List of commits:
Subject Hash Author Date (UTC)
Initial commit bfb7298e48367d2ac0924811b4950f3066ff075c mse 2021-05-22 05:08:16
Commit bfb7298e48367d2ac0924811b4950f3066ff075c - Initial commit
Author: mse
Author date (UTC): 2021-05-22 05:08
Committer name: mse
Committer date (UTC): 2021-05-22 05:08
Parent(s):
Signer:
Signing key:
Signing status: N
Tree: 77382ace9386689def92d71e57ee72091ae506d2
File Lines added Lines deleted
.gitignore 13 0
COPYING 339 0
Confectioner.command 4 0
Makefile 271 0
README.md 60 0
caveconfec 4 0
caveconfec.bat 4 0
confec.cpp 6347 0
data/dialogue_en/init.json 12 0
data/glsl/postfx.frag 36 0
data/items.json 193 0
data/sounds/sounds.json 15 0
data/ui/Confectioner.ttf 0 0
data/ui/button_n.png 0 0
data/ui/button_p.png 0 0
data/ui/cursor.bmp 0 0
data/ui/en.ttf 0 0
gamecontrollerdb.txt 954 0
include/SDL2/SDL.h 138 0
include/SDL2/SDL_assert.h 293 0
include/SDL2/SDL_atomic.h 295 0
include/SDL2/SDL_audio.h 859 0
include/SDL2/SDL_bits.h 121 0
include/SDL2/SDL_blendmode.h 123 0
include/SDL2/SDL_clipboard.h 71 0
include/SDL2/SDL_config.h 288 0
include/SDL2/SDL_cpuinfo.h 299 0
include/SDL2/SDL_egl.h 1676 0
include/SDL2/SDL_endian.h 263 0
include/SDL2/SDL_error.h 112 0
include/SDL2/SDL_events.h 827 0
include/SDL2/SDL_filesystem.h 136 0
include/SDL2/SDL_gamecontroller.h 541 0
include/SDL2/SDL_gesture.h 87 0
include/SDL2/SDL_haptic.h 1247 0
include/SDL2/SDL_hints.h 1578 0
include/SDL2/SDL_joystick.h 499 0
include/SDL2/SDL_keyboard.h 217 0
include/SDL2/SDL_keycode.h 351 0
include/SDL2/SDL_loadso.h 81 0
include/SDL2/SDL_locale.h 101 0
include/SDL2/SDL_log.h 211 0
include/SDL2/SDL_main.h 180 0
include/SDL2/SDL_messagebox.h 146 0
include/SDL2/SDL_metal.h 117 0
include/SDL2/SDL_misc.h 75 0
include/SDL2/SDL_mouse.h 302 0
include/SDL2/SDL_mutex.h 251 0
include/SDL2/SDL_name.h 33 0
include/SDL2/SDL_opengl.h 2183 0
include/SDL2/SDL_opengl_glext.h 11180 0
include/SDL2/SDL_opengles.h 39 0
include/SDL2/SDL_opengles2.h 52 0
include/SDL2/SDL_opengles2_gl2.h 621 0
include/SDL2/SDL_opengles2_gl2ext.h 2050 0
include/SDL2/SDL_opengles2_gl2platform.h 30 0
include/SDL2/SDL_opengles2_khrplatform.h 282 0
include/SDL2/SDL_pixels.h 479 0
include/SDL2/SDL_platform.h 198 0
include/SDL2/SDL_power.h 75 0
include/SDL2/SDL_quit.h 58 0
include/SDL2/SDL_rect.h 174 0
include/SDL2/SDL_render.h 1158 0
include/SDL2/SDL_revision.h 2 0
include/SDL2/SDL_rwops.h 283 0
include/SDL2/SDL_scancode.h 413 0
include/SDL2/SDL_sensor.h 267 0
include/SDL2/SDL_shape.h 144 0
include/SDL2/SDL_stdinc.h 647 0
include/SDL2/SDL_surface.h 563 0
include/SDL2/SDL_system.h 325 0
include/SDL2/SDL_syswm.h 354 0
include/SDL2/SDL_test.h 69 0
include/SDL2/SDL_test_assert.h 105 0
include/SDL2/SDL_test_common.h 218 0
include/SDL2/SDL_test_compare.h 69 0
include/SDL2/SDL_test_crc32.h 124 0
include/SDL2/SDL_test_font.h 81 0
include/SDL2/SDL_test_fuzzer.h 384 0
include/SDL2/SDL_test_harness.h 134 0
include/SDL2/SDL_test_images.h 78 0
include/SDL2/SDL_test_log.h 67 0
include/SDL2/SDL_test_md5.h 129 0
include/SDL2/SDL_test_memory.h 63 0
include/SDL2/SDL_test_random.h 115 0
include/SDL2/SDL_thread.h 366 0
include/SDL2/SDL_timer.h 115 0
include/SDL2/SDL_touch.h 102 0
include/SDL2/SDL_types.h 29 0
include/SDL2/SDL_version.h 162 0
include/SDL2/SDL_video.h 1282 0
include/SDL2/SDL_vulkan.h 276 0
include/SDL2/begin_code.h 166 0
include/SDL2/close_code.h 40 0
include/civilian.h 165 0
include/cute_sound.h 2719 0
include/dialogue.h 344 0
include/en_to_zh.h 307 0
include/enzhtest.cpp 34 0
include/fg2/fg2.h 2551 0
include/fg2/glad_gl.h 4559 0
include/fg2/glad_gles2.h 1453 0
include/fg2/linalg.h 721 0
include/fg3/fg3.h 2777 0
include/fg3/glad_gl.h 3385 0
include/fg3/glad_gles2.h 2587 0
include/fg3/linalg.h 721 0
include/fighter.h 182 0
include/flora.h 273 0
include/force_link_glibc_2.25.h 3728 0
include/fseq.h 78 0
include/fworld.h 2113 0
include/genalg.h 246 0
include/ini.h 1057 0
include/micropather.h 511 0
include/ne.h 529 0
include/proc.h 86 0
include/stb_image.h 7762 0
include/stb_perlin.h 367 0
include/stb_truetype.h 5011 0
include/stb_vorbis.c 5575 0
include/tm_json.h 3830 0
include/wolf.h 131 0
libs.cpp 43 0
micropather.cpp 1081 0
openjdk.pem 2451 0
steam_appid.txt 1 0
File .gitignore added (mode: 100644) (index 0000000..227abf3)
1 *.a
2 *.o
3 *.so
4 *.dll
5 *.dylib
6 *.framework
7 *.tar.*
8 *.zip
9 *boost*
10 SDL2-*
11 include/steam
12 cave-*
13 confec-*
File COPYING added (mode: 100644) (index 0000000..d159169)
1 GNU GENERAL PUBLIC LICENSE
2 Version 2, June 1991
3
4 Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6 Everyone is permitted to copy and distribute verbatim copies
7 of this license document, but changing it is not allowed.
8
9 Preamble
10
11 The licenses for most software are designed to take away your
12 freedom to share and change it. By contrast, the GNU General Public
13 License is intended to guarantee your freedom to share and change free
14 software--to make sure the software is free for all its users. This
15 General Public License applies to most of the Free Software
16 Foundation's software and to any other program whose authors commit to
17 using it. (Some other Free Software Foundation software is covered by
18 the GNU Lesser General Public License instead.) You can apply it to
19 your programs, too.
20
21 When we speak of free software, we are referring to freedom, not
22 price. Our General Public Licenses are designed to make sure that you
23 have the freedom to distribute copies of free software (and charge for
24 this service if you wish), that you receive source code or can get it
25 if you want it, that you can change the software or use pieces of it
26 in new free programs; and that you know you can do these things.
27
28 To protect your rights, we need to make restrictions that forbid
29 anyone to deny you these rights or to ask you to surrender the rights.
30 These restrictions translate to certain responsibilities for you if you
31 distribute copies of the software, or if you modify it.
32
33 For example, if you distribute copies of such a program, whether
34 gratis or for a fee, you must give the recipients all the rights that
35 you have. You must make sure that they, too, receive or can get the
36 source code. And you must show them these terms so they know their
37 rights.
38
39 We protect your rights with two steps: (1) copyright the software, and
40 (2) offer you this license which gives you legal permission to copy,
41 distribute and/or modify the software.
42
43 Also, for each author's protection and ours, we want to make certain
44 that everyone understands that there is no warranty for this free
45 software. If the software is modified by someone else and passed on, we
46 want its recipients to know that what they have is not the original, so
47 that any problems introduced by others will not reflect on the original
48 authors' reputations.
49
50 Finally, any free program is threatened constantly by software
51 patents. We wish to avoid the danger that redistributors of a free
52 program will individually obtain patent licenses, in effect making the
53 program proprietary. To prevent this, we have made it clear that any
54 patent must be licensed for everyone's free use or not licensed at all.
55
56 The precise terms and conditions for copying, distribution and
57 modification follow.
58
59 GNU GENERAL PUBLIC LICENSE
60 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
62 0. This License applies to any program or other work which contains
63 a notice placed by the copyright holder saying it may be distributed
64 under the terms of this General Public License. The "Program", below,
65 refers to any such program or work, and a "work based on the Program"
66 means either the Program or any derivative work under copyright law:
67 that is to say, a work containing the Program or a portion of it,
68 either verbatim or with modifications and/or translated into another
69 language. (Hereinafter, translation is included without limitation in
70 the term "modification".) Each licensee is addressed as "you".
71
72 Activities other than copying, distribution and modification are not
73 covered by this License; they are outside its scope. The act of
74 running the Program is not restricted, and the output from the Program
75 is covered only if its contents constitute a work based on the
76 Program (independent of having been made by running the Program).
77 Whether that is true depends on what the Program does.
78
79 1. You may copy and distribute verbatim copies of the Program's
80 source code as you receive it, in any medium, provided that you
81 conspicuously and appropriately publish on each copy an appropriate
82 copyright notice and disclaimer of warranty; keep intact all the
83 notices that refer to this License and to the absence of any warranty;
84 and give any other recipients of the Program a copy of this License
85 along with the Program.
86
87 You may charge a fee for the physical act of transferring a copy, and
88 you may at your option offer warranty protection in exchange for a fee.
89
90 2. You may modify your copy or copies of the Program or any portion
91 of it, thus forming a work based on the Program, and copy and
92 distribute such modifications or work under the terms of Section 1
93 above, provided that you also meet all of these conditions:
94
95 a) You must cause the modified files to carry prominent notices
96 stating that you changed the files and the date of any change.
97
98 b) You must cause any work that you distribute or publish, that in
99 whole or in part contains or is derived from the Program or any
100 part thereof, to be licensed as a whole at no charge to all third
101 parties under the terms of this License.
102
103 c) If the modified program normally reads commands interactively
104 when run, you must cause it, when started running for such
105 interactive use in the most ordinary way, to print or display an
106 announcement including an appropriate copyright notice and a
107 notice that there is no warranty (or else, saying that you provide
108 a warranty) and that users may redistribute the program under
109 these conditions, and telling the user how to view a copy of this
110 License. (Exception: if the Program itself is interactive but
111 does not normally print such an announcement, your work based on
112 the Program is not required to print an announcement.)
113
114 These requirements apply to the modified work as a whole. If
115 identifiable sections of that work are not derived from the Program,
116 and can be reasonably considered independent and separate works in
117 themselves, then this License, and its terms, do not apply to those
118 sections when you distribute them as separate works. But when you
119 distribute the same sections as part of a whole which is a work based
120 on the Program, the distribution of the whole must be on the terms of
121 this License, whose permissions for other licensees extend to the
122 entire whole, and thus to each and every part regardless of who wrote it.
123
124 Thus, it is not the intent of this section to claim rights or contest
125 your rights to work written entirely by you; rather, the intent is to
126 exercise the right to control the distribution of derivative or
127 collective works based on the Program.
128
129 In addition, mere aggregation of another work not based on the Program
130 with the Program (or with a work based on the Program) on a volume of
131 a storage or distribution medium does not bring the other work under
132 the scope of this License.
133
134 3. You may copy and distribute the Program (or a work based on it,
135 under Section 2) in object code or executable form under the terms of
136 Sections 1 and 2 above provided that you also do one of the following:
137
138 a) Accompany it with the complete corresponding machine-readable
139 source code, which must be distributed under the terms of Sections
140 1 and 2 above on a medium customarily used for software interchange; or,
141
142 b) Accompany it with a written offer, valid for at least three
143 years, to give any third party, for a charge no more than your
144 cost of physically performing source distribution, a complete
145 machine-readable copy of the corresponding source code, to be
146 distributed under the terms of Sections 1 and 2 above on a medium
147 customarily used for software interchange; or,
148
149 c) Accompany it with the information you received as to the offer
150 to distribute corresponding source code. (This alternative is
151 allowed only for noncommercial distribution and only if you
152 received the program in object code or executable form with such
153 an offer, in accord with Subsection b above.)
154
155 The source code for a work means the preferred form of the work for
156 making modifications to it. For an executable work, complete source
157 code means all the source code for all modules it contains, plus any
158 associated interface definition files, plus the scripts used to
159 control compilation and installation of the executable. However, as a
160 special exception, the source code distributed need not include
161 anything that is normally distributed (in either source or binary
162 form) with the major components (compiler, kernel, and so on) of the
163 operating system on which the executable runs, unless that component
164 itself accompanies the executable.
165
166 If distribution of executable or object code is made by offering
167 access to copy from a designated place, then offering equivalent
168 access to copy the source code from the same place counts as
169 distribution of the source code, even though third parties are not
170 compelled to copy the source along with the object code.
171
172 4. You may not copy, modify, sublicense, or distribute the Program
173 except as expressly provided under this License. Any attempt
174 otherwise to copy, modify, sublicense or distribute the Program is
175 void, and will automatically terminate your rights under this License.
176 However, parties who have received copies, or rights, from you under
177 this License will not have their licenses terminated so long as such
178 parties remain in full compliance.
179
180 5. You are not required to accept this License, since you have not
181 signed it. However, nothing else grants you permission to modify or
182 distribute the Program or its derivative works. These actions are
183 prohibited by law if you do not accept this License. Therefore, by
184 modifying or distributing the Program (or any work based on the
185 Program), you indicate your acceptance of this License to do so, and
186 all its terms and conditions for copying, distributing or modifying
187 the Program or works based on it.
188
189 6. Each time you redistribute the Program (or any work based on the
190 Program), the recipient automatically receives a license from the
191 original licensor to copy, distribute or modify the Program subject to
192 these terms and conditions. You may not impose any further
193 restrictions on the recipients' exercise of the rights granted herein.
194 You are not responsible for enforcing compliance by third parties to
195 this License.
196
197 7. If, as a consequence of a court judgment or allegation of patent
198 infringement or for any other reason (not limited to patent issues),
199 conditions are imposed on you (whether by court order, agreement or
200 otherwise) that contradict the conditions of this License, they do not
201 excuse you from the conditions of this License. If you cannot
202 distribute so as to satisfy simultaneously your obligations under this
203 License and any other pertinent obligations, then as a consequence you
204 may not distribute the Program at all. For example, if a patent
205 license would not permit royalty-free redistribution of the Program by
206 all those who receive copies directly or indirectly through you, then
207 the only way you could satisfy both it and this License would be to
208 refrain entirely from distribution of the Program.
209
210 If any portion of this section is held invalid or unenforceable under
211 any particular circumstance, the balance of the section is intended to
212 apply and the section as a whole is intended to apply in other
213 circumstances.
214
215 It is not the purpose of this section to induce you to infringe any
216 patents or other property right claims or to contest validity of any
217 such claims; this section has the sole purpose of protecting the
218 integrity of the free software distribution system, which is
219 implemented by public license practices. Many people have made
220 generous contributions to the wide range of software distributed
221 through that system in reliance on consistent application of that
222 system; it is up to the author/donor to decide if he or she is willing
223 to distribute software through any other system and a licensee cannot
224 impose that choice.
225
226 This section is intended to make thoroughly clear what is believed to
227 be a consequence of the rest of this License.
228
229 8. If the distribution and/or use of the Program is restricted in
230 certain countries either by patents or by copyrighted interfaces, the
231 original copyright holder who places the Program under this License
232 may add an explicit geographical distribution limitation excluding
233 those countries, so that distribution is permitted only in or among
234 countries not thus excluded. In such case, this License incorporates
235 the limitation as if written in the body of this License.
236
237 9. The Free Software Foundation may publish revised and/or new versions
238 of the General Public License from time to time. Such new versions will
239 be similar in spirit to the present version, but may differ in detail to
240 address new problems or concerns.
241
242 Each version is given a distinguishing version number. If the Program
243 specifies a version number of this License which applies to it and "any
244 later version", you have the option of following the terms and conditions
245 either of that version or of any later version published by the Free
246 Software Foundation. If the Program does not specify a version number of
247 this License, you may choose any version ever published by the Free Software
248 Foundation.
249
250 10. If you wish to incorporate parts of the Program into other free
251 programs whose distribution conditions are different, write to the author
252 to ask for permission. For software which is copyrighted by the Free
253 Software Foundation, write to the Free Software Foundation; we sometimes
254 make exceptions for this. Our decision will be guided by the two goals
255 of preserving the free status of all derivatives of our free software and
256 of promoting the sharing and reuse of software generally.
257
258 NO WARRANTY
259
260 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261 FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262 OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263 PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264 OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266 TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267 PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268 REPAIR OR CORRECTION.
269
270 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272 REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273 INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274 OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275 TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276 YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277 PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278 POSSIBILITY OF SUCH DAMAGES.
279
280 END OF TERMS AND CONDITIONS
281
282 How to Apply These Terms to Your New Programs
283
284 If you develop a new program, and you want it to be of the greatest
285 possible use to the public, the best way to achieve this is to make it
286 free software which everyone can redistribute and change under these terms.
287
288 To do so, attach the following notices to the program. It is safest
289 to attach them to the start of each source file to most effectively
290 convey the exclusion of warranty; and each file should have at least
291 the "copyright" line and a pointer to where the full notice is found.
292
293 <one line to give the program's name and a brief idea of what it does.>
294 Copyright (C) <year> <name of author>
295
296 This program is free software; you can redistribute it and/or modify
297 it under the terms of the GNU General Public License as published by
298 the Free Software Foundation; either version 2 of the License, or
299 (at your option) any later version.
300
301 This program is distributed in the hope that it will be useful,
302 but WITHOUT ANY WARRANTY; without even the implied warranty of
303 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304 GNU General Public License for more details.
305
306 You should have received a copy of the GNU General Public License along
307 with this program; if not, write to the Free Software Foundation, Inc.,
308 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309
310 Also add information on how to contact you by electronic and paper mail.
311
312 If the program is interactive, make it output a short notice like this
313 when it starts in an interactive mode:
314
315 Gnomovision version 69, Copyright (C) year name of author
316 Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317 This is free software, and you are welcome to redistribute it
318 under certain conditions; type `show c' for details.
319
320 The hypothetical commands `show w' and `show c' should show the appropriate
321 parts of the General Public License. Of course, the commands you use may
322 be called something other than `show w' and `show c'; they could even be
323 mouse-clicks or menu items--whatever suits your program.
324
325 You should also get your employer (if you work as a programmer) or your
326 school, if any, to sign a "copyright disclaimer" for the program, if
327 necessary. Here is a sample; alter the names:
328
329 Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330 `Gnomovision' (which makes passes at compilers) written by James Hacker.
331
332 <signature of Ty Coon>, 1 April 1989
333 Ty Coon, President of Vice
334
335 This General Public License does not permit incorporating your program into
336 proprietary programs. If your program is a subroutine library, you may
337 consider it more useful to permit linking proprietary applications with the
338 library. If this is what you want to do, use the GNU Lesser General
339 Public License instead of this License.
File Confectioner.command added (mode: 100755) (index 0000000..45aea81)
1 #!/bin/sh
2
3 cd $(dirname "$0")
4 ./confec-mac
File Makefile added (mode: 100644) (index 0000000..5eceb14)
1 PROGRAM=confec
2 PROGRAM_DRMFREE=cave-confec
3 INCLUDES=include/fworld.h include/civilian.h
4
5 # SDL2
6 SDL2_VER=2.0.14
7 SDL2_DIR=SDL2-$(SDL2_VER)
8 SDL2_TAR=$(SDL2_DIR).tar.gz
9 SDL2_WIN_TAR=SDL2-devel-$(SDL2_VER)-mingw.tar.gz
10
11 # Poco
12 POCO_OPTIONS=-DENABLE_DATA=OFF -DENABLE_DATA_MYSQL=OFF
13 POCO_VER=1.10.1
14 # Checks libversion every invocation.
15 POCO_LIBVER=$(shell tr -d '\r\n' < $(POCO_DIR)/libversion)
16 POCO_DIR=poco-$(POCO_VER)-all
17 POCO_TAR=$(POCO_DIR).tar.bz2
18 POCO_FOUNDATION=libPocoFoundation.so.$(POCO_LIBVER)
19 POCO_NET=libPocoNet.so.$(POCO_LIBVER)
20 POCO_NETSSL=libPocoNetSSL.so.$(POCO_LIBVER)
21 POCO_CRYPTO=libPocoCrypto.so.$(POCO_LIBVER)
22 POCO_LINKS=-l:$(POCO_FOUNDATION) -l:$(POCO_NET) -l:$(POCO_NETSSL) -l:$(POCO_CRYPTO)
23
24 # Boost
25 BOOST_VER_MAJOR=1
26 BOOST_VER_MINOR=76
27 BOOST_VER_PATCH=0
28 BOOST_VER_DOTTED=$(BOOST_VER_MAJOR).$(BOOST_VER_MINOR).$(BOOST_VER_PATCH)
29 BOOST_DIR=boost_$(BOOST_VER_MAJOR)_$(BOOST_VER_MINOR)_$(BOOST_VER_PATCH)
30 BOOST_TAR=$(BOOST_DIR).tar.bz2
31
32 # OpenSSL
33 OPENSSL_VER_MAJOR=1
34 OPENSSL_VER_MINOR=1
35 OPENSSL_VER_PATCH=1g
36 OPENSSL_VER_DOTTED=$(OPENSSL_VER_MAJOR).$(OPENSSL_VER_MINOR).$(OPENSSL_VER_PATCH)
37 OPENSSL_DIR=openssl-$(OPENSSL_VER_DOTTED)
38 OPENSSL_TAR=$(OPENSSL_DIR).tar.gz
39
40 LINCC := gcc -march=x86-64 -include $(shell readlink -f include/force_link_glibc_2.25.h)
41 LINCXX := $(CXX) -march=x86-64 -include $(shell readlink -f include/force_link_glibc_2.25.h)
42 CXXDYNAMIC=$(LINCXX) $(CXXFLAGS) -O3 -D__LIGHT__ -o $(PROGRAM)-dynamic $(PROGRAM).cpp libs.o libboost_system.a -Wl,-rpath,. -L. -l:libSDL2.so -lssl -lcrypto -pthread -lsteam_api
43 MACCXX=clang++ -march=x86-64
44 WINCXX=i686-w64-mingw32-g++-posix -march=pentium4 -static-libgcc -static-libstdc++
45 CXXFLAGS=-Iinclude -I$(OPENSSL_DIR)/include -I$(BOOST_DIR) -I$(POCO_DIR)/Foundation/include -I$(POCO_DIR)/Net/include -I$(POCO_DIR)/NetSSL_OpenSSL/include -I$(POCO_DIR)/Crypto/include -std=c++14 -Wall -Wextra -Wfatal-errors
46 WIN_CMAKE_FLAGS=-DCMAKE_C_COMPILER=i686-w64-mingw32-gcc-win32 -DCMAKE_CXX_COMPILER=i686-w64-mingw32-g++-win32 -DCMAKE_C_COMPILER_WORKS=1 -DCMAKE_CXX_COMPILER_WORKS=1
47 MAC_OPENSSL_SSL=libssl-mac.a
48 MAC_OPENSSL_CRYPTO=libcrypto-mac.a
49 WIN_OPENSSL_SSL=libssl-$(OPENSSL_VER_MAJOR)_$(OPENSSL_VER_MINOR).dll
50 WIN_OPENSSL_CRYPTO=libcrypto-$(OPENSSL_VER_MAJOR)_$(OPENSSL_VER_MINOR).dll
51 WEB_PREFIX=sudo docker run --rm -v $(shell pwd):/src -u emscripten trzeci/emscripten
52 WEB_FLAGS_LEGACY=-s TOTAL_MEMORY=134217728
53 WEB_FLAGS_NEW=-s INITIAL_MEMORY=134217728
54 WEB_FLAGS=$(WEB_FLAGS_LEGACY) -fno-rtti -fno-exceptions --llvm-lto 1 -s ELIMINATE_DUPLICATE_FUNCTIONS=1 -s "ENVIRONMENT='web'" -s USE_SDL=0 -s SIMD=0 -s WASM=0 -s "EXTRA_EXPORTED_RUNTIME_METHODS=['Pointer_stringify']" --preload-file data
55 WEB_SDL_OPT=--disable-render --disable-render-d3d --disable-directx --disable-video-vulkan --disable-filesystem --disable-diskaudio --disable-dummyaudio --disable-libudev --disable-haptic
56 WEB_SDL_CONFIGURE=emconfigure ../configure --host=asmjs-unknown-emscripten --disable-assembly --disable-threads --disable-cpuinfo $(WEB_SDL_OPT)
57
58 # Uncomment the line below to default to the DRM-free version.
59 drmfree-gnu: $(PROGRAM_DRMFREE)
60
61 steam-gnu: $(PROGRAM)-static
62
63 $(PROGRAM)-static: libs.o libboost_system.a libSDL2.a $(PROGRAM).cpp $(INCLUDES)
64 # Building Steam version for GNU/Linux.
65 $(LINCXX) $(CXXFLAGS) -static-libgcc -static-libstdc++ -O3 -D__LIGHT__ -D__STEAM__ -o $@ $(PROGRAM).cpp libs.o libboost_system.a libSDL2.a \
66 -Wl,-rpath,. -L. -ldl -lssl -lcrypto -pthread -lsteam_api
67
68 $(PROGRAM_DRMFREE): libs.o libboost_system.a libSDL2.a $(PROGRAM).cpp $(INCLUDES)
69 # Building DRM-free version for GNU/Linux.
70 $(LINCXX) $(CXXFLAGS) -static-libgcc -static-libstdc++ -O3 -D__LIGHT__ -o $@ $(PROGRAM).cpp libs.o libboost_system.a libSDL2.a \
71 -Wl,-rpath,. -L. -ldl -lssl -lcrypto -pthread
72
73 $(PROGRAM)-dynamic: libs.o libboost_system.a $(PROGRAM).cpp $(INCLUDES)
74 $(CXXDYNAMIC)
75
76 # VR support, lol. Not currently implemented.
77 ccvr: libs.o libboost_system.a libSDL2.a $(PROGRAM).cpp $(INCLUDES)
78 $(LINCXX) $(CXXFLAGS) -static-libgcc -static-libstdc++ -O3 -D__LIGHT__ -D__STEAM__ -o $@ $(PROGRAM).cpp libs.o libboost_system.a libSDL2.a \
79 -Wl,-rpath,. -L. -ldl -lssl -lcrypto -pthread -lopenxr_loader -lsteam_api
80
81 debug: clean libs.o libboost_system.a libSDL2.a $(PROGRAM).cpp
82 $(LINCXX) -Iinclude -I$(BOOST_DIR) -std=c++14 -Wall -Wextra -Wfatal-errors -g -D__STEAM__ -o $@ $(PROGRAM).cpp libs.o libboost_system.a libSDL2.a -Wl,-rpath,. -L. -ldl -lssl -lcrypto -pthread -lsteam_api $(POCO_LINKS)
83
84 lint:
85 clang-tidy $(PROGRAM).cpp -checks=cert-*-cpp -header-filter=fdungeon.h -- $(CXXDYNAMIC)
86
87 drmfree: $(PROGRAM_DRMFREE) $(PROGRAM_DRMFREE).exe
88
89 demo: $(PROGRAM)-demo-static $(PROGRAM)-demo.exe
90
91 $(PROGRAM)-demo-static: libs.o libboost_system.a libSDL2.a $(PROGRAM).cpp $(INCLUDES)
92 $(LINCXX) $(CXXFLAGS) -static-libgcc -static-libstdc++ -O3 -D__LIGHT__ -D__STEAM__ -D__DEMO__ -o $@ $(PROGRAM).cpp libs.o libboost_system.a libSDL2.a \
93 -Wl,-rpath,. -L. -ldl -lssl -lcrypto -pthread -lsteam_api
94
95 $(PROGRAM)-demo.exe: libs-win.o libboost_system-win.a $(WIN_OPENSSL_SSL) $(WIN_OPENSSL_CRYPTO) $(PROGRAM).cpp $(INCLUDES)
96 $(WINCXX) $(CXXFLAGS) -I$(OPENSSL_DIR)/include -O3 -D__LIGHT__ -D__STEAM__ -D__DEMO__ -o $@ $(PROGRAM).cpp libs-win.o libboost_system-win.a \
97 -L. -l:$(WIN_OPENSSL_SSL) -l:$(WIN_OPENSSL_CRYPTO) -lwsock32 -lws2_32 -lmingw32 -l:SDL2.dll -l:libSDL2main.a -l:steam_api.dll \
98 -static -lpthread
99
100 ccserver: ccserver.cpp $(INCLUDES)
101 $(LINCXX) $(CXXFLAGS) -O3 -o $@ ccserver.cpp -Wl,-rpath,. -L. -pthread -l:$(POCO_FOUNDATION) -l:$(POCO_NET)
102
103 libs.o: libs.cpp micropather.cpp include/tm_json.h $(BOOST_DIR)
104 $(LINCXX) $(CXXFLAGS) -O3 -o $@ libs.cpp -c
105
106 # Build SDL2 for Linux as compatibly as possible.
107 libSDL2.a: $(SDL2_DIR)
108 rm -r -f $(SDL2_DIR)/build
109 mkdir -p $(SDL2_DIR)/build
110 export CC="$(LINCC)" ;\
111 cd $(SDL2_DIR)/build; ../configure --disable-sndio --disable-esd \
112 --disable-arts --disable-video-directfb --disable-rpath \
113 --enable-alsa --enable-alsa-shared --enable-pulseaudio \
114 --enable-pulseaudio-shared --enable-x11-shared --enable-sdl-dlopen \
115 --disable-input-tslib CFLAGS="-O3" && make
116 cp $(SDL2_DIR)/build/build/.libs/libSDL2.a $@
117 touch $@
118
119 $(PROGRAM)-mac: libs-mac.o SDL2.framework $(MAC_OPENSSL_SSL) $(MAC_OPENSSL_CRYPTO) $(PROGRAM).cpp $(INCLUDES)
120 # Building Steam version for Mac.
121 $(MACCXX) $(CXXFLAGS) -O3 -D__LIGHT__ -D__STEAM__ -o $@ $(PROGRAM).cpp libs-mac.o $(MAC_OPENSSL_SSL) $(MAC_OPENSSL_CRYPTO) \
122 -F. -L. -Wl,-rpath,"." -framework SDL2 -ldl -pthread -lsteam_api
123
124 $(PROGRAM_DRMFREE)-mac: libs-mac.o SDL2.framework $(MAC_OPENSSL_SSL) $(MAC_OPENSSL_CRYPTO) $(PROGRAM).cpp $(INCLUDES)
125 # Building DRM-free version for Mac.
126 $(MACCXX) $(CXXFLAGS) -O3 -D__LIGHT__ -o $@ $(PROGRAM).cpp libs-mac.o $(MAC_OPENSSL_SSL) $(MAC_OPENSSL_CRYPTO) \
127 -F. -L. -Wl,-rpath,"." -framework SDL2 -ldl -pthread
128
129 libs-mac.o: libs.cpp micropather.cpp include/tm_json.h $(BOOST_DIR)
130 $(MACCXX) $(CXXFLAGS) -O3 -o $@ libs.cpp -c
131
132 $(PROGRAM).exe: libs-win.o libboost_system-win.a $(WIN_OPENSSL_SSL) $(WIN_OPENSSL_CRYPTO) $(PROGRAM).cpp $(INCLUDES)
133 $(WINCXX) $(CXXFLAGS) -I$(OPENSSL_DIR)/include -O3 -D__LIGHT__ -D__STEAM__ -o $@ $(PROGRAM).cpp libs-win.o libboost_system-win.a \
134 -L. -l:$(WIN_OPENSSL_SSL) -l:$(WIN_OPENSSL_CRYPTO) -lwsock32 -lws2_32 -lmingw32 -l:SDL2.dll -l:libSDL2main.a -l:steam_api.dll \
135 -static -lpthread
136
137 $(PROGRAM_DRMFREE).exe: libs-win.o libboost_system-win.a $(WIN_OPENSSL_SSL) $(WIN_OPENSSL_CRYPTO) $(PROGRAM).cpp $(INCLUDES)
138 # Building DRM-free version for Windows.
139 $(WINCXX) $(CXXFLAGS) -I$(OPENSSL_DIR)/include -O3 -D__LIGHT__ -o $@ $(PROGRAM).cpp libs-win.o libboost_system-win.a \
140 -L. -l:$(WIN_OPENSSL_SSL) -l:$(WIN_OPENSSL_CRYPTO) -lwsock32 -lws2_32 -lmingw32 -l:SDL2.dll -l:libSDL2main.a \
141 -static -lpthread
142
143 libs-win.o: include/SDL2 libSDL2main.a SDL2.dll libs.cpp micropather.cpp include/tm_json.h $(BOOST_DIR) $(OPENSSL_DIR)
144 $(WINCXX) $(CXXFLAGS) -I$(OPENSSL_DIR)/include -O3 -o $@ libs.cpp -c
145
146 include/SDL2: $(SDL2_WIN_TAR)
147 $(RM) -r $@
148 tar xzvf $(SDL2_WIN_TAR) --strip-components=2 SDL2-$(SDL2_VER)/i686-w64-mingw32/$@
149 touch $@
150
151 libSDL2main.a: $(SDL2_WIN_TAR)
152 tar xzvf $(SDL2_WIN_TAR) --strip-components=3 SDL2-$(SDL2_VER)/i686-w64-mingw32/lib/$@
153 touch $@
154
155 SDL2.dll: $(SDL2_WIN_TAR)
156 tar xzvf $(SDL2_WIN_TAR) --strip-components=3 SDL2-$(SDL2_VER)/i686-w64-mingw32/bin/$@
157 touch $@
158
159 $(SDL2_WIN_TAR):
160 wget https://libsdl.org/release/$(SDL2_WIN_TAR)
161
162 html: libs-web.o libSDL2-web.a $(PROGRAM).cpp $(INCLUDES)
163 mkdir -p $@
164 $(WEB_PREFIX) emcc $(WEB_FLAGS) $(CXXFLAGS) --closure 1 -Oz -D__LIGHT__ -o $@/index.html $(PROGRAM).cpp libs-web.o libSDL2-web.a -lwebsocket.js
165
166 web: index-template.html web/index.js
167 cp -f index-template.html $@/index.html
168 cp -f favicon.ico $@
169 touch $@
170
171 web/index.js: libs-web.o libSDL2-web.a $(PROGRAM).cpp $(INCLUDES)
172 mkdir -p web
173 $(WEB_PREFIX) emcc $(WEB_FLAGS) $(CXXFLAGS) --closure 1 -Oz -D__LIGHT__ -o $@ $(PROGRAM).cpp libs-web.o libSDL2-web.a -lwebsocket.js
174
175 libs-web.o: libs.cpp micropather.cpp include/tm_json.h
176 $(WEB_PREFIX) emcc $(WEB_FLAGS) $(CXXFLAGS) -Oz -o $@ libs.cpp -c
177
178 libSDL2-web.a: $(SDL2_DIR)
179 rm -r -f $(SDL2_DIR)/build
180 mkdir -p $(SDL2_DIR)/build
181 $(WEB_PREFIX) /bin/bash -c "cd $(SDL2_DIR)/build; $(WEB_SDL_CONFIGURE) CFLAGS=\"-Oz\" && emmake make"
182 cp $(SDL2_DIR)/build/build/.libs/libSDL2.a $@
183 touch $@
184
185 $(SDL2_DIR): $(SDL2_TAR)
186 $(RM) -r $@
187 tar xvf $(SDL2_TAR)
188 touch $@
189
190 $(SDL2_TAR):
191 wget https://libsdl.org/release/$(SDL2_TAR)
192
193 $(POCO_NET): $(POCO_DIR)
194 mkdir -p $(POCO_DIR)/build
195 cd $(POCO_DIR)/build; cmake $(POCO_OPTIONS) -DCMAKE_BUILD_TYPE=Release .. && make
196 mv $(POCO_DIR)/build/lib/$(POCO_FOUNDATION) .
197 mv $(POCO_DIR)/build/lib/$(POCO_NET) .
198 mv $(POCO_DIR)/build/lib/$(POCO_NETSSL) .
199 mv $(POCO_DIR)/build/lib/$(POCO_CRYPTO) .
200
201 winpoco: $(POCO_DIR)
202 mkdir -p $(POCO_DIR)/build
203 cd $(POCO_DIR)/build; cmake $(POCO_OPTIONS) $(WIN_CMAKE_FLAGS) -DCMAKE_TOOLCHAIN_FILE=../../cross-mingw32-linux.cmake -DCMAKE_BUILD_TYPE=Release .. && make
204 #mv $(POCO_DIR)/build/lib/$(WIN_POCO_FOUNDATION) .
205 #mv $(POCO_DIR)/build/lib/$(WIN_POCO_NET) .
206 #mv $(POCO_DIR)/build/lib/$(WIN_POCO_NETSSL) .
207 #mv $(POCO_DIR)/build/lib/$(WIN_POCO_CRYPTO) .
208
209 $(POCO_DIR): $(POCO_TAR)
210 $(RM) -r $@
211 tar xvf $(POCO_TAR)
212 touch $@
213
214 $(POCO_TAR):
215 wget https://pocoproject.org/releases/poco-$(POCO_VER)/$(POCO_TAR)
216
217 libboost_system.a: $(BOOST_DIR)
218 cp $(BOOST_DIR)/stage/lib/$@ .
219 touch $@
220
221 libboost_system-win.a: $(BOOST_DIR)
222 # Windows target
223 # https://stackoverflow.com/questions/5411282#11907834
224 # https://stackoverflow.com/questions/27342524#55919915
225 cd $(BOOST_DIR) && \
226 echo "using gcc : mingw32 : i686-w64-mingw32-g++-posix ;" > win-config.jam && \
227 ./bootstrap.sh && \
228 ./b2 --with-system --user-config=win-config.jam toolset=gcc-mingw32 target-os=windows cxxflags="-std=c++11" --layout=tagged architecture=x86 address-model=32 release
229 touch $(BOOST_DIR)
230 cp $(BOOST_DIR)/stage/lib/libboost_system-mt-x32.a $@
231 touch $@
232
233 $(BOOST_DIR): $(BOOST_TAR)
234 $(RM) -r $@
235 tar xvf $(BOOST_TAR)
236 # POSIX target
237 cd $@ && ./bootstrap.sh && ./b2 --with-system cxxflags="-std=c++11" release
238 touch $@
239
240 $(BOOST_TAR):
241 wget https://boostorg.jfrog.io/artifactory/main/release/$(BOOST_VER_DOTTED)/source/$(BOOST_TAR)
242
243 $(MAC_OPENSSL_SSL): $(OPENSSL_DIR)
244 # Mac target
245 cd $(OPENSSL_DIR) && ./Configure gcc && make
246 touch $(OPENSSL_DIR)
247 cp $(OPENSSL_DIR)/libssl.a $(MAC_OPENSSL_SSL)
248 touch $(MAC_OPENSSL_SSL)
249 cp $(OPENSSL_DIR)/libcrypto.a $(MAC_OPENSSL_CRYPTO)
250 touch $(MAC_OPENSSL_CRYPTO)
251
252 $(WIN_OPENSSL_SSL): $(OPENSSL_DIR)
253 # Windows target
254 cd $(OPENSSL_DIR) && ./Configure mingw --cross-compile-prefix=i686-w64-mingw32- && make
255 touch $(OPENSSL_DIR)
256 cp $(OPENSSL_DIR)/$(WIN_OPENSSL_SSL) .
257 touch $(WIN_OPENSSL_SSL)
258 cp $(OPENSSL_DIR)/$(WIN_OPENSSL_CRYPTO) .
259 touch $(WIN_OPENSSL_CRYPTO)
260
261 $(OPENSSL_DIR): $(OPENSSL_TAR)
262 $(RM) -r $@
263 tar xvf $(OPENSSL_TAR)
264 touch $@
265
266 $(OPENSSL_TAR):
267 wget https://www.openssl.org/source/$(OPENSSL_TAR)
268
269 clean:
270 $(RM) debug $(PROGRAM)-static $(PROGRAM)-dynamic $(PROGRAM_DRMFREE) $(PROGRAM)-demo-static libs.o \
271 $(PROGRAM).exe $(PROGRAM_DRMFREE).exe $(PROGRAM)-demo.exe libs-win.o libs-web.o ccserver
File README.md added (mode: 100644) (index 0000000..081d051)
1 # Confectioner Engine
2
3 This repository contains the engine and some permissively licensed third-party code.
4
5 Though Confectioner Engine is FLOSS (see: COPYING), Cave Confectioner is proprietary. This restriction exists regardless of the licensing of the engine. Please don't name products "Cave Confectioner".
6
7 After compiling, place the data folder from a commercial Cave Confectioner release in this folder, then run the game.
8
9 # Compiling
10
11 To be on the safe side, you should have a spare 2 GB of storage to build. The makefile uses wget to download compressed archives from the Internet: source code for GNU/Linux, binaries for Windows. Steam and Mac libraries currently must be downloaded manually if you target Steam or Mac.
12
13 ## Dependencies
14
15 * A Unix-compatible environment (GNU/Linux, Mac, or possibly BSD)
16 * GCC or Clang
17 * MinGW (only if targeting Windows)
18 * CMake
19 * wget
20 * tar
21 * Boost (source downloaded automatically for any target platform, HUGE when extracted)
22 - *Poco is NOT used anymore, but its ghost floats around the code*
23 * OpenSSL 1.1 (system version used on GNU/Linux, downloaded for other platforms)
24 * SDL 2.0.x (source downloaded automatically for GNU/Linux, binaries for Windows)
25 * SDL's dependencies (only if building for GNU/Linux, see below)
26
27 To install many of the core dependencies on Debian/Ubuntu/Mint/Trisquel:
28
29 sudo apt install build-essential libsdl2-dev \
30 libegl1-mesa-dev libgl1-mesa-dev libgles2-mesa-dev \
31 libxrandr-dev libxi-dev libasound2-dev libpulse-dev libudev-dev
32
33 To compile on GNU/Linux, simply run `make`, or read the makefile for other target platforms and configurations. The default DRM-free executable is called **cave-confec**.
34
35 If you care to update non-executable dependencies, here is where to get them:
36
37 **openjdk.pem**
38
39 * OpenJDK SSL trust store, which is used in the Windows build.
40 * https://github.com/nabla-c0d3/trust_stores_observatory
41
42 **gamecontrollerdb.txt**
43
44 * Used by SDL to recognize game controllers and assign mappings.
45 * https://github.com/gabomdq/SDL_GameControllerDB
46
47 # Tools used
48
49 These tools are used for programming and content creation. They are not needed for compilation, but you can use them to expand, rework, or mod the game.
50
51 * Geany - code editing
52 * Tiled - maps
53 * GIMP - sprites
54 * Audacity - audio
55
56 All of the tools are cross-platform and can be installed on free systems as well as Windows and Mac.
57
58 To install the tools on Debian/Ubuntu/Mint/Trisquel:
59
60 sudo apt install geany tiled gimp audacity
File caveconfec added (mode: 100755) (index 0000000..84cb138)
1 #!/bin/sh
2
3 # Use the LD_PRELOAD trick to test the game with the Steam overlay.
4 LD_PRELOAD=~/.steam/steam/ubuntu12_64/gameoverlayrenderer.so ./confec-static
File caveconfec.bat added (mode: 100755) (index 0000000..41b0ef2)
1 @echo off
2
3 confec
4 pause
The diff for file confec.cpp is too big (6347 changes) and cannot be shown.
File data/dialogue_en/init.json added (mode: 100644) (index 0000000..f413890)
1 {
2 "init": {
3 "bg": "black",
4 "caption": "Game not found.",
5 "lines": [ "Quit" ],
6 "ids": [ "quit" ]
7 },
8
9 "quit": {
10 "exec": { "void": "CALLBACK QUIT" }
11 }
12 }
File data/glsl/postfx.frag added (mode: 100644) (index 0000000..e4a8994)
1 /*
2 Formerly a bloom shader, now a simpler brightness shader.
3 Switches to a red vignette when u_fog.a < 0.001.
4 u_fog contains bloom parameters (not fog). u_fog.a is set to 0.0
5 when player health <= 25 so damage can be indicated visually.
6 */
7
8 uniform sampler2D u_texture;
9 uniform vec4 u_fog;
10 uniform vec3 u_camera;
11 in vec2 v_UV;
12 in vec4 v_RelativePos;
13 out vec4 fragColor;
14
15 void main(){
16 float threshold = u_fog.z;
17 float amount = u_fog.w;
18
19 // Create a more pleasant hue.
20 vec3 color = texture( u_texture, v_UV ).rgb * vec3( 1.04, 1.02, 1.0 );
21
22 float value = color.r * 0.3 + color.g * 0.6 + color.b * 0.1;
23 vec3 result =
24 color * ( max( value - threshold, 0.0 ) * 0.8 + ( value > threshold ? 0.4 : 0.0 ) );
25
26 if( u_fog.a < 0.001 ){
27 // Red vignette.
28 vec2 c = v_UV * 2.0 - 1.0;
29 float f = dot( c, c * c * c ) * 0.5;
30 fragColor =
31 vec4( mix( color + result * amount, vec3( 1.0, 0.0, 0.0 ), f ), 1.0 );
32 }else{
33 // No vignette.
34 fragColor = vec4( color + result * amount, 1.0 );
35 }
36 }
File data/items.json added (mode: 100644) (index 0000000..ac3bff4)
1 {
2 /*
3 // For detailed information on how items are interpreted, see fworld.h.
4 // Examples:
5 "10_Alice": { // This is a hypothetical selectable character with properties matching those seen in Tiled.
6 "icon": "icons/character-alice.png",
7 "entity": {
8 "gid":1,
9 "id":1,
10 "type":"player",
11 "width":32,
12 "height":32,
13 "rotation":0,
14 "visible":true,
15 "properties": {
16 "age":0.0,
17 "animationMode":0,
18 "bribeFail":"",
19 "bribeItems":"",
20 "bribeNewDialogue":"",
21 "bribeSuccess":"",
22 "collisionSize":24.0,
23 "dialogue":"",
24 "direction":1,
25 "fps":7.5,
26 "health":100,
27 "inventory":"",
28 "karma":50,
29 "money":0,
30 "meleeDamage":30,
31 "meleeRecovery":0.33,
32 "meleeSpriteImage":"alice-melee.png",
33 "shadowImage":"shadow32.png",
34 "sleepImage":"alice-sleep.png",
35 "speed":3.75,
36 "spriteHeight":64,
37 "spriteImage":"alice.png",
38 "spriteWidth":32
39 }
40 }
41 },
42 "100": { // This is a special item (see: Steam Inventory Service) which may be available to DRM-free players via hardcoded values in confec.cpp.
43 "icon": "special/100.png"
44 },
45 "gen_pine": { // This is a pine tree that can be placed in the world by a procedural generator.
46 "entity": {
47 "gid":1,
48 "id":1,
49 "name":"",
50 "type":"static",
51 "width":32,
52 "height":32,
53 "rotation":0,
54 "visible":true,
55 "properties": {
56 "age":0,
57 "animationMode":0,
58 "bribeFail":"",
59 "bribeItems":"",
60 "bribeNewDialogue":"",
61 "bribeSuccess":"",
62 "collisionSize":18,
63 "dialogue":"",
64 "direction":0,
65 "fps":10,
66 "health":0,
67 "inventory":"",
68 "money":0,
69 "shadowImage":"",
70 "spriteHeight":96,
71 "spriteImage":"pine.png",
72 "spriteWidth":48
73 }
74 }
75 },
76 "Campfire": { // This is an item that cannot be collected or placed directly, but is merely symbolic (appears as an ingredient on a player's recipe screen).
77 "icon": "icons/fire.png"
78 },
79 "Apple": { // This is an unbaked apple with an entity that overrides the default entity when placed in the world.
80 "icon": "icons/apple-raw.png",
81 "stack": 9,
82 "flavor": 20,
83 "appearance": 25,
84 "sweetness": 40,
85 "lactose": 0,
86 "price": 1,
87 "entity": {
88 "gid":1,
89 "id":1,
90 "name":"apple",
91 "type":"pickup",
92 "width":32,
93 "height":32,
94 "rotation":0,
95 "visible":true,
96 "properties": {
97 "age":0,
98 "animationMode":0,
99 "block":false,
100 "bribeFail":"",
101 "bribeItems":"",
102 "bribeNewDialogue":"",
103 "bribeSuccess":"",
104 "collisionSize":0,
105 "dialogue":"",
106 "direction":0,
107 "fps":10,
108 "health":0,
109 "inventory":"Apple;1",
110 "money":0,
111 "shadowImage":"",
112 "spriteHeight":32,
113 "spriteImage":"apple-entity.png",
114 "spriteWidth":32
115 }
116 }
117 },
118 "Baked Apple": { // Baked version of the above.
119 "icon": "icons/apple-baked.png",
120 "stack": 9,
121 "flavor": 25,
122 "appearance": 25,
123 "sweetness": 50,
124 "lactose": 0,
125 "price": 1,
126 "yield": 1,
127 "recipe": { "Apple": 1, "Campfire": -1 },
128 "entity": {
129 "gid":1,
130 "id":1,
131 "name":"baked apple",
132 "type":"pickup",
133 "width":32,
134 "height":32,
135 "rotation":0,
136 "visible":true,
137 "properties": {
138 "age":0,
139 "animationMode":0,
140 "block":false,
141 "bribeFail":"",
142 "bribeItems":"",
143 "bribeNewDialogue":"",
144 "bribeSuccess":"",
145 "collisionSize":0,
146 "dialogue":"",
147 "direction":0,
148 "fps":10,
149 "health":0,
150 "inventory":"Baked Apple;1",
151 "money":0,
152 "shadowImage":"",
153 "spriteHeight":32,
154 "spriteImage":"apple-baked-entity.png",
155 "spriteWidth":32
156 }
157 }
158 },
159 "Raw Fillet": { // A simple non-edible item with a recipe and a byproduct. Set flavor to > 0 to make it edible.
160 "icon": "icons/fillet-raw.png",
161 "stack": 9,
162 "flavor": 0,
163 "appearance": 25,
164 "sweetness": 0,
165 "lactose": 0,
166 "price": 1,
167 "yield": 2,
168 "recipe": { "Raw Meat": 1, "Knife": -1 },
169 "byproducts": { "Lard": 1 }
170 },
171 "Pastry Crust": { // A simple edible item with a recipe.
172 "icon": "icons/pastrycrust.png",
173 "stack": 9,
174 "flavor": 20,
175 "appearance": 10,
176 "sweetness": 8,
177 "lactose": 0,
178 "price": 1,
179 "yield": 1,
180 "recipe": { "Flour": 1, "Lard": 1 }
181 },
182 "Ghost Pepper": { // When eaten, damages health (because sweetness is -9999) and runs a script. (See calculations in the Eat function in confec.cpp.)
183 "icon": "icons/pepper-ghost.png",
184 "stack": 9,
185 "flavor": 30,
186 "appearance": 30,
187 "sweetness": -9999,
188 "lactose": 0,
189 "price": 4,
190 "script": "#PLAYSOUND hot"
191 },
192 */
193 }
File data/sounds/sounds.json added (mode: 100644) (index 0000000..eb335f0)
1 {
2 /*
3 // Syntax:
4 "my_sound": { "file": "my_sound.wav", "volume": 1.0 },
5 "my_other_sound": { "file": "music.ogg", "volume": 0.9 },
6 "my_sound_with_reverb": {
7 "file": "my_sound.wav",
8 "volume": 0.7,
9 "reverbEchoes": 6,
10 "reverbVolumeFactor": 0.6,
11 "reverbDelay": 0.012,
12 "reverbDelayFactor": 0.55
13 }
14 */
15 }
File data/ui/Confectioner.ttf added (mode: 100755) (index 0000000..40bf263)
File data/ui/button_n.png added (mode: 100755) (index 0000000..78bb78e)
File data/ui/button_p.png added (mode: 100755) (index 0000000..5ae1b5d)
File data/ui/cursor.bmp added (mode: 100644) (index 0000000..719e3c6)
File data/ui/en.ttf added (mode: 100644) (index 0000000..8a406e9)
File gamecontrollerdb.txt added (mode: 100644) (index 0000000..3ab2f70)
1 # Game Controller DB for SDL in 2.0.9 format
2 # Source: https://github.com/gabomdq/SDL_GameControllerDB
3
4 # Windows
5 03000000fa2d00000100000000000000,3DRUDDER,leftx:a0,lefty:a1,rightx:a5,righty:a2,platform:Windows,
6 03000000c82d00002038000000000000,8bitdo,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows,
7 03000000c82d000011ab000000000000,8BitDo F30,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows,
8 03000000c82d00001038000000000000,8BitDo F30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows,
9 03000000c82d00000090000000000000,8BitDo FC30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows,
10 03000000c82d00000650000000000000,8BitDo M30,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:a4,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:b7,start:b11,x:b3,y:b4,platform:Windows,
11 03000000c82d00005106000000000000,8BitDo M30 Gamepad,a:b1,b:b0,back:b10,guide:b2,leftshoulder:b6,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b9,start:b11,x:b4,y:b3,platform:Windows,
12 03000000c82d00000310000000000000,8BitDo N30,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Windows,
13 03000000c82d00002028000000000000,8BitDo N30,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows,
14 03000000c82d00008010000000000000,8BitDo N30,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Windows,
15 03000000c82d00000190000000000000,8BitDo N30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows,
16 03000000c82d00001590000000000000,8BitDo N30 Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows,
17 03000000c82d00006528000000000000,8BitDo N30 Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows,
18 03000000022000000090000000000000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows,
19 03000000203800000900000000000000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows,
20 03000000c82d00000130000000000000,8BitDo SF30,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows,
21 03000000c82d00000060000000000000,8Bitdo SF30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Windows,
22 03000000c82d00000061000000000000,8Bitdo SF30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Windows,
23 03000000c82d000021ab000000000000,8BitDo SFC30,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Windows,
24 03000000102800000900000000000000,8Bitdo SFC30 GamePad,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Windows,
25 03000000c82d00003028000000000000,8Bitdo SFC30 GamePad,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Windows,
26 03000000c82d00000030000000000000,8BitDo SN30,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Windows,
27 03000000c82d00000351000000000000,8BitDo SN30,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows,
28 03000000c82d00001290000000000000,8BitDo SN30,a:b1,b:b0,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Windows,
29 03000000c82d000020ab000000000000,8BitDo SN30,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows,
30 03000000c82d00004028000000000000,8BitDo SN30,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows,
31 03000000c82d00006228000000000000,8BitDo SN30,a:b1,b:b0,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Windows,
32 03000000c82d00000160000000000000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Windows,
33 03000000c82d00000161000000000000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Windows,
34 03000000c82d00000260000000000000,8BitDo SN30 Pro+,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Windows,
35 03000000c82d00000261000000000000,8BitDo SN30 Pro+,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Windows,
36 03000000c82d00000031000000000000,8BitDo Wireless Adapter,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,
37 03000000c82d00001890000000000000,8BitDo Zero 2,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Windows,
38 03000000c82d00003032000000000000,8BitDo Zero 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Windows,
39 03000000a00500003232000000000000,8Bitdo Zero GamePad,a:b0,b:b1,back:b10,dpdown:+a2,dpleft:-a0,dpright:+a0,dpup:-a2,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Windows,
40 030000008f0e00001200000000000000,Acme GA-02,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b2,y:b3,platform:Windows,
41 03000000c01100000355000011010000,ACRUX USB GAME PAD,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
42 03000000fa190000f0ff000000000000,Acteck AGJ-3200,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
43 030000006f0e00001413000000000000,Afterglow,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
44 03000000341a00003608000000000000,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
45 030000006f0e00000263000000000000,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
46 030000006f0e00001101000000000000,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
47 030000006f0e00001401000000000000,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
48 030000006f0e00001402000000000000,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
49 030000006f0e00001901000000000000,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
50 030000006f0e00001a01000000000000,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
51 03000000d62000001d57000000000000,Airflo PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
52 03000000869800002400000000007801,Astro C40 TR,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,
53 03000000d6200000e557000000000000,Batarang,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
54 03000000c01100001352000000000000,Battalife Joystick,a:b6,b:b7,back:b2,leftshoulder:b0,leftx:a0,lefty:a1,rightshoulder:b1,start:b3,x:b4,y:b5,platform:Windows,
55 030000006f0e00003201000000000000,Battlefield 4 PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
56 03000000d62000002a79000000000000,BDA PS4 Fightpad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
57 03000000bc2000006012000000000000,Betop 2126F,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
58 03000000bc2000000055000000000000,Betop BFM Gamepad,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,
59 03000000bc2000006312000000000000,Betop Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
60 03000000bc2000006321000000000000,BETOP CONTROLLER,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
61 03000000bc2000006412000000000000,Betop Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
62 03000000c01100000555000000000000,Betop Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
63 03000000c01100000655000000000000,Betop Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
64 03000000790000000700000000000000,Betop Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b3,y:b0,platform:Windows,
65 03000000808300000300000000000000,Betop Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b3,y:b0,platform:Windows,
66 030000006b1400000055000000000000,Bigben PS3 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,
67 030000006b1400000103000000000000,Bigben PS3 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b2,platform:Windows,
68 0300000066f700000500000000000000,BrutalLegendTest,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b3,platform:Windows,
69 03000000d81d00000b00000000000000,BUFFALO BSGP1601 Series ,a:b5,b:b3,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b8,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b9,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b13,x:b4,y:b2,platform:Windows,
70 03000000e82000006058000000000000,Cideko AK08b,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
71 03000000457500000401000000000000,Cobra,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
72 030000005e0400008e02000000000000,Controller (XBOX 360 For Windows),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:+a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:-a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,
73 030000005e040000a102000000000000,Controller (Xbox 360 Wireless Receiver for Windows),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:+a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:-a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,
74 030000005e040000ff02000000000000,Controller (Xbox One For Windows) - Wired,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:+a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:-a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,
75 030000005e040000ea02000000000000,Controller (Xbox One For Windows) - Wireless,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:+a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:-a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,
76 03000000260900008888000000000000,Cyber Gadget GameCube Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:a4,rightx:a2,righty:a3~,start:b7,x:b2,y:b3,platform:Windows,
77 03000000a306000022f6000000000000,Cyborg V.3 Rumble Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:+a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:-a3,rightx:a2,righty:a4,start:b9,x:b0,y:b3,platform:Windows,
78 03000000451300000830000000000000,Defender Game Racer X7,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,
79 030000007d0400000840000000000000,Destroyer Tiltpad,+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b1,b:b2,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,x:b0,y:b3,platform:Windows,
80 03000000791d00000103000000000000,Dual Box WII,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
81 03000000bd12000002e0000000000000,Dual USB Vibration Joystick,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b9,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b10,righttrigger:b5,rightx:a3,righty:a2,start:b11,x:b3,y:b0,platform:Windows,
82 030000008f0e00000910000000000000,DualShock 2,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b9,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b10,righttrigger:b5,rightx:a3,righty:a2,start:b11,x:b3,y:b0,platform:Windows,
83 030000006f0e00003001000000000000,EA SPORTS PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
84 03000000b80500000410000000000000,Elecom Gamepad,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b1,platform:Windows,
85 03000000b80500000610000000000000,Elecom Gamepad,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b1,platform:Windows,
86 03000000120c0000f61c000000000000,Elite,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
87 030000008f0e00000f31000000000000,EXEQ,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b2,platform:Windows,
88 03000000341a00000108000000000000,EXEQ RF USB Gamepad 8206,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,
89 030000006f0e00008401000000000000,Faceoff Deluxe+ Audio Wired Controller for Nintendo Switch,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
90 030000006f0e00008001000000000000,Faceoff Wired Pro Controller for Nintendo Switch,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
91 03000000852100000201000000000000,FF-GP1,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
92 030000000d0f00008500000000000000,Fighting Commander 2016 PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
93 030000000d0f00008400000000000000,Fighting Commander 5,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
94 030000000d0f00008700000000000000,Fighting Stick mini 4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows,
95 030000000d0f00008800000000000000,Fighting Stick mini 4,a:b1,b:b2,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b8,x:b0,y:b3,platform:Windows,
96 030000000d0f00002700000000000000,FIGHTING STICK V3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows,
97 78696e70757403000000000000000000,Fightstick TES,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,lefttrigger:a2,rightshoulder:b5,righttrigger:a5,start:b7,x:b2,y:b3,platform:Windows,
98 03000000790000002201000000000000,Game Controller for PC,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
99 0300000066f700000100000000000000,Game VIB Joystick,a:b2,b:b3,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a3,righty:a2,start:b11,x:b0,y:b1,platform:Windows,
100 03000000260900002625000000000000,Gamecube Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,lefttrigger:a4,leftx:a0,lefty:a1,righttrigger:a5,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Windows,
101 03000000790000004618000000000000,GameCube Controller Adapter,a:b1,b:b2,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,rightx:a5,righty:a2,start:b9,x:b0,y:b3,platform:Windows,
102 030000008f0e00000d31000000000000,GAMEPAD 3 TURBO,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
103 03000000280400000140000000000000,GamePad Pro USB,a:b1,b:b2,back:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows,
104 03000000ac0500003d03000000000000,GameSir,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,
105 03000000ac0500004d04000000000000,GameSir,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,
106 03000000ffff00000000000000000000,GameStop Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,
107 03000000c01100000140000000000000,GameStop PS4 Fun Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
108 030000006f0e00000102000000007801,GameStop Xbox 360 Wired Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,
109 030000009b2800003200000000000000,GC/N64 to USB v3.4,a:b0,b:b7,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,lefttrigger:+a5,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:+a2,rightx:a3,righty:a4,start:b3,x:b1,y:b8,platform:Windows,
110 030000009b2800006000000000000000,GC/N64 to USB v3.6,a:b0,b:b7,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,lefttrigger:+a5,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:+a2,rightx:a3,righty:a4,start:b3,x:b1,y:b8,platform:Windows,
111 030000008305000009a0000000000000,Genius,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,
112 030000008305000031b0000000000000,Genius Maxfire Blaze 3,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,
113 03000000451300000010000000000000,Genius Maxfire Grandias 12,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,
114 030000005c1a00003330000000000000,Genius MaxFire Grandias 12V,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b4,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b2,y:b3,platform:Windows,
115 03000000300f00000b01000000000000,GGE909 Recoil Pad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Windows,
116 03000000f0250000c283000000000000,Gioteck,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
117 03000000f025000021c1000000000000,Gioteck PS3 Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
118 03000000f0250000c383000000000000,Gioteck VX2 Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
119 03000000f0250000c483000000000000,Gioteck VX2 Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
120 030000007d0400000540000000000000,Gravis Eliminator GamePad Pro,a:b1,b:b2,back:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows,
121 03000000341a00000302000000000000,Hama Scorpad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
122 030000000d0f00004900000000000000,Hatsune Miku Sho Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
123 030000001008000001e1000000000000,Havit HV-G60,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b3,y:b0,platform:Windows,
124 03000000d81400000862000000000000,HitBox Edition Cthulhu+,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b5,lefttrigger:b4,rightshoulder:b7,righttrigger:b6,start:b9,x:b0,y:b3,platform:Windows,
125 03000000632500002605000000000000,HJD-X,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,
126 030000000d0f00002d00000000000000,Hori Fighting Commander 3 Pro,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
127 030000000d0f00005f00000000000000,Hori Fighting Commander 4 (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
128 030000000d0f00005e00000000000000,Hori Fighting Commander 4 (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
129 030000000d0f00004000000000000000,Hori Fighting Stick Mini 3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b5,lefttrigger:b4,rightshoulder:b7,righttrigger:b6,start:b9,x:b0,y:b3,platform:Windows,
130 030000000d0f00005400000000000000,Hori Pad 3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
131 030000000d0f00000900000000000000,Hori Pad 3 Turbo,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
132 030000000d0f00004d00000000000000,Hori Pad A,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
133 030000000d0f00009200000000000000,Hori Pokken Tournament DX Pro Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows,
134 030000000d0f00001600000000007803,HORI Real Arcade Pro EX-SE (Xbox 360),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,lefttrigger:a2,rightshoulder:b5,righttrigger:a5,start:b7,x:b2,y:b3,platform:Windows,
135 030000000d0f00009c00000000000000,Hori TAC Pro,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
136 030000000d0f0000c100000000000000,Horipad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
137 030000000d0f00006e00000000000000,HORIPAD 4 (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
138 030000000d0f00006600000000000000,HORIPAD 4 (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
139 030000000d0f00005500000000000000,Horipad 4 FPS,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
140 030000000d0f0000ee00000000000000,HORIPAD mini4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
141 03000000250900000017000000000000,HRAP2 on PS/SS/N64 Joypad to USB BOX,a:b2,b:b1,back:b9,leftshoulder:b5,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b6,start:b8,x:b3,y:b0,platform:Windows,
142 030000008f0e00001330000000000000,HuiJia SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b9,x:b3,y:b0,platform:Windows,
143 03000000d81d00000f00000000000000,iBUFFALO BSGP1204 Series,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
144 03000000d81d00001000000000000000,iBUFFALO BSGP1204P Series,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
145 03000000830500006020000000000000,iBuffalo SNES Controller,a:b1,b:b0,back:b6,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b7,x:b3,y:b2,platform:Windows,
146 03000000b50700001403000000000000,Impact Black,a:b2,b:b3,back:b8,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Windows,
147 030000006f0e00002401000000000000,INJUSTICE FightStick PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows,
148 03000000ac0500002c02000000000000,IPEGA,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b8,leftstick:b13,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b9,rightstick:b14,righttrigger:b7,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,
149 03000000491900000204000000000000,Ipega PG-9023,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,
150 03000000491900000304000000000000,Ipega PG-9087 - Bluetooth Gamepad,+righty:+a5,-righty:-a4,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,start:b11,x:b3,y:b4,platform:Windows,
151 030000006e0500000a20000000000000,JC-DUX60 ELECOM MMO Gamepad,a:b2,b:b3,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b8,leftstick:b14,lefttrigger:b12,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b15,righttrigger:b13,rightx:a3,righty:a4,start:b20,x:b0,y:b1,platform:Windows,
152 030000006e0500000520000000000000,JC-P301U,a:b2,b:b3,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3,start:b11,x:b0,y:b1,platform:Windows,
153 030000006e0500000320000000000000,JC-U3613M (DInput),a:b2,b:b3,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3,start:b11,x:b0,y:b1,platform:Windows,
154 030000006e0500000720000000000000,JC-W01U,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b1,platform:Windows,
155 030000007e0500000620000000000000,Joy-Con (L),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b13,leftshoulder:b4,leftstick:b10,rightshoulder:b5,start:b8,x:b2,y:b3,platform:Windows,
156 030000007e0500000620000001000000,Joy-Con (L),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b13,leftshoulder:b4,leftstick:b10,rightshoulder:b5,start:b8,x:b2,y:b3,platform:Windows,
157 030000007e0500000720000000000000,Joy-Con (R),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b12,leftshoulder:b4,leftstick:b11,rightshoulder:b5,start:b9,x:b2,y:b3,platform:Windows,
158 030000007e0500000720000001000000,Joy-Con (R),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b12,leftshoulder:b4,leftstick:b11,rightshoulder:b5,start:b9,x:b2,y:b3,platform:Windows,
159 03000000bd12000003c0000000000000,JY-P70UR,a:b1,b:b0,back:b5,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b8,rightstick:b11,righttrigger:b9,rightx:a3,righty:a2,start:b4,x:b3,y:b2,platform:Windows,
160 03000000242f00002d00000000000000,JYS Wireless Adapter,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
161 03000000242f00008a00000000000000,JYS Wireless Adapter,a:b1,b:b4,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b0,y:b3,platform:Windows,
162 03000000790000000200000000000000,King PS3 Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b3,y:b0,platform:Windows,
163 030000006d040000d1ca000000000000,Logitech ChillStream,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
164 030000006d040000d2ca000000000000,Logitech Cordless Precision,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
165 030000006d04000011c2000000000000,Logitech Cordless Wingman,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b5,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b2,righttrigger:b7,rightx:a3,righty:a4,x:b4,platform:Windows,
166 030000006d04000016c2000000000000,Logitech Dual Action,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
167 030000006d04000018c2000000000000,Logitech F510 Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
168 030000006d04000019c2000000000000,Logitech F710 Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
169 030000006d0400001ac2000000000000,Logitech Precision Gamepad,a:b1,b:b2,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows,
170 030000006d0400000ac2000000000000,Logitech WingMan RumblePad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b2,rightx:a3,righty:a4,x:b3,y:b4,platform:Windows,
171 03000000380700006652000000000000,Mad Catz C.T.R.L.R,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b0,y:b3,platform:Windows,
172 03000000380700005032000000000000,Mad Catz FightPad PRO (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
173 03000000380700005082000000000000,Mad Catz FightPad PRO (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
174 03000000380700008433000000000000,Mad Catz FightStick TE S+ (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
175 03000000380700008483000000000000,Mad Catz FightStick TE S+ (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
176 03000000380700008134000000000000,Mad Catz FightStick TE2+ PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b7,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b4,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
177 03000000380700008184000000000000,Mad Catz FightStick TE2+ PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b5,leftstick:b10,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b4,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
178 03000000380700006252000000000000,Mad Catz Micro C.T.R.L.R,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b0,y:b3,platform:Windows,
179 03000000380700008034000000000000,Mad Catz TE2 PS3 Fightstick,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
180 03000000380700008084000000000000,Mad Catz TE2 PS4 Fightstick,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
181 03000000380700008532000000000000,Madcatz Arcade Fightstick TE S PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
182 03000000380700003888000000000000,Madcatz Arcade Fightstick TE S+ PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
183 03000000380700001888000000000000,MadCatz SFIV FightStick PS3,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b5,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b4,righttrigger:b6,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,
184 03000000380700008081000000000000,MADCATZ SFV Arcade FightStick Alpha PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
185 030000002a0600001024000000000000,Matricom,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b2,y:b3,platform:Windows,
186 03000000250900000128000000000000,Mayflash Arcade Stick,a:b1,b:b2,back:b8,leftshoulder:b0,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b3,righttrigger:b7,start:b9,x:b5,y:b6,platform:Windows,
187 03000000790000004418000000000000,Mayflash GameCube Controller,a:b1,b:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b0,y:b3,platform:Windows,
188 03000000790000004318000000000000,Mayflash GameCube Controller Adapter,a:b1,b:b2,back:b0,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b0,leftshoulder:b4,leftstick:b0,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b0,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b0,y:b3,platform:Windows,
189 03000000242f00007300000000000000,Mayflash Magic NS,a:b1,b:b4,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b0,y:b3,platform:Windows,
190 0300000079000000d218000000000000,Mayflash Magic NS,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
191 03000000d620000010a7000000000000,Mayflash Magic NS,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
192 030000008f0e00001030000000000000,Mayflash USB Adapter for original Sega Saturn controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b5,rightshoulder:b2,righttrigger:b7,start:b9,x:b3,y:b4,platform:Windows,
193 0300000025090000e803000000000000,Mayflash Wii Classic Controller,a:b1,b:b0,back:b8,dpdown:b13,dpleft:b12,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b2,platform:Windows,
194 03000000790000000018000000000000,Mayflash WiiU Pro Game Controller Adapter (DInput),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
195 03000000790000002418000000000000,Mega Drive,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,rightshoulder:b2,start:b9,x:b3,y:b4,platform:Windows,
196 03000000380700006382000000000000,MLG GamePad PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
197 03000000c62400002a89000000000000,MOGA XP5-A Plus,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b15,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,
198 03000000c62400002b89000000000000,MOGA XP5-A Plus,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,
199 03000000c62400001a89000000000000,MOGA XP5-X Plus,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,
200 03000000c62400001b89000000000000,MOGA XP5-X Plus,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,
201 03000000efbe0000edfe000000000000,Monect Virtual Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b0,platform:Windows,
202 03000000250900006688000000000000,MP-8866 Super Dual Box,a:b2,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Windows,
203 030000006b140000010c000000000000,NACON GC-400ES,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,
204 030000001008000001e5000000000000,NEXT SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,righttrigger:b6,start:b9,x:b3,y:b0,platform:Windows,
205 03000000152000000182000000000000,NGDS,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b3,y:b0,platform:Windows,
206 03000000bd12000015d0000000000000,Nintendo Retrolink USB Super SNES Classic Controller,a:b2,b:b1,back:b8,leftshoulder:b4,leftx:a0,lefty:a1,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Windows,
207 030000007e0500000920000000000000,Nintendo Switch Pro Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,
208 030000000d0500000308000000000000,Nostromo N45,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b12,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b10,x:b2,y:b3,platform:Windows,
209 03000000550900001472000000000000,NVIDIA Controller v01.04,a:b11,b:b10,back:b13,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b7,leftstick:b5,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b4,righttrigger:a5,rightx:a3,righty:a6,start:b3,x:b9,y:b8,platform:Windows,
210 030000004b120000014d000000000000,NYKO AIRFLO,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:a3,leftstick:a0,lefttrigger:b6,rightshoulder:b5,rightstick:a2,righttrigger:b7,start:b9,x:b2,y:b3,platform:Windows,
211 03000000782300000a10000000000000,Onlive Wireless Controller,a:b15,b:b14,back:b7,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b11,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a3,righty:a4,start:b6,x:b13,y:b12,platform:Windows,
212 03000000d62000006d57000000000000,OPP PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
213 030000006b14000001a1000000000000,Orange Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b2,y:b3,platform:Windows,
214 03000000362800000100000000000000,OUYA Game Controller,a:b0,b:b3,dpdown:b9,dpleft:b10,dpright:b11,dpup:b8,guide:b14,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:b13,rightx:a3,righty:a4,x:b1,y:b2,platform:Windows,
215 03000000120c0000f60e000000000000,P4 Wired Gamepad,a:b1,b:b2,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b5,lefttrigger:b7,rightshoulder:b4,righttrigger:b6,start:b9,x:b0,y:b3,platform:Windows,
216 030000006f0e00000901000000000000,PDP Versus Fighting Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows,
217 030000008f0e00000300000000000000,Piranha xtreme,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Windows,
218 030000004c050000da0c000000000000,PlayStation Classic Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,lefttrigger:b4,rightshoulder:b7,righttrigger:b5,start:b9,x:b3,y:b0,platform:Windows,
219 03000000d62000006dca000000000000,PowerA Pro Ex,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
220 03000000d62000009557000000000000,Pro Elite PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
221 03000000d62000009f31000000000000,Pro Ex mini PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
222 03000000d6200000c757000000000000,Pro Ex mini PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
223 03000000632500002306000000000000,PS Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Windows,
224 03000000e30500009605000000000000,PS to USB convert cable,a:b2,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Windows,
225 03000000100800000100000000000000,PS1 Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Windows,
226 030000008f0e00007530000000000000,PS1 Controller,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b1,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
227 03000000100800000300000000000000,PS2 Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a4,righty:a2,start:b9,x:b3,y:b0,platform:Windows,
228 03000000250900008888000000000000,PS2 Controller,a:b2,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Windows,
229 03000000666600006706000000000000,PS2 Controller,a:b2,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,leftshoulder:b6,leftstick:b9,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b10,righttrigger:b5,rightx:a2,righty:a3,start:b11,x:b3,y:b0,platform:Windows,
230 030000006b1400000303000000000000,PS2 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,
231 030000009d0d00001330000000000000,PS2 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,
232 03000000250900000500000000000000,PS3 Controller,a:b2,b:b1,back:b9,dpdown:h0.8,dpleft:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b0,y:b3,platform:Windows,
233 030000004c0500006802000000000000,PS3 Controller,a:b2,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b10,lefttrigger:a3~,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:a4~,rightx:a2,righty:a5,start:b8,x:b3,y:b0,platform:Windows,
234 03000000632500007505000000000000,PS3 Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
235 03000000888800000803000000000000,PS3 Controller,a:b2,b:b1,back:b8,dpdown:h0.8,dpleft:h0.4,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b9,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:b7,rightx:a3,righty:a4,start:b11,x:b0,y:b3,platform:Windows,
236 030000008f0e00001431000000000000,PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
237 030000003807000056a8000000000000,PS3 RF pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
238 03000000100000008200000000000000,PS360+ v1.66,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:h0.4,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows,
239 030000004c050000a00b000000000000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
240 030000004c050000c405000000000000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
241 030000004c050000cc09000000000000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
242 030000004c050000e60c000000000000,PS5 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,misc1:b13,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
243 03000000300f00000011000000000000,QanBa Arcade JoyStick 1008,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b10,x:b0,y:b3,platform:Windows,
244 03000000300f00001611000000000000,QanBa Arcade JoyStick 4018,a:b1,b:b2,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b8,x:b0,y:b3,platform:Windows,
245 03000000222c00000020000000000000,QANBA DRONE ARCADE JOYSTICK,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:a3,rightshoulder:b5,righttrigger:a4,start:b9,x:b0,y:b3,platform:Windows,
246 03000000300f00001210000000000000,QanBa Joystick Plus,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,rightshoulder:b5,start:b9,x:b2,y:b3,platform:Windows,
247 03000000341a00000104000000000000,QanBa Joystick Q4RAF,a:b5,b:b6,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b0,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b3,righttrigger:b7,start:b9,x:b1,y:b2,platform:Windows,
248 03000000222c00000223000000000000,Qanba Obsidian Arcade Joystick PS3 Mode,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
249 03000000222c00000023000000000000,Qanba Obsidian Arcade Joystick PS4 Mode,a:b1,b:b2,back:b13,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
250 03000000321500000003000000000000,Razer Hydra,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,
251 03000000321500000204000000000000,Razer Panthera (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
252 03000000321500000104000000000000,Razer Panthera (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
253 03000000321500000507000000000000,Razer Raiju Mobile,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,
254 03000000321500000707000000000000,Razer Raiju Mobile,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,
255 03000000321500000011000000000000,Razer Raion Fightpad for PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
256 03000000321500000009000000000000,Razer Serval,+lefty:+a2,-lefty:-a1,a:b0,b:b1,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,leftx:a0,rightshoulder:b5,rightstick:b9,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,
257 030000000d0f00001100000000000000,REAL ARCADE PRO.3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,rightshoulder:b5,rightstick:b11,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows,
258 030000000d0f00006a00000000000000,Real Arcade Pro.4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
259 030000000d0f00006b00000000000000,Real Arcade Pro.4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
260 030000000d0f00008a00000000000000,Real Arcade Pro.4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
261 030000000d0f00008b00000000000000,Real Arcade Pro.4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
262 030000000d0f00007000000000000000,REAL ARCADE PRO.4 VLX,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,rightshoulder:b5,rightstick:b11,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows,
263 030000000d0f00002200000000000000,REAL ARCADE Pro.V3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
264 030000000d0f00005b00000000000000,Real Arcade Pro.V4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
265 030000000d0f00005c00000000000000,Real Arcade Pro.V4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
266 03000000790000001100000000000000,Retrolink SNES Controller,a:b2,b:b1,back:b8,dpdown:+a4,dpleft:-a3,dpright:+a3,dpup:-a4,leftshoulder:b4,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Windows,
267 03000000bd12000013d0000000000000,Retrolink USB SEGA Saturn Classic,a:b0,b:b1,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b5,lefttrigger:b6,rightshoulder:b2,righttrigger:b7,start:b8,x:b3,y:b4,platform:Windows,
268 0300000000f000000300000000000000,RetroUSB.com RetroPad,a:b1,b:b5,back:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b3,x:b0,y:b4,platform:Windows,
269 0300000000f00000f100000000000000,RetroUSB.com Super RetroPort,a:b1,b:b5,back:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b3,x:b0,y:b4,platform:Windows,
270 030000006b140000010d000000000000,Revolution Pro Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
271 030000006b140000020d000000000000,Revolution Pro Controller 2(1/2),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
272 030000006b140000130d000000000000,Revolution Pro Controller 3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
273 030000006f0e00001e01000000000000,Rock Candy PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
274 030000006f0e00002801000000000000,Rock Candy PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
275 030000006f0e00002f01000000000000,Rock Candy PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
276 030000004f04000003d0000000000000,run'n'drive,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b7,leftshoulder:a3,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:a4,rightstick:b11,righttrigger:b5,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
277 03000000a30600001af5000000000000,Saitek Cyborg,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b0,y:b3,platform:Windows,
278 03000000a306000023f6000000000000,Saitek Cyborg V.1 Game pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b0,y:b3,platform:Windows,
279 03000000300f00001201000000000000,Saitek Dual Analog Pad,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Windows,
280 03000000a30600000701000000000000,Saitek P220,a:b2,b:b3,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,lefttrigger:b7,rightshoulder:b4,righttrigger:b5,x:b0,y:b1,platform:Windows,
281 03000000a30600000cff000000000000,Saitek P2500 Force Rumble Pad,a:b2,b:b3,back:b11,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3,start:b10,x:b0,y:b1,platform:Windows,
282 03000000a30600000c04000000000000,Saitek P2900,a:b1,b:b2,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b3,platform:Windows,
283 03000000300f00001001000000000000,Saitek P480 Rumble Pad,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Windows,
284 03000000a30600000b04000000000000,Saitek P990,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b3,platform:Windows,
285 03000000a30600000b04000000010000,Saitek P990 Dual Analog Pad,a:b1,b:b2,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b8,x:b0,y:b3,platform:Windows,
286 03000000a30600002106000000000000,Saitek PS1000,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b0,y:b3,platform:Windows,
287 03000000a306000020f6000000000000,Saitek PS2700,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b0,y:b3,platform:Windows,
288 03000000300f00001101000000000000,Saitek Rumble Pad,a:b2,b:b3,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Windows,
289 03000000730700000401000000000000,Sanwa PlayOnline Mobile,a:b0,b:b1,back:b2,leftx:a0,lefty:a1,start:b3,platform:Windows,
290 0300000000050000289b000000000000,Saturn_Adapter_2.0,a:b1,b:b2,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,start:b9,x:b0,y:b3,platform:Windows,
291 030000009b2800000500000000000000,Saturn_Adapter_2.0,a:b1,b:b2,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,start:b9,x:b0,y:b3,platform:Windows,
292 03000000a30c00002500000000000000,Sega Genesis Mini 3B controller,a:b2,b:b1,dpdown:+a4,dpleft:-a3,dpright:+a3,dpup:-a4,righttrigger:b5,start:b9,platform:Windows,
293 03000000a30c00002400000000000000,Sega Mega Drive Mini 6B controller,a:b2,b:b1,dpdown:+a4,dpleft:-a3,dpright:+a3,dpup:-a4,rightshoulder:b4,righttrigger:b5,start:b9,x:b3,y:b0,platform:Windows,
294 030000005e0400008e02000000007801,ShanWan PS3/PC Wired GamePad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,
295 03000000341a00000208000000000000,SL-6555-SBK,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:-a4,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a4,rightx:a3,righty:a2,start:b7,x:b2,y:b3,platform:Windows,
296 03000000341a00000908000000000000,SL-6566,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,
297 030000008f0e00000800000000000000,SpeedLink Strike FX,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
298 03000000c01100000591000000000000,Speedlink Torid,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
299 03000000d11800000094000000000000,Stadia Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:b12,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:b11,rightx:a3,righty:a4,start:b9,x:b2,y:b3,platform:Windows,
300 03000000110100001914000000000000,SteelSeries,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftstick:b13,lefttrigger:b6,leftx:a0,lefty:a1,rightstick:b14,righttrigger:b7,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,
301 03000000381000001214000000000000,SteelSeries Free,a:b0,b:b1,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Windows,
302 03000000110100003114000000000000,SteelSeries Stratus Duo,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,
303 03000000381000001814000000000000,SteelSeries Stratus XL,a:b0,b:b1,back:b18,dpdown:b13,dpleft:b14,dpright:b15,dpup:b12,guide:b19,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b2,y:b3,platform:Windows,
304 03000000790000001c18000000000000,STK-7024X,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,
305 03000000ff1100003133000000000000,SVEN X-PAD,a:b2,b:b3,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b9,rightx:a2,righty:a4,start:b5,x:b0,y:b1,platform:Windows,
306 03000000d620000011a7000000000000,Switch,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
307 03000000457500002211000000000000,SZMY-POWER PC Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
308 030000004f04000007d0000000000000,T Mini Wireless,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
309 030000004f0400000ab1000000000000,T.16000M,a:b0,b:b1,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b11,leftshoulder:b4,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:b7,start:b10,x:b2,y:b3,platform:Windows,
310 03000000fa1900000706000000000000,Team 5,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
311 03000000b50700001203000000000000,Techmobility X6-38V,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Windows,
312 030000004f04000015b3000000000000,Thrustmaster Dual Analog 4,a:b0,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b1,y:b3,platform:Windows,
313 030000004f04000023b3000000000000,Thrustmaster Dual Trigger 3-in-1,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
314 030000004f0400000ed0000000000000,ThrustMaster eSwap PRO Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
315 030000004f04000000b3000000000000,Thrustmaster Firestorm Dual Power,a:b0,b:b2,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b11,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b12,righttrigger:b7,rightx:a2,righty:a3,start:b10,x:b1,y:b3,platform:Windows,
316 030000004f04000004b3000000000000,Thrustmaster Firestorm Dual Power 3,a:b0,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b1,y:b3,platform:Windows,
317 03000000666600000488000000000000,TigerGame PS/PS2 Game Controller Adapter,a:b2,b:b1,back:b9,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Windows,
318 03000000d62000006000000000000000,Tournament PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
319 030000005f140000c501000000000000,Trust Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
320 03000000b80500000210000000000000,Trust Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
321 030000004f04000087b6000000000000,TWCS Throttle,dpdown:b8,dpleft:b9,dpright:b7,dpup:b6,leftstick:b5,lefttrigger:-a5,leftx:a0,lefty:a1,righttrigger:+a5,platform:Windows,
322 03000000d90400000200000000000000,TwinShock PS2,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Windows,
323 030000006e0500001320000000000000,U4113,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
324 03000000101c0000171c000000000000,uRage Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
325 03000000300f00000701000000000000,USB 4-Axis 12-Button Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Windows,
326 03000000341a00002308000000000000,USB gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,
327 030000005509000000b4000000000000,USB gamepad,a:b10,b:b11,back:b5,dpdown:b1,dpleft:b2,dpright:b3,dpup:b0,guide:b14,leftshoulder:b8,leftstick:b6,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b9,rightstick:b7,righttrigger:a5,rightx:a2,righty:a3,start:b4,x:b12,y:b13,platform:Windows,
328 030000006b1400000203000000000000,USB gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,
329 03000000790000000a00000000000000,USB gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b3,y:b0,platform:Windows,
330 03000000f0250000c183000000000000,USB gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
331 03000000ff1100004133000000000000,USB gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a4,righty:a2,start:b9,x:b3,y:b0,platform:Windows,
332 03000000632500002305000000000000,USB Vibration Joystick (BM),a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
333 03000000790000001a18000000000000,Venom,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows,
334 03000000790000001b18000000000000,Venom Arcade Joystick,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows,
335 030000006f0e00000302000000000000,Victrix Pro Fight Stick for PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows,
336 030000006f0e00000702000000000000,Victrix Pro Fight Stick for PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows,
337 0300000034120000adbe000000000000,vJoy Device,a:b0,b:b1,back:b15,dpdown:b6,dpleft:b7,dpright:b8,dpup:b5,guide:b16,leftshoulder:b9,leftstick:b13,lefttrigger:b11,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b14,righttrigger:b12,rightx:+a3,righty:+a4,start:b4,x:b2,y:b3,platform:Windows,
338 030000005e0400000a0b000000000000,Xbox Adaptive Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:+a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:-a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,
339 030000005e040000ff02000000007801,Xbox One Elite Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,
340 030000005e040000130b000000000000,Xbox Series Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,
341 03000000341a00000608000000000000,Xeox,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,
342 03000000450c00002043000000000000,XEOX Gamepad SL-6556-BK,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows,
343 03000000ac0500005b05000000000000,Xiaoji Gamesir-G3w,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows,
344 03000000172700004431000000000000,XiaoMi Game Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b20,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a7,rightx:a2,righty:a5,start:b11,x:b3,y:b4,platform:Windows,
345 03000000786901006e70000000000000,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,
346 xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows,
347 03000000790000004f18000000000000,ZD-T Android,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows,
348 03000000120c0000101e000000000000,ZEROPLUS P4 Wired Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows,
349
350 # Mac OS X
351 030000008f0e00000300000009010000,2In1 USB Joystick,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Mac OS X,
352 03000000c82d00000090000001000000,8BitDo FC30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X,
353 03000000c82d00001038000000010000,8BitDo FC30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X,
354 03000000c82d00000650000001000000,8BitDo M30,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b8,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:b7,start:b11,x:b3,y:b4,platform:Mac OS X,
355 03000000c82d00005106000000010000,8BitDo M30 Gamepad,a:b1,b:b0,back:b10,guide:b2,leftshoulder:b6,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,start:b11,x:b4,y:b3,platform:Mac OS X,
356 03000000c82d00001590000001000000,8BitDo N30 Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X,
357 03000000c82d00006528000000010000,8BitDo N30 Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X,
358 030000003512000012ab000001000000,8BitDo NES30 Gamepad,a:b1,b:b0,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Mac OS X,
359 03000000022000000090000001000000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X,
360 03000000203800000900000000010000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X,
361 03000000c82d00000190000001000000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X,
362 03000000102800000900000000000000,8Bitdo SFC30 GamePad Joystick,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Mac OS X,
363 03000000c82d00001290000001000000,8BitDo SN30 Gamepad,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Mac OS X,
364 03000000c82d00000160000001000000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X,
365 03000000c82d00000161000000010000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Mac OS X,
366 03000000c82d00000260000001000000,8BitDo SN30 Pro+,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X,
367 03000000c82d00000261000000010000,8BitDo SN30 Pro+,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X,
368 03000000c82d00000031000001000000,8BitDo Wireless Adapter,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,
369 03000000c82d00001890000001000000,8BitDo Zero 2,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Mac OS X,
370 03000000c82d00003032000000010000,8BitDo Zero 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,rightx:a2,righty:a31,start:b11,x:b4,y:b3,platform:Mac OS X,
371 03000000a00500003232000008010000,8Bitdo Zero GamePad,a:b0,b:b1,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Mac OS X,
372 03000000a00500003232000009010000,8Bitdo Zero GamePad,a:b0,b:b1,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Mac OS X,
373 03000000050b00000045000031000000,ASUS Gamepad,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Mac OS X,
374 03000000c62400001a89000000010000,BDA MOGA XP5-X Plus,a:b0,b:b1,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b14,leftshoulder:b6,leftstick:b15,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b16,righttrigger:a4,rightx:a2,righty:a3,start:b13,x:b3,y:b4,platform:Mac OS X,
375 03000000c62400001b89000000010000,BDA MOGA XP5-X Plus,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,
376 03000000d62000002a79000000010000,BDA PS4 Fightpad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,
377 030000008305000031b0000000000000,Cideko AK08b,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
378 03000000260900008888000088020000,Cyber Gadget GameCube Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:a5,rightx:a2,righty:a3~,start:b7,x:b2,y:b3,platform:Mac OS X,
379 03000000a306000022f6000001030000,Cyborg V.3 Rumble Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:+a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:-a3,rightx:a2,righty:a4,start:b9,x:b0,y:b3,platform:Mac OS X,
380 03000000ad1b000001f9000000000000,Gamestop BB-070 X360 Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,
381 0500000047532047616d657061640000,GameStop Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Mac OS X,
382 03000000c01100000140000000010000,GameStop PS4 Fun Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,
383 030000006f0e00000102000000000000,GameStop Xbox 360 Wired Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,
384 030000007d0400000540000001010000,Gravis Eliminator GamePad Pro,a:b1,b:b2,back:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Mac OS X,
385 030000008f0e00000300000007010000,GreenAsia Inc. USB Joystick,a:b2,b:b3,x:b0,y:b1,back:b8,start:b9,leftshoulder:b4,rightshoulder:b6,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a2,lefttrigger:b5,righttrigger:b7,platform:Mac OS X,
386 030000000d0f00002d00000000100000,Hori Fighting Commander 3 Pro,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
387 030000000d0f00005f00000000010000,Hori Fighting Commander 4 (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
388 030000000d0f00005e00000000010000,Hori Fighting Commander 4 (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,
389 030000000d0f00005f00000000000000,HORI Fighting Commander 4 PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
390 030000000d0f00005e00000000000000,HORI Fighting Commander 4 PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
391 030000000d0f00004d00000000000000,HORI Gem Pad 3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
392 030000000d0f00009200000000010000,Hori Pokken Tournament DX Pro Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Mac OS X,
393 030000000d0f00006e00000000010000,HORIPAD 4 (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
394 030000000d0f00006600000000010000,HORIPAD 4 (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,
395 030000000d0f00006600000000000000,HORIPAD FPS PLUS 4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,
396 030000000d0f0000ee00000000010000,HORIPAD mini4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,
397 030000008f0e00001330000011010000,HuiJia SNES Controller,a:b4,b:b2,back:b16,dpdown:+a2,dpleft:-a0,dpright:+a0,dpup:-a2,leftshoulder:b12,rightshoulder:b14,start:b18,x:b6,y:b0,platform:Mac OS X,
398 03000000830500006020000000010000,iBuffalo SNES Controller,a:b1,b:b0,back:b6,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b7,x:b3,y:b2,platform:Mac OS X,
399 03000000830500006020000000000000,iBuffalo USB 2-axis 8-button Gamepad,a:b1,b:b0,back:b6,leftshoulder:b4,leftx:a0,lefty:a1,rightshoulder:b5,start:b7,x:b3,y:b2,platform:Mac OS X,
400 030000007e0500000620000001000000,Joy-Con (L),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b13,leftshoulder:b4,leftstick:b10,rightshoulder:b5,start:b8,x:b2,y:b3,platform:Mac OS X,
401 030000007e0500000720000001000000,Joy-Con (R),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b12,leftshoulder:b4,leftstick:b11,rightshoulder:b5,start:b9,x:b2,y:b3,platform:Mac OS X,
402 03000000242f00002d00000007010000,JYS Wireless Adapter,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Mac OS X,
403 030000006d04000016c2000000020000,Logitech Dual Action,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
404 030000006d04000016c2000000030000,Logitech Dual Action,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
405 030000006d04000016c2000014040000,Logitech Dual Action,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
406 030000006d04000016c2000000000000,Logitech F310 Gamepad (DInput),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
407 030000006d04000018c2000000000000,Logitech F510 Gamepad (DInput),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
408 030000006d04000019c2000005030000,Logitech F710,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
409 030000006d0400001fc2000000000000,Logitech F710 Gamepad (XInput),a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,
410 030000006d04000018c2000000010000,Logitech RumblePad 2 USB,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1~,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3~,start:b9,x:b0,y:b3,platform:Mac OS X,
411 030000006d04000019c2000000000000,Logitech Wireless Gamepad (DInput),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
412 03000000380700005032000000010000,Mad Catz FightPad PRO (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
413 03000000380700005082000000010000,Mad Catz FightPad PRO (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,
414 03000000380700008433000000010000,Mad Catz FightStick TE S+ (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
415 03000000380700008483000000010000,Mad Catz FightStick TE S+ (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,
416 03000000790000004418000000010000,Mayflash GameCube Controller,a:b1,b:b2,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b0,y:b3,platform:Mac OS X,
417 03000000242f00007300000000020000,Mayflash Magic NS,a:b1,b:b4,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b0,y:b3,platform:Mac OS X,
418 0300000079000000d218000026010000,Mayflash Magic NS,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Mac OS X,
419 03000000d620000010a7000003010000,Mayflash Magic NS,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
420 0300000025090000e803000000000000,Mayflash Wii Classic Controller,a:b1,b:b0,back:b8,dpdown:b13,dpleft:b12,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b2,platform:Mac OS X,
421 03000000790000000018000000000000,Mayflash WiiU Pro Game Controller Adapter (DInput),a:b4,b:b8,back:b32,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b16,leftstick:b40,lefttrigger:b24,leftx:a0,lefty:a4,rightshoulder:b20,rightstick:b44,righttrigger:b28,rightx:a8,righty:a12,start:b36,x:b0,y:b12,platform:Mac OS X,
422 03000000d8140000cecf000000000000,MC Cthulhu,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Mac OS X,
423 030000005e0400002700000001010000,Microsoft SideWinder Plug & Play Game Pad,a:b0,b:b1,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,lefttrigger:b4,leftx:a0,lefty:a1,righttrigger:b5,x:b2,y:b3,platform:Mac OS X,
424 03000000d62000007162000001000000,Moga Pro 2 HID,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Mac OS X,
425 03000000c62400002a89000000010000,MOGA XP5-A Plus,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b21,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,
426 03000000c62400002b89000000010000,MOGA XP5-A Plus,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,
427 03000000632500007505000000020000,NEOGEO mini PAD Controller,a:b1,b:b0,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,start:b9,x:b2,y:b3,platform:Mac OS X,
428 030000001008000001e5000006010000,NEXT SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,righttrigger:b6,start:b9,x:b3,y:b0,platform:Mac OS X,
429 03000000d620000011a7000000020000,Nintendo Switch Core (Plus) Wired Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
430 030000007e0500000920000000000000,Nintendo Switch Pro Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Mac OS X,
431 030000007e0500000920000001000000,Nintendo Switch Pro Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Mac OS X,
432 03000000550900001472000025050000,NVIDIA Controller v01.04,a:b0,b:b1,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b15,leftshoulder:b4,leftstick:b7,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a5,start:b6,x:b2,y:b3,platform:Mac OS X,
433 030000006f0e00000901000002010000,PDP Versus Fighting Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Mac OS X,
434 030000008f0e00000300000000000000,Piranha xtreme,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Mac OS X,
435 030000004c050000da0c000000010000,Playstation Classic Controller,a:b2,b:b1,back:b8,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,start:b9,x:b3,y:b0,platform:Mac OS X,
436 03000000d62000006dca000000010000,PowerA Pro Ex,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
437 030000004c0500006802000000000000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Mac OS X,
438 030000004c0500006802000000010000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Mac OS X,
439 030000004c050000a00b000000010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,
440 030000004c050000c405000000000000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,
441 030000004c050000c405000000010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,
442 030000004c050000cc09000000010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,
443 050000004c050000e60c000000010000,PS5 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,misc1:b13,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,
444 030000008916000000fd000000000000,Razer Onza TE,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,
445 03000000321500000204000000010000,Razer Panthera (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
446 03000000321500000104000000010000,Razer Panthera (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,
447 03000000321500000010000000010000,Razer RAIJU,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,
448 03000000321500000507000001010000,Razer Raiju Mobile,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b21,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,
449 03000000321500000011000000010000,Razer Raion Fightpad for PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,
450 03000000321500000009000000020000,Razer Serval,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Mac OS X,
451 030000003215000000090000163a0000,Razer Serval,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Mac OS X,
452 0300000032150000030a000000000000,Razer Wildcat,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,
453 03000000790000001100000000000000,Retrolink Classic Controller,a:b2,b:b1,back:b8,leftshoulder:b4,leftx:a3,lefty:a4,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Mac OS X,
454 03000000790000001100000006010000,Retrolink SNES Controller,a:b2,b:b1,back:b8,dpdown:+a4,dpleft:-a3,dpright:+a3,dpup:-a4,leftshoulder:b4,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Mac OS X,
455 030000006b140000010d000000010000,Revolution Pro Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,
456 030000006b140000130d000000010000,Revolution Pro Controller 3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,
457 03000000c6240000fefa000000000000,Rock Candy Gamepad for PS3,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,
458 03000000730700000401000000010000,Sanwa PlayOnline Mobile,a:b0,b:b1,back:b2,leftx:a0,lefty:a1,start:b3,platform:Mac OS X,
459 03000000811700007e05000000000000,Sega Saturn,a:b2,b:b4,dpdown:b16,dpleft:b15,dpright:b14,dpup:b17,leftshoulder:b8,lefttrigger:a5,leftx:a0,lefty:a2,rightshoulder:b9,righttrigger:a4,start:b13,x:b0,y:b6,platform:Mac OS X,
460 03000000b40400000a01000000000000,Sega Saturn USB Gamepad,a:b0,b:b1,back:b5,guide:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b8,x:b3,y:b4,platform:Mac OS X,
461 030000003512000021ab000000000000,SFC30 Joystick,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Mac OS X,
462 0300000000f00000f100000000000000,SNES RetroPort,a:b2,b:b3,back:b4,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b5,rightshoulder:b7,start:b6,x:b0,y:b1,platform:Mac OS X,
463 030000004c050000e60c000000010000,Sony DualSense,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
464 030000004c050000cc09000000000000,Sony DualShock 4 V2,a:b1,b:b2,back:b13,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,
465 030000004c050000a00b000000000000,Sony DualShock 4 Wireless Adaptor,a:b1,b:b2,back:b13,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,
466 03000000d11800000094000000010000,Stadia Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Mac OS X,
467 030000005e0400008e02000001000000,Steam Virtual Gamepad,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,
468 03000000110100002014000000000000,SteelSeries Nimbus,a:b0,b:b1,dpdown:b9,dpleft:b11,dpright:b10,dpup:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b12,x:b2,y:b3,platform:Mac OS X,
469 03000000110100002014000001000000,SteelSeries Nimbus,a:b0,b:b1,dpdown:b9,dpleft:b11,dpright:b10,dpup:b8,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1~,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3~,x:b2,y:b3,platform:Mac OS X,
470 03000000381000002014000001000000,SteelSeries Nimbus,a:b0,b:b1,dpdown:b9,dpleft:b11,dpright:b10,dpup:b8,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1~,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3~,x:b2,y:b3,platform:Mac OS X,
471 050000004e696d6275732b0000000000,SteelSeries Nimbus Plus,a:b0,b:b1,back:b15,dpdown:b11,dpleft:b13,dpright:b12,dpup:b10,guide:b16,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1~,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3~,start:b14,x:b2,y:b3,platform:Mac OS X,
472 03000000110100001714000000000000,SteelSeries Stratus XL,a:b0,b:b1,dpdown:b9,dpleft:b11,dpright:b10,dpup:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1~,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3~,start:b12,x:b2,y:b3,platform:Mac OS X,
473 03000000110100001714000020010000,SteelSeries Stratus XL,a:b0,b:b1,dpdown:b9,dpleft:b11,dpright:b10,dpup:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1~,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3~,start:b12,x:b2,y:b3,platform:Mac OS X,
474 03000000457500002211000000010000,SZMY-POWER PC Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X,
475 030000004f04000015b3000000000000,Thrustmaster Dual Analog 3.2,a:b0,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b1,y:b3,platform:Mac OS X,
476 030000004f0400000ed0000000020000,ThrustMaster eSwap PRO Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,
477 030000004f04000000b3000000000000,Thrustmaster Firestorm Dual Power,a:b0,b:b2,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b11,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:b7,rightx:a2,righty:a3,start:b10,x:b1,y:b3,platform:Mac OS X,
478 03000000bd12000015d0000000000000,Tomee SNES USB Controller,a:b2,b:b1,back:b8,leftshoulder:b4,leftx:a0,lefty:a1,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Mac OS X,
479 03000000bd12000015d0000000010000,Tomee SNES USB Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Mac OS X,
480 03000000100800000100000000000000,Twin USB Joystick,a:b4,b:b2,back:b16,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b12,leftstick:b20,lefttrigger:b8,leftx:a0,lefty:a2,rightshoulder:b14,rightstick:b22,righttrigger:b10,rightx:a6,righty:a4,start:b18,x:b6,y:b0,platform:Mac OS X,
481 030000006f0e00000302000025040000,Victrix Pro Fight Stick for PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Mac OS X,
482 030000006f0e00000702000003060000,Victrix Pro Fight Stick for PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Mac OS X,
483 03000000791d00000103000009010000,Wii Classic Controller,a:b2,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,guide:b10,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Mac OS X,
484 050000005769696d6f74652028303000,Wii Remote,a:b4,b:b5,back:b7,dpdown:b3,dpleft:b0,dpright:b1,dpup:b2,guide:b8,leftshoulder:b11,lefttrigger:b12,leftx:a0,lefty:a1,start:b6,x:b10,y:b9,platform:Mac OS X,
485 050000005769696d6f74652028313800,Wii U Pro Controller,a:b16,b:b15,back:b7,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b8,leftshoulder:b19,leftstick:b23,lefttrigger:b21,leftx:a0,lefty:a1,rightshoulder:b20,rightstick:b24,righttrigger:b22,rightx:a2,righty:a3,start:b6,x:b18,y:b17,platform:Mac OS X,
486 030000005e0400008e02000000000000,X360 Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,
487 03000000c6240000045d000000000000,Xbox 360 Wired Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,
488 030000005e0400000a0b000000000000,Xbox Adaptive Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,
489 030000005e040000050b000003090000,Xbox Elite Wireless Controller Series 2,a:b0,b:b1,back:b31,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b53,leftshoulder:b6,leftstick:b13,lefttrigger:a6,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,
490 030000005e040000d102000000000000,Xbox One Wired Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,
491 030000005e040000dd02000000000000,Xbox One Wired Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,
492 030000005e040000e302000000000000,Xbox One Wired Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,
493 030000005e040000130b000001050000,Xbox Series Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,
494 030000005e040000130b000005050000,Xbox Series Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,
495 030000005e040000e002000000000000,Xbox Wireless Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Mac OS X,
496 030000005e040000e002000003090000,Xbox Wireless Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Mac OS X,
497 030000005e040000ea02000000000000,Xbox Wireless Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X,
498 030000005e040000fd02000003090000,Xbox Wireless Controller,a:b0,b:b1,back:b16,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b15,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X,
499 03000000172700004431000029010000,XiaoMi Game Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b15,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a6,rightx:a2,righty:a5,start:b11,x:b3,y:b4,platform:Mac OS X,
500 03000000120c0000100e000000010000,ZEROPLUS P4 Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,
501 03000000120c0000101e000000010000,ZEROPLUS P4 Wired Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X,
502
503 # Linux
504 03000000c82d00000090000011010000,8BitDo FC30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,
505 05000000c82d00001038000000010000,8Bitdo FC30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,
506 05000000c82d00005106000000010000,8BitDo M30,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b8,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:b7,start:b11,x:b3,y:b4,platform:Linux,
507 03000000c82d00001590000011010000,8BitDo N30 Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,
508 05000000c82d00006528000000010000,8BitDo N30 Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,
509 03000000c82d00000310000011010000,8BitDo NES30,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b7,lefttrigger:b6,rightshoulder:b9,righttrigger:b8,start:b11,x:b3,y:b4,platform:Linux,
510 05000000c82d00008010000000010000,8BitDo NES30,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b7,lefttrigger:b6,rightshoulder:b9,righttrigger:b8,start:b11,x:b3,y:b4,platform:Linux,
511 03000000022000000090000011010000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,
512 05000000203800000900000000010000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,
513 05000000c82d00002038000000010000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,
514 03000000c82d00000190000011010000,8Bitdo NES30 Pro 8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,
515 05000000c82d00000060000000010000,8BitDo SF30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,
516 05000000c82d00000061000000010000,8Bitdo SF30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,
517 03000000c82d000021ab000010010000,8BitDo SFC30,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Linux,
518 030000003512000012ab000010010000,8Bitdo SFC30 GamePad,a:b2,b:b1,back:b6,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b7,x:b3,y:b0,platform:Linux,
519 05000000102800000900000000010000,8Bitdo SFC30 GamePad,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Linux,
520 05000000c82d00003028000000010000,8Bitdo SFC30 GamePad,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Linux,
521 03000000c82d00000160000000000000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Linux,
522 03000000c82d00000160000011010000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,
523 03000000c82d00000161000000000000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Linux,
524 03000000c82d00001290000011010000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Linux,
525 05000000c82d00000161000000010000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,
526 05000000c82d00006228000000010000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,
527 03000000c82d00000260000011010000,8BitDo SN30 Pro+,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,
528 05000000c82d00000261000000010000,8BitDo SN30 Pro+,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,
529 05000000202800000900000000010000,8BitDo SNES30 Gamepad,a:b1,b:b0,back:b10,dpdown:b122,dpleft:b119,dpright:b120,dpup:b117,leftshoulder:b6,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Linux,
530 03000000c82d00000031000011010000,8BitDo Wireless Adapter (DInput),a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
531 030000005e0400008e02000020010000,8BitDo Wireless Adapter (XInput),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
532 03000000c82d00001890000011010000,8BitDo Zero 2,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Linux,
533 05000000c82d00003032000000010000,8BitDo Zero 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux,
534 050000005e040000e002000030110000,8BitDo Zero 2 (XInput),a:b0,b:b1,back:b6,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b7,x:b2,y:b3,platform:Linux,
535 05000000a00500003232000001000000,8Bitdo Zero GamePad,a:b0,b:b1,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Linux,
536 05000000a00500003232000008010000,8Bitdo Zero GamePad,a:b0,b:b1,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Linux,
537 03000000c01100000355000011010000,ACRUX USB GAME PAD,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
538 030000006f0e00001302000000010000,Afterglow,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
539 030000006f0e00003901000020060000,Afterglow Controller for Xbox One,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
540 030000006f0e00003901000000430000,Afterglow Prismatic Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
541 030000006f0e00003901000013020000,Afterglow Prismatic Wired Controller 048-007-NA,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
542 03000000100000008200000011010000,Akishop Customs PS360+ v1.66,a:b1,b:b2,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux,
543 030000007c1800000006000010010000,Alienware Dual Compatible Game Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b3,platform:Linux,
544 05000000491900000204000021000000,Amazon Fire Game Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b17,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b12,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
545 03000000790000003018000011010000,Arcade Fightstick F300,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux,
546 05000000050b00000045000031000000,ASUS Gamepad,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b10,x:b2,y:b3,platform:Linux,
547 05000000050b00000045000040000000,ASUS Gamepad,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b10,x:b2,y:b3,platform:Linux,
548 03000000120c00000500000010010000,AxisPad,a:b2,b:b3,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a3,righty:a2,start:b11,x:b0,y:b1,platform:Linux,
549 03000000c62400001b89000011010000,BDA MOGA XP5-X Plus,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
550 03000000d62000002a79000011010000,BDA PS4 Fightpad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
551 03000000c21100000791000011010000,Be1 GC101 Controller 1.03 mode,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,
552 03000000c31100000791000011010000,Be1 GC101 GAMEPAD 1.03 mode,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
553 030000005e0400008e02000003030000,Be1 GC101 Xbox 360 Controller mode,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
554 03000000666600006706000000010000,boom PSX to PC Converter,a:b2,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,leftshoulder:b6,leftstick:b9,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b10,righttrigger:b5,rightx:a2,righty:a3,start:b11,x:b3,y:b0,platform:Linux,
555 03000000ffff0000ffff000000010000,Chinese-made Xbox Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b5,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b2,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b3,y:b4,platform:Linux,
556 03000000e82000006058000001010000,Cideko AK08b,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,
557 030000000b0400003365000000010000,Competition Pro,a:b0,b:b1,back:b2,leftx:a0,lefty:a1,start:b3,platform:Linux,
558 03000000260900008888000000010000,Cyber Gadget GameCube Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:a5,rightx:a2,righty:a3~,start:b7,x:b2,y:b3,platform:Linux,
559 03000000a306000022f6000011010000,Cyborg V.3 Rumble Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:+a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:-a3,rightx:a2,righty:a4,start:b9,x:b0,y:b3,platform:Linux,
560 03000000b40400000a01000000010000,CYPRESS USB Gamepad,a:b0,b:b1,back:b5,guide:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b8,x:b3,y:b4,platform:Linux,
561 03000000790000000600000010010000,DragonRise Inc. Generic USB Joystick,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b3,y:b0,platform:Linux,
562 030000004f04000004b3000010010000,Dual Power 2,a:b0,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b1,y:b3,platform:Linux,
563 030000006f0e00003001000001010000,EA Sports PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
564 03000000341a000005f7000010010000,GameCube {HuiJia USB box},a:b1,b:b2,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b0,y:b3,platform:Linux,
565 03000000bc2000000055000011010000,GameSir G3w,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
566 0500000047532047616d657061640000,GameStop Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,
567 030000006f0e00000104000000010000,Gamestop Logic3 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
568 030000008f0e00000800000010010000,Gasia Co. Ltd PS(R) Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,
569 030000006f0e00001304000000010000,Generic X-Box pad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
570 03000000451300000010000010010000,Genius Maxfire Grandias 12,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,
571 03000000f0250000c183000010010000,Goodbetterbest Ltd USB Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
572 0300000079000000d418000000010000,GPD Win 2 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
573 030000007d0400000540000000010000,Gravis Eliminator GamePad Pro,a:b1,b:b2,back:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux,
574 03000000280400000140000000010000,Gravis GamePad Pro USB ,a:b1,b:b2,back:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux,
575 030000008f0e00000610000000010000,GreenAsia Electronics 4Axes 12Keys GamePad ,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b9,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b10,righttrigger:b5,rightx:a3,righty:a2,start:b11,x:b3,y:b0,platform:Linux,
576 030000008f0e00001200000010010000,GreenAsia Inc. USB Joystick,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b2,y:b3,platform:Linux,
577 0500000047532067616d657061640000,GS gamepad,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,
578 03000000f0250000c383000010010000,GT VX2,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,
579 06000000adde0000efbe000002010000,Hidromancer Game Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
580 03000000d81400000862000011010000,HitBox (PS3/PC) Analog Mode,a:b1,b:b2,back:b8,guide:b9,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b12,x:b0,y:b3,platform:Linux,
581 03000000c9110000f055000011010000,HJC Game GAMEPAD,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,
582 03000000632500002605000010010000,HJD-X,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
583 030000000d0f00000d00000000010000,hori,a:b0,b:b6,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b3,leftx:b4,lefty:b5,rightshoulder:b7,start:b9,x:b1,y:b2,platform:Linux,
584 030000000d0f00001000000011010000,HORI CO. LTD. FIGHTING STICK 3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux,
585 030000000d0f0000c100000011010000,HORI CO. LTD. HORIPAD S,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b13,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
586 030000000d0f00006a00000011010000,HORI CO. LTD. Real Arcade Pro.4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
587 030000000d0f00006b00000011010000,HORI CO. LTD. Real Arcade Pro.4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
588 030000000d0f00002200000011010000,HORI CO. LTD. REAL ARCADE Pro.V3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux,
589 030000000d0f00008500000010010000,HORI Fighting Commander,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
590 030000000d0f00008600000002010000,Hori Fighting Commander,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,
591 030000000d0f00005f00000011010000,Hori Fighting Commander 4 (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
592 030000000d0f00005e00000011010000,Hori Fighting Commander 4 (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
593 03000000ad1b000001f5000033050000,Hori Pad EX Turbo 2,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
594 030000000d0f00009200000011010000,Hori Pokken Tournament DX Pro Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux,
595 030000000d0f0000aa00000011010000,HORI Real Arcade Pro,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,
596 030000000d0f0000d800000072056800,HORI Real Arcade Pro S,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Linux,
597 030000000d0f00001600000000010000,Hori Real Arcade Pro.EX-SE (Xbox 360),a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b2,y:b3,platform:Linux,
598 030000000d0f00006e00000011010000,HORIPAD 4 (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
599 030000000d0f00006600000011010000,HORIPAD 4 (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
600 030000000d0f0000ee00000011010000,HORIPAD mini4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
601 030000000d0f00006700000001010000,HORIPAD ONE,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
602 030000008f0e00001330000010010000,HuiJia SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b9,x:b3,y:b0,platform:Linux,
603 03000000242e00008816000001010000,Hyperkin X91,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
604 03000000830500006020000010010000,iBuffalo SNES Controller,a:b1,b:b0,back:b6,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b7,x:b3,y:b2,platform:Linux,
605 050000006964726f69643a636f6e0000,idroid:con,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
606 03000000b50700001503000010010000,impact,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Linux,
607 03000000d80400008200000003000000,IMS PCU#0 Gamepad Interface,a:b1,b:b0,back:b4,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,start:b5,x:b3,y:b2,platform:Linux,
608 03000000fd0500000030000000010000,InterAct GoPad I-73000 (Fighting Game Layout),a:b3,b:b4,back:b6,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:b5,start:b7,x:b0,y:b1,platform:Linux,
609 0500000049190000020400001b010000,Ipega PG-9069 - Bluetooth Gamepad,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b161,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
610 03000000632500007505000011010000,Ipega PG-9099 - Bluetooth Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,
611 030000006e0500000320000010010000,JC-U3613M - DirectInput Mode,a:b2,b:b3,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3,start:b11,x:b0,y:b1,platform:Linux,
612 03000000300f00001001000010010000,Jess Tech Dual Analog Rumble Pad,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Linux,
613 03000000300f00000b01000010010000,Jess Tech GGE909 PC Recoil Pad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Linux,
614 03000000ba2200002010000001010000,Jess Technology USB Game Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Linux,
615 030000007e0500000620000001000000,Joy-Con (L),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b13,leftshoulder:b4,leftstick:b10,rightshoulder:b5,start:b8,x:b2,y:b3,platform:Linux,
616 050000007e0500000620000001000000,Joy-Con (L),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b13,leftshoulder:b4,leftstick:b10,rightshoulder:b5,start:b8,x:b2,y:b3,platform:Linux,
617 030000007e0500000720000001000000,Joy-Con (R),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b12,leftshoulder:b4,leftstick:b11,rightshoulder:b5,start:b9,x:b2,y:b3,platform:Linux,
618 050000007e0500000720000001000000,Joy-Con (R),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b12,leftshoulder:b4,leftstick:b11,rightshoulder:b5,start:b9,x:b2,y:b3,platform:Linux,
619 03000000242f00002d00000011010000,JYS Wireless Adapter,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,
620 03000000242f00008a00000011010000,JYS Wireless Adapter,a:b1,b:b4,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b0,y:b3,platform:Linux,
621 030000006f0e00000103000000020000,Logic3 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
622 030000006d040000d1ca000000000000,Logitech ChillStream,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
623 030000006d04000019c2000010010000,Logitech Cordless RumblePad 2,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
624 030000006d04000016c2000010010000,Logitech Dual Action,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
625 030000006d04000016c2000011010000,Logitech Dual Action,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
626 030000006d0400001dc2000014400000,Logitech F310 Gamepad (XInput),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
627 030000006d0400001ec2000019200000,Logitech F510 Gamepad (XInput),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
628 030000006d0400001ec2000020200000,Logitech F510 Gamepad (XInput),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
629 030000006d04000019c2000011010000,Logitech F710 Gamepad (DInput),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
630 030000006d0400001fc2000005030000,Logitech F710 Gamepad (XInput),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
631 030000006d0400000ac2000010010000,Logitech Inc. WingMan RumblePad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b2,rightx:a3,righty:a4,x:b3,y:b4,platform:Linux,
632 030000006d04000018c2000010010000,Logitech RumblePad 2,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
633 030000006d04000011c2000010010000,Logitech WingMan Cordless RumblePad,a:b0,b:b1,back:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b6,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b10,rightx:a3,righty:a4,start:b8,x:b3,y:b4,platform:Linux,
634 050000004d4f435554452d3035305800,M54-PC,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
635 05000000380700006652000025010000,Mad Catz C.T.R.L.R ,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
636 03000000380700005032000011010000,Mad Catz FightPad PRO (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
637 03000000380700005082000011010000,Mad Catz FightPad PRO (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
638 03000000ad1b00002ef0000090040000,Mad Catz Fightpad SFxT,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,lefttrigger:a2,rightshoulder:b5,righttrigger:a5,start:b7,x:b2,y:b3,platform:Linux,
639 03000000380700008034000011010000,Mad Catz fightstick (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
640 03000000380700008084000011010000,Mad Catz fightstick (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
641 03000000380700008433000011010000,Mad Catz FightStick TE S+ (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
642 03000000380700008483000011010000,Mad Catz FightStick TE S+ (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
643 03000000380700001647000010040000,Mad Catz Wired Xbox 360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
644 03000000380700003847000090040000,Mad Catz Wired Xbox 360 Controller (SFIV),a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,
645 03000000ad1b000016f0000090040000,Mad Catz Xbox 360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
646 03000000380700001888000010010000,MadCatz PC USB Wired Stick 8818,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
647 03000000380700003888000010010000,MadCatz PC USB Wired Stick 8838,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:a0,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
648 03000000120c00000500000000010000,Manta Dualshock 2,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b2,y:b3,platform:Linux,
649 03000000790000004418000010010000,Mayflash GameCube Controller,a:b1,b:b2,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b0,y:b3,platform:Linux,
650 03000000790000004318000010010000,Mayflash GameCube Controller Adapter,a:b1,b:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b0,y:b3,platform:Linux,
651 03000000242f00007300000011010000,Mayflash Magic NS,a:b1,b:b4,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b0,y:b3,platform:Linux,
652 0300000079000000d218000011010000,Mayflash Magic NS,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
653 03000000d620000010a7000011010000,Mayflash Magic NS,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
654 0300000025090000e803000001010000,Mayflash Wii Classic Controller,a:b1,b:b0,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:a4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:a5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b2,platform:Linux,
655 03000000780000000600000010010000,Microntek USB Joystick,a:b2,b:b1,back:b8,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,start:b9,x:b3,y:b0,platform:Linux,
656 030000005e0400000e00000000010000,Microsoft SideWinder,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,rightshoulder:b7,start:b8,x:b3,y:b4,platform:Linux,
657 030000005e0400008e02000004010000,Microsoft X-Box 360 pad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
658 030000005e0400008e02000062230000,Microsoft X-Box 360 pad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
659 050000005e040000050b000003090000,Microsoft X-Box One Elite 2 pad,a:b0,b:b1,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a6,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
660 030000005e040000e302000003020000,Microsoft X-Box One Elite pad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
661 030000005e040000d102000001010000,Microsoft X-Box One pad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
662 030000005e040000dd02000003020000,Microsoft X-Box One pad (Firmware 2015),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
663 030000005e040000d102000003020000,Microsoft X-Box One pad v2,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
664 030000005e0400008502000000010000,Microsoft X-Box pad (Japan),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b5,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b2,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b3,y:b4,platform:Linux,
665 030000005e0400008902000021010000,Microsoft X-Box pad v2 (US),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b5,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b2,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b3,y:b4,platform:Linux,
666 030000005e040000000b000008040000,Microsoft Xbox One Elite 2 pad - Wired,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
667 030000005e040000ea02000008040000,Microsoft Xbox One S pad - Wired,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
668 03000000c62400001a53000000010000,Mini PE,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
669 03000000030000000300000002000000,Miroof,a:b1,b:b0,back:b6,leftshoulder:b4,leftx:a0,lefty:a1,rightshoulder:b5,start:b7,x:b3,y:b2,platform:Linux,
670 05000000d6200000e589000001000000,Moga 2 HID,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Linux,
671 05000000d6200000ad0d000001000000,Moga Pro,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Linux,
672 05000000d62000007162000001000000,Moga Pro 2 HID,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Linux,
673 03000000c62400002b89000011010000,MOGA XP5-A Plus,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
674 05000000c62400002a89000000010000,MOGA XP5-A Plus,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b22,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
675 05000000c62400001a89000000010000,MOGA XP5-X Plus,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
676 03000000250900006688000000010000,MP-8866 Super Dual Box,a:b2,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Linux,
677 030000006b140000010c000010010000,NACON GC-400ES,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,
678 030000000d0f00000900000010010000,Natec Genesis P44,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
679 030000001008000001e5000010010000,NEXT SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,righttrigger:b6,start:b9,x:b3,y:b0,platform:Linux,
680 060000007e0500000820000000000000,Nintendo Combined Joy-Cons (joycond),a:b0,b:b1,back:b9,dpdown:b15,dpleft:b16,dpright:b17,dpup:b14,guide:b11,leftshoulder:b5,leftstick:b12,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b13,righttrigger:b8,rightx:a2,righty:a3,start:b10,x:b3,y:b2,platform:Linux,
681 030000007e0500003703000000016800,Nintendo GameCube Controller,a:b0,b:b2,dpdown:b6,dpleft:b4,dpright:b5,dpup:b7,lefttrigger:a4,leftx:a0,lefty:a1~,rightshoulder:b9,righttrigger:a5,rightx:a2,righty:a3~,start:b8,x:b1,y:b3,platform:Linux,
682 03000000790000004618000010010000,Nintendo GameCube Controller Adapter,a:b1,b:b2,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,rightx:a5~,righty:a2~,start:b9,x:b0,y:b3,platform:Linux,
683 050000007e0500000920000001000000,Nintendo Switch Pro Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,
684 050000007e0500000920000001800000,Nintendo Switch Pro Controller (joycond),a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b11,leftshoulder:b5,leftstick:b12,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b13,righttrigger:b8,rightx:a2,righty:a3,start:b10,x:b3,y:b2,platform:Linux,
685 030000007e0500000920000011810000,Nintendo Switch Pro Controller Wired (joycond),a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b11,leftshoulder:b5,leftstick:b12,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b13,righttrigger:b8,rightx:a2,righty:a3,start:b10,x:b3,y:b2,platform:Linux,
686 050000007e0500003003000001000000,Nintendo Wii Remote Pro Controller,a:b0,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b16,dpup:b13,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b2,platform:Linux,
687 05000000010000000100000003000000,Nintendo Wiimote,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,
688 030000000d0500000308000010010000,Nostromo n45 Dual Analog Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b12,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b10,x:b2,y:b3,platform:Linux,
689 03000000550900001072000011010000,NVIDIA Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b13,leftshoulder:b4,leftstick:b8,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Linux,
690 03000000550900001472000011010000,NVIDIA Controller v01.04,a:b0,b:b1,back:b14,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b16,leftshoulder:b4,leftstick:b7,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a5,start:b6,x:b2,y:b3,platform:Linux,
691 05000000550900001472000001000000,NVIDIA Controller v01.04,a:b0,b:b1,back:b14,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b16,leftshoulder:b4,leftstick:b7,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a5,start:b6,x:b2,y:b3,platform:Linux,
692 03000000451300000830000010010000,NYKO CORE,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
693 19000000010000000100000001010000,odroidgo2_joypad,a:b1,b:b0,dpdown:b7,dpleft:b8,dpright:b9,dpup:b6,guide:b10,leftshoulder:b4,leftstick:b12,lefttrigger:b11,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b13,righttrigger:b14,start:b15,x:b2,y:b3,platform:Linux,
694 19000000010000000200000011000000,odroidgo2_joypad_v11,a:b1,b:b0,dpdown:b9,dpleft:b10,dpright:b11,dpup:b8,guide:b12,leftshoulder:b4,leftstick:b14,lefttrigger:b13,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b15,righttrigger:b16,start:b17,x:b2,y:b3,platform:Linux,
695 030000005e0400000202000000010000,Old Xbox pad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b5,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b2,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b3,y:b4,platform:Linux,
696 03000000c0160000dc27000001010000,OnyxSoft Dual JoyDivision,a:b0,b:b1,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b6,x:b2,y:b3,platform:Linux,
697 05000000362800000100000002010000,OUYA Game Controller,a:b0,b:b3,dpdown:b9,dpleft:b10,dpright:b11,dpup:b8,guide:b14,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,x:b1,y:b2,platform:Linux,
698 05000000362800000100000003010000,OUYA Game Controller,a:b0,b:b3,dpdown:b9,dpleft:b10,dpright:b11,dpup:b8,guide:b14,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,x:b1,y:b2,platform:Linux,
699 03000000830500005020000010010000,Padix Co. Ltd. Rockfire PSX/USB Bridge,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3,start:b11,x:b2,y:b3,platform:Linux,
700 03000000790000001c18000011010000,PC Game Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,
701 03000000ff1100003133000010010000,PC Game Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,
702 030000006f0e0000b802000001010000,PDP AFTERGLOW Wired Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
703 030000006f0e0000b802000013020000,PDP AFTERGLOW Wired Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
704 030000006f0e00006401000001010000,PDP Battlefield One,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
705 030000006f0e00008001000011010000,PDP CO. LTD. Faceoff Wired Pro Controller for Nintendo Switch,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
706 030000006f0e00003101000000010000,PDP EA Sports Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
707 030000006f0e0000c802000012010000,PDP Kingdom Hearts Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
708 030000006f0e00008701000011010000,PDP Rock Candy Wired Controller for Nintendo Switch,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b13,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,
709 030000006f0e00000901000011010000,PDP Versus Fighting Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux,
710 030000006f0e0000a802000023020000,PDP Wired Controller for Xbox One,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,
711 030000006f0e00008501000011010000,PDP Wired Fight Pad Pro for Nintendo Switch,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,
712 0500000049190000030400001b010000,PG-9099,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
713 05000000491900000204000000000000,PG-9118,a:b73,b:b74,back:b83,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b79,leftstick:b86,lefttrigger:b81,leftx:a0,lefty:a1,rightshoulder:b80,rightstick:b87,righttrigger:b82,rightx:a2,righty:a3,start:b84,x:b76,y:b77,platform:Linux,
714 030000004c050000da0c000011010000,Playstation Controller,a:b2,b:b1,back:b8,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,start:b9,x:b3,y:b0,platform:Linux,
715 03000000c62400000053000000010000,PowerA,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
716 03000000c62400003a54000001010000,PowerA 1428124-01,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
717 03000000d62000006dca000011010000,PowerA Pro Ex,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
718 03000000c62400001a58000001010000,PowerA Xbox One Cabled,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
719 030000006d040000d2ca000011010000,Precision Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
720 03000000ff1100004133000010010000,PS2 Controller,a:b2,b:b1,back:b8,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,start:b9,x:b3,y:b0,platform:Linux,
721 03000000341a00003608000011010000,PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
722 030000004c0500006802000010010000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Linux,
723 030000004c0500006802000010810000,PS3 Controller,a:b0,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b16,dpup:b13,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux,
724 030000004c0500006802000011010000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Linux,
725 030000004c0500006802000011810000,PS3 Controller,a:b0,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b16,dpup:b13,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux,
726 030000006f0e00001402000011010000,PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
727 030000008f0e00000300000010010000,PS3 Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,
728 050000004c0500006802000000010000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:a12,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:a13,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Linux,
729 050000004c0500006802000000800000,PS3 Controller,a:b0,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b16,dpup:b13,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux,
730 050000004c0500006802000000810000,PS3 Controller,a:b0,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b16,dpup:b13,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux,
731 05000000504c415953544154494f4e00,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Linux,
732 060000004c0500006802000000010000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Linux,
733 030000004c050000a00b000011010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
734 030000004c050000a00b000011810000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux,
735 030000004c050000c405000011010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
736 030000004c050000c405000011810000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux,
737 030000004c050000cc09000000010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
738 030000004c050000cc09000011010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
739 030000004c050000cc09000011810000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux,
740 03000000c01100000140000011010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
741 050000004c050000c405000000010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
742 050000004c050000c405000000810000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux,
743 050000004c050000c405000001800000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux,
744 050000004c050000cc09000000010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
745 050000004c050000cc09000000810000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux,
746 050000004c050000cc09000001800000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux,
747 030000004c050000e60c000011010000,PS5 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,misc1:b13,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
748 050000004c050000e60c000000010000,PS5 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,misc1:b13,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
749 03000000300f00001211000011010000,QanBa Arcade JoyStick,a:b2,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b5,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b6,start:b9,x:b1,y:b3,platform:Linux,
750 030000009b2800003200000001010000,Raphnet Technologies GC/N64 to USB v3.4,a:b0,b:b7,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:b5,rightx:a3,righty:a4,start:b3,x:b1,y:b8,platform:Linux,
751 030000009b2800006000000001010000,Raphnet Technologies GC/N64 to USB v3.6,a:b0,b:b7,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:b5,rightx:a3,righty:a4,start:b3,x:b1,y:b8,platform:Linux,
752 030000009b2800000300000001010000,raphnet.net 4nes4snes v1.5,a:b0,b:b4,back:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b3,x:b1,y:b5,platform:Linux,
753 030000008916000001fd000024010000,Razer Onza Classic Edition,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
754 030000008916000000fd000024010000,Razer Onza Tournament Edition,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
755 03000000321500000204000011010000,Razer Panthera (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
756 03000000321500000104000011010000,Razer Panthera (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
757 03000000321500000810000011010000,Razer Panthera Evo Arcade Stick for PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b13,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
758 03000000321500000010000011010000,Razer RAIJU,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
759 03000000321500000507000000010000,Razer Raiju Mobile,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b21,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
760 03000000321500000011000011010000,Razer Raion Fightpad for PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
761 030000008916000000fe000024010000,Razer Sabertooth,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
762 03000000c6240000045d000024010000,Razer Sabertooth,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
763 03000000c6240000045d000025010000,Razer Sabertooth,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
764 03000000321500000009000011010000,Razer Serval,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Linux,
765 050000003215000000090000163a0000,Razer Serval,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Linux,
766 0300000032150000030a000001010000,Razer Wildcat,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
767 03000000790000001100000010010000,Retrolink SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Linux,
768 0300000081170000990a000001010000,Retronic Adapter,a:b0,leftx:a0,lefty:a1,platform:Linux,
769 0300000000f000000300000000010000,RetroPad,a:b1,b:b5,back:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b3,x:b0,y:b4,platform:Linux,
770 030000006b140000010d000011010000,Revolution Pro Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
771 030000006b140000130d000011010000,Revolution Pro Controller 3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
772 030000006f0e00001f01000000010000,Rock Candy,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
773 030000006f0e00001e01000011010000,Rock Candy PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
774 030000006f0e00004601000001010000,Rock Candy Xbox One Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
775 03000000a306000023f6000011010000,Saitek Cyborg V.1 Game Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b0,y:b3,platform:Linux,
776 03000000a30600001005000000010000,Saitek P150,a:b0,b:b1,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b7,lefttrigger:b6,rightshoulder:b2,righttrigger:b5,x:b3,y:b4,platform:Linux,
777 03000000a30600000701000000010000,Saitek P220,a:b2,b:b3,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,lefttrigger:b7,rightshoulder:b4,righttrigger:b5,x:b0,y:b1,platform:Linux,
778 03000000a30600000cff000010010000,Saitek P2500 Force Rumble Pad,a:b2,b:b3,back:b11,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a3,righty:a2,start:b10,x:b0,y:b1,platform:Linux,
779 03000000a30600000c04000011010000,Saitek P2900 Wireless Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b12,x:b0,y:b3,platform:Linux,
780 03000000300f00001201000010010000,Saitek P380,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Linux,
781 03000000a30600000901000000010000,Saitek P880,a:b2,b:b3,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a3,righty:a2,x:b0,y:b1,platform:Linux,
782 03000000a30600000b04000000010000,Saitek P990 Dual Analog Pad,a:b1,b:b2,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b8,x:b0,y:b3,platform:Linux,
783 03000000a306000018f5000010010000,Saitek PLC Saitek P3200 Rumble Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b0,y:b3,platform:Linux,
784 03000000a306000020f6000011010000,Saitek PS2700 Rumble Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b0,y:b3,platform:Linux,
785 03000000d81d00000e00000010010000,Savior,a:b0,b:b1,back:b8,leftshoulder:b6,leftstick:b10,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b2,rightstick:b11,righttrigger:b3,start:b9,x:b4,y:b5,platform:Linux,
786 03000000c01600008704000011010000,Serial/Keyboard/Mouse/Joystick,a:b12,b:b10,back:b4,dpdown:b2,dpleft:b3,dpright:b1,dpup:b0,leftshoulder:b9,leftstick:b14,lefttrigger:b6,leftx:a1,lefty:a0,rightshoulder:b8,rightstick:b15,righttrigger:b7,rightx:a2,righty:a3,start:b5,x:b13,y:b11,platform:Linux,
787 03000000f025000021c1000010010000,ShanWan Gioteck PS3 Wired Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,
788 03000000632500007505000010010000,SHANWAN PS3/PC Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,
789 03000000bc2000000055000010010000,ShanWan PS3/PC Wired GamePad,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
790 030000005f140000c501000010010000,SHANWAN Trust Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,
791 03000000632500002305000010010000,ShanWan USB Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,
792 03000000341a00000908000010010000,SL-6566,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,
793 030000004c050000e60c000011810000,Sony DualSense,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux,
794 030000004c050000e60c000000006800,Sony DualSense,a:b0,b:b1,x:b2,y:b3,back:b4,guide:b5,start:b6,leftstick:b7,rightstick:b8,leftshoulder:b9,rightshoulder:b10,dpup:b11,dpdown:b12,dpleft:b13,dpright:b14,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,platform:Linux,
795 050000004c050000e60c000000810000,Sony DualSense ,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux,
796 030000004c050000e60c000000016800,Sony DualSense ,a:b0,b:b1,x:b2,y:b3,back:b4,guide:b5,start:b6,leftstick:b7,rightstick:b8,leftshoulder:b9,rightshoulder:b10,dpup:b11,dpdown:b12,dpleft:b13,dpright:b14,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,platform:Linux,
797 03000000250900000500000000010000,Sony PS2 pad with SmartJoy adapter,a:b2,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Linux,
798 030000005e0400008e02000073050000,Speedlink TORID Wireless Gamepad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
799 030000005e0400008e02000020200000,SpeedLink XEOX Pro Analog Gamepad pad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
800 03000000d11800000094000011010000,Stadia Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Linux,
801 03000000de2800000112000001000000,Steam Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,paddle1:b11,paddle2:b10,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:Linux,
802 03000000de2800000211000001000000,Steam Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,paddle1:b11,paddle2:b10,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:Linux,
803 03000000de2800004211000001000000,Steam Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,paddle1:b11,paddle2:b10,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:Linux,
804 03000000de2800004211000011010000,Steam Controller,a:b2,b:b3,back:b10,dpdown:b18,dpleft:b19,dpright:b20,dpup:b17,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b5,platform:Linux,
805 03000000de280000fc11000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
806 05000000de2800000212000001000000,Steam Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,paddle1:b11,paddle2:b10,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:Linux,
807 05000000de2800000511000001000000,Steam Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,paddle1:b11,paddle2:b10,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:Linux,
808 05000000de2800000611000001000000,Steam Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,paddle1:b11,paddle2:b10,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:Linux,
809 03000000de280000ff11000001000000,Steam Virtual Gamepad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
810 03000000381000003014000075010000,SteelSeries Stratus Duo,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
811 03000000381000003114000075010000,SteelSeries Stratus Duo,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
812 0500000011010000311400001b010000,SteelSeries Stratus Duo,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b32,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
813 05000000110100001914000009010000,SteelSeries Stratus XL,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
814 03000000ad1b000038f0000090040000,Street Fighter IV FightStick TE,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
815 030000003b07000004a1000000010000,Suncom SFX Plus for USB,a:b0,b:b2,back:b7,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b9,righttrigger:b5,start:b8,x:b1,y:b3,platform:Linux,
816 03000000666600000488000000010000,Super Joy Box 5 Pro,a:b2,b:b1,back:b9,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Linux,
817 0300000000f00000f100000000010000,Super RetroPort,a:b1,b:b5,back:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b3,x:b0,y:b4,platform:Linux,
818 03000000457500002211000010010000,SZMY-POWER CO. LTD. GAMEPAD,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,
819 030000008f0e00000d31000010010000,SZMY-POWER CO. LTD. GAMEPAD 3 TURBO,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
820 030000008f0e00001431000010010000,SZMY-POWER CO. LTD. PS3 gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
821 030000004f04000020b3000010010000,Thrustmaster 2 in 1 DT,a:b0,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b1,y:b3,platform:Linux,
822 030000004f04000015b3000010010000,Thrustmaster Dual Analog 4,a:b0,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b1,y:b3,platform:Linux,
823 030000004f04000023b3000000010000,Thrustmaster Dual Trigger 3-in-1,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
824 030000004f0400000ed0000011010000,ThrustMaster eSwap PRO Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
825 03000000b50700000399000000010000,Thrustmaster Firestorm Digital 2,a:b2,b:b4,back:b11,leftshoulder:b6,leftstick:b10,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b8,rightstick:b0,righttrigger:b9,start:b1,x:b3,y:b5,platform:Linux,
826 030000004f04000003b3000010010000,Thrustmaster Firestorm Dual Analog 2,a:b0,b:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b9,rightx:a2,righty:a3,x:b1,y:b3,platform:Linux,
827 030000004f04000000b3000010010000,Thrustmaster Firestorm Dual Power,a:b0,b:b2,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b11,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b12,righttrigger:b7,rightx:a2,righty:a3,start:b10,x:b1,y:b3,platform:Linux,
828 030000004f04000026b3000002040000,Thrustmaster Gamepad GP XID,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
829 03000000c6240000025b000002020000,Thrustmaster GPX Gamepad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
830 030000004f04000008d0000000010000,Thrustmaster Run N Drive Wireless,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
831 030000004f04000009d0000000010000,Thrustmaster Run N Drive Wireless PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
832 030000004f04000007d0000000010000,Thrustmaster T Mini Wireless,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,
833 030000004f04000012b3000010010000,Thrustmaster vibrating gamepad,a:b0,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b1,y:b3,platform:Linux,
834 03000000bd12000015d0000010010000,Tomee SNES USB Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Linux,
835 03000000d814000007cd000011010000,Toodles 2008 Chimp PC/PS3,a:b0,b:b1,back:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b9,x:b3,y:b2,platform:Linux,
836 030000005e0400008e02000070050000,Torid,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
837 03000000c01100000591000011010000,Torid,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,
838 03000000100800000100000010010000,Twin USB PS2 Adapter,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Linux,
839 03000000100800000300000010010000,USB Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Linux,
840 03000000790000000600000007010000,USB gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b3,y:b0,platform:Linux,
841 03000000790000001100000000010000,USB Gamepad1,a:b2,b:b1,back:b8,dpdown:a0,dpleft:a1,dpright:a2,dpup:a4,start:b9,platform:Linux,
842 030000006f0e00000302000011010000,Victrix Pro Fight Stick for PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux,
843 030000006f0e00000702000011010000,Victrix Pro Fight Stick for PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux,
844 05000000ac0500003232000001000000,VR-BOX,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b2,y:b3,platform:Linux,
845 03000000791d00000103000010010000,Wii Classic Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,
846 050000000d0f0000f600000001000000,Wireless HORIPAD Switch Pro Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,
847 030000005e0400008e02000010010000,X360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
848 030000005e0400008e02000014010000,X360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
849 030000005e0400001907000000010000,X360 Wireless Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
850 030000005e0400009102000007010000,X360 Wireless Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
851 030000005e040000a102000000010000,X360 Wireless Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
852 030000005e040000a102000007010000,X360 Wireless Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
853 0000000058626f782033363020576900,Xbox 360 Wireless Controller,a:b0,b:b1,back:b14,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,guide:b7,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b6,x:b2,y:b3,platform:Linux,
854 030000005e040000a102000014010000,Xbox 360 Wireless Receiver (XBOX),a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
855 0000000058626f782047616d65706100,Xbox Gamepad (userspace driver),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Linux,
856 030000005e040000d102000002010000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
857 050000005e040000fd02000030110000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
858 050000005e040000050b000002090000,Xbox One Elite Series 2,a:b0,b:b1,back:b136,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a6,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
859 030000005e040000ea02000000000000,Xbox One Wireless Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
860 050000005e040000e002000003090000,Xbox One Wireless Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
861 050000005e040000fd02000003090000,Xbox One Wireless Controller,a:b0,b:b1,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b16,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
862 030000005e040000ea02000001030000,Xbox One Wireless Controller (Model 1708),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
863 030000005e040000120b000001050000,Xbox Series Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
864 030000005e040000130b000005050000,Xbox Series Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
865 050000005e040000130b000001050000,Xbox Series Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
866 050000005e040000130b000005050000,Xbox Series Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
867 030000005e0400008e02000000010000,xbox360 Wireless EasySMX,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
868 03000000450c00002043000010010000,XEOX Gamepad SL-6556-BK,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux,
869 03000000ac0500005b05000010010000,Xiaoji Gamesir-G3w,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux,
870 05000000172700004431000029010000,XiaoMi Game Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b20,leftshoulder:b6,leftstick:b13,lefttrigger:a7,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a6,rightx:a2,righty:a5,start:b11,x:b3,y:b4,platform:Linux,
871 03000000c0160000e105000001010000,Xin-Mo Xin-Mo Dual Arcade,a:b4,b:b3,back:b6,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b9,leftshoulder:b2,leftx:a0,lefty:a1,rightshoulder:b5,start:b7,x:b1,y:b0,platform:Linux,
872 xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
873 03000000120c0000100e000011010000,ZEROPLUS P4 Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
874 03000000120c0000101e000011010000,ZEROPLUS P4 Wired Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux,
875
876 # Android
877 05000000c82d000006500000ffff3f00,8BitDo M30 Gamepad,a:b1,b:b0,back:b4,guide:b17,leftshoulder:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b10,righttrigger:a4,start:b6,x:b3,y:b2,platform:Android,
878 05000000c82d000051060000ffff3f00,8BitDo M30 Gamepad,a:b1,b:b0,back:b4,guide:b17,leftshoulder:b9,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,righttrigger:a5,start:b6,x:b3,y:b2,platform:Android,
879 05000000c82d000015900000ffff3f00,8BitDo N30 Pro 2,a:b1,b:b0,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android,
880 05000000c82d000065280000ffff3f00,8BitDo N30 Pro 2,a:b1,b:b0,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b17,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android,
881 050000000220000000900000ffff3f00,8BitDo NES30 Pro,a:b1,b:b0,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android,
882 050000002038000009000000ffff3f00,8BitDo NES30 Pro,a:b1,b:b0,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android,
883 05000000c82d000000600000ffff3f00,8BitDo SF30 Pro,a:b1,b:b0,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:b15,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:b16,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android,
884 05000000c82d000000610000ffff3f00,8BitDo SF30 Pro,a:b1,b:b0,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android,
885 05000000c82d000012900000ffff3f00,8BitDo SN30 Gamepad,a:b1,b:b0,back:b4,leftshoulder:b9,leftx:a0,lefty:a1,rightshoulder:b10,start:b6,x:b3,y:b2,platform:Android,
886 05000000c82d000062280000ffff3f00,8BitDo SN30 Gamepad,a:b1,b:b0,back:b4,leftshoulder:b9,leftx:a0,lefty:a1,rightshoulder:b10,start:b6,x:b3,y:b2,platform:Android,
887 05000000c82d000001600000ffff3f00,8BitDo SN30 Pro,a:b1,b:b0,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android,
888 05000000c82d000002600000ffff0f00,8BitDo SN30 Pro+,a:b1,b:b0,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b17,leftshoulder:b9,leftstick:b7,lefttrigger:b15,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:b16,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android,
889 050000002028000009000000ffff3f00,8BitDo SNES30 Gamepad,a:b1,b:b0,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android,
890 050000003512000020ab000000780f00,8BitDo SNES30 Gamepad,a:b21,b:b20,back:b30,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b26,rightshoulder:b27,start:b31,x:b24,y:b23,platform:Android,
891 05000000c82d000018900000ffff0f00,8BitDo Zero 2,a:b1,b:b0,back:b4,leftshoulder:b9,leftx:a0,lefty:a1,rightshoulder:b10,start:b6,x:b3,y:b2,platform:Android,
892 05000000c82d000030320000ffff0f00,8BitDo Zero 2,a:b1,b:b0,back:b4,leftshoulder:b9,leftx:a0,lefty:a1,rightshoulder:b10,start:b6,x:b3,y:b2,platform:Android,
893 05000000bc20000000550000ffff3f00,GameSir G3w,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,
894 05000000d6020000e5890000dfff3f00,GPD XD Plus,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a4,rightx:a2,righty:a5,start:b6,x:b2,y:b3,platform:Android,
895 0500000031366332860c44aadfff0f00,GS Gamepad,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:b15,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:b16,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,
896 0500000083050000602000000ffe0000,iBuffalo SNES Controller,a:b1,b:b0,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b15,rightshoulder:b16,start:b10,x:b3,y:b2,platform:Android,
897 64633436313965656664373634323364,Microsoft X-Box 360 pad,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,x:b2,y:b3,platform:Android,
898 7573622067616d657061642020202020,NEXT SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,righttrigger:b6,start:b9,x:b3,y:b0,platform:Android,
899 050000007e05000009200000ffff0f00,Nintendo Switch Pro Controller,a:b0,b:b1,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b3,leftstick:b4,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b6,righttrigger:b10,rightx:a2,righty:a3,start:b16,x:b17,y:b2,platform:Android,
900 37336435666338653565313731303834,NVIDIA Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,
901 4e564944494120436f72706f72617469,NVIDIA Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,
902 61363931656135336130663561616264,NVIDIA Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,
903 050000005509000003720000cf7f3f00,NVIDIA Controller v01.01,a:b0,b:b1,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,
904 050000005509000010720000ffff3f00,NVIDIA Controller v01.03,a:b0,b:b1,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,
905 050000005509000014720000df7f3f00,NVIDIA Controller v01.04,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a4,rightx:a2,righty:a5,start:b6,x:b2,y:b3,platform:Android,
906 050000004c05000068020000dfff3f00,PS3 Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,
907 030000004c050000cc09000000006800,PS4 Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,
908 050000004c050000c4050000fffe3f00,PS4 Controller,a:b1,b:b17,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b3,leftstick:b4,lefttrigger:+a3,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b6,righttrigger:+a4,rightx:a2,righty:a5,start:b16,x:b0,y:b2,platform:Android,
909 050000004c050000c4050000ffff3f00,PS4 Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,
910 050000004c050000cc090000fffe3f00,PS4 Controller,a:b1,b:b17,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b3,leftstick:b4,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b6,righttrigger:a4,rightx:a2,righty:a5,start:b16,x:b0,y:b2,platform:Android,
911 050000004c050000cc090000ffff3f00,PS4 Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,
912 35643031303033326130316330353564,PS4 Controller,a:b1,b:b17,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b3,leftstick:b4,lefttrigger:+a3,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b6,righttrigger:+a4,rightx:a2,righty:a5,start:b16,x:b0,y:b2,platform:Android,
913 050000004c050000e60c0000fffe3f00,PS5 Controller,a:b1,b:b17,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b3,leftstick:b4,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b6,righttrigger:a4,rightx:a2,righty:a5,start:b16,x:b0,y:b2,platform:Android,
914 62653861643333663663383332396665,Razer Kishi,a:b0,b:b1,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,
915 050000003215000005070000ffff3f00,Razer Raiju Mobile,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,
916 050000003215000007070000ffff3f00,Razer Raiju Mobile,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,
917 050000003215000000090000bf7f3f00,Razer Serval,a:b0,b:b1,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,x:b2,y:b3,platform:Android,
918 32633532643734376632656664383733,Sony DualSense,a:b1,b:b19,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b3,leftstick:b15,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b20,rightstick:b6,righttrigger:b10,rightx:a2,righty:a5,start:b18,x:b0,y:b2,platform:Android,
919 61303162353165316365336436343139,Sony DualSense,a:b1,b:b19,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b3,leftstick:b15,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b20,rightstick:b6,righttrigger:b10,rightx:a2,righty:a5,start:b18,x:b0,y:b2,platform:Android,
920 05000000de2800000511000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:Android,
921 05000000de2800000611000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:Android,
922 050000004f0400000ed00000fffe3f00,ThrustMaster eSwap PRO Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,
923 5477696e20555342204a6f7973746963,Twin USB Joystick,a:b22,b:b21,back:b28,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b26,leftstick:b30,lefttrigger:b24,leftx:a0,lefty:a1,rightshoulder:b27,rightstick:b31,righttrigger:b25,rightx:a3,righty:a2,start:b29,x:b23,y:b20,platform:Android,
924 30306539356238653637313730656134,Wireless HORIPAD Switch Pro Controller,a:b0,b:b1,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b3,leftstick:b15,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b20,rightstick:b6,righttrigger:b10,rightx:a2,righty:a3,start:b18,x:b19,y:b2,platform:Android,
925 050000005e040000fd020000ff7f3f00,Xbox One S Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,
926 050000005e040000e00200000ffe3f00,Xbox One Wireless Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b3,leftstick:b15,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b16,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b17,y:b2,platform:Android,
927 050000005e040000fd020000ffff3f00,Xbox One Wireless Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,
928 050000005e040000130b0000ffff3f00,Xbox Series Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,
929 65633038363832353634653836396239,Xbox Series Controller,a:b0,b:b1,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android,
930 050000005e04000091020000ff073f00,Xbox Wireless Controller,a:b0,b:b1,back:b4,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a3,righty:a4,start:b6,x:b2,y:b3,platform:Android,
931 34356136633366613530316338376136,Xbox Wireless Controller,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b3,leftstick:b15,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b16,righttrigger:a5,rightx:a3,righty:a4,x:b17,y:b2,platform:Android,
932 050000001727000044310000ffff3f00,XiaoMi Game Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a7,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a6,rightx:a2,righty:a5,start:b6,x:b2,y:b3,platform:Android,
933
934 # iOS
935 05000000ac0500000100000000006d01,*,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b4,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a5,rightx:a3,righty:a4,x:b2,y:b3,platform:iOS,
936 05000000ac050000010000004f066d01,*,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b4,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a5,rightx:a3,righty:a4,x:b2,y:b3,platform:iOS,
937 05000000ac05000001000000cf076d01,*,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,x:b2,y:b3,platform:iOS,
938 05000000ac05000001000000df076d01,*,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b2,y:b3,platform:iOS,
939 05000000ac05000001000000ff076d01,*,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b2,y:b3,platform:iOS,
940 05000000ac0500000200000000006d02,*,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b4,rightshoulder:b5,x:b2,y:b3,platform:iOS,
941 05000000ac050000020000004f066d02,*,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b4,rightshoulder:b5,x:b2,y:b3,platform:iOS,
942 4d466947616d65706164010000000000,MFi Extended Gamepad,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a5,rightx:a3,righty:a4,start:b6,x:b2,y:b3,platform:iOS,
943 4d466947616d65706164020000000000,MFi Gamepad,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,rightshoulder:b5,start:b6,x:b2,y:b3,platform:iOS,
944 050000004c050000cc090000df070000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b2,y:b3,platform:iOS,
945 050000004c050000cc090000ff070000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b2,y:b3,platform:iOS,
946 050000004c050000cc090000ff870001,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b10,touchpad:b11,x:b2,y:b3,platform:iOS,
947 050000004c050000cc090000ff876d01,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,misc1:b11,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b2,y:b3,platform:iOS,
948 05000000ac0500000300000000006d03,Remote,a:b0,b:b2,leftx:a0,lefty:a1,platform:iOS,
949 05000000ac0500000300000043006d03,Remote,a:b0,b:b2,leftx:a0,lefty:a1,platform:iOS,
950 05000000de2800000511000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:iOS,
951 05000000de2800000611000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:iOS,
952 050000005e040000050b0000ff070001,Xbox Elite Wireless Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,paddle1:b11,paddle2:b13,paddle3:b12,paddle4:b14,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b2,y:b3,platform:iOS,
953 050000005e040000e0020000df070000,Xbox Wireless Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b2,y:b3,platform:iOS,
954 050000005e040000e0020000ff070000,Xbox Wireless Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b2,y:b3,platform:iOS,
File include/SDL2/SDL.h added (mode: 100644) (index 0000000..e2656ca)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL.h
24 *
25 * Main include header for the SDL library
26 */
27
28
29 #ifndef SDL_h_
30 #define SDL_h_
31
32 #include "SDL_main.h"
33 #include "SDL_stdinc.h"
34 #include "SDL_assert.h"
35 #include "SDL_atomic.h"
36 #include "SDL_audio.h"
37 #include "SDL_clipboard.h"
38 #include "SDL_cpuinfo.h"
39 #include "SDL_endian.h"
40 #include "SDL_error.h"
41 #include "SDL_events.h"
42 #include "SDL_filesystem.h"
43 #include "SDL_gamecontroller.h"
44 #include "SDL_haptic.h"
45 #include "SDL_hints.h"
46 #include "SDL_joystick.h"
47 #include "SDL_loadso.h"
48 #include "SDL_log.h"
49 #include "SDL_messagebox.h"
50 #include "SDL_metal.h"
51 #include "SDL_mutex.h"
52 #include "SDL_power.h"
53 #include "SDL_render.h"
54 #include "SDL_rwops.h"
55 #include "SDL_sensor.h"
56 #include "SDL_shape.h"
57 #include "SDL_system.h"
58 #include "SDL_thread.h"
59 #include "SDL_timer.h"
60 #include "SDL_version.h"
61 #include "SDL_video.h"
62 #include "SDL_locale.h"
63 #include "SDL_misc.h"
64
65 #include "begin_code.h"
66 /* Set up for C function definitions, even when using C++ */
67 #ifdef __cplusplus
68 extern "C" {
69 #endif
70
71 /* As of version 0.5, SDL is loaded dynamically into the application */
72
73 /**
74 * \name SDL_INIT_*
75 *
76 * These are the flags which may be passed to SDL_Init(). You should
77 * specify the subsystems which you will be using in your application.
78 */
79 /* @{ */
80 #define SDL_INIT_TIMER 0x00000001u
81 #define SDL_INIT_AUDIO 0x00000010u
82 #define SDL_INIT_VIDEO 0x00000020u /**< SDL_INIT_VIDEO implies SDL_INIT_EVENTS */
83 #define SDL_INIT_JOYSTICK 0x00000200u /**< SDL_INIT_JOYSTICK implies SDL_INIT_EVENTS */
84 #define SDL_INIT_HAPTIC 0x00001000u
85 #define SDL_INIT_GAMECONTROLLER 0x00002000u /**< SDL_INIT_GAMECONTROLLER implies SDL_INIT_JOYSTICK */
86 #define SDL_INIT_EVENTS 0x00004000u
87 #define SDL_INIT_SENSOR 0x00008000u
88 #define SDL_INIT_NOPARACHUTE 0x00100000u /**< compatibility; this flag is ignored. */
89 #define SDL_INIT_EVERYTHING ( \
90 SDL_INIT_TIMER | SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_EVENTS | \
91 SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMECONTROLLER | SDL_INIT_SENSOR \
92 )
93 /* @} */
94
95 /**
96 * This function initializes the subsystems specified by \c flags
97 */
98 extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags);
99
100 /**
101 * This function initializes specific SDL subsystems
102 *
103 * Subsystem initialization is ref-counted, you must call
104 * SDL_QuitSubSystem() for each SDL_InitSubSystem() to correctly
105 * shutdown a subsystem manually (or call SDL_Quit() to force shutdown).
106 * If a subsystem is already loaded then this call will
107 * increase the ref-count and return.
108 */
109 extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags);
110
111 /**
112 * This function cleans up specific SDL subsystems
113 */
114 extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags);
115
116 /**
117 * This function returns a mask of the specified subsystems which have
118 * previously been initialized.
119 *
120 * If \c flags is 0, it returns a mask of all initialized subsystems.
121 */
122 extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags);
123
124 /**
125 * This function cleans up all initialized subsystems. You should
126 * call it upon all exit conditions.
127 */
128 extern DECLSPEC void SDLCALL SDL_Quit(void);
129
130 /* Ends C function definitions when using C++ */
131 #ifdef __cplusplus
132 }
133 #endif
134 #include "close_code.h"
135
136 #endif /* SDL_h_ */
137
138 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_assert.h added (mode: 100644) (index 0000000..f8a368e)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 #ifndef SDL_assert_h_
23 #define SDL_assert_h_
24
25 #include "SDL_config.h"
26
27 #include "begin_code.h"
28 /* Set up for C function definitions, even when using C++ */
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 #ifndef SDL_ASSERT_LEVEL
34 #ifdef SDL_DEFAULT_ASSERT_LEVEL
35 #define SDL_ASSERT_LEVEL SDL_DEFAULT_ASSERT_LEVEL
36 #elif defined(_DEBUG) || defined(DEBUG) || \
37 (defined(__GNUC__) && !defined(__OPTIMIZE__))
38 #define SDL_ASSERT_LEVEL 2
39 #else
40 #define SDL_ASSERT_LEVEL 1
41 #endif
42 #endif /* SDL_ASSERT_LEVEL */
43
44 /*
45 These are macros and not first class functions so that the debugger breaks
46 on the assertion line and not in some random guts of SDL, and so each
47 assert can have unique static variables associated with it.
48 */
49
50 #if defined(_MSC_VER)
51 /* Don't include intrin.h here because it contains C++ code */
52 extern void __cdecl __debugbreak(void);
53 #define SDL_TriggerBreakpoint() __debugbreak()
54 #elif ( (!defined(__NACL__)) && ((defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))) )
55 #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" )
56 #elif ( defined(__APPLE__) && defined(__arm64__) ) /* this might work on other ARM targets, but this is a known quantity... */
57 #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "brk #22\n\t" )
58 #elif defined(__386__) && defined(__WATCOMC__)
59 #define SDL_TriggerBreakpoint() { _asm { int 0x03 } }
60 #elif defined(HAVE_SIGNAL_H) && !defined(__WATCOMC__)
61 #include <signal.h>
62 #define SDL_TriggerBreakpoint() raise(SIGTRAP)
63 #else
64 /* How do we trigger breakpoints on this platform? */
65 #define SDL_TriggerBreakpoint()
66 #endif
67
68 #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 supports __func__ as a standard. */
69 # define SDL_FUNCTION __func__
70 #elif ((__GNUC__ >= 2) || defined(_MSC_VER) || defined (__WATCOMC__))
71 # define SDL_FUNCTION __FUNCTION__
72 #else
73 # define SDL_FUNCTION "???"
74 #endif
75 #define SDL_FILE __FILE__
76 #define SDL_LINE __LINE__
77
78 /*
79 sizeof (x) makes the compiler still parse the expression even without
80 assertions enabled, so the code is always checked at compile time, but
81 doesn't actually generate code for it, so there are no side effects or
82 expensive checks at run time, just the constant size of what x WOULD be,
83 which presumably gets optimized out as unused.
84 This also solves the problem of...
85
86 int somevalue = blah();
87 SDL_assert(somevalue == 1);
88
89 ...which would cause compiles to complain that somevalue is unused if we
90 disable assertions.
91 */
92
93 /* "while (0,0)" fools Microsoft's compiler's /W4 warning level into thinking
94 this condition isn't constant. And looks like an owl's face! */
95 #ifdef _MSC_VER /* stupid /W4 warnings. */
96 #define SDL_NULL_WHILE_LOOP_CONDITION (0,0)
97 #else
98 #define SDL_NULL_WHILE_LOOP_CONDITION (0)
99 #endif
100
101 #define SDL_disabled_assert(condition) \
102 do { (void) sizeof ((condition)); } while (SDL_NULL_WHILE_LOOP_CONDITION)
103
104 typedef enum
105 {
106 SDL_ASSERTION_RETRY, /**< Retry the assert immediately. */
107 SDL_ASSERTION_BREAK, /**< Make the debugger trigger a breakpoint. */
108 SDL_ASSERTION_ABORT, /**< Terminate the program. */
109 SDL_ASSERTION_IGNORE, /**< Ignore the assert. */
110 SDL_ASSERTION_ALWAYS_IGNORE /**< Ignore the assert from now on. */
111 } SDL_AssertState;
112
113 typedef struct SDL_AssertData
114 {
115 int always_ignore;
116 unsigned int trigger_count;
117 const char *condition;
118 const char *filename;
119 int linenum;
120 const char *function;
121 const struct SDL_AssertData *next;
122 } SDL_AssertData;
123
124 #if (SDL_ASSERT_LEVEL > 0)
125
126 /* Never call this directly. Use the SDL_assert* macros. */
127 extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *,
128 const char *,
129 const char *, int)
130 #if defined(__clang__)
131 #if __has_feature(attribute_analyzer_noreturn)
132 /* this tells Clang's static analysis that we're a custom assert function,
133 and that the analyzer should assume the condition was always true past this
134 SDL_assert test. */
135 __attribute__((analyzer_noreturn))
136 #endif
137 #endif
138 ;
139
140 /* the do {} while(0) avoids dangling else problems:
141 if (x) SDL_assert(y); else blah();
142 ... without the do/while, the "else" could attach to this macro's "if".
143 We try to handle just the minimum we need here in a macro...the loop,
144 the static vars, and break points. The heavy lifting is handled in
145 SDL_ReportAssertion(), in SDL_assert.c.
146 */
147 #define SDL_enabled_assert(condition) \
148 do { \
149 while ( !(condition) ) { \
150 static struct SDL_AssertData sdl_assert_data = { \
151 0, 0, #condition, 0, 0, 0, 0 \
152 }; \
153 const SDL_AssertState sdl_assert_state = SDL_ReportAssertion(&sdl_assert_data, SDL_FUNCTION, SDL_FILE, SDL_LINE); \
154 if (sdl_assert_state == SDL_ASSERTION_RETRY) { \
155 continue; /* go again. */ \
156 } else if (sdl_assert_state == SDL_ASSERTION_BREAK) { \
157 SDL_TriggerBreakpoint(); \
158 } \
159 break; /* not retrying. */ \
160 } \
161 } while (SDL_NULL_WHILE_LOOP_CONDITION)
162
163 #endif /* enabled assertions support code */
164
165 /* Enable various levels of assertions. */
166 #if SDL_ASSERT_LEVEL == 0 /* assertions disabled */
167 # define SDL_assert(condition) SDL_disabled_assert(condition)
168 # define SDL_assert_release(condition) SDL_disabled_assert(condition)
169 # define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)
170 #elif SDL_ASSERT_LEVEL == 1 /* release settings. */
171 # define SDL_assert(condition) SDL_disabled_assert(condition)
172 # define SDL_assert_release(condition) SDL_enabled_assert(condition)
173 # define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)
174 #elif SDL_ASSERT_LEVEL == 2 /* normal settings. */
175 # define SDL_assert(condition) SDL_enabled_assert(condition)
176 # define SDL_assert_release(condition) SDL_enabled_assert(condition)
177 # define SDL_assert_paranoid(condition) SDL_disabled_assert(condition)
178 #elif SDL_ASSERT_LEVEL == 3 /* paranoid settings. */
179 # define SDL_assert(condition) SDL_enabled_assert(condition)
180 # define SDL_assert_release(condition) SDL_enabled_assert(condition)
181 # define SDL_assert_paranoid(condition) SDL_enabled_assert(condition)
182 #else
183 # error Unknown assertion level.
184 #endif
185
186 /* this assertion is never disabled at any level. */
187 #define SDL_assert_always(condition) SDL_enabled_assert(condition)
188
189
190 typedef SDL_AssertState (SDLCALL *SDL_AssertionHandler)(
191 const SDL_AssertData* data, void* userdata);
192
193 /**
194 * \brief Set an application-defined assertion handler.
195 *
196 * This allows an app to show its own assertion UI and/or force the
197 * response to an assertion failure. If the app doesn't provide this, SDL
198 * will try to do the right thing, popping up a system-specific GUI dialog,
199 * and probably minimizing any fullscreen windows.
200 *
201 * This callback may fire from any thread, but it runs wrapped in a mutex, so
202 * it will only fire from one thread at a time.
203 *
204 * Setting the callback to NULL restores SDL's original internal handler.
205 *
206 * This callback is NOT reset to SDL's internal handler upon SDL_Quit()!
207 *
208 * Return SDL_AssertState value of how to handle the assertion failure.
209 *
210 * \param handler Callback function, called when an assertion fails.
211 * \param userdata A pointer passed to the callback as-is.
212 */
213 extern DECLSPEC void SDLCALL SDL_SetAssertionHandler(
214 SDL_AssertionHandler handler,
215 void *userdata);
216
217 /**
218 * \brief Get the default assertion handler.
219 *
220 * This returns the function pointer that is called by default when an
221 * assertion is triggered. This is an internal function provided by SDL,
222 * that is used for assertions when SDL_SetAssertionHandler() hasn't been
223 * used to provide a different function.
224 *
225 * \return The default SDL_AssertionHandler that is called when an assert triggers.
226 */
227 extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetDefaultAssertionHandler(void);
228
229 /**
230 * \brief Get the current assertion handler.
231 *
232 * This returns the function pointer that is called when an assertion is
233 * triggered. This is either the value last passed to
234 * SDL_SetAssertionHandler(), or if no application-specified function is
235 * set, is equivalent to calling SDL_GetDefaultAssertionHandler().
236 *
237 * \param puserdata Pointer to a void*, which will store the "userdata"
238 * pointer that was passed to SDL_SetAssertionHandler().
239 * This value will always be NULL for the default handler.
240 * If you don't care about this data, it is safe to pass
241 * a NULL pointer to this function to ignore it.
242 * \return The SDL_AssertionHandler that is called when an assert triggers.
243 */
244 extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetAssertionHandler(void **puserdata);
245
246 /**
247 * \brief Get a list of all assertion failures.
248 *
249 * Get all assertions triggered since last call to SDL_ResetAssertionReport(),
250 * or the start of the program.
251 *
252 * The proper way to examine this data looks something like this:
253 *
254 * <code>
255 * const SDL_AssertData *item = SDL_GetAssertionReport();
256 * while (item) {
257 * printf("'%s', %s (%s:%d), triggered %u times, always ignore: %s.\\n",
258 * item->condition, item->function, item->filename,
259 * item->linenum, item->trigger_count,
260 * item->always_ignore ? "yes" : "no");
261 * item = item->next;
262 * }
263 * </code>
264 *
265 * \return List of all assertions.
266 * \sa SDL_ResetAssertionReport
267 */
268 extern DECLSPEC const SDL_AssertData * SDLCALL SDL_GetAssertionReport(void);
269
270 /**
271 * \brief Reset the list of all assertion failures.
272 *
273 * Reset list of all assertions triggered.
274 *
275 * \sa SDL_GetAssertionReport
276 */
277 extern DECLSPEC void SDLCALL SDL_ResetAssertionReport(void);
278
279
280 /* these had wrong naming conventions until 2.0.4. Please update your app! */
281 #define SDL_assert_state SDL_AssertState
282 #define SDL_assert_data SDL_AssertData
283
284
285 /* Ends C function definitions when using C++ */
286 #ifdef __cplusplus
287 }
288 #endif
289 #include "close_code.h"
290
291 #endif /* SDL_assert_h_ */
292
293 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_atomic.h added (mode: 100644) (index 0000000..e99f1bc)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_atomic.h
24 *
25 * Atomic operations.
26 *
27 * IMPORTANT:
28 * If you are not an expert in concurrent lockless programming, you should
29 * only be using the atomic lock and reference counting functions in this
30 * file. In all other cases you should be protecting your data structures
31 * with full mutexes.
32 *
33 * The list of "safe" functions to use are:
34 * SDL_AtomicLock()
35 * SDL_AtomicUnlock()
36 * SDL_AtomicIncRef()
37 * SDL_AtomicDecRef()
38 *
39 * Seriously, here be dragons!
40 * ^^^^^^^^^^^^^^^^^^^^^^^^^^^
41 *
42 * You can find out a little more about lockless programming and the
43 * subtle issues that can arise here:
44 * http://msdn.microsoft.com/en-us/library/ee418650%28v=vs.85%29.aspx
45 *
46 * There's also lots of good information here:
47 * http://www.1024cores.net/home/lock-free-algorithms
48 * http://preshing.com/
49 *
50 * These operations may or may not actually be implemented using
51 * processor specific atomic operations. When possible they are
52 * implemented as true processor specific atomic operations. When that
53 * is not possible the are implemented using locks that *do* use the
54 * available atomic operations.
55 *
56 * All of the atomic operations that modify memory are full memory barriers.
57 */
58
59 #ifndef SDL_atomic_h_
60 #define SDL_atomic_h_
61
62 #include "SDL_stdinc.h"
63 #include "SDL_platform.h"
64
65 #include "begin_code.h"
66
67 /* Set up for C function definitions, even when using C++ */
68 #ifdef __cplusplus
69 extern "C" {
70 #endif
71
72 /**
73 * \name SDL AtomicLock
74 *
75 * The atomic locks are efficient spinlocks using CPU instructions,
76 * but are vulnerable to starvation and can spin forever if a thread
77 * holding a lock has been terminated. For this reason you should
78 * minimize the code executed inside an atomic lock and never do
79 * expensive things like API or system calls while holding them.
80 *
81 * The atomic locks are not safe to lock recursively.
82 *
83 * Porting Note:
84 * The spin lock functions and type are required and can not be
85 * emulated because they are used in the atomic emulation code.
86 */
87 /* @{ */
88
89 typedef int SDL_SpinLock;
90
91 /**
92 * \brief Try to lock a spin lock by setting it to a non-zero value.
93 *
94 * \param lock Points to the lock.
95 *
96 * \return SDL_TRUE if the lock succeeded, SDL_FALSE if the lock is already held.
97 */
98 extern DECLSPEC SDL_bool SDLCALL SDL_AtomicTryLock(SDL_SpinLock *lock);
99
100 /**
101 * \brief Lock a spin lock by setting it to a non-zero value.
102 *
103 * \param lock Points to the lock.
104 */
105 extern DECLSPEC void SDLCALL SDL_AtomicLock(SDL_SpinLock *lock);
106
107 /**
108 * \brief Unlock a spin lock by setting it to 0. Always returns immediately
109 *
110 * \param lock Points to the lock.
111 */
112 extern DECLSPEC void SDLCALL SDL_AtomicUnlock(SDL_SpinLock *lock);
113
114 /* @} *//* SDL AtomicLock */
115
116
117 /**
118 * The compiler barrier prevents the compiler from reordering
119 * reads and writes to globally visible variables across the call.
120 */
121 #if defined(_MSC_VER) && (_MSC_VER > 1200) && !defined(__clang__)
122 void _ReadWriteBarrier(void);
123 #pragma intrinsic(_ReadWriteBarrier)
124 #define SDL_CompilerBarrier() _ReadWriteBarrier()
125 #elif (defined(__GNUC__) && !defined(__EMSCRIPTEN__)) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5120))
126 /* This is correct for all CPUs when using GCC or Solaris Studio 12.1+. */
127 #define SDL_CompilerBarrier() __asm__ __volatile__ ("" : : : "memory")
128 #elif defined(__WATCOMC__)
129 extern _inline void SDL_CompilerBarrier (void);
130 #pragma aux SDL_CompilerBarrier = "" parm [] modify exact [];
131 #else
132 #define SDL_CompilerBarrier() \
133 { SDL_SpinLock _tmp = 0; SDL_AtomicLock(&_tmp); SDL_AtomicUnlock(&_tmp); }
134 #endif
135
136 /**
137 * Memory barriers are designed to prevent reads and writes from being
138 * reordered by the compiler and being seen out of order on multi-core CPUs.
139 *
140 * A typical pattern would be for thread A to write some data and a flag,
141 * and for thread B to read the flag and get the data. In this case you
142 * would insert a release barrier between writing the data and the flag,
143 * guaranteeing that the data write completes no later than the flag is
144 * written, and you would insert an acquire barrier between reading the
145 * flag and reading the data, to ensure that all the reads associated
146 * with the flag have completed.
147 *
148 * In this pattern you should always see a release barrier paired with
149 * an acquire barrier and you should gate the data reads/writes with a
150 * single flag variable.
151 *
152 * For more information on these semantics, take a look at the blog post:
153 * http://preshing.com/20120913/acquire-and-release-semantics
154 */
155 extern DECLSPEC void SDLCALL SDL_MemoryBarrierReleaseFunction(void);
156 extern DECLSPEC void SDLCALL SDL_MemoryBarrierAcquireFunction(void);
157
158 #if defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
159 #define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("lwsync" : : : "memory")
160 #define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("lwsync" : : : "memory")
161 #elif defined(__GNUC__) && defined(__aarch64__)
162 #define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("dmb ish" : : : "memory")
163 #define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("dmb ish" : : : "memory")
164 #elif defined(__GNUC__) && defined(__arm__)
165 #if 0 /* defined(__LINUX__) || defined(__ANDROID__) */
166 /* Information from:
167 https://chromium.googlesource.com/chromium/chromium/+/trunk/base/atomicops_internals_arm_gcc.h#19
168
169 The Linux kernel provides a helper function which provides the right code for a memory barrier,
170 hard-coded at address 0xffff0fa0
171 */
172 typedef void (*SDL_KernelMemoryBarrierFunc)();
173 #define SDL_MemoryBarrierRelease() ((SDL_KernelMemoryBarrierFunc)0xffff0fa0)()
174 #define SDL_MemoryBarrierAcquire() ((SDL_KernelMemoryBarrierFunc)0xffff0fa0)()
175 #elif 0 /* defined(__QNXNTO__) */
176 #include <sys/cpuinline.h>
177
178 #define SDL_MemoryBarrierRelease() __cpu_membarrier()
179 #define SDL_MemoryBarrierAcquire() __cpu_membarrier()
180 #else
181 #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__)
182 #define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("dmb ish" : : : "memory")
183 #define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("dmb ish" : : : "memory")
184 #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__)
185 #ifdef __thumb__
186 /* The mcr instruction isn't available in thumb mode, use real functions */
187 #define SDL_MEMORY_BARRIER_USES_FUNCTION
188 #define SDL_MemoryBarrierRelease() SDL_MemoryBarrierReleaseFunction()
189 #define SDL_MemoryBarrierAcquire() SDL_MemoryBarrierAcquireFunction()
190 #else
191 #define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r"(0) : "memory")
192 #define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r"(0) : "memory")
193 #endif /* __thumb__ */
194 #else
195 #define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("" : : : "memory")
196 #define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("" : : : "memory")
197 #endif /* __LINUX__ || __ANDROID__ */
198 #endif /* __GNUC__ && __arm__ */
199 #else
200 #if (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5120))
201 /* This is correct for all CPUs on Solaris when using Solaris Studio 12.1+. */
202 #include <mbarrier.h>
203 #define SDL_MemoryBarrierRelease() __machine_rel_barrier()
204 #define SDL_MemoryBarrierAcquire() __machine_acq_barrier()
205 #else
206 /* This is correct for the x86 and x64 CPUs, and we'll expand this over time. */
207 #define SDL_MemoryBarrierRelease() SDL_CompilerBarrier()
208 #define SDL_MemoryBarrierAcquire() SDL_CompilerBarrier()
209 #endif
210 #endif
211
212 /**
213 * \brief A type representing an atomic integer value. It is a struct
214 * so people don't accidentally use numeric operations on it.
215 */
216 typedef struct { int value; } SDL_atomic_t;
217
218 /**
219 * \brief Set an atomic variable to a new value if it is currently an old value.
220 *
221 * \return SDL_TRUE if the atomic variable was set, SDL_FALSE otherwise.
222 *
223 * \note If you don't know what this function is for, you shouldn't use it!
224 */
225 extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int newval);
226
227 /**
228 * \brief Set an atomic variable to a value.
229 *
230 * \return The previous value of the atomic variable.
231 */
232 extern DECLSPEC int SDLCALL SDL_AtomicSet(SDL_atomic_t *a, int v);
233
234 /**
235 * \brief Get the value of an atomic variable
236 */
237 extern DECLSPEC int SDLCALL SDL_AtomicGet(SDL_atomic_t *a);
238
239 /**
240 * \brief Add to an atomic variable.
241 *
242 * \return The previous value of the atomic variable.
243 *
244 * \note This same style can be used for any number operation
245 */
246 extern DECLSPEC int SDLCALL SDL_AtomicAdd(SDL_atomic_t *a, int v);
247
248 /**
249 * \brief Increment an atomic variable used as a reference count.
250 */
251 #ifndef SDL_AtomicIncRef
252 #define SDL_AtomicIncRef(a) SDL_AtomicAdd(a, 1)
253 #endif
254
255 /**
256 * \brief Decrement an atomic variable used as a reference count.
257 *
258 * \return SDL_TRUE if the variable reached zero after decrementing,
259 * SDL_FALSE otherwise
260 */
261 #ifndef SDL_AtomicDecRef
262 #define SDL_AtomicDecRef(a) (SDL_AtomicAdd(a, -1) == 1)
263 #endif
264
265 /**
266 * \brief Set a pointer to a new value if it is currently an old value.
267 *
268 * \return SDL_TRUE if the pointer was set, SDL_FALSE otherwise.
269 *
270 * \note If you don't know what this function is for, you shouldn't use it!
271 */
272 extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCASPtr(void **a, void *oldval, void *newval);
273
274 /**
275 * \brief Set a pointer to a value atomically.
276 *
277 * \return The previous value of the pointer.
278 */
279 extern DECLSPEC void* SDLCALL SDL_AtomicSetPtr(void **a, void* v);
280
281 /**
282 * \brief Get the value of a pointer atomically.
283 */
284 extern DECLSPEC void* SDLCALL SDL_AtomicGetPtr(void **a);
285
286 /* Ends C function definitions when using C++ */
287 #ifdef __cplusplus
288 }
289 #endif
290
291 #include "close_code.h"
292
293 #endif /* SDL_atomic_h_ */
294
295 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_audio.h added (mode: 100644) (index 0000000..4ba3491)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_audio.h
24 *
25 * Access to the raw audio mixing buffer for the SDL library.
26 */
27
28 #ifndef SDL_audio_h_
29 #define SDL_audio_h_
30
31 #include "SDL_stdinc.h"
32 #include "SDL_error.h"
33 #include "SDL_endian.h"
34 #include "SDL_mutex.h"
35 #include "SDL_thread.h"
36 #include "SDL_rwops.h"
37
38 #include "begin_code.h"
39 /* Set up for C function definitions, even when using C++ */
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43
44 /**
45 * \brief Audio format flags.
46 *
47 * These are what the 16 bits in SDL_AudioFormat currently mean...
48 * (Unspecified bits are always zero).
49 *
50 * \verbatim
51 ++-----------------------sample is signed if set
52 ||
53 || ++-----------sample is bigendian if set
54 || ||
55 || || ++---sample is float if set
56 || || ||
57 || || || +---sample bit size---+
58 || || || | |
59 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
60 \endverbatim
61 *
62 * There are macros in SDL 2.0 and later to query these bits.
63 */
64 typedef Uint16 SDL_AudioFormat;
65
66 /**
67 * \name Audio flags
68 */
69 /* @{ */
70
71 #define SDL_AUDIO_MASK_BITSIZE (0xFF)
72 #define SDL_AUDIO_MASK_DATATYPE (1<<8)
73 #define SDL_AUDIO_MASK_ENDIAN (1<<12)
74 #define SDL_AUDIO_MASK_SIGNED (1<<15)
75 #define SDL_AUDIO_BITSIZE(x) (x & SDL_AUDIO_MASK_BITSIZE)
76 #define SDL_AUDIO_ISFLOAT(x) (x & SDL_AUDIO_MASK_DATATYPE)
77 #define SDL_AUDIO_ISBIGENDIAN(x) (x & SDL_AUDIO_MASK_ENDIAN)
78 #define SDL_AUDIO_ISSIGNED(x) (x & SDL_AUDIO_MASK_SIGNED)
79 #define SDL_AUDIO_ISINT(x) (!SDL_AUDIO_ISFLOAT(x))
80 #define SDL_AUDIO_ISLITTLEENDIAN(x) (!SDL_AUDIO_ISBIGENDIAN(x))
81 #define SDL_AUDIO_ISUNSIGNED(x) (!SDL_AUDIO_ISSIGNED(x))
82
83 /**
84 * \name Audio format flags
85 *
86 * Defaults to LSB byte order.
87 */
88 /* @{ */
89 #define AUDIO_U8 0x0008 /**< Unsigned 8-bit samples */
90 #define AUDIO_S8 0x8008 /**< Signed 8-bit samples */
91 #define AUDIO_U16LSB 0x0010 /**< Unsigned 16-bit samples */
92 #define AUDIO_S16LSB 0x8010 /**< Signed 16-bit samples */
93 #define AUDIO_U16MSB 0x1010 /**< As above, but big-endian byte order */
94 #define AUDIO_S16MSB 0x9010 /**< As above, but big-endian byte order */
95 #define AUDIO_U16 AUDIO_U16LSB
96 #define AUDIO_S16 AUDIO_S16LSB
97 /* @} */
98
99 /**
100 * \name int32 support
101 */
102 /* @{ */
103 #define AUDIO_S32LSB 0x8020 /**< 32-bit integer samples */
104 #define AUDIO_S32MSB 0x9020 /**< As above, but big-endian byte order */
105 #define AUDIO_S32 AUDIO_S32LSB
106 /* @} */
107
108 /**
109 * \name float32 support
110 */
111 /* @{ */
112 #define AUDIO_F32LSB 0x8120 /**< 32-bit floating point samples */
113 #define AUDIO_F32MSB 0x9120 /**< As above, but big-endian byte order */
114 #define AUDIO_F32 AUDIO_F32LSB
115 /* @} */
116
117 /**
118 * \name Native audio byte ordering
119 */
120 /* @{ */
121 #if SDL_BYTEORDER == SDL_LIL_ENDIAN
122 #define AUDIO_U16SYS AUDIO_U16LSB
123 #define AUDIO_S16SYS AUDIO_S16LSB
124 #define AUDIO_S32SYS AUDIO_S32LSB
125 #define AUDIO_F32SYS AUDIO_F32LSB
126 #else
127 #define AUDIO_U16SYS AUDIO_U16MSB
128 #define AUDIO_S16SYS AUDIO_S16MSB
129 #define AUDIO_S32SYS AUDIO_S32MSB
130 #define AUDIO_F32SYS AUDIO_F32MSB
131 #endif
132 /* @} */
133
134 /**
135 * \name Allow change flags
136 *
137 * Which audio format changes are allowed when opening a device.
138 */
139 /* @{ */
140 #define SDL_AUDIO_ALLOW_FREQUENCY_CHANGE 0x00000001
141 #define SDL_AUDIO_ALLOW_FORMAT_CHANGE 0x00000002
142 #define SDL_AUDIO_ALLOW_CHANNELS_CHANGE 0x00000004
143 #define SDL_AUDIO_ALLOW_SAMPLES_CHANGE 0x00000008
144 #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)
145 /* @} */
146
147 /* @} *//* Audio flags */
148
149 /**
150 * This function is called when the audio device needs more data.
151 *
152 * \param userdata An application-specific parameter saved in
153 * the SDL_AudioSpec structure
154 * \param stream A pointer to the audio data buffer.
155 * \param len The length of that buffer in bytes.
156 *
157 * Once the callback returns, the buffer will no longer be valid.
158 * Stereo samples are stored in a LRLRLR ordering.
159 *
160 * You can choose to avoid callbacks and use SDL_QueueAudio() instead, if
161 * you like. Just open your audio device with a NULL callback.
162 */
163 typedef void (SDLCALL * SDL_AudioCallback) (void *userdata, Uint8 * stream,
164 int len);
165
166 /**
167 * The calculated values in this structure are calculated by SDL_OpenAudio().
168 *
169 * For multi-channel audio, the default SDL channel mapping is:
170 * 2: FL FR (stereo)
171 * 3: FL FR LFE (2.1 surround)
172 * 4: FL FR BL BR (quad)
173 * 5: FL FR FC BL BR (quad + center)
174 * 6: FL FR FC LFE SL SR (5.1 surround - last two can also be BL BR)
175 * 7: FL FR FC LFE BC SL SR (6.1 surround)
176 * 8: FL FR FC LFE BL BR SL SR (7.1 surround)
177 */
178 typedef struct SDL_AudioSpec
179 {
180 int freq; /**< DSP frequency -- samples per second */
181 SDL_AudioFormat format; /**< Audio data format */
182 Uint8 channels; /**< Number of channels: 1 mono, 2 stereo */
183 Uint8 silence; /**< Audio buffer silence value (calculated) */
184 Uint16 samples; /**< Audio buffer size in sample FRAMES (total samples divided by channel count) */
185 Uint16 padding; /**< Necessary for some compile environments */
186 Uint32 size; /**< Audio buffer size in bytes (calculated) */
187 SDL_AudioCallback callback; /**< Callback that feeds the audio device (NULL to use SDL_QueueAudio()). */
188 void *userdata; /**< Userdata passed to callback (ignored for NULL callbacks). */
189 } SDL_AudioSpec;
190
191
192 struct SDL_AudioCVT;
193 typedef void (SDLCALL * SDL_AudioFilter) (struct SDL_AudioCVT * cvt,
194 SDL_AudioFormat format);
195
196 /**
197 * \brief Upper limit of filters in SDL_AudioCVT
198 *
199 * The maximum number of SDL_AudioFilter functions in SDL_AudioCVT is
200 * currently limited to 9. The SDL_AudioCVT.filters array has 10 pointers,
201 * one of which is the terminating NULL pointer.
202 */
203 #define SDL_AUDIOCVT_MAX_FILTERS 9
204
205 /**
206 * \struct SDL_AudioCVT
207 * \brief A structure to hold a set of audio conversion filters and buffers.
208 *
209 * Note that various parts of the conversion pipeline can take advantage
210 * of SIMD operations (like SSE2, for example). SDL_AudioCVT doesn't require
211 * you to pass it aligned data, but can possibly run much faster if you
212 * set both its (buf) field to a pointer that is aligned to 16 bytes, and its
213 * (len) field to something that's a multiple of 16, if possible.
214 */
215 #ifdef __GNUC__
216 /* This structure is 84 bytes on 32-bit architectures, make sure GCC doesn't
217 pad it out to 88 bytes to guarantee ABI compatibility between compilers.
218 vvv
219 The next time we rev the ABI, make sure to size the ints and add padding.
220 */
221 #define SDL_AUDIOCVT_PACKED __attribute__((packed))
222 #else
223 #define SDL_AUDIOCVT_PACKED
224 #endif
225 /* */
226 typedef struct SDL_AudioCVT
227 {
228 int needed; /**< Set to 1 if conversion possible */
229 SDL_AudioFormat src_format; /**< Source audio format */
230 SDL_AudioFormat dst_format; /**< Target audio format */
231 double rate_incr; /**< Rate conversion increment */
232 Uint8 *buf; /**< Buffer to hold entire audio data */
233 int len; /**< Length of original audio buffer */
234 int len_cvt; /**< Length of converted audio buffer */
235 int len_mult; /**< buffer must be len*len_mult big */
236 double len_ratio; /**< Given len, final size is len*len_ratio */
237 SDL_AudioFilter filters[SDL_AUDIOCVT_MAX_FILTERS + 1]; /**< NULL-terminated list of filter functions */
238 int filter_index; /**< Current audio conversion function */
239 } SDL_AUDIOCVT_PACKED SDL_AudioCVT;
240
241
242 /* Function prototypes */
243
244 /**
245 * \name Driver discovery functions
246 *
247 * These functions return the list of built in audio drivers, in the
248 * order that they are normally initialized by default.
249 */
250 /* @{ */
251 extern DECLSPEC int SDLCALL SDL_GetNumAudioDrivers(void);
252 extern DECLSPEC const char *SDLCALL SDL_GetAudioDriver(int index);
253 /* @} */
254
255 /**
256 * \name Initialization and cleanup
257 *
258 * \internal These functions are used internally, and should not be used unless
259 * you have a specific need to specify the audio driver you want to
260 * use. You should normally use SDL_Init() or SDL_InitSubSystem().
261 */
262 /* @{ */
263 extern DECLSPEC int SDLCALL SDL_AudioInit(const char *driver_name);
264 extern DECLSPEC void SDLCALL SDL_AudioQuit(void);
265 /* @} */
266
267 /**
268 * This function returns the name of the current audio driver, or NULL
269 * if no driver has been initialized.
270 */
271 extern DECLSPEC const char *SDLCALL SDL_GetCurrentAudioDriver(void);
272
273 /**
274 * This function opens the audio device with the desired parameters, and
275 * returns 0 if successful, placing the actual hardware parameters in the
276 * structure pointed to by \c obtained. If \c obtained is NULL, the audio
277 * data passed to the callback function will be guaranteed to be in the
278 * requested format, and will be automatically converted to the hardware
279 * audio format if necessary. This function returns -1 if it failed
280 * to open the audio device, or couldn't set up the audio thread.
281 *
282 * When filling in the desired audio spec structure,
283 * - \c desired->freq should be the desired audio frequency in samples-per-
284 * second.
285 * - \c desired->format should be the desired audio format.
286 * - \c desired->samples is the desired size of the audio buffer, in
287 * samples. This number should be a power of two, and may be adjusted by
288 * the audio driver to a value more suitable for the hardware. Good values
289 * seem to range between 512 and 8096 inclusive, depending on the
290 * application and CPU speed. Smaller values yield faster response time,
291 * but can lead to underflow if the application is doing heavy processing
292 * and cannot fill the audio buffer in time. A stereo sample consists of
293 * both right and left channels in LR ordering.
294 * Note that the number of samples is directly related to time by the
295 * following formula: \code ms = (samples*1000)/freq \endcode
296 * - \c desired->size is the size in bytes of the audio buffer, and is
297 * calculated by SDL_OpenAudio().
298 * - \c desired->silence is the value used to set the buffer to silence,
299 * and is calculated by SDL_OpenAudio().
300 * - \c desired->callback should be set to a function that will be called
301 * when the audio device is ready for more data. It is passed a pointer
302 * to the audio buffer, and the length in bytes of the audio buffer.
303 * This function usually runs in a separate thread, and so you should
304 * protect data structures that it accesses by calling SDL_LockAudio()
305 * and SDL_UnlockAudio() in your code. Alternately, you may pass a NULL
306 * pointer here, and call SDL_QueueAudio() with some frequency, to queue
307 * more audio samples to be played (or for capture devices, call
308 * SDL_DequeueAudio() with some frequency, to obtain audio samples).
309 * - \c desired->userdata is passed as the first parameter to your callback
310 * function. If you passed a NULL callback, this value is ignored.
311 *
312 * The audio device starts out playing silence when it's opened, and should
313 * be enabled for playing by calling \c SDL_PauseAudio(0) when you are ready
314 * for your audio callback function to be called. Since the audio driver
315 * may modify the requested size of the audio buffer, you should allocate
316 * any local mixing buffers after you open the audio device.
317 */
318 extern DECLSPEC int SDLCALL SDL_OpenAudio(SDL_AudioSpec * desired,
319 SDL_AudioSpec * obtained);
320
321 /**
322 * SDL Audio Device IDs.
323 *
324 * A successful call to SDL_OpenAudio() is always device id 1, and legacy
325 * SDL audio APIs assume you want this device ID. SDL_OpenAudioDevice() calls
326 * always returns devices >= 2 on success. The legacy calls are good both
327 * for backwards compatibility and when you don't care about multiple,
328 * specific, or capture devices.
329 */
330 typedef Uint32 SDL_AudioDeviceID;
331
332 /**
333 * Get the number of available devices exposed by the current driver.
334 * Only valid after a successfully initializing the audio subsystem.
335 * Returns -1 if an explicit list of devices can't be determined; this is
336 * not an error. For example, if SDL is set up to talk to a remote audio
337 * server, it can't list every one available on the Internet, but it will
338 * still allow a specific host to be specified to SDL_OpenAudioDevice().
339 *
340 * In many common cases, when this function returns a value <= 0, it can still
341 * successfully open the default device (NULL for first argument of
342 * SDL_OpenAudioDevice()).
343 */
344 extern DECLSPEC int SDLCALL SDL_GetNumAudioDevices(int iscapture);
345
346 /**
347 * Get the human-readable name of a specific audio device.
348 * Must be a value between 0 and (number of audio devices-1).
349 * Only valid after a successfully initializing the audio subsystem.
350 * The values returned by this function reflect the latest call to
351 * SDL_GetNumAudioDevices(); recall that function to redetect available
352 * hardware.
353 *
354 * The string returned by this function is UTF-8 encoded, read-only, and
355 * managed internally. You are not to free it. If you need to keep the
356 * string for any length of time, you should make your own copy of it, as it
357 * will be invalid next time any of several other SDL functions is called.
358 */
359 extern DECLSPEC const char *SDLCALL SDL_GetAudioDeviceName(int index,
360 int iscapture);
361
362
363 /**
364 * Open a specific audio device. Passing in a device name of NULL requests
365 * the most reasonable default (and is equivalent to calling SDL_OpenAudio()).
366 *
367 * The device name is a UTF-8 string reported by SDL_GetAudioDeviceName(), but
368 * some drivers allow arbitrary and driver-specific strings, such as a
369 * hostname/IP address for a remote audio server, or a filename in the
370 * diskaudio driver.
371 *
372 * \return 0 on error, a valid device ID that is >= 2 on success.
373 *
374 * SDL_OpenAudio(), unlike this function, always acts on device ID 1.
375 */
376 extern DECLSPEC SDL_AudioDeviceID SDLCALL SDL_OpenAudioDevice(const char
377 *device,
378 int iscapture,
379 const
380 SDL_AudioSpec *
381 desired,
382 SDL_AudioSpec *
383 obtained,
384 int
385 allowed_changes);
386
387
388
389 /**
390 * \name Audio state
391 *
392 * Get the current audio state.
393 */
394 /* @{ */
395 typedef enum
396 {
397 SDL_AUDIO_STOPPED = 0,
398 SDL_AUDIO_PLAYING,
399 SDL_AUDIO_PAUSED
400 } SDL_AudioStatus;
401 extern DECLSPEC SDL_AudioStatus SDLCALL SDL_GetAudioStatus(void);
402
403 extern DECLSPEC SDL_AudioStatus SDLCALL
404 SDL_GetAudioDeviceStatus(SDL_AudioDeviceID dev);
405 /* @} *//* Audio State */
406
407 /**
408 * \name Pause audio functions
409 *
410 * These functions pause and unpause the audio callback processing.
411 * They should be called with a parameter of 0 after opening the audio
412 * device to start playing sound. This is so you can safely initialize
413 * data for your callback function after opening the audio device.
414 * Silence will be written to the audio device during the pause.
415 */
416 /* @{ */
417 extern DECLSPEC void SDLCALL SDL_PauseAudio(int pause_on);
418 extern DECLSPEC void SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev,
419 int pause_on);
420 /* @} *//* Pause audio functions */
421
422 /**
423 * \brief Load the audio data of a WAVE file into memory
424 *
425 * Loading a WAVE file requires \c src, \c spec, \c audio_buf and \c audio_len
426 * to be valid pointers. The entire data portion of the file is then loaded
427 * into memory and decoded if necessary.
428 *
429 * If \c freesrc is non-zero, the data source gets automatically closed and
430 * freed before the function returns.
431 *
432 * Supported are RIFF WAVE files with the formats PCM (8, 16, 24, and 32 bits),
433 * IEEE Float (32 bits), Microsoft ADPCM and IMA ADPCM (4 bits), and A-law and
434 * µ-law (8 bits). Other formats are currently unsupported and cause an error.
435 *
436 * If this function succeeds, the pointer returned by it is equal to \c spec
437 * and the pointer to the audio data allocated by the function is written to
438 * \c audio_buf and its length in bytes to \c audio_len. The \ref SDL_AudioSpec
439 * members \c freq, \c channels, and \c format are set to the values of the
440 * audio data in the buffer. The \c samples member is set to a sane default and
441 * all others are set to zero.
442 *
443 * It's necessary to use SDL_FreeWAV() to free the audio data returned in
444 * \c audio_buf when it is no longer used.
445 *
446 * Because of the underspecification of the Waveform format, there are many
447 * problematic files in the wild that cause issues with strict decoders. To
448 * provide compatibility with these files, this decoder is lenient in regards
449 * to the truncation of the file, the fact chunk, and the size of the RIFF
450 * chunk. The hints SDL_HINT_WAVE_RIFF_CHUNK_SIZE, SDL_HINT_WAVE_TRUNCATION,
451 * and SDL_HINT_WAVE_FACT_CHUNK can be used to tune the behavior of the
452 * loading process.
453 *
454 * Any file that is invalid (due to truncation, corruption, or wrong values in
455 * the headers), too big, or unsupported causes an error. Additionally, any
456 * critical I/O error from the data source will terminate the loading process
457 * with an error. The function returns NULL on error and in all cases (with the
458 * exception of \c src being NULL), an appropriate error message will be set.
459 *
460 * It is required that the data source supports seeking.
461 *
462 * Example:
463 * \code
464 * SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...);
465 * \endcode
466 *
467 * \param src The data source with the WAVE data
468 * \param freesrc A integer value that makes the function close the data source if non-zero
469 * \param spec A pointer filled with the audio format of the audio data
470 * \param audio_buf A pointer filled with the audio data allocated by the function
471 * \param audio_len A pointer filled with the length of the audio data buffer in bytes
472 * \return NULL on error, or non-NULL on success.
473 */
474 extern DECLSPEC SDL_AudioSpec *SDLCALL SDL_LoadWAV_RW(SDL_RWops * src,
475 int freesrc,
476 SDL_AudioSpec * spec,
477 Uint8 ** audio_buf,
478 Uint32 * audio_len);
479
480 /**
481 * Loads a WAV from a file.
482 * Compatibility convenience function.
483 */
484 #define SDL_LoadWAV(file, spec, audio_buf, audio_len) \
485 SDL_LoadWAV_RW(SDL_RWFromFile(file, "rb"),1, spec,audio_buf,audio_len)
486
487 /**
488 * This function frees data previously allocated with SDL_LoadWAV_RW()
489 */
490 extern DECLSPEC void SDLCALL SDL_FreeWAV(Uint8 * audio_buf);
491
492 /**
493 * This function takes a source format and rate and a destination format
494 * and rate, and initializes the \c cvt structure with information needed
495 * by SDL_ConvertAudio() to convert a buffer of audio data from one format
496 * to the other. An unsupported format causes an error and -1 will be returned.
497 *
498 * \return 0 if no conversion is needed, 1 if the audio filter is set up,
499 * or -1 on error.
500 */
501 extern DECLSPEC int SDLCALL SDL_BuildAudioCVT(SDL_AudioCVT * cvt,
502 SDL_AudioFormat src_format,
503 Uint8 src_channels,
504 int src_rate,
505 SDL_AudioFormat dst_format,
506 Uint8 dst_channels,
507 int dst_rate);
508
509 /**
510 * Once you have initialized the \c cvt structure using SDL_BuildAudioCVT(),
511 * created an audio buffer \c cvt->buf, and filled it with \c cvt->len bytes of
512 * audio data in the source format, this function will convert it in-place
513 * to the desired format.
514 *
515 * The data conversion may expand the size of the audio data, so the buffer
516 * \c cvt->buf should be allocated after the \c cvt structure is initialized by
517 * SDL_BuildAudioCVT(), and should be \c cvt->len*cvt->len_mult bytes long.
518 *
519 * \return 0 on success or -1 if \c cvt->buf is NULL.
520 */
521 extern DECLSPEC int SDLCALL SDL_ConvertAudio(SDL_AudioCVT * cvt);
522
523 /* SDL_AudioStream is a new audio conversion interface.
524 The benefits vs SDL_AudioCVT:
525 - it can handle resampling data in chunks without generating
526 artifacts, when it doesn't have the complete buffer available.
527 - it can handle incoming data in any variable size.
528 - You push data as you have it, and pull it when you need it
529 */
530 /* this is opaque to the outside world. */
531 struct _SDL_AudioStream;
532 typedef struct _SDL_AudioStream SDL_AudioStream;
533
534 /**
535 * Create a new audio stream
536 *
537 * \param src_format The format of the source audio
538 * \param src_channels The number of channels of the source audio
539 * \param src_rate The sampling rate of the source audio
540 * \param dst_format The format of the desired audio output
541 * \param dst_channels The number of channels of the desired audio output
542 * \param dst_rate The sampling rate of the desired audio output
543 * \return 0 on success, or -1 on error.
544 *
545 * \sa SDL_AudioStreamPut
546 * \sa SDL_AudioStreamGet
547 * \sa SDL_AudioStreamAvailable
548 * \sa SDL_AudioStreamFlush
549 * \sa SDL_AudioStreamClear
550 * \sa SDL_FreeAudioStream
551 */
552 extern DECLSPEC SDL_AudioStream * SDLCALL SDL_NewAudioStream(const SDL_AudioFormat src_format,
553 const Uint8 src_channels,
554 const int src_rate,
555 const SDL_AudioFormat dst_format,
556 const Uint8 dst_channels,
557 const int dst_rate);
558
559 /**
560 * Add data to be converted/resampled to the stream
561 *
562 * \param stream The stream the audio data is being added to
563 * \param buf A pointer to the audio data to add
564 * \param len The number of bytes to write to the stream
565 * \return 0 on success, or -1 on error.
566 *
567 * \sa SDL_NewAudioStream
568 * \sa SDL_AudioStreamGet
569 * \sa SDL_AudioStreamAvailable
570 * \sa SDL_AudioStreamFlush
571 * \sa SDL_AudioStreamClear
572 * \sa SDL_FreeAudioStream
573 */
574 extern DECLSPEC int SDLCALL SDL_AudioStreamPut(SDL_AudioStream *stream, const void *buf, int len);
575
576 /**
577 * Get converted/resampled data from the stream
578 *
579 * \param stream The stream the audio is being requested from
580 * \param buf A buffer to fill with audio data
581 * \param len The maximum number of bytes to fill
582 * \return The number of bytes read from the stream, or -1 on error
583 *
584 * \sa SDL_NewAudioStream
585 * \sa SDL_AudioStreamPut
586 * \sa SDL_AudioStreamAvailable
587 * \sa SDL_AudioStreamFlush
588 * \sa SDL_AudioStreamClear
589 * \sa SDL_FreeAudioStream
590 */
591 extern DECLSPEC int SDLCALL SDL_AudioStreamGet(SDL_AudioStream *stream, void *buf, int len);
592
593 /**
594 * Get the number of converted/resampled bytes available. The stream may be
595 * buffering data behind the scenes until it has enough to resample
596 * correctly, so this number might be lower than what you expect, or even
597 * be zero. Add more data or flush the stream if you need the data now.
598 *
599 * \sa SDL_NewAudioStream
600 * \sa SDL_AudioStreamPut
601 * \sa SDL_AudioStreamGet
602 * \sa SDL_AudioStreamFlush
603 * \sa SDL_AudioStreamClear
604 * \sa SDL_FreeAudioStream
605 */
606 extern DECLSPEC int SDLCALL SDL_AudioStreamAvailable(SDL_AudioStream *stream);
607
608 /**
609 * Tell the stream that you're done sending data, and anything being buffered
610 * should be converted/resampled and made available immediately.
611 *
612 * It is legal to add more data to a stream after flushing, but there will
613 * be audio gaps in the output. Generally this is intended to signal the
614 * end of input, so the complete output becomes available.
615 *
616 * \sa SDL_NewAudioStream
617 * \sa SDL_AudioStreamPut
618 * \sa SDL_AudioStreamGet
619 * \sa SDL_AudioStreamAvailable
620 * \sa SDL_AudioStreamClear
621 * \sa SDL_FreeAudioStream
622 */
623 extern DECLSPEC int SDLCALL SDL_AudioStreamFlush(SDL_AudioStream *stream);
624
625 /**
626 * Clear any pending data in the stream without converting it
627 *
628 * \sa SDL_NewAudioStream
629 * \sa SDL_AudioStreamPut
630 * \sa SDL_AudioStreamGet
631 * \sa SDL_AudioStreamAvailable
632 * \sa SDL_AudioStreamFlush
633 * \sa SDL_FreeAudioStream
634 */
635 extern DECLSPEC void SDLCALL SDL_AudioStreamClear(SDL_AudioStream *stream);
636
637 /**
638 * Free an audio stream
639 *
640 * \sa SDL_NewAudioStream
641 * \sa SDL_AudioStreamPut
642 * \sa SDL_AudioStreamGet
643 * \sa SDL_AudioStreamAvailable
644 * \sa SDL_AudioStreamFlush
645 * \sa SDL_AudioStreamClear
646 */
647 extern DECLSPEC void SDLCALL SDL_FreeAudioStream(SDL_AudioStream *stream);
648
649 #define SDL_MIX_MAXVOLUME 128
650 /**
651 * This takes two audio buffers of the playing audio format and mixes
652 * them, performing addition, volume adjustment, and overflow clipping.
653 * The volume ranges from 0 - 128, and should be set to ::SDL_MIX_MAXVOLUME
654 * for full audio volume. Note this does not change hardware volume.
655 * This is provided for convenience -- you can mix your own audio data.
656 */
657 extern DECLSPEC void SDLCALL SDL_MixAudio(Uint8 * dst, const Uint8 * src,
658 Uint32 len, int volume);
659
660 /**
661 * This works like SDL_MixAudio(), but you specify the audio format instead of
662 * using the format of audio device 1. Thus it can be used when no audio
663 * device is open at all.
664 */
665 extern DECLSPEC void SDLCALL SDL_MixAudioFormat(Uint8 * dst,
666 const Uint8 * src,
667 SDL_AudioFormat format,
668 Uint32 len, int volume);
669
670 /**
671 * Queue more audio on non-callback devices.
672 *
673 * (If you are looking to retrieve queued audio from a non-callback capture
674 * device, you want SDL_DequeueAudio() instead. This will return -1 to
675 * signify an error if you use it with capture devices.)
676 *
677 * SDL offers two ways to feed audio to the device: you can either supply a
678 * callback that SDL triggers with some frequency to obtain more audio
679 * (pull method), or you can supply no callback, and then SDL will expect
680 * you to supply data at regular intervals (push method) with this function.
681 *
682 * There are no limits on the amount of data you can queue, short of
683 * exhaustion of address space. Queued data will drain to the device as
684 * necessary without further intervention from you. If the device needs
685 * audio but there is not enough queued, it will play silence to make up
686 * the difference. This means you will have skips in your audio playback
687 * if you aren't routinely queueing sufficient data.
688 *
689 * This function copies the supplied data, so you are safe to free it when
690 * the function returns. This function is thread-safe, but queueing to the
691 * same device from two threads at once does not promise which buffer will
692 * be queued first.
693 *
694 * You may not queue audio on a device that is using an application-supplied
695 * callback; doing so returns an error. You have to use the audio callback
696 * or queue audio with this function, but not both.
697 *
698 * You should not call SDL_LockAudio() on the device before queueing; SDL
699 * handles locking internally for this function.
700 *
701 * \param dev The device ID to which we will queue audio.
702 * \param data The data to queue to the device for later playback.
703 * \param len The number of bytes (not samples!) to which (data) points.
704 * \return 0 on success, or -1 on error.
705 *
706 * \sa SDL_GetQueuedAudioSize
707 * \sa SDL_ClearQueuedAudio
708 */
709 extern DECLSPEC int SDLCALL SDL_QueueAudio(SDL_AudioDeviceID dev, const void *data, Uint32 len);
710
711 /**
712 * Dequeue more audio on non-callback devices.
713 *
714 * (If you are looking to queue audio for output on a non-callback playback
715 * device, you want SDL_QueueAudio() instead. This will always return 0
716 * if you use it with playback devices.)
717 *
718 * SDL offers two ways to retrieve audio from a capture device: you can
719 * either supply a callback that SDL triggers with some frequency as the
720 * device records more audio data, (push method), or you can supply no
721 * callback, and then SDL will expect you to retrieve data at regular
722 * intervals (pull method) with this function.
723 *
724 * There are no limits on the amount of data you can queue, short of
725 * exhaustion of address space. Data from the device will keep queuing as
726 * necessary without further intervention from you. This means you will
727 * eventually run out of memory if you aren't routinely dequeueing data.
728 *
729 * Capture devices will not queue data when paused; if you are expecting
730 * to not need captured audio for some length of time, use
731 * SDL_PauseAudioDevice() to stop the capture device from queueing more
732 * data. This can be useful during, say, level loading times. When
733 * unpaused, capture devices will start queueing data from that point,
734 * having flushed any capturable data available while paused.
735 *
736 * This function is thread-safe, but dequeueing from the same device from
737 * two threads at once does not promise which thread will dequeued data
738 * first.
739 *
740 * You may not dequeue audio from a device that is using an
741 * application-supplied callback; doing so returns an error. You have to use
742 * the audio callback, or dequeue audio with this function, but not both.
743 *
744 * You should not call SDL_LockAudio() on the device before queueing; SDL
745 * handles locking internally for this function.
746 *
747 * \param dev The device ID from which we will dequeue audio.
748 * \param data A pointer into where audio data should be copied.
749 * \param len The number of bytes (not samples!) to which (data) points.
750 * \return number of bytes dequeued, which could be less than requested.
751 *
752 * \sa SDL_GetQueuedAudioSize
753 * \sa SDL_ClearQueuedAudio
754 */
755 extern DECLSPEC Uint32 SDLCALL SDL_DequeueAudio(SDL_AudioDeviceID dev, void *data, Uint32 len);
756
757 /**
758 * Get the number of bytes of still-queued audio.
759 *
760 * For playback device:
761 *
762 * This is the number of bytes that have been queued for playback with
763 * SDL_QueueAudio(), but have not yet been sent to the hardware. This
764 * number may shrink at any time, so this only informs of pending data.
765 *
766 * Once we've sent it to the hardware, this function can not decide the
767 * exact byte boundary of what has been played. It's possible that we just
768 * gave the hardware several kilobytes right before you called this
769 * function, but it hasn't played any of it yet, or maybe half of it, etc.
770 *
771 * For capture devices:
772 *
773 * This is the number of bytes that have been captured by the device and
774 * are waiting for you to dequeue. This number may grow at any time, so
775 * this only informs of the lower-bound of available data.
776 *
777 * You may not queue audio on a device that is using an application-supplied
778 * callback; calling this function on such a device always returns 0.
779 * You have to queue audio with SDL_QueueAudio()/SDL_DequeueAudio(), or use
780 * the audio callback, but not both.
781 *
782 * You should not call SDL_LockAudio() on the device before querying; SDL
783 * handles locking internally for this function.
784 *
785 * \param dev The device ID of which we will query queued audio size.
786 * \return Number of bytes (not samples!) of queued audio.
787 *
788 * \sa SDL_QueueAudio
789 * \sa SDL_ClearQueuedAudio
790 */
791 extern DECLSPEC Uint32 SDLCALL SDL_GetQueuedAudioSize(SDL_AudioDeviceID dev);
792
793 /**
794 * Drop any queued audio data. For playback devices, this is any queued data
795 * still waiting to be submitted to the hardware. For capture devices, this
796 * is any data that was queued by the device that hasn't yet been dequeued by
797 * the application.
798 *
799 * Immediately after this call, SDL_GetQueuedAudioSize() will return 0. For
800 * playback devices, the hardware will start playing silence if more audio
801 * isn't queued. Unpaused capture devices will start filling the queue again
802 * as soon as they have more data available (which, depending on the state
803 * of the hardware and the thread, could be before this function call
804 * returns!).
805 *
806 * This will not prevent playback of queued audio that's already been sent
807 * to the hardware, as we can not undo that, so expect there to be some
808 * fraction of a second of audio that might still be heard. This can be
809 * useful if you want to, say, drop any pending music during a level change
810 * in your game.
811 *
812 * You may not queue audio on a device that is using an application-supplied
813 * callback; calling this function on such a device is always a no-op.
814 * You have to queue audio with SDL_QueueAudio()/SDL_DequeueAudio(), or use
815 * the audio callback, but not both.
816 *
817 * You should not call SDL_LockAudio() on the device before clearing the
818 * queue; SDL handles locking internally for this function.
819 *
820 * This function always succeeds and thus returns void.
821 *
822 * \param dev The device ID of which to clear the audio queue.
823 *
824 * \sa SDL_QueueAudio
825 * \sa SDL_GetQueuedAudioSize
826 */
827 extern DECLSPEC void SDLCALL SDL_ClearQueuedAudio(SDL_AudioDeviceID dev);
828
829
830 /**
831 * \name Audio lock functions
832 *
833 * The lock manipulated by these functions protects the callback function.
834 * During a SDL_LockAudio()/SDL_UnlockAudio() pair, you can be guaranteed that
835 * the callback function is not running. Do not call these from the callback
836 * function or you will cause deadlock.
837 */
838 /* @{ */
839 extern DECLSPEC void SDLCALL SDL_LockAudio(void);
840 extern DECLSPEC void SDLCALL SDL_LockAudioDevice(SDL_AudioDeviceID dev);
841 extern DECLSPEC void SDLCALL SDL_UnlockAudio(void);
842 extern DECLSPEC void SDLCALL SDL_UnlockAudioDevice(SDL_AudioDeviceID dev);
843 /* @} *//* Audio lock functions */
844
845 /**
846 * This function shuts down audio processing and closes the audio device.
847 */
848 extern DECLSPEC void SDLCALL SDL_CloseAudio(void);
849 extern DECLSPEC void SDLCALL SDL_CloseAudioDevice(SDL_AudioDeviceID dev);
850
851 /* Ends C function definitions when using C++ */
852 #ifdef __cplusplus
853 }
854 #endif
855 #include "close_code.h"
856
857 #endif /* SDL_audio_h_ */
858
859 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_bits.h added (mode: 100644) (index 0000000..db150ed)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_bits.h
24 *
25 * Functions for fiddling with bits and bitmasks.
26 */
27
28 #ifndef SDL_bits_h_
29 #define SDL_bits_h_
30
31 #include "SDL_stdinc.h"
32
33 #include "begin_code.h"
34 /* Set up for C function definitions, even when using C++ */
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38
39 /**
40 * \file SDL_bits.h
41 */
42
43 /**
44 * Get the index of the most significant bit. Result is undefined when called
45 * with 0. This operation can also be stated as "count leading zeroes" and
46 * "log base 2".
47 *
48 * \return Index of the most significant bit, or -1 if the value is 0.
49 */
50 #if defined(__WATCOMC__) && defined(__386__)
51 extern _inline int _SDL_clz_watcom (Uint32);
52 #pragma aux _SDL_clz_watcom = \
53 "bsr eax, eax" \
54 "xor eax, 31" \
55 parm [eax] nomemory \
56 value [eax] \
57 modify exact [eax] nomemory;
58 #endif
59
60 SDL_FORCE_INLINE int
61 SDL_MostSignificantBitIndex32(Uint32 x)
62 {
63 #if defined(__GNUC__) && (__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
64 /* Count Leading Zeroes builtin in GCC.
65 * http://gcc.gnu.org/onlinedocs/gcc-4.3.4/gcc/Other-Builtins.html
66 */
67 if (x == 0) {
68 return -1;
69 }
70 return 31 - __builtin_clz(x);
71 #elif defined(__WATCOMC__) && defined(__386__)
72 if (x == 0) {
73 return -1;
74 }
75 return 31 - _SDL_clz_watcom(x);
76 #else
77 /* Based off of Bit Twiddling Hacks by Sean Eron Anderson
78 * <seander@cs.stanford.edu>, released in the public domain.
79 * http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog
80 */
81 const Uint32 b[] = {0x2, 0xC, 0xF0, 0xFF00, 0xFFFF0000};
82 const int S[] = {1, 2, 4, 8, 16};
83
84 int msbIndex = 0;
85 int i;
86
87 if (x == 0) {
88 return -1;
89 }
90
91 for (i = 4; i >= 0; i--)
92 {
93 if (x & b[i])
94 {
95 x >>= S[i];
96 msbIndex |= S[i];
97 }
98 }
99
100 return msbIndex;
101 #endif
102 }
103
104 SDL_FORCE_INLINE SDL_bool
105 SDL_HasExactlyOneBitSet32(Uint32 x)
106 {
107 if (x && !(x & (x - 1))) {
108 return SDL_TRUE;
109 }
110 return SDL_FALSE;
111 }
112
113 /* Ends C function definitions when using C++ */
114 #ifdef __cplusplus
115 }
116 #endif
117 #include "close_code.h"
118
119 #endif /* SDL_bits_h_ */
120
121 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_blendmode.h added (mode: 100644) (index 0000000..5e21a79)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_blendmode.h
24 *
25 * Header file declaring the SDL_BlendMode enumeration
26 */
27
28 #ifndef SDL_blendmode_h_
29 #define SDL_blendmode_h_
30
31 #include "begin_code.h"
32 /* Set up for C function definitions, even when using C++ */
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 /**
38 * \brief The blend mode used in SDL_RenderCopy() and drawing operations.
39 */
40 typedef enum
41 {
42 SDL_BLENDMODE_NONE = 0x00000000, /**< no blending
43 dstRGBA = srcRGBA */
44 SDL_BLENDMODE_BLEND = 0x00000001, /**< alpha blending
45 dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA))
46 dstA = srcA + (dstA * (1-srcA)) */
47 SDL_BLENDMODE_ADD = 0x00000002, /**< additive blending
48 dstRGB = (srcRGB * srcA) + dstRGB
49 dstA = dstA */
50 SDL_BLENDMODE_MOD = 0x00000004, /**< color modulate
51 dstRGB = srcRGB * dstRGB
52 dstA = dstA */
53 SDL_BLENDMODE_MUL = 0x00000008, /**< color multiply
54 dstRGB = (srcRGB * dstRGB) + (dstRGB * (1-srcA))
55 dstA = (srcA * dstA) + (dstA * (1-srcA)) */
56 SDL_BLENDMODE_INVALID = 0x7FFFFFFF
57
58 /* Additional custom blend modes can be returned by SDL_ComposeCustomBlendMode() */
59
60 } SDL_BlendMode;
61
62 /**
63 * \brief The blend operation used when combining source and destination pixel components
64 */
65 typedef enum
66 {
67 SDL_BLENDOPERATION_ADD = 0x1, /**< dst + src: supported by all renderers */
68 SDL_BLENDOPERATION_SUBTRACT = 0x2, /**< dst - src : supported by D3D9, D3D11, OpenGL, OpenGLES */
69 SDL_BLENDOPERATION_REV_SUBTRACT = 0x3, /**< src - dst : supported by D3D9, D3D11, OpenGL, OpenGLES */
70 SDL_BLENDOPERATION_MINIMUM = 0x4, /**< min(dst, src) : supported by D3D11 */
71 SDL_BLENDOPERATION_MAXIMUM = 0x5 /**< max(dst, src) : supported by D3D11 */
72
73 } SDL_BlendOperation;
74
75 /**
76 * \brief The normalized factor used to multiply pixel components
77 */
78 typedef enum
79 {
80 SDL_BLENDFACTOR_ZERO = 0x1, /**< 0, 0, 0, 0 */
81 SDL_BLENDFACTOR_ONE = 0x2, /**< 1, 1, 1, 1 */
82 SDL_BLENDFACTOR_SRC_COLOR = 0x3, /**< srcR, srcG, srcB, srcA */
83 SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR = 0x4, /**< 1-srcR, 1-srcG, 1-srcB, 1-srcA */
84 SDL_BLENDFACTOR_SRC_ALPHA = 0x5, /**< srcA, srcA, srcA, srcA */
85 SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA = 0x6, /**< 1-srcA, 1-srcA, 1-srcA, 1-srcA */
86 SDL_BLENDFACTOR_DST_COLOR = 0x7, /**< dstR, dstG, dstB, dstA */
87 SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR = 0x8, /**< 1-dstR, 1-dstG, 1-dstB, 1-dstA */
88 SDL_BLENDFACTOR_DST_ALPHA = 0x9, /**< dstA, dstA, dstA, dstA */
89 SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA = 0xA /**< 1-dstA, 1-dstA, 1-dstA, 1-dstA */
90
91 } SDL_BlendFactor;
92
93 /**
94 * \brief Create a custom blend mode, which may or may not be supported by a given renderer
95 *
96 * \param srcColorFactor source color factor
97 * \param dstColorFactor destination color factor
98 * \param colorOperation color operation
99 * \param srcAlphaFactor source alpha factor
100 * \param dstAlphaFactor destination alpha factor
101 * \param alphaOperation alpha operation
102 *
103 * The result of the blend mode operation will be:
104 * dstRGB = dstRGB * dstColorFactor colorOperation srcRGB * srcColorFactor
105 * and
106 * dstA = dstA * dstAlphaFactor alphaOperation srcA * srcAlphaFactor
107 */
108 extern DECLSPEC SDL_BlendMode SDLCALL SDL_ComposeCustomBlendMode(SDL_BlendFactor srcColorFactor,
109 SDL_BlendFactor dstColorFactor,
110 SDL_BlendOperation colorOperation,
111 SDL_BlendFactor srcAlphaFactor,
112 SDL_BlendFactor dstAlphaFactor,
113 SDL_BlendOperation alphaOperation);
114
115 /* Ends C function definitions when using C++ */
116 #ifdef __cplusplus
117 }
118 #endif
119 #include "close_code.h"
120
121 #endif /* SDL_blendmode_h_ */
122
123 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_clipboard.h added (mode: 100644) (index 0000000..dbf69fc)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_clipboard.h
24 *
25 * Include file for SDL clipboard handling
26 */
27
28 #ifndef SDL_clipboard_h_
29 #define SDL_clipboard_h_
30
31 #include "SDL_stdinc.h"
32
33 #include "begin_code.h"
34 /* Set up for C function definitions, even when using C++ */
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38
39 /* Function prototypes */
40
41 /**
42 * \brief Put UTF-8 text into the clipboard
43 *
44 * \sa SDL_GetClipboardText()
45 */
46 extern DECLSPEC int SDLCALL SDL_SetClipboardText(const char *text);
47
48 /**
49 * \brief Get UTF-8 text from the clipboard, which must be freed with SDL_free()
50 *
51 * \sa SDL_SetClipboardText()
52 */
53 extern DECLSPEC char * SDLCALL SDL_GetClipboardText(void);
54
55 /**
56 * \brief Returns a flag indicating whether the clipboard exists and contains a text string that is non-empty
57 *
58 * \sa SDL_GetClipboardText()
59 */
60 extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void);
61
62
63 /* Ends C function definitions when using C++ */
64 #ifdef __cplusplus
65 }
66 #endif
67 #include "close_code.h"
68
69 #endif /* SDL_clipboard_h_ */
70
71 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_config.h added (mode: 100644) (index 0000000..18a3638)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 #ifndef SDL_config_windows_h_
23 #define SDL_config_windows_h_
24 #define SDL_config_h_
25
26 #include "SDL_platform.h"
27
28 /* This is a set of defines to configure the SDL features */
29
30 #if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
31 #if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__)
32 #define HAVE_STDINT_H 1
33 #elif defined(_MSC_VER)
34 typedef signed __int8 int8_t;
35 typedef unsigned __int8 uint8_t;
36 typedef signed __int16 int16_t;
37 typedef unsigned __int16 uint16_t;
38 typedef signed __int32 int32_t;
39 typedef unsigned __int32 uint32_t;
40 typedef signed __int64 int64_t;
41 typedef unsigned __int64 uint64_t;
42 #ifndef _UINTPTR_T_DEFINED
43 #ifdef _WIN64
44 typedef unsigned __int64 uintptr_t;
45 #else
46 typedef unsigned int uintptr_t;
47 #endif
48 #define _UINTPTR_T_DEFINED
49 #endif
50 /* Older Visual C++ headers don't have the Win64-compatible typedefs... */
51 #if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR)))
52 #define DWORD_PTR DWORD
53 #endif
54 #if ((_MSC_VER <= 1200) && (!defined(LONG_PTR)))
55 #define LONG_PTR LONG
56 #endif
57 #else /* !__GNUC__ && !_MSC_VER */
58 typedef signed char int8_t;
59 typedef unsigned char uint8_t;
60 typedef signed short int16_t;
61 typedef unsigned short uint16_t;
62 typedef signed int int32_t;
63 typedef unsigned int uint32_t;
64 typedef signed long long int64_t;
65 typedef unsigned long long uint64_t;
66 #ifndef _SIZE_T_DEFINED_
67 #define _SIZE_T_DEFINED_
68 typedef unsigned int size_t;
69 #endif
70 typedef unsigned int uintptr_t;
71 #endif /* __GNUC__ || _MSC_VER */
72 #endif /* !_STDINT_H_ && !HAVE_STDINT_H */
73
74 #ifdef _WIN64
75 # define SIZEOF_VOIDP 8
76 #else
77 # define SIZEOF_VOIDP 4
78 #endif
79
80 #define HAVE_DDRAW_H 1
81 #define HAVE_DINPUT_H 1
82 #define HAVE_DSOUND_H 1
83 #define HAVE_DXGI_H 1
84 #define HAVE_XINPUT_H 1
85 #define HAVE_MMDEVICEAPI_H 1
86 #define HAVE_AUDIOCLIENT_H 1
87 #define HAVE_SENSORSAPI_H
88
89 /* This is disabled by default to avoid C runtime dependencies and manifest requirements */
90 #ifdef HAVE_LIBC
91 /* Useful headers */
92 #define STDC_HEADERS 1
93 #define HAVE_CTYPE_H 1
94 #define HAVE_FLOAT_H 1
95 #define HAVE_LIMITS_H 1
96 #define HAVE_MATH_H 1
97 #define HAVE_SIGNAL_H 1
98 #define HAVE_STDIO_H 1
99 #define HAVE_STRING_H 1
100
101 /* C library functions */
102 #define HAVE_MALLOC 1
103 #define HAVE_CALLOC 1
104 #define HAVE_REALLOC 1
105 #define HAVE_FREE 1
106 #define HAVE_ALLOCA 1
107 #define HAVE_QSORT 1
108 #define HAVE_ABS 1
109 #define HAVE_MEMSET 1
110 #define HAVE_MEMCPY 1
111 #define HAVE_MEMMOVE 1
112 #define HAVE_MEMCMP 1
113 #define HAVE_STRLEN 1
114 #define HAVE__STRREV 1
115 /* These functions have security warnings, so we won't use them */
116 /* #undef HAVE__STRUPR */
117 /* #undef HAVE__STRLWR */
118 #define HAVE_STRCHR 1
119 #define HAVE_STRRCHR 1
120 #define HAVE_STRSTR 1
121 /* #undef HAVE_STRTOK_R */
122 #if defined(_MSC_VER)
123 #define HAVE_STRTOK_S 1
124 #endif
125 /* These functions have security warnings, so we won't use them */
126 /* #undef HAVE__LTOA */
127 /* #undef HAVE__ULTOA */
128 #define HAVE_STRTOL 1
129 #define HAVE_STRTOUL 1
130 #define HAVE_STRTOD 1
131 #define HAVE_ATOI 1
132 #define HAVE_ATOF 1
133 #define HAVE_STRCMP 1
134 #define HAVE_STRNCMP 1
135 #define HAVE__STRICMP 1
136 #define HAVE__STRNICMP 1
137 #define HAVE__WCSICMP 1
138 #define HAVE__WCSNICMP 1
139 #define HAVE_ACOS 1
140 #define HAVE_ACOSF 1
141 #define HAVE_ASIN 1
142 #define HAVE_ASINF 1
143 #define HAVE_ATAN 1
144 #define HAVE_ATANF 1
145 #define HAVE_ATAN2 1
146 #define HAVE_ATAN2F 1
147 #define HAVE_CEILF 1
148 #define HAVE__COPYSIGN 1
149 #define HAVE_COS 1
150 #define HAVE_COSF 1
151 #define HAVE_EXP 1
152 #define HAVE_EXPF 1
153 #define HAVE_FABS 1
154 #define HAVE_FABSF 1
155 #define HAVE_FLOOR 1
156 #define HAVE_FLOORF 1
157 #define HAVE_FMOD 1
158 #define HAVE_FMODF 1
159 #define HAVE_LOG 1
160 #define HAVE_LOGF 1
161 #define HAVE_LOG10 1
162 #define HAVE_LOG10F 1
163 #define HAVE_POW 1
164 #define HAVE_POWF 1
165 #define HAVE_SIN 1
166 #define HAVE_SINF 1
167 #define HAVE_SQRT 1
168 #define HAVE_SQRTF 1
169 #define HAVE_TAN 1
170 #define HAVE_TANF 1
171 #if defined(_MSC_VER)
172 /* These functions were added with the VC++ 2013 C runtime library */
173 #if _MSC_VER >= 1800
174 #define HAVE_STRTOLL 1
175 #define HAVE_VSSCANF 1
176 #define HAVE_SCALBN 1
177 #define HAVE_SCALBNF 1
178 #define HAVE_TRUNC 1
179 #define HAVE_TRUNCF 1
180 #endif
181 /* This function is available with at least the VC++ 2008 C runtime library */
182 #if _MSC_VER >= 1400
183 #define HAVE__FSEEKI64 1
184 #endif
185 #endif
186 #if !defined(_MSC_VER) || defined(_USE_MATH_DEFINES)
187 #define HAVE_M_PI 1
188 #endif
189 #else
190 #define HAVE_STDARG_H 1
191 #define HAVE_STDDEF_H 1
192 #endif
193
194 /* Check to see if we have Windows 10 build environment */
195 #if _MSC_VER >= 1911 /* Visual Studio 15.3 */
196 #include <sdkddkver.h>
197 #if _WIN32_WINNT >= 0x0601 /* Windows 7 */
198 #define SDL_WINDOWS7_SDK
199 #endif
200 #if _WIN32_WINNT >= 0x0602 /* Windows 8 */
201 #define SDL_WINDOWS8_SDK
202 #endif
203 #if _WIN32_WINNT >= 0x0A00 /* Windows 10 */
204 #define SDL_WINDOWS10_SDK
205 #endif
206 #endif /* _MSC_VER >= 1911 */
207
208 /* Enable various audio drivers */
209 #define SDL_AUDIO_DRIVER_WASAPI 1
210 #define SDL_AUDIO_DRIVER_DSOUND 1
211 #define SDL_AUDIO_DRIVER_WINMM 1
212 #define SDL_AUDIO_DRIVER_DISK 1
213 #define SDL_AUDIO_DRIVER_DUMMY 1
214
215 /* Enable various input drivers */
216 #define SDL_JOYSTICK_DINPUT 1
217 #define SDL_JOYSTICK_HIDAPI 1
218 #ifndef __WINRT__
219 #define SDL_JOYSTICK_RAWINPUT 1
220 #endif
221 #define SDL_JOYSTICK_VIRTUAL 1
222 #ifdef SDL_WINDOWS10_SDK
223 #define SDL_JOYSTICK_WGI 1
224 #endif
225 #define SDL_JOYSTICK_XINPUT 1
226 #define SDL_HAPTIC_DINPUT 1
227 #define SDL_HAPTIC_XINPUT 1
228
229 /* Enable the sensor driver */
230 #define SDL_SENSOR_WINDOWS 1
231
232 /* Enable various shared object loading systems */
233 #define SDL_LOADSO_WINDOWS 1
234
235 /* Enable various threading systems */
236 #define SDL_THREAD_WINDOWS 1
237
238 /* Enable various timer systems */
239 #define SDL_TIMER_WINDOWS 1
240
241 /* Enable various video drivers */
242 #define SDL_VIDEO_DRIVER_DUMMY 1
243 #define SDL_VIDEO_DRIVER_WINDOWS 1
244
245 #ifndef SDL_VIDEO_RENDER_D3D
246 #define SDL_VIDEO_RENDER_D3D 1
247 #endif
248 #ifdef SDL_WINDOWS7_SDK
249 #define SDL_VIDEO_RENDER_D3D11 1
250 #endif
251
252 /* Enable OpenGL support */
253 #ifndef SDL_VIDEO_OPENGL
254 #define SDL_VIDEO_OPENGL 1
255 #endif
256 #ifndef SDL_VIDEO_OPENGL_WGL
257 #define SDL_VIDEO_OPENGL_WGL 1
258 #endif
259 #ifndef SDL_VIDEO_RENDER_OGL
260 #define SDL_VIDEO_RENDER_OGL 1
261 #endif
262 #ifndef SDL_VIDEO_RENDER_OGL_ES2
263 #define SDL_VIDEO_RENDER_OGL_ES2 1
264 #endif
265 #ifndef SDL_VIDEO_OPENGL_ES2
266 #define SDL_VIDEO_OPENGL_ES2 1
267 #endif
268 #ifndef SDL_VIDEO_OPENGL_EGL
269 #define SDL_VIDEO_OPENGL_EGL 1
270 #endif
271
272 /* Enable Vulkan support */
273 #define SDL_VIDEO_VULKAN 1
274
275 /* Enable system power support */
276 #define SDL_POWER_WINDOWS 1
277
278 /* Enable filesystem support */
279 #define SDL_FILESYSTEM_WINDOWS 1
280
281 /* Enable assembly routines (Win64 doesn't have inline asm) */
282 #ifndef _WIN64
283 #define SDL_ASSEMBLY_ROUTINES 1
284 #endif
285
286 #endif /* SDL_config_windows_h_ */
287
288 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_cpuinfo.h added (mode: 100644) (index 0000000..df3123c)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_cpuinfo.h
24 *
25 * CPU feature detection for SDL.
26 */
27
28 #ifndef SDL_cpuinfo_h_
29 #define SDL_cpuinfo_h_
30
31 #include "SDL_stdinc.h"
32
33 /* Need to do this here because intrin.h has C++ code in it */
34 /* Visual Studio 2005 has a bug where intrin.h conflicts with winnt.h */
35 #if defined(_MSC_VER) && (_MSC_VER >= 1500) && (defined(_M_IX86) || defined(_M_X64))
36 #ifdef __clang__
37 /* Many of the intrinsics SDL uses are not implemented by clang with Visual Studio */
38 #undef __MMX__
39 #undef __SSE__
40 #undef __SSE2__
41 #else
42 #include <intrin.h>
43 #ifndef _WIN64
44 #ifndef __MMX__
45 #define __MMX__
46 #endif
47 #ifndef __3dNOW__
48 #define __3dNOW__
49 #endif
50 #endif
51 #ifndef __SSE__
52 #define __SSE__
53 #endif
54 #ifndef __SSE2__
55 #define __SSE2__
56 #endif
57 #endif /* __clang__ */
58 #elif defined(__MINGW64_VERSION_MAJOR)
59 #include <intrin.h>
60 #else
61 /* 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. */
62 #if defined(HAVE_ALTIVEC_H) && defined(__ALTIVEC__) && !defined(__APPLE_ALTIVEC__) && defined(SDL_ENABLE_ALTIVEC_H)
63 #include <altivec.h>
64 #endif
65 #if !defined(SDL_DISABLE_ARM_NEON_H)
66 # if defined(__ARM_NEON)
67 # include <arm_neon.h>
68 # elif defined(__WINDOWS__) || defined(__WINRT__)
69 /* Visual Studio doesn't define __ARM_ARCH, but _M_ARM (if set, always 7), and _M_ARM64 (if set, always 1). */
70 # if defined(_M_ARM)
71 # include <armintr.h>
72 # include <arm_neon.h>
73 # define __ARM_NEON 1 /* Set __ARM_NEON so that it can be used elsewhere, at compile time */
74 # endif
75 # if defined (_M_ARM64)
76 # include <arm64intr.h>
77 # include <arm64_neon.h>
78 # define __ARM_NEON 1 /* Set __ARM_NEON so that it can be used elsewhere, at compile time */
79 # endif
80 # endif
81 #endif
82 #if defined(__3dNOW__) && !defined(SDL_DISABLE_MM3DNOW_H)
83 #include <mm3dnow.h>
84 #endif
85 #if defined(HAVE_IMMINTRIN_H) && !defined(SDL_DISABLE_IMMINTRIN_H)
86 #include <immintrin.h>
87 #else
88 #if defined(__MMX__) && !defined(SDL_DISABLE_MMINTRIN_H)
89 #include <mmintrin.h>
90 #endif
91 #if defined(__SSE__) && !defined(SDL_DISABLE_XMMINTRIN_H)
92 #include <xmmintrin.h>
93 #endif
94 #if defined(__SSE2__) && !defined(SDL_DISABLE_EMMINTRIN_H)
95 #include <emmintrin.h>
96 #endif
97 #if defined(__SSE3__) && !defined(SDL_DISABLE_PMMINTRIN_H)
98 #include <pmmintrin.h>
99 #endif
100 #endif /* HAVE_IMMINTRIN_H */
101 #endif /* compiler version */
102
103 #include "begin_code.h"
104 /* Set up for C function definitions, even when using C++ */
105 #ifdef __cplusplus
106 extern "C" {
107 #endif
108
109 /* This is a guess for the cacheline size used for padding.
110 * Most x86 processors have a 64 byte cache line.
111 * The 64-bit PowerPC processors have a 128 byte cache line.
112 * We'll use the larger value to be generally safe.
113 */
114 #define SDL_CACHELINE_SIZE 128
115
116 /**
117 * This function returns the number of CPU cores available.
118 */
119 extern DECLSPEC int SDLCALL SDL_GetCPUCount(void);
120
121 /**
122 * This function returns the L1 cache line size of the CPU
123 *
124 * This is useful for determining multi-threaded structure padding
125 * or SIMD prefetch sizes.
126 */
127 extern DECLSPEC int SDLCALL SDL_GetCPUCacheLineSize(void);
128
129 /**
130 * This function returns true if the CPU has the RDTSC instruction.
131 */
132 extern DECLSPEC SDL_bool SDLCALL SDL_HasRDTSC(void);
133
134 /**
135 * This function returns true if the CPU has AltiVec features.
136 */
137 extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void);
138
139 /**
140 * This function returns true if the CPU has MMX features.
141 */
142 extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void);
143
144 /**
145 * This function returns true if the CPU has 3DNow! features.
146 */
147 extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNow(void);
148
149 /**
150 * This function returns true if the CPU has SSE features.
151 */
152 extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void);
153
154 /**
155 * This function returns true if the CPU has SSE2 features.
156 */
157 extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void);
158
159 /**
160 * This function returns true if the CPU has SSE3 features.
161 */
162 extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE3(void);
163
164 /**
165 * This function returns true if the CPU has SSE4.1 features.
166 */
167 extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE41(void);
168
169 /**
170 * This function returns true if the CPU has SSE4.2 features.
171 */
172 extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE42(void);
173
174 /**
175 * This function returns true if the CPU has AVX features.
176 */
177 extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX(void);
178
179 /**
180 * This function returns true if the CPU has AVX2 features.
181 */
182 extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX2(void);
183
184 /**
185 * This function returns true if the CPU has AVX-512F (foundation) features.
186 */
187 extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX512F(void);
188
189 /**
190 * This function returns true if the CPU has ARM SIMD (ARMv6) features.
191 */
192 extern DECLSPEC SDL_bool SDLCALL SDL_HasARMSIMD(void);
193
194 /**
195 * This function returns true if the CPU has NEON (ARM SIMD) features.
196 */
197 extern DECLSPEC SDL_bool SDLCALL SDL_HasNEON(void);
198
199 /**
200 * This function returns the amount of RAM configured in the system, in MB.
201 */
202 extern DECLSPEC int SDLCALL SDL_GetSystemRAM(void);
203
204 /**
205 * \brief Report the alignment this system needs for SIMD allocations.
206 *
207 * This will return the minimum number of bytes to which a pointer must be
208 * aligned to be compatible with SIMD instructions on the current machine.
209 * For example, if the machine supports SSE only, it will return 16, but if
210 * it supports AVX-512F, it'll return 64 (etc). This only reports values for
211 * instruction sets SDL knows about, so if your SDL build doesn't have
212 * SDL_HasAVX512F(), then it might return 16 for the SSE support it sees and
213 * not 64 for the AVX-512 instructions that exist but SDL doesn't know about.
214 * Plan accordingly.
215 */
216 extern DECLSPEC size_t SDLCALL SDL_SIMDGetAlignment(void);
217
218 /**
219 * \brief Allocate memory in a SIMD-friendly way.
220 *
221 * This will allocate a block of memory that is suitable for use with SIMD
222 * instructions. Specifically, it will be properly aligned and padded for
223 * the system's supported vector instructions.
224 *
225 * The memory returned will be padded such that it is safe to read or write
226 * an incomplete vector at the end of the memory block. This can be useful
227 * so you don't have to drop back to a scalar fallback at the end of your
228 * SIMD processing loop to deal with the final elements without overflowing
229 * the allocated buffer.
230 *
231 * You must free this memory with SDL_FreeSIMD(), not free() or SDL_free()
232 * or delete[], etc.
233 *
234 * Note that SDL will only deal with SIMD instruction sets it is aware of;
235 * for example, SDL 2.0.8 knows that SSE wants 16-byte vectors
236 * (SDL_HasSSE()), and AVX2 wants 32 bytes (SDL_HasAVX2()), but doesn't
237 * know that AVX-512 wants 64. To be clear: if you can't decide to use an
238 * instruction set with an SDL_Has*() function, don't use that instruction
239 * set with memory allocated through here.
240 *
241 * SDL_AllocSIMD(0) will return a non-NULL pointer, assuming the system isn't
242 * out of memory.
243 *
244 * \param len The length, in bytes, of the block to allocated. The actual
245 * allocated block might be larger due to padding, etc.
246 * \return Pointer to newly-allocated block, NULL if out of memory.
247 *
248 * \sa SDL_SIMDAlignment
249 * \sa SDL_SIMDRealloc
250 * \sa SDL_SIMDFree
251 */
252 extern DECLSPEC void * SDLCALL SDL_SIMDAlloc(const size_t len);
253
254 /**
255 * \brief Reallocate memory obtained from SDL_SIMDAlloc
256 *
257 * It is not valid to use this function on a pointer from anything but
258 * SDL_SIMDAlloc(). It can't be used on pointers from malloc, realloc,
259 * SDL_malloc, memalign, new[], etc.
260 *
261 * \param mem The pointer obtained from SDL_SIMDAlloc. This function also
262 * accepts NULL, at which point this function is the same as
263 * calling SDL_realloc with a NULL pointer.
264 * \param len The length, in bytes, of the block to allocated. The actual
265 * allocated block might be larger due to padding, etc. Passing 0
266 * will return a non-NULL pointer, assuming the system isn't out of
267 * memory.
268 * \return Pointer to newly-reallocated block, NULL if out of memory.
269 *
270 * \sa SDL_SIMDAlignment
271 * \sa SDL_SIMDAlloc
272 * \sa SDL_SIMDFree
273 */
274 extern DECLSPEC void * SDLCALL SDL_SIMDRealloc(void *mem, const size_t len);
275
276 /**
277 * \brief Deallocate memory obtained from SDL_SIMDAlloc
278 *
279 * It is not valid to use this function on a pointer from anything but
280 * SDL_SIMDAlloc(). It can't be used on pointers from malloc, realloc,
281 * SDL_malloc, memalign, new[], etc.
282 *
283 * However, SDL_SIMDFree(NULL) is a legal no-op.
284 *
285 * \sa SDL_SIMDAlloc
286 * \sa SDL_SIMDRealloc
287 */
288 extern DECLSPEC void SDLCALL SDL_SIMDFree(void *ptr);
289
290 /* vi: set ts=4 sw=4 expandtab: */
291 /* Ends C function definitions when using C++ */
292 #ifdef __cplusplus
293 }
294 #endif
295 #include "close_code.h"
296
297 #endif /* SDL_cpuinfo_h_ */
298
299 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_egl.h added (mode: 100644) (index 0000000..531441e)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_egl.h
24 *
25 * This is a simple file to encapsulate the EGL API headers.
26 */
27 #if !defined(_MSC_VER) && !defined(__ANDROID__)
28
29 #include <EGL/egl.h>
30 #include <EGL/eglext.h>
31
32 #else /* _MSC_VER */
33
34 /* EGL headers for Visual Studio */
35
36 #ifndef __khrplatform_h_
37 #define __khrplatform_h_
38
39 /*
40 ** Copyright (c) 2008-2009 The Khronos Group Inc.
41 **
42 ** Permission is hereby granted, free of charge, to any person obtaining a
43 ** copy of this software and/or associated documentation files (the
44 ** "Materials"), to deal in the Materials without restriction, including
45 ** without limitation the rights to use, copy, modify, merge, publish,
46 ** distribute, sublicense, and/or sell copies of the Materials, and to
47 ** permit persons to whom the Materials are furnished to do so, subject to
48 ** the following conditions:
49 **
50 ** The above copyright notice and this permission notice shall be included
51 ** in all copies or substantial portions of the Materials.
52 **
53 ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
54 ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
55 ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
56 ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
57 ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
58 ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
59 ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
60 */
61
62 /* Khronos platform-specific types and definitions.
63 *
64 * $Revision: 23298 $ on $Date: 2013-09-30 17:07:13 -0700 (Mon, 30 Sep 2013) $
65 *
66 * Adopters may modify this file to suit their platform. Adopters are
67 * encouraged to submit platform specific modifications to the Khronos
68 * group so that they can be included in future versions of this file.
69 * Please submit changes by sending them to the public Khronos Bugzilla
70 * (http://khronos.org/bugzilla) by filing a bug against product
71 * "Khronos (general)" component "Registry".
72 *
73 * A predefined template which fills in some of the bug fields can be
74 * reached using http://tinyurl.com/khrplatform-h-bugreport, but you
75 * must create a Bugzilla login first.
76 *
77 *
78 * See the Implementer's Guidelines for information about where this file
79 * should be located on your system and for more details of its use:
80 * http://www.khronos.org/registry/implementers_guide.pdf
81 *
82 * This file should be included as
83 * #include <KHR/khrplatform.h>
84 * by Khronos client API header files that use its types and defines.
85 *
86 * The types in khrplatform.h should only be used to define API-specific types.
87 *
88 * Types defined in khrplatform.h:
89 * khronos_int8_t signed 8 bit
90 * khronos_uint8_t unsigned 8 bit
91 * khronos_int16_t signed 16 bit
92 * khronos_uint16_t unsigned 16 bit
93 * khronos_int32_t signed 32 bit
94 * khronos_uint32_t unsigned 32 bit
95 * khronos_int64_t signed 64 bit
96 * khronos_uint64_t unsigned 64 bit
97 * khronos_intptr_t signed same number of bits as a pointer
98 * khronos_uintptr_t unsigned same number of bits as a pointer
99 * khronos_ssize_t signed size
100 * khronos_usize_t unsigned size
101 * khronos_float_t signed 32 bit floating point
102 * khronos_time_ns_t unsigned 64 bit time in nanoseconds
103 * khronos_utime_nanoseconds_t unsigned time interval or absolute time in
104 * nanoseconds
105 * khronos_stime_nanoseconds_t signed time interval in nanoseconds
106 * khronos_boolean_enum_t enumerated boolean type. This should
107 * only be used as a base type when a client API's boolean type is
108 * an enum. Client APIs which use an integer or other type for
109 * booleans cannot use this as the base type for their boolean.
110 *
111 * Tokens defined in khrplatform.h:
112 *
113 * KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values.
114 *
115 * KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0.
116 * KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0.
117 *
118 * Calling convention macros defined in this file:
119 * KHRONOS_APICALL
120 * KHRONOS_APIENTRY
121 * KHRONOS_APIATTRIBUTES
122 *
123 * These may be used in function prototypes as:
124 *
125 * KHRONOS_APICALL void KHRONOS_APIENTRY funcname(
126 * int arg1,
127 * int arg2) KHRONOS_APIATTRIBUTES;
128 */
129
130 /*-------------------------------------------------------------------------
131 * Definition of KHRONOS_APICALL
132 *-------------------------------------------------------------------------
133 * This precedes the return type of the function in the function prototype.
134 */
135 #if defined(_WIN32) && !defined(__SCITECH_SNAP__) && !defined(SDL_VIDEO_STATIC_ANGLE)
136 # define KHRONOS_APICALL __declspec(dllimport)
137 #elif defined (__SYMBIAN32__)
138 # define KHRONOS_APICALL IMPORT_C
139 #else
140 # define KHRONOS_APICALL
141 #endif
142
143 /*-------------------------------------------------------------------------
144 * Definition of KHRONOS_APIENTRY
145 *-------------------------------------------------------------------------
146 * This follows the return type of the function and precedes the function
147 * name in the function prototype.
148 */
149 #if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__)
150 /* Win32 but not WinCE */
151 # define KHRONOS_APIENTRY __stdcall
152 #else
153 # define KHRONOS_APIENTRY
154 #endif
155
156 /*-------------------------------------------------------------------------
157 * Definition of KHRONOS_APIATTRIBUTES
158 *-------------------------------------------------------------------------
159 * This follows the closing parenthesis of the function prototype arguments.
160 */
161 #if defined (__ARMCC_2__)
162 #define KHRONOS_APIATTRIBUTES __softfp
163 #else
164 #define KHRONOS_APIATTRIBUTES
165 #endif
166
167 /*-------------------------------------------------------------------------
168 * basic type definitions
169 *-----------------------------------------------------------------------*/
170 #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__)
171
172
173 /*
174 * Using <stdint.h>
175 */
176 #include <stdint.h>
177 typedef int32_t khronos_int32_t;
178 typedef uint32_t khronos_uint32_t;
179 typedef int64_t khronos_int64_t;
180 typedef uint64_t khronos_uint64_t;
181 #define KHRONOS_SUPPORT_INT64 1
182 #define KHRONOS_SUPPORT_FLOAT 1
183
184 #elif defined(__VMS ) || defined(__sgi)
185
186 /*
187 * Using <inttypes.h>
188 */
189 #include <inttypes.h>
190 typedef int32_t khronos_int32_t;
191 typedef uint32_t khronos_uint32_t;
192 typedef int64_t khronos_int64_t;
193 typedef uint64_t khronos_uint64_t;
194 #define KHRONOS_SUPPORT_INT64 1
195 #define KHRONOS_SUPPORT_FLOAT 1
196
197 #elif defined(_WIN32) && !defined(__SCITECH_SNAP__)
198
199 /*
200 * Win32
201 */
202 typedef __int32 khronos_int32_t;
203 typedef unsigned __int32 khronos_uint32_t;
204 typedef __int64 khronos_int64_t;
205 typedef unsigned __int64 khronos_uint64_t;
206 #define KHRONOS_SUPPORT_INT64 1
207 #define KHRONOS_SUPPORT_FLOAT 1
208
209 #elif defined(__sun__) || defined(__digital__)
210
211 /*
212 * Sun or Digital
213 */
214 typedef int khronos_int32_t;
215 typedef unsigned int khronos_uint32_t;
216 #if defined(__arch64__) || defined(_LP64)
217 typedef long int khronos_int64_t;
218 typedef unsigned long int khronos_uint64_t;
219 #else
220 typedef long long int khronos_int64_t;
221 typedef unsigned long long int khronos_uint64_t;
222 #endif /* __arch64__ */
223 #define KHRONOS_SUPPORT_INT64 1
224 #define KHRONOS_SUPPORT_FLOAT 1
225
226 #elif 0
227
228 /*
229 * Hypothetical platform with no float or int64 support
230 */
231 typedef int khronos_int32_t;
232 typedef unsigned int khronos_uint32_t;
233 #define KHRONOS_SUPPORT_INT64 0
234 #define KHRONOS_SUPPORT_FLOAT 0
235
236 #else
237
238 /*
239 * Generic fallback
240 */
241 #include <stdint.h>
242 typedef int32_t khronos_int32_t;
243 typedef uint32_t khronos_uint32_t;
244 typedef int64_t khronos_int64_t;
245 typedef uint64_t khronos_uint64_t;
246 #define KHRONOS_SUPPORT_INT64 1
247 #define KHRONOS_SUPPORT_FLOAT 1
248
249 #endif
250
251
252 /*
253 * Types that are (so far) the same on all platforms
254 */
255 typedef signed char khronos_int8_t;
256 typedef unsigned char khronos_uint8_t;
257 typedef signed short int khronos_int16_t;
258 typedef unsigned short int khronos_uint16_t;
259
260 /*
261 * Types that differ between LLP64 and LP64 architectures - in LLP64,
262 * pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
263 * to be the only LLP64 architecture in current use.
264 */
265 #ifdef _WIN64
266 typedef signed long long int khronos_intptr_t;
267 typedef unsigned long long int khronos_uintptr_t;
268 typedef signed long long int khronos_ssize_t;
269 typedef unsigned long long int khronos_usize_t;
270 #else
271 typedef signed long int khronos_intptr_t;
272 typedef unsigned long int khronos_uintptr_t;
273 typedef signed long int khronos_ssize_t;
274 typedef unsigned long int khronos_usize_t;
275 #endif
276
277 #if KHRONOS_SUPPORT_FLOAT
278 /*
279 * Float type
280 */
281 typedef float khronos_float_t;
282 #endif
283
284 #if KHRONOS_SUPPORT_INT64
285 /* Time types
286 *
287 * These types can be used to represent a time interval in nanoseconds or
288 * an absolute Unadjusted System Time. Unadjusted System Time is the number
289 * of nanoseconds since some arbitrary system event (e.g. since the last
290 * time the system booted). The Unadjusted System Time is an unsigned
291 * 64 bit value that wraps back to 0 every 584 years. Time intervals
292 * may be either signed or unsigned.
293 */
294 typedef khronos_uint64_t khronos_utime_nanoseconds_t;
295 typedef khronos_int64_t khronos_stime_nanoseconds_t;
296 #endif
297
298 /*
299 * Dummy value used to pad enum types to 32 bits.
300 */
301 #ifndef KHRONOS_MAX_ENUM
302 #define KHRONOS_MAX_ENUM 0x7FFFFFFF
303 #endif
304
305 /*
306 * Enumerated boolean type
307 *
308 * Values other than zero should be considered to be true. Therefore
309 * comparisons should not be made against KHRONOS_TRUE.
310 */
311 typedef enum {
312 KHRONOS_FALSE = 0,
313 KHRONOS_TRUE = 1,
314 KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM
315 } khronos_boolean_enum_t;
316
317 #endif /* __khrplatform_h_ */
318
319
320 #ifndef __eglplatform_h_
321 #define __eglplatform_h_
322
323 /*
324 ** Copyright (c) 2007-2009 The Khronos Group Inc.
325 **
326 ** Permission is hereby granted, free of charge, to any person obtaining a
327 ** copy of this software and/or associated documentation files (the
328 ** "Materials"), to deal in the Materials without restriction, including
329 ** without limitation the rights to use, copy, modify, merge, publish,
330 ** distribute, sublicense, and/or sell copies of the Materials, and to
331 ** permit persons to whom the Materials are furnished to do so, subject to
332 ** the following conditions:
333 **
334 ** The above copyright notice and this permission notice shall be included
335 ** in all copies or substantial portions of the Materials.
336 **
337 ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
338 ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
339 ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
340 ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
341 ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
342 ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
343 ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
344 */
345
346 /* Platform-specific types and definitions for egl.h
347 * $Revision: 12306 $ on $Date: 2010-08-25 09:51:28 -0700 (Wed, 25 Aug 2010) $
348 *
349 * Adopters may modify khrplatform.h and this file to suit their platform.
350 * You are encouraged to submit all modifications to the Khronos group so that
351 * they can be included in future versions of this file. Please submit changes
352 * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
353 * by filing a bug against product "EGL" component "Registry".
354 */
355
356 /*#include <KHR/khrplatform.h>*/
357
358 /* Macros used in EGL function prototype declarations.
359 *
360 * EGL functions should be prototyped as:
361 *
362 * EGLAPI return-type EGLAPIENTRY eglFunction(arguments);
363 * typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments);
364 *
365 * KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h
366 */
367
368 #ifndef EGLAPI
369 #define EGLAPI KHRONOS_APICALL
370 #endif
371
372 #ifndef EGLAPIENTRY
373 #define EGLAPIENTRY KHRONOS_APIENTRY
374 #endif
375 #define EGLAPIENTRYP EGLAPIENTRY*
376
377 /* The types NativeDisplayType, NativeWindowType, and NativePixmapType
378 * are aliases of window-system-dependent types, such as X Display * or
379 * Windows Device Context. They must be defined in platform-specific
380 * code below. The EGL-prefixed versions of Native*Type are the same
381 * types, renamed in EGL 1.3 so all types in the API start with "EGL".
382 *
383 * Khronos STRONGLY RECOMMENDS that you use the default definitions
384 * provided below, since these changes affect both binary and source
385 * portability of applications using EGL running on different EGL
386 * implementations.
387 */
388
389 #if defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */
390 #ifndef WIN32_LEAN_AND_MEAN
391 #define WIN32_LEAN_AND_MEAN 1
392 #endif
393 #ifndef NOMINMAX /* don't define min() and max(). */
394 #define NOMINMAX
395 #endif
396 #include <windows.h>
397
398 #if __WINRT__
399 #include <Unknwn.h>
400 typedef IUnknown * EGLNativeWindowType;
401 typedef IUnknown * EGLNativePixmapType;
402 typedef IUnknown * EGLNativeDisplayType;
403 #else
404 typedef HDC EGLNativeDisplayType;
405 typedef HBITMAP EGLNativePixmapType;
406 typedef HWND EGLNativeWindowType;
407 #endif
408
409 #elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */
410
411 typedef int EGLNativeDisplayType;
412 typedef void *EGLNativeWindowType;
413 typedef void *EGLNativePixmapType;
414
415 #elif defined(WL_EGL_PLATFORM)
416
417 typedef struct wl_display *EGLNativeDisplayType;
418 typedef struct wl_egl_pixmap *EGLNativePixmapType;
419 typedef struct wl_egl_window *EGLNativeWindowType;
420
421 #elif defined(__GBM__)
422
423 typedef struct gbm_device *EGLNativeDisplayType;
424 typedef struct gbm_bo *EGLNativePixmapType;
425 typedef void *EGLNativeWindowType;
426
427 #elif defined(__ANDROID__) /* Android */
428
429 struct ANativeWindow;
430 struct egl_native_pixmap_t;
431
432 typedef struct ANativeWindow *EGLNativeWindowType;
433 typedef struct egl_native_pixmap_t *EGLNativePixmapType;
434 typedef void *EGLNativeDisplayType;
435
436 #elif defined(MIR_EGL_PLATFORM)
437
438 #include <mir_toolkit/mir_client_library.h>
439 typedef MirEGLNativeDisplayType EGLNativeDisplayType;
440 typedef void *EGLNativePixmapType;
441 typedef MirEGLNativeWindowType EGLNativeWindowType;
442
443 #elif defined(__unix__)
444
445 #ifdef MESA_EGL_NO_X11_HEADERS
446
447 typedef void *EGLNativeDisplayType;
448 typedef khronos_uintptr_t EGLNativePixmapType;
449 typedef khronos_uintptr_t EGLNativeWindowType;
450
451 #else
452
453 /* X11 (tentative) */
454 #include <X11/Xlib.h>
455 #include <X11/Xutil.h>
456
457 typedef Display *EGLNativeDisplayType;
458 typedef Pixmap EGLNativePixmapType;
459 typedef Window EGLNativeWindowType;
460
461 #endif /* MESA_EGL_NO_X11_HEADERS */
462
463 #else
464 #error "Platform not recognized"
465 #endif
466
467 /* EGL 1.2 types, renamed for consistency in EGL 1.3 */
468 typedef EGLNativeDisplayType NativeDisplayType;
469 typedef EGLNativePixmapType NativePixmapType;
470 typedef EGLNativeWindowType NativeWindowType;
471
472
473 /* Define EGLint. This must be a signed integral type large enough to contain
474 * all legal attribute names and values passed into and out of EGL, whether
475 * their type is boolean, bitmask, enumerant (symbolic constant), integer,
476 * handle, or other. While in general a 32-bit integer will suffice, if
477 * handles are 64 bit types, then EGLint should be defined as a signed 64-bit
478 * integer type.
479 */
480 typedef khronos_int32_t EGLint;
481
482 #endif /* __eglplatform_h */
483
484 #ifndef __egl_h_
485 #define __egl_h_ 1
486
487 #ifdef __cplusplus
488 extern "C" {
489 #endif
490
491 /*
492 ** Copyright (c) 2013-2015 The Khronos Group Inc.
493 **
494 ** Permission is hereby granted, free of charge, to any person obtaining a
495 ** copy of this software and/or associated documentation files (the
496 ** "Materials"), to deal in the Materials without restriction, including
497 ** without limitation the rights to use, copy, modify, merge, publish,
498 ** distribute, sublicense, and/or sell copies of the Materials, and to
499 ** permit persons to whom the Materials are furnished to do so, subject to
500 ** the following conditions:
501 **
502 ** The above copyright notice and this permission notice shall be included
503 ** in all copies or substantial portions of the Materials.
504 **
505 ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
506 ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
507 ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
508 ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
509 ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
510 ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
511 ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
512 */
513 /*
514 ** This header is generated from the Khronos OpenGL / OpenGL ES XML
515 ** API Registry. The current version of the Registry, generator scripts
516 ** used to make the header, and the header can be found at
517 ** http://www.opengl.org/registry/
518 **
519 ** Khronos $Revision: 31566 $ on $Date: 2015-06-23 08:48:48 -0700 (Tue, 23 Jun 2015) $
520 */
521
522 /*#include <EGL/eglplatform.h>*/
523
524 /* Generated on date 20150623 */
525
526 /* Generated C header for:
527 * API: egl
528 * Versions considered: .*
529 * Versions emitted: .*
530 * Default extensions included: None
531 * Additional extensions included: _nomatch_^
532 * Extensions removed: _nomatch_^
533 */
534
535 #ifndef EGL_VERSION_1_0
536 #define EGL_VERSION_1_0 1
537 typedef unsigned int EGLBoolean;
538 typedef void *EGLDisplay;
539 typedef void *EGLConfig;
540 typedef void *EGLSurface;
541 typedef void *EGLContext;
542 typedef void (*__eglMustCastToProperFunctionPointerType)(void);
543 #define EGL_ALPHA_SIZE 0x3021
544 #define EGL_BAD_ACCESS 0x3002
545 #define EGL_BAD_ALLOC 0x3003
546 #define EGL_BAD_ATTRIBUTE 0x3004
547 #define EGL_BAD_CONFIG 0x3005
548 #define EGL_BAD_CONTEXT 0x3006
549 #define EGL_BAD_CURRENT_SURFACE 0x3007
550 #define EGL_BAD_DISPLAY 0x3008
551 #define EGL_BAD_MATCH 0x3009
552 #define EGL_BAD_NATIVE_PIXMAP 0x300A
553 #define EGL_BAD_NATIVE_WINDOW 0x300B
554 #define EGL_BAD_PARAMETER 0x300C
555 #define EGL_BAD_SURFACE 0x300D
556 #define EGL_BLUE_SIZE 0x3022
557 #define EGL_BUFFER_SIZE 0x3020
558 #define EGL_CONFIG_CAVEAT 0x3027
559 #define EGL_CONFIG_ID 0x3028
560 #define EGL_CORE_NATIVE_ENGINE 0x305B
561 #define EGL_DEPTH_SIZE 0x3025
562 #define EGL_DONT_CARE ((EGLint)-1)
563 #define EGL_DRAW 0x3059
564 #define EGL_EXTENSIONS 0x3055
565 #define EGL_FALSE 0
566 #define EGL_GREEN_SIZE 0x3023
567 #define EGL_HEIGHT 0x3056
568 #define EGL_LARGEST_PBUFFER 0x3058
569 #define EGL_LEVEL 0x3029
570 #define EGL_MAX_PBUFFER_HEIGHT 0x302A
571 #define EGL_MAX_PBUFFER_PIXELS 0x302B
572 #define EGL_MAX_PBUFFER_WIDTH 0x302C
573 #define EGL_NATIVE_RENDERABLE 0x302D
574 #define EGL_NATIVE_VISUAL_ID 0x302E
575 #define EGL_NATIVE_VISUAL_TYPE 0x302F
576 #define EGL_NONE 0x3038
577 #define EGL_NON_CONFORMANT_CONFIG 0x3051
578 #define EGL_NOT_INITIALIZED 0x3001
579 #define EGL_NO_CONTEXT ((EGLContext)0)
580 #define EGL_NO_DISPLAY ((EGLDisplay)0)
581 #define EGL_NO_SURFACE ((EGLSurface)0)
582 #define EGL_PBUFFER_BIT 0x0001
583 #define EGL_PIXMAP_BIT 0x0002
584 #define EGL_READ 0x305A
585 #define EGL_RED_SIZE 0x3024
586 #define EGL_SAMPLES 0x3031
587 #define EGL_SAMPLE_BUFFERS 0x3032
588 #define EGL_SLOW_CONFIG 0x3050
589 #define EGL_STENCIL_SIZE 0x3026
590 #define EGL_SUCCESS 0x3000
591 #define EGL_SURFACE_TYPE 0x3033
592 #define EGL_TRANSPARENT_BLUE_VALUE 0x3035
593 #define EGL_TRANSPARENT_GREEN_VALUE 0x3036
594 #define EGL_TRANSPARENT_RED_VALUE 0x3037
595 #define EGL_TRANSPARENT_RGB 0x3052
596 #define EGL_TRANSPARENT_TYPE 0x3034
597 #define EGL_TRUE 1
598 #define EGL_VENDOR 0x3053
599 #define EGL_VERSION 0x3054
600 #define EGL_WIDTH 0x3057
601 #define EGL_WINDOW_BIT 0x0004
602 EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config);
603 EGLAPI EGLBoolean EGLAPIENTRY eglCopyBuffers (EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target);
604 EGLAPI EGLContext EGLAPIENTRY eglCreateContext (EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list);
605 EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferSurface (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list);
606 EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurface (EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint *attrib_list);
607 EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface (EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list);
608 EGLAPI EGLBoolean EGLAPIENTRY eglDestroyContext (EGLDisplay dpy, EGLContext ctx);
609 EGLAPI EGLBoolean EGLAPIENTRY eglDestroySurface (EGLDisplay dpy, EGLSurface surface);
610 EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigAttrib (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value);
611 EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigs (EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config);
612 EGLAPI EGLDisplay EGLAPIENTRY eglGetCurrentDisplay (void);
613 EGLAPI EGLSurface EGLAPIENTRY eglGetCurrentSurface (EGLint readdraw);
614 EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay (EGLNativeDisplayType display_id);
615 EGLAPI EGLint EGLAPIENTRY eglGetError (void);
616 EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY eglGetProcAddress (const char *procname);
617 EGLAPI EGLBoolean EGLAPIENTRY eglInitialize (EGLDisplay dpy, EGLint *major, EGLint *minor);
618 EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrent (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx);
619 EGLAPI EGLBoolean EGLAPIENTRY eglQueryContext (EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value);
620 EGLAPI const char *EGLAPIENTRY eglQueryString (EGLDisplay dpy, EGLint name);
621 EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value);
622 EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers (EGLDisplay dpy, EGLSurface surface);
623 EGLAPI EGLBoolean EGLAPIENTRY eglTerminate (EGLDisplay dpy);
624 EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL (void);
625 EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative (EGLint engine);
626 #endif /* EGL_VERSION_1_0 */
627
628 #ifndef EGL_VERSION_1_1
629 #define EGL_VERSION_1_1 1
630 #define EGL_BACK_BUFFER 0x3084
631 #define EGL_BIND_TO_TEXTURE_RGB 0x3039
632 #define EGL_BIND_TO_TEXTURE_RGBA 0x303A
633 #define EGL_CONTEXT_LOST 0x300E
634 #define EGL_MIN_SWAP_INTERVAL 0x303B
635 #define EGL_MAX_SWAP_INTERVAL 0x303C
636 #define EGL_MIPMAP_TEXTURE 0x3082
637 #define EGL_MIPMAP_LEVEL 0x3083
638 #define EGL_NO_TEXTURE 0x305C
639 #define EGL_TEXTURE_2D 0x305F
640 #define EGL_TEXTURE_FORMAT 0x3080
641 #define EGL_TEXTURE_RGB 0x305D
642 #define EGL_TEXTURE_RGBA 0x305E
643 #define EGL_TEXTURE_TARGET 0x3081
644 EGLAPI EGLBoolean EGLAPIENTRY eglBindTexImage (EGLDisplay dpy, EGLSurface surface, EGLint buffer);
645 EGLAPI EGLBoolean EGLAPIENTRY eglReleaseTexImage (EGLDisplay dpy, EGLSurface surface, EGLint buffer);
646 EGLAPI EGLBoolean EGLAPIENTRY eglSurfaceAttrib (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value);
647 EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval (EGLDisplay dpy, EGLint interval);
648 #endif /* EGL_VERSION_1_1 */
649
650 #ifndef EGL_VERSION_1_2
651 #define EGL_VERSION_1_2 1
652 typedef unsigned int EGLenum;
653 typedef void *EGLClientBuffer;
654 #define EGL_ALPHA_FORMAT 0x3088
655 #define EGL_ALPHA_FORMAT_NONPRE 0x308B
656 #define EGL_ALPHA_FORMAT_PRE 0x308C
657 #define EGL_ALPHA_MASK_SIZE 0x303E
658 #define EGL_BUFFER_PRESERVED 0x3094
659 #define EGL_BUFFER_DESTROYED 0x3095
660 #define EGL_CLIENT_APIS 0x308D
661 #define EGL_COLORSPACE 0x3087
662 #define EGL_COLORSPACE_sRGB 0x3089
663 #define EGL_COLORSPACE_LINEAR 0x308A
664 #define EGL_COLOR_BUFFER_TYPE 0x303F
665 #define EGL_CONTEXT_CLIENT_TYPE 0x3097
666 #define EGL_DISPLAY_SCALING 10000
667 #define EGL_HORIZONTAL_RESOLUTION 0x3090
668 #define EGL_LUMINANCE_BUFFER 0x308F
669 #define EGL_LUMINANCE_SIZE 0x303D
670 #define EGL_OPENGL_ES_BIT 0x0001
671 #define EGL_OPENVG_BIT 0x0002
672 #define EGL_OPENGL_ES_API 0x30A0
673 #define EGL_OPENVG_API 0x30A1
674 #define EGL_OPENVG_IMAGE 0x3096
675 #define EGL_PIXEL_ASPECT_RATIO 0x3092
676 #define EGL_RENDERABLE_TYPE 0x3040
677 #define EGL_RENDER_BUFFER 0x3086
678 #define EGL_RGB_BUFFER 0x308E
679 #define EGL_SINGLE_BUFFER 0x3085
680 #define EGL_SWAP_BEHAVIOR 0x3093
681 #define EGL_UNKNOWN ((EGLint)-1)
682 #define EGL_VERTICAL_RESOLUTION 0x3091
683 EGLAPI EGLBoolean EGLAPIENTRY eglBindAPI (EGLenum api);
684 EGLAPI EGLenum EGLAPIENTRY eglQueryAPI (void);
685 EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferFromClientBuffer (EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list);
686 EGLAPI EGLBoolean EGLAPIENTRY eglReleaseThread (void);
687 EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient (void);
688 #endif /* EGL_VERSION_1_2 */
689
690 #ifndef EGL_VERSION_1_3
691 #define EGL_VERSION_1_3 1
692 #define EGL_CONFORMANT 0x3042
693 #define EGL_CONTEXT_CLIENT_VERSION 0x3098
694 #define EGL_MATCH_NATIVE_PIXMAP 0x3041
695 #define EGL_OPENGL_ES2_BIT 0x0004
696 #define EGL_VG_ALPHA_FORMAT 0x3088
697 #define EGL_VG_ALPHA_FORMAT_NONPRE 0x308B
698 #define EGL_VG_ALPHA_FORMAT_PRE 0x308C
699 #define EGL_VG_ALPHA_FORMAT_PRE_BIT 0x0040
700 #define EGL_VG_COLORSPACE 0x3087
701 #define EGL_VG_COLORSPACE_sRGB 0x3089
702 #define EGL_VG_COLORSPACE_LINEAR 0x308A
703 #define EGL_VG_COLORSPACE_LINEAR_BIT 0x0020
704 #endif /* EGL_VERSION_1_3 */
705
706 #ifndef EGL_VERSION_1_4
707 #define EGL_VERSION_1_4 1
708 #define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType)0)
709 #define EGL_MULTISAMPLE_RESOLVE_BOX_BIT 0x0200
710 #define EGL_MULTISAMPLE_RESOLVE 0x3099
711 #define EGL_MULTISAMPLE_RESOLVE_DEFAULT 0x309A
712 #define EGL_MULTISAMPLE_RESOLVE_BOX 0x309B
713 #define EGL_OPENGL_API 0x30A2
714 #define EGL_OPENGL_BIT 0x0008
715 #define EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400
716 EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext (void);
717 #endif /* EGL_VERSION_1_4 */
718
719 #ifndef EGL_VERSION_1_5
720 #define EGL_VERSION_1_5 1
721 typedef void *EGLSync;
722 typedef intptr_t EGLAttrib;
723 typedef khronos_utime_nanoseconds_t EGLTime;
724 typedef void *EGLImage;
725 #define EGL_CONTEXT_MAJOR_VERSION 0x3098
726 #define EGL_CONTEXT_MINOR_VERSION 0x30FB
727 #define EGL_CONTEXT_OPENGL_PROFILE_MASK 0x30FD
728 #define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY 0x31BD
729 #define EGL_NO_RESET_NOTIFICATION 0x31BE
730 #define EGL_LOSE_CONTEXT_ON_RESET 0x31BF
731 #define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT 0x00000001
732 #define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT 0x00000002
733 #define EGL_CONTEXT_OPENGL_DEBUG 0x31B0
734 #define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE 0x31B1
735 #define EGL_CONTEXT_OPENGL_ROBUST_ACCESS 0x31B2
736 #define EGL_OPENGL_ES3_BIT 0x00000040
737 #define EGL_CL_EVENT_HANDLE 0x309C
738 #define EGL_SYNC_CL_EVENT 0x30FE
739 #define EGL_SYNC_CL_EVENT_COMPLETE 0x30FF
740 #define EGL_SYNC_PRIOR_COMMANDS_COMPLETE 0x30F0
741 #define EGL_SYNC_TYPE 0x30F7
742 #define EGL_SYNC_STATUS 0x30F1
743 #define EGL_SYNC_CONDITION 0x30F8
744 #define EGL_SIGNALED 0x30F2
745 #define EGL_UNSIGNALED 0x30F3
746 #define EGL_SYNC_FLUSH_COMMANDS_BIT 0x0001
747 #define EGL_FOREVER 0xFFFFFFFFFFFFFFFFull
748 #define EGL_TIMEOUT_EXPIRED 0x30F5
749 #define EGL_CONDITION_SATISFIED 0x30F6
750 #define EGL_NO_SYNC ((EGLSync)0)
751 #define EGL_SYNC_FENCE 0x30F9
752 #define EGL_GL_COLORSPACE 0x309D
753 #define EGL_GL_COLORSPACE_SRGB 0x3089
754 #define EGL_GL_COLORSPACE_LINEAR 0x308A
755 #define EGL_GL_RENDERBUFFER 0x30B9
756 #define EGL_GL_TEXTURE_2D 0x30B1
757 #define EGL_GL_TEXTURE_LEVEL 0x30BC
758 #define EGL_GL_TEXTURE_3D 0x30B2
759 #define EGL_GL_TEXTURE_ZOFFSET 0x30BD
760 #define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x30B3
761 #define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x30B4
762 #define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x30B5
763 #define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x30B6
764 #define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x30B7
765 #define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x30B8
766 #define EGL_IMAGE_PRESERVED 0x30D2
767 #define EGL_NO_IMAGE ((EGLImage)0)
768 EGLAPI EGLSync EGLAPIENTRY eglCreateSync (EGLDisplay dpy, EGLenum type, const EGLAttrib *attrib_list);
769 EGLAPI EGLBoolean EGLAPIENTRY eglDestroySync (EGLDisplay dpy, EGLSync sync);
770 EGLAPI EGLint EGLAPIENTRY eglClientWaitSync (EGLDisplay dpy, EGLSync sync, EGLint flags, EGLTime timeout);
771 EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttrib (EGLDisplay dpy, EGLSync sync, EGLint attribute, EGLAttrib *value);
772 EGLAPI EGLImage EGLAPIENTRY eglCreateImage (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLAttrib *attrib_list);
773 EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImage (EGLDisplay dpy, EGLImage image);
774 EGLAPI EGLDisplay EGLAPIENTRY eglGetPlatformDisplay (EGLenum platform, void *native_display, const EGLAttrib *attrib_list);
775 EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformWindowSurface (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLAttrib *attrib_list);
776 EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurface (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLAttrib *attrib_list);
777 EGLAPI EGLBoolean EGLAPIENTRY eglWaitSync (EGLDisplay dpy, EGLSync sync, EGLint flags);
778 #endif /* EGL_VERSION_1_5 */
779
780 #ifdef __cplusplus
781 }
782 #endif
783
784 #endif /* __egl_h_ */
785
786
787
788 #ifndef __eglext_h_
789 #define __eglext_h_ 1
790
791 #ifdef __cplusplus
792 extern "C" {
793 #endif
794
795 /*
796 ** Copyright (c) 2013-2015 The Khronos Group Inc.
797 **
798 ** Permission is hereby granted, free of charge, to any person obtaining a
799 ** copy of this software and/or associated documentation files (the
800 ** "Materials"), to deal in the Materials without restriction, including
801 ** without limitation the rights to use, copy, modify, merge, publish,
802 ** distribute, sublicense, and/or sell copies of the Materials, and to
803 ** permit persons to whom the Materials are furnished to do so, subject to
804 ** the following conditions:
805 **
806 ** The above copyright notice and this permission notice shall be included
807 ** in all copies or substantial portions of the Materials.
808 **
809 ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
810 ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
811 ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
812 ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
813 ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
814 ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
815 ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
816 */
817 /*
818 ** This header is generated from the Khronos OpenGL / OpenGL ES XML
819 ** API Registry. The current version of the Registry, generator scripts
820 ** used to make the header, and the header can be found at
821 ** http://www.opengl.org/registry/
822 **
823 ** Khronos $Revision: 31566 $ on $Date: 2015-06-23 08:48:48 -0700 (Tue, 23 Jun 2015) $
824 */
825
826 /*#include <EGL/eglplatform.h>*/
827
828 #define EGL_EGLEXT_VERSION 20150623
829
830 /* Generated C header for:
831 * API: egl
832 * Versions considered: .*
833 * Versions emitted: _nomatch_^
834 * Default extensions included: egl
835 * Additional extensions included: _nomatch_^
836 * Extensions removed: _nomatch_^
837 */
838
839 #ifndef EGL_KHR_cl_event
840 #define EGL_KHR_cl_event 1
841 #define EGL_CL_EVENT_HANDLE_KHR 0x309C
842 #define EGL_SYNC_CL_EVENT_KHR 0x30FE
843 #define EGL_SYNC_CL_EVENT_COMPLETE_KHR 0x30FF
844 #endif /* EGL_KHR_cl_event */
845
846 #ifndef EGL_KHR_cl_event2
847 #define EGL_KHR_cl_event2 1
848 typedef void *EGLSyncKHR;
849 typedef intptr_t EGLAttribKHR;
850 typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESYNC64KHRPROC) (EGLDisplay dpy, EGLenum type, const EGLAttribKHR *attrib_list);
851 #ifdef EGL_EGLEXT_PROTOTYPES
852 EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSync64KHR (EGLDisplay dpy, EGLenum type, const EGLAttribKHR *attrib_list);
853 #endif
854 #endif /* EGL_KHR_cl_event2 */
855
856 #ifndef EGL_KHR_client_get_all_proc_addresses
857 #define EGL_KHR_client_get_all_proc_addresses 1
858 #endif /* EGL_KHR_client_get_all_proc_addresses */
859
860 #ifndef EGL_KHR_config_attribs
861 #define EGL_KHR_config_attribs 1
862 #define EGL_CONFORMANT_KHR 0x3042
863 #define EGL_VG_COLORSPACE_LINEAR_BIT_KHR 0x0020
864 #define EGL_VG_ALPHA_FORMAT_PRE_BIT_KHR 0x0040
865 #endif /* EGL_KHR_config_attribs */
866
867 #ifndef EGL_KHR_create_context
868 #define EGL_KHR_create_context 1
869 #define EGL_CONTEXT_MAJOR_VERSION_KHR 0x3098
870 #define EGL_CONTEXT_MINOR_VERSION_KHR 0x30FB
871 #define EGL_CONTEXT_FLAGS_KHR 0x30FC
872 #define EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR 0x30FD
873 #define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR 0x31BD
874 #define EGL_NO_RESET_NOTIFICATION_KHR 0x31BE
875 #define EGL_LOSE_CONTEXT_ON_RESET_KHR 0x31BF
876 #define EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR 0x00000001
877 #define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR 0x00000002
878 #define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR 0x00000004
879 #define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR 0x00000001
880 #define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR 0x00000002
881 #define EGL_OPENGL_ES3_BIT_KHR 0x00000040
882 #endif /* EGL_KHR_create_context */
883
884 #ifndef EGL_KHR_create_context_no_error
885 #define EGL_KHR_create_context_no_error 1
886 #define EGL_CONTEXT_OPENGL_NO_ERROR_KHR 0x31B3
887 #endif /* EGL_KHR_create_context_no_error */
888
889 #ifndef EGL_KHR_fence_sync
890 #define EGL_KHR_fence_sync 1
891 typedef khronos_utime_nanoseconds_t EGLTimeKHR;
892 #ifdef KHRONOS_SUPPORT_INT64
893 #define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR 0x30F0
894 #define EGL_SYNC_CONDITION_KHR 0x30F8
895 #define EGL_SYNC_FENCE_KHR 0x30F9
896 typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESYNCKHRPROC) (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list);
897 typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync);
898 typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout);
899 typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value);
900 #ifdef EGL_EGLEXT_PROTOTYPES
901 EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSyncKHR (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list);
902 EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncKHR (EGLDisplay dpy, EGLSyncKHR sync);
903 EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout);
904 EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value);
905 #endif
906 #endif /* KHRONOS_SUPPORT_INT64 */
907 #endif /* EGL_KHR_fence_sync */
908
909 #ifndef EGL_KHR_get_all_proc_addresses
910 #define EGL_KHR_get_all_proc_addresses 1
911 #endif /* EGL_KHR_get_all_proc_addresses */
912
913 #ifndef EGL_KHR_gl_colorspace
914 #define EGL_KHR_gl_colorspace 1
915 #define EGL_GL_COLORSPACE_KHR 0x309D
916 #define EGL_GL_COLORSPACE_SRGB_KHR 0x3089
917 #define EGL_GL_COLORSPACE_LINEAR_KHR 0x308A
918 #endif /* EGL_KHR_gl_colorspace */
919
920 #ifndef EGL_KHR_gl_renderbuffer_image
921 #define EGL_KHR_gl_renderbuffer_image 1
922 #define EGL_GL_RENDERBUFFER_KHR 0x30B9
923 #endif /* EGL_KHR_gl_renderbuffer_image */
924
925 #ifndef EGL_KHR_gl_texture_2D_image
926 #define EGL_KHR_gl_texture_2D_image 1
927 #define EGL_GL_TEXTURE_2D_KHR 0x30B1
928 #define EGL_GL_TEXTURE_LEVEL_KHR 0x30BC
929 #endif /* EGL_KHR_gl_texture_2D_image */
930
931 #ifndef EGL_KHR_gl_texture_3D_image
932 #define EGL_KHR_gl_texture_3D_image 1
933 #define EGL_GL_TEXTURE_3D_KHR 0x30B2
934 #define EGL_GL_TEXTURE_ZOFFSET_KHR 0x30BD
935 #endif /* EGL_KHR_gl_texture_3D_image */
936
937 #ifndef EGL_KHR_gl_texture_cubemap_image
938 #define EGL_KHR_gl_texture_cubemap_image 1
939 #define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X_KHR 0x30B3
940 #define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X_KHR 0x30B4
941 #define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y_KHR 0x30B5
942 #define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_KHR 0x30B6
943 #define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z_KHR 0x30B7
944 #define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_KHR 0x30B8
945 #endif /* EGL_KHR_gl_texture_cubemap_image */
946
947 #ifndef EGL_KHR_image
948 #define EGL_KHR_image 1
949 typedef void *EGLImageKHR;
950 #define EGL_NATIVE_PIXMAP_KHR 0x30B0
951 #define EGL_NO_IMAGE_KHR ((EGLImageKHR)0)
952 typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEIMAGEKHRPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list);
953 typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGLImageKHR image);
954 #ifdef EGL_EGLEXT_PROTOTYPES
955 EGLAPI EGLImageKHR EGLAPIENTRY eglCreateImageKHR (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list);
956 EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImageKHR (EGLDisplay dpy, EGLImageKHR image);
957 #endif
958 #endif /* EGL_KHR_image */
959
960 #ifndef EGL_KHR_image_base
961 #define EGL_KHR_image_base 1
962 #define EGL_IMAGE_PRESERVED_KHR 0x30D2
963 #endif /* EGL_KHR_image_base */
964
965 #ifndef EGL_KHR_image_pixmap
966 #define EGL_KHR_image_pixmap 1
967 #endif /* EGL_KHR_image_pixmap */
968
969 #ifndef EGL_KHR_lock_surface
970 #define EGL_KHR_lock_surface 1
971 #define EGL_READ_SURFACE_BIT_KHR 0x0001
972 #define EGL_WRITE_SURFACE_BIT_KHR 0x0002
973 #define EGL_LOCK_SURFACE_BIT_KHR 0x0080
974 #define EGL_OPTIMAL_FORMAT_BIT_KHR 0x0100
975 #define EGL_MATCH_FORMAT_KHR 0x3043
976 #define EGL_FORMAT_RGB_565_EXACT_KHR 0x30C0
977 #define EGL_FORMAT_RGB_565_KHR 0x30C1
978 #define EGL_FORMAT_RGBA_8888_EXACT_KHR 0x30C2
979 #define EGL_FORMAT_RGBA_8888_KHR 0x30C3
980 #define EGL_MAP_PRESERVE_PIXELS_KHR 0x30C4
981 #define EGL_LOCK_USAGE_HINT_KHR 0x30C5
982 #define EGL_BITMAP_POINTER_KHR 0x30C6
983 #define EGL_BITMAP_PITCH_KHR 0x30C7
984 #define EGL_BITMAP_ORIGIN_KHR 0x30C8
985 #define EGL_BITMAP_PIXEL_RED_OFFSET_KHR 0x30C9
986 #define EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR 0x30CA
987 #define EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR 0x30CB
988 #define EGL_BITMAP_PIXEL_ALPHA_OFFSET_KHR 0x30CC
989 #define EGL_BITMAP_PIXEL_LUMINANCE_OFFSET_KHR 0x30CD
990 #define EGL_LOWER_LEFT_KHR 0x30CE
991 #define EGL_UPPER_LEFT_KHR 0x30CF
992 typedef EGLBoolean (EGLAPIENTRYP PFNEGLLOCKSURFACEKHRPROC) (EGLDisplay dpy, EGLSurface surface, const EGLint *attrib_list);
993 typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNLOCKSURFACEKHRPROC) (EGLDisplay dpy, EGLSurface surface);
994 #ifdef EGL_EGLEXT_PROTOTYPES
995 EGLAPI EGLBoolean EGLAPIENTRY eglLockSurfaceKHR (EGLDisplay dpy, EGLSurface surface, const EGLint *attrib_list);
996 EGLAPI EGLBoolean EGLAPIENTRY eglUnlockSurfaceKHR (EGLDisplay dpy, EGLSurface surface);
997 #endif
998 #endif /* EGL_KHR_lock_surface */
999
1000 #ifndef EGL_KHR_lock_surface2
1001 #define EGL_KHR_lock_surface2 1
1002 #define EGL_BITMAP_PIXEL_SIZE_KHR 0x3110
1003 #endif /* EGL_KHR_lock_surface2 */
1004
1005 #ifndef EGL_KHR_lock_surface3
1006 #define EGL_KHR_lock_surface3 1
1007 typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSURFACE64KHRPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLAttribKHR *value);
1008 #ifdef EGL_EGLEXT_PROTOTYPES
1009 EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface64KHR (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLAttribKHR *value);
1010 #endif
1011 #endif /* EGL_KHR_lock_surface3 */
1012
1013 #ifndef EGL_KHR_partial_update
1014 #define EGL_KHR_partial_update 1
1015 #define EGL_BUFFER_AGE_KHR 0x313D
1016 typedef EGLBoolean (EGLAPIENTRYP PFNEGLSETDAMAGEREGIONKHRPROC) (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects);
1017 #ifdef EGL_EGLEXT_PROTOTYPES
1018 EGLAPI EGLBoolean EGLAPIENTRY eglSetDamageRegionKHR (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects);
1019 #endif
1020 #endif /* EGL_KHR_partial_update */
1021
1022 #ifndef EGL_KHR_platform_android
1023 #define EGL_KHR_platform_android 1
1024 #define EGL_PLATFORM_ANDROID_KHR 0x3141
1025 #endif /* EGL_KHR_platform_android */
1026
1027 #ifndef EGL_KHR_platform_gbm
1028 #define EGL_KHR_platform_gbm 1
1029 #define EGL_PLATFORM_GBM_KHR 0x31D7
1030 #endif /* EGL_KHR_platform_gbm */
1031
1032 #ifndef EGL_KHR_platform_wayland
1033 #define EGL_KHR_platform_wayland 1
1034 #define EGL_PLATFORM_WAYLAND_KHR 0x31D8
1035 #endif /* EGL_KHR_platform_wayland */
1036
1037 #ifndef EGL_KHR_platform_x11
1038 #define EGL_KHR_platform_x11 1
1039 #define EGL_PLATFORM_X11_KHR 0x31D5
1040 #define EGL_PLATFORM_X11_SCREEN_KHR 0x31D6
1041 #endif /* EGL_KHR_platform_x11 */
1042
1043 #ifndef EGL_KHR_reusable_sync
1044 #define EGL_KHR_reusable_sync 1
1045 #ifdef KHRONOS_SUPPORT_INT64
1046 #define EGL_SYNC_STATUS_KHR 0x30F1
1047 #define EGL_SIGNALED_KHR 0x30F2
1048 #define EGL_UNSIGNALED_KHR 0x30F3
1049 #define EGL_TIMEOUT_EXPIRED_KHR 0x30F5
1050 #define EGL_CONDITION_SATISFIED_KHR 0x30F6
1051 #define EGL_SYNC_TYPE_KHR 0x30F7
1052 #define EGL_SYNC_REUSABLE_KHR 0x30FA
1053 #define EGL_SYNC_FLUSH_COMMANDS_BIT_KHR 0x0001
1054 #define EGL_FOREVER_KHR 0xFFFFFFFFFFFFFFFFull
1055 #define EGL_NO_SYNC_KHR ((EGLSyncKHR)0)
1056 typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode);
1057 #ifdef EGL_EGLEXT_PROTOTYPES
1058 EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode);
1059 #endif
1060 #endif /* KHRONOS_SUPPORT_INT64 */
1061 #endif /* EGL_KHR_reusable_sync */
1062
1063 #ifndef EGL_KHR_stream
1064 #define EGL_KHR_stream 1
1065 typedef void *EGLStreamKHR;
1066 typedef khronos_uint64_t EGLuint64KHR;
1067 #ifdef KHRONOS_SUPPORT_INT64
1068 #define EGL_NO_STREAM_KHR ((EGLStreamKHR)0)
1069 #define EGL_CONSUMER_LATENCY_USEC_KHR 0x3210
1070 #define EGL_PRODUCER_FRAME_KHR 0x3212
1071 #define EGL_CONSUMER_FRAME_KHR 0x3213
1072 #define EGL_STREAM_STATE_KHR 0x3214
1073 #define EGL_STREAM_STATE_CREATED_KHR 0x3215
1074 #define EGL_STREAM_STATE_CONNECTING_KHR 0x3216
1075 #define EGL_STREAM_STATE_EMPTY_KHR 0x3217
1076 #define EGL_STREAM_STATE_NEW_FRAME_AVAILABLE_KHR 0x3218
1077 #define EGL_STREAM_STATE_OLD_FRAME_AVAILABLE_KHR 0x3219
1078 #define EGL_STREAM_STATE_DISCONNECTED_KHR 0x321A
1079 #define EGL_BAD_STREAM_KHR 0x321B
1080 #define EGL_BAD_STATE_KHR 0x321C
1081 typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMKHRPROC) (EGLDisplay dpy, const EGLint *attrib_list);
1082 typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSTREAMKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream);
1083 typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMATTRIBKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value);
1084 typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value);
1085 typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMU64KHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value);
1086 #ifdef EGL_EGLEXT_PROTOTYPES
1087 EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamKHR (EGLDisplay dpy, const EGLint *attrib_list);
1088 EGLAPI EGLBoolean EGLAPIENTRY eglDestroyStreamKHR (EGLDisplay dpy, EGLStreamKHR stream);
1089 EGLAPI EGLBoolean EGLAPIENTRY eglStreamAttribKHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value);
1090 EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamKHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value);
1091 EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamu64KHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value);
1092 #endif
1093 #endif /* KHRONOS_SUPPORT_INT64 */
1094 #endif /* EGL_KHR_stream */
1095
1096 #ifndef EGL_KHR_stream_consumer_gltexture
1097 #define EGL_KHR_stream_consumer_gltexture 1
1098 #ifdef EGL_KHR_stream
1099 #define EGL_CONSUMER_ACQUIRE_TIMEOUT_USEC_KHR 0x321E
1100 typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream);
1101 typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERACQUIREKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream);
1102 typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERRELEASEKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream);
1103 #ifdef EGL_EGLEXT_PROTOTYPES
1104 EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerGLTextureExternalKHR (EGLDisplay dpy, EGLStreamKHR stream);
1105 EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerAcquireKHR (EGLDisplay dpy, EGLStreamKHR stream);
1106 EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerReleaseKHR (EGLDisplay dpy, EGLStreamKHR stream);
1107 #endif
1108 #endif /* EGL_KHR_stream */
1109 #endif /* EGL_KHR_stream_consumer_gltexture */
1110
1111 #ifndef EGL_KHR_stream_cross_process_fd
1112 #define EGL_KHR_stream_cross_process_fd 1
1113 typedef int EGLNativeFileDescriptorKHR;
1114 #ifdef EGL_KHR_stream
1115 #define EGL_NO_FILE_DESCRIPTOR_KHR ((EGLNativeFileDescriptorKHR)(-1))
1116 typedef EGLNativeFileDescriptorKHR (EGLAPIENTRYP PFNEGLGETSTREAMFILEDESCRIPTORKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream);
1117 typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMFROMFILEDESCRIPTORKHRPROC) (EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor);
1118 #ifdef EGL_EGLEXT_PROTOTYPES
1119 EGLAPI EGLNativeFileDescriptorKHR EGLAPIENTRY eglGetStreamFileDescriptorKHR (EGLDisplay dpy, EGLStreamKHR stream);
1120 EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamFromFileDescriptorKHR (EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor);
1121 #endif
1122 #endif /* EGL_KHR_stream */
1123 #endif /* EGL_KHR_stream_cross_process_fd */
1124
1125 #ifndef EGL_KHR_stream_fifo
1126 #define EGL_KHR_stream_fifo 1
1127 #ifdef EGL_KHR_stream
1128 #define EGL_STREAM_FIFO_LENGTH_KHR 0x31FC
1129 #define EGL_STREAM_TIME_NOW_KHR 0x31FD
1130 #define EGL_STREAM_TIME_CONSUMER_KHR 0x31FE
1131 #define EGL_STREAM_TIME_PRODUCER_KHR 0x31FF
1132 typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMTIMEKHRPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR *value);
1133 #ifdef EGL_EGLEXT_PROTOTYPES
1134 EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamTimeKHR (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR *value);
1135 #endif
1136 #endif /* EGL_KHR_stream */
1137 #endif /* EGL_KHR_stream_fifo */
1138
1139 #ifndef EGL_KHR_stream_producer_aldatalocator
1140 #define EGL_KHR_stream_producer_aldatalocator 1
1141 #ifdef EGL_KHR_stream
1142 #endif /* EGL_KHR_stream */
1143 #endif /* EGL_KHR_stream_producer_aldatalocator */
1144
1145 #ifndef EGL_KHR_stream_producer_eglsurface
1146 #define EGL_KHR_stream_producer_eglsurface 1
1147 #ifdef EGL_KHR_stream
1148 #define EGL_STREAM_BIT_KHR 0x0800
1149 typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC) (EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint *attrib_list);
1150 #ifdef EGL_EGLEXT_PROTOTYPES
1151 EGLAPI EGLSurface EGLAPIENTRY eglCreateStreamProducerSurfaceKHR (EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint *attrib_list);
1152 #endif
1153 #endif /* EGL_KHR_stream */
1154 #endif /* EGL_KHR_stream_producer_eglsurface */
1155
1156 #ifndef EGL_KHR_surfaceless_context
1157 #define EGL_KHR_surfaceless_context 1
1158 #endif /* EGL_KHR_surfaceless_context */
1159
1160 #ifndef EGL_KHR_swap_buffers_with_damage
1161 #define EGL_KHR_swap_buffers_with_damage 1
1162 typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEKHRPROC) (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects);
1163 #ifdef EGL_EGLEXT_PROTOTYPES
1164 EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageKHR (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects);
1165 #endif
1166 #endif /* EGL_KHR_swap_buffers_with_damage */
1167
1168 #ifndef EGL_KHR_vg_parent_image
1169 #define EGL_KHR_vg_parent_image 1
1170 #define EGL_VG_PARENT_IMAGE_KHR 0x30BA
1171 #endif /* EGL_KHR_vg_parent_image */
1172
1173 #ifndef EGL_KHR_wait_sync
1174 #define EGL_KHR_wait_sync 1
1175 typedef EGLint (EGLAPIENTRYP PFNEGLWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags);
1176 #ifdef EGL_EGLEXT_PROTOTYPES
1177 EGLAPI EGLint EGLAPIENTRY eglWaitSyncKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags);
1178 #endif
1179 #endif /* EGL_KHR_wait_sync */
1180
1181 #ifndef EGL_ANDROID_blob_cache
1182 #define EGL_ANDROID_blob_cache 1
1183 typedef khronos_ssize_t EGLsizeiANDROID;
1184 typedef void (*EGLSetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, const void *value, EGLsizeiANDROID valueSize);
1185 typedef EGLsizeiANDROID (*EGLGetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, void *value, EGLsizeiANDROID valueSize);
1186 typedef void (EGLAPIENTRYP PFNEGLSETBLOBCACHEFUNCSANDROIDPROC) (EGLDisplay dpy, EGLSetBlobFuncANDROID set, EGLGetBlobFuncANDROID get);
1187 #ifdef EGL_EGLEXT_PROTOTYPES
1188 EGLAPI void EGLAPIENTRY eglSetBlobCacheFuncsANDROID (EGLDisplay dpy, EGLSetBlobFuncANDROID set, EGLGetBlobFuncANDROID get);
1189 #endif
1190 #endif /* EGL_ANDROID_blob_cache */
1191
1192 #ifndef EGL_ANDROID_framebuffer_target
1193 #define EGL_ANDROID_framebuffer_target 1
1194 #define EGL_FRAMEBUFFER_TARGET_ANDROID 0x3147
1195 #endif /* EGL_ANDROID_framebuffer_target */
1196
1197 #ifndef EGL_ANDROID_image_native_buffer
1198 #define EGL_ANDROID_image_native_buffer 1
1199 #define EGL_NATIVE_BUFFER_ANDROID 0x3140
1200 #endif /* EGL_ANDROID_image_native_buffer */
1201
1202 #ifndef EGL_ANDROID_native_fence_sync
1203 #define EGL_ANDROID_native_fence_sync 1
1204 #define EGL_SYNC_NATIVE_FENCE_ANDROID 0x3144
1205 #define EGL_SYNC_NATIVE_FENCE_FD_ANDROID 0x3145
1206 #define EGL_SYNC_NATIVE_FENCE_SIGNALED_ANDROID 0x3146
1207 #define EGL_NO_NATIVE_FENCE_FD_ANDROID -1
1208 typedef EGLint (EGLAPIENTRYP PFNEGLDUPNATIVEFENCEFDANDROIDPROC) (EGLDisplay dpy, EGLSyncKHR sync);
1209 #ifdef EGL_EGLEXT_PROTOTYPES
1210 EGLAPI EGLint EGLAPIENTRY eglDupNativeFenceFDANDROID (EGLDisplay dpy, EGLSyncKHR sync);
1211 #endif
1212 #endif /* EGL_ANDROID_native_fence_sync */
1213
1214 #ifndef EGL_ANDROID_recordable
1215 #define EGL_ANDROID_recordable 1
1216 #define EGL_RECORDABLE_ANDROID 0x3142
1217 #endif /* EGL_ANDROID_recordable */
1218
1219 #ifndef EGL_ANGLE_d3d_share_handle_client_buffer
1220 #define EGL_ANGLE_d3d_share_handle_client_buffer 1
1221 #define EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE 0x3200
1222 #endif /* EGL_ANGLE_d3d_share_handle_client_buffer */
1223
1224 #ifndef EGL_ANGLE_device_d3d
1225 #define EGL_ANGLE_device_d3d 1
1226 #define EGL_D3D9_DEVICE_ANGLE 0x33A0
1227 #define EGL_D3D11_DEVICE_ANGLE 0x33A1
1228 #endif /* EGL_ANGLE_device_d3d */
1229
1230 #ifndef EGL_ANGLE_query_surface_pointer
1231 #define EGL_ANGLE_query_surface_pointer 1
1232 typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSURFACEPOINTERANGLEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value);
1233 #ifdef EGL_EGLEXT_PROTOTYPES
1234 EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurfacePointerANGLE (EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value);
1235 #endif
1236 #endif /* EGL_ANGLE_query_surface_pointer */
1237
1238 #ifndef EGL_ANGLE_surface_d3d_texture_2d_share_handle
1239 #define EGL_ANGLE_surface_d3d_texture_2d_share_handle 1
1240 #endif /* EGL_ANGLE_surface_d3d_texture_2d_share_handle */
1241
1242 #ifndef EGL_ANGLE_window_fixed_size
1243 #define EGL_ANGLE_window_fixed_size 1
1244 #define EGL_FIXED_SIZE_ANGLE 0x3201
1245 #endif /* EGL_ANGLE_window_fixed_size */
1246
1247 #ifndef EGL_ARM_pixmap_multisample_discard
1248 #define EGL_ARM_pixmap_multisample_discard 1
1249 #define EGL_DISCARD_SAMPLES_ARM 0x3286
1250 #endif /* EGL_ARM_pixmap_multisample_discard */
1251
1252 #ifndef EGL_EXT_buffer_age
1253 #define EGL_EXT_buffer_age 1
1254 #define EGL_BUFFER_AGE_EXT 0x313D
1255 #endif /* EGL_EXT_buffer_age */
1256
1257 #ifndef EGL_EXT_client_extensions
1258 #define EGL_EXT_client_extensions 1
1259 #endif /* EGL_EXT_client_extensions */
1260
1261 #ifndef EGL_EXT_create_context_robustness
1262 #define EGL_EXT_create_context_robustness 1
1263 #define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT 0x30BF
1264 #define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT 0x3138
1265 #define EGL_NO_RESET_NOTIFICATION_EXT 0x31BE
1266 #define EGL_LOSE_CONTEXT_ON_RESET_EXT 0x31BF
1267 #endif /* EGL_EXT_create_context_robustness */
1268
1269 #ifndef EGL_EXT_device_base
1270 #define EGL_EXT_device_base 1
1271 typedef void *EGLDeviceEXT;
1272 #define EGL_NO_DEVICE_EXT ((EGLDeviceEXT)(0))
1273 #define EGL_BAD_DEVICE_EXT 0x322B
1274 #define EGL_DEVICE_EXT 0x322C
1275 typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDEVICEATTRIBEXTPROC) (EGLDeviceEXT device, EGLint attribute, EGLAttrib *value);
1276 typedef const char *(EGLAPIENTRYP PFNEGLQUERYDEVICESTRINGEXTPROC) (EGLDeviceEXT device, EGLint name);
1277 typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDEVICESEXTPROC) (EGLint max_devices, EGLDeviceEXT *devices, EGLint *num_devices);
1278 typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDISPLAYATTRIBEXTPROC) (EGLDisplay dpy, EGLint attribute, EGLAttrib *value);
1279 #ifdef EGL_EGLEXT_PROTOTYPES
1280 EGLAPI EGLBoolean EGLAPIENTRY eglQueryDeviceAttribEXT (EGLDeviceEXT device, EGLint attribute, EGLAttrib *value);
1281 EGLAPI const char *EGLAPIENTRY eglQueryDeviceStringEXT (EGLDeviceEXT device, EGLint name);
1282 EGLAPI EGLBoolean EGLAPIENTRY eglQueryDevicesEXT (EGLint max_devices, EGLDeviceEXT *devices, EGLint *num_devices);
1283 EGLAPI EGLBoolean EGLAPIENTRY eglQueryDisplayAttribEXT (EGLDisplay dpy, EGLint attribute, EGLAttrib *value);
1284 #endif
1285 #endif /* EGL_EXT_device_base */
1286
1287 #ifndef EGL_EXT_device_drm
1288 #define EGL_EXT_device_drm 1
1289 #define EGL_DRM_DEVICE_FILE_EXT 0x3233
1290 #endif /* EGL_EXT_device_drm */
1291
1292 #ifndef EGL_EXT_device_enumeration
1293 #define EGL_EXT_device_enumeration 1
1294 #endif /* EGL_EXT_device_enumeration */
1295
1296 #ifndef EGL_EXT_device_openwf
1297 #define EGL_EXT_device_openwf 1
1298 #define EGL_OPENWF_DEVICE_ID_EXT 0x3237
1299 #endif /* EGL_EXT_device_openwf */
1300
1301 #ifndef EGL_EXT_device_query
1302 #define EGL_EXT_device_query 1
1303 #endif /* EGL_EXT_device_query */
1304
1305 #ifndef EGL_EXT_image_dma_buf_import
1306 #define EGL_EXT_image_dma_buf_import 1
1307 #define EGL_LINUX_DMA_BUF_EXT 0x3270
1308 #define EGL_LINUX_DRM_FOURCC_EXT 0x3271
1309 #define EGL_DMA_BUF_PLANE0_FD_EXT 0x3272
1310 #define EGL_DMA_BUF_PLANE0_OFFSET_EXT 0x3273
1311 #define EGL_DMA_BUF_PLANE0_PITCH_EXT 0x3274
1312 #define EGL_DMA_BUF_PLANE1_FD_EXT 0x3275
1313 #define EGL_DMA_BUF_PLANE1_OFFSET_EXT 0x3276
1314 #define EGL_DMA_BUF_PLANE1_PITCH_EXT 0x3277
1315 #define EGL_DMA_BUF_PLANE2_FD_EXT 0x3278
1316 #define EGL_DMA_BUF_PLANE2_OFFSET_EXT 0x3279
1317 #define EGL_DMA_BUF_PLANE2_PITCH_EXT 0x327A
1318 #define EGL_YUV_COLOR_SPACE_HINT_EXT 0x327B
1319 #define EGL_SAMPLE_RANGE_HINT_EXT 0x327C
1320 #define EGL_YUV_CHROMA_HORIZONTAL_SITING_HINT_EXT 0x327D
1321 #define EGL_YUV_CHROMA_VERTICAL_SITING_HINT_EXT 0x327E
1322 #define EGL_ITU_REC601_EXT 0x327F
1323 #define EGL_ITU_REC709_EXT 0x3280
1324 #define EGL_ITU_REC2020_EXT 0x3281
1325 #define EGL_YUV_FULL_RANGE_EXT 0x3282
1326 #define EGL_YUV_NARROW_RANGE_EXT 0x3283
1327 #define EGL_YUV_CHROMA_SITING_0_EXT 0x3284
1328 #define EGL_YUV_CHROMA_SITING_0_5_EXT 0x3285
1329 #endif /* EGL_EXT_image_dma_buf_import */
1330
1331 #ifndef EGL_EXT_multiview_window
1332 #define EGL_EXT_multiview_window 1
1333 #define EGL_MULTIVIEW_VIEW_COUNT_EXT 0x3134
1334 #endif /* EGL_EXT_multiview_window */
1335
1336 #ifndef EGL_EXT_output_base
1337 #define EGL_EXT_output_base 1
1338 typedef void *EGLOutputLayerEXT;
1339 typedef void *EGLOutputPortEXT;
1340 #define EGL_NO_OUTPUT_LAYER_EXT ((EGLOutputLayerEXT)0)
1341 #define EGL_NO_OUTPUT_PORT_EXT ((EGLOutputPortEXT)0)
1342 #define EGL_BAD_OUTPUT_LAYER_EXT 0x322D
1343 #define EGL_BAD_OUTPUT_PORT_EXT 0x322E
1344 #define EGL_SWAP_INTERVAL_EXT 0x322F
1345 typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETOUTPUTLAYERSEXTPROC) (EGLDisplay dpy, const EGLAttrib *attrib_list, EGLOutputLayerEXT *layers, EGLint max_layers, EGLint *num_layers);
1346 typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETOUTPUTPORTSEXTPROC) (EGLDisplay dpy, const EGLAttrib *attrib_list, EGLOutputPortEXT *ports, EGLint max_ports, EGLint *num_ports);
1347 typedef EGLBoolean (EGLAPIENTRYP PFNEGLOUTPUTLAYERATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib value);
1348 typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYOUTPUTLAYERATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib *value);
1349 typedef const char *(EGLAPIENTRYP PFNEGLQUERYOUTPUTLAYERSTRINGEXTPROC) (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint name);
1350 typedef EGLBoolean (EGLAPIENTRYP PFNEGLOUTPUTPORTATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib value);
1351 typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYOUTPUTPORTATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib *value);
1352 typedef const char *(EGLAPIENTRYP PFNEGLQUERYOUTPUTPORTSTRINGEXTPROC) (EGLDisplay dpy, EGLOutputPortEXT port, EGLint name);
1353 #ifdef EGL_EGLEXT_PROTOTYPES
1354 EGLAPI EGLBoolean EGLAPIENTRY eglGetOutputLayersEXT (EGLDisplay dpy, const EGLAttrib *attrib_list, EGLOutputLayerEXT *layers, EGLint max_layers, EGLint *num_layers);
1355 EGLAPI EGLBoolean EGLAPIENTRY eglGetOutputPortsEXT (EGLDisplay dpy, const EGLAttrib *attrib_list, EGLOutputPortEXT *ports, EGLint max_ports, EGLint *num_ports);
1356 EGLAPI EGLBoolean EGLAPIENTRY eglOutputLayerAttribEXT (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib value);
1357 EGLAPI EGLBoolean EGLAPIENTRY eglQueryOutputLayerAttribEXT (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib *value);
1358 EGLAPI const char *EGLAPIENTRY eglQueryOutputLayerStringEXT (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint name);
1359 EGLAPI EGLBoolean EGLAPIENTRY eglOutputPortAttribEXT (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib value);
1360 EGLAPI EGLBoolean EGLAPIENTRY eglQueryOutputPortAttribEXT (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib *value);
1361 EGLAPI const char *EGLAPIENTRY eglQueryOutputPortStringEXT (EGLDisplay dpy, EGLOutputPortEXT port, EGLint name);
1362 #endif
1363 #endif /* EGL_EXT_output_base */
1364
1365 #ifndef EGL_EXT_output_drm
1366 #define EGL_EXT_output_drm 1
1367 #define EGL_DRM_CRTC_EXT 0x3234
1368 #define EGL_DRM_PLANE_EXT 0x3235
1369 #define EGL_DRM_CONNECTOR_EXT 0x3236
1370 #endif /* EGL_EXT_output_drm */
1371
1372 #ifndef EGL_EXT_output_openwf
1373 #define EGL_EXT_output_openwf 1
1374 #define EGL_OPENWF_PIPELINE_ID_EXT 0x3238
1375 #define EGL_OPENWF_PORT_ID_EXT 0x3239
1376 #endif /* EGL_EXT_output_openwf */
1377
1378 #ifndef EGL_EXT_platform_base
1379 #define EGL_EXT_platform_base 1
1380 typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETPLATFORMDISPLAYEXTPROC) (EGLenum platform, void *native_display, const EGLint *attrib_list);
1381 typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC) (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLint *attrib_list);
1382 typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMPIXMAPSURFACEEXTPROC) (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLint *attrib_list);
1383 #ifdef EGL_EGLEXT_PROTOTYPES
1384 EGLAPI EGLDisplay EGLAPIENTRY eglGetPlatformDisplayEXT (EGLenum platform, void *native_display, const EGLint *attrib_list);
1385 EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformWindowSurfaceEXT (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLint *attrib_list);
1386 EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurfaceEXT (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLint *attrib_list);
1387 #endif
1388 #endif /* EGL_EXT_platform_base */
1389
1390 #ifndef EGL_EXT_platform_device
1391 #define EGL_EXT_platform_device 1
1392 #define EGL_PLATFORM_DEVICE_EXT 0x313F
1393 #endif /* EGL_EXT_platform_device */
1394
1395 #ifndef EGL_EXT_platform_wayland
1396 #define EGL_EXT_platform_wayland 1
1397 #define EGL_PLATFORM_WAYLAND_EXT 0x31D8
1398 #endif /* EGL_EXT_platform_wayland */
1399
1400 #ifndef EGL_EXT_platform_x11
1401 #define EGL_EXT_platform_x11 1
1402 #define EGL_PLATFORM_X11_EXT 0x31D5
1403 #define EGL_PLATFORM_X11_SCREEN_EXT 0x31D6
1404 #endif /* EGL_EXT_platform_x11 */
1405
1406 #ifndef EGL_EXT_protected_surface
1407 #define EGL_EXT_protected_surface 1
1408 #define EGL_PROTECTED_CONTENT_EXT 0x32C0
1409 #endif /* EGL_EXT_protected_surface */
1410
1411 #ifndef EGL_EXT_stream_consumer_egloutput
1412 #define EGL_EXT_stream_consumer_egloutput 1
1413 typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMEROUTPUTEXTPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLOutputLayerEXT layer);
1414 #ifdef EGL_EGLEXT_PROTOTYPES
1415 EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerOutputEXT (EGLDisplay dpy, EGLStreamKHR stream, EGLOutputLayerEXT layer);
1416 #endif
1417 #endif /* EGL_EXT_stream_consumer_egloutput */
1418
1419 #ifndef EGL_EXT_swap_buffers_with_damage
1420 #define EGL_EXT_swap_buffers_with_damage 1
1421 typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC) (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects);
1422 #ifdef EGL_EGLEXT_PROTOTYPES
1423 EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageEXT (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects);
1424 #endif
1425 #endif /* EGL_EXT_swap_buffers_with_damage */
1426
1427 #ifndef EGL_EXT_yuv_surface
1428 #define EGL_EXT_yuv_surface 1
1429 #define EGL_YUV_ORDER_EXT 0x3301
1430 #define EGL_YUV_NUMBER_OF_PLANES_EXT 0x3311
1431 #define EGL_YUV_SUBSAMPLE_EXT 0x3312
1432 #define EGL_YUV_DEPTH_RANGE_EXT 0x3317
1433 #define EGL_YUV_CSC_STANDARD_EXT 0x330A
1434 #define EGL_YUV_PLANE_BPP_EXT 0x331A
1435 #define EGL_YUV_BUFFER_EXT 0x3300
1436 #define EGL_YUV_ORDER_YUV_EXT 0x3302
1437 #define EGL_YUV_ORDER_YVU_EXT 0x3303
1438 #define EGL_YUV_ORDER_YUYV_EXT 0x3304
1439 #define EGL_YUV_ORDER_UYVY_EXT 0x3305
1440 #define EGL_YUV_ORDER_YVYU_EXT 0x3306
1441 #define EGL_YUV_ORDER_VYUY_EXT 0x3307
1442 #define EGL_YUV_ORDER_AYUV_EXT 0x3308
1443 #define EGL_YUV_SUBSAMPLE_4_2_0_EXT 0x3313
1444 #define EGL_YUV_SUBSAMPLE_4_2_2_EXT 0x3314
1445 #define EGL_YUV_SUBSAMPLE_4_4_4_EXT 0x3315
1446 #define EGL_YUV_DEPTH_RANGE_LIMITED_EXT 0x3318
1447 #define EGL_YUV_DEPTH_RANGE_FULL_EXT 0x3319
1448 #define EGL_YUV_CSC_STANDARD_601_EXT 0x330B
1449 #define EGL_YUV_CSC_STANDARD_709_EXT 0x330C
1450 #define EGL_YUV_CSC_STANDARD_2020_EXT 0x330D
1451 #define EGL_YUV_PLANE_BPP_0_EXT 0x331B
1452 #define EGL_YUV_PLANE_BPP_8_EXT 0x331C
1453 #define EGL_YUV_PLANE_BPP_10_EXT 0x331D
1454 #endif /* EGL_EXT_yuv_surface */
1455
1456 #ifndef EGL_HI_clientpixmap
1457 #define EGL_HI_clientpixmap 1
1458 struct EGLClientPixmapHI {
1459 void *pData;
1460 EGLint iWidth;
1461 EGLint iHeight;
1462 EGLint iStride;
1463 };
1464 #define EGL_CLIENT_PIXMAP_POINTER_HI 0x8F74
1465 typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPIXMAPSURFACEHIPROC) (EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI *pixmap);
1466 #ifdef EGL_EGLEXT_PROTOTYPES
1467 EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurfaceHI (EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI *pixmap);
1468 #endif
1469 #endif /* EGL_HI_clientpixmap */
1470
1471 #ifndef EGL_HI_colorformats
1472 #define EGL_HI_colorformats 1
1473 #define EGL_COLOR_FORMAT_HI 0x8F70
1474 #define EGL_COLOR_RGB_HI 0x8F71
1475 #define EGL_COLOR_RGBA_HI 0x8F72
1476 #define EGL_COLOR_ARGB_HI 0x8F73
1477 #endif /* EGL_HI_colorformats */
1478
1479 #ifndef EGL_IMG_context_priority
1480 #define EGL_IMG_context_priority 1
1481 #define EGL_CONTEXT_PRIORITY_LEVEL_IMG 0x3100
1482 #define EGL_CONTEXT_PRIORITY_HIGH_IMG 0x3101
1483 #define EGL_CONTEXT_PRIORITY_MEDIUM_IMG 0x3102
1484 #define EGL_CONTEXT_PRIORITY_LOW_IMG 0x3103
1485 #endif /* EGL_IMG_context_priority */
1486
1487 #ifndef EGL_MESA_drm_image
1488 #define EGL_MESA_drm_image 1
1489 #define EGL_DRM_BUFFER_FORMAT_MESA 0x31D0
1490 #define EGL_DRM_BUFFER_USE_MESA 0x31D1
1491 #define EGL_DRM_BUFFER_FORMAT_ARGB32_MESA 0x31D2
1492 #define EGL_DRM_BUFFER_MESA 0x31D3
1493 #define EGL_DRM_BUFFER_STRIDE_MESA 0x31D4
1494 #define EGL_DRM_BUFFER_USE_SCANOUT_MESA 0x00000001
1495 #define EGL_DRM_BUFFER_USE_SHARE_MESA 0x00000002
1496 typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEDRMIMAGEMESAPROC) (EGLDisplay dpy, const EGLint *attrib_list);
1497 typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDRMIMAGEMESAPROC) (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride);
1498 #ifdef EGL_EGLEXT_PROTOTYPES
1499 EGLAPI EGLImageKHR EGLAPIENTRY eglCreateDRMImageMESA (EGLDisplay dpy, const EGLint *attrib_list);
1500 EGLAPI EGLBoolean EGLAPIENTRY eglExportDRMImageMESA (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride);
1501 #endif
1502 #endif /* EGL_MESA_drm_image */
1503
1504 #ifndef EGL_MESA_image_dma_buf_export
1505 #define EGL_MESA_image_dma_buf_export 1
1506 typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDMABUFIMAGEQUERYMESAPROC) (EGLDisplay dpy, EGLImageKHR image, int *fourcc, int *num_planes, EGLuint64KHR *modifiers);
1507 typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDMABUFIMAGEMESAPROC) (EGLDisplay dpy, EGLImageKHR image, int *fds, EGLint *strides, EGLint *offsets);
1508 #ifdef EGL_EGLEXT_PROTOTYPES
1509 EGLAPI EGLBoolean EGLAPIENTRY eglExportDMABUFImageQueryMESA (EGLDisplay dpy, EGLImageKHR image, int *fourcc, int *num_planes, EGLuint64KHR *modifiers);
1510 EGLAPI EGLBoolean EGLAPIENTRY eglExportDMABUFImageMESA (EGLDisplay dpy, EGLImageKHR image, int *fds, EGLint *strides, EGLint *offsets);
1511 #endif
1512 #endif /* EGL_MESA_image_dma_buf_export */
1513
1514 #ifndef EGL_MESA_platform_gbm
1515 #define EGL_MESA_platform_gbm 1
1516 #define EGL_PLATFORM_GBM_MESA 0x31D7
1517 #endif /* EGL_MESA_platform_gbm */
1518
1519 #ifndef EGL_NOK_swap_region
1520 #define EGL_NOK_swap_region 1
1521 typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSREGIONNOKPROC) (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint *rects);
1522 #ifdef EGL_EGLEXT_PROTOTYPES
1523 EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersRegionNOK (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint *rects);
1524 #endif
1525 #endif /* EGL_NOK_swap_region */
1526
1527 #ifndef EGL_NOK_swap_region2
1528 #define EGL_NOK_swap_region2 1
1529 typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSREGION2NOKPROC) (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint *rects);
1530 #ifdef EGL_EGLEXT_PROTOTYPES
1531 EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersRegion2NOK (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint *rects);
1532 #endif
1533 #endif /* EGL_NOK_swap_region2 */
1534
1535 #ifndef EGL_NOK_texture_from_pixmap
1536 #define EGL_NOK_texture_from_pixmap 1
1537 #define EGL_Y_INVERTED_NOK 0x307F
1538 #endif /* EGL_NOK_texture_from_pixmap */
1539
1540 #ifndef EGL_NV_3dvision_surface
1541 #define EGL_NV_3dvision_surface 1
1542 #define EGL_AUTO_STEREO_NV 0x3136
1543 #endif /* EGL_NV_3dvision_surface */
1544
1545 #ifndef EGL_NV_coverage_sample
1546 #define EGL_NV_coverage_sample 1
1547 #define EGL_COVERAGE_BUFFERS_NV 0x30E0
1548 #define EGL_COVERAGE_SAMPLES_NV 0x30E1
1549 #endif /* EGL_NV_coverage_sample */
1550
1551 #ifndef EGL_NV_coverage_sample_resolve
1552 #define EGL_NV_coverage_sample_resolve 1
1553 #define EGL_COVERAGE_SAMPLE_RESOLVE_NV 0x3131
1554 #define EGL_COVERAGE_SAMPLE_RESOLVE_DEFAULT_NV 0x3132
1555 #define EGL_COVERAGE_SAMPLE_RESOLVE_NONE_NV 0x3133
1556 #endif /* EGL_NV_coverage_sample_resolve */
1557
1558 #ifndef EGL_NV_cuda_event
1559 #define EGL_NV_cuda_event 1
1560 #define EGL_CUDA_EVENT_HANDLE_NV 0x323B
1561 #define EGL_SYNC_CUDA_EVENT_NV 0x323C
1562 #define EGL_SYNC_CUDA_EVENT_COMPLETE_NV 0x323D
1563 #endif /* EGL_NV_cuda_event */
1564
1565 #ifndef EGL_NV_depth_nonlinear
1566 #define EGL_NV_depth_nonlinear 1
1567 #define EGL_DEPTH_ENCODING_NV 0x30E2
1568 #define EGL_DEPTH_ENCODING_NONE_NV 0
1569 #define EGL_DEPTH_ENCODING_NONLINEAR_NV 0x30E3
1570 #endif /* EGL_NV_depth_nonlinear */
1571
1572 #ifndef EGL_NV_device_cuda
1573 #define EGL_NV_device_cuda 1
1574 #define EGL_CUDA_DEVICE_NV 0x323A
1575 #endif /* EGL_NV_device_cuda */
1576
1577 #ifndef EGL_NV_native_query
1578 #define EGL_NV_native_query 1
1579 typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEDISPLAYNVPROC) (EGLDisplay dpy, EGLNativeDisplayType *display_id);
1580 typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEWINDOWNVPROC) (EGLDisplay dpy, EGLSurface surf, EGLNativeWindowType *window);
1581 typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEPIXMAPNVPROC) (EGLDisplay dpy, EGLSurface surf, EGLNativePixmapType *pixmap);
1582 #ifdef EGL_EGLEXT_PROTOTYPES
1583 EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativeDisplayNV (EGLDisplay dpy, EGLNativeDisplayType *display_id);
1584 EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativeWindowNV (EGLDisplay dpy, EGLSurface surf, EGLNativeWindowType *window);
1585 EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativePixmapNV (EGLDisplay dpy, EGLSurface surf, EGLNativePixmapType *pixmap);
1586 #endif
1587 #endif /* EGL_NV_native_query */
1588
1589 #ifndef EGL_NV_post_convert_rounding
1590 #define EGL_NV_post_convert_rounding 1
1591 #endif /* EGL_NV_post_convert_rounding */
1592
1593 #ifndef EGL_NV_post_sub_buffer
1594 #define EGL_NV_post_sub_buffer 1
1595 #define EGL_POST_SUB_BUFFER_SUPPORTED_NV 0x30BE
1596 typedef EGLBoolean (EGLAPIENTRYP PFNEGLPOSTSUBBUFFERNVPROC) (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height);
1597 #ifdef EGL_EGLEXT_PROTOTYPES
1598 EGLAPI EGLBoolean EGLAPIENTRY eglPostSubBufferNV (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height);
1599 #endif
1600 #endif /* EGL_NV_post_sub_buffer */
1601
1602 #ifndef EGL_NV_stream_sync
1603 #define EGL_NV_stream_sync 1
1604 #define EGL_SYNC_NEW_FRAME_NV 0x321F
1605 typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESTREAMSYNCNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum type, const EGLint *attrib_list);
1606 #ifdef EGL_EGLEXT_PROTOTYPES
1607 EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateStreamSyncNV (EGLDisplay dpy, EGLStreamKHR stream, EGLenum type, const EGLint *attrib_list);
1608 #endif
1609 #endif /* EGL_NV_stream_sync */
1610
1611 #ifndef EGL_NV_sync
1612 #define EGL_NV_sync 1
1613 typedef void *EGLSyncNV;
1614 typedef khronos_utime_nanoseconds_t EGLTimeNV;
1615 #ifdef KHRONOS_SUPPORT_INT64
1616 #define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_NV 0x30E6
1617 #define EGL_SYNC_STATUS_NV 0x30E7
1618 #define EGL_SIGNALED_NV 0x30E8
1619 #define EGL_UNSIGNALED_NV 0x30E9
1620 #define EGL_SYNC_FLUSH_COMMANDS_BIT_NV 0x0001
1621 #define EGL_FOREVER_NV 0xFFFFFFFFFFFFFFFFull
1622 #define EGL_ALREADY_SIGNALED_NV 0x30EA
1623 #define EGL_TIMEOUT_EXPIRED_NV 0x30EB
1624 #define EGL_CONDITION_SATISFIED_NV 0x30EC
1625 #define EGL_SYNC_TYPE_NV 0x30ED
1626 #define EGL_SYNC_CONDITION_NV 0x30EE
1627 #define EGL_SYNC_FENCE_NV 0x30EF
1628 #define EGL_NO_SYNC_NV ((EGLSyncNV)0)
1629 typedef EGLSyncNV (EGLAPIENTRYP PFNEGLCREATEFENCESYNCNVPROC) (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list);
1630 typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCNVPROC) (EGLSyncNV sync);
1631 typedef EGLBoolean (EGLAPIENTRYP PFNEGLFENCENVPROC) (EGLSyncNV sync);
1632 typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCNVPROC) (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout);
1633 typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCNVPROC) (EGLSyncNV sync, EGLenum mode);
1634 typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBNVPROC) (EGLSyncNV sync, EGLint attribute, EGLint *value);
1635 #ifdef EGL_EGLEXT_PROTOTYPES
1636 EGLAPI EGLSyncNV EGLAPIENTRY eglCreateFenceSyncNV (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list);
1637 EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncNV (EGLSyncNV sync);
1638 EGLAPI EGLBoolean EGLAPIENTRY eglFenceNV (EGLSyncNV sync);
1639 EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncNV (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout);
1640 EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncNV (EGLSyncNV sync, EGLenum mode);
1641 EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribNV (EGLSyncNV sync, EGLint attribute, EGLint *value);
1642 #endif
1643 #endif /* KHRONOS_SUPPORT_INT64 */
1644 #endif /* EGL_NV_sync */
1645
1646 #ifndef EGL_NV_system_time
1647 #define EGL_NV_system_time 1
1648 typedef khronos_utime_nanoseconds_t EGLuint64NV;
1649 #ifdef KHRONOS_SUPPORT_INT64
1650 typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC) (void);
1651 typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMENVPROC) (void);
1652 #ifdef EGL_EGLEXT_PROTOTYPES
1653 EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeFrequencyNV (void);
1654 EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeNV (void);
1655 #endif
1656 #endif /* KHRONOS_SUPPORT_INT64 */
1657 #endif /* EGL_NV_system_time */
1658
1659 #ifndef EGL_TIZEN_image_native_buffer
1660 #define EGL_TIZEN_image_native_buffer 1
1661 #define EGL_NATIVE_BUFFER_TIZEN 0x32A0
1662 #endif /* EGL_TIZEN_image_native_buffer */
1663
1664 #ifndef EGL_TIZEN_image_native_surface
1665 #define EGL_TIZEN_image_native_surface 1
1666 #define EGL_NATIVE_SURFACE_TIZEN 0x32A1
1667 #endif /* EGL_TIZEN_image_native_surface */
1668
1669 #ifdef __cplusplus
1670 }
1671 #endif
1672
1673 #endif /* __eglext_h_ */
1674
1675
1676 #endif /* _MSC_VER */
File include/SDL2/SDL_endian.h added (mode: 100644) (index 0000000..171c008)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_endian.h
24 *
25 * Functions for reading and writing endian-specific values
26 */
27
28 #ifndef SDL_endian_h_
29 #define SDL_endian_h_
30
31 #include "SDL_stdinc.h"
32
33 /**
34 * \name The two types of endianness
35 */
36 /* @{ */
37 #define SDL_LIL_ENDIAN 1234
38 #define SDL_BIG_ENDIAN 4321
39 /* @} */
40
41 #ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */
42 #ifdef __linux__
43 #include <endian.h>
44 #define SDL_BYTEORDER __BYTE_ORDER
45 #elif defined(__OpenBSD__)
46 #include <endian.h>
47 #define SDL_BYTEORDER BYTE_ORDER
48 #else
49 #if defined(__hppa__) || \
50 defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \
51 (defined(__MIPS__) && defined(__MIPSEB__)) || \
52 defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \
53 defined(__sparc__)
54 #define SDL_BYTEORDER SDL_BIG_ENDIAN
55 #else
56 #define SDL_BYTEORDER SDL_LIL_ENDIAN
57 #endif
58 #endif /* __linux__ */
59 #endif /* !SDL_BYTEORDER */
60
61
62 #include "begin_code.h"
63 /* Set up for C function definitions, even when using C++ */
64 #ifdef __cplusplus
65 extern "C" {
66 #endif
67
68 /**
69 * \file SDL_endian.h
70 */
71 #if defined(__GNUC__) && defined(__i386__) && \
72 !(__GNUC__ == 2 && __GNUC_MINOR__ == 95 /* broken gcc version */)
73 SDL_FORCE_INLINE Uint16
74 SDL_Swap16(Uint16 x)
75 {
76 __asm__("xchgb %b0,%h0": "=q"(x):"0"(x));
77 return x;
78 }
79 #elif defined(__GNUC__) && defined(__x86_64__)
80 SDL_FORCE_INLINE Uint16
81 SDL_Swap16(Uint16 x)
82 {
83 __asm__("xchgb %b0,%h0": "=Q"(x):"0"(x));
84 return x;
85 }
86 #elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
87 SDL_FORCE_INLINE Uint16
88 SDL_Swap16(Uint16 x)
89 {
90 int result;
91
92 __asm__("rlwimi %0,%2,8,16,23": "=&r"(result):"0"(x >> 8), "r"(x));
93 return (Uint16)result;
94 }
95 #elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) && !defined(__mcoldfire__)
96 SDL_FORCE_INLINE Uint16
97 SDL_Swap16(Uint16 x)
98 {
99 __asm__("rorw #8,%0": "=d"(x): "0"(x):"cc");
100 return x;
101 }
102 #elif defined(__WATCOMC__) && defined(__386__)
103 extern _inline Uint16 SDL_Swap16(Uint16);
104 #pragma aux SDL_Swap16 = \
105 "xchg al, ah" \
106 parm [ax] \
107 modify [ax];
108 #else
109 SDL_FORCE_INLINE Uint16
110 SDL_Swap16(Uint16 x)
111 {
112 return SDL_static_cast(Uint16, ((x << 8) | (x >> 8)));
113 }
114 #endif
115
116 #if defined(__GNUC__) && defined(__i386__)
117 SDL_FORCE_INLINE Uint32
118 SDL_Swap32(Uint32 x)
119 {
120 __asm__("bswap %0": "=r"(x):"0"(x));
121 return x;
122 }
123 #elif defined(__GNUC__) && defined(__x86_64__)
124 SDL_FORCE_INLINE Uint32
125 SDL_Swap32(Uint32 x)
126 {
127 __asm__("bswapl %0": "=r"(x):"0"(x));
128 return x;
129 }
130 #elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
131 SDL_FORCE_INLINE Uint32
132 SDL_Swap32(Uint32 x)
133 {
134 Uint32 result;
135
136 __asm__("rlwimi %0,%2,24,16,23": "=&r"(result):"0"(x >> 24), "r"(x));
137 __asm__("rlwimi %0,%2,8,8,15": "=&r"(result):"0"(result), "r"(x));
138 __asm__("rlwimi %0,%2,24,0,7": "=&r"(result):"0"(result), "r"(x));
139 return result;
140 }
141 #elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) && !defined(__mcoldfire__)
142 SDL_FORCE_INLINE Uint32
143 SDL_Swap32(Uint32 x)
144 {
145 __asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0": "=d"(x): "0"(x):"cc");
146 return x;
147 }
148 #elif defined(__WATCOMC__) && defined(__386__)
149 extern _inline Uint32 SDL_Swap32(Uint32);
150 #ifndef __SW_3 /* 486+ */
151 #pragma aux SDL_Swap32 = \
152 "bswap eax" \
153 parm [eax] \
154 modify [eax];
155 #else /* 386-only */
156 #pragma aux SDL_Swap32 = \
157 "xchg al, ah" \
158 "ror eax, 16" \
159 "xchg al, ah" \
160 parm [eax] \
161 modify [eax];
162 #endif
163 #else
164 SDL_FORCE_INLINE Uint32
165 SDL_Swap32(Uint32 x)
166 {
167 return SDL_static_cast(Uint32, ((x << 24) | ((x << 8) & 0x00FF0000) |
168 ((x >> 8) & 0x0000FF00) | (x >> 24)));
169 }
170 #endif
171
172 #if defined(__GNUC__) && defined(__i386__)
173 SDL_FORCE_INLINE Uint64
174 SDL_Swap64(Uint64 x)
175 {
176 union
177 {
178 struct
179 {
180 Uint32 a, b;
181 } s;
182 Uint64 u;
183 } v;
184 v.u = x;
185 __asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1": "=r"(v.s.a), "=r"(v.s.b):"0"(v.s.a),
186 "1"(v.s.
187 b));
188 return v.u;
189 }
190 #elif defined(__GNUC__) && defined(__x86_64__)
191 SDL_FORCE_INLINE Uint64
192 SDL_Swap64(Uint64 x)
193 {
194 __asm__("bswapq %0": "=r"(x):"0"(x));
195 return x;
196 }
197 #else
198 SDL_FORCE_INLINE Uint64
199 SDL_Swap64(Uint64 x)
200 {
201 Uint32 hi, lo;
202
203 /* Separate into high and low 32-bit values and swap them */
204 lo = SDL_static_cast(Uint32, x & 0xFFFFFFFF);
205 x >>= 32;
206 hi = SDL_static_cast(Uint32, x & 0xFFFFFFFF);
207 x = SDL_Swap32(lo);
208 x <<= 32;
209 x |= SDL_Swap32(hi);
210 return (x);
211 }
212 #endif
213
214
215 SDL_FORCE_INLINE float
216 SDL_SwapFloat(float x)
217 {
218 union
219 {
220 float f;
221 Uint32 ui32;
222 } swapper;
223 swapper.f = x;
224 swapper.ui32 = SDL_Swap32(swapper.ui32);
225 return swapper.f;
226 }
227
228
229 /**
230 * \name Swap to native
231 * Byteswap item from the specified endianness to the native endianness.
232 */
233 /* @{ */
234 #if SDL_BYTEORDER == SDL_LIL_ENDIAN
235 #define SDL_SwapLE16(X) (X)
236 #define SDL_SwapLE32(X) (X)
237 #define SDL_SwapLE64(X) (X)
238 #define SDL_SwapFloatLE(X) (X)
239 #define SDL_SwapBE16(X) SDL_Swap16(X)
240 #define SDL_SwapBE32(X) SDL_Swap32(X)
241 #define SDL_SwapBE64(X) SDL_Swap64(X)
242 #define SDL_SwapFloatBE(X) SDL_SwapFloat(X)
243 #else
244 #define SDL_SwapLE16(X) SDL_Swap16(X)
245 #define SDL_SwapLE32(X) SDL_Swap32(X)
246 #define SDL_SwapLE64(X) SDL_Swap64(X)
247 #define SDL_SwapFloatLE(X) SDL_SwapFloat(X)
248 #define SDL_SwapBE16(X) (X)
249 #define SDL_SwapBE32(X) (X)
250 #define SDL_SwapBE64(X) (X)
251 #define SDL_SwapFloatBE(X) (X)
252 #endif
253 /* @} *//* Swap to native */
254
255 /* Ends C function definitions when using C++ */
256 #ifdef __cplusplus
257 }
258 #endif
259 #include "close_code.h"
260
261 #endif /* SDL_endian_h_ */
262
263 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_error.h added (mode: 100644) (index 0000000..962d62f)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_error.h
24 *
25 * Simple error message routines for SDL.
26 */
27
28 #ifndef SDL_error_h_
29 #define SDL_error_h_
30
31 #include "SDL_stdinc.h"
32
33 #include "begin_code.h"
34 /* Set up for C function definitions, even when using C++ */
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38
39 /* Public functions */
40
41
42 /**
43 * \brief Set the error message for the current thread
44 *
45 * \return -1, there is no error handling for this function
46 */
47 extern DECLSPEC int SDLCALL SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1);
48
49 /**
50 * \brief Get the last error message that was set
51 *
52 * SDL API functions may set error messages and then succeed, so you should
53 * only use the error value if a function fails.
54 *
55 * This returns a pointer to a static buffer for convenience and should not
56 * be called by multiple threads simultaneously.
57 *
58 * \return a pointer to the last error message that was set
59 */
60 extern DECLSPEC const char *SDLCALL SDL_GetError(void);
61
62 /**
63 * \brief Get the last error message that was set for the current thread
64 *
65 * SDL API functions may set error messages and then succeed, so you should
66 * only use the error value if a function fails.
67 *
68 * \param errstr A buffer to fill with the last error message that was set
69 * for the current thread
70 * \param maxlen The size of the buffer pointed to by the errstr parameter
71 *
72 * \return errstr
73 */
74 extern DECLSPEC char * SDLCALL SDL_GetErrorMsg(char *errstr, int maxlen);
75
76 /**
77 * \brief Clear the error message for the current thread
78 */
79 extern DECLSPEC void SDLCALL SDL_ClearError(void);
80
81 /**
82 * \name Internal error functions
83 *
84 * \internal
85 * Private error reporting function - used internally.
86 */
87 /* @{ */
88 #define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM)
89 #define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED)
90 #define SDL_InvalidParamError(param) SDL_SetError("Parameter '%s' is invalid", (param))
91 typedef enum
92 {
93 SDL_ENOMEM,
94 SDL_EFREAD,
95 SDL_EFWRITE,
96 SDL_EFSEEK,
97 SDL_UNSUPPORTED,
98 SDL_LASTERROR
99 } SDL_errorcode;
100 /* SDL_Error() unconditionally returns -1. */
101 extern DECLSPEC int SDLCALL SDL_Error(SDL_errorcode code);
102 /* @} *//* Internal error functions */
103
104 /* Ends C function definitions when using C++ */
105 #ifdef __cplusplus
106 }
107 #endif
108 #include "close_code.h"
109
110 #endif /* SDL_error_h_ */
111
112 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_events.h added (mode: 100644) (index 0000000..ae560c0)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_events.h
24 *
25 * Include file for SDL event handling.
26 */
27
28 #ifndef SDL_events_h_
29 #define SDL_events_h_
30
31 #include "SDL_stdinc.h"
32 #include "SDL_error.h"
33 #include "SDL_video.h"
34 #include "SDL_keyboard.h"
35 #include "SDL_mouse.h"
36 #include "SDL_joystick.h"
37 #include "SDL_gamecontroller.h"
38 #include "SDL_quit.h"
39 #include "SDL_gesture.h"
40 #include "SDL_touch.h"
41
42 #include "begin_code.h"
43 /* Set up for C function definitions, even when using C++ */
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47
48 /* General keyboard/mouse state definitions */
49 #define SDL_RELEASED 0
50 #define SDL_PRESSED 1
51
52 /**
53 * \brief The types of events that can be delivered.
54 */
55 typedef enum
56 {
57 SDL_FIRSTEVENT = 0, /**< Unused (do not remove) */
58
59 /* Application events */
60 SDL_QUIT = 0x100, /**< User-requested quit */
61
62 /* These application events have special meaning on iOS, see README-ios.md for details */
63 SDL_APP_TERMINATING, /**< The application is being terminated by the OS
64 Called on iOS in applicationWillTerminate()
65 Called on Android in onDestroy()
66 */
67 SDL_APP_LOWMEMORY, /**< The application is low on memory, free memory if possible.
68 Called on iOS in applicationDidReceiveMemoryWarning()
69 Called on Android in onLowMemory()
70 */
71 SDL_APP_WILLENTERBACKGROUND, /**< The application is about to enter the background
72 Called on iOS in applicationWillResignActive()
73 Called on Android in onPause()
74 */
75 SDL_APP_DIDENTERBACKGROUND, /**< The application did enter the background and may not get CPU for some time
76 Called on iOS in applicationDidEnterBackground()
77 Called on Android in onPause()
78 */
79 SDL_APP_WILLENTERFOREGROUND, /**< The application is about to enter the foreground
80 Called on iOS in applicationWillEnterForeground()
81 Called on Android in onResume()
82 */
83 SDL_APP_DIDENTERFOREGROUND, /**< The application is now interactive
84 Called on iOS in applicationDidBecomeActive()
85 Called on Android in onResume()
86 */
87
88 SDL_LOCALECHANGED, /**< The user's locale preferences have changed. */
89
90 /* Display events */
91 SDL_DISPLAYEVENT = 0x150, /**< Display state change */
92
93 /* Window events */
94 SDL_WINDOWEVENT = 0x200, /**< Window state change */
95 SDL_SYSWMEVENT, /**< System specific event */
96
97 /* Keyboard events */
98 SDL_KEYDOWN = 0x300, /**< Key pressed */
99 SDL_KEYUP, /**< Key released */
100 SDL_TEXTEDITING, /**< Keyboard text editing (composition) */
101 SDL_TEXTINPUT, /**< Keyboard text input */
102 SDL_KEYMAPCHANGED, /**< Keymap changed due to a system event such as an
103 input language or keyboard layout change.
104 */
105
106 /* Mouse events */
107 SDL_MOUSEMOTION = 0x400, /**< Mouse moved */
108 SDL_MOUSEBUTTONDOWN, /**< Mouse button pressed */
109 SDL_MOUSEBUTTONUP, /**< Mouse button released */
110 SDL_MOUSEWHEEL, /**< Mouse wheel motion */
111
112 /* Joystick events */
113 SDL_JOYAXISMOTION = 0x600, /**< Joystick axis motion */
114 SDL_JOYBALLMOTION, /**< Joystick trackball motion */
115 SDL_JOYHATMOTION, /**< Joystick hat position change */
116 SDL_JOYBUTTONDOWN, /**< Joystick button pressed */
117 SDL_JOYBUTTONUP, /**< Joystick button released */
118 SDL_JOYDEVICEADDED, /**< A new joystick has been inserted into the system */
119 SDL_JOYDEVICEREMOVED, /**< An opened joystick has been removed */
120
121 /* Game controller events */
122 SDL_CONTROLLERAXISMOTION = 0x650, /**< Game controller axis motion */
123 SDL_CONTROLLERBUTTONDOWN, /**< Game controller button pressed */
124 SDL_CONTROLLERBUTTONUP, /**< Game controller button released */
125 SDL_CONTROLLERDEVICEADDED, /**< A new Game controller has been inserted into the system */
126 SDL_CONTROLLERDEVICEREMOVED, /**< An opened Game controller has been removed */
127 SDL_CONTROLLERDEVICEREMAPPED, /**< The controller mapping was updated */
128 SDL_CONTROLLERTOUCHPADDOWN, /**< Game controller touchpad was touched */
129 SDL_CONTROLLERTOUCHPADMOTION, /**< Game controller touchpad finger was moved */
130 SDL_CONTROLLERTOUCHPADUP, /**< Game controller touchpad finger was lifted */
131 SDL_CONTROLLERSENSORUPDATE, /**< Game controller sensor was updated */
132
133 /* Touch events */
134 SDL_FINGERDOWN = 0x700,
135 SDL_FINGERUP,
136 SDL_FINGERMOTION,
137
138 /* Gesture events */
139 SDL_DOLLARGESTURE = 0x800,
140 SDL_DOLLARRECORD,
141 SDL_MULTIGESTURE,
142
143 /* Clipboard events */
144 SDL_CLIPBOARDUPDATE = 0x900, /**< The clipboard changed */
145
146 /* Drag and drop events */
147 SDL_DROPFILE = 0x1000, /**< The system requests a file open */
148 SDL_DROPTEXT, /**< text/plain drag-and-drop event */
149 SDL_DROPBEGIN, /**< A new set of drops is beginning (NULL filename) */
150 SDL_DROPCOMPLETE, /**< Current set of drops is now complete (NULL filename) */
151
152 /* Audio hotplug events */
153 SDL_AUDIODEVICEADDED = 0x1100, /**< A new audio device is available */
154 SDL_AUDIODEVICEREMOVED, /**< An audio device has been removed. */
155
156 /* Sensor events */
157 SDL_SENSORUPDATE = 0x1200, /**< A sensor was updated */
158
159 /* Render events */
160 SDL_RENDER_TARGETS_RESET = 0x2000, /**< The render targets have been reset and their contents need to be updated */
161 SDL_RENDER_DEVICE_RESET, /**< The device has been reset and all textures need to be recreated */
162
163 /** Events ::SDL_USEREVENT through ::SDL_LASTEVENT are for your use,
164 * and should be allocated with SDL_RegisterEvents()
165 */
166 SDL_USEREVENT = 0x8000,
167
168 /**
169 * This last event is only for bounding internal arrays
170 */
171 SDL_LASTEVENT = 0xFFFF
172 } SDL_EventType;
173
174 /**
175 * \brief Fields shared by every event
176 */
177 typedef struct SDL_CommonEvent
178 {
179 Uint32 type;
180 Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
181 } SDL_CommonEvent;
182
183 /**
184 * \brief Display state change event data (event.display.*)
185 */
186 typedef struct SDL_DisplayEvent
187 {
188 Uint32 type; /**< ::SDL_DISPLAYEVENT */
189 Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
190 Uint32 display; /**< The associated display index */
191 Uint8 event; /**< ::SDL_DisplayEventID */
192 Uint8 padding1;
193 Uint8 padding2;
194 Uint8 padding3;
195 Sint32 data1; /**< event dependent data */
196 } SDL_DisplayEvent;
197
198 /**
199 * \brief Window state change event data (event.window.*)
200 */
201 typedef struct SDL_WindowEvent
202 {
203 Uint32 type; /**< ::SDL_WINDOWEVENT */
204 Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
205 Uint32 windowID; /**< The associated window */
206 Uint8 event; /**< ::SDL_WindowEventID */
207 Uint8 padding1;
208 Uint8 padding2;
209 Uint8 padding3;
210 Sint32 data1; /**< event dependent data */
211 Sint32 data2; /**< event dependent data */
212 } SDL_WindowEvent;
213
214 /**
215 * \brief Keyboard button event structure (event.key.*)
216 */
217 typedef struct SDL_KeyboardEvent
218 {
219 Uint32 type; /**< ::SDL_KEYDOWN or ::SDL_KEYUP */
220 Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
221 Uint32 windowID; /**< The window with keyboard focus, if any */
222 Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
223 Uint8 repeat; /**< Non-zero if this is a key repeat */
224 Uint8 padding2;
225 Uint8 padding3;
226 SDL_Keysym keysym; /**< The key that was pressed or released */
227 } SDL_KeyboardEvent;
228
229 #define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32)
230 /**
231 * \brief Keyboard text editing event structure (event.edit.*)
232 */
233 typedef struct SDL_TextEditingEvent
234 {
235 Uint32 type; /**< ::SDL_TEXTEDITING */
236 Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
237 Uint32 windowID; /**< The window with keyboard focus, if any */
238 char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE]; /**< The editing text */
239 Sint32 start; /**< The start cursor of selected editing text */
240 Sint32 length; /**< The length of selected editing text */
241 } SDL_TextEditingEvent;
242
243
244 #define SDL_TEXTINPUTEVENT_TEXT_SIZE (32)
245 /**
246 * \brief Keyboard text input event structure (event.text.*)
247 */
248 typedef struct SDL_TextInputEvent
249 {
250 Uint32 type; /**< ::SDL_TEXTINPUT */
251 Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
252 Uint32 windowID; /**< The window with keyboard focus, if any */
253 char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]; /**< The input text */
254 } SDL_TextInputEvent;
255
256 /**
257 * \brief Mouse motion event structure (event.motion.*)
258 */
259 typedef struct SDL_MouseMotionEvent
260 {
261 Uint32 type; /**< ::SDL_MOUSEMOTION */
262 Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
263 Uint32 windowID; /**< The window with mouse focus, if any */
264 Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
265 Uint32 state; /**< The current button state */
266 Sint32 x; /**< X coordinate, relative to window */
267 Sint32 y; /**< Y coordinate, relative to window */
268 Sint32 xrel; /**< The relative motion in the X direction */
269 Sint32 yrel; /**< The relative motion in the Y direction */
270 } SDL_MouseMotionEvent;
271
272 /**
273 * \brief Mouse button event structure (event.button.*)
274 */
275 typedef struct SDL_MouseButtonEvent
276 {
277 Uint32 type; /**< ::SDL_MOUSEBUTTONDOWN or ::SDL_MOUSEBUTTONUP */
278 Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
279 Uint32 windowID; /**< The window with mouse focus, if any */
280 Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
281 Uint8 button; /**< The mouse button index */
282 Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
283 Uint8 clicks; /**< 1 for single-click, 2 for double-click, etc. */
284 Uint8 padding1;
285 Sint32 x; /**< X coordinate, relative to window */
286 Sint32 y; /**< Y coordinate, relative to window */
287 } SDL_MouseButtonEvent;
288
289 /**
290 * \brief Mouse wheel event structure (event.wheel.*)
291 */
292 typedef struct SDL_MouseWheelEvent
293 {
294 Uint32 type; /**< ::SDL_MOUSEWHEEL */
295 Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
296 Uint32 windowID; /**< The window with mouse focus, if any */
297 Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
298 Sint32 x; /**< The amount scrolled horizontally, positive to the right and negative to the left */
299 Sint32 y; /**< The amount scrolled vertically, positive away from the user and negative toward the user */
300 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 */
301 } SDL_MouseWheelEvent;
302
303 /**
304 * \brief Joystick axis motion event structure (event.jaxis.*)
305 */
306 typedef struct SDL_JoyAxisEvent
307 {
308 Uint32 type; /**< ::SDL_JOYAXISMOTION */
309 Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
310 SDL_JoystickID which; /**< The joystick instance id */
311 Uint8 axis; /**< The joystick axis index */
312 Uint8 padding1;
313 Uint8 padding2;
314 Uint8 padding3;
315 Sint16 value; /**< The axis value (range: -32768 to 32767) */
316 Uint16 padding4;
317 } SDL_JoyAxisEvent;
318
319 /**
320 * \brief Joystick trackball motion event structure (event.jball.*)
321 */
322 typedef struct SDL_JoyBallEvent
323 {
324 Uint32 type; /**< ::SDL_JOYBALLMOTION */
325 Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
326 SDL_JoystickID which; /**< The joystick instance id */
327 Uint8 ball; /**< The joystick trackball index */
328 Uint8 padding1;
329 Uint8 padding2;
330 Uint8 padding3;
331 Sint16 xrel; /**< The relative motion in the X direction */
332 Sint16 yrel; /**< The relative motion in the Y direction */
333 } SDL_JoyBallEvent;
334
335 /**
336 * \brief Joystick hat position change event structure (event.jhat.*)
337 */
338 typedef struct SDL_JoyHatEvent
339 {
340 Uint32 type; /**< ::SDL_JOYHATMOTION */
341 Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
342 SDL_JoystickID which; /**< The joystick instance id */
343 Uint8 hat; /**< The joystick hat index */
344 Uint8 value; /**< The hat position value.
345 * \sa ::SDL_HAT_LEFTUP ::SDL_HAT_UP ::SDL_HAT_RIGHTUP
346 * \sa ::SDL_HAT_LEFT ::SDL_HAT_CENTERED ::SDL_HAT_RIGHT
347 * \sa ::SDL_HAT_LEFTDOWN ::SDL_HAT_DOWN ::SDL_HAT_RIGHTDOWN
348 *
349 * Note that zero means the POV is centered.
350 */
351 Uint8 padding1;
352 Uint8 padding2;
353 } SDL_JoyHatEvent;
354
355 /**
356 * \brief Joystick button event structure (event.jbutton.*)
357 */
358 typedef struct SDL_JoyButtonEvent
359 {
360 Uint32 type; /**< ::SDL_JOYBUTTONDOWN or ::SDL_JOYBUTTONUP */
361 Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
362 SDL_JoystickID which; /**< The joystick instance id */
363 Uint8 button; /**< The joystick button index */
364 Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
365 Uint8 padding1;
366 Uint8 padding2;
367 } SDL_JoyButtonEvent;
368
369 /**
370 * \brief Joystick device event structure (event.jdevice.*)
371 */
372 typedef struct SDL_JoyDeviceEvent
373 {
374 Uint32 type; /**< ::SDL_JOYDEVICEADDED or ::SDL_JOYDEVICEREMOVED */
375 Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
376 Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED event */
377 } SDL_JoyDeviceEvent;
378
379
380 /**
381 * \brief Game controller axis motion event structure (event.caxis.*)
382 */
383 typedef struct SDL_ControllerAxisEvent
384 {
385 Uint32 type; /**< ::SDL_CONTROLLERAXISMOTION */
386 Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
387 SDL_JoystickID which; /**< The joystick instance id */
388 Uint8 axis; /**< The controller axis (SDL_GameControllerAxis) */
389 Uint8 padding1;
390 Uint8 padding2;
391 Uint8 padding3;
392 Sint16 value; /**< The axis value (range: -32768 to 32767) */
393 Uint16 padding4;
394 } SDL_ControllerAxisEvent;
395
396
397 /**
398 * \brief Game controller button event structure (event.cbutton.*)
399 */
400 typedef struct SDL_ControllerButtonEvent
401 {
402 Uint32 type; /**< ::SDL_CONTROLLERBUTTONDOWN or ::SDL_CONTROLLERBUTTONUP */
403 Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
404 SDL_JoystickID which; /**< The joystick instance id */
405 Uint8 button; /**< The controller button (SDL_GameControllerButton) */
406 Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */
407 Uint8 padding1;
408 Uint8 padding2;
409 } SDL_ControllerButtonEvent;
410
411
412 /**
413 * \brief Controller device event structure (event.cdevice.*)
414 */
415 typedef struct SDL_ControllerDeviceEvent
416 {
417 Uint32 type; /**< ::SDL_CONTROLLERDEVICEADDED, ::SDL_CONTROLLERDEVICEREMOVED, or ::SDL_CONTROLLERDEVICEREMAPPED */
418 Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
419 Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED or REMAPPED event */
420 } SDL_ControllerDeviceEvent;
421
422 /**
423 * \brief Game controller touchpad event structure (event.ctouchpad.*)
424 */
425 typedef struct SDL_ControllerTouchpadEvent
426 {
427 Uint32 type; /**< ::SDL_CONTROLLERTOUCHPADDOWN or ::SDL_CONTROLLERTOUCHPADMOTION or ::SDL_CONTROLLERTOUCHPADUP */
428 Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
429 SDL_JoystickID which; /**< The joystick instance id */
430 Sint32 touchpad; /**< The index of the touchpad */
431 Sint32 finger; /**< The index of the finger on the touchpad */
432 float x; /**< Normalized in the range 0...1 with 0 being on the left */
433 float y; /**< Normalized in the range 0...1 with 0 being at the top */
434 float pressure; /**< Normalized in the range 0...1 */
435 } SDL_ControllerTouchpadEvent;
436
437 /**
438 * \brief Game controller sensor event structure (event.csensor.*)
439 */
440 typedef struct SDL_ControllerSensorEvent
441 {
442 Uint32 type; /**< ::SDL_CONTROLLERSENSORUPDATE */
443 Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
444 SDL_JoystickID which; /**< The joystick instance id */
445 Sint32 sensor; /**< The type of the sensor, one of the values of ::SDL_SensorType */
446 float data[3]; /**< Up to 3 values from the sensor, as defined in SDL_sensor.h */
447 } SDL_ControllerSensorEvent;
448
449 /**
450 * \brief Audio device event structure (event.adevice.*)
451 */
452 typedef struct SDL_AudioDeviceEvent
453 {
454 Uint32 type; /**< ::SDL_AUDIODEVICEADDED, or ::SDL_AUDIODEVICEREMOVED */
455 Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
456 Uint32 which; /**< The audio device index for the ADDED event (valid until next SDL_GetNumAudioDevices() call), SDL_AudioDeviceID for the REMOVED event */
457 Uint8 iscapture; /**< zero if an output device, non-zero if a capture device. */
458 Uint8 padding1;
459 Uint8 padding2;
460 Uint8 padding3;
461 } SDL_AudioDeviceEvent;
462
463
464 /**
465 * \brief Touch finger event structure (event.tfinger.*)
466 */
467 typedef struct SDL_TouchFingerEvent
468 {
469 Uint32 type; /**< ::SDL_FINGERMOTION or ::SDL_FINGERDOWN or ::SDL_FINGERUP */
470 Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
471 SDL_TouchID touchId; /**< The touch device id */
472 SDL_FingerID fingerId;
473 float x; /**< Normalized in the range 0...1 */
474 float y; /**< Normalized in the range 0...1 */
475 float dx; /**< Normalized in the range -1...1 */
476 float dy; /**< Normalized in the range -1...1 */
477 float pressure; /**< Normalized in the range 0...1 */
478 Uint32 windowID; /**< The window underneath the finger, if any */
479 } SDL_TouchFingerEvent;
480
481
482 /**
483 * \brief Multiple Finger Gesture Event (event.mgesture.*)
484 */
485 typedef struct SDL_MultiGestureEvent
486 {
487 Uint32 type; /**< ::SDL_MULTIGESTURE */
488 Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
489 SDL_TouchID touchId; /**< The touch device id */
490 float dTheta;
491 float dDist;
492 float x;
493 float y;
494 Uint16 numFingers;
495 Uint16 padding;
496 } SDL_MultiGestureEvent;
497
498
499 /**
500 * \brief Dollar Gesture Event (event.dgesture.*)
501 */
502 typedef struct SDL_DollarGestureEvent
503 {
504 Uint32 type; /**< ::SDL_DOLLARGESTURE or ::SDL_DOLLARRECORD */
505 Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
506 SDL_TouchID touchId; /**< The touch device id */
507 SDL_GestureID gestureId;
508 Uint32 numFingers;
509 float error;
510 float x; /**< Normalized center of gesture */
511 float y; /**< Normalized center of gesture */
512 } SDL_DollarGestureEvent;
513
514
515 /**
516 * \brief An event used to request a file open by the system (event.drop.*)
517 * This event is enabled by default, you can disable it with SDL_EventState().
518 * \note If this event is enabled, you must free the filename in the event.
519 */
520 typedef struct SDL_DropEvent
521 {
522 Uint32 type; /**< ::SDL_DROPBEGIN or ::SDL_DROPFILE or ::SDL_DROPTEXT or ::SDL_DROPCOMPLETE */
523 Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
524 char *file; /**< The file name, which should be freed with SDL_free(), is NULL on begin/complete */
525 Uint32 windowID; /**< The window that was dropped on, if any */
526 } SDL_DropEvent;
527
528
529 /**
530 * \brief Sensor event structure (event.sensor.*)
531 */
532 typedef struct SDL_SensorEvent
533 {
534 Uint32 type; /**< ::SDL_SENSORUPDATE */
535 Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
536 Sint32 which; /**< The instance ID of the sensor */
537 float data[6]; /**< Up to 6 values from the sensor - additional values can be queried using SDL_SensorGetData() */
538 } SDL_SensorEvent;
539
540 /**
541 * \brief The "quit requested" event
542 */
543 typedef struct SDL_QuitEvent
544 {
545 Uint32 type; /**< ::SDL_QUIT */
546 Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
547 } SDL_QuitEvent;
548
549 /**
550 * \brief OS Specific event
551 */
552 typedef struct SDL_OSEvent
553 {
554 Uint32 type; /**< ::SDL_QUIT */
555 Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
556 } SDL_OSEvent;
557
558 /**
559 * \brief A user-defined event type (event.user.*)
560 */
561 typedef struct SDL_UserEvent
562 {
563 Uint32 type; /**< ::SDL_USEREVENT through ::SDL_LASTEVENT-1 */
564 Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
565 Uint32 windowID; /**< The associated window if any */
566 Sint32 code; /**< User defined event code */
567 void *data1; /**< User defined data pointer */
568 void *data2; /**< User defined data pointer */
569 } SDL_UserEvent;
570
571
572 struct SDL_SysWMmsg;
573 typedef struct SDL_SysWMmsg SDL_SysWMmsg;
574
575 /**
576 * \brief A video driver dependent system event (event.syswm.*)
577 * This event is disabled by default, you can enable it with SDL_EventState()
578 *
579 * \note If you want to use this event, you should include SDL_syswm.h.
580 */
581 typedef struct SDL_SysWMEvent
582 {
583 Uint32 type; /**< ::SDL_SYSWMEVENT */
584 Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
585 SDL_SysWMmsg *msg; /**< driver dependent data, defined in SDL_syswm.h */
586 } SDL_SysWMEvent;
587
588 /**
589 * \brief General event structure
590 */
591 typedef union SDL_Event
592 {
593 Uint32 type; /**< Event type, shared with all events */
594 SDL_CommonEvent common; /**< Common event data */
595 SDL_DisplayEvent display; /**< Display event data */
596 SDL_WindowEvent window; /**< Window event data */
597 SDL_KeyboardEvent key; /**< Keyboard event data */
598 SDL_TextEditingEvent edit; /**< Text editing event data */
599 SDL_TextInputEvent text; /**< Text input event data */
600 SDL_MouseMotionEvent motion; /**< Mouse motion event data */
601 SDL_MouseButtonEvent button; /**< Mouse button event data */
602 SDL_MouseWheelEvent wheel; /**< Mouse wheel event data */
603 SDL_JoyAxisEvent jaxis; /**< Joystick axis event data */
604 SDL_JoyBallEvent jball; /**< Joystick ball event data */
605 SDL_JoyHatEvent jhat; /**< Joystick hat event data */
606 SDL_JoyButtonEvent jbutton; /**< Joystick button event data */
607 SDL_JoyDeviceEvent jdevice; /**< Joystick device change event data */
608 SDL_ControllerAxisEvent caxis; /**< Game Controller axis event data */
609 SDL_ControllerButtonEvent cbutton; /**< Game Controller button event data */
610 SDL_ControllerDeviceEvent cdevice; /**< Game Controller device event data */
611 SDL_ControllerTouchpadEvent ctouchpad; /**< Game Controller touchpad event data */
612 SDL_ControllerSensorEvent csensor; /**< Game Controller sensor event data */
613 SDL_AudioDeviceEvent adevice; /**< Audio device event data */
614 SDL_SensorEvent sensor; /**< Sensor event data */
615 SDL_QuitEvent quit; /**< Quit request event data */
616 SDL_UserEvent user; /**< Custom event data */
617 SDL_SysWMEvent syswm; /**< System dependent window event data */
618 SDL_TouchFingerEvent tfinger; /**< Touch finger event data */
619 SDL_MultiGestureEvent mgesture; /**< Gesture event data */
620 SDL_DollarGestureEvent dgesture; /**< Gesture event data */
621 SDL_DropEvent drop; /**< Drag and drop event data */
622
623 /* This is necessary for ABI compatibility between Visual C++ and GCC
624 Visual C++ will respect the push pack pragma and use 52 bytes for
625 this structure, and GCC will use the alignment of the largest datatype
626 within the union, which is 8 bytes.
627
628 So... we'll add padding to force the size to be 56 bytes for both.
629 */
630 Uint8 padding[56];
631 } SDL_Event;
632
633 /* Make sure we haven't broken binary compatibility */
634 SDL_COMPILE_TIME_ASSERT(SDL_Event, sizeof(SDL_Event) == 56);
635
636
637 /* Function prototypes */
638
639 /**
640 * Pumps the event loop, gathering events from the input devices.
641 *
642 * This function updates the event queue and internal input device state.
643 *
644 * This should only be run in the thread that sets the video mode.
645 */
646 extern DECLSPEC void SDLCALL SDL_PumpEvents(void);
647
648 /* @{ */
649 typedef enum
650 {
651 SDL_ADDEVENT,
652 SDL_PEEKEVENT,
653 SDL_GETEVENT
654 } SDL_eventaction;
655
656 /**
657 * Checks the event queue for messages and optionally returns them.
658 *
659 * If \c action is ::SDL_ADDEVENT, up to \c numevents events will be added to
660 * the back of the event queue.
661 *
662 * If \c action is ::SDL_PEEKEVENT, up to \c numevents events at the front
663 * of the event queue, within the specified minimum and maximum type,
664 * will be returned and will not be removed from the queue.
665 *
666 * If \c action is ::SDL_GETEVENT, up to \c numevents events at the front
667 * of the event queue, within the specified minimum and maximum type,
668 * will be returned and will be removed from the queue.
669 *
670 * \return The number of events actually stored, or -1 if there was an error.
671 *
672 * This function is thread-safe.
673 */
674 extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event * events, int numevents,
675 SDL_eventaction action,
676 Uint32 minType, Uint32 maxType);
677 /* @} */
678
679 /**
680 * Checks to see if certain event types are in the event queue.
681 */
682 extern DECLSPEC SDL_bool SDLCALL SDL_HasEvent(Uint32 type);
683 extern DECLSPEC SDL_bool SDLCALL SDL_HasEvents(Uint32 minType, Uint32 maxType);
684
685 /**
686 * This function clears events from the event queue
687 * This function only affects currently queued events. If you want to make
688 * sure that all pending OS events are flushed, you can call SDL_PumpEvents()
689 * on the main thread immediately before the flush call.
690 */
691 extern DECLSPEC void SDLCALL SDL_FlushEvent(Uint32 type);
692 extern DECLSPEC void SDLCALL SDL_FlushEvents(Uint32 minType, Uint32 maxType);
693
694 /**
695 * \brief Polls for currently pending events.
696 *
697 * \return 1 if there are any pending events, or 0 if there are none available.
698 *
699 * \param event If not NULL, the next event is removed from the queue and
700 * stored in that area.
701 */
702 extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event * event);
703
704 /**
705 * \brief Waits indefinitely for the next available event.
706 *
707 * \return 1, or 0 if there was an error while waiting for events.
708 *
709 * \param event If not NULL, the next event is removed from the queue and
710 * stored in that area.
711 */
712 extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event * event);
713
714 /**
715 * \brief Waits until the specified timeout (in milliseconds) for the next
716 * available event.
717 *
718 * \return 1, or 0 if there was an error while waiting for events.
719 *
720 * \param event If not NULL, the next event is removed from the queue and
721 * stored in that area.
722 * \param timeout The timeout (in milliseconds) to wait for next event.
723 */
724 extern DECLSPEC int SDLCALL SDL_WaitEventTimeout(SDL_Event * event,
725 int timeout);
726
727 /**
728 * \brief Add an event to the event queue.
729 *
730 * \return 1 on success, 0 if the event was filtered, or -1 if the event queue
731 * was full or there was some other error.
732 */
733 extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event * event);
734
735 typedef int (SDLCALL * SDL_EventFilter) (void *userdata, SDL_Event * event);
736
737 /**
738 * Sets up a filter to process all events before they change internal state and
739 * are posted to the internal event queue.
740 *
741 * The filter is prototyped as:
742 * \code
743 * int SDL_EventFilter(void *userdata, SDL_Event * event);
744 * \endcode
745 *
746 * If the filter returns 1, then the event will be added to the internal queue.
747 * If it returns 0, then the event will be dropped from the queue, but the
748 * internal state will still be updated. This allows selective filtering of
749 * dynamically arriving events.
750 *
751 * \warning Be very careful of what you do in the event filter function, as
752 * it may run in a different thread!
753 *
754 * There is one caveat when dealing with the ::SDL_QuitEvent event type. The
755 * event filter is only called when the window manager desires to close the
756 * application window. If the event filter returns 1, then the window will
757 * be closed, otherwise the window will remain open if possible.
758 *
759 * If the quit event is generated by an interrupt signal, it will bypass the
760 * internal queue and be delivered to the application at the next event poll.
761 */
762 extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter,
763 void *userdata);
764
765 /**
766 * Return the current event filter - can be used to "chain" filters.
767 * If there is no event filter set, this function returns SDL_FALSE.
768 */
769 extern DECLSPEC SDL_bool SDLCALL SDL_GetEventFilter(SDL_EventFilter * filter,
770 void **userdata);
771
772 /**
773 * Add a function which is called when an event is added to the queue.
774 */
775 extern DECLSPEC void SDLCALL SDL_AddEventWatch(SDL_EventFilter filter,
776 void *userdata);
777
778 /**
779 * Remove an event watch function added with SDL_AddEventWatch()
780 */
781 extern DECLSPEC void SDLCALL SDL_DelEventWatch(SDL_EventFilter filter,
782 void *userdata);
783
784 /**
785 * Run the filter function on the current event queue, removing any
786 * events for which the filter returns 0.
787 */
788 extern DECLSPEC void SDLCALL SDL_FilterEvents(SDL_EventFilter filter,
789 void *userdata);
790
791 /* @{ */
792 #define SDL_QUERY -1
793 #define SDL_IGNORE 0
794 #define SDL_DISABLE 0
795 #define SDL_ENABLE 1
796
797 /**
798 * This function allows you to set the state of processing certain events.
799 * - If \c state is set to ::SDL_IGNORE, that event will be automatically
800 * dropped from the event queue and will not be filtered.
801 * - If \c state is set to ::SDL_ENABLE, that event will be processed
802 * normally.
803 * - If \c state is set to ::SDL_QUERY, SDL_EventState() will return the
804 * current processing state of the specified event.
805 */
806 extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint32 type, int state);
807 /* @} */
808 #define SDL_GetEventState(type) SDL_EventState(type, SDL_QUERY)
809
810 /**
811 * This function allocates a set of user-defined events, and returns
812 * the beginning event number for that set of events.
813 *
814 * If there aren't enough user-defined events left, this function
815 * returns (Uint32)-1
816 */
817 extern DECLSPEC Uint32 SDLCALL SDL_RegisterEvents(int numevents);
818
819 /* Ends C function definitions when using C++ */
820 #ifdef __cplusplus
821 }
822 #endif
823 #include "close_code.h"
824
825 #endif /* SDL_events_h_ */
826
827 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_filesystem.h added (mode: 100644) (index 0000000..68042b6)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_filesystem.h
24 *
25 * \brief Include file for filesystem SDL API functions
26 */
27
28 #ifndef SDL_filesystem_h_
29 #define SDL_filesystem_h_
30
31 #include "SDL_stdinc.h"
32
33 #include "begin_code.h"
34
35 /* Set up for C function definitions, even when using C++ */
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39
40 /**
41 * \brief Get the path where the application resides.
42 *
43 * Get the "base path". This is the directory where the application was run
44 * from, which is probably the installation directory, and may or may not
45 * be the process's current working directory.
46 *
47 * This returns an absolute path in UTF-8 encoding, and is guaranteed to
48 * end with a path separator ('\\' on Windows, '/' most other places).
49 *
50 * The pointer returned by this function is owned by you. Please call
51 * SDL_free() on the pointer when you are done with it, or it will be a
52 * memory leak. This is not necessarily a fast call, though, so you should
53 * call this once near startup and save the string if you need it.
54 *
55 * Some platforms can't determine the application's path, and on other
56 * platforms, this might be meaningless. In such cases, this function will
57 * return NULL.
58 *
59 * \return String of base dir in UTF-8 encoding, or NULL on error.
60 *
61 * \sa SDL_GetPrefPath
62 */
63 extern DECLSPEC char *SDLCALL SDL_GetBasePath(void);
64
65 /**
66 * \brief Get the user-and-app-specific path where files can be written.
67 *
68 * Get the "pref dir". This is meant to be where users can write personal
69 * files (preferences and save games, etc) that are specific to your
70 * application. This directory is unique per user, per application.
71 *
72 * This function will decide the appropriate location in the native filesystem,
73 * create the directory if necessary, and return a string of the absolute
74 * path to the directory in UTF-8 encoding.
75 *
76 * On Windows, the string might look like:
77 * "C:\\Users\\bob\\AppData\\Roaming\\My Company\\My Program Name\\"
78 *
79 * On Linux, the string might look like:
80 * "/home/bob/.local/share/My Program Name/"
81 *
82 * On Mac OS X, the string might look like:
83 * "/Users/bob/Library/Application Support/My Program Name/"
84 *
85 * (etc.)
86 *
87 * You specify the name of your organization (if it's not a real organization,
88 * your name or an Internet domain you own might do) and the name of your
89 * application. These should be untranslated proper names.
90 *
91 * Both the org and app strings may become part of a directory name, so
92 * please follow these rules:
93 *
94 * - Try to use the same org string (including case-sensitivity) for
95 * all your applications that use this function.
96 * - Always use a unique app string for each one, and make sure it never
97 * changes for an app once you've decided on it.
98 * - Unicode characters are legal, as long as it's UTF-8 encoded, but...
99 * - ...only use letters, numbers, and spaces. Avoid punctuation like
100 * "Game Name 2: Bad Guy's Revenge!" ... "Game Name 2" is sufficient.
101 *
102 * This returns an absolute path in UTF-8 encoding, and is guaranteed to
103 * end with a path separator ('\\' on Windows, '/' most other places).
104 *
105 * The pointer returned by this function is owned by you. Please call
106 * SDL_free() on the pointer when you are done with it, or it will be a
107 * memory leak. This is not necessarily a fast call, though, so you should
108 * call this once near startup and save the string if you need it.
109 *
110 * You should assume the path returned by this function is the only safe
111 * place to write files (and that SDL_GetBasePath(), while it might be
112 * writable, or even the parent of the returned path, aren't where you
113 * should be writing things).
114 *
115 * Some platforms can't determine the pref path, and on other
116 * platforms, this might be meaningless. In such cases, this function will
117 * return NULL.
118 *
119 * \param org The name of your organization.
120 * \param app The name of your application.
121 * \return UTF-8 string of user dir in platform-dependent notation. NULL
122 * if there's a problem (creating directory failed, etc).
123 *
124 * \sa SDL_GetBasePath
125 */
126 extern DECLSPEC char *SDLCALL SDL_GetPrefPath(const char *org, const char *app);
127
128 /* Ends C function definitions when using C++ */
129 #ifdef __cplusplus
130 }
131 #endif
132 #include "close_code.h"
133
134 #endif /* SDL_filesystem_h_ */
135
136 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_gamecontroller.h added (mode: 100644) (index 0000000..e42433c)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_gamecontroller.h
24 *
25 * Include file for SDL game controller event handling
26 */
27
28 #ifndef SDL_gamecontroller_h_
29 #define SDL_gamecontroller_h_
30
31 #include "SDL_stdinc.h"
32 #include "SDL_error.h"
33 #include "SDL_rwops.h"
34 #include "SDL_sensor.h"
35 #include "SDL_joystick.h"
36
37 #include "begin_code.h"
38 /* Set up for C function definitions, even when using C++ */
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42
43 /**
44 * \file SDL_gamecontroller.h
45 *
46 * In order to use these functions, SDL_Init() must have been called
47 * with the ::SDL_INIT_GAMECONTROLLER flag. This causes SDL to scan the system
48 * for game controllers, and load appropriate drivers.
49 *
50 * If you would like to receive controller updates while the application
51 * is in the background, you should set the following hint before calling
52 * SDL_Init(): SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS
53 */
54
55 /**
56 * The gamecontroller structure used to identify an SDL game controller
57 */
58 struct _SDL_GameController;
59 typedef struct _SDL_GameController SDL_GameController;
60
61 typedef enum
62 {
63 SDL_CONTROLLER_TYPE_UNKNOWN = 0,
64 SDL_CONTROLLER_TYPE_XBOX360,
65 SDL_CONTROLLER_TYPE_XBOXONE,
66 SDL_CONTROLLER_TYPE_PS3,
67 SDL_CONTROLLER_TYPE_PS4,
68 SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO,
69 SDL_CONTROLLER_TYPE_VIRTUAL,
70 SDL_CONTROLLER_TYPE_PS5
71 } SDL_GameControllerType;
72
73 typedef enum
74 {
75 SDL_CONTROLLER_BINDTYPE_NONE = 0,
76 SDL_CONTROLLER_BINDTYPE_BUTTON,
77 SDL_CONTROLLER_BINDTYPE_AXIS,
78 SDL_CONTROLLER_BINDTYPE_HAT
79 } SDL_GameControllerBindType;
80
81 /**
82 * Get the SDL joystick layer binding for this controller button/axis mapping
83 */
84 typedef struct SDL_GameControllerButtonBind
85 {
86 SDL_GameControllerBindType bindType;
87 union
88 {
89 int button;
90 int axis;
91 struct {
92 int hat;
93 int hat_mask;
94 } hat;
95 } value;
96
97 } SDL_GameControllerButtonBind;
98
99
100 /**
101 * To count the number of game controllers in the system for the following:
102 * int nJoysticks = SDL_NumJoysticks();
103 * int nGameControllers = 0;
104 * for (int i = 0; i < nJoysticks; i++) {
105 * if (SDL_IsGameController(i)) {
106 * nGameControllers++;
107 * }
108 * }
109 *
110 * 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:
111 * guid,name,mappings
112 *
113 * 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.
114 * Under Windows there is a reserved GUID of "xinput" that covers any XInput devices.
115 * The mapping format for joystick is:
116 * bX - a joystick button, index X
117 * hX.Y - hat X with value Y
118 * aX - axis X of the joystick
119 * Buttons can be used as a controller axis and vice versa.
120 *
121 * This string shows an example of a valid mapping for a controller
122 * "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",
123 *
124 */
125
126 /**
127 * Load a set of mappings from a seekable SDL data stream (memory or file), filtered by the current SDL_GetPlatform()
128 * A community sourced database of controllers is available at https://raw.github.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt
129 *
130 * If \c freerw is non-zero, the stream will be closed after being read.
131 *
132 * \return number of mappings added, -1 on error
133 */
134 extern DECLSPEC int SDLCALL SDL_GameControllerAddMappingsFromRW(SDL_RWops * rw, int freerw);
135
136 /**
137 * Load a set of mappings from a file, filtered by the current SDL_GetPlatform()
138 *
139 * Convenience macro.
140 */
141 #define SDL_GameControllerAddMappingsFromFile(file) SDL_GameControllerAddMappingsFromRW(SDL_RWFromFile(file, "rb"), 1)
142
143 /**
144 * Add or update an existing mapping configuration
145 *
146 * \return 1 if mapping is added, 0 if updated, -1 on error
147 */
148 extern DECLSPEC int SDLCALL SDL_GameControllerAddMapping(const char* mappingString);
149
150 /**
151 * Get the number of mappings installed
152 *
153 * \return the number of mappings
154 */
155 extern DECLSPEC int SDLCALL SDL_GameControllerNumMappings(void);
156
157 /**
158 * Get the mapping at a particular index.
159 *
160 * \return the mapping string. Must be freed with SDL_free(). Returns NULL if the index is out of range.
161 */
162 extern DECLSPEC char * SDLCALL SDL_GameControllerMappingForIndex(int mapping_index);
163
164 /**
165 * Get a mapping string for a GUID
166 *
167 * \return the mapping string. Must be freed with SDL_free(). Returns NULL if no mapping is available
168 */
169 extern DECLSPEC char * SDLCALL SDL_GameControllerMappingForGUID(SDL_JoystickGUID guid);
170
171 /**
172 * Get a mapping string for an open GameController
173 *
174 * \return the mapping string. Must be freed with SDL_free(). Returns NULL if no mapping is available
175 */
176 extern DECLSPEC char * SDLCALL SDL_GameControllerMapping(SDL_GameController *gamecontroller);
177
178 /**
179 * Is the joystick on this index supported by the game controller interface?
180 */
181 extern DECLSPEC SDL_bool SDLCALL SDL_IsGameController(int joystick_index);
182
183 /**
184 * Get the implementation dependent name of a game controller.
185 * This can be called before any controllers are opened.
186 * If no name can be found, this function returns NULL.
187 */
188 extern DECLSPEC const char *SDLCALL SDL_GameControllerNameForIndex(int joystick_index);
189
190 /**
191 * Get the type of a game controller.
192 * This can be called before any controllers are opened.
193 */
194 extern DECLSPEC SDL_GameControllerType SDLCALL SDL_GameControllerTypeForIndex(int joystick_index);
195
196 /**
197 * Get the mapping of a game controller.
198 * This can be called before any controllers are opened.
199 *
200 * \return the mapping string. Must be freed with SDL_free(). Returns NULL if no mapping is available
201 */
202 extern DECLSPEC char *SDLCALL SDL_GameControllerMappingForDeviceIndex(int joystick_index);
203
204 /**
205 * Open a game controller for use.
206 * The index passed as an argument refers to the N'th game controller on the system.
207 * This index is not the value which will identify this controller in future
208 * controller events. The joystick's instance id (::SDL_JoystickID) will be
209 * used there instead.
210 *
211 * \return A controller identifier, or NULL if an error occurred.
212 */
213 extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerOpen(int joystick_index);
214
215 /**
216 * Return the SDL_GameController associated with an instance id.
217 */
218 extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromInstanceID(SDL_JoystickID joyid);
219
220 /**
221 * Return the SDL_GameController associated with a player index.
222 */
223 extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromPlayerIndex(int player_index);
224
225 /**
226 * Return the name for this currently opened controller
227 */
228 extern DECLSPEC const char *SDLCALL SDL_GameControllerName(SDL_GameController *gamecontroller);
229
230 /**
231 * Return the type of this currently opened controller
232 */
233 extern DECLSPEC SDL_GameControllerType SDLCALL SDL_GameControllerGetType(SDL_GameController *gamecontroller);
234
235 /**
236 * Get the player index of an opened game controller, or -1 if it's not available
237 *
238 * For XInput controllers this returns the XInput user index.
239 */
240 extern DECLSPEC int SDLCALL SDL_GameControllerGetPlayerIndex(SDL_GameController *gamecontroller);
241
242 /**
243 * Set the player index of an opened game controller
244 */
245 extern DECLSPEC void SDLCALL SDL_GameControllerSetPlayerIndex(SDL_GameController *gamecontroller, int player_index);
246
247 /**
248 * Get the USB vendor ID of an opened controller, if available.
249 * If the vendor ID isn't available this function returns 0.
250 */
251 extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetVendor(SDL_GameController *gamecontroller);
252
253 /**
254 * Get the USB product ID of an opened controller, if available.
255 * If the product ID isn't available this function returns 0.
256 */
257 extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProduct(SDL_GameController *gamecontroller);
258
259 /**
260 * Get the product version of an opened controller, if available.
261 * If the product version isn't available this function returns 0.
262 */
263 extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProductVersion(SDL_GameController *gamecontroller);
264
265 /**
266 * Get the serial number of an opened controller, if available.
267 *
268 * Returns the serial number of the controller, or NULL if it is not available.
269 */
270 extern DECLSPEC const char * SDLCALL SDL_GameControllerGetSerial(SDL_GameController *gamecontroller);
271
272 /**
273 * Returns SDL_TRUE if the controller has been opened and currently connected,
274 * or SDL_FALSE if it has not.
275 */
276 extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerGetAttached(SDL_GameController *gamecontroller);
277
278 /**
279 * Get the underlying joystick object used by a controller
280 */
281 extern DECLSPEC SDL_Joystick *SDLCALL SDL_GameControllerGetJoystick(SDL_GameController *gamecontroller);
282
283 /**
284 * Enable/disable controller event polling.
285 *
286 * If controller events are disabled, you must call SDL_GameControllerUpdate()
287 * yourself and check the state of the controller when you want controller
288 * information.
289 *
290 * The state can be one of ::SDL_QUERY, ::SDL_ENABLE or ::SDL_IGNORE.
291 */
292 extern DECLSPEC int SDLCALL SDL_GameControllerEventState(int state);
293
294 /**
295 * Update the current state of the open game controllers.
296 *
297 * This is called automatically by the event loop if any game controller
298 * events are enabled.
299 */
300 extern DECLSPEC void SDLCALL SDL_GameControllerUpdate(void);
301
302
303 /**
304 * The list of axes available from a controller
305 *
306 * Thumbstick axis values range from SDL_JOYSTICK_AXIS_MIN to SDL_JOYSTICK_AXIS_MAX,
307 * and are centered within ~8000 of zero, though advanced UI will allow users to set
308 * or autodetect the dead zone, which varies between controllers.
309 *
310 * Trigger axis values range from 0 to SDL_JOYSTICK_AXIS_MAX.
311 */
312 typedef enum
313 {
314 SDL_CONTROLLER_AXIS_INVALID = -1,
315 SDL_CONTROLLER_AXIS_LEFTX,
316 SDL_CONTROLLER_AXIS_LEFTY,
317 SDL_CONTROLLER_AXIS_RIGHTX,
318 SDL_CONTROLLER_AXIS_RIGHTY,
319 SDL_CONTROLLER_AXIS_TRIGGERLEFT,
320 SDL_CONTROLLER_AXIS_TRIGGERRIGHT,
321 SDL_CONTROLLER_AXIS_MAX
322 } SDL_GameControllerAxis;
323
324 /**
325 * turn this string into a axis mapping
326 */
327 extern DECLSPEC SDL_GameControllerAxis SDLCALL SDL_GameControllerGetAxisFromString(const char *pchString);
328
329 /**
330 * turn this axis enum into a string mapping
331 */
332 extern DECLSPEC const char* SDLCALL SDL_GameControllerGetStringForAxis(SDL_GameControllerAxis axis);
333
334 /**
335 * Get the SDL joystick layer binding for this controller button mapping
336 */
337 extern DECLSPEC SDL_GameControllerButtonBind SDLCALL
338 SDL_GameControllerGetBindForAxis(SDL_GameController *gamecontroller,
339 SDL_GameControllerAxis axis);
340
341 /**
342 * Return whether a game controller has a given axis
343 */
344 extern DECLSPEC SDL_bool SDLCALL
345 SDL_GameControllerHasAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis);
346
347 /**
348 * Get the current state of an axis control on a game controller.
349 *
350 * The state is a value ranging from -32768 to 32767 (except for the triggers,
351 * which range from 0 to 32767).
352 *
353 * The axis indices start at index 0.
354 */
355 extern DECLSPEC Sint16 SDLCALL
356 SDL_GameControllerGetAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis);
357
358 /**
359 * The list of buttons available from a controller
360 */
361 typedef enum
362 {
363 SDL_CONTROLLER_BUTTON_INVALID = -1,
364 SDL_CONTROLLER_BUTTON_A,
365 SDL_CONTROLLER_BUTTON_B,
366 SDL_CONTROLLER_BUTTON_X,
367 SDL_CONTROLLER_BUTTON_Y,
368 SDL_CONTROLLER_BUTTON_BACK,
369 SDL_CONTROLLER_BUTTON_GUIDE,
370 SDL_CONTROLLER_BUTTON_START,
371 SDL_CONTROLLER_BUTTON_LEFTSTICK,
372 SDL_CONTROLLER_BUTTON_RIGHTSTICK,
373 SDL_CONTROLLER_BUTTON_LEFTSHOULDER,
374 SDL_CONTROLLER_BUTTON_RIGHTSHOULDER,
375 SDL_CONTROLLER_BUTTON_DPAD_UP,
376 SDL_CONTROLLER_BUTTON_DPAD_DOWN,
377 SDL_CONTROLLER_BUTTON_DPAD_LEFT,
378 SDL_CONTROLLER_BUTTON_DPAD_RIGHT,
379 SDL_CONTROLLER_BUTTON_MISC1, /* Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button */
380 SDL_CONTROLLER_BUTTON_PADDLE1, /* Xbox Elite paddle P1 */
381 SDL_CONTROLLER_BUTTON_PADDLE2, /* Xbox Elite paddle P3 */
382 SDL_CONTROLLER_BUTTON_PADDLE3, /* Xbox Elite paddle P2 */
383 SDL_CONTROLLER_BUTTON_PADDLE4, /* Xbox Elite paddle P4 */
384 SDL_CONTROLLER_BUTTON_TOUCHPAD, /* PS4/PS5 touchpad button */
385 SDL_CONTROLLER_BUTTON_MAX
386 } SDL_GameControllerButton;
387
388 /**
389 * turn this string into a button mapping
390 */
391 extern DECLSPEC SDL_GameControllerButton SDLCALL SDL_GameControllerGetButtonFromString(const char *pchString);
392
393 /**
394 * turn this button enum into a string mapping
395 */
396 extern DECLSPEC const char* SDLCALL SDL_GameControllerGetStringForButton(SDL_GameControllerButton button);
397
398 /**
399 * Get the SDL joystick layer binding for this controller button mapping
400 */
401 extern DECLSPEC SDL_GameControllerButtonBind SDLCALL
402 SDL_GameControllerGetBindForButton(SDL_GameController *gamecontroller,
403 SDL_GameControllerButton button);
404
405 /**
406 * Return whether a game controller has a given button
407 */
408 extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasButton(SDL_GameController *gamecontroller,
409 SDL_GameControllerButton button);
410
411 /**
412 * Get the current state of a button on a game controller.
413 *
414 * The button indices start at index 0.
415 */
416 extern DECLSPEC Uint8 SDLCALL SDL_GameControllerGetButton(SDL_GameController *gamecontroller,
417 SDL_GameControllerButton button);
418
419 /**
420 * Get the number of touchpads on a game controller.
421 */
422 extern DECLSPEC int SDLCALL SDL_GameControllerGetNumTouchpads(SDL_GameController *gamecontroller);
423
424 /**
425 * Get the number of supported simultaneous fingers on a touchpad on a game controller.
426 */
427 extern DECLSPEC int SDLCALL SDL_GameControllerGetNumTouchpadFingers(SDL_GameController *gamecontroller, int touchpad);
428
429 /**
430 * Get the current state of a finger on a touchpad on a game controller.
431 */
432 extern DECLSPEC int SDLCALL SDL_GameControllerGetTouchpadFinger(SDL_GameController *gamecontroller, int touchpad, int finger, Uint8 *state, float *x, float *y, float *pressure);
433
434 /**
435 * Return whether a game controller has a particular sensor.
436 *
437 * \param gamecontroller The controller to query
438 * \param type The type of sensor to query
439 *
440 * \return SDL_TRUE if the sensor exists, SDL_FALSE otherwise.
441 */
442 extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasSensor(SDL_GameController *gamecontroller, SDL_SensorType type);
443
444 /**
445 * Set whether data reporting for a game controller sensor is enabled
446 *
447 * \param gamecontroller The controller to update
448 * \param type The type of sensor to enable/disable
449 * \param enabled Whether data reporting should be enabled
450 *
451 * \return 0 or -1 if an error occurred.
452 */
453 extern DECLSPEC int SDLCALL SDL_GameControllerSetSensorEnabled(SDL_GameController *gamecontroller, SDL_SensorType type, SDL_bool enabled);
454
455 /**
456 * Query whether sensor data reporting is enabled for a game controller
457 *
458 * \param gamecontroller The controller to query
459 * \param type The type of sensor to query
460 *
461 * \return SDL_TRUE if the sensor is enabled, SDL_FALSE otherwise.
462 */
463 extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerIsSensorEnabled(SDL_GameController *gamecontroller, SDL_SensorType type);
464
465 /**
466 * Get the current state of a game controller sensor.
467 *
468 * The number of values and interpretation of the data is sensor dependent.
469 * See SDL_sensor.h for the details for each type of sensor.
470 *
471 * \param gamecontroller The controller to query
472 * \param type The type of sensor to query
473 * \param data A pointer filled with the current sensor state
474 * \param num_values The number of values to write to data
475 *
476 * \return 0 or -1 if an error occurred.
477 */
478 extern DECLSPEC int SDLCALL SDL_GameControllerGetSensorData(SDL_GameController *gamecontroller, SDL_SensorType type, float *data, int num_values);
479
480 /**
481 * Start a rumble effect
482 * Each call to this function cancels any previous rumble effect, and calling it with 0 intensity stops any rumbling.
483 *
484 * \param gamecontroller The controller to vibrate
485 * \param low_frequency_rumble The intensity of the low frequency (left) rumble motor, from 0 to 0xFFFF
486 * \param high_frequency_rumble The intensity of the high frequency (right) rumble motor, from 0 to 0xFFFF
487 * \param duration_ms The duration of the rumble effect, in milliseconds
488 *
489 * \return 0, or -1 if rumble isn't supported on this controller
490 */
491 extern DECLSPEC int SDLCALL SDL_GameControllerRumble(SDL_GameController *gamecontroller, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms);
492
493 /**
494 * Start a rumble effect in the game controller's triggers
495 * Each call to this function cancels any previous trigger rumble effect, and calling it with 0 intensity stops any rumbling.
496 *
497 * \param gamecontroller The controller to vibrate
498 * \param left_rumble The intensity of the left trigger rumble motor, from 0 to 0xFFFF
499 * \param right_rumble The intensity of the right trigger rumble motor, from 0 to 0xFFFF
500 * \param duration_ms The duration of the rumble effect, in milliseconds
501 *
502 * \return 0, or -1 if rumble isn't supported on this controller
503 */
504 extern DECLSPEC int SDLCALL SDL_GameControllerRumbleTriggers(SDL_GameController *gamecontroller, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms);
505
506 /**
507 * Return whether a controller has an LED
508 *
509 * \param gamecontroller The controller to query
510 *
511 * \return SDL_TRUE, or SDL_FALSE if this controller does not have a modifiable LED
512 */
513 extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasLED(SDL_GameController *gamecontroller);
514
515 /**
516 * Update a controller's LED color.
517 *
518 * \param gamecontroller The controller to update
519 * \param red The intensity of the red LED
520 * \param green The intensity of the green LED
521 * \param blue The intensity of the blue LED
522 *
523 * \return 0, or -1 if this controller does not have a modifiable LED
524 */
525 extern DECLSPEC int SDLCALL SDL_GameControllerSetLED(SDL_GameController *gamecontroller, Uint8 red, Uint8 green, Uint8 blue);
526
527 /**
528 * Close a controller previously opened with SDL_GameControllerOpen().
529 */
530 extern DECLSPEC void SDLCALL SDL_GameControllerClose(SDL_GameController *gamecontroller);
531
532
533 /* Ends C function definitions when using C++ */
534 #ifdef __cplusplus
535 }
536 #endif
537 #include "close_code.h"
538
539 #endif /* SDL_gamecontroller_h_ */
540
541 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_gesture.h added (mode: 100644) (index 0000000..81ed431)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_gesture.h
24 *
25 * Include file for SDL gesture event handling.
26 */
27
28 #ifndef SDL_gesture_h_
29 #define SDL_gesture_h_
30
31 #include "SDL_stdinc.h"
32 #include "SDL_error.h"
33 #include "SDL_video.h"
34
35 #include "SDL_touch.h"
36
37
38 #include "begin_code.h"
39 /* Set up for C function definitions, even when using C++ */
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43
44 typedef Sint64 SDL_GestureID;
45
46 /* Function prototypes */
47
48 /**
49 * \brief Begin Recording a gesture on the specified touch, or all touches (-1)
50 *
51 *
52 */
53 extern DECLSPEC int SDLCALL SDL_RecordGesture(SDL_TouchID touchId);
54
55
56 /**
57 * \brief Save all currently loaded Dollar Gesture templates
58 *
59 *
60 */
61 extern DECLSPEC int SDLCALL SDL_SaveAllDollarTemplates(SDL_RWops *dst);
62
63 /**
64 * \brief Save a currently loaded Dollar Gesture template
65 *
66 *
67 */
68 extern DECLSPEC int SDLCALL SDL_SaveDollarTemplate(SDL_GestureID gestureId,SDL_RWops *dst);
69
70
71 /**
72 * \brief Load Dollar Gesture templates from a file
73 *
74 *
75 */
76 extern DECLSPEC int SDLCALL SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src);
77
78
79 /* Ends C function definitions when using C++ */
80 #ifdef __cplusplus
81 }
82 #endif
83 #include "close_code.h"
84
85 #endif /* SDL_gesture_h_ */
86
87 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_haptic.h added (mode: 100644) (index 0000000..c27da11)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_haptic.h
24 *
25 * \brief The SDL haptic subsystem allows you to control haptic (force feedback)
26 * devices.
27 *
28 * The basic usage is as follows:
29 * - Initialize the subsystem (::SDL_INIT_HAPTIC).
30 * - Open a haptic device.
31 * - SDL_HapticOpen() to open from index.
32 * - SDL_HapticOpenFromJoystick() to open from an existing joystick.
33 * - Create an effect (::SDL_HapticEffect).
34 * - Upload the effect with SDL_HapticNewEffect().
35 * - Run the effect with SDL_HapticRunEffect().
36 * - (optional) Free the effect with SDL_HapticDestroyEffect().
37 * - Close the haptic device with SDL_HapticClose().
38 *
39 * \par Simple rumble example:
40 * \code
41 * SDL_Haptic *haptic;
42 *
43 * // Open the device
44 * haptic = SDL_HapticOpen( 0 );
45 * if (haptic == NULL)
46 * return -1;
47 *
48 * // Initialize simple rumble
49 * if (SDL_HapticRumbleInit( haptic ) != 0)
50 * return -1;
51 *
52 * // Play effect at 50% strength for 2 seconds
53 * if (SDL_HapticRumblePlay( haptic, 0.5, 2000 ) != 0)
54 * return -1;
55 * SDL_Delay( 2000 );
56 *
57 * // Clean up
58 * SDL_HapticClose( haptic );
59 * \endcode
60 *
61 * \par Complete example:
62 * \code
63 * int test_haptic( SDL_Joystick * joystick ) {
64 * SDL_Haptic *haptic;
65 * SDL_HapticEffect effect;
66 * int effect_id;
67 *
68 * // Open the device
69 * haptic = SDL_HapticOpenFromJoystick( joystick );
70 * if (haptic == NULL) return -1; // Most likely joystick isn't haptic
71 *
72 * // See if it can do sine waves
73 * if ((SDL_HapticQuery(haptic) & SDL_HAPTIC_SINE)==0) {
74 * SDL_HapticClose(haptic); // No sine effect
75 * return -1;
76 * }
77 *
78 * // Create the effect
79 * memset( &effect, 0, sizeof(SDL_HapticEffect) ); // 0 is safe default
80 * effect.type = SDL_HAPTIC_SINE;
81 * effect.periodic.direction.type = SDL_HAPTIC_POLAR; // Polar coordinates
82 * effect.periodic.direction.dir[0] = 18000; // Force comes from south
83 * effect.periodic.period = 1000; // 1000 ms
84 * effect.periodic.magnitude = 20000; // 20000/32767 strength
85 * effect.periodic.length = 5000; // 5 seconds long
86 * effect.periodic.attack_length = 1000; // Takes 1 second to get max strength
87 * effect.periodic.fade_length = 1000; // Takes 1 second to fade away
88 *
89 * // Upload the effect
90 * effect_id = SDL_HapticNewEffect( haptic, &effect );
91 *
92 * // Test the effect
93 * SDL_HapticRunEffect( haptic, effect_id, 1 );
94 * SDL_Delay( 5000); // Wait for the effect to finish
95 *
96 * // We destroy the effect, although closing the device also does this
97 * SDL_HapticDestroyEffect( haptic, effect_id );
98 *
99 * // Close the device
100 * SDL_HapticClose(haptic);
101 *
102 * return 0; // Success
103 * }
104 * \endcode
105 */
106
107 #ifndef SDL_haptic_h_
108 #define SDL_haptic_h_
109
110 #include "SDL_stdinc.h"
111 #include "SDL_error.h"
112 #include "SDL_joystick.h"
113
114 #include "begin_code.h"
115 /* Set up for C function definitions, even when using C++ */
116 #ifdef __cplusplus
117 extern "C" {
118 #endif /* __cplusplus */
119
120 /* FIXME: For SDL 2.1, adjust all the magnitude variables to be Uint16 (0xFFFF).
121 *
122 * At the moment the magnitude variables are mixed between signed/unsigned, and
123 * it is also not made clear that ALL of those variables expect a max of 0x7FFF.
124 *
125 * Some platforms may have higher precision than that (Linux FF, Windows XInput)
126 * so we should fix the inconsistency in favor of higher possible precision,
127 * adjusting for platforms that use different scales.
128 * -flibit
129 */
130
131 /**
132 * \typedef SDL_Haptic
133 *
134 * \brief The haptic structure used to identify an SDL haptic.
135 *
136 * \sa SDL_HapticOpen
137 * \sa SDL_HapticOpenFromJoystick
138 * \sa SDL_HapticClose
139 */
140 struct _SDL_Haptic;
141 typedef struct _SDL_Haptic SDL_Haptic;
142
143
144 /**
145 * \name Haptic features
146 *
147 * Different haptic features a device can have.
148 */
149 /* @{ */
150
151 /**
152 * \name Haptic effects
153 */
154 /* @{ */
155
156 /**
157 * \brief Constant effect supported.
158 *
159 * Constant haptic effect.
160 *
161 * \sa SDL_HapticCondition
162 */
163 #define SDL_HAPTIC_CONSTANT (1u<<0)
164
165 /**
166 * \brief Sine wave effect supported.
167 *
168 * Periodic haptic effect that simulates sine waves.
169 *
170 * \sa SDL_HapticPeriodic
171 */
172 #define SDL_HAPTIC_SINE (1u<<1)
173
174 /**
175 * \brief Left/Right effect supported.
176 *
177 * Haptic effect for direct control over high/low frequency motors.
178 *
179 * \sa SDL_HapticLeftRight
180 * \warning this value was SDL_HAPTIC_SQUARE right before 2.0.0 shipped. Sorry,
181 * we ran out of bits, and this is important for XInput devices.
182 */
183 #define SDL_HAPTIC_LEFTRIGHT (1u<<2)
184
185 /* !!! FIXME: put this back when we have more bits in 2.1 */
186 /* #define SDL_HAPTIC_SQUARE (1<<2) */
187
188 /**
189 * \brief Triangle wave effect supported.
190 *
191 * Periodic haptic effect that simulates triangular waves.
192 *
193 * \sa SDL_HapticPeriodic
194 */
195 #define SDL_HAPTIC_TRIANGLE (1u<<3)
196
197 /**
198 * \brief Sawtoothup wave effect supported.
199 *
200 * Periodic haptic effect that simulates saw tooth up waves.
201 *
202 * \sa SDL_HapticPeriodic
203 */
204 #define SDL_HAPTIC_SAWTOOTHUP (1u<<4)
205
206 /**
207 * \brief Sawtoothdown wave effect supported.
208 *
209 * Periodic haptic effect that simulates saw tooth down waves.
210 *
211 * \sa SDL_HapticPeriodic
212 */
213 #define SDL_HAPTIC_SAWTOOTHDOWN (1u<<5)
214
215 /**
216 * \brief Ramp effect supported.
217 *
218 * Ramp haptic effect.
219 *
220 * \sa SDL_HapticRamp
221 */
222 #define SDL_HAPTIC_RAMP (1u<<6)
223
224 /**
225 * \brief Spring effect supported - uses axes position.
226 *
227 * Condition haptic effect that simulates a spring. Effect is based on the
228 * axes position.
229 *
230 * \sa SDL_HapticCondition
231 */
232 #define SDL_HAPTIC_SPRING (1u<<7)
233
234 /**
235 * \brief Damper effect supported - uses axes velocity.
236 *
237 * Condition haptic effect that simulates dampening. Effect is based on the
238 * axes velocity.
239 *
240 * \sa SDL_HapticCondition
241 */
242 #define SDL_HAPTIC_DAMPER (1u<<8)
243
244 /**
245 * \brief Inertia effect supported - uses axes acceleration.
246 *
247 * Condition haptic effect that simulates inertia. Effect is based on the axes
248 * acceleration.
249 *
250 * \sa SDL_HapticCondition
251 */
252 #define SDL_HAPTIC_INERTIA (1u<<9)
253
254 /**
255 * \brief Friction effect supported - uses axes movement.
256 *
257 * Condition haptic effect that simulates friction. Effect is based on the
258 * axes movement.
259 *
260 * \sa SDL_HapticCondition
261 */
262 #define SDL_HAPTIC_FRICTION (1u<<10)
263
264 /**
265 * \brief Custom effect is supported.
266 *
267 * User defined custom haptic effect.
268 */
269 #define SDL_HAPTIC_CUSTOM (1u<<11)
270
271 /* @} *//* Haptic effects */
272
273 /* These last few are features the device has, not effects */
274
275 /**
276 * \brief Device can set global gain.
277 *
278 * Device supports setting the global gain.
279 *
280 * \sa SDL_HapticSetGain
281 */
282 #define SDL_HAPTIC_GAIN (1u<<12)
283
284 /**
285 * \brief Device can set autocenter.
286 *
287 * Device supports setting autocenter.
288 *
289 * \sa SDL_HapticSetAutocenter
290 */
291 #define SDL_HAPTIC_AUTOCENTER (1u<<13)
292
293 /**
294 * \brief Device can be queried for effect status.
295 *
296 * Device supports querying effect status.
297 *
298 * \sa SDL_HapticGetEffectStatus
299 */
300 #define SDL_HAPTIC_STATUS (1u<<14)
301
302 /**
303 * \brief Device can be paused.
304 *
305 * Devices supports being paused.
306 *
307 * \sa SDL_HapticPause
308 * \sa SDL_HapticUnpause
309 */
310 #define SDL_HAPTIC_PAUSE (1u<<15)
311
312
313 /**
314 * \name Direction encodings
315 */
316 /* @{ */
317
318 /**
319 * \brief Uses polar coordinates for the direction.
320 *
321 * \sa SDL_HapticDirection
322 */
323 #define SDL_HAPTIC_POLAR 0
324
325 /**
326 * \brief Uses cartesian coordinates for the direction.
327 *
328 * \sa SDL_HapticDirection
329 */
330 #define SDL_HAPTIC_CARTESIAN 1
331
332 /**
333 * \brief Uses spherical coordinates for the direction.
334 *
335 * \sa SDL_HapticDirection
336 */
337 #define SDL_HAPTIC_SPHERICAL 2
338
339 /**
340 * \brief Use this value to play an effect on the steering wheel axis. This
341 * provides better compatibility across platforms and devices as SDL will guess
342 * the correct axis.
343 * \sa SDL_HapticDirection
344 */
345 #define SDL_HAPTIC_STEERING_AXIS 3
346
347 /* @} *//* Direction encodings */
348
349 /* @} *//* Haptic features */
350
351 /*
352 * Misc defines.
353 */
354
355 /**
356 * \brief Used to play a device an infinite number of times.
357 *
358 * \sa SDL_HapticRunEffect
359 */
360 #define SDL_HAPTIC_INFINITY 4294967295U
361
362
363 /**
364 * \brief Structure that represents a haptic direction.
365 *
366 * This is the direction where the force comes from,
367 * instead of the direction in which the force is exerted.
368 *
369 * Directions can be specified by:
370 * - ::SDL_HAPTIC_POLAR : Specified by polar coordinates.
371 * - ::SDL_HAPTIC_CARTESIAN : Specified by cartesian coordinates.
372 * - ::SDL_HAPTIC_SPHERICAL : Specified by spherical coordinates.
373 *
374 * Cardinal directions of the haptic device are relative to the positioning
375 * of the device. North is considered to be away from the user.
376 *
377 * The following diagram represents the cardinal directions:
378 * \verbatim
379 .--.
380 |__| .-------.
381 |=.| |.-----.|
382 |--| || ||
383 | | |'-----'|
384 |__|~')_____('
385 [ COMPUTER ]
386
387
388 North (0,-1)
389 ^
390 |
391 |
392 (-1,0) West <----[ HAPTIC ]----> East (1,0)
393 |
394 |
395 v
396 South (0,1)
397
398
399 [ USER ]
400 \|||/
401 (o o)
402 ---ooO-(_)-Ooo---
403 \endverbatim
404 *
405 * If type is ::SDL_HAPTIC_POLAR, direction is encoded by hundredths of a
406 * degree starting north and turning clockwise. ::SDL_HAPTIC_POLAR only uses
407 * the first \c dir parameter. The cardinal directions would be:
408 * - North: 0 (0 degrees)
409 * - East: 9000 (90 degrees)
410 * - South: 18000 (180 degrees)
411 * - West: 27000 (270 degrees)
412 *
413 * If type is ::SDL_HAPTIC_CARTESIAN, direction is encoded by three positions
414 * (X axis, Y axis and Z axis (with 3 axes)). ::SDL_HAPTIC_CARTESIAN uses
415 * the first three \c dir parameters. The cardinal directions would be:
416 * - North: 0,-1, 0
417 * - East: 1, 0, 0
418 * - South: 0, 1, 0
419 * - West: -1, 0, 0
420 *
421 * The Z axis represents the height of the effect if supported, otherwise
422 * it's unused. In cartesian encoding (1, 2) would be the same as (2, 4), you
423 * can use any multiple you want, only the direction matters.
424 *
425 * If type is ::SDL_HAPTIC_SPHERICAL, direction is encoded by two rotations.
426 * The first two \c dir parameters are used. The \c dir parameters are as
427 * follows (all values are in hundredths of degrees):
428 * - Degrees from (1, 0) rotated towards (0, 1).
429 * - Degrees towards (0, 0, 1) (device needs at least 3 axes).
430 *
431 *
432 * Example of force coming from the south with all encodings (force coming
433 * from the south means the user will have to pull the stick to counteract):
434 * \code
435 * SDL_HapticDirection direction;
436 *
437 * // Cartesian directions
438 * direction.type = SDL_HAPTIC_CARTESIAN; // Using cartesian direction encoding.
439 * direction.dir[0] = 0; // X position
440 * direction.dir[1] = 1; // Y position
441 * // Assuming the device has 2 axes, we don't need to specify third parameter.
442 *
443 * // Polar directions
444 * direction.type = SDL_HAPTIC_POLAR; // We'll be using polar direction encoding.
445 * direction.dir[0] = 18000; // Polar only uses first parameter
446 *
447 * // Spherical coordinates
448 * direction.type = SDL_HAPTIC_SPHERICAL; // Spherical encoding
449 * direction.dir[0] = 9000; // Since we only have two axes we don't need more parameters.
450 * \endcode
451 *
452 * \sa SDL_HAPTIC_POLAR
453 * \sa SDL_HAPTIC_CARTESIAN
454 * \sa SDL_HAPTIC_SPHERICAL
455 * \sa SDL_HAPTIC_STEERING_AXIS
456 * \sa SDL_HapticEffect
457 * \sa SDL_HapticNumAxes
458 */
459 typedef struct SDL_HapticDirection
460 {
461 Uint8 type; /**< The type of encoding. */
462 Sint32 dir[3]; /**< The encoded direction. */
463 } SDL_HapticDirection;
464
465
466 /**
467 * \brief A structure containing a template for a Constant effect.
468 *
469 * This struct is exclusively for the ::SDL_HAPTIC_CONSTANT effect.
470 *
471 * A constant effect applies a constant force in the specified direction
472 * to the joystick.
473 *
474 * \sa SDL_HAPTIC_CONSTANT
475 * \sa SDL_HapticEffect
476 */
477 typedef struct SDL_HapticConstant
478 {
479 /* Header */
480 Uint16 type; /**< ::SDL_HAPTIC_CONSTANT */
481 SDL_HapticDirection direction; /**< Direction of the effect. */
482
483 /* Replay */
484 Uint32 length; /**< Duration of the effect. */
485 Uint16 delay; /**< Delay before starting the effect. */
486
487 /* Trigger */
488 Uint16 button; /**< Button that triggers the effect. */
489 Uint16 interval; /**< How soon it can be triggered again after button. */
490
491 /* Constant */
492 Sint16 level; /**< Strength of the constant effect. */
493
494 /* Envelope */
495 Uint16 attack_length; /**< Duration of the attack. */
496 Uint16 attack_level; /**< Level at the start of the attack. */
497 Uint16 fade_length; /**< Duration of the fade. */
498 Uint16 fade_level; /**< Level at the end of the fade. */
499 } SDL_HapticConstant;
500
501 /**
502 * \brief A structure containing a template for a Periodic effect.
503 *
504 * The struct handles the following effects:
505 * - ::SDL_HAPTIC_SINE
506 * - ::SDL_HAPTIC_LEFTRIGHT
507 * - ::SDL_HAPTIC_TRIANGLE
508 * - ::SDL_HAPTIC_SAWTOOTHUP
509 * - ::SDL_HAPTIC_SAWTOOTHDOWN
510 *
511 * A periodic effect consists in a wave-shaped effect that repeats itself
512 * over time. The type determines the shape of the wave and the parameters
513 * determine the dimensions of the wave.
514 *
515 * Phase is given by hundredth of a degree meaning that giving the phase a value
516 * of 9000 will displace it 25% of its period. Here are sample values:
517 * - 0: No phase displacement.
518 * - 9000: Displaced 25% of its period.
519 * - 18000: Displaced 50% of its period.
520 * - 27000: Displaced 75% of its period.
521 * - 36000: Displaced 100% of its period, same as 0, but 0 is preferred.
522 *
523 * Examples:
524 * \verbatim
525 SDL_HAPTIC_SINE
526 __ __ __ __
527 / \ / \ / \ /
528 / \__/ \__/ \__/
529
530 SDL_HAPTIC_SQUARE
531 __ __ __ __ __
532 | | | | | | | | | |
533 | |__| |__| |__| |__| |
534
535 SDL_HAPTIC_TRIANGLE
536 /\ /\ /\ /\ /\
537 / \ / \ / \ / \ /
538 / \/ \/ \/ \/
539
540 SDL_HAPTIC_SAWTOOTHUP
541 /| /| /| /| /| /| /|
542 / | / | / | / | / | / | / |
543 / |/ |/ |/ |/ |/ |/ |
544
545 SDL_HAPTIC_SAWTOOTHDOWN
546 \ |\ |\ |\ |\ |\ |\ |
547 \ | \ | \ | \ | \ | \ | \ |
548 \| \| \| \| \| \| \|
549 \endverbatim
550 *
551 * \sa SDL_HAPTIC_SINE
552 * \sa SDL_HAPTIC_LEFTRIGHT
553 * \sa SDL_HAPTIC_TRIANGLE
554 * \sa SDL_HAPTIC_SAWTOOTHUP
555 * \sa SDL_HAPTIC_SAWTOOTHDOWN
556 * \sa SDL_HapticEffect
557 */
558 typedef struct SDL_HapticPeriodic
559 {
560 /* Header */
561 Uint16 type; /**< ::SDL_HAPTIC_SINE, ::SDL_HAPTIC_LEFTRIGHT,
562 ::SDL_HAPTIC_TRIANGLE, ::SDL_HAPTIC_SAWTOOTHUP or
563 ::SDL_HAPTIC_SAWTOOTHDOWN */
564 SDL_HapticDirection direction; /**< Direction of the effect. */
565
566 /* Replay */
567 Uint32 length; /**< Duration of the effect. */
568 Uint16 delay; /**< Delay before starting the effect. */
569
570 /* Trigger */
571 Uint16 button; /**< Button that triggers the effect. */
572 Uint16 interval; /**< How soon it can be triggered again after button. */
573
574 /* Periodic */
575 Uint16 period; /**< Period of the wave. */
576 Sint16 magnitude; /**< Peak value; if negative, equivalent to 180 degrees extra phase shift. */
577 Sint16 offset; /**< Mean value of the wave. */
578 Uint16 phase; /**< Positive phase shift given by hundredth of a degree. */
579
580 /* Envelope */
581 Uint16 attack_length; /**< Duration of the attack. */
582 Uint16 attack_level; /**< Level at the start of the attack. */
583 Uint16 fade_length; /**< Duration of the fade. */
584 Uint16 fade_level; /**< Level at the end of the fade. */
585 } SDL_HapticPeriodic;
586
587 /**
588 * \brief A structure containing a template for a Condition effect.
589 *
590 * The struct handles the following effects:
591 * - ::SDL_HAPTIC_SPRING: Effect based on axes position.
592 * - ::SDL_HAPTIC_DAMPER: Effect based on axes velocity.
593 * - ::SDL_HAPTIC_INERTIA: Effect based on axes acceleration.
594 * - ::SDL_HAPTIC_FRICTION: Effect based on axes movement.
595 *
596 * Direction is handled by condition internals instead of a direction member.
597 * The condition effect specific members have three parameters. The first
598 * refers to the X axis, the second refers to the Y axis and the third
599 * refers to the Z axis. The right terms refer to the positive side of the
600 * axis and the left terms refer to the negative side of the axis. Please
601 * refer to the ::SDL_HapticDirection diagram for which side is positive and
602 * which is negative.
603 *
604 * \sa SDL_HapticDirection
605 * \sa SDL_HAPTIC_SPRING
606 * \sa SDL_HAPTIC_DAMPER
607 * \sa SDL_HAPTIC_INERTIA
608 * \sa SDL_HAPTIC_FRICTION
609 * \sa SDL_HapticEffect
610 */
611 typedef struct SDL_HapticCondition
612 {
613 /* Header */
614 Uint16 type; /**< ::SDL_HAPTIC_SPRING, ::SDL_HAPTIC_DAMPER,
615 ::SDL_HAPTIC_INERTIA or ::SDL_HAPTIC_FRICTION */
616 SDL_HapticDirection direction; /**< Direction of the effect - Not used ATM. */
617
618 /* Replay */
619 Uint32 length; /**< Duration of the effect. */
620 Uint16 delay; /**< Delay before starting the effect. */
621
622 /* Trigger */
623 Uint16 button; /**< Button that triggers the effect. */
624 Uint16 interval; /**< How soon it can be triggered again after button. */
625
626 /* Condition */
627 Uint16 right_sat[3]; /**< Level when joystick is to the positive side; max 0xFFFF. */
628 Uint16 left_sat[3]; /**< Level when joystick is to the negative side; max 0xFFFF. */
629 Sint16 right_coeff[3]; /**< How fast to increase the force towards the positive side. */
630 Sint16 left_coeff[3]; /**< How fast to increase the force towards the negative side. */
631 Uint16 deadband[3]; /**< Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered. */
632 Sint16 center[3]; /**< Position of the dead zone. */
633 } SDL_HapticCondition;
634
635 /**
636 * \brief A structure containing a template for a Ramp effect.
637 *
638 * This struct is exclusively for the ::SDL_HAPTIC_RAMP effect.
639 *
640 * The ramp effect starts at start strength and ends at end strength.
641 * It augments in linear fashion. If you use attack and fade with a ramp
642 * the effects get added to the ramp effect making the effect become
643 * quadratic instead of linear.
644 *
645 * \sa SDL_HAPTIC_RAMP
646 * \sa SDL_HapticEffect
647 */
648 typedef struct SDL_HapticRamp
649 {
650 /* Header */
651 Uint16 type; /**< ::SDL_HAPTIC_RAMP */
652 SDL_HapticDirection direction; /**< Direction of the effect. */
653
654 /* Replay */
655 Uint32 length; /**< Duration of the effect. */
656 Uint16 delay; /**< Delay before starting the effect. */
657
658 /* Trigger */
659 Uint16 button; /**< Button that triggers the effect. */
660 Uint16 interval; /**< How soon it can be triggered again after button. */
661
662 /* Ramp */
663 Sint16 start; /**< Beginning strength level. */
664 Sint16 end; /**< Ending strength level. */
665
666 /* Envelope */
667 Uint16 attack_length; /**< Duration of the attack. */
668 Uint16 attack_level; /**< Level at the start of the attack. */
669 Uint16 fade_length; /**< Duration of the fade. */
670 Uint16 fade_level; /**< Level at the end of the fade. */
671 } SDL_HapticRamp;
672
673 /**
674 * \brief A structure containing a template for a Left/Right effect.
675 *
676 * This struct is exclusively for the ::SDL_HAPTIC_LEFTRIGHT effect.
677 *
678 * The Left/Right effect is used to explicitly control the large and small
679 * motors, commonly found in modern game controllers. The small (right) motor
680 * is high frequency, and the large (left) motor is low frequency.
681 *
682 * \sa SDL_HAPTIC_LEFTRIGHT
683 * \sa SDL_HapticEffect
684 */
685 typedef struct SDL_HapticLeftRight
686 {
687 /* Header */
688 Uint16 type; /**< ::SDL_HAPTIC_LEFTRIGHT */
689
690 /* Replay */
691 Uint32 length; /**< Duration of the effect in milliseconds. */
692
693 /* Rumble */
694 Uint16 large_magnitude; /**< Control of the large controller motor. */
695 Uint16 small_magnitude; /**< Control of the small controller motor. */
696 } SDL_HapticLeftRight;
697
698 /**
699 * \brief A structure containing a template for the ::SDL_HAPTIC_CUSTOM effect.
700 *
701 * This struct is exclusively for the ::SDL_HAPTIC_CUSTOM effect.
702 *
703 * A custom force feedback effect is much like a periodic effect, where the
704 * application can define its exact shape. You will have to allocate the
705 * data yourself. Data should consist of channels * samples Uint16 samples.
706 *
707 * If channels is one, the effect is rotated using the defined direction.
708 * Otherwise it uses the samples in data for the different axes.
709 *
710 * \sa SDL_HAPTIC_CUSTOM
711 * \sa SDL_HapticEffect
712 */
713 typedef struct SDL_HapticCustom
714 {
715 /* Header */
716 Uint16 type; /**< ::SDL_HAPTIC_CUSTOM */
717 SDL_HapticDirection direction; /**< Direction of the effect. */
718
719 /* Replay */
720 Uint32 length; /**< Duration of the effect. */
721 Uint16 delay; /**< Delay before starting the effect. */
722
723 /* Trigger */
724 Uint16 button; /**< Button that triggers the effect. */
725 Uint16 interval; /**< How soon it can be triggered again after button. */
726
727 /* Custom */
728 Uint8 channels; /**< Axes to use, minimum of one. */
729 Uint16 period; /**< Sample periods. */
730 Uint16 samples; /**< Amount of samples. */
731 Uint16 *data; /**< Should contain channels*samples items. */
732
733 /* Envelope */
734 Uint16 attack_length; /**< Duration of the attack. */
735 Uint16 attack_level; /**< Level at the start of the attack. */
736 Uint16 fade_length; /**< Duration of the fade. */
737 Uint16 fade_level; /**< Level at the end of the fade. */
738 } SDL_HapticCustom;
739
740 /**
741 * \brief The generic template for any haptic effect.
742 *
743 * All values max at 32767 (0x7FFF). Signed values also can be negative.
744 * Time values unless specified otherwise are in milliseconds.
745 *
746 * You can also pass ::SDL_HAPTIC_INFINITY to length instead of a 0-32767
747 * value. Neither delay, interval, attack_length nor fade_length support
748 * ::SDL_HAPTIC_INFINITY. Fade will also not be used since effect never ends.
749 *
750 * Additionally, the ::SDL_HAPTIC_RAMP effect does not support a duration of
751 * ::SDL_HAPTIC_INFINITY.
752 *
753 * Button triggers may not be supported on all devices, it is advised to not
754 * use them if possible. Buttons start at index 1 instead of index 0 like
755 * the joystick.
756 *
757 * If both attack_length and fade_level are 0, the envelope is not used,
758 * otherwise both values are used.
759 *
760 * Common parts:
761 * \code
762 * // Replay - All effects have this
763 * Uint32 length; // Duration of effect (ms).
764 * Uint16 delay; // Delay before starting effect.
765 *
766 * // Trigger - All effects have this
767 * Uint16 button; // Button that triggers effect.
768 * Uint16 interval; // How soon before effect can be triggered again.
769 *
770 * // Envelope - All effects except condition effects have this
771 * Uint16 attack_length; // Duration of the attack (ms).
772 * Uint16 attack_level; // Level at the start of the attack.
773 * Uint16 fade_length; // Duration of the fade out (ms).
774 * Uint16 fade_level; // Level at the end of the fade.
775 * \endcode
776 *
777 *
778 * Here we have an example of a constant effect evolution in time:
779 * \verbatim
780 Strength
781 ^
782 |
783 | effect level --> _________________
784 | / \
785 | / \
786 | / \
787 | / \
788 | attack_level --> | \
789 | | | <--- fade_level
790 |
791 +--------------------------------------------------> Time
792 [--] [---]
793 attack_length fade_length
794
795 [------------------][-----------------------]
796 delay length
797 \endverbatim
798 *
799 * Note either the attack_level or the fade_level may be above the actual
800 * effect level.
801 *
802 * \sa SDL_HapticConstant
803 * \sa SDL_HapticPeriodic
804 * \sa SDL_HapticCondition
805 * \sa SDL_HapticRamp
806 * \sa SDL_HapticLeftRight
807 * \sa SDL_HapticCustom
808 */
809 typedef union SDL_HapticEffect
810 {
811 /* Common for all force feedback effects */
812 Uint16 type; /**< Effect type. */
813 SDL_HapticConstant constant; /**< Constant effect. */
814 SDL_HapticPeriodic periodic; /**< Periodic effect. */
815 SDL_HapticCondition condition; /**< Condition effect. */
816 SDL_HapticRamp ramp; /**< Ramp effect. */
817 SDL_HapticLeftRight leftright; /**< Left/Right effect. */
818 SDL_HapticCustom custom; /**< Custom effect. */
819 } SDL_HapticEffect;
820
821
822 /* Function prototypes */
823 /**
824 * \brief Count the number of haptic devices attached to the system.
825 *
826 * \return Number of haptic devices detected on the system.
827 */
828 extern DECLSPEC int SDLCALL SDL_NumHaptics(void);
829
830 /**
831 * \brief Get the implementation dependent name of a haptic device.
832 *
833 * This can be called before any joysticks are opened.
834 * If no name can be found, this function returns NULL.
835 *
836 * \param device_index Index of the device to get its name.
837 * \return Name of the device or NULL on error.
838 *
839 * \sa SDL_NumHaptics
840 */
841 extern DECLSPEC const char *SDLCALL SDL_HapticName(int device_index);
842
843 /**
844 * \brief Opens a haptic device for use.
845 *
846 * The index passed as an argument refers to the N'th haptic device on this
847 * system.
848 *
849 * When opening a haptic device, its gain will be set to maximum and
850 * autocenter will be disabled. To modify these values use
851 * SDL_HapticSetGain() and SDL_HapticSetAutocenter().
852 *
853 * \param device_index Index of the device to open.
854 * \return Device identifier or NULL on error.
855 *
856 * \sa SDL_HapticIndex
857 * \sa SDL_HapticOpenFromMouse
858 * \sa SDL_HapticOpenFromJoystick
859 * \sa SDL_HapticClose
860 * \sa SDL_HapticSetGain
861 * \sa SDL_HapticSetAutocenter
862 * \sa SDL_HapticPause
863 * \sa SDL_HapticStopAll
864 */
865 extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpen(int device_index);
866
867 /**
868 * \brief Checks if the haptic device at index has been opened.
869 *
870 * \param device_index Index to check to see if it has been opened.
871 * \return 1 if it has been opened or 0 if it hasn't.
872 *
873 * \sa SDL_HapticOpen
874 * \sa SDL_HapticIndex
875 */
876 extern DECLSPEC int SDLCALL SDL_HapticOpened(int device_index);
877
878 /**
879 * \brief Gets the index of a haptic device.
880 *
881 * \param haptic Haptic device to get the index of.
882 * \return The index of the haptic device or -1 on error.
883 *
884 * \sa SDL_HapticOpen
885 * \sa SDL_HapticOpened
886 */
887 extern DECLSPEC int SDLCALL SDL_HapticIndex(SDL_Haptic * haptic);
888
889 /**
890 * \brief Gets whether or not the current mouse has haptic capabilities.
891 *
892 * \return SDL_TRUE if the mouse is haptic, SDL_FALSE if it isn't.
893 *
894 * \sa SDL_HapticOpenFromMouse
895 */
896 extern DECLSPEC int SDLCALL SDL_MouseIsHaptic(void);
897
898 /**
899 * \brief Tries to open a haptic device from the current mouse.
900 *
901 * \return The haptic device identifier or NULL on error.
902 *
903 * \sa SDL_MouseIsHaptic
904 * \sa SDL_HapticOpen
905 */
906 extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpenFromMouse(void);
907
908 /**
909 * \brief Checks to see if a joystick has haptic features.
910 *
911 * \param joystick Joystick to test for haptic capabilities.
912 * \return SDL_TRUE if the joystick is haptic, SDL_FALSE if it isn't
913 * or -1 if an error occurred.
914 *
915 * \sa SDL_HapticOpenFromJoystick
916 */
917 extern DECLSPEC int SDLCALL SDL_JoystickIsHaptic(SDL_Joystick * joystick);
918
919 /**
920 * \brief Opens a haptic device for use from a joystick device.
921 *
922 * You must still close the haptic device separately. It will not be closed
923 * with the joystick.
924 *
925 * When opening from a joystick you should first close the haptic device before
926 * closing the joystick device. If not, on some implementations the haptic
927 * device will also get unallocated and you'll be unable to use force feedback
928 * on that device.
929 *
930 * \param joystick Joystick to create a haptic device from.
931 * \return A valid haptic device identifier on success or NULL on error.
932 *
933 * \sa SDL_HapticOpen
934 * \sa SDL_HapticClose
935 */
936 extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpenFromJoystick(SDL_Joystick *
937 joystick);
938
939 /**
940 * \brief Closes a haptic device previously opened with SDL_HapticOpen().
941 *
942 * \param haptic Haptic device to close.
943 */
944 extern DECLSPEC void SDLCALL SDL_HapticClose(SDL_Haptic * haptic);
945
946 /**
947 * \brief Returns the number of effects a haptic device can store.
948 *
949 * On some platforms this isn't fully supported, and therefore is an
950 * approximation. Always check to see if your created effect was actually
951 * created and do not rely solely on SDL_HapticNumEffects().
952 *
953 * \param haptic The haptic device to query effect max.
954 * \return The number of effects the haptic device can store or
955 * -1 on error.
956 *
957 * \sa SDL_HapticNumEffectsPlaying
958 * \sa SDL_HapticQuery
959 */
960 extern DECLSPEC int SDLCALL SDL_HapticNumEffects(SDL_Haptic * haptic);
961
962 /**
963 * \brief Returns the number of effects a haptic device can play at the same
964 * time.
965 *
966 * This is not supported on all platforms, but will always return a value.
967 * Added here for the sake of completeness.
968 *
969 * \param haptic The haptic device to query maximum playing effects.
970 * \return The number of effects the haptic device can play at the same time
971 * or -1 on error.
972 *
973 * \sa SDL_HapticNumEffects
974 * \sa SDL_HapticQuery
975 */
976 extern DECLSPEC int SDLCALL SDL_HapticNumEffectsPlaying(SDL_Haptic * haptic);
977
978 /**
979 * \brief Gets the haptic device's supported features in bitwise manner.
980 *
981 * Example:
982 * \code
983 * if (SDL_HapticQuery(haptic) & SDL_HAPTIC_CONSTANT) {
984 * printf("We have constant haptic effect!\n");
985 * }
986 * \endcode
987 *
988 * \param haptic The haptic device to query.
989 * \return Haptic features in bitwise manner (OR'd).
990 *
991 * \sa SDL_HapticNumEffects
992 * \sa SDL_HapticEffectSupported
993 */
994 extern DECLSPEC unsigned int SDLCALL SDL_HapticQuery(SDL_Haptic * haptic);
995
996
997 /**
998 * \brief Gets the number of haptic axes the device has.
999 *
1000 * \sa SDL_HapticDirection
1001 */
1002 extern DECLSPEC int SDLCALL SDL_HapticNumAxes(SDL_Haptic * haptic);
1003
1004 /**
1005 * \brief Checks to see if effect is supported by haptic.
1006 *
1007 * \param haptic Haptic device to check on.
1008 * \param effect Effect to check to see if it is supported.
1009 * \return SDL_TRUE if effect is supported, SDL_FALSE if it isn't or -1 on error.
1010 *
1011 * \sa SDL_HapticQuery
1012 * \sa SDL_HapticNewEffect
1013 */
1014 extern DECLSPEC int SDLCALL SDL_HapticEffectSupported(SDL_Haptic * haptic,
1015 SDL_HapticEffect *
1016 effect);
1017
1018 /**
1019 * \brief Creates a new haptic effect on the device.
1020 *
1021 * \param haptic Haptic device to create the effect on.
1022 * \param effect Properties of the effect to create.
1023 * \return The identifier of the effect on success or -1 on error.
1024 *
1025 * \sa SDL_HapticUpdateEffect
1026 * \sa SDL_HapticRunEffect
1027 * \sa SDL_HapticDestroyEffect
1028 */
1029 extern DECLSPEC int SDLCALL SDL_HapticNewEffect(SDL_Haptic * haptic,
1030 SDL_HapticEffect * effect);
1031
1032 /**
1033 * \brief Updates the properties of an effect.
1034 *
1035 * Can be used dynamically, although behavior when dynamically changing
1036 * direction may be strange. Specifically the effect may reupload itself
1037 * and start playing from the start. You cannot change the type either when
1038 * running SDL_HapticUpdateEffect().
1039 *
1040 * \param haptic Haptic device that has the effect.
1041 * \param effect Identifier of the effect to update.
1042 * \param data New effect properties to use.
1043 * \return 0 on success or -1 on error.
1044 *
1045 * \sa SDL_HapticNewEffect
1046 * \sa SDL_HapticRunEffect
1047 * \sa SDL_HapticDestroyEffect
1048 */
1049 extern DECLSPEC int SDLCALL SDL_HapticUpdateEffect(SDL_Haptic * haptic,
1050 int effect,
1051 SDL_HapticEffect * data);
1052
1053 /**
1054 * \brief Runs the haptic effect on its associated haptic device.
1055 *
1056 * If iterations are ::SDL_HAPTIC_INFINITY, it'll run the effect over and over
1057 * repeating the envelope (attack and fade) every time. If you only want the
1058 * effect to last forever, set ::SDL_HAPTIC_INFINITY in the effect's length
1059 * parameter.
1060 *
1061 * \param haptic Haptic device to run the effect on.
1062 * \param effect Identifier of the haptic effect to run.
1063 * \param iterations Number of iterations to run the effect. Use
1064 * ::SDL_HAPTIC_INFINITY for infinity.
1065 * \return 0 on success or -1 on error.
1066 *
1067 * \sa SDL_HapticStopEffect
1068 * \sa SDL_HapticDestroyEffect
1069 * \sa SDL_HapticGetEffectStatus
1070 */
1071 extern DECLSPEC int SDLCALL SDL_HapticRunEffect(SDL_Haptic * haptic,
1072 int effect,
1073 Uint32 iterations);
1074
1075 /**
1076 * \brief Stops the haptic effect on its associated haptic device.
1077 *
1078 * \param haptic Haptic device to stop the effect on.
1079 * \param effect Identifier of the effect to stop.
1080 * \return 0 on success or -1 on error.
1081 *
1082 * \sa SDL_HapticRunEffect
1083 * \sa SDL_HapticDestroyEffect
1084 */
1085 extern DECLSPEC int SDLCALL SDL_HapticStopEffect(SDL_Haptic * haptic,
1086 int effect);
1087
1088 /**
1089 * \brief Destroys a haptic effect on the device.
1090 *
1091 * This will stop the effect if it's running. Effects are automatically
1092 * destroyed when the device is closed.
1093 *
1094 * \param haptic Device to destroy the effect on.
1095 * \param effect Identifier of the effect to destroy.
1096 *
1097 * \sa SDL_HapticNewEffect
1098 */
1099 extern DECLSPEC void SDLCALL SDL_HapticDestroyEffect(SDL_Haptic * haptic,
1100 int effect);
1101
1102 /**
1103 * \brief Gets the status of the current effect on the haptic device.
1104 *
1105 * Device must support the ::SDL_HAPTIC_STATUS feature.
1106 *
1107 * \param haptic Haptic device to query the effect status on.
1108 * \param effect Identifier of the effect to query its status.
1109 * \return 0 if it isn't playing, 1 if it is playing or -1 on error.
1110 *
1111 * \sa SDL_HapticRunEffect
1112 * \sa SDL_HapticStopEffect
1113 */
1114 extern DECLSPEC int SDLCALL SDL_HapticGetEffectStatus(SDL_Haptic * haptic,
1115 int effect);
1116
1117 /**
1118 * \brief Sets the global gain of the device.
1119 *
1120 * Device must support the ::SDL_HAPTIC_GAIN feature.
1121 *
1122 * The user may specify the maximum gain by setting the environment variable
1123 * SDL_HAPTIC_GAIN_MAX which should be between 0 and 100. All calls to
1124 * SDL_HapticSetGain() will scale linearly using SDL_HAPTIC_GAIN_MAX as the
1125 * maximum.
1126 *
1127 * \param haptic Haptic device to set the gain on.
1128 * \param gain Value to set the gain to, should be between 0 and 100.
1129 * \return 0 on success or -1 on error.
1130 *
1131 * \sa SDL_HapticQuery
1132 */
1133 extern DECLSPEC int SDLCALL SDL_HapticSetGain(SDL_Haptic * haptic, int gain);
1134
1135 /**
1136 * \brief Sets the global autocenter of the device.
1137 *
1138 * Autocenter should be between 0 and 100. Setting it to 0 will disable
1139 * autocentering.
1140 *
1141 * Device must support the ::SDL_HAPTIC_AUTOCENTER feature.
1142 *
1143 * \param haptic Haptic device to set autocentering on.
1144 * \param autocenter Value to set autocenter to, 0 disables autocentering.
1145 * \return 0 on success or -1 on error.
1146 *
1147 * \sa SDL_HapticQuery
1148 */
1149 extern DECLSPEC int SDLCALL SDL_HapticSetAutocenter(SDL_Haptic * haptic,
1150 int autocenter);
1151
1152 /**
1153 * \brief Pauses a haptic device.
1154 *
1155 * Device must support the ::SDL_HAPTIC_PAUSE feature. Call
1156 * SDL_HapticUnpause() to resume playback.
1157 *
1158 * Do not modify the effects nor add new ones while the device is paused.
1159 * That can cause all sorts of weird errors.
1160 *
1161 * \param haptic Haptic device to pause.
1162 * \return 0 on success or -1 on error.
1163 *
1164 * \sa SDL_HapticUnpause
1165 */
1166 extern DECLSPEC int SDLCALL SDL_HapticPause(SDL_Haptic * haptic);
1167
1168 /**
1169 * \brief Unpauses a haptic device.
1170 *
1171 * Call to unpause after SDL_HapticPause().
1172 *
1173 * \param haptic Haptic device to unpause.
1174 * \return 0 on success or -1 on error.
1175 *
1176 * \sa SDL_HapticPause
1177 */
1178 extern DECLSPEC int SDLCALL SDL_HapticUnpause(SDL_Haptic * haptic);
1179
1180 /**
1181 * \brief Stops all the currently playing effects on a haptic device.
1182 *
1183 * \param haptic Haptic device to stop.
1184 * \return 0 on success or -1 on error.
1185 */
1186 extern DECLSPEC int SDLCALL SDL_HapticStopAll(SDL_Haptic * haptic);
1187
1188 /**
1189 * \brief Checks to see if rumble is supported on a haptic device.
1190 *
1191 * \param haptic Haptic device to check to see if it supports rumble.
1192 * \return SDL_TRUE if effect is supported, SDL_FALSE if it isn't or -1 on error.
1193 *
1194 * \sa SDL_HapticRumbleInit
1195 * \sa SDL_HapticRumblePlay
1196 * \sa SDL_HapticRumbleStop
1197 */
1198 extern DECLSPEC int SDLCALL SDL_HapticRumbleSupported(SDL_Haptic * haptic);
1199
1200 /**
1201 * \brief Initializes the haptic device for simple rumble playback.
1202 *
1203 * \param haptic Haptic device to initialize for simple rumble playback.
1204 * \return 0 on success or -1 on error.
1205 *
1206 * \sa SDL_HapticOpen
1207 * \sa SDL_HapticRumbleSupported
1208 * \sa SDL_HapticRumblePlay
1209 * \sa SDL_HapticRumbleStop
1210 */
1211 extern DECLSPEC int SDLCALL SDL_HapticRumbleInit(SDL_Haptic * haptic);
1212
1213 /**
1214 * \brief Runs simple rumble on a haptic device
1215 *
1216 * \param haptic Haptic device to play rumble effect on.
1217 * \param strength Strength of the rumble to play as a 0-1 float value.
1218 * \param length Length of the rumble to play in milliseconds.
1219 * \return 0 on success or -1 on error.
1220 *
1221 * \sa SDL_HapticRumbleSupported
1222 * \sa SDL_HapticRumbleInit
1223 * \sa SDL_HapticRumbleStop
1224 */
1225 extern DECLSPEC int SDLCALL SDL_HapticRumblePlay(SDL_Haptic * haptic, float strength, Uint32 length );
1226
1227 /**
1228 * \brief Stops the simple rumble on a haptic device.
1229 *
1230 * \param haptic Haptic to stop the rumble on.
1231 * \return 0 on success or -1 on error.
1232 *
1233 * \sa SDL_HapticRumbleSupported
1234 * \sa SDL_HapticRumbleInit
1235 * \sa SDL_HapticRumblePlay
1236 */
1237 extern DECLSPEC int SDLCALL SDL_HapticRumbleStop(SDL_Haptic * haptic);
1238
1239 /* Ends C function definitions when using C++ */
1240 #ifdef __cplusplus
1241 }
1242 #endif
1243 #include "close_code.h"
1244
1245 #endif /* SDL_haptic_h_ */
1246
1247 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_hints.h added (mode: 100644) (index 0000000..50a5a08)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_hints.h
24 *
25 * Official documentation for SDL configuration variables
26 *
27 * This file contains functions to set and get configuration hints,
28 * as well as listing each of them alphabetically.
29 *
30 * The convention for naming hints is SDL_HINT_X, where "SDL_X" is
31 * the environment variable that can be used to override the default.
32 *
33 * In general these hints are just that - they may or may not be
34 * supported or applicable on any given platform, but they provide
35 * a way for an application or user to give the library a hint as
36 * to how they would like the library to work.
37 */
38
39 #ifndef SDL_hints_h_
40 #define SDL_hints_h_
41
42 #include "SDL_stdinc.h"
43
44 #include "begin_code.h"
45 /* Set up for C function definitions, even when using C++ */
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49
50 /**
51 * \brief A variable controlling how 3D acceleration is used to accelerate the SDL screen surface.
52 *
53 * SDL can try to accelerate the SDL screen surface by using streaming
54 * textures with a 3D rendering engine. This variable controls whether and
55 * how this is done.
56 *
57 * This variable can be set to the following values:
58 * "0" - Disable 3D acceleration
59 * "1" - Enable 3D acceleration, using the default renderer.
60 * "X" - Enable 3D acceleration, using X where X is one of the valid rendering drivers. (e.g. "direct3d", "opengl", etc.)
61 *
62 * By default SDL tries to make a best guess for each platform whether
63 * to use acceleration or not.
64 */
65 #define SDL_HINT_FRAMEBUFFER_ACCELERATION "SDL_FRAMEBUFFER_ACCELERATION"
66
67 /**
68 * \brief A variable specifying which render driver to use.
69 *
70 * If the application doesn't pick a specific renderer to use, this variable
71 * specifies the name of the preferred renderer. If the preferred renderer
72 * can't be initialized, the normal default renderer is used.
73 *
74 * This variable is case insensitive and can be set to the following values:
75 * "direct3d"
76 * "opengl"
77 * "opengles2"
78 * "opengles"
79 * "metal"
80 * "software"
81 *
82 * The default varies by platform, but it's the first one in the list that
83 * is available on the current platform.
84 */
85 #define SDL_HINT_RENDER_DRIVER "SDL_RENDER_DRIVER"
86
87 /**
88 * \brief A variable controlling whether the OpenGL render driver uses shaders if they are available.
89 *
90 * This variable can be set to the following values:
91 * "0" - Disable shaders
92 * "1" - Enable shaders
93 *
94 * By default shaders are used if OpenGL supports them.
95 */
96 #define SDL_HINT_RENDER_OPENGL_SHADERS "SDL_RENDER_OPENGL_SHADERS"
97
98 /**
99 * \brief A variable controlling whether the Direct3D device is initialized for thread-safe operations.
100 *
101 * This variable can be set to the following values:
102 * "0" - Thread-safety is not enabled (faster)
103 * "1" - Thread-safety is enabled
104 *
105 * By default the Direct3D device is created with thread-safety disabled.
106 */
107 #define SDL_HINT_RENDER_DIRECT3D_THREADSAFE "SDL_RENDER_DIRECT3D_THREADSAFE"
108
109 /**
110 * \brief A variable controlling whether to enable Direct3D 11+'s Debug Layer.
111 *
112 * This variable does not have any effect on the Direct3D 9 based renderer.
113 *
114 * This variable can be set to the following values:
115 * "0" - Disable Debug Layer use
116 * "1" - Enable Debug Layer use
117 *
118 * By default, SDL does not use Direct3D Debug Layer.
119 */
120 #define SDL_HINT_RENDER_DIRECT3D11_DEBUG "SDL_RENDER_DIRECT3D11_DEBUG"
121
122 /**
123 * \brief A variable controlling the scaling policy for SDL_RenderSetLogicalSize.
124 *
125 * This variable can be set to the following values:
126 * "0" or "letterbox" - Uses letterbox/sidebars to fit the entire rendering on screen
127 * "1" or "overscan" - Will zoom the rendering so it fills the entire screen, allowing edges to be drawn offscreen
128 *
129 * By default letterbox is used
130 */
131 #define SDL_HINT_RENDER_LOGICAL_SIZE_MODE "SDL_RENDER_LOGICAL_SIZE_MODE"
132
133 /**
134 * \brief A variable controlling the scaling quality
135 *
136 * This variable can be set to the following values:
137 * "0" or "nearest" - Nearest pixel sampling
138 * "1" or "linear" - Linear filtering (supported by OpenGL and Direct3D)
139 * "2" or "best" - Currently this is the same as "linear"
140 *
141 * By default nearest pixel sampling is used
142 */
143 #define SDL_HINT_RENDER_SCALE_QUALITY "SDL_RENDER_SCALE_QUALITY"
144
145 /**
146 * \brief A variable controlling whether updates to the SDL screen surface should be synchronized with the vertical refresh, to avoid tearing.
147 *
148 * This variable can be set to the following values:
149 * "0" - Disable vsync
150 * "1" - Enable vsync
151 *
152 * By default SDL does not sync screen surface updates with vertical refresh.
153 */
154 #define SDL_HINT_RENDER_VSYNC "SDL_RENDER_VSYNC"
155
156 /**
157 * \brief A variable controlling whether the screensaver is enabled.
158 *
159 * This variable can be set to the following values:
160 * "0" - Disable screensaver
161 * "1" - Enable screensaver
162 *
163 * By default SDL will disable the screensaver.
164 */
165 #define SDL_HINT_VIDEO_ALLOW_SCREENSAVER "SDL_VIDEO_ALLOW_SCREENSAVER"
166
167 /**
168 * \brief A variable controlling whether the graphics context is externally managed.
169 *
170 * This variable can be set to the following values:
171 * "0" - SDL will manage graphics contexts that are attached to windows.
172 * "1" - Disable graphics context management on windows.
173 *
174 * By default SDL will manage OpenGL contexts in certain situations. For example, on Android the
175 * context will be automatically saved and restored when pausing the application. Additionally, some
176 * platforms will assume usage of OpenGL if Vulkan isn't used. Setting this to "1" will prevent this
177 * behavior, which is desireable when the application manages the graphics context, such as
178 * an externally managed OpenGL context or attaching a Vulkan surface to the window.
179 */
180 #define SDL_HINT_VIDEO_EXTERNAL_CONTEXT "SDL_VIDEO_EXTERNAL_CONTEXT"
181
182 /**
183 * \brief A variable controlling whether the X11 VidMode extension should be used.
184 *
185 * This variable can be set to the following values:
186 * "0" - Disable XVidMode
187 * "1" - Enable XVidMode
188 *
189 * By default SDL will use XVidMode if it is available.
190 */
191 #define SDL_HINT_VIDEO_X11_XVIDMODE "SDL_VIDEO_X11_XVIDMODE"
192
193 /**
194 * \brief A variable controlling whether the X11 Xinerama extension should be used.
195 *
196 * This variable can be set to the following values:
197 * "0" - Disable Xinerama
198 * "1" - Enable Xinerama
199 *
200 * By default SDL will use Xinerama if it is available.
201 */
202 #define SDL_HINT_VIDEO_X11_XINERAMA "SDL_VIDEO_X11_XINERAMA"
203
204 /**
205 * \brief A variable controlling whether the X11 XRandR extension should be used.
206 *
207 * This variable can be set to the following values:
208 * "0" - Disable XRandR
209 * "1" - Enable XRandR
210 *
211 * By default SDL will not use XRandR because of window manager issues.
212 */
213 #define SDL_HINT_VIDEO_X11_XRANDR "SDL_VIDEO_X11_XRANDR"
214
215 /**
216 * \brief A variable forcing the visual ID chosen for new X11 windows
217 *
218 */
219 #define SDL_HINT_VIDEO_X11_WINDOW_VISUALID "SDL_VIDEO_X11_WINDOW_VISUALID"
220
221 /**
222 * \brief A variable controlling whether the X11 _NET_WM_PING protocol should be supported.
223 *
224 * This variable can be set to the following values:
225 * "0" - Disable _NET_WM_PING
226 * "1" - Enable _NET_WM_PING
227 *
228 * By default SDL will use _NET_WM_PING, but for applications that know they
229 * will not always be able to respond to ping requests in a timely manner they can
230 * turn it off to avoid the window manager thinking the app is hung.
231 * The hint is checked in CreateWindow.
232 */
233 #define SDL_HINT_VIDEO_X11_NET_WM_PING "SDL_VIDEO_X11_NET_WM_PING"
234
235 /**
236 * \brief A variable controlling whether the X11 _NET_WM_BYPASS_COMPOSITOR hint should be used.
237 *
238 * This variable can be set to the following values:
239 * "0" - Disable _NET_WM_BYPASS_COMPOSITOR
240 * "1" - Enable _NET_WM_BYPASS_COMPOSITOR
241 *
242 * By default SDL will use _NET_WM_BYPASS_COMPOSITOR
243 *
244 */
245 #define SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR "SDL_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR"
246
247 /**
248 * \brief A variable controlling whether X11 should use GLX or EGL by default
249 *
250 * This variable can be set to the following values:
251 * "0" - Use GLX
252 * "1" - Use EGL
253 *
254 * By default SDL will use GLX when both are present.
255 */
256 #define SDL_HINT_VIDEO_X11_FORCE_EGL "SDL_VIDEO_X11_FORCE_EGL"
257
258 /**
259 * \brief A variable controlling whether the window frame and title bar are interactive when the cursor is hidden
260 *
261 * This variable can be set to the following values:
262 * "0" - The window frame is not interactive when the cursor is hidden (no move, resize, etc)
263 * "1" - The window frame is interactive when the cursor is hidden
264 *
265 * By default SDL will allow interaction with the window frame when the cursor is hidden
266 */
267 #define SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN "SDL_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN"
268
269 /**
270 * \brief A variable to specify custom icon resource id from RC file on Windows platform
271 */
272 #define SDL_HINT_WINDOWS_INTRESOURCE_ICON "SDL_WINDOWS_INTRESOURCE_ICON"
273 #define SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL "SDL_WINDOWS_INTRESOURCE_ICON_SMALL"
274
275 /**
276 * \brief A variable controlling whether the windows message loop is processed by SDL
277 *
278 * This variable can be set to the following values:
279 * "0" - The window message loop is not run
280 * "1" - The window message loop is processed in SDL_PumpEvents()
281 *
282 * By default SDL will process the windows message loop
283 */
284 #define SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP "SDL_WINDOWS_ENABLE_MESSAGELOOP"
285
286 /**
287 * \brief A variable controlling whether grabbing input grabs the keyboard
288 *
289 * This variable can be set to the following values:
290 * "0" - Grab will affect only the mouse
291 * "1" - Grab will affect mouse and keyboard
292 *
293 * By default SDL will not grab the keyboard so system shortcuts still work.
294 */
295 #define SDL_HINT_GRAB_KEYBOARD "SDL_GRAB_KEYBOARD"
296
297 /**
298 * \brief A variable setting the double click time, in milliseconds.
299 */
300 #define SDL_HINT_MOUSE_DOUBLE_CLICK_TIME "SDL_MOUSE_DOUBLE_CLICK_TIME"
301
302 /**
303 * \brief A variable setting the double click radius, in pixels.
304 */
305 #define SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS "SDL_MOUSE_DOUBLE_CLICK_RADIUS"
306
307 /**
308 * \brief A variable setting the speed scale for mouse motion, in floating point, when the mouse is not in relative mode
309 */
310 #define SDL_HINT_MOUSE_NORMAL_SPEED_SCALE "SDL_MOUSE_NORMAL_SPEED_SCALE"
311
312 /**
313 * \brief A variable setting the scale for mouse motion, in floating point, when the mouse is in relative mode
314 */
315 #define SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE "SDL_MOUSE_RELATIVE_SPEED_SCALE"
316
317 /**
318 * \brief A variable controlling whether relative mouse motion is affected by renderer scaling
319 *
320 * This variable can be set to the following values:
321 * "0" - Relative motion is unaffected by DPI or renderer's logical size
322 * "1" - Relative motion is scaled according to DPI scaling and logical size
323 *
324 * By default relative mouse deltas are affected by DPI and renderer scaling
325 */
326 #define SDL_HINT_MOUSE_RELATIVE_SCALING "SDL_MOUSE_RELATIVE_SCALING"
327
328 /**
329 * \brief A variable controlling whether relative mouse mode is implemented using mouse warping
330 *
331 * This variable can be set to the following values:
332 * "0" - Relative mouse mode uses raw input
333 * "1" - Relative mouse mode uses mouse warping
334 *
335 * By default SDL will use raw input for relative mouse mode
336 */
337 #define SDL_HINT_MOUSE_RELATIVE_MODE_WARP "SDL_MOUSE_RELATIVE_MODE_WARP"
338
339 /**
340 * \brief Allow mouse click events when clicking to focus an SDL window
341 *
342 * This variable can be set to the following values:
343 * "0" - Ignore mouse clicks that activate a window
344 * "1" - Generate events for mouse clicks that activate a window
345 *
346 * By default SDL will ignore mouse clicks that activate a window
347 */
348 #define SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH "SDL_MOUSE_FOCUS_CLICKTHROUGH"
349
350 /**
351 * \brief A variable controlling whether touch events should generate synthetic mouse events
352 *
353 * This variable can be set to the following values:
354 * "0" - Touch events will not generate mouse events
355 * "1" - Touch events will generate mouse events
356 *
357 * By default SDL will generate mouse events for touch events
358 */
359 #define SDL_HINT_TOUCH_MOUSE_EVENTS "SDL_TOUCH_MOUSE_EVENTS"
360
361 /**
362 * \brief A variable controlling whether mouse events should generate synthetic touch events
363 *
364 * This variable can be set to the following values:
365 * "0" - Mouse events will not generate touch events (default for desktop platforms)
366 * "1" - Mouse events will generate touch events (default for mobile platforms, such as Android and iOS)
367 */
368
369 #define SDL_HINT_MOUSE_TOUCH_EVENTS "SDL_MOUSE_TOUCH_EVENTS"
370
371 /**
372 * \brief Minimize your SDL_Window if it loses key focus when in fullscreen mode. Defaults to false.
373 * \warning Before SDL 2.0.14, this defaulted to true! In 2.0.14, we're
374 * seeing if "true" causes more problems than it solves in modern times.
375 *
376 */
377 #define SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS "SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS"
378
379 /**
380 * \brief A variable controlling whether the idle timer is disabled on iOS.
381 *
382 * When an iOS app does not receive touches for some time, the screen is
383 * dimmed automatically. For games where the accelerometer is the only input
384 * this is problematic. This functionality can be disabled by setting this
385 * hint.
386 *
387 * As of SDL 2.0.4, SDL_EnableScreenSaver() and SDL_DisableScreenSaver()
388 * accomplish the same thing on iOS. They should be preferred over this hint.
389 *
390 * This variable can be set to the following values:
391 * "0" - Enable idle timer
392 * "1" - Disable idle timer
393 */
394 #define SDL_HINT_IDLE_TIMER_DISABLED "SDL_IOS_IDLE_TIMER_DISABLED"
395
396 /**
397 * \brief A variable controlling which orientations are allowed on iOS/Android.
398 *
399 * In some circumstances it is necessary to be able to explicitly control
400 * which UI orientations are allowed.
401 *
402 * This variable is a space delimited list of the following values:
403 * "LandscapeLeft", "LandscapeRight", "Portrait" "PortraitUpsideDown"
404 */
405 #define SDL_HINT_ORIENTATIONS "SDL_IOS_ORIENTATIONS"
406
407 /**
408 * \brief A variable controlling whether controllers used with the Apple TV
409 * generate UI events.
410 *
411 * When UI events are generated by controller input, the app will be
412 * backgrounded when the Apple TV remote's menu button is pressed, and when the
413 * pause or B buttons on gamepads are pressed.
414 *
415 * More information about properly making use of controllers for the Apple TV
416 * can be found here:
417 * https://developer.apple.com/tvos/human-interface-guidelines/remote-and-controllers/
418 *
419 * This variable can be set to the following values:
420 * "0" - Controller input does not generate UI events (the default).
421 * "1" - Controller input generates UI events.
422 */
423 #define SDL_HINT_APPLE_TV_CONTROLLER_UI_EVENTS "SDL_APPLE_TV_CONTROLLER_UI_EVENTS"
424
425 /**
426 * \brief A variable controlling whether the Apple TV remote's joystick axes
427 * will automatically match the rotation of the remote.
428 *
429 * This variable can be set to the following values:
430 * "0" - Remote orientation does not affect joystick axes (the default).
431 * "1" - Joystick axes are based on the orientation of the remote.
432 */
433 #define SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION "SDL_APPLE_TV_REMOTE_ALLOW_ROTATION"
434
435 /**
436 * \brief A variable controlling whether the home indicator bar on iPhone X
437 * should be hidden.
438 *
439 * This variable can be set to the following values:
440 * "0" - The indicator bar is not hidden (default for windowed applications)
441 * "1" - The indicator bar is hidden and is shown when the screen is touched (useful for movie playback applications)
442 * "2" - The indicator bar is dim and the first swipe makes it visible and the second swipe performs the "home" action (default for fullscreen applications)
443 */
444 #define SDL_HINT_IOS_HIDE_HOME_INDICATOR "SDL_IOS_HIDE_HOME_INDICATOR"
445
446 /**
447 * \brief A variable controlling whether the Android / iOS built-in
448 * accelerometer should be listed as a joystick device.
449 *
450 * This variable can be set to the following values:
451 * "0" - The accelerometer is not listed as a joystick
452 * "1" - The accelerometer is available as a 3 axis joystick (the default).
453 */
454 #define SDL_HINT_ACCELEROMETER_AS_JOYSTICK "SDL_ACCELEROMETER_AS_JOYSTICK"
455
456 /**
457 * \brief A variable controlling whether the Android / tvOS remotes
458 * should be listed as joystick devices, instead of sending keyboard events.
459 *
460 * This variable can be set to the following values:
461 * "0" - Remotes send enter/escape/arrow key events
462 * "1" - Remotes are available as 2 axis, 2 button joysticks (the default).
463 */
464 #define SDL_HINT_TV_REMOTE_AS_JOYSTICK "SDL_TV_REMOTE_AS_JOYSTICK"
465
466 /**
467 * \brief A variable that lets you disable the detection and use of Xinput gamepad devices
468 *
469 * The variable can be set to the following values:
470 * "0" - Disable XInput detection (only uses direct input)
471 * "1" - Enable XInput detection (the default)
472 */
473 #define SDL_HINT_XINPUT_ENABLED "SDL_XINPUT_ENABLED"
474
475 /**
476 * \brief A variable that causes SDL to use the old axis and button mapping for XInput devices.
477 *
478 * This hint is for backwards compatibility only and will be removed in SDL 2.1
479 *
480 * The default value is "0". This hint must be set before SDL_Init()
481 */
482 #define SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING "SDL_XINPUT_USE_OLD_JOYSTICK_MAPPING"
483
484 /**
485 * \brief A variable that overrides the automatic controller type detection
486 *
487 * The variable should be comma separated entries, in the form: VID/PID=type
488 *
489 * The VID and PID should be hexadecimal with exactly 4 digits, e.g. 0x00fd
490 *
491 * The type should be one of:
492 * Xbox360
493 * XboxOne
494 * PS3
495 * PS4
496 * PS5
497 * SwitchPro
498 *
499 * This hint affects what driver is used, and must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER)
500 */
501 #define SDL_HINT_GAMECONTROLLERTYPE "SDL_GAMECONTROLLERTYPE"
502
503 /**
504 * \brief A variable that lets you manually hint extra gamecontroller db entries.
505 *
506 * The variable should be newline delimited rows of gamecontroller config data, see SDL_gamecontroller.h
507 *
508 * This hint must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER)
509 * You can update mappings after the system is initialized with SDL_GameControllerMappingForGUID() and SDL_GameControllerAddMapping()
510 */
511 #define SDL_HINT_GAMECONTROLLERCONFIG "SDL_GAMECONTROLLERCONFIG"
512
513 /**
514 * \brief A variable that lets you provide a file with extra gamecontroller db entries.
515 *
516 * The file should contain lines of gamecontroller config data, see SDL_gamecontroller.h
517 *
518 * This hint must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER)
519 * You can update mappings after the system is initialized with SDL_GameControllerMappingForGUID() and SDL_GameControllerAddMapping()
520 */
521 #define SDL_HINT_GAMECONTROLLERCONFIG_FILE "SDL_GAMECONTROLLERCONFIG_FILE"
522
523 /**
524 * \brief A variable containing a list of devices to skip when scanning for game controllers.
525 *
526 * The format of the string is a comma separated list of USB VID/PID pairs
527 * in hexadecimal form, e.g.
528 *
529 * 0xAAAA/0xBBBB,0xCCCC/0xDDDD
530 *
531 * The variable can also take the form of @file, in which case the named
532 * file will be loaded and interpreted as the value of the variable.
533 */
534 #define SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES "SDL_GAMECONTROLLER_IGNORE_DEVICES"
535
536 /**
537 * \brief If set, all devices will be skipped when scanning for game controllers except for the ones listed in this variable.
538 *
539 * The format of the string is a comma separated list of USB VID/PID pairs
540 * in hexadecimal form, e.g.
541 *
542 * 0xAAAA/0xBBBB,0xCCCC/0xDDDD
543 *
544 * The variable can also take the form of @file, in which case the named
545 * file will be loaded and interpreted as the value of the variable.
546 */
547 #define SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT "SDL_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT"
548
549 /**
550 * \brief If set, game controller face buttons report their values according to their labels instead of their positional layout.
551 *
552 * For example, on Nintendo Switch controllers, normally you'd get:
553 *
554 * (Y)
555 * (X) (B)
556 * (A)
557 *
558 * but if this hint is set, you'll get:
559 *
560 * (X)
561 * (Y) (A)
562 * (B)
563 *
564 * The variable can be set to the following values:
565 * "0" - Report the face buttons by position, as though they were on an Xbox controller.
566 * "1" - Report the face buttons by label instead of position
567 *
568 * The default value is "1". This hint may be set at any time.
569 */
570 #define SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS "SDL_GAMECONTROLLER_USE_BUTTON_LABELS"
571
572 /**
573 * \brief A variable that lets you enable joystick (and gamecontroller) events even when your app is in the background.
574 *
575 * The variable can be set to the following values:
576 * "0" - Disable joystick & gamecontroller input events when the
577 * application is in the background.
578 * "1" - Enable joystick & gamecontroller input events when the
579 * application is in the background.
580 *
581 * The default value is "0". This hint may be set at any time.
582 */
583 #define SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS "SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS"
584
585 /**
586 * \brief A variable controlling whether the HIDAPI joystick drivers should be used.
587 *
588 * This variable can be set to the following values:
589 * "0" - HIDAPI drivers are not used
590 * "1" - HIDAPI drivers are used (the default)
591 *
592 * This variable is the default for all drivers, but can be overridden by the hints for specific drivers below.
593 */
594 #define SDL_HINT_JOYSTICK_HIDAPI "SDL_JOYSTICK_HIDAPI"
595
596 /**
597 * \brief A variable controlling whether the HIDAPI driver for PS4 controllers should be used.
598 *
599 * This variable can be set to the following values:
600 * "0" - HIDAPI driver is not used
601 * "1" - HIDAPI driver is used
602 *
603 * The default is the value of SDL_HINT_JOYSTICK_HIDAPI
604 */
605 #define SDL_HINT_JOYSTICK_HIDAPI_PS4 "SDL_JOYSTICK_HIDAPI_PS4"
606
607 /**
608 * \brief A variable controlling whether the HIDAPI driver for PS5 controllers should be used.
609 *
610 * This variable can be set to the following values:
611 * "0" - HIDAPI driver is not used
612 * "1" - HIDAPI driver is used
613 *
614 * The default is the value of SDL_HINT_JOYSTICK_HIDAPI
615 */
616 #define SDL_HINT_JOYSTICK_HIDAPI_PS5 "SDL_JOYSTICK_HIDAPI_PS5"
617
618 /**
619 * \brief A variable controlling whether extended input reports should be used for PS4 controllers when using the HIDAPI driver.
620 *
621 * This variable can be set to the following values:
622 * "0" - extended reports are not enabled (the default)
623 * "1" - extended reports
624 *
625 * Extended input reports allow rumble on Bluetooth PS4 controllers, but
626 * break DirectInput handling for applications that don't use SDL.
627 *
628 * Once extended reports are enabled, they can not be disabled without
629 * power cycling the controller.
630 */
631 #define SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE "SDL_JOYSTICK_HIDAPI_PS4_RUMBLE"
632
633 /**
634 * \brief A variable controlling whether the HIDAPI driver for Steam Controllers should be used.
635 *
636 * This variable can be set to the following values:
637 * "0" - HIDAPI driver is not used
638 * "1" - HIDAPI driver is used
639 *
640 * The default is the value of SDL_HINT_JOYSTICK_HIDAPI
641 */
642 #define SDL_HINT_JOYSTICK_HIDAPI_STEAM "SDL_JOYSTICK_HIDAPI_STEAM"
643
644 /**
645 * \brief A variable controlling whether the HIDAPI driver for Nintendo Switch controllers should be used.
646 *
647 * This variable can be set to the following values:
648 * "0" - HIDAPI driver is not used
649 * "1" - HIDAPI driver is used
650 *
651 * The default is the value of SDL_HINT_JOYSTICK_HIDAPI
652 */
653 #define SDL_HINT_JOYSTICK_HIDAPI_SWITCH "SDL_JOYSTICK_HIDAPI_SWITCH"
654
655 /**
656 * \brief A variable controlling whether the HIDAPI driver for XBox controllers should be used.
657 *
658 * This variable can be set to the following values:
659 * "0" - HIDAPI driver is not used
660 * "1" - HIDAPI driver is used
661 *
662 * The default is "0" on Windows, otherwise the value of SDL_HINT_JOYSTICK_HIDAPI
663 */
664 #define SDL_HINT_JOYSTICK_HIDAPI_XBOX "SDL_JOYSTICK_HIDAPI_XBOX"
665
666 /**
667 * \brief A variable controlling whether the HIDAPI driver for XBox controllers on Windows should pull correlated
668 * data from XInput.
669 *
670 * This variable can be set to the following values:
671 * "0" - HIDAPI Xbox driver will only use HIDAPI data
672 * "1" - HIDAPI Xbox driver will also pull data from XInput, providing better trigger axes, guide button
673 * presses, and rumble support
674 *
675 * The default is "1". This hint applies to any joysticks opened after setting the hint.
676 */
677 #define SDL_HINT_JOYSTICK_HIDAPI_CORRELATE_XINPUT "SDL_JOYSTICK_HIDAPI_CORRELATE_XINPUT"
678
679 /**
680 * \brief A variable controlling whether the HIDAPI driver for Nintendo GameCube controllers should be used.
681 *
682 * This variable can be set to the following values:
683 * "0" - HIDAPI driver is not used
684 * "1" - HIDAPI driver is used
685 *
686 * The default is the value of SDL_HINT_JOYSTICK_HIDAPI
687 */
688 #define SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE "SDL_JOYSTICK_HIDAPI_GAMECUBE"
689
690 /**
691 * \brief A variable that controls whether Steam Controllers should be exposed using the SDL joystick and game controller APIs
692 *
693 * The variable can be set to the following values:
694 * "0" - Do not scan for Steam Controllers
695 * "1" - Scan for Steam Controllers (the default)
696 *
697 * The default value is "1". This hint must be set before initializing the joystick subsystem.
698 */
699 #define SDL_HINT_ENABLE_STEAM_CONTROLLERS "SDL_ENABLE_STEAM_CONTROLLERS"
700
701 /**
702 * \brief A variable controlling whether the RAWINPUT joystick drivers should be used for better handling XInput-capable devices.
703 *
704 * This variable can be set to the following values:
705 * "0" - RAWINPUT drivers are not used
706 * "1" - RAWINPUT drivers are used (the default)
707 *
708 */
709 #define SDL_HINT_JOYSTICK_RAWINPUT "SDL_JOYSTICK_RAWINPUT"
710
711 /**
712 * \brief A variable controlling whether a separate thread should be used
713 * for handling joystick detection and raw input messages on Windows
714 *
715 * This variable can be set to the following values:
716 * "0" - A separate thread is not used (the default)
717 * "1" - A separate thread is used for handling raw input messages
718 *
719 */
720 #define SDL_HINT_JOYSTICK_THREAD "SDL_JOYSTICK_THREAD"
721
722 /**
723 * \brief A variable controlling whether joysticks on Linux adhere to their HID-defined deadzones or return unfiltered values.
724 *
725 * This variable can be set to the following values:
726 * "0" - Return unfiltered joystick axis values (the default)
727 * "1" - Return axis values with deadzones taken into account
728 */
729 #define SDL_HINT_LINUX_JOYSTICK_DEADZONES "SDL_LINUX_JOYSTICK_DEADZONES"
730
731 /**
732 * \brief If set to "0" then never set the top most bit on a SDL Window, even if the video mode expects it.
733 * This is a debugging aid for developers and not expected to be used by end users. The default is "1"
734 *
735 * This variable can be set to the following values:
736 * "0" - don't allow topmost
737 * "1" - allow topmost
738 */
739 #define SDL_HINT_ALLOW_TOPMOST "SDL_ALLOW_TOPMOST"
740
741 /**
742 * \brief A variable that controls the timer resolution, in milliseconds.
743 *
744 * The higher resolution the timer, the more frequently the CPU services
745 * timer interrupts, and the more precise delays are, but this takes up
746 * power and CPU time. This hint is only used on Windows 7 and earlier.
747 *
748 * See this blog post for more information:
749 * http://randomascii.wordpress.com/2013/07/08/windows-timer-resolution-megawatts-wasted/
750 *
751 * If this variable is set to "0", the system timer resolution is not set.
752 *
753 * The default value is "1". This hint may be set at any time.
754 */
755 #define SDL_HINT_TIMER_RESOLUTION "SDL_TIMER_RESOLUTION"
756
757
758 /**
759 * \brief A variable describing the content orientation on QtWayland-based platforms.
760 *
761 * On QtWayland platforms, windows are rotated client-side to allow for custom
762 * transitions. In order to correctly position overlays (e.g. volume bar) and
763 * gestures (e.g. events view, close/minimize gestures), the system needs to
764 * know in which orientation the application is currently drawing its contents.
765 *
766 * This does not cause the window to be rotated or resized, the application
767 * needs to take care of drawing the content in the right orientation (the
768 * framebuffer is always in portrait mode).
769 *
770 * This variable can be one of the following values:
771 * "primary" (default), "portrait", "landscape", "inverted-portrait", "inverted-landscape"
772 */
773 #define SDL_HINT_QTWAYLAND_CONTENT_ORIENTATION "SDL_QTWAYLAND_CONTENT_ORIENTATION"
774
775 /**
776 * \brief Flags to set on QtWayland windows to integrate with the native window manager.
777 *
778 * On QtWayland platforms, this hint controls the flags to set on the windows.
779 * For example, on Sailfish OS "OverridesSystemGestures" disables swipe gestures.
780 *
781 * This variable is a space-separated list of the following values (empty = no flags):
782 * "OverridesSystemGestures", "StaysOnTop", "BypassWindowManager"
783 */
784 #define SDL_HINT_QTWAYLAND_WINDOW_FLAGS "SDL_QTWAYLAND_WINDOW_FLAGS"
785
786 /**
787 * \brief A string specifying SDL's threads stack size in bytes or "0" for the backend's default size
788 *
789 * Use this hint in case you need to set SDL's threads stack size to other than the default.
790 * This is specially useful if you build SDL against a non glibc libc library (such as musl) which
791 * provides a relatively small default thread stack size (a few kilobytes versus the default 8MB glibc uses).
792 * Support for this hint is currently available only in the pthread, Windows, and PSP backend.
793 *
794 * Instead of this hint, in 2.0.9 and later, you can use
795 * SDL_CreateThreadWithStackSize(). This hint only works with the classic
796 * SDL_CreateThread().
797 */
798 #define SDL_HINT_THREAD_STACK_SIZE "SDL_THREAD_STACK_SIZE"
799
800 /**
801 * \brief A string specifying additional information to use with SDL_SetThreadPriority.
802 *
803 * By default SDL_SetThreadPriority will make appropriate system changes in order to
804 * apply a thread priority. For example on systems using pthreads the scheduler policy
805 * is changed automatically to a policy that works well with a given priority.
806 * Code which has specific requirements can override SDL's default behavior with this hint.
807 *
808 * pthread hint values are "current", "other", "fifo" and "rr".
809 * Currently no other platform hint values are defined but may be in the future.
810 *
811 * \note On Linux, the kernel may send SIGKILL to realtime tasks which exceed the distro
812 * configured execution budget for rtkit. This budget can be queried through RLIMIT_RTTIME
813 * after calling SDL_SetThreadPriority().
814 */
815 #define SDL_HINT_THREAD_PRIORITY_POLICY "SDL_THREAD_PRIORITY_POLICY"
816
817 /**
818 * \brief Specifies whether SDL_THREAD_PRIORITY_TIME_CRITICAL should be treated as realtime.
819 *
820 * On some platforms, like Linux, a realtime priority thread may be subject to restrictions
821 * that require special handling by the application. This hint exists to let SDL know that
822 * the app is prepared to handle said restrictions.
823 *
824 * On Linux, SDL will apply the following configuration to any thread that becomes realtime:
825 * * The SCHED_RESET_ON_FORK bit will be set on the scheduling policy,
826 * * An RLIMIT_RTTIME budget will be configured to the rtkit specified limit.
827 * * Exceeding this limit will result in the kernel sending SIGKILL to the app,
828 * * Refer to the man pages for more information.
829 *
830 * This variable can be set to the following values:
831 * "0" - default platform specific behaviour
832 * "1" - Force SDL_THREAD_PRIORITY_TIME_CRITICAL to a realtime scheduling policy
833 */
834 #define SDL_HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL "SDL_THREAD_FORCE_REALTIME_TIME_CRITICAL"
835
836 /**
837 * \brief If set to 1, then do not allow high-DPI windows. ("Retina" on Mac and iOS)
838 */
839 #define SDL_HINT_VIDEO_HIGHDPI_DISABLED "SDL_VIDEO_HIGHDPI_DISABLED"
840
841 /**
842 * \brief A variable that determines whether ctrl+click should generate a right-click event on Mac
843 *
844 * If present, holding ctrl while left clicking will generate a right click
845 * event when on Mac.
846 */
847 #define SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK "SDL_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK"
848
849 /**
850 * \brief A variable specifying which shader compiler to preload when using the Chrome ANGLE binaries
851 *
852 * SDL has EGL and OpenGL ES2 support on Windows via the ANGLE project. It
853 * can use two different sets of binaries, those compiled by the user from source
854 * or those provided by the Chrome browser. In the later case, these binaries require
855 * that SDL loads a DLL providing the shader compiler.
856 *
857 * This variable can be set to the following values:
858 * "d3dcompiler_46.dll" - default, best for Vista or later.
859 * "d3dcompiler_43.dll" - for XP support.
860 * "none" - do not load any library, useful if you compiled ANGLE from source and included the compiler in your binaries.
861 *
862 */
863 #define SDL_HINT_VIDEO_WIN_D3DCOMPILER "SDL_VIDEO_WIN_D3DCOMPILER"
864
865 /**
866 * \brief A variable that is the address of another SDL_Window* (as a hex string formatted with "%p").
867 *
868 * If this hint is set before SDL_CreateWindowFrom() and the SDL_Window* it is set to has
869 * SDL_WINDOW_OPENGL set (and running on WGL only, currently), then two things will occur on the newly
870 * created SDL_Window:
871 *
872 * 1. Its pixel format will be set to the same pixel format as this SDL_Window. This is
873 * needed for example when sharing an OpenGL context across multiple windows.
874 *
875 * 2. The flag SDL_WINDOW_OPENGL will be set on the new window so it can be used for
876 * OpenGL rendering.
877 *
878 * This variable can be set to the following values:
879 * The address (as a string "%p") of the SDL_Window* that new windows created with SDL_CreateWindowFrom() should
880 * share a pixel format with.
881 */
882 #define SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT "SDL_VIDEO_WINDOW_SHARE_PIXEL_FORMAT"
883
884 /**
885 * \brief A URL to a WinRT app's privacy policy
886 *
887 * All network-enabled WinRT apps must make a privacy policy available to its
888 * users. On Windows 8, 8.1, and RT, Microsoft mandates that this policy be
889 * be available in the Windows Settings charm, as accessed from within the app.
890 * SDL provides code to add a URL-based link there, which can point to the app's
891 * privacy policy.
892 *
893 * To setup a URL to an app's privacy policy, set SDL_HINT_WINRT_PRIVACY_POLICY_URL
894 * before calling any SDL_Init() functions. The contents of the hint should
895 * be a valid URL. For example, "http://www.example.com".
896 *
897 * The default value is "", which will prevent SDL from adding a privacy policy
898 * link to the Settings charm. This hint should only be set during app init.
899 *
900 * The label text of an app's "Privacy Policy" link may be customized via another
901 * hint, SDL_HINT_WINRT_PRIVACY_POLICY_LABEL.
902 *
903 * Please note that on Windows Phone, Microsoft does not provide standard UI
904 * for displaying a privacy policy link, and as such, SDL_HINT_WINRT_PRIVACY_POLICY_URL
905 * will not get used on that platform. Network-enabled phone apps should display
906 * their privacy policy through some other, in-app means.
907 */
908 #define SDL_HINT_WINRT_PRIVACY_POLICY_URL "SDL_WINRT_PRIVACY_POLICY_URL"
909
910 /** \brief Label text for a WinRT app's privacy policy link
911 *
912 * Network-enabled WinRT apps must include a privacy policy. On Windows 8, 8.1, and RT,
913 * Microsoft mandates that this policy be available via the Windows Settings charm.
914 * SDL provides code to add a link there, with its label text being set via the
915 * optional hint, SDL_HINT_WINRT_PRIVACY_POLICY_LABEL.
916 *
917 * Please note that a privacy policy's contents are not set via this hint. A separate
918 * hint, SDL_HINT_WINRT_PRIVACY_POLICY_URL, is used to link to the actual text of the
919 * policy.
920 *
921 * The contents of this hint should be encoded as a UTF8 string.
922 *
923 * The default value is "Privacy Policy". This hint should only be set during app
924 * initialization, preferably before any calls to SDL_Init().
925 *
926 * For additional information on linking to a privacy policy, see the documentation for
927 * SDL_HINT_WINRT_PRIVACY_POLICY_URL.
928 */
929 #define SDL_HINT_WINRT_PRIVACY_POLICY_LABEL "SDL_WINRT_PRIVACY_POLICY_LABEL"
930
931 /** \brief Allows back-button-press events on Windows Phone to be marked as handled
932 *
933 * Windows Phone devices typically feature a Back button. When pressed,
934 * the OS will emit back-button-press events, which apps are expected to
935 * handle in an appropriate manner. If apps do not explicitly mark these
936 * events as 'Handled', then the OS will invoke its default behavior for
937 * unhandled back-button-press events, which on Windows Phone 8 and 8.1 is to
938 * terminate the app (and attempt to switch to the previous app, or to the
939 * device's home screen).
940 *
941 * Setting the SDL_HINT_WINRT_HANDLE_BACK_BUTTON hint to "1" will cause SDL
942 * to mark back-button-press events as Handled, if and when one is sent to
943 * the app.
944 *
945 * Internally, Windows Phone sends back button events as parameters to
946 * special back-button-press callback functions. Apps that need to respond
947 * to back-button-press events are expected to register one or more
948 * callback functions for such, shortly after being launched (during the
949 * app's initialization phase). After the back button is pressed, the OS
950 * will invoke these callbacks. If the app's callback(s) do not explicitly
951 * mark the event as handled by the time they return, or if the app never
952 * registers one of these callback, the OS will consider the event
953 * un-handled, and it will apply its default back button behavior (terminate
954 * the app).
955 *
956 * SDL registers its own back-button-press callback with the Windows Phone
957 * OS. This callback will emit a pair of SDL key-press events (SDL_KEYDOWN
958 * and SDL_KEYUP), each with a scancode of SDL_SCANCODE_AC_BACK, after which
959 * it will check the contents of the hint, SDL_HINT_WINRT_HANDLE_BACK_BUTTON.
960 * If the hint's value is set to "1", the back button event's Handled
961 * property will get set to 'true'. If the hint's value is set to something
962 * else, or if it is unset, SDL will leave the event's Handled property
963 * alone. (By default, the OS sets this property to 'false', to note.)
964 *
965 * SDL apps can either set SDL_HINT_WINRT_HANDLE_BACK_BUTTON well before a
966 * back button is pressed, or can set it in direct-response to a back button
967 * being pressed.
968 *
969 * In order to get notified when a back button is pressed, SDL apps should
970 * register a callback function with SDL_AddEventWatch(), and have it listen
971 * for SDL_KEYDOWN events that have a scancode of SDL_SCANCODE_AC_BACK.
972 * (Alternatively, SDL_KEYUP events can be listened-for. Listening for
973 * either event type is suitable.) Any value of SDL_HINT_WINRT_HANDLE_BACK_BUTTON
974 * set by such a callback, will be applied to the OS' current
975 * back-button-press event.
976 *
977 * More details on back button behavior in Windows Phone apps can be found
978 * at the following page, on Microsoft's developer site:
979 * http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj247550(v=vs.105).aspx
980 */
981 #define SDL_HINT_WINRT_HANDLE_BACK_BUTTON "SDL_WINRT_HANDLE_BACK_BUTTON"
982
983 /**
984 * \brief A variable that dictates policy for fullscreen Spaces on Mac OS X.
985 *
986 * This hint only applies to Mac OS X.
987 *
988 * The variable can be set to the following values:
989 * "0" - Disable Spaces support (FULLSCREEN_DESKTOP won't use them and
990 * SDL_WINDOW_RESIZABLE windows won't offer the "fullscreen"
991 * button on their titlebars).
992 * "1" - Enable Spaces support (FULLSCREEN_DESKTOP will use them and
993 * SDL_WINDOW_RESIZABLE windows will offer the "fullscreen"
994 * button on their titlebars).
995 *
996 * The default value is "1". Spaces are disabled regardless of this hint if
997 * the OS isn't at least Mac OS X Lion (10.7). This hint must be set before
998 * any windows are created.
999 */
1000 #define SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES "SDL_VIDEO_MAC_FULLSCREEN_SPACES"
1001
1002 /**
1003 * \brief When set don't force the SDL app to become a foreground process
1004 *
1005 * This hint only applies to Mac OS X.
1006 *
1007 */
1008 #define SDL_HINT_MAC_BACKGROUND_APP "SDL_MAC_BACKGROUND_APP"
1009
1010 /**
1011 * \brief Android APK expansion main file version. Should be a string number like "1", "2" etc.
1012 *
1013 * Must be set together with SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION.
1014 *
1015 * If both hints were set then SDL_RWFromFile() will look into expansion files
1016 * after a given relative path was not found in the internal storage and assets.
1017 *
1018 * By default this hint is not set and the APK expansion files are not searched.
1019 */
1020 #define SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION "SDL_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION"
1021
1022 /**
1023 * \brief Android APK expansion patch file version. Should be a string number like "1", "2" etc.
1024 *
1025 * Must be set together with SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION.
1026 *
1027 * If both hints were set then SDL_RWFromFile() will look into expansion files
1028 * after a given relative path was not found in the internal storage and assets.
1029 *
1030 * By default this hint is not set and the APK expansion files are not searched.
1031 */
1032 #define SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION "SDL_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION"
1033
1034 /**
1035 * \brief A variable to control whether certain IMEs should handle text editing internally instead of sending SDL_TEXTEDITING events.
1036 *
1037 * The variable can be set to the following values:
1038 * "0" - SDL_TEXTEDITING events are sent, and it is the application's
1039 * responsibility to render the text from these events and
1040 * differentiate it somehow from committed text. (default)
1041 * "1" - If supported by the IME then SDL_TEXTEDITING events are not sent,
1042 * and text that is being composed will be rendered in its own UI.
1043 */
1044 #define SDL_HINT_IME_INTERNAL_EDITING "SDL_IME_INTERNAL_EDITING"
1045
1046 /**
1047 * \brief A variable to control whether we trap the Android back button to handle it manually.
1048 * This is necessary for the right mouse button to work on some Android devices, or
1049 * to be able to trap the back button for use in your code reliably. If set to true,
1050 * the back button will show up as an SDL_KEYDOWN / SDL_KEYUP pair with a keycode of
1051 * SDL_SCANCODE_AC_BACK.
1052 *
1053 * The variable can be set to the following values:
1054 * "0" - Back button will be handled as usual for system. (default)
1055 * "1" - Back button will be trapped, allowing you to handle the key press
1056 * manually. (This will also let right mouse click work on systems
1057 * where the right mouse button functions as back.)
1058 *
1059 * The value of this hint is used at runtime, so it can be changed at any time.
1060 */
1061 #define SDL_HINT_ANDROID_TRAP_BACK_BUTTON "SDL_ANDROID_TRAP_BACK_BUTTON"
1062
1063 /**
1064 * \brief A variable to control whether the event loop will block itself when the app is paused.
1065 *
1066 * The variable can be set to the following values:
1067 * "0" - Non blocking.
1068 * "1" - Blocking. (default)
1069 *
1070 * The value should be set before SDL is initialized.
1071 */
1072 #define SDL_HINT_ANDROID_BLOCK_ON_PAUSE "SDL_ANDROID_BLOCK_ON_PAUSE"
1073
1074 /**
1075 * \brief A variable to control whether SDL will pause audio in background
1076 * (Requires SDL_ANDROID_BLOCK_ON_PAUSE as "Non blocking")
1077 *
1078 * The variable can be set to the following values:
1079 * "0" - Non paused.
1080 * "1" - Paused. (default)
1081 *
1082 * The value should be set before SDL is initialized.
1083 */
1084 #define SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO "SDL_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO"
1085
1086 /**
1087 * \brief A variable to control whether the return key on the soft keyboard
1088 * should hide the soft keyboard on Android and iOS.
1089 *
1090 * The variable can be set to the following values:
1091 * "0" - The return key will be handled as a key event. This is the behaviour of SDL <= 2.0.3. (default)
1092 * "1" - The return key will hide the keyboard.
1093 *
1094 * The value of this hint is used at runtime, so it can be changed at any time.
1095 */
1096 #define SDL_HINT_RETURN_KEY_HIDES_IME "SDL_RETURN_KEY_HIDES_IME"
1097
1098 /**
1099 * \brief override the binding element for keyboard inputs for Emscripten builds
1100 *
1101 * This hint only applies to the emscripten platform
1102 *
1103 * The variable can be one of
1104 * "#window" - The javascript window object (this is the default)
1105 * "#document" - The javascript document object
1106 * "#screen" - the javascript window.screen object
1107 * "#canvas" - the WebGL canvas element
1108 * any other string without a leading # sign applies to the element on the page with that ID.
1109 */
1110 #define SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT "SDL_EMSCRIPTEN_KEYBOARD_ELEMENT"
1111
1112 /**
1113 * \brief Disable giving back control to the browser automatically
1114 * when running with asyncify
1115 *
1116 * With -s ASYNCIFY, SDL2 calls emscripten_sleep during operations
1117 * such as refreshing the screen or polling events.
1118 *
1119 * This hint only applies to the emscripten platform
1120 *
1121 * The variable can be set to the following values:
1122 * "0" - Disable emscripten_sleep calls (if you give back browser control manually or use asyncify for other purposes)
1123 * "1" - Enable emscripten_sleep calls (the default)
1124 */
1125 #define SDL_HINT_EMSCRIPTEN_ASYNCIFY "SDL_EMSCRIPTEN_ASYNCIFY"
1126
1127 /**
1128 * \brief Tell SDL not to catch the SIGINT or SIGTERM signals.
1129 *
1130 * This hint only applies to Unix-like platforms, and should set before
1131 * any calls to SDL_Init()
1132 *
1133 * The variable can be set to the following values:
1134 * "0" - SDL will install a SIGINT and SIGTERM handler, and when it
1135 * catches a signal, convert it into an SDL_QUIT event.
1136 * "1" - SDL will not install a signal handler at all.
1137 */
1138 #define SDL_HINT_NO_SIGNAL_HANDLERS "SDL_NO_SIGNAL_HANDLERS"
1139
1140 /**
1141 * \brief Tell SDL not to generate window-close events for Alt+F4 on Windows.
1142 *
1143 * The variable can be set to the following values:
1144 * "0" - SDL will generate a window-close event when it sees Alt+F4.
1145 * "1" - SDL will only do normal key handling for Alt+F4.
1146 */
1147 #define SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 "SDL_WINDOWS_NO_CLOSE_ON_ALT_F4"
1148
1149 /**
1150 * \brief Prevent SDL from using version 4 of the bitmap header when saving BMPs.
1151 *
1152 * The bitmap header version 4 is required for proper alpha channel support and
1153 * SDL will use it when required. Should this not be desired, this hint can
1154 * force the use of the 40 byte header version which is supported everywhere.
1155 *
1156 * The variable can be set to the following values:
1157 * "0" - Surfaces with a colorkey or an alpha channel are saved to a
1158 * 32-bit BMP file with an alpha mask. SDL will use the bitmap
1159 * header version 4 and set the alpha mask accordingly.
1160 * "1" - Surfaces with a colorkey or an alpha channel are saved to a
1161 * 32-bit BMP file without an alpha mask. The alpha channel data
1162 * will be in the file, but applications are going to ignore it.
1163 *
1164 * The default value is "0".
1165 */
1166 #define SDL_HINT_BMP_SAVE_LEGACY_FORMAT "SDL_BMP_SAVE_LEGACY_FORMAT"
1167
1168 /**
1169 * \brief Tell SDL not to name threads on Windows with the 0x406D1388 Exception.
1170 * The 0x406D1388 Exception is a trick used to inform Visual Studio of a
1171 * thread's name, but it tends to cause problems with other debuggers,
1172 * and the .NET runtime. Note that SDL 2.0.6 and later will still use
1173 * the (safer) SetThreadDescription API, introduced in the Windows 10
1174 * Creators Update, if available.
1175 *
1176 * The variable can be set to the following values:
1177 * "0" - SDL will raise the 0x406D1388 Exception to name threads.
1178 * This is the default behavior of SDL <= 2.0.4.
1179 * "1" - SDL will not raise this exception, and threads will be unnamed. (default)
1180 * This is necessary with .NET languages or debuggers that aren't Visual Studio.
1181 */
1182 #define SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING "SDL_WINDOWS_DISABLE_THREAD_NAMING"
1183
1184 /**
1185 * \brief Tell SDL which Dispmanx layer to use on a Raspberry PI
1186 *
1187 * Also known as Z-order. The variable can take a negative or positive value.
1188 * The default is 10000.
1189 */
1190 #define SDL_HINT_RPI_VIDEO_LAYER "SDL_RPI_VIDEO_LAYER"
1191
1192 /**
1193 * \brief Tell the video driver that we only want a double buffer.
1194 *
1195 * By default, most lowlevel 2D APIs will use a triple buffer scheme that
1196 * wastes no CPU time on waiting for vsync after issuing a flip, but
1197 * introduces a frame of latency. On the other hand, using a double buffer
1198 * scheme instead is recommended for cases where low latency is an important
1199 * factor because we save a whole frame of latency.
1200 * We do so by waiting for vsync immediately after issuing a flip, usually just
1201 * after eglSwapBuffers call in the backend's *_SwapWindow function.
1202 *
1203 * Since it's driver-specific, it's only supported where possible and
1204 * implemented. Currently supported the following drivers:
1205 * - KMSDRM (kmsdrm)
1206 * - Raspberry Pi (raspberrypi)
1207 */
1208 #define SDL_HINT_VIDEO_DOUBLE_BUFFER "SDL_VIDEO_DOUBLE_BUFFER"
1209
1210 /**
1211 * \brief A variable controlling what driver to use for OpenGL ES contexts.
1212 *
1213 * On some platforms, currently Windows and X11, OpenGL drivers may support
1214 * creating contexts with an OpenGL ES profile. By default SDL uses these
1215 * profiles, when available, otherwise it attempts to load an OpenGL ES
1216 * library, e.g. that provided by the ANGLE project. This variable controls
1217 * whether SDL follows this default behaviour or will always load an
1218 * OpenGL ES library.
1219 *
1220 * Circumstances where this is useful include
1221 * - Testing an app with a particular OpenGL ES implementation, e.g ANGLE,
1222 * or emulator, e.g. those from ARM, Imagination or Qualcomm.
1223 * - Resolving OpenGL ES function addresses at link time by linking with
1224 * the OpenGL ES library instead of querying them at run time with
1225 * SDL_GL_GetProcAddress().
1226 *
1227 * Caution: for an application to work with the default behaviour across
1228 * different OpenGL drivers it must query the OpenGL ES function
1229 * addresses at run time using SDL_GL_GetProcAddress().
1230 *
1231 * This variable is ignored on most platforms because OpenGL ES is native
1232 * or not supported.
1233 *
1234 * This variable can be set to the following values:
1235 * "0" - Use ES profile of OpenGL, if available. (Default when not set.)
1236 * "1" - Load OpenGL ES library using the default library names.
1237 *
1238 */
1239 #define SDL_HINT_OPENGL_ES_DRIVER "SDL_OPENGL_ES_DRIVER"
1240
1241 /**
1242 * \brief A variable controlling speed/quality tradeoff of audio resampling.
1243 *
1244 * If available, SDL can use libsamplerate ( http://www.mega-nerd.com/SRC/ )
1245 * to handle audio resampling. There are different resampling modes available
1246 * that produce different levels of quality, using more CPU.
1247 *
1248 * If this hint isn't specified to a valid setting, or libsamplerate isn't
1249 * available, SDL will use the default, internal resampling algorithm.
1250 *
1251 * Note that this is currently only applicable to resampling audio that is
1252 * being written to a device for playback or audio being read from a device
1253 * for capture. SDL_AudioCVT always uses the default resampler (although this
1254 * might change for SDL 2.1).
1255 *
1256 * This hint is currently only checked at audio subsystem initialization.
1257 *
1258 * This variable can be set to the following values:
1259 *
1260 * "0" or "default" - Use SDL's internal resampling (Default when not set - low quality, fast)
1261 * "1" or "fast" - Use fast, slightly higher quality resampling, if available
1262 * "2" or "medium" - Use medium quality resampling, if available
1263 * "3" or "best" - Use high quality resampling, if available
1264 */
1265 #define SDL_HINT_AUDIO_RESAMPLING_MODE "SDL_AUDIO_RESAMPLING_MODE"
1266
1267 /**
1268 * \brief A variable controlling the audio category on iOS and Mac OS X
1269 *
1270 * This variable can be set to the following values:
1271 *
1272 * "ambient" - Use the AVAudioSessionCategoryAmbient audio category, will be muted by the phone mute switch (default)
1273 * "playback" - Use the AVAudioSessionCategoryPlayback category
1274 *
1275 * For more information, see Apple's documentation:
1276 * https://developer.apple.com/library/content/documentation/Audio/Conceptual/AudioSessionProgrammingGuide/AudioSessionCategoriesandModes/AudioSessionCategoriesandModes.html
1277 */
1278 #define SDL_HINT_AUDIO_CATEGORY "SDL_AUDIO_CATEGORY"
1279
1280 /**
1281 * \brief A variable controlling whether the 2D render API is compatible or efficient.
1282 *
1283 * This variable can be set to the following values:
1284 *
1285 * "0" - Don't use batching to make rendering more efficient.
1286 * "1" - Use batching, but might cause problems if app makes its own direct OpenGL calls.
1287 *
1288 * Up to SDL 2.0.9, the render API would draw immediately when requested. Now
1289 * it batches up draw requests and sends them all to the GPU only when forced
1290 * to (during SDL_RenderPresent, when changing render targets, by updating a
1291 * texture that the batch needs, etc). This is significantly more efficient,
1292 * but it can cause problems for apps that expect to render on top of the
1293 * render API's output. As such, SDL will disable batching if a specific
1294 * render backend is requested (since this might indicate that the app is
1295 * planning to use the underlying graphics API directly). This hint can
1296 * be used to explicitly request batching in this instance. It is a contract
1297 * that you will either never use the underlying graphics API directly, or
1298 * if you do, you will call SDL_RenderFlush() before you do so any current
1299 * batch goes to the GPU before your work begins. Not following this contract
1300 * will result in undefined behavior.
1301 */
1302 #define SDL_HINT_RENDER_BATCHING "SDL_RENDER_BATCHING"
1303
1304
1305 /**
1306 * \brief A variable controlling whether SDL updates joystick state when getting input events
1307 *
1308 * This variable can be set to the following values:
1309 *
1310 * "0" - You'll call SDL_JoystickUpdate() manually
1311 * "1" - SDL will automatically call SDL_JoystickUpdate() (default)
1312 *
1313 * This hint can be toggled on and off at runtime.
1314 */
1315 #define SDL_HINT_AUTO_UPDATE_JOYSTICKS "SDL_AUTO_UPDATE_JOYSTICKS"
1316
1317
1318 /**
1319 * \brief A variable controlling whether SDL updates sensor state when getting input events
1320 *
1321 * This variable can be set to the following values:
1322 *
1323 * "0" - You'll call SDL_SensorUpdate() manually
1324 * "1" - SDL will automatically call SDL_SensorUpdate() (default)
1325 *
1326 * This hint can be toggled on and off at runtime.
1327 */
1328 #define SDL_HINT_AUTO_UPDATE_SENSORS "SDL_AUTO_UPDATE_SENSORS"
1329
1330
1331 /**
1332 * \brief A variable controlling whether SDL logs all events pushed onto its internal queue.
1333 *
1334 * This variable can be set to the following values:
1335 *
1336 * "0" - Don't log any events (default)
1337 * "1" - Log all events except mouse and finger motion, which are pretty spammy.
1338 * "2" - Log all events.
1339 *
1340 * This is generally meant to be used to debug SDL itself, but can be useful
1341 * for application developers that need better visibility into what is going
1342 * on in the event queue. Logged events are sent through SDL_Log(), which
1343 * means by default they appear on stdout on most platforms or maybe
1344 * OutputDebugString() on Windows, and can be funneled by the app with
1345 * SDL_LogSetOutputFunction(), etc.
1346 *
1347 * This hint can be toggled on and off at runtime, if you only need to log
1348 * events for a small subset of program execution.
1349 */
1350 #define SDL_HINT_EVENT_LOGGING "SDL_EVENT_LOGGING"
1351
1352
1353
1354 /**
1355 * \brief Controls how the size of the RIFF chunk affects the loading of a WAVE file.
1356 *
1357 * The size of the RIFF chunk (which includes all the sub-chunks of the WAVE
1358 * file) is not always reliable. In case the size is wrong, it's possible to
1359 * just ignore it and step through the chunks until a fixed limit is reached.
1360 *
1361 * Note that files that have trailing data unrelated to the WAVE file or
1362 * corrupt files may slow down the loading process without a reliable boundary.
1363 * By default, SDL stops after 10000 chunks to prevent wasting time. Use the
1364 * environment variable SDL_WAVE_CHUNK_LIMIT to adjust this value.
1365 *
1366 * This variable can be set to the following values:
1367 *
1368 * "force" - Always use the RIFF chunk size as a boundary for the chunk search
1369 * "ignorezero" - Like "force", but a zero size searches up to 4 GiB (default)
1370 * "ignore" - Ignore the RIFF chunk size and always search up to 4 GiB
1371 * "maximum" - Search for chunks until the end of file (not recommended)
1372 */
1373 #define SDL_HINT_WAVE_RIFF_CHUNK_SIZE "SDL_WAVE_RIFF_CHUNK_SIZE"
1374
1375 /**
1376 * \brief Controls how a truncated WAVE file is handled.
1377 *
1378 * A WAVE file is considered truncated if any of the chunks are incomplete or
1379 * the data chunk size is not a multiple of the block size. By default, SDL
1380 * decodes until the first incomplete block, as most applications seem to do.
1381 *
1382 * This variable can be set to the following values:
1383 *
1384 * "verystrict" - Raise an error if the file is truncated
1385 * "strict" - Like "verystrict", but the size of the RIFF chunk is ignored
1386 * "dropframe" - Decode until the first incomplete sample frame
1387 * "dropblock" - Decode until the first incomplete block (default)
1388 */
1389 #define SDL_HINT_WAVE_TRUNCATION "SDL_WAVE_TRUNCATION"
1390
1391 /**
1392 * \brief Controls how the fact chunk affects the loading of a WAVE file.
1393 *
1394 * The fact chunk stores information about the number of samples of a WAVE
1395 * file. The Standards Update from Microsoft notes that this value can be used
1396 * to 'determine the length of the data in seconds'. This is especially useful
1397 * for compressed formats (for which this is a mandatory chunk) if they produce
1398 * multiple sample frames per block and truncating the block is not allowed.
1399 * The fact chunk can exactly specify how many sample frames there should be
1400 * in this case.
1401 *
1402 * Unfortunately, most application seem to ignore the fact chunk and so SDL
1403 * ignores it by default as well.
1404 *
1405 * This variable can be set to the following values:
1406 *
1407 * "truncate" - Use the number of samples to truncate the wave data if
1408 * the fact chunk is present and valid
1409 * "strict" - Like "truncate", but raise an error if the fact chunk
1410 * is invalid, not present for non-PCM formats, or if the
1411 * data chunk doesn't have that many samples
1412 * "ignorezero" - Like "truncate", but ignore fact chunk if the number of
1413 * samples is zero
1414 * "ignore" - Ignore fact chunk entirely (default)
1415 */
1416 #define SDL_HINT_WAVE_FACT_CHUNK "SDL_WAVE_FACT_CHUNK"
1417
1418 /**
1419 * \brief Override for SDL_GetDisplayUsableBounds()
1420 *
1421 * If set, this hint will override the expected results for
1422 * SDL_GetDisplayUsableBounds() for display index 0. Generally you don't want
1423 * to do this, but this allows an embedded system to request that some of the
1424 * screen be reserved for other uses when paired with a well-behaved
1425 * application.
1426 *
1427 * The contents of this hint must be 4 comma-separated integers, the first
1428 * is the bounds x, then y, width and height, in that order.
1429 */
1430 #define SDL_HINT_DISPLAY_USABLE_BOUNDS "SDL_DISPLAY_USABLE_BOUNDS"
1431
1432 /**
1433 * \brief Specify an application name for an audio device.
1434 *
1435 * Some audio backends (such as PulseAudio) allow you to describe your audio
1436 * stream. Among other things, this description might show up in a system
1437 * control panel that lets the user adjust the volume on specific audio
1438 * streams instead of using one giant master volume slider.
1439 *
1440 * This hints lets you transmit that information to the OS. The contents of
1441 * this hint are used while opening an audio device. You should use a string
1442 * that describes your program ("My Game 2: The Revenge")
1443 *
1444 * Setting this to "" or leaving it unset will have SDL use a reasonable
1445 * default: probably the application's name or "SDL Application" if SDL
1446 * doesn't have any better information.
1447 *
1448 * On targets where this is not supported, this hint does nothing.
1449 */
1450 #define SDL_HINT_AUDIO_DEVICE_APP_NAME "SDL_AUDIO_DEVICE_APP_NAME"
1451
1452 /**
1453 * \brief Specify an application name for an audio device.
1454 *
1455 * Some audio backends (such as PulseAudio) allow you to describe your audio
1456 * stream. Among other things, this description might show up in a system
1457 * control panel that lets the user adjust the volume on specific audio
1458 * streams instead of using one giant master volume slider.
1459 *
1460 * This hints lets you transmit that information to the OS. The contents of
1461 * this hint are used while opening an audio device. You should use a string
1462 * that describes your what your program is playing ("audio stream" is
1463 * probably sufficient in many cases, but this could be useful for something
1464 * like "team chat" if you have a headset playing VoIP audio separately).
1465 *
1466 * Setting this to "" or leaving it unset will have SDL use a reasonable
1467 * default: "audio stream" or something similar.
1468 *
1469 * On targets where this is not supported, this hint does nothing.
1470 */
1471 #define SDL_HINT_AUDIO_DEVICE_STREAM_NAME "SDL_AUDIO_DEVICE_STREAM_NAME"
1472
1473
1474 /**
1475 * \brief Override for SDL_GetPreferredLocales()
1476 *
1477 * If set, this will be favored over anything the OS might report for the
1478 * user's preferred locales. Changing this hint at runtime will not generate
1479 * a SDL_LOCALECHANGED event (but if you can change the hint, you can push
1480 * your own event, if you want).
1481 *
1482 * The format of this hint is a comma-separated list of language and locale,
1483 * combined with an underscore, as is a common format: "en_GB". Locale is
1484 * optional: "en". So you might have a list like this: "en_GB,jp,es_PT"
1485 */
1486 #define SDL_HINT_PREFERRED_LOCALES "SDL_PREFERRED_LOCALES"
1487
1488
1489 /**
1490 * \brief An enumeration of hint priorities
1491 */
1492 typedef enum
1493 {
1494 SDL_HINT_DEFAULT,
1495 SDL_HINT_NORMAL,
1496 SDL_HINT_OVERRIDE
1497 } SDL_HintPriority;
1498
1499
1500 /**
1501 * \brief Set a hint with a specific priority
1502 *
1503 * The priority controls the behavior when setting a hint that already
1504 * has a value. Hints will replace existing hints of their priority and
1505 * lower. Environment variables are considered to have override priority.
1506 *
1507 * \return SDL_TRUE if the hint was set, SDL_FALSE otherwise
1508 */
1509 extern DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name,
1510 const char *value,
1511 SDL_HintPriority priority);
1512
1513 /**
1514 * \brief Set a hint with normal priority
1515 *
1516 * \return SDL_TRUE if the hint was set, SDL_FALSE otherwise
1517 */
1518 extern DECLSPEC SDL_bool SDLCALL SDL_SetHint(const char *name,
1519 const char *value);
1520
1521 /**
1522 * \brief Get a hint
1523 *
1524 * \return The string value of a hint variable.
1525 */
1526 extern DECLSPEC const char * SDLCALL SDL_GetHint(const char *name);
1527
1528 /**
1529 * \brief Get a hint
1530 *
1531 * \return The boolean value of a hint variable.
1532 */
1533 extern DECLSPEC SDL_bool SDLCALL SDL_GetHintBoolean(const char *name, SDL_bool default_value);
1534
1535 /**
1536 * \brief type definition of the hint callback function.
1537 */
1538 typedef void (SDLCALL *SDL_HintCallback)(void *userdata, const char *name, const char *oldValue, const char *newValue);
1539
1540 /**
1541 * \brief Add a function to watch a particular hint
1542 *
1543 * \param name The hint to watch
1544 * \param callback The function to call when the hint value changes
1545 * \param userdata A pointer to pass to the callback function
1546 */
1547 extern DECLSPEC void SDLCALL SDL_AddHintCallback(const char *name,
1548 SDL_HintCallback callback,
1549 void *userdata);
1550
1551 /**
1552 * \brief Remove a function watching a particular hint
1553 *
1554 * \param name The hint being watched
1555 * \param callback The function being called when the hint value changes
1556 * \param userdata A pointer being passed to the callback function
1557 */
1558 extern DECLSPEC void SDLCALL SDL_DelHintCallback(const char *name,
1559 SDL_HintCallback callback,
1560 void *userdata);
1561
1562 /**
1563 * \brief Clear all hints
1564 *
1565 * This function is called during SDL_Quit() to free stored hints.
1566 */
1567 extern DECLSPEC void SDLCALL SDL_ClearHints(void);
1568
1569
1570 /* Ends C function definitions when using C++ */
1571 #ifdef __cplusplus
1572 }
1573 #endif
1574 #include "close_code.h"
1575
1576 #endif /* SDL_hints_h_ */
1577
1578 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_joystick.h added (mode: 100644) (index 0000000..0bbeafe)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_joystick.h
24 *
25 * Include file for SDL joystick event handling
26 *
27 * The term "device_index" identifies currently plugged in joystick devices between 0 and SDL_NumJoysticks(), with the exact joystick
28 * behind a device_index changing as joysticks are plugged and unplugged.
29 *
30 * The term "instance_id" is the current instantiation of a joystick device in the system, if the joystick is removed and then re-inserted
31 * then it will get a new instance_id, instance_id's are monotonically increasing identifiers of a joystick plugged in.
32 *
33 * The term JoystickGUID is a stable 128-bit identifier for a joystick device that does not change over time, it identifies class of
34 * the device (a X360 wired controller for example). This identifier is platform dependent.
35 *
36 *
37 */
38
39 #ifndef SDL_joystick_h_
40 #define SDL_joystick_h_
41
42 #include "SDL_stdinc.h"
43 #include "SDL_error.h"
44
45 #include "begin_code.h"
46 /* Set up for C function definitions, even when using C++ */
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50
51 /**
52 * \file SDL_joystick.h
53 *
54 * In order to use these functions, SDL_Init() must have been called
55 * with the ::SDL_INIT_JOYSTICK flag. This causes SDL to scan the system
56 * for joysticks, and load appropriate drivers.
57 *
58 * If you would like to receive joystick updates while the application
59 * is in the background, you should set the following hint before calling
60 * SDL_Init(): SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS
61 */
62
63 /**
64 * The joystick structure used to identify an SDL joystick
65 */
66 struct _SDL_Joystick;
67 typedef struct _SDL_Joystick SDL_Joystick;
68
69 /* A structure that encodes the stable unique id for a joystick device */
70 typedef struct {
71 Uint8 data[16];
72 } SDL_JoystickGUID;
73
74 /**
75 * This is a unique ID for a joystick for the time it is connected to the system,
76 * and is never reused for the lifetime of the application. If the joystick is
77 * disconnected and reconnected, it will get a new ID.
78 *
79 * The ID value starts at 0 and increments from there. The value -1 is an invalid ID.
80 */
81 typedef Sint32 SDL_JoystickID;
82
83 typedef enum
84 {
85 SDL_JOYSTICK_TYPE_UNKNOWN,
86 SDL_JOYSTICK_TYPE_GAMECONTROLLER,
87 SDL_JOYSTICK_TYPE_WHEEL,
88 SDL_JOYSTICK_TYPE_ARCADE_STICK,
89 SDL_JOYSTICK_TYPE_FLIGHT_STICK,
90 SDL_JOYSTICK_TYPE_DANCE_PAD,
91 SDL_JOYSTICK_TYPE_GUITAR,
92 SDL_JOYSTICK_TYPE_DRUM_KIT,
93 SDL_JOYSTICK_TYPE_ARCADE_PAD,
94 SDL_JOYSTICK_TYPE_THROTTLE
95 } SDL_JoystickType;
96
97 typedef enum
98 {
99 SDL_JOYSTICK_POWER_UNKNOWN = -1,
100 SDL_JOYSTICK_POWER_EMPTY, /* <= 5% */
101 SDL_JOYSTICK_POWER_LOW, /* <= 20% */
102 SDL_JOYSTICK_POWER_MEDIUM, /* <= 70% */
103 SDL_JOYSTICK_POWER_FULL, /* <= 100% */
104 SDL_JOYSTICK_POWER_WIRED,
105 SDL_JOYSTICK_POWER_MAX
106 } SDL_JoystickPowerLevel;
107
108 /* Set max recognized G-force from accelerometer
109 See src/joystick/uikit/SDL_sysjoystick.m for notes on why this is needed
110 */
111 #define SDL_IPHONE_MAX_GFORCE 5.0
112
113
114 /* Function prototypes */
115
116 /**
117 * Locking for multi-threaded access to the joystick API
118 *
119 * If you are using the joystick API or handling events from multiple threads
120 * you should use these locking functions to protect access to the joysticks.
121 *
122 * In particular, you are guaranteed that the joystick list won't change, so
123 * the API functions that take a joystick index will be valid, and joystick
124 * and game controller events will not be delivered.
125 */
126 extern DECLSPEC void SDLCALL SDL_LockJoysticks(void);
127 extern DECLSPEC void SDLCALL SDL_UnlockJoysticks(void);
128
129 /**
130 * Count the number of joysticks attached to the system right now
131 */
132 extern DECLSPEC int SDLCALL SDL_NumJoysticks(void);
133
134 /**
135 * Get the implementation dependent name of a joystick.
136 * This can be called before any joysticks are opened.
137 * If no name can be found, this function returns NULL.
138 */
139 extern DECLSPEC const char *SDLCALL SDL_JoystickNameForIndex(int device_index);
140
141 /**
142 * Get the player index of a joystick, or -1 if it's not available
143 * This can be called before any joysticks are opened.
144 */
145 extern DECLSPEC int SDLCALL SDL_JoystickGetDevicePlayerIndex(int device_index);
146
147 /**
148 * Return the GUID for the joystick at this index
149 * This can be called before any joysticks are opened.
150 */
151 extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetDeviceGUID(int device_index);
152
153 /**
154 * Get the USB vendor ID of a joystick, if available.
155 * This can be called before any joysticks are opened.
156 * If the vendor ID isn't available this function returns 0.
157 */
158 extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceVendor(int device_index);
159
160 /**
161 * Get the USB product ID of a joystick, if available.
162 * This can be called before any joysticks are opened.
163 * If the product ID isn't available this function returns 0.
164 */
165 extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceProduct(int device_index);
166
167 /**
168 * Get the product version of a joystick, if available.
169 * This can be called before any joysticks are opened.
170 * If the product version isn't available this function returns 0.
171 */
172 extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceProductVersion(int device_index);
173
174 /**
175 * Get the type of a joystick, if available.
176 * This can be called before any joysticks are opened.
177 */
178 extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetDeviceType(int device_index);
179
180 /**
181 * Get the instance ID of a joystick.
182 * This can be called before any joysticks are opened.
183 * If the index is out of range, this function will return -1.
184 */
185 extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickGetDeviceInstanceID(int device_index);
186
187 /**
188 * Open a joystick for use.
189 * The index passed as an argument refers to the N'th joystick on the system.
190 * This index is not the value which will identify this joystick in future
191 * joystick events. The joystick's instance id (::SDL_JoystickID) will be used
192 * there instead.
193 *
194 * \return A joystick identifier, or NULL if an error occurred.
195 */
196 extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickOpen(int device_index);
197
198 /**
199 * Return the SDL_Joystick associated with an instance id.
200 */
201 extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromInstanceID(SDL_JoystickID instance_id);
202
203 /**
204 * Return the SDL_Joystick associated with a player index.
205 */
206 extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromPlayerIndex(int player_index);
207
208 /**
209 * Attaches a new virtual joystick.
210 * Returns the joystick's device index, or -1 if an error occurred.
211 */
212 extern DECLSPEC int SDLCALL SDL_JoystickAttachVirtual(SDL_JoystickType type,
213 int naxes,
214 int nbuttons,
215 int nhats);
216
217 /**
218 * Detaches a virtual joystick
219 * Returns 0 on success, or -1 if an error occurred.
220 */
221 extern DECLSPEC int SDLCALL SDL_JoystickDetachVirtual(int device_index);
222
223 /**
224 * Indicates whether or not a virtual-joystick is at a given device index.
225 */
226 extern DECLSPEC SDL_bool SDLCALL SDL_JoystickIsVirtual(int device_index);
227
228 /**
229 * Set values on an opened, virtual-joystick's controls.
230 * Please note that values set here will not be applied until the next
231 * call to SDL_JoystickUpdate, which can either be called directly,
232 * or can be called indirectly through various other SDL APIS,
233 * including, but not limited to the following: SDL_PollEvent,
234 * SDL_PumpEvents, SDL_WaitEventTimeout, SDL_WaitEvent.
235 *
236 * Returns 0 on success, -1 on error.
237 */
238 extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualAxis(SDL_Joystick *joystick, int axis, Sint16 value);
239 extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualButton(SDL_Joystick *joystick, int button, Uint8 value);
240 extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualHat(SDL_Joystick *joystick, int hat, Uint8 value);
241
242 /**
243 * Return the name for this currently opened joystick.
244 * If no name can be found, this function returns NULL.
245 */
246 extern DECLSPEC const char *SDLCALL SDL_JoystickName(SDL_Joystick *joystick);
247
248 /**
249 * Get the player index of an opened joystick, or -1 if it's not available
250 *
251 * For XInput controllers this returns the XInput user index.
252 */
253 extern DECLSPEC int SDLCALL SDL_JoystickGetPlayerIndex(SDL_Joystick *joystick);
254
255 /**
256 * Set the player index of an opened joystick
257 */
258 extern DECLSPEC void SDLCALL SDL_JoystickSetPlayerIndex(SDL_Joystick *joystick, int player_index);
259
260 /**
261 * Return the GUID for this opened joystick
262 */
263 extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUID(SDL_Joystick *joystick);
264
265 /**
266 * Get the USB vendor ID of an opened joystick, if available.
267 * If the vendor ID isn't available this function returns 0.
268 */
269 extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetVendor(SDL_Joystick *joystick);
270
271 /**
272 * Get the USB product ID of an opened joystick, if available.
273 * If the product ID isn't available this function returns 0.
274 */
275 extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProduct(SDL_Joystick *joystick);
276
277 /**
278 * Get the product version of an opened joystick, if available.
279 * If the product version isn't available this function returns 0.
280 */
281 extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProductVersion(SDL_Joystick *joystick);
282
283 /**
284 * Get the serial number of an opened joystick, if available.
285 *
286 * Returns the serial number of the joystick, or NULL if it is not available.
287 */
288 extern DECLSPEC const char * SDLCALL SDL_JoystickGetSerial(SDL_Joystick *joystick);
289
290 /**
291 * Get the type of an opened joystick.
292 */
293 extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetType(SDL_Joystick *joystick);
294
295 /**
296 * Return a string representation for this guid. pszGUID must point to at least 33 bytes
297 * (32 for the string plus a NULL terminator).
298 */
299 extern DECLSPEC void SDLCALL SDL_JoystickGetGUIDString(SDL_JoystickGUID guid, char *pszGUID, int cbGUID);
300
301 /**
302 * Convert a string into a joystick guid
303 */
304 extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUIDFromString(const char *pchGUID);
305
306 /**
307 * Returns SDL_TRUE if the joystick has been opened and currently connected, or SDL_FALSE if it has not.
308 */
309 extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAttached(SDL_Joystick *joystick);
310
311 /**
312 * Get the instance ID of an opened joystick or -1 if the joystick is invalid.
313 */
314 extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickInstanceID(SDL_Joystick *joystick);
315
316 /**
317 * Get the number of general axis controls on a joystick.
318 */
319 extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick *joystick);
320
321 /**
322 * Get the number of trackballs on a joystick.
323 *
324 * Joystick trackballs have only relative motion events associated
325 * with them and their state cannot be polled.
326 */
327 extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick *joystick);
328
329 /**
330 * Get the number of POV hats on a joystick.
331 */
332 extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick *joystick);
333
334 /**
335 * Get the number of buttons on a joystick.
336 */
337 extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick *joystick);
338
339 /**
340 * Update the current state of the open joysticks.
341 *
342 * This is called automatically by the event loop if any joystick
343 * events are enabled.
344 */
345 extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void);
346
347 /**
348 * Enable/disable joystick event polling.
349 *
350 * If joystick events are disabled, you must call SDL_JoystickUpdate()
351 * yourself and check the state of the joystick when you want joystick
352 * information.
353 *
354 * The state can be one of ::SDL_QUERY, ::SDL_ENABLE or ::SDL_IGNORE.
355 */
356 extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state);
357
358 #define SDL_JOYSTICK_AXIS_MAX 32767
359 #define SDL_JOYSTICK_AXIS_MIN -32768
360 /**
361 * Get the current state of an axis control on a joystick.
362 *
363 * The state is a value ranging from -32768 to 32767.
364 *
365 * The axis indices start at index 0.
366 */
367 extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick *joystick,
368 int axis);
369
370 /**
371 * Get the initial state of an axis control on a joystick.
372 *
373 * The state is a value ranging from -32768 to 32767.
374 *
375 * The axis indices start at index 0.
376 *
377 * \return SDL_TRUE if this axis has any initial value, or SDL_FALSE if not.
378 */
379 extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAxisInitialState(SDL_Joystick *joystick,
380 int axis, Sint16 *state);
381
382 /**
383 * \name Hat positions
384 */
385 /* @{ */
386 #define SDL_HAT_CENTERED 0x00
387 #define SDL_HAT_UP 0x01
388 #define SDL_HAT_RIGHT 0x02
389 #define SDL_HAT_DOWN 0x04
390 #define SDL_HAT_LEFT 0x08
391 #define SDL_HAT_RIGHTUP (SDL_HAT_RIGHT|SDL_HAT_UP)
392 #define SDL_HAT_RIGHTDOWN (SDL_HAT_RIGHT|SDL_HAT_DOWN)
393 #define SDL_HAT_LEFTUP (SDL_HAT_LEFT|SDL_HAT_UP)
394 #define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT|SDL_HAT_DOWN)
395 /* @} */
396
397 /**
398 * Get the current state of a POV hat on a joystick.
399 *
400 * The hat indices start at index 0.
401 *
402 * \return The return value is one of the following positions:
403 * - ::SDL_HAT_CENTERED
404 * - ::SDL_HAT_UP
405 * - ::SDL_HAT_RIGHT
406 * - ::SDL_HAT_DOWN
407 * - ::SDL_HAT_LEFT
408 * - ::SDL_HAT_RIGHTUP
409 * - ::SDL_HAT_RIGHTDOWN
410 * - ::SDL_HAT_LEFTUP
411 * - ::SDL_HAT_LEFTDOWN
412 */
413 extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick *joystick,
414 int hat);
415
416 /**
417 * Get the ball axis change since the last poll.
418 *
419 * \return 0, or -1 if you passed it invalid parameters.
420 *
421 * The ball indices start at index 0.
422 */
423 extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick *joystick,
424 int ball, int *dx, int *dy);
425
426 /**
427 * Get the current state of a button on a joystick.
428 *
429 * The button indices start at index 0.
430 */
431 extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick *joystick,
432 int button);
433
434 /**
435 * Start a rumble effect
436 * Each call to this function cancels any previous rumble effect, and calling it with 0 intensity stops any rumbling.
437 *
438 * \param joystick The joystick to vibrate
439 * \param low_frequency_rumble The intensity of the low frequency (left) rumble motor, from 0 to 0xFFFF
440 * \param high_frequency_rumble The intensity of the high frequency (right) rumble motor, from 0 to 0xFFFF
441 * \param duration_ms The duration of the rumble effect, in milliseconds
442 *
443 * \return 0, or -1 if rumble isn't supported on this joystick
444 */
445 extern DECLSPEC int SDLCALL SDL_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms);
446
447 /**
448 * Start a rumble effect in the joystick's triggers
449 * Each call to this function cancels any previous trigger rumble effect, and calling it with 0 intensity stops any rumbling.
450 *
451 * \param joystick The joystick to vibrate
452 * \param left_rumble The intensity of the left trigger rumble motor, from 0 to 0xFFFF
453 * \param right_rumble The intensity of the right trigger rumble motor, from 0 to 0xFFFF
454 * \param duration_ms The duration of the rumble effect, in milliseconds
455 *
456 * \return 0, or -1 if trigger rumble isn't supported on this joystick
457 */
458 extern DECLSPEC int SDLCALL SDL_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms);
459
460 /**
461 * Return whether a joystick has an LED
462 *
463 * \param joystick The joystick to query
464 *
465 * \return SDL_TRUE, or SDL_FALSE if this joystick does not have a modifiable LED
466 */
467 extern DECLSPEC SDL_bool SDLCALL SDL_JoystickHasLED(SDL_Joystick *joystick);
468
469 /**
470 * Update a joystick's LED color.
471 *
472 * \param joystick The joystick to update
473 * \param red The intensity of the red LED
474 * \param green The intensity of the green LED
475 * \param blue The intensity of the blue LED
476 *
477 * \return 0, or -1 if this joystick does not have a modifiable LED
478 */
479 extern DECLSPEC int SDLCALL SDL_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue);
480
481 /**
482 * Close a joystick previously opened with SDL_JoystickOpen().
483 */
484 extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick *joystick);
485
486 /**
487 * Return the battery level of this joystick
488 */
489 extern DECLSPEC SDL_JoystickPowerLevel SDLCALL SDL_JoystickCurrentPowerLevel(SDL_Joystick *joystick);
490
491 /* Ends C function definitions when using C++ */
492 #ifdef __cplusplus
493 }
494 #endif
495 #include "close_code.h"
496
497 #endif /* SDL_joystick_h_ */
498
499 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_keyboard.h added (mode: 100644) (index 0000000..f6853c6)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_keyboard.h
24 *
25 * Include file for SDL keyboard event handling
26 */
27
28 #ifndef SDL_keyboard_h_
29 #define SDL_keyboard_h_
30
31 #include "SDL_stdinc.h"
32 #include "SDL_error.h"
33 #include "SDL_keycode.h"
34 #include "SDL_video.h"
35
36 #include "begin_code.h"
37 /* Set up for C function definitions, even when using C++ */
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41
42 /**
43 * \brief The SDL keysym structure, used in key events.
44 *
45 * \note If you are looking for translated character input, see the ::SDL_TEXTINPUT event.
46 */
47 typedef struct SDL_Keysym
48 {
49 SDL_Scancode scancode; /**< SDL physical key code - see ::SDL_Scancode for details */
50 SDL_Keycode sym; /**< SDL virtual key code - see ::SDL_Keycode for details */
51 Uint16 mod; /**< current key modifiers */
52 Uint32 unused;
53 } SDL_Keysym;
54
55 /* Function prototypes */
56
57 /**
58 * \brief Get the window which currently has keyboard focus.
59 */
60 extern DECLSPEC SDL_Window * SDLCALL SDL_GetKeyboardFocus(void);
61
62 /**
63 * \brief Get a snapshot of the current state of the keyboard.
64 *
65 * \param numkeys if non-NULL, receives the length of the returned array.
66 *
67 * \return An array of key states. Indexes into this array are obtained by using ::SDL_Scancode values.
68 *
69 * \b Example:
70 * \code
71 * const Uint8 *state = SDL_GetKeyboardState(NULL);
72 * if ( state[SDL_SCANCODE_RETURN] ) {
73 * printf("<RETURN> is pressed.\n");
74 * }
75 * \endcode
76 */
77 extern DECLSPEC const Uint8 *SDLCALL SDL_GetKeyboardState(int *numkeys);
78
79 /**
80 * \brief Get the current key modifier state for the keyboard.
81 */
82 extern DECLSPEC SDL_Keymod SDLCALL SDL_GetModState(void);
83
84 /**
85 * \brief Set the current key modifier state for the keyboard.
86 *
87 * \note This does not change the keyboard state, only the key modifier flags.
88 */
89 extern DECLSPEC void SDLCALL SDL_SetModState(SDL_Keymod modstate);
90
91 /**
92 * \brief Get the key code corresponding to the given scancode according
93 * to the current keyboard layout.
94 *
95 * See ::SDL_Keycode for details.
96 *
97 * \sa SDL_GetKeyName()
98 */
99 extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode);
100
101 /**
102 * \brief Get the scancode corresponding to the given key code according to the
103 * current keyboard layout.
104 *
105 * See ::SDL_Scancode for details.
106 *
107 * \sa SDL_GetScancodeName()
108 */
109 extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromKey(SDL_Keycode key);
110
111 /**
112 * \brief Get a human-readable name for a scancode.
113 *
114 * \return A pointer to the name for the scancode.
115 * If the scancode doesn't have a name, this function returns
116 * an empty string ("").
117 *
118 * \sa SDL_Scancode
119 */
120 extern DECLSPEC const char *SDLCALL SDL_GetScancodeName(SDL_Scancode scancode);
121
122 /**
123 * \brief Get a scancode from a human-readable name
124 *
125 * \return scancode, or SDL_SCANCODE_UNKNOWN if the name wasn't recognized
126 *
127 * \sa SDL_Scancode
128 */
129 extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromName(const char *name);
130
131 /**
132 * \brief Get a human-readable name for a key.
133 *
134 * \return A pointer to a UTF-8 string that stays valid at least until the next
135 * call to this function. If you need it around any longer, you must
136 * copy it. If the key doesn't have a name, this function returns an
137 * empty string ("").
138 *
139 * \sa SDL_Keycode
140 */
141 extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDL_Keycode key);
142
143 /**
144 * \brief Get a key code from a human-readable name
145 *
146 * \return key code, or SDLK_UNKNOWN if the name wasn't recognized
147 *
148 * \sa SDL_Keycode
149 */
150 extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName(const char *name);
151
152 /**
153 * \brief Start accepting Unicode text input events.
154 * This function will show the on-screen keyboard if supported.
155 *
156 * \sa SDL_StopTextInput()
157 * \sa SDL_SetTextInputRect()
158 * \sa SDL_HasScreenKeyboardSupport()
159 */
160 extern DECLSPEC void SDLCALL SDL_StartTextInput(void);
161
162 /**
163 * \brief Return whether or not Unicode text input events are enabled.
164 *
165 * \sa SDL_StartTextInput()
166 * \sa SDL_StopTextInput()
167 */
168 extern DECLSPEC SDL_bool SDLCALL SDL_IsTextInputActive(void);
169
170 /**
171 * \brief Stop receiving any text input events.
172 * This function will hide the on-screen keyboard if supported.
173 *
174 * \sa SDL_StartTextInput()
175 * \sa SDL_HasScreenKeyboardSupport()
176 */
177 extern DECLSPEC void SDLCALL SDL_StopTextInput(void);
178
179 /**
180 * \brief Set the rectangle used to type Unicode text inputs.
181 * This is used as a hint for IME and on-screen keyboard placement.
182 *
183 * \sa SDL_StartTextInput()
184 */
185 extern DECLSPEC void SDLCALL SDL_SetTextInputRect(SDL_Rect *rect);
186
187 /**
188 * \brief Returns whether the platform has some screen keyboard support.
189 *
190 * \return SDL_TRUE if some keyboard support is available else SDL_FALSE.
191 *
192 * \note Not all screen keyboard functions are supported on all platforms.
193 *
194 * \sa SDL_IsScreenKeyboardShown()
195 */
196 extern DECLSPEC SDL_bool SDLCALL SDL_HasScreenKeyboardSupport(void);
197
198 /**
199 * \brief Returns whether the screen keyboard is shown for given window.
200 *
201 * \param window The window for which screen keyboard should be queried.
202 *
203 * \return SDL_TRUE if screen keyboard is shown else SDL_FALSE.
204 *
205 * \sa SDL_HasScreenKeyboardSupport()
206 */
207 extern DECLSPEC SDL_bool SDLCALL SDL_IsScreenKeyboardShown(SDL_Window *window);
208
209 /* Ends C function definitions when using C++ */
210 #ifdef __cplusplus
211 }
212 #endif
213 #include "close_code.h"
214
215 #endif /* SDL_keyboard_h_ */
216
217 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_keycode.h added (mode: 100644) (index 0000000..6f6b65c)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_keycode.h
24 *
25 * Defines constants which identify keyboard keys and modifiers.
26 */
27
28 #ifndef SDL_keycode_h_
29 #define SDL_keycode_h_
30
31 #include "SDL_stdinc.h"
32 #include "SDL_scancode.h"
33
34 /**
35 * \brief The SDL virtual key representation.
36 *
37 * Values of this type are used to represent keyboard keys using the current
38 * layout of the keyboard. These values include Unicode values representing
39 * the unmodified character that would be generated by pressing the key, or
40 * an SDLK_* constant for those keys that do not generate characters.
41 *
42 * A special exception is the number keys at the top of the keyboard which
43 * always map to SDLK_0...SDLK_9, regardless of layout.
44 */
45 typedef Sint32 SDL_Keycode;
46
47 #define SDLK_SCANCODE_MASK (1<<30)
48 #define SDL_SCANCODE_TO_KEYCODE(X) (X | SDLK_SCANCODE_MASK)
49
50 typedef enum
51 {
52 SDLK_UNKNOWN = 0,
53
54 SDLK_RETURN = '\r',
55 SDLK_ESCAPE = '\033',
56 SDLK_BACKSPACE = '\b',
57 SDLK_TAB = '\t',
58 SDLK_SPACE = ' ',
59 SDLK_EXCLAIM = '!',
60 SDLK_QUOTEDBL = '"',
61 SDLK_HASH = '#',
62 SDLK_PERCENT = '%',
63 SDLK_DOLLAR = '$',
64 SDLK_AMPERSAND = '&',
65 SDLK_QUOTE = '\'',
66 SDLK_LEFTPAREN = '(',
67 SDLK_RIGHTPAREN = ')',
68 SDLK_ASTERISK = '*',
69 SDLK_PLUS = '+',
70 SDLK_COMMA = ',',
71 SDLK_MINUS = '-',
72 SDLK_PERIOD = '.',
73 SDLK_SLASH = '/',
74 SDLK_0 = '0',
75 SDLK_1 = '1',
76 SDLK_2 = '2',
77 SDLK_3 = '3',
78 SDLK_4 = '4',
79 SDLK_5 = '5',
80 SDLK_6 = '6',
81 SDLK_7 = '7',
82 SDLK_8 = '8',
83 SDLK_9 = '9',
84 SDLK_COLON = ':',
85 SDLK_SEMICOLON = ';',
86 SDLK_LESS = '<',
87 SDLK_EQUALS = '=',
88 SDLK_GREATER = '>',
89 SDLK_QUESTION = '?',
90 SDLK_AT = '@',
91
92 /*
93 Skip uppercase letters
94 */
95
96 SDLK_LEFTBRACKET = '[',
97 SDLK_BACKSLASH = '\\',
98 SDLK_RIGHTBRACKET = ']',
99 SDLK_CARET = '^',
100 SDLK_UNDERSCORE = '_',
101 SDLK_BACKQUOTE = '`',
102 SDLK_a = 'a',
103 SDLK_b = 'b',
104 SDLK_c = 'c',
105 SDLK_d = 'd',
106 SDLK_e = 'e',
107 SDLK_f = 'f',
108 SDLK_g = 'g',
109 SDLK_h = 'h',
110 SDLK_i = 'i',
111 SDLK_j = 'j',
112 SDLK_k = 'k',
113 SDLK_l = 'l',
114 SDLK_m = 'm',
115 SDLK_n = 'n',
116 SDLK_o = 'o',
117 SDLK_p = 'p',
118 SDLK_q = 'q',
119 SDLK_r = 'r',
120 SDLK_s = 's',
121 SDLK_t = 't',
122 SDLK_u = 'u',
123 SDLK_v = 'v',
124 SDLK_w = 'w',
125 SDLK_x = 'x',
126 SDLK_y = 'y',
127 SDLK_z = 'z',
128
129 SDLK_CAPSLOCK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CAPSLOCK),
130
131 SDLK_F1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F1),
132 SDLK_F2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F2),
133 SDLK_F3 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F3),
134 SDLK_F4 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F4),
135 SDLK_F5 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F5),
136 SDLK_F6 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F6),
137 SDLK_F7 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F7),
138 SDLK_F8 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F8),
139 SDLK_F9 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F9),
140 SDLK_F10 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F10),
141 SDLK_F11 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F11),
142 SDLK_F12 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F12),
143
144 SDLK_PRINTSCREEN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRINTSCREEN),
145 SDLK_SCROLLLOCK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SCROLLLOCK),
146 SDLK_PAUSE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAUSE),
147 SDLK_INSERT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_INSERT),
148 SDLK_HOME = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HOME),
149 SDLK_PAGEUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEUP),
150 SDLK_DELETE = '\177',
151 SDLK_END = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_END),
152 SDLK_PAGEDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEDOWN),
153 SDLK_RIGHT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RIGHT),
154 SDLK_LEFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LEFT),
155 SDLK_DOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DOWN),
156 SDLK_UP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UP),
157
158 SDLK_NUMLOCKCLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_NUMLOCKCLEAR),
159 SDLK_KP_DIVIDE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DIVIDE),
160 SDLK_KP_MULTIPLY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MULTIPLY),
161 SDLK_KP_MINUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MINUS),
162 SDLK_KP_PLUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUS),
163 SDLK_KP_ENTER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_ENTER),
164 SDLK_KP_1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_1),
165 SDLK_KP_2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_2),
166 SDLK_KP_3 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_3),
167 SDLK_KP_4 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_4),
168 SDLK_KP_5 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_5),
169 SDLK_KP_6 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_6),
170 SDLK_KP_7 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_7),
171 SDLK_KP_8 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_8),
172 SDLK_KP_9 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_9),
173 SDLK_KP_0 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_0),
174 SDLK_KP_PERIOD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERIOD),
175
176 SDLK_APPLICATION = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APPLICATION),
177 SDLK_POWER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_POWER),
178 SDLK_KP_EQUALS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALS),
179 SDLK_F13 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F13),
180 SDLK_F14 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F14),
181 SDLK_F15 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F15),
182 SDLK_F16 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F16),
183 SDLK_F17 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F17),
184 SDLK_F18 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F18),
185 SDLK_F19 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F19),
186 SDLK_F20 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F20),
187 SDLK_F21 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F21),
188 SDLK_F22 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F22),
189 SDLK_F23 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F23),
190 SDLK_F24 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F24),
191 SDLK_EXECUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXECUTE),
192 SDLK_HELP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HELP),
193 SDLK_MENU = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MENU),
194 SDLK_SELECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SELECT),
195 SDLK_STOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_STOP),
196 SDLK_AGAIN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AGAIN),
197 SDLK_UNDO = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UNDO),
198 SDLK_CUT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CUT),
199 SDLK_COPY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_COPY),
200 SDLK_PASTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PASTE),
201 SDLK_FIND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_FIND),
202 SDLK_MUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MUTE),
203 SDLK_VOLUMEUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEUP),
204 SDLK_VOLUMEDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEDOWN),
205 SDLK_KP_COMMA = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COMMA),
206 SDLK_KP_EQUALSAS400 =
207 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALSAS400),
208
209 SDLK_ALTERASE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_ALTERASE),
210 SDLK_SYSREQ = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SYSREQ),
211 SDLK_CANCEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CANCEL),
212 SDLK_CLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEAR),
213 SDLK_PRIOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRIOR),
214 SDLK_RETURN2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RETURN2),
215 SDLK_SEPARATOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SEPARATOR),
216 SDLK_OUT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OUT),
217 SDLK_OPER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OPER),
218 SDLK_CLEARAGAIN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEARAGAIN),
219 SDLK_CRSEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CRSEL),
220 SDLK_EXSEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXSEL),
221
222 SDLK_KP_00 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_00),
223 SDLK_KP_000 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_000),
224 SDLK_THOUSANDSSEPARATOR =
225 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_THOUSANDSSEPARATOR),
226 SDLK_DECIMALSEPARATOR =
227 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DECIMALSEPARATOR),
228 SDLK_CURRENCYUNIT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYUNIT),
229 SDLK_CURRENCYSUBUNIT =
230 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYSUBUNIT),
231 SDLK_KP_LEFTPAREN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTPAREN),
232 SDLK_KP_RIGHTPAREN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTPAREN),
233 SDLK_KP_LEFTBRACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTBRACE),
234 SDLK_KP_RIGHTBRACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTBRACE),
235 SDLK_KP_TAB = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_TAB),
236 SDLK_KP_BACKSPACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BACKSPACE),
237 SDLK_KP_A = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_A),
238 SDLK_KP_B = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_B),
239 SDLK_KP_C = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_C),
240 SDLK_KP_D = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_D),
241 SDLK_KP_E = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_E),
242 SDLK_KP_F = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_F),
243 SDLK_KP_XOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_XOR),
244 SDLK_KP_POWER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_POWER),
245 SDLK_KP_PERCENT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERCENT),
246 SDLK_KP_LESS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LESS),
247 SDLK_KP_GREATER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_GREATER),
248 SDLK_KP_AMPERSAND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AMPERSAND),
249 SDLK_KP_DBLAMPERSAND =
250 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLAMPERSAND),
251 SDLK_KP_VERTICALBAR =
252 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_VERTICALBAR),
253 SDLK_KP_DBLVERTICALBAR =
254 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLVERTICALBAR),
255 SDLK_KP_COLON = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COLON),
256 SDLK_KP_HASH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HASH),
257 SDLK_KP_SPACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_SPACE),
258 SDLK_KP_AT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AT),
259 SDLK_KP_EXCLAM = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EXCLAM),
260 SDLK_KP_MEMSTORE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSTORE),
261 SDLK_KP_MEMRECALL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMRECALL),
262 SDLK_KP_MEMCLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMCLEAR),
263 SDLK_KP_MEMADD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMADD),
264 SDLK_KP_MEMSUBTRACT =
265 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSUBTRACT),
266 SDLK_KP_MEMMULTIPLY =
267 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMMULTIPLY),
268 SDLK_KP_MEMDIVIDE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMDIVIDE),
269 SDLK_KP_PLUSMINUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUSMINUS),
270 SDLK_KP_CLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEAR),
271 SDLK_KP_CLEARENTRY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEARENTRY),
272 SDLK_KP_BINARY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BINARY),
273 SDLK_KP_OCTAL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_OCTAL),
274 SDLK_KP_DECIMAL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DECIMAL),
275 SDLK_KP_HEXADECIMAL =
276 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HEXADECIMAL),
277
278 SDLK_LCTRL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LCTRL),
279 SDLK_LSHIFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LSHIFT),
280 SDLK_LALT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LALT),
281 SDLK_LGUI = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LGUI),
282 SDLK_RCTRL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RCTRL),
283 SDLK_RSHIFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RSHIFT),
284 SDLK_RALT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RALT),
285 SDLK_RGUI = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RGUI),
286
287 SDLK_MODE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MODE),
288
289 SDLK_AUDIONEXT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIONEXT),
290 SDLK_AUDIOPREV = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOPREV),
291 SDLK_AUDIOSTOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOSTOP),
292 SDLK_AUDIOPLAY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOPLAY),
293 SDLK_AUDIOMUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOMUTE),
294 SDLK_MEDIASELECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIASELECT),
295 SDLK_WWW = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_WWW),
296 SDLK_MAIL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MAIL),
297 SDLK_CALCULATOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CALCULATOR),
298 SDLK_COMPUTER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_COMPUTER),
299 SDLK_AC_SEARCH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_SEARCH),
300 SDLK_AC_HOME = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_HOME),
301 SDLK_AC_BACK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BACK),
302 SDLK_AC_FORWARD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_FORWARD),
303 SDLK_AC_STOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_STOP),
304 SDLK_AC_REFRESH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_REFRESH),
305 SDLK_AC_BOOKMARKS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BOOKMARKS),
306
307 SDLK_BRIGHTNESSDOWN =
308 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_BRIGHTNESSDOWN),
309 SDLK_BRIGHTNESSUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_BRIGHTNESSUP),
310 SDLK_DISPLAYSWITCH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DISPLAYSWITCH),
311 SDLK_KBDILLUMTOGGLE =
312 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMTOGGLE),
313 SDLK_KBDILLUMDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMDOWN),
314 SDLK_KBDILLUMUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMUP),
315 SDLK_EJECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EJECT),
316 SDLK_SLEEP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SLEEP),
317 SDLK_APP1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APP1),
318 SDLK_APP2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APP2),
319
320 SDLK_AUDIOREWIND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOREWIND),
321 SDLK_AUDIOFASTFORWARD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOFASTFORWARD)
322 } SDL_KeyCode;
323
324 /**
325 * \brief Enumeration of valid key mods (possibly OR'd together).
326 */
327 typedef enum
328 {
329 KMOD_NONE = 0x0000,
330 KMOD_LSHIFT = 0x0001,
331 KMOD_RSHIFT = 0x0002,
332 KMOD_LCTRL = 0x0040,
333 KMOD_RCTRL = 0x0080,
334 KMOD_LALT = 0x0100,
335 KMOD_RALT = 0x0200,
336 KMOD_LGUI = 0x0400,
337 KMOD_RGUI = 0x0800,
338 KMOD_NUM = 0x1000,
339 KMOD_CAPS = 0x2000,
340 KMOD_MODE = 0x4000,
341 KMOD_RESERVED = 0x8000,
342
343 KMOD_CTRL = KMOD_LCTRL | KMOD_RCTRL,
344 KMOD_SHIFT = KMOD_LSHIFT | KMOD_RSHIFT,
345 KMOD_ALT = KMOD_LALT | KMOD_RALT,
346 KMOD_GUI = KMOD_LGUI | KMOD_RGUI
347 } SDL_Keymod;
348
349 #endif /* SDL_keycode_h_ */
350
351 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_loadso.h added (mode: 100644) (index 0000000..89578a9)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_loadso.h
24 *
25 * System dependent library loading routines
26 *
27 * Some things to keep in mind:
28 * \li These functions only work on C function names. Other languages may
29 * have name mangling and intrinsic language support that varies from
30 * compiler to compiler.
31 * \li Make sure you declare your function pointers with the same calling
32 * convention as the actual library function. Your code will crash
33 * mysteriously if you do not do this.
34 * \li Avoid namespace collisions. If you load a symbol from the library,
35 * it is not defined whether or not it goes into the global symbol
36 * namespace for the application. If it does and it conflicts with
37 * symbols in your code or other shared libraries, you will not get
38 * the results you expect. :)
39 */
40
41 #ifndef SDL_loadso_h_
42 #define SDL_loadso_h_
43
44 #include "SDL_stdinc.h"
45 #include "SDL_error.h"
46
47 #include "begin_code.h"
48 /* Set up for C function definitions, even when using C++ */
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52
53 /**
54 * This function dynamically loads a shared object and returns a pointer
55 * to the object handle (or NULL if there was an error).
56 * The 'sofile' parameter is a system dependent name of the object file.
57 */
58 extern DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile);
59
60 /**
61 * Given an object handle, this function looks up the address of the
62 * named function in the shared object and returns it. This address
63 * is no longer valid after calling SDL_UnloadObject().
64 */
65 extern DECLSPEC void *SDLCALL SDL_LoadFunction(void *handle,
66 const char *name);
67
68 /**
69 * Unload a shared object from memory.
70 */
71 extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle);
72
73 /* Ends C function definitions when using C++ */
74 #ifdef __cplusplus
75 }
76 #endif
77 #include "close_code.h"
78
79 #endif /* SDL_loadso_h_ */
80
81 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_locale.h added (mode: 100644) (index 0000000..1f4b0c4)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_locale.h
24 *
25 * Include file for SDL locale services
26 */
27
28 #ifndef _SDL_locale_h
29 #define _SDL_locale_h
30
31 #include "SDL_stdinc.h"
32 #include "SDL_error.h"
33
34 #include "begin_code.h"
35 /* Set up for C function definitions, even when using C++ */
36 #ifdef __cplusplus
37 /* *INDENT-OFF* */
38 extern "C" {
39 /* *INDENT-ON* */
40 #endif
41
42
43 typedef struct SDL_Locale
44 {
45 const char *language; /**< A language name, like "en" for English. */
46 const char *country; /**< A country, like "US" for America. Can be NULL. */
47 } SDL_Locale;
48
49 /**
50 * \brief Report the user's preferred locale.
51 *
52 * This returns an array of SDL_Locale structs, the final item zeroed out.
53 * When the caller is done with this array, it should call SDL_free() on
54 * the returned value; all the memory involved is allocated in a single
55 * block, so a single SDL_free() will suffice.
56 *
57 * Returned language strings are in the format xx, where 'xx' is an ISO-639
58 * language specifier (such as "en" for English, "de" for German, etc).
59 * Country strings are in the format YY, where "YY" is an ISO-3166 country
60 * code (such as "US" for the United States, "CA" for Canada, etc). Country
61 * might be NULL if there's no specific guidance on them (so you might get
62 * { "en", "US" } for American English, but { "en", NULL } means "English
63 * language, generically"). Language strings are never NULL, except to
64 * terminate the array.
65 *
66 * Please note that not all of these strings are 2 characters; some are
67 * three or more.
68 *
69 * The returned list of locales are in the order of the user's preference.
70 * For example, a German citizen that is fluent in US English and knows
71 * enough Japanese to navigate around Tokyo might have a list like:
72 * { "de", "en_US", "jp", NULL }. Someone from England might prefer British
73 * English (where "color" is spelled "colour", etc), but will settle for
74 * anything like it: { "en_GB", "en", NULL }.
75 *
76 * This function returns NULL on error, including when the platform does not
77 * supply this information at all.
78 *
79 * This might be a "slow" call that has to query the operating system. It's
80 * best to ask for this once and save the results. However, this list can
81 * change, usually because the user has changed a system preference outside
82 * of your program; SDL will send an SDL_LOCALECHANGED event in this case,
83 * if possible, and you can call this function again to get an updated copy
84 * of preferred locales.
85 *
86 * \return array of locales, terminated with a locale with a NULL language
87 * field. Will return NULL on error.
88 */
89 extern DECLSPEC SDL_Locale * SDLCALL SDL_GetPreferredLocales(void);
90
91 /* Ends C function definitions when using C++ */
92 #ifdef __cplusplus
93 /* *INDENT-OFF* */
94 }
95 /* *INDENT-ON* */
96 #endif
97 #include "close_code.h"
98
99 #endif /* _SDL_locale_h */
100
101 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_log.h added (mode: 100644) (index 0000000..c1751fd)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_log.h
24 *
25 * Simple log messages with categories and priorities.
26 *
27 * By default logs are quiet, but if you're debugging SDL you might want:
28 *
29 * SDL_LogSetAllPriority(SDL_LOG_PRIORITY_WARN);
30 *
31 * Here's where the messages go on different platforms:
32 * Windows: debug output stream
33 * Android: log output
34 * Others: standard error output (stderr)
35 */
36
37 #ifndef SDL_log_h_
38 #define SDL_log_h_
39
40 #include "SDL_stdinc.h"
41
42 #include "begin_code.h"
43 /* Set up for C function definitions, even when using C++ */
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47
48
49 /**
50 * \brief The maximum size of a log message
51 *
52 * Messages longer than the maximum size will be truncated
53 */
54 #define SDL_MAX_LOG_MESSAGE 4096
55
56 /**
57 * \brief The predefined log categories
58 *
59 * By default the application category is enabled at the INFO level,
60 * the assert category is enabled at the WARN level, test is enabled
61 * at the VERBOSE level and all other categories are enabled at the
62 * CRITICAL level.
63 */
64 typedef enum
65 {
66 SDL_LOG_CATEGORY_APPLICATION,
67 SDL_LOG_CATEGORY_ERROR,
68 SDL_LOG_CATEGORY_ASSERT,
69 SDL_LOG_CATEGORY_SYSTEM,
70 SDL_LOG_CATEGORY_AUDIO,
71 SDL_LOG_CATEGORY_VIDEO,
72 SDL_LOG_CATEGORY_RENDER,
73 SDL_LOG_CATEGORY_INPUT,
74 SDL_LOG_CATEGORY_TEST,
75
76 /* Reserved for future SDL library use */
77 SDL_LOG_CATEGORY_RESERVED1,
78 SDL_LOG_CATEGORY_RESERVED2,
79 SDL_LOG_CATEGORY_RESERVED3,
80 SDL_LOG_CATEGORY_RESERVED4,
81 SDL_LOG_CATEGORY_RESERVED5,
82 SDL_LOG_CATEGORY_RESERVED6,
83 SDL_LOG_CATEGORY_RESERVED7,
84 SDL_LOG_CATEGORY_RESERVED8,
85 SDL_LOG_CATEGORY_RESERVED9,
86 SDL_LOG_CATEGORY_RESERVED10,
87
88 /* Beyond this point is reserved for application use, e.g.
89 enum {
90 MYAPP_CATEGORY_AWESOME1 = SDL_LOG_CATEGORY_CUSTOM,
91 MYAPP_CATEGORY_AWESOME2,
92 MYAPP_CATEGORY_AWESOME3,
93 ...
94 };
95 */
96 SDL_LOG_CATEGORY_CUSTOM
97 } SDL_LogCategory;
98
99 /**
100 * \brief The predefined log priorities
101 */
102 typedef enum
103 {
104 SDL_LOG_PRIORITY_VERBOSE = 1,
105 SDL_LOG_PRIORITY_DEBUG,
106 SDL_LOG_PRIORITY_INFO,
107 SDL_LOG_PRIORITY_WARN,
108 SDL_LOG_PRIORITY_ERROR,
109 SDL_LOG_PRIORITY_CRITICAL,
110 SDL_NUM_LOG_PRIORITIES
111 } SDL_LogPriority;
112
113
114 /**
115 * \brief Set the priority of all log categories
116 */
117 extern DECLSPEC void SDLCALL SDL_LogSetAllPriority(SDL_LogPriority priority);
118
119 /**
120 * \brief Set the priority of a particular log category
121 */
122 extern DECLSPEC void SDLCALL SDL_LogSetPriority(int category,
123 SDL_LogPriority priority);
124
125 /**
126 * \brief Get the priority of a particular log category
127 */
128 extern DECLSPEC SDL_LogPriority SDLCALL SDL_LogGetPriority(int category);
129
130 /**
131 * \brief Reset all priorities to default.
132 *
133 * \note This is called in SDL_Quit().
134 */
135 extern DECLSPEC void SDLCALL SDL_LogResetPriorities(void);
136
137 /**
138 * \brief Log a message with SDL_LOG_CATEGORY_APPLICATION and SDL_LOG_PRIORITY_INFO
139 */
140 extern DECLSPEC void SDLCALL SDL_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1);
141
142 /**
143 * \brief Log a message with SDL_LOG_PRIORITY_VERBOSE
144 */
145 extern DECLSPEC void SDLCALL SDL_LogVerbose(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
146
147 /**
148 * \brief Log a message with SDL_LOG_PRIORITY_DEBUG
149 */
150 extern DECLSPEC void SDLCALL SDL_LogDebug(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
151
152 /**
153 * \brief Log a message with SDL_LOG_PRIORITY_INFO
154 */
155 extern DECLSPEC void SDLCALL SDL_LogInfo(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
156
157 /**
158 * \brief Log a message with SDL_LOG_PRIORITY_WARN
159 */
160 extern DECLSPEC void SDLCALL SDL_LogWarn(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
161
162 /**
163 * \brief Log a message with SDL_LOG_PRIORITY_ERROR
164 */
165 extern DECLSPEC void SDLCALL SDL_LogError(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
166
167 /**
168 * \brief Log a message with SDL_LOG_PRIORITY_CRITICAL
169 */
170 extern DECLSPEC void SDLCALL SDL_LogCritical(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
171
172 /**
173 * \brief Log a message with the specified category and priority.
174 */
175 extern DECLSPEC void SDLCALL SDL_LogMessage(int category,
176 SDL_LogPriority priority,
177 SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(3);
178
179 /**
180 * \brief Log a message with the specified category and priority.
181 */
182 extern DECLSPEC void SDLCALL SDL_LogMessageV(int category,
183 SDL_LogPriority priority,
184 const char *fmt, va_list ap);
185
186 /**
187 * \brief The prototype for the log output function
188 */
189 typedef void (SDLCALL *SDL_LogOutputFunction)(void *userdata, int category, SDL_LogPriority priority, const char *message);
190
191 /**
192 * \brief Get the current log output function.
193 */
194 extern DECLSPEC void SDLCALL SDL_LogGetOutputFunction(SDL_LogOutputFunction *callback, void **userdata);
195
196 /**
197 * \brief This function allows you to replace the default log output
198 * function with one of your own.
199 */
200 extern DECLSPEC void SDLCALL SDL_LogSetOutputFunction(SDL_LogOutputFunction callback, void *userdata);
201
202
203 /* Ends C function definitions when using C++ */
204 #ifdef __cplusplus
205 }
206 #endif
207 #include "close_code.h"
208
209 #endif /* SDL_log_h_ */
210
211 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_main.h added (mode: 100644) (index 0000000..fcb5c17)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 #ifndef SDL_main_h_
23 #define SDL_main_h_
24
25 #include "SDL_stdinc.h"
26
27 /**
28 * \file SDL_main.h
29 *
30 * Redefine main() on some platforms so that it is called by SDL.
31 */
32
33 #ifndef SDL_MAIN_HANDLED
34 #if defined(__WIN32__)
35 /* On Windows SDL provides WinMain(), which parses the command line and passes
36 the arguments to your main function.
37
38 If you provide your own WinMain(), you may define SDL_MAIN_HANDLED
39 */
40 #define SDL_MAIN_AVAILABLE
41
42 #elif defined(__WINRT__)
43 /* On WinRT, SDL provides a main function that initializes CoreApplication,
44 creating an instance of IFrameworkView in the process.
45
46 Please note that #include'ing SDL_main.h is not enough to get a main()
47 function working. In non-XAML apps, the file,
48 src/main/winrt/SDL_WinRT_main_NonXAML.cpp, or a copy of it, must be compiled
49 into the app itself. In XAML apps, the function, SDL_WinRTRunApp must be
50 called, with a pointer to the Direct3D-hosted XAML control passed in.
51 */
52 #define SDL_MAIN_NEEDED
53
54 #elif defined(__IPHONEOS__)
55 /* On iOS SDL provides a main function that creates an application delegate
56 and starts the iOS application run loop.
57
58 If you link with SDL dynamically on iOS, the main function can't be in a
59 shared library, so you need to link with libSDLmain.a, which includes a
60 stub main function that calls into the shared library to start execution.
61
62 See src/video/uikit/SDL_uikitappdelegate.m for more details.
63 */
64 #define SDL_MAIN_NEEDED
65
66 #elif defined(__ANDROID__)
67 /* On Android SDL provides a Java class in SDLActivity.java that is the
68 main activity entry point.
69
70 See docs/README-android.md for more details on extending that class.
71 */
72 #define SDL_MAIN_NEEDED
73
74 /* We need to export SDL_main so it can be launched from Java */
75 #define SDLMAIN_DECLSPEC DECLSPEC
76
77 #elif defined(__NACL__)
78 /* On NACL we use ppapi_simple to set up the application helper code,
79 then wait for the first PSE_INSTANCE_DIDCHANGEVIEW event before
80 starting the user main function.
81 All user code is run in a separate thread by ppapi_simple, thus
82 allowing for blocking io to take place via nacl_io
83 */
84 #define SDL_MAIN_NEEDED
85
86 #endif
87 #endif /* SDL_MAIN_HANDLED */
88
89 #ifndef SDLMAIN_DECLSPEC
90 #define SDLMAIN_DECLSPEC
91 #endif
92
93 /**
94 * \file SDL_main.h
95 *
96 * The application's main() function must be called with C linkage,
97 * and should be declared like this:
98 * \code
99 * #ifdef __cplusplus
100 * extern "C"
101 * #endif
102 * int main(int argc, char *argv[])
103 * {
104 * }
105 * \endcode
106 */
107
108 #if defined(SDL_MAIN_NEEDED) || defined(SDL_MAIN_AVAILABLE)
109 #define main SDL_main
110 #endif
111
112 #include "begin_code.h"
113 #ifdef __cplusplus
114 extern "C" {
115 #endif
116
117 /**
118 * The prototype for the application's main() function
119 */
120 typedef int (*SDL_main_func)(int argc, char *argv[]);
121 extern SDLMAIN_DECLSPEC int SDL_main(int argc, char *argv[]);
122
123
124 /**
125 * This is called by the real SDL main function to let the rest of the
126 * library know that initialization was done properly.
127 *
128 * Calling this yourself without knowing what you're doing can cause
129 * crashes and hard to diagnose problems with your application.
130 */
131 extern DECLSPEC void SDLCALL SDL_SetMainReady(void);
132
133 #ifdef __WIN32__
134
135 /**
136 * This can be called to set the application class at startup
137 */
138 extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style, void *hInst);
139 extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
140
141 #endif /* __WIN32__ */
142
143
144 #ifdef __WINRT__
145
146 /**
147 * \brief Initializes and launches an SDL/WinRT application.
148 *
149 * \param mainFunction The SDL app's C-style main().
150 * \param reserved Reserved for future use; should be NULL
151 * \return 0 on success, -1 on failure. On failure, use SDL_GetError to retrieve more
152 * information on the failure.
153 */
154 extern DECLSPEC int SDLCALL SDL_WinRTRunApp(SDL_main_func mainFunction, void * reserved);
155
156 #endif /* __WINRT__ */
157
158 #if defined(__IPHONEOS__)
159
160 /**
161 * \brief Initializes and launches an SDL application.
162 *
163 * \param argc The argc parameter from the application's main() function
164 * \param argv The argv parameter from the application's main() function
165 * \param mainFunction The SDL app's C-style main().
166 * \return the return value from mainFunction
167 */
168 extern DECLSPEC int SDLCALL SDL_UIKitRunApp(int argc, char *argv[], SDL_main_func mainFunction);
169
170 #endif /* __IPHONEOS__ */
171
172
173 #ifdef __cplusplus
174 }
175 #endif
176 #include "close_code.h"
177
178 #endif /* SDL_main_h_ */
179
180 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_messagebox.h added (mode: 100644) (index 0000000..03639ce)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 #ifndef SDL_messagebox_h_
23 #define SDL_messagebox_h_
24
25 #include "SDL_stdinc.h"
26 #include "SDL_video.h" /* For SDL_Window */
27
28 #include "begin_code.h"
29 /* Set up for C function definitions, even when using C++ */
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33
34 /**
35 * \brief SDL_MessageBox flags. If supported will display warning icon, etc.
36 */
37 typedef enum
38 {
39 SDL_MESSAGEBOX_ERROR = 0x00000010, /**< error dialog */
40 SDL_MESSAGEBOX_WARNING = 0x00000020, /**< warning dialog */
41 SDL_MESSAGEBOX_INFORMATION = 0x00000040, /**< informational dialog */
42 SDL_MESSAGEBOX_BUTTONS_LEFT_TO_RIGHT = 0x00000080, /**< buttons placed left to right */
43 SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT = 0x00000100 /**< buttons placed right to left */
44 } SDL_MessageBoxFlags;
45
46 /**
47 * \brief Flags for SDL_MessageBoxButtonData.
48 */
49 typedef enum
50 {
51 SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT = 0x00000001, /**< Marks the default button when return is hit */
52 SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT = 0x00000002 /**< Marks the default button when escape is hit */
53 } SDL_MessageBoxButtonFlags;
54
55 /**
56 * \brief Individual button data.
57 */
58 typedef struct
59 {
60 Uint32 flags; /**< ::SDL_MessageBoxButtonFlags */
61 int buttonid; /**< User defined button id (value returned via SDL_ShowMessageBox) */
62 const char * text; /**< The UTF-8 button text */
63 } SDL_MessageBoxButtonData;
64
65 /**
66 * \brief RGB value used in a message box color scheme
67 */
68 typedef struct
69 {
70 Uint8 r, g, b;
71 } SDL_MessageBoxColor;
72
73 typedef enum
74 {
75 SDL_MESSAGEBOX_COLOR_BACKGROUND,
76 SDL_MESSAGEBOX_COLOR_TEXT,
77 SDL_MESSAGEBOX_COLOR_BUTTON_BORDER,
78 SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND,
79 SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED,
80 SDL_MESSAGEBOX_COLOR_MAX
81 } SDL_MessageBoxColorType;
82
83 /**
84 * \brief A set of colors to use for message box dialogs
85 */
86 typedef struct
87 {
88 SDL_MessageBoxColor colors[SDL_MESSAGEBOX_COLOR_MAX];
89 } SDL_MessageBoxColorScheme;
90
91 /**
92 * \brief MessageBox structure containing title, text, window, etc.
93 */
94 typedef struct
95 {
96 Uint32 flags; /**< ::SDL_MessageBoxFlags */
97 SDL_Window *window; /**< Parent window, can be NULL */
98 const char *title; /**< UTF-8 title */
99 const char *message; /**< UTF-8 message text */
100
101 int numbuttons;
102 const SDL_MessageBoxButtonData *buttons;
103
104 const SDL_MessageBoxColorScheme *colorScheme; /**< ::SDL_MessageBoxColorScheme, can be NULL to use system settings */
105 } SDL_MessageBoxData;
106
107 /**
108 * \brief Create a modal message box.
109 *
110 * \param messageboxdata The SDL_MessageBoxData structure with title, text, etc.
111 * \param buttonid The pointer to which user id of hit button should be copied.
112 *
113 * \return -1 on error, otherwise 0 and buttonid contains user id of button
114 * hit or -1 if dialog was closed.
115 *
116 * \note This function should be called on the thread that created the parent
117 * window, or on the main thread if the messagebox has no parent. It will
118 * block execution of that thread until the user clicks a button or
119 * closes the messagebox.
120 */
121 extern DECLSPEC int SDLCALL SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid);
122
123 /**
124 * \brief Create a simple modal message box
125 *
126 * \param flags ::SDL_MessageBoxFlags
127 * \param title UTF-8 title text
128 * \param message UTF-8 message text
129 * \param window The parent window, or NULL for no parent
130 *
131 * \return 0 on success, -1 on error
132 *
133 * \sa SDL_ShowMessageBox
134 */
135 extern DECLSPEC int SDLCALL SDL_ShowSimpleMessageBox(Uint32 flags, const char *title, const char *message, SDL_Window *window);
136
137
138 /* Ends C function definitions when using C++ */
139 #ifdef __cplusplus
140 }
141 #endif
142 #include "close_code.h"
143
144 #endif /* SDL_messagebox_h_ */
145
146 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_metal.h added (mode: 100644) (index 0000000..f967357)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_metal.h
24 *
25 * Header file for functions to creating Metal layers and views on SDL windows.
26 */
27
28 #ifndef SDL_metal_h_
29 #define SDL_metal_h_
30
31 #include "SDL_video.h"
32
33 #include "begin_code.h"
34 /* Set up for C function definitions, even when using C++ */
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38
39 /**
40 * \brief A handle to a CAMetalLayer-backed NSView (macOS) or UIView (iOS/tvOS).
41 *
42 * \note This can be cast directly to an NSView or UIView.
43 */
44 typedef void *SDL_MetalView;
45
46 /**
47 * \name Metal support functions
48 */
49 /* @{ */
50
51 /**
52 * \brief Create a CAMetalLayer-backed NSView/UIView and attach it to the
53 * specified window.
54 *
55 * On macOS, this does *not* associate a MTLDevice with the CAMetalLayer on its
56 * own. It is up to user code to do that.
57 *
58 * The returned handle can be casted directly to a NSView or UIView.
59 * To access the backing CAMetalLayer, call SDL_Metal_GetLayer().
60 *
61 * \note \a window must be created with the SDL_WINDOW_METAL flag.
62 *
63 * \sa SDL_Metal_DestroyView
64 * \sa SDL_Metal_GetLayer
65 */
66 extern DECLSPEC SDL_MetalView SDLCALL SDL_Metal_CreateView(SDL_Window * window);
67
68 /**
69 * \brief Destroy an existing SDL_MetalView object.
70 *
71 * This should be called before SDL_DestroyWindow, if SDL_Metal_CreateView was
72 * called after SDL_CreateWindow.
73 *
74 * \sa SDL_Metal_CreateView
75 */
76 extern DECLSPEC void SDLCALL SDL_Metal_DestroyView(SDL_MetalView view);
77
78 /**
79 * \brief Get a pointer to the backing CAMetalLayer for the given view.
80 *
81 * \sa SDL_MetalCreateView
82 */
83 extern DECLSPEC void *SDLCALL SDL_Metal_GetLayer(SDL_MetalView view);
84
85 /**
86 * \brief Get the size of a window's underlying drawable in pixels (for use
87 * with setting viewport, scissor & etc).
88 *
89 * \param window SDL_Window from which the drawable size should be queried
90 * \param w Pointer to variable for storing the width in pixels,
91 * may be NULL
92 * \param h Pointer to variable for storing the height in pixels,
93 * may be NULL
94 *
95 * This may differ from SDL_GetWindowSize() if we're rendering to a high-DPI
96 * drawable, i.e. the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a
97 * platform with high-DPI support (Apple calls this "Retina"), and not disabled
98 * by the \c SDL_HINT_VIDEO_HIGHDPI_DISABLED hint.
99 *
100 * \note On macOS high-DPI support must be enabled for an application by
101 * setting NSHighResolutionCapable to true in its Info.plist.
102 *
103 * \sa SDL_GetWindowSize()
104 * \sa SDL_CreateWindow()
105 */
106 extern DECLSPEC void SDLCALL SDL_Metal_GetDrawableSize(SDL_Window* window, int *w,
107 int *h);
108
109 /* @} *//* Metal support functions */
110
111 /* Ends C function definitions when using C++ */
112 #ifdef __cplusplus
113 }
114 #endif
115 #include "close_code.h"
116
117 #endif /* SDL_metal_h_ */
File include/SDL2/SDL_misc.h added (mode: 100644) (index 0000000..a04f19b)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_misc.h
24 *
25 * \brief Include file for SDL API functions that don't fit elsewhere.
26 */
27
28 #ifndef SDL_misc_h_
29 #define SDL_misc_h_
30
31 #include "SDL_stdinc.h"
32
33 #include "begin_code.h"
34
35 /* Set up for C function definitions, even when using C++ */
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39
40 /**
41 * \brief Open an URL / URI in the browser or other
42 *
43 * Open a URL in a separate, system-provided application. How this works will
44 * vary wildly depending on the platform. This will likely launch what
45 * makes sense to handle a specific URL's protocol (a web browser for http://,
46 * etc), but it might also be able to launch file managers for directories
47 * and other things.
48 *
49 * What happens when you open a URL varies wildly as well: your game window
50 * may lose focus (and may or may not lose focus if your game was fullscreen
51 * or grabbing input at the time). On mobile devices, your app will likely
52 * move to the background or your process might be paused. Any given platform
53 * may or may not handle a given URL.
54 *
55 * If this is unimplemented (or simply unavailable) for a platform, this will
56 * fail with an error. A successful result does not mean the URL loaded, just
57 * that we launched something to handle it (or at least believe we did).
58 *
59 * All this to say: this function can be useful, but you should definitely
60 * test it on every platform you target.
61 *
62 * \param url A valid URL to open.
63 * \return 0 on success, or -1 on error.
64 */
65 extern DECLSPEC int SDLCALL SDL_OpenURL(const char *url);
66
67 /* Ends C function definitions when using C++ */
68 #ifdef __cplusplus
69 }
70 #endif
71 #include "close_code.h"
72
73 #endif /* SDL_misc_h_ */
74
75 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_mouse.h added (mode: 100644) (index 0000000..99b658e)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_mouse.h
24 *
25 * Include file for SDL mouse event handling.
26 */
27
28 #ifndef SDL_mouse_h_
29 #define SDL_mouse_h_
30
31 #include "SDL_stdinc.h"
32 #include "SDL_error.h"
33 #include "SDL_video.h"
34
35 #include "begin_code.h"
36 /* Set up for C function definitions, even when using C++ */
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40
41 typedef struct SDL_Cursor SDL_Cursor; /**< Implementation dependent */
42
43 /**
44 * \brief Cursor types for SDL_CreateSystemCursor().
45 */
46 typedef enum
47 {
48 SDL_SYSTEM_CURSOR_ARROW, /**< Arrow */
49 SDL_SYSTEM_CURSOR_IBEAM, /**< I-beam */
50 SDL_SYSTEM_CURSOR_WAIT, /**< Wait */
51 SDL_SYSTEM_CURSOR_CROSSHAIR, /**< Crosshair */
52 SDL_SYSTEM_CURSOR_WAITARROW, /**< Small wait cursor (or Wait if not available) */
53 SDL_SYSTEM_CURSOR_SIZENWSE, /**< Double arrow pointing northwest and southeast */
54 SDL_SYSTEM_CURSOR_SIZENESW, /**< Double arrow pointing northeast and southwest */
55 SDL_SYSTEM_CURSOR_SIZEWE, /**< Double arrow pointing west and east */
56 SDL_SYSTEM_CURSOR_SIZENS, /**< Double arrow pointing north and south */
57 SDL_SYSTEM_CURSOR_SIZEALL, /**< Four pointed arrow pointing north, south, east, and west */
58 SDL_SYSTEM_CURSOR_NO, /**< Slashed circle or crossbones */
59 SDL_SYSTEM_CURSOR_HAND, /**< Hand */
60 SDL_NUM_SYSTEM_CURSORS
61 } SDL_SystemCursor;
62
63 /**
64 * \brief Scroll direction types for the Scroll event
65 */
66 typedef enum
67 {
68 SDL_MOUSEWHEEL_NORMAL, /**< The scroll direction is normal */
69 SDL_MOUSEWHEEL_FLIPPED /**< The scroll direction is flipped / natural */
70 } SDL_MouseWheelDirection;
71
72 /* Function prototypes */
73
74 /**
75 * \brief Get the window which currently has mouse focus.
76 */
77 extern DECLSPEC SDL_Window * SDLCALL SDL_GetMouseFocus(void);
78
79 /**
80 * \brief Retrieve the current state of the mouse.
81 *
82 * The current button state is returned as a button bitmask, which can
83 * be tested using the SDL_BUTTON(X) macros, and x and y are set to the
84 * mouse cursor position relative to the focus window for the currently
85 * selected mouse. You can pass NULL for either x or y.
86 */
87 extern DECLSPEC Uint32 SDLCALL SDL_GetMouseState(int *x, int *y);
88
89 /**
90 * \brief Get the current state of the mouse, in relation to the desktop
91 *
92 * This works just like SDL_GetMouseState(), but the coordinates will be
93 * reported relative to the top-left of the desktop. This can be useful if
94 * you need to track the mouse outside of a specific window and
95 * SDL_CaptureMouse() doesn't fit your needs. For example, it could be
96 * useful if you need to track the mouse while dragging a window, where
97 * coordinates relative to a window might not be in sync at all times.
98 *
99 * \note SDL_GetMouseState() returns the mouse position as SDL understands
100 * it from the last pump of the event queue. This function, however,
101 * queries the OS for the current mouse position, and as such, might
102 * be a slightly less efficient function. Unless you know what you're
103 * doing and have a good reason to use this function, you probably want
104 * SDL_GetMouseState() instead.
105 *
106 * \param x Returns the current X coord, relative to the desktop. Can be NULL.
107 * \param y Returns the current Y coord, relative to the desktop. Can be NULL.
108 * \return The current button state as a bitmask, which can be tested using the SDL_BUTTON(X) macros.
109 *
110 * \sa SDL_GetMouseState
111 */
112 extern DECLSPEC Uint32 SDLCALL SDL_GetGlobalMouseState(int *x, int *y);
113
114 /**
115 * \brief Retrieve the relative state of the mouse.
116 *
117 * The current button state is returned as a button bitmask, which can
118 * be tested using the SDL_BUTTON(X) macros, and x and y are set to the
119 * mouse deltas since the last call to SDL_GetRelativeMouseState().
120 */
121 extern DECLSPEC Uint32 SDLCALL SDL_GetRelativeMouseState(int *x, int *y);
122
123 /**
124 * \brief Moves the mouse to the given position within the window.
125 *
126 * \param window The window to move the mouse into, or NULL for the current mouse focus
127 * \param x The x coordinate within the window
128 * \param y The y coordinate within the window
129 *
130 * \note This function generates a mouse motion event
131 */
132 extern DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_Window * window,
133 int x, int y);
134
135 /**
136 * \brief Moves the mouse to the given position in global screen space.
137 *
138 * \param x The x coordinate
139 * \param y The y coordinate
140 * \return 0 on success, -1 on error (usually: unsupported by a platform).
141 *
142 * \note This function generates a mouse motion event
143 */
144 extern DECLSPEC int SDLCALL SDL_WarpMouseGlobal(int x, int y);
145
146 /**
147 * \brief Set relative mouse mode.
148 *
149 * \param enabled Whether or not to enable relative mode
150 *
151 * \return 0 on success, or -1 if relative mode is not supported.
152 *
153 * While the mouse is in relative mode, the cursor is hidden, and the
154 * driver will try to report continuous motion in the current window.
155 * Only relative motion events will be delivered, the mouse position
156 * will not change.
157 *
158 * \note This function will flush any pending mouse motion.
159 *
160 * \sa SDL_GetRelativeMouseMode()
161 */
162 extern DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(SDL_bool enabled);
163
164 /**
165 * \brief Capture the mouse, to track input outside an SDL window.
166 *
167 * \param enabled Whether or not to enable capturing
168 *
169 * Capturing enables your app to obtain mouse events globally, instead of
170 * just within your window. Not all video targets support this function.
171 * When capturing is enabled, the current window will get all mouse events,
172 * but unlike relative mode, no change is made to the cursor and it is
173 * not restrained to your window.
174 *
175 * This function may also deny mouse input to other windows--both those in
176 * your application and others on the system--so you should use this
177 * function sparingly, and in small bursts. For example, you might want to
178 * track the mouse while the user is dragging something, until the user
179 * releases a mouse button. It is not recommended that you capture the mouse
180 * for long periods of time, such as the entire time your app is running.
181 *
182 * While captured, mouse events still report coordinates relative to the
183 * current (foreground) window, but those coordinates may be outside the
184 * bounds of the window (including negative values). Capturing is only
185 * allowed for the foreground window. If the window loses focus while
186 * capturing, the capture will be disabled automatically.
187 *
188 * While capturing is enabled, the current window will have the
189 * SDL_WINDOW_MOUSE_CAPTURE flag set.
190 *
191 * \return 0 on success, or -1 if not supported.
192 */
193 extern DECLSPEC int SDLCALL SDL_CaptureMouse(SDL_bool enabled);
194
195 /**
196 * \brief Query whether relative mouse mode is enabled.
197 *
198 * \sa SDL_SetRelativeMouseMode()
199 */
200 extern DECLSPEC SDL_bool SDLCALL SDL_GetRelativeMouseMode(void);
201
202 /**
203 * \brief Create a cursor, using the specified bitmap data and
204 * mask (in MSB format).
205 *
206 * The cursor width must be a multiple of 8 bits.
207 *
208 * The cursor is created in black and white according to the following:
209 * <table>
210 * <tr><td> data </td><td> mask </td><td> resulting pixel on screen </td></tr>
211 * <tr><td> 0 </td><td> 1 </td><td> White </td></tr>
212 * <tr><td> 1 </td><td> 1 </td><td> Black </td></tr>
213 * <tr><td> 0 </td><td> 0 </td><td> Transparent </td></tr>
214 * <tr><td> 1 </td><td> 0 </td><td> Inverted color if possible, black
215 * if not. </td></tr>
216 * </table>
217 *
218 * \sa SDL_FreeCursor()
219 */
220 extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateCursor(const Uint8 * data,
221 const Uint8 * mask,
222 int w, int h, int hot_x,
223 int hot_y);
224
225 /**
226 * \brief Create a color cursor.
227 *
228 * \sa SDL_FreeCursor()
229 */
230 extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateColorCursor(SDL_Surface *surface,
231 int hot_x,
232 int hot_y);
233
234 /**
235 * \brief Create a system cursor.
236 *
237 * \sa SDL_FreeCursor()
238 */
239 extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateSystemCursor(SDL_SystemCursor id);
240
241 /**
242 * \brief Set the active cursor.
243 */
244 extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor * cursor);
245
246 /**
247 * \brief Return the active cursor.
248 */
249 extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetCursor(void);
250
251 /**
252 * \brief Return the default cursor.
253 */
254 extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetDefaultCursor(void);
255
256 /**
257 * \brief Frees a cursor created with SDL_CreateCursor() or similar functions.
258 *
259 * \sa SDL_CreateCursor()
260 * \sa SDL_CreateColorCursor()
261 * \sa SDL_CreateSystemCursor()
262 */
263 extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor * cursor);
264
265 /**
266 * \brief Toggle whether or not the cursor is shown.
267 *
268 * \param toggle 1 to show the cursor, 0 to hide it, -1 to query the current
269 * state.
270 *
271 * \return 1 if the cursor is shown, or 0 if the cursor is hidden.
272 */
273 extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle);
274
275 /**
276 * Used as a mask when testing buttons in buttonstate.
277 * - Button 1: Left mouse button
278 * - Button 2: Middle mouse button
279 * - Button 3: Right mouse button
280 */
281 #define SDL_BUTTON(X) (1 << ((X)-1))
282 #define SDL_BUTTON_LEFT 1
283 #define SDL_BUTTON_MIDDLE 2
284 #define SDL_BUTTON_RIGHT 3
285 #define SDL_BUTTON_X1 4
286 #define SDL_BUTTON_X2 5
287 #define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT)
288 #define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE)
289 #define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT)
290 #define SDL_BUTTON_X1MASK SDL_BUTTON(SDL_BUTTON_X1)
291 #define SDL_BUTTON_X2MASK SDL_BUTTON(SDL_BUTTON_X2)
292
293
294 /* Ends C function definitions when using C++ */
295 #ifdef __cplusplus
296 }
297 #endif
298 #include "close_code.h"
299
300 #endif /* SDL_mouse_h_ */
301
302 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_mutex.h added (mode: 100644) (index 0000000..3c5b955)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 #ifndef SDL_mutex_h_
23 #define SDL_mutex_h_
24
25 /**
26 * \file SDL_mutex.h
27 *
28 * Functions to provide thread synchronization primitives.
29 */
30
31 #include "SDL_stdinc.h"
32 #include "SDL_error.h"
33
34 #include "begin_code.h"
35 /* Set up for C function definitions, even when using C++ */
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39
40 /**
41 * Synchronization functions which can time out return this value
42 * if they time out.
43 */
44 #define SDL_MUTEX_TIMEDOUT 1
45
46 /**
47 * This is the timeout value which corresponds to never time out.
48 */
49 #define SDL_MUTEX_MAXWAIT (~(Uint32)0)
50
51
52 /**
53 * \name Mutex functions
54 */
55 /* @{ */
56
57 /* The SDL mutex structure, defined in SDL_sysmutex.c */
58 struct SDL_mutex;
59 typedef struct SDL_mutex SDL_mutex;
60
61 /**
62 * Create a mutex, initialized unlocked.
63 */
64 extern DECLSPEC SDL_mutex *SDLCALL SDL_CreateMutex(void);
65
66 /**
67 * Lock the mutex.
68 *
69 * \return 0, or -1 on error.
70 */
71 #define SDL_mutexP(m) SDL_LockMutex(m)
72 extern DECLSPEC int SDLCALL SDL_LockMutex(SDL_mutex * mutex);
73
74 /**
75 * Try to lock the mutex
76 *
77 * \return 0, SDL_MUTEX_TIMEDOUT, or -1 on error
78 */
79 extern DECLSPEC int SDLCALL SDL_TryLockMutex(SDL_mutex * mutex);
80
81 /**
82 * Unlock the mutex.
83 *
84 * \return 0, or -1 on error.
85 *
86 * \warning It is an error to unlock a mutex that has not been locked by
87 * the current thread, and doing so results in undefined behavior.
88 */
89 #define SDL_mutexV(m) SDL_UnlockMutex(m)
90 extern DECLSPEC int SDLCALL SDL_UnlockMutex(SDL_mutex * mutex);
91
92 /**
93 * Destroy a mutex.
94 */
95 extern DECLSPEC void SDLCALL SDL_DestroyMutex(SDL_mutex * mutex);
96
97 /* @} *//* Mutex functions */
98
99
100 /**
101 * \name Semaphore functions
102 */
103 /* @{ */
104
105 /* The SDL semaphore structure, defined in SDL_syssem.c */
106 struct SDL_semaphore;
107 typedef struct SDL_semaphore SDL_sem;
108
109 /**
110 * Create a semaphore, initialized with value, returns NULL on failure.
111 */
112 extern DECLSPEC SDL_sem *SDLCALL SDL_CreateSemaphore(Uint32 initial_value);
113
114 /**
115 * Destroy a semaphore.
116 */
117 extern DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_sem * sem);
118
119 /**
120 * This function suspends the calling thread until the semaphore pointed
121 * to by \c sem has a positive count. It then atomically decreases the
122 * semaphore count.
123 */
124 extern DECLSPEC int SDLCALL SDL_SemWait(SDL_sem * sem);
125
126 /**
127 * Non-blocking variant of SDL_SemWait().
128 *
129 * \return 0 if the wait succeeds, ::SDL_MUTEX_TIMEDOUT if the wait would
130 * block, and -1 on error.
131 */
132 extern DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem * sem);
133
134 /**
135 * Variant of SDL_SemWait() with a timeout in milliseconds.
136 *
137 * \return 0 if the wait succeeds, ::SDL_MUTEX_TIMEDOUT if the wait does not
138 * succeed in the allotted time, and -1 on error.
139 *
140 * \warning On some platforms this function is implemented by looping with a
141 * delay of 1 ms, and so should be avoided if possible.
142 */
143 extern DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem * sem, Uint32 ms);
144
145 /**
146 * Atomically increases the semaphore's count (not blocking).
147 *
148 * \return 0, or -1 on error.
149 */
150 extern DECLSPEC int SDLCALL SDL_SemPost(SDL_sem * sem);
151
152 /**
153 * Returns the current count of the semaphore.
154 */
155 extern DECLSPEC Uint32 SDLCALL SDL_SemValue(SDL_sem * sem);
156
157 /* @} *//* Semaphore functions */
158
159
160 /**
161 * \name Condition variable functions
162 */
163 /* @{ */
164
165 /* The SDL condition variable structure, defined in SDL_syscond.c */
166 struct SDL_cond;
167 typedef struct SDL_cond SDL_cond;
168
169 /**
170 * Create a condition variable.
171 *
172 * Typical use of condition variables:
173 *
174 * Thread A:
175 * SDL_LockMutex(lock);
176 * while ( ! condition ) {
177 * SDL_CondWait(cond, lock);
178 * }
179 * SDL_UnlockMutex(lock);
180 *
181 * Thread B:
182 * SDL_LockMutex(lock);
183 * ...
184 * condition = true;
185 * ...
186 * SDL_CondSignal(cond);
187 * SDL_UnlockMutex(lock);
188 *
189 * There is some discussion whether to signal the condition variable
190 * with the mutex locked or not. There is some potential performance
191 * benefit to unlocking first on some platforms, but there are some
192 * potential race conditions depending on how your code is structured.
193 *
194 * In general it's safer to signal the condition variable while the
195 * mutex is locked.
196 */
197 extern DECLSPEC SDL_cond *SDLCALL SDL_CreateCond(void);
198
199 /**
200 * Destroy a condition variable.
201 */
202 extern DECLSPEC void SDLCALL SDL_DestroyCond(SDL_cond * cond);
203
204 /**
205 * Restart one of the threads that are waiting on the condition variable.
206 *
207 * \return 0 or -1 on error.
208 */
209 extern DECLSPEC int SDLCALL SDL_CondSignal(SDL_cond * cond);
210
211 /**
212 * Restart all threads that are waiting on the condition variable.
213 *
214 * \return 0 or -1 on error.
215 */
216 extern DECLSPEC int SDLCALL SDL_CondBroadcast(SDL_cond * cond);
217
218 /**
219 * Wait on the condition variable, unlocking the provided mutex.
220 *
221 * \warning The mutex must be locked before entering this function!
222 *
223 * The mutex is re-locked once the condition variable is signaled.
224 *
225 * \return 0 when it is signaled, or -1 on error.
226 */
227 extern DECLSPEC int SDLCALL SDL_CondWait(SDL_cond * cond, SDL_mutex * mutex);
228
229 /**
230 * Waits for at most \c ms milliseconds, and returns 0 if the condition
231 * variable is signaled, ::SDL_MUTEX_TIMEDOUT if the condition is not
232 * signaled in the allotted time, and -1 on error.
233 *
234 * \warning On some platforms this function is implemented by looping with a
235 * delay of 1 ms, and so should be avoided if possible.
236 */
237 extern DECLSPEC int SDLCALL SDL_CondWaitTimeout(SDL_cond * cond,
238 SDL_mutex * mutex, Uint32 ms);
239
240 /* @} *//* Condition variable functions */
241
242
243 /* Ends C function definitions when using C++ */
244 #ifdef __cplusplus
245 }
246 #endif
247 #include "close_code.h"
248
249 #endif /* SDL_mutex_h_ */
250
251 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_name.h added (mode: 100644) (index 0000000..a49c488)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 #ifndef SDLname_h_
23 #define SDLname_h_
24
25 #if defined(__STDC__) || defined(__cplusplus)
26 #define NeedFunctionPrototypes 1
27 #endif
28
29 #define SDL_NAME(X) SDL_##X
30
31 #endif /* SDLname_h_ */
32
33 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_opengl.h added (mode: 100644) (index 0000000..5cd302c)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_opengl.h
24 *
25 * This is a simple file to encapsulate the OpenGL API headers.
26 */
27
28 /**
29 * \def NO_SDL_GLEXT
30 *
31 * Define this if you have your own version of glext.h and want to disable the
32 * version included in SDL_opengl.h.
33 */
34
35 #ifndef SDL_opengl_h_
36 #define SDL_opengl_h_
37
38 #include "SDL_config.h"
39
40 #ifndef __IPHONEOS__ /* No OpenGL on iOS. */
41
42 /*
43 * Mesa 3-D graphics library
44 *
45 * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
46 * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
47 *
48 * Permission is hereby granted, free of charge, to any person obtaining a
49 * copy of this software and associated documentation files (the "Software"),
50 * to deal in the Software without restriction, including without limitation
51 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
52 * and/or sell copies of the Software, and to permit persons to whom the
53 * Software is furnished to do so, subject to the following conditions:
54 *
55 * The above copyright notice and this permission notice shall be included
56 * in all copies or substantial portions of the Software.
57 *
58 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
59 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
60 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
61 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
62 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
63 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
64 * OTHER DEALINGS IN THE SOFTWARE.
65 */
66
67
68 #ifndef __gl_h_
69 #define __gl_h_
70
71 #if defined(USE_MGL_NAMESPACE)
72 #include "gl_mangle.h"
73 #endif
74
75
76 /**********************************************************************
77 * Begin system-specific stuff.
78 */
79
80 #if defined(_WIN32) && !defined(__WIN32__) && !defined(__CYGWIN__)
81 #define __WIN32__
82 #endif
83
84 #if defined(__WIN32__) && !defined(__CYGWIN__)
85 # if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */
86 # define GLAPI __declspec(dllexport)
87 # elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
88 # define GLAPI __declspec(dllimport)
89 # else /* for use with static link lib build of Win32 edition only */
90 # define GLAPI extern
91 # endif /* _STATIC_MESA support */
92 # if defined(__MINGW32__) && defined(GL_NO_STDCALL) || defined(UNDER_CE) /* The generated DLLs by MingW with STDCALL are not compatible with the ones done by Microsoft's compilers */
93 # define GLAPIENTRY
94 # else
95 # define GLAPIENTRY __stdcall
96 # endif
97 #elif defined(__CYGWIN__) && defined(USE_OPENGL32) /* use native windows opengl32 */
98 # define GLAPI extern
99 # define GLAPIENTRY __stdcall
100 #elif defined(__OS2__) || defined(__EMX__) /* native os/2 opengl */
101 # define GLAPI extern
102 # define GLAPIENTRY _System
103 # define APIENTRY _System
104 # if defined(__GNUC__) && !defined(_System)
105 # define _System
106 # endif
107 #elif (defined(__GNUC__) && __GNUC__ >= 4) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
108 # define GLAPI __attribute__((visibility("default")))
109 # define GLAPIENTRY
110 #endif /* WIN32 && !CYGWIN */
111
112 /*
113 * WINDOWS: Include windows.h here to define APIENTRY.
114 * It is also useful when applications include this file by
115 * including only glut.h, since glut.h depends on windows.h.
116 * Applications needing to include windows.h with parms other
117 * than "WIN32_LEAN_AND_MEAN" may include windows.h before
118 * glut.h or gl.h.
119 */
120 #if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__)
121 #ifndef WIN32_LEAN_AND_MEAN
122 #define WIN32_LEAN_AND_MEAN 1
123 #endif
124 #ifndef NOMINMAX /* don't define min() and max(). */
125 #define NOMINMAX
126 #endif
127 #include <windows.h>
128 #endif
129
130 #ifndef GLAPI
131 #define GLAPI extern
132 #endif
133
134 #ifndef GLAPIENTRY
135 #define GLAPIENTRY
136 #endif
137
138 #ifndef APIENTRY
139 #define APIENTRY GLAPIENTRY
140 #endif
141
142 /* "P" suffix to be used for a pointer to a function */
143 #ifndef APIENTRYP
144 #define APIENTRYP APIENTRY *
145 #endif
146
147 #ifndef GLAPIENTRYP
148 #define GLAPIENTRYP GLAPIENTRY *
149 #endif
150
151 #if defined(PRAGMA_EXPORT_SUPPORTED)
152 #pragma export on
153 #endif
154
155 /*
156 * End system-specific stuff.
157 **********************************************************************/
158
159
160
161 #ifdef __cplusplus
162 extern "C" {
163 #endif
164
165
166
167 #define GL_VERSION_1_1 1
168 #define GL_VERSION_1_2 1
169 #define GL_VERSION_1_3 1
170 #define GL_ARB_imaging 1
171
172
173 /*
174 * Datatypes
175 */
176 typedef unsigned int GLenum;
177 typedef unsigned char GLboolean;
178 typedef unsigned int GLbitfield;
179 typedef void GLvoid;
180 typedef signed char GLbyte; /* 1-byte signed */
181 typedef short GLshort; /* 2-byte signed */
182 typedef int GLint; /* 4-byte signed */
183 typedef unsigned char GLubyte; /* 1-byte unsigned */
184 typedef unsigned short GLushort; /* 2-byte unsigned */
185 typedef unsigned int GLuint; /* 4-byte unsigned */
186 typedef int GLsizei; /* 4-byte signed */
187 typedef float GLfloat; /* single precision float */
188 typedef float GLclampf; /* single precision float in [0,1] */
189 typedef double GLdouble; /* double precision float */
190 typedef double GLclampd; /* double precision float in [0,1] */
191
192
193
194 /*
195 * Constants
196 */
197
198 /* Boolean values */
199 #define GL_FALSE 0
200 #define GL_TRUE 1
201
202 /* Data types */
203 #define GL_BYTE 0x1400
204 #define GL_UNSIGNED_BYTE 0x1401
205 #define GL_SHORT 0x1402
206 #define GL_UNSIGNED_SHORT 0x1403
207 #define GL_INT 0x1404
208 #define GL_UNSIGNED_INT 0x1405
209 #define GL_FLOAT 0x1406
210 #define GL_2_BYTES 0x1407
211 #define GL_3_BYTES 0x1408
212 #define GL_4_BYTES 0x1409
213 #define GL_DOUBLE 0x140A
214
215 /* Primitives */
216 #define GL_POINTS 0x0000
217 #define GL_LINES 0x0001
218 #define GL_LINE_LOOP 0x0002
219 #define GL_LINE_STRIP 0x0003
220 #define GL_TRIANGLES 0x0004
221 #define GL_TRIANGLE_STRIP 0x0005
222 #define GL_TRIANGLE_FAN 0x0006
223 #define GL_QUADS 0x0007
224 #define GL_QUAD_STRIP 0x0008
225 #define GL_POLYGON 0x0009
226
227 /* Vertex Arrays */
228 #define GL_VERTEX_ARRAY 0x8074
229 #define GL_NORMAL_ARRAY 0x8075
230 #define GL_COLOR_ARRAY 0x8076
231 #define GL_INDEX_ARRAY 0x8077
232 #define GL_TEXTURE_COORD_ARRAY 0x8078
233 #define GL_EDGE_FLAG_ARRAY 0x8079
234 #define GL_VERTEX_ARRAY_SIZE 0x807A
235 #define GL_VERTEX_ARRAY_TYPE 0x807B
236 #define GL_VERTEX_ARRAY_STRIDE 0x807C
237 #define GL_NORMAL_ARRAY_TYPE 0x807E
238 #define GL_NORMAL_ARRAY_STRIDE 0x807F
239 #define GL_COLOR_ARRAY_SIZE 0x8081
240 #define GL_COLOR_ARRAY_TYPE 0x8082
241 #define GL_COLOR_ARRAY_STRIDE 0x8083
242 #define GL_INDEX_ARRAY_TYPE 0x8085
243 #define GL_INDEX_ARRAY_STRIDE 0x8086
244 #define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088
245 #define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089
246 #define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A
247 #define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C
248 #define GL_VERTEX_ARRAY_POINTER 0x808E
249 #define GL_NORMAL_ARRAY_POINTER 0x808F
250 #define GL_COLOR_ARRAY_POINTER 0x8090
251 #define GL_INDEX_ARRAY_POINTER 0x8091
252 #define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092
253 #define GL_EDGE_FLAG_ARRAY_POINTER 0x8093
254 #define GL_V2F 0x2A20
255 #define GL_V3F 0x2A21
256 #define GL_C4UB_V2F 0x2A22
257 #define GL_C4UB_V3F 0x2A23
258 #define GL_C3F_V3F 0x2A24
259 #define GL_N3F_V3F 0x2A25
260 #define GL_C4F_N3F_V3F 0x2A26
261 #define GL_T2F_V3F 0x2A27
262 #define GL_T4F_V4F 0x2A28
263 #define GL_T2F_C4UB_V3F 0x2A29
264 #define GL_T2F_C3F_V3F 0x2A2A
265 #define GL_T2F_N3F_V3F 0x2A2B
266 #define GL_T2F_C4F_N3F_V3F 0x2A2C
267 #define GL_T4F_C4F_N3F_V4F 0x2A2D
268
269 /* Matrix Mode */
270 #define GL_MATRIX_MODE 0x0BA0
271 #define GL_MODELVIEW 0x1700
272 #define GL_PROJECTION 0x1701
273 #define GL_TEXTURE 0x1702
274
275 /* Points */
276 #define GL_POINT_SMOOTH 0x0B10
277 #define GL_POINT_SIZE 0x0B11
278 #define GL_POINT_SIZE_GRANULARITY 0x0B13
279 #define GL_POINT_SIZE_RANGE 0x0B12
280
281 /* Lines */
282 #define GL_LINE_SMOOTH 0x0B20
283 #define GL_LINE_STIPPLE 0x0B24
284 #define GL_LINE_STIPPLE_PATTERN 0x0B25
285 #define GL_LINE_STIPPLE_REPEAT 0x0B26
286 #define GL_LINE_WIDTH 0x0B21
287 #define GL_LINE_WIDTH_GRANULARITY 0x0B23
288 #define GL_LINE_WIDTH_RANGE 0x0B22
289
290 /* Polygons */
291 #define GL_POINT 0x1B00
292 #define GL_LINE 0x1B01
293 #define GL_FILL 0x1B02
294 #define GL_CW 0x0900
295 #define GL_CCW 0x0901
296 #define GL_FRONT 0x0404
297 #define GL_BACK 0x0405
298 #define GL_POLYGON_MODE 0x0B40
299 #define GL_POLYGON_SMOOTH 0x0B41
300 #define GL_POLYGON_STIPPLE 0x0B42
301 #define GL_EDGE_FLAG 0x0B43
302 #define GL_CULL_FACE 0x0B44
303 #define GL_CULL_FACE_MODE 0x0B45
304 #define GL_FRONT_FACE 0x0B46
305 #define GL_POLYGON_OFFSET_FACTOR 0x8038
306 #define GL_POLYGON_OFFSET_UNITS 0x2A00
307 #define GL_POLYGON_OFFSET_POINT 0x2A01
308 #define GL_POLYGON_OFFSET_LINE 0x2A02
309 #define GL_POLYGON_OFFSET_FILL 0x8037
310
311 /* Display Lists */
312 #define GL_COMPILE 0x1300
313 #define GL_COMPILE_AND_EXECUTE 0x1301
314 #define GL_LIST_BASE 0x0B32
315 #define GL_LIST_INDEX 0x0B33
316 #define GL_LIST_MODE 0x0B30
317
318 /* Depth buffer */
319 #define GL_NEVER 0x0200
320 #define GL_LESS 0x0201
321 #define GL_EQUAL 0x0202
322 #define GL_LEQUAL 0x0203
323 #define GL_GREATER 0x0204
324 #define GL_NOTEQUAL 0x0205
325 #define GL_GEQUAL 0x0206
326 #define GL_ALWAYS 0x0207
327 #define GL_DEPTH_TEST 0x0B71
328 #define GL_DEPTH_BITS 0x0D56
329 #define GL_DEPTH_CLEAR_VALUE 0x0B73
330 #define GL_DEPTH_FUNC 0x0B74
331 #define GL_DEPTH_RANGE 0x0B70
332 #define GL_DEPTH_WRITEMASK 0x0B72
333 #define GL_DEPTH_COMPONENT 0x1902
334
335 /* Lighting */
336 #define GL_LIGHTING 0x0B50
337 #define GL_LIGHT0 0x4000
338 #define GL_LIGHT1 0x4001
339 #define GL_LIGHT2 0x4002
340 #define GL_LIGHT3 0x4003
341 #define GL_LIGHT4 0x4004
342 #define GL_LIGHT5 0x4005
343 #define GL_LIGHT6 0x4006
344 #define GL_LIGHT7 0x4007
345 #define GL_SPOT_EXPONENT 0x1205
346 #define GL_SPOT_CUTOFF 0x1206
347 #define GL_CONSTANT_ATTENUATION 0x1207
348 #define GL_LINEAR_ATTENUATION 0x1208
349 #define GL_QUADRATIC_ATTENUATION 0x1209
350 #define GL_AMBIENT 0x1200
351 #define GL_DIFFUSE 0x1201
352 #define GL_SPECULAR 0x1202
353 #define GL_SHININESS 0x1601
354 #define GL_EMISSION 0x1600
355 #define GL_POSITION 0x1203
356 #define GL_SPOT_DIRECTION 0x1204
357 #define GL_AMBIENT_AND_DIFFUSE 0x1602
358 #define GL_COLOR_INDEXES 0x1603
359 #define GL_LIGHT_MODEL_TWO_SIDE 0x0B52
360 #define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51
361 #define GL_LIGHT_MODEL_AMBIENT 0x0B53
362 #define GL_FRONT_AND_BACK 0x0408
363 #define GL_SHADE_MODEL 0x0B54
364 #define GL_FLAT 0x1D00
365 #define GL_SMOOTH 0x1D01
366 #define GL_COLOR_MATERIAL 0x0B57
367 #define GL_COLOR_MATERIAL_FACE 0x0B55
368 #define GL_COLOR_MATERIAL_PARAMETER 0x0B56
369 #define GL_NORMALIZE 0x0BA1
370
371 /* User clipping planes */
372 #define GL_CLIP_PLANE0 0x3000
373 #define GL_CLIP_PLANE1 0x3001
374 #define GL_CLIP_PLANE2 0x3002
375 #define GL_CLIP_PLANE3 0x3003
376 #define GL_CLIP_PLANE4 0x3004
377 #define GL_CLIP_PLANE5 0x3005
378
379 /* Accumulation buffer */
380 #define GL_ACCUM_RED_BITS 0x0D58
381 #define GL_ACCUM_GREEN_BITS 0x0D59
382 #define GL_ACCUM_BLUE_BITS 0x0D5A
383 #define GL_ACCUM_ALPHA_BITS 0x0D5B
384 #define GL_ACCUM_CLEAR_VALUE 0x0B80
385 #define GL_ACCUM 0x0100
386 #define GL_ADD 0x0104
387 #define GL_LOAD 0x0101
388 #define GL_MULT 0x0103
389 #define GL_RETURN 0x0102
390
391 /* Alpha testing */
392 #define GL_ALPHA_TEST 0x0BC0
393 #define GL_ALPHA_TEST_REF 0x0BC2
394 #define GL_ALPHA_TEST_FUNC 0x0BC1
395
396 /* Blending */
397 #define GL_BLEND 0x0BE2
398 #define GL_BLEND_SRC 0x0BE1
399 #define GL_BLEND_DST 0x0BE0
400 #define GL_ZERO 0
401 #define GL_ONE 1
402 #define GL_SRC_COLOR 0x0300
403 #define GL_ONE_MINUS_SRC_COLOR 0x0301
404 #define GL_SRC_ALPHA 0x0302
405 #define GL_ONE_MINUS_SRC_ALPHA 0x0303
406 #define GL_DST_ALPHA 0x0304
407 #define GL_ONE_MINUS_DST_ALPHA 0x0305
408 #define GL_DST_COLOR 0x0306
409 #define GL_ONE_MINUS_DST_COLOR 0x0307
410 #define GL_SRC_ALPHA_SATURATE 0x0308
411
412 /* Render Mode */
413 #define GL_FEEDBACK 0x1C01
414 #define GL_RENDER 0x1C00
415 #define GL_SELECT 0x1C02
416
417 /* Feedback */
418 #define GL_2D 0x0600
419 #define GL_3D 0x0601
420 #define GL_3D_COLOR 0x0602
421 #define GL_3D_COLOR_TEXTURE 0x0603
422 #define GL_4D_COLOR_TEXTURE 0x0604
423 #define GL_POINT_TOKEN 0x0701
424 #define GL_LINE_TOKEN 0x0702
425 #define GL_LINE_RESET_TOKEN 0x0707
426 #define GL_POLYGON_TOKEN 0x0703
427 #define GL_BITMAP_TOKEN 0x0704
428 #define GL_DRAW_PIXEL_TOKEN 0x0705
429 #define GL_COPY_PIXEL_TOKEN 0x0706
430 #define GL_PASS_THROUGH_TOKEN 0x0700
431 #define GL_FEEDBACK_BUFFER_POINTER 0x0DF0
432 #define GL_FEEDBACK_BUFFER_SIZE 0x0DF1
433 #define GL_FEEDBACK_BUFFER_TYPE 0x0DF2
434
435 /* Selection */
436 #define GL_SELECTION_BUFFER_POINTER 0x0DF3
437 #define GL_SELECTION_BUFFER_SIZE 0x0DF4
438
439 /* Fog */
440 #define GL_FOG 0x0B60
441 #define GL_FOG_MODE 0x0B65
442 #define GL_FOG_DENSITY 0x0B62
443 #define GL_FOG_COLOR 0x0B66
444 #define GL_FOG_INDEX 0x0B61
445 #define GL_FOG_START 0x0B63
446 #define GL_FOG_END 0x0B64
447 #define GL_LINEAR 0x2601
448 #define GL_EXP 0x0800
449 #define GL_EXP2 0x0801
450
451 /* Logic Ops */
452 #define GL_LOGIC_OP 0x0BF1
453 #define GL_INDEX_LOGIC_OP 0x0BF1
454 #define GL_COLOR_LOGIC_OP 0x0BF2
455 #define GL_LOGIC_OP_MODE 0x0BF0
456 #define GL_CLEAR 0x1500
457 #define GL_SET 0x150F
458 #define GL_COPY 0x1503
459 #define GL_COPY_INVERTED 0x150C
460 #define GL_NOOP 0x1505
461 #define GL_INVERT 0x150A
462 #define GL_AND 0x1501
463 #define GL_NAND 0x150E
464 #define GL_OR 0x1507
465 #define GL_NOR 0x1508
466 #define GL_XOR 0x1506
467 #define GL_EQUIV 0x1509
468 #define GL_AND_REVERSE 0x1502
469 #define GL_AND_INVERTED 0x1504
470 #define GL_OR_REVERSE 0x150B
471 #define GL_OR_INVERTED 0x150D
472
473 /* Stencil */
474 #define GL_STENCIL_BITS 0x0D57
475 #define GL_STENCIL_TEST 0x0B90
476 #define GL_STENCIL_CLEAR_VALUE 0x0B91
477 #define GL_STENCIL_FUNC 0x0B92
478 #define GL_STENCIL_VALUE_MASK 0x0B93
479 #define GL_STENCIL_FAIL 0x0B94
480 #define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
481 #define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
482 #define GL_STENCIL_REF 0x0B97
483 #define GL_STENCIL_WRITEMASK 0x0B98
484 #define GL_STENCIL_INDEX 0x1901
485 #define GL_KEEP 0x1E00
486 #define GL_REPLACE 0x1E01
487 #define GL_INCR 0x1E02
488 #define GL_DECR 0x1E03
489
490 /* Buffers, Pixel Drawing/Reading */
491 #define GL_NONE 0
492 #define GL_LEFT 0x0406
493 #define GL_RIGHT 0x0407
494 /*GL_FRONT 0x0404 */
495 /*GL_BACK 0x0405 */
496 /*GL_FRONT_AND_BACK 0x0408 */
497 #define GL_FRONT_LEFT 0x0400
498 #define GL_FRONT_RIGHT 0x0401
499 #define GL_BACK_LEFT 0x0402
500 #define GL_BACK_RIGHT 0x0403
501 #define GL_AUX0 0x0409
502 #define GL_AUX1 0x040A
503 #define GL_AUX2 0x040B
504 #define GL_AUX3 0x040C
505 #define GL_COLOR_INDEX 0x1900
506 #define GL_RED 0x1903
507 #define GL_GREEN 0x1904
508 #define GL_BLUE 0x1905
509 #define GL_ALPHA 0x1906
510 #define GL_LUMINANCE 0x1909
511 #define GL_LUMINANCE_ALPHA 0x190A
512 #define GL_ALPHA_BITS 0x0D55
513 #define GL_RED_BITS 0x0D52
514 #define GL_GREEN_BITS 0x0D53
515 #define GL_BLUE_BITS 0x0D54
516 #define GL_INDEX_BITS 0x0D51
517 #define GL_SUBPIXEL_BITS 0x0D50
518 #define GL_AUX_BUFFERS 0x0C00
519 #define GL_READ_BUFFER 0x0C02
520 #define GL_DRAW_BUFFER 0x0C01
521 #define GL_DOUBLEBUFFER 0x0C32
522 #define GL_STEREO 0x0C33
523 #define GL_BITMAP 0x1A00
524 #define GL_COLOR 0x1800
525 #define GL_DEPTH 0x1801
526 #define GL_STENCIL 0x1802
527 #define GL_DITHER 0x0BD0
528 #define GL_RGB 0x1907
529 #define GL_RGBA 0x1908
530
531 /* Implementation limits */
532 #define GL_MAX_LIST_NESTING 0x0B31
533 #define GL_MAX_EVAL_ORDER 0x0D30
534 #define GL_MAX_LIGHTS 0x0D31
535 #define GL_MAX_CLIP_PLANES 0x0D32
536 #define GL_MAX_TEXTURE_SIZE 0x0D33
537 #define GL_MAX_PIXEL_MAP_TABLE 0x0D34
538 #define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35
539 #define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36
540 #define GL_MAX_NAME_STACK_DEPTH 0x0D37
541 #define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38
542 #define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39
543 #define GL_MAX_VIEWPORT_DIMS 0x0D3A
544 #define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B
545
546 /* Gets */
547 #define GL_ATTRIB_STACK_DEPTH 0x0BB0
548 #define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1
549 #define GL_COLOR_CLEAR_VALUE 0x0C22
550 #define GL_COLOR_WRITEMASK 0x0C23
551 #define GL_CURRENT_INDEX 0x0B01
552 #define GL_CURRENT_COLOR 0x0B00
553 #define GL_CURRENT_NORMAL 0x0B02
554 #define GL_CURRENT_RASTER_COLOR 0x0B04
555 #define GL_CURRENT_RASTER_DISTANCE 0x0B09
556 #define GL_CURRENT_RASTER_INDEX 0x0B05
557 #define GL_CURRENT_RASTER_POSITION 0x0B07
558 #define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06
559 #define GL_CURRENT_RASTER_POSITION_VALID 0x0B08
560 #define GL_CURRENT_TEXTURE_COORDS 0x0B03
561 #define GL_INDEX_CLEAR_VALUE 0x0C20
562 #define GL_INDEX_MODE 0x0C30
563 #define GL_INDEX_WRITEMASK 0x0C21
564 #define GL_MODELVIEW_MATRIX 0x0BA6
565 #define GL_MODELVIEW_STACK_DEPTH 0x0BA3
566 #define GL_NAME_STACK_DEPTH 0x0D70
567 #define GL_PROJECTION_MATRIX 0x0BA7
568 #define GL_PROJECTION_STACK_DEPTH 0x0BA4
569 #define GL_RENDER_MODE 0x0C40
570 #define GL_RGBA_MODE 0x0C31
571 #define GL_TEXTURE_MATRIX 0x0BA8
572 #define GL_TEXTURE_STACK_DEPTH 0x0BA5
573 #define GL_VIEWPORT 0x0BA2
574
575 /* Evaluators */
576 #define GL_AUTO_NORMAL 0x0D80
577 #define GL_MAP1_COLOR_4 0x0D90
578 #define GL_MAP1_INDEX 0x0D91
579 #define GL_MAP1_NORMAL 0x0D92
580 #define GL_MAP1_TEXTURE_COORD_1 0x0D93
581 #define GL_MAP1_TEXTURE_COORD_2 0x0D94
582 #define GL_MAP1_TEXTURE_COORD_3 0x0D95
583 #define GL_MAP1_TEXTURE_COORD_4 0x0D96
584 #define GL_MAP1_VERTEX_3 0x0D97
585 #define GL_MAP1_VERTEX_4 0x0D98
586 #define GL_MAP2_COLOR_4 0x0DB0
587 #define GL_MAP2_INDEX 0x0DB1
588 #define GL_MAP2_NORMAL 0x0DB2
589 #define GL_MAP2_TEXTURE_COORD_1 0x0DB3
590 #define GL_MAP2_TEXTURE_COORD_2 0x0DB4
591 #define GL_MAP2_TEXTURE_COORD_3 0x0DB5
592 #define GL_MAP2_TEXTURE_COORD_4 0x0DB6
593 #define GL_MAP2_VERTEX_3 0x0DB7
594 #define GL_MAP2_VERTEX_4 0x0DB8
595 #define GL_MAP1_GRID_DOMAIN 0x0DD0
596 #define GL_MAP1_GRID_SEGMENTS 0x0DD1
597 #define GL_MAP2_GRID_DOMAIN 0x0DD2
598 #define GL_MAP2_GRID_SEGMENTS 0x0DD3
599 #define GL_COEFF 0x0A00
600 #define GL_ORDER 0x0A01
601 #define GL_DOMAIN 0x0A02
602
603 /* Hints */
604 #define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50
605 #define GL_POINT_SMOOTH_HINT 0x0C51
606 #define GL_LINE_SMOOTH_HINT 0x0C52
607 #define GL_POLYGON_SMOOTH_HINT 0x0C53
608 #define GL_FOG_HINT 0x0C54
609 #define GL_DONT_CARE 0x1100
610 #define GL_FASTEST 0x1101
611 #define GL_NICEST 0x1102
612
613 /* Scissor box */
614 #define GL_SCISSOR_BOX 0x0C10
615 #define GL_SCISSOR_TEST 0x0C11
616
617 /* Pixel Mode / Transfer */
618 #define GL_MAP_COLOR 0x0D10
619 #define GL_MAP_STENCIL 0x0D11
620 #define GL_INDEX_SHIFT 0x0D12
621 #define GL_INDEX_OFFSET 0x0D13
622 #define GL_RED_SCALE 0x0D14
623 #define GL_RED_BIAS 0x0D15
624 #define GL_GREEN_SCALE 0x0D18
625 #define GL_GREEN_BIAS 0x0D19
626 #define GL_BLUE_SCALE 0x0D1A
627 #define GL_BLUE_BIAS 0x0D1B
628 #define GL_ALPHA_SCALE 0x0D1C
629 #define GL_ALPHA_BIAS 0x0D1D
630 #define GL_DEPTH_SCALE 0x0D1E
631 #define GL_DEPTH_BIAS 0x0D1F
632 #define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1
633 #define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0
634 #define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2
635 #define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3
636 #define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4
637 #define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5
638 #define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6
639 #define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7
640 #define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8
641 #define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9
642 #define GL_PIXEL_MAP_S_TO_S 0x0C71
643 #define GL_PIXEL_MAP_I_TO_I 0x0C70
644 #define GL_PIXEL_MAP_I_TO_R 0x0C72
645 #define GL_PIXEL_MAP_I_TO_G 0x0C73
646 #define GL_PIXEL_MAP_I_TO_B 0x0C74
647 #define GL_PIXEL_MAP_I_TO_A 0x0C75
648 #define GL_PIXEL_MAP_R_TO_R 0x0C76
649 #define GL_PIXEL_MAP_G_TO_G 0x0C77
650 #define GL_PIXEL_MAP_B_TO_B 0x0C78
651 #define GL_PIXEL_MAP_A_TO_A 0x0C79
652 #define GL_PACK_ALIGNMENT 0x0D05
653 #define GL_PACK_LSB_FIRST 0x0D01
654 #define GL_PACK_ROW_LENGTH 0x0D02
655 #define GL_PACK_SKIP_PIXELS 0x0D04
656 #define GL_PACK_SKIP_ROWS 0x0D03
657 #define GL_PACK_SWAP_BYTES 0x0D00
658 #define GL_UNPACK_ALIGNMENT 0x0CF5
659 #define GL_UNPACK_LSB_FIRST 0x0CF1
660 #define GL_UNPACK_ROW_LENGTH 0x0CF2
661 #define GL_UNPACK_SKIP_PIXELS 0x0CF4
662 #define GL_UNPACK_SKIP_ROWS 0x0CF3
663 #define GL_UNPACK_SWAP_BYTES 0x0CF0
664 #define GL_ZOOM_X 0x0D16
665 #define GL_ZOOM_Y 0x0D17
666
667 /* Texture mapping */
668 #define GL_TEXTURE_ENV 0x2300
669 #define GL_TEXTURE_ENV_MODE 0x2200
670 #define GL_TEXTURE_1D 0x0DE0
671 #define GL_TEXTURE_2D 0x0DE1
672 #define GL_TEXTURE_WRAP_S 0x2802
673 #define GL_TEXTURE_WRAP_T 0x2803
674 #define GL_TEXTURE_MAG_FILTER 0x2800
675 #define GL_TEXTURE_MIN_FILTER 0x2801
676 #define GL_TEXTURE_ENV_COLOR 0x2201
677 #define GL_TEXTURE_GEN_S 0x0C60
678 #define GL_TEXTURE_GEN_T 0x0C61
679 #define GL_TEXTURE_GEN_R 0x0C62
680 #define GL_TEXTURE_GEN_Q 0x0C63
681 #define GL_TEXTURE_GEN_MODE 0x2500
682 #define GL_TEXTURE_BORDER_COLOR 0x1004
683 #define GL_TEXTURE_WIDTH 0x1000
684 #define GL_TEXTURE_HEIGHT 0x1001
685 #define GL_TEXTURE_BORDER 0x1005
686 #define GL_TEXTURE_COMPONENTS 0x1003
687 #define GL_TEXTURE_RED_SIZE 0x805C
688 #define GL_TEXTURE_GREEN_SIZE 0x805D
689 #define GL_TEXTURE_BLUE_SIZE 0x805E
690 #define GL_TEXTURE_ALPHA_SIZE 0x805F
691 #define GL_TEXTURE_LUMINANCE_SIZE 0x8060
692 #define GL_TEXTURE_INTENSITY_SIZE 0x8061
693 #define GL_NEAREST_MIPMAP_NEAREST 0x2700
694 #define GL_NEAREST_MIPMAP_LINEAR 0x2702
695 #define GL_LINEAR_MIPMAP_NEAREST 0x2701
696 #define GL_LINEAR_MIPMAP_LINEAR 0x2703
697 #define GL_OBJECT_LINEAR 0x2401
698 #define GL_OBJECT_PLANE 0x2501
699 #define GL_EYE_LINEAR 0x2400
700 #define GL_EYE_PLANE 0x2502
701 #define GL_SPHERE_MAP 0x2402
702 #define GL_DECAL 0x2101
703 #define GL_MODULATE 0x2100
704 #define GL_NEAREST 0x2600
705 #define GL_REPEAT 0x2901
706 #define GL_CLAMP 0x2900
707 #define GL_S 0x2000
708 #define GL_T 0x2001
709 #define GL_R 0x2002
710 #define GL_Q 0x2003
711
712 /* Utility */
713 #define GL_VENDOR 0x1F00
714 #define GL_RENDERER 0x1F01
715 #define GL_VERSION 0x1F02
716 #define GL_EXTENSIONS 0x1F03
717
718 /* Errors */
719 #define GL_NO_ERROR 0
720 #define GL_INVALID_ENUM 0x0500
721 #define GL_INVALID_VALUE 0x0501
722 #define GL_INVALID_OPERATION 0x0502
723 #define GL_STACK_OVERFLOW 0x0503
724 #define GL_STACK_UNDERFLOW 0x0504
725 #define GL_OUT_OF_MEMORY 0x0505
726
727 /* glPush/PopAttrib bits */
728 #define GL_CURRENT_BIT 0x00000001
729 #define GL_POINT_BIT 0x00000002
730 #define GL_LINE_BIT 0x00000004
731 #define GL_POLYGON_BIT 0x00000008
732 #define GL_POLYGON_STIPPLE_BIT 0x00000010
733 #define GL_PIXEL_MODE_BIT 0x00000020
734 #define GL_LIGHTING_BIT 0x00000040
735 #define GL_FOG_BIT 0x00000080
736 #define GL_DEPTH_BUFFER_BIT 0x00000100
737 #define GL_ACCUM_BUFFER_BIT 0x00000200
738 #define GL_STENCIL_BUFFER_BIT 0x00000400
739 #define GL_VIEWPORT_BIT 0x00000800
740 #define GL_TRANSFORM_BIT 0x00001000
741 #define GL_ENABLE_BIT 0x00002000
742 #define GL_COLOR_BUFFER_BIT 0x00004000
743 #define GL_HINT_BIT 0x00008000
744 #define GL_EVAL_BIT 0x00010000
745 #define GL_LIST_BIT 0x00020000
746 #define GL_TEXTURE_BIT 0x00040000
747 #define GL_SCISSOR_BIT 0x00080000
748 #define GL_ALL_ATTRIB_BITS 0x000FFFFF
749
750
751 /* OpenGL 1.1 */
752 #define GL_PROXY_TEXTURE_1D 0x8063
753 #define GL_PROXY_TEXTURE_2D 0x8064
754 #define GL_TEXTURE_PRIORITY 0x8066
755 #define GL_TEXTURE_RESIDENT 0x8067
756 #define GL_TEXTURE_BINDING_1D 0x8068
757 #define GL_TEXTURE_BINDING_2D 0x8069
758 #define GL_TEXTURE_INTERNAL_FORMAT 0x1003
759 #define GL_ALPHA4 0x803B
760 #define GL_ALPHA8 0x803C
761 #define GL_ALPHA12 0x803D
762 #define GL_ALPHA16 0x803E
763 #define GL_LUMINANCE4 0x803F
764 #define GL_LUMINANCE8 0x8040
765 #define GL_LUMINANCE12 0x8041
766 #define GL_LUMINANCE16 0x8042
767 #define GL_LUMINANCE4_ALPHA4 0x8043
768 #define GL_LUMINANCE6_ALPHA2 0x8044
769 #define GL_LUMINANCE8_ALPHA8 0x8045
770 #define GL_LUMINANCE12_ALPHA4 0x8046
771 #define GL_LUMINANCE12_ALPHA12 0x8047
772 #define GL_LUMINANCE16_ALPHA16 0x8048
773 #define GL_INTENSITY 0x8049
774 #define GL_INTENSITY4 0x804A
775 #define GL_INTENSITY8 0x804B
776 #define GL_INTENSITY12 0x804C
777 #define GL_INTENSITY16 0x804D
778 #define GL_R3_G3_B2 0x2A10
779 #define GL_RGB4 0x804F
780 #define GL_RGB5 0x8050
781 #define GL_RGB8 0x8051
782 #define GL_RGB10 0x8052
783 #define GL_RGB12 0x8053
784 #define GL_RGB16 0x8054
785 #define GL_RGBA2 0x8055
786 #define GL_RGBA4 0x8056
787 #define GL_RGB5_A1 0x8057
788 #define GL_RGBA8 0x8058
789 #define GL_RGB10_A2 0x8059
790 #define GL_RGBA12 0x805A
791 #define GL_RGBA16 0x805B
792 #define GL_CLIENT_PIXEL_STORE_BIT 0x00000001
793 #define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002
794 #define GL_ALL_CLIENT_ATTRIB_BITS 0xFFFFFFFF
795 #define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF
796
797
798
799 /*
800 * Miscellaneous
801 */
802
803 GLAPI void GLAPIENTRY glClearIndex( GLfloat c );
804
805 GLAPI void GLAPIENTRY glClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha );
806
807 GLAPI void GLAPIENTRY glClear( GLbitfield mask );
808
809 GLAPI void GLAPIENTRY glIndexMask( GLuint mask );
810
811 GLAPI void GLAPIENTRY glColorMask( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha );
812
813 GLAPI void GLAPIENTRY glAlphaFunc( GLenum func, GLclampf ref );
814
815 GLAPI void GLAPIENTRY glBlendFunc( GLenum sfactor, GLenum dfactor );
816
817 GLAPI void GLAPIENTRY glLogicOp( GLenum opcode );
818
819 GLAPI void GLAPIENTRY glCullFace( GLenum mode );
820
821 GLAPI void GLAPIENTRY glFrontFace( GLenum mode );
822
823 GLAPI void GLAPIENTRY glPointSize( GLfloat size );
824
825 GLAPI void GLAPIENTRY glLineWidth( GLfloat width );
826
827 GLAPI void GLAPIENTRY glLineStipple( GLint factor, GLushort pattern );
828
829 GLAPI void GLAPIENTRY glPolygonMode( GLenum face, GLenum mode );
830
831 GLAPI void GLAPIENTRY glPolygonOffset( GLfloat factor, GLfloat units );
832
833 GLAPI void GLAPIENTRY glPolygonStipple( const GLubyte *mask );
834
835 GLAPI void GLAPIENTRY glGetPolygonStipple( GLubyte *mask );
836
837 GLAPI void GLAPIENTRY glEdgeFlag( GLboolean flag );
838
839 GLAPI void GLAPIENTRY glEdgeFlagv( const GLboolean *flag );
840
841 GLAPI void GLAPIENTRY glScissor( GLint x, GLint y, GLsizei width, GLsizei height);
842
843 GLAPI void GLAPIENTRY glClipPlane( GLenum plane, const GLdouble *equation );
844
845 GLAPI void GLAPIENTRY glGetClipPlane( GLenum plane, GLdouble *equation );
846
847 GLAPI void GLAPIENTRY glDrawBuffer( GLenum mode );
848
849 GLAPI void GLAPIENTRY glReadBuffer( GLenum mode );
850
851 GLAPI void GLAPIENTRY glEnable( GLenum cap );
852
853 GLAPI void GLAPIENTRY glDisable( GLenum cap );
854
855 GLAPI GLboolean GLAPIENTRY glIsEnabled( GLenum cap );
856
857
858 GLAPI void GLAPIENTRY glEnableClientState( GLenum cap ); /* 1.1 */
859
860 GLAPI void GLAPIENTRY glDisableClientState( GLenum cap ); /* 1.1 */
861
862
863 GLAPI void GLAPIENTRY glGetBooleanv( GLenum pname, GLboolean *params );
864
865 GLAPI void GLAPIENTRY glGetDoublev( GLenum pname, GLdouble *params );
866
867 GLAPI void GLAPIENTRY glGetFloatv( GLenum pname, GLfloat *params );
868
869 GLAPI void GLAPIENTRY glGetIntegerv( GLenum pname, GLint *params );
870
871
872 GLAPI void GLAPIENTRY glPushAttrib( GLbitfield mask );
873
874 GLAPI void GLAPIENTRY glPopAttrib( void );
875
876
877 GLAPI void GLAPIENTRY glPushClientAttrib( GLbitfield mask ); /* 1.1 */
878
879 GLAPI void GLAPIENTRY glPopClientAttrib( void ); /* 1.1 */
880
881
882 GLAPI GLint GLAPIENTRY glRenderMode( GLenum mode );
883
884 GLAPI GLenum GLAPIENTRY glGetError( void );
885
886 GLAPI const GLubyte * GLAPIENTRY glGetString( GLenum name );
887
888 GLAPI void GLAPIENTRY glFinish( void );
889
890 GLAPI void GLAPIENTRY glFlush( void );
891
892 GLAPI void GLAPIENTRY glHint( GLenum target, GLenum mode );
893
894
895 /*
896 * Depth Buffer
897 */
898
899 GLAPI void GLAPIENTRY glClearDepth( GLclampd depth );
900
901 GLAPI void GLAPIENTRY glDepthFunc( GLenum func );
902
903 GLAPI void GLAPIENTRY glDepthMask( GLboolean flag );
904
905 GLAPI void GLAPIENTRY glDepthRange( GLclampd near_val, GLclampd far_val );
906
907
908 /*
909 * Accumulation Buffer
910 */
911
912 GLAPI void GLAPIENTRY glClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha );
913
914 GLAPI void GLAPIENTRY glAccum( GLenum op, GLfloat value );
915
916
917 /*
918 * Transformation
919 */
920
921 GLAPI void GLAPIENTRY glMatrixMode( GLenum mode );
922
923 GLAPI void GLAPIENTRY glOrtho( GLdouble left, GLdouble right,
924 GLdouble bottom, GLdouble top,
925 GLdouble near_val, GLdouble far_val );
926
927 GLAPI void GLAPIENTRY glFrustum( GLdouble left, GLdouble right,
928 GLdouble bottom, GLdouble top,
929 GLdouble near_val, GLdouble far_val );
930
931 GLAPI void GLAPIENTRY glViewport( GLint x, GLint y,
932 GLsizei width, GLsizei height );
933
934 GLAPI void GLAPIENTRY glPushMatrix( void );
935
936 GLAPI void GLAPIENTRY glPopMatrix( void );
937
938 GLAPI void GLAPIENTRY glLoadIdentity( void );
939
940 GLAPI void GLAPIENTRY glLoadMatrixd( const GLdouble *m );
941 GLAPI void GLAPIENTRY glLoadMatrixf( const GLfloat *m );
942
943 GLAPI void GLAPIENTRY glMultMatrixd( const GLdouble *m );
944 GLAPI void GLAPIENTRY glMultMatrixf( const GLfloat *m );
945
946 GLAPI void GLAPIENTRY glRotated( GLdouble angle,
947 GLdouble x, GLdouble y, GLdouble z );
948 GLAPI void GLAPIENTRY glRotatef( GLfloat angle,
949 GLfloat x, GLfloat y, GLfloat z );
950
951 GLAPI void GLAPIENTRY glScaled( GLdouble x, GLdouble y, GLdouble z );
952 GLAPI void GLAPIENTRY glScalef( GLfloat x, GLfloat y, GLfloat z );
953
954 GLAPI void GLAPIENTRY glTranslated( GLdouble x, GLdouble y, GLdouble z );
955 GLAPI void GLAPIENTRY glTranslatef( GLfloat x, GLfloat y, GLfloat z );
956
957
958 /*
959 * Display Lists
960 */
961
962 GLAPI GLboolean GLAPIENTRY glIsList( GLuint list );
963
964 GLAPI void GLAPIENTRY glDeleteLists( GLuint list, GLsizei range );
965
966 GLAPI GLuint GLAPIENTRY glGenLists( GLsizei range );
967
968 GLAPI void GLAPIENTRY glNewList( GLuint list, GLenum mode );
969
970 GLAPI void GLAPIENTRY glEndList( void );
971
972 GLAPI void GLAPIENTRY glCallList( GLuint list );
973
974 GLAPI void GLAPIENTRY glCallLists( GLsizei n, GLenum type,
975 const GLvoid *lists );
976
977 GLAPI void GLAPIENTRY glListBase( GLuint base );
978
979
980 /*
981 * Drawing Functions
982 */
983
984 GLAPI void GLAPIENTRY glBegin( GLenum mode );
985
986 GLAPI void GLAPIENTRY glEnd( void );
987
988
989 GLAPI void GLAPIENTRY glVertex2d( GLdouble x, GLdouble y );
990 GLAPI void GLAPIENTRY glVertex2f( GLfloat x, GLfloat y );
991 GLAPI void GLAPIENTRY glVertex2i( GLint x, GLint y );
992 GLAPI void GLAPIENTRY glVertex2s( GLshort x, GLshort y );
993
994 GLAPI void GLAPIENTRY glVertex3d( GLdouble x, GLdouble y, GLdouble z );
995 GLAPI void GLAPIENTRY glVertex3f( GLfloat x, GLfloat y, GLfloat z );
996 GLAPI void GLAPIENTRY glVertex3i( GLint x, GLint y, GLint z );
997 GLAPI void GLAPIENTRY glVertex3s( GLshort x, GLshort y, GLshort z );
998
999 GLAPI void GLAPIENTRY glVertex4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w );
1000 GLAPI void GLAPIENTRY glVertex4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w );
1001 GLAPI void GLAPIENTRY glVertex4i( GLint x, GLint y, GLint z, GLint w );
1002 GLAPI void GLAPIENTRY glVertex4s( GLshort x, GLshort y, GLshort z, GLshort w );
1003
1004 GLAPI void GLAPIENTRY glVertex2dv( const GLdouble *v );
1005 GLAPI void GLAPIENTRY glVertex2fv( const GLfloat *v );
1006 GLAPI void GLAPIENTRY glVertex2iv( const GLint *v );
1007 GLAPI void GLAPIENTRY glVertex2sv( const GLshort *v );
1008
1009 GLAPI void GLAPIENTRY glVertex3dv( const GLdouble *v );
1010 GLAPI void GLAPIENTRY glVertex3fv( const GLfloat *v );
1011 GLAPI void GLAPIENTRY glVertex3iv( const GLint *v );
1012 GLAPI void GLAPIENTRY glVertex3sv( const GLshort *v );
1013
1014 GLAPI void GLAPIENTRY glVertex4dv( const GLdouble *v );
1015 GLAPI void GLAPIENTRY glVertex4fv( const GLfloat *v );
1016 GLAPI void GLAPIENTRY glVertex4iv( const GLint *v );
1017 GLAPI void GLAPIENTRY glVertex4sv( const GLshort *v );
1018
1019
1020 GLAPI void GLAPIENTRY glNormal3b( GLbyte nx, GLbyte ny, GLbyte nz );
1021 GLAPI void GLAPIENTRY glNormal3d( GLdouble nx, GLdouble ny, GLdouble nz );
1022 GLAPI void GLAPIENTRY glNormal3f( GLfloat nx, GLfloat ny, GLfloat nz );
1023 GLAPI void GLAPIENTRY glNormal3i( GLint nx, GLint ny, GLint nz );
1024 GLAPI void GLAPIENTRY glNormal3s( GLshort nx, GLshort ny, GLshort nz );
1025
1026 GLAPI void GLAPIENTRY glNormal3bv( const GLbyte *v );
1027 GLAPI void GLAPIENTRY glNormal3dv( const GLdouble *v );
1028 GLAPI void GLAPIENTRY glNormal3fv( const GLfloat *v );
1029 GLAPI void GLAPIENTRY glNormal3iv( const GLint *v );
1030 GLAPI void GLAPIENTRY glNormal3sv( const GLshort *v );
1031
1032
1033 GLAPI void GLAPIENTRY glIndexd( GLdouble c );
1034 GLAPI void GLAPIENTRY glIndexf( GLfloat c );
1035 GLAPI void GLAPIENTRY glIndexi( GLint c );
1036 GLAPI void GLAPIENTRY glIndexs( GLshort c );
1037 GLAPI void GLAPIENTRY glIndexub( GLubyte c ); /* 1.1 */
1038
1039 GLAPI void GLAPIENTRY glIndexdv( const GLdouble *c );
1040 GLAPI void GLAPIENTRY glIndexfv( const GLfloat *c );
1041 GLAPI void GLAPIENTRY glIndexiv( const GLint *c );
1042 GLAPI void GLAPIENTRY glIndexsv( const GLshort *c );
1043 GLAPI void GLAPIENTRY glIndexubv( const GLubyte *c ); /* 1.1 */
1044
1045 GLAPI void GLAPIENTRY glColor3b( GLbyte red, GLbyte green, GLbyte blue );
1046 GLAPI void GLAPIENTRY glColor3d( GLdouble red, GLdouble green, GLdouble blue );
1047 GLAPI void GLAPIENTRY glColor3f( GLfloat red, GLfloat green, GLfloat blue );
1048 GLAPI void GLAPIENTRY glColor3i( GLint red, GLint green, GLint blue );
1049 GLAPI void GLAPIENTRY glColor3s( GLshort red, GLshort green, GLshort blue );
1050 GLAPI void GLAPIENTRY glColor3ub( GLubyte red, GLubyte green, GLubyte blue );
1051 GLAPI void GLAPIENTRY glColor3ui( GLuint red, GLuint green, GLuint blue );
1052 GLAPI void GLAPIENTRY glColor3us( GLushort red, GLushort green, GLushort blue );
1053
1054 GLAPI void GLAPIENTRY glColor4b( GLbyte red, GLbyte green,
1055 GLbyte blue, GLbyte alpha );
1056 GLAPI void GLAPIENTRY glColor4d( GLdouble red, GLdouble green,
1057 GLdouble blue, GLdouble alpha );
1058 GLAPI void GLAPIENTRY glColor4f( GLfloat red, GLfloat green,
1059 GLfloat blue, GLfloat alpha );
1060 GLAPI void GLAPIENTRY glColor4i( GLint red, GLint green,
1061 GLint blue, GLint alpha );
1062 GLAPI void GLAPIENTRY glColor4s( GLshort red, GLshort green,
1063 GLshort blue, GLshort alpha );
1064 GLAPI void GLAPIENTRY glColor4ub( GLubyte red, GLubyte green,
1065 GLubyte blue, GLubyte alpha );
1066 GLAPI void GLAPIENTRY glColor4ui( GLuint red, GLuint green,
1067 GLuint blue, GLuint alpha );
1068 GLAPI void GLAPIENTRY glColor4us( GLushort red, GLushort green,
1069 GLushort blue, GLushort alpha );
1070
1071
1072 GLAPI void GLAPIENTRY glColor3bv( const GLbyte *v );
1073 GLAPI void GLAPIENTRY glColor3dv( const GLdouble *v );
1074 GLAPI void GLAPIENTRY glColor3fv( const GLfloat *v );
1075 GLAPI void GLAPIENTRY glColor3iv( const GLint *v );
1076 GLAPI void GLAPIENTRY glColor3sv( const GLshort *v );
1077 GLAPI void GLAPIENTRY glColor3ubv( const GLubyte *v );
1078 GLAPI void GLAPIENTRY glColor3uiv( const GLuint *v );
1079 GLAPI void GLAPIENTRY glColor3usv( const GLushort *v );
1080
1081 GLAPI void GLAPIENTRY glColor4bv( const GLbyte *v );
1082 GLAPI void GLAPIENTRY glColor4dv( const GLdouble *v );
1083 GLAPI void GLAPIENTRY glColor4fv( const GLfloat *v );
1084 GLAPI void GLAPIENTRY glColor4iv( const GLint *v );
1085 GLAPI void GLAPIENTRY glColor4sv( const GLshort *v );
1086 GLAPI void GLAPIENTRY glColor4ubv( const GLubyte *v );
1087 GLAPI void GLAPIENTRY glColor4uiv( const GLuint *v );
1088 GLAPI void GLAPIENTRY glColor4usv( const GLushort *v );
1089
1090
1091 GLAPI void GLAPIENTRY glTexCoord1d( GLdouble s );
1092 GLAPI void GLAPIENTRY glTexCoord1f( GLfloat s );
1093 GLAPI void GLAPIENTRY glTexCoord1i( GLint s );
1094 GLAPI void GLAPIENTRY glTexCoord1s( GLshort s );
1095
1096 GLAPI void GLAPIENTRY glTexCoord2d( GLdouble s, GLdouble t );
1097 GLAPI void GLAPIENTRY glTexCoord2f( GLfloat s, GLfloat t );
1098 GLAPI void GLAPIENTRY glTexCoord2i( GLint s, GLint t );
1099 GLAPI void GLAPIENTRY glTexCoord2s( GLshort s, GLshort t );
1100
1101 GLAPI void GLAPIENTRY glTexCoord3d( GLdouble s, GLdouble t, GLdouble r );
1102 GLAPI void GLAPIENTRY glTexCoord3f( GLfloat s, GLfloat t, GLfloat r );
1103 GLAPI void GLAPIENTRY glTexCoord3i( GLint s, GLint t, GLint r );
1104 GLAPI void GLAPIENTRY glTexCoord3s( GLshort s, GLshort t, GLshort r );
1105
1106 GLAPI void GLAPIENTRY glTexCoord4d( GLdouble s, GLdouble t, GLdouble r, GLdouble q );
1107 GLAPI void GLAPIENTRY glTexCoord4f( GLfloat s, GLfloat t, GLfloat r, GLfloat q );
1108 GLAPI void GLAPIENTRY glTexCoord4i( GLint s, GLint t, GLint r, GLint q );
1109 GLAPI void GLAPIENTRY glTexCoord4s( GLshort s, GLshort t, GLshort r, GLshort q );
1110
1111 GLAPI void GLAPIENTRY glTexCoord1dv( const GLdouble *v );
1112 GLAPI void GLAPIENTRY glTexCoord1fv( const GLfloat *v );
1113 GLAPI void GLAPIENTRY glTexCoord1iv( const GLint *v );
1114 GLAPI void GLAPIENTRY glTexCoord1sv( const GLshort *v );
1115
1116 GLAPI void GLAPIENTRY glTexCoord2dv( const GLdouble *v );
1117 GLAPI void GLAPIENTRY glTexCoord2fv( const GLfloat *v );
1118 GLAPI void GLAPIENTRY glTexCoord2iv( const GLint *v );
1119 GLAPI void GLAPIENTRY glTexCoord2sv( const GLshort *v );
1120
1121 GLAPI void GLAPIENTRY glTexCoord3dv( const GLdouble *v );
1122 GLAPI void GLAPIENTRY glTexCoord3fv( const GLfloat *v );
1123 GLAPI void GLAPIENTRY glTexCoord3iv( const GLint *v );
1124 GLAPI void GLAPIENTRY glTexCoord3sv( const GLshort *v );
1125
1126 GLAPI void GLAPIENTRY glTexCoord4dv( const GLdouble *v );
1127 GLAPI void GLAPIENTRY glTexCoord4fv( const GLfloat *v );
1128 GLAPI void GLAPIENTRY glTexCoord4iv( const GLint *v );
1129 GLAPI void GLAPIENTRY glTexCoord4sv( const GLshort *v );
1130
1131
1132 GLAPI void GLAPIENTRY glRasterPos2d( GLdouble x, GLdouble y );
1133 GLAPI void GLAPIENTRY glRasterPos2f( GLfloat x, GLfloat y );
1134 GLAPI void GLAPIENTRY glRasterPos2i( GLint x, GLint y );
1135 GLAPI void GLAPIENTRY glRasterPos2s( GLshort x, GLshort y );
1136
1137 GLAPI void GLAPIENTRY glRasterPos3d( GLdouble x, GLdouble y, GLdouble z );
1138 GLAPI void GLAPIENTRY glRasterPos3f( GLfloat x, GLfloat y, GLfloat z );
1139 GLAPI void GLAPIENTRY glRasterPos3i( GLint x, GLint y, GLint z );
1140 GLAPI void GLAPIENTRY glRasterPos3s( GLshort x, GLshort y, GLshort z );
1141
1142 GLAPI void GLAPIENTRY glRasterPos4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w );
1143 GLAPI void GLAPIENTRY glRasterPos4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w );
1144 GLAPI void GLAPIENTRY glRasterPos4i( GLint x, GLint y, GLint z, GLint w );
1145 GLAPI void GLAPIENTRY glRasterPos4s( GLshort x, GLshort y, GLshort z, GLshort w );
1146
1147 GLAPI void GLAPIENTRY glRasterPos2dv( const GLdouble *v );
1148 GLAPI void GLAPIENTRY glRasterPos2fv( const GLfloat *v );
1149 GLAPI void GLAPIENTRY glRasterPos2iv( const GLint *v );
1150 GLAPI void GLAPIENTRY glRasterPos2sv( const GLshort *v );
1151
1152 GLAPI void GLAPIENTRY glRasterPos3dv( const GLdouble *v );
1153 GLAPI void GLAPIENTRY glRasterPos3fv( const GLfloat *v );
1154 GLAPI void GLAPIENTRY glRasterPos3iv( const GLint *v );
1155 GLAPI void GLAPIENTRY glRasterPos3sv( const GLshort *v );
1156
1157 GLAPI void GLAPIENTRY glRasterPos4dv( const GLdouble *v );
1158 GLAPI void GLAPIENTRY glRasterPos4fv( const GLfloat *v );
1159 GLAPI void GLAPIENTRY glRasterPos4iv( const GLint *v );
1160 GLAPI void GLAPIENTRY glRasterPos4sv( const GLshort *v );
1161
1162
1163 GLAPI void GLAPIENTRY glRectd( GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2 );
1164 GLAPI void GLAPIENTRY glRectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 );
1165 GLAPI void GLAPIENTRY glRecti( GLint x1, GLint y1, GLint x2, GLint y2 );
1166 GLAPI void GLAPIENTRY glRects( GLshort x1, GLshort y1, GLshort x2, GLshort y2 );
1167
1168
1169 GLAPI void GLAPIENTRY glRectdv( const GLdouble *v1, const GLdouble *v2 );
1170 GLAPI void GLAPIENTRY glRectfv( const GLfloat *v1, const GLfloat *v2 );
1171 GLAPI void GLAPIENTRY glRectiv( const GLint *v1, const GLint *v2 );
1172 GLAPI void GLAPIENTRY glRectsv( const GLshort *v1, const GLshort *v2 );
1173
1174
1175 /*
1176 * Vertex Arrays (1.1)
1177 */
1178
1179 GLAPI void GLAPIENTRY glVertexPointer( GLint size, GLenum type,
1180 GLsizei stride, const GLvoid *ptr );
1181
1182 GLAPI void GLAPIENTRY glNormalPointer( GLenum type, GLsizei stride,
1183 const GLvoid *ptr );
1184
1185 GLAPI void GLAPIENTRY glColorPointer( GLint size, GLenum type,
1186 GLsizei stride, const GLvoid *ptr );
1187
1188 GLAPI void GLAPIENTRY glIndexPointer( GLenum type, GLsizei stride,
1189 const GLvoid *ptr );
1190
1191 GLAPI void GLAPIENTRY glTexCoordPointer( GLint size, GLenum type,
1192 GLsizei stride, const GLvoid *ptr );
1193
1194 GLAPI void GLAPIENTRY glEdgeFlagPointer( GLsizei stride, const GLvoid *ptr );
1195
1196 GLAPI void GLAPIENTRY glGetPointerv( GLenum pname, GLvoid **params );
1197
1198 GLAPI void GLAPIENTRY glArrayElement( GLint i );
1199
1200 GLAPI void GLAPIENTRY glDrawArrays( GLenum mode, GLint first, GLsizei count );
1201
1202 GLAPI void GLAPIENTRY glDrawElements( GLenum mode, GLsizei count,
1203 GLenum type, const GLvoid *indices );
1204
1205 GLAPI void GLAPIENTRY glInterleavedArrays( GLenum format, GLsizei stride,
1206 const GLvoid *pointer );
1207
1208 /*
1209 * Lighting
1210 */
1211
1212 GLAPI void GLAPIENTRY glShadeModel( GLenum mode );
1213
1214 GLAPI void GLAPIENTRY glLightf( GLenum light, GLenum pname, GLfloat param );
1215 GLAPI void GLAPIENTRY glLighti( GLenum light, GLenum pname, GLint param );
1216 GLAPI void GLAPIENTRY glLightfv( GLenum light, GLenum pname,
1217 const GLfloat *params );
1218 GLAPI void GLAPIENTRY glLightiv( GLenum light, GLenum pname,
1219 const GLint *params );
1220
1221 GLAPI void GLAPIENTRY glGetLightfv( GLenum light, GLenum pname,
1222 GLfloat *params );
1223 GLAPI void GLAPIENTRY glGetLightiv( GLenum light, GLenum pname,
1224 GLint *params );
1225
1226 GLAPI void GLAPIENTRY glLightModelf( GLenum pname, GLfloat param );
1227 GLAPI void GLAPIENTRY glLightModeli( GLenum pname, GLint param );
1228 GLAPI void GLAPIENTRY glLightModelfv( GLenum pname, const GLfloat *params );
1229 GLAPI void GLAPIENTRY glLightModeliv( GLenum pname, const GLint *params );
1230
1231 GLAPI void GLAPIENTRY glMaterialf( GLenum face, GLenum pname, GLfloat param );
1232 GLAPI void GLAPIENTRY glMateriali( GLenum face, GLenum pname, GLint param );
1233 GLAPI void GLAPIENTRY glMaterialfv( GLenum face, GLenum pname, const GLfloat *params );
1234 GLAPI void GLAPIENTRY glMaterialiv( GLenum face, GLenum pname, const GLint *params );
1235
1236 GLAPI void GLAPIENTRY glGetMaterialfv( GLenum face, GLenum pname, GLfloat *params );
1237 GLAPI void GLAPIENTRY glGetMaterialiv( GLenum face, GLenum pname, GLint *params );
1238
1239 GLAPI void GLAPIENTRY glColorMaterial( GLenum face, GLenum mode );
1240
1241
1242 /*
1243 * Raster functions
1244 */
1245
1246 GLAPI void GLAPIENTRY glPixelZoom( GLfloat xfactor, GLfloat yfactor );
1247
1248 GLAPI void GLAPIENTRY glPixelStoref( GLenum pname, GLfloat param );
1249 GLAPI void GLAPIENTRY glPixelStorei( GLenum pname, GLint param );
1250
1251 GLAPI void GLAPIENTRY glPixelTransferf( GLenum pname, GLfloat param );
1252 GLAPI void GLAPIENTRY glPixelTransferi( GLenum pname, GLint param );
1253
1254 GLAPI void GLAPIENTRY glPixelMapfv( GLenum map, GLsizei mapsize,
1255 const GLfloat *values );
1256 GLAPI void GLAPIENTRY glPixelMapuiv( GLenum map, GLsizei mapsize,
1257 const GLuint *values );
1258 GLAPI void GLAPIENTRY glPixelMapusv( GLenum map, GLsizei mapsize,
1259 const GLushort *values );
1260
1261 GLAPI void GLAPIENTRY glGetPixelMapfv( GLenum map, GLfloat *values );
1262 GLAPI void GLAPIENTRY glGetPixelMapuiv( GLenum map, GLuint *values );
1263 GLAPI void GLAPIENTRY glGetPixelMapusv( GLenum map, GLushort *values );
1264
1265 GLAPI void GLAPIENTRY glBitmap( GLsizei width, GLsizei height,
1266 GLfloat xorig, GLfloat yorig,
1267 GLfloat xmove, GLfloat ymove,
1268 const GLubyte *bitmap );
1269
1270 GLAPI void GLAPIENTRY glReadPixels( GLint x, GLint y,
1271 GLsizei width, GLsizei height,
1272 GLenum format, GLenum type,
1273 GLvoid *pixels );
1274
1275 GLAPI void GLAPIENTRY glDrawPixels( GLsizei width, GLsizei height,
1276 GLenum format, GLenum type,
1277 const GLvoid *pixels );
1278
1279 GLAPI void GLAPIENTRY glCopyPixels( GLint x, GLint y,
1280 GLsizei width, GLsizei height,
1281 GLenum type );
1282
1283 /*
1284 * Stenciling
1285 */
1286
1287 GLAPI void GLAPIENTRY glStencilFunc( GLenum func, GLint ref, GLuint mask );
1288
1289 GLAPI void GLAPIENTRY glStencilMask( GLuint mask );
1290
1291 GLAPI void GLAPIENTRY glStencilOp( GLenum fail, GLenum zfail, GLenum zpass );
1292
1293 GLAPI void GLAPIENTRY glClearStencil( GLint s );
1294
1295
1296
1297 /*
1298 * Texture mapping
1299 */
1300
1301 GLAPI void GLAPIENTRY glTexGend( GLenum coord, GLenum pname, GLdouble param );
1302 GLAPI void GLAPIENTRY glTexGenf( GLenum coord, GLenum pname, GLfloat param );
1303 GLAPI void GLAPIENTRY glTexGeni( GLenum coord, GLenum pname, GLint param );
1304
1305 GLAPI void GLAPIENTRY glTexGendv( GLenum coord, GLenum pname, const GLdouble *params );
1306 GLAPI void GLAPIENTRY glTexGenfv( GLenum coord, GLenum pname, const GLfloat *params );
1307 GLAPI void GLAPIENTRY glTexGeniv( GLenum coord, GLenum pname, const GLint *params );
1308
1309 GLAPI void GLAPIENTRY glGetTexGendv( GLenum coord, GLenum pname, GLdouble *params );
1310 GLAPI void GLAPIENTRY glGetTexGenfv( GLenum coord, GLenum pname, GLfloat *params );
1311 GLAPI void GLAPIENTRY glGetTexGeniv( GLenum coord, GLenum pname, GLint *params );
1312
1313
1314 GLAPI void GLAPIENTRY glTexEnvf( GLenum target, GLenum pname, GLfloat param );
1315 GLAPI void GLAPIENTRY glTexEnvi( GLenum target, GLenum pname, GLint param );
1316
1317 GLAPI void GLAPIENTRY glTexEnvfv( GLenum target, GLenum pname, const GLfloat *params );
1318 GLAPI void GLAPIENTRY glTexEnviv( GLenum target, GLenum pname, const GLint *params );
1319
1320 GLAPI void GLAPIENTRY glGetTexEnvfv( GLenum target, GLenum pname, GLfloat *params );
1321 GLAPI void GLAPIENTRY glGetTexEnviv( GLenum target, GLenum pname, GLint *params );
1322
1323
1324 GLAPI void GLAPIENTRY glTexParameterf( GLenum target, GLenum pname, GLfloat param );
1325 GLAPI void GLAPIENTRY glTexParameteri( GLenum target, GLenum pname, GLint param );
1326
1327 GLAPI void GLAPIENTRY glTexParameterfv( GLenum target, GLenum pname,
1328 const GLfloat *params );
1329 GLAPI void GLAPIENTRY glTexParameteriv( GLenum target, GLenum pname,
1330 const GLint *params );
1331
1332 GLAPI void GLAPIENTRY glGetTexParameterfv( GLenum target,
1333 GLenum pname, GLfloat *params);
1334 GLAPI void GLAPIENTRY glGetTexParameteriv( GLenum target,
1335 GLenum pname, GLint *params );
1336
1337 GLAPI void GLAPIENTRY glGetTexLevelParameterfv( GLenum target, GLint level,
1338 GLenum pname, GLfloat *params );
1339 GLAPI void GLAPIENTRY glGetTexLevelParameteriv( GLenum target, GLint level,
1340 GLenum pname, GLint *params );
1341
1342
1343 GLAPI void GLAPIENTRY glTexImage1D( GLenum target, GLint level,
1344 GLint internalFormat,
1345 GLsizei width, GLint border,
1346 GLenum format, GLenum type,
1347 const GLvoid *pixels );
1348
1349 GLAPI void GLAPIENTRY glTexImage2D( GLenum target, GLint level,
1350 GLint internalFormat,
1351 GLsizei width, GLsizei height,
1352 GLint border, GLenum format, GLenum type,
1353 const GLvoid *pixels );
1354
1355 GLAPI void GLAPIENTRY glGetTexImage( GLenum target, GLint level,
1356 GLenum format, GLenum type,
1357 GLvoid *pixels );
1358
1359
1360 /* 1.1 functions */
1361
1362 GLAPI void GLAPIENTRY glGenTextures( GLsizei n, GLuint *textures );
1363
1364 GLAPI void GLAPIENTRY glDeleteTextures( GLsizei n, const GLuint *textures);
1365
1366 GLAPI void GLAPIENTRY glBindTexture( GLenum target, GLuint texture );
1367
1368 GLAPI void GLAPIENTRY glPrioritizeTextures( GLsizei n,
1369 const GLuint *textures,
1370 const GLclampf *priorities );
1371
1372 GLAPI GLboolean GLAPIENTRY glAreTexturesResident( GLsizei n,
1373 const GLuint *textures,
1374 GLboolean *residences );
1375
1376 GLAPI GLboolean GLAPIENTRY glIsTexture( GLuint texture );
1377
1378
1379 GLAPI void GLAPIENTRY glTexSubImage1D( GLenum target, GLint level,
1380 GLint xoffset,
1381 GLsizei width, GLenum format,
1382 GLenum type, const GLvoid *pixels );
1383
1384
1385 GLAPI void GLAPIENTRY glTexSubImage2D( GLenum target, GLint level,
1386 GLint xoffset, GLint yoffset,
1387 GLsizei width, GLsizei height,
1388 GLenum format, GLenum type,
1389 const GLvoid *pixels );
1390
1391
1392 GLAPI void GLAPIENTRY glCopyTexImage1D( GLenum target, GLint level,
1393 GLenum internalformat,
1394 GLint x, GLint y,
1395 GLsizei width, GLint border );
1396
1397
1398 GLAPI void GLAPIENTRY glCopyTexImage2D( GLenum target, GLint level,
1399 GLenum internalformat,
1400 GLint x, GLint y,
1401 GLsizei width, GLsizei height,
1402 GLint border );
1403
1404
1405 GLAPI void GLAPIENTRY glCopyTexSubImage1D( GLenum target, GLint level,
1406 GLint xoffset, GLint x, GLint y,
1407 GLsizei width );
1408
1409
1410 GLAPI void GLAPIENTRY glCopyTexSubImage2D( GLenum target, GLint level,
1411 GLint xoffset, GLint yoffset,
1412 GLint x, GLint y,
1413 GLsizei width, GLsizei height );
1414
1415
1416 /*
1417 * Evaluators
1418 */
1419
1420 GLAPI void GLAPIENTRY glMap1d( GLenum target, GLdouble u1, GLdouble u2,
1421 GLint stride,
1422 GLint order, const GLdouble *points );
1423 GLAPI void GLAPIENTRY glMap1f( GLenum target, GLfloat u1, GLfloat u2,
1424 GLint stride,
1425 GLint order, const GLfloat *points );
1426
1427 GLAPI void GLAPIENTRY glMap2d( GLenum target,
1428 GLdouble u1, GLdouble u2, GLint ustride, GLint uorder,
1429 GLdouble v1, GLdouble v2, GLint vstride, GLint vorder,
1430 const GLdouble *points );
1431 GLAPI void GLAPIENTRY glMap2f( GLenum target,
1432 GLfloat u1, GLfloat u2, GLint ustride, GLint uorder,
1433 GLfloat v1, GLfloat v2, GLint vstride, GLint vorder,
1434 const GLfloat *points );
1435
1436 GLAPI void GLAPIENTRY glGetMapdv( GLenum target, GLenum query, GLdouble *v );
1437 GLAPI void GLAPIENTRY glGetMapfv( GLenum target, GLenum query, GLfloat *v );
1438 GLAPI void GLAPIENTRY glGetMapiv( GLenum target, GLenum query, GLint *v );
1439
1440 GLAPI void GLAPIENTRY glEvalCoord1d( GLdouble u );
1441 GLAPI void GLAPIENTRY glEvalCoord1f( GLfloat u );
1442
1443 GLAPI void GLAPIENTRY glEvalCoord1dv( const GLdouble *u );
1444 GLAPI void GLAPIENTRY glEvalCoord1fv( const GLfloat *u );
1445
1446 GLAPI void GLAPIENTRY glEvalCoord2d( GLdouble u, GLdouble v );
1447 GLAPI void GLAPIENTRY glEvalCoord2f( GLfloat u, GLfloat v );
1448
1449 GLAPI void GLAPIENTRY glEvalCoord2dv( const GLdouble *u );
1450 GLAPI void GLAPIENTRY glEvalCoord2fv( const GLfloat *u );
1451
1452 GLAPI void GLAPIENTRY glMapGrid1d( GLint un, GLdouble u1, GLdouble u2 );
1453 GLAPI void GLAPIENTRY glMapGrid1f( GLint un, GLfloat u1, GLfloat u2 );
1454
1455 GLAPI void GLAPIENTRY glMapGrid2d( GLint un, GLdouble u1, GLdouble u2,
1456 GLint vn, GLdouble v1, GLdouble v2 );
1457 GLAPI void GLAPIENTRY glMapGrid2f( GLint un, GLfloat u1, GLfloat u2,
1458 GLint vn, GLfloat v1, GLfloat v2 );
1459
1460 GLAPI void GLAPIENTRY glEvalPoint1( GLint i );
1461
1462 GLAPI void GLAPIENTRY glEvalPoint2( GLint i, GLint j );
1463
1464 GLAPI void GLAPIENTRY glEvalMesh1( GLenum mode, GLint i1, GLint i2 );
1465
1466 GLAPI void GLAPIENTRY glEvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 );
1467
1468
1469 /*
1470 * Fog
1471 */
1472
1473 GLAPI void GLAPIENTRY glFogf( GLenum pname, GLfloat param );
1474
1475 GLAPI void GLAPIENTRY glFogi( GLenum pname, GLint param );
1476
1477 GLAPI void GLAPIENTRY glFogfv( GLenum pname, const GLfloat *params );
1478
1479 GLAPI void GLAPIENTRY glFogiv( GLenum pname, const GLint *params );
1480
1481
1482 /*
1483 * Selection and Feedback
1484 */
1485
1486 GLAPI void GLAPIENTRY glFeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer );
1487
1488 GLAPI void GLAPIENTRY glPassThrough( GLfloat token );
1489
1490 GLAPI void GLAPIENTRY glSelectBuffer( GLsizei size, GLuint *buffer );
1491
1492 GLAPI void GLAPIENTRY glInitNames( void );
1493
1494 GLAPI void GLAPIENTRY glLoadName( GLuint name );
1495
1496 GLAPI void GLAPIENTRY glPushName( GLuint name );
1497
1498 GLAPI void GLAPIENTRY glPopName( void );
1499
1500
1501
1502 /*
1503 * OpenGL 1.2
1504 */
1505
1506 #define GL_RESCALE_NORMAL 0x803A
1507 #define GL_CLAMP_TO_EDGE 0x812F
1508 #define GL_MAX_ELEMENTS_VERTICES 0x80E8
1509 #define GL_MAX_ELEMENTS_INDICES 0x80E9
1510 #define GL_BGR 0x80E0
1511 #define GL_BGRA 0x80E1
1512 #define GL_UNSIGNED_BYTE_3_3_2 0x8032
1513 #define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362
1514 #define GL_UNSIGNED_SHORT_5_6_5 0x8363
1515 #define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364
1516 #define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
1517 #define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365
1518 #define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
1519 #define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366
1520 #define GL_UNSIGNED_INT_8_8_8_8 0x8035
1521 #define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367
1522 #define GL_UNSIGNED_INT_10_10_10_2 0x8036
1523 #define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
1524 #define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8
1525 #define GL_SINGLE_COLOR 0x81F9
1526 #define GL_SEPARATE_SPECULAR_COLOR 0x81FA
1527 #define GL_TEXTURE_MIN_LOD 0x813A
1528 #define GL_TEXTURE_MAX_LOD 0x813B
1529 #define GL_TEXTURE_BASE_LEVEL 0x813C
1530 #define GL_TEXTURE_MAX_LEVEL 0x813D
1531 #define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12
1532 #define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13
1533 #define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22
1534 #define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23
1535 #define GL_ALIASED_POINT_SIZE_RANGE 0x846D
1536 #define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
1537 #define GL_PACK_SKIP_IMAGES 0x806B
1538 #define GL_PACK_IMAGE_HEIGHT 0x806C
1539 #define GL_UNPACK_SKIP_IMAGES 0x806D
1540 #define GL_UNPACK_IMAGE_HEIGHT 0x806E
1541 #define GL_TEXTURE_3D 0x806F
1542 #define GL_PROXY_TEXTURE_3D 0x8070
1543 #define GL_TEXTURE_DEPTH 0x8071
1544 #define GL_TEXTURE_WRAP_R 0x8072
1545 #define GL_MAX_3D_TEXTURE_SIZE 0x8073
1546 #define GL_TEXTURE_BINDING_3D 0x806A
1547
1548 GLAPI void GLAPIENTRY glDrawRangeElements( GLenum mode, GLuint start,
1549 GLuint end, GLsizei count, GLenum type, const GLvoid *indices );
1550
1551 GLAPI void GLAPIENTRY glTexImage3D( GLenum target, GLint level,
1552 GLint internalFormat,
1553 GLsizei width, GLsizei height,
1554 GLsizei depth, GLint border,
1555 GLenum format, GLenum type,
1556 const GLvoid *pixels );
1557
1558 GLAPI void GLAPIENTRY glTexSubImage3D( GLenum target, GLint level,
1559 GLint xoffset, GLint yoffset,
1560 GLint zoffset, GLsizei width,
1561 GLsizei height, GLsizei depth,
1562 GLenum format,
1563 GLenum type, const GLvoid *pixels);
1564
1565 GLAPI void GLAPIENTRY glCopyTexSubImage3D( GLenum target, GLint level,
1566 GLint xoffset, GLint yoffset,
1567 GLint zoffset, GLint x,
1568 GLint y, GLsizei width,
1569 GLsizei height );
1570
1571 typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
1572 typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
1573 typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
1574 typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
1575
1576
1577 /*
1578 * GL_ARB_imaging
1579 */
1580
1581 #define GL_CONSTANT_COLOR 0x8001
1582 #define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
1583 #define GL_CONSTANT_ALPHA 0x8003
1584 #define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
1585 #define GL_COLOR_TABLE 0x80D0
1586 #define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1
1587 #define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2
1588 #define GL_PROXY_COLOR_TABLE 0x80D3
1589 #define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4
1590 #define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5
1591 #define GL_COLOR_TABLE_SCALE 0x80D6
1592 #define GL_COLOR_TABLE_BIAS 0x80D7
1593 #define GL_COLOR_TABLE_FORMAT 0x80D8
1594 #define GL_COLOR_TABLE_WIDTH 0x80D9
1595 #define GL_COLOR_TABLE_RED_SIZE 0x80DA
1596 #define GL_COLOR_TABLE_GREEN_SIZE 0x80DB
1597 #define GL_COLOR_TABLE_BLUE_SIZE 0x80DC
1598 #define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD
1599 #define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE
1600 #define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF
1601 #define GL_CONVOLUTION_1D 0x8010
1602 #define GL_CONVOLUTION_2D 0x8011
1603 #define GL_SEPARABLE_2D 0x8012
1604 #define GL_CONVOLUTION_BORDER_MODE 0x8013
1605 #define GL_CONVOLUTION_FILTER_SCALE 0x8014
1606 #define GL_CONVOLUTION_FILTER_BIAS 0x8015
1607 #define GL_REDUCE 0x8016
1608 #define GL_CONVOLUTION_FORMAT 0x8017
1609 #define GL_CONVOLUTION_WIDTH 0x8018
1610 #define GL_CONVOLUTION_HEIGHT 0x8019
1611 #define GL_MAX_CONVOLUTION_WIDTH 0x801A
1612 #define GL_MAX_CONVOLUTION_HEIGHT 0x801B
1613 #define GL_POST_CONVOLUTION_RED_SCALE 0x801C
1614 #define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D
1615 #define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E
1616 #define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F
1617 #define GL_POST_CONVOLUTION_RED_BIAS 0x8020
1618 #define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021
1619 #define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022
1620 #define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023
1621 #define GL_CONSTANT_BORDER 0x8151
1622 #define GL_REPLICATE_BORDER 0x8153
1623 #define GL_CONVOLUTION_BORDER_COLOR 0x8154
1624 #define GL_COLOR_MATRIX 0x80B1
1625 #define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2
1626 #define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3
1627 #define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4
1628 #define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5
1629 #define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6
1630 #define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7
1631 #define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8
1632 #define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9
1633 #define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA
1634 #define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB
1635 #define GL_HISTOGRAM 0x8024
1636 #define GL_PROXY_HISTOGRAM 0x8025
1637 #define GL_HISTOGRAM_WIDTH 0x8026
1638 #define GL_HISTOGRAM_FORMAT 0x8027
1639 #define GL_HISTOGRAM_RED_SIZE 0x8028
1640 #define GL_HISTOGRAM_GREEN_SIZE 0x8029
1641 #define GL_HISTOGRAM_BLUE_SIZE 0x802A
1642 #define GL_HISTOGRAM_ALPHA_SIZE 0x802B
1643 #define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C
1644 #define GL_HISTOGRAM_SINK 0x802D
1645 #define GL_MINMAX 0x802E
1646 #define GL_MINMAX_FORMAT 0x802F
1647 #define GL_MINMAX_SINK 0x8030
1648 #define GL_TABLE_TOO_LARGE 0x8031
1649 #define GL_BLEND_EQUATION 0x8009
1650 #define GL_MIN 0x8007
1651 #define GL_MAX 0x8008
1652 #define GL_FUNC_ADD 0x8006
1653 #define GL_FUNC_SUBTRACT 0x800A
1654 #define GL_FUNC_REVERSE_SUBTRACT 0x800B
1655 #define GL_BLEND_COLOR 0x8005
1656
1657
1658 GLAPI void GLAPIENTRY glColorTable( GLenum target, GLenum internalformat,
1659 GLsizei width, GLenum format,
1660 GLenum type, const GLvoid *table );
1661
1662 GLAPI void GLAPIENTRY glColorSubTable( GLenum target,
1663 GLsizei start, GLsizei count,
1664 GLenum format, GLenum type,
1665 const GLvoid *data );
1666
1667 GLAPI void GLAPIENTRY glColorTableParameteriv(GLenum target, GLenum pname,
1668 const GLint *params);
1669
1670 GLAPI void GLAPIENTRY glColorTableParameterfv(GLenum target, GLenum pname,
1671 const GLfloat *params);
1672
1673 GLAPI void GLAPIENTRY glCopyColorSubTable( GLenum target, GLsizei start,
1674 GLint x, GLint y, GLsizei width );
1675
1676 GLAPI void GLAPIENTRY glCopyColorTable( GLenum target, GLenum internalformat,
1677 GLint x, GLint y, GLsizei width );
1678
1679 GLAPI void GLAPIENTRY glGetColorTable( GLenum target, GLenum format,
1680 GLenum type, GLvoid *table );
1681
1682 GLAPI void GLAPIENTRY glGetColorTableParameterfv( GLenum target, GLenum pname,
1683 GLfloat *params );
1684
1685 GLAPI void GLAPIENTRY glGetColorTableParameteriv( GLenum target, GLenum pname,
1686 GLint *params );
1687
1688 GLAPI void GLAPIENTRY glBlendEquation( GLenum mode );
1689
1690 GLAPI void GLAPIENTRY glBlendColor( GLclampf red, GLclampf green,
1691 GLclampf blue, GLclampf alpha );
1692
1693 GLAPI void GLAPIENTRY glHistogram( GLenum target, GLsizei width,
1694 GLenum internalformat, GLboolean sink );
1695
1696 GLAPI void GLAPIENTRY glResetHistogram( GLenum target );
1697
1698 GLAPI void GLAPIENTRY glGetHistogram( GLenum target, GLboolean reset,
1699 GLenum format, GLenum type,
1700 GLvoid *values );
1701
1702 GLAPI void GLAPIENTRY glGetHistogramParameterfv( GLenum target, GLenum pname,
1703 GLfloat *params );
1704
1705 GLAPI void GLAPIENTRY glGetHistogramParameteriv( GLenum target, GLenum pname,
1706 GLint *params );
1707
1708 GLAPI void GLAPIENTRY glMinmax( GLenum target, GLenum internalformat,
1709 GLboolean sink );
1710
1711 GLAPI void GLAPIENTRY glResetMinmax( GLenum target );
1712
1713 GLAPI void GLAPIENTRY glGetMinmax( GLenum target, GLboolean reset,
1714 GLenum format, GLenum types,
1715 GLvoid *values );
1716
1717 GLAPI void GLAPIENTRY glGetMinmaxParameterfv( GLenum target, GLenum pname,
1718 GLfloat *params );
1719
1720 GLAPI void GLAPIENTRY glGetMinmaxParameteriv( GLenum target, GLenum pname,
1721 GLint *params );
1722
1723 GLAPI void GLAPIENTRY glConvolutionFilter1D( GLenum target,
1724 GLenum internalformat, GLsizei width, GLenum format, GLenum type,
1725 const GLvoid *image );
1726
1727 GLAPI void GLAPIENTRY glConvolutionFilter2D( GLenum target,
1728 GLenum internalformat, GLsizei width, GLsizei height, GLenum format,
1729 GLenum type, const GLvoid *image );
1730
1731 GLAPI void GLAPIENTRY glConvolutionParameterf( GLenum target, GLenum pname,
1732 GLfloat params );
1733
1734 GLAPI void GLAPIENTRY glConvolutionParameterfv( GLenum target, GLenum pname,
1735 const GLfloat *params );
1736
1737 GLAPI void GLAPIENTRY glConvolutionParameteri( GLenum target, GLenum pname,
1738 GLint params );
1739
1740 GLAPI void GLAPIENTRY glConvolutionParameteriv( GLenum target, GLenum pname,
1741 const GLint *params );
1742
1743 GLAPI void GLAPIENTRY glCopyConvolutionFilter1D( GLenum target,
1744 GLenum internalformat, GLint x, GLint y, GLsizei width );
1745
1746 GLAPI void GLAPIENTRY glCopyConvolutionFilter2D( GLenum target,
1747 GLenum internalformat, GLint x, GLint y, GLsizei width,
1748 GLsizei height);
1749
1750 GLAPI void GLAPIENTRY glGetConvolutionFilter( GLenum target, GLenum format,
1751 GLenum type, GLvoid *image );
1752
1753 GLAPI void GLAPIENTRY glGetConvolutionParameterfv( GLenum target, GLenum pname,
1754 GLfloat *params );
1755
1756 GLAPI void GLAPIENTRY glGetConvolutionParameteriv( GLenum target, GLenum pname,
1757 GLint *params );
1758
1759 GLAPI void GLAPIENTRY glSeparableFilter2D( GLenum target,
1760 GLenum internalformat, GLsizei width, GLsizei height, GLenum format,
1761 GLenum type, const GLvoid *row, const GLvoid *column );
1762
1763 GLAPI void GLAPIENTRY glGetSeparableFilter( GLenum target, GLenum format,
1764 GLenum type, GLvoid *row, GLvoid *column, GLvoid *span );
1765
1766
1767
1768
1769 /*
1770 * OpenGL 1.3
1771 */
1772
1773 /* multitexture */
1774 #define GL_TEXTURE0 0x84C0
1775 #define GL_TEXTURE1 0x84C1
1776 #define GL_TEXTURE2 0x84C2
1777 #define GL_TEXTURE3 0x84C3
1778 #define GL_TEXTURE4 0x84C4
1779 #define GL_TEXTURE5 0x84C5
1780 #define GL_TEXTURE6 0x84C6
1781 #define GL_TEXTURE7 0x84C7
1782 #define GL_TEXTURE8 0x84C8
1783 #define GL_TEXTURE9 0x84C9
1784 #define GL_TEXTURE10 0x84CA
1785 #define GL_TEXTURE11 0x84CB
1786 #define GL_TEXTURE12 0x84CC
1787 #define GL_TEXTURE13 0x84CD
1788 #define GL_TEXTURE14 0x84CE
1789 #define GL_TEXTURE15 0x84CF
1790 #define GL_TEXTURE16 0x84D0
1791 #define GL_TEXTURE17 0x84D1
1792 #define GL_TEXTURE18 0x84D2
1793 #define GL_TEXTURE19 0x84D3
1794 #define GL_TEXTURE20 0x84D4
1795 #define GL_TEXTURE21 0x84D5
1796 #define GL_TEXTURE22 0x84D6
1797 #define GL_TEXTURE23 0x84D7
1798 #define GL_TEXTURE24 0x84D8
1799 #define GL_TEXTURE25 0x84D9
1800 #define GL_TEXTURE26 0x84DA
1801 #define GL_TEXTURE27 0x84DB
1802 #define GL_TEXTURE28 0x84DC
1803 #define GL_TEXTURE29 0x84DD
1804 #define GL_TEXTURE30 0x84DE
1805 #define GL_TEXTURE31 0x84DF
1806 #define GL_ACTIVE_TEXTURE 0x84E0
1807 #define GL_CLIENT_ACTIVE_TEXTURE 0x84E1
1808 #define GL_MAX_TEXTURE_UNITS 0x84E2
1809 /* texture_cube_map */
1810 #define GL_NORMAL_MAP 0x8511
1811 #define GL_REFLECTION_MAP 0x8512
1812 #define GL_TEXTURE_CUBE_MAP 0x8513
1813 #define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
1814 #define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
1815 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
1816 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
1817 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
1818 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
1819 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
1820 #define GL_PROXY_TEXTURE_CUBE_MAP 0x851B
1821 #define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
1822 /* texture_compression */
1823 #define GL_COMPRESSED_ALPHA 0x84E9
1824 #define GL_COMPRESSED_LUMINANCE 0x84EA
1825 #define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB
1826 #define GL_COMPRESSED_INTENSITY 0x84EC
1827 #define GL_COMPRESSED_RGB 0x84ED
1828 #define GL_COMPRESSED_RGBA 0x84EE
1829 #define GL_TEXTURE_COMPRESSION_HINT 0x84EF
1830 #define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0
1831 #define GL_TEXTURE_COMPRESSED 0x86A1
1832 #define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
1833 #define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
1834 /* multisample */
1835 #define GL_MULTISAMPLE 0x809D
1836 #define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
1837 #define GL_SAMPLE_ALPHA_TO_ONE 0x809F
1838 #define GL_SAMPLE_COVERAGE 0x80A0
1839 #define GL_SAMPLE_BUFFERS 0x80A8
1840 #define GL_SAMPLES 0x80A9
1841 #define GL_SAMPLE_COVERAGE_VALUE 0x80AA
1842 #define GL_SAMPLE_COVERAGE_INVERT 0x80AB
1843 #define GL_MULTISAMPLE_BIT 0x20000000
1844 /* transpose_matrix */
1845 #define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3
1846 #define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4
1847 #define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5
1848 #define GL_TRANSPOSE_COLOR_MATRIX 0x84E6
1849 /* texture_env_combine */
1850 #define GL_COMBINE 0x8570
1851 #define GL_COMBINE_RGB 0x8571
1852 #define GL_COMBINE_ALPHA 0x8572
1853 #define GL_SOURCE0_RGB 0x8580
1854 #define GL_SOURCE1_RGB 0x8581
1855 #define GL_SOURCE2_RGB 0x8582
1856 #define GL_SOURCE0_ALPHA 0x8588
1857 #define GL_SOURCE1_ALPHA 0x8589
1858 #define GL_SOURCE2_ALPHA 0x858A
1859 #define GL_OPERAND0_RGB 0x8590
1860 #define GL_OPERAND1_RGB 0x8591
1861 #define GL_OPERAND2_RGB 0x8592
1862 #define GL_OPERAND0_ALPHA 0x8598
1863 #define GL_OPERAND1_ALPHA 0x8599
1864 #define GL_OPERAND2_ALPHA 0x859A
1865 #define GL_RGB_SCALE 0x8573
1866 #define GL_ADD_SIGNED 0x8574
1867 #define GL_INTERPOLATE 0x8575
1868 #define GL_SUBTRACT 0x84E7
1869 #define GL_CONSTANT 0x8576
1870 #define GL_PRIMARY_COLOR 0x8577
1871 #define GL_PREVIOUS 0x8578
1872 /* texture_env_dot3 */
1873 #define GL_DOT3_RGB 0x86AE
1874 #define GL_DOT3_RGBA 0x86AF
1875 /* texture_border_clamp */
1876 #define GL_CLAMP_TO_BORDER 0x812D
1877
1878 GLAPI void GLAPIENTRY glActiveTexture( GLenum texture );
1879
1880 GLAPI void GLAPIENTRY glClientActiveTexture( GLenum texture );
1881
1882 GLAPI void GLAPIENTRY glCompressedTexImage1D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data );
1883
1884 GLAPI void GLAPIENTRY glCompressedTexImage2D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data );
1885
1886 GLAPI void GLAPIENTRY glCompressedTexImage3D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data );
1887
1888 GLAPI void GLAPIENTRY glCompressedTexSubImage1D( GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data );
1889
1890 GLAPI void GLAPIENTRY glCompressedTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data );
1891
1892 GLAPI void GLAPIENTRY glCompressedTexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data );
1893
1894 GLAPI void GLAPIENTRY glGetCompressedTexImage( GLenum target, GLint lod, GLvoid *img );
1895
1896 GLAPI void GLAPIENTRY glMultiTexCoord1d( GLenum target, GLdouble s );
1897
1898 GLAPI void GLAPIENTRY glMultiTexCoord1dv( GLenum target, const GLdouble *v );
1899
1900 GLAPI void GLAPIENTRY glMultiTexCoord1f( GLenum target, GLfloat s );
1901
1902 GLAPI void GLAPIENTRY glMultiTexCoord1fv( GLenum target, const GLfloat *v );
1903
1904 GLAPI void GLAPIENTRY glMultiTexCoord1i( GLenum target, GLint s );
1905
1906 GLAPI void GLAPIENTRY glMultiTexCoord1iv( GLenum target, const GLint *v );
1907
1908 GLAPI void GLAPIENTRY glMultiTexCoord1s( GLenum target, GLshort s );
1909
1910 GLAPI void GLAPIENTRY glMultiTexCoord1sv( GLenum target, const GLshort *v );
1911
1912 GLAPI void GLAPIENTRY glMultiTexCoord2d( GLenum target, GLdouble s, GLdouble t );
1913
1914 GLAPI void GLAPIENTRY glMultiTexCoord2dv( GLenum target, const GLdouble *v );
1915
1916 GLAPI void GLAPIENTRY glMultiTexCoord2f( GLenum target, GLfloat s, GLfloat t );
1917
1918 GLAPI void GLAPIENTRY glMultiTexCoord2fv( GLenum target, const GLfloat *v );
1919
1920 GLAPI void GLAPIENTRY glMultiTexCoord2i( GLenum target, GLint s, GLint t );
1921
1922 GLAPI void GLAPIENTRY glMultiTexCoord2iv( GLenum target, const GLint *v );
1923
1924 GLAPI void GLAPIENTRY glMultiTexCoord2s( GLenum target, GLshort s, GLshort t );
1925
1926 GLAPI void GLAPIENTRY glMultiTexCoord2sv( GLenum target, const GLshort *v );
1927
1928 GLAPI void GLAPIENTRY glMultiTexCoord3d( GLenum target, GLdouble s, GLdouble t, GLdouble r );
1929
1930 GLAPI void GLAPIENTRY glMultiTexCoord3dv( GLenum target, const GLdouble *v );
1931
1932 GLAPI void GLAPIENTRY glMultiTexCoord3f( GLenum target, GLfloat s, GLfloat t, GLfloat r );
1933
1934 GLAPI void GLAPIENTRY glMultiTexCoord3fv( GLenum target, const GLfloat *v );
1935
1936 GLAPI void GLAPIENTRY glMultiTexCoord3i( GLenum target, GLint s, GLint t, GLint r );
1937
1938 GLAPI void GLAPIENTRY glMultiTexCoord3iv( GLenum target, const GLint *v );
1939
1940 GLAPI void GLAPIENTRY glMultiTexCoord3s( GLenum target, GLshort s, GLshort t, GLshort r );
1941
1942 GLAPI void GLAPIENTRY glMultiTexCoord3sv( GLenum target, const GLshort *v );
1943
1944 GLAPI void GLAPIENTRY glMultiTexCoord4d( GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q );
1945
1946 GLAPI void GLAPIENTRY glMultiTexCoord4dv( GLenum target, const GLdouble *v );
1947
1948 GLAPI void GLAPIENTRY glMultiTexCoord4f( GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q );
1949
1950 GLAPI void GLAPIENTRY glMultiTexCoord4fv( GLenum target, const GLfloat *v );
1951
1952 GLAPI void GLAPIENTRY glMultiTexCoord4i( GLenum target, GLint s, GLint t, GLint r, GLint q );
1953
1954 GLAPI void GLAPIENTRY glMultiTexCoord4iv( GLenum target, const GLint *v );
1955
1956 GLAPI void GLAPIENTRY glMultiTexCoord4s( GLenum target, GLshort s, GLshort t, GLshort r, GLshort q );
1957
1958 GLAPI void GLAPIENTRY glMultiTexCoord4sv( GLenum target, const GLshort *v );
1959
1960
1961 GLAPI void GLAPIENTRY glLoadTransposeMatrixd( const GLdouble m[16] );
1962
1963 GLAPI void GLAPIENTRY glLoadTransposeMatrixf( const GLfloat m[16] );
1964
1965 GLAPI void GLAPIENTRY glMultTransposeMatrixd( const GLdouble m[16] );
1966
1967 GLAPI void GLAPIENTRY glMultTransposeMatrixf( const GLfloat m[16] );
1968
1969 GLAPI void GLAPIENTRY glSampleCoverage( GLclampf value, GLboolean invert );
1970
1971
1972 typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture);
1973 typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert);
1974 typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
1975 typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
1976 typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
1977 typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
1978 typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
1979 typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
1980 typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img);
1981
1982
1983
1984 /*
1985 * GL_ARB_multitexture (ARB extension 1 and OpenGL 1.2.1)
1986 */
1987 #ifndef GL_ARB_multitexture
1988 #define GL_ARB_multitexture 1
1989
1990 #define GL_TEXTURE0_ARB 0x84C0
1991 #define GL_TEXTURE1_ARB 0x84C1
1992 #define GL_TEXTURE2_ARB 0x84C2
1993 #define GL_TEXTURE3_ARB 0x84C3
1994 #define GL_TEXTURE4_ARB 0x84C4
1995 #define GL_TEXTURE5_ARB 0x84C5
1996 #define GL_TEXTURE6_ARB 0x84C6
1997 #define GL_TEXTURE7_ARB 0x84C7
1998 #define GL_TEXTURE8_ARB 0x84C8
1999 #define GL_TEXTURE9_ARB 0x84C9
2000 #define GL_TEXTURE10_ARB 0x84CA
2001 #define GL_TEXTURE11_ARB 0x84CB
2002 #define GL_TEXTURE12_ARB 0x84CC
2003 #define GL_TEXTURE13_ARB 0x84CD
2004 #define GL_TEXTURE14_ARB 0x84CE
2005 #define GL_TEXTURE15_ARB 0x84CF
2006 #define GL_TEXTURE16_ARB 0x84D0
2007 #define GL_TEXTURE17_ARB 0x84D1
2008 #define GL_TEXTURE18_ARB 0x84D2
2009 #define GL_TEXTURE19_ARB 0x84D3
2010 #define GL_TEXTURE20_ARB 0x84D4
2011 #define GL_TEXTURE21_ARB 0x84D5
2012 #define GL_TEXTURE22_ARB 0x84D6
2013 #define GL_TEXTURE23_ARB 0x84D7
2014 #define GL_TEXTURE24_ARB 0x84D8
2015 #define GL_TEXTURE25_ARB 0x84D9
2016 #define GL_TEXTURE26_ARB 0x84DA
2017 #define GL_TEXTURE27_ARB 0x84DB
2018 #define GL_TEXTURE28_ARB 0x84DC
2019 #define GL_TEXTURE29_ARB 0x84DD
2020 #define GL_TEXTURE30_ARB 0x84DE
2021 #define GL_TEXTURE31_ARB 0x84DF
2022 #define GL_ACTIVE_TEXTURE_ARB 0x84E0
2023 #define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1
2024 #define GL_MAX_TEXTURE_UNITS_ARB 0x84E2
2025
2026 GLAPI void GLAPIENTRY glActiveTextureARB(GLenum texture);
2027 GLAPI void GLAPIENTRY glClientActiveTextureARB(GLenum texture);
2028 GLAPI void GLAPIENTRY glMultiTexCoord1dARB(GLenum target, GLdouble s);
2029 GLAPI void GLAPIENTRY glMultiTexCoord1dvARB(GLenum target, const GLdouble *v);
2030 GLAPI void GLAPIENTRY glMultiTexCoord1fARB(GLenum target, GLfloat s);
2031 GLAPI void GLAPIENTRY glMultiTexCoord1fvARB(GLenum target, const GLfloat *v);
2032 GLAPI void GLAPIENTRY glMultiTexCoord1iARB(GLenum target, GLint s);
2033 GLAPI void GLAPIENTRY glMultiTexCoord1ivARB(GLenum target, const GLint *v);
2034 GLAPI void GLAPIENTRY glMultiTexCoord1sARB(GLenum target, GLshort s);
2035 GLAPI void GLAPIENTRY glMultiTexCoord1svARB(GLenum target, const GLshort *v);
2036 GLAPI void GLAPIENTRY glMultiTexCoord2dARB(GLenum target, GLdouble s, GLdouble t);
2037 GLAPI void GLAPIENTRY glMultiTexCoord2dvARB(GLenum target, const GLdouble *v);
2038 GLAPI void GLAPIENTRY glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t);
2039 GLAPI void GLAPIENTRY glMultiTexCoord2fvARB(GLenum target, const GLfloat *v);
2040 GLAPI void GLAPIENTRY glMultiTexCoord2iARB(GLenum target, GLint s, GLint t);
2041 GLAPI void GLAPIENTRY glMultiTexCoord2ivARB(GLenum target, const GLint *v);
2042 GLAPI void GLAPIENTRY glMultiTexCoord2sARB(GLenum target, GLshort s, GLshort t);
2043 GLAPI void GLAPIENTRY glMultiTexCoord2svARB(GLenum target, const GLshort *v);
2044 GLAPI void GLAPIENTRY glMultiTexCoord3dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r);
2045 GLAPI void GLAPIENTRY glMultiTexCoord3dvARB(GLenum target, const GLdouble *v);
2046 GLAPI void GLAPIENTRY glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r);
2047 GLAPI void GLAPIENTRY glMultiTexCoord3fvARB(GLenum target, const GLfloat *v);
2048 GLAPI void GLAPIENTRY glMultiTexCoord3iARB(GLenum target, GLint s, GLint t, GLint r);
2049 GLAPI void GLAPIENTRY glMultiTexCoord3ivARB(GLenum target, const GLint *v);
2050 GLAPI void GLAPIENTRY glMultiTexCoord3sARB(GLenum target, GLshort s, GLshort t, GLshort r);
2051 GLAPI void GLAPIENTRY glMultiTexCoord3svARB(GLenum target, const GLshort *v);
2052 GLAPI void GLAPIENTRY glMultiTexCoord4dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
2053 GLAPI void GLAPIENTRY glMultiTexCoord4dvARB(GLenum target, const GLdouble *v);
2054 GLAPI void GLAPIENTRY glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
2055 GLAPI void GLAPIENTRY glMultiTexCoord4fvARB(GLenum target, const GLfloat *v);
2056 GLAPI void GLAPIENTRY glMultiTexCoord4iARB(GLenum target, GLint s, GLint t, GLint r, GLint q);
2057 GLAPI void GLAPIENTRY glMultiTexCoord4ivARB(GLenum target, const GLint *v);
2058 GLAPI void GLAPIENTRY glMultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
2059 GLAPI void GLAPIENTRY glMultiTexCoord4svARB(GLenum target, const GLshort *v);
2060
2061 typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture);
2062 typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture);
2063 typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s);
2064 typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v);
2065 typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s);
2066 typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v);
2067 typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s);
2068 typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v);
2069 typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s);
2070 typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v);
2071 typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t);
2072 typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v);
2073 typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t);
2074 typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v);
2075 typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t);
2076 typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v);
2077 typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t);
2078 typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v);
2079 typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
2080 typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v);
2081 typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
2082 typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v);
2083 typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r);
2084 typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v);
2085 typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
2086 typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v);
2087 typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
2088 typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v);
2089 typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
2090 typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v);
2091 typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
2092 typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v);
2093 typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
2094 typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v);
2095
2096 #endif /* GL_ARB_multitexture */
2097
2098
2099
2100 /*
2101 * Define this token if you want "old-style" header file behaviour (extensions
2102 * defined in gl.h). Otherwise, extensions will be included from glext.h.
2103 */
2104 #if !defined(NO_SDL_GLEXT) && !defined(GL_GLEXT_LEGACY)
2105 #include "SDL_opengl_glext.h"
2106 #endif /* GL_GLEXT_LEGACY */
2107
2108
2109
2110 /*
2111 * ???. GL_MESA_packed_depth_stencil
2112 * XXX obsolete
2113 */
2114 #ifndef GL_MESA_packed_depth_stencil
2115 #define GL_MESA_packed_depth_stencil 1
2116
2117 #define GL_DEPTH_STENCIL_MESA 0x8750
2118 #define GL_UNSIGNED_INT_24_8_MESA 0x8751
2119 #define GL_UNSIGNED_INT_8_24_REV_MESA 0x8752
2120 #define GL_UNSIGNED_SHORT_15_1_MESA 0x8753
2121 #define GL_UNSIGNED_SHORT_1_15_REV_MESA 0x8754
2122
2123 #endif /* GL_MESA_packed_depth_stencil */
2124
2125
2126 #ifndef GL_ATI_blend_equation_separate
2127 #define GL_ATI_blend_equation_separate 1
2128
2129 #define GL_ALPHA_BLEND_EQUATION_ATI 0x883D
2130
2131 GLAPI void GLAPIENTRY glBlendEquationSeparateATI( GLenum modeRGB, GLenum modeA );
2132 typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEATIPROC) (GLenum modeRGB, GLenum modeA);
2133
2134 #endif /* GL_ATI_blend_equation_separate */
2135
2136
2137 /* GL_OES_EGL_image */
2138 #ifndef GL_OES_EGL_image
2139 typedef void* GLeglImageOES;
2140 #endif
2141
2142 #ifndef GL_OES_EGL_image
2143 #define GL_OES_EGL_image 1
2144 #ifdef GL_GLEXT_PROTOTYPES
2145 GLAPI void APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image);
2146 GLAPI void APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image);
2147 #endif
2148 typedef void (APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image);
2149 typedef void (APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image);
2150 #endif
2151
2152
2153 /**
2154 ** NOTE!!!!! If you add new functions to this file, or update
2155 ** glext.h be sure to regenerate the gl_mangle.h file. See comments
2156 ** in that file for details.
2157 **/
2158
2159
2160
2161 /**********************************************************************
2162 * Begin system-specific stuff
2163 */
2164 #if defined(PRAGMA_EXPORT_SUPPORTED)
2165 #pragma export off
2166 #endif
2167
2168 /*
2169 * End system-specific stuff
2170 **********************************************************************/
2171
2172
2173 #ifdef __cplusplus
2174 }
2175 #endif
2176
2177 #endif /* __gl_h_ */
2178
2179 #endif /* !__IPHONEOS__ */
2180
2181 #endif /* SDL_opengl_h_ */
2182
2183 /* vi: set ts=4 sw=4 expandtab: */
The diff for file include/SDL2/SDL_opengl_glext.h is too big (11180 changes) and cannot be shown.
File include/SDL2/SDL_opengles.h added (mode: 100644) (index 0000000..5c2a3e6)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_opengles.h
24 *
25 * This is a simple file to encapsulate the OpenGL ES 1.X API headers.
26 */
27 #include "SDL_config.h"
28
29 #ifdef __IPHONEOS__
30 #include <OpenGLES/ES1/gl.h>
31 #include <OpenGLES/ES1/glext.h>
32 #else
33 #include <GLES/gl.h>
34 #include <GLES/glext.h>
35 #endif
36
37 #ifndef APIENTRY
38 #define APIENTRY
39 #endif
File include/SDL2/SDL_opengles2.h added (mode: 100644) (index 0000000..00bc180)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_opengles2.h
24 *
25 * This is a simple file to encapsulate the OpenGL ES 2.0 API headers.
26 */
27 #include "SDL_config.h"
28
29 #ifndef _MSC_VER
30
31 #ifdef __IPHONEOS__
32 #include <OpenGLES/ES2/gl.h>
33 #include <OpenGLES/ES2/glext.h>
34 #else
35 #include <GLES2/gl2platform.h>
36 #include <GLES2/gl2.h>
37 #include <GLES2/gl2ext.h>
38 #endif
39
40 #else /* _MSC_VER */
41
42 /* OpenGL ES2 headers for Visual Studio */
43 #include "SDL_opengles2_khrplatform.h"
44 #include "SDL_opengles2_gl2platform.h"
45 #include "SDL_opengles2_gl2.h"
46 #include "SDL_opengles2_gl2ext.h"
47
48 #endif /* _MSC_VER */
49
50 #ifndef APIENTRY
51 #define APIENTRY GL_APIENTRY
52 #endif
File include/SDL2/SDL_opengles2_gl2.h added (mode: 100644) (index 0000000..c62fb0a)
1 #ifndef __gl2_h_
2 #define __gl2_h_
3
4 /* $Revision: 20555 $ on $Date:: 2013-02-12 14:32:47 -0800 #$ */
5
6 /*#include <GLES2/gl2platform.h>*/
7
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11
12 /*
13 * This document is licensed under the SGI Free Software B License Version
14 * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
15 */
16
17 /*-------------------------------------------------------------------------
18 * Data type definitions
19 *-----------------------------------------------------------------------*/
20
21 typedef void GLvoid;
22 typedef char GLchar;
23 typedef unsigned int GLenum;
24 typedef unsigned char GLboolean;
25 typedef unsigned int GLbitfield;
26 typedef khronos_int8_t GLbyte;
27 typedef short GLshort;
28 typedef int GLint;
29 typedef int GLsizei;
30 typedef khronos_uint8_t GLubyte;
31 typedef unsigned short GLushort;
32 typedef unsigned int GLuint;
33 typedef khronos_float_t GLfloat;
34 typedef khronos_float_t GLclampf;
35 typedef khronos_int32_t GLfixed;
36
37 /* GL types for handling large vertex buffer objects */
38 typedef khronos_intptr_t GLintptr;
39 typedef khronos_ssize_t GLsizeiptr;
40
41 /* OpenGL ES core versions */
42 #define GL_ES_VERSION_2_0 1
43
44 /* ClearBufferMask */
45 #define GL_DEPTH_BUFFER_BIT 0x00000100
46 #define GL_STENCIL_BUFFER_BIT 0x00000400
47 #define GL_COLOR_BUFFER_BIT 0x00004000
48
49 /* Boolean */
50 #define GL_FALSE 0
51 #define GL_TRUE 1
52
53 /* BeginMode */
54 #define GL_POINTS 0x0000
55 #define GL_LINES 0x0001
56 #define GL_LINE_LOOP 0x0002
57 #define GL_LINE_STRIP 0x0003
58 #define GL_TRIANGLES 0x0004
59 #define GL_TRIANGLE_STRIP 0x0005
60 #define GL_TRIANGLE_FAN 0x0006
61
62 /* AlphaFunction (not supported in ES20) */
63 /* GL_NEVER */
64 /* GL_LESS */
65 /* GL_EQUAL */
66 /* GL_LEQUAL */
67 /* GL_GREATER */
68 /* GL_NOTEQUAL */
69 /* GL_GEQUAL */
70 /* GL_ALWAYS */
71
72 /* BlendingFactorDest */
73 #define GL_ZERO 0
74 #define GL_ONE 1
75 #define GL_SRC_COLOR 0x0300
76 #define GL_ONE_MINUS_SRC_COLOR 0x0301
77 #define GL_SRC_ALPHA 0x0302
78 #define GL_ONE_MINUS_SRC_ALPHA 0x0303
79 #define GL_DST_ALPHA 0x0304
80 #define GL_ONE_MINUS_DST_ALPHA 0x0305
81
82 /* BlendingFactorSrc */
83 /* GL_ZERO */
84 /* GL_ONE */
85 #define GL_DST_COLOR 0x0306
86 #define GL_ONE_MINUS_DST_COLOR 0x0307
87 #define GL_SRC_ALPHA_SATURATE 0x0308
88 /* GL_SRC_ALPHA */
89 /* GL_ONE_MINUS_SRC_ALPHA */
90 /* GL_DST_ALPHA */
91 /* GL_ONE_MINUS_DST_ALPHA */
92
93 /* BlendEquationSeparate */
94 #define GL_FUNC_ADD 0x8006
95 #define GL_BLEND_EQUATION 0x8009
96 #define GL_BLEND_EQUATION_RGB 0x8009 /* same as BLEND_EQUATION */
97 #define GL_BLEND_EQUATION_ALPHA 0x883D
98
99 /* BlendSubtract */
100 #define GL_FUNC_SUBTRACT 0x800A
101 #define GL_FUNC_REVERSE_SUBTRACT 0x800B
102
103 /* Separate Blend Functions */
104 #define GL_BLEND_DST_RGB 0x80C8
105 #define GL_BLEND_SRC_RGB 0x80C9
106 #define GL_BLEND_DST_ALPHA 0x80CA
107 #define GL_BLEND_SRC_ALPHA 0x80CB
108 #define GL_CONSTANT_COLOR 0x8001
109 #define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
110 #define GL_CONSTANT_ALPHA 0x8003
111 #define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
112 #define GL_BLEND_COLOR 0x8005
113
114 /* Buffer Objects */
115 #define GL_ARRAY_BUFFER 0x8892
116 #define GL_ELEMENT_ARRAY_BUFFER 0x8893
117 #define GL_ARRAY_BUFFER_BINDING 0x8894
118 #define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
119
120 #define GL_STREAM_DRAW 0x88E0
121 #define GL_STATIC_DRAW 0x88E4
122 #define GL_DYNAMIC_DRAW 0x88E8
123
124 #define GL_BUFFER_SIZE 0x8764
125 #define GL_BUFFER_USAGE 0x8765
126
127 #define GL_CURRENT_VERTEX_ATTRIB 0x8626
128
129 /* CullFaceMode */
130 #define GL_FRONT 0x0404
131 #define GL_BACK 0x0405
132 #define GL_FRONT_AND_BACK 0x0408
133
134 /* DepthFunction */
135 /* GL_NEVER */
136 /* GL_LESS */
137 /* GL_EQUAL */
138 /* GL_LEQUAL */
139 /* GL_GREATER */
140 /* GL_NOTEQUAL */
141 /* GL_GEQUAL */
142 /* GL_ALWAYS */
143
144 /* EnableCap */
145 #define GL_TEXTURE_2D 0x0DE1
146 #define GL_CULL_FACE 0x0B44
147 #define GL_BLEND 0x0BE2
148 #define GL_DITHER 0x0BD0
149 #define GL_STENCIL_TEST 0x0B90
150 #define GL_DEPTH_TEST 0x0B71
151 #define GL_SCISSOR_TEST 0x0C11
152 #define GL_POLYGON_OFFSET_FILL 0x8037
153 #define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
154 #define GL_SAMPLE_COVERAGE 0x80A0
155
156 /* ErrorCode */
157 #define GL_NO_ERROR 0
158 #define GL_INVALID_ENUM 0x0500
159 #define GL_INVALID_VALUE 0x0501
160 #define GL_INVALID_OPERATION 0x0502
161 #define GL_OUT_OF_MEMORY 0x0505
162
163 /* FrontFaceDirection */
164 #define GL_CW 0x0900
165 #define GL_CCW 0x0901
166
167 /* GetPName */
168 #define GL_LINE_WIDTH 0x0B21
169 #define GL_ALIASED_POINT_SIZE_RANGE 0x846D
170 #define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
171 #define GL_CULL_FACE_MODE 0x0B45
172 #define GL_FRONT_FACE 0x0B46
173 #define GL_DEPTH_RANGE 0x0B70
174 #define GL_DEPTH_WRITEMASK 0x0B72
175 #define GL_DEPTH_CLEAR_VALUE 0x0B73
176 #define GL_DEPTH_FUNC 0x0B74
177 #define GL_STENCIL_CLEAR_VALUE 0x0B91
178 #define GL_STENCIL_FUNC 0x0B92
179 #define GL_STENCIL_FAIL 0x0B94
180 #define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
181 #define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
182 #define GL_STENCIL_REF 0x0B97
183 #define GL_STENCIL_VALUE_MASK 0x0B93
184 #define GL_STENCIL_WRITEMASK 0x0B98
185 #define GL_STENCIL_BACK_FUNC 0x8800
186 #define GL_STENCIL_BACK_FAIL 0x8801
187 #define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802
188 #define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803
189 #define GL_STENCIL_BACK_REF 0x8CA3
190 #define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
191 #define GL_STENCIL_BACK_WRITEMASK 0x8CA5
192 #define GL_VIEWPORT 0x0BA2
193 #define GL_SCISSOR_BOX 0x0C10
194 /* GL_SCISSOR_TEST */
195 #define GL_COLOR_CLEAR_VALUE 0x0C22
196 #define GL_COLOR_WRITEMASK 0x0C23
197 #define GL_UNPACK_ALIGNMENT 0x0CF5
198 #define GL_PACK_ALIGNMENT 0x0D05
199 #define GL_MAX_TEXTURE_SIZE 0x0D33
200 #define GL_MAX_VIEWPORT_DIMS 0x0D3A
201 #define GL_SUBPIXEL_BITS 0x0D50
202 #define GL_RED_BITS 0x0D52
203 #define GL_GREEN_BITS 0x0D53
204 #define GL_BLUE_BITS 0x0D54
205 #define GL_ALPHA_BITS 0x0D55
206 #define GL_DEPTH_BITS 0x0D56
207 #define GL_STENCIL_BITS 0x0D57
208 #define GL_POLYGON_OFFSET_UNITS 0x2A00
209 /* GL_POLYGON_OFFSET_FILL */
210 #define GL_POLYGON_OFFSET_FACTOR 0x8038
211 #define GL_TEXTURE_BINDING_2D 0x8069
212 #define GL_SAMPLE_BUFFERS 0x80A8
213 #define GL_SAMPLES 0x80A9
214 #define GL_SAMPLE_COVERAGE_VALUE 0x80AA
215 #define GL_SAMPLE_COVERAGE_INVERT 0x80AB
216
217 /* GetTextureParameter */
218 /* GL_TEXTURE_MAG_FILTER */
219 /* GL_TEXTURE_MIN_FILTER */
220 /* GL_TEXTURE_WRAP_S */
221 /* GL_TEXTURE_WRAP_T */
222
223 #define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
224 #define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
225
226 /* HintMode */
227 #define GL_DONT_CARE 0x1100
228 #define GL_FASTEST 0x1101
229 #define GL_NICEST 0x1102
230
231 /* HintTarget */
232 #define GL_GENERATE_MIPMAP_HINT 0x8192
233
234 /* DataType */
235 #define GL_BYTE 0x1400
236 #define GL_UNSIGNED_BYTE 0x1401
237 #define GL_SHORT 0x1402
238 #define GL_UNSIGNED_SHORT 0x1403
239 #define GL_INT 0x1404
240 #define GL_UNSIGNED_INT 0x1405
241 #define GL_FLOAT 0x1406
242 #define GL_FIXED 0x140C
243
244 /* PixelFormat */
245 #define GL_DEPTH_COMPONENT 0x1902
246 #define GL_ALPHA 0x1906
247 #define GL_RGB 0x1907
248 #define GL_RGBA 0x1908
249 #define GL_LUMINANCE 0x1909
250 #define GL_LUMINANCE_ALPHA 0x190A
251
252 /* PixelType */
253 /* GL_UNSIGNED_BYTE */
254 #define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
255 #define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
256 #define GL_UNSIGNED_SHORT_5_6_5 0x8363
257
258 /* Shaders */
259 #define GL_FRAGMENT_SHADER 0x8B30
260 #define GL_VERTEX_SHADER 0x8B31
261 #define GL_MAX_VERTEX_ATTRIBS 0x8869
262 #define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB
263 #define GL_MAX_VARYING_VECTORS 0x8DFC
264 #define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
265 #define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
266 #define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
267 #define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD
268 #define GL_SHADER_TYPE 0x8B4F
269 #define GL_DELETE_STATUS 0x8B80
270 #define GL_LINK_STATUS 0x8B82
271 #define GL_VALIDATE_STATUS 0x8B83
272 #define GL_ATTACHED_SHADERS 0x8B85
273 #define GL_ACTIVE_UNIFORMS 0x8B86
274 #define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
275 #define GL_ACTIVE_ATTRIBUTES 0x8B89
276 #define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
277 #define GL_SHADING_LANGUAGE_VERSION 0x8B8C
278 #define GL_CURRENT_PROGRAM 0x8B8D
279
280 /* StencilFunction */
281 #define GL_NEVER 0x0200
282 #define GL_LESS 0x0201
283 #define GL_EQUAL 0x0202
284 #define GL_LEQUAL 0x0203
285 #define GL_GREATER 0x0204
286 #define GL_NOTEQUAL 0x0205
287 #define GL_GEQUAL 0x0206
288 #define GL_ALWAYS 0x0207
289
290 /* StencilOp */
291 /* GL_ZERO */
292 #define GL_KEEP 0x1E00
293 #define GL_REPLACE 0x1E01
294 #define GL_INCR 0x1E02
295 #define GL_DECR 0x1E03
296 #define GL_INVERT 0x150A
297 #define GL_INCR_WRAP 0x8507
298 #define GL_DECR_WRAP 0x8508
299
300 /* StringName */
301 #define GL_VENDOR 0x1F00
302 #define GL_RENDERER 0x1F01
303 #define GL_VERSION 0x1F02
304 #define GL_EXTENSIONS 0x1F03
305
306 /* TextureMagFilter */
307 #define GL_NEAREST 0x2600
308 #define GL_LINEAR 0x2601
309
310 /* TextureMinFilter */
311 /* GL_NEAREST */
312 /* GL_LINEAR */
313 #define GL_NEAREST_MIPMAP_NEAREST 0x2700
314 #define GL_LINEAR_MIPMAP_NEAREST 0x2701
315 #define GL_NEAREST_MIPMAP_LINEAR 0x2702
316 #define GL_LINEAR_MIPMAP_LINEAR 0x2703
317
318 /* TextureParameterName */
319 #define GL_TEXTURE_MAG_FILTER 0x2800
320 #define GL_TEXTURE_MIN_FILTER 0x2801
321 #define GL_TEXTURE_WRAP_S 0x2802
322 #define GL_TEXTURE_WRAP_T 0x2803
323
324 /* TextureTarget */
325 /* GL_TEXTURE_2D */
326 #define GL_TEXTURE 0x1702
327
328 #define GL_TEXTURE_CUBE_MAP 0x8513
329 #define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
330 #define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
331 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
332 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
333 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
334 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
335 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
336 #define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
337
338 /* TextureUnit */
339 #define GL_TEXTURE0 0x84C0
340 #define GL_TEXTURE1 0x84C1
341 #define GL_TEXTURE2 0x84C2
342 #define GL_TEXTURE3 0x84C3
343 #define GL_TEXTURE4 0x84C4
344 #define GL_TEXTURE5 0x84C5
345 #define GL_TEXTURE6 0x84C6
346 #define GL_TEXTURE7 0x84C7
347 #define GL_TEXTURE8 0x84C8
348 #define GL_TEXTURE9 0x84C9
349 #define GL_TEXTURE10 0x84CA
350 #define GL_TEXTURE11 0x84CB
351 #define GL_TEXTURE12 0x84CC
352 #define GL_TEXTURE13 0x84CD
353 #define GL_TEXTURE14 0x84CE
354 #define GL_TEXTURE15 0x84CF
355 #define GL_TEXTURE16 0x84D0
356 #define GL_TEXTURE17 0x84D1
357 #define GL_TEXTURE18 0x84D2
358 #define GL_TEXTURE19 0x84D3
359 #define GL_TEXTURE20 0x84D4
360 #define GL_TEXTURE21 0x84D5
361 #define GL_TEXTURE22 0x84D6
362 #define GL_TEXTURE23 0x84D7
363 #define GL_TEXTURE24 0x84D8
364 #define GL_TEXTURE25 0x84D9
365 #define GL_TEXTURE26 0x84DA
366 #define GL_TEXTURE27 0x84DB
367 #define GL_TEXTURE28 0x84DC
368 #define GL_TEXTURE29 0x84DD
369 #define GL_TEXTURE30 0x84DE
370 #define GL_TEXTURE31 0x84DF
371 #define GL_ACTIVE_TEXTURE 0x84E0
372
373 /* TextureWrapMode */
374 #define GL_REPEAT 0x2901
375 #define GL_CLAMP_TO_EDGE 0x812F
376 #define GL_MIRRORED_REPEAT 0x8370
377
378 /* Uniform Types */
379 #define GL_FLOAT_VEC2 0x8B50
380 #define GL_FLOAT_VEC3 0x8B51
381 #define GL_FLOAT_VEC4 0x8B52
382 #define GL_INT_VEC2 0x8B53
383 #define GL_INT_VEC3 0x8B54
384 #define GL_INT_VEC4 0x8B55
385 #define GL_BOOL 0x8B56
386 #define GL_BOOL_VEC2 0x8B57
387 #define GL_BOOL_VEC3 0x8B58
388 #define GL_BOOL_VEC4 0x8B59
389 #define GL_FLOAT_MAT2 0x8B5A
390 #define GL_FLOAT_MAT3 0x8B5B
391 #define GL_FLOAT_MAT4 0x8B5C
392 #define GL_SAMPLER_2D 0x8B5E
393 #define GL_SAMPLER_CUBE 0x8B60
394
395 /* Vertex Arrays */
396 #define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
397 #define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
398 #define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
399 #define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
400 #define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
401 #define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
402 #define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
403
404 /* Read Format */
405 #define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A
406 #define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
407
408 /* Shader Source */
409 #define GL_COMPILE_STATUS 0x8B81
410 #define GL_INFO_LOG_LENGTH 0x8B84
411 #define GL_SHADER_SOURCE_LENGTH 0x8B88
412 #define GL_SHADER_COMPILER 0x8DFA
413
414 /* Shader Binary */
415 #define GL_SHADER_BINARY_FORMATS 0x8DF8
416 #define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9
417
418 /* Shader Precision-Specified Types */
419 #define GL_LOW_FLOAT 0x8DF0
420 #define GL_MEDIUM_FLOAT 0x8DF1
421 #define GL_HIGH_FLOAT 0x8DF2
422 #define GL_LOW_INT 0x8DF3
423 #define GL_MEDIUM_INT 0x8DF4
424 #define GL_HIGH_INT 0x8DF5
425
426 /* Framebuffer Object. */
427 #define GL_FRAMEBUFFER 0x8D40
428 #define GL_RENDERBUFFER 0x8D41
429
430 #define GL_RGBA4 0x8056
431 #define GL_RGB5_A1 0x8057
432 #define GL_RGB565 0x8D62
433 #define GL_DEPTH_COMPONENT16 0x81A5
434 #define GL_STENCIL_INDEX8 0x8D48
435
436 #define GL_RENDERBUFFER_WIDTH 0x8D42
437 #define GL_RENDERBUFFER_HEIGHT 0x8D43
438 #define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44
439 #define GL_RENDERBUFFER_RED_SIZE 0x8D50
440 #define GL_RENDERBUFFER_GREEN_SIZE 0x8D51
441 #define GL_RENDERBUFFER_BLUE_SIZE 0x8D52
442 #define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53
443 #define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54
444 #define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55
445
446 #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
447 #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
448 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
449 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
450
451 #define GL_COLOR_ATTACHMENT0 0x8CE0
452 #define GL_DEPTH_ATTACHMENT 0x8D00
453 #define GL_STENCIL_ATTACHMENT 0x8D20
454
455 #define GL_NONE 0
456
457 #define GL_FRAMEBUFFER_COMPLETE 0x8CD5
458 #define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
459 #define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
460 #define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9
461 #define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
462
463 #define GL_FRAMEBUFFER_BINDING 0x8CA6
464 #define GL_RENDERBUFFER_BINDING 0x8CA7
465 #define GL_MAX_RENDERBUFFER_SIZE 0x84E8
466
467 #define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
468
469 /*-------------------------------------------------------------------------
470 * GL core functions.
471 *-----------------------------------------------------------------------*/
472
473 GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture);
474 GL_APICALL void GL_APIENTRY glAttachShader (GLuint program, GLuint shader);
475 GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar* name);
476 GL_APICALL void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer);
477 GL_APICALL void GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer);
478 GL_APICALL void GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer);
479 GL_APICALL void GL_APIENTRY glBindTexture (GLenum target, GLuint texture);
480 GL_APICALL void GL_APIENTRY glBlendColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
481 GL_APICALL void GL_APIENTRY glBlendEquation ( GLenum mode );
482 GL_APICALL void GL_APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha);
483 GL_APICALL void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
484 GL_APICALL void GL_APIENTRY glBlendFuncSeparate (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
485 GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage);
486 GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data);
487 GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus (GLenum target);
488 GL_APICALL void GL_APIENTRY glClear (GLbitfield mask);
489 GL_APICALL void GL_APIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
490 GL_APICALL void GL_APIENTRY glClearDepthf (GLclampf depth);
491 GL_APICALL void GL_APIENTRY glClearStencil (GLint s);
492 GL_APICALL void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
493 GL_APICALL void GL_APIENTRY glCompileShader (GLuint shader);
494 GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data);
495 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);
496 GL_APICALL void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
497 GL_APICALL void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
498 GL_APICALL GLuint GL_APIENTRY glCreateProgram (void);
499 GL_APICALL GLuint GL_APIENTRY glCreateShader (GLenum type);
500 GL_APICALL void GL_APIENTRY glCullFace (GLenum mode);
501 GL_APICALL void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint* buffers);
502 GL_APICALL void GL_APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint* framebuffers);
503 GL_APICALL void GL_APIENTRY glDeleteProgram (GLuint program);
504 GL_APICALL void GL_APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint* renderbuffers);
505 GL_APICALL void GL_APIENTRY glDeleteShader (GLuint shader);
506 GL_APICALL void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint* textures);
507 GL_APICALL void GL_APIENTRY glDepthFunc (GLenum func);
508 GL_APICALL void GL_APIENTRY glDepthMask (GLboolean flag);
509 GL_APICALL void GL_APIENTRY glDepthRangef (GLclampf zNear, GLclampf zFar);
510 GL_APICALL void GL_APIENTRY glDetachShader (GLuint program, GLuint shader);
511 GL_APICALL void GL_APIENTRY glDisable (GLenum cap);
512 GL_APICALL void GL_APIENTRY glDisableVertexAttribArray (GLuint index);
513 GL_APICALL void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
514 GL_APICALL void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid* indices);
515 GL_APICALL void GL_APIENTRY glEnable (GLenum cap);
516 GL_APICALL void GL_APIENTRY glEnableVertexAttribArray (GLuint index);
517 GL_APICALL void GL_APIENTRY glFinish (void);
518 GL_APICALL void GL_APIENTRY glFlush (void);
519 GL_APICALL void GL_APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
520 GL_APICALL void GL_APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
521 GL_APICALL void GL_APIENTRY glFrontFace (GLenum mode);
522 GL_APICALL void GL_APIENTRY glGenBuffers (GLsizei n, GLuint* buffers);
523 GL_APICALL void GL_APIENTRY glGenerateMipmap (GLenum target);
524 GL_APICALL void GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint* framebuffers);
525 GL_APICALL void GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint* renderbuffers);
526 GL_APICALL void GL_APIENTRY glGenTextures (GLsizei n, GLuint* textures);
527 GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
528 GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
529 GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders);
530 GL_APICALL GLint GL_APIENTRY glGetAttribLocation (GLuint program, const GLchar* name);
531 GL_APICALL void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean* params);
532 GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint* params);
533 GL_APICALL GLenum GL_APIENTRY glGetError (void);
534 GL_APICALL void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat* params);
535 GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint* params);
536 GL_APICALL void GL_APIENTRY glGetIntegerv (GLenum pname, GLint* params);
537 GL_APICALL void GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint* params);
538 GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog);
539 GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint* params);
540 GL_APICALL void GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint* params);
541 GL_APICALL void GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog);
542 GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
543 GL_APICALL void GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source);
544 GL_APICALL const GLubyte* GL_APIENTRY glGetString (GLenum name);
545 GL_APICALL void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat* params);
546 GL_APICALL void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint* params);
547 GL_APICALL void GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat* params);
548 GL_APICALL void GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint* params);
549 GL_APICALL GLint GL_APIENTRY glGetUniformLocation (GLuint program, const GLchar* name);
550 GL_APICALL void GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat* params);
551 GL_APICALL void GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint* params);
552 GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, GLvoid** pointer);
553 GL_APICALL void GL_APIENTRY glHint (GLenum target, GLenum mode);
554 GL_APICALL GLboolean GL_APIENTRY glIsBuffer (GLuint buffer);
555 GL_APICALL GLboolean GL_APIENTRY glIsEnabled (GLenum cap);
556 GL_APICALL GLboolean GL_APIENTRY glIsFramebuffer (GLuint framebuffer);
557 GL_APICALL GLboolean GL_APIENTRY glIsProgram (GLuint program);
558 GL_APICALL GLboolean GL_APIENTRY glIsRenderbuffer (GLuint renderbuffer);
559 GL_APICALL GLboolean GL_APIENTRY glIsShader (GLuint shader);
560 GL_APICALL GLboolean GL_APIENTRY glIsTexture (GLuint texture);
561 GL_APICALL void GL_APIENTRY glLineWidth (GLfloat width);
562 GL_APICALL void GL_APIENTRY glLinkProgram (GLuint program);
563 GL_APICALL void GL_APIENTRY glPixelStorei (GLenum pname, GLint param);
564 GL_APICALL void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
565 GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels);
566 GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void);
567 GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
568 GL_APICALL void GL_APIENTRY glSampleCoverage (GLclampf value, GLboolean invert);
569 GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
570 GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length);
571 GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar* const* string, const GLint* length);
572 GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
573 GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);
574 GL_APICALL void GL_APIENTRY glStencilMask (GLuint mask);
575 GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask);
576 GL_APICALL void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
577 GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
578 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);
579 GL_APICALL void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
580 GL_APICALL void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat* params);
581 GL_APICALL void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);
582 GL_APICALL void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint* params);
583 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);
584 GL_APICALL void GL_APIENTRY glUniform1f (GLint location, GLfloat x);
585 GL_APICALL void GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat* v);
586 GL_APICALL void GL_APIENTRY glUniform1i (GLint location, GLint x);
587 GL_APICALL void GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint* v);
588 GL_APICALL void GL_APIENTRY glUniform2f (GLint location, GLfloat x, GLfloat y);
589 GL_APICALL void GL_APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat* v);
590 GL_APICALL void GL_APIENTRY glUniform2i (GLint location, GLint x, GLint y);
591 GL_APICALL void GL_APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint* v);
592 GL_APICALL void GL_APIENTRY glUniform3f (GLint location, GLfloat x, GLfloat y, GLfloat z);
593 GL_APICALL void GL_APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat* v);
594 GL_APICALL void GL_APIENTRY glUniform3i (GLint location, GLint x, GLint y, GLint z);
595 GL_APICALL void GL_APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint* v);
596 GL_APICALL void GL_APIENTRY glUniform4f (GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
597 GL_APICALL void GL_APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat* v);
598 GL_APICALL void GL_APIENTRY glUniform4i (GLint location, GLint x, GLint y, GLint z, GLint w);
599 GL_APICALL void GL_APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint* v);
600 GL_APICALL void GL_APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
601 GL_APICALL void GL_APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
602 GL_APICALL void GL_APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
603 GL_APICALL void GL_APIENTRY glUseProgram (GLuint program);
604 GL_APICALL void GL_APIENTRY glValidateProgram (GLuint program);
605 GL_APICALL void GL_APIENTRY glVertexAttrib1f (GLuint indx, GLfloat x);
606 GL_APICALL void GL_APIENTRY glVertexAttrib1fv (GLuint indx, const GLfloat* values);
607 GL_APICALL void GL_APIENTRY glVertexAttrib2f (GLuint indx, GLfloat x, GLfloat y);
608 GL_APICALL void GL_APIENTRY glVertexAttrib2fv (GLuint indx, const GLfloat* values);
609 GL_APICALL void GL_APIENTRY glVertexAttrib3f (GLuint indx, GLfloat x, GLfloat y, GLfloat z);
610 GL_APICALL void GL_APIENTRY glVertexAttrib3fv (GLuint indx, const GLfloat* values);
611 GL_APICALL void GL_APIENTRY glVertexAttrib4f (GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
612 GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint indx, const GLfloat* values);
613 GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr);
614 GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
615
616 #ifdef __cplusplus
617 }
618 #endif
619
620 #endif /* __gl2_h_ */
621
File include/SDL2/SDL_opengles2_gl2ext.h added (mode: 100644) (index 0000000..e8ca8b1)
1 #ifndef __gl2ext_h_
2 #define __gl2ext_h_
3
4 /* $Revision: 22801 $ on $Date:: 2013-08-21 03:20:48 -0700 #$ */
5
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
9
10 /*
11 * This document is licensed under the SGI Free Software B License Version
12 * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
13 */
14
15 #ifndef GL_APIENTRYP
16 # define GL_APIENTRYP GL_APIENTRY*
17 #endif
18
19 /* New types shared by several extensions */
20
21 #ifndef __gl3_h_
22 /* These are defined with respect to <inttypes.h> in the
23 * Apple extension spec, but they are also used by non-APPLE
24 * extensions, and in the Khronos header we use the Khronos
25 * portable types in khrplatform.h, which must be defined.
26 */
27 typedef khronos_int64_t GLint64;
28 typedef khronos_uint64_t GLuint64;
29 typedef struct __GLsync *GLsync;
30 #endif
31
32
33 /*------------------------------------------------------------------------*
34 * OES extension tokens
35 *------------------------------------------------------------------------*/
36
37 /* GL_OES_compressed_ETC1_RGB8_texture */
38 #ifndef GL_OES_compressed_ETC1_RGB8_texture
39 #define GL_ETC1_RGB8_OES 0x8D64
40 #endif
41
42 /* GL_OES_compressed_paletted_texture */
43 #ifndef GL_OES_compressed_paletted_texture
44 #define GL_PALETTE4_RGB8_OES 0x8B90
45 #define GL_PALETTE4_RGBA8_OES 0x8B91
46 #define GL_PALETTE4_R5_G6_B5_OES 0x8B92
47 #define GL_PALETTE4_RGBA4_OES 0x8B93
48 #define GL_PALETTE4_RGB5_A1_OES 0x8B94
49 #define GL_PALETTE8_RGB8_OES 0x8B95
50 #define GL_PALETTE8_RGBA8_OES 0x8B96
51 #define GL_PALETTE8_R5_G6_B5_OES 0x8B97
52 #define GL_PALETTE8_RGBA4_OES 0x8B98
53 #define GL_PALETTE8_RGB5_A1_OES 0x8B99
54 #endif
55
56 /* GL_OES_depth24 */
57 #ifndef GL_OES_depth24
58 #define GL_DEPTH_COMPONENT24_OES 0x81A6
59 #endif
60
61 /* GL_OES_depth32 */
62 #ifndef GL_OES_depth32
63 #define GL_DEPTH_COMPONENT32_OES 0x81A7
64 #endif
65
66 /* GL_OES_depth_texture */
67 /* No new tokens introduced by this extension. */
68
69 /* GL_OES_EGL_image */
70 #ifndef GL_OES_EGL_image
71 typedef void* GLeglImageOES;
72 #endif
73
74 /* GL_OES_EGL_image_external */
75 #ifndef GL_OES_EGL_image_external
76 /* GLeglImageOES defined in GL_OES_EGL_image already. */
77 #define GL_TEXTURE_EXTERNAL_OES 0x8D65
78 #define GL_SAMPLER_EXTERNAL_OES 0x8D66
79 #define GL_TEXTURE_BINDING_EXTERNAL_OES 0x8D67
80 #define GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES 0x8D68
81 #endif
82
83 /* GL_OES_element_index_uint */
84 #ifndef GL_OES_element_index_uint
85 #define GL_UNSIGNED_INT 0x1405
86 #endif
87
88 /* GL_OES_get_program_binary */
89 #ifndef GL_OES_get_program_binary
90 #define GL_PROGRAM_BINARY_LENGTH_OES 0x8741
91 #define GL_NUM_PROGRAM_BINARY_FORMATS_OES 0x87FE
92 #define GL_PROGRAM_BINARY_FORMATS_OES 0x87FF
93 #endif
94
95 /* GL_OES_mapbuffer */
96 #ifndef GL_OES_mapbuffer
97 #define GL_WRITE_ONLY_OES 0x88B9
98 #define GL_BUFFER_ACCESS_OES 0x88BB
99 #define GL_BUFFER_MAPPED_OES 0x88BC
100 #define GL_BUFFER_MAP_POINTER_OES 0x88BD
101 #endif
102
103 /* GL_OES_packed_depth_stencil */
104 #ifndef GL_OES_packed_depth_stencil
105 #define GL_DEPTH_STENCIL_OES 0x84F9
106 #define GL_UNSIGNED_INT_24_8_OES 0x84FA
107 #define GL_DEPTH24_STENCIL8_OES 0x88F0
108 #endif
109
110 /* GL_OES_required_internalformat */
111 #ifndef GL_OES_required_internalformat
112 #define GL_ALPHA8_OES 0x803C
113 #define GL_DEPTH_COMPONENT16_OES 0x81A5
114 /* reuse GL_DEPTH_COMPONENT24_OES */
115 /* reuse GL_DEPTH24_STENCIL8_OES */
116 /* reuse GL_DEPTH_COMPONENT32_OES */
117 #define GL_LUMINANCE4_ALPHA4_OES 0x8043
118 #define GL_LUMINANCE8_ALPHA8_OES 0x8045
119 #define GL_LUMINANCE8_OES 0x8040
120 #define GL_RGBA4_OES 0x8056
121 #define GL_RGB5_A1_OES 0x8057
122 #define GL_RGB565_OES 0x8D62
123 /* reuse GL_RGB8_OES */
124 /* reuse GL_RGBA8_OES */
125 /* reuse GL_RGB10_EXT */
126 /* reuse GL_RGB10_A2_EXT */
127 #endif
128
129 /* GL_OES_rgb8_rgba8 */
130 #ifndef GL_OES_rgb8_rgba8
131 #define GL_RGB8_OES 0x8051
132 #define GL_RGBA8_OES 0x8058
133 #endif
134
135 /* GL_OES_standard_derivatives */
136 #ifndef GL_OES_standard_derivatives
137 #define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES 0x8B8B
138 #endif
139
140 /* GL_OES_stencil1 */
141 #ifndef GL_OES_stencil1
142 #define GL_STENCIL_INDEX1_OES 0x8D46
143 #endif
144
145 /* GL_OES_stencil4 */
146 #ifndef GL_OES_stencil4
147 #define GL_STENCIL_INDEX4_OES 0x8D47
148 #endif
149
150 #ifndef GL_OES_surfaceless_context
151 #define GL_FRAMEBUFFER_UNDEFINED_OES 0x8219
152 #endif
153
154 /* GL_OES_texture_3D */
155 #ifndef GL_OES_texture_3D
156 #define GL_TEXTURE_WRAP_R_OES 0x8072
157 #define GL_TEXTURE_3D_OES 0x806F
158 #define GL_TEXTURE_BINDING_3D_OES 0x806A
159 #define GL_MAX_3D_TEXTURE_SIZE_OES 0x8073
160 #define GL_SAMPLER_3D_OES 0x8B5F
161 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES 0x8CD4
162 #endif
163
164 /* GL_OES_texture_float */
165 /* No new tokens introduced by this extension. */
166
167 /* GL_OES_texture_float_linear */
168 /* No new tokens introduced by this extension. */
169
170 /* GL_OES_texture_half_float */
171 #ifndef GL_OES_texture_half_float
172 #define GL_HALF_FLOAT_OES 0x8D61
173 #endif
174
175 /* GL_OES_texture_half_float_linear */
176 /* No new tokens introduced by this extension. */
177
178 /* GL_OES_texture_npot */
179 /* No new tokens introduced by this extension. */
180
181 /* GL_OES_vertex_array_object */
182 #ifndef GL_OES_vertex_array_object
183 #define GL_VERTEX_ARRAY_BINDING_OES 0x85B5
184 #endif
185
186 /* GL_OES_vertex_half_float */
187 /* GL_HALF_FLOAT_OES defined in GL_OES_texture_half_float already. */
188
189 /* GL_OES_vertex_type_10_10_10_2 */
190 #ifndef GL_OES_vertex_type_10_10_10_2
191 #define GL_UNSIGNED_INT_10_10_10_2_OES 0x8DF6
192 #define GL_INT_10_10_10_2_OES 0x8DF7
193 #endif
194
195 /*------------------------------------------------------------------------*
196 * KHR extension tokens
197 *------------------------------------------------------------------------*/
198
199 #ifndef GL_KHR_debug
200 typedef void (GL_APIENTRYP GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
201 #define GL_DEBUG_OUTPUT_SYNCHRONOUS_KHR 0x8242
202 #define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_KHR 0x8243
203 #define GL_DEBUG_CALLBACK_FUNCTION_KHR 0x8244
204 #define GL_DEBUG_CALLBACK_USER_PARAM_KHR 0x8245
205 #define GL_DEBUG_SOURCE_API_KHR 0x8246
206 #define GL_DEBUG_SOURCE_WINDOW_SYSTEM_KHR 0x8247
207 #define GL_DEBUG_SOURCE_SHADER_COMPILER_KHR 0x8248
208 #define GL_DEBUG_SOURCE_THIRD_PARTY_KHR 0x8249
209 #define GL_DEBUG_SOURCE_APPLICATION_KHR 0x824A
210 #define GL_DEBUG_SOURCE_OTHER_KHR 0x824B
211 #define GL_DEBUG_TYPE_ERROR_KHR 0x824C
212 #define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_KHR 0x824D
213 #define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_KHR 0x824E
214 #define GL_DEBUG_TYPE_PORTABILITY_KHR 0x824F
215 #define GL_DEBUG_TYPE_PERFORMANCE_KHR 0x8250
216 #define GL_DEBUG_TYPE_OTHER_KHR 0x8251
217 #define GL_DEBUG_TYPE_MARKER_KHR 0x8268
218 #define GL_DEBUG_TYPE_PUSH_GROUP_KHR 0x8269
219 #define GL_DEBUG_TYPE_POP_GROUP_KHR 0x826A
220 #define GL_DEBUG_SEVERITY_NOTIFICATION_KHR 0x826B
221 #define GL_MAX_DEBUG_GROUP_STACK_DEPTH_KHR 0x826C
222 #define GL_DEBUG_GROUP_STACK_DEPTH_KHR 0x826D
223 #define GL_BUFFER_KHR 0x82E0
224 #define GL_SHADER_KHR 0x82E1
225 #define GL_PROGRAM_KHR 0x82E2
226 #define GL_QUERY_KHR 0x82E3
227 /* PROGRAM_PIPELINE only in GL */
228 #define GL_SAMPLER_KHR 0x82E6
229 /* DISPLAY_LIST only in GL */
230 #define GL_MAX_LABEL_LENGTH_KHR 0x82E8
231 #define GL_MAX_DEBUG_MESSAGE_LENGTH_KHR 0x9143
232 #define GL_MAX_DEBUG_LOGGED_MESSAGES_KHR 0x9144
233 #define GL_DEBUG_LOGGED_MESSAGES_KHR 0x9145
234 #define GL_DEBUG_SEVERITY_HIGH_KHR 0x9146
235 #define GL_DEBUG_SEVERITY_MEDIUM_KHR 0x9147
236 #define GL_DEBUG_SEVERITY_LOW_KHR 0x9148
237 #define GL_DEBUG_OUTPUT_KHR 0x92E0
238 #define GL_CONTEXT_FLAG_DEBUG_BIT_KHR 0x00000002
239 #define GL_STACK_OVERFLOW_KHR 0x0503
240 #define GL_STACK_UNDERFLOW_KHR 0x0504
241 #endif
242
243 #ifndef GL_KHR_texture_compression_astc_ldr
244 #define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0
245 #define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1
246 #define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2
247 #define GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3
248 #define GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4
249 #define GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5
250 #define GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6
251 #define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7
252 #define GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8
253 #define GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9
254 #define GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA
255 #define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB
256 #define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC
257 #define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD
258 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0
259 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1
260 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2
261 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3
262 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4
263 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5
264 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6
265 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7
266 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8
267 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9
268 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA
269 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB
270 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC
271 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD
272 #endif
273
274 /*------------------------------------------------------------------------*
275 * AMD extension tokens
276 *------------------------------------------------------------------------*/
277
278 /* GL_AMD_compressed_3DC_texture */
279 #ifndef GL_AMD_compressed_3DC_texture
280 #define GL_3DC_X_AMD 0x87F9
281 #define GL_3DC_XY_AMD 0x87FA
282 #endif
283
284 /* GL_AMD_compressed_ATC_texture */
285 #ifndef GL_AMD_compressed_ATC_texture
286 #define GL_ATC_RGB_AMD 0x8C92
287 #define GL_ATC_RGBA_EXPLICIT_ALPHA_AMD 0x8C93
288 #define GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD 0x87EE
289 #endif
290
291 /* GL_AMD_performance_monitor */
292 #ifndef GL_AMD_performance_monitor
293 #define GL_COUNTER_TYPE_AMD 0x8BC0
294 #define GL_COUNTER_RANGE_AMD 0x8BC1
295 #define GL_UNSIGNED_INT64_AMD 0x8BC2
296 #define GL_PERCENTAGE_AMD 0x8BC3
297 #define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4
298 #define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5
299 #define GL_PERFMON_RESULT_AMD 0x8BC6
300 #endif
301
302 /* GL_AMD_program_binary_Z400 */
303 #ifndef GL_AMD_program_binary_Z400
304 #define GL_Z400_BINARY_AMD 0x8740
305 #endif
306
307 /*------------------------------------------------------------------------*
308 * ANGLE extension tokens
309 *------------------------------------------------------------------------*/
310
311 /* GL_ANGLE_depth_texture */
312 #ifndef GL_ANGLE_depth_texture
313 #define GL_DEPTH_COMPONENT 0x1902
314 #define GL_DEPTH_STENCIL_OES 0x84F9
315 #define GL_UNSIGNED_SHORT 0x1403
316 #define GL_UNSIGNED_INT 0x1405
317 #define GL_UNSIGNED_INT_24_8_OES 0x84FA
318 #define GL_DEPTH_COMPONENT16 0x81A5
319 #define GL_DEPTH_COMPONENT32_OES 0x81A7
320 #define GL_DEPTH24_STENCIL8_OES 0x88F0
321 #endif
322
323 /* GL_ANGLE_framebuffer_blit */
324 #ifndef GL_ANGLE_framebuffer_blit
325 #define GL_READ_FRAMEBUFFER_ANGLE 0x8CA8
326 #define GL_DRAW_FRAMEBUFFER_ANGLE 0x8CA9
327 #define GL_DRAW_FRAMEBUFFER_BINDING_ANGLE 0x8CA6
328 #define GL_READ_FRAMEBUFFER_BINDING_ANGLE 0x8CAA
329 #endif
330
331 /* GL_ANGLE_framebuffer_multisample */
332 #ifndef GL_ANGLE_framebuffer_multisample
333 #define GL_RENDERBUFFER_SAMPLES_ANGLE 0x8CAB
334 #define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE 0x8D56
335 #define GL_MAX_SAMPLES_ANGLE 0x8D57
336 #endif
337
338 /* GL_ANGLE_instanced_arrays */
339 #ifndef GL_ANGLE_instanced_arrays
340 #define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE 0x88FE
341 #endif
342
343 /* GL_ANGLE_pack_reverse_row_order */
344 #ifndef GL_ANGLE_pack_reverse_row_order
345 #define GL_PACK_REVERSE_ROW_ORDER_ANGLE 0x93A4
346 #endif
347
348 /* GL_ANGLE_program_binary */
349 #ifndef GL_ANGLE_program_binary
350 #define GL_PROGRAM_BINARY_ANGLE 0x93A6
351 #endif
352
353 /* GL_ANGLE_texture_compression_dxt3 */
354 #ifndef GL_ANGLE_texture_compression_dxt3
355 #define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2
356 #endif
357
358 /* GL_ANGLE_texture_compression_dxt5 */
359 #ifndef GL_ANGLE_texture_compression_dxt5
360 #define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3
361 #endif
362
363 /* GL_ANGLE_texture_usage */
364 #ifndef GL_ANGLE_texture_usage
365 #define GL_TEXTURE_USAGE_ANGLE 0x93A2
366 #define GL_FRAMEBUFFER_ATTACHMENT_ANGLE 0x93A3
367 #endif
368
369 /* GL_ANGLE_translated_shader_source */
370 #ifndef GL_ANGLE_translated_shader_source
371 #define GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE 0x93A0
372 #endif
373
374 /*------------------------------------------------------------------------*
375 * APPLE extension tokens
376 *------------------------------------------------------------------------*/
377
378 /* GL_APPLE_copy_texture_levels */
379 /* No new tokens introduced by this extension. */
380
381 /* GL_APPLE_framebuffer_multisample */
382 #ifndef GL_APPLE_framebuffer_multisample
383 #define GL_RENDERBUFFER_SAMPLES_APPLE 0x8CAB
384 #define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_APPLE 0x8D56
385 #define GL_MAX_SAMPLES_APPLE 0x8D57
386 #define GL_READ_FRAMEBUFFER_APPLE 0x8CA8
387 #define GL_DRAW_FRAMEBUFFER_APPLE 0x8CA9
388 #define GL_DRAW_FRAMEBUFFER_BINDING_APPLE 0x8CA6
389 #define GL_READ_FRAMEBUFFER_BINDING_APPLE 0x8CAA
390 #endif
391
392 /* GL_APPLE_rgb_422 */
393 #ifndef GL_APPLE_rgb_422
394 #define GL_RGB_422_APPLE 0x8A1F
395 #define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA
396 #define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB
397 #endif
398
399 /* GL_APPLE_sync */
400 #ifndef GL_APPLE_sync
401
402 #define GL_SYNC_OBJECT_APPLE 0x8A53
403 #define GL_MAX_SERVER_WAIT_TIMEOUT_APPLE 0x9111
404 #define GL_OBJECT_TYPE_APPLE 0x9112
405 #define GL_SYNC_CONDITION_APPLE 0x9113
406 #define GL_SYNC_STATUS_APPLE 0x9114
407 #define GL_SYNC_FLAGS_APPLE 0x9115
408 #define GL_SYNC_FENCE_APPLE 0x9116
409 #define GL_SYNC_GPU_COMMANDS_COMPLETE_APPLE 0x9117
410 #define GL_UNSIGNALED_APPLE 0x9118
411 #define GL_SIGNALED_APPLE 0x9119
412 #define GL_ALREADY_SIGNALED_APPLE 0x911A
413 #define GL_TIMEOUT_EXPIRED_APPLE 0x911B
414 #define GL_CONDITION_SATISFIED_APPLE 0x911C
415 #define GL_WAIT_FAILED_APPLE 0x911D
416 #define GL_SYNC_FLUSH_COMMANDS_BIT_APPLE 0x00000001
417 #define GL_TIMEOUT_IGNORED_APPLE 0xFFFFFFFFFFFFFFFFull
418 #endif
419
420 /* GL_APPLE_texture_format_BGRA8888 */
421 #ifndef GL_APPLE_texture_format_BGRA8888
422 #define GL_BGRA_EXT 0x80E1
423 #endif
424
425 /* GL_APPLE_texture_max_level */
426 #ifndef GL_APPLE_texture_max_level
427 #define GL_TEXTURE_MAX_LEVEL_APPLE 0x813D
428 #endif
429
430 /*------------------------------------------------------------------------*
431 * ARM extension tokens
432 *------------------------------------------------------------------------*/
433
434 /* GL_ARM_mali_program_binary */
435 #ifndef GL_ARM_mali_program_binary
436 #define GL_MALI_PROGRAM_BINARY_ARM 0x8F61
437 #endif
438
439 /* GL_ARM_mali_shader_binary */
440 #ifndef GL_ARM_mali_shader_binary
441 #define GL_MALI_SHADER_BINARY_ARM 0x8F60
442 #endif
443
444 /* GL_ARM_rgba8 */
445 /* No new tokens introduced by this extension. */
446
447 /*------------------------------------------------------------------------*
448 * EXT extension tokens
449 *------------------------------------------------------------------------*/
450
451 /* GL_EXT_blend_minmax */
452 #ifndef GL_EXT_blend_minmax
453 #define GL_MIN_EXT 0x8007
454 #define GL_MAX_EXT 0x8008
455 #endif
456
457 /* GL_EXT_color_buffer_half_float */
458 #ifndef GL_EXT_color_buffer_half_float
459 #define GL_RGBA16F_EXT 0x881A
460 #define GL_RGB16F_EXT 0x881B
461 #define GL_RG16F_EXT 0x822F
462 #define GL_R16F_EXT 0x822D
463 #define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT 0x8211
464 #define GL_UNSIGNED_NORMALIZED_EXT 0x8C17
465 #endif
466
467 /* GL_EXT_debug_label */
468 #ifndef GL_EXT_debug_label
469 #define GL_PROGRAM_PIPELINE_OBJECT_EXT 0x8A4F
470 #define GL_PROGRAM_OBJECT_EXT 0x8B40
471 #define GL_SHADER_OBJECT_EXT 0x8B48
472 #define GL_BUFFER_OBJECT_EXT 0x9151
473 #define GL_QUERY_OBJECT_EXT 0x9153
474 #define GL_VERTEX_ARRAY_OBJECT_EXT 0x9154
475 #endif
476
477 /* GL_EXT_debug_marker */
478 /* No new tokens introduced by this extension. */
479
480 /* GL_EXT_discard_framebuffer */
481 #ifndef GL_EXT_discard_framebuffer
482 #define GL_COLOR_EXT 0x1800
483 #define GL_DEPTH_EXT 0x1801
484 #define GL_STENCIL_EXT 0x1802
485 #endif
486
487 #ifndef GL_EXT_disjoint_timer_query
488 #define GL_QUERY_COUNTER_BITS_EXT 0x8864
489 #define GL_CURRENT_QUERY_EXT 0x8865
490 #define GL_QUERY_RESULT_EXT 0x8866
491 #define GL_QUERY_RESULT_AVAILABLE_EXT 0x8867
492 #define GL_TIME_ELAPSED_EXT 0x88BF
493 #define GL_TIMESTAMP_EXT 0x8E28
494 #define GL_GPU_DISJOINT_EXT 0x8FBB
495 #endif
496
497 #ifndef GL_EXT_draw_buffers
498 #define GL_EXT_draw_buffers 1
499 #define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF
500 #define GL_MAX_DRAW_BUFFERS_EXT 0x8824
501 #define GL_DRAW_BUFFER0_EXT 0x8825
502 #define GL_DRAW_BUFFER1_EXT 0x8826
503 #define GL_DRAW_BUFFER2_EXT 0x8827
504 #define GL_DRAW_BUFFER3_EXT 0x8828
505 #define GL_DRAW_BUFFER4_EXT 0x8829
506 #define GL_DRAW_BUFFER5_EXT 0x882A
507 #define GL_DRAW_BUFFER6_EXT 0x882B
508 #define GL_DRAW_BUFFER7_EXT 0x882C
509 #define GL_DRAW_BUFFER8_EXT 0x882D
510 #define GL_DRAW_BUFFER9_EXT 0x882E
511 #define GL_DRAW_BUFFER10_EXT 0x882F
512 #define GL_DRAW_BUFFER11_EXT 0x8830
513 #define GL_DRAW_BUFFER12_EXT 0x8831
514 #define GL_DRAW_BUFFER13_EXT 0x8832
515 #define GL_DRAW_BUFFER14_EXT 0x8833
516 #define GL_DRAW_BUFFER15_EXT 0x8834
517 #define GL_COLOR_ATTACHMENT0_EXT 0x8CE0
518 #define GL_COLOR_ATTACHMENT1_EXT 0x8CE1
519 #define GL_COLOR_ATTACHMENT2_EXT 0x8CE2
520 #define GL_COLOR_ATTACHMENT3_EXT 0x8CE3
521 #define GL_COLOR_ATTACHMENT4_EXT 0x8CE4
522 #define GL_COLOR_ATTACHMENT5_EXT 0x8CE5
523 #define GL_COLOR_ATTACHMENT6_EXT 0x8CE6
524 #define GL_COLOR_ATTACHMENT7_EXT 0x8CE7
525 #define GL_COLOR_ATTACHMENT8_EXT 0x8CE8
526 #define GL_COLOR_ATTACHMENT9_EXT 0x8CE9
527 #define GL_COLOR_ATTACHMENT10_EXT 0x8CEA
528 #define GL_COLOR_ATTACHMENT11_EXT 0x8CEB
529 #define GL_COLOR_ATTACHMENT12_EXT 0x8CEC
530 #define GL_COLOR_ATTACHMENT13_EXT 0x8CED
531 #define GL_COLOR_ATTACHMENT14_EXT 0x8CEE
532 #define GL_COLOR_ATTACHMENT15_EXT 0x8CEF
533 #endif
534
535 /* GL_EXT_map_buffer_range */
536 #ifndef GL_EXT_map_buffer_range
537 #define GL_MAP_READ_BIT_EXT 0x0001
538 #define GL_MAP_WRITE_BIT_EXT 0x0002
539 #define GL_MAP_INVALIDATE_RANGE_BIT_EXT 0x0004
540 #define GL_MAP_INVALIDATE_BUFFER_BIT_EXT 0x0008
541 #define GL_MAP_FLUSH_EXPLICIT_BIT_EXT 0x0010
542 #define GL_MAP_UNSYNCHRONIZED_BIT_EXT 0x0020
543 #endif
544
545 /* GL_EXT_multisampled_render_to_texture */
546 #ifndef GL_EXT_multisampled_render_to_texture
547 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT 0x8D6C
548 /* reuse values from GL_EXT_framebuffer_multisample (desktop extension) */
549 #define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB
550 #define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56
551 #define GL_MAX_SAMPLES_EXT 0x8D57
552 #endif
553
554 /* GL_EXT_multiview_draw_buffers */
555 #ifndef GL_EXT_multiview_draw_buffers
556 #define GL_COLOR_ATTACHMENT_EXT 0x90F0
557 #define GL_MULTIVIEW_EXT 0x90F1
558 #define GL_DRAW_BUFFER_EXT 0x0C01
559 #define GL_READ_BUFFER_EXT 0x0C02
560 #define GL_MAX_MULTIVIEW_BUFFERS_EXT 0x90F2
561 #endif
562
563 /* GL_EXT_multi_draw_arrays */
564 /* No new tokens introduced by this extension. */
565
566 /* GL_EXT_occlusion_query_boolean */
567 #ifndef GL_EXT_occlusion_query_boolean
568 #define GL_ANY_SAMPLES_PASSED_EXT 0x8C2F
569 #define GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT 0x8D6A
570 #define GL_CURRENT_QUERY_EXT 0x8865
571 #define GL_QUERY_RESULT_EXT 0x8866
572 #define GL_QUERY_RESULT_AVAILABLE_EXT 0x8867
573 #endif
574
575 /* GL_EXT_read_format_bgra */
576 #ifndef GL_EXT_read_format_bgra
577 #define GL_BGRA_EXT 0x80E1
578 #define GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT 0x8365
579 #define GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT 0x8366
580 #endif
581
582 /* GL_EXT_robustness */
583 #ifndef GL_EXT_robustness
584 /* reuse GL_NO_ERROR */
585 #define GL_GUILTY_CONTEXT_RESET_EXT 0x8253
586 #define GL_INNOCENT_CONTEXT_RESET_EXT 0x8254
587 #define GL_UNKNOWN_CONTEXT_RESET_EXT 0x8255
588 #define GL_CONTEXT_ROBUST_ACCESS_EXT 0x90F3
589 #define GL_RESET_NOTIFICATION_STRATEGY_EXT 0x8256
590 #define GL_LOSE_CONTEXT_ON_RESET_EXT 0x8252
591 #define GL_NO_RESET_NOTIFICATION_EXT 0x8261
592 #endif
593
594 /* GL_EXT_separate_shader_objects */
595 #ifndef GL_EXT_separate_shader_objects
596 #define GL_VERTEX_SHADER_BIT_EXT 0x00000001
597 #define GL_FRAGMENT_SHADER_BIT_EXT 0x00000002
598 #define GL_ALL_SHADER_BITS_EXT 0xFFFFFFFF
599 #define GL_PROGRAM_SEPARABLE_EXT 0x8258
600 #define GL_ACTIVE_PROGRAM_EXT 0x8259
601 #define GL_PROGRAM_PIPELINE_BINDING_EXT 0x825A
602 #endif
603
604 /* GL_EXT_shader_framebuffer_fetch */
605 #ifndef GL_EXT_shader_framebuffer_fetch
606 #define GL_FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT 0x8A52
607 #endif
608
609 /* GL_EXT_shader_texture_lod */
610 /* No new tokens introduced by this extension. */
611
612 /* GL_EXT_shadow_samplers */
613 #ifndef GL_EXT_shadow_samplers
614 #define GL_TEXTURE_COMPARE_MODE_EXT 0x884C
615 #define GL_TEXTURE_COMPARE_FUNC_EXT 0x884D
616 #define GL_COMPARE_REF_TO_TEXTURE_EXT 0x884E
617 #define GL_SAMPLER_2D_SHADOW_EXT 0x8B62
618 #endif
619
620 /* GL_EXT_sRGB */
621 #ifndef GL_EXT_sRGB
622 #define GL_SRGB_EXT 0x8C40
623 #define GL_SRGB_ALPHA_EXT 0x8C42
624 #define GL_SRGB8_ALPHA8_EXT 0x8C43
625 #define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT 0x8210
626 #endif
627
628 /* GL_EXT_sRGB_write_control */
629 #ifndef GL_EXT_sRGB_write_control
630 #define GL_EXT_sRGB_write_control 1
631 #define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9
632 #endif
633
634 /* GL_EXT_texture_compression_dxt1 */
635 #ifndef GL_EXT_texture_compression_dxt1
636 #define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
637 #define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
638 #endif
639
640 /* GL_EXT_texture_filter_anisotropic */
641 #ifndef GL_EXT_texture_filter_anisotropic
642 #define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
643 #define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
644 #endif
645
646 /* GL_EXT_texture_format_BGRA8888 */
647 #ifndef GL_EXT_texture_format_BGRA8888
648 #define GL_BGRA_EXT 0x80E1
649 #endif
650
651 /* GL_EXT_texture_rg */
652 #ifndef GL_EXT_texture_rg
653 #define GL_RED_EXT 0x1903
654 #define GL_RG_EXT 0x8227
655 #define GL_R8_EXT 0x8229
656 #define GL_RG8_EXT 0x822B
657 #endif
658
659 /* GL_EXT_texture_sRGB_decode */
660 #ifndef GL_EXT_texture_sRGB_decode
661 #define GL_EXT_texture_sRGB_decode 1
662 #define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48
663 #define GL_DECODE_EXT 0x8A49
664 #define GL_SKIP_DECODE_EXT 0x8A4A
665 #endif
666
667 /* GL_EXT_texture_storage */
668 #ifndef GL_EXT_texture_storage
669 #define GL_TEXTURE_IMMUTABLE_FORMAT_EXT 0x912F
670 #define GL_ALPHA8_EXT 0x803C
671 #define GL_LUMINANCE8_EXT 0x8040
672 #define GL_LUMINANCE8_ALPHA8_EXT 0x8045
673 #define GL_RGBA32F_EXT 0x8814
674 #define GL_RGB32F_EXT 0x8815
675 #define GL_ALPHA32F_EXT 0x8816
676 #define GL_LUMINANCE32F_EXT 0x8818
677 #define GL_LUMINANCE_ALPHA32F_EXT 0x8819
678 /* reuse GL_RGBA16F_EXT */
679 /* reuse GL_RGB16F_EXT */
680 #define GL_ALPHA16F_EXT 0x881C
681 #define GL_LUMINANCE16F_EXT 0x881E
682 #define GL_LUMINANCE_ALPHA16F_EXT 0x881F
683 #define GL_RGB10_A2_EXT 0x8059
684 #define GL_RGB10_EXT 0x8052
685 #define GL_BGRA8_EXT 0x93A1
686 #define GL_R8_EXT 0x8229
687 #define GL_RG8_EXT 0x822B
688 #define GL_R32F_EXT 0x822E
689 #define GL_RG32F_EXT 0x8230
690 #define GL_R16F_EXT 0x822D
691 #define GL_RG16F_EXT 0x822F
692 #endif
693
694 /* GL_EXT_texture_type_2_10_10_10_REV */
695 #ifndef GL_EXT_texture_type_2_10_10_10_REV
696 #define GL_UNSIGNED_INT_2_10_10_10_REV_EXT 0x8368
697 #endif
698
699 /* GL_EXT_unpack_subimage */
700 #ifndef GL_EXT_unpack_subimage
701 #define GL_UNPACK_ROW_LENGTH_EXT 0x0CF2
702 #define GL_UNPACK_SKIP_ROWS_EXT 0x0CF3
703 #define GL_UNPACK_SKIP_PIXELS_EXT 0x0CF4
704 #endif
705
706 /*------------------------------------------------------------------------*
707 * DMP extension tokens
708 *------------------------------------------------------------------------*/
709
710 /* GL_DMP_shader_binary */
711 #ifndef GL_DMP_shader_binary
712 #define GL_SHADER_BINARY_DMP 0x9250
713 #endif
714
715 /*------------------------------------------------------------------------*
716 * FJ extension tokens
717 *------------------------------------------------------------------------*/
718
719 /* GL_FJ_shader_binary_GCCSO */
720 #ifndef GL_FJ_shader_binary_GCCSO
721 #define GL_GCCSO_SHADER_BINARY_FJ 0x9260
722 #endif
723
724 /*------------------------------------------------------------------------*
725 * IMG extension tokens
726 *------------------------------------------------------------------------*/
727
728 /* GL_IMG_program_binary */
729 #ifndef GL_IMG_program_binary
730 #define GL_SGX_PROGRAM_BINARY_IMG 0x9130
731 #endif
732
733 /* GL_IMG_read_format */
734 #ifndef GL_IMG_read_format
735 #define GL_BGRA_IMG 0x80E1
736 #define GL_UNSIGNED_SHORT_4_4_4_4_REV_IMG 0x8365
737 #endif
738
739 /* GL_IMG_shader_binary */
740 #ifndef GL_IMG_shader_binary
741 #define GL_SGX_BINARY_IMG 0x8C0A
742 #endif
743
744 /* GL_IMG_texture_compression_pvrtc */
745 #ifndef GL_IMG_texture_compression_pvrtc
746 #define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00
747 #define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG 0x8C01
748 #define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02
749 #define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03
750 #endif
751
752 /* GL_IMG_texture_compression_pvrtc2 */
753 #ifndef GL_IMG_texture_compression_pvrtc2
754 #define GL_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG 0x9137
755 #define GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG 0x9138
756 #endif
757
758 /* GL_IMG_multisampled_render_to_texture */
759 #ifndef GL_IMG_multisampled_render_to_texture
760 #define GL_RENDERBUFFER_SAMPLES_IMG 0x9133
761 #define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_IMG 0x9134
762 #define GL_MAX_SAMPLES_IMG 0x9135
763 #define GL_TEXTURE_SAMPLES_IMG 0x9136
764 #endif
765
766 /*------------------------------------------------------------------------*
767 * NV extension tokens
768 *------------------------------------------------------------------------*/
769
770 /* GL_NV_coverage_sample */
771 #ifndef GL_NV_coverage_sample
772 #define GL_COVERAGE_COMPONENT_NV 0x8ED0
773 #define GL_COVERAGE_COMPONENT4_NV 0x8ED1
774 #define GL_COVERAGE_ATTACHMENT_NV 0x8ED2
775 #define GL_COVERAGE_BUFFERS_NV 0x8ED3
776 #define GL_COVERAGE_SAMPLES_NV 0x8ED4
777 #define GL_COVERAGE_ALL_FRAGMENTS_NV 0x8ED5
778 #define GL_COVERAGE_EDGE_FRAGMENTS_NV 0x8ED6
779 #define GL_COVERAGE_AUTOMATIC_NV 0x8ED7
780 #define GL_COVERAGE_BUFFER_BIT_NV 0x00008000
781 #endif
782
783 /* GL_NV_depth_nonlinear */
784 #ifndef GL_NV_depth_nonlinear
785 #define GL_DEPTH_COMPONENT16_NONLINEAR_NV 0x8E2C
786 #endif
787
788 /* GL_NV_draw_buffers */
789 #ifndef GL_NV_draw_buffers
790 #define GL_MAX_DRAW_BUFFERS_NV 0x8824
791 #define GL_DRAW_BUFFER0_NV 0x8825
792 #define GL_DRAW_BUFFER1_NV 0x8826
793 #define GL_DRAW_BUFFER2_NV 0x8827
794 #define GL_DRAW_BUFFER3_NV 0x8828
795 #define GL_DRAW_BUFFER4_NV 0x8829
796 #define GL_DRAW_BUFFER5_NV 0x882A
797 #define GL_DRAW_BUFFER6_NV 0x882B
798 #define GL_DRAW_BUFFER7_NV 0x882C
799 #define GL_DRAW_BUFFER8_NV 0x882D
800 #define GL_DRAW_BUFFER9_NV 0x882E
801 #define GL_DRAW_BUFFER10_NV 0x882F
802 #define GL_DRAW_BUFFER11_NV 0x8830
803 #define GL_DRAW_BUFFER12_NV 0x8831
804 #define GL_DRAW_BUFFER13_NV 0x8832
805 #define GL_DRAW_BUFFER14_NV 0x8833
806 #define GL_DRAW_BUFFER15_NV 0x8834
807 #define GL_COLOR_ATTACHMENT0_NV 0x8CE0
808 #define GL_COLOR_ATTACHMENT1_NV 0x8CE1
809 #define GL_COLOR_ATTACHMENT2_NV 0x8CE2
810 #define GL_COLOR_ATTACHMENT3_NV 0x8CE3
811 #define GL_COLOR_ATTACHMENT4_NV 0x8CE4
812 #define GL_COLOR_ATTACHMENT5_NV 0x8CE5
813 #define GL_COLOR_ATTACHMENT6_NV 0x8CE6
814 #define GL_COLOR_ATTACHMENT7_NV 0x8CE7
815 #define GL_COLOR_ATTACHMENT8_NV 0x8CE8
816 #define GL_COLOR_ATTACHMENT9_NV 0x8CE9
817 #define GL_COLOR_ATTACHMENT10_NV 0x8CEA
818 #define GL_COLOR_ATTACHMENT11_NV 0x8CEB
819 #define GL_COLOR_ATTACHMENT12_NV 0x8CEC
820 #define GL_COLOR_ATTACHMENT13_NV 0x8CED
821 #define GL_COLOR_ATTACHMENT14_NV 0x8CEE
822 #define GL_COLOR_ATTACHMENT15_NV 0x8CEF
823 #endif
824
825 /* GL_NV_draw_instanced */
826 /* No new tokens introduced by this extension. */
827
828 /* GL_NV_fbo_color_attachments */
829 #ifndef GL_NV_fbo_color_attachments
830 #define GL_MAX_COLOR_ATTACHMENTS_NV 0x8CDF
831 /* GL_COLOR_ATTACHMENT{0-15}_NV defined in GL_NV_draw_buffers already. */
832 #endif
833
834 /* GL_NV_fence */
835 #ifndef GL_NV_fence
836 #define GL_ALL_COMPLETED_NV 0x84F2
837 #define GL_FENCE_STATUS_NV 0x84F3
838 #define GL_FENCE_CONDITION_NV 0x84F4
839 #endif
840
841 /* GL_NV_framebuffer_blit */
842 #ifndef GL_NV_framebuffer_blit
843 #define GL_READ_FRAMEBUFFER_NV 0x8CA8
844 #define GL_DRAW_FRAMEBUFFER_NV 0x8CA9
845 #define GL_DRAW_FRAMEBUFFER_BINDING_NV 0x8CA6
846 #define GL_READ_FRAMEBUFFER_BINDING_NV 0x8CAA
847 #endif
848
849 /* GL_NV_framebuffer_multisample */
850 #ifndef GL_NV_framebuffer_multisample
851 #define GL_RENDERBUFFER_SAMPLES_NV 0x8CAB
852 #define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_NV 0x8D56
853 #define GL_MAX_SAMPLES_NV 0x8D57
854 #endif
855
856 /* GL_NV_generate_mipmap_sRGB */
857 /* No new tokens introduced by this extension. */
858
859 /* GL_NV_instanced_arrays */
860 #ifndef GL_NV_instanced_arrays
861 #define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_NV 0x88FE
862 #endif
863
864 /* GL_NV_read_buffer */
865 #ifndef GL_NV_read_buffer
866 #define GL_READ_BUFFER_NV 0x0C02
867 #endif
868
869 /* GL_NV_read_buffer_front */
870 /* No new tokens introduced by this extension. */
871
872 /* GL_NV_read_depth */
873 /* No new tokens introduced by this extension. */
874
875 /* GL_NV_read_depth_stencil */
876 /* No new tokens introduced by this extension. */
877
878 /* GL_NV_read_stencil */
879 /* No new tokens introduced by this extension. */
880
881 /* GL_NV_shadow_samplers_array */
882 #ifndef GL_NV_shadow_samplers_array
883 #define GL_SAMPLER_2D_ARRAY_SHADOW_NV 0x8DC4
884 #endif
885
886 /* GL_NV_shadow_samplers_cube */
887 #ifndef GL_NV_shadow_samplers_cube
888 #define GL_SAMPLER_CUBE_SHADOW_NV 0x8DC5
889 #endif
890
891 /* GL_NV_sRGB_formats */
892 #ifndef GL_NV_sRGB_formats
893 #define GL_SLUMINANCE_NV 0x8C46
894 #define GL_SLUMINANCE_ALPHA_NV 0x8C44
895 #define GL_SRGB8_NV 0x8C41
896 #define GL_SLUMINANCE8_NV 0x8C47
897 #define GL_SLUMINANCE8_ALPHA8_NV 0x8C45
898 #define GL_COMPRESSED_SRGB_S3TC_DXT1_NV 0x8C4C
899 #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_NV 0x8C4D
900 #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_NV 0x8C4E
901 #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_NV 0x8C4F
902 #define GL_ETC1_SRGB8_NV 0x88EE
903 #endif
904
905 /* GL_NV_texture_border_clamp */
906 #ifndef GL_NV_texture_border_clamp
907 #define GL_TEXTURE_BORDER_COLOR_NV 0x1004
908 #define GL_CLAMP_TO_BORDER_NV 0x812D
909 #endif
910
911 /* GL_NV_texture_compression_s3tc_update */
912 /* No new tokens introduced by this extension. */
913
914 /* GL_NV_texture_npot_2D_mipmap */
915 /* No new tokens introduced by this extension. */
916
917 /*------------------------------------------------------------------------*
918 * QCOM extension tokens
919 *------------------------------------------------------------------------*/
920
921 /* GL_QCOM_alpha_test */
922 #ifndef GL_QCOM_alpha_test
923 #define GL_ALPHA_TEST_QCOM 0x0BC0
924 #define GL_ALPHA_TEST_FUNC_QCOM 0x0BC1
925 #define GL_ALPHA_TEST_REF_QCOM 0x0BC2
926 #endif
927
928 /* GL_QCOM_binning_control */
929 #ifndef GL_QCOM_binning_control
930 #define GL_BINNING_CONTROL_HINT_QCOM 0x8FB0
931 #define GL_CPU_OPTIMIZED_QCOM 0x8FB1
932 #define GL_GPU_OPTIMIZED_QCOM 0x8FB2
933 #define GL_RENDER_DIRECT_TO_FRAMEBUFFER_QCOM 0x8FB3
934 #endif
935
936 /* GL_QCOM_driver_control */
937 /* No new tokens introduced by this extension. */
938
939 /* GL_QCOM_extended_get */
940 #ifndef GL_QCOM_extended_get
941 #define GL_TEXTURE_WIDTH_QCOM 0x8BD2
942 #define GL_TEXTURE_HEIGHT_QCOM 0x8BD3
943 #define GL_TEXTURE_DEPTH_QCOM 0x8BD4
944 #define GL_TEXTURE_INTERNAL_FORMAT_QCOM 0x8BD5
945 #define GL_TEXTURE_FORMAT_QCOM 0x8BD6
946 #define GL_TEXTURE_TYPE_QCOM 0x8BD7
947 #define GL_TEXTURE_IMAGE_VALID_QCOM 0x8BD8
948 #define GL_TEXTURE_NUM_LEVELS_QCOM 0x8BD9
949 #define GL_TEXTURE_TARGET_QCOM 0x8BDA
950 #define GL_TEXTURE_OBJECT_VALID_QCOM 0x8BDB
951 #define GL_STATE_RESTORE 0x8BDC
952 #endif
953
954 /* GL_QCOM_extended_get2 */
955 /* No new tokens introduced by this extension. */
956
957 /* GL_QCOM_perfmon_global_mode */
958 #ifndef GL_QCOM_perfmon_global_mode
959 #define GL_PERFMON_GLOBAL_MODE_QCOM 0x8FA0
960 #endif
961
962 /* GL_QCOM_writeonly_rendering */
963 #ifndef GL_QCOM_writeonly_rendering
964 #define GL_WRITEONLY_RENDERING_QCOM 0x8823
965 #endif
966
967 /* GL_QCOM_tiled_rendering */
968 #ifndef GL_QCOM_tiled_rendering
969 #define GL_COLOR_BUFFER_BIT0_QCOM 0x00000001
970 #define GL_COLOR_BUFFER_BIT1_QCOM 0x00000002
971 #define GL_COLOR_BUFFER_BIT2_QCOM 0x00000004
972 #define GL_COLOR_BUFFER_BIT3_QCOM 0x00000008
973 #define GL_COLOR_BUFFER_BIT4_QCOM 0x00000010
974 #define GL_COLOR_BUFFER_BIT5_QCOM 0x00000020
975 #define GL_COLOR_BUFFER_BIT6_QCOM 0x00000040
976 #define GL_COLOR_BUFFER_BIT7_QCOM 0x00000080
977 #define GL_DEPTH_BUFFER_BIT0_QCOM 0x00000100
978 #define GL_DEPTH_BUFFER_BIT1_QCOM 0x00000200
979 #define GL_DEPTH_BUFFER_BIT2_QCOM 0x00000400
980 #define GL_DEPTH_BUFFER_BIT3_QCOM 0x00000800
981 #define GL_DEPTH_BUFFER_BIT4_QCOM 0x00001000
982 #define GL_DEPTH_BUFFER_BIT5_QCOM 0x00002000
983 #define GL_DEPTH_BUFFER_BIT6_QCOM 0x00004000
984 #define GL_DEPTH_BUFFER_BIT7_QCOM 0x00008000
985 #define GL_STENCIL_BUFFER_BIT0_QCOM 0x00010000
986 #define GL_STENCIL_BUFFER_BIT1_QCOM 0x00020000
987 #define GL_STENCIL_BUFFER_BIT2_QCOM 0x00040000
988 #define GL_STENCIL_BUFFER_BIT3_QCOM 0x00080000
989 #define GL_STENCIL_BUFFER_BIT4_QCOM 0x00100000
990 #define GL_STENCIL_BUFFER_BIT5_QCOM 0x00200000
991 #define GL_STENCIL_BUFFER_BIT6_QCOM 0x00400000
992 #define GL_STENCIL_BUFFER_BIT7_QCOM 0x00800000
993 #define GL_MULTISAMPLE_BUFFER_BIT0_QCOM 0x01000000
994 #define GL_MULTISAMPLE_BUFFER_BIT1_QCOM 0x02000000
995 #define GL_MULTISAMPLE_BUFFER_BIT2_QCOM 0x04000000
996 #define GL_MULTISAMPLE_BUFFER_BIT3_QCOM 0x08000000
997 #define GL_MULTISAMPLE_BUFFER_BIT4_QCOM 0x10000000
998 #define GL_MULTISAMPLE_BUFFER_BIT5_QCOM 0x20000000
999 #define GL_MULTISAMPLE_BUFFER_BIT6_QCOM 0x40000000
1000 #define GL_MULTISAMPLE_BUFFER_BIT7_QCOM 0x80000000
1001 #endif
1002
1003 /*------------------------------------------------------------------------*
1004 * VIV extension tokens
1005 *------------------------------------------------------------------------*/
1006
1007 /* GL_VIV_shader_binary */
1008 #ifndef GL_VIV_shader_binary
1009 #define GL_SHADER_BINARY_VIV 0x8FC4
1010 #endif
1011
1012 /*------------------------------------------------------------------------*
1013 * End of extension tokens, start of corresponding extension functions
1014 *------------------------------------------------------------------------*/
1015
1016 /*------------------------------------------------------------------------*
1017 * OES extension functions
1018 *------------------------------------------------------------------------*/
1019
1020 /* GL_OES_compressed_ETC1_RGB8_texture */
1021 #ifndef GL_OES_compressed_ETC1_RGB8_texture
1022 #define GL_OES_compressed_ETC1_RGB8_texture 1
1023 #endif
1024
1025 /* GL_OES_compressed_paletted_texture */
1026 #ifndef GL_OES_compressed_paletted_texture
1027 #define GL_OES_compressed_paletted_texture 1
1028 #endif
1029
1030 /* GL_OES_depth24 */
1031 #ifndef GL_OES_depth24
1032 #define GL_OES_depth24 1
1033 #endif
1034
1035 /* GL_OES_depth32 */
1036 #ifndef GL_OES_depth32
1037 #define GL_OES_depth32 1
1038 #endif
1039
1040 /* GL_OES_depth_texture */
1041 #ifndef GL_OES_depth_texture
1042 #define GL_OES_depth_texture 1
1043 #endif
1044
1045 /* GL_OES_EGL_image */
1046 #ifndef GL_OES_EGL_image
1047 #define GL_OES_EGL_image 1
1048 #ifdef GL_GLEXT_PROTOTYPES
1049 GL_APICALL void GL_APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image);
1050 GL_APICALL void GL_APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image);
1051 #endif
1052 typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image);
1053 typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image);
1054 #endif
1055
1056 /* GL_OES_EGL_image_external */
1057 #ifndef GL_OES_EGL_image_external
1058 #define GL_OES_EGL_image_external 1
1059 /* glEGLImageTargetTexture2DOES defined in GL_OES_EGL_image already. */
1060 #endif
1061
1062 /* GL_OES_element_index_uint */
1063 #ifndef GL_OES_element_index_uint
1064 #define GL_OES_element_index_uint 1
1065 #endif
1066
1067 /* GL_OES_fbo_render_mipmap */
1068 #ifndef GL_OES_fbo_render_mipmap
1069 #define GL_OES_fbo_render_mipmap 1
1070 #endif
1071
1072 /* GL_OES_fragment_precision_high */
1073 #ifndef GL_OES_fragment_precision_high
1074 #define GL_OES_fragment_precision_high 1
1075 #endif
1076
1077 /* GL_OES_get_program_binary */
1078 #ifndef GL_OES_get_program_binary
1079 #define GL_OES_get_program_binary 1
1080 #ifdef GL_GLEXT_PROTOTYPES
1081 GL_APICALL void GL_APIENTRY glGetProgramBinaryOES (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary);
1082 GL_APICALL void GL_APIENTRY glProgramBinaryOES (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length);
1083 #endif
1084 typedef void (GL_APIENTRYP PFNGLGETPROGRAMBINARYOESPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary);
1085 typedef void (GL_APIENTRYP PFNGLPROGRAMBINARYOESPROC) (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length);
1086 #endif
1087
1088 /* GL_OES_mapbuffer */
1089 #ifndef GL_OES_mapbuffer
1090 #define GL_OES_mapbuffer 1
1091 #ifdef GL_GLEXT_PROTOTYPES
1092 GL_APICALL void* GL_APIENTRY glMapBufferOES (GLenum target, GLenum access);
1093 GL_APICALL GLboolean GL_APIENTRY glUnmapBufferOES (GLenum target);
1094 GL_APICALL void GL_APIENTRY glGetBufferPointervOES (GLenum target, GLenum pname, GLvoid **params);
1095 #endif
1096 typedef void* (GL_APIENTRYP PFNGLMAPBUFFEROESPROC) (GLenum target, GLenum access);
1097 typedef GLboolean (GL_APIENTRYP PFNGLUNMAPBUFFEROESPROC) (GLenum target);
1098 typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum pname, GLvoid **params);
1099 #endif
1100
1101 /* GL_OES_packed_depth_stencil */
1102 #ifndef GL_OES_packed_depth_stencil
1103 #define GL_OES_packed_depth_stencil 1
1104 #endif
1105
1106 /* GL_OES_required_internalformat */
1107 #ifndef GL_OES_required_internalformat
1108 #define GL_OES_required_internalformat 1
1109 #endif
1110
1111 /* GL_OES_rgb8_rgba8 */
1112 #ifndef GL_OES_rgb8_rgba8
1113 #define GL_OES_rgb8_rgba8 1
1114 #endif
1115
1116 /* GL_OES_standard_derivatives */
1117 #ifndef GL_OES_standard_derivatives
1118 #define GL_OES_standard_derivatives 1
1119 #endif
1120
1121 /* GL_OES_stencil1 */
1122 #ifndef GL_OES_stencil1
1123 #define GL_OES_stencil1 1
1124 #endif
1125
1126 /* GL_OES_stencil4 */
1127 #ifndef GL_OES_stencil4
1128 #define GL_OES_stencil4 1
1129 #endif
1130
1131 #ifndef GL_OES_surfaceless_context
1132 #define GL_OES_surfaceless_context 1
1133 #endif
1134
1135 /* GL_OES_texture_3D */
1136 #ifndef GL_OES_texture_3D
1137 #define GL_OES_texture_3D 1
1138 #ifdef GL_GLEXT_PROTOTYPES
1139 GL_APICALL void GL_APIENTRY glTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
1140 GL_APICALL void GL_APIENTRY glTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels);
1141 GL_APICALL void GL_APIENTRY glCopyTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
1142 GL_APICALL void GL_APIENTRY glCompressedTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data);
1143 GL_APICALL void GL_APIENTRY glCompressedTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data);
1144 GL_APICALL void GL_APIENTRY glFramebufferTexture3DOES (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
1145 #endif
1146 typedef void (GL_APIENTRYP PFNGLTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
1147 typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels);
1148 typedef void (GL_APIENTRYP PFNGLCOPYTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
1149 typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data);
1150 typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data);
1151 typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DOESPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
1152 #endif
1153
1154 /* GL_OES_texture_float */
1155 #ifndef GL_OES_texture_float
1156 #define GL_OES_texture_float 1
1157 #endif
1158
1159 /* GL_OES_texture_float_linear */
1160 #ifndef GL_OES_texture_float_linear
1161 #define GL_OES_texture_float_linear 1
1162 #endif
1163
1164 /* GL_OES_texture_half_float */
1165 #ifndef GL_OES_texture_half_float
1166 #define GL_OES_texture_half_float 1
1167 #endif
1168
1169 /* GL_OES_texture_half_float_linear */
1170 #ifndef GL_OES_texture_half_float_linear
1171 #define GL_OES_texture_half_float_linear 1
1172 #endif
1173
1174 /* GL_OES_texture_npot */
1175 #ifndef GL_OES_texture_npot
1176 #define GL_OES_texture_npot 1
1177 #endif
1178
1179 /* GL_OES_vertex_array_object */
1180 #ifndef GL_OES_vertex_array_object
1181 #define GL_OES_vertex_array_object 1
1182 #ifdef GL_GLEXT_PROTOTYPES
1183 GL_APICALL void GL_APIENTRY glBindVertexArrayOES (GLuint array);
1184 GL_APICALL void GL_APIENTRY glDeleteVertexArraysOES (GLsizei n, const GLuint *arrays);
1185 GL_APICALL void GL_APIENTRY glGenVertexArraysOES (GLsizei n, GLuint *arrays);
1186 GL_APICALL GLboolean GL_APIENTRY glIsVertexArrayOES (GLuint array);
1187 #endif
1188 typedef void (GL_APIENTRYP PFNGLBINDVERTEXARRAYOESPROC) (GLuint array);
1189 typedef void (GL_APIENTRYP PFNGLDELETEVERTEXARRAYSOESPROC) (GLsizei n, const GLuint *arrays);
1190 typedef void (GL_APIENTRYP PFNGLGENVERTEXARRAYSOESPROC) (GLsizei n, GLuint *arrays);
1191 typedef GLboolean (GL_APIENTRYP PFNGLISVERTEXARRAYOESPROC) (GLuint array);
1192 #endif
1193
1194 /* GL_OES_vertex_half_float */
1195 #ifndef GL_OES_vertex_half_float
1196 #define GL_OES_vertex_half_float 1
1197 #endif
1198
1199 /* GL_OES_vertex_type_10_10_10_2 */
1200 #ifndef GL_OES_vertex_type_10_10_10_2
1201 #define GL_OES_vertex_type_10_10_10_2 1
1202 #endif
1203
1204 /*------------------------------------------------------------------------*
1205 * KHR extension functions
1206 *------------------------------------------------------------------------*/
1207
1208 #ifndef GL_KHR_debug
1209 #define GL_KHR_debug 1
1210 #ifdef GL_GLEXT_PROTOTYPES
1211 GL_APICALL void GL_APIENTRY glDebugMessageControlKHR (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
1212 GL_APICALL void GL_APIENTRY glDebugMessageInsertKHR (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
1213 GL_APICALL void GL_APIENTRY glDebugMessageCallbackKHR (GLDEBUGPROCKHR callback, const void *userParam);
1214 GL_APICALL GLuint GL_APIENTRY glGetDebugMessageLogKHR (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
1215 GL_APICALL void GL_APIENTRY glPushDebugGroupKHR (GLenum source, GLuint id, GLsizei length, const GLchar *message);
1216 GL_APICALL void GL_APIENTRY glPopDebugGroupKHR (void);
1217 GL_APICALL void GL_APIENTRY glObjectLabelKHR (GLenum identifier, GLuint name, GLsizei length, const GLchar *label);
1218 GL_APICALL void GL_APIENTRY glGetObjectLabelKHR (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label);
1219 GL_APICALL void GL_APIENTRY glObjectPtrLabelKHR (const void *ptr, GLsizei length, const GLchar *label);
1220 GL_APICALL void GL_APIENTRY glGetObjectPtrLabelKHR (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label);
1221 GL_APICALL void GL_APIENTRY glGetPointervKHR (GLenum pname, GLvoid **params);
1222 #endif
1223 typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGECONTROLKHRPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
1224 typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGEINSERTKHRPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
1225 typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGECALLBACKKHRPROC) (GLDEBUGPROCKHR callback, const void *userParam);
1226 typedef GLuint (GL_APIENTRYP PFNGLGETDEBUGMESSAGELOGKHRPROC) (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
1227 typedef void (GL_APIENTRYP PFNGLPUSHDEBUGGROUPKHRPROC) (GLenum source, GLuint id, GLsizei length, const GLchar *message);
1228 typedef void (GL_APIENTRYP PFNGLPOPDEBUGGROUPKHRPROC) (void);
1229 typedef void (GL_APIENTRYP PFNGLOBJECTLABELKHRPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar *label);
1230 typedef void (GL_APIENTRYP PFNGLGETOBJECTLABELKHRPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label);
1231 typedef void (GL_APIENTRYP PFNGLOBJECTPTRLABELKHRPROC) (const void *ptr, GLsizei length, const GLchar *label);
1232 typedef void (GL_APIENTRYP PFNGLGETOBJECTPTRLABELKHRPROC) (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label);
1233 typedef void (GL_APIENTRYP PFNGLGETPOINTERVKHRPROC) (GLenum pname, GLvoid **params);
1234 #endif
1235
1236 #ifndef GL_KHR_texture_compression_astc_ldr
1237 #define GL_KHR_texture_compression_astc_ldr 1
1238 #endif
1239
1240
1241 /*------------------------------------------------------------------------*
1242 * AMD extension functions
1243 *------------------------------------------------------------------------*/
1244
1245 /* GL_AMD_compressed_3DC_texture */
1246 #ifndef GL_AMD_compressed_3DC_texture
1247 #define GL_AMD_compressed_3DC_texture 1
1248 #endif
1249
1250 /* GL_AMD_compressed_ATC_texture */
1251 #ifndef GL_AMD_compressed_ATC_texture
1252 #define GL_AMD_compressed_ATC_texture 1
1253 #endif
1254
1255 /* AMD_performance_monitor */
1256 #ifndef GL_AMD_performance_monitor
1257 #define GL_AMD_performance_monitor 1
1258 #ifdef GL_GLEXT_PROTOTYPES
1259 GL_APICALL void GL_APIENTRY glGetPerfMonitorGroupsAMD (GLint *numGroups, GLsizei groupsSize, GLuint *groups);
1260 GL_APICALL void GL_APIENTRY glGetPerfMonitorCountersAMD (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters);
1261 GL_APICALL void GL_APIENTRY glGetPerfMonitorGroupStringAMD (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString);
1262 GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterStringAMD (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString);
1263 GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint group, GLuint counter, GLenum pname, GLvoid *data);
1264 GL_APICALL void GL_APIENTRY glGenPerfMonitorsAMD (GLsizei n, GLuint *monitors);
1265 GL_APICALL void GL_APIENTRY glDeletePerfMonitorsAMD (GLsizei n, GLuint *monitors);
1266 GL_APICALL void GL_APIENTRY glSelectPerfMonitorCountersAMD (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList);
1267 GL_APICALL void GL_APIENTRY glBeginPerfMonitorAMD (GLuint monitor);
1268 GL_APICALL void GL_APIENTRY glEndPerfMonitorAMD (GLuint monitor);
1269 GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterDataAMD (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten);
1270 #endif
1271 typedef void (GL_APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups);
1272 typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters);
1273 typedef void (GL_APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString);
1274 typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString);
1275 typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, GLvoid *data);
1276 typedef void (GL_APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors);
1277 typedef void (GL_APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors);
1278 typedef void (GL_APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList);
1279 typedef void (GL_APIENTRYP PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor);
1280 typedef void (GL_APIENTRYP PFNGLENDPERFMONITORAMDPROC) (GLuint monitor);
1281 typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten);
1282 #endif
1283
1284 /* GL_AMD_program_binary_Z400 */
1285 #ifndef GL_AMD_program_binary_Z400
1286 #define GL_AMD_program_binary_Z400 1
1287 #endif
1288
1289 /*------------------------------------------------------------------------*
1290 * ANGLE extension functions
1291 *------------------------------------------------------------------------*/
1292
1293 /* GL_ANGLE_depth_texture */
1294 #ifndef GL_ANGLE_depth_texture
1295 #define GL_ANGLE_depth_texture 1
1296 #endif
1297
1298 /* GL_ANGLE_framebuffer_blit */
1299 #ifndef GL_ANGLE_framebuffer_blit
1300 #define GL_ANGLE_framebuffer_blit 1
1301 #ifdef GL_GLEXT_PROTOTYPES
1302 GL_APICALL void GL_APIENTRY glBlitFramebufferANGLE (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
1303 #endif
1304 typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERANGLEPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
1305 #endif
1306
1307 /* GL_ANGLE_framebuffer_multisample */
1308 #ifndef GL_ANGLE_framebuffer_multisample
1309 #define GL_ANGLE_framebuffer_multisample 1
1310 #ifdef GL_GLEXT_PROTOTYPES
1311 GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleANGLE (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
1312 #endif
1313 typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
1314 #endif
1315
1316 #ifndef GL_ANGLE_instanced_arrays
1317 #define GL_ANGLE_instanced_arrays 1
1318 #ifdef GL_GLEXT_PROTOTYPES
1319 GL_APICALL void GL_APIENTRY glDrawArraysInstancedANGLE (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
1320 GL_APICALL void GL_APIENTRY glDrawElementsInstancedANGLE (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount);
1321 GL_APICALL void GL_APIENTRY glVertexAttribDivisorANGLE (GLuint index, GLuint divisor);
1322 #endif
1323 typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDANGLEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
1324 typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDANGLEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount);
1325 typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISORANGLEPROC) (GLuint index, GLuint divisor);
1326 #endif
1327
1328 /* GL_ANGLE_pack_reverse_row_order */
1329 #ifndef GL_ANGLE_pack_reverse_row_order
1330 #define GL_ANGLE_pack_reverse_row_order 1
1331 #endif
1332
1333 /* GL_ANGLE_program_binary */
1334 #ifndef GL_ANGLE_program_binary
1335 #define GL_ANGLE_program_binary 1
1336 #endif
1337
1338 /* GL_ANGLE_texture_compression_dxt3 */
1339 #ifndef GL_ANGLE_texture_compression_dxt3
1340 #define GL_ANGLE_texture_compression_dxt3 1
1341 #endif
1342
1343 /* GL_ANGLE_texture_compression_dxt5 */
1344 #ifndef GL_ANGLE_texture_compression_dxt5
1345 #define GL_ANGLE_texture_compression_dxt5 1
1346 #endif
1347
1348 /* GL_ANGLE_texture_usage */
1349 #ifndef GL_ANGLE_texture_usage
1350 #define GL_ANGLE_texture_usage 1
1351 #endif
1352
1353 #ifndef GL_ANGLE_translated_shader_source
1354 #define GL_ANGLE_translated_shader_source 1
1355 #ifdef GL_GLEXT_PROTOTYPES
1356 GL_APICALL void GL_APIENTRY glGetTranslatedShaderSourceANGLE (GLuint shader, GLsizei bufsize, GLsizei *length, GLchar *source);
1357 #endif
1358 typedef void (GL_APIENTRYP PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC) (GLuint shader, GLsizei bufsize, GLsizei *length, GLchar *source);
1359 #endif
1360
1361 /*------------------------------------------------------------------------*
1362 * APPLE extension functions
1363 *------------------------------------------------------------------------*/
1364
1365 /* GL_APPLE_copy_texture_levels */
1366 #ifndef GL_APPLE_copy_texture_levels
1367 #define GL_APPLE_copy_texture_levels 1
1368 #ifdef GL_GLEXT_PROTOTYPES
1369 GL_APICALL void GL_APIENTRY glCopyTextureLevelsAPPLE (GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount);
1370 #endif
1371 typedef void (GL_APIENTRYP PFNGLCOPYTEXTURELEVELSAPPLEPROC) (GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount);
1372 #endif
1373
1374 /* GL_APPLE_framebuffer_multisample */
1375 #ifndef GL_APPLE_framebuffer_multisample
1376 #define GL_APPLE_framebuffer_multisample 1
1377 #ifdef GL_GLEXT_PROTOTYPES
1378 GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleAPPLE (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
1379 GL_APICALL void GL_APIENTRY glResolveMultisampleFramebufferAPPLE (void);
1380 #endif /* GL_GLEXT_PROTOTYPES */
1381 typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
1382 typedef void (GL_APIENTRYP PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC) (void);
1383 #endif
1384
1385 /* GL_APPLE_rgb_422 */
1386 #ifndef GL_APPLE_rgb_422
1387 #define GL_APPLE_rgb_422 1
1388 #endif
1389
1390 /* GL_APPLE_sync */
1391 #ifndef GL_APPLE_sync
1392 #define GL_APPLE_sync 1
1393 #ifdef GL_GLEXT_PROTOTYPES
1394 GL_APICALL GLsync GL_APIENTRY glFenceSyncAPPLE (GLenum condition, GLbitfield flags);
1395 GL_APICALL GLboolean GL_APIENTRY glIsSyncAPPLE (GLsync sync);
1396 GL_APICALL void GL_APIENTRY glDeleteSyncAPPLE (GLsync sync);
1397 GL_APICALL GLenum GL_APIENTRY glClientWaitSyncAPPLE (GLsync sync, GLbitfield flags, GLuint64 timeout);
1398 GL_APICALL void GL_APIENTRY glWaitSyncAPPLE (GLsync sync, GLbitfield flags, GLuint64 timeout);
1399 GL_APICALL void GL_APIENTRY glGetInteger64vAPPLE (GLenum pname, GLint64 *params);
1400 GL_APICALL void GL_APIENTRY glGetSyncivAPPLE (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
1401 #endif
1402 typedef GLsync (GL_APIENTRYP PFNGLFENCESYNCAPPLEPROC) (GLenum condition, GLbitfield flags);
1403 typedef GLboolean (GL_APIENTRYP PFNGLISSYNCAPPLEPROC) (GLsync sync);
1404 typedef void (GL_APIENTRYP PFNGLDELETESYNCAPPLEPROC) (GLsync sync);
1405 typedef GLenum (GL_APIENTRYP PFNGLCLIENTWAITSYNCAPPLEPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
1406 typedef void (GL_APIENTRYP PFNGLWAITSYNCAPPLEPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
1407 typedef void (GL_APIENTRYP PFNGLGETINTEGER64VAPPLEPROC) (GLenum pname, GLint64 *params);
1408 typedef void (GL_APIENTRYP PFNGLGETSYNCIVAPPLEPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
1409 #endif
1410
1411 /* GL_APPLE_texture_format_BGRA8888 */
1412 #ifndef GL_APPLE_texture_format_BGRA8888
1413 #define GL_APPLE_texture_format_BGRA8888 1
1414 #endif
1415
1416 /* GL_APPLE_texture_max_level */
1417 #ifndef GL_APPLE_texture_max_level
1418 #define GL_APPLE_texture_max_level 1
1419 #endif
1420
1421 /*------------------------------------------------------------------------*
1422 * ARM extension functions
1423 *------------------------------------------------------------------------*/
1424
1425 /* GL_ARM_mali_program_binary */
1426 #ifndef GL_ARM_mali_program_binary
1427 #define GL_ARM_mali_program_binary 1
1428 #endif
1429
1430 /* GL_ARM_mali_shader_binary */
1431 #ifndef GL_ARM_mali_shader_binary
1432 #define GL_ARM_mali_shader_binary 1
1433 #endif
1434
1435 /* GL_ARM_rgba8 */
1436 #ifndef GL_ARM_rgba8
1437 #define GL_ARM_rgba8 1
1438 #endif
1439
1440 /*------------------------------------------------------------------------*
1441 * EXT extension functions
1442 *------------------------------------------------------------------------*/
1443
1444 /* GL_EXT_blend_minmax */
1445 #ifndef GL_EXT_blend_minmax
1446 #define GL_EXT_blend_minmax 1
1447 #endif
1448
1449 /* GL_EXT_color_buffer_half_float */
1450 #ifndef GL_EXT_color_buffer_half_float
1451 #define GL_EXT_color_buffer_half_float 1
1452 #endif
1453
1454 /* GL_EXT_debug_label */
1455 #ifndef GL_EXT_debug_label
1456 #define GL_EXT_debug_label 1
1457 #ifdef GL_GLEXT_PROTOTYPES
1458 GL_APICALL void GL_APIENTRY glLabelObjectEXT (GLenum type, GLuint object, GLsizei length, const GLchar *label);
1459 GL_APICALL void GL_APIENTRY glGetObjectLabelEXT (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label);
1460 #endif
1461 typedef void (GL_APIENTRYP PFNGLLABELOBJECTEXTPROC) (GLenum type, GLuint object, GLsizei length, const GLchar *label);
1462 typedef void (GL_APIENTRYP PFNGLGETOBJECTLABELEXTPROC) (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label);
1463 #endif
1464
1465 /* GL_EXT_debug_marker */
1466 #ifndef GL_EXT_debug_marker
1467 #define GL_EXT_debug_marker 1
1468 #ifdef GL_GLEXT_PROTOTYPES
1469 GL_APICALL void GL_APIENTRY glInsertEventMarkerEXT (GLsizei length, const GLchar *marker);
1470 GL_APICALL void GL_APIENTRY glPushGroupMarkerEXT (GLsizei length, const GLchar *marker);
1471 GL_APICALL void GL_APIENTRY glPopGroupMarkerEXT (void);
1472 #endif
1473 typedef void (GL_APIENTRYP PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar *marker);
1474 typedef void (GL_APIENTRYP PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar *marker);
1475 typedef void (GL_APIENTRYP PFNGLPOPGROUPMARKEREXTPROC) (void);
1476 #endif
1477
1478 /* GL_EXT_discard_framebuffer */
1479 #ifndef GL_EXT_discard_framebuffer
1480 #define GL_EXT_discard_framebuffer 1
1481 #ifdef GL_GLEXT_PROTOTYPES
1482 GL_APICALL void GL_APIENTRY glDiscardFramebufferEXT (GLenum target, GLsizei numAttachments, const GLenum *attachments);
1483 #endif
1484 typedef void (GL_APIENTRYP PFNGLDISCARDFRAMEBUFFEREXTPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments);
1485 #endif
1486
1487 #ifndef GL_EXT_disjoint_timer_query
1488 #define GL_EXT_disjoint_timer_query 1
1489 #ifdef GL_GLEXT_PROTOTYPES
1490 GL_APICALL void GL_APIENTRY glGenQueriesEXT (GLsizei n, GLuint *ids);
1491 GL_APICALL void GL_APIENTRY glDeleteQueriesEXT (GLsizei n, const GLuint *ids);
1492 GL_APICALL GLboolean GL_APIENTRY glIsQueryEXT (GLuint id);
1493 GL_APICALL void GL_APIENTRY glBeginQueryEXT (GLenum target, GLuint id);
1494 GL_APICALL void GL_APIENTRY glEndQueryEXT (GLenum target);
1495 GL_APICALL void GL_APIENTRY glQueryCounterEXT (GLuint id, GLenum target);
1496 GL_APICALL void GL_APIENTRY glGetQueryivEXT (GLenum target, GLenum pname, GLint *params);
1497 GL_APICALL void GL_APIENTRY glGetQueryObjectivEXT (GLuint id, GLenum pname, GLint *params);
1498 GL_APICALL void GL_APIENTRY glGetQueryObjectuivEXT (GLuint id, GLenum pname, GLuint *params);
1499 GL_APICALL void GL_APIENTRY glGetQueryObjecti64vEXT (GLuint id, GLenum pname, GLint64 *params);
1500 GL_APICALL void GL_APIENTRY glGetQueryObjectui64vEXT (GLuint id, GLenum pname, GLuint64 *params);
1501 #endif
1502 typedef void (GL_APIENTRYP PFNGLGENQUERIESEXTPROC) (GLsizei n, GLuint *ids);
1503 typedef void (GL_APIENTRYP PFNGLDELETEQUERIESEXTPROC) (GLsizei n, const GLuint *ids);
1504 typedef GLboolean (GL_APIENTRYP PFNGLISQUERYEXTPROC) (GLuint id);
1505 typedef void (GL_APIENTRYP PFNGLBEGINQUERYEXTPROC) (GLenum target, GLuint id);
1506 typedef void (GL_APIENTRYP PFNGLENDQUERYEXTPROC) (GLenum target);
1507 typedef void (GL_APIENTRYP PFNGLQUERYCOUNTEREXTPROC) (GLuint id, GLenum target);
1508 typedef void (GL_APIENTRYP PFNGLGETQUERYIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
1509 typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTIVEXTPROC) (GLuint id, GLenum pname, GLint *params);
1510 typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUIVEXTPROC) (GLuint id, GLenum pname, GLuint *params);
1511 typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64 *params);
1512 typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64 *params);
1513 #endif /* GL_EXT_disjoint_timer_query */
1514
1515 #ifndef GL_EXT_draw_buffers
1516 #define GL_EXT_draw_buffers 1
1517 #ifdef GL_GLEXT_PROTOTYPES
1518 GL_APICALL void GL_APIENTRY glDrawBuffersEXT (GLsizei n, const GLenum *bufs);
1519 #endif
1520 typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSEXTPROC) (GLsizei n, const GLenum *bufs);
1521 #endif /* GL_EXT_draw_buffers */
1522
1523 /* GL_EXT_map_buffer_range */
1524 #ifndef GL_EXT_map_buffer_range
1525 #define GL_EXT_map_buffer_range 1
1526 #ifdef GL_GLEXT_PROTOTYPES
1527 GL_APICALL void* GL_APIENTRY glMapBufferRangeEXT (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
1528 GL_APICALL void GL_APIENTRY glFlushMappedBufferRangeEXT (GLenum target, GLintptr offset, GLsizeiptr length);
1529 #endif
1530 typedef void* (GL_APIENTRYP PFNGLMAPBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
1531 typedef void (GL_APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length);
1532 #endif
1533
1534 /* GL_EXT_multisampled_render_to_texture */
1535 #ifndef GL_EXT_multisampled_render_to_texture
1536 #define GL_EXT_multisampled_render_to_texture 1
1537 #ifdef GL_GLEXT_PROTOTYPES
1538 GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleEXT (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
1539 GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
1540 #endif
1541 typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
1542 typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
1543 #endif
1544
1545 /* GL_EXT_multiview_draw_buffers */
1546 #ifndef GL_EXT_multiview_draw_buffers
1547 #define GL_EXT_multiview_draw_buffers 1
1548 #ifdef GL_GLEXT_PROTOTYPES
1549 GL_APICALL void GL_APIENTRY glReadBufferIndexedEXT (GLenum src, GLint index);
1550 GL_APICALL void GL_APIENTRY glDrawBuffersIndexedEXT (GLint n, const GLenum *location, const GLint *indices);
1551 GL_APICALL void GL_APIENTRY glGetIntegeri_vEXT (GLenum target, GLuint index, GLint *data);
1552 #endif
1553 typedef void (GL_APIENTRYP PFNGLREADBUFFERINDEXEDEXTPROC) (GLenum src, GLint index);
1554 typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSINDEXEDEXTPROC) (GLint n, const GLenum *location, const GLint *indices);
1555 typedef void (GL_APIENTRYP PFNGLGETINTEGERI_VEXTPROC) (GLenum target, GLuint index, GLint *data);
1556 #endif
1557
1558 #ifndef GL_EXT_multi_draw_arrays
1559 #define GL_EXT_multi_draw_arrays 1
1560 #ifdef GL_GLEXT_PROTOTYPES
1561 GL_APICALL void GL_APIENTRY glMultiDrawArraysEXT (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
1562 GL_APICALL void GL_APIENTRY glMultiDrawElementsEXT (GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount);
1563 #endif /* GL_GLEXT_PROTOTYPES */
1564 typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
1565 typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount);
1566 #endif
1567
1568 /* GL_EXT_occlusion_query_boolean */
1569 #ifndef GL_EXT_occlusion_query_boolean
1570 #define GL_EXT_occlusion_query_boolean 1
1571 /* All entry points also exist in GL_EXT_disjoint_timer_query */
1572 #endif
1573
1574 /* GL_EXT_read_format_bgra */
1575 #ifndef GL_EXT_read_format_bgra
1576 #define GL_EXT_read_format_bgra 1
1577 #endif
1578
1579 /* GL_EXT_robustness */
1580 #ifndef GL_EXT_robustness
1581 #define GL_EXT_robustness 1
1582 #ifdef GL_GLEXT_PROTOTYPES
1583 GL_APICALL GLenum GL_APIENTRY glGetGraphicsResetStatusEXT (void);
1584 GL_APICALL void GL_APIENTRY glReadnPixelsEXT (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid *data);
1585 GL_APICALL void GL_APIENTRY glGetnUniformfvEXT (GLuint program, GLint location, GLsizei bufSize, GLfloat *params);
1586 GL_APICALL void GL_APIENTRY glGetnUniformivEXT (GLuint program, GLint location, GLsizei bufSize, GLint *params);
1587 #endif
1588 typedef GLenum (GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSEXTPROC) (void);
1589 typedef void (GL_APIENTRYP PFNGLREADNPIXELSEXTPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid *data);
1590 typedef void (GL_APIENTRYP PFNGLGETNUNIFORMFVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params);
1591 typedef void (GL_APIENTRYP PFNGLGETNUNIFORMIVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params);
1592 #endif
1593
1594 /* GL_EXT_separate_shader_objects */
1595 #ifndef GL_EXT_separate_shader_objects
1596 #define GL_EXT_separate_shader_objects 1
1597 #ifdef GL_GLEXT_PROTOTYPES
1598 GL_APICALL void GL_APIENTRY glUseProgramStagesEXT (GLuint pipeline, GLbitfield stages, GLuint program);
1599 GL_APICALL void GL_APIENTRY glActiveShaderProgramEXT (GLuint pipeline, GLuint program);
1600 GL_APICALL GLuint GL_APIENTRY glCreateShaderProgramvEXT (GLenum type, GLsizei count, const GLchar **strings);
1601 GL_APICALL void GL_APIENTRY glBindProgramPipelineEXT (GLuint pipeline);
1602 GL_APICALL void GL_APIENTRY glDeleteProgramPipelinesEXT (GLsizei n, const GLuint *pipelines);
1603 GL_APICALL void GL_APIENTRY glGenProgramPipelinesEXT (GLsizei n, GLuint *pipelines);
1604 GL_APICALL GLboolean GL_APIENTRY glIsProgramPipelineEXT (GLuint pipeline);
1605 GL_APICALL void GL_APIENTRY glProgramParameteriEXT (GLuint program, GLenum pname, GLint value);
1606 GL_APICALL void GL_APIENTRY glGetProgramPipelineivEXT (GLuint pipeline, GLenum pname, GLint *params);
1607 GL_APICALL void GL_APIENTRY glProgramUniform1iEXT (GLuint program, GLint location, GLint x);
1608 GL_APICALL void GL_APIENTRY glProgramUniform2iEXT (GLuint program, GLint location, GLint x, GLint y);
1609 GL_APICALL void GL_APIENTRY glProgramUniform3iEXT (GLuint program, GLint location, GLint x, GLint y, GLint z);
1610 GL_APICALL void GL_APIENTRY glProgramUniform4iEXT (GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w);
1611 GL_APICALL void GL_APIENTRY glProgramUniform1fEXT (GLuint program, GLint location, GLfloat x);
1612 GL_APICALL void GL_APIENTRY glProgramUniform2fEXT (GLuint program, GLint location, GLfloat x, GLfloat y);
1613 GL_APICALL void GL_APIENTRY glProgramUniform3fEXT (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z);
1614 GL_APICALL void GL_APIENTRY glProgramUniform4fEXT (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
1615 GL_APICALL void GL_APIENTRY glProgramUniform1ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
1616 GL_APICALL void GL_APIENTRY glProgramUniform2ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
1617 GL_APICALL void GL_APIENTRY glProgramUniform3ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
1618 GL_APICALL void GL_APIENTRY glProgramUniform4ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value);
1619 GL_APICALL void GL_APIENTRY glProgramUniform1fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
1620 GL_APICALL void GL_APIENTRY glProgramUniform2fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
1621 GL_APICALL void GL_APIENTRY glProgramUniform3fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
1622 GL_APICALL void GL_APIENTRY glProgramUniform4fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value);
1623 GL_APICALL void GL_APIENTRY glProgramUniformMatrix2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
1624 GL_APICALL void GL_APIENTRY glProgramUniformMatrix3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
1625 GL_APICALL void GL_APIENTRY glProgramUniformMatrix4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
1626 GL_APICALL void GL_APIENTRY glValidateProgramPipelineEXT (GLuint pipeline);
1627 GL_APICALL void GL_APIENTRY glGetProgramPipelineInfoLogEXT (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
1628 #endif
1629 typedef void (GL_APIENTRYP PFNGLUSEPROGRAMSTAGESEXTPROC) (GLuint pipeline, GLbitfield stages, GLuint program);
1630 typedef void (GL_APIENTRYP PFNGLACTIVESHADERPROGRAMEXTPROC) (GLuint pipeline, GLuint program);
1631 typedef GLuint (GL_APIENTRYP PFNGLCREATESHADERPROGRAMVEXTPROC) (GLenum type, GLsizei count, const GLchar **strings);
1632 typedef void (GL_APIENTRYP PFNGLBINDPROGRAMPIPELINEEXTPROC) (GLuint pipeline);
1633 typedef void (GL_APIENTRYP PFNGLDELETEPROGRAMPIPELINESEXTPROC) (GLsizei n, const GLuint *pipelines);
1634 typedef void (GL_APIENTRYP PFNGLGENPROGRAMPIPELINESEXTPROC) (GLsizei n, GLuint *pipelines);
1635 typedef GLboolean (GL_APIENTRYP PFNGLISPROGRAMPIPELINEEXTPROC) (GLuint pipeline);
1636 typedef void (GL_APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value);
1637 typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEIVEXTPROC) (GLuint pipeline, GLenum pname, GLint *params);
1638 typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint x);
1639 typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint x, GLint y);
1640 typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z);
1641 typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w);
1642 typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat x);
1643 typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat x, GLfloat y);
1644 typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z);
1645 typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
1646 typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
1647 typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
1648 typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
1649 typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value);
1650 typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
1651 typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
1652 typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
1653 typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value);
1654 typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
1655 typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
1656 typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
1657 typedef void (GL_APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEEXTPROC) (GLuint pipeline);
1658 typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC) (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
1659 #endif
1660
1661 /* GL_EXT_shader_framebuffer_fetch */
1662 #ifndef GL_EXT_shader_framebuffer_fetch
1663 #define GL_EXT_shader_framebuffer_fetch 1
1664 #endif
1665
1666 /* GL_EXT_shader_texture_lod */
1667 #ifndef GL_EXT_shader_texture_lod
1668 #define GL_EXT_shader_texture_lod 1
1669 #endif
1670
1671 /* GL_EXT_shadow_samplers */
1672 #ifndef GL_EXT_shadow_samplers
1673 #define GL_EXT_shadow_samplers 1
1674 #endif
1675
1676 /* GL_EXT_sRGB */
1677 #ifndef GL_EXT_sRGB
1678 #define GL_EXT_sRGB 1
1679 #endif
1680
1681 /* GL_EXT_texture_compression_dxt1 */
1682 #ifndef GL_EXT_texture_compression_dxt1
1683 #define GL_EXT_texture_compression_dxt1 1
1684 #endif
1685
1686 /* GL_EXT_texture_filter_anisotropic */
1687 #ifndef GL_EXT_texture_filter_anisotropic
1688 #define GL_EXT_texture_filter_anisotropic 1
1689 #endif
1690
1691 /* GL_EXT_texture_format_BGRA8888 */
1692 #ifndef GL_EXT_texture_format_BGRA8888
1693 #define GL_EXT_texture_format_BGRA8888 1
1694 #endif
1695
1696 /* GL_EXT_texture_rg */
1697 #ifndef GL_EXT_texture_rg
1698 #define GL_EXT_texture_rg 1
1699 #endif
1700
1701 /* GL_EXT_texture_storage */
1702 #ifndef GL_EXT_texture_storage
1703 #define GL_EXT_texture_storage 1
1704 #ifdef GL_GLEXT_PROTOTYPES
1705 GL_APICALL void GL_APIENTRY glTexStorage1DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
1706 GL_APICALL void GL_APIENTRY glTexStorage2DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
1707 GL_APICALL void GL_APIENTRY glTexStorage3DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
1708 GL_APICALL void GL_APIENTRY glTextureStorage1DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
1709 GL_APICALL void GL_APIENTRY glTextureStorage2DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
1710 GL_APICALL void GL_APIENTRY glTextureStorage3DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
1711 #endif
1712 typedef void (GL_APIENTRYP PFNGLTEXSTORAGE1DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
1713 typedef void (GL_APIENTRYP PFNGLTEXSTORAGE2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
1714 typedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
1715 typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
1716 typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
1717 typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
1718 #endif
1719
1720 /* GL_EXT_texture_type_2_10_10_10_REV */
1721 #ifndef GL_EXT_texture_type_2_10_10_10_REV
1722 #define GL_EXT_texture_type_2_10_10_10_REV 1
1723 #endif
1724
1725 /* GL_EXT_unpack_subimage */
1726 #ifndef GL_EXT_unpack_subimage
1727 #define GL_EXT_unpack_subimage 1
1728 #endif
1729
1730 /*------------------------------------------------------------------------*
1731 * DMP extension functions
1732 *------------------------------------------------------------------------*/
1733
1734 /* GL_DMP_shader_binary */
1735 #ifndef GL_DMP_shader_binary
1736 #define GL_DMP_shader_binary 1
1737 #endif
1738
1739 /*------------------------------------------------------------------------*
1740 * FJ extension functions
1741 *------------------------------------------------------------------------*/
1742
1743 /* GL_FJ_shader_binary_GCCSO */
1744 #ifndef GL_FJ_shader_binary_GCCSO
1745 #define GL_FJ_shader_binary_GCCSO 1
1746 #endif
1747
1748 /*------------------------------------------------------------------------*
1749 * IMG extension functions
1750 *------------------------------------------------------------------------*/
1751
1752 /* GL_IMG_program_binary */
1753 #ifndef GL_IMG_program_binary
1754 #define GL_IMG_program_binary 1
1755 #endif
1756
1757 /* GL_IMG_read_format */
1758 #ifndef GL_IMG_read_format
1759 #define GL_IMG_read_format 1
1760 #endif
1761
1762 /* GL_IMG_shader_binary */
1763 #ifndef GL_IMG_shader_binary
1764 #define GL_IMG_shader_binary 1
1765 #endif
1766
1767 /* GL_IMG_texture_compression_pvrtc */
1768 #ifndef GL_IMG_texture_compression_pvrtc
1769 #define GL_IMG_texture_compression_pvrtc 1
1770 #endif
1771
1772 /* GL_IMG_texture_compression_pvrtc2 */
1773 #ifndef GL_IMG_texture_compression_pvrtc2
1774 #define GL_IMG_texture_compression_pvrtc2 1
1775 #endif
1776
1777 /* GL_IMG_multisampled_render_to_texture */
1778 #ifndef GL_IMG_multisampled_render_to_texture
1779 #define GL_IMG_multisampled_render_to_texture 1
1780 #ifdef GL_GLEXT_PROTOTYPES
1781 GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleIMG (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
1782 GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleIMG (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
1783 #endif
1784 typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMGPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
1785 typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMGPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
1786 #endif
1787
1788 /*------------------------------------------------------------------------*
1789 * NV extension functions
1790 *------------------------------------------------------------------------*/
1791
1792 /* GL_NV_coverage_sample */
1793 #ifndef GL_NV_coverage_sample
1794 #define GL_NV_coverage_sample 1
1795 #ifdef GL_GLEXT_PROTOTYPES
1796 GL_APICALL void GL_APIENTRY glCoverageMaskNV (GLboolean mask);
1797 GL_APICALL void GL_APIENTRY glCoverageOperationNV (GLenum operation);
1798 #endif
1799 typedef void (GL_APIENTRYP PFNGLCOVERAGEMASKNVPROC) (GLboolean mask);
1800 typedef void (GL_APIENTRYP PFNGLCOVERAGEOPERATIONNVPROC) (GLenum operation);
1801 #endif
1802
1803 /* GL_NV_depth_nonlinear */
1804 #ifndef GL_NV_depth_nonlinear
1805 #define GL_NV_depth_nonlinear 1
1806 #endif
1807
1808 /* GL_NV_draw_buffers */
1809 #ifndef GL_NV_draw_buffers
1810 #define GL_NV_draw_buffers 1
1811 #ifdef GL_GLEXT_PROTOTYPES
1812 GL_APICALL void GL_APIENTRY glDrawBuffersNV (GLsizei n, const GLenum *bufs);
1813 #endif
1814 typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSNVPROC) (GLsizei n, const GLenum *bufs);
1815 #endif
1816
1817 /* GL_NV_draw_instanced */
1818 #ifndef GL_NV_draw_instanced
1819 #define GL_NV_draw_instanced 1
1820 #ifdef GL_GLEXT_PROTOTYPES
1821 GL_APICALL void GL_APIENTRY glDrawArraysInstancedNV (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
1822 GL_APICALL void GL_APIENTRY glDrawElementsInstancedNV (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
1823 #endif
1824 typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDNVPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
1825 typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDNVPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
1826 #endif
1827
1828 /* GL_NV_fbo_color_attachments */
1829 #ifndef GL_NV_fbo_color_attachments
1830 #define GL_NV_fbo_color_attachments 1
1831 #endif
1832
1833 /* GL_NV_fence */
1834 #ifndef GL_NV_fence
1835 #define GL_NV_fence 1
1836 #ifdef GL_GLEXT_PROTOTYPES
1837 GL_APICALL void GL_APIENTRY glDeleteFencesNV (GLsizei n, const GLuint *fences);
1838 GL_APICALL void GL_APIENTRY glGenFencesNV (GLsizei n, GLuint *fences);
1839 GL_APICALL GLboolean GL_APIENTRY glIsFenceNV (GLuint fence);
1840 GL_APICALL GLboolean GL_APIENTRY glTestFenceNV (GLuint fence);
1841 GL_APICALL void GL_APIENTRY glGetFenceivNV (GLuint fence, GLenum pname, GLint *params);
1842 GL_APICALL void GL_APIENTRY glFinishFenceNV (GLuint fence);
1843 GL_APICALL void GL_APIENTRY glSetFenceNV (GLuint fence, GLenum condition);
1844 #endif
1845 typedef void (GL_APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences);
1846 typedef void (GL_APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences);
1847 typedef GLboolean (GL_APIENTRYP PFNGLISFENCENVPROC) (GLuint fence);
1848 typedef GLboolean (GL_APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence);
1849 typedef void (GL_APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params);
1850 typedef void (GL_APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence);
1851 typedef void (GL_APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition);
1852 #endif
1853
1854 /* GL_NV_framebuffer_blit */
1855 #ifndef GL_NV_framebuffer_blit
1856 #define GL_NV_framebuffer_blit 1
1857 #ifdef GL_GLEXT_PROTOTYPES
1858 GL_APICALL void GL_APIENTRY glBlitFramebufferNV (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
1859 #endif
1860 typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERNVPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
1861 #endif
1862
1863 /* GL_NV_framebuffer_multisample */
1864 #ifndef GL_NV_framebuffer_multisample
1865 #define GL_NV_framebuffer_multisample 1
1866 #ifdef GL_GLEXT_PROTOTYPES
1867 GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleNV ( GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
1868 #endif
1869 typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLENVPROC) ( GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
1870 #endif
1871
1872 /* GL_NV_generate_mipmap_sRGB */
1873 #ifndef GL_NV_generate_mipmap_sRGB
1874 #define GL_NV_generate_mipmap_sRGB 1
1875 #endif
1876
1877 /* GL_NV_instanced_arrays */
1878 #ifndef GL_NV_instanced_arrays
1879 #define GL_NV_instanced_arrays 1
1880 #ifdef GL_GLEXT_PROTOTYPES
1881 GL_APICALL void GL_APIENTRY glVertexAttribDivisorNV (GLuint index, GLuint divisor);
1882 #endif
1883 typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISORNVPROC) (GLuint index, GLuint divisor);
1884 #endif
1885
1886 /* GL_NV_read_buffer */
1887 #ifndef GL_NV_read_buffer
1888 #define GL_NV_read_buffer 1
1889 #ifdef GL_GLEXT_PROTOTYPES
1890 GL_APICALL void GL_APIENTRY glReadBufferNV (GLenum mode);
1891 #endif
1892 typedef void (GL_APIENTRYP PFNGLREADBUFFERNVPROC) (GLenum mode);
1893 #endif
1894
1895 /* GL_NV_read_buffer_front */
1896 #ifndef GL_NV_read_buffer_front
1897 #define GL_NV_read_buffer_front 1
1898 #endif
1899
1900 /* GL_NV_read_depth */
1901 #ifndef GL_NV_read_depth
1902 #define GL_NV_read_depth 1
1903 #endif
1904
1905 /* GL_NV_read_depth_stencil */
1906 #ifndef GL_NV_read_depth_stencil
1907 #define GL_NV_read_depth_stencil 1
1908 #endif
1909
1910 /* GL_NV_read_stencil */
1911 #ifndef GL_NV_read_stencil
1912 #define GL_NV_read_stencil 1
1913 #endif
1914
1915 /* GL_NV_shadow_samplers_array */
1916 #ifndef GL_NV_shadow_samplers_array
1917 #define GL_NV_shadow_samplers_array 1
1918 #endif
1919
1920 /* GL_NV_shadow_samplers_cube */
1921 #ifndef GL_NV_shadow_samplers_cube
1922 #define GL_NV_shadow_samplers_cube 1
1923 #endif
1924
1925 /* GL_NV_sRGB_formats */
1926 #ifndef GL_NV_sRGB_formats
1927 #define GL_NV_sRGB_formats 1
1928 #endif
1929
1930 /* GL_NV_texture_border_clamp */
1931 #ifndef GL_NV_texture_border_clamp
1932 #define GL_NV_texture_border_clamp 1
1933 #endif
1934
1935 /* GL_NV_texture_compression_s3tc_update */
1936 #ifndef GL_NV_texture_compression_s3tc_update
1937 #define GL_NV_texture_compression_s3tc_update 1
1938 #endif
1939
1940 /* GL_NV_texture_npot_2D_mipmap */
1941 #ifndef GL_NV_texture_npot_2D_mipmap
1942 #define GL_NV_texture_npot_2D_mipmap 1
1943 #endif
1944
1945 /*------------------------------------------------------------------------*
1946 * QCOM extension functions
1947 *------------------------------------------------------------------------*/
1948
1949 /* GL_QCOM_alpha_test */
1950 #ifndef GL_QCOM_alpha_test
1951 #define GL_QCOM_alpha_test 1
1952 #ifdef GL_GLEXT_PROTOTYPES
1953 GL_APICALL void GL_APIENTRY glAlphaFuncQCOM (GLenum func, GLclampf ref);
1954 #endif
1955 typedef void (GL_APIENTRYP PFNGLALPHAFUNCQCOMPROC) (GLenum func, GLclampf ref);
1956 #endif
1957
1958 /* GL_QCOM_binning_control */
1959 #ifndef GL_QCOM_binning_control
1960 #define GL_QCOM_binning_control 1
1961 #endif
1962
1963 /* GL_QCOM_driver_control */
1964 #ifndef GL_QCOM_driver_control
1965 #define GL_QCOM_driver_control 1
1966 #ifdef GL_GLEXT_PROTOTYPES
1967 GL_APICALL void GL_APIENTRY glGetDriverControlsQCOM (GLint *num, GLsizei size, GLuint *driverControls);
1968 GL_APICALL void GL_APIENTRY glGetDriverControlStringQCOM (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString);
1969 GL_APICALL void GL_APIENTRY glEnableDriverControlQCOM (GLuint driverControl);
1970 GL_APICALL void GL_APIENTRY glDisableDriverControlQCOM (GLuint driverControl);
1971 #endif
1972 typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSQCOMPROC) (GLint *num, GLsizei size, GLuint *driverControls);
1973 typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSTRINGQCOMPROC) (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString);
1974 typedef void (GL_APIENTRYP PFNGLENABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl);
1975 typedef void (GL_APIENTRYP PFNGLDISABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl);
1976 #endif
1977
1978 /* GL_QCOM_extended_get */
1979 #ifndef GL_QCOM_extended_get
1980 #define GL_QCOM_extended_get 1
1981 #ifdef GL_GLEXT_PROTOTYPES
1982 GL_APICALL void GL_APIENTRY glExtGetTexturesQCOM (GLuint *textures, GLint maxTextures, GLint *numTextures);
1983 GL_APICALL void GL_APIENTRY glExtGetBuffersQCOM (GLuint *buffers, GLint maxBuffers, GLint *numBuffers);
1984 GL_APICALL void GL_APIENTRY glExtGetRenderbuffersQCOM (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers);
1985 GL_APICALL void GL_APIENTRY glExtGetFramebuffersQCOM (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers);
1986 GL_APICALL void GL_APIENTRY glExtGetTexLevelParameterivQCOM (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params);
1987 GL_APICALL void GL_APIENTRY glExtTexObjectStateOverrideiQCOM (GLenum target, GLenum pname, GLint param);
1988 GL_APICALL void GL_APIENTRY glExtGetTexSubImageQCOM (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels);
1989 GL_APICALL void GL_APIENTRY glExtGetBufferPointervQCOM (GLenum target, GLvoid **params);
1990 #endif
1991 typedef void (GL_APIENTRYP PFNGLEXTGETTEXTURESQCOMPROC) (GLuint *textures, GLint maxTextures, GLint *numTextures);
1992 typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERSQCOMPROC) (GLuint *buffers, GLint maxBuffers, GLint *numBuffers);
1993 typedef void (GL_APIENTRYP PFNGLEXTGETRENDERBUFFERSQCOMPROC) (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers);
1994 typedef void (GL_APIENTRYP PFNGLEXTGETFRAMEBUFFERSQCOMPROC) (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers);
1995 typedef void (GL_APIENTRYP PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC) (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params);
1996 typedef void (GL_APIENTRYP PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC) (GLenum target, GLenum pname, GLint param);
1997 typedef void (GL_APIENTRYP PFNGLEXTGETTEXSUBIMAGEQCOMPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels);
1998 typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERPOINTERVQCOMPROC) (GLenum target, GLvoid **params);
1999 #endif
2000
2001 /* GL_QCOM_extended_get2 */
2002 #ifndef GL_QCOM_extended_get2
2003 #define GL_QCOM_extended_get2 1
2004 #ifdef GL_GLEXT_PROTOTYPES
2005 GL_APICALL void GL_APIENTRY glExtGetShadersQCOM (GLuint *shaders, GLint maxShaders, GLint *numShaders);
2006 GL_APICALL void GL_APIENTRY glExtGetProgramsQCOM (GLuint *programs, GLint maxPrograms, GLint *numPrograms);
2007 GL_APICALL GLboolean GL_APIENTRY glExtIsProgramBinaryQCOM (GLuint program);
2008 GL_APICALL void GL_APIENTRY glExtGetProgramBinarySourceQCOM (GLuint program, GLenum shadertype, GLchar *source, GLint *length);
2009 #endif
2010 typedef void (GL_APIENTRYP PFNGLEXTGETSHADERSQCOMPROC) (GLuint *shaders, GLint maxShaders, GLint *numShaders);
2011 typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMSQCOMPROC) (GLuint *programs, GLint maxPrograms, GLint *numPrograms);
2012 typedef GLboolean (GL_APIENTRYP PFNGLEXTISPROGRAMBINARYQCOMPROC) (GLuint program);
2013 typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC) (GLuint program, GLenum shadertype, GLchar *source, GLint *length);
2014 #endif
2015
2016 /* GL_QCOM_perfmon_global_mode */
2017 #ifndef GL_QCOM_perfmon_global_mode
2018 #define GL_QCOM_perfmon_global_mode 1
2019 #endif
2020
2021 /* GL_QCOM_writeonly_rendering */
2022 #ifndef GL_QCOM_writeonly_rendering
2023 #define GL_QCOM_writeonly_rendering 1
2024 #endif
2025
2026 /* GL_QCOM_tiled_rendering */
2027 #ifndef GL_QCOM_tiled_rendering
2028 #define GL_QCOM_tiled_rendering 1
2029 #ifdef GL_GLEXT_PROTOTYPES
2030 GL_APICALL void GL_APIENTRY glStartTilingQCOM (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask);
2031 GL_APICALL void GL_APIENTRY glEndTilingQCOM (GLbitfield preserveMask);
2032 #endif
2033 typedef void (GL_APIENTRYP PFNGLSTARTTILINGQCOMPROC) (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask);
2034 typedef void (GL_APIENTRYP PFNGLENDTILINGQCOMPROC) (GLbitfield preserveMask);
2035 #endif
2036
2037 /*------------------------------------------------------------------------*
2038 * VIV extension tokens
2039 *------------------------------------------------------------------------*/
2040
2041 /* GL_VIV_shader_binary */
2042 #ifndef GL_VIV_shader_binary
2043 #define GL_VIV_shader_binary 1
2044 #endif
2045
2046 #ifdef __cplusplus
2047 }
2048 #endif
2049
2050 #endif /* __gl2ext_h_ */
File include/SDL2/SDL_opengles2_gl2platform.h added (mode: 100644) (index 0000000..c325686)
1 #ifndef __gl2platform_h_
2 #define __gl2platform_h_
3
4 /* $Revision: 10602 $ on $Date:: 2010-03-04 22:35:34 -0800 #$ */
5
6 /*
7 * This document is licensed under the SGI Free Software B License Version
8 * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
9 */
10
11 /* Platform-specific types and definitions for OpenGL ES 2.X gl2.h
12 *
13 * Adopters may modify khrplatform.h and this file to suit their platform.
14 * You are encouraged to submit all modifications to the Khronos group so that
15 * they can be included in future versions of this file. Please submit changes
16 * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
17 * by filing a bug against product "OpenGL-ES" component "Registry".
18 */
19
20 /*#include <KHR/khrplatform.h>*/
21
22 #ifndef GL_APICALL
23 #define GL_APICALL KHRONOS_APICALL
24 #endif
25
26 #ifndef GL_APIENTRY
27 #define GL_APIENTRY KHRONOS_APIENTRY
28 #endif
29
30 #endif /* __gl2platform_h_ */
File include/SDL2/SDL_opengles2_khrplatform.h added (mode: 100644) (index 0000000..c9e6f17)
1 #ifndef __khrplatform_h_
2 #define __khrplatform_h_
3
4 /*
5 ** Copyright (c) 2008-2009 The Khronos Group Inc.
6 **
7 ** Permission is hereby granted, free of charge, to any person obtaining a
8 ** copy of this software and/or associated documentation files (the
9 ** "Materials"), to deal in the Materials without restriction, including
10 ** without limitation the rights to use, copy, modify, merge, publish,
11 ** distribute, sublicense, and/or sell copies of the Materials, and to
12 ** permit persons to whom the Materials are furnished to do so, subject to
13 ** the following conditions:
14 **
15 ** The above copyright notice and this permission notice shall be included
16 ** in all copies or substantial portions of the Materials.
17 **
18 ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19 ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21 ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
22 ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
25 */
26
27 /* Khronos platform-specific types and definitions.
28 *
29 * $Revision: 23298 $ on $Date: 2013-09-30 17:07:13 -0700 (Mon, 30 Sep 2013) $
30 *
31 * Adopters may modify this file to suit their platform. Adopters are
32 * encouraged to submit platform specific modifications to the Khronos
33 * group so that they can be included in future versions of this file.
34 * Please submit changes by sending them to the public Khronos Bugzilla
35 * (http://khronos.org/bugzilla) by filing a bug against product
36 * "Khronos (general)" component "Registry".
37 *
38 * A predefined template which fills in some of the bug fields can be
39 * reached using http://tinyurl.com/khrplatform-h-bugreport, but you
40 * must create a Bugzilla login first.
41 *
42 *
43 * See the Implementer's Guidelines for information about where this file
44 * should be located on your system and for more details of its use:
45 * http://www.khronos.org/registry/implementers_guide.pdf
46 *
47 * This file should be included as
48 * #include <KHR/khrplatform.h>
49 * by Khronos client API header files that use its types and defines.
50 *
51 * The types in khrplatform.h should only be used to define API-specific types.
52 *
53 * Types defined in khrplatform.h:
54 * khronos_int8_t signed 8 bit
55 * khronos_uint8_t unsigned 8 bit
56 * khronos_int16_t signed 16 bit
57 * khronos_uint16_t unsigned 16 bit
58 * khronos_int32_t signed 32 bit
59 * khronos_uint32_t unsigned 32 bit
60 * khronos_int64_t signed 64 bit
61 * khronos_uint64_t unsigned 64 bit
62 * khronos_intptr_t signed same number of bits as a pointer
63 * khronos_uintptr_t unsigned same number of bits as a pointer
64 * khronos_ssize_t signed size
65 * khronos_usize_t unsigned size
66 * khronos_float_t signed 32 bit floating point
67 * khronos_time_ns_t unsigned 64 bit time in nanoseconds
68 * khronos_utime_nanoseconds_t unsigned time interval or absolute time in
69 * nanoseconds
70 * khronos_stime_nanoseconds_t signed time interval in nanoseconds
71 * khronos_boolean_enum_t enumerated boolean type. This should
72 * only be used as a base type when a client API's boolean type is
73 * an enum. Client APIs which use an integer or other type for
74 * booleans cannot use this as the base type for their boolean.
75 *
76 * Tokens defined in khrplatform.h:
77 *
78 * KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values.
79 *
80 * KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0.
81 * KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0.
82 *
83 * Calling convention macros defined in this file:
84 * KHRONOS_APICALL
85 * KHRONOS_APIENTRY
86 * KHRONOS_APIATTRIBUTES
87 *
88 * These may be used in function prototypes as:
89 *
90 * KHRONOS_APICALL void KHRONOS_APIENTRY funcname(
91 * int arg1,
92 * int arg2) KHRONOS_APIATTRIBUTES;
93 */
94
95 /*-------------------------------------------------------------------------
96 * Definition of KHRONOS_APICALL
97 *-------------------------------------------------------------------------
98 * This precedes the return type of the function in the function prototype.
99 */
100 #if defined(_WIN32) && !defined(__SCITECH_SNAP__)
101 # define KHRONOS_APICALL __declspec(dllimport)
102 #elif defined (__SYMBIAN32__)
103 # define KHRONOS_APICALL IMPORT_C
104 #else
105 # define KHRONOS_APICALL
106 #endif
107
108 /*-------------------------------------------------------------------------
109 * Definition of KHRONOS_APIENTRY
110 *-------------------------------------------------------------------------
111 * This follows the return type of the function and precedes the function
112 * name in the function prototype.
113 */
114 #if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__)
115 /* Win32 but not WinCE */
116 # define KHRONOS_APIENTRY __stdcall
117 #else
118 # define KHRONOS_APIENTRY
119 #endif
120
121 /*-------------------------------------------------------------------------
122 * Definition of KHRONOS_APIATTRIBUTES
123 *-------------------------------------------------------------------------
124 * This follows the closing parenthesis of the function prototype arguments.
125 */
126 #if defined (__ARMCC_2__)
127 #define KHRONOS_APIATTRIBUTES __softfp
128 #else
129 #define KHRONOS_APIATTRIBUTES
130 #endif
131
132 /*-------------------------------------------------------------------------
133 * basic type definitions
134 *-----------------------------------------------------------------------*/
135 #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__)
136
137
138 /*
139 * Using <stdint.h>
140 */
141 #include <stdint.h>
142 typedef int32_t khronos_int32_t;
143 typedef uint32_t khronos_uint32_t;
144 typedef int64_t khronos_int64_t;
145 typedef uint64_t khronos_uint64_t;
146 #define KHRONOS_SUPPORT_INT64 1
147 #define KHRONOS_SUPPORT_FLOAT 1
148
149 #elif defined(__VMS ) || defined(__sgi)
150
151 /*
152 * Using <inttypes.h>
153 */
154 #include <inttypes.h>
155 typedef int32_t khronos_int32_t;
156 typedef uint32_t khronos_uint32_t;
157 typedef int64_t khronos_int64_t;
158 typedef uint64_t khronos_uint64_t;
159 #define KHRONOS_SUPPORT_INT64 1
160 #define KHRONOS_SUPPORT_FLOAT 1
161
162 #elif defined(_WIN32) && !defined(__SCITECH_SNAP__)
163
164 /*
165 * Win32
166 */
167 typedef __int32 khronos_int32_t;
168 typedef unsigned __int32 khronos_uint32_t;
169 typedef __int64 khronos_int64_t;
170 typedef unsigned __int64 khronos_uint64_t;
171 #define KHRONOS_SUPPORT_INT64 1
172 #define KHRONOS_SUPPORT_FLOAT 1
173
174 #elif defined(__sun__) || defined(__digital__)
175
176 /*
177 * Sun or Digital
178 */
179 typedef int khronos_int32_t;
180 typedef unsigned int khronos_uint32_t;
181 #if defined(__arch64__) || defined(_LP64)
182 typedef long int khronos_int64_t;
183 typedef unsigned long int khronos_uint64_t;
184 #else
185 typedef long long int khronos_int64_t;
186 typedef unsigned long long int khronos_uint64_t;
187 #endif /* __arch64__ */
188 #define KHRONOS_SUPPORT_INT64 1
189 #define KHRONOS_SUPPORT_FLOAT 1
190
191 #elif 0
192
193 /*
194 * Hypothetical platform with no float or int64 support
195 */
196 typedef int khronos_int32_t;
197 typedef unsigned int khronos_uint32_t;
198 #define KHRONOS_SUPPORT_INT64 0
199 #define KHRONOS_SUPPORT_FLOAT 0
200
201 #else
202
203 /*
204 * Generic fallback
205 */
206 #include <stdint.h>
207 typedef int32_t khronos_int32_t;
208 typedef uint32_t khronos_uint32_t;
209 typedef int64_t khronos_int64_t;
210 typedef uint64_t khronos_uint64_t;
211 #define KHRONOS_SUPPORT_INT64 1
212 #define KHRONOS_SUPPORT_FLOAT 1
213
214 #endif
215
216
217 /*
218 * Types that are (so far) the same on all platforms
219 */
220 typedef signed char khronos_int8_t;
221 typedef unsigned char khronos_uint8_t;
222 typedef signed short int khronos_int16_t;
223 typedef unsigned short int khronos_uint16_t;
224
225 /*
226 * Types that differ between LLP64 and LP64 architectures - in LLP64,
227 * pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
228 * to be the only LLP64 architecture in current use.
229 */
230 #ifdef _WIN64
231 typedef signed long long int khronos_intptr_t;
232 typedef unsigned long long int khronos_uintptr_t;
233 typedef signed long long int khronos_ssize_t;
234 typedef unsigned long long int khronos_usize_t;
235 #else
236 typedef signed long int khronos_intptr_t;
237 typedef unsigned long int khronos_uintptr_t;
238 typedef signed long int khronos_ssize_t;
239 typedef unsigned long int khronos_usize_t;
240 #endif
241
242 #if KHRONOS_SUPPORT_FLOAT
243 /*
244 * Float type
245 */
246 typedef float khronos_float_t;
247 #endif
248
249 #if KHRONOS_SUPPORT_INT64
250 /* Time types
251 *
252 * These types can be used to represent a time interval in nanoseconds or
253 * an absolute Unadjusted System Time. Unadjusted System Time is the number
254 * of nanoseconds since some arbitrary system event (e.g. since the last
255 * time the system booted). The Unadjusted System Time is an unsigned
256 * 64 bit value that wraps back to 0 every 584 years. Time intervals
257 * may be either signed or unsigned.
258 */
259 typedef khronos_uint64_t khronos_utime_nanoseconds_t;
260 typedef khronos_int64_t khronos_stime_nanoseconds_t;
261 #endif
262
263 /*
264 * Dummy value used to pad enum types to 32 bits.
265 */
266 #ifndef KHRONOS_MAX_ENUM
267 #define KHRONOS_MAX_ENUM 0x7FFFFFFF
268 #endif
269
270 /*
271 * Enumerated boolean type
272 *
273 * Values other than zero should be considered to be true. Therefore
274 * comparisons should not be made against KHRONOS_TRUE.
275 */
276 typedef enum {
277 KHRONOS_FALSE = 0,
278 KHRONOS_TRUE = 1,
279 KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM
280 } khronos_boolean_enum_t;
281
282 #endif /* __khrplatform_h_ */
File include/SDL2/SDL_pixels.h added (mode: 100644) (index 0000000..aa90cbc)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_pixels.h
24 *
25 * Header for the enumerated pixel format definitions.
26 */
27
28 #ifndef SDL_pixels_h_
29 #define SDL_pixels_h_
30
31 #include "SDL_stdinc.h"
32 #include "SDL_endian.h"
33
34 #include "begin_code.h"
35 /* Set up for C function definitions, even when using C++ */
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39
40 /**
41 * \name Transparency definitions
42 *
43 * These define alpha as the opacity of a surface.
44 */
45 /* @{ */
46 #define SDL_ALPHA_OPAQUE 255
47 #define SDL_ALPHA_TRANSPARENT 0
48 /* @} */
49
50 /** Pixel type. */
51 typedef enum
52 {
53 SDL_PIXELTYPE_UNKNOWN,
54 SDL_PIXELTYPE_INDEX1,
55 SDL_PIXELTYPE_INDEX4,
56 SDL_PIXELTYPE_INDEX8,
57 SDL_PIXELTYPE_PACKED8,
58 SDL_PIXELTYPE_PACKED16,
59 SDL_PIXELTYPE_PACKED32,
60 SDL_PIXELTYPE_ARRAYU8,
61 SDL_PIXELTYPE_ARRAYU16,
62 SDL_PIXELTYPE_ARRAYU32,
63 SDL_PIXELTYPE_ARRAYF16,
64 SDL_PIXELTYPE_ARRAYF32
65 } SDL_PixelType;
66
67 /** Bitmap pixel order, high bit -> low bit. */
68 typedef enum
69 {
70 SDL_BITMAPORDER_NONE,
71 SDL_BITMAPORDER_4321,
72 SDL_BITMAPORDER_1234
73 } SDL_BitmapOrder;
74
75 /** Packed component order, high bit -> low bit. */
76 typedef enum
77 {
78 SDL_PACKEDORDER_NONE,
79 SDL_PACKEDORDER_XRGB,
80 SDL_PACKEDORDER_RGBX,
81 SDL_PACKEDORDER_ARGB,
82 SDL_PACKEDORDER_RGBA,
83 SDL_PACKEDORDER_XBGR,
84 SDL_PACKEDORDER_BGRX,
85 SDL_PACKEDORDER_ABGR,
86 SDL_PACKEDORDER_BGRA
87 } SDL_PackedOrder;
88
89 /** Array component order, low byte -> high byte. */
90 /* !!! FIXME: in 2.1, make these not overlap differently with
91 !!! FIXME: SDL_PACKEDORDER_*, so we can simplify SDL_ISPIXELFORMAT_ALPHA */
92 typedef enum
93 {
94 SDL_ARRAYORDER_NONE,
95 SDL_ARRAYORDER_RGB,
96 SDL_ARRAYORDER_RGBA,
97 SDL_ARRAYORDER_ARGB,
98 SDL_ARRAYORDER_BGR,
99 SDL_ARRAYORDER_BGRA,
100 SDL_ARRAYORDER_ABGR
101 } SDL_ArrayOrder;
102
103 /** Packed component layout. */
104 typedef enum
105 {
106 SDL_PACKEDLAYOUT_NONE,
107 SDL_PACKEDLAYOUT_332,
108 SDL_PACKEDLAYOUT_4444,
109 SDL_PACKEDLAYOUT_1555,
110 SDL_PACKEDLAYOUT_5551,
111 SDL_PACKEDLAYOUT_565,
112 SDL_PACKEDLAYOUT_8888,
113 SDL_PACKEDLAYOUT_2101010,
114 SDL_PACKEDLAYOUT_1010102
115 } SDL_PackedLayout;
116
117 #define SDL_DEFINE_PIXELFOURCC(A, B, C, D) SDL_FOURCC(A, B, C, D)
118
119 #define SDL_DEFINE_PIXELFORMAT(type, order, layout, bits, bytes) \
120 ((1 << 28) | ((type) << 24) | ((order) << 20) | ((layout) << 16) | \
121 ((bits) << 8) | ((bytes) << 0))
122
123 #define SDL_PIXELFLAG(X) (((X) >> 28) & 0x0F)
124 #define SDL_PIXELTYPE(X) (((X) >> 24) & 0x0F)
125 #define SDL_PIXELORDER(X) (((X) >> 20) & 0x0F)
126 #define SDL_PIXELLAYOUT(X) (((X) >> 16) & 0x0F)
127 #define SDL_BITSPERPIXEL(X) (((X) >> 8) & 0xFF)
128 #define SDL_BYTESPERPIXEL(X) \
129 (SDL_ISPIXELFORMAT_FOURCC(X) ? \
130 ((((X) == SDL_PIXELFORMAT_YUY2) || \
131 ((X) == SDL_PIXELFORMAT_UYVY) || \
132 ((X) == SDL_PIXELFORMAT_YVYU)) ? 2 : 1) : (((X) >> 0) & 0xFF))
133
134 #define SDL_ISPIXELFORMAT_INDEXED(format) \
135 (!SDL_ISPIXELFORMAT_FOURCC(format) && \
136 ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX1) || \
137 (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX4) || \
138 (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX8)))
139
140 #define SDL_ISPIXELFORMAT_PACKED(format) \
141 (!SDL_ISPIXELFORMAT_FOURCC(format) && \
142 ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED8) || \
143 (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED16) || \
144 (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED32)))
145
146 #define SDL_ISPIXELFORMAT_ARRAY(format) \
147 (!SDL_ISPIXELFORMAT_FOURCC(format) && \
148 ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU8) || \
149 (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU16) || \
150 (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU32) || \
151 (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF16) || \
152 (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF32)))
153
154 #define SDL_ISPIXELFORMAT_ALPHA(format) \
155 ((SDL_ISPIXELFORMAT_PACKED(format) && \
156 ((SDL_PIXELORDER(format) == SDL_PACKEDORDER_ARGB) || \
157 (SDL_PIXELORDER(format) == SDL_PACKEDORDER_RGBA) || \
158 (SDL_PIXELORDER(format) == SDL_PACKEDORDER_ABGR) || \
159 (SDL_PIXELORDER(format) == SDL_PACKEDORDER_BGRA))) || \
160 (SDL_ISPIXELFORMAT_ARRAY(format) && \
161 ((SDL_PIXELORDER(format) == SDL_ARRAYORDER_ARGB) || \
162 (SDL_PIXELORDER(format) == SDL_ARRAYORDER_RGBA) || \
163 (SDL_PIXELORDER(format) == SDL_ARRAYORDER_ABGR) || \
164 (SDL_PIXELORDER(format) == SDL_ARRAYORDER_BGRA))))
165
166 /* The flag is set to 1 because 0x1? is not in the printable ASCII range */
167 #define SDL_ISPIXELFORMAT_FOURCC(format) \
168 ((format) && (SDL_PIXELFLAG(format) != 1))
169
170 /* Note: If you modify this list, update SDL_GetPixelFormatName() */
171 typedef enum
172 {
173 SDL_PIXELFORMAT_UNKNOWN,
174 SDL_PIXELFORMAT_INDEX1LSB =
175 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_4321, 0,
176 1, 0),
177 SDL_PIXELFORMAT_INDEX1MSB =
178 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_1234, 0,
179 1, 0),
180 SDL_PIXELFORMAT_INDEX4LSB =
181 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_4321, 0,
182 4, 0),
183 SDL_PIXELFORMAT_INDEX4MSB =
184 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_1234, 0,
185 4, 0),
186 SDL_PIXELFORMAT_INDEX8 =
187 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX8, 0, 0, 8, 1),
188 SDL_PIXELFORMAT_RGB332 =
189 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED8, SDL_PACKEDORDER_XRGB,
190 SDL_PACKEDLAYOUT_332, 8, 1),
191 SDL_PIXELFORMAT_XRGB4444 =
192 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB,
193 SDL_PACKEDLAYOUT_4444, 12, 2),
194 SDL_PIXELFORMAT_RGB444 = SDL_PIXELFORMAT_XRGB4444,
195 SDL_PIXELFORMAT_XBGR4444 =
196 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR,
197 SDL_PACKEDLAYOUT_4444, 12, 2),
198 SDL_PIXELFORMAT_BGR444 = SDL_PIXELFORMAT_XBGR4444,
199 SDL_PIXELFORMAT_XRGB1555 =
200 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB,
201 SDL_PACKEDLAYOUT_1555, 15, 2),
202 SDL_PIXELFORMAT_RGB555 = SDL_PIXELFORMAT_XRGB1555,
203 SDL_PIXELFORMAT_XBGR1555 =
204 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR,
205 SDL_PACKEDLAYOUT_1555, 15, 2),
206 SDL_PIXELFORMAT_BGR555 = SDL_PIXELFORMAT_XBGR1555,
207 SDL_PIXELFORMAT_ARGB4444 =
208 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB,
209 SDL_PACKEDLAYOUT_4444, 16, 2),
210 SDL_PIXELFORMAT_RGBA4444 =
211 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA,
212 SDL_PACKEDLAYOUT_4444, 16, 2),
213 SDL_PIXELFORMAT_ABGR4444 =
214 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR,
215 SDL_PACKEDLAYOUT_4444, 16, 2),
216 SDL_PIXELFORMAT_BGRA4444 =
217 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA,
218 SDL_PACKEDLAYOUT_4444, 16, 2),
219 SDL_PIXELFORMAT_ARGB1555 =
220 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB,
221 SDL_PACKEDLAYOUT_1555, 16, 2),
222 SDL_PIXELFORMAT_RGBA5551 =
223 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA,
224 SDL_PACKEDLAYOUT_5551, 16, 2),
225 SDL_PIXELFORMAT_ABGR1555 =
226 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR,
227 SDL_PACKEDLAYOUT_1555, 16, 2),
228 SDL_PIXELFORMAT_BGRA5551 =
229 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA,
230 SDL_PACKEDLAYOUT_5551, 16, 2),
231 SDL_PIXELFORMAT_RGB565 =
232 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB,
233 SDL_PACKEDLAYOUT_565, 16, 2),
234 SDL_PIXELFORMAT_BGR565 =
235 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR,
236 SDL_PACKEDLAYOUT_565, 16, 2),
237 SDL_PIXELFORMAT_RGB24 =
238 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_RGB, 0,
239 24, 3),
240 SDL_PIXELFORMAT_BGR24 =
241 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_BGR, 0,
242 24, 3),
243 SDL_PIXELFORMAT_XRGB8888 =
244 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XRGB,
245 SDL_PACKEDLAYOUT_8888, 24, 4),
246 SDL_PIXELFORMAT_RGB888 = SDL_PIXELFORMAT_XRGB8888,
247 SDL_PIXELFORMAT_RGBX8888 =
248 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBX,
249 SDL_PACKEDLAYOUT_8888, 24, 4),
250 SDL_PIXELFORMAT_XBGR8888 =
251 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XBGR,
252 SDL_PACKEDLAYOUT_8888, 24, 4),
253 SDL_PIXELFORMAT_BGR888 = SDL_PIXELFORMAT_XBGR8888,
254 SDL_PIXELFORMAT_BGRX8888 =
255 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRX,
256 SDL_PACKEDLAYOUT_8888, 24, 4),
257 SDL_PIXELFORMAT_ARGB8888 =
258 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB,
259 SDL_PACKEDLAYOUT_8888, 32, 4),
260 SDL_PIXELFORMAT_RGBA8888 =
261 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBA,
262 SDL_PACKEDLAYOUT_8888, 32, 4),
263 SDL_PIXELFORMAT_ABGR8888 =
264 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ABGR,
265 SDL_PACKEDLAYOUT_8888, 32, 4),
266 SDL_PIXELFORMAT_BGRA8888 =
267 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRA,
268 SDL_PACKEDLAYOUT_8888, 32, 4),
269 SDL_PIXELFORMAT_ARGB2101010 =
270 SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB,
271 SDL_PACKEDLAYOUT_2101010, 32, 4),
272
273 /* Aliases for RGBA byte arrays of color data, for the current platform */
274 #if SDL_BYTEORDER == SDL_BIG_ENDIAN
275 SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_RGBA8888,
276 SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_ARGB8888,
277 SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_BGRA8888,
278 SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_ABGR8888,
279 #else
280 SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_ABGR8888,
281 SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_BGRA8888,
282 SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_ARGB8888,
283 SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_RGBA8888,
284 #endif
285
286 SDL_PIXELFORMAT_YV12 = /**< Planar mode: Y + V + U (3 planes) */
287 SDL_DEFINE_PIXELFOURCC('Y', 'V', '1', '2'),
288 SDL_PIXELFORMAT_IYUV = /**< Planar mode: Y + U + V (3 planes) */
289 SDL_DEFINE_PIXELFOURCC('I', 'Y', 'U', 'V'),
290 SDL_PIXELFORMAT_YUY2 = /**< Packed mode: Y0+U0+Y1+V0 (1 plane) */
291 SDL_DEFINE_PIXELFOURCC('Y', 'U', 'Y', '2'),
292 SDL_PIXELFORMAT_UYVY = /**< Packed mode: U0+Y0+V0+Y1 (1 plane) */
293 SDL_DEFINE_PIXELFOURCC('U', 'Y', 'V', 'Y'),
294 SDL_PIXELFORMAT_YVYU = /**< Packed mode: Y0+V0+Y1+U0 (1 plane) */
295 SDL_DEFINE_PIXELFOURCC('Y', 'V', 'Y', 'U'),
296 SDL_PIXELFORMAT_NV12 = /**< Planar mode: Y + U/V interleaved (2 planes) */
297 SDL_DEFINE_PIXELFOURCC('N', 'V', '1', '2'),
298 SDL_PIXELFORMAT_NV21 = /**< Planar mode: Y + V/U interleaved (2 planes) */
299 SDL_DEFINE_PIXELFOURCC('N', 'V', '2', '1'),
300 SDL_PIXELFORMAT_EXTERNAL_OES = /**< Android video texture format */
301 SDL_DEFINE_PIXELFOURCC('O', 'E', 'S', ' ')
302 } SDL_PixelFormatEnum;
303
304 typedef struct SDL_Color
305 {
306 Uint8 r;
307 Uint8 g;
308 Uint8 b;
309 Uint8 a;
310 } SDL_Color;
311 #define SDL_Colour SDL_Color
312
313 typedef struct SDL_Palette
314 {
315 int ncolors;
316 SDL_Color *colors;
317 Uint32 version;
318 int refcount;
319 } SDL_Palette;
320
321 /**
322 * \note Everything in the pixel format structure is read-only.
323 */
324 typedef struct SDL_PixelFormat
325 {
326 Uint32 format;
327 SDL_Palette *palette;
328 Uint8 BitsPerPixel;
329 Uint8 BytesPerPixel;
330 Uint8 padding[2];
331 Uint32 Rmask;
332 Uint32 Gmask;
333 Uint32 Bmask;
334 Uint32 Amask;
335 Uint8 Rloss;
336 Uint8 Gloss;
337 Uint8 Bloss;
338 Uint8 Aloss;
339 Uint8 Rshift;
340 Uint8 Gshift;
341 Uint8 Bshift;
342 Uint8 Ashift;
343 int refcount;
344 struct SDL_PixelFormat *next;
345 } SDL_PixelFormat;
346
347 /**
348 * \brief Get the human readable name of a pixel format
349 */
350 extern DECLSPEC const char* SDLCALL SDL_GetPixelFormatName(Uint32 format);
351
352 /**
353 * \brief Convert one of the enumerated pixel formats to a bpp and RGBA masks.
354 *
355 * \return SDL_TRUE, or SDL_FALSE if the conversion wasn't possible.
356 *
357 * \sa SDL_MasksToPixelFormatEnum()
358 */
359 extern DECLSPEC SDL_bool SDLCALL SDL_PixelFormatEnumToMasks(Uint32 format,
360 int *bpp,
361 Uint32 * Rmask,
362 Uint32 * Gmask,
363 Uint32 * Bmask,
364 Uint32 * Amask);
365
366 /**
367 * \brief Convert a bpp and RGBA masks to an enumerated pixel format.
368 *
369 * \return The pixel format, or ::SDL_PIXELFORMAT_UNKNOWN if the conversion
370 * wasn't possible.
371 *
372 * \sa SDL_PixelFormatEnumToMasks()
373 */
374 extern DECLSPEC Uint32 SDLCALL SDL_MasksToPixelFormatEnum(int bpp,
375 Uint32 Rmask,
376 Uint32 Gmask,
377 Uint32 Bmask,
378 Uint32 Amask);
379
380 /**
381 * \brief Create an SDL_PixelFormat structure from a pixel format enum.
382 */
383 extern DECLSPEC SDL_PixelFormat * SDLCALL SDL_AllocFormat(Uint32 pixel_format);
384
385 /**
386 * \brief Free an SDL_PixelFormat structure.
387 */
388 extern DECLSPEC void SDLCALL SDL_FreeFormat(SDL_PixelFormat *format);
389
390 /**
391 * \brief Create a palette structure with the specified number of color
392 * entries.
393 *
394 * \return A new palette, or NULL if there wasn't enough memory.
395 *
396 * \note The palette entries are initialized to white.
397 *
398 * \sa SDL_FreePalette()
399 */
400 extern DECLSPEC SDL_Palette *SDLCALL SDL_AllocPalette(int ncolors);
401
402 /**
403 * \brief Set the palette for a pixel format structure.
404 */
405 extern DECLSPEC int SDLCALL SDL_SetPixelFormatPalette(SDL_PixelFormat * format,
406 SDL_Palette *palette);
407
408 /**
409 * \brief Set a range of colors in a palette.
410 *
411 * \param palette The palette to modify.
412 * \param colors An array of colors to copy into the palette.
413 * \param firstcolor The index of the first palette entry to modify.
414 * \param ncolors The number of entries to modify.
415 *
416 * \return 0 on success, or -1 if not all of the colors could be set.
417 */
418 extern DECLSPEC int SDLCALL SDL_SetPaletteColors(SDL_Palette * palette,
419 const SDL_Color * colors,
420 int firstcolor, int ncolors);
421
422 /**
423 * \brief Free a palette created with SDL_AllocPalette().
424 *
425 * \sa SDL_AllocPalette()
426 */
427 extern DECLSPEC void SDLCALL SDL_FreePalette(SDL_Palette * palette);
428
429 /**
430 * \brief Maps an RGB triple to an opaque pixel value for a given pixel format.
431 *
432 * \sa SDL_MapRGBA
433 */
434 extern DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormat * format,
435 Uint8 r, Uint8 g, Uint8 b);
436
437 /**
438 * \brief Maps an RGBA quadruple to a pixel value for a given pixel format.
439 *
440 * \sa SDL_MapRGB
441 */
442 extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormat * format,
443 Uint8 r, Uint8 g, Uint8 b,
444 Uint8 a);
445
446 /**
447 * \brief Get the RGB components from a pixel of the specified format.
448 *
449 * \sa SDL_GetRGBA
450 */
451 extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel,
452 const SDL_PixelFormat * format,
453 Uint8 * r, Uint8 * g, Uint8 * b);
454
455 /**
456 * \brief Get the RGBA components from a pixel of the specified format.
457 *
458 * \sa SDL_GetRGB
459 */
460 extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel,
461 const SDL_PixelFormat * format,
462 Uint8 * r, Uint8 * g, Uint8 * b,
463 Uint8 * a);
464
465 /**
466 * \brief Calculate a 256 entry gamma ramp for a gamma value.
467 */
468 extern DECLSPEC void SDLCALL SDL_CalculateGammaRamp(float gamma, Uint16 * ramp);
469
470
471 /* Ends C function definitions when using C++ */
472 #ifdef __cplusplus
473 }
474 #endif
475 #include "close_code.h"
476
477 #endif /* SDL_pixels_h_ */
478
479 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_platform.h added (mode: 100644) (index 0000000..7166557)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_platform.h
24 *
25 * Try to get a standard set of platform defines.
26 */
27
28 #ifndef SDL_platform_h_
29 #define SDL_platform_h_
30
31 #if defined(_AIX)
32 #undef __AIX__
33 #define __AIX__ 1
34 #endif
35 #if defined(__HAIKU__)
36 #undef __HAIKU__
37 #define __HAIKU__ 1
38 #endif
39 #if defined(bsdi) || defined(__bsdi) || defined(__bsdi__)
40 #undef __BSDI__
41 #define __BSDI__ 1
42 #endif
43 #if defined(_arch_dreamcast)
44 #undef __DREAMCAST__
45 #define __DREAMCAST__ 1
46 #endif
47 #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
48 #undef __FREEBSD__
49 #define __FREEBSD__ 1
50 #endif
51 #if defined(hpux) || defined(__hpux) || defined(__hpux__)
52 #undef __HPUX__
53 #define __HPUX__ 1
54 #endif
55 #if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE)
56 #undef __IRIX__
57 #define __IRIX__ 1
58 #endif
59 #if (defined(linux) || defined(__linux) || defined(__linux__))
60 #undef __LINUX__
61 #define __LINUX__ 1
62 #endif
63 #if defined(ANDROID) || defined(__ANDROID__)
64 #undef __ANDROID__
65 #undef __LINUX__ /* do we need to do this? */
66 #define __ANDROID__ 1
67 #endif
68
69 #if defined(__APPLE__)
70 /* lets us know what version of Mac OS X we're compiling on */
71 #include "AvailabilityMacros.h"
72 #include "TargetConditionals.h"
73 #if TARGET_OS_TV
74 #undef __TVOS__
75 #define __TVOS__ 1
76 #endif
77 #if TARGET_OS_IPHONE
78 /* if compiling for iOS */
79 #undef __IPHONEOS__
80 #define __IPHONEOS__ 1
81 #undef __MACOSX__
82 #else
83 /* if not compiling for iOS */
84 #undef __MACOSX__
85 #define __MACOSX__ 1
86 #if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
87 # error SDL for Mac OS X only supports deploying on 10.6 and above.
88 #endif /* MAC_OS_X_VERSION_MIN_REQUIRED < 1060 */
89 #endif /* TARGET_OS_IPHONE */
90 #endif /* defined(__APPLE__) */
91
92 #if defined(__NetBSD__)
93 #undef __NETBSD__
94 #define __NETBSD__ 1
95 #endif
96 #if defined(__OpenBSD__)
97 #undef __OPENBSD__
98 #define __OPENBSD__ 1
99 #endif
100 #if defined(__OS2__) || defined(__EMX__)
101 #undef __OS2__
102 #define __OS2__ 1
103 #endif
104 #if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE)
105 #undef __OSF__
106 #define __OSF__ 1
107 #endif
108 #if defined(__QNXNTO__)
109 #undef __QNXNTO__
110 #define __QNXNTO__ 1
111 #endif
112 #if defined(riscos) || defined(__riscos) || defined(__riscos__)
113 #undef __RISCOS__
114 #define __RISCOS__ 1
115 #endif
116 #if defined(__sun) && defined(__SVR4)
117 #undef __SOLARIS__
118 #define __SOLARIS__ 1
119 #endif
120
121 #if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__)
122 /* Try to find out if we're compiling for WinRT or non-WinRT */
123 #if defined(_MSC_VER) && defined(__has_include)
124 #if __has_include(<winapifamily.h>)
125 #define HAVE_WINAPIFAMILY_H 1
126 #else
127 #define HAVE_WINAPIFAMILY_H 0
128 #endif
129
130 /* If _USING_V110_SDK71_ is defined it means we are using the Windows XP toolset. */
131 #elif defined(_MSC_VER) && (_MSC_VER >= 1700 && !_USING_V110_SDK71_) /* _MSC_VER == 1700 for Visual Studio 2012 */
132 #define HAVE_WINAPIFAMILY_H 1
133 #else
134 #define HAVE_WINAPIFAMILY_H 0
135 #endif
136
137 #if HAVE_WINAPIFAMILY_H
138 #include <winapifamily.h>
139 #define WINAPI_FAMILY_WINRT (!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP))
140 #else
141 #define WINAPI_FAMILY_WINRT 0
142 #endif /* HAVE_WINAPIFAMILY_H */
143
144 #if WINAPI_FAMILY_WINRT
145 #undef __WINRT__
146 #define __WINRT__ 1
147 #else
148 #undef __WINDOWS__
149 #define __WINDOWS__ 1
150 #endif
151 #endif /* defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) */
152
153 #if defined(__WINDOWS__)
154 #undef __WIN32__
155 #define __WIN32__ 1
156 #endif
157 #if defined(__PSP__)
158 #undef __PSP__
159 #define __PSP__ 1
160 #endif
161
162 /* The NACL compiler defines __native_client__ and __pnacl__
163 * Ref: http://www.chromium.org/nativeclient/pnacl/stability-of-the-pnacl-bitcode-abi
164 */
165 #if defined(__native_client__)
166 #undef __LINUX__
167 #undef __NACL__
168 #define __NACL__ 1
169 #endif
170 #if defined(__pnacl__)
171 #undef __LINUX__
172 #undef __PNACL__
173 #define __PNACL__ 1
174 /* PNACL with newlib supports static linking only */
175 #define __SDL_NOGETPROCADDR__
176 #endif
177
178
179 #include "begin_code.h"
180 /* Set up for C function definitions, even when using C++ */
181 #ifdef __cplusplus
182 extern "C" {
183 #endif
184
185 /**
186 * \brief Gets the name of the platform.
187 */
188 extern DECLSPEC const char * SDLCALL SDL_GetPlatform (void);
189
190 /* Ends C function definitions when using C++ */
191 #ifdef __cplusplus
192 }
193 #endif
194 #include "close_code.h"
195
196 #endif /* SDL_platform_h_ */
197
198 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_power.h added (mode: 100644) (index 0000000..39884cc)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 #ifndef SDL_power_h_
23 #define SDL_power_h_
24
25 /**
26 * \file SDL_power.h
27 *
28 * Header for the SDL power management routines.
29 */
30
31 #include "SDL_stdinc.h"
32
33 #include "begin_code.h"
34 /* Set up for C function definitions, even when using C++ */
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38
39 /**
40 * \brief The basic state for the system's power supply.
41 */
42 typedef enum
43 {
44 SDL_POWERSTATE_UNKNOWN, /**< cannot determine power status */
45 SDL_POWERSTATE_ON_BATTERY, /**< Not plugged in, running on the battery */
46 SDL_POWERSTATE_NO_BATTERY, /**< Plugged in, no battery available */
47 SDL_POWERSTATE_CHARGING, /**< Plugged in, charging battery */
48 SDL_POWERSTATE_CHARGED /**< Plugged in, battery charged */
49 } SDL_PowerState;
50
51
52 /**
53 * \brief Get the current power supply details.
54 *
55 * \param secs Seconds of battery life left. You can pass a NULL here if
56 * you don't care. Will return -1 if we can't determine a
57 * value, or we're not running on a battery.
58 *
59 * \param pct Percentage of battery life left, between 0 and 100. You can
60 * pass a NULL here if you don't care. Will return -1 if we
61 * can't determine a value, or we're not running on a battery.
62 *
63 * \return The state of the battery (if any).
64 */
65 extern DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *secs, int *pct);
66
67 /* Ends C function definitions when using C++ */
68 #ifdef __cplusplus
69 }
70 #endif
71 #include "close_code.h"
72
73 #endif /* SDL_power_h_ */
74
75 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_quit.h added (mode: 100644) (index 0000000..b2bd5da)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_quit.h
24 *
25 * Include file for SDL quit event handling.
26 */
27
28 #ifndef SDL_quit_h_
29 #define SDL_quit_h_
30
31 #include "SDL_stdinc.h"
32 #include "SDL_error.h"
33
34 /**
35 * \file SDL_quit.h
36 *
37 * An ::SDL_QUIT event is generated when the user tries to close the application
38 * window. If it is ignored or filtered out, the window will remain open.
39 * If it is not ignored or filtered, it is queued normally and the window
40 * is allowed to close. When the window is closed, screen updates will
41 * complete, but have no effect.
42 *
43 * SDL_Init() installs signal handlers for SIGINT (keyboard interrupt)
44 * and SIGTERM (system termination request), if handlers do not already
45 * exist, that generate ::SDL_QUIT events as well. There is no way
46 * to determine the cause of an ::SDL_QUIT event, but setting a signal
47 * handler in your application will override the default generation of
48 * quit events for that signal.
49 *
50 * \sa SDL_Quit()
51 */
52
53 /* There are no functions directly affecting the quit event */
54
55 #define SDL_QuitRequested() \
56 (SDL_PumpEvents(), (SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUIT,SDL_QUIT) > 0))
57
58 #endif /* SDL_quit_h_ */
File include/SDL2/SDL_rect.h added (mode: 100644) (index 0000000..47f0d20)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_rect.h
24 *
25 * Header file for SDL_rect definition and management functions.
26 */
27
28 #ifndef SDL_rect_h_
29 #define SDL_rect_h_
30
31 #include "SDL_stdinc.h"
32 #include "SDL_error.h"
33 #include "SDL_pixels.h"
34 #include "SDL_rwops.h"
35
36 #include "begin_code.h"
37 /* Set up for C function definitions, even when using C++ */
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41
42 /**
43 * \brief The structure that defines a point (integer)
44 *
45 * \sa SDL_EnclosePoints
46 * \sa SDL_PointInRect
47 */
48 typedef struct SDL_Point
49 {
50 int x;
51 int y;
52 } SDL_Point;
53
54 /**
55 * \brief The structure that defines a point (floating point)
56 *
57 * \sa SDL_EnclosePoints
58 * \sa SDL_PointInRect
59 */
60 typedef struct SDL_FPoint
61 {
62 float x;
63 float y;
64 } SDL_FPoint;
65
66
67 /**
68 * \brief A rectangle, with the origin at the upper left (integer).
69 *
70 * \sa SDL_RectEmpty
71 * \sa SDL_RectEquals
72 * \sa SDL_HasIntersection
73 * \sa SDL_IntersectRect
74 * \sa SDL_UnionRect
75 * \sa SDL_EnclosePoints
76 */
77 typedef struct SDL_Rect
78 {
79 int x, y;
80 int w, h;
81 } SDL_Rect;
82
83
84 /**
85 * \brief A rectangle, with the origin at the upper left (floating point).
86 */
87 typedef struct SDL_FRect
88 {
89 float x;
90 float y;
91 float w;
92 float h;
93 } SDL_FRect;
94
95
96 /**
97 * \brief Returns true if point resides inside a rectangle.
98 */
99 SDL_FORCE_INLINE SDL_bool SDL_PointInRect(const SDL_Point *p, const SDL_Rect *r)
100 {
101 return ( (p->x >= r->x) && (p->x < (r->x + r->w)) &&
102 (p->y >= r->y) && (p->y < (r->y + r->h)) ) ? SDL_TRUE : SDL_FALSE;
103 }
104
105 /**
106 * \brief Returns true if the rectangle has no area.
107 */
108 SDL_FORCE_INLINE SDL_bool SDL_RectEmpty(const SDL_Rect *r)
109 {
110 return ((!r) || (r->w <= 0) || (r->h <= 0)) ? SDL_TRUE : SDL_FALSE;
111 }
112
113 /**
114 * \brief Returns true if the two rectangles are equal.
115 */
116 SDL_FORCE_INLINE SDL_bool SDL_RectEquals(const SDL_Rect *a, const SDL_Rect *b)
117 {
118 return (a && b && (a->x == b->x) && (a->y == b->y) &&
119 (a->w == b->w) && (a->h == b->h)) ? SDL_TRUE : SDL_FALSE;
120 }
121
122 /**
123 * \brief Determine whether two rectangles intersect.
124 *
125 * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
126 */
127 extern DECLSPEC SDL_bool SDLCALL SDL_HasIntersection(const SDL_Rect * A,
128 const SDL_Rect * B);
129
130 /**
131 * \brief Calculate the intersection of two rectangles.
132 *
133 * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
134 */
135 extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRect(const SDL_Rect * A,
136 const SDL_Rect * B,
137 SDL_Rect * result);
138
139 /**
140 * \brief Calculate the union of two rectangles.
141 */
142 extern DECLSPEC void SDLCALL SDL_UnionRect(const SDL_Rect * A,
143 const SDL_Rect * B,
144 SDL_Rect * result);
145
146 /**
147 * \brief Calculate a minimal rectangle enclosing a set of points
148 *
149 * \return SDL_TRUE if any points were within the clipping rect
150 */
151 extern DECLSPEC SDL_bool SDLCALL SDL_EnclosePoints(const SDL_Point * points,
152 int count,
153 const SDL_Rect * clip,
154 SDL_Rect * result);
155
156 /**
157 * \brief Calculate the intersection of a rectangle and line segment.
158 *
159 * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
160 */
161 extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRectAndLine(const SDL_Rect *
162 rect, int *X1,
163 int *Y1, int *X2,
164 int *Y2);
165
166 /* Ends C function definitions when using C++ */
167 #ifdef __cplusplus
168 }
169 #endif
170 #include "close_code.h"
171
172 #endif /* SDL_rect_h_ */
173
174 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_render.h added (mode: 100644) (index 0000000..f26fb7e)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_render.h
24 *
25 * Header file for SDL 2D rendering functions.
26 *
27 * This API supports the following features:
28 * * single pixel points
29 * * single pixel lines
30 * * filled rectangles
31 * * texture images
32 *
33 * The primitives may be drawn in opaque, blended, or additive modes.
34 *
35 * The texture images may be drawn in opaque, blended, or additive modes.
36 * They can have an additional color tint or alpha modulation applied to
37 * them, and may also be stretched with linear interpolation.
38 *
39 * This API is designed to accelerate simple 2D operations. You may
40 * want more functionality such as polygons and particle effects and
41 * in that case you should use SDL's OpenGL/Direct3D support or one
42 * of the many good 3D engines.
43 *
44 * These functions must be called from the main thread.
45 * See this bug for details: http://bugzilla.libsdl.org/show_bug.cgi?id=1995
46 */
47
48 #ifndef SDL_render_h_
49 #define SDL_render_h_
50
51 #include "SDL_stdinc.h"
52 #include "SDL_rect.h"
53 #include "SDL_video.h"
54
55 #include "begin_code.h"
56 /* Set up for C function definitions, even when using C++ */
57 #ifdef __cplusplus
58 extern "C" {
59 #endif
60
61 /**
62 * \brief Flags used when creating a rendering context
63 */
64 typedef enum
65 {
66 SDL_RENDERER_SOFTWARE = 0x00000001, /**< The renderer is a software fallback */
67 SDL_RENDERER_ACCELERATED = 0x00000002, /**< The renderer uses hardware
68 acceleration */
69 SDL_RENDERER_PRESENTVSYNC = 0x00000004, /**< Present is synchronized
70 with the refresh rate */
71 SDL_RENDERER_TARGETTEXTURE = 0x00000008 /**< The renderer supports
72 rendering to texture */
73 } SDL_RendererFlags;
74
75 /**
76 * \brief Information on the capabilities of a render driver or context.
77 */
78 typedef struct SDL_RendererInfo
79 {
80 const char *name; /**< The name of the renderer */
81 Uint32 flags; /**< Supported ::SDL_RendererFlags */
82 Uint32 num_texture_formats; /**< The number of available texture formats */
83 Uint32 texture_formats[16]; /**< The available texture formats */
84 int max_texture_width; /**< The maximum texture width */
85 int max_texture_height; /**< The maximum texture height */
86 } SDL_RendererInfo;
87
88 /**
89 * \brief The scaling mode for a texture.
90 */
91 typedef enum
92 {
93 SDL_ScaleModeNearest, /**< nearest pixel sampling */
94 SDL_ScaleModeLinear, /**< linear filtering */
95 SDL_ScaleModeBest /**< anisotropic filtering */
96 } SDL_ScaleMode;
97
98 /**
99 * \brief The access pattern allowed for a texture.
100 */
101 typedef enum
102 {
103 SDL_TEXTUREACCESS_STATIC, /**< Changes rarely, not lockable */
104 SDL_TEXTUREACCESS_STREAMING, /**< Changes frequently, lockable */
105 SDL_TEXTUREACCESS_TARGET /**< Texture can be used as a render target */
106 } SDL_TextureAccess;
107
108 /**
109 * \brief The texture channel modulation used in SDL_RenderCopy().
110 */
111 typedef enum
112 {
113 SDL_TEXTUREMODULATE_NONE = 0x00000000, /**< No modulation */
114 SDL_TEXTUREMODULATE_COLOR = 0x00000001, /**< srcC = srcC * color */
115 SDL_TEXTUREMODULATE_ALPHA = 0x00000002 /**< srcA = srcA * alpha */
116 } SDL_TextureModulate;
117
118 /**
119 * \brief Flip constants for SDL_RenderCopyEx
120 */
121 typedef enum
122 {
123 SDL_FLIP_NONE = 0x00000000, /**< Do not flip */
124 SDL_FLIP_HORIZONTAL = 0x00000001, /**< flip horizontally */
125 SDL_FLIP_VERTICAL = 0x00000002 /**< flip vertically */
126 } SDL_RendererFlip;
127
128 /**
129 * \brief A structure representing rendering state
130 */
131 struct SDL_Renderer;
132 typedef struct SDL_Renderer SDL_Renderer;
133
134 /**
135 * \brief An efficient driver-specific representation of pixel data
136 */
137 struct SDL_Texture;
138 typedef struct SDL_Texture SDL_Texture;
139
140
141 /* Function prototypes */
142
143 /**
144 * \brief Get the number of 2D rendering drivers available for the current
145 * display.
146 *
147 * A render driver is a set of code that handles rendering and texture
148 * management on a particular display. Normally there is only one, but
149 * some drivers may have several available with different capabilities.
150 *
151 * \sa SDL_GetRenderDriverInfo()
152 * \sa SDL_CreateRenderer()
153 */
154 extern DECLSPEC int SDLCALL SDL_GetNumRenderDrivers(void);
155
156 /**
157 * \brief Get information about a specific 2D rendering driver for the current
158 * display.
159 *
160 * \param index The index of the driver to query information about.
161 * \param info A pointer to an SDL_RendererInfo struct to be filled with
162 * information on the rendering driver.
163 *
164 * \return 0 on success, -1 if the index was out of range.
165 *
166 * \sa SDL_CreateRenderer()
167 */
168 extern DECLSPEC int SDLCALL SDL_GetRenderDriverInfo(int index,
169 SDL_RendererInfo * info);
170
171 /**
172 * \brief Create a window and default renderer
173 *
174 * \param width The width of the window
175 * \param height The height of the window
176 * \param window_flags The flags used to create the window
177 * \param window A pointer filled with the window, or NULL on error
178 * \param renderer A pointer filled with the renderer, or NULL on error
179 *
180 * \return 0 on success, or -1 on error
181 */
182 extern DECLSPEC int SDLCALL SDL_CreateWindowAndRenderer(
183 int width, int height, Uint32 window_flags,
184 SDL_Window **window, SDL_Renderer **renderer);
185
186
187 /**
188 * \brief Create a 2D rendering context for a window.
189 *
190 * \param window The window where rendering is displayed.
191 * \param index The index of the rendering driver to initialize, or -1 to
192 * initialize the first one supporting the requested flags.
193 * \param flags ::SDL_RendererFlags.
194 *
195 * \return A valid rendering context or NULL if there was an error.
196 *
197 * \sa SDL_CreateSoftwareRenderer()
198 * \sa SDL_GetRendererInfo()
199 * \sa SDL_DestroyRenderer()
200 */
201 extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateRenderer(SDL_Window * window,
202 int index, Uint32 flags);
203
204 /**
205 * \brief Create a 2D software rendering context for a surface.
206 *
207 * \param surface The surface where rendering is done.
208 *
209 * \return A valid rendering context or NULL if there was an error.
210 *
211 * \sa SDL_CreateRenderer()
212 * \sa SDL_DestroyRenderer()
213 */
214 extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateSoftwareRenderer(SDL_Surface * surface);
215
216 /**
217 * \brief Get the renderer associated with a window.
218 */
219 extern DECLSPEC SDL_Renderer * SDLCALL SDL_GetRenderer(SDL_Window * window);
220
221 /**
222 * \brief Get information about a rendering context.
223 */
224 extern DECLSPEC int SDLCALL SDL_GetRendererInfo(SDL_Renderer * renderer,
225 SDL_RendererInfo * info);
226
227 /**
228 * \brief Get the output size in pixels of a rendering context.
229 */
230 extern DECLSPEC int SDLCALL SDL_GetRendererOutputSize(SDL_Renderer * renderer,
231 int *w, int *h);
232
233 /**
234 * \brief Create a texture for a rendering context.
235 *
236 * \param renderer The renderer.
237 * \param format The format of the texture.
238 * \param access One of the enumerated values in ::SDL_TextureAccess.
239 * \param w The width of the texture in pixels.
240 * \param h The height of the texture in pixels.
241 *
242 * \return The created texture is returned, or NULL if no rendering context was
243 * active, the format was unsupported, or the width or height were out
244 * of range.
245 *
246 * \note The contents of the texture are not defined at creation.
247 *
248 * \sa SDL_QueryTexture()
249 * \sa SDL_UpdateTexture()
250 * \sa SDL_DestroyTexture()
251 */
252 extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTexture(SDL_Renderer * renderer,
253 Uint32 format,
254 int access, int w,
255 int h);
256
257 /**
258 * \brief Create a texture from an existing surface.
259 *
260 * \param renderer The renderer.
261 * \param surface The surface containing pixel data used to fill the texture.
262 *
263 * \return The created texture is returned, or NULL on error.
264 *
265 * \note The surface is not modified or freed by this function.
266 *
267 * \sa SDL_QueryTexture()
268 * \sa SDL_DestroyTexture()
269 */
270 extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTextureFromSurface(SDL_Renderer * renderer, SDL_Surface * surface);
271
272 /**
273 * \brief Query the attributes of a texture
274 *
275 * \param texture A texture to be queried.
276 * \param format A pointer filled in with the raw format of the texture. The
277 * actual format may differ, but pixel transfers will use this
278 * format.
279 * \param access A pointer filled in with the actual access to the texture.
280 * \param w A pointer filled in with the width of the texture in pixels.
281 * \param h A pointer filled in with the height of the texture in pixels.
282 *
283 * \return 0 on success, or -1 if the texture is not valid.
284 */
285 extern DECLSPEC int SDLCALL SDL_QueryTexture(SDL_Texture * texture,
286 Uint32 * format, int *access,
287 int *w, int *h);
288
289 /**
290 * \brief Set an additional color value used in render copy operations.
291 *
292 * \param texture The texture to update.
293 * \param r The red color value multiplied into copy operations.
294 * \param g The green color value multiplied into copy operations.
295 * \param b The blue color value multiplied into copy operations.
296 *
297 * \return 0 on success, or -1 if the texture is not valid or color modulation
298 * is not supported.
299 *
300 * \sa SDL_GetTextureColorMod()
301 */
302 extern DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_Texture * texture,
303 Uint8 r, Uint8 g, Uint8 b);
304
305
306 /**
307 * \brief Get the additional color value used in render copy operations.
308 *
309 * \param texture The texture to query.
310 * \param r A pointer filled in with the current red color value.
311 * \param g A pointer filled in with the current green color value.
312 * \param b A pointer filled in with the current blue color value.
313 *
314 * \return 0 on success, or -1 if the texture is not valid.
315 *
316 * \sa SDL_SetTextureColorMod()
317 */
318 extern DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_Texture * texture,
319 Uint8 * r, Uint8 * g,
320 Uint8 * b);
321
322 /**
323 * \brief Set an additional alpha value used in render copy operations.
324 *
325 * \param texture The texture to update.
326 * \param alpha The alpha value multiplied into copy operations.
327 *
328 * \return 0 on success, or -1 if the texture is not valid or alpha modulation
329 * is not supported.
330 *
331 * \sa SDL_GetTextureAlphaMod()
332 */
333 extern DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_Texture * texture,
334 Uint8 alpha);
335
336 /**
337 * \brief Get the additional alpha value used in render copy operations.
338 *
339 * \param texture The texture to query.
340 * \param alpha A pointer filled in with the current alpha value.
341 *
342 * \return 0 on success, or -1 if the texture is not valid.
343 *
344 * \sa SDL_SetTextureAlphaMod()
345 */
346 extern DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_Texture * texture,
347 Uint8 * alpha);
348
349 /**
350 * \brief Set the blend mode used for texture copy operations.
351 *
352 * \param texture The texture to update.
353 * \param blendMode ::SDL_BlendMode to use for texture blending.
354 *
355 * \return 0 on success, or -1 if the texture is not valid or the blend mode is
356 * not supported.
357 *
358 * \note If the blend mode is not supported, the closest supported mode is
359 * chosen.
360 *
361 * \sa SDL_GetTextureBlendMode()
362 */
363 extern DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_Texture * texture,
364 SDL_BlendMode blendMode);
365
366 /**
367 * \brief Get the blend mode used for texture copy operations.
368 *
369 * \param texture The texture to query.
370 * \param blendMode A pointer filled in with the current blend mode.
371 *
372 * \return 0 on success, or -1 if the texture is not valid.
373 *
374 * \sa SDL_SetTextureBlendMode()
375 */
376 extern DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture * texture,
377 SDL_BlendMode *blendMode);
378
379 /**
380 * \brief Set the scale mode used for texture scale operations.
381 *
382 * \param texture The texture to update.
383 * \param scaleMode ::SDL_ScaleMode to use for texture scaling.
384 *
385 * \return 0 on success, or -1 if the texture is not valid.
386 *
387 * \note If the scale mode is not supported, the closest supported mode is
388 * chosen.
389 *
390 * \sa SDL_GetTextureScaleMode()
391 */
392 extern DECLSPEC int SDLCALL SDL_SetTextureScaleMode(SDL_Texture * texture,
393 SDL_ScaleMode scaleMode);
394
395 /**
396 * \brief Get the scale mode used for texture scale operations.
397 *
398 * \param texture The texture to query.
399 * \param scaleMode A pointer filled in with the current scale mode.
400 *
401 * \return 0 on success, or -1 if the texture is not valid.
402 *
403 * \sa SDL_SetTextureScaleMode()
404 */
405 extern DECLSPEC int SDLCALL SDL_GetTextureScaleMode(SDL_Texture * texture,
406 SDL_ScaleMode *scaleMode);
407
408 /**
409 * \brief Update the given texture rectangle with new pixel data.
410 *
411 * \param texture The texture to update
412 * \param rect A pointer to the rectangle of pixels to update, or NULL to
413 * update the entire texture.
414 * \param pixels The raw pixel data in the format of the texture.
415 * \param pitch The number of bytes in a row of pixel data, including padding between lines.
416 *
417 * The pixel data must be in the format of the texture. The pixel format can be
418 * queried with SDL_QueryTexture.
419 *
420 * \return 0 on success, or -1 if the texture is not valid.
421 *
422 * \note This is a fairly slow function.
423 */
424 extern DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_Texture * texture,
425 const SDL_Rect * rect,
426 const void *pixels, int pitch);
427
428 /**
429 * \brief Update a rectangle within a planar YV12 or IYUV texture with new pixel data.
430 *
431 * \param texture The texture to update
432 * \param rect A pointer to the rectangle of pixels to update, or NULL to
433 * update the entire texture.
434 * \param Yplane The raw pixel data for the Y plane.
435 * \param Ypitch The number of bytes between rows of pixel data for the Y plane.
436 * \param Uplane The raw pixel data for the U plane.
437 * \param Upitch The number of bytes between rows of pixel data for the U plane.
438 * \param Vplane The raw pixel data for the V plane.
439 * \param Vpitch The number of bytes between rows of pixel data for the V plane.
440 *
441 * \return 0 on success, or -1 if the texture is not valid.
442 *
443 * \note You can use SDL_UpdateTexture() as long as your pixel data is
444 * a contiguous block of Y and U/V planes in the proper order, but
445 * this function is available if your pixel data is not contiguous.
446 */
447 extern DECLSPEC int SDLCALL SDL_UpdateYUVTexture(SDL_Texture * texture,
448 const SDL_Rect * rect,
449 const Uint8 *Yplane, int Ypitch,
450 const Uint8 *Uplane, int Upitch,
451 const Uint8 *Vplane, int Vpitch);
452
453 /**
454 * \brief Lock a portion of the texture for write-only pixel access.
455 *
456 * \param texture The texture to lock for access, which was created with
457 * ::SDL_TEXTUREACCESS_STREAMING.
458 * \param rect A pointer to the rectangle to lock for access. If the rect
459 * is NULL, the entire texture will be locked.
460 * \param pixels This is filled in with a pointer to the locked pixels,
461 * appropriately offset by the locked area.
462 * \param pitch This is filled in with the pitch of the locked pixels.
463 *
464 * \return 0 on success, or -1 if the texture is not valid or was not created with ::SDL_TEXTUREACCESS_STREAMING.
465 *
466 * \sa SDL_UnlockTexture()
467 */
468 extern DECLSPEC int SDLCALL SDL_LockTexture(SDL_Texture * texture,
469 const SDL_Rect * rect,
470 void **pixels, int *pitch);
471
472 /**
473 * \brief Lock a portion of the texture for write-only pixel access.
474 * Expose it as a SDL surface.
475 *
476 * \param texture The texture to lock for access, which was created with
477 * ::SDL_TEXTUREACCESS_STREAMING.
478 * \param rect A pointer to the rectangle to lock for access. If the rect
479 * is NULL, the entire texture will be locked.
480 * \param surface This is filled in with a SDL surface representing the locked area
481 * Surface is freed internally after calling SDL_UnlockTexture or SDL_DestroyTexture.
482 *
483 * \return 0 on success, or -1 if the texture is not valid or was not created with ::SDL_TEXTUREACCESS_STREAMING.
484 *
485 * \sa SDL_UnlockTexture()
486 */
487 extern DECLSPEC int SDLCALL SDL_LockTextureToSurface(SDL_Texture *texture,
488 const SDL_Rect *rect,
489 SDL_Surface **surface);
490
491 /**
492 * \brief Unlock a texture, uploading the changes to video memory, if needed.
493 * If SDL_LockTextureToSurface() was called for locking, the SDL surface is freed.
494 *
495 * \sa SDL_LockTexture()
496 * \sa SDL_LockTextureToSurface()
497 */
498 extern DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_Texture * texture);
499
500 /**
501 * \brief Determines whether a window supports the use of render targets
502 *
503 * \param renderer The renderer that will be checked
504 *
505 * \return SDL_TRUE if supported, SDL_FALSE if not.
506 */
507 extern DECLSPEC SDL_bool SDLCALL SDL_RenderTargetSupported(SDL_Renderer *renderer);
508
509 /**
510 * \brief Set a texture as the current rendering target.
511 *
512 * \param renderer The renderer.
513 * \param texture The targeted texture, which must be created with the SDL_TEXTUREACCESS_TARGET flag, or NULL for the default render target
514 *
515 * \return 0 on success, or -1 on error
516 *
517 * \sa SDL_GetRenderTarget()
518 */
519 extern DECLSPEC int SDLCALL SDL_SetRenderTarget(SDL_Renderer *renderer,
520 SDL_Texture *texture);
521
522 /**
523 * \brief Get the current render target or NULL for the default render target.
524 *
525 * \return The current render target
526 *
527 * \sa SDL_SetRenderTarget()
528 */
529 extern DECLSPEC SDL_Texture * SDLCALL SDL_GetRenderTarget(SDL_Renderer *renderer);
530
531 /**
532 * \brief Set device independent resolution for rendering
533 *
534 * \param renderer The renderer for which resolution should be set.
535 * \param w The width of the logical resolution
536 * \param h The height of the logical resolution
537 *
538 * This function uses the viewport and scaling functionality to allow a fixed logical
539 * resolution for rendering, regardless of the actual output resolution. If the actual
540 * output resolution doesn't have the same aspect ratio the output rendering will be
541 * centered within the output display.
542 *
543 * If the output display is a window, mouse events in the window will be filtered
544 * and scaled so they seem to arrive within the logical resolution.
545 *
546 * \note If this function results in scaling or subpixel drawing by the
547 * rendering backend, it will be handled using the appropriate
548 * quality hints.
549 *
550 * \sa SDL_RenderGetLogicalSize()
551 * \sa SDL_RenderSetScale()
552 * \sa SDL_RenderSetViewport()
553 */
554 extern DECLSPEC int SDLCALL SDL_RenderSetLogicalSize(SDL_Renderer * renderer, int w, int h);
555
556 /**
557 * \brief Get device independent resolution for rendering
558 *
559 * \param renderer The renderer from which resolution should be queried.
560 * \param w A pointer filled with the width of the logical resolution
561 * \param h A pointer filled with the height of the logical resolution
562 *
563 * \sa SDL_RenderSetLogicalSize()
564 */
565 extern DECLSPEC void SDLCALL SDL_RenderGetLogicalSize(SDL_Renderer * renderer, int *w, int *h);
566
567 /**
568 * \brief Set whether to force integer scales for resolution-independent rendering
569 *
570 * \param renderer The renderer for which integer scaling should be set.
571 * \param enable Enable or disable integer scaling
572 *
573 * This function restricts the logical viewport to integer values - that is, when
574 * a resolution is between two multiples of a logical size, the viewport size is
575 * rounded down to the lower multiple.
576 *
577 * \sa SDL_RenderSetLogicalSize()
578 */
579 extern DECLSPEC int SDLCALL SDL_RenderSetIntegerScale(SDL_Renderer * renderer,
580 SDL_bool enable);
581
582 /**
583 * \brief Get whether integer scales are forced for resolution-independent rendering
584 *
585 * \param renderer The renderer from which integer scaling should be queried.
586 *
587 * \sa SDL_RenderSetIntegerScale()
588 */
589 extern DECLSPEC SDL_bool SDLCALL SDL_RenderGetIntegerScale(SDL_Renderer * renderer);
590
591 /**
592 * \brief Set the drawing area for rendering on the current target.
593 *
594 * \param renderer The renderer for which the drawing area should be set.
595 * \param rect The rectangle representing the drawing area, or NULL to set the viewport to the entire target.
596 *
597 * The x,y of the viewport rect represents the origin for rendering.
598 *
599 * \return 0 on success, or -1 on error
600 *
601 * \note If the window associated with the renderer is resized, the viewport is automatically reset.
602 *
603 * \sa SDL_RenderGetViewport()
604 * \sa SDL_RenderSetLogicalSize()
605 */
606 extern DECLSPEC int SDLCALL SDL_RenderSetViewport(SDL_Renderer * renderer,
607 const SDL_Rect * rect);
608
609 /**
610 * \brief Get the drawing area for the current target.
611 *
612 * \sa SDL_RenderSetViewport()
613 */
614 extern DECLSPEC void SDLCALL SDL_RenderGetViewport(SDL_Renderer * renderer,
615 SDL_Rect * rect);
616
617 /**
618 * \brief Set the clip rectangle for the current target.
619 *
620 * \param renderer The renderer for which clip rectangle should be set.
621 * \param rect A pointer to the rectangle to set as the clip rectangle,
622 * relative to the viewport, or NULL to disable clipping.
623 *
624 * \return 0 on success, or -1 on error
625 *
626 * \sa SDL_RenderGetClipRect()
627 */
628 extern DECLSPEC int SDLCALL SDL_RenderSetClipRect(SDL_Renderer * renderer,
629 const SDL_Rect * rect);
630
631 /**
632 * \brief Get the clip rectangle for the current target.
633 *
634 * \param renderer The renderer from which clip rectangle should be queried.
635 * \param rect A pointer filled in with the current clip rectangle, or
636 * an empty rectangle if clipping is disabled.
637 *
638 * \sa SDL_RenderSetClipRect()
639 */
640 extern DECLSPEC void SDLCALL SDL_RenderGetClipRect(SDL_Renderer * renderer,
641 SDL_Rect * rect);
642
643 /**
644 * \brief Get whether clipping is enabled on the given renderer.
645 *
646 * \param renderer The renderer from which clip state should be queried.
647 *
648 * \sa SDL_RenderGetClipRect()
649 */
650 extern DECLSPEC SDL_bool SDLCALL SDL_RenderIsClipEnabled(SDL_Renderer * renderer);
651
652
653 /**
654 * \brief Set the drawing scale for rendering on the current target.
655 *
656 * \param renderer The renderer for which the drawing scale should be set.
657 * \param scaleX The horizontal scaling factor
658 * \param scaleY The vertical scaling factor
659 *
660 * The drawing coordinates are scaled by the x/y scaling factors
661 * before they are used by the renderer. This allows resolution
662 * independent drawing with a single coordinate system.
663 *
664 * \note If this results in scaling or subpixel drawing by the
665 * rendering backend, it will be handled using the appropriate
666 * quality hints. For best results use integer scaling factors.
667 *
668 * \sa SDL_RenderGetScale()
669 * \sa SDL_RenderSetLogicalSize()
670 */
671 extern DECLSPEC int SDLCALL SDL_RenderSetScale(SDL_Renderer * renderer,
672 float scaleX, float scaleY);
673
674 /**
675 * \brief Get the drawing scale for the current target.
676 *
677 * \param renderer The renderer from which drawing scale should be queried.
678 * \param scaleX A pointer filled in with the horizontal scaling factor
679 * \param scaleY A pointer filled in with the vertical scaling factor
680 *
681 * \sa SDL_RenderSetScale()
682 */
683 extern DECLSPEC void SDLCALL SDL_RenderGetScale(SDL_Renderer * renderer,
684 float *scaleX, float *scaleY);
685
686 /**
687 * \brief Set the color used for drawing operations (Rect, Line and Clear).
688 *
689 * \param renderer The renderer for which drawing color should be set.
690 * \param r The red value used to draw on the rendering target.
691 * \param g The green value used to draw on the rendering target.
692 * \param b The blue value used to draw on the rendering target.
693 * \param a The alpha value used to draw on the rendering target, usually
694 * ::SDL_ALPHA_OPAQUE (255).
695 *
696 * \return 0 on success, or -1 on error
697 */
698 extern DECLSPEC int SDLCALL SDL_SetRenderDrawColor(SDL_Renderer * renderer,
699 Uint8 r, Uint8 g, Uint8 b,
700 Uint8 a);
701
702 /**
703 * \brief Get the color used for drawing operations (Rect, Line and Clear).
704 *
705 * \param renderer The renderer from which drawing color should be queried.
706 * \param r A pointer to the red value used to draw on the rendering target.
707 * \param g A pointer to the green value used to draw on the rendering target.
708 * \param b A pointer to the blue value used to draw on the rendering target.
709 * \param a A pointer to the alpha value used to draw on the rendering target,
710 * usually ::SDL_ALPHA_OPAQUE (255).
711 *
712 * \return 0 on success, or -1 on error
713 */
714 extern DECLSPEC int SDLCALL SDL_GetRenderDrawColor(SDL_Renderer * renderer,
715 Uint8 * r, Uint8 * g, Uint8 * b,
716 Uint8 * a);
717
718 /**
719 * \brief Set the blend mode used for drawing operations (Fill and Line).
720 *
721 * \param renderer The renderer for which blend mode should be set.
722 * \param blendMode ::SDL_BlendMode to use for blending.
723 *
724 * \return 0 on success, or -1 on error
725 *
726 * \note If the blend mode is not supported, the closest supported mode is
727 * chosen.
728 *
729 * \sa SDL_GetRenderDrawBlendMode()
730 */
731 extern DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(SDL_Renderer * renderer,
732 SDL_BlendMode blendMode);
733
734 /**
735 * \brief Get the blend mode used for drawing operations.
736 *
737 * \param renderer The renderer from which blend mode should be queried.
738 * \param blendMode A pointer filled in with the current blend mode.
739 *
740 * \return 0 on success, or -1 on error
741 *
742 * \sa SDL_SetRenderDrawBlendMode()
743 */
744 extern DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(SDL_Renderer * renderer,
745 SDL_BlendMode *blendMode);
746
747 /**
748 * \brief Clear the current rendering target with the drawing color
749 *
750 * This function clears the entire rendering target, ignoring the viewport and
751 * the clip rectangle.
752 *
753 * \return 0 on success, or -1 on error
754 */
755 extern DECLSPEC int SDLCALL SDL_RenderClear(SDL_Renderer * renderer);
756
757 /**
758 * \brief Draw a point on the current rendering target.
759 *
760 * \param renderer The renderer which should draw a point.
761 * \param x The x coordinate of the point.
762 * \param y The y coordinate of the point.
763 *
764 * \return 0 on success, or -1 on error
765 */
766 extern DECLSPEC int SDLCALL SDL_RenderDrawPoint(SDL_Renderer * renderer,
767 int x, int y);
768
769 /**
770 * \brief Draw multiple points on the current rendering target.
771 *
772 * \param renderer The renderer which should draw multiple points.
773 * \param points The points to draw
774 * \param count The number of points to draw
775 *
776 * \return 0 on success, or -1 on error
777 */
778 extern DECLSPEC int SDLCALL SDL_RenderDrawPoints(SDL_Renderer * renderer,
779 const SDL_Point * points,
780 int count);
781
782 /**
783 * \brief Draw a line on the current rendering target.
784 *
785 * \param renderer The renderer which should draw a line.
786 * \param x1 The x coordinate of the start point.
787 * \param y1 The y coordinate of the start point.
788 * \param x2 The x coordinate of the end point.
789 * \param y2 The y coordinate of the end point.
790 *
791 * \return 0 on success, or -1 on error
792 */
793 extern DECLSPEC int SDLCALL SDL_RenderDrawLine(SDL_Renderer * renderer,
794 int x1, int y1, int x2, int y2);
795
796 /**
797 * \brief Draw a series of connected lines on the current rendering target.
798 *
799 * \param renderer The renderer which should draw multiple lines.
800 * \param points The points along the lines
801 * \param count The number of points, drawing count-1 lines
802 *
803 * \return 0 on success, or -1 on error
804 */
805 extern DECLSPEC int SDLCALL SDL_RenderDrawLines(SDL_Renderer * renderer,
806 const SDL_Point * points,
807 int count);
808
809 /**
810 * \brief Draw a rectangle on the current rendering target.
811 *
812 * \param renderer The renderer which should draw a rectangle.
813 * \param rect A pointer to the destination rectangle, or NULL to outline the entire rendering target.
814 *
815 * \return 0 on success, or -1 on error
816 */
817 extern DECLSPEC int SDLCALL SDL_RenderDrawRect(SDL_Renderer * renderer,
818 const SDL_Rect * rect);
819
820 /**
821 * \brief Draw some number of rectangles on the current rendering target.
822 *
823 * \param renderer The renderer which should draw multiple rectangles.
824 * \param rects A pointer to an array of destination rectangles.
825 * \param count The number of rectangles.
826 *
827 * \return 0 on success, or -1 on error
828 */
829 extern DECLSPEC int SDLCALL SDL_RenderDrawRects(SDL_Renderer * renderer,
830 const SDL_Rect * rects,
831 int count);
832
833 /**
834 * \brief Fill a rectangle on the current rendering target with the drawing color.
835 *
836 * \param renderer The renderer which should fill a rectangle.
837 * \param rect A pointer to the destination rectangle, or NULL for the entire
838 * rendering target.
839 *
840 * \return 0 on success, or -1 on error
841 */
842 extern DECLSPEC int SDLCALL SDL_RenderFillRect(SDL_Renderer * renderer,
843 const SDL_Rect * rect);
844
845 /**
846 * \brief Fill some number of rectangles on the current rendering target with the drawing color.
847 *
848 * \param renderer The renderer which should fill multiple rectangles.
849 * \param rects A pointer to an array of destination rectangles.
850 * \param count The number of rectangles.
851 *
852 * \return 0 on success, or -1 on error
853 */
854 extern DECLSPEC int SDLCALL SDL_RenderFillRects(SDL_Renderer * renderer,
855 const SDL_Rect * rects,
856 int count);
857
858 /**
859 * \brief Copy a portion of the texture to the current rendering target.
860 *
861 * \param renderer The renderer which should copy parts of a texture.
862 * \param texture The source texture.
863 * \param srcrect A pointer to the source rectangle, or NULL for the entire
864 * texture.
865 * \param dstrect A pointer to the destination rectangle, or NULL for the
866 * entire rendering target.
867 *
868 * \return 0 on success, or -1 on error
869 */
870 extern DECLSPEC int SDLCALL SDL_RenderCopy(SDL_Renderer * renderer,
871 SDL_Texture * texture,
872 const SDL_Rect * srcrect,
873 const SDL_Rect * dstrect);
874
875 /**
876 * \brief Copy a portion of the source texture to the current rendering target, rotating it by angle around the given center
877 *
878 * \param renderer The renderer which should copy parts of a texture.
879 * \param texture The source texture.
880 * \param srcrect A pointer to the source rectangle, or NULL for the entire
881 * texture.
882 * \param dstrect A pointer to the destination rectangle, or NULL for the
883 * entire rendering target.
884 * \param angle An angle in degrees that indicates the rotation that will be applied to dstrect, rotating it in a clockwise direction
885 * \param center A pointer to a point indicating the point around which dstrect will be rotated (if NULL, rotation will be done around dstrect.w/2, dstrect.h/2).
886 * \param flip An SDL_RendererFlip value stating which flipping actions should be performed on the texture
887 *
888 * \return 0 on success, or -1 on error
889 */
890 extern DECLSPEC int SDLCALL SDL_RenderCopyEx(SDL_Renderer * renderer,
891 SDL_Texture * texture,
892 const SDL_Rect * srcrect,
893 const SDL_Rect * dstrect,
894 const double angle,
895 const SDL_Point *center,
896 const SDL_RendererFlip flip);
897
898
899 /**
900 * \brief Draw a point on the current rendering target.
901 *
902 * \param renderer The renderer which should draw a point.
903 * \param x The x coordinate of the point.
904 * \param y The y coordinate of the point.
905 *
906 * \return 0 on success, or -1 on error
907 */
908 extern DECLSPEC int SDLCALL SDL_RenderDrawPointF(SDL_Renderer * renderer,
909 float x, float y);
910
911 /**
912 * \brief Draw multiple points on the current rendering target.
913 *
914 * \param renderer The renderer which should draw multiple points.
915 * \param points The points to draw
916 * \param count The number of points to draw
917 *
918 * \return 0 on success, or -1 on error
919 */
920 extern DECLSPEC int SDLCALL SDL_RenderDrawPointsF(SDL_Renderer * renderer,
921 const SDL_FPoint * points,
922 int count);
923
924 /**
925 * \brief Draw a line on the current rendering target.
926 *
927 * \param renderer The renderer which should draw a line.
928 * \param x1 The x coordinate of the start point.
929 * \param y1 The y coordinate of the start point.
930 * \param x2 The x coordinate of the end point.
931 * \param y2 The y coordinate of the end point.
932 *
933 * \return 0 on success, or -1 on error
934 */
935 extern DECLSPEC int SDLCALL SDL_RenderDrawLineF(SDL_Renderer * renderer,
936 float x1, float y1, float x2, float y2);
937
938 /**
939 * \brief Draw a series of connected lines on the current rendering target.
940 *
941 * \param renderer The renderer which should draw multiple lines.
942 * \param points The points along the lines
943 * \param count The number of points, drawing count-1 lines
944 *
945 * \return 0 on success, or -1 on error
946 */
947 extern DECLSPEC int SDLCALL SDL_RenderDrawLinesF(SDL_Renderer * renderer,
948 const SDL_FPoint * points,
949 int count);
950
951 /**
952 * \brief Draw a rectangle on the current rendering target.
953 *
954 * \param renderer The renderer which should draw a rectangle.
955 * \param rect A pointer to the destination rectangle, or NULL to outline the entire rendering target.
956 *
957 * \return 0 on success, or -1 on error
958 */
959 extern DECLSPEC int SDLCALL SDL_RenderDrawRectF(SDL_Renderer * renderer,
960 const SDL_FRect * rect);
961
962 /**
963 * \brief Draw some number of rectangles on the current rendering target.
964 *
965 * \param renderer The renderer which should draw multiple rectangles.
966 * \param rects A pointer to an array of destination rectangles.
967 * \param count The number of rectangles.
968 *
969 * \return 0 on success, or -1 on error
970 */
971 extern DECLSPEC int SDLCALL SDL_RenderDrawRectsF(SDL_Renderer * renderer,
972 const SDL_FRect * rects,
973 int count);
974
975 /**
976 * \brief Fill a rectangle on the current rendering target with the drawing color.
977 *
978 * \param renderer The renderer which should fill a rectangle.
979 * \param rect A pointer to the destination rectangle, or NULL for the entire
980 * rendering target.
981 *
982 * \return 0 on success, or -1 on error
983 */
984 extern DECLSPEC int SDLCALL SDL_RenderFillRectF(SDL_Renderer * renderer,
985 const SDL_FRect * rect);
986
987 /**
988 * \brief Fill some number of rectangles on the current rendering target with the drawing color.
989 *
990 * \param renderer The renderer which should fill multiple rectangles.
991 * \param rects A pointer to an array of destination rectangles.
992 * \param count The number of rectangles.
993 *
994 * \return 0 on success, or -1 on error
995 */
996 extern DECLSPEC int SDLCALL SDL_RenderFillRectsF(SDL_Renderer * renderer,
997 const SDL_FRect * rects,
998 int count);
999
1000 /**
1001 * \brief Copy a portion of the texture to the current rendering target.
1002 *
1003 * \param renderer The renderer which should copy parts of a texture.
1004 * \param texture The source texture.
1005 * \param srcrect A pointer to the source rectangle, or NULL for the entire
1006 * texture.
1007 * \param dstrect A pointer to the destination rectangle, or NULL for the
1008 * entire rendering target.
1009 *
1010 * \return 0 on success, or -1 on error
1011 */
1012 extern DECLSPEC int SDLCALL SDL_RenderCopyF(SDL_Renderer * renderer,
1013 SDL_Texture * texture,
1014 const SDL_Rect * srcrect,
1015 const SDL_FRect * dstrect);
1016
1017 /**
1018 * \brief Copy a portion of the source texture to the current rendering target, rotating it by angle around the given center
1019 *
1020 * \param renderer The renderer which should copy parts of a texture.
1021 * \param texture The source texture.
1022 * \param srcrect A pointer to the source rectangle, or NULL for the entire
1023 * texture.
1024 * \param dstrect A pointer to the destination rectangle, or NULL for the
1025 * entire rendering target.
1026 * \param angle An angle in degrees that indicates the rotation that will be applied to dstrect, rotating it in a clockwise direction
1027 * \param center A pointer to a point indicating the point around which dstrect will be rotated (if NULL, rotation will be done around dstrect.w/2, dstrect.h/2).
1028 * \param flip An SDL_RendererFlip value stating which flipping actions should be performed on the texture
1029 *
1030 * \return 0 on success, or -1 on error
1031 */
1032 extern DECLSPEC int SDLCALL SDL_RenderCopyExF(SDL_Renderer * renderer,
1033 SDL_Texture * texture,
1034 const SDL_Rect * srcrect,
1035 const SDL_FRect * dstrect,
1036 const double angle,
1037 const SDL_FPoint *center,
1038 const SDL_RendererFlip flip);
1039
1040 /**
1041 * \brief Read pixels from the current rendering target.
1042 *
1043 * \param renderer The renderer from which pixels should be read.
1044 * \param rect A pointer to the rectangle to read, or NULL for the entire
1045 * render target.
1046 * \param format The desired format of the pixel data, or 0 to use the format
1047 * of the rendering target
1048 * \param pixels A pointer to be filled in with the pixel data
1049 * \param pitch The pitch of the pixels parameter.
1050 *
1051 * \return 0 on success, or -1 if pixel reading is not supported.
1052 *
1053 * \warning This is a very slow operation, and should not be used frequently.
1054 */
1055 extern DECLSPEC int SDLCALL SDL_RenderReadPixels(SDL_Renderer * renderer,
1056 const SDL_Rect * rect,
1057 Uint32 format,
1058 void *pixels, int pitch);
1059
1060 /**
1061 * \brief Update the screen with rendering performed.
1062 */
1063 extern DECLSPEC void SDLCALL SDL_RenderPresent(SDL_Renderer * renderer);
1064
1065 /**
1066 * \brief Destroy the specified texture.
1067 *
1068 * \sa SDL_CreateTexture()
1069 * \sa SDL_CreateTextureFromSurface()
1070 */
1071 extern DECLSPEC void SDLCALL SDL_DestroyTexture(SDL_Texture * texture);
1072
1073 /**
1074 * \brief Destroy the rendering context for a window and free associated
1075 * textures.
1076 *
1077 * \sa SDL_CreateRenderer()
1078 */
1079 extern DECLSPEC void SDLCALL SDL_DestroyRenderer(SDL_Renderer * renderer);
1080
1081 /**
1082 * \brief Force the rendering context to flush any pending commands to the
1083 * underlying rendering API.
1084 *
1085 * You do not need to (and in fact, shouldn't) call this function unless
1086 * you are planning to call into OpenGL/Direct3D/Metal/whatever directly
1087 * in addition to using an SDL_Renderer.
1088 *
1089 * This is for a very-specific case: if you are using SDL's render API,
1090 * you asked for a specific renderer backend (OpenGL, Direct3D, etc),
1091 * you set SDL_HINT_RENDER_BATCHING to "1", and you plan to make
1092 * OpenGL/D3D/whatever calls in addition to SDL render API calls. If all of
1093 * this applies, you should call SDL_RenderFlush() between calls to SDL's
1094 * render API and the low-level API you're using in cooperation.
1095 *
1096 * In all other cases, you can ignore this function. This is only here to
1097 * get maximum performance out of a specific situation. In all other cases,
1098 * SDL will do the right thing, perhaps at a performance loss.
1099 *
1100 * This function is first available in SDL 2.0.10, and is not needed in
1101 * 2.0.9 and earlier, as earlier versions did not queue rendering commands
1102 * at all, instead flushing them to the OS immediately.
1103 */
1104 extern DECLSPEC int SDLCALL SDL_RenderFlush(SDL_Renderer * renderer);
1105
1106
1107 /**
1108 * \brief Bind the texture to the current OpenGL/ES/ES2 context for use with
1109 * OpenGL instructions.
1110 *
1111 * \param texture The SDL texture to bind
1112 * \param texw A pointer to a float that will be filled with the texture width
1113 * \param texh A pointer to a float that will be filled with the texture height
1114 *
1115 * \return 0 on success, or -1 if the operation is not supported
1116 */
1117 extern DECLSPEC int SDLCALL SDL_GL_BindTexture(SDL_Texture *texture, float *texw, float *texh);
1118
1119 /**
1120 * \brief Unbind a texture from the current OpenGL/ES/ES2 context.
1121 *
1122 * \param texture The SDL texture to unbind
1123 *
1124 * \return 0 on success, or -1 if the operation is not supported
1125 */
1126 extern DECLSPEC int SDLCALL SDL_GL_UnbindTexture(SDL_Texture *texture);
1127
1128 /**
1129 * \brief Get the CAMetalLayer associated with the given Metal renderer
1130 *
1131 * \param renderer The renderer to query
1132 *
1133 * \return CAMetalLayer* on success, or NULL if the renderer isn't a Metal renderer
1134 *
1135 * \sa SDL_RenderGetMetalCommandEncoder()
1136 */
1137 extern DECLSPEC void *SDLCALL SDL_RenderGetMetalLayer(SDL_Renderer * renderer);
1138
1139 /**
1140 * \brief Get the Metal command encoder for the current frame
1141 *
1142 * \param renderer The renderer to query
1143 *
1144 * \return id<MTLRenderCommandEncoder> on success, or NULL if the renderer isn't a Metal renderer
1145 *
1146 * \sa SDL_RenderGetMetalLayer()
1147 */
1148 extern DECLSPEC void *SDLCALL SDL_RenderGetMetalCommandEncoder(SDL_Renderer * renderer);
1149
1150 /* Ends C function definitions when using C++ */
1151 #ifdef __cplusplus
1152 }
1153 #endif
1154 #include "close_code.h"
1155
1156 #endif /* SDL_render_h_ */
1157
1158 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_revision.h added (mode: 100644) (index 0000000..e0bcf43)
1 #define SDL_REVISION "hg-14525:e52d96ea04fc"
2 #define SDL_REVISION_NUMBER 14525
File include/SDL2/SDL_rwops.h added (mode: 100644) (index 0000000..2e6225f)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_rwops.h
24 *
25 * This file provides a general interface for SDL to read and write
26 * data streams. It can easily be extended to files, memory, etc.
27 */
28
29 #ifndef SDL_rwops_h_
30 #define SDL_rwops_h_
31
32 #include "SDL_stdinc.h"
33 #include "SDL_error.h"
34
35 #include "begin_code.h"
36 /* Set up for C function definitions, even when using C++ */
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40
41 /* RWops Types */
42 #define SDL_RWOPS_UNKNOWN 0U /**< Unknown stream type */
43 #define SDL_RWOPS_WINFILE 1U /**< Win32 file */
44 #define SDL_RWOPS_STDFILE 2U /**< Stdio file */
45 #define SDL_RWOPS_JNIFILE 3U /**< Android asset */
46 #define SDL_RWOPS_MEMORY 4U /**< Memory stream */
47 #define SDL_RWOPS_MEMORY_RO 5U /**< Read-Only memory stream */
48
49 /**
50 * This is the read/write operation structure -- very basic.
51 */
52 typedef struct SDL_RWops
53 {
54 /**
55 * Return the size of the file in this rwops, or -1 if unknown
56 */
57 Sint64 (SDLCALL * size) (struct SDL_RWops * context);
58
59 /**
60 * Seek to \c offset relative to \c whence, one of stdio's whence values:
61 * RW_SEEK_SET, RW_SEEK_CUR, RW_SEEK_END
62 *
63 * \return the final offset in the data stream, or -1 on error.
64 */
65 Sint64 (SDLCALL * seek) (struct SDL_RWops * context, Sint64 offset,
66 int whence);
67
68 /**
69 * Read up to \c maxnum objects each of size \c size from the data
70 * stream to the area pointed at by \c ptr.
71 *
72 * \return the number of objects read, or 0 at error or end of file.
73 */
74 size_t (SDLCALL * read) (struct SDL_RWops * context, void *ptr,
75 size_t size, size_t maxnum);
76
77 /**
78 * Write exactly \c num objects each of size \c size from the area
79 * pointed at by \c ptr to data stream.
80 *
81 * \return the number of objects written, or 0 at error or end of file.
82 */
83 size_t (SDLCALL * write) (struct SDL_RWops * context, const void *ptr,
84 size_t size, size_t num);
85
86 /**
87 * Close and free an allocated SDL_RWops structure.
88 *
89 * \return 0 if successful or -1 on write error when flushing data.
90 */
91 int (SDLCALL * close) (struct SDL_RWops * context);
92
93 Uint32 type;
94 union
95 {
96 #if defined(__ANDROID__)
97 struct
98 {
99 void *asset;
100 } androidio;
101 #elif defined(__WIN32__)
102 struct
103 {
104 SDL_bool append;
105 void *h;
106 struct
107 {
108 void *data;
109 size_t size;
110 size_t left;
111 } buffer;
112 } windowsio;
113 #endif
114
115 #ifdef HAVE_STDIO_H
116 struct
117 {
118 SDL_bool autoclose;
119 FILE *fp;
120 } stdio;
121 #endif
122 struct
123 {
124 Uint8 *base;
125 Uint8 *here;
126 Uint8 *stop;
127 } mem;
128 struct
129 {
130 void *data1;
131 void *data2;
132 } unknown;
133 } hidden;
134
135 } SDL_RWops;
136
137
138 /**
139 * \name RWFrom functions
140 *
141 * Functions to create SDL_RWops structures from various data streams.
142 */
143 /* @{ */
144
145 extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFile(const char *file,
146 const char *mode);
147
148 #ifdef HAVE_STDIO_H
149 extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(FILE * fp,
150 SDL_bool autoclose);
151 #else
152 extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(void * fp,
153 SDL_bool autoclose);
154 #endif
155
156 extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromMem(void *mem, int size);
157 extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromConstMem(const void *mem,
158 int size);
159
160 /* @} *//* RWFrom functions */
161
162
163 extern DECLSPEC SDL_RWops *SDLCALL SDL_AllocRW(void);
164 extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops * area);
165
166 #define RW_SEEK_SET 0 /**< Seek from the beginning of data */
167 #define RW_SEEK_CUR 1 /**< Seek relative to current read point */
168 #define RW_SEEK_END 2 /**< Seek relative to the end of data */
169
170 /**
171 * Return the size of the file in this rwops, or -1 if unknown
172 */
173 extern DECLSPEC Sint64 SDLCALL SDL_RWsize(SDL_RWops *context);
174
175 /**
176 * Seek to \c offset relative to \c whence, one of stdio's whence values:
177 * RW_SEEK_SET, RW_SEEK_CUR, RW_SEEK_END
178 *
179 * \return the final offset in the data stream, or -1 on error.
180 */
181 extern DECLSPEC Sint64 SDLCALL SDL_RWseek(SDL_RWops *context,
182 Sint64 offset, int whence);
183
184 /**
185 * Return the current offset in the data stream, or -1 on error.
186 */
187 extern DECLSPEC Sint64 SDLCALL SDL_RWtell(SDL_RWops *context);
188
189 /**
190 * Read up to \c maxnum objects each of size \c size from the data
191 * stream to the area pointed at by \c ptr.
192 *
193 * \return the number of objects read, or 0 at error or end of file.
194 */
195 extern DECLSPEC size_t SDLCALL SDL_RWread(SDL_RWops *context,
196 void *ptr, size_t size, size_t maxnum);
197
198 /**
199 * Write exactly \c num objects each of size \c size from the area
200 * pointed at by \c ptr to data stream.
201 *
202 * \return the number of objects written, or 0 at error or end of file.
203 */
204 extern DECLSPEC size_t SDLCALL SDL_RWwrite(SDL_RWops *context,
205 const void *ptr, size_t size, size_t num);
206
207 /**
208 * Close and free an allocated SDL_RWops structure.
209 *
210 * \return 0 if successful or -1 on write error when flushing data.
211 */
212 extern DECLSPEC int SDLCALL SDL_RWclose(SDL_RWops *context);
213
214 /**
215 * Load all the data from an SDL data stream.
216 *
217 * The data is allocated with a zero byte at the end (null terminated)
218 *
219 * If \c datasize is not NULL, it is filled with the size of the data read.
220 *
221 * If \c freesrc is non-zero, the stream will be closed after being read.
222 *
223 * The data should be freed with SDL_free().
224 *
225 * \return the data, or NULL if there was an error.
226 */
227 extern DECLSPEC void *SDLCALL SDL_LoadFile_RW(SDL_RWops * src, size_t *datasize,
228 int freesrc);
229
230 /**
231 * Load an entire file.
232 *
233 * The data is allocated with a zero byte at the end (null terminated)
234 *
235 * If \c datasize is not NULL, it is filled with the size of the data read.
236 *
237 * If \c freesrc is non-zero, the stream will be closed after being read.
238 *
239 * The data should be freed with SDL_free().
240 *
241 * \return the data, or NULL if there was an error.
242 */
243 extern DECLSPEC void *SDLCALL SDL_LoadFile(const char *file, size_t *datasize);
244
245 /**
246 * \name Read endian functions
247 *
248 * Read an item of the specified endianness and return in native format.
249 */
250 /* @{ */
251 extern DECLSPEC Uint8 SDLCALL SDL_ReadU8(SDL_RWops * src);
252 extern DECLSPEC Uint16 SDLCALL SDL_ReadLE16(SDL_RWops * src);
253 extern DECLSPEC Uint16 SDLCALL SDL_ReadBE16(SDL_RWops * src);
254 extern DECLSPEC Uint32 SDLCALL SDL_ReadLE32(SDL_RWops * src);
255 extern DECLSPEC Uint32 SDLCALL SDL_ReadBE32(SDL_RWops * src);
256 extern DECLSPEC Uint64 SDLCALL SDL_ReadLE64(SDL_RWops * src);
257 extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops * src);
258 /* @} *//* Read endian functions */
259
260 /**
261 * \name Write endian functions
262 *
263 * Write an item of native format to the specified endianness.
264 */
265 /* @{ */
266 extern DECLSPEC size_t SDLCALL SDL_WriteU8(SDL_RWops * dst, Uint8 value);
267 extern DECLSPEC size_t SDLCALL SDL_WriteLE16(SDL_RWops * dst, Uint16 value);
268 extern DECLSPEC size_t SDLCALL SDL_WriteBE16(SDL_RWops * dst, Uint16 value);
269 extern DECLSPEC size_t SDLCALL SDL_WriteLE32(SDL_RWops * dst, Uint32 value);
270 extern DECLSPEC size_t SDLCALL SDL_WriteBE32(SDL_RWops * dst, Uint32 value);
271 extern DECLSPEC size_t SDLCALL SDL_WriteLE64(SDL_RWops * dst, Uint64 value);
272 extern DECLSPEC size_t SDLCALL SDL_WriteBE64(SDL_RWops * dst, Uint64 value);
273 /* @} *//* Write endian functions */
274
275 /* Ends C function definitions when using C++ */
276 #ifdef __cplusplus
277 }
278 #endif
279 #include "close_code.h"
280
281 #endif /* SDL_rwops_h_ */
282
283 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_scancode.h added (mode: 100644) (index 0000000..b19197d)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_scancode.h
24 *
25 * Defines keyboard scancodes.
26 */
27
28 #ifndef SDL_scancode_h_
29 #define SDL_scancode_h_
30
31 #include "SDL_stdinc.h"
32
33 /**
34 * \brief The SDL keyboard scancode representation.
35 *
36 * Values of this type are used to represent keyboard keys, among other places
37 * in the \link SDL_Keysym::scancode key.keysym.scancode \endlink field of the
38 * SDL_Event structure.
39 *
40 * The values in this enumeration are based on the USB usage page standard:
41 * https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf
42 */
43 typedef enum
44 {
45 SDL_SCANCODE_UNKNOWN = 0,
46
47 /**
48 * \name Usage page 0x07
49 *
50 * These values are from usage page 0x07 (USB keyboard page).
51 */
52 /* @{ */
53
54 SDL_SCANCODE_A = 4,
55 SDL_SCANCODE_B = 5,
56 SDL_SCANCODE_C = 6,
57 SDL_SCANCODE_D = 7,
58 SDL_SCANCODE_E = 8,
59 SDL_SCANCODE_F = 9,
60 SDL_SCANCODE_G = 10,
61 SDL_SCANCODE_H = 11,
62 SDL_SCANCODE_I = 12,
63 SDL_SCANCODE_J = 13,
64 SDL_SCANCODE_K = 14,
65 SDL_SCANCODE_L = 15,
66 SDL_SCANCODE_M = 16,
67 SDL_SCANCODE_N = 17,
68 SDL_SCANCODE_O = 18,
69 SDL_SCANCODE_P = 19,
70 SDL_SCANCODE_Q = 20,
71 SDL_SCANCODE_R = 21,
72 SDL_SCANCODE_S = 22,
73 SDL_SCANCODE_T = 23,
74 SDL_SCANCODE_U = 24,
75 SDL_SCANCODE_V = 25,
76 SDL_SCANCODE_W = 26,
77 SDL_SCANCODE_X = 27,
78 SDL_SCANCODE_Y = 28,
79 SDL_SCANCODE_Z = 29,
80
81 SDL_SCANCODE_1 = 30,
82 SDL_SCANCODE_2 = 31,
83 SDL_SCANCODE_3 = 32,
84 SDL_SCANCODE_4 = 33,
85 SDL_SCANCODE_5 = 34,
86 SDL_SCANCODE_6 = 35,
87 SDL_SCANCODE_7 = 36,
88 SDL_SCANCODE_8 = 37,
89 SDL_SCANCODE_9 = 38,
90 SDL_SCANCODE_0 = 39,
91
92 SDL_SCANCODE_RETURN = 40,
93 SDL_SCANCODE_ESCAPE = 41,
94 SDL_SCANCODE_BACKSPACE = 42,
95 SDL_SCANCODE_TAB = 43,
96 SDL_SCANCODE_SPACE = 44,
97
98 SDL_SCANCODE_MINUS = 45,
99 SDL_SCANCODE_EQUALS = 46,
100 SDL_SCANCODE_LEFTBRACKET = 47,
101 SDL_SCANCODE_RIGHTBRACKET = 48,
102 SDL_SCANCODE_BACKSLASH = 49, /**< Located at the lower left of the return
103 * key on ISO keyboards and at the right end
104 * of the QWERTY row on ANSI keyboards.
105 * Produces REVERSE SOLIDUS (backslash) and
106 * VERTICAL LINE in a US layout, REVERSE
107 * SOLIDUS and VERTICAL LINE in a UK Mac
108 * layout, NUMBER SIGN and TILDE in a UK
109 * Windows layout, DOLLAR SIGN and POUND SIGN
110 * in a Swiss German layout, NUMBER SIGN and
111 * APOSTROPHE in a German layout, GRAVE
112 * ACCENT and POUND SIGN in a French Mac
113 * layout, and ASTERISK and MICRO SIGN in a
114 * French Windows layout.
115 */
116 SDL_SCANCODE_NONUSHASH = 50, /**< ISO USB keyboards actually use this code
117 * instead of 49 for the same key, but all
118 * OSes I've seen treat the two codes
119 * identically. So, as an implementor, unless
120 * your keyboard generates both of those
121 * codes and your OS treats them differently,
122 * you should generate SDL_SCANCODE_BACKSLASH
123 * instead of this code. As a user, you
124 * should not rely on this code because SDL
125 * will never generate it with most (all?)
126 * keyboards.
127 */
128 SDL_SCANCODE_SEMICOLON = 51,
129 SDL_SCANCODE_APOSTROPHE = 52,
130 SDL_SCANCODE_GRAVE = 53, /**< Located in the top left corner (on both ANSI
131 * and ISO keyboards). Produces GRAVE ACCENT and
132 * TILDE in a US Windows layout and in US and UK
133 * Mac layouts on ANSI keyboards, GRAVE ACCENT
134 * and NOT SIGN in a UK Windows layout, SECTION
135 * SIGN and PLUS-MINUS SIGN in US and UK Mac
136 * layouts on ISO keyboards, SECTION SIGN and
137 * DEGREE SIGN in a Swiss German layout (Mac:
138 * only on ISO keyboards), CIRCUMFLEX ACCENT and
139 * DEGREE SIGN in a German layout (Mac: only on
140 * ISO keyboards), SUPERSCRIPT TWO and TILDE in a
141 * French Windows layout, COMMERCIAL AT and
142 * NUMBER SIGN in a French Mac layout on ISO
143 * keyboards, and LESS-THAN SIGN and GREATER-THAN
144 * SIGN in a Swiss German, German, or French Mac
145 * layout on ANSI keyboards.
146 */
147 SDL_SCANCODE_COMMA = 54,
148 SDL_SCANCODE_PERIOD = 55,
149 SDL_SCANCODE_SLASH = 56,
150
151 SDL_SCANCODE_CAPSLOCK = 57,
152
153 SDL_SCANCODE_F1 = 58,
154 SDL_SCANCODE_F2 = 59,
155 SDL_SCANCODE_F3 = 60,
156 SDL_SCANCODE_F4 = 61,
157 SDL_SCANCODE_F5 = 62,
158 SDL_SCANCODE_F6 = 63,
159 SDL_SCANCODE_F7 = 64,
160 SDL_SCANCODE_F8 = 65,
161 SDL_SCANCODE_F9 = 66,
162 SDL_SCANCODE_F10 = 67,
163 SDL_SCANCODE_F11 = 68,
164 SDL_SCANCODE_F12 = 69,
165
166 SDL_SCANCODE_PRINTSCREEN = 70,
167 SDL_SCANCODE_SCROLLLOCK = 71,
168 SDL_SCANCODE_PAUSE = 72,
169 SDL_SCANCODE_INSERT = 73, /**< insert on PC, help on some Mac keyboards (but
170 does send code 73, not 117) */
171 SDL_SCANCODE_HOME = 74,
172 SDL_SCANCODE_PAGEUP = 75,
173 SDL_SCANCODE_DELETE = 76,
174 SDL_SCANCODE_END = 77,
175 SDL_SCANCODE_PAGEDOWN = 78,
176 SDL_SCANCODE_RIGHT = 79,
177 SDL_SCANCODE_LEFT = 80,
178 SDL_SCANCODE_DOWN = 81,
179 SDL_SCANCODE_UP = 82,
180
181 SDL_SCANCODE_NUMLOCKCLEAR = 83, /**< num lock on PC, clear on Mac keyboards
182 */
183 SDL_SCANCODE_KP_DIVIDE = 84,
184 SDL_SCANCODE_KP_MULTIPLY = 85,
185 SDL_SCANCODE_KP_MINUS = 86,
186 SDL_SCANCODE_KP_PLUS = 87,
187 SDL_SCANCODE_KP_ENTER = 88,
188 SDL_SCANCODE_KP_1 = 89,
189 SDL_SCANCODE_KP_2 = 90,
190 SDL_SCANCODE_KP_3 = 91,
191 SDL_SCANCODE_KP_4 = 92,
192 SDL_SCANCODE_KP_5 = 93,
193 SDL_SCANCODE_KP_6 = 94,
194 SDL_SCANCODE_KP_7 = 95,
195 SDL_SCANCODE_KP_8 = 96,
196 SDL_SCANCODE_KP_9 = 97,
197 SDL_SCANCODE_KP_0 = 98,
198 SDL_SCANCODE_KP_PERIOD = 99,
199
200 SDL_SCANCODE_NONUSBACKSLASH = 100, /**< This is the additional key that ISO
201 * keyboards have over ANSI ones,
202 * located between left shift and Y.
203 * Produces GRAVE ACCENT and TILDE in a
204 * US or UK Mac layout, REVERSE SOLIDUS
205 * (backslash) and VERTICAL LINE in a
206 * US or UK Windows layout, and
207 * LESS-THAN SIGN and GREATER-THAN SIGN
208 * in a Swiss German, German, or French
209 * layout. */
210 SDL_SCANCODE_APPLICATION = 101, /**< windows contextual menu, compose */
211 SDL_SCANCODE_POWER = 102, /**< The USB document says this is a status flag,
212 * not a physical key - but some Mac keyboards
213 * do have a power key. */
214 SDL_SCANCODE_KP_EQUALS = 103,
215 SDL_SCANCODE_F13 = 104,
216 SDL_SCANCODE_F14 = 105,
217 SDL_SCANCODE_F15 = 106,
218 SDL_SCANCODE_F16 = 107,
219 SDL_SCANCODE_F17 = 108,
220 SDL_SCANCODE_F18 = 109,
221 SDL_SCANCODE_F19 = 110,
222 SDL_SCANCODE_F20 = 111,
223 SDL_SCANCODE_F21 = 112,
224 SDL_SCANCODE_F22 = 113,
225 SDL_SCANCODE_F23 = 114,
226 SDL_SCANCODE_F24 = 115,
227 SDL_SCANCODE_EXECUTE = 116,
228 SDL_SCANCODE_HELP = 117,
229 SDL_SCANCODE_MENU = 118,
230 SDL_SCANCODE_SELECT = 119,
231 SDL_SCANCODE_STOP = 120,
232 SDL_SCANCODE_AGAIN = 121, /**< redo */
233 SDL_SCANCODE_UNDO = 122,
234 SDL_SCANCODE_CUT = 123,
235 SDL_SCANCODE_COPY = 124,
236 SDL_SCANCODE_PASTE = 125,
237 SDL_SCANCODE_FIND = 126,
238 SDL_SCANCODE_MUTE = 127,
239 SDL_SCANCODE_VOLUMEUP = 128,
240 SDL_SCANCODE_VOLUMEDOWN = 129,
241 /* not sure whether there's a reason to enable these */
242 /* SDL_SCANCODE_LOCKINGCAPSLOCK = 130, */
243 /* SDL_SCANCODE_LOCKINGNUMLOCK = 131, */
244 /* SDL_SCANCODE_LOCKINGSCROLLLOCK = 132, */
245 SDL_SCANCODE_KP_COMMA = 133,
246 SDL_SCANCODE_KP_EQUALSAS400 = 134,
247
248 SDL_SCANCODE_INTERNATIONAL1 = 135, /**< used on Asian keyboards, see
249 footnotes in USB doc */
250 SDL_SCANCODE_INTERNATIONAL2 = 136,
251 SDL_SCANCODE_INTERNATIONAL3 = 137, /**< Yen */
252 SDL_SCANCODE_INTERNATIONAL4 = 138,
253 SDL_SCANCODE_INTERNATIONAL5 = 139,
254 SDL_SCANCODE_INTERNATIONAL6 = 140,
255 SDL_SCANCODE_INTERNATIONAL7 = 141,
256 SDL_SCANCODE_INTERNATIONAL8 = 142,
257 SDL_SCANCODE_INTERNATIONAL9 = 143,
258 SDL_SCANCODE_LANG1 = 144, /**< Hangul/English toggle */
259 SDL_SCANCODE_LANG2 = 145, /**< Hanja conversion */
260 SDL_SCANCODE_LANG3 = 146, /**< Katakana */
261 SDL_SCANCODE_LANG4 = 147, /**< Hiragana */
262 SDL_SCANCODE_LANG5 = 148, /**< Zenkaku/Hankaku */
263 SDL_SCANCODE_LANG6 = 149, /**< reserved */
264 SDL_SCANCODE_LANG7 = 150, /**< reserved */
265 SDL_SCANCODE_LANG8 = 151, /**< reserved */
266 SDL_SCANCODE_LANG9 = 152, /**< reserved */
267
268 SDL_SCANCODE_ALTERASE = 153, /**< Erase-Eaze */
269 SDL_SCANCODE_SYSREQ = 154,
270 SDL_SCANCODE_CANCEL = 155,
271 SDL_SCANCODE_CLEAR = 156,
272 SDL_SCANCODE_PRIOR = 157,
273 SDL_SCANCODE_RETURN2 = 158,
274 SDL_SCANCODE_SEPARATOR = 159,
275 SDL_SCANCODE_OUT = 160,
276 SDL_SCANCODE_OPER = 161,
277 SDL_SCANCODE_CLEARAGAIN = 162,
278 SDL_SCANCODE_CRSEL = 163,
279 SDL_SCANCODE_EXSEL = 164,
280
281 SDL_SCANCODE_KP_00 = 176,
282 SDL_SCANCODE_KP_000 = 177,
283 SDL_SCANCODE_THOUSANDSSEPARATOR = 178,
284 SDL_SCANCODE_DECIMALSEPARATOR = 179,
285 SDL_SCANCODE_CURRENCYUNIT = 180,
286 SDL_SCANCODE_CURRENCYSUBUNIT = 181,
287 SDL_SCANCODE_KP_LEFTPAREN = 182,
288 SDL_SCANCODE_KP_RIGHTPAREN = 183,
289 SDL_SCANCODE_KP_LEFTBRACE = 184,
290 SDL_SCANCODE_KP_RIGHTBRACE = 185,
291 SDL_SCANCODE_KP_TAB = 186,
292 SDL_SCANCODE_KP_BACKSPACE = 187,
293 SDL_SCANCODE_KP_A = 188,
294 SDL_SCANCODE_KP_B = 189,
295 SDL_SCANCODE_KP_C = 190,
296 SDL_SCANCODE_KP_D = 191,
297 SDL_SCANCODE_KP_E = 192,
298 SDL_SCANCODE_KP_F = 193,
299 SDL_SCANCODE_KP_XOR = 194,
300 SDL_SCANCODE_KP_POWER = 195,
301 SDL_SCANCODE_KP_PERCENT = 196,
302 SDL_SCANCODE_KP_LESS = 197,
303 SDL_SCANCODE_KP_GREATER = 198,
304 SDL_SCANCODE_KP_AMPERSAND = 199,
305 SDL_SCANCODE_KP_DBLAMPERSAND = 200,
306 SDL_SCANCODE_KP_VERTICALBAR = 201,
307 SDL_SCANCODE_KP_DBLVERTICALBAR = 202,
308 SDL_SCANCODE_KP_COLON = 203,
309 SDL_SCANCODE_KP_HASH = 204,
310 SDL_SCANCODE_KP_SPACE = 205,
311 SDL_SCANCODE_KP_AT = 206,
312 SDL_SCANCODE_KP_EXCLAM = 207,
313 SDL_SCANCODE_KP_MEMSTORE = 208,
314 SDL_SCANCODE_KP_MEMRECALL = 209,
315 SDL_SCANCODE_KP_MEMCLEAR = 210,
316 SDL_SCANCODE_KP_MEMADD = 211,
317 SDL_SCANCODE_KP_MEMSUBTRACT = 212,
318 SDL_SCANCODE_KP_MEMMULTIPLY = 213,
319 SDL_SCANCODE_KP_MEMDIVIDE = 214,
320 SDL_SCANCODE_KP_PLUSMINUS = 215,
321 SDL_SCANCODE_KP_CLEAR = 216,
322 SDL_SCANCODE_KP_CLEARENTRY = 217,
323 SDL_SCANCODE_KP_BINARY = 218,
324 SDL_SCANCODE_KP_OCTAL = 219,
325 SDL_SCANCODE_KP_DECIMAL = 220,
326 SDL_SCANCODE_KP_HEXADECIMAL = 221,
327
328 SDL_SCANCODE_LCTRL = 224,
329 SDL_SCANCODE_LSHIFT = 225,
330 SDL_SCANCODE_LALT = 226, /**< alt, option */
331 SDL_SCANCODE_LGUI = 227, /**< windows, command (apple), meta */
332 SDL_SCANCODE_RCTRL = 228,
333 SDL_SCANCODE_RSHIFT = 229,
334 SDL_SCANCODE_RALT = 230, /**< alt gr, option */
335 SDL_SCANCODE_RGUI = 231, /**< windows, command (apple), meta */
336
337 SDL_SCANCODE_MODE = 257, /**< I'm not sure if this is really not covered
338 * by any of the above, but since there's a
339 * special KMOD_MODE for it I'm adding it here
340 */
341
342 /* @} *//* Usage page 0x07 */
343
344 /**
345 * \name Usage page 0x0C
346 *
347 * These values are mapped from usage page 0x0C (USB consumer page).
348 */
349 /* @{ */
350
351 SDL_SCANCODE_AUDIONEXT = 258,
352 SDL_SCANCODE_AUDIOPREV = 259,
353 SDL_SCANCODE_AUDIOSTOP = 260,
354 SDL_SCANCODE_AUDIOPLAY = 261,
355 SDL_SCANCODE_AUDIOMUTE = 262,
356 SDL_SCANCODE_MEDIASELECT = 263,
357 SDL_SCANCODE_WWW = 264,
358 SDL_SCANCODE_MAIL = 265,
359 SDL_SCANCODE_CALCULATOR = 266,
360 SDL_SCANCODE_COMPUTER = 267,
361 SDL_SCANCODE_AC_SEARCH = 268,
362 SDL_SCANCODE_AC_HOME = 269,
363 SDL_SCANCODE_AC_BACK = 270,
364 SDL_SCANCODE_AC_FORWARD = 271,
365 SDL_SCANCODE_AC_STOP = 272,
366 SDL_SCANCODE_AC_REFRESH = 273,
367 SDL_SCANCODE_AC_BOOKMARKS = 274,
368
369 /* @} *//* Usage page 0x0C */
370
371 /**
372 * \name Walther keys
373 *
374 * These are values that Christian Walther added (for mac keyboard?).
375 */
376 /* @{ */
377
378 SDL_SCANCODE_BRIGHTNESSDOWN = 275,
379 SDL_SCANCODE_BRIGHTNESSUP = 276,
380 SDL_SCANCODE_DISPLAYSWITCH = 277, /**< display mirroring/dual display
381 switch, video mode switch */
382 SDL_SCANCODE_KBDILLUMTOGGLE = 278,
383 SDL_SCANCODE_KBDILLUMDOWN = 279,
384 SDL_SCANCODE_KBDILLUMUP = 280,
385 SDL_SCANCODE_EJECT = 281,
386 SDL_SCANCODE_SLEEP = 282,
387
388 SDL_SCANCODE_APP1 = 283,
389 SDL_SCANCODE_APP2 = 284,
390
391 /* @} *//* Walther keys */
392
393 /**
394 * \name Usage page 0x0C (additional media keys)
395 *
396 * These values are mapped from usage page 0x0C (USB consumer page).
397 */
398 /* @{ */
399
400 SDL_SCANCODE_AUDIOREWIND = 285,
401 SDL_SCANCODE_AUDIOFASTFORWARD = 286,
402
403 /* @} *//* Usage page 0x0C (additional media keys) */
404
405 /* Add any other keys here. */
406
407 SDL_NUM_SCANCODES = 512 /**< not a key, just marks the number of scancodes
408 for array bounds */
409 } SDL_Scancode;
410
411 #endif /* SDL_scancode_h_ */
412
413 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_sensor.h added (mode: 100644) (index 0000000..e623634)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_sensor.h
24 *
25 * Include file for SDL sensor event handling
26 *
27 */
28
29 #ifndef SDL_sensor_h_
30 #define SDL_sensor_h_
31
32 #include "SDL_stdinc.h"
33 #include "SDL_error.h"
34
35 #include "begin_code.h"
36 /* Set up for C function definitions, even when using C++ */
37 #ifdef __cplusplus
38 /* *INDENT-OFF* */
39 extern "C" {
40 /* *INDENT-ON* */
41 #endif
42
43 /**
44 * \brief SDL_sensor.h
45 *
46 * In order to use these functions, SDL_Init() must have been called
47 * with the ::SDL_INIT_SENSOR flag. This causes SDL to scan the system
48 * for sensors, and load appropriate drivers.
49 */
50
51 struct _SDL_Sensor;
52 typedef struct _SDL_Sensor SDL_Sensor;
53
54 /**
55 * This is a unique ID for a sensor for the time it is connected to the system,
56 * and is never reused for the lifetime of the application.
57 *
58 * The ID value starts at 0 and increments from there. The value -1 is an invalid ID.
59 */
60 typedef Sint32 SDL_SensorID;
61
62 /* The different sensors defined by SDL
63 *
64 * Additional sensors may be available, using platform dependent semantics.
65 *
66 * Hare are the additional Android sensors:
67 * https://developer.android.com/reference/android/hardware/SensorEvent.html#values
68 */
69 typedef enum
70 {
71 SDL_SENSOR_INVALID = -1, /**< Returned for an invalid sensor */
72 SDL_SENSOR_UNKNOWN, /**< Unknown sensor type */
73 SDL_SENSOR_ACCEL, /**< Accelerometer */
74 SDL_SENSOR_GYRO /**< Gyroscope */
75 } SDL_SensorType;
76
77 /**
78 * Accelerometer sensor
79 *
80 * The accelerometer returns the current acceleration in SI meters per
81 * second squared. This measurement includes the force of gravity, so
82 * a device at rest will have an value of SDL_STANDARD_GRAVITY away
83 * from the center of the earth.
84 *
85 * values[0]: Acceleration on the x axis
86 * values[1]: Acceleration on the y axis
87 * values[2]: Acceleration on the z axis
88 *
89 * For phones held in portrait mode and game controllers held in front of you,
90 * the axes are defined as follows:
91 * -X ... +X : left ... right
92 * -Y ... +Y : bottom ... top
93 * -Z ... +Z : farther ... closer
94 *
95 * The axis data is not changed when the phone is rotated.
96 *
97 * \sa SDL_GetDisplayOrientation()
98 */
99 #define SDL_STANDARD_GRAVITY 9.80665f
100
101 /**
102 * Gyroscope sensor
103 *
104 * The gyroscope returns the current rate of rotation in radians per second.
105 * The rotation is positive in the counter-clockwise direction. That is,
106 * an observer looking from a positive location on one of the axes would
107 * see positive rotation on that axis when it appeared to be rotating
108 * counter-clockwise.
109 *
110 * values[0]: Angular speed around the x axis (pitch)
111 * values[1]: Angular speed around the y axis (yaw)
112 * values[2]: Angular speed around the z axis (roll)
113 *
114 * For phones held in portrait mode and game controllers held in front of you,
115 * the axes are defined as follows:
116 * -X ... +X : left ... right
117 * -Y ... +Y : bottom ... top
118 * -Z ... +Z : farther ... closer
119 *
120 * The axis data is not changed when the phone or controller is rotated.
121 *
122 * \sa SDL_GetDisplayOrientation()
123 */
124
125 /* Function prototypes */
126
127 /**
128 * Locking for multi-threaded access to the sensor API
129 *
130 * If you are using the sensor API or handling events from multiple threads
131 * you should use these locking functions to protect access to the sensors.
132 *
133 * In particular, you are guaranteed that the sensor list won't change, so
134 * the API functions that take a sensor index will be valid, and sensor
135 * events will not be delivered.
136 */
137 extern DECLSPEC void SDLCALL SDL_LockSensors(void);
138 extern DECLSPEC void SDLCALL SDL_UnlockSensors(void);
139
140 /**
141 * \brief Count the number of sensors attached to the system right now
142 */
143 extern DECLSPEC int SDLCALL SDL_NumSensors(void);
144
145 /**
146 * \brief Get the implementation dependent name of a sensor.
147 *
148 * This can be called before any sensors are opened.
149 *
150 * \return The sensor name, or NULL if device_index is out of range.
151 */
152 extern DECLSPEC const char *SDLCALL SDL_SensorGetDeviceName(int device_index);
153
154 /**
155 * \brief Get the type of a sensor.
156 *
157 * This can be called before any sensors are opened.
158 *
159 * \return The sensor type, or SDL_SENSOR_INVALID if device_index is out of range.
160 */
161 extern DECLSPEC SDL_SensorType SDLCALL SDL_SensorGetDeviceType(int device_index);
162
163 /**
164 * \brief Get the platform dependent type of a sensor.
165 *
166 * This can be called before any sensors are opened.
167 *
168 * \return The sensor platform dependent type, or -1 if device_index is out of range.
169 */
170 extern DECLSPEC int SDLCALL SDL_SensorGetDeviceNonPortableType(int device_index);
171
172 /**
173 * \brief Get the instance ID of a sensor.
174 *
175 * This can be called before any sensors are opened.
176 *
177 * \return The sensor instance ID, or -1 if device_index is out of range.
178 */
179 extern DECLSPEC SDL_SensorID SDLCALL SDL_SensorGetDeviceInstanceID(int device_index);
180
181 /**
182 * \brief Open a sensor for use.
183 *
184 * The index passed as an argument refers to the N'th sensor on the system.
185 *
186 * \return A sensor identifier, or NULL if an error occurred.
187 */
188 extern DECLSPEC SDL_Sensor *SDLCALL SDL_SensorOpen(int device_index);
189
190 /**
191 * Return the SDL_Sensor associated with an instance id.
192 */
193 extern DECLSPEC SDL_Sensor *SDLCALL SDL_SensorFromInstanceID(SDL_SensorID instance_id);
194
195 /**
196 * \brief Get the implementation dependent name of a sensor.
197 *
198 * \return The sensor name, or NULL if the sensor is NULL.
199 */
200 extern DECLSPEC const char *SDLCALL SDL_SensorGetName(SDL_Sensor *sensor);
201
202 /**
203 * \brief Get the type of a sensor.
204 *
205 * This can be called before any sensors are opened.
206 *
207 * \return The sensor type, or SDL_SENSOR_INVALID if the sensor is NULL.
208 */
209 extern DECLSPEC SDL_SensorType SDLCALL SDL_SensorGetType(SDL_Sensor *sensor);
210
211 /**
212 * \brief Get the platform dependent type of a sensor.
213 *
214 * This can be called before any sensors are opened.
215 *
216 * \return The sensor platform dependent type, or -1 if the sensor is NULL.
217 */
218 extern DECLSPEC int SDLCALL SDL_SensorGetNonPortableType(SDL_Sensor *sensor);
219
220 /**
221 * \brief Get the instance ID of a sensor.
222 *
223 * This can be called before any sensors are opened.
224 *
225 * \return The sensor instance ID, or -1 if the sensor is NULL.
226 */
227 extern DECLSPEC SDL_SensorID SDLCALL SDL_SensorGetInstanceID(SDL_Sensor *sensor);
228
229 /**
230 * Get the current state of an opened sensor.
231 *
232 * The number of values and interpretation of the data is sensor dependent.
233 *
234 * \param sensor The sensor to query
235 * \param data A pointer filled with the current sensor state
236 * \param num_values The number of values to write to data
237 *
238 * \return 0 or -1 if an error occurred.
239 */
240 extern DECLSPEC int SDLCALL SDL_SensorGetData(SDL_Sensor * sensor, float *data, int num_values);
241
242 /**
243 * Close a sensor previously opened with SDL_SensorOpen()
244 */
245 extern DECLSPEC void SDLCALL SDL_SensorClose(SDL_Sensor * sensor);
246
247 /**
248 * Update the current state of the open sensors.
249 *
250 * This is called automatically by the event loop if sensor events are enabled.
251 *
252 * This needs to be called from the thread that initialized the sensor subsystem.
253 */
254 extern DECLSPEC void SDLCALL SDL_SensorUpdate(void);
255
256
257 /* Ends C function definitions when using C++ */
258 #ifdef __cplusplus
259 /* *INDENT-OFF* */
260 }
261 /* *INDENT-ON* */
262 #endif
263 #include "close_code.h"
264
265 #endif /* SDL_sensor_h_ */
266
267 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_shape.h added (mode: 100644) (index 0000000..cbd9deb)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 #ifndef SDL_shape_h_
23 #define SDL_shape_h_
24
25 #include "SDL_stdinc.h"
26 #include "SDL_pixels.h"
27 #include "SDL_rect.h"
28 #include "SDL_surface.h"
29 #include "SDL_video.h"
30
31 #include "begin_code.h"
32 /* Set up for C function definitions, even when using C++ */
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 /** \file SDL_shape.h
38 *
39 * Header file for the shaped window API.
40 */
41
42 #define SDL_NONSHAPEABLE_WINDOW -1
43 #define SDL_INVALID_SHAPE_ARGUMENT -2
44 #define SDL_WINDOW_LACKS_SHAPE -3
45
46 /**
47 * \brief Create a window that can be shaped with the specified position, dimensions, and flags.
48 *
49 * \param title The title of the window, in UTF-8 encoding.
50 * \param x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or
51 * ::SDL_WINDOWPOS_UNDEFINED.
52 * \param y The y position of the window, ::SDL_WINDOWPOS_CENTERED, or
53 * ::SDL_WINDOWPOS_UNDEFINED.
54 * \param w The width of the window.
55 * \param h The height of the window.
56 * \param flags The flags for the window, a mask of SDL_WINDOW_BORDERLESS with any of the following:
57 * ::SDL_WINDOW_OPENGL, ::SDL_WINDOW_INPUT_GRABBED,
58 * ::SDL_WINDOW_HIDDEN, ::SDL_WINDOW_RESIZABLE,
59 * ::SDL_WINDOW_MAXIMIZED, ::SDL_WINDOW_MINIMIZED,
60 * ::SDL_WINDOW_BORDERLESS is always set, and ::SDL_WINDOW_FULLSCREEN is always unset.
61 *
62 * \return The window created, or NULL if window creation failed.
63 *
64 * \sa SDL_DestroyWindow()
65 */
66 extern DECLSPEC SDL_Window * SDLCALL SDL_CreateShapedWindow(const char *title,unsigned int x,unsigned int y,unsigned int w,unsigned int h,Uint32 flags);
67
68 /**
69 * \brief Return whether the given window is a shaped window.
70 *
71 * \param window The window to query for being shaped.
72 *
73 * \return SDL_TRUE if the window is a window that can be shaped, SDL_FALSE if the window is unshaped or NULL.
74 *
75 * \sa SDL_CreateShapedWindow
76 */
77 extern DECLSPEC SDL_bool SDLCALL SDL_IsShapedWindow(const SDL_Window *window);
78
79 /** \brief An enum denoting the specific type of contents present in an SDL_WindowShapeParams union. */
80 typedef enum {
81 /** \brief The default mode, a binarized alpha cutoff of 1. */
82 ShapeModeDefault,
83 /** \brief A binarized alpha cutoff with a given integer value. */
84 ShapeModeBinarizeAlpha,
85 /** \brief A binarized alpha cutoff with a given integer value, but with the opposite comparison. */
86 ShapeModeReverseBinarizeAlpha,
87 /** \brief A color key is applied. */
88 ShapeModeColorKey
89 } WindowShapeMode;
90
91 #define SDL_SHAPEMODEALPHA(mode) (mode == ShapeModeDefault || mode == ShapeModeBinarizeAlpha || mode == ShapeModeReverseBinarizeAlpha)
92
93 /** \brief A union containing parameters for shaped windows. */
94 typedef union {
95 /** \brief A cutoff alpha value for binarization of the window shape's alpha channel. */
96 Uint8 binarizationCutoff;
97 SDL_Color colorKey;
98 } SDL_WindowShapeParams;
99
100 /** \brief A struct that tags the SDL_WindowShapeParams union with an enum describing the type of its contents. */
101 typedef struct SDL_WindowShapeMode {
102 /** \brief The mode of these window-shape parameters. */
103 WindowShapeMode mode;
104 /** \brief Window-shape parameters. */
105 SDL_WindowShapeParams parameters;
106 } SDL_WindowShapeMode;
107
108 /**
109 * \brief Set the shape and parameters of a shaped window.
110 *
111 * \param window The shaped window whose parameters should be set.
112 * \param shape A surface encoding the desired shape for the window.
113 * \param shape_mode The parameters to set for the shaped window.
114 *
115 * \return 0 on success, SDL_INVALID_SHAPE_ARGUMENT on an invalid shape argument, or SDL_NONSHAPEABLE_WINDOW
116 * if the SDL_Window given does not reference a valid shaped window.
117 *
118 * \sa SDL_WindowShapeMode
119 * \sa SDL_GetShapedWindowMode.
120 */
121 extern DECLSPEC int SDLCALL SDL_SetWindowShape(SDL_Window *window,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode);
122
123 /**
124 * \brief Get the shape parameters of a shaped window.
125 *
126 * \param window The shaped window whose parameters should be retrieved.
127 * \param shape_mode An empty shape-mode structure to fill, or NULL to check whether the window has a shape.
128 *
129 * \return 0 if the window has a shape and, provided shape_mode was not NULL, shape_mode has been filled with the mode
130 * data, SDL_NONSHAPEABLE_WINDOW if the SDL_Window given is not a shaped window, or SDL_WINDOW_LACKS_SHAPE if
131 * the SDL_Window given is a shapeable window currently lacking a shape.
132 *
133 * \sa SDL_WindowShapeMode
134 * \sa SDL_SetWindowShape
135 */
136 extern DECLSPEC int SDLCALL SDL_GetShapedWindowMode(SDL_Window *window,SDL_WindowShapeMode *shape_mode);
137
138 /* Ends C function definitions when using C++ */
139 #ifdef __cplusplus
140 }
141 #endif
142 #include "close_code.h"
143
144 #endif /* SDL_shape_h_ */
File include/SDL2/SDL_stdinc.h added (mode: 100644) (index 0000000..91ccaa4)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_stdinc.h
24 *
25 * This is a general header that includes C language support.
26 */
27
28 #ifndef SDL_stdinc_h_
29 #define SDL_stdinc_h_
30
31 #include "SDL_config.h"
32
33 #ifdef __APPLE__
34 #ifndef _DARWIN_C_SOURCE
35 #define _DARWIN_C_SOURCE 1 /* for memset_pattern4() */
36 #endif
37 #endif
38
39 #ifdef HAVE_SYS_TYPES_H
40 #include <sys/types.h>
41 #endif
42 #ifdef HAVE_STDIO_H
43 #include <stdio.h>
44 #endif
45 #if defined(STDC_HEADERS)
46 # include <stdlib.h>
47 # include <stddef.h>
48 # include <stdarg.h>
49 #else
50 # if defined(HAVE_STDLIB_H)
51 # include <stdlib.h>
52 # elif defined(HAVE_MALLOC_H)
53 # include <malloc.h>
54 # endif
55 # if defined(HAVE_STDDEF_H)
56 # include <stddef.h>
57 # endif
58 # if defined(HAVE_STDARG_H)
59 # include <stdarg.h>
60 # endif
61 #endif
62 #ifdef HAVE_STRING_H
63 # if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H)
64 # include <memory.h>
65 # endif
66 # include <string.h>
67 #endif
68 #ifdef HAVE_STRINGS_H
69 # include <strings.h>
70 #endif
71 #ifdef HAVE_WCHAR_H
72 # include <wchar.h>
73 #endif
74 #if defined(HAVE_INTTYPES_H)
75 # include <inttypes.h>
76 #elif defined(HAVE_STDINT_H)
77 # include <stdint.h>
78 #endif
79 #ifdef HAVE_CTYPE_H
80 # include <ctype.h>
81 #endif
82 #ifdef HAVE_MATH_H
83 # if defined(__WINRT__)
84 /* Defining _USE_MATH_DEFINES is required to get M_PI to be defined on
85 WinRT. See http://msdn.microsoft.com/en-us/library/4hwaceh6.aspx
86 for more information.
87 */
88 # define _USE_MATH_DEFINES
89 # endif
90 # include <math.h>
91 #endif
92 #ifdef HAVE_FLOAT_H
93 # include <float.h>
94 #endif
95 #if defined(HAVE_ALLOCA) && !defined(alloca)
96 # if defined(HAVE_ALLOCA_H)
97 # include <alloca.h>
98 # elif defined(__GNUC__)
99 # define alloca __builtin_alloca
100 # elif defined(_MSC_VER)
101 # include <malloc.h>
102 # define alloca _alloca
103 # elif defined(__WATCOMC__)
104 # include <malloc.h>
105 # elif defined(__BORLANDC__)
106 # include <malloc.h>
107 # elif defined(__DMC__)
108 # include <stdlib.h>
109 # elif defined(__AIX__)
110 #pragma alloca
111 # elif defined(__MRC__)
112 void *alloca(unsigned);
113 # else
114 char *alloca();
115 # endif
116 #endif
117
118 /**
119 * The number of elements in an array.
120 */
121 #define SDL_arraysize(array) (sizeof(array)/sizeof(array[0]))
122 #define SDL_TABLESIZE(table) SDL_arraysize(table)
123
124 /**
125 * Macro useful for building other macros with strings in them
126 *
127 * e.g. #define LOG_ERROR(X) OutputDebugString(SDL_STRINGIFY_ARG(__FUNCTION__) ": " X "\n")
128 */
129 #define SDL_STRINGIFY_ARG(arg) #arg
130
131 /**
132 * \name Cast operators
133 *
134 * Use proper C++ casts when compiled as C++ to be compatible with the option
135 * -Wold-style-cast of GCC (and -Werror=old-style-cast in GCC 4.2 and above).
136 */
137 /* @{ */
138 #ifdef __cplusplus
139 #define SDL_reinterpret_cast(type, expression) reinterpret_cast<type>(expression)
140 #define SDL_static_cast(type, expression) static_cast<type>(expression)
141 #define SDL_const_cast(type, expression) const_cast<type>(expression)
142 #else
143 #define SDL_reinterpret_cast(type, expression) ((type)(expression))
144 #define SDL_static_cast(type, expression) ((type)(expression))
145 #define SDL_const_cast(type, expression) ((type)(expression))
146 #endif
147 /* @} *//* Cast operators */
148
149 /* Define a four character code as a Uint32 */
150 #define SDL_FOURCC(A, B, C, D) \
151 ((SDL_static_cast(Uint32, SDL_static_cast(Uint8, (A))) << 0) | \
152 (SDL_static_cast(Uint32, SDL_static_cast(Uint8, (B))) << 8) | \
153 (SDL_static_cast(Uint32, SDL_static_cast(Uint8, (C))) << 16) | \
154 (SDL_static_cast(Uint32, SDL_static_cast(Uint8, (D))) << 24))
155
156 /**
157 * \name Basic data types
158 */
159 /* @{ */
160
161 #ifdef __CC_ARM
162 /* ARM's compiler throws warnings if we use an enum: like "SDL_bool x = a < b;" */
163 #define SDL_FALSE 0
164 #define SDL_TRUE 1
165 typedef int SDL_bool;
166 #else
167 typedef enum
168 {
169 SDL_FALSE = 0,
170 SDL_TRUE = 1
171 } SDL_bool;
172 #endif
173
174 /**
175 * \brief A signed 8-bit integer type.
176 */
177 #define SDL_MAX_SINT8 ((Sint8)0x7F) /* 127 */
178 #define SDL_MIN_SINT8 ((Sint8)(~0x7F)) /* -128 */
179 typedef int8_t Sint8;
180 /**
181 * \brief An unsigned 8-bit integer type.
182 */
183 #define SDL_MAX_UINT8 ((Uint8)0xFF) /* 255 */
184 #define SDL_MIN_UINT8 ((Uint8)0x00) /* 0 */
185 typedef uint8_t Uint8;
186 /**
187 * \brief A signed 16-bit integer type.
188 */
189 #define SDL_MAX_SINT16 ((Sint16)0x7FFF) /* 32767 */
190 #define SDL_MIN_SINT16 ((Sint16)(~0x7FFF)) /* -32768 */
191 typedef int16_t Sint16;
192 /**
193 * \brief An unsigned 16-bit integer type.
194 */
195 #define SDL_MAX_UINT16 ((Uint16)0xFFFF) /* 65535 */
196 #define SDL_MIN_UINT16 ((Uint16)0x0000) /* 0 */
197 typedef uint16_t Uint16;
198 /**
199 * \brief A signed 32-bit integer type.
200 */
201 #define SDL_MAX_SINT32 ((Sint32)0x7FFFFFFF) /* 2147483647 */
202 #define SDL_MIN_SINT32 ((Sint32)(~0x7FFFFFFF)) /* -2147483648 */
203 typedef int32_t Sint32;
204 /**
205 * \brief An unsigned 32-bit integer type.
206 */
207 #define SDL_MAX_UINT32 ((Uint32)0xFFFFFFFFu) /* 4294967295 */
208 #define SDL_MIN_UINT32 ((Uint32)0x00000000) /* 0 */
209 typedef uint32_t Uint32;
210
211 /**
212 * \brief A signed 64-bit integer type.
213 */
214 #define SDL_MAX_SINT64 ((Sint64)0x7FFFFFFFFFFFFFFFll) /* 9223372036854775807 */
215 #define SDL_MIN_SINT64 ((Sint64)(~0x7FFFFFFFFFFFFFFFll)) /* -9223372036854775808 */
216 typedef int64_t Sint64;
217 /**
218 * \brief An unsigned 64-bit integer type.
219 */
220 #define SDL_MAX_UINT64 ((Uint64)0xFFFFFFFFFFFFFFFFull) /* 18446744073709551615 */
221 #define SDL_MIN_UINT64 ((Uint64)(0x0000000000000000ull)) /* 0 */
222 typedef uint64_t Uint64;
223
224 /* @} *//* Basic data types */
225
226 /* Make sure we have macros for printing 64 bit values.
227 * <stdint.h> should define these but this is not true all platforms.
228 * (for example win32) */
229 #ifndef SDL_PRIs64
230 #ifdef PRIs64
231 #define SDL_PRIs64 PRIs64
232 #elif defined(__WIN32__)
233 #define SDL_PRIs64 "I64d"
234 #elif defined(__LINUX__) && defined(__LP64__)
235 #define SDL_PRIs64 "ld"
236 #else
237 #define SDL_PRIs64 "lld"
238 #endif
239 #endif
240 #ifndef SDL_PRIu64
241 #ifdef PRIu64
242 #define SDL_PRIu64 PRIu64
243 #elif defined(__WIN32__)
244 #define SDL_PRIu64 "I64u"
245 #elif defined(__LINUX__) && defined(__LP64__)
246 #define SDL_PRIu64 "lu"
247 #else
248 #define SDL_PRIu64 "llu"
249 #endif
250 #endif
251 #ifndef SDL_PRIx64
252 #ifdef PRIx64
253 #define SDL_PRIx64 PRIx64
254 #elif defined(__WIN32__)
255 #define SDL_PRIx64 "I64x"
256 #elif defined(__LINUX__) && defined(__LP64__)
257 #define SDL_PRIx64 "lx"
258 #else
259 #define SDL_PRIx64 "llx"
260 #endif
261 #endif
262 #ifndef SDL_PRIX64
263 #ifdef PRIX64
264 #define SDL_PRIX64 PRIX64
265 #elif defined(__WIN32__)
266 #define SDL_PRIX64 "I64X"
267 #elif defined(__LINUX__) && defined(__LP64__)
268 #define SDL_PRIX64 "lX"
269 #else
270 #define SDL_PRIX64 "llX"
271 #endif
272 #endif
273
274 /* Annotations to help code analysis tools */
275 #ifdef SDL_DISABLE_ANALYZE_MACROS
276 #define SDL_IN_BYTECAP(x)
277 #define SDL_INOUT_Z_CAP(x)
278 #define SDL_OUT_Z_CAP(x)
279 #define SDL_OUT_CAP(x)
280 #define SDL_OUT_BYTECAP(x)
281 #define SDL_OUT_Z_BYTECAP(x)
282 #define SDL_PRINTF_FORMAT_STRING
283 #define SDL_SCANF_FORMAT_STRING
284 #define SDL_PRINTF_VARARG_FUNC( fmtargnumber )
285 #define SDL_SCANF_VARARG_FUNC( fmtargnumber )
286 #else
287 #if defined(_MSC_VER) && (_MSC_VER >= 1600) /* VS 2010 and above */
288 #include <sal.h>
289
290 #define SDL_IN_BYTECAP(x) _In_bytecount_(x)
291 #define SDL_INOUT_Z_CAP(x) _Inout_z_cap_(x)
292 #define SDL_OUT_Z_CAP(x) _Out_z_cap_(x)
293 #define SDL_OUT_CAP(x) _Out_cap_(x)
294 #define SDL_OUT_BYTECAP(x) _Out_bytecap_(x)
295 #define SDL_OUT_Z_BYTECAP(x) _Out_z_bytecap_(x)
296
297 #define SDL_PRINTF_FORMAT_STRING _Printf_format_string_
298 #define SDL_SCANF_FORMAT_STRING _Scanf_format_string_impl_
299 #else
300 #define SDL_IN_BYTECAP(x)
301 #define SDL_INOUT_Z_CAP(x)
302 #define SDL_OUT_Z_CAP(x)
303 #define SDL_OUT_CAP(x)
304 #define SDL_OUT_BYTECAP(x)
305 #define SDL_OUT_Z_BYTECAP(x)
306 #define SDL_PRINTF_FORMAT_STRING
307 #define SDL_SCANF_FORMAT_STRING
308 #endif
309 #if defined(__GNUC__)
310 #define SDL_PRINTF_VARARG_FUNC( fmtargnumber ) __attribute__ (( format( __printf__, fmtargnumber, fmtargnumber+1 )))
311 #define SDL_SCANF_VARARG_FUNC( fmtargnumber ) __attribute__ (( format( __scanf__, fmtargnumber, fmtargnumber+1 )))
312 #else
313 #define SDL_PRINTF_VARARG_FUNC( fmtargnumber )
314 #define SDL_SCANF_VARARG_FUNC( fmtargnumber )
315 #endif
316 #endif /* SDL_DISABLE_ANALYZE_MACROS */
317
318 #define SDL_COMPILE_TIME_ASSERT(name, x) \
319 typedef int SDL_compile_time_assert_ ## name[(x) * 2 - 1]
320 /** \cond */
321 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
322 SDL_COMPILE_TIME_ASSERT(uint8, sizeof(Uint8) == 1);
323 SDL_COMPILE_TIME_ASSERT(sint8, sizeof(Sint8) == 1);
324 SDL_COMPILE_TIME_ASSERT(uint16, sizeof(Uint16) == 2);
325 SDL_COMPILE_TIME_ASSERT(sint16, sizeof(Sint16) == 2);
326 SDL_COMPILE_TIME_ASSERT(uint32, sizeof(Uint32) == 4);
327 SDL_COMPILE_TIME_ASSERT(sint32, sizeof(Sint32) == 4);
328 SDL_COMPILE_TIME_ASSERT(uint64, sizeof(Uint64) == 8);
329 SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8);
330 #endif /* DOXYGEN_SHOULD_IGNORE_THIS */
331 /** \endcond */
332
333 /* Check to make sure enums are the size of ints, for structure packing.
334 For both Watcom C/C++ and Borland C/C++ the compiler option that makes
335 enums having the size of an int must be enabled.
336 This is "-b" for Borland C/C++ and "-ei" for Watcom C/C++ (v11).
337 */
338
339 /** \cond */
340 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
341 #if !defined(__ANDROID__)
342 /* TODO: include/SDL_stdinc.h:174: error: size of array 'SDL_dummy_enum' is negative */
343 typedef enum
344 {
345 DUMMY_ENUM_VALUE
346 } SDL_DUMMY_ENUM;
347
348 SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int));
349 #endif
350 #endif /* DOXYGEN_SHOULD_IGNORE_THIS */
351 /** \endcond */
352
353 #include "begin_code.h"
354 /* Set up for C function definitions, even when using C++ */
355 #ifdef __cplusplus
356 extern "C" {
357 #endif
358
359 #ifdef HAVE_ALLOCA
360 #define SDL_stack_alloc(type, count) (type*)alloca(sizeof(type)*(count))
361 #define SDL_stack_free(data)
362 #else
363 #define SDL_stack_alloc(type, count) (type*)SDL_malloc(sizeof(type)*(count))
364 #define SDL_stack_free(data) SDL_free(data)
365 #endif
366
367 extern DECLSPEC void *SDLCALL SDL_malloc(size_t size);
368 extern DECLSPEC void *SDLCALL SDL_calloc(size_t nmemb, size_t size);
369 extern DECLSPEC void *SDLCALL SDL_realloc(void *mem, size_t size);
370 extern DECLSPEC void SDLCALL SDL_free(void *mem);
371
372 typedef void *(SDLCALL *SDL_malloc_func)(size_t size);
373 typedef void *(SDLCALL *SDL_calloc_func)(size_t nmemb, size_t size);
374 typedef void *(SDLCALL *SDL_realloc_func)(void *mem, size_t size);
375 typedef void (SDLCALL *SDL_free_func)(void *mem);
376
377 /**
378 * \brief Get the current set of SDL memory functions
379 */
380 extern DECLSPEC void SDLCALL SDL_GetMemoryFunctions(SDL_malloc_func *malloc_func,
381 SDL_calloc_func *calloc_func,
382 SDL_realloc_func *realloc_func,
383 SDL_free_func *free_func);
384
385 /**
386 * \brief Replace SDL's memory allocation functions with a custom set
387 *
388 * \note If you are replacing SDL's memory functions, you should call
389 * SDL_GetNumAllocations() and be very careful if it returns non-zero.
390 * That means that your free function will be called with memory
391 * allocated by the previous memory allocation functions.
392 */
393 extern DECLSPEC int SDLCALL SDL_SetMemoryFunctions(SDL_malloc_func malloc_func,
394 SDL_calloc_func calloc_func,
395 SDL_realloc_func realloc_func,
396 SDL_free_func free_func);
397
398 /**
399 * \brief Get the number of outstanding (unfreed) allocations
400 */
401 extern DECLSPEC int SDLCALL SDL_GetNumAllocations(void);
402
403 extern DECLSPEC char *SDLCALL SDL_getenv(const char *name);
404 extern DECLSPEC int SDLCALL SDL_setenv(const char *name, const char *value, int overwrite);
405
406 extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size, int (*compare) (const void *, const void *));
407
408 extern DECLSPEC int SDLCALL SDL_abs(int x);
409
410 /* !!! FIXME: these have side effects. You probably shouldn't use them. */
411 /* !!! FIXME: Maybe we do forceinline functions of SDL_mini, SDL_minf, etc? */
412 #define SDL_min(x, y) (((x) < (y)) ? (x) : (y))
413 #define SDL_max(x, y) (((x) > (y)) ? (x) : (y))
414
415 extern DECLSPEC int SDLCALL SDL_isdigit(int x);
416 extern DECLSPEC int SDLCALL SDL_isspace(int x);
417 extern DECLSPEC int SDLCALL SDL_isupper(int x);
418 extern DECLSPEC int SDLCALL SDL_islower(int x);
419 extern DECLSPEC int SDLCALL SDL_toupper(int x);
420 extern DECLSPEC int SDLCALL SDL_tolower(int x);
421
422 extern DECLSPEC Uint32 SDLCALL SDL_crc32(Uint32 crc, const void *data, size_t len);
423
424 extern DECLSPEC void *SDLCALL SDL_memset(SDL_OUT_BYTECAP(len) void *dst, int c, size_t len);
425
426 #define SDL_zero(x) SDL_memset(&(x), 0, sizeof((x)))
427 #define SDL_zerop(x) SDL_memset((x), 0, sizeof(*(x)))
428 #define SDL_zeroa(x) SDL_memset((x), 0, sizeof((x)))
429
430 /* Note that memset() is a byte assignment and this is a 32-bit assignment, so they're not directly equivalent. */
431 SDL_FORCE_INLINE void SDL_memset4(void *dst, Uint32 val, size_t dwords)
432 {
433 #ifdef __APPLE__
434 memset_pattern4(dst, &val, dwords * 4);
435 #elif defined(__GNUC__) && defined(i386)
436 int u0, u1, u2;
437 __asm__ __volatile__ (
438 "cld \n\t"
439 "rep ; stosl \n\t"
440 : "=&D" (u0), "=&a" (u1), "=&c" (u2)
441 : "0" (dst), "1" (val), "2" (SDL_static_cast(Uint32, dwords))
442 : "memory"
443 );
444 #else
445 size_t _n = (dwords + 3) / 4;
446 Uint32 *_p = SDL_static_cast(Uint32 *, dst);
447 Uint32 _val = (val);
448 if (dwords == 0)
449 return;
450 switch (dwords % 4)
451 {
452 case 0: do { *_p++ = _val; /* fallthrough */
453 case 3: *_p++ = _val; /* fallthrough */
454 case 2: *_p++ = _val; /* fallthrough */
455 case 1: *_p++ = _val; /* fallthrough */
456 } while ( --_n );
457 }
458 #endif
459 }
460
461 extern DECLSPEC void *SDLCALL SDL_memcpy(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len);
462
463 extern DECLSPEC void *SDLCALL SDL_memmove(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len);
464 extern DECLSPEC int SDLCALL SDL_memcmp(const void *s1, const void *s2, size_t len);
465
466 extern DECLSPEC size_t SDLCALL SDL_wcslen(const wchar_t *wstr);
467 extern DECLSPEC size_t SDLCALL SDL_wcslcpy(SDL_OUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t maxlen);
468 extern DECLSPEC size_t SDLCALL SDL_wcslcat(SDL_INOUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t maxlen);
469 extern DECLSPEC wchar_t *SDLCALL SDL_wcsdup(const wchar_t *wstr);
470 extern DECLSPEC wchar_t *SDLCALL SDL_wcsstr(const wchar_t *haystack, const wchar_t *needle);
471
472 extern DECLSPEC int SDLCALL SDL_wcscmp(const wchar_t *str1, const wchar_t *str2);
473 extern DECLSPEC int SDLCALL SDL_wcsncmp(const wchar_t *str1, const wchar_t *str2, size_t maxlen);
474 extern DECLSPEC int SDLCALL SDL_wcscasecmp(const wchar_t *str1, const wchar_t *str2);
475 extern DECLSPEC int SDLCALL SDL_wcsncasecmp(const wchar_t *str1, const wchar_t *str2, size_t len);
476
477 extern DECLSPEC size_t SDLCALL SDL_strlen(const char *str);
478 extern DECLSPEC size_t SDLCALL SDL_strlcpy(SDL_OUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen);
479 extern DECLSPEC size_t SDLCALL SDL_utf8strlcpy(SDL_OUT_Z_CAP(dst_bytes) char *dst, const char *src, size_t dst_bytes);
480 extern DECLSPEC size_t SDLCALL SDL_strlcat(SDL_INOUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen);
481 extern DECLSPEC char *SDLCALL SDL_strdup(const char *str);
482 extern DECLSPEC char *SDLCALL SDL_strrev(char *str);
483 extern DECLSPEC char *SDLCALL SDL_strupr(char *str);
484 extern DECLSPEC char *SDLCALL SDL_strlwr(char *str);
485 extern DECLSPEC char *SDLCALL SDL_strchr(const char *str, int c);
486 extern DECLSPEC char *SDLCALL SDL_strrchr(const char *str, int c);
487 extern DECLSPEC char *SDLCALL SDL_strstr(const char *haystack, const char *needle);
488 extern DECLSPEC char *SDLCALL SDL_strtokr(char *s1, const char *s2, char **saveptr);
489 extern DECLSPEC size_t SDLCALL SDL_utf8strlen(const char *str);
490
491 extern DECLSPEC char *SDLCALL SDL_itoa(int value, char *str, int radix);
492 extern DECLSPEC char *SDLCALL SDL_uitoa(unsigned int value, char *str, int radix);
493 extern DECLSPEC char *SDLCALL SDL_ltoa(long value, char *str, int radix);
494 extern DECLSPEC char *SDLCALL SDL_ultoa(unsigned long value, char *str, int radix);
495 extern DECLSPEC char *SDLCALL SDL_lltoa(Sint64 value, char *str, int radix);
496 extern DECLSPEC char *SDLCALL SDL_ulltoa(Uint64 value, char *str, int radix);
497
498 extern DECLSPEC int SDLCALL SDL_atoi(const char *str);
499 extern DECLSPEC double SDLCALL SDL_atof(const char *str);
500 extern DECLSPEC long SDLCALL SDL_strtol(const char *str, char **endp, int base);
501 extern DECLSPEC unsigned long SDLCALL SDL_strtoul(const char *str, char **endp, int base);
502 extern DECLSPEC Sint64 SDLCALL SDL_strtoll(const char *str, char **endp, int base);
503 extern DECLSPEC Uint64 SDLCALL SDL_strtoull(const char *str, char **endp, int base);
504 extern DECLSPEC double SDLCALL SDL_strtod(const char *str, char **endp);
505
506 extern DECLSPEC int SDLCALL SDL_strcmp(const char *str1, const char *str2);
507 extern DECLSPEC int SDLCALL SDL_strncmp(const char *str1, const char *str2, size_t maxlen);
508 extern DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, const char *str2);
509 extern DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *str2, size_t len);
510
511 extern DECLSPEC int SDLCALL SDL_sscanf(const char *text, SDL_SCANF_FORMAT_STRING const char *fmt, ...) SDL_SCANF_VARARG_FUNC(2);
512 extern DECLSPEC int SDLCALL SDL_vsscanf(const char *text, const char *fmt, va_list ap);
513 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);
514 extern DECLSPEC int SDLCALL SDL_vsnprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, const char *fmt, va_list ap);
515
516 #ifndef HAVE_M_PI
517 #ifndef M_PI
518 #define M_PI 3.14159265358979323846264338327950288 /**< pi */
519 #endif
520 #endif
521
522 extern DECLSPEC double SDLCALL SDL_acos(double x);
523 extern DECLSPEC float SDLCALL SDL_acosf(float x);
524 extern DECLSPEC double SDLCALL SDL_asin(double x);
525 extern DECLSPEC float SDLCALL SDL_asinf(float x);
526 extern DECLSPEC double SDLCALL SDL_atan(double x);
527 extern DECLSPEC float SDLCALL SDL_atanf(float x);
528 extern DECLSPEC double SDLCALL SDL_atan2(double x, double y);
529 extern DECLSPEC float SDLCALL SDL_atan2f(float x, float y);
530 extern DECLSPEC double SDLCALL SDL_ceil(double x);
531 extern DECLSPEC float SDLCALL SDL_ceilf(float x);
532 extern DECLSPEC double SDLCALL SDL_copysign(double x, double y);
533 extern DECLSPEC float SDLCALL SDL_copysignf(float x, float y);
534 extern DECLSPEC double SDLCALL SDL_cos(double x);
535 extern DECLSPEC float SDLCALL SDL_cosf(float x);
536 extern DECLSPEC double SDLCALL SDL_exp(double x);
537 extern DECLSPEC float SDLCALL SDL_expf(float x);
538 extern DECLSPEC double SDLCALL SDL_fabs(double x);
539 extern DECLSPEC float SDLCALL SDL_fabsf(float x);
540 extern DECLSPEC double SDLCALL SDL_floor(double x);
541 extern DECLSPEC float SDLCALL SDL_floorf(float x);
542 extern DECLSPEC double SDLCALL SDL_trunc(double x);
543 extern DECLSPEC float SDLCALL SDL_truncf(float x);
544 extern DECLSPEC double SDLCALL SDL_fmod(double x, double y);
545 extern DECLSPEC float SDLCALL SDL_fmodf(float x, float y);
546 extern DECLSPEC double SDLCALL SDL_log(double x);
547 extern DECLSPEC float SDLCALL SDL_logf(float x);
548 extern DECLSPEC double SDLCALL SDL_log10(double x);
549 extern DECLSPEC float SDLCALL SDL_log10f(float x);
550 extern DECLSPEC double SDLCALL SDL_pow(double x, double y);
551 extern DECLSPEC float SDLCALL SDL_powf(float x, float y);
552 extern DECLSPEC double SDLCALL SDL_scalbn(double x, int n);
553 extern DECLSPEC float SDLCALL SDL_scalbnf(float x, int n);
554 extern DECLSPEC double SDLCALL SDL_sin(double x);
555 extern DECLSPEC float SDLCALL SDL_sinf(float x);
556 extern DECLSPEC double SDLCALL SDL_sqrt(double x);
557 extern DECLSPEC float SDLCALL SDL_sqrtf(float x);
558 extern DECLSPEC double SDLCALL SDL_tan(double x);
559 extern DECLSPEC float SDLCALL SDL_tanf(float x);
560
561 /* The SDL implementation of iconv() returns these error codes */
562 #define SDL_ICONV_ERROR (size_t)-1
563 #define SDL_ICONV_E2BIG (size_t)-2
564 #define SDL_ICONV_EILSEQ (size_t)-3
565 #define SDL_ICONV_EINVAL (size_t)-4
566
567 /* SDL_iconv_* are now always real symbols/types, not macros or inlined. */
568 typedef struct _SDL_iconv_t *SDL_iconv_t;
569 extern DECLSPEC SDL_iconv_t SDLCALL SDL_iconv_open(const char *tocode,
570 const char *fromcode);
571 extern DECLSPEC int SDLCALL SDL_iconv_close(SDL_iconv_t cd);
572 extern DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf,
573 size_t * inbytesleft, char **outbuf,
574 size_t * outbytesleft);
575 /**
576 * This function converts a string between encodings in one pass, returning a
577 * string that must be freed with SDL_free() or NULL on error.
578 */
579 extern DECLSPEC char *SDLCALL SDL_iconv_string(const char *tocode,
580 const char *fromcode,
581 const char *inbuf,
582 size_t inbytesleft);
583 #define SDL_iconv_utf8_locale(S) SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1)
584 #define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2-INTERNAL", "UTF-8", S, SDL_strlen(S)+1)
585 #define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4-INTERNAL", "UTF-8", S, SDL_strlen(S)+1)
586
587 /* force builds using Clang's static analysis tools to use literal C runtime
588 here, since there are possibly tests that are ineffective otherwise. */
589 #if defined(__clang_analyzer__) && !defined(SDL_DISABLE_ANALYZE_MACROS)
590
591 /* The analyzer knows about strlcpy even when the system doesn't provide it */
592 #ifndef HAVE_STRLCPY
593 size_t strlcpy(char* dst, const char* src, size_t size);
594 #endif
595
596 /* The analyzer knows about strlcat even when the system doesn't provide it */
597 #ifndef HAVE_STRLCAT
598 size_t strlcat(char* dst, const char* src, size_t size);
599 #endif
600
601 #define SDL_malloc malloc
602 #define SDL_calloc calloc
603 #define SDL_realloc realloc
604 #define SDL_free free
605 #define SDL_memset memset
606 #define SDL_memcpy memcpy
607 #define SDL_memmove memmove
608 #define SDL_memcmp memcmp
609 #define SDL_strlcpy strlcpy
610 #define SDL_strlcat strlcat
611 #define SDL_strlen strlen
612 #define SDL_wcslen wcslen
613 #define SDL_wcslcpy wcslcpy
614 #define SDL_wcslcat wcslcat
615 #define SDL_strdup strdup
616 #define SDL_wcsdup wcsdup
617 #define SDL_strchr strchr
618 #define SDL_strrchr strrchr
619 #define SDL_strstr strstr
620 #define SDL_wcsstr wcsstr
621 #define SDL_strtokr strtok_r
622 #define SDL_strcmp strcmp
623 #define SDL_wcscmp wcscmp
624 #define SDL_strncmp strncmp
625 #define SDL_wcsncmp wcsncmp
626 #define SDL_strcasecmp strcasecmp
627 #define SDL_strncasecmp strncasecmp
628 #define SDL_sscanf sscanf
629 #define SDL_vsscanf vsscanf
630 #define SDL_snprintf snprintf
631 #define SDL_vsnprintf vsnprintf
632 #endif
633
634 SDL_FORCE_INLINE void *SDL_memcpy4(SDL_OUT_BYTECAP(dwords*4) void *dst, SDL_IN_BYTECAP(dwords*4) const void *src, size_t dwords)
635 {
636 return SDL_memcpy(dst, src, dwords * 4);
637 }
638
639 /* Ends C function definitions when using C++ */
640 #ifdef __cplusplus
641 }
642 #endif
643 #include "close_code.h"
644
645 #endif /* SDL_stdinc_h_ */
646
647 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_surface.h added (mode: 100644) (index 0000000..d3f8c81)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_surface.h
24 *
25 * Header file for ::SDL_Surface definition and management functions.
26 */
27
28 #ifndef SDL_surface_h_
29 #define SDL_surface_h_
30
31 #include "SDL_stdinc.h"
32 #include "SDL_pixels.h"
33 #include "SDL_rect.h"
34 #include "SDL_blendmode.h"
35 #include "SDL_rwops.h"
36
37 #include "begin_code.h"
38 /* Set up for C function definitions, even when using C++ */
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42
43 /**
44 * \name Surface flags
45 *
46 * These are the currently supported flags for the ::SDL_Surface.
47 *
48 * \internal
49 * Used internally (read-only).
50 */
51 /* @{ */
52 #define SDL_SWSURFACE 0 /**< Just here for compatibility */
53 #define SDL_PREALLOC 0x00000001 /**< Surface uses preallocated memory */
54 #define SDL_RLEACCEL 0x00000002 /**< Surface is RLE encoded */
55 #define SDL_DONTFREE 0x00000004 /**< Surface is referenced internally */
56 #define SDL_SIMD_ALIGNED 0x00000008 /**< Surface uses aligned memory */
57 /* @} *//* Surface flags */
58
59 /**
60 * Evaluates to true if the surface needs to be locked before access.
61 */
62 #define SDL_MUSTLOCK(S) (((S)->flags & SDL_RLEACCEL) != 0)
63
64 /**
65 * \brief A collection of pixels used in software blitting.
66 *
67 * \note This structure should be treated as read-only, except for \c pixels,
68 * which, if not NULL, contains the raw pixel data for the surface.
69 */
70 typedef struct SDL_Surface
71 {
72 Uint32 flags; /**< Read-only */
73 SDL_PixelFormat *format; /**< Read-only */
74 int w, h; /**< Read-only */
75 int pitch; /**< Read-only */
76 void *pixels; /**< Read-write */
77
78 /** Application data associated with the surface */
79 void *userdata; /**< Read-write */
80
81 /** information needed for surfaces requiring locks */
82 int locked; /**< Read-only */
83
84 /** list of BlitMap that hold a reference to this surface */
85 void *list_blitmap; /**< Private */
86
87 /** clipping information */
88 SDL_Rect clip_rect; /**< Read-only */
89
90 /** info for fast blit mapping to other surfaces */
91 struct SDL_BlitMap *map; /**< Private */
92
93 /** Reference count -- used when freeing surface */
94 int refcount; /**< Read-mostly */
95 } SDL_Surface;
96
97 /**
98 * \brief The type of function used for surface blitting functions.
99 */
100 typedef int (SDLCALL *SDL_blit) (struct SDL_Surface * src, SDL_Rect * srcrect,
101 struct SDL_Surface * dst, SDL_Rect * dstrect);
102
103 /**
104 * \brief The formula used for converting between YUV and RGB
105 */
106 typedef enum
107 {
108 SDL_YUV_CONVERSION_JPEG, /**< Full range JPEG */
109 SDL_YUV_CONVERSION_BT601, /**< BT.601 (the default) */
110 SDL_YUV_CONVERSION_BT709, /**< BT.709 */
111 SDL_YUV_CONVERSION_AUTOMATIC /**< BT.601 for SD content, BT.709 for HD content */
112 } SDL_YUV_CONVERSION_MODE;
113
114 /**
115 * Allocate and free an RGB surface.
116 *
117 * If the depth is 4 or 8 bits, an empty palette is allocated for the surface.
118 * If the depth is greater than 8 bits, the pixel format is set using the
119 * flags '[RGB]mask'.
120 *
121 * If the function runs out of memory, it will return NULL.
122 *
123 * \param flags The \c flags are obsolete and should be set to 0.
124 * \param width The width in pixels of the surface to create.
125 * \param height The height in pixels of the surface to create.
126 * \param depth The depth in bits of the surface to create.
127 * \param Rmask The red mask of the surface to create.
128 * \param Gmask The green mask of the surface to create.
129 * \param Bmask The blue mask of the surface to create.
130 * \param Amask The alpha mask of the surface to create.
131 */
132 extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurface
133 (Uint32 flags, int width, int height, int depth,
134 Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
135
136 /* !!! FIXME for 2.1: why does this ask for depth? Format provides that. */
137 extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceWithFormat
138 (Uint32 flags, int width, int height, int depth, Uint32 format);
139
140 extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels,
141 int width,
142 int height,
143 int depth,
144 int pitch,
145 Uint32 Rmask,
146 Uint32 Gmask,
147 Uint32 Bmask,
148 Uint32 Amask);
149 extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceWithFormatFrom
150 (void *pixels, int width, int height, int depth, int pitch, Uint32 format);
151 extern DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface * surface);
152
153 /**
154 * \brief Set the palette used by a surface.
155 *
156 * \return 0, or -1 if the surface format doesn't use a palette.
157 *
158 * \note A single palette can be shared with many surfaces.
159 */
160 extern DECLSPEC int SDLCALL SDL_SetSurfacePalette(SDL_Surface * surface,
161 SDL_Palette * palette);
162
163 /**
164 * \brief Sets up a surface for directly accessing the pixels.
165 *
166 * Between calls to SDL_LockSurface() / SDL_UnlockSurface(), you can write
167 * to and read from \c surface->pixels, using the pixel format stored in
168 * \c surface->format. Once you are done accessing the surface, you should
169 * use SDL_UnlockSurface() to release it.
170 *
171 * Not all surfaces require locking. If SDL_MUSTLOCK(surface) evaluates
172 * to 0, then you can read and write to the surface at any time, and the
173 * pixel format of the surface will not change.
174 *
175 * No operating system or library calls should be made between lock/unlock
176 * pairs, as critical system locks may be held during this time.
177 *
178 * SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked.
179 *
180 * \sa SDL_UnlockSurface()
181 */
182 extern DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface * surface);
183 /** \sa SDL_LockSurface() */
184 extern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface * surface);
185
186 /**
187 * Load a surface from a seekable SDL data stream (memory or file).
188 *
189 * If \c freesrc is non-zero, the stream will be closed after being read.
190 *
191 * The new surface should be freed with SDL_FreeSurface().
192 *
193 * \return the new surface, or NULL if there was an error.
194 */
195 extern DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP_RW(SDL_RWops * src,
196 int freesrc);
197
198 /**
199 * Load a surface from a file.
200 *
201 * Convenience macro.
202 */
203 #define SDL_LoadBMP(file) SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1)
204
205 /**
206 * Save a surface to a seekable SDL data stream (memory or file).
207 *
208 * Surfaces with a 24-bit, 32-bit and paletted 8-bit format get saved in the
209 * BMP directly. Other RGB formats with 8-bit or higher get converted to a
210 * 24-bit surface or, if they have an alpha mask or a colorkey, to a 32-bit
211 * surface before they are saved. YUV and paletted 1-bit and 4-bit formats are
212 * not supported.
213 *
214 * If \c freedst is non-zero, the stream will be closed after being written.
215 *
216 * \return 0 if successful or -1 if there was an error.
217 */
218 extern DECLSPEC int SDLCALL SDL_SaveBMP_RW
219 (SDL_Surface * surface, SDL_RWops * dst, int freedst);
220
221 /**
222 * Save a surface to a file.
223 *
224 * Convenience macro.
225 */
226 #define SDL_SaveBMP(surface, file) \
227 SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1)
228
229 /**
230 * \brief Sets the RLE acceleration hint for a surface.
231 *
232 * \return 0 on success, or -1 if the surface is not valid
233 *
234 * \note If RLE is enabled, colorkey and alpha blending blits are much faster,
235 * but the surface must be locked before directly accessing the pixels.
236 */
237 extern DECLSPEC int SDLCALL SDL_SetSurfaceRLE(SDL_Surface * surface,
238 int flag);
239
240 /**
241 * \brief Returns whether the surface is RLE enabled
242 *
243 * \return SDL_TRUE if the surface is RLE enabled, or SDL_FALSE if the surface is NULL or not RLE enabled
244 */
245 extern DECLSPEC SDL_bool SDLCALL SDL_HasSurfaceRLE(SDL_Surface * surface);
246
247 /**
248 * \brief Sets the color key (transparent pixel) in a blittable surface.
249 *
250 * \param surface The surface to update
251 * \param flag Non-zero to enable colorkey and 0 to disable colorkey
252 * \param key The transparent pixel in the native surface format
253 *
254 * \return 0 on success, or -1 if the surface is not valid
255 *
256 * You can pass SDL_RLEACCEL to enable RLE accelerated blits.
257 */
258 extern DECLSPEC int SDLCALL SDL_SetColorKey(SDL_Surface * surface,
259 int flag, Uint32 key);
260
261 /**
262 * \brief Returns whether the surface has a color key
263 *
264 * \return SDL_TRUE if the surface has a color key, or SDL_FALSE if the surface is NULL or has no color key
265 */
266 extern DECLSPEC SDL_bool SDLCALL SDL_HasColorKey(SDL_Surface * surface);
267
268 /**
269 * \brief Gets the color key (transparent pixel) in a blittable surface.
270 *
271 * \param surface The surface to update
272 * \param key A pointer filled in with the transparent pixel in the native
273 * surface format
274 *
275 * \return 0 on success, or -1 if the surface is not valid or colorkey is not
276 * enabled.
277 */
278 extern DECLSPEC int SDLCALL SDL_GetColorKey(SDL_Surface * surface,
279 Uint32 * key);
280
281 /**
282 * \brief Set an additional color value used in blit operations.
283 *
284 * \param surface The surface to update.
285 * \param r The red color value multiplied into blit operations.
286 * \param g The green color value multiplied into blit operations.
287 * \param b The blue color value multiplied into blit operations.
288 *
289 * \return 0 on success, or -1 if the surface is not valid.
290 *
291 * \sa SDL_GetSurfaceColorMod()
292 */
293 extern DECLSPEC int SDLCALL SDL_SetSurfaceColorMod(SDL_Surface * surface,
294 Uint8 r, Uint8 g, Uint8 b);
295
296
297 /**
298 * \brief Get the additional color value used in blit operations.
299 *
300 * \param surface The surface to query.
301 * \param r A pointer filled in with the current red color value.
302 * \param g A pointer filled in with the current green color value.
303 * \param b A pointer filled in with the current blue color value.
304 *
305 * \return 0 on success, or -1 if the surface is not valid.
306 *
307 * \sa SDL_SetSurfaceColorMod()
308 */
309 extern DECLSPEC int SDLCALL SDL_GetSurfaceColorMod(SDL_Surface * surface,
310 Uint8 * r, Uint8 * g,
311 Uint8 * b);
312
313 /**
314 * \brief Set an additional alpha value used in blit operations.
315 *
316 * \param surface The surface to update.
317 * \param alpha The alpha value multiplied into blit operations.
318 *
319 * \return 0 on success, or -1 if the surface is not valid.
320 *
321 * \sa SDL_GetSurfaceAlphaMod()
322 */
323 extern DECLSPEC int SDLCALL SDL_SetSurfaceAlphaMod(SDL_Surface * surface,
324 Uint8 alpha);
325
326 /**
327 * \brief Get the additional alpha value used in blit operations.
328 *
329 * \param surface The surface to query.
330 * \param alpha A pointer filled in with the current alpha value.
331 *
332 * \return 0 on success, or -1 if the surface is not valid.
333 *
334 * \sa SDL_SetSurfaceAlphaMod()
335 */
336 extern DECLSPEC int SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface * surface,
337 Uint8 * alpha);
338
339 /**
340 * \brief Set the blend mode used for blit operations.
341 *
342 * \param surface The surface to update.
343 * \param blendMode ::SDL_BlendMode to use for blit blending.
344 *
345 * \return 0 on success, or -1 if the parameters are not valid.
346 *
347 * \sa SDL_GetSurfaceBlendMode()
348 */
349 extern DECLSPEC int SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface * surface,
350 SDL_BlendMode blendMode);
351
352 /**
353 * \brief Get the blend mode used for blit operations.
354 *
355 * \param surface The surface to query.
356 * \param blendMode A pointer filled in with the current blend mode.
357 *
358 * \return 0 on success, or -1 if the surface is not valid.
359 *
360 * \sa SDL_SetSurfaceBlendMode()
361 */
362 extern DECLSPEC int SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface * surface,
363 SDL_BlendMode *blendMode);
364
365 /**
366 * Sets the clipping rectangle for the destination surface in a blit.
367 *
368 * If the clip rectangle is NULL, clipping will be disabled.
369 *
370 * If the clip rectangle doesn't intersect the surface, the function will
371 * return SDL_FALSE and blits will be completely clipped. Otherwise the
372 * function returns SDL_TRUE and blits to the surface will be clipped to
373 * the intersection of the surface area and the clipping rectangle.
374 *
375 * Note that blits are automatically clipped to the edges of the source
376 * and destination surfaces.
377 */
378 extern DECLSPEC SDL_bool SDLCALL SDL_SetClipRect(SDL_Surface * surface,
379 const SDL_Rect * rect);
380
381 /**
382 * Gets the clipping rectangle for the destination surface in a blit.
383 *
384 * \c rect must be a pointer to a valid rectangle which will be filled
385 * with the correct values.
386 */
387 extern DECLSPEC void SDLCALL SDL_GetClipRect(SDL_Surface * surface,
388 SDL_Rect * rect);
389
390 /*
391 * Creates a new surface identical to the existing surface
392 */
393 extern DECLSPEC SDL_Surface *SDLCALL SDL_DuplicateSurface(SDL_Surface * surface);
394
395 /**
396 * Creates a new surface of the specified format, and then copies and maps
397 * the given surface to it so the blit of the converted surface will be as
398 * fast as possible. If this function fails, it returns NULL.
399 *
400 * The \c flags parameter is passed to SDL_CreateRGBSurface() and has those
401 * semantics. You can also pass ::SDL_RLEACCEL in the flags parameter and
402 * SDL will try to RLE accelerate colorkey and alpha blits in the resulting
403 * surface.
404 */
405 extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurface
406 (SDL_Surface * src, const SDL_PixelFormat * fmt, Uint32 flags);
407 extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurfaceFormat
408 (SDL_Surface * src, Uint32 pixel_format, Uint32 flags);
409
410 /**
411 * \brief Copy a block of pixels of one format to another format
412 *
413 * \return 0 on success, or -1 if there was an error
414 */
415 extern DECLSPEC int SDLCALL SDL_ConvertPixels(int width, int height,
416 Uint32 src_format,
417 const void * src, int src_pitch,
418 Uint32 dst_format,
419 void * dst, int dst_pitch);
420
421 /**
422 * Performs a fast fill of the given rectangle with \c color.
423 *
424 * If \c rect is NULL, the whole surface will be filled with \c color.
425 *
426 * The color should be a pixel of the format used by the surface, and
427 * can be generated by the SDL_MapRGB() function.
428 *
429 * \return 0 on success, or -1 on error.
430 */
431 extern DECLSPEC int SDLCALL SDL_FillRect
432 (SDL_Surface * dst, const SDL_Rect * rect, Uint32 color);
433 extern DECLSPEC int SDLCALL SDL_FillRects
434 (SDL_Surface * dst, const SDL_Rect * rects, int count, Uint32 color);
435
436 /**
437 * Performs a fast blit from the source surface to the destination surface.
438 *
439 * This assumes that the source and destination rectangles are
440 * the same size. If either \c srcrect or \c dstrect are NULL, the entire
441 * surface (\c src or \c dst) is copied. The final blit rectangles are saved
442 * in \c srcrect and \c dstrect after all clipping is performed.
443 *
444 * \return If the blit is successful, it returns 0, otherwise it returns -1.
445 *
446 * The blit function should not be called on a locked surface.
447 *
448 * The blit semantics for surfaces with and without blending and colorkey
449 * are defined as follows:
450 * \verbatim
451 RGBA->RGB:
452 Source surface blend mode set to SDL_BLENDMODE_BLEND:
453 alpha-blend (using the source alpha-channel and per-surface alpha)
454 SDL_SRCCOLORKEY ignored.
455 Source surface blend mode set to SDL_BLENDMODE_NONE:
456 copy RGB.
457 if SDL_SRCCOLORKEY set, only copy the pixels matching the
458 RGB values of the source color key, ignoring alpha in the
459 comparison.
460
461 RGB->RGBA:
462 Source surface blend mode set to SDL_BLENDMODE_BLEND:
463 alpha-blend (using the source per-surface alpha)
464 Source surface blend mode set to SDL_BLENDMODE_NONE:
465 copy RGB, set destination alpha to source per-surface alpha value.
466 both:
467 if SDL_SRCCOLORKEY set, only copy the pixels matching the
468 source color key.
469
470 RGBA->RGBA:
471 Source surface blend mode set to SDL_BLENDMODE_BLEND:
472 alpha-blend (using the source alpha-channel and per-surface alpha)
473 SDL_SRCCOLORKEY ignored.
474 Source surface blend mode set to SDL_BLENDMODE_NONE:
475 copy all of RGBA to the destination.
476 if SDL_SRCCOLORKEY set, only copy the pixels matching the
477 RGB values of the source color key, ignoring alpha in the
478 comparison.
479
480 RGB->RGB:
481 Source surface blend mode set to SDL_BLENDMODE_BLEND:
482 alpha-blend (using the source per-surface alpha)
483 Source surface blend mode set to SDL_BLENDMODE_NONE:
484 copy RGB.
485 both:
486 if SDL_SRCCOLORKEY set, only copy the pixels matching the
487 source color key.
488 \endverbatim
489 *
490 * You should call SDL_BlitSurface() unless you know exactly how SDL
491 * blitting works internally and how to use the other blit functions.
492 */
493 #define SDL_BlitSurface SDL_UpperBlit
494
495 /**
496 * This is the public blit function, SDL_BlitSurface(), and it performs
497 * rectangle validation and clipping before passing it to SDL_LowerBlit()
498 */
499 extern DECLSPEC int SDLCALL SDL_UpperBlit
500 (SDL_Surface * src, const SDL_Rect * srcrect,
501 SDL_Surface * dst, SDL_Rect * dstrect);
502
503 /**
504 * This is a semi-private blit function and it performs low-level surface
505 * blitting only.
506 */
507 extern DECLSPEC int SDLCALL SDL_LowerBlit
508 (SDL_Surface * src, SDL_Rect * srcrect,
509 SDL_Surface * dst, SDL_Rect * dstrect);
510
511 /**
512 * \brief Perform a fast, low quality, stretch blit between two surfaces of the
513 * same pixel format.
514 *
515 * \note This function uses a static buffer, and is not thread-safe.
516 */
517 extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface * src,
518 const SDL_Rect * srcrect,
519 SDL_Surface * dst,
520 const SDL_Rect * dstrect);
521
522 #define SDL_BlitScaled SDL_UpperBlitScaled
523
524 /**
525 * This is the public scaled blit function, SDL_BlitScaled(), and it performs
526 * rectangle validation and clipping before passing it to SDL_LowerBlitScaled()
527 */
528 extern DECLSPEC int SDLCALL SDL_UpperBlitScaled
529 (SDL_Surface * src, const SDL_Rect * srcrect,
530 SDL_Surface * dst, SDL_Rect * dstrect);
531
532 /**
533 * This is a semi-private blit function and it performs low-level surface
534 * scaled blitting only.
535 */
536 extern DECLSPEC int SDLCALL SDL_LowerBlitScaled
537 (SDL_Surface * src, SDL_Rect * srcrect,
538 SDL_Surface * dst, SDL_Rect * dstrect);
539
540 /**
541 * \brief Set the YUV conversion mode
542 */
543 extern DECLSPEC void SDLCALL SDL_SetYUVConversionMode(SDL_YUV_CONVERSION_MODE mode);
544
545 /**
546 * \brief Get the YUV conversion mode
547 */
548 extern DECLSPEC SDL_YUV_CONVERSION_MODE SDLCALL SDL_GetYUVConversionMode(void);
549
550 /**
551 * \brief Get the YUV conversion mode, returning the correct mode for the resolution when the current conversion mode is SDL_YUV_CONVERSION_AUTOMATIC
552 */
553 extern DECLSPEC SDL_YUV_CONVERSION_MODE SDLCALL SDL_GetYUVConversionModeForResolution(int width, int height);
554
555 /* Ends C function definitions when using C++ */
556 #ifdef __cplusplus
557 }
558 #endif
559 #include "close_code.h"
560
561 #endif /* SDL_surface_h_ */
562
563 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_system.h added (mode: 100644) (index 0000000..d296ab1)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_system.h
24 *
25 * Include file for platform specific SDL API functions
26 */
27
28 #ifndef SDL_system_h_
29 #define SDL_system_h_
30
31 #include "SDL_stdinc.h"
32 #include "SDL_keyboard.h"
33 #include "SDL_render.h"
34 #include "SDL_video.h"
35
36 #include "begin_code.h"
37 /* Set up for C function definitions, even when using C++ */
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41
42
43 /* Platform specific functions for Windows */
44 #ifdef __WIN32__
45
46 /**
47 \brief Set a function that is called for every windows message, before TranslateMessage()
48 */
49 typedef void (SDLCALL * SDL_WindowsMessageHook)(void *userdata, void *hWnd, unsigned int message, Uint64 wParam, Sint64 lParam);
50 extern DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback, void *userdata);
51
52 /**
53 \brief Returns the D3D9 adapter index that matches the specified display index.
54
55 This adapter index can be passed to IDirect3D9::CreateDevice and controls
56 on which monitor a full screen application will appear.
57 */
58 extern DECLSPEC int SDLCALL SDL_Direct3D9GetAdapterIndex( int displayIndex );
59
60 typedef struct IDirect3DDevice9 IDirect3DDevice9;
61 /**
62 \brief Returns the D3D device associated with a renderer, or NULL if it's not a D3D renderer.
63
64 Once you are done using the device, you should release it to avoid a resource leak.
65 */
66 extern DECLSPEC IDirect3DDevice9* SDLCALL SDL_RenderGetD3D9Device(SDL_Renderer * renderer);
67
68 /**
69 \brief Returns the DXGI Adapter and Output indices for the specified display index.
70
71 These can be passed to EnumAdapters and EnumOutputs respectively to get the objects
72 required to create a DX10 or DX11 device and swap chain.
73 */
74 extern DECLSPEC SDL_bool SDLCALL SDL_DXGIGetOutputInfo( int displayIndex, int *adapterIndex, int *outputIndex );
75
76 #endif /* __WIN32__ */
77
78
79 /* Platform specific functions for Linux */
80 #ifdef __LINUX__
81
82 /**
83 \brief Sets the UNIX nice value for a thread, using setpriority() if possible, and RealtimeKit if available.
84
85 \return 0 on success, or -1 on error.
86 */
87 extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriority(Sint64 threadID, int priority);
88
89 #endif /* __LINUX__ */
90
91 /* Platform specific functions for iOS */
92 #ifdef __IPHONEOS__
93
94 #define SDL_iOSSetAnimationCallback(window, interval, callback, callbackParam) SDL_iPhoneSetAnimationCallback(window, interval, callback, callbackParam)
95 extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam);
96
97 #define SDL_iOSSetEventPump(enabled) SDL_iPhoneSetEventPump(enabled)
98 extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled);
99
100 #endif /* __IPHONEOS__ */
101
102
103 /* Platform specific functions for Android */
104 #ifdef __ANDROID__
105
106 /**
107 \brief Get the JNI environment for the current thread
108
109 This returns JNIEnv*, but the prototype is void* so we don't need jni.h
110 */
111 extern DECLSPEC void * SDLCALL SDL_AndroidGetJNIEnv(void);
112
113 /**
114 \brief Get the SDL Activity object for the application
115
116 This returns jobject, but the prototype is void* so we don't need jni.h
117 The jobject returned by SDL_AndroidGetActivity is a local reference.
118 It is the caller's responsibility to properly release it
119 (using env->Push/PopLocalFrame or manually with env->DeleteLocalRef)
120 */
121 extern DECLSPEC void * SDLCALL SDL_AndroidGetActivity(void);
122
123 /**
124 \brief Return API level of the current device
125
126 API level 30: Android 11
127 API level 29: Android 10
128 API level 28: Android 9
129 API level 27: Android 8.1
130 API level 26: Android 8.0
131 API level 25: Android 7.1
132 API level 24: Android 7.0
133 API level 23: Android 6.0
134 API level 22: Android 5.1
135 API level 21: Android 5.0
136 API level 20: Android 4.4W
137 API level 19: Android 4.4
138 API level 18: Android 4.3
139 API level 17: Android 4.2
140 API level 16: Android 4.1
141 API level 15: Android 4.0.3
142 API level 14: Android 4.0
143 API level 13: Android 3.2
144 API level 12: Android 3.1
145 API level 11: Android 3.0
146 API level 10: Android 2.3.3
147 */
148 extern DECLSPEC int SDLCALL SDL_GetAndroidSDKVersion(void);
149
150 /**
151 \brief Return true if the application is running on Android TV
152 */
153 extern DECLSPEC SDL_bool SDLCALL SDL_IsAndroidTV(void);
154
155 /**
156 \brief Return true if the application is running on a Chromebook
157 */
158 extern DECLSPEC SDL_bool SDLCALL SDL_IsChromebook(void);
159
160 /**
161 \brief Return true is the application is running on a Samsung DeX docking station
162 */
163 extern DECLSPEC SDL_bool SDLCALL SDL_IsDeXMode(void);
164
165 /**
166 \brief Trigger the Android system back button behavior.
167 */
168 extern DECLSPEC void SDLCALL SDL_AndroidBackButton(void);
169
170 /**
171 See the official Android developer guide for more information:
172 http://developer.android.com/guide/topics/data/data-storage.html
173 */
174 #define SDL_ANDROID_EXTERNAL_STORAGE_READ 0x01
175 #define SDL_ANDROID_EXTERNAL_STORAGE_WRITE 0x02
176
177 /**
178 \brief Get the path used for internal storage for this application.
179
180 This path is unique to your application and cannot be written to
181 by other applications.
182 */
183 extern DECLSPEC const char * SDLCALL SDL_AndroidGetInternalStoragePath(void);
184
185 /**
186 \brief Get the current state of external storage, a bitmask of these values:
187 SDL_ANDROID_EXTERNAL_STORAGE_READ
188 SDL_ANDROID_EXTERNAL_STORAGE_WRITE
189
190 If external storage is currently unavailable, this will return 0.
191 */
192 extern DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState(void);
193
194 /**
195 \brief Get the path used for external storage for this application.
196
197 This path is unique to your application, but is public and can be
198 written to by other applications.
199 */
200 extern DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath(void);
201
202 /**
203 \brief Request permissions at runtime.
204
205 This blocks the calling thread until the permission is granted or
206 denied. Returns SDL_TRUE if the permission was granted.
207 */
208 extern DECLSPEC SDL_bool SDLCALL SDL_AndroidRequestPermission(const char *permission);
209
210 #endif /* __ANDROID__ */
211
212 /* Platform specific functions for WinRT */
213 #ifdef __WINRT__
214
215 /**
216 * \brief WinRT / Windows Phone path types
217 */
218 typedef enum
219 {
220 /** \brief The installed app's root directory.
221 Files here are likely to be read-only. */
222 SDL_WINRT_PATH_INSTALLED_LOCATION,
223
224 /** \brief The app's local data store. Files may be written here */
225 SDL_WINRT_PATH_LOCAL_FOLDER,
226
227 /** \brief The app's roaming data store. Unsupported on Windows Phone.
228 Files written here may be copied to other machines via a network
229 connection.
230 */
231 SDL_WINRT_PATH_ROAMING_FOLDER,
232
233 /** \brief The app's temporary data store. Unsupported on Windows Phone.
234 Files written here may be deleted at any time. */
235 SDL_WINRT_PATH_TEMP_FOLDER
236 } SDL_WinRT_Path;
237
238
239 /**
240 * \brief WinRT Device Family
241 */
242 typedef enum
243 {
244 /** \brief Unknown family */
245 SDL_WINRT_DEVICEFAMILY_UNKNOWN,
246
247 /** \brief Desktop family*/
248 SDL_WINRT_DEVICEFAMILY_DESKTOP,
249
250 /** \brief Mobile family (for example smartphone) */
251 SDL_WINRT_DEVICEFAMILY_MOBILE,
252
253 /** \brief XBox family */
254 SDL_WINRT_DEVICEFAMILY_XBOX,
255 } SDL_WinRT_DeviceFamily;
256
257
258 /**
259 * \brief Retrieves a WinRT defined path on the local file system
260 *
261 * \note Documentation on most app-specific path types on WinRT
262 * can be found on MSDN, at the URL:
263 * http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx
264 *
265 * \param pathType The type of path to retrieve.
266 * \return A UCS-2 string (16-bit, wide-char) containing the path, or NULL
267 * if the path is not available for any reason. Not all paths are
268 * available on all versions of Windows. This is especially true on
269 * Windows Phone. Check the documentation for the given
270 * SDL_WinRT_Path for more information on which path types are
271 * supported where.
272 */
273 extern DECLSPEC const wchar_t * SDLCALL SDL_WinRTGetFSPathUNICODE(SDL_WinRT_Path pathType);
274
275 /**
276 * \brief Retrieves a WinRT defined path on the local file system
277 *
278 * \note Documentation on most app-specific path types on WinRT
279 * can be found on MSDN, at the URL:
280 * http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx
281 *
282 * \param pathType The type of path to retrieve.
283 * \return A UTF-8 string (8-bit, multi-byte) containing the path, or NULL
284 * if the path is not available for any reason. Not all paths are
285 * available on all versions of Windows. This is especially true on
286 * Windows Phone. Check the documentation for the given
287 * SDL_WinRT_Path for more information on which path types are
288 * supported where.
289 */
290 extern DECLSPEC const char * SDLCALL SDL_WinRTGetFSPathUTF8(SDL_WinRT_Path pathType);
291
292 /**
293 * \brief Detects the device family of WinRT plattform on runtime
294 *
295 * \return Device family
296 */
297 extern DECLSPEC SDL_WinRT_DeviceFamily SDLCALL SDL_WinRTGetDeviceFamily();
298
299 #endif /* __WINRT__ */
300
301 /**
302 \brief Return true if the current device is a tablet.
303 */
304 extern DECLSPEC SDL_bool SDLCALL SDL_IsTablet(void);
305
306 /* Functions used by iOS application delegates to notify SDL about state changes */
307 extern DECLSPEC void SDLCALL SDL_OnApplicationWillTerminate(void);
308 extern DECLSPEC void SDLCALL SDL_OnApplicationDidReceiveMemoryWarning(void);
309 extern DECLSPEC void SDLCALL SDL_OnApplicationWillResignActive(void);
310 extern DECLSPEC void SDLCALL SDL_OnApplicationDidEnterBackground(void);
311 extern DECLSPEC void SDLCALL SDL_OnApplicationWillEnterForeground(void);
312 extern DECLSPEC void SDLCALL SDL_OnApplicationDidBecomeActive(void);
313 #ifdef __IPHONEOS__
314 extern DECLSPEC void SDLCALL SDL_OnApplicationDidChangeStatusBarOrientation(void);
315 #endif
316
317 /* Ends C function definitions when using C++ */
318 #ifdef __cplusplus
319 }
320 #endif
321 #include "close_code.h"
322
323 #endif /* SDL_system_h_ */
324
325 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_syswm.h added (mode: 100644) (index 0000000..f0e9675)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_syswm.h
24 *
25 * Include file for SDL custom system window manager hooks.
26 */
27
28 #ifndef SDL_syswm_h_
29 #define SDL_syswm_h_
30
31 #include "SDL_stdinc.h"
32 #include "SDL_error.h"
33 #include "SDL_video.h"
34 #include "SDL_version.h"
35
36 /**
37 * \brief SDL_syswm.h
38 *
39 * Your application has access to a special type of event ::SDL_SYSWMEVENT,
40 * which contains window-manager specific information and arrives whenever
41 * an unhandled window event occurs. This event is ignored by default, but
42 * you can enable it with SDL_EventState().
43 */
44 struct SDL_SysWMinfo;
45
46 #if !defined(SDL_PROTOTYPES_ONLY)
47
48 #if defined(SDL_VIDEO_DRIVER_WINDOWS)
49 #ifndef WIN32_LEAN_AND_MEAN
50 #define WIN32_LEAN_AND_MEAN
51 #endif
52 #ifndef NOMINMAX /* don't define min() and max(). */
53 #define NOMINMAX
54 #endif
55 #include <windows.h>
56 #endif
57
58 #if defined(SDL_VIDEO_DRIVER_WINRT)
59 #include <Inspectable.h>
60 #endif
61
62 /* This is the structure for custom window manager events */
63 #if defined(SDL_VIDEO_DRIVER_X11)
64 #if defined(__APPLE__) && defined(__MACH__)
65 /* conflicts with Quickdraw.h */
66 #define Cursor X11Cursor
67 #endif
68
69 #include <X11/Xlib.h>
70 #include <X11/Xatom.h>
71
72 #if defined(__APPLE__) && defined(__MACH__)
73 /* matches the re-define above */
74 #undef Cursor
75 #endif
76
77 #endif /* defined(SDL_VIDEO_DRIVER_X11) */
78
79 #if defined(SDL_VIDEO_DRIVER_DIRECTFB)
80 #include <directfb.h>
81 #endif
82
83 #if defined(SDL_VIDEO_DRIVER_COCOA)
84 #ifdef __OBJC__
85 @class NSWindow;
86 #else
87 typedef struct _NSWindow NSWindow;
88 #endif
89 #endif
90
91 #if defined(SDL_VIDEO_DRIVER_UIKIT)
92 #ifdef __OBJC__
93 #include <UIKit/UIKit.h>
94 #else
95 typedef struct _UIWindow UIWindow;
96 typedef struct _UIViewController UIViewController;
97 #endif
98 typedef Uint32 GLuint;
99 #endif
100
101 #if defined(SDL_VIDEO_DRIVER_ANDROID)
102 typedef struct ANativeWindow ANativeWindow;
103 typedef void *EGLSurface;
104 #endif
105
106 #if defined(SDL_VIDEO_DRIVER_VIVANTE)
107 #include "SDL_egl.h"
108 #endif
109
110 #if defined(SDL_VIDEO_DRIVER_OS2)
111 #define INCL_WIN
112 #include <os2.h>
113 #endif
114 #endif /* SDL_PROTOTYPES_ONLY */
115
116
117 #include "begin_code.h"
118 /* Set up for C function definitions, even when using C++ */
119 #ifdef __cplusplus
120 extern "C" {
121 #endif
122
123 #if !defined(SDL_PROTOTYPES_ONLY)
124 /**
125 * These are the various supported windowing subsystems
126 */
127 typedef enum
128 {
129 SDL_SYSWM_UNKNOWN,
130 SDL_SYSWM_WINDOWS,
131 SDL_SYSWM_X11,
132 SDL_SYSWM_DIRECTFB,
133 SDL_SYSWM_COCOA,
134 SDL_SYSWM_UIKIT,
135 SDL_SYSWM_WAYLAND,
136 SDL_SYSWM_MIR, /* no longer available, left for API/ABI compatibility. Remove in 2.1! */
137 SDL_SYSWM_WINRT,
138 SDL_SYSWM_ANDROID,
139 SDL_SYSWM_VIVANTE,
140 SDL_SYSWM_OS2,
141 SDL_SYSWM_HAIKU
142 } SDL_SYSWM_TYPE;
143
144 /**
145 * The custom event structure.
146 */
147 struct SDL_SysWMmsg
148 {
149 SDL_version version;
150 SDL_SYSWM_TYPE subsystem;
151 union
152 {
153 #if defined(SDL_VIDEO_DRIVER_WINDOWS)
154 struct {
155 HWND hwnd; /**< The window for the message */
156 UINT msg; /**< The type of message */
157 WPARAM wParam; /**< WORD message parameter */
158 LPARAM lParam; /**< LONG message parameter */
159 } win;
160 #endif
161 #if defined(SDL_VIDEO_DRIVER_X11)
162 struct {
163 XEvent event;
164 } x11;
165 #endif
166 #if defined(SDL_VIDEO_DRIVER_DIRECTFB)
167 struct {
168 DFBEvent event;
169 } dfb;
170 #endif
171 #if defined(SDL_VIDEO_DRIVER_COCOA)
172 struct
173 {
174 /* Latest version of Xcode clang complains about empty structs in C v. C++:
175 error: empty struct has size 0 in C, size 1 in C++
176 */
177 int dummy;
178 /* No Cocoa window events yet */
179 } cocoa;
180 #endif
181 #if defined(SDL_VIDEO_DRIVER_UIKIT)
182 struct
183 {
184 int dummy;
185 /* No UIKit window events yet */
186 } uikit;
187 #endif
188 #if defined(SDL_VIDEO_DRIVER_VIVANTE)
189 struct
190 {
191 int dummy;
192 /* No Vivante window events yet */
193 } vivante;
194 #endif
195 #if defined(SDL_VIDEO_DRIVER_OS2)
196 struct
197 {
198 BOOL fFrame; /**< TRUE if hwnd is a frame window */
199 HWND hwnd; /**< The window receiving the message */
200 ULONG msg; /**< The message identifier */
201 MPARAM mp1; /**< The first first message parameter */
202 MPARAM mp2; /**< The second first message parameter */
203 } os2;
204 #endif
205 /* Can't have an empty union */
206 int dummy;
207 } msg;
208 };
209
210 /**
211 * The custom window manager information structure.
212 *
213 * When this structure is returned, it holds information about which
214 * low level system it is using, and will be one of SDL_SYSWM_TYPE.
215 */
216 struct SDL_SysWMinfo
217 {
218 SDL_version version;
219 SDL_SYSWM_TYPE subsystem;
220 union
221 {
222 #if defined(SDL_VIDEO_DRIVER_WINDOWS)
223 struct
224 {
225 HWND window; /**< The window handle */
226 HDC hdc; /**< The window device context */
227 HINSTANCE hinstance; /**< The instance handle */
228 } win;
229 #endif
230 #if defined(SDL_VIDEO_DRIVER_WINRT)
231 struct
232 {
233 IInspectable * window; /**< The WinRT CoreWindow */
234 } winrt;
235 #endif
236 #if defined(SDL_VIDEO_DRIVER_X11)
237 struct
238 {
239 Display *display; /**< The X11 display */
240 Window window; /**< The X11 window */
241 } x11;
242 #endif
243 #if defined(SDL_VIDEO_DRIVER_DIRECTFB)
244 struct
245 {
246 IDirectFB *dfb; /**< The directfb main interface */
247 IDirectFBWindow *window; /**< The directfb window handle */
248 IDirectFBSurface *surface; /**< The directfb client surface */
249 } dfb;
250 #endif
251 #if defined(SDL_VIDEO_DRIVER_COCOA)
252 struct
253 {
254 #if defined(__OBJC__) && defined(__has_feature) && __has_feature(objc_arc)
255 NSWindow __unsafe_unretained *window; /**< The Cocoa window */
256 #else
257 NSWindow *window; /**< The Cocoa window */
258 #endif
259 } cocoa;
260 #endif
261 #if defined(SDL_VIDEO_DRIVER_UIKIT)
262 struct
263 {
264 #if defined(__OBJC__) && defined(__has_feature) && __has_feature(objc_arc)
265 UIWindow __unsafe_unretained *window; /**< The UIKit window */
266 #else
267 UIWindow *window; /**< The UIKit window */
268 #endif
269 GLuint framebuffer; /**< The GL view's Framebuffer Object. It must be bound when rendering to the screen using GL. */
270 GLuint colorbuffer; /**< The GL view's color Renderbuffer Object. It must be bound when SDL_GL_SwapWindow is called. */
271 GLuint resolveFramebuffer; /**< The Framebuffer Object which holds the resolve color Renderbuffer, when MSAA is used. */
272 } uikit;
273 #endif
274 #if defined(SDL_VIDEO_DRIVER_WAYLAND)
275 struct
276 {
277 struct wl_display *display; /**< Wayland display */
278 struct wl_surface *surface; /**< Wayland surface */
279 struct wl_shell_surface *shell_surface; /**< Wayland shell_surface (window manager handle) */
280 } wl;
281 #endif
282 #if defined(SDL_VIDEO_DRIVER_MIR) /* no longer available, left for API/ABI compatibility. Remove in 2.1! */
283 struct
284 {
285 void *connection; /**< Mir display server connection */
286 void *surface; /**< Mir surface */
287 } mir;
288 #endif
289
290 #if defined(SDL_VIDEO_DRIVER_ANDROID)
291 struct
292 {
293 ANativeWindow *window;
294 EGLSurface surface;
295 } android;
296 #endif
297
298 #if defined(SDL_VIDEO_DRIVER_OS2)
299 struct
300 {
301 HWND hwnd; /**< The window handle */
302 HWND hwndFrame; /**< The frame window handle */
303 } os2;
304 #endif
305
306 #if defined(SDL_VIDEO_DRIVER_VIVANTE)
307 struct
308 {
309 EGLNativeDisplayType display;
310 EGLNativeWindowType window;
311 } vivante;
312 #endif
313
314 /* Make sure this union is always 64 bytes (8 64-bit pointers). */
315 /* Be careful not to overflow this if you add a new target! */
316 Uint8 dummy[64];
317 } info;
318 };
319
320 #endif /* SDL_PROTOTYPES_ONLY */
321
322 typedef struct SDL_SysWMinfo SDL_SysWMinfo;
323
324 /* Function prototypes */
325 /**
326 * \brief This function allows access to driver-dependent window information.
327 *
328 * \param window The window about which information is being requested
329 * \param info This structure must be initialized with the SDL version, and is
330 * then filled in with information about the given window.
331 *
332 * \return SDL_TRUE if the function is implemented and the version member of
333 * the \c info struct is valid, SDL_FALSE otherwise.
334 *
335 * You typically use this function like this:
336 * \code
337 * SDL_SysWMinfo info;
338 * SDL_VERSION(&info.version);
339 * if ( SDL_GetWindowWMInfo(window, &info) ) { ... }
340 * \endcode
341 */
342 extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowWMInfo(SDL_Window * window,
343 SDL_SysWMinfo * info);
344
345
346 /* Ends C function definitions when using C++ */
347 #ifdef __cplusplus
348 }
349 #endif
350 #include "close_code.h"
351
352 #endif /* SDL_syswm_h_ */
353
354 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_test.h added (mode: 100644) (index 0000000..7095427)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_test.h
24 *
25 * Include file for SDL test framework.
26 *
27 * This code is a part of the SDL2_test library, not the main SDL library.
28 */
29
30 #ifndef SDL_test_h_
31 #define SDL_test_h_
32
33 #include "SDL.h"
34 #include "SDL_test_assert.h"
35 #include "SDL_test_common.h"
36 #include "SDL_test_compare.h"
37 #include "SDL_test_crc32.h"
38 #include "SDL_test_font.h"
39 #include "SDL_test_fuzzer.h"
40 #include "SDL_test_harness.h"
41 #include "SDL_test_images.h"
42 #include "SDL_test_log.h"
43 #include "SDL_test_md5.h"
44 #include "SDL_test_memory.h"
45 #include "SDL_test_random.h"
46
47 #include "begin_code.h"
48 /* Set up for C function definitions, even when using C++ */
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52
53 /* Global definitions */
54
55 /*
56 * Note: Maximum size of SDLTest log message is less than SDL's limit
57 * to ensure we can fit additional information such as the timestamp.
58 */
59 #define SDLTEST_MAX_LOGMESSAGE_LENGTH 3584
60
61 /* Ends C function definitions when using C++ */
62 #ifdef __cplusplus
63 }
64 #endif
65 #include "close_code.h"
66
67 #endif /* SDL_test_h_ */
68
69 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_test_assert.h added (mode: 100644) (index 0000000..19b9095)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_test_assert.h
24 *
25 * Include file for SDL test framework.
26 *
27 * This code is a part of the SDL2_test library, not the main SDL library.
28 */
29
30 /*
31 *
32 * Assert API for test code and test cases
33 *
34 */
35
36 #ifndef SDL_test_assert_h_
37 #define SDL_test_assert_h_
38
39 #include "begin_code.h"
40 /* Set up for C function definitions, even when using C++ */
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44
45 /**
46 * \brief Fails the assert.
47 */
48 #define ASSERT_FAIL 0
49
50 /**
51 * \brief Passes the assert.
52 */
53 #define ASSERT_PASS 1
54
55 /**
56 * \brief Assert that logs and break execution flow on failures.
57 *
58 * \param assertCondition Evaluated condition or variable to assert; fail (==0) or pass (!=0).
59 * \param assertDescription Message to log with the assert describing it.
60 */
61 void SDLTest_Assert(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(2);
62
63 /**
64 * \brief Assert for test cases that logs but does not break execution flow on failures. Updates assertion counters.
65 *
66 * \param assertCondition Evaluated condition or variable to assert; fail (==0) or pass (!=0).
67 * \param assertDescription Message to log with the assert describing it.
68 *
69 * \returns Returns the assertCondition so it can be used to externally to break execution flow if desired.
70 */
71 int SDLTest_AssertCheck(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(2);
72
73 /**
74 * \brief Explicitly pass without checking an assertion condition. Updates assertion counter.
75 *
76 * \param assertDescription Message to log with the assert describing it.
77 */
78 void SDLTest_AssertPass(SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(1);
79
80 /**
81 * \brief Resets the assert summary counters to zero.
82 */
83 void SDLTest_ResetAssertSummary(void);
84
85 /**
86 * \brief Logs summary of all assertions (total, pass, fail) since last reset as INFO or ERROR.
87 */
88 void SDLTest_LogAssertSummary(void);
89
90
91 /**
92 * \brief Converts the current assert summary state to a test result.
93 *
94 * \returns TEST_RESULT_PASSED, TEST_RESULT_FAILED, or TEST_RESULT_NO_ASSERT
95 */
96 int SDLTest_AssertSummaryToTestResult(void);
97
98 #ifdef __cplusplus
99 }
100 #endif
101 #include "close_code.h"
102
103 #endif /* SDL_test_assert_h_ */
104
105 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_test_common.h added (mode: 100644) (index 0000000..3ad2030)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_test_common.h
24 *
25 * Include file for SDL test framework.
26 *
27 * This code is a part of the SDL2_test library, not the main SDL library.
28 */
29
30 /* Ported from original test\common.h file. */
31
32 #ifndef SDL_test_common_h_
33 #define SDL_test_common_h_
34
35 #include "SDL.h"
36
37 #if defined(__PSP__)
38 #define DEFAULT_WINDOW_WIDTH 480
39 #define DEFAULT_WINDOW_HEIGHT 272
40 #else
41 #define DEFAULT_WINDOW_WIDTH 640
42 #define DEFAULT_WINDOW_HEIGHT 480
43 #endif
44
45 #define VERBOSE_VIDEO 0x00000001
46 #define VERBOSE_MODES 0x00000002
47 #define VERBOSE_RENDER 0x00000004
48 #define VERBOSE_EVENT 0x00000008
49 #define VERBOSE_AUDIO 0x00000010
50
51 typedef struct
52 {
53 /* SDL init flags */
54 char **argv;
55 Uint32 flags;
56 Uint32 verbose;
57
58 /* Video info */
59 const char *videodriver;
60 int display;
61 const char *window_title;
62 const char *window_icon;
63 Uint32 window_flags;
64 int window_x;
65 int window_y;
66 int window_w;
67 int window_h;
68 int window_minW;
69 int window_minH;
70 int window_maxW;
71 int window_maxH;
72 int logical_w;
73 int logical_h;
74 float scale;
75 int depth;
76 int refresh_rate;
77 int num_windows;
78 SDL_Window **windows;
79
80 /* Renderer info */
81 const char *renderdriver;
82 Uint32 render_flags;
83 SDL_bool skip_renderer;
84 SDL_Renderer **renderers;
85 SDL_Texture **targets;
86
87 /* Audio info */
88 const char *audiodriver;
89 SDL_AudioSpec audiospec;
90
91 /* GL settings */
92 int gl_red_size;
93 int gl_green_size;
94 int gl_blue_size;
95 int gl_alpha_size;
96 int gl_buffer_size;
97 int gl_depth_size;
98 int gl_stencil_size;
99 int gl_double_buffer;
100 int gl_accum_red_size;
101 int gl_accum_green_size;
102 int gl_accum_blue_size;
103 int gl_accum_alpha_size;
104 int gl_stereo;
105 int gl_multisamplebuffers;
106 int gl_multisamplesamples;
107 int gl_retained_backing;
108 int gl_accelerated;
109 int gl_major_version;
110 int gl_minor_version;
111 int gl_debug;
112 int gl_profile_mask;
113 } SDLTest_CommonState;
114
115 #include "begin_code.h"
116 /* Set up for C function definitions, even when using C++ */
117 #ifdef __cplusplus
118 extern "C" {
119 #endif
120
121 /* Function prototypes */
122
123 /**
124 * \brief Parse command line parameters and create common state.
125 *
126 * \param argv Array of command line parameters
127 * \param flags Flags indicating which subsystem to initialize (i.e. SDL_INIT_VIDEO | SDL_INIT_AUDIO)
128 *
129 * \returns Returns a newly allocated common state object.
130 */
131 SDLTest_CommonState *SDLTest_CommonCreateState(char **argv, Uint32 flags);
132
133 /**
134 * \brief Process one common argument.
135 *
136 * \param state The common state describing the test window to create.
137 * \param index The index of the argument to process in argv[].
138 *
139 * \returns The number of arguments processed (i.e. 1 for --fullscreen, 2 for --video [videodriver], or -1 on error.
140 */
141 int SDLTest_CommonArg(SDLTest_CommonState * state, int index);
142
143
144 /**
145 * \brief Logs command line usage info.
146 *
147 * This logs the appropriate command line options for the subsystems in use
148 * plus other common options, and then any application-specific options.
149 * This uses the SDL_Log() function and splits up output to be friendly to
150 * 80-character-wide terminals.
151 *
152 * \param state The common state describing the test window for the app.
153 * \param argv0 argv[0], as passed to main/SDL_main.
154 * \param options an array of strings for application specific options. The last element of the array should be NULL.
155 */
156 void SDLTest_CommonLogUsage(SDLTest_CommonState * state, const char *argv0, const char **options);
157
158 /**
159 * \brief Returns common usage information
160 *
161 * You should (probably) be using SDLTest_CommonLogUsage() instead, but this
162 * function remains for binary compatibility. Strings returned from this
163 * function are valid until SDLTest_CommonQuit() is called, in which case
164 * those strings' memory is freed and can no longer be used.
165 *
166 * \param state The common state describing the test window to create.
167 * \returns String with usage information
168 */
169 const char *SDLTest_CommonUsage(SDLTest_CommonState * state);
170
171 /**
172 * \brief Open test window.
173 *
174 * \param state The common state describing the test window to create.
175 *
176 * \returns True if initialization succeeded, false otherwise
177 */
178 SDL_bool SDLTest_CommonInit(SDLTest_CommonState * state);
179
180 /**
181 * \brief Easy argument handling when test app doesn't need any custom args.
182 *
183 * \param state The common state describing the test window to create.
184 * \param argc argc, as supplied to SDL_main
185 * \param argv argv, as supplied to SDL_main
186 *
187 * \returns False if app should quit, true otherwise.
188 */
189 SDL_bool SDLTest_CommonDefaultArgs(SDLTest_CommonState * state, const int argc, char **argv);
190
191 /**
192 * \brief Common event handler for test windows.
193 *
194 * \param state The common state used to create test window.
195 * \param event The event to handle.
196 * \param done Flag indicating we are done.
197 *
198 */
199 void SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *done);
200
201 /**
202 * \brief Close test window.
203 *
204 * \param state The common state used to create test window.
205 *
206 */
207 void SDLTest_CommonQuit(SDLTest_CommonState * state);
208
209
210 /* Ends C function definitions when using C++ */
211 #ifdef __cplusplus
212 }
213 #endif
214 #include "close_code.h"
215
216 #endif /* SDL_test_common_h_ */
217
218 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_test_compare.h added (mode: 100644) (index 0000000..38b22bb)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_test_compare.h
24 *
25 * Include file for SDL test framework.
26 *
27 * This code is a part of the SDL2_test library, not the main SDL library.
28 */
29
30 /*
31
32 Defines comparison functions (i.e. for surfaces).
33
34 */
35
36 #ifndef SDL_test_compare_h_
37 #define SDL_test_compare_h_
38
39 #include "SDL.h"
40
41 #include "SDL_test_images.h"
42
43 #include "begin_code.h"
44 /* Set up for C function definitions, even when using C++ */
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48
49 /**
50 * \brief Compares a surface and with reference image data for equality
51 *
52 * \param surface Surface used in comparison
53 * \param referenceSurface Test Surface used in comparison
54 * \param allowable_error Allowable difference (=sum of squared difference for each RGB component) in blending accuracy.
55 *
56 * \returns 0 if comparison succeeded, >0 (=number of pixels for which the comparison failed) if comparison failed, -1 if any of the surfaces were NULL, -2 if the surface sizes differ.
57 */
58 int SDLTest_CompareSurfaces(SDL_Surface *surface, SDL_Surface *referenceSurface, int allowable_error);
59
60
61 /* Ends C function definitions when using C++ */
62 #ifdef __cplusplus
63 }
64 #endif
65 #include "close_code.h"
66
67 #endif /* SDL_test_compare_h_ */
68
69 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_test_crc32.h added (mode: 100644) (index 0000000..611066a)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_test_crc32.h
24 *
25 * Include file for SDL test framework.
26 *
27 * This code is a part of the SDL2_test library, not the main SDL library.
28 */
29
30 /*
31
32 Implements CRC32 calculations (default output is Perl String::CRC32 compatible).
33
34 */
35
36 #ifndef SDL_test_crc32_h_
37 #define SDL_test_crc32_h_
38
39 #include "begin_code.h"
40 /* Set up for C function definitions, even when using C++ */
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44
45
46 /* ------------ Definitions --------- */
47
48 /* Definition shared by all CRC routines */
49
50 #ifndef CrcUint32
51 #define CrcUint32 unsigned int
52 #endif
53 #ifndef CrcUint8
54 #define CrcUint8 unsigned char
55 #endif
56
57 #ifdef ORIGINAL_METHOD
58 #define CRC32_POLY 0x04c11db7 /* AUTODIN II, Ethernet, & FDDI */
59 #else
60 #define CRC32_POLY 0xEDB88320 /* Perl String::CRC32 compatible */
61 #endif
62
63 /**
64 * Data structure for CRC32 (checksum) computation
65 */
66 typedef struct {
67 CrcUint32 crc32_table[256]; /* CRC table */
68 } SDLTest_Crc32Context;
69
70 /* ---------- Function Prototypes ------------- */
71
72 /**
73 * \brief Initialize the CRC context
74 *
75 * Note: The function initializes the crc table required for all crc calculations.
76 *
77 * \param crcContext pointer to context variable
78 *
79 * \returns 0 for OK, -1 on error
80 *
81 */
82 int SDLTest_Crc32Init(SDLTest_Crc32Context * crcContext);
83
84
85 /**
86 * \brief calculate a crc32 from a data block
87 *
88 * \param crcContext pointer to context variable
89 * \param inBuf input buffer to checksum
90 * \param inLen length of input buffer
91 * \param crc32 pointer to Uint32 to store the final CRC into
92 *
93 * \returns 0 for OK, -1 on error
94 *
95 */
96 int SDLTest_Crc32Calc(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32);
97
98 /* Same routine broken down into three steps */
99 int SDLTest_Crc32CalcStart(SDLTest_Crc32Context * crcContext, CrcUint32 *crc32);
100 int SDLTest_Crc32CalcEnd(SDLTest_Crc32Context * crcContext, CrcUint32 *crc32);
101 int SDLTest_Crc32CalcBuffer(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32);
102
103
104 /**
105 * \brief clean up CRC context
106 *
107 * \param crcContext pointer to context variable
108 *
109 * \returns 0 for OK, -1 on error
110 *
111 */
112
113 int SDLTest_Crc32Done(SDLTest_Crc32Context * crcContext);
114
115
116 /* Ends C function definitions when using C++ */
117 #ifdef __cplusplus
118 }
119 #endif
120 #include "close_code.h"
121
122 #endif /* SDL_test_crc32_h_ */
123
124 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_test_font.h added (mode: 100644) (index 0000000..dc4ce6d)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_test_font.h
24 *
25 * Include file for SDL test framework.
26 *
27 * This code is a part of the SDL2_test library, not the main SDL library.
28 */
29
30 #ifndef SDL_test_font_h_
31 #define SDL_test_font_h_
32
33 #include "begin_code.h"
34 /* Set up for C function definitions, even when using C++ */
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38
39 /* Function prototypes */
40
41 #define FONT_CHARACTER_SIZE 8
42
43 /**
44 * \brief Draw a string in the currently set font.
45 *
46 * \param renderer The renderer to draw on.
47 * \param x The X coordinate of the upper left corner of the character.
48 * \param y The Y coordinate of the upper left corner of the character.
49 * \param c The character to draw.
50 *
51 * \returns Returns 0 on success, -1 on failure.
52 */
53 int SDLTest_DrawCharacter(SDL_Renderer *renderer, int x, int y, char c);
54
55 /**
56 * \brief Draw a string in the currently set font.
57 *
58 * \param renderer The renderer to draw on.
59 * \param x The X coordinate of the upper left corner of the string.
60 * \param y The Y coordinate of the upper left corner of the string.
61 * \param s The string to draw.
62 *
63 * \returns Returns 0 on success, -1 on failure.
64 */
65 int SDLTest_DrawString(SDL_Renderer *renderer, int x, int y, const char *s);
66
67
68 /**
69 * \brief Cleanup textures used by font drawing functions.
70 */
71 void SDLTest_CleanupTextDrawing(void);
72
73 /* Ends C function definitions when using C++ */
74 #ifdef __cplusplus
75 }
76 #endif
77 #include "close_code.h"
78
79 #endif /* SDL_test_font_h_ */
80
81 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_test_fuzzer.h added (mode: 100644) (index 0000000..cb5a17a)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_test_fuzzer.h
24 *
25 * Include file for SDL test framework.
26 *
27 * This code is a part of the SDL2_test library, not the main SDL library.
28 */
29
30 /*
31
32 Data generators for fuzzing test data in a reproducible way.
33
34 */
35
36 #ifndef SDL_test_fuzzer_h_
37 #define SDL_test_fuzzer_h_
38
39 #include "begin_code.h"
40 /* Set up for C function definitions, even when using C++ */
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44
45
46 /*
47 Based on GSOC code by Markus Kauppila <markus.kauppila@gmail.com>
48 */
49
50
51 /**
52 * \file
53 * Note: The fuzzer implementation uses a static instance of random context
54 * internally which makes it thread-UNsafe.
55 */
56
57 /**
58 * Initializes the fuzzer for a test
59 *
60 * \param execKey Execution "Key" that initializes the random number generator uniquely for the test.
61 *
62 */
63 void SDLTest_FuzzerInit(Uint64 execKey);
64
65
66 /**
67 * Returns a random Uint8
68 *
69 * \returns Generated integer
70 */
71 Uint8 SDLTest_RandomUint8(void);
72
73 /**
74 * Returns a random Sint8
75 *
76 * \returns Generated signed integer
77 */
78 Sint8 SDLTest_RandomSint8(void);
79
80
81 /**
82 * Returns a random Uint16
83 *
84 * \returns Generated integer
85 */
86 Uint16 SDLTest_RandomUint16(void);
87
88 /**
89 * Returns a random Sint16
90 *
91 * \returns Generated signed integer
92 */
93 Sint16 SDLTest_RandomSint16(void);
94
95
96 /**
97 * Returns a random integer
98 *
99 * \returns Generated integer
100 */
101 Sint32 SDLTest_RandomSint32(void);
102
103
104 /**
105 * Returns a random positive integer
106 *
107 * \returns Generated integer
108 */
109 Uint32 SDLTest_RandomUint32(void);
110
111 /**
112 * Returns random Uint64.
113 *
114 * \returns Generated integer
115 */
116 Uint64 SDLTest_RandomUint64(void);
117
118
119 /**
120 * Returns random Sint64.
121 *
122 * \returns Generated signed integer
123 */
124 Sint64 SDLTest_RandomSint64(void);
125
126 /**
127 * \returns random float in range [0.0 - 1.0[
128 */
129 float SDLTest_RandomUnitFloat(void);
130
131 /**
132 * \returns random double in range [0.0 - 1.0[
133 */
134 double SDLTest_RandomUnitDouble(void);
135
136 /**
137 * \returns random float.
138 *
139 */
140 float SDLTest_RandomFloat(void);
141
142 /**
143 * \returns random double.
144 *
145 */
146 double SDLTest_RandomDouble(void);
147
148 /**
149 * Returns a random boundary value for Uint8 within the given boundaries.
150 * Boundaries are inclusive, see the usage examples below. If validDomain
151 * is true, the function will only return valid boundaries, otherwise non-valid
152 * boundaries are also possible.
153 * If boundary1 > boundary2, the values are swapped
154 *
155 * Usage examples:
156 * RandomUint8BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20
157 * RandomUint8BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21
158 * RandomUint8BoundaryValue(0, 99, SDL_FALSE) returns 100
159 * RandomUint8BoundaryValue(0, 255, SDL_FALSE) returns 0 (error set)
160 *
161 * \param boundary1 Lower boundary limit
162 * \param boundary2 Upper boundary limit
163 * \param validDomain Should the generated boundary be valid (=within the bounds) or not?
164 *
165 * \returns Random boundary value for the given range and domain or 0 with error set
166 */
167 Uint8 SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, SDL_bool validDomain);
168
169 /**
170 * Returns a random boundary value for Uint16 within the given boundaries.
171 * Boundaries are inclusive, see the usage examples below. If validDomain
172 * is true, the function will only return valid boundaries, otherwise non-valid
173 * boundaries are also possible.
174 * If boundary1 > boundary2, the values are swapped
175 *
176 * Usage examples:
177 * RandomUint16BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20
178 * RandomUint16BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21
179 * RandomUint16BoundaryValue(0, 99, SDL_FALSE) returns 100
180 * RandomUint16BoundaryValue(0, 0xFFFF, SDL_FALSE) returns 0 (error set)
181 *
182 * \param boundary1 Lower boundary limit
183 * \param boundary2 Upper boundary limit
184 * \param validDomain Should the generated boundary be valid (=within the bounds) or not?
185 *
186 * \returns Random boundary value for the given range and domain or 0 with error set
187 */
188 Uint16 SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL_bool validDomain);
189
190 /**
191 * Returns a random boundary value for Uint32 within the given boundaries.
192 * Boundaries are inclusive, see the usage examples below. If validDomain
193 * is true, the function will only return valid boundaries, otherwise non-valid
194 * boundaries are also possible.
195 * If boundary1 > boundary2, the values are swapped
196 *
197 * Usage examples:
198 * RandomUint32BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20
199 * RandomUint32BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21
200 * RandomUint32BoundaryValue(0, 99, SDL_FALSE) returns 100
201 * RandomUint32BoundaryValue(0, 0xFFFFFFFF, SDL_FALSE) returns 0 (with error set)
202 *
203 * \param boundary1 Lower boundary limit
204 * \param boundary2 Upper boundary limit
205 * \param validDomain Should the generated boundary be valid (=within the bounds) or not?
206 *
207 * \returns Random boundary value for the given range and domain or 0 with error set
208 */
209 Uint32 SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL_bool validDomain);
210
211 /**
212 * Returns a random boundary value for Uint64 within the given boundaries.
213 * Boundaries are inclusive, see the usage examples below. If validDomain
214 * is true, the function will only return valid boundaries, otherwise non-valid
215 * boundaries are also possible.
216 * If boundary1 > boundary2, the values are swapped
217 *
218 * Usage examples:
219 * RandomUint64BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20
220 * RandomUint64BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21
221 * RandomUint64BoundaryValue(0, 99, SDL_FALSE) returns 100
222 * RandomUint64BoundaryValue(0, 0xFFFFFFFFFFFFFFFF, SDL_FALSE) returns 0 (with error set)
223 *
224 * \param boundary1 Lower boundary limit
225 * \param boundary2 Upper boundary limit
226 * \param validDomain Should the generated boundary be valid (=within the bounds) or not?
227 *
228 * \returns Random boundary value for the given range and domain or 0 with error set
229 */
230 Uint64 SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL_bool validDomain);
231
232 /**
233 * Returns a random boundary value for Sint8 within the given boundaries.
234 * Boundaries are inclusive, see the usage examples below. If validDomain
235 * is true, the function will only return valid boundaries, otherwise non-valid
236 * boundaries are also possible.
237 * If boundary1 > boundary2, the values are swapped
238 *
239 * Usage examples:
240 * RandomSint8BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20
241 * RandomSint8BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9
242 * RandomSint8BoundaryValue(SINT8_MIN, 99, SDL_FALSE) returns 100
243 * RandomSint8BoundaryValue(SINT8_MIN, SINT8_MAX, SDL_FALSE) returns SINT8_MIN (== error value) with error set
244 *
245 * \param boundary1 Lower boundary limit
246 * \param boundary2 Upper boundary limit
247 * \param validDomain Should the generated boundary be valid (=within the bounds) or not?
248 *
249 * \returns Random boundary value for the given range and domain or SINT8_MIN with error set
250 */
251 Sint8 SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, SDL_bool validDomain);
252
253
254 /**
255 * Returns a random boundary value for Sint16 within the given boundaries.
256 * Boundaries are inclusive, see the usage examples below. If validDomain
257 * is true, the function will only return valid boundaries, otherwise non-valid
258 * boundaries are also possible.
259 * If boundary1 > boundary2, the values are swapped
260 *
261 * Usage examples:
262 * RandomSint16BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20
263 * RandomSint16BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9
264 * RandomSint16BoundaryValue(SINT16_MIN, 99, SDL_FALSE) returns 100
265 * RandomSint16BoundaryValue(SINT16_MIN, SINT16_MAX, SDL_FALSE) returns SINT16_MIN (== error value) with error set
266 *
267 * \param boundary1 Lower boundary limit
268 * \param boundary2 Upper boundary limit
269 * \param validDomain Should the generated boundary be valid (=within the bounds) or not?
270 *
271 * \returns Random boundary value for the given range and domain or SINT16_MIN with error set
272 */
273 Sint16 SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL_bool validDomain);
274
275 /**
276 * Returns a random boundary value for Sint32 within the given boundaries.
277 * Boundaries are inclusive, see the usage examples below. If validDomain
278 * is true, the function will only return valid boundaries, otherwise non-valid
279 * boundaries are also possible.
280 * If boundary1 > boundary2, the values are swapped
281 *
282 * Usage examples:
283 * RandomSint32BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20
284 * RandomSint32BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9
285 * RandomSint32BoundaryValue(SINT32_MIN, 99, SDL_FALSE) returns 100
286 * RandomSint32BoundaryValue(SINT32_MIN, SINT32_MAX, SDL_FALSE) returns SINT32_MIN (== error value)
287 *
288 * \param boundary1 Lower boundary limit
289 * \param boundary2 Upper boundary limit
290 * \param validDomain Should the generated boundary be valid (=within the bounds) or not?
291 *
292 * \returns Random boundary value for the given range and domain or SINT32_MIN with error set
293 */
294 Sint32 SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL_bool validDomain);
295
296 /**
297 * Returns a random boundary value for Sint64 within the given boundaries.
298 * Boundaries are inclusive, see the usage examples below. If validDomain
299 * is true, the function will only return valid boundaries, otherwise non-valid
300 * boundaries are also possible.
301 * If boundary1 > boundary2, the values are swapped
302 *
303 * Usage examples:
304 * RandomSint64BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20
305 * RandomSint64BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9
306 * RandomSint64BoundaryValue(SINT64_MIN, 99, SDL_FALSE) returns 100
307 * RandomSint64BoundaryValue(SINT64_MIN, SINT64_MAX, SDL_FALSE) returns SINT64_MIN (== error value) and error set
308 *
309 * \param boundary1 Lower boundary limit
310 * \param boundary2 Upper boundary limit
311 * \param validDomain Should the generated boundary be valid (=within the bounds) or not?
312 *
313 * \returns Random boundary value for the given range and domain or SINT64_MIN with error set
314 */
315 Sint64 SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL_bool validDomain);
316
317
318 /**
319 * Returns integer in range [min, max] (inclusive).
320 * Min and max values can be negative values.
321 * If Max in smaller than min, then the values are swapped.
322 * Min and max are the same value, that value will be returned.
323 *
324 * \param min Minimum inclusive value of returned random number
325 * \param max Maximum inclusive value of returned random number
326 *
327 * \returns Generated random integer in range
328 */
329 Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max);
330
331
332 /**
333 * Generates random null-terminated string. The minimum length for
334 * the string is 1 character, maximum length for the string is 255
335 * characters and it can contain ASCII characters from 32 to 126.
336 *
337 * Note: Returned string needs to be deallocated.
338 *
339 * \returns Newly allocated random string; or NULL if length was invalid or string could not be allocated.
340 */
341 char * SDLTest_RandomAsciiString(void);
342
343
344 /**
345 * Generates random null-terminated string. The maximum length for
346 * the string is defined by the maxLength parameter.
347 * String can contain ASCII characters from 32 to 126.
348 *
349 * Note: Returned string needs to be deallocated.
350 *
351 * \param maxLength The maximum length of the generated string.
352 *
353 * \returns Newly allocated random string; or NULL if maxLength was invalid or string could not be allocated.
354 */
355 char * SDLTest_RandomAsciiStringWithMaximumLength(int maxLength);
356
357
358 /**
359 * Generates random null-terminated string. The length for
360 * the string is defined by the size parameter.
361 * String can contain ASCII characters from 32 to 126.
362 *
363 * Note: Returned string needs to be deallocated.
364 *
365 * \param size The length of the generated string
366 *
367 * \returns Newly allocated random string; or NULL if size was invalid or string could not be allocated.
368 */
369 char * SDLTest_RandomAsciiStringOfSize(int size);
370
371 /**
372 * Returns the invocation count for the fuzzer since last ...FuzzerInit.
373 */
374 int SDLTest_GetFuzzerInvocationCount(void);
375
376 /* Ends C function definitions when using C++ */
377 #ifdef __cplusplus
378 }
379 #endif
380 #include "close_code.h"
381
382 #endif /* SDL_test_fuzzer_h_ */
383
384 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_test_harness.h added (mode: 100644) (index 0000000..97d9812)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_test_harness.h
24 *
25 * Include file for SDL test framework.
26 *
27 * This code is a part of the SDL2_test library, not the main SDL library.
28 */
29
30 /*
31 Defines types for test case definitions and the test execution harness API.
32
33 Based on original GSOC code by Markus Kauppila <markus.kauppila@gmail.com>
34 */
35
36 #ifndef SDL_test_h_arness_h
37 #define SDL_test_h_arness_h
38
39 #include "begin_code.h"
40 /* Set up for C function definitions, even when using C++ */
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44
45
46 /* ! Definitions for test case structures */
47 #define TEST_ENABLED 1
48 #define TEST_DISABLED 0
49
50 /* ! Definition of all the possible test return values of the test case method */
51 #define TEST_ABORTED -1
52 #define TEST_STARTED 0
53 #define TEST_COMPLETED 1
54 #define TEST_SKIPPED 2
55
56 /* ! Definition of all the possible test results for the harness */
57 #define TEST_RESULT_PASSED 0
58 #define TEST_RESULT_FAILED 1
59 #define TEST_RESULT_NO_ASSERT 2
60 #define TEST_RESULT_SKIPPED 3
61 #define TEST_RESULT_SETUP_FAILURE 4
62
63 /* !< Function pointer to a test case setup function (run before every test) */
64 typedef void (*SDLTest_TestCaseSetUpFp)(void *arg);
65
66 /* !< Function pointer to a test case function */
67 typedef int (*SDLTest_TestCaseFp)(void *arg);
68
69 /* !< Function pointer to a test case teardown function (run after every test) */
70 typedef void (*SDLTest_TestCaseTearDownFp)(void *arg);
71
72 /**
73 * Holds information about a single test case.
74 */
75 typedef struct SDLTest_TestCaseReference {
76 /* !< Func2Stress */
77 SDLTest_TestCaseFp testCase;
78 /* !< Short name (or function name) "Func2Stress" */
79 char *name;
80 /* !< Long name or full description "This test pushes func2() to the limit." */
81 char *description;
82 /* !< Set to TEST_ENABLED or TEST_DISABLED (test won't be run) */
83 int enabled;
84 } SDLTest_TestCaseReference;
85
86 /**
87 * Holds information about a test suite (multiple test cases).
88 */
89 typedef struct SDLTest_TestSuiteReference {
90 /* !< "PlatformSuite" */
91 char *name;
92 /* !< The function that is run before each test. NULL skips. */
93 SDLTest_TestCaseSetUpFp testSetUp;
94 /* !< The test cases that are run as part of the suite. Last item should be NULL. */
95 const SDLTest_TestCaseReference **testCases;
96 /* !< The function that is run after each test. NULL skips. */
97 SDLTest_TestCaseTearDownFp testTearDown;
98 } SDLTest_TestSuiteReference;
99
100
101 /**
102 * \brief Generates a random run seed string for the harness. The generated seed will contain alphanumeric characters (0-9A-Z).
103 *
104 * Note: The returned string needs to be deallocated by the caller.
105 *
106 * \param length The length of the seed string to generate
107 *
108 * \returns The generated seed string
109 */
110 char *SDLTest_GenerateRunSeed(const int length);
111
112 /**
113 * \brief Execute a test suite using the given run seed and execution key.
114 *
115 * \param testSuites Suites containing the test case.
116 * \param userRunSeed Custom run seed provided by user, or NULL to autogenerate one.
117 * \param userExecKey Custom execution key provided by user, or 0 to autogenerate one.
118 * \param filter Filter specification. NULL disables. Case sensitive.
119 * \param testIterations Number of iterations to run each test case.
120 *
121 * \returns Test run result; 0 when all tests passed, 1 if any tests failed.
122 */
123 int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *userRunSeed, Uint64 userExecKey, const char *filter, int testIterations);
124
125
126 /* Ends C function definitions when using C++ */
127 #ifdef __cplusplus
128 }
129 #endif
130 #include "close_code.h"
131
132 #endif /* SDL_test_h_arness_h */
133
134 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_test_images.h added (mode: 100644) (index 0000000..1cc3ee2)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_test_images.h
24 *
25 * Include file for SDL test framework.
26 *
27 * This code is a part of the SDL2_test library, not the main SDL library.
28 */
29
30 /*
31
32 Defines some images for tests.
33
34 */
35
36 #ifndef SDL_test_images_h_
37 #define SDL_test_images_h_
38
39 #include "SDL.h"
40
41 #include "begin_code.h"
42 /* Set up for C function definitions, even when using C++ */
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46
47 /**
48 *Type for test images.
49 */
50 typedef struct SDLTest_SurfaceImage_s {
51 int width;
52 int height;
53 unsigned int bytes_per_pixel; /* 3:RGB, 4:RGBA */
54 const char *pixel_data;
55 } SDLTest_SurfaceImage_t;
56
57 /* Test images */
58 SDL_Surface *SDLTest_ImageBlit(void);
59 SDL_Surface *SDLTest_ImageBlitColor(void);
60 SDL_Surface *SDLTest_ImageBlitAlpha(void);
61 SDL_Surface *SDLTest_ImageBlitBlendAdd(void);
62 SDL_Surface *SDLTest_ImageBlitBlend(void);
63 SDL_Surface *SDLTest_ImageBlitBlendMod(void);
64 SDL_Surface *SDLTest_ImageBlitBlendNone(void);
65 SDL_Surface *SDLTest_ImageBlitBlendAll(void);
66 SDL_Surface *SDLTest_ImageFace(void);
67 SDL_Surface *SDLTest_ImagePrimitives(void);
68 SDL_Surface *SDLTest_ImagePrimitivesBlend(void);
69
70 /* Ends C function definitions when using C++ */
71 #ifdef __cplusplus
72 }
73 #endif
74 #include "close_code.h"
75
76 #endif /* SDL_test_images_h_ */
77
78 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_test_log.h added (mode: 100644) (index 0000000..6066f90)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_test_log.h
24 *
25 * Include file for SDL test framework.
26 *
27 * This code is a part of the SDL2_test library, not the main SDL library.
28 */
29
30 /*
31 *
32 * Wrapper to log in the TEST category
33 *
34 */
35
36 #ifndef SDL_test_log_h_
37 #define SDL_test_log_h_
38
39 #include "begin_code.h"
40 /* Set up for C function definitions, even when using C++ */
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44
45 /**
46 * \brief Prints given message with a timestamp in the TEST category and INFO priority.
47 *
48 * \param fmt Message to be logged
49 */
50 void SDLTest_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1);
51
52 /**
53 * \brief Prints given message with a timestamp in the TEST category and the ERROR priority.
54 *
55 * \param fmt Message to be logged
56 */
57 void SDLTest_LogError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1);
58
59 /* Ends C function definitions when using C++ */
60 #ifdef __cplusplus
61 }
62 #endif
63 #include "close_code.h"
64
65 #endif /* SDL_test_log_h_ */
66
67 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_test_md5.h added (mode: 100644) (index 0000000..b1c51d9)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_test_md5.h
24 *
25 * Include file for SDL test framework.
26 *
27 * This code is a part of the SDL2_test library, not the main SDL library.
28 */
29
30 /*
31 ***********************************************************************
32 ** Header file for implementation of MD5 **
33 ** RSA Data Security, Inc. MD5 Message-Digest Algorithm **
34 ** Created: 2/17/90 RLR **
35 ** Revised: 12/27/90 SRD,AJ,BSK,JT Reference C version **
36 ** Revised (for MD5): RLR 4/27/91 **
37 ** -- G modified to have y&~z instead of y&z **
38 ** -- FF, GG, HH modified to add in last register done **
39 ** -- Access pattern: round 2 works mod 5, round 3 works mod 3 **
40 ** -- distinct additive constant for each step **
41 ** -- round 4 added, working mod 7 **
42 ***********************************************************************
43 */
44
45 /*
46 ***********************************************************************
47 ** Message-digest routines: **
48 ** To form the message digest for a message M **
49 ** (1) Initialize a context buffer mdContext using MD5Init **
50 ** (2) Call MD5Update on mdContext and M **
51 ** (3) Call MD5Final on mdContext **
52 ** The message digest is now in mdContext->digest[0...15] **
53 ***********************************************************************
54 */
55
56 #ifndef SDL_test_md5_h_
57 #define SDL_test_md5_h_
58
59 #include "begin_code.h"
60 /* Set up for C function definitions, even when using C++ */
61 #ifdef __cplusplus
62 extern "C" {
63 #endif
64
65 /* ------------ Definitions --------- */
66
67 /* typedef a 32-bit type */
68 typedef unsigned long int MD5UINT4;
69
70 /* Data structure for MD5 (Message-Digest) computation */
71 typedef struct {
72 MD5UINT4 i[2]; /* number of _bits_ handled mod 2^64 */
73 MD5UINT4 buf[4]; /* scratch buffer */
74 unsigned char in[64]; /* input buffer */
75 unsigned char digest[16]; /* actual digest after Md5Final call */
76 } SDLTest_Md5Context;
77
78 /* ---------- Function Prototypes ------------- */
79
80 /**
81 * \brief initialize the context
82 *
83 * \param mdContext pointer to context variable
84 *
85 * Note: The function initializes the message-digest context
86 * mdContext. Call before each new use of the context -
87 * all fields are set to zero.
88 */
89 void SDLTest_Md5Init(SDLTest_Md5Context * mdContext);
90
91
92 /**
93 * \brief update digest from variable length data
94 *
95 * \param mdContext pointer to context variable
96 * \param inBuf pointer to data array/string
97 * \param inLen length of data array/string
98 *
99 * Note: The function updates the message-digest context to account
100 * for the presence of each of the characters inBuf[0..inLen-1]
101 * in the message whose digest is being computed.
102 */
103
104 void SDLTest_Md5Update(SDLTest_Md5Context * mdContext, unsigned char *inBuf,
105 unsigned int inLen);
106
107
108 /**
109 * \brief complete digest computation
110 *
111 * \param mdContext pointer to context variable
112 *
113 * Note: The function terminates the message-digest computation and
114 * ends with the desired message digest in mdContext.digest[0..15].
115 * Always call before using the digest[] variable.
116 */
117
118 void SDLTest_Md5Final(SDLTest_Md5Context * mdContext);
119
120
121 /* Ends C function definitions when using C++ */
122 #ifdef __cplusplus
123 }
124 #endif
125 #include "close_code.h"
126
127 #endif /* SDL_test_md5_h_ */
128
129 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_test_memory.h added (mode: 100644) (index 0000000..df69f93)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_test_memory.h
24 *
25 * Include file for SDL test framework.
26 *
27 * This code is a part of the SDL2_test library, not the main SDL library.
28 */
29
30 #ifndef SDL_test_memory_h_
31 #define SDL_test_memory_h_
32
33 #include "begin_code.h"
34 /* Set up for C function definitions, even when using C++ */
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38
39
40 /**
41 * \brief Start tracking SDL memory allocations
42 *
43 * \note This should be called before any other SDL functions for complete tracking coverage
44 */
45 int SDLTest_TrackAllocations(void);
46
47 /**
48 * \brief Print a log of any outstanding allocations
49 *
50 * \note This can be called after SDL_Quit()
51 */
52 void SDLTest_LogAllocations(void);
53
54
55 /* Ends C function definitions when using C++ */
56 #ifdef __cplusplus
57 }
58 #endif
59 #include "close_code.h"
60
61 #endif /* SDL_test_memory_h_ */
62
63 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_test_random.h added (mode: 100644) (index 0000000..9404e9d)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_test_random.h
24 *
25 * Include file for SDL test framework.
26 *
27 * This code is a part of the SDL2_test library, not the main SDL library.
28 */
29
30 /*
31
32 A "32-bit Multiply with carry random number generator. Very fast.
33 Includes a list of recommended multipliers.
34
35 multiply-with-carry generator: x(n) = a*x(n-1) + carry mod 2^32.
36 period: (a*2^31)-1
37
38 */
39
40 #ifndef SDL_test_random_h_
41 #define SDL_test_random_h_
42
43 #include "begin_code.h"
44 /* Set up for C function definitions, even when using C++ */
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48
49 /* --- Definitions */
50
51 /*
52 * Macros that return a random number in a specific format.
53 */
54 #define SDLTest_RandomInt(c) ((int)SDLTest_Random(c))
55
56 /*
57 * Context structure for the random number generator state.
58 */
59 typedef struct {
60 unsigned int a;
61 unsigned int x;
62 unsigned int c;
63 unsigned int ah;
64 unsigned int al;
65 } SDLTest_RandomContext;
66
67
68 /* --- Function prototypes */
69
70 /**
71 * \brief Initialize random number generator with two integers.
72 *
73 * Note: The random sequence of numbers returned by ...Random() is the
74 * same for the same two integers and has a period of 2^31.
75 *
76 * \param rndContext pointer to context structure
77 * \param xi integer that defines the random sequence
78 * \param ci integer that defines the random sequence
79 *
80 */
81 void SDLTest_RandomInit(SDLTest_RandomContext * rndContext, unsigned int xi,
82 unsigned int ci);
83
84 /**
85 * \brief Initialize random number generator based on current system time.
86 *
87 * \param rndContext pointer to context structure
88 *
89 */
90 void SDLTest_RandomInitTime(SDLTest_RandomContext *rndContext);
91
92
93 /**
94 * \brief Initialize random number generator based on current system time.
95 *
96 * Note: ...RandomInit() or ...RandomInitTime() must have been called
97 * before using this function.
98 *
99 * \param rndContext pointer to context structure
100 *
101 * \returns A random number (32bit unsigned integer)
102 *
103 */
104 unsigned int SDLTest_Random(SDLTest_RandomContext *rndContext);
105
106
107 /* Ends C function definitions when using C++ */
108 #ifdef __cplusplus
109 }
110 #endif
111 #include "close_code.h"
112
113 #endif /* SDL_test_random_h_ */
114
115 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_thread.h added (mode: 100644) (index 0000000..4016358)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 #ifndef SDL_thread_h_
23 #define SDL_thread_h_
24
25 /**
26 * \file SDL_thread.h
27 *
28 * Header for the SDL thread management routines.
29 */
30
31 #include "SDL_stdinc.h"
32 #include "SDL_error.h"
33
34 /* Thread synchronization primitives */
35 #include "SDL_atomic.h"
36 #include "SDL_mutex.h"
37
38 #include "begin_code.h"
39 /* Set up for C function definitions, even when using C++ */
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43
44 /* The SDL thread structure, defined in SDL_thread.c */
45 struct SDL_Thread;
46 typedef struct SDL_Thread SDL_Thread;
47
48 /* The SDL thread ID */
49 typedef unsigned long SDL_threadID;
50
51 /* Thread local storage ID, 0 is the invalid ID */
52 typedef unsigned int SDL_TLSID;
53
54 /**
55 * The SDL thread priority.
56 *
57 * SDL will make system changes as necessary in order to apply the thread priority.
58 * Code which attempts to control thread state related to priority should be aware
59 * that calling SDL_SetThreadPriority may alter such state.
60 * SDL_HINT_THREAD_PRIORITY_POLICY can be used to control aspects of this behavior.
61 *
62 * \note On many systems you require special privileges to set high or time critical priority.
63 */
64 typedef enum {
65 SDL_THREAD_PRIORITY_LOW,
66 SDL_THREAD_PRIORITY_NORMAL,
67 SDL_THREAD_PRIORITY_HIGH,
68 SDL_THREAD_PRIORITY_TIME_CRITICAL
69 } SDL_ThreadPriority;
70
71 /**
72 * The function passed to SDL_CreateThread().
73 * It is passed a void* user context parameter and returns an int.
74 */
75 typedef int (SDLCALL * SDL_ThreadFunction) (void *data);
76
77 #if defined(__WIN32__)
78 /**
79 * \file SDL_thread.h
80 *
81 * We compile SDL into a DLL. This means, that it's the DLL which
82 * creates a new thread for the calling process with the SDL_CreateThread()
83 * API. There is a problem with this, that only the RTL of the SDL2.DLL will
84 * be initialized for those threads, and not the RTL of the calling
85 * application!
86 *
87 * To solve this, we make a little hack here.
88 *
89 * We'll always use the caller's _beginthread() and _endthread() APIs to
90 * start a new thread. This way, if it's the SDL2.DLL which uses this API,
91 * then the RTL of SDL2.DLL will be used to create the new thread, and if it's
92 * the application, then the RTL of the application will be used.
93 *
94 * So, in short:
95 * Always use the _beginthread() and _endthread() of the calling runtime
96 * library!
97 */
98 #define SDL_PASSED_BEGINTHREAD_ENDTHREAD
99 #include <process.h> /* _beginthreadex() and _endthreadex() */
100
101 typedef uintptr_t (__cdecl * pfnSDL_CurrentBeginThread)
102 (void *, unsigned, unsigned (__stdcall *func)(void *),
103 void * /*arg*/, unsigned, unsigned * /* threadID */);
104 typedef void (__cdecl * pfnSDL_CurrentEndThread) (unsigned code);
105
106 #ifndef SDL_beginthread
107 #define SDL_beginthread _beginthreadex
108 #endif
109 #ifndef SDL_endthread
110 #define SDL_endthread _endthreadex
111 #endif
112
113 /**
114 * Create a thread.
115 */
116 extern DECLSPEC SDL_Thread *SDLCALL
117 SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data,
118 pfnSDL_CurrentBeginThread pfnBeginThread,
119 pfnSDL_CurrentEndThread pfnEndThread);
120
121 extern DECLSPEC SDL_Thread *SDLCALL
122 SDL_CreateThreadWithStackSize(int (SDLCALL * fn) (void *),
123 const char *name, const size_t stacksize, void *data,
124 pfnSDL_CurrentBeginThread pfnBeginThread,
125 pfnSDL_CurrentEndThread pfnEndThread);
126
127
128 /**
129 * Create a thread.
130 */
131 #if defined(SDL_CreateThread) && SDL_DYNAMIC_API
132 #undef SDL_CreateThread
133 #define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
134 #undef SDL_CreateThreadWithStackSize
135 #define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
136 #else
137 #define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
138 #define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)SDL_endthread)
139 #endif
140
141 #elif defined(__OS2__)
142 /*
143 * just like the windows case above: We compile SDL2
144 * into a dll with Watcom's runtime statically linked.
145 */
146 #define SDL_PASSED_BEGINTHREAD_ENDTHREAD
147
148 #ifndef __EMX__
149 #include <process.h>
150 #else
151 #include <stdlib.h>
152 #endif
153
154 typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void * /*arg*/);
155 typedef void (*pfnSDL_CurrentEndThread)(void);
156
157 #ifndef SDL_beginthread
158 #define SDL_beginthread _beginthread
159 #endif
160 #ifndef SDL_endthread
161 #define SDL_endthread _endthread
162 #endif
163
164 extern DECLSPEC SDL_Thread *SDLCALL
165 SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data,
166 pfnSDL_CurrentBeginThread pfnBeginThread,
167 pfnSDL_CurrentEndThread pfnEndThread);
168 extern DECLSPEC SDL_Thread *SDLCALL
169 SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const size_t stacksize, void *data,
170 pfnSDL_CurrentBeginThread pfnBeginThread,
171 pfnSDL_CurrentEndThread pfnEndThread);
172
173 #if defined(SDL_CreateThread) && SDL_DYNAMIC_API
174 #undef SDL_CreateThread
175 #define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
176 #undef SDL_CreateThreadWithStackSize
177 #define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
178 #else
179 #define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
180 #define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
181 #endif
182
183 #else
184
185 /**
186 * Create a thread with a default stack size.
187 *
188 * This is equivalent to calling:
189 * SDL_CreateThreadWithStackSize(fn, name, 0, data);
190 */
191 extern DECLSPEC SDL_Thread *SDLCALL
192 SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data);
193
194 /**
195 * Create a thread.
196 *
197 * Thread naming is a little complicated: Most systems have very small
198 * limits for the string length (Haiku has 32 bytes, Linux currently has 16,
199 * Visual C++ 6.0 has nine!), and possibly other arbitrary rules. You'll
200 * have to see what happens with your system's debugger. The name should be
201 * UTF-8 (but using the naming limits of C identifiers is a better bet).
202 * There are no requirements for thread naming conventions, so long as the
203 * string is null-terminated UTF-8, but these guidelines are helpful in
204 * choosing a name:
205 *
206 * http://stackoverflow.com/questions/149932/naming-conventions-for-threads
207 *
208 * If a system imposes requirements, SDL will try to munge the string for
209 * it (truncate, etc), but the original string contents will be available
210 * from SDL_GetThreadName().
211 *
212 * The size (in bytes) of the new stack can be specified. Zero means "use
213 * the system default" which might be wildly different between platforms
214 * (x86 Linux generally defaults to eight megabytes, an embedded device
215 * might be a few kilobytes instead).
216 *
217 * In SDL 2.1, stacksize will be folded into the original SDL_CreateThread
218 * function.
219 */
220 extern DECLSPEC SDL_Thread *SDLCALL
221 SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const size_t stacksize, void *data);
222
223 #endif
224
225 /**
226 * Get the thread name, as it was specified in SDL_CreateThread().
227 * This function returns a pointer to a UTF-8 string that names the
228 * specified thread, or NULL if it doesn't have a name. This is internal
229 * memory, not to be free()'d by the caller, and remains valid until the
230 * specified thread is cleaned up by SDL_WaitThread().
231 */
232 extern DECLSPEC const char *SDLCALL SDL_GetThreadName(SDL_Thread *thread);
233
234 /**
235 * Get the thread identifier for the current thread.
236 */
237 extern DECLSPEC SDL_threadID SDLCALL SDL_ThreadID(void);
238
239 /**
240 * Get the thread identifier for the specified thread.
241 *
242 * Equivalent to SDL_ThreadID() if the specified thread is NULL.
243 */
244 extern DECLSPEC SDL_threadID SDLCALL SDL_GetThreadID(SDL_Thread * thread);
245
246 /**
247 * Set the priority for the current thread
248 */
249 extern DECLSPEC int SDLCALL SDL_SetThreadPriority(SDL_ThreadPriority priority);
250
251 /**
252 * Wait for a thread to finish. Threads that haven't been detached will
253 * remain (as a "zombie") until this function cleans them up. Not doing so
254 * is a resource leak.
255 *
256 * Once a thread has been cleaned up through this function, the SDL_Thread
257 * that references it becomes invalid and should not be referenced again.
258 * As such, only one thread may call SDL_WaitThread() on another.
259 *
260 * The return code for the thread function is placed in the area
261 * pointed to by \c status, if \c status is not NULL.
262 *
263 * You may not wait on a thread that has been used in a call to
264 * SDL_DetachThread(). Use either that function or this one, but not
265 * both, or behavior is undefined.
266 *
267 * It is safe to pass NULL to this function; it is a no-op.
268 */
269 extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread * thread, int *status);
270
271 /**
272 * A thread may be "detached" to signify that it should not remain until
273 * another thread has called SDL_WaitThread() on it. Detaching a thread
274 * is useful for long-running threads that nothing needs to synchronize
275 * with or further manage. When a detached thread is done, it simply
276 * goes away.
277 *
278 * There is no way to recover the return code of a detached thread. If you
279 * need this, don't detach the thread and instead use SDL_WaitThread().
280 *
281 * Once a thread is detached, you should usually assume the SDL_Thread isn't
282 * safe to reference again, as it will become invalid immediately upon
283 * the detached thread's exit, instead of remaining until someone has called
284 * SDL_WaitThread() to finally clean it up. As such, don't detach the same
285 * thread more than once.
286 *
287 * If a thread has already exited when passed to SDL_DetachThread(), it will
288 * stop waiting for a call to SDL_WaitThread() and clean up immediately.
289 * It is not safe to detach a thread that might be used with SDL_WaitThread().
290 *
291 * You may not call SDL_WaitThread() on a thread that has been detached.
292 * Use either that function or this one, but not both, or behavior is
293 * undefined.
294 *
295 * It is safe to pass NULL to this function; it is a no-op.
296 */
297 extern DECLSPEC void SDLCALL SDL_DetachThread(SDL_Thread * thread);
298
299 /**
300 * \brief Create an identifier that is globally visible to all threads but refers to data that is thread-specific.
301 *
302 * \return The newly created thread local storage identifier, or 0 on error
303 *
304 * \code
305 * static SDL_SpinLock tls_lock;
306 * static SDL_TLSID thread_local_storage;
307 *
308 * void SetMyThreadData(void *value)
309 * {
310 * if (!thread_local_storage) {
311 * SDL_AtomicLock(&tls_lock);
312 * if (!thread_local_storage) {
313 * thread_local_storage = SDL_TLSCreate();
314 * }
315 * SDL_AtomicUnlock(&tls_lock);
316 * }
317 * SDL_TLSSet(thread_local_storage, value, 0);
318 * }
319 *
320 * void *GetMyThreadData(void)
321 * {
322 * return SDL_TLSGet(thread_local_storage);
323 * }
324 * \endcode
325 *
326 * \sa SDL_TLSGet()
327 * \sa SDL_TLSSet()
328 */
329 extern DECLSPEC SDL_TLSID SDLCALL SDL_TLSCreate(void);
330
331 /**
332 * \brief Get the value associated with a thread local storage ID for the current thread.
333 *
334 * \param id The thread local storage ID
335 *
336 * \return The value associated with the ID for the current thread, or NULL if no value has been set.
337 *
338 * \sa SDL_TLSCreate()
339 * \sa SDL_TLSSet()
340 */
341 extern DECLSPEC void * SDLCALL SDL_TLSGet(SDL_TLSID id);
342
343 /**
344 * \brief Set the value associated with a thread local storage ID for the current thread.
345 *
346 * \param id The thread local storage ID
347 * \param value The value to associate with the ID for the current thread
348 * \param destructor A function called when the thread exits, to free the value.
349 *
350 * \return 0 on success, -1 on error
351 *
352 * \sa SDL_TLSCreate()
353 * \sa SDL_TLSGet()
354 */
355 extern DECLSPEC int SDLCALL SDL_TLSSet(SDL_TLSID id, const void *value, void (SDLCALL *destructor)(void*));
356
357
358 /* Ends C function definitions when using C++ */
359 #ifdef __cplusplus
360 }
361 #endif
362 #include "close_code.h"
363
364 #endif /* SDL_thread_h_ */
365
366 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_timer.h added (mode: 100644) (index 0000000..aada717)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 #ifndef SDL_timer_h_
23 #define SDL_timer_h_
24
25 /**
26 * \file SDL_timer.h
27 *
28 * Header for the SDL time management routines.
29 */
30
31 #include "SDL_stdinc.h"
32 #include "SDL_error.h"
33
34 #include "begin_code.h"
35 /* Set up for C function definitions, even when using C++ */
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39
40 /**
41 * \brief Get the number of milliseconds since the SDL library initialization.
42 *
43 * \note This value wraps if the program runs for more than ~49 days.
44 */
45 extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void);
46
47 /**
48 * \brief Compare SDL ticks values, and return true if A has passed B
49 *
50 * e.g. if you want to wait 100 ms, you could do this:
51 * Uint32 timeout = SDL_GetTicks() + 100;
52 * while (!SDL_TICKS_PASSED(SDL_GetTicks(), timeout)) {
53 * ... do work until timeout has elapsed
54 * }
55 */
56 #define SDL_TICKS_PASSED(A, B) ((Sint32)((B) - (A)) <= 0)
57
58 /**
59 * \brief Get the current value of the high resolution counter
60 */
61 extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceCounter(void);
62
63 /**
64 * \brief Get the count per second of the high resolution counter
65 */
66 extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceFrequency(void);
67
68 /**
69 * \brief Wait a specified number of milliseconds before returning.
70 */
71 extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms);
72
73 /**
74 * Function prototype for the timer callback function.
75 *
76 * The callback function is passed the current timer interval and returns
77 * the next timer interval. If the returned value is the same as the one
78 * passed in, the periodic alarm continues, otherwise a new alarm is
79 * scheduled. If the callback returns 0, the periodic alarm is cancelled.
80 */
81 typedef Uint32 (SDLCALL * SDL_TimerCallback) (Uint32 interval, void *param);
82
83 /**
84 * Definition of the timer ID type.
85 */
86 typedef int SDL_TimerID;
87
88 /**
89 * \brief Add a new timer to the pool of timers already running.
90 *
91 * \return A timer ID, or 0 when an error occurs.
92 */
93 extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval,
94 SDL_TimerCallback callback,
95 void *param);
96
97 /**
98 * \brief Remove a timer knowing its ID.
99 *
100 * \return A boolean value indicating success or failure.
101 *
102 * \warning It is not safe to remove a timer multiple times.
103 */
104 extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID id);
105
106
107 /* Ends C function definitions when using C++ */
108 #ifdef __cplusplus
109 }
110 #endif
111 #include "close_code.h"
112
113 #endif /* SDL_timer_h_ */
114
115 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_touch.h added (mode: 100644) (index 0000000..fa5a37c)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_touch.h
24 *
25 * Include file for SDL touch event handling.
26 */
27
28 #ifndef SDL_touch_h_
29 #define SDL_touch_h_
30
31 #include "SDL_stdinc.h"
32 #include "SDL_error.h"
33 #include "SDL_video.h"
34
35 #include "begin_code.h"
36 /* Set up for C function definitions, even when using C++ */
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40
41 typedef Sint64 SDL_TouchID;
42 typedef Sint64 SDL_FingerID;
43
44 typedef enum
45 {
46 SDL_TOUCH_DEVICE_INVALID = -1,
47 SDL_TOUCH_DEVICE_DIRECT, /* touch screen with window-relative coordinates */
48 SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE, /* trackpad with absolute device coordinates */
49 SDL_TOUCH_DEVICE_INDIRECT_RELATIVE /* trackpad with screen cursor-relative coordinates */
50 } SDL_TouchDeviceType;
51
52 typedef struct SDL_Finger
53 {
54 SDL_FingerID id;
55 float x;
56 float y;
57 float pressure;
58 } SDL_Finger;
59
60 /* Used as the device ID for mouse events simulated with touch input */
61 #define SDL_TOUCH_MOUSEID ((Uint32)-1)
62
63 /* Used as the SDL_TouchID for touch events simulated with mouse input */
64 #define SDL_MOUSE_TOUCHID ((Sint64)-1)
65
66
67 /* Function prototypes */
68
69 /**
70 * \brief Get the number of registered touch devices.
71 */
72 extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices(void);
73
74 /**
75 * \brief Get the touch ID with the given index, or 0 if the index is invalid.
76 */
77 extern DECLSPEC SDL_TouchID SDLCALL SDL_GetTouchDevice(int index);
78
79 /**
80 * \brief Get the type of the given touch device.
81 */
82 extern DECLSPEC SDL_TouchDeviceType SDLCALL SDL_GetTouchDeviceType(SDL_TouchID touchID);
83
84 /**
85 * \brief Get the number of active fingers for a given touch device.
86 */
87 extern DECLSPEC int SDLCALL SDL_GetNumTouchFingers(SDL_TouchID touchID);
88
89 /**
90 * \brief Get the finger object of the given touch, with the given index.
91 */
92 extern DECLSPEC SDL_Finger * SDLCALL SDL_GetTouchFinger(SDL_TouchID touchID, int index);
93
94 /* Ends C function definitions when using C++ */
95 #ifdef __cplusplus
96 }
97 #endif
98 #include "close_code.h"
99
100 #endif /* SDL_touch_h_ */
101
102 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_types.h added (mode: 100644) (index 0000000..b6bb571)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_types.h
24 *
25 * \deprecated
26 */
27
28 /* DEPRECATED */
29 #include "SDL_stdinc.h"
File include/SDL2/SDL_version.h added (mode: 100644) (index 0000000..23b65f4)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_version.h
24 *
25 * This header defines the current SDL version.
26 */
27
28 #ifndef SDL_version_h_
29 #define SDL_version_h_
30
31 #include "SDL_stdinc.h"
32
33 #include "begin_code.h"
34 /* Set up for C function definitions, even when using C++ */
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38
39 /**
40 * \brief Information the version of SDL in use.
41 *
42 * Represents the library's version as three levels: major revision
43 * (increments with massive changes, additions, and enhancements),
44 * minor revision (increments with backwards-compatible changes to the
45 * major revision), and patchlevel (increments with fixes to the minor
46 * revision).
47 *
48 * \sa SDL_VERSION
49 * \sa SDL_GetVersion
50 */
51 typedef struct SDL_version
52 {
53 Uint8 major; /**< major version */
54 Uint8 minor; /**< minor version */
55 Uint8 patch; /**< update version */
56 } SDL_version;
57
58 /* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
59 */
60 #define SDL_MAJOR_VERSION 2
61 #define SDL_MINOR_VERSION 0
62 #define SDL_PATCHLEVEL 14
63
64 /**
65 * \brief Macro to determine SDL version program was compiled against.
66 *
67 * This macro fills in a SDL_version structure with the version of the
68 * library you compiled against. This is determined by what header the
69 * compiler uses. Note that if you dynamically linked the library, you might
70 * have a slightly newer or older version at runtime. That version can be
71 * determined with SDL_GetVersion(), which, unlike SDL_VERSION(),
72 * is not a macro.
73 *
74 * \param x A pointer to a SDL_version struct to initialize.
75 *
76 * \sa SDL_version
77 * \sa SDL_GetVersion
78 */
79 #define SDL_VERSION(x) \
80 { \
81 (x)->major = SDL_MAJOR_VERSION; \
82 (x)->minor = SDL_MINOR_VERSION; \
83 (x)->patch = SDL_PATCHLEVEL; \
84 }
85
86 /**
87 * This macro turns the version numbers into a numeric value:
88 * \verbatim
89 (1,2,3) -> (1203)
90 \endverbatim
91 *
92 * This assumes that there will never be more than 100 patchlevels.
93 */
94 #define SDL_VERSIONNUM(X, Y, Z) \
95 ((X)*1000 + (Y)*100 + (Z))
96
97 /**
98 * This is the version number macro for the current SDL version.
99 */
100 #define SDL_COMPILEDVERSION \
101 SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL)
102
103 /**
104 * This macro will evaluate to true if compiled with SDL at least X.Y.Z.
105 */
106 #define SDL_VERSION_ATLEAST(X, Y, Z) \
107 (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z))
108
109 /**
110 * \brief Get the version of SDL that is linked against your program.
111 *
112 * If you are linking to SDL dynamically, then it is possible that the
113 * current version will be different than the version you compiled against.
114 * This function returns the current version, while SDL_VERSION() is a
115 * macro that tells you what version you compiled with.
116 *
117 * \code
118 * SDL_version compiled;
119 * SDL_version linked;
120 *
121 * SDL_VERSION(&compiled);
122 * SDL_GetVersion(&linked);
123 * printf("We compiled against SDL version %d.%d.%d ...\n",
124 * compiled.major, compiled.minor, compiled.patch);
125 * printf("But we linked against SDL version %d.%d.%d.\n",
126 * linked.major, linked.minor, linked.patch);
127 * \endcode
128 *
129 * This function may be called safely at any time, even before SDL_Init().
130 *
131 * \sa SDL_VERSION
132 */
133 extern DECLSPEC void SDLCALL SDL_GetVersion(SDL_version * ver);
134
135 /**
136 * \brief Get the code revision of SDL that is linked against your program.
137 *
138 * Returns an arbitrary string (a hash value) uniquely identifying the
139 * exact revision of the SDL library in use, and is only useful in comparing
140 * against other revisions. It is NOT an incrementing number.
141 */
142 extern DECLSPEC const char *SDLCALL SDL_GetRevision(void);
143
144 /**
145 * \brief Get the revision number of SDL that is linked against your program.
146 *
147 * Returns a number uniquely identifying the exact revision of the SDL
148 * library in use. It is an incrementing number based on commits to
149 * hg.libsdl.org.
150 */
151 extern DECLSPEC int SDLCALL SDL_GetRevisionNumber(void);
152
153
154 /* Ends C function definitions when using C++ */
155 #ifdef __cplusplus
156 }
157 #endif
158 #include "close_code.h"
159
160 #endif /* SDL_version_h_ */
161
162 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_video.h added (mode: 100644) (index 0000000..54cbe0f)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_video.h
24 *
25 * Header file for SDL video functions.
26 */
27
28 #ifndef SDL_video_h_
29 #define SDL_video_h_
30
31 #include "SDL_stdinc.h"
32 #include "SDL_pixels.h"
33 #include "SDL_rect.h"
34 #include "SDL_surface.h"
35
36 #include "begin_code.h"
37 /* Set up for C function definitions, even when using C++ */
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41
42 /**
43 * \brief The structure that defines a display mode
44 *
45 * \sa SDL_GetNumDisplayModes()
46 * \sa SDL_GetDisplayMode()
47 * \sa SDL_GetDesktopDisplayMode()
48 * \sa SDL_GetCurrentDisplayMode()
49 * \sa SDL_GetClosestDisplayMode()
50 * \sa SDL_SetWindowDisplayMode()
51 * \sa SDL_GetWindowDisplayMode()
52 */
53 typedef struct
54 {
55 Uint32 format; /**< pixel format */
56 int w; /**< width, in screen coordinates */
57 int h; /**< height, in screen coordinates */
58 int refresh_rate; /**< refresh rate (or zero for unspecified) */
59 void *driverdata; /**< driver-specific data, initialize to 0 */
60 } SDL_DisplayMode;
61
62 /**
63 * \brief The type used to identify a window
64 *
65 * \sa SDL_CreateWindow()
66 * \sa SDL_CreateWindowFrom()
67 * \sa SDL_DestroyWindow()
68 * \sa SDL_GetWindowData()
69 * \sa SDL_GetWindowFlags()
70 * \sa SDL_GetWindowGrab()
71 * \sa SDL_GetWindowPosition()
72 * \sa SDL_GetWindowSize()
73 * \sa SDL_GetWindowTitle()
74 * \sa SDL_HideWindow()
75 * \sa SDL_MaximizeWindow()
76 * \sa SDL_MinimizeWindow()
77 * \sa SDL_RaiseWindow()
78 * \sa SDL_RestoreWindow()
79 * \sa SDL_SetWindowData()
80 * \sa SDL_SetWindowFullscreen()
81 * \sa SDL_SetWindowGrab()
82 * \sa SDL_SetWindowIcon()
83 * \sa SDL_SetWindowPosition()
84 * \sa SDL_SetWindowSize()
85 * \sa SDL_SetWindowBordered()
86 * \sa SDL_SetWindowResizable()
87 * \sa SDL_SetWindowTitle()
88 * \sa SDL_ShowWindow()
89 */
90 typedef struct SDL_Window SDL_Window;
91
92 /**
93 * \brief The flags on a window
94 *
95 * \sa SDL_GetWindowFlags()
96 */
97 typedef enum
98 {
99 SDL_WINDOW_FULLSCREEN = 0x00000001, /**< fullscreen window */
100 SDL_WINDOW_OPENGL = 0x00000002, /**< window usable with OpenGL context */
101 SDL_WINDOW_SHOWN = 0x00000004, /**< window is visible */
102 SDL_WINDOW_HIDDEN = 0x00000008, /**< window is not visible */
103 SDL_WINDOW_BORDERLESS = 0x00000010, /**< no window decoration */
104 SDL_WINDOW_RESIZABLE = 0x00000020, /**< window can be resized */
105 SDL_WINDOW_MINIMIZED = 0x00000040, /**< window is minimized */
106 SDL_WINDOW_MAXIMIZED = 0x00000080, /**< window is maximized */
107 SDL_WINDOW_INPUT_GRABBED = 0x00000100, /**< window has grabbed input focus */
108 SDL_WINDOW_INPUT_FOCUS = 0x00000200, /**< window has input focus */
109 SDL_WINDOW_MOUSE_FOCUS = 0x00000400, /**< window has mouse focus */
110 SDL_WINDOW_FULLSCREEN_DESKTOP = ( SDL_WINDOW_FULLSCREEN | 0x00001000 ),
111 SDL_WINDOW_FOREIGN = 0x00000800, /**< window not created by SDL */
112 SDL_WINDOW_ALLOW_HIGHDPI = 0x00002000, /**< window should be created in high-DPI mode if supported.
113 On macOS NSHighResolutionCapable must be set true in the
114 application's Info.plist for this to have any effect. */
115 SDL_WINDOW_MOUSE_CAPTURE = 0x00004000, /**< window has mouse captured (unrelated to INPUT_GRABBED) */
116 SDL_WINDOW_ALWAYS_ON_TOP = 0x00008000, /**< window should always be above others */
117 SDL_WINDOW_SKIP_TASKBAR = 0x00010000, /**< window should not be added to the taskbar */
118 SDL_WINDOW_UTILITY = 0x00020000, /**< window should be treated as a utility window */
119 SDL_WINDOW_TOOLTIP = 0x00040000, /**< window should be treated as a tooltip */
120 SDL_WINDOW_POPUP_MENU = 0x00080000, /**< window should be treated as a popup menu */
121 SDL_WINDOW_VULKAN = 0x10000000, /**< window usable for Vulkan surface */
122 SDL_WINDOW_METAL = 0x20000000 /**< window usable for Metal view */
123 } SDL_WindowFlags;
124
125 /**
126 * \brief Used to indicate that you don't care what the window position is.
127 */
128 #define SDL_WINDOWPOS_UNDEFINED_MASK 0x1FFF0000u
129 #define SDL_WINDOWPOS_UNDEFINED_DISPLAY(X) (SDL_WINDOWPOS_UNDEFINED_MASK|(X))
130 #define SDL_WINDOWPOS_UNDEFINED SDL_WINDOWPOS_UNDEFINED_DISPLAY(0)
131 #define SDL_WINDOWPOS_ISUNDEFINED(X) \
132 (((X)&0xFFFF0000) == SDL_WINDOWPOS_UNDEFINED_MASK)
133
134 /**
135 * \brief Used to indicate that the window position should be centered.
136 */
137 #define SDL_WINDOWPOS_CENTERED_MASK 0x2FFF0000u
138 #define SDL_WINDOWPOS_CENTERED_DISPLAY(X) (SDL_WINDOWPOS_CENTERED_MASK|(X))
139 #define SDL_WINDOWPOS_CENTERED SDL_WINDOWPOS_CENTERED_DISPLAY(0)
140 #define SDL_WINDOWPOS_ISCENTERED(X) \
141 (((X)&0xFFFF0000) == SDL_WINDOWPOS_CENTERED_MASK)
142
143 /**
144 * \brief Event subtype for window events
145 */
146 typedef enum
147 {
148 SDL_WINDOWEVENT_NONE, /**< Never used */
149 SDL_WINDOWEVENT_SHOWN, /**< Window has been shown */
150 SDL_WINDOWEVENT_HIDDEN, /**< Window has been hidden */
151 SDL_WINDOWEVENT_EXPOSED, /**< Window has been exposed and should be
152 redrawn */
153 SDL_WINDOWEVENT_MOVED, /**< Window has been moved to data1, data2
154 */
155 SDL_WINDOWEVENT_RESIZED, /**< Window has been resized to data1xdata2 */
156 SDL_WINDOWEVENT_SIZE_CHANGED, /**< The window size has changed, either as
157 a result of an API call or through the
158 system or user changing the window size. */
159 SDL_WINDOWEVENT_MINIMIZED, /**< Window has been minimized */
160 SDL_WINDOWEVENT_MAXIMIZED, /**< Window has been maximized */
161 SDL_WINDOWEVENT_RESTORED, /**< Window has been restored to normal size
162 and position */
163 SDL_WINDOWEVENT_ENTER, /**< Window has gained mouse focus */
164 SDL_WINDOWEVENT_LEAVE, /**< Window has lost mouse focus */
165 SDL_WINDOWEVENT_FOCUS_GAINED, /**< Window has gained keyboard focus */
166 SDL_WINDOWEVENT_FOCUS_LOST, /**< Window has lost keyboard focus */
167 SDL_WINDOWEVENT_CLOSE, /**< The window manager requests that the window be closed */
168 SDL_WINDOWEVENT_TAKE_FOCUS, /**< Window is being offered a focus (should SetWindowInputFocus() on itself or a subwindow, or ignore) */
169 SDL_WINDOWEVENT_HIT_TEST /**< Window had a hit test that wasn't SDL_HITTEST_NORMAL. */
170 } SDL_WindowEventID;
171
172 /**
173 * \brief Event subtype for display events
174 */
175 typedef enum
176 {
177 SDL_DISPLAYEVENT_NONE, /**< Never used */
178 SDL_DISPLAYEVENT_ORIENTATION, /**< Display orientation has changed to data1 */
179 SDL_DISPLAYEVENT_CONNECTED, /**< Display has been added to the system */
180 SDL_DISPLAYEVENT_DISCONNECTED /**< Display has been removed from the system */
181 } SDL_DisplayEventID;
182
183 typedef enum
184 {
185 SDL_ORIENTATION_UNKNOWN, /**< The display orientation can't be determined */
186 SDL_ORIENTATION_LANDSCAPE, /**< The display is in landscape mode, with the right side up, relative to portrait mode */
187 SDL_ORIENTATION_LANDSCAPE_FLIPPED, /**< The display is in landscape mode, with the left side up, relative to portrait mode */
188 SDL_ORIENTATION_PORTRAIT, /**< The display is in portrait mode */
189 SDL_ORIENTATION_PORTRAIT_FLIPPED /**< The display is in portrait mode, upside down */
190 } SDL_DisplayOrientation;
191
192 /**
193 * \brief An opaque handle to an OpenGL context.
194 */
195 typedef void *SDL_GLContext;
196
197 /**
198 * \brief OpenGL configuration attributes
199 */
200 typedef enum
201 {
202 SDL_GL_RED_SIZE,
203 SDL_GL_GREEN_SIZE,
204 SDL_GL_BLUE_SIZE,
205 SDL_GL_ALPHA_SIZE,
206 SDL_GL_BUFFER_SIZE,
207 SDL_GL_DOUBLEBUFFER,
208 SDL_GL_DEPTH_SIZE,
209 SDL_GL_STENCIL_SIZE,
210 SDL_GL_ACCUM_RED_SIZE,
211 SDL_GL_ACCUM_GREEN_SIZE,
212 SDL_GL_ACCUM_BLUE_SIZE,
213 SDL_GL_ACCUM_ALPHA_SIZE,
214 SDL_GL_STEREO,
215 SDL_GL_MULTISAMPLEBUFFERS,
216 SDL_GL_MULTISAMPLESAMPLES,
217 SDL_GL_ACCELERATED_VISUAL,
218 SDL_GL_RETAINED_BACKING,
219 SDL_GL_CONTEXT_MAJOR_VERSION,
220 SDL_GL_CONTEXT_MINOR_VERSION,
221 SDL_GL_CONTEXT_EGL,
222 SDL_GL_CONTEXT_FLAGS,
223 SDL_GL_CONTEXT_PROFILE_MASK,
224 SDL_GL_SHARE_WITH_CURRENT_CONTEXT,
225 SDL_GL_FRAMEBUFFER_SRGB_CAPABLE,
226 SDL_GL_CONTEXT_RELEASE_BEHAVIOR,
227 SDL_GL_CONTEXT_RESET_NOTIFICATION,
228 SDL_GL_CONTEXT_NO_ERROR
229 } SDL_GLattr;
230
231 typedef enum
232 {
233 SDL_GL_CONTEXT_PROFILE_CORE = 0x0001,
234 SDL_GL_CONTEXT_PROFILE_COMPATIBILITY = 0x0002,
235 SDL_GL_CONTEXT_PROFILE_ES = 0x0004 /**< GLX_CONTEXT_ES2_PROFILE_BIT_EXT */
236 } SDL_GLprofile;
237
238 typedef enum
239 {
240 SDL_GL_CONTEXT_DEBUG_FLAG = 0x0001,
241 SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG = 0x0002,
242 SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG = 0x0004,
243 SDL_GL_CONTEXT_RESET_ISOLATION_FLAG = 0x0008
244 } SDL_GLcontextFlag;
245
246 typedef enum
247 {
248 SDL_GL_CONTEXT_RELEASE_BEHAVIOR_NONE = 0x0000,
249 SDL_GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH = 0x0001
250 } SDL_GLcontextReleaseFlag;
251
252 typedef enum
253 {
254 SDL_GL_CONTEXT_RESET_NO_NOTIFICATION = 0x0000,
255 SDL_GL_CONTEXT_RESET_LOSE_CONTEXT = 0x0001
256 } SDL_GLContextResetNotification;
257
258 /* Function prototypes */
259
260 /**
261 * \brief Get the number of video drivers compiled into SDL
262 *
263 * \sa SDL_GetVideoDriver()
264 */
265 extern DECLSPEC int SDLCALL SDL_GetNumVideoDrivers(void);
266
267 /**
268 * \brief Get the name of a built in video driver.
269 *
270 * \note The video drivers are presented in the order in which they are
271 * normally checked during initialization.
272 *
273 * \sa SDL_GetNumVideoDrivers()
274 */
275 extern DECLSPEC const char *SDLCALL SDL_GetVideoDriver(int index);
276
277 /**
278 * \brief Initialize the video subsystem, optionally specifying a video driver.
279 *
280 * \param driver_name Initialize a specific driver by name, or NULL for the
281 * default video driver.
282 *
283 * \return 0 on success, -1 on error
284 *
285 * This function initializes the video subsystem; setting up a connection
286 * to the window manager, etc, and determines the available display modes
287 * and pixel formats, but does not initialize a window or graphics mode.
288 *
289 * \sa SDL_VideoQuit()
290 */
291 extern DECLSPEC int SDLCALL SDL_VideoInit(const char *driver_name);
292
293 /**
294 * \brief Shuts down the video subsystem.
295 *
296 * This function closes all windows, and restores the original video mode.
297 *
298 * \sa SDL_VideoInit()
299 */
300 extern DECLSPEC void SDLCALL SDL_VideoQuit(void);
301
302 /**
303 * \brief Returns the name of the currently initialized video driver.
304 *
305 * \return The name of the current video driver or NULL if no driver
306 * has been initialized
307 *
308 * \sa SDL_GetNumVideoDrivers()
309 * \sa SDL_GetVideoDriver()
310 */
311 extern DECLSPEC const char *SDLCALL SDL_GetCurrentVideoDriver(void);
312
313 /**
314 * \brief Returns the number of available video displays.
315 *
316 * \sa SDL_GetDisplayBounds()
317 */
318 extern DECLSPEC int SDLCALL SDL_GetNumVideoDisplays(void);
319
320 /**
321 * \brief Get the name of a display in UTF-8 encoding
322 *
323 * \return The name of a display, or NULL for an invalid display index.
324 *
325 * \sa SDL_GetNumVideoDisplays()
326 */
327 extern DECLSPEC const char * SDLCALL SDL_GetDisplayName(int displayIndex);
328
329 /**
330 * \brief Get the desktop area represented by a display, with the primary
331 * display located at 0,0
332 *
333 * \return 0 on success, or -1 if the index is out of range.
334 *
335 * \sa SDL_GetNumVideoDisplays()
336 */
337 extern DECLSPEC int SDLCALL SDL_GetDisplayBounds(int displayIndex, SDL_Rect * rect);
338
339 /**
340 * \brief Get the usable desktop area represented by a display, with the
341 * primary display located at 0,0
342 *
343 * This is the same area as SDL_GetDisplayBounds() reports, but with portions
344 * reserved by the system removed. For example, on Mac OS X, this subtracts
345 * the area occupied by the menu bar and dock.
346 *
347 * Setting a window to be fullscreen generally bypasses these unusable areas,
348 * so these are good guidelines for the maximum space available to a
349 * non-fullscreen window.
350 *
351 * \return 0 on success, or -1 if the index is out of range.
352 *
353 * \sa SDL_GetDisplayBounds()
354 * \sa SDL_GetNumVideoDisplays()
355 */
356 extern DECLSPEC int SDLCALL SDL_GetDisplayUsableBounds(int displayIndex, SDL_Rect * rect);
357
358 /**
359 * \brief Get the dots/pixels-per-inch for a display
360 *
361 * \note Diagonal, horizontal and vertical DPI can all be optionally
362 * returned if the parameter is non-NULL.
363 *
364 * \return 0 on success, or -1 if no DPI information is available or the index is out of range.
365 *
366 * \sa SDL_GetNumVideoDisplays()
367 */
368 extern DECLSPEC int SDLCALL SDL_GetDisplayDPI(int displayIndex, float * ddpi, float * hdpi, float * vdpi);
369
370 /**
371 * \brief Get the orientation of a display
372 *
373 * \return The orientation of the display, or SDL_ORIENTATION_UNKNOWN if it isn't available.
374 *
375 * \sa SDL_GetNumVideoDisplays()
376 */
377 extern DECLSPEC SDL_DisplayOrientation SDLCALL SDL_GetDisplayOrientation(int displayIndex);
378
379 /**
380 * \brief Returns the number of available display modes.
381 *
382 * \sa SDL_GetDisplayMode()
383 */
384 extern DECLSPEC int SDLCALL SDL_GetNumDisplayModes(int displayIndex);
385
386 /**
387 * \brief Fill in information about a specific display mode.
388 *
389 * \note The display modes are sorted in this priority:
390 * \li bits per pixel -> more colors to fewer colors
391 * \li width -> largest to smallest
392 * \li height -> largest to smallest
393 * \li refresh rate -> highest to lowest
394 *
395 * \sa SDL_GetNumDisplayModes()
396 */
397 extern DECLSPEC int SDLCALL SDL_GetDisplayMode(int displayIndex, int modeIndex,
398 SDL_DisplayMode * mode);
399
400 /**
401 * \brief Fill in information about the desktop display mode.
402 */
403 extern DECLSPEC int SDLCALL SDL_GetDesktopDisplayMode(int displayIndex, SDL_DisplayMode * mode);
404
405 /**
406 * \brief Fill in information about the current display mode.
407 */
408 extern DECLSPEC int SDLCALL SDL_GetCurrentDisplayMode(int displayIndex, SDL_DisplayMode * mode);
409
410
411 /**
412 * \brief Get the closest match to the requested display mode.
413 *
414 * \param displayIndex The index of display from which mode should be queried.
415 * \param mode The desired display mode
416 * \param closest A pointer to a display mode to be filled in with the closest
417 * match of the available display modes.
418 *
419 * \return The passed in value \c closest, or NULL if no matching video mode
420 * was available.
421 *
422 * The available display modes are scanned, and \c closest is filled in with the
423 * closest mode matching the requested mode and returned. The mode format and
424 * refresh_rate default to the desktop mode if they are 0. The modes are
425 * scanned with size being first priority, format being second priority, and
426 * finally checking the refresh_rate. If all the available modes are too
427 * small, then NULL is returned.
428 *
429 * \sa SDL_GetNumDisplayModes()
430 * \sa SDL_GetDisplayMode()
431 */
432 extern DECLSPEC SDL_DisplayMode * SDLCALL SDL_GetClosestDisplayMode(int displayIndex, const SDL_DisplayMode * mode, SDL_DisplayMode * closest);
433
434 /**
435 * \brief Get the display index associated with a window.
436 *
437 * \return the display index of the display containing the center of the
438 * window, or -1 on error.
439 */
440 extern DECLSPEC int SDLCALL SDL_GetWindowDisplayIndex(SDL_Window * window);
441
442 /**
443 * \brief Set the display mode used when a fullscreen window is visible.
444 *
445 * By default the window's dimensions and the desktop format and refresh rate
446 * are used.
447 *
448 * \param window The window for which the display mode should be set.
449 * \param mode The mode to use, or NULL for the default mode.
450 *
451 * \return 0 on success, or -1 if setting the display mode failed.
452 *
453 * \sa SDL_GetWindowDisplayMode()
454 * \sa SDL_SetWindowFullscreen()
455 */
456 extern DECLSPEC int SDLCALL SDL_SetWindowDisplayMode(SDL_Window * window,
457 const SDL_DisplayMode
458 * mode);
459
460 /**
461 * \brief Fill in information about the display mode used when a fullscreen
462 * window is visible.
463 *
464 * \sa SDL_SetWindowDisplayMode()
465 * \sa SDL_SetWindowFullscreen()
466 */
467 extern DECLSPEC int SDLCALL SDL_GetWindowDisplayMode(SDL_Window * window,
468 SDL_DisplayMode * mode);
469
470 /**
471 * \brief Get the pixel format associated with the window.
472 */
473 extern DECLSPEC Uint32 SDLCALL SDL_GetWindowPixelFormat(SDL_Window * window);
474
475 /**
476 * \brief Create a window with the specified position, dimensions, and flags.
477 *
478 * \param title The title of the window, in UTF-8 encoding.
479 * \param x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or
480 * ::SDL_WINDOWPOS_UNDEFINED.
481 * \param y The y position of the window, ::SDL_WINDOWPOS_CENTERED, or
482 * ::SDL_WINDOWPOS_UNDEFINED.
483 * \param w The width of the window, in screen coordinates.
484 * \param h The height of the window, in screen coordinates.
485 * \param flags The flags for the window, a mask of any of the following:
486 * ::SDL_WINDOW_FULLSCREEN, ::SDL_WINDOW_OPENGL,
487 * ::SDL_WINDOW_HIDDEN, ::SDL_WINDOW_BORDERLESS,
488 * ::SDL_WINDOW_RESIZABLE, ::SDL_WINDOW_MAXIMIZED,
489 * ::SDL_WINDOW_MINIMIZED, ::SDL_WINDOW_INPUT_GRABBED,
490 * ::SDL_WINDOW_ALLOW_HIGHDPI, ::SDL_WINDOW_VULKAN
491 * ::SDL_WINDOW_METAL.
492 *
493 * \return The created window, or NULL if window creation failed.
494 *
495 * If the window is created with the SDL_WINDOW_ALLOW_HIGHDPI flag, its size
496 * in pixels may differ from its size in screen coordinates on platforms with
497 * high-DPI support (e.g. iOS and Mac OS X). Use SDL_GetWindowSize() to query
498 * the client area's size in screen coordinates, and SDL_GL_GetDrawableSize(),
499 * SDL_Vulkan_GetDrawableSize(), or SDL_GetRendererOutputSize() to query the
500 * drawable size in pixels.
501 *
502 * If the window is created with any of the SDL_WINDOW_OPENGL or
503 * SDL_WINDOW_VULKAN flags, then the corresponding LoadLibrary function
504 * (SDL_GL_LoadLibrary or SDL_Vulkan_LoadLibrary) is called and the
505 * corresponding UnloadLibrary function is called by SDL_DestroyWindow().
506 *
507 * If SDL_WINDOW_VULKAN is specified and there isn't a working Vulkan driver,
508 * SDL_CreateWindow() will fail because SDL_Vulkan_LoadLibrary() will fail.
509 *
510 * If SDL_WINDOW_METAL is specified on an OS that does not support Metal,
511 * SDL_CreateWindow() will fail.
512 *
513 * \note On non-Apple devices, SDL requires you to either not link to the
514 * Vulkan loader or link to a dynamic library version. This limitation
515 * may be removed in a future version of SDL.
516 *
517 * \sa SDL_DestroyWindow()
518 * \sa SDL_GL_LoadLibrary()
519 * \sa SDL_Vulkan_LoadLibrary()
520 */
521 extern DECLSPEC SDL_Window * SDLCALL SDL_CreateWindow(const char *title,
522 int x, int y, int w,
523 int h, Uint32 flags);
524
525 /**
526 * \brief Create an SDL window from an existing native window.
527 *
528 * \param data A pointer to driver-dependent window creation data
529 *
530 * \return The created window, or NULL if window creation failed.
531 *
532 * \sa SDL_DestroyWindow()
533 */
534 extern DECLSPEC SDL_Window * SDLCALL SDL_CreateWindowFrom(const void *data);
535
536 /**
537 * \brief Get the numeric ID of a window, for logging purposes.
538 */
539 extern DECLSPEC Uint32 SDLCALL SDL_GetWindowID(SDL_Window * window);
540
541 /**
542 * \brief Get a window from a stored ID, or NULL if it doesn't exist.
543 */
544 extern DECLSPEC SDL_Window * SDLCALL SDL_GetWindowFromID(Uint32 id);
545
546 /**
547 * \brief Get the window flags.
548 */
549 extern DECLSPEC Uint32 SDLCALL SDL_GetWindowFlags(SDL_Window * window);
550
551 /**
552 * \brief Set the title of a window, in UTF-8 format.
553 *
554 * \sa SDL_GetWindowTitle()
555 */
556 extern DECLSPEC void SDLCALL SDL_SetWindowTitle(SDL_Window * window,
557 const char *title);
558
559 /**
560 * \brief Get the title of a window, in UTF-8 format.
561 *
562 * \sa SDL_SetWindowTitle()
563 */
564 extern DECLSPEC const char *SDLCALL SDL_GetWindowTitle(SDL_Window * window);
565
566 /**
567 * \brief Set the icon for a window.
568 *
569 * \param window The window for which the icon should be set.
570 * \param icon The icon for the window.
571 */
572 extern DECLSPEC void SDLCALL SDL_SetWindowIcon(SDL_Window * window,
573 SDL_Surface * icon);
574
575 /**
576 * \brief Associate an arbitrary named pointer with a window.
577 *
578 * \param window The window to associate with the pointer.
579 * \param name The name of the pointer.
580 * \param userdata The associated pointer.
581 *
582 * \return The previous value associated with 'name'
583 *
584 * \note The name is case-sensitive.
585 *
586 * \sa SDL_GetWindowData()
587 */
588 extern DECLSPEC void* SDLCALL SDL_SetWindowData(SDL_Window * window,
589 const char *name,
590 void *userdata);
591
592 /**
593 * \brief Retrieve the data pointer associated with a window.
594 *
595 * \param window The window to query.
596 * \param name The name of the pointer.
597 *
598 * \return The value associated with 'name'
599 *
600 * \sa SDL_SetWindowData()
601 */
602 extern DECLSPEC void *SDLCALL SDL_GetWindowData(SDL_Window * window,
603 const char *name);
604
605 /**
606 * \brief Set the position of a window.
607 *
608 * \param window The window to reposition.
609 * \param x The x coordinate of the window in screen coordinates, or
610 * ::SDL_WINDOWPOS_CENTERED or ::SDL_WINDOWPOS_UNDEFINED.
611 * \param y The y coordinate of the window in screen coordinates, or
612 * ::SDL_WINDOWPOS_CENTERED or ::SDL_WINDOWPOS_UNDEFINED.
613 *
614 * \note The window coordinate origin is the upper left of the display.
615 *
616 * \sa SDL_GetWindowPosition()
617 */
618 extern DECLSPEC void SDLCALL SDL_SetWindowPosition(SDL_Window * window,
619 int x, int y);
620
621 /**
622 * \brief Get the position of a window.
623 *
624 * \param window The window to query.
625 * \param x Pointer to variable for storing the x position, in screen
626 * coordinates. May be NULL.
627 * \param y Pointer to variable for storing the y position, in screen
628 * coordinates. May be NULL.
629 *
630 * \sa SDL_SetWindowPosition()
631 */
632 extern DECLSPEC void SDLCALL SDL_GetWindowPosition(SDL_Window * window,
633 int *x, int *y);
634
635 /**
636 * \brief Set the size of a window's client area.
637 *
638 * \param window The window to resize.
639 * \param w The width of the window, in screen coordinates. Must be >0.
640 * \param h The height of the window, in screen coordinates. Must be >0.
641 *
642 * \note Fullscreen windows automatically match the size of the display mode,
643 * and you should use SDL_SetWindowDisplayMode() to change their size.
644 *
645 * The window size in screen coordinates may differ from the size in pixels, if
646 * the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a platform with
647 * high-dpi support (e.g. iOS or OS X). Use SDL_GL_GetDrawableSize() or
648 * SDL_GetRendererOutputSize() to get the real client area size in pixels.
649 *
650 * \sa SDL_GetWindowSize()
651 * \sa SDL_SetWindowDisplayMode()
652 */
653 extern DECLSPEC void SDLCALL SDL_SetWindowSize(SDL_Window * window, int w,
654 int h);
655
656 /**
657 * \brief Get the size of a window's client area.
658 *
659 * \param window The window to query.
660 * \param w Pointer to variable for storing the width, in screen
661 * coordinates. May be NULL.
662 * \param h Pointer to variable for storing the height, in screen
663 * coordinates. May be NULL.
664 *
665 * The window size in screen coordinates may differ from the size in pixels, if
666 * the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a platform with
667 * high-dpi support (e.g. iOS or OS X). Use SDL_GL_GetDrawableSize() or
668 * SDL_GetRendererOutputSize() to get the real client area size in pixels.
669 *
670 * \sa SDL_SetWindowSize()
671 */
672 extern DECLSPEC void SDLCALL SDL_GetWindowSize(SDL_Window * window, int *w,
673 int *h);
674
675 /**
676 * \brief Get the size of a window's borders (decorations) around the client area.
677 *
678 * \param window The window to query.
679 * \param top Pointer to variable for storing the size of the top border. NULL is permitted.
680 * \param left Pointer to variable for storing the size of the left border. NULL is permitted.
681 * \param bottom Pointer to variable for storing the size of the bottom border. NULL is permitted.
682 * \param right Pointer to variable for storing the size of the right border. NULL is permitted.
683 *
684 * \return 0 on success, or -1 if getting this information is not supported.
685 *
686 * \note if this function fails (returns -1), the size values will be
687 * initialized to 0, 0, 0, 0 (if a non-NULL pointer is provided), as
688 * if the window in question was borderless.
689 */
690 extern DECLSPEC int SDLCALL SDL_GetWindowBordersSize(SDL_Window * window,
691 int *top, int *left,
692 int *bottom, int *right);
693
694 /**
695 * \brief Set the minimum size of a window's client area.
696 *
697 * \param window The window to set a new minimum size.
698 * \param min_w The minimum width of the window, must be >0
699 * \param min_h The minimum height of the window, must be >0
700 *
701 * \note You can't change the minimum size of a fullscreen window, it
702 * automatically matches the size of the display mode.
703 *
704 * \sa SDL_GetWindowMinimumSize()
705 * \sa SDL_SetWindowMaximumSize()
706 */
707 extern DECLSPEC void SDLCALL SDL_SetWindowMinimumSize(SDL_Window * window,
708 int min_w, int min_h);
709
710 /**
711 * \brief Get the minimum size of a window's client area.
712 *
713 * \param window The window to query.
714 * \param w Pointer to variable for storing the minimum width, may be NULL
715 * \param h Pointer to variable for storing the minimum height, may be NULL
716 *
717 * \sa SDL_GetWindowMaximumSize()
718 * \sa SDL_SetWindowMinimumSize()
719 */
720 extern DECLSPEC void SDLCALL SDL_GetWindowMinimumSize(SDL_Window * window,
721 int *w, int *h);
722
723 /**
724 * \brief Set the maximum size of a window's client area.
725 *
726 * \param window The window to set a new maximum size.
727 * \param max_w The maximum width of the window, must be >0
728 * \param max_h The maximum height of the window, must be >0
729 *
730 * \note You can't change the maximum size of a fullscreen window, it
731 * automatically matches the size of the display mode.
732 *
733 * \sa SDL_GetWindowMaximumSize()
734 * \sa SDL_SetWindowMinimumSize()
735 */
736 extern DECLSPEC void SDLCALL SDL_SetWindowMaximumSize(SDL_Window * window,
737 int max_w, int max_h);
738
739 /**
740 * \brief Get the maximum size of a window's client area.
741 *
742 * \param window The window to query.
743 * \param w Pointer to variable for storing the maximum width, may be NULL
744 * \param h Pointer to variable for storing the maximum height, may be NULL
745 *
746 * \sa SDL_GetWindowMinimumSize()
747 * \sa SDL_SetWindowMaximumSize()
748 */
749 extern DECLSPEC void SDLCALL SDL_GetWindowMaximumSize(SDL_Window * window,
750 int *w, int *h);
751
752 /**
753 * \brief Set the border state of a window.
754 *
755 * This will add or remove the window's SDL_WINDOW_BORDERLESS flag and
756 * add or remove the border from the actual window. This is a no-op if the
757 * window's border already matches the requested state.
758 *
759 * \param window The window of which to change the border state.
760 * \param bordered SDL_FALSE to remove border, SDL_TRUE to add border.
761 *
762 * \note You can't change the border state of a fullscreen window.
763 *
764 * \sa SDL_GetWindowFlags()
765 */
766 extern DECLSPEC void SDLCALL SDL_SetWindowBordered(SDL_Window * window,
767 SDL_bool bordered);
768
769 /**
770 * \brief Set the user-resizable state of a window.
771 *
772 * This will add or remove the window's SDL_WINDOW_RESIZABLE flag and
773 * allow/disallow user resizing of the window. This is a no-op if the
774 * window's resizable state already matches the requested state.
775 *
776 * \param window The window of which to change the resizable state.
777 * \param resizable SDL_TRUE to allow resizing, SDL_FALSE to disallow.
778 *
779 * \note You can't change the resizable state of a fullscreen window.
780 *
781 * \sa SDL_GetWindowFlags()
782 */
783 extern DECLSPEC void SDLCALL SDL_SetWindowResizable(SDL_Window * window,
784 SDL_bool resizable);
785
786 /**
787 * \brief Show a window.
788 *
789 * \sa SDL_HideWindow()
790 */
791 extern DECLSPEC void SDLCALL SDL_ShowWindow(SDL_Window * window);
792
793 /**
794 * \brief Hide a window.
795 *
796 * \sa SDL_ShowWindow()
797 */
798 extern DECLSPEC void SDLCALL SDL_HideWindow(SDL_Window * window);
799
800 /**
801 * \brief Raise a window above other windows and set the input focus.
802 */
803 extern DECLSPEC void SDLCALL SDL_RaiseWindow(SDL_Window * window);
804
805 /**
806 * \brief Make a window as large as possible.
807 *
808 * \sa SDL_RestoreWindow()
809 */
810 extern DECLSPEC void SDLCALL SDL_MaximizeWindow(SDL_Window * window);
811
812 /**
813 * \brief Minimize a window to an iconic representation.
814 *
815 * \sa SDL_RestoreWindow()
816 */
817 extern DECLSPEC void SDLCALL SDL_MinimizeWindow(SDL_Window * window);
818
819 /**
820 * \brief Restore the size and position of a minimized or maximized window.
821 *
822 * \sa SDL_MaximizeWindow()
823 * \sa SDL_MinimizeWindow()
824 */
825 extern DECLSPEC void SDLCALL SDL_RestoreWindow(SDL_Window * window);
826
827 /**
828 * \brief Set a window's fullscreen state.
829 *
830 * \return 0 on success, or -1 if setting the display mode failed.
831 *
832 * \sa SDL_SetWindowDisplayMode()
833 * \sa SDL_GetWindowDisplayMode()
834 */
835 extern DECLSPEC int SDLCALL SDL_SetWindowFullscreen(SDL_Window * window,
836 Uint32 flags);
837
838 /**
839 * \brief Get the SDL surface associated with the window.
840 *
841 * \return The window's framebuffer surface, or NULL on error.
842 *
843 * A new surface will be created with the optimal format for the window,
844 * if necessary. This surface will be freed when the window is destroyed.
845 *
846 * \note You may not combine this with 3D or the rendering API on this window.
847 *
848 * \sa SDL_UpdateWindowSurface()
849 * \sa SDL_UpdateWindowSurfaceRects()
850 */
851 extern DECLSPEC SDL_Surface * SDLCALL SDL_GetWindowSurface(SDL_Window * window);
852
853 /**
854 * \brief Copy the window surface to the screen.
855 *
856 * \return 0 on success, or -1 on error.
857 *
858 * \sa SDL_GetWindowSurface()
859 * \sa SDL_UpdateWindowSurfaceRects()
860 */
861 extern DECLSPEC int SDLCALL SDL_UpdateWindowSurface(SDL_Window * window);
862
863 /**
864 * \brief Copy a number of rectangles on the window surface to the screen.
865 *
866 * \return 0 on success, or -1 on error.
867 *
868 * \sa SDL_GetWindowSurface()
869 * \sa SDL_UpdateWindowSurface()
870 */
871 extern DECLSPEC int SDLCALL SDL_UpdateWindowSurfaceRects(SDL_Window * window,
872 const SDL_Rect * rects,
873 int numrects);
874
875 /**
876 * \brief Set a window's input grab mode.
877 *
878 * \param window The window for which the input grab mode should be set.
879 * \param grabbed This is SDL_TRUE to grab input, and SDL_FALSE to release input.
880 *
881 * If the caller enables a grab while another window is currently grabbed,
882 * the other window loses its grab in favor of the caller's window.
883 *
884 * \sa SDL_GetWindowGrab()
885 */
886 extern DECLSPEC void SDLCALL SDL_SetWindowGrab(SDL_Window * window,
887 SDL_bool grabbed);
888
889 /**
890 * \brief Get a window's input grab mode.
891 *
892 * \return This returns SDL_TRUE if input is grabbed, and SDL_FALSE otherwise.
893 *
894 * \sa SDL_SetWindowGrab()
895 */
896 extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowGrab(SDL_Window * window);
897
898 /**
899 * \brief Get the window that currently has an input grab enabled.
900 *
901 * \return This returns the window if input is grabbed, and NULL otherwise.
902 *
903 * \sa SDL_SetWindowGrab()
904 */
905 extern DECLSPEC SDL_Window * SDLCALL SDL_GetGrabbedWindow(void);
906
907 /**
908 * \brief Set the brightness (gamma correction) for a window.
909 *
910 * \return 0 on success, or -1 if setting the brightness isn't supported.
911 *
912 * \sa SDL_GetWindowBrightness()
913 * \sa SDL_SetWindowGammaRamp()
914 */
915 extern DECLSPEC int SDLCALL SDL_SetWindowBrightness(SDL_Window * window, float brightness);
916
917 /**
918 * \brief Get the brightness (gamma correction) for a window.
919 *
920 * \return The last brightness value passed to SDL_SetWindowBrightness()
921 *
922 * \sa SDL_SetWindowBrightness()
923 */
924 extern DECLSPEC float SDLCALL SDL_GetWindowBrightness(SDL_Window * window);
925
926 /**
927 * \brief Set the opacity for a window
928 *
929 * \param window The window which will be made transparent or opaque
930 * \param opacity Opacity (0.0f - transparent, 1.0f - opaque) This will be
931 * clamped internally between 0.0f and 1.0f.
932 *
933 * \return 0 on success, or -1 if setting the opacity isn't supported.
934 *
935 * \sa SDL_GetWindowOpacity()
936 */
937 extern DECLSPEC int SDLCALL SDL_SetWindowOpacity(SDL_Window * window, float opacity);
938
939 /**
940 * \brief Get the opacity of a window.
941 *
942 * If transparency isn't supported on this platform, opacity will be reported
943 * as 1.0f without error.
944 *
945 * \param window The window in question.
946 * \param out_opacity Opacity (0.0f - transparent, 1.0f - opaque)
947 *
948 * \return 0 on success, or -1 on error (invalid window, etc).
949 *
950 * \sa SDL_SetWindowOpacity()
951 */
952 extern DECLSPEC int SDLCALL SDL_GetWindowOpacity(SDL_Window * window, float * out_opacity);
953
954 /**
955 * \brief Sets the window as a modal for another window (TODO: reconsider this function and/or its name)
956 *
957 * \param modal_window The window that should be modal
958 * \param parent_window The parent window
959 *
960 * \return 0 on success, or -1 otherwise.
961 */
962 extern DECLSPEC int SDLCALL SDL_SetWindowModalFor(SDL_Window * modal_window, SDL_Window * parent_window);
963
964 /**
965 * \brief Explicitly sets input focus to the window.
966 *
967 * You almost certainly want SDL_RaiseWindow() instead of this function. Use
968 * this with caution, as you might give focus to a window that's completely
969 * obscured by other windows.
970 *
971 * \param window The window that should get the input focus
972 *
973 * \return 0 on success, or -1 otherwise.
974 * \sa SDL_RaiseWindow()
975 */
976 extern DECLSPEC int SDLCALL SDL_SetWindowInputFocus(SDL_Window * window);
977
978 /**
979 * \brief Set the gamma ramp for a window.
980 *
981 * \param window The window for which the gamma ramp should be set.
982 * \param red The translation table for the red channel, or NULL.
983 * \param green The translation table for the green channel, or NULL.
984 * \param blue The translation table for the blue channel, or NULL.
985 *
986 * \return 0 on success, or -1 if gamma ramps are unsupported.
987 *
988 * Set the gamma translation table for the red, green, and blue channels
989 * of the video hardware. Each table is an array of 256 16-bit quantities,
990 * representing a mapping between the input and output for that channel.
991 * The input is the index into the array, and the output is the 16-bit
992 * gamma value at that index, scaled to the output color precision.
993 *
994 * \sa SDL_GetWindowGammaRamp()
995 */
996 extern DECLSPEC int SDLCALL SDL_SetWindowGammaRamp(SDL_Window * window,
997 const Uint16 * red,
998 const Uint16 * green,
999 const Uint16 * blue);
1000
1001 /**
1002 * \brief Get the gamma ramp for a window.
1003 *
1004 * \param window The window from which the gamma ramp should be queried.
1005 * \param red A pointer to a 256 element array of 16-bit quantities to hold
1006 * the translation table for the red channel, or NULL.
1007 * \param green A pointer to a 256 element array of 16-bit quantities to hold
1008 * the translation table for the green channel, or NULL.
1009 * \param blue A pointer to a 256 element array of 16-bit quantities to hold
1010 * the translation table for the blue channel, or NULL.
1011 *
1012 * \return 0 on success, or -1 if gamma ramps are unsupported.
1013 *
1014 * \sa SDL_SetWindowGammaRamp()
1015 */
1016 extern DECLSPEC int SDLCALL SDL_GetWindowGammaRamp(SDL_Window * window,
1017 Uint16 * red,
1018 Uint16 * green,
1019 Uint16 * blue);
1020
1021 /**
1022 * \brief Possible return values from the SDL_HitTest callback.
1023 *
1024 * \sa SDL_HitTest
1025 */
1026 typedef enum
1027 {
1028 SDL_HITTEST_NORMAL, /**< Region is normal. No special properties. */
1029 SDL_HITTEST_DRAGGABLE, /**< Region can drag entire window. */
1030 SDL_HITTEST_RESIZE_TOPLEFT,
1031 SDL_HITTEST_RESIZE_TOP,
1032 SDL_HITTEST_RESIZE_TOPRIGHT,
1033 SDL_HITTEST_RESIZE_RIGHT,
1034 SDL_HITTEST_RESIZE_BOTTOMRIGHT,
1035 SDL_HITTEST_RESIZE_BOTTOM,
1036 SDL_HITTEST_RESIZE_BOTTOMLEFT,
1037 SDL_HITTEST_RESIZE_LEFT
1038 } SDL_HitTestResult;
1039
1040 /**
1041 * \brief Callback used for hit-testing.
1042 *
1043 * \sa SDL_SetWindowHitTest
1044 */
1045 typedef SDL_HitTestResult (SDLCALL *SDL_HitTest)(SDL_Window *win,
1046 const SDL_Point *area,
1047 void *data);
1048
1049 /**
1050 * \brief Provide a callback that decides if a window region has special properties.
1051 *
1052 * Normally windows are dragged and resized by decorations provided by the
1053 * system window manager (a title bar, borders, etc), but for some apps, it
1054 * makes sense to drag them from somewhere else inside the window itself; for
1055 * example, one might have a borderless window that wants to be draggable
1056 * from any part, or simulate its own title bar, etc.
1057 *
1058 * This function lets the app provide a callback that designates pieces of
1059 * a given window as special. This callback is run during event processing
1060 * if we need to tell the OS to treat a region of the window specially; the
1061 * use of this callback is known as "hit testing."
1062 *
1063 * Mouse input may not be delivered to your application if it is within
1064 * a special area; the OS will often apply that input to moving the window or
1065 * resizing the window and not deliver it to the application.
1066 *
1067 * Specifying NULL for a callback disables hit-testing. Hit-testing is
1068 * disabled by default.
1069 *
1070 * Platforms that don't support this functionality will return -1
1071 * unconditionally, even if you're attempting to disable hit-testing.
1072 *
1073 * Your callback may fire at any time, and its firing does not indicate any
1074 * specific behavior (for example, on Windows, this certainly might fire
1075 * when the OS is deciding whether to drag your window, but it fires for lots
1076 * of other reasons, too, some unrelated to anything you probably care about
1077 * _and when the mouse isn't actually at the location it is testing_).
1078 * Since this can fire at any time, you should try to keep your callback
1079 * efficient, devoid of allocations, etc.
1080 *
1081 * \param window The window to set hit-testing on.
1082 * \param callback The callback to call when doing a hit-test.
1083 * \param callback_data An app-defined void pointer passed to the callback.
1084 * \return 0 on success, -1 on error (including unsupported).
1085 */
1086 extern DECLSPEC int SDLCALL SDL_SetWindowHitTest(SDL_Window * window,
1087 SDL_HitTest callback,
1088 void *callback_data);
1089
1090 /**
1091 * \brief Destroy a window.
1092 */
1093 extern DECLSPEC void SDLCALL SDL_DestroyWindow(SDL_Window * window);
1094
1095
1096 /**
1097 * \brief Returns whether the screensaver is currently enabled (default off).
1098 *
1099 * \sa SDL_EnableScreenSaver()
1100 * \sa SDL_DisableScreenSaver()
1101 */
1102 extern DECLSPEC SDL_bool SDLCALL SDL_IsScreenSaverEnabled(void);
1103
1104 /**
1105 * \brief Allow the screen to be blanked by a screensaver
1106 *
1107 * \sa SDL_IsScreenSaverEnabled()
1108 * \sa SDL_DisableScreenSaver()
1109 */
1110 extern DECLSPEC void SDLCALL SDL_EnableScreenSaver(void);
1111
1112 /**
1113 * \brief Prevent the screen from being blanked by a screensaver
1114 *
1115 * \sa SDL_IsScreenSaverEnabled()
1116 * \sa SDL_EnableScreenSaver()
1117 */
1118 extern DECLSPEC void SDLCALL SDL_DisableScreenSaver(void);
1119
1120
1121 /**
1122 * \name OpenGL support functions
1123 */
1124 /* @{ */
1125
1126 /**
1127 * \brief Dynamically load an OpenGL library.
1128 *
1129 * \param path The platform dependent OpenGL library name, or NULL to open the
1130 * default OpenGL library.
1131 *
1132 * \return 0 on success, or -1 if the library couldn't be loaded.
1133 *
1134 * This should be done after initializing the video driver, but before
1135 * creating any OpenGL windows. If no OpenGL library is loaded, the default
1136 * library will be loaded upon creation of the first OpenGL window.
1137 *
1138 * \note If you do this, you need to retrieve all of the GL functions used in
1139 * your program from the dynamic library using SDL_GL_GetProcAddress().
1140 *
1141 * \sa SDL_GL_GetProcAddress()
1142 * \sa SDL_GL_UnloadLibrary()
1143 */
1144 extern DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path);
1145
1146 /**
1147 * \brief Get the address of an OpenGL function.
1148 */
1149 extern DECLSPEC void *SDLCALL SDL_GL_GetProcAddress(const char *proc);
1150
1151 /**
1152 * \brief Unload the OpenGL library previously loaded by SDL_GL_LoadLibrary().
1153 *
1154 * \sa SDL_GL_LoadLibrary()
1155 */
1156 extern DECLSPEC void SDLCALL SDL_GL_UnloadLibrary(void);
1157
1158 /**
1159 * \brief Return true if an OpenGL extension is supported for the current
1160 * context.
1161 */
1162 extern DECLSPEC SDL_bool SDLCALL SDL_GL_ExtensionSupported(const char
1163 *extension);
1164
1165 /**
1166 * \brief Reset all previously set OpenGL context attributes to their default values
1167 */
1168 extern DECLSPEC void SDLCALL SDL_GL_ResetAttributes(void);
1169
1170 /**
1171 * \brief Set an OpenGL window attribute before window creation.
1172 *
1173 * \return 0 on success, or -1 if the attribute could not be set.
1174 */
1175 extern DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value);
1176
1177 /**
1178 * \brief Get the actual value for an attribute from the current context.
1179 *
1180 * \return 0 on success, or -1 if the attribute could not be retrieved.
1181 * The integer at \c value will be modified in either case.
1182 */
1183 extern DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int *value);
1184
1185 /**
1186 * \brief Create an OpenGL context for use with an OpenGL window, and make it
1187 * current.
1188 *
1189 * \sa SDL_GL_DeleteContext()
1190 */
1191 extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_CreateContext(SDL_Window *
1192 window);
1193
1194 /**
1195 * \brief Set up an OpenGL context for rendering into an OpenGL window.
1196 *
1197 * \note The context must have been created with a compatible window.
1198 */
1199 extern DECLSPEC int SDLCALL SDL_GL_MakeCurrent(SDL_Window * window,
1200 SDL_GLContext context);
1201
1202 /**
1203 * \brief Get the currently active OpenGL window.
1204 */
1205 extern DECLSPEC SDL_Window* SDLCALL SDL_GL_GetCurrentWindow(void);
1206
1207 /**
1208 * \brief Get the currently active OpenGL context.
1209 */
1210 extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_GetCurrentContext(void);
1211
1212 /**
1213 * \brief Get the size of a window's underlying drawable in pixels (for use
1214 * with glViewport).
1215 *
1216 * \param window Window from which the drawable size should be queried
1217 * \param w Pointer to variable for storing the width in pixels, may be NULL
1218 * \param h Pointer to variable for storing the height in pixels, may be NULL
1219 *
1220 * This may differ from SDL_GetWindowSize() if we're rendering to a high-DPI
1221 * drawable, i.e. the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a
1222 * platform with high-DPI support (Apple calls this "Retina"), and not disabled
1223 * by the SDL_HINT_VIDEO_HIGHDPI_DISABLED hint.
1224 *
1225 * \sa SDL_GetWindowSize()
1226 * \sa SDL_CreateWindow()
1227 */
1228 extern DECLSPEC void SDLCALL SDL_GL_GetDrawableSize(SDL_Window * window, int *w,
1229 int *h);
1230
1231 /**
1232 * \brief Set the swap interval for the current OpenGL context.
1233 *
1234 * \param interval 0 for immediate updates, 1 for updates synchronized with the
1235 * vertical retrace. If the system supports it, you may
1236 * specify -1 to allow late swaps to happen immediately
1237 * instead of waiting for the next retrace.
1238 *
1239 * \return 0 on success, or -1 if setting the swap interval is not supported.
1240 *
1241 * \sa SDL_GL_GetSwapInterval()
1242 */
1243 extern DECLSPEC int SDLCALL SDL_GL_SetSwapInterval(int interval);
1244
1245 /**
1246 * \brief Get the swap interval for the current OpenGL context.
1247 *
1248 * \return 0 if there is no vertical retrace synchronization, 1 if the buffer
1249 * swap is synchronized with the vertical retrace, and -1 if late
1250 * swaps happen immediately instead of waiting for the next retrace.
1251 * If the system can't determine the swap interval, or there isn't a
1252 * valid current context, this will return 0 as a safe default.
1253 *
1254 * \sa SDL_GL_SetSwapInterval()
1255 */
1256 extern DECLSPEC int SDLCALL SDL_GL_GetSwapInterval(void);
1257
1258 /**
1259 * \brief Swap the OpenGL buffers for a window, if double-buffering is
1260 * supported.
1261 */
1262 extern DECLSPEC void SDLCALL SDL_GL_SwapWindow(SDL_Window * window);
1263
1264 /**
1265 * \brief Delete an OpenGL context.
1266 *
1267 * \sa SDL_GL_CreateContext()
1268 */
1269 extern DECLSPEC void SDLCALL SDL_GL_DeleteContext(SDL_GLContext context);
1270
1271 /* @} *//* OpenGL support functions */
1272
1273
1274 /* Ends C function definitions when using C++ */
1275 #ifdef __cplusplus
1276 }
1277 #endif
1278 #include "close_code.h"
1279
1280 #endif /* SDL_video_h_ */
1281
1282 /* vi: set ts=4 sw=4 expandtab: */
File include/SDL2/SDL_vulkan.h added (mode: 100644) (index 0000000..a3de1ce)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 2017, Mark Callow
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file SDL_vulkan.h
24 *
25 * Header file for functions to creating Vulkan surfaces on SDL windows.
26 */
27
28 #ifndef SDL_vulkan_h_
29 #define SDL_vulkan_h_
30
31 #include "SDL_video.h"
32
33 #include "begin_code.h"
34 /* Set up for C function definitions, even when using C++ */
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38
39 /* Avoid including vulkan.h, don't define VkInstance if it's already included */
40 #ifdef VULKAN_H_
41 #define NO_SDL_VULKAN_TYPEDEFS
42 #endif
43 #ifndef NO_SDL_VULKAN_TYPEDEFS
44 #define VK_DEFINE_HANDLE(object) typedef struct object##_T* object;
45
46 #if defined(__LP64__) || defined(_WIN64) || defined(__x86_64__) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__)
47 #define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef struct object##_T *object;
48 #else
49 #define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef uint64_t object;
50 #endif
51
52 VK_DEFINE_HANDLE(VkInstance)
53 VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSurfaceKHR)
54
55 #endif /* !NO_SDL_VULKAN_TYPEDEFS */
56
57 typedef VkInstance SDL_vulkanInstance;
58 typedef VkSurfaceKHR SDL_vulkanSurface; /* for compatibility with Tizen */
59
60 /**
61 * \name Vulkan support functions
62 *
63 * \note SDL_Vulkan_GetInstanceExtensions & SDL_Vulkan_CreateSurface API
64 * is compatable with Tizen's implementation of Vulkan in SDL.
65 */
66 /* @{ */
67
68 /**
69 * \brief Dynamically load a Vulkan loader library.
70 *
71 * \param [in] path The platform dependent Vulkan loader library name, or
72 * \c NULL.
73 *
74 * \return \c 0 on success, or \c -1 if the library couldn't be loaded.
75 *
76 * If \a path is NULL SDL will use the value of the environment variable
77 * \c SDL_VULKAN_LIBRARY, if set, otherwise it loads the default Vulkan
78 * loader library.
79 *
80 * This should be called after initializing the video driver, but before
81 * creating any Vulkan windows. If no Vulkan loader library is loaded, the
82 * default library will be loaded upon creation of the first Vulkan window.
83 *
84 * \note It is fairly common for Vulkan applications to link with \a libvulkan
85 * instead of explicitly loading it at run time. This will work with
86 * SDL provided the application links to a dynamic library and both it
87 * and SDL use the same search path.
88 *
89 * \note If you specify a non-NULL \c path, an application should retrieve all
90 * of the Vulkan functions it uses from the dynamic library using
91 * \c SDL_Vulkan_GetVkGetInstanceProcAddr() unless you can guarantee
92 * \c path points to the same vulkan loader library the application
93 * linked to.
94 *
95 * \note On Apple devices, if \a path is NULL, SDL will attempt to find
96 * the vkGetInstanceProcAddr address within all the mach-o images of
97 * the current process. This is because it is fairly common for Vulkan
98 * applications to link with libvulkan (and historically MoltenVK was
99 * provided as a static library). If it is not found then, on macOS, SDL
100 * will attempt to load \c vulkan.framework/vulkan, \c libvulkan.1.dylib,
101 * followed by \c libvulkan.dylib, in that order.
102 * On iOS SDL will attempt to load \c libvulkan.dylib only. Applications
103 * using a dynamic framework or .dylib must ensure it is included in its
104 * application bundle.
105 *
106 * \note On non-Apple devices, application linking with a static libvulkan is
107 * not supported. Either do not link to the Vulkan loader or link to a
108 * dynamic library version.
109 *
110 * \note This function will fail if there are no working Vulkan drivers
111 * installed.
112 *
113 * \sa SDL_Vulkan_GetVkGetInstanceProcAddr()
114 * \sa SDL_Vulkan_UnloadLibrary()
115 */
116 extern DECLSPEC int SDLCALL SDL_Vulkan_LoadLibrary(const char *path);
117
118 /**
119 * \brief Get the address of the \c vkGetInstanceProcAddr function.
120 *
121 * \note This should be called after either calling SDL_Vulkan_LoadLibrary
122 * or creating an SDL_Window with the SDL_WINDOW_VULKAN flag.
123 */
124 extern DECLSPEC void *SDLCALL SDL_Vulkan_GetVkGetInstanceProcAddr(void);
125
126 /**
127 * \brief Unload the Vulkan loader library previously loaded by
128 * \c SDL_Vulkan_LoadLibrary().
129 *
130 * \sa SDL_Vulkan_LoadLibrary()
131 */
132 extern DECLSPEC void SDLCALL SDL_Vulkan_UnloadLibrary(void);
133
134 /**
135 * \brief Get the names of the Vulkan instance extensions needed to create
136 * a surface with \c SDL_Vulkan_CreateSurface().
137 *
138 * \param [in] \c NULL or window Window for which the required Vulkan instance
139 * extensions should be retrieved
140 * \param [in,out] pCount pointer to an \c unsigned related to the number of
141 * required Vulkan instance extensions
142 * \param [out] pNames \c NULL or a pointer to an array to be filled with the
143 * required Vulkan instance extensions
144 *
145 * \return \c SDL_TRUE on success, \c SDL_FALSE on error.
146 *
147 * If \a pNames is \c NULL, then the number of required Vulkan instance
148 * extensions is returned in pCount. Otherwise, \a pCount must point to a
149 * variable set to the number of elements in the \a pNames array, and on
150 * return the variable is overwritten with the number of names actually
151 * written to \a pNames. If \a pCount is less than the number of required
152 * extensions, at most \a pCount structures will be written. If \a pCount
153 * is smaller than the number of required extensions, \c SDL_FALSE will be
154 * returned instead of \c SDL_TRUE, to indicate that not all the required
155 * extensions were returned.
156 *
157 * \note If \c window is not NULL, it will be checked against its creation
158 * flags to ensure that the Vulkan flag is present. This parameter
159 * will be removed in a future major release.
160 *
161 * \note The returned list of extensions will contain \c VK_KHR_surface
162 * and zero or more platform specific extensions
163 *
164 * \note The extension names queried here must be enabled when calling
165 * VkCreateInstance, otherwise surface creation will fail.
166 *
167 * \note \c window should have been created with the \c SDL_WINDOW_VULKAN flag
168 * or be \c NULL
169 *
170 * \code
171 * unsigned int count;
172 * // get count of required extensions
173 * if(!SDL_Vulkan_GetInstanceExtensions(NULL, &count, NULL))
174 * handle_error();
175 *
176 * static const char *const additionalExtensions[] =
177 * {
178 * VK_EXT_DEBUG_REPORT_EXTENSION_NAME, // example additional extension
179 * };
180 * size_t additionalExtensionsCount = sizeof(additionalExtensions) / sizeof(additionalExtensions[0]);
181 * size_t extensionCount = count + additionalExtensionsCount;
182 * const char **names = malloc(sizeof(const char *) * extensionCount);
183 * if(!names)
184 * handle_error();
185 *
186 * // get names of required extensions
187 * if(!SDL_Vulkan_GetInstanceExtensions(NULL, &count, names))
188 * handle_error();
189 *
190 * // copy additional extensions after required extensions
191 * for(size_t i = 0; i < additionalExtensionsCount; i++)
192 * names[i + count] = additionalExtensions[i];
193 *
194 * VkInstanceCreateInfo instanceCreateInfo = {};
195 * instanceCreateInfo.enabledExtensionCount = extensionCount;
196 * instanceCreateInfo.ppEnabledExtensionNames = names;
197 * // fill in rest of instanceCreateInfo
198 *
199 * VkInstance instance;
200 * // create the Vulkan instance
201 * VkResult result = vkCreateInstance(&instanceCreateInfo, NULL, &instance);
202 * free(names);
203 * \endcode
204 *
205 * \sa SDL_Vulkan_CreateSurface()
206 */
207 extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_GetInstanceExtensions(SDL_Window *window,
208 unsigned int *pCount,
209 const char **pNames);
210
211 /**
212 * \brief Create a Vulkan rendering surface for a window.
213 *
214 * \param [in] window SDL_Window to which to attach the rendering surface.
215 * \param [in] instance handle to the Vulkan instance to use.
216 * \param [out] surface pointer to a VkSurfaceKHR handle to receive the
217 * handle of the newly created surface.
218 *
219 * \return \c SDL_TRUE on success, \c SDL_FALSE on error.
220 *
221 * \code
222 * VkInstance instance;
223 * SDL_Window *window;
224 *
225 * // create instance and window
226 *
227 * // create the Vulkan surface
228 * VkSurfaceKHR surface;
229 * if(!SDL_Vulkan_CreateSurface(window, instance, &surface))
230 * handle_error();
231 * \endcode
232 *
233 * \note \a window should have been created with the \c SDL_WINDOW_VULKAN flag.
234 *
235 * \note \a instance should have been created with the extensions returned
236 * by \c SDL_Vulkan_CreateSurface() enabled.
237 *
238 * \sa SDL_Vulkan_GetInstanceExtensions()
239 */
240 extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_CreateSurface(SDL_Window *window,
241 VkInstance instance,
242 VkSurfaceKHR* surface);
243
244 /**
245 * \brief Get the size of a window's underlying drawable in pixels (for use
246 * with setting viewport, scissor & etc).
247 *
248 * \param window SDL_Window from which the drawable size should be queried
249 * \param w Pointer to variable for storing the width in pixels,
250 * may be NULL
251 * \param h Pointer to variable for storing the height in pixels,
252 * may be NULL
253 *
254 * This may differ from SDL_GetWindowSize() if we're rendering to a high-DPI
255 * drawable, i.e. the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a
256 * platform with high-DPI support (Apple calls this "Retina"), and not disabled
257 * by the \c SDL_HINT_VIDEO_HIGHDPI_DISABLED hint.
258 *
259 * \note On macOS high-DPI support must be enabled for an application by
260 * setting NSHighResolutionCapable to true in its Info.plist.
261 *
262 * \sa SDL_GetWindowSize()
263 * \sa SDL_CreateWindow()
264 */
265 extern DECLSPEC void SDLCALL SDL_Vulkan_GetDrawableSize(SDL_Window * window,
266 int *w, int *h);
267
268 /* @} *//* Vulkan support functions */
269
270 /* Ends C function definitions when using C++ */
271 #ifdef __cplusplus
272 }
273 #endif
274 #include "close_code.h"
275
276 #endif /* SDL_vulkan_h_ */
File include/SDL2/begin_code.h added (mode: 100644) (index 0000000..1ca40cc)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file begin_code.h
24 *
25 * This file sets things up for C dynamic library function definitions,
26 * static inlined functions, and structures aligned at 4-byte alignment.
27 * If you don't like ugly C preprocessor code, don't look at this file. :)
28 */
29
30 /* This shouldn't be nested -- included it around code only. */
31 #ifdef _begin_code_h
32 #error Nested inclusion of begin_code.h
33 #endif
34 #define _begin_code_h
35
36 #ifndef SDL_DEPRECATED
37 # if (__GNUC__ >= 4) /* technically, this arrived in gcc 3.1, but oh well. */
38 # define SDL_DEPRECATED __attribute__((deprecated))
39 # else
40 # define SDL_DEPRECATED
41 # endif
42 #endif
43
44 #ifndef SDL_UNUSED
45 # ifdef __GNUC__
46 # define SDL_UNUSED __attribute__((unused))
47 # else
48 # define SDL_UNUSED
49 # endif
50 #endif
51
52 /* Some compilers use a special export keyword */
53 #ifndef DECLSPEC
54 # if defined(__WIN32__) || defined(__WINRT__) || defined(__CYGWIN__)
55 # ifdef DLL_EXPORT
56 # define DECLSPEC __declspec(dllexport)
57 # else
58 # define DECLSPEC
59 # endif
60 # elif defined(__OS2__)
61 # ifdef BUILD_SDL
62 # define DECLSPEC __declspec(dllexport)
63 # else
64 # define DECLSPEC
65 # endif
66 # else
67 # if defined(__GNUC__) && __GNUC__ >= 4
68 # define DECLSPEC __attribute__ ((visibility("default")))
69 # else
70 # define DECLSPEC
71 # endif
72 # endif
73 #endif
74
75 /* By default SDL uses the C calling convention */
76 #ifndef SDLCALL
77 #if (defined(__WIN32__) || defined(__WINRT__)) && !defined(__GNUC__)
78 #define SDLCALL __cdecl
79 #elif defined(__OS2__) || defined(__EMX__)
80 #define SDLCALL _System
81 # if defined (__GNUC__) && !defined(_System)
82 # define _System /* for old EMX/GCC compat. */
83 # endif
84 #else
85 #define SDLCALL
86 #endif
87 #endif /* SDLCALL */
88
89 /* Removed DECLSPEC on Symbian OS because SDL cannot be a DLL in EPOC */
90 #ifdef __SYMBIAN32__
91 #undef DECLSPEC
92 #define DECLSPEC
93 #endif /* __SYMBIAN32__ */
94
95 /* Force structure packing at 4 byte alignment.
96 This is necessary if the header is included in code which has structure
97 packing set to an alternate value, say for loading structures from disk.
98 The packing is reset to the previous value in close_code.h
99 */
100 #if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__)
101 #ifdef _MSC_VER
102 #pragma warning(disable: 4103)
103 #endif
104 #ifdef __clang__
105 #pragma clang diagnostic ignored "-Wpragma-pack"
106 #endif
107 #ifdef __BORLANDC__
108 #pragma nopackwarning
109 #endif
110 #ifdef _M_X64
111 /* Use 8-byte alignment on 64-bit architectures, so pointers are aligned */
112 #pragma pack(push,8)
113 #else
114 #pragma pack(push,4)
115 #endif
116 #endif /* Compiler needs structure packing set */
117
118 #ifndef SDL_INLINE
119 #if defined(__GNUC__)
120 #define SDL_INLINE __inline__
121 #elif defined(_MSC_VER) || defined(__BORLANDC__) || \
122 defined(__DMC__) || defined(__SC__) || \
123 defined(__WATCOMC__) || defined(__LCC__) || \
124 defined(__DECC) || defined(__CC_ARM)
125 #define SDL_INLINE __inline
126 #ifndef __inline__
127 #define __inline__ __inline
128 #endif
129 #else
130 #define SDL_INLINE inline
131 #ifndef __inline__
132 #define __inline__ inline
133 #endif
134 #endif
135 #endif /* SDL_INLINE not defined */
136
137 #ifndef SDL_FORCE_INLINE
138 #if defined(_MSC_VER)
139 #define SDL_FORCE_INLINE __forceinline
140 #elif ( (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__) )
141 #define SDL_FORCE_INLINE __attribute__((always_inline)) static __inline__
142 #else
143 #define SDL_FORCE_INLINE static SDL_INLINE
144 #endif
145 #endif /* SDL_FORCE_INLINE not defined */
146
147 #ifndef SDL_NORETURN
148 #if defined(__GNUC__)
149 #define SDL_NORETURN __attribute__((noreturn))
150 #elif defined(_MSC_VER)
151 #define SDL_NORETURN __declspec(noreturn)
152 #else
153 #define SDL_NORETURN
154 #endif
155 #endif /* SDL_NORETURN not defined */
156
157 /* Apparently this is needed by several Windows compilers */
158 #if !defined(__MACH__)
159 #ifndef NULL
160 #ifdef __cplusplus
161 #define NULL 0
162 #else
163 #define NULL ((void *)0)
164 #endif
165 #endif /* NULL */
166 #endif /* ! Mac OS X - breaks precompiled headers */
File include/SDL2/close_code.h added (mode: 100644) (index 0000000..6aa411b)
1 /*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20 */
21
22 /**
23 * \file close_code.h
24 *
25 * This file reverses the effects of begin_code.h and should be included
26 * after you finish any function and structure declarations in your headers
27 */
28
29 #ifndef _begin_code_h
30 #error close_code.h included without matching begin_code.h
31 #endif
32 #undef _begin_code_h
33
34 /* Reset structure packing at previous byte alignment */
35 #if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__)
36 #ifdef __BORLANDC__
37 #pragma nopackwarning
38 #endif
39 #pragma pack(pop)
40 #endif /* Compiler needs structure packing set */
File include/civilian.h added (mode: 100755) (index 0000000..0221323)
1 #ifndef CIVILIAN_H
2 #define CIVILIAN_H
3
4 #ifndef FWORLD_H
5 #error Include fworld.h before civilian.h so the world can be referenced.
6 #endif
7
8 #include <stdio.h>
9
10 #include <cmath>
11 #include <cstdlib>
12
13 #include <vector>
14
15 namespace civilian {
16
17 struct Civilian {
18 size_t entity_index;
19 };
20
21 fworld::Entity* FindPOI(
22 fworld::World* world,
23 fworld::Entity &entity );
24
25 void AI(
26 std::vector<Civilian>* civilians,
27 fworld::World* world,
28 unsigned int rand_seed,
29 double d );
30
31 std::vector<Civilian> GetCivilians( fworld::World* world );
32
33 fworld::Entity* FindPOI(
34 fworld::World* world,
35 fworld::Entity &entity ){
36
37 // Make a list of possible points of interest.
38 std::vector<fworld::Entity*> candidates;
39 for( auto &e : world->entities ){
40 long long tile_x = e.x + 0.5, tile_y = e.y + 0.5;
41 if( e.task != fworld::TASK_SLEEP
42 && ( e.type.length() < 4 || ( e.type.substr( 0, 4 ) != "WARP"
43 && ( e.type.length() < 6 || e.type.substr( 0, 6 ) != "portal" )
44 && e.type != "ignore"
45 && e.type != "base"
46 && e.type != "corpse"
47 && e.type != "fighter"
48 && e.type != "sentry"
49 && e.type != "flora"
50 && e.type != "pickup"
51 && e.type != "regrow"
52 && e.type != "spawn"
53 && e.type != "player" ) )
54 && !world->entitiesBumping( entity, e )
55 && !world->tileBlocking( tile_x, tile_y, true )
56 && world->reachable( (long long)( entity.x + 0.5 ), (long long)( entity.y + 0.5 ), tile_x, tile_y, 15, true ) ){
57 candidates.push_back( &e );
58 }
59 }
60 // Randomly pick a point of interest.
61 if( candidates.size() > 0 ){
62 return candidates[(double)std::rand() / RAND_MAX * candidates.size()];
63 }
64 return nullptr;
65 }
66
67 void AI(
68 std::vector<Civilian>* civilians,
69 fworld::World* world,
70 unsigned int rand_seed,
71 double d ){
72
73 std::srand( rand_seed );
74 // Define the player variable.
75 fworld::Entity* player = nullptr;
76
77 // This lambda has access to the player and the world.
78 auto TalkingToPlayer = [&]( fworld::Entity &entity ){
79 // Check that the player is in talk mode and has a path.
80 if( player->task == fworld::TASK_TALK && player->path.size() > 0 ){
81 // Get a target from the player's path.
82 intptr_t index = (intptr_t)player->path[player->path.size() - 1];
83 size_t map_width = world->mapInfo[0].size();
84 long long target_y = index / map_width;
85 long long target_x = index - target_y * map_width;
86 // Return whether the player is targeting the entity's position.
87 return target_x == (long long)( entity.x + 0.5 )
88 && target_y == (long long)( entity.y + 0.5 );
89 }
90 return false;
91 };
92
93 // Find the player.
94 if( world->followEntity >= 0 ){
95 player = &world->entities[world->followEntity];
96 }
97 // Perform AI logic on all of the civilians.
98 for( auto &c : *civilians ){
99 if( c.entity_index >= world->entities.size() || (
100 world->entities[c.entity_index].type != "civilian"
101 && world->entities[c.entity_index].type != "bird"
102 ) ){
103 // Entity misalignment. Reassign civilians.
104 // The less this happens, the better. TODO
105 #ifndef __EMSCRIPTEN__
106 //fprintf( stderr, "Civilians misaligned. Correcting.\n" );
107 #endif
108 *civilians = GetCivilians( world );
109 return;
110 }
111 auto &ent = world->entities[c.entity_index];
112 if( player && player->task != fworld::TASK_SLEEP
113 && ( TalkingToPlayer( ent )
114 || ( ent.type != "bird"
115 && world->entitiesBumping( ent, *player ) ) ) ){
116 // Entity is interacting with the player.
117 world->entityLookAt( ent, *player );
118 ent.path.clear();
119 ent.walking = false;
120 ent.task = fworld::TASK_NONE;
121 ent.boredom = 0.0;
122 }else if( ent.task == fworld::TASK_NONE || ent.path.size() == 0 ){
123 // Entity is standing still away from the player.
124 ent.task = fworld::TASK_NONE;
125 ent.boredom += d;
126 double patience = ent.type == "bird" ? 0.0 : 2.0;
127 if( ent.boredom >= patience ){
128 ent.boredom = 0.0;
129 fworld::Entity* poi = FindPOI( world, ent );
130 if( poi ){
131 ent.task = fworld::TASK_BUMP;
132 world->solveEntityPath(
133 ent,
134 (long long)( poi->x + 0.5 ),
135 (long long)( poi->y + 0.5 ),
136 true
137 );
138 }
139 }
140 }
141 // Stop the entity's walking animation if not walking.
142 if( ent.path.size() == 0 ){
143 ent.walking = false;
144 ent.frame = 0.0;
145 }
146 }
147 }
148
149 std::vector<Civilian> GetCivilians( fworld::World* world ){
150 std::vector<Civilian> civilians;
151 for( size_t i = 0; i < world->entities.size(); i++ ){
152 auto &ent = world->entities[i];
153 if( ent.type == "civilian" || ent.type == "bird" ){
154 Civilian c = {};
155 c.entity_index = i;
156 ent.task = fworld::TASK_NONE;
157 civilians.push_back( c );
158 }
159 }
160 return civilians;
161 }
162
163 } // namespace civilian
164
165 #endif // CIVILIAN_H
File include/cute_sound.h added (mode: 100644) (index 0000000..ec36346)
1 /*
2 ------------------------------------------------------------------------------
3 Licensing information can be found at the end of the file.
4 ------------------------------------------------------------------------------
5
6 cute_sound.h - v1.11
7
8
9 To create implementation (the function definitions)
10 #define CUTE_SOUND_IMPLEMENTATION
11 in *one* C/CPP file (translation unit) that includes this file
12
13
14 SUMMARY
15
16 cute_sound is a C API for loading, playing, looping, panning and fading mono
17 and stereo sounds, without any external dependencies other than things that ship
18 with standard OSs, or SDL2 for more uncommon OSs.
19
20 For Windows cute_sound uses DirectSound. Due to the use of SSE intrinsics, MinGW
21 builds must be made with the compiler option: -march=native, or optionally SSE
22 can be disabled with CUTE_SOUND_SCALAR_MODE. More on this mode written below.
23
24 For Apple machines cute_sound uses CoreAudio.
25
26 For Linux builds cute_sound uses ALSA (implementation is currently buggy, and
27 cute_sound's SDL2 implementation is recommended instead).
28
29 An SDL2 implementation of cute_sound is available on platforms SDL2 is available,
30 which is pretty much everywhere. To use the SDL2 implementation of cute_sound
31 define CUTE_SOUND_FORCE_SDL before placing the CUTE_SOUND_IMPLEMENTATION into a
32 translation unit in order to force the use of SDL. Here is an example:
33
34 #define CUTE_SOUND_FORCE_SDL
35 #define CUTE_SOUND_IMPLEMENTATION
36 #include <cute_sound.h>
37
38 If you want to use cute_sound with SDL_RWops, you must enable it by putting this
39 before you #include cute_sound.h:
40
41 #define CUTE_SOUND_SDL_RWOPS
42
43
44 REVISION HISTORY
45
46 1.0 (06/04/2016) initial release
47 1.01 (06/06/2016) load WAV from memory
48 separate portable and OS-specific code in cs_mix
49 fixed bug causing audio glitches when sounds ended
50 added stb_vorbis loaders + demo example
51 1.02 (06/08/2016) error checking + strings in vorbis loaders
52 SSE2 implementation of mixer
53 fix typos on docs/comments
54 corrected volume bug introduced in 1.01
55 1.03 (07/05/2016) size calculation helper (to know size of sound in
56 bytes on the heap) cs_sound_size
57 1.04 (12/06/2016) merged in Aaron Balint's contributions
58 SFFT and pitch functions from Stephan M. Bernsee
59 cs_mix can run on its own thread with cs_spawn_mix_thread
60 updated documentation, typo fixes
61 fixed typo in cs_malloc16 that caused heap corruption
62 1.05 (12/08/2016) cs_stop_all_sounds, suggested by Aaron Balint
63 1.06 (02/17/2017) port to CoreAudio for Apple machines
64 1.07 (06/18/2017) SIMD the pitch shift code; swapped out old Bernsee
65 code for a new re-write, updated docs as necessary,
66 support for compiling as .c and .cpp on Windows,
67 port for SDL (for Linux, or any other platform).
68 Special thanks to DeXP (Dmitry Hrabrov) for 90% of
69 the work on the SDL port!
70 1.08 (09/06/2017) SDL_RWops support by RobLoach
71 1.09 (05/20/2018) Load wav funcs can skip all irrelevant chunks
72 Ref counting for playing sounds
73 1.10 (08/24/2019) Introduced plugin interface, reimplemented pitch shifting
74 as a plugin, added optional `ctx` to alloc functions
75 1.11 (04/23/2020) scalar SIMD mode and various compiler warning/error fixes
76
77
78 CONTRIBUTORS
79
80 Aaron Balint 1.04 - real time pitch
81 1.04 - separate thread for cs_mix
82 1.04 - bugfix, removed extra cs_free16 call for second channel
83 DeXP 1.07 - initial work on SDL port
84 RobLoach 1.08 - SDL_RWops support
85 Matt Rosen 1.10 - Initial experiments with cute_dsp to figure out plugin
86 interface needs and use-cases
87 fluffrabbit 1.11 - scalar SIMD mode and various compiler warning/error fixes
88
89
90 DOCUMENTATION (very quick intro)
91
92 1. create context
93 2. load sounds from disk into memory
94 3. play sounds
95 4. free context
96
97 1. cs_context_t* ctx = cs_make_context(hwnd, frequency, buffered_samples, N, NULL);
98 2. cs_play_sound_def_t def = cs_make_def(&cs_load_wav("path_to_file/filename.wav"));
99 3. cs_play_sound(ctx, def);
100 4. cs_shutdown_context(ctx);
101
102
103 DOCUMENTATION (longer introduction)
104
105 cute_sound consists of cs_loaded_sound_t, cs_playing_sound_t and the cs_context_t.
106 The cs_context_t encapsulates an OS sound API, as well as buffers + settings.
107 cs_loaded_sound_t holds raw samples of a sound. cs_playing_sound_t is an instance
108 of a cs_loaded_sound_t that represents a sound that can be played through the
109 cs_context_t.
110
111 There are two main versions of the API, the low-level and the high-level
112 API. The low-level API does not manage any memory for cs_playing_sound_ts. The
113 high level api holds a memory pool of playing sounds.
114
115 To actually mix sounds together and send audio to the sound card, be sure
116 to call either cs_mix periodically or call cs_spawn_mix_thread once.
117
118
119 High-level API
120
121 First create a context and pass in non-zero to the final parameter. This
122 final parameter controls how large of a memory pool to use for cs_playing_sound_t's.
123 Here's an example where N is the size of the internal pool:
124
125 cs_context_t* ctx = cs_make_context(hwnd, frequency, buffered_samples, N, NULL);
126
127 We create cs_playing_sound_t's indirectly with cs_play_def_t structs. cs_play_def_t is a
128 POD struct so feel free to make them straight on the stack. The cs_play_def
129 sets up initialization parameters. Here's an example to load a wav and
130 play it:
131
132 cs_loaded_sound_t loaded = cs_load_wav("path_to_file/filename.wav");
133 cs_play_sound_def_t def = cs_make_def(&loaded);
134 cs_playing_sound_t* sound = cs_play_sound(ctx, def);
135
136 The same def can be used to play as many sounds as desired (even simultaneously)
137 as long as the context playing sound pool is large enough.
138
139 You can work with some low-level functionality by iterating through the linked list
140 ctx->playing, which can be accessed by calling cs_get_playing(ctx). If you spawned a
141 thread via cs_spawn_mix_thread, remember to call cs_lock before you work with
142 cs_get_playing and call cs_unlock afterwards so sound can play again.
143
144
145 Low-level API
146
147 First create a context and pass 0 in the final parameter (0 here means
148 the context will *not* allocate a cs_playing_sound_t memory pool):
149
150 cs_context_t* ctx = cs_make_context(hwnd, frequency, buffered_samples, 0, NULL);
151
152 parameters:
153 hwnd -- HWND, handle to window (on OSX just pass in 0)
154 frequency -- int, represents Hz frequency rate in which samples are played
155 buffered_samples -- int, number of samples the internal ring buffers can hold at once
156 0 -- int, number of elements in cs_playing_sound_t pool
157 NULL -- optional pointer for custom allocator, just set to NULL
158
159 We create a cs_playing_sound_t like so:
160 cs_loaded_sound_t loaded = cs_load_wav("path_to_file/filename.wav");
161 cs_playing_sound_t playing_sound = cs_make_playing_sound(&loaded);
162
163 Then to play the sound we do:
164 cs_insert_sound(ctx, &playing_sound);
165
166 The above cs_insert_sound function call will place playing_sound into
167 a singly-linked list inside the context. The context will remove
168 the sound from its internal list when it finishes playing.
169
170 WARNING: The high-level API cannot be mixed with the low-level API. If you
171 try then the internal code will assert and crash. Pick one and stick with it.
172 Usually he high-level API will be used, but if someone is *really* picky about
173 their memory usage, or wants more control, the low-level API can be used.
174
175 Here is the Low-Level API:
176 cs_playing_sound_t cs_make_playing_sound(cs_loaded_sound_t* loaded);
177 int cs_insert_sound(cs_context_t* ctx, cs_playing_sound_t* sound);
178
179 Here is the High-Level API:
180 cs_playing_sound_t* cs_play_sound(cs_context_t* ctx, cs_play_sound_def_t def);
181 cs_play_sound_def_t cs_make_def(cs_loaded_sound_t* sound);
182 void cs_stop_all_sounds(cs_context_t(ctx);
183
184 Be sure to link against dsound.dll (or dsound.lib) on Windows.
185
186 Read the rest of the header for specific details on all available functions
187 and struct types.
188
189
190 PLUGINS
191
192 Cute sound can add plugins at run-time to modify audio before it gets mixed. Please
193 refer to all the documentation near `cs_plugin_interface_t`.
194
195 DISABLE SSE SIMD ACCELERATION
196
197 If for whatever reason you don't want to use SSE intrinsics and instead would prefer
198 plain C (for example if your platform does not support SSE) then define
199 CUTE_SOUND_SCALAR_MODE before including cute_sound.h while also defining the
200 symbol definitions. Here's an example:
201
202 #define CUTE_SOUND_IMPLEMENTATION
203 #define CUTE_SOUND_SCALAR_MODE
204 #include <cute_sound.h>
205
206 KNOWN LIMITATIONS
207
208 * PCM mono/stereo format is the only formats the LoadWAV function supports. I don't
209 guarantee it will work for all kinds of wav files, but it certainly does for the common
210 kind (and can be changed fairly easily if someone wanted to extend it).
211 * Only supports 16 bits per sample.
212 * Mixer does not do any fancy clipping. The algorithm is to convert all 16 bit samples
213 to float, mix all samples, and write back to audio API as 16 bit integers. In
214 practice this works very well and clipping is not often a big problem.
215
216
217 FAQ
218
219 Q : Why DirectSound instead of (insert API here) on Windows?
220 A : Casey Muratori documented DS on Handmade Hero, other APIs do not have such good docs. DS has
221 shipped on Windows XP all the way through Windows 10 -- using this header effectively intro-
222 duces zero dependencies for the foreseeable future. The DS API itself is sane enough to quickly
223 implement needed features, and users won't hear the difference between various APIs. Latency is
224 not that great with DS but it is shippable. Additionally, many other APIs will in the end speak
225 to Windows through the DS API.
226
227 Q : I would like to use my own memory management, how can I achieve this?
228 A : This header makes a couple uses of malloc/free, and cs_malloc16/cs_free16. Simply find these bits
229 and replace them with your own memory allocation routines. They can be wrapped up into a macro,
230 or call your own functions directly -- it's up to you. Generally these functions allocate fairly
231 large chunks of memory, and not very often (if at all).
232
233 Q : Does this library support audio streaming? Something like System::createStream in FMOD.
234 A : No. Typically music files aren't that large (in the megabytes). Compare this to a typical
235 DXT texture of 1024x1024, at 0.5MB of memory. Now say an average music file for a game is three
236 minutes long. Loading this file into memory and storing it as raw 16bit samples with two channels,
237 would be:
238
239 num_samples = 3 * 60 * 44100 * 2
240 num_bits = num_samples * 16
241 num_bytes = num_bits / 8
242 num_megabytes = num_bytes / (1024 * 1024)
243 or 30.3mb
244
245 So say the user has 2gb of spare RAM. That means we could fit 67 different three minute length
246 music files in there simultaneously. That is a ridiculous amount of spare memory. 30mb is nothing
247 nowadays. Just load your music file into memory all at once and then play it.
248
249 Q : But I really need streaming of audio files from disk to save memory! Also loading my audio
250 files (like .OGG) takes a long time (multiple seconds).
251 A : It is recommended to either A) load up your music files before they are needed, perhaps during
252 a loading screen, or B) stream in the entire audio into memory on another thread. cs_read_mem_ogg is
253 a great candidate function to throw onto a job pool. Streaming is more a remnant of older machines
254 (like in the 90's or early 2000's) where decoding speed and RAM were real nasty bottlenecks. For
255 more modern machines, these aren't really concerns, even with mobile devices. If even after reading
256 this Q/A section you still want to stream your audio, you can try mini_al as an alternative:
257 https://github.com/dr-soft/mini_al
258 */
259
260 /*
261 Some past discussion threads:
262 https://www.reddit.com/r/gamedev/comments/6i39j2/tinysound_the_cutest_library_to_get_audio_into/
263 https://www.reddit.com/r/gamedev/comments/4ml6l9/tinysound_singlefile_c_audio_library/
264 https://forums.tigsource.com/index.php?topic=58706.0
265 */
266
267 #if !defined(CUTE_SOUND_H)
268
269 #if defined(_WIN32)
270
271 #if !defined _CRT_SECURE_NO_WARNINGS
272 #define _CRT_SECURE_NO_WARNINGS
273 #endif
274
275 #if !defined _CRT_NONSTDC_NO_DEPRECATE
276 #define _CRT_NONSTDC_NO_DEPRECATE
277 #endif
278
279 #endif
280
281 #include <stdint.h>
282
283 // read this in the event of cs_load_wav/cs_load_ogg errors
284 // also read this in the event of certain errors from cs_make_context
285 extern const char* cs_error_reason;
286
287 // stores a loaded sound in memory
288 typedef struct cs_loaded_sound_t
289 {
290 int sample_rate;
291 int sample_count;
292 int channel_count;
293
294 // Number of instances currently referencing this audio. Must be zero
295 // in order to safely delete the audio. References are automatically
296 // updated whenever playing instances are inserted into the context.
297 int playing_count;
298
299 // The actual raw audio samples in memory.
300 void* channels[2];
301 } cs_loaded_sound_t;
302
303 // Don't change this unless necessary. 32 is a huge number to begin with.
304 #define CUTE_SOUND_PLUGINS_MAX (32)
305
306 // represents an instance of a cs_loaded_sound_t, can be played through the cs_context_t
307 typedef struct cs_playing_sound_t
308 {
309 int active;
310 int paused;
311 int looped;
312 float volume0;
313 float volume1;
314 float pan0;
315 float pan1;
316 int sample_index;
317 cs_loaded_sound_t* loaded_sound;
318 struct cs_playing_sound_t* next;
319 void* plugin_udata[CUTE_SOUND_PLUGINS_MAX];
320 } cs_playing_sound_t;
321
322 // holds audio API info and other info
323 struct cs_context_t;
324 typedef struct cs_context_t cs_context_t;
325
326 // The returned struct will contain a null pointer in cs_loaded_sound_t::channel[0]
327 // in the case of errors. Read cs_error_reason string for details on what happened.
328 // Calls cs_read_mem_wav internally.
329 cs_loaded_sound_t cs_load_wav(const char* path);
330
331 // Reads a WAV file from memory. Still allocates memory for the cs_loaded_sound_t since
332 // WAV format will interlace stereo, and we need separate data streams to do SIMD
333 // properly.
334 void cs_read_mem_wav(const void* memory, int size, cs_loaded_sound_t* sound);
335
336 // If stb_vorbis was included *before* cute_sound go ahead and create
337 // some functions for dealing with OGG files.
338 #ifdef STB_VORBIS_INCLUDE_STB_VORBIS_H
339
340 void cs_read_mem_ogg(const void* memory, int length, cs_loaded_sound_t* sound);
341 cs_loaded_sound_t cs_load_ogg(const char* path);
342
343 #endif
344
345 // Uses cs_free16 (aligned free, implemented later in this file) to free up both of
346 // the channels stored within sound
347 void cs_free_sound(cs_loaded_sound_t* sound);
348
349 // Returns the size, in bytes, of all heap-allocated memory for this particular
350 // loaded sound
351 int cs_sound_size(cs_loaded_sound_t* sound);
352
353 // playing_pool_count -- 0 to setup low-level API, non-zero to size the internal
354 // memory pool for cs_playing_sound_t instances
355 // `user_allocator_context` can be NULL - it is passed to `CUTE_SOUND_ALLOC` and
356 // `CUTE_SOUND_FREE`.
357 cs_context_t* cs_make_context(void* hwnd, unsigned play_frequency_in_Hz, int buffered_samples, int playing_pool_count, void* user_allocator_context);
358 void cs_shutdown_context(cs_context_t* ctx);
359
360 // Call cs_spawn_mix_thread once to setup a separate thread for the context to run
361 // upon. The separate thread will continually call cs_mix and perform mixing
362 // operations.
363 void cs_spawn_mix_thread(cs_context_t* ctx);
364
365 // Use cs_thread_sleep_delay to specify a custom sleep delay time.
366 // A sleep will occur after each call to cs_mix. By default YieldProcessor
367 // is used, and no sleep occurs. Use a sleep delay to conserve CPU bandwidth.
368 // A recommended sleep time is a little less than 1/2 your predicted 1/FPS.
369 // 60 fps is 16 ms, so about 1-5 should work well in most cases.
370 void cs_thread_sleep_delay(cs_context_t* ctx, int milliseconds);
371
372 // Lock the thread before working with some of the lower-level stuff.
373 void cs_lock(cs_context_t* ctx);
374
375 // Unlock the thread after you've done that stuff.
376 void cs_unlock(cs_context_t* ctx);
377
378 // Call this manually, once per game tick recommended, if you haven't ever
379 // called cs_spawn_mix_thread. Otherwise the thread will call cs_mix itself.
380 // num_samples_to_write is not used on Windows. On Mac it is used to push
381 // samples into a circular buffer while CoreAudio simultaneously pulls samples
382 // off of the buffer. num_samples_to_write should be computed each update tick
383 // as delta_time * play_frequency_in_Hz + 1.
384 void cs_mix(cs_context_t* ctx);
385
386 // All of the functions in this next section should only be called if cs_is_active
387 // returns true. Calling them otherwise probably won't do anything bad, but it
388 // won't do anything at all. If a sound is active it resides in the context's
389 // internal list of playing sounds.
390 int cs_is_active(cs_playing_sound_t* sound);
391
392 // Flags sound for removal. Upon next cs_mix call will remove sound from playing
393 // list. If high-level API used sound is placed onto the internal free list.
394 void cs_stop_sound(cs_playing_sound_t* sound);
395
396 void cs_loop_sound(cs_playing_sound_t* sound, int zero_for_no_loop);
397 void cs_pause_sound(cs_playing_sound_t* sound, int one_for_paused);
398
399 // lerp from 0 to 1, 0 full left, 1 full right
400 void cs_set_pan(cs_playing_sound_t* sound, float pan);
401
402 // explicitly set volume of each channel. Can be used as panning (but it's
403 // recommended to use the cs_set_pan function for panning).
404 void cs_set_volume(cs_playing_sound_t* sound, float volume_left, float volume_right);
405
406 // Delays sound before actually playing it. Requires context to be passed in
407 // since there's a conversion from seconds to samples per second.
408 // If one were so inclined another version could be implemented like:
409 // void cs_set_delay(cs_playing_sound_t* sound, float delay, int samples_per_second)
410 void cs_set_delay(cs_context_t* ctx, cs_playing_sound_t* sound, float delay_in_seconds);
411
412 // Return the linked list ctx->playing, be sure to use cs_lock or cs_unlock if mixing on
413 // another thread.
414 cs_playing_sound_t* cs_get_playing(cs_context_t* ctx);
415
416 // Portable sleep function. Do not call this with milliseconds > 999.
417 void cs_sleep(int milliseconds);
418
419 // LOW-LEVEL API
420 cs_playing_sound_t cs_make_playing_sound(cs_loaded_sound_t* loaded);
421 int cs_insert_sound(cs_context_t* ctx, cs_playing_sound_t* sound); // returns 1 if sound was successfully inserted, 0 otherwise
422
423 // HIGH-LEVEL API
424
425 // This def struct is just used to pass parameters to `cs_play_sound`.
426 // Be careful since `loaded` points to a `cs_loaded_sound_t` struct, so make
427 // sure the `cs_loaded_sound_t` struct persists in memory!
428 typedef struct cs_play_sound_def_t
429 {
430 int paused;
431 int looped;
432 float volume_left;
433 float volume_right;
434 float pan;
435 float delay;
436 cs_loaded_sound_t* loaded;
437 } cs_play_sound_def_t;
438
439 cs_playing_sound_t* cs_play_sound(cs_context_t* ctx, cs_play_sound_def_t def);
440 cs_play_sound_def_t cs_make_def(cs_loaded_sound_t* sound);
441 void cs_stop_all_sounds(cs_context_t* ctx);
442
443 // SDL_RWops specific functions
444 #if defined(SDL_rwops_h_) && defined(CUTE_SOUND_SDL_RWOPS)
445
446 // Provides the ability to use cs_load_wav with an SDL_RWops object.
447 cs_loaded_sound_t cs_load_wav_rw(SDL_RWops* context);
448
449 #ifdef STB_VORBIS_INCLUDE_STB_VORBIS_H
450
451 // Provides the ability to use cs_load_ogg with an SDL_RWops object.
452 cs_loaded_sound_t cs_load_ogg_rw(SDL_RWops* rw);
453
454 #endif
455
456 #endif // SDL_rwops_h_
457
458 /**
459 * Uniquely identifies a plugin once added to a `cs_context_t` via `cs_add_plugin`.
460 */
461 typedef int cs_plugin_id_t;
462
463 /**
464 * Plugin interface.
465 *
466 * A plugin is anyone who implements one of these cs_plugin_interface_t structs
467 * and then calls `cs_add_plugin(ctx, plugin_ptr)`. Plugins can be implemented to
468 * perform custom operations on playing sounds before they mixed to the audio driver.
469 */
470 typedef struct cs_plugin_interface_t
471 {
472 /**
473 * This pointer is used to represent your plugin instance, and is pased to all callbacks as the
474 * `plugin_instance` pointer. This pointer is not managed by cute sound in any way. You are
475 * responsible for allocating and releasing all resources associated with the plugin instance.
476 */
477 void* plugin_instance;
478
479 /**
480 * Called whenever a new sound is starting to play. `playing_sound_udata` is optional, and should
481 * point to whatever data you would like to associate with playing sounds, on a per-playing-sound
482 * basis.
483 *
484 * This function is only called from user threads whenever `cs_play_sound` or `cs_insert_sound`
485 * is called.
486 */
487 void (*on_make_playing_sound_fn)(cs_context_t* cs_ctx, void* plugin_instance, void** playing_sound_udata, const cs_playing_sound_t* sound);
488
489 /**
490 * Called once for each time `on_make_playing_sound_fn` is called. The pointer originally assigned
491 * in `on_make_playing_sound_fn` will be passed back here as `playing_sound_udata`. The intent is
492 * to let the user free up any resources associated with the playing sound instance before the sound
493 * is released completely internally.
494 *
495 * This function can be called from the user thread, or from the mixer thread.
496 */
497 void (*on_free_playing_sound_fn)(cs_context_t* cs_ctx, void* plugin_instance, void* playing_sound_udata, const cs_playing_sound_t* sound);
498
499 /**
500 * Called when mixing each playing sound instance, once per channel on each playing sound instance.
501 * This function gives the plugin a chance to alter any audio before being mixed by cute_sound to
502 * the audio driver. The source audio is not alterable, however, the plugin can copy `samples_in`
503 * and then output modified samples in `samples_out`.
504 *
505 * `channel_index` This function is called once per source channel, so `channel_index` will be either
506 * 0 or 1, depending on the channel count.
507 * `samples_in` All audio from the playing sound's source.
508 * `sample_count` The number of samples in `samples_in` and expected in `samples_out`.
509 * `samples_out` Required to point to a valid samples buffer. The simplest case is to assign `samples_out`
510 * directly as `samples_in`, performing no modifications. In most cases though the plugin
511 * will make a copy of `(float*)samples_in`, alter the samples, and assign `samples_out` to
512 * point to the modified samples. `samples_out` is expected to point to a valid buffer until
513 * the next time `on_mix_fn` is called. Typically the plugin can hold a single buffer used
514 * for altered samples, and simply reuse the same buffer each time `on_mix_fn` is called.
515 * `playing_sound_udata` The user data `playing_sound_udata` assigned when `on_make_playing_sound_fn` was called.
516 *
517 * This function can be called from the user thread, or from the mixer thread.
518 */
519 void (*on_mix_fn)(cs_context_t* cs_ctx, void* plugin_instance, int channel_index, const float* samples_in, int sample_count, float** samples_out, void* playing_sound_udata, const cs_playing_sound_t* sound);
520 } cs_plugin_interface_t;
521
522 cs_plugin_id_t cs_add_plugin(cs_context_t* ctx, const cs_plugin_interface_t* plugin);
523
524 #define CUTE_SOUND_H
525 #endif
526
527 #ifdef CUTE_SOUND_IMPLEMENTATION
528 #ifndef CUTE_SOUND_IMPLEMENTATION_ONCE
529 #define CUTE_SOUND_IMPLEMENTATION_ONCE
530
531 #ifndef CUTE_SOUND_MINIMUM_BUFFERED_SAMPLES
532 # define CUTE_SOUND_MINIMUM_BUFFERED_SAMPLES 1024
533 #endif
534
535 #if !defined(CUTE_SOUND_ALLOC)
536 #include <stdlib.h> // malloc, free
537 #define CUTE_SOUND_ALLOC(size, ctx) malloc(size)
538 #define CUTE_SOUND_FREE(mem, ctx) free(mem)
539 #endif
540
541 #include <stdio.h> // fopen, fclose
542 #include <string.h> // memcmp, memset, memcpy
543
544 // Platform detection.
545 #define CUTE_SOUND_WINDOWS 1
546 #define CUTE_SOUND_APPLE 2
547 #define CUTE_SOUND_LINUX 3
548 #define CUTE_SOUND_SDL 4
549
550 #if defined(_WIN32)
551
552 #if !defined _CRT_SECURE_NO_WARNINGS
553 #define _CRT_SECURE_NO_WARNINGS
554 #endif
555
556 #if !defined _CRT_NONSTDC_NO_DEPRECATE
557 #define _CRT_NONSTDC_NO_DEPRECATE
558 #endif
559
560 #define CUTE_SOUND_PLATFORM CUTE_SOUND_WINDOWS
561
562 #elif defined(__APPLE__)
563
564 #define CUTE_SOUND_PLATFORM CUTE_SOUND_APPLE
565
566 #elif defined(__linux__)
567
568 #define CUTE_SOUND_PLATFORM CUTE_SOUND_LINUX
569
570 #else
571
572 // Just use SDL on other esoteric platforms.
573 #define CUTE_SOUND_PLATFORM CUTE_SOUND_SDL
574
575 #endif
576
577 // Use CUTE_SOUND_FORCE_SDL to override the above macros and use the SDL port.
578 #ifdef CUTE_SOUND_FORCE_SDL
579
580 #undef CUTE_SOUND_PLATFORM
581 #define CUTE_SOUND_PLATFORM CUTE_SOUND_SDL
582
583 #endif
584
585 // Platform specific file inclusions.
586 #if CUTE_SOUND_PLATFORM == CUTE_SOUND_WINDOWS
587
588 #ifndef _WINDOWS_
589 #ifndef WIN32_LEAN_AND_MEAN
590 #define WIN32_LEAN_AND_MEAN
591 #endif
592 #include <windows.h>
593 #endif
594
595 #ifndef _WAVEFORMATEX_
596 #include <mmreg.h>
597 #include <mmsystem.h>
598 #endif
599
600 #include <dsound.h>
601 #undef PlaySound
602
603 #ifdef _MSC_VER
604 #pragma comment(lib, "dsound.lib")
605 #endif
606
607 #elif CUTE_SOUND_PLATFORM == CUTE_SOUND_APPLE
608
609 #include <CoreAudio/CoreAudio.h>
610 #include <AudioUnit/AudioUnit.h>
611 #include <pthread.h>
612 #include <mach/mach_time.h>
613
614 #elif CUTE_SOUND_PLATFORM == CUTE_SOUND_LINUX
615
616 #define ALSA_PCM_NEW_HW_PARAMS_API
617 #include <alsa/asoundlib.h>
618 #include <unistd.h> // nanosleep
619 #include <dlfcn.h> // dlopen, dclose, dlsym
620 #define timespec // Avoids duplicate definitions.
621 #undef timespec // You must compile with POSIX features enabled.
622 #include <pthread.h>
623 #include <alloca.h>
624 #include <assert.h>
625
626 #elif CUTE_SOUND_PLATFORM == CUTE_SOUND_SDL
627
628 #include <SDL2/SDL.h>
629 #ifndef _WIN32
630 #include <alloca.h>
631 #endif
632
633 #else
634
635 #error Unsupported platform - please choose one of CUTE_SOUND_WINDOWS, CUTE_SOUND_APPLE, CUTE_SOUND_LINUX or CUTE_SOUND_SDL.
636
637 #endif
638
639 #ifdef CUTE_SOUND_SCALAR_MODE
640
641 #include <limits.h>
642
643 #define CS_SATURATE16(X) (int16_t)((X) > SHRT_MAX ? SHRT_MAX : ((X) < SHRT_MIN ? SHRT_MIN : (X)))
644
645 typedef struct cs__m128
646 {
647 float a, b, c, d;
648 } cs__m128;
649
650 typedef struct cs__m128i
651 {
652 int32_t a, b, c, d;
653 } cs__m128i;
654
655 cs__m128 cs_mm_set_ps(float e3, float e2, float e1, float e0)
656 {
657 cs__m128 a;
658 a.a = e0;
659 a.b = e1;
660 a.c = e2;
661 a.d = e3;
662 return a;
663 }
664
665 cs__m128 cs_mm_set1_ps(float e)
666 {
667 cs__m128 a;
668 a.a = e;
669 a.b = e;
670 a.c = e;
671 a.d = e;
672 return a;
673 }
674
675 cs__m128 cs_mm_load_ps(float const* mem_addr)
676 {
677 cs__m128 a;
678 a.a = mem_addr[0];
679 a.b = mem_addr[1];
680 a.c = mem_addr[2];
681 a.d = mem_addr[3];
682 return a;
683 }
684
685 cs__m128 cs_mm_add_ps(cs__m128 a, cs__m128 b)
686 {
687 cs__m128 c;
688 c.a = a.a + b.a;
689 c.b = a.b + b.b;
690 c.c = a.c + b.c;
691 c.d = a.d + b.d;
692 return c;
693 }
694
695 cs__m128 cs_mm_mul_ps(cs__m128 a, cs__m128 b)
696 {
697 cs__m128 c;
698 c.a = a.a * b.a;
699 c.b = a.b * b.b;
700 c.c = a.c * b.c;
701 c.d = a.d * b.d;
702 return c;
703 }
704
705 cs__m128i cs_mm_cvtps_epi32(cs__m128 a)
706 {
707 cs__m128i b;
708 b.a = a.a;
709 b.b = a.b;
710 b.c = a.c;
711 b.d = a.d;
712 return b;
713 }
714
715 cs__m128i cs_mm_unpacklo_epi32(cs__m128i a, cs__m128i b)
716 {
717 cs__m128i c;
718 c.a = a.a;
719 c.b = b.a;
720 c.c = a.b;
721 c.d = b.b;
722 return c;
723 }
724
725 cs__m128i cs_mm_unpackhi_epi32(cs__m128i a, cs__m128i b)
726 {
727 cs__m128i c;
728 c.a = a.c;
729 c.b = b.c;
730 c.c = a.d;
731 c.d = b.d;
732 return c;
733 }
734
735 cs__m128i cs_mm_packs_epi32(cs__m128i a, cs__m128i b)
736 {
737 union {
738 int16_t c[8];
739 cs__m128i m;
740 } dst;
741 dst.c[0] = CS_SATURATE16(a.a);
742 dst.c[1] = CS_SATURATE16(a.b);
743 dst.c[2] = CS_SATURATE16(a.c);
744 dst.c[3] = CS_SATURATE16(a.d);
745 dst.c[4] = CS_SATURATE16(b.a);
746 dst.c[5] = CS_SATURATE16(b.b);
747 dst.c[6] = CS_SATURATE16(b.c);
748 dst.c[7] = CS_SATURATE16(b.d);
749 return dst.m;
750 }
751
752 #else
753
754 #include <xmmintrin.h>
755 #include <emmintrin.h>
756
757 #define cs__m128 __m128
758 #define cs__m128i __m128i
759
760 #define cs_mm_set_ps _mm_set_ps
761 #define cs_mm_set1_ps _mm_set1_ps
762 #define cs_mm_load_ps _mm_load_ps
763 #define cs_mm_add_ps _mm_add_ps
764 #define cs_mm_mul_ps _mm_mul_ps
765 #define cs_mm_cvtps_epi32 _mm_cvtps_epi32
766 #define cs_mm_unpacklo_epi32 _mm_unpacklo_epi32
767 #define cs_mm_unpackhi_epi32 _mm_unpackhi_epi32
768 #define cs_mm_packs_epi32 _mm_packs_epi32
769
770 #endif // CUTE_SOUND_SCALAR_MODE
771
772 #define CUTE_SOUND_CHECK(X, Y) do { if (!(X)) { cs_error_reason = Y; goto ts_err; } } while (0)
773 #ifdef __clang__
774 #define CUTE_SOUND_ASSERT_INTERNAL __builtin_trap()
775 #else
776 #define CUTE_SOUND_ASSERT_INTERNAL *(int*)0 = 0
777 #endif
778 #define CUTE_SOUND_ASSERT(X) do { if (!(X)) CUTE_SOUND_ASSERT_INTERNAL; } while (0)
779 #define CUTE_SOUND_ALIGN(X, Y) ((((size_t)X) + ((Y) - 1)) & ~((Y) - 1))
780 #define CUTE_SOUND_TRUNC(X, Y) ((size_t)(X) & ~((Y) - 1))
781
782 const char* cs_error_reason;
783
784 static void* cs_read_file_to_memory(const char* path, int* size, void* mem_ctx)
785 {
786 (void)mem_ctx;
787 void* data = 0;
788 FILE* fp = fopen(path, "rb");
789 int sizeNum = 0;
790
791 if (fp)
792 {
793 fseek(fp, 0, SEEK_END);
794 sizeNum = (int)ftell(fp);
795 fseek(fp, 0, SEEK_SET);
796 data = CUTE_SOUND_ALLOC(sizeNum, mem_ctx);
797 (void)(fread(data, sizeNum, 1, fp) + 1);
798 fclose(fp);
799 }
800
801 if (size) *size = sizeNum;
802 return data;
803 }
804
805 static int cs_four_cc(const char* CC, void* memory)
806 {
807 if (!memcmp(CC, memory, 4)) return 1;
808 return 0;
809 }
810
811 static char* cs_next(char* data)
812 {
813 uint32_t size = *(uint32_t*)(data + 4);
814 size = (size + 1) & ~1;
815 return data + 8 + size;
816 }
817
818 static void* cs_malloc16(size_t size, void* mem_ctx)
819 {
820 (void)mem_ctx;
821 void* p = CUTE_SOUND_ALLOC(size + 16, mem_ctx);
822 if (!p) return 0;
823 unsigned char offset = (size_t)p & 15;
824 p = (void*)CUTE_SOUND_ALIGN(p + 1, 16);
825 *((char*)p - 1) = 16 - offset;
826 CUTE_SOUND_ASSERT(!((size_t)p & 15));
827 return p;
828 }
829
830 static void cs_free16(void* p, void* mem_ctx)
831 {
832 (void)mem_ctx;
833 if (!p) return;
834 CUTE_SOUND_FREE((char*)p - (((size_t)*((char*)p - 1)) & 0xFF), NULL);
835 }
836
837 static void cs_last_element(cs__m128* a, int i, int j, int16_t* samples, int offset)
838 {
839 switch (offset)
840 {
841 case 1:
842 a[i] = cs_mm_set_ps(samples[j], 0.0f, 0.0f, 0.0f);
843 break;
844
845 case 2:
846 a[i] = cs_mm_set_ps(samples[j], samples[j + 1], 0.0f, 0.0f);
847 break;
848
849 case 3:
850 a[i] = cs_mm_set_ps(samples[j], samples[j + 1], samples[j + 2], 0.0f);
851 break;
852
853 case 0:
854 a[i] = cs_mm_set_ps(samples[j], samples[j + 1], samples[j + 2], samples[j + 3]);
855 break;
856 }
857 }
858
859 void cs_read_mem_wav(const void* memory, int size, cs_loaded_sound_t* sound)
860 {
861 #pragma pack(push, 1)
862 typedef struct
863 {
864 uint16_t wFormatTag;
865 uint16_t nChannels;
866 uint32_t nSamplesPerSec;
867 uint32_t nAvgBytesPerSec;
868 uint16_t nBlockAlign;
869 uint16_t wBitsPerSample;
870 uint16_t cbSize;
871 uint16_t wValidBitsPerSample;
872 uint32_t dwChannelMask;
873 uint8_t SubFormat[18];
874 } Fmt;
875 #pragma pack(pop)
876
877 sound->playing_count = 0;
878
879 char* data = (char*)memory;
880 char* end = data + size;
881 CUTE_SOUND_CHECK(data, "Unable to read input file (file doesn't exist, or could not allocate heap memory.");
882 CUTE_SOUND_CHECK(cs_four_cc("RIFF", data), "Incorrect file header; is this a WAV file?");
883 CUTE_SOUND_CHECK(cs_four_cc("WAVE", data + 8), "Incorrect file header; is this a WAV file?");
884
885 data += 12;
886
887 while (1)
888 {
889 CUTE_SOUND_CHECK(end > data, "Error searching for fmt chunk.");
890 if (cs_four_cc("fmt ", data)) break;
891 data = cs_next(data);
892 }
893
894 Fmt fmt;
895 fmt = *(Fmt*)(data + 8);
896 CUTE_SOUND_CHECK(fmt.wFormatTag == 1, "Only PCM WAV files are supported.");
897 CUTE_SOUND_CHECK(fmt.nChannels == 1 || fmt.nChannels == 2, "Only mono or stereo supported (too many channels detected).");
898 CUTE_SOUND_CHECK(fmt.wBitsPerSample == 16, "Only 16 bits per sample supported.");
899 CUTE_SOUND_CHECK(fmt.nBlockAlign == fmt.nChannels * 2, "implementation error");
900
901 sound->sample_rate = (int)fmt.nSamplesPerSec;
902
903 while (1)
904 {
905 CUTE_SOUND_CHECK(end > data, "Error searching for data chunk.");
906 if (cs_four_cc("data", data)) break;
907 data = cs_next(data);
908 }
909
910 {
911 int sample_size = *((uint32_t*)(data + 4));
912 int sample_count = sample_size / (fmt.nChannels * sizeof(uint16_t));
913 sound->sample_count = sample_count;
914 sound->channel_count = fmt.nChannels;
915
916 int wide_count = (int)CUTE_SOUND_ALIGN(sample_count, 4);
917 wide_count /= 4;
918 int wide_offset = sample_count & 3;
919 int16_t* samples = (int16_t*)(data + 8);
920 float* sample = (float*)alloca(sizeof(float) * 4 + 16);
921 sample = (float*)CUTE_SOUND_ALIGN(sample, 16);
922
923 switch (sound->channel_count)
924 {
925 case 1:
926 {
927 sound->channels[0] = cs_malloc16(wide_count * sizeof(cs__m128), NULL);
928 sound->channels[1] = 0;
929 cs__m128* a = (cs__m128*)sound->channels[0];
930
931 for (int i = 0, j = 0; i < wide_count - 1; ++i, j += 4)
932 {
933 sample[0] = (float)samples[j];
934 sample[1] = (float)samples[j + 1];
935 sample[2] = (float)samples[j + 2];
936 sample[3] = (float)samples[j + 3];
937 a[i] = cs_mm_load_ps(sample);
938 }
939
940 cs_last_element(a, wide_count - 1, (wide_count - 1) * 4, samples, wide_offset);
941 } break;
942
943 case 2:
944 {
945 cs__m128* a = (cs__m128*)cs_malloc16(wide_count * sizeof(cs__m128) * 2, NULL);
946 cs__m128* b = a + wide_count;
947
948 for (int i = 0, j = 0; i < wide_count - 1; ++i, j += 8)
949 {
950 sample[0] = (float)samples[j];
951 sample[1] = (float)samples[j + 2];
952 sample[2] = (float)samples[j + 4];
953 sample[3] = (float)samples[j + 6];
954 a[i] = cs_mm_load_ps(sample);
955
956 sample[0] = (float)samples[j + 1];
957 sample[1] = (float)samples[j + 3];
958 sample[2] = (float)samples[j + 5];
959 sample[3] = (float)samples[j + 7];
960 b[i] = cs_mm_load_ps(sample);
961 }
962
963 cs_last_element(a, wide_count - 1, (wide_count - 1) * 4, samples, wide_offset);
964 cs_last_element(b, wide_count - 1, (wide_count - 1) * 4 + 4, samples, wide_offset);
965 sound->channels[0] = a;
966 sound->channels[1] = b;
967 } break;
968
969 default:
970 CUTE_SOUND_CHECK(0, "unsupported channel count (only support mono and stereo).");
971 }
972 }
973
974 return;
975
976 ts_err:
977 memset(&sound, 0, sizeof(sound));
978 }
979
980 cs_loaded_sound_t cs_load_wav(const char* path)
981 {
982 cs_loaded_sound_t sound = { 0, 0, 0, 0, { NULL, NULL } };
983 int size;
984 char* wav = (char*)cs_read_file_to_memory(path, &size, NULL);
985 cs_read_mem_wav(wav, size, &sound);
986 CUTE_SOUND_FREE(wav, NULL);
987 return sound;
988 }
989
990 #if CUTE_SOUND_PLATFORM == CUTE_SOUND_SDL && defined(SDL_rwops_h_) && defined(CUTE_SOUND_SDL_RWOPS)
991
992 // Load an SDL_RWops object's data into memory.
993 // Ripped straight from: https://wiki.libsdl.org/SDL_RWread
994 static void* cs_read_rw_to_memory(SDL_RWops* rw, int* size, void* mem_ctx)
995 {
996 Sint64 res_size = SDL_RWsize(rw);
997 char* data = (char*)CUTE_SOUND_ALLOC((size_t)(res_size + 1), mem_ctx);
998
999 Sint64 nb_read_total = 0, nb_read = 1;
1000 char* buf = data;
1001 while (nb_read_total < res_size && nb_read != 0)
1002 {
1003 nb_read = SDL_RWread(rw, buf, 1, (size_t)(res_size - nb_read_total));
1004 nb_read_total += nb_read;
1005 buf += nb_read;
1006 }
1007
1008 SDL_RWclose(rw);
1009
1010 if (nb_read_total != res_size)
1011 {
1012 CUTE_SOUND_FREE(data, NULL);
1013 return NULL;
1014 }
1015
1016 if (size) *size = (int)res_size;
1017 return data;
1018 }
1019
1020 cs_loaded_sound_t cs_load_wav_rw(SDL_RWops* context)
1021 {
1022 cs_loaded_sound_t sound = { 0 };
1023 int size;
1024 char* wav = (char*)cs_read_rw_to_memory(context, &size, NULL);
1025 cs_read_mem_wav(wav, size, &sound);
1026 CUTE_SOUND_FREE(wav, NULL);
1027 return sound;
1028 }
1029
1030 #endif
1031
1032 // If stb_vorbis was included *before* cute_sound go ahead and create
1033 // some functions for dealing with OGG files.
1034 #ifdef STB_VORBIS_INCLUDE_STB_VORBIS_H
1035
1036 void cs_read_mem_ogg(const void* memory, int length, cs_loaded_sound_t* sound)
1037 {
1038 int16_t* samples = 0;
1039 int channel_count;
1040 int sample_count = stb_vorbis_decode_memory((const unsigned char*)memory, length, &channel_count, &sound->sample_rate, &samples);
1041
1042 CUTE_SOUND_CHECK(sample_count > 0, "stb_vorbis_decode_memory failed. Make sure your file exists and is a valid OGG file.");
1043
1044 {
1045 int wide_count = (int)CUTE_SOUND_ALIGN(sample_count, 4) / 4;
1046 int wide_offset = sample_count & 3;
1047 float* sample = (float*)alloca(sizeof(float) * 4 + 16);
1048 sample = (float*)CUTE_SOUND_ALIGN(sample, 16);
1049 cs__m128* a;
1050 cs__m128* b;
1051
1052 switch (channel_count)
1053 {
1054 case 1:
1055 {
1056 a = (cs__m128*)cs_malloc16(wide_count * sizeof(cs__m128), NULL);
1057 b = 0;
1058
1059 for (int i = 0, j = 0; i < wide_count - 1; ++i, j += 4)
1060 {
1061 sample[0] = (float)samples[j];
1062 sample[1] = (float)samples[j + 1];
1063 sample[2] = (float)samples[j + 2];
1064 sample[3] = (float)samples[j + 3];
1065 a[i] = cs_mm_load_ps(sample);
1066 }
1067
1068 cs_last_element(a, wide_count - 1, (wide_count - 1) * 4, samples, wide_offset);
1069 } break;
1070
1071 case 2:
1072 a = (cs__m128*)cs_malloc16(wide_count * sizeof(cs__m128) * 2, NULL);
1073 b = a + wide_count;
1074
1075 for (int i = 0, j = 0; i < wide_count - 1; ++i, j += 8)
1076 {
1077 sample[0] = (float)samples[j];
1078 sample[1] = (float)samples[j + 2];
1079 sample[2] = (float)samples[j + 4];
1080 sample[3] = (float)samples[j + 6];
1081 a[i] = cs_mm_load_ps(sample);
1082
1083 sample[0] = (float)samples[j + 1];
1084 sample[1] = (float)samples[j + 3];
1085 sample[2] = (float)samples[j + 5];
1086 sample[3] = (float)samples[j + 7];
1087 b[i] = cs_mm_load_ps(sample);
1088 }
1089
1090 cs_last_element(a, wide_count - 1, (wide_count - 1) * 4, samples, wide_offset);
1091 cs_last_element(b, wide_count - 1, (wide_count - 1) * 4 + 4, samples, wide_offset);
1092 break;
1093
1094 default:
1095 CUTE_SOUND_CHECK(0, "Unsupported channel count.");
1096 }
1097
1098 sound->sample_count = sample_count;
1099 sound->channel_count = channel_count;
1100 sound->channels[0] = a;
1101 sound->channels[1] = b;
1102 sound->playing_count = 0;
1103 free(samples);
1104 }
1105 return;
1106
1107 ts_err:
1108 free(samples);
1109 memset(sound, 0, sizeof(cs_loaded_sound_t));
1110 }
1111
1112 cs_loaded_sound_t cs_load_ogg(const char* path)
1113 {
1114 int length;
1115 void* memory = cs_read_file_to_memory(path, &length, NULL);
1116 cs_loaded_sound_t sound = { 0, 0, 0, 0, { NULL, NULL } };
1117 cs_read_mem_ogg(memory, length, &sound);
1118 CUTE_SOUND_FREE(memory, NULL);
1119
1120 return sound;
1121 }
1122
1123 #if CUTE_SOUND_PLATFORM == CUTE_SOUND_SDL && defined(SDL_rwops_h_) && defined(CUTE_SOUND_SDL_RWOPS)
1124
1125 cs_loaded_sound_t cs_load_ogg_rw(SDL_RWops* rw)
1126 {
1127 int length;
1128 void* memory = cs_read_rw_to_memory(rw, &length, NULL);
1129 cs_loaded_sound_t sound = { 0 };
1130 cs_read_mem_ogg(memory, length, &sound);
1131 CUTE_SOUND_FREE(memory, NULL);
1132
1133 return sound;
1134 }
1135
1136 #endif
1137
1138 #endif
1139
1140 void cs_free_sound(cs_loaded_sound_t* sound)
1141 {
1142 cs_free16(sound->channels[0], NULL);
1143 memset(sound, 0, sizeof(cs_loaded_sound_t));
1144 }
1145
1146 int cs_sound_size(cs_loaded_sound_t* sound)
1147 {
1148 return sound->sample_count * sound->channel_count * sizeof(uint16_t);
1149 }
1150
1151 cs_playing_sound_t cs_make_playing_sound(cs_loaded_sound_t* loaded)
1152 {
1153 cs_playing_sound_t playing;
1154 playing.active = 0;
1155 playing.paused = 0;
1156 playing.looped = 0;
1157 playing.volume0 = 1.0f;
1158 playing.volume1 = 1.0f;
1159 playing.pan0 = 0.5f;
1160 playing.pan1 = 0.5f;
1161 playing.sample_index = 0;
1162 playing.loaded_sound = loaded;
1163 playing.next = 0;
1164 for (int i = 0; i < CUTE_SOUND_PLUGINS_MAX; ++i) playing.plugin_udata[i] = NULL;
1165 return playing;
1166 }
1167
1168 int cs_is_active(cs_playing_sound_t* sound)
1169 {
1170 return sound->active;
1171 }
1172
1173 void cs_stop_sound(cs_playing_sound_t* sound)
1174 {
1175 sound->loaded_sound = 0;
1176 sound->active = 0;
1177 }
1178
1179 void cs_loop_sound(cs_playing_sound_t* sound, int zero_for_no_loop)
1180 {
1181 sound->looped = zero_for_no_loop;
1182 }
1183
1184 void cs_pause_sound(cs_playing_sound_t* sound, int one_for_paused)
1185 {
1186 sound->paused = one_for_paused;
1187 }
1188
1189 void cs_set_pan(cs_playing_sound_t* sound, float pan)
1190 {
1191 if (pan > 1.0f) pan = 1.0f;
1192 else if (pan < 0.0f) pan = 0.0f;
1193 float left = 1.0f - pan;
1194 float right = pan;
1195 sound->pan0 = left;
1196 sound->pan1 = right;
1197 }
1198
1199 void cs_set_volume(cs_playing_sound_t* sound, float volume_left, float volume_right)
1200 {
1201 if (volume_left < 0.0f) volume_left = 0.0f;
1202 if (volume_right < 0.0f) volume_right = 0.0f;
1203 sound->volume0 = volume_left;
1204 sound->volume1 = volume_right;
1205 }
1206
1207 #if CUTE_SOUND_PLATFORM == CUTE_SOUND_WINDOWS
1208
1209 void cs_sleep(int milliseconds)
1210 {
1211 Sleep(milliseconds);
1212 }
1213
1214 struct cs_context_t
1215 {
1216 unsigned latency_samples;
1217 unsigned running_index;
1218 int Hz;
1219 int bps;
1220 int buffer_size;
1221 int wide_count;
1222 cs_playing_sound_t* playing;
1223 cs__m128* floatA;
1224 cs__m128* floatB;
1225 cs__m128i* samples;
1226 cs_playing_sound_t* playing_pool;
1227 cs_playing_sound_t* playing_free;
1228
1229 // platform specific stuff
1230 LPDIRECTSOUND dsound;
1231 LPDIRECTSOUNDBUFFER buffer;
1232 LPDIRECTSOUNDBUFFER primary;
1233
1234 // data for cs_mix thread, enable these with cs_spawn_mix_thread
1235 CRITICAL_SECTION critical_section;
1236 int separate_thread;
1237 int running;
1238 int sleep_milliseconds;
1239
1240 int plugin_count;
1241 cs_plugin_interface_t plugins[CUTE_SOUND_PLUGINS_MAX];
1242
1243 void* mem_ctx;
1244 };
1245
1246 static void cs_release_context(cs_context_t* ctx)
1247 {
1248 DeleteCriticalSection(&ctx->critical_section);
1249 #ifdef __cplusplus
1250 ctx->buffer->Release();
1251 ctx->primary->Release();
1252 ctx->dsound->Release();
1253 #else
1254 ctx->buffer->lpVtbl->Release(ctx->buffer);
1255 ctx->primary->lpVtbl->Release(ctx->primary);
1256 ctx->dsound->lpVtbl->Release(ctx->dsound);
1257 #endif
1258 cs_playing_sound_t* playing = ctx->playing;
1259 while (playing)
1260 {
1261 for (int i = 0; i < ctx->plugin_count; ++i)
1262 {
1263 cs_plugin_interface_t* plugin = ctx->plugins + i;
1264 plugin->on_free_playing_sound_fn(ctx, plugin->plugin_instance, playing->plugin_udata[i], playing);
1265 }
1266 playing = playing->next;
1267 }
1268
1269 CUTE_SOUND_FREE(ctx, ctx->mem_ctx);
1270 }
1271
1272 static DWORD WINAPI cs_ctx_thread(LPVOID lpParameter)
1273 {
1274 cs_context_t* ctx = (cs_context_t*)lpParameter;
1275
1276 while (ctx->running)
1277 {
1278 cs_mix(ctx);
1279 if (ctx->sleep_milliseconds) cs_sleep(ctx->sleep_milliseconds);
1280 else YieldProcessor();
1281 }
1282
1283 ctx->separate_thread = 0;
1284 return 0;
1285 }
1286
1287 void cs_lock(cs_context_t* ctx)
1288 {
1289 EnterCriticalSection(&ctx->critical_section);
1290 }
1291
1292 void cs_unlock(cs_context_t* ctx)
1293 {
1294 LeaveCriticalSection(&ctx->critical_section);
1295 }
1296
1297 cs_context_t* cs_make_context(void* hwnd, unsigned play_frequency_in_Hz, int buffered_samples, int playing_pool_count, void* user_allocator_ctx)
1298 {
1299 buffered_samples = buffered_samples < CUTE_SOUND_MINIMUM_BUFFERED_SAMPLES ? CUTE_SOUND_MINIMUM_BUFFERED_SAMPLES : buffered_samples;
1300 int bps = sizeof(INT16) * 2;
1301 int buffer_size = buffered_samples * bps;
1302 cs_context_t* ctx = 0;
1303 WAVEFORMATEX format = { 0, 0, 0, 0, 0, 0, 0 };
1304 DSBUFFERDESC bufdesc = { 0, 0, 0, 0, 0, { 0, 0, 0, 0 } };
1305 LPDIRECTSOUND dsound;
1306
1307 CUTE_SOUND_CHECK(hwnd, "Invalid hwnd passed to cs_make_context.");
1308 {
1309 HRESULT res = DirectSoundCreate(0, &dsound, 0);
1310 CUTE_SOUND_CHECK(res == DS_OK, "DirectSoundCreate failed");
1311 #ifdef __cplusplus
1312 dsound->SetCooperativeLevel((HWND)hwnd, DSSCL_PRIORITY);
1313 #else
1314 dsound->lpVtbl->SetCooperativeLevel(dsound, (HWND)hwnd, DSSCL_PRIORITY);
1315 #endif
1316 bufdesc.dwSize = sizeof(bufdesc);
1317 bufdesc.dwFlags = DSBCAPS_PRIMARYBUFFER;
1318
1319 LPDIRECTSOUNDBUFFER primary_buffer;
1320 #ifdef __cplusplus
1321 res = dsound->CreateSoundBuffer(&bufdesc, &primary_buffer, 0);
1322 #else
1323 res = dsound->lpVtbl->CreateSoundBuffer(dsound, &bufdesc, &primary_buffer, 0);
1324 #endif
1325 CUTE_SOUND_CHECK(res == DS_OK, "Failed to create primary sound buffer");
1326
1327 format.wFormatTag = WAVE_FORMAT_PCM;
1328 format.nChannels = 2;
1329 format.nSamplesPerSec = play_frequency_in_Hz;
1330 format.wBitsPerSample = 16;
1331 format.nBlockAlign = (format.nChannels * format.wBitsPerSample) / 8;
1332 format.nAvgBytesPerSec = format.nSamplesPerSec * format.nBlockAlign;
1333 format.cbSize = 0;
1334 #ifdef __cplusplus
1335 res = primary_buffer->SetFormat(&format);
1336 #else
1337 res = primary_buffer->lpVtbl->SetFormat(primary_buffer, &format);
1338 #endif
1339 CUTE_SOUND_CHECK(res == DS_OK, "Failed to set format on primary buffer");
1340
1341 LPDIRECTSOUNDBUFFER secondary_buffer;
1342 bufdesc.dwSize = sizeof(bufdesc);
1343 bufdesc.dwFlags = 0;
1344 bufdesc.dwBufferBytes = buffer_size;
1345 bufdesc.lpwfxFormat = &format;
1346 #ifdef __cplusplus
1347 res = dsound->CreateSoundBuffer(&bufdesc, &secondary_buffer, 0);
1348 #else
1349 res = dsound->lpVtbl->CreateSoundBuffer(dsound, &bufdesc, &secondary_buffer, 0);
1350 #endif
1351 CUTE_SOUND_CHECK(res == DS_OK, "Failed to set format on secondary buffer");
1352
1353 int sample_count = buffered_samples;
1354 int wide_count = (int)CUTE_SOUND_ALIGN(sample_count, 4);
1355 int pool_size = playing_pool_count * sizeof(cs_playing_sound_t);
1356 int mix_buffers_size = sizeof(cs__m128) * wide_count * 2;
1357 int sample_buffer_size = sizeof(cs__m128i) * wide_count;
1358 ctx = (cs_context_t*)CUTE_SOUND_ALLOC(sizeof(cs_context_t) + mix_buffers_size + sample_buffer_size + 16 + pool_size, user_allocator_ctx);
1359 ctx->latency_samples = 4096;
1360 ctx->running_index = 0;
1361 ctx->Hz = play_frequency_in_Hz;
1362 ctx->bps = bps;
1363 ctx->buffer_size = buffer_size;
1364 ctx->wide_count = wide_count;
1365 ctx->dsound = dsound;
1366 ctx->buffer = secondary_buffer;
1367 ctx->primary = primary_buffer;
1368 ctx->playing = 0;
1369 ctx->floatA = (cs__m128*)(ctx + 1);
1370 ctx->floatA = (cs__m128*)CUTE_SOUND_ALIGN(ctx->floatA, 16);
1371 CUTE_SOUND_ASSERT(!((size_t)ctx->floatA & 15));
1372 ctx->floatB = ctx->floatA + wide_count;
1373 ctx->samples = (cs__m128i*)ctx->floatB + wide_count;
1374 ctx->running = 1;
1375 ctx->separate_thread = 0;
1376 ctx->sleep_milliseconds = 0;
1377 ctx->plugin_count = 0;
1378 ctx->mem_ctx = user_allocator_ctx;
1379 InitializeCriticalSectionAndSpinCount(&ctx->critical_section, 0x00000400);
1380
1381 if (playing_pool_count)
1382 {
1383 ctx->playing_pool = (cs_playing_sound_t*)(ctx->samples + wide_count);
1384 for (int i = 0; i < playing_pool_count - 1; ++i)
1385 ctx->playing_pool[i].next = ctx->playing_pool + i + 1;
1386 ctx->playing_pool[playing_pool_count - 1].next = 0;
1387 ctx->playing_free = ctx->playing_pool;
1388
1389 }
1390
1391 else
1392 {
1393 ctx->playing_pool = 0;
1394 ctx->playing_free = 0;
1395 }
1396
1397 return ctx;
1398 }
1399
1400 ts_err:
1401 CUTE_SOUND_FREE(ctx, ctx->mem_ctx);
1402 return 0;
1403 }
1404
1405 void cs_spawn_mix_thread(cs_context_t* ctx)
1406 {
1407 if (ctx->separate_thread) return;
1408 ctx->separate_thread = 1;
1409 CreateThread(0, 0, cs_ctx_thread, ctx, 0, 0);
1410 }
1411
1412 #elif CUTE_SOUND_PLATFORM == CUTE_SOUND_APPLE
1413
1414 void cs_sleep(int milliseconds)
1415 {
1416 struct timespec ts = { 0, milliseconds * 1000000 };
1417 nanosleep(&ts, NULL);
1418 }
1419
1420 struct cs_context_t
1421 {
1422 unsigned latency_samples;
1423 unsigned index0; // read
1424 unsigned index1; // write
1425 unsigned samples_in_circular_buffer;
1426 int Hz;
1427 int bps;
1428 int wide_count;
1429 int sample_count;
1430 cs_playing_sound_t* playing;
1431 cs__m128* floatA;
1432 cs__m128* floatB;
1433 cs__m128i* samples;
1434 cs_playing_sound_t* playing_pool;
1435 cs_playing_sound_t* playing_free;
1436
1437 // platform specific stuff
1438 AudioComponentInstance inst;
1439
1440 // data for cs_mix thread, enable these with cs_spawn_mix_thread
1441 pthread_t thread;
1442 pthread_mutex_t mutex;
1443 int separate_thread;
1444 int running;
1445 int sleep_milliseconds;
1446
1447 int plugin_count;
1448 cs_plugin_interface_t plugins[CUTE_SOUND_PLUGINS_MAX];
1449
1450 void* mem_ctx;
1451 };
1452
1453 static void cs_release_context(cs_context_t* ctx)
1454 {
1455 pthread_mutex_destroy(&ctx->mutex);
1456 AudioOutputUnitStop(ctx->inst);
1457 AudioUnitUninitialize(ctx->inst);
1458 AudioComponentInstanceDispose(ctx->inst);
1459 cs_playing_sound_t* playing = ctx->playing;
1460 while (playing)
1461 {
1462 for (int i = 0; i < ctx->plugin_count; ++i)
1463 {
1464 cs_plugin_interface_t* plugin = ctx->plugins + i;
1465 plugin->on_free_playing_sound_fn(ctx, plugin->plugin_instance, playing->plugin_udata[i], playing);
1466 }
1467 playing = playing->next;
1468 }
1469
1470 CUTE_SOUND_FREE(ctx, ctx->mem_ctx);
1471 }
1472
1473 static void* cs_ctx_thread(void* udata)
1474 {
1475 cs_context_t* ctx = (cs_context_t*)udata;
1476
1477 while (ctx->running)
1478 {
1479 printf("Entering mix...\n");
1480 cs_mix(ctx);
1481 if (ctx->sleep_milliseconds) cs_sleep(ctx->sleep_milliseconds);
1482 else pthread_yield_np();
1483 }
1484
1485 ctx->separate_thread = 0;
1486 pthread_exit(0);
1487 return 0;
1488 }
1489
1490 void cs_lock(cs_context_t* ctx)
1491 {
1492 pthread_mutex_lock(&ctx->mutex);
1493 }
1494
1495 void cs_unlock(cs_context_t* ctx)
1496 {
1497 pthread_mutex_unlock(&ctx->mutex);
1498 }
1499
1500 static OSStatus cs_memcpy_to_coreaudio(void* udata, AudioUnitRenderActionFlags* ioActionFlags, const AudioTimeStamp* inTimeStamp, UInt32 inBusNumber, UInt32 inNumberFrames, AudioBufferList* ioData);
1501
1502 cs_context_t* cs_make_context(void* unused, unsigned play_frequency_in_Hz, int buffered_samples, int playing_pool_count, void* user_allocator_ctx)
1503 {
1504 buffered_samples = buffered_samples < CUTE_SOUND_MINIMUM_BUFFERED_SAMPLES ? CUTE_SOUND_MINIMUM_BUFFERED_SAMPLES : buffered_samples;
1505 int bps = sizeof(uint16_t) * 2;
1506
1507 AudioComponentDescription comp_desc = { 0 };
1508 comp_desc.componentType = kAudioUnitType_Output;
1509 comp_desc.componentSubType = kAudioUnitSubType_DefaultOutput;
1510 comp_desc.componentFlags = 0;
1511 comp_desc.componentFlagsMask = 0;
1512 comp_desc.componentManufacturer = kAudioUnitManufacturer_Apple;
1513
1514 AudioComponent comp = AudioComponentFindNext(NULL, &comp_desc);
1515 if (!comp)
1516 {
1517 cs_error_reason = "Failed to create output unit from AudioComponentFindNext.";
1518 return 0;
1519 }
1520
1521 AudioStreamBasicDescription stream_desc = { 0 };
1522 stream_desc.mSampleRate = (double)play_frequency_in_Hz;
1523 stream_desc.mFormatID = kAudioFormatLinearPCM;
1524 stream_desc.mFormatFlags = kAudioFormatFlagIsSignedInteger | kAudioFormatFlagsNativeEndian | kAudioFormatFlagIsPacked;
1525 stream_desc.mFramesPerPacket = 1;
1526 stream_desc.mChannelsPerFrame = 2;
1527 stream_desc.mBitsPerChannel = sizeof(uint16_t) * 8;
1528 stream_desc.mBytesPerPacket = bps;
1529 stream_desc.mBytesPerFrame = bps;
1530 stream_desc.mReserved = 0;
1531
1532 AudioComponentInstance inst;
1533 OSStatus ret;
1534 AURenderCallbackStruct input;
1535
1536 ret = AudioComponentInstanceNew(comp, &inst);
1537
1538 int sample_count = buffered_samples;
1539 int wide_count = (int)CUTE_SOUND_ALIGN(sample_count, 4) / 4;
1540 int pool_size = playing_pool_count * sizeof(cs_playing_sound_t);
1541 int mix_buffers_size = sizeof(cs__m128) * wide_count * 2;
1542 int sample_buffer_size = sizeof(cs__m128i) * wide_count;
1543 cs_context_t* ctx = (cs_context_t*)CUTE_SOUND_ALLOC(sizeof(cs_context_t) + mix_buffers_size + sample_buffer_size + 16 + pool_size, user_allocator_ctx);
1544 CUTE_SOUND_CHECK(ret == noErr, "AudioComponentInstanceNew failed");
1545 ctx->latency_samples = 4096;
1546 ctx->index0 = 0;
1547 ctx->index1 = 0;
1548 ctx->samples_in_circular_buffer = 0;
1549 ctx->Hz = play_frequency_in_Hz;
1550 ctx->bps = bps;
1551 ctx->wide_count = wide_count;
1552 ctx->sample_count = wide_count * 4;
1553 ctx->inst = inst;
1554 ctx->playing = 0;
1555 ctx->floatA = (cs__m128*)(ctx + 1);
1556 ctx->floatA = (cs__m128*)CUTE_SOUND_ALIGN(ctx->floatA, 16);
1557 CUTE_SOUND_ASSERT(!((size_t)ctx->floatA & 15));
1558 ctx->floatB = ctx->floatA + wide_count;
1559 ctx->samples = (cs__m128i*)ctx->floatB + wide_count;
1560 ctx->running = 1;
1561 ctx->separate_thread = 0;
1562 ctx->sleep_milliseconds = 0;
1563 ctx->plugin_count = 0;
1564 ctx->mem_ctx = user_allocator_ctx;
1565
1566 ret = AudioUnitSetProperty(inst, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, 0, &stream_desc, sizeof(stream_desc));
1567 CUTE_SOUND_CHECK(ret == noErr, "Failed to set stream forat");
1568
1569 input.inputProc = cs_memcpy_to_coreaudio;
1570 input.inputProcRefCon = ctx;
1571 ret = AudioUnitSetProperty(inst, kAudioUnitProperty_SetRenderCallback, kAudioUnitScope_Input, 0, &input, sizeof(input));
1572 CUTE_SOUND_CHECK(ret == noErr, "AudioUnitSetProperty failed");
1573
1574 ret = AudioUnitInitialize(inst);
1575 CUTE_SOUND_CHECK(ret == noErr, "Couldn't initialize output unit");
1576
1577 ret = AudioOutputUnitStart(inst);
1578 CUTE_SOUND_CHECK(ret == noErr, "Couldn't start output unit");
1579 pthread_mutex_init(&ctx->mutex, NULL);
1580
1581 if (playing_pool_count)
1582 {
1583 ctx->playing_pool = (cs_playing_sound_t*)(ctx->samples + wide_count);
1584 for (int i = 0; i < playing_pool_count - 1; ++i)
1585 ctx->playing_pool[i].next = ctx->playing_pool + i + 1;
1586 ctx->playing_pool[playing_pool_count - 1].next = 0;
1587 ctx->playing_free = ctx->playing_pool;
1588 }
1589
1590 else
1591 {
1592 ctx->playing_pool = 0;
1593 ctx->playing_free = 0;
1594 }
1595
1596 return ctx;
1597
1598 ts_err:
1599 CUTE_SOUND_FREE(ctx, ctx->mem_ctx);
1600 return 0;
1601 }
1602
1603 void cs_spawn_mix_thread(cs_context_t* ctx)
1604 {
1605 if (ctx->separate_thread) return;
1606 ctx->separate_thread = 1;
1607 pthread_create(&ctx->thread, 0, cs_ctx_thread, ctx);
1608 }
1609
1610 #elif CUTE_SOUND_PLATFORM == CUTE_SOUND_LINUX
1611
1612 void cs_sleep(int milliseconds)
1613 {
1614 struct timespec ts = { 0, milliseconds * 1000000 };
1615 nanosleep(&ts, NULL);
1616 }
1617
1618 // Load up ALSA functions manually, so nobody has to deal with compiler linker flags.
1619 typedef struct cs_pcm_functions_t
1620 {
1621 int (*snd_pcm_open)(snd_pcm_t**, const char*, snd_pcm_stream_t, int);
1622 int (*snd_pcm_close)(snd_pcm_t* pcm);
1623 int (*snd_pcm_hw_params_any)(snd_pcm_t*, snd_pcm_hw_params_t*);
1624 int (*snd_pcm_hw_params_set_access)(snd_pcm_t*, snd_pcm_hw_params_t*, snd_pcm_access_t);
1625 int (*snd_pcm_hw_params_set_format)(snd_pcm_t*, snd_pcm_hw_params_t*, snd_pcm_format_t);
1626 int (*snd_pcm_hw_params_set_rate_near)(snd_pcm_t*, snd_pcm_hw_params_t*, unsigned int*, int*);
1627 int (*snd_pcm_hw_params_set_channels)(snd_pcm_t*, snd_pcm_hw_params_t*, unsigned int);
1628 int (*snd_pcm_hw_params_set_period_size_near)(snd_pcm_t*, snd_pcm_hw_params_t*, snd_pcm_uframes_t*, int*);
1629 int (*snd_pcm_hw_params_set_periods_min)(snd_pcm_t*, snd_pcm_hw_params_t*, unsigned int*, int*);
1630 int (*snd_pcm_hw_params_set_periods_first)(snd_pcm_t*, snd_pcm_hw_params_t*, unsigned int*, int*);
1631 int (*snd_pcm_hw_params)(snd_pcm_t*, snd_pcm_hw_params_t*);
1632 int (*snd_pcm_sw_params_current)(snd_pcm_t*, snd_pcm_sw_params_t*);
1633 int (*snd_pcm_sw_params_set_avail_min)(snd_pcm_t*, snd_pcm_sw_params_t*, snd_pcm_uframes_t);
1634 int (*snd_pcm_sw_params_set_start_threshold)(snd_pcm_t*, snd_pcm_sw_params_t*, snd_pcm_uframes_t);
1635 int (*snd_pcm_sw_params)(snd_pcm_t*, snd_pcm_sw_params_t*);
1636 snd_pcm_sframes_t (*snd_pcm_avail)(snd_pcm_t*);
1637 snd_pcm_sframes_t (*snd_pcm_writei)(snd_pcm_t*, const void*, snd_pcm_uframes_t);
1638 size_t (*snd_pcm_hw_params_sizeof)(void);
1639 size_t (*snd_pcm_sw_params_sizeof)(void);
1640 int (*snd_pcm_drain)(snd_pcm_t*);
1641 int (*snd_pcm_recover)(snd_pcm_t*, int, int);
1642 } cs_pcm_functions_t;
1643
1644 #define CUTE_SOUND_DLSYM(fn) \
1645 do { \
1646 void* ptr = dlsym(handle, #fn); \
1647 assert(ptr); \
1648 memcpy(&fns->fn, &ptr, sizeof(void*)); \
1649 } while (0)
1650
1651 static void* cs_load_alsa_functions(cs_pcm_functions_t* fns)
1652 {
1653 void* handle = dlopen("libasound.so", RTLD_NOW);
1654 if (!handle) return NULL;
1655
1656 memset(fns, 0, sizeof(*fns));
1657
1658 CUTE_SOUND_DLSYM(snd_pcm_open);
1659 CUTE_SOUND_DLSYM(snd_pcm_close);
1660 CUTE_SOUND_DLSYM(snd_pcm_hw_params_any);
1661 CUTE_SOUND_DLSYM(snd_pcm_hw_params_set_access);
1662 CUTE_SOUND_DLSYM(snd_pcm_hw_params_set_format);
1663 CUTE_SOUND_DLSYM(snd_pcm_hw_params_set_rate_near);
1664 CUTE_SOUND_DLSYM(snd_pcm_hw_params_set_format);
1665 CUTE_SOUND_DLSYM(snd_pcm_hw_params_set_channels);
1666 CUTE_SOUND_DLSYM(snd_pcm_hw_params_set_period_size_near);
1667 CUTE_SOUND_DLSYM(snd_pcm_hw_params_set_periods_min);
1668 CUTE_SOUND_DLSYM(snd_pcm_hw_params_set_periods_first);
1669 CUTE_SOUND_DLSYM(snd_pcm_hw_params);
1670 CUTE_SOUND_DLSYM(snd_pcm_sw_params);
1671 CUTE_SOUND_DLSYM(snd_pcm_sw_params_current);
1672 CUTE_SOUND_DLSYM(snd_pcm_sw_params_set_avail_min);
1673 CUTE_SOUND_DLSYM(snd_pcm_sw_params_set_start_threshold);
1674 CUTE_SOUND_DLSYM(snd_pcm_avail);
1675 CUTE_SOUND_DLSYM(snd_pcm_writei);
1676 CUTE_SOUND_DLSYM(snd_pcm_hw_params_sizeof);
1677 CUTE_SOUND_DLSYM(snd_pcm_sw_params_sizeof);
1678 CUTE_SOUND_DLSYM(snd_pcm_drain);
1679 CUTE_SOUND_DLSYM(snd_pcm_recover);
1680
1681 return handle;
1682 }
1683
1684 struct cs_context_t
1685 {
1686 unsigned latency_samples;
1687 unsigned index0; // read
1688 unsigned index1; // write
1689 unsigned samples_in_circular_buffer;
1690 int Hz;
1691 int bps;
1692 int buffer_size;
1693 int wide_count;
1694 int sample_count;
1695 cs_playing_sound_t* playing;
1696 cs__m128* floatA;
1697 cs__m128* floatB;
1698 cs__m128i* samples;
1699 cs_playing_sound_t* playing_pool;
1700 cs_playing_sound_t* playing_free;
1701
1702 // Platform specific stuff.
1703 snd_pcm_t* pcm_handle;
1704 cs_pcm_functions_t fns;
1705 void *alsa_so;
1706
1707 // data for cs_mix thread, enable these with cs_spawn_mix_thread
1708 pthread_t thread;
1709 pthread_mutex_t mutex;
1710 int separate_thread;
1711 int running;
1712 int sleep_milliseconds;
1713
1714 int plugin_count;
1715 cs_plugin_interface_t plugins[CUTE_SOUND_PLUGINS_MAX];
1716
1717 void* mem_ctx;
1718 };
1719
1720 static void cs_release_context(cs_context_t* ctx)
1721 {
1722 pthread_mutex_destroy(&ctx->mutex);
1723 cs_playing_sound_t* playing = ctx->playing;
1724 while (playing)
1725 {
1726 for (int i = 0; i < ctx->plugin_count; ++i)
1727 {
1728 cs_plugin_interface_t* plugin = ctx->plugins + i;
1729 plugin->on_free_playing_sound_fn(ctx, plugin->plugin_instance, playing->plugin_udata[i], playing);
1730 }
1731 playing = playing->next;
1732 }
1733 ctx->fns.snd_pcm_drain(ctx->pcm_handle);
1734 ctx->fns.snd_pcm_close(ctx->pcm_handle);
1735 dlclose(ctx->alsa_so);
1736
1737 CUTE_SOUND_FREE(ctx, ctx->mem_ctx);
1738 }
1739
1740 int cs_ctx_thread(void* udata)
1741 {
1742 cs_context_t* ctx = (cs_context_t*)udata;
1743
1744 while (ctx->running)
1745 {
1746 cs_mix(ctx);
1747 if (ctx->sleep_milliseconds) cs_sleep(ctx->sleep_milliseconds);
1748 else cs_sleep(1);
1749 }
1750
1751 ctx->separate_thread = 0;
1752 return 0;
1753 }
1754
1755 void cs_lock(cs_context_t* ctx)
1756 {
1757 pthread_mutex_lock(&ctx->mutex);
1758 }
1759
1760 void cs_unlock(cs_context_t* ctx)
1761 {
1762 pthread_mutex_unlock(&ctx->mutex);
1763 }
1764
1765 cs_context_t* cs_make_context(void* unused, unsigned play_frequency_in_Hz, int buffered_samples, int playing_pool_count, void* user_allocator_ctx)
1766 {
1767 buffered_samples = buffered_samples < CUTE_SOUND_MINIMUM_BUFFERED_SAMPLES ? CUTE_SOUND_MINIMUM_BUFFERED_SAMPLES : buffered_samples;
1768 (void)unused;
1769 int sample_count = buffered_samples;
1770 int bps;
1771 int wide_count;
1772 int pool_size;
1773 int mix_buffers_size;
1774 int sample_buffer_size;
1775 int res;
1776 cs_context_t* ctx = NULL;
1777
1778 // Platform specific things.
1779 snd_pcm_t* pcm_handle;
1780 cs_pcm_functions_t fns;
1781 snd_pcm_uframes_t period_size;
1782 const char* default_device = "hw:0,0";
1783 unsigned int periods = 2;
1784 int dir = 0;
1785 snd_pcm_hw_params_t *hw_params = NULL;
1786 snd_pcm_sw_params_t *sw_params = NULL;
1787
1788 // This hack is necessary for some inline'd code in ALSA's headers that tries to
1789 // call these sizeof functions, which we are loading into the cute sound context manually.
1790 #define snd_pcm_hw_params_sizeof fns.snd_pcm_hw_params_sizeof
1791 #define snd_pcm_sw_params_sizeof fns.snd_pcm_sw_params_sizeof
1792
1793 void* alsa_so = cs_load_alsa_functions(&fns);
1794 CUTE_SOUND_CHECK(alsa_so, "Unable to load ALSA functions from shared library.");
1795 printf("%p\n", fns.snd_pcm_open);
1796 res = fns.snd_pcm_open(&pcm_handle, default_device, SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK);
1797 CUTE_SOUND_CHECK(res >= 0, "Failed to open default audio device.");
1798 snd_pcm_hw_params_alloca(&hw_params);
1799 res = fns.snd_pcm_hw_params_any(pcm_handle, hw_params);
1800 CUTE_SOUND_CHECK(res >= 0, "Failed to set default parameters.");
1801 res = fns.snd_pcm_hw_params_set_access(pcm_handle, hw_params, SND_PCM_ACCESS_RW_INTERLEAVED);
1802 CUTE_SOUND_CHECK(res >= 0, "Only interleaved sample output is supported by cute_sound, and is not available.");
1803 res = fns.snd_pcm_hw_params_set_format(pcm_handle, hw_params, SND_PCM_FORMAT_S16_LE);
1804 CUTE_SOUND_CHECK(res >= 0, "Failed to set sample format.");
1805 res = fns.snd_pcm_hw_params_set_rate_near(pcm_handle, hw_params, (unsigned*)&play_frequency_in_Hz, &dir);
1806 CUTE_SOUND_CHECK(res >= 0, "Failed to set sample rate.");
1807 res = fns.snd_pcm_hw_params_set_channels(pcm_handle, hw_params, 2);
1808 CUTE_SOUND_CHECK(res >= 0, "Failed to set channel count.");
1809 period_size = (snd_pcm_uframes_t)sample_count;
1810 res = fns.snd_pcm_hw_params_set_period_size_near(pcm_handle, hw_params, &period_size, &dir);
1811 CUTE_SOUND_CHECK(res >= 0, "Failed to set buffer size, likely not enough RAM for these settings.");
1812 res = fns.snd_pcm_hw_params_set_periods_min(pcm_handle, hw_params, &periods, &dir);
1813 CUTE_SOUND_CHECK(res >= 0, "Failed to set double buffering (min), likely not enough RAM for these settings.");
1814 res = fns.snd_pcm_hw_params_set_periods_first(pcm_handle, hw_params, &periods, &dir);
1815 CUTE_SOUND_CHECK(res >= 0, "Failed to set double buffering (first), likely not enough RAM for these settings.");
1816 res = fns.snd_pcm_hw_params(pcm_handle, hw_params);
1817 CUTE_SOUND_CHECK(res >= 0, "Failed to send hardware parameters to the driver.");
1818 snd_pcm_sw_params_alloca(&sw_params);
1819 CUTE_SOUND_CHECK(res >= 0, "Failed to allocate software parameters.");
1820 res = fns.snd_pcm_sw_params_current(pcm_handle, sw_params);
1821 CUTE_SOUND_CHECK(res >= 0, "Failed to initialize software parameters.");
1822 res = fns.snd_pcm_sw_params_set_avail_min(pcm_handle, sw_params, period_size);
1823 CUTE_SOUND_CHECK(res >= 0, "Failed to set minimum available count.");
1824 res = fns.snd_pcm_sw_params_set_start_threshold(pcm_handle, sw_params, 1);
1825 CUTE_SOUND_CHECK(res >= 0, "Failed to set start threshold.");
1826 res = fns.snd_pcm_sw_params(pcm_handle, sw_params);
1827 CUTE_SOUND_CHECK(res >= 0, "Failed to send software parameters to the driver.");
1828
1829 // Platform independent things.
1830 sample_count = (int)period_size;
1831 bps = sizeof(uint16_t) * 2;
1832 wide_count = (int)CUTE_SOUND_ALIGN(sample_count, 4) / 4;
1833 pool_size = playing_pool_count * sizeof(cs_playing_sound_t);
1834 mix_buffers_size = sizeof(cs__m128) * wide_count * 2;
1835 sample_buffer_size = sizeof(cs__m128i) * wide_count;
1836
1837 ctx = (cs_context_t*)CUTE_SOUND_ALLOC(sizeof(cs_context_t) + mix_buffers_size + sample_buffer_size + 16 + pool_size, user_allocator_ctx);
1838 CUTE_SOUND_CHECK(ctx != NULL, "Can't create audio context");
1839 ctx->latency_samples = 4096;
1840 ctx->index0 = 0;
1841 ctx->index1 = 0;
1842 ctx->samples_in_circular_buffer = 0;
1843 ctx->Hz = play_frequency_in_Hz;
1844 ctx->bps = bps;
1845 ctx->wide_count = wide_count;
1846 ctx->sample_count = wide_count * 4;
1847 ctx->playing = 0;
1848 ctx->floatA = (cs__m128*)(ctx + 1);
1849 ctx->floatA = (cs__m128*)CUTE_SOUND_ALIGN(ctx->floatA, 16);
1850 CUTE_SOUND_ASSERT(!((size_t)ctx->floatA & 15));
1851 ctx->floatB = ctx->floatA + wide_count;
1852 ctx->samples = (cs__m128i*)ctx->floatB + wide_count;
1853 ctx->running = 1;
1854 ctx->separate_thread = 0;
1855 ctx->sleep_milliseconds = 0;
1856 ctx->plugin_count = 0;
1857 ctx->mem_ctx = user_allocator_ctx;
1858
1859 // Platform dependent assignments.
1860 ctx->fns = fns;
1861 ctx->pcm_handle = pcm_handle;
1862 ctx->alsa_so = alsa_so;
1863 pthread_mutex_init(&ctx->mutex, NULL);
1864
1865 if (playing_pool_count)
1866 {
1867 ctx->playing_pool = (cs_playing_sound_t*)(ctx->samples + wide_count);
1868 for (int i = 0; i < playing_pool_count - 1; ++i)
1869 ctx->playing_pool[i].next = ctx->playing_pool + i + 1;
1870 ctx->playing_pool[playing_pool_count - 1].next = 0;
1871 ctx->playing_free = ctx->playing_pool;
1872 }
1873
1874 else
1875 {
1876 ctx->playing_pool = 0;
1877 ctx->playing_free = 0;
1878 }
1879
1880 return ctx;
1881
1882 ts_err:
1883 if (ctx) CUTE_SOUND_FREE(ctx, ctx->mem_ctx);
1884 return 0;
1885 }
1886
1887 void cs_spawn_mix_thread(cs_context_t* ctx)
1888 {
1889 if (ctx->separate_thread) return;
1890 ctx->separate_thread = 1;
1891 pthread_create(&ctx->thread, NULL, (void* (*)(void*))cs_ctx_thread, ctx);
1892 }
1893
1894 #elif CUTE_SOUND_PLATFORM == CUTE_SOUND_SDL
1895
1896 void cs_sleep(int milliseconds)
1897 {
1898 SDL_Delay(milliseconds);
1899 }
1900
1901 struct cs_context_t
1902 {
1903 unsigned latency_samples;
1904 unsigned index0; // read
1905 unsigned index1; // write
1906 unsigned samples_in_circular_buffer;
1907 int Hz;
1908 int bps;
1909 int buffer_size;
1910 int wide_count;
1911 int sample_count;
1912 cs_playing_sound_t* playing;
1913 cs__m128* floatA;
1914 cs__m128* floatB;
1915 cs__m128i* samples;
1916 cs_playing_sound_t* playing_pool;
1917 cs_playing_sound_t* playing_free;
1918 SDL_AudioDeviceID dev;
1919
1920 // data for cs_mix thread, enable these with cs_spawn_mix_thread
1921 SDL_Thread* thread;
1922 SDL_mutex* mutex;
1923 int separate_thread;
1924 int running;
1925 int sleep_milliseconds;
1926
1927 int plugin_count;
1928 cs_plugin_interface_t plugins[CUTE_SOUND_PLUGINS_MAX];
1929
1930 void* mem_ctx;
1931 };
1932
1933 static void cs_release_context(cs_context_t* ctx)
1934 {
1935 SDL_DestroyMutex(ctx->mutex);
1936 cs_playing_sound_t* playing = ctx->playing;
1937 while (playing)
1938 {
1939 for (int i = 0; i < ctx->plugin_count; ++i)
1940 {
1941 cs_plugin_interface_t* plugin = ctx->plugins + i;
1942 plugin->on_free_playing_sound_fn(ctx, plugin->plugin_instance, playing->plugin_udata[i], playing);
1943 }
1944 playing = playing->next;
1945 }
1946 SDL_CloseAudioDevice(ctx->dev);
1947
1948 CUTE_SOUND_FREE(ctx, ctx->mem_ctx);
1949 }
1950
1951 int cs_ctx_thread(void* udata)
1952 {
1953 cs_context_t* ctx = (cs_context_t*)udata;
1954
1955 while (ctx->running)
1956 {
1957 cs_mix(ctx);
1958 if (ctx->sleep_milliseconds) cs_sleep(ctx->sleep_milliseconds);
1959 else cs_sleep(1);
1960 }
1961
1962 ctx->separate_thread = 0;
1963 return 0;
1964 }
1965
1966 void cs_lock(cs_context_t* ctx)
1967 {
1968 SDL_LockMutex(ctx->mutex);
1969 }
1970
1971 void cs_unlock(cs_context_t* ctx)
1972 {
1973 SDL_UnlockMutex(ctx->mutex);
1974 }
1975
1976 static void cs_sdl_audio_callback(void* udata, Uint8* stream, int len);
1977
1978 cs_context_t* cs_make_context(void* unused, unsigned play_frequency_in_Hz, int buffered_samples, int playing_pool_count, void* user_allocator_ctx)
1979 {
1980 buffered_samples = buffered_samples < CUTE_SOUND_MINIMUM_BUFFERED_SAMPLES ? CUTE_SOUND_MINIMUM_BUFFERED_SAMPLES : buffered_samples;
1981 (void)unused;
1982 int bps = sizeof(uint16_t) * 2;
1983 int sample_count = buffered_samples;
1984 int wide_count = (int)CUTE_SOUND_ALIGN(sample_count, 4) / 4;
1985 int pool_size = playing_pool_count * sizeof(cs_playing_sound_t);
1986 int mix_buffers_size = sizeof(cs__m128) * wide_count * 2;
1987 int sample_buffer_size = sizeof(cs__m128i) * wide_count;
1988 cs_context_t* ctx = 0;
1989 SDL_AudioSpec wanted, have;
1990 int ret = SDL_InitSubSystem(SDL_INIT_AUDIO);
1991 CUTE_SOUND_CHECK(ret >= 0, "Can't init SDL audio");
1992
1993 ctx = (cs_context_t*)CUTE_SOUND_ALLOC(sizeof(cs_context_t) + mix_buffers_size + sample_buffer_size + 16 + pool_size, user_allocator_ctx);
1994 CUTE_SOUND_CHECK(ctx != NULL, "Can't create audio context");
1995 ctx->latency_samples = 4096;
1996 ctx->index0 = 0;
1997 ctx->index1 = 0;
1998 ctx->samples_in_circular_buffer = 0;
1999 ctx->Hz = play_frequency_in_Hz;
2000 ctx->bps = bps;
2001 ctx->wide_count = wide_count;
2002 ctx->sample_count = wide_count * 4;
2003 ctx->playing = 0;
2004 ctx->floatA = (cs__m128*)(ctx + 1);
2005 ctx->floatA = (cs__m128*)CUTE_SOUND_ALIGN(ctx->floatA, 16);
2006 CUTE_SOUND_ASSERT(!((size_t)ctx->floatA & 15));
2007 ctx->floatB = ctx->floatA + wide_count;
2008 ctx->samples = (cs__m128i*)ctx->floatB + wide_count;
2009 ctx->running = 1;
2010 ctx->separate_thread = 0;
2011 ctx->sleep_milliseconds = 0;
2012 ctx->plugin_count = 0;
2013 ctx->mem_ctx = user_allocator_ctx;
2014
2015 SDL_memset(&wanted, 0, sizeof(wanted));
2016 SDL_memset(&have, 0, sizeof(have));
2017 wanted.freq = play_frequency_in_Hz;
2018 wanted.format = AUDIO_S16SYS;
2019 wanted.channels = 2; /* 1 = mono, 2 = stereo */
2020 wanted.samples = buffered_samples;
2021 wanted.callback = cs_sdl_audio_callback;
2022 wanted.userdata = ctx;
2023 ctx->dev = SDL_OpenAudioDevice(NULL, 0, &wanted, &have, 0);
2024 CUTE_SOUND_CHECK(ctx->dev >= 0, "Can't open SDL audio");
2025 SDL_PauseAudioDevice(ctx->dev, 0);
2026 ctx->mutex = SDL_CreateMutex();
2027
2028 if (playing_pool_count)
2029 {
2030 ctx->playing_pool = (cs_playing_sound_t*)(ctx->samples + wide_count);
2031 for (int i = 0; i < playing_pool_count - 1; ++i)
2032 ctx->playing_pool[i].next = ctx->playing_pool + i + 1;
2033 ctx->playing_pool[playing_pool_count - 1].next = 0;
2034 ctx->playing_free = ctx->playing_pool;
2035 }
2036
2037 else
2038 {
2039 ctx->playing_pool = 0;
2040 ctx->playing_free = 0;
2041 }
2042
2043 return ctx;
2044
2045 ts_err:
2046 if (ctx) CUTE_SOUND_FREE(ctx, ctx->mem_ctx);
2047 return 0;
2048 }
2049
2050 void cs_spawn_mix_thread(cs_context_t* ctx)
2051 {
2052 if (ctx->separate_thread) return;
2053 ctx->separate_thread = 1;
2054 ctx->thread = SDL_CreateThread(&cs_ctx_thread, "CuteSoundThread", ctx);
2055 }
2056
2057 #endif // CUTE_SOUND_PLATFORM == CUTE_SOUND_***
2058
2059 // Platform-agnostic functions that access cs_context_t members go here.
2060
2061 cs_playing_sound_t* cs_get_playing(cs_context_t* ctx)
2062 {
2063 return ctx->playing;
2064 }
2065
2066 #if CUTE_SOUND_PLATFORM == CUTE_SOUND_SDL || CUTE_SOUND_PLATFORM == CUTE_SOUND_APPLE
2067
2068 static int cs_samples_written(cs_context_t* ctx)
2069 {
2070 return ctx->samples_in_circular_buffer;
2071 }
2072
2073 static int cs_samples_unwritten(cs_context_t* ctx)
2074 {
2075 return ctx->sample_count - ctx->samples_in_circular_buffer;
2076 }
2077
2078 static int cs_samples_to_mix(cs_context_t* ctx)
2079 {
2080 int lat = ctx->latency_samples;
2081 int written = cs_samples_written(ctx);
2082 int dif = lat - written;
2083 CUTE_SOUND_ASSERT(dif >= 0);
2084 if (dif)
2085 {
2086 int unwritten = cs_samples_unwritten(ctx);
2087 return dif < unwritten ? dif : unwritten;
2088 }
2089 return 0;
2090 }
2091
2092 #define CUTE_SOUND_SAMPLES_TO_BYTES(interleaved_sample_count) ((interleaved_sample_count) * ctx->bps)
2093 #define CUTE_SOUND_BYTES_TO_SAMPLES(byte_count) ((byte_count) / ctx->bps)
2094
2095 static void cs_push_bytes(cs_context_t* ctx, void* data, int size)
2096 {
2097 int index1 = ctx->index1;
2098 int samples_to_write = CUTE_SOUND_BYTES_TO_SAMPLES(size);
2099 int sample_count = ctx->sample_count;
2100
2101 int unwritten = cs_samples_unwritten(ctx);
2102 if (unwritten < samples_to_write) samples_to_write = unwritten;
2103 int samples_to_end = sample_count - index1;
2104
2105 if (samples_to_write > samples_to_end)
2106 {
2107 memcpy((char*)ctx->samples + CUTE_SOUND_SAMPLES_TO_BYTES(index1), data, CUTE_SOUND_SAMPLES_TO_BYTES(samples_to_end));
2108 memcpy(ctx->samples, (char*)data + CUTE_SOUND_SAMPLES_TO_BYTES(samples_to_end), size - CUTE_SOUND_SAMPLES_TO_BYTES(samples_to_end));
2109 ctx->index1 = (samples_to_write - samples_to_end) % sample_count;
2110 }
2111
2112 else
2113 {
2114 memcpy((char*)ctx->samples + CUTE_SOUND_SAMPLES_TO_BYTES(index1), data, size);
2115 ctx->index1 = (ctx->index1 + samples_to_write) % sample_count;
2116 }
2117
2118 ctx->samples_in_circular_buffer += samples_to_write;
2119 }
2120
2121 static int cs_pull_bytes(cs_context_t* ctx, void* dst, int size)
2122 {
2123 int index0 = ctx->index0;
2124 int allowed_size = CUTE_SOUND_SAMPLES_TO_BYTES(cs_samples_written(ctx));
2125 int sample_count = ctx->sample_count;
2126 int zeros = 0;
2127
2128 if (allowed_size < size)
2129 {
2130 zeros = size - allowed_size;
2131 size = allowed_size;
2132 }
2133
2134 int samples_to_read = CUTE_SOUND_BYTES_TO_SAMPLES(size);
2135 int samples_to_end = sample_count - index0;
2136
2137 if (samples_to_read > samples_to_end)
2138 {
2139 memcpy(dst, ((char*)ctx->samples) + CUTE_SOUND_SAMPLES_TO_BYTES(index0), CUTE_SOUND_SAMPLES_TO_BYTES(samples_to_end));
2140 memcpy(((char*)dst) + CUTE_SOUND_SAMPLES_TO_BYTES(samples_to_end), ctx->samples, size - CUTE_SOUND_SAMPLES_TO_BYTES(samples_to_end));
2141 ctx->index0 = (samples_to_read - samples_to_end) % sample_count;
2142 }
2143
2144 else
2145 {
2146 memcpy(dst, ((char*)ctx->samples) + CUTE_SOUND_SAMPLES_TO_BYTES(index0), size);
2147 ctx->index0 = (ctx->index0 + samples_to_read) % sample_count;
2148 }
2149
2150 ctx->samples_in_circular_buffer -= samples_to_read;
2151
2152 return zeros;
2153 }
2154
2155 #endif
2156
2157 void cs_shutdown_context(cs_context_t* ctx)
2158 {
2159 if (ctx->separate_thread)
2160 {
2161 cs_lock(ctx);
2162 ctx->running = 0;
2163 cs_unlock(ctx);
2164 }
2165
2166 while (ctx->separate_thread) cs_sleep(1);
2167 cs_release_context(ctx);
2168 }
2169
2170 void cs_thread_sleep_delay(cs_context_t* ctx, int milliseconds)
2171 {
2172 ctx->sleep_milliseconds = milliseconds;
2173 }
2174
2175 static void s_on_make_playing(cs_context_t* ctx, cs_playing_sound_t* sound)
2176 {
2177 for (int i = 0; i < ctx->plugin_count; ++i)
2178 {
2179 cs_plugin_interface_t* plugin = ctx->plugins + i;
2180 void* udata = NULL;
2181 plugin->on_make_playing_sound_fn(ctx, plugin->plugin_instance, &udata, sound);
2182 if (udata) sound->plugin_udata[i] = udata;
2183 }
2184 }
2185
2186 int cs_insert_sound(cs_context_t* ctx, cs_playing_sound_t* sound)
2187 {
2188 // Cannot use cs_playing_sound_t if cs_make_context was passed non-zero for playing_pool_count
2189 // since non-zero playing_pool_count means the context is doing some memory-management
2190 // for a playing sound pool. InsertSound assumes the pool does not exist, and is apart
2191 // of the lower-level API (see top of this header for documentation details).
2192 CUTE_SOUND_ASSERT(ctx->playing_pool == 0);
2193
2194 if (sound->active) return 0;
2195 cs_lock(ctx);
2196 sound->next = ctx->playing;
2197 ctx->playing = sound;
2198 sound->loaded_sound->playing_count += 1;
2199 sound->active = 1;
2200
2201 s_on_make_playing(ctx, sound);
2202
2203 cs_unlock(ctx);
2204
2205 return 1;
2206 }
2207
2208 // NOTE: does not allow delay_in_seconds to be negative (clamps at 0)
2209 void cs_set_delay(cs_context_t* ctx, cs_playing_sound_t* sound, float delay_in_seconds)
2210 {
2211 if (delay_in_seconds < 0.0f) delay_in_seconds = 0.0f;
2212 sound->sample_index = (int)(delay_in_seconds * (float)ctx->Hz);
2213 sound->sample_index = -(int)CUTE_SOUND_ALIGN(sound->sample_index, 4);
2214 }
2215
2216 cs_play_sound_def_t cs_make_def(cs_loaded_sound_t* sound)
2217 {
2218 cs_play_sound_def_t def;
2219 def.paused = 0;
2220 def.looped = 0;
2221 def.volume_left = 1.0f;
2222 def.volume_right = 1.0f;
2223 def.pan = 0.5f;
2224 def.delay = 0.0f;
2225 def.loaded = sound;
2226 return def;
2227 }
2228
2229 cs_playing_sound_t* cs_play_sound(cs_context_t* ctx, cs_play_sound_def_t def)
2230 {
2231 cs_lock(ctx);
2232
2233 cs_playing_sound_t* playing = ctx->playing_free;
2234 if (!playing) {
2235 cs_unlock(ctx);
2236 return 0;
2237 }
2238 ctx->playing_free = playing->next;
2239 *playing = cs_make_playing_sound(def.loaded);
2240 playing->active = 1;
2241 playing->paused = def.paused;
2242 playing->looped = def.looped;
2243 cs_set_volume(playing, def.volume_left, def.volume_right);
2244 cs_set_pan(playing, def.pan);
2245 cs_set_delay(ctx, playing, def.delay);
2246 playing->next = ctx->playing;
2247 ctx->playing = playing;
2248 playing->loaded_sound->playing_count += 1;
2249
2250 s_on_make_playing(ctx, playing);
2251
2252 cs_unlock(ctx);
2253
2254 return playing;
2255 }
2256
2257
2258 void cs_stop_all_sounds(cs_context_t* ctx)
2259 {
2260 // This is apart of the high level API, not the low level API.
2261 // If using the low level API you must write your own function to
2262 // stop playing all sounds.
2263 CUTE_SOUND_ASSERT(ctx->playing_pool != 0);
2264
2265 cs_lock(ctx);
2266 cs_playing_sound_t* sound = ctx->playing;
2267 while (sound)
2268 {
2269 // let cs_mix() remove the sound
2270 sound->active = 0;
2271 sound = sound->next;
2272 }
2273 cs_unlock(ctx);
2274 }
2275
2276 cs_plugin_id_t cs_add_plugin(cs_context_t* ctx, const cs_plugin_interface_t* plugin)
2277 {
2278 CUTE_SOUND_ASSERT(ctx->plugin_count < CUTE_SOUND_PLUGINS_MAX);
2279 ctx->plugins[ctx->plugin_count++] = *plugin;
2280 return ctx->plugin_count - 1;
2281 }
2282
2283 #if CUTE_SOUND_PLATFORM == CUTE_SOUND_WINDOWS
2284
2285 static void cs_position(cs_context_t* ctx, int* byte_to_lock, int* bytes_to_write)
2286 {
2287 // compute bytes to be written to direct sound
2288 DWORD play_cursor;
2289 DWORD write_cursor;
2290 #ifdef __cplusplus
2291 HRESULT hr = ctx->buffer->GetCurrentPosition(&play_cursor, &write_cursor);
2292 #else
2293 HRESULT hr = ctx->buffer->lpVtbl->GetCurrentPosition(ctx->buffer, &play_cursor, &write_cursor);
2294 #endif
2295 CUTE_SOUND_ASSERT(hr == DS_OK);
2296
2297 DWORD lock = (ctx->running_index * ctx->bps) % ctx->buffer_size;
2298 DWORD target_cursor = (write_cursor + ctx->latency_samples * ctx->bps);
2299 if (target_cursor > (DWORD)ctx->buffer_size) target_cursor %= ctx->buffer_size;
2300 target_cursor = (DWORD)CUTE_SOUND_ALIGN(target_cursor, 16);
2301 DWORD write;
2302
2303 if (lock > target_cursor)
2304 {
2305 write = (ctx->buffer_size - lock) + target_cursor;
2306 }
2307
2308 else
2309 {
2310 write = target_cursor - lock;
2311 }
2312
2313 *byte_to_lock = lock;
2314 *bytes_to_write = write;
2315 }
2316
2317 static void cs_memcpy_to_directsound(cs_context_t* ctx, int16_t* samples, int byte_to_lock, int bytes_to_write)
2318 {
2319 // copy mixer buffers to direct sound
2320 void* region1;
2321 DWORD size1;
2322 void* region2;
2323 DWORD size2;
2324 #ifdef __cplusplus
2325 HRESULT hr = ctx->buffer->Lock(byte_to_lock, bytes_to_write, &region1, &size1, &region2, &size2, 0);
2326
2327 if (hr == DSERR_BUFFERLOST)
2328 {
2329 ctx->buffer->Restore();
2330 hr = ctx->buffer->Lock(byte_to_lock, bytes_to_write, &region1, &size1, &region2, &size2, 0);
2331 }
2332 #else
2333 HRESULT hr = ctx->buffer->lpVtbl->Lock(ctx->buffer, byte_to_lock, bytes_to_write, &region1, &size1, &region2, &size2, 0);
2334
2335 if (hr == DSERR_BUFFERLOST)
2336 {
2337 ctx->buffer->lpVtbl->Restore(ctx->buffer);
2338 hr = ctx->buffer->lpVtbl->Lock(ctx->buffer, byte_to_lock, bytes_to_write, &region1, &size1, &region2, &size2, 0);
2339 }
2340 #endif
2341
2342 if (!SUCCEEDED(hr))
2343 return;
2344
2345 unsigned running_index = ctx->running_index;
2346 INT16* sample1 = (INT16*)region1;
2347 DWORD sample1_count = size1 / ctx->bps;
2348 memcpy(sample1, samples, sample1_count * sizeof(INT16) * 2);
2349 samples += sample1_count * 2;
2350 running_index += sample1_count;
2351
2352 INT16* sample2 = (INT16*)region2;
2353 DWORD sample2_count = size2 / ctx->bps;
2354 memcpy(sample2, samples, sample2_count * sizeof(INT16) * 2);
2355 samples += sample2_count * 2;
2356 running_index += sample2_count;
2357
2358 #ifdef __cplusplus
2359 ctx->buffer->Unlock(region1, size1, region2, size2);
2360 #else
2361 ctx->buffer->lpVtbl->Unlock(ctx->buffer, region1, size1, region2, size2);
2362 #endif
2363 ctx->running_index = running_index;
2364
2365 // meager hack to fill out sound buffer before playing
2366 static int first;
2367 if (!first)
2368 {
2369 #ifdef __cplusplus
2370 ctx->buffer->Play(0, 0, DSBPLAY_LOOPING);
2371 #else
2372 ctx->buffer->lpVtbl->Play(ctx->buffer, 0, 0, DSBPLAY_LOOPING);
2373 #endif
2374 first = 1;
2375 }
2376 }
2377
2378 #elif CUTE_SOUND_PLATFORM == CUTE_SOUND_APPLE
2379
2380 static OSStatus cs_memcpy_to_coreaudio(void* udata, AudioUnitRenderActionFlags* ioActionFlags, const AudioTimeStamp* inTimeStamp, UInt32 inBusNumber, UInt32 inNumberFrames, AudioBufferList* ioData)
2381 {
2382 cs_context_t* ctx = (cs_context_t*)udata;
2383 int bps = ctx->bps;
2384 int samples_requested_to_consume = inNumberFrames;
2385 AudioBuffer* buffer = ioData->mBuffers;
2386
2387 CUTE_SOUND_ASSERT(ioData->mNumberBuffers == 1);
2388 CUTE_SOUND_ASSERT(buffer->mNumberChannels == 2);
2389 int byte_size = buffer->mDataByteSize;
2390 CUTE_SOUND_ASSERT(byte_size == samples_requested_to_consume * bps);
2391
2392 int zero_bytes = cs_pull_bytes(ctx, buffer->mData, byte_size);
2393 memset(((char*)buffer->mData) + (byte_size - zero_bytes), 0, zero_bytes);
2394
2395 return noErr;
2396 }
2397
2398 #elif CUTE_SOUND_PLATFORM == CUTE_SOUND_SDL
2399
2400 static void cs_sdl_audio_callback(void* udata, Uint8* stream, int len)
2401 {
2402 cs_context_t* ctx = (cs_context_t*)udata;
2403 int zero_bytes = cs_pull_bytes(ctx, stream, len);
2404 memset(stream + (len - zero_bytes), 0, zero_bytes);
2405 }
2406
2407 #endif
2408
2409 void cs_mix(cs_context_t* ctx)
2410 {
2411 // These variables have to be declared before any gotos to compile
2412 // as C++.
2413 cs_playing_sound_t** ptr;
2414 cs__m128i* samples;
2415 cs__m128* floatA;
2416 cs__m128* floatB;
2417 cs__m128 zero;
2418 int wide_count;
2419 int samples_to_write;
2420
2421 cs_lock(ctx);
2422
2423 #if CUTE_SOUND_PLATFORM == CUTE_SOUND_WINDOWS
2424
2425 int byte_to_lock;
2426 int bytes_to_write;
2427 cs_position(ctx, &byte_to_lock, &bytes_to_write);
2428
2429 if (!bytes_to_write) goto unlock;
2430 samples_to_write = bytes_to_write / ctx->bps;
2431
2432 #elif CUTE_SOUND_PLATFORM == CUTE_SOUND_APPLE || CUTE_SOUND_PLATFORM == CUTE_SOUND_SDL
2433
2434 int bytes_to_write;
2435 samples_to_write = cs_samples_to_mix(ctx);
2436 if (!samples_to_write) goto unlock;
2437 bytes_to_write = samples_to_write * ctx->bps;
2438
2439 #elif CUTE_SOUND_PLATFORM == CUTE_SOUND_LINUX
2440
2441 int ret;
2442 snd_pcm_sframes_t frames = ctx->fns.snd_pcm_avail(ctx->pcm_handle);
2443 if (frames == -EAGAIN) goto unlock; // No data yet.
2444 else if (frames < 0) { /* Fatal error... How should this be handled? */ }
2445 else if (frames == 0) goto unlock;
2446 samples_to_write = (int)frames;
2447 if (samples_to_write > (int)ctx->latency_samples) samples_to_write = ctx->latency_samples;
2448
2449 #endif
2450
2451 // clear mixer buffers
2452 wide_count = (int)CUTE_SOUND_ALIGN(samples_to_write, 4) / 4;
2453
2454 floatA = ctx->floatA;
2455 floatB = ctx->floatB;
2456 zero = cs_mm_set1_ps(0.0f);
2457
2458 for (int i = 0; i < wide_count; ++i)
2459 {
2460 floatA[i] = zero;
2461 floatB[i] = zero;
2462 }
2463
2464 // mix all playing sounds into the mixer buffers
2465 ptr = &ctx->playing;
2466 while (*ptr)
2467 {
2468 cs_playing_sound_t* playing = *ptr;
2469 cs_loaded_sound_t* loaded = playing->loaded_sound;
2470
2471 // immediately remove any inactive elements
2472 if (!playing->active || !ctx->running)
2473 goto remove;
2474
2475 if (!loaded)
2476 goto remove;
2477
2478 // skip all paused sounds
2479 if (playing->paused)
2480 goto get_next_playing_sound;
2481
2482 {
2483 cs__m128* cA = (cs__m128*)loaded->channels[0];
2484 cs__m128* cB = (cs__m128*)loaded->channels[1];
2485
2486 // Attempted to play a sound with no audio.
2487 // Make sure the audio file was loaded properly. Check for
2488 // error messages in cs_error_reason.
2489 CUTE_SOUND_ASSERT(cA);
2490
2491 int mix_count = samples_to_write;
2492 int offset = playing->sample_index;
2493 int remaining = loaded->sample_count - offset;
2494 if (remaining < mix_count) mix_count = remaining;
2495 CUTE_SOUND_ASSERT(remaining > 0);
2496
2497 float vA0 = playing->volume0 * playing->pan0;
2498 float vB0 = playing->volume1 * playing->pan1;
2499 cs__m128 vA = cs_mm_set1_ps(vA0);
2500 cs__m128 vB = cs_mm_set1_ps(vB0);
2501
2502 // skip sound if it's delay is longer than mix_count and
2503 // handle various delay cases
2504 int delay_offset = 0;
2505 if (offset < 0)
2506 {
2507 int samples_till_positive = -offset;
2508 int mix_leftover = mix_count - samples_till_positive;
2509
2510 if (mix_leftover <= 0)
2511 {
2512 playing->sample_index += mix_count;
2513 goto get_next_playing_sound;
2514 }
2515
2516 else
2517 {
2518 offset = 0;
2519 delay_offset = samples_till_positive;
2520 mix_count = mix_leftover;
2521 }
2522 }
2523 CUTE_SOUND_ASSERT(!(delay_offset & 3));
2524
2525 // SIMD offets
2526 int mix_wide = (int)CUTE_SOUND_ALIGN(mix_count, 4) / 4;
2527 int offset_wide = (int)CUTE_SOUND_TRUNC(offset, 4) / 4;
2528 int delay_wide = (int)CUTE_SOUND_ALIGN(delay_offset, 4) / 4;
2529 int sample_count = (mix_wide - 2 * delay_wide) * 4;
2530
2531 // Give all plugins a chance to inject altered samples into the mix streams.
2532 for (int i = 0; i < ctx->plugin_count; ++i)
2533 {
2534 cs_plugin_interface_t* plugin = ctx->plugins + i;
2535 float* plugin_samples_in_channel_a = (float*)(cA + delay_wide + offset_wide);
2536 float* plugin_samples_in_channel_b = (float*)(cB + delay_wide + offset_wide);
2537 float* samples_out_channel_a = NULL;
2538 float* samples_out_channel_b = NULL;
2539 plugin->on_mix_fn(ctx, plugin->plugin_instance, 0, plugin_samples_in_channel_a, sample_count, &samples_out_channel_a, playing->plugin_udata[i], playing);
2540 if (loaded->channel_count == 2) plugin->on_mix_fn(ctx, plugin->plugin_instance, 1, plugin_samples_in_channel_b, sample_count, &samples_out_channel_b, playing->plugin_udata[i], playing);
2541 if (samples_out_channel_a) cA = (cs__m128*)samples_out_channel_a;
2542 if (samples_out_channel_b) cB = (cs__m128*)samples_out_channel_b;
2543
2544 // Set offset_wide to cancel out delay_wide because cA and cB are now owned by the plugin,
2545 // this elimineating the need for the delay offset.
2546 if (!!samples_out_channel_a | !!samples_out_channel_b) offset_wide = -delay_wide;
2547 }
2548
2549 // apply volume, load samples into float buffers
2550 switch (loaded->channel_count)
2551 {
2552 case 1:
2553 for (int i = delay_wide; i < mix_wide - delay_wide; ++i)
2554 {
2555 cs__m128 A = cA[i + offset_wide];
2556 cs__m128 B = cs_mm_mul_ps(A, vB);
2557 A = cs_mm_mul_ps(A, vA);
2558 floatA[i] = cs_mm_add_ps(floatA[i], A);
2559 floatB[i] = cs_mm_add_ps(floatB[i], B);
2560 }
2561 break;
2562
2563 case 2:
2564 {
2565 for (int i = delay_wide; i < mix_wide - delay_wide; ++i)
2566 {
2567 cs__m128 A = cA[i + offset_wide];
2568 cs__m128 B = cB[i + offset_wide];
2569
2570 A = cs_mm_mul_ps(A, vA);
2571 B = cs_mm_mul_ps(B, vB);
2572 floatA[i] = cs_mm_add_ps(floatA[i], A);
2573 floatB[i] = cs_mm_add_ps(floatB[i], B);
2574 }
2575 } break;
2576 }
2577
2578 // playing list logic
2579 playing->sample_index += mix_count;
2580 if (playing->sample_index == loaded->sample_count)
2581 {
2582 if (playing->looped)
2583 {
2584 playing->sample_index = 0;
2585 goto get_next_playing_sound;
2586 }
2587
2588 goto remove;
2589 }
2590 }
2591
2592 get_next_playing_sound:
2593 if (*ptr) ptr = &(*ptr)->next;
2594 else break;
2595 continue;
2596
2597 remove:
2598 playing->sample_index = 0;
2599 *ptr = (*ptr)->next;
2600 playing->next = 0;
2601 playing->active = 0;
2602
2603 if (playing->loaded_sound)
2604 {
2605 playing->loaded_sound->playing_count -= 1;
2606 CUTE_SOUND_ASSERT(playing->loaded_sound->playing_count >= 0);
2607 }
2608
2609 // Notify plugins of this playing sound instance being released.
2610 for (int i = 0; i < ctx->plugin_count; ++i)
2611 {
2612 cs_plugin_interface_t* plugin = ctx->plugins + i;
2613 plugin->on_free_playing_sound_fn(ctx, plugin->plugin_instance, playing->plugin_udata[i], playing);
2614 playing->plugin_udata[i] = NULL;
2615 }
2616
2617 // if using high-level API manage the cs_playing_sound_t memory ourselves
2618 if (ctx->playing_pool)
2619 {
2620 playing->next = ctx->playing_free;
2621 ctx->playing_free = playing;
2622 }
2623
2624 continue;
2625 }
2626
2627 // load all floats into 16 bit packed interleaved samples
2628 #if CUTE_SOUND_PLATFORM == CUTE_SOUND_WINDOWS
2629
2630 samples = ctx->samples;
2631 for (int i = 0; i < wide_count; ++i)
2632 {
2633 cs__m128i a = cs_mm_cvtps_epi32(floatA[i]);
2634 cs__m128i b = cs_mm_cvtps_epi32(floatB[i]);
2635 cs__m128i a0b0a1b1 = cs_mm_unpacklo_epi32(a, b);
2636 cs__m128i a2b2a3b3 = cs_mm_unpackhi_epi32(a, b);
2637 samples[i] = cs_mm_packs_epi32(a0b0a1b1, a2b2a3b3);
2638 }
2639 cs_memcpy_to_directsound(ctx, (int16_t*)samples, byte_to_lock, bytes_to_write);
2640
2641 #elif CUTE_SOUND_PLATFORM == CUTE_SOUND_APPLE || CUTE_SOUND_PLATFORM == CUTE_SOUND_SDL || CUTE_SOUND_PLATFORM == CUTE_SOUND_LINUX
2642
2643 // Since the ctx->samples array is already in use as a ring buffer
2644 // reusing floatA to store output is a good way to temporarly store
2645 // the final samples. Then a single ring buffer push can be used
2646 // afterwards. Pretty hacky, but whatever :)
2647 samples = (cs__m128i*)floatA;
2648 for (int i = 0; i < wide_count; ++i)
2649 {
2650 cs__m128i a = cs_mm_cvtps_epi32(floatA[i]);
2651 cs__m128i b = cs_mm_cvtps_epi32(floatB[i]);
2652 cs__m128i a0b0a1b1 = cs_mm_unpacklo_epi32(a, b);
2653 cs__m128i a2b2a3b3 = cs_mm_unpackhi_epi32(a, b);
2654 samples[i] = cs_mm_packs_epi32(a0b0a1b1, a2b2a3b3);
2655 }
2656
2657 // SDL/CoreAudio use a callback mechanism communicating with cute sound
2658 // over a ring buffer (accessed by cs_push_bytes and cs_pull_bytes), but
2659 // ALSA on Linux has their own memcpy-style function to use... So we don't
2660 // need a local ring buffer at all, and can directly hand over the samples.
2661 #if CUTE_SOUND_PLATFORM != CUTE_SOUND_LINUX
2662 cs_push_bytes(ctx, samples, bytes_to_write);
2663 #else
2664 ret = ctx->fns.snd_pcm_writei(ctx->pcm_handle, samples, (snd_pcm_sframes_t)samples_to_write);
2665 if (ret < 0) ret = ctx->fns.snd_pcm_recover(ctx->pcm_handle, ret, 0);
2666 if (ret < 0) {
2667 // A fatal error occured.
2668 ctx->separate_thread = 0;
2669 }
2670 #endif
2671
2672 #endif
2673
2674 unlock:
2675 cs_unlock(ctx);
2676 }
2677
2678 #endif // CUTE_SOUND_IMPLEMENTATION_ONCE
2679 #endif // CUTE_SOUND_IMPLEMENTATION
2680
2681 /*
2682 ------------------------------------------------------------------------------
2683 This software is available under 2 licenses - you may choose the one you like.
2684 ------------------------------------------------------------------------------
2685 ALTERNATIVE A - zlib license
2686 Copyright (c) 2017 Randy Gaul http://www.randygaul.net
2687 This software is provided 'as-is', without any express or implied warranty.
2688 In no event will the authors be held liable for any damages arising from
2689 the use of this software.
2690 Permission is granted to anyone to use this software for any purpose,
2691 including commercial applications, and to alter it and redistribute it
2692 freely, subject to the following restrictions:
2693 1. The origin of this software must not be misrepresented; you must not
2694 claim that you wrote the original software. If you use this software
2695 in a product, an acknowledgment in the product documentation would be
2696 appreciated but is not required.
2697 2. Altered source versions must be plainly marked as such, and must not
2698 be misrepresented as being the original software.
2699 3. This notice may not be removed or altered from any source distribution.
2700 ------------------------------------------------------------------------------
2701 ALTERNATIVE B - Public Domain (www.unlicense.org)
2702 This is free and unencumbered software released into the public domain.
2703 Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
2704 software, either in source code form or as a compiled binary, for any purpose,
2705 commercial or non-commercial, and by any means.
2706 In jurisdictions that recognize copyright laws, the author or authors of this
2707 software dedicate any and all copyright interest in the software to the public
2708 domain. We make this dedication for the benefit of the public at large and to
2709 the detriment of our heirs and successors. We intend this dedication to be an
2710 overt act of relinquishment in perpetuity of all present and future rights to
2711 this software under copyright law.
2712 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2713 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2714 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2715 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
2716 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
2717 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2718 ------------------------------------------------------------------------------
2719 */
File include/dialogue.h added (mode: 100755) (index 0000000..1b78172)
1 #ifndef DIALOGUE_H
2 #define DIALOGUE_H
3
4 #ifndef _TM_JSON_H_INCLUDED_
5 # error Include tm_json.h before dialogue.h so dialogue can be loaded.
6 #endif
7
8 #include <stdio.h>
9
10 #include <cstdlib>
11 #include <ctime>
12 #include <climits>
13
14 #include <functional>
15 #include <string>
16 #include <vector>
17
18 namespace dialogue {
19
20 // Key/value pairs.
21 struct Variable {
22 std::string key;
23 long long valueInt;
24 };
25
26 // Arithmetic operations on key/value pairs.
27 struct Operation {
28 std::string key;
29 char op;
30 long long valueInt;
31 std::string valueKey; // Has length > 0 if value is to be derived from variable.
32 };
33
34 // Interaction contexts, like multiple-choice or visual novel screens.
35 struct Screen {
36 std::string id;
37 std::string bg;
38 std::string fg;
39 std::vector<Operation> exec;
40 std::string caption;
41 std::vector<std::string> lines;
42 std::vector<std::string> ids;
43 };
44
45 class Talk {
46 public:
47 // Set fallbackDir to alternate folder containing dialogue.
48 std::string fallbackDir;
49 std::string file;
50 Screen screen;
51 std::vector<Screen> screens;
52 std::vector<Variable> variables;
53 std::function<long long(std::string)> callback;
54 void go( std::string id );
55 void append( std::string filePath );
56 bool hasScreen( std::string id );
57 Screen getScreen( std::string id );
58 void setScreen( Screen scr );
59 bool hasVariable( std::string key );
60 long long getVariable( std::string key );
61 void setVariable( std::string key, long long valueInt );
62 int parseJSON( std::string &text );
63 Talk( std::string filePath = "" );
64 private:
65 void operate( Operation o );
66 void transformString( std::string &str );
67 };
68
69 void Talk::go( std::string id ){
70 if( id.length() >= 5 && id.substr( id.length() - 5 ) == ".json" ){
71 screens.clear();
72 std::string filePath = file.substr( 0, file.find_last_of( '/' ) + 1 ) + id;
73 append( filePath );
74 if( file == filePath ){
75 screen = getScreen( "init" );
76 }
77 std::srand( std::time( NULL ) );
78 }else{
79 screen = getScreen( id );
80 }
81 transformString( screen.caption );
82 for( std::string &s : screen.lines ){
83 transformString( s );
84 }
85 for( std::string &s : screen.ids ){
86 transformString( s );
87 }
88 // Copy exec to a local stack to allow nested callback operations.
89 std::vector<Operation> op_stack = screen.exec;
90 for( Operation &o : op_stack ){
91 operate( o );
92 }
93 }
94
95 void Talk::append( std::string filePath ){
96 FILE *stream = fopen( filePath.c_str(), "rb" );
97 if( !stream ){
98 // Attempt to load from the fallback directory.
99 std::string altPath;
100 size_t pos = filePath.find_last_of( '/' );
101 if( pos != filePath.length() - 1 ){
102 // File does not look like a directory.
103 if( pos == std::string::npos ){
104 altPath = fallbackDir + "/" + filePath;
105 }else{
106 altPath = fallbackDir + "/" + filePath.substr( pos + 1 );
107 }
108 stream = fopen( altPath.c_str(), "rb" );
109 }
110 }
111 if( !stream ){
112 screen = {
113 "ERROR",
114 "",
115 "",
116 {},
117 "ERROR: File \"" + filePath + "\" could not be loaded.",
118 { "Go to init" },
119 { "init" }
120 };
121 return;
122 }
123 std::string text = "";
124 char buf[4096];
125 while( size_t len = fread( buf, 1, sizeof( buf ), stream ) ){
126 text += std::string( buf, len );
127 }
128 fclose( stream );
129 if( parseJSON( text ) == 0 ){
130 file = filePath;
131 }
132 }
133
134 bool Talk::hasScreen( std::string id ){
135 for( Screen &s : screens ){
136 if( s.id == id ){
137 return true;
138 }
139 }
140 return false;
141 }
142
143 Screen Talk::getScreen( std::string id ){
144 for( Screen &s : screens ){
145 if( s.id == id ){
146 return s;
147 }
148 }
149 return {
150 "ERROR",
151 "",
152 "",
153 {},
154 "ERROR: Dialogue screen \"" + id + "\" not found.",
155 { "Go to init" },
156 { "init" }
157 };
158 }
159
160 void Talk::setScreen( Screen scr ){
161 for( Screen &s : screens ){
162 if( s.id == scr.id ){
163 s = scr;
164 return;
165 }
166 }
167 screens.push_back( scr );
168 }
169
170 bool Talk::hasVariable( std::string key ){
171 for( Variable &v : variables ) if( v.key == key ) return true;
172 return false;
173 }
174
175 long long Talk::getVariable( std::string key ){
176 if( key == "RAND" ){
177 return std::rand();
178 }else if( key.length() >= 8 && key.substr( 0, 8 ) == "CALLBACK" ){
179 std::string arg = key.length() >= 10 ? key.substr( 9 ) : "";
180 transformString( arg );
181 return callback( arg );
182 }else{
183 for( Variable &v : variables ){
184 if( v.key == key ) return v.valueInt;
185 }
186 }
187 return 0;
188 }
189
190 void Talk::setVariable( std::string key, long long valueInt ){
191 for( Variable &v : variables ){
192 if( v.key == key ){
193 v.valueInt = valueInt;
194 return;
195 }
196 }
197 variables.push_back( { key, valueInt } );
198 }
199
200 int Talk::parseJSON( std::string &text ){
201 // All code dependent on tm_json.h is contained within this function.
202
203 auto allocatedDocument = jsonAllocateDocumentEx( text.c_str(), text.size(), JSON_READER_JSON5 );
204
205 auto err = allocatedDocument.document.error;
206 if( err.type != JSON_OK ){
207 screen = {
208 "ERROR",
209 "",
210 "",
211 {},
212 "JSON ERROR: " +
213 std::string( jsonGetErrorString( err.type ) ) + " at line " +
214 std::to_string( err.line ) + ":" +
215 std::to_string( err.column ),
216 { "Go to init" },
217 { "init" }
218 };
219 jsonFreeDocument( &allocatedDocument );
220 return err.type;
221 }
222
223 auto viewToString = []( JsonStringView str ){
224 return std::string( str.data, str.size );
225 };
226
227 for( auto s : allocatedDocument.document.root.getObject() ){
228 std::vector<Operation> exec;
229 for( auto o : s.value["exec"].getObject() ){
230 std::string key = viewToString( o.name );
231 char op = ':';
232 if( key.length() > 0 && key.find_last_of( "=!<>?%*/+-" ) == key.length() - 1 ){
233 op = key.back();
234 key.resize( key.length() - 1 );
235 }
236 exec.push_back( {
237 key,
238 op,
239 o.value.getInt64(),
240 o.value.isString() ? viewToString( o.value.getString() ) : ""
241 } );
242 }
243 std::vector<std::string> lines;
244 for( auto l : s.value["lines"].getArray() ) lines.push_back( viewToString( l.getString() ) );
245 std::vector<std::string> ids;
246 for( auto i : s.value["ids"].getArray() ) ids.push_back( viewToString( i.getString() ) );
247 Screen scr = {
248 viewToString( s.name ),
249 viewToString( s.value["bg"].getString() ),
250 viewToString( s.value["fg"].getString() ),
251 exec,
252 viewToString( s.value["caption"].getString() ),
253 lines,
254 ids
255 };
256 // Overwrite the screen with the same id if applicable.
257 bool over = false;
258 for( auto &screen : screens ){
259 if( screen.id == scr.id ){
260 screen = scr;
261 over = true;
262 break;
263 }
264 }
265 if( !over ) screens.push_back( scr );
266 }
267
268 jsonFreeDocument( &allocatedDocument );
269
270 return 0;
271 }
272
273 Talk::Talk( std::string filePath ){
274 callback = []( std::string param ){
275 // Suppress unused parameter warnings.
276 param = "";
277 return 0;
278 };
279 if( filePath.length() > 0 ){
280 go( filePath );
281 }
282 }
283
284 void Talk::operate( Operation o ){
285 long long in = o.valueInt, out = getVariable( o.key );
286 if( o.valueKey.length() > 0 ){
287 in = getVariable( o.valueKey );
288 }
289 switch( o.op ){
290 case ':': out = in;
291 break;
292 case '=': out = ( out == in ) ? 1 : 0;
293 break;
294 case '!': out = ( out != in ) ? 1 : 0;
295 break;
296 case '<': out = ( out < in ) ? 1 : 0;
297 break;
298 case '>': out = ( out > in ) ? 1 : 0;
299 break;
300 case '?': out = ( out != 0 ) ? in : 0;
301 break;
302 case '%': out %= in;
303 break;
304 case '*': out *= in;
305 break;
306 case '/': out = ( in == 0 ) ? LLONG_MAX : out / in;
307 break;
308 case '+': out += in;
309 break;
310 case '-': out -= in;
311 }
312 setVariable( o.key, out );
313 }
314
315 void Talk::transformString( std::string &str ){
316 bool replacing = false;
317 std::string outStr = "";
318 size_t start = 0, i = 0;
319 for( i = 0; i < str.length(); i++ ){
320 switch( str[i] ){
321 case '`':
322 if( replacing ){
323 if( i - start > 1 ){
324 outStr += std::to_string( getVariable( str.substr( start + 1, i - start - 1 ) ) );
325 }
326 start = i + 1;
327 }else{
328 if( i >= start ){
329 outStr += str.substr( start, i - start );
330 }
331 start = i;
332 }
333 replacing = !replacing;
334 }
335 }
336 if( start < str.length() ){
337 outStr += str.substr( start );
338 }
339 str = outStr;
340 }
341
342 } // namespace dialogue
343
344 #endif // DIALOGUE_H
File include/en_to_zh.h added (mode: 100644) (index 0000000..0cfb5f4)
1 // English and Mandarin are both subject-verb-object, so approximate
2 // literal translations can be done trivially. Example:
3 /*
4 #include "en_to_zh.h"
5 #include <iostream>
6 int main(){
7 std::cout
8 << EnToZh( "This is an English-to-Chinese translation." )
9 << std::endl;
10 return 0;
11 }
12 */
13
14 #include <map>
15 #include <string>
16 #include <vector>
17
18 const std::map<std::string,std::string> translate_en_zh = {
19 { " ", "" },
20 { ",", ", " },
21 { ".", ". " },
22 { ":", ": " },
23 { ";", "; " },
24 { "?", "? " },
25 { "!", "! " },
26 { "that", "那" },
27 { "the", "这" },
28 { "this", "这" },
29 { "yes", "是" },
30 { "am", "是" },
31 { "m", "是" },
32 { "are", "是" },
33 { "be", "是" },
34 { "is", "是" },
35 { "got", "是" },
36 { "exist", "是" },
37 { "exists", "是" },
38 { "and", "和" },
39 { "but", "但" },
40 { "however", "但" },
41 { "yet", "但" },
42 { "a", "一个" },
43 { "an", "一个" },
44 { "i", "我" },
45 { "me", "我" },
46 { "myself", "我" },
47 { "my", "我的" },
48 { "or", "或" },
49 { "all", "所有" },
50 { "english", "英文" },
51 { "to", "到" },
52 { "chinese", "普通话" },
53 { "mandarin", "普通话" },
54 { "translation", "翻译" },
55 { "number", "数字" },
56 { "of", "的" },
57 { "unique", "独特的" },
58 { "words", "字" },
59 { "limited", "有限的" },
60 { "scant", "有限的" },
61 { "no", "不" },
62 { "not", "不" },
63 { "tea", "茶" },
64 { "you", "你" },
65 { "yourself", "你自己" },
66 { "thyself", "你自己" },
67 { "your", "你的" },
68 { "phrase", "短语" },
69 { "cake", "蛋糕" },
70 { "cave", "洞穴" },
71 { "pan", "盘" },
72 { "plate", "盘" },
73 { "test", "测试" },
74 { "testing", "测试" },
75 { "base", "基地" },
76 { "bases", "基地" },
77 { "belong", "属于" },
78 { "belongs", "属于" },
79 { "us", "我们" },
80 { "we", "我们" },
81 { "ourselves", "我们" },
82 { "each", "每个" },
83 { "every", "每个" },
84 { "man", "男人" },
85 { "men", "男人" },
86 { "person", "人" },
87 { "people", "人" },
88 { "should", "应该" },
89 { "has", "有" },
90 { "have", "有" },
91 { "thing", "事物" },
92 { "things", "事物" },
93 { "good", "好" },
94 { "dog", "狗" },
95 { "hound", "猎犬" },
96 { "horse", "马" },
97 { "bridle", "辔" },
98 { "bear", "熊" },
99 { "stuffed", "塞满" },
100 { "die", "死" },
101 { "dead", "死个" },
102 { "by", "将" },
103 { "would", "将" },
104 { "way", "道路" },
105 { "worry", "担心" },
106 { "many", "多" },
107 { "more", "多" },
108 { "much", "多" },
109 { "numerous", "多" },
110 { "about", "关于" },
111 { "regarding", "关于" },
112 { "thereof", "关于" },
113 { "what", "什么" },
114 { "its", "它的" },
115 { "it's", "它是" },
116 { "guard", "守卫" },
117 { "guarding", "守卫" },
118 { "child", "孩子" },
119 { "do", "做" },
120 { "with", "和" },
121 { "life", "生命" },
122 { "any", "任何" },
123 { "whichever", "任何" },
124 { "whatsoever", "任何" },
125 { "random", "随机的" },
126 { "knowledge", "智慧" },
127 { "wisdom", "智慧" },
128 { "world", "世界" },
129 { "confectioner", "甜品师" },
130 { "shaman", "巫" },
131 { "witch", "巫" },
132 { "small", "小" },
133 { "little", "小" },
134 { "tiny", "小" },
135 { "young", "小" },
136 { "few", "很少" },
137 { "make", "制作" },
138 { "manufacture", "制作" },
139 { "in", "在" },
140 { "at", "在" },
141 { "can", "可以" },
142 { "could", "可以" },
143 { "may", "可以" },
144 { "wise", "明智的" },
145 { "sagely", "明智的" },
146 { "sagacious", "明智的" },
147 { "mushroom", "蘑菇" },
148 { "mushrooms", "蘑菇" },
149 { "pumpkin", "南瓜" },
150 { "pumpkins", "南瓜" },
151 { "squash", "南瓜" },
152 { "apple", "苹果" },
153 { "apples", "苹果" },
154 { "orange", "橘子" },
155 { "oranges", "橘子" },
156 { "tangerine", "橘子" },
157 { "tangerines", "橘子" },
158 { "berry", "浆果" },
159 { "berries", "浆果" },
160 { "raw", "生的" },
161 { "baked", "烤的" },
162 { "cooked", "熟的" },
163 { "meat", "肉" },
164 { "fillet", "鱼片" },
165 { "pastry", "糕点" },
166 { "crust", "皮" },
167 { "lard", "猪油" },
168 { "wood", "木头" },
169 { "timber", "木头" },
170 { "basket", "篮" },
171 { "baskets", "篮" },
172 { "frost", "霜" },
173 { "coconut", "椰子" },
174 { "coconuts", "椰子" },
175 { "feather", "羽毛" },
176 { "feathers", "羽毛" },
177 { "plumage", "羽毛" },
178 { "ostrich", "鸵鸟" },
179 { "ostriches", "鸵鸟" },
180 { "egg", "蛋" },
181 { "eggs", "蛋" },
182 { "warrior", "战士" },
183 { "warriors", "战士们" },
184 { "soldier", "士兵" },
185 { "soldiers", "士兵" },
186 { "campfire", "营火" },
187 { "stone", "石" },
188 { "stones", "石" },
189 { "grind", "研磨" },
190 { "grinding", "研磨" },
191 { "mill", "磨" },
192 { "milling", "磨" },
193 { "magic", "魔" },
194 { "wolf", "狼" },
195 { "wolves", "狼" },
196 { "wolfish", "狼" },
197 { "gold", "金" },
198 { "golden", "金" },
199 { "aurum", "金" },
200 { "knife", "刀" },
201 { "knives", "刀" },
202 { "obsidian", "黑曜石" },
203 { "dragonglass", "黑曜石" },
204 { "guardian", "监护人" },
205 { "guardians", "监护人" },
206 { "yeti", "雪人" },
207 { "yetis", "雪人" },
208 { "rose", "玫瑰" },
209 { "roses", "玫瑰花" },
210 { "sentry", "哨兵" },
211 { "sentinel", "哨兵" },
212 { "bush", "衬套" },
213 { "frostbush", "霜衬套" },
214 { "flame", "焰" },
215 { "eagle", "鹰" },
216 { "hawk", "鹰" },
217 { "ancestor", "祖先" },
218 { "goat", "山羊" },
219 { "goats", "山羊" },
220 { "ram", "公羊" },
221 { "horn", "角" },
222 { "clay", "黏土" },
223 { "milk", "牛奶" },
224 { "eggnog", "蛋酒" },
225 { "custard", "卡仕达酱" },
226 { "flour", "面粉" },
227 { "batter", "面糊" },
228 { "grain", "粮食" },
229 { "pepper", "胡椒" },
230 { "peppers", "胡椒" },
231 { "habanero", "哈瓦那人" },
232 { "ghost", "鬼" },
233 { "split", "分裂" },
234 { "fire", "火" },
235 { "kit", "套件" },
236 { "roasted", "烤" },
237 { "crispbread", "薄脆" },
238 { "tack", "硬面团" },
239 { "almost", "差不多" },
240 { "spice", "香草" },
241 { "can't", "不能" },
242 { "cannot", "不能" },
243 { "rest", "休息" },
244 { "here", "这里" },
245 { "continue", "继续" },
246 { "empty", "空的" },
247 { "auto", "自动的" },
248 { "automatic", "自动的" },
249 { "save", "保存" },
250 { "give", "给" },
251 { "talk", "谈谈" },
252 { "want", "想要的" },
253 { "that's", "那是" },
254 { "brilliant", "杰出的" },
255 { "now", "现在" },
256 { "new", "新" },
257 { "formula", "配方" },
258 { "recipe", "配方" },
259 { "one", "一" },
260 { "two", "两个" },
261 { "three", "三个" },
262 { "four", "四个" },
263 { "five", "五个" },
264 { "six", "六个" },
265 { "seven", "七个" },
266 { "eight", "八个" },
267 { "nine", "九个" },
268 { "ten", "十个" }
269 };
270
271 inline std::string EnToZh( const std::string &str ){
272 std::vector<std::string> tokens;
273 std::string t_new;
274 for( char c : str ){
275 if((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '\''){
276 // Alphabetical characters are added to the current token.
277 t_new.push_back( c );
278 }else{
279 // Non-alphabetical characters get their own tokens.
280 tokens.push_back( t_new );
281 t_new = "";
282 tokens.push_back( std::string( 1, c ) );
283 }
284 }
285 if( t_new.length() > 0 ) tokens.push_back( t_new );
286 std::string result;
287 for( std::string &t : tokens ){
288 // Lowercase the token for searching.
289 std::string t_lower;
290 for( char c : t ){
291 t_lower.push_back(
292 ( c >= 'A' && c <= 'Z' ) ? c - 'A' + 'a' : c
293 );
294 }
295 auto t_it = translate_en_zh.find( t_lower );
296 if( t_it == translate_en_zh.end() ){
297 // No match found. Use the original token.
298 result += t;
299 // Add a space if the token is a word.
300 if( t.length() > 1 ) result += " ";
301 }else{
302 // Match found.
303 result += t_it->second;
304 }
305 }
306 return result;
307 }
File include/enzhtest.cpp added (mode: 100644) (index 0000000..c0a66f1)
1 #include "en_to_zh.h"
2 #include <iostream>
3 int main(){
4 std::cout
5 << EnToZh( "This is an English-to-Chinese translation.\n" )
6 << EnToZh( "The number of unique words is limited.\n" )
7 << EnToZh( "To be or not to be, that is the phrase.\n" )
8 << EnToZh( "Test test testing.\n" )
9 << EnToZh( "All your base are belong to us.\n" )
10 << EnToZh( "Every man should have three things: a good dog, a hound; a good horse, and a bridle.\n" )
11 << EnToZh( "By the way, the bear is dead and stuffed. I would worry more about what it's guarding.\n" )
12 << EnToZh( "Yes, my child?\n" )
13 << EnToZh( "What should I do with my life?\n" )
14 << EnToZh( "Got any random wisdom?\n" )
15 << EnToZh( "Never mind.\n" )
16 << EnToZh( "The world is young, but in this age you nonetheless have options.\n" )
17 << EnToZh( "You could be a confectioner by making a recipe book. (Or a cake.)\n" )
18 << EnToZh( "You could be an adventurer by fighting dangerous creatures.\n" )
19 << EnToZh( "The future holds wonders!\n" )
20 << EnToZh( "Do not trust wise men.\n" )
21 << EnToZh( "The shaman likes baked apples and magic berries.\n" )
22 << EnToZh( "When you give food to yourself, you eat.\n" )
23 << EnToZh( "When you trade something of your own, the trader may give you money.\n" )
24 << EnToZh( "There is a mythical food called \"cake\". Nobody knows how to make it.\n" )
25 << EnToZh( "The settlement to the east is worth visiting, though its inhabitants seldom welcome outsiders.\n" )
26 << EnToZh( "Cake is all the motivation you need. One day, you will make some and give it to me.\n" )
27 << EnToZh( "All a man needs is a horn of goat milk and some flour. Milky tack. It's not cake, but few things are.\n" )
28 << EnToZh( "Walk your own path. Find your own destiny.\n" )
29 << EnToZh( "Explore, try things, and see what foods you can make.\n" )
30 << EnToZh( "There is nothing more I can teach you. You are the wise one now. The age of cake is upon us, and an age of wonders it is." )
31 << EnToZh( "There is nothing more I can teach you. You are the wise one now. The age of cake is upon us, and an age of wonders it is." )
32 << std::endl;
33 return 0;
34 }
File include/fg2/fg2.h added (mode: 100755) (index 0000000..4b35a45)
1 #ifndef FG2_H
2 #define FG2_H
3
4 #if defined(__EMSCRIPTEN__)
5 # define FG2_GET_CANVAS_WIDTH EM_ASM_INT( { return Module.canvas.width; }, nullptr )
6 # define FG2_GET_CANVAS_HEIGHT EM_ASM_INT( { return Module.canvas.height; }, nullptr )
7 # define GLAD_GLES2_IMPLEMENTATION
8 # include "glad_gles2.h"
9 # include <emscripten/emscripten.h>
10 # include <emscripten/html5.h>
11 #elif defined(__ANDROID__)
12 # define GLAD_GLES2_IMPLEMENTATION
13 # include "glad_gles2.h"
14 #elif defined(__APPLE__)
15 # include <TargetConditionals.h>
16 # if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE==1
17 # define GLAD_GLES2_IMPLEMENTATION
18 # include "glad_gles2.h"
19 # else
20 # define GLAD_GL_IMPLEMENTATION
21 # include "glad_gl.h"
22 # endif
23 #else
24 # define GLAD_GL_IMPLEMENTATION
25 # include "glad_gl.h"
26 #endif
27
28 #include "linalg.h"
29
30 #include <SDL2/SDL.h>
31
32 #include <stdio.h>
33
34 #include <cmath>
35 #include <cstring>
36
37 #include <memory>
38 #include <string>
39 #include <vector>
40
41 namespace fg2
42 {
43
44 bool verbose = true;
45
46 #ifdef GLAD_GL
47 const char* shaderHeader = R"(
48 #version 110
49 )";
50 #else // GLES
51 const char* shaderHeader = R"(
52 #version 100
53 precision mediump float;
54 )";
55 #endif
56
57 // vec2/3 can become vec4 automatically
58 // https://stackoverflow.com/questions/18935203/shader-position-vec4-or-vec3
59
60 const char* unlitVert = R"(
61 uniform mat4 u_matrices[6]; // 0:mvp 1:mv 2:m 3:normal 4:texture, 5:light
62 attribute vec4 a_Position;
63 attribute vec4 a_Normal;
64 attribute vec4 a_Tangent;
65 attribute vec4 a_UV;
66 varying vec2 v_UV;
67 varying vec4 v_RelativePos;
68 void main(){
69 v_UV = vec2( u_matrices[4] * a_UV );
70 v_RelativePos = u_matrices[1] * a_Position;
71 gl_Position = u_matrices[0] * a_Position;
72 }
73 )";
74
75 const char* unlitFrag = R"(
76 uniform sampler2D u_texture;
77 uniform vec4 u_fog;
78 uniform vec3 u_camera;
79 varying vec2 v_UV;
80 varying vec4 v_RelativePos;
81 void main(){
82 vec4 texColor = texture2D( u_texture, v_UV );
83 if( texColor.a < 0.001 ) discard;
84 if( u_fog.a > 0.0 ){
85 float fogFactor = 1.0 - clamp( 1.0 / exp( length( v_RelativePos ) * u_fog.a ), 0.0, 1.0 );
86 gl_FragColor = vec4( mix( texColor.rgb, u_fog.rgb, fogFactor ), texColor.a );
87 }else{
88 gl_FragColor = texColor;
89 }
90 }
91 )";
92
93 std::vector<std::string> unlitSamplers = { "u_texture" };
94
95 const char* colorModFrag = R"(
96 uniform sampler2D u_texture;
97 uniform vec4 u_fog;
98 uniform vec3 u_camera;
99 varying vec2 v_UV;
100 varying vec4 v_RelativePos;
101 void main(){
102 vec4 texColor = texture2D( u_texture, v_UV );
103 if( texColor.a < 0.001 ) discard;
104 gl_FragColor = texColor * u_fog;
105 }
106 )";
107
108 std::vector<std::string> colorModSamplers = { "u_texture" };
109
110 const char* skyboxVert = R"(
111 uniform mat4 u_matrices[6]; // 0:mvp 1:mv 2:m 3:normal 4:texture, 5:light
112 attribute vec4 a_Position;
113 attribute vec4 a_Normal;
114 attribute vec4 a_Tangent;
115 attribute vec4 a_UV;
116 varying vec3 v_STR;
117 void main(){
118 v_STR = a_Position.xyz;
119 vec4 pos = u_matrices[0] * a_Position;
120 gl_Position = pos.xyww;
121 }
122 )";
123
124 const char* skyboxFrag = R"(
125 uniform samplerCube u_cubemap;
126 uniform vec4 u_fog;
127 uniform vec3 u_camera;
128 varying vec3 v_STR;
129 void main(){
130 gl_FragColor = textureCube( u_cubemap, v_STR ) * u_fog;
131 }
132 )";
133
134 std::vector<std::string> skyboxSamplers = { "u_cubemap" };
135
136 const GLchar* irradianceFrag = R"(
137 uniform samplerCube u_cubemap;
138 uniform vec4 u_fog;
139 uniform vec3 u_camera;
140 varying vec3 v_STR;
141
142 const float PI = 3.1415927;
143
144 mat4 rotationMatrix( vec3 axis, float angle ){
145 axis = normalize( axis );
146 float s = sin( angle );
147 float c = cos( angle );
148 float oc = 1.0 - c;
149 return mat4(
150 oc * axis.x * axis.x + c, oc * axis.x * axis.y - axis.z * s, oc * axis.z * axis.x + axis.y * s, 0.0,
151 oc * axis.x * axis.y + axis.z * s, oc * axis.y * axis.y + c, oc * axis.y * axis.z - axis.x * s, 0.0,
152 oc * axis.z * axis.x - axis.y * s, oc * axis.y * axis.z + axis.x * s, oc * axis.z * axis.z + c, 0.0,
153 0.0, 0.0, 0.0, 1.0
154 );
155 }
156
157 vec3 getIrradiance( vec3 normal ){
158 const float grain = 0.05;
159 vec3 irradiance = vec3( 0.0 );
160 vec3 up = vec3( 0.0, 1.0, 0.0 );
161 vec3 right = normalize( cross( normal, up ) );
162 float index = 0.0;
163 for( float longi = 0.0; longi <= PI * 0.5; longi += grain ){
164 mat4 trl = rotationMatrix( right, longi );
165 for( float azi = 0.0; azi <= PI * 2.0; azi += grain ){
166 mat4 tra = rotationMatrix( normal, azi );
167 vec3 sampleVec = ( tra * trl * vec4( normal, 1.0 ) ).xyz;
168 irradiance += textureCube( u_cubemap, sampleVec ).rgb * sin( longi ) * cos( longi );
169 index += 1.0;
170 }
171 }
172 float hemispherePDF = 1.0 / ( 2.0 * PI );
173 irradiance /= index * hemispherePDF;
174 return irradiance;
175 }
176
177 void main(){
178 vec3 N = normalize( v_STR );
179 gl_FragColor = vec4( getIrradiance( N ) / PI, 1.0 );
180 }
181 )";
182
183 std::vector<std::string> irradianceSamplers = { "u_cubemap" };
184
185 struct Display {
186 bool success;
187 unsigned int width;
188 unsigned int height;
189 std::string title;
190 };
191
192 Display newDisplay = { false, 0, 0, "" };
193
194 struct Color {
195 GLfloat r;
196 GLfloat g;
197 GLfloat b;
198 GLfloat a;
199 };
200
201 Color newColor = { 1.0f, 1.0f, 1.0f, 1.0f };
202
203 Color fogColor = { 0.0f, 0.0f, 0.0f, 0.0f };
204
205 struct Texture {
206 bool success;
207 GLuint texture;
208 GLsizei width;
209 GLsizei height;
210 unsigned int channels;
211 bool mipmap;
212 GLenum type;
213 };
214
215 Texture newTexture = { false, 0, 0, 0, 0, false, 0 };
216
217 Texture blankTexture = { false, 0, 0, 0, 0, false, 0 };
218
219 struct Framebuffer {
220 bool success;
221 GLuint fbo;
222 GLuint texture;
223 GLuint texture_z;
224 GLenum texture_type;
225 GLuint rbo;
226 GLsizei width;
227 GLsizei height;
228 };
229
230 Framebuffer newFramebuffer = { false, 0, 0, 0, 0, 0, 0, 0 };
231
232 struct Vertex {
233 GLfloat Position[3];
234 GLfloat Normal[3];
235 GLfloat Tangent[3];
236 GLfloat UV[2];
237 };
238
239 Vertex newVertex = {
240 { 0.0f, 0.0f, 0.0f },
241 { 0.0f, 0.0f, 0.0f },
242 { 0.0f, 0.0f, 0.0f },
243 { 0.0f, 0.0f }
244 };
245
246 typedef GLuint Index;
247
248 struct Pipeline {
249 bool success;
250 GLuint programObject;
251 GLuint u_metallicFactor;
252 GLuint u_roughnessFactor;
253 GLuint u_matrices;
254 GLuint u_fog;
255 GLuint u_camera;
256 std::vector<GLuint> slots;
257 };
258
259 Pipeline
260 newPipeline = { false, 0, 0, 0, 0, 0, 0, {} },
261 drawPipeline = { false, 0, 0, 0, 0, 0, 0, {} },
262 unlitPipeline = { false, 0, 0, 0, 0, 0, 0, {} },
263 colorModPipeline = { false, 0, 0, 0, 0, 0, 0, {} },
264 skyboxPipeline = { false, 0, 0, 0, 0, 0, 0, {} },
265 irradiancePipeline = { false, 0, 0, 0, 0, 0, 0, {} };
266
267 struct Mesh {
268 bool success;
269 std::vector<Vertex> vertices;
270 std::vector<Index> indices;
271 GLuint buffers[2]; // vertex buffer, index buffer
272 GLfloat xmin;
273 GLfloat xmax;
274 GLfloat ymin;
275 GLfloat ymax;
276 GLfloat zmin;
277 GLfloat zmax;
278 };
279
280 Mesh newMesh = { false, {}, {}, { 0, 0 }, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f };
281
282 Mesh planeMesh = { false, {}, {}, { 0, 0 }, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f };
283
284 Mesh cubeMesh = { false, {}, {}, { 0, 0 }, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f };
285
286 struct Font {
287 Texture texture;
288 Mesh textMesh;
289 float size;
290 float height;
291 std::vector<int> charStarts;
292 std::vector<int> charEnds;
293 std::vector<unsigned char> buffer;
294 std::vector<unsigned char> atlas;
295 bool needSync;
296 #ifdef __STB_INCLUDE_STB_TRUETYPE_H__
297 stbtt_pack_context pc;
298 stbtt_fontinfo info;
299 std::vector<stbtt_packedchar> packedChars;
300 #else
301 void* pc;
302 void* info;
303 std::vector<void*> packedChars;
304 #endif
305 };
306
307 Font newFont = { newTexture, newMesh, 0.0f, 0.0f, {}, {}, {}, {}, false, {}, {}, {} };
308
309 // Globals.
310 linalg::mat<double,4,4> texMatrix = linalg::identity, lightMatrix = linalg::identity;
311
312 int mouseX = 0, mouseY = 0, mouseMoveX = 0, mouseMoveY = 0, mouseWheel = 0;
313 bool mouseTrapped = false;
314
315 float touchPressure = 0.0f;
316 bool touchStart = false;
317
318 SDL_Window* window = nullptr;
319 SDL_GLContext ctx = 0;
320 SDL_GameController* controller = nullptr;
321
322 SDL_Rect textInputRect = {};
323 bool textInputEnabled = false;
324 bool textReturnStart = false;
325 std::string textInputString = "";
326
327 Uint32 windowID = 0;
328 const Uint8* keystates = nullptr;
329 Uint64 now = 0;
330
331 std::u32string utf8ToUtf32( std::string in ){
332 std::u32string out;
333
334 for( size_t i = 0; i < in.length(); i++ ){
335 // An unsigned char pointer starting at the current char.
336 auto u = reinterpret_cast<unsigned char*>( &in[ i ] );
337
338 if( u[0] < 128 ){
339 // 7 bits (ASCII)
340 out += u[0];
341 }else if( i + 1 < in.length() ){
342 if( u[0] >= 192 && u[0] < 224 ){
343 // 2 bytes
344 out +=
345 ( u[0] - 192 ) * 64 +
346 ( u[1] - 128 );
347 i += 1;
348 }else if( i + 2 < in.length() ){
349 if( u[0] >= 224 && u[0] < 240 ){
350 // 3 bytes
351 out +=
352 ( u[0] - 224 ) * 4096 +
353 ( u[1] - 128 ) * 64 +
354 ( u[2] - 128 );
355 i += 2;
356 }else if( i + 3 < in.length() && u[0] >= 240 && u[0] < 248 ){
357 // 4 bytes
358 out +=
359 ( u[0] - 240 ) * 262144 +
360 ( u[1] - 128 ) * 4096 +
361 ( u[2] - 128 ) * 64 +
362 ( u[3] - 128 );
363 i += 3;
364 }
365 }
366 }
367 }
368
369 return out;
370 }
371
372 linalg::vec<double,4> eulerToQuat( double aX, double aY, double aZ ){
373 double
374 c1 = std::cos( aY * 0.5 ),
375 c2 = std::cos( aZ * 0.5 ),
376 c3 = std::cos( aX * 0.5 ),
377 s1 = std::sin( aY * 0.5 ),
378 s2 = std::sin( aZ * 0.5 ),
379 s3 = std::sin( aX * 0.5 );
380
381 return linalg::vec<double,4>(
382 s1 * s2 * c3 + c1 * c2 * s3,
383 s1 * c2 * c3 + c1 * s2 * s3,
384 c1 * s2 * c3 - s1 * c2 * s3,
385 c1 * c2 * c3 - s1 * s2 * s3
386 );
387 }
388
389 linalg::vec<double,4> directionToQuat( linalg::vec<double,3> forward, linalg::vec<double,3> up ){
390 forward = linalg::normalize( forward );
391 up = linalg::normalize( up );
392 linalg::mat<double,4,4> m = linalg::lookat_matrix( linalg::vec<double,3>(), forward, up );
393 return linalg::qconj( linalg::rotation_quat( linalg::mat<double,3,3>(
394 { m[0][0], m[1][0], m[2][0] },
395 { m[0][1], m[1][1], m[2][1] },
396 { m[0][2], m[1][2], m[2][2] }
397 ) ) );
398 }
399
400 double wrapAngle( double a ){
401 return std::remainder( a, std::acos( -1 ) * 2 );
402 }
403
404 Color rgb( float r, float g, float b ){
405 Color col = { r, g, b, 1.0f };
406 return col;
407 }
408
409 // Used by cls.
410 void drawMesh( Mesh &mesh, linalg::mat<double,4,4> modelMat, linalg::mat<double,4,4> viewMat, linalg::mat<double,4,4> projMat );
411 void setPipeline( Pipeline pipeline );
412
413 void cls( Color col, bool clearDepth = true ){
414 if( clearDepth ){
415 // GL_DEPTH_BUFFER_BIT is not usually problematic.
416 glClear( GL_DEPTH_BUFFER_BIT );
417 }
418 // Clear the screen by drawing a plane rather than glClear.
419 // Graphics driver bugs occasionally result in glClear-related crashes.
420 Pipeline p = drawPipeline;
421 setPipeline( colorModPipeline );
422 glUniform4f( drawPipeline.u_fog, col.r, col.g, col.b, col.a );
423 glDisable( GL_BLEND );
424 glActiveTexture( GL_TEXTURE0 );
425 glBindTexture( GL_TEXTURE_2D, blankTexture.texture );
426 // Stretch to screen bounds at max depth.
427 drawMesh(
428 planeMesh,
429 linalg::mat<double,4,4>(
430 { 2.0, 0.0, 0.0, 0.0 },
431 { 0.0, 2.0, 0.0, 0.0 },
432 { 0.0, 0.0, 0.0, 0.0 },
433 { 0.0, 0.0, 1.0, 1.0 }
434 ),
435 linalg::identity,
436 linalg::identity
437 );
438 glUniform4f( drawPipeline.u_fog, fogColor.r, fogColor.g, fogColor.b, fogColor.a );
439 setPipeline( p );
440 }
441
442 Mesh loadMesh( std::vector<Vertex> &vertices, std::vector<Index> &indices, bool streaming = false ){
443 Mesh mesh = newMesh;
444
445 if( vertices.size() > 0 ){
446 // Measure the farthest bounds of the vertices.
447 // Start with the first vertex so that the origin does not matter.
448 GLfloat* p = vertices[0].Position;
449 mesh.xmin = p[0];
450 mesh.xmax = p[0];
451 mesh.ymin = p[1];
452 mesh.ymax = p[1];
453 mesh.zmin = p[2];
454 mesh.zmax = p[2];
455 for( size_t i = 1; i < vertices.size(); i++ ){
456 p = vertices[i].Position;
457 if( p[0] < mesh.xmin ) mesh.xmin = p[0];
458 if( p[0] > mesh.xmax ) mesh.xmax = p[0];
459 if( p[1] < mesh.ymin ) mesh.ymin = p[1];
460 if( p[1] > mesh.ymax ) mesh.ymax = p[1];
461 if( p[2] < mesh.zmin ) mesh.zmin = p[2];
462 if( p[2] > mesh.zmax ) mesh.zmax = p[2];
463 }
464 }
465
466 if( verbose )
467 printf( "%s%s\n", ( streaming ? "STREAMING " : "" ), "MESH" );
468
469 // Generate a vertex buffer and an index buffer.
470 glGenBuffers( 2, &mesh.buffers[0] );
471 if( verbose ){
472 printf( "Vertex buffer address: %d\n", mesh.buffers[0] );
473 printf( "Index buffer address: %d\n", mesh.buffers[1] );
474 }
475
476 // Switch to the vertex buffer.
477 glBindBuffer( GL_ARRAY_BUFFER, mesh.buffers[0] );
478 // Upload the vertices, passing the size in bytes.
479 glBufferData( GL_ARRAY_BUFFER, vertices.size() * sizeof(Vertex), &vertices[0], streaming ? GL_STREAM_DRAW : GL_STATIC_DRAW );
480 if( verbose ){
481 printf( "Number of vertices: %lu\n", vertices.size() );
482 printf( "Size of Vertex: %lu\n", sizeof(Vertex) );
483 }
484
485 // Switch to the index buffer.
486 glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, mesh.buffers[1] );
487 // Upload the indices, passing the size in bytes.
488 glBufferData( GL_ELEMENT_ARRAY_BUFFER, indices.size() * sizeof(Index), &indices[0], streaming ? GL_STREAM_DRAW : GL_STATIC_DRAW );
489 if( verbose ){
490 printf( "Number of indices: %lu\n", indices.size() );
491 printf( "Size of Index: %lu\n\n", sizeof(Index) );
492 }
493
494 // TODO: Failure conditions.
495 mesh.success = true;
496
497 mesh.vertices = vertices;
498 mesh.indices = indices;
499
500 return mesh;
501 }
502
503 void updateMesh( Mesh &mesh, std::vector<Vertex> &vertices, std::vector<Index> &indices, bool streaming = false ){
504 // Switch to the vertex buffer.
505 glBindBuffer( GL_ARRAY_BUFFER, mesh.buffers[0] );
506 // Upload the vertices, passing the size in bytes.
507 glBufferData( GL_ARRAY_BUFFER, vertices.size() * sizeof(Vertex), &vertices[0], streaming ? GL_STREAM_DRAW : GL_STATIC_DRAW );
508
509 // Switch to the index buffer.
510 glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, mesh.buffers[1] );
511 // Upload the indices, passing the size in bytes.
512 glBufferData( GL_ELEMENT_ARRAY_BUFFER, indices.size() * sizeof(Index), &indices[0], streaming ? GL_STREAM_DRAW : GL_STATIC_DRAW );
513
514 mesh.vertices = vertices;
515 mesh.indices = indices;
516 }
517
518 void drawMesh( Mesh &mesh, linalg::mat<double,4,4> modelMat, linalg::mat<double,4,4> viewMat, linalg::mat<double,4,4> projMat ){
519 if( !mesh.success ){
520 return;
521 }
522
523 linalg::mat<double,4,4> mv = linalg::mul( linalg::inverse( viewMat ), modelMat );
524 linalg::mat<double,4,4> mvp = linalg::mul( projMat, mv );
525 linalg::mat<double,4,4> normal = linalg::transpose( linalg::inverse( modelMat ) );
526
527 const GLfloat glmats[96] = { // TODO: Don't send all matrices at once.
528 (GLfloat)mvp[0][0], (GLfloat)mvp[0][1], (GLfloat)mvp[0][2], (GLfloat)mvp[0][3],
529 (GLfloat)mvp[1][0], (GLfloat)mvp[1][1], (GLfloat)mvp[1][2], (GLfloat)mvp[1][3],
530 (GLfloat)mvp[2][0], (GLfloat)mvp[2][1], (GLfloat)mvp[2][2], (GLfloat)mvp[2][3],
531 (GLfloat)mvp[3][0], (GLfloat)mvp[3][1], (GLfloat)mvp[3][2], (GLfloat)mvp[3][3],
532 (GLfloat)mv[0][0], (GLfloat)mv[0][1], (GLfloat)mv[0][2], (GLfloat)mv[0][3],
533 (GLfloat)mv[1][0], (GLfloat)mv[1][1], (GLfloat)mv[1][2], (GLfloat)mv[1][3],
534 (GLfloat)mv[2][0], (GLfloat)mv[2][1], (GLfloat)mv[2][2], (GLfloat)mv[2][3],
535 (GLfloat)mv[3][0], (GLfloat)mv[3][1], (GLfloat)mv[3][2], (GLfloat)mv[3][3],
536 (GLfloat)modelMat[0][0], (GLfloat)modelMat[0][1], (GLfloat)modelMat[0][2], (GLfloat)modelMat[0][3],
537 (GLfloat)modelMat[1][0], (GLfloat)modelMat[1][1], (GLfloat)modelMat[1][2], (GLfloat)modelMat[1][3],
538 (GLfloat)modelMat[2][0], (GLfloat)modelMat[2][1], (GLfloat)modelMat[2][2], (GLfloat)modelMat[2][3],
539 (GLfloat)modelMat[3][0], (GLfloat)modelMat[3][1], (GLfloat)modelMat[3][2], (GLfloat)modelMat[3][3],
540 (GLfloat)normal[0][0], (GLfloat)normal[0][1], (GLfloat)normal[0][2], (GLfloat)normal[0][3],
541 (GLfloat)normal[1][0], (GLfloat)normal[1][1], (GLfloat)normal[1][2], (GLfloat)normal[1][3],
542 (GLfloat)normal[2][0], (GLfloat)normal[2][1], (GLfloat)normal[2][2], (GLfloat)normal[2][3],
543 (GLfloat)normal[3][0], (GLfloat)normal[3][1], (GLfloat)normal[3][2], (GLfloat)normal[3][3],
544 (GLfloat)texMatrix[0][0], (GLfloat)texMatrix[0][1], (GLfloat)texMatrix[0][2], (GLfloat)texMatrix[0][3],
545 (GLfloat)texMatrix[1][0], (GLfloat)texMatrix[1][1], (GLfloat)texMatrix[1][2], (GLfloat)texMatrix[1][3],
546 (GLfloat)texMatrix[2][0], (GLfloat)texMatrix[2][1], (GLfloat)texMatrix[2][2], (GLfloat)texMatrix[2][3],
547 (GLfloat)texMatrix[3][0], (GLfloat)texMatrix[3][1], (GLfloat)texMatrix[3][2], (GLfloat)texMatrix[3][3],
548 (GLfloat)lightMatrix[0][0], (GLfloat)lightMatrix[0][1], (GLfloat)lightMatrix[0][2], (GLfloat)lightMatrix[0][3],
549 (GLfloat)lightMatrix[1][0], (GLfloat)lightMatrix[1][1], (GLfloat)lightMatrix[1][2], (GLfloat)lightMatrix[1][3],
550 (GLfloat)lightMatrix[2][0], (GLfloat)lightMatrix[2][1], (GLfloat)lightMatrix[2][2], (GLfloat)lightMatrix[2][3],
551 (GLfloat)lightMatrix[3][0], (GLfloat)lightMatrix[3][1], (GLfloat)lightMatrix[3][2], (GLfloat)lightMatrix[3][3],
552 };
553
554 glUniformMatrix4fv( drawPipeline.u_matrices, 6, GL_FALSE, glmats );
555
556 // Send the camera position relative to the object's origin.
557 glUniform3f(
558 drawPipeline.u_camera,
559 viewMat[3][0] - modelMat[3][0],
560 viewMat[3][1] - modelMat[3][1],
561 viewMat[3][2] - modelMat[3][2]
562 );
563
564 glBindBuffer( GL_ARRAY_BUFFER, mesh.buffers[0] );
565 glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, mesh.buffers[1] );
566
567 // turn on 4 attribute arrays
568 glEnableVertexAttribArray( 0 ); // Position
569 glEnableVertexAttribArray( 1 ); // Normal
570 glEnableVertexAttribArray( 2 ); // Tangent
571 glEnableVertexAttribArray( 3 ); // UV
572
573 size_t pointer = 0;
574 glVertexAttribPointer( 0, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex), (const GLvoid*)pointer ); // Position
575 pointer += sizeof(newVertex.Position);
576 glVertexAttribPointer( 1, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex), (const GLvoid*)pointer ); // Normal
577 pointer += sizeof(newVertex.Normal);
578 glVertexAttribPointer( 2, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex), (const GLvoid*)pointer ); // Tangent
579 pointer += sizeof(newVertex.Tangent);
580 glVertexAttribPointer( 3, 2, GL_FLOAT, GL_FALSE, sizeof(Vertex), (const GLvoid*)pointer ); // UV
581
582 glDrawElements( GL_TRIANGLES, mesh.indices.size(), GL_UNSIGNED_INT, (const GLvoid*)0 );
583 }
584
585 void normalizeVertices( std::vector<Vertex> &verts ){
586 for( size_t i = 0; i < verts.size(); i++ ){
587 GLfloat* n = verts[i].Normal;
588 GLfloat l = std::sqrt( n[0] * n[0] + n[1] * n[1] + n[2] * n[2] );
589 if( l != 0.0f && l != 1.0f ){
590 verts[i].Normal[0] /= l;
591 verts[i].Normal[1] /= l;
592 verts[i].Normal[2] /= l;
593 }
594 }
595 }
596
597 Mesh loadOBJ( std::string filepath ){
598 if( verbose ) printf( "OBJ MESH\n" );
599 size_t line = 0;
600
601 #ifndef __EMSCRIPTEN__
602 try{
603 #endif
604
605 FILE* file = fopen( filepath.c_str(), "rb" );
606
607 if( !file ){
608 fprintf( stderr, "Failed to open %s\n\n", filepath.c_str() );
609 return newMesh;
610 }
611
612 std::string text = "";
613 char buf[4096];
614 while( size_t len = fread( buf, 1, sizeof( buf ), file ) ){
615 text += std::string( buf, len );
616 }
617 fclose( file );
618
619 struct float3 { GLfloat x, y, z; };
620 struct float2 { GLfloat u, v; };
621 struct obdex { int v1, vt1, vn1, v2, vt2, vn2, v3, vt3, vn3; };
622
623 std::vector<float3> obj_v, obj_vn;
624 std::vector<float2> obj_vt;
625 std::vector<obdex> obj_f;
626
627 size_t head = 0, tail = 0;
628
629 do{
630 line++;
631 tail = text.find_first_of( "\n", head );
632 if( tail == std::string::npos ) tail = text.size();
633 if( text[ head ] != '#' ){
634 std::string ln = text.substr( head, tail - head );
635
636 std::vector<std::string> s;
637
638 size_t i1 = 0, i2 = 0;
639
640 do{
641 i2 = ln.find_first_of( " \r/", i1 );
642 if( i2 == std::string::npos ) i2 = ln.size();
643 std::string value = ln.substr( i1, i2 - i1 );
644 if( value.length() > 0 ) s.push_back( value );
645 i1 = i2 + 1;
646 }while( i1 < ln.size() );
647
648 if( s.size() > 0 ){
649 if( s[0] == "v" && s.size() >= 4 ){
650 obj_v.push_back( { std::stof(s[1]), std::stof(s[2]), std::stof(s[3]) } );
651 }else if( s[0] == "vt" && s.size() >= 3 ){
652 // Flip the vertical texture coordinate.
653 obj_vt.push_back( { std::stof(s[1]), 1.0f - std::stof(s[2]) } );
654 }else if( s[0] == "vn" && s.size() >= 4 ){
655 obj_vn.push_back( { std::stof(s[1]), std::stof(s[2]), std::stof(s[3]) } );
656 }else if( s[0] == "f" && s.size() >= 10 ){
657 obj_f.push_back( {
658 std::stoi(s[1]),
659 std::stoi(s[2]),
660 std::stoi(s[3]),
661 std::stoi(s[4]),
662 std::stoi(s[5]),
663 std::stoi(s[6]),
664 std::stoi(s[7]),
665 std::stoi(s[8]),
666 std::stoi(s[9])
667 } );
668 }
669 }
670 }
671 head = tail + 1;
672 }while( head < text.size() );
673
674 if( verbose ){
675 printf( "Vertex positions: %lu\n", obj_v.size() );
676 printf( "Vertex texcoords: %lu\n", obj_vt.size() );
677 printf( "Vertex normals: %lu\n", obj_vn.size() );
678 printf( "Faces: %lu\n", obj_f.size() );
679 }
680
681 // group vertex attributes by texture coordinates
682 std::vector<Vertex> verts( obj_vt.size() );
683 std::vector<Index> inds;
684
685 for( obdex f : obj_f ){
686 Index a = f.vt1 - 1, b = f.vt2 - 1, c = f.vt3 - 1;
687 verts[ a ] = {
688 { obj_v[ f.v1 - 1 ].x, obj_v[ f.v1 - 1 ].y, obj_v[ f.v1 - 1 ].z },
689 { obj_vn[ f.vn1 - 1 ].x, obj_vn[ f.vn1 - 1 ].y, obj_vn[ f.vn1 - 1 ].z },
690 { 0.0f, 0.0f, 0.0f },
691 { obj_vt[ a ].u, obj_vt[ a ].v }
692 };
693 verts[ b ] = {
694 { obj_v[ f.v2 - 1 ].x, obj_v[ f.v2 - 1 ].y, obj_v[ f.v2 - 1 ].z },
695 { obj_vn[ f.vn2 - 1 ].x, obj_vn[ f.vn2 - 1 ].y, obj_vn[ f.vn2 - 1 ].z },
696 { 0.0f, 0.0f, 0.0f },
697 { obj_vt[ b ].u, obj_vt[ b ].v }
698 };
699 verts[ c ] = {
700 { obj_v[ f.v3 - 1 ].x, obj_v[ f.v3 - 1 ].y, obj_v[ f.v3 - 1 ].z },
701 { obj_vn[ f.vn3 - 1 ].x, obj_vn[ f.vn3 - 1 ].y, obj_vn[ f.vn3 - 1 ].z },
702 { 0.0f, 0.0f, 0.0f },
703 { obj_vt[ c ].u, obj_vt[ c ].v }
704 };
705 Index i[3] = { a, b, c };
706 inds.insert( std::end( inds ), std::begin( i ), std::end( i ) );
707 }
708
709 normalizeVertices( verts );
710
711 if( verbose ){
712 printf( "Vertices: %lu\n", verts.size() );
713 printf( "Indices: %lu\n\n", inds.size() );
714 }
715
716 return loadMesh( verts, inds );
717
718 #ifndef __EMSCRIPTEN__
719 }catch( const std::exception &e ){
720 fprintf( stderr, "Caught exception at line %lu of %s: %s\n\n", line, filepath.c_str(), e.what().c_str() );
721 }
722 #endif
723
724 return newMesh;
725 }
726
727 #ifdef tinyply_h
728
729 Mesh loadPLY( std::string filepath ){
730 if( verbose ) printf( "PLY MESH\n" );
731
732 #ifndef __EMSCRIPTEN__
733 try{
734 #endif
735
736 std::ifstream ss( filepath, std::ios::binary );
737
738 if( ss.fail() ){
739 fprintf( stderr, "Failed to open %s\n\n", filepath.c_str() );
740 return newMesh;
741 }
742
743 PlyFile file;
744 file.parse_header( ss );
745
746 if( verbose ){
747 for( auto c : file.get_comments() ){
748 std::cout << "Comment: " << c << std::endl;
749 }
750 }
751
752 // Tinyply treats parsed data as untyped byte buffers.
753 std::shared_ptr<PlyData> vertices, normals, texcoords, faces;
754
755 bool gotNormals = false, gotUV = false;
756
757 for( auto e : file.get_elements() ){
758 if( verbose )
759 std::cout << "element - " << e.name << " (" << e.size << ")" << std::endl;
760 for( auto p : e.properties ){
761 if( verbose )
762 std::cout << "\tproperty - " << p.name << " (" << tinyply::PropertyTable[p.propertyType].str << ")" << std::endl;
763
764 if( e.name == "vertex" ){
765 if( p.name == "x" ){
766 // assume if "x" exists then so do "y" and "z"
767 vertices = file.request_properties_from_element( e.name, { "x", "y", "z" } );
768 }else if( p.name == "nx" ){
769 // assume if "nx" exists then so do "ny" and "nz"
770 normals = file.request_properties_from_element( e.name, { "nx", "ny", "nz" } );
771 gotNormals = true;
772 }else if( p.name == "u" ){
773 // assume if "u" exists then so does "v"
774 texcoords = file.request_properties_from_element( e.name, { "u", "v" } );
775 gotUV = true;
776 }else if( p.name == "s" ){
777 // assume if "s" exists then so does "t"
778 texcoords = file.request_properties_from_element( e.name, { "s", "t" } );
779 gotUV = true;
780 }
781 }else if( e.name == "face" && p.name == "vertex_indices" ){
782 faces = file.request_properties_from_element( e.name, { p.name }, 3 );
783 }
784 }
785 }
786
787 file.read( ss );
788
789 if( verbose ){
790 if( vertices )
791 std::cout << "Read " << vertices->count << " total vertices." << std::endl;
792 if( normals )
793 std::cout << "Read " << normals->count << " total vertex normals." << std::endl;
794 if( texcoords )
795 std::cout << "Read " << texcoords->count << " total vertex texcoords." << std::endl;
796 if( faces )
797 std::cout << "Read " << faces->count << " total faces (triangles).\n" << std::endl;
798 }
799
800 if( vertices->t == tinyply::Type::FLOAT32 && ( faces->t == tinyply::Type::INT32 || faces->t == tinyply::Type::UINT32 ) ){
801 struct float3 { GLfloat x, y, z; };
802 struct float2 { GLfloat u, v; };
803
804 // vertex positions
805 std::vector<float3> vertpos( vertices->count );
806 const size_t numVerticesBytes = vertices->buffer.size_bytes();
807 std::memcpy( vertpos.data(), vertices->buffer.get(), numVerticesBytes );
808
809 // vertex normals
810 std::vector<float3> vertnorms( gotNormals ? normals->count : 1 );
811 if( gotNormals ){
812 const size_t numNormalsBytes = normals->buffer.size_bytes();
813 std::memcpy( vertnorms.data(), normals->buffer.get(), numNormalsBytes );
814 }
815
816 // vertex UV
817 std::vector<float2> vertuv( gotUV ? texcoords->count : 1 );
818 if( gotUV ){
819 const size_t numTexcoordsBytes = texcoords->buffer.size_bytes();
820 std::memcpy( vertuv.data(), texcoords->buffer.get(), numTexcoordsBytes );
821 }
822
823 // create the vertex array
824 std::vector<Vertex> verts;
825
826 float3 n = { 0.0f, 0.0f, 0.0f };
827 float2 uv = { 0.0f, 0.0f };
828
829 // fill vertex array with vertex attributes from tinyply
830 for( size_t i = 0; i < vertpos.size(); i++ ){
831 if( gotNormals ) n = { vertnorms[i].x, vertnorms[i].y, vertnorms[i].z };
832 if( gotUV ) uv = { vertuv[i].u, vertuv[i].v };
833 Vertex v = {
834 { vertpos[i].x, vertpos[i].y, vertpos[i].z },
835 { n.x, n.y, n.z },
836 { 0.0f, 0.0f, 0.0f },
837 // Flip the vertical texture coordinate.
838 { uv.u, 1.0f - uv.v },
839 };
840 verts.push_back( v );
841 }
842
843 // normalize the vertex array
844 normalizeVertices( verts );
845
846 std::vector<int32_t> indpos( faces->count * 3 );
847 const size_t numFacesBytes = faces->buffer.size_bytes();
848 std::memcpy( indpos.data(), faces->buffer.get(), numFacesBytes );
849
850 // detect if signed int32 is used for indices
851 bool sint = faces->t == tinyply::Type::INT32;
852
853 // create the index array
854 std::vector<Index> inds;
855
856 // fill index array with indices from tinyply
857 for( int32_t i : indpos ) inds.push_back( sint ? (Index)i : (Index)*reinterpret_cast<uint32_t*>(&i) );
858
859 return loadMesh( verts, inds );
860 }else{
861 fprintf( stderr, "PLY mesh does not use 32-bit format\n\n" );
862 }
863
864 #ifndef __EMSCRIPTEN__
865 }catch( const std::exception &e ){
866 fprintf( stderr, "Caught exception with %s: %s\n\n", filepath.c_str(), e.what().c_str() );
867 }
868 #endif
869
870 return newMesh;
871 }
872
873 #else
874
875 Mesh loadPLY( std::string filepath ){
876 (void)filepath;
877 fprintf( stderr, "Include tinyply.h before fg2.h to load PLY files.\n\n" );
878 return newMesh;
879 }
880
881 #endif // tinyply_h
882
883 void freeMesh( Mesh &mesh ){
884 glDeleteBuffers( 2, mesh.buffers );
885 mesh = newMesh;
886 }
887
888 Texture loadTexture( const GLvoid* data, GLsizei width, GLsizei height, unsigned int channels, bool mipmap = true, bool filter = true ){
889 Texture tex = newTexture;
890 if( !data ) return tex;
891
892 // GL_LUMINANCE and GL_LUMINANCE_ALPHA do not exist in GLES3 and later.
893 GLenum pixfmts[] = {
894 GL_LUMINANCE,
895 GL_LUMINANCE_ALPHA,
896 GL_RGB,
897 GL_RGBA
898 };
899
900 glGenTextures( 1, &tex.texture );
901 glBindTexture( GL_TEXTURE_2D, tex.texture );
902
903 bool canRepeat = true;
904 #ifdef __EMSCRIPTEN__
905 // https://stackoverflow.com/questions/600293/how-to-check-if-a-number-is-a-power-of-2
906 if( ( width & ( width - 1 ) ) != 0 || ( height & ( height - 1 ) ) != 0 ){
907 canRepeat = false;
908 mipmap = false;
909 }
910 #endif
911
912 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, canRepeat ? GL_REPEAT : GL_CLAMP_TO_EDGE );
913 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, canRepeat ? GL_REPEAT : GL_CLAMP_TO_EDGE );
914
915 glTexParameteri(
916 GL_TEXTURE_2D,
917 GL_TEXTURE_MIN_FILTER,
918 mipmap ? ( filter ? GL_LINEAR_MIPMAP_LINEAR : GL_NEAREST_MIPMAP_LINEAR ) : ( filter ? GL_LINEAR : GL_NEAREST )
919 );
920 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter ? GL_LINEAR : GL_NEAREST );
921
922 // STB libraries do not pad rows
923 // https://www.opengl.org/discussion_boards/showthread.php/134151-glTexImage2D-Resulting-texture-not-matching-passed-data
924 // https://stackoverflow.com/questions/15052463/given-the-pitch-of-an-image-how-to-calculate-the-gl-unpack-alignment
925 unsigned int pitch = width * channels;
926 glPixelStorei(
927 GL_UNPACK_ALIGNMENT,
928 pitch % 8 == 0 ? 8 // most efficient
929 : ( pitch % 4 == 0 ? 4 // common value
930 : ( pitch % 2 == 0 ? 2 // dubious efficiency
931 : 1 // least efficient
932 ) ) );
933
934 // GLES2 has no concept of gamma correction or sRGB
935 // https://www.khronos.org/registry/OpenGL-Refpages/es2.0/xhtml/glTexImage2D.xml
936 glTexImage2D(
937 GL_TEXTURE_2D,
938 0,
939 pixfmts[ channels - 1 ],
940 width,
941 height,
942 0,
943 pixfmts[ channels - 1 ],
944 GL_UNSIGNED_BYTE,
945 data
946 );
947 #ifdef GLAD_GL
948 if( mipmap ) glGenerateMipmapEXT( GL_TEXTURE_2D );
949 #else // GLES
950 if( mipmap ) glGenerateMipmap( GL_TEXTURE_2D );
951 #endif
952
953 tex.success = true;
954 tex.width = width;
955 tex.height = height;
956 tex.channels = channels;
957 tex.mipmap = mipmap;
958 tex.type = GL_TEXTURE_2D;
959
960 return tex;
961 }
962
963 Texture loadCubemap( std::vector<GLvoid*> faces, GLsizei width, GLsizei height, unsigned int channels, bool mipmap = true, bool filter = true ){
964 Texture tex = newTexture;
965 if( faces.size() != 6 ) return tex;
966
967 // GL_LUMINANCE and GL_LUMINANCE_ALPHA do not exist in GLES3 and later.
968 GLenum pixfmts[] = {
969 GL_LUMINANCE,
970 GL_LUMINANCE_ALPHA,
971 GL_RGB,
972 GL_RGBA
973 };
974
975 glGenTextures( 1, &tex.texture );
976 glBindTexture( GL_TEXTURE_CUBE_MAP, tex.texture );
977
978 // OpenGL 2.0 does not support seamless cubemaps or GL_TEXTURE_WRAP_R
979 glTexParameteri( GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
980 glTexParameteri( GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
981
982 glTexParameteri(
983 GL_TEXTURE_CUBE_MAP,
984 GL_TEXTURE_MIN_FILTER,
985 mipmap ? ( filter ? GL_LINEAR_MIPMAP_LINEAR : GL_NEAREST_MIPMAP_LINEAR ) : ( filter ? GL_LINEAR : GL_NEAREST )
986 );
987 glTexParameteri( GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, filter ? GL_LINEAR : GL_NEAREST );
988
989 unsigned int pitch = width * channels;
990 glPixelStorei(
991 GL_UNPACK_ALIGNMENT,
992 pitch % 8 == 0 ? 8 // most efficient
993 : ( pitch % 4 == 0 ? 4 // common value
994 : ( pitch % 2 == 0 ? 2 // dubious efficiency
995 : 1 // least efficient
996 ) ) );
997
998 for( unsigned int i = 0; i < 6; i++ )
999 glTexImage2D(
1000 GL_TEXTURE_CUBE_MAP_POSITIVE_X + i,
1001 0,
1002 pixfmts[channels - 1],
1003 width,
1004 height,
1005 0,
1006 pixfmts[channels - 1],
1007 GL_UNSIGNED_BYTE,
1008 faces[i]
1009 );
1010
1011 #ifdef GLAD_GL
1012 if( mipmap ) glGenerateMipmapEXT( GL_TEXTURE_CUBE_MAP );
1013 #else // GLES
1014 if( mipmap ) glGenerateMipmap( GL_TEXTURE_CUBE_MAP );
1015 #endif
1016
1017 tex.success = true;
1018 tex.width = width;
1019 tex.height = height;
1020 tex.channels = channels;
1021 tex.mipmap = mipmap;
1022 tex.type = GL_TEXTURE_CUBE_MAP;
1023
1024 return tex;
1025 }
1026
1027 void freeTexture( Texture &tex ){
1028 glDeleteTextures( 1, &tex.texture );
1029 tex = newTexture;
1030 }
1031
1032 void updateTexture( Texture &tex, const GLvoid* data ){
1033 GLenum pixfmts[] = {
1034 GL_LUMINANCE,
1035 GL_LUMINANCE_ALPHA,
1036 GL_RGB,
1037 GL_RGBA
1038 };
1039
1040 glBindTexture( GL_TEXTURE_2D, tex.texture );
1041
1042 glTexSubImage2D(
1043 GL_TEXTURE_2D,
1044 0,
1045 0,
1046 0,
1047 tex.width,
1048 tex.height,
1049 pixfmts[ tex.channels - 1 ],
1050 GL_UNSIGNED_BYTE,
1051 data
1052 );
1053 #ifdef GLAD_GL
1054 if( tex.mipmap ) glGenerateMipmapEXT( GL_TEXTURE_2D );
1055 #else // GLES
1056 if( tex.mipmap ) glGenerateMipmap( GL_TEXTURE_2D );
1057 #endif
1058 }
1059
1060 void updateCubemap( Texture &tex, std::vector<GLvoid*> faces ){
1061 if( faces.size() != 6 ) return;
1062
1063 GLenum pixfmts[] = {
1064 GL_LUMINANCE,
1065 GL_LUMINANCE_ALPHA,
1066 GL_RGB,
1067 GL_RGBA
1068 };
1069
1070 glBindTexture( GL_TEXTURE_CUBE_MAP, tex.texture );
1071
1072 for( unsigned int i = 0; i < 6; i++ )
1073 glTexSubImage2D(
1074 GL_TEXTURE_CUBE_MAP_POSITIVE_X + i,
1075 0,
1076 0,
1077 0,
1078 tex.width,
1079 tex.height,
1080 pixfmts[ tex.channels - 1 ],
1081 GL_UNSIGNED_BYTE,
1082 faces[i]
1083 );
1084 #ifdef GLAD_GL
1085 if( tex.mipmap ) glGenerateMipmapEXT( GL_TEXTURE_CUBE_MAP );
1086 #else // GLES
1087 if( tex.mipmap ) glGenerateMipmap( GL_TEXTURE_CUBE_MAP );
1088 #endif
1089 }
1090
1091 void updateCubemapFace( Texture &tex, const GLvoid* data, unsigned int face ){
1092 // Faces can be indexed with either integers 0-5 or OpenGL enums.
1093 face %= GL_TEXTURE_CUBE_MAP_POSITIVE_X;
1094
1095 GLenum pixfmts[] = {
1096 GL_LUMINANCE,
1097 GL_LUMINANCE_ALPHA,
1098 GL_RGB,
1099 GL_RGBA
1100 };
1101
1102 glBindTexture( GL_TEXTURE_CUBE_MAP, tex.texture );
1103
1104 glTexSubImage2D(
1105 face,
1106 0,
1107 0,
1108 0,
1109 tex.width,
1110 tex.height,
1111 pixfmts[ tex.channels - 1 ],
1112 GL_UNSIGNED_BYTE,
1113 data
1114 );
1115 #ifdef GLAD_GL
1116 if( tex.mipmap ) glGenerateMipmapEXT( GL_TEXTURE_CUBE_MAP );
1117 #else // GLES
1118 if( tex.mipmap ) glGenerateMipmap( GL_TEXTURE_CUBE_MAP );
1119 #endif
1120 }
1121
1122 void setTexture( Texture tex, GLuint texSlot ){
1123 if( tex.success ){
1124 glActiveTexture( GL_TEXTURE0 + texSlot );
1125 glBindTexture( tex.type, tex.texture );
1126 }
1127 }
1128
1129 void setFog( Color col ){
1130 glUniform4f( drawPipeline.u_fog, col.r, col.g, col.b, col.a );
1131 fogColor = col;
1132 }
1133
1134 void setMetallicFactor( GLfloat f ){
1135 glUniform1f( drawPipeline.u_metallicFactor, f );
1136 }
1137
1138 void setRoughnessFactor( GLfloat f ){
1139 glUniform1f( drawPipeline.u_roughnessFactor, f );
1140 }
1141
1142 void setPipeline( Pipeline pipeline ){
1143 if( pipeline.success ){
1144 glUseProgram( pipeline.programObject );
1145 drawPipeline = pipeline;
1146 glUniform4f( drawPipeline.u_fog, fogColor.r, fogColor.g, fogColor.b, fogColor.a );
1147 // Bind the sampler locations.
1148 for( size_t i = 0; i < pipeline.slots.size(); i++ )
1149 glUniform1i( pipeline.slots[i], i );
1150 }
1151 }
1152
1153 Pipeline getPipeline(){
1154 return drawPipeline;
1155 }
1156
1157 void setTextureMatrix( linalg::mat<double,4,4> texMat ){
1158 texMatrix = texMat;
1159 }
1160
1161 void setLightMatrix( linalg::mat<double,4,4> lightMat ){
1162 lightMatrix = lightMat;
1163 }
1164
1165 Framebuffer createFramebuffer( GLsizei width, GLsizei height, bool cubemap = false ){
1166 // This framebuffer API does not currently support:
1167 // * multisampling (GLES 3.0+)
1168 // * mipmapping
1169
1170 Framebuffer fb = newFramebuffer;
1171 #ifdef GLAD_GL
1172 glGenFramebuffersEXT( 1, &fb.fbo );
1173 glBindFramebufferEXT( GL_FRAMEBUFFER_EXT, fb.fbo );
1174 #else // GLES
1175 glGenFramebuffers( 1, &fb.fbo );
1176 glBindFramebuffer( GL_FRAMEBUFFER, fb.fbo );
1177 #endif
1178
1179 fb.texture_type = cubemap ? GL_TEXTURE_CUBE_MAP : GL_TEXTURE_2D;
1180 glGenTextures( 1, &fb.texture );
1181 glBindTexture( fb.texture_type, fb.texture );
1182
1183 if( cubemap ){
1184 // Create 6 blank faces.
1185 for( unsigned int i = 0; i < 6; i++ ){
1186 glTexImage2D(
1187 GL_TEXTURE_CUBE_MAP_POSITIVE_X + i,
1188 0,
1189 GL_RGB,
1190 width,
1191 height,
1192 0,
1193 GL_RGB,
1194 GL_UNSIGNED_BYTE,
1195 nullptr
1196 );
1197 #ifdef GLAD_GL
1198 glFramebufferTexture2DEXT(
1199 GL_FRAMEBUFFER_EXT,
1200 GL_COLOR_ATTACHMENT0_EXT,
1201 GL_TEXTURE_CUBE_MAP_POSITIVE_X + i,
1202 fb.texture,
1203 0
1204 );
1205 #else
1206 glFramebufferTexture2D(
1207 GL_FRAMEBUFFER,
1208 GL_COLOR_ATTACHMENT0,
1209 GL_TEXTURE_CUBE_MAP_POSITIVE_X + i,
1210 fb.texture,
1211 0
1212 );
1213 #endif
1214 }
1215 }else{
1216 // Create a blank surface.
1217 glTexImage2D( GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, nullptr );
1218 #ifdef GLAD_GL
1219 glFramebufferTexture2DEXT( GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, fb.texture, 0 );
1220 #else
1221 glFramebufferTexture2D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, fb.texture, 0 );
1222 #endif
1223 }
1224
1225 glTexParameteri( fb.texture_type, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
1226 glTexParameteri( fb.texture_type, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
1227 glTexParameteri( fb.texture_type, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
1228 glTexParameteri( fb.texture_type, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
1229 // Unbind the texture.
1230 glBindTexture( fb.texture_type, 0 );
1231
1232 if( cubemap ){
1233 // Cubemap depth textures are unsupported.
1234 fb.texture_z = 0;
1235 // Create a depth renderbuffer.
1236 #ifdef GLAD_GL
1237 glGenRenderbuffersEXT( 1, &fb.rbo );
1238 glBindRenderbufferEXT( GL_RENDERBUFFER_EXT, fb.rbo );
1239 glRenderbufferStorageEXT( GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT16, width, height );
1240 glFramebufferRenderbufferEXT( GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, fb.rbo );
1241 #else // GLES
1242 glGenRenderbuffers( 1, &fb.rbo );
1243 glBindRenderbuffer( GL_RENDERBUFFER, fb.rbo );
1244 glRenderbufferStorage( GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, width, height );
1245 glFramebufferRenderbuffer( GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, fb.rbo );
1246 #endif
1247 }else{
1248 fb.rbo = 0;
1249 // Create a depth texture.
1250 glGenTextures( 1, &fb.texture_z );
1251 glBindTexture( GL_TEXTURE_2D, fb.texture_z );
1252 //glTexImage2D( GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT16, width, height, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, nullptr );
1253 glTexImage2D( GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, width, height, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, nullptr );
1254 #ifdef GLAD_GL
1255 glFramebufferTexture2DEXT( GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_TEXTURE_2D, fb.texture_z, 0 );
1256 #else // GLES
1257 glFramebufferTexture2D( GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, fb.texture_z, 0 );
1258 #endif
1259 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
1260 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
1261 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
1262 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
1263 // Unbind the texture.
1264 glBindTexture( GL_TEXTURE_2D, 0 );
1265 }
1266
1267 fb.success =
1268 #ifdef GLAD_GL
1269 glCheckFramebufferStatusEXT( GL_FRAMEBUFFER_EXT ) == GL_FRAMEBUFFER_COMPLETE_EXT;
1270 #else // GLES
1271 glCheckFramebufferStatus( GL_FRAMEBUFFER ) == GL_FRAMEBUFFER_COMPLETE;
1272 #endif
1273
1274 fb.width = width;
1275 fb.height = height;
1276 return fb;
1277 }
1278
1279 void resizeFramebuffer( Framebuffer &fb, GLsizei width, GLsizei height ){
1280 // Only resize if necessary.
1281 if( fb.width == width && fb.height == height ) return;
1282
1283 #ifdef GLAD_GL
1284 glBindFramebufferEXT( GL_FRAMEBUFFER_EXT, fb.fbo );
1285 #else // GLES
1286 glBindFramebuffer( GL_FRAMEBUFFER, fb.fbo );
1287 #endif
1288
1289 glBindTexture( fb.texture_type, fb.texture );
1290
1291 if( fb.texture_type == GL_TEXTURE_CUBE_MAP ){
1292 // Resize the 6 faces.
1293 for( unsigned int i = 0; i < 6; i++ ){
1294 glTexImage2D(
1295 GL_TEXTURE_CUBE_MAP_POSITIVE_X + i,
1296 0,
1297 GL_RGB,
1298 width,
1299 height,
1300 0,
1301 GL_RGB,
1302 GL_UNSIGNED_BYTE,
1303 nullptr
1304 );
1305 }
1306 }else{
1307 // Resize the texture.
1308 glTexImage2D( GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, nullptr );
1309 }
1310
1311 // Unbind the texture.
1312 glBindTexture( fb.texture_type, 0 );
1313
1314 if( fb.texture_type == GL_TEXTURE_CUBE_MAP ){
1315 // Replace the depth renderbuffer.
1316 #ifdef GLAD_GL
1317 glDeleteRenderbuffersEXT( 1, &fb.rbo );
1318 glGenRenderbuffersEXT( 1, &fb.rbo );
1319 glBindRenderbufferEXT( GL_RENDERBUFFER_EXT, fb.rbo );
1320 glRenderbufferStorageEXT( GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT16, width, height );
1321 glFramebufferRenderbufferEXT( GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, fb.rbo );
1322 #else // GLES
1323 glDeleteRenderbuffers( 1, &fb.rbo );
1324 glGenRenderbuffers( 1, &fb.rbo );
1325 glBindRenderbuffer( GL_RENDERBUFFER, fb.rbo );
1326 glRenderbufferStorage( GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, width, height );
1327 glFramebufferRenderbuffer( GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, fb.rbo );
1328 #endif
1329 }else{
1330 // Resize the depth texture.
1331 glBindTexture( GL_TEXTURE_2D, fb.texture_z );
1332 //glTexImage2D( GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT16, width, height, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, nullptr );
1333 glTexImage2D( GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, width, height, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, nullptr );
1334 // Unbind the texture.
1335 glBindTexture( GL_TEXTURE_2D, 0 );
1336 }
1337
1338 fb.success =
1339 #ifdef GLAD_GL
1340 glCheckFramebufferStatusEXT( GL_FRAMEBUFFER_EXT ) == GL_FRAMEBUFFER_COMPLETE_EXT;
1341 #else // GLES
1342 glCheckFramebufferStatus( GL_FRAMEBUFFER ) == GL_FRAMEBUFFER_COMPLETE;
1343 #endif
1344
1345 fb.width = width;
1346 fb.height = height;
1347 }
1348
1349 Texture getFramebufferTexture( Framebuffer &fb ){
1350 Texture tex = newTexture;
1351 tex.success = fb.success;
1352 tex.texture = fb.texture;
1353 tex.width = fb.width;
1354 tex.height = fb.height;
1355 tex.channels = 4;
1356 tex.mipmap = false; // TODO: mipmapping
1357 tex.type = fb.texture_type;
1358 return tex;
1359 }
1360
1361 // Used by setFramebuffer.
1362 Display getDisplay();
1363
1364 void setFramebuffer( Framebuffer fb = newFramebuffer ){
1365 // Set the drawing target to the framebuffer or the screen.
1366 if( fb.success ){
1367 #ifdef GLAD_GL
1368 glBindFramebufferEXT( GL_FRAMEBUFFER_EXT, fb.fbo );
1369 #else // GLES
1370 glBindFramebuffer( GL_FRAMEBUFFER, fb.fbo );
1371 #endif
1372 glViewport( 0, 0, fb.width, fb.height );
1373 }else{
1374 #ifdef GLAD_GL
1375 glBindFramebufferEXT( GL_FRAMEBUFFER_EXT, 0 );
1376 #else // GLES
1377 glBindFramebuffer( GL_FRAMEBUFFER, 0 );
1378 #endif
1379 auto disp = getDisplay();
1380 glViewport( 0, 0, disp.width, disp.height );
1381 }
1382 }
1383
1384 void drawFramebuffer( Framebuffer &fb, bool draw_z = false ){
1385 if( !fb.success ) return;
1386 glDisable( GL_DEPTH_TEST );
1387 glDisable( GL_CULL_FACE );
1388 glActiveTexture( GL_TEXTURE0 );
1389 glBindTexture( fb.texture_type, draw_z ? fb.texture_z : fb.texture );
1390 texMatrix = linalg::identity;
1391 // Stretch to screen bounds and flip vertically.
1392 drawMesh(
1393 planeMesh,
1394 linalg::scaling_matrix( linalg::vec<double,3>( 2.0, -2.0, 0.0 ) ),
1395 linalg::identity,
1396 linalg::identity
1397 );
1398 glEnable( GL_DEPTH_TEST );
1399 glEnable( GL_CULL_FACE );
1400 }
1401
1402 Framebuffer getIrradianceFramebuffer( Texture in_cubemap, Framebuffer fb = newFramebuffer ){
1403 if( !fb.success ) fb = createFramebuffer( 32, 32, true );
1404 setFramebuffer( fb );
1405
1406 // Degrees to radians.
1407 const double d2r = 0.01745329251994329577;
1408
1409 linalg::vec<double,3> viewAngles[] = {
1410 { 0.0, -90.0, 180.0 }, // Right
1411 { 0.0, 90.0, 180.0 }, // Left
1412 { 90.0, 0.0, 0.0 }, // Top
1413 { -90.0, 0.0, 0.0 }, // Bottom
1414 { 0.0, 180.0, 180.0 }, // Back
1415 { 0.0, 0.0, 180.0 } // Front
1416 };
1417
1418 linalg::mat<double,4,4> projMat = linalg::perspective_matrix( 90.0 * d2r, 1.0, 0.1, 10.0 );
1419
1420 auto old_pipeline = drawPipeline;
1421 setPipeline( irradiancePipeline );
1422 glDisable( GL_BLEND );
1423 glDisable( GL_CULL_FACE );
1424 setTexture( in_cubemap, 0 );
1425
1426 for( unsigned int i = 0; i < 6; i++ ){
1427 #ifdef GLAD_GL
1428 glFramebufferTexture2DEXT(
1429 GL_FRAMEBUFFER_EXT,
1430 GL_COLOR_ATTACHMENT0_EXT,
1431 GL_TEXTURE_CUBE_MAP_POSITIVE_X + i,
1432 fb.texture,
1433 0
1434 );
1435 #else // GLES
1436 glFramebufferTexture2D(
1437 GL_FRAMEBUFFER,
1438 GL_COLOR_ATTACHMENT0,
1439 GL_TEXTURE_CUBE_MAP_POSITIVE_X + i,
1440 fb.texture,
1441 0
1442 );
1443 #endif
1444 glClear( GL_DEPTH_BUFFER_BIT );
1445 drawMesh(
1446 cubeMesh,
1447 linalg::identity,
1448 linalg::rotation_matrix(
1449 eulerToQuat(
1450 viewAngles[i].x * d2r,
1451 viewAngles[i].y * d2r,
1452 viewAngles[i].z * d2r
1453 )
1454 ),
1455 projMat
1456 );
1457 }
1458
1459 setFramebuffer();
1460 setPipeline( old_pipeline );
1461 glEnable( GL_CULL_FACE );
1462 return fb;
1463 }
1464
1465 void drawSkybox( Texture &tex, linalg::mat<double,4,4> view, linalg::mat<double,4,4> proj, Color tint = newColor ){
1466 if( !skyboxPipeline.success ) return;
1467 auto old_pipeline = drawPipeline;
1468 setPipeline( skyboxPipeline );
1469 glUniform4f( drawPipeline.u_fog, tint.r, tint.g, tint.b, tint.a );
1470 glDisable( GL_CULL_FACE );
1471 setTexture( tex, 0 );
1472 // Extract the 3x3 rotation matrix from the view matrix.
1473 // The camera is effectively at <0,0,0> with the skybox.
1474 drawMesh(
1475 cubeMesh,
1476 linalg::identity,
1477 linalg::mat<double,4,4>(
1478 { view[0][0], view[0][1], view[0][2], 0.0 },
1479 { view[1][0], view[1][1], view[1][2], 0.0 },
1480 { view[2][0], view[2][1], view[2][2], 0.0 },
1481 { 0.0, 0.0, 0.0, 1.0 }
1482 ),
1483 proj
1484 );
1485 glUniform4f( drawPipeline.u_fog, fogColor.r, fogColor.g, fogColor.b, fogColor.a );
1486 setPipeline( old_pipeline );
1487 glEnable( GL_CULL_FACE );
1488 }
1489
1490 int compileShader( GLuint shader ){
1491 glCompileShader( shader );
1492 GLint compiled;
1493 glGetShaderiv( shader, GL_COMPILE_STATUS, &compiled );
1494 if( !compiled ){
1495 fprintf( stderr, "Failed to compile shader.\n" );
1496 GLint infoLen = 0;
1497 glGetShaderiv( shader, GL_INFO_LOG_LENGTH, &infoLen );
1498 if( infoLen > 1 ){
1499 char* infoLog = new char[infoLen];
1500 glGetShaderInfoLog( shader, infoLen, nullptr, infoLog );
1501 fprintf( stderr, "%s\n", infoLog );
1502 delete[] infoLog;
1503 }
1504 glDeleteShader( shader );
1505 return 0;
1506 }
1507 GLint debugout;
1508 glGetShaderiv( shader, GL_SHADER_TYPE, &debugout );
1509 if( verbose ){
1510 printf( "%s\n", ( debugout == GL_VERTEX_SHADER ? "VERTEX SHADER" : "FRAGMENT SHADER" ) );
1511 printf( "Shader address: %d\n", shader );
1512 }
1513 glGetShaderiv( shader, GL_SHADER_SOURCE_LENGTH, &debugout );
1514 if( verbose ) printf( "Shader source length: %d\n\n", debugout );
1515 return 1;
1516 }
1517
1518 int linkProgram( GLuint programObject ){
1519 glLinkProgram( programObject );
1520 GLint infoLen = 0;
1521 GLint linked;
1522 glGetProgramiv( programObject, GL_LINK_STATUS, &linked );
1523 if( !linked ){
1524 fprintf( stderr, "Failed to link shader program.\n" );
1525 glGetProgramiv( programObject, GL_INFO_LOG_LENGTH, &infoLen );
1526 if( infoLen > 1 ){
1527 char* infoLog = new char[infoLen];
1528 glGetProgramInfoLog( programObject, infoLen, nullptr, infoLog );
1529 fprintf( stderr, "%s\n", infoLog );
1530 delete[] infoLog;
1531 }
1532 glDeleteProgram( programObject );
1533 return 0;
1534 }
1535 if( verbose ){
1536 printf( "PROGRAM OBJECT\n" );
1537 printf( "Program object address: %d\n", programObject );
1538 }
1539 GLint debugout;
1540 glGetProgramiv( programObject, GL_ATTACHED_SHADERS, &debugout );
1541 if( verbose ) printf( "Attached shaders: %d\n", debugout );
1542 glGetProgramiv( programObject, GL_ACTIVE_ATTRIBUTES, &debugout );
1543 if( verbose ) printf( "Active attributes: %d\n", debugout );
1544 glGetProgramiv( programObject, GL_ACTIVE_UNIFORMS, &debugout );
1545 if( verbose ) printf( "Active uniforms: %d\n", debugout );
1546
1547 glValidateProgram( programObject );
1548 glGetProgramiv( programObject, GL_VALIDATE_STATUS, &debugout );
1549 if( verbose )
1550 printf( "%s\n", ( debugout == GL_TRUE ? "Program object is valid." : "Program object is not valid." ) );
1551 glGetProgramiv( programObject, GL_INFO_LOG_LENGTH, &infoLen );
1552 if( infoLen > 1 ){
1553 char* infoLog = new char[infoLen];
1554 glGetProgramInfoLog( programObject, infoLen, nullptr, infoLog );
1555 if( verbose ) printf( "%s\n", infoLog );
1556 delete[] infoLog;
1557 }
1558
1559 printf( "\n" );
1560
1561 return 1;
1562 }
1563
1564 Pipeline loadPipeline( const char* vertSrc, const char* fragSrc, std::vector<std::string> samplers = {} ){
1565 Pipeline pipeline = newPipeline;
1566
1567 GLuint vert;
1568 if( ( vert = glCreateShader( GL_VERTEX_SHADER ) ) == 0 ) return pipeline;
1569 const char* vertStrings[] = { shaderHeader, vertSrc };
1570 glShaderSource( vert, 2, vertStrings, nullptr );
1571 if( !compileShader( vert ) ) return pipeline;
1572
1573 GLuint frag;
1574 if( ( frag = glCreateShader( GL_FRAGMENT_SHADER ) ) == 0 ) return pipeline;
1575 const char* fragStrings[] = { shaderHeader, fragSrc };
1576 glShaderSource( frag, 2, fragStrings, nullptr );
1577 if( !compileShader( frag ) ) return pipeline;
1578
1579 GLuint programObject;
1580 if( ( programObject = glCreateProgram() ) == 0 ) return pipeline;
1581 glAttachShader( programObject, vert );
1582 glAttachShader( programObject, frag );
1583
1584 // only needed if layout qualifier is not used (like in OpenGL 2.0)
1585 glBindAttribLocation( programObject, 0, "a_Position" );
1586 glBindAttribLocation( programObject, 1, "a_Normal" );
1587 glBindAttribLocation( programObject, 2, "a_Tangent" );
1588 glBindAttribLocation( programObject, 3, "a_UV" );
1589
1590 if( !linkProgram( programObject ) ) return pipeline;
1591
1592 // https://stackoverflow.com/questions/39784072/is-there-garbage-collection-on-the-gpu
1593 // https://gamedev.stackexchange.com/questions/47910/after-a-succesful-gllinkprogram-should-i-delete-detach-my-shaders
1594 glDetachShader( programObject, vert );
1595 glDeleteShader( vert );
1596 glDetachShader( programObject, frag );
1597 glDeleteShader( frag );
1598
1599 pipeline.success = true;
1600 pipeline.programObject = programObject;
1601 pipeline.u_metallicFactor = glGetUniformLocation( programObject, "u_metallicFactor" );
1602 pipeline.u_roughnessFactor = glGetUniformLocation( programObject, "u_roughnessFactor" );
1603 pipeline.u_matrices = glGetUniformLocation( programObject, "u_matrices" );
1604 pipeline.u_fog = glGetUniformLocation( programObject, "u_fog" );
1605 pipeline.u_camera = glGetUniformLocation( programObject, "u_camera" );
1606
1607 // Add the sampler locations to be bound in setPipeline.
1608 for( size_t i = 0; i < samplers.size(); i++ )
1609 pipeline.slots.push_back( glGetUniformLocation( programObject, samplers[i].c_str() ) );
1610
1611 return pipeline;
1612 }
1613
1614 Display createDisplay( unsigned int width, unsigned int height, std::string title, int multisamples = 4, bool HiDPI = false, bool vsync = true ){
1615 // Opens a window with a GL context.
1616 // Display display = createDisplay( 800, 600, "Title" );
1617
1618 Display disp = newDisplay;
1619
1620 if( SDL_Init( SDL_INIT_VIDEO | SDL_INIT_GAMECONTROLLER ) < 0 ){
1621 fprintf( stderr, "Failed to initialize SDL.\n" );
1622 return disp;
1623 }
1624
1625 if( verbose ) printf( "Creating GL 2 window...\n" );
1626
1627 SDL_GL_LoadLibrary( nullptr );
1628
1629 #ifdef GLAD_GL
1630 SDL_GL_SetAttribute( SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_COMPATIBILITY );
1631 #else // GLES
1632 SDL_GL_SetAttribute( SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES );
1633 #endif
1634 SDL_GL_SetAttribute( SDL_GL_CONTEXT_MAJOR_VERSION, 2 );
1635 SDL_GL_SetAttribute( SDL_GL_CONTEXT_MINOR_VERSION, 0 );
1636
1637 if( multisamples > 1 ){
1638 SDL_GL_SetAttribute( SDL_GL_MULTISAMPLEBUFFERS, 1 );
1639 SDL_GL_SetAttribute( SDL_GL_MULTISAMPLESAMPLES, multisamples );
1640 }else{
1641 #ifdef __EMSCRIPTEN__
1642 EmscriptenWebGLContextAttributes att;
1643 emscripten_webgl_init_context_attributes( &att );
1644 att.antialias = EM_FALSE;
1645 att.majorVersion = 1;
1646 att.minorVersion = 0;
1647 emscripten_webgl_make_context_current( emscripten_webgl_create_context( 0, &att ) );
1648 #endif
1649 }
1650
1651 #ifdef __EMSCRIPTEN__
1652 // Emscripten's fixed-resolution canvas doesn't always scale properly.
1653 // Force full window.
1654 if( true ){
1655 #else
1656 if( width == 0 && height == 0 ){
1657 #endif
1658 window = SDL_CreateWindow(
1659 title.c_str(),
1660 SDL_WINDOWPOS_UNDEFINED,
1661 SDL_WINDOWPOS_UNDEFINED,
1662 0,
1663 0,
1664 HiDPI ?
1665 ( SDL_WINDOW_FULLSCREEN_DESKTOP | SDL_WINDOW_OPENGL | SDL_WINDOW_ALLOW_HIGHDPI ) :
1666 ( SDL_WINDOW_FULLSCREEN_DESKTOP | SDL_WINDOW_OPENGL )
1667 );
1668 #ifdef __EMSCRIPTEN__
1669 SDL_SetWindowFullscreen( window, 0 ); // Complicated reasons for needing this.
1670 EmscriptenFullscreenStrategy strat;
1671 strat.scaleMode = EMSCRIPTEN_FULLSCREEN_SCALE_STRETCH;
1672 strat.canvasResolutionScaleMode =
1673 HiDPI ?
1674 EMSCRIPTEN_FULLSCREEN_CANVAS_SCALE_HIDEF :
1675 EMSCRIPTEN_FULLSCREEN_CANVAS_SCALE_STDDEF;
1676 strat.filteringMode = EMSCRIPTEN_FULLSCREEN_FILTERING_NEAREST;
1677 emscripten_enter_soft_fullscreen( 0, &strat );
1678 width = (unsigned int)FG2_GET_CANVAS_WIDTH;
1679 height = (unsigned int)FG2_GET_CANVAS_HEIGHT;
1680 #else
1681 int winw, winh;
1682 SDL_GetWindowSize( window, &winw, &winh );
1683 width = (unsigned int)winw;
1684 height = (unsigned int)winh;
1685 #endif
1686 }else{
1687 window = SDL_CreateWindow(
1688 title.c_str(),
1689 SDL_WINDOWPOS_CENTERED,
1690 SDL_WINDOWPOS_CENTERED,
1691 width,
1692 height,
1693 HiDPI ?
1694 ( SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI ) :
1695 ( SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE )
1696 );
1697 }
1698 if( !window ){
1699 fprintf( stderr, "Failed to create GL window.\n" );
1700 return disp;
1701 }
1702 ctx = SDL_GL_CreateContext( window );
1703 if( !ctx ){
1704 fprintf( stderr, "Failed to create GL context.\n" );
1705 return disp;
1706 }
1707 if( vsync ){
1708 // Try to set up late swap tearing or vsync.
1709 if( SDL_GL_SetSwapInterval( -1 ) < 0 )
1710 if( SDL_GL_SetSwapInterval( 1 ) < 0 ) SDL_GL_SetSwapInterval( 0 );
1711 }else{
1712 // No vsync.
1713 SDL_GL_SetSwapInterval( 0 );
1714 }
1715
1716 windowID = SDL_GetWindowID( window );
1717
1718 #if defined(GLAD_GL)
1719 int version = gladLoadGL( (GLADloadfunc)SDL_GL_GetProcAddress );
1720 #elif defined(__EMSCRIPTEN__)
1721 // Work around a regression in SDL 2.0.12.
1722 int version = gladLoadGLES2( (GLADloadfunc)emscripten_webgl1_get_proc_address );
1723 #else
1724 int version = gladLoadGLES2( (GLADloadfunc)SDL_GL_GetProcAddress );
1725 #endif
1726
1727 if( version == 0 ){
1728 fprintf( stderr, "Failed to use extension loader.\n" );
1729 return disp;
1730 }
1731
1732 if( verbose ){
1733 printf( "Success!\n" );
1734 printf( "OpenGL vendor: %s\n", glGetString( GL_VENDOR ) );
1735 printf( "OpenGL renderer: %s\n", glGetString( GL_RENDERER ) );
1736 printf( "OpenGL version: %s\n", glGetString( GL_VERSION ) );
1737 printf( "GLSL version: %s\n\n", glGetString( GL_SHADING_LANGUAGE_VERSION ) );
1738 }
1739
1740 glEnable( GL_CULL_FACE );
1741 glEnable( GL_DEPTH_TEST );
1742 glDepthFunc( GL_LEQUAL );
1743 glDepthMask( GL_TRUE );
1744 if( multisamples > 1 ) glEnable( GL_SAMPLE_ALPHA_TO_COVERAGE );
1745
1746 unlitPipeline = loadPipeline( unlitVert, unlitFrag, unlitSamplers );
1747 if( unlitPipeline.success ){
1748 if( verbose ) printf( "Unlit pipeline loaded successfully.\n\n" );
1749 }else{
1750 fprintf( stderr, "Failed to load unlit pipeline.\n\n" );
1751 return disp;
1752 }
1753 setPipeline( unlitPipeline );
1754
1755 colorModPipeline = loadPipeline( unlitVert, colorModFrag, colorModSamplers );
1756 if( colorModPipeline.success ){
1757 if( verbose ) printf( "Color mod pipeline loaded successfully.\n\n" );
1758 }else{
1759 fprintf( stderr, "Failed to load color mod pipeline.\n\n" );
1760 return disp;
1761 }
1762
1763 skyboxPipeline = loadPipeline( skyboxVert, skyboxFrag, skyboxSamplers );
1764 if( skyboxPipeline.success ){
1765 if( verbose ) printf( "Skybox pipeline loaded successfully.\n\n" );
1766 }else{
1767 fprintf( stderr, "Failed to load skybox pipeline.\n\n" );
1768 }
1769
1770 irradiancePipeline = loadPipeline( skyboxVert, irradianceFrag, irradianceSamplers );
1771 if( irradiancePipeline.success ){
1772 if( verbose ) printf( "Irradiance pipeline loaded successfully.\n\n" );
1773 }else{
1774 fprintf( stderr, "Failed to load irradiance pipeline.\n\n" );
1775 }
1776
1777 unsigned char pixels[] = { 0xFF, 0xFF, 0xFF, 0xFF };
1778
1779 blankTexture = loadTexture( pixels, 2, 2, 1, false, false );
1780 if( blankTexture.success ){
1781 if( verbose ) printf( "Blank texture loaded successfully.\n\n" );
1782 }else{
1783 fprintf( stderr, "Failed to load blank texture.\n\n" );
1784 return disp;
1785 }
1786
1787 std::vector<Vertex> vertices;
1788 std::vector<Index> indices;
1789
1790 vertices = {
1791 { { -0.5, 0.5, 0.0 }, { 0.0, 0.0, 1.0 }, { 1.0, 0.0, 0.0 }, { 0.0, 0.0 } },
1792 { { -0.5, -0.5, 0.0 }, { 0.0, 0.0, 1.0 }, { 1.0, 0.0, 0.0 }, { 0.0, 1.0 } },
1793 { { 0.5, -0.5, 0.0 }, { 0.0, 0.0, 1.0 }, { 1.0, 0.0, 0.0 }, { 1.0, 1.0 } },
1794 { { 0.5, 0.5, 0.0 }, { 0.0, 0.0, 1.0 }, { 1.0, 0.0, 0.0 }, { 1.0, 0.0 } }
1795 };
1796
1797 indices = { 0, 1, 2, 2, 3, 0 };
1798
1799 planeMesh = loadMesh( vertices, indices );
1800 if( planeMesh.success ){
1801 if( verbose ) printf( "Plane mesh loaded successfully.\n\n" );
1802 }else{
1803 fprintf( stderr, "Failed to load plane mesh.\n\n" );
1804 return disp;
1805 }
1806
1807 vertices = {
1808 { { -0.5, 0.5, 0.5 }, { 0.0, 0.0, 1.0 }, { 1.0, 0.0, 0.0 }, { 0.0, 0.0 } },
1809 { { -0.5, -0.5, 0.5 }, { 0.0, 0.0, 1.0 }, { 1.0, 0.0, 0.0 }, { 0.0, 1.0 } },
1810 { { 0.5, -0.5, 0.5 }, { 0.0, 0.0, 1.0 }, { 1.0, 0.0, 0.0 }, { 1.0, 1.0 } },
1811 { { 0.5, 0.5, 0.5 }, { 0.0, 0.0, 1.0 }, { 1.0, 0.0, 0.0 }, { 1.0, 0.0 } },
1812 { { 0.5, 0.5, 0.5 }, { 1.0, 0.0, 0.0 }, { 0.0, 0.0, -1.0 }, { 0.0, 0.0 } },
1813 { { 0.5, -0.5, 0.5 }, { 1.0, 0.0, 0.0 }, { 0.0, 0.0, -1.0 }, { 0.0, 1.0 } },
1814 { { 0.5, -0.5, -0.5 }, { 1.0, 0.0, 0.0 }, { 0.0, 0.0, -1.0 }, { 1.0, 1.0 } },
1815 { { 0.5, 0.5, -0.5 }, { 1.0, 0.0, 0.0 }, { 0.0, 0.0, -1.0 }, { 1.0, 0.0 } },
1816 { { -0.5, 0.5, -0.5 }, { -1.0, 0.0, 0.0 }, { 0.0, 0.0, 1.0 }, { 0.0, 0.0 } },
1817 { { -0.5, -0.5, -0.5 }, { -1.0, 0.0, 0.0 }, { 0.0, 0.0, 1.0 }, { 0.0, 1.0 } },
1818 { { -0.5, -0.5, 0.5 }, { -1.0, 0.0, 0.0 }, { 0.0, 0.0, 1.0 }, { 1.0, 1.0 } },
1819 { { -0.5, 0.5, 0.5 }, { -1.0, 0.0, 0.0 }, { 0.0, 0.0, 1.0 }, { 1.0, 0.0 } },
1820 { { 0.5, 0.5, -0.5 }, { 0.0, 0.0, -1.0 }, { -1.0, 0.0, 0.0 }, { 0.0, 0.0 } },
1821 { { 0.5, -0.5, -0.5 }, { 0.0, 0.0, -1.0 }, { -1.0, 0.0, 0.0 }, { 0.0, 1.0 } },
1822 { { -0.5, -0.5, -0.5 }, { 0.0, 0.0, -1.0 }, { -1.0, 0.0, 0.0 }, { 1.0, 1.0 } },
1823 { { -0.5, 0.5, -0.5 }, { 0.0, 0.0, -1.0 }, { -1.0, 0.0, 0.0 }, { 1.0, 0.0 } },
1824 { { -0.5, 0.5, -0.5 }, { 0.0, 1.0, 0.0 }, { 1.0, 0.0, 0.0 }, { 1.0, 1.0 } },
1825 { { -0.5, 0.5, 0.5 }, { 0.0, 1.0, 0.0 }, { 1.0, 0.0, 0.0 }, { 1.0, 0.0 } },
1826 { { 0.5, 0.5, 0.5 }, { 0.0, 1.0, 0.0 }, { 1.0, 0.0, 0.0 }, { 0.0, 0.0 } },
1827 { { 0.5, 0.5, -0.5 }, { 0.0, 1.0, 0.0 }, { 1.0, 0.0, 0.0 }, { 0.0, 1.0 } },
1828 { { -0.5, -0.5, 0.5 }, { 0.0, -1.0, 0.0 }, { 1.0, 0.0, 0.0 }, { 0.0, 0.0 } },
1829 { { -0.5, -0.5, -0.5 }, { 0.0, -1.0, 0.0 }, { 1.0, 0.0, 0.0 }, { 0.0, 1.0 } },
1830 { { 0.5, -0.5, -0.5 }, { 0.0, -1.0, 0.0 }, { 1.0, 0.0, 0.0 }, { 1.0, 1.0 } },
1831 { { 0.5, -0.5, 0.5 }, { 0.0, -1.0, 0.0 }, { 1.0, 0.0, 0.0 }, { 1.0, 0.0 } }
1832 };
1833
1834 indices = {
1835 0, 1, 2, 2, 3, 0,
1836 4, 5, 6, 6, 7, 4,
1837 8, 9, 10, 10, 11, 8,
1838 12, 13, 14, 14, 15, 12,
1839 16, 17, 18, 18, 19, 16,
1840 20, 21, 22, 22, 23, 20
1841 };
1842
1843 cubeMesh = loadMesh( vertices, indices );
1844 if( cubeMesh.success ){
1845 if( verbose ) printf( "Cube mesh loaded successfully.\n\n" );
1846 }else{
1847 fprintf( stderr, "Failed to load cube mesh.\n\n" );
1848 return disp;
1849 }
1850
1851 // Avoid a segfault when keys are accessed before the first sync.
1852 keystates = SDL_GetKeyboardState( nullptr );
1853
1854 #ifndef __EMSCRIPTEN__
1855 // Attempt to load the controller database file.
1856 const char* mappings_file = "gamecontrollerdb.txt";
1857 if( SDL_GameControllerAddMappingsFromFile( mappings_file ) < 0 ){
1858 fprintf( stderr, "Failed to load %s: %s\n", mappings_file, SDL_GetError() );
1859 }
1860 #endif
1861
1862 // Open the first available controller.
1863 for( int i = 0; i < SDL_NumJoysticks(); i++ ){
1864 if( SDL_IsGameController( i ) ){
1865 controller = SDL_GameControllerOpen( i );
1866 if( controller ){
1867 break;
1868 }else{
1869 fprintf( stderr, "Failed to open game controller %d: %s\n", i, SDL_GetError() );
1870 }
1871 }
1872 }
1873
1874 // SDL cannot fill in mouse position until the mouse moves.
1875
1876 disp.success = true;
1877 disp.width = width;
1878 disp.height = height;
1879 disp.title = title;
1880 return disp;
1881 }
1882
1883 Display getDisplay(){
1884 Display disp = newDisplay;
1885 #ifdef __EMSCRIPTEN__
1886 int width = FG2_GET_CANVAS_WIDTH, height = FG2_GET_CANVAS_HEIGHT;
1887 #else
1888 int width, height;
1889 SDL_GetWindowSize( window, &width, &height );
1890 #endif
1891 disp.success = width > 0 ? true : false;
1892 disp.width = (unsigned int)width;
1893 disp.height = (unsigned int)height;
1894 if( disp.success ) disp.title = SDL_GetWindowTitle( window );
1895 return disp;
1896 }
1897
1898 unsigned int getDisplayWidth(){
1899 #ifdef __EMSCRIPTEN__
1900 return (unsigned int)FG2_GET_CANVAS_WIDTH;
1901 #else
1902 int width;
1903 SDL_GetWindowSize( window, &width, nullptr );
1904 return (unsigned int)width;
1905 #endif
1906 }
1907
1908 unsigned int getDisplayHeight(){
1909 #ifdef __EMSCRIPTEN__
1910 return (unsigned int)FG2_GET_CANVAS_HEIGHT;
1911 #else
1912 int height;
1913 SDL_GetWindowSize( window, nullptr, &height );
1914 return (unsigned int)height;
1915 #endif
1916 }
1917
1918 double deltaTime(){
1919 Uint64 last = now;
1920 now = SDL_GetPerformanceCounter();
1921 return ( now - last ) / (double)SDL_GetPerformanceFrequency();
1922 }
1923
1924 // Used by syncEvents.
1925 void end();
1926
1927 void syncEvents(){
1928 int sdlWidth, sdlHeight; // Not always the actual width and height.
1929 #ifdef __EMSCRIPTEN__
1930 SDL_GL_GetDrawableSize( window, &sdlWidth, &sdlHeight );
1931 int canvasWidth = FG2_GET_CANVAS_WIDTH, canvasHeight = FG2_GET_CANVAS_HEIGHT;
1932 EmscriptenMouseEvent mouseState;
1933 if( emscripten_get_mouse_status( &mouseState ) == EMSCRIPTEN_RESULT_SUCCESS ){
1934 mouseX = mouseState.canvasX;
1935 mouseY = mouseState.canvasY;
1936 }
1937 #endif
1938 // Used for touch scaling.
1939 double screenWidth = getDisplayWidth(), screenHeight = getDisplayHeight();
1940 mouseMoveX = 0;
1941 mouseMoveY = 0;
1942 mouseWheel = 0;
1943 touchStart = false;
1944 textReturnStart = false;
1945 SDL_Event event = {};
1946 while( SDL_PollEvent( &event ) ){
1947 if( event.type == SDL_MOUSEMOTION ){
1948 #ifdef __EMSCRIPTEN__ // canvas[Width|Height] != sdl[Width|Height], distorting mouse movement
1949 mouseMoveX += (double)canvasWidth / (double)sdlWidth * (double)event.motion.xrel;
1950 mouseMoveY += (double)canvasHeight / (double)sdlHeight * (double)event.motion.yrel;
1951 #else
1952 mouseMoveX += event.motion.xrel;
1953 mouseMoveY += event.motion.yrel;
1954 mouseX = event.motion.x;
1955 mouseY = event.motion.y;
1956 #endif
1957 }else if( event.type == SDL_MOUSEWHEEL ){
1958 mouseWheel = event.wheel.direction == SDL_MOUSEWHEEL_FLIPPED
1959 ? event.wheel.y * -1 : event.wheel.y;
1960 }else if( event.type == SDL_FINGERDOWN
1961 || event.type == SDL_FINGERMOTION ){
1962 // TODO: mouseMoveX, mouseMoveY
1963 mouseX = event.tfinger.x * screenWidth;
1964 mouseY = event.tfinger.y * screenHeight;
1965 touchPressure = event.tfinger.pressure;
1966 if( event.type == SDL_FINGERDOWN ) touchStart = true;
1967 }else if( event.type == SDL_FINGERUP ){
1968 touchPressure = 0.0f;
1969 }else if( event.type == SDL_QUIT ){
1970 end();
1971 }else if( event.type == SDL_WINDOWEVENT
1972 && event.window.windowID == windowID
1973 && event.window.event == SDL_WINDOWEVENT_SIZE_CHANGED ){
1974 #ifdef __EMSCRIPTEN__
1975 glViewport( 0, 0, canvasWidth, canvasHeight );
1976 #else
1977 SDL_GL_GetDrawableSize( window, &sdlWidth, &sdlHeight );
1978 glViewport( 0, 0, sdlWidth, sdlHeight );
1979 #endif
1980 }else if( textInputEnabled && event.type == SDL_TEXTINPUT ){
1981 // Text input from keyboard or IME.
1982 textInputString += event.text.text;
1983 }else if( textInputEnabled && event.type == SDL_KEYDOWN
1984 && event.key.keysym.sym == SDLK_BACKSPACE
1985 && textInputString.length() > 0 ){
1986 // Backspace deletion.
1987 textInputString.pop_back();
1988 }else if( textInputEnabled && event.type == SDL_KEYDOWN
1989 && ( event.key.keysym.sym == SDLK_RETURN
1990 || event.key.keysym.sym == SDLK_KP_ENTER ) ){
1991 // For handling the Enter key during text input.
1992 textReturnStart = true;
1993 }
1994 }
1995 keystates = SDL_GetKeyboardState( nullptr );
1996 // Handle controller hotplugging.
1997 if( !controller || !SDL_GameControllerGetAttached( controller ) ){
1998 controller = nullptr;
1999 // Open the first available controller.
2000 for( int i = 0; i < SDL_NumJoysticks(); i++ ){
2001 if( SDL_IsGameController( i ) ){
2002 // Open the controller.
2003 controller = SDL_GameControllerOpen( i );
2004 if( controller ) break;
2005 }
2006 }
2007 }
2008 }
2009
2010 void sync(){
2011 SDL_GL_SwapWindow( window );
2012 syncEvents();
2013 }
2014
2015 void setTextInput( int x = 0, int y = 0, int w = 0, int h = 0 ){
2016 // https://wiki.libsdl.org/Tutorials/TextInput
2017 if( x || y || w || h ){
2018 textInputRect = { x, y, w, h };
2019 #ifdef __EMSCRIPTEN__
2020 // Add a text input element.
2021 EM_ASM( {
2022 // Helper form.
2023 var form = document.getElementById( "FFORM" );
2024 if( form == null ){
2025 form = document.createElement( "form" );
2026 form.id = "FFORM";
2027 form.action = "/";
2028 form.style.position = "absolute";
2029 form.style.left = "0px";
2030 form.style.top = "0px";
2031 form.style.margin = 0;
2032 form.style.border = 0;
2033 form.style.padding = 0;
2034 document.body.appendChild( form );
2035 var submit = document.createElement( "input" );
2036 submit.type = "submit";
2037 submit.style.display = "none";
2038 form.appendChild( submit );
2039 form.onsubmit = function( e ){ e.preventDefault(); };
2040 }
2041 // Input field.
2042 var ti = document.getElementById( "FTEXTINPUT" );
2043 if( ti == null ){
2044 ti = document.createElement( "input" );
2045 ti.type = "text";
2046 ti.id = "FTEXTINPUT";
2047 ti.style.textAlign = "center";
2048 ti.style.position = "absolute";
2049 ti.style.zIndex = 99;
2050 ti.style.margin = 0;
2051 ti.style.border = 0;
2052 ti.style.padding = 0;
2053 ti.style.opacity = 0.0;
2054 form.appendChild( ti );
2055 ti.focus();
2056 }
2057 var canv = Module.canvas;
2058 var scale = canv.offsetHeight / canv.height;
2059 ti.style.left = ( $0 * scale + canv.offsetLeft ) + "px";
2060 ti.style.top = ( $1 * scale + canv.offsetTop ) + "px";
2061 ti.style.width = ( $2 * scale ) + "px";
2062 ti.style.height = ( $3 * scale ) + "px";
2063 }, x, y, w, h );
2064 #else
2065 if( !SDL_IsTextInputActive() )
2066 SDL_StartTextInput();
2067 SDL_SetTextInputRect( &textInputRect );
2068 #endif
2069 textInputEnabled = true;
2070 }else{
2071 #ifdef __EMSCRIPTEN__
2072 // Remove the text input element.
2073 EM_ASM( {
2074 var form = document.getElementById( "FFORM" );
2075 var ti = document.getElementById( "FTEXTINPUT" );
2076 if( ti != null ) form.removeChild( ti );
2077 } );
2078 #else
2079 if( SDL_IsTextInputActive() )
2080 SDL_StopTextInput();
2081 #endif
2082 textInputEnabled = false;
2083 }
2084 }
2085
2086 int upKey(){
2087 return keystates[ SDL_SCANCODE_UP ];
2088 }
2089
2090 int downKey(){
2091 return keystates[ SDL_SCANCODE_DOWN ];
2092 }
2093
2094 int leftKey(){
2095 return keystates[ SDL_SCANCODE_LEFT ];
2096 }
2097
2098 int rightKey(){
2099 return keystates[ SDL_SCANCODE_RIGHT ];
2100 }
2101
2102 int shiftKey(){
2103 return keystates[ SDL_SCANCODE_LSHIFT ]
2104 || keystates[ SDL_SCANCODE_RSHIFT ];
2105 }
2106
2107 int enterKey(){
2108 return keystates[ SDL_SCANCODE_RETURN ]
2109 || keystates[ SDL_SCANCODE_KP_ENTER ];
2110 }
2111
2112 int escapeKey(){
2113 return keystates[ SDL_SCANCODE_ESCAPE ];
2114 }
2115
2116 int spaceKey(){
2117 return keystates[ SDL_SCANCODE_SPACE ];
2118 }
2119
2120 int charKey( char key ){
2121 if( key >= 'A' && key <= 'Z' ) key = key - 'A' + 'a';
2122 if( key >= 'a' && key <= 'z' ){
2123 return keystates[ key - 'a' + SDL_SCANCODE_A ];
2124 }else if( key >= '0' && key <= '9' ){
2125 key = key == '0' ? 9 : key - '1';
2126 return keystates[ key + SDL_SCANCODE_1 ]
2127 || keystates[ key + SDL_SCANCODE_KP_1 ];
2128 }
2129 return 0;
2130 }
2131
2132 int upPad(){
2133 return controller ?
2134 SDL_GameControllerGetButton( controller, SDL_CONTROLLER_BUTTON_DPAD_UP )
2135 : 0;
2136 }
2137
2138 int downPad(){
2139 return controller ?
2140 SDL_GameControllerGetButton( controller, SDL_CONTROLLER_BUTTON_DPAD_DOWN )
2141 : 0;
2142 }
2143
2144 int leftPad(){
2145 return controller ?
2146 SDL_GameControllerGetButton( controller, SDL_CONTROLLER_BUTTON_DPAD_LEFT )
2147 : 0;
2148 }
2149
2150 int rightPad(){
2151 return controller ?
2152 SDL_GameControllerGetButton( controller, SDL_CONTROLLER_BUTTON_DPAD_RIGHT )
2153 : 0;
2154 }
2155
2156 int selectButton(){
2157 return controller ?
2158 SDL_GameControllerGetButton( controller, SDL_CONTROLLER_BUTTON_BACK )
2159 : 0;
2160 }
2161
2162 int startButton(){
2163 return controller ?
2164 SDL_GameControllerGetButton( controller, SDL_CONTROLLER_BUTTON_START )
2165 : 0;
2166 }
2167
2168 int aButton(){
2169 return controller ?
2170 SDL_GameControllerGetButton( controller, SDL_CONTROLLER_BUTTON_A )
2171 : 0;
2172 }
2173
2174 int bButton(){
2175 return controller ?
2176 SDL_GameControllerGetButton( controller, SDL_CONTROLLER_BUTTON_B )
2177 : 0;
2178 }
2179
2180 int xButton(){
2181 return controller ?
2182 SDL_GameControllerGetButton( controller, SDL_CONTROLLER_BUTTON_X )
2183 : 0;
2184 }
2185
2186 int yButton(){
2187 return controller ?
2188 SDL_GameControllerGetButton( controller, SDL_CONTROLLER_BUTTON_Y )
2189 : 0;
2190 }
2191
2192 int left1(){
2193 return controller ?
2194 SDL_GameControllerGetButton( controller, SDL_CONTROLLER_BUTTON_LEFTSHOULDER )
2195 : 0;
2196 }
2197
2198 int right1(){
2199 return controller ?
2200 SDL_GameControllerGetButton( controller, SDL_CONTROLLER_BUTTON_RIGHTSHOULDER )
2201 : 0;
2202 }
2203
2204 float left2(){
2205 return controller ?
2206 ( SDL_GameControllerGetAxis( controller, SDL_CONTROLLER_AXIS_TRIGGERLEFT ) / 32767.0f )
2207 : 0.0f;
2208 }
2209
2210 float right2(){
2211 return controller ?
2212 ( SDL_GameControllerGetAxis( controller, SDL_CONTROLLER_AXIS_TRIGGERRIGHT ) / 32767.0f )
2213 : 0.0f;
2214 }
2215
2216 int leftStick(){
2217 return controller ?
2218 SDL_GameControllerGetButton( controller, SDL_CONTROLLER_BUTTON_LEFTSTICK )
2219 : 0;
2220 }
2221
2222 int rightStick(){
2223 return controller ?
2224 SDL_GameControllerGetButton( controller, SDL_CONTROLLER_BUTTON_RIGHTSTICK )
2225 : 0;
2226 }
2227
2228 float leftStickX(){
2229 return controller ?
2230 ( SDL_GameControllerGetAxis( controller, SDL_CONTROLLER_AXIS_LEFTX ) / 32768.0f )
2231 : 0.0f;
2232 }
2233
2234 float leftStickY(){
2235 return controller ?
2236 ( SDL_GameControllerGetAxis( controller, SDL_CONTROLLER_AXIS_LEFTY ) / 32768.0f )
2237 : 0.0f;
2238 }
2239
2240 float rightStickX(){
2241 return controller ?
2242 ( SDL_GameControllerGetAxis( controller, SDL_CONTROLLER_AXIS_RIGHTX ) / 32768.0f )
2243 : 0.0f;
2244 }
2245
2246 float rightStickY(){
2247 return controller ?
2248 ( SDL_GameControllerGetAxis( controller, SDL_CONTROLLER_AXIS_RIGHTY ) / 32768.0f )
2249 : 0.0f;
2250 }
2251
2252 int mouseButton( int button ){
2253 if( button == 2 )
2254 button = 3;
2255 else if( button == 3 )
2256 button = 2;
2257 return SDL_GetMouseState( nullptr, nullptr ) & SDL_BUTTON( button ) ? 1 : 0;
2258 }
2259
2260 void showMouse( bool show ){
2261 SDL_ShowCursor( show ? SDL_ENABLE : SDL_DISABLE );
2262 }
2263
2264 void trapMouse( bool trap ){
2265 if( SDL_SetRelativeMouseMode( trap ? SDL_TRUE : SDL_FALSE ) > -1 ){
2266 mouseTrapped = trap;
2267 }else{
2268 mouseTrapped = false;
2269 }
2270 }
2271
2272 void end(){
2273 if( controller ){
2274 SDL_GameControllerClose( controller );
2275 }
2276 SDL_GL_DeleteContext( ctx );
2277 SDL_DestroyWindow( window );
2278 // TODO: Investigate why SDL_Quit segfaults in SDL 2.0.12.
2279 //SDL_Quit();
2280 exit( 0 );
2281 }
2282
2283 #ifdef __STB_INCLUDE_STB_TRUETYPE_H__
2284
2285 void packFontRange( Font &font, int cpStart, int cpEnd ){
2286 if( !font.texture.success ) return;
2287 font.charStarts.push_back( cpStart );
2288 font.charEnds.push_back( cpEnd );
2289 int indexOffset = font.packedChars.size();
2290 int numChars = cpEnd - cpStart + 1;
2291 font.packedChars.resize( indexOffset + numChars );
2292 stbtt_PackFontRange(
2293 &font.pc,
2294 font.buffer.data(),
2295 0,
2296 STBTT_POINT_SIZE( font.size ),
2297 cpStart,
2298 numChars,
2299 &font.packedChars[ indexOffset ]
2300 );
2301 font.needSync = true;
2302 }
2303
2304 int getCharacterIndex( int cp, Font &font ){
2305 int cpTotal = 0;
2306 for( size_t i = 0; i < font.charStarts.size(); i++ ){
2307 int cpStart = font.charStarts[ i ];
2308 int cpEnd = font.charEnds[ i ];
2309 if( (int)cp >= cpStart && (int)cp <= cpEnd )
2310 return cp - cpStart + cpTotal;
2311 cpTotal += cpEnd - cpStart + 1;
2312 }
2313 // dynamic packing
2314 packFontRange( font, cp, cp );
2315 return getCharacterIndex( cp, font );
2316 }
2317
2318 Font loadFont( std::string fileName, float fontSize, int oversampleX, int oversampleY,
2319 bool prepack = true, int atlasWidth = 512, int atlasHeight = 512 ){
2320 Font font = newFont;
2321
2322 FILE* file = fopen( fileName.c_str(), "rb" );
2323 if( !file ){
2324 fprintf( stderr, "Failed to open %s\n\n", fileName.c_str() );
2325 return font;
2326 }
2327 font.buffer = {};
2328 unsigned char buf[4096];
2329 while( size_t len = fread( buf, 1, sizeof( buf ), file ) ){
2330 std::vector<unsigned char> buf_vector( buf, buf + len );
2331 font.buffer.insert(
2332 font.buffer.end(),
2333 buf_vector.begin(),
2334 buf_vector.end()
2335 );
2336 }
2337 fclose( file );
2338
2339 stbtt_InitFont( &font.info, font.buffer.data(), 0 );
2340
2341 font.size = fontSize;
2342
2343 // This may not be correct, but it works because Microsoft.
2344 int x0, y0, x1, y1;
2345 stbtt_GetFontBoundingBox( &font.info, &x0, &y0, &x1, &y1);
2346 font.height = (float)y1 * stbtt_ScaleForMappingEmToPixels( &font.info, font.size ) * 1.333f - 0.5f;
2347
2348 font.atlas.resize( atlasWidth * atlasHeight );
2349
2350 stbtt_PackBegin( &font.pc, font.atlas.data(), atlasWidth, atlasHeight, 0, 1, nullptr );
2351 stbtt_PackSetOversampling( &font.pc, oversampleX, oversampleY );
2352
2353 font.texture = loadTexture( font.atlas.data(), atlasWidth, atlasHeight, 1, false, true );
2354
2355 std::vector<Vertex> noVertices = {};
2356 std::vector<Index> noIndices = {};
2357 font.textMesh = loadMesh( noVertices, noIndices, true );
2358
2359 // ASCII
2360 if( prepack ){
2361 packFontRange( font, 32, 126 );
2362 updateTexture( font.texture, font.atlas.data() );
2363 }
2364
2365 return font;
2366 }
2367
2368 float getTextWidthUtf32( std::u32string codepoints, Font &font ){
2369 Texture &tex = font.texture;
2370 if( !tex.success ) return 0.0f;
2371 // for stb_truetype's automatic positioning
2372 float charX = 0.0f, charY = 0.0f;
2373 for( size_t i = 0; i < codepoints.length(); i++ ){
2374 auto cp = codepoints[ i ];
2375 int ci = getCharacterIndex( cp, font );
2376 stbtt_aligned_quad q;
2377 // integer positioning needs to be disabled for kerning to work properly
2378 stbtt_GetPackedQuad( font.packedChars.data(), tex.width, tex.height, ci, &charX, &charY, &q, 0 );
2379 // set the kern offset for the next character
2380 if( codepoints.length() - i > 1 )
2381 charX += ( q.s1 - q.s0 ) * stbtt_GetCodepointKernAdvance( &font.info, cp, codepoints[ i + 1 ] );
2382 }
2383 return charX;
2384 }
2385
2386 float getTextWidth( std::string text, Font &font ){
2387 if( !font.texture.success ) return 0.0f;
2388 return getTextWidthUtf32( utf8ToUtf32( text ), font );
2389 }
2390
2391 void drawTextUtf32( std::u32string codepoints, Font &font, float posX, float posY, float scale, int align = 0, float wordWrap = 0.0f ){
2392 // align modes -- 0: left, 1: center, 2: right
2393
2394 Texture &tex = font.texture;
2395 if( !tex.success ) return;
2396
2397 float leading = font.size * 1.2f;
2398 size_t wordStart = 0;
2399 float wordStartX = 0.0f;
2400
2401 // for stb_truetype's automatic positioning
2402 float charX = 0.0f, charY = 0.0f;
2403
2404 std::vector<Vertex> vertices;
2405 std::vector<Index> indices;
2406
2407 // buffer characters
2408 for( size_t i = 0; i < codepoints.length(); i++ ){
2409 auto cp = codepoints[ i ];
2410 // Get the font character index of codepoints >= 32 (space).
2411 // Don't print control characters.
2412 int ci = getCharacterIndex( cp < 32 ? 32 : cp, font );
2413
2414 stbtt_aligned_quad q;
2415 // integer positioning needs to be disabled for kerning to work properly
2416 stbtt_GetPackedQuad( font.packedChars.data(), tex.width, tex.height, ci, &charX, &charY, &q, 0 );
2417
2418 // set the kern offset for the next character
2419 if( codepoints.length() - i > 1 )
2420 charX += ( q.s1 - q.s0 ) * stbtt_GetCodepointKernAdvance( &font.info, cp, codepoints[ i + 1 ] );
2421
2422 // handle newlines and word wrapping
2423 if( cp == ' ' ){
2424 wordStart = i + 1;
2425 wordStartX = charX;
2426 }else if( cp == '\n' ){
2427 if( align == 0 ){ // Left-to-right alignment.
2428 wordStart = i + 1;
2429 wordStartX = charX;
2430 charX = 0.0f;
2431 charY += leading;
2432 }else{ // Other alignment.
2433 drawTextUtf32( codepoints.substr( i + 1 ), font, posX, posY + leading * scale, scale, align, wordWrap );
2434 break;
2435 }
2436 }else if( wordWrap > 0.0f && charX * scale > wordWrap && wordStart > 0 ){
2437 // re-align
2438 charX = wordStartX;
2439 // delete the last characters
2440 vertices.resize( ( wordStart - 1 ) * 4 );
2441 indices.resize( ( wordStart - 1 ) * 6 );
2442 drawTextUtf32( codepoints.substr( wordStart ), font, posX, posY + leading * scale, scale, align, wordWrap );
2443 break;
2444 }
2445
2446 // add the character to the vertex and index vectors
2447 Index idx = (Index)vertices.size();
2448 vertices.insert( vertices.end(), {
2449 { { q.x0, -q.y0, 0.0f },
2450 { 0.0f, 0.0f, 1.0f },
2451 { 1.0f, 0.0f, 0.0f },
2452 { q.s0, q.t0 } },
2453 { { q.x0, -q.y1, 0.0f },
2454 { 0.0f, 0.0f, 1.0f },
2455 { 1.0f, 0.0f, 0.0f },
2456 { q.s0, q.t1 } },
2457 { { q.x1, -q.y1, 0.0f },
2458 { 0.0f, 0.0f, 1.0f },
2459 { 1.0f, 0.0f, 0.0f },
2460 { q.s1, q.t1 } },
2461 { { q.x1, -q.y0, 0.0f },
2462 { 0.0f, 0.0f, 1.0f },
2463 { 1.0f, 0.0f, 0.0f },
2464 { q.s1, q.t0 } }
2465 } );
2466 indices.insert( indices.end(), {
2467 idx, idx + 1, idx + 2, idx + 2, idx + 3, idx
2468 } );
2469 }
2470
2471 if( font.needSync ){
2472 updateTexture( tex, font.atlas.data() );
2473 font.needSync = false;
2474 }
2475
2476 // copy old state
2477 linalg::mat<double,4,4> oldTexMatrix = texMatrix;
2478
2479 double screenWidth = getDisplayWidth(), screenHeight = getDisplayHeight();
2480 texMatrix = linalg::identity;
2481 setTexture( tex, 0 );
2482 updateMesh( font.textMesh, vertices, indices, true );
2483 posX += charX * scale * ( align == 0 ? 0.0f : ( align == 1 ? -0.5f : -1.0f ) );
2484 posY += font.size * scale;
2485 drawMesh(
2486 font.textMesh,
2487 linalg::mul(
2488 linalg::translation_matrix( linalg::vec<double,3>(
2489 -1.0 + posX * 2.0 / screenWidth,
2490 1.0 - posY * 2.0 / screenHeight,
2491 0.0
2492 ) ),
2493 linalg::scaling_matrix( linalg::vec<double,3>(
2494 2.0 / screenWidth * scale,
2495 2.0 / screenHeight * scale,
2496 1.0
2497 ) )
2498 ),
2499 linalg::identity,
2500 linalg::identity
2501 );
2502
2503 // restore old state
2504 texMatrix = oldTexMatrix;
2505 }
2506
2507 void drawText( std::string text, Font &font, float posX, float posY, float scale, int align = 0, float wordWrap = 0.0f ){
2508 // align modes -- 0: left, 1: center, 2: right
2509
2510 if( !font.texture.success ) return;
2511
2512 drawTextUtf32( utf8ToUtf32( text ), font, posX, posY, scale, align, wordWrap );
2513 }
2514
2515 #else
2516
2517 void packFontRange( Font &font, int cpStart, int cpEnd ){
2518 return;
2519 }
2520
2521 int getCharacterIndex( int cp, Font &font ){
2522 return 0;
2523 }
2524
2525 Font loadFont( std::string fileName, float fontSize, int oversampleX, int oversampleY,
2526 bool prepack = true, int atlasWidth = 512, int atlasHeight = 512 ){
2527 fprintf( stderr, "Include stb_truetype.h before fg2.h to load TrueType fonts.\n\n" );
2528 return newFont;
2529 }
2530
2531 float getTextWidthUtf32( std::u32string codepoints, Font &font ){
2532 return 0.0f;
2533 }
2534
2535 float getTextWidth( std::string text, Font &font ){
2536 return 0.0f;
2537 }
2538
2539 void drawTextUtf32( std::u32string codepoints, Font &font, float posX, float posY, float scale, int align = 0, float wordWrap = 0.0f ){
2540 return;
2541 }
2542
2543 void drawText( std::string text, Font &font, float posX, float posY, float scale, int align = 0, float wordWrap = 0.0f ){
2544 return;
2545 }
2546
2547 #endif // __STB_INCLUDE_STB_TRUETYPE_H__
2548
2549 } // namespace fg2
2550
2551 #endif // FG2_H
File include/fg2/glad_gl.h added (mode: 100755) (index 0000000..97c627d)
1 /**
2 * Loader generated by glad 2.0.0-beta on Tue May 7 19:31:33 2019
3 *
4 * Generator: C/C++
5 * Specification: gl
6 * Extensions: 1
7 *
8 * APIs:
9 * - gl:compatibility=2.0
10 *
11 * Options:
12 * - MX_GLOBAL = False
13 * - LOADER = False
14 * - ALIAS = False
15 * - HEADER_ONLY = True
16 * - DEBUG = False
17 * - MX = False
18 *
19 * Commandline:
20 * --api='gl:compatibility=2.0' --extensions='GL_EXT_framebuffer_object' c --header-only
21 *
22 * Online:
23 * http://glad.sh/#api=gl%3Acompatibility%3D2.0&extensions=GL_EXT_framebuffer_object&generator=c&options=HEADER_ONLY
24 *
25 */
26
27 #ifndef GLAD_GL_H_
28 #define GLAD_GL_H_
29
30 #ifdef __gl_h_
31 #error OpenGL header already included (API: gl), remove previous include!
32 #endif
33 #define __gl_h_ 1
34
35
36 #define GLAD_GL
37 #define GLAD_OPTION_GL_HEADER_ONLY
38
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42
43 #ifndef GLAD_PLATFORM_H_
44 #define GLAD_PLATFORM_H_
45
46 #ifndef GLAD_PLATFORM_WIN32
47 #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__MINGW32__)
48 #define GLAD_PLATFORM_WIN32 1
49 #else
50 #define GLAD_PLATFORM_WIN32 0
51 #endif
52 #endif
53
54 #ifndef GLAD_PLATFORM_APPLE
55 #ifdef __APPLE__
56 #define GLAD_PLATFORM_APPLE 1
57 #else
58 #define GLAD_PLATFORM_APPLE 0
59 #endif
60 #endif
61
62 #ifndef GLAD_PLATFORM_EMSCRIPTEN
63 #ifdef __EMSCRIPTEN__
64 #define GLAD_PLATFORM_EMSCRIPTEN 1
65 #else
66 #define GLAD_PLATFORM_EMSCRIPTEN 0
67 #endif
68 #endif
69
70 #ifndef GLAD_PLATFORM_UWP
71 #if defined(_MSC_VER) && !defined(GLAD_INTERNAL_HAVE_WINAPIFAMILY)
72 #ifdef __has_include
73 #if __has_include(<winapifamily.h>)
74 #define GLAD_INTERNAL_HAVE_WINAPIFAMILY 1
75 #endif
76 #elif _MSC_VER >= 1700 && !_USING_V110_SDK71_
77 #define GLAD_INTERNAL_HAVE_WINAPIFAMILY 1
78 #endif
79 #endif
80
81 #ifdef GLAD_INTERNAL_HAVE_WINAPIFAMILY
82 #include <winapifamily.h>
83 #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
84 #define GLAD_PLATFORM_UWP 1
85 #endif
86 #endif
87
88 #ifndef GLAD_PLATFORM_UWP
89 #define GLAD_PLATFORM_UWP 0
90 #endif
91 #endif
92
93 #ifdef __GNUC__
94 #define GLAD_GNUC_EXTENSION __extension__
95 #else
96 #define GLAD_GNUC_EXTENSION
97 #endif
98
99 #ifndef GLAD_API_CALL
100 #if defined(GLAD_API_CALL_EXPORT)
101 #if GLAD_PLATFORM_WIN32 || defined(__CYGWIN__)
102 #if defined(GLAD_API_CALL_EXPORT_BUILD)
103 #if defined(__GNUC__)
104 #define GLAD_API_CALL __attribute__ ((dllexport)) extern
105 #else
106 #define GLAD_API_CALL __declspec(dllexport) extern
107 #endif
108 #else
109 #if defined(__GNUC__)
110 #define GLAD_API_CALL __attribute__ ((dllimport)) extern
111 #else
112 #define GLAD_API_CALL __declspec(dllimport) extern
113 #endif
114 #endif
115 #elif defined(__GNUC__) && defined(GLAD_API_CALL_EXPORT_BUILD)
116 #define GLAD_API_CALL __attribute__ ((visibility ("default"))) extern
117 #else
118 #define GLAD_API_CALL extern
119 #endif
120 #else
121 #define GLAD_API_CALL extern
122 #endif
123 #endif
124
125 #ifdef APIENTRY
126 #define GLAD_API_PTR APIENTRY
127 #elif GLAD_PLATFORM_WIN32
128 #define GLAD_API_PTR __stdcall
129 #else
130 #define GLAD_API_PTR
131 #endif
132
133 #ifndef GLAPI
134 #define GLAPI GLAD_API_CALL
135 #endif
136
137 #ifndef GLAPIENTRY
138 #define GLAPIENTRY GLAD_API_PTR
139 #endif
140
141 #define GLAD_MAKE_VERSION(major, minor) (major * 10000 + minor)
142 #define GLAD_VERSION_MAJOR(version) (version / 10000)
143 #define GLAD_VERSION_MINOR(version) (version % 10000)
144
145 #define GLAD_GENERATOR_VERSION "2.0.0-beta"
146
147 typedef void (*GLADapiproc)(void);
148
149 typedef GLADapiproc (*GLADloadfunc)(const char *name);
150 typedef GLADapiproc (*GLADuserptrloadfunc)(void *userptr, const char *name);
151
152 typedef void (*GLADprecallback)(const char *name, GLADapiproc apiproc, int len_args, ...);
153 typedef void (*GLADpostcallback)(void *ret, const char *name, GLADapiproc apiproc, int len_args, ...);
154
155 #endif /* GLAD_PLATFORM_H_ */
156
157 #define GL_2D 0x0600
158 #define GL_2_BYTES 0x1407
159 #define GL_3D 0x0601
160 #define GL_3D_COLOR 0x0602
161 #define GL_3D_COLOR_TEXTURE 0x0603
162 #define GL_3_BYTES 0x1408
163 #define GL_4D_COLOR_TEXTURE 0x0604
164 #define GL_4_BYTES 0x1409
165 #define GL_ACCUM 0x0100
166 #define GL_ACCUM_ALPHA_BITS 0x0D5B
167 #define GL_ACCUM_BLUE_BITS 0x0D5A
168 #define GL_ACCUM_BUFFER_BIT 0x00000200
169 #define GL_ACCUM_CLEAR_VALUE 0x0B80
170 #define GL_ACCUM_GREEN_BITS 0x0D59
171 #define GL_ACCUM_RED_BITS 0x0D58
172 #define GL_ACTIVE_ATTRIBUTES 0x8B89
173 #define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
174 #define GL_ACTIVE_TEXTURE 0x84E0
175 #define GL_ACTIVE_UNIFORMS 0x8B86
176 #define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
177 #define GL_ADD 0x0104
178 #define GL_ADD_SIGNED 0x8574
179 #define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
180 #define GL_ALIASED_POINT_SIZE_RANGE 0x846D
181 #define GL_ALL_ATTRIB_BITS 0xFFFFFFFF
182 #define GL_ALPHA 0x1906
183 #define GL_ALPHA12 0x803D
184 #define GL_ALPHA16 0x803E
185 #define GL_ALPHA4 0x803B
186 #define GL_ALPHA8 0x803C
187 #define GL_ALPHA_BIAS 0x0D1D
188 #define GL_ALPHA_BITS 0x0D55
189 #define GL_ALPHA_SCALE 0x0D1C
190 #define GL_ALPHA_TEST 0x0BC0
191 #define GL_ALPHA_TEST_FUNC 0x0BC1
192 #define GL_ALPHA_TEST_REF 0x0BC2
193 #define GL_ALWAYS 0x0207
194 #define GL_AMBIENT 0x1200
195 #define GL_AMBIENT_AND_DIFFUSE 0x1602
196 #define GL_AND 0x1501
197 #define GL_AND_INVERTED 0x1504
198 #define GL_AND_REVERSE 0x1502
199 #define GL_ARRAY_BUFFER 0x8892
200 #define GL_ARRAY_BUFFER_BINDING 0x8894
201 #define GL_ATTACHED_SHADERS 0x8B85
202 #define GL_ATTRIB_STACK_DEPTH 0x0BB0
203 #define GL_AUTO_NORMAL 0x0D80
204 #define GL_AUX0 0x0409
205 #define GL_AUX1 0x040A
206 #define GL_AUX2 0x040B
207 #define GL_AUX3 0x040C
208 #define GL_AUX_BUFFERS 0x0C00
209 #define GL_BACK 0x0405
210 #define GL_BACK_LEFT 0x0402
211 #define GL_BACK_RIGHT 0x0403
212 #define GL_BGR 0x80E0
213 #define GL_BGRA 0x80E1
214 #define GL_BITMAP 0x1A00
215 #define GL_BITMAP_TOKEN 0x0704
216 #define GL_BLEND 0x0BE2
217 #define GL_BLEND_COLOR 0x8005
218 #define GL_BLEND_DST 0x0BE0
219 #define GL_BLEND_DST_ALPHA 0x80CA
220 #define GL_BLEND_DST_RGB 0x80C8
221 #define GL_BLEND_EQUATION 0x8009
222 #define GL_BLEND_EQUATION_ALPHA 0x883D
223 #define GL_BLEND_EQUATION_RGB 0x8009
224 #define GL_BLEND_SRC 0x0BE1
225 #define GL_BLEND_SRC_ALPHA 0x80CB
226 #define GL_BLEND_SRC_RGB 0x80C9
227 #define GL_BLUE 0x1905
228 #define GL_BLUE_BIAS 0x0D1B
229 #define GL_BLUE_BITS 0x0D54
230 #define GL_BLUE_SCALE 0x0D1A
231 #define GL_BOOL 0x8B56
232 #define GL_BOOL_VEC2 0x8B57
233 #define GL_BOOL_VEC3 0x8B58
234 #define GL_BOOL_VEC4 0x8B59
235 #define GL_BUFFER_ACCESS 0x88BB
236 #define GL_BUFFER_MAPPED 0x88BC
237 #define GL_BUFFER_MAP_POINTER 0x88BD
238 #define GL_BUFFER_SIZE 0x8764
239 #define GL_BUFFER_USAGE 0x8765
240 #define GL_BYTE 0x1400
241 #define GL_C3F_V3F 0x2A24
242 #define GL_C4F_N3F_V3F 0x2A26
243 #define GL_C4UB_V2F 0x2A22
244 #define GL_C4UB_V3F 0x2A23
245 #define GL_CCW 0x0901
246 #define GL_CLAMP 0x2900
247 #define GL_CLAMP_TO_BORDER 0x812D
248 #define GL_CLAMP_TO_EDGE 0x812F
249 #define GL_CLEAR 0x1500
250 #define GL_CLIENT_ACTIVE_TEXTURE 0x84E1
251 #define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF
252 #define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1
253 #define GL_CLIENT_PIXEL_STORE_BIT 0x00000001
254 #define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002
255 #define GL_CLIP_PLANE0 0x3000
256 #define GL_CLIP_PLANE1 0x3001
257 #define GL_CLIP_PLANE2 0x3002
258 #define GL_CLIP_PLANE3 0x3003
259 #define GL_CLIP_PLANE4 0x3004
260 #define GL_CLIP_PLANE5 0x3005
261 #define GL_COEFF 0x0A00
262 #define GL_COLOR 0x1800
263 #define GL_COLOR_ARRAY 0x8076
264 #define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898
265 #define GL_COLOR_ARRAY_POINTER 0x8090
266 #define GL_COLOR_ARRAY_SIZE 0x8081
267 #define GL_COLOR_ARRAY_STRIDE 0x8083
268 #define GL_COLOR_ARRAY_TYPE 0x8082
269 #define GL_COLOR_ATTACHMENT0_EXT 0x8CE0
270 #define GL_COLOR_ATTACHMENT10_EXT 0x8CEA
271 #define GL_COLOR_ATTACHMENT11_EXT 0x8CEB
272 #define GL_COLOR_ATTACHMENT12_EXT 0x8CEC
273 #define GL_COLOR_ATTACHMENT13_EXT 0x8CED
274 #define GL_COLOR_ATTACHMENT14_EXT 0x8CEE
275 #define GL_COLOR_ATTACHMENT15_EXT 0x8CEF
276 #define GL_COLOR_ATTACHMENT1_EXT 0x8CE1
277 #define GL_COLOR_ATTACHMENT2_EXT 0x8CE2
278 #define GL_COLOR_ATTACHMENT3_EXT 0x8CE3
279 #define GL_COLOR_ATTACHMENT4_EXT 0x8CE4
280 #define GL_COLOR_ATTACHMENT5_EXT 0x8CE5
281 #define GL_COLOR_ATTACHMENT6_EXT 0x8CE6
282 #define GL_COLOR_ATTACHMENT7_EXT 0x8CE7
283 #define GL_COLOR_ATTACHMENT8_EXT 0x8CE8
284 #define GL_COLOR_ATTACHMENT9_EXT 0x8CE9
285 #define GL_COLOR_BUFFER_BIT 0x00004000
286 #define GL_COLOR_CLEAR_VALUE 0x0C22
287 #define GL_COLOR_INDEX 0x1900
288 #define GL_COLOR_INDEXES 0x1603
289 #define GL_COLOR_LOGIC_OP 0x0BF2
290 #define GL_COLOR_MATERIAL 0x0B57
291 #define GL_COLOR_MATERIAL_FACE 0x0B55
292 #define GL_COLOR_MATERIAL_PARAMETER 0x0B56
293 #define GL_COLOR_SUM 0x8458
294 #define GL_COLOR_WRITEMASK 0x0C23
295 #define GL_COMBINE 0x8570
296 #define GL_COMBINE_ALPHA 0x8572
297 #define GL_COMBINE_RGB 0x8571
298 #define GL_COMPARE_R_TO_TEXTURE 0x884E
299 #define GL_COMPILE 0x1300
300 #define GL_COMPILE_AND_EXECUTE 0x1301
301 #define GL_COMPILE_STATUS 0x8B81
302 #define GL_COMPRESSED_ALPHA 0x84E9
303 #define GL_COMPRESSED_INTENSITY 0x84EC
304 #define GL_COMPRESSED_LUMINANCE 0x84EA
305 #define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB
306 #define GL_COMPRESSED_RGB 0x84ED
307 #define GL_COMPRESSED_RGBA 0x84EE
308 #define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
309 #define GL_CONSTANT 0x8576
310 #define GL_CONSTANT_ALPHA 0x8003
311 #define GL_CONSTANT_ATTENUATION 0x1207
312 #define GL_CONSTANT_COLOR 0x8001
313 #define GL_COORD_REPLACE 0x8862
314 #define GL_COPY 0x1503
315 #define GL_COPY_INVERTED 0x150C
316 #define GL_COPY_PIXEL_TOKEN 0x0706
317 #define GL_CULL_FACE 0x0B44
318 #define GL_CULL_FACE_MODE 0x0B45
319 #define GL_CURRENT_BIT 0x00000001
320 #define GL_CURRENT_COLOR 0x0B00
321 #define GL_CURRENT_FOG_COORD 0x8453
322 #define GL_CURRENT_FOG_COORDINATE 0x8453
323 #define GL_CURRENT_INDEX 0x0B01
324 #define GL_CURRENT_NORMAL 0x0B02
325 #define GL_CURRENT_PROGRAM 0x8B8D
326 #define GL_CURRENT_QUERY 0x8865
327 #define GL_CURRENT_RASTER_COLOR 0x0B04
328 #define GL_CURRENT_RASTER_DISTANCE 0x0B09
329 #define GL_CURRENT_RASTER_INDEX 0x0B05
330 #define GL_CURRENT_RASTER_POSITION 0x0B07
331 #define GL_CURRENT_RASTER_POSITION_VALID 0x0B08
332 #define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06
333 #define GL_CURRENT_SECONDARY_COLOR 0x8459
334 #define GL_CURRENT_TEXTURE_COORDS 0x0B03
335 #define GL_CURRENT_VERTEX_ATTRIB 0x8626
336 #define GL_CW 0x0900
337 #define GL_DECAL 0x2101
338 #define GL_DECR 0x1E03
339 #define GL_DECR_WRAP 0x8508
340 #define GL_DELETE_STATUS 0x8B80
341 #define GL_DEPTH 0x1801
342 #define GL_DEPTH_ATTACHMENT_EXT 0x8D00
343 #define GL_DEPTH_BIAS 0x0D1F
344 #define GL_DEPTH_BITS 0x0D56
345 #define GL_DEPTH_BUFFER_BIT 0x00000100
346 #define GL_DEPTH_CLEAR_VALUE 0x0B73
347 #define GL_DEPTH_COMPONENT 0x1902
348 #define GL_DEPTH_COMPONENT16 0x81A5
349 #define GL_DEPTH_COMPONENT24 0x81A6
350 #define GL_DEPTH_COMPONENT32 0x81A7
351 #define GL_DEPTH_FUNC 0x0B74
352 #define GL_DEPTH_RANGE 0x0B70
353 #define GL_DEPTH_SCALE 0x0D1E
354 #define GL_DEPTH_TEST 0x0B71
355 #define GL_DEPTH_TEXTURE_MODE 0x884B
356 #define GL_DEPTH_WRITEMASK 0x0B72
357 #define GL_DIFFUSE 0x1201
358 #define GL_DITHER 0x0BD0
359 #define GL_DOMAIN 0x0A02
360 #define GL_DONT_CARE 0x1100
361 #define GL_DOT3_RGB 0x86AE
362 #define GL_DOT3_RGBA 0x86AF
363 #define GL_DOUBLE 0x140A
364 #define GL_DOUBLEBUFFER 0x0C32
365 #define GL_DRAW_BUFFER 0x0C01
366 #define GL_DRAW_BUFFER0 0x8825
367 #define GL_DRAW_BUFFER1 0x8826
368 #define GL_DRAW_BUFFER10 0x882F
369 #define GL_DRAW_BUFFER11 0x8830
370 #define GL_DRAW_BUFFER12 0x8831
371 #define GL_DRAW_BUFFER13 0x8832
372 #define GL_DRAW_BUFFER14 0x8833
373 #define GL_DRAW_BUFFER15 0x8834
374 #define GL_DRAW_BUFFER2 0x8827
375 #define GL_DRAW_BUFFER3 0x8828
376 #define GL_DRAW_BUFFER4 0x8829
377 #define GL_DRAW_BUFFER5 0x882A
378 #define GL_DRAW_BUFFER6 0x882B
379 #define GL_DRAW_BUFFER7 0x882C
380 #define GL_DRAW_BUFFER8 0x882D
381 #define GL_DRAW_BUFFER9 0x882E
382 #define GL_DRAW_PIXEL_TOKEN 0x0705
383 #define GL_DST_ALPHA 0x0304
384 #define GL_DST_COLOR 0x0306
385 #define GL_DYNAMIC_COPY 0x88EA
386 #define GL_DYNAMIC_DRAW 0x88E8
387 #define GL_DYNAMIC_READ 0x88E9
388 #define GL_EDGE_FLAG 0x0B43
389 #define GL_EDGE_FLAG_ARRAY 0x8079
390 #define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B
391 #define GL_EDGE_FLAG_ARRAY_POINTER 0x8093
392 #define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C
393 #define GL_ELEMENT_ARRAY_BUFFER 0x8893
394 #define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
395 #define GL_EMISSION 0x1600
396 #define GL_ENABLE_BIT 0x00002000
397 #define GL_EQUAL 0x0202
398 #define GL_EQUIV 0x1509
399 #define GL_EVAL_BIT 0x00010000
400 #define GL_EXP 0x0800
401 #define GL_EXP2 0x0801
402 #define GL_EXTENSIONS 0x1F03
403 #define GL_EYE_LINEAR 0x2400
404 #define GL_EYE_PLANE 0x2502
405 #define GL_FALSE 0
406 #define GL_FASTEST 0x1101
407 #define GL_FEEDBACK 0x1C01
408 #define GL_FEEDBACK_BUFFER_POINTER 0x0DF0
409 #define GL_FEEDBACK_BUFFER_SIZE 0x0DF1
410 #define GL_FEEDBACK_BUFFER_TYPE 0x0DF2
411 #define GL_FILL 0x1B02
412 #define GL_FLAT 0x1D00
413 #define GL_FLOAT 0x1406
414 #define GL_FLOAT_MAT2 0x8B5A
415 #define GL_FLOAT_MAT3 0x8B5B
416 #define GL_FLOAT_MAT4 0x8B5C
417 #define GL_FLOAT_VEC2 0x8B50
418 #define GL_FLOAT_VEC3 0x8B51
419 #define GL_FLOAT_VEC4 0x8B52
420 #define GL_FOG 0x0B60
421 #define GL_FOG_BIT 0x00000080
422 #define GL_FOG_COLOR 0x0B66
423 #define GL_FOG_COORD 0x8451
424 #define GL_FOG_COORDINATE 0x8451
425 #define GL_FOG_COORDINATE_ARRAY 0x8457
426 #define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D
427 #define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456
428 #define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455
429 #define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454
430 #define GL_FOG_COORDINATE_SOURCE 0x8450
431 #define GL_FOG_COORD_ARRAY 0x8457
432 #define GL_FOG_COORD_ARRAY_BUFFER_BINDING 0x889D
433 #define GL_FOG_COORD_ARRAY_POINTER 0x8456
434 #define GL_FOG_COORD_ARRAY_STRIDE 0x8455
435 #define GL_FOG_COORD_ARRAY_TYPE 0x8454
436 #define GL_FOG_COORD_SRC 0x8450
437 #define GL_FOG_DENSITY 0x0B62
438 #define GL_FOG_END 0x0B64
439 #define GL_FOG_HINT 0x0C54
440 #define GL_FOG_INDEX 0x0B61
441 #define GL_FOG_MODE 0x0B65
442 #define GL_FOG_START 0x0B63
443 #define GL_FRAGMENT_DEPTH 0x8452
444 #define GL_FRAGMENT_SHADER 0x8B30
445 #define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B
446 #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1
447 #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0
448 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4
449 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3
450 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2
451 #define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6
452 #define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5
453 #define GL_FRAMEBUFFER_EXT 0x8D40
454 #define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6
455 #define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9
456 #define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB
457 #define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA
458 #define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7
459 #define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC
460 #define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD
461 #define GL_FRONT 0x0404
462 #define GL_FRONT_AND_BACK 0x0408
463 #define GL_FRONT_FACE 0x0B46
464 #define GL_FRONT_LEFT 0x0400
465 #define GL_FRONT_RIGHT 0x0401
466 #define GL_FUNC_ADD 0x8006
467 #define GL_FUNC_REVERSE_SUBTRACT 0x800B
468 #define GL_FUNC_SUBTRACT 0x800A
469 #define GL_GENERATE_MIPMAP 0x8191
470 #define GL_GENERATE_MIPMAP_HINT 0x8192
471 #define GL_GEQUAL 0x0206
472 #define GL_GREATER 0x0204
473 #define GL_GREEN 0x1904
474 #define GL_GREEN_BIAS 0x0D19
475 #define GL_GREEN_BITS 0x0D53
476 #define GL_GREEN_SCALE 0x0D18
477 #define GL_HINT_BIT 0x00008000
478 #define GL_INCR 0x1E02
479 #define GL_INCR_WRAP 0x8507
480 #define GL_INDEX_ARRAY 0x8077
481 #define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899
482 #define GL_INDEX_ARRAY_POINTER 0x8091
483 #define GL_INDEX_ARRAY_STRIDE 0x8086
484 #define GL_INDEX_ARRAY_TYPE 0x8085
485 #define GL_INDEX_BITS 0x0D51
486 #define GL_INDEX_CLEAR_VALUE 0x0C20
487 #define GL_INDEX_LOGIC_OP 0x0BF1
488 #define GL_INDEX_MODE 0x0C30
489 #define GL_INDEX_OFFSET 0x0D13
490 #define GL_INDEX_SHIFT 0x0D12
491 #define GL_INDEX_WRITEMASK 0x0C21
492 #define GL_INFO_LOG_LENGTH 0x8B84
493 #define GL_INT 0x1404
494 #define GL_INTENSITY 0x8049
495 #define GL_INTENSITY12 0x804C
496 #define GL_INTENSITY16 0x804D
497 #define GL_INTENSITY4 0x804A
498 #define GL_INTENSITY8 0x804B
499 #define GL_INTERPOLATE 0x8575
500 #define GL_INT_VEC2 0x8B53
501 #define GL_INT_VEC3 0x8B54
502 #define GL_INT_VEC4 0x8B55
503 #define GL_INVALID_ENUM 0x0500
504 #define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506
505 #define GL_INVALID_OPERATION 0x0502
506 #define GL_INVALID_VALUE 0x0501
507 #define GL_INVERT 0x150A
508 #define GL_KEEP 0x1E00
509 #define GL_LEFT 0x0406
510 #define GL_LEQUAL 0x0203
511 #define GL_LESS 0x0201
512 #define GL_LIGHT0 0x4000
513 #define GL_LIGHT1 0x4001
514 #define GL_LIGHT2 0x4002
515 #define GL_LIGHT3 0x4003
516 #define GL_LIGHT4 0x4004
517 #define GL_LIGHT5 0x4005
518 #define GL_LIGHT6 0x4006
519 #define GL_LIGHT7 0x4007
520 #define GL_LIGHTING 0x0B50
521 #define GL_LIGHTING_BIT 0x00000040
522 #define GL_LIGHT_MODEL_AMBIENT 0x0B53
523 #define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8
524 #define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51
525 #define GL_LIGHT_MODEL_TWO_SIDE 0x0B52
526 #define GL_LINE 0x1B01
527 #define GL_LINEAR 0x2601
528 #define GL_LINEAR_ATTENUATION 0x1208
529 #define GL_LINEAR_MIPMAP_LINEAR 0x2703
530 #define GL_LINEAR_MIPMAP_NEAREST 0x2701
531 #define GL_LINES 0x0001
532 #define GL_LINE_BIT 0x00000004
533 #define GL_LINE_LOOP 0x0002
534 #define GL_LINE_RESET_TOKEN 0x0707
535 #define GL_LINE_SMOOTH 0x0B20
536 #define GL_LINE_SMOOTH_HINT 0x0C52
537 #define GL_LINE_STIPPLE 0x0B24
538 #define GL_LINE_STIPPLE_PATTERN 0x0B25
539 #define GL_LINE_STIPPLE_REPEAT 0x0B26
540 #define GL_LINE_STRIP 0x0003
541 #define GL_LINE_TOKEN 0x0702
542 #define GL_LINE_WIDTH 0x0B21
543 #define GL_LINE_WIDTH_GRANULARITY 0x0B23
544 #define GL_LINE_WIDTH_RANGE 0x0B22
545 #define GL_LINK_STATUS 0x8B82
546 #define GL_LIST_BASE 0x0B32
547 #define GL_LIST_BIT 0x00020000
548 #define GL_LIST_INDEX 0x0B33
549 #define GL_LIST_MODE 0x0B30
550 #define GL_LOAD 0x0101
551 #define GL_LOGIC_OP 0x0BF1
552 #define GL_LOGIC_OP_MODE 0x0BF0
553 #define GL_LOWER_LEFT 0x8CA1
554 #define GL_LUMINANCE 0x1909
555 #define GL_LUMINANCE12 0x8041
556 #define GL_LUMINANCE12_ALPHA12 0x8047
557 #define GL_LUMINANCE12_ALPHA4 0x8046
558 #define GL_LUMINANCE16 0x8042
559 #define GL_LUMINANCE16_ALPHA16 0x8048
560 #define GL_LUMINANCE4 0x803F
561 #define GL_LUMINANCE4_ALPHA4 0x8043
562 #define GL_LUMINANCE6_ALPHA2 0x8044
563 #define GL_LUMINANCE8 0x8040
564 #define GL_LUMINANCE8_ALPHA8 0x8045
565 #define GL_LUMINANCE_ALPHA 0x190A
566 #define GL_MAP1_COLOR_4 0x0D90
567 #define GL_MAP1_GRID_DOMAIN 0x0DD0
568 #define GL_MAP1_GRID_SEGMENTS 0x0DD1
569 #define GL_MAP1_INDEX 0x0D91
570 #define GL_MAP1_NORMAL 0x0D92
571 #define GL_MAP1_TEXTURE_COORD_1 0x0D93
572 #define GL_MAP1_TEXTURE_COORD_2 0x0D94
573 #define GL_MAP1_TEXTURE_COORD_3 0x0D95
574 #define GL_MAP1_TEXTURE_COORD_4 0x0D96
575 #define GL_MAP1_VERTEX_3 0x0D97
576 #define GL_MAP1_VERTEX_4 0x0D98
577 #define GL_MAP2_COLOR_4 0x0DB0
578 #define GL_MAP2_GRID_DOMAIN 0x0DD2
579 #define GL_MAP2_GRID_SEGMENTS 0x0DD3
580 #define GL_MAP2_INDEX 0x0DB1
581 #define GL_MAP2_NORMAL 0x0DB2
582 #define GL_MAP2_TEXTURE_COORD_1 0x0DB3
583 #define GL_MAP2_TEXTURE_COORD_2 0x0DB4
584 #define GL_MAP2_TEXTURE_COORD_3 0x0DB5
585 #define GL_MAP2_TEXTURE_COORD_4 0x0DB6
586 #define GL_MAP2_VERTEX_3 0x0DB7
587 #define GL_MAP2_VERTEX_4 0x0DB8
588 #define GL_MAP_COLOR 0x0D10
589 #define GL_MAP_STENCIL 0x0D11
590 #define GL_MATRIX_MODE 0x0BA0
591 #define GL_MAX 0x8008
592 #define GL_MAX_3D_TEXTURE_SIZE 0x8073
593 #define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35
594 #define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B
595 #define GL_MAX_CLIP_PLANES 0x0D32
596 #define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF
597 #define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
598 #define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
599 #define GL_MAX_DRAW_BUFFERS 0x8824
600 #define GL_MAX_ELEMENTS_INDICES 0x80E9
601 #define GL_MAX_ELEMENTS_VERTICES 0x80E8
602 #define GL_MAX_EVAL_ORDER 0x0D30
603 #define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49
604 #define GL_MAX_LIGHTS 0x0D31
605 #define GL_MAX_LIST_NESTING 0x0B31
606 #define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36
607 #define GL_MAX_NAME_STACK_DEPTH 0x0D37
608 #define GL_MAX_PIXEL_MAP_TABLE 0x0D34
609 #define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38
610 #define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8
611 #define GL_MAX_TEXTURE_COORDS 0x8871
612 #define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
613 #define GL_MAX_TEXTURE_LOD_BIAS 0x84FD
614 #define GL_MAX_TEXTURE_SIZE 0x0D33
615 #define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39
616 #define GL_MAX_TEXTURE_UNITS 0x84E2
617 #define GL_MAX_VARYING_FLOATS 0x8B4B
618 #define GL_MAX_VERTEX_ATTRIBS 0x8869
619 #define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
620 #define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A
621 #define GL_MAX_VIEWPORT_DIMS 0x0D3A
622 #define GL_MIN 0x8007
623 #define GL_MIRRORED_REPEAT 0x8370
624 #define GL_MODELVIEW 0x1700
625 #define GL_MODELVIEW_MATRIX 0x0BA6
626 #define GL_MODELVIEW_STACK_DEPTH 0x0BA3
627 #define GL_MODULATE 0x2100
628 #define GL_MULT 0x0103
629 #define GL_MULTISAMPLE 0x809D
630 #define GL_MULTISAMPLE_BIT 0x20000000
631 #define GL_N3F_V3F 0x2A25
632 #define GL_NAME_STACK_DEPTH 0x0D70
633 #define GL_NAND 0x150E
634 #define GL_NEAREST 0x2600
635 #define GL_NEAREST_MIPMAP_LINEAR 0x2702
636 #define GL_NEAREST_MIPMAP_NEAREST 0x2700
637 #define GL_NEVER 0x0200
638 #define GL_NICEST 0x1102
639 #define GL_NONE 0
640 #define GL_NOOP 0x1505
641 #define GL_NOR 0x1508
642 #define GL_NORMALIZE 0x0BA1
643 #define GL_NORMAL_ARRAY 0x8075
644 #define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897
645 #define GL_NORMAL_ARRAY_POINTER 0x808F
646 #define GL_NORMAL_ARRAY_STRIDE 0x807F
647 #define GL_NORMAL_ARRAY_TYPE 0x807E
648 #define GL_NORMAL_MAP 0x8511
649 #define GL_NOTEQUAL 0x0205
650 #define GL_NO_ERROR 0
651 #define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
652 #define GL_OBJECT_LINEAR 0x2401
653 #define GL_OBJECT_PLANE 0x2501
654 #define GL_ONE 1
655 #define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
656 #define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
657 #define GL_ONE_MINUS_DST_ALPHA 0x0305
658 #define GL_ONE_MINUS_DST_COLOR 0x0307
659 #define GL_ONE_MINUS_SRC_ALPHA 0x0303
660 #define GL_ONE_MINUS_SRC_COLOR 0x0301
661 #define GL_OPERAND0_ALPHA 0x8598
662 #define GL_OPERAND0_RGB 0x8590
663 #define GL_OPERAND1_ALPHA 0x8599
664 #define GL_OPERAND1_RGB 0x8591
665 #define GL_OPERAND2_ALPHA 0x859A
666 #define GL_OPERAND2_RGB 0x8592
667 #define GL_OR 0x1507
668 #define GL_ORDER 0x0A01
669 #define GL_OR_INVERTED 0x150D
670 #define GL_OR_REVERSE 0x150B
671 #define GL_OUT_OF_MEMORY 0x0505
672 #define GL_PACK_ALIGNMENT 0x0D05
673 #define GL_PACK_IMAGE_HEIGHT 0x806C
674 #define GL_PACK_LSB_FIRST 0x0D01
675 #define GL_PACK_ROW_LENGTH 0x0D02
676 #define GL_PACK_SKIP_IMAGES 0x806B
677 #define GL_PACK_SKIP_PIXELS 0x0D04
678 #define GL_PACK_SKIP_ROWS 0x0D03
679 #define GL_PACK_SWAP_BYTES 0x0D00
680 #define GL_PASS_THROUGH_TOKEN 0x0700
681 #define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50
682 #define GL_PIXEL_MAP_A_TO_A 0x0C79
683 #define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9
684 #define GL_PIXEL_MAP_B_TO_B 0x0C78
685 #define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8
686 #define GL_PIXEL_MAP_G_TO_G 0x0C77
687 #define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7
688 #define GL_PIXEL_MAP_I_TO_A 0x0C75
689 #define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5
690 #define GL_PIXEL_MAP_I_TO_B 0x0C74
691 #define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4
692 #define GL_PIXEL_MAP_I_TO_G 0x0C73
693 #define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3
694 #define GL_PIXEL_MAP_I_TO_I 0x0C70
695 #define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0
696 #define GL_PIXEL_MAP_I_TO_R 0x0C72
697 #define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2
698 #define GL_PIXEL_MAP_R_TO_R 0x0C76
699 #define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6
700 #define GL_PIXEL_MAP_S_TO_S 0x0C71
701 #define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1
702 #define GL_PIXEL_MODE_BIT 0x00000020
703 #define GL_POINT 0x1B00
704 #define GL_POINTS 0x0000
705 #define GL_POINT_BIT 0x00000002
706 #define GL_POINT_DISTANCE_ATTENUATION 0x8129
707 #define GL_POINT_FADE_THRESHOLD_SIZE 0x8128
708 #define GL_POINT_SIZE 0x0B11
709 #define GL_POINT_SIZE_GRANULARITY 0x0B13
710 #define GL_POINT_SIZE_MAX 0x8127
711 #define GL_POINT_SIZE_MIN 0x8126
712 #define GL_POINT_SIZE_RANGE 0x0B12
713 #define GL_POINT_SMOOTH 0x0B10
714 #define GL_POINT_SMOOTH_HINT 0x0C51
715 #define GL_POINT_SPRITE 0x8861
716 #define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0
717 #define GL_POINT_TOKEN 0x0701
718 #define GL_POLYGON 0x0009
719 #define GL_POLYGON_BIT 0x00000008
720 #define GL_POLYGON_MODE 0x0B40
721 #define GL_POLYGON_OFFSET_FACTOR 0x8038
722 #define GL_POLYGON_OFFSET_FILL 0x8037
723 #define GL_POLYGON_OFFSET_LINE 0x2A02
724 #define GL_POLYGON_OFFSET_POINT 0x2A01
725 #define GL_POLYGON_OFFSET_UNITS 0x2A00
726 #define GL_POLYGON_SMOOTH 0x0B41
727 #define GL_POLYGON_SMOOTH_HINT 0x0C53
728 #define GL_POLYGON_STIPPLE 0x0B42
729 #define GL_POLYGON_STIPPLE_BIT 0x00000010
730 #define GL_POLYGON_TOKEN 0x0703
731 #define GL_POSITION 0x1203
732 #define GL_PREVIOUS 0x8578
733 #define GL_PRIMARY_COLOR 0x8577
734 #define GL_PROJECTION 0x1701
735 #define GL_PROJECTION_MATRIX 0x0BA7
736 #define GL_PROJECTION_STACK_DEPTH 0x0BA4
737 #define GL_PROXY_TEXTURE_1D 0x8063
738 #define GL_PROXY_TEXTURE_2D 0x8064
739 #define GL_PROXY_TEXTURE_3D 0x8070
740 #define GL_PROXY_TEXTURE_CUBE_MAP 0x851B
741 #define GL_Q 0x2003
742 #define GL_QUADRATIC_ATTENUATION 0x1209
743 #define GL_QUADS 0x0007
744 #define GL_QUAD_STRIP 0x0008
745 #define GL_QUERY_COUNTER_BITS 0x8864
746 #define GL_QUERY_RESULT 0x8866
747 #define GL_QUERY_RESULT_AVAILABLE 0x8867
748 #define GL_R 0x2002
749 #define GL_R3_G3_B2 0x2A10
750 #define GL_READ_BUFFER 0x0C02
751 #define GL_READ_ONLY 0x88B8
752 #define GL_READ_WRITE 0x88BA
753 #define GL_RED 0x1903
754 #define GL_RED_BIAS 0x0D15
755 #define GL_RED_BITS 0x0D52
756 #define GL_RED_SCALE 0x0D14
757 #define GL_REFLECTION_MAP 0x8512
758 #define GL_RENDER 0x1C00
759 #define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53
760 #define GL_RENDERBUFFER_BINDING_EXT 0x8CA7
761 #define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52
762 #define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54
763 #define GL_RENDERBUFFER_EXT 0x8D41
764 #define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51
765 #define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43
766 #define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44
767 #define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50
768 #define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55
769 #define GL_RENDERBUFFER_WIDTH_EXT 0x8D42
770 #define GL_RENDERER 0x1F01
771 #define GL_RENDER_MODE 0x0C40
772 #define GL_REPEAT 0x2901
773 #define GL_REPLACE 0x1E01
774 #define GL_RESCALE_NORMAL 0x803A
775 #define GL_RETURN 0x0102
776 #define GL_RGB 0x1907
777 #define GL_RGB10 0x8052
778 #define GL_RGB10_A2 0x8059
779 #define GL_RGB12 0x8053
780 #define GL_RGB16 0x8054
781 #define GL_RGB4 0x804F
782 #define GL_RGB5 0x8050
783 #define GL_RGB5_A1 0x8057
784 #define GL_RGB8 0x8051
785 #define GL_RGBA 0x1908
786 #define GL_RGBA12 0x805A
787 #define GL_RGBA16 0x805B
788 #define GL_RGBA2 0x8055
789 #define GL_RGBA4 0x8056
790 #define GL_RGBA8 0x8058
791 #define GL_RGBA_MODE 0x0C31
792 #define GL_RGB_SCALE 0x8573
793 #define GL_RIGHT 0x0407
794 #define GL_S 0x2000
795 #define GL_SAMPLER_1D 0x8B5D
796 #define GL_SAMPLER_1D_SHADOW 0x8B61
797 #define GL_SAMPLER_2D 0x8B5E
798 #define GL_SAMPLER_2D_SHADOW 0x8B62
799 #define GL_SAMPLER_3D 0x8B5F
800 #define GL_SAMPLER_CUBE 0x8B60
801 #define GL_SAMPLES 0x80A9
802 #define GL_SAMPLES_PASSED 0x8914
803 #define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
804 #define GL_SAMPLE_ALPHA_TO_ONE 0x809F
805 #define GL_SAMPLE_BUFFERS 0x80A8
806 #define GL_SAMPLE_COVERAGE 0x80A0
807 #define GL_SAMPLE_COVERAGE_INVERT 0x80AB
808 #define GL_SAMPLE_COVERAGE_VALUE 0x80AA
809 #define GL_SCISSOR_BIT 0x00080000
810 #define GL_SCISSOR_BOX 0x0C10
811 #define GL_SCISSOR_TEST 0x0C11
812 #define GL_SECONDARY_COLOR_ARRAY 0x845E
813 #define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C
814 #define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D
815 #define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A
816 #define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C
817 #define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B
818 #define GL_SELECT 0x1C02
819 #define GL_SELECTION_BUFFER_POINTER 0x0DF3
820 #define GL_SELECTION_BUFFER_SIZE 0x0DF4
821 #define GL_SEPARATE_SPECULAR_COLOR 0x81FA
822 #define GL_SET 0x150F
823 #define GL_SHADER_SOURCE_LENGTH 0x8B88
824 #define GL_SHADER_TYPE 0x8B4F
825 #define GL_SHADE_MODEL 0x0B54
826 #define GL_SHADING_LANGUAGE_VERSION 0x8B8C
827 #define GL_SHININESS 0x1601
828 #define GL_SHORT 0x1402
829 #define GL_SINGLE_COLOR 0x81F9
830 #define GL_SMOOTH 0x1D01
831 #define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23
832 #define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22
833 #define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13
834 #define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12
835 #define GL_SOURCE0_ALPHA 0x8588
836 #define GL_SOURCE0_RGB 0x8580
837 #define GL_SOURCE1_ALPHA 0x8589
838 #define GL_SOURCE1_RGB 0x8581
839 #define GL_SOURCE2_ALPHA 0x858A
840 #define GL_SOURCE2_RGB 0x8582
841 #define GL_SPECULAR 0x1202
842 #define GL_SPHERE_MAP 0x2402
843 #define GL_SPOT_CUTOFF 0x1206
844 #define GL_SPOT_DIRECTION 0x1204
845 #define GL_SPOT_EXPONENT 0x1205
846 #define GL_SRC0_ALPHA 0x8588
847 #define GL_SRC0_RGB 0x8580
848 #define GL_SRC1_ALPHA 0x8589
849 #define GL_SRC1_RGB 0x8581
850 #define GL_SRC2_ALPHA 0x858A
851 #define GL_SRC2_RGB 0x8582
852 #define GL_SRC_ALPHA 0x0302
853 #define GL_SRC_ALPHA_SATURATE 0x0308
854 #define GL_SRC_COLOR 0x0300
855 #define GL_STACK_OVERFLOW 0x0503
856 #define GL_STACK_UNDERFLOW 0x0504
857 #define GL_STATIC_COPY 0x88E6
858 #define GL_STATIC_DRAW 0x88E4
859 #define GL_STATIC_READ 0x88E5
860 #define GL_STENCIL 0x1802
861 #define GL_STENCIL_ATTACHMENT_EXT 0x8D20
862 #define GL_STENCIL_BACK_FAIL 0x8801
863 #define GL_STENCIL_BACK_FUNC 0x8800
864 #define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802
865 #define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803
866 #define GL_STENCIL_BACK_REF 0x8CA3
867 #define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
868 #define GL_STENCIL_BACK_WRITEMASK 0x8CA5
869 #define GL_STENCIL_BITS 0x0D57
870 #define GL_STENCIL_BUFFER_BIT 0x00000400
871 #define GL_STENCIL_CLEAR_VALUE 0x0B91
872 #define GL_STENCIL_FAIL 0x0B94
873 #define GL_STENCIL_FUNC 0x0B92
874 #define GL_STENCIL_INDEX 0x1901
875 #define GL_STENCIL_INDEX16_EXT 0x8D49
876 #define GL_STENCIL_INDEX1_EXT 0x8D46
877 #define GL_STENCIL_INDEX4_EXT 0x8D47
878 #define GL_STENCIL_INDEX8_EXT 0x8D48
879 #define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
880 #define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
881 #define GL_STENCIL_REF 0x0B97
882 #define GL_STENCIL_TEST 0x0B90
883 #define GL_STENCIL_VALUE_MASK 0x0B93
884 #define GL_STENCIL_WRITEMASK 0x0B98
885 #define GL_STEREO 0x0C33
886 #define GL_STREAM_COPY 0x88E2
887 #define GL_STREAM_DRAW 0x88E0
888 #define GL_STREAM_READ 0x88E1
889 #define GL_SUBPIXEL_BITS 0x0D50
890 #define GL_SUBTRACT 0x84E7
891 #define GL_T 0x2001
892 #define GL_T2F_C3F_V3F 0x2A2A
893 #define GL_T2F_C4F_N3F_V3F 0x2A2C
894 #define GL_T2F_C4UB_V3F 0x2A29
895 #define GL_T2F_N3F_V3F 0x2A2B
896 #define GL_T2F_V3F 0x2A27
897 #define GL_T4F_C4F_N3F_V4F 0x2A2D
898 #define GL_T4F_V4F 0x2A28
899 #define GL_TEXTURE 0x1702
900 #define GL_TEXTURE0 0x84C0
901 #define GL_TEXTURE1 0x84C1
902 #define GL_TEXTURE10 0x84CA
903 #define GL_TEXTURE11 0x84CB
904 #define GL_TEXTURE12 0x84CC
905 #define GL_TEXTURE13 0x84CD
906 #define GL_TEXTURE14 0x84CE
907 #define GL_TEXTURE15 0x84CF
908 #define GL_TEXTURE16 0x84D0
909 #define GL_TEXTURE17 0x84D1
910 #define GL_TEXTURE18 0x84D2
911 #define GL_TEXTURE19 0x84D3
912 #define GL_TEXTURE2 0x84C2
913 #define GL_TEXTURE20 0x84D4
914 #define GL_TEXTURE21 0x84D5
915 #define GL_TEXTURE22 0x84D6
916 #define GL_TEXTURE23 0x84D7
917 #define GL_TEXTURE24 0x84D8
918 #define GL_TEXTURE25 0x84D9
919 #define GL_TEXTURE26 0x84DA
920 #define GL_TEXTURE27 0x84DB
921 #define GL_TEXTURE28 0x84DC
922 #define GL_TEXTURE29 0x84DD
923 #define GL_TEXTURE3 0x84C3
924 #define GL_TEXTURE30 0x84DE
925 #define GL_TEXTURE31 0x84DF
926 #define GL_TEXTURE4 0x84C4
927 #define GL_TEXTURE5 0x84C5
928 #define GL_TEXTURE6 0x84C6
929 #define GL_TEXTURE7 0x84C7
930 #define GL_TEXTURE8 0x84C8
931 #define GL_TEXTURE9 0x84C9
932 #define GL_TEXTURE_1D 0x0DE0
933 #define GL_TEXTURE_2D 0x0DE1
934 #define GL_TEXTURE_3D 0x806F
935 #define GL_TEXTURE_ALPHA_SIZE 0x805F
936 #define GL_TEXTURE_BASE_LEVEL 0x813C
937 #define GL_TEXTURE_BINDING_1D 0x8068
938 #define GL_TEXTURE_BINDING_2D 0x8069
939 #define GL_TEXTURE_BINDING_3D 0x806A
940 #define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
941 #define GL_TEXTURE_BIT 0x00040000
942 #define GL_TEXTURE_BLUE_SIZE 0x805E
943 #define GL_TEXTURE_BORDER 0x1005
944 #define GL_TEXTURE_BORDER_COLOR 0x1004
945 #define GL_TEXTURE_COMPARE_FUNC 0x884D
946 #define GL_TEXTURE_COMPARE_MODE 0x884C
947 #define GL_TEXTURE_COMPONENTS 0x1003
948 #define GL_TEXTURE_COMPRESSED 0x86A1
949 #define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0
950 #define GL_TEXTURE_COMPRESSION_HINT 0x84EF
951 #define GL_TEXTURE_COORD_ARRAY 0x8078
952 #define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A
953 #define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092
954 #define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088
955 #define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A
956 #define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089
957 #define GL_TEXTURE_CUBE_MAP 0x8513
958 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
959 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
960 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
961 #define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
962 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
963 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
964 #define GL_TEXTURE_DEPTH 0x8071
965 #define GL_TEXTURE_DEPTH_SIZE 0x884A
966 #define GL_TEXTURE_ENV 0x2300
967 #define GL_TEXTURE_ENV_COLOR 0x2201
968 #define GL_TEXTURE_ENV_MODE 0x2200
969 #define GL_TEXTURE_FILTER_CONTROL 0x8500
970 #define GL_TEXTURE_GEN_MODE 0x2500
971 #define GL_TEXTURE_GEN_Q 0x0C63
972 #define GL_TEXTURE_GEN_R 0x0C62
973 #define GL_TEXTURE_GEN_S 0x0C60
974 #define GL_TEXTURE_GEN_T 0x0C61
975 #define GL_TEXTURE_GREEN_SIZE 0x805D
976 #define GL_TEXTURE_HEIGHT 0x1001
977 #define GL_TEXTURE_INTENSITY_SIZE 0x8061
978 #define GL_TEXTURE_INTERNAL_FORMAT 0x1003
979 #define GL_TEXTURE_LOD_BIAS 0x8501
980 #define GL_TEXTURE_LUMINANCE_SIZE 0x8060
981 #define GL_TEXTURE_MAG_FILTER 0x2800
982 #define GL_TEXTURE_MATRIX 0x0BA8
983 #define GL_TEXTURE_MAX_LEVEL 0x813D
984 #define GL_TEXTURE_MAX_LOD 0x813B
985 #define GL_TEXTURE_MIN_FILTER 0x2801
986 #define GL_TEXTURE_MIN_LOD 0x813A
987 #define GL_TEXTURE_PRIORITY 0x8066
988 #define GL_TEXTURE_RED_SIZE 0x805C
989 #define GL_TEXTURE_RESIDENT 0x8067
990 #define GL_TEXTURE_STACK_DEPTH 0x0BA5
991 #define GL_TEXTURE_WIDTH 0x1000
992 #define GL_TEXTURE_WRAP_R 0x8072
993 #define GL_TEXTURE_WRAP_S 0x2802
994 #define GL_TEXTURE_WRAP_T 0x2803
995 #define GL_TRANSFORM_BIT 0x00001000
996 #define GL_TRANSPOSE_COLOR_MATRIX 0x84E6
997 #define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3
998 #define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4
999 #define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5
1000 #define GL_TRIANGLES 0x0004
1001 #define GL_TRIANGLE_FAN 0x0006
1002 #define GL_TRIANGLE_STRIP 0x0005
1003 #define GL_TRUE 1
1004 #define GL_UNPACK_ALIGNMENT 0x0CF5
1005 #define GL_UNPACK_IMAGE_HEIGHT 0x806E
1006 #define GL_UNPACK_LSB_FIRST 0x0CF1
1007 #define GL_UNPACK_ROW_LENGTH 0x0CF2
1008 #define GL_UNPACK_SKIP_IMAGES 0x806D
1009 #define GL_UNPACK_SKIP_PIXELS 0x0CF4
1010 #define GL_UNPACK_SKIP_ROWS 0x0CF3
1011 #define GL_UNPACK_SWAP_BYTES 0x0CF0
1012 #define GL_UNSIGNED_BYTE 0x1401
1013 #define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362
1014 #define GL_UNSIGNED_BYTE_3_3_2 0x8032
1015 #define GL_UNSIGNED_INT 0x1405
1016 #define GL_UNSIGNED_INT_10_10_10_2 0x8036
1017 #define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
1018 #define GL_UNSIGNED_INT_8_8_8_8 0x8035
1019 #define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367
1020 #define GL_UNSIGNED_SHORT 0x1403
1021 #define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366
1022 #define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
1023 #define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365
1024 #define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
1025 #define GL_UNSIGNED_SHORT_5_6_5 0x8363
1026 #define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364
1027 #define GL_UPPER_LEFT 0x8CA2
1028 #define GL_V2F 0x2A20
1029 #define GL_V3F 0x2A21
1030 #define GL_VALIDATE_STATUS 0x8B83
1031 #define GL_VENDOR 0x1F00
1032 #define GL_VERSION 0x1F02
1033 #define GL_VERTEX_ARRAY 0x8074
1034 #define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896
1035 #define GL_VERTEX_ARRAY_POINTER 0x808E
1036 #define GL_VERTEX_ARRAY_SIZE 0x807A
1037 #define GL_VERTEX_ARRAY_STRIDE 0x807C
1038 #define GL_VERTEX_ARRAY_TYPE 0x807B
1039 #define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
1040 #define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
1041 #define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
1042 #define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
1043 #define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
1044 #define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
1045 #define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
1046 #define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642
1047 #define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643
1048 #define GL_VERTEX_SHADER 0x8B31
1049 #define GL_VIEWPORT 0x0BA2
1050 #define GL_VIEWPORT_BIT 0x00000800
1051 #define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E
1052 #define GL_WRITE_ONLY 0x88B9
1053 #define GL_XOR 0x1506
1054 #define GL_ZERO 0
1055 #define GL_ZOOM_X 0x0D16
1056 #define GL_ZOOM_Y 0x0D17
1057
1058
1059 #ifndef __khrplatform_h_
1060 #define __khrplatform_h_
1061
1062 /*
1063 ** Copyright (c) 2008-2018 The Khronos Group Inc.
1064 **
1065 ** Permission is hereby granted, free of charge, to any person obtaining a
1066 ** copy of this software and/or associated documentation files (the
1067 ** "Materials"), to deal in the Materials without restriction, including
1068 ** without limitation the rights to use, copy, modify, merge, publish,
1069 ** distribute, sublicense, and/or sell copies of the Materials, and to
1070 ** permit persons to whom the Materials are furnished to do so, subject to
1071 ** the following conditions:
1072 **
1073 ** The above copyright notice and this permission notice shall be included
1074 ** in all copies or substantial portions of the Materials.
1075 **
1076 ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
1077 ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1078 ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1079 ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
1080 ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
1081 ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
1082 ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
1083 */
1084
1085 /* Khronos platform-specific types and definitions.
1086 *
1087 * The master copy of khrplatform.h is maintained in the Khronos EGL
1088 * Registry repository at https://github.com/KhronosGroup/EGL-Registry
1089 * The last semantic modification to khrplatform.h was at commit ID:
1090 * 67a3e0864c2d75ea5287b9f3d2eb74a745936692
1091 *
1092 * Adopters may modify this file to suit their platform. Adopters are
1093 * encouraged to submit platform specific modifications to the Khronos
1094 * group so that they can be included in future versions of this file.
1095 * Please submit changes by filing pull requests or issues on
1096 * the EGL Registry repository linked above.
1097 *
1098 *
1099 * See the Implementer's Guidelines for information about where this file
1100 * should be located on your system and for more details of its use:
1101 * http://www.khronos.org/registry/implementers_guide.pdf
1102 *
1103 * This file should be included as
1104 * #include <KHR/khrplatform.h>
1105 * by Khronos client API header files that use its types and defines.
1106 *
1107 * The types in khrplatform.h should only be used to define API-specific types.
1108 *
1109 * Types defined in khrplatform.h:
1110 * khronos_int8_t signed 8 bit
1111 * khronos_uint8_t unsigned 8 bit
1112 * khronos_int16_t signed 16 bit
1113 * khronos_uint16_t unsigned 16 bit
1114 * khronos_int32_t signed 32 bit
1115 * khronos_uint32_t unsigned 32 bit
1116 * khronos_int64_t signed 64 bit
1117 * khronos_uint64_t unsigned 64 bit
1118 * khronos_intptr_t signed same number of bits as a pointer
1119 * khronos_uintptr_t unsigned same number of bits as a pointer
1120 * khronos_ssize_t signed size
1121 * khronos_usize_t unsigned size
1122 * khronos_float_t signed 32 bit floating point
1123 * khronos_time_ns_t unsigned 64 bit time in nanoseconds
1124 * khronos_utime_nanoseconds_t unsigned time interval or absolute time in
1125 * nanoseconds
1126 * khronos_stime_nanoseconds_t signed time interval in nanoseconds
1127 * khronos_boolean_enum_t enumerated boolean type. This should
1128 * only be used as a base type when a client API's boolean type is
1129 * an enum. Client APIs which use an integer or other type for
1130 * booleans cannot use this as the base type for their boolean.
1131 *
1132 * Tokens defined in khrplatform.h:
1133 *
1134 * KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values.
1135 *
1136 * KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0.
1137 * KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0.
1138 *
1139 * Calling convention macros defined in this file:
1140 * KHRONOS_APICALL
1141 * KHRONOS_GLAD_API_PTR
1142 * KHRONOS_APIATTRIBUTES
1143 *
1144 * These may be used in function prototypes as:
1145 *
1146 * KHRONOS_APICALL void KHRONOS_GLAD_API_PTR funcname(
1147 * int arg1,
1148 * int arg2) KHRONOS_APIATTRIBUTES;
1149 */
1150
1151 /*-------------------------------------------------------------------------
1152 * Definition of KHRONOS_APICALL
1153 *-------------------------------------------------------------------------
1154 * This precedes the return type of the function in the function prototype.
1155 */
1156 #if defined(_WIN32) && !defined(__SCITECH_SNAP__)
1157 # define KHRONOS_APICALL __declspec(dllimport)
1158 #elif defined (__SYMBIAN32__)
1159 # define KHRONOS_APICALL IMPORT_C
1160 #elif defined(__ANDROID__)
1161 # define KHRONOS_APICALL __attribute__((visibility("default")))
1162 #else
1163 # define KHRONOS_APICALL
1164 #endif
1165
1166 /*-------------------------------------------------------------------------
1167 * Definition of KHRONOS_GLAD_API_PTR
1168 *-------------------------------------------------------------------------
1169 * This follows the return type of the function and precedes the function
1170 * name in the function prototype.
1171 */
1172 #if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__)
1173 /* Win32 but not WinCE */
1174 # define KHRONOS_GLAD_API_PTR __stdcall
1175 #else
1176 # define KHRONOS_GLAD_API_PTR
1177 #endif
1178
1179 /*-------------------------------------------------------------------------
1180 * Definition of KHRONOS_APIATTRIBUTES
1181 *-------------------------------------------------------------------------
1182 * This follows the closing parenthesis of the function prototype arguments.
1183 */
1184 #if defined (__ARMCC_2__)
1185 #define KHRONOS_APIATTRIBUTES __softfp
1186 #else
1187 #define KHRONOS_APIATTRIBUTES
1188 #endif
1189
1190 /*-------------------------------------------------------------------------
1191 * basic type definitions
1192 *-----------------------------------------------------------------------*/
1193 #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__)
1194
1195
1196 /*
1197 * Using <stdint.h>
1198 */
1199 #include <stdint.h>
1200 typedef int32_t khronos_int32_t;
1201 typedef uint32_t khronos_uint32_t;
1202 typedef int64_t khronos_int64_t;
1203 typedef uint64_t khronos_uint64_t;
1204 #define KHRONOS_SUPPORT_INT64 1
1205 #define KHRONOS_SUPPORT_FLOAT 1
1206
1207 #elif defined(__VMS ) || defined(__sgi)
1208
1209 /*
1210 * Using <inttypes.h>
1211 */
1212 #include <inttypes.h>
1213 typedef int32_t khronos_int32_t;
1214 typedef uint32_t khronos_uint32_t;
1215 typedef int64_t khronos_int64_t;
1216 typedef uint64_t khronos_uint64_t;
1217 #define KHRONOS_SUPPORT_INT64 1
1218 #define KHRONOS_SUPPORT_FLOAT 1
1219
1220 #elif defined(_WIN32) && !defined(__SCITECH_SNAP__)
1221
1222 /*
1223 * Win32
1224 */
1225 typedef __int32 khronos_int32_t;
1226 typedef unsigned __int32 khronos_uint32_t;
1227 typedef __int64 khronos_int64_t;
1228 typedef unsigned __int64 khronos_uint64_t;
1229 #define KHRONOS_SUPPORT_INT64 1
1230 #define KHRONOS_SUPPORT_FLOAT 1
1231
1232 #elif defined(__sun__) || defined(__digital__)
1233
1234 /*
1235 * Sun or Digital
1236 */
1237 typedef int khronos_int32_t;
1238 typedef unsigned int khronos_uint32_t;
1239 #if defined(__arch64__) || defined(_LP64)
1240 typedef long int khronos_int64_t;
1241 typedef unsigned long int khronos_uint64_t;
1242 #else
1243 typedef long long int khronos_int64_t;
1244 typedef unsigned long long int khronos_uint64_t;
1245 #endif /* __arch64__ */
1246 #define KHRONOS_SUPPORT_INT64 1
1247 #define KHRONOS_SUPPORT_FLOAT 1
1248
1249 #elif 0
1250
1251 /*
1252 * Hypothetical platform with no float or int64 support
1253 */
1254 typedef int khronos_int32_t;
1255 typedef unsigned int khronos_uint32_t;
1256 #define KHRONOS_SUPPORT_INT64 0
1257 #define KHRONOS_SUPPORT_FLOAT 0
1258
1259 #else
1260
1261 /*
1262 * Generic fallback
1263 */
1264 #include <stdint.h>
1265 typedef int32_t khronos_int32_t;
1266 typedef uint32_t khronos_uint32_t;
1267 typedef int64_t khronos_int64_t;
1268 typedef uint64_t khronos_uint64_t;
1269 #define KHRONOS_SUPPORT_INT64 1
1270 #define KHRONOS_SUPPORT_FLOAT 1
1271
1272 #endif
1273
1274
1275 /*
1276 * Types that are (so far) the same on all platforms
1277 */
1278 typedef signed char khronos_int8_t;
1279 typedef unsigned char khronos_uint8_t;
1280 typedef signed short int khronos_int16_t;
1281 typedef unsigned short int khronos_uint16_t;
1282
1283 /*
1284 * Types that differ between LLP64 and LP64 architectures - in LLP64,
1285 * pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
1286 * to be the only LLP64 architecture in current use.
1287 */
1288 #ifdef _WIN64
1289 typedef signed long long int khronos_intptr_t;
1290 typedef unsigned long long int khronos_uintptr_t;
1291 typedef signed long long int khronos_ssize_t;
1292 typedef unsigned long long int khronos_usize_t;
1293 #else
1294 typedef signed long int khronos_intptr_t;
1295 typedef unsigned long int khronos_uintptr_t;
1296 typedef signed long int khronos_ssize_t;
1297 typedef unsigned long int khronos_usize_t;
1298 #endif
1299
1300 #if KHRONOS_SUPPORT_FLOAT
1301 /*
1302 * Float type
1303 */
1304 typedef float khronos_float_t;
1305 #endif
1306
1307 #if KHRONOS_SUPPORT_INT64
1308 /* Time types
1309 *
1310 * These types can be used to represent a time interval in nanoseconds or
1311 * an absolute Unadjusted System Time. Unadjusted System Time is the number
1312 * of nanoseconds since some arbitrary system event (e.g. since the last
1313 * time the system booted). The Unadjusted System Time is an unsigned
1314 * 64 bit value that wraps back to 0 every 584 years. Time intervals
1315 * may be either signed or unsigned.
1316 */
1317 typedef khronos_uint64_t khronos_utime_nanoseconds_t;
1318 typedef khronos_int64_t khronos_stime_nanoseconds_t;
1319 #endif
1320
1321 /*
1322 * Dummy value used to pad enum types to 32 bits.
1323 */
1324 #ifndef KHRONOS_MAX_ENUM
1325 #define KHRONOS_MAX_ENUM 0x7FFFFFFF
1326 #endif
1327
1328 /*
1329 * Enumerated boolean type
1330 *
1331 * Values other than zero should be considered to be true. Therefore
1332 * comparisons should not be made against KHRONOS_TRUE.
1333 */
1334 typedef enum {
1335 KHRONOS_FALSE = 0,
1336 KHRONOS_TRUE = 1,
1337 KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM
1338 } khronos_boolean_enum_t;
1339
1340 #endif /* __khrplatform_h_ */
1341 typedef unsigned int GLenum;
1342 typedef unsigned char GLboolean;
1343 typedef unsigned int GLbitfield;
1344 typedef void GLvoid;
1345 typedef khronos_int8_t GLbyte;
1346 typedef khronos_uint8_t GLubyte;
1347 typedef khronos_int16_t GLshort;
1348 typedef khronos_uint16_t GLushort;
1349 typedef int GLint;
1350 typedef unsigned int GLuint;
1351 typedef khronos_int32_t GLclampx;
1352 typedef int GLsizei;
1353 typedef khronos_float_t GLfloat;
1354 typedef khronos_float_t GLclampf;
1355 typedef double GLdouble;
1356 typedef double GLclampd;
1357 typedef void *GLeglClientBufferEXT;
1358 typedef void *GLeglImageOES;
1359 typedef char GLchar;
1360 typedef char GLcharARB;
1361 #ifdef __APPLE__
1362 typedef void *GLhandleARB;
1363 #else
1364 typedef unsigned int GLhandleARB;
1365 #endif
1366 typedef khronos_uint16_t GLhalf;
1367 typedef khronos_uint16_t GLhalfARB;
1368 typedef khronos_int32_t GLfixed;
1369 #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
1370 typedef khronos_intptr_t GLintptr;
1371 #else
1372 typedef khronos_intptr_t GLintptr;
1373 #endif
1374 #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
1375 typedef khronos_intptr_t GLintptrARB;
1376 #else
1377 typedef khronos_intptr_t GLintptrARB;
1378 #endif
1379 #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
1380 typedef khronos_ssize_t GLsizeiptr;
1381 #else
1382 typedef khronos_ssize_t GLsizeiptr;
1383 #endif
1384 #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
1385 typedef khronos_ssize_t GLsizeiptrARB;
1386 #else
1387 typedef khronos_ssize_t GLsizeiptrARB;
1388 #endif
1389 typedef khronos_int64_t GLint64;
1390 typedef khronos_int64_t GLint64EXT;
1391 typedef khronos_uint64_t GLuint64;
1392 typedef khronos_uint64_t GLuint64EXT;
1393 typedef struct __GLsync *GLsync;
1394 struct _cl_context;
1395 struct _cl_event;
1396 typedef void ( *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
1397 typedef void ( *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
1398 typedef void ( *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
1399 typedef void ( *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,void *userParam);
1400 typedef unsigned short GLhalfNV;
1401 typedef GLintptr GLvdpauSurfaceNV;
1402 typedef void ( *GLVULKANPROCNV)(void);
1403
1404
1405 #define GL_VERSION_1_0 1
1406 GLAD_API_CALL int GLAD_GL_VERSION_1_0;
1407 #define GL_VERSION_1_1 1
1408 GLAD_API_CALL int GLAD_GL_VERSION_1_1;
1409 #define GL_VERSION_1_2 1
1410 GLAD_API_CALL int GLAD_GL_VERSION_1_2;
1411 #define GL_VERSION_1_3 1
1412 GLAD_API_CALL int GLAD_GL_VERSION_1_3;
1413 #define GL_VERSION_1_4 1
1414 GLAD_API_CALL int GLAD_GL_VERSION_1_4;
1415 #define GL_VERSION_1_5 1
1416 GLAD_API_CALL int GLAD_GL_VERSION_1_5;
1417 #define GL_VERSION_2_0 1
1418 GLAD_API_CALL int GLAD_GL_VERSION_2_0;
1419 #define GL_EXT_framebuffer_object 1
1420 GLAD_API_CALL int GLAD_GL_EXT_framebuffer_object;
1421
1422
1423 typedef void (GLAD_API_PTR *PFNGLACCUMPROC)(GLenum op, GLfloat value);
1424 typedef void (GLAD_API_PTR *PFNGLACTIVETEXTUREPROC)(GLenum texture);
1425 typedef void (GLAD_API_PTR *PFNGLALPHAFUNCPROC)(GLenum func, GLfloat ref);
1426 typedef GLboolean (GLAD_API_PTR *PFNGLARETEXTURESRESIDENTPROC)(GLsizei n, const GLuint * textures, GLboolean * residences);
1427 typedef void (GLAD_API_PTR *PFNGLARRAYELEMENTPROC)(GLint i);
1428 typedef void (GLAD_API_PTR *PFNGLATTACHSHADERPROC)(GLuint program, GLuint shader);
1429 typedef void (GLAD_API_PTR *PFNGLBEGINPROC)(GLenum mode);
1430 typedef void (GLAD_API_PTR *PFNGLBEGINQUERYPROC)(GLenum target, GLuint id);
1431 typedef void (GLAD_API_PTR *PFNGLBINDATTRIBLOCATIONPROC)(GLuint program, GLuint index, const GLchar * name);
1432 typedef void (GLAD_API_PTR *PFNGLBINDBUFFERPROC)(GLenum target, GLuint buffer);
1433 typedef void (GLAD_API_PTR *PFNGLBINDFRAMEBUFFEREXTPROC)(GLenum target, GLuint framebuffer);
1434 typedef void (GLAD_API_PTR *PFNGLBINDRENDERBUFFEREXTPROC)(GLenum target, GLuint renderbuffer);
1435 typedef void (GLAD_API_PTR *PFNGLBINDTEXTUREPROC)(GLenum target, GLuint texture);
1436 typedef void (GLAD_API_PTR *PFNGLBITMAPPROC)(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte * bitmap);
1437 typedef void (GLAD_API_PTR *PFNGLBLENDCOLORPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
1438 typedef void (GLAD_API_PTR *PFNGLBLENDEQUATIONPROC)(GLenum mode);
1439 typedef void (GLAD_API_PTR *PFNGLBLENDEQUATIONSEPARATEPROC)(GLenum modeRGB, GLenum modeAlpha);
1440 typedef void (GLAD_API_PTR *PFNGLBLENDFUNCPROC)(GLenum sfactor, GLenum dfactor);
1441 typedef void (GLAD_API_PTR *PFNGLBLENDFUNCSEPARATEPROC)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
1442 typedef void (GLAD_API_PTR *PFNGLBUFFERDATAPROC)(GLenum target, GLsizeiptr size, const void * data, GLenum usage);
1443 typedef void (GLAD_API_PTR *PFNGLBUFFERSUBDATAPROC)(GLenum target, GLintptr offset, GLsizeiptr size, const void * data);
1444 typedef void (GLAD_API_PTR *PFNGLCALLLISTPROC)(GLuint list);
1445 typedef void (GLAD_API_PTR *PFNGLCALLLISTSPROC)(GLsizei n, GLenum type, const void * lists);
1446 typedef GLenum (GLAD_API_PTR *PFNGLCHECKFRAMEBUFFERSTATUSPROC)(GLenum target);
1447 typedef GLenum (GLAD_API_PTR *PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC)(GLenum target);
1448 typedef void (GLAD_API_PTR *PFNGLCLEARPROC)(GLbitfield mask);
1449 typedef void (GLAD_API_PTR *PFNGLCLEARACCUMPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
1450 typedef void (GLAD_API_PTR *PFNGLCLEARCOLORPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
1451 typedef void (GLAD_API_PTR *PFNGLCLEARDEPTHPROC)(GLdouble depth);
1452 typedef void (GLAD_API_PTR *PFNGLCLEARINDEXPROC)(GLfloat c);
1453 typedef void (GLAD_API_PTR *PFNGLCLEARSTENCILPROC)(GLint s);
1454 typedef void (GLAD_API_PTR *PFNGLCLIENTACTIVETEXTUREPROC)(GLenum texture);
1455 typedef void (GLAD_API_PTR *PFNGLCLIPPLANEPROC)(GLenum plane, const GLdouble * equation);
1456 typedef void (GLAD_API_PTR *PFNGLCOLOR3BPROC)(GLbyte red, GLbyte green, GLbyte blue);
1457 typedef void (GLAD_API_PTR *PFNGLCOLOR3BVPROC)(const GLbyte * v);
1458 typedef void (GLAD_API_PTR *PFNGLCOLOR3DPROC)(GLdouble red, GLdouble green, GLdouble blue);
1459 typedef void (GLAD_API_PTR *PFNGLCOLOR3DVPROC)(const GLdouble * v);
1460 typedef void (GLAD_API_PTR *PFNGLCOLOR3FPROC)(GLfloat red, GLfloat green, GLfloat blue);
1461 typedef void (GLAD_API_PTR *PFNGLCOLOR3FVPROC)(const GLfloat * v);
1462 typedef void (GLAD_API_PTR *PFNGLCOLOR3IPROC)(GLint red, GLint green, GLint blue);
1463 typedef void (GLAD_API_PTR *PFNGLCOLOR3IVPROC)(const GLint * v);
1464 typedef void (GLAD_API_PTR *PFNGLCOLOR3SPROC)(GLshort red, GLshort green, GLshort blue);
1465 typedef void (GLAD_API_PTR *PFNGLCOLOR3SVPROC)(const GLshort * v);
1466 typedef void (GLAD_API_PTR *PFNGLCOLOR3UBPROC)(GLubyte red, GLubyte green, GLubyte blue);
1467 typedef void (GLAD_API_PTR *PFNGLCOLOR3UBVPROC)(const GLubyte * v);
1468 typedef void (GLAD_API_PTR *PFNGLCOLOR3UIPROC)(GLuint red, GLuint green, GLuint blue);
1469 typedef void (GLAD_API_PTR *PFNGLCOLOR3UIVPROC)(const GLuint * v);
1470 typedef void (GLAD_API_PTR *PFNGLCOLOR3USPROC)(GLushort red, GLushort green, GLushort blue);
1471 typedef void (GLAD_API_PTR *PFNGLCOLOR3USVPROC)(const GLushort * v);
1472 typedef void (GLAD_API_PTR *PFNGLCOLOR4BPROC)(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha);
1473 typedef void (GLAD_API_PTR *PFNGLCOLOR4BVPROC)(const GLbyte * v);
1474 typedef void (GLAD_API_PTR *PFNGLCOLOR4DPROC)(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha);
1475 typedef void (GLAD_API_PTR *PFNGLCOLOR4DVPROC)(const GLdouble * v);
1476 typedef void (GLAD_API_PTR *PFNGLCOLOR4FPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
1477 typedef void (GLAD_API_PTR *PFNGLCOLOR4FVPROC)(const GLfloat * v);
1478 typedef void (GLAD_API_PTR *PFNGLCOLOR4IPROC)(GLint red, GLint green, GLint blue, GLint alpha);
1479 typedef void (GLAD_API_PTR *PFNGLCOLOR4IVPROC)(const GLint * v);
1480 typedef void (GLAD_API_PTR *PFNGLCOLOR4SPROC)(GLshort red, GLshort green, GLshort blue, GLshort alpha);
1481 typedef void (GLAD_API_PTR *PFNGLCOLOR4SVPROC)(const GLshort * v);
1482 typedef void (GLAD_API_PTR *PFNGLCOLOR4UBPROC)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
1483 typedef void (GLAD_API_PTR *PFNGLCOLOR4UBVPROC)(const GLubyte * v);
1484 typedef void (GLAD_API_PTR *PFNGLCOLOR4UIPROC)(GLuint red, GLuint green, GLuint blue, GLuint alpha);
1485 typedef void (GLAD_API_PTR *PFNGLCOLOR4UIVPROC)(const GLuint * v);
1486 typedef void (GLAD_API_PTR *PFNGLCOLOR4USPROC)(GLushort red, GLushort green, GLushort blue, GLushort alpha);
1487 typedef void (GLAD_API_PTR *PFNGLCOLOR4USVPROC)(const GLushort * v);
1488 typedef void (GLAD_API_PTR *PFNGLCOLORMASKPROC)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
1489 typedef void (GLAD_API_PTR *PFNGLCOLORMATERIALPROC)(GLenum face, GLenum mode);
1490 typedef void (GLAD_API_PTR *PFNGLCOLORPOINTERPROC)(GLint size, GLenum type, GLsizei stride, const void * pointer);
1491 typedef void (GLAD_API_PTR *PFNGLCOMPILESHADERPROC)(GLuint shader);
1492 typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXIMAGE1DPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void * data);
1493 typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXIMAGE2DPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void * data);
1494 typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXIMAGE3DPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void * data);
1495 typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void * data);
1496 typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void * data);
1497 typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void * data);
1498 typedef void (GLAD_API_PTR *PFNGLCOPYPIXELSPROC)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type);
1499 typedef void (GLAD_API_PTR *PFNGLCOPYTEXIMAGE1DPROC)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
1500 typedef void (GLAD_API_PTR *PFNGLCOPYTEXIMAGE2DPROC)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
1501 typedef void (GLAD_API_PTR *PFNGLCOPYTEXSUBIMAGE1DPROC)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
1502 typedef void (GLAD_API_PTR *PFNGLCOPYTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
1503 typedef void (GLAD_API_PTR *PFNGLCOPYTEXSUBIMAGE3DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
1504 typedef GLuint (GLAD_API_PTR *PFNGLCREATEPROGRAMPROC)(void);
1505 typedef GLuint (GLAD_API_PTR *PFNGLCREATESHADERPROC)(GLenum type);
1506 typedef void (GLAD_API_PTR *PFNGLCULLFACEPROC)(GLenum mode);
1507 typedef void (GLAD_API_PTR *PFNGLDELETEBUFFERSPROC)(GLsizei n, const GLuint * buffers);
1508 typedef void (GLAD_API_PTR *PFNGLDELETEFRAMEBUFFERSPROC)(GLsizei n, const GLuint * framebuffers);
1509 typedef void (GLAD_API_PTR *PFNGLDELETEFRAMEBUFFERSEXTPROC)(GLsizei n, const GLuint * framebuffers);
1510 typedef void (GLAD_API_PTR *PFNGLDELETELISTSPROC)(GLuint list, GLsizei range);
1511 typedef void (GLAD_API_PTR *PFNGLDELETEPROGRAMPROC)(GLuint program);
1512 typedef void (GLAD_API_PTR *PFNGLDELETEQUERIESPROC)(GLsizei n, const GLuint * ids);
1513 typedef void (GLAD_API_PTR *PFNGLDELETERENDERBUFFERSPROC)(GLsizei n, const GLuint * renderbuffers);
1514 typedef void (GLAD_API_PTR *PFNGLDELETERENDERBUFFERSEXTPROC)(GLsizei n, const GLuint * renderbuffers);
1515 typedef void (GLAD_API_PTR *PFNGLDELETESHADERPROC)(GLuint shader);
1516 typedef void (GLAD_API_PTR *PFNGLDELETETEXTURESPROC)(GLsizei n, const GLuint * textures);
1517 typedef void (GLAD_API_PTR *PFNGLDEPTHFUNCPROC)(GLenum func);
1518 typedef void (GLAD_API_PTR *PFNGLDEPTHMASKPROC)(GLboolean flag);
1519 typedef void (GLAD_API_PTR *PFNGLDEPTHRANGEPROC)(GLdouble n, GLdouble f);
1520 typedef void (GLAD_API_PTR *PFNGLDETACHSHADERPROC)(GLuint program, GLuint shader);
1521 typedef void (GLAD_API_PTR *PFNGLDISABLEPROC)(GLenum cap);
1522 typedef void (GLAD_API_PTR *PFNGLDISABLECLIENTSTATEPROC)(GLenum array);
1523 typedef void (GLAD_API_PTR *PFNGLDISABLEVERTEXATTRIBARRAYPROC)(GLuint index);
1524 typedef void (GLAD_API_PTR *PFNGLDRAWARRAYSPROC)(GLenum mode, GLint first, GLsizei count);
1525 typedef void (GLAD_API_PTR *PFNGLDRAWBUFFERPROC)(GLenum buf);
1526 typedef void (GLAD_API_PTR *PFNGLDRAWBUFFERSPROC)(GLsizei n, const GLenum * bufs);
1527 typedef void (GLAD_API_PTR *PFNGLDRAWELEMENTSPROC)(GLenum mode, GLsizei count, GLenum type, const void * indices);
1528 typedef void (GLAD_API_PTR *PFNGLDRAWPIXELSPROC)(GLsizei width, GLsizei height, GLenum format, GLenum type, const void * pixels);
1529 typedef void (GLAD_API_PTR *PFNGLDRAWRANGEELEMENTSPROC)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void * indices);
1530 typedef void (GLAD_API_PTR *PFNGLEDGEFLAGPROC)(GLboolean flag);
1531 typedef void (GLAD_API_PTR *PFNGLEDGEFLAGPOINTERPROC)(GLsizei stride, const void * pointer);
1532 typedef void (GLAD_API_PTR *PFNGLEDGEFLAGVPROC)(const GLboolean * flag);
1533 typedef void (GLAD_API_PTR *PFNGLENABLEPROC)(GLenum cap);
1534 typedef void (GLAD_API_PTR *PFNGLENABLECLIENTSTATEPROC)(GLenum array);
1535 typedef void (GLAD_API_PTR *PFNGLENABLEVERTEXATTRIBARRAYPROC)(GLuint index);
1536 typedef void (GLAD_API_PTR *PFNGLENDPROC)(void);
1537 typedef void (GLAD_API_PTR *PFNGLENDLISTPROC)(void);
1538 typedef void (GLAD_API_PTR *PFNGLENDQUERYPROC)(GLenum target);
1539 typedef void (GLAD_API_PTR *PFNGLEVALCOORD1DPROC)(GLdouble u);
1540 typedef void (GLAD_API_PTR *PFNGLEVALCOORD1DVPROC)(const GLdouble * u);
1541 typedef void (GLAD_API_PTR *PFNGLEVALCOORD1FPROC)(GLfloat u);
1542 typedef void (GLAD_API_PTR *PFNGLEVALCOORD1FVPROC)(const GLfloat * u);
1543 typedef void (GLAD_API_PTR *PFNGLEVALCOORD2DPROC)(GLdouble u, GLdouble v);
1544 typedef void (GLAD_API_PTR *PFNGLEVALCOORD2DVPROC)(const GLdouble * u);
1545 typedef void (GLAD_API_PTR *PFNGLEVALCOORD2FPROC)(GLfloat u, GLfloat v);
1546 typedef void (GLAD_API_PTR *PFNGLEVALCOORD2FVPROC)(const GLfloat * u);
1547 typedef void (GLAD_API_PTR *PFNGLEVALMESH1PROC)(GLenum mode, GLint i1, GLint i2);
1548 typedef void (GLAD_API_PTR *PFNGLEVALMESH2PROC)(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2);
1549 typedef void (GLAD_API_PTR *PFNGLEVALPOINT1PROC)(GLint i);
1550 typedef void (GLAD_API_PTR *PFNGLEVALPOINT2PROC)(GLint i, GLint j);
1551 typedef void (GLAD_API_PTR *PFNGLFEEDBACKBUFFERPROC)(GLsizei size, GLenum type, GLfloat * buffer);
1552 typedef void (GLAD_API_PTR *PFNGLFINISHPROC)(void);
1553 typedef void (GLAD_API_PTR *PFNGLFLUSHPROC)(void);
1554 typedef void (GLAD_API_PTR *PFNGLFOGCOORDPOINTERPROC)(GLenum type, GLsizei stride, const void * pointer);
1555 typedef void (GLAD_API_PTR *PFNGLFOGCOORDDPROC)(GLdouble coord);
1556 typedef void (GLAD_API_PTR *PFNGLFOGCOORDDVPROC)(const GLdouble * coord);
1557 typedef void (GLAD_API_PTR *PFNGLFOGCOORDFPROC)(GLfloat coord);
1558 typedef void (GLAD_API_PTR *PFNGLFOGCOORDFVPROC)(const GLfloat * coord);
1559 typedef void (GLAD_API_PTR *PFNGLFOGFPROC)(GLenum pname, GLfloat param);
1560 typedef void (GLAD_API_PTR *PFNGLFOGFVPROC)(GLenum pname, const GLfloat * params);
1561 typedef void (GLAD_API_PTR *PFNGLFOGIPROC)(GLenum pname, GLint param);
1562 typedef void (GLAD_API_PTR *PFNGLFOGIVPROC)(GLenum pname, const GLint * params);
1563 typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERRENDERBUFFERPROC)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
1564 typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
1565 typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERTEXTURE1DPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
1566 typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERTEXTURE1DEXTPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
1567 typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERTEXTURE2DPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
1568 typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERTEXTURE2DEXTPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
1569 typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERTEXTURE3DPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
1570 typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERTEXTURE3DEXTPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
1571 typedef void (GLAD_API_PTR *PFNGLFRONTFACEPROC)(GLenum mode);
1572 typedef void (GLAD_API_PTR *PFNGLFRUSTUMPROC)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
1573 typedef void (GLAD_API_PTR *PFNGLGENBUFFERSPROC)(GLsizei n, GLuint * buffers);
1574 typedef void (GLAD_API_PTR *PFNGLGENFRAMEBUFFERSPROC)(GLsizei n, GLuint * framebuffers);
1575 typedef void (GLAD_API_PTR *PFNGLGENFRAMEBUFFERSEXTPROC)(GLsizei n, GLuint * framebuffers);
1576 typedef GLuint (GLAD_API_PTR *PFNGLGENLISTSPROC)(GLsizei range);
1577 typedef void (GLAD_API_PTR *PFNGLGENQUERIESPROC)(GLsizei n, GLuint * ids);
1578 typedef void (GLAD_API_PTR *PFNGLGENRENDERBUFFERSPROC)(GLsizei n, GLuint * renderbuffers);
1579 typedef void (GLAD_API_PTR *PFNGLGENRENDERBUFFERSEXTPROC)(GLsizei n, GLuint * renderbuffers);
1580 typedef void (GLAD_API_PTR *PFNGLGENTEXTURESPROC)(GLsizei n, GLuint * textures);
1581 typedef void (GLAD_API_PTR *PFNGLGENERATEMIPMAPPROC)(GLenum target);
1582 typedef void (GLAD_API_PTR *PFNGLGENERATEMIPMAPEXTPROC)(GLenum target);
1583 typedef void (GLAD_API_PTR *PFNGLGETACTIVEATTRIBPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name);
1584 typedef void (GLAD_API_PTR *PFNGLGETACTIVEUNIFORMPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name);
1585 typedef void (GLAD_API_PTR *PFNGLGETATTACHEDSHADERSPROC)(GLuint program, GLsizei maxCount, GLsizei * count, GLuint * shaders);
1586 typedef GLint (GLAD_API_PTR *PFNGLGETATTRIBLOCATIONPROC)(GLuint program, const GLchar * name);
1587 typedef void (GLAD_API_PTR *PFNGLGETBOOLEANVPROC)(GLenum pname, GLboolean * data);
1588 typedef void (GLAD_API_PTR *PFNGLGETBUFFERPARAMETERIVPROC)(GLenum target, GLenum pname, GLint * params);
1589 typedef void (GLAD_API_PTR *PFNGLGETBUFFERPOINTERVPROC)(GLenum target, GLenum pname, void ** params);
1590 typedef void (GLAD_API_PTR *PFNGLGETBUFFERSUBDATAPROC)(GLenum target, GLintptr offset, GLsizeiptr size, void * data);
1591 typedef void (GLAD_API_PTR *PFNGLGETCLIPPLANEPROC)(GLenum plane, GLdouble * equation);
1592 typedef void (GLAD_API_PTR *PFNGLGETCOMPRESSEDTEXIMAGEPROC)(GLenum target, GLint level, void * img);
1593 typedef void (GLAD_API_PTR *PFNGLGETDOUBLEVPROC)(GLenum pname, GLdouble * data);
1594 typedef GLenum (GLAD_API_PTR *PFNGLGETERRORPROC)(void);
1595 typedef void (GLAD_API_PTR *PFNGLGETFLOATVPROC)(GLenum pname, GLfloat * data);
1596 typedef void (GLAD_API_PTR *PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)(GLenum target, GLenum attachment, GLenum pname, GLint * params);
1597 typedef void (GLAD_API_PTR *PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)(GLenum target, GLenum attachment, GLenum pname, GLint * params);
1598 typedef void (GLAD_API_PTR *PFNGLGETINTEGERVPROC)(GLenum pname, GLint * data);
1599 typedef void (GLAD_API_PTR *PFNGLGETLIGHTFVPROC)(GLenum light, GLenum pname, GLfloat * params);
1600 typedef void (GLAD_API_PTR *PFNGLGETLIGHTIVPROC)(GLenum light, GLenum pname, GLint * params);
1601 typedef void (GLAD_API_PTR *PFNGLGETMAPDVPROC)(GLenum target, GLenum query, GLdouble * v);
1602 typedef void (GLAD_API_PTR *PFNGLGETMAPFVPROC)(GLenum target, GLenum query, GLfloat * v);
1603 typedef void (GLAD_API_PTR *PFNGLGETMAPIVPROC)(GLenum target, GLenum query, GLint * v);
1604 typedef void (GLAD_API_PTR *PFNGLGETMATERIALFVPROC)(GLenum face, GLenum pname, GLfloat * params);
1605 typedef void (GLAD_API_PTR *PFNGLGETMATERIALIVPROC)(GLenum face, GLenum pname, GLint * params);
1606 typedef void (GLAD_API_PTR *PFNGLGETPIXELMAPFVPROC)(GLenum map, GLfloat * values);
1607 typedef void (GLAD_API_PTR *PFNGLGETPIXELMAPUIVPROC)(GLenum map, GLuint * values);
1608 typedef void (GLAD_API_PTR *PFNGLGETPIXELMAPUSVPROC)(GLenum map, GLushort * values);
1609 typedef void (GLAD_API_PTR *PFNGLGETPOINTERVPROC)(GLenum pname, void ** params);
1610 typedef void (GLAD_API_PTR *PFNGLGETPOLYGONSTIPPLEPROC)(GLubyte * mask);
1611 typedef void (GLAD_API_PTR *PFNGLGETPROGRAMINFOLOGPROC)(GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog);
1612 typedef void (GLAD_API_PTR *PFNGLGETPROGRAMIVPROC)(GLuint program, GLenum pname, GLint * params);
1613 typedef void (GLAD_API_PTR *PFNGLGETQUERYOBJECTIVPROC)(GLuint id, GLenum pname, GLint * params);
1614 typedef void (GLAD_API_PTR *PFNGLGETQUERYOBJECTUIVPROC)(GLuint id, GLenum pname, GLuint * params);
1615 typedef void (GLAD_API_PTR *PFNGLGETQUERYIVPROC)(GLenum target, GLenum pname, GLint * params);
1616 typedef void (GLAD_API_PTR *PFNGLGETRENDERBUFFERPARAMETERIVPROC)(GLenum target, GLenum pname, GLint * params);
1617 typedef void (GLAD_API_PTR *PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC)(GLenum target, GLenum pname, GLint * params);
1618 typedef void (GLAD_API_PTR *PFNGLGETSHADERINFOLOGPROC)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog);
1619 typedef void (GLAD_API_PTR *PFNGLGETSHADERSOURCEPROC)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * source);
1620 typedef void (GLAD_API_PTR *PFNGLGETSHADERIVPROC)(GLuint shader, GLenum pname, GLint * params);
1621 typedef const GLubyte * (GLAD_API_PTR *PFNGLGETSTRINGPROC)(GLenum name);
1622 typedef void (GLAD_API_PTR *PFNGLGETTEXENVFVPROC)(GLenum target, GLenum pname, GLfloat * params);
1623 typedef void (GLAD_API_PTR *PFNGLGETTEXENVIVPROC)(GLenum target, GLenum pname, GLint * params);
1624 typedef void (GLAD_API_PTR *PFNGLGETTEXGENDVPROC)(GLenum coord, GLenum pname, GLdouble * params);
1625 typedef void (GLAD_API_PTR *PFNGLGETTEXGENFVPROC)(GLenum coord, GLenum pname, GLfloat * params);
1626 typedef void (GLAD_API_PTR *PFNGLGETTEXGENIVPROC)(GLenum coord, GLenum pname, GLint * params);
1627 typedef void (GLAD_API_PTR *PFNGLGETTEXIMAGEPROC)(GLenum target, GLint level, GLenum format, GLenum type, void * pixels);
1628 typedef void (GLAD_API_PTR *PFNGLGETTEXLEVELPARAMETERFVPROC)(GLenum target, GLint level, GLenum pname, GLfloat * params);
1629 typedef void (GLAD_API_PTR *PFNGLGETTEXLEVELPARAMETERIVPROC)(GLenum target, GLint level, GLenum pname, GLint * params);
1630 typedef void (GLAD_API_PTR *PFNGLGETTEXPARAMETERFVPROC)(GLenum target, GLenum pname, GLfloat * params);
1631 typedef void (GLAD_API_PTR *PFNGLGETTEXPARAMETERIVPROC)(GLenum target, GLenum pname, GLint * params);
1632 typedef GLint (GLAD_API_PTR *PFNGLGETUNIFORMLOCATIONPROC)(GLuint program, const GLchar * name);
1633 typedef void (GLAD_API_PTR *PFNGLGETUNIFORMFVPROC)(GLuint program, GLint location, GLfloat * params);
1634 typedef void (GLAD_API_PTR *PFNGLGETUNIFORMIVPROC)(GLuint program, GLint location, GLint * params);
1635 typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBPOINTERVPROC)(GLuint index, GLenum pname, void ** pointer);
1636 typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBDVPROC)(GLuint index, GLenum pname, GLdouble * params);
1637 typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBFVPROC)(GLuint index, GLenum pname, GLfloat * params);
1638 typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBIVPROC)(GLuint index, GLenum pname, GLint * params);
1639 typedef void (GLAD_API_PTR *PFNGLHINTPROC)(GLenum target, GLenum mode);
1640 typedef void (GLAD_API_PTR *PFNGLINDEXMASKPROC)(GLuint mask);
1641 typedef void (GLAD_API_PTR *PFNGLINDEXPOINTERPROC)(GLenum type, GLsizei stride, const void * pointer);
1642 typedef void (GLAD_API_PTR *PFNGLINDEXDPROC)(GLdouble c);
1643 typedef void (GLAD_API_PTR *PFNGLINDEXDVPROC)(const GLdouble * c);
1644 typedef void (GLAD_API_PTR *PFNGLINDEXFPROC)(GLfloat c);
1645 typedef void (GLAD_API_PTR *PFNGLINDEXFVPROC)(const GLfloat * c);
1646 typedef void (GLAD_API_PTR *PFNGLINDEXIPROC)(GLint c);
1647 typedef void (GLAD_API_PTR *PFNGLINDEXIVPROC)(const GLint * c);
1648 typedef void (GLAD_API_PTR *PFNGLINDEXSPROC)(GLshort c);
1649 typedef void (GLAD_API_PTR *PFNGLINDEXSVPROC)(const GLshort * c);
1650 typedef void (GLAD_API_PTR *PFNGLINDEXUBPROC)(GLubyte c);
1651 typedef void (GLAD_API_PTR *PFNGLINDEXUBVPROC)(const GLubyte * c);
1652 typedef void (GLAD_API_PTR *PFNGLINITNAMESPROC)(void);
1653 typedef void (GLAD_API_PTR *PFNGLINTERLEAVEDARRAYSPROC)(GLenum format, GLsizei stride, const void * pointer);
1654 typedef GLboolean (GLAD_API_PTR *PFNGLISBUFFERPROC)(GLuint buffer);
1655 typedef GLboolean (GLAD_API_PTR *PFNGLISENABLEDPROC)(GLenum cap);
1656 typedef GLboolean (GLAD_API_PTR *PFNGLISFRAMEBUFFERPROC)(GLuint framebuffer);
1657 typedef GLboolean (GLAD_API_PTR *PFNGLISFRAMEBUFFEREXTPROC)(GLuint framebuffer);
1658 typedef GLboolean (GLAD_API_PTR *PFNGLISLISTPROC)(GLuint list);
1659 typedef GLboolean (GLAD_API_PTR *PFNGLISPROGRAMPROC)(GLuint program);
1660 typedef GLboolean (GLAD_API_PTR *PFNGLISQUERYPROC)(GLuint id);
1661 typedef GLboolean (GLAD_API_PTR *PFNGLISRENDERBUFFERPROC)(GLuint renderbuffer);
1662 typedef GLboolean (GLAD_API_PTR *PFNGLISRENDERBUFFEREXTPROC)(GLuint renderbuffer);
1663 typedef GLboolean (GLAD_API_PTR *PFNGLISSHADERPROC)(GLuint shader);
1664 typedef GLboolean (GLAD_API_PTR *PFNGLISTEXTUREPROC)(GLuint texture);
1665 typedef void (GLAD_API_PTR *PFNGLLIGHTMODELFPROC)(GLenum pname, GLfloat param);
1666 typedef void (GLAD_API_PTR *PFNGLLIGHTMODELFVPROC)(GLenum pname, const GLfloat * params);
1667 typedef void (GLAD_API_PTR *PFNGLLIGHTMODELIPROC)(GLenum pname, GLint param);
1668 typedef void (GLAD_API_PTR *PFNGLLIGHTMODELIVPROC)(GLenum pname, const GLint * params);
1669 typedef void (GLAD_API_PTR *PFNGLLIGHTFPROC)(GLenum light, GLenum pname, GLfloat param);
1670 typedef void (GLAD_API_PTR *PFNGLLIGHTFVPROC)(GLenum light, GLenum pname, const GLfloat * params);
1671 typedef void (GLAD_API_PTR *PFNGLLIGHTIPROC)(GLenum light, GLenum pname, GLint param);
1672 typedef void (GLAD_API_PTR *PFNGLLIGHTIVPROC)(GLenum light, GLenum pname, const GLint * params);
1673 typedef void (GLAD_API_PTR *PFNGLLINESTIPPLEPROC)(GLint factor, GLushort pattern);
1674 typedef void (GLAD_API_PTR *PFNGLLINEWIDTHPROC)(GLfloat width);
1675 typedef void (GLAD_API_PTR *PFNGLLINKPROGRAMPROC)(GLuint program);
1676 typedef void (GLAD_API_PTR *PFNGLLISTBASEPROC)(GLuint base);
1677 typedef void (GLAD_API_PTR *PFNGLLOADIDENTITYPROC)(void);
1678 typedef void (GLAD_API_PTR *PFNGLLOADMATRIXDPROC)(const GLdouble * m);
1679 typedef void (GLAD_API_PTR *PFNGLLOADMATRIXFPROC)(const GLfloat * m);
1680 typedef void (GLAD_API_PTR *PFNGLLOADNAMEPROC)(GLuint name);
1681 typedef void (GLAD_API_PTR *PFNGLLOADTRANSPOSEMATRIXDPROC)(const GLdouble * m);
1682 typedef void (GLAD_API_PTR *PFNGLLOADTRANSPOSEMATRIXFPROC)(const GLfloat * m);
1683 typedef void (GLAD_API_PTR *PFNGLLOGICOPPROC)(GLenum opcode);
1684 typedef void (GLAD_API_PTR *PFNGLMAP1DPROC)(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble * points);
1685 typedef void (GLAD_API_PTR *PFNGLMAP1FPROC)(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat * points);
1686 typedef void (GLAD_API_PTR *PFNGLMAP2DPROC)(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble * points);
1687 typedef void (GLAD_API_PTR *PFNGLMAP2FPROC)(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat * points);
1688 typedef void * (GLAD_API_PTR *PFNGLMAPBUFFERPROC)(GLenum target, GLenum access);
1689 typedef void (GLAD_API_PTR *PFNGLMAPGRID1DPROC)(GLint un, GLdouble u1, GLdouble u2);
1690 typedef void (GLAD_API_PTR *PFNGLMAPGRID1FPROC)(GLint un, GLfloat u1, GLfloat u2);
1691 typedef void (GLAD_API_PTR *PFNGLMAPGRID2DPROC)(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2);
1692 typedef void (GLAD_API_PTR *PFNGLMAPGRID2FPROC)(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2);
1693 typedef void (GLAD_API_PTR *PFNGLMATERIALFPROC)(GLenum face, GLenum pname, GLfloat param);
1694 typedef void (GLAD_API_PTR *PFNGLMATERIALFVPROC)(GLenum face, GLenum pname, const GLfloat * params);
1695 typedef void (GLAD_API_PTR *PFNGLMATERIALIPROC)(GLenum face, GLenum pname, GLint param);
1696 typedef void (GLAD_API_PTR *PFNGLMATERIALIVPROC)(GLenum face, GLenum pname, const GLint * params);
1697 typedef void (GLAD_API_PTR *PFNGLMATRIXMODEPROC)(GLenum mode);
1698 typedef void (GLAD_API_PTR *PFNGLMULTMATRIXDPROC)(const GLdouble * m);
1699 typedef void (GLAD_API_PTR *PFNGLMULTMATRIXFPROC)(const GLfloat * m);
1700 typedef void (GLAD_API_PTR *PFNGLMULTTRANSPOSEMATRIXDPROC)(const GLdouble * m);
1701 typedef void (GLAD_API_PTR *PFNGLMULTTRANSPOSEMATRIXFPROC)(const GLfloat * m);
1702 typedef void (GLAD_API_PTR *PFNGLMULTIDRAWARRAYSPROC)(GLenum mode, const GLint * first, const GLsizei * count, GLsizei drawcount);
1703 typedef void (GLAD_API_PTR *PFNGLMULTIDRAWELEMENTSPROC)(GLenum mode, const GLsizei * count, GLenum type, const void *const* indices, GLsizei drawcount);
1704 typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD1DPROC)(GLenum target, GLdouble s);
1705 typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD1DVPROC)(GLenum target, const GLdouble * v);
1706 typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD1FPROC)(GLenum target, GLfloat s);
1707 typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD1FVPROC)(GLenum target, const GLfloat * v);
1708 typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD1IPROC)(GLenum target, GLint s);
1709 typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD1IVPROC)(GLenum target, const GLint * v);
1710 typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD1SPROC)(GLenum target, GLshort s);
1711 typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD1SVPROC)(GLenum target, const GLshort * v);
1712 typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD2DPROC)(GLenum target, GLdouble s, GLdouble t);
1713 typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD2DVPROC)(GLenum target, const GLdouble * v);
1714 typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD2FPROC)(GLenum target, GLfloat s, GLfloat t);
1715 typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD2FVPROC)(GLenum target, const GLfloat * v);
1716 typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD2IPROC)(GLenum target, GLint s, GLint t);
1717 typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD2IVPROC)(GLenum target, const GLint * v);
1718 typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD2SPROC)(GLenum target, GLshort s, GLshort t);
1719 typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD2SVPROC)(GLenum target, const GLshort * v);
1720 typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD3DPROC)(GLenum target, GLdouble s, GLdouble t, GLdouble r);
1721 typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD3DVPROC)(GLenum target, const GLdouble * v);
1722 typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD3FPROC)(GLenum target, GLfloat s, GLfloat t, GLfloat r);
1723 typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD3FVPROC)(GLenum target, const GLfloat * v);
1724 typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD3IPROC)(GLenum target, GLint s, GLint t, GLint r);
1725 typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD3IVPROC)(GLenum target, const GLint * v);
1726 typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD3SPROC)(GLenum target, GLshort s, GLshort t, GLshort r);
1727 typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD3SVPROC)(GLenum target, const GLshort * v);
1728 typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD4DPROC)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
1729 typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD4DVPROC)(GLenum target, const GLdouble * v);
1730 typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD4FPROC)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
1731 typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD4FVPROC)(GLenum target, const GLfloat * v);
1732 typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD4IPROC)(GLenum target, GLint s, GLint t, GLint r, GLint q);
1733 typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD4IVPROC)(GLenum target, const GLint * v);
1734 typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD4SPROC)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
1735 typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD4SVPROC)(GLenum target, const GLshort * v);
1736 typedef void (GLAD_API_PTR *PFNGLNEWLISTPROC)(GLuint list, GLenum mode);
1737 typedef void (GLAD_API_PTR *PFNGLNORMAL3BPROC)(GLbyte nx, GLbyte ny, GLbyte nz);
1738 typedef void (GLAD_API_PTR *PFNGLNORMAL3BVPROC)(const GLbyte * v);
1739 typedef void (GLAD_API_PTR *PFNGLNORMAL3DPROC)(GLdouble nx, GLdouble ny, GLdouble nz);
1740 typedef void (GLAD_API_PTR *PFNGLNORMAL3DVPROC)(const GLdouble * v);
1741 typedef void (GLAD_API_PTR *PFNGLNORMAL3FPROC)(GLfloat nx, GLfloat ny, GLfloat nz);
1742 typedef void (GLAD_API_PTR *PFNGLNORMAL3FVPROC)(const GLfloat * v);
1743 typedef void (GLAD_API_PTR *PFNGLNORMAL3IPROC)(GLint nx, GLint ny, GLint nz);
1744 typedef void (GLAD_API_PTR *PFNGLNORMAL3IVPROC)(const GLint * v);
1745 typedef void (GLAD_API_PTR *PFNGLNORMAL3SPROC)(GLshort nx, GLshort ny, GLshort nz);
1746 typedef void (GLAD_API_PTR *PFNGLNORMAL3SVPROC)(const GLshort * v);
1747 typedef void (GLAD_API_PTR *PFNGLNORMALPOINTERPROC)(GLenum type, GLsizei stride, const void * pointer);
1748 typedef void (GLAD_API_PTR *PFNGLORTHOPROC)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
1749 typedef void (GLAD_API_PTR *PFNGLPASSTHROUGHPROC)(GLfloat token);
1750 typedef void (GLAD_API_PTR *PFNGLPIXELMAPFVPROC)(GLenum map, GLsizei mapsize, const GLfloat * values);
1751 typedef void (GLAD_API_PTR *PFNGLPIXELMAPUIVPROC)(GLenum map, GLsizei mapsize, const GLuint * values);
1752 typedef void (GLAD_API_PTR *PFNGLPIXELMAPUSVPROC)(GLenum map, GLsizei mapsize, const GLushort * values);
1753 typedef void (GLAD_API_PTR *PFNGLPIXELSTOREFPROC)(GLenum pname, GLfloat param);
1754 typedef void (GLAD_API_PTR *PFNGLPIXELSTOREIPROC)(GLenum pname, GLint param);
1755 typedef void (GLAD_API_PTR *PFNGLPIXELTRANSFERFPROC)(GLenum pname, GLfloat param);
1756 typedef void (GLAD_API_PTR *PFNGLPIXELTRANSFERIPROC)(GLenum pname, GLint param);
1757 typedef void (GLAD_API_PTR *PFNGLPIXELZOOMPROC)(GLfloat xfactor, GLfloat yfactor);
1758 typedef void (GLAD_API_PTR *PFNGLPOINTPARAMETERFPROC)(GLenum pname, GLfloat param);
1759 typedef void (GLAD_API_PTR *PFNGLPOINTPARAMETERFVPROC)(GLenum pname, const GLfloat * params);
1760 typedef void (GLAD_API_PTR *PFNGLPOINTPARAMETERIPROC)(GLenum pname, GLint param);
1761 typedef void (GLAD_API_PTR *PFNGLPOINTPARAMETERIVPROC)(GLenum pname, const GLint * params);
1762 typedef void (GLAD_API_PTR *PFNGLPOINTSIZEPROC)(GLfloat size);
1763 typedef void (GLAD_API_PTR *PFNGLPOLYGONMODEPROC)(GLenum face, GLenum mode);
1764 typedef void (GLAD_API_PTR *PFNGLPOLYGONOFFSETPROC)(GLfloat factor, GLfloat units);
1765 typedef void (GLAD_API_PTR *PFNGLPOLYGONSTIPPLEPROC)(const GLubyte * mask);
1766 typedef void (GLAD_API_PTR *PFNGLPOPATTRIBPROC)(void);
1767 typedef void (GLAD_API_PTR *PFNGLPOPCLIENTATTRIBPROC)(void);
1768 typedef void (GLAD_API_PTR *PFNGLPOPMATRIXPROC)(void);
1769 typedef void (GLAD_API_PTR *PFNGLPOPNAMEPROC)(void);
1770 typedef void (GLAD_API_PTR *PFNGLPRIORITIZETEXTURESPROC)(GLsizei n, const GLuint * textures, const GLfloat * priorities);
1771 typedef void (GLAD_API_PTR *PFNGLPUSHATTRIBPROC)(GLbitfield mask);
1772 typedef void (GLAD_API_PTR *PFNGLPUSHCLIENTATTRIBPROC)(GLbitfield mask);
1773 typedef void (GLAD_API_PTR *PFNGLPUSHMATRIXPROC)(void);
1774 typedef void (GLAD_API_PTR *PFNGLPUSHNAMEPROC)(GLuint name);
1775 typedef void (GLAD_API_PTR *PFNGLRASTERPOS2DPROC)(GLdouble x, GLdouble y);
1776 typedef void (GLAD_API_PTR *PFNGLRASTERPOS2DVPROC)(const GLdouble * v);
1777 typedef void (GLAD_API_PTR *PFNGLRASTERPOS2FPROC)(GLfloat x, GLfloat y);
1778 typedef void (GLAD_API_PTR *PFNGLRASTERPOS2FVPROC)(const GLfloat * v);
1779 typedef void (GLAD_API_PTR *PFNGLRASTERPOS2IPROC)(GLint x, GLint y);
1780 typedef void (GLAD_API_PTR *PFNGLRASTERPOS2IVPROC)(const GLint * v);
1781 typedef void (GLAD_API_PTR *PFNGLRASTERPOS2SPROC)(GLshort x, GLshort y);
1782 typedef void (GLAD_API_PTR *PFNGLRASTERPOS2SVPROC)(const GLshort * v);
1783 typedef void (GLAD_API_PTR *PFNGLRASTERPOS3DPROC)(GLdouble x, GLdouble y, GLdouble z);
1784 typedef void (GLAD_API_PTR *PFNGLRASTERPOS3DVPROC)(const GLdouble * v);
1785 typedef void (GLAD_API_PTR *PFNGLRASTERPOS3FPROC)(GLfloat x, GLfloat y, GLfloat z);
1786 typedef void (GLAD_API_PTR *PFNGLRASTERPOS3FVPROC)(const GLfloat * v);
1787 typedef void (GLAD_API_PTR *PFNGLRASTERPOS3IPROC)(GLint x, GLint y, GLint z);
1788 typedef void (GLAD_API_PTR *PFNGLRASTERPOS3IVPROC)(const GLint * v);
1789 typedef void (GLAD_API_PTR *PFNGLRASTERPOS3SPROC)(GLshort x, GLshort y, GLshort z);
1790 typedef void (GLAD_API_PTR *PFNGLRASTERPOS3SVPROC)(const GLshort * v);
1791 typedef void (GLAD_API_PTR *PFNGLRASTERPOS4DPROC)(GLdouble x, GLdouble y, GLdouble z, GLdouble w);
1792 typedef void (GLAD_API_PTR *PFNGLRASTERPOS4DVPROC)(const GLdouble * v);
1793 typedef void (GLAD_API_PTR *PFNGLRASTERPOS4FPROC)(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
1794 typedef void (GLAD_API_PTR *PFNGLRASTERPOS4FVPROC)(const GLfloat * v);
1795 typedef void (GLAD_API_PTR *PFNGLRASTERPOS4IPROC)(GLint x, GLint y, GLint z, GLint w);
1796 typedef void (GLAD_API_PTR *PFNGLRASTERPOS4IVPROC)(const GLint * v);
1797 typedef void (GLAD_API_PTR *PFNGLRASTERPOS4SPROC)(GLshort x, GLshort y, GLshort z, GLshort w);
1798 typedef void (GLAD_API_PTR *PFNGLRASTERPOS4SVPROC)(const GLshort * v);
1799 typedef void (GLAD_API_PTR *PFNGLREADBUFFERPROC)(GLenum src);
1800 typedef void (GLAD_API_PTR *PFNGLREADPIXELSPROC)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void * pixels);
1801 typedef void (GLAD_API_PTR *PFNGLRECTDPROC)(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2);
1802 typedef void (GLAD_API_PTR *PFNGLRECTDVPROC)(const GLdouble * v1, const GLdouble * v2);
1803 typedef void (GLAD_API_PTR *PFNGLRECTFPROC)(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2);
1804 typedef void (GLAD_API_PTR *PFNGLRECTFVPROC)(const GLfloat * v1, const GLfloat * v2);
1805 typedef void (GLAD_API_PTR *PFNGLRECTIPROC)(GLint x1, GLint y1, GLint x2, GLint y2);
1806 typedef void (GLAD_API_PTR *PFNGLRECTIVPROC)(const GLint * v1, const GLint * v2);
1807 typedef void (GLAD_API_PTR *PFNGLRECTSPROC)(GLshort x1, GLshort y1, GLshort x2, GLshort y2);
1808 typedef void (GLAD_API_PTR *PFNGLRECTSVPROC)(const GLshort * v1, const GLshort * v2);
1809 typedef GLint (GLAD_API_PTR *PFNGLRENDERMODEPROC)(GLenum mode);
1810 typedef void (GLAD_API_PTR *PFNGLRENDERBUFFERSTORAGEPROC)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
1811 typedef void (GLAD_API_PTR *PFNGLRENDERBUFFERSTORAGEEXTPROC)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
1812 typedef void (GLAD_API_PTR *PFNGLROTATEDPROC)(GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
1813 typedef void (GLAD_API_PTR *PFNGLROTATEFPROC)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
1814 typedef void (GLAD_API_PTR *PFNGLSAMPLECOVERAGEPROC)(GLfloat value, GLboolean invert);
1815 typedef void (GLAD_API_PTR *PFNGLSCALEDPROC)(GLdouble x, GLdouble y, GLdouble z);
1816 typedef void (GLAD_API_PTR *PFNGLSCALEFPROC)(GLfloat x, GLfloat y, GLfloat z);
1817 typedef void (GLAD_API_PTR *PFNGLSCISSORPROC)(GLint x, GLint y, GLsizei width, GLsizei height);
1818 typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3BPROC)(GLbyte red, GLbyte green, GLbyte blue);
1819 typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3BVPROC)(const GLbyte * v);
1820 typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3DPROC)(GLdouble red, GLdouble green, GLdouble blue);
1821 typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3DVPROC)(const GLdouble * v);
1822 typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3FPROC)(GLfloat red, GLfloat green, GLfloat blue);
1823 typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3FVPROC)(const GLfloat * v);
1824 typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3IPROC)(GLint red, GLint green, GLint blue);
1825 typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3IVPROC)(const GLint * v);
1826 typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3SPROC)(GLshort red, GLshort green, GLshort blue);
1827 typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3SVPROC)(const GLshort * v);
1828 typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3UBPROC)(GLubyte red, GLubyte green, GLubyte blue);
1829 typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3UBVPROC)(const GLubyte * v);
1830 typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3UIPROC)(GLuint red, GLuint green, GLuint blue);
1831 typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3UIVPROC)(const GLuint * v);
1832 typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3USPROC)(GLushort red, GLushort green, GLushort blue);
1833 typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3USVPROC)(const GLushort * v);
1834 typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLORPOINTERPROC)(GLint size, GLenum type, GLsizei stride, const void * pointer);
1835 typedef void (GLAD_API_PTR *PFNGLSELECTBUFFERPROC)(GLsizei size, GLuint * buffer);
1836 typedef void (GLAD_API_PTR *PFNGLSHADEMODELPROC)(GLenum mode);
1837 typedef void (GLAD_API_PTR *PFNGLSHADERSOURCEPROC)(GLuint shader, GLsizei count, const GLchar *const* string, const GLint * length);
1838 typedef void (GLAD_API_PTR *PFNGLSTENCILFUNCPROC)(GLenum func, GLint ref, GLuint mask);
1839 typedef void (GLAD_API_PTR *PFNGLSTENCILFUNCSEPARATEPROC)(GLenum face, GLenum func, GLint ref, GLuint mask);
1840 typedef void (GLAD_API_PTR *PFNGLSTENCILMASKPROC)(GLuint mask);
1841 typedef void (GLAD_API_PTR *PFNGLSTENCILMASKSEPARATEPROC)(GLenum face, GLuint mask);
1842 typedef void (GLAD_API_PTR *PFNGLSTENCILOPPROC)(GLenum fail, GLenum zfail, GLenum zpass);
1843 typedef void (GLAD_API_PTR *PFNGLSTENCILOPSEPARATEPROC)(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
1844 typedef void (GLAD_API_PTR *PFNGLTEXCOORD1DPROC)(GLdouble s);
1845 typedef void (GLAD_API_PTR *PFNGLTEXCOORD1DVPROC)(const GLdouble * v);
1846 typedef void (GLAD_API_PTR *PFNGLTEXCOORD1FPROC)(GLfloat s);
1847 typedef void (GLAD_API_PTR *PFNGLTEXCOORD1FVPROC)(const GLfloat * v);
1848 typedef void (GLAD_API_PTR *PFNGLTEXCOORD1IPROC)(GLint s);
1849 typedef void (GLAD_API_PTR *PFNGLTEXCOORD1IVPROC)(const GLint * v);
1850 typedef void (GLAD_API_PTR *PFNGLTEXCOORD1SPROC)(GLshort s);
1851 typedef void (GLAD_API_PTR *PFNGLTEXCOORD1SVPROC)(const GLshort * v);
1852 typedef void (GLAD_API_PTR *PFNGLTEXCOORD2DPROC)(GLdouble s, GLdouble t);
1853 typedef void (GLAD_API_PTR *PFNGLTEXCOORD2DVPROC)(const GLdouble * v);
1854 typedef void (GLAD_API_PTR *PFNGLTEXCOORD2FPROC)(GLfloat s, GLfloat t);
1855 typedef void (GLAD_API_PTR *PFNGLTEXCOORD2FVPROC)(const GLfloat * v);
1856 typedef void (GLAD_API_PTR *PFNGLTEXCOORD2IPROC)(GLint s, GLint t);
1857 typedef void (GLAD_API_PTR *PFNGLTEXCOORD2IVPROC)(const GLint * v);
1858 typedef void (GLAD_API_PTR *PFNGLTEXCOORD2SPROC)(GLshort s, GLshort t);
1859 typedef void (GLAD_API_PTR *PFNGLTEXCOORD2SVPROC)(const GLshort * v);
1860 typedef void (GLAD_API_PTR *PFNGLTEXCOORD3DPROC)(GLdouble s, GLdouble t, GLdouble r);
1861 typedef void (GLAD_API_PTR *PFNGLTEXCOORD3DVPROC)(const GLdouble * v);
1862 typedef void (GLAD_API_PTR *PFNGLTEXCOORD3FPROC)(GLfloat s, GLfloat t, GLfloat r);
1863 typedef void (GLAD_API_PTR *PFNGLTEXCOORD3FVPROC)(const GLfloat * v);
1864 typedef void (GLAD_API_PTR *PFNGLTEXCOORD3IPROC)(GLint s, GLint t, GLint r);
1865 typedef void (GLAD_API_PTR *PFNGLTEXCOORD3IVPROC)(const GLint * v);
1866 typedef void (GLAD_API_PTR *PFNGLTEXCOORD3SPROC)(GLshort s, GLshort t, GLshort r);
1867 typedef void (GLAD_API_PTR *PFNGLTEXCOORD3SVPROC)(const GLshort * v);
1868 typedef void (GLAD_API_PTR *PFNGLTEXCOORD4DPROC)(GLdouble s, GLdouble t, GLdouble r, GLdouble q);
1869 typedef void (GLAD_API_PTR *PFNGLTEXCOORD4DVPROC)(const GLdouble * v);
1870 typedef void (GLAD_API_PTR *PFNGLTEXCOORD4FPROC)(GLfloat s, GLfloat t, GLfloat r, GLfloat q);
1871 typedef void (GLAD_API_PTR *PFNGLTEXCOORD4FVPROC)(const GLfloat * v);
1872 typedef void (GLAD_API_PTR *PFNGLTEXCOORD4IPROC)(GLint s, GLint t, GLint r, GLint q);
1873 typedef void (GLAD_API_PTR *PFNGLTEXCOORD4IVPROC)(const GLint * v);
1874 typedef void (GLAD_API_PTR *PFNGLTEXCOORD4SPROC)(GLshort s, GLshort t, GLshort r, GLshort q);
1875 typedef void (GLAD_API_PTR *PFNGLTEXCOORD4SVPROC)(const GLshort * v);
1876 typedef void (GLAD_API_PTR *PFNGLTEXCOORDPOINTERPROC)(GLint size, GLenum type, GLsizei stride, const void * pointer);
1877 typedef void (GLAD_API_PTR *PFNGLTEXENVFPROC)(GLenum target, GLenum pname, GLfloat param);
1878 typedef void (GLAD_API_PTR *PFNGLTEXENVFVPROC)(GLenum target, GLenum pname, const GLfloat * params);
1879 typedef void (GLAD_API_PTR *PFNGLTEXENVIPROC)(GLenum target, GLenum pname, GLint param);
1880 typedef void (GLAD_API_PTR *PFNGLTEXENVIVPROC)(GLenum target, GLenum pname, const GLint * params);
1881 typedef void (GLAD_API_PTR *PFNGLTEXGENDPROC)(GLenum coord, GLenum pname, GLdouble param);
1882 typedef void (GLAD_API_PTR *PFNGLTEXGENDVPROC)(GLenum coord, GLenum pname, const GLdouble * params);
1883 typedef void (GLAD_API_PTR *PFNGLTEXGENFPROC)(GLenum coord, GLenum pname, GLfloat param);
1884 typedef void (GLAD_API_PTR *PFNGLTEXGENFVPROC)(GLenum coord, GLenum pname, const GLfloat * params);
1885 typedef void (GLAD_API_PTR *PFNGLTEXGENIPROC)(GLenum coord, GLenum pname, GLint param);
1886 typedef void (GLAD_API_PTR *PFNGLTEXGENIVPROC)(GLenum coord, GLenum pname, const GLint * params);
1887 typedef void (GLAD_API_PTR *PFNGLTEXIMAGE1DPROC)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void * pixels);
1888 typedef void (GLAD_API_PTR *PFNGLTEXIMAGE2DPROC)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void * pixels);
1889 typedef void (GLAD_API_PTR *PFNGLTEXIMAGE3DPROC)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void * pixels);
1890 typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERFPROC)(GLenum target, GLenum pname, GLfloat param);
1891 typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERFVPROC)(GLenum target, GLenum pname, const GLfloat * params);
1892 typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERIPROC)(GLenum target, GLenum pname, GLint param);
1893 typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERIVPROC)(GLenum target, GLenum pname, const GLint * params);
1894 typedef void (GLAD_API_PTR *PFNGLTEXSUBIMAGE1DPROC)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void * pixels);
1895 typedef void (GLAD_API_PTR *PFNGLTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void * pixels);
1896 typedef void (GLAD_API_PTR *PFNGLTEXSUBIMAGE3DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void * pixels);
1897 typedef void (GLAD_API_PTR *PFNGLTRANSLATEDPROC)(GLdouble x, GLdouble y, GLdouble z);
1898 typedef void (GLAD_API_PTR *PFNGLTRANSLATEFPROC)(GLfloat x, GLfloat y, GLfloat z);
1899 typedef void (GLAD_API_PTR *PFNGLUNIFORM1FPROC)(GLint location, GLfloat v0);
1900 typedef void (GLAD_API_PTR *PFNGLUNIFORM1FVPROC)(GLint location, GLsizei count, const GLfloat * value);
1901 typedef void (GLAD_API_PTR *PFNGLUNIFORM1IPROC)(GLint location, GLint v0);
1902 typedef void (GLAD_API_PTR *PFNGLUNIFORM1IVPROC)(GLint location, GLsizei count, const GLint * value);
1903 typedef void (GLAD_API_PTR *PFNGLUNIFORM2FPROC)(GLint location, GLfloat v0, GLfloat v1);
1904 typedef void (GLAD_API_PTR *PFNGLUNIFORM2FVPROC)(GLint location, GLsizei count, const GLfloat * value);
1905 typedef void (GLAD_API_PTR *PFNGLUNIFORM2IPROC)(GLint location, GLint v0, GLint v1);
1906 typedef void (GLAD_API_PTR *PFNGLUNIFORM2IVPROC)(GLint location, GLsizei count, const GLint * value);
1907 typedef void (GLAD_API_PTR *PFNGLUNIFORM3FPROC)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
1908 typedef void (GLAD_API_PTR *PFNGLUNIFORM3FVPROC)(GLint location, GLsizei count, const GLfloat * value);
1909 typedef void (GLAD_API_PTR *PFNGLUNIFORM3IPROC)(GLint location, GLint v0, GLint v1, GLint v2);
1910 typedef void (GLAD_API_PTR *PFNGLUNIFORM3IVPROC)(GLint location, GLsizei count, const GLint * value);
1911 typedef void (GLAD_API_PTR *PFNGLUNIFORM4FPROC)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
1912 typedef void (GLAD_API_PTR *PFNGLUNIFORM4FVPROC)(GLint location, GLsizei count, const GLfloat * value);
1913 typedef void (GLAD_API_PTR *PFNGLUNIFORM4IPROC)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
1914 typedef void (GLAD_API_PTR *PFNGLUNIFORM4IVPROC)(GLint location, GLsizei count, const GLint * value);
1915 typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX2FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
1916 typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX3FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
1917 typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX4FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
1918 typedef GLboolean (GLAD_API_PTR *PFNGLUNMAPBUFFERPROC)(GLenum target);
1919 typedef void (GLAD_API_PTR *PFNGLUSEPROGRAMPROC)(GLuint program);
1920 typedef void (GLAD_API_PTR *PFNGLVALIDATEPROGRAMPROC)(GLuint program);
1921 typedef void (GLAD_API_PTR *PFNGLVERTEX2DPROC)(GLdouble x, GLdouble y);
1922 typedef void (GLAD_API_PTR *PFNGLVERTEX2DVPROC)(const GLdouble * v);
1923 typedef void (GLAD_API_PTR *PFNGLVERTEX2FPROC)(GLfloat x, GLfloat y);
1924 typedef void (GLAD_API_PTR *PFNGLVERTEX2FVPROC)(const GLfloat * v);
1925 typedef void (GLAD_API_PTR *PFNGLVERTEX2IPROC)(GLint x, GLint y);
1926 typedef void (GLAD_API_PTR *PFNGLVERTEX2IVPROC)(const GLint * v);
1927 typedef void (GLAD_API_PTR *PFNGLVERTEX2SPROC)(GLshort x, GLshort y);
1928 typedef void (GLAD_API_PTR *PFNGLVERTEX2SVPROC)(const GLshort * v);
1929 typedef void (GLAD_API_PTR *PFNGLVERTEX3DPROC)(GLdouble x, GLdouble y, GLdouble z);
1930 typedef void (GLAD_API_PTR *PFNGLVERTEX3DVPROC)(const GLdouble * v);
1931 typedef void (GLAD_API_PTR *PFNGLVERTEX3FPROC)(GLfloat x, GLfloat y, GLfloat z);
1932 typedef void (GLAD_API_PTR *PFNGLVERTEX3FVPROC)(const GLfloat * v);
1933 typedef void (GLAD_API_PTR *PFNGLVERTEX3IPROC)(GLint x, GLint y, GLint z);
1934 typedef void (GLAD_API_PTR *PFNGLVERTEX3IVPROC)(const GLint * v);
1935 typedef void (GLAD_API_PTR *PFNGLVERTEX3SPROC)(GLshort x, GLshort y, GLshort z);
1936 typedef void (GLAD_API_PTR *PFNGLVERTEX3SVPROC)(const GLshort * v);
1937 typedef void (GLAD_API_PTR *PFNGLVERTEX4DPROC)(GLdouble x, GLdouble y, GLdouble z, GLdouble w);
1938 typedef void (GLAD_API_PTR *PFNGLVERTEX4DVPROC)(const GLdouble * v);
1939 typedef void (GLAD_API_PTR *PFNGLVERTEX4FPROC)(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
1940 typedef void (GLAD_API_PTR *PFNGLVERTEX4FVPROC)(const GLfloat * v);
1941 typedef void (GLAD_API_PTR *PFNGLVERTEX4IPROC)(GLint x, GLint y, GLint z, GLint w);
1942 typedef void (GLAD_API_PTR *PFNGLVERTEX4IVPROC)(const GLint * v);
1943 typedef void (GLAD_API_PTR *PFNGLVERTEX4SPROC)(GLshort x, GLshort y, GLshort z, GLshort w);
1944 typedef void (GLAD_API_PTR *PFNGLVERTEX4SVPROC)(const GLshort * v);
1945 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB1DPROC)(GLuint index, GLdouble x);
1946 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB1DVPROC)(GLuint index, const GLdouble * v);
1947 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB1FPROC)(GLuint index, GLfloat x);
1948 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB1FVPROC)(GLuint index, const GLfloat * v);
1949 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB1SPROC)(GLuint index, GLshort x);
1950 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB1SVPROC)(GLuint index, const GLshort * v);
1951 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB2DPROC)(GLuint index, GLdouble x, GLdouble y);
1952 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB2DVPROC)(GLuint index, const GLdouble * v);
1953 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB2FPROC)(GLuint index, GLfloat x, GLfloat y);
1954 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB2FVPROC)(GLuint index, const GLfloat * v);
1955 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB2SPROC)(GLuint index, GLshort x, GLshort y);
1956 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB2SVPROC)(GLuint index, const GLshort * v);
1957 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB3DPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z);
1958 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB3DVPROC)(GLuint index, const GLdouble * v);
1959 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB3FPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z);
1960 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB3FVPROC)(GLuint index, const GLfloat * v);
1961 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB3SPROC)(GLuint index, GLshort x, GLshort y, GLshort z);
1962 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB3SVPROC)(GLuint index, const GLshort * v);
1963 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4NBVPROC)(GLuint index, const GLbyte * v);
1964 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4NIVPROC)(GLuint index, const GLint * v);
1965 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4NSVPROC)(GLuint index, const GLshort * v);
1966 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4NUBPROC)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
1967 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4NUBVPROC)(GLuint index, const GLubyte * v);
1968 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4NUIVPROC)(GLuint index, const GLuint * v);
1969 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4NUSVPROC)(GLuint index, const GLushort * v);
1970 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4BVPROC)(GLuint index, const GLbyte * v);
1971 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4DPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
1972 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4DVPROC)(GLuint index, const GLdouble * v);
1973 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4FPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
1974 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4FVPROC)(GLuint index, const GLfloat * v);
1975 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4IVPROC)(GLuint index, const GLint * v);
1976 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4SPROC)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
1977 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4SVPROC)(GLuint index, const GLshort * v);
1978 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4UBVPROC)(GLuint index, const GLubyte * v);
1979 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4UIVPROC)(GLuint index, const GLuint * v);
1980 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4USVPROC)(GLuint index, const GLushort * v);
1981 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBPOINTERPROC)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void * pointer);
1982 typedef void (GLAD_API_PTR *PFNGLVERTEXPOINTERPROC)(GLint size, GLenum type, GLsizei stride, const void * pointer);
1983 typedef void (GLAD_API_PTR *PFNGLVIEWPORTPROC)(GLint x, GLint y, GLsizei width, GLsizei height);
1984 typedef void (GLAD_API_PTR *PFNGLWINDOWPOS2DPROC)(GLdouble x, GLdouble y);
1985 typedef void (GLAD_API_PTR *PFNGLWINDOWPOS2DVPROC)(const GLdouble * v);
1986 typedef void (GLAD_API_PTR *PFNGLWINDOWPOS2FPROC)(GLfloat x, GLfloat y);
1987 typedef void (GLAD_API_PTR *PFNGLWINDOWPOS2FVPROC)(const GLfloat * v);
1988 typedef void (GLAD_API_PTR *PFNGLWINDOWPOS2IPROC)(GLint x, GLint y);
1989 typedef void (GLAD_API_PTR *PFNGLWINDOWPOS2IVPROC)(const GLint * v);
1990 typedef void (GLAD_API_PTR *PFNGLWINDOWPOS2SPROC)(GLshort x, GLshort y);
1991 typedef void (GLAD_API_PTR *PFNGLWINDOWPOS2SVPROC)(const GLshort * v);
1992 typedef void (GLAD_API_PTR *PFNGLWINDOWPOS3DPROC)(GLdouble x, GLdouble y, GLdouble z);
1993 typedef void (GLAD_API_PTR *PFNGLWINDOWPOS3DVPROC)(const GLdouble * v);
1994 typedef void (GLAD_API_PTR *PFNGLWINDOWPOS3FPROC)(GLfloat x, GLfloat y, GLfloat z);
1995 typedef void (GLAD_API_PTR *PFNGLWINDOWPOS3FVPROC)(const GLfloat * v);
1996 typedef void (GLAD_API_PTR *PFNGLWINDOWPOS3IPROC)(GLint x, GLint y, GLint z);
1997 typedef void (GLAD_API_PTR *PFNGLWINDOWPOS3IVPROC)(const GLint * v);
1998 typedef void (GLAD_API_PTR *PFNGLWINDOWPOS3SPROC)(GLshort x, GLshort y, GLshort z);
1999 typedef void (GLAD_API_PTR *PFNGLWINDOWPOS3SVPROC)(const GLshort * v);
2000
2001 GLAD_API_CALL PFNGLACCUMPROC glad_glAccum;
2002 #define glAccum glad_glAccum
2003 GLAD_API_CALL PFNGLACTIVETEXTUREPROC glad_glActiveTexture;
2004 #define glActiveTexture glad_glActiveTexture
2005 GLAD_API_CALL PFNGLALPHAFUNCPROC glad_glAlphaFunc;
2006 #define glAlphaFunc glad_glAlphaFunc
2007 GLAD_API_CALL PFNGLARETEXTURESRESIDENTPROC glad_glAreTexturesResident;
2008 #define glAreTexturesResident glad_glAreTexturesResident
2009 GLAD_API_CALL PFNGLARRAYELEMENTPROC glad_glArrayElement;
2010 #define glArrayElement glad_glArrayElement
2011 GLAD_API_CALL PFNGLATTACHSHADERPROC glad_glAttachShader;
2012 #define glAttachShader glad_glAttachShader
2013 GLAD_API_CALL PFNGLBEGINPROC glad_glBegin;
2014 #define glBegin glad_glBegin
2015 GLAD_API_CALL PFNGLBEGINQUERYPROC glad_glBeginQuery;
2016 #define glBeginQuery glad_glBeginQuery
2017 GLAD_API_CALL PFNGLBINDATTRIBLOCATIONPROC glad_glBindAttribLocation;
2018 #define glBindAttribLocation glad_glBindAttribLocation
2019 GLAD_API_CALL PFNGLBINDBUFFERPROC glad_glBindBuffer;
2020 #define glBindBuffer glad_glBindBuffer
2021 GLAD_API_CALL PFNGLBINDFRAMEBUFFEREXTPROC glad_glBindFramebufferEXT;
2022 #define glBindFramebufferEXT glad_glBindFramebufferEXT
2023 GLAD_API_CALL PFNGLBINDRENDERBUFFEREXTPROC glad_glBindRenderbufferEXT;
2024 #define glBindRenderbufferEXT glad_glBindRenderbufferEXT
2025 GLAD_API_CALL PFNGLBINDTEXTUREPROC glad_glBindTexture;
2026 #define glBindTexture glad_glBindTexture
2027 GLAD_API_CALL PFNGLBITMAPPROC glad_glBitmap;
2028 #define glBitmap glad_glBitmap
2029 GLAD_API_CALL PFNGLBLENDCOLORPROC glad_glBlendColor;
2030 #define glBlendColor glad_glBlendColor
2031 GLAD_API_CALL PFNGLBLENDEQUATIONPROC glad_glBlendEquation;
2032 #define glBlendEquation glad_glBlendEquation
2033 GLAD_API_CALL PFNGLBLENDEQUATIONSEPARATEPROC glad_glBlendEquationSeparate;
2034 #define glBlendEquationSeparate glad_glBlendEquationSeparate
2035 GLAD_API_CALL PFNGLBLENDFUNCPROC glad_glBlendFunc;
2036 #define glBlendFunc glad_glBlendFunc
2037 GLAD_API_CALL PFNGLBLENDFUNCSEPARATEPROC glad_glBlendFuncSeparate;
2038 #define glBlendFuncSeparate glad_glBlendFuncSeparate
2039 GLAD_API_CALL PFNGLBUFFERDATAPROC glad_glBufferData;
2040 #define glBufferData glad_glBufferData
2041 GLAD_API_CALL PFNGLBUFFERSUBDATAPROC glad_glBufferSubData;
2042 #define glBufferSubData glad_glBufferSubData
2043 GLAD_API_CALL PFNGLCALLLISTPROC glad_glCallList;
2044 #define glCallList glad_glCallList
2045 GLAD_API_CALL PFNGLCALLLISTSPROC glad_glCallLists;
2046 #define glCallLists glad_glCallLists
2047 GLAD_API_CALL PFNGLCHECKFRAMEBUFFERSTATUSPROC glad_glCheckFramebufferStatus;
2048 #define glCheckFramebufferStatus glad_glCheckFramebufferStatus
2049 GLAD_API_CALL PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC glad_glCheckFramebufferStatusEXT;
2050 #define glCheckFramebufferStatusEXT glad_glCheckFramebufferStatusEXT
2051 GLAD_API_CALL PFNGLCLEARPROC glad_glClear;
2052 #define glClear glad_glClear
2053 GLAD_API_CALL PFNGLCLEARACCUMPROC glad_glClearAccum;
2054 #define glClearAccum glad_glClearAccum
2055 GLAD_API_CALL PFNGLCLEARCOLORPROC glad_glClearColor;
2056 #define glClearColor glad_glClearColor
2057 GLAD_API_CALL PFNGLCLEARDEPTHPROC glad_glClearDepth;
2058 #define glClearDepth glad_glClearDepth
2059 GLAD_API_CALL PFNGLCLEARINDEXPROC glad_glClearIndex;
2060 #define glClearIndex glad_glClearIndex
2061 GLAD_API_CALL PFNGLCLEARSTENCILPROC glad_glClearStencil;
2062 #define glClearStencil glad_glClearStencil
2063 GLAD_API_CALL PFNGLCLIENTACTIVETEXTUREPROC glad_glClientActiveTexture;
2064 #define glClientActiveTexture glad_glClientActiveTexture
2065 GLAD_API_CALL PFNGLCLIPPLANEPROC glad_glClipPlane;
2066 #define glClipPlane glad_glClipPlane
2067 GLAD_API_CALL PFNGLCOLOR3BPROC glad_glColor3b;
2068 #define glColor3b glad_glColor3b
2069 GLAD_API_CALL PFNGLCOLOR3BVPROC glad_glColor3bv;
2070 #define glColor3bv glad_glColor3bv
2071 GLAD_API_CALL PFNGLCOLOR3DPROC glad_glColor3d;
2072 #define glColor3d glad_glColor3d
2073 GLAD_API_CALL PFNGLCOLOR3DVPROC glad_glColor3dv;
2074 #define glColor3dv glad_glColor3dv
2075 GLAD_API_CALL PFNGLCOLOR3FPROC glad_glColor3f;
2076 #define glColor3f glad_glColor3f
2077 GLAD_API_CALL PFNGLCOLOR3FVPROC glad_glColor3fv;
2078 #define glColor3fv glad_glColor3fv
2079 GLAD_API_CALL PFNGLCOLOR3IPROC glad_glColor3i;
2080 #define glColor3i glad_glColor3i
2081 GLAD_API_CALL PFNGLCOLOR3IVPROC glad_glColor3iv;
2082 #define glColor3iv glad_glColor3iv
2083 GLAD_API_CALL PFNGLCOLOR3SPROC glad_glColor3s;
2084 #define glColor3s glad_glColor3s
2085 GLAD_API_CALL PFNGLCOLOR3SVPROC glad_glColor3sv;
2086 #define glColor3sv glad_glColor3sv
2087 GLAD_API_CALL PFNGLCOLOR3UBPROC glad_glColor3ub;
2088 #define glColor3ub glad_glColor3ub
2089 GLAD_API_CALL PFNGLCOLOR3UBVPROC glad_glColor3ubv;
2090 #define glColor3ubv glad_glColor3ubv
2091 GLAD_API_CALL PFNGLCOLOR3UIPROC glad_glColor3ui;
2092 #define glColor3ui glad_glColor3ui
2093 GLAD_API_CALL PFNGLCOLOR3UIVPROC glad_glColor3uiv;
2094 #define glColor3uiv glad_glColor3uiv
2095 GLAD_API_CALL PFNGLCOLOR3USPROC glad_glColor3us;
2096 #define glColor3us glad_glColor3us
2097 GLAD_API_CALL PFNGLCOLOR3USVPROC glad_glColor3usv;
2098 #define glColor3usv glad_glColor3usv
2099 GLAD_API_CALL PFNGLCOLOR4BPROC glad_glColor4b;
2100 #define glColor4b glad_glColor4b
2101 GLAD_API_CALL PFNGLCOLOR4BVPROC glad_glColor4bv;
2102 #define glColor4bv glad_glColor4bv
2103 GLAD_API_CALL PFNGLCOLOR4DPROC glad_glColor4d;
2104 #define glColor4d glad_glColor4d
2105 GLAD_API_CALL PFNGLCOLOR4DVPROC glad_glColor4dv;
2106 #define glColor4dv glad_glColor4dv
2107 GLAD_API_CALL PFNGLCOLOR4FPROC glad_glColor4f;
2108 #define glColor4f glad_glColor4f
2109 GLAD_API_CALL PFNGLCOLOR4FVPROC glad_glColor4fv;
2110 #define glColor4fv glad_glColor4fv
2111 GLAD_API_CALL PFNGLCOLOR4IPROC glad_glColor4i;
2112 #define glColor4i glad_glColor4i
2113 GLAD_API_CALL PFNGLCOLOR4IVPROC glad_glColor4iv;
2114 #define glColor4iv glad_glColor4iv
2115 GLAD_API_CALL PFNGLCOLOR4SPROC glad_glColor4s;
2116 #define glColor4s glad_glColor4s
2117 GLAD_API_CALL PFNGLCOLOR4SVPROC glad_glColor4sv;
2118 #define glColor4sv glad_glColor4sv
2119 GLAD_API_CALL PFNGLCOLOR4UBPROC glad_glColor4ub;
2120 #define glColor4ub glad_glColor4ub
2121 GLAD_API_CALL PFNGLCOLOR4UBVPROC glad_glColor4ubv;
2122 #define glColor4ubv glad_glColor4ubv
2123 GLAD_API_CALL PFNGLCOLOR4UIPROC glad_glColor4ui;
2124 #define glColor4ui glad_glColor4ui
2125 GLAD_API_CALL PFNGLCOLOR4UIVPROC glad_glColor4uiv;
2126 #define glColor4uiv glad_glColor4uiv
2127 GLAD_API_CALL PFNGLCOLOR4USPROC glad_glColor4us;
2128 #define glColor4us glad_glColor4us
2129 GLAD_API_CALL PFNGLCOLOR4USVPROC glad_glColor4usv;
2130 #define glColor4usv glad_glColor4usv
2131 GLAD_API_CALL PFNGLCOLORMASKPROC glad_glColorMask;
2132 #define glColorMask glad_glColorMask
2133 GLAD_API_CALL PFNGLCOLORMATERIALPROC glad_glColorMaterial;
2134 #define glColorMaterial glad_glColorMaterial
2135 GLAD_API_CALL PFNGLCOLORPOINTERPROC glad_glColorPointer;
2136 #define glColorPointer glad_glColorPointer
2137 GLAD_API_CALL PFNGLCOMPILESHADERPROC glad_glCompileShader;
2138 #define glCompileShader glad_glCompileShader
2139 GLAD_API_CALL PFNGLCOMPRESSEDTEXIMAGE1DPROC glad_glCompressedTexImage1D;
2140 #define glCompressedTexImage1D glad_glCompressedTexImage1D
2141 GLAD_API_CALL PFNGLCOMPRESSEDTEXIMAGE2DPROC glad_glCompressedTexImage2D;
2142 #define glCompressedTexImage2D glad_glCompressedTexImage2D
2143 GLAD_API_CALL PFNGLCOMPRESSEDTEXIMAGE3DPROC glad_glCompressedTexImage3D;
2144 #define glCompressedTexImage3D glad_glCompressedTexImage3D
2145 GLAD_API_CALL PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC glad_glCompressedTexSubImage1D;
2146 #define glCompressedTexSubImage1D glad_glCompressedTexSubImage1D
2147 GLAD_API_CALL PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glad_glCompressedTexSubImage2D;
2148 #define glCompressedTexSubImage2D glad_glCompressedTexSubImage2D
2149 GLAD_API_CALL PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glad_glCompressedTexSubImage3D;
2150 #define glCompressedTexSubImage3D glad_glCompressedTexSubImage3D
2151 GLAD_API_CALL PFNGLCOPYPIXELSPROC glad_glCopyPixels;
2152 #define glCopyPixels glad_glCopyPixels
2153 GLAD_API_CALL PFNGLCOPYTEXIMAGE1DPROC glad_glCopyTexImage1D;
2154 #define glCopyTexImage1D glad_glCopyTexImage1D
2155 GLAD_API_CALL PFNGLCOPYTEXIMAGE2DPROC glad_glCopyTexImage2D;
2156 #define glCopyTexImage2D glad_glCopyTexImage2D
2157 GLAD_API_CALL PFNGLCOPYTEXSUBIMAGE1DPROC glad_glCopyTexSubImage1D;
2158 #define glCopyTexSubImage1D glad_glCopyTexSubImage1D
2159 GLAD_API_CALL PFNGLCOPYTEXSUBIMAGE2DPROC glad_glCopyTexSubImage2D;
2160 #define glCopyTexSubImage2D glad_glCopyTexSubImage2D
2161 GLAD_API_CALL PFNGLCOPYTEXSUBIMAGE3DPROC glad_glCopyTexSubImage3D;
2162 #define glCopyTexSubImage3D glad_glCopyTexSubImage3D
2163 GLAD_API_CALL PFNGLCREATEPROGRAMPROC glad_glCreateProgram;
2164 #define glCreateProgram glad_glCreateProgram
2165 GLAD_API_CALL PFNGLCREATESHADERPROC glad_glCreateShader;
2166 #define glCreateShader glad_glCreateShader
2167 GLAD_API_CALL PFNGLCULLFACEPROC glad_glCullFace;
2168 #define glCullFace glad_glCullFace
2169 GLAD_API_CALL PFNGLDELETEBUFFERSPROC glad_glDeleteBuffers;
2170 #define glDeleteBuffers glad_glDeleteBuffers
2171 GLAD_API_CALL PFNGLDELETEFRAMEBUFFERSPROC glad_glDeleteFramebuffers;
2172 #define glDeleteFramebuffers glad_glDeleteFramebuffers
2173 GLAD_API_CALL PFNGLDELETEFRAMEBUFFERSEXTPROC glad_glDeleteFramebuffersEXT;
2174 #define glDeleteFramebuffersEXT glad_glDeleteFramebuffersEXT
2175 GLAD_API_CALL PFNGLDELETELISTSPROC glad_glDeleteLists;
2176 #define glDeleteLists glad_glDeleteLists
2177 GLAD_API_CALL PFNGLDELETEPROGRAMPROC glad_glDeleteProgram;
2178 #define glDeleteProgram glad_glDeleteProgram
2179 GLAD_API_CALL PFNGLDELETEQUERIESPROC glad_glDeleteQueries;
2180 #define glDeleteQueries glad_glDeleteQueries
2181 GLAD_API_CALL PFNGLDELETERENDERBUFFERSPROC glad_glDeleteRenderbuffers;
2182 #define glDeleteRenderbuffers glad_glDeleteRenderbuffers
2183 GLAD_API_CALL PFNGLDELETERENDERBUFFERSEXTPROC glad_glDeleteRenderbuffersEXT;
2184 #define glDeleteRenderbuffersEXT glad_glDeleteRenderbuffersEXT
2185 GLAD_API_CALL PFNGLDELETESHADERPROC glad_glDeleteShader;
2186 #define glDeleteShader glad_glDeleteShader
2187 GLAD_API_CALL PFNGLDELETETEXTURESPROC glad_glDeleteTextures;
2188 #define glDeleteTextures glad_glDeleteTextures
2189 GLAD_API_CALL PFNGLDEPTHFUNCPROC glad_glDepthFunc;
2190 #define glDepthFunc glad_glDepthFunc
2191 GLAD_API_CALL PFNGLDEPTHMASKPROC glad_glDepthMask;
2192 #define glDepthMask glad_glDepthMask
2193 GLAD_API_CALL PFNGLDEPTHRANGEPROC glad_glDepthRange;
2194 #define glDepthRange glad_glDepthRange
2195 GLAD_API_CALL PFNGLDETACHSHADERPROC glad_glDetachShader;
2196 #define glDetachShader glad_glDetachShader
2197 GLAD_API_CALL PFNGLDISABLEPROC glad_glDisable;
2198 #define glDisable glad_glDisable
2199 GLAD_API_CALL PFNGLDISABLECLIENTSTATEPROC glad_glDisableClientState;
2200 #define glDisableClientState glad_glDisableClientState
2201 GLAD_API_CALL PFNGLDISABLEVERTEXATTRIBARRAYPROC glad_glDisableVertexAttribArray;
2202 #define glDisableVertexAttribArray glad_glDisableVertexAttribArray
2203 GLAD_API_CALL PFNGLDRAWARRAYSPROC glad_glDrawArrays;
2204 #define glDrawArrays glad_glDrawArrays
2205 GLAD_API_CALL PFNGLDRAWBUFFERPROC glad_glDrawBuffer;
2206 #define glDrawBuffer glad_glDrawBuffer
2207 GLAD_API_CALL PFNGLDRAWBUFFERSPROC glad_glDrawBuffers;
2208 #define glDrawBuffers glad_glDrawBuffers
2209 GLAD_API_CALL PFNGLDRAWELEMENTSPROC glad_glDrawElements;
2210 #define glDrawElements glad_glDrawElements
2211 GLAD_API_CALL PFNGLDRAWPIXELSPROC glad_glDrawPixels;
2212 #define glDrawPixels glad_glDrawPixels
2213 GLAD_API_CALL PFNGLDRAWRANGEELEMENTSPROC glad_glDrawRangeElements;
2214 #define glDrawRangeElements glad_glDrawRangeElements
2215 GLAD_API_CALL PFNGLEDGEFLAGPROC glad_glEdgeFlag;
2216 #define glEdgeFlag glad_glEdgeFlag
2217 GLAD_API_CALL PFNGLEDGEFLAGPOINTERPROC glad_glEdgeFlagPointer;
2218 #define glEdgeFlagPointer glad_glEdgeFlagPointer
2219 GLAD_API_CALL PFNGLEDGEFLAGVPROC glad_glEdgeFlagv;
2220 #define glEdgeFlagv glad_glEdgeFlagv
2221 GLAD_API_CALL PFNGLENABLEPROC glad_glEnable;
2222 #define glEnable glad_glEnable
2223 GLAD_API_CALL PFNGLENABLECLIENTSTATEPROC glad_glEnableClientState;
2224 #define glEnableClientState glad_glEnableClientState
2225 GLAD_API_CALL PFNGLENABLEVERTEXATTRIBARRAYPROC glad_glEnableVertexAttribArray;
2226 #define glEnableVertexAttribArray glad_glEnableVertexAttribArray
2227 GLAD_API_CALL PFNGLENDPROC glad_glEnd;
2228 #define glEnd glad_glEnd
2229 GLAD_API_CALL PFNGLENDLISTPROC glad_glEndList;
2230 #define glEndList glad_glEndList
2231 GLAD_API_CALL PFNGLENDQUERYPROC glad_glEndQuery;
2232 #define glEndQuery glad_glEndQuery
2233 GLAD_API_CALL PFNGLEVALCOORD1DPROC glad_glEvalCoord1d;
2234 #define glEvalCoord1d glad_glEvalCoord1d
2235 GLAD_API_CALL PFNGLEVALCOORD1DVPROC glad_glEvalCoord1dv;
2236 #define glEvalCoord1dv glad_glEvalCoord1dv
2237 GLAD_API_CALL PFNGLEVALCOORD1FPROC glad_glEvalCoord1f;
2238 #define glEvalCoord1f glad_glEvalCoord1f
2239 GLAD_API_CALL PFNGLEVALCOORD1FVPROC glad_glEvalCoord1fv;
2240 #define glEvalCoord1fv glad_glEvalCoord1fv
2241 GLAD_API_CALL PFNGLEVALCOORD2DPROC glad_glEvalCoord2d;
2242 #define glEvalCoord2d glad_glEvalCoord2d
2243 GLAD_API_CALL PFNGLEVALCOORD2DVPROC glad_glEvalCoord2dv;
2244 #define glEvalCoord2dv glad_glEvalCoord2dv
2245 GLAD_API_CALL PFNGLEVALCOORD2FPROC glad_glEvalCoord2f;
2246 #define glEvalCoord2f glad_glEvalCoord2f
2247 GLAD_API_CALL PFNGLEVALCOORD2FVPROC glad_glEvalCoord2fv;
2248 #define glEvalCoord2fv glad_glEvalCoord2fv
2249 GLAD_API_CALL PFNGLEVALMESH1PROC glad_glEvalMesh1;
2250 #define glEvalMesh1 glad_glEvalMesh1
2251 GLAD_API_CALL PFNGLEVALMESH2PROC glad_glEvalMesh2;
2252 #define glEvalMesh2 glad_glEvalMesh2
2253 GLAD_API_CALL PFNGLEVALPOINT1PROC glad_glEvalPoint1;
2254 #define glEvalPoint1 glad_glEvalPoint1
2255 GLAD_API_CALL PFNGLEVALPOINT2PROC glad_glEvalPoint2;
2256 #define glEvalPoint2 glad_glEvalPoint2
2257 GLAD_API_CALL PFNGLFEEDBACKBUFFERPROC glad_glFeedbackBuffer;
2258 #define glFeedbackBuffer glad_glFeedbackBuffer
2259 GLAD_API_CALL PFNGLFINISHPROC glad_glFinish;
2260 #define glFinish glad_glFinish
2261 GLAD_API_CALL PFNGLFLUSHPROC glad_glFlush;
2262 #define glFlush glad_glFlush
2263 GLAD_API_CALL PFNGLFOGCOORDPOINTERPROC glad_glFogCoordPointer;
2264 #define glFogCoordPointer glad_glFogCoordPointer
2265 GLAD_API_CALL PFNGLFOGCOORDDPROC glad_glFogCoordd;
2266 #define glFogCoordd glad_glFogCoordd
2267 GLAD_API_CALL PFNGLFOGCOORDDVPROC glad_glFogCoorddv;
2268 #define glFogCoorddv glad_glFogCoorddv
2269 GLAD_API_CALL PFNGLFOGCOORDFPROC glad_glFogCoordf;
2270 #define glFogCoordf glad_glFogCoordf
2271 GLAD_API_CALL PFNGLFOGCOORDFVPROC glad_glFogCoordfv;
2272 #define glFogCoordfv glad_glFogCoordfv
2273 GLAD_API_CALL PFNGLFOGFPROC glad_glFogf;
2274 #define glFogf glad_glFogf
2275 GLAD_API_CALL PFNGLFOGFVPROC glad_glFogfv;
2276 #define glFogfv glad_glFogfv
2277 GLAD_API_CALL PFNGLFOGIPROC glad_glFogi;
2278 #define glFogi glad_glFogi
2279 GLAD_API_CALL PFNGLFOGIVPROC glad_glFogiv;
2280 #define glFogiv glad_glFogiv
2281 GLAD_API_CALL PFNGLFRAMEBUFFERRENDERBUFFERPROC glad_glFramebufferRenderbuffer;
2282 #define glFramebufferRenderbuffer glad_glFramebufferRenderbuffer
2283 GLAD_API_CALL PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC glad_glFramebufferRenderbufferEXT;
2284 #define glFramebufferRenderbufferEXT glad_glFramebufferRenderbufferEXT
2285 GLAD_API_CALL PFNGLFRAMEBUFFERTEXTURE1DPROC glad_glFramebufferTexture1D;
2286 #define glFramebufferTexture1D glad_glFramebufferTexture1D
2287 GLAD_API_CALL PFNGLFRAMEBUFFERTEXTURE1DEXTPROC glad_glFramebufferTexture1DEXT;
2288 #define glFramebufferTexture1DEXT glad_glFramebufferTexture1DEXT
2289 GLAD_API_CALL PFNGLFRAMEBUFFERTEXTURE2DPROC glad_glFramebufferTexture2D;
2290 #define glFramebufferTexture2D glad_glFramebufferTexture2D
2291 GLAD_API_CALL PFNGLFRAMEBUFFERTEXTURE2DEXTPROC glad_glFramebufferTexture2DEXT;
2292 #define glFramebufferTexture2DEXT glad_glFramebufferTexture2DEXT
2293 GLAD_API_CALL PFNGLFRAMEBUFFERTEXTURE3DPROC glad_glFramebufferTexture3D;
2294 #define glFramebufferTexture3D glad_glFramebufferTexture3D
2295 GLAD_API_CALL PFNGLFRAMEBUFFERTEXTURE3DEXTPROC glad_glFramebufferTexture3DEXT;
2296 #define glFramebufferTexture3DEXT glad_glFramebufferTexture3DEXT
2297 GLAD_API_CALL PFNGLFRONTFACEPROC glad_glFrontFace;
2298 #define glFrontFace glad_glFrontFace
2299 GLAD_API_CALL PFNGLFRUSTUMPROC glad_glFrustum;
2300 #define glFrustum glad_glFrustum
2301 GLAD_API_CALL PFNGLGENBUFFERSPROC glad_glGenBuffers;
2302 #define glGenBuffers glad_glGenBuffers
2303 GLAD_API_CALL PFNGLGENFRAMEBUFFERSPROC glad_glGenFramebuffers;
2304 #define glGenFramebuffers glad_glGenFramebuffers
2305 GLAD_API_CALL PFNGLGENFRAMEBUFFERSEXTPROC glad_glGenFramebuffersEXT;
2306 #define glGenFramebuffersEXT glad_glGenFramebuffersEXT
2307 GLAD_API_CALL PFNGLGENLISTSPROC glad_glGenLists;
2308 #define glGenLists glad_glGenLists
2309 GLAD_API_CALL PFNGLGENQUERIESPROC glad_glGenQueries;
2310 #define glGenQueries glad_glGenQueries
2311 GLAD_API_CALL PFNGLGENRENDERBUFFERSPROC glad_glGenRenderbuffers;
2312 #define glGenRenderbuffers glad_glGenRenderbuffers
2313 GLAD_API_CALL PFNGLGENRENDERBUFFERSEXTPROC glad_glGenRenderbuffersEXT;
2314 #define glGenRenderbuffersEXT glad_glGenRenderbuffersEXT
2315 GLAD_API_CALL PFNGLGENTEXTURESPROC glad_glGenTextures;
2316 #define glGenTextures glad_glGenTextures
2317 GLAD_API_CALL PFNGLGENERATEMIPMAPPROC glad_glGenerateMipmap;
2318 #define glGenerateMipmap glad_glGenerateMipmap
2319 GLAD_API_CALL PFNGLGENERATEMIPMAPEXTPROC glad_glGenerateMipmapEXT;
2320 #define glGenerateMipmapEXT glad_glGenerateMipmapEXT
2321 GLAD_API_CALL PFNGLGETACTIVEATTRIBPROC glad_glGetActiveAttrib;
2322 #define glGetActiveAttrib glad_glGetActiveAttrib
2323 GLAD_API_CALL PFNGLGETACTIVEUNIFORMPROC glad_glGetActiveUniform;
2324 #define glGetActiveUniform glad_glGetActiveUniform
2325 GLAD_API_CALL PFNGLGETATTACHEDSHADERSPROC glad_glGetAttachedShaders;
2326 #define glGetAttachedShaders glad_glGetAttachedShaders
2327 GLAD_API_CALL PFNGLGETATTRIBLOCATIONPROC glad_glGetAttribLocation;
2328 #define glGetAttribLocation glad_glGetAttribLocation
2329 GLAD_API_CALL PFNGLGETBOOLEANVPROC glad_glGetBooleanv;
2330 #define glGetBooleanv glad_glGetBooleanv
2331 GLAD_API_CALL PFNGLGETBUFFERPARAMETERIVPROC glad_glGetBufferParameteriv;
2332 #define glGetBufferParameteriv glad_glGetBufferParameteriv
2333 GLAD_API_CALL PFNGLGETBUFFERPOINTERVPROC glad_glGetBufferPointerv;
2334 #define glGetBufferPointerv glad_glGetBufferPointerv
2335 GLAD_API_CALL PFNGLGETBUFFERSUBDATAPROC glad_glGetBufferSubData;
2336 #define glGetBufferSubData glad_glGetBufferSubData
2337 GLAD_API_CALL PFNGLGETCLIPPLANEPROC glad_glGetClipPlane;
2338 #define glGetClipPlane glad_glGetClipPlane
2339 GLAD_API_CALL PFNGLGETCOMPRESSEDTEXIMAGEPROC glad_glGetCompressedTexImage;
2340 #define glGetCompressedTexImage glad_glGetCompressedTexImage
2341 GLAD_API_CALL PFNGLGETDOUBLEVPROC glad_glGetDoublev;
2342 #define glGetDoublev glad_glGetDoublev
2343 GLAD_API_CALL PFNGLGETERRORPROC glad_glGetError;
2344 #define glGetError glad_glGetError
2345 GLAD_API_CALL PFNGLGETFLOATVPROC glad_glGetFloatv;
2346 #define glGetFloatv glad_glGetFloatv
2347 GLAD_API_CALL PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetFramebufferAttachmentParameteriv;
2348 #define glGetFramebufferAttachmentParameteriv glad_glGetFramebufferAttachmentParameteriv
2349 GLAD_API_CALL PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC glad_glGetFramebufferAttachmentParameterivEXT;
2350 #define glGetFramebufferAttachmentParameterivEXT glad_glGetFramebufferAttachmentParameterivEXT
2351 GLAD_API_CALL PFNGLGETINTEGERVPROC glad_glGetIntegerv;
2352 #define glGetIntegerv glad_glGetIntegerv
2353 GLAD_API_CALL PFNGLGETLIGHTFVPROC glad_glGetLightfv;
2354 #define glGetLightfv glad_glGetLightfv
2355 GLAD_API_CALL PFNGLGETLIGHTIVPROC glad_glGetLightiv;
2356 #define glGetLightiv glad_glGetLightiv
2357 GLAD_API_CALL PFNGLGETMAPDVPROC glad_glGetMapdv;
2358 #define glGetMapdv glad_glGetMapdv
2359 GLAD_API_CALL PFNGLGETMAPFVPROC glad_glGetMapfv;
2360 #define glGetMapfv glad_glGetMapfv
2361 GLAD_API_CALL PFNGLGETMAPIVPROC glad_glGetMapiv;
2362 #define glGetMapiv glad_glGetMapiv
2363 GLAD_API_CALL PFNGLGETMATERIALFVPROC glad_glGetMaterialfv;
2364 #define glGetMaterialfv glad_glGetMaterialfv
2365 GLAD_API_CALL PFNGLGETMATERIALIVPROC glad_glGetMaterialiv;
2366 #define glGetMaterialiv glad_glGetMaterialiv
2367 GLAD_API_CALL PFNGLGETPIXELMAPFVPROC glad_glGetPixelMapfv;
2368 #define glGetPixelMapfv glad_glGetPixelMapfv
2369 GLAD_API_CALL PFNGLGETPIXELMAPUIVPROC glad_glGetPixelMapuiv;
2370 #define glGetPixelMapuiv glad_glGetPixelMapuiv
2371 GLAD_API_CALL PFNGLGETPIXELMAPUSVPROC glad_glGetPixelMapusv;
2372 #define glGetPixelMapusv glad_glGetPixelMapusv
2373 GLAD_API_CALL PFNGLGETPOINTERVPROC glad_glGetPointerv;
2374 #define glGetPointerv glad_glGetPointerv
2375 GLAD_API_CALL PFNGLGETPOLYGONSTIPPLEPROC glad_glGetPolygonStipple;
2376 #define glGetPolygonStipple glad_glGetPolygonStipple
2377 GLAD_API_CALL PFNGLGETPROGRAMINFOLOGPROC glad_glGetProgramInfoLog;
2378 #define glGetProgramInfoLog glad_glGetProgramInfoLog
2379 GLAD_API_CALL PFNGLGETPROGRAMIVPROC glad_glGetProgramiv;
2380 #define glGetProgramiv glad_glGetProgramiv
2381 GLAD_API_CALL PFNGLGETQUERYOBJECTIVPROC glad_glGetQueryObjectiv;
2382 #define glGetQueryObjectiv glad_glGetQueryObjectiv
2383 GLAD_API_CALL PFNGLGETQUERYOBJECTUIVPROC glad_glGetQueryObjectuiv;
2384 #define glGetQueryObjectuiv glad_glGetQueryObjectuiv
2385 GLAD_API_CALL PFNGLGETQUERYIVPROC glad_glGetQueryiv;
2386 #define glGetQueryiv glad_glGetQueryiv
2387 GLAD_API_CALL PFNGLGETRENDERBUFFERPARAMETERIVPROC glad_glGetRenderbufferParameteriv;
2388 #define glGetRenderbufferParameteriv glad_glGetRenderbufferParameteriv
2389 GLAD_API_CALL PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC glad_glGetRenderbufferParameterivEXT;
2390 #define glGetRenderbufferParameterivEXT glad_glGetRenderbufferParameterivEXT
2391 GLAD_API_CALL PFNGLGETSHADERINFOLOGPROC glad_glGetShaderInfoLog;
2392 #define glGetShaderInfoLog glad_glGetShaderInfoLog
2393 GLAD_API_CALL PFNGLGETSHADERSOURCEPROC glad_glGetShaderSource;
2394 #define glGetShaderSource glad_glGetShaderSource
2395 GLAD_API_CALL PFNGLGETSHADERIVPROC glad_glGetShaderiv;
2396 #define glGetShaderiv glad_glGetShaderiv
2397 GLAD_API_CALL PFNGLGETSTRINGPROC glad_glGetString;
2398 #define glGetString glad_glGetString
2399 GLAD_API_CALL PFNGLGETTEXENVFVPROC glad_glGetTexEnvfv;
2400 #define glGetTexEnvfv glad_glGetTexEnvfv
2401 GLAD_API_CALL PFNGLGETTEXENVIVPROC glad_glGetTexEnviv;
2402 #define glGetTexEnviv glad_glGetTexEnviv
2403 GLAD_API_CALL PFNGLGETTEXGENDVPROC glad_glGetTexGendv;
2404 #define glGetTexGendv glad_glGetTexGendv
2405 GLAD_API_CALL PFNGLGETTEXGENFVPROC glad_glGetTexGenfv;
2406 #define glGetTexGenfv glad_glGetTexGenfv
2407 GLAD_API_CALL PFNGLGETTEXGENIVPROC glad_glGetTexGeniv;
2408 #define glGetTexGeniv glad_glGetTexGeniv
2409 GLAD_API_CALL PFNGLGETTEXIMAGEPROC glad_glGetTexImage;
2410 #define glGetTexImage glad_glGetTexImage
2411 GLAD_API_CALL PFNGLGETTEXLEVELPARAMETERFVPROC glad_glGetTexLevelParameterfv;
2412 #define glGetTexLevelParameterfv glad_glGetTexLevelParameterfv
2413 GLAD_API_CALL PFNGLGETTEXLEVELPARAMETERIVPROC glad_glGetTexLevelParameteriv;
2414 #define glGetTexLevelParameteriv glad_glGetTexLevelParameteriv
2415 GLAD_API_CALL PFNGLGETTEXPARAMETERFVPROC glad_glGetTexParameterfv;
2416 #define glGetTexParameterfv glad_glGetTexParameterfv
2417 GLAD_API_CALL PFNGLGETTEXPARAMETERIVPROC glad_glGetTexParameteriv;
2418 #define glGetTexParameteriv glad_glGetTexParameteriv
2419 GLAD_API_CALL PFNGLGETUNIFORMLOCATIONPROC glad_glGetUniformLocation;
2420 #define glGetUniformLocation glad_glGetUniformLocation
2421 GLAD_API_CALL PFNGLGETUNIFORMFVPROC glad_glGetUniformfv;
2422 #define glGetUniformfv glad_glGetUniformfv
2423 GLAD_API_CALL PFNGLGETUNIFORMIVPROC glad_glGetUniformiv;
2424 #define glGetUniformiv glad_glGetUniformiv
2425 GLAD_API_CALL PFNGLGETVERTEXATTRIBPOINTERVPROC glad_glGetVertexAttribPointerv;
2426 #define glGetVertexAttribPointerv glad_glGetVertexAttribPointerv
2427 GLAD_API_CALL PFNGLGETVERTEXATTRIBDVPROC glad_glGetVertexAttribdv;
2428 #define glGetVertexAttribdv glad_glGetVertexAttribdv
2429 GLAD_API_CALL PFNGLGETVERTEXATTRIBFVPROC glad_glGetVertexAttribfv;
2430 #define glGetVertexAttribfv glad_glGetVertexAttribfv
2431 GLAD_API_CALL PFNGLGETVERTEXATTRIBIVPROC glad_glGetVertexAttribiv;
2432 #define glGetVertexAttribiv glad_glGetVertexAttribiv
2433 GLAD_API_CALL PFNGLHINTPROC glad_glHint;
2434 #define glHint glad_glHint
2435 GLAD_API_CALL PFNGLINDEXMASKPROC glad_glIndexMask;
2436 #define glIndexMask glad_glIndexMask
2437 GLAD_API_CALL PFNGLINDEXPOINTERPROC glad_glIndexPointer;
2438 #define glIndexPointer glad_glIndexPointer
2439 GLAD_API_CALL PFNGLINDEXDPROC glad_glIndexd;
2440 #define glIndexd glad_glIndexd
2441 GLAD_API_CALL PFNGLINDEXDVPROC glad_glIndexdv;
2442 #define glIndexdv glad_glIndexdv
2443 GLAD_API_CALL PFNGLINDEXFPROC glad_glIndexf;
2444 #define glIndexf glad_glIndexf
2445 GLAD_API_CALL PFNGLINDEXFVPROC glad_glIndexfv;
2446 #define glIndexfv glad_glIndexfv
2447 GLAD_API_CALL PFNGLINDEXIPROC glad_glIndexi;
2448 #define glIndexi glad_glIndexi
2449 GLAD_API_CALL PFNGLINDEXIVPROC glad_glIndexiv;
2450 #define glIndexiv glad_glIndexiv
2451 GLAD_API_CALL PFNGLINDEXSPROC glad_glIndexs;
2452 #define glIndexs glad_glIndexs
2453 GLAD_API_CALL PFNGLINDEXSVPROC glad_glIndexsv;
2454 #define glIndexsv glad_glIndexsv
2455 GLAD_API_CALL PFNGLINDEXUBPROC glad_glIndexub;
2456 #define glIndexub glad_glIndexub
2457 GLAD_API_CALL PFNGLINDEXUBVPROC glad_glIndexubv;
2458 #define glIndexubv glad_glIndexubv
2459 GLAD_API_CALL PFNGLINITNAMESPROC glad_glInitNames;
2460 #define glInitNames glad_glInitNames
2461 GLAD_API_CALL PFNGLINTERLEAVEDARRAYSPROC glad_glInterleavedArrays;
2462 #define glInterleavedArrays glad_glInterleavedArrays
2463 GLAD_API_CALL PFNGLISBUFFERPROC glad_glIsBuffer;
2464 #define glIsBuffer glad_glIsBuffer
2465 GLAD_API_CALL PFNGLISENABLEDPROC glad_glIsEnabled;
2466 #define glIsEnabled glad_glIsEnabled
2467 GLAD_API_CALL PFNGLISFRAMEBUFFERPROC glad_glIsFramebuffer;
2468 #define glIsFramebuffer glad_glIsFramebuffer
2469 GLAD_API_CALL PFNGLISFRAMEBUFFEREXTPROC glad_glIsFramebufferEXT;
2470 #define glIsFramebufferEXT glad_glIsFramebufferEXT
2471 GLAD_API_CALL PFNGLISLISTPROC glad_glIsList;
2472 #define glIsList glad_glIsList
2473 GLAD_API_CALL PFNGLISPROGRAMPROC glad_glIsProgram;
2474 #define glIsProgram glad_glIsProgram
2475 GLAD_API_CALL PFNGLISQUERYPROC glad_glIsQuery;
2476 #define glIsQuery glad_glIsQuery
2477 GLAD_API_CALL PFNGLISRENDERBUFFERPROC glad_glIsRenderbuffer;
2478 #define glIsRenderbuffer glad_glIsRenderbuffer
2479 GLAD_API_CALL PFNGLISRENDERBUFFEREXTPROC glad_glIsRenderbufferEXT;
2480 #define glIsRenderbufferEXT glad_glIsRenderbufferEXT
2481 GLAD_API_CALL PFNGLISSHADERPROC glad_glIsShader;
2482 #define glIsShader glad_glIsShader
2483 GLAD_API_CALL PFNGLISTEXTUREPROC glad_glIsTexture;
2484 #define glIsTexture glad_glIsTexture
2485 GLAD_API_CALL PFNGLLIGHTMODELFPROC glad_glLightModelf;
2486 #define glLightModelf glad_glLightModelf
2487 GLAD_API_CALL PFNGLLIGHTMODELFVPROC glad_glLightModelfv;
2488 #define glLightModelfv glad_glLightModelfv
2489 GLAD_API_CALL PFNGLLIGHTMODELIPROC glad_glLightModeli;
2490 #define glLightModeli glad_glLightModeli
2491 GLAD_API_CALL PFNGLLIGHTMODELIVPROC glad_glLightModeliv;
2492 #define glLightModeliv glad_glLightModeliv
2493 GLAD_API_CALL PFNGLLIGHTFPROC glad_glLightf;
2494 #define glLightf glad_glLightf
2495 GLAD_API_CALL PFNGLLIGHTFVPROC glad_glLightfv;
2496 #define glLightfv glad_glLightfv
2497 GLAD_API_CALL PFNGLLIGHTIPROC glad_glLighti;
2498 #define glLighti glad_glLighti
2499 GLAD_API_CALL PFNGLLIGHTIVPROC glad_glLightiv;
2500 #define glLightiv glad_glLightiv
2501 GLAD_API_CALL PFNGLLINESTIPPLEPROC glad_glLineStipple;
2502 #define glLineStipple glad_glLineStipple
2503 GLAD_API_CALL PFNGLLINEWIDTHPROC glad_glLineWidth;
2504 #define glLineWidth glad_glLineWidth
2505 GLAD_API_CALL PFNGLLINKPROGRAMPROC glad_glLinkProgram;
2506 #define glLinkProgram glad_glLinkProgram
2507 GLAD_API_CALL PFNGLLISTBASEPROC glad_glListBase;
2508 #define glListBase glad_glListBase
2509 GLAD_API_CALL PFNGLLOADIDENTITYPROC glad_glLoadIdentity;
2510 #define glLoadIdentity glad_glLoadIdentity
2511 GLAD_API_CALL PFNGLLOADMATRIXDPROC glad_glLoadMatrixd;
2512 #define glLoadMatrixd glad_glLoadMatrixd
2513 GLAD_API_CALL PFNGLLOADMATRIXFPROC glad_glLoadMatrixf;
2514 #define glLoadMatrixf glad_glLoadMatrixf
2515 GLAD_API_CALL PFNGLLOADNAMEPROC glad_glLoadName;
2516 #define glLoadName glad_glLoadName
2517 GLAD_API_CALL PFNGLLOADTRANSPOSEMATRIXDPROC glad_glLoadTransposeMatrixd;
2518 #define glLoadTransposeMatrixd glad_glLoadTransposeMatrixd
2519 GLAD_API_CALL PFNGLLOADTRANSPOSEMATRIXFPROC glad_glLoadTransposeMatrixf;
2520 #define glLoadTransposeMatrixf glad_glLoadTransposeMatrixf
2521 GLAD_API_CALL PFNGLLOGICOPPROC glad_glLogicOp;
2522 #define glLogicOp glad_glLogicOp
2523 GLAD_API_CALL PFNGLMAP1DPROC glad_glMap1d;
2524 #define glMap1d glad_glMap1d
2525 GLAD_API_CALL PFNGLMAP1FPROC glad_glMap1f;
2526 #define glMap1f glad_glMap1f
2527 GLAD_API_CALL PFNGLMAP2DPROC glad_glMap2d;
2528 #define glMap2d glad_glMap2d
2529 GLAD_API_CALL PFNGLMAP2FPROC glad_glMap2f;
2530 #define glMap2f glad_glMap2f
2531 GLAD_API_CALL PFNGLMAPBUFFERPROC glad_glMapBuffer;
2532 #define glMapBuffer glad_glMapBuffer
2533 GLAD_API_CALL PFNGLMAPGRID1DPROC glad_glMapGrid1d;
2534 #define glMapGrid1d glad_glMapGrid1d
2535 GLAD_API_CALL PFNGLMAPGRID1FPROC glad_glMapGrid1f;
2536 #define glMapGrid1f glad_glMapGrid1f
2537 GLAD_API_CALL PFNGLMAPGRID2DPROC glad_glMapGrid2d;
2538 #define glMapGrid2d glad_glMapGrid2d
2539 GLAD_API_CALL PFNGLMAPGRID2FPROC glad_glMapGrid2f;
2540 #define glMapGrid2f glad_glMapGrid2f
2541 GLAD_API_CALL PFNGLMATERIALFPROC glad_glMaterialf;
2542 #define glMaterialf glad_glMaterialf
2543 GLAD_API_CALL PFNGLMATERIALFVPROC glad_glMaterialfv;
2544 #define glMaterialfv glad_glMaterialfv
2545 GLAD_API_CALL PFNGLMATERIALIPROC glad_glMateriali;
2546 #define glMateriali glad_glMateriali
2547 GLAD_API_CALL PFNGLMATERIALIVPROC glad_glMaterialiv;
2548 #define glMaterialiv glad_glMaterialiv
2549 GLAD_API_CALL PFNGLMATRIXMODEPROC glad_glMatrixMode;
2550 #define glMatrixMode glad_glMatrixMode
2551 GLAD_API_CALL PFNGLMULTMATRIXDPROC glad_glMultMatrixd;
2552 #define glMultMatrixd glad_glMultMatrixd
2553 GLAD_API_CALL PFNGLMULTMATRIXFPROC glad_glMultMatrixf;
2554 #define glMultMatrixf glad_glMultMatrixf
2555 GLAD_API_CALL PFNGLMULTTRANSPOSEMATRIXDPROC glad_glMultTransposeMatrixd;
2556 #define glMultTransposeMatrixd glad_glMultTransposeMatrixd
2557 GLAD_API_CALL PFNGLMULTTRANSPOSEMATRIXFPROC glad_glMultTransposeMatrixf;
2558 #define glMultTransposeMatrixf glad_glMultTransposeMatrixf
2559 GLAD_API_CALL PFNGLMULTIDRAWARRAYSPROC glad_glMultiDrawArrays;
2560 #define glMultiDrawArrays glad_glMultiDrawArrays
2561 GLAD_API_CALL PFNGLMULTIDRAWELEMENTSPROC glad_glMultiDrawElements;
2562 #define glMultiDrawElements glad_glMultiDrawElements
2563 GLAD_API_CALL PFNGLMULTITEXCOORD1DPROC glad_glMultiTexCoord1d;
2564 #define glMultiTexCoord1d glad_glMultiTexCoord1d
2565 GLAD_API_CALL PFNGLMULTITEXCOORD1DVPROC glad_glMultiTexCoord1dv;
2566 #define glMultiTexCoord1dv glad_glMultiTexCoord1dv
2567 GLAD_API_CALL PFNGLMULTITEXCOORD1FPROC glad_glMultiTexCoord1f;
2568 #define glMultiTexCoord1f glad_glMultiTexCoord1f
2569 GLAD_API_CALL PFNGLMULTITEXCOORD1FVPROC glad_glMultiTexCoord1fv;
2570 #define glMultiTexCoord1fv glad_glMultiTexCoord1fv
2571 GLAD_API_CALL PFNGLMULTITEXCOORD1IPROC glad_glMultiTexCoord1i;
2572 #define glMultiTexCoord1i glad_glMultiTexCoord1i
2573 GLAD_API_CALL PFNGLMULTITEXCOORD1IVPROC glad_glMultiTexCoord1iv;
2574 #define glMultiTexCoord1iv glad_glMultiTexCoord1iv
2575 GLAD_API_CALL PFNGLMULTITEXCOORD1SPROC glad_glMultiTexCoord1s;
2576 #define glMultiTexCoord1s glad_glMultiTexCoord1s
2577 GLAD_API_CALL PFNGLMULTITEXCOORD1SVPROC glad_glMultiTexCoord1sv;
2578 #define glMultiTexCoord1sv glad_glMultiTexCoord1sv
2579 GLAD_API_CALL PFNGLMULTITEXCOORD2DPROC glad_glMultiTexCoord2d;
2580 #define glMultiTexCoord2d glad_glMultiTexCoord2d
2581 GLAD_API_CALL PFNGLMULTITEXCOORD2DVPROC glad_glMultiTexCoord2dv;
2582 #define glMultiTexCoord2dv glad_glMultiTexCoord2dv
2583 GLAD_API_CALL PFNGLMULTITEXCOORD2FPROC glad_glMultiTexCoord2f;
2584 #define glMultiTexCoord2f glad_glMultiTexCoord2f
2585 GLAD_API_CALL PFNGLMULTITEXCOORD2FVPROC glad_glMultiTexCoord2fv;
2586 #define glMultiTexCoord2fv glad_glMultiTexCoord2fv
2587 GLAD_API_CALL PFNGLMULTITEXCOORD2IPROC glad_glMultiTexCoord2i;
2588 #define glMultiTexCoord2i glad_glMultiTexCoord2i
2589 GLAD_API_CALL PFNGLMULTITEXCOORD2IVPROC glad_glMultiTexCoord2iv;
2590 #define glMultiTexCoord2iv glad_glMultiTexCoord2iv
2591 GLAD_API_CALL PFNGLMULTITEXCOORD2SPROC glad_glMultiTexCoord2s;
2592 #define glMultiTexCoord2s glad_glMultiTexCoord2s
2593 GLAD_API_CALL PFNGLMULTITEXCOORD2SVPROC glad_glMultiTexCoord2sv;
2594 #define glMultiTexCoord2sv glad_glMultiTexCoord2sv
2595 GLAD_API_CALL PFNGLMULTITEXCOORD3DPROC glad_glMultiTexCoord3d;
2596 #define glMultiTexCoord3d glad_glMultiTexCoord3d
2597 GLAD_API_CALL PFNGLMULTITEXCOORD3DVPROC glad_glMultiTexCoord3dv;
2598 #define glMultiTexCoord3dv glad_glMultiTexCoord3dv
2599 GLAD_API_CALL PFNGLMULTITEXCOORD3FPROC glad_glMultiTexCoord3f;
2600 #define glMultiTexCoord3f glad_glMultiTexCoord3f
2601 GLAD_API_CALL PFNGLMULTITEXCOORD3FVPROC glad_glMultiTexCoord3fv;
2602 #define glMultiTexCoord3fv glad_glMultiTexCoord3fv
2603 GLAD_API_CALL PFNGLMULTITEXCOORD3IPROC glad_glMultiTexCoord3i;
2604 #define glMultiTexCoord3i glad_glMultiTexCoord3i
2605 GLAD_API_CALL PFNGLMULTITEXCOORD3IVPROC glad_glMultiTexCoord3iv;
2606 #define glMultiTexCoord3iv glad_glMultiTexCoord3iv
2607 GLAD_API_CALL PFNGLMULTITEXCOORD3SPROC glad_glMultiTexCoord3s;
2608 #define glMultiTexCoord3s glad_glMultiTexCoord3s
2609 GLAD_API_CALL PFNGLMULTITEXCOORD3SVPROC glad_glMultiTexCoord3sv;
2610 #define glMultiTexCoord3sv glad_glMultiTexCoord3sv
2611 GLAD_API_CALL PFNGLMULTITEXCOORD4DPROC glad_glMultiTexCoord4d;
2612 #define glMultiTexCoord4d glad_glMultiTexCoord4d
2613 GLAD_API_CALL PFNGLMULTITEXCOORD4DVPROC glad_glMultiTexCoord4dv;
2614 #define glMultiTexCoord4dv glad_glMultiTexCoord4dv
2615 GLAD_API_CALL PFNGLMULTITEXCOORD4FPROC glad_glMultiTexCoord4f;
2616 #define glMultiTexCoord4f glad_glMultiTexCoord4f
2617 GLAD_API_CALL PFNGLMULTITEXCOORD4FVPROC glad_glMultiTexCoord4fv;
2618 #define glMultiTexCoord4fv glad_glMultiTexCoord4fv
2619 GLAD_API_CALL PFNGLMULTITEXCOORD4IPROC glad_glMultiTexCoord4i;
2620 #define glMultiTexCoord4i glad_glMultiTexCoord4i
2621 GLAD_API_CALL PFNGLMULTITEXCOORD4IVPROC glad_glMultiTexCoord4iv;
2622 #define glMultiTexCoord4iv glad_glMultiTexCoord4iv
2623 GLAD_API_CALL PFNGLMULTITEXCOORD4SPROC glad_glMultiTexCoord4s;
2624 #define glMultiTexCoord4s glad_glMultiTexCoord4s
2625 GLAD_API_CALL PFNGLMULTITEXCOORD4SVPROC glad_glMultiTexCoord4sv;
2626 #define glMultiTexCoord4sv glad_glMultiTexCoord4sv
2627 GLAD_API_CALL PFNGLNEWLISTPROC glad_glNewList;
2628 #define glNewList glad_glNewList
2629 GLAD_API_CALL PFNGLNORMAL3BPROC glad_glNormal3b;
2630 #define glNormal3b glad_glNormal3b
2631 GLAD_API_CALL PFNGLNORMAL3BVPROC glad_glNormal3bv;
2632 #define glNormal3bv glad_glNormal3bv
2633 GLAD_API_CALL PFNGLNORMAL3DPROC glad_glNormal3d;
2634 #define glNormal3d glad_glNormal3d
2635 GLAD_API_CALL PFNGLNORMAL3DVPROC glad_glNormal3dv;
2636 #define glNormal3dv glad_glNormal3dv
2637 GLAD_API_CALL PFNGLNORMAL3FPROC glad_glNormal3f;
2638 #define glNormal3f glad_glNormal3f
2639 GLAD_API_CALL PFNGLNORMAL3FVPROC glad_glNormal3fv;
2640 #define glNormal3fv glad_glNormal3fv
2641 GLAD_API_CALL PFNGLNORMAL3IPROC glad_glNormal3i;
2642 #define glNormal3i glad_glNormal3i
2643 GLAD_API_CALL PFNGLNORMAL3IVPROC glad_glNormal3iv;
2644 #define glNormal3iv glad_glNormal3iv
2645 GLAD_API_CALL PFNGLNORMAL3SPROC glad_glNormal3s;
2646 #define glNormal3s glad_glNormal3s
2647 GLAD_API_CALL PFNGLNORMAL3SVPROC glad_glNormal3sv;
2648 #define glNormal3sv glad_glNormal3sv
2649 GLAD_API_CALL PFNGLNORMALPOINTERPROC glad_glNormalPointer;
2650 #define glNormalPointer glad_glNormalPointer
2651 GLAD_API_CALL PFNGLORTHOPROC glad_glOrtho;
2652 #define glOrtho glad_glOrtho
2653 GLAD_API_CALL PFNGLPASSTHROUGHPROC glad_glPassThrough;
2654 #define glPassThrough glad_glPassThrough
2655 GLAD_API_CALL PFNGLPIXELMAPFVPROC glad_glPixelMapfv;
2656 #define glPixelMapfv glad_glPixelMapfv
2657 GLAD_API_CALL PFNGLPIXELMAPUIVPROC glad_glPixelMapuiv;
2658 #define glPixelMapuiv glad_glPixelMapuiv
2659 GLAD_API_CALL PFNGLPIXELMAPUSVPROC glad_glPixelMapusv;
2660 #define glPixelMapusv glad_glPixelMapusv
2661 GLAD_API_CALL PFNGLPIXELSTOREFPROC glad_glPixelStoref;
2662 #define glPixelStoref glad_glPixelStoref
2663 GLAD_API_CALL PFNGLPIXELSTOREIPROC glad_glPixelStorei;
2664 #define glPixelStorei glad_glPixelStorei
2665 GLAD_API_CALL PFNGLPIXELTRANSFERFPROC glad_glPixelTransferf;
2666 #define glPixelTransferf glad_glPixelTransferf
2667 GLAD_API_CALL PFNGLPIXELTRANSFERIPROC glad_glPixelTransferi;
2668 #define glPixelTransferi glad_glPixelTransferi
2669 GLAD_API_CALL PFNGLPIXELZOOMPROC glad_glPixelZoom;
2670 #define glPixelZoom glad_glPixelZoom
2671 GLAD_API_CALL PFNGLPOINTPARAMETERFPROC glad_glPointParameterf;
2672 #define glPointParameterf glad_glPointParameterf
2673 GLAD_API_CALL PFNGLPOINTPARAMETERFVPROC glad_glPointParameterfv;
2674 #define glPointParameterfv glad_glPointParameterfv
2675 GLAD_API_CALL PFNGLPOINTPARAMETERIPROC glad_glPointParameteri;
2676 #define glPointParameteri glad_glPointParameteri
2677 GLAD_API_CALL PFNGLPOINTPARAMETERIVPROC glad_glPointParameteriv;
2678 #define glPointParameteriv glad_glPointParameteriv
2679 GLAD_API_CALL PFNGLPOINTSIZEPROC glad_glPointSize;
2680 #define glPointSize glad_glPointSize
2681 GLAD_API_CALL PFNGLPOLYGONMODEPROC glad_glPolygonMode;
2682 #define glPolygonMode glad_glPolygonMode
2683 GLAD_API_CALL PFNGLPOLYGONOFFSETPROC glad_glPolygonOffset;
2684 #define glPolygonOffset glad_glPolygonOffset
2685 GLAD_API_CALL PFNGLPOLYGONSTIPPLEPROC glad_glPolygonStipple;
2686 #define glPolygonStipple glad_glPolygonStipple
2687 GLAD_API_CALL PFNGLPOPATTRIBPROC glad_glPopAttrib;
2688 #define glPopAttrib glad_glPopAttrib
2689 GLAD_API_CALL PFNGLPOPCLIENTATTRIBPROC glad_glPopClientAttrib;
2690 #define glPopClientAttrib glad_glPopClientAttrib
2691 GLAD_API_CALL PFNGLPOPMATRIXPROC glad_glPopMatrix;
2692 #define glPopMatrix glad_glPopMatrix
2693 GLAD_API_CALL PFNGLPOPNAMEPROC glad_glPopName;
2694 #define glPopName glad_glPopName
2695 GLAD_API_CALL PFNGLPRIORITIZETEXTURESPROC glad_glPrioritizeTextures;
2696 #define glPrioritizeTextures glad_glPrioritizeTextures
2697 GLAD_API_CALL PFNGLPUSHATTRIBPROC glad_glPushAttrib;
2698 #define glPushAttrib glad_glPushAttrib
2699 GLAD_API_CALL PFNGLPUSHCLIENTATTRIBPROC glad_glPushClientAttrib;
2700 #define glPushClientAttrib glad_glPushClientAttrib
2701 GLAD_API_CALL PFNGLPUSHMATRIXPROC glad_glPushMatrix;
2702 #define glPushMatrix glad_glPushMatrix
2703 GLAD_API_CALL PFNGLPUSHNAMEPROC glad_glPushName;
2704 #define glPushName glad_glPushName
2705 GLAD_API_CALL PFNGLRASTERPOS2DPROC glad_glRasterPos2d;
2706 #define glRasterPos2d glad_glRasterPos2d
2707 GLAD_API_CALL PFNGLRASTERPOS2DVPROC glad_glRasterPos2dv;
2708 #define glRasterPos2dv glad_glRasterPos2dv
2709 GLAD_API_CALL PFNGLRASTERPOS2FPROC glad_glRasterPos2f;
2710 #define glRasterPos2f glad_glRasterPos2f
2711 GLAD_API_CALL PFNGLRASTERPOS2FVPROC glad_glRasterPos2fv;
2712 #define glRasterPos2fv glad_glRasterPos2fv
2713 GLAD_API_CALL PFNGLRASTERPOS2IPROC glad_glRasterPos2i;
2714 #define glRasterPos2i glad_glRasterPos2i
2715 GLAD_API_CALL PFNGLRASTERPOS2IVPROC glad_glRasterPos2iv;
2716 #define glRasterPos2iv glad_glRasterPos2iv
2717 GLAD_API_CALL PFNGLRASTERPOS2SPROC glad_glRasterPos2s;
2718 #define glRasterPos2s glad_glRasterPos2s
2719 GLAD_API_CALL PFNGLRASTERPOS2SVPROC glad_glRasterPos2sv;
2720 #define glRasterPos2sv glad_glRasterPos2sv
2721 GLAD_API_CALL PFNGLRASTERPOS3DPROC glad_glRasterPos3d;
2722 #define glRasterPos3d glad_glRasterPos3d
2723 GLAD_API_CALL PFNGLRASTERPOS3DVPROC glad_glRasterPos3dv;
2724 #define glRasterPos3dv glad_glRasterPos3dv
2725 GLAD_API_CALL PFNGLRASTERPOS3FPROC glad_glRasterPos3f;
2726 #define glRasterPos3f glad_glRasterPos3f
2727 GLAD_API_CALL PFNGLRASTERPOS3FVPROC glad_glRasterPos3fv;
2728 #define glRasterPos3fv glad_glRasterPos3fv
2729 GLAD_API_CALL PFNGLRASTERPOS3IPROC glad_glRasterPos3i;
2730 #define glRasterPos3i glad_glRasterPos3i
2731 GLAD_API_CALL PFNGLRASTERPOS3IVPROC glad_glRasterPos3iv;
2732 #define glRasterPos3iv glad_glRasterPos3iv
2733 GLAD_API_CALL PFNGLRASTERPOS3SPROC glad_glRasterPos3s;
2734 #define glRasterPos3s glad_glRasterPos3s
2735 GLAD_API_CALL PFNGLRASTERPOS3SVPROC glad_glRasterPos3sv;
2736 #define glRasterPos3sv glad_glRasterPos3sv
2737 GLAD_API_CALL PFNGLRASTERPOS4DPROC glad_glRasterPos4d;
2738 #define glRasterPos4d glad_glRasterPos4d
2739 GLAD_API_CALL PFNGLRASTERPOS4DVPROC glad_glRasterPos4dv;
2740 #define glRasterPos4dv glad_glRasterPos4dv
2741 GLAD_API_CALL PFNGLRASTERPOS4FPROC glad_glRasterPos4f;
2742 #define glRasterPos4f glad_glRasterPos4f
2743 GLAD_API_CALL PFNGLRASTERPOS4FVPROC glad_glRasterPos4fv;
2744 #define glRasterPos4fv glad_glRasterPos4fv
2745 GLAD_API_CALL PFNGLRASTERPOS4IPROC glad_glRasterPos4i;
2746 #define glRasterPos4i glad_glRasterPos4i
2747 GLAD_API_CALL PFNGLRASTERPOS4IVPROC glad_glRasterPos4iv;
2748 #define glRasterPos4iv glad_glRasterPos4iv
2749 GLAD_API_CALL PFNGLRASTERPOS4SPROC glad_glRasterPos4s;
2750 #define glRasterPos4s glad_glRasterPos4s
2751 GLAD_API_CALL PFNGLRASTERPOS4SVPROC glad_glRasterPos4sv;
2752 #define glRasterPos4sv glad_glRasterPos4sv
2753 GLAD_API_CALL PFNGLREADBUFFERPROC glad_glReadBuffer;
2754 #define glReadBuffer glad_glReadBuffer
2755 GLAD_API_CALL PFNGLREADPIXELSPROC glad_glReadPixels;
2756 #define glReadPixels glad_glReadPixels
2757 GLAD_API_CALL PFNGLRECTDPROC glad_glRectd;
2758 #define glRectd glad_glRectd
2759 GLAD_API_CALL PFNGLRECTDVPROC glad_glRectdv;
2760 #define glRectdv glad_glRectdv
2761 GLAD_API_CALL PFNGLRECTFPROC glad_glRectf;
2762 #define glRectf glad_glRectf
2763 GLAD_API_CALL PFNGLRECTFVPROC glad_glRectfv;
2764 #define glRectfv glad_glRectfv
2765 GLAD_API_CALL PFNGLRECTIPROC glad_glRecti;
2766 #define glRecti glad_glRecti
2767 GLAD_API_CALL PFNGLRECTIVPROC glad_glRectiv;
2768 #define glRectiv glad_glRectiv
2769 GLAD_API_CALL PFNGLRECTSPROC glad_glRects;
2770 #define glRects glad_glRects
2771 GLAD_API_CALL PFNGLRECTSVPROC glad_glRectsv;
2772 #define glRectsv glad_glRectsv
2773 GLAD_API_CALL PFNGLRENDERMODEPROC glad_glRenderMode;
2774 #define glRenderMode glad_glRenderMode
2775 GLAD_API_CALL PFNGLRENDERBUFFERSTORAGEPROC glad_glRenderbufferStorage;
2776 #define glRenderbufferStorage glad_glRenderbufferStorage
2777 GLAD_API_CALL PFNGLRENDERBUFFERSTORAGEEXTPROC glad_glRenderbufferStorageEXT;
2778 #define glRenderbufferStorageEXT glad_glRenderbufferStorageEXT
2779 GLAD_API_CALL PFNGLROTATEDPROC glad_glRotated;
2780 #define glRotated glad_glRotated
2781 GLAD_API_CALL PFNGLROTATEFPROC glad_glRotatef;
2782 #define glRotatef glad_glRotatef
2783 GLAD_API_CALL PFNGLSAMPLECOVERAGEPROC glad_glSampleCoverage;
2784 #define glSampleCoverage glad_glSampleCoverage
2785 GLAD_API_CALL PFNGLSCALEDPROC glad_glScaled;
2786 #define glScaled glad_glScaled
2787 GLAD_API_CALL PFNGLSCALEFPROC glad_glScalef;
2788 #define glScalef glad_glScalef
2789 GLAD_API_CALL PFNGLSCISSORPROC glad_glScissor;
2790 #define glScissor glad_glScissor
2791 GLAD_API_CALL PFNGLSECONDARYCOLOR3BPROC glad_glSecondaryColor3b;
2792 #define glSecondaryColor3b glad_glSecondaryColor3b
2793 GLAD_API_CALL PFNGLSECONDARYCOLOR3BVPROC glad_glSecondaryColor3bv;
2794 #define glSecondaryColor3bv glad_glSecondaryColor3bv
2795 GLAD_API_CALL PFNGLSECONDARYCOLOR3DPROC glad_glSecondaryColor3d;
2796 #define glSecondaryColor3d glad_glSecondaryColor3d
2797 GLAD_API_CALL PFNGLSECONDARYCOLOR3DVPROC glad_glSecondaryColor3dv;
2798 #define glSecondaryColor3dv glad_glSecondaryColor3dv
2799 GLAD_API_CALL PFNGLSECONDARYCOLOR3FPROC glad_glSecondaryColor3f;
2800 #define glSecondaryColor3f glad_glSecondaryColor3f
2801 GLAD_API_CALL PFNGLSECONDARYCOLOR3FVPROC glad_glSecondaryColor3fv;
2802 #define glSecondaryColor3fv glad_glSecondaryColor3fv
2803 GLAD_API_CALL PFNGLSECONDARYCOLOR3IPROC glad_glSecondaryColor3i;
2804 #define glSecondaryColor3i glad_glSecondaryColor3i
2805 GLAD_API_CALL PFNGLSECONDARYCOLOR3IVPROC glad_glSecondaryColor3iv;
2806 #define glSecondaryColor3iv glad_glSecondaryColor3iv
2807 GLAD_API_CALL PFNGLSECONDARYCOLOR3SPROC glad_glSecondaryColor3s;
2808 #define glSecondaryColor3s glad_glSecondaryColor3s
2809 GLAD_API_CALL PFNGLSECONDARYCOLOR3SVPROC glad_glSecondaryColor3sv;
2810 #define glSecondaryColor3sv glad_glSecondaryColor3sv
2811 GLAD_API_CALL PFNGLSECONDARYCOLOR3UBPROC glad_glSecondaryColor3ub;
2812 #define glSecondaryColor3ub glad_glSecondaryColor3ub
2813 GLAD_API_CALL PFNGLSECONDARYCOLOR3UBVPROC glad_glSecondaryColor3ubv;
2814 #define glSecondaryColor3ubv glad_glSecondaryColor3ubv
2815 GLAD_API_CALL PFNGLSECONDARYCOLOR3UIPROC glad_glSecondaryColor3ui;
2816 #define glSecondaryColor3ui glad_glSecondaryColor3ui
2817 GLAD_API_CALL PFNGLSECONDARYCOLOR3UIVPROC glad_glSecondaryColor3uiv;
2818 #define glSecondaryColor3uiv glad_glSecondaryColor3uiv
2819 GLAD_API_CALL PFNGLSECONDARYCOLOR3USPROC glad_glSecondaryColor3us;
2820 #define glSecondaryColor3us glad_glSecondaryColor3us
2821 GLAD_API_CALL PFNGLSECONDARYCOLOR3USVPROC glad_glSecondaryColor3usv;
2822 #define glSecondaryColor3usv glad_glSecondaryColor3usv
2823 GLAD_API_CALL PFNGLSECONDARYCOLORPOINTERPROC glad_glSecondaryColorPointer;
2824 #define glSecondaryColorPointer glad_glSecondaryColorPointer
2825 GLAD_API_CALL PFNGLSELECTBUFFERPROC glad_glSelectBuffer;
2826 #define glSelectBuffer glad_glSelectBuffer
2827 GLAD_API_CALL PFNGLSHADEMODELPROC glad_glShadeModel;
2828 #define glShadeModel glad_glShadeModel
2829 GLAD_API_CALL PFNGLSHADERSOURCEPROC glad_glShaderSource;
2830 #define glShaderSource glad_glShaderSource
2831 GLAD_API_CALL PFNGLSTENCILFUNCPROC glad_glStencilFunc;
2832 #define glStencilFunc glad_glStencilFunc
2833 GLAD_API_CALL PFNGLSTENCILFUNCSEPARATEPROC glad_glStencilFuncSeparate;
2834 #define glStencilFuncSeparate glad_glStencilFuncSeparate
2835 GLAD_API_CALL PFNGLSTENCILMASKPROC glad_glStencilMask;
2836 #define glStencilMask glad_glStencilMask
2837 GLAD_API_CALL PFNGLSTENCILMASKSEPARATEPROC glad_glStencilMaskSeparate;
2838 #define glStencilMaskSeparate glad_glStencilMaskSeparate
2839 GLAD_API_CALL PFNGLSTENCILOPPROC glad_glStencilOp;
2840 #define glStencilOp glad_glStencilOp
2841 GLAD_API_CALL PFNGLSTENCILOPSEPARATEPROC glad_glStencilOpSeparate;
2842 #define glStencilOpSeparate glad_glStencilOpSeparate
2843 GLAD_API_CALL PFNGLTEXCOORD1DPROC glad_glTexCoord1d;
2844 #define glTexCoord1d glad_glTexCoord1d
2845 GLAD_API_CALL PFNGLTEXCOORD1DVPROC glad_glTexCoord1dv;
2846 #define glTexCoord1dv glad_glTexCoord1dv
2847 GLAD_API_CALL PFNGLTEXCOORD1FPROC glad_glTexCoord1f;
2848 #define glTexCoord1f glad_glTexCoord1f
2849 GLAD_API_CALL PFNGLTEXCOORD1FVPROC glad_glTexCoord1fv;
2850 #define glTexCoord1fv glad_glTexCoord1fv
2851 GLAD_API_CALL PFNGLTEXCOORD1IPROC glad_glTexCoord1i;
2852 #define glTexCoord1i glad_glTexCoord1i
2853 GLAD_API_CALL PFNGLTEXCOORD1IVPROC glad_glTexCoord1iv;
2854 #define glTexCoord1iv glad_glTexCoord1iv
2855 GLAD_API_CALL PFNGLTEXCOORD1SPROC glad_glTexCoord1s;
2856 #define glTexCoord1s glad_glTexCoord1s
2857 GLAD_API_CALL PFNGLTEXCOORD1SVPROC glad_glTexCoord1sv;
2858 #define glTexCoord1sv glad_glTexCoord1sv
2859 GLAD_API_CALL PFNGLTEXCOORD2DPROC glad_glTexCoord2d;
2860 #define glTexCoord2d glad_glTexCoord2d
2861 GLAD_API_CALL PFNGLTEXCOORD2DVPROC glad_glTexCoord2dv;
2862 #define glTexCoord2dv glad_glTexCoord2dv
2863 GLAD_API_CALL PFNGLTEXCOORD2FPROC glad_glTexCoord2f;
2864 #define glTexCoord2f glad_glTexCoord2f
2865 GLAD_API_CALL PFNGLTEXCOORD2FVPROC glad_glTexCoord2fv;
2866 #define glTexCoord2fv glad_glTexCoord2fv
2867 GLAD_API_CALL PFNGLTEXCOORD2IPROC glad_glTexCoord2i;
2868 #define glTexCoord2i glad_glTexCoord2i
2869 GLAD_API_CALL PFNGLTEXCOORD2IVPROC glad_glTexCoord2iv;
2870 #define glTexCoord2iv glad_glTexCoord2iv
2871 GLAD_API_CALL PFNGLTEXCOORD2SPROC glad_glTexCoord2s;
2872 #define glTexCoord2s glad_glTexCoord2s
2873 GLAD_API_CALL PFNGLTEXCOORD2SVPROC glad_glTexCoord2sv;
2874 #define glTexCoord2sv glad_glTexCoord2sv
2875 GLAD_API_CALL PFNGLTEXCOORD3DPROC glad_glTexCoord3d;
2876 #define glTexCoord3d glad_glTexCoord3d
2877 GLAD_API_CALL PFNGLTEXCOORD3DVPROC glad_glTexCoord3dv;
2878 #define glTexCoord3dv glad_glTexCoord3dv
2879 GLAD_API_CALL PFNGLTEXCOORD3FPROC glad_glTexCoord3f;
2880 #define glTexCoord3f glad_glTexCoord3f
2881 GLAD_API_CALL PFNGLTEXCOORD3FVPROC glad_glTexCoord3fv;
2882 #define glTexCoord3fv glad_glTexCoord3fv
2883 GLAD_API_CALL PFNGLTEXCOORD3IPROC glad_glTexCoord3i;
2884 #define glTexCoord3i glad_glTexCoord3i
2885 GLAD_API_CALL PFNGLTEXCOORD3IVPROC glad_glTexCoord3iv;
2886 #define glTexCoord3iv glad_glTexCoord3iv
2887 GLAD_API_CALL PFNGLTEXCOORD3SPROC glad_glTexCoord3s;
2888 #define glTexCoord3s glad_glTexCoord3s
2889 GLAD_API_CALL PFNGLTEXCOORD3SVPROC glad_glTexCoord3sv;
2890 #define glTexCoord3sv glad_glTexCoord3sv
2891 GLAD_API_CALL PFNGLTEXCOORD4DPROC glad_glTexCoord4d;
2892 #define glTexCoord4d glad_glTexCoord4d
2893 GLAD_API_CALL PFNGLTEXCOORD4DVPROC glad_glTexCoord4dv;
2894 #define glTexCoord4dv glad_glTexCoord4dv
2895 GLAD_API_CALL PFNGLTEXCOORD4FPROC glad_glTexCoord4f;
2896 #define glTexCoord4f glad_glTexCoord4f
2897 GLAD_API_CALL PFNGLTEXCOORD4FVPROC glad_glTexCoord4fv;
2898 #define glTexCoord4fv glad_glTexCoord4fv
2899 GLAD_API_CALL PFNGLTEXCOORD4IPROC glad_glTexCoord4i;
2900 #define glTexCoord4i glad_glTexCoord4i
2901 GLAD_API_CALL PFNGLTEXCOORD4IVPROC glad_glTexCoord4iv;
2902 #define glTexCoord4iv glad_glTexCoord4iv
2903 GLAD_API_CALL PFNGLTEXCOORD4SPROC glad_glTexCoord4s;
2904 #define glTexCoord4s glad_glTexCoord4s
2905 GLAD_API_CALL PFNGLTEXCOORD4SVPROC glad_glTexCoord4sv;
2906 #define glTexCoord4sv glad_glTexCoord4sv
2907 GLAD_API_CALL PFNGLTEXCOORDPOINTERPROC glad_glTexCoordPointer;
2908 #define glTexCoordPointer glad_glTexCoordPointer
2909 GLAD_API_CALL PFNGLTEXENVFPROC glad_glTexEnvf;
2910 #define glTexEnvf glad_glTexEnvf
2911 GLAD_API_CALL PFNGLTEXENVFVPROC glad_glTexEnvfv;
2912 #define glTexEnvfv glad_glTexEnvfv
2913 GLAD_API_CALL PFNGLTEXENVIPROC glad_glTexEnvi;
2914 #define glTexEnvi glad_glTexEnvi
2915 GLAD_API_CALL PFNGLTEXENVIVPROC glad_glTexEnviv;
2916 #define glTexEnviv glad_glTexEnviv
2917 GLAD_API_CALL PFNGLTEXGENDPROC glad_glTexGend;
2918 #define glTexGend glad_glTexGend
2919 GLAD_API_CALL PFNGLTEXGENDVPROC glad_glTexGendv;
2920 #define glTexGendv glad_glTexGendv
2921 GLAD_API_CALL PFNGLTEXGENFPROC glad_glTexGenf;
2922 #define glTexGenf glad_glTexGenf
2923 GLAD_API_CALL PFNGLTEXGENFVPROC glad_glTexGenfv;
2924 #define glTexGenfv glad_glTexGenfv
2925 GLAD_API_CALL PFNGLTEXGENIPROC glad_glTexGeni;
2926 #define glTexGeni glad_glTexGeni
2927 GLAD_API_CALL PFNGLTEXGENIVPROC glad_glTexGeniv;
2928 #define glTexGeniv glad_glTexGeniv
2929 GLAD_API_CALL PFNGLTEXIMAGE1DPROC glad_glTexImage1D;
2930 #define glTexImage1D glad_glTexImage1D
2931 GLAD_API_CALL PFNGLTEXIMAGE2DPROC glad_glTexImage2D;
2932 #define glTexImage2D glad_glTexImage2D
2933 GLAD_API_CALL PFNGLTEXIMAGE3DPROC glad_glTexImage3D;
2934 #define glTexImage3D glad_glTexImage3D
2935 GLAD_API_CALL PFNGLTEXPARAMETERFPROC glad_glTexParameterf;
2936 #define glTexParameterf glad_glTexParameterf
2937 GLAD_API_CALL PFNGLTEXPARAMETERFVPROC glad_glTexParameterfv;
2938 #define glTexParameterfv glad_glTexParameterfv
2939 GLAD_API_CALL PFNGLTEXPARAMETERIPROC glad_glTexParameteri;
2940 #define glTexParameteri glad_glTexParameteri
2941 GLAD_API_CALL PFNGLTEXPARAMETERIVPROC glad_glTexParameteriv;
2942 #define glTexParameteriv glad_glTexParameteriv
2943 GLAD_API_CALL PFNGLTEXSUBIMAGE1DPROC glad_glTexSubImage1D;
2944 #define glTexSubImage1D glad_glTexSubImage1D
2945 GLAD_API_CALL PFNGLTEXSUBIMAGE2DPROC glad_glTexSubImage2D;
2946 #define glTexSubImage2D glad_glTexSubImage2D
2947 GLAD_API_CALL PFNGLTEXSUBIMAGE3DPROC glad_glTexSubImage3D;
2948 #define glTexSubImage3D glad_glTexSubImage3D
2949 GLAD_API_CALL PFNGLTRANSLATEDPROC glad_glTranslated;
2950 #define glTranslated glad_glTranslated
2951 GLAD_API_CALL PFNGLTRANSLATEFPROC glad_glTranslatef;
2952 #define glTranslatef glad_glTranslatef
2953 GLAD_API_CALL PFNGLUNIFORM1FPROC glad_glUniform1f;
2954 #define glUniform1f glad_glUniform1f
2955 GLAD_API_CALL PFNGLUNIFORM1FVPROC glad_glUniform1fv;
2956 #define glUniform1fv glad_glUniform1fv
2957 GLAD_API_CALL PFNGLUNIFORM1IPROC glad_glUniform1i;
2958 #define glUniform1i glad_glUniform1i
2959 GLAD_API_CALL PFNGLUNIFORM1IVPROC glad_glUniform1iv;
2960 #define glUniform1iv glad_glUniform1iv
2961 GLAD_API_CALL PFNGLUNIFORM2FPROC glad_glUniform2f;
2962 #define glUniform2f glad_glUniform2f
2963 GLAD_API_CALL PFNGLUNIFORM2FVPROC glad_glUniform2fv;
2964 #define glUniform2fv glad_glUniform2fv
2965 GLAD_API_CALL PFNGLUNIFORM2IPROC glad_glUniform2i;
2966 #define glUniform2i glad_glUniform2i
2967 GLAD_API_CALL PFNGLUNIFORM2IVPROC glad_glUniform2iv;
2968 #define glUniform2iv glad_glUniform2iv
2969 GLAD_API_CALL PFNGLUNIFORM3FPROC glad_glUniform3f;
2970 #define glUniform3f glad_glUniform3f
2971 GLAD_API_CALL PFNGLUNIFORM3FVPROC glad_glUniform3fv;
2972 #define glUniform3fv glad_glUniform3fv
2973 GLAD_API_CALL PFNGLUNIFORM3IPROC glad_glUniform3i;
2974 #define glUniform3i glad_glUniform3i
2975 GLAD_API_CALL PFNGLUNIFORM3IVPROC glad_glUniform3iv;
2976 #define glUniform3iv glad_glUniform3iv
2977 GLAD_API_CALL PFNGLUNIFORM4FPROC glad_glUniform4f;
2978 #define glUniform4f glad_glUniform4f
2979 GLAD_API_CALL PFNGLUNIFORM4FVPROC glad_glUniform4fv;
2980 #define glUniform4fv glad_glUniform4fv
2981 GLAD_API_CALL PFNGLUNIFORM4IPROC glad_glUniform4i;
2982 #define glUniform4i glad_glUniform4i
2983 GLAD_API_CALL PFNGLUNIFORM4IVPROC glad_glUniform4iv;
2984 #define glUniform4iv glad_glUniform4iv
2985 GLAD_API_CALL PFNGLUNIFORMMATRIX2FVPROC glad_glUniformMatrix2fv;
2986 #define glUniformMatrix2fv glad_glUniformMatrix2fv
2987 GLAD_API_CALL PFNGLUNIFORMMATRIX3FVPROC glad_glUniformMatrix3fv;
2988 #define glUniformMatrix3fv glad_glUniformMatrix3fv
2989 GLAD_API_CALL PFNGLUNIFORMMATRIX4FVPROC glad_glUniformMatrix4fv;
2990 #define glUniformMatrix4fv glad_glUniformMatrix4fv
2991 GLAD_API_CALL PFNGLUNMAPBUFFERPROC glad_glUnmapBuffer;
2992 #define glUnmapBuffer glad_glUnmapBuffer
2993 GLAD_API_CALL PFNGLUSEPROGRAMPROC glad_glUseProgram;
2994 #define glUseProgram glad_glUseProgram
2995 GLAD_API_CALL PFNGLVALIDATEPROGRAMPROC glad_glValidateProgram;
2996 #define glValidateProgram glad_glValidateProgram
2997 GLAD_API_CALL PFNGLVERTEX2DPROC glad_glVertex2d;
2998 #define glVertex2d glad_glVertex2d
2999 GLAD_API_CALL PFNGLVERTEX2DVPROC glad_glVertex2dv;
3000 #define glVertex2dv glad_glVertex2dv
3001 GLAD_API_CALL PFNGLVERTEX2FPROC glad_glVertex2f;
3002 #define glVertex2f glad_glVertex2f
3003 GLAD_API_CALL PFNGLVERTEX2FVPROC glad_glVertex2fv;
3004 #define glVertex2fv glad_glVertex2fv
3005 GLAD_API_CALL PFNGLVERTEX2IPROC glad_glVertex2i;
3006 #define glVertex2i glad_glVertex2i
3007 GLAD_API_CALL PFNGLVERTEX2IVPROC glad_glVertex2iv;
3008 #define glVertex2iv glad_glVertex2iv
3009 GLAD_API_CALL PFNGLVERTEX2SPROC glad_glVertex2s;
3010 #define glVertex2s glad_glVertex2s
3011 GLAD_API_CALL PFNGLVERTEX2SVPROC glad_glVertex2sv;
3012 #define glVertex2sv glad_glVertex2sv
3013 GLAD_API_CALL PFNGLVERTEX3DPROC glad_glVertex3d;
3014 #define glVertex3d glad_glVertex3d
3015 GLAD_API_CALL PFNGLVERTEX3DVPROC glad_glVertex3dv;
3016 #define glVertex3dv glad_glVertex3dv
3017 GLAD_API_CALL PFNGLVERTEX3FPROC glad_glVertex3f;
3018 #define glVertex3f glad_glVertex3f
3019 GLAD_API_CALL PFNGLVERTEX3FVPROC glad_glVertex3fv;
3020 #define glVertex3fv glad_glVertex3fv
3021 GLAD_API_CALL PFNGLVERTEX3IPROC glad_glVertex3i;
3022 #define glVertex3i glad_glVertex3i
3023 GLAD_API_CALL PFNGLVERTEX3IVPROC glad_glVertex3iv;
3024 #define glVertex3iv glad_glVertex3iv
3025 GLAD_API_CALL PFNGLVERTEX3SPROC glad_glVertex3s;
3026 #define glVertex3s glad_glVertex3s
3027 GLAD_API_CALL PFNGLVERTEX3SVPROC glad_glVertex3sv;
3028 #define glVertex3sv glad_glVertex3sv
3029 GLAD_API_CALL PFNGLVERTEX4DPROC glad_glVertex4d;
3030 #define glVertex4d glad_glVertex4d
3031 GLAD_API_CALL PFNGLVERTEX4DVPROC glad_glVertex4dv;
3032 #define glVertex4dv glad_glVertex4dv
3033 GLAD_API_CALL PFNGLVERTEX4FPROC glad_glVertex4f;
3034 #define glVertex4f glad_glVertex4f
3035 GLAD_API_CALL PFNGLVERTEX4FVPROC glad_glVertex4fv;
3036 #define glVertex4fv glad_glVertex4fv
3037 GLAD_API_CALL PFNGLVERTEX4IPROC glad_glVertex4i;
3038 #define glVertex4i glad_glVertex4i
3039 GLAD_API_CALL PFNGLVERTEX4IVPROC glad_glVertex4iv;
3040 #define glVertex4iv glad_glVertex4iv
3041 GLAD_API_CALL PFNGLVERTEX4SPROC glad_glVertex4s;
3042 #define glVertex4s glad_glVertex4s
3043 GLAD_API_CALL PFNGLVERTEX4SVPROC glad_glVertex4sv;
3044 #define glVertex4sv glad_glVertex4sv
3045 GLAD_API_CALL PFNGLVERTEXATTRIB1DPROC glad_glVertexAttrib1d;
3046 #define glVertexAttrib1d glad_glVertexAttrib1d
3047 GLAD_API_CALL PFNGLVERTEXATTRIB1DVPROC glad_glVertexAttrib1dv;
3048 #define glVertexAttrib1dv glad_glVertexAttrib1dv
3049 GLAD_API_CALL PFNGLVERTEXATTRIB1FPROC glad_glVertexAttrib1f;
3050 #define glVertexAttrib1f glad_glVertexAttrib1f
3051 GLAD_API_CALL PFNGLVERTEXATTRIB1FVPROC glad_glVertexAttrib1fv;
3052 #define glVertexAttrib1fv glad_glVertexAttrib1fv
3053 GLAD_API_CALL PFNGLVERTEXATTRIB1SPROC glad_glVertexAttrib1s;
3054 #define glVertexAttrib1s glad_glVertexAttrib1s
3055 GLAD_API_CALL PFNGLVERTEXATTRIB1SVPROC glad_glVertexAttrib1sv;
3056 #define glVertexAttrib1sv glad_glVertexAttrib1sv
3057 GLAD_API_CALL PFNGLVERTEXATTRIB2DPROC glad_glVertexAttrib2d;
3058 #define glVertexAttrib2d glad_glVertexAttrib2d
3059 GLAD_API_CALL PFNGLVERTEXATTRIB2DVPROC glad_glVertexAttrib2dv;
3060 #define glVertexAttrib2dv glad_glVertexAttrib2dv
3061 GLAD_API_CALL PFNGLVERTEXATTRIB2FPROC glad_glVertexAttrib2f;
3062 #define glVertexAttrib2f glad_glVertexAttrib2f
3063 GLAD_API_CALL PFNGLVERTEXATTRIB2FVPROC glad_glVertexAttrib2fv;
3064 #define glVertexAttrib2fv glad_glVertexAttrib2fv
3065 GLAD_API_CALL PFNGLVERTEXATTRIB2SPROC glad_glVertexAttrib2s;
3066 #define glVertexAttrib2s glad_glVertexAttrib2s
3067 GLAD_API_CALL PFNGLVERTEXATTRIB2SVPROC glad_glVertexAttrib2sv;
3068 #define glVertexAttrib2sv glad_glVertexAttrib2sv
3069 GLAD_API_CALL PFNGLVERTEXATTRIB3DPROC glad_glVertexAttrib3d;
3070 #define glVertexAttrib3d glad_glVertexAttrib3d
3071 GLAD_API_CALL PFNGLVERTEXATTRIB3DVPROC glad_glVertexAttrib3dv;
3072 #define glVertexAttrib3dv glad_glVertexAttrib3dv
3073 GLAD_API_CALL PFNGLVERTEXATTRIB3FPROC glad_glVertexAttrib3f;
3074 #define glVertexAttrib3f glad_glVertexAttrib3f
3075 GLAD_API_CALL PFNGLVERTEXATTRIB3FVPROC glad_glVertexAttrib3fv;
3076 #define glVertexAttrib3fv glad_glVertexAttrib3fv
3077 GLAD_API_CALL PFNGLVERTEXATTRIB3SPROC glad_glVertexAttrib3s;
3078 #define glVertexAttrib3s glad_glVertexAttrib3s
3079 GLAD_API_CALL PFNGLVERTEXATTRIB3SVPROC glad_glVertexAttrib3sv;
3080 #define glVertexAttrib3sv glad_glVertexAttrib3sv
3081 GLAD_API_CALL PFNGLVERTEXATTRIB4NBVPROC glad_glVertexAttrib4Nbv;
3082 #define glVertexAttrib4Nbv glad_glVertexAttrib4Nbv
3083 GLAD_API_CALL PFNGLVERTEXATTRIB4NIVPROC glad_glVertexAttrib4Niv;
3084 #define glVertexAttrib4Niv glad_glVertexAttrib4Niv
3085 GLAD_API_CALL PFNGLVERTEXATTRIB4NSVPROC glad_glVertexAttrib4Nsv;
3086 #define glVertexAttrib4Nsv glad_glVertexAttrib4Nsv
3087 GLAD_API_CALL PFNGLVERTEXATTRIB4NUBPROC glad_glVertexAttrib4Nub;
3088 #define glVertexAttrib4Nub glad_glVertexAttrib4Nub
3089 GLAD_API_CALL PFNGLVERTEXATTRIB4NUBVPROC glad_glVertexAttrib4Nubv;
3090 #define glVertexAttrib4Nubv glad_glVertexAttrib4Nubv
3091 GLAD_API_CALL PFNGLVERTEXATTRIB4NUIVPROC glad_glVertexAttrib4Nuiv;
3092 #define glVertexAttrib4Nuiv glad_glVertexAttrib4Nuiv
3093 GLAD_API_CALL PFNGLVERTEXATTRIB4NUSVPROC glad_glVertexAttrib4Nusv;
3094 #define glVertexAttrib4Nusv glad_glVertexAttrib4Nusv
3095 GLAD_API_CALL PFNGLVERTEXATTRIB4BVPROC glad_glVertexAttrib4bv;
3096 #define glVertexAttrib4bv glad_glVertexAttrib4bv
3097 GLAD_API_CALL PFNGLVERTEXATTRIB4DPROC glad_glVertexAttrib4d;
3098 #define glVertexAttrib4d glad_glVertexAttrib4d
3099 GLAD_API_CALL PFNGLVERTEXATTRIB4DVPROC glad_glVertexAttrib4dv;
3100 #define glVertexAttrib4dv glad_glVertexAttrib4dv
3101 GLAD_API_CALL PFNGLVERTEXATTRIB4FPROC glad_glVertexAttrib4f;
3102 #define glVertexAttrib4f glad_glVertexAttrib4f
3103 GLAD_API_CALL PFNGLVERTEXATTRIB4FVPROC glad_glVertexAttrib4fv;
3104 #define glVertexAttrib4fv glad_glVertexAttrib4fv
3105 GLAD_API_CALL PFNGLVERTEXATTRIB4IVPROC glad_glVertexAttrib4iv;
3106 #define glVertexAttrib4iv glad_glVertexAttrib4iv
3107 GLAD_API_CALL PFNGLVERTEXATTRIB4SPROC glad_glVertexAttrib4s;
3108 #define glVertexAttrib4s glad_glVertexAttrib4s
3109 GLAD_API_CALL PFNGLVERTEXATTRIB4SVPROC glad_glVertexAttrib4sv;
3110 #define glVertexAttrib4sv glad_glVertexAttrib4sv
3111 GLAD_API_CALL PFNGLVERTEXATTRIB4UBVPROC glad_glVertexAttrib4ubv;
3112 #define glVertexAttrib4ubv glad_glVertexAttrib4ubv
3113 GLAD_API_CALL PFNGLVERTEXATTRIB4UIVPROC glad_glVertexAttrib4uiv;
3114 #define glVertexAttrib4uiv glad_glVertexAttrib4uiv
3115 GLAD_API_CALL PFNGLVERTEXATTRIB4USVPROC glad_glVertexAttrib4usv;
3116 #define glVertexAttrib4usv glad_glVertexAttrib4usv
3117 GLAD_API_CALL PFNGLVERTEXATTRIBPOINTERPROC glad_glVertexAttribPointer;
3118 #define glVertexAttribPointer glad_glVertexAttribPointer
3119 GLAD_API_CALL PFNGLVERTEXPOINTERPROC glad_glVertexPointer;
3120 #define glVertexPointer glad_glVertexPointer
3121 GLAD_API_CALL PFNGLVIEWPORTPROC glad_glViewport;
3122 #define glViewport glad_glViewport
3123 GLAD_API_CALL PFNGLWINDOWPOS2DPROC glad_glWindowPos2d;
3124 #define glWindowPos2d glad_glWindowPos2d
3125 GLAD_API_CALL PFNGLWINDOWPOS2DVPROC glad_glWindowPos2dv;
3126 #define glWindowPos2dv glad_glWindowPos2dv
3127 GLAD_API_CALL PFNGLWINDOWPOS2FPROC glad_glWindowPos2f;
3128 #define glWindowPos2f glad_glWindowPos2f
3129 GLAD_API_CALL PFNGLWINDOWPOS2FVPROC glad_glWindowPos2fv;
3130 #define glWindowPos2fv glad_glWindowPos2fv
3131 GLAD_API_CALL PFNGLWINDOWPOS2IPROC glad_glWindowPos2i;
3132 #define glWindowPos2i glad_glWindowPos2i
3133 GLAD_API_CALL PFNGLWINDOWPOS2IVPROC glad_glWindowPos2iv;
3134 #define glWindowPos2iv glad_glWindowPos2iv
3135 GLAD_API_CALL PFNGLWINDOWPOS2SPROC glad_glWindowPos2s;
3136 #define glWindowPos2s glad_glWindowPos2s
3137 GLAD_API_CALL PFNGLWINDOWPOS2SVPROC glad_glWindowPos2sv;
3138 #define glWindowPos2sv glad_glWindowPos2sv
3139 GLAD_API_CALL PFNGLWINDOWPOS3DPROC glad_glWindowPos3d;
3140 #define glWindowPos3d glad_glWindowPos3d
3141 GLAD_API_CALL PFNGLWINDOWPOS3DVPROC glad_glWindowPos3dv;
3142 #define glWindowPos3dv glad_glWindowPos3dv
3143 GLAD_API_CALL PFNGLWINDOWPOS3FPROC glad_glWindowPos3f;
3144 #define glWindowPos3f glad_glWindowPos3f
3145 GLAD_API_CALL PFNGLWINDOWPOS3FVPROC glad_glWindowPos3fv;
3146 #define glWindowPos3fv glad_glWindowPos3fv
3147 GLAD_API_CALL PFNGLWINDOWPOS3IPROC glad_glWindowPos3i;
3148 #define glWindowPos3i glad_glWindowPos3i
3149 GLAD_API_CALL PFNGLWINDOWPOS3IVPROC glad_glWindowPos3iv;
3150 #define glWindowPos3iv glad_glWindowPos3iv
3151 GLAD_API_CALL PFNGLWINDOWPOS3SPROC glad_glWindowPos3s;
3152 #define glWindowPos3s glad_glWindowPos3s
3153 GLAD_API_CALL PFNGLWINDOWPOS3SVPROC glad_glWindowPos3sv;
3154 #define glWindowPos3sv glad_glWindowPos3sv
3155
3156
3157 GLAD_API_CALL int gladLoadGLUserPtr( GLADuserptrloadfunc load, void *userptr);
3158 GLAD_API_CALL int gladLoadGL( GLADloadfunc load);
3159
3160
3161
3162
3163
3164
3165 #ifdef __cplusplus
3166 }
3167 #endif
3168 #endif
3169
3170 /* Source */
3171 #ifdef GLAD_GL_IMPLEMENTATION
3172 #include <stdio.h>
3173 #include <stdlib.h>
3174 #include <string.h>
3175
3176 #ifndef GLAD_IMPL_UTIL_C_
3177 #define GLAD_IMPL_UTIL_C_
3178
3179 #ifdef _MSC_VER
3180 #define GLAD_IMPL_UTIL_SSCANF sscanf_s
3181 #else
3182 #define GLAD_IMPL_UTIL_SSCANF sscanf
3183 #endif
3184
3185 #endif /* GLAD_IMPL_UTIL_C_ */
3186
3187
3188 int GLAD_GL_VERSION_1_0 = 0;
3189 int GLAD_GL_VERSION_1_1 = 0;
3190 int GLAD_GL_VERSION_1_2 = 0;
3191 int GLAD_GL_VERSION_1_3 = 0;
3192 int GLAD_GL_VERSION_1_4 = 0;
3193 int GLAD_GL_VERSION_1_5 = 0;
3194 int GLAD_GL_VERSION_2_0 = 0;
3195 int GLAD_GL_EXT_framebuffer_object = 0;
3196
3197
3198
3199 PFNGLACCUMPROC glad_glAccum = NULL;
3200 PFNGLACTIVETEXTUREPROC glad_glActiveTexture = NULL;
3201 PFNGLALPHAFUNCPROC glad_glAlphaFunc = NULL;
3202 PFNGLARETEXTURESRESIDENTPROC glad_glAreTexturesResident = NULL;
3203 PFNGLARRAYELEMENTPROC glad_glArrayElement = NULL;
3204 PFNGLATTACHSHADERPROC glad_glAttachShader = NULL;
3205 PFNGLBEGINPROC glad_glBegin = NULL;
3206 PFNGLBEGINQUERYPROC glad_glBeginQuery = NULL;
3207 PFNGLBINDATTRIBLOCATIONPROC glad_glBindAttribLocation = NULL;
3208 PFNGLBINDBUFFERPROC glad_glBindBuffer = NULL;
3209 PFNGLBINDFRAMEBUFFEREXTPROC glad_glBindFramebufferEXT = NULL;
3210 PFNGLBINDRENDERBUFFEREXTPROC glad_glBindRenderbufferEXT = NULL;
3211 PFNGLBINDTEXTUREPROC glad_glBindTexture = NULL;
3212 PFNGLBITMAPPROC glad_glBitmap = NULL;
3213 PFNGLBLENDCOLORPROC glad_glBlendColor = NULL;
3214 PFNGLBLENDEQUATIONPROC glad_glBlendEquation = NULL;
3215 PFNGLBLENDEQUATIONSEPARATEPROC glad_glBlendEquationSeparate = NULL;
3216 PFNGLBLENDFUNCPROC glad_glBlendFunc = NULL;
3217 PFNGLBLENDFUNCSEPARATEPROC glad_glBlendFuncSeparate = NULL;
3218 PFNGLBUFFERDATAPROC glad_glBufferData = NULL;
3219 PFNGLBUFFERSUBDATAPROC glad_glBufferSubData = NULL;
3220 PFNGLCALLLISTPROC glad_glCallList = NULL;
3221 PFNGLCALLLISTSPROC glad_glCallLists = NULL;
3222 PFNGLCHECKFRAMEBUFFERSTATUSPROC glad_glCheckFramebufferStatus = NULL;
3223 PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC glad_glCheckFramebufferStatusEXT = NULL;
3224 PFNGLCLEARPROC glad_glClear = NULL;
3225 PFNGLCLEARACCUMPROC glad_glClearAccum = NULL;
3226 PFNGLCLEARCOLORPROC glad_glClearColor = NULL;
3227 PFNGLCLEARDEPTHPROC glad_glClearDepth = NULL;
3228 PFNGLCLEARINDEXPROC glad_glClearIndex = NULL;
3229 PFNGLCLEARSTENCILPROC glad_glClearStencil = NULL;
3230 PFNGLCLIENTACTIVETEXTUREPROC glad_glClientActiveTexture = NULL;
3231 PFNGLCLIPPLANEPROC glad_glClipPlane = NULL;
3232 PFNGLCOLOR3BPROC glad_glColor3b = NULL;
3233 PFNGLCOLOR3BVPROC glad_glColor3bv = NULL;
3234 PFNGLCOLOR3DPROC glad_glColor3d = NULL;
3235 PFNGLCOLOR3DVPROC glad_glColor3dv = NULL;
3236 PFNGLCOLOR3FPROC glad_glColor3f = NULL;
3237 PFNGLCOLOR3FVPROC glad_glColor3fv = NULL;
3238 PFNGLCOLOR3IPROC glad_glColor3i = NULL;
3239 PFNGLCOLOR3IVPROC glad_glColor3iv = NULL;
3240 PFNGLCOLOR3SPROC glad_glColor3s = NULL;
3241 PFNGLCOLOR3SVPROC glad_glColor3sv = NULL;
3242 PFNGLCOLOR3UBPROC glad_glColor3ub = NULL;
3243 PFNGLCOLOR3UBVPROC glad_glColor3ubv = NULL;
3244 PFNGLCOLOR3UIPROC glad_glColor3ui = NULL;
3245 PFNGLCOLOR3UIVPROC glad_glColor3uiv = NULL;
3246 PFNGLCOLOR3USPROC glad_glColor3us = NULL;
3247 PFNGLCOLOR3USVPROC glad_glColor3usv = NULL;
3248 PFNGLCOLOR4BPROC glad_glColor4b = NULL;
3249 PFNGLCOLOR4BVPROC glad_glColor4bv = NULL;
3250 PFNGLCOLOR4DPROC glad_glColor4d = NULL;
3251 PFNGLCOLOR4DVPROC glad_glColor4dv = NULL;
3252 PFNGLCOLOR4FPROC glad_glColor4f = NULL;
3253 PFNGLCOLOR4FVPROC glad_glColor4fv = NULL;
3254 PFNGLCOLOR4IPROC glad_glColor4i = NULL;
3255 PFNGLCOLOR4IVPROC glad_glColor4iv = NULL;
3256 PFNGLCOLOR4SPROC glad_glColor4s = NULL;
3257 PFNGLCOLOR4SVPROC glad_glColor4sv = NULL;
3258 PFNGLCOLOR4UBPROC glad_glColor4ub = NULL;
3259 PFNGLCOLOR4UBVPROC glad_glColor4ubv = NULL;
3260 PFNGLCOLOR4UIPROC glad_glColor4ui = NULL;
3261 PFNGLCOLOR4UIVPROC glad_glColor4uiv = NULL;
3262 PFNGLCOLOR4USPROC glad_glColor4us = NULL;
3263 PFNGLCOLOR4USVPROC glad_glColor4usv = NULL;
3264 PFNGLCOLORMASKPROC glad_glColorMask = NULL;
3265 PFNGLCOLORMATERIALPROC glad_glColorMaterial = NULL;
3266 PFNGLCOLORPOINTERPROC glad_glColorPointer = NULL;
3267 PFNGLCOMPILESHADERPROC glad_glCompileShader = NULL;
3268 PFNGLCOMPRESSEDTEXIMAGE1DPROC glad_glCompressedTexImage1D = NULL;
3269 PFNGLCOMPRESSEDTEXIMAGE2DPROC glad_glCompressedTexImage2D = NULL;
3270 PFNGLCOMPRESSEDTEXIMAGE3DPROC glad_glCompressedTexImage3D = NULL;
3271 PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC glad_glCompressedTexSubImage1D = NULL;
3272 PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glad_glCompressedTexSubImage2D = NULL;
3273 PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glad_glCompressedTexSubImage3D = NULL;
3274 PFNGLCOPYPIXELSPROC glad_glCopyPixels = NULL;
3275 PFNGLCOPYTEXIMAGE1DPROC glad_glCopyTexImage1D = NULL;
3276 PFNGLCOPYTEXIMAGE2DPROC glad_glCopyTexImage2D = NULL;
3277 PFNGLCOPYTEXSUBIMAGE1DPROC glad_glCopyTexSubImage1D = NULL;
3278 PFNGLCOPYTEXSUBIMAGE2DPROC glad_glCopyTexSubImage2D = NULL;
3279 PFNGLCOPYTEXSUBIMAGE3DPROC glad_glCopyTexSubImage3D = NULL;
3280 PFNGLCREATEPROGRAMPROC glad_glCreateProgram = NULL;
3281 PFNGLCREATESHADERPROC glad_glCreateShader = NULL;
3282 PFNGLCULLFACEPROC glad_glCullFace = NULL;
3283 PFNGLDELETEBUFFERSPROC glad_glDeleteBuffers = NULL;
3284 PFNGLDELETEFRAMEBUFFERSPROC glad_glDeleteFramebuffers = NULL;
3285 PFNGLDELETEFRAMEBUFFERSEXTPROC glad_glDeleteFramebuffersEXT = NULL;
3286 PFNGLDELETELISTSPROC glad_glDeleteLists = NULL;
3287 PFNGLDELETEPROGRAMPROC glad_glDeleteProgram = NULL;
3288 PFNGLDELETEQUERIESPROC glad_glDeleteQueries = NULL;
3289 PFNGLDELETERENDERBUFFERSPROC glad_glDeleteRenderbuffers = NULL;
3290 PFNGLDELETERENDERBUFFERSEXTPROC glad_glDeleteRenderbuffersEXT = NULL;
3291 PFNGLDELETESHADERPROC glad_glDeleteShader = NULL;
3292 PFNGLDELETETEXTURESPROC glad_glDeleteTextures = NULL;
3293 PFNGLDEPTHFUNCPROC glad_glDepthFunc = NULL;
3294 PFNGLDEPTHMASKPROC glad_glDepthMask = NULL;
3295 PFNGLDEPTHRANGEPROC glad_glDepthRange = NULL;
3296 PFNGLDETACHSHADERPROC glad_glDetachShader = NULL;
3297 PFNGLDISABLEPROC glad_glDisable = NULL;
3298 PFNGLDISABLECLIENTSTATEPROC glad_glDisableClientState = NULL;
3299 PFNGLDISABLEVERTEXATTRIBARRAYPROC glad_glDisableVertexAttribArray = NULL;
3300 PFNGLDRAWARRAYSPROC glad_glDrawArrays = NULL;
3301 PFNGLDRAWBUFFERPROC glad_glDrawBuffer = NULL;
3302 PFNGLDRAWBUFFERSPROC glad_glDrawBuffers = NULL;
3303 PFNGLDRAWELEMENTSPROC glad_glDrawElements = NULL;
3304 PFNGLDRAWPIXELSPROC glad_glDrawPixels = NULL;
3305 PFNGLDRAWRANGEELEMENTSPROC glad_glDrawRangeElements = NULL;
3306 PFNGLEDGEFLAGPROC glad_glEdgeFlag = NULL;
3307 PFNGLEDGEFLAGPOINTERPROC glad_glEdgeFlagPointer = NULL;
3308 PFNGLEDGEFLAGVPROC glad_glEdgeFlagv = NULL;
3309 PFNGLENABLEPROC glad_glEnable = NULL;
3310 PFNGLENABLECLIENTSTATEPROC glad_glEnableClientState = NULL;
3311 PFNGLENABLEVERTEXATTRIBARRAYPROC glad_glEnableVertexAttribArray = NULL;
3312 PFNGLENDPROC glad_glEnd = NULL;
3313 PFNGLENDLISTPROC glad_glEndList = NULL;
3314 PFNGLENDQUERYPROC glad_glEndQuery = NULL;
3315 PFNGLEVALCOORD1DPROC glad_glEvalCoord1d = NULL;
3316 PFNGLEVALCOORD1DVPROC glad_glEvalCoord1dv = NULL;
3317 PFNGLEVALCOORD1FPROC glad_glEvalCoord1f = NULL;
3318 PFNGLEVALCOORD1FVPROC glad_glEvalCoord1fv = NULL;
3319 PFNGLEVALCOORD2DPROC glad_glEvalCoord2d = NULL;
3320 PFNGLEVALCOORD2DVPROC glad_glEvalCoord2dv = NULL;
3321 PFNGLEVALCOORD2FPROC glad_glEvalCoord2f = NULL;
3322 PFNGLEVALCOORD2FVPROC glad_glEvalCoord2fv = NULL;
3323 PFNGLEVALMESH1PROC glad_glEvalMesh1 = NULL;
3324 PFNGLEVALMESH2PROC glad_glEvalMesh2 = NULL;
3325 PFNGLEVALPOINT1PROC glad_glEvalPoint1 = NULL;
3326 PFNGLEVALPOINT2PROC glad_glEvalPoint2 = NULL;
3327 PFNGLFEEDBACKBUFFERPROC glad_glFeedbackBuffer = NULL;
3328 PFNGLFINISHPROC glad_glFinish = NULL;
3329 PFNGLFLUSHPROC glad_glFlush = NULL;
3330 PFNGLFOGCOORDPOINTERPROC glad_glFogCoordPointer = NULL;
3331 PFNGLFOGCOORDDPROC glad_glFogCoordd = NULL;
3332 PFNGLFOGCOORDDVPROC glad_glFogCoorddv = NULL;
3333 PFNGLFOGCOORDFPROC glad_glFogCoordf = NULL;
3334 PFNGLFOGCOORDFVPROC glad_glFogCoordfv = NULL;
3335 PFNGLFOGFPROC glad_glFogf = NULL;
3336 PFNGLFOGFVPROC glad_glFogfv = NULL;
3337 PFNGLFOGIPROC glad_glFogi = NULL;
3338 PFNGLFOGIVPROC glad_glFogiv = NULL;
3339 PFNGLFRAMEBUFFERRENDERBUFFERPROC glad_glFramebufferRenderbuffer = NULL;
3340 PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC glad_glFramebufferRenderbufferEXT = NULL;
3341 PFNGLFRAMEBUFFERTEXTURE1DPROC glad_glFramebufferTexture1D = NULL;
3342 PFNGLFRAMEBUFFERTEXTURE1DEXTPROC glad_glFramebufferTexture1DEXT = NULL;
3343 PFNGLFRAMEBUFFERTEXTURE2DPROC glad_glFramebufferTexture2D = NULL;
3344 PFNGLFRAMEBUFFERTEXTURE2DEXTPROC glad_glFramebufferTexture2DEXT = NULL;
3345 PFNGLFRAMEBUFFERTEXTURE3DPROC glad_glFramebufferTexture3D = NULL;
3346 PFNGLFRAMEBUFFERTEXTURE3DEXTPROC glad_glFramebufferTexture3DEXT = NULL;
3347 PFNGLFRONTFACEPROC glad_glFrontFace = NULL;
3348 PFNGLFRUSTUMPROC glad_glFrustum = NULL;
3349 PFNGLGENBUFFERSPROC glad_glGenBuffers = NULL;
3350 PFNGLGENFRAMEBUFFERSPROC glad_glGenFramebuffers = NULL;
3351 PFNGLGENFRAMEBUFFERSEXTPROC glad_glGenFramebuffersEXT = NULL;
3352 PFNGLGENLISTSPROC glad_glGenLists = NULL;
3353 PFNGLGENQUERIESPROC glad_glGenQueries = NULL;
3354 PFNGLGENRENDERBUFFERSPROC glad_glGenRenderbuffers = NULL;
3355 PFNGLGENRENDERBUFFERSEXTPROC glad_glGenRenderbuffersEXT = NULL;
3356 PFNGLGENTEXTURESPROC glad_glGenTextures = NULL;
3357 PFNGLGENERATEMIPMAPPROC glad_glGenerateMipmap = NULL;
3358 PFNGLGENERATEMIPMAPEXTPROC glad_glGenerateMipmapEXT = NULL;
3359 PFNGLGETACTIVEATTRIBPROC glad_glGetActiveAttrib = NULL;
3360 PFNGLGETACTIVEUNIFORMPROC glad_glGetActiveUniform = NULL;
3361 PFNGLGETATTACHEDSHADERSPROC glad_glGetAttachedShaders = NULL;
3362 PFNGLGETATTRIBLOCATIONPROC glad_glGetAttribLocation = NULL;
3363 PFNGLGETBOOLEANVPROC glad_glGetBooleanv = NULL;
3364 PFNGLGETBUFFERPARAMETERIVPROC glad_glGetBufferParameteriv = NULL;
3365 PFNGLGETBUFFERPOINTERVPROC glad_glGetBufferPointerv = NULL;
3366 PFNGLGETBUFFERSUBDATAPROC glad_glGetBufferSubData = NULL;
3367 PFNGLGETCLIPPLANEPROC glad_glGetClipPlane = NULL;
3368 PFNGLGETCOMPRESSEDTEXIMAGEPROC glad_glGetCompressedTexImage = NULL;
3369 PFNGLGETDOUBLEVPROC glad_glGetDoublev = NULL;
3370 PFNGLGETERRORPROC glad_glGetError = NULL;
3371 PFNGLGETFLOATVPROC glad_glGetFloatv = NULL;
3372 PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetFramebufferAttachmentParameteriv = NULL;
3373 PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC glad_glGetFramebufferAttachmentParameterivEXT = NULL;
3374 PFNGLGETINTEGERVPROC glad_glGetIntegerv = NULL;
3375 PFNGLGETLIGHTFVPROC glad_glGetLightfv = NULL;
3376 PFNGLGETLIGHTIVPROC glad_glGetLightiv = NULL;
3377 PFNGLGETMAPDVPROC glad_glGetMapdv = NULL;
3378 PFNGLGETMAPFVPROC glad_glGetMapfv = NULL;
3379 PFNGLGETMAPIVPROC glad_glGetMapiv = NULL;
3380 PFNGLGETMATERIALFVPROC glad_glGetMaterialfv = NULL;
3381 PFNGLGETMATERIALIVPROC glad_glGetMaterialiv = NULL;
3382 PFNGLGETPIXELMAPFVPROC glad_glGetPixelMapfv = NULL;
3383 PFNGLGETPIXELMAPUIVPROC glad_glGetPixelMapuiv = NULL;
3384 PFNGLGETPIXELMAPUSVPROC glad_glGetPixelMapusv = NULL;
3385 PFNGLGETPOINTERVPROC glad_glGetPointerv = NULL;
3386 PFNGLGETPOLYGONSTIPPLEPROC glad_glGetPolygonStipple = NULL;
3387 PFNGLGETPROGRAMINFOLOGPROC glad_glGetProgramInfoLog = NULL;
3388 PFNGLGETPROGRAMIVPROC glad_glGetProgramiv = NULL;
3389 PFNGLGETQUERYOBJECTIVPROC glad_glGetQueryObjectiv = NULL;
3390 PFNGLGETQUERYOBJECTUIVPROC glad_glGetQueryObjectuiv = NULL;
3391 PFNGLGETQUERYIVPROC glad_glGetQueryiv = NULL;
3392 PFNGLGETRENDERBUFFERPARAMETERIVPROC glad_glGetRenderbufferParameteriv = NULL;
3393 PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC glad_glGetRenderbufferParameterivEXT = NULL;
3394 PFNGLGETSHADERINFOLOGPROC glad_glGetShaderInfoLog = NULL;
3395 PFNGLGETSHADERSOURCEPROC glad_glGetShaderSource = NULL;
3396 PFNGLGETSHADERIVPROC glad_glGetShaderiv = NULL;
3397 PFNGLGETSTRINGPROC glad_glGetString = NULL;
3398 PFNGLGETTEXENVFVPROC glad_glGetTexEnvfv = NULL;
3399 PFNGLGETTEXENVIVPROC glad_glGetTexEnviv = NULL;
3400 PFNGLGETTEXGENDVPROC glad_glGetTexGendv = NULL;
3401 PFNGLGETTEXGENFVPROC glad_glGetTexGenfv = NULL;
3402 PFNGLGETTEXGENIVPROC glad_glGetTexGeniv = NULL;
3403 PFNGLGETTEXIMAGEPROC glad_glGetTexImage = NULL;
3404 PFNGLGETTEXLEVELPARAMETERFVPROC glad_glGetTexLevelParameterfv = NULL;
3405 PFNGLGETTEXLEVELPARAMETERIVPROC glad_glGetTexLevelParameteriv = NULL;
3406 PFNGLGETTEXPARAMETERFVPROC glad_glGetTexParameterfv = NULL;
3407 PFNGLGETTEXPARAMETERIVPROC glad_glGetTexParameteriv = NULL;
3408 PFNGLGETUNIFORMLOCATIONPROC glad_glGetUniformLocation = NULL;
3409 PFNGLGETUNIFORMFVPROC glad_glGetUniformfv = NULL;
3410 PFNGLGETUNIFORMIVPROC glad_glGetUniformiv = NULL;
3411 PFNGLGETVERTEXATTRIBPOINTERVPROC glad_glGetVertexAttribPointerv = NULL;
3412 PFNGLGETVERTEXATTRIBDVPROC glad_glGetVertexAttribdv = NULL;
3413 PFNGLGETVERTEXATTRIBFVPROC glad_glGetVertexAttribfv = NULL;
3414 PFNGLGETVERTEXATTRIBIVPROC glad_glGetVertexAttribiv = NULL;
3415 PFNGLHINTPROC glad_glHint = NULL;
3416 PFNGLINDEXMASKPROC glad_glIndexMask = NULL;
3417 PFNGLINDEXPOINTERPROC glad_glIndexPointer = NULL;
3418 PFNGLINDEXDPROC glad_glIndexd = NULL;
3419 PFNGLINDEXDVPROC glad_glIndexdv = NULL;
3420 PFNGLINDEXFPROC glad_glIndexf = NULL;
3421 PFNGLINDEXFVPROC glad_glIndexfv = NULL;
3422 PFNGLINDEXIPROC glad_glIndexi = NULL;
3423 PFNGLINDEXIVPROC glad_glIndexiv = NULL;
3424 PFNGLINDEXSPROC glad_glIndexs = NULL;
3425 PFNGLINDEXSVPROC glad_glIndexsv = NULL;
3426 PFNGLINDEXUBPROC glad_glIndexub = NULL;
3427 PFNGLINDEXUBVPROC glad_glIndexubv = NULL;
3428 PFNGLINITNAMESPROC glad_glInitNames = NULL;
3429 PFNGLINTERLEAVEDARRAYSPROC glad_glInterleavedArrays = NULL;
3430 PFNGLISBUFFERPROC glad_glIsBuffer = NULL;
3431 PFNGLISENABLEDPROC glad_glIsEnabled = NULL;
3432 PFNGLISFRAMEBUFFERPROC glad_glIsFramebuffer = NULL;
3433 PFNGLISFRAMEBUFFEREXTPROC glad_glIsFramebufferEXT = NULL;
3434 PFNGLISLISTPROC glad_glIsList = NULL;
3435 PFNGLISPROGRAMPROC glad_glIsProgram = NULL;
3436 PFNGLISQUERYPROC glad_glIsQuery = NULL;
3437 PFNGLISRENDERBUFFERPROC glad_glIsRenderbuffer = NULL;
3438 PFNGLISRENDERBUFFEREXTPROC glad_glIsRenderbufferEXT = NULL;
3439 PFNGLISSHADERPROC glad_glIsShader = NULL;
3440 PFNGLISTEXTUREPROC glad_glIsTexture = NULL;
3441 PFNGLLIGHTMODELFPROC glad_glLightModelf = NULL;
3442 PFNGLLIGHTMODELFVPROC glad_glLightModelfv = NULL;
3443 PFNGLLIGHTMODELIPROC glad_glLightModeli = NULL;
3444 PFNGLLIGHTMODELIVPROC glad_glLightModeliv = NULL;
3445 PFNGLLIGHTFPROC glad_glLightf = NULL;
3446 PFNGLLIGHTFVPROC glad_glLightfv = NULL;
3447 PFNGLLIGHTIPROC glad_glLighti = NULL;
3448 PFNGLLIGHTIVPROC glad_glLightiv = NULL;
3449 PFNGLLINESTIPPLEPROC glad_glLineStipple = NULL;
3450 PFNGLLINEWIDTHPROC glad_glLineWidth = NULL;
3451 PFNGLLINKPROGRAMPROC glad_glLinkProgram = NULL;
3452 PFNGLLISTBASEPROC glad_glListBase = NULL;
3453 PFNGLLOADIDENTITYPROC glad_glLoadIdentity = NULL;
3454 PFNGLLOADMATRIXDPROC glad_glLoadMatrixd = NULL;
3455 PFNGLLOADMATRIXFPROC glad_glLoadMatrixf = NULL;
3456 PFNGLLOADNAMEPROC glad_glLoadName = NULL;
3457 PFNGLLOADTRANSPOSEMATRIXDPROC glad_glLoadTransposeMatrixd = NULL;
3458 PFNGLLOADTRANSPOSEMATRIXFPROC glad_glLoadTransposeMatrixf = NULL;
3459 PFNGLLOGICOPPROC glad_glLogicOp = NULL;
3460 PFNGLMAP1DPROC glad_glMap1d = NULL;
3461 PFNGLMAP1FPROC glad_glMap1f = NULL;
3462 PFNGLMAP2DPROC glad_glMap2d = NULL;
3463 PFNGLMAP2FPROC glad_glMap2f = NULL;
3464 PFNGLMAPBUFFERPROC glad_glMapBuffer = NULL;
3465 PFNGLMAPGRID1DPROC glad_glMapGrid1d = NULL;
3466 PFNGLMAPGRID1FPROC glad_glMapGrid1f = NULL;
3467 PFNGLMAPGRID2DPROC glad_glMapGrid2d = NULL;
3468 PFNGLMAPGRID2FPROC glad_glMapGrid2f = NULL;
3469 PFNGLMATERIALFPROC glad_glMaterialf = NULL;
3470 PFNGLMATERIALFVPROC glad_glMaterialfv = NULL;
3471 PFNGLMATERIALIPROC glad_glMateriali = NULL;
3472 PFNGLMATERIALIVPROC glad_glMaterialiv = NULL;
3473 PFNGLMATRIXMODEPROC glad_glMatrixMode = NULL;
3474 PFNGLMULTMATRIXDPROC glad_glMultMatrixd = NULL;
3475 PFNGLMULTMATRIXFPROC glad_glMultMatrixf = NULL;
3476 PFNGLMULTTRANSPOSEMATRIXDPROC glad_glMultTransposeMatrixd = NULL;
3477 PFNGLMULTTRANSPOSEMATRIXFPROC glad_glMultTransposeMatrixf = NULL;
3478 PFNGLMULTIDRAWARRAYSPROC glad_glMultiDrawArrays = NULL;
3479 PFNGLMULTIDRAWELEMENTSPROC glad_glMultiDrawElements = NULL;
3480 PFNGLMULTITEXCOORD1DPROC glad_glMultiTexCoord1d = NULL;
3481 PFNGLMULTITEXCOORD1DVPROC glad_glMultiTexCoord1dv = NULL;
3482 PFNGLMULTITEXCOORD1FPROC glad_glMultiTexCoord1f = NULL;
3483 PFNGLMULTITEXCOORD1FVPROC glad_glMultiTexCoord1fv = NULL;
3484 PFNGLMULTITEXCOORD1IPROC glad_glMultiTexCoord1i = NULL;
3485 PFNGLMULTITEXCOORD1IVPROC glad_glMultiTexCoord1iv = NULL;
3486 PFNGLMULTITEXCOORD1SPROC glad_glMultiTexCoord1s = NULL;
3487 PFNGLMULTITEXCOORD1SVPROC glad_glMultiTexCoord1sv = NULL;
3488 PFNGLMULTITEXCOORD2DPROC glad_glMultiTexCoord2d = NULL;
3489 PFNGLMULTITEXCOORD2DVPROC glad_glMultiTexCoord2dv = NULL;
3490 PFNGLMULTITEXCOORD2FPROC glad_glMultiTexCoord2f = NULL;
3491 PFNGLMULTITEXCOORD2FVPROC glad_glMultiTexCoord2fv = NULL;
3492 PFNGLMULTITEXCOORD2IPROC glad_glMultiTexCoord2i = NULL;
3493 PFNGLMULTITEXCOORD2IVPROC glad_glMultiTexCoord2iv = NULL;
3494 PFNGLMULTITEXCOORD2SPROC glad_glMultiTexCoord2s = NULL;
3495 PFNGLMULTITEXCOORD2SVPROC glad_glMultiTexCoord2sv = NULL;
3496 PFNGLMULTITEXCOORD3DPROC glad_glMultiTexCoord3d = NULL;
3497 PFNGLMULTITEXCOORD3DVPROC glad_glMultiTexCoord3dv = NULL;
3498 PFNGLMULTITEXCOORD3FPROC glad_glMultiTexCoord3f = NULL;
3499 PFNGLMULTITEXCOORD3FVPROC glad_glMultiTexCoord3fv = NULL;
3500 PFNGLMULTITEXCOORD3IPROC glad_glMultiTexCoord3i = NULL;
3501 PFNGLMULTITEXCOORD3IVPROC glad_glMultiTexCoord3iv = NULL;
3502 PFNGLMULTITEXCOORD3SPROC glad_glMultiTexCoord3s = NULL;
3503 PFNGLMULTITEXCOORD3SVPROC glad_glMultiTexCoord3sv = NULL;
3504 PFNGLMULTITEXCOORD4DPROC glad_glMultiTexCoord4d = NULL;
3505 PFNGLMULTITEXCOORD4DVPROC glad_glMultiTexCoord4dv = NULL;
3506 PFNGLMULTITEXCOORD4FPROC glad_glMultiTexCoord4f = NULL;
3507 PFNGLMULTITEXCOORD4FVPROC glad_glMultiTexCoord4fv = NULL;
3508 PFNGLMULTITEXCOORD4IPROC glad_glMultiTexCoord4i = NULL;
3509 PFNGLMULTITEXCOORD4IVPROC glad_glMultiTexCoord4iv = NULL;
3510 PFNGLMULTITEXCOORD4SPROC glad_glMultiTexCoord4s = NULL;
3511 PFNGLMULTITEXCOORD4SVPROC glad_glMultiTexCoord4sv = NULL;
3512 PFNGLNEWLISTPROC glad_glNewList = NULL;
3513 PFNGLNORMAL3BPROC glad_glNormal3b = NULL;
3514 PFNGLNORMAL3BVPROC glad_glNormal3bv = NULL;
3515 PFNGLNORMAL3DPROC glad_glNormal3d = NULL;
3516 PFNGLNORMAL3DVPROC glad_glNormal3dv = NULL;
3517 PFNGLNORMAL3FPROC glad_glNormal3f = NULL;
3518 PFNGLNORMAL3FVPROC glad_glNormal3fv = NULL;
3519 PFNGLNORMAL3IPROC glad_glNormal3i = NULL;
3520 PFNGLNORMAL3IVPROC glad_glNormal3iv = NULL;
3521 PFNGLNORMAL3SPROC glad_glNormal3s = NULL;
3522 PFNGLNORMAL3SVPROC glad_glNormal3sv = NULL;
3523 PFNGLNORMALPOINTERPROC glad_glNormalPointer = NULL;
3524 PFNGLORTHOPROC glad_glOrtho = NULL;
3525 PFNGLPASSTHROUGHPROC glad_glPassThrough = NULL;
3526 PFNGLPIXELMAPFVPROC glad_glPixelMapfv = NULL;
3527 PFNGLPIXELMAPUIVPROC glad_glPixelMapuiv = NULL;
3528 PFNGLPIXELMAPUSVPROC glad_glPixelMapusv = NULL;
3529 PFNGLPIXELSTOREFPROC glad_glPixelStoref = NULL;
3530 PFNGLPIXELSTOREIPROC glad_glPixelStorei = NULL;
3531 PFNGLPIXELTRANSFERFPROC glad_glPixelTransferf = NULL;
3532 PFNGLPIXELTRANSFERIPROC glad_glPixelTransferi = NULL;
3533 PFNGLPIXELZOOMPROC glad_glPixelZoom = NULL;
3534 PFNGLPOINTPARAMETERFPROC glad_glPointParameterf = NULL;
3535 PFNGLPOINTPARAMETERFVPROC glad_glPointParameterfv = NULL;
3536 PFNGLPOINTPARAMETERIPROC glad_glPointParameteri = NULL;
3537 PFNGLPOINTPARAMETERIVPROC glad_glPointParameteriv = NULL;
3538 PFNGLPOINTSIZEPROC glad_glPointSize = NULL;
3539 PFNGLPOLYGONMODEPROC glad_glPolygonMode = NULL;
3540 PFNGLPOLYGONOFFSETPROC glad_glPolygonOffset = NULL;
3541 PFNGLPOLYGONSTIPPLEPROC glad_glPolygonStipple = NULL;
3542 PFNGLPOPATTRIBPROC glad_glPopAttrib = NULL;
3543 PFNGLPOPCLIENTATTRIBPROC glad_glPopClientAttrib = NULL;
3544 PFNGLPOPMATRIXPROC glad_glPopMatrix = NULL;
3545 PFNGLPOPNAMEPROC glad_glPopName = NULL;
3546 PFNGLPRIORITIZETEXTURESPROC glad_glPrioritizeTextures = NULL;
3547 PFNGLPUSHATTRIBPROC glad_glPushAttrib = NULL;
3548 PFNGLPUSHCLIENTATTRIBPROC glad_glPushClientAttrib = NULL;
3549 PFNGLPUSHMATRIXPROC glad_glPushMatrix = NULL;
3550 PFNGLPUSHNAMEPROC glad_glPushName = NULL;
3551 PFNGLRASTERPOS2DPROC glad_glRasterPos2d = NULL;
3552 PFNGLRASTERPOS2DVPROC glad_glRasterPos2dv = NULL;
3553 PFNGLRASTERPOS2FPROC glad_glRasterPos2f = NULL;
3554 PFNGLRASTERPOS2FVPROC glad_glRasterPos2fv = NULL;
3555 PFNGLRASTERPOS2IPROC glad_glRasterPos2i = NULL;
3556 PFNGLRASTERPOS2IVPROC glad_glRasterPos2iv = NULL;
3557 PFNGLRASTERPOS2SPROC glad_glRasterPos2s = NULL;
3558 PFNGLRASTERPOS2SVPROC glad_glRasterPos2sv = NULL;
3559 PFNGLRASTERPOS3DPROC glad_glRasterPos3d = NULL;
3560 PFNGLRASTERPOS3DVPROC glad_glRasterPos3dv = NULL;
3561 PFNGLRASTERPOS3FPROC glad_glRasterPos3f = NULL;
3562 PFNGLRASTERPOS3FVPROC glad_glRasterPos3fv = NULL;
3563 PFNGLRASTERPOS3IPROC glad_glRasterPos3i = NULL;
3564 PFNGLRASTERPOS3IVPROC glad_glRasterPos3iv = NULL;
3565 PFNGLRASTERPOS3SPROC glad_glRasterPos3s = NULL;
3566 PFNGLRASTERPOS3SVPROC glad_glRasterPos3sv = NULL;
3567 PFNGLRASTERPOS4DPROC glad_glRasterPos4d = NULL;
3568 PFNGLRASTERPOS4DVPROC glad_glRasterPos4dv = NULL;
3569 PFNGLRASTERPOS4FPROC glad_glRasterPos4f = NULL;
3570 PFNGLRASTERPOS4FVPROC glad_glRasterPos4fv = NULL;
3571 PFNGLRASTERPOS4IPROC glad_glRasterPos4i = NULL;
3572 PFNGLRASTERPOS4IVPROC glad_glRasterPos4iv = NULL;
3573 PFNGLRASTERPOS4SPROC glad_glRasterPos4s = NULL;
3574 PFNGLRASTERPOS4SVPROC glad_glRasterPos4sv = NULL;
3575 PFNGLREADBUFFERPROC glad_glReadBuffer = NULL;
3576 PFNGLREADPIXELSPROC glad_glReadPixels = NULL;
3577 PFNGLRECTDPROC glad_glRectd = NULL;
3578 PFNGLRECTDVPROC glad_glRectdv = NULL;
3579 PFNGLRECTFPROC glad_glRectf = NULL;
3580 PFNGLRECTFVPROC glad_glRectfv = NULL;
3581 PFNGLRECTIPROC glad_glRecti = NULL;
3582 PFNGLRECTIVPROC glad_glRectiv = NULL;
3583 PFNGLRECTSPROC glad_glRects = NULL;
3584 PFNGLRECTSVPROC glad_glRectsv = NULL;
3585 PFNGLRENDERMODEPROC glad_glRenderMode = NULL;
3586 PFNGLRENDERBUFFERSTORAGEPROC glad_glRenderbufferStorage = NULL;
3587 PFNGLRENDERBUFFERSTORAGEEXTPROC glad_glRenderbufferStorageEXT = NULL;
3588 PFNGLROTATEDPROC glad_glRotated = NULL;
3589 PFNGLROTATEFPROC glad_glRotatef = NULL;
3590 PFNGLSAMPLECOVERAGEPROC glad_glSampleCoverage = NULL;
3591 PFNGLSCALEDPROC glad_glScaled = NULL;
3592 PFNGLSCALEFPROC glad_glScalef = NULL;
3593 PFNGLSCISSORPROC glad_glScissor = NULL;
3594 PFNGLSECONDARYCOLOR3BPROC glad_glSecondaryColor3b = NULL;
3595 PFNGLSECONDARYCOLOR3BVPROC glad_glSecondaryColor3bv = NULL;
3596 PFNGLSECONDARYCOLOR3DPROC glad_glSecondaryColor3d = NULL;
3597 PFNGLSECONDARYCOLOR3DVPROC glad_glSecondaryColor3dv = NULL;
3598 PFNGLSECONDARYCOLOR3FPROC glad_glSecondaryColor3f = NULL;
3599 PFNGLSECONDARYCOLOR3FVPROC glad_glSecondaryColor3fv = NULL;
3600 PFNGLSECONDARYCOLOR3IPROC glad_glSecondaryColor3i = NULL;
3601 PFNGLSECONDARYCOLOR3IVPROC glad_glSecondaryColor3iv = NULL;
3602 PFNGLSECONDARYCOLOR3SPROC glad_glSecondaryColor3s = NULL;
3603 PFNGLSECONDARYCOLOR3SVPROC glad_glSecondaryColor3sv = NULL;
3604 PFNGLSECONDARYCOLOR3UBPROC glad_glSecondaryColor3ub = NULL;
3605 PFNGLSECONDARYCOLOR3UBVPROC glad_glSecondaryColor3ubv = NULL;
3606 PFNGLSECONDARYCOLOR3UIPROC glad_glSecondaryColor3ui = NULL;
3607 PFNGLSECONDARYCOLOR3UIVPROC glad_glSecondaryColor3uiv = NULL;
3608 PFNGLSECONDARYCOLOR3USPROC glad_glSecondaryColor3us = NULL;
3609 PFNGLSECONDARYCOLOR3USVPROC glad_glSecondaryColor3usv = NULL;
3610 PFNGLSECONDARYCOLORPOINTERPROC glad_glSecondaryColorPointer = NULL;
3611 PFNGLSELECTBUFFERPROC glad_glSelectBuffer = NULL;
3612 PFNGLSHADEMODELPROC glad_glShadeModel = NULL;
3613 PFNGLSHADERSOURCEPROC glad_glShaderSource = NULL;
3614 PFNGLSTENCILFUNCPROC glad_glStencilFunc = NULL;
3615 PFNGLSTENCILFUNCSEPARATEPROC glad_glStencilFuncSeparate = NULL;
3616 PFNGLSTENCILMASKPROC glad_glStencilMask = NULL;
3617 PFNGLSTENCILMASKSEPARATEPROC glad_glStencilMaskSeparate = NULL;
3618 PFNGLSTENCILOPPROC glad_glStencilOp = NULL;
3619 PFNGLSTENCILOPSEPARATEPROC glad_glStencilOpSeparate = NULL;
3620 PFNGLTEXCOORD1DPROC glad_glTexCoord1d = NULL;
3621 PFNGLTEXCOORD1DVPROC glad_glTexCoord1dv = NULL;
3622 PFNGLTEXCOORD1FPROC glad_glTexCoord1f = NULL;
3623 PFNGLTEXCOORD1FVPROC glad_glTexCoord1fv = NULL;
3624 PFNGLTEXCOORD1IPROC glad_glTexCoord1i = NULL;
3625 PFNGLTEXCOORD1IVPROC glad_glTexCoord1iv = NULL;
3626 PFNGLTEXCOORD1SPROC glad_glTexCoord1s = NULL;
3627 PFNGLTEXCOORD1SVPROC glad_glTexCoord1sv = NULL;
3628 PFNGLTEXCOORD2DPROC glad_glTexCoord2d = NULL;
3629 PFNGLTEXCOORD2DVPROC glad_glTexCoord2dv = NULL;
3630 PFNGLTEXCOORD2FPROC glad_glTexCoord2f = NULL;
3631 PFNGLTEXCOORD2FVPROC glad_glTexCoord2fv = NULL;
3632 PFNGLTEXCOORD2IPROC glad_glTexCoord2i = NULL;
3633 PFNGLTEXCOORD2IVPROC glad_glTexCoord2iv = NULL;
3634 PFNGLTEXCOORD2SPROC glad_glTexCoord2s = NULL;
3635 PFNGLTEXCOORD2SVPROC glad_glTexCoord2sv = NULL;
3636 PFNGLTEXCOORD3DPROC glad_glTexCoord3d = NULL;
3637 PFNGLTEXCOORD3DVPROC glad_glTexCoord3dv = NULL;
3638 PFNGLTEXCOORD3FPROC glad_glTexCoord3f = NULL;
3639 PFNGLTEXCOORD3FVPROC glad_glTexCoord3fv = NULL;
3640 PFNGLTEXCOORD3IPROC glad_glTexCoord3i = NULL;
3641 PFNGLTEXCOORD3IVPROC glad_glTexCoord3iv = NULL;
3642 PFNGLTEXCOORD3SPROC glad_glTexCoord3s = NULL;
3643 PFNGLTEXCOORD3SVPROC glad_glTexCoord3sv = NULL;
3644 PFNGLTEXCOORD4DPROC glad_glTexCoord4d = NULL;
3645 PFNGLTEXCOORD4DVPROC glad_glTexCoord4dv = NULL;
3646 PFNGLTEXCOORD4FPROC glad_glTexCoord4f = NULL;
3647 PFNGLTEXCOORD4FVPROC glad_glTexCoord4fv = NULL;
3648 PFNGLTEXCOORD4IPROC glad_glTexCoord4i = NULL;
3649 PFNGLTEXCOORD4IVPROC glad_glTexCoord4iv = NULL;
3650 PFNGLTEXCOORD4SPROC glad_glTexCoord4s = NULL;
3651 PFNGLTEXCOORD4SVPROC glad_glTexCoord4sv = NULL;
3652 PFNGLTEXCOORDPOINTERPROC glad_glTexCoordPointer = NULL;
3653 PFNGLTEXENVFPROC glad_glTexEnvf = NULL;
3654 PFNGLTEXENVFVPROC glad_glTexEnvfv = NULL;
3655 PFNGLTEXENVIPROC glad_glTexEnvi = NULL;
3656 PFNGLTEXENVIVPROC glad_glTexEnviv = NULL;
3657 PFNGLTEXGENDPROC glad_glTexGend = NULL;
3658 PFNGLTEXGENDVPROC glad_glTexGendv = NULL;
3659 PFNGLTEXGENFPROC glad_glTexGenf = NULL;
3660 PFNGLTEXGENFVPROC glad_glTexGenfv = NULL;
3661 PFNGLTEXGENIPROC glad_glTexGeni = NULL;
3662 PFNGLTEXGENIVPROC glad_glTexGeniv = NULL;
3663 PFNGLTEXIMAGE1DPROC glad_glTexImage1D = NULL;
3664 PFNGLTEXIMAGE2DPROC glad_glTexImage2D = NULL;
3665 PFNGLTEXIMAGE3DPROC glad_glTexImage3D = NULL;
3666 PFNGLTEXPARAMETERFPROC glad_glTexParameterf = NULL;
3667 PFNGLTEXPARAMETERFVPROC glad_glTexParameterfv = NULL;
3668 PFNGLTEXPARAMETERIPROC glad_glTexParameteri = NULL;
3669 PFNGLTEXPARAMETERIVPROC glad_glTexParameteriv = NULL;
3670 PFNGLTEXSUBIMAGE1DPROC glad_glTexSubImage1D = NULL;
3671 PFNGLTEXSUBIMAGE2DPROC glad_glTexSubImage2D = NULL;
3672 PFNGLTEXSUBIMAGE3DPROC glad_glTexSubImage3D = NULL;
3673 PFNGLTRANSLATEDPROC glad_glTranslated = NULL;
3674 PFNGLTRANSLATEFPROC glad_glTranslatef = NULL;
3675 PFNGLUNIFORM1FPROC glad_glUniform1f = NULL;
3676 PFNGLUNIFORM1FVPROC glad_glUniform1fv = NULL;
3677 PFNGLUNIFORM1IPROC glad_glUniform1i = NULL;
3678 PFNGLUNIFORM1IVPROC glad_glUniform1iv = NULL;
3679 PFNGLUNIFORM2FPROC glad_glUniform2f = NULL;
3680 PFNGLUNIFORM2FVPROC glad_glUniform2fv = NULL;
3681 PFNGLUNIFORM2IPROC glad_glUniform2i = NULL;
3682 PFNGLUNIFORM2IVPROC glad_glUniform2iv = NULL;
3683 PFNGLUNIFORM3FPROC glad_glUniform3f = NULL;
3684 PFNGLUNIFORM3FVPROC glad_glUniform3fv = NULL;
3685 PFNGLUNIFORM3IPROC glad_glUniform3i = NULL;
3686 PFNGLUNIFORM3IVPROC glad_glUniform3iv = NULL;
3687 PFNGLUNIFORM4FPROC glad_glUniform4f = NULL;
3688 PFNGLUNIFORM4FVPROC glad_glUniform4fv = NULL;
3689 PFNGLUNIFORM4IPROC glad_glUniform4i = NULL;
3690 PFNGLUNIFORM4IVPROC glad_glUniform4iv = NULL;
3691 PFNGLUNIFORMMATRIX2FVPROC glad_glUniformMatrix2fv = NULL;
3692 PFNGLUNIFORMMATRIX3FVPROC glad_glUniformMatrix3fv = NULL;
3693 PFNGLUNIFORMMATRIX4FVPROC glad_glUniformMatrix4fv = NULL;
3694 PFNGLUNMAPBUFFERPROC glad_glUnmapBuffer = NULL;
3695 PFNGLUSEPROGRAMPROC glad_glUseProgram = NULL;
3696 PFNGLVALIDATEPROGRAMPROC glad_glValidateProgram = NULL;
3697 PFNGLVERTEX2DPROC glad_glVertex2d = NULL;
3698 PFNGLVERTEX2DVPROC glad_glVertex2dv = NULL;
3699 PFNGLVERTEX2FPROC glad_glVertex2f = NULL;
3700 PFNGLVERTEX2FVPROC glad_glVertex2fv = NULL;
3701 PFNGLVERTEX2IPROC glad_glVertex2i = NULL;
3702 PFNGLVERTEX2IVPROC glad_glVertex2iv = NULL;
3703 PFNGLVERTEX2SPROC glad_glVertex2s = NULL;
3704 PFNGLVERTEX2SVPROC glad_glVertex2sv = NULL;
3705 PFNGLVERTEX3DPROC glad_glVertex3d = NULL;
3706 PFNGLVERTEX3DVPROC glad_glVertex3dv = NULL;
3707 PFNGLVERTEX3FPROC glad_glVertex3f = NULL;
3708 PFNGLVERTEX3FVPROC glad_glVertex3fv = NULL;
3709 PFNGLVERTEX3IPROC glad_glVertex3i = NULL;
3710 PFNGLVERTEX3IVPROC glad_glVertex3iv = NULL;
3711 PFNGLVERTEX3SPROC glad_glVertex3s = NULL;
3712 PFNGLVERTEX3SVPROC glad_glVertex3sv = NULL;
3713 PFNGLVERTEX4DPROC glad_glVertex4d = NULL;
3714 PFNGLVERTEX4DVPROC glad_glVertex4dv = NULL;
3715 PFNGLVERTEX4FPROC glad_glVertex4f = NULL;
3716 PFNGLVERTEX4FVPROC glad_glVertex4fv = NULL;
3717 PFNGLVERTEX4IPROC glad_glVertex4i = NULL;
3718 PFNGLVERTEX4IVPROC glad_glVertex4iv = NULL;
3719 PFNGLVERTEX4SPROC glad_glVertex4s = NULL;
3720 PFNGLVERTEX4SVPROC glad_glVertex4sv = NULL;
3721 PFNGLVERTEXATTRIB1DPROC glad_glVertexAttrib1d = NULL;
3722 PFNGLVERTEXATTRIB1DVPROC glad_glVertexAttrib1dv = NULL;
3723 PFNGLVERTEXATTRIB1FPROC glad_glVertexAttrib1f = NULL;
3724 PFNGLVERTEXATTRIB1FVPROC glad_glVertexAttrib1fv = NULL;
3725 PFNGLVERTEXATTRIB1SPROC glad_glVertexAttrib1s = NULL;
3726 PFNGLVERTEXATTRIB1SVPROC glad_glVertexAttrib1sv = NULL;
3727 PFNGLVERTEXATTRIB2DPROC glad_glVertexAttrib2d = NULL;
3728 PFNGLVERTEXATTRIB2DVPROC glad_glVertexAttrib2dv = NULL;
3729 PFNGLVERTEXATTRIB2FPROC glad_glVertexAttrib2f = NULL;
3730 PFNGLVERTEXATTRIB2FVPROC glad_glVertexAttrib2fv = NULL;
3731 PFNGLVERTEXATTRIB2SPROC glad_glVertexAttrib2s = NULL;
3732 PFNGLVERTEXATTRIB2SVPROC glad_glVertexAttrib2sv = NULL;
3733 PFNGLVERTEXATTRIB3DPROC glad_glVertexAttrib3d = NULL;
3734 PFNGLVERTEXATTRIB3DVPROC glad_glVertexAttrib3dv = NULL;
3735 PFNGLVERTEXATTRIB3FPROC glad_glVertexAttrib3f = NULL;
3736 PFNGLVERTEXATTRIB3FVPROC glad_glVertexAttrib3fv = NULL;
3737 PFNGLVERTEXATTRIB3SPROC glad_glVertexAttrib3s = NULL;
3738 PFNGLVERTEXATTRIB3SVPROC glad_glVertexAttrib3sv = NULL;
3739 PFNGLVERTEXATTRIB4NBVPROC glad_glVertexAttrib4Nbv = NULL;
3740 PFNGLVERTEXATTRIB4NIVPROC glad_glVertexAttrib4Niv = NULL;
3741 PFNGLVERTEXATTRIB4NSVPROC glad_glVertexAttrib4Nsv = NULL;
3742 PFNGLVERTEXATTRIB4NUBPROC glad_glVertexAttrib4Nub = NULL;
3743 PFNGLVERTEXATTRIB4NUBVPROC glad_glVertexAttrib4Nubv = NULL;
3744 PFNGLVERTEXATTRIB4NUIVPROC glad_glVertexAttrib4Nuiv = NULL;
3745 PFNGLVERTEXATTRIB4NUSVPROC glad_glVertexAttrib4Nusv = NULL;
3746 PFNGLVERTEXATTRIB4BVPROC glad_glVertexAttrib4bv = NULL;
3747 PFNGLVERTEXATTRIB4DPROC glad_glVertexAttrib4d = NULL;
3748 PFNGLVERTEXATTRIB4DVPROC glad_glVertexAttrib4dv = NULL;
3749 PFNGLVERTEXATTRIB4FPROC glad_glVertexAttrib4f = NULL;
3750 PFNGLVERTEXATTRIB4FVPROC glad_glVertexAttrib4fv = NULL;
3751 PFNGLVERTEXATTRIB4IVPROC glad_glVertexAttrib4iv = NULL;
3752 PFNGLVERTEXATTRIB4SPROC glad_glVertexAttrib4s = NULL;
3753 PFNGLVERTEXATTRIB4SVPROC glad_glVertexAttrib4sv = NULL;
3754 PFNGLVERTEXATTRIB4UBVPROC glad_glVertexAttrib4ubv = NULL;
3755 PFNGLVERTEXATTRIB4UIVPROC glad_glVertexAttrib4uiv = NULL;
3756 PFNGLVERTEXATTRIB4USVPROC glad_glVertexAttrib4usv = NULL;
3757 PFNGLVERTEXATTRIBPOINTERPROC glad_glVertexAttribPointer = NULL;
3758 PFNGLVERTEXPOINTERPROC glad_glVertexPointer = NULL;
3759 PFNGLVIEWPORTPROC glad_glViewport = NULL;
3760 PFNGLWINDOWPOS2DPROC glad_glWindowPos2d = NULL;
3761 PFNGLWINDOWPOS2DVPROC glad_glWindowPos2dv = NULL;
3762 PFNGLWINDOWPOS2FPROC glad_glWindowPos2f = NULL;
3763 PFNGLWINDOWPOS2FVPROC glad_glWindowPos2fv = NULL;
3764 PFNGLWINDOWPOS2IPROC glad_glWindowPos2i = NULL;
3765 PFNGLWINDOWPOS2IVPROC glad_glWindowPos2iv = NULL;
3766 PFNGLWINDOWPOS2SPROC glad_glWindowPos2s = NULL;
3767 PFNGLWINDOWPOS2SVPROC glad_glWindowPos2sv = NULL;
3768 PFNGLWINDOWPOS3DPROC glad_glWindowPos3d = NULL;
3769 PFNGLWINDOWPOS3DVPROC glad_glWindowPos3dv = NULL;
3770 PFNGLWINDOWPOS3FPROC glad_glWindowPos3f = NULL;
3771 PFNGLWINDOWPOS3FVPROC glad_glWindowPos3fv = NULL;
3772 PFNGLWINDOWPOS3IPROC glad_glWindowPos3i = NULL;
3773 PFNGLWINDOWPOS3IVPROC glad_glWindowPos3iv = NULL;
3774 PFNGLWINDOWPOS3SPROC glad_glWindowPos3s = NULL;
3775 PFNGLWINDOWPOS3SVPROC glad_glWindowPos3sv = NULL;
3776
3777
3778 static void glad_gl_load_GL_VERSION_1_0( GLADuserptrloadfunc load, void* userptr) {
3779 if(!GLAD_GL_VERSION_1_0) return;
3780 glAccum = (PFNGLACCUMPROC) load(userptr, "glAccum");
3781 glAlphaFunc = (PFNGLALPHAFUNCPROC) load(userptr, "glAlphaFunc");
3782 glBegin = (PFNGLBEGINPROC) load(userptr, "glBegin");
3783 glBitmap = (PFNGLBITMAPPROC) load(userptr, "glBitmap");
3784 glBlendFunc = (PFNGLBLENDFUNCPROC) load(userptr, "glBlendFunc");
3785 glCallList = (PFNGLCALLLISTPROC) load(userptr, "glCallList");
3786 glCallLists = (PFNGLCALLLISTSPROC) load(userptr, "glCallLists");
3787 glClear = (PFNGLCLEARPROC) load(userptr, "glClear");
3788 glClearAccum = (PFNGLCLEARACCUMPROC) load(userptr, "glClearAccum");
3789 glClearColor = (PFNGLCLEARCOLORPROC) load(userptr, "glClearColor");
3790 glClearDepth = (PFNGLCLEARDEPTHPROC) load(userptr, "glClearDepth");
3791 glClearIndex = (PFNGLCLEARINDEXPROC) load(userptr, "glClearIndex");
3792 glClearStencil = (PFNGLCLEARSTENCILPROC) load(userptr, "glClearStencil");
3793 glClipPlane = (PFNGLCLIPPLANEPROC) load(userptr, "glClipPlane");
3794 glColor3b = (PFNGLCOLOR3BPROC) load(userptr, "glColor3b");
3795 glColor3bv = (PFNGLCOLOR3BVPROC) load(userptr, "glColor3bv");
3796 glColor3d = (PFNGLCOLOR3DPROC) load(userptr, "glColor3d");
3797 glColor3dv = (PFNGLCOLOR3DVPROC) load(userptr, "glColor3dv");
3798 glColor3f = (PFNGLCOLOR3FPROC) load(userptr, "glColor3f");
3799 glColor3fv = (PFNGLCOLOR3FVPROC) load(userptr, "glColor3fv");
3800 glColor3i = (PFNGLCOLOR3IPROC) load(userptr, "glColor3i");
3801 glColor3iv = (PFNGLCOLOR3IVPROC) load(userptr, "glColor3iv");
3802 glColor3s = (PFNGLCOLOR3SPROC) load(userptr, "glColor3s");
3803 glColor3sv = (PFNGLCOLOR3SVPROC) load(userptr, "glColor3sv");
3804 glColor3ub = (PFNGLCOLOR3UBPROC) load(userptr, "glColor3ub");
3805 glColor3ubv = (PFNGLCOLOR3UBVPROC) load(userptr, "glColor3ubv");
3806 glColor3ui = (PFNGLCOLOR3UIPROC) load(userptr, "glColor3ui");
3807 glColor3uiv = (PFNGLCOLOR3UIVPROC) load(userptr, "glColor3uiv");
3808 glColor3us = (PFNGLCOLOR3USPROC) load(userptr, "glColor3us");
3809 glColor3usv = (PFNGLCOLOR3USVPROC) load(userptr, "glColor3usv");
3810 glColor4b = (PFNGLCOLOR4BPROC) load(userptr, "glColor4b");
3811 glColor4bv = (PFNGLCOLOR4BVPROC) load(userptr, "glColor4bv");
3812 glColor4d = (PFNGLCOLOR4DPROC) load(userptr, "glColor4d");
3813 glColor4dv = (PFNGLCOLOR4DVPROC) load(userptr, "glColor4dv");
3814 glColor4f = (PFNGLCOLOR4FPROC) load(userptr, "glColor4f");
3815 glColor4fv = (PFNGLCOLOR4FVPROC) load(userptr, "glColor4fv");
3816 glColor4i = (PFNGLCOLOR4IPROC) load(userptr, "glColor4i");
3817 glColor4iv = (PFNGLCOLOR4IVPROC) load(userptr, "glColor4iv");
3818 glColor4s = (PFNGLCOLOR4SPROC) load(userptr, "glColor4s");
3819 glColor4sv = (PFNGLCOLOR4SVPROC) load(userptr, "glColor4sv");
3820 glColor4ub = (PFNGLCOLOR4UBPROC) load(userptr, "glColor4ub");
3821 glColor4ubv = (PFNGLCOLOR4UBVPROC) load(userptr, "glColor4ubv");
3822 glColor4ui = (PFNGLCOLOR4UIPROC) load(userptr, "glColor4ui");
3823 glColor4uiv = (PFNGLCOLOR4UIVPROC) load(userptr, "glColor4uiv");
3824 glColor4us = (PFNGLCOLOR4USPROC) load(userptr, "glColor4us");
3825 glColor4usv = (PFNGLCOLOR4USVPROC) load(userptr, "glColor4usv");
3826 glColorMask = (PFNGLCOLORMASKPROC) load(userptr, "glColorMask");
3827 glColorMaterial = (PFNGLCOLORMATERIALPROC) load(userptr, "glColorMaterial");
3828 glCopyPixels = (PFNGLCOPYPIXELSPROC) load(userptr, "glCopyPixels");
3829 glCullFace = (PFNGLCULLFACEPROC) load(userptr, "glCullFace");
3830 glDeleteLists = (PFNGLDELETELISTSPROC) load(userptr, "glDeleteLists");
3831 glDepthFunc = (PFNGLDEPTHFUNCPROC) load(userptr, "glDepthFunc");
3832 glDepthMask = (PFNGLDEPTHMASKPROC) load(userptr, "glDepthMask");
3833 glDepthRange = (PFNGLDEPTHRANGEPROC) load(userptr, "glDepthRange");
3834 glDisable = (PFNGLDISABLEPROC) load(userptr, "glDisable");
3835 glDrawBuffer = (PFNGLDRAWBUFFERPROC) load(userptr, "glDrawBuffer");
3836 glDrawPixels = (PFNGLDRAWPIXELSPROC) load(userptr, "glDrawPixels");
3837 glEdgeFlag = (PFNGLEDGEFLAGPROC) load(userptr, "glEdgeFlag");
3838 glEdgeFlagv = (PFNGLEDGEFLAGVPROC) load(userptr, "glEdgeFlagv");
3839 glEnable = (PFNGLENABLEPROC) load(userptr, "glEnable");
3840 glEnd = (PFNGLENDPROC) load(userptr, "glEnd");
3841 glEndList = (PFNGLENDLISTPROC) load(userptr, "glEndList");
3842 glEvalCoord1d = (PFNGLEVALCOORD1DPROC) load(userptr, "glEvalCoord1d");
3843 glEvalCoord1dv = (PFNGLEVALCOORD1DVPROC) load(userptr, "glEvalCoord1dv");
3844 glEvalCoord1f = (PFNGLEVALCOORD1FPROC) load(userptr, "glEvalCoord1f");
3845 glEvalCoord1fv = (PFNGLEVALCOORD1FVPROC) load(userptr, "glEvalCoord1fv");
3846 glEvalCoord2d = (PFNGLEVALCOORD2DPROC) load(userptr, "glEvalCoord2d");
3847 glEvalCoord2dv = (PFNGLEVALCOORD2DVPROC) load(userptr, "glEvalCoord2dv");
3848 glEvalCoord2f = (PFNGLEVALCOORD2FPROC) load(userptr, "glEvalCoord2f");
3849 glEvalCoord2fv = (PFNGLEVALCOORD2FVPROC) load(userptr, "glEvalCoord2fv");
3850 glEvalMesh1 = (PFNGLEVALMESH1PROC) load(userptr, "glEvalMesh1");
3851 glEvalMesh2 = (PFNGLEVALMESH2PROC) load(userptr, "glEvalMesh2");
3852 glEvalPoint1 = (PFNGLEVALPOINT1PROC) load(userptr, "glEvalPoint1");
3853 glEvalPoint2 = (PFNGLEVALPOINT2PROC) load(userptr, "glEvalPoint2");
3854 glFeedbackBuffer = (PFNGLFEEDBACKBUFFERPROC) load(userptr, "glFeedbackBuffer");
3855 glFinish = (PFNGLFINISHPROC) load(userptr, "glFinish");
3856 glFlush = (PFNGLFLUSHPROC) load(userptr, "glFlush");
3857 glFogf = (PFNGLFOGFPROC) load(userptr, "glFogf");
3858 glFogfv = (PFNGLFOGFVPROC) load(userptr, "glFogfv");
3859 glFogi = (PFNGLFOGIPROC) load(userptr, "glFogi");
3860 glFogiv = (PFNGLFOGIVPROC) load(userptr, "glFogiv");
3861 glFrontFace = (PFNGLFRONTFACEPROC) load(userptr, "glFrontFace");
3862 glFrustum = (PFNGLFRUSTUMPROC) load(userptr, "glFrustum");
3863 glGenLists = (PFNGLGENLISTSPROC) load(userptr, "glGenLists");
3864 glGetBooleanv = (PFNGLGETBOOLEANVPROC) load(userptr, "glGetBooleanv");
3865 glGetClipPlane = (PFNGLGETCLIPPLANEPROC) load(userptr, "glGetClipPlane");
3866 glGetDoublev = (PFNGLGETDOUBLEVPROC) load(userptr, "glGetDoublev");
3867 glGetError = (PFNGLGETERRORPROC) load(userptr, "glGetError");
3868 glGetFloatv = (PFNGLGETFLOATVPROC) load(userptr, "glGetFloatv");
3869 glGetIntegerv = (PFNGLGETINTEGERVPROC) load(userptr, "glGetIntegerv");
3870 glGetLightfv = (PFNGLGETLIGHTFVPROC) load(userptr, "glGetLightfv");
3871 glGetLightiv = (PFNGLGETLIGHTIVPROC) load(userptr, "glGetLightiv");
3872 glGetMapdv = (PFNGLGETMAPDVPROC) load(userptr, "glGetMapdv");
3873 glGetMapfv = (PFNGLGETMAPFVPROC) load(userptr, "glGetMapfv");
3874 glGetMapiv = (PFNGLGETMAPIVPROC) load(userptr, "glGetMapiv");
3875 glGetMaterialfv = (PFNGLGETMATERIALFVPROC) load(userptr, "glGetMaterialfv");
3876 glGetMaterialiv = (PFNGLGETMATERIALIVPROC) load(userptr, "glGetMaterialiv");
3877 glGetPixelMapfv = (PFNGLGETPIXELMAPFVPROC) load(userptr, "glGetPixelMapfv");
3878 glGetPixelMapuiv = (PFNGLGETPIXELMAPUIVPROC) load(userptr, "glGetPixelMapuiv");
3879 glGetPixelMapusv = (PFNGLGETPIXELMAPUSVPROC) load(userptr, "glGetPixelMapusv");
3880 glGetPolygonStipple = (PFNGLGETPOLYGONSTIPPLEPROC) load(userptr, "glGetPolygonStipple");
3881 glGetString = (PFNGLGETSTRINGPROC) load(userptr, "glGetString");
3882 glGetTexEnvfv = (PFNGLGETTEXENVFVPROC) load(userptr, "glGetTexEnvfv");
3883 glGetTexEnviv = (PFNGLGETTEXENVIVPROC) load(userptr, "glGetTexEnviv");
3884 glGetTexGendv = (PFNGLGETTEXGENDVPROC) load(userptr, "glGetTexGendv");
3885 glGetTexGenfv = (PFNGLGETTEXGENFVPROC) load(userptr, "glGetTexGenfv");
3886 glGetTexGeniv = (PFNGLGETTEXGENIVPROC) load(userptr, "glGetTexGeniv");
3887 glGetTexImage = (PFNGLGETTEXIMAGEPROC) load(userptr, "glGetTexImage");
3888 glGetTexLevelParameterfv = (PFNGLGETTEXLEVELPARAMETERFVPROC) load(userptr, "glGetTexLevelParameterfv");
3889 glGetTexLevelParameteriv = (PFNGLGETTEXLEVELPARAMETERIVPROC) load(userptr, "glGetTexLevelParameteriv");
3890 glGetTexParameterfv = (PFNGLGETTEXPARAMETERFVPROC) load(userptr, "glGetTexParameterfv");
3891 glGetTexParameteriv = (PFNGLGETTEXPARAMETERIVPROC) load(userptr, "glGetTexParameteriv");
3892 glHint = (PFNGLHINTPROC) load(userptr, "glHint");
3893 glIndexMask = (PFNGLINDEXMASKPROC) load(userptr, "glIndexMask");
3894 glIndexd = (PFNGLINDEXDPROC) load(userptr, "glIndexd");
3895 glIndexdv = (PFNGLINDEXDVPROC) load(userptr, "glIndexdv");
3896 glIndexf = (PFNGLINDEXFPROC) load(userptr, "glIndexf");
3897 glIndexfv = (PFNGLINDEXFVPROC) load(userptr, "glIndexfv");
3898 glIndexi = (PFNGLINDEXIPROC) load(userptr, "glIndexi");
3899 glIndexiv = (PFNGLINDEXIVPROC) load(userptr, "glIndexiv");
3900 glIndexs = (PFNGLINDEXSPROC) load(userptr, "glIndexs");
3901 glIndexsv = (PFNGLINDEXSVPROC) load(userptr, "glIndexsv");
3902 glInitNames = (PFNGLINITNAMESPROC) load(userptr, "glInitNames");
3903 glIsEnabled = (PFNGLISENABLEDPROC) load(userptr, "glIsEnabled");
3904 glIsList = (PFNGLISLISTPROC) load(userptr, "glIsList");
3905 glLightModelf = (PFNGLLIGHTMODELFPROC) load(userptr, "glLightModelf");
3906 glLightModelfv = (PFNGLLIGHTMODELFVPROC) load(userptr, "glLightModelfv");
3907 glLightModeli = (PFNGLLIGHTMODELIPROC) load(userptr, "glLightModeli");
3908 glLightModeliv = (PFNGLLIGHTMODELIVPROC) load(userptr, "glLightModeliv");
3909 glLightf = (PFNGLLIGHTFPROC) load(userptr, "glLightf");
3910 glLightfv = (PFNGLLIGHTFVPROC) load(userptr, "glLightfv");
3911 glLighti = (PFNGLLIGHTIPROC) load(userptr, "glLighti");
3912 glLightiv = (PFNGLLIGHTIVPROC) load(userptr, "glLightiv");
3913 glLineStipple = (PFNGLLINESTIPPLEPROC) load(userptr, "glLineStipple");
3914 glLineWidth = (PFNGLLINEWIDTHPROC) load(userptr, "glLineWidth");
3915 glListBase = (PFNGLLISTBASEPROC) load(userptr, "glListBase");
3916 glLoadIdentity = (PFNGLLOADIDENTITYPROC) load(userptr, "glLoadIdentity");
3917 glLoadMatrixd = (PFNGLLOADMATRIXDPROC) load(userptr, "glLoadMatrixd");
3918 glLoadMatrixf = (PFNGLLOADMATRIXFPROC) load(userptr, "glLoadMatrixf");
3919 glLoadName = (PFNGLLOADNAMEPROC) load(userptr, "glLoadName");
3920 glLogicOp = (PFNGLLOGICOPPROC) load(userptr, "glLogicOp");
3921 glMap1d = (PFNGLMAP1DPROC) load(userptr, "glMap1d");
3922 glMap1f = (PFNGLMAP1FPROC) load(userptr, "glMap1f");
3923 glMap2d = (PFNGLMAP2DPROC) load(userptr, "glMap2d");
3924 glMap2f = (PFNGLMAP2FPROC) load(userptr, "glMap2f");
3925 glMapGrid1d = (PFNGLMAPGRID1DPROC) load(userptr, "glMapGrid1d");
3926 glMapGrid1f = (PFNGLMAPGRID1FPROC) load(userptr, "glMapGrid1f");
3927 glMapGrid2d = (PFNGLMAPGRID2DPROC) load(userptr, "glMapGrid2d");
3928 glMapGrid2f = (PFNGLMAPGRID2FPROC) load(userptr, "glMapGrid2f");
3929 glMaterialf = (PFNGLMATERIALFPROC) load(userptr, "glMaterialf");
3930 glMaterialfv = (PFNGLMATERIALFVPROC) load(userptr, "glMaterialfv");
3931 glMateriali = (PFNGLMATERIALIPROC) load(userptr, "glMateriali");
3932 glMaterialiv = (PFNGLMATERIALIVPROC) load(userptr, "glMaterialiv");
3933 glMatrixMode = (PFNGLMATRIXMODEPROC) load(userptr, "glMatrixMode");
3934 glMultMatrixd = (PFNGLMULTMATRIXDPROC) load(userptr, "glMultMatrixd");
3935 glMultMatrixf = (PFNGLMULTMATRIXFPROC) load(userptr, "glMultMatrixf");
3936 glNewList = (PFNGLNEWLISTPROC) load(userptr, "glNewList");
3937 glNormal3b = (PFNGLNORMAL3BPROC) load(userptr, "glNormal3b");
3938 glNormal3bv = (PFNGLNORMAL3BVPROC) load(userptr, "glNormal3bv");
3939 glNormal3d = (PFNGLNORMAL3DPROC) load(userptr, "glNormal3d");
3940 glNormal3dv = (PFNGLNORMAL3DVPROC) load(userptr, "glNormal3dv");
3941 glNormal3f = (PFNGLNORMAL3FPROC) load(userptr, "glNormal3f");
3942 glNormal3fv = (PFNGLNORMAL3FVPROC) load(userptr, "glNormal3fv");
3943 glNormal3i = (PFNGLNORMAL3IPROC) load(userptr, "glNormal3i");
3944 glNormal3iv = (PFNGLNORMAL3IVPROC) load(userptr, "glNormal3iv");
3945 glNormal3s = (PFNGLNORMAL3SPROC) load(userptr, "glNormal3s");
3946 glNormal3sv = (PFNGLNORMAL3SVPROC) load(userptr, "glNormal3sv");
3947 glOrtho = (PFNGLORTHOPROC) load(userptr, "glOrtho");
3948 glPassThrough = (PFNGLPASSTHROUGHPROC) load(userptr, "glPassThrough");
3949 glPixelMapfv = (PFNGLPIXELMAPFVPROC) load(userptr, "glPixelMapfv");
3950 glPixelMapuiv = (PFNGLPIXELMAPUIVPROC) load(userptr, "glPixelMapuiv");
3951 glPixelMapusv = (PFNGLPIXELMAPUSVPROC) load(userptr, "glPixelMapusv");
3952 glPixelStoref = (PFNGLPIXELSTOREFPROC) load(userptr, "glPixelStoref");
3953 glPixelStorei = (PFNGLPIXELSTOREIPROC) load(userptr, "glPixelStorei");
3954 glPixelTransferf = (PFNGLPIXELTRANSFERFPROC) load(userptr, "glPixelTransferf");
3955 glPixelTransferi = (PFNGLPIXELTRANSFERIPROC) load(userptr, "glPixelTransferi");
3956 glPixelZoom = (PFNGLPIXELZOOMPROC) load(userptr, "glPixelZoom");
3957 glPointSize = (PFNGLPOINTSIZEPROC) load(userptr, "glPointSize");
3958 glPolygonMode = (PFNGLPOLYGONMODEPROC) load(userptr, "glPolygonMode");
3959 glPolygonStipple = (PFNGLPOLYGONSTIPPLEPROC) load(userptr, "glPolygonStipple");
3960 glPopAttrib = (PFNGLPOPATTRIBPROC) load(userptr, "glPopAttrib");
3961 glPopMatrix = (PFNGLPOPMATRIXPROC) load(userptr, "glPopMatrix");
3962 glPopName = (PFNGLPOPNAMEPROC) load(userptr, "glPopName");
3963 glPushAttrib = (PFNGLPUSHATTRIBPROC) load(userptr, "glPushAttrib");
3964 glPushMatrix = (PFNGLPUSHMATRIXPROC) load(userptr, "glPushMatrix");
3965 glPushName = (PFNGLPUSHNAMEPROC) load(userptr, "glPushName");
3966 glRasterPos2d = (PFNGLRASTERPOS2DPROC) load(userptr, "glRasterPos2d");
3967 glRasterPos2dv = (PFNGLRASTERPOS2DVPROC) load(userptr, "glRasterPos2dv");
3968 glRasterPos2f = (PFNGLRASTERPOS2FPROC) load(userptr, "glRasterPos2f");
3969 glRasterPos2fv = (PFNGLRASTERPOS2FVPROC) load(userptr, "glRasterPos2fv");
3970 glRasterPos2i = (PFNGLRASTERPOS2IPROC) load(userptr, "glRasterPos2i");
3971 glRasterPos2iv = (PFNGLRASTERPOS2IVPROC) load(userptr, "glRasterPos2iv");
3972 glRasterPos2s = (PFNGLRASTERPOS2SPROC) load(userptr, "glRasterPos2s");
3973 glRasterPos2sv = (PFNGLRASTERPOS2SVPROC) load(userptr, "glRasterPos2sv");
3974 glRasterPos3d = (PFNGLRASTERPOS3DPROC) load(userptr, "glRasterPos3d");
3975 glRasterPos3dv = (PFNGLRASTERPOS3DVPROC) load(userptr, "glRasterPos3dv");
3976 glRasterPos3f = (PFNGLRASTERPOS3FPROC) load(userptr, "glRasterPos3f");
3977 glRasterPos3fv = (PFNGLRASTERPOS3FVPROC) load(userptr, "glRasterPos3fv");
3978 glRasterPos3i = (PFNGLRASTERPOS3IPROC) load(userptr, "glRasterPos3i");
3979 glRasterPos3iv = (PFNGLRASTERPOS3IVPROC) load(userptr, "glRasterPos3iv");
3980 glRasterPos3s = (PFNGLRASTERPOS3SPROC) load(userptr, "glRasterPos3s");
3981 glRasterPos3sv = (PFNGLRASTERPOS3SVPROC) load(userptr, "glRasterPos3sv");
3982 glRasterPos4d = (PFNGLRASTERPOS4DPROC) load(userptr, "glRasterPos4d");
3983 glRasterPos4dv = (PFNGLRASTERPOS4DVPROC) load(userptr, "glRasterPos4dv");
3984 glRasterPos4f = (PFNGLRASTERPOS4FPROC) load(userptr, "glRasterPos4f");
3985 glRasterPos4fv = (PFNGLRASTERPOS4FVPROC) load(userptr, "glRasterPos4fv");
3986 glRasterPos4i = (PFNGLRASTERPOS4IPROC) load(userptr, "glRasterPos4i");
3987 glRasterPos4iv = (PFNGLRASTERPOS4IVPROC) load(userptr, "glRasterPos4iv");
3988 glRasterPos4s = (PFNGLRASTERPOS4SPROC) load(userptr, "glRasterPos4s");
3989 glRasterPos4sv = (PFNGLRASTERPOS4SVPROC) load(userptr, "glRasterPos4sv");
3990 glReadBuffer = (PFNGLREADBUFFERPROC) load(userptr, "glReadBuffer");
3991 glReadPixels = (PFNGLREADPIXELSPROC) load(userptr, "glReadPixels");
3992 glRectd = (PFNGLRECTDPROC) load(userptr, "glRectd");
3993 glRectdv = (PFNGLRECTDVPROC) load(userptr, "glRectdv");
3994 glRectf = (PFNGLRECTFPROC) load(userptr, "glRectf");
3995 glRectfv = (PFNGLRECTFVPROC) load(userptr, "glRectfv");
3996 glRecti = (PFNGLRECTIPROC) load(userptr, "glRecti");
3997 glRectiv = (PFNGLRECTIVPROC) load(userptr, "glRectiv");
3998 glRects = (PFNGLRECTSPROC) load(userptr, "glRects");
3999 glRectsv = (PFNGLRECTSVPROC) load(userptr, "glRectsv");
4000 glRenderMode = (PFNGLRENDERMODEPROC) load(userptr, "glRenderMode");
4001 glRotated = (PFNGLROTATEDPROC) load(userptr, "glRotated");
4002 glRotatef = (PFNGLROTATEFPROC) load(userptr, "glRotatef");
4003 glScaled = (PFNGLSCALEDPROC) load(userptr, "glScaled");
4004 glScalef = (PFNGLSCALEFPROC) load(userptr, "glScalef");
4005 glScissor = (PFNGLSCISSORPROC) load(userptr, "glScissor");
4006 glSelectBuffer = (PFNGLSELECTBUFFERPROC) load(userptr, "glSelectBuffer");
4007 glShadeModel = (PFNGLSHADEMODELPROC) load(userptr, "glShadeModel");
4008 glStencilFunc = (PFNGLSTENCILFUNCPROC) load(userptr, "glStencilFunc");
4009 glStencilMask = (PFNGLSTENCILMASKPROC) load(userptr, "glStencilMask");
4010 glStencilOp = (PFNGLSTENCILOPPROC) load(userptr, "glStencilOp");
4011 glTexCoord1d = (PFNGLTEXCOORD1DPROC) load(userptr, "glTexCoord1d");
4012 glTexCoord1dv = (PFNGLTEXCOORD1DVPROC) load(userptr, "glTexCoord1dv");
4013 glTexCoord1f = (PFNGLTEXCOORD1FPROC) load(userptr, "glTexCoord1f");
4014 glTexCoord1fv = (PFNGLTEXCOORD1FVPROC) load(userptr, "glTexCoord1fv");
4015 glTexCoord1i = (PFNGLTEXCOORD1IPROC) load(userptr, "glTexCoord1i");
4016 glTexCoord1iv = (PFNGLTEXCOORD1IVPROC) load(userptr, "glTexCoord1iv");
4017 glTexCoord1s = (PFNGLTEXCOORD1SPROC) load(userptr, "glTexCoord1s");
4018 glTexCoord1sv = (PFNGLTEXCOORD1SVPROC) load(userptr, "glTexCoord1sv");
4019 glTexCoord2d = (PFNGLTEXCOORD2DPROC) load(userptr, "glTexCoord2d");
4020 glTexCoord2dv = (PFNGLTEXCOORD2DVPROC) load(userptr, "glTexCoord2dv");
4021 glTexCoord2f = (PFNGLTEXCOORD2FPROC) load(userptr, "glTexCoord2f");
4022 glTexCoord2fv = (PFNGLTEXCOORD2FVPROC) load(userptr, "glTexCoord2fv");
4023 glTexCoord2i = (PFNGLTEXCOORD2IPROC) load(userptr, "glTexCoord2i");
4024 glTexCoord2iv = (PFNGLTEXCOORD2IVPROC) load(userptr, "glTexCoord2iv");
4025 glTexCoord2s = (PFNGLTEXCOORD2SPROC) load(userptr, "glTexCoord2s");
4026 glTexCoord2sv = (PFNGLTEXCOORD2SVPROC) load(userptr, "glTexCoord2sv");
4027 glTexCoord3d = (PFNGLTEXCOORD3DPROC) load(userptr, "glTexCoord3d");
4028 glTexCoord3dv = (PFNGLTEXCOORD3DVPROC) load(userptr, "glTexCoord3dv");
4029 glTexCoord3f = (PFNGLTEXCOORD3FPROC) load(userptr, "glTexCoord3f");
4030 glTexCoord3fv = (PFNGLTEXCOORD3FVPROC) load(userptr, "glTexCoord3fv");
4031 glTexCoord3i = (PFNGLTEXCOORD3IPROC) load(userptr, "glTexCoord3i");
4032 glTexCoord3iv = (PFNGLTEXCOORD3IVPROC) load(userptr, "glTexCoord3iv");
4033 glTexCoord3s = (PFNGLTEXCOORD3SPROC) load(userptr, "glTexCoord3s");
4034 glTexCoord3sv = (PFNGLTEXCOORD3SVPROC) load(userptr, "glTexCoord3sv");
4035 glTexCoord4d = (PFNGLTEXCOORD4DPROC) load(userptr, "glTexCoord4d");
4036 glTexCoord4dv = (PFNGLTEXCOORD4DVPROC) load(userptr, "glTexCoord4dv");
4037 glTexCoord4f = (PFNGLTEXCOORD4FPROC) load(userptr, "glTexCoord4f");
4038 glTexCoord4fv = (PFNGLTEXCOORD4FVPROC) load(userptr, "glTexCoord4fv");
4039 glTexCoord4i = (PFNGLTEXCOORD4IPROC) load(userptr, "glTexCoord4i");
4040 glTexCoord4iv = (PFNGLTEXCOORD4IVPROC) load(userptr, "glTexCoord4iv");
4041 glTexCoord4s = (PFNGLTEXCOORD4SPROC) load(userptr, "glTexCoord4s");
4042 glTexCoord4sv = (PFNGLTEXCOORD4SVPROC) load(userptr, "glTexCoord4sv");
4043 glTexEnvf = (PFNGLTEXENVFPROC) load(userptr, "glTexEnvf");
4044 glTexEnvfv = (PFNGLTEXENVFVPROC) load(userptr, "glTexEnvfv");
4045 glTexEnvi = (PFNGLTEXENVIPROC) load(userptr, "glTexEnvi");
4046 glTexEnviv = (PFNGLTEXENVIVPROC) load(userptr, "glTexEnviv");
4047 glTexGend = (PFNGLTEXGENDPROC) load(userptr, "glTexGend");
4048 glTexGendv = (PFNGLTEXGENDVPROC) load(userptr, "glTexGendv");
4049 glTexGenf = (PFNGLTEXGENFPROC) load(userptr, "glTexGenf");
4050 glTexGenfv = (PFNGLTEXGENFVPROC) load(userptr, "glTexGenfv");
4051 glTexGeni = (PFNGLTEXGENIPROC) load(userptr, "glTexGeni");
4052 glTexGeniv = (PFNGLTEXGENIVPROC) load(userptr, "glTexGeniv");
4053 glTexImage1D = (PFNGLTEXIMAGE1DPROC) load(userptr, "glTexImage1D");
4054 glTexImage2D = (PFNGLTEXIMAGE2DPROC) load(userptr, "glTexImage2D");
4055 glTexParameterf = (PFNGLTEXPARAMETERFPROC) load(userptr, "glTexParameterf");
4056 glTexParameterfv = (PFNGLTEXPARAMETERFVPROC) load(userptr, "glTexParameterfv");
4057 glTexParameteri = (PFNGLTEXPARAMETERIPROC) load(userptr, "glTexParameteri");
4058 glTexParameteriv = (PFNGLTEXPARAMETERIVPROC) load(userptr, "glTexParameteriv");
4059 glTranslated = (PFNGLTRANSLATEDPROC) load(userptr, "glTranslated");
4060 glTranslatef = (PFNGLTRANSLATEFPROC) load(userptr, "glTranslatef");
4061 glVertex2d = (PFNGLVERTEX2DPROC) load(userptr, "glVertex2d");
4062 glVertex2dv = (PFNGLVERTEX2DVPROC) load(userptr, "glVertex2dv");
4063 glVertex2f = (PFNGLVERTEX2FPROC) load(userptr, "glVertex2f");
4064 glVertex2fv = (PFNGLVERTEX2FVPROC) load(userptr, "glVertex2fv");
4065 glVertex2i = (PFNGLVERTEX2IPROC) load(userptr, "glVertex2i");
4066 glVertex2iv = (PFNGLVERTEX2IVPROC) load(userptr, "glVertex2iv");
4067 glVertex2s = (PFNGLVERTEX2SPROC) load(userptr, "glVertex2s");
4068 glVertex2sv = (PFNGLVERTEX2SVPROC) load(userptr, "glVertex2sv");
4069 glVertex3d = (PFNGLVERTEX3DPROC) load(userptr, "glVertex3d");
4070 glVertex3dv = (PFNGLVERTEX3DVPROC) load(userptr, "glVertex3dv");
4071 glVertex3f = (PFNGLVERTEX3FPROC) load(userptr, "glVertex3f");
4072 glVertex3fv = (PFNGLVERTEX3FVPROC) load(userptr, "glVertex3fv");
4073 glVertex3i = (PFNGLVERTEX3IPROC) load(userptr, "glVertex3i");
4074 glVertex3iv = (PFNGLVERTEX3IVPROC) load(userptr, "glVertex3iv");
4075 glVertex3s = (PFNGLVERTEX3SPROC) load(userptr, "glVertex3s");
4076 glVertex3sv = (PFNGLVERTEX3SVPROC) load(userptr, "glVertex3sv");
4077 glVertex4d = (PFNGLVERTEX4DPROC) load(userptr, "glVertex4d");
4078 glVertex4dv = (PFNGLVERTEX4DVPROC) load(userptr, "glVertex4dv");
4079 glVertex4f = (PFNGLVERTEX4FPROC) load(userptr, "glVertex4f");
4080 glVertex4fv = (PFNGLVERTEX4FVPROC) load(userptr, "glVertex4fv");
4081 glVertex4i = (PFNGLVERTEX4IPROC) load(userptr, "glVertex4i");
4082 glVertex4iv = (PFNGLVERTEX4IVPROC) load(userptr, "glVertex4iv");
4083 glVertex4s = (PFNGLVERTEX4SPROC) load(userptr, "glVertex4s");
4084 glVertex4sv = (PFNGLVERTEX4SVPROC) load(userptr, "glVertex4sv");
4085 glViewport = (PFNGLVIEWPORTPROC) load(userptr, "glViewport");
4086 }
4087 static void glad_gl_load_GL_VERSION_1_1( GLADuserptrloadfunc load, void* userptr) {
4088 if(!GLAD_GL_VERSION_1_1) return;
4089 glAreTexturesResident = (PFNGLARETEXTURESRESIDENTPROC) load(userptr, "glAreTexturesResident");
4090 glArrayElement = (PFNGLARRAYELEMENTPROC) load(userptr, "glArrayElement");
4091 glBindTexture = (PFNGLBINDTEXTUREPROC) load(userptr, "glBindTexture");
4092 glColorPointer = (PFNGLCOLORPOINTERPROC) load(userptr, "glColorPointer");
4093 glCopyTexImage1D = (PFNGLCOPYTEXIMAGE1DPROC) load(userptr, "glCopyTexImage1D");
4094 glCopyTexImage2D = (PFNGLCOPYTEXIMAGE2DPROC) load(userptr, "glCopyTexImage2D");
4095 glCopyTexSubImage1D = (PFNGLCOPYTEXSUBIMAGE1DPROC) load(userptr, "glCopyTexSubImage1D");
4096 glCopyTexSubImage2D = (PFNGLCOPYTEXSUBIMAGE2DPROC) load(userptr, "glCopyTexSubImage2D");
4097 glDeleteTextures = (PFNGLDELETETEXTURESPROC) load(userptr, "glDeleteTextures");
4098 glDisableClientState = (PFNGLDISABLECLIENTSTATEPROC) load(userptr, "glDisableClientState");
4099 glDrawArrays = (PFNGLDRAWARRAYSPROC) load(userptr, "glDrawArrays");
4100 glDrawElements = (PFNGLDRAWELEMENTSPROC) load(userptr, "glDrawElements");
4101 glEdgeFlagPointer = (PFNGLEDGEFLAGPOINTERPROC) load(userptr, "glEdgeFlagPointer");
4102 glEnableClientState = (PFNGLENABLECLIENTSTATEPROC) load(userptr, "glEnableClientState");
4103 glGenTextures = (PFNGLGENTEXTURESPROC) load(userptr, "glGenTextures");
4104 glGetPointerv = (PFNGLGETPOINTERVPROC) load(userptr, "glGetPointerv");
4105 glIndexPointer = (PFNGLINDEXPOINTERPROC) load(userptr, "glIndexPointer");
4106 glIndexub = (PFNGLINDEXUBPROC) load(userptr, "glIndexub");
4107 glIndexubv = (PFNGLINDEXUBVPROC) load(userptr, "glIndexubv");
4108 glInterleavedArrays = (PFNGLINTERLEAVEDARRAYSPROC) load(userptr, "glInterleavedArrays");
4109 glIsTexture = (PFNGLISTEXTUREPROC) load(userptr, "glIsTexture");
4110 glNormalPointer = (PFNGLNORMALPOINTERPROC) load(userptr, "glNormalPointer");
4111 glPolygonOffset = (PFNGLPOLYGONOFFSETPROC) load(userptr, "glPolygonOffset");
4112 glPopClientAttrib = (PFNGLPOPCLIENTATTRIBPROC) load(userptr, "glPopClientAttrib");
4113 glPrioritizeTextures = (PFNGLPRIORITIZETEXTURESPROC) load(userptr, "glPrioritizeTextures");
4114 glPushClientAttrib = (PFNGLPUSHCLIENTATTRIBPROC) load(userptr, "glPushClientAttrib");
4115 glTexCoordPointer = (PFNGLTEXCOORDPOINTERPROC) load(userptr, "glTexCoordPointer");
4116 glTexSubImage1D = (PFNGLTEXSUBIMAGE1DPROC) load(userptr, "glTexSubImage1D");
4117 glTexSubImage2D = (PFNGLTEXSUBIMAGE2DPROC) load(userptr, "glTexSubImage2D");
4118 glVertexPointer = (PFNGLVERTEXPOINTERPROC) load(userptr, "glVertexPointer");
4119 }
4120 static void glad_gl_load_GL_VERSION_1_2( GLADuserptrloadfunc load, void* userptr) {
4121 if(!GLAD_GL_VERSION_1_2) return;
4122 glCopyTexSubImage3D = (PFNGLCOPYTEXSUBIMAGE3DPROC) load(userptr, "glCopyTexSubImage3D");
4123 glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC) load(userptr, "glDrawRangeElements");
4124 glTexImage3D = (PFNGLTEXIMAGE3DPROC) load(userptr, "glTexImage3D");
4125 glTexSubImage3D = (PFNGLTEXSUBIMAGE3DPROC) load(userptr, "glTexSubImage3D");
4126 }
4127 static void glad_gl_load_GL_VERSION_1_3( GLADuserptrloadfunc load, void* userptr) {
4128 if(!GLAD_GL_VERSION_1_3) return;
4129 glActiveTexture = (PFNGLACTIVETEXTUREPROC) load(userptr, "glActiveTexture");
4130 glClientActiveTexture = (PFNGLCLIENTACTIVETEXTUREPROC) load(userptr, "glClientActiveTexture");
4131 glCompressedTexImage1D = (PFNGLCOMPRESSEDTEXIMAGE1DPROC) load(userptr, "glCompressedTexImage1D");
4132 glCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC) load(userptr, "glCompressedTexImage2D");
4133 glCompressedTexImage3D = (PFNGLCOMPRESSEDTEXIMAGE3DPROC) load(userptr, "glCompressedTexImage3D");
4134 glCompressedTexSubImage1D = (PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) load(userptr, "glCompressedTexSubImage1D");
4135 glCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) load(userptr, "glCompressedTexSubImage2D");
4136 glCompressedTexSubImage3D = (PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) load(userptr, "glCompressedTexSubImage3D");
4137 glGetCompressedTexImage = (PFNGLGETCOMPRESSEDTEXIMAGEPROC) load(userptr, "glGetCompressedTexImage");
4138 glLoadTransposeMatrixd = (PFNGLLOADTRANSPOSEMATRIXDPROC) load(userptr, "glLoadTransposeMatrixd");
4139 glLoadTransposeMatrixf = (PFNGLLOADTRANSPOSEMATRIXFPROC) load(userptr, "glLoadTransposeMatrixf");
4140 glMultTransposeMatrixd = (PFNGLMULTTRANSPOSEMATRIXDPROC) load(userptr, "glMultTransposeMatrixd");
4141 glMultTransposeMatrixf = (PFNGLMULTTRANSPOSEMATRIXFPROC) load(userptr, "glMultTransposeMatrixf");
4142 glMultiTexCoord1d = (PFNGLMULTITEXCOORD1DPROC) load(userptr, "glMultiTexCoord1d");
4143 glMultiTexCoord1dv = (PFNGLMULTITEXCOORD1DVPROC) load(userptr, "glMultiTexCoord1dv");
4144 glMultiTexCoord1f = (PFNGLMULTITEXCOORD1FPROC) load(userptr, "glMultiTexCoord1f");
4145 glMultiTexCoord1fv = (PFNGLMULTITEXCOORD1FVPROC) load(userptr, "glMultiTexCoord1fv");
4146 glMultiTexCoord1i = (PFNGLMULTITEXCOORD1IPROC) load(userptr, "glMultiTexCoord1i");
4147 glMultiTexCoord1iv = (PFNGLMULTITEXCOORD1IVPROC) load(userptr, "glMultiTexCoord1iv");
4148 glMultiTexCoord1s = (PFNGLMULTITEXCOORD1SPROC) load(userptr, "glMultiTexCoord1s");
4149 glMultiTexCoord1sv = (PFNGLMULTITEXCOORD1SVPROC) load(userptr, "glMultiTexCoord1sv");
4150 glMultiTexCoord2d = (PFNGLMULTITEXCOORD2DPROC) load(userptr, "glMultiTexCoord2d");
4151 glMultiTexCoord2dv = (PFNGLMULTITEXCOORD2DVPROC) load(userptr, "glMultiTexCoord2dv");
4152 glMultiTexCoord2f = (PFNGLMULTITEXCOORD2FPROC) load(userptr, "glMultiTexCoord2f");
4153 glMultiTexCoord2fv = (PFNGLMULTITEXCOORD2FVPROC) load(userptr, "glMultiTexCoord2fv");
4154 glMultiTexCoord2i = (PFNGLMULTITEXCOORD2IPROC) load(userptr, "glMultiTexCoord2i");
4155 glMultiTexCoord2iv = (PFNGLMULTITEXCOORD2IVPROC) load(userptr, "glMultiTexCoord2iv");
4156 glMultiTexCoord2s = (PFNGLMULTITEXCOORD2SPROC) load(userptr, "glMultiTexCoord2s");
4157 glMultiTexCoord2sv = (PFNGLMULTITEXCOORD2SVPROC) load(userptr, "glMultiTexCoord2sv");
4158 glMultiTexCoord3d = (PFNGLMULTITEXCOORD3DPROC) load(userptr, "glMultiTexCoord3d");
4159 glMultiTexCoord3dv = (PFNGLMULTITEXCOORD3DVPROC) load(userptr, "glMultiTexCoord3dv");
4160 glMultiTexCoord3f = (PFNGLMULTITEXCOORD3FPROC) load(userptr, "glMultiTexCoord3f");
4161 glMultiTexCoord3fv = (PFNGLMULTITEXCOORD3FVPROC) load(userptr, "glMultiTexCoord3fv");
4162 glMultiTexCoord3i = (PFNGLMULTITEXCOORD3IPROC) load(userptr, "glMultiTexCoord3i");
4163 glMultiTexCoord3iv = (PFNGLMULTITEXCOORD3IVPROC) load(userptr, "glMultiTexCoord3iv");
4164 glMultiTexCoord3s = (PFNGLMULTITEXCOORD3SPROC) load(userptr, "glMultiTexCoord3s");
4165 glMultiTexCoord3sv = (PFNGLMULTITEXCOORD3SVPROC) load(userptr, "glMultiTexCoord3sv");
4166 glMultiTexCoord4d = (PFNGLMULTITEXCOORD4DPROC) load(userptr, "glMultiTexCoord4d");
4167 glMultiTexCoord4dv = (PFNGLMULTITEXCOORD4DVPROC) load(userptr, "glMultiTexCoord4dv");
4168 glMultiTexCoord4f = (PFNGLMULTITEXCOORD4FPROC) load(userptr, "glMultiTexCoord4f");
4169 glMultiTexCoord4fv = (PFNGLMULTITEXCOORD4FVPROC) load(userptr, "glMultiTexCoord4fv");
4170 glMultiTexCoord4i = (PFNGLMULTITEXCOORD4IPROC) load(userptr, "glMultiTexCoord4i");
4171 glMultiTexCoord4iv = (PFNGLMULTITEXCOORD4IVPROC) load(userptr, "glMultiTexCoord4iv");
4172 glMultiTexCoord4s = (PFNGLMULTITEXCOORD4SPROC) load(userptr, "glMultiTexCoord4s");
4173 glMultiTexCoord4sv = (PFNGLMULTITEXCOORD4SVPROC) load(userptr, "glMultiTexCoord4sv");
4174 glSampleCoverage = (PFNGLSAMPLECOVERAGEPROC) load(userptr, "glSampleCoverage");
4175 }
4176 static void glad_gl_load_GL_VERSION_1_4( GLADuserptrloadfunc load, void* userptr) {
4177 if(!GLAD_GL_VERSION_1_4) return;
4178 glBlendColor = (PFNGLBLENDCOLORPROC) load(userptr, "glBlendColor");
4179 glBlendEquation = (PFNGLBLENDEQUATIONPROC) load(userptr, "glBlendEquation");
4180 glBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC) load(userptr, "glBlendFuncSeparate");
4181 glFogCoordPointer = (PFNGLFOGCOORDPOINTERPROC) load(userptr, "glFogCoordPointer");
4182 glFogCoordd = (PFNGLFOGCOORDDPROC) load(userptr, "glFogCoordd");
4183 glFogCoorddv = (PFNGLFOGCOORDDVPROC) load(userptr, "glFogCoorddv");
4184 glFogCoordf = (PFNGLFOGCOORDFPROC) load(userptr, "glFogCoordf");
4185 glFogCoordfv = (PFNGLFOGCOORDFVPROC) load(userptr, "glFogCoordfv");
4186 glMultiDrawArrays = (PFNGLMULTIDRAWARRAYSPROC) load(userptr, "glMultiDrawArrays");
4187 glMultiDrawElements = (PFNGLMULTIDRAWELEMENTSPROC) load(userptr, "glMultiDrawElements");
4188 glPointParameterf = (PFNGLPOINTPARAMETERFPROC) load(userptr, "glPointParameterf");
4189 glPointParameterfv = (PFNGLPOINTPARAMETERFVPROC) load(userptr, "glPointParameterfv");
4190 glPointParameteri = (PFNGLPOINTPARAMETERIPROC) load(userptr, "glPointParameteri");
4191 glPointParameteriv = (PFNGLPOINTPARAMETERIVPROC) load(userptr, "glPointParameteriv");
4192 glSecondaryColor3b = (PFNGLSECONDARYCOLOR3BPROC) load(userptr, "glSecondaryColor3b");
4193 glSecondaryColor3bv = (PFNGLSECONDARYCOLOR3BVPROC) load(userptr, "glSecondaryColor3bv");
4194 glSecondaryColor3d = (PFNGLSECONDARYCOLOR3DPROC) load(userptr, "glSecondaryColor3d");
4195 glSecondaryColor3dv = (PFNGLSECONDARYCOLOR3DVPROC) load(userptr, "glSecondaryColor3dv");
4196 glSecondaryColor3f = (PFNGLSECONDARYCOLOR3FPROC) load(userptr, "glSecondaryColor3f");
4197 glSecondaryColor3fv = (PFNGLSECONDARYCOLOR3FVPROC) load(userptr, "glSecondaryColor3fv");
4198 glSecondaryColor3i = (PFNGLSECONDARYCOLOR3IPROC) load(userptr, "glSecondaryColor3i");
4199 glSecondaryColor3iv = (PFNGLSECONDARYCOLOR3IVPROC) load(userptr, "glSecondaryColor3iv");
4200 glSecondaryColor3s = (PFNGLSECONDARYCOLOR3SPROC) load(userptr, "glSecondaryColor3s");
4201 glSecondaryColor3sv = (PFNGLSECONDARYCOLOR3SVPROC) load(userptr, "glSecondaryColor3sv");
4202 glSecondaryColor3ub = (PFNGLSECONDARYCOLOR3UBPROC) load(userptr, "glSecondaryColor3ub");
4203 glSecondaryColor3ubv = (PFNGLSECONDARYCOLOR3UBVPROC) load(userptr, "glSecondaryColor3ubv");
4204 glSecondaryColor3ui = (PFNGLSECONDARYCOLOR3UIPROC) load(userptr, "glSecondaryColor3ui");
4205 glSecondaryColor3uiv = (PFNGLSECONDARYCOLOR3UIVPROC) load(userptr, "glSecondaryColor3uiv");
4206 glSecondaryColor3us = (PFNGLSECONDARYCOLOR3USPROC) load(userptr, "glSecondaryColor3us");
4207 glSecondaryColor3usv = (PFNGLSECONDARYCOLOR3USVPROC) load(userptr, "glSecondaryColor3usv");
4208 glSecondaryColorPointer = (PFNGLSECONDARYCOLORPOINTERPROC) load(userptr, "glSecondaryColorPointer");
4209 glWindowPos2d = (PFNGLWINDOWPOS2DPROC) load(userptr, "glWindowPos2d");
4210 glWindowPos2dv = (PFNGLWINDOWPOS2DVPROC) load(userptr, "glWindowPos2dv");
4211 glWindowPos2f = (PFNGLWINDOWPOS2FPROC) load(userptr, "glWindowPos2f");
4212 glWindowPos2fv = (PFNGLWINDOWPOS2FVPROC) load(userptr, "glWindowPos2fv");
4213 glWindowPos2i = (PFNGLWINDOWPOS2IPROC) load(userptr, "glWindowPos2i");
4214 glWindowPos2iv = (PFNGLWINDOWPOS2IVPROC) load(userptr, "glWindowPos2iv");
4215 glWindowPos2s = (PFNGLWINDOWPOS2SPROC) load(userptr, "glWindowPos2s");
4216 glWindowPos2sv = (PFNGLWINDOWPOS2SVPROC) load(userptr, "glWindowPos2sv");
4217 glWindowPos3d = (PFNGLWINDOWPOS3DPROC) load(userptr, "glWindowPos3d");
4218 glWindowPos3dv = (PFNGLWINDOWPOS3DVPROC) load(userptr, "glWindowPos3dv");
4219 glWindowPos3f = (PFNGLWINDOWPOS3FPROC) load(userptr, "glWindowPos3f");
4220 glWindowPos3fv = (PFNGLWINDOWPOS3FVPROC) load(userptr, "glWindowPos3fv");
4221 glWindowPos3i = (PFNGLWINDOWPOS3IPROC) load(userptr, "glWindowPos3i");
4222 glWindowPos3iv = (PFNGLWINDOWPOS3IVPROC) load(userptr, "glWindowPos3iv");
4223 glWindowPos3s = (PFNGLWINDOWPOS3SPROC) load(userptr, "glWindowPos3s");
4224 glWindowPos3sv = (PFNGLWINDOWPOS3SVPROC) load(userptr, "glWindowPos3sv");
4225 }
4226 static void glad_gl_load_GL_VERSION_1_5( GLADuserptrloadfunc load, void* userptr) {
4227 if(!GLAD_GL_VERSION_1_5) return;
4228 glBeginQuery = (PFNGLBEGINQUERYPROC) load(userptr, "glBeginQuery");
4229 glBindBuffer = (PFNGLBINDBUFFERPROC) load(userptr, "glBindBuffer");
4230 glBufferData = (PFNGLBUFFERDATAPROC) load(userptr, "glBufferData");
4231 glBufferSubData = (PFNGLBUFFERSUBDATAPROC) load(userptr, "glBufferSubData");
4232 glDeleteBuffers = (PFNGLDELETEBUFFERSPROC) load(userptr, "glDeleteBuffers");
4233 glDeleteQueries = (PFNGLDELETEQUERIESPROC) load(userptr, "glDeleteQueries");
4234 glEndQuery = (PFNGLENDQUERYPROC) load(userptr, "glEndQuery");
4235 glGenBuffers = (PFNGLGENBUFFERSPROC) load(userptr, "glGenBuffers");
4236 glGenQueries = (PFNGLGENQUERIESPROC) load(userptr, "glGenQueries");
4237 glGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC) load(userptr, "glGetBufferParameteriv");
4238 glGetBufferPointerv = (PFNGLGETBUFFERPOINTERVPROC) load(userptr, "glGetBufferPointerv");
4239 glGetBufferSubData = (PFNGLGETBUFFERSUBDATAPROC) load(userptr, "glGetBufferSubData");
4240 glGetQueryObjectiv = (PFNGLGETQUERYOBJECTIVPROC) load(userptr, "glGetQueryObjectiv");
4241 glGetQueryObjectuiv = (PFNGLGETQUERYOBJECTUIVPROC) load(userptr, "glGetQueryObjectuiv");
4242 glGetQueryiv = (PFNGLGETQUERYIVPROC) load(userptr, "glGetQueryiv");
4243 glIsBuffer = (PFNGLISBUFFERPROC) load(userptr, "glIsBuffer");
4244 glIsQuery = (PFNGLISQUERYPROC) load(userptr, "glIsQuery");
4245 glMapBuffer = (PFNGLMAPBUFFERPROC) load(userptr, "glMapBuffer");
4246 glUnmapBuffer = (PFNGLUNMAPBUFFERPROC) load(userptr, "glUnmapBuffer");
4247 }
4248 static void glad_gl_load_GL_VERSION_2_0( GLADuserptrloadfunc load, void* userptr) {
4249 if(!GLAD_GL_VERSION_2_0) return;
4250 glAttachShader = (PFNGLATTACHSHADERPROC) load(userptr, "glAttachShader");
4251 glBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC) load(userptr, "glBindAttribLocation");
4252 glBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC) load(userptr, "glBlendEquationSeparate");
4253 glCompileShader = (PFNGLCOMPILESHADERPROC) load(userptr, "glCompileShader");
4254 glCreateProgram = (PFNGLCREATEPROGRAMPROC) load(userptr, "glCreateProgram");
4255 glCreateShader = (PFNGLCREATESHADERPROC) load(userptr, "glCreateShader");
4256 glDeleteProgram = (PFNGLDELETEPROGRAMPROC) load(userptr, "glDeleteProgram");
4257 glDeleteShader = (PFNGLDELETESHADERPROC) load(userptr, "glDeleteShader");
4258 glDetachShader = (PFNGLDETACHSHADERPROC) load(userptr, "glDetachShader");
4259 glDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC) load(userptr, "glDisableVertexAttribArray");
4260 glDrawBuffers = (PFNGLDRAWBUFFERSPROC) load(userptr, "glDrawBuffers");
4261 glEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC) load(userptr, "glEnableVertexAttribArray");
4262 glGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC) load(userptr, "glGetActiveAttrib");
4263 glGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC) load(userptr, "glGetActiveUniform");
4264 glGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC) load(userptr, "glGetAttachedShaders");
4265 glGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC) load(userptr, "glGetAttribLocation");
4266 glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC) load(userptr, "glGetProgramInfoLog");
4267 glGetProgramiv = (PFNGLGETPROGRAMIVPROC) load(userptr, "glGetProgramiv");
4268 glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC) load(userptr, "glGetShaderInfoLog");
4269 glGetShaderSource = (PFNGLGETSHADERSOURCEPROC) load(userptr, "glGetShaderSource");
4270 glGetShaderiv = (PFNGLGETSHADERIVPROC) load(userptr, "glGetShaderiv");
4271 glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC) load(userptr, "glGetUniformLocation");
4272 glGetUniformfv = (PFNGLGETUNIFORMFVPROC) load(userptr, "glGetUniformfv");
4273 glGetUniformiv = (PFNGLGETUNIFORMIVPROC) load(userptr, "glGetUniformiv");
4274 glGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC) load(userptr, "glGetVertexAttribPointerv");
4275 glGetVertexAttribdv = (PFNGLGETVERTEXATTRIBDVPROC) load(userptr, "glGetVertexAttribdv");
4276 glGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC) load(userptr, "glGetVertexAttribfv");
4277 glGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC) load(userptr, "glGetVertexAttribiv");
4278 glIsProgram = (PFNGLISPROGRAMPROC) load(userptr, "glIsProgram");
4279 glIsShader = (PFNGLISSHADERPROC) load(userptr, "glIsShader");
4280 glLinkProgram = (PFNGLLINKPROGRAMPROC) load(userptr, "glLinkProgram");
4281 glShaderSource = (PFNGLSHADERSOURCEPROC) load(userptr, "glShaderSource");
4282 glStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC) load(userptr, "glStencilFuncSeparate");
4283 glStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC) load(userptr, "glStencilMaskSeparate");
4284 glStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC) load(userptr, "glStencilOpSeparate");
4285 glUniform1f = (PFNGLUNIFORM1FPROC) load(userptr, "glUniform1f");
4286 glUniform1fv = (PFNGLUNIFORM1FVPROC) load(userptr, "glUniform1fv");
4287 glUniform1i = (PFNGLUNIFORM1IPROC) load(userptr, "glUniform1i");
4288 glUniform1iv = (PFNGLUNIFORM1IVPROC) load(userptr, "glUniform1iv");
4289 glUniform2f = (PFNGLUNIFORM2FPROC) load(userptr, "glUniform2f");
4290 glUniform2fv = (PFNGLUNIFORM2FVPROC) load(userptr, "glUniform2fv");
4291 glUniform2i = (PFNGLUNIFORM2IPROC) load(userptr, "glUniform2i");
4292 glUniform2iv = (PFNGLUNIFORM2IVPROC) load(userptr, "glUniform2iv");
4293 glUniform3f = (PFNGLUNIFORM3FPROC) load(userptr, "glUniform3f");
4294 glUniform3fv = (PFNGLUNIFORM3FVPROC) load(userptr, "glUniform3fv");
4295 glUniform3i = (PFNGLUNIFORM3IPROC) load(userptr, "glUniform3i");
4296 glUniform3iv = (PFNGLUNIFORM3IVPROC) load(userptr, "glUniform3iv");
4297 glUniform4f = (PFNGLUNIFORM4FPROC) load(userptr, "glUniform4f");
4298 glUniform4fv = (PFNGLUNIFORM4FVPROC) load(userptr, "glUniform4fv");
4299 glUniform4i = (PFNGLUNIFORM4IPROC) load(userptr, "glUniform4i");
4300 glUniform4iv = (PFNGLUNIFORM4IVPROC) load(userptr, "glUniform4iv");
4301 glUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC) load(userptr, "glUniformMatrix2fv");
4302 glUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC) load(userptr, "glUniformMatrix3fv");
4303 glUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC) load(userptr, "glUniformMatrix4fv");
4304 glUseProgram = (PFNGLUSEPROGRAMPROC) load(userptr, "glUseProgram");
4305 glValidateProgram = (PFNGLVALIDATEPROGRAMPROC) load(userptr, "glValidateProgram");
4306 glVertexAttrib1d = (PFNGLVERTEXATTRIB1DPROC) load(userptr, "glVertexAttrib1d");
4307 glVertexAttrib1dv = (PFNGLVERTEXATTRIB1DVPROC) load(userptr, "glVertexAttrib1dv");
4308 glVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC) load(userptr, "glVertexAttrib1f");
4309 glVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC) load(userptr, "glVertexAttrib1fv");
4310 glVertexAttrib1s = (PFNGLVERTEXATTRIB1SPROC) load(userptr, "glVertexAttrib1s");
4311 glVertexAttrib1sv = (PFNGLVERTEXATTRIB1SVPROC) load(userptr, "glVertexAttrib1sv");
4312 glVertexAttrib2d = (PFNGLVERTEXATTRIB2DPROC) load(userptr, "glVertexAttrib2d");
4313 glVertexAttrib2dv = (PFNGLVERTEXATTRIB2DVPROC) load(userptr, "glVertexAttrib2dv");
4314 glVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC) load(userptr, "glVertexAttrib2f");
4315 glVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC) load(userptr, "glVertexAttrib2fv");
4316 glVertexAttrib2s = (PFNGLVERTEXATTRIB2SPROC) load(userptr, "glVertexAttrib2s");
4317 glVertexAttrib2sv = (PFNGLVERTEXATTRIB2SVPROC) load(userptr, "glVertexAttrib2sv");
4318 glVertexAttrib3d = (PFNGLVERTEXATTRIB3DPROC) load(userptr, "glVertexAttrib3d");
4319 glVertexAttrib3dv = (PFNGLVERTEXATTRIB3DVPROC) load(userptr, "glVertexAttrib3dv");
4320 glVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC) load(userptr, "glVertexAttrib3f");
4321 glVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC) load(userptr, "glVertexAttrib3fv");
4322 glVertexAttrib3s = (PFNGLVERTEXATTRIB3SPROC) load(userptr, "glVertexAttrib3s");
4323 glVertexAttrib3sv = (PFNGLVERTEXATTRIB3SVPROC) load(userptr, "glVertexAttrib3sv");
4324 glVertexAttrib4Nbv = (PFNGLVERTEXATTRIB4NBVPROC) load(userptr, "glVertexAttrib4Nbv");
4325 glVertexAttrib4Niv = (PFNGLVERTEXATTRIB4NIVPROC) load(userptr, "glVertexAttrib4Niv");
4326 glVertexAttrib4Nsv = (PFNGLVERTEXATTRIB4NSVPROC) load(userptr, "glVertexAttrib4Nsv");
4327 glVertexAttrib4Nub = (PFNGLVERTEXATTRIB4NUBPROC) load(userptr, "glVertexAttrib4Nub");
4328 glVertexAttrib4Nubv = (PFNGLVERTEXATTRIB4NUBVPROC) load(userptr, "glVertexAttrib4Nubv");
4329 glVertexAttrib4Nuiv = (PFNGLVERTEXATTRIB4NUIVPROC) load(userptr, "glVertexAttrib4Nuiv");
4330 glVertexAttrib4Nusv = (PFNGLVERTEXATTRIB4NUSVPROC) load(userptr, "glVertexAttrib4Nusv");
4331 glVertexAttrib4bv = (PFNGLVERTEXATTRIB4BVPROC) load(userptr, "glVertexAttrib4bv");
4332 glVertexAttrib4d = (PFNGLVERTEXATTRIB4DPROC) load(userptr, "glVertexAttrib4d");
4333 glVertexAttrib4dv = (PFNGLVERTEXATTRIB4DVPROC) load(userptr, "glVertexAttrib4dv");
4334 glVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC) load(userptr, "glVertexAttrib4f");
4335 glVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC) load(userptr, "glVertexAttrib4fv");
4336 glVertexAttrib4iv = (PFNGLVERTEXATTRIB4IVPROC) load(userptr, "glVertexAttrib4iv");
4337 glVertexAttrib4s = (PFNGLVERTEXATTRIB4SPROC) load(userptr, "glVertexAttrib4s");
4338 glVertexAttrib4sv = (PFNGLVERTEXATTRIB4SVPROC) load(userptr, "glVertexAttrib4sv");
4339 glVertexAttrib4ubv = (PFNGLVERTEXATTRIB4UBVPROC) load(userptr, "glVertexAttrib4ubv");
4340 glVertexAttrib4uiv = (PFNGLVERTEXATTRIB4UIVPROC) load(userptr, "glVertexAttrib4uiv");
4341 glVertexAttrib4usv = (PFNGLVERTEXATTRIB4USVPROC) load(userptr, "glVertexAttrib4usv");
4342 glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC) load(userptr, "glVertexAttribPointer");
4343 }
4344 static void glad_gl_load_GL_EXT_framebuffer_object( GLADuserptrloadfunc load, void* userptr) {
4345 if(!GLAD_GL_EXT_framebuffer_object) return;
4346 glBindFramebufferEXT = (PFNGLBINDFRAMEBUFFEREXTPROC) load(userptr, "glBindFramebufferEXT");
4347 glBindRenderbufferEXT = (PFNGLBINDRENDERBUFFEREXTPROC) load(userptr, "glBindRenderbufferEXT");
4348 glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC) load(userptr, "glCheckFramebufferStatus");
4349 glCheckFramebufferStatusEXT = (PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) load(userptr, "glCheckFramebufferStatusEXT");
4350 glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC) load(userptr, "glDeleteFramebuffers");
4351 glDeleteFramebuffersEXT = (PFNGLDELETEFRAMEBUFFERSEXTPROC) load(userptr, "glDeleteFramebuffersEXT");
4352 glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC) load(userptr, "glDeleteRenderbuffers");
4353 glDeleteRenderbuffersEXT = (PFNGLDELETERENDERBUFFERSEXTPROC) load(userptr, "glDeleteRenderbuffersEXT");
4354 glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC) load(userptr, "glFramebufferRenderbuffer");
4355 glFramebufferRenderbufferEXT = (PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) load(userptr, "glFramebufferRenderbufferEXT");
4356 glFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC) load(userptr, "glFramebufferTexture1D");
4357 glFramebufferTexture1DEXT = (PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) load(userptr, "glFramebufferTexture1DEXT");
4358 glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC) load(userptr, "glFramebufferTexture2D");
4359 glFramebufferTexture2DEXT = (PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) load(userptr, "glFramebufferTexture2DEXT");
4360 glFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC) load(userptr, "glFramebufferTexture3D");
4361 glFramebufferTexture3DEXT = (PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) load(userptr, "glFramebufferTexture3DEXT");
4362 glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC) load(userptr, "glGenFramebuffers");
4363 glGenFramebuffersEXT = (PFNGLGENFRAMEBUFFERSEXTPROC) load(userptr, "glGenFramebuffersEXT");
4364 glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC) load(userptr, "glGenRenderbuffers");
4365 glGenRenderbuffersEXT = (PFNGLGENRENDERBUFFERSEXTPROC) load(userptr, "glGenRenderbuffersEXT");
4366 glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC) load(userptr, "glGenerateMipmap");
4367 glGenerateMipmapEXT = (PFNGLGENERATEMIPMAPEXTPROC) load(userptr, "glGenerateMipmapEXT");
4368 glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) load(userptr, "glGetFramebufferAttachmentParameteriv");
4369 glGetFramebufferAttachmentParameterivEXT = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) load(userptr, "glGetFramebufferAttachmentParameterivEXT");
4370 glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC) load(userptr, "glGetRenderbufferParameteriv");
4371 glGetRenderbufferParameterivEXT = (PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) load(userptr, "glGetRenderbufferParameterivEXT");
4372 glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC) load(userptr, "glIsFramebuffer");
4373 glIsFramebufferEXT = (PFNGLISFRAMEBUFFEREXTPROC) load(userptr, "glIsFramebufferEXT");
4374 glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC) load(userptr, "glIsRenderbuffer");
4375 glIsRenderbufferEXT = (PFNGLISRENDERBUFFEREXTPROC) load(userptr, "glIsRenderbufferEXT");
4376 glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC) load(userptr, "glRenderbufferStorage");
4377 glRenderbufferStorageEXT = (PFNGLRENDERBUFFERSTORAGEEXTPROC) load(userptr, "glRenderbufferStorageEXT");
4378 }
4379
4380
4381
4382 #if defined(GL_ES_VERSION_3_0) || defined(GL_VERSION_3_0)
4383 #define GLAD_GL_IS_SOME_NEW_VERSION 1
4384 #else
4385 #define GLAD_GL_IS_SOME_NEW_VERSION 0
4386 #endif
4387
4388 static int glad_gl_get_extensions( int version, const char **out_exts, unsigned int *out_num_exts_i, char ***out_exts_i) {
4389 #if GLAD_GL_IS_SOME_NEW_VERSION
4390 if(GLAD_VERSION_MAJOR(version) < 3) {
4391 #else
4392 (void) version;
4393 (void) out_num_exts_i;
4394 (void) out_exts_i;
4395 #endif
4396 if (glGetString == NULL) {
4397 return 0;
4398 }
4399 *out_exts = (const char *)glGetString(GL_EXTENSIONS);
4400 #if GLAD_GL_IS_SOME_NEW_VERSION
4401 } else {
4402 unsigned int index = 0;
4403 unsigned int num_exts_i = 0;
4404 char **exts_i = NULL;
4405 if (glGetStringi == NULL || glGetIntegerv == NULL) {
4406 return 0;
4407 }
4408 glGetIntegerv(GL_NUM_EXTENSIONS, (int*) &num_exts_i);
4409 if (num_exts_i > 0) {
4410 exts_i = (char **) malloc(num_exts_i * (sizeof *exts_i));
4411 }
4412 if (exts_i == NULL) {
4413 return 0;
4414 }
4415 for(index = 0; index < num_exts_i; index++) {
4416 const char *gl_str_tmp = (const char*) glGetStringi(GL_EXTENSIONS, index);
4417 size_t len = strlen(gl_str_tmp) + 1;
4418
4419 char *local_str = (char*) malloc(len * sizeof(char));
4420 if(local_str != NULL) {
4421 memcpy(local_str, gl_str_tmp, len * sizeof(char));
4422 }
4423
4424 exts_i[index] = local_str;
4425 }
4426
4427 *out_num_exts_i = num_exts_i;
4428 *out_exts_i = exts_i;
4429 }
4430 #endif
4431 return 1;
4432 }
4433 static void glad_gl_free_extensions(char **exts_i, unsigned int num_exts_i) {
4434 if (exts_i != NULL) {
4435 unsigned int index;
4436 for(index = 0; index < num_exts_i; index++) {
4437 free((void *) (exts_i[index]));
4438 }
4439 free((void *)exts_i);
4440 exts_i = NULL;
4441 }
4442 }
4443 static int glad_gl_has_extension(int version, const char *exts, unsigned int num_exts_i, char **exts_i, const char *ext) {
4444 if(GLAD_VERSION_MAJOR(version) < 3 || !GLAD_GL_IS_SOME_NEW_VERSION) {
4445 const char *extensions;
4446 const char *loc;
4447 const char *terminator;
4448 extensions = exts;
4449 if(extensions == NULL || ext == NULL) {
4450 return 0;
4451 }
4452 while(1) {
4453 loc = strstr(extensions, ext);
4454 if(loc == NULL) {
4455 return 0;
4456 }
4457 terminator = loc + strlen(ext);
4458 if((loc == extensions || *(loc - 1) == ' ') &&
4459 (*terminator == ' ' || *terminator == '\0')) {
4460 return 1;
4461 }
4462 extensions = terminator;
4463 }
4464 } else {
4465 unsigned int index;
4466 for(index = 0; index < num_exts_i; index++) {
4467 const char *e = exts_i[index];
4468 if(strcmp(e, ext) == 0) {
4469 return 1;
4470 }
4471 }
4472 }
4473 return 0;
4474 }
4475
4476 static GLADapiproc glad_gl_get_proc_from_userptr(void *userptr, const char* name) {
4477 return (GLAD_GNUC_EXTENSION (GLADapiproc (*)(const char *name)) userptr)(name);
4478 }
4479
4480 static int glad_gl_find_extensions_gl( int version) {
4481 const char *exts = NULL;
4482 unsigned int num_exts_i = 0;
4483 char **exts_i = NULL;
4484 if (!glad_gl_get_extensions(version, &exts, &num_exts_i, &exts_i)) return 0;
4485
4486 GLAD_GL_EXT_framebuffer_object = glad_gl_has_extension(version, exts, num_exts_i, exts_i, "GL_EXT_framebuffer_object");
4487
4488 glad_gl_free_extensions(exts_i, num_exts_i);
4489
4490 return 1;
4491 }
4492
4493 static int glad_gl_find_core_gl(void) {
4494 int i, major, minor;
4495 const char* version;
4496 const char* prefixes[] = {
4497 "OpenGL ES-CM ",
4498 "OpenGL ES-CL ",
4499 "OpenGL ES ",
4500 NULL
4501 };
4502 version = (const char*) glGetString(GL_VERSION);
4503 if (!version) return 0;
4504 for (i = 0; prefixes[i]; i++) {
4505 const size_t length = strlen(prefixes[i]);
4506 if (strncmp(version, prefixes[i], length) == 0) {
4507 version += length;
4508 break;
4509 }
4510 }
4511
4512 GLAD_IMPL_UTIL_SSCANF(version, "%d.%d", &major, &minor);
4513
4514 GLAD_GL_VERSION_1_0 = (major == 1 && minor >= 0) || major > 1;
4515 GLAD_GL_VERSION_1_1 = (major == 1 && minor >= 1) || major > 1;
4516 GLAD_GL_VERSION_1_2 = (major == 1 && minor >= 2) || major > 1;
4517 GLAD_GL_VERSION_1_3 = (major == 1 && minor >= 3) || major > 1;
4518 GLAD_GL_VERSION_1_4 = (major == 1 && minor >= 4) || major > 1;
4519 GLAD_GL_VERSION_1_5 = (major == 1 && minor >= 5) || major > 1;
4520 GLAD_GL_VERSION_2_0 = (major == 2 && minor >= 0) || major > 2;
4521
4522 return GLAD_MAKE_VERSION(major, minor);
4523 }
4524
4525 int gladLoadGLUserPtr( GLADuserptrloadfunc load, void *userptr) {
4526 int version;
4527
4528 glGetString = (PFNGLGETSTRINGPROC) load(userptr, "glGetString");
4529 if(glGetString == NULL) return 0;
4530 if(glGetString(GL_VERSION) == NULL) return 0;
4531 version = glad_gl_find_core_gl();
4532
4533 glad_gl_load_GL_VERSION_1_0(load, userptr);
4534 glad_gl_load_GL_VERSION_1_1(load, userptr);
4535 glad_gl_load_GL_VERSION_1_2(load, userptr);
4536 glad_gl_load_GL_VERSION_1_3(load, userptr);
4537 glad_gl_load_GL_VERSION_1_4(load, userptr);
4538 glad_gl_load_GL_VERSION_1_5(load, userptr);
4539 glad_gl_load_GL_VERSION_2_0(load, userptr);
4540
4541 if (!glad_gl_find_extensions_gl(version)) return 0;
4542 glad_gl_load_GL_EXT_framebuffer_object(load, userptr);
4543
4544
4545
4546 return version;
4547 }
4548
4549
4550 int gladLoadGL( GLADloadfunc load) {
4551 return gladLoadGLUserPtr( glad_gl_get_proc_from_userptr, GLAD_GNUC_EXTENSION (void*) load);
4552 }
4553
4554
4555
4556
4557
4558 #endif /* GLAD_GL_IMPLEMENTATION */
4559
File include/fg2/glad_gles2.h added (mode: 100755) (index 0000000..2787600)
1 /** Modified to replace Khronos types with fixed-size types from stdint.
2 * Loader generated by glad 2.0.0-beta on Fri Aug 30 10:54:41 2019
3 *
4 * Generator: C/C++
5 * Specification: gl
6 * Extensions: 0
7 *
8 * APIs:
9 * - gles2=2.0
10 *
11 * Options:
12 * - MX_GLOBAL = False
13 * - ON_DEMAND = False
14 * - LOADER = False
15 * - ALIAS = False
16 * - HEADER_ONLY = True
17 * - DEBUG = False
18 * - MX = False
19 *
20 * Commandline:
21 * --api='gles2=2.0' --extensions='' c --header-only
22 *
23 * Online:
24 * http://glad.sh/#api=gles2%3D2.0&extensions=&generator=c&options=HEADER_ONLY
25 *
26 */
27
28 #ifndef GLAD_GLES2_H_
29 #define GLAD_GLES2_H_
30
31 #ifdef __gl2_h_
32 #error OpenGL ES 2 header already included (API: gles2), remove previous include!
33 #endif
34 #define __gl2_h_ 1
35
36 #ifdef __gl3_h_
37 #error OpenGL ES 3 header already included (API: gles2), remove previous include!
38 #endif
39 #define __gl3_h_ 1
40
41
42 #define GLAD_GLES2
43 #define GLAD_OPTION_GLES2_HEADER_ONLY
44
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48
49 #ifndef GLAD_PLATFORM_H_
50 #define GLAD_PLATFORM_H_
51
52 #include <stdint.h>
53
54 #ifndef GLAD_PLATFORM_WIN32
55 #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__MINGW32__)
56 #define GLAD_PLATFORM_WIN32 1
57 #else
58 #define GLAD_PLATFORM_WIN32 0
59 #endif
60 #endif
61
62 #ifndef GLAD_PLATFORM_APPLE
63 #ifdef __APPLE__
64 #define GLAD_PLATFORM_APPLE 1
65 #else
66 #define GLAD_PLATFORM_APPLE 0
67 #endif
68 #endif
69
70 #ifndef GLAD_PLATFORM_EMSCRIPTEN
71 #ifdef __EMSCRIPTEN__
72 #define GLAD_PLATFORM_EMSCRIPTEN 1
73 #else
74 #define GLAD_PLATFORM_EMSCRIPTEN 0
75 #endif
76 #endif
77
78 #ifndef GLAD_PLATFORM_UWP
79 #if defined(_MSC_VER) && !defined(GLAD_INTERNAL_HAVE_WINAPIFAMILY)
80 #ifdef __has_include
81 #if __has_include(<winapifamily.h>)
82 #define GLAD_INTERNAL_HAVE_WINAPIFAMILY 1
83 #endif
84 #elif _MSC_VER >= 1700 && !_USING_V110_SDK71_
85 #define GLAD_INTERNAL_HAVE_WINAPIFAMILY 1
86 #endif
87 #endif
88
89 #ifdef GLAD_INTERNAL_HAVE_WINAPIFAMILY
90 #include <winapifamily.h>
91 #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
92 #define GLAD_PLATFORM_UWP 1
93 #endif
94 #endif
95
96 #ifndef GLAD_PLATFORM_UWP
97 #define GLAD_PLATFORM_UWP 0
98 #endif
99 #endif
100
101 #ifdef __GNUC__
102 #define GLAD_GNUC_EXTENSION __extension__
103 #else
104 #define GLAD_GNUC_EXTENSION
105 #endif
106
107 #ifndef GLAD_API_CALL
108 #if defined(GLAD_API_CALL_EXPORT)
109 #if GLAD_PLATFORM_WIN32 || defined(__CYGWIN__)
110 #if defined(GLAD_API_CALL_EXPORT_BUILD)
111 #if defined(__GNUC__)
112 #define GLAD_API_CALL __attribute__ ((dllexport)) extern
113 #else
114 #define GLAD_API_CALL __declspec(dllexport) extern
115 #endif
116 #else
117 #if defined(__GNUC__)
118 #define GLAD_API_CALL __attribute__ ((dllimport)) extern
119 #else
120 #define GLAD_API_CALL __declspec(dllimport) extern
121 #endif
122 #endif
123 #elif defined(__GNUC__) && defined(GLAD_API_CALL_EXPORT_BUILD)
124 #define GLAD_API_CALL __attribute__ ((visibility ("default"))) extern
125 #else
126 #define GLAD_API_CALL extern
127 #endif
128 #else
129 #define GLAD_API_CALL extern
130 #endif
131 #endif
132
133 #ifdef APIENTRY
134 #define GLAD_API_PTR APIENTRY
135 #elif GLAD_PLATFORM_WIN32
136 #define GLAD_API_PTR __stdcall
137 #else
138 #define GLAD_API_PTR
139 #endif
140
141 #ifndef GLAPI
142 #define GLAPI GLAD_API_CALL
143 #endif
144
145 #ifndef GLAPIENTRY
146 #define GLAPIENTRY GLAD_API_PTR
147 #endif
148
149 #define GLAD_MAKE_VERSION(major, minor) (major * 10000 + minor)
150 #define GLAD_VERSION_MAJOR(version) (version / 10000)
151 #define GLAD_VERSION_MINOR(version) (version % 10000)
152
153 #define GLAD_GENERATOR_VERSION "2.0.0-beta"
154
155 typedef void (*GLADapiproc)(void);
156
157 typedef GLADapiproc (*GLADloadfunc)(const char *name);
158 typedef GLADapiproc (*GLADuserptrloadfunc)(void *userptr, const char *name);
159
160 typedef void (*GLADprecallback)(const char *name, GLADapiproc apiproc, int len_args, ...);
161 typedef void (*GLADpostcallback)(void *ret, const char *name, GLADapiproc apiproc, int len_args, ...);
162
163 #endif /* GLAD_PLATFORM_H_ */
164
165 #define GL_ACTIVE_ATTRIBUTES 0x8B89
166 #define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
167 #define GL_ACTIVE_TEXTURE 0x84E0
168 #define GL_ACTIVE_UNIFORMS 0x8B86
169 #define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
170 #define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
171 #define GL_ALIASED_POINT_SIZE_RANGE 0x846D
172 #define GL_ALPHA 0x1906
173 #define GL_ALPHA_BITS 0x0D55
174 #define GL_ALWAYS 0x0207
175 #define GL_ARRAY_BUFFER 0x8892
176 #define GL_ARRAY_BUFFER_BINDING 0x8894
177 #define GL_ATTACHED_SHADERS 0x8B85
178 #define GL_BACK 0x0405
179 #define GL_BLEND 0x0BE2
180 #define GL_BLEND_COLOR 0x8005
181 #define GL_BLEND_DST_ALPHA 0x80CA
182 #define GL_BLEND_DST_RGB 0x80C8
183 #define GL_BLEND_EQUATION 0x8009
184 #define GL_BLEND_EQUATION_ALPHA 0x883D
185 #define GL_BLEND_EQUATION_RGB 0x8009
186 #define GL_BLEND_SRC_ALPHA 0x80CB
187 #define GL_BLEND_SRC_RGB 0x80C9
188 #define GL_BLUE_BITS 0x0D54
189 #define GL_BOOL 0x8B56
190 #define GL_BOOL_VEC2 0x8B57
191 #define GL_BOOL_VEC3 0x8B58
192 #define GL_BOOL_VEC4 0x8B59
193 #define GL_BUFFER_SIZE 0x8764
194 #define GL_BUFFER_USAGE 0x8765
195 #define GL_BYTE 0x1400
196 #define GL_CCW 0x0901
197 #define GL_CLAMP_TO_EDGE 0x812F
198 #define GL_COLOR_ATTACHMENT0 0x8CE0
199 #define GL_COLOR_BUFFER_BIT 0x00004000
200 #define GL_COLOR_CLEAR_VALUE 0x0C22
201 #define GL_COLOR_WRITEMASK 0x0C23
202 #define GL_COMPILE_STATUS 0x8B81
203 #define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
204 #define GL_CONSTANT_ALPHA 0x8003
205 #define GL_CONSTANT_COLOR 0x8001
206 #define GL_CULL_FACE 0x0B44
207 #define GL_CULL_FACE_MODE 0x0B45
208 #define GL_CURRENT_PROGRAM 0x8B8D
209 #define GL_CURRENT_VERTEX_ATTRIB 0x8626
210 #define GL_CW 0x0900
211 #define GL_DECR 0x1E03
212 #define GL_DECR_WRAP 0x8508
213 #define GL_DELETE_STATUS 0x8B80
214 #define GL_DEPTH_ATTACHMENT 0x8D00
215 #define GL_DEPTH_BITS 0x0D56
216 #define GL_DEPTH_BUFFER_BIT 0x00000100
217 #define GL_DEPTH_CLEAR_VALUE 0x0B73
218 #define GL_DEPTH_COMPONENT 0x1902
219 #define GL_DEPTH_COMPONENT16 0x81A5
220 #define GL_DEPTH_FUNC 0x0B74
221 #define GL_DEPTH_RANGE 0x0B70
222 #define GL_DEPTH_TEST 0x0B71
223 #define GL_DEPTH_WRITEMASK 0x0B72
224 #define GL_DITHER 0x0BD0
225 #define GL_DONT_CARE 0x1100
226 #define GL_DST_ALPHA 0x0304
227 #define GL_DST_COLOR 0x0306
228 #define GL_DYNAMIC_DRAW 0x88E8
229 #define GL_ELEMENT_ARRAY_BUFFER 0x8893
230 #define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
231 #define GL_EQUAL 0x0202
232 #define GL_EXTENSIONS 0x1F03
233 #define GL_FALSE 0
234 #define GL_FASTEST 0x1101
235 #define GL_FIXED 0x140C
236 #define GL_FLOAT 0x1406
237 #define GL_FLOAT_MAT2 0x8B5A
238 #define GL_FLOAT_MAT3 0x8B5B
239 #define GL_FLOAT_MAT4 0x8B5C
240 #define GL_FLOAT_VEC2 0x8B50
241 #define GL_FLOAT_VEC3 0x8B51
242 #define GL_FLOAT_VEC4 0x8B52
243 #define GL_FRAGMENT_SHADER 0x8B30
244 #define GL_FRAMEBUFFER 0x8D40
245 #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
246 #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
247 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
248 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
249 #define GL_FRAMEBUFFER_BINDING 0x8CA6
250 #define GL_FRAMEBUFFER_COMPLETE 0x8CD5
251 #define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
252 #define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9
253 #define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
254 #define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
255 #define GL_FRONT 0x0404
256 #define GL_FRONT_AND_BACK 0x0408
257 #define GL_FRONT_FACE 0x0B46
258 #define GL_FUNC_ADD 0x8006
259 #define GL_FUNC_REVERSE_SUBTRACT 0x800B
260 #define GL_FUNC_SUBTRACT 0x800A
261 #define GL_GENERATE_MIPMAP_HINT 0x8192
262 #define GL_GEQUAL 0x0206
263 #define GL_GREATER 0x0204
264 #define GL_GREEN_BITS 0x0D53
265 #define GL_HIGH_FLOAT 0x8DF2
266 #define GL_HIGH_INT 0x8DF5
267 #define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
268 #define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A
269 #define GL_INCR 0x1E02
270 #define GL_INCR_WRAP 0x8507
271 #define GL_INFO_LOG_LENGTH 0x8B84
272 #define GL_INT 0x1404
273 #define GL_INT_VEC2 0x8B53
274 #define GL_INT_VEC3 0x8B54
275 #define GL_INT_VEC4 0x8B55
276 #define GL_INVALID_ENUM 0x0500
277 #define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
278 #define GL_INVALID_OPERATION 0x0502
279 #define GL_INVALID_VALUE 0x0501
280 #define GL_INVERT 0x150A
281 #define GL_KEEP 0x1E00
282 #define GL_LEQUAL 0x0203
283 #define GL_LESS 0x0201
284 #define GL_LINEAR 0x2601
285 #define GL_LINEAR_MIPMAP_LINEAR 0x2703
286 #define GL_LINEAR_MIPMAP_NEAREST 0x2701
287 #define GL_LINES 0x0001
288 #define GL_LINE_LOOP 0x0002
289 #define GL_LINE_STRIP 0x0003
290 #define GL_LINE_WIDTH 0x0B21
291 #define GL_LINK_STATUS 0x8B82
292 #define GL_LOW_FLOAT 0x8DF0
293 #define GL_LOW_INT 0x8DF3
294 #define GL_LUMINANCE 0x1909
295 #define GL_LUMINANCE_ALPHA 0x190A
296 #define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
297 #define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
298 #define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD
299 #define GL_MAX_RENDERBUFFER_SIZE 0x84E8
300 #define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
301 #define GL_MAX_TEXTURE_SIZE 0x0D33
302 #define GL_MAX_VARYING_VECTORS 0x8DFC
303 #define GL_MAX_VERTEX_ATTRIBS 0x8869
304 #define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
305 #define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB
306 #define GL_MAX_VIEWPORT_DIMS 0x0D3A
307 #define GL_MEDIUM_FLOAT 0x8DF1
308 #define GL_MEDIUM_INT 0x8DF4
309 #define GL_MIRRORED_REPEAT 0x8370
310 #define GL_NEAREST 0x2600
311 #define GL_NEAREST_MIPMAP_LINEAR 0x2702
312 #define GL_NEAREST_MIPMAP_NEAREST 0x2700
313 #define GL_NEVER 0x0200
314 #define GL_NICEST 0x1102
315 #define GL_NONE 0
316 #define GL_NOTEQUAL 0x0205
317 #define GL_NO_ERROR 0
318 #define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
319 #define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9
320 #define GL_ONE 1
321 #define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
322 #define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
323 #define GL_ONE_MINUS_DST_ALPHA 0x0305
324 #define GL_ONE_MINUS_DST_COLOR 0x0307
325 #define GL_ONE_MINUS_SRC_ALPHA 0x0303
326 #define GL_ONE_MINUS_SRC_COLOR 0x0301
327 #define GL_OUT_OF_MEMORY 0x0505
328 #define GL_PACK_ALIGNMENT 0x0D05
329 #define GL_POINTS 0x0000
330 #define GL_POLYGON_OFFSET_FACTOR 0x8038
331 #define GL_POLYGON_OFFSET_FILL 0x8037
332 #define GL_POLYGON_OFFSET_UNITS 0x2A00
333 #define GL_RED_BITS 0x0D52
334 #define GL_RENDERBUFFER 0x8D41
335 #define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53
336 #define GL_RENDERBUFFER_BINDING 0x8CA7
337 #define GL_RENDERBUFFER_BLUE_SIZE 0x8D52
338 #define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54
339 #define GL_RENDERBUFFER_GREEN_SIZE 0x8D51
340 #define GL_RENDERBUFFER_HEIGHT 0x8D43
341 #define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44
342 #define GL_RENDERBUFFER_RED_SIZE 0x8D50
343 #define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55
344 #define GL_RENDERBUFFER_WIDTH 0x8D42
345 #define GL_RENDERER 0x1F01
346 #define GL_REPEAT 0x2901
347 #define GL_REPLACE 0x1E01
348 #define GL_RGB 0x1907
349 #define GL_RGB565 0x8D62
350 #define GL_RGB5_A1 0x8057
351 #define GL_RGBA 0x1908
352 #define GL_RGBA4 0x8056
353 #define GL_SAMPLER_2D 0x8B5E
354 #define GL_SAMPLER_CUBE 0x8B60
355 #define GL_SAMPLES 0x80A9
356 #define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
357 #define GL_SAMPLE_BUFFERS 0x80A8
358 #define GL_SAMPLE_COVERAGE 0x80A0
359 #define GL_SAMPLE_COVERAGE_INVERT 0x80AB
360 #define GL_SAMPLE_COVERAGE_VALUE 0x80AA
361 #define GL_SCISSOR_BOX 0x0C10
362 #define GL_SCISSOR_TEST 0x0C11
363 #define GL_SHADER_BINARY_FORMATS 0x8DF8
364 #define GL_SHADER_COMPILER 0x8DFA
365 #define GL_SHADER_SOURCE_LENGTH 0x8B88
366 #define GL_SHADER_TYPE 0x8B4F
367 #define GL_SHADING_LANGUAGE_VERSION 0x8B8C
368 #define GL_SHORT 0x1402
369 #define GL_SRC_ALPHA 0x0302
370 #define GL_SRC_ALPHA_SATURATE 0x0308
371 #define GL_SRC_COLOR 0x0300
372 #define GL_STATIC_DRAW 0x88E4
373 #define GL_STENCIL_ATTACHMENT 0x8D20
374 #define GL_STENCIL_BACK_FAIL 0x8801
375 #define GL_STENCIL_BACK_FUNC 0x8800
376 #define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802
377 #define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803
378 #define GL_STENCIL_BACK_REF 0x8CA3
379 #define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
380 #define GL_STENCIL_BACK_WRITEMASK 0x8CA5
381 #define GL_STENCIL_BITS 0x0D57
382 #define GL_STENCIL_BUFFER_BIT 0x00000400
383 #define GL_STENCIL_CLEAR_VALUE 0x0B91
384 #define GL_STENCIL_FAIL 0x0B94
385 #define GL_STENCIL_FUNC 0x0B92
386 #define GL_STENCIL_INDEX8 0x8D48
387 #define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
388 #define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
389 #define GL_STENCIL_REF 0x0B97
390 #define GL_STENCIL_TEST 0x0B90
391 #define GL_STENCIL_VALUE_MASK 0x0B93
392 #define GL_STENCIL_WRITEMASK 0x0B98
393 #define GL_STREAM_DRAW 0x88E0
394 #define GL_SUBPIXEL_BITS 0x0D50
395 #define GL_TEXTURE 0x1702
396 #define GL_TEXTURE0 0x84C0
397 #define GL_TEXTURE1 0x84C1
398 #define GL_TEXTURE10 0x84CA
399 #define GL_TEXTURE11 0x84CB
400 #define GL_TEXTURE12 0x84CC
401 #define GL_TEXTURE13 0x84CD
402 #define GL_TEXTURE14 0x84CE
403 #define GL_TEXTURE15 0x84CF
404 #define GL_TEXTURE16 0x84D0
405 #define GL_TEXTURE17 0x84D1
406 #define GL_TEXTURE18 0x84D2
407 #define GL_TEXTURE19 0x84D3
408 #define GL_TEXTURE2 0x84C2
409 #define GL_TEXTURE20 0x84D4
410 #define GL_TEXTURE21 0x84D5
411 #define GL_TEXTURE22 0x84D6
412 #define GL_TEXTURE23 0x84D7
413 #define GL_TEXTURE24 0x84D8
414 #define GL_TEXTURE25 0x84D9
415 #define GL_TEXTURE26 0x84DA
416 #define GL_TEXTURE27 0x84DB
417 #define GL_TEXTURE28 0x84DC
418 #define GL_TEXTURE29 0x84DD
419 #define GL_TEXTURE3 0x84C3
420 #define GL_TEXTURE30 0x84DE
421 #define GL_TEXTURE31 0x84DF
422 #define GL_TEXTURE4 0x84C4
423 #define GL_TEXTURE5 0x84C5
424 #define GL_TEXTURE6 0x84C6
425 #define GL_TEXTURE7 0x84C7
426 #define GL_TEXTURE8 0x84C8
427 #define GL_TEXTURE9 0x84C9
428 #define GL_TEXTURE_2D 0x0DE1
429 #define GL_TEXTURE_BINDING_2D 0x8069
430 #define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
431 #define GL_TEXTURE_CUBE_MAP 0x8513
432 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
433 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
434 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
435 #define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
436 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
437 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
438 #define GL_TEXTURE_MAG_FILTER 0x2800
439 #define GL_TEXTURE_MIN_FILTER 0x2801
440 #define GL_TEXTURE_WRAP_S 0x2802
441 #define GL_TEXTURE_WRAP_T 0x2803
442 #define GL_TRIANGLES 0x0004
443 #define GL_TRIANGLE_FAN 0x0006
444 #define GL_TRIANGLE_STRIP 0x0005
445 #define GL_TRUE 1
446 #define GL_UNPACK_ALIGNMENT 0x0CF5
447 #define GL_UNSIGNED_BYTE 0x1401
448 #define GL_UNSIGNED_INT 0x1405
449 #define GL_UNSIGNED_SHORT 0x1403
450 #define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
451 #define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
452 #define GL_UNSIGNED_SHORT_5_6_5 0x8363
453 #define GL_VALIDATE_STATUS 0x8B83
454 #define GL_VENDOR 0x1F00
455 #define GL_VERSION 0x1F02
456 #define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
457 #define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
458 #define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
459 #define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
460 #define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
461 #define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
462 #define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
463 #define GL_VERTEX_SHADER 0x8B31
464 #define GL_VIEWPORT 0x0BA2
465 #define GL_ZERO 0
466
467
468 typedef unsigned int GLenum;
469 typedef unsigned char GLboolean;
470 typedef unsigned int GLbitfield;
471 typedef void GLvoid;
472 typedef signed char GLbyte;
473 typedef unsigned char GLubyte;
474 typedef signed short int GLshort;
475 typedef unsigned short int GLushort;
476 typedef int GLint;
477 typedef unsigned int GLuint;
478 typedef int32_t GLclampx;
479 typedef int GLsizei;
480 typedef float GLfloat;
481 typedef float GLclampf;
482 typedef double GLdouble;
483 typedef double GLclampd;
484 typedef void *GLeglClientBufferEXT;
485 typedef void *GLeglImageOES;
486 typedef char GLchar;
487 typedef char GLcharARB;
488 #ifdef __APPLE__
489 typedef void *GLhandleARB;
490 #else
491 typedef unsigned int GLhandleARB;
492 #endif
493 typedef unsigned short int GLhalf;
494 typedef unsigned short int GLhalfARB;
495 typedef int32_t GLfixed;
496 #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
497 typedef intptr_t GLintptr;
498 #else
499 typedef intptr_t GLintptr;
500 #endif
501 #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
502 typedef intptr_t GLintptrARB;
503 #else
504 typedef intptr_t GLintptrARB;
505 #endif
506 #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
507 typedef intptr_t GLsizeiptr;
508 #else
509 typedef intptr_t GLsizeiptr;
510 #endif
511 #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
512 typedef intptr_t GLsizeiptrARB;
513 #else
514 typedef intptr_t GLsizeiptrARB;
515 #endif
516 typedef int64_t GLint64;
517 typedef int64_t GLint64EXT;
518 typedef uint64_t GLuint64;
519 typedef uint64_t GLuint64EXT;
520 typedef struct __GLsync *GLsync;
521 struct _cl_context;
522 struct _cl_event;
523 typedef void ( *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
524 typedef void ( *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
525 typedef void ( *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
526 typedef void ( *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,void *userParam);
527 typedef unsigned short GLhalfNV;
528 typedef GLintptr GLvdpauSurfaceNV;
529 typedef void ( *GLVULKANPROCNV)(void);
530
531
532 #define GL_ES_VERSION_2_0 1
533 GLAD_API_CALL int GLAD_GL_ES_VERSION_2_0;
534
535
536 typedef void (GLAD_API_PTR *PFNGLACTIVETEXTUREPROC)(GLenum texture);
537 typedef void (GLAD_API_PTR *PFNGLATTACHSHADERPROC)(GLuint program, GLuint shader);
538 typedef void (GLAD_API_PTR *PFNGLBINDATTRIBLOCATIONPROC)(GLuint program, GLuint index, const GLchar * name);
539 typedef void (GLAD_API_PTR *PFNGLBINDBUFFERPROC)(GLenum target, GLuint buffer);
540 typedef void (GLAD_API_PTR *PFNGLBINDFRAMEBUFFERPROC)(GLenum target, GLuint framebuffer);
541 typedef void (GLAD_API_PTR *PFNGLBINDRENDERBUFFERPROC)(GLenum target, GLuint renderbuffer);
542 typedef void (GLAD_API_PTR *PFNGLBINDTEXTUREPROC)(GLenum target, GLuint texture);
543 typedef void (GLAD_API_PTR *PFNGLBLENDCOLORPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
544 typedef void (GLAD_API_PTR *PFNGLBLENDEQUATIONPROC)(GLenum mode);
545 typedef void (GLAD_API_PTR *PFNGLBLENDEQUATIONSEPARATEPROC)(GLenum modeRGB, GLenum modeAlpha);
546 typedef void (GLAD_API_PTR *PFNGLBLENDFUNCPROC)(GLenum sfactor, GLenum dfactor);
547 typedef void (GLAD_API_PTR *PFNGLBLENDFUNCSEPARATEPROC)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
548 typedef void (GLAD_API_PTR *PFNGLBUFFERDATAPROC)(GLenum target, GLsizeiptr size, const void * data, GLenum usage);
549 typedef void (GLAD_API_PTR *PFNGLBUFFERSUBDATAPROC)(GLenum target, GLintptr offset, GLsizeiptr size, const void * data);
550 typedef GLenum (GLAD_API_PTR *PFNGLCHECKFRAMEBUFFERSTATUSPROC)(GLenum target);
551 typedef void (GLAD_API_PTR *PFNGLCLEARPROC)(GLbitfield mask);
552 typedef void (GLAD_API_PTR *PFNGLCLEARCOLORPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
553 typedef void (GLAD_API_PTR *PFNGLCLEARDEPTHFPROC)(GLfloat d);
554 typedef void (GLAD_API_PTR *PFNGLCLEARSTENCILPROC)(GLint s);
555 typedef void (GLAD_API_PTR *PFNGLCOLORMASKPROC)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
556 typedef void (GLAD_API_PTR *PFNGLCOMPILESHADERPROC)(GLuint shader);
557 typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXIMAGE2DPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void * data);
558 typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void * data);
559 typedef void (GLAD_API_PTR *PFNGLCOPYTEXIMAGE2DPROC)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
560 typedef void (GLAD_API_PTR *PFNGLCOPYTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
561 typedef GLuint (GLAD_API_PTR *PFNGLCREATEPROGRAMPROC)(void);
562 typedef GLuint (GLAD_API_PTR *PFNGLCREATESHADERPROC)(GLenum type);
563 typedef void (GLAD_API_PTR *PFNGLCULLFACEPROC)(GLenum mode);
564 typedef void (GLAD_API_PTR *PFNGLDELETEBUFFERSPROC)(GLsizei n, const GLuint * buffers);
565 typedef void (GLAD_API_PTR *PFNGLDELETEFRAMEBUFFERSPROC)(GLsizei n, const GLuint * framebuffers);
566 typedef void (GLAD_API_PTR *PFNGLDELETEPROGRAMPROC)(GLuint program);
567 typedef void (GLAD_API_PTR *PFNGLDELETERENDERBUFFERSPROC)(GLsizei n, const GLuint * renderbuffers);
568 typedef void (GLAD_API_PTR *PFNGLDELETESHADERPROC)(GLuint shader);
569 typedef void (GLAD_API_PTR *PFNGLDELETETEXTURESPROC)(GLsizei n, const GLuint * textures);
570 typedef void (GLAD_API_PTR *PFNGLDEPTHFUNCPROC)(GLenum func);
571 typedef void (GLAD_API_PTR *PFNGLDEPTHMASKPROC)(GLboolean flag);
572 typedef void (GLAD_API_PTR *PFNGLDEPTHRANGEFPROC)(GLfloat n, GLfloat f);
573 typedef void (GLAD_API_PTR *PFNGLDETACHSHADERPROC)(GLuint program, GLuint shader);
574 typedef void (GLAD_API_PTR *PFNGLDISABLEPROC)(GLenum cap);
575 typedef void (GLAD_API_PTR *PFNGLDISABLEVERTEXATTRIBARRAYPROC)(GLuint index);
576 typedef void (GLAD_API_PTR *PFNGLDRAWARRAYSPROC)(GLenum mode, GLint first, GLsizei count);
577 typedef void (GLAD_API_PTR *PFNGLDRAWELEMENTSPROC)(GLenum mode, GLsizei count, GLenum type, const void * indices);
578 typedef void (GLAD_API_PTR *PFNGLENABLEPROC)(GLenum cap);
579 typedef void (GLAD_API_PTR *PFNGLENABLEVERTEXATTRIBARRAYPROC)(GLuint index);
580 typedef void (GLAD_API_PTR *PFNGLFINISHPROC)(void);
581 typedef void (GLAD_API_PTR *PFNGLFLUSHPROC)(void);
582 typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERRENDERBUFFERPROC)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
583 typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERTEXTURE2DPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
584 typedef void (GLAD_API_PTR *PFNGLFRONTFACEPROC)(GLenum mode);
585 typedef void (GLAD_API_PTR *PFNGLGENBUFFERSPROC)(GLsizei n, GLuint * buffers);
586 typedef void (GLAD_API_PTR *PFNGLGENFRAMEBUFFERSPROC)(GLsizei n, GLuint * framebuffers);
587 typedef void (GLAD_API_PTR *PFNGLGENRENDERBUFFERSPROC)(GLsizei n, GLuint * renderbuffers);
588 typedef void (GLAD_API_PTR *PFNGLGENTEXTURESPROC)(GLsizei n, GLuint * textures);
589 typedef void (GLAD_API_PTR *PFNGLGENERATEMIPMAPPROC)(GLenum target);
590 typedef void (GLAD_API_PTR *PFNGLGETACTIVEATTRIBPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name);
591 typedef void (GLAD_API_PTR *PFNGLGETACTIVEUNIFORMPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name);
592 typedef void (GLAD_API_PTR *PFNGLGETATTACHEDSHADERSPROC)(GLuint program, GLsizei maxCount, GLsizei * count, GLuint * shaders);
593 typedef GLint (GLAD_API_PTR *PFNGLGETATTRIBLOCATIONPROC)(GLuint program, const GLchar * name);
594 typedef void (GLAD_API_PTR *PFNGLGETBOOLEANVPROC)(GLenum pname, GLboolean * data);
595 typedef void (GLAD_API_PTR *PFNGLGETBUFFERPARAMETERIVPROC)(GLenum target, GLenum pname, GLint * params);
596 typedef GLenum (GLAD_API_PTR *PFNGLGETERRORPROC)(void);
597 typedef void (GLAD_API_PTR *PFNGLGETFLOATVPROC)(GLenum pname, GLfloat * data);
598 typedef void (GLAD_API_PTR *PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)(GLenum target, GLenum attachment, GLenum pname, GLint * params);
599 typedef void (GLAD_API_PTR *PFNGLGETINTEGERVPROC)(GLenum pname, GLint * data);
600 typedef void (GLAD_API_PTR *PFNGLGETPROGRAMINFOLOGPROC)(GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog);
601 typedef void (GLAD_API_PTR *PFNGLGETPROGRAMIVPROC)(GLuint program, GLenum pname, GLint * params);
602 typedef void (GLAD_API_PTR *PFNGLGETRENDERBUFFERPARAMETERIVPROC)(GLenum target, GLenum pname, GLint * params);
603 typedef void (GLAD_API_PTR *PFNGLGETSHADERINFOLOGPROC)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog);
604 typedef void (GLAD_API_PTR *PFNGLGETSHADERPRECISIONFORMATPROC)(GLenum shadertype, GLenum precisiontype, GLint * range, GLint * precision);
605 typedef void (GLAD_API_PTR *PFNGLGETSHADERSOURCEPROC)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * source);
606 typedef void (GLAD_API_PTR *PFNGLGETSHADERIVPROC)(GLuint shader, GLenum pname, GLint * params);
607 typedef const GLubyte * (GLAD_API_PTR *PFNGLGETSTRINGPROC)(GLenum name);
608 typedef void (GLAD_API_PTR *PFNGLGETTEXPARAMETERFVPROC)(GLenum target, GLenum pname, GLfloat * params);
609 typedef void (GLAD_API_PTR *PFNGLGETTEXPARAMETERIVPROC)(GLenum target, GLenum pname, GLint * params);
610 typedef GLint (GLAD_API_PTR *PFNGLGETUNIFORMLOCATIONPROC)(GLuint program, const GLchar * name);
611 typedef void (GLAD_API_PTR *PFNGLGETUNIFORMFVPROC)(GLuint program, GLint location, GLfloat * params);
612 typedef void (GLAD_API_PTR *PFNGLGETUNIFORMIVPROC)(GLuint program, GLint location, GLint * params);
613 typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBPOINTERVPROC)(GLuint index, GLenum pname, void ** pointer);
614 typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBFVPROC)(GLuint index, GLenum pname, GLfloat * params);
615 typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBIVPROC)(GLuint index, GLenum pname, GLint * params);
616 typedef void (GLAD_API_PTR *PFNGLHINTPROC)(GLenum target, GLenum mode);
617 typedef GLboolean (GLAD_API_PTR *PFNGLISBUFFERPROC)(GLuint buffer);
618 typedef GLboolean (GLAD_API_PTR *PFNGLISENABLEDPROC)(GLenum cap);
619 typedef GLboolean (GLAD_API_PTR *PFNGLISFRAMEBUFFERPROC)(GLuint framebuffer);
620 typedef GLboolean (GLAD_API_PTR *PFNGLISPROGRAMPROC)(GLuint program);
621 typedef GLboolean (GLAD_API_PTR *PFNGLISRENDERBUFFERPROC)(GLuint renderbuffer);
622 typedef GLboolean (GLAD_API_PTR *PFNGLISSHADERPROC)(GLuint shader);
623 typedef GLboolean (GLAD_API_PTR *PFNGLISTEXTUREPROC)(GLuint texture);
624 typedef void (GLAD_API_PTR *PFNGLLINEWIDTHPROC)(GLfloat width);
625 typedef void (GLAD_API_PTR *PFNGLLINKPROGRAMPROC)(GLuint program);
626 typedef void (GLAD_API_PTR *PFNGLPIXELSTOREIPROC)(GLenum pname, GLint param);
627 typedef void (GLAD_API_PTR *PFNGLPOLYGONOFFSETPROC)(GLfloat factor, GLfloat units);
628 typedef void (GLAD_API_PTR *PFNGLREADPIXELSPROC)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void * pixels);
629 typedef void (GLAD_API_PTR *PFNGLRELEASESHADERCOMPILERPROC)(void);
630 typedef void (GLAD_API_PTR *PFNGLRENDERBUFFERSTORAGEPROC)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
631 typedef void (GLAD_API_PTR *PFNGLSAMPLECOVERAGEPROC)(GLfloat value, GLboolean invert);
632 typedef void (GLAD_API_PTR *PFNGLSCISSORPROC)(GLint x, GLint y, GLsizei width, GLsizei height);
633 typedef void (GLAD_API_PTR *PFNGLSHADERBINARYPROC)(GLsizei count, const GLuint * shaders, GLenum binaryformat, const void * binary, GLsizei length);
634 typedef void (GLAD_API_PTR *PFNGLSHADERSOURCEPROC)(GLuint shader, GLsizei count, const GLchar *const* string, const GLint * length);
635 typedef void (GLAD_API_PTR *PFNGLSTENCILFUNCPROC)(GLenum func, GLint ref, GLuint mask);
636 typedef void (GLAD_API_PTR *PFNGLSTENCILFUNCSEPARATEPROC)(GLenum face, GLenum func, GLint ref, GLuint mask);
637 typedef void (GLAD_API_PTR *PFNGLSTENCILMASKPROC)(GLuint mask);
638 typedef void (GLAD_API_PTR *PFNGLSTENCILMASKSEPARATEPROC)(GLenum face, GLuint mask);
639 typedef void (GLAD_API_PTR *PFNGLSTENCILOPPROC)(GLenum fail, GLenum zfail, GLenum zpass);
640 typedef void (GLAD_API_PTR *PFNGLSTENCILOPSEPARATEPROC)(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
641 typedef void (GLAD_API_PTR *PFNGLTEXIMAGE2DPROC)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void * pixels);
642 typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERFPROC)(GLenum target, GLenum pname, GLfloat param);
643 typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERFVPROC)(GLenum target, GLenum pname, const GLfloat * params);
644 typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERIPROC)(GLenum target, GLenum pname, GLint param);
645 typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERIVPROC)(GLenum target, GLenum pname, const GLint * params);
646 typedef void (GLAD_API_PTR *PFNGLTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void * pixels);
647 typedef void (GLAD_API_PTR *PFNGLUNIFORM1FPROC)(GLint location, GLfloat v0);
648 typedef void (GLAD_API_PTR *PFNGLUNIFORM1FVPROC)(GLint location, GLsizei count, const GLfloat * value);
649 typedef void (GLAD_API_PTR *PFNGLUNIFORM1IPROC)(GLint location, GLint v0);
650 typedef void (GLAD_API_PTR *PFNGLUNIFORM1IVPROC)(GLint location, GLsizei count, const GLint * value);
651 typedef void (GLAD_API_PTR *PFNGLUNIFORM2FPROC)(GLint location, GLfloat v0, GLfloat v1);
652 typedef void (GLAD_API_PTR *PFNGLUNIFORM2FVPROC)(GLint location, GLsizei count, const GLfloat * value);
653 typedef void (GLAD_API_PTR *PFNGLUNIFORM2IPROC)(GLint location, GLint v0, GLint v1);
654 typedef void (GLAD_API_PTR *PFNGLUNIFORM2IVPROC)(GLint location, GLsizei count, const GLint * value);
655 typedef void (GLAD_API_PTR *PFNGLUNIFORM3FPROC)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
656 typedef void (GLAD_API_PTR *PFNGLUNIFORM3FVPROC)(GLint location, GLsizei count, const GLfloat * value);
657 typedef void (GLAD_API_PTR *PFNGLUNIFORM3IPROC)(GLint location, GLint v0, GLint v1, GLint v2);
658 typedef void (GLAD_API_PTR *PFNGLUNIFORM3IVPROC)(GLint location, GLsizei count, const GLint * value);
659 typedef void (GLAD_API_PTR *PFNGLUNIFORM4FPROC)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
660 typedef void (GLAD_API_PTR *PFNGLUNIFORM4FVPROC)(GLint location, GLsizei count, const GLfloat * value);
661 typedef void (GLAD_API_PTR *PFNGLUNIFORM4IPROC)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
662 typedef void (GLAD_API_PTR *PFNGLUNIFORM4IVPROC)(GLint location, GLsizei count, const GLint * value);
663 typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX2FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
664 typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX3FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
665 typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX4FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
666 typedef void (GLAD_API_PTR *PFNGLUSEPROGRAMPROC)(GLuint program);
667 typedef void (GLAD_API_PTR *PFNGLVALIDATEPROGRAMPROC)(GLuint program);
668 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB1FPROC)(GLuint index, GLfloat x);
669 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB1FVPROC)(GLuint index, const GLfloat * v);
670 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB2FPROC)(GLuint index, GLfloat x, GLfloat y);
671 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB2FVPROC)(GLuint index, const GLfloat * v);
672 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB3FPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z);
673 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB3FVPROC)(GLuint index, const GLfloat * v);
674 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4FPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
675 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4FVPROC)(GLuint index, const GLfloat * v);
676 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBPOINTERPROC)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void * pointer);
677 typedef void (GLAD_API_PTR *PFNGLVIEWPORTPROC)(GLint x, GLint y, GLsizei width, GLsizei height);
678
679 GLAD_API_CALL PFNGLACTIVETEXTUREPROC glad_glActiveTexture;
680 #define glActiveTexture glad_glActiveTexture
681 GLAD_API_CALL PFNGLATTACHSHADERPROC glad_glAttachShader;
682 #define glAttachShader glad_glAttachShader
683 GLAD_API_CALL PFNGLBINDATTRIBLOCATIONPROC glad_glBindAttribLocation;
684 #define glBindAttribLocation glad_glBindAttribLocation
685 GLAD_API_CALL PFNGLBINDBUFFERPROC glad_glBindBuffer;
686 #define glBindBuffer glad_glBindBuffer
687 GLAD_API_CALL PFNGLBINDFRAMEBUFFERPROC glad_glBindFramebuffer;
688 #define glBindFramebuffer glad_glBindFramebuffer
689 GLAD_API_CALL PFNGLBINDRENDERBUFFERPROC glad_glBindRenderbuffer;
690 #define glBindRenderbuffer glad_glBindRenderbuffer
691 GLAD_API_CALL PFNGLBINDTEXTUREPROC glad_glBindTexture;
692 #define glBindTexture glad_glBindTexture
693 GLAD_API_CALL PFNGLBLENDCOLORPROC glad_glBlendColor;
694 #define glBlendColor glad_glBlendColor
695 GLAD_API_CALL PFNGLBLENDEQUATIONPROC glad_glBlendEquation;
696 #define glBlendEquation glad_glBlendEquation
697 GLAD_API_CALL PFNGLBLENDEQUATIONSEPARATEPROC glad_glBlendEquationSeparate;
698 #define glBlendEquationSeparate glad_glBlendEquationSeparate
699 GLAD_API_CALL PFNGLBLENDFUNCPROC glad_glBlendFunc;
700 #define glBlendFunc glad_glBlendFunc
701 GLAD_API_CALL PFNGLBLENDFUNCSEPARATEPROC glad_glBlendFuncSeparate;
702 #define glBlendFuncSeparate glad_glBlendFuncSeparate
703 GLAD_API_CALL PFNGLBUFFERDATAPROC glad_glBufferData;
704 #define glBufferData glad_glBufferData
705 GLAD_API_CALL PFNGLBUFFERSUBDATAPROC glad_glBufferSubData;
706 #define glBufferSubData glad_glBufferSubData
707 GLAD_API_CALL PFNGLCHECKFRAMEBUFFERSTATUSPROC glad_glCheckFramebufferStatus;
708 #define glCheckFramebufferStatus glad_glCheckFramebufferStatus
709 GLAD_API_CALL PFNGLCLEARPROC glad_glClear;
710 #define glClear glad_glClear
711 GLAD_API_CALL PFNGLCLEARCOLORPROC glad_glClearColor;
712 #define glClearColor glad_glClearColor
713 GLAD_API_CALL PFNGLCLEARDEPTHFPROC glad_glClearDepthf;
714 #define glClearDepthf glad_glClearDepthf
715 GLAD_API_CALL PFNGLCLEARSTENCILPROC glad_glClearStencil;
716 #define glClearStencil glad_glClearStencil
717 GLAD_API_CALL PFNGLCOLORMASKPROC glad_glColorMask;
718 #define glColorMask glad_glColorMask
719 GLAD_API_CALL PFNGLCOMPILESHADERPROC glad_glCompileShader;
720 #define glCompileShader glad_glCompileShader
721 GLAD_API_CALL PFNGLCOMPRESSEDTEXIMAGE2DPROC glad_glCompressedTexImage2D;
722 #define glCompressedTexImage2D glad_glCompressedTexImage2D
723 GLAD_API_CALL PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glad_glCompressedTexSubImage2D;
724 #define glCompressedTexSubImage2D glad_glCompressedTexSubImage2D
725 GLAD_API_CALL PFNGLCOPYTEXIMAGE2DPROC glad_glCopyTexImage2D;
726 #define glCopyTexImage2D glad_glCopyTexImage2D
727 GLAD_API_CALL PFNGLCOPYTEXSUBIMAGE2DPROC glad_glCopyTexSubImage2D;
728 #define glCopyTexSubImage2D glad_glCopyTexSubImage2D
729 GLAD_API_CALL PFNGLCREATEPROGRAMPROC glad_glCreateProgram;
730 #define glCreateProgram glad_glCreateProgram
731 GLAD_API_CALL PFNGLCREATESHADERPROC glad_glCreateShader;
732 #define glCreateShader glad_glCreateShader
733 GLAD_API_CALL PFNGLCULLFACEPROC glad_glCullFace;
734 #define glCullFace glad_glCullFace
735 GLAD_API_CALL PFNGLDELETEBUFFERSPROC glad_glDeleteBuffers;
736 #define glDeleteBuffers glad_glDeleteBuffers
737 GLAD_API_CALL PFNGLDELETEFRAMEBUFFERSPROC glad_glDeleteFramebuffers;
738 #define glDeleteFramebuffers glad_glDeleteFramebuffers
739 GLAD_API_CALL PFNGLDELETEPROGRAMPROC glad_glDeleteProgram;
740 #define glDeleteProgram glad_glDeleteProgram
741 GLAD_API_CALL PFNGLDELETERENDERBUFFERSPROC glad_glDeleteRenderbuffers;
742 #define glDeleteRenderbuffers glad_glDeleteRenderbuffers
743 GLAD_API_CALL PFNGLDELETESHADERPROC glad_glDeleteShader;
744 #define glDeleteShader glad_glDeleteShader
745 GLAD_API_CALL PFNGLDELETETEXTURESPROC glad_glDeleteTextures;
746 #define glDeleteTextures glad_glDeleteTextures
747 GLAD_API_CALL PFNGLDEPTHFUNCPROC glad_glDepthFunc;
748 #define glDepthFunc glad_glDepthFunc
749 GLAD_API_CALL PFNGLDEPTHMASKPROC glad_glDepthMask;
750 #define glDepthMask glad_glDepthMask
751 GLAD_API_CALL PFNGLDEPTHRANGEFPROC glad_glDepthRangef;
752 #define glDepthRangef glad_glDepthRangef
753 GLAD_API_CALL PFNGLDETACHSHADERPROC glad_glDetachShader;
754 #define glDetachShader glad_glDetachShader
755 GLAD_API_CALL PFNGLDISABLEPROC glad_glDisable;
756 #define glDisable glad_glDisable
757 GLAD_API_CALL PFNGLDISABLEVERTEXATTRIBARRAYPROC glad_glDisableVertexAttribArray;
758 #define glDisableVertexAttribArray glad_glDisableVertexAttribArray
759 GLAD_API_CALL PFNGLDRAWARRAYSPROC glad_glDrawArrays;
760 #define glDrawArrays glad_glDrawArrays
761 GLAD_API_CALL PFNGLDRAWELEMENTSPROC glad_glDrawElements;
762 #define glDrawElements glad_glDrawElements
763 GLAD_API_CALL PFNGLENABLEPROC glad_glEnable;
764 #define glEnable glad_glEnable
765 GLAD_API_CALL PFNGLENABLEVERTEXATTRIBARRAYPROC glad_glEnableVertexAttribArray;
766 #define glEnableVertexAttribArray glad_glEnableVertexAttribArray
767 GLAD_API_CALL PFNGLFINISHPROC glad_glFinish;
768 #define glFinish glad_glFinish
769 GLAD_API_CALL PFNGLFLUSHPROC glad_glFlush;
770 #define glFlush glad_glFlush
771 GLAD_API_CALL PFNGLFRAMEBUFFERRENDERBUFFERPROC glad_glFramebufferRenderbuffer;
772 #define glFramebufferRenderbuffer glad_glFramebufferRenderbuffer
773 GLAD_API_CALL PFNGLFRAMEBUFFERTEXTURE2DPROC glad_glFramebufferTexture2D;
774 #define glFramebufferTexture2D glad_glFramebufferTexture2D
775 GLAD_API_CALL PFNGLFRONTFACEPROC glad_glFrontFace;
776 #define glFrontFace glad_glFrontFace
777 GLAD_API_CALL PFNGLGENBUFFERSPROC glad_glGenBuffers;
778 #define glGenBuffers glad_glGenBuffers
779 GLAD_API_CALL PFNGLGENFRAMEBUFFERSPROC glad_glGenFramebuffers;
780 #define glGenFramebuffers glad_glGenFramebuffers
781 GLAD_API_CALL PFNGLGENRENDERBUFFERSPROC glad_glGenRenderbuffers;
782 #define glGenRenderbuffers glad_glGenRenderbuffers
783 GLAD_API_CALL PFNGLGENTEXTURESPROC glad_glGenTextures;
784 #define glGenTextures glad_glGenTextures
785 GLAD_API_CALL PFNGLGENERATEMIPMAPPROC glad_glGenerateMipmap;
786 #define glGenerateMipmap glad_glGenerateMipmap
787 GLAD_API_CALL PFNGLGETACTIVEATTRIBPROC glad_glGetActiveAttrib;
788 #define glGetActiveAttrib glad_glGetActiveAttrib
789 GLAD_API_CALL PFNGLGETACTIVEUNIFORMPROC glad_glGetActiveUniform;
790 #define glGetActiveUniform glad_glGetActiveUniform
791 GLAD_API_CALL PFNGLGETATTACHEDSHADERSPROC glad_glGetAttachedShaders;
792 #define glGetAttachedShaders glad_glGetAttachedShaders
793 GLAD_API_CALL PFNGLGETATTRIBLOCATIONPROC glad_glGetAttribLocation;
794 #define glGetAttribLocation glad_glGetAttribLocation
795 GLAD_API_CALL PFNGLGETBOOLEANVPROC glad_glGetBooleanv;
796 #define glGetBooleanv glad_glGetBooleanv
797 GLAD_API_CALL PFNGLGETBUFFERPARAMETERIVPROC glad_glGetBufferParameteriv;
798 #define glGetBufferParameteriv glad_glGetBufferParameteriv
799 GLAD_API_CALL PFNGLGETERRORPROC glad_glGetError;
800 #define glGetError glad_glGetError
801 GLAD_API_CALL PFNGLGETFLOATVPROC glad_glGetFloatv;
802 #define glGetFloatv glad_glGetFloatv
803 GLAD_API_CALL PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetFramebufferAttachmentParameteriv;
804 #define glGetFramebufferAttachmentParameteriv glad_glGetFramebufferAttachmentParameteriv
805 GLAD_API_CALL PFNGLGETINTEGERVPROC glad_glGetIntegerv;
806 #define glGetIntegerv glad_glGetIntegerv
807 GLAD_API_CALL PFNGLGETPROGRAMINFOLOGPROC glad_glGetProgramInfoLog;
808 #define glGetProgramInfoLog glad_glGetProgramInfoLog
809 GLAD_API_CALL PFNGLGETPROGRAMIVPROC glad_glGetProgramiv;
810 #define glGetProgramiv glad_glGetProgramiv
811 GLAD_API_CALL PFNGLGETRENDERBUFFERPARAMETERIVPROC glad_glGetRenderbufferParameteriv;
812 #define glGetRenderbufferParameteriv glad_glGetRenderbufferParameteriv
813 GLAD_API_CALL PFNGLGETSHADERINFOLOGPROC glad_glGetShaderInfoLog;
814 #define glGetShaderInfoLog glad_glGetShaderInfoLog
815 GLAD_API_CALL PFNGLGETSHADERPRECISIONFORMATPROC glad_glGetShaderPrecisionFormat;
816 #define glGetShaderPrecisionFormat glad_glGetShaderPrecisionFormat
817 GLAD_API_CALL PFNGLGETSHADERSOURCEPROC glad_glGetShaderSource;
818 #define glGetShaderSource glad_glGetShaderSource
819 GLAD_API_CALL PFNGLGETSHADERIVPROC glad_glGetShaderiv;
820 #define glGetShaderiv glad_glGetShaderiv
821 GLAD_API_CALL PFNGLGETSTRINGPROC glad_glGetString;
822 #define glGetString glad_glGetString
823 GLAD_API_CALL PFNGLGETTEXPARAMETERFVPROC glad_glGetTexParameterfv;
824 #define glGetTexParameterfv glad_glGetTexParameterfv
825 GLAD_API_CALL PFNGLGETTEXPARAMETERIVPROC glad_glGetTexParameteriv;
826 #define glGetTexParameteriv glad_glGetTexParameteriv
827 GLAD_API_CALL PFNGLGETUNIFORMLOCATIONPROC glad_glGetUniformLocation;
828 #define glGetUniformLocation glad_glGetUniformLocation
829 GLAD_API_CALL PFNGLGETUNIFORMFVPROC glad_glGetUniformfv;
830 #define glGetUniformfv glad_glGetUniformfv
831 GLAD_API_CALL PFNGLGETUNIFORMIVPROC glad_glGetUniformiv;
832 #define glGetUniformiv glad_glGetUniformiv
833 GLAD_API_CALL PFNGLGETVERTEXATTRIBPOINTERVPROC glad_glGetVertexAttribPointerv;
834 #define glGetVertexAttribPointerv glad_glGetVertexAttribPointerv
835 GLAD_API_CALL PFNGLGETVERTEXATTRIBFVPROC glad_glGetVertexAttribfv;
836 #define glGetVertexAttribfv glad_glGetVertexAttribfv
837 GLAD_API_CALL PFNGLGETVERTEXATTRIBIVPROC glad_glGetVertexAttribiv;
838 #define glGetVertexAttribiv glad_glGetVertexAttribiv
839 GLAD_API_CALL PFNGLHINTPROC glad_glHint;
840 #define glHint glad_glHint
841 GLAD_API_CALL PFNGLISBUFFERPROC glad_glIsBuffer;
842 #define glIsBuffer glad_glIsBuffer
843 GLAD_API_CALL PFNGLISENABLEDPROC glad_glIsEnabled;
844 #define glIsEnabled glad_glIsEnabled
845 GLAD_API_CALL PFNGLISFRAMEBUFFERPROC glad_glIsFramebuffer;
846 #define glIsFramebuffer glad_glIsFramebuffer
847 GLAD_API_CALL PFNGLISPROGRAMPROC glad_glIsProgram;
848 #define glIsProgram glad_glIsProgram
849 GLAD_API_CALL PFNGLISRENDERBUFFERPROC glad_glIsRenderbuffer;
850 #define glIsRenderbuffer glad_glIsRenderbuffer
851 GLAD_API_CALL PFNGLISSHADERPROC glad_glIsShader;
852 #define glIsShader glad_glIsShader
853 GLAD_API_CALL PFNGLISTEXTUREPROC glad_glIsTexture;
854 #define glIsTexture glad_glIsTexture
855 GLAD_API_CALL PFNGLLINEWIDTHPROC glad_glLineWidth;
856 #define glLineWidth glad_glLineWidth
857 GLAD_API_CALL PFNGLLINKPROGRAMPROC glad_glLinkProgram;
858 #define glLinkProgram glad_glLinkProgram
859 GLAD_API_CALL PFNGLPIXELSTOREIPROC glad_glPixelStorei;
860 #define glPixelStorei glad_glPixelStorei
861 GLAD_API_CALL PFNGLPOLYGONOFFSETPROC glad_glPolygonOffset;
862 #define glPolygonOffset glad_glPolygonOffset
863 GLAD_API_CALL PFNGLREADPIXELSPROC glad_glReadPixels;
864 #define glReadPixels glad_glReadPixels
865 GLAD_API_CALL PFNGLRELEASESHADERCOMPILERPROC glad_glReleaseShaderCompiler;
866 #define glReleaseShaderCompiler glad_glReleaseShaderCompiler
867 GLAD_API_CALL PFNGLRENDERBUFFERSTORAGEPROC glad_glRenderbufferStorage;
868 #define glRenderbufferStorage glad_glRenderbufferStorage
869 GLAD_API_CALL PFNGLSAMPLECOVERAGEPROC glad_glSampleCoverage;
870 #define glSampleCoverage glad_glSampleCoverage
871 GLAD_API_CALL PFNGLSCISSORPROC glad_glScissor;
872 #define glScissor glad_glScissor
873 GLAD_API_CALL PFNGLSHADERBINARYPROC glad_glShaderBinary;
874 #define glShaderBinary glad_glShaderBinary
875 GLAD_API_CALL PFNGLSHADERSOURCEPROC glad_glShaderSource;
876 #define glShaderSource glad_glShaderSource
877 GLAD_API_CALL PFNGLSTENCILFUNCPROC glad_glStencilFunc;
878 #define glStencilFunc glad_glStencilFunc
879 GLAD_API_CALL PFNGLSTENCILFUNCSEPARATEPROC glad_glStencilFuncSeparate;
880 #define glStencilFuncSeparate glad_glStencilFuncSeparate
881 GLAD_API_CALL PFNGLSTENCILMASKPROC glad_glStencilMask;
882 #define glStencilMask glad_glStencilMask
883 GLAD_API_CALL PFNGLSTENCILMASKSEPARATEPROC glad_glStencilMaskSeparate;
884 #define glStencilMaskSeparate glad_glStencilMaskSeparate
885 GLAD_API_CALL PFNGLSTENCILOPPROC glad_glStencilOp;
886 #define glStencilOp glad_glStencilOp
887 GLAD_API_CALL PFNGLSTENCILOPSEPARATEPROC glad_glStencilOpSeparate;
888 #define glStencilOpSeparate glad_glStencilOpSeparate
889 GLAD_API_CALL PFNGLTEXIMAGE2DPROC glad_glTexImage2D;
890 #define glTexImage2D glad_glTexImage2D
891 GLAD_API_CALL PFNGLTEXPARAMETERFPROC glad_glTexParameterf;
892 #define glTexParameterf glad_glTexParameterf
893 GLAD_API_CALL PFNGLTEXPARAMETERFVPROC glad_glTexParameterfv;
894 #define glTexParameterfv glad_glTexParameterfv
895 GLAD_API_CALL PFNGLTEXPARAMETERIPROC glad_glTexParameteri;
896 #define glTexParameteri glad_glTexParameteri
897 GLAD_API_CALL PFNGLTEXPARAMETERIVPROC glad_glTexParameteriv;
898 #define glTexParameteriv glad_glTexParameteriv
899 GLAD_API_CALL PFNGLTEXSUBIMAGE2DPROC glad_glTexSubImage2D;
900 #define glTexSubImage2D glad_glTexSubImage2D
901 GLAD_API_CALL PFNGLUNIFORM1FPROC glad_glUniform1f;
902 #define glUniform1f glad_glUniform1f
903 GLAD_API_CALL PFNGLUNIFORM1FVPROC glad_glUniform1fv;
904 #define glUniform1fv glad_glUniform1fv
905 GLAD_API_CALL PFNGLUNIFORM1IPROC glad_glUniform1i;
906 #define glUniform1i glad_glUniform1i
907 GLAD_API_CALL PFNGLUNIFORM1IVPROC glad_glUniform1iv;
908 #define glUniform1iv glad_glUniform1iv
909 GLAD_API_CALL PFNGLUNIFORM2FPROC glad_glUniform2f;
910 #define glUniform2f glad_glUniform2f
911 GLAD_API_CALL PFNGLUNIFORM2FVPROC glad_glUniform2fv;
912 #define glUniform2fv glad_glUniform2fv
913 GLAD_API_CALL PFNGLUNIFORM2IPROC glad_glUniform2i;
914 #define glUniform2i glad_glUniform2i
915 GLAD_API_CALL PFNGLUNIFORM2IVPROC glad_glUniform2iv;
916 #define glUniform2iv glad_glUniform2iv
917 GLAD_API_CALL PFNGLUNIFORM3FPROC glad_glUniform3f;
918 #define glUniform3f glad_glUniform3f
919 GLAD_API_CALL PFNGLUNIFORM3FVPROC glad_glUniform3fv;
920 #define glUniform3fv glad_glUniform3fv
921 GLAD_API_CALL PFNGLUNIFORM3IPROC glad_glUniform3i;
922 #define glUniform3i glad_glUniform3i
923 GLAD_API_CALL PFNGLUNIFORM3IVPROC glad_glUniform3iv;
924 #define glUniform3iv glad_glUniform3iv
925 GLAD_API_CALL PFNGLUNIFORM4FPROC glad_glUniform4f;
926 #define glUniform4f glad_glUniform4f
927 GLAD_API_CALL PFNGLUNIFORM4FVPROC glad_glUniform4fv;
928 #define glUniform4fv glad_glUniform4fv
929 GLAD_API_CALL PFNGLUNIFORM4IPROC glad_glUniform4i;
930 #define glUniform4i glad_glUniform4i
931 GLAD_API_CALL PFNGLUNIFORM4IVPROC glad_glUniform4iv;
932 #define glUniform4iv glad_glUniform4iv
933 GLAD_API_CALL PFNGLUNIFORMMATRIX2FVPROC glad_glUniformMatrix2fv;
934 #define glUniformMatrix2fv glad_glUniformMatrix2fv
935 GLAD_API_CALL PFNGLUNIFORMMATRIX3FVPROC glad_glUniformMatrix3fv;
936 #define glUniformMatrix3fv glad_glUniformMatrix3fv
937 GLAD_API_CALL PFNGLUNIFORMMATRIX4FVPROC glad_glUniformMatrix4fv;
938 #define glUniformMatrix4fv glad_glUniformMatrix4fv
939 GLAD_API_CALL PFNGLUSEPROGRAMPROC glad_glUseProgram;
940 #define glUseProgram glad_glUseProgram
941 GLAD_API_CALL PFNGLVALIDATEPROGRAMPROC glad_glValidateProgram;
942 #define glValidateProgram glad_glValidateProgram
943 GLAD_API_CALL PFNGLVERTEXATTRIB1FPROC glad_glVertexAttrib1f;
944 #define glVertexAttrib1f glad_glVertexAttrib1f
945 GLAD_API_CALL PFNGLVERTEXATTRIB1FVPROC glad_glVertexAttrib1fv;
946 #define glVertexAttrib1fv glad_glVertexAttrib1fv
947 GLAD_API_CALL PFNGLVERTEXATTRIB2FPROC glad_glVertexAttrib2f;
948 #define glVertexAttrib2f glad_glVertexAttrib2f
949 GLAD_API_CALL PFNGLVERTEXATTRIB2FVPROC glad_glVertexAttrib2fv;
950 #define glVertexAttrib2fv glad_glVertexAttrib2fv
951 GLAD_API_CALL PFNGLVERTEXATTRIB3FPROC glad_glVertexAttrib3f;
952 #define glVertexAttrib3f glad_glVertexAttrib3f
953 GLAD_API_CALL PFNGLVERTEXATTRIB3FVPROC glad_glVertexAttrib3fv;
954 #define glVertexAttrib3fv glad_glVertexAttrib3fv
955 GLAD_API_CALL PFNGLVERTEXATTRIB4FPROC glad_glVertexAttrib4f;
956 #define glVertexAttrib4f glad_glVertexAttrib4f
957 GLAD_API_CALL PFNGLVERTEXATTRIB4FVPROC glad_glVertexAttrib4fv;
958 #define glVertexAttrib4fv glad_glVertexAttrib4fv
959 GLAD_API_CALL PFNGLVERTEXATTRIBPOINTERPROC glad_glVertexAttribPointer;
960 #define glVertexAttribPointer glad_glVertexAttribPointer
961 GLAD_API_CALL PFNGLVIEWPORTPROC glad_glViewport;
962 #define glViewport glad_glViewport
963
964
965
966
967
968 GLAD_API_CALL int gladLoadGLES2UserPtr( GLADuserptrloadfunc load, void *userptr);
969 GLAD_API_CALL int gladLoadGLES2( GLADloadfunc load);
970
971
972
973 #ifdef __cplusplus
974 }
975 #endif
976 #endif
977
978 /* Source */
979 #ifdef GLAD_GLES2_IMPLEMENTATION
980 #include <stdint.h>
981 #include <stdio.h>
982 #include <stdlib.h>
983 #include <string.h>
984
985 #ifndef GLAD_IMPL_UTIL_C_
986 #define GLAD_IMPL_UTIL_C_
987
988 #ifdef _MSC_VER
989 #define GLAD_IMPL_UTIL_SSCANF sscanf_s
990 #else
991 #define GLAD_IMPL_UTIL_SSCANF sscanf
992 #endif
993
994 #endif /* GLAD_IMPL_UTIL_C_ */
995
996
997 int GLAD_GL_ES_VERSION_2_0 = 0;
998
999
1000
1001 PFNGLACTIVETEXTUREPROC glad_glActiveTexture = NULL;
1002 PFNGLATTACHSHADERPROC glad_glAttachShader = NULL;
1003 PFNGLBINDATTRIBLOCATIONPROC glad_glBindAttribLocation = NULL;
1004 PFNGLBINDBUFFERPROC glad_glBindBuffer = NULL;
1005 PFNGLBINDFRAMEBUFFERPROC glad_glBindFramebuffer = NULL;
1006 PFNGLBINDRENDERBUFFERPROC glad_glBindRenderbuffer = NULL;
1007 PFNGLBINDTEXTUREPROC glad_glBindTexture = NULL;
1008 PFNGLBLENDCOLORPROC glad_glBlendColor = NULL;
1009 PFNGLBLENDEQUATIONPROC glad_glBlendEquation = NULL;
1010 PFNGLBLENDEQUATIONSEPARATEPROC glad_glBlendEquationSeparate = NULL;
1011 PFNGLBLENDFUNCPROC glad_glBlendFunc = NULL;
1012 PFNGLBLENDFUNCSEPARATEPROC glad_glBlendFuncSeparate = NULL;
1013 PFNGLBUFFERDATAPROC glad_glBufferData = NULL;
1014 PFNGLBUFFERSUBDATAPROC glad_glBufferSubData = NULL;
1015 PFNGLCHECKFRAMEBUFFERSTATUSPROC glad_glCheckFramebufferStatus = NULL;
1016 PFNGLCLEARPROC glad_glClear = NULL;
1017 PFNGLCLEARCOLORPROC glad_glClearColor = NULL;
1018 PFNGLCLEARDEPTHFPROC glad_glClearDepthf = NULL;
1019 PFNGLCLEARSTENCILPROC glad_glClearStencil = NULL;
1020 PFNGLCOLORMASKPROC glad_glColorMask = NULL;
1021 PFNGLCOMPILESHADERPROC glad_glCompileShader = NULL;
1022 PFNGLCOMPRESSEDTEXIMAGE2DPROC glad_glCompressedTexImage2D = NULL;
1023 PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glad_glCompressedTexSubImage2D = NULL;
1024 PFNGLCOPYTEXIMAGE2DPROC glad_glCopyTexImage2D = NULL;
1025 PFNGLCOPYTEXSUBIMAGE2DPROC glad_glCopyTexSubImage2D = NULL;
1026 PFNGLCREATEPROGRAMPROC glad_glCreateProgram = NULL;
1027 PFNGLCREATESHADERPROC glad_glCreateShader = NULL;
1028 PFNGLCULLFACEPROC glad_glCullFace = NULL;
1029 PFNGLDELETEBUFFERSPROC glad_glDeleteBuffers = NULL;
1030 PFNGLDELETEFRAMEBUFFERSPROC glad_glDeleteFramebuffers = NULL;
1031 PFNGLDELETEPROGRAMPROC glad_glDeleteProgram = NULL;
1032 PFNGLDELETERENDERBUFFERSPROC glad_glDeleteRenderbuffers = NULL;
1033 PFNGLDELETESHADERPROC glad_glDeleteShader = NULL;
1034 PFNGLDELETETEXTURESPROC glad_glDeleteTextures = NULL;
1035 PFNGLDEPTHFUNCPROC glad_glDepthFunc = NULL;
1036 PFNGLDEPTHMASKPROC glad_glDepthMask = NULL;
1037 PFNGLDEPTHRANGEFPROC glad_glDepthRangef = NULL;
1038 PFNGLDETACHSHADERPROC glad_glDetachShader = NULL;
1039 PFNGLDISABLEPROC glad_glDisable = NULL;
1040 PFNGLDISABLEVERTEXATTRIBARRAYPROC glad_glDisableVertexAttribArray = NULL;
1041 PFNGLDRAWARRAYSPROC glad_glDrawArrays = NULL;
1042 PFNGLDRAWELEMENTSPROC glad_glDrawElements = NULL;
1043 PFNGLENABLEPROC glad_glEnable = NULL;
1044 PFNGLENABLEVERTEXATTRIBARRAYPROC glad_glEnableVertexAttribArray = NULL;
1045 PFNGLFINISHPROC glad_glFinish = NULL;
1046 PFNGLFLUSHPROC glad_glFlush = NULL;
1047 PFNGLFRAMEBUFFERRENDERBUFFERPROC glad_glFramebufferRenderbuffer = NULL;
1048 PFNGLFRAMEBUFFERTEXTURE2DPROC glad_glFramebufferTexture2D = NULL;
1049 PFNGLFRONTFACEPROC glad_glFrontFace = NULL;
1050 PFNGLGENBUFFERSPROC glad_glGenBuffers = NULL;
1051 PFNGLGENFRAMEBUFFERSPROC glad_glGenFramebuffers = NULL;
1052 PFNGLGENRENDERBUFFERSPROC glad_glGenRenderbuffers = NULL;
1053 PFNGLGENTEXTURESPROC glad_glGenTextures = NULL;
1054 PFNGLGENERATEMIPMAPPROC glad_glGenerateMipmap = NULL;
1055 PFNGLGETACTIVEATTRIBPROC glad_glGetActiveAttrib = NULL;
1056 PFNGLGETACTIVEUNIFORMPROC glad_glGetActiveUniform = NULL;
1057 PFNGLGETATTACHEDSHADERSPROC glad_glGetAttachedShaders = NULL;
1058 PFNGLGETATTRIBLOCATIONPROC glad_glGetAttribLocation = NULL;
1059 PFNGLGETBOOLEANVPROC glad_glGetBooleanv = NULL;
1060 PFNGLGETBUFFERPARAMETERIVPROC glad_glGetBufferParameteriv = NULL;
1061 PFNGLGETERRORPROC glad_glGetError = NULL;
1062 PFNGLGETFLOATVPROC glad_glGetFloatv = NULL;
1063 PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetFramebufferAttachmentParameteriv = NULL;
1064 PFNGLGETINTEGERVPROC glad_glGetIntegerv = NULL;
1065 PFNGLGETPROGRAMINFOLOGPROC glad_glGetProgramInfoLog = NULL;
1066 PFNGLGETPROGRAMIVPROC glad_glGetProgramiv = NULL;
1067 PFNGLGETRENDERBUFFERPARAMETERIVPROC glad_glGetRenderbufferParameteriv = NULL;
1068 PFNGLGETSHADERINFOLOGPROC glad_glGetShaderInfoLog = NULL;
1069 PFNGLGETSHADERPRECISIONFORMATPROC glad_glGetShaderPrecisionFormat = NULL;
1070 PFNGLGETSHADERSOURCEPROC glad_glGetShaderSource = NULL;
1071 PFNGLGETSHADERIVPROC glad_glGetShaderiv = NULL;
1072 PFNGLGETSTRINGPROC glad_glGetString = NULL;
1073 PFNGLGETTEXPARAMETERFVPROC glad_glGetTexParameterfv = NULL;
1074 PFNGLGETTEXPARAMETERIVPROC glad_glGetTexParameteriv = NULL;
1075 PFNGLGETUNIFORMLOCATIONPROC glad_glGetUniformLocation = NULL;
1076 PFNGLGETUNIFORMFVPROC glad_glGetUniformfv = NULL;
1077 PFNGLGETUNIFORMIVPROC glad_glGetUniformiv = NULL;
1078 PFNGLGETVERTEXATTRIBPOINTERVPROC glad_glGetVertexAttribPointerv = NULL;
1079 PFNGLGETVERTEXATTRIBFVPROC glad_glGetVertexAttribfv = NULL;
1080 PFNGLGETVERTEXATTRIBIVPROC glad_glGetVertexAttribiv = NULL;
1081 PFNGLHINTPROC glad_glHint = NULL;
1082 PFNGLISBUFFERPROC glad_glIsBuffer = NULL;
1083 PFNGLISENABLEDPROC glad_glIsEnabled = NULL;
1084 PFNGLISFRAMEBUFFERPROC glad_glIsFramebuffer = NULL;
1085 PFNGLISPROGRAMPROC glad_glIsProgram = NULL;
1086 PFNGLISRENDERBUFFERPROC glad_glIsRenderbuffer = NULL;
1087 PFNGLISSHADERPROC glad_glIsShader = NULL;
1088 PFNGLISTEXTUREPROC glad_glIsTexture = NULL;
1089 PFNGLLINEWIDTHPROC glad_glLineWidth = NULL;
1090 PFNGLLINKPROGRAMPROC glad_glLinkProgram = NULL;
1091 PFNGLPIXELSTOREIPROC glad_glPixelStorei = NULL;
1092 PFNGLPOLYGONOFFSETPROC glad_glPolygonOffset = NULL;
1093 PFNGLREADPIXELSPROC glad_glReadPixels = NULL;
1094 PFNGLRELEASESHADERCOMPILERPROC glad_glReleaseShaderCompiler = NULL;
1095 PFNGLRENDERBUFFERSTORAGEPROC glad_glRenderbufferStorage = NULL;
1096 PFNGLSAMPLECOVERAGEPROC glad_glSampleCoverage = NULL;
1097 PFNGLSCISSORPROC glad_glScissor = NULL;
1098 PFNGLSHADERBINARYPROC glad_glShaderBinary = NULL;
1099 PFNGLSHADERSOURCEPROC glad_glShaderSource = NULL;
1100 PFNGLSTENCILFUNCPROC glad_glStencilFunc = NULL;
1101 PFNGLSTENCILFUNCSEPARATEPROC glad_glStencilFuncSeparate = NULL;
1102 PFNGLSTENCILMASKPROC glad_glStencilMask = NULL;
1103 PFNGLSTENCILMASKSEPARATEPROC glad_glStencilMaskSeparate = NULL;
1104 PFNGLSTENCILOPPROC glad_glStencilOp = NULL;
1105 PFNGLSTENCILOPSEPARATEPROC glad_glStencilOpSeparate = NULL;
1106 PFNGLTEXIMAGE2DPROC glad_glTexImage2D = NULL;
1107 PFNGLTEXPARAMETERFPROC glad_glTexParameterf = NULL;
1108 PFNGLTEXPARAMETERFVPROC glad_glTexParameterfv = NULL;
1109 PFNGLTEXPARAMETERIPROC glad_glTexParameteri = NULL;
1110 PFNGLTEXPARAMETERIVPROC glad_glTexParameteriv = NULL;
1111 PFNGLTEXSUBIMAGE2DPROC glad_glTexSubImage2D = NULL;
1112 PFNGLUNIFORM1FPROC glad_glUniform1f = NULL;
1113 PFNGLUNIFORM1FVPROC glad_glUniform1fv = NULL;
1114 PFNGLUNIFORM1IPROC glad_glUniform1i = NULL;
1115 PFNGLUNIFORM1IVPROC glad_glUniform1iv = NULL;
1116 PFNGLUNIFORM2FPROC glad_glUniform2f = NULL;
1117 PFNGLUNIFORM2FVPROC glad_glUniform2fv = NULL;
1118 PFNGLUNIFORM2IPROC glad_glUniform2i = NULL;
1119 PFNGLUNIFORM2IVPROC glad_glUniform2iv = NULL;
1120 PFNGLUNIFORM3FPROC glad_glUniform3f = NULL;
1121 PFNGLUNIFORM3FVPROC glad_glUniform3fv = NULL;
1122 PFNGLUNIFORM3IPROC glad_glUniform3i = NULL;
1123 PFNGLUNIFORM3IVPROC glad_glUniform3iv = NULL;
1124 PFNGLUNIFORM4FPROC glad_glUniform4f = NULL;
1125 PFNGLUNIFORM4FVPROC glad_glUniform4fv = NULL;
1126 PFNGLUNIFORM4IPROC glad_glUniform4i = NULL;
1127 PFNGLUNIFORM4IVPROC glad_glUniform4iv = NULL;
1128 PFNGLUNIFORMMATRIX2FVPROC glad_glUniformMatrix2fv = NULL;
1129 PFNGLUNIFORMMATRIX3FVPROC glad_glUniformMatrix3fv = NULL;
1130 PFNGLUNIFORMMATRIX4FVPROC glad_glUniformMatrix4fv = NULL;
1131 PFNGLUSEPROGRAMPROC glad_glUseProgram = NULL;
1132 PFNGLVALIDATEPROGRAMPROC glad_glValidateProgram = NULL;
1133 PFNGLVERTEXATTRIB1FPROC glad_glVertexAttrib1f = NULL;
1134 PFNGLVERTEXATTRIB1FVPROC glad_glVertexAttrib1fv = NULL;
1135 PFNGLVERTEXATTRIB2FPROC glad_glVertexAttrib2f = NULL;
1136 PFNGLVERTEXATTRIB2FVPROC glad_glVertexAttrib2fv = NULL;
1137 PFNGLVERTEXATTRIB3FPROC glad_glVertexAttrib3f = NULL;
1138 PFNGLVERTEXATTRIB3FVPROC glad_glVertexAttrib3fv = NULL;
1139 PFNGLVERTEXATTRIB4FPROC glad_glVertexAttrib4f = NULL;
1140 PFNGLVERTEXATTRIB4FVPROC glad_glVertexAttrib4fv = NULL;
1141 PFNGLVERTEXATTRIBPOINTERPROC glad_glVertexAttribPointer = NULL;
1142 PFNGLVIEWPORTPROC glad_glViewport = NULL;
1143
1144
1145 static void glad_gl_load_GL_ES_VERSION_2_0( GLADuserptrloadfunc load, void* userptr) {
1146 if(!GLAD_GL_ES_VERSION_2_0) return;
1147 glad_glActiveTexture = (PFNGLACTIVETEXTUREPROC) load(userptr, "glActiveTexture");
1148 glad_glAttachShader = (PFNGLATTACHSHADERPROC) load(userptr, "glAttachShader");
1149 glad_glBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC) load(userptr, "glBindAttribLocation");
1150 glad_glBindBuffer = (PFNGLBINDBUFFERPROC) load(userptr, "glBindBuffer");
1151 glad_glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC) load(userptr, "glBindFramebuffer");
1152 glad_glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC) load(userptr, "glBindRenderbuffer");
1153 glad_glBindTexture = (PFNGLBINDTEXTUREPROC) load(userptr, "glBindTexture");
1154 glad_glBlendColor = (PFNGLBLENDCOLORPROC) load(userptr, "glBlendColor");
1155 glad_glBlendEquation = (PFNGLBLENDEQUATIONPROC) load(userptr, "glBlendEquation");
1156 glad_glBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC) load(userptr, "glBlendEquationSeparate");
1157 glad_glBlendFunc = (PFNGLBLENDFUNCPROC) load(userptr, "glBlendFunc");
1158 glad_glBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC) load(userptr, "glBlendFuncSeparate");
1159 glad_glBufferData = (PFNGLBUFFERDATAPROC) load(userptr, "glBufferData");
1160 glad_glBufferSubData = (PFNGLBUFFERSUBDATAPROC) load(userptr, "glBufferSubData");
1161 glad_glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC) load(userptr, "glCheckFramebufferStatus");
1162 glad_glClear = (PFNGLCLEARPROC) load(userptr, "glClear");
1163 glad_glClearColor = (PFNGLCLEARCOLORPROC) load(userptr, "glClearColor");
1164 glad_glClearDepthf = (PFNGLCLEARDEPTHFPROC) load(userptr, "glClearDepthf");
1165 glad_glClearStencil = (PFNGLCLEARSTENCILPROC) load(userptr, "glClearStencil");
1166 glad_glColorMask = (PFNGLCOLORMASKPROC) load(userptr, "glColorMask");
1167 glad_glCompileShader = (PFNGLCOMPILESHADERPROC) load(userptr, "glCompileShader");
1168 glad_glCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC) load(userptr, "glCompressedTexImage2D");
1169 glad_glCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) load(userptr, "glCompressedTexSubImage2D");
1170 glad_glCopyTexImage2D = (PFNGLCOPYTEXIMAGE2DPROC) load(userptr, "glCopyTexImage2D");
1171 glad_glCopyTexSubImage2D = (PFNGLCOPYTEXSUBIMAGE2DPROC) load(userptr, "glCopyTexSubImage2D");
1172 glad_glCreateProgram = (PFNGLCREATEPROGRAMPROC) load(userptr, "glCreateProgram");
1173 glad_glCreateShader = (PFNGLCREATESHADERPROC) load(userptr, "glCreateShader");
1174 glad_glCullFace = (PFNGLCULLFACEPROC) load(userptr, "glCullFace");
1175 glad_glDeleteBuffers = (PFNGLDELETEBUFFERSPROC) load(userptr, "glDeleteBuffers");
1176 glad_glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC) load(userptr, "glDeleteFramebuffers");
1177 glad_glDeleteProgram = (PFNGLDELETEPROGRAMPROC) load(userptr, "glDeleteProgram");
1178 glad_glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC) load(userptr, "glDeleteRenderbuffers");
1179 glad_glDeleteShader = (PFNGLDELETESHADERPROC) load(userptr, "glDeleteShader");
1180 glad_glDeleteTextures = (PFNGLDELETETEXTURESPROC) load(userptr, "glDeleteTextures");
1181 glad_glDepthFunc = (PFNGLDEPTHFUNCPROC) load(userptr, "glDepthFunc");
1182 glad_glDepthMask = (PFNGLDEPTHMASKPROC) load(userptr, "glDepthMask");
1183 glad_glDepthRangef = (PFNGLDEPTHRANGEFPROC) load(userptr, "glDepthRangef");
1184 glad_glDetachShader = (PFNGLDETACHSHADERPROC) load(userptr, "glDetachShader");
1185 glad_glDisable = (PFNGLDISABLEPROC) load(userptr, "glDisable");
1186 glad_glDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC) load(userptr, "glDisableVertexAttribArray");
1187 glad_glDrawArrays = (PFNGLDRAWARRAYSPROC) load(userptr, "glDrawArrays");
1188 glad_glDrawElements = (PFNGLDRAWELEMENTSPROC) load(userptr, "glDrawElements");
1189 glad_glEnable = (PFNGLENABLEPROC) load(userptr, "glEnable");
1190 glad_glEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC) load(userptr, "glEnableVertexAttribArray");
1191 glad_glFinish = (PFNGLFINISHPROC) load(userptr, "glFinish");
1192 glad_glFlush = (PFNGLFLUSHPROC) load(userptr, "glFlush");
1193 glad_glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC) load(userptr, "glFramebufferRenderbuffer");
1194 glad_glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC) load(userptr, "glFramebufferTexture2D");
1195 glad_glFrontFace = (PFNGLFRONTFACEPROC) load(userptr, "glFrontFace");
1196 glad_glGenBuffers = (PFNGLGENBUFFERSPROC) load(userptr, "glGenBuffers");
1197 glad_glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC) load(userptr, "glGenFramebuffers");
1198 glad_glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC) load(userptr, "glGenRenderbuffers");
1199 glad_glGenTextures = (PFNGLGENTEXTURESPROC) load(userptr, "glGenTextures");
1200 glad_glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC) load(userptr, "glGenerateMipmap");
1201 glad_glGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC) load(userptr, "glGetActiveAttrib");
1202 glad_glGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC) load(userptr, "glGetActiveUniform");
1203 glad_glGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC) load(userptr, "glGetAttachedShaders");
1204 glad_glGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC) load(userptr, "glGetAttribLocation");
1205 glad_glGetBooleanv = (PFNGLGETBOOLEANVPROC) load(userptr, "glGetBooleanv");
1206 glad_glGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC) load(userptr, "glGetBufferParameteriv");
1207 glad_glGetError = (PFNGLGETERRORPROC) load(userptr, "glGetError");
1208 glad_glGetFloatv = (PFNGLGETFLOATVPROC) load(userptr, "glGetFloatv");
1209 glad_glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) load(userptr, "glGetFramebufferAttachmentParameteriv");
1210 glad_glGetIntegerv = (PFNGLGETINTEGERVPROC) load(userptr, "glGetIntegerv");
1211 glad_glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC) load(userptr, "glGetProgramInfoLog");
1212 glad_glGetProgramiv = (PFNGLGETPROGRAMIVPROC) load(userptr, "glGetProgramiv");
1213 glad_glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC) load(userptr, "glGetRenderbufferParameteriv");
1214 glad_glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC) load(userptr, "glGetShaderInfoLog");
1215 glad_glGetShaderPrecisionFormat = (PFNGLGETSHADERPRECISIONFORMATPROC) load(userptr, "glGetShaderPrecisionFormat");
1216 glad_glGetShaderSource = (PFNGLGETSHADERSOURCEPROC) load(userptr, "glGetShaderSource");
1217 glad_glGetShaderiv = (PFNGLGETSHADERIVPROC) load(userptr, "glGetShaderiv");
1218 glad_glGetString = (PFNGLGETSTRINGPROC) load(userptr, "glGetString");
1219 glad_glGetTexParameterfv = (PFNGLGETTEXPARAMETERFVPROC) load(userptr, "glGetTexParameterfv");
1220 glad_glGetTexParameteriv = (PFNGLGETTEXPARAMETERIVPROC) load(userptr, "glGetTexParameteriv");
1221 glad_glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC) load(userptr, "glGetUniformLocation");
1222 glad_glGetUniformfv = (PFNGLGETUNIFORMFVPROC) load(userptr, "glGetUniformfv");
1223 glad_glGetUniformiv = (PFNGLGETUNIFORMIVPROC) load(userptr, "glGetUniformiv");
1224 glad_glGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC) load(userptr, "glGetVertexAttribPointerv");
1225 glad_glGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC) load(userptr, "glGetVertexAttribfv");
1226 glad_glGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC) load(userptr, "glGetVertexAttribiv");
1227 glad_glHint = (PFNGLHINTPROC) load(userptr, "glHint");
1228 glad_glIsBuffer = (PFNGLISBUFFERPROC) load(userptr, "glIsBuffer");
1229 glad_glIsEnabled = (PFNGLISENABLEDPROC) load(userptr, "glIsEnabled");
1230 glad_glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC) load(userptr, "glIsFramebuffer");
1231 glad_glIsProgram = (PFNGLISPROGRAMPROC) load(userptr, "glIsProgram");
1232 glad_glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC) load(userptr, "glIsRenderbuffer");
1233 glad_glIsShader = (PFNGLISSHADERPROC) load(userptr, "glIsShader");
1234 glad_glIsTexture = (PFNGLISTEXTUREPROC) load(userptr, "glIsTexture");
1235 glad_glLineWidth = (PFNGLLINEWIDTHPROC) load(userptr, "glLineWidth");
1236 glad_glLinkProgram = (PFNGLLINKPROGRAMPROC) load(userptr, "glLinkProgram");
1237 glad_glPixelStorei = (PFNGLPIXELSTOREIPROC) load(userptr, "glPixelStorei");
1238 glad_glPolygonOffset = (PFNGLPOLYGONOFFSETPROC) load(userptr, "glPolygonOffset");
1239 glad_glReadPixels = (PFNGLREADPIXELSPROC) load(userptr, "glReadPixels");
1240 glad_glReleaseShaderCompiler = (PFNGLRELEASESHADERCOMPILERPROC) load(userptr, "glReleaseShaderCompiler");
1241 glad_glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC) load(userptr, "glRenderbufferStorage");
1242 glad_glSampleCoverage = (PFNGLSAMPLECOVERAGEPROC) load(userptr, "glSampleCoverage");
1243 glad_glScissor = (PFNGLSCISSORPROC) load(userptr, "glScissor");
1244 glad_glShaderBinary = (PFNGLSHADERBINARYPROC) load(userptr, "glShaderBinary");
1245 glad_glShaderSource = (PFNGLSHADERSOURCEPROC) load(userptr, "glShaderSource");
1246 glad_glStencilFunc = (PFNGLSTENCILFUNCPROC) load(userptr, "glStencilFunc");
1247 glad_glStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC) load(userptr, "glStencilFuncSeparate");
1248 glad_glStencilMask = (PFNGLSTENCILMASKPROC) load(userptr, "glStencilMask");
1249 glad_glStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC) load(userptr, "glStencilMaskSeparate");
1250 glad_glStencilOp = (PFNGLSTENCILOPPROC) load(userptr, "glStencilOp");
1251 glad_glStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC) load(userptr, "glStencilOpSeparate");
1252 glad_glTexImage2D = (PFNGLTEXIMAGE2DPROC) load(userptr, "glTexImage2D");
1253 glad_glTexParameterf = (PFNGLTEXPARAMETERFPROC) load(userptr, "glTexParameterf");
1254 glad_glTexParameterfv = (PFNGLTEXPARAMETERFVPROC) load(userptr, "glTexParameterfv");
1255 glad_glTexParameteri = (PFNGLTEXPARAMETERIPROC) load(userptr, "glTexParameteri");
1256 glad_glTexParameteriv = (PFNGLTEXPARAMETERIVPROC) load(userptr, "glTexParameteriv");
1257 glad_glTexSubImage2D = (PFNGLTEXSUBIMAGE2DPROC) load(userptr, "glTexSubImage2D");
1258 glad_glUniform1f = (PFNGLUNIFORM1FPROC) load(userptr, "glUniform1f");
1259 glad_glUniform1fv = (PFNGLUNIFORM1FVPROC) load(userptr, "glUniform1fv");
1260 glad_glUniform1i = (PFNGLUNIFORM1IPROC) load(userptr, "glUniform1i");
1261 glad_glUniform1iv = (PFNGLUNIFORM1IVPROC) load(userptr, "glUniform1iv");
1262 glad_glUniform2f = (PFNGLUNIFORM2FPROC) load(userptr, "glUniform2f");
1263 glad_glUniform2fv = (PFNGLUNIFORM2FVPROC) load(userptr, "glUniform2fv");
1264 glad_glUniform2i = (PFNGLUNIFORM2IPROC) load(userptr, "glUniform2i");
1265 glad_glUniform2iv = (PFNGLUNIFORM2IVPROC) load(userptr, "glUniform2iv");
1266 glad_glUniform3f = (PFNGLUNIFORM3FPROC) load(userptr, "glUniform3f");
1267 glad_glUniform3fv = (PFNGLUNIFORM3FVPROC) load(userptr, "glUniform3fv");
1268 glad_glUniform3i = (PFNGLUNIFORM3IPROC) load(userptr, "glUniform3i");
1269 glad_glUniform3iv = (PFNGLUNIFORM3IVPROC) load(userptr, "glUniform3iv");
1270 glad_glUniform4f = (PFNGLUNIFORM4FPROC) load(userptr, "glUniform4f");
1271 glad_glUniform4fv = (PFNGLUNIFORM4FVPROC) load(userptr, "glUniform4fv");
1272 glad_glUniform4i = (PFNGLUNIFORM4IPROC) load(userptr, "glUniform4i");
1273 glad_glUniform4iv = (PFNGLUNIFORM4IVPROC) load(userptr, "glUniform4iv");
1274 glad_glUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC) load(userptr, "glUniformMatrix2fv");
1275 glad_glUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC) load(userptr, "glUniformMatrix3fv");
1276 glad_glUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC) load(userptr, "glUniformMatrix4fv");
1277 glad_glUseProgram = (PFNGLUSEPROGRAMPROC) load(userptr, "glUseProgram");
1278 glad_glValidateProgram = (PFNGLVALIDATEPROGRAMPROC) load(userptr, "glValidateProgram");
1279 glad_glVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC) load(userptr, "glVertexAttrib1f");
1280 glad_glVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC) load(userptr, "glVertexAttrib1fv");
1281 glad_glVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC) load(userptr, "glVertexAttrib2f");
1282 glad_glVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC) load(userptr, "glVertexAttrib2fv");
1283 glad_glVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC) load(userptr, "glVertexAttrib3f");
1284 glad_glVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC) load(userptr, "glVertexAttrib3fv");
1285 glad_glVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC) load(userptr, "glVertexAttrib4f");
1286 glad_glVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC) load(userptr, "glVertexAttrib4fv");
1287 glad_glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC) load(userptr, "glVertexAttribPointer");
1288 glad_glViewport = (PFNGLVIEWPORTPROC) load(userptr, "glViewport");
1289 }
1290
1291
1292
1293 #if defined(GL_ES_VERSION_3_0) || defined(GL_VERSION_3_0)
1294 #define GLAD_GL_IS_SOME_NEW_VERSION 1
1295 #else
1296 #define GLAD_GL_IS_SOME_NEW_VERSION 0
1297 #endif
1298
1299 static int glad_gl_get_extensions( int version, const char **out_exts, unsigned int *out_num_exts_i, char ***out_exts_i) {
1300 #if GLAD_GL_IS_SOME_NEW_VERSION
1301 if(GLAD_VERSION_MAJOR(version) < 3) {
1302 #else
1303 (void) version;
1304 (void) out_num_exts_i;
1305 (void) out_exts_i;
1306 #endif
1307 if (glad_glGetString == NULL) {
1308 return 0;
1309 }
1310 *out_exts = (const char *)glad_glGetString(GL_EXTENSIONS);
1311 #if GLAD_GL_IS_SOME_NEW_VERSION
1312 } else {
1313 unsigned int index = 0;
1314 unsigned int num_exts_i = 0;
1315 char **exts_i = NULL;
1316 if (glad_glGetStringi == NULL || glad_glGetIntegerv == NULL) {
1317 return 0;
1318 }
1319 glad_glGetIntegerv(GL_NUM_EXTENSIONS, (int*) &num_exts_i);
1320 if (num_exts_i > 0) {
1321 exts_i = (char **) malloc(num_exts_i * (sizeof *exts_i));
1322 }
1323 if (exts_i == NULL) {
1324 return 0;
1325 }
1326 for(index = 0; index < num_exts_i; index++) {
1327 const char *gl_str_tmp = (const char*) glad_glGetStringi(GL_EXTENSIONS, index);
1328 size_t len = strlen(gl_str_tmp) + 1;
1329
1330 char *local_str = (char*) malloc(len * sizeof(char));
1331 if(local_str != NULL) {
1332 memcpy(local_str, gl_str_tmp, len * sizeof(char));
1333 }
1334
1335 exts_i[index] = local_str;
1336 }
1337
1338 *out_num_exts_i = num_exts_i;
1339 *out_exts_i = exts_i;
1340 }
1341 #endif
1342 return 1;
1343 }
1344 static void glad_gl_free_extensions(char **exts_i, unsigned int num_exts_i) {
1345 if (exts_i != NULL) {
1346 unsigned int index;
1347 for(index = 0; index < num_exts_i; index++) {
1348 free((void *) (exts_i[index]));
1349 }
1350 free((void *)exts_i);
1351 exts_i = NULL;
1352 }
1353 }
1354 static int glad_gl_has_extension(int version, const char *exts, unsigned int num_exts_i, char **exts_i, const char *ext) {
1355 if(GLAD_VERSION_MAJOR(version) < 3 || !GLAD_GL_IS_SOME_NEW_VERSION) {
1356 const char *extensions;
1357 const char *loc;
1358 const char *terminator;
1359 extensions = exts;
1360 if(extensions == NULL || ext == NULL) {
1361 return 0;
1362 }
1363 while(1) {
1364 loc = strstr(extensions, ext);
1365 if(loc == NULL) {
1366 return 0;
1367 }
1368 terminator = loc + strlen(ext);
1369 if((loc == extensions || *(loc - 1) == ' ') &&
1370 (*terminator == ' ' || *terminator == '\0')) {
1371 return 1;
1372 }
1373 extensions = terminator;
1374 }
1375 } else {
1376 unsigned int index;
1377 for(index = 0; index < num_exts_i; index++) {
1378 const char *e = exts_i[index];
1379 if(strcmp(e, ext) == 0) {
1380 return 1;
1381 }
1382 }
1383 }
1384 return 0;
1385 }
1386
1387 static GLADapiproc glad_gl_get_proc_from_userptr(void *userptr, const char* name) {
1388 return (GLAD_GNUC_EXTENSION (GLADapiproc (*)(const char *name)) userptr)(name);
1389 }
1390
1391 static int glad_gl_find_extensions_gles2( int version) {
1392 const char *exts = NULL;
1393 unsigned int num_exts_i = 0;
1394 char **exts_i = NULL;
1395 if (!glad_gl_get_extensions(version, &exts, &num_exts_i, &exts_i)) return 0;
1396
1397 (void) glad_gl_has_extension;
1398
1399 glad_gl_free_extensions(exts_i, num_exts_i);
1400
1401 return 1;
1402 }
1403
1404 static int glad_gl_find_core_gles2(void) {
1405 int i, major, minor;
1406 const char* version;
1407 const char* prefixes[] = {
1408 "OpenGL ES-CM ",
1409 "OpenGL ES-CL ",
1410 "OpenGL ES ",
1411 NULL
1412 };
1413 version = (const char*) glad_glGetString(GL_VERSION);
1414 if (!version) return 0;
1415 for (i = 0; prefixes[i]; i++) {
1416 const size_t length = strlen(prefixes[i]);
1417 if (strncmp(version, prefixes[i], length) == 0) {
1418 version += length;
1419 break;
1420 }
1421 }
1422
1423 GLAD_IMPL_UTIL_SSCANF(version, "%d.%d", &major, &minor);
1424
1425 GLAD_GL_ES_VERSION_2_0 = (major == 2 && minor >= 0) || major > 2;
1426
1427 return GLAD_MAKE_VERSION(major, minor);
1428 }
1429
1430 int gladLoadGLES2UserPtr( GLADuserptrloadfunc load, void *userptr) {
1431 int version;
1432
1433 glad_glGetString = (PFNGLGETSTRINGPROC) load(userptr, "glGetString");
1434 if(glad_glGetString == NULL) return 0;
1435 if(glad_glGetString(GL_VERSION) == NULL) return 0;
1436 version = glad_gl_find_core_gles2();
1437
1438 glad_gl_load_GL_ES_VERSION_2_0(load, userptr);
1439
1440 if (!glad_gl_find_extensions_gles2(version)) return 0;
1441
1442
1443
1444 return version;
1445 }
1446
1447
1448 int gladLoadGLES2( GLADloadfunc load) {
1449 return gladLoadGLES2UserPtr( glad_gl_get_proc_from_userptr, GLAD_GNUC_EXTENSION (void*) load);
1450 }
1451
1452
1453 #endif /* GLAD_GLES2_IMPLEMENTATION */
File include/fg2/linalg.h added (mode: 100644) (index 0000000..aff292a)
1 // linalg.h - 2.2-beta - Single-header public domain linear algebra library
2 //
3 // The intent of this library is to provide the bulk of the functionality
4 // you need to write programs that frequently use small, fixed-size vectors
5 // and matrices, in domains such as computational geometry or computer
6 // graphics. It strives for terse, readable source code.
7 //
8 // The original author of this software is Sterling Orsten, and its permanent
9 // home is <http://github.com/sgorsten/linalg/>. If you find this software
10 // useful, an acknowledgement in your source text and/or product documentation
11 // is appreciated, but not required.
12 //
13 // The author acknowledges significant insights and contributions by:
14 // Stan Melax <http://github.com/melax/>
15 // Dimitri Diakopoulos <http://github.com/ddiakopoulos/>
16 //
17 // Some features are deprecated. Define LINALG_FORWARD_COMPATIBLE to remove them.
18
19
20
21 // This is free and unencumbered software released into the public domain.
22 //
23 // Anyone is free to copy, modify, publish, use, compile, sell, or
24 // distribute this software, either in source code form or as a compiled
25 // binary, for any purpose, commercial or non-commercial, and by any
26 // means.
27 //
28 // In jurisdictions that recognize copyright laws, the author or authors
29 // of this software dedicate any and all copyright interest in the
30 // software to the public domain. We make this dedication for the benefit
31 // of the public at large and to the detriment of our heirs and
32 // successors. We intend this dedication to be an overt act of
33 // relinquishment in perpetuity of all present and future rights to this
34 // software under copyright law.
35 //
36 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
37 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
38 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
39 // IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
40 // OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
41 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
42 // OTHER DEALINGS IN THE SOFTWARE.
43 //
44 // For more information, please refer to <http://unlicense.org/>
45
46
47
48 #pragma once
49 #ifndef LINALG_H
50 #define LINALG_H
51
52 #include <cmath> // For various unary math functions, such as std::sqrt
53 #include <cstdlib> // To resolve std::abs ambiguity on clang
54 #include <cstdint> // For implementing namespace linalg::aliases
55 #include <array> // For std::array
56 #include <iosfwd> // For forward definitions of std::ostream
57 #include <type_traits> // For std::enable_if, std::is_same, std::declval
58 #include <functional> // For std::hash declaration
59
60 // In Visual Studio 2015, `constexpr` applied to a member function implies `const`, which causes ambiguous overload resolution
61 #if _MSC_VER <= 1900
62 #define LINALG_CONSTEXPR14
63 #else
64 #define LINALG_CONSTEXPR14 constexpr
65 #endif
66
67 namespace linalg
68 {
69 // Small, fixed-length vector type, consisting of exactly M elements of type T, and presumed to be a column-vector unless otherwise noted.
70 template<class T, int M> struct vec;
71
72 // Small, fixed-size matrix type, consisting of exactly M rows and N columns of type T, stored in column-major order.
73 template<class T, int M, int N> struct mat;
74
75 // Specialize converter<T,U> with a function application operator that converts type U to type T to enable implicit conversions
76 template<class T, class U> struct converter {};
77 namespace detail
78 {
79 template<class T, class U> using conv_t = typename std::enable_if<!std::is_same<T,U>::value, decltype(converter<T,U>{}(std::declval<U>()))>::type;
80
81 // Trait for retrieving scalar type of any linear algebra object
82 template<class A> struct scalar_type {};
83 template<class T, int M > struct scalar_type<vec<T,M >> { using type = T; };
84 template<class T, int M, int N> struct scalar_type<mat<T,M,N>> { using type = T; };
85
86 // Type returned by the compare(...) function which supports all six comparison operators against 0
87 template<class T> struct ord { T a,b; };
88 template<class T> constexpr bool operator == (const ord<T> & o, std::nullptr_t) { return o.a == o.b; }
89 template<class T> constexpr bool operator != (const ord<T> & o, std::nullptr_t) { return !(o.a == o.b); }
90 template<class T> constexpr bool operator < (const ord<T> & o, std::nullptr_t) { return o.a < o.b; }
91 template<class T> constexpr bool operator > (const ord<T> & o, std::nullptr_t) { return o.b < o.a; }
92 template<class T> constexpr bool operator <= (const ord<T> & o, std::nullptr_t) { return !(o.b < o.a); }
93 template<class T> constexpr bool operator >= (const ord<T> & o, std::nullptr_t) { return !(o.a < o.b); }
94
95 // Patterns which can be used with the compare(...) function
96 template<class A, class B> struct any_compare {};
97 template<class T> struct any_compare<vec<T,1>,vec<T,1>> { using type=ord<T>; constexpr ord<T> operator() (const vec<T,1> & a, const vec<T,1> & b) const { return ord<T>{a.x,b.x}; } };
98 template<class T> struct any_compare<vec<T,2>,vec<T,2>> { using type=ord<T>; constexpr ord<T> operator() (const vec<T,2> & a, const vec<T,2> & b) const { return !(a.x==b.x) ? ord<T>{a.x,b.x} : ord<T>{a.y,b.y}; } };
99 template<class T> struct any_compare<vec<T,3>,vec<T,3>> { using type=ord<T>; constexpr ord<T> operator() (const vec<T,3> & a, const vec<T,3> & b) const { return !(a.x==b.x) ? ord<T>{a.x,b.x} : !(a.y==b.y) ? ord<T>{a.y,b.y} : ord<T>{a.z,b.z}; } };
100 template<class T> struct any_compare<vec<T,4>,vec<T,4>> { using type=ord<T>; constexpr ord<T> operator() (const vec<T,4> & a, const vec<T,4> & b) const { return !(a.x==b.x) ? ord<T>{a.x,b.x} : !(a.y==b.y) ? ord<T>{a.y,b.y} : !(a.z==b.z) ? ord<T>{a.z,b.z} : ord<T>{a.w,b.w}; } };
101 template<class T, int M> struct any_compare<mat<T,M,1>,mat<T,M,1>> { using type=ord<T>; constexpr ord<T> operator() (const mat<T,M,1> & a, const mat<T,M,1> & b) const { return compare(a.x,b.x); } };
102 template<class T, int M> struct any_compare<mat<T,M,2>,mat<T,M,2>> { using type=ord<T>; constexpr ord<T> operator() (const mat<T,M,2> & a, const mat<T,M,2> & b) const { return a.x!=b.x ? compare(a.x,b.x) : compare(a.y,b.y); } };
103 template<class T, int M> struct any_compare<mat<T,M,3>,mat<T,M,3>> { using type=ord<T>; constexpr ord<T> operator() (const mat<T,M,3> & a, const mat<T,M,3> & b) const { return a.x!=b.x ? compare(a.x,b.x) : a.y!=b.y ? compare(a.y,b.y) : compare(a.z,b.z); } };
104 template<class T, int M> struct any_compare<mat<T,M,4>,mat<T,M,4>> { using type=ord<T>; constexpr ord<T> operator() (const mat<T,M,4> & a, const mat<T,M,4> & b) const { return a.x!=b.x ? compare(a.x,b.x) : a.y!=b.y ? compare(a.y,b.y) : a.z!=b.z ? compare(a.z,b.z) : compare(a.w,b.w); } };
105
106 // Helper for compile-time index-based access to members of vector and matrix types
107 template<int I> struct getter;
108 template<> struct getter<0> { template<class A> constexpr auto operator() (A & a) const -> decltype(a.x) { return a.x; } };
109 template<> struct getter<1> { template<class A> constexpr auto operator() (A & a) const -> decltype(a.y) { return a.y; } };
110 template<> struct getter<2> { template<class A> constexpr auto operator() (A & a) const -> decltype(a.z) { return a.z; } };
111 template<> struct getter<3> { template<class A> constexpr auto operator() (A & a) const -> decltype(a.w) { return a.w; } };
112
113 // Stand-in for std::integer_sequence/std::make_integer_sequence
114 template<int... I> struct seq {};
115 template<int A, int N> struct make_seq_impl;
116 template<int A> struct make_seq_impl<A,0> { using type=seq<>; };
117 template<int A> struct make_seq_impl<A,1> { using type=seq<A+0>; };
118 template<int A> struct make_seq_impl<A,2> { using type=seq<A+0,A+1>; };
119 template<int A> struct make_seq_impl<A,3> { using type=seq<A+0,A+1,A+2>; };
120 template<int A> struct make_seq_impl<A,4> { using type=seq<A+0,A+1,A+2,A+3>; };
121 template<int A, int B> using make_seq = typename make_seq_impl<A,B-A>::type;
122 template<class T, int M, int... I> vec<T,sizeof...(I)> constexpr swizzle(const vec<T,M> & v, seq<I...> i) { return {getter<I>{}(v)...}; }
123 template<class T, int M, int N, int... I, int... J> mat<T,sizeof...(I),sizeof...(J)> constexpr swizzle(const mat<T,M,N> & m, seq<I...> i, seq<J...> j) { return {swizzle(getter<J>{}(m),i)...}; }
124
125 // SFINAE helpers to determine result of function application
126 template<class F, class... T> using ret_t = decltype(std::declval<F>()(std::declval<T>()...));
127
128 // SFINAE helper which is defined if all provided types are scalars
129 struct empty {};
130 template<class... T> struct scalars;
131 template<> struct scalars<> { using type=void; };
132 template<class T, class... U> struct scalars<T,U...> : std::conditional<std::is_arithmetic<T>::value, scalars<U...>, empty>::type {};
133 template<class... T> using scalars_t = typename scalars<T...>::type;
134
135 // Helpers which indicate how apply(F, ...) should be called for various arguments
136 template<class F, class Void, class... T> struct apply {}; // Patterns which contain only vectors or scalars
137 template<class F, int M, class A > struct apply<F, scalars_t< >, vec<A,M> > { using type=vec<ret_t<F,A >,M>; enum {size=M, mm=0}; template<int... I> static constexpr type impl(seq<I...>, F f, const vec<A,M> & a ) { return {f(getter<I>{}(a) )...}; } };
138 template<class F, int M, class A, class B > struct apply<F, scalars_t< >, vec<A,M>, vec<B,M> > { using type=vec<ret_t<F,A,B >,M>; enum {size=M, mm=0}; template<int... I> static constexpr type impl(seq<I...>, F f, const vec<A,M> & a, const vec<B,M> & b ) { return {f(getter<I>{}(a), getter<I>{}(b) )...}; } };
139 template<class F, int M, class A, class B > struct apply<F, scalars_t<B >, vec<A,M>, B > { using type=vec<ret_t<F,A,B >,M>; enum {size=M, mm=0}; template<int... I> static constexpr type impl(seq<I...>, F f, const vec<A,M> & a, B b ) { return {f(getter<I>{}(a), b )...}; } };
140 template<class F, int M, class A, class B > struct apply<F, scalars_t<A >, A, vec<B,M> > { using type=vec<ret_t<F,A,B >,M>; enum {size=M, mm=0}; template<int... I> static constexpr type impl(seq<I...>, F f, A a, const vec<B,M> & b ) { return {f(a, getter<I>{}(b) )...}; } };
141 template<class F, int M, class A, class B, class C> struct apply<F, scalars_t< >, vec<A,M>, vec<B,M>, vec<C,M>> { using type=vec<ret_t<F,A,B,C>,M>; enum {size=M, mm=0}; template<int... I> static constexpr type impl(seq<I...>, F f, const vec<A,M> & a, const vec<B,M> & b, const vec<C,M> & c) { return {f(getter<I>{}(a), getter<I>{}(b), getter<I>{}(c))...}; } };
142 template<class F, int M, class A, class B, class C> struct apply<F, scalars_t<C >, vec<A,M>, vec<B,M>, C > { using type=vec<ret_t<F,A,B,C>,M>; enum {size=M, mm=0}; template<int... I> static constexpr type impl(seq<I...>, F f, const vec<A,M> & a, const vec<B,M> & b, C c) { return {f(getter<I>{}(a), getter<I>{}(b), c )...}; } };
143 template<class F, int M, class A, class B, class C> struct apply<F, scalars_t<B >, vec<A,M>, B, vec<C,M>> { using type=vec<ret_t<F,A,B,C>,M>; enum {size=M, mm=0}; template<int... I> static constexpr type impl(seq<I...>, F f, const vec<A,M> & a, B b, const vec<C,M> & c) { return {f(getter<I>{}(a), b, getter<I>{}(c))...}; } };
144 template<class F, int M, class A, class B, class C> struct apply<F, scalars_t<B,C>, vec<A,M>, B, C > { using type=vec<ret_t<F,A,B,C>,M>; enum {size=M, mm=0}; template<int... I> static constexpr type impl(seq<I...>, F f, const vec<A,M> & a, B b, C c) { return {f(getter<I>{}(a), b, c )...}; } };
145 template<class F, int M, class A, class B, class C> struct apply<F, scalars_t<A >, A, vec<B,M>, vec<C,M>> { using type=vec<ret_t<F,A,B,C>,M>; enum {size=M, mm=0}; template<int... I> static constexpr type impl(seq<I...>, F f, A a, const vec<B,M> & b, const vec<C,M> & c) { return {f(a, getter<I>{}(b), getter<I>{}(c))...}; } };
146 template<class F, int M, class A, class B, class C> struct apply<F, scalars_t<A,C>, A, vec<B,M>, C > { using type=vec<ret_t<F,A,B,C>,M>; enum {size=M, mm=0}; template<int... I> static constexpr type impl(seq<I...>, F f, A a, const vec<B,M> & b, C c) { return {f(a, getter<I>{}(b), c )...}; } };
147 template<class F, int M, class A, class B, class C> struct apply<F, scalars_t<A,B>, A, B, vec<C,M>> { using type=vec<ret_t<F,A,B,C>,M>; enum {size=M, mm=0}; template<int... I> static constexpr type impl(seq<I...>, F f, A a, B b, const vec<C,M> & c) { return {f(a, b, getter<I>{}(c))...}; } };
148 template<class F, int M, int N, class A > struct apply<F, scalars_t< >, mat<A,M,N> > { using type=mat<ret_t<F,A >,M,N>; enum {size=N, mm=0}; template<int... J> static constexpr type impl(seq<J...>, F f, const mat<A,M,N> & a ) { return {apply<F, void, vec<A,M> >::impl(make_seq<0,M>{}, f, getter<J>{}(a) )...}; } };
149 template<class F, int M, int N, class A, class B> struct apply<F, scalars_t< >, mat<A,M,N>, mat<B,M,N>> { using type=mat<ret_t<F,A,B>,M,N>; enum {size=N, mm=1}; template<int... J> static constexpr type impl(seq<J...>, F f, const mat<A,M,N> & a, const mat<B,M,N> & b) { return {apply<F, void, vec<A,M>, vec<B,M>>::impl(make_seq<0,M>{}, f, getter<J>{}(a), getter<J>{}(b))...}; } };
150 template<class F, int M, int N, class A, class B> struct apply<F, scalars_t<B>, mat<A,M,N>, B > { using type=mat<ret_t<F,A,B>,M,N>; enum {size=N, mm=0}; template<int... J> static constexpr type impl(seq<J...>, F f, const mat<A,M,N> & a, B b) { return {apply<F, void, vec<A,M>, B >::impl(make_seq<0,M>{}, f, getter<J>{}(a), b )...}; } };
151 template<class F, int M, int N, class A, class B> struct apply<F, scalars_t<A>, A, mat<B,M,N>> { using type=mat<ret_t<F,A,B>,M,N>; enum {size=N, mm=0}; template<int... J> static constexpr type impl(seq<J...>, F f, A a, const mat<B,M,N> & b) { return {apply<F, void, A, vec<B,M>>::impl(make_seq<0,M>{}, f, a, getter<J>{}(b))...}; } };
152 template<class F, class... A> struct apply<F, scalars_t<A...>, A...> { using type = ret_t<F,A...>; enum {size=0, mm=0}; static constexpr type impl(seq<>, F f, A... a) { return f(a...); } };
153
154 // Function objects for selecting between alternatives
155 struct min { template<class A, class B> constexpr auto operator() (A a, B b) const -> typename std::remove_reference<decltype(a<b ? a : b)>::type { return a<b ? a : b; } };
156 struct max { template<class A, class B> constexpr auto operator() (A a, B b) const -> typename std::remove_reference<decltype(a<b ? b : a)>::type { return a<b ? b : a; } };
157 struct clamp { template<class A, class B, class C> constexpr auto operator() (A a, B b, C c) const -> typename std::remove_reference<decltype(a<b ? b : a<c ? a : c)>::type { return a<b ? b : a<c ? a : c; } };
158 struct select { template<class A, class B, class C> constexpr auto operator() (A a, B b, C c) const -> typename std::remove_reference<decltype(a ? b : c)>::type { return a ? b : c; } };
159 struct lerp { template<class A, class B, class C> constexpr auto operator() (A a, B b, C c) const -> decltype(a*(1-c) + b*c) { return a*(1-c) + b*c; } };
160
161 // Function objects for applying operators
162 struct op_pos { template<class A> constexpr auto operator() (A a) const -> decltype(+a) { return +a; } };
163 struct op_neg { template<class A> constexpr auto operator() (A a) const -> decltype(-a) { return -a; } };
164 struct op_not { template<class A> constexpr auto operator() (A a) const -> decltype(!a) { return !a; } };
165 struct op_cmp { template<class A> constexpr auto operator() (A a) const -> decltype(~(a)) { return ~a; } };
166 struct op_mul { template<class A, class B> constexpr auto operator() (A a, B b) const -> decltype(a * b) { return a * b; } };
167 struct op_div { template<class A, class B> constexpr auto operator() (A a, B b) const -> decltype(a / b) { return a / b; } };
168 struct op_mod { template<class A, class B> constexpr auto operator() (A a, B b) const -> decltype(a % b) { return a % b; } };
169 struct op_add { template<class A, class B> constexpr auto operator() (A a, B b) const -> decltype(a + b) { return a + b; } };
170 struct op_sub { template<class A, class B> constexpr auto operator() (A a, B b) const -> decltype(a - b) { return a - b; } };
171 struct op_lsh { template<class A, class B> constexpr auto operator() (A a, B b) const -> decltype(a << b) { return a << b; } };
172 struct op_rsh { template<class A, class B> constexpr auto operator() (A a, B b) const -> decltype(a >> b) { return a >> b; } };
173 struct op_lt { template<class A, class B> constexpr auto operator() (A a, B b) const -> decltype(a < b) { return a < b; } };
174 struct op_gt { template<class A, class B> constexpr auto operator() (A a, B b) const -> decltype(a > b) { return a > b; } };
175 struct op_le { template<class A, class B> constexpr auto operator() (A a, B b) const -> decltype(a <= b) { return a <= b; } };
176 struct op_ge { template<class A, class B> constexpr auto operator() (A a, B b) const -> decltype(a >= b) { return a >= b; } };
177 struct op_eq { template<class A, class B> constexpr auto operator() (A a, B b) const -> decltype(a == b) { return a == b; } };
178 struct op_ne { template<class A, class B> constexpr auto operator() (A a, B b) const -> decltype(a != b) { return a != b; } };
179 struct op_int { template<class A, class B> constexpr auto operator() (A a, B b) const -> decltype(a & b) { return a & b; } };
180 struct op_xor { template<class A, class B> constexpr auto operator() (A a, B b) const -> decltype(a ^ b) { return a ^ b; } };
181 struct op_un { template<class A, class B> constexpr auto operator() (A a, B b) const -> decltype(a | b) { return a | b; } };
182 struct op_and { template<class A, class B> constexpr auto operator() (A a, B b) const -> decltype(a && b) { return a && b; } };
183 struct op_or { template<class A, class B> constexpr auto operator() (A a, B b) const -> decltype(a || b) { return a || b; } };
184
185 // Function objects for applying standard library math functions
186 struct std_abs { template<class A> auto operator() (A a) const -> decltype(std::abs (a)) { return std::abs (a); } };
187 struct std_floor { template<class A> auto operator() (A a) const -> decltype(std::floor(a)) { return std::floor(a); } };
188 struct std_ceil { template<class A> auto operator() (A a) const -> decltype(std::ceil (a)) { return std::ceil (a); } };
189 struct std_exp { template<class A> auto operator() (A a) const -> decltype(std::exp (a)) { return std::exp (a); } };
190 struct std_log { template<class A> auto operator() (A a) const -> decltype(std::log (a)) { return std::log (a); } };
191 struct std_log10 { template<class A> auto operator() (A a) const -> decltype(std::log10(a)) { return std::log10(a); } };
192 struct std_sqrt { template<class A> auto operator() (A a) const -> decltype(std::sqrt (a)) { return std::sqrt (a); } };
193 struct std_sin { template<class A> auto operator() (A a) const -> decltype(std::sin (a)) { return std::sin (a); } };
194 struct std_cos { template<class A> auto operator() (A a) const -> decltype(std::cos (a)) { return std::cos (a); } };
195 struct std_tan { template<class A> auto operator() (A a) const -> decltype(std::tan (a)) { return std::tan (a); } };
196 struct std_asin { template<class A> auto operator() (A a) const -> decltype(std::asin (a)) { return std::asin (a); } };
197 struct std_acos { template<class A> auto operator() (A a) const -> decltype(std::acos (a)) { return std::acos (a); } };
198 struct std_atan { template<class A> auto operator() (A a) const -> decltype(std::atan (a)) { return std::atan (a); } };
199 struct std_sinh { template<class A> auto operator() (A a) const -> decltype(std::sinh (a)) { return std::sinh (a); } };
200 struct std_cosh { template<class A> auto operator() (A a) const -> decltype(std::cosh (a)) { return std::cosh (a); } };
201 struct std_tanh { template<class A> auto operator() (A a) const -> decltype(std::tanh (a)) { return std::tanh (a); } };
202 struct std_round { template<class A> auto operator() (A a) const -> decltype(std::round(a)) { return std::round(a); } };
203 struct std_fmod { template<class A, class B> auto operator() (A a, B b) const -> decltype(std::fmod (a, b)) { return std::fmod (a, b); } };
204 struct std_pow { template<class A, class B> auto operator() (A a, B b) const -> decltype(std::pow (a, b)) { return std::pow (a, b); } };
205 struct std_atan2 { template<class A, class B> auto operator() (A a, B b) const -> decltype(std::atan2 (a, b)) { return std::atan2 (a, b); } };
206 struct std_copysign { template<class A, class B> auto operator() (A a, B b) const -> decltype(std::copysign(a, b)) { return std::copysign(a, b); } };
207 }
208
209 // Small, fixed-length vector type, consisting of exactly M elements of type T, and presumed to be a column-vector unless otherwise noted
210 template<class T> struct vec<T,1>
211 {
212 T x;
213 constexpr vec() : x() {}
214 constexpr vec(const T & x_) : x(x_) {}
215 // NOTE: vec<T,1> does NOT have a constructor from pointer, this can conflict with initializing its single element from zero
216 template<class U>
217 constexpr explicit vec(const vec<U,1> & v) : vec(static_cast<T>(v.x)) {}
218 constexpr const T & operator[] (int i) const { return x; }
219 LINALG_CONSTEXPR14 T & operator[] (int i) { return x; }
220
221 template<class U, class=detail::conv_t<vec,U>> constexpr vec(const U & u) : vec(converter<vec,U>{}(u)) {}
222 template<class U, class=detail::conv_t<U,vec>> constexpr operator U () const { return converter<U,vec>{}(*this); }
223 };
224 template<class T> struct vec<T,2>
225 {
226 T x,y;
227 constexpr vec() : x(), y() {}
228 constexpr vec(const T & x_, const T & y_) : x(x_), y(y_) {}
229 constexpr explicit vec(const T & s) : vec(s, s) {}
230 constexpr explicit vec(const T * p) : vec(p[0], p[1]) {}
231 template<class U>
232 constexpr explicit vec(const vec<U,2> & v) : vec(static_cast<T>(v.x), static_cast<T>(v.y)) {}
233 constexpr const T & operator[] (int i) const { return i==0?x:y; }
234 LINALG_CONSTEXPR14 T & operator[] (int i) { return i==0?x:y; }
235
236 template<class U, class=detail::conv_t<vec,U>> constexpr vec(const U & u) : vec(converter<vec,U>{}(u)) {}
237 template<class U, class=detail::conv_t<U,vec>> constexpr operator U () const { return converter<U,vec>{}(*this); }
238 };
239 template<class T> struct vec<T,3>
240 {
241 T x,y,z;
242 constexpr vec() : x(), y(), z() {}
243 constexpr vec(const T & x_, const T & y_,
244 const T & z_) : x(x_), y(y_), z(z_) {}
245 constexpr vec(const vec<T,2> & xy,
246 const T & z_) : vec(xy.x, xy.y, z_) {}
247 constexpr explicit vec(const T & s) : vec(s, s, s) {}
248 constexpr explicit vec(const T * p) : vec(p[0], p[1], p[2]) {}
249 template<class U>
250 constexpr explicit vec(const vec<U,3> & v) : vec(static_cast<T>(v.x), static_cast<T>(v.y), static_cast<T>(v.z)) {}
251 constexpr const T & operator[] (int i) const { return i==0?x:i==1?y:z; }
252 LINALG_CONSTEXPR14 T & operator[] (int i) { return i==0?x:i==1?y:z; }
253 constexpr const vec<T,2> & xy() const { return *reinterpret_cast<const vec<T,2> *>(this); }
254 vec<T,2> & xy() { return *reinterpret_cast<vec<T,2> *>(this); }
255
256 template<class U, class=detail::conv_t<vec,U>> constexpr vec(const U & u) : vec(converter<vec,U>{}(u)) {}
257 template<class U, class=detail::conv_t<U,vec>> constexpr operator U () const { return converter<U,vec>{}(*this); }
258 };
259 template<class T> struct vec<T,4>
260 {
261 T x,y,z,w;
262 constexpr vec() : x(), y(), z(), w() {}
263 constexpr vec(const T & x_, const T & y_,
264 const T & z_, const T & w_) : x(x_), y(y_), z(z_), w(w_) {}
265 constexpr vec(const vec<T,2> & xy,
266 const T & z_, const T & w_) : vec(xy.x, xy.y, z_, w_) {}
267 constexpr vec(const vec<T,3> & xyz,
268 const T & w_) : vec(xyz.x, xyz.y, xyz.z, w_) {}
269 constexpr explicit vec(const T & s) : vec(s, s, s, s) {}
270 constexpr explicit vec(const T * p) : vec(p[0], p[1], p[2], p[3]) {}
271 template<class U>
272 constexpr explicit vec(const vec<U,4> & v) : vec(static_cast<T>(v.x), static_cast<T>(v.y), static_cast<T>(v.z), static_cast<T>(v.w)) {}
273 constexpr const T & operator[] (int i) const { return i==0?x:i==1?y:i==2?z:w; }
274 LINALG_CONSTEXPR14 T & operator[] (int i) { return i==0?x:i==1?y:i==2?z:w; }
275 constexpr const vec<T,2> & xy() const { return *reinterpret_cast<const vec<T,2> *>(this); }
276 constexpr const vec<T,3> & xyz() const { return *reinterpret_cast<const vec<T,3> *>(this); }
277 vec<T,2> & xy() { return *reinterpret_cast<vec<T,2> *>(this); }
278 vec<T,3> & xyz() { return *reinterpret_cast<vec<T,3> *>(this); }
279
280 template<class U, class=detail::conv_t<vec,U>> constexpr vec(const U & u) : vec(converter<vec,U>{}(u)) {}
281 template<class U, class=detail::conv_t<U,vec>> constexpr operator U () const { return converter<U,vec>{}(*this); }
282 };
283
284 // Small, fixed-size matrix type, consisting of exactly M rows and N columns of type T, stored in column-major order.
285 template<class T, int M> struct mat<T,M,1>
286 {
287 typedef vec<T,M> V;
288 V x;
289 constexpr mat() : x() {}
290 constexpr mat(const V & x_) : x(x_) {}
291 constexpr explicit mat(const T & s) : x(s) {}
292 constexpr explicit mat(const T * p) : x(p+M*0) {}
293 template<class U>
294 constexpr explicit mat(const mat<U,M,1> & m) : mat(V(m.x)) {}
295 constexpr vec<T,1> row(int i) const { return {x[i]}; }
296 constexpr const V & operator[] (int j) const { return x; }
297 LINALG_CONSTEXPR14 V & operator[] (int j) { return x; }
298
299 template<class U, class=detail::conv_t<mat,U>> constexpr mat(const U & u) : mat(converter<mat,U>{}(u)) {}
300 template<class U, class=detail::conv_t<U,mat>> constexpr operator U () const { return converter<U,mat>{}(*this); }
301 };
302 template<class T, int M> struct mat<T,M,2>
303 {
304 typedef vec<T,M> V;
305 V x,y;
306 constexpr mat() : x(), y() {}
307 constexpr mat(const V & x_, const V & y_) : x(x_), y(y_) {}
308 constexpr explicit mat(const T & s) : x(s), y(s) {}
309 constexpr explicit mat(const T * p) : x(p+M*0), y(p+M*1) {}
310 template<class U>
311 constexpr explicit mat(const mat<U,M,2> & m) : mat(V(m.x), V(m.y)) {}
312 constexpr vec<T,2> row(int i) const { return {x[i], y[i]}; }
313 constexpr const V & operator[] (int j) const { return j==0?x:y; }
314 LINALG_CONSTEXPR14 V & operator[] (int j) { return j==0?x:y; }
315
316 template<class U, class=detail::conv_t<mat,U>> constexpr mat(const U & u) : mat(converter<mat,U>{}(u)) {}
317 template<class U, class=detail::conv_t<U,mat>> constexpr operator U () const { return converter<U,mat>{}(*this); }
318 };
319 template<class T, int M> struct mat<T,M,3>
320 {
321 typedef vec<T,M> V;
322 V x,y,z;
323 constexpr mat() : x(), y(), z() {}
324 constexpr mat(const V & x_, const V & y_,
325 const V & z_) : x(x_), y(y_), z(z_) {}
326 constexpr explicit mat(const T & s) : x(s), y(s), z(s) {}
327 constexpr explicit mat(const T * p) : x(p+M*0), y(p+M*1), z(p+M*2) {}
328 template<class U>
329 constexpr explicit mat(const mat<U,M,3> & m) : mat(V(m.x), V(m.y), V(m.z)) {}
330 constexpr vec<T,3> row(int i) const { return {x[i], y[i], z[i]}; }
331 constexpr const V & operator[] (int j) const { return j==0?x:j==1?y:z; }
332 LINALG_CONSTEXPR14 V & operator[] (int j) { return j==0?x:j==1?y:z; }
333
334 template<class U, class=detail::conv_t<mat,U>> constexpr mat(const U & u) : mat(converter<mat,U>{}(u)) {}
335 template<class U, class=detail::conv_t<U,mat>> constexpr operator U () const { return converter<U,mat>{}(*this); }
336 };
337 template<class T, int M> struct mat<T,M,4>
338 {
339 typedef vec<T,M> V;
340 V x,y,z,w;
341 constexpr mat() : x(), y(), z(), w() {}
342 constexpr mat(const V & x_, const V & y_,
343 const V & z_, const V & w_) : x(x_), y(y_), z(z_), w(w_) {}
344 constexpr explicit mat(const T & s) : x(s), y(s), z(s), w(s) {}
345 constexpr explicit mat(const T * p) : x(p+M*0), y(p+M*1), z(p+M*2), w(p+M*3) {}
346 template<class U>
347 constexpr explicit mat(const mat<U,M,4> & m) : mat(V(m.x), V(m.y), V(m.z), V(m.w)) {}
348 constexpr vec<T,4> row(int i) const { return {x[i], y[i], z[i], w[i]}; }
349 constexpr const V & operator[] (int j) const { return j==0?x:j==1?y:j==2?z:w; }
350 LINALG_CONSTEXPR14 V & operator[] (int j) { return j==0?x:j==1?y:j==2?z:w; }
351
352 template<class U, class=detail::conv_t<mat,U>> constexpr mat(const U & u) : mat(converter<mat,U>{}(u)) {}
353 template<class U, class=detail::conv_t<U,mat>> constexpr operator U () const { return converter<U,mat>{}(*this); }
354 };
355
356 // Define a type which will convert to the multiplicative identity of any square matrix
357 struct identity_t { constexpr explicit identity_t(int) {} };
358 template<class T> struct converter<mat<T,1,1>, identity_t> { constexpr mat<T,1,1> operator() (identity_t) const { return {vec<T,1>{1}}; } };
359 template<class T> struct converter<mat<T,2,2>, identity_t> { constexpr mat<T,2,2> operator() (identity_t) const { return {{1,0},{0,1}}; } };
360 template<class T> struct converter<mat<T,3,3>, identity_t> { constexpr mat<T,3,3> operator() (identity_t) const { return {{1,0,0},{0,1,0},{0,0,1}}; } };
361 template<class T> struct converter<mat<T,4,4>, identity_t> { constexpr mat<T,4,4> operator() (identity_t) const { return {{1,0,0,0},{0,1,0,0},{0,0,1,0},{0,0,0,1}}; } };
362 constexpr identity_t identity {1};
363
364 // Produce a scalar by applying f(A,B) -> A to adjacent pairs of elements from a vec/mat in left-to-right/column-major order (matching the associativity of arithmetic and logical operators)
365 template<class F, class A, class B> constexpr A fold(F f, A a, const vec<B,1> & b) { return f(a, b.x); }
366 template<class F, class A, class B> constexpr A fold(F f, A a, const vec<B,2> & b) { return f(f(a, b.x), b.y); }
367 template<class F, class A, class B> constexpr A fold(F f, A a, const vec<B,3> & b) { return f(f(f(a, b.x), b.y), b.z); }
368 template<class F, class A, class B> constexpr A fold(F f, A a, const vec<B,4> & b) { return f(f(f(f(a, b.x), b.y), b.z), b.w); }
369 template<class F, class A, class B, int M> constexpr A fold(F f, A a, const mat<B,M,1> & b) { return fold(f, a, b.x); }
370 template<class F, class A, class B, int M> constexpr A fold(F f, A a, const mat<B,M,2> & b) { return fold(f, fold(f, a, b.x), b.y); }
371 template<class F, class A, class B, int M> constexpr A fold(F f, A a, const mat<B,M,3> & b) { return fold(f, fold(f, fold(f, a, b.x), b.y), b.z); }
372 template<class F, class A, class B, int M> constexpr A fold(F f, A a, const mat<B,M,4> & b) { return fold(f, fold(f, fold(f, fold(f, a, b.x), b.y), b.z), b.w); }
373
374 // Type aliases for the result of calling apply(...) with various arguments, can be used with return type SFINAE to constrian overload sets
375 template<class F, class... A> using apply_t = typename detail::apply<F,void,A...>::type;
376 template<class F, class... A> using mm_apply_t = typename std::enable_if<detail::apply<F,void,A...>::mm, apply_t<F,A...>>::type;
377 template<class F, class... A> using no_mm_apply_t = typename std::enable_if<!detail::apply<F,void,A...>::mm, apply_t<F,A...>>::type;
378 template<class A> using scalar_t = typename detail::scalar_type<A>::type; // Underlying scalar type when performing elementwise operations
379
380 // apply(f,...) applies the provided function in an elementwise fashion to its arguments, producing an object of the same dimensions
381 template<class F, class... A> constexpr apply_t<F,A...> apply(F func, const A & ... args) { return detail::apply<F,void,A...>::impl(detail::make_seq<0,detail::apply<F,void,A...>::size>{}, func, args...); }
382
383 // map(a,f) is equivalent to apply(f,a)
384 template<class A, class F> constexpr apply_t<F,A> map(const A & a, F func) { return apply(func, a); }
385
386 // zip(a,b,f) is equivalent to apply(f,a,b)
387 template<class A, class B, class F> constexpr apply_t<F,A,B> zip(const A & a, const B & b, F func) { return apply(func, a, b); }
388
389 // Relational operators are defined to compare the elements of two vectors or matrices lexicographically, in column-major order
390 template<class A, class B> constexpr typename detail::any_compare<A,B>::type compare(const A & a, const B & b) { return detail::any_compare<A,B>()(a,b); }
391 template<class A, class B> constexpr auto operator == (const A & a, const B & b) -> decltype(compare(a,b) == 0) { return compare(a,b) == 0; }
392 template<class A, class B> constexpr auto operator != (const A & a, const B & b) -> decltype(compare(a,b) != 0) { return compare(a,b) != 0; }
393 template<class A, class B> constexpr auto operator < (const A & a, const B & b) -> decltype(compare(a,b) < 0) { return compare(a,b) < 0; }
394 template<class A, class B> constexpr auto operator > (const A & a, const B & b) -> decltype(compare(a,b) > 0) { return compare(a,b) > 0; }
395 template<class A, class B> constexpr auto operator <= (const A & a, const B & b) -> decltype(compare(a,b) <= 0) { return compare(a,b) <= 0; }
396 template<class A, class B> constexpr auto operator >= (const A & a, const B & b) -> decltype(compare(a,b) >= 0) { return compare(a,b) >= 0; }
397
398 // Functions for coalescing scalar values
399 template<class A> constexpr bool any (const A & a) { return fold(detail::op_or{}, false, a); }
400 template<class A> constexpr bool all (const A & a) { return fold(detail::op_and{}, true, a); }
401 template<class A> constexpr scalar_t<A> sum (const A & a) { return fold(detail::op_add{}, scalar_t<A>(0), a); }
402 template<class A> constexpr scalar_t<A> product(const A & a) { return fold(detail::op_mul{}, scalar_t<A>(1), a); }
403 template<class A> constexpr scalar_t<A> minelem(const A & a) { return fold(detail::min{}, a.x, a); }
404 template<class A> constexpr scalar_t<A> maxelem(const A & a) { return fold(detail::max{}, a.x, a); }
405 template<class T, int M> int argmin(const vec<T,M> & a) { int j=0; for(int i=1; i<M; ++i) if(a[i] < a[j]) j = i; return j; }
406 template<class T, int M> int argmax(const vec<T,M> & a) { int j=0; for(int i=1; i<M; ++i) if(a[i] > a[j]) j = i; return j; }
407
408 // Unary operators are defined component-wise for linalg types
409 template<class A> constexpr apply_t<detail::op_pos, A> operator + (const A & a) { return apply(detail::op_pos{}, a); }
410 template<class A> constexpr apply_t<detail::op_neg, A> operator - (const A & a) { return apply(detail::op_neg{}, a); }
411 template<class A> constexpr apply_t<detail::op_cmp, A> operator ~ (const A & a) { return apply(detail::op_cmp{}, a); }
412 template<class A> constexpr apply_t<detail::op_not, A> operator ! (const A & a) { return apply(detail::op_not{}, a); }
413
414 // Binary operators are defined component-wise for linalg types, EXCEPT for `operator *`
415 template<class A, class B> constexpr apply_t<detail::op_add, A, B> operator + (const A & a, const B & b) { return apply(detail::op_add{}, a, b); }
416 template<class A, class B> constexpr apply_t<detail::op_sub, A, B> operator - (const A & a, const B & b) { return apply(detail::op_sub{}, a, b); }
417 template<class A, class B> constexpr apply_t<detail::op_mul, A, B> cmul (const A & a, const B & b) { return apply(detail::op_mul{}, a, b); }
418 template<class A, class B> constexpr apply_t<detail::op_div, A, B> operator / (const A & a, const B & b) { return apply(detail::op_div{}, a, b); }
419 template<class A, class B> constexpr apply_t<detail::op_mod, A, B> operator % (const A & a, const B & b) { return apply(detail::op_mod{}, a, b); }
420 template<class A, class B> constexpr apply_t<detail::op_un, A, B> operator | (const A & a, const B & b) { return apply(detail::op_un{}, a, b); }
421 template<class A, class B> constexpr apply_t<detail::op_xor, A, B> operator ^ (const A & a, const B & b) { return apply(detail::op_xor{}, a, b); }
422 template<class A, class B> constexpr apply_t<detail::op_int, A, B> operator & (const A & a, const B & b) { return apply(detail::op_int{}, a, b); }
423 template<class A, class B> constexpr apply_t<detail::op_lsh, A, B> operator << (const A & a, const B & b) { return apply(detail::op_lsh{}, a, b); }
424 template<class A, class B> constexpr apply_t<detail::op_rsh, A, B> operator >> (const A & a, const B & b) { return apply(detail::op_rsh{}, a, b); }
425
426 // Binary `operator *` was originally defined component-wise for all patterns, in a fashion consistent with the other operators. However,
427 // this was one of the most frequent sources of confusion among new users of this library, with the binary `operator *` being used accidentally
428 // by users who INTENDED the semantics of the algebraic matrix product, but RECEIVED the semantics of the Hadamard product. While there is
429 // precedent within the HLSL, Fortran, R, APL, J, and Mathematica programming languages for `operator *` having the semantics of the Hadamard
430 // product between matrices, it is counterintuitive to users of GLSL, Eigen, and many other languages and libraries that chose matrix product
431 // semantics for `operator *`.
432 //
433 // For these reasons, binary `operator *` is now DEPRECATED between pairs of matrices. Users may call `cmul(...)` for component-wise multiplication,
434 // or `mul(...)` for matrix multiplication. Binary `operator *` continues to be available for vector * vector, vector * scalar, matrix * scalar, etc.
435 template<class A, class B> constexpr no_mm_apply_t<detail::op_mul, A, B> operator * (const A & a, const B & b) { return cmul(a,b); }
436 #ifndef LINALG_FORWARD_COMPATIBLE
437 template<class A, class B> [[deprecated("`operator *` between pairs of matrices is deprecated. See the source text for details.")]] constexpr mm_apply_t<detail::op_mul, A, B> operator * (const A & a, const B & b) { return cmul(a,b); }
438 #endif
439
440 // Binary assignment operators a $= b is always defined as though it were explicitly written a = a $ b
441 template<class A, class B> constexpr auto operator += (A & a, const B & b) -> decltype(a = a + b) { return a = a + b; }
442 template<class A, class B> constexpr auto operator -= (A & a, const B & b) -> decltype(a = a - b) { return a = a - b; }
443 template<class A, class B> constexpr auto operator *= (A & a, const B & b) -> decltype(a = a * b) { return a = a * b; }
444 template<class A, class B> constexpr auto operator /= (A & a, const B & b) -> decltype(a = a / b) { return a = a / b; }
445 template<class A, class B> constexpr auto operator %= (A & a, const B & b) -> decltype(a = a % b) { return a = a % b; }
446 template<class A, class B> constexpr auto operator |= (A & a, const B & b) -> decltype(a = a | b) { return a = a | b; }
447 template<class A, class B> constexpr auto operator ^= (A & a, const B & b) -> decltype(a = a ^ b) { return a = a ^ b; }
448 template<class A, class B> constexpr auto operator &= (A & a, const B & b) -> decltype(a = a & b) { return a = a & b; }
449 template<class A, class B> constexpr auto operator <<= (A & a, const B & b) -> decltype(a = a << b) { return a = a << b; }
450 template<class A, class B> constexpr auto operator >>= (A & a, const B & b) -> decltype(a = a >> b) { return a = a >> b; }
451
452 // Swizzles and subobjects
453 template<int... I, class T, int M> constexpr vec<T,sizeof...(I)> swizzle(const vec<T,M> & a) { return {detail::getter<I>{}(a)...}; }
454 template<int I0, int I1, class T, int M> constexpr vec<T,I1-I0> subvec (const vec<T,M> & a) { return detail::swizzle(a, detail::make_seq<I0,I1>{}); }
455 template<int I0, int J0, int I1, int J1, class T, int M, int N> constexpr mat<T,I1-I0,J1-J0> submat (const mat<T,M,N> & a) { return detail::swizzle(a, detail::make_seq<I0,I1>{}, detail::make_seq<J0,J1>{}); }
456
457 // Component-wise standard library math functions
458 template<class A> apply_t<detail::std_abs, A> abs (const A & a) { return apply(detail::std_abs{}, a); }
459 template<class A> apply_t<detail::std_floor, A> floor(const A & a) { return apply(detail::std_floor{}, a); }
460 template<class A> apply_t<detail::std_ceil, A> ceil (const A & a) { return apply(detail::std_ceil{}, a); }
461 template<class A> apply_t<detail::std_exp, A> exp (const A & a) { return apply(detail::std_exp{}, a); }
462 template<class A> apply_t<detail::std_log, A> log (const A & a) { return apply(detail::std_log{}, a); }
463 template<class A> apply_t<detail::std_log10, A> log10(const A & a) { return apply(detail::std_log10{}, a); }
464 template<class A> apply_t<detail::std_sqrt, A> sqrt (const A & a) { return apply(detail::std_sqrt{}, a); }
465 template<class A> apply_t<detail::std_sin, A> sin (const A & a) { return apply(detail::std_sin{}, a); }
466 template<class A> apply_t<detail::std_cos, A> cos (const A & a) { return apply(detail::std_cos{}, a); }
467 template<class A> apply_t<detail::std_tan, A> tan (const A & a) { return apply(detail::std_tan{}, a); }
468 template<class A> apply_t<detail::std_asin, A> asin (const A & a) { return apply(detail::std_asin{}, a); }
469 template<class A> apply_t<detail::std_acos, A> acos (const A & a) { return apply(detail::std_acos{}, a); }
470 template<class A> apply_t<detail::std_atan, A> atan (const A & a) { return apply(detail::std_atan{}, a); }
471 template<class A> apply_t<detail::std_sinh, A> sinh (const A & a) { return apply(detail::std_sinh{}, a); }
472 template<class A> apply_t<detail::std_cosh, A> cosh (const A & a) { return apply(detail::std_cosh{}, a); }
473 template<class A> apply_t<detail::std_tanh, A> tanh (const A & a) { return apply(detail::std_tanh{}, a); }
474 template<class A> apply_t<detail::std_round, A> round(const A & a) { return apply(detail::std_round{}, a); }
475
476 template<class A, class B> apply_t<detail::std_fmod, A, B> fmod (const A & a, const B & b) { return apply(detail::std_fmod{}, a, b); }
477 template<class A, class B> apply_t<detail::std_pow, A, B> pow (const A & a, const B & b) { return apply(detail::std_pow{}, a, b); }
478 template<class A, class B> apply_t<detail::std_atan2, A, B> atan2 (const A & a, const B & b) { return apply(detail::std_atan2{}, a, b); }
479 template<class A, class B> apply_t<detail::std_copysign, A, B> copysign(const A & a, const B & b) { return apply(detail::std_copysign{}, a, b); }
480
481 // Component-wise relational functions on vectors
482 template<class A, class B> constexpr apply_t<detail::op_eq, A, B> equal (const A & a, const B & b) { return apply(detail::op_eq{}, a, b); }
483 template<class A, class B> constexpr apply_t<detail::op_ne, A, B> nequal (const A & a, const B & b) { return apply(detail::op_ne{}, a, b); }
484 template<class A, class B> constexpr apply_t<detail::op_lt, A, B> less (const A & a, const B & b) { return apply(detail::op_lt{}, a, b); }
485 template<class A, class B> constexpr apply_t<detail::op_gt, A, B> greater(const A & a, const B & b) { return apply(detail::op_gt{}, a, b); }
486 template<class A, class B> constexpr apply_t<detail::op_le, A, B> lequal (const A & a, const B & b) { return apply(detail::op_le{}, a, b); }
487 template<class A, class B> constexpr apply_t<detail::op_ge, A, B> gequal (const A & a, const B & b) { return apply(detail::op_ge{}, a, b); }
488
489 // Component-wise selection functions on vectors
490 template<class A, class B> constexpr apply_t<detail::min, A, B> min(const A & a, const B & b) { return apply(detail::min{}, a, b); }
491 template<class A, class B> constexpr apply_t<detail::max, A, B> max(const A & a, const B & b) { return apply(detail::max{}, a, b); }
492 template<class X, class L, class H> constexpr apply_t<detail::clamp, X, L, H> clamp (const X & x, const L & l, const H & h) { return apply(detail::clamp{}, x, l, h); }
493 template<class P, class A, class B> constexpr apply_t<detail::select, P, A, B> select(const P & p, const A & a, const B & b) { return apply(detail::select{}, p, a, b); }
494 template<class A, class B, class T> constexpr apply_t<detail::lerp, A, B, T> lerp (const A & a, const B & b, const T & t) { return apply(detail::lerp{}, a, b, t); }
495
496 // Support for vector algebra
497 template<class T> constexpr T cross (const vec<T,2> & a, const vec<T,2> & b) { return a.x*b.y-a.y*b.x; }
498 template<class T> constexpr vec<T,2> cross (T a, const vec<T,2> & b) { return {-a*b.y, a*b.x}; }
499 template<class T> constexpr vec<T,2> cross (const vec<T,2> & a, T b) { return {a.y*b, -a.x*b}; }
500 template<class T> constexpr vec<T,3> cross (const vec<T,3> & a, const vec<T,3> & b) { return {a.y*b.z-a.z*b.y, a.z*b.x-a.x*b.z, a.x*b.y-a.y*b.x}; }
501 template<class T, int M> constexpr T dot (const vec<T,M> & a, const vec<T,M> & b) { return sum(a*b); }
502 template<class T, int M> constexpr T length2 (const vec<T,M> & a) { return dot(a,a); }
503 template<class T, int M> T length (const vec<T,M> & a) { return std::sqrt(length2(a)); }
504 template<class T, int M> vec<T,M> normalize(const vec<T,M> & a) { return a / length(a); }
505 template<class T, int M> constexpr T distance2(const vec<T,M> & a, const vec<T,M> & b) { return length2(b-a); }
506 template<class T, int M> T distance (const vec<T,M> & a, const vec<T,M> & b) { return length(b-a); }
507 template<class T, int M> T uangle (const vec<T,M> & a, const vec<T,M> & b) { T d=dot(a,b); return d > 1 ? 0 : std::acos(d < -1 ? -1 : d); }
508 template<class T, int M> T angle (const vec<T,M> & a, const vec<T,M> & b) { return uangle(normalize(a), normalize(b)); }
509 template<class T> vec<T,2> rot (T a, const vec<T,2> & v) { const T s = std::sin(a), c = std::cos(a); return {v.x*c - v.y*s, v.x*s + v.y*c}; }
510 template<class T, int M> vec<T,M> nlerp (const vec<T,M> & a, const vec<T,M> & b, T t) { return normalize(lerp(a,b,t)); }
511 template<class T, int M> vec<T,M> slerp (const vec<T,M> & a, const vec<T,M> & b, T t) { T th=uangle(a,b); return th == 0 ? a : a*(std::sin(th*(1-t))/std::sin(th)) + b*(std::sin(th*t)/std::sin(th)); }
512
513 // Support for quaternion algebra using 4D vectors, representing xi + yj + zk + w
514 template<class T> constexpr vec<T,4> qconj(const vec<T,4> & q) { return {-q.x,-q.y,-q.z,q.w}; }
515 template<class T> vec<T,4> qinv (const vec<T,4> & q) { return qconj(q)/length2(q); }
516 template<class T> vec<T,4> qexp (const vec<T,4> & q) { const auto v = q.xyz(); const auto vv = length(v); return std::exp(q.w) * vec<T,4>{v * (vv > 0 ? std::sin(vv)/vv : 0), std::cos(vv)}; }
517 template<class T> vec<T,4> qlog (const vec<T,4> & q) { const auto v = q.xyz(); const auto vv = length(v), qq = length(q); return {v * (vv > 0 ? std::acos(q.w/qq)/vv : 0), std::log(qq)}; }
518 template<class T> vec<T,4> qpow (const vec<T,4> & q, const T & p) { const auto v = q.xyz(); const auto vv = length(v), qq = length(q), th = std::acos(q.w/qq); return std::pow(qq,p)*vec<T,4>{v * (vv > 0 ? std::sin(p*th)/vv : 0), std::cos(p*th)}; }
519 template<class T> constexpr vec<T,4> qmul (const vec<T,4> & a, const vec<T,4> & b) { return {a.x*b.w+a.w*b.x+a.y*b.z-a.z*b.y, a.y*b.w+a.w*b.y+a.z*b.x-a.x*b.z, a.z*b.w+a.w*b.z+a.x*b.y-a.y*b.x, a.w*b.w-a.x*b.x-a.y*b.y-a.z*b.z}; }
520 template<class T, class... R> constexpr vec<T,4> qmul(const vec<T,4> & a, R... r) { return qmul(a, qmul(r...)); }
521
522 // Support for 3D spatial rotations using quaternions, via qmul(qmul(q, v), qconj(q))
523 template<class T> constexpr vec<T,3> qxdir (const vec<T,4> & q) { return {q.w*q.w+q.x*q.x-q.y*q.y-q.z*q.z, (q.x*q.y+q.z*q.w)*2, (q.z*q.x-q.y*q.w)*2}; }
524 template<class T> constexpr vec<T,3> qydir (const vec<T,4> & q) { return {(q.x*q.y-q.z*q.w)*2, q.w*q.w-q.x*q.x+q.y*q.y-q.z*q.z, (q.y*q.z+q.x*q.w)*2}; }
525 template<class T> constexpr vec<T,3> qzdir (const vec<T,4> & q) { return {(q.z*q.x+q.y*q.w)*2, (q.y*q.z-q.x*q.w)*2, q.w*q.w-q.x*q.x-q.y*q.y+q.z*q.z}; }
526 template<class T> constexpr mat<T,3,3> qmat (const vec<T,4> & q) { return {qxdir(q), qydir(q), qzdir(q)}; }
527 template<class T> constexpr vec<T,3> qrot (const vec<T,4> & q, const vec<T,3> & v) { return qxdir(q)*v.x + qydir(q)*v.y + qzdir(q)*v.z; }
528 template<class T> T qangle(const vec<T,4> & q) { return std::atan2(length(q.xyz()), q.w)*2; }
529 template<class T> vec<T,3> qaxis (const vec<T,4> & q) { return normalize(q.xyz()); }
530 template<class T> vec<T,4> qnlerp(const vec<T,4> & a, const vec<T,4> & b, T t) { return nlerp(a, dot(a,b) < 0 ? -b : b, t); }
531 template<class T> vec<T,4> qslerp(const vec<T,4> & a, const vec<T,4> & b, T t) { return slerp(a, dot(a,b) < 0 ? -b : b, t); }
532
533 // Support for matrix algebra
534 template<class T, int M> constexpr vec<T,M> mul(const mat<T,M,1> & a, const vec<T,1> & b) { return a.x*b.x; }
535 template<class T, int M> constexpr vec<T,M> mul(const mat<T,M,2> & a, const vec<T,2> & b) { return a.x*b.x + a.y*b.y; }
536 template<class T, int M> constexpr vec<T,M> mul(const mat<T,M,3> & a, const vec<T,3> & b) { return a.x*b.x + a.y*b.y + a.z*b.z; }
537 template<class T, int M> constexpr vec<T,M> mul(const mat<T,M,4> & a, const vec<T,4> & b) { return a.x*b.x + a.y*b.y + a.z*b.z + a.w*b.w; }
538 template<class T, int M, int N> constexpr mat<T,M,1> mul(const mat<T,M,N> & a, const mat<T,N,1> & b) { return {mul(a,b.x)}; }
539 template<class T, int M, int N> constexpr mat<T,M,2> mul(const mat<T,M,N> & a, const mat<T,N,2> & b) { return {mul(a,b.x), mul(a,b.y)}; }
540 template<class T, int M, int N> constexpr mat<T,M,3> mul(const mat<T,M,N> & a, const mat<T,N,3> & b) { return {mul(a,b.x), mul(a,b.y), mul(a,b.z)}; }
541 template<class T, int M, int N> constexpr mat<T,M,4> mul(const mat<T,M,N> & a, const mat<T,N,4> & b) { return {mul(a,b.x), mul(a,b.y), mul(a,b.z), mul(a,b.w)}; }
542 template<class T, int M, int N, int P> constexpr vec<T,M> mul(const mat<T,M,N> & a, const mat<T,N,P> & b, const vec<T,P> & c) { return mul(mul(a,b),c); }
543 template<class T, int M, int N, int P, int Q> constexpr mat<T,M,Q> mul(const mat<T,M,N> & a, const mat<T,N,P> & b, const mat<T,P,Q> & c) { return mul(mul(a,b),c); }
544 template<class T, int M, int N, int P, int Q> constexpr vec<T,M> mul(const mat<T,M,N> & a, const mat<T,N,P> & b, const mat<T,P,Q> & c, const vec<T,Q> & d) { return mul(mul(a,b,c),d); }
545 template<class T, int M, int N, int P, int Q, int R> constexpr mat<T,M,R> mul(const mat<T,M,N> & a, const mat<T,N,P> & b, const mat<T,P,Q> & c, const mat<T,Q,R> & d) { return mul(mul(a,b,c),d); }
546 template<class T, int M> constexpr mat<T,M,1> outerprod(const vec<T,M> & a, const vec<T,1> & b) { return {a*b.x}; }
547 template<class T, int M> constexpr mat<T,M,2> outerprod(const vec<T,M> & a, const vec<T,2> & b) { return {a*b.x, a*b.y}; }
548 template<class T, int M> constexpr mat<T,M,3> outerprod(const vec<T,M> & a, const vec<T,3> & b) { return {a*b.x, a*b.y, a*b.z}; }
549 template<class T, int M> constexpr mat<T,M,4> outerprod(const vec<T,M> & a, const vec<T,4> & b) { return {a*b.x, a*b.y, a*b.z, a*b.w}; }
550 template<class T> constexpr vec<T,1> diagonal(const mat<T,1,1> & a) { return {a.x.x}; }
551 template<class T> constexpr vec<T,2> diagonal(const mat<T,2,2> & a) { return {a.x.x, a.y.y}; }
552 template<class T> constexpr vec<T,3> diagonal(const mat<T,3,3> & a) { return {a.x.x, a.y.y, a.z.z}; }
553 template<class T> constexpr vec<T,4> diagonal(const mat<T,4,4> & a) { return {a.x.x, a.y.y, a.z.z, a.w.w}; }
554 template<class T, int N> constexpr T trace(const mat<T,N,N> & a) { return sum(diagonal(a)); }
555 template<class T, int M> constexpr mat<T,M,1> transpose(const mat<T,1,M> & m) { return {m.row(0)}; }
556 template<class T, int M> constexpr mat<T,M,2> transpose(const mat<T,2,M> & m) { return {m.row(0), m.row(1)}; }
557 template<class T, int M> constexpr mat<T,M,3> transpose(const mat<T,3,M> & m) { return {m.row(0), m.row(1), m.row(2)}; }
558 template<class T, int M> constexpr mat<T,M,4> transpose(const mat<T,4,M> & m) { return {m.row(0), m.row(1), m.row(2), m.row(3)}; }
559 template<class T, int M> constexpr mat<T,1,M> transpose(const vec<T,M> & m) { return transpose(mat<T,M,1>(m)); }
560 template<class T> constexpr mat<T,1,1> adjugate(const mat<T,1,1> & a) { return {vec<T,1>{1}}; }
561 template<class T> constexpr mat<T,2,2> adjugate(const mat<T,2,2> & a) { return {{a.y.y, -a.x.y}, {-a.y.x, a.x.x}}; }
562 template<class T> constexpr mat<T,3,3> adjugate(const mat<T,3,3> & a);
563 template<class T> constexpr mat<T,4,4> adjugate(const mat<T,4,4> & a);
564 template<class T, int N> constexpr mat<T,N,N> comatrix(const mat<T,N,N> & a) { return transpose(adjugate(a)); }
565 template<class T> constexpr T determinant(const mat<T,1,1> & a) { return a.x.x; }
566 template<class T> constexpr T determinant(const mat<T,2,2> & a) { return a.x.x*a.y.y - a.x.y*a.y.x; }
567 template<class T> constexpr T determinant(const mat<T,3,3> & a) { return a.x.x*(a.y.y*a.z.z - a.z.y*a.y.z) + a.x.y*(a.y.z*a.z.x - a.z.z*a.y.x) + a.x.z*(a.y.x*a.z.y - a.z.x*a.y.y); }
568 template<class T> constexpr T determinant(const mat<T,4,4> & a);
569 template<class T, int N> constexpr mat<T,N,N> inverse(const mat<T,N,N> & a) { return adjugate(a)/determinant(a); }
570
571 // Vectors and matrices can be used as ranges
572 template<class T, int M> T * begin( vec<T,M> & a) { return &a.x; }
573 template<class T, int M> const T * begin(const vec<T,M> & a) { return &a.x; }
574 template<class T, int M> T * end ( vec<T,M> & a) { return begin(a) + M; }
575 template<class T, int M> const T * end (const vec<T,M> & a) { return begin(a) + M; }
576 template<class T, int M, int N> vec<T,M> * begin( mat<T,M,N> & a) { return &a.x; }
577 template<class T, int M, int N> const vec<T,M> * begin(const mat<T,M,N> & a) { return &a.x; }
578 template<class T, int M, int N> vec<T,M> * end ( mat<T,M,N> & a) { return begin(a) + N; }
579 template<class T, int M, int N> const vec<T,M> * end (const mat<T,M,N> & a) { return begin(a) + N; }
580
581 // Factory functions for 3D spatial transformations (will possibly be removed or changed in a future version)
582 enum fwd_axis { neg_z, pos_z }; // Should projection matrices be generated assuming forward is {0,0,-1} or {0,0,1}
583 enum z_range { neg_one_to_one, zero_to_one }; // Should projection matrices map z into the range of [-1,1] or [0,1]?
584 template<class T> vec<T,4> rotation_quat (const vec<T,3> & axis, T angle) { return {axis*std::sin(angle/2), std::cos(angle/2)}; }
585 template<class T> vec<T,4> rotation_quat (const mat<T,3,3> & m);
586 template<class T> mat<T,4,4> translation_matrix(const vec<T,3> & translation) { return {{1,0,0,0},{0,1,0,0},{0,0,1,0},{translation,1}}; }
587 template<class T> mat<T,4,4> rotation_matrix (const vec<T,4> & rotation) { return {{qxdir(rotation),0}, {qydir(rotation),0}, {qzdir(rotation),0}, {0,0,0,1}}; }
588 template<class T> mat<T,4,4> scaling_matrix (const vec<T,3> & scaling) { return {{scaling.x,0,0,0}, {0,scaling.y,0,0}, {0,0,scaling.z,0}, {0,0,0,1}}; }
589 template<class T> mat<T,4,4> pose_matrix (const vec<T,4> & q, const vec<T,3> & p) { return {{qxdir(q),0}, {qydir(q),0}, {qzdir(q),0}, {p,1}}; }
590 template<class T> mat<T,4,4> lookat_matrix (const vec<T,3> & eye, const vec<T,3> & center, const vec<T,3> & view_y_dir, fwd_axis fwd = neg_z);
591 template<class T> mat<T,4,4> frustum_matrix (T x0, T x1, T y0, T y1, T n, T f, fwd_axis a = neg_z, z_range z = neg_one_to_one);
592 template<class T> mat<T,4,4> perspective_matrix(T fovy, T aspect, T n, T f, fwd_axis a = neg_z, z_range z = neg_one_to_one) { T y = n*std::tan(fovy / 2), x = y*aspect; return frustum_matrix(-x, x, -y, y, n, f, a, z); }
593
594 // Provide implicit conversion between linalg::vec<T,M> and std::array<T,M>
595 template<class T> struct converter<vec<T,1>, std::array<T,1>> { vec<T,1> operator() (const std::array<T,1> & a) const { return {a[0]}; } };
596 template<class T> struct converter<vec<T,2>, std::array<T,2>> { vec<T,2> operator() (const std::array<T,2> & a) const { return {a[0], a[1]}; } };
597 template<class T> struct converter<vec<T,3>, std::array<T,3>> { vec<T,3> operator() (const std::array<T,3> & a) const { return {a[0], a[1], a[2]}; } };
598 template<class T> struct converter<vec<T,4>, std::array<T,4>> { vec<T,4> operator() (const std::array<T,4> & a) const { return {a[0], a[1], a[2], a[3]}; } };
599
600 template<class T> struct converter<std::array<T,1>, vec<T,1>> { std::array<T,1> operator() (const vec<T,1> & a) const { return {a[0]}; } };
601 template<class T> struct converter<std::array<T,2>, vec<T,2>> { std::array<T,2> operator() (const vec<T,2> & a) const { return {a[0], a[1]}; } };
602 template<class T> struct converter<std::array<T,3>, vec<T,3>> { std::array<T,3> operator() (const vec<T,3> & a) const { return {a[0], a[1], a[2]}; } };
603 template<class T> struct converter<std::array<T,4>, vec<T,4>> { std::array<T,4> operator() (const vec<T,4> & a) const { return {a[0], a[1], a[2], a[3]}; } };
604
605 // Provide typedefs for common element types and vector/matrix sizes
606 namespace aliases
607 {
608 typedef vec<bool,1> bool1; typedef vec<uint8_t,1> byte1; typedef vec<int16_t,1> short1; typedef vec<uint16_t,1> ushort1;
609 typedef vec<bool,2> bool2; typedef vec<uint8_t,2> byte2; typedef vec<int16_t,2> short2; typedef vec<uint16_t,2> ushort2;
610 typedef vec<bool,3> bool3; typedef vec<uint8_t,3> byte3; typedef vec<int16_t,3> short3; typedef vec<uint16_t,3> ushort3;
611 typedef vec<bool,4> bool4; typedef vec<uint8_t,4> byte4; typedef vec<int16_t,4> short4; typedef vec<uint16_t,4> ushort4;
612 typedef vec<int,1> int1; typedef vec<unsigned,1> uint1; typedef vec<float,1> float1; typedef vec<double,1> double1;
613 typedef vec<int,2> int2; typedef vec<unsigned,2> uint2; typedef vec<float,2> float2; typedef vec<double,2> double2;
614 typedef vec<int,3> int3; typedef vec<unsigned,3> uint3; typedef vec<float,3> float3; typedef vec<double,3> double3;
615 typedef vec<int,4> int4; typedef vec<unsigned,4> uint4; typedef vec<float,4> float4; typedef vec<double,4> double4;
616 typedef mat<bool,1,1> bool1x1; typedef mat<int,1,1> int1x1; typedef mat<float,1,1> float1x1; typedef mat<double,1,1> double1x1;
617 typedef mat<bool,1,2> bool1x2; typedef mat<int,1,2> int1x2; typedef mat<float,1,2> float1x2; typedef mat<double,1,2> double1x2;
618 typedef mat<bool,1,3> bool1x3; typedef mat<int,1,3> int1x3; typedef mat<float,1,3> float1x3; typedef mat<double,1,3> double1x3;
619 typedef mat<bool,1,4> bool1x4; typedef mat<int,1,4> int1x4; typedef mat<float,1,4> float1x4; typedef mat<double,1,4> double1x4;
620 typedef mat<bool,2,1> bool2x1; typedef mat<int,2,1> int2x1; typedef mat<float,2,1> float2x1; typedef mat<double,2,1> double2x1;
621 typedef mat<bool,2,2> bool2x2; typedef mat<int,2,2> int2x2; typedef mat<float,2,2> float2x2; typedef mat<double,2,2> double2x2;
622 typedef mat<bool,2,3> bool2x3; typedef mat<int,2,3> int2x3; typedef mat<float,2,3> float2x3; typedef mat<double,2,3> double2x3;
623 typedef mat<bool,2,4> bool2x4; typedef mat<int,2,4> int2x4; typedef mat<float,2,4> float2x4; typedef mat<double,2,4> double2x4;
624 typedef mat<bool,3,1> bool3x1; typedef mat<int,3,1> int3x1; typedef mat<float,3,1> float3x1; typedef mat<double,3,1> double3x1;
625 typedef mat<bool,3,2> bool3x2; typedef mat<int,3,2> int3x2; typedef mat<float,3,2> float3x2; typedef mat<double,3,2> double3x2;
626 typedef mat<bool,3,3> bool3x3; typedef mat<int,3,3> int3x3; typedef mat<float,3,3> float3x3; typedef mat<double,3,3> double3x3;
627 typedef mat<bool,3,4> bool3x4; typedef mat<int,3,4> int3x4; typedef mat<float,3,4> float3x4; typedef mat<double,3,4> double3x4;
628 typedef mat<bool,4,1> bool4x1; typedef mat<int,4,1> int4x1; typedef mat<float,4,1> float4x1; typedef mat<double,4,1> double4x1;
629 typedef mat<bool,4,2> bool4x2; typedef mat<int,4,2> int4x2; typedef mat<float,4,2> float4x2; typedef mat<double,4,2> double4x2;
630 typedef mat<bool,4,3> bool4x3; typedef mat<int,4,3> int4x3; typedef mat<float,4,3> float4x3; typedef mat<double,4,3> double4x3;
631 typedef mat<bool,4,4> bool4x4; typedef mat<int,4,4> int4x4; typedef mat<float,4,4> float4x4; typedef mat<double,4,4> double4x4;
632 }
633
634 // Provide output streaming operators, writing something that resembles an aggregate literal that could be used to construct the specified value
635 namespace ostream_overloads
636 {
637 template<class C, class T> std::basic_ostream<C> & operator << (std::basic_ostream<C> & out, const vec<T,1> & v) { return out << '{' << v[0] << '}'; }
638 template<class C, class T> std::basic_ostream<C> & operator << (std::basic_ostream<C> & out, const vec<T,2> & v) { return out << '{' << v[0] << ',' << v[1] << '}'; }
639 template<class C, class T> std::basic_ostream<C> & operator << (std::basic_ostream<C> & out, const vec<T,3> & v) { return out << '{' << v[0] << ',' << v[1] << ',' << v[2] << '}'; }
640 template<class C, class T> std::basic_ostream<C> & operator << (std::basic_ostream<C> & out, const vec<T,4> & v) { return out << '{' << v[0] << ',' << v[1] << ',' << v[2] << ',' << v[3] << '}'; }
641
642 template<class C, class T, int M> std::basic_ostream<C> & operator << (std::basic_ostream<C> & out, const mat<T,M,1> & m) { return out << '{' << m[0] << '}'; }
643 template<class C, class T, int M> std::basic_ostream<C> & operator << (std::basic_ostream<C> & out, const mat<T,M,2> & m) { return out << '{' << m[0] << ',' << m[1] << '}'; }
644 template<class C, class T, int M> std::basic_ostream<C> & operator << (std::basic_ostream<C> & out, const mat<T,M,3> & m) { return out << '{' << m[0] << ',' << m[1] << ',' << m[2] << '}'; }
645 template<class C, class T, int M> std::basic_ostream<C> & operator << (std::basic_ostream<C> & out, const mat<T,M,4> & m) { return out << '{' << m[0] << ',' << m[1] << ',' << m[2] << ',' << m[3] << '}'; }
646 }
647 }
648
649 namespace std
650 {
651 // Provide specializations for std::hash<...> with linalg types
652 template<class T> struct hash<linalg::vec<T,1>> { std::size_t operator()(const linalg::vec<T,1> & v) const { std::hash<T> h; return h(v.x); } };
653 template<class T> struct hash<linalg::vec<T,2>> { std::size_t operator()(const linalg::vec<T,2> & v) const { std::hash<T> h; return h(v.x) ^ (h(v.y) << 1); } };
654 template<class T> struct hash<linalg::vec<T,3>> { std::size_t operator()(const linalg::vec<T,3> & v) const { std::hash<T> h; return h(v.x) ^ (h(v.y) << 1) ^ (h(v.z) << 2); } };
655 template<class T> struct hash<linalg::vec<T,4>> { std::size_t operator()(const linalg::vec<T,4> & v) const { std::hash<T> h; return h(v.x) ^ (h(v.y) << 1) ^ (h(v.z) << 2) ^ (h(v.w) << 3); } };
656
657 template<class T, int M> struct hash<linalg::mat<T,M,1>> { std::size_t operator()(const linalg::mat<T,M,1> & v) const { std::hash<linalg::vec<T,M>> h; return h(v.x); } };
658 template<class T, int M> struct hash<linalg::mat<T,M,2>> { std::size_t operator()(const linalg::mat<T,M,2> & v) const { std::hash<linalg::vec<T,M>> h; return h(v.x) ^ (h(v.y) << M); } };
659 template<class T, int M> struct hash<linalg::mat<T,M,3>> { std::size_t operator()(const linalg::mat<T,M,3> & v) const { std::hash<linalg::vec<T,M>> h; return h(v.x) ^ (h(v.y) << M) ^ (h(v.z) << (M*2)); } };
660 template<class T, int M> struct hash<linalg::mat<T,M,4>> { std::size_t operator()(const linalg::mat<T,M,4> & v) const { std::hash<linalg::vec<T,M>> h; return h(v.x) ^ (h(v.y) << M) ^ (h(v.z) << (M*2)) ^ (h(v.w) << (M*3)); } };
661 }
662
663 // Definitions of functions too long to be defined inline
664 template<class T> constexpr linalg::mat<T,3,3> linalg::adjugate(const mat<T,3,3> & a)
665 {
666 return {{a.y.y*a.z.z - a.z.y*a.y.z, a.z.y*a.x.z - a.x.y*a.z.z, a.x.y*a.y.z - a.y.y*a.x.z},
667 {a.y.z*a.z.x - a.z.z*a.y.x, a.z.z*a.x.x - a.x.z*a.z.x, a.x.z*a.y.x - a.y.z*a.x.x},
668 {a.y.x*a.z.y - a.z.x*a.y.y, a.z.x*a.x.y - a.x.x*a.z.y, a.x.x*a.y.y - a.y.x*a.x.y}};
669 }
670
671 template<class T> constexpr linalg::mat<T,4,4> linalg::adjugate(const mat<T,4,4> & a)
672 {
673 return {{a.y.y*a.z.z*a.w.w + a.w.y*a.y.z*a.z.w + a.z.y*a.w.z*a.y.w - a.y.y*a.w.z*a.z.w - a.z.y*a.y.z*a.w.w - a.w.y*a.z.z*a.y.w,
674 a.x.y*a.w.z*a.z.w + a.z.y*a.x.z*a.w.w + a.w.y*a.z.z*a.x.w - a.w.y*a.x.z*a.z.w - a.z.y*a.w.z*a.x.w - a.x.y*a.z.z*a.w.w,
675 a.x.y*a.y.z*a.w.w + a.w.y*a.x.z*a.y.w + a.y.y*a.w.z*a.x.w - a.x.y*a.w.z*a.y.w - a.y.y*a.x.z*a.w.w - a.w.y*a.y.z*a.x.w,
676 a.x.y*a.z.z*a.y.w + a.y.y*a.x.z*a.z.w + a.z.y*a.y.z*a.x.w - a.x.y*a.y.z*a.z.w - a.z.y*a.x.z*a.y.w - a.y.y*a.z.z*a.x.w},
677 {a.y.z*a.w.w*a.z.x + a.z.z*a.y.w*a.w.x + a.w.z*a.z.w*a.y.x - a.y.z*a.z.w*a.w.x - a.w.z*a.y.w*a.z.x - a.z.z*a.w.w*a.y.x,
678 a.x.z*a.z.w*a.w.x + a.w.z*a.x.w*a.z.x + a.z.z*a.w.w*a.x.x - a.x.z*a.w.w*a.z.x - a.z.z*a.x.w*a.w.x - a.w.z*a.z.w*a.x.x,
679 a.x.z*a.w.w*a.y.x + a.y.z*a.x.w*a.w.x + a.w.z*a.y.w*a.x.x - a.x.z*a.y.w*a.w.x - a.w.z*a.x.w*a.y.x - a.y.z*a.w.w*a.x.x,
680 a.x.z*a.y.w*a.z.x + a.z.z*a.x.w*a.y.x + a.y.z*a.z.w*a.x.x - a.x.z*a.z.w*a.y.x - a.y.z*a.x.w*a.z.x - a.z.z*a.y.w*a.x.x},
681 {a.y.w*a.z.x*a.w.y + a.w.w*a.y.x*a.z.y + a.z.w*a.w.x*a.y.y - a.y.w*a.w.x*a.z.y - a.z.w*a.y.x*a.w.y - a.w.w*a.z.x*a.y.y,
682 a.x.w*a.w.x*a.z.y + a.z.w*a.x.x*a.w.y + a.w.w*a.z.x*a.x.y - a.x.w*a.z.x*a.w.y - a.w.w*a.x.x*a.z.y - a.z.w*a.w.x*a.x.y,
683 a.x.w*a.y.x*a.w.y + a.w.w*a.x.x*a.y.y + a.y.w*a.w.x*a.x.y - a.x.w*a.w.x*a.y.y - a.y.w*a.x.x*a.w.y - a.w.w*a.y.x*a.x.y,
684 a.x.w*a.z.x*a.y.y + a.y.w*a.x.x*a.z.y + a.z.w*a.y.x*a.x.y - a.x.w*a.y.x*a.z.y - a.z.w*a.x.x*a.y.y - a.y.w*a.z.x*a.x.y},
685 {a.y.x*a.w.y*a.z.z + a.z.x*a.y.y*a.w.z + a.w.x*a.z.y*a.y.z - a.y.x*a.z.y*a.w.z - a.w.x*a.y.y*a.z.z - a.z.x*a.w.y*a.y.z,
686 a.x.x*a.z.y*a.w.z + a.w.x*a.x.y*a.z.z + a.z.x*a.w.y*a.x.z - a.x.x*a.w.y*a.z.z - a.z.x*a.x.y*a.w.z - a.w.x*a.z.y*a.x.z,
687 a.x.x*a.w.y*a.y.z + a.y.x*a.x.y*a.w.z + a.w.x*a.y.y*a.x.z - a.x.x*a.y.y*a.w.z - a.w.x*a.x.y*a.y.z - a.y.x*a.w.y*a.x.z,
688 a.x.x*a.y.y*a.z.z + a.z.x*a.x.y*a.y.z + a.y.x*a.z.y*a.x.z - a.x.x*a.z.y*a.y.z - a.y.x*a.x.y*a.z.z - a.z.x*a.y.y*a.x.z}};
689 }
690
691 template<class T> constexpr T linalg::determinant(const mat<T,4,4> & a)
692 {
693 return a.x.x*(a.y.y*a.z.z*a.w.w + a.w.y*a.y.z*a.z.w + a.z.y*a.w.z*a.y.w - a.y.y*a.w.z*a.z.w - a.z.y*a.y.z*a.w.w - a.w.y*a.z.z*a.y.w)
694 + a.x.y*(a.y.z*a.w.w*a.z.x + a.z.z*a.y.w*a.w.x + a.w.z*a.z.w*a.y.x - a.y.z*a.z.w*a.w.x - a.w.z*a.y.w*a.z.x - a.z.z*a.w.w*a.y.x)
695 + a.x.z*(a.y.w*a.z.x*a.w.y + a.w.w*a.y.x*a.z.y + a.z.w*a.w.x*a.y.y - a.y.w*a.w.x*a.z.y - a.z.w*a.y.x*a.w.y - a.w.w*a.z.x*a.y.y)
696 + a.x.w*(a.y.x*a.w.y*a.z.z + a.z.x*a.y.y*a.w.z + a.w.x*a.z.y*a.y.z - a.y.x*a.z.y*a.w.z - a.w.x*a.y.y*a.z.z - a.z.x*a.w.y*a.y.z);
697 }
698
699 template<class T> linalg::vec<T,4> linalg::rotation_quat(const mat<T,3,3> & m)
700 {
701 const vec<T,4> q {m.x.x-m.y.y-m.z.z, m.y.y-m.x.x-m.z.z, m.z.z-m.x.x-m.y.y, m.x.x+m.y.y+m.z.z}, s[] {
702 {1, m.x.y + m.y.x, m.z.x + m.x.z, m.y.z - m.z.y},
703 {m.x.y + m.y.x, 1, m.y.z + m.z.y, m.z.x - m.x.z},
704 {m.x.z + m.z.x, m.y.z + m.z.y, 1, m.x.y - m.y.x},
705 {m.y.z - m.z.y, m.z.x - m.x.z, m.x.y - m.y.x, 1}};
706 return copysign(normalize(sqrt(max(T(0), T(1)+q))), s[argmax(q)]);
707 }
708
709 template<class T> linalg::mat<T,4,4> linalg::lookat_matrix(const vec<T,3> & eye, const vec<T,3> & center, const vec<T,3> & view_y_dir, fwd_axis a)
710 {
711 const vec<T,3> f = normalize(center - eye), z = a == pos_z ? f : -f, x = normalize(cross(view_y_dir, z)), y = cross(z, x);
712 return inverse(mat<T,4,4>{{x,0},{y,0},{z,0},{eye,1}});
713 }
714
715 template<class T> linalg::mat<T,4,4> linalg::frustum_matrix(T x0, T x1, T y0, T y1, T n, T f, fwd_axis a, z_range z)
716 {
717 const T s = a == pos_z ? T(1) : T(-1), o = z == neg_one_to_one ? n : 0;
718 return {{2*n/(x1-x0),0,0,0}, {0,2*n/(y1-y0),0,0}, {-s*(x0+x1)/(x1-x0),-s*(y0+y1)/(y1-y0),s*(f+o)/(f-n),s}, {0,0,-(n+o)*f/(f-n),0}};
719 }
720
721 #endif
File include/fg3/fg3.h added (mode: 100755) (index 0000000..4eea18a)
1 #ifndef FG3_H
2 #define FG3_H
3
4 #if !defined(SDL_MAJOR_VERSION) && !defined(SFML_VERSION_MAJOR)
5 # error Include <SDL2/SDL.h> or <SFML/Window.hpp> before <fg3/fg3.h> so a graphics context can be initialized.
6 #endif
7
8 #if defined(__APPLE__)
9 # include <TargetConditionals.h>
10 # if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE==1
11 # define GLAD_GLES2_IMPLEMENTATION
12 # include "glad_gles2.h"
13 # else
14 # define GLAD_GL_IMPLEMENTATION
15 # include "glad_gl.h"
16 # endif
17 #elif defined(__ANDROID__)
18 # define GLAD_GLES2_IMPLEMENTATION
19 # include "glad_gles2.h"
20 #else
21 # define GLAD_GL_IMPLEMENTATION
22 # include "glad_gl.h"
23 #endif
24
25 #include "linalg.h"
26
27 #include <cmath>
28 #include <cstring>
29
30 #include <iostream>
31 #include <fstream>
32 #include <sstream>
33 #include <memory>
34 #include <string>
35 #include <vector>
36
37 namespace fg3
38 {
39
40 bool verbose = true;
41
42 #ifndef _VERBOUT_
43 #define _VERBOUT_ if( verbose ) std::cout
44 #endif
45
46 #ifndef _ERROUT_
47 #define _ERROUT_ std::cerr
48 #endif
49
50 #ifdef GLAD_GL
51 const GLchar* shaderHeader = R"(
52 #version 330
53 )";
54 #else // GLES
55 const GLchar* shaderHeader = R"(
56 #version 300 es
57 precision highp float;
58 )";
59 #endif
60
61 // vec2/3 can become vec4 automatically
62 // https://stackoverflow.com/questions/18935203/shader-position-vec4-or-vec3
63
64 const GLchar* unlitVert = R"(
65 uniform mat4 u_matrices[6]; // 0:mvp 1:mv 2:m 3:normal 4:texture 5:light
66 layout(location = 0) in vec4 a_Position;
67 layout(location = 1) in vec4 a_Normal;
68 layout(location = 2) in vec4 a_Tangent;
69 layout(location = 3) in vec4 a_UV;
70 out vec2 v_UV;
71 out vec4 v_RelativePos;
72 void main(){
73 v_UV = vec2( u_matrices[4] * a_UV );
74 v_RelativePos = u_matrices[1] * a_Position;
75 gl_Position = u_matrices[0] * a_Position;
76 }
77 )";
78
79 const GLchar* unlitFrag = R"(
80 uniform sampler2D u_texture;
81 uniform vec4 u_fog;
82 uniform vec3 u_camera;
83 in vec2 v_UV;
84 in vec4 v_RelativePos;
85 layout(location = 0) out vec4 fragColor;
86 void main(){
87 vec4 texColor = texture( u_texture, v_UV );
88 if( texColor.a < 0.001 ) discard;
89 if( u_fog.a > 0.0 ){
90 float fogFactor = 1.0 - clamp( 1.0 / exp( length( v_RelativePos ) * u_fog.a ), 0.0, 1.0 );
91 fragColor = vec4( mix( texColor.rgb, u_fog.rgb, fogFactor ), texColor.a );
92 }else{
93 fragColor = texColor;
94 }
95 }
96 )";
97
98 std::vector<std::string> unlitSamplers = { "u_texture" };
99
100 const GLchar* colorModFrag = R"(
101 uniform sampler2D u_texture;
102 uniform vec4 u_fog;
103 uniform vec3 u_camera;
104 in vec2 v_UV;
105 in vec4 v_RelativePos;
106 layout(location = 0) out vec4 fragColor;
107 void main(){
108 vec4 texColor = texture( u_texture, v_UV );
109 if( texColor.a < 0.001 ) discard;
110 fragColor = texColor * u_fog;
111 }
112 )";
113
114 std::vector<std::string> colorModSamplers = { "u_texture" };
115
116 // Instanced arrays are used for instancing.
117 // https://learnopengl.com/Advanced-OpenGL/Instancing
118
119 const GLchar* unlitInstanceVert = R"(
120 uniform mat4 u_matrices[3]; // 0:view 1:projection 2:light
121 layout(location = 0) in vec4 a_Position;
122 layout(location = 1) in vec4 a_Normal;
123 layout(location = 2) in vec4 a_Tangent;
124 layout(location = 3) in vec4 a_UV;
125 layout(location = 4) in vec4 a_Color;
126 layout(location = 5) in mat4 a_ModelMat;
127 layout(location = 9) in mat4 a_TexMat;
128 out vec2 v_UV;
129 out vec4 v_Color;
130 out vec4 v_RelativePos;
131 void main(){
132 v_UV = vec2( a_TexMat * a_UV );
133 v_Color = a_Color;
134 mat4 mv = u_matrices[0] * a_ModelMat;
135 v_RelativePos = mv * a_Position;
136 gl_Position = u_matrices[1] * mv * a_Position;
137 }
138 )";
139
140 const GLchar* unlitInstanceFrag = R"(
141 uniform sampler2D u_texture;
142 uniform vec4 u_fog;
143 in vec2 v_UV;
144 in vec4 v_Color;
145 in vec4 v_RelativePos;
146 layout(location = 0) out vec4 fragColor;
147 void main(){
148 vec4 texColor = texture( u_texture, v_UV ) * v_Color;
149 if( texColor.a < 0.001 ) discard;
150 if( u_fog.a > 0.0 ){
151 float fogFactor = 1.0 - clamp( 1.0 / exp( length( v_RelativePos ) * u_fog.a ), 0.0, 1.0 );
152 fragColor = vec4( mix( texColor.rgb, u_fog.rgb, fogFactor ), texColor.a );
153 }else{
154 fragColor = texColor;
155 }
156 }
157 )";
158
159 std::vector<std::string> unlitInstanceSamplers = { "u_texture" };
160
161 const GLchar* skyboxVert = R"(
162 uniform mat4 u_matrices[6]; // 0:mvp 1:mv 2:m 3:normal 4:texture 5:light
163 layout(location = 0) in vec4 a_Position;
164 layout(location = 1) in vec4 a_Normal;
165 layout(location = 2) in vec4 a_Tangent;
166 layout(location = 3) in vec4 a_UV;
167 out vec3 v_STR;
168 void main(){
169 v_STR = a_Position.xyz;
170 vec4 pos = u_matrices[0] * a_Position;
171 gl_Position = pos.xyww;
172 }
173 )";
174
175 const GLchar* skyboxFrag = R"(
176 uniform samplerCube u_cubemap;
177 uniform vec4 u_fog;
178 uniform vec3 u_camera;
179 in vec3 v_STR;
180 layout(location = 0) out vec4 fragColor;
181 void main(){
182 fragColor = texture( u_cubemap, v_STR );
183 }
184 )";
185
186 std::vector<std::string> skyboxSamplers = { "u_cubemap" };
187
188 const GLchar* irradianceFrag = R"(
189 uniform samplerCube u_cubemap;
190 uniform vec4 u_fog;
191 uniform vec3 u_camera;
192 in vec3 v_STR;
193 layout(location = 0) out vec4 fragColor;
194 const float PI = 3.1415927;
195 mat4 rotationMatrix( vec3 axis, float angle ){
196 axis = normalize( axis );
197 float s = sin( angle );
198 float c = cos( angle );
199 float oc = 1.0 - c;
200 return mat4( mat3(
201 oc * axis.x * axis.x + c, oc * axis.x * axis.y - axis.z * s, oc * axis.z * axis.x + axis.y * s,
202 oc * axis.x * axis.y + axis.z * s, oc * axis.y * axis.y + c, oc * axis.y * axis.z - axis.x * s,
203 oc * axis.z * axis.x - axis.y * s, oc * axis.y * axis.z + axis.x * s, oc * axis.z * axis.z + c
204 ) );
205 }
206 vec3 getIrradiance( vec3 normal ){
207 float grain = 0.05;
208 vec3 irradiance = vec3( 0.0 );
209 vec3 up = vec3( 0.0, 1.0, 0.0 );
210 vec3 right = normalize( cross( normal, up ) );
211 float index = 0.0;
212 for( float longi = 0.0; longi <= PI * 0.5; longi += grain ){
213 mat4 trl = rotationMatrix( right, longi );
214 for( float azi = 0.0; azi <= PI * 2.0; azi += grain ){
215 mat4 tra = rotationMatrix( normal, azi );
216 vec3 sampleVec = ( tra * trl * vec4( normal, 1.0 ) ).xyz;
217 irradiance += texture( u_cubemap, sampleVec ).rgb * sin( longi ) * cos( longi );
218 index += 1.0;
219 }
220 }
221 float hemispherePDF = 1.0 / ( 2.0 * PI );
222 irradiance /= index * hemispherePDF;
223 return irradiance;
224 }
225 void main(){
226 vec3 N = normalize( v_STR );
227 fragColor = vec4( getIrradiance( N ) / PI, 1.0 );
228 }
229 )";
230
231 std::vector<std::string> irradianceSamplers = { "u_cubemap" };
232
233 struct Display {
234 bool success;
235 unsigned int width;
236 unsigned int height;
237 std::string title;
238 };
239
240 Display newDisplay = { false, 0, 0, "" };
241
242 struct Color {
243 GLfloat r;
244 GLfloat g;
245 GLfloat b;
246 GLfloat a;
247 };
248
249 Color newColor = { 1.0f, 1.0f, 1.0f, 1.0f };
250
251 Color fogColor = { 0.0f, 0.0f, 0.0f, 0.0f };
252
253 struct Texture {
254 bool success;
255 GLuint texture;
256 GLsizei width;
257 GLsizei height;
258 unsigned int channels;
259 bool mipmap;
260 GLenum type;
261 };
262
263 Texture newTexture = { false, 0, 0, 0, 0, false, 0 };
264
265 Texture blankTexture = { false, 0, 0, 0, 0, false, 0 };
266
267 struct Framebuffer {
268 bool success;
269 GLuint fbo;
270 GLuint texture;
271 GLuint texture_z;
272 GLenum texture_type;
273 GLenum texture_fmt;
274 GLuint rbo;
275 GLsizei width;
276 GLsizei height;
277 GLsizei multisample;
278 };
279
280 Framebuffer newFramebuffer = { false, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
281
282 struct Vertex {
283 GLfloat Position[3];
284 GLfloat Normal[3];
285 GLfloat Tangent[3];
286 GLfloat UV[2];
287 };
288
289 Vertex newVertex = {
290 { 0.0f, 0.0f, 0.0f },
291 { 0.0f, 0.0f, 0.0f },
292 { 0.0f, 0.0f, 0.0f },
293 { 0.0f, 0.0f }
294 };
295
296 typedef GLuint Index;
297
298 // maybe make this an extendable class?
299 // different pipelines need different numbers of uniforms.
300 // don't forget UNIFORM BUFFER OBJECTS! GL 3.1+, GLES 3.0+
301 struct Pipeline {
302 bool success;
303 GLuint programObject;
304 GLuint u_metallicFactor;
305 GLuint u_roughnessFactor;
306 GLuint u_matrices;
307 GLuint u_fog;
308 GLuint u_camera;
309 std::vector<GLuint> slots;
310 };
311
312 Pipeline
313 newPipeline = { false, 0, 0, 0, 0, 0, 0, {} },
314 drawPipeline = { false, 0, 0, 0, 0, 0, 0, {} },
315 unlitPipeline = { false, 0, 0, 0, 0, 0, 0, {} },
316 colorModPipeline = { false, 0, 0, 0, 0, 0, 0, {} },
317 unlitInstancePipeline = { false, 0, 0, 0, 0, 0, 0, {} },
318 skyboxPipeline = { false, 0, 0, 0, 0, 0, 0, {} },
319 irradiancePipeline = { false, 0, 0, 0, 0, 0, 0, {} };
320
321 struct Mesh {
322 bool success;
323 std::vector<Vertex> vertices;
324 std::vector<Index> indices;
325 GLuint vao[3]; // VAO state, vertex buffer, index buffer
326 GLfloat xmin;
327 GLfloat xmax;
328 GLfloat ymin;
329 GLfloat ymax;
330 GLfloat zmin;
331 GLfloat zmax;
332 };
333
334 Mesh newMesh = { false, {}, {}, { 0, 0, 0 }, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f };
335
336 Mesh planeMesh = { false, {}, {}, { 0, 0, 0 }, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f };
337
338 Mesh cubeMesh = { false, {}, {}, { 0, 0, 0 }, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f };
339
340 struct Font {
341 Texture texture;
342 Mesh textMesh;
343 float size;
344 float height;
345 std::vector<int> charStarts;
346 std::vector<int> charEnds;
347 std::vector<unsigned char> buffer;
348 std::vector<unsigned char> atlas;
349 bool needSync;
350 #ifdef __STB_INCLUDE_STB_TRUETYPE_H__
351 stbtt_pack_context pc;
352 stbtt_fontinfo info;
353 std::vector<stbtt_packedchar> packedChars;
354 #else
355 void* pc;
356 void* info;
357 std::vector<void*> packedChars;
358 #endif
359 };
360
361 Font newFont = { newTexture, newMesh, 0.0f, 0.0f, {}, {}, {}, {}, false, {}, {}, {} };
362
363 // Globals.
364 linalg::mat<double,4,4> texMatrix = linalg::identity, lightMatrix = linalg::identity;
365
366 // Instancing.
367 struct InstanceAttributes {
368 Color color;
369 GLfloat modelMat[16];
370 GLfloat texMat[16];
371 };
372
373 // Used by testDraw.
374 void setPipeline( Pipeline pipeline );
375 void setTexture( Texture tex, GLuint texSlot );
376
377 class InstanceBuffer {
378 public:
379 GLuint vbo = 0;
380 std::vector<InstanceAttributes> attributes;
381
382 void push( const Color &color, linalg::mat<double,4,4> modelMat ){
383 attributes.push_back( {
384 color, {
385 (GLfloat)modelMat[0][0], (GLfloat)modelMat[0][1], (GLfloat)modelMat[0][2], (GLfloat)modelMat[0][3],
386 (GLfloat)modelMat[1][0], (GLfloat)modelMat[1][1], (GLfloat)modelMat[1][2], (GLfloat)modelMat[1][3],
387 (GLfloat)modelMat[2][0], (GLfloat)modelMat[2][1], (GLfloat)modelMat[2][2], (GLfloat)modelMat[2][3],
388 (GLfloat)modelMat[3][0], (GLfloat)modelMat[3][1], (GLfloat)modelMat[3][2], (GLfloat)modelMat[3][3] }, {
389 (GLfloat)texMatrix[0][0], (GLfloat)texMatrix[0][1], (GLfloat)texMatrix[0][2], (GLfloat)texMatrix[0][3],
390 (GLfloat)texMatrix[1][0], (GLfloat)texMatrix[1][1], (GLfloat)texMatrix[1][2], (GLfloat)texMatrix[1][3],
391 (GLfloat)texMatrix[2][0], (GLfloat)texMatrix[2][1], (GLfloat)texMatrix[2][2], (GLfloat)texMatrix[2][3],
392 (GLfloat)texMatrix[3][0], (GLfloat)texMatrix[3][1], (GLfloat)texMatrix[3][2], (GLfloat)texMatrix[3][3] }
393 } );
394 }
395
396 void upload(){
397 // Copy the attributes to the VBO.
398 if( !vbo ) glGenBuffers( 1, &vbo );
399 glBindBuffer( GL_ARRAY_BUFFER, vbo );
400 glBufferData( GL_ARRAY_BUFFER, attributes.size() * sizeof(InstanceAttributes), attributes.data(), GL_STREAM_DRAW );
401 }
402
403 void draw( Mesh &mesh, linalg::mat<double,4,4> viewMat, linalg::mat<double,4,4> projMat ){
404 if( attributes.empty() || !mesh.success || !vbo ) return;
405
406 // Bind the VBO.
407 glBindBuffer( GL_ARRAY_BUFFER, vbo );
408
409 // The view matrix is the inverse of the camera's transform.
410 viewMat = linalg::inverse( viewMat );
411
412 // Copy the camera matrices to the uniform matrix array.
413 const GLfloat glmats[48] = {
414 (GLfloat)viewMat[0][0], (GLfloat)viewMat[0][1], (GLfloat)viewMat[0][2], (GLfloat)viewMat[0][3],
415 (GLfloat)viewMat[1][0], (GLfloat)viewMat[1][1], (GLfloat)viewMat[1][2], (GLfloat)viewMat[1][3],
416 (GLfloat)viewMat[2][0], (GLfloat)viewMat[2][1], (GLfloat)viewMat[2][2], (GLfloat)viewMat[2][3],
417 (GLfloat)viewMat[3][0], (GLfloat)viewMat[3][1], (GLfloat)viewMat[3][2], (GLfloat)viewMat[3][3],
418 (GLfloat)projMat[0][0], (GLfloat)projMat[0][1], (GLfloat)projMat[0][2], (GLfloat)projMat[0][3],
419 (GLfloat)projMat[1][0], (GLfloat)projMat[1][1], (GLfloat)projMat[1][2], (GLfloat)projMat[1][3],
420 (GLfloat)projMat[2][0], (GLfloat)projMat[2][1], (GLfloat)projMat[2][2], (GLfloat)projMat[2][3],
421 (GLfloat)projMat[3][0], (GLfloat)projMat[3][1], (GLfloat)projMat[3][2], (GLfloat)projMat[3][3],
422 (GLfloat)lightMatrix[0][0], (GLfloat)lightMatrix[0][1], (GLfloat)lightMatrix[0][2], (GLfloat)lightMatrix[0][3],
423 (GLfloat)lightMatrix[1][0], (GLfloat)lightMatrix[1][1], (GLfloat)lightMatrix[1][2], (GLfloat)lightMatrix[1][3],
424 (GLfloat)lightMatrix[2][0], (GLfloat)lightMatrix[2][1], (GLfloat)lightMatrix[2][2], (GLfloat)lightMatrix[2][3],
425 (GLfloat)lightMatrix[3][0], (GLfloat)lightMatrix[3][1], (GLfloat)lightMatrix[3][2], (GLfloat)lightMatrix[3][3],
426 };
427
428 glUniformMatrix4fv( drawPipeline.u_matrices, 3, GL_FALSE, glmats );
429
430 // Switch graphics memory to the VAO.
431 glBindVertexArray( mesh.vao[0] );
432
433 // Turn on 1 + 4 + 4 attribute arrays. (mat4 counts as 4.)
434 std::size_t pointer = 0;
435 for( int i = 4; i < 13; i++ ){
436 glEnableVertexAttribArray( i );
437 glVertexAttribPointer( i, 4, GL_FLOAT, GL_FALSE, sizeof(InstanceAttributes), (void*)pointer );
438 pointer += sizeof(GLfloat) * 4;
439 glVertexAttribDivisor( i, 1 );
440 }
441
442 glDrawElementsInstanced(
443 GL_TRIANGLES,
444 mesh.indices.size(),
445 GL_UNSIGNED_INT,
446 (const GLvoid*)0,
447 attributes.size()
448 );
449
450 // Instancing is over, so disable the instancing arrays.
451 for( int i = 4; i < 13; i++ )
452 glDisableVertexAttribArray( i );
453
454 // Switch out of the VAO.
455 glBindVertexArray( 0 );
456 }
457
458 void clear(){
459 attributes.clear();
460 }
461
462 void testDraw( linalg::mat<double,4,4> viewMat, linalg::mat<double,4,4> projMat ){
463 // Build the instance buffer.
464 for( int x = -5; x < 5; x++ ){
465 for( int y = -5; y < 5; y++ ){
466 for( int z = -5; z < 5; z++ ){
467 push(
468 (Color){ ( x + 6 ) * 0.09f, ( y + 6 ) * 0.09f, 0.0f, 1.0f },
469 linalg::translation_matrix( linalg::vec<double,3>( x * 3.0, y * 3.0, z * 3.0 ) )
470 );
471 }
472 }
473 }
474 // Upload attributes.
475 upload();
476 // Draw the instance buffer.
477 auto old_pipeline = drawPipeline;
478 setPipeline( unlitInstancePipeline );
479 setTexture( blankTexture, 0 );
480 draw( cubeMesh, viewMat, projMat );
481 clear();
482 setPipeline( old_pipeline );
483 }
484
485 virtual ~InstanceBuffer(){
486 if( vbo ) glDeleteBuffers( 1, &vbo );
487 }
488 };
489
490 // TODO: SFML mouse wheel.
491 int mouseX = 0, mouseY = 0, mouseMoveX = 0, mouseMoveY = 0, mouseWheel = 0;
492 bool mouseTrapped = false;
493
494 // TODO: SFML touch input.
495 float touchPressure = 0.0f;
496 bool touchStart = false;
497
498 #ifdef SDL_MAJOR_VERSION
499 SDL_Window* window;
500 SDL_GLContext ctx;
501 SDL_GameController* controller = nullptr;
502
503 // TODO: SFML text input.
504 SDL_Rect textInputRect = {};
505 bool textInputEnabled = false;
506 bool textReturnStart = false;
507 std::string textInputString = "";
508
509 Uint32 windowID;
510 const Uint8* keystates;
511 Uint64 now;
512 #else // SFML
513 sf::Window window;
514 sf::Clock clock;
515 // TODO: SFML controller.
516
517 // TODO: SFML text input.
518
519 std::string windowTitle;
520 #endif
521
522 std::u32string utf8ToUtf32( std::string in ){
523 std::u32string out;
524
525 for( size_t i = 0; i < in.length(); i++ ){
526 // an unsigned char pointer starting at the current char
527 auto u = reinterpret_cast<unsigned char*>( &in[ i ] );
528
529 if( u[0] < 128 ){
530 // 7 bits (ASCII)
531 out += u[0];
532 }else if( i + 1 < in.length() ){
533 if( u[0] >= 192 && u[0] < 224 ){
534 // 2 bytes
535 out +=
536 ( u[0] - 192 ) * 64 +
537 ( u[1] - 128 );
538 i += 1;
539 }else if( i + 2 < in.length() ){
540 if( u[0] >= 224 && u[0] < 240 ){
541 // 3 bytes
542 out +=
543 ( u[0] - 224 ) * 4096 +
544 ( u[1] - 128 ) * 64 +
545 ( u[2] - 128 );
546 i += 2;
547 }else if( i + 3 < in.length() && u[0] >= 240 && u[0] < 248 ){
548 // 4 bytes
549 out +=
550 ( u[0] - 240 ) * 262144 +
551 ( u[1] - 128 ) * 4096 +
552 ( u[2] - 128 ) * 64 +
553 ( u[3] - 128 );
554 i += 3;
555 }
556 }
557 }
558 }
559
560 return out;
561 }
562
563 linalg::vec<double,4> eulerToQuat( double aX, double aY, double aZ ){
564 double
565 c1 = std::cos( aY * 0.5 ),
566 c2 = std::cos( aZ * 0.5 ),
567 c3 = std::cos( aX * 0.5 ),
568 s1 = std::sin( aY * 0.5 ),
569 s2 = std::sin( aZ * 0.5 ),
570 s3 = std::sin( aX * 0.5 );
571
572 return linalg::vec<double,4>(
573 s1 * s2 * c3 + c1 * c2 * s3,
574 s1 * c2 * c3 + c1 * s2 * s3,
575 c1 * s2 * c3 - s1 * c2 * s3,
576 c1 * c2 * c3 - s1 * s2 * s3
577 );
578 }
579
580 linalg::vec<double,4> directionToQuat( linalg::vec<double,3> forward, linalg::vec<double,3> up ){
581 forward = linalg::normalize( forward );
582 up = linalg::normalize( up );
583 linalg::mat<double,4,4> m = linalg::lookat_matrix( linalg::vec<double,3>(), forward, up );
584 return linalg::qconj( linalg::rotation_quat( linalg::mat<double,3,3>(
585 { m[0][0], m[1][0], m[2][0] },
586 { m[0][1], m[1][1], m[2][1] },
587 { m[0][2], m[1][2], m[2][2] }
588 ) ) );
589 }
590
591 double wrapAngle( double a ){
592 return std::remainder( a, std::acos( -1 ) * 2 );
593 }
594
595 Color rgb( float r, float g, float b ){
596 Color col = { r, g, b, 1.0f };
597 return col;
598 }
599
600 // Used by cls.
601 void drawMesh( Mesh &mesh, linalg::mat<double,4,4> modelMat, linalg::mat<double,4,4> viewMat, linalg::mat<double,4,4> projMat );
602 void setPipeline( Pipeline pipeline );
603
604 void cls( Color col, bool clearDepth = true ){
605 if( clearDepth ){
606 // GL_DEPTH_BUFFER_BIT is not usually problematic.
607 glClear( GL_DEPTH_BUFFER_BIT );
608 }
609 // Clear the screen by drawing a plane rather than glClear.
610 // Graphics driver bugs occasionally result in glClear-related crashes.
611 Pipeline p = drawPipeline;
612 setPipeline( colorModPipeline );
613 glUniform4f( drawPipeline.u_fog, col.r, col.g, col.b, col.a );
614 glDisable( GL_BLEND );
615 glActiveTexture( GL_TEXTURE0 );
616 glBindTexture( GL_TEXTURE_2D, blankTexture.texture );
617 // Stretch to screen bounds at max depth.
618 drawMesh(
619 planeMesh,
620 linalg::mat<double,4,4>(
621 { 2.0, 0.0, 0.0, 0.0 },
622 { 0.0, 2.0, 0.0, 0.0 },
623 { 0.0, 0.0, 0.0, 0.0 },
624 { 0.0, 0.0, 1.0, 1.0 }
625 ),
626 linalg::identity,
627 linalg::identity
628 );
629 glUniform4f( drawPipeline.u_fog, fogColor.r, fogColor.g, fogColor.b, fogColor.a );
630 setPipeline( p );
631 }
632
633 Mesh loadMesh( std::vector<Vertex> &vertices, std::vector<Index> &indices, bool streaming = false ){
634 Mesh mesh = newMesh;
635
636 if( vertices.size() > 0 ){
637 // Measure the farthest bounds of the vertices.
638 // Start with the first vertex so that the origin does not matter.
639 GLfloat* p = vertices[0].Position;
640 mesh.xmin = p[0];
641 mesh.xmax = p[0];
642 mesh.ymin = p[1];
643 mesh.ymax = p[1];
644 mesh.zmin = p[2];
645 mesh.zmax = p[2];
646 for( size_t i = 1; i < vertices.size(); i++ ){
647 p = vertices[i].Position;
648 if( p[0] < mesh.xmin ) mesh.xmin = p[0];
649 if( p[0] > mesh.xmax ) mesh.xmax = p[0];
650 if( p[1] < mesh.ymin ) mesh.ymin = p[1];
651 if( p[1] > mesh.ymax ) mesh.ymax = p[1];
652 if( p[2] < mesh.zmin ) mesh.zmin = p[2];
653 if( p[2] > mesh.zmax ) mesh.zmax = p[2];
654 }
655 }
656
657 _VERBOUT_ << ( streaming ? "STREAMING " : "" ) << "VERTEX ARRAY OBJECT" << std::endl;
658
659 // generate a VAO (1 per mesh)
660 glGenVertexArrays( 1, &mesh.vao[0] );
661 // switch graphics memory to the VAO
662 glBindVertexArray( mesh.vao[0] );
663
664 _VERBOUT_ << "VAO address: " << mesh.vao[0] << std::endl;
665
666 // turn on 4 attribute arrays
667 glEnableVertexAttribArray( 0 ); // Position
668 glEnableVertexAttribArray( 1 ); // Normal
669 glEnableVertexAttribArray( 2 ); // Tangent
670 glEnableVertexAttribArray( 3 ); // UV
671
672 // generate a vertex buffer and an index buffer
673 glGenBuffers( 2, &mesh.vao[1] );
674
675 _VERBOUT_ << "Vertex buffer address: " << mesh.vao[1] << std::endl;
676 _VERBOUT_ << "Index buffer address: " << mesh.vao[2] << std::endl;
677
678 // switch to the vertex buffer
679 glBindBuffer( GL_ARRAY_BUFFER, mesh.vao[1] );
680 // upload the vertices, passing the size in bytes
681 glBufferData( GL_ARRAY_BUFFER, vertices.size() * sizeof(Vertex), &vertices[0], streaming ? GL_STREAM_DRAW : GL_STATIC_DRAW );
682 _VERBOUT_ << "Number of vertices: " << vertices.size() << std::endl;
683 _VERBOUT_ << "Size of Vertex: " << sizeof(Vertex) << std::endl;
684
685 // perhaps an inconsistent use of data here but I'm not sure what to do
686 // sizeof returns a size_t which can be cast to anything since it's just a number
687 std::size_t pointer = 0;
688 glVertexAttribPointer( 0, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex), (const GLvoid*)pointer ); // Position
689 pointer += sizeof(vertices[0].Position);
690 glVertexAttribPointer( 1, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex), (const GLvoid*)pointer ); // Normal
691 pointer += sizeof(vertices[0].Normal);
692 glVertexAttribPointer( 2, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex), (const GLvoid*)pointer ); // Tangent
693 pointer += sizeof(vertices[0].Tangent);
694 glVertexAttribPointer( 3, 2, GL_FLOAT, GL_FALSE, sizeof(Vertex), (const GLvoid*)pointer ); // UV
695
696 // switch to the index buffer
697 glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, mesh.vao[2] );
698 // upload the indices, passing the size in bytes
699 glBufferData( GL_ELEMENT_ARRAY_BUFFER, indices.size() * sizeof(Index), &indices[0], streaming ? GL_STREAM_DRAW : GL_STATIC_DRAW );
700 _VERBOUT_ << "Number of indices: " << indices.size() << std::endl;
701 _VERBOUT_ << "Size of Index: " << sizeof(Index) << "\n" << std::endl;
702
703 // switch out of the VAO
704 glBindVertexArray( 0 );
705
706 // TODO: Failure conditions.
707 mesh.success = true;
708
709 mesh.vertices = vertices;
710 mesh.indices = indices;
711
712 return mesh;
713 }
714
715 void updateMesh( Mesh &mesh, std::vector<Vertex> &vertices, std::vector<Index> &indices, bool streaming = false ){
716 // switch graphics memory to the VAO
717 glBindVertexArray( mesh.vao[0] );
718
719 // switch to the vertex buffer
720 glBindBuffer( GL_ARRAY_BUFFER, mesh.vao[1] );
721 // upload the vertices, passing the size in bytes
722 glBufferData( GL_ARRAY_BUFFER, vertices.size() * sizeof(Vertex), &vertices[0], streaming ? GL_STREAM_DRAW : GL_STATIC_DRAW );
723
724 // switch to the index buffer
725 glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, mesh.vao[2] );
726 // upload the indices, passing the size in bytes
727 glBufferData( GL_ELEMENT_ARRAY_BUFFER, indices.size() * sizeof(Index), &indices[0], streaming ? GL_STREAM_DRAW : GL_STATIC_DRAW );
728
729 mesh.vertices = vertices;
730 mesh.indices = indices;
731 }
732
733 void drawMesh( Mesh &mesh, linalg::mat<double,4,4> modelMat, linalg::mat<double,4,4> viewMat, linalg::mat<double,4,4> projMat ){
734 if( !mesh.success ) return;
735
736 linalg::mat<double,4,4> mv = linalg::mul( linalg::inverse( viewMat ), modelMat );
737 linalg::mat<double,4,4> mvp = linalg::mul( projMat, mv );
738 linalg::mat<double,4,4> normal = linalg::transpose( linalg::inverse( modelMat ) );
739
740 const GLfloat glmats[96] = { // TODO: Don't send all matrices at once.
741 (GLfloat)mvp[0][0], (GLfloat)mvp[0][1], (GLfloat)mvp[0][2], (GLfloat)mvp[0][3],
742 (GLfloat)mvp[1][0], (GLfloat)mvp[1][1], (GLfloat)mvp[1][2], (GLfloat)mvp[1][3],
743 (GLfloat)mvp[2][0], (GLfloat)mvp[2][1], (GLfloat)mvp[2][2], (GLfloat)mvp[2][3],
744 (GLfloat)mvp[3][0], (GLfloat)mvp[3][1], (GLfloat)mvp[3][2], (GLfloat)mvp[3][3],
745 (GLfloat)mv[0][0], (GLfloat)mv[0][1], (GLfloat)mv[0][2], (GLfloat)mv[0][3],
746 (GLfloat)mv[1][0], (GLfloat)mv[1][1], (GLfloat)mv[1][2], (GLfloat)mv[1][3],
747 (GLfloat)mv[2][0], (GLfloat)mv[2][1], (GLfloat)mv[2][2], (GLfloat)mv[2][3],
748 (GLfloat)mv[3][0], (GLfloat)mv[3][1], (GLfloat)mv[3][2], (GLfloat)mv[3][3],
749 (GLfloat)modelMat[0][0], (GLfloat)modelMat[0][1], (GLfloat)modelMat[0][2], (GLfloat)modelMat[0][3],
750 (GLfloat)modelMat[1][0], (GLfloat)modelMat[1][1], (GLfloat)modelMat[1][2], (GLfloat)modelMat[1][3],
751 (GLfloat)modelMat[2][0], (GLfloat)modelMat[2][1], (GLfloat)modelMat[2][2], (GLfloat)modelMat[2][3],
752 (GLfloat)modelMat[3][0], (GLfloat)modelMat[3][1], (GLfloat)modelMat[3][2], (GLfloat)modelMat[3][3],
753 (GLfloat)normal[0][0], (GLfloat)normal[0][1], (GLfloat)normal[0][2], (GLfloat)normal[0][3],
754 (GLfloat)normal[1][0], (GLfloat)normal[1][1], (GLfloat)normal[1][2], (GLfloat)normal[1][3],
755 (GLfloat)normal[2][0], (GLfloat)normal[2][1], (GLfloat)normal[2][2], (GLfloat)normal[2][3],
756 (GLfloat)normal[3][0], (GLfloat)normal[3][1], (GLfloat)normal[3][2], (GLfloat)normal[3][3],
757 (GLfloat)texMatrix[0][0], (GLfloat)texMatrix[0][1], (GLfloat)texMatrix[0][2], (GLfloat)texMatrix[0][3],
758 (GLfloat)texMatrix[1][0], (GLfloat)texMatrix[1][1], (GLfloat)texMatrix[1][2], (GLfloat)texMatrix[1][3],
759 (GLfloat)texMatrix[2][0], (GLfloat)texMatrix[2][1], (GLfloat)texMatrix[2][2], (GLfloat)texMatrix[2][3],
760 (GLfloat)texMatrix[3][0], (GLfloat)texMatrix[3][1], (GLfloat)texMatrix[3][2], (GLfloat)texMatrix[3][3],
761 (GLfloat)lightMatrix[0][0], (GLfloat)lightMatrix[0][1], (GLfloat)lightMatrix[0][2], (GLfloat)lightMatrix[0][3],
762 (GLfloat)lightMatrix[1][0], (GLfloat)lightMatrix[1][1], (GLfloat)lightMatrix[1][2], (GLfloat)lightMatrix[1][3],
763 (GLfloat)lightMatrix[2][0], (GLfloat)lightMatrix[2][1], (GLfloat)lightMatrix[2][2], (GLfloat)lightMatrix[2][3],
764 (GLfloat)lightMatrix[3][0], (GLfloat)lightMatrix[3][1], (GLfloat)lightMatrix[3][2], (GLfloat)lightMatrix[3][3],
765 };
766
767 glUniformMatrix4fv( drawPipeline.u_matrices, 6, GL_FALSE, glmats );
768
769 // Send the camera position relative to the object's origin.
770 glUniform3f(
771 drawPipeline.u_camera,
772 viewMat[3][0] - modelMat[3][0],
773 viewMat[3][1] - modelMat[3][1],
774 viewMat[3][2] - modelMat[3][2]
775 );
776
777 // Switch graphics memory to the VAO.
778 glBindVertexArray( mesh.vao[0] );
779
780 glDrawElements( GL_TRIANGLES, mesh.indices.size(), GL_UNSIGNED_INT, (const GLvoid*)0 );
781 }
782
783 void normalizeVertices( std::vector<Vertex> &verts ){
784 for( size_t i = 0; i < verts.size(); i++ ){
785 GLfloat* n = verts[i].Normal;
786 GLfloat l = std::sqrt( n[0] * n[0] + n[1] * n[1] + n[2] * n[2] );
787 if( l != 0.0f && l != 1.0f ){
788 verts[i].Normal[0] /= l;
789 verts[i].Normal[1] /= l;
790 verts[i].Normal[2] /= l;
791 }
792 }
793 }
794
795 Mesh loadOBJ( std::string filepath ){
796 _VERBOUT_ << "OBJ MESH" << std::endl;
797 size_t line = 0;
798 try{
799 std::ifstream ss( filepath, std::ios::binary );
800
801 if( ss.fail() ){
802 _ERROUT_ << "Failed to open " << filepath << "\n" << std::endl;
803 return newMesh;
804 }
805
806 std::string text = static_cast<std::stringstream const&>( std::stringstream() << ss.rdbuf() ).str();
807
808 struct float3 { GLfloat x, y, z; };
809 struct float2 { GLfloat u, v; };
810 struct obdex { int v1, vt1, vn1, v2, vt2, vn2, v3, vt3, vn3; };
811
812 std::vector<float3> obj_v, obj_vn;
813 std::vector<float2> obj_vt;
814 std::vector<obdex> obj_f;
815
816 size_t head = 0, tail = 0;
817
818 do{
819 line++;
820 tail = text.find_first_of( "\n", head );
821 if( tail == std::string::npos ) tail = text.size();
822 if( text[ head ] != '#' ){
823 std::string ln = text.substr( head, tail - head );
824
825 std::vector<std::string> s;
826
827 size_t i1 = 0, i2 = 0;
828
829 do{
830 i2 = ln.find_first_of( " \r/", i1 );
831 if( i2 == std::string::npos ) i2 = ln.size();
832 std::string value = ln.substr( i1, i2 - i1 );
833 if( value.length() > 0 ) s.push_back( value );
834 i1 = i2 + 1;
835 }while( i1 < ln.size() );
836
837 if( s.size() > 0 ){
838 if( s[0] == "v" && s.size() >= 4 ){
839 obj_v.push_back( { std::stof(s[1]), std::stof(s[2]), std::stof(s[3]) } );
840 }else if( s[0] == "vt" && s.size() >= 3 ){
841 // Flip the vertical texture coordinate.
842 obj_vt.push_back( { std::stof(s[1]), 1.0f - std::stof(s[2]) } );
843 }else if( s[0] == "vn" && s.size() >= 4 ){
844 obj_vn.push_back( { std::stof(s[1]), std::stof(s[2]), std::stof(s[3]) } );
845 }else if( s[0] == "f" && s.size() >= 10 ){
846 obj_f.push_back( {
847 std::stoi(s[1]),
848 std::stoi(s[2]),
849 std::stoi(s[3]),
850 std::stoi(s[4]),
851 std::stoi(s[5]),
852 std::stoi(s[6]),
853 std::stoi(s[7]),
854 std::stoi(s[8]),
855 std::stoi(s[9])
856 } );
857 }
858 }
859 }
860 head = tail + 1;
861 }while( head < text.size() );
862
863 _VERBOUT_ << "Vertex positions: " << obj_v.size() << std::endl;
864 _VERBOUT_ << "Vertex texcoords: " << obj_vt.size() << std::endl;
865 _VERBOUT_ << "Vertex normals: " << obj_vn.size() << std::endl;
866 _VERBOUT_ << "Faces: " << obj_f.size() << std::endl;
867
868 // group vertex attributes by texture coordinates
869 std::vector<Vertex> verts( obj_vt.size() );
870 std::vector<Index> inds;
871
872 for( obdex f : obj_f ){
873 Index a = f.vt1 - 1, b = f.vt2 - 1, c = f.vt3 - 1;
874 verts[ a ] = {
875 { obj_v[ f.v1 - 1 ].x, obj_v[ f.v1 - 1 ].y, obj_v[ f.v1 - 1 ].z },
876 { obj_vn[ f.vn1 - 1 ].x, obj_vn[ f.vn1 - 1 ].y, obj_vn[ f.vn1 - 1 ].z },
877 { 0.0f, 0.0f, 0.0f },
878 { obj_vt[ a ].u, obj_vt[ a ].v }
879 };
880 verts[ b ] = {
881 { obj_v[ f.v2 - 1 ].x, obj_v[ f.v2 - 1 ].y, obj_v[ f.v2 - 1 ].z },
882 { obj_vn[ f.vn2 - 1 ].x, obj_vn[ f.vn2 - 1 ].y, obj_vn[ f.vn2 - 1 ].z },
883 { 0.0f, 0.0f, 0.0f },
884 { obj_vt[ b ].u, obj_vt[ b ].v }
885 };
886 verts[ c ] = {
887 { obj_v[ f.v3 - 1 ].x, obj_v[ f.v3 - 1 ].y, obj_v[ f.v3 - 1 ].z },
888 { obj_vn[ f.vn3 - 1 ].x, obj_vn[ f.vn3 - 1 ].y, obj_vn[ f.vn3 - 1 ].z },
889 { 0.0f, 0.0f, 0.0f },
890 { obj_vt[ c ].u, obj_vt[ c ].v }
891 };
892 Index i[3] = { a, b, c };
893 inds.insert( std::end( inds ), std::begin( i ), std::end( i ) );
894 }
895
896 normalizeVertices( verts );
897
898 _VERBOUT_ << "Vertices: " << verts.size() << std::endl;
899 _VERBOUT_ << "Indices: " << inds.size() << "\n" << std::endl;
900
901 return loadMesh( verts, inds );
902
903 }catch( const std::exception &e ){
904 _ERROUT_ << "Caught exception at line " << line << " of " << filepath << ": " << e.what() << "\n" << std::endl;
905 }
906 return newMesh;
907 }
908
909 #ifdef tinyply_h
910
911 Mesh loadPLY( std::string filepath ){
912 _VERBOUT_ << "PLY MESH" << std::endl;
913 try{
914 std::ifstream ss( filepath, std::ios::binary );
915
916 if( ss.fail() ){
917 _ERROUT_ << "Failed to open " << filepath << "\n" << std::endl;
918 return newMesh;
919 }
920
921 PlyFile file;
922 file.parse_header( ss );
923
924 for( auto c : file.get_comments() ) _VERBOUT_ << "Comment: " << c << std::endl;
925
926 // Tinyply treats parsed data as untyped byte buffers.
927 std::shared_ptr<PlyData> vertices, normals, texcoords, faces;
928
929 bool gotNormals = false, gotUV = false;
930
931 for( auto e : file.get_elements() ){
932 _VERBOUT_ << "element - " << e.name << " (" << e.size << ")" << std::endl;
933 for( auto p : e.properties ){
934 _VERBOUT_ << "\tproperty - " << p.name << " (" << tinyply::PropertyTable[p.propertyType].str << ")" << std::endl;
935
936 if( e.name == "vertex" ){
937 if( p.name == "x" ){
938 // assume if "x" exists then so do "y" and "z"
939 vertices = file.request_properties_from_element( e.name, { "x", "y", "z" } );
940 }else if( p.name == "nx" ){
941 // assume if "nx" exists then so do "ny" and "nz"
942 normals = file.request_properties_from_element( e.name, { "nx", "ny", "nz" } );
943 gotNormals = true;
944 }else if( p.name == "u" ){
945 // assume if "u" exists then so does "v"
946 texcoords = file.request_properties_from_element( e.name, { "u", "v" } );
947 gotUV = true;
948 }else if( p.name == "s" ){
949 // assume if "s" exists then so does "t"
950 texcoords = file.request_properties_from_element( e.name, { "s", "t" } );
951 gotUV = true;
952 }
953 }else if( e.name == "face" && p.name == "vertex_indices" ){
954 faces = file.request_properties_from_element( e.name, { p.name }, 3 );
955 }
956 }
957 }
958
959 file.read( ss );
960
961 if( vertices ){
962 _VERBOUT_ << "Read " << vertices->count << " total vertices." << std::endl;
963 }
964 if( normals ){
965 _VERBOUT_ << "Read " << normals->count << " total vertex normals." << std::endl;
966 }
967 if( texcoords ){
968 _VERBOUT_ << "Read " << texcoords->count << " total vertex texcoords." << std::endl;
969 }
970 if( faces ){
971 _VERBOUT_ << "Read " << faces->count << " total faces (triangles).\n" << std::endl;
972 }
973
974 if( vertices->t == tinyply::Type::FLOAT32 && ( faces->t == tinyply::Type::INT32 || faces->t == tinyply::Type::UINT32 ) ){
975 struct float3 { GLfloat x, y, z; };
976 struct float2 { GLfloat u, v; };
977
978 // vertex positions
979 std::vector<float3> vertpos( vertices->count );
980 const size_t numVerticesBytes = vertices->buffer.size_bytes();
981 std::memcpy( vertpos.data(), vertices->buffer.get(), numVerticesBytes );
982
983 // vertex normals
984 std::vector<float3> vertnorms( gotNormals ? normals->count : 1 );
985 if( gotNormals ){
986 const size_t numNormalsBytes = normals->buffer.size_bytes();
987 std::memcpy( vertnorms.data(), normals->buffer.get(), numNormalsBytes );
988 }
989
990 // vertex UV
991 std::vector<float2> vertuv( gotUV ? texcoords->count : 1 );
992 if( gotUV ){
993 const size_t numTexcoordsBytes = texcoords->buffer.size_bytes();
994 std::memcpy( vertuv.data(), texcoords->buffer.get(), numTexcoordsBytes );
995 }
996
997 // create the vertex array
998 std::vector<Vertex> verts;
999
1000 float3 n = { 0.0f, 0.0f, 0.0f };
1001 float2 uv = { 0.0f, 0.0f };
1002
1003 // fill vertex array with vertex attributes from tinyply
1004 for( size_t i = 0; i < vertpos.size(); i++ ){
1005 if( gotNormals ) n = { vertnorms[i].x, vertnorms[i].y, vertnorms[i].z };
1006 if( gotUV ) uv = { vertuv[i].u, vertuv[i].v };
1007 Vertex v = {
1008 { vertpos[i].x, vertpos[i].y, vertpos[i].z },
1009 { n.x, n.y, n.z },
1010 { 0.0f, 0.0f, 0.0f },
1011 // Flip the vertical texture coordinate.
1012 { uv.u, 1.0f - uv.v },
1013 };
1014 verts.push_back( v );
1015 }
1016
1017 // normalize the vertex array
1018 normalizeVertices( verts );
1019
1020 std::vector<int32_t> indpos( faces->count * 3 );
1021 const size_t numFacesBytes = faces->buffer.size_bytes();
1022 std::memcpy( indpos.data(), faces->buffer.get(), numFacesBytes );
1023
1024 // detect if signed int32 is used for indices
1025 bool sint = faces->t == tinyply::Type::INT32;
1026
1027 // create the index array
1028 std::vector<Index> inds;
1029
1030 // fill index array with indices from tinyply
1031 for( int32_t i : indpos ) inds.push_back( sint ? (Index)i : (Index)*reinterpret_cast<uint32_t*>(&i) );
1032
1033 return loadMesh( verts, inds );
1034 }else{
1035 _ERROUT_ << "PLY mesh does not use 32-bit format\n" << std::endl;
1036 }
1037 }catch( const std::exception &e ){
1038 _ERROUT_ << "Caught exception with " << filepath << ": " << e.what() << "\n" << std::endl;
1039 }
1040 return newMesh;
1041 }
1042
1043 #else
1044
1045 Mesh loadPLY( std::string filepath ){
1046 (void)filepath;
1047 _ERROUT_ << "Include tinyply.h before fg3.h to load PLY files.\n" << std::endl;
1048 return newMesh;
1049 }
1050
1051 #endif // tinyply_h
1052
1053 void freeMesh( Mesh &mesh ){
1054 glDeleteBuffers( 2, &mesh.vao[1] );
1055 glDeleteVertexArrays( 1, &mesh.vao[0] );
1056 mesh = newMesh;
1057 }
1058
1059 Texture loadTexture( const GLvoid* data, GLsizei width, GLsizei height, unsigned int channels, bool mipmap = true, bool filter = true ){
1060 Texture tex = newTexture;
1061 if( !data ) return tex;
1062
1063 // To retain compatibility with both WebGL and OpenGL 4, single-channel textures only come in red.
1064 GLenum pixfmts[] = {
1065 GL_RED,
1066 GL_RG,
1067 GL_RGB,
1068 GL_RGBA
1069 };
1070
1071 glGenTextures( 1, &tex.texture );
1072 glBindTexture( GL_TEXTURE_2D, tex.texture );
1073
1074 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
1075 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );
1076
1077 glTexParameteri(
1078 GL_TEXTURE_2D,
1079 GL_TEXTURE_MIN_FILTER,
1080 mipmap ? ( filter ? GL_LINEAR_MIPMAP_LINEAR : GL_NEAREST_MIPMAP_LINEAR ) : ( filter ? GL_LINEAR : GL_NEAREST )
1081 );
1082 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter ? GL_LINEAR : GL_NEAREST );
1083
1084 if( channels < 3 ){
1085 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_G, GL_RED );
1086 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_RED );
1087 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_A, channels == 2 ? GL_GREEN : GL_ONE );
1088 }
1089
1090 // STB libraries do not pad rows
1091 // https://www.opengl.org/discussion_boards/showthread.php/134151-glTexImage2D-Resulting-texture-not-matching-passed-data
1092 // https://stackoverflow.com/questions/15052463/given-the-pitch-of-an-image-how-to-calculate-the-gl-unpack-alignment
1093 unsigned int pitch = width * channels;
1094 glPixelStorei(
1095 GL_UNPACK_ALIGNMENT,
1096 pitch % 8 == 0 ? 8 // most efficient
1097 : ( pitch % 4 == 0 ? 4 // common value
1098 : ( pitch % 2 == 0 ? 2 // dubious efficiency
1099 : 1 // least efficient
1100 ) ) );
1101
1102 // assume an sRGBA image, which OpenGL automatically linearizes before passing to every shader
1103 // or load said sRGBA image as linear RGBA so fragments are output 1:1 without lighting effects
1104 // https://www.khronos.org/registry/OpenGL-Refpages/es3.0/html/glTexImage2D.xhtml
1105 // https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glTexImage2D.xhtml
1106 // http://opengl.datenwolf.net/gltut/html/Texturing/Tutorial%2016.html
1107 glTexImage2D(
1108 GL_TEXTURE_2D,
1109 0,
1110 # if defined(SFML_VERSION_MAJOR) && SFML_VERSION_MAJOR <= 2 && SFML_VERSION_MINOR <= 4
1111 // gamma correction unsupported so load the texture as a raw sRGB image (physically incorrect)
1112 GL_SRGB8_ALPHA8,
1113 # else
1114 // gamma correction supported (physically correct)
1115 GL_RGBA8,
1116 # endif
1117 width,
1118 height,
1119 0,
1120 pixfmts[ channels - 1 ],
1121 GL_UNSIGNED_BYTE,
1122 data
1123 );
1124 if( mipmap ) glGenerateMipmap( GL_TEXTURE_2D );
1125
1126 tex.success = true;
1127 tex.width = width;
1128 tex.height = height;
1129 tex.channels = channels;
1130 tex.mipmap = mipmap;
1131 tex.type = GL_TEXTURE_2D;
1132
1133 return tex;
1134 }
1135
1136 Texture loadCubemap( std::vector<GLvoid*> faces, GLsizei width, GLsizei height, unsigned int channels, bool mipmap = true, bool filter = true ){
1137 Texture tex = newTexture;
1138 if( faces.size() != 6 ) return tex;
1139
1140 // To retain compatibility with both WebGL and OpenGL 4, single-channel textures only come in red.
1141 GLenum pixfmts[] = {
1142 GL_RED,
1143 GL_RG,
1144 GL_RGB,
1145 GL_RGBA
1146 };
1147
1148 glGenTextures( 1, &tex.texture );
1149 glBindTexture( GL_TEXTURE_CUBE_MAP, tex.texture );
1150
1151 glTexParameteri( GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
1152 glTexParameteri( GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
1153 glTexParameteri( GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE );
1154
1155 glTexParameteri(
1156 GL_TEXTURE_CUBE_MAP,
1157 GL_TEXTURE_MIN_FILTER,
1158 mipmap ? ( filter ? GL_LINEAR_MIPMAP_LINEAR : GL_NEAREST_MIPMAP_LINEAR ) : ( filter ? GL_LINEAR : GL_NEAREST )
1159 );
1160 glTexParameteri( GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, filter ? GL_LINEAR : GL_NEAREST );
1161
1162 if( channels < 3 ){
1163 glTexParameteri( GL_TEXTURE_CUBE_MAP, GL_TEXTURE_SWIZZLE_G, GL_RED );
1164 glTexParameteri( GL_TEXTURE_CUBE_MAP, GL_TEXTURE_SWIZZLE_B, GL_RED );
1165 glTexParameteri( GL_TEXTURE_CUBE_MAP, GL_TEXTURE_SWIZZLE_A, channels == 2 ? GL_GREEN : GL_ONE );
1166 }
1167
1168 unsigned int pitch = width * channels;
1169 glPixelStorei(
1170 GL_UNPACK_ALIGNMENT,
1171 pitch % 8 == 0 ? 8 // most efficient
1172 : ( pitch % 4 == 0 ? 4 // common value
1173 : ( pitch % 2 == 0 ? 2 // dubious efficiency
1174 : 1 // least efficient
1175 ) ) );
1176
1177 for( unsigned int i = 0; i < 6; i++ )
1178 glTexImage2D(
1179 GL_TEXTURE_CUBE_MAP_POSITIVE_X + i,
1180 0,
1181 # if defined(SFML_VERSION_MAJOR) && SFML_VERSION_MAJOR <= 2 && SFML_VERSION_MINOR <= 4
1182 // gamma correction unsupported so load the texture as a raw sRGB image (physically incorrect)
1183 GL_SRGB8_ALPHA8,
1184 # else
1185 // gamma correction supported (physically correct)
1186 GL_RGBA8,
1187 # endif
1188 width,
1189 height,
1190 0,
1191 pixfmts[channels - 1],
1192 GL_UNSIGNED_BYTE,
1193 faces[i]
1194 );
1195
1196 if( mipmap ) glGenerateMipmap( GL_TEXTURE_CUBE_MAP );
1197
1198 tex.success = true;
1199 tex.width = width;
1200 tex.height = height;
1201 tex.channels = channels;
1202 tex.mipmap = mipmap;
1203 tex.type = GL_TEXTURE_CUBE_MAP;
1204
1205 return tex;
1206 }
1207
1208 void freeTexture( Texture &tex ){
1209 glDeleteTextures( 1, &tex.texture );
1210 tex = newTexture;
1211 }
1212
1213 void updateTexture( Texture &tex, const GLvoid* data ){
1214 GLenum pixfmts[] = {
1215 GL_RED,
1216 GL_RG,
1217 GL_RGB,
1218 GL_RGBA
1219 };
1220
1221 glBindTexture( GL_TEXTURE_2D, tex.texture );
1222
1223 glTexSubImage2D(
1224 GL_TEXTURE_2D,
1225 0,
1226 0,
1227 0,
1228 tex.width,
1229 tex.height,
1230 pixfmts[ tex.channels - 1 ],
1231 GL_UNSIGNED_BYTE,
1232 data
1233 );
1234 if( tex.mipmap ) glGenerateMipmap( GL_TEXTURE_2D );
1235 }
1236
1237 void updateCubemap( Texture &tex, std::vector<GLvoid*> faces ){
1238 if( faces.size() != 6 ) return;
1239
1240 GLenum pixfmts[] = {
1241 GL_RED,
1242 GL_RG,
1243 GL_RGB,
1244 GL_RGBA
1245 };
1246
1247 glBindTexture( GL_TEXTURE_CUBE_MAP, tex.texture );
1248
1249 for( unsigned int i = 0; i < 6; i++ )
1250 glTexSubImage2D(
1251 GL_TEXTURE_CUBE_MAP_POSITIVE_X + i,
1252 0,
1253 0,
1254 0,
1255 tex.width,
1256 tex.height,
1257 pixfmts[ tex.channels - 1 ],
1258 GL_UNSIGNED_BYTE,
1259 faces[i]
1260 );
1261 if( tex.mipmap ) glGenerateMipmap( GL_TEXTURE_CUBE_MAP );
1262 }
1263
1264 void updateCubemapFace( Texture &tex, const GLvoid* data, unsigned int face ){
1265 // Faces can be indexed with either integers 0-5 or OpenGL enums.
1266 face %= GL_TEXTURE_CUBE_MAP_POSITIVE_X;
1267
1268 GLenum pixfmts[] = {
1269 GL_RED,
1270 GL_RG,
1271 GL_RGB,
1272 GL_RGBA
1273 };
1274
1275 glBindTexture( GL_TEXTURE_CUBE_MAP, tex.texture );
1276
1277 glTexSubImage2D(
1278 face,
1279 0,
1280 0,
1281 0,
1282 tex.width,
1283 tex.height,
1284 pixfmts[ tex.channels - 1 ],
1285 GL_UNSIGNED_BYTE,
1286 data
1287 );
1288 if( tex.mipmap ) glGenerateMipmap( GL_TEXTURE_CUBE_MAP );
1289 }
1290
1291 void setTexture( Texture tex, GLuint texSlot ){
1292 if( tex.success ){
1293 glActiveTexture( GL_TEXTURE0 + texSlot );
1294 glBindTexture( tex.type, tex.texture );
1295 }
1296 }
1297
1298 void setFog( Color col ){
1299 glUniform4f( drawPipeline.u_fog, col.r, col.g, col.b, col.a );
1300 fogColor = col;
1301 }
1302
1303 void setMetallicFactor( GLfloat f ){
1304 glUniform1f( drawPipeline.u_metallicFactor, f );
1305 }
1306
1307 void setRoughnessFactor( GLfloat f ){
1308 glUniform1f( drawPipeline.u_roughnessFactor, f );
1309 }
1310
1311 void setPipeline( Pipeline pipeline ){
1312 if( pipeline.success ){
1313 glUseProgram( pipeline.programObject );
1314 drawPipeline = pipeline;
1315 glUniform4f( drawPipeline.u_fog, fogColor.r, fogColor.g, fogColor.b, fogColor.a );
1316 // Bind the sampler locations.
1317 for( size_t i = 0; i < pipeline.slots.size(); i++ )
1318 glUniform1i( pipeline.slots[i], i );
1319 }
1320 }
1321
1322 Pipeline getPipeline(){
1323 return drawPipeline;
1324 }
1325
1326 void setTextureMatrix( linalg::mat<double,4,4> texMat ){
1327 texMatrix = texMat;
1328 }
1329
1330 void setLightMatrix( linalg::mat<double,4,4> lightMat ){
1331 lightMatrix = lightMat;
1332 }
1333
1334 Framebuffer createFramebuffer( GLsizei width, GLsizei height, bool cubemap = false, GLenum internalFmt = GL_RGB, GLsizei multisample = 0 ){
1335 // https://stackoverflow.com/questions/46535341
1336 // This framebuffer API does not currently support mipmapping.
1337
1338 Framebuffer fb = newFramebuffer;
1339 glGenFramebuffers( 1, &fb.fbo );
1340 glBindFramebuffer( GL_FRAMEBUFFER, fb.fbo );
1341
1342 fb.texture_type = cubemap ? GL_TEXTURE_CUBE_MAP
1343 : ( multisample > 0 ? GL_TEXTURE_2D_MULTISAMPLE : GL_TEXTURE_2D );
1344 fb.texture_fmt = internalFmt;
1345 glGenTextures( 1, &fb.texture );
1346 glBindTexture( fb.texture_type, fb.texture );
1347
1348 GLenum format, pixType;
1349 if( internalFmt == GL_RGB ){
1350 format = GL_RGB;
1351 pixType = GL_UNSIGNED_BYTE;
1352 }else if( internalFmt == GL_RG16F ){
1353 format = GL_RG;
1354 pixType = GL_HALF_FLOAT;
1355 }else if( internalFmt == GL_RGB16F ){
1356 format = GL_RGB;
1357 pixType = GL_HALF_FLOAT;
1358 }else if( internalFmt == GL_RG32F ){
1359 format = GL_RG;
1360 pixType = GL_FLOAT;
1361 }else if( internalFmt == GL_RGB32F ){
1362 format = GL_RGB;
1363 pixType = GL_FLOAT;
1364 }else{
1365 fprintf( stderr, "Unrecognized internalFmt. Using GL_RGB.\n" );
1366 internalFmt = GL_RGB;
1367 format = GL_RGB;
1368 pixType = GL_UNSIGNED_BYTE;
1369 }
1370
1371 if( cubemap ){
1372 // Create 6 blank faces.
1373 for( unsigned int i = 0; i < 6; i++ ){
1374 glTexImage2D(
1375 GL_TEXTURE_CUBE_MAP_POSITIVE_X + i,
1376 0,
1377 internalFmt,
1378 width,
1379 height,
1380 0,
1381 format,
1382 pixType,
1383 nullptr
1384 );
1385 glFramebufferTexture2D(
1386 GL_FRAMEBUFFER,
1387 GL_COLOR_ATTACHMENT0,
1388 GL_TEXTURE_CUBE_MAP_POSITIVE_X + i,
1389 fb.texture,
1390 0
1391 );
1392 }
1393 glTexParameteri( fb.texture_type, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE );
1394 }else{
1395 // Create a blank surface.
1396 if( fb.texture_type == GL_TEXTURE_2D_MULTISAMPLE ){
1397 glTexImage2DMultisample( GL_TEXTURE_2D_MULTISAMPLE, multisample, internalFmt, width, height, GL_TRUE );
1398 }else{
1399 glTexImage2D( GL_TEXTURE_2D, 0, internalFmt, width, height, 0, format, pixType, nullptr );
1400 }
1401 glFramebufferTexture2D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, fb.texture_type, fb.texture, 0 );
1402 }
1403
1404 if( multisample == 0 ){
1405 glTexParameteri( fb.texture_type, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
1406 glTexParameteri( fb.texture_type, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
1407 glTexParameteri( fb.texture_type, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
1408 glTexParameteri( fb.texture_type, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
1409 }
1410
1411 // Unbind the texture.
1412 glBindTexture( fb.texture_type, 0 );
1413
1414 if( cubemap || fb.texture_type == GL_TEXTURE_2D_MULTISAMPLE ){
1415 // Cubemap depth textures are unsupported.
1416 fb.texture_z = 0;
1417 // Create a depth renderbuffer.
1418 glGenRenderbuffers( 1, &fb.rbo );
1419 glBindRenderbuffer( GL_RENDERBUFFER, fb.rbo );
1420 if( fb.texture_type == GL_TEXTURE_2D_MULTISAMPLE ){
1421 glRenderbufferStorageMultisample( GL_RENDERBUFFER, multisample, GL_DEPTH_COMPONENT16, width, height );
1422 }else{
1423 glRenderbufferStorage( GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, width, height );
1424 }
1425 glFramebufferRenderbuffer( GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, fb.rbo );
1426 }else{
1427 fb.rbo = 0;
1428 // Create a depth texture.
1429 glGenTextures( 1, &fb.texture_z );
1430 glBindTexture( fb.texture_type, fb.texture_z );
1431 glTexImage2D( fb.texture_type, 0, GL_DEPTH_COMPONENT16, width, height, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, nullptr );
1432 glFramebufferTexture2D( GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, fb.texture_type, fb.texture_z, 0 );
1433 glTexParameteri( fb.texture_type, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
1434 glTexParameteri( fb.texture_type, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
1435 glTexParameteri( fb.texture_type, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
1436 glTexParameteri( fb.texture_type, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
1437 // Unbind the texture.
1438 glBindTexture( fb.texture_type, 0 );
1439 }
1440
1441 auto status = glCheckFramebufferStatus( GL_FRAMEBUFFER );
1442 fb.success = status == GL_FRAMEBUFFER_COMPLETE;
1443 if( !fb.success ){
1444 fprintf( stderr, "createFramebuffer failed. multisample: %d status: %d\n", multisample, (int)status );
1445 }
1446
1447 GLenum glerr;
1448 while( ( glerr = glGetError() ) != GL_NO_ERROR ){
1449 fprintf( stderr, "OpenGL error: %d\n", (int)glerr );
1450 }
1451
1452 fb.width = width;
1453 fb.height = height;
1454 fb.multisample = multisample;
1455 return fb;
1456 }
1457
1458 void resizeFramebuffer( Framebuffer &fb, GLsizei width, GLsizei height, GLsizei multisample = 0 ){
1459 // Only resize if necessary.
1460 if( fb.width == width && fb.height == height
1461 && fb.multisample == multisample ){
1462 return;
1463 }
1464
1465 glBindFramebuffer( GL_FRAMEBUFFER, fb.fbo );
1466
1467 glBindTexture( fb.texture_type, fb.texture );
1468
1469 GLenum format, pixType;
1470 if( fb.texture_fmt == GL_RG16F ){
1471 format = GL_RG;
1472 pixType = GL_HALF_FLOAT;
1473 }else if( fb.texture_fmt == GL_RGB16F ){
1474 format = GL_RGB;
1475 pixType = GL_HALF_FLOAT;
1476 }else if( fb.texture_fmt == GL_RG32F ){
1477 format = GL_RG;
1478 pixType = GL_FLOAT;
1479 }else if( fb.texture_fmt == GL_RGB32F ){
1480 format = GL_RGB;
1481 pixType = GL_FLOAT;
1482 }else{
1483 format = GL_RGB;
1484 pixType = GL_UNSIGNED_BYTE;
1485 }
1486
1487 if( fb.texture_type == GL_TEXTURE_CUBE_MAP ){
1488 // Resize the 6 faces.
1489 for( unsigned int i = 0; i < 6; i++ ){
1490 glTexImage2D(
1491 GL_TEXTURE_CUBE_MAP_POSITIVE_X + i,
1492 0,
1493 fb.texture_fmt,
1494 width,
1495 height,
1496 0,
1497 format,
1498 pixType,
1499 nullptr
1500 );
1501 }
1502 }else{
1503 // Resize the texture.
1504 if( fb.texture_type == GL_TEXTURE_2D_MULTISAMPLE ){
1505 glTexImage2DMultisample( GL_TEXTURE_2D_MULTISAMPLE, multisample, fb.texture_fmt, width, height, GL_TRUE );
1506 }else{
1507 glTexImage2D( GL_TEXTURE_2D, 0, fb.texture_fmt, width, height, 0, format, pixType, nullptr );
1508 }
1509 }
1510
1511 // Unbind the texture.
1512 glBindTexture( fb.texture_type, 0 );
1513
1514 if( fb.texture_type == GL_TEXTURE_CUBE_MAP
1515 || fb.texture_type == GL_TEXTURE_2D_MULTISAMPLE ){
1516 // Replace the depth renderbuffer.
1517 glDeleteRenderbuffers( 1, &fb.rbo );
1518 glGenRenderbuffers( 1, &fb.rbo );
1519 glBindRenderbuffer( GL_RENDERBUFFER, fb.rbo );
1520 if( fb.texture_type == GL_TEXTURE_2D_MULTISAMPLE ){
1521 glRenderbufferStorageMultisample( GL_RENDERBUFFER, multisample, GL_DEPTH_COMPONENT16, width, height );
1522 }else{
1523 glRenderbufferStorage( GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, width, height );
1524 }
1525 glFramebufferRenderbuffer( GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, fb.rbo );
1526 }else{
1527 // Resize the depth texture.
1528 glBindTexture( fb.texture_type, fb.texture_z );
1529 glTexImage2D( fb.texture_type, 0, GL_DEPTH_COMPONENT16, width, height, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, nullptr );
1530 // Unbind the texture.
1531 glBindTexture( fb.texture_type, 0 );
1532 }
1533
1534 fb.success = glCheckFramebufferStatus( GL_FRAMEBUFFER ) == GL_FRAMEBUFFER_COMPLETE;
1535 fb.width = width;
1536 fb.height = height;
1537 fb.multisample = multisample;
1538 }
1539
1540 Texture getFramebufferTexture( Framebuffer &fb ){
1541 Texture tex = newTexture;
1542 tex.success = fb.success;
1543 tex.texture = fb.texture;
1544 tex.width = fb.width;
1545 tex.height = fb.height;
1546 tex.channels = 4;
1547 tex.mipmap = false; // TODO: mipmapping
1548 tex.type = fb.texture_type;
1549 return tex;
1550 }
1551
1552 // Used by setFramebuffer
1553 Display getDisplay();
1554
1555 void setFramebuffer( Framebuffer fb = newFramebuffer ){
1556 // Set the drawing target to the framebuffer or the screen.
1557 if( fb.success ){
1558 glBindFramebuffer( GL_FRAMEBUFFER, fb.fbo );
1559 glViewport( 0, 0, fb.width, fb.height );
1560 }else{
1561 glBindFramebuffer( GL_FRAMEBUFFER, 0 );
1562 auto disp = getDisplay();
1563 glViewport( 0, 0, disp.width, disp.height );
1564 }
1565 }
1566
1567 void drawFramebuffer( Framebuffer &fb, bool draw_z = false ){
1568 if( !fb.success ) return;
1569 if( fb.texture_type == GL_TEXTURE_2D_MULTISAMPLE ){
1570 // Blit and rely on OpenGL to resolve samples.
1571 glBindFramebuffer( GL_READ_FRAMEBUFFER, fb.fbo );
1572 glBlitFramebuffer(
1573 0, 0, fb.width, fb.height, // source
1574 0, 0, fb.width, fb.height, // destination
1575 GL_COLOR_BUFFER_BIT,
1576 GL_NEAREST
1577 );
1578 }else{
1579 // Draw using a shader.
1580 glDisable( GL_DEPTH_TEST );
1581 glDisable( GL_CULL_FACE );
1582 glActiveTexture( GL_TEXTURE0 );
1583 glBindTexture( fb.texture_type, draw_z ? fb.texture_z : fb.texture );
1584 texMatrix = linalg::identity;
1585 // Stretch to screen bounds and flip vertically.
1586 drawMesh(
1587 planeMesh,
1588 linalg::scaling_matrix( linalg::vec<double,3>( 2.0, -2.0, 0.0 ) ),
1589 linalg::identity,
1590 linalg::identity
1591 );
1592 glEnable( GL_DEPTH_TEST );
1593 glEnable( GL_CULL_FACE );
1594 }
1595 }
1596
1597 Framebuffer getIrradianceFramebuffer( Texture in_cubemap, Framebuffer fb = newFramebuffer ){
1598 if( !fb.success ) fb = createFramebuffer( 32, 32, true );
1599 setFramebuffer( fb );
1600
1601 // Degrees to radians.
1602 const double d2r = 0.01745329251994329577;
1603
1604 linalg::vec<double,3> viewAngles[] = {
1605 { 0.0, -90.0, 180.0 }, // Right
1606 { 0.0, 90.0, 180.0 }, // Left
1607 { 90.0, 0.0, 0.0 }, // Top
1608 { -90.0, 0.0, 0.0 }, // Bottom
1609 { 0.0, 180.0, 180.0 }, // Back
1610 { 0.0, 0.0, 180.0 } // Front
1611 };
1612
1613 linalg::mat<double,4,4> projMat = linalg::perspective_matrix( 90.0 * d2r, 1.0, 0.1, 10.0 );
1614
1615 auto old_pipeline = drawPipeline;
1616 setPipeline( irradiancePipeline );
1617 glDisable( GL_CULL_FACE );
1618 setTexture( in_cubemap, 0 );
1619
1620 for( unsigned int i = 0; i < 6; i++ ){
1621 glFramebufferTexture2D(
1622 GL_FRAMEBUFFER,
1623 GL_COLOR_ATTACHMENT0,
1624 GL_TEXTURE_CUBE_MAP_POSITIVE_X + i,
1625 fb.texture,
1626 0
1627 );
1628 glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
1629 drawMesh(
1630 cubeMesh,
1631 linalg::identity,
1632 linalg::rotation_matrix(
1633 eulerToQuat(
1634 viewAngles[i].x * d2r,
1635 viewAngles[i].y * d2r,
1636 viewAngles[i].z * d2r
1637 )
1638 ),
1639 projMat
1640 );
1641 }
1642
1643 setFramebuffer();
1644 setPipeline( old_pipeline );
1645 glEnable( GL_CULL_FACE );
1646 return fb;
1647 }
1648
1649 void drawSkybox( Texture &tex, linalg::mat<double,4,4> view, linalg::mat<double,4,4> proj, Color tint = newColor ){
1650 if( !skyboxPipeline.success ) return;
1651 auto old_pipeline = drawPipeline;
1652 setPipeline( skyboxPipeline );
1653 glUniform4f( drawPipeline.u_fog, tint.r, tint.g, tint.b, tint.a );
1654 glDisable( GL_CULL_FACE );
1655 setTexture( tex, 0 );
1656 // Extract the 3x3 rotation matrix from the view matrix.
1657 // The camera is effectively at <0,0,0> with the skybox.
1658 drawMesh(
1659 cubeMesh,
1660 linalg::identity,
1661 linalg::mat<double,4,4>(
1662 { view[0][0], view[0][1], view[0][2], 0.0 },
1663 { view[1][0], view[1][1], view[1][2], 0.0 },
1664 { view[2][0], view[2][1], view[2][2], 0.0 },
1665 { 0.0, 0.0, 0.0, 1.0 }
1666 ),
1667 proj
1668 );
1669 glUniform4f( drawPipeline.u_fog, fogColor.r, fogColor.g, fogColor.b, fogColor.a );
1670 setPipeline( old_pipeline );
1671 glEnable( GL_CULL_FACE );
1672 }
1673
1674 int compileShader( GLuint shader ){
1675 glCompileShader( shader );
1676 GLint compiled;
1677 glGetShaderiv( shader, GL_COMPILE_STATUS, &compiled );
1678 if( !compiled ){
1679 _ERROUT_ << "Failed to compile shader." << std::endl;
1680 GLint infoLen = 0;
1681 glGetShaderiv( shader, GL_INFO_LOG_LENGTH, &infoLen );
1682 if( infoLen > 1 ){
1683 GLchar* infoLog = new GLchar[infoLen];
1684 glGetShaderInfoLog( shader, infoLen, nullptr, infoLog );
1685 _ERROUT_ << infoLog << std::endl;
1686 delete[] infoLog;
1687 }
1688 glDeleteShader( shader );
1689 return 0;
1690 }
1691 GLint debugout;
1692 glGetShaderiv( shader, GL_SHADER_TYPE, &debugout );
1693 _VERBOUT_ << ( debugout == GL_VERTEX_SHADER ? "VERTEX SHADER" : "FRAGMENT SHADER" ) << std::endl;
1694 _VERBOUT_ << "Shader address: " << shader << std::endl;
1695 glGetShaderiv( shader, GL_SHADER_SOURCE_LENGTH, &debugout );
1696 _VERBOUT_ << "Shader source length: " << debugout << "\n" << std::endl;
1697 return 1;
1698 }
1699
1700 int linkProgram( GLuint programObject ){
1701 glLinkProgram( programObject );
1702 GLint infoLen = 0;
1703 GLint linked;
1704 glGetProgramiv( programObject, GL_LINK_STATUS, &linked );
1705 if( !linked ){
1706 _ERROUT_ << "Failed to link shader program." << std::endl;
1707 glGetProgramiv( programObject, GL_INFO_LOG_LENGTH, &infoLen );
1708 if( infoLen > 1 ){
1709 GLchar* infoLog = new GLchar[infoLen];
1710 glGetProgramInfoLog( programObject, infoLen, nullptr, infoLog );
1711 _ERROUT_ << infoLog << std::endl;
1712 delete[] infoLog;
1713 }
1714 glDeleteProgram( programObject );
1715 return 0;
1716 }
1717 _VERBOUT_ << "PROGRAM OBJECT" << std::endl;
1718 _VERBOUT_ << "Program object address: " << programObject << std::endl;
1719 GLint debugout;
1720 glGetProgramiv( programObject, GL_ATTACHED_SHADERS, &debugout );
1721 _VERBOUT_ << "Attached shaders: " << debugout << std::endl;
1722 glGetProgramiv( programObject, GL_ACTIVE_ATTRIBUTES, &debugout );
1723 _VERBOUT_ << "Active attributes: " << debugout << std::endl;
1724 glGetProgramiv( programObject, GL_ACTIVE_UNIFORMS, &debugout );
1725 _VERBOUT_ << "Active uniforms: " << debugout << std::endl;
1726
1727 glValidateProgram( programObject );
1728 glGetProgramiv( programObject, GL_VALIDATE_STATUS, &debugout );
1729 _VERBOUT_ << ( debugout == GL_TRUE ? "Program object is valid." : "Program object is not valid." ) << std::endl;
1730 glGetProgramiv( programObject, GL_INFO_LOG_LENGTH, &infoLen );
1731 if( infoLen > 1 ){
1732 GLchar* infoLog = new GLchar[infoLen];
1733 glGetProgramInfoLog( programObject, infoLen, nullptr, infoLog );
1734 _VERBOUT_ << infoLog << std::endl;
1735 delete[] infoLog;
1736 }
1737
1738 _VERBOUT_ << std::endl;
1739
1740 return 1;
1741 }
1742
1743 Pipeline loadPipeline( const GLchar* vertSrc, const GLchar* fragSrc, std::vector<std::string> samplers = {} ){
1744 Pipeline pipeline = newPipeline;
1745
1746 GLuint vert;
1747 if( ( vert = glCreateShader( GL_VERTEX_SHADER ) ) == 0 ) return pipeline;
1748 const GLchar* vertStrings[] = { shaderHeader, vertSrc };
1749 glShaderSource( vert, 2, vertStrings, nullptr );
1750 if( !compileShader( vert ) ) return pipeline;
1751
1752 GLuint frag;
1753 if( ( frag = glCreateShader( GL_FRAGMENT_SHADER ) ) == 0 ) return pipeline;
1754 const GLchar* fragStrings[] = { shaderHeader, fragSrc };
1755 glShaderSource( frag, 2, fragStrings, nullptr );
1756 if( !compileShader( frag ) ) return pipeline;
1757
1758 GLuint programObject;
1759 if( ( programObject = glCreateProgram() ) == 0 ) return pipeline;
1760 glAttachShader( programObject, vert );
1761 glAttachShader( programObject, frag );
1762
1763 if( !linkProgram( programObject ) ) return pipeline;
1764
1765 // https://stackoverflow.com/questions/39784072/is-there-garbage-collection-on-the-gpu
1766 // https://gamedev.stackexchange.com/questions/47910/after-a-succesful-gllinkprogram-should-i-delete-detach-my-shaders
1767 glDetachShader( programObject, vert );
1768 glDeleteShader( vert );
1769 glDetachShader( programObject, frag );
1770 glDeleteShader( frag );
1771
1772 pipeline.success = true;
1773 pipeline.programObject = programObject;
1774 pipeline.u_metallicFactor = glGetUniformLocation( programObject, "u_metallicFactor" );
1775 pipeline.u_roughnessFactor = glGetUniformLocation( programObject, "u_roughnessFactor" );
1776 pipeline.u_matrices = glGetUniformLocation( programObject, "u_matrices" );
1777 pipeline.u_fog = glGetUniformLocation( programObject, "u_fog" );
1778 pipeline.u_camera = glGetUniformLocation( programObject, "u_camera" );
1779
1780 // Add the sampler locations to be bound in setPipeline.
1781 for( size_t i = 0; i < samplers.size(); i++ )
1782 pipeline.slots.push_back( glGetUniformLocation( programObject, samplers[i].c_str() ) );
1783
1784 return pipeline;
1785 }
1786
1787 Display createDisplay( unsigned int width, unsigned int height, std::string title, int multisamples = 4, bool HiDPI = true, bool vsync = true ){
1788 // Opens a window with a GL context.
1789 // Display display = createDisplay( 800, 600, "Title" );
1790
1791 Display disp = newDisplay;
1792
1793 # ifdef SDL_MAJOR_VERSION
1794 if( SDL_Init( SDL_INIT_VIDEO | SDL_INIT_GAMECONTROLLER ) < 0 ){
1795 _ERROUT_ << "Failed to initialize SDL." << std::endl;
1796 return disp;
1797 }
1798 # endif
1799
1800 _VERBOUT_ << "Creating GL 3 window..." << std::endl;
1801
1802 # ifdef SDL_MAJOR_VERSION
1803 SDL_GL_LoadLibrary( nullptr );
1804 # ifdef GLAD_GL
1805 SDL_GL_SetAttribute( SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE );
1806 SDL_GL_SetAttribute( SDL_GL_CONTEXT_MAJOR_VERSION, 3 );
1807 SDL_GL_SetAttribute( SDL_GL_CONTEXT_MINOR_VERSION, 3 );
1808 # else // GLES
1809 SDL_GL_SetAttribute( SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES );
1810 SDL_GL_SetAttribute( SDL_GL_CONTEXT_MAJOR_VERSION, 3 );
1811 SDL_GL_SetAttribute( SDL_GL_CONTEXT_MINOR_VERSION, 0 );
1812 # endif
1813 SDL_GL_SetAttribute( SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, 1 );
1814 if( multisamples > 1 ){
1815 SDL_GL_SetAttribute( SDL_GL_MULTISAMPLEBUFFERS, 1 );
1816 SDL_GL_SetAttribute( SDL_GL_MULTISAMPLESAMPLES, multisamples );
1817 }
1818 if( width == 0 && height == 0 ){
1819 window = SDL_CreateWindow(
1820 title.c_str(),
1821 SDL_WINDOWPOS_UNDEFINED,
1822 SDL_WINDOWPOS_UNDEFINED,
1823 0,
1824 0,
1825 HiDPI ?
1826 ( SDL_WINDOW_FULLSCREEN_DESKTOP | SDL_WINDOW_OPENGL | SDL_WINDOW_ALLOW_HIGHDPI ) :
1827 ( SDL_WINDOW_FULLSCREEN_DESKTOP | SDL_WINDOW_OPENGL )
1828 );
1829 // a hack to return correct values for the display size
1830 int winw, winh;
1831 SDL_GetWindowSize( window, &winw, &winh );
1832 width = (unsigned int)winw;
1833 height = (unsigned int)winh;
1834 }else{
1835 window = SDL_CreateWindow(
1836 title.c_str(),
1837 SDL_WINDOWPOS_CENTERED,
1838 SDL_WINDOWPOS_CENTERED,
1839 width,
1840 height,
1841 HiDPI ?
1842 ( SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI ) :
1843 ( SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE )
1844 );
1845 }
1846 if( !window ){
1847 _ERROUT_ << "Failed to create GL window." << std::endl;
1848 return disp;
1849 }
1850 ctx = SDL_GL_CreateContext( window );
1851 if( !ctx ){
1852 _ERROUT_ << "Failed to create GL context." << std::endl;
1853 return disp;
1854 }
1855 if( vsync ){
1856 // Try to set up late swap tearing or vsync.
1857 if( SDL_GL_SetSwapInterval( -1 ) < 0 )
1858 if( SDL_GL_SetSwapInterval( 1 ) < 0 ) SDL_GL_SetSwapInterval( 0 );
1859 }else{
1860 // No vsync.
1861 SDL_GL_SetSwapInterval( 0 );
1862 }
1863
1864 windowID = SDL_GetWindowID( window );
1865
1866 # ifdef GLAD_GL
1867 int version = gladLoadGL( (GLADloadfunc)SDL_GL_GetProcAddress );
1868 # else // GLES
1869 int version = gladLoadGLES2( (GLADloadfunc)SDL_GL_GetProcAddress );
1870 # endif
1871
1872 // Avoid a segfault when keys are accessed before the first sync.
1873 keystates = SDL_GetKeyboardState( nullptr );
1874
1875 #ifndef __EMSCRIPTEN__
1876 // Attempt to load the controller database file.
1877 const char* mappings_file = "gamecontrollerdb.txt";
1878 if( SDL_GameControllerAddMappingsFromFile( mappings_file ) < 0 ){
1879 std::cerr << "Failed to load " << mappings_file << ": " << SDL_GetError() << std::endl;
1880 }
1881 #endif
1882
1883 // Open the first available controller.
1884 for( int i = 0; i < SDL_NumJoysticks(); i++ ){
1885 if( SDL_IsGameController( i ) ){
1886 controller = SDL_GameControllerOpen( i );
1887 if( controller ){
1888 break;
1889 }else{
1890 _ERROUT_ << "Failed to open game controller " << i << ": " << SDL_GetError() << std::endl;
1891 }
1892 }
1893 }
1894
1895 // SDL cannot fill in mouse position until the mouse moves
1896 # else // SFML
1897
1898 // SFML does not support GLES2+ yet. For GLES2+ you must use SDL.
1899 // ContextSettings: depthBufferBits, stencilBufferBits, msaaLevel, majorVersion, minorVersion, attributeFlags, sRgbCapable
1900 // https://www.sfml-dev.org/documentation/2.5.0/structsf_1_1ContextSettings.php
1901 sf::ContextSettings ctxSettings = sf::ContextSettings( 24, 8, multisamples, 3, 3, sf::ContextSettings::Core, true );
1902
1903 sf::VideoMode dMode = sf::VideoMode::getDesktopMode();
1904
1905 if( width == 0 && height == 0 ){
1906 width = dMode.width;
1907 height = dMode.height;
1908 window.create(
1909 sf::VideoMode( width, height, dMode.bitsPerPixel ),
1910 title,
1911 sf::Style::Fullscreen,
1912 ctxSettings
1913 );
1914 }else{
1915 window.create(
1916 sf::VideoMode( width, height, dMode.bitsPerPixel ),
1917 title,
1918 sf::Style::Default,
1919 ctxSettings
1920 );
1921 // center the window
1922 window.setPosition( sf::Vector2i( ( dMode.width - width ) / 2, ( dMode.height - height ) / 2 ) );
1923 }
1924
1925 if( !window.isOpen() ){
1926 _ERROUT_ << "Failed to create GL window." << std::endl;
1927 return disp;
1928 }
1929
1930 windowTitle = title;
1931 window.setVerticalSyncEnabled( vsync );
1932 window.setActive( true );
1933
1934 int version = gladLoadGL( sf::Context::getFunction );
1935
1936 // SFML relative mouse movement is based on mouse position, so getting the initial position is necessary
1937 sf::Vector2i mousePos = sf::Mouse::getPosition( window );
1938 mouseX = mousePos.x;
1939 mouseY = mousePos.y;
1940 # endif
1941
1942 if( version == 0 ){
1943 _ERROUT_ << "Failed to use extension loader." << std::endl;
1944 return disp;
1945 }
1946
1947 _VERBOUT_ << "Success!" << std::endl;
1948 _VERBOUT_ << "OpenGL vendor: " << glGetString( GL_VENDOR ) << std::endl;
1949 _VERBOUT_ << "OpenGL renderer: " << glGetString( GL_RENDERER ) << std::endl;
1950 _VERBOUT_ << "OpenGL version: " << glGetString( GL_VERSION ) << std::endl;
1951 _VERBOUT_ << "GLSL version: " << glGetString( GL_SHADING_LANGUAGE_VERSION ) << "\n" << std::endl;
1952
1953 glEnable( GL_MULTISAMPLE );
1954 glEnable( GL_CULL_FACE );
1955 glEnable( GL_DEPTH_TEST );
1956 glEnable( GL_TEXTURE_CUBE_MAP_SEAMLESS );
1957 glDepthFunc( GL_LEQUAL );
1958 glDepthMask( GL_TRUE );
1959 if( multisamples > 1 ) glEnable( GL_SAMPLE_ALPHA_TO_COVERAGE );
1960
1961 unlitPipeline = loadPipeline( unlitVert, unlitFrag, unlitSamplers );
1962 if( unlitPipeline.success ){
1963 _VERBOUT_ << "Unlit pipeline loaded successfully.\n" << std::endl;
1964 }else{
1965 _ERROUT_ << "Failed to load unlit pipeline.\n" << std::endl;
1966 return disp;
1967 }
1968 setPipeline( unlitPipeline );
1969
1970 colorModPipeline = loadPipeline( unlitVert, colorModFrag, colorModSamplers );
1971 if( colorModPipeline.success ){
1972 _VERBOUT_ << "Color mod pipeline loaded successfully.\n" << std::endl;
1973 }else{
1974 _ERROUT_ << "Failed to load color mod pipeline.\n" << std::endl;
1975 return disp;
1976 }
1977
1978 unlitInstancePipeline = loadPipeline( unlitInstanceVert, unlitInstanceFrag, unlitInstanceSamplers );
1979 if( unlitInstancePipeline.success ){
1980 _VERBOUT_ << "Unlit instance pipeline loaded successfully.\n" << std::endl;
1981 }else{
1982 _ERROUT_ << "Failed to load unlit instance pipeline.\n" << std::endl;
1983 return disp;
1984 }
1985
1986 skyboxPipeline = loadPipeline( skyboxVert, skyboxFrag, skyboxSamplers );
1987 if( skyboxPipeline.success ){
1988 _VERBOUT_ << "Skybox pipeline loaded successfully.\n" << std::endl;
1989 }else{
1990 _ERROUT_ << "Failed to load skybox pipeline.\n" << std::endl;
1991 }
1992
1993 irradiancePipeline = loadPipeline( skyboxVert, irradianceFrag, irradianceSamplers );
1994 if( irradiancePipeline.success ){
1995 _VERBOUT_ << "Irradiance pipeline loaded successfully.\n" << std::endl;
1996 }else{
1997 _ERROUT_ << "Failed to load irradiance pipeline.\n" << std::endl;
1998 }
1999
2000 unsigned char pixels[] = { 0xFF, 0xFF, 0xFF, 0xFF };
2001
2002 blankTexture = loadTexture( pixels, 2, 2, 1, false, false );
2003 if( blankTexture.success ){
2004 _VERBOUT_ << "Blank texture loaded successfully.\n" << std::endl;
2005 }else{
2006 _ERROUT_ << "Failed to load blank texture.\n" << std::endl;
2007 return disp;
2008 }
2009
2010 std::vector<Vertex> vertices;
2011 std::vector<Index> indices;
2012
2013 vertices = {
2014 { { -0.5, 0.5, 0.0 }, { 0.0, 0.0, 1.0 }, { 1.0, 0.0, 0.0 }, { 0.0, 0.0 } },
2015 { { -0.5, -0.5, 0.0 }, { 0.0, 0.0, 1.0 }, { 1.0, 0.0, 0.0 }, { 0.0, 1.0 } },
2016 { { 0.5, -0.5, 0.0 }, { 0.0, 0.0, 1.0 }, { 1.0, 0.0, 0.0 }, { 1.0, 1.0 } },
2017 { { 0.5, 0.5, 0.0 }, { 0.0, 0.0, 1.0 }, { 1.0, 0.0, 0.0 }, { 1.0, 0.0 } }
2018 };
2019
2020 indices = { 0, 1, 2, 2, 3, 0 };
2021
2022 planeMesh = loadMesh( vertices, indices );
2023 if( planeMesh.success ){
2024 _VERBOUT_ << "Plane mesh loaded successfully.\n" << std::endl;
2025 }else{
2026 _ERROUT_ << "Failed to load plane mesh.\n" << std::endl;
2027 return disp;
2028 }
2029
2030 vertices = {
2031 { { -0.5, 0.5, 0.5 }, { 0.0, 0.0, 1.0 }, { 1.0, 0.0, 0.0 }, { 0.0, 0.0 } },
2032 { { -0.5, -0.5, 0.5 }, { 0.0, 0.0, 1.0 }, { 1.0, 0.0, 0.0 }, { 0.0, 1.0 } },
2033 { { 0.5, -0.5, 0.5 }, { 0.0, 0.0, 1.0 }, { 1.0, 0.0, 0.0 }, { 1.0, 1.0 } },
2034 { { 0.5, 0.5, 0.5 }, { 0.0, 0.0, 1.0 }, { 1.0, 0.0, 0.0 }, { 1.0, 0.0 } },
2035 { { 0.5, 0.5, 0.5 }, { 1.0, 0.0, 0.0 }, { 0.0, 0.0, -1.0 }, { 0.0, 0.0 } },
2036 { { 0.5, -0.5, 0.5 }, { 1.0, 0.0, 0.0 }, { 0.0, 0.0, -1.0 }, { 0.0, 1.0 } },
2037 { { 0.5, -0.5, -0.5 }, { 1.0, 0.0, 0.0 }, { 0.0, 0.0, -1.0 }, { 1.0, 1.0 } },
2038 { { 0.5, 0.5, -0.5 }, { 1.0, 0.0, 0.0 }, { 0.0, 0.0, -1.0 }, { 1.0, 0.0 } },
2039 { { -0.5, 0.5, -0.5 }, { -1.0, 0.0, 0.0 }, { 0.0, 0.0, 1.0 }, { 0.0, 0.0 } },
2040 { { -0.5, -0.5, -0.5 }, { -1.0, 0.0, 0.0 }, { 0.0, 0.0, 1.0 }, { 0.0, 1.0 } },
2041 { { -0.5, -0.5, 0.5 }, { -1.0, 0.0, 0.0 }, { 0.0, 0.0, 1.0 }, { 1.0, 1.0 } },
2042 { { -0.5, 0.5, 0.5 }, { -1.0, 0.0, 0.0 }, { 0.0, 0.0, 1.0 }, { 1.0, 0.0 } },
2043 { { 0.5, 0.5, -0.5 }, { 0.0, 0.0, -1.0 }, { -1.0, 0.0, 0.0 }, { 0.0, 0.0 } },
2044 { { 0.5, -0.5, -0.5 }, { 0.0, 0.0, -1.0 }, { -1.0, 0.0, 0.0 }, { 0.0, 1.0 } },
2045 { { -0.5, -0.5, -0.5 }, { 0.0, 0.0, -1.0 }, { -1.0, 0.0, 0.0 }, { 1.0, 1.0 } },
2046 { { -0.5, 0.5, -0.5 }, { 0.0, 0.0, -1.0 }, { -1.0, 0.0, 0.0 }, { 1.0, 0.0 } },
2047 { { -0.5, 0.5, -0.5 }, { 0.0, 1.0, 0.0 }, { 1.0, 0.0, 0.0 }, { 1.0, 1.0 } },
2048 { { -0.5, 0.5, 0.5 }, { 0.0, 1.0, 0.0 }, { 1.0, 0.0, 0.0 }, { 1.0, 0.0 } },
2049 { { 0.5, 0.5, 0.5 }, { 0.0, 1.0, 0.0 }, { 1.0, 0.0, 0.0 }, { 0.0, 0.0 } },
2050 { { 0.5, 0.5, -0.5 }, { 0.0, 1.0, 0.0 }, { 1.0, 0.0, 0.0 }, { 0.0, 1.0 } },
2051 { { -0.5, -0.5, 0.5 }, { 0.0, -1.0, 0.0 }, { 1.0, 0.0, 0.0 }, { 0.0, 0.0 } },
2052 { { -0.5, -0.5, -0.5 }, { 0.0, -1.0, 0.0 }, { 1.0, 0.0, 0.0 }, { 0.0, 1.0 } },
2053 { { 0.5, -0.5, -0.5 }, { 0.0, -1.0, 0.0 }, { 1.0, 0.0, 0.0 }, { 1.0, 1.0 } },
2054 { { 0.5, -0.5, 0.5 }, { 0.0, -1.0, 0.0 }, { 1.0, 0.0, 0.0 }, { 1.0, 0.0 } }
2055 };
2056
2057 indices = {
2058 0, 1, 2, 2, 3, 0,
2059 4, 5, 6, 6, 7, 4,
2060 8, 9, 10, 10, 11, 8,
2061 12, 13, 14, 14, 15, 12,
2062 16, 17, 18, 18, 19, 16,
2063 20, 21, 22, 22, 23, 20
2064 };
2065
2066 cubeMesh = loadMesh( vertices, indices );
2067 if( cubeMesh.success ){
2068 _VERBOUT_ << "Cube mesh loaded successfully.\n" << std::endl;
2069 }else{
2070 _ERROUT_ << "Failed to load cube mesh.\n" << std::endl;
2071 return disp;
2072 }
2073
2074 disp.success = true;
2075 disp.width = width;
2076 disp.height = height;
2077 disp.title = title;
2078 return disp;
2079 }
2080
2081 #ifdef SDL_MAJOR_VERSION
2082
2083 Display getDisplay(){
2084 Display disp = newDisplay;
2085 int width, height;
2086 SDL_GetWindowSize( window, &width, &height );
2087 disp.success = width > 0 ? true : false;
2088 disp.width = (unsigned int)width;
2089 disp.height = (unsigned int)height;
2090 if( disp.success ) disp.title = SDL_GetWindowTitle( window );
2091 return disp;
2092 }
2093
2094 unsigned int getDisplayWidth(){
2095 int width;
2096 SDL_GetWindowSize( window, &width, nullptr );
2097 return (unsigned int)width;
2098 }
2099
2100 unsigned int getDisplayHeight(){
2101 int height;
2102 SDL_GetWindowSize( window, nullptr, &height );
2103 return (unsigned int)height;
2104 }
2105
2106 double deltaTime(){
2107 Uint64 last = now;
2108 now = SDL_GetPerformanceCounter();
2109 return ( now - last ) / (double)SDL_GetPerformanceFrequency();
2110 }
2111
2112 void syncEvents(){
2113 // Used for touch scaling.
2114 double screenWidth = getDisplayWidth(), screenHeight = getDisplayHeight();
2115 mouseMoveX = 0;
2116 mouseMoveY = 0;
2117 mouseWheel = 0;
2118 touchStart = false;
2119 textReturnStart = false;
2120 SDL_Event event;
2121 while( SDL_PollEvent( &event ) ){
2122 if( event.type == SDL_MOUSEMOTION ){
2123 mouseMoveX += event.motion.xrel;
2124 mouseMoveY += event.motion.yrel;
2125 mouseX = event.motion.x;
2126 mouseY = event.motion.y;
2127 }else if( event.type == SDL_MOUSEWHEEL ){
2128 mouseWheel = event.wheel.direction == SDL_MOUSEWHEEL_FLIPPED
2129 ? event.wheel.y * -1 : event.wheel.y;
2130 }else if( event.type == SDL_FINGERDOWN
2131 || event.type == SDL_FINGERMOTION ){
2132 // TODO: mouseMoveX, mouseMoveY
2133 mouseX = event.tfinger.x * screenWidth;
2134 mouseY = event.tfinger.y * screenHeight;
2135 touchPressure = event.tfinger.pressure;
2136 if( event.type == SDL_FINGERDOWN ) touchStart = true;
2137 }else if( event.type == SDL_FINGERUP ){
2138 touchPressure = 0.0f;
2139 }else if( event.type == SDL_QUIT ){
2140 SDL_GL_DeleteContext( ctx );
2141 SDL_DestroyWindow( window );
2142 SDL_Quit();
2143 exit( 0 );
2144 }else if( event.type == SDL_WINDOWEVENT
2145 && event.window.windowID == windowID
2146 && event.window.event == SDL_WINDOWEVENT_SIZE_CHANGED ){
2147 int width, height;
2148 SDL_GL_GetDrawableSize( window, &width, &height );
2149 glViewport( 0, 0, width, height );
2150 }else if( textInputEnabled && event.type == SDL_TEXTINPUT ){
2151 // Text input from keyboard or IME.
2152 textInputString += event.text.text;
2153 }else if( textInputEnabled && event.type == SDL_KEYDOWN
2154 && event.key.keysym.sym == SDLK_BACKSPACE
2155 && textInputString.length() > 0 ){
2156 // Backspace deletion.
2157 textInputString.pop_back();
2158 }else if( textInputEnabled && event.type == SDL_KEYDOWN
2159 && ( event.key.keysym.sym == SDLK_RETURN
2160 || event.key.keysym.sym == SDLK_KP_ENTER ) ){
2161 // For handling the Enter key during text input.
2162 textReturnStart = true;
2163 }
2164 }
2165 keystates = SDL_GetKeyboardState( nullptr );
2166 // Handle controller hotplugging.
2167 if( !controller || !SDL_GameControllerGetAttached( controller ) ){
2168 controller = nullptr;
2169 // Open the first available controller.
2170 for( int i = 0; i < SDL_NumJoysticks(); i++ ){
2171 if( SDL_IsGameController( i ) ){
2172 // Open the controller.
2173 controller = SDL_GameControllerOpen( i );
2174 if( controller ) break;
2175 }
2176 }
2177 }
2178 }
2179
2180 void sync(){
2181 SDL_GL_SwapWindow( window );
2182 syncEvents();
2183 }
2184
2185 void setTextInput( int x = 0, int y = 0, int w = 0, int h = 0 ){
2186 // https://wiki.libsdl.org/Tutorials/TextInput
2187 if( x || y || w || h ){
2188 if( !SDL_IsTextInputActive() )
2189 SDL_StartTextInput();
2190 textInputEnabled = true;
2191 textInputRect = { x, y, w, h };
2192 SDL_SetTextInputRect( &textInputRect );
2193 }else{
2194 if( SDL_IsTextInputActive() )
2195 SDL_StopTextInput();
2196 textInputEnabled = false;
2197 }
2198 }
2199
2200 int upKey(){
2201 return keystates[ SDL_SCANCODE_UP ];
2202 }
2203
2204 int downKey(){
2205 return keystates[ SDL_SCANCODE_DOWN ];
2206 }
2207
2208 int leftKey(){
2209 return keystates[ SDL_SCANCODE_LEFT ];
2210 }
2211
2212 int rightKey(){
2213 return keystates[ SDL_SCANCODE_RIGHT ];
2214 }
2215
2216 int shiftKey(){
2217 return keystates[ SDL_SCANCODE_LSHIFT ]
2218 || keystates[ SDL_SCANCODE_RSHIFT ];
2219 }
2220
2221 int enterKey(){
2222 return keystates[ SDL_SCANCODE_RETURN ]
2223 || keystates[ SDL_SCANCODE_KP_ENTER ];
2224 }
2225
2226 int escapeKey(){
2227 return keystates[ SDL_SCANCODE_ESCAPE ];
2228 }
2229
2230 int spaceKey(){
2231 return keystates[ SDL_SCANCODE_SPACE ];
2232 }
2233
2234 int charKey( char key ){
2235 if( key >= 'A' && key <= 'Z' ) key = key - 'A' + 'a';
2236 if( key >= 'a' && key <= 'z' ){
2237 return keystates[ key - 'a' + SDL_SCANCODE_A ];
2238 }else if( key >= '0' && key <= '9' ){
2239 key = key == '0' ? 9 : key - '1';
2240 return keystates[ key + SDL_SCANCODE_1 ] || keystates[ key + SDL_SCANCODE_KP_1 ];
2241 }
2242 return 0;
2243 }
2244
2245 int upPad(){
2246 return controller ?
2247 SDL_GameControllerGetButton( controller, SDL_CONTROLLER_BUTTON_DPAD_UP )
2248 : 0;
2249 }
2250
2251 int downPad(){
2252 return controller ?
2253 SDL_GameControllerGetButton( controller, SDL_CONTROLLER_BUTTON_DPAD_DOWN )
2254 : 0;
2255 }
2256
2257 int leftPad(){
2258 return controller ?
2259 SDL_GameControllerGetButton( controller, SDL_CONTROLLER_BUTTON_DPAD_LEFT )
2260 : 0;
2261 }
2262
2263 int rightPad(){
2264 return controller ?
2265 SDL_GameControllerGetButton( controller, SDL_CONTROLLER_BUTTON_DPAD_RIGHT )
2266 : 0;
2267 }
2268
2269 int selectButton(){
2270 return controller ?
2271 SDL_GameControllerGetButton( controller, SDL_CONTROLLER_BUTTON_BACK )
2272 : 0;
2273 }
2274
2275 int startButton(){
2276 return controller ?
2277 SDL_GameControllerGetButton( controller, SDL_CONTROLLER_BUTTON_START )
2278 : 0;
2279 }
2280
2281 int aButton(){
2282 return controller ?
2283 SDL_GameControllerGetButton( controller, SDL_CONTROLLER_BUTTON_A )
2284 : 0;
2285 }
2286
2287 int bButton(){
2288 return controller ?
2289 SDL_GameControllerGetButton( controller, SDL_CONTROLLER_BUTTON_B )
2290 : 0;
2291 }
2292
2293 int xButton(){
2294 return controller ?
2295 SDL_GameControllerGetButton( controller, SDL_CONTROLLER_BUTTON_X )
2296 : 0;
2297 }
2298
2299 int yButton(){
2300 return controller ?
2301 SDL_GameControllerGetButton( controller, SDL_CONTROLLER_BUTTON_Y )
2302 : 0;
2303 }
2304
2305 int left1(){
2306 return controller ?
2307 SDL_GameControllerGetButton( controller, SDL_CONTROLLER_BUTTON_LEFTSHOULDER )
2308 : 0;
2309 }
2310
2311 int right1(){
2312 return controller ?
2313 SDL_GameControllerGetButton( controller, SDL_CONTROLLER_BUTTON_RIGHTSHOULDER )
2314 : 0;
2315 }
2316
2317 float left2(){
2318 return controller ?
2319 ( SDL_GameControllerGetAxis( controller, SDL_CONTROLLER_AXIS_TRIGGERLEFT ) / 32767.0f )
2320 : 0.0f;
2321 }
2322
2323 float right2(){
2324 return controller ?
2325 ( SDL_GameControllerGetAxis( controller, SDL_CONTROLLER_AXIS_TRIGGERRIGHT ) / 32767.0f )
2326 : 0.0f;
2327 }
2328
2329 int leftStick(){
2330 return controller ?
2331 SDL_GameControllerGetButton( controller, SDL_CONTROLLER_BUTTON_LEFTSTICK )
2332 : 0;
2333 }
2334
2335 int rightStick(){
2336 return controller ?
2337 SDL_GameControllerGetButton( controller, SDL_CONTROLLER_BUTTON_RIGHTSTICK )
2338 : 0;
2339 }
2340
2341 float leftStickX(){
2342 return controller ?
2343 ( SDL_GameControllerGetAxis( controller, SDL_CONTROLLER_AXIS_LEFTX ) / 32768.0f )
2344 : 0.0f;
2345 }
2346
2347 float leftStickY(){
2348 return controller ?
2349 ( SDL_GameControllerGetAxis( controller, SDL_CONTROLLER_AXIS_LEFTY ) / 32768.0f )
2350 : 0.0f;
2351 }
2352
2353 float rightStickX(){
2354 return controller ?
2355 ( SDL_GameControllerGetAxis( controller, SDL_CONTROLLER_AXIS_RIGHTX ) / 32768.0f )
2356 : 0.0f;
2357 }
2358
2359 float rightStickY(){
2360 return controller ?
2361 ( SDL_GameControllerGetAxis( controller, SDL_CONTROLLER_AXIS_RIGHTY ) / 32768.0f )
2362 : 0.0f;
2363 }
2364
2365 int mouseButton( int button ){
2366 if( button == 2 )
2367 button = 3;
2368 else if( button == 3 )
2369 button = 2;
2370 return SDL_GetMouseState( nullptr, nullptr ) & SDL_BUTTON( button ) ? 1 : 0;
2371 }
2372
2373 void showMouse( bool show ){
2374 SDL_ShowCursor( show ? SDL_ENABLE : SDL_DISABLE );
2375 }
2376
2377 void trapMouse( bool trap ){
2378 if( SDL_SetRelativeMouseMode( trap ? SDL_TRUE : SDL_FALSE ) > -1 ){
2379 mouseTrapped = trap;
2380 }else{
2381 mouseTrapped = false;
2382 }
2383 }
2384
2385 void end(){
2386 if( controller ){
2387 SDL_GameControllerClose( controller );
2388 }
2389 SDL_GL_DeleteContext( ctx );
2390 SDL_DestroyWindow( window );
2391 // TODO: Investigate why SDL_Quit segfaults in SDL 2.0.12.
2392 //SDL_Quit();
2393 exit( 0 );
2394 }
2395
2396 #else // SFML
2397
2398 Display getDisplay(){
2399 Display disp = newDisplay;
2400 sf::Vector2u winSize = window.getSize();
2401 disp.success = winSize.x > 0 ? true : false;
2402 disp.width = winSize.x;
2403 disp.height = winSize.y;
2404 if( disp.success ) disp.title = windowTitle;
2405 return disp;
2406 }
2407
2408 unsigned int getDisplayWidth(){
2409 return window.getSize().x;
2410 }
2411
2412 unsigned int getDisplayHeight(){
2413 return window.getSize().y;
2414 }
2415
2416 double deltaTime(){
2417 return clock.restart().asSeconds();
2418 }
2419
2420 void syncEvents(){
2421 mouseMoveX = 0;
2422 mouseMoveY = 0;
2423 mouseWheel = 0; // TODO: Mouse wheel.
2424 sf::Event event;
2425 while( window.pollEvent( event ) ){
2426 if( event.type == sf::Event::MouseMoved ){
2427 mouseMoveX += event.mouseMove.x - mouseX;
2428 mouseMoveY += event.mouseMove.y - mouseY;
2429 mouseX = event.mouseMove.x;
2430 mouseY = event.mouseMove.y;
2431 }else if( event.type == sf::Event::Closed ){
2432 window.close();
2433 exit( 0 );
2434 }
2435 }
2436 if( mouseTrapped ){
2437 sf::Vector2u winSize = window.getSize();
2438 mouseX = winSize.x / 2;
2439 mouseY = winSize.y / 2;
2440 sf::Mouse::setPosition( { mouseX, mouseY }, window );
2441 }
2442 }
2443
2444 void sync(){
2445 window.display();
2446 syncEvents();
2447 window.setActive( true );
2448 }
2449
2450 int upKey(){
2451 return ( window.hasFocus() && sf::Keyboard::isKeyPressed( sf::Keyboard::Up ) ) ? 1 : 0;
2452 }
2453
2454 int downKey(){
2455 return ( window.hasFocus() && sf::Keyboard::isKeyPressed( sf::Keyboard::Down ) ) ? 1 : 0;
2456 }
2457
2458 int leftKey(){
2459 return ( window.hasFocus() && sf::Keyboard::isKeyPressed( sf::Keyboard::Left ) ) ? 1 : 0;
2460 }
2461
2462 int rightKey(){
2463 return ( window.hasFocus() && sf::Keyboard::isKeyPressed( sf::Keyboard::Right ) ) ? 1 : 0;
2464 }
2465
2466 // TODO: SFML shiftKey() and enterKey().
2467
2468 int escapeKey(){
2469 return ( window.hasFocus() && sf::Keyboard::isKeyPressed( sf::Keyboard::Escape ) ) ? 1 : 0;
2470 }
2471
2472 int spaceKey(){
2473 return ( window.hasFocus() && sf::Keyboard::isKeyPressed( sf::Keyboard::Space ) ) ? 1 : 0;
2474 }
2475
2476 int charKey( char key ){
2477 if( window.hasFocus() ){
2478 if( key >= 'A' && key <= 'Z' ) key = key - 'A' + 'a';
2479 if( key >= 'a' && key <= 'z' ){
2480 return sf::Keyboard::isKeyPressed( key - 'a' + sf::Keyboard::A ) ? 1 : 0;
2481 }else if( key >= '0' && key <= '9' ){
2482 return ( sf::Keyboard::isKeyPressed( key - '0' + sf::Keyboard::Num0 ) ||
2483 sf::Keyboard::isKeyPressed( key - '0' + sf::Keyboard::Numpad0 ) ) ? 1 : 0;
2484 }
2485 }
2486 return 0;
2487 }
2488
2489 int mouseButton( int button ){
2490 return ( window.hasFocus() && sf::Mouse::isButtonPressed( sf::Mouse::Button( button - 1 ) ) ) ? 1 : 0;
2491 }
2492
2493 void showMouse( bool show ){
2494 window.setMouseCursorVisible( show );
2495 }
2496
2497 void trapMouse( bool trap ){
2498 window.setMouseCursorGrabbed( trap );
2499 mouseTrapped = trap;
2500 }
2501
2502 void end(){
2503 window.close();
2504 exit( 0 );
2505 }
2506
2507 #endif
2508
2509 #ifdef __STB_INCLUDE_STB_TRUETYPE_H__
2510
2511 void packFontRange( Font &font, int cpStart, int cpEnd ){
2512 if( !font.texture.success ) return;
2513 font.charStarts.push_back( cpStart );
2514 font.charEnds.push_back( cpEnd );
2515 int indexOffset = font.packedChars.size();
2516 int numChars = cpEnd - cpStart + 1;
2517 font.packedChars.resize( indexOffset + numChars );
2518 stbtt_PackFontRange(
2519 &font.pc,
2520 font.buffer.data(),
2521 0,
2522 STBTT_POINT_SIZE( font.size ),
2523 cpStart,
2524 numChars,
2525 &font.packedChars[ indexOffset ]
2526 );
2527 font.needSync = true;
2528 }
2529
2530 int getCharacterIndex( int cp, Font &font ){
2531 int cpTotal = 0;
2532 for( size_t i = 0; i < font.charStarts.size(); i++ ){
2533 int cpStart = font.charStarts[ i ];
2534 int cpEnd = font.charEnds[ i ];
2535 if( (int)cp >= cpStart && (int)cp <= cpEnd )
2536 return cp - cpStart + cpTotal;
2537 cpTotal += cpEnd - cpStart + 1;
2538 }
2539 // dynamic packing
2540 packFontRange( font, cp, cp );
2541 return getCharacterIndex( cp, font );
2542 }
2543
2544 Font loadFont( std::string fileName, float fontSize, int oversampleX, int oversampleY,
2545 bool prepack = true, int atlasWidth = 512, int atlasHeight = 512 ){
2546 Font font = newFont;
2547
2548 FILE* file = fopen( fileName.c_str(), "rb" );
2549 if( !file ){
2550 fprintf( stderr, "Failed to open %s\n\n", fileName.c_str() );
2551 return font;
2552 }
2553 font.buffer = {};
2554 unsigned char buf[4096];
2555 while( size_t len = fread( buf, 1, sizeof( buf ), file ) ){
2556 std::vector<unsigned char> buf_vector( buf, buf + len );
2557 font.buffer.insert(
2558 font.buffer.end(),
2559 buf_vector.begin(),
2560 buf_vector.end()
2561 );
2562 }
2563 fclose( file );
2564
2565 stbtt_InitFont( &font.info, font.buffer.data(), 0 );
2566
2567 font.size = fontSize;
2568
2569 // This may not be correct, but it works because Microsoft.
2570 int x0, y0, x1, y1;
2571 stbtt_GetFontBoundingBox( &font.info, &x0, &y0, &x1, &y1);
2572 font.height = (float)y1 * stbtt_ScaleForMappingEmToPixels( &font.info, font.size ) * 1.333f - 0.5f;
2573
2574 font.atlas.resize( atlasWidth * atlasHeight );
2575
2576 stbtt_PackBegin( &font.pc, font.atlas.data(), atlasWidth, atlasHeight, 0, 1, nullptr );
2577 stbtt_PackSetOversampling( &font.pc, oversampleX, oversampleY );
2578
2579 font.texture = loadTexture( font.atlas.data(), atlasWidth, atlasHeight, 1, false, true );
2580
2581 std::vector<Vertex> noVertices = {};
2582 std::vector<Index> noIndices = {};
2583 font.textMesh = loadMesh( noVertices, noIndices, true );
2584
2585 // ASCII
2586 if( prepack ){
2587 packFontRange( font, 32, 126 );
2588 updateTexture( font.texture, font.atlas.data() );
2589 }
2590
2591 return font;
2592 }
2593
2594 float getTextWidthUtf32( std::u32string codepoints, Font &font ){
2595 Texture &tex = font.texture;
2596 if( !tex.success ) return 0.0f;
2597 // for stb_truetype's automatic positioning
2598 float charX = 0.0f, charY = 0.0f;
2599 for( size_t i = 0; i < codepoints.length(); i++ ){
2600 auto cp = codepoints[ i ];
2601 int ci = getCharacterIndex( cp, font );
2602 stbtt_aligned_quad q;
2603 // integer positioning needs to be disabled for kerning to work properly
2604 stbtt_GetPackedQuad( font.packedChars.data(), tex.width, tex.height, ci, &charX, &charY, &q, 0 );
2605 // set the kern offset for the next character
2606 if( codepoints.length() - i > 1 )
2607 charX += ( q.s1 - q.s0 ) * stbtt_GetCodepointKernAdvance( &font.info, cp, codepoints[ i + 1 ] );
2608 }
2609 return charX;
2610 }
2611
2612 float getTextWidth( std::string text, Font &font ){
2613 if( !font.texture.success ) return 0.0f;
2614 return getTextWidthUtf32( utf8ToUtf32( text ), font );
2615 }
2616
2617 void drawTextUtf32( std::u32string codepoints, Font &font, float posX, float posY, float scale, int align = 0, float wordWrap = 0.0f ){
2618 // align modes -- 0: left, 1: center, 2: right
2619
2620 Texture &tex = font.texture;
2621 if( !tex.success ) return;
2622
2623 float leading = font.size * 1.2f;
2624 size_t wordStart = 0;
2625 float wordStartX = 0.0f;
2626
2627 // for stb_truetype's automatic positioning
2628 float charX = 0.0f, charY = 0.0f;
2629
2630 std::vector<Vertex> vertices;
2631 std::vector<Index> indices;
2632
2633 // buffer characters
2634 for( size_t i = 0; i < codepoints.length(); i++ ){
2635 auto cp = codepoints[ i ];
2636 // Get the font character index of codepoints >= 32 (space).
2637 // Don't print control characters.
2638 int ci = getCharacterIndex( cp < 32 ? 32 : cp, font );
2639
2640 stbtt_aligned_quad q;
2641 // integer positioning needs to be disabled for kerning to work properly
2642 stbtt_GetPackedQuad( font.packedChars.data(), tex.width, tex.height, ci, &charX, &charY, &q, 0 );
2643
2644 // set the kern offset for the next character
2645 if( codepoints.length() - i > 1 )
2646 charX += ( q.s1 - q.s0 ) * stbtt_GetCodepointKernAdvance( &font.info, cp, codepoints[ i + 1 ] );
2647
2648 // handle newlines and word wrapping
2649 if( cp == ' ' ){
2650 wordStart = i + 1;
2651 wordStartX = charX;
2652 }else if( cp == '\n' ){
2653 if( align == 0 ){ // Left-to-right alignment.
2654 wordStart = i + 1;
2655 wordStartX = charX;
2656 charX = 0.0f;
2657 charY += leading;
2658 }else{ // Other alignment.
2659 drawTextUtf32( codepoints.substr( i + 1 ), font, posX, posY + leading * scale, scale, align, wordWrap );
2660 break;
2661 }
2662 }else if( wordWrap > 0.0f && charX * scale > wordWrap && wordStart > 0 ){
2663 // re-align
2664 charX = wordStartX;
2665 // delete the last characters
2666 vertices.resize( ( wordStart - 1 ) * 4 );
2667 indices.resize( ( wordStart - 1 ) * 6 );
2668 drawTextUtf32( codepoints.substr( wordStart ), font, posX, posY + leading * scale, scale, align, wordWrap );
2669 break;
2670 }
2671
2672 // add the character to the vertex and index vectors
2673 Index idx = (Index)vertices.size();
2674 vertices.insert( vertices.end(), {
2675 { { q.x0, -q.y0, 0.0f },
2676 { 0.0f, 0.0f, 1.0f },
2677 { 1.0f, 0.0f, 0.0f },
2678 { q.s0, q.t0 } },
2679 { { q.x0, -q.y1, 0.0f },
2680 { 0.0f, 0.0f, 1.0f },
2681 { 1.0f, 0.0f, 0.0f },
2682 { q.s0, q.t1 } },
2683 { { q.x1, -q.y1, 0.0f },
2684 { 0.0f, 0.0f, 1.0f },
2685 { 1.0f, 0.0f, 0.0f },
2686 { q.s1, q.t1 } },
2687 { { q.x1, -q.y0, 0.0f },
2688 { 0.0f, 0.0f, 1.0f },
2689 { 1.0f, 0.0f, 0.0f },
2690 { q.s1, q.t0 } }
2691 } );
2692 indices.insert( indices.end(), {
2693 idx, idx + 1, idx + 2, idx + 2, idx + 3, idx
2694 } );
2695 }
2696
2697 if( font.needSync ){
2698 updateTexture( tex, font.atlas.data() );
2699 font.needSync = false;
2700 }
2701
2702 // copy old state
2703 linalg::mat<double,4,4> oldTexMatrix = texMatrix;
2704
2705 double screenWidth = getDisplayWidth(), screenHeight = getDisplayHeight();
2706 texMatrix = linalg::identity;
2707 setTexture( tex, 0 );
2708 updateMesh( font.textMesh, vertices, indices, true );
2709 posX += charX * scale * ( align == 0 ? 0.0f : ( align == 1 ? -0.5f : -1.0f ) );
2710 posY += font.size * scale;
2711 drawMesh(
2712 font.textMesh,
2713 linalg::mul(
2714 linalg::translation_matrix( linalg::vec<double,3>(
2715 -1.0 + posX * 2.0 / screenWidth,
2716 1.0 - posY * 2.0 / screenHeight,
2717 0.0
2718 ) ),
2719 linalg::scaling_matrix( linalg::vec<double,3>(
2720 2.0 / screenWidth * scale,
2721 2.0 / screenHeight * scale,
2722 1.0
2723 ) )
2724 ),
2725 linalg::identity,
2726 linalg::identity
2727 );
2728
2729 // restore old state
2730 texMatrix = oldTexMatrix;
2731 }
2732
2733 void drawText( std::string text, Font &font, float posX, float posY, float scale, int align = 0, float wordWrap = 0.0f ){
2734 // align modes -- 0: left, 1: center, 2: right
2735
2736 if( !font.texture.success ) return;
2737
2738 drawTextUtf32( utf8ToUtf32( text ), font, posX, posY, scale, align, wordWrap );
2739 }
2740
2741 #else
2742
2743 void packFontRange( Font &font, int cpStart, int cpEnd ){
2744 return;
2745 }
2746
2747 int getCharacterIndex( int cp, Font &font ){
2748 return 0;
2749 }
2750
2751 Font loadFont( std::string fileName, float fontSize, int oversampleX, int oversampleY,
2752 bool prepack = true, int atlasWidth = 512, int atlasHeight = 512 ){
2753 _ERROUT_ << "Include stb_truetype.h before fg3.h to load TrueType fonts.\n" << std::endl;
2754 return newFont;
2755 }
2756
2757 float getTextWidthUtf32( std::u32string codepoints, Font &font ){
2758 return 0.0f;
2759 }
2760
2761 float getTextWidth( std::string text, Font &font ){
2762 return 0.0f;
2763 }
2764
2765 void drawTextUtf32( std::u32string codepoints, Font &font, float posX, float posY, float scale, int align = 0, float wordWrap = 0.0f ){
2766 return;
2767 }
2768
2769 void drawText( std::string text, Font &font, float posX, float posY, float scale, int align = 0, float wordWrap = 0.0f ){
2770 return;
2771 }
2772
2773 #endif // __STB_INCLUDE_STB_TRUETYPE_H__
2774
2775 } // namespace fg3
2776
2777 #endif // FG3_H
File include/fg3/glad_gl.h added (mode: 100755) (index 0000000..d3ec405)
1 /**
2 * Loader generated by glad 2.0.0-beta on Wed Oct 3 12:25:32 2018
3 *
4 * Generator: C/C++
5 * Specification: gl
6 * Extensions: 0
7 *
8 * APIs:
9 * - gl:core=3.3
10 *
11 * Options:
12 * - MX_GLOBAL = False
13 * - LOADER = False
14 * - ALIAS = False
15 * - HEADER_ONLY = True
16 * - DEBUG = False
17 * - MX = False
18 *
19 * Commandline:
20 * --api='gl:core=3.3' --extensions='' c --header-only
21 *
22 * Online:
23 * http://glad.sh/#api=gl%3Acore%3D3.3&extensions=&generator=c&options=HEADER_ONLY
24 *
25 */
26
27 #ifndef GLAD_GL_H_
28 #define GLAD_GL_H_
29
30 #ifdef __gl_h_
31 #error OpenGL header already included (API: gl), remove previous include!
32 #endif
33 #define __gl_h_ 1
34
35
36 #define GLAD_GL
37 #define GLAD_OPTION_GL_HEADER_ONLY
38
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42
43 #ifndef GLAD_PLATFORM_H_
44 #define GLAD_PLATFORM_H_
45
46 #ifndef GLAD_PLATFORM_WIN32
47 #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__MINGW32__)
48 #define GLAD_PLATFORM_WIN32 1
49 #else
50 #define GLAD_PLATFORM_WIN32 0
51 #endif
52 #endif
53
54 #ifndef GLAD_PLATFORM_APPLE
55 #ifdef __APPLE__
56 #define GLAD_PLATFORM_APPLE 1
57 #else
58 #define GLAD_PLATFORM_APPLE 0
59 #endif
60 #endif
61
62 #ifndef GLAD_PLATFORM_EMSCRIPTEN
63 #ifdef __EMSCRIPTEN__
64 #define GLAD_PLATFORM_EMSCRIPTEN 1
65 #else
66 #define GLAD_PLATFORM_EMSCRIPTEN 0
67 #endif
68 #endif
69
70 #ifndef GLAD_PLATFORM_UWP
71 #if defined(_MSC_VER) && !defined(GLAD_INTERNAL_HAVE_WINAPIFAMILY)
72 #ifdef __has_include
73 #if __has_include(<winapifamily.h>)
74 #define GLAD_INTERNAL_HAVE_WINAPIFAMILY 1
75 #endif
76 #elif _MSC_VER >= 1700 && !_USING_V110_SDK71_
77 #define GLAD_INTERNAL_HAVE_WINAPIFAMILY 1
78 #endif
79 #endif
80
81 #ifdef GLAD_INTERNAL_HAVE_WINAPIFAMILY
82 #include <winapifamily.h>
83 #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
84 #define GLAD_PLATFORM_UWP 1
85 #endif
86 #endif
87
88 #ifndef GLAD_PLATFORM_UWP
89 #define GLAD_PLATFORM_UWP 0
90 #endif
91 #endif
92
93 #ifdef __GNUC__
94 #define GLAD_GNUC_EXTENSION __extension__
95 #else
96 #define GLAD_GNUC_EXTENSION
97 #endif
98
99 #ifndef GLAD_API_CALL
100 #if defined(GLAD_API_CALL_EXPORT)
101 #if GLAD_PLATFORM_WIN32 || defined(__CYGWIN__)
102 #if defined(GLAD_API_CALL_EXPORT_BUILD)
103 #if defined(__GNUC__)
104 #define GLAD_API_CALL __attribute__ ((dllexport)) extern
105 #else
106 #define GLAD_API_CALL __declspec(dllexport) extern
107 #endif
108 #else
109 #if defined(__GNUC__)
110 #define GLAD_API_CALL __attribute__ ((dllimport)) extern
111 #else
112 #define GLAD_API_CALL __declspec(dllimport) extern
113 #endif
114 #endif
115 #elif defined(__GNUC__) && defined(GLAD_API_CALL_EXPORT_BUILD)
116 #define GLAD_API_CALL __attribute__ ((visibility ("default"))) extern
117 #else
118 #define GLAD_API_CALL extern
119 #endif
120 #else
121 #define GLAD_API_CALL extern
122 #endif
123 #endif
124
125 #ifdef APIENTRY
126 #define GLAD_API_PTR APIENTRY
127 #elif GLAD_PLATFORM_WIN32
128 #define GLAD_API_PTR __stdcall
129 #else
130 #define GLAD_API_PTR
131 #endif
132
133 #ifndef GLAPI
134 #define GLAPI GLAD_API_CALL
135 #endif
136
137 #ifndef GLAPIENTRY
138 #define GLAPIENTRY GLAD_API_PTR
139 #endif
140
141
142 #define GLAD_MAKE_VERSION(major, minor) (major * 10000 + minor)
143 #define GLAD_VERSION_MAJOR(version) (version / 10000)
144 #define GLAD_VERSION_MINOR(version) (version % 10000)
145
146 typedef void (*GLADapiproc)(void);
147
148 typedef GLADapiproc (*GLADloadfunc)(const char *name);
149 typedef GLADapiproc (*GLADuserptrloadfunc)(const char *name, void *userptr);
150
151 typedef void (*GLADprecallback)(const char *name, GLADapiproc apiproc, int len_args, ...);
152 typedef void (*GLADpostcallback)(void *ret, const char *name, GLADapiproc apiproc, int len_args, ...);
153
154 #endif /* GLAD_PLATFORM_H_ */
155
156 #define GL_ACTIVE_ATTRIBUTES 0x8B89
157 #define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
158 #define GL_ACTIVE_TEXTURE 0x84E0
159 #define GL_ACTIVE_UNIFORMS 0x8B86
160 #define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36
161 #define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35
162 #define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
163 #define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
164 #define GL_ALPHA 0x1906
165 #define GL_ALREADY_SIGNALED 0x911A
166 #define GL_ALWAYS 0x0207
167 #define GL_AND 0x1501
168 #define GL_AND_INVERTED 0x1504
169 #define GL_AND_REVERSE 0x1502
170 #define GL_ANY_SAMPLES_PASSED 0x8C2F
171 #define GL_ARRAY_BUFFER 0x8892
172 #define GL_ARRAY_BUFFER_BINDING 0x8894
173 #define GL_ATTACHED_SHADERS 0x8B85
174 #define GL_BACK 0x0405
175 #define GL_BACK_LEFT 0x0402
176 #define GL_BACK_RIGHT 0x0403
177 #define GL_BGR 0x80E0
178 #define GL_BGRA 0x80E1
179 #define GL_BGRA_INTEGER 0x8D9B
180 #define GL_BGR_INTEGER 0x8D9A
181 #define GL_BLEND 0x0BE2
182 #define GL_BLEND_COLOR 0x8005
183 #define GL_BLEND_DST 0x0BE0
184 #define GL_BLEND_DST_ALPHA 0x80CA
185 #define GL_BLEND_DST_RGB 0x80C8
186 #define GL_BLEND_EQUATION 0x8009
187 #define GL_BLEND_EQUATION_ALPHA 0x883D
188 #define GL_BLEND_EQUATION_RGB 0x8009
189 #define GL_BLEND_SRC 0x0BE1
190 #define GL_BLEND_SRC_ALPHA 0x80CB
191 #define GL_BLEND_SRC_RGB 0x80C9
192 #define GL_BLUE 0x1905
193 #define GL_BLUE_INTEGER 0x8D96
194 #define GL_BOOL 0x8B56
195 #define GL_BOOL_VEC2 0x8B57
196 #define GL_BOOL_VEC3 0x8B58
197 #define GL_BOOL_VEC4 0x8B59
198 #define GL_BUFFER_ACCESS 0x88BB
199 #define GL_BUFFER_ACCESS_FLAGS 0x911F
200 #define GL_BUFFER_MAPPED 0x88BC
201 #define GL_BUFFER_MAP_LENGTH 0x9120
202 #define GL_BUFFER_MAP_OFFSET 0x9121
203 #define GL_BUFFER_MAP_POINTER 0x88BD
204 #define GL_BUFFER_SIZE 0x8764
205 #define GL_BUFFER_USAGE 0x8765
206 #define GL_BYTE 0x1400
207 #define GL_CCW 0x0901
208 #define GL_CLAMP_READ_COLOR 0x891C
209 #define GL_CLAMP_TO_BORDER 0x812D
210 #define GL_CLAMP_TO_EDGE 0x812F
211 #define GL_CLEAR 0x1500
212 #define GL_CLIP_DISTANCE0 0x3000
213 #define GL_CLIP_DISTANCE1 0x3001
214 #define GL_CLIP_DISTANCE2 0x3002
215 #define GL_CLIP_DISTANCE3 0x3003
216 #define GL_CLIP_DISTANCE4 0x3004
217 #define GL_CLIP_DISTANCE5 0x3005
218 #define GL_CLIP_DISTANCE6 0x3006
219 #define GL_CLIP_DISTANCE7 0x3007
220 #define GL_COLOR 0x1800
221 #define GL_COLOR_ATTACHMENT0 0x8CE0
222 #define GL_COLOR_ATTACHMENT1 0x8CE1
223 #define GL_COLOR_ATTACHMENT10 0x8CEA
224 #define GL_COLOR_ATTACHMENT11 0x8CEB
225 #define GL_COLOR_ATTACHMENT12 0x8CEC
226 #define GL_COLOR_ATTACHMENT13 0x8CED
227 #define GL_COLOR_ATTACHMENT14 0x8CEE
228 #define GL_COLOR_ATTACHMENT15 0x8CEF
229 #define GL_COLOR_ATTACHMENT16 0x8CF0
230 #define GL_COLOR_ATTACHMENT17 0x8CF1
231 #define GL_COLOR_ATTACHMENT18 0x8CF2
232 #define GL_COLOR_ATTACHMENT19 0x8CF3
233 #define GL_COLOR_ATTACHMENT2 0x8CE2
234 #define GL_COLOR_ATTACHMENT20 0x8CF4
235 #define GL_COLOR_ATTACHMENT21 0x8CF5
236 #define GL_COLOR_ATTACHMENT22 0x8CF6
237 #define GL_COLOR_ATTACHMENT23 0x8CF7
238 #define GL_COLOR_ATTACHMENT24 0x8CF8
239 #define GL_COLOR_ATTACHMENT25 0x8CF9
240 #define GL_COLOR_ATTACHMENT26 0x8CFA
241 #define GL_COLOR_ATTACHMENT27 0x8CFB
242 #define GL_COLOR_ATTACHMENT28 0x8CFC
243 #define GL_COLOR_ATTACHMENT29 0x8CFD
244 #define GL_COLOR_ATTACHMENT3 0x8CE3
245 #define GL_COLOR_ATTACHMENT30 0x8CFE
246 #define GL_COLOR_ATTACHMENT31 0x8CFF
247 #define GL_COLOR_ATTACHMENT4 0x8CE4
248 #define GL_COLOR_ATTACHMENT5 0x8CE5
249 #define GL_COLOR_ATTACHMENT6 0x8CE6
250 #define GL_COLOR_ATTACHMENT7 0x8CE7
251 #define GL_COLOR_ATTACHMENT8 0x8CE8
252 #define GL_COLOR_ATTACHMENT9 0x8CE9
253 #define GL_COLOR_BUFFER_BIT 0x00004000
254 #define GL_COLOR_CLEAR_VALUE 0x0C22
255 #define GL_COLOR_LOGIC_OP 0x0BF2
256 #define GL_COLOR_WRITEMASK 0x0C23
257 #define GL_COMPARE_REF_TO_TEXTURE 0x884E
258 #define GL_COMPILE_STATUS 0x8B81
259 #define GL_COMPRESSED_RED 0x8225
260 #define GL_COMPRESSED_RED_RGTC1 0x8DBB
261 #define GL_COMPRESSED_RG 0x8226
262 #define GL_COMPRESSED_RGB 0x84ED
263 #define GL_COMPRESSED_RGBA 0x84EE
264 #define GL_COMPRESSED_RG_RGTC2 0x8DBD
265 #define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC
266 #define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE
267 #define GL_COMPRESSED_SRGB 0x8C48
268 #define GL_COMPRESSED_SRGB_ALPHA 0x8C49
269 #define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
270 #define GL_CONDITION_SATISFIED 0x911C
271 #define GL_CONSTANT_ALPHA 0x8003
272 #define GL_CONSTANT_COLOR 0x8001
273 #define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002
274 #define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001
275 #define GL_CONTEXT_FLAGS 0x821E
276 #define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x00000001
277 #define GL_CONTEXT_PROFILE_MASK 0x9126
278 #define GL_COPY 0x1503
279 #define GL_COPY_INVERTED 0x150C
280 #define GL_COPY_READ_BUFFER 0x8F36
281 #define GL_COPY_WRITE_BUFFER 0x8F37
282 #define GL_CULL_FACE 0x0B44
283 #define GL_CULL_FACE_MODE 0x0B45
284 #define GL_CURRENT_PROGRAM 0x8B8D
285 #define GL_CURRENT_QUERY 0x8865
286 #define GL_CURRENT_VERTEX_ATTRIB 0x8626
287 #define GL_CW 0x0900
288 #define GL_DECR 0x1E03
289 #define GL_DECR_WRAP 0x8508
290 #define GL_DELETE_STATUS 0x8B80
291 #define GL_DEPTH 0x1801
292 #define GL_DEPTH24_STENCIL8 0x88F0
293 #define GL_DEPTH32F_STENCIL8 0x8CAD
294 #define GL_DEPTH_ATTACHMENT 0x8D00
295 #define GL_DEPTH_BUFFER_BIT 0x00000100
296 #define GL_DEPTH_CLAMP 0x864F
297 #define GL_DEPTH_CLEAR_VALUE 0x0B73
298 #define GL_DEPTH_COMPONENT 0x1902
299 #define GL_DEPTH_COMPONENT16 0x81A5
300 #define GL_DEPTH_COMPONENT24 0x81A6
301 #define GL_DEPTH_COMPONENT32 0x81A7
302 #define GL_DEPTH_COMPONENT32F 0x8CAC
303 #define GL_DEPTH_FUNC 0x0B74
304 #define GL_DEPTH_RANGE 0x0B70
305 #define GL_DEPTH_STENCIL 0x84F9
306 #define GL_DEPTH_STENCIL_ATTACHMENT 0x821A
307 #define GL_DEPTH_TEST 0x0B71
308 #define GL_DEPTH_WRITEMASK 0x0B72
309 #define GL_DITHER 0x0BD0
310 #define GL_DONT_CARE 0x1100
311 #define GL_DOUBLE 0x140A
312 #define GL_DOUBLEBUFFER 0x0C32
313 #define GL_DRAW_BUFFER 0x0C01
314 #define GL_DRAW_BUFFER0 0x8825
315 #define GL_DRAW_BUFFER1 0x8826
316 #define GL_DRAW_BUFFER10 0x882F
317 #define GL_DRAW_BUFFER11 0x8830
318 #define GL_DRAW_BUFFER12 0x8831
319 #define GL_DRAW_BUFFER13 0x8832
320 #define GL_DRAW_BUFFER14 0x8833
321 #define GL_DRAW_BUFFER15 0x8834
322 #define GL_DRAW_BUFFER2 0x8827
323 #define GL_DRAW_BUFFER3 0x8828
324 #define GL_DRAW_BUFFER4 0x8829
325 #define GL_DRAW_BUFFER5 0x882A
326 #define GL_DRAW_BUFFER6 0x882B
327 #define GL_DRAW_BUFFER7 0x882C
328 #define GL_DRAW_BUFFER8 0x882D
329 #define GL_DRAW_BUFFER9 0x882E
330 #define GL_DRAW_FRAMEBUFFER 0x8CA9
331 #define GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6
332 #define GL_DST_ALPHA 0x0304
333 #define GL_DST_COLOR 0x0306
334 #define GL_DYNAMIC_COPY 0x88EA
335 #define GL_DYNAMIC_DRAW 0x88E8
336 #define GL_DYNAMIC_READ 0x88E9
337 #define GL_ELEMENT_ARRAY_BUFFER 0x8893
338 #define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
339 #define GL_EQUAL 0x0202
340 #define GL_EQUIV 0x1509
341 #define GL_EXTENSIONS 0x1F03
342 #define GL_FALSE 0
343 #define GL_FASTEST 0x1101
344 #define GL_FILL 0x1B02
345 #define GL_FIRST_VERTEX_CONVENTION 0x8E4D
346 #define GL_FIXED_ONLY 0x891D
347 #define GL_FLOAT 0x1406
348 #define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD
349 #define GL_FLOAT_MAT2 0x8B5A
350 #define GL_FLOAT_MAT2x3 0x8B65
351 #define GL_FLOAT_MAT2x4 0x8B66
352 #define GL_FLOAT_MAT3 0x8B5B
353 #define GL_FLOAT_MAT3x2 0x8B67
354 #define GL_FLOAT_MAT3x4 0x8B68
355 #define GL_FLOAT_MAT4 0x8B5C
356 #define GL_FLOAT_MAT4x2 0x8B69
357 #define GL_FLOAT_MAT4x3 0x8B6A
358 #define GL_FLOAT_VEC2 0x8B50
359 #define GL_FLOAT_VEC3 0x8B51
360 #define GL_FLOAT_VEC4 0x8B52
361 #define GL_FRAGMENT_SHADER 0x8B30
362 #define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B
363 #define GL_FRAMEBUFFER 0x8D40
364 #define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215
365 #define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214
366 #define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210
367 #define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211
368 #define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216
369 #define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213
370 #define GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7
371 #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
372 #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
373 #define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212
374 #define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217
375 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
376 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4
377 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
378 #define GL_FRAMEBUFFER_BINDING 0x8CA6
379 #define GL_FRAMEBUFFER_COMPLETE 0x8CD5
380 #define GL_FRAMEBUFFER_DEFAULT 0x8218
381 #define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
382 #define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB
383 #define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8
384 #define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
385 #define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56
386 #define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC
387 #define GL_FRAMEBUFFER_SRGB 0x8DB9
388 #define GL_FRAMEBUFFER_UNDEFINED 0x8219
389 #define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
390 #define GL_FRONT 0x0404
391 #define GL_FRONT_AND_BACK 0x0408
392 #define GL_FRONT_FACE 0x0B46
393 #define GL_FRONT_LEFT 0x0400
394 #define GL_FRONT_RIGHT 0x0401
395 #define GL_FUNC_ADD 0x8006
396 #define GL_FUNC_REVERSE_SUBTRACT 0x800B
397 #define GL_FUNC_SUBTRACT 0x800A
398 #define GL_GEOMETRY_INPUT_TYPE 0x8917
399 #define GL_GEOMETRY_OUTPUT_TYPE 0x8918
400 #define GL_GEOMETRY_SHADER 0x8DD9
401 #define GL_GEOMETRY_VERTICES_OUT 0x8916
402 #define GL_GEQUAL 0x0206
403 #define GL_GREATER 0x0204
404 #define GL_GREEN 0x1904
405 #define GL_GREEN_INTEGER 0x8D95
406 #define GL_HALF_FLOAT 0x140B
407 #define GL_INCR 0x1E02
408 #define GL_INCR_WRAP 0x8507
409 #define GL_INFO_LOG_LENGTH 0x8B84
410 #define GL_INT 0x1404
411 #define GL_INTERLEAVED_ATTRIBS 0x8C8C
412 #define GL_INT_2_10_10_10_REV 0x8D9F
413 #define GL_INT_SAMPLER_1D 0x8DC9
414 #define GL_INT_SAMPLER_1D_ARRAY 0x8DCE
415 #define GL_INT_SAMPLER_2D 0x8DCA
416 #define GL_INT_SAMPLER_2D_ARRAY 0x8DCF
417 #define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109
418 #define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C
419 #define GL_INT_SAMPLER_2D_RECT 0x8DCD
420 #define GL_INT_SAMPLER_3D 0x8DCB
421 #define GL_INT_SAMPLER_BUFFER 0x8DD0
422 #define GL_INT_SAMPLER_CUBE 0x8DCC
423 #define GL_INT_VEC2 0x8B53
424 #define GL_INT_VEC3 0x8B54
425 #define GL_INT_VEC4 0x8B55
426 #define GL_INVALID_ENUM 0x0500
427 #define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
428 #define GL_INVALID_INDEX 0xFFFFFFFF
429 #define GL_INVALID_OPERATION 0x0502
430 #define GL_INVALID_VALUE 0x0501
431 #define GL_INVERT 0x150A
432 #define GL_KEEP 0x1E00
433 #define GL_LAST_VERTEX_CONVENTION 0x8E4E
434 #define GL_LEFT 0x0406
435 #define GL_LEQUAL 0x0203
436 #define GL_LESS 0x0201
437 #define GL_LINE 0x1B01
438 #define GL_LINEAR 0x2601
439 #define GL_LINEAR_MIPMAP_LINEAR 0x2703
440 #define GL_LINEAR_MIPMAP_NEAREST 0x2701
441 #define GL_LINES 0x0001
442 #define GL_LINES_ADJACENCY 0x000A
443 #define GL_LINE_LOOP 0x0002
444 #define GL_LINE_SMOOTH 0x0B20
445 #define GL_LINE_SMOOTH_HINT 0x0C52
446 #define GL_LINE_STRIP 0x0003
447 #define GL_LINE_STRIP_ADJACENCY 0x000B
448 #define GL_LINE_WIDTH 0x0B21
449 #define GL_LINE_WIDTH_GRANULARITY 0x0B23
450 #define GL_LINE_WIDTH_RANGE 0x0B22
451 #define GL_LINK_STATUS 0x8B82
452 #define GL_LOGIC_OP_MODE 0x0BF0
453 #define GL_LOWER_LEFT 0x8CA1
454 #define GL_MAJOR_VERSION 0x821B
455 #define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010
456 #define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008
457 #define GL_MAP_INVALIDATE_RANGE_BIT 0x0004
458 #define GL_MAP_READ_BIT 0x0001
459 #define GL_MAP_UNSYNCHRONIZED_BIT 0x0020
460 #define GL_MAP_WRITE_BIT 0x0002
461 #define GL_MAX 0x8008
462 #define GL_MAX_3D_TEXTURE_SIZE 0x8073
463 #define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF
464 #define GL_MAX_CLIP_DISTANCES 0x0D32
465 #define GL_MAX_COLOR_ATTACHMENTS 0x8CDF
466 #define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E
467 #define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33
468 #define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32
469 #define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
470 #define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E
471 #define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31
472 #define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
473 #define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F
474 #define GL_MAX_DRAW_BUFFERS 0x8824
475 #define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS 0x88FC
476 #define GL_MAX_ELEMENTS_INDICES 0x80E9
477 #define GL_MAX_ELEMENTS_VERTICES 0x80E8
478 #define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125
479 #define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D
480 #define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49
481 #define GL_MAX_GEOMETRY_INPUT_COMPONENTS 0x9123
482 #define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124
483 #define GL_MAX_GEOMETRY_OUTPUT_VERTICES 0x8DE0
484 #define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29
485 #define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1
486 #define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C
487 #define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF
488 #define GL_MAX_INTEGER_SAMPLES 0x9110
489 #define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905
490 #define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8
491 #define GL_MAX_RENDERBUFFER_SIZE 0x84E8
492 #define GL_MAX_SAMPLES 0x8D57
493 #define GL_MAX_SAMPLE_MASK_WORDS 0x8E59
494 #define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111
495 #define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B
496 #define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
497 #define GL_MAX_TEXTURE_LOD_BIAS 0x84FD
498 #define GL_MAX_TEXTURE_SIZE 0x0D33
499 #define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A
500 #define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B
501 #define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80
502 #define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30
503 #define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F
504 #define GL_MAX_VARYING_COMPONENTS 0x8B4B
505 #define GL_MAX_VARYING_FLOATS 0x8B4B
506 #define GL_MAX_VERTEX_ATTRIBS 0x8869
507 #define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122
508 #define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
509 #define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B
510 #define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A
511 #define GL_MAX_VIEWPORT_DIMS 0x0D3A
512 #define GL_MIN 0x8007
513 #define GL_MINOR_VERSION 0x821C
514 #define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904
515 #define GL_MIRRORED_REPEAT 0x8370
516 #define GL_MULTISAMPLE 0x809D
517 #define GL_NAND 0x150E
518 #define GL_NEAREST 0x2600
519 #define GL_NEAREST_MIPMAP_LINEAR 0x2702
520 #define GL_NEAREST_MIPMAP_NEAREST 0x2700
521 #define GL_NEVER 0x0200
522 #define GL_NICEST 0x1102
523 #define GL_NONE 0
524 #define GL_NOOP 0x1505
525 #define GL_NOR 0x1508
526 #define GL_NOTEQUAL 0x0205
527 #define GL_NO_ERROR 0
528 #define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
529 #define GL_NUM_EXTENSIONS 0x821D
530 #define GL_OBJECT_TYPE 0x9112
531 #define GL_ONE 1
532 #define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
533 #define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
534 #define GL_ONE_MINUS_DST_ALPHA 0x0305
535 #define GL_ONE_MINUS_DST_COLOR 0x0307
536 #define GL_ONE_MINUS_SRC1_ALPHA 0x88FB
537 #define GL_ONE_MINUS_SRC1_COLOR 0x88FA
538 #define GL_ONE_MINUS_SRC_ALPHA 0x0303
539 #define GL_ONE_MINUS_SRC_COLOR 0x0301
540 #define GL_OR 0x1507
541 #define GL_OR_INVERTED 0x150D
542 #define GL_OR_REVERSE 0x150B
543 #define GL_OUT_OF_MEMORY 0x0505
544 #define GL_PACK_ALIGNMENT 0x0D05
545 #define GL_PACK_IMAGE_HEIGHT 0x806C
546 #define GL_PACK_LSB_FIRST 0x0D01
547 #define GL_PACK_ROW_LENGTH 0x0D02
548 #define GL_PACK_SKIP_IMAGES 0x806B
549 #define GL_PACK_SKIP_PIXELS 0x0D04
550 #define GL_PACK_SKIP_ROWS 0x0D03
551 #define GL_PACK_SWAP_BYTES 0x0D00
552 #define GL_PIXEL_PACK_BUFFER 0x88EB
553 #define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED
554 #define GL_PIXEL_UNPACK_BUFFER 0x88EC
555 #define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF
556 #define GL_POINT 0x1B00
557 #define GL_POINTS 0x0000
558 #define GL_POINT_FADE_THRESHOLD_SIZE 0x8128
559 #define GL_POINT_SIZE 0x0B11
560 #define GL_POINT_SIZE_GRANULARITY 0x0B13
561 #define GL_POINT_SIZE_RANGE 0x0B12
562 #define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0
563 #define GL_POLYGON_MODE 0x0B40
564 #define GL_POLYGON_OFFSET_FACTOR 0x8038
565 #define GL_POLYGON_OFFSET_FILL 0x8037
566 #define GL_POLYGON_OFFSET_LINE 0x2A02
567 #define GL_POLYGON_OFFSET_POINT 0x2A01
568 #define GL_POLYGON_OFFSET_UNITS 0x2A00
569 #define GL_POLYGON_SMOOTH 0x0B41
570 #define GL_POLYGON_SMOOTH_HINT 0x0C53
571 #define GL_PRIMITIVES_GENERATED 0x8C87
572 #define GL_PRIMITIVE_RESTART 0x8F9D
573 #define GL_PRIMITIVE_RESTART_INDEX 0x8F9E
574 #define GL_PROGRAM_POINT_SIZE 0x8642
575 #define GL_PROVOKING_VERTEX 0x8E4F
576 #define GL_PROXY_TEXTURE_1D 0x8063
577 #define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19
578 #define GL_PROXY_TEXTURE_2D 0x8064
579 #define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B
580 #define GL_PROXY_TEXTURE_2D_MULTISAMPLE 0x9101
581 #define GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103
582 #define GL_PROXY_TEXTURE_3D 0x8070
583 #define GL_PROXY_TEXTURE_CUBE_MAP 0x851B
584 #define GL_PROXY_TEXTURE_RECTANGLE 0x84F7
585 #define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C
586 #define GL_QUERY_BY_REGION_NO_WAIT 0x8E16
587 #define GL_QUERY_BY_REGION_WAIT 0x8E15
588 #define GL_QUERY_COUNTER_BITS 0x8864
589 #define GL_QUERY_NO_WAIT 0x8E14
590 #define GL_QUERY_RESULT 0x8866
591 #define GL_QUERY_RESULT_AVAILABLE 0x8867
592 #define GL_QUERY_WAIT 0x8E13
593 #define GL_R11F_G11F_B10F 0x8C3A
594 #define GL_R16 0x822A
595 #define GL_R16F 0x822D
596 #define GL_R16I 0x8233
597 #define GL_R16UI 0x8234
598 #define GL_R16_SNORM 0x8F98
599 #define GL_R32F 0x822E
600 #define GL_R32I 0x8235
601 #define GL_R32UI 0x8236
602 #define GL_R3_G3_B2 0x2A10
603 #define GL_R8 0x8229
604 #define GL_R8I 0x8231
605 #define GL_R8UI 0x8232
606 #define GL_R8_SNORM 0x8F94
607 #define GL_RASTERIZER_DISCARD 0x8C89
608 #define GL_READ_BUFFER 0x0C02
609 #define GL_READ_FRAMEBUFFER 0x8CA8
610 #define GL_READ_FRAMEBUFFER_BINDING 0x8CAA
611 #define GL_READ_ONLY 0x88B8
612 #define GL_READ_WRITE 0x88BA
613 #define GL_RED 0x1903
614 #define GL_RED_INTEGER 0x8D94
615 #define GL_RENDERBUFFER 0x8D41
616 #define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53
617 #define GL_RENDERBUFFER_BINDING 0x8CA7
618 #define GL_RENDERBUFFER_BLUE_SIZE 0x8D52
619 #define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54
620 #define GL_RENDERBUFFER_GREEN_SIZE 0x8D51
621 #define GL_RENDERBUFFER_HEIGHT 0x8D43
622 #define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44
623 #define GL_RENDERBUFFER_RED_SIZE 0x8D50
624 #define GL_RENDERBUFFER_SAMPLES 0x8CAB
625 #define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55
626 #define GL_RENDERBUFFER_WIDTH 0x8D42
627 #define GL_RENDERER 0x1F01
628 #define GL_REPEAT 0x2901
629 #define GL_REPLACE 0x1E01
630 #define GL_RG 0x8227
631 #define GL_RG16 0x822C
632 #define GL_RG16F 0x822F
633 #define GL_RG16I 0x8239
634 #define GL_RG16UI 0x823A
635 #define GL_RG16_SNORM 0x8F99
636 #define GL_RG32F 0x8230
637 #define GL_RG32I 0x823B
638 #define GL_RG32UI 0x823C
639 #define GL_RG8 0x822B
640 #define GL_RG8I 0x8237
641 #define GL_RG8UI 0x8238
642 #define GL_RG8_SNORM 0x8F95
643 #define GL_RGB 0x1907
644 #define GL_RGB10 0x8052
645 #define GL_RGB10_A2 0x8059
646 #define GL_RGB10_A2UI 0x906F
647 #define GL_RGB12 0x8053
648 #define GL_RGB16 0x8054
649 #define GL_RGB16F 0x881B
650 #define GL_RGB16I 0x8D89
651 #define GL_RGB16UI 0x8D77
652 #define GL_RGB16_SNORM 0x8F9A
653 #define GL_RGB32F 0x8815
654 #define GL_RGB32I 0x8D83
655 #define GL_RGB32UI 0x8D71
656 #define GL_RGB4 0x804F
657 #define GL_RGB5 0x8050
658 #define GL_RGB5_A1 0x8057
659 #define GL_RGB8 0x8051
660 #define GL_RGB8I 0x8D8F
661 #define GL_RGB8UI 0x8D7D
662 #define GL_RGB8_SNORM 0x8F96
663 #define GL_RGB9_E5 0x8C3D
664 #define GL_RGBA 0x1908
665 #define GL_RGBA12 0x805A
666 #define GL_RGBA16 0x805B
667 #define GL_RGBA16F 0x881A
668 #define GL_RGBA16I 0x8D88
669 #define GL_RGBA16UI 0x8D76
670 #define GL_RGBA16_SNORM 0x8F9B
671 #define GL_RGBA2 0x8055
672 #define GL_RGBA32F 0x8814
673 #define GL_RGBA32I 0x8D82
674 #define GL_RGBA32UI 0x8D70
675 #define GL_RGBA4 0x8056
676 #define GL_RGBA8 0x8058
677 #define GL_RGBA8I 0x8D8E
678 #define GL_RGBA8UI 0x8D7C
679 #define GL_RGBA8_SNORM 0x8F97
680 #define GL_RGBA_INTEGER 0x8D99
681 #define GL_RGB_INTEGER 0x8D98
682 #define GL_RG_INTEGER 0x8228
683 #define GL_RIGHT 0x0407
684 #define GL_SAMPLER_1D 0x8B5D
685 #define GL_SAMPLER_1D_ARRAY 0x8DC0
686 #define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3
687 #define GL_SAMPLER_1D_SHADOW 0x8B61
688 #define GL_SAMPLER_2D 0x8B5E
689 #define GL_SAMPLER_2D_ARRAY 0x8DC1
690 #define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4
691 #define GL_SAMPLER_2D_MULTISAMPLE 0x9108
692 #define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B
693 #define GL_SAMPLER_2D_RECT 0x8B63
694 #define GL_SAMPLER_2D_RECT_SHADOW 0x8B64
695 #define GL_SAMPLER_2D_SHADOW 0x8B62
696 #define GL_SAMPLER_3D 0x8B5F
697 #define GL_SAMPLER_BINDING 0x8919
698 #define GL_SAMPLER_BUFFER 0x8DC2
699 #define GL_SAMPLER_CUBE 0x8B60
700 #define GL_SAMPLER_CUBE_SHADOW 0x8DC5
701 #define GL_SAMPLES 0x80A9
702 #define GL_SAMPLES_PASSED 0x8914
703 #define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
704 #define GL_SAMPLE_ALPHA_TO_ONE 0x809F
705 #define GL_SAMPLE_BUFFERS 0x80A8
706 #define GL_SAMPLE_COVERAGE 0x80A0
707 #define GL_SAMPLE_COVERAGE_INVERT 0x80AB
708 #define GL_SAMPLE_COVERAGE_VALUE 0x80AA
709 #define GL_SAMPLE_MASK 0x8E51
710 #define GL_SAMPLE_MASK_VALUE 0x8E52
711 #define GL_SAMPLE_POSITION 0x8E50
712 #define GL_SCISSOR_BOX 0x0C10
713 #define GL_SCISSOR_TEST 0x0C11
714 #define GL_SEPARATE_ATTRIBS 0x8C8D
715 #define GL_SET 0x150F
716 #define GL_SHADER_SOURCE_LENGTH 0x8B88
717 #define GL_SHADER_TYPE 0x8B4F
718 #define GL_SHADING_LANGUAGE_VERSION 0x8B8C
719 #define GL_SHORT 0x1402
720 #define GL_SIGNALED 0x9119
721 #define GL_SIGNED_NORMALIZED 0x8F9C
722 #define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23
723 #define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22
724 #define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13
725 #define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12
726 #define GL_SRC1_ALPHA 0x8589
727 #define GL_SRC1_COLOR 0x88F9
728 #define GL_SRC_ALPHA 0x0302
729 #define GL_SRC_ALPHA_SATURATE 0x0308
730 #define GL_SRC_COLOR 0x0300
731 #define GL_SRGB 0x8C40
732 #define GL_SRGB8 0x8C41
733 #define GL_SRGB8_ALPHA8 0x8C43
734 #define GL_SRGB_ALPHA 0x8C42
735 #define GL_STATIC_COPY 0x88E6
736 #define GL_STATIC_DRAW 0x88E4
737 #define GL_STATIC_READ 0x88E5
738 #define GL_STENCIL 0x1802
739 #define GL_STENCIL_ATTACHMENT 0x8D20
740 #define GL_STENCIL_BACK_FAIL 0x8801
741 #define GL_STENCIL_BACK_FUNC 0x8800
742 #define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802
743 #define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803
744 #define GL_STENCIL_BACK_REF 0x8CA3
745 #define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
746 #define GL_STENCIL_BACK_WRITEMASK 0x8CA5
747 #define GL_STENCIL_BUFFER_BIT 0x00000400
748 #define GL_STENCIL_CLEAR_VALUE 0x0B91
749 #define GL_STENCIL_FAIL 0x0B94
750 #define GL_STENCIL_FUNC 0x0B92
751 #define GL_STENCIL_INDEX 0x1901
752 #define GL_STENCIL_INDEX1 0x8D46
753 #define GL_STENCIL_INDEX16 0x8D49
754 #define GL_STENCIL_INDEX4 0x8D47
755 #define GL_STENCIL_INDEX8 0x8D48
756 #define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
757 #define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
758 #define GL_STENCIL_REF 0x0B97
759 #define GL_STENCIL_TEST 0x0B90
760 #define GL_STENCIL_VALUE_MASK 0x0B93
761 #define GL_STENCIL_WRITEMASK 0x0B98
762 #define GL_STEREO 0x0C33
763 #define GL_STREAM_COPY 0x88E2
764 #define GL_STREAM_DRAW 0x88E0
765 #define GL_STREAM_READ 0x88E1
766 #define GL_SUBPIXEL_BITS 0x0D50
767 #define GL_SYNC_CONDITION 0x9113
768 #define GL_SYNC_FENCE 0x9116
769 #define GL_SYNC_FLAGS 0x9115
770 #define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001
771 #define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117
772 #define GL_SYNC_STATUS 0x9114
773 #define GL_TEXTURE 0x1702
774 #define GL_TEXTURE0 0x84C0
775 #define GL_TEXTURE1 0x84C1
776 #define GL_TEXTURE10 0x84CA
777 #define GL_TEXTURE11 0x84CB
778 #define GL_TEXTURE12 0x84CC
779 #define GL_TEXTURE13 0x84CD
780 #define GL_TEXTURE14 0x84CE
781 #define GL_TEXTURE15 0x84CF
782 #define GL_TEXTURE16 0x84D0
783 #define GL_TEXTURE17 0x84D1
784 #define GL_TEXTURE18 0x84D2
785 #define GL_TEXTURE19 0x84D3
786 #define GL_TEXTURE2 0x84C2
787 #define GL_TEXTURE20 0x84D4
788 #define GL_TEXTURE21 0x84D5
789 #define GL_TEXTURE22 0x84D6
790 #define GL_TEXTURE23 0x84D7
791 #define GL_TEXTURE24 0x84D8
792 #define GL_TEXTURE25 0x84D9
793 #define GL_TEXTURE26 0x84DA
794 #define GL_TEXTURE27 0x84DB
795 #define GL_TEXTURE28 0x84DC
796 #define GL_TEXTURE29 0x84DD
797 #define GL_TEXTURE3 0x84C3
798 #define GL_TEXTURE30 0x84DE
799 #define GL_TEXTURE31 0x84DF
800 #define GL_TEXTURE4 0x84C4
801 #define GL_TEXTURE5 0x84C5
802 #define GL_TEXTURE6 0x84C6
803 #define GL_TEXTURE7 0x84C7
804 #define GL_TEXTURE8 0x84C8
805 #define GL_TEXTURE9 0x84C9
806 #define GL_TEXTURE_1D 0x0DE0
807 #define GL_TEXTURE_1D_ARRAY 0x8C18
808 #define GL_TEXTURE_2D 0x0DE1
809 #define GL_TEXTURE_2D_ARRAY 0x8C1A
810 #define GL_TEXTURE_2D_MULTISAMPLE 0x9100
811 #define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102
812 #define GL_TEXTURE_3D 0x806F
813 #define GL_TEXTURE_ALPHA_SIZE 0x805F
814 #define GL_TEXTURE_ALPHA_TYPE 0x8C13
815 #define GL_TEXTURE_BASE_LEVEL 0x813C
816 #define GL_TEXTURE_BINDING_1D 0x8068
817 #define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C
818 #define GL_TEXTURE_BINDING_2D 0x8069
819 #define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D
820 #define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104
821 #define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105
822 #define GL_TEXTURE_BINDING_3D 0x806A
823 #define GL_TEXTURE_BINDING_BUFFER 0x8C2C
824 #define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
825 #define GL_TEXTURE_BINDING_RECTANGLE 0x84F6
826 #define GL_TEXTURE_BLUE_SIZE 0x805E
827 #define GL_TEXTURE_BLUE_TYPE 0x8C12
828 #define GL_TEXTURE_BORDER_COLOR 0x1004
829 #define GL_TEXTURE_BUFFER 0x8C2A
830 #define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D
831 #define GL_TEXTURE_COMPARE_FUNC 0x884D
832 #define GL_TEXTURE_COMPARE_MODE 0x884C
833 #define GL_TEXTURE_COMPRESSED 0x86A1
834 #define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0
835 #define GL_TEXTURE_COMPRESSION_HINT 0x84EF
836 #define GL_TEXTURE_CUBE_MAP 0x8513
837 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
838 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
839 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
840 #define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
841 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
842 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
843 #define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F
844 #define GL_TEXTURE_DEPTH 0x8071
845 #define GL_TEXTURE_DEPTH_SIZE 0x884A
846 #define GL_TEXTURE_DEPTH_TYPE 0x8C16
847 #define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107
848 #define GL_TEXTURE_GREEN_SIZE 0x805D
849 #define GL_TEXTURE_GREEN_TYPE 0x8C11
850 #define GL_TEXTURE_HEIGHT 0x1001
851 #define GL_TEXTURE_INTERNAL_FORMAT 0x1003
852 #define GL_TEXTURE_LOD_BIAS 0x8501
853 #define GL_TEXTURE_MAG_FILTER 0x2800
854 #define GL_TEXTURE_MAX_LEVEL 0x813D
855 #define GL_TEXTURE_MAX_LOD 0x813B
856 #define GL_TEXTURE_MIN_FILTER 0x2801
857 #define GL_TEXTURE_MIN_LOD 0x813A
858 #define GL_TEXTURE_RECTANGLE 0x84F5
859 #define GL_TEXTURE_RED_SIZE 0x805C
860 #define GL_TEXTURE_RED_TYPE 0x8C10
861 #define GL_TEXTURE_SAMPLES 0x9106
862 #define GL_TEXTURE_SHARED_SIZE 0x8C3F
863 #define GL_TEXTURE_STENCIL_SIZE 0x88F1
864 #define GL_TEXTURE_SWIZZLE_A 0x8E45
865 #define GL_TEXTURE_SWIZZLE_B 0x8E44
866 #define GL_TEXTURE_SWIZZLE_G 0x8E43
867 #define GL_TEXTURE_SWIZZLE_R 0x8E42
868 #define GL_TEXTURE_SWIZZLE_RGBA 0x8E46
869 #define GL_TEXTURE_WIDTH 0x1000
870 #define GL_TEXTURE_WRAP_R 0x8072
871 #define GL_TEXTURE_WRAP_S 0x2802
872 #define GL_TEXTURE_WRAP_T 0x2803
873 #define GL_TIMEOUT_EXPIRED 0x911B
874 #define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFF
875 #define GL_TIMESTAMP 0x8E28
876 #define GL_TIME_ELAPSED 0x88BF
877 #define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E
878 #define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F
879 #define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F
880 #define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85
881 #define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84
882 #define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88
883 #define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83
884 #define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76
885 #define GL_TRIANGLES 0x0004
886 #define GL_TRIANGLES_ADJACENCY 0x000C
887 #define GL_TRIANGLE_FAN 0x0006
888 #define GL_TRIANGLE_STRIP 0x0005
889 #define GL_TRIANGLE_STRIP_ADJACENCY 0x000D
890 #define GL_TRUE 1
891 #define GL_UNIFORM_ARRAY_STRIDE 0x8A3C
892 #define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42
893 #define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43
894 #define GL_UNIFORM_BLOCK_BINDING 0x8A3F
895 #define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40
896 #define GL_UNIFORM_BLOCK_INDEX 0x8A3A
897 #define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41
898 #define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46
899 #define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45
900 #define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44
901 #define GL_UNIFORM_BUFFER 0x8A11
902 #define GL_UNIFORM_BUFFER_BINDING 0x8A28
903 #define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34
904 #define GL_UNIFORM_BUFFER_SIZE 0x8A2A
905 #define GL_UNIFORM_BUFFER_START 0x8A29
906 #define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E
907 #define GL_UNIFORM_MATRIX_STRIDE 0x8A3D
908 #define GL_UNIFORM_NAME_LENGTH 0x8A39
909 #define GL_UNIFORM_OFFSET 0x8A3B
910 #define GL_UNIFORM_SIZE 0x8A38
911 #define GL_UNIFORM_TYPE 0x8A37
912 #define GL_UNPACK_ALIGNMENT 0x0CF5
913 #define GL_UNPACK_IMAGE_HEIGHT 0x806E
914 #define GL_UNPACK_LSB_FIRST 0x0CF1
915 #define GL_UNPACK_ROW_LENGTH 0x0CF2
916 #define GL_UNPACK_SKIP_IMAGES 0x806D
917 #define GL_UNPACK_SKIP_PIXELS 0x0CF4
918 #define GL_UNPACK_SKIP_ROWS 0x0CF3
919 #define GL_UNPACK_SWAP_BYTES 0x0CF0
920 #define GL_UNSIGNALED 0x9118
921 #define GL_UNSIGNED_BYTE 0x1401
922 #define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362
923 #define GL_UNSIGNED_BYTE_3_3_2 0x8032
924 #define GL_UNSIGNED_INT 0x1405
925 #define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B
926 #define GL_UNSIGNED_INT_10_10_10_2 0x8036
927 #define GL_UNSIGNED_INT_24_8 0x84FA
928 #define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
929 #define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E
930 #define GL_UNSIGNED_INT_8_8_8_8 0x8035
931 #define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367
932 #define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1
933 #define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6
934 #define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2
935 #define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7
936 #define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A
937 #define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D
938 #define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5
939 #define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3
940 #define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8
941 #define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4
942 #define GL_UNSIGNED_INT_VEC2 0x8DC6
943 #define GL_UNSIGNED_INT_VEC3 0x8DC7
944 #define GL_UNSIGNED_INT_VEC4 0x8DC8
945 #define GL_UNSIGNED_NORMALIZED 0x8C17
946 #define GL_UNSIGNED_SHORT 0x1403
947 #define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366
948 #define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
949 #define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365
950 #define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
951 #define GL_UNSIGNED_SHORT_5_6_5 0x8363
952 #define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364
953 #define GL_UPPER_LEFT 0x8CA2
954 #define GL_VALIDATE_STATUS 0x8B83
955 #define GL_VENDOR 0x1F00
956 #define GL_VERSION 0x1F02
957 #define GL_VERTEX_ARRAY_BINDING 0x85B5
958 #define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
959 #define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE
960 #define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
961 #define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD
962 #define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
963 #define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
964 #define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
965 #define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
966 #define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
967 #define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642
968 #define GL_VERTEX_SHADER 0x8B31
969 #define GL_VIEWPORT 0x0BA2
970 #define GL_WAIT_FAILED 0x911D
971 #define GL_WRITE_ONLY 0x88B9
972 #define GL_XOR 0x1506
973 #define GL_ZERO 0
974
975
976 #include <stddef.h>
977 #ifndef __khrplatform_h_
978 #define __khrplatform_h_
979
980 /*
981 ** Copyright (c) 2008-2018 The Khronos Group Inc.
982 **
983 ** Permission is hereby granted, free of charge, to any person obtaining a
984 ** copy of this software and/or associated documentation files (the
985 ** "Materials"), to deal in the Materials without restriction, including
986 ** without limitation the rights to use, copy, modify, merge, publish,
987 ** distribute, sublicense, and/or sell copies of the Materials, and to
988 ** permit persons to whom the Materials are furnished to do so, subject to
989 ** the following conditions:
990 **
991 ** The above copyright notice and this permission notice shall be included
992 ** in all copies or substantial portions of the Materials.
993 **
994 ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
995 ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
996 ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
997 ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
998 ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
999 ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
1000 ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
1001 */
1002
1003 /* Khronos platform-specific types and definitions.
1004 *
1005 * The master copy of khrplatform.h is maintained in the Khronos EGL
1006 * Registry repository at https://github.com/KhronosGroup/EGL-Registry
1007 * The last semantic modification to khrplatform.h was at commit ID:
1008 * 67a3e0864c2d75ea5287b9f3d2eb74a745936692
1009 *
1010 * Adopters may modify this file to suit their platform. Adopters are
1011 * encouraged to submit platform specific modifications to the Khronos
1012 * group so that they can be included in future versions of this file.
1013 * Please submit changes by filing pull requests or issues on
1014 * the EGL Registry repository linked above.
1015 *
1016 *
1017 * See the Implementer's Guidelines for information about where this file
1018 * should be located on your system and for more details of its use:
1019 * http://www.khronos.org/registry/implementers_guide.pdf
1020 *
1021 * This file should be included as
1022 * #include <KHR/khrplatform.h>
1023 * by Khronos client API header files that use its types and defines.
1024 *
1025 * The types in khrplatform.h should only be used to define API-specific types.
1026 *
1027 * Types defined in khrplatform.h:
1028 * khronos_int8_t signed 8 bit
1029 * khronos_uint8_t unsigned 8 bit
1030 * khronos_int16_t signed 16 bit
1031 * khronos_uint16_t unsigned 16 bit
1032 * khronos_int32_t signed 32 bit
1033 * khronos_uint32_t unsigned 32 bit
1034 * khronos_int64_t signed 64 bit
1035 * khronos_uint64_t unsigned 64 bit
1036 * khronos_intptr_t signed same number of bits as a pointer
1037 * khronos_uintptr_t unsigned same number of bits as a pointer
1038 * khronos_ssize_t signed size
1039 * khronos_usize_t unsigned size
1040 * khronos_float_t signed 32 bit floating point
1041 * khronos_time_ns_t unsigned 64 bit time in nanoseconds
1042 * khronos_utime_nanoseconds_t unsigned time interval or absolute time in
1043 * nanoseconds
1044 * khronos_stime_nanoseconds_t signed time interval in nanoseconds
1045 * khronos_boolean_enum_t enumerated boolean type. This should
1046 * only be used as a base type when a client API's boolean type is
1047 * an enum. Client APIs which use an integer or other type for
1048 * booleans cannot use this as the base type for their boolean.
1049 *
1050 * Tokens defined in khrplatform.h:
1051 *
1052 * KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values.
1053 *
1054 * KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0.
1055 * KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0.
1056 *
1057 * Calling convention macros defined in this file:
1058 * KHRONOS_APICALL
1059 * KHRONOS_GLAD_API_PTR
1060 * KHRONOS_APIATTRIBUTES
1061 *
1062 * These may be used in function prototypes as:
1063 *
1064 * KHRONOS_APICALL void KHRONOS_GLAD_API_PTR funcname(
1065 * int arg1,
1066 * int arg2) KHRONOS_APIATTRIBUTES;
1067 */
1068
1069 /*-------------------------------------------------------------------------
1070 * Definition of KHRONOS_APICALL
1071 *-------------------------------------------------------------------------
1072 * This precedes the return type of the function in the function prototype.
1073 */
1074 #if defined(_WIN32) && !defined(__SCITECH_SNAP__)
1075 # define KHRONOS_APICALL __declspec(dllimport)
1076 #elif defined (__SYMBIAN32__)
1077 # define KHRONOS_APICALL IMPORT_C
1078 #elif defined(__ANDROID__)
1079 # define KHRONOS_APICALL __attribute__((visibility("default")))
1080 #else
1081 # define KHRONOS_APICALL
1082 #endif
1083
1084 /*-------------------------------------------------------------------------
1085 * Definition of KHRONOS_GLAD_API_PTR
1086 *-------------------------------------------------------------------------
1087 * This follows the return type of the function and precedes the function
1088 * name in the function prototype.
1089 */
1090 #if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__)
1091 /* Win32 but not WinCE */
1092 # define KHRONOS_GLAD_API_PTR __stdcall
1093 #else
1094 # define KHRONOS_GLAD_API_PTR
1095 #endif
1096
1097 /*-------------------------------------------------------------------------
1098 * Definition of KHRONOS_APIATTRIBUTES
1099 *-------------------------------------------------------------------------
1100 * This follows the closing parenthesis of the function prototype arguments.
1101 */
1102 #if defined (__ARMCC_2__)
1103 #define KHRONOS_APIATTRIBUTES __softfp
1104 #else
1105 #define KHRONOS_APIATTRIBUTES
1106 #endif
1107
1108 /*-------------------------------------------------------------------------
1109 * basic type definitions
1110 *-----------------------------------------------------------------------*/
1111 #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__)
1112
1113
1114 /*
1115 * Using <stdint.h>
1116 */
1117 #include <stdint.h>
1118 typedef int32_t khronos_int32_t;
1119 typedef uint32_t khronos_uint32_t;
1120 typedef int64_t khronos_int64_t;
1121 typedef uint64_t khronos_uint64_t;
1122 #define KHRONOS_SUPPORT_INT64 1
1123 #define KHRONOS_SUPPORT_FLOAT 1
1124
1125 #elif defined(__VMS ) || defined(__sgi)
1126
1127 /*
1128 * Using <inttypes.h>
1129 */
1130 #include <inttypes.h>
1131 typedef int32_t khronos_int32_t;
1132 typedef uint32_t khronos_uint32_t;
1133 typedef int64_t khronos_int64_t;
1134 typedef uint64_t khronos_uint64_t;
1135 #define KHRONOS_SUPPORT_INT64 1
1136 #define KHRONOS_SUPPORT_FLOAT 1
1137
1138 #elif defined(_WIN32) && !defined(__SCITECH_SNAP__)
1139
1140 /*
1141 * Win32
1142 */
1143 typedef __int32 khronos_int32_t;
1144 typedef unsigned __int32 khronos_uint32_t;
1145 typedef __int64 khronos_int64_t;
1146 typedef unsigned __int64 khronos_uint64_t;
1147 #define KHRONOS_SUPPORT_INT64 1
1148 #define KHRONOS_SUPPORT_FLOAT 1
1149
1150 #elif defined(__sun__) || defined(__digital__)
1151
1152 /*
1153 * Sun or Digital
1154 */
1155 typedef int khronos_int32_t;
1156 typedef unsigned int khronos_uint32_t;
1157 #if defined(__arch64__) || defined(_LP64)
1158 typedef long int khronos_int64_t;
1159 typedef unsigned long int khronos_uint64_t;
1160 #else
1161 typedef long long int khronos_int64_t;
1162 typedef unsigned long long int khronos_uint64_t;
1163 #endif /* __arch64__ */
1164 #define KHRONOS_SUPPORT_INT64 1
1165 #define KHRONOS_SUPPORT_FLOAT 1
1166
1167 #elif 0
1168
1169 /*
1170 * Hypothetical platform with no float or int64 support
1171 */
1172 typedef int khronos_int32_t;
1173 typedef unsigned int khronos_uint32_t;
1174 #define KHRONOS_SUPPORT_INT64 0
1175 #define KHRONOS_SUPPORT_FLOAT 0
1176
1177 #else
1178
1179 /*
1180 * Generic fallback
1181 */
1182 #include <stdint.h>
1183 typedef int32_t khronos_int32_t;
1184 typedef uint32_t khronos_uint32_t;
1185 typedef int64_t khronos_int64_t;
1186 typedef uint64_t khronos_uint64_t;
1187 #define KHRONOS_SUPPORT_INT64 1
1188 #define KHRONOS_SUPPORT_FLOAT 1
1189
1190 #endif
1191
1192
1193 /*
1194 * Types that are (so far) the same on all platforms
1195 */
1196 typedef signed char khronos_int8_t;
1197 typedef unsigned char khronos_uint8_t;
1198 typedef signed short int khronos_int16_t;
1199 typedef unsigned short int khronos_uint16_t;
1200
1201 /*
1202 * Types that differ between LLP64 and LP64 architectures - in LLP64,
1203 * pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
1204 * to be the only LLP64 architecture in current use.
1205 */
1206 #ifdef _WIN64
1207 typedef signed long long int khronos_intptr_t;
1208 typedef unsigned long long int khronos_uintptr_t;
1209 typedef signed long long int khronos_ssize_t;
1210 typedef unsigned long long int khronos_usize_t;
1211 #else
1212 typedef signed long int khronos_intptr_t;
1213 typedef unsigned long int khronos_uintptr_t;
1214 typedef signed long int khronos_ssize_t;
1215 typedef unsigned long int khronos_usize_t;
1216 #endif
1217
1218 #if KHRONOS_SUPPORT_FLOAT
1219 /*
1220 * Float type
1221 */
1222 typedef float khronos_float_t;
1223 #endif
1224
1225 #if KHRONOS_SUPPORT_INT64
1226 /* Time types
1227 *
1228 * These types can be used to represent a time interval in nanoseconds or
1229 * an absolute Unadjusted System Time. Unadjusted System Time is the number
1230 * of nanoseconds since some arbitrary system event (e.g. since the last
1231 * time the system booted). The Unadjusted System Time is an unsigned
1232 * 64 bit value that wraps back to 0 every 584 years. Time intervals
1233 * may be either signed or unsigned.
1234 */
1235 typedef khronos_uint64_t khronos_utime_nanoseconds_t;
1236 typedef khronos_int64_t khronos_stime_nanoseconds_t;
1237 #endif
1238
1239 /*
1240 * Dummy value used to pad enum types to 32 bits.
1241 */
1242 #ifndef KHRONOS_MAX_ENUM
1243 #define KHRONOS_MAX_ENUM 0x7FFFFFFF
1244 #endif
1245
1246 /*
1247 * Enumerated boolean type
1248 *
1249 * Values other than zero should be considered to be true. Therefore
1250 * comparisons should not be made against KHRONOS_TRUE.
1251 */
1252 typedef enum {
1253 KHRONOS_FALSE = 0,
1254 KHRONOS_TRUE = 1,
1255 KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM
1256 } khronos_boolean_enum_t;
1257
1258 #endif /* __khrplatform_h_ */
1259 #ifndef GLEXT_64_TYPES_DEFINED
1260 /* This code block is duplicated in glxext.h, so must be protected */
1261 #define GLEXT_64_TYPES_DEFINED
1262 /* Define int32_t, int64_t, and uint64_t types for UST/MSC */
1263 /* (as used in the GL_EXT_timer_query extension). */
1264 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
1265 #include <inttypes.h>
1266 #elif defined(__sun__) || defined(__digital__)
1267 #include <inttypes.h>
1268 #if defined(__STDC__)
1269 #if defined(__arch64__) || defined(_LP64)
1270 typedef long int int64_t;
1271 typedef unsigned long int uint64_t;
1272 #else
1273 typedef long long int int64_t;
1274 typedef unsigned long long int uint64_t;
1275 #endif /* __arch64__ */
1276 #endif /* __STDC__ */
1277 #elif defined( __VMS ) || defined(__sgi)
1278 #include <inttypes.h>
1279 #elif defined(__SCO__) || defined(__USLC__)
1280 #include <stdint.h>
1281 #elif defined(__UNIXOS2__) || defined(__SOL64__)
1282 typedef long int int32_t;
1283 typedef long long int int64_t;
1284 typedef unsigned long long int uint64_t;
1285 #elif defined(_WIN32) && defined(__GNUC__)
1286 #include <stdint.h>
1287 #elif defined(_WIN32)
1288 typedef __int32 int32_t;
1289 typedef __int64 int64_t;
1290 typedef unsigned __int64 uint64_t;
1291 #else
1292 /* Fallback if nothing above works */
1293 #include <inttypes.h>
1294 #endif
1295 #endif
1296 typedef unsigned int GLenum;
1297 typedef unsigned char GLboolean;
1298 typedef unsigned int GLbitfield;
1299 typedef void GLvoid;
1300 typedef signed char GLbyte;
1301 typedef short GLshort;
1302 typedef int GLint;
1303 typedef int GLclampx;
1304 typedef unsigned char GLubyte;
1305 typedef unsigned short GLushort;
1306 typedef unsigned int GLuint;
1307 typedef int GLsizei;
1308 typedef float GLfloat;
1309 typedef float GLclampf;
1310 typedef double GLdouble;
1311 typedef double GLclampd;
1312 typedef void *GLeglClientBufferEXT;
1313 typedef void *GLeglImageOES;
1314 typedef char GLchar;
1315 typedef char GLcharARB;
1316 #ifdef __APPLE__
1317 typedef void *GLhandleARB;
1318 #else
1319 typedef unsigned int GLhandleARB;
1320 #endif
1321 typedef unsigned short GLhalfARB;
1322 typedef unsigned short GLhalf;
1323 typedef GLint GLfixed;
1324 #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
1325 typedef khronos_intptr_t GLintptr;
1326 #else
1327 typedef khronos_intptr_t GLintptr;
1328 #endif
1329 #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
1330 typedef khronos_ssize_t GLsizeiptr;
1331 #else
1332 typedef khronos_ssize_t GLsizeiptr;
1333 #endif
1334 typedef int64_t GLint64;
1335 typedef uint64_t GLuint64;
1336 #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
1337 typedef long GLintptrARB;
1338 #else
1339 typedef ptrdiff_t GLintptrARB;
1340 #endif
1341 #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
1342 typedef long GLsizeiptrARB;
1343 #else
1344 typedef ptrdiff_t GLsizeiptrARB;
1345 #endif
1346 typedef int64_t GLint64EXT;
1347 typedef uint64_t GLuint64EXT;
1348 typedef struct __GLsync *GLsync;
1349 struct _cl_context;
1350 struct _cl_event;
1351 typedef void ( *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
1352 typedef void ( *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
1353 typedef void ( *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
1354 typedef void ( *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,void *userParam);
1355 typedef unsigned short GLhalfNV;
1356 typedef GLintptr GLvdpauSurfaceNV;
1357 typedef void ( *GLVULKANPROCNV)(void);
1358
1359
1360 #define GL_VERSION_1_0 1
1361 GLAD_API_CALL int GLAD_GL_VERSION_1_0;
1362 #define GL_VERSION_1_1 1
1363 GLAD_API_CALL int GLAD_GL_VERSION_1_1;
1364 #define GL_VERSION_1_2 1
1365 GLAD_API_CALL int GLAD_GL_VERSION_1_2;
1366 #define GL_VERSION_1_3 1
1367 GLAD_API_CALL int GLAD_GL_VERSION_1_3;
1368 #define GL_VERSION_1_4 1
1369 GLAD_API_CALL int GLAD_GL_VERSION_1_4;
1370 #define GL_VERSION_1_5 1
1371 GLAD_API_CALL int GLAD_GL_VERSION_1_5;
1372 #define GL_VERSION_2_0 1
1373 GLAD_API_CALL int GLAD_GL_VERSION_2_0;
1374 #define GL_VERSION_2_1 1
1375 GLAD_API_CALL int GLAD_GL_VERSION_2_1;
1376 #define GL_VERSION_3_0 1
1377 GLAD_API_CALL int GLAD_GL_VERSION_3_0;
1378 #define GL_VERSION_3_1 1
1379 GLAD_API_CALL int GLAD_GL_VERSION_3_1;
1380 #define GL_VERSION_3_2 1
1381 GLAD_API_CALL int GLAD_GL_VERSION_3_2;
1382 #define GL_VERSION_3_3 1
1383 GLAD_API_CALL int GLAD_GL_VERSION_3_3;
1384
1385
1386 typedef void (GLAD_API_PTR *PFNGLACTIVETEXTUREPROC)(GLenum texture);
1387 typedef void (GLAD_API_PTR *PFNGLATTACHSHADERPROC)(GLuint program, GLuint shader);
1388 typedef void (GLAD_API_PTR *PFNGLBEGINCONDITIONALRENDERPROC)(GLuint id, GLenum mode);
1389 typedef void (GLAD_API_PTR *PFNGLBEGINQUERYPROC)(GLenum target, GLuint id);
1390 typedef void (GLAD_API_PTR *PFNGLBEGINTRANSFORMFEEDBACKPROC)(GLenum primitiveMode);
1391 typedef void (GLAD_API_PTR *PFNGLBINDATTRIBLOCATIONPROC)(GLuint program, GLuint index, const GLchar * name);
1392 typedef void (GLAD_API_PTR *PFNGLBINDBUFFERPROC)(GLenum target, GLuint buffer);
1393 typedef void (GLAD_API_PTR *PFNGLBINDBUFFERBASEPROC)(GLenum target, GLuint index, GLuint buffer);
1394 typedef void (GLAD_API_PTR *PFNGLBINDBUFFERRANGEPROC)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
1395 typedef void (GLAD_API_PTR *PFNGLBINDFRAGDATALOCATIONPROC)(GLuint program, GLuint color, const GLchar * name);
1396 typedef void (GLAD_API_PTR *PFNGLBINDFRAGDATALOCATIONINDEXEDPROC)(GLuint program, GLuint colorNumber, GLuint index, const GLchar * name);
1397 typedef void (GLAD_API_PTR *PFNGLBINDFRAMEBUFFERPROC)(GLenum target, GLuint framebuffer);
1398 typedef void (GLAD_API_PTR *PFNGLBINDRENDERBUFFERPROC)(GLenum target, GLuint renderbuffer);
1399 typedef void (GLAD_API_PTR *PFNGLBINDSAMPLERPROC)(GLuint unit, GLuint sampler);
1400 typedef void (GLAD_API_PTR *PFNGLBINDTEXTUREPROC)(GLenum target, GLuint texture);
1401 typedef void (GLAD_API_PTR *PFNGLBINDVERTEXARRAYPROC)(GLuint array);
1402 typedef void (GLAD_API_PTR *PFNGLBLENDCOLORPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
1403 typedef void (GLAD_API_PTR *PFNGLBLENDEQUATIONPROC)(GLenum mode);
1404 typedef void (GLAD_API_PTR *PFNGLBLENDEQUATIONSEPARATEPROC)(GLenum modeRGB, GLenum modeAlpha);
1405 typedef void (GLAD_API_PTR *PFNGLBLENDFUNCPROC)(GLenum sfactor, GLenum dfactor);
1406 typedef void (GLAD_API_PTR *PFNGLBLENDFUNCSEPARATEPROC)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
1407 typedef void (GLAD_API_PTR *PFNGLBLITFRAMEBUFFERPROC)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
1408 typedef void (GLAD_API_PTR *PFNGLBUFFERDATAPROC)(GLenum target, GLsizeiptr size, const void * data, GLenum usage);
1409 typedef void (GLAD_API_PTR *PFNGLBUFFERSUBDATAPROC)(GLenum target, GLintptr offset, GLsizeiptr size, const void * data);
1410 typedef GLenum (GLAD_API_PTR *PFNGLCHECKFRAMEBUFFERSTATUSPROC)(GLenum target);
1411 typedef void (GLAD_API_PTR *PFNGLCLAMPCOLORPROC)(GLenum target, GLenum clamp);
1412 typedef void (GLAD_API_PTR *PFNGLCLEARPROC)(GLbitfield mask);
1413 typedef void (GLAD_API_PTR *PFNGLCLEARBUFFERFIPROC)(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
1414 typedef void (GLAD_API_PTR *PFNGLCLEARBUFFERFVPROC)(GLenum buffer, GLint drawbuffer, const GLfloat * value);
1415 typedef void (GLAD_API_PTR *PFNGLCLEARBUFFERIVPROC)(GLenum buffer, GLint drawbuffer, const GLint * value);
1416 typedef void (GLAD_API_PTR *PFNGLCLEARBUFFERUIVPROC)(GLenum buffer, GLint drawbuffer, const GLuint * value);
1417 typedef void (GLAD_API_PTR *PFNGLCLEARCOLORPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
1418 typedef void (GLAD_API_PTR *PFNGLCLEARDEPTHPROC)(GLdouble depth);
1419 typedef void (GLAD_API_PTR *PFNGLCLEARSTENCILPROC)(GLint s);
1420 typedef GLenum (GLAD_API_PTR *PFNGLCLIENTWAITSYNCPROC)(GLsync sync, GLbitfield flags, GLuint64 timeout);
1421 typedef void (GLAD_API_PTR *PFNGLCOLORMASKPROC)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
1422 typedef void (GLAD_API_PTR *PFNGLCOLORMASKIPROC)(GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
1423 typedef void (GLAD_API_PTR *PFNGLCOMPILESHADERPROC)(GLuint shader);
1424 typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXIMAGE1DPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void * data);
1425 typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXIMAGE2DPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void * data);
1426 typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXIMAGE3DPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void * data);
1427 typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void * data);
1428 typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void * data);
1429 typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void * data);
1430 typedef void (GLAD_API_PTR *PFNGLCOPYBUFFERSUBDATAPROC)(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
1431 typedef void (GLAD_API_PTR *PFNGLCOPYTEXIMAGE1DPROC)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
1432 typedef void (GLAD_API_PTR *PFNGLCOPYTEXIMAGE2DPROC)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
1433 typedef void (GLAD_API_PTR *PFNGLCOPYTEXSUBIMAGE1DPROC)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
1434 typedef void (GLAD_API_PTR *PFNGLCOPYTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
1435 typedef void (GLAD_API_PTR *PFNGLCOPYTEXSUBIMAGE3DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
1436 typedef GLuint (GLAD_API_PTR *PFNGLCREATEPROGRAMPROC)(void);
1437 typedef GLuint (GLAD_API_PTR *PFNGLCREATESHADERPROC)(GLenum type);
1438 typedef void (GLAD_API_PTR *PFNGLCULLFACEPROC)(GLenum mode);
1439 typedef void (GLAD_API_PTR *PFNGLDELETEBUFFERSPROC)(GLsizei n, const GLuint * buffers);
1440 typedef void (GLAD_API_PTR *PFNGLDELETEFRAMEBUFFERSPROC)(GLsizei n, const GLuint * framebuffers);
1441 typedef void (GLAD_API_PTR *PFNGLDELETEPROGRAMPROC)(GLuint program);
1442 typedef void (GLAD_API_PTR *PFNGLDELETEQUERIESPROC)(GLsizei n, const GLuint * ids);
1443 typedef void (GLAD_API_PTR *PFNGLDELETERENDERBUFFERSPROC)(GLsizei n, const GLuint * renderbuffers);
1444 typedef void (GLAD_API_PTR *PFNGLDELETESAMPLERSPROC)(GLsizei count, const GLuint * samplers);
1445 typedef void (GLAD_API_PTR *PFNGLDELETESHADERPROC)(GLuint shader);
1446 typedef void (GLAD_API_PTR *PFNGLDELETESYNCPROC)(GLsync sync);
1447 typedef void (GLAD_API_PTR *PFNGLDELETETEXTURESPROC)(GLsizei n, const GLuint * textures);
1448 typedef void (GLAD_API_PTR *PFNGLDELETEVERTEXARRAYSPROC)(GLsizei n, const GLuint * arrays);
1449 typedef void (GLAD_API_PTR *PFNGLDEPTHFUNCPROC)(GLenum func);
1450 typedef void (GLAD_API_PTR *PFNGLDEPTHMASKPROC)(GLboolean flag);
1451 typedef void (GLAD_API_PTR *PFNGLDEPTHRANGEPROC)(GLdouble n, GLdouble f);
1452 typedef void (GLAD_API_PTR *PFNGLDETACHSHADERPROC)(GLuint program, GLuint shader);
1453 typedef void (GLAD_API_PTR *PFNGLDISABLEPROC)(GLenum cap);
1454 typedef void (GLAD_API_PTR *PFNGLDISABLEVERTEXATTRIBARRAYPROC)(GLuint index);
1455 typedef void (GLAD_API_PTR *PFNGLDISABLEIPROC)(GLenum target, GLuint index);
1456 typedef void (GLAD_API_PTR *PFNGLDRAWARRAYSPROC)(GLenum mode, GLint first, GLsizei count);
1457 typedef void (GLAD_API_PTR *PFNGLDRAWARRAYSINSTANCEDPROC)(GLenum mode, GLint first, GLsizei count, GLsizei instancecount);
1458 typedef void (GLAD_API_PTR *PFNGLDRAWBUFFERPROC)(GLenum buf);
1459 typedef void (GLAD_API_PTR *PFNGLDRAWBUFFERSPROC)(GLsizei n, const GLenum * bufs);
1460 typedef void (GLAD_API_PTR *PFNGLDRAWELEMENTSPROC)(GLenum mode, GLsizei count, GLenum type, const void * indices);
1461 typedef void (GLAD_API_PTR *PFNGLDRAWELEMENTSBASEVERTEXPROC)(GLenum mode, GLsizei count, GLenum type, const void * indices, GLint basevertex);
1462 typedef void (GLAD_API_PTR *PFNGLDRAWELEMENTSINSTANCEDPROC)(GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei instancecount);
1463 typedef void (GLAD_API_PTR *PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC)(GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei instancecount, GLint basevertex);
1464 typedef void (GLAD_API_PTR *PFNGLDRAWRANGEELEMENTSPROC)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void * indices);
1465 typedef void (GLAD_API_PTR *PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void * indices, GLint basevertex);
1466 typedef void (GLAD_API_PTR *PFNGLENABLEPROC)(GLenum cap);
1467 typedef void (GLAD_API_PTR *PFNGLENABLEVERTEXATTRIBARRAYPROC)(GLuint index);
1468 typedef void (GLAD_API_PTR *PFNGLENABLEIPROC)(GLenum target, GLuint index);
1469 typedef void (GLAD_API_PTR *PFNGLENDCONDITIONALRENDERPROC)(void);
1470 typedef void (GLAD_API_PTR *PFNGLENDQUERYPROC)(GLenum target);
1471 typedef void (GLAD_API_PTR *PFNGLENDTRANSFORMFEEDBACKPROC)(void);
1472 typedef GLsync (GLAD_API_PTR *PFNGLFENCESYNCPROC)(GLenum condition, GLbitfield flags);
1473 typedef void (GLAD_API_PTR *PFNGLFINISHPROC)(void);
1474 typedef void (GLAD_API_PTR *PFNGLFLUSHPROC)(void);
1475 typedef void (GLAD_API_PTR *PFNGLFLUSHMAPPEDBUFFERRANGEPROC)(GLenum target, GLintptr offset, GLsizeiptr length);
1476 typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERRENDERBUFFERPROC)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
1477 typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERTEXTUREPROC)(GLenum target, GLenum attachment, GLuint texture, GLint level);
1478 typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERTEXTURE1DPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
1479 typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERTEXTURE2DPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
1480 typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERTEXTURE3DPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
1481 typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERTEXTURELAYERPROC)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
1482 typedef void (GLAD_API_PTR *PFNGLFRONTFACEPROC)(GLenum mode);
1483 typedef void (GLAD_API_PTR *PFNGLGENBUFFERSPROC)(GLsizei n, GLuint * buffers);
1484 typedef void (GLAD_API_PTR *PFNGLGENFRAMEBUFFERSPROC)(GLsizei n, GLuint * framebuffers);
1485 typedef void (GLAD_API_PTR *PFNGLGENQUERIESPROC)(GLsizei n, GLuint * ids);
1486 typedef void (GLAD_API_PTR *PFNGLGENRENDERBUFFERSPROC)(GLsizei n, GLuint * renderbuffers);
1487 typedef void (GLAD_API_PTR *PFNGLGENSAMPLERSPROC)(GLsizei count, GLuint * samplers);
1488 typedef void (GLAD_API_PTR *PFNGLGENTEXTURESPROC)(GLsizei n, GLuint * textures);
1489 typedef void (GLAD_API_PTR *PFNGLGENVERTEXARRAYSPROC)(GLsizei n, GLuint * arrays);
1490 typedef void (GLAD_API_PTR *PFNGLGENERATEMIPMAPPROC)(GLenum target);
1491 typedef void (GLAD_API_PTR *PFNGLGETACTIVEATTRIBPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name);
1492 typedef void (GLAD_API_PTR *PFNGLGETACTIVEUNIFORMPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name);
1493 typedef void (GLAD_API_PTR *PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei * length, GLchar * uniformBlockName);
1494 typedef void (GLAD_API_PTR *PFNGLGETACTIVEUNIFORMBLOCKIVPROC)(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint * params);
1495 typedef void (GLAD_API_PTR *PFNGLGETACTIVEUNIFORMNAMEPROC)(GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei * length, GLchar * uniformName);
1496 typedef void (GLAD_API_PTR *PFNGLGETACTIVEUNIFORMSIVPROC)(GLuint program, GLsizei uniformCount, const GLuint * uniformIndices, GLenum pname, GLint * params);
1497 typedef void (GLAD_API_PTR *PFNGLGETATTACHEDSHADERSPROC)(GLuint program, GLsizei maxCount, GLsizei * count, GLuint * shaders);
1498 typedef GLint (GLAD_API_PTR *PFNGLGETATTRIBLOCATIONPROC)(GLuint program, const GLchar * name);
1499 typedef void (GLAD_API_PTR *PFNGLGETBOOLEANI_VPROC)(GLenum target, GLuint index, GLboolean * data);
1500 typedef void (GLAD_API_PTR *PFNGLGETBOOLEANVPROC)(GLenum pname, GLboolean * data);
1501 typedef void (GLAD_API_PTR *PFNGLGETBUFFERPARAMETERI64VPROC)(GLenum target, GLenum pname, GLint64 * params);
1502 typedef void (GLAD_API_PTR *PFNGLGETBUFFERPARAMETERIVPROC)(GLenum target, GLenum pname, GLint * params);
1503 typedef void (GLAD_API_PTR *PFNGLGETBUFFERPOINTERVPROC)(GLenum target, GLenum pname, void ** params);
1504 typedef void (GLAD_API_PTR *PFNGLGETBUFFERSUBDATAPROC)(GLenum target, GLintptr offset, GLsizeiptr size, void * data);
1505 typedef void (GLAD_API_PTR *PFNGLGETCOMPRESSEDTEXIMAGEPROC)(GLenum target, GLint level, void * img);
1506 typedef void (GLAD_API_PTR *PFNGLGETDOUBLEVPROC)(GLenum pname, GLdouble * data);
1507 typedef GLenum (GLAD_API_PTR *PFNGLGETERRORPROC)(void);
1508 typedef void (GLAD_API_PTR *PFNGLGETFLOATVPROC)(GLenum pname, GLfloat * data);
1509 typedef GLint (GLAD_API_PTR *PFNGLGETFRAGDATAINDEXPROC)(GLuint program, const GLchar * name);
1510 typedef GLint (GLAD_API_PTR *PFNGLGETFRAGDATALOCATIONPROC)(GLuint program, const GLchar * name);
1511 typedef void (GLAD_API_PTR *PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)(GLenum target, GLenum attachment, GLenum pname, GLint * params);
1512 typedef void (GLAD_API_PTR *PFNGLGETINTEGER64I_VPROC)(GLenum target, GLuint index, GLint64 * data);
1513 typedef void (GLAD_API_PTR *PFNGLGETINTEGER64VPROC)(GLenum pname, GLint64 * data);
1514 typedef void (GLAD_API_PTR *PFNGLGETINTEGERI_VPROC)(GLenum target, GLuint index, GLint * data);
1515 typedef void (GLAD_API_PTR *PFNGLGETINTEGERVPROC)(GLenum pname, GLint * data);
1516 typedef void (GLAD_API_PTR *PFNGLGETMULTISAMPLEFVPROC)(GLenum pname, GLuint index, GLfloat * val);
1517 typedef void (GLAD_API_PTR *PFNGLGETPROGRAMINFOLOGPROC)(GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog);
1518 typedef void (GLAD_API_PTR *PFNGLGETPROGRAMIVPROC)(GLuint program, GLenum pname, GLint * params);
1519 typedef void (GLAD_API_PTR *PFNGLGETQUERYOBJECTI64VPROC)(GLuint id, GLenum pname, GLint64 * params);
1520 typedef void (GLAD_API_PTR *PFNGLGETQUERYOBJECTIVPROC)(GLuint id, GLenum pname, GLint * params);
1521 typedef void (GLAD_API_PTR *PFNGLGETQUERYOBJECTUI64VPROC)(GLuint id, GLenum pname, GLuint64 * params);
1522 typedef void (GLAD_API_PTR *PFNGLGETQUERYOBJECTUIVPROC)(GLuint id, GLenum pname, GLuint * params);
1523 typedef void (GLAD_API_PTR *PFNGLGETQUERYIVPROC)(GLenum target, GLenum pname, GLint * params);
1524 typedef void (GLAD_API_PTR *PFNGLGETRENDERBUFFERPARAMETERIVPROC)(GLenum target, GLenum pname, GLint * params);
1525 typedef void (GLAD_API_PTR *PFNGLGETSAMPLERPARAMETERIIVPROC)(GLuint sampler, GLenum pname, GLint * params);
1526 typedef void (GLAD_API_PTR *PFNGLGETSAMPLERPARAMETERIUIVPROC)(GLuint sampler, GLenum pname, GLuint * params);
1527 typedef void (GLAD_API_PTR *PFNGLGETSAMPLERPARAMETERFVPROC)(GLuint sampler, GLenum pname, GLfloat * params);
1528 typedef void (GLAD_API_PTR *PFNGLGETSAMPLERPARAMETERIVPROC)(GLuint sampler, GLenum pname, GLint * params);
1529 typedef void (GLAD_API_PTR *PFNGLGETSHADERINFOLOGPROC)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog);
1530 typedef void (GLAD_API_PTR *PFNGLGETSHADERSOURCEPROC)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * source);
1531 typedef void (GLAD_API_PTR *PFNGLGETSHADERIVPROC)(GLuint shader, GLenum pname, GLint * params);
1532 typedef const GLubyte * (GLAD_API_PTR *PFNGLGETSTRINGPROC)(GLenum name);
1533 typedef const GLubyte * (GLAD_API_PTR *PFNGLGETSTRINGIPROC)(GLenum name, GLuint index);
1534 typedef void (GLAD_API_PTR *PFNGLGETSYNCIVPROC)(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * values);
1535 typedef void (GLAD_API_PTR *PFNGLGETTEXIMAGEPROC)(GLenum target, GLint level, GLenum format, GLenum type, void * pixels);
1536 typedef void (GLAD_API_PTR *PFNGLGETTEXLEVELPARAMETERFVPROC)(GLenum target, GLint level, GLenum pname, GLfloat * params);
1537 typedef void (GLAD_API_PTR *PFNGLGETTEXLEVELPARAMETERIVPROC)(GLenum target, GLint level, GLenum pname, GLint * params);
1538 typedef void (GLAD_API_PTR *PFNGLGETTEXPARAMETERIIVPROC)(GLenum target, GLenum pname, GLint * params);
1539 typedef void (GLAD_API_PTR *PFNGLGETTEXPARAMETERIUIVPROC)(GLenum target, GLenum pname, GLuint * params);
1540 typedef void (GLAD_API_PTR *PFNGLGETTEXPARAMETERFVPROC)(GLenum target, GLenum pname, GLfloat * params);
1541 typedef void (GLAD_API_PTR *PFNGLGETTEXPARAMETERIVPROC)(GLenum target, GLenum pname, GLint * params);
1542 typedef void (GLAD_API_PTR *PFNGLGETTRANSFORMFEEDBACKVARYINGPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, GLchar * name);
1543 typedef GLuint (GLAD_API_PTR *PFNGLGETUNIFORMBLOCKINDEXPROC)(GLuint program, const GLchar * uniformBlockName);
1544 typedef void (GLAD_API_PTR *PFNGLGETUNIFORMINDICESPROC)(GLuint program, GLsizei uniformCount, const GLchar *const* uniformNames, GLuint * uniformIndices);
1545 typedef GLint (GLAD_API_PTR *PFNGLGETUNIFORMLOCATIONPROC)(GLuint program, const GLchar * name);
1546 typedef void (GLAD_API_PTR *PFNGLGETUNIFORMFVPROC)(GLuint program, GLint location, GLfloat * params);
1547 typedef void (GLAD_API_PTR *PFNGLGETUNIFORMIVPROC)(GLuint program, GLint location, GLint * params);
1548 typedef void (GLAD_API_PTR *PFNGLGETUNIFORMUIVPROC)(GLuint program, GLint location, GLuint * params);
1549 typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBIIVPROC)(GLuint index, GLenum pname, GLint * params);
1550 typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBIUIVPROC)(GLuint index, GLenum pname, GLuint * params);
1551 typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBPOINTERVPROC)(GLuint index, GLenum pname, void ** pointer);
1552 typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBDVPROC)(GLuint index, GLenum pname, GLdouble * params);
1553 typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBFVPROC)(GLuint index, GLenum pname, GLfloat * params);
1554 typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBIVPROC)(GLuint index, GLenum pname, GLint * params);
1555 typedef void (GLAD_API_PTR *PFNGLHINTPROC)(GLenum target, GLenum mode);
1556 typedef GLboolean (GLAD_API_PTR *PFNGLISBUFFERPROC)(GLuint buffer);
1557 typedef GLboolean (GLAD_API_PTR *PFNGLISENABLEDPROC)(GLenum cap);
1558 typedef GLboolean (GLAD_API_PTR *PFNGLISENABLEDIPROC)(GLenum target, GLuint index);
1559 typedef GLboolean (GLAD_API_PTR *PFNGLISFRAMEBUFFERPROC)(GLuint framebuffer);
1560 typedef GLboolean (GLAD_API_PTR *PFNGLISPROGRAMPROC)(GLuint program);
1561 typedef GLboolean (GLAD_API_PTR *PFNGLISQUERYPROC)(GLuint id);
1562 typedef GLboolean (GLAD_API_PTR *PFNGLISRENDERBUFFERPROC)(GLuint renderbuffer);
1563 typedef GLboolean (GLAD_API_PTR *PFNGLISSAMPLERPROC)(GLuint sampler);
1564 typedef GLboolean (GLAD_API_PTR *PFNGLISSHADERPROC)(GLuint shader);
1565 typedef GLboolean (GLAD_API_PTR *PFNGLISSYNCPROC)(GLsync sync);
1566 typedef GLboolean (GLAD_API_PTR *PFNGLISTEXTUREPROC)(GLuint texture);
1567 typedef GLboolean (GLAD_API_PTR *PFNGLISVERTEXARRAYPROC)(GLuint array);
1568 typedef void (GLAD_API_PTR *PFNGLLINEWIDTHPROC)(GLfloat width);
1569 typedef void (GLAD_API_PTR *PFNGLLINKPROGRAMPROC)(GLuint program);
1570 typedef void (GLAD_API_PTR *PFNGLLOGICOPPROC)(GLenum opcode);
1571 typedef void * (GLAD_API_PTR *PFNGLMAPBUFFERPROC)(GLenum target, GLenum access);
1572 typedef void * (GLAD_API_PTR *PFNGLMAPBUFFERRANGEPROC)(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
1573 typedef void (GLAD_API_PTR *PFNGLMULTIDRAWARRAYSPROC)(GLenum mode, const GLint * first, const GLsizei * count, GLsizei drawcount);
1574 typedef void (GLAD_API_PTR *PFNGLMULTIDRAWELEMENTSPROC)(GLenum mode, const GLsizei * count, GLenum type, const void *const* indices, GLsizei drawcount);
1575 typedef void (GLAD_API_PTR *PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC)(GLenum mode, const GLsizei * count, GLenum type, const void *const* indices, GLsizei drawcount, const GLint * basevertex);
1576 typedef void (GLAD_API_PTR *PFNGLPIXELSTOREFPROC)(GLenum pname, GLfloat param);
1577 typedef void (GLAD_API_PTR *PFNGLPIXELSTOREIPROC)(GLenum pname, GLint param);
1578 typedef void (GLAD_API_PTR *PFNGLPOINTPARAMETERFPROC)(GLenum pname, GLfloat param);
1579 typedef void (GLAD_API_PTR *PFNGLPOINTPARAMETERFVPROC)(GLenum pname, const GLfloat * params);
1580 typedef void (GLAD_API_PTR *PFNGLPOINTPARAMETERIPROC)(GLenum pname, GLint param);
1581 typedef void (GLAD_API_PTR *PFNGLPOINTPARAMETERIVPROC)(GLenum pname, const GLint * params);
1582 typedef void (GLAD_API_PTR *PFNGLPOINTSIZEPROC)(GLfloat size);
1583 typedef void (GLAD_API_PTR *PFNGLPOLYGONMODEPROC)(GLenum face, GLenum mode);
1584 typedef void (GLAD_API_PTR *PFNGLPOLYGONOFFSETPROC)(GLfloat factor, GLfloat units);
1585 typedef void (GLAD_API_PTR *PFNGLPRIMITIVERESTARTINDEXPROC)(GLuint index);
1586 typedef void (GLAD_API_PTR *PFNGLPROVOKINGVERTEXPROC)(GLenum mode);
1587 typedef void (GLAD_API_PTR *PFNGLQUERYCOUNTERPROC)(GLuint id, GLenum target);
1588 typedef void (GLAD_API_PTR *PFNGLREADBUFFERPROC)(GLenum src);
1589 typedef void (GLAD_API_PTR *PFNGLREADPIXELSPROC)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void * pixels);
1590 typedef void (GLAD_API_PTR *PFNGLRENDERBUFFERSTORAGEPROC)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
1591 typedef void (GLAD_API_PTR *PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
1592 typedef void (GLAD_API_PTR *PFNGLSAMPLECOVERAGEPROC)(GLfloat value, GLboolean invert);
1593 typedef void (GLAD_API_PTR *PFNGLSAMPLEMASKIPROC)(GLuint maskNumber, GLbitfield mask);
1594 typedef void (GLAD_API_PTR *PFNGLSAMPLERPARAMETERIIVPROC)(GLuint sampler, GLenum pname, const GLint * param);
1595 typedef void (GLAD_API_PTR *PFNGLSAMPLERPARAMETERIUIVPROC)(GLuint sampler, GLenum pname, const GLuint * param);
1596 typedef void (GLAD_API_PTR *PFNGLSAMPLERPARAMETERFPROC)(GLuint sampler, GLenum pname, GLfloat param);
1597 typedef void (GLAD_API_PTR *PFNGLSAMPLERPARAMETERFVPROC)(GLuint sampler, GLenum pname, const GLfloat * param);
1598 typedef void (GLAD_API_PTR *PFNGLSAMPLERPARAMETERIPROC)(GLuint sampler, GLenum pname, GLint param);
1599 typedef void (GLAD_API_PTR *PFNGLSAMPLERPARAMETERIVPROC)(GLuint sampler, GLenum pname, const GLint * param);
1600 typedef void (GLAD_API_PTR *PFNGLSCISSORPROC)(GLint x, GLint y, GLsizei width, GLsizei height);
1601 typedef void (GLAD_API_PTR *PFNGLSHADERSOURCEPROC)(GLuint shader, GLsizei count, const GLchar *const* string, const GLint * length);
1602 typedef void (GLAD_API_PTR *PFNGLSTENCILFUNCPROC)(GLenum func, GLint ref, GLuint mask);
1603 typedef void (GLAD_API_PTR *PFNGLSTENCILFUNCSEPARATEPROC)(GLenum face, GLenum func, GLint ref, GLuint mask);
1604 typedef void (GLAD_API_PTR *PFNGLSTENCILMASKPROC)(GLuint mask);
1605 typedef void (GLAD_API_PTR *PFNGLSTENCILMASKSEPARATEPROC)(GLenum face, GLuint mask);
1606 typedef void (GLAD_API_PTR *PFNGLSTENCILOPPROC)(GLenum fail, GLenum zfail, GLenum zpass);
1607 typedef void (GLAD_API_PTR *PFNGLSTENCILOPSEPARATEPROC)(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
1608 typedef void (GLAD_API_PTR *PFNGLTEXBUFFERPROC)(GLenum target, GLenum internalformat, GLuint buffer);
1609 typedef void (GLAD_API_PTR *PFNGLTEXIMAGE1DPROC)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void * pixels);
1610 typedef void (GLAD_API_PTR *PFNGLTEXIMAGE2DPROC)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void * pixels);
1611 typedef void (GLAD_API_PTR *PFNGLTEXIMAGE2DMULTISAMPLEPROC)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
1612 typedef void (GLAD_API_PTR *PFNGLTEXIMAGE3DPROC)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void * pixels);
1613 typedef void (GLAD_API_PTR *PFNGLTEXIMAGE3DMULTISAMPLEPROC)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
1614 typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERIIVPROC)(GLenum target, GLenum pname, const GLint * params);
1615 typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERIUIVPROC)(GLenum target, GLenum pname, const GLuint * params);
1616 typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERFPROC)(GLenum target, GLenum pname, GLfloat param);
1617 typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERFVPROC)(GLenum target, GLenum pname, const GLfloat * params);
1618 typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERIPROC)(GLenum target, GLenum pname, GLint param);
1619 typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERIVPROC)(GLenum target, GLenum pname, const GLint * params);
1620 typedef void (GLAD_API_PTR *PFNGLTEXSUBIMAGE1DPROC)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void * pixels);
1621 typedef void (GLAD_API_PTR *PFNGLTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void * pixels);
1622 typedef void (GLAD_API_PTR *PFNGLTEXSUBIMAGE3DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void * pixels);
1623 typedef void (GLAD_API_PTR *PFNGLTRANSFORMFEEDBACKVARYINGSPROC)(GLuint program, GLsizei count, const GLchar *const* varyings, GLenum bufferMode);
1624 typedef void (GLAD_API_PTR *PFNGLUNIFORM1FPROC)(GLint location, GLfloat v0);
1625 typedef void (GLAD_API_PTR *PFNGLUNIFORM1FVPROC)(GLint location, GLsizei count, const GLfloat * value);
1626 typedef void (GLAD_API_PTR *PFNGLUNIFORM1IPROC)(GLint location, GLint v0);
1627 typedef void (GLAD_API_PTR *PFNGLUNIFORM1IVPROC)(GLint location, GLsizei count, const GLint * value);
1628 typedef void (GLAD_API_PTR *PFNGLUNIFORM1UIPROC)(GLint location, GLuint v0);
1629 typedef void (GLAD_API_PTR *PFNGLUNIFORM1UIVPROC)(GLint location, GLsizei count, const GLuint * value);
1630 typedef void (GLAD_API_PTR *PFNGLUNIFORM2FPROC)(GLint location, GLfloat v0, GLfloat v1);
1631 typedef void (GLAD_API_PTR *PFNGLUNIFORM2FVPROC)(GLint location, GLsizei count, const GLfloat * value);
1632 typedef void (GLAD_API_PTR *PFNGLUNIFORM2IPROC)(GLint location, GLint v0, GLint v1);
1633 typedef void (GLAD_API_PTR *PFNGLUNIFORM2IVPROC)(GLint location, GLsizei count, const GLint * value);
1634 typedef void (GLAD_API_PTR *PFNGLUNIFORM2UIPROC)(GLint location, GLuint v0, GLuint v1);
1635 typedef void (GLAD_API_PTR *PFNGLUNIFORM2UIVPROC)(GLint location, GLsizei count, const GLuint * value);
1636 typedef void (GLAD_API_PTR *PFNGLUNIFORM3FPROC)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
1637 typedef void (GLAD_API_PTR *PFNGLUNIFORM3FVPROC)(GLint location, GLsizei count, const GLfloat * value);
1638 typedef void (GLAD_API_PTR *PFNGLUNIFORM3IPROC)(GLint location, GLint v0, GLint v1, GLint v2);
1639 typedef void (GLAD_API_PTR *PFNGLUNIFORM3IVPROC)(GLint location, GLsizei count, const GLint * value);
1640 typedef void (GLAD_API_PTR *PFNGLUNIFORM3UIPROC)(GLint location, GLuint v0, GLuint v1, GLuint v2);
1641 typedef void (GLAD_API_PTR *PFNGLUNIFORM3UIVPROC)(GLint location, GLsizei count, const GLuint * value);
1642 typedef void (GLAD_API_PTR *PFNGLUNIFORM4FPROC)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
1643 typedef void (GLAD_API_PTR *PFNGLUNIFORM4FVPROC)(GLint location, GLsizei count, const GLfloat * value);
1644 typedef void (GLAD_API_PTR *PFNGLUNIFORM4IPROC)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
1645 typedef void (GLAD_API_PTR *PFNGLUNIFORM4IVPROC)(GLint location, GLsizei count, const GLint * value);
1646 typedef void (GLAD_API_PTR *PFNGLUNIFORM4UIPROC)(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
1647 typedef void (GLAD_API_PTR *PFNGLUNIFORM4UIVPROC)(GLint location, GLsizei count, const GLuint * value);
1648 typedef void (GLAD_API_PTR *PFNGLUNIFORMBLOCKBINDINGPROC)(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
1649 typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX2FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
1650 typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX2X3FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
1651 typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX2X4FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
1652 typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX3FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
1653 typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX3X2FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
1654 typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX3X4FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
1655 typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX4FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
1656 typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX4X2FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
1657 typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX4X3FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
1658 typedef GLboolean (GLAD_API_PTR *PFNGLUNMAPBUFFERPROC)(GLenum target);
1659 typedef void (GLAD_API_PTR *PFNGLUSEPROGRAMPROC)(GLuint program);
1660 typedef void (GLAD_API_PTR *PFNGLVALIDATEPROGRAMPROC)(GLuint program);
1661 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB1DPROC)(GLuint index, GLdouble x);
1662 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB1DVPROC)(GLuint index, const GLdouble * v);
1663 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB1FPROC)(GLuint index, GLfloat x);
1664 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB1FVPROC)(GLuint index, const GLfloat * v);
1665 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB1SPROC)(GLuint index, GLshort x);
1666 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB1SVPROC)(GLuint index, const GLshort * v);
1667 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB2DPROC)(GLuint index, GLdouble x, GLdouble y);
1668 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB2DVPROC)(GLuint index, const GLdouble * v);
1669 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB2FPROC)(GLuint index, GLfloat x, GLfloat y);
1670 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB2FVPROC)(GLuint index, const GLfloat * v);
1671 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB2SPROC)(GLuint index, GLshort x, GLshort y);
1672 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB2SVPROC)(GLuint index, const GLshort * v);
1673 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB3DPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z);
1674 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB3DVPROC)(GLuint index, const GLdouble * v);
1675 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB3FPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z);
1676 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB3FVPROC)(GLuint index, const GLfloat * v);
1677 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB3SPROC)(GLuint index, GLshort x, GLshort y, GLshort z);
1678 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB3SVPROC)(GLuint index, const GLshort * v);
1679 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4NBVPROC)(GLuint index, const GLbyte * v);
1680 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4NIVPROC)(GLuint index, const GLint * v);
1681 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4NSVPROC)(GLuint index, const GLshort * v);
1682 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4NUBPROC)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
1683 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4NUBVPROC)(GLuint index, const GLubyte * v);
1684 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4NUIVPROC)(GLuint index, const GLuint * v);
1685 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4NUSVPROC)(GLuint index, const GLushort * v);
1686 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4BVPROC)(GLuint index, const GLbyte * v);
1687 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4DPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
1688 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4DVPROC)(GLuint index, const GLdouble * v);
1689 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4FPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
1690 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4FVPROC)(GLuint index, const GLfloat * v);
1691 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4IVPROC)(GLuint index, const GLint * v);
1692 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4SPROC)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
1693 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4SVPROC)(GLuint index, const GLshort * v);
1694 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4UBVPROC)(GLuint index, const GLubyte * v);
1695 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4UIVPROC)(GLuint index, const GLuint * v);
1696 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4USVPROC)(GLuint index, const GLushort * v);
1697 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBDIVISORPROC)(GLuint index, GLuint divisor);
1698 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI1IPROC)(GLuint index, GLint x);
1699 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI1IVPROC)(GLuint index, const GLint * v);
1700 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI1UIPROC)(GLuint index, GLuint x);
1701 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI1UIVPROC)(GLuint index, const GLuint * v);
1702 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI2IPROC)(GLuint index, GLint x, GLint y);
1703 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI2IVPROC)(GLuint index, const GLint * v);
1704 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI2UIPROC)(GLuint index, GLuint x, GLuint y);
1705 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI2UIVPROC)(GLuint index, const GLuint * v);
1706 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI3IPROC)(GLuint index, GLint x, GLint y, GLint z);
1707 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI3IVPROC)(GLuint index, const GLint * v);
1708 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI3UIPROC)(GLuint index, GLuint x, GLuint y, GLuint z);
1709 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI3UIVPROC)(GLuint index, const GLuint * v);
1710 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4BVPROC)(GLuint index, const GLbyte * v);
1711 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4IPROC)(GLuint index, GLint x, GLint y, GLint z, GLint w);
1712 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4IVPROC)(GLuint index, const GLint * v);
1713 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4SVPROC)(GLuint index, const GLshort * v);
1714 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4UBVPROC)(GLuint index, const GLubyte * v);
1715 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4UIPROC)(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
1716 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4UIVPROC)(GLuint index, const GLuint * v);
1717 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4USVPROC)(GLuint index, const GLushort * v);
1718 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBIPOINTERPROC)(GLuint index, GLint size, GLenum type, GLsizei stride, const void * pointer);
1719 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBP1UIPROC)(GLuint index, GLenum type, GLboolean normalized, GLuint value);
1720 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBP1UIVPROC)(GLuint index, GLenum type, GLboolean normalized, const GLuint * value);
1721 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBP2UIPROC)(GLuint index, GLenum type, GLboolean normalized, GLuint value);
1722 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBP2UIVPROC)(GLuint index, GLenum type, GLboolean normalized, const GLuint * value);
1723 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBP3UIPROC)(GLuint index, GLenum type, GLboolean normalized, GLuint value);
1724 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBP3UIVPROC)(GLuint index, GLenum type, GLboolean normalized, const GLuint * value);
1725 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBP4UIPROC)(GLuint index, GLenum type, GLboolean normalized, GLuint value);
1726 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBP4UIVPROC)(GLuint index, GLenum type, GLboolean normalized, const GLuint * value);
1727 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBPOINTERPROC)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void * pointer);
1728 typedef void (GLAD_API_PTR *PFNGLVIEWPORTPROC)(GLint x, GLint y, GLsizei width, GLsizei height);
1729 typedef void (GLAD_API_PTR *PFNGLWAITSYNCPROC)(GLsync sync, GLbitfield flags, GLuint64 timeout);
1730
1731 GLAD_API_CALL PFNGLACTIVETEXTUREPROC glad_glActiveTexture;
1732 #define glActiveTexture glad_glActiveTexture
1733 GLAD_API_CALL PFNGLATTACHSHADERPROC glad_glAttachShader;
1734 #define glAttachShader glad_glAttachShader
1735 GLAD_API_CALL PFNGLBEGINCONDITIONALRENDERPROC glad_glBeginConditionalRender;
1736 #define glBeginConditionalRender glad_glBeginConditionalRender
1737 GLAD_API_CALL PFNGLBEGINQUERYPROC glad_glBeginQuery;
1738 #define glBeginQuery glad_glBeginQuery
1739 GLAD_API_CALL PFNGLBEGINTRANSFORMFEEDBACKPROC glad_glBeginTransformFeedback;
1740 #define glBeginTransformFeedback glad_glBeginTransformFeedback
1741 GLAD_API_CALL PFNGLBINDATTRIBLOCATIONPROC glad_glBindAttribLocation;
1742 #define glBindAttribLocation glad_glBindAttribLocation
1743 GLAD_API_CALL PFNGLBINDBUFFERPROC glad_glBindBuffer;
1744 #define glBindBuffer glad_glBindBuffer
1745 GLAD_API_CALL PFNGLBINDBUFFERBASEPROC glad_glBindBufferBase;
1746 #define glBindBufferBase glad_glBindBufferBase
1747 GLAD_API_CALL PFNGLBINDBUFFERRANGEPROC glad_glBindBufferRange;
1748 #define glBindBufferRange glad_glBindBufferRange
1749 GLAD_API_CALL PFNGLBINDFRAGDATALOCATIONPROC glad_glBindFragDataLocation;
1750 #define glBindFragDataLocation glad_glBindFragDataLocation
1751 GLAD_API_CALL PFNGLBINDFRAGDATALOCATIONINDEXEDPROC glad_glBindFragDataLocationIndexed;
1752 #define glBindFragDataLocationIndexed glad_glBindFragDataLocationIndexed
1753 GLAD_API_CALL PFNGLBINDFRAMEBUFFERPROC glad_glBindFramebuffer;
1754 #define glBindFramebuffer glad_glBindFramebuffer
1755 GLAD_API_CALL PFNGLBINDRENDERBUFFERPROC glad_glBindRenderbuffer;
1756 #define glBindRenderbuffer glad_glBindRenderbuffer
1757 GLAD_API_CALL PFNGLBINDSAMPLERPROC glad_glBindSampler;
1758 #define glBindSampler glad_glBindSampler
1759 GLAD_API_CALL PFNGLBINDTEXTUREPROC glad_glBindTexture;
1760 #define glBindTexture glad_glBindTexture
1761 GLAD_API_CALL PFNGLBINDVERTEXARRAYPROC glad_glBindVertexArray;
1762 #define glBindVertexArray glad_glBindVertexArray
1763 GLAD_API_CALL PFNGLBLENDCOLORPROC glad_glBlendColor;
1764 #define glBlendColor glad_glBlendColor
1765 GLAD_API_CALL PFNGLBLENDEQUATIONPROC glad_glBlendEquation;
1766 #define glBlendEquation glad_glBlendEquation
1767 GLAD_API_CALL PFNGLBLENDEQUATIONSEPARATEPROC glad_glBlendEquationSeparate;
1768 #define glBlendEquationSeparate glad_glBlendEquationSeparate
1769 GLAD_API_CALL PFNGLBLENDFUNCPROC glad_glBlendFunc;
1770 #define glBlendFunc glad_glBlendFunc
1771 GLAD_API_CALL PFNGLBLENDFUNCSEPARATEPROC glad_glBlendFuncSeparate;
1772 #define glBlendFuncSeparate glad_glBlendFuncSeparate
1773 GLAD_API_CALL PFNGLBLITFRAMEBUFFERPROC glad_glBlitFramebuffer;
1774 #define glBlitFramebuffer glad_glBlitFramebuffer
1775 GLAD_API_CALL PFNGLBUFFERDATAPROC glad_glBufferData;
1776 #define glBufferData glad_glBufferData
1777 GLAD_API_CALL PFNGLBUFFERSUBDATAPROC glad_glBufferSubData;
1778 #define glBufferSubData glad_glBufferSubData
1779 GLAD_API_CALL PFNGLCHECKFRAMEBUFFERSTATUSPROC glad_glCheckFramebufferStatus;
1780 #define glCheckFramebufferStatus glad_glCheckFramebufferStatus
1781 GLAD_API_CALL PFNGLCLAMPCOLORPROC glad_glClampColor;
1782 #define glClampColor glad_glClampColor
1783 GLAD_API_CALL PFNGLCLEARPROC glad_glClear;
1784 #define glClear glad_glClear
1785 GLAD_API_CALL PFNGLCLEARBUFFERFIPROC glad_glClearBufferfi;
1786 #define glClearBufferfi glad_glClearBufferfi
1787 GLAD_API_CALL PFNGLCLEARBUFFERFVPROC glad_glClearBufferfv;
1788 #define glClearBufferfv glad_glClearBufferfv
1789 GLAD_API_CALL PFNGLCLEARBUFFERIVPROC glad_glClearBufferiv;
1790 #define glClearBufferiv glad_glClearBufferiv
1791 GLAD_API_CALL PFNGLCLEARBUFFERUIVPROC glad_glClearBufferuiv;
1792 #define glClearBufferuiv glad_glClearBufferuiv
1793 GLAD_API_CALL PFNGLCLEARCOLORPROC glad_glClearColor;
1794 #define glClearColor glad_glClearColor
1795 GLAD_API_CALL PFNGLCLEARDEPTHPROC glad_glClearDepth;
1796 #define glClearDepth glad_glClearDepth
1797 GLAD_API_CALL PFNGLCLEARSTENCILPROC glad_glClearStencil;
1798 #define glClearStencil glad_glClearStencil
1799 GLAD_API_CALL PFNGLCLIENTWAITSYNCPROC glad_glClientWaitSync;
1800 #define glClientWaitSync glad_glClientWaitSync
1801 GLAD_API_CALL PFNGLCOLORMASKPROC glad_glColorMask;
1802 #define glColorMask glad_glColorMask
1803 GLAD_API_CALL PFNGLCOLORMASKIPROC glad_glColorMaski;
1804 #define glColorMaski glad_glColorMaski
1805 GLAD_API_CALL PFNGLCOMPILESHADERPROC glad_glCompileShader;
1806 #define glCompileShader glad_glCompileShader
1807 GLAD_API_CALL PFNGLCOMPRESSEDTEXIMAGE1DPROC glad_glCompressedTexImage1D;
1808 #define glCompressedTexImage1D glad_glCompressedTexImage1D
1809 GLAD_API_CALL PFNGLCOMPRESSEDTEXIMAGE2DPROC glad_glCompressedTexImage2D;
1810 #define glCompressedTexImage2D glad_glCompressedTexImage2D
1811 GLAD_API_CALL PFNGLCOMPRESSEDTEXIMAGE3DPROC glad_glCompressedTexImage3D;
1812 #define glCompressedTexImage3D glad_glCompressedTexImage3D
1813 GLAD_API_CALL PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC glad_glCompressedTexSubImage1D;
1814 #define glCompressedTexSubImage1D glad_glCompressedTexSubImage1D
1815 GLAD_API_CALL PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glad_glCompressedTexSubImage2D;
1816 #define glCompressedTexSubImage2D glad_glCompressedTexSubImage2D
1817 GLAD_API_CALL PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glad_glCompressedTexSubImage3D;
1818 #define glCompressedTexSubImage3D glad_glCompressedTexSubImage3D
1819 GLAD_API_CALL PFNGLCOPYBUFFERSUBDATAPROC glad_glCopyBufferSubData;
1820 #define glCopyBufferSubData glad_glCopyBufferSubData
1821 GLAD_API_CALL PFNGLCOPYTEXIMAGE1DPROC glad_glCopyTexImage1D;
1822 #define glCopyTexImage1D glad_glCopyTexImage1D
1823 GLAD_API_CALL PFNGLCOPYTEXIMAGE2DPROC glad_glCopyTexImage2D;
1824 #define glCopyTexImage2D glad_glCopyTexImage2D
1825 GLAD_API_CALL PFNGLCOPYTEXSUBIMAGE1DPROC glad_glCopyTexSubImage1D;
1826 #define glCopyTexSubImage1D glad_glCopyTexSubImage1D
1827 GLAD_API_CALL PFNGLCOPYTEXSUBIMAGE2DPROC glad_glCopyTexSubImage2D;
1828 #define glCopyTexSubImage2D glad_glCopyTexSubImage2D
1829 GLAD_API_CALL PFNGLCOPYTEXSUBIMAGE3DPROC glad_glCopyTexSubImage3D;
1830 #define glCopyTexSubImage3D glad_glCopyTexSubImage3D
1831 GLAD_API_CALL PFNGLCREATEPROGRAMPROC glad_glCreateProgram;
1832 #define glCreateProgram glad_glCreateProgram
1833 GLAD_API_CALL PFNGLCREATESHADERPROC glad_glCreateShader;
1834 #define glCreateShader glad_glCreateShader
1835 GLAD_API_CALL PFNGLCULLFACEPROC glad_glCullFace;
1836 #define glCullFace glad_glCullFace
1837 GLAD_API_CALL PFNGLDELETEBUFFERSPROC glad_glDeleteBuffers;
1838 #define glDeleteBuffers glad_glDeleteBuffers
1839 GLAD_API_CALL PFNGLDELETEFRAMEBUFFERSPROC glad_glDeleteFramebuffers;
1840 #define glDeleteFramebuffers glad_glDeleteFramebuffers
1841 GLAD_API_CALL PFNGLDELETEPROGRAMPROC glad_glDeleteProgram;
1842 #define glDeleteProgram glad_glDeleteProgram
1843 GLAD_API_CALL PFNGLDELETEQUERIESPROC glad_glDeleteQueries;
1844 #define glDeleteQueries glad_glDeleteQueries
1845 GLAD_API_CALL PFNGLDELETERENDERBUFFERSPROC glad_glDeleteRenderbuffers;
1846 #define glDeleteRenderbuffers glad_glDeleteRenderbuffers
1847 GLAD_API_CALL PFNGLDELETESAMPLERSPROC glad_glDeleteSamplers;
1848 #define glDeleteSamplers glad_glDeleteSamplers
1849 GLAD_API_CALL PFNGLDELETESHADERPROC glad_glDeleteShader;
1850 #define glDeleteShader glad_glDeleteShader
1851 GLAD_API_CALL PFNGLDELETESYNCPROC glad_glDeleteSync;
1852 #define glDeleteSync glad_glDeleteSync
1853 GLAD_API_CALL PFNGLDELETETEXTURESPROC glad_glDeleteTextures;
1854 #define glDeleteTextures glad_glDeleteTextures
1855 GLAD_API_CALL PFNGLDELETEVERTEXARRAYSPROC glad_glDeleteVertexArrays;
1856 #define glDeleteVertexArrays glad_glDeleteVertexArrays
1857 GLAD_API_CALL PFNGLDEPTHFUNCPROC glad_glDepthFunc;
1858 #define glDepthFunc glad_glDepthFunc
1859 GLAD_API_CALL PFNGLDEPTHMASKPROC glad_glDepthMask;
1860 #define glDepthMask glad_glDepthMask
1861 GLAD_API_CALL PFNGLDEPTHRANGEPROC glad_glDepthRange;
1862 #define glDepthRange glad_glDepthRange
1863 GLAD_API_CALL PFNGLDETACHSHADERPROC glad_glDetachShader;
1864 #define glDetachShader glad_glDetachShader
1865 GLAD_API_CALL PFNGLDISABLEPROC glad_glDisable;
1866 #define glDisable glad_glDisable
1867 GLAD_API_CALL PFNGLDISABLEVERTEXATTRIBARRAYPROC glad_glDisableVertexAttribArray;
1868 #define glDisableVertexAttribArray glad_glDisableVertexAttribArray
1869 GLAD_API_CALL PFNGLDISABLEIPROC glad_glDisablei;
1870 #define glDisablei glad_glDisablei
1871 GLAD_API_CALL PFNGLDRAWARRAYSPROC glad_glDrawArrays;
1872 #define glDrawArrays glad_glDrawArrays
1873 GLAD_API_CALL PFNGLDRAWARRAYSINSTANCEDPROC glad_glDrawArraysInstanced;
1874 #define glDrawArraysInstanced glad_glDrawArraysInstanced
1875 GLAD_API_CALL PFNGLDRAWBUFFERPROC glad_glDrawBuffer;
1876 #define glDrawBuffer glad_glDrawBuffer
1877 GLAD_API_CALL PFNGLDRAWBUFFERSPROC glad_glDrawBuffers;
1878 #define glDrawBuffers glad_glDrawBuffers
1879 GLAD_API_CALL PFNGLDRAWELEMENTSPROC glad_glDrawElements;
1880 #define glDrawElements glad_glDrawElements
1881 GLAD_API_CALL PFNGLDRAWELEMENTSBASEVERTEXPROC glad_glDrawElementsBaseVertex;
1882 #define glDrawElementsBaseVertex glad_glDrawElementsBaseVertex
1883 GLAD_API_CALL PFNGLDRAWELEMENTSINSTANCEDPROC glad_glDrawElementsInstanced;
1884 #define glDrawElementsInstanced glad_glDrawElementsInstanced
1885 GLAD_API_CALL PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC glad_glDrawElementsInstancedBaseVertex;
1886 #define glDrawElementsInstancedBaseVertex glad_glDrawElementsInstancedBaseVertex
1887 GLAD_API_CALL PFNGLDRAWRANGEELEMENTSPROC glad_glDrawRangeElements;
1888 #define glDrawRangeElements glad_glDrawRangeElements
1889 GLAD_API_CALL PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC glad_glDrawRangeElementsBaseVertex;
1890 #define glDrawRangeElementsBaseVertex glad_glDrawRangeElementsBaseVertex
1891 GLAD_API_CALL PFNGLENABLEPROC glad_glEnable;
1892 #define glEnable glad_glEnable
1893 GLAD_API_CALL PFNGLENABLEVERTEXATTRIBARRAYPROC glad_glEnableVertexAttribArray;
1894 #define glEnableVertexAttribArray glad_glEnableVertexAttribArray
1895 GLAD_API_CALL PFNGLENABLEIPROC glad_glEnablei;
1896 #define glEnablei glad_glEnablei
1897 GLAD_API_CALL PFNGLENDCONDITIONALRENDERPROC glad_glEndConditionalRender;
1898 #define glEndConditionalRender glad_glEndConditionalRender
1899 GLAD_API_CALL PFNGLENDQUERYPROC glad_glEndQuery;
1900 #define glEndQuery glad_glEndQuery
1901 GLAD_API_CALL PFNGLENDTRANSFORMFEEDBACKPROC glad_glEndTransformFeedback;
1902 #define glEndTransformFeedback glad_glEndTransformFeedback
1903 GLAD_API_CALL PFNGLFENCESYNCPROC glad_glFenceSync;
1904 #define glFenceSync glad_glFenceSync
1905 GLAD_API_CALL PFNGLFINISHPROC glad_glFinish;
1906 #define glFinish glad_glFinish
1907 GLAD_API_CALL PFNGLFLUSHPROC glad_glFlush;
1908 #define glFlush glad_glFlush
1909 GLAD_API_CALL PFNGLFLUSHMAPPEDBUFFERRANGEPROC glad_glFlushMappedBufferRange;
1910 #define glFlushMappedBufferRange glad_glFlushMappedBufferRange
1911 GLAD_API_CALL PFNGLFRAMEBUFFERRENDERBUFFERPROC glad_glFramebufferRenderbuffer;
1912 #define glFramebufferRenderbuffer glad_glFramebufferRenderbuffer
1913 GLAD_API_CALL PFNGLFRAMEBUFFERTEXTUREPROC glad_glFramebufferTexture;
1914 #define glFramebufferTexture glad_glFramebufferTexture
1915 GLAD_API_CALL PFNGLFRAMEBUFFERTEXTURE1DPROC glad_glFramebufferTexture1D;
1916 #define glFramebufferTexture1D glad_glFramebufferTexture1D
1917 GLAD_API_CALL PFNGLFRAMEBUFFERTEXTURE2DPROC glad_glFramebufferTexture2D;
1918 #define glFramebufferTexture2D glad_glFramebufferTexture2D
1919 GLAD_API_CALL PFNGLFRAMEBUFFERTEXTURE3DPROC glad_glFramebufferTexture3D;
1920 #define glFramebufferTexture3D glad_glFramebufferTexture3D
1921 GLAD_API_CALL PFNGLFRAMEBUFFERTEXTURELAYERPROC glad_glFramebufferTextureLayer;
1922 #define glFramebufferTextureLayer glad_glFramebufferTextureLayer
1923 GLAD_API_CALL PFNGLFRONTFACEPROC glad_glFrontFace;
1924 #define glFrontFace glad_glFrontFace
1925 GLAD_API_CALL PFNGLGENBUFFERSPROC glad_glGenBuffers;
1926 #define glGenBuffers glad_glGenBuffers
1927 GLAD_API_CALL PFNGLGENFRAMEBUFFERSPROC glad_glGenFramebuffers;
1928 #define glGenFramebuffers glad_glGenFramebuffers
1929 GLAD_API_CALL PFNGLGENQUERIESPROC glad_glGenQueries;
1930 #define glGenQueries glad_glGenQueries
1931 GLAD_API_CALL PFNGLGENRENDERBUFFERSPROC glad_glGenRenderbuffers;
1932 #define glGenRenderbuffers glad_glGenRenderbuffers
1933 GLAD_API_CALL PFNGLGENSAMPLERSPROC glad_glGenSamplers;
1934 #define glGenSamplers glad_glGenSamplers
1935 GLAD_API_CALL PFNGLGENTEXTURESPROC glad_glGenTextures;
1936 #define glGenTextures glad_glGenTextures
1937 GLAD_API_CALL PFNGLGENVERTEXARRAYSPROC glad_glGenVertexArrays;
1938 #define glGenVertexArrays glad_glGenVertexArrays
1939 GLAD_API_CALL PFNGLGENERATEMIPMAPPROC glad_glGenerateMipmap;
1940 #define glGenerateMipmap glad_glGenerateMipmap
1941 GLAD_API_CALL PFNGLGETACTIVEATTRIBPROC glad_glGetActiveAttrib;
1942 #define glGetActiveAttrib glad_glGetActiveAttrib
1943 GLAD_API_CALL PFNGLGETACTIVEUNIFORMPROC glad_glGetActiveUniform;
1944 #define glGetActiveUniform glad_glGetActiveUniform
1945 GLAD_API_CALL PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC glad_glGetActiveUniformBlockName;
1946 #define glGetActiveUniformBlockName glad_glGetActiveUniformBlockName
1947 GLAD_API_CALL PFNGLGETACTIVEUNIFORMBLOCKIVPROC glad_glGetActiveUniformBlockiv;
1948 #define glGetActiveUniformBlockiv glad_glGetActiveUniformBlockiv
1949 GLAD_API_CALL PFNGLGETACTIVEUNIFORMNAMEPROC glad_glGetActiveUniformName;
1950 #define glGetActiveUniformName glad_glGetActiveUniformName
1951 GLAD_API_CALL PFNGLGETACTIVEUNIFORMSIVPROC glad_glGetActiveUniformsiv;
1952 #define glGetActiveUniformsiv glad_glGetActiveUniformsiv
1953 GLAD_API_CALL PFNGLGETATTACHEDSHADERSPROC glad_glGetAttachedShaders;
1954 #define glGetAttachedShaders glad_glGetAttachedShaders
1955 GLAD_API_CALL PFNGLGETATTRIBLOCATIONPROC glad_glGetAttribLocation;
1956 #define glGetAttribLocation glad_glGetAttribLocation
1957 GLAD_API_CALL PFNGLGETBOOLEANI_VPROC glad_glGetBooleani_v;
1958 #define glGetBooleani_v glad_glGetBooleani_v
1959 GLAD_API_CALL PFNGLGETBOOLEANVPROC glad_glGetBooleanv;
1960 #define glGetBooleanv glad_glGetBooleanv
1961 GLAD_API_CALL PFNGLGETBUFFERPARAMETERI64VPROC glad_glGetBufferParameteri64v;
1962 #define glGetBufferParameteri64v glad_glGetBufferParameteri64v
1963 GLAD_API_CALL PFNGLGETBUFFERPARAMETERIVPROC glad_glGetBufferParameteriv;
1964 #define glGetBufferParameteriv glad_glGetBufferParameteriv
1965 GLAD_API_CALL PFNGLGETBUFFERPOINTERVPROC glad_glGetBufferPointerv;
1966 #define glGetBufferPointerv glad_glGetBufferPointerv
1967 GLAD_API_CALL PFNGLGETBUFFERSUBDATAPROC glad_glGetBufferSubData;
1968 #define glGetBufferSubData glad_glGetBufferSubData
1969 GLAD_API_CALL PFNGLGETCOMPRESSEDTEXIMAGEPROC glad_glGetCompressedTexImage;
1970 #define glGetCompressedTexImage glad_glGetCompressedTexImage
1971 GLAD_API_CALL PFNGLGETDOUBLEVPROC glad_glGetDoublev;
1972 #define glGetDoublev glad_glGetDoublev
1973 GLAD_API_CALL PFNGLGETERRORPROC glad_glGetError;
1974 #define glGetError glad_glGetError
1975 GLAD_API_CALL PFNGLGETFLOATVPROC glad_glGetFloatv;
1976 #define glGetFloatv glad_glGetFloatv
1977 GLAD_API_CALL PFNGLGETFRAGDATAINDEXPROC glad_glGetFragDataIndex;
1978 #define glGetFragDataIndex glad_glGetFragDataIndex
1979 GLAD_API_CALL PFNGLGETFRAGDATALOCATIONPROC glad_glGetFragDataLocation;
1980 #define glGetFragDataLocation glad_glGetFragDataLocation
1981 GLAD_API_CALL PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetFramebufferAttachmentParameteriv;
1982 #define glGetFramebufferAttachmentParameteriv glad_glGetFramebufferAttachmentParameteriv
1983 GLAD_API_CALL PFNGLGETINTEGER64I_VPROC glad_glGetInteger64i_v;
1984 #define glGetInteger64i_v glad_glGetInteger64i_v
1985 GLAD_API_CALL PFNGLGETINTEGER64VPROC glad_glGetInteger64v;
1986 #define glGetInteger64v glad_glGetInteger64v
1987 GLAD_API_CALL PFNGLGETINTEGERI_VPROC glad_glGetIntegeri_v;
1988 #define glGetIntegeri_v glad_glGetIntegeri_v
1989 GLAD_API_CALL PFNGLGETINTEGERVPROC glad_glGetIntegerv;
1990 #define glGetIntegerv glad_glGetIntegerv
1991 GLAD_API_CALL PFNGLGETMULTISAMPLEFVPROC glad_glGetMultisamplefv;
1992 #define glGetMultisamplefv glad_glGetMultisamplefv
1993 GLAD_API_CALL PFNGLGETPROGRAMINFOLOGPROC glad_glGetProgramInfoLog;
1994 #define glGetProgramInfoLog glad_glGetProgramInfoLog
1995 GLAD_API_CALL PFNGLGETPROGRAMIVPROC glad_glGetProgramiv;
1996 #define glGetProgramiv glad_glGetProgramiv
1997 GLAD_API_CALL PFNGLGETQUERYOBJECTI64VPROC glad_glGetQueryObjecti64v;
1998 #define glGetQueryObjecti64v glad_glGetQueryObjecti64v
1999 GLAD_API_CALL PFNGLGETQUERYOBJECTIVPROC glad_glGetQueryObjectiv;
2000 #define glGetQueryObjectiv glad_glGetQueryObjectiv
2001 GLAD_API_CALL PFNGLGETQUERYOBJECTUI64VPROC glad_glGetQueryObjectui64v;
2002 #define glGetQueryObjectui64v glad_glGetQueryObjectui64v
2003 GLAD_API_CALL PFNGLGETQUERYOBJECTUIVPROC glad_glGetQueryObjectuiv;
2004 #define glGetQueryObjectuiv glad_glGetQueryObjectuiv
2005 GLAD_API_CALL PFNGLGETQUERYIVPROC glad_glGetQueryiv;
2006 #define glGetQueryiv glad_glGetQueryiv
2007 GLAD_API_CALL PFNGLGETRENDERBUFFERPARAMETERIVPROC glad_glGetRenderbufferParameteriv;
2008 #define glGetRenderbufferParameteriv glad_glGetRenderbufferParameteriv
2009 GLAD_API_CALL PFNGLGETSAMPLERPARAMETERIIVPROC glad_glGetSamplerParameterIiv;
2010 #define glGetSamplerParameterIiv glad_glGetSamplerParameterIiv
2011 GLAD_API_CALL PFNGLGETSAMPLERPARAMETERIUIVPROC glad_glGetSamplerParameterIuiv;
2012 #define glGetSamplerParameterIuiv glad_glGetSamplerParameterIuiv
2013 GLAD_API_CALL PFNGLGETSAMPLERPARAMETERFVPROC glad_glGetSamplerParameterfv;
2014 #define glGetSamplerParameterfv glad_glGetSamplerParameterfv
2015 GLAD_API_CALL PFNGLGETSAMPLERPARAMETERIVPROC glad_glGetSamplerParameteriv;
2016 #define glGetSamplerParameteriv glad_glGetSamplerParameteriv
2017 GLAD_API_CALL PFNGLGETSHADERINFOLOGPROC glad_glGetShaderInfoLog;
2018 #define glGetShaderInfoLog glad_glGetShaderInfoLog
2019 GLAD_API_CALL PFNGLGETSHADERSOURCEPROC glad_glGetShaderSource;
2020 #define glGetShaderSource glad_glGetShaderSource
2021 GLAD_API_CALL PFNGLGETSHADERIVPROC glad_glGetShaderiv;
2022 #define glGetShaderiv glad_glGetShaderiv
2023 GLAD_API_CALL PFNGLGETSTRINGPROC glad_glGetString;
2024 #define glGetString glad_glGetString
2025 GLAD_API_CALL PFNGLGETSTRINGIPROC glad_glGetStringi;
2026 #define glGetStringi glad_glGetStringi
2027 GLAD_API_CALL PFNGLGETSYNCIVPROC glad_glGetSynciv;
2028 #define glGetSynciv glad_glGetSynciv
2029 GLAD_API_CALL PFNGLGETTEXIMAGEPROC glad_glGetTexImage;
2030 #define glGetTexImage glad_glGetTexImage
2031 GLAD_API_CALL PFNGLGETTEXLEVELPARAMETERFVPROC glad_glGetTexLevelParameterfv;
2032 #define glGetTexLevelParameterfv glad_glGetTexLevelParameterfv
2033 GLAD_API_CALL PFNGLGETTEXLEVELPARAMETERIVPROC glad_glGetTexLevelParameteriv;
2034 #define glGetTexLevelParameteriv glad_glGetTexLevelParameteriv
2035 GLAD_API_CALL PFNGLGETTEXPARAMETERIIVPROC glad_glGetTexParameterIiv;
2036 #define glGetTexParameterIiv glad_glGetTexParameterIiv
2037 GLAD_API_CALL PFNGLGETTEXPARAMETERIUIVPROC glad_glGetTexParameterIuiv;
2038 #define glGetTexParameterIuiv glad_glGetTexParameterIuiv
2039 GLAD_API_CALL PFNGLGETTEXPARAMETERFVPROC glad_glGetTexParameterfv;
2040 #define glGetTexParameterfv glad_glGetTexParameterfv
2041 GLAD_API_CALL PFNGLGETTEXPARAMETERIVPROC glad_glGetTexParameteriv;
2042 #define glGetTexParameteriv glad_glGetTexParameteriv
2043 GLAD_API_CALL PFNGLGETTRANSFORMFEEDBACKVARYINGPROC glad_glGetTransformFeedbackVarying;
2044 #define glGetTransformFeedbackVarying glad_glGetTransformFeedbackVarying
2045 GLAD_API_CALL PFNGLGETUNIFORMBLOCKINDEXPROC glad_glGetUniformBlockIndex;
2046 #define glGetUniformBlockIndex glad_glGetUniformBlockIndex
2047 GLAD_API_CALL PFNGLGETUNIFORMINDICESPROC glad_glGetUniformIndices;
2048 #define glGetUniformIndices glad_glGetUniformIndices
2049 GLAD_API_CALL PFNGLGETUNIFORMLOCATIONPROC glad_glGetUniformLocation;
2050 #define glGetUniformLocation glad_glGetUniformLocation
2051 GLAD_API_CALL PFNGLGETUNIFORMFVPROC glad_glGetUniformfv;
2052 #define glGetUniformfv glad_glGetUniformfv
2053 GLAD_API_CALL PFNGLGETUNIFORMIVPROC glad_glGetUniformiv;
2054 #define glGetUniformiv glad_glGetUniformiv
2055 GLAD_API_CALL PFNGLGETUNIFORMUIVPROC glad_glGetUniformuiv;
2056 #define glGetUniformuiv glad_glGetUniformuiv
2057 GLAD_API_CALL PFNGLGETVERTEXATTRIBIIVPROC glad_glGetVertexAttribIiv;
2058 #define glGetVertexAttribIiv glad_glGetVertexAttribIiv
2059 GLAD_API_CALL PFNGLGETVERTEXATTRIBIUIVPROC glad_glGetVertexAttribIuiv;
2060 #define glGetVertexAttribIuiv glad_glGetVertexAttribIuiv
2061 GLAD_API_CALL PFNGLGETVERTEXATTRIBPOINTERVPROC glad_glGetVertexAttribPointerv;
2062 #define glGetVertexAttribPointerv glad_glGetVertexAttribPointerv
2063 GLAD_API_CALL PFNGLGETVERTEXATTRIBDVPROC glad_glGetVertexAttribdv;
2064 #define glGetVertexAttribdv glad_glGetVertexAttribdv
2065 GLAD_API_CALL PFNGLGETVERTEXATTRIBFVPROC glad_glGetVertexAttribfv;
2066 #define glGetVertexAttribfv glad_glGetVertexAttribfv
2067 GLAD_API_CALL PFNGLGETVERTEXATTRIBIVPROC glad_glGetVertexAttribiv;
2068 #define glGetVertexAttribiv glad_glGetVertexAttribiv
2069 GLAD_API_CALL PFNGLHINTPROC glad_glHint;
2070 #define glHint glad_glHint
2071 GLAD_API_CALL PFNGLISBUFFERPROC glad_glIsBuffer;
2072 #define glIsBuffer glad_glIsBuffer
2073 GLAD_API_CALL PFNGLISENABLEDPROC glad_glIsEnabled;
2074 #define glIsEnabled glad_glIsEnabled
2075 GLAD_API_CALL PFNGLISENABLEDIPROC glad_glIsEnabledi;
2076 #define glIsEnabledi glad_glIsEnabledi
2077 GLAD_API_CALL PFNGLISFRAMEBUFFERPROC glad_glIsFramebuffer;
2078 #define glIsFramebuffer glad_glIsFramebuffer
2079 GLAD_API_CALL PFNGLISPROGRAMPROC glad_glIsProgram;
2080 #define glIsProgram glad_glIsProgram
2081 GLAD_API_CALL PFNGLISQUERYPROC glad_glIsQuery;
2082 #define glIsQuery glad_glIsQuery
2083 GLAD_API_CALL PFNGLISRENDERBUFFERPROC glad_glIsRenderbuffer;
2084 #define glIsRenderbuffer glad_glIsRenderbuffer
2085 GLAD_API_CALL PFNGLISSAMPLERPROC glad_glIsSampler;
2086 #define glIsSampler glad_glIsSampler
2087 GLAD_API_CALL PFNGLISSHADERPROC glad_glIsShader;
2088 #define glIsShader glad_glIsShader
2089 GLAD_API_CALL PFNGLISSYNCPROC glad_glIsSync;
2090 #define glIsSync glad_glIsSync
2091 GLAD_API_CALL PFNGLISTEXTUREPROC glad_glIsTexture;
2092 #define glIsTexture glad_glIsTexture
2093 GLAD_API_CALL PFNGLISVERTEXARRAYPROC glad_glIsVertexArray;
2094 #define glIsVertexArray glad_glIsVertexArray
2095 GLAD_API_CALL PFNGLLINEWIDTHPROC glad_glLineWidth;
2096 #define glLineWidth glad_glLineWidth
2097 GLAD_API_CALL PFNGLLINKPROGRAMPROC glad_glLinkProgram;
2098 #define glLinkProgram glad_glLinkProgram
2099 GLAD_API_CALL PFNGLLOGICOPPROC glad_glLogicOp;
2100 #define glLogicOp glad_glLogicOp
2101 GLAD_API_CALL PFNGLMAPBUFFERPROC glad_glMapBuffer;
2102 #define glMapBuffer glad_glMapBuffer
2103 GLAD_API_CALL PFNGLMAPBUFFERRANGEPROC glad_glMapBufferRange;
2104 #define glMapBufferRange glad_glMapBufferRange
2105 GLAD_API_CALL PFNGLMULTIDRAWARRAYSPROC glad_glMultiDrawArrays;
2106 #define glMultiDrawArrays glad_glMultiDrawArrays
2107 GLAD_API_CALL PFNGLMULTIDRAWELEMENTSPROC glad_glMultiDrawElements;
2108 #define glMultiDrawElements glad_glMultiDrawElements
2109 GLAD_API_CALL PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC glad_glMultiDrawElementsBaseVertex;
2110 #define glMultiDrawElementsBaseVertex glad_glMultiDrawElementsBaseVertex
2111 GLAD_API_CALL PFNGLPIXELSTOREFPROC glad_glPixelStoref;
2112 #define glPixelStoref glad_glPixelStoref
2113 GLAD_API_CALL PFNGLPIXELSTOREIPROC glad_glPixelStorei;
2114 #define glPixelStorei glad_glPixelStorei
2115 GLAD_API_CALL PFNGLPOINTPARAMETERFPROC glad_glPointParameterf;
2116 #define glPointParameterf glad_glPointParameterf
2117 GLAD_API_CALL PFNGLPOINTPARAMETERFVPROC glad_glPointParameterfv;
2118 #define glPointParameterfv glad_glPointParameterfv
2119 GLAD_API_CALL PFNGLPOINTPARAMETERIPROC glad_glPointParameteri;
2120 #define glPointParameteri glad_glPointParameteri
2121 GLAD_API_CALL PFNGLPOINTPARAMETERIVPROC glad_glPointParameteriv;
2122 #define glPointParameteriv glad_glPointParameteriv
2123 GLAD_API_CALL PFNGLPOINTSIZEPROC glad_glPointSize;
2124 #define glPointSize glad_glPointSize
2125 GLAD_API_CALL PFNGLPOLYGONMODEPROC glad_glPolygonMode;
2126 #define glPolygonMode glad_glPolygonMode
2127 GLAD_API_CALL PFNGLPOLYGONOFFSETPROC glad_glPolygonOffset;
2128 #define glPolygonOffset glad_glPolygonOffset
2129 GLAD_API_CALL PFNGLPRIMITIVERESTARTINDEXPROC glad_glPrimitiveRestartIndex;
2130 #define glPrimitiveRestartIndex glad_glPrimitiveRestartIndex
2131 GLAD_API_CALL PFNGLPROVOKINGVERTEXPROC glad_glProvokingVertex;
2132 #define glProvokingVertex glad_glProvokingVertex
2133 GLAD_API_CALL PFNGLQUERYCOUNTERPROC glad_glQueryCounter;
2134 #define glQueryCounter glad_glQueryCounter
2135 GLAD_API_CALL PFNGLREADBUFFERPROC glad_glReadBuffer;
2136 #define glReadBuffer glad_glReadBuffer
2137 GLAD_API_CALL PFNGLREADPIXELSPROC glad_glReadPixels;
2138 #define glReadPixels glad_glReadPixels
2139 GLAD_API_CALL PFNGLRENDERBUFFERSTORAGEPROC glad_glRenderbufferStorage;
2140 #define glRenderbufferStorage glad_glRenderbufferStorage
2141 GLAD_API_CALL PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC glad_glRenderbufferStorageMultisample;
2142 #define glRenderbufferStorageMultisample glad_glRenderbufferStorageMultisample
2143 GLAD_API_CALL PFNGLSAMPLECOVERAGEPROC glad_glSampleCoverage;
2144 #define glSampleCoverage glad_glSampleCoverage
2145 GLAD_API_CALL PFNGLSAMPLEMASKIPROC glad_glSampleMaski;
2146 #define glSampleMaski glad_glSampleMaski
2147 GLAD_API_CALL PFNGLSAMPLERPARAMETERIIVPROC glad_glSamplerParameterIiv;
2148 #define glSamplerParameterIiv glad_glSamplerParameterIiv
2149 GLAD_API_CALL PFNGLSAMPLERPARAMETERIUIVPROC glad_glSamplerParameterIuiv;
2150 #define glSamplerParameterIuiv glad_glSamplerParameterIuiv
2151 GLAD_API_CALL PFNGLSAMPLERPARAMETERFPROC glad_glSamplerParameterf;
2152 #define glSamplerParameterf glad_glSamplerParameterf
2153 GLAD_API_CALL PFNGLSAMPLERPARAMETERFVPROC glad_glSamplerParameterfv;
2154 #define glSamplerParameterfv glad_glSamplerParameterfv
2155 GLAD_API_CALL PFNGLSAMPLERPARAMETERIPROC glad_glSamplerParameteri;
2156 #define glSamplerParameteri glad_glSamplerParameteri
2157 GLAD_API_CALL PFNGLSAMPLERPARAMETERIVPROC glad_glSamplerParameteriv;
2158 #define glSamplerParameteriv glad_glSamplerParameteriv
2159 GLAD_API_CALL PFNGLSCISSORPROC glad_glScissor;
2160 #define glScissor glad_glScissor
2161 GLAD_API_CALL PFNGLSHADERSOURCEPROC glad_glShaderSource;
2162 #define glShaderSource glad_glShaderSource
2163 GLAD_API_CALL PFNGLSTENCILFUNCPROC glad_glStencilFunc;
2164 #define glStencilFunc glad_glStencilFunc
2165 GLAD_API_CALL PFNGLSTENCILFUNCSEPARATEPROC glad_glStencilFuncSeparate;
2166 #define glStencilFuncSeparate glad_glStencilFuncSeparate
2167 GLAD_API_CALL PFNGLSTENCILMASKPROC glad_glStencilMask;
2168 #define glStencilMask glad_glStencilMask
2169 GLAD_API_CALL PFNGLSTENCILMASKSEPARATEPROC glad_glStencilMaskSeparate;
2170 #define glStencilMaskSeparate glad_glStencilMaskSeparate
2171 GLAD_API_CALL PFNGLSTENCILOPPROC glad_glStencilOp;
2172 #define glStencilOp glad_glStencilOp
2173 GLAD_API_CALL PFNGLSTENCILOPSEPARATEPROC glad_glStencilOpSeparate;
2174 #define glStencilOpSeparate glad_glStencilOpSeparate
2175 GLAD_API_CALL PFNGLTEXBUFFERPROC glad_glTexBuffer;
2176 #define glTexBuffer glad_glTexBuffer
2177 GLAD_API_CALL PFNGLTEXIMAGE1DPROC glad_glTexImage1D;
2178 #define glTexImage1D glad_glTexImage1D
2179 GLAD_API_CALL PFNGLTEXIMAGE2DPROC glad_glTexImage2D;
2180 #define glTexImage2D glad_glTexImage2D
2181 GLAD_API_CALL PFNGLTEXIMAGE2DMULTISAMPLEPROC glad_glTexImage2DMultisample;
2182 #define glTexImage2DMultisample glad_glTexImage2DMultisample
2183 GLAD_API_CALL PFNGLTEXIMAGE3DPROC glad_glTexImage3D;
2184 #define glTexImage3D glad_glTexImage3D
2185 GLAD_API_CALL PFNGLTEXIMAGE3DMULTISAMPLEPROC glad_glTexImage3DMultisample;
2186 #define glTexImage3DMultisample glad_glTexImage3DMultisample
2187 GLAD_API_CALL PFNGLTEXPARAMETERIIVPROC glad_glTexParameterIiv;
2188 #define glTexParameterIiv glad_glTexParameterIiv
2189 GLAD_API_CALL PFNGLTEXPARAMETERIUIVPROC glad_glTexParameterIuiv;
2190 #define glTexParameterIuiv glad_glTexParameterIuiv
2191 GLAD_API_CALL PFNGLTEXPARAMETERFPROC glad_glTexParameterf;
2192 #define glTexParameterf glad_glTexParameterf
2193 GLAD_API_CALL PFNGLTEXPARAMETERFVPROC glad_glTexParameterfv;
2194 #define glTexParameterfv glad_glTexParameterfv
2195 GLAD_API_CALL PFNGLTEXPARAMETERIPROC glad_glTexParameteri;
2196 #define glTexParameteri glad_glTexParameteri
2197 GLAD_API_CALL PFNGLTEXPARAMETERIVPROC glad_glTexParameteriv;
2198 #define glTexParameteriv glad_glTexParameteriv
2199 GLAD_API_CALL PFNGLTEXSUBIMAGE1DPROC glad_glTexSubImage1D;
2200 #define glTexSubImage1D glad_glTexSubImage1D
2201 GLAD_API_CALL PFNGLTEXSUBIMAGE2DPROC glad_glTexSubImage2D;
2202 #define glTexSubImage2D glad_glTexSubImage2D
2203 GLAD_API_CALL PFNGLTEXSUBIMAGE3DPROC glad_glTexSubImage3D;
2204 #define glTexSubImage3D glad_glTexSubImage3D
2205 GLAD_API_CALL PFNGLTRANSFORMFEEDBACKVARYINGSPROC glad_glTransformFeedbackVaryings;
2206 #define glTransformFeedbackVaryings glad_glTransformFeedbackVaryings
2207 GLAD_API_CALL PFNGLUNIFORM1FPROC glad_glUniform1f;
2208 #define glUniform1f glad_glUniform1f
2209 GLAD_API_CALL PFNGLUNIFORM1FVPROC glad_glUniform1fv;
2210 #define glUniform1fv glad_glUniform1fv
2211 GLAD_API_CALL PFNGLUNIFORM1IPROC glad_glUniform1i;
2212 #define glUniform1i glad_glUniform1i
2213 GLAD_API_CALL PFNGLUNIFORM1IVPROC glad_glUniform1iv;
2214 #define glUniform1iv glad_glUniform1iv
2215 GLAD_API_CALL PFNGLUNIFORM1UIPROC glad_glUniform1ui;
2216 #define glUniform1ui glad_glUniform1ui
2217 GLAD_API_CALL PFNGLUNIFORM1UIVPROC glad_glUniform1uiv;
2218 #define glUniform1uiv glad_glUniform1uiv
2219 GLAD_API_CALL PFNGLUNIFORM2FPROC glad_glUniform2f;
2220 #define glUniform2f glad_glUniform2f
2221 GLAD_API_CALL PFNGLUNIFORM2FVPROC glad_glUniform2fv;
2222 #define glUniform2fv glad_glUniform2fv
2223 GLAD_API_CALL PFNGLUNIFORM2IPROC glad_glUniform2i;
2224 #define glUniform2i glad_glUniform2i
2225 GLAD_API_CALL PFNGLUNIFORM2IVPROC glad_glUniform2iv;
2226 #define glUniform2iv glad_glUniform2iv
2227 GLAD_API_CALL PFNGLUNIFORM2UIPROC glad_glUniform2ui;
2228 #define glUniform2ui glad_glUniform2ui
2229 GLAD_API_CALL PFNGLUNIFORM2UIVPROC glad_glUniform2uiv;
2230 #define glUniform2uiv glad_glUniform2uiv
2231 GLAD_API_CALL PFNGLUNIFORM3FPROC glad_glUniform3f;
2232 #define glUniform3f glad_glUniform3f
2233 GLAD_API_CALL PFNGLUNIFORM3FVPROC glad_glUniform3fv;
2234 #define glUniform3fv glad_glUniform3fv
2235 GLAD_API_CALL PFNGLUNIFORM3IPROC glad_glUniform3i;
2236 #define glUniform3i glad_glUniform3i
2237 GLAD_API_CALL PFNGLUNIFORM3IVPROC glad_glUniform3iv;
2238 #define glUniform3iv glad_glUniform3iv
2239 GLAD_API_CALL PFNGLUNIFORM3UIPROC glad_glUniform3ui;
2240 #define glUniform3ui glad_glUniform3ui
2241 GLAD_API_CALL PFNGLUNIFORM3UIVPROC glad_glUniform3uiv;
2242 #define glUniform3uiv glad_glUniform3uiv
2243 GLAD_API_CALL PFNGLUNIFORM4FPROC glad_glUniform4f;
2244 #define glUniform4f glad_glUniform4f
2245 GLAD_API_CALL PFNGLUNIFORM4FVPROC glad_glUniform4fv;
2246 #define glUniform4fv glad_glUniform4fv
2247 GLAD_API_CALL PFNGLUNIFORM4IPROC glad_glUniform4i;
2248 #define glUniform4i glad_glUniform4i
2249 GLAD_API_CALL PFNGLUNIFORM4IVPROC glad_glUniform4iv;
2250 #define glUniform4iv glad_glUniform4iv
2251 GLAD_API_CALL PFNGLUNIFORM4UIPROC glad_glUniform4ui;
2252 #define glUniform4ui glad_glUniform4ui
2253 GLAD_API_CALL PFNGLUNIFORM4UIVPROC glad_glUniform4uiv;
2254 #define glUniform4uiv glad_glUniform4uiv
2255 GLAD_API_CALL PFNGLUNIFORMBLOCKBINDINGPROC glad_glUniformBlockBinding;
2256 #define glUniformBlockBinding glad_glUniformBlockBinding
2257 GLAD_API_CALL PFNGLUNIFORMMATRIX2FVPROC glad_glUniformMatrix2fv;
2258 #define glUniformMatrix2fv glad_glUniformMatrix2fv
2259 GLAD_API_CALL PFNGLUNIFORMMATRIX2X3FVPROC glad_glUniformMatrix2x3fv;
2260 #define glUniformMatrix2x3fv glad_glUniformMatrix2x3fv
2261 GLAD_API_CALL PFNGLUNIFORMMATRIX2X4FVPROC glad_glUniformMatrix2x4fv;
2262 #define glUniformMatrix2x4fv glad_glUniformMatrix2x4fv
2263 GLAD_API_CALL PFNGLUNIFORMMATRIX3FVPROC glad_glUniformMatrix3fv;
2264 #define glUniformMatrix3fv glad_glUniformMatrix3fv
2265 GLAD_API_CALL PFNGLUNIFORMMATRIX3X2FVPROC glad_glUniformMatrix3x2fv;
2266 #define glUniformMatrix3x2fv glad_glUniformMatrix3x2fv
2267 GLAD_API_CALL PFNGLUNIFORMMATRIX3X4FVPROC glad_glUniformMatrix3x4fv;
2268 #define glUniformMatrix3x4fv glad_glUniformMatrix3x4fv
2269 GLAD_API_CALL PFNGLUNIFORMMATRIX4FVPROC glad_glUniformMatrix4fv;
2270 #define glUniformMatrix4fv glad_glUniformMatrix4fv
2271 GLAD_API_CALL PFNGLUNIFORMMATRIX4X2FVPROC glad_glUniformMatrix4x2fv;
2272 #define glUniformMatrix4x2fv glad_glUniformMatrix4x2fv
2273 GLAD_API_CALL PFNGLUNIFORMMATRIX4X3FVPROC glad_glUniformMatrix4x3fv;
2274 #define glUniformMatrix4x3fv glad_glUniformMatrix4x3fv
2275 GLAD_API_CALL PFNGLUNMAPBUFFERPROC glad_glUnmapBuffer;
2276 #define glUnmapBuffer glad_glUnmapBuffer
2277 GLAD_API_CALL PFNGLUSEPROGRAMPROC glad_glUseProgram;
2278 #define glUseProgram glad_glUseProgram
2279 GLAD_API_CALL PFNGLVALIDATEPROGRAMPROC glad_glValidateProgram;
2280 #define glValidateProgram glad_glValidateProgram
2281 GLAD_API_CALL PFNGLVERTEXATTRIB1DPROC glad_glVertexAttrib1d;
2282 #define glVertexAttrib1d glad_glVertexAttrib1d
2283 GLAD_API_CALL PFNGLVERTEXATTRIB1DVPROC glad_glVertexAttrib1dv;
2284 #define glVertexAttrib1dv glad_glVertexAttrib1dv
2285 GLAD_API_CALL PFNGLVERTEXATTRIB1FPROC glad_glVertexAttrib1f;
2286 #define glVertexAttrib1f glad_glVertexAttrib1f
2287 GLAD_API_CALL PFNGLVERTEXATTRIB1FVPROC glad_glVertexAttrib1fv;
2288 #define glVertexAttrib1fv glad_glVertexAttrib1fv
2289 GLAD_API_CALL PFNGLVERTEXATTRIB1SPROC glad_glVertexAttrib1s;
2290 #define glVertexAttrib1s glad_glVertexAttrib1s
2291 GLAD_API_CALL PFNGLVERTEXATTRIB1SVPROC glad_glVertexAttrib1sv;
2292 #define glVertexAttrib1sv glad_glVertexAttrib1sv
2293 GLAD_API_CALL PFNGLVERTEXATTRIB2DPROC glad_glVertexAttrib2d;
2294 #define glVertexAttrib2d glad_glVertexAttrib2d
2295 GLAD_API_CALL PFNGLVERTEXATTRIB2DVPROC glad_glVertexAttrib2dv;
2296 #define glVertexAttrib2dv glad_glVertexAttrib2dv
2297 GLAD_API_CALL PFNGLVERTEXATTRIB2FPROC glad_glVertexAttrib2f;
2298 #define glVertexAttrib2f glad_glVertexAttrib2f
2299 GLAD_API_CALL PFNGLVERTEXATTRIB2FVPROC glad_glVertexAttrib2fv;
2300 #define glVertexAttrib2fv glad_glVertexAttrib2fv
2301 GLAD_API_CALL PFNGLVERTEXATTRIB2SPROC glad_glVertexAttrib2s;
2302 #define glVertexAttrib2s glad_glVertexAttrib2s
2303 GLAD_API_CALL PFNGLVERTEXATTRIB2SVPROC glad_glVertexAttrib2sv;
2304 #define glVertexAttrib2sv glad_glVertexAttrib2sv
2305 GLAD_API_CALL PFNGLVERTEXATTRIB3DPROC glad_glVertexAttrib3d;
2306 #define glVertexAttrib3d glad_glVertexAttrib3d
2307 GLAD_API_CALL PFNGLVERTEXATTRIB3DVPROC glad_glVertexAttrib3dv;
2308 #define glVertexAttrib3dv glad_glVertexAttrib3dv
2309 GLAD_API_CALL PFNGLVERTEXATTRIB3FPROC glad_glVertexAttrib3f;
2310 #define glVertexAttrib3f glad_glVertexAttrib3f
2311 GLAD_API_CALL PFNGLVERTEXATTRIB3FVPROC glad_glVertexAttrib3fv;
2312 #define glVertexAttrib3fv glad_glVertexAttrib3fv
2313 GLAD_API_CALL PFNGLVERTEXATTRIB3SPROC glad_glVertexAttrib3s;
2314 #define glVertexAttrib3s glad_glVertexAttrib3s
2315 GLAD_API_CALL PFNGLVERTEXATTRIB3SVPROC glad_glVertexAttrib3sv;
2316 #define glVertexAttrib3sv glad_glVertexAttrib3sv
2317 GLAD_API_CALL PFNGLVERTEXATTRIB4NBVPROC glad_glVertexAttrib4Nbv;
2318 #define glVertexAttrib4Nbv glad_glVertexAttrib4Nbv
2319 GLAD_API_CALL PFNGLVERTEXATTRIB4NIVPROC glad_glVertexAttrib4Niv;
2320 #define glVertexAttrib4Niv glad_glVertexAttrib4Niv
2321 GLAD_API_CALL PFNGLVERTEXATTRIB4NSVPROC glad_glVertexAttrib4Nsv;
2322 #define glVertexAttrib4Nsv glad_glVertexAttrib4Nsv
2323 GLAD_API_CALL PFNGLVERTEXATTRIB4NUBPROC glad_glVertexAttrib4Nub;
2324 #define glVertexAttrib4Nub glad_glVertexAttrib4Nub
2325 GLAD_API_CALL PFNGLVERTEXATTRIB4NUBVPROC glad_glVertexAttrib4Nubv;
2326 #define glVertexAttrib4Nubv glad_glVertexAttrib4Nubv
2327 GLAD_API_CALL PFNGLVERTEXATTRIB4NUIVPROC glad_glVertexAttrib4Nuiv;
2328 #define glVertexAttrib4Nuiv glad_glVertexAttrib4Nuiv
2329 GLAD_API_CALL PFNGLVERTEXATTRIB4NUSVPROC glad_glVertexAttrib4Nusv;
2330 #define glVertexAttrib4Nusv glad_glVertexAttrib4Nusv
2331 GLAD_API_CALL PFNGLVERTEXATTRIB4BVPROC glad_glVertexAttrib4bv;
2332 #define glVertexAttrib4bv glad_glVertexAttrib4bv
2333 GLAD_API_CALL PFNGLVERTEXATTRIB4DPROC glad_glVertexAttrib4d;
2334 #define glVertexAttrib4d glad_glVertexAttrib4d
2335 GLAD_API_CALL PFNGLVERTEXATTRIB4DVPROC glad_glVertexAttrib4dv;
2336 #define glVertexAttrib4dv glad_glVertexAttrib4dv
2337 GLAD_API_CALL PFNGLVERTEXATTRIB4FPROC glad_glVertexAttrib4f;
2338 #define glVertexAttrib4f glad_glVertexAttrib4f
2339 GLAD_API_CALL PFNGLVERTEXATTRIB4FVPROC glad_glVertexAttrib4fv;
2340 #define glVertexAttrib4fv glad_glVertexAttrib4fv
2341 GLAD_API_CALL PFNGLVERTEXATTRIB4IVPROC glad_glVertexAttrib4iv;
2342 #define glVertexAttrib4iv glad_glVertexAttrib4iv
2343 GLAD_API_CALL PFNGLVERTEXATTRIB4SPROC glad_glVertexAttrib4s;
2344 #define glVertexAttrib4s glad_glVertexAttrib4s
2345 GLAD_API_CALL PFNGLVERTEXATTRIB4SVPROC glad_glVertexAttrib4sv;
2346 #define glVertexAttrib4sv glad_glVertexAttrib4sv
2347 GLAD_API_CALL PFNGLVERTEXATTRIB4UBVPROC glad_glVertexAttrib4ubv;
2348 #define glVertexAttrib4ubv glad_glVertexAttrib4ubv
2349 GLAD_API_CALL PFNGLVERTEXATTRIB4UIVPROC glad_glVertexAttrib4uiv;
2350 #define glVertexAttrib4uiv glad_glVertexAttrib4uiv
2351 GLAD_API_CALL PFNGLVERTEXATTRIB4USVPROC glad_glVertexAttrib4usv;
2352 #define glVertexAttrib4usv glad_glVertexAttrib4usv
2353 GLAD_API_CALL PFNGLVERTEXATTRIBDIVISORPROC glad_glVertexAttribDivisor;
2354 #define glVertexAttribDivisor glad_glVertexAttribDivisor
2355 GLAD_API_CALL PFNGLVERTEXATTRIBI1IPROC glad_glVertexAttribI1i;
2356 #define glVertexAttribI1i glad_glVertexAttribI1i
2357 GLAD_API_CALL PFNGLVERTEXATTRIBI1IVPROC glad_glVertexAttribI1iv;
2358 #define glVertexAttribI1iv glad_glVertexAttribI1iv
2359 GLAD_API_CALL PFNGLVERTEXATTRIBI1UIPROC glad_glVertexAttribI1ui;
2360 #define glVertexAttribI1ui glad_glVertexAttribI1ui
2361 GLAD_API_CALL PFNGLVERTEXATTRIBI1UIVPROC glad_glVertexAttribI1uiv;
2362 #define glVertexAttribI1uiv glad_glVertexAttribI1uiv
2363 GLAD_API_CALL PFNGLVERTEXATTRIBI2IPROC glad_glVertexAttribI2i;
2364 #define glVertexAttribI2i glad_glVertexAttribI2i
2365 GLAD_API_CALL PFNGLVERTEXATTRIBI2IVPROC glad_glVertexAttribI2iv;
2366 #define glVertexAttribI2iv glad_glVertexAttribI2iv
2367 GLAD_API_CALL PFNGLVERTEXATTRIBI2UIPROC glad_glVertexAttribI2ui;
2368 #define glVertexAttribI2ui glad_glVertexAttribI2ui
2369 GLAD_API_CALL PFNGLVERTEXATTRIBI2UIVPROC glad_glVertexAttribI2uiv;
2370 #define glVertexAttribI2uiv glad_glVertexAttribI2uiv
2371 GLAD_API_CALL PFNGLVERTEXATTRIBI3IPROC glad_glVertexAttribI3i;
2372 #define glVertexAttribI3i glad_glVertexAttribI3i
2373 GLAD_API_CALL PFNGLVERTEXATTRIBI3IVPROC glad_glVertexAttribI3iv;
2374 #define glVertexAttribI3iv glad_glVertexAttribI3iv
2375 GLAD_API_CALL PFNGLVERTEXATTRIBI3UIPROC glad_glVertexAttribI3ui;
2376 #define glVertexAttribI3ui glad_glVertexAttribI3ui
2377 GLAD_API_CALL PFNGLVERTEXATTRIBI3UIVPROC glad_glVertexAttribI3uiv;
2378 #define glVertexAttribI3uiv glad_glVertexAttribI3uiv
2379 GLAD_API_CALL PFNGLVERTEXATTRIBI4BVPROC glad_glVertexAttribI4bv;
2380 #define glVertexAttribI4bv glad_glVertexAttribI4bv
2381 GLAD_API_CALL PFNGLVERTEXATTRIBI4IPROC glad_glVertexAttribI4i;
2382 #define glVertexAttribI4i glad_glVertexAttribI4i
2383 GLAD_API_CALL PFNGLVERTEXATTRIBI4IVPROC glad_glVertexAttribI4iv;
2384 #define glVertexAttribI4iv glad_glVertexAttribI4iv
2385 GLAD_API_CALL PFNGLVERTEXATTRIBI4SVPROC glad_glVertexAttribI4sv;
2386 #define glVertexAttribI4sv glad_glVertexAttribI4sv
2387 GLAD_API_CALL PFNGLVERTEXATTRIBI4UBVPROC glad_glVertexAttribI4ubv;
2388 #define glVertexAttribI4ubv glad_glVertexAttribI4ubv
2389 GLAD_API_CALL PFNGLVERTEXATTRIBI4UIPROC glad_glVertexAttribI4ui;
2390 #define glVertexAttribI4ui glad_glVertexAttribI4ui
2391 GLAD_API_CALL PFNGLVERTEXATTRIBI4UIVPROC glad_glVertexAttribI4uiv;
2392 #define glVertexAttribI4uiv glad_glVertexAttribI4uiv
2393 GLAD_API_CALL PFNGLVERTEXATTRIBI4USVPROC glad_glVertexAttribI4usv;
2394 #define glVertexAttribI4usv glad_glVertexAttribI4usv
2395 GLAD_API_CALL PFNGLVERTEXATTRIBIPOINTERPROC glad_glVertexAttribIPointer;
2396 #define glVertexAttribIPointer glad_glVertexAttribIPointer
2397 GLAD_API_CALL PFNGLVERTEXATTRIBP1UIPROC glad_glVertexAttribP1ui;
2398 #define glVertexAttribP1ui glad_glVertexAttribP1ui
2399 GLAD_API_CALL PFNGLVERTEXATTRIBP1UIVPROC glad_glVertexAttribP1uiv;
2400 #define glVertexAttribP1uiv glad_glVertexAttribP1uiv
2401 GLAD_API_CALL PFNGLVERTEXATTRIBP2UIPROC glad_glVertexAttribP2ui;
2402 #define glVertexAttribP2ui glad_glVertexAttribP2ui
2403 GLAD_API_CALL PFNGLVERTEXATTRIBP2UIVPROC glad_glVertexAttribP2uiv;
2404 #define glVertexAttribP2uiv glad_glVertexAttribP2uiv
2405 GLAD_API_CALL PFNGLVERTEXATTRIBP3UIPROC glad_glVertexAttribP3ui;
2406 #define glVertexAttribP3ui glad_glVertexAttribP3ui
2407 GLAD_API_CALL PFNGLVERTEXATTRIBP3UIVPROC glad_glVertexAttribP3uiv;
2408 #define glVertexAttribP3uiv glad_glVertexAttribP3uiv
2409 GLAD_API_CALL PFNGLVERTEXATTRIBP4UIPROC glad_glVertexAttribP4ui;
2410 #define glVertexAttribP4ui glad_glVertexAttribP4ui
2411 GLAD_API_CALL PFNGLVERTEXATTRIBP4UIVPROC glad_glVertexAttribP4uiv;
2412 #define glVertexAttribP4uiv glad_glVertexAttribP4uiv
2413 GLAD_API_CALL PFNGLVERTEXATTRIBPOINTERPROC glad_glVertexAttribPointer;
2414 #define glVertexAttribPointer glad_glVertexAttribPointer
2415 GLAD_API_CALL PFNGLVIEWPORTPROC glad_glViewport;
2416 #define glViewport glad_glViewport
2417 GLAD_API_CALL PFNGLWAITSYNCPROC glad_glWaitSync;
2418 #define glWaitSync glad_glWaitSync
2419
2420
2421 GLAD_API_CALL int gladLoadGLUserPtr( GLADuserptrloadfunc load, void *userptr);
2422 GLAD_API_CALL int gladLoadGL( GLADloadfunc load);
2423
2424
2425
2426
2427
2428
2429 #ifdef __cplusplus
2430 }
2431 #endif
2432 #endif
2433
2434 /* Source */
2435 #ifdef GLAD_GL_IMPLEMENTATION
2436 #include <stdio.h>
2437 #include <stdlib.h>
2438 #include <string.h>
2439
2440 #ifndef GLAD_IMPL_UTIL_C_
2441 #define GLAD_IMPL_UTIL_C_
2442
2443 #ifdef _MSC_VER
2444 #define GLAD_IMPL_UTIL_SSCANF sscanf_s
2445 #else
2446 #define GLAD_IMPL_UTIL_SSCANF sscanf
2447 #endif
2448
2449 #endif /* GLAD_IMPL_UTIL_C_ */
2450
2451
2452 int GLAD_GL_VERSION_1_0 = 0;
2453 int GLAD_GL_VERSION_1_1 = 0;
2454 int GLAD_GL_VERSION_1_2 = 0;
2455 int GLAD_GL_VERSION_1_3 = 0;
2456 int GLAD_GL_VERSION_1_4 = 0;
2457 int GLAD_GL_VERSION_1_5 = 0;
2458 int GLAD_GL_VERSION_2_0 = 0;
2459 int GLAD_GL_VERSION_2_1 = 0;
2460 int GLAD_GL_VERSION_3_0 = 0;
2461 int GLAD_GL_VERSION_3_1 = 0;
2462 int GLAD_GL_VERSION_3_2 = 0;
2463 int GLAD_GL_VERSION_3_3 = 0;
2464
2465
2466
2467 PFNGLACTIVETEXTUREPROC glad_glActiveTexture = NULL;
2468 PFNGLATTACHSHADERPROC glad_glAttachShader = NULL;
2469 PFNGLBEGINCONDITIONALRENDERPROC glad_glBeginConditionalRender = NULL;
2470 PFNGLBEGINQUERYPROC glad_glBeginQuery = NULL;
2471 PFNGLBEGINTRANSFORMFEEDBACKPROC glad_glBeginTransformFeedback = NULL;
2472 PFNGLBINDATTRIBLOCATIONPROC glad_glBindAttribLocation = NULL;
2473 PFNGLBINDBUFFERPROC glad_glBindBuffer = NULL;
2474 PFNGLBINDBUFFERBASEPROC glad_glBindBufferBase = NULL;
2475 PFNGLBINDBUFFERRANGEPROC glad_glBindBufferRange = NULL;
2476 PFNGLBINDFRAGDATALOCATIONPROC glad_glBindFragDataLocation = NULL;
2477 PFNGLBINDFRAGDATALOCATIONINDEXEDPROC glad_glBindFragDataLocationIndexed = NULL;
2478 PFNGLBINDFRAMEBUFFERPROC glad_glBindFramebuffer = NULL;
2479 PFNGLBINDRENDERBUFFERPROC glad_glBindRenderbuffer = NULL;
2480 PFNGLBINDSAMPLERPROC glad_glBindSampler = NULL;
2481 PFNGLBINDTEXTUREPROC glad_glBindTexture = NULL;
2482 PFNGLBINDVERTEXARRAYPROC glad_glBindVertexArray = NULL;
2483 PFNGLBLENDCOLORPROC glad_glBlendColor = NULL;
2484 PFNGLBLENDEQUATIONPROC glad_glBlendEquation = NULL;
2485 PFNGLBLENDEQUATIONSEPARATEPROC glad_glBlendEquationSeparate = NULL;
2486 PFNGLBLENDFUNCPROC glad_glBlendFunc = NULL;
2487 PFNGLBLENDFUNCSEPARATEPROC glad_glBlendFuncSeparate = NULL;
2488 PFNGLBLITFRAMEBUFFERPROC glad_glBlitFramebuffer = NULL;
2489 PFNGLBUFFERDATAPROC glad_glBufferData = NULL;
2490 PFNGLBUFFERSUBDATAPROC glad_glBufferSubData = NULL;
2491 PFNGLCHECKFRAMEBUFFERSTATUSPROC glad_glCheckFramebufferStatus = NULL;
2492 PFNGLCLAMPCOLORPROC glad_glClampColor = NULL;
2493 PFNGLCLEARPROC glad_glClear = NULL;
2494 PFNGLCLEARBUFFERFIPROC glad_glClearBufferfi = NULL;
2495 PFNGLCLEARBUFFERFVPROC glad_glClearBufferfv = NULL;
2496 PFNGLCLEARBUFFERIVPROC glad_glClearBufferiv = NULL;
2497 PFNGLCLEARBUFFERUIVPROC glad_glClearBufferuiv = NULL;
2498 PFNGLCLEARCOLORPROC glad_glClearColor = NULL;
2499 PFNGLCLEARDEPTHPROC glad_glClearDepth = NULL;
2500 PFNGLCLEARSTENCILPROC glad_glClearStencil = NULL;
2501 PFNGLCLIENTWAITSYNCPROC glad_glClientWaitSync = NULL;
2502 PFNGLCOLORMASKPROC glad_glColorMask = NULL;
2503 PFNGLCOLORMASKIPROC glad_glColorMaski = NULL;
2504 PFNGLCOMPILESHADERPROC glad_glCompileShader = NULL;
2505 PFNGLCOMPRESSEDTEXIMAGE1DPROC glad_glCompressedTexImage1D = NULL;
2506 PFNGLCOMPRESSEDTEXIMAGE2DPROC glad_glCompressedTexImage2D = NULL;
2507 PFNGLCOMPRESSEDTEXIMAGE3DPROC glad_glCompressedTexImage3D = NULL;
2508 PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC glad_glCompressedTexSubImage1D = NULL;
2509 PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glad_glCompressedTexSubImage2D = NULL;
2510 PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glad_glCompressedTexSubImage3D = NULL;
2511 PFNGLCOPYBUFFERSUBDATAPROC glad_glCopyBufferSubData = NULL;
2512 PFNGLCOPYTEXIMAGE1DPROC glad_glCopyTexImage1D = NULL;
2513 PFNGLCOPYTEXIMAGE2DPROC glad_glCopyTexImage2D = NULL;
2514 PFNGLCOPYTEXSUBIMAGE1DPROC glad_glCopyTexSubImage1D = NULL;
2515 PFNGLCOPYTEXSUBIMAGE2DPROC glad_glCopyTexSubImage2D = NULL;
2516 PFNGLCOPYTEXSUBIMAGE3DPROC glad_glCopyTexSubImage3D = NULL;
2517 PFNGLCREATEPROGRAMPROC glad_glCreateProgram = NULL;
2518 PFNGLCREATESHADERPROC glad_glCreateShader = NULL;
2519 PFNGLCULLFACEPROC glad_glCullFace = NULL;
2520 PFNGLDELETEBUFFERSPROC glad_glDeleteBuffers = NULL;
2521 PFNGLDELETEFRAMEBUFFERSPROC glad_glDeleteFramebuffers = NULL;
2522 PFNGLDELETEPROGRAMPROC glad_glDeleteProgram = NULL;
2523 PFNGLDELETEQUERIESPROC glad_glDeleteQueries = NULL;
2524 PFNGLDELETERENDERBUFFERSPROC glad_glDeleteRenderbuffers = NULL;
2525 PFNGLDELETESAMPLERSPROC glad_glDeleteSamplers = NULL;
2526 PFNGLDELETESHADERPROC glad_glDeleteShader = NULL;
2527 PFNGLDELETESYNCPROC glad_glDeleteSync = NULL;
2528 PFNGLDELETETEXTURESPROC glad_glDeleteTextures = NULL;
2529 PFNGLDELETEVERTEXARRAYSPROC glad_glDeleteVertexArrays = NULL;
2530 PFNGLDEPTHFUNCPROC glad_glDepthFunc = NULL;
2531 PFNGLDEPTHMASKPROC glad_glDepthMask = NULL;
2532 PFNGLDEPTHRANGEPROC glad_glDepthRange = NULL;
2533 PFNGLDETACHSHADERPROC glad_glDetachShader = NULL;
2534 PFNGLDISABLEPROC glad_glDisable = NULL;
2535 PFNGLDISABLEVERTEXATTRIBARRAYPROC glad_glDisableVertexAttribArray = NULL;
2536 PFNGLDISABLEIPROC glad_glDisablei = NULL;
2537 PFNGLDRAWARRAYSPROC glad_glDrawArrays = NULL;
2538 PFNGLDRAWARRAYSINSTANCEDPROC glad_glDrawArraysInstanced = NULL;
2539 PFNGLDRAWBUFFERPROC glad_glDrawBuffer = NULL;
2540 PFNGLDRAWBUFFERSPROC glad_glDrawBuffers = NULL;
2541 PFNGLDRAWELEMENTSPROC glad_glDrawElements = NULL;
2542 PFNGLDRAWELEMENTSBASEVERTEXPROC glad_glDrawElementsBaseVertex = NULL;
2543 PFNGLDRAWELEMENTSINSTANCEDPROC glad_glDrawElementsInstanced = NULL;
2544 PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC glad_glDrawElementsInstancedBaseVertex = NULL;
2545 PFNGLDRAWRANGEELEMENTSPROC glad_glDrawRangeElements = NULL;
2546 PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC glad_glDrawRangeElementsBaseVertex = NULL;
2547 PFNGLENABLEPROC glad_glEnable = NULL;
2548 PFNGLENABLEVERTEXATTRIBARRAYPROC glad_glEnableVertexAttribArray = NULL;
2549 PFNGLENABLEIPROC glad_glEnablei = NULL;
2550 PFNGLENDCONDITIONALRENDERPROC glad_glEndConditionalRender = NULL;
2551 PFNGLENDQUERYPROC glad_glEndQuery = NULL;
2552 PFNGLENDTRANSFORMFEEDBACKPROC glad_glEndTransformFeedback = NULL;
2553 PFNGLFENCESYNCPROC glad_glFenceSync = NULL;
2554 PFNGLFINISHPROC glad_glFinish = NULL;
2555 PFNGLFLUSHPROC glad_glFlush = NULL;
2556 PFNGLFLUSHMAPPEDBUFFERRANGEPROC glad_glFlushMappedBufferRange = NULL;
2557 PFNGLFRAMEBUFFERRENDERBUFFERPROC glad_glFramebufferRenderbuffer = NULL;
2558 PFNGLFRAMEBUFFERTEXTUREPROC glad_glFramebufferTexture = NULL;
2559 PFNGLFRAMEBUFFERTEXTURE1DPROC glad_glFramebufferTexture1D = NULL;
2560 PFNGLFRAMEBUFFERTEXTURE2DPROC glad_glFramebufferTexture2D = NULL;
2561 PFNGLFRAMEBUFFERTEXTURE3DPROC glad_glFramebufferTexture3D = NULL;
2562 PFNGLFRAMEBUFFERTEXTURELAYERPROC glad_glFramebufferTextureLayer = NULL;
2563 PFNGLFRONTFACEPROC glad_glFrontFace = NULL;
2564 PFNGLGENBUFFERSPROC glad_glGenBuffers = NULL;
2565 PFNGLGENFRAMEBUFFERSPROC glad_glGenFramebuffers = NULL;
2566 PFNGLGENQUERIESPROC glad_glGenQueries = NULL;
2567 PFNGLGENRENDERBUFFERSPROC glad_glGenRenderbuffers = NULL;
2568 PFNGLGENSAMPLERSPROC glad_glGenSamplers = NULL;
2569 PFNGLGENTEXTURESPROC glad_glGenTextures = NULL;
2570 PFNGLGENVERTEXARRAYSPROC glad_glGenVertexArrays = NULL;
2571 PFNGLGENERATEMIPMAPPROC glad_glGenerateMipmap = NULL;
2572 PFNGLGETACTIVEATTRIBPROC glad_glGetActiveAttrib = NULL;
2573 PFNGLGETACTIVEUNIFORMPROC glad_glGetActiveUniform = NULL;
2574 PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC glad_glGetActiveUniformBlockName = NULL;
2575 PFNGLGETACTIVEUNIFORMBLOCKIVPROC glad_glGetActiveUniformBlockiv = NULL;
2576 PFNGLGETACTIVEUNIFORMNAMEPROC glad_glGetActiveUniformName = NULL;
2577 PFNGLGETACTIVEUNIFORMSIVPROC glad_glGetActiveUniformsiv = NULL;
2578 PFNGLGETATTACHEDSHADERSPROC glad_glGetAttachedShaders = NULL;
2579 PFNGLGETATTRIBLOCATIONPROC glad_glGetAttribLocation = NULL;
2580 PFNGLGETBOOLEANI_VPROC glad_glGetBooleani_v = NULL;
2581 PFNGLGETBOOLEANVPROC glad_glGetBooleanv = NULL;
2582 PFNGLGETBUFFERPARAMETERI64VPROC glad_glGetBufferParameteri64v = NULL;
2583 PFNGLGETBUFFERPARAMETERIVPROC glad_glGetBufferParameteriv = NULL;
2584 PFNGLGETBUFFERPOINTERVPROC glad_glGetBufferPointerv = NULL;
2585 PFNGLGETBUFFERSUBDATAPROC glad_glGetBufferSubData = NULL;
2586 PFNGLGETCOMPRESSEDTEXIMAGEPROC glad_glGetCompressedTexImage = NULL;
2587 PFNGLGETDOUBLEVPROC glad_glGetDoublev = NULL;
2588 PFNGLGETERRORPROC glad_glGetError = NULL;
2589 PFNGLGETFLOATVPROC glad_glGetFloatv = NULL;
2590 PFNGLGETFRAGDATAINDEXPROC glad_glGetFragDataIndex = NULL;
2591 PFNGLGETFRAGDATALOCATIONPROC glad_glGetFragDataLocation = NULL;
2592 PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetFramebufferAttachmentParameteriv = NULL;
2593 PFNGLGETINTEGER64I_VPROC glad_glGetInteger64i_v = NULL;
2594 PFNGLGETINTEGER64VPROC glad_glGetInteger64v = NULL;
2595 PFNGLGETINTEGERI_VPROC glad_glGetIntegeri_v = NULL;
2596 PFNGLGETINTEGERVPROC glad_glGetIntegerv = NULL;
2597 PFNGLGETMULTISAMPLEFVPROC glad_glGetMultisamplefv = NULL;
2598 PFNGLGETPROGRAMINFOLOGPROC glad_glGetProgramInfoLog = NULL;
2599 PFNGLGETPROGRAMIVPROC glad_glGetProgramiv = NULL;
2600 PFNGLGETQUERYOBJECTI64VPROC glad_glGetQueryObjecti64v = NULL;
2601 PFNGLGETQUERYOBJECTIVPROC glad_glGetQueryObjectiv = NULL;
2602 PFNGLGETQUERYOBJECTUI64VPROC glad_glGetQueryObjectui64v = NULL;
2603 PFNGLGETQUERYOBJECTUIVPROC glad_glGetQueryObjectuiv = NULL;
2604 PFNGLGETQUERYIVPROC glad_glGetQueryiv = NULL;
2605 PFNGLGETRENDERBUFFERPARAMETERIVPROC glad_glGetRenderbufferParameteriv = NULL;
2606 PFNGLGETSAMPLERPARAMETERIIVPROC glad_glGetSamplerParameterIiv = NULL;
2607 PFNGLGETSAMPLERPARAMETERIUIVPROC glad_glGetSamplerParameterIuiv = NULL;
2608 PFNGLGETSAMPLERPARAMETERFVPROC glad_glGetSamplerParameterfv = NULL;
2609 PFNGLGETSAMPLERPARAMETERIVPROC glad_glGetSamplerParameteriv = NULL;
2610 PFNGLGETSHADERINFOLOGPROC glad_glGetShaderInfoLog = NULL;
2611 PFNGLGETSHADERSOURCEPROC glad_glGetShaderSource = NULL;
2612 PFNGLGETSHADERIVPROC glad_glGetShaderiv = NULL;
2613 PFNGLGETSTRINGPROC glad_glGetString = NULL;
2614 PFNGLGETSTRINGIPROC glad_glGetStringi = NULL;
2615 PFNGLGETSYNCIVPROC glad_glGetSynciv = NULL;
2616 PFNGLGETTEXIMAGEPROC glad_glGetTexImage = NULL;
2617 PFNGLGETTEXLEVELPARAMETERFVPROC glad_glGetTexLevelParameterfv = NULL;
2618 PFNGLGETTEXLEVELPARAMETERIVPROC glad_glGetTexLevelParameteriv = NULL;
2619 PFNGLGETTEXPARAMETERIIVPROC glad_glGetTexParameterIiv = NULL;
2620 PFNGLGETTEXPARAMETERIUIVPROC glad_glGetTexParameterIuiv = NULL;
2621 PFNGLGETTEXPARAMETERFVPROC glad_glGetTexParameterfv = NULL;
2622 PFNGLGETTEXPARAMETERIVPROC glad_glGetTexParameteriv = NULL;
2623 PFNGLGETTRANSFORMFEEDBACKVARYINGPROC glad_glGetTransformFeedbackVarying = NULL;
2624 PFNGLGETUNIFORMBLOCKINDEXPROC glad_glGetUniformBlockIndex = NULL;
2625 PFNGLGETUNIFORMINDICESPROC glad_glGetUniformIndices = NULL;
2626 PFNGLGETUNIFORMLOCATIONPROC glad_glGetUniformLocation = NULL;
2627 PFNGLGETUNIFORMFVPROC glad_glGetUniformfv = NULL;
2628 PFNGLGETUNIFORMIVPROC glad_glGetUniformiv = NULL;
2629 PFNGLGETUNIFORMUIVPROC glad_glGetUniformuiv = NULL;
2630 PFNGLGETVERTEXATTRIBIIVPROC glad_glGetVertexAttribIiv = NULL;
2631 PFNGLGETVERTEXATTRIBIUIVPROC glad_glGetVertexAttribIuiv = NULL;
2632 PFNGLGETVERTEXATTRIBPOINTERVPROC glad_glGetVertexAttribPointerv = NULL;
2633 PFNGLGETVERTEXATTRIBDVPROC glad_glGetVertexAttribdv = NULL;
2634 PFNGLGETVERTEXATTRIBFVPROC glad_glGetVertexAttribfv = NULL;
2635 PFNGLGETVERTEXATTRIBIVPROC glad_glGetVertexAttribiv = NULL;
2636 PFNGLHINTPROC glad_glHint = NULL;
2637 PFNGLISBUFFERPROC glad_glIsBuffer = NULL;
2638 PFNGLISENABLEDPROC glad_glIsEnabled = NULL;
2639 PFNGLISENABLEDIPROC glad_glIsEnabledi = NULL;
2640 PFNGLISFRAMEBUFFERPROC glad_glIsFramebuffer = NULL;
2641 PFNGLISPROGRAMPROC glad_glIsProgram = NULL;
2642 PFNGLISQUERYPROC glad_glIsQuery = NULL;
2643 PFNGLISRENDERBUFFERPROC glad_glIsRenderbuffer = NULL;
2644 PFNGLISSAMPLERPROC glad_glIsSampler = NULL;
2645 PFNGLISSHADERPROC glad_glIsShader = NULL;
2646 PFNGLISSYNCPROC glad_glIsSync = NULL;
2647 PFNGLISTEXTUREPROC glad_glIsTexture = NULL;
2648 PFNGLISVERTEXARRAYPROC glad_glIsVertexArray = NULL;
2649 PFNGLLINEWIDTHPROC glad_glLineWidth = NULL;
2650 PFNGLLINKPROGRAMPROC glad_glLinkProgram = NULL;
2651 PFNGLLOGICOPPROC glad_glLogicOp = NULL;
2652 PFNGLMAPBUFFERPROC glad_glMapBuffer = NULL;
2653 PFNGLMAPBUFFERRANGEPROC glad_glMapBufferRange = NULL;
2654 PFNGLMULTIDRAWARRAYSPROC glad_glMultiDrawArrays = NULL;
2655 PFNGLMULTIDRAWELEMENTSPROC glad_glMultiDrawElements = NULL;
2656 PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC glad_glMultiDrawElementsBaseVertex = NULL;
2657 PFNGLPIXELSTOREFPROC glad_glPixelStoref = NULL;
2658 PFNGLPIXELSTOREIPROC glad_glPixelStorei = NULL;
2659 PFNGLPOINTPARAMETERFPROC glad_glPointParameterf = NULL;
2660 PFNGLPOINTPARAMETERFVPROC glad_glPointParameterfv = NULL;
2661 PFNGLPOINTPARAMETERIPROC glad_glPointParameteri = NULL;
2662 PFNGLPOINTPARAMETERIVPROC glad_glPointParameteriv = NULL;
2663 PFNGLPOINTSIZEPROC glad_glPointSize = NULL;
2664 PFNGLPOLYGONMODEPROC glad_glPolygonMode = NULL;
2665 PFNGLPOLYGONOFFSETPROC glad_glPolygonOffset = NULL;
2666 PFNGLPRIMITIVERESTARTINDEXPROC glad_glPrimitiveRestartIndex = NULL;
2667 PFNGLPROVOKINGVERTEXPROC glad_glProvokingVertex = NULL;
2668 PFNGLQUERYCOUNTERPROC glad_glQueryCounter = NULL;
2669 PFNGLREADBUFFERPROC glad_glReadBuffer = NULL;
2670 PFNGLREADPIXELSPROC glad_glReadPixels = NULL;
2671 PFNGLRENDERBUFFERSTORAGEPROC glad_glRenderbufferStorage = NULL;
2672 PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC glad_glRenderbufferStorageMultisample = NULL;
2673 PFNGLSAMPLECOVERAGEPROC glad_glSampleCoverage = NULL;
2674 PFNGLSAMPLEMASKIPROC glad_glSampleMaski = NULL;
2675 PFNGLSAMPLERPARAMETERIIVPROC glad_glSamplerParameterIiv = NULL;
2676 PFNGLSAMPLERPARAMETERIUIVPROC glad_glSamplerParameterIuiv = NULL;
2677 PFNGLSAMPLERPARAMETERFPROC glad_glSamplerParameterf = NULL;
2678 PFNGLSAMPLERPARAMETERFVPROC glad_glSamplerParameterfv = NULL;
2679 PFNGLSAMPLERPARAMETERIPROC glad_glSamplerParameteri = NULL;
2680 PFNGLSAMPLERPARAMETERIVPROC glad_glSamplerParameteriv = NULL;
2681 PFNGLSCISSORPROC glad_glScissor = NULL;
2682 PFNGLSHADERSOURCEPROC glad_glShaderSource = NULL;
2683 PFNGLSTENCILFUNCPROC glad_glStencilFunc = NULL;
2684 PFNGLSTENCILFUNCSEPARATEPROC glad_glStencilFuncSeparate = NULL;
2685 PFNGLSTENCILMASKPROC glad_glStencilMask = NULL;
2686 PFNGLSTENCILMASKSEPARATEPROC glad_glStencilMaskSeparate = NULL;
2687 PFNGLSTENCILOPPROC glad_glStencilOp = NULL;
2688 PFNGLSTENCILOPSEPARATEPROC glad_glStencilOpSeparate = NULL;
2689 PFNGLTEXBUFFERPROC glad_glTexBuffer = NULL;
2690 PFNGLTEXIMAGE1DPROC glad_glTexImage1D = NULL;
2691 PFNGLTEXIMAGE2DPROC glad_glTexImage2D = NULL;
2692 PFNGLTEXIMAGE2DMULTISAMPLEPROC glad_glTexImage2DMultisample = NULL;
2693 PFNGLTEXIMAGE3DPROC glad_glTexImage3D = NULL;
2694 PFNGLTEXIMAGE3DMULTISAMPLEPROC glad_glTexImage3DMultisample = NULL;
2695 PFNGLTEXPARAMETERIIVPROC glad_glTexParameterIiv = NULL;
2696 PFNGLTEXPARAMETERIUIVPROC glad_glTexParameterIuiv = NULL;
2697 PFNGLTEXPARAMETERFPROC glad_glTexParameterf = NULL;
2698 PFNGLTEXPARAMETERFVPROC glad_glTexParameterfv = NULL;
2699 PFNGLTEXPARAMETERIPROC glad_glTexParameteri = NULL;
2700 PFNGLTEXPARAMETERIVPROC glad_glTexParameteriv = NULL;
2701 PFNGLTEXSUBIMAGE1DPROC glad_glTexSubImage1D = NULL;
2702 PFNGLTEXSUBIMAGE2DPROC glad_glTexSubImage2D = NULL;
2703 PFNGLTEXSUBIMAGE3DPROC glad_glTexSubImage3D = NULL;
2704 PFNGLTRANSFORMFEEDBACKVARYINGSPROC glad_glTransformFeedbackVaryings = NULL;
2705 PFNGLUNIFORM1FPROC glad_glUniform1f = NULL;
2706 PFNGLUNIFORM1FVPROC glad_glUniform1fv = NULL;
2707 PFNGLUNIFORM1IPROC glad_glUniform1i = NULL;
2708 PFNGLUNIFORM1IVPROC glad_glUniform1iv = NULL;
2709 PFNGLUNIFORM1UIPROC glad_glUniform1ui = NULL;
2710 PFNGLUNIFORM1UIVPROC glad_glUniform1uiv = NULL;
2711 PFNGLUNIFORM2FPROC glad_glUniform2f = NULL;
2712 PFNGLUNIFORM2FVPROC glad_glUniform2fv = NULL;
2713 PFNGLUNIFORM2IPROC glad_glUniform2i = NULL;
2714 PFNGLUNIFORM2IVPROC glad_glUniform2iv = NULL;
2715 PFNGLUNIFORM2UIPROC glad_glUniform2ui = NULL;
2716 PFNGLUNIFORM2UIVPROC glad_glUniform2uiv = NULL;
2717 PFNGLUNIFORM3FPROC glad_glUniform3f = NULL;
2718 PFNGLUNIFORM3FVPROC glad_glUniform3fv = NULL;
2719 PFNGLUNIFORM3IPROC glad_glUniform3i = NULL;
2720 PFNGLUNIFORM3IVPROC glad_glUniform3iv = NULL;
2721 PFNGLUNIFORM3UIPROC glad_glUniform3ui = NULL;
2722 PFNGLUNIFORM3UIVPROC glad_glUniform3uiv = NULL;
2723 PFNGLUNIFORM4FPROC glad_glUniform4f = NULL;
2724 PFNGLUNIFORM4FVPROC glad_glUniform4fv = NULL;
2725 PFNGLUNIFORM4IPROC glad_glUniform4i = NULL;
2726 PFNGLUNIFORM4IVPROC glad_glUniform4iv = NULL;
2727 PFNGLUNIFORM4UIPROC glad_glUniform4ui = NULL;
2728 PFNGLUNIFORM4UIVPROC glad_glUniform4uiv = NULL;
2729 PFNGLUNIFORMBLOCKBINDINGPROC glad_glUniformBlockBinding = NULL;
2730 PFNGLUNIFORMMATRIX2FVPROC glad_glUniformMatrix2fv = NULL;
2731 PFNGLUNIFORMMATRIX2X3FVPROC glad_glUniformMatrix2x3fv = NULL;
2732 PFNGLUNIFORMMATRIX2X4FVPROC glad_glUniformMatrix2x4fv = NULL;
2733 PFNGLUNIFORMMATRIX3FVPROC glad_glUniformMatrix3fv = NULL;
2734 PFNGLUNIFORMMATRIX3X2FVPROC glad_glUniformMatrix3x2fv = NULL;
2735 PFNGLUNIFORMMATRIX3X4FVPROC glad_glUniformMatrix3x4fv = NULL;
2736 PFNGLUNIFORMMATRIX4FVPROC glad_glUniformMatrix4fv = NULL;
2737 PFNGLUNIFORMMATRIX4X2FVPROC glad_glUniformMatrix4x2fv = NULL;
2738 PFNGLUNIFORMMATRIX4X3FVPROC glad_glUniformMatrix4x3fv = NULL;
2739 PFNGLUNMAPBUFFERPROC glad_glUnmapBuffer = NULL;
2740 PFNGLUSEPROGRAMPROC glad_glUseProgram = NULL;
2741 PFNGLVALIDATEPROGRAMPROC glad_glValidateProgram = NULL;
2742 PFNGLVERTEXATTRIB1DPROC glad_glVertexAttrib1d = NULL;
2743 PFNGLVERTEXATTRIB1DVPROC glad_glVertexAttrib1dv = NULL;
2744 PFNGLVERTEXATTRIB1FPROC glad_glVertexAttrib1f = NULL;
2745 PFNGLVERTEXATTRIB1FVPROC glad_glVertexAttrib1fv = NULL;
2746 PFNGLVERTEXATTRIB1SPROC glad_glVertexAttrib1s = NULL;
2747 PFNGLVERTEXATTRIB1SVPROC glad_glVertexAttrib1sv = NULL;
2748 PFNGLVERTEXATTRIB2DPROC glad_glVertexAttrib2d = NULL;
2749 PFNGLVERTEXATTRIB2DVPROC glad_glVertexAttrib2dv = NULL;
2750 PFNGLVERTEXATTRIB2FPROC glad_glVertexAttrib2f = NULL;
2751 PFNGLVERTEXATTRIB2FVPROC glad_glVertexAttrib2fv = NULL;
2752 PFNGLVERTEXATTRIB2SPROC glad_glVertexAttrib2s = NULL;
2753 PFNGLVERTEXATTRIB2SVPROC glad_glVertexAttrib2sv = NULL;
2754 PFNGLVERTEXATTRIB3DPROC glad_glVertexAttrib3d = NULL;
2755 PFNGLVERTEXATTRIB3DVPROC glad_glVertexAttrib3dv = NULL;
2756 PFNGLVERTEXATTRIB3FPROC glad_glVertexAttrib3f = NULL;
2757 PFNGLVERTEXATTRIB3FVPROC glad_glVertexAttrib3fv = NULL;
2758 PFNGLVERTEXATTRIB3SPROC glad_glVertexAttrib3s = NULL;
2759 PFNGLVERTEXATTRIB3SVPROC glad_glVertexAttrib3sv = NULL;
2760 PFNGLVERTEXATTRIB4NBVPROC glad_glVertexAttrib4Nbv = NULL;
2761 PFNGLVERTEXATTRIB4NIVPROC glad_glVertexAttrib4Niv = NULL;
2762 PFNGLVERTEXATTRIB4NSVPROC glad_glVertexAttrib4Nsv = NULL;
2763 PFNGLVERTEXATTRIB4NUBPROC glad_glVertexAttrib4Nub = NULL;
2764 PFNGLVERTEXATTRIB4NUBVPROC glad_glVertexAttrib4Nubv = NULL;
2765 PFNGLVERTEXATTRIB4NUIVPROC glad_glVertexAttrib4Nuiv = NULL;
2766 PFNGLVERTEXATTRIB4NUSVPROC glad_glVertexAttrib4Nusv = NULL;
2767 PFNGLVERTEXATTRIB4BVPROC glad_glVertexAttrib4bv = NULL;
2768 PFNGLVERTEXATTRIB4DPROC glad_glVertexAttrib4d = NULL;
2769 PFNGLVERTEXATTRIB4DVPROC glad_glVertexAttrib4dv = NULL;
2770 PFNGLVERTEXATTRIB4FPROC glad_glVertexAttrib4f = NULL;
2771 PFNGLVERTEXATTRIB4FVPROC glad_glVertexAttrib4fv = NULL;
2772 PFNGLVERTEXATTRIB4IVPROC glad_glVertexAttrib4iv = NULL;
2773 PFNGLVERTEXATTRIB4SPROC glad_glVertexAttrib4s = NULL;
2774 PFNGLVERTEXATTRIB4SVPROC glad_glVertexAttrib4sv = NULL;
2775 PFNGLVERTEXATTRIB4UBVPROC glad_glVertexAttrib4ubv = NULL;
2776 PFNGLVERTEXATTRIB4UIVPROC glad_glVertexAttrib4uiv = NULL;
2777 PFNGLVERTEXATTRIB4USVPROC glad_glVertexAttrib4usv = NULL;
2778 PFNGLVERTEXATTRIBDIVISORPROC glad_glVertexAttribDivisor = NULL;
2779 PFNGLVERTEXATTRIBI1IPROC glad_glVertexAttribI1i = NULL;
2780 PFNGLVERTEXATTRIBI1IVPROC glad_glVertexAttribI1iv = NULL;
2781 PFNGLVERTEXATTRIBI1UIPROC glad_glVertexAttribI1ui = NULL;
2782 PFNGLVERTEXATTRIBI1UIVPROC glad_glVertexAttribI1uiv = NULL;
2783 PFNGLVERTEXATTRIBI2IPROC glad_glVertexAttribI2i = NULL;
2784 PFNGLVERTEXATTRIBI2IVPROC glad_glVertexAttribI2iv = NULL;
2785 PFNGLVERTEXATTRIBI2UIPROC glad_glVertexAttribI2ui = NULL;
2786 PFNGLVERTEXATTRIBI2UIVPROC glad_glVertexAttribI2uiv = NULL;
2787 PFNGLVERTEXATTRIBI3IPROC glad_glVertexAttribI3i = NULL;
2788 PFNGLVERTEXATTRIBI3IVPROC glad_glVertexAttribI3iv = NULL;
2789 PFNGLVERTEXATTRIBI3UIPROC glad_glVertexAttribI3ui = NULL;
2790 PFNGLVERTEXATTRIBI3UIVPROC glad_glVertexAttribI3uiv = NULL;
2791 PFNGLVERTEXATTRIBI4BVPROC glad_glVertexAttribI4bv = NULL;
2792 PFNGLVERTEXATTRIBI4IPROC glad_glVertexAttribI4i = NULL;
2793 PFNGLVERTEXATTRIBI4IVPROC glad_glVertexAttribI4iv = NULL;
2794 PFNGLVERTEXATTRIBI4SVPROC glad_glVertexAttribI4sv = NULL;
2795 PFNGLVERTEXATTRIBI4UBVPROC glad_glVertexAttribI4ubv = NULL;
2796 PFNGLVERTEXATTRIBI4UIPROC glad_glVertexAttribI4ui = NULL;
2797 PFNGLVERTEXATTRIBI4UIVPROC glad_glVertexAttribI4uiv = NULL;
2798 PFNGLVERTEXATTRIBI4USVPROC glad_glVertexAttribI4usv = NULL;
2799 PFNGLVERTEXATTRIBIPOINTERPROC glad_glVertexAttribIPointer = NULL;
2800 PFNGLVERTEXATTRIBP1UIPROC glad_glVertexAttribP1ui = NULL;
2801 PFNGLVERTEXATTRIBP1UIVPROC glad_glVertexAttribP1uiv = NULL;
2802 PFNGLVERTEXATTRIBP2UIPROC glad_glVertexAttribP2ui = NULL;
2803 PFNGLVERTEXATTRIBP2UIVPROC glad_glVertexAttribP2uiv = NULL;
2804 PFNGLVERTEXATTRIBP3UIPROC glad_glVertexAttribP3ui = NULL;
2805 PFNGLVERTEXATTRIBP3UIVPROC glad_glVertexAttribP3uiv = NULL;
2806 PFNGLVERTEXATTRIBP4UIPROC glad_glVertexAttribP4ui = NULL;
2807 PFNGLVERTEXATTRIBP4UIVPROC glad_glVertexAttribP4uiv = NULL;
2808 PFNGLVERTEXATTRIBPOINTERPROC glad_glVertexAttribPointer = NULL;
2809 PFNGLVIEWPORTPROC glad_glViewport = NULL;
2810 PFNGLWAITSYNCPROC glad_glWaitSync = NULL;
2811
2812
2813 static void glad_gl_load_GL_VERSION_1_0( GLADuserptrloadfunc load, void* userptr) {
2814 if(!GLAD_GL_VERSION_1_0) return;
2815 glBlendFunc = (PFNGLBLENDFUNCPROC) load("glBlendFunc", userptr);
2816 glClear = (PFNGLCLEARPROC) load("glClear", userptr);
2817 glClearColor = (PFNGLCLEARCOLORPROC) load("glClearColor", userptr);
2818 glClearDepth = (PFNGLCLEARDEPTHPROC) load("glClearDepth", userptr);
2819 glClearStencil = (PFNGLCLEARSTENCILPROC) load("glClearStencil", userptr);
2820 glColorMask = (PFNGLCOLORMASKPROC) load("glColorMask", userptr);
2821 glCullFace = (PFNGLCULLFACEPROC) load("glCullFace", userptr);
2822 glDepthFunc = (PFNGLDEPTHFUNCPROC) load("glDepthFunc", userptr);
2823 glDepthMask = (PFNGLDEPTHMASKPROC) load("glDepthMask", userptr);
2824 glDepthRange = (PFNGLDEPTHRANGEPROC) load("glDepthRange", userptr);
2825 glDisable = (PFNGLDISABLEPROC) load("glDisable", userptr);
2826 glDrawBuffer = (PFNGLDRAWBUFFERPROC) load("glDrawBuffer", userptr);
2827 glEnable = (PFNGLENABLEPROC) load("glEnable", userptr);
2828 glFinish = (PFNGLFINISHPROC) load("glFinish", userptr);
2829 glFlush = (PFNGLFLUSHPROC) load("glFlush", userptr);
2830 glFrontFace = (PFNGLFRONTFACEPROC) load("glFrontFace", userptr);
2831 glGetBooleanv = (PFNGLGETBOOLEANVPROC) load("glGetBooleanv", userptr);
2832 glGetDoublev = (PFNGLGETDOUBLEVPROC) load("glGetDoublev", userptr);
2833 glGetError = (PFNGLGETERRORPROC) load("glGetError", userptr);
2834 glGetFloatv = (PFNGLGETFLOATVPROC) load("glGetFloatv", userptr);
2835 glGetIntegerv = (PFNGLGETINTEGERVPROC) load("glGetIntegerv", userptr);
2836 glGetString = (PFNGLGETSTRINGPROC) load("glGetString", userptr);
2837 glGetTexImage = (PFNGLGETTEXIMAGEPROC) load("glGetTexImage", userptr);
2838 glGetTexLevelParameterfv = (PFNGLGETTEXLEVELPARAMETERFVPROC) load("glGetTexLevelParameterfv", userptr);
2839 glGetTexLevelParameteriv = (PFNGLGETTEXLEVELPARAMETERIVPROC) load("glGetTexLevelParameteriv", userptr);
2840 glGetTexParameterfv = (PFNGLGETTEXPARAMETERFVPROC) load("glGetTexParameterfv", userptr);
2841 glGetTexParameteriv = (PFNGLGETTEXPARAMETERIVPROC) load("glGetTexParameteriv", userptr);
2842 glHint = (PFNGLHINTPROC) load("glHint", userptr);
2843 glIsEnabled = (PFNGLISENABLEDPROC) load("glIsEnabled", userptr);
2844 glLineWidth = (PFNGLLINEWIDTHPROC) load("glLineWidth", userptr);
2845 glLogicOp = (PFNGLLOGICOPPROC) load("glLogicOp", userptr);
2846 glPixelStoref = (PFNGLPIXELSTOREFPROC) load("glPixelStoref", userptr);
2847 glPixelStorei = (PFNGLPIXELSTOREIPROC) load("glPixelStorei", userptr);
2848 glPointSize = (PFNGLPOINTSIZEPROC) load("glPointSize", userptr);
2849 glPolygonMode = (PFNGLPOLYGONMODEPROC) load("glPolygonMode", userptr);
2850 glReadBuffer = (PFNGLREADBUFFERPROC) load("glReadBuffer", userptr);
2851 glReadPixels = (PFNGLREADPIXELSPROC) load("glReadPixels", userptr);
2852 glScissor = (PFNGLSCISSORPROC) load("glScissor", userptr);
2853 glStencilFunc = (PFNGLSTENCILFUNCPROC) load("glStencilFunc", userptr);
2854 glStencilMask = (PFNGLSTENCILMASKPROC) load("glStencilMask", userptr);
2855 glStencilOp = (PFNGLSTENCILOPPROC) load("glStencilOp", userptr);
2856 glTexImage1D = (PFNGLTEXIMAGE1DPROC) load("glTexImage1D", userptr);
2857 glTexImage2D = (PFNGLTEXIMAGE2DPROC) load("glTexImage2D", userptr);
2858 glTexParameterf = (PFNGLTEXPARAMETERFPROC) load("glTexParameterf", userptr);
2859 glTexParameterfv = (PFNGLTEXPARAMETERFVPROC) load("glTexParameterfv", userptr);
2860 glTexParameteri = (PFNGLTEXPARAMETERIPROC) load("glTexParameteri", userptr);
2861 glTexParameteriv = (PFNGLTEXPARAMETERIVPROC) load("glTexParameteriv", userptr);
2862 glViewport = (PFNGLVIEWPORTPROC) load("glViewport", userptr);
2863 }
2864 static void glad_gl_load_GL_VERSION_1_1( GLADuserptrloadfunc load, void* userptr) {
2865 if(!GLAD_GL_VERSION_1_1) return;
2866 glBindTexture = (PFNGLBINDTEXTUREPROC) load("glBindTexture", userptr);
2867 glCopyTexImage1D = (PFNGLCOPYTEXIMAGE1DPROC) load("glCopyTexImage1D", userptr);
2868 glCopyTexImage2D = (PFNGLCOPYTEXIMAGE2DPROC) load("glCopyTexImage2D", userptr);
2869 glCopyTexSubImage1D = (PFNGLCOPYTEXSUBIMAGE1DPROC) load("glCopyTexSubImage1D", userptr);
2870 glCopyTexSubImage2D = (PFNGLCOPYTEXSUBIMAGE2DPROC) load("glCopyTexSubImage2D", userptr);
2871 glDeleteTextures = (PFNGLDELETETEXTURESPROC) load("glDeleteTextures", userptr);
2872 glDrawArrays = (PFNGLDRAWARRAYSPROC) load("glDrawArrays", userptr);
2873 glDrawElements = (PFNGLDRAWELEMENTSPROC) load("glDrawElements", userptr);
2874 glGenTextures = (PFNGLGENTEXTURESPROC) load("glGenTextures", userptr);
2875 glIsTexture = (PFNGLISTEXTUREPROC) load("glIsTexture", userptr);
2876 glPolygonOffset = (PFNGLPOLYGONOFFSETPROC) load("glPolygonOffset", userptr);
2877 glTexSubImage1D = (PFNGLTEXSUBIMAGE1DPROC) load("glTexSubImage1D", userptr);
2878 glTexSubImage2D = (PFNGLTEXSUBIMAGE2DPROC) load("glTexSubImage2D", userptr);
2879 }
2880 static void glad_gl_load_GL_VERSION_1_2( GLADuserptrloadfunc load, void* userptr) {
2881 if(!GLAD_GL_VERSION_1_2) return;
2882 glCopyTexSubImage3D = (PFNGLCOPYTEXSUBIMAGE3DPROC) load("glCopyTexSubImage3D", userptr);
2883 glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC) load("glDrawRangeElements", userptr);
2884 glTexImage3D = (PFNGLTEXIMAGE3DPROC) load("glTexImage3D", userptr);
2885 glTexSubImage3D = (PFNGLTEXSUBIMAGE3DPROC) load("glTexSubImage3D", userptr);
2886 }
2887 static void glad_gl_load_GL_VERSION_1_3( GLADuserptrloadfunc load, void* userptr) {
2888 if(!GLAD_GL_VERSION_1_3) return;
2889 glActiveTexture = (PFNGLACTIVETEXTUREPROC) load("glActiveTexture", userptr);
2890 glCompressedTexImage1D = (PFNGLCOMPRESSEDTEXIMAGE1DPROC) load("glCompressedTexImage1D", userptr);
2891 glCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC) load("glCompressedTexImage2D", userptr);
2892 glCompressedTexImage3D = (PFNGLCOMPRESSEDTEXIMAGE3DPROC) load("glCompressedTexImage3D", userptr);
2893 glCompressedTexSubImage1D = (PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) load("glCompressedTexSubImage1D", userptr);
2894 glCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) load("glCompressedTexSubImage2D", userptr);
2895 glCompressedTexSubImage3D = (PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) load("glCompressedTexSubImage3D", userptr);
2896 glGetCompressedTexImage = (PFNGLGETCOMPRESSEDTEXIMAGEPROC) load("glGetCompressedTexImage", userptr);
2897 glSampleCoverage = (PFNGLSAMPLECOVERAGEPROC) load("glSampleCoverage", userptr);
2898 }
2899 static void glad_gl_load_GL_VERSION_1_4( GLADuserptrloadfunc load, void* userptr) {
2900 if(!GLAD_GL_VERSION_1_4) return;
2901 glBlendColor = (PFNGLBLENDCOLORPROC) load("glBlendColor", userptr);
2902 glBlendEquation = (PFNGLBLENDEQUATIONPROC) load("glBlendEquation", userptr);
2903 glBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC) load("glBlendFuncSeparate", userptr);
2904 glMultiDrawArrays = (PFNGLMULTIDRAWARRAYSPROC) load("glMultiDrawArrays", userptr);
2905 glMultiDrawElements = (PFNGLMULTIDRAWELEMENTSPROC) load("glMultiDrawElements", userptr);
2906 glPointParameterf = (PFNGLPOINTPARAMETERFPROC) load("glPointParameterf", userptr);
2907 glPointParameterfv = (PFNGLPOINTPARAMETERFVPROC) load("glPointParameterfv", userptr);
2908 glPointParameteri = (PFNGLPOINTPARAMETERIPROC) load("glPointParameteri", userptr);
2909 glPointParameteriv = (PFNGLPOINTPARAMETERIVPROC) load("glPointParameteriv", userptr);
2910 }
2911 static void glad_gl_load_GL_VERSION_1_5( GLADuserptrloadfunc load, void* userptr) {
2912 if(!GLAD_GL_VERSION_1_5) return;
2913 glBeginQuery = (PFNGLBEGINQUERYPROC) load("glBeginQuery", userptr);
2914 glBindBuffer = (PFNGLBINDBUFFERPROC) load("glBindBuffer", userptr);
2915 glBufferData = (PFNGLBUFFERDATAPROC) load("glBufferData", userptr);
2916 glBufferSubData = (PFNGLBUFFERSUBDATAPROC) load("glBufferSubData", userptr);
2917 glDeleteBuffers = (PFNGLDELETEBUFFERSPROC) load("glDeleteBuffers", userptr);
2918 glDeleteQueries = (PFNGLDELETEQUERIESPROC) load("glDeleteQueries", userptr);
2919 glEndQuery = (PFNGLENDQUERYPROC) load("glEndQuery", userptr);
2920 glGenBuffers = (PFNGLGENBUFFERSPROC) load("glGenBuffers", userptr);
2921 glGenQueries = (PFNGLGENQUERIESPROC) load("glGenQueries", userptr);
2922 glGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC) load("glGetBufferParameteriv", userptr);
2923 glGetBufferPointerv = (PFNGLGETBUFFERPOINTERVPROC) load("glGetBufferPointerv", userptr);
2924 glGetBufferSubData = (PFNGLGETBUFFERSUBDATAPROC) load("glGetBufferSubData", userptr);
2925 glGetQueryObjectiv = (PFNGLGETQUERYOBJECTIVPROC) load("glGetQueryObjectiv", userptr);
2926 glGetQueryObjectuiv = (PFNGLGETQUERYOBJECTUIVPROC) load("glGetQueryObjectuiv", userptr);
2927 glGetQueryiv = (PFNGLGETQUERYIVPROC) load("glGetQueryiv", userptr);
2928 glIsBuffer = (PFNGLISBUFFERPROC) load("glIsBuffer", userptr);
2929 glIsQuery = (PFNGLISQUERYPROC) load("glIsQuery", userptr);
2930 glMapBuffer = (PFNGLMAPBUFFERPROC) load("glMapBuffer", userptr);
2931 glUnmapBuffer = (PFNGLUNMAPBUFFERPROC) load("glUnmapBuffer", userptr);
2932 }
2933 static void glad_gl_load_GL_VERSION_2_0( GLADuserptrloadfunc load, void* userptr) {
2934 if(!GLAD_GL_VERSION_2_0) return;
2935 glAttachShader = (PFNGLATTACHSHADERPROC) load("glAttachShader", userptr);
2936 glBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC) load("glBindAttribLocation", userptr);
2937 glBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC) load("glBlendEquationSeparate", userptr);
2938 glCompileShader = (PFNGLCOMPILESHADERPROC) load("glCompileShader", userptr);
2939 glCreateProgram = (PFNGLCREATEPROGRAMPROC) load("glCreateProgram", userptr);
2940 glCreateShader = (PFNGLCREATESHADERPROC) load("glCreateShader", userptr);
2941 glDeleteProgram = (PFNGLDELETEPROGRAMPROC) load("glDeleteProgram", userptr);
2942 glDeleteShader = (PFNGLDELETESHADERPROC) load("glDeleteShader", userptr);
2943 glDetachShader = (PFNGLDETACHSHADERPROC) load("glDetachShader", userptr);
2944 glDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC) load("glDisableVertexAttribArray", userptr);
2945 glDrawBuffers = (PFNGLDRAWBUFFERSPROC) load("glDrawBuffers", userptr);
2946 glEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC) load("glEnableVertexAttribArray", userptr);
2947 glGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC) load("glGetActiveAttrib", userptr);
2948 glGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC) load("glGetActiveUniform", userptr);
2949 glGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC) load("glGetAttachedShaders", userptr);
2950 glGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC) load("glGetAttribLocation", userptr);
2951 glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC) load("glGetProgramInfoLog", userptr);
2952 glGetProgramiv = (PFNGLGETPROGRAMIVPROC) load("glGetProgramiv", userptr);
2953 glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC) load("glGetShaderInfoLog", userptr);
2954 glGetShaderSource = (PFNGLGETSHADERSOURCEPROC) load("glGetShaderSource", userptr);
2955 glGetShaderiv = (PFNGLGETSHADERIVPROC) load("glGetShaderiv", userptr);
2956 glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC) load("glGetUniformLocation", userptr);
2957 glGetUniformfv = (PFNGLGETUNIFORMFVPROC) load("glGetUniformfv", userptr);
2958 glGetUniformiv = (PFNGLGETUNIFORMIVPROC) load("glGetUniformiv", userptr);
2959 glGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC) load("glGetVertexAttribPointerv", userptr);
2960 glGetVertexAttribdv = (PFNGLGETVERTEXATTRIBDVPROC) load("glGetVertexAttribdv", userptr);
2961 glGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC) load("glGetVertexAttribfv", userptr);
2962 glGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC) load("glGetVertexAttribiv", userptr);
2963 glIsProgram = (PFNGLISPROGRAMPROC) load("glIsProgram", userptr);
2964 glIsShader = (PFNGLISSHADERPROC) load("glIsShader", userptr);
2965 glLinkProgram = (PFNGLLINKPROGRAMPROC) load("glLinkProgram", userptr);
2966 glShaderSource = (PFNGLSHADERSOURCEPROC) load("glShaderSource", userptr);
2967 glStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC) load("glStencilFuncSeparate", userptr);
2968 glStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC) load("glStencilMaskSeparate", userptr);
2969 glStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC) load("glStencilOpSeparate", userptr);
2970 glUniform1f = (PFNGLUNIFORM1FPROC) load("glUniform1f", userptr);
2971 glUniform1fv = (PFNGLUNIFORM1FVPROC) load("glUniform1fv", userptr);
2972 glUniform1i = (PFNGLUNIFORM1IPROC) load("glUniform1i", userptr);
2973 glUniform1iv = (PFNGLUNIFORM1IVPROC) load("glUniform1iv", userptr);
2974 glUniform2f = (PFNGLUNIFORM2FPROC) load("glUniform2f", userptr);
2975 glUniform2fv = (PFNGLUNIFORM2FVPROC) load("glUniform2fv", userptr);
2976 glUniform2i = (PFNGLUNIFORM2IPROC) load("glUniform2i", userptr);
2977 glUniform2iv = (PFNGLUNIFORM2IVPROC) load("glUniform2iv", userptr);
2978 glUniform3f = (PFNGLUNIFORM3FPROC) load("glUniform3f", userptr);
2979 glUniform3fv = (PFNGLUNIFORM3FVPROC) load("glUniform3fv", userptr);
2980 glUniform3i = (PFNGLUNIFORM3IPROC) load("glUniform3i", userptr);
2981 glUniform3iv = (PFNGLUNIFORM3IVPROC) load("glUniform3iv", userptr);
2982 glUniform4f = (PFNGLUNIFORM4FPROC) load("glUniform4f", userptr);
2983 glUniform4fv = (PFNGLUNIFORM4FVPROC) load("glUniform4fv", userptr);
2984 glUniform4i = (PFNGLUNIFORM4IPROC) load("glUniform4i", userptr);
2985 glUniform4iv = (PFNGLUNIFORM4IVPROC) load("glUniform4iv", userptr);
2986 glUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC) load("glUniformMatrix2fv", userptr);
2987 glUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC) load("glUniformMatrix3fv", userptr);
2988 glUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC) load("glUniformMatrix4fv", userptr);
2989 glUseProgram = (PFNGLUSEPROGRAMPROC) load("glUseProgram", userptr);
2990 glValidateProgram = (PFNGLVALIDATEPROGRAMPROC) load("glValidateProgram", userptr);
2991 glVertexAttrib1d = (PFNGLVERTEXATTRIB1DPROC) load("glVertexAttrib1d", userptr);
2992 glVertexAttrib1dv = (PFNGLVERTEXATTRIB1DVPROC) load("glVertexAttrib1dv", userptr);
2993 glVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC) load("glVertexAttrib1f", userptr);
2994 glVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC) load("glVertexAttrib1fv", userptr);
2995 glVertexAttrib1s = (PFNGLVERTEXATTRIB1SPROC) load("glVertexAttrib1s", userptr);
2996 glVertexAttrib1sv = (PFNGLVERTEXATTRIB1SVPROC) load("glVertexAttrib1sv", userptr);
2997 glVertexAttrib2d = (PFNGLVERTEXATTRIB2DPROC) load("glVertexAttrib2d", userptr);
2998 glVertexAttrib2dv = (PFNGLVERTEXATTRIB2DVPROC) load("glVertexAttrib2dv", userptr);
2999 glVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC) load("glVertexAttrib2f", userptr);
3000 glVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC) load("glVertexAttrib2fv", userptr);
3001 glVertexAttrib2s = (PFNGLVERTEXATTRIB2SPROC) load("glVertexAttrib2s", userptr);
3002 glVertexAttrib2sv = (PFNGLVERTEXATTRIB2SVPROC) load("glVertexAttrib2sv", userptr);
3003 glVertexAttrib3d = (PFNGLVERTEXATTRIB3DPROC) load("glVertexAttrib3d", userptr);
3004 glVertexAttrib3dv = (PFNGLVERTEXATTRIB3DVPROC) load("glVertexAttrib3dv", userptr);
3005 glVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC) load("glVertexAttrib3f", userptr);
3006 glVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC) load("glVertexAttrib3fv", userptr);
3007 glVertexAttrib3s = (PFNGLVERTEXATTRIB3SPROC) load("glVertexAttrib3s", userptr);
3008 glVertexAttrib3sv = (PFNGLVERTEXATTRIB3SVPROC) load("glVertexAttrib3sv", userptr);
3009 glVertexAttrib4Nbv = (PFNGLVERTEXATTRIB4NBVPROC) load("glVertexAttrib4Nbv", userptr);
3010 glVertexAttrib4Niv = (PFNGLVERTEXATTRIB4NIVPROC) load("glVertexAttrib4Niv", userptr);
3011 glVertexAttrib4Nsv = (PFNGLVERTEXATTRIB4NSVPROC) load("glVertexAttrib4Nsv", userptr);
3012 glVertexAttrib4Nub = (PFNGLVERTEXATTRIB4NUBPROC) load("glVertexAttrib4Nub", userptr);
3013 glVertexAttrib4Nubv = (PFNGLVERTEXATTRIB4NUBVPROC) load("glVertexAttrib4Nubv", userptr);
3014 glVertexAttrib4Nuiv = (PFNGLVERTEXATTRIB4NUIVPROC) load("glVertexAttrib4Nuiv", userptr);
3015 glVertexAttrib4Nusv = (PFNGLVERTEXATTRIB4NUSVPROC) load("glVertexAttrib4Nusv", userptr);
3016 glVertexAttrib4bv = (PFNGLVERTEXATTRIB4BVPROC) load("glVertexAttrib4bv", userptr);
3017 glVertexAttrib4d = (PFNGLVERTEXATTRIB4DPROC) load("glVertexAttrib4d", userptr);
3018 glVertexAttrib4dv = (PFNGLVERTEXATTRIB4DVPROC) load("glVertexAttrib4dv", userptr);
3019 glVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC) load("glVertexAttrib4f", userptr);
3020 glVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC) load("glVertexAttrib4fv", userptr);
3021 glVertexAttrib4iv = (PFNGLVERTEXATTRIB4IVPROC) load("glVertexAttrib4iv", userptr);
3022 glVertexAttrib4s = (PFNGLVERTEXATTRIB4SPROC) load("glVertexAttrib4s", userptr);
3023 glVertexAttrib4sv = (PFNGLVERTEXATTRIB4SVPROC) load("glVertexAttrib4sv", userptr);
3024 glVertexAttrib4ubv = (PFNGLVERTEXATTRIB4UBVPROC) load("glVertexAttrib4ubv", userptr);
3025 glVertexAttrib4uiv = (PFNGLVERTEXATTRIB4UIVPROC) load("glVertexAttrib4uiv", userptr);
3026 glVertexAttrib4usv = (PFNGLVERTEXATTRIB4USVPROC) load("glVertexAttrib4usv", userptr);
3027 glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC) load("glVertexAttribPointer", userptr);
3028 }
3029 static void glad_gl_load_GL_VERSION_2_1( GLADuserptrloadfunc load, void* userptr) {
3030 if(!GLAD_GL_VERSION_2_1) return;
3031 glUniformMatrix2x3fv = (PFNGLUNIFORMMATRIX2X3FVPROC) load("glUniformMatrix2x3fv", userptr);
3032 glUniformMatrix2x4fv = (PFNGLUNIFORMMATRIX2X4FVPROC) load("glUniformMatrix2x4fv", userptr);
3033 glUniformMatrix3x2fv = (PFNGLUNIFORMMATRIX3X2FVPROC) load("glUniformMatrix3x2fv", userptr);
3034 glUniformMatrix3x4fv = (PFNGLUNIFORMMATRIX3X4FVPROC) load("glUniformMatrix3x4fv", userptr);
3035 glUniformMatrix4x2fv = (PFNGLUNIFORMMATRIX4X2FVPROC) load("glUniformMatrix4x2fv", userptr);
3036 glUniformMatrix4x3fv = (PFNGLUNIFORMMATRIX4X3FVPROC) load("glUniformMatrix4x3fv", userptr);
3037 }
3038 static void glad_gl_load_GL_VERSION_3_0( GLADuserptrloadfunc load, void* userptr) {
3039 if(!GLAD_GL_VERSION_3_0) return;
3040 glBeginConditionalRender = (PFNGLBEGINCONDITIONALRENDERPROC) load("glBeginConditionalRender", userptr);
3041 glBeginTransformFeedback = (PFNGLBEGINTRANSFORMFEEDBACKPROC) load("glBeginTransformFeedback", userptr);
3042 glBindBufferBase = (PFNGLBINDBUFFERBASEPROC) load("glBindBufferBase", userptr);
3043 glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC) load("glBindBufferRange", userptr);
3044 glBindFragDataLocation = (PFNGLBINDFRAGDATALOCATIONPROC) load("glBindFragDataLocation", userptr);
3045 glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC) load("glBindFramebuffer", userptr);
3046 glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC) load("glBindRenderbuffer", userptr);
3047 glBindVertexArray = (PFNGLBINDVERTEXARRAYPROC) load("glBindVertexArray", userptr);
3048 glBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC) load("glBlitFramebuffer", userptr);
3049 glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC) load("glCheckFramebufferStatus", userptr);
3050 glClampColor = (PFNGLCLAMPCOLORPROC) load("glClampColor", userptr);
3051 glClearBufferfi = (PFNGLCLEARBUFFERFIPROC) load("glClearBufferfi", userptr);
3052 glClearBufferfv = (PFNGLCLEARBUFFERFVPROC) load("glClearBufferfv", userptr);
3053 glClearBufferiv = (PFNGLCLEARBUFFERIVPROC) load("glClearBufferiv", userptr);
3054 glClearBufferuiv = (PFNGLCLEARBUFFERUIVPROC) load("glClearBufferuiv", userptr);
3055 glColorMaski = (PFNGLCOLORMASKIPROC) load("glColorMaski", userptr);
3056 glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC) load("glDeleteFramebuffers", userptr);
3057 glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC) load("glDeleteRenderbuffers", userptr);
3058 glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC) load("glDeleteVertexArrays", userptr);
3059 glDisablei = (PFNGLDISABLEIPROC) load("glDisablei", userptr);
3060 glEnablei = (PFNGLENABLEIPROC) load("glEnablei", userptr);
3061 glEndConditionalRender = (PFNGLENDCONDITIONALRENDERPROC) load("glEndConditionalRender", userptr);
3062 glEndTransformFeedback = (PFNGLENDTRANSFORMFEEDBACKPROC) load("glEndTransformFeedback", userptr);
3063 glFlushMappedBufferRange = (PFNGLFLUSHMAPPEDBUFFERRANGEPROC) load("glFlushMappedBufferRange", userptr);
3064 glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC) load("glFramebufferRenderbuffer", userptr);
3065 glFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC) load("glFramebufferTexture1D", userptr);
3066 glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC) load("glFramebufferTexture2D", userptr);
3067 glFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC) load("glFramebufferTexture3D", userptr);
3068 glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC) load("glFramebufferTextureLayer", userptr);
3069 glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC) load("glGenFramebuffers", userptr);
3070 glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC) load("glGenRenderbuffers", userptr);
3071 glGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC) load("glGenVertexArrays", userptr);
3072 glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC) load("glGenerateMipmap", userptr);
3073 glGetBooleani_v = (PFNGLGETBOOLEANI_VPROC) load("glGetBooleani_v", userptr);
3074 glGetFragDataLocation = (PFNGLGETFRAGDATALOCATIONPROC) load("glGetFragDataLocation", userptr);
3075 glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) load("glGetFramebufferAttachmentParameteriv", userptr);
3076 glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC) load("glGetIntegeri_v", userptr);
3077 glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC) load("glGetRenderbufferParameteriv", userptr);
3078 glGetStringi = (PFNGLGETSTRINGIPROC) load("glGetStringi", userptr);
3079 glGetTexParameterIiv = (PFNGLGETTEXPARAMETERIIVPROC) load("glGetTexParameterIiv", userptr);
3080 glGetTexParameterIuiv = (PFNGLGETTEXPARAMETERIUIVPROC) load("glGetTexParameterIuiv", userptr);
3081 glGetTransformFeedbackVarying = (PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) load("glGetTransformFeedbackVarying", userptr);
3082 glGetUniformuiv = (PFNGLGETUNIFORMUIVPROC) load("glGetUniformuiv", userptr);
3083 glGetVertexAttribIiv = (PFNGLGETVERTEXATTRIBIIVPROC) load("glGetVertexAttribIiv", userptr);
3084 glGetVertexAttribIuiv = (PFNGLGETVERTEXATTRIBIUIVPROC) load("glGetVertexAttribIuiv", userptr);
3085 glIsEnabledi = (PFNGLISENABLEDIPROC) load("glIsEnabledi", userptr);
3086 glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC) load("glIsFramebuffer", userptr);
3087 glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC) load("glIsRenderbuffer", userptr);
3088 glIsVertexArray = (PFNGLISVERTEXARRAYPROC) load("glIsVertexArray", userptr);
3089 glMapBufferRange = (PFNGLMAPBUFFERRANGEPROC) load("glMapBufferRange", userptr);
3090 glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC) load("glRenderbufferStorage", userptr);
3091 glRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) load("glRenderbufferStorageMultisample", userptr);
3092 glTexParameterIiv = (PFNGLTEXPARAMETERIIVPROC) load("glTexParameterIiv", userptr);
3093 glTexParameterIuiv = (PFNGLTEXPARAMETERIUIVPROC) load("glTexParameterIuiv", userptr);
3094 glTransformFeedbackVaryings = (PFNGLTRANSFORMFEEDBACKVARYINGSPROC) load("glTransformFeedbackVaryings", userptr);
3095 glUniform1ui = (PFNGLUNIFORM1UIPROC) load("glUniform1ui", userptr);
3096 glUniform1uiv = (PFNGLUNIFORM1UIVPROC) load("glUniform1uiv", userptr);
3097 glUniform2ui = (PFNGLUNIFORM2UIPROC) load("glUniform2ui", userptr);
3098 glUniform2uiv = (PFNGLUNIFORM2UIVPROC) load("glUniform2uiv", userptr);
3099 glUniform3ui = (PFNGLUNIFORM3UIPROC) load("glUniform3ui", userptr);
3100 glUniform3uiv = (PFNGLUNIFORM3UIVPROC) load("glUniform3uiv", userptr);
3101 glUniform4ui = (PFNGLUNIFORM4UIPROC) load("glUniform4ui", userptr);
3102 glUniform4uiv = (PFNGLUNIFORM4UIVPROC) load("glUniform4uiv", userptr);
3103 glVertexAttribI1i = (PFNGLVERTEXATTRIBI1IPROC) load("glVertexAttribI1i", userptr);
3104 glVertexAttribI1iv = (PFNGLVERTEXATTRIBI1IVPROC) load("glVertexAttribI1iv", userptr);
3105 glVertexAttribI1ui = (PFNGLVERTEXATTRIBI1UIPROC) load("glVertexAttribI1ui", userptr);
3106 glVertexAttribI1uiv = (PFNGLVERTEXATTRIBI1UIVPROC) load("glVertexAttribI1uiv", userptr);
3107 glVertexAttribI2i = (PFNGLVERTEXATTRIBI2IPROC) load("glVertexAttribI2i", userptr);
3108 glVertexAttribI2iv = (PFNGLVERTEXATTRIBI2IVPROC) load("glVertexAttribI2iv", userptr);
3109 glVertexAttribI2ui = (PFNGLVERTEXATTRIBI2UIPROC) load("glVertexAttribI2ui", userptr);
3110 glVertexAttribI2uiv = (PFNGLVERTEXATTRIBI2UIVPROC) load("glVertexAttribI2uiv", userptr);
3111 glVertexAttribI3i = (PFNGLVERTEXATTRIBI3IPROC) load("glVertexAttribI3i", userptr);
3112 glVertexAttribI3iv = (PFNGLVERTEXATTRIBI3IVPROC) load("glVertexAttribI3iv", userptr);
3113 glVertexAttribI3ui = (PFNGLVERTEXATTRIBI3UIPROC) load("glVertexAttribI3ui", userptr);
3114 glVertexAttribI3uiv = (PFNGLVERTEXATTRIBI3UIVPROC) load("glVertexAttribI3uiv", userptr);
3115 glVertexAttribI4bv = (PFNGLVERTEXATTRIBI4BVPROC) load("glVertexAttribI4bv", userptr);
3116 glVertexAttribI4i = (PFNGLVERTEXATTRIBI4IPROC) load("glVertexAttribI4i", userptr);
3117 glVertexAttribI4iv = (PFNGLVERTEXATTRIBI4IVPROC) load("glVertexAttribI4iv", userptr);
3118 glVertexAttribI4sv = (PFNGLVERTEXATTRIBI4SVPROC) load("glVertexAttribI4sv", userptr);
3119 glVertexAttribI4ubv = (PFNGLVERTEXATTRIBI4UBVPROC) load("glVertexAttribI4ubv", userptr);
3120 glVertexAttribI4ui = (PFNGLVERTEXATTRIBI4UIPROC) load("glVertexAttribI4ui", userptr);
3121 glVertexAttribI4uiv = (PFNGLVERTEXATTRIBI4UIVPROC) load("glVertexAttribI4uiv", userptr);
3122 glVertexAttribI4usv = (PFNGLVERTEXATTRIBI4USVPROC) load("glVertexAttribI4usv", userptr);
3123 glVertexAttribIPointer = (PFNGLVERTEXATTRIBIPOINTERPROC) load("glVertexAttribIPointer", userptr);
3124 }
3125 static void glad_gl_load_GL_VERSION_3_1( GLADuserptrloadfunc load, void* userptr) {
3126 if(!GLAD_GL_VERSION_3_1) return;
3127 glBindBufferBase = (PFNGLBINDBUFFERBASEPROC) load("glBindBufferBase", userptr);
3128 glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC) load("glBindBufferRange", userptr);
3129 glCopyBufferSubData = (PFNGLCOPYBUFFERSUBDATAPROC) load("glCopyBufferSubData", userptr);
3130 glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDPROC) load("glDrawArraysInstanced", userptr);
3131 glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDPROC) load("glDrawElementsInstanced", userptr);
3132 glGetActiveUniformBlockName = (PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) load("glGetActiveUniformBlockName", userptr);
3133 glGetActiveUniformBlockiv = (PFNGLGETACTIVEUNIFORMBLOCKIVPROC) load("glGetActiveUniformBlockiv", userptr);
3134 glGetActiveUniformName = (PFNGLGETACTIVEUNIFORMNAMEPROC) load("glGetActiveUniformName", userptr);
3135 glGetActiveUniformsiv = (PFNGLGETACTIVEUNIFORMSIVPROC) load("glGetActiveUniformsiv", userptr);
3136 glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC) load("glGetIntegeri_v", userptr);
3137 glGetUniformBlockIndex = (PFNGLGETUNIFORMBLOCKINDEXPROC) load("glGetUniformBlockIndex", userptr);
3138 glGetUniformIndices = (PFNGLGETUNIFORMINDICESPROC) load("glGetUniformIndices", userptr);
3139 glPrimitiveRestartIndex = (PFNGLPRIMITIVERESTARTINDEXPROC) load("glPrimitiveRestartIndex", userptr);
3140 glTexBuffer = (PFNGLTEXBUFFERPROC) load("glTexBuffer", userptr);
3141 glUniformBlockBinding = (PFNGLUNIFORMBLOCKBINDINGPROC) load("glUniformBlockBinding", userptr);
3142 }
3143 static void glad_gl_load_GL_VERSION_3_2( GLADuserptrloadfunc load, void* userptr) {
3144 if(!GLAD_GL_VERSION_3_2) return;
3145 glClientWaitSync = (PFNGLCLIENTWAITSYNCPROC) load("glClientWaitSync", userptr);
3146 glDeleteSync = (PFNGLDELETESYNCPROC) load("glDeleteSync", userptr);
3147 glDrawElementsBaseVertex = (PFNGLDRAWELEMENTSBASEVERTEXPROC) load("glDrawElementsBaseVertex", userptr);
3148 glDrawElementsInstancedBaseVertex = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) load("glDrawElementsInstancedBaseVertex", userptr);
3149 glDrawRangeElementsBaseVertex = (PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC) load("glDrawRangeElementsBaseVertex", userptr);
3150 glFenceSync = (PFNGLFENCESYNCPROC) load("glFenceSync", userptr);
3151 glFramebufferTexture = (PFNGLFRAMEBUFFERTEXTUREPROC) load("glFramebufferTexture", userptr);
3152 glGetBufferParameteri64v = (PFNGLGETBUFFERPARAMETERI64VPROC) load("glGetBufferParameteri64v", userptr);
3153 glGetInteger64i_v = (PFNGLGETINTEGER64I_VPROC) load("glGetInteger64i_v", userptr);
3154 glGetInteger64v = (PFNGLGETINTEGER64VPROC) load("glGetInteger64v", userptr);
3155 glGetMultisamplefv = (PFNGLGETMULTISAMPLEFVPROC) load("glGetMultisamplefv", userptr);
3156 glGetSynciv = (PFNGLGETSYNCIVPROC) load("glGetSynciv", userptr);
3157 glIsSync = (PFNGLISSYNCPROC) load("glIsSync", userptr);
3158 glMultiDrawElementsBaseVertex = (PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) load("glMultiDrawElementsBaseVertex", userptr);
3159 glProvokingVertex = (PFNGLPROVOKINGVERTEXPROC) load("glProvokingVertex", userptr);
3160 glSampleMaski = (PFNGLSAMPLEMASKIPROC) load("glSampleMaski", userptr);
3161 glTexImage2DMultisample = (PFNGLTEXIMAGE2DMULTISAMPLEPROC) load("glTexImage2DMultisample", userptr);
3162 glTexImage3DMultisample = (PFNGLTEXIMAGE3DMULTISAMPLEPROC) load("glTexImage3DMultisample", userptr);
3163 glWaitSync = (PFNGLWAITSYNCPROC) load("glWaitSync", userptr);
3164 }
3165 static void glad_gl_load_GL_VERSION_3_3( GLADuserptrloadfunc load, void* userptr) {
3166 if(!GLAD_GL_VERSION_3_3) return;
3167 glBindFragDataLocationIndexed = (PFNGLBINDFRAGDATALOCATIONINDEXEDPROC) load("glBindFragDataLocationIndexed", userptr);
3168 glBindSampler = (PFNGLBINDSAMPLERPROC) load("glBindSampler", userptr);
3169 glDeleteSamplers = (PFNGLDELETESAMPLERSPROC) load("glDeleteSamplers", userptr);
3170 glGenSamplers = (PFNGLGENSAMPLERSPROC) load("glGenSamplers", userptr);
3171 glGetFragDataIndex = (PFNGLGETFRAGDATAINDEXPROC) load("glGetFragDataIndex", userptr);
3172 glGetQueryObjecti64v = (PFNGLGETQUERYOBJECTI64VPROC) load("glGetQueryObjecti64v", userptr);
3173 glGetQueryObjectui64v = (PFNGLGETQUERYOBJECTUI64VPROC) load("glGetQueryObjectui64v", userptr);
3174 glGetSamplerParameterIiv = (PFNGLGETSAMPLERPARAMETERIIVPROC) load("glGetSamplerParameterIiv", userptr);
3175 glGetSamplerParameterIuiv = (PFNGLGETSAMPLERPARAMETERIUIVPROC) load("glGetSamplerParameterIuiv", userptr);
3176 glGetSamplerParameterfv = (PFNGLGETSAMPLERPARAMETERFVPROC) load("glGetSamplerParameterfv", userptr);
3177 glGetSamplerParameteriv = (PFNGLGETSAMPLERPARAMETERIVPROC) load("glGetSamplerParameteriv", userptr);
3178 glIsSampler = (PFNGLISSAMPLERPROC) load("glIsSampler", userptr);
3179 glQueryCounter = (PFNGLQUERYCOUNTERPROC) load("glQueryCounter", userptr);
3180 glSamplerParameterIiv = (PFNGLSAMPLERPARAMETERIIVPROC) load("glSamplerParameterIiv", userptr);
3181 glSamplerParameterIuiv = (PFNGLSAMPLERPARAMETERIUIVPROC) load("glSamplerParameterIuiv", userptr);
3182 glSamplerParameterf = (PFNGLSAMPLERPARAMETERFPROC) load("glSamplerParameterf", userptr);
3183 glSamplerParameterfv = (PFNGLSAMPLERPARAMETERFVPROC) load("glSamplerParameterfv", userptr);
3184 glSamplerParameteri = (PFNGLSAMPLERPARAMETERIPROC) load("glSamplerParameteri", userptr);
3185 glSamplerParameteriv = (PFNGLSAMPLERPARAMETERIVPROC) load("glSamplerParameteriv", userptr);
3186 glVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISORPROC) load("glVertexAttribDivisor", userptr);
3187 glVertexAttribP1ui = (PFNGLVERTEXATTRIBP1UIPROC) load("glVertexAttribP1ui", userptr);
3188 glVertexAttribP1uiv = (PFNGLVERTEXATTRIBP1UIVPROC) load("glVertexAttribP1uiv", userptr);
3189 glVertexAttribP2ui = (PFNGLVERTEXATTRIBP2UIPROC) load("glVertexAttribP2ui", userptr);
3190 glVertexAttribP2uiv = (PFNGLVERTEXATTRIBP2UIVPROC) load("glVertexAttribP2uiv", userptr);
3191 glVertexAttribP3ui = (PFNGLVERTEXATTRIBP3UIPROC) load("glVertexAttribP3ui", userptr);
3192 glVertexAttribP3uiv = (PFNGLVERTEXATTRIBP3UIVPROC) load("glVertexAttribP3uiv", userptr);
3193 glVertexAttribP4ui = (PFNGLVERTEXATTRIBP4UIPROC) load("glVertexAttribP4ui", userptr);
3194 glVertexAttribP4uiv = (PFNGLVERTEXATTRIBP4UIVPROC) load("glVertexAttribP4uiv", userptr);
3195 }
3196
3197
3198
3199 #if defined(GL_ES_VERSION_3_0) || defined(GL_VERSION_3_0)
3200 #define GLAD_GL_IS_SOME_NEW_VERSION 1
3201 #else
3202 #define GLAD_GL_IS_SOME_NEW_VERSION 0
3203 #endif
3204
3205 static int glad_gl_get_extensions( int version, const char **out_exts, unsigned int *out_num_exts_i, char ***out_exts_i) {
3206 #if GLAD_GL_IS_SOME_NEW_VERSION
3207 if(GLAD_VERSION_MAJOR(version) < 3) {
3208 #else
3209 (void) version;
3210 (void) out_num_exts_i;
3211 (void) out_exts_i;
3212 #endif
3213 if (glGetString == NULL) {
3214 return 0;
3215 }
3216 *out_exts = (const char *)glGetString(GL_EXTENSIONS);
3217 #if GLAD_GL_IS_SOME_NEW_VERSION
3218 } else {
3219 unsigned int index = 0;
3220 unsigned int num_exts_i = 0;
3221 char **exts_i = NULL;
3222 if (glGetStringi == NULL || glGetIntegerv == NULL) {
3223 return 0;
3224 }
3225 glGetIntegerv(GL_NUM_EXTENSIONS, (int*) &num_exts_i);
3226 if (num_exts_i > 0) {
3227 exts_i = (char **) malloc(num_exts_i * (sizeof *exts_i));
3228 }
3229 if (exts_i == NULL) {
3230 return 0;
3231 }
3232 for(index = 0; index < num_exts_i; index++) {
3233 const char *gl_str_tmp = (const char*) glGetStringi(GL_EXTENSIONS, index);
3234 size_t len = strlen(gl_str_tmp) + 1;
3235
3236 char *local_str = (char*) malloc(len * sizeof(char));
3237 if(local_str != NULL) {
3238 memcpy(local_str, gl_str_tmp, len * sizeof(char));
3239 }
3240
3241 exts_i[index] = local_str;
3242 }
3243
3244 *out_num_exts_i = num_exts_i;
3245 *out_exts_i = exts_i;
3246 }
3247 #endif
3248 return 1;
3249 }
3250 static void glad_gl_free_extensions(char **exts_i, unsigned int num_exts_i) {
3251 if (exts_i != NULL) {
3252 unsigned int index;
3253 for(index = 0; index < num_exts_i; index++) {
3254 free((void *) (exts_i[index]));
3255 }
3256 free((void *)exts_i);
3257 exts_i = NULL;
3258 }
3259 }
3260 static int glad_gl_has_extension(int version, const char *exts, unsigned int num_exts_i, char **exts_i, const char *ext) {
3261 if(GLAD_VERSION_MAJOR(version) < 3 || !GLAD_GL_IS_SOME_NEW_VERSION) {
3262 const char *extensions;
3263 const char *loc;
3264 const char *terminator;
3265 extensions = exts;
3266 if(extensions == NULL || ext == NULL) {
3267 return 0;
3268 }
3269 while(1) {
3270 loc = strstr(extensions, ext);
3271 if(loc == NULL) {
3272 return 0;
3273 }
3274 terminator = loc + strlen(ext);
3275 if((loc == extensions || *(loc - 1) == ' ') &&
3276 (*terminator == ' ' || *terminator == '\0')) {
3277 return 1;
3278 }
3279 extensions = terminator;
3280 }
3281 } else {
3282 unsigned int index;
3283 for(index = 0; index < num_exts_i; index++) {
3284 const char *e = exts_i[index];
3285 if(strcmp(e, ext) == 0) {
3286 return 1;
3287 }
3288 }
3289 }
3290 return 0;
3291 }
3292
3293 static GLADapiproc glad_gl_get_proc_from_userptr(const char* name, void *userptr) {
3294 return (GLAD_GNUC_EXTENSION (GLADapiproc (*)(const char *name)) userptr)(name);
3295 }
3296
3297 static int glad_gl_find_extensions_gl( int version) {
3298 const char *exts = NULL;
3299 unsigned int num_exts_i = 0;
3300 char **exts_i = NULL;
3301 if (!glad_gl_get_extensions(version, &exts, &num_exts_i, &exts_i)) return 0;
3302
3303 (void) glad_gl_has_extension;
3304
3305 glad_gl_free_extensions(exts_i, num_exts_i);
3306
3307 return 1;
3308 }
3309
3310 static int glad_gl_find_core_gl(void) {
3311 int i, major, minor;
3312 const char* version;
3313 const char* prefixes[] = {
3314 "OpenGL ES-CM ",
3315 "OpenGL ES-CL ",
3316 "OpenGL ES ",
3317 NULL
3318 };
3319 version = (const char*) glGetString(GL_VERSION);
3320 if (!version) return 0;
3321 for (i = 0; prefixes[i]; i++) {
3322 const size_t length = strlen(prefixes[i]);
3323 if (strncmp(version, prefixes[i], length) == 0) {
3324 version += length;
3325 break;
3326 }
3327 }
3328
3329 GLAD_IMPL_UTIL_SSCANF(version, "%d.%d", &major, &minor);
3330
3331 GLAD_GL_VERSION_1_0 = (major == 1 && minor >= 0) || major > 1;
3332 GLAD_GL_VERSION_1_1 = (major == 1 && minor >= 1) || major > 1;
3333 GLAD_GL_VERSION_1_2 = (major == 1 && minor >= 2) || major > 1;
3334 GLAD_GL_VERSION_1_3 = (major == 1 && minor >= 3) || major > 1;
3335 GLAD_GL_VERSION_1_4 = (major == 1 && minor >= 4) || major > 1;
3336 GLAD_GL_VERSION_1_5 = (major == 1 && minor >= 5) || major > 1;
3337 GLAD_GL_VERSION_2_0 = (major == 2 && minor >= 0) || major > 2;
3338 GLAD_GL_VERSION_2_1 = (major == 2 && minor >= 1) || major > 2;
3339 GLAD_GL_VERSION_3_0 = (major == 3 && minor >= 0) || major > 3;
3340 GLAD_GL_VERSION_3_1 = (major == 3 && minor >= 1) || major > 3;
3341 GLAD_GL_VERSION_3_2 = (major == 3 && minor >= 2) || major > 3;
3342 GLAD_GL_VERSION_3_3 = (major == 3 && minor >= 3) || major > 3;
3343
3344 return GLAD_MAKE_VERSION(major, minor);
3345 }
3346
3347 int gladLoadGLUserPtr( GLADuserptrloadfunc load, void *userptr) {
3348 int version;
3349
3350 glGetString = (PFNGLGETSTRINGPROC) load("glGetString", userptr);
3351 if(glGetString == NULL) return 0;
3352 if(glGetString(GL_VERSION) == NULL) return 0;
3353 version = glad_gl_find_core_gl();
3354
3355 glad_gl_load_GL_VERSION_1_0(load, userptr);
3356 glad_gl_load_GL_VERSION_1_1(load, userptr);
3357 glad_gl_load_GL_VERSION_1_2(load, userptr);
3358 glad_gl_load_GL_VERSION_1_3(load, userptr);
3359 glad_gl_load_GL_VERSION_1_4(load, userptr);
3360 glad_gl_load_GL_VERSION_1_5(load, userptr);
3361 glad_gl_load_GL_VERSION_2_0(load, userptr);
3362 glad_gl_load_GL_VERSION_2_1(load, userptr);
3363 glad_gl_load_GL_VERSION_3_0(load, userptr);
3364 glad_gl_load_GL_VERSION_3_1(load, userptr);
3365 glad_gl_load_GL_VERSION_3_2(load, userptr);
3366 glad_gl_load_GL_VERSION_3_3(load, userptr);
3367
3368 if (!glad_gl_find_extensions_gl(version)) return 0;
3369
3370
3371
3372 return version;
3373 }
3374
3375
3376 int gladLoadGL( GLADloadfunc load) {
3377 return gladLoadGLUserPtr( glad_gl_get_proc_from_userptr, GLAD_GNUC_EXTENSION (void*) load);
3378 }
3379
3380
3381
3382
3383
3384 #endif /* GLAD_GL_IMPLEMENTATION */
3385
File include/fg3/glad_gles2.h added (mode: 100755) (index 0000000..dd40822)
1 /**
2 * Loader generated by glad 2.0.0-beta on Wed Oct 3 12:25:32 2018
3 *
4 * Generator: C/C++
5 * Specification: gl
6 * Extensions: 0
7 *
8 * APIs:
9 * - gles2=3.0
10 *
11 * Options:
12 * - MX_GLOBAL = False
13 * - LOADER = False
14 * - ALIAS = False
15 * - HEADER_ONLY = True
16 * - DEBUG = False
17 * - MX = False
18 *
19 * Commandline:
20 * --api='gles2=3.0' --extensions='' c --header-only
21 *
22 * Online:
23 * http://glad.sh/#api=gles2%3D3.0&extensions=&generator=c&options=HEADER_ONLY
24 *
25 */
26
27 #ifndef GLAD_GLES2_H_
28 #define GLAD_GLES2_H_
29
30 #ifdef __gl2_h_
31 #error OpenGL ES 2 header already included (API: gles2), remove previous include!
32 #endif
33 #define __gl2_h_ 1
34
35 #ifdef __gl3_h_
36 #error OpenGL ES 3 header already included (API: gles2), remove previous include!
37 #endif
38 #define __gl3_h_ 1
39
40
41 #define GLAD_GLES2
42 #define GLAD_OPTION_GLES2_HEADER_ONLY
43
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47
48 #ifndef GLAD_PLATFORM_H_
49 #define GLAD_PLATFORM_H_
50
51 #ifndef GLAD_PLATFORM_WIN32
52 #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__MINGW32__)
53 #define GLAD_PLATFORM_WIN32 1
54 #else
55 #define GLAD_PLATFORM_WIN32 0
56 #endif
57 #endif
58
59 #ifndef GLAD_PLATFORM_APPLE
60 #ifdef __APPLE__
61 #define GLAD_PLATFORM_APPLE 1
62 #else
63 #define GLAD_PLATFORM_APPLE 0
64 #endif
65 #endif
66
67 #ifndef GLAD_PLATFORM_EMSCRIPTEN
68 #ifdef __EMSCRIPTEN__
69 #define GLAD_PLATFORM_EMSCRIPTEN 1
70 #else
71 #define GLAD_PLATFORM_EMSCRIPTEN 0
72 #endif
73 #endif
74
75 #ifndef GLAD_PLATFORM_UWP
76 #if defined(_MSC_VER) && !defined(GLAD_INTERNAL_HAVE_WINAPIFAMILY)
77 #ifdef __has_include
78 #if __has_include(<winapifamily.h>)
79 #define GLAD_INTERNAL_HAVE_WINAPIFAMILY 1
80 #endif
81 #elif _MSC_VER >= 1700 && !_USING_V110_SDK71_
82 #define GLAD_INTERNAL_HAVE_WINAPIFAMILY 1
83 #endif
84 #endif
85
86 #ifdef GLAD_INTERNAL_HAVE_WINAPIFAMILY
87 #include <winapifamily.h>
88 #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
89 #define GLAD_PLATFORM_UWP 1
90 #endif
91 #endif
92
93 #ifndef GLAD_PLATFORM_UWP
94 #define GLAD_PLATFORM_UWP 0
95 #endif
96 #endif
97
98 #ifdef __GNUC__
99 #define GLAD_GNUC_EXTENSION __extension__
100 #else
101 #define GLAD_GNUC_EXTENSION
102 #endif
103
104 #ifndef GLAD_API_CALL
105 #if defined(GLAD_API_CALL_EXPORT)
106 #if GLAD_PLATFORM_WIN32 || defined(__CYGWIN__)
107 #if defined(GLAD_API_CALL_EXPORT_BUILD)
108 #if defined(__GNUC__)
109 #define GLAD_API_CALL __attribute__ ((dllexport)) extern
110 #else
111 #define GLAD_API_CALL __declspec(dllexport) extern
112 #endif
113 #else
114 #if defined(__GNUC__)
115 #define GLAD_API_CALL __attribute__ ((dllimport)) extern
116 #else
117 #define GLAD_API_CALL __declspec(dllimport) extern
118 #endif
119 #endif
120 #elif defined(__GNUC__) && defined(GLAD_API_CALL_EXPORT_BUILD)
121 #define GLAD_API_CALL __attribute__ ((visibility ("default"))) extern
122 #else
123 #define GLAD_API_CALL extern
124 #endif
125 #else
126 #define GLAD_API_CALL extern
127 #endif
128 #endif
129
130 #ifdef APIENTRY
131 #define GLAD_API_PTR APIENTRY
132 #elif GLAD_PLATFORM_WIN32
133 #define GLAD_API_PTR __stdcall
134 #else
135 #define GLAD_API_PTR
136 #endif
137
138 #ifndef GLAPI
139 #define GLAPI GLAD_API_CALL
140 #endif
141
142 #ifndef GLAPIENTRY
143 #define GLAPIENTRY GLAD_API_PTR
144 #endif
145
146
147 #define GLAD_MAKE_VERSION(major, minor) (major * 10000 + minor)
148 #define GLAD_VERSION_MAJOR(version) (version / 10000)
149 #define GLAD_VERSION_MINOR(version) (version % 10000)
150
151 typedef void (*GLADapiproc)(void);
152
153 typedef GLADapiproc (*GLADloadfunc)(const char *name);
154 typedef GLADapiproc (*GLADuserptrloadfunc)(const char *name, void *userptr);
155
156 typedef void (*GLADprecallback)(const char *name, GLADapiproc apiproc, int len_args, ...);
157 typedef void (*GLADpostcallback)(void *ret, const char *name, GLADapiproc apiproc, int len_args, ...);
158
159 #endif /* GLAD_PLATFORM_H_ */
160
161 #define GL_ACTIVE_ATTRIBUTES 0x8B89
162 #define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
163 #define GL_ACTIVE_TEXTURE 0x84E0
164 #define GL_ACTIVE_UNIFORMS 0x8B86
165 #define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36
166 #define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35
167 #define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
168 #define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
169 #define GL_ALIASED_POINT_SIZE_RANGE 0x846D
170 #define GL_ALPHA 0x1906
171 #define GL_ALPHA_BITS 0x0D55
172 #define GL_ALREADY_SIGNALED 0x911A
173 #define GL_ALWAYS 0x0207
174 #define GL_ANY_SAMPLES_PASSED 0x8C2F
175 #define GL_ANY_SAMPLES_PASSED_CONSERVATIVE 0x8D6A
176 #define GL_ARRAY_BUFFER 0x8892
177 #define GL_ARRAY_BUFFER_BINDING 0x8894
178 #define GL_ATTACHED_SHADERS 0x8B85
179 #define GL_BACK 0x0405
180 #define GL_BLEND 0x0BE2
181 #define GL_BLEND_COLOR 0x8005
182 #define GL_BLEND_DST_ALPHA 0x80CA
183 #define GL_BLEND_DST_RGB 0x80C8
184 #define GL_BLEND_EQUATION 0x8009
185 #define GL_BLEND_EQUATION_ALPHA 0x883D
186 #define GL_BLEND_EQUATION_RGB 0x8009
187 #define GL_BLEND_SRC_ALPHA 0x80CB
188 #define GL_BLEND_SRC_RGB 0x80C9
189 #define GL_BLUE 0x1905
190 #define GL_BLUE_BITS 0x0D54
191 #define GL_BOOL 0x8B56
192 #define GL_BOOL_VEC2 0x8B57
193 #define GL_BOOL_VEC3 0x8B58
194 #define GL_BOOL_VEC4 0x8B59
195 #define GL_BUFFER_ACCESS_FLAGS 0x911F
196 #define GL_BUFFER_MAPPED 0x88BC
197 #define GL_BUFFER_MAP_LENGTH 0x9120
198 #define GL_BUFFER_MAP_OFFSET 0x9121
199 #define GL_BUFFER_MAP_POINTER 0x88BD
200 #define GL_BUFFER_SIZE 0x8764
201 #define GL_BUFFER_USAGE 0x8765
202 #define GL_BYTE 0x1400
203 #define GL_CCW 0x0901
204 #define GL_CLAMP_TO_EDGE 0x812F
205 #define GL_COLOR 0x1800
206 #define GL_COLOR_ATTACHMENT0 0x8CE0
207 #define GL_COLOR_ATTACHMENT1 0x8CE1
208 #define GL_COLOR_ATTACHMENT10 0x8CEA
209 #define GL_COLOR_ATTACHMENT11 0x8CEB
210 #define GL_COLOR_ATTACHMENT12 0x8CEC
211 #define GL_COLOR_ATTACHMENT13 0x8CED
212 #define GL_COLOR_ATTACHMENT14 0x8CEE
213 #define GL_COLOR_ATTACHMENT15 0x8CEF
214 #define GL_COLOR_ATTACHMENT16 0x8CF0
215 #define GL_COLOR_ATTACHMENT17 0x8CF1
216 #define GL_COLOR_ATTACHMENT18 0x8CF2
217 #define GL_COLOR_ATTACHMENT19 0x8CF3
218 #define GL_COLOR_ATTACHMENT2 0x8CE2
219 #define GL_COLOR_ATTACHMENT20 0x8CF4
220 #define GL_COLOR_ATTACHMENT21 0x8CF5
221 #define GL_COLOR_ATTACHMENT22 0x8CF6
222 #define GL_COLOR_ATTACHMENT23 0x8CF7
223 #define GL_COLOR_ATTACHMENT24 0x8CF8
224 #define GL_COLOR_ATTACHMENT25 0x8CF9
225 #define GL_COLOR_ATTACHMENT26 0x8CFA
226 #define GL_COLOR_ATTACHMENT27 0x8CFB
227 #define GL_COLOR_ATTACHMENT28 0x8CFC
228 #define GL_COLOR_ATTACHMENT29 0x8CFD
229 #define GL_COLOR_ATTACHMENT3 0x8CE3
230 #define GL_COLOR_ATTACHMENT30 0x8CFE
231 #define GL_COLOR_ATTACHMENT31 0x8CFF
232 #define GL_COLOR_ATTACHMENT4 0x8CE4
233 #define GL_COLOR_ATTACHMENT5 0x8CE5
234 #define GL_COLOR_ATTACHMENT6 0x8CE6
235 #define GL_COLOR_ATTACHMENT7 0x8CE7
236 #define GL_COLOR_ATTACHMENT8 0x8CE8
237 #define GL_COLOR_ATTACHMENT9 0x8CE9
238 #define GL_COLOR_BUFFER_BIT 0x00004000
239 #define GL_COLOR_CLEAR_VALUE 0x0C22
240 #define GL_COLOR_WRITEMASK 0x0C23
241 #define GL_COMPARE_REF_TO_TEXTURE 0x884E
242 #define GL_COMPARE_R_TO_TEXTURE 0x884E
243 #define GL_COMPILE_STATUS 0x8B81
244 #define GL_COMPRESSED_R11_EAC 0x9270
245 #define GL_COMPRESSED_RG11_EAC 0x9272
246 #define GL_COMPRESSED_RGB8_ETC2 0x9274
247 #define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276
248 #define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278
249 #define GL_COMPRESSED_SIGNED_R11_EAC 0x9271
250 #define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273
251 #define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279
252 #define GL_COMPRESSED_SRGB8_ETC2 0x9275
253 #define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277
254 #define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
255 #define GL_CONDITION_SATISFIED 0x911C
256 #define GL_CONSTANT_ALPHA 0x8003
257 #define GL_CONSTANT_COLOR 0x8001
258 #define GL_COPY_READ_BUFFER 0x8F36
259 #define GL_COPY_READ_BUFFER_BINDING 0x8F36
260 #define GL_COPY_WRITE_BUFFER 0x8F37
261 #define GL_COPY_WRITE_BUFFER_BINDING 0x8F37
262 #define GL_CULL_FACE 0x0B44
263 #define GL_CULL_FACE_MODE 0x0B45
264 #define GL_CURRENT_PROGRAM 0x8B8D
265 #define GL_CURRENT_QUERY 0x8865
266 #define GL_CURRENT_VERTEX_ATTRIB 0x8626
267 #define GL_CW 0x0900
268 #define GL_DECR 0x1E03
269 #define GL_DECR_WRAP 0x8508
270 #define GL_DELETE_STATUS 0x8B80
271 #define GL_DEPTH 0x1801
272 #define GL_DEPTH24_STENCIL8 0x88F0
273 #define GL_DEPTH32F_STENCIL8 0x8CAD
274 #define GL_DEPTH_ATTACHMENT 0x8D00
275 #define GL_DEPTH_BITS 0x0D56
276 #define GL_DEPTH_BUFFER_BIT 0x00000100
277 #define GL_DEPTH_CLEAR_VALUE 0x0B73
278 #define GL_DEPTH_COMPONENT 0x1902
279 #define GL_DEPTH_COMPONENT16 0x81A5
280 #define GL_DEPTH_COMPONENT24 0x81A6
281 #define GL_DEPTH_COMPONENT32F 0x8CAC
282 #define GL_DEPTH_FUNC 0x0B74
283 #define GL_DEPTH_RANGE 0x0B70
284 #define GL_DEPTH_STENCIL 0x84F9
285 #define GL_DEPTH_STENCIL_ATTACHMENT 0x821A
286 #define GL_DEPTH_TEST 0x0B71
287 #define GL_DEPTH_WRITEMASK 0x0B72
288 #define GL_DITHER 0x0BD0
289 #define GL_DONT_CARE 0x1100
290 #define GL_DRAW_BUFFER0 0x8825
291 #define GL_DRAW_BUFFER1 0x8826
292 #define GL_DRAW_BUFFER10 0x882F
293 #define GL_DRAW_BUFFER11 0x8830
294 #define GL_DRAW_BUFFER12 0x8831
295 #define GL_DRAW_BUFFER13 0x8832
296 #define GL_DRAW_BUFFER14 0x8833
297 #define GL_DRAW_BUFFER15 0x8834
298 #define GL_DRAW_BUFFER2 0x8827
299 #define GL_DRAW_BUFFER3 0x8828
300 #define GL_DRAW_BUFFER4 0x8829
301 #define GL_DRAW_BUFFER5 0x882A
302 #define GL_DRAW_BUFFER6 0x882B
303 #define GL_DRAW_BUFFER7 0x882C
304 #define GL_DRAW_BUFFER8 0x882D
305 #define GL_DRAW_BUFFER9 0x882E
306 #define GL_DRAW_FRAMEBUFFER 0x8CA9
307 #define GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6
308 #define GL_DST_ALPHA 0x0304
309 #define GL_DST_COLOR 0x0306
310 #define GL_DYNAMIC_COPY 0x88EA
311 #define GL_DYNAMIC_DRAW 0x88E8
312 #define GL_DYNAMIC_READ 0x88E9
313 #define GL_ELEMENT_ARRAY_BUFFER 0x8893
314 #define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
315 #define GL_EQUAL 0x0202
316 #define GL_EXTENSIONS 0x1F03
317 #define GL_FALSE 0
318 #define GL_FASTEST 0x1101
319 #define GL_FIXED 0x140C
320 #define GL_FLOAT 0x1406
321 #define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD
322 #define GL_FLOAT_MAT2 0x8B5A
323 #define GL_FLOAT_MAT2x3 0x8B65
324 #define GL_FLOAT_MAT2x4 0x8B66
325 #define GL_FLOAT_MAT3 0x8B5B
326 #define GL_FLOAT_MAT3x2 0x8B67
327 #define GL_FLOAT_MAT3x4 0x8B68
328 #define GL_FLOAT_MAT4 0x8B5C
329 #define GL_FLOAT_MAT4x2 0x8B69
330 #define GL_FLOAT_MAT4x3 0x8B6A
331 #define GL_FLOAT_VEC2 0x8B50
332 #define GL_FLOAT_VEC3 0x8B51
333 #define GL_FLOAT_VEC4 0x8B52
334 #define GL_FRAGMENT_SHADER 0x8B30
335 #define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B
336 #define GL_FRAMEBUFFER 0x8D40
337 #define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215
338 #define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214
339 #define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210
340 #define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211
341 #define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216
342 #define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213
343 #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
344 #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
345 #define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212
346 #define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217
347 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
348 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4
349 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
350 #define GL_FRAMEBUFFER_BINDING 0x8CA6
351 #define GL_FRAMEBUFFER_COMPLETE 0x8CD5
352 #define GL_FRAMEBUFFER_DEFAULT 0x8218
353 #define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
354 #define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9
355 #define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
356 #define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56
357 #define GL_FRAMEBUFFER_UNDEFINED 0x8219
358 #define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
359 #define GL_FRONT 0x0404
360 #define GL_FRONT_AND_BACK 0x0408
361 #define GL_FRONT_FACE 0x0B46
362 #define GL_FUNC_ADD 0x8006
363 #define GL_FUNC_REVERSE_SUBTRACT 0x800B
364 #define GL_FUNC_SUBTRACT 0x800A
365 #define GL_GENERATE_MIPMAP_HINT 0x8192
366 #define GL_GEQUAL 0x0206
367 #define GL_GREATER 0x0204
368 #define GL_GREEN 0x1904
369 #define GL_GREEN_BITS 0x0D53
370 #define GL_HALF_FLOAT 0x140B
371 #define GL_HIGH_FLOAT 0x8DF2
372 #define GL_HIGH_INT 0x8DF5
373 #define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
374 #define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A
375 #define GL_INCR 0x1E02
376 #define GL_INCR_WRAP 0x8507
377 #define GL_INFO_LOG_LENGTH 0x8B84
378 #define GL_INT 0x1404
379 #define GL_INTERLEAVED_ATTRIBS 0x8C8C
380 #define GL_INT_2_10_10_10_REV 0x8D9F
381 #define GL_INT_SAMPLER_2D 0x8DCA
382 #define GL_INT_SAMPLER_2D_ARRAY 0x8DCF
383 #define GL_INT_SAMPLER_3D 0x8DCB
384 #define GL_INT_SAMPLER_CUBE 0x8DCC
385 #define GL_INT_VEC2 0x8B53
386 #define GL_INT_VEC3 0x8B54
387 #define GL_INT_VEC4 0x8B55
388 #define GL_INVALID_ENUM 0x0500
389 #define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
390 #define GL_INVALID_INDEX 0xFFFFFFFF
391 #define GL_INVALID_OPERATION 0x0502
392 #define GL_INVALID_VALUE 0x0501
393 #define GL_INVERT 0x150A
394 #define GL_KEEP 0x1E00
395 #define GL_LEQUAL 0x0203
396 #define GL_LESS 0x0201
397 #define GL_LINEAR 0x2601
398 #define GL_LINEAR_MIPMAP_LINEAR 0x2703
399 #define GL_LINEAR_MIPMAP_NEAREST 0x2701
400 #define GL_LINES 0x0001
401 #define GL_LINE_LOOP 0x0002
402 #define GL_LINE_STRIP 0x0003
403 #define GL_LINE_WIDTH 0x0B21
404 #define GL_LINK_STATUS 0x8B82
405 #define GL_LOW_FLOAT 0x8DF0
406 #define GL_LOW_INT 0x8DF3
407 #define GL_LUMINANCE 0x1909
408 #define GL_LUMINANCE_ALPHA 0x190A
409 #define GL_MAJOR_VERSION 0x821B
410 #define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010
411 #define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008
412 #define GL_MAP_INVALIDATE_RANGE_BIT 0x0004
413 #define GL_MAP_READ_BIT 0x0001
414 #define GL_MAP_UNSYNCHRONIZED_BIT 0x0020
415 #define GL_MAP_WRITE_BIT 0x0002
416 #define GL_MAX 0x8008
417 #define GL_MAX_3D_TEXTURE_SIZE 0x8073
418 #define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF
419 #define GL_MAX_COLOR_ATTACHMENTS 0x8CDF
420 #define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33
421 #define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
422 #define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E
423 #define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31
424 #define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
425 #define GL_MAX_DRAW_BUFFERS 0x8824
426 #define GL_MAX_ELEMENTS_INDICES 0x80E9
427 #define GL_MAX_ELEMENTS_VERTICES 0x80E8
428 #define GL_MAX_ELEMENT_INDEX 0x8D6B
429 #define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125
430 #define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D
431 #define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49
432 #define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD
433 #define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905
434 #define GL_MAX_RENDERBUFFER_SIZE 0x84E8
435 #define GL_MAX_SAMPLES 0x8D57
436 #define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111
437 #define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
438 #define GL_MAX_TEXTURE_LOD_BIAS 0x84FD
439 #define GL_MAX_TEXTURE_SIZE 0x0D33
440 #define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A
441 #define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B
442 #define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80
443 #define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30
444 #define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F
445 #define GL_MAX_VARYING_COMPONENTS 0x8B4B
446 #define GL_MAX_VARYING_VECTORS 0x8DFC
447 #define GL_MAX_VERTEX_ATTRIBS 0x8869
448 #define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122
449 #define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
450 #define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B
451 #define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A
452 #define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB
453 #define GL_MAX_VIEWPORT_DIMS 0x0D3A
454 #define GL_MEDIUM_FLOAT 0x8DF1
455 #define GL_MEDIUM_INT 0x8DF4
456 #define GL_MIN 0x8007
457 #define GL_MINOR_VERSION 0x821C
458 #define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904
459 #define GL_MIRRORED_REPEAT 0x8370
460 #define GL_NEAREST 0x2600
461 #define GL_NEAREST_MIPMAP_LINEAR 0x2702
462 #define GL_NEAREST_MIPMAP_NEAREST 0x2700
463 #define GL_NEVER 0x0200
464 #define GL_NICEST 0x1102
465 #define GL_NONE 0
466 #define GL_NOTEQUAL 0x0205
467 #define GL_NO_ERROR 0
468 #define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
469 #define GL_NUM_EXTENSIONS 0x821D
470 #define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE
471 #define GL_NUM_SAMPLE_COUNTS 0x9380
472 #define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9
473 #define GL_OBJECT_TYPE 0x9112
474 #define GL_ONE 1
475 #define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
476 #define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
477 #define GL_ONE_MINUS_DST_ALPHA 0x0305
478 #define GL_ONE_MINUS_DST_COLOR 0x0307
479 #define GL_ONE_MINUS_SRC_ALPHA 0x0303
480 #define GL_ONE_MINUS_SRC_COLOR 0x0301
481 #define GL_OUT_OF_MEMORY 0x0505
482 #define GL_PACK_ALIGNMENT 0x0D05
483 #define GL_PACK_ROW_LENGTH 0x0D02
484 #define GL_PACK_SKIP_PIXELS 0x0D04
485 #define GL_PACK_SKIP_ROWS 0x0D03
486 #define GL_PIXEL_PACK_BUFFER 0x88EB
487 #define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED
488 #define GL_PIXEL_UNPACK_BUFFER 0x88EC
489 #define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF
490 #define GL_POINTS 0x0000
491 #define GL_POLYGON_OFFSET_FACTOR 0x8038
492 #define GL_POLYGON_OFFSET_FILL 0x8037
493 #define GL_POLYGON_OFFSET_UNITS 0x2A00
494 #define GL_PRIMITIVE_RESTART_FIXED_INDEX 0x8D69
495 #define GL_PROGRAM_BINARY_FORMATS 0x87FF
496 #define GL_PROGRAM_BINARY_LENGTH 0x8741
497 #define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257
498 #define GL_QUERY_RESULT 0x8866
499 #define GL_QUERY_RESULT_AVAILABLE 0x8867
500 #define GL_R11F_G11F_B10F 0x8C3A
501 #define GL_R16F 0x822D
502 #define GL_R16I 0x8233
503 #define GL_R16UI 0x8234
504 #define GL_R32F 0x822E
505 #define GL_R32I 0x8235
506 #define GL_R32UI 0x8236
507 #define GL_R8 0x8229
508 #define GL_R8I 0x8231
509 #define GL_R8UI 0x8232
510 #define GL_R8_SNORM 0x8F94
511 #define GL_RASTERIZER_DISCARD 0x8C89
512 #define GL_READ_BUFFER 0x0C02
513 #define GL_READ_FRAMEBUFFER 0x8CA8
514 #define GL_READ_FRAMEBUFFER_BINDING 0x8CAA
515 #define GL_RED 0x1903
516 #define GL_RED_BITS 0x0D52
517 #define GL_RED_INTEGER 0x8D94
518 #define GL_RENDERBUFFER 0x8D41
519 #define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53
520 #define GL_RENDERBUFFER_BINDING 0x8CA7
521 #define GL_RENDERBUFFER_BLUE_SIZE 0x8D52
522 #define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54
523 #define GL_RENDERBUFFER_GREEN_SIZE 0x8D51
524 #define GL_RENDERBUFFER_HEIGHT 0x8D43
525 #define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44
526 #define GL_RENDERBUFFER_RED_SIZE 0x8D50
527 #define GL_RENDERBUFFER_SAMPLES 0x8CAB
528 #define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55
529 #define GL_RENDERBUFFER_WIDTH 0x8D42
530 #define GL_RENDERER 0x1F01
531 #define GL_REPEAT 0x2901
532 #define GL_REPLACE 0x1E01
533 #define GL_RG 0x8227
534 #define GL_RG16F 0x822F
535 #define GL_RG16I 0x8239
536 #define GL_RG16UI 0x823A
537 #define GL_RG32F 0x8230
538 #define GL_RG32I 0x823B
539 #define GL_RG32UI 0x823C
540 #define GL_RG8 0x822B
541 #define GL_RG8I 0x8237
542 #define GL_RG8UI 0x8238
543 #define GL_RG8_SNORM 0x8F95
544 #define GL_RGB 0x1907
545 #define GL_RGB10_A2 0x8059
546 #define GL_RGB10_A2UI 0x906F
547 #define GL_RGB16F 0x881B
548 #define GL_RGB16I 0x8D89
549 #define GL_RGB16UI 0x8D77
550 #define GL_RGB32F 0x8815
551 #define GL_RGB32I 0x8D83
552 #define GL_RGB32UI 0x8D71
553 #define GL_RGB565 0x8D62
554 #define GL_RGB5_A1 0x8057
555 #define GL_RGB8 0x8051
556 #define GL_RGB8I 0x8D8F
557 #define GL_RGB8UI 0x8D7D
558 #define GL_RGB8_SNORM 0x8F96
559 #define GL_RGB9_E5 0x8C3D
560 #define GL_RGBA 0x1908
561 #define GL_RGBA16F 0x881A
562 #define GL_RGBA16I 0x8D88
563 #define GL_RGBA16UI 0x8D76
564 #define GL_RGBA32F 0x8814
565 #define GL_RGBA32I 0x8D82
566 #define GL_RGBA32UI 0x8D70
567 #define GL_RGBA4 0x8056
568 #define GL_RGBA8 0x8058
569 #define GL_RGBA8I 0x8D8E
570 #define GL_RGBA8UI 0x8D7C
571 #define GL_RGBA8_SNORM 0x8F97
572 #define GL_RGBA_INTEGER 0x8D99
573 #define GL_RGB_INTEGER 0x8D98
574 #define GL_RG_INTEGER 0x8228
575 #define GL_SAMPLER_2D 0x8B5E
576 #define GL_SAMPLER_2D_ARRAY 0x8DC1
577 #define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4
578 #define GL_SAMPLER_2D_SHADOW 0x8B62
579 #define GL_SAMPLER_3D 0x8B5F
580 #define GL_SAMPLER_BINDING 0x8919
581 #define GL_SAMPLER_CUBE 0x8B60
582 #define GL_SAMPLER_CUBE_SHADOW 0x8DC5
583 #define GL_SAMPLES 0x80A9
584 #define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
585 #define GL_SAMPLE_BUFFERS 0x80A8
586 #define GL_SAMPLE_COVERAGE 0x80A0
587 #define GL_SAMPLE_COVERAGE_INVERT 0x80AB
588 #define GL_SAMPLE_COVERAGE_VALUE 0x80AA
589 #define GL_SCISSOR_BOX 0x0C10
590 #define GL_SCISSOR_TEST 0x0C11
591 #define GL_SEPARATE_ATTRIBS 0x8C8D
592 #define GL_SHADER_BINARY_FORMATS 0x8DF8
593 #define GL_SHADER_COMPILER 0x8DFA
594 #define GL_SHADER_SOURCE_LENGTH 0x8B88
595 #define GL_SHADER_TYPE 0x8B4F
596 #define GL_SHADING_LANGUAGE_VERSION 0x8B8C
597 #define GL_SHORT 0x1402
598 #define GL_SIGNALED 0x9119
599 #define GL_SIGNED_NORMALIZED 0x8F9C
600 #define GL_SRC_ALPHA 0x0302
601 #define GL_SRC_ALPHA_SATURATE 0x0308
602 #define GL_SRC_COLOR 0x0300
603 #define GL_SRGB 0x8C40
604 #define GL_SRGB8 0x8C41
605 #define GL_SRGB8_ALPHA8 0x8C43
606 #define GL_STATIC_COPY 0x88E6
607 #define GL_STATIC_DRAW 0x88E4
608 #define GL_STATIC_READ 0x88E5
609 #define GL_STENCIL 0x1802
610 #define GL_STENCIL_ATTACHMENT 0x8D20
611 #define GL_STENCIL_BACK_FAIL 0x8801
612 #define GL_STENCIL_BACK_FUNC 0x8800
613 #define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802
614 #define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803
615 #define GL_STENCIL_BACK_REF 0x8CA3
616 #define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
617 #define GL_STENCIL_BACK_WRITEMASK 0x8CA5
618 #define GL_STENCIL_BITS 0x0D57
619 #define GL_STENCIL_BUFFER_BIT 0x00000400
620 #define GL_STENCIL_CLEAR_VALUE 0x0B91
621 #define GL_STENCIL_FAIL 0x0B94
622 #define GL_STENCIL_FUNC 0x0B92
623 #define GL_STENCIL_INDEX8 0x8D48
624 #define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
625 #define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
626 #define GL_STENCIL_REF 0x0B97
627 #define GL_STENCIL_TEST 0x0B90
628 #define GL_STENCIL_VALUE_MASK 0x0B93
629 #define GL_STENCIL_WRITEMASK 0x0B98
630 #define GL_STREAM_COPY 0x88E2
631 #define GL_STREAM_DRAW 0x88E0
632 #define GL_STREAM_READ 0x88E1
633 #define GL_SUBPIXEL_BITS 0x0D50
634 #define GL_SYNC_CONDITION 0x9113
635 #define GL_SYNC_FENCE 0x9116
636 #define GL_SYNC_FLAGS 0x9115
637 #define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001
638 #define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117
639 #define GL_SYNC_STATUS 0x9114
640 #define GL_TEXTURE 0x1702
641 #define GL_TEXTURE0 0x84C0
642 #define GL_TEXTURE1 0x84C1
643 #define GL_TEXTURE10 0x84CA
644 #define GL_TEXTURE11 0x84CB
645 #define GL_TEXTURE12 0x84CC
646 #define GL_TEXTURE13 0x84CD
647 #define GL_TEXTURE14 0x84CE
648 #define GL_TEXTURE15 0x84CF
649 #define GL_TEXTURE16 0x84D0
650 #define GL_TEXTURE17 0x84D1
651 #define GL_TEXTURE18 0x84D2
652 #define GL_TEXTURE19 0x84D3
653 #define GL_TEXTURE2 0x84C2
654 #define GL_TEXTURE20 0x84D4
655 #define GL_TEXTURE21 0x84D5
656 #define GL_TEXTURE22 0x84D6
657 #define GL_TEXTURE23 0x84D7
658 #define GL_TEXTURE24 0x84D8
659 #define GL_TEXTURE25 0x84D9
660 #define GL_TEXTURE26 0x84DA
661 #define GL_TEXTURE27 0x84DB
662 #define GL_TEXTURE28 0x84DC
663 #define GL_TEXTURE29 0x84DD
664 #define GL_TEXTURE3 0x84C3
665 #define GL_TEXTURE30 0x84DE
666 #define GL_TEXTURE31 0x84DF
667 #define GL_TEXTURE4 0x84C4
668 #define GL_TEXTURE5 0x84C5
669 #define GL_TEXTURE6 0x84C6
670 #define GL_TEXTURE7 0x84C7
671 #define GL_TEXTURE8 0x84C8
672 #define GL_TEXTURE9 0x84C9
673 #define GL_TEXTURE_2D 0x0DE1
674 #define GL_TEXTURE_2D_ARRAY 0x8C1A
675 #define GL_TEXTURE_3D 0x806F
676 #define GL_TEXTURE_BASE_LEVEL 0x813C
677 #define GL_TEXTURE_BINDING_2D 0x8069
678 #define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D
679 #define GL_TEXTURE_BINDING_3D 0x806A
680 #define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
681 #define GL_TEXTURE_COMPARE_FUNC 0x884D
682 #define GL_TEXTURE_COMPARE_MODE 0x884C
683 #define GL_TEXTURE_CUBE_MAP 0x8513
684 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
685 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
686 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
687 #define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
688 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
689 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
690 #define GL_TEXTURE_IMMUTABLE_FORMAT 0x912F
691 #define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF
692 #define GL_TEXTURE_MAG_FILTER 0x2800
693 #define GL_TEXTURE_MAX_LEVEL 0x813D
694 #define GL_TEXTURE_MAX_LOD 0x813B
695 #define GL_TEXTURE_MIN_FILTER 0x2801
696 #define GL_TEXTURE_MIN_LOD 0x813A
697 #define GL_TEXTURE_SWIZZLE_A 0x8E45
698 #define GL_TEXTURE_SWIZZLE_B 0x8E44
699 #define GL_TEXTURE_SWIZZLE_G 0x8E43
700 #define GL_TEXTURE_SWIZZLE_R 0x8E42
701 #define GL_TEXTURE_WRAP_R 0x8072
702 #define GL_TEXTURE_WRAP_S 0x2802
703 #define GL_TEXTURE_WRAP_T 0x2803
704 #define GL_TIMEOUT_EXPIRED 0x911B
705 #define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFF
706 #define GL_TRANSFORM_FEEDBACK 0x8E22
707 #define GL_TRANSFORM_FEEDBACK_ACTIVE 0x8E24
708 #define GL_TRANSFORM_FEEDBACK_BINDING 0x8E25
709 #define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E
710 #define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE 0x8E24
711 #define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F
712 #define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F
713 #define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED 0x8E23
714 #define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85
715 #define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84
716 #define GL_TRANSFORM_FEEDBACK_PAUSED 0x8E23
717 #define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88
718 #define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83
719 #define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76
720 #define GL_TRIANGLES 0x0004
721 #define GL_TRIANGLE_FAN 0x0006
722 #define GL_TRIANGLE_STRIP 0x0005
723 #define GL_TRUE 1
724 #define GL_UNIFORM_ARRAY_STRIDE 0x8A3C
725 #define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42
726 #define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43
727 #define GL_UNIFORM_BLOCK_BINDING 0x8A3F
728 #define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40
729 #define GL_UNIFORM_BLOCK_INDEX 0x8A3A
730 #define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41
731 #define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46
732 #define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44
733 #define GL_UNIFORM_BUFFER 0x8A11
734 #define GL_UNIFORM_BUFFER_BINDING 0x8A28
735 #define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34
736 #define GL_UNIFORM_BUFFER_SIZE 0x8A2A
737 #define GL_UNIFORM_BUFFER_START 0x8A29
738 #define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E
739 #define GL_UNIFORM_MATRIX_STRIDE 0x8A3D
740 #define GL_UNIFORM_NAME_LENGTH 0x8A39
741 #define GL_UNIFORM_OFFSET 0x8A3B
742 #define GL_UNIFORM_SIZE 0x8A38
743 #define GL_UNIFORM_TYPE 0x8A37
744 #define GL_UNPACK_ALIGNMENT 0x0CF5
745 #define GL_UNPACK_IMAGE_HEIGHT 0x806E
746 #define GL_UNPACK_ROW_LENGTH 0x0CF2
747 #define GL_UNPACK_SKIP_IMAGES 0x806D
748 #define GL_UNPACK_SKIP_PIXELS 0x0CF4
749 #define GL_UNPACK_SKIP_ROWS 0x0CF3
750 #define GL_UNSIGNALED 0x9118
751 #define GL_UNSIGNED_BYTE 0x1401
752 #define GL_UNSIGNED_INT 0x1405
753 #define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B
754 #define GL_UNSIGNED_INT_24_8 0x84FA
755 #define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
756 #define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E
757 #define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2
758 #define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7
759 #define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3
760 #define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4
761 #define GL_UNSIGNED_INT_VEC2 0x8DC6
762 #define GL_UNSIGNED_INT_VEC3 0x8DC7
763 #define GL_UNSIGNED_INT_VEC4 0x8DC8
764 #define GL_UNSIGNED_NORMALIZED 0x8C17
765 #define GL_UNSIGNED_SHORT 0x1403
766 #define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
767 #define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
768 #define GL_UNSIGNED_SHORT_5_6_5 0x8363
769 #define GL_VALIDATE_STATUS 0x8B83
770 #define GL_VENDOR 0x1F00
771 #define GL_VERSION 0x1F02
772 #define GL_VERTEX_ARRAY_BINDING 0x85B5
773 #define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
774 #define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE
775 #define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
776 #define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD
777 #define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
778 #define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
779 #define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
780 #define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
781 #define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
782 #define GL_VERTEX_SHADER 0x8B31
783 #define GL_VIEWPORT 0x0BA2
784 #define GL_WAIT_FAILED 0x911D
785 #define GL_ZERO 0
786
787
788 #include <stddef.h>
789 #ifndef __khrplatform_h_
790 #define __khrplatform_h_
791
792 /*
793 ** Copyright (c) 2008-2018 The Khronos Group Inc.
794 **
795 ** Permission is hereby granted, free of charge, to any person obtaining a
796 ** copy of this software and/or associated documentation files (the
797 ** "Materials"), to deal in the Materials without restriction, including
798 ** without limitation the rights to use, copy, modify, merge, publish,
799 ** distribute, sublicense, and/or sell copies of the Materials, and to
800 ** permit persons to whom the Materials are furnished to do so, subject to
801 ** the following conditions:
802 **
803 ** The above copyright notice and this permission notice shall be included
804 ** in all copies or substantial portions of the Materials.
805 **
806 ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
807 ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
808 ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
809 ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
810 ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
811 ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
812 ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
813 */
814
815 /* Khronos platform-specific types and definitions.
816 *
817 * The master copy of khrplatform.h is maintained in the Khronos EGL
818 * Registry repository at https://github.com/KhronosGroup/EGL-Registry
819 * The last semantic modification to khrplatform.h was at commit ID:
820 * 67a3e0864c2d75ea5287b9f3d2eb74a745936692
821 *
822 * Adopters may modify this file to suit their platform. Adopters are
823 * encouraged to submit platform specific modifications to the Khronos
824 * group so that they can be included in future versions of this file.
825 * Please submit changes by filing pull requests or issues on
826 * the EGL Registry repository linked above.
827 *
828 *
829 * See the Implementer's Guidelines for information about where this file
830 * should be located on your system and for more details of its use:
831 * http://www.khronos.org/registry/implementers_guide.pdf
832 *
833 * This file should be included as
834 * #include <KHR/khrplatform.h>
835 * by Khronos client API header files that use its types and defines.
836 *
837 * The types in khrplatform.h should only be used to define API-specific types.
838 *
839 * Types defined in khrplatform.h:
840 * khronos_int8_t signed 8 bit
841 * khronos_uint8_t unsigned 8 bit
842 * khronos_int16_t signed 16 bit
843 * khronos_uint16_t unsigned 16 bit
844 * khronos_int32_t signed 32 bit
845 * khronos_uint32_t unsigned 32 bit
846 * khronos_int64_t signed 64 bit
847 * khronos_uint64_t unsigned 64 bit
848 * khronos_intptr_t signed same number of bits as a pointer
849 * khronos_uintptr_t unsigned same number of bits as a pointer
850 * khronos_ssize_t signed size
851 * khronos_usize_t unsigned size
852 * khronos_float_t signed 32 bit floating point
853 * khronos_time_ns_t unsigned 64 bit time in nanoseconds
854 * khronos_utime_nanoseconds_t unsigned time interval or absolute time in
855 * nanoseconds
856 * khronos_stime_nanoseconds_t signed time interval in nanoseconds
857 * khronos_boolean_enum_t enumerated boolean type. This should
858 * only be used as a base type when a client API's boolean type is
859 * an enum. Client APIs which use an integer or other type for
860 * booleans cannot use this as the base type for their boolean.
861 *
862 * Tokens defined in khrplatform.h:
863 *
864 * KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values.
865 *
866 * KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0.
867 * KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0.
868 *
869 * Calling convention macros defined in this file:
870 * KHRONOS_APICALL
871 * KHRONOS_GLAD_API_PTR
872 * KHRONOS_APIATTRIBUTES
873 *
874 * These may be used in function prototypes as:
875 *
876 * KHRONOS_APICALL void KHRONOS_GLAD_API_PTR funcname(
877 * int arg1,
878 * int arg2) KHRONOS_APIATTRIBUTES;
879 */
880
881 /*-------------------------------------------------------------------------
882 * Definition of KHRONOS_APICALL
883 *-------------------------------------------------------------------------
884 * This precedes the return type of the function in the function prototype.
885 */
886 #if defined(_WIN32) && !defined(__SCITECH_SNAP__)
887 # define KHRONOS_APICALL __declspec(dllimport)
888 #elif defined (__SYMBIAN32__)
889 # define KHRONOS_APICALL IMPORT_C
890 #elif defined(__ANDROID__)
891 # define KHRONOS_APICALL __attribute__((visibility("default")))
892 #else
893 # define KHRONOS_APICALL
894 #endif
895
896 /*-------------------------------------------------------------------------
897 * Definition of KHRONOS_GLAD_API_PTR
898 *-------------------------------------------------------------------------
899 * This follows the return type of the function and precedes the function
900 * name in the function prototype.
901 */
902 #if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__)
903 /* Win32 but not WinCE */
904 # define KHRONOS_GLAD_API_PTR __stdcall
905 #else
906 # define KHRONOS_GLAD_API_PTR
907 #endif
908
909 /*-------------------------------------------------------------------------
910 * Definition of KHRONOS_APIATTRIBUTES
911 *-------------------------------------------------------------------------
912 * This follows the closing parenthesis of the function prototype arguments.
913 */
914 #if defined (__ARMCC_2__)
915 #define KHRONOS_APIATTRIBUTES __softfp
916 #else
917 #define KHRONOS_APIATTRIBUTES
918 #endif
919
920 /*-------------------------------------------------------------------------
921 * basic type definitions
922 *-----------------------------------------------------------------------*/
923 #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__)
924
925
926 /*
927 * Using <stdint.h>
928 */
929 #include <stdint.h>
930 typedef int32_t khronos_int32_t;
931 typedef uint32_t khronos_uint32_t;
932 typedef int64_t khronos_int64_t;
933 typedef uint64_t khronos_uint64_t;
934 #define KHRONOS_SUPPORT_INT64 1
935 #define KHRONOS_SUPPORT_FLOAT 1
936
937 #elif defined(__VMS ) || defined(__sgi)
938
939 /*
940 * Using <inttypes.h>
941 */
942 #include <inttypes.h>
943 typedef int32_t khronos_int32_t;
944 typedef uint32_t khronos_uint32_t;
945 typedef int64_t khronos_int64_t;
946 typedef uint64_t khronos_uint64_t;
947 #define KHRONOS_SUPPORT_INT64 1
948 #define KHRONOS_SUPPORT_FLOAT 1
949
950 #elif defined(_WIN32) && !defined(__SCITECH_SNAP__)
951
952 /*
953 * Win32
954 */
955 typedef __int32 khronos_int32_t;
956 typedef unsigned __int32 khronos_uint32_t;
957 typedef __int64 khronos_int64_t;
958 typedef unsigned __int64 khronos_uint64_t;
959 #define KHRONOS_SUPPORT_INT64 1
960 #define KHRONOS_SUPPORT_FLOAT 1
961
962 #elif defined(__sun__) || defined(__digital__)
963
964 /*
965 * Sun or Digital
966 */
967 typedef int khronos_int32_t;
968 typedef unsigned int khronos_uint32_t;
969 #if defined(__arch64__) || defined(_LP64)
970 typedef long int khronos_int64_t;
971 typedef unsigned long int khronos_uint64_t;
972 #else
973 typedef long long int khronos_int64_t;
974 typedef unsigned long long int khronos_uint64_t;
975 #endif /* __arch64__ */
976 #define KHRONOS_SUPPORT_INT64 1
977 #define KHRONOS_SUPPORT_FLOAT 1
978
979 #elif 0
980
981 /*
982 * Hypothetical platform with no float or int64 support
983 */
984 typedef int khronos_int32_t;
985 typedef unsigned int khronos_uint32_t;
986 #define KHRONOS_SUPPORT_INT64 0
987 #define KHRONOS_SUPPORT_FLOAT 0
988
989 #else
990
991 /*
992 * Generic fallback
993 */
994 #include <stdint.h>
995 typedef int32_t khronos_int32_t;
996 typedef uint32_t khronos_uint32_t;
997 typedef int64_t khronos_int64_t;
998 typedef uint64_t khronos_uint64_t;
999 #define KHRONOS_SUPPORT_INT64 1
1000 #define KHRONOS_SUPPORT_FLOAT 1
1001
1002 #endif
1003
1004
1005 /*
1006 * Types that are (so far) the same on all platforms
1007 */
1008 typedef signed char khronos_int8_t;
1009 typedef unsigned char khronos_uint8_t;
1010 typedef signed short int khronos_int16_t;
1011 typedef unsigned short int khronos_uint16_t;
1012
1013 /*
1014 * Types that differ between LLP64 and LP64 architectures - in LLP64,
1015 * pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
1016 * to be the only LLP64 architecture in current use.
1017 */
1018 #ifdef _WIN64
1019 typedef signed long long int khronos_intptr_t;
1020 typedef unsigned long long int khronos_uintptr_t;
1021 typedef signed long long int khronos_ssize_t;
1022 typedef unsigned long long int khronos_usize_t;
1023 #else
1024 typedef signed long int khronos_intptr_t;
1025 typedef unsigned long int khronos_uintptr_t;
1026 typedef signed long int khronos_ssize_t;
1027 typedef unsigned long int khronos_usize_t;
1028 #endif
1029
1030 #if KHRONOS_SUPPORT_FLOAT
1031 /*
1032 * Float type
1033 */
1034 typedef float khronos_float_t;
1035 #endif
1036
1037 #if KHRONOS_SUPPORT_INT64
1038 /* Time types
1039 *
1040 * These types can be used to represent a time interval in nanoseconds or
1041 * an absolute Unadjusted System Time. Unadjusted System Time is the number
1042 * of nanoseconds since some arbitrary system event (e.g. since the last
1043 * time the system booted). The Unadjusted System Time is an unsigned
1044 * 64 bit value that wraps back to 0 every 584 years. Time intervals
1045 * may be either signed or unsigned.
1046 */
1047 typedef khronos_uint64_t khronos_utime_nanoseconds_t;
1048 typedef khronos_int64_t khronos_stime_nanoseconds_t;
1049 #endif
1050
1051 /*
1052 * Dummy value used to pad enum types to 32 bits.
1053 */
1054 #ifndef KHRONOS_MAX_ENUM
1055 #define KHRONOS_MAX_ENUM 0x7FFFFFFF
1056 #endif
1057
1058 /*
1059 * Enumerated boolean type
1060 *
1061 * Values other than zero should be considered to be true. Therefore
1062 * comparisons should not be made against KHRONOS_TRUE.
1063 */
1064 typedef enum {
1065 KHRONOS_FALSE = 0,
1066 KHRONOS_TRUE = 1,
1067 KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM
1068 } khronos_boolean_enum_t;
1069
1070 #endif /* __khrplatform_h_ */
1071 typedef unsigned int GLenum;
1072 typedef unsigned char GLboolean;
1073 typedef unsigned int GLbitfield;
1074 typedef void GLvoid;
1075 typedef khronos_int8_t GLbyte;
1076 typedef short GLshort;
1077 typedef int GLint;
1078 typedef int GLclampx;
1079 typedef khronos_uint8_t GLubyte;
1080 typedef unsigned short GLushort;
1081 typedef unsigned int GLuint;
1082 typedef int GLsizei;
1083 typedef khronos_float_t GLfloat;
1084 typedef khronos_float_t GLclampf;
1085 typedef double GLdouble;
1086 typedef double GLclampd;
1087 typedef void *GLeglClientBufferEXT;
1088 typedef void *GLeglImageOES;
1089 typedef char GLchar;
1090 typedef char GLcharARB;
1091 #ifdef __APPLE__
1092 typedef void *GLhandleARB;
1093 #else
1094 typedef unsigned int GLhandleARB;
1095 #endif
1096 typedef unsigned short GLhalfARB;
1097 typedef unsigned short GLhalf;
1098 typedef khronos_int32_t GLfixed;
1099 #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
1100 typedef khronos_intptr_t GLintptr;
1101 #else
1102 typedef khronos_intptr_t GLintptr;
1103 #endif
1104 #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
1105 typedef khronos_ssize_t GLsizeiptr;
1106 #else
1107 typedef khronos_ssize_t GLsizeiptr;
1108 #endif
1109 typedef khronos_int64_t GLint64;
1110 typedef khronos_uint64_t GLuint64;
1111 #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
1112 typedef long GLintptrARB;
1113 #else
1114 typedef ptrdiff_t GLintptrARB;
1115 #endif
1116 #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
1117 typedef long GLsizeiptrARB;
1118 #else
1119 typedef ptrdiff_t GLsizeiptrARB;
1120 #endif
1121 typedef khronos_int64_t GLint64EXT;
1122 typedef khronos_uint64_t GLuint64EXT;
1123 typedef struct __GLsync *GLsync;
1124 struct _cl_context;
1125 struct _cl_event;
1126 typedef void ( *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
1127 typedef void ( *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
1128 typedef void ( *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
1129 typedef void ( *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,void *userParam);
1130 typedef unsigned short GLhalfNV;
1131 typedef GLintptr GLvdpauSurfaceNV;
1132 typedef void ( *GLVULKANPROCNV)(void);
1133
1134
1135 #define GL_ES_VERSION_2_0 1
1136 GLAD_API_CALL int GLAD_GL_ES_VERSION_2_0;
1137 #define GL_ES_VERSION_3_0 1
1138 GLAD_API_CALL int GLAD_GL_ES_VERSION_3_0;
1139
1140
1141 typedef void (GLAD_API_PTR *PFNGLACTIVETEXTUREPROC)(GLenum texture);
1142 typedef void (GLAD_API_PTR *PFNGLATTACHSHADERPROC)(GLuint program, GLuint shader);
1143 typedef void (GLAD_API_PTR *PFNGLBEGINQUERYPROC)(GLenum target, GLuint id);
1144 typedef void (GLAD_API_PTR *PFNGLBEGINTRANSFORMFEEDBACKPROC)(GLenum primitiveMode);
1145 typedef void (GLAD_API_PTR *PFNGLBINDATTRIBLOCATIONPROC)(GLuint program, GLuint index, const GLchar * name);
1146 typedef void (GLAD_API_PTR *PFNGLBINDBUFFERPROC)(GLenum target, GLuint buffer);
1147 typedef void (GLAD_API_PTR *PFNGLBINDBUFFERBASEPROC)(GLenum target, GLuint index, GLuint buffer);
1148 typedef void (GLAD_API_PTR *PFNGLBINDBUFFERRANGEPROC)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
1149 typedef void (GLAD_API_PTR *PFNGLBINDFRAMEBUFFERPROC)(GLenum target, GLuint framebuffer);
1150 typedef void (GLAD_API_PTR *PFNGLBINDRENDERBUFFERPROC)(GLenum target, GLuint renderbuffer);
1151 typedef void (GLAD_API_PTR *PFNGLBINDSAMPLERPROC)(GLuint unit, GLuint sampler);
1152 typedef void (GLAD_API_PTR *PFNGLBINDTEXTUREPROC)(GLenum target, GLuint texture);
1153 typedef void (GLAD_API_PTR *PFNGLBINDTRANSFORMFEEDBACKPROC)(GLenum target, GLuint id);
1154 typedef void (GLAD_API_PTR *PFNGLBINDVERTEXARRAYPROC)(GLuint array);
1155 typedef void (GLAD_API_PTR *PFNGLBLENDCOLORPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
1156 typedef void (GLAD_API_PTR *PFNGLBLENDEQUATIONPROC)(GLenum mode);
1157 typedef void (GLAD_API_PTR *PFNGLBLENDEQUATIONSEPARATEPROC)(GLenum modeRGB, GLenum modeAlpha);
1158 typedef void (GLAD_API_PTR *PFNGLBLENDFUNCPROC)(GLenum sfactor, GLenum dfactor);
1159 typedef void (GLAD_API_PTR *PFNGLBLENDFUNCSEPARATEPROC)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
1160 typedef void (GLAD_API_PTR *PFNGLBLITFRAMEBUFFERPROC)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
1161 typedef void (GLAD_API_PTR *PFNGLBUFFERDATAPROC)(GLenum target, GLsizeiptr size, const void * data, GLenum usage);
1162 typedef void (GLAD_API_PTR *PFNGLBUFFERSUBDATAPROC)(GLenum target, GLintptr offset, GLsizeiptr size, const void * data);
1163 typedef GLenum (GLAD_API_PTR *PFNGLCHECKFRAMEBUFFERSTATUSPROC)(GLenum target);
1164 typedef void (GLAD_API_PTR *PFNGLCLEARPROC)(GLbitfield mask);
1165 typedef void (GLAD_API_PTR *PFNGLCLEARBUFFERFIPROC)(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
1166 typedef void (GLAD_API_PTR *PFNGLCLEARBUFFERFVPROC)(GLenum buffer, GLint drawbuffer, const GLfloat * value);
1167 typedef void (GLAD_API_PTR *PFNGLCLEARBUFFERIVPROC)(GLenum buffer, GLint drawbuffer, const GLint * value);
1168 typedef void (GLAD_API_PTR *PFNGLCLEARBUFFERUIVPROC)(GLenum buffer, GLint drawbuffer, const GLuint * value);
1169 typedef void (GLAD_API_PTR *PFNGLCLEARCOLORPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
1170 typedef void (GLAD_API_PTR *PFNGLCLEARDEPTHFPROC)(GLfloat d);
1171 typedef void (GLAD_API_PTR *PFNGLCLEARSTENCILPROC)(GLint s);
1172 typedef GLenum (GLAD_API_PTR *PFNGLCLIENTWAITSYNCPROC)(GLsync sync, GLbitfield flags, GLuint64 timeout);
1173 typedef void (GLAD_API_PTR *PFNGLCOLORMASKPROC)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
1174 typedef void (GLAD_API_PTR *PFNGLCOMPILESHADERPROC)(GLuint shader);
1175 typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXIMAGE2DPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void * data);
1176 typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXIMAGE3DPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void * data);
1177 typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void * data);
1178 typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void * data);
1179 typedef void (GLAD_API_PTR *PFNGLCOPYBUFFERSUBDATAPROC)(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
1180 typedef void (GLAD_API_PTR *PFNGLCOPYTEXIMAGE2DPROC)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
1181 typedef void (GLAD_API_PTR *PFNGLCOPYTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
1182 typedef void (GLAD_API_PTR *PFNGLCOPYTEXSUBIMAGE3DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
1183 typedef GLuint (GLAD_API_PTR *PFNGLCREATEPROGRAMPROC)(void);
1184 typedef GLuint (GLAD_API_PTR *PFNGLCREATESHADERPROC)(GLenum type);
1185 typedef void (GLAD_API_PTR *PFNGLCULLFACEPROC)(GLenum mode);
1186 typedef void (GLAD_API_PTR *PFNGLDELETEBUFFERSPROC)(GLsizei n, const GLuint * buffers);
1187 typedef void (GLAD_API_PTR *PFNGLDELETEFRAMEBUFFERSPROC)(GLsizei n, const GLuint * framebuffers);
1188 typedef void (GLAD_API_PTR *PFNGLDELETEPROGRAMPROC)(GLuint program);
1189 typedef void (GLAD_API_PTR *PFNGLDELETEQUERIESPROC)(GLsizei n, const GLuint * ids);
1190 typedef void (GLAD_API_PTR *PFNGLDELETERENDERBUFFERSPROC)(GLsizei n, const GLuint * renderbuffers);
1191 typedef void (GLAD_API_PTR *PFNGLDELETESAMPLERSPROC)(GLsizei count, const GLuint * samplers);
1192 typedef void (GLAD_API_PTR *PFNGLDELETESHADERPROC)(GLuint shader);
1193 typedef void (GLAD_API_PTR *PFNGLDELETESYNCPROC)(GLsync sync);
1194 typedef void (GLAD_API_PTR *PFNGLDELETETEXTURESPROC)(GLsizei n, const GLuint * textures);
1195 typedef void (GLAD_API_PTR *PFNGLDELETETRANSFORMFEEDBACKSPROC)(GLsizei n, const GLuint * ids);
1196 typedef void (GLAD_API_PTR *PFNGLDELETEVERTEXARRAYSPROC)(GLsizei n, const GLuint * arrays);
1197 typedef void (GLAD_API_PTR *PFNGLDEPTHFUNCPROC)(GLenum func);
1198 typedef void (GLAD_API_PTR *PFNGLDEPTHMASKPROC)(GLboolean flag);
1199 typedef void (GLAD_API_PTR *PFNGLDEPTHRANGEFPROC)(GLfloat n, GLfloat f);
1200 typedef void (GLAD_API_PTR *PFNGLDETACHSHADERPROC)(GLuint program, GLuint shader);
1201 typedef void (GLAD_API_PTR *PFNGLDISABLEPROC)(GLenum cap);
1202 typedef void (GLAD_API_PTR *PFNGLDISABLEVERTEXATTRIBARRAYPROC)(GLuint index);
1203 typedef void (GLAD_API_PTR *PFNGLDRAWARRAYSPROC)(GLenum mode, GLint first, GLsizei count);
1204 typedef void (GLAD_API_PTR *PFNGLDRAWARRAYSINSTANCEDPROC)(GLenum mode, GLint first, GLsizei count, GLsizei instancecount);
1205 typedef void (GLAD_API_PTR *PFNGLDRAWBUFFERSPROC)(GLsizei n, const GLenum * bufs);
1206 typedef void (GLAD_API_PTR *PFNGLDRAWELEMENTSPROC)(GLenum mode, GLsizei count, GLenum type, const void * indices);
1207 typedef void (GLAD_API_PTR *PFNGLDRAWELEMENTSINSTANCEDPROC)(GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei instancecount);
1208 typedef void (GLAD_API_PTR *PFNGLDRAWRANGEELEMENTSPROC)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void * indices);
1209 typedef void (GLAD_API_PTR *PFNGLENABLEPROC)(GLenum cap);
1210 typedef void (GLAD_API_PTR *PFNGLENABLEVERTEXATTRIBARRAYPROC)(GLuint index);
1211 typedef void (GLAD_API_PTR *PFNGLENDQUERYPROC)(GLenum target);
1212 typedef void (GLAD_API_PTR *PFNGLENDTRANSFORMFEEDBACKPROC)(void);
1213 typedef GLsync (GLAD_API_PTR *PFNGLFENCESYNCPROC)(GLenum condition, GLbitfield flags);
1214 typedef void (GLAD_API_PTR *PFNGLFINISHPROC)(void);
1215 typedef void (GLAD_API_PTR *PFNGLFLUSHPROC)(void);
1216 typedef void (GLAD_API_PTR *PFNGLFLUSHMAPPEDBUFFERRANGEPROC)(GLenum target, GLintptr offset, GLsizeiptr length);
1217 typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERRENDERBUFFERPROC)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
1218 typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERTEXTURE2DPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
1219 typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERTEXTURELAYERPROC)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
1220 typedef void (GLAD_API_PTR *PFNGLFRONTFACEPROC)(GLenum mode);
1221 typedef void (GLAD_API_PTR *PFNGLGENBUFFERSPROC)(GLsizei n, GLuint * buffers);
1222 typedef void (GLAD_API_PTR *PFNGLGENFRAMEBUFFERSPROC)(GLsizei n, GLuint * framebuffers);
1223 typedef void (GLAD_API_PTR *PFNGLGENQUERIESPROC)(GLsizei n, GLuint * ids);
1224 typedef void (GLAD_API_PTR *PFNGLGENRENDERBUFFERSPROC)(GLsizei n, GLuint * renderbuffers);
1225 typedef void (GLAD_API_PTR *PFNGLGENSAMPLERSPROC)(GLsizei count, GLuint * samplers);
1226 typedef void (GLAD_API_PTR *PFNGLGENTEXTURESPROC)(GLsizei n, GLuint * textures);
1227 typedef void (GLAD_API_PTR *PFNGLGENTRANSFORMFEEDBACKSPROC)(GLsizei n, GLuint * ids);
1228 typedef void (GLAD_API_PTR *PFNGLGENVERTEXARRAYSPROC)(GLsizei n, GLuint * arrays);
1229 typedef void (GLAD_API_PTR *PFNGLGENERATEMIPMAPPROC)(GLenum target);
1230 typedef void (GLAD_API_PTR *PFNGLGETACTIVEATTRIBPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name);
1231 typedef void (GLAD_API_PTR *PFNGLGETACTIVEUNIFORMPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name);
1232 typedef void (GLAD_API_PTR *PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei * length, GLchar * uniformBlockName);
1233 typedef void (GLAD_API_PTR *PFNGLGETACTIVEUNIFORMBLOCKIVPROC)(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint * params);
1234 typedef void (GLAD_API_PTR *PFNGLGETACTIVEUNIFORMSIVPROC)(GLuint program, GLsizei uniformCount, const GLuint * uniformIndices, GLenum pname, GLint * params);
1235 typedef void (GLAD_API_PTR *PFNGLGETATTACHEDSHADERSPROC)(GLuint program, GLsizei maxCount, GLsizei * count, GLuint * shaders);
1236 typedef GLint (GLAD_API_PTR *PFNGLGETATTRIBLOCATIONPROC)(GLuint program, const GLchar * name);
1237 typedef void (GLAD_API_PTR *PFNGLGETBOOLEANVPROC)(GLenum pname, GLboolean * data);
1238 typedef void (GLAD_API_PTR *PFNGLGETBUFFERPARAMETERI64VPROC)(GLenum target, GLenum pname, GLint64 * params);
1239 typedef void (GLAD_API_PTR *PFNGLGETBUFFERPARAMETERIVPROC)(GLenum target, GLenum pname, GLint * params);
1240 typedef void (GLAD_API_PTR *PFNGLGETBUFFERPOINTERVPROC)(GLenum target, GLenum pname, void ** params);
1241 typedef GLenum (GLAD_API_PTR *PFNGLGETERRORPROC)(void);
1242 typedef void (GLAD_API_PTR *PFNGLGETFLOATVPROC)(GLenum pname, GLfloat * data);
1243 typedef GLint (GLAD_API_PTR *PFNGLGETFRAGDATALOCATIONPROC)(GLuint program, const GLchar * name);
1244 typedef void (GLAD_API_PTR *PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)(GLenum target, GLenum attachment, GLenum pname, GLint * params);
1245 typedef void (GLAD_API_PTR *PFNGLGETINTEGER64I_VPROC)(GLenum target, GLuint index, GLint64 * data);
1246 typedef void (GLAD_API_PTR *PFNGLGETINTEGER64VPROC)(GLenum pname, GLint64 * data);
1247 typedef void (GLAD_API_PTR *PFNGLGETINTEGERI_VPROC)(GLenum target, GLuint index, GLint * data);
1248 typedef void (GLAD_API_PTR *PFNGLGETINTEGERVPROC)(GLenum pname, GLint * data);
1249 typedef void (GLAD_API_PTR *PFNGLGETINTERNALFORMATIVPROC)(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint * params);
1250 typedef void (GLAD_API_PTR *PFNGLGETPROGRAMBINARYPROC)(GLuint program, GLsizei bufSize, GLsizei * length, GLenum * binaryFormat, void * binary);
1251 typedef void (GLAD_API_PTR *PFNGLGETPROGRAMINFOLOGPROC)(GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog);
1252 typedef void (GLAD_API_PTR *PFNGLGETPROGRAMIVPROC)(GLuint program, GLenum pname, GLint * params);
1253 typedef void (GLAD_API_PTR *PFNGLGETQUERYOBJECTUIVPROC)(GLuint id, GLenum pname, GLuint * params);
1254 typedef void (GLAD_API_PTR *PFNGLGETQUERYIVPROC)(GLenum target, GLenum pname, GLint * params);
1255 typedef void (GLAD_API_PTR *PFNGLGETRENDERBUFFERPARAMETERIVPROC)(GLenum target, GLenum pname, GLint * params);
1256 typedef void (GLAD_API_PTR *PFNGLGETSAMPLERPARAMETERFVPROC)(GLuint sampler, GLenum pname, GLfloat * params);
1257 typedef void (GLAD_API_PTR *PFNGLGETSAMPLERPARAMETERIVPROC)(GLuint sampler, GLenum pname, GLint * params);
1258 typedef void (GLAD_API_PTR *PFNGLGETSHADERINFOLOGPROC)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog);
1259 typedef void (GLAD_API_PTR *PFNGLGETSHADERPRECISIONFORMATPROC)(GLenum shadertype, GLenum precisiontype, GLint * range, GLint * precision);
1260 typedef void (GLAD_API_PTR *PFNGLGETSHADERSOURCEPROC)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * source);
1261 typedef void (GLAD_API_PTR *PFNGLGETSHADERIVPROC)(GLuint shader, GLenum pname, GLint * params);
1262 typedef const GLubyte * (GLAD_API_PTR *PFNGLGETSTRINGPROC)(GLenum name);
1263 typedef const GLubyte * (GLAD_API_PTR *PFNGLGETSTRINGIPROC)(GLenum name, GLuint index);
1264 typedef void (GLAD_API_PTR *PFNGLGETSYNCIVPROC)(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * values);
1265 typedef void (GLAD_API_PTR *PFNGLGETTEXPARAMETERFVPROC)(GLenum target, GLenum pname, GLfloat * params);
1266 typedef void (GLAD_API_PTR *PFNGLGETTEXPARAMETERIVPROC)(GLenum target, GLenum pname, GLint * params);
1267 typedef void (GLAD_API_PTR *PFNGLGETTRANSFORMFEEDBACKVARYINGPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, GLchar * name);
1268 typedef GLuint (GLAD_API_PTR *PFNGLGETUNIFORMBLOCKINDEXPROC)(GLuint program, const GLchar * uniformBlockName);
1269 typedef void (GLAD_API_PTR *PFNGLGETUNIFORMINDICESPROC)(GLuint program, GLsizei uniformCount, const GLchar *const* uniformNames, GLuint * uniformIndices);
1270 typedef GLint (GLAD_API_PTR *PFNGLGETUNIFORMLOCATIONPROC)(GLuint program, const GLchar * name);
1271 typedef void (GLAD_API_PTR *PFNGLGETUNIFORMFVPROC)(GLuint program, GLint location, GLfloat * params);
1272 typedef void (GLAD_API_PTR *PFNGLGETUNIFORMIVPROC)(GLuint program, GLint location, GLint * params);
1273 typedef void (GLAD_API_PTR *PFNGLGETUNIFORMUIVPROC)(GLuint program, GLint location, GLuint * params);
1274 typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBIIVPROC)(GLuint index, GLenum pname, GLint * params);
1275 typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBIUIVPROC)(GLuint index, GLenum pname, GLuint * params);
1276 typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBPOINTERVPROC)(GLuint index, GLenum pname, void ** pointer);
1277 typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBFVPROC)(GLuint index, GLenum pname, GLfloat * params);
1278 typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBIVPROC)(GLuint index, GLenum pname, GLint * params);
1279 typedef void (GLAD_API_PTR *PFNGLHINTPROC)(GLenum target, GLenum mode);
1280 typedef void (GLAD_API_PTR *PFNGLINVALIDATEFRAMEBUFFERPROC)(GLenum target, GLsizei numAttachments, const GLenum * attachments);
1281 typedef void (GLAD_API_PTR *PFNGLINVALIDATESUBFRAMEBUFFERPROC)(GLenum target, GLsizei numAttachments, const GLenum * attachments, GLint x, GLint y, GLsizei width, GLsizei height);
1282 typedef GLboolean (GLAD_API_PTR *PFNGLISBUFFERPROC)(GLuint buffer);
1283 typedef GLboolean (GLAD_API_PTR *PFNGLISENABLEDPROC)(GLenum cap);
1284 typedef GLboolean (GLAD_API_PTR *PFNGLISFRAMEBUFFERPROC)(GLuint framebuffer);
1285 typedef GLboolean (GLAD_API_PTR *PFNGLISPROGRAMPROC)(GLuint program);
1286 typedef GLboolean (GLAD_API_PTR *PFNGLISQUERYPROC)(GLuint id);
1287 typedef GLboolean (GLAD_API_PTR *PFNGLISRENDERBUFFERPROC)(GLuint renderbuffer);
1288 typedef GLboolean (GLAD_API_PTR *PFNGLISSAMPLERPROC)(GLuint sampler);
1289 typedef GLboolean (GLAD_API_PTR *PFNGLISSHADERPROC)(GLuint shader);
1290 typedef GLboolean (GLAD_API_PTR *PFNGLISSYNCPROC)(GLsync sync);
1291 typedef GLboolean (GLAD_API_PTR *PFNGLISTEXTUREPROC)(GLuint texture);
1292 typedef GLboolean (GLAD_API_PTR *PFNGLISTRANSFORMFEEDBACKPROC)(GLuint id);
1293 typedef GLboolean (GLAD_API_PTR *PFNGLISVERTEXARRAYPROC)(GLuint array);
1294 typedef void (GLAD_API_PTR *PFNGLLINEWIDTHPROC)(GLfloat width);
1295 typedef void (GLAD_API_PTR *PFNGLLINKPROGRAMPROC)(GLuint program);
1296 typedef void * (GLAD_API_PTR *PFNGLMAPBUFFERRANGEPROC)(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
1297 typedef void (GLAD_API_PTR *PFNGLPAUSETRANSFORMFEEDBACKPROC)(void);
1298 typedef void (GLAD_API_PTR *PFNGLPIXELSTOREIPROC)(GLenum pname, GLint param);
1299 typedef void (GLAD_API_PTR *PFNGLPOLYGONOFFSETPROC)(GLfloat factor, GLfloat units);
1300 typedef void (GLAD_API_PTR *PFNGLPROGRAMBINARYPROC)(GLuint program, GLenum binaryFormat, const void * binary, GLsizei length);
1301 typedef void (GLAD_API_PTR *PFNGLPROGRAMPARAMETERIPROC)(GLuint program, GLenum pname, GLint value);
1302 typedef void (GLAD_API_PTR *PFNGLREADBUFFERPROC)(GLenum src);
1303 typedef void (GLAD_API_PTR *PFNGLREADPIXELSPROC)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void * pixels);
1304 typedef void (GLAD_API_PTR *PFNGLRELEASESHADERCOMPILERPROC)(void);
1305 typedef void (GLAD_API_PTR *PFNGLRENDERBUFFERSTORAGEPROC)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
1306 typedef void (GLAD_API_PTR *PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
1307 typedef void (GLAD_API_PTR *PFNGLRESUMETRANSFORMFEEDBACKPROC)(void);
1308 typedef void (GLAD_API_PTR *PFNGLSAMPLECOVERAGEPROC)(GLfloat value, GLboolean invert);
1309 typedef void (GLAD_API_PTR *PFNGLSAMPLERPARAMETERFPROC)(GLuint sampler, GLenum pname, GLfloat param);
1310 typedef void (GLAD_API_PTR *PFNGLSAMPLERPARAMETERFVPROC)(GLuint sampler, GLenum pname, const GLfloat * param);
1311 typedef void (GLAD_API_PTR *PFNGLSAMPLERPARAMETERIPROC)(GLuint sampler, GLenum pname, GLint param);
1312 typedef void (GLAD_API_PTR *PFNGLSAMPLERPARAMETERIVPROC)(GLuint sampler, GLenum pname, const GLint * param);
1313 typedef void (GLAD_API_PTR *PFNGLSCISSORPROC)(GLint x, GLint y, GLsizei width, GLsizei height);
1314 typedef void (GLAD_API_PTR *PFNGLSHADERBINARYPROC)(GLsizei count, const GLuint * shaders, GLenum binaryformat, const void * binary, GLsizei length);
1315 typedef void (GLAD_API_PTR *PFNGLSHADERSOURCEPROC)(GLuint shader, GLsizei count, const GLchar *const* string, const GLint * length);
1316 typedef void (GLAD_API_PTR *PFNGLSTENCILFUNCPROC)(GLenum func, GLint ref, GLuint mask);
1317 typedef void (GLAD_API_PTR *PFNGLSTENCILFUNCSEPARATEPROC)(GLenum face, GLenum func, GLint ref, GLuint mask);
1318 typedef void (GLAD_API_PTR *PFNGLSTENCILMASKPROC)(GLuint mask);
1319 typedef void (GLAD_API_PTR *PFNGLSTENCILMASKSEPARATEPROC)(GLenum face, GLuint mask);
1320 typedef void (GLAD_API_PTR *PFNGLSTENCILOPPROC)(GLenum fail, GLenum zfail, GLenum zpass);
1321 typedef void (GLAD_API_PTR *PFNGLSTENCILOPSEPARATEPROC)(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
1322 typedef void (GLAD_API_PTR *PFNGLTEXIMAGE2DPROC)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void * pixels);
1323 typedef void (GLAD_API_PTR *PFNGLTEXIMAGE3DPROC)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void * pixels);
1324 typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERFPROC)(GLenum target, GLenum pname, GLfloat param);
1325 typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERFVPROC)(GLenum target, GLenum pname, const GLfloat * params);
1326 typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERIPROC)(GLenum target, GLenum pname, GLint param);
1327 typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERIVPROC)(GLenum target, GLenum pname, const GLint * params);
1328 typedef void (GLAD_API_PTR *PFNGLTEXSTORAGE2DPROC)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
1329 typedef void (GLAD_API_PTR *PFNGLTEXSTORAGE3DPROC)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
1330 typedef void (GLAD_API_PTR *PFNGLTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void * pixels);
1331 typedef void (GLAD_API_PTR *PFNGLTEXSUBIMAGE3DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void * pixels);
1332 typedef void (GLAD_API_PTR *PFNGLTRANSFORMFEEDBACKVARYINGSPROC)(GLuint program, GLsizei count, const GLchar *const* varyings, GLenum bufferMode);
1333 typedef void (GLAD_API_PTR *PFNGLUNIFORM1FPROC)(GLint location, GLfloat v0);
1334 typedef void (GLAD_API_PTR *PFNGLUNIFORM1FVPROC)(GLint location, GLsizei count, const GLfloat * value);
1335 typedef void (GLAD_API_PTR *PFNGLUNIFORM1IPROC)(GLint location, GLint v0);
1336 typedef void (GLAD_API_PTR *PFNGLUNIFORM1IVPROC)(GLint location, GLsizei count, const GLint * value);
1337 typedef void (GLAD_API_PTR *PFNGLUNIFORM1UIPROC)(GLint location, GLuint v0);
1338 typedef void (GLAD_API_PTR *PFNGLUNIFORM1UIVPROC)(GLint location, GLsizei count, const GLuint * value);
1339 typedef void (GLAD_API_PTR *PFNGLUNIFORM2FPROC)(GLint location, GLfloat v0, GLfloat v1);
1340 typedef void (GLAD_API_PTR *PFNGLUNIFORM2FVPROC)(GLint location, GLsizei count, const GLfloat * value);
1341 typedef void (GLAD_API_PTR *PFNGLUNIFORM2IPROC)(GLint location, GLint v0, GLint v1);
1342 typedef void (GLAD_API_PTR *PFNGLUNIFORM2IVPROC)(GLint location, GLsizei count, const GLint * value);
1343 typedef void (GLAD_API_PTR *PFNGLUNIFORM2UIPROC)(GLint location, GLuint v0, GLuint v1);
1344 typedef void (GLAD_API_PTR *PFNGLUNIFORM2UIVPROC)(GLint location, GLsizei count, const GLuint * value);
1345 typedef void (GLAD_API_PTR *PFNGLUNIFORM3FPROC)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
1346 typedef void (GLAD_API_PTR *PFNGLUNIFORM3FVPROC)(GLint location, GLsizei count, const GLfloat * value);
1347 typedef void (GLAD_API_PTR *PFNGLUNIFORM3IPROC)(GLint location, GLint v0, GLint v1, GLint v2);
1348 typedef void (GLAD_API_PTR *PFNGLUNIFORM3IVPROC)(GLint location, GLsizei count, const GLint * value);
1349 typedef void (GLAD_API_PTR *PFNGLUNIFORM3UIPROC)(GLint location, GLuint v0, GLuint v1, GLuint v2);
1350 typedef void (GLAD_API_PTR *PFNGLUNIFORM3UIVPROC)(GLint location, GLsizei count, const GLuint * value);
1351 typedef void (GLAD_API_PTR *PFNGLUNIFORM4FPROC)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
1352 typedef void (GLAD_API_PTR *PFNGLUNIFORM4FVPROC)(GLint location, GLsizei count, const GLfloat * value);
1353 typedef void (GLAD_API_PTR *PFNGLUNIFORM4IPROC)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
1354 typedef void (GLAD_API_PTR *PFNGLUNIFORM4IVPROC)(GLint location, GLsizei count, const GLint * value);
1355 typedef void (GLAD_API_PTR *PFNGLUNIFORM4UIPROC)(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
1356 typedef void (GLAD_API_PTR *PFNGLUNIFORM4UIVPROC)(GLint location, GLsizei count, const GLuint * value);
1357 typedef void (GLAD_API_PTR *PFNGLUNIFORMBLOCKBINDINGPROC)(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
1358 typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX2FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
1359 typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX2X3FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
1360 typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX2X4FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
1361 typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX3FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
1362 typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX3X2FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
1363 typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX3X4FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
1364 typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX4FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
1365 typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX4X2FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
1366 typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX4X3FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
1367 typedef GLboolean (GLAD_API_PTR *PFNGLUNMAPBUFFERPROC)(GLenum target);
1368 typedef void (GLAD_API_PTR *PFNGLUSEPROGRAMPROC)(GLuint program);
1369 typedef void (GLAD_API_PTR *PFNGLVALIDATEPROGRAMPROC)(GLuint program);
1370 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB1FPROC)(GLuint index, GLfloat x);
1371 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB1FVPROC)(GLuint index, const GLfloat * v);
1372 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB2FPROC)(GLuint index, GLfloat x, GLfloat y);
1373 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB2FVPROC)(GLuint index, const GLfloat * v);
1374 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB3FPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z);
1375 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB3FVPROC)(GLuint index, const GLfloat * v);
1376 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4FPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
1377 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4FVPROC)(GLuint index, const GLfloat * v);
1378 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBDIVISORPROC)(GLuint index, GLuint divisor);
1379 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4IPROC)(GLuint index, GLint x, GLint y, GLint z, GLint w);
1380 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4IVPROC)(GLuint index, const GLint * v);
1381 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4UIPROC)(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
1382 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4UIVPROC)(GLuint index, const GLuint * v);
1383 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBIPOINTERPROC)(GLuint index, GLint size, GLenum type, GLsizei stride, const void * pointer);
1384 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBPOINTERPROC)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void * pointer);
1385 typedef void (GLAD_API_PTR *PFNGLVIEWPORTPROC)(GLint x, GLint y, GLsizei width, GLsizei height);
1386 typedef void (GLAD_API_PTR *PFNGLWAITSYNCPROC)(GLsync sync, GLbitfield flags, GLuint64 timeout);
1387
1388 GLAD_API_CALL PFNGLACTIVETEXTUREPROC glad_glActiveTexture;
1389 #define glActiveTexture glad_glActiveTexture
1390 GLAD_API_CALL PFNGLATTACHSHADERPROC glad_glAttachShader;
1391 #define glAttachShader glad_glAttachShader
1392 GLAD_API_CALL PFNGLBEGINQUERYPROC glad_glBeginQuery;
1393 #define glBeginQuery glad_glBeginQuery
1394 GLAD_API_CALL PFNGLBEGINTRANSFORMFEEDBACKPROC glad_glBeginTransformFeedback;
1395 #define glBeginTransformFeedback glad_glBeginTransformFeedback
1396 GLAD_API_CALL PFNGLBINDATTRIBLOCATIONPROC glad_glBindAttribLocation;
1397 #define glBindAttribLocation glad_glBindAttribLocation
1398 GLAD_API_CALL PFNGLBINDBUFFERPROC glad_glBindBuffer;
1399 #define glBindBuffer glad_glBindBuffer
1400 GLAD_API_CALL PFNGLBINDBUFFERBASEPROC glad_glBindBufferBase;
1401 #define glBindBufferBase glad_glBindBufferBase
1402 GLAD_API_CALL PFNGLBINDBUFFERRANGEPROC glad_glBindBufferRange;
1403 #define glBindBufferRange glad_glBindBufferRange
1404 GLAD_API_CALL PFNGLBINDFRAMEBUFFERPROC glad_glBindFramebuffer;
1405 #define glBindFramebuffer glad_glBindFramebuffer
1406 GLAD_API_CALL PFNGLBINDRENDERBUFFERPROC glad_glBindRenderbuffer;
1407 #define glBindRenderbuffer glad_glBindRenderbuffer
1408 GLAD_API_CALL PFNGLBINDSAMPLERPROC glad_glBindSampler;
1409 #define glBindSampler glad_glBindSampler
1410 GLAD_API_CALL PFNGLBINDTEXTUREPROC glad_glBindTexture;
1411 #define glBindTexture glad_glBindTexture
1412 GLAD_API_CALL PFNGLBINDTRANSFORMFEEDBACKPROC glad_glBindTransformFeedback;
1413 #define glBindTransformFeedback glad_glBindTransformFeedback
1414 GLAD_API_CALL PFNGLBINDVERTEXARRAYPROC glad_glBindVertexArray;
1415 #define glBindVertexArray glad_glBindVertexArray
1416 GLAD_API_CALL PFNGLBLENDCOLORPROC glad_glBlendColor;
1417 #define glBlendColor glad_glBlendColor
1418 GLAD_API_CALL PFNGLBLENDEQUATIONPROC glad_glBlendEquation;
1419 #define glBlendEquation glad_glBlendEquation
1420 GLAD_API_CALL PFNGLBLENDEQUATIONSEPARATEPROC glad_glBlendEquationSeparate;
1421 #define glBlendEquationSeparate glad_glBlendEquationSeparate
1422 GLAD_API_CALL PFNGLBLENDFUNCPROC glad_glBlendFunc;
1423 #define glBlendFunc glad_glBlendFunc
1424 GLAD_API_CALL PFNGLBLENDFUNCSEPARATEPROC glad_glBlendFuncSeparate;
1425 #define glBlendFuncSeparate glad_glBlendFuncSeparate
1426 GLAD_API_CALL PFNGLBLITFRAMEBUFFERPROC glad_glBlitFramebuffer;
1427 #define glBlitFramebuffer glad_glBlitFramebuffer
1428 GLAD_API_CALL PFNGLBUFFERDATAPROC glad_glBufferData;
1429 #define glBufferData glad_glBufferData
1430 GLAD_API_CALL PFNGLBUFFERSUBDATAPROC glad_glBufferSubData;
1431 #define glBufferSubData glad_glBufferSubData
1432 GLAD_API_CALL PFNGLCHECKFRAMEBUFFERSTATUSPROC glad_glCheckFramebufferStatus;
1433 #define glCheckFramebufferStatus glad_glCheckFramebufferStatus
1434 GLAD_API_CALL PFNGLCLEARPROC glad_glClear;
1435 #define glClear glad_glClear
1436 GLAD_API_CALL PFNGLCLEARBUFFERFIPROC glad_glClearBufferfi;
1437 #define glClearBufferfi glad_glClearBufferfi
1438 GLAD_API_CALL PFNGLCLEARBUFFERFVPROC glad_glClearBufferfv;
1439 #define glClearBufferfv glad_glClearBufferfv
1440 GLAD_API_CALL PFNGLCLEARBUFFERIVPROC glad_glClearBufferiv;
1441 #define glClearBufferiv glad_glClearBufferiv
1442 GLAD_API_CALL PFNGLCLEARBUFFERUIVPROC glad_glClearBufferuiv;
1443 #define glClearBufferuiv glad_glClearBufferuiv
1444 GLAD_API_CALL PFNGLCLEARCOLORPROC glad_glClearColor;
1445 #define glClearColor glad_glClearColor
1446 GLAD_API_CALL PFNGLCLEARDEPTHFPROC glad_glClearDepthf;
1447 #define glClearDepthf glad_glClearDepthf
1448 GLAD_API_CALL PFNGLCLEARSTENCILPROC glad_glClearStencil;
1449 #define glClearStencil glad_glClearStencil
1450 GLAD_API_CALL PFNGLCLIENTWAITSYNCPROC glad_glClientWaitSync;
1451 #define glClientWaitSync glad_glClientWaitSync
1452 GLAD_API_CALL PFNGLCOLORMASKPROC glad_glColorMask;
1453 #define glColorMask glad_glColorMask
1454 GLAD_API_CALL PFNGLCOMPILESHADERPROC glad_glCompileShader;
1455 #define glCompileShader glad_glCompileShader
1456 GLAD_API_CALL PFNGLCOMPRESSEDTEXIMAGE2DPROC glad_glCompressedTexImage2D;
1457 #define glCompressedTexImage2D glad_glCompressedTexImage2D
1458 GLAD_API_CALL PFNGLCOMPRESSEDTEXIMAGE3DPROC glad_glCompressedTexImage3D;
1459 #define glCompressedTexImage3D glad_glCompressedTexImage3D
1460 GLAD_API_CALL PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glad_glCompressedTexSubImage2D;
1461 #define glCompressedTexSubImage2D glad_glCompressedTexSubImage2D
1462 GLAD_API_CALL PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glad_glCompressedTexSubImage3D;
1463 #define glCompressedTexSubImage3D glad_glCompressedTexSubImage3D
1464 GLAD_API_CALL PFNGLCOPYBUFFERSUBDATAPROC glad_glCopyBufferSubData;
1465 #define glCopyBufferSubData glad_glCopyBufferSubData
1466 GLAD_API_CALL PFNGLCOPYTEXIMAGE2DPROC glad_glCopyTexImage2D;
1467 #define glCopyTexImage2D glad_glCopyTexImage2D
1468 GLAD_API_CALL PFNGLCOPYTEXSUBIMAGE2DPROC glad_glCopyTexSubImage2D;
1469 #define glCopyTexSubImage2D glad_glCopyTexSubImage2D
1470 GLAD_API_CALL PFNGLCOPYTEXSUBIMAGE3DPROC glad_glCopyTexSubImage3D;
1471 #define glCopyTexSubImage3D glad_glCopyTexSubImage3D
1472 GLAD_API_CALL PFNGLCREATEPROGRAMPROC glad_glCreateProgram;
1473 #define glCreateProgram glad_glCreateProgram
1474 GLAD_API_CALL PFNGLCREATESHADERPROC glad_glCreateShader;
1475 #define glCreateShader glad_glCreateShader
1476 GLAD_API_CALL PFNGLCULLFACEPROC glad_glCullFace;
1477 #define glCullFace glad_glCullFace
1478 GLAD_API_CALL PFNGLDELETEBUFFERSPROC glad_glDeleteBuffers;
1479 #define glDeleteBuffers glad_glDeleteBuffers
1480 GLAD_API_CALL PFNGLDELETEFRAMEBUFFERSPROC glad_glDeleteFramebuffers;
1481 #define glDeleteFramebuffers glad_glDeleteFramebuffers
1482 GLAD_API_CALL PFNGLDELETEPROGRAMPROC glad_glDeleteProgram;
1483 #define glDeleteProgram glad_glDeleteProgram
1484 GLAD_API_CALL PFNGLDELETEQUERIESPROC glad_glDeleteQueries;
1485 #define glDeleteQueries glad_glDeleteQueries
1486 GLAD_API_CALL PFNGLDELETERENDERBUFFERSPROC glad_glDeleteRenderbuffers;
1487 #define glDeleteRenderbuffers glad_glDeleteRenderbuffers
1488 GLAD_API_CALL PFNGLDELETESAMPLERSPROC glad_glDeleteSamplers;
1489 #define glDeleteSamplers glad_glDeleteSamplers
1490 GLAD_API_CALL PFNGLDELETESHADERPROC glad_glDeleteShader;
1491 #define glDeleteShader glad_glDeleteShader
1492 GLAD_API_CALL PFNGLDELETESYNCPROC glad_glDeleteSync;
1493 #define glDeleteSync glad_glDeleteSync
1494 GLAD_API_CALL PFNGLDELETETEXTURESPROC glad_glDeleteTextures;
1495 #define glDeleteTextures glad_glDeleteTextures
1496 GLAD_API_CALL PFNGLDELETETRANSFORMFEEDBACKSPROC glad_glDeleteTransformFeedbacks;
1497 #define glDeleteTransformFeedbacks glad_glDeleteTransformFeedbacks
1498 GLAD_API_CALL PFNGLDELETEVERTEXARRAYSPROC glad_glDeleteVertexArrays;
1499 #define glDeleteVertexArrays glad_glDeleteVertexArrays
1500 GLAD_API_CALL PFNGLDEPTHFUNCPROC glad_glDepthFunc;
1501 #define glDepthFunc glad_glDepthFunc
1502 GLAD_API_CALL PFNGLDEPTHMASKPROC glad_glDepthMask;
1503 #define glDepthMask glad_glDepthMask
1504 GLAD_API_CALL PFNGLDEPTHRANGEFPROC glad_glDepthRangef;
1505 #define glDepthRangef glad_glDepthRangef
1506 GLAD_API_CALL PFNGLDETACHSHADERPROC glad_glDetachShader;
1507 #define glDetachShader glad_glDetachShader
1508 GLAD_API_CALL PFNGLDISABLEPROC glad_glDisable;
1509 #define glDisable glad_glDisable
1510 GLAD_API_CALL PFNGLDISABLEVERTEXATTRIBARRAYPROC glad_glDisableVertexAttribArray;
1511 #define glDisableVertexAttribArray glad_glDisableVertexAttribArray
1512 GLAD_API_CALL PFNGLDRAWARRAYSPROC glad_glDrawArrays;
1513 #define glDrawArrays glad_glDrawArrays
1514 GLAD_API_CALL PFNGLDRAWARRAYSINSTANCEDPROC glad_glDrawArraysInstanced;
1515 #define glDrawArraysInstanced glad_glDrawArraysInstanced
1516 GLAD_API_CALL PFNGLDRAWBUFFERSPROC glad_glDrawBuffers;
1517 #define glDrawBuffers glad_glDrawBuffers
1518 GLAD_API_CALL PFNGLDRAWELEMENTSPROC glad_glDrawElements;
1519 #define glDrawElements glad_glDrawElements
1520 GLAD_API_CALL PFNGLDRAWELEMENTSINSTANCEDPROC glad_glDrawElementsInstanced;
1521 #define glDrawElementsInstanced glad_glDrawElementsInstanced
1522 GLAD_API_CALL PFNGLDRAWRANGEELEMENTSPROC glad_glDrawRangeElements;
1523 #define glDrawRangeElements glad_glDrawRangeElements
1524 GLAD_API_CALL PFNGLENABLEPROC glad_glEnable;
1525 #define glEnable glad_glEnable
1526 GLAD_API_CALL PFNGLENABLEVERTEXATTRIBARRAYPROC glad_glEnableVertexAttribArray;
1527 #define glEnableVertexAttribArray glad_glEnableVertexAttribArray
1528 GLAD_API_CALL PFNGLENDQUERYPROC glad_glEndQuery;
1529 #define glEndQuery glad_glEndQuery
1530 GLAD_API_CALL PFNGLENDTRANSFORMFEEDBACKPROC glad_glEndTransformFeedback;
1531 #define glEndTransformFeedback glad_glEndTransformFeedback
1532 GLAD_API_CALL PFNGLFENCESYNCPROC glad_glFenceSync;
1533 #define glFenceSync glad_glFenceSync
1534 GLAD_API_CALL PFNGLFINISHPROC glad_glFinish;
1535 #define glFinish glad_glFinish
1536 GLAD_API_CALL PFNGLFLUSHPROC glad_glFlush;
1537 #define glFlush glad_glFlush
1538 GLAD_API_CALL PFNGLFLUSHMAPPEDBUFFERRANGEPROC glad_glFlushMappedBufferRange;
1539 #define glFlushMappedBufferRange glad_glFlushMappedBufferRange
1540 GLAD_API_CALL PFNGLFRAMEBUFFERRENDERBUFFERPROC glad_glFramebufferRenderbuffer;
1541 #define glFramebufferRenderbuffer glad_glFramebufferRenderbuffer
1542 GLAD_API_CALL PFNGLFRAMEBUFFERTEXTURE2DPROC glad_glFramebufferTexture2D;
1543 #define glFramebufferTexture2D glad_glFramebufferTexture2D
1544 GLAD_API_CALL PFNGLFRAMEBUFFERTEXTURELAYERPROC glad_glFramebufferTextureLayer;
1545 #define glFramebufferTextureLayer glad_glFramebufferTextureLayer
1546 GLAD_API_CALL PFNGLFRONTFACEPROC glad_glFrontFace;
1547 #define glFrontFace glad_glFrontFace
1548 GLAD_API_CALL PFNGLGENBUFFERSPROC glad_glGenBuffers;
1549 #define glGenBuffers glad_glGenBuffers
1550 GLAD_API_CALL PFNGLGENFRAMEBUFFERSPROC glad_glGenFramebuffers;
1551 #define glGenFramebuffers glad_glGenFramebuffers
1552 GLAD_API_CALL PFNGLGENQUERIESPROC glad_glGenQueries;
1553 #define glGenQueries glad_glGenQueries
1554 GLAD_API_CALL PFNGLGENRENDERBUFFERSPROC glad_glGenRenderbuffers;
1555 #define glGenRenderbuffers glad_glGenRenderbuffers
1556 GLAD_API_CALL PFNGLGENSAMPLERSPROC glad_glGenSamplers;
1557 #define glGenSamplers glad_glGenSamplers
1558 GLAD_API_CALL PFNGLGENTEXTURESPROC glad_glGenTextures;
1559 #define glGenTextures glad_glGenTextures
1560 GLAD_API_CALL PFNGLGENTRANSFORMFEEDBACKSPROC glad_glGenTransformFeedbacks;
1561 #define glGenTransformFeedbacks glad_glGenTransformFeedbacks
1562 GLAD_API_CALL PFNGLGENVERTEXARRAYSPROC glad_glGenVertexArrays;
1563 #define glGenVertexArrays glad_glGenVertexArrays
1564 GLAD_API_CALL PFNGLGENERATEMIPMAPPROC glad_glGenerateMipmap;
1565 #define glGenerateMipmap glad_glGenerateMipmap
1566 GLAD_API_CALL PFNGLGETACTIVEATTRIBPROC glad_glGetActiveAttrib;
1567 #define glGetActiveAttrib glad_glGetActiveAttrib
1568 GLAD_API_CALL PFNGLGETACTIVEUNIFORMPROC glad_glGetActiveUniform;
1569 #define glGetActiveUniform glad_glGetActiveUniform
1570 GLAD_API_CALL PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC glad_glGetActiveUniformBlockName;
1571 #define glGetActiveUniformBlockName glad_glGetActiveUniformBlockName
1572 GLAD_API_CALL PFNGLGETACTIVEUNIFORMBLOCKIVPROC glad_glGetActiveUniformBlockiv;
1573 #define glGetActiveUniformBlockiv glad_glGetActiveUniformBlockiv
1574 GLAD_API_CALL PFNGLGETACTIVEUNIFORMSIVPROC glad_glGetActiveUniformsiv;
1575 #define glGetActiveUniformsiv glad_glGetActiveUniformsiv
1576 GLAD_API_CALL PFNGLGETATTACHEDSHADERSPROC glad_glGetAttachedShaders;
1577 #define glGetAttachedShaders glad_glGetAttachedShaders
1578 GLAD_API_CALL PFNGLGETATTRIBLOCATIONPROC glad_glGetAttribLocation;
1579 #define glGetAttribLocation glad_glGetAttribLocation
1580 GLAD_API_CALL PFNGLGETBOOLEANVPROC glad_glGetBooleanv;
1581 #define glGetBooleanv glad_glGetBooleanv
1582 GLAD_API_CALL PFNGLGETBUFFERPARAMETERI64VPROC glad_glGetBufferParameteri64v;
1583 #define glGetBufferParameteri64v glad_glGetBufferParameteri64v
1584 GLAD_API_CALL PFNGLGETBUFFERPARAMETERIVPROC glad_glGetBufferParameteriv;
1585 #define glGetBufferParameteriv glad_glGetBufferParameteriv
1586 GLAD_API_CALL PFNGLGETBUFFERPOINTERVPROC glad_glGetBufferPointerv;
1587 #define glGetBufferPointerv glad_glGetBufferPointerv
1588 GLAD_API_CALL PFNGLGETERRORPROC glad_glGetError;
1589 #define glGetError glad_glGetError
1590 GLAD_API_CALL PFNGLGETFLOATVPROC glad_glGetFloatv;
1591 #define glGetFloatv glad_glGetFloatv
1592 GLAD_API_CALL PFNGLGETFRAGDATALOCATIONPROC glad_glGetFragDataLocation;
1593 #define glGetFragDataLocation glad_glGetFragDataLocation
1594 GLAD_API_CALL PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetFramebufferAttachmentParameteriv;
1595 #define glGetFramebufferAttachmentParameteriv glad_glGetFramebufferAttachmentParameteriv
1596 GLAD_API_CALL PFNGLGETINTEGER64I_VPROC glad_glGetInteger64i_v;
1597 #define glGetInteger64i_v glad_glGetInteger64i_v
1598 GLAD_API_CALL PFNGLGETINTEGER64VPROC glad_glGetInteger64v;
1599 #define glGetInteger64v glad_glGetInteger64v
1600 GLAD_API_CALL PFNGLGETINTEGERI_VPROC glad_glGetIntegeri_v;
1601 #define glGetIntegeri_v glad_glGetIntegeri_v
1602 GLAD_API_CALL PFNGLGETINTEGERVPROC glad_glGetIntegerv;
1603 #define glGetIntegerv glad_glGetIntegerv
1604 GLAD_API_CALL PFNGLGETINTERNALFORMATIVPROC glad_glGetInternalformativ;
1605 #define glGetInternalformativ glad_glGetInternalformativ
1606 GLAD_API_CALL PFNGLGETPROGRAMBINARYPROC glad_glGetProgramBinary;
1607 #define glGetProgramBinary glad_glGetProgramBinary
1608 GLAD_API_CALL PFNGLGETPROGRAMINFOLOGPROC glad_glGetProgramInfoLog;
1609 #define glGetProgramInfoLog glad_glGetProgramInfoLog
1610 GLAD_API_CALL PFNGLGETPROGRAMIVPROC glad_glGetProgramiv;
1611 #define glGetProgramiv glad_glGetProgramiv
1612 GLAD_API_CALL PFNGLGETQUERYOBJECTUIVPROC glad_glGetQueryObjectuiv;
1613 #define glGetQueryObjectuiv glad_glGetQueryObjectuiv
1614 GLAD_API_CALL PFNGLGETQUERYIVPROC glad_glGetQueryiv;
1615 #define glGetQueryiv glad_glGetQueryiv
1616 GLAD_API_CALL PFNGLGETRENDERBUFFERPARAMETERIVPROC glad_glGetRenderbufferParameteriv;
1617 #define glGetRenderbufferParameteriv glad_glGetRenderbufferParameteriv
1618 GLAD_API_CALL PFNGLGETSAMPLERPARAMETERFVPROC glad_glGetSamplerParameterfv;
1619 #define glGetSamplerParameterfv glad_glGetSamplerParameterfv
1620 GLAD_API_CALL PFNGLGETSAMPLERPARAMETERIVPROC glad_glGetSamplerParameteriv;
1621 #define glGetSamplerParameteriv glad_glGetSamplerParameteriv
1622 GLAD_API_CALL PFNGLGETSHADERINFOLOGPROC glad_glGetShaderInfoLog;
1623 #define glGetShaderInfoLog glad_glGetShaderInfoLog
1624 GLAD_API_CALL PFNGLGETSHADERPRECISIONFORMATPROC glad_glGetShaderPrecisionFormat;
1625 #define glGetShaderPrecisionFormat glad_glGetShaderPrecisionFormat
1626 GLAD_API_CALL PFNGLGETSHADERSOURCEPROC glad_glGetShaderSource;
1627 #define glGetShaderSource glad_glGetShaderSource
1628 GLAD_API_CALL PFNGLGETSHADERIVPROC glad_glGetShaderiv;
1629 #define glGetShaderiv glad_glGetShaderiv
1630 GLAD_API_CALL PFNGLGETSTRINGPROC glad_glGetString;
1631 #define glGetString glad_glGetString
1632 GLAD_API_CALL PFNGLGETSTRINGIPROC glad_glGetStringi;
1633 #define glGetStringi glad_glGetStringi
1634 GLAD_API_CALL PFNGLGETSYNCIVPROC glad_glGetSynciv;
1635 #define glGetSynciv glad_glGetSynciv
1636 GLAD_API_CALL PFNGLGETTEXPARAMETERFVPROC glad_glGetTexParameterfv;
1637 #define glGetTexParameterfv glad_glGetTexParameterfv
1638 GLAD_API_CALL PFNGLGETTEXPARAMETERIVPROC glad_glGetTexParameteriv;
1639 #define glGetTexParameteriv glad_glGetTexParameteriv
1640 GLAD_API_CALL PFNGLGETTRANSFORMFEEDBACKVARYINGPROC glad_glGetTransformFeedbackVarying;
1641 #define glGetTransformFeedbackVarying glad_glGetTransformFeedbackVarying
1642 GLAD_API_CALL PFNGLGETUNIFORMBLOCKINDEXPROC glad_glGetUniformBlockIndex;
1643 #define glGetUniformBlockIndex glad_glGetUniformBlockIndex
1644 GLAD_API_CALL PFNGLGETUNIFORMINDICESPROC glad_glGetUniformIndices;
1645 #define glGetUniformIndices glad_glGetUniformIndices
1646 GLAD_API_CALL PFNGLGETUNIFORMLOCATIONPROC glad_glGetUniformLocation;
1647 #define glGetUniformLocation glad_glGetUniformLocation
1648 GLAD_API_CALL PFNGLGETUNIFORMFVPROC glad_glGetUniformfv;
1649 #define glGetUniformfv glad_glGetUniformfv
1650 GLAD_API_CALL PFNGLGETUNIFORMIVPROC glad_glGetUniformiv;
1651 #define glGetUniformiv glad_glGetUniformiv
1652 GLAD_API_CALL PFNGLGETUNIFORMUIVPROC glad_glGetUniformuiv;
1653 #define glGetUniformuiv glad_glGetUniformuiv
1654 GLAD_API_CALL PFNGLGETVERTEXATTRIBIIVPROC glad_glGetVertexAttribIiv;
1655 #define glGetVertexAttribIiv glad_glGetVertexAttribIiv
1656 GLAD_API_CALL PFNGLGETVERTEXATTRIBIUIVPROC glad_glGetVertexAttribIuiv;
1657 #define glGetVertexAttribIuiv glad_glGetVertexAttribIuiv
1658 GLAD_API_CALL PFNGLGETVERTEXATTRIBPOINTERVPROC glad_glGetVertexAttribPointerv;
1659 #define glGetVertexAttribPointerv glad_glGetVertexAttribPointerv
1660 GLAD_API_CALL PFNGLGETVERTEXATTRIBFVPROC glad_glGetVertexAttribfv;
1661 #define glGetVertexAttribfv glad_glGetVertexAttribfv
1662 GLAD_API_CALL PFNGLGETVERTEXATTRIBIVPROC glad_glGetVertexAttribiv;
1663 #define glGetVertexAttribiv glad_glGetVertexAttribiv
1664 GLAD_API_CALL PFNGLHINTPROC glad_glHint;
1665 #define glHint glad_glHint
1666 GLAD_API_CALL PFNGLINVALIDATEFRAMEBUFFERPROC glad_glInvalidateFramebuffer;
1667 #define glInvalidateFramebuffer glad_glInvalidateFramebuffer
1668 GLAD_API_CALL PFNGLINVALIDATESUBFRAMEBUFFERPROC glad_glInvalidateSubFramebuffer;
1669 #define glInvalidateSubFramebuffer glad_glInvalidateSubFramebuffer
1670 GLAD_API_CALL PFNGLISBUFFERPROC glad_glIsBuffer;
1671 #define glIsBuffer glad_glIsBuffer
1672 GLAD_API_CALL PFNGLISENABLEDPROC glad_glIsEnabled;
1673 #define glIsEnabled glad_glIsEnabled
1674 GLAD_API_CALL PFNGLISFRAMEBUFFERPROC glad_glIsFramebuffer;
1675 #define glIsFramebuffer glad_glIsFramebuffer
1676 GLAD_API_CALL PFNGLISPROGRAMPROC glad_glIsProgram;
1677 #define glIsProgram glad_glIsProgram
1678 GLAD_API_CALL PFNGLISQUERYPROC glad_glIsQuery;
1679 #define glIsQuery glad_glIsQuery
1680 GLAD_API_CALL PFNGLISRENDERBUFFERPROC glad_glIsRenderbuffer;
1681 #define glIsRenderbuffer glad_glIsRenderbuffer
1682 GLAD_API_CALL PFNGLISSAMPLERPROC glad_glIsSampler;
1683 #define glIsSampler glad_glIsSampler
1684 GLAD_API_CALL PFNGLISSHADERPROC glad_glIsShader;
1685 #define glIsShader glad_glIsShader
1686 GLAD_API_CALL PFNGLISSYNCPROC glad_glIsSync;
1687 #define glIsSync glad_glIsSync
1688 GLAD_API_CALL PFNGLISTEXTUREPROC glad_glIsTexture;
1689 #define glIsTexture glad_glIsTexture
1690 GLAD_API_CALL PFNGLISTRANSFORMFEEDBACKPROC glad_glIsTransformFeedback;
1691 #define glIsTransformFeedback glad_glIsTransformFeedback
1692 GLAD_API_CALL PFNGLISVERTEXARRAYPROC glad_glIsVertexArray;
1693 #define glIsVertexArray glad_glIsVertexArray
1694 GLAD_API_CALL PFNGLLINEWIDTHPROC glad_glLineWidth;
1695 #define glLineWidth glad_glLineWidth
1696 GLAD_API_CALL PFNGLLINKPROGRAMPROC glad_glLinkProgram;
1697 #define glLinkProgram glad_glLinkProgram
1698 GLAD_API_CALL PFNGLMAPBUFFERRANGEPROC glad_glMapBufferRange;
1699 #define glMapBufferRange glad_glMapBufferRange
1700 GLAD_API_CALL PFNGLPAUSETRANSFORMFEEDBACKPROC glad_glPauseTransformFeedback;
1701 #define glPauseTransformFeedback glad_glPauseTransformFeedback
1702 GLAD_API_CALL PFNGLPIXELSTOREIPROC glad_glPixelStorei;
1703 #define glPixelStorei glad_glPixelStorei
1704 GLAD_API_CALL PFNGLPOLYGONOFFSETPROC glad_glPolygonOffset;
1705 #define glPolygonOffset glad_glPolygonOffset
1706 GLAD_API_CALL PFNGLPROGRAMBINARYPROC glad_glProgramBinary;
1707 #define glProgramBinary glad_glProgramBinary
1708 GLAD_API_CALL PFNGLPROGRAMPARAMETERIPROC glad_glProgramParameteri;
1709 #define glProgramParameteri glad_glProgramParameteri
1710 GLAD_API_CALL PFNGLREADBUFFERPROC glad_glReadBuffer;
1711 #define glReadBuffer glad_glReadBuffer
1712 GLAD_API_CALL PFNGLREADPIXELSPROC glad_glReadPixels;
1713 #define glReadPixels glad_glReadPixels
1714 GLAD_API_CALL PFNGLRELEASESHADERCOMPILERPROC glad_glReleaseShaderCompiler;
1715 #define glReleaseShaderCompiler glad_glReleaseShaderCompiler
1716 GLAD_API_CALL PFNGLRENDERBUFFERSTORAGEPROC glad_glRenderbufferStorage;
1717 #define glRenderbufferStorage glad_glRenderbufferStorage
1718 GLAD_API_CALL PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC glad_glRenderbufferStorageMultisample;
1719 #define glRenderbufferStorageMultisample glad_glRenderbufferStorageMultisample
1720 GLAD_API_CALL PFNGLRESUMETRANSFORMFEEDBACKPROC glad_glResumeTransformFeedback;
1721 #define glResumeTransformFeedback glad_glResumeTransformFeedback
1722 GLAD_API_CALL PFNGLSAMPLECOVERAGEPROC glad_glSampleCoverage;
1723 #define glSampleCoverage glad_glSampleCoverage
1724 GLAD_API_CALL PFNGLSAMPLERPARAMETERFPROC glad_glSamplerParameterf;
1725 #define glSamplerParameterf glad_glSamplerParameterf
1726 GLAD_API_CALL PFNGLSAMPLERPARAMETERFVPROC glad_glSamplerParameterfv;
1727 #define glSamplerParameterfv glad_glSamplerParameterfv
1728 GLAD_API_CALL PFNGLSAMPLERPARAMETERIPROC glad_glSamplerParameteri;
1729 #define glSamplerParameteri glad_glSamplerParameteri
1730 GLAD_API_CALL PFNGLSAMPLERPARAMETERIVPROC glad_glSamplerParameteriv;
1731 #define glSamplerParameteriv glad_glSamplerParameteriv
1732 GLAD_API_CALL PFNGLSCISSORPROC glad_glScissor;
1733 #define glScissor glad_glScissor
1734 GLAD_API_CALL PFNGLSHADERBINARYPROC glad_glShaderBinary;
1735 #define glShaderBinary glad_glShaderBinary
1736 GLAD_API_CALL PFNGLSHADERSOURCEPROC glad_glShaderSource;
1737 #define glShaderSource glad_glShaderSource
1738 GLAD_API_CALL PFNGLSTENCILFUNCPROC glad_glStencilFunc;
1739 #define glStencilFunc glad_glStencilFunc
1740 GLAD_API_CALL PFNGLSTENCILFUNCSEPARATEPROC glad_glStencilFuncSeparate;
1741 #define glStencilFuncSeparate glad_glStencilFuncSeparate
1742 GLAD_API_CALL PFNGLSTENCILMASKPROC glad_glStencilMask;
1743 #define glStencilMask glad_glStencilMask
1744 GLAD_API_CALL PFNGLSTENCILMASKSEPARATEPROC glad_glStencilMaskSeparate;
1745 #define glStencilMaskSeparate glad_glStencilMaskSeparate
1746 GLAD_API_CALL PFNGLSTENCILOPPROC glad_glStencilOp;
1747 #define glStencilOp glad_glStencilOp
1748 GLAD_API_CALL PFNGLSTENCILOPSEPARATEPROC glad_glStencilOpSeparate;
1749 #define glStencilOpSeparate glad_glStencilOpSeparate
1750 GLAD_API_CALL PFNGLTEXIMAGE2DPROC glad_glTexImage2D;
1751 #define glTexImage2D glad_glTexImage2D
1752 GLAD_API_CALL PFNGLTEXIMAGE3DPROC glad_glTexImage3D;
1753 #define glTexImage3D glad_glTexImage3D
1754 GLAD_API_CALL PFNGLTEXPARAMETERFPROC glad_glTexParameterf;
1755 #define glTexParameterf glad_glTexParameterf
1756 GLAD_API_CALL PFNGLTEXPARAMETERFVPROC glad_glTexParameterfv;
1757 #define glTexParameterfv glad_glTexParameterfv
1758 GLAD_API_CALL PFNGLTEXPARAMETERIPROC glad_glTexParameteri;
1759 #define glTexParameteri glad_glTexParameteri
1760 GLAD_API_CALL PFNGLTEXPARAMETERIVPROC glad_glTexParameteriv;
1761 #define glTexParameteriv glad_glTexParameteriv
1762 GLAD_API_CALL PFNGLTEXSTORAGE2DPROC glad_glTexStorage2D;
1763 #define glTexStorage2D glad_glTexStorage2D
1764 GLAD_API_CALL PFNGLTEXSTORAGE3DPROC glad_glTexStorage3D;
1765 #define glTexStorage3D glad_glTexStorage3D
1766 GLAD_API_CALL PFNGLTEXSUBIMAGE2DPROC glad_glTexSubImage2D;
1767 #define glTexSubImage2D glad_glTexSubImage2D
1768 GLAD_API_CALL PFNGLTEXSUBIMAGE3DPROC glad_glTexSubImage3D;
1769 #define glTexSubImage3D glad_glTexSubImage3D
1770 GLAD_API_CALL PFNGLTRANSFORMFEEDBACKVARYINGSPROC glad_glTransformFeedbackVaryings;
1771 #define glTransformFeedbackVaryings glad_glTransformFeedbackVaryings
1772 GLAD_API_CALL PFNGLUNIFORM1FPROC glad_glUniform1f;
1773 #define glUniform1f glad_glUniform1f
1774 GLAD_API_CALL PFNGLUNIFORM1FVPROC glad_glUniform1fv;
1775 #define glUniform1fv glad_glUniform1fv
1776 GLAD_API_CALL PFNGLUNIFORM1IPROC glad_glUniform1i;
1777 #define glUniform1i glad_glUniform1i
1778 GLAD_API_CALL PFNGLUNIFORM1IVPROC glad_glUniform1iv;
1779 #define glUniform1iv glad_glUniform1iv
1780 GLAD_API_CALL PFNGLUNIFORM1UIPROC glad_glUniform1ui;
1781 #define glUniform1ui glad_glUniform1ui
1782 GLAD_API_CALL PFNGLUNIFORM1UIVPROC glad_glUniform1uiv;
1783 #define glUniform1uiv glad_glUniform1uiv
1784 GLAD_API_CALL PFNGLUNIFORM2FPROC glad_glUniform2f;
1785 #define glUniform2f glad_glUniform2f
1786 GLAD_API_CALL PFNGLUNIFORM2FVPROC glad_glUniform2fv;
1787 #define glUniform2fv glad_glUniform2fv
1788 GLAD_API_CALL PFNGLUNIFORM2IPROC glad_glUniform2i;
1789 #define glUniform2i glad_glUniform2i
1790 GLAD_API_CALL PFNGLUNIFORM2IVPROC glad_glUniform2iv;
1791 #define glUniform2iv glad_glUniform2iv
1792 GLAD_API_CALL PFNGLUNIFORM2UIPROC glad_glUniform2ui;
1793 #define glUniform2ui glad_glUniform2ui
1794 GLAD_API_CALL PFNGLUNIFORM2UIVPROC glad_glUniform2uiv;
1795 #define glUniform2uiv glad_glUniform2uiv
1796 GLAD_API_CALL PFNGLUNIFORM3FPROC glad_glUniform3f;
1797 #define glUniform3f glad_glUniform3f
1798 GLAD_API_CALL PFNGLUNIFORM3FVPROC glad_glUniform3fv;
1799 #define glUniform3fv glad_glUniform3fv
1800 GLAD_API_CALL PFNGLUNIFORM3IPROC glad_glUniform3i;
1801 #define glUniform3i glad_glUniform3i
1802 GLAD_API_CALL PFNGLUNIFORM3IVPROC glad_glUniform3iv;
1803 #define glUniform3iv glad_glUniform3iv
1804 GLAD_API_CALL PFNGLUNIFORM3UIPROC glad_glUniform3ui;
1805 #define glUniform3ui glad_glUniform3ui
1806 GLAD_API_CALL PFNGLUNIFORM3UIVPROC glad_glUniform3uiv;
1807 #define glUniform3uiv glad_glUniform3uiv
1808 GLAD_API_CALL PFNGLUNIFORM4FPROC glad_glUniform4f;
1809 #define glUniform4f glad_glUniform4f
1810 GLAD_API_CALL PFNGLUNIFORM4FVPROC glad_glUniform4fv;
1811 #define glUniform4fv glad_glUniform4fv
1812 GLAD_API_CALL PFNGLUNIFORM4IPROC glad_glUniform4i;
1813 #define glUniform4i glad_glUniform4i
1814 GLAD_API_CALL PFNGLUNIFORM4IVPROC glad_glUniform4iv;
1815 #define glUniform4iv glad_glUniform4iv
1816 GLAD_API_CALL PFNGLUNIFORM4UIPROC glad_glUniform4ui;
1817 #define glUniform4ui glad_glUniform4ui
1818 GLAD_API_CALL PFNGLUNIFORM4UIVPROC glad_glUniform4uiv;
1819 #define glUniform4uiv glad_glUniform4uiv
1820 GLAD_API_CALL PFNGLUNIFORMBLOCKBINDINGPROC glad_glUniformBlockBinding;
1821 #define glUniformBlockBinding glad_glUniformBlockBinding
1822 GLAD_API_CALL PFNGLUNIFORMMATRIX2FVPROC glad_glUniformMatrix2fv;
1823 #define glUniformMatrix2fv glad_glUniformMatrix2fv
1824 GLAD_API_CALL PFNGLUNIFORMMATRIX2X3FVPROC glad_glUniformMatrix2x3fv;
1825 #define glUniformMatrix2x3fv glad_glUniformMatrix2x3fv
1826 GLAD_API_CALL PFNGLUNIFORMMATRIX2X4FVPROC glad_glUniformMatrix2x4fv;
1827 #define glUniformMatrix2x4fv glad_glUniformMatrix2x4fv
1828 GLAD_API_CALL PFNGLUNIFORMMATRIX3FVPROC glad_glUniformMatrix3fv;
1829 #define glUniformMatrix3fv glad_glUniformMatrix3fv
1830 GLAD_API_CALL PFNGLUNIFORMMATRIX3X2FVPROC glad_glUniformMatrix3x2fv;
1831 #define glUniformMatrix3x2fv glad_glUniformMatrix3x2fv
1832 GLAD_API_CALL PFNGLUNIFORMMATRIX3X4FVPROC glad_glUniformMatrix3x4fv;
1833 #define glUniformMatrix3x4fv glad_glUniformMatrix3x4fv
1834 GLAD_API_CALL PFNGLUNIFORMMATRIX4FVPROC glad_glUniformMatrix4fv;
1835 #define glUniformMatrix4fv glad_glUniformMatrix4fv
1836 GLAD_API_CALL PFNGLUNIFORMMATRIX4X2FVPROC glad_glUniformMatrix4x2fv;
1837 #define glUniformMatrix4x2fv glad_glUniformMatrix4x2fv
1838 GLAD_API_CALL PFNGLUNIFORMMATRIX4X3FVPROC glad_glUniformMatrix4x3fv;
1839 #define glUniformMatrix4x3fv glad_glUniformMatrix4x3fv
1840 GLAD_API_CALL PFNGLUNMAPBUFFERPROC glad_glUnmapBuffer;
1841 #define glUnmapBuffer glad_glUnmapBuffer
1842 GLAD_API_CALL PFNGLUSEPROGRAMPROC glad_glUseProgram;
1843 #define glUseProgram glad_glUseProgram
1844 GLAD_API_CALL PFNGLVALIDATEPROGRAMPROC glad_glValidateProgram;
1845 #define glValidateProgram glad_glValidateProgram
1846 GLAD_API_CALL PFNGLVERTEXATTRIB1FPROC glad_glVertexAttrib1f;
1847 #define glVertexAttrib1f glad_glVertexAttrib1f
1848 GLAD_API_CALL PFNGLVERTEXATTRIB1FVPROC glad_glVertexAttrib1fv;
1849 #define glVertexAttrib1fv glad_glVertexAttrib1fv
1850 GLAD_API_CALL PFNGLVERTEXATTRIB2FPROC glad_glVertexAttrib2f;
1851 #define glVertexAttrib2f glad_glVertexAttrib2f
1852 GLAD_API_CALL PFNGLVERTEXATTRIB2FVPROC glad_glVertexAttrib2fv;
1853 #define glVertexAttrib2fv glad_glVertexAttrib2fv
1854 GLAD_API_CALL PFNGLVERTEXATTRIB3FPROC glad_glVertexAttrib3f;
1855 #define glVertexAttrib3f glad_glVertexAttrib3f
1856 GLAD_API_CALL PFNGLVERTEXATTRIB3FVPROC glad_glVertexAttrib3fv;
1857 #define glVertexAttrib3fv glad_glVertexAttrib3fv
1858 GLAD_API_CALL PFNGLVERTEXATTRIB4FPROC glad_glVertexAttrib4f;
1859 #define glVertexAttrib4f glad_glVertexAttrib4f
1860 GLAD_API_CALL PFNGLVERTEXATTRIB4FVPROC glad_glVertexAttrib4fv;
1861 #define glVertexAttrib4fv glad_glVertexAttrib4fv
1862 GLAD_API_CALL PFNGLVERTEXATTRIBDIVISORPROC glad_glVertexAttribDivisor;
1863 #define glVertexAttribDivisor glad_glVertexAttribDivisor
1864 GLAD_API_CALL PFNGLVERTEXATTRIBI4IPROC glad_glVertexAttribI4i;
1865 #define glVertexAttribI4i glad_glVertexAttribI4i
1866 GLAD_API_CALL PFNGLVERTEXATTRIBI4IVPROC glad_glVertexAttribI4iv;
1867 #define glVertexAttribI4iv glad_glVertexAttribI4iv
1868 GLAD_API_CALL PFNGLVERTEXATTRIBI4UIPROC glad_glVertexAttribI4ui;
1869 #define glVertexAttribI4ui glad_glVertexAttribI4ui
1870 GLAD_API_CALL PFNGLVERTEXATTRIBI4UIVPROC glad_glVertexAttribI4uiv;
1871 #define glVertexAttribI4uiv glad_glVertexAttribI4uiv
1872 GLAD_API_CALL PFNGLVERTEXATTRIBIPOINTERPROC glad_glVertexAttribIPointer;
1873 #define glVertexAttribIPointer glad_glVertexAttribIPointer
1874 GLAD_API_CALL PFNGLVERTEXATTRIBPOINTERPROC glad_glVertexAttribPointer;
1875 #define glVertexAttribPointer glad_glVertexAttribPointer
1876 GLAD_API_CALL PFNGLVIEWPORTPROC glad_glViewport;
1877 #define glViewport glad_glViewport
1878 GLAD_API_CALL PFNGLWAITSYNCPROC glad_glWaitSync;
1879 #define glWaitSync glad_glWaitSync
1880
1881
1882 GLAD_API_CALL int gladLoadGLES2UserPtr( GLADuserptrloadfunc load, void *userptr);
1883 GLAD_API_CALL int gladLoadGLES2( GLADloadfunc load);
1884
1885
1886
1887
1888
1889
1890 #ifdef __cplusplus
1891 }
1892 #endif
1893 #endif
1894
1895 /* Source */
1896 #ifdef GLAD_GLES2_IMPLEMENTATION
1897 #include <stdio.h>
1898 #include <stdlib.h>
1899 #include <string.h>
1900
1901 #ifndef GLAD_IMPL_UTIL_C_
1902 #define GLAD_IMPL_UTIL_C_
1903
1904 #ifdef _MSC_VER
1905 #define GLAD_IMPL_UTIL_SSCANF sscanf_s
1906 #else
1907 #define GLAD_IMPL_UTIL_SSCANF sscanf
1908 #endif
1909
1910 #endif /* GLAD_IMPL_UTIL_C_ */
1911
1912
1913 int GLAD_GL_ES_VERSION_2_0 = 0;
1914 int GLAD_GL_ES_VERSION_3_0 = 0;
1915
1916
1917
1918 PFNGLACTIVETEXTUREPROC glad_glActiveTexture = NULL;
1919 PFNGLATTACHSHADERPROC glad_glAttachShader = NULL;
1920 PFNGLBEGINQUERYPROC glad_glBeginQuery = NULL;
1921 PFNGLBEGINTRANSFORMFEEDBACKPROC glad_glBeginTransformFeedback = NULL;
1922 PFNGLBINDATTRIBLOCATIONPROC glad_glBindAttribLocation = NULL;
1923 PFNGLBINDBUFFERPROC glad_glBindBuffer = NULL;
1924 PFNGLBINDBUFFERBASEPROC glad_glBindBufferBase = NULL;
1925 PFNGLBINDBUFFERRANGEPROC glad_glBindBufferRange = NULL;
1926 PFNGLBINDFRAMEBUFFERPROC glad_glBindFramebuffer = NULL;
1927 PFNGLBINDRENDERBUFFERPROC glad_glBindRenderbuffer = NULL;
1928 PFNGLBINDSAMPLERPROC glad_glBindSampler = NULL;
1929 PFNGLBINDTEXTUREPROC glad_glBindTexture = NULL;
1930 PFNGLBINDTRANSFORMFEEDBACKPROC glad_glBindTransformFeedback = NULL;
1931 PFNGLBINDVERTEXARRAYPROC glad_glBindVertexArray = NULL;
1932 PFNGLBLENDCOLORPROC glad_glBlendColor = NULL;
1933 PFNGLBLENDEQUATIONPROC glad_glBlendEquation = NULL;
1934 PFNGLBLENDEQUATIONSEPARATEPROC glad_glBlendEquationSeparate = NULL;
1935 PFNGLBLENDFUNCPROC glad_glBlendFunc = NULL;
1936 PFNGLBLENDFUNCSEPARATEPROC glad_glBlendFuncSeparate = NULL;
1937 PFNGLBLITFRAMEBUFFERPROC glad_glBlitFramebuffer = NULL;
1938 PFNGLBUFFERDATAPROC glad_glBufferData = NULL;
1939 PFNGLBUFFERSUBDATAPROC glad_glBufferSubData = NULL;
1940 PFNGLCHECKFRAMEBUFFERSTATUSPROC glad_glCheckFramebufferStatus = NULL;
1941 PFNGLCLEARPROC glad_glClear = NULL;
1942 PFNGLCLEARBUFFERFIPROC glad_glClearBufferfi = NULL;
1943 PFNGLCLEARBUFFERFVPROC glad_glClearBufferfv = NULL;
1944 PFNGLCLEARBUFFERIVPROC glad_glClearBufferiv = NULL;
1945 PFNGLCLEARBUFFERUIVPROC glad_glClearBufferuiv = NULL;
1946 PFNGLCLEARCOLORPROC glad_glClearColor = NULL;
1947 PFNGLCLEARDEPTHFPROC glad_glClearDepthf = NULL;
1948 PFNGLCLEARSTENCILPROC glad_glClearStencil = NULL;
1949 PFNGLCLIENTWAITSYNCPROC glad_glClientWaitSync = NULL;
1950 PFNGLCOLORMASKPROC glad_glColorMask = NULL;
1951 PFNGLCOMPILESHADERPROC glad_glCompileShader = NULL;
1952 PFNGLCOMPRESSEDTEXIMAGE2DPROC glad_glCompressedTexImage2D = NULL;
1953 PFNGLCOMPRESSEDTEXIMAGE3DPROC glad_glCompressedTexImage3D = NULL;
1954 PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glad_glCompressedTexSubImage2D = NULL;
1955 PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glad_glCompressedTexSubImage3D = NULL;
1956 PFNGLCOPYBUFFERSUBDATAPROC glad_glCopyBufferSubData = NULL;
1957 PFNGLCOPYTEXIMAGE2DPROC glad_glCopyTexImage2D = NULL;
1958 PFNGLCOPYTEXSUBIMAGE2DPROC glad_glCopyTexSubImage2D = NULL;
1959 PFNGLCOPYTEXSUBIMAGE3DPROC glad_glCopyTexSubImage3D = NULL;
1960 PFNGLCREATEPROGRAMPROC glad_glCreateProgram = NULL;
1961 PFNGLCREATESHADERPROC glad_glCreateShader = NULL;
1962 PFNGLCULLFACEPROC glad_glCullFace = NULL;
1963 PFNGLDELETEBUFFERSPROC glad_glDeleteBuffers = NULL;
1964 PFNGLDELETEFRAMEBUFFERSPROC glad_glDeleteFramebuffers = NULL;
1965 PFNGLDELETEPROGRAMPROC glad_glDeleteProgram = NULL;
1966 PFNGLDELETEQUERIESPROC glad_glDeleteQueries = NULL;
1967 PFNGLDELETERENDERBUFFERSPROC glad_glDeleteRenderbuffers = NULL;
1968 PFNGLDELETESAMPLERSPROC glad_glDeleteSamplers = NULL;
1969 PFNGLDELETESHADERPROC glad_glDeleteShader = NULL;
1970 PFNGLDELETESYNCPROC glad_glDeleteSync = NULL;
1971 PFNGLDELETETEXTURESPROC glad_glDeleteTextures = NULL;
1972 PFNGLDELETETRANSFORMFEEDBACKSPROC glad_glDeleteTransformFeedbacks = NULL;
1973 PFNGLDELETEVERTEXARRAYSPROC glad_glDeleteVertexArrays = NULL;
1974 PFNGLDEPTHFUNCPROC glad_glDepthFunc = NULL;
1975 PFNGLDEPTHMASKPROC glad_glDepthMask = NULL;
1976 PFNGLDEPTHRANGEFPROC glad_glDepthRangef = NULL;
1977 PFNGLDETACHSHADERPROC glad_glDetachShader = NULL;
1978 PFNGLDISABLEPROC glad_glDisable = NULL;
1979 PFNGLDISABLEVERTEXATTRIBARRAYPROC glad_glDisableVertexAttribArray = NULL;
1980 PFNGLDRAWARRAYSPROC glad_glDrawArrays = NULL;
1981 PFNGLDRAWARRAYSINSTANCEDPROC glad_glDrawArraysInstanced = NULL;
1982 PFNGLDRAWBUFFERSPROC glad_glDrawBuffers = NULL;
1983 PFNGLDRAWELEMENTSPROC glad_glDrawElements = NULL;
1984 PFNGLDRAWELEMENTSINSTANCEDPROC glad_glDrawElementsInstanced = NULL;
1985 PFNGLDRAWRANGEELEMENTSPROC glad_glDrawRangeElements = NULL;
1986 PFNGLENABLEPROC glad_glEnable = NULL;
1987 PFNGLENABLEVERTEXATTRIBARRAYPROC glad_glEnableVertexAttribArray = NULL;
1988 PFNGLENDQUERYPROC glad_glEndQuery = NULL;
1989 PFNGLENDTRANSFORMFEEDBACKPROC glad_glEndTransformFeedback = NULL;
1990 PFNGLFENCESYNCPROC glad_glFenceSync = NULL;
1991 PFNGLFINISHPROC glad_glFinish = NULL;
1992 PFNGLFLUSHPROC glad_glFlush = NULL;
1993 PFNGLFLUSHMAPPEDBUFFERRANGEPROC glad_glFlushMappedBufferRange = NULL;
1994 PFNGLFRAMEBUFFERRENDERBUFFERPROC glad_glFramebufferRenderbuffer = NULL;
1995 PFNGLFRAMEBUFFERTEXTURE2DPROC glad_glFramebufferTexture2D = NULL;
1996 PFNGLFRAMEBUFFERTEXTURELAYERPROC glad_glFramebufferTextureLayer = NULL;
1997 PFNGLFRONTFACEPROC glad_glFrontFace = NULL;
1998 PFNGLGENBUFFERSPROC glad_glGenBuffers = NULL;
1999 PFNGLGENFRAMEBUFFERSPROC glad_glGenFramebuffers = NULL;
2000 PFNGLGENQUERIESPROC glad_glGenQueries = NULL;
2001 PFNGLGENRENDERBUFFERSPROC glad_glGenRenderbuffers = NULL;
2002 PFNGLGENSAMPLERSPROC glad_glGenSamplers = NULL;
2003 PFNGLGENTEXTURESPROC glad_glGenTextures = NULL;
2004 PFNGLGENTRANSFORMFEEDBACKSPROC glad_glGenTransformFeedbacks = NULL;
2005 PFNGLGENVERTEXARRAYSPROC glad_glGenVertexArrays = NULL;
2006 PFNGLGENERATEMIPMAPPROC glad_glGenerateMipmap = NULL;
2007 PFNGLGETACTIVEATTRIBPROC glad_glGetActiveAttrib = NULL;
2008 PFNGLGETACTIVEUNIFORMPROC glad_glGetActiveUniform = NULL;
2009 PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC glad_glGetActiveUniformBlockName = NULL;
2010 PFNGLGETACTIVEUNIFORMBLOCKIVPROC glad_glGetActiveUniformBlockiv = NULL;
2011 PFNGLGETACTIVEUNIFORMSIVPROC glad_glGetActiveUniformsiv = NULL;
2012 PFNGLGETATTACHEDSHADERSPROC glad_glGetAttachedShaders = NULL;
2013 PFNGLGETATTRIBLOCATIONPROC glad_glGetAttribLocation = NULL;
2014 PFNGLGETBOOLEANVPROC glad_glGetBooleanv = NULL;
2015 PFNGLGETBUFFERPARAMETERI64VPROC glad_glGetBufferParameteri64v = NULL;
2016 PFNGLGETBUFFERPARAMETERIVPROC glad_glGetBufferParameteriv = NULL;
2017 PFNGLGETBUFFERPOINTERVPROC glad_glGetBufferPointerv = NULL;
2018 PFNGLGETERRORPROC glad_glGetError = NULL;
2019 PFNGLGETFLOATVPROC glad_glGetFloatv = NULL;
2020 PFNGLGETFRAGDATALOCATIONPROC glad_glGetFragDataLocation = NULL;
2021 PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetFramebufferAttachmentParameteriv = NULL;
2022 PFNGLGETINTEGER64I_VPROC glad_glGetInteger64i_v = NULL;
2023 PFNGLGETINTEGER64VPROC glad_glGetInteger64v = NULL;
2024 PFNGLGETINTEGERI_VPROC glad_glGetIntegeri_v = NULL;
2025 PFNGLGETINTEGERVPROC glad_glGetIntegerv = NULL;
2026 PFNGLGETINTERNALFORMATIVPROC glad_glGetInternalformativ = NULL;
2027 PFNGLGETPROGRAMBINARYPROC glad_glGetProgramBinary = NULL;
2028 PFNGLGETPROGRAMINFOLOGPROC glad_glGetProgramInfoLog = NULL;
2029 PFNGLGETPROGRAMIVPROC glad_glGetProgramiv = NULL;
2030 PFNGLGETQUERYOBJECTUIVPROC glad_glGetQueryObjectuiv = NULL;
2031 PFNGLGETQUERYIVPROC glad_glGetQueryiv = NULL;
2032 PFNGLGETRENDERBUFFERPARAMETERIVPROC glad_glGetRenderbufferParameteriv = NULL;
2033 PFNGLGETSAMPLERPARAMETERFVPROC glad_glGetSamplerParameterfv = NULL;
2034 PFNGLGETSAMPLERPARAMETERIVPROC glad_glGetSamplerParameteriv = NULL;
2035 PFNGLGETSHADERINFOLOGPROC glad_glGetShaderInfoLog = NULL;
2036 PFNGLGETSHADERPRECISIONFORMATPROC glad_glGetShaderPrecisionFormat = NULL;
2037 PFNGLGETSHADERSOURCEPROC glad_glGetShaderSource = NULL;
2038 PFNGLGETSHADERIVPROC glad_glGetShaderiv = NULL;
2039 PFNGLGETSTRINGPROC glad_glGetString = NULL;
2040 PFNGLGETSTRINGIPROC glad_glGetStringi = NULL;
2041 PFNGLGETSYNCIVPROC glad_glGetSynciv = NULL;
2042 PFNGLGETTEXPARAMETERFVPROC glad_glGetTexParameterfv = NULL;
2043 PFNGLGETTEXPARAMETERIVPROC glad_glGetTexParameteriv = NULL;
2044 PFNGLGETTRANSFORMFEEDBACKVARYINGPROC glad_glGetTransformFeedbackVarying = NULL;
2045 PFNGLGETUNIFORMBLOCKINDEXPROC glad_glGetUniformBlockIndex = NULL;
2046 PFNGLGETUNIFORMINDICESPROC glad_glGetUniformIndices = NULL;
2047 PFNGLGETUNIFORMLOCATIONPROC glad_glGetUniformLocation = NULL;
2048 PFNGLGETUNIFORMFVPROC glad_glGetUniformfv = NULL;
2049 PFNGLGETUNIFORMIVPROC glad_glGetUniformiv = NULL;
2050 PFNGLGETUNIFORMUIVPROC glad_glGetUniformuiv = NULL;
2051 PFNGLGETVERTEXATTRIBIIVPROC glad_glGetVertexAttribIiv = NULL;
2052 PFNGLGETVERTEXATTRIBIUIVPROC glad_glGetVertexAttribIuiv = NULL;
2053 PFNGLGETVERTEXATTRIBPOINTERVPROC glad_glGetVertexAttribPointerv = NULL;
2054 PFNGLGETVERTEXATTRIBFVPROC glad_glGetVertexAttribfv = NULL;
2055 PFNGLGETVERTEXATTRIBIVPROC glad_glGetVertexAttribiv = NULL;
2056 PFNGLHINTPROC glad_glHint = NULL;
2057 PFNGLINVALIDATEFRAMEBUFFERPROC glad_glInvalidateFramebuffer = NULL;
2058 PFNGLINVALIDATESUBFRAMEBUFFERPROC glad_glInvalidateSubFramebuffer = NULL;
2059 PFNGLISBUFFERPROC glad_glIsBuffer = NULL;
2060 PFNGLISENABLEDPROC glad_glIsEnabled = NULL;
2061 PFNGLISFRAMEBUFFERPROC glad_glIsFramebuffer = NULL;
2062 PFNGLISPROGRAMPROC glad_glIsProgram = NULL;
2063 PFNGLISQUERYPROC glad_glIsQuery = NULL;
2064 PFNGLISRENDERBUFFERPROC glad_glIsRenderbuffer = NULL;
2065 PFNGLISSAMPLERPROC glad_glIsSampler = NULL;
2066 PFNGLISSHADERPROC glad_glIsShader = NULL;
2067 PFNGLISSYNCPROC glad_glIsSync = NULL;
2068 PFNGLISTEXTUREPROC glad_glIsTexture = NULL;
2069 PFNGLISTRANSFORMFEEDBACKPROC glad_glIsTransformFeedback = NULL;
2070 PFNGLISVERTEXARRAYPROC glad_glIsVertexArray = NULL;
2071 PFNGLLINEWIDTHPROC glad_glLineWidth = NULL;
2072 PFNGLLINKPROGRAMPROC glad_glLinkProgram = NULL;
2073 PFNGLMAPBUFFERRANGEPROC glad_glMapBufferRange = NULL;
2074 PFNGLPAUSETRANSFORMFEEDBACKPROC glad_glPauseTransformFeedback = NULL;
2075 PFNGLPIXELSTOREIPROC glad_glPixelStorei = NULL;
2076 PFNGLPOLYGONOFFSETPROC glad_glPolygonOffset = NULL;
2077 PFNGLPROGRAMBINARYPROC glad_glProgramBinary = NULL;
2078 PFNGLPROGRAMPARAMETERIPROC glad_glProgramParameteri = NULL;
2079 PFNGLREADBUFFERPROC glad_glReadBuffer = NULL;
2080 PFNGLREADPIXELSPROC glad_glReadPixels = NULL;
2081 PFNGLRELEASESHADERCOMPILERPROC glad_glReleaseShaderCompiler = NULL;
2082 PFNGLRENDERBUFFERSTORAGEPROC glad_glRenderbufferStorage = NULL;
2083 PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC glad_glRenderbufferStorageMultisample = NULL;
2084 PFNGLRESUMETRANSFORMFEEDBACKPROC glad_glResumeTransformFeedback = NULL;
2085 PFNGLSAMPLECOVERAGEPROC glad_glSampleCoverage = NULL;
2086 PFNGLSAMPLERPARAMETERFPROC glad_glSamplerParameterf = NULL;
2087 PFNGLSAMPLERPARAMETERFVPROC glad_glSamplerParameterfv = NULL;
2088 PFNGLSAMPLERPARAMETERIPROC glad_glSamplerParameteri = NULL;
2089 PFNGLSAMPLERPARAMETERIVPROC glad_glSamplerParameteriv = NULL;
2090 PFNGLSCISSORPROC glad_glScissor = NULL;
2091 PFNGLSHADERBINARYPROC glad_glShaderBinary = NULL;
2092 PFNGLSHADERSOURCEPROC glad_glShaderSource = NULL;
2093 PFNGLSTENCILFUNCPROC glad_glStencilFunc = NULL;
2094 PFNGLSTENCILFUNCSEPARATEPROC glad_glStencilFuncSeparate = NULL;
2095 PFNGLSTENCILMASKPROC glad_glStencilMask = NULL;
2096 PFNGLSTENCILMASKSEPARATEPROC glad_glStencilMaskSeparate = NULL;
2097 PFNGLSTENCILOPPROC glad_glStencilOp = NULL;
2098 PFNGLSTENCILOPSEPARATEPROC glad_glStencilOpSeparate = NULL;
2099 PFNGLTEXIMAGE2DPROC glad_glTexImage2D = NULL;
2100 PFNGLTEXIMAGE3DPROC glad_glTexImage3D = NULL;
2101 PFNGLTEXPARAMETERFPROC glad_glTexParameterf = NULL;
2102 PFNGLTEXPARAMETERFVPROC glad_glTexParameterfv = NULL;
2103 PFNGLTEXPARAMETERIPROC glad_glTexParameteri = NULL;
2104 PFNGLTEXPARAMETERIVPROC glad_glTexParameteriv = NULL;
2105 PFNGLTEXSTORAGE2DPROC glad_glTexStorage2D = NULL;
2106 PFNGLTEXSTORAGE3DPROC glad_glTexStorage3D = NULL;
2107 PFNGLTEXSUBIMAGE2DPROC glad_glTexSubImage2D = NULL;
2108 PFNGLTEXSUBIMAGE3DPROC glad_glTexSubImage3D = NULL;
2109 PFNGLTRANSFORMFEEDBACKVARYINGSPROC glad_glTransformFeedbackVaryings = NULL;
2110 PFNGLUNIFORM1FPROC glad_glUniform1f = NULL;
2111 PFNGLUNIFORM1FVPROC glad_glUniform1fv = NULL;
2112 PFNGLUNIFORM1IPROC glad_glUniform1i = NULL;
2113 PFNGLUNIFORM1IVPROC glad_glUniform1iv = NULL;
2114 PFNGLUNIFORM1UIPROC glad_glUniform1ui = NULL;
2115 PFNGLUNIFORM1UIVPROC glad_glUniform1uiv = NULL;
2116 PFNGLUNIFORM2FPROC glad_glUniform2f = NULL;
2117 PFNGLUNIFORM2FVPROC glad_glUniform2fv = NULL;
2118 PFNGLUNIFORM2IPROC glad_glUniform2i = NULL;
2119 PFNGLUNIFORM2IVPROC glad_glUniform2iv = NULL;
2120 PFNGLUNIFORM2UIPROC glad_glUniform2ui = NULL;
2121 PFNGLUNIFORM2UIVPROC glad_glUniform2uiv = NULL;
2122 PFNGLUNIFORM3FPROC glad_glUniform3f = NULL;
2123 PFNGLUNIFORM3FVPROC glad_glUniform3fv = NULL;
2124 PFNGLUNIFORM3IPROC glad_glUniform3i = NULL;
2125 PFNGLUNIFORM3IVPROC glad_glUniform3iv = NULL;
2126 PFNGLUNIFORM3UIPROC glad_glUniform3ui = NULL;
2127 PFNGLUNIFORM3UIVPROC glad_glUniform3uiv = NULL;
2128 PFNGLUNIFORM4FPROC glad_glUniform4f = NULL;
2129 PFNGLUNIFORM4FVPROC glad_glUniform4fv = NULL;
2130 PFNGLUNIFORM4IPROC glad_glUniform4i = NULL;
2131 PFNGLUNIFORM4IVPROC glad_glUniform4iv = NULL;
2132 PFNGLUNIFORM4UIPROC glad_glUniform4ui = NULL;
2133 PFNGLUNIFORM4UIVPROC glad_glUniform4uiv = NULL;
2134 PFNGLUNIFORMBLOCKBINDINGPROC glad_glUniformBlockBinding = NULL;
2135 PFNGLUNIFORMMATRIX2FVPROC glad_glUniformMatrix2fv = NULL;
2136 PFNGLUNIFORMMATRIX2X3FVPROC glad_glUniformMatrix2x3fv = NULL;
2137 PFNGLUNIFORMMATRIX2X4FVPROC glad_glUniformMatrix2x4fv = NULL;
2138 PFNGLUNIFORMMATRIX3FVPROC glad_glUniformMatrix3fv = NULL;
2139 PFNGLUNIFORMMATRIX3X2FVPROC glad_glUniformMatrix3x2fv = NULL;
2140 PFNGLUNIFORMMATRIX3X4FVPROC glad_glUniformMatrix3x4fv = NULL;
2141 PFNGLUNIFORMMATRIX4FVPROC glad_glUniformMatrix4fv = NULL;
2142 PFNGLUNIFORMMATRIX4X2FVPROC glad_glUniformMatrix4x2fv = NULL;
2143 PFNGLUNIFORMMATRIX4X3FVPROC glad_glUniformMatrix4x3fv = NULL;
2144 PFNGLUNMAPBUFFERPROC glad_glUnmapBuffer = NULL;
2145 PFNGLUSEPROGRAMPROC glad_glUseProgram = NULL;
2146 PFNGLVALIDATEPROGRAMPROC glad_glValidateProgram = NULL;
2147 PFNGLVERTEXATTRIB1FPROC glad_glVertexAttrib1f = NULL;
2148 PFNGLVERTEXATTRIB1FVPROC glad_glVertexAttrib1fv = NULL;
2149 PFNGLVERTEXATTRIB2FPROC glad_glVertexAttrib2f = NULL;
2150 PFNGLVERTEXATTRIB2FVPROC glad_glVertexAttrib2fv = NULL;
2151 PFNGLVERTEXATTRIB3FPROC glad_glVertexAttrib3f = NULL;
2152 PFNGLVERTEXATTRIB3FVPROC glad_glVertexAttrib3fv = NULL;
2153 PFNGLVERTEXATTRIB4FPROC glad_glVertexAttrib4f = NULL;
2154 PFNGLVERTEXATTRIB4FVPROC glad_glVertexAttrib4fv = NULL;
2155 PFNGLVERTEXATTRIBDIVISORPROC glad_glVertexAttribDivisor = NULL;
2156 PFNGLVERTEXATTRIBI4IPROC glad_glVertexAttribI4i = NULL;
2157 PFNGLVERTEXATTRIBI4IVPROC glad_glVertexAttribI4iv = NULL;
2158 PFNGLVERTEXATTRIBI4UIPROC glad_glVertexAttribI4ui = NULL;
2159 PFNGLVERTEXATTRIBI4UIVPROC glad_glVertexAttribI4uiv = NULL;
2160 PFNGLVERTEXATTRIBIPOINTERPROC glad_glVertexAttribIPointer = NULL;
2161 PFNGLVERTEXATTRIBPOINTERPROC glad_glVertexAttribPointer = NULL;
2162 PFNGLVIEWPORTPROC glad_glViewport = NULL;
2163 PFNGLWAITSYNCPROC glad_glWaitSync = NULL;
2164
2165
2166 static void glad_gl_load_GL_ES_VERSION_2_0( GLADuserptrloadfunc load, void* userptr) {
2167 if(!GLAD_GL_ES_VERSION_2_0) return;
2168 glActiveTexture = (PFNGLACTIVETEXTUREPROC) load("glActiveTexture", userptr);
2169 glAttachShader = (PFNGLATTACHSHADERPROC) load("glAttachShader", userptr);
2170 glBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC) load("glBindAttribLocation", userptr);
2171 glBindBuffer = (PFNGLBINDBUFFERPROC) load("glBindBuffer", userptr);
2172 glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC) load("glBindFramebuffer", userptr);
2173 glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC) load("glBindRenderbuffer", userptr);
2174 glBindTexture = (PFNGLBINDTEXTUREPROC) load("glBindTexture", userptr);
2175 glBlendColor = (PFNGLBLENDCOLORPROC) load("glBlendColor", userptr);
2176 glBlendEquation = (PFNGLBLENDEQUATIONPROC) load("glBlendEquation", userptr);
2177 glBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC) load("glBlendEquationSeparate", userptr);
2178 glBlendFunc = (PFNGLBLENDFUNCPROC) load("glBlendFunc", userptr);
2179 glBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC) load("glBlendFuncSeparate", userptr);
2180 glBufferData = (PFNGLBUFFERDATAPROC) load("glBufferData", userptr);
2181 glBufferSubData = (PFNGLBUFFERSUBDATAPROC) load("glBufferSubData", userptr);
2182 glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC) load("glCheckFramebufferStatus", userptr);
2183 glClear = (PFNGLCLEARPROC) load("glClear", userptr);
2184 glClearColor = (PFNGLCLEARCOLORPROC) load("glClearColor", userptr);
2185 glClearDepthf = (PFNGLCLEARDEPTHFPROC) load("glClearDepthf", userptr);
2186 glClearStencil = (PFNGLCLEARSTENCILPROC) load("glClearStencil", userptr);
2187 glColorMask = (PFNGLCOLORMASKPROC) load("glColorMask", userptr);
2188 glCompileShader = (PFNGLCOMPILESHADERPROC) load("glCompileShader", userptr);
2189 glCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC) load("glCompressedTexImage2D", userptr);
2190 glCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) load("glCompressedTexSubImage2D", userptr);
2191 glCopyTexImage2D = (PFNGLCOPYTEXIMAGE2DPROC) load("glCopyTexImage2D", userptr);
2192 glCopyTexSubImage2D = (PFNGLCOPYTEXSUBIMAGE2DPROC) load("glCopyTexSubImage2D", userptr);
2193 glCreateProgram = (PFNGLCREATEPROGRAMPROC) load("glCreateProgram", userptr);
2194 glCreateShader = (PFNGLCREATESHADERPROC) load("glCreateShader", userptr);
2195 glCullFace = (PFNGLCULLFACEPROC) load("glCullFace", userptr);
2196 glDeleteBuffers = (PFNGLDELETEBUFFERSPROC) load("glDeleteBuffers", userptr);
2197 glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC) load("glDeleteFramebuffers", userptr);
2198 glDeleteProgram = (PFNGLDELETEPROGRAMPROC) load("glDeleteProgram", userptr);
2199 glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC) load("glDeleteRenderbuffers", userptr);
2200 glDeleteShader = (PFNGLDELETESHADERPROC) load("glDeleteShader", userptr);
2201 glDeleteTextures = (PFNGLDELETETEXTURESPROC) load("glDeleteTextures", userptr);
2202 glDepthFunc = (PFNGLDEPTHFUNCPROC) load("glDepthFunc", userptr);
2203 glDepthMask = (PFNGLDEPTHMASKPROC) load("glDepthMask", userptr);
2204 glDepthRangef = (PFNGLDEPTHRANGEFPROC) load("glDepthRangef", userptr);
2205 glDetachShader = (PFNGLDETACHSHADERPROC) load("glDetachShader", userptr);
2206 glDisable = (PFNGLDISABLEPROC) load("glDisable", userptr);
2207 glDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC) load("glDisableVertexAttribArray", userptr);
2208 glDrawArrays = (PFNGLDRAWARRAYSPROC) load("glDrawArrays", userptr);
2209 glDrawElements = (PFNGLDRAWELEMENTSPROC) load("glDrawElements", userptr);
2210 glEnable = (PFNGLENABLEPROC) load("glEnable", userptr);
2211 glEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC) load("glEnableVertexAttribArray", userptr);
2212 glFinish = (PFNGLFINISHPROC) load("glFinish", userptr);
2213 glFlush = (PFNGLFLUSHPROC) load("glFlush", userptr);
2214 glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC) load("glFramebufferRenderbuffer", userptr);
2215 glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC) load("glFramebufferTexture2D", userptr);
2216 glFrontFace = (PFNGLFRONTFACEPROC) load("glFrontFace", userptr);
2217 glGenBuffers = (PFNGLGENBUFFERSPROC) load("glGenBuffers", userptr);
2218 glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC) load("glGenFramebuffers", userptr);
2219 glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC) load("glGenRenderbuffers", userptr);
2220 glGenTextures = (PFNGLGENTEXTURESPROC) load("glGenTextures", userptr);
2221 glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC) load("glGenerateMipmap", userptr);
2222 glGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC) load("glGetActiveAttrib", userptr);
2223 glGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC) load("glGetActiveUniform", userptr);
2224 glGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC) load("glGetAttachedShaders", userptr);
2225 glGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC) load("glGetAttribLocation", userptr);
2226 glGetBooleanv = (PFNGLGETBOOLEANVPROC) load("glGetBooleanv", userptr);
2227 glGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC) load("glGetBufferParameteriv", userptr);
2228 glGetError = (PFNGLGETERRORPROC) load("glGetError", userptr);
2229 glGetFloatv = (PFNGLGETFLOATVPROC) load("glGetFloatv", userptr);
2230 glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) load("glGetFramebufferAttachmentParameteriv", userptr);
2231 glGetIntegerv = (PFNGLGETINTEGERVPROC) load("glGetIntegerv", userptr);
2232 glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC) load("glGetProgramInfoLog", userptr);
2233 glGetProgramiv = (PFNGLGETPROGRAMIVPROC) load("glGetProgramiv", userptr);
2234 glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC) load("glGetRenderbufferParameteriv", userptr);
2235 glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC) load("glGetShaderInfoLog", userptr);
2236 glGetShaderPrecisionFormat = (PFNGLGETSHADERPRECISIONFORMATPROC) load("glGetShaderPrecisionFormat", userptr);
2237 glGetShaderSource = (PFNGLGETSHADERSOURCEPROC) load("glGetShaderSource", userptr);
2238 glGetShaderiv = (PFNGLGETSHADERIVPROC) load("glGetShaderiv", userptr);
2239 glGetString = (PFNGLGETSTRINGPROC) load("glGetString", userptr);
2240 glGetTexParameterfv = (PFNGLGETTEXPARAMETERFVPROC) load("glGetTexParameterfv", userptr);
2241 glGetTexParameteriv = (PFNGLGETTEXPARAMETERIVPROC) load("glGetTexParameteriv", userptr);
2242 glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC) load("glGetUniformLocation", userptr);
2243 glGetUniformfv = (PFNGLGETUNIFORMFVPROC) load("glGetUniformfv", userptr);
2244 glGetUniformiv = (PFNGLGETUNIFORMIVPROC) load("glGetUniformiv", userptr);
2245 glGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC) load("glGetVertexAttribPointerv", userptr);
2246 glGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC) load("glGetVertexAttribfv", userptr);
2247 glGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC) load("glGetVertexAttribiv", userptr);
2248 glHint = (PFNGLHINTPROC) load("glHint", userptr);
2249 glIsBuffer = (PFNGLISBUFFERPROC) load("glIsBuffer", userptr);
2250 glIsEnabled = (PFNGLISENABLEDPROC) load("glIsEnabled", userptr);
2251 glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC) load("glIsFramebuffer", userptr);
2252 glIsProgram = (PFNGLISPROGRAMPROC) load("glIsProgram", userptr);
2253 glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC) load("glIsRenderbuffer", userptr);
2254 glIsShader = (PFNGLISSHADERPROC) load("glIsShader", userptr);
2255 glIsTexture = (PFNGLISTEXTUREPROC) load("glIsTexture", userptr);
2256 glLineWidth = (PFNGLLINEWIDTHPROC) load("glLineWidth", userptr);
2257 glLinkProgram = (PFNGLLINKPROGRAMPROC) load("glLinkProgram", userptr);
2258 glPixelStorei = (PFNGLPIXELSTOREIPROC) load("glPixelStorei", userptr);
2259 glPolygonOffset = (PFNGLPOLYGONOFFSETPROC) load("glPolygonOffset", userptr);
2260 glReadPixels = (PFNGLREADPIXELSPROC) load("glReadPixels", userptr);
2261 glReleaseShaderCompiler = (PFNGLRELEASESHADERCOMPILERPROC) load("glReleaseShaderCompiler", userptr);
2262 glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC) load("glRenderbufferStorage", userptr);
2263 glSampleCoverage = (PFNGLSAMPLECOVERAGEPROC) load("glSampleCoverage", userptr);
2264 glScissor = (PFNGLSCISSORPROC) load("glScissor", userptr);
2265 glShaderBinary = (PFNGLSHADERBINARYPROC) load("glShaderBinary", userptr);
2266 glShaderSource = (PFNGLSHADERSOURCEPROC) load("glShaderSource", userptr);
2267 glStencilFunc = (PFNGLSTENCILFUNCPROC) load("glStencilFunc", userptr);
2268 glStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC) load("glStencilFuncSeparate", userptr);
2269 glStencilMask = (PFNGLSTENCILMASKPROC) load("glStencilMask", userptr);
2270 glStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC) load("glStencilMaskSeparate", userptr);
2271 glStencilOp = (PFNGLSTENCILOPPROC) load("glStencilOp", userptr);
2272 glStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC) load("glStencilOpSeparate", userptr);
2273 glTexImage2D = (PFNGLTEXIMAGE2DPROC) load("glTexImage2D", userptr);
2274 glTexParameterf = (PFNGLTEXPARAMETERFPROC) load("glTexParameterf", userptr);
2275 glTexParameterfv = (PFNGLTEXPARAMETERFVPROC) load("glTexParameterfv", userptr);
2276 glTexParameteri = (PFNGLTEXPARAMETERIPROC) load("glTexParameteri", userptr);
2277 glTexParameteriv = (PFNGLTEXPARAMETERIVPROC) load("glTexParameteriv", userptr);
2278 glTexSubImage2D = (PFNGLTEXSUBIMAGE2DPROC) load("glTexSubImage2D", userptr);
2279 glUniform1f = (PFNGLUNIFORM1FPROC) load("glUniform1f", userptr);
2280 glUniform1fv = (PFNGLUNIFORM1FVPROC) load("glUniform1fv", userptr);
2281 glUniform1i = (PFNGLUNIFORM1IPROC) load("glUniform1i", userptr);
2282 glUniform1iv = (PFNGLUNIFORM1IVPROC) load("glUniform1iv", userptr);
2283 glUniform2f = (PFNGLUNIFORM2FPROC) load("glUniform2f", userptr);
2284 glUniform2fv = (PFNGLUNIFORM2FVPROC) load("glUniform2fv", userptr);
2285 glUniform2i = (PFNGLUNIFORM2IPROC) load("glUniform2i", userptr);
2286 glUniform2iv = (PFNGLUNIFORM2IVPROC) load("glUniform2iv", userptr);
2287 glUniform3f = (PFNGLUNIFORM3FPROC) load("glUniform3f", userptr);
2288 glUniform3fv = (PFNGLUNIFORM3FVPROC) load("glUniform3fv", userptr);
2289 glUniform3i = (PFNGLUNIFORM3IPROC) load("glUniform3i", userptr);
2290 glUniform3iv = (PFNGLUNIFORM3IVPROC) load("glUniform3iv", userptr);
2291 glUniform4f = (PFNGLUNIFORM4FPROC) load("glUniform4f", userptr);
2292 glUniform4fv = (PFNGLUNIFORM4FVPROC) load("glUniform4fv", userptr);
2293 glUniform4i = (PFNGLUNIFORM4IPROC) load("glUniform4i", userptr);
2294 glUniform4iv = (PFNGLUNIFORM4IVPROC) load("glUniform4iv", userptr);
2295 glUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC) load("glUniformMatrix2fv", userptr);
2296 glUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC) load("glUniformMatrix3fv", userptr);
2297 glUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC) load("glUniformMatrix4fv", userptr);
2298 glUseProgram = (PFNGLUSEPROGRAMPROC) load("glUseProgram", userptr);
2299 glValidateProgram = (PFNGLVALIDATEPROGRAMPROC) load("glValidateProgram", userptr);
2300 glVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC) load("glVertexAttrib1f", userptr);
2301 glVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC) load("glVertexAttrib1fv", userptr);
2302 glVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC) load("glVertexAttrib2f", userptr);
2303 glVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC) load("glVertexAttrib2fv", userptr);
2304 glVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC) load("glVertexAttrib3f", userptr);
2305 glVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC) load("glVertexAttrib3fv", userptr);
2306 glVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC) load("glVertexAttrib4f", userptr);
2307 glVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC) load("glVertexAttrib4fv", userptr);
2308 glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC) load("glVertexAttribPointer", userptr);
2309 glViewport = (PFNGLVIEWPORTPROC) load("glViewport", userptr);
2310 }
2311 static void glad_gl_load_GL_ES_VERSION_3_0( GLADuserptrloadfunc load, void* userptr) {
2312 if(!GLAD_GL_ES_VERSION_3_0) return;
2313 glBeginQuery = (PFNGLBEGINQUERYPROC) load("glBeginQuery", userptr);
2314 glBeginTransformFeedback = (PFNGLBEGINTRANSFORMFEEDBACKPROC) load("glBeginTransformFeedback", userptr);
2315 glBindBufferBase = (PFNGLBINDBUFFERBASEPROC) load("glBindBufferBase", userptr);
2316 glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC) load("glBindBufferRange", userptr);
2317 glBindSampler = (PFNGLBINDSAMPLERPROC) load("glBindSampler", userptr);
2318 glBindTransformFeedback = (PFNGLBINDTRANSFORMFEEDBACKPROC) load("glBindTransformFeedback", userptr);
2319 glBindVertexArray = (PFNGLBINDVERTEXARRAYPROC) load("glBindVertexArray", userptr);
2320 glBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC) load("glBlitFramebuffer", userptr);
2321 glClearBufferfi = (PFNGLCLEARBUFFERFIPROC) load("glClearBufferfi", userptr);
2322 glClearBufferfv = (PFNGLCLEARBUFFERFVPROC) load("glClearBufferfv", userptr);
2323 glClearBufferiv = (PFNGLCLEARBUFFERIVPROC) load("glClearBufferiv", userptr);
2324 glClearBufferuiv = (PFNGLCLEARBUFFERUIVPROC) load("glClearBufferuiv", userptr);
2325 glClientWaitSync = (PFNGLCLIENTWAITSYNCPROC) load("glClientWaitSync", userptr);
2326 glCompressedTexImage3D = (PFNGLCOMPRESSEDTEXIMAGE3DPROC) load("glCompressedTexImage3D", userptr);
2327 glCompressedTexSubImage3D = (PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) load("glCompressedTexSubImage3D", userptr);
2328 glCopyBufferSubData = (PFNGLCOPYBUFFERSUBDATAPROC) load("glCopyBufferSubData", userptr);
2329 glCopyTexSubImage3D = (PFNGLCOPYTEXSUBIMAGE3DPROC) load("glCopyTexSubImage3D", userptr);
2330 glDeleteQueries = (PFNGLDELETEQUERIESPROC) load("glDeleteQueries", userptr);
2331 glDeleteSamplers = (PFNGLDELETESAMPLERSPROC) load("glDeleteSamplers", userptr);
2332 glDeleteSync = (PFNGLDELETESYNCPROC) load("glDeleteSync", userptr);
2333 glDeleteTransformFeedbacks = (PFNGLDELETETRANSFORMFEEDBACKSPROC) load("glDeleteTransformFeedbacks", userptr);
2334 glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC) load("glDeleteVertexArrays", userptr);
2335 glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDPROC) load("glDrawArraysInstanced", userptr);
2336 glDrawBuffers = (PFNGLDRAWBUFFERSPROC) load("glDrawBuffers", userptr);
2337 glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDPROC) load("glDrawElementsInstanced", userptr);
2338 glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC) load("glDrawRangeElements", userptr);
2339 glEndQuery = (PFNGLENDQUERYPROC) load("glEndQuery", userptr);
2340 glEndTransformFeedback = (PFNGLENDTRANSFORMFEEDBACKPROC) load("glEndTransformFeedback", userptr);
2341 glFenceSync = (PFNGLFENCESYNCPROC) load("glFenceSync", userptr);
2342 glFlushMappedBufferRange = (PFNGLFLUSHMAPPEDBUFFERRANGEPROC) load("glFlushMappedBufferRange", userptr);
2343 glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC) load("glFramebufferTextureLayer", userptr);
2344 glGenQueries = (PFNGLGENQUERIESPROC) load("glGenQueries", userptr);
2345 glGenSamplers = (PFNGLGENSAMPLERSPROC) load("glGenSamplers", userptr);
2346 glGenTransformFeedbacks = (PFNGLGENTRANSFORMFEEDBACKSPROC) load("glGenTransformFeedbacks", userptr);
2347 glGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC) load("glGenVertexArrays", userptr);
2348 glGetActiveUniformBlockName = (PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) load("glGetActiveUniformBlockName", userptr);
2349 glGetActiveUniformBlockiv = (PFNGLGETACTIVEUNIFORMBLOCKIVPROC) load("glGetActiveUniformBlockiv", userptr);
2350 glGetActiveUniformsiv = (PFNGLGETACTIVEUNIFORMSIVPROC) load("glGetActiveUniformsiv", userptr);
2351 glGetBufferParameteri64v = (PFNGLGETBUFFERPARAMETERI64VPROC) load("glGetBufferParameteri64v", userptr);
2352 glGetBufferPointerv = (PFNGLGETBUFFERPOINTERVPROC) load("glGetBufferPointerv", userptr);
2353 glGetFragDataLocation = (PFNGLGETFRAGDATALOCATIONPROC) load("glGetFragDataLocation", userptr);
2354 glGetInteger64i_v = (PFNGLGETINTEGER64I_VPROC) load("glGetInteger64i_v", userptr);
2355 glGetInteger64v = (PFNGLGETINTEGER64VPROC) load("glGetInteger64v", userptr);
2356 glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC) load("glGetIntegeri_v", userptr);
2357 glGetInternalformativ = (PFNGLGETINTERNALFORMATIVPROC) load("glGetInternalformativ", userptr);
2358 glGetProgramBinary = (PFNGLGETPROGRAMBINARYPROC) load("glGetProgramBinary", userptr);
2359 glGetQueryObjectuiv = (PFNGLGETQUERYOBJECTUIVPROC) load("glGetQueryObjectuiv", userptr);
2360 glGetQueryiv = (PFNGLGETQUERYIVPROC) load("glGetQueryiv", userptr);
2361 glGetSamplerParameterfv = (PFNGLGETSAMPLERPARAMETERFVPROC) load("glGetSamplerParameterfv", userptr);
2362 glGetSamplerParameteriv = (PFNGLGETSAMPLERPARAMETERIVPROC) load("glGetSamplerParameteriv", userptr);
2363 glGetStringi = (PFNGLGETSTRINGIPROC) load("glGetStringi", userptr);
2364 glGetSynciv = (PFNGLGETSYNCIVPROC) load("glGetSynciv", userptr);
2365 glGetTransformFeedbackVarying = (PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) load("glGetTransformFeedbackVarying", userptr);
2366 glGetUniformBlockIndex = (PFNGLGETUNIFORMBLOCKINDEXPROC) load("glGetUniformBlockIndex", userptr);
2367 glGetUniformIndices = (PFNGLGETUNIFORMINDICESPROC) load("glGetUniformIndices", userptr);
2368 glGetUniformuiv = (PFNGLGETUNIFORMUIVPROC) load("glGetUniformuiv", userptr);
2369 glGetVertexAttribIiv = (PFNGLGETVERTEXATTRIBIIVPROC) load("glGetVertexAttribIiv", userptr);
2370 glGetVertexAttribIuiv = (PFNGLGETVERTEXATTRIBIUIVPROC) load("glGetVertexAttribIuiv", userptr);
2371 glInvalidateFramebuffer = (PFNGLINVALIDATEFRAMEBUFFERPROC) load("glInvalidateFramebuffer", userptr);
2372 glInvalidateSubFramebuffer = (PFNGLINVALIDATESUBFRAMEBUFFERPROC) load("glInvalidateSubFramebuffer", userptr);
2373 glIsQuery = (PFNGLISQUERYPROC) load("glIsQuery", userptr);
2374 glIsSampler = (PFNGLISSAMPLERPROC) load("glIsSampler", userptr);
2375 glIsSync = (PFNGLISSYNCPROC) load("glIsSync", userptr);
2376 glIsTransformFeedback = (PFNGLISTRANSFORMFEEDBACKPROC) load("glIsTransformFeedback", userptr);
2377 glIsVertexArray = (PFNGLISVERTEXARRAYPROC) load("glIsVertexArray", userptr);
2378 glMapBufferRange = (PFNGLMAPBUFFERRANGEPROC) load("glMapBufferRange", userptr);
2379 glPauseTransformFeedback = (PFNGLPAUSETRANSFORMFEEDBACKPROC) load("glPauseTransformFeedback", userptr);
2380 glProgramBinary = (PFNGLPROGRAMBINARYPROC) load("glProgramBinary", userptr);
2381 glProgramParameteri = (PFNGLPROGRAMPARAMETERIPROC) load("glProgramParameteri", userptr);
2382 glReadBuffer = (PFNGLREADBUFFERPROC) load("glReadBuffer", userptr);
2383 glRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) load("glRenderbufferStorageMultisample", userptr);
2384 glResumeTransformFeedback = (PFNGLRESUMETRANSFORMFEEDBACKPROC) load("glResumeTransformFeedback", userptr);
2385 glSamplerParameterf = (PFNGLSAMPLERPARAMETERFPROC) load("glSamplerParameterf", userptr);
2386 glSamplerParameterfv = (PFNGLSAMPLERPARAMETERFVPROC) load("glSamplerParameterfv", userptr);
2387 glSamplerParameteri = (PFNGLSAMPLERPARAMETERIPROC) load("glSamplerParameteri", userptr);
2388 glSamplerParameteriv = (PFNGLSAMPLERPARAMETERIVPROC) load("glSamplerParameteriv", userptr);
2389 glTexImage3D = (PFNGLTEXIMAGE3DPROC) load("glTexImage3D", userptr);
2390 glTexStorage2D = (PFNGLTEXSTORAGE2DPROC) load("glTexStorage2D", userptr);
2391 glTexStorage3D = (PFNGLTEXSTORAGE3DPROC) load("glTexStorage3D", userptr);
2392 glTexSubImage3D = (PFNGLTEXSUBIMAGE3DPROC) load("glTexSubImage3D", userptr);
2393 glTransformFeedbackVaryings = (PFNGLTRANSFORMFEEDBACKVARYINGSPROC) load("glTransformFeedbackVaryings", userptr);
2394 glUniform1ui = (PFNGLUNIFORM1UIPROC) load("glUniform1ui", userptr);
2395 glUniform1uiv = (PFNGLUNIFORM1UIVPROC) load("glUniform1uiv", userptr);
2396 glUniform2ui = (PFNGLUNIFORM2UIPROC) load("glUniform2ui", userptr);
2397 glUniform2uiv = (PFNGLUNIFORM2UIVPROC) load("glUniform2uiv", userptr);
2398 glUniform3ui = (PFNGLUNIFORM3UIPROC) load("glUniform3ui", userptr);
2399 glUniform3uiv = (PFNGLUNIFORM3UIVPROC) load("glUniform3uiv", userptr);
2400 glUniform4ui = (PFNGLUNIFORM4UIPROC) load("glUniform4ui", userptr);
2401 glUniform4uiv = (PFNGLUNIFORM4UIVPROC) load("glUniform4uiv", userptr);
2402 glUniformBlockBinding = (PFNGLUNIFORMBLOCKBINDINGPROC) load("glUniformBlockBinding", userptr);
2403 glUniformMatrix2x3fv = (PFNGLUNIFORMMATRIX2X3FVPROC) load("glUniformMatrix2x3fv", userptr);
2404 glUniformMatrix2x4fv = (PFNGLUNIFORMMATRIX2X4FVPROC) load("glUniformMatrix2x4fv", userptr);
2405 glUniformMatrix3x2fv = (PFNGLUNIFORMMATRIX3X2FVPROC) load("glUniformMatrix3x2fv", userptr);
2406 glUniformMatrix3x4fv = (PFNGLUNIFORMMATRIX3X4FVPROC) load("glUniformMatrix3x4fv", userptr);
2407 glUniformMatrix4x2fv = (PFNGLUNIFORMMATRIX4X2FVPROC) load("glUniformMatrix4x2fv", userptr);
2408 glUniformMatrix4x3fv = (PFNGLUNIFORMMATRIX4X3FVPROC) load("glUniformMatrix4x3fv", userptr);
2409 glUnmapBuffer = (PFNGLUNMAPBUFFERPROC) load("glUnmapBuffer", userptr);
2410 glVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISORPROC) load("glVertexAttribDivisor", userptr);
2411 glVertexAttribI4i = (PFNGLVERTEXATTRIBI4IPROC) load("glVertexAttribI4i", userptr);
2412 glVertexAttribI4iv = (PFNGLVERTEXATTRIBI4IVPROC) load("glVertexAttribI4iv", userptr);
2413 glVertexAttribI4ui = (PFNGLVERTEXATTRIBI4UIPROC) load("glVertexAttribI4ui", userptr);
2414 glVertexAttribI4uiv = (PFNGLVERTEXATTRIBI4UIVPROC) load("glVertexAttribI4uiv", userptr);
2415 glVertexAttribIPointer = (PFNGLVERTEXATTRIBIPOINTERPROC) load("glVertexAttribIPointer", userptr);
2416 glWaitSync = (PFNGLWAITSYNCPROC) load("glWaitSync", userptr);
2417 }
2418
2419
2420
2421 #if defined(GL_ES_VERSION_3_0) || defined(GL_VERSION_3_0)
2422 #define GLAD_GL_IS_SOME_NEW_VERSION 1
2423 #else
2424 #define GLAD_GL_IS_SOME_NEW_VERSION 0
2425 #endif
2426
2427 static int glad_gl_get_extensions( int version, const char **out_exts, unsigned int *out_num_exts_i, char ***out_exts_i) {
2428 #if GLAD_GL_IS_SOME_NEW_VERSION
2429 if(GLAD_VERSION_MAJOR(version) < 3) {
2430 #else
2431 (void) version;
2432 (void) out_num_exts_i;
2433 (void) out_exts_i;
2434 #endif
2435 if (glGetString == NULL) {
2436 return 0;
2437 }
2438 *out_exts = (const char *)glGetString(GL_EXTENSIONS);
2439 #if GLAD_GL_IS_SOME_NEW_VERSION
2440 } else {
2441 unsigned int index = 0;
2442 unsigned int num_exts_i = 0;
2443 char **exts_i = NULL;
2444 if (glGetStringi == NULL || glGetIntegerv == NULL) {
2445 return 0;
2446 }
2447 glGetIntegerv(GL_NUM_EXTENSIONS, (int*) &num_exts_i);
2448 if (num_exts_i > 0) {
2449 exts_i = (char **) malloc(num_exts_i * (sizeof *exts_i));
2450 }
2451 if (exts_i == NULL) {
2452 return 0;
2453 }
2454 for(index = 0; index < num_exts_i; index++) {
2455 const char *gl_str_tmp = (const char*) glGetStringi(GL_EXTENSIONS, index);
2456 size_t len = strlen(gl_str_tmp) + 1;
2457
2458 char *local_str = (char*) malloc(len * sizeof(char));
2459 if(local_str != NULL) {
2460 memcpy(local_str, gl_str_tmp, len * sizeof(char));
2461 }
2462
2463 exts_i[index] = local_str;
2464 }
2465
2466 *out_num_exts_i = num_exts_i;
2467 *out_exts_i = exts_i;
2468 }
2469 #endif
2470 return 1;
2471 }
2472 static void glad_gl_free_extensions(char **exts_i, unsigned int num_exts_i) {
2473 if (exts_i != NULL) {
2474 unsigned int index;
2475 for(index = 0; index < num_exts_i; index++) {
2476 free((void *) (exts_i[index]));
2477 }
2478 free((void *)exts_i);
2479 exts_i = NULL;
2480 }
2481 }
2482 static int glad_gl_has_extension(int version, const char *exts, unsigned int num_exts_i, char **exts_i, const char *ext) {
2483 if(GLAD_VERSION_MAJOR(version) < 3 || !GLAD_GL_IS_SOME_NEW_VERSION) {
2484 const char *extensions;
2485 const char *loc;
2486 const char *terminator;
2487 extensions = exts;
2488 if(extensions == NULL || ext == NULL) {
2489 return 0;
2490 }
2491 while(1) {
2492 loc = strstr(extensions, ext);
2493 if(loc == NULL) {
2494 return 0;
2495 }
2496 terminator = loc + strlen(ext);
2497 if((loc == extensions || *(loc - 1) == ' ') &&
2498 (*terminator == ' ' || *terminator == '\0')) {
2499 return 1;
2500 }
2501 extensions = terminator;
2502 }
2503 } else {
2504 unsigned int index;
2505 for(index = 0; index < num_exts_i; index++) {
2506 const char *e = exts_i[index];
2507 if(strcmp(e, ext) == 0) {
2508 return 1;
2509 }
2510 }
2511 }
2512 return 0;
2513 }
2514
2515 static GLADapiproc glad_gl_get_proc_from_userptr(const char* name, void *userptr) {
2516 return (GLAD_GNUC_EXTENSION (GLADapiproc (*)(const char *name)) userptr)(name);
2517 }
2518
2519 static int glad_gl_find_extensions_gles2( int version) {
2520 const char *exts = NULL;
2521 unsigned int num_exts_i = 0;
2522 char **exts_i = NULL;
2523 if (!glad_gl_get_extensions(version, &exts, &num_exts_i, &exts_i)) return 0;
2524
2525 (void) glad_gl_has_extension;
2526
2527 glad_gl_free_extensions(exts_i, num_exts_i);
2528
2529 return 1;
2530 }
2531
2532 static int glad_gl_find_core_gles2(void) {
2533 int i, major, minor;
2534 const char* version;
2535 const char* prefixes[] = {
2536 "OpenGL ES-CM ",
2537 "OpenGL ES-CL ",
2538 "OpenGL ES ",
2539 NULL
2540 };
2541 version = (const char*) glGetString(GL_VERSION);
2542 if (!version) return 0;
2543 for (i = 0; prefixes[i]; i++) {
2544 const size_t length = strlen(prefixes[i]);
2545 if (strncmp(version, prefixes[i], length) == 0) {
2546 version += length;
2547 break;
2548 }
2549 }
2550
2551 GLAD_IMPL_UTIL_SSCANF(version, "%d.%d", &major, &minor);
2552
2553 GLAD_GL_ES_VERSION_2_0 = (major == 2 && minor >= 0) || major > 2;
2554 GLAD_GL_ES_VERSION_3_0 = (major == 3 && minor >= 0) || major > 3;
2555
2556 return GLAD_MAKE_VERSION(major, minor);
2557 }
2558
2559 int gladLoadGLES2UserPtr( GLADuserptrloadfunc load, void *userptr) {
2560 int version;
2561
2562 glGetString = (PFNGLGETSTRINGPROC) load("glGetString", userptr);
2563 if(glGetString == NULL) return 0;
2564 if(glGetString(GL_VERSION) == NULL) return 0;
2565 version = glad_gl_find_core_gles2();
2566
2567 glad_gl_load_GL_ES_VERSION_2_0(load, userptr);
2568 glad_gl_load_GL_ES_VERSION_3_0(load, userptr);
2569
2570 if (!glad_gl_find_extensions_gles2(version)) return 0;
2571
2572
2573
2574 return version;
2575 }
2576
2577
2578 int gladLoadGLES2( GLADloadfunc load) {
2579 return gladLoadGLES2UserPtr( glad_gl_get_proc_from_userptr, GLAD_GNUC_EXTENSION (void*) load);
2580 }
2581
2582
2583
2584
2585
2586 #endif /* GLAD_GLES2_IMPLEMENTATION */
2587
File include/fg3/linalg.h added (mode: 100644) (index 0000000..aff292a)
1 // linalg.h - 2.2-beta - Single-header public domain linear algebra library
2 //
3 // The intent of this library is to provide the bulk of the functionality
4 // you need to write programs that frequently use small, fixed-size vectors
5 // and matrices, in domains such as computational geometry or computer
6 // graphics. It strives for terse, readable source code.
7 //
8 // The original author of this software is Sterling Orsten, and its permanent
9 // home is <http://github.com/sgorsten/linalg/>. If you find this software
10 // useful, an acknowledgement in your source text and/or product documentation
11 // is appreciated, but not required.
12 //
13 // The author acknowledges significant insights and contributions by:
14 // Stan Melax <http://github.com/melax/>
15 // Dimitri Diakopoulos <http://github.com/ddiakopoulos/>
16 //
17 // Some features are deprecated. Define LINALG_FORWARD_COMPATIBLE to remove them.
18
19
20
21 // This is free and unencumbered software released into the public domain.
22 //
23 // Anyone is free to copy, modify, publish, use, compile, sell, or
24 // distribute this software, either in source code form or as a compiled
25 // binary, for any purpose, commercial or non-commercial, and by any
26 // means.
27 //
28 // In jurisdictions that recognize copyright laws, the author or authors
29 // of this software dedicate any and all copyright interest in the
30 // software to the public domain. We make this dedication for the benefit
31 // of the public at large and to the detriment of our heirs and
32 // successors. We intend this dedication to be an overt act of
33 // relinquishment in perpetuity of all present and future rights to this
34 // software under copyright law.
35 //
36 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
37 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
38 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
39 // IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
40 // OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
41 // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
42 // OTHER DEALINGS IN THE SOFTWARE.
43 //
44 // For more information, please refer to <http://unlicense.org/>
45
46
47
48 #pragma once
49 #ifndef LINALG_H
50 #define LINALG_H
51
52 #include <cmath> // For various unary math functions, such as std::sqrt
53 #include <cstdlib> // To resolve std::abs ambiguity on clang
54 #include <cstdint> // For implementing namespace linalg::aliases
55 #include <array> // For std::array
56 #include <iosfwd> // For forward definitions of std::ostream
57 #include <type_traits> // For std::enable_if, std::is_same, std::declval
58 #include <functional> // For std::hash declaration
59
60 // In Visual Studio 2015, `constexpr` applied to a member function implies `const`, which causes ambiguous overload resolution
61 #if _MSC_VER <= 1900
62 #define LINALG_CONSTEXPR14
63 #else
64 #define LINALG_CONSTEXPR14 constexpr
65 #endif
66
67 namespace linalg
68 {
69 // Small, fixed-length vector type, consisting of exactly M elements of type T, and presumed to be a column-vector unless otherwise noted.
70 template<class T, int M> struct vec;
71
72 // Small, fixed-size matrix type, consisting of exactly M rows and N columns of type T, stored in column-major order.
73 template<class T, int M, int N> struct mat;
74
75 // Specialize converter<T,U> with a function application operator that converts type U to type T to enable implicit conversions
76 template<class T, class U> struct converter {};
77 namespace detail
78 {
79 template<class T, class U> using conv_t = typename std::enable_if<!std::is_same<T,U>::value, decltype(converter<T,U>{}(std::declval<U>()))>::type;
80
81 // Trait for retrieving scalar type of any linear algebra object
82 template<class A> struct scalar_type {};
83 template<class T, int M > struct scalar_type<vec<T,M >> { using type = T; };
84 template<class T, int M, int N> struct scalar_type<mat<T,M,N>> { using type = T; };
85
86 // Type returned by the compare(...) function which supports all six comparison operators against 0
87 template<class T> struct ord { T a,b; };
88 template<class T> constexpr bool operator == (const ord<T> & o, std::nullptr_t) { return o.a == o.b; }
89 template<class T> constexpr bool operator != (const ord<T> & o, std::nullptr_t) { return !(o.a == o.b); }
90 template<class T> constexpr bool operator < (const ord<T> & o, std::nullptr_t) { return o.a < o.b; }
91 template<class T> constexpr bool operator > (const ord<T> & o, std::nullptr_t) { return o.b < o.a; }
92 template<class T> constexpr bool operator <= (const ord<T> & o, std::nullptr_t) { return !(o.b < o.a); }
93 template<class T> constexpr bool operator >= (const ord<T> & o, std::nullptr_t) { return !(o.a < o.b); }
94
95 // Patterns which can be used with the compare(...) function
96 template<class A, class B> struct any_compare {};
97 template<class T> struct any_compare<vec<T,1>,vec<T,1>> { using type=ord<T>; constexpr ord<T> operator() (const vec<T,1> & a, const vec<T,1> & b) const { return ord<T>{a.x,b.x}; } };
98 template<class T> struct any_compare<vec<T,2>,vec<T,2>> { using type=ord<T>; constexpr ord<T> operator() (const vec<T,2> & a, const vec<T,2> & b) const { return !(a.x==b.x) ? ord<T>{a.x,b.x} : ord<T>{a.y,b.y}; } };
99 template<class T> struct any_compare<vec<T,3>,vec<T,3>> { using type=ord<T>; constexpr ord<T> operator() (const vec<T,3> & a, const vec<T,3> & b) const { return !(a.x==b.x) ? ord<T>{a.x,b.x} : !(a.y==b.y) ? ord<T>{a.y,b.y} : ord<T>{a.z,b.z}; } };
100 template<class T> struct any_compare<vec<T,4>,vec<T,4>> { using type=ord<T>; constexpr ord<T> operator() (const vec<T,4> & a, const vec<T,4> & b) const { return !(a.x==b.x) ? ord<T>{a.x,b.x} : !(a.y==b.y) ? ord<T>{a.y,b.y} : !(a.z==b.z) ? ord<T>{a.z,b.z} : ord<T>{a.w,b.w}; } };
101 template<class T, int M> struct any_compare<mat<T,M,1>,mat<T,M,1>> { using type=ord<T>; constexpr ord<T> operator() (const mat<T,M,1> & a, const mat<T,M,1> & b) const { return compare(a.x,b.x); } };
102 template<class T, int M> struct any_compare<mat<T,M,2>,mat<T,M,2>> { using type=ord<T>; constexpr ord<T> operator() (const mat<T,M,2> & a, const mat<T,M,2> & b) const { return a.x!=b.x ? compare(a.x,b.x) : compare(a.y,b.y); } };
103 template<class T, int M> struct any_compare<mat<T,M,3>,mat<T,M,3>> { using type=ord<T>; constexpr ord<T> operator() (const mat<T,M,3> & a, const mat<T,M,3> & b) const { return a.x!=b.x ? compare(a.x,b.x) : a.y!=b.y ? compare(a.y,b.y) : compare(a.z,b.z); } };
104 template<class T, int M> struct any_compare<mat<T,M,4>,mat<T,M,4>> { using type=ord<T>; constexpr ord<T> operator() (const mat<T,M,4> & a, const mat<T,M,4> & b) const { return a.x!=b.x ? compare(a.x,b.x) : a.y!=b.y ? compare(a.y,b.y) : a.z!=b.z ? compare(a.z,b.z) : compare(a.w,b.w); } };
105
106 // Helper for compile-time index-based access to members of vector and matrix types
107 template<int I> struct getter;
108 template<> struct getter<0> { template<class A> constexpr auto operator() (A & a) const -> decltype(a.x) { return a.x; } };
109 template<> struct getter<1> { template<class A> constexpr auto operator() (A & a) const -> decltype(a.y) { return a.y; } };
110 template<> struct getter<2> { template<class A> constexpr auto operator() (A & a) const -> decltype(a.z) { return a.z; } };
111 template<> struct getter<3> { template<class A> constexpr auto operator() (A & a) const -> decltype(a.w) { return a.w; } };
112
113 // Stand-in for std::integer_sequence/std::make_integer_sequence
114 template<int... I> struct seq {};
115 template<int A, int N> struct make_seq_impl;
116 template<int A> struct make_seq_impl<A,0> { using type=seq<>; };
117 template<int A> struct make_seq_impl<A,1> { using type=seq<A+0>; };
118 template<int A> struct make_seq_impl<A,2> { using type=seq<A+0,A+1>; };
119 template<int A> struct make_seq_impl<A,3> { using type=seq<A+0,A+1,A+2>; };
120 template<int A> struct make_seq_impl<A,4> { using type=seq<A+0,A+1,A+2,A+3>; };
121 template<int A, int B> using make_seq = typename make_seq_impl<A,B-A>::type;
122 template<class T, int M, int... I> vec<T,sizeof...(I)> constexpr swizzle(const vec<T,M> & v, seq<I...> i) { return {getter<I>{}(v)...}; }
123 template<class T, int M, int N, int... I, int... J> mat<T,sizeof...(I),sizeof...(J)> constexpr swizzle(const mat<T,M,N> & m, seq<I...> i, seq<J...> j) { return {swizzle(getter<J>{}(m),i)...}; }
124
125 // SFINAE helpers to determine result of function application
126 template<class F, class... T> using ret_t = decltype(std::declval<F>()(std::declval<T>()...));
127
128 // SFINAE helper which is defined if all provided types are scalars
129 struct empty {};
130 template<class... T> struct scalars;
131 template<> struct scalars<> { using type=void; };
132 template<class T, class... U> struct scalars<T,U...> : std::conditional<std::is_arithmetic<T>::value, scalars<U...>, empty>::type {};
133 template<class... T> using scalars_t = typename scalars<T...>::type;
134
135 // Helpers which indicate how apply(F, ...) should be called for various arguments
136 template<class F, class Void, class... T> struct apply {}; // Patterns which contain only vectors or scalars
137 template<class F, int M, class A > struct apply<F, scalars_t< >, vec<A,M> > { using type=vec<ret_t<F,A >,M>; enum {size=M, mm=0}; template<int... I> static constexpr type impl(seq<I...>, F f, const vec<A,M> & a ) { return {f(getter<I>{}(a) )...}; } };
138 template<class F, int M, class A, class B > struct apply<F, scalars_t< >, vec<A,M>, vec<B,M> > { using type=vec<ret_t<F,A,B >,M>; enum {size=M, mm=0}; template<int... I> static constexpr type impl(seq<I...>, F f, const vec<A,M> & a, const vec<B,M> & b ) { return {f(getter<I>{}(a), getter<I>{}(b) )...}; } };
139 template<class F, int M, class A, class B > struct apply<F, scalars_t<B >, vec<A,M>, B > { using type=vec<ret_t<F,A,B >,M>; enum {size=M, mm=0}; template<int... I> static constexpr type impl(seq<I...>, F f, const vec<A,M> & a, B b ) { return {f(getter<I>{}(a), b )...}; } };
140 template<class F, int M, class A, class B > struct apply<F, scalars_t<A >, A, vec<B,M> > { using type=vec<ret_t<F,A,B >,M>; enum {size=M, mm=0}; template<int... I> static constexpr type impl(seq<I...>, F f, A a, const vec<B,M> & b ) { return {f(a, getter<I>{}(b) )...}; } };
141 template<class F, int M, class A, class B, class C> struct apply<F, scalars_t< >, vec<A,M>, vec<B,M>, vec<C,M>> { using type=vec<ret_t<F,A,B,C>,M>; enum {size=M, mm=0}; template<int... I> static constexpr type impl(seq<I...>, F f, const vec<A,M> & a, const vec<B,M> & b, const vec<C,M> & c) { return {f(getter<I>{}(a), getter<I>{}(b), getter<I>{}(c))...}; } };
142 template<class F, int M, class A, class B, class C> struct apply<F, scalars_t<C >, vec<A,M>, vec<B,M>, C > { using type=vec<ret_t<F,A,B,C>,M>; enum {size=M, mm=0}; template<int... I> static constexpr type impl(seq<I...>, F f, const vec<A,M> & a, const vec<B,M> & b, C c) { return {f(getter<I>{}(a), getter<I>{}(b), c )...}; } };
143 template<class F, int M, class A, class B, class C> struct apply<F, scalars_t<B >, vec<A,M>, B, vec<C,M>> { using type=vec<ret_t<F,A,B,C>,M>; enum {size=M, mm=0}; template<int... I> static constexpr type impl(seq<I...>, F f, const vec<A,M> & a, B b, const vec<C,M> & c) { return {f(getter<I>{}(a), b, getter<I>{}(c))...}; } };
144 template<class F, int M, class A, class B, class C> struct apply<F, scalars_t<B,C>, vec<A,M>, B, C > { using type=vec<ret_t<F,A,B,C>,M>; enum {size=M, mm=0}; template<int... I> static constexpr type impl(seq<I...>, F f, const vec<A,M> & a, B b, C c) { return {f(getter<I>{}(a), b, c )...}; } };
145 template<class F, int M, class A, class B, class C> struct apply<F, scalars_t<A >, A, vec<B,M>, vec<C,M>> { using type=vec<ret_t<F,A,B,C>,M>; enum {size=M, mm=0}; template<int... I> static constexpr type impl(seq<I...>, F f, A a, const vec<B,M> & b, const vec<C,M> & c) { return {f(a, getter<I>{}(b), getter<I>{}(c))...}; } };
146 template<class F, int M, class A, class B, class C> struct apply<F, scalars_t<A,C>, A, vec<B,M>, C > { using type=vec<ret_t<F,A,B,C>,M>; enum {size=M, mm=0}; template<int... I> static constexpr type impl(seq<I...>, F f, A a, const vec<B,M> & b, C c) { return {f(a, getter<I>{}(b), c )...}; } };
147 template<class F, int M, class A, class B, class C> struct apply<F, scalars_t<A,B>, A, B, vec<C,M>> { using type=vec<ret_t<F,A,B,C>,M>; enum {size=M, mm=0}; template<int... I> static constexpr type impl(seq<I...>, F f, A a, B b, const vec<C,M> & c) { return {f(a, b, getter<I>{}(c))...}; } };
148 template<class F, int M, int N, class A > struct apply<F, scalars_t< >, mat<A,M,N> > { using type=mat<ret_t<F,A >,M,N>; enum {size=N, mm=0}; template<int... J> static constexpr type impl(seq<J...>, F f, const mat<A,M,N> & a ) { return {apply<F, void, vec<A,M> >::impl(make_seq<0,M>{}, f, getter<J>{}(a) )...}; } };
149 template<class F, int M, int N, class A, class B> struct apply<F, scalars_t< >, mat<A,M,N>, mat<B,M,N>> { using type=mat<ret_t<F,A,B>,M,N>; enum {size=N, mm=1}; template<int... J> static constexpr type impl(seq<J...>, F f, const mat<A,M,N> & a, const mat<B,M,N> & b) { return {apply<F, void, vec<A,M>, vec<B,M>>::impl(make_seq<0,M>{}, f, getter<J>{}(a), getter<J>{}(b))...}; } };
150 template<class F, int M, int N, class A, class B> struct apply<F, scalars_t<B>, mat<A,M,N>, B > { using type=mat<ret_t<F,A,B>,M,N>; enum {size=N, mm=0}; template<int... J> static constexpr type impl(seq<J...>, F f, const mat<A,M,N> & a, B b) { return {apply<F, void, vec<A,M>, B >::impl(make_seq<0,M>{}, f, getter<J>{}(a), b )...}; } };
151 template<class F, int M, int N, class A, class B> struct apply<F, scalars_t<A>, A, mat<B,M,N>> { using type=mat<ret_t<F,A,B>,M,N>; enum {size=N, mm=0}; template<int... J> static constexpr type impl(seq<J...>, F f, A a, const mat<B,M,N> & b) { return {apply<F, void, A, vec<B,M>>::impl(make_seq<0,M>{}, f, a, getter<J>{}(b))...}; } };
152 template<class F, class... A> struct apply<F, scalars_t<A...>, A...> { using type = ret_t<F,A...>; enum {size=0, mm=0}; static constexpr type impl(seq<>, F f, A... a) { return f(a...); } };
153
154 // Function objects for selecting between alternatives
155 struct min { template<class A, class B> constexpr auto operator() (A a, B b) const -> typename std::remove_reference<decltype(a<b ? a : b)>::type { return a<b ? a : b; } };
156 struct max { template<class A, class B> constexpr auto operator() (A a, B b) const -> typename std::remove_reference<decltype(a<b ? b : a)>::type { return a<b ? b : a; } };
157 struct clamp { template<class A, class B, class C> constexpr auto operator() (A a, B b, C c) const -> typename std::remove_reference<decltype(a<b ? b : a<c ? a : c)>::type { return a<b ? b : a<c ? a : c; } };
158 struct select { template<class A, class B, class C> constexpr auto operator() (A a, B b, C c) const -> typename std::remove_reference<decltype(a ? b : c)>::type { return a ? b : c; } };
159 struct lerp { template<class A, class B, class C> constexpr auto operator() (A a, B b, C c) const -> decltype(a*(1-c) + b*c) { return a*(1-c) + b*c; } };
160
161 // Function objects for applying operators
162 struct op_pos { template<class A> constexpr auto operator() (A a) const -> decltype(+a) { return +a; } };
163 struct op_neg { template<class A> constexpr auto operator() (A a) const -> decltype(-a) { return -a; } };
164 struct op_not { template<class A> constexpr auto operator() (A a) const -> decltype(!a) { return !a; } };
165 struct op_cmp { template<class A> constexpr auto operator() (A a) const -> decltype(~(a)) { return ~a; } };
166 struct op_mul { template<class A, class B> constexpr auto operator() (A a, B b) const -> decltype(a * b) { return a * b; } };
167 struct op_div { template<class A, class B> constexpr auto operator() (A a, B b) const -> decltype(a / b) { return a / b; } };
168 struct op_mod { template<class A, class B> constexpr auto operator() (A a, B b) const -> decltype(a % b) { return a % b; } };
169 struct op_add { template<class A, class B> constexpr auto operator() (A a, B b) const -> decltype(a + b) { return a + b; } };
170 struct op_sub { template<class A, class B> constexpr auto operator() (A a, B b) const -> decltype(a - b) { return a - b; } };
171 struct op_lsh { template<class A, class B> constexpr auto operator() (A a, B b) const -> decltype(a << b) { return a << b; } };
172 struct op_rsh { template<class A, class B> constexpr auto operator() (A a, B b) const -> decltype(a >> b) { return a >> b; } };
173 struct op_lt { template<class A, class B> constexpr auto operator() (A a, B b) const -> decltype(a < b) { return a < b; } };
174 struct op_gt { template<class A, class B> constexpr auto operator() (A a, B b) const -> decltype(a > b) { return a > b; } };
175 struct op_le { template<class A, class B> constexpr auto operator() (A a, B b) const -> decltype(a <= b) { return a <= b; } };
176 struct op_ge { template<class A, class B> constexpr auto operator() (A a, B b) const -> decltype(a >= b) { return a >= b; } };
177 struct op_eq { template<class A, class B> constexpr auto operator() (A a, B b) const -> decltype(a == b) { return a == b; } };
178 struct op_ne { template<class A, class B> constexpr auto operator() (A a, B b) const -> decltype(a != b) { return a != b; } };
179 struct op_int { template<class A, class B> constexpr auto operator() (A a, B b) const -> decltype(a & b) { return a & b; } };
180 struct op_xor { template<class A, class B> constexpr auto operator() (A a, B b) const -> decltype(a ^ b) { return a ^ b; } };
181 struct op_un { template<class A, class B> constexpr auto operator() (A a, B b) const -> decltype(a | b) { return a | b; } };
182 struct op_and { template<class A, class B> constexpr auto operator() (A a, B b) const -> decltype(a && b) { return a && b; } };
183 struct op_or { template<class A, class B> constexpr auto operator() (A a, B b) const -> decltype(a || b) { return a || b; } };
184
185 // Function objects for applying standard library math functions
186 struct std_abs { template<class A> auto operator() (A a) const -> decltype(std::abs (a)) { return std::abs (a); } };
187 struct std_floor { template<class A> auto operator() (A a) const -> decltype(std::floor(a)) { return std::floor(a); } };
188 struct std_ceil { template<class A> auto operator() (A a) const -> decltype(std::ceil (a)) { return std::ceil (a); } };
189 struct std_exp { template<class A> auto operator() (A a) const -> decltype(std::exp (a)) { return std::exp (a); } };
190 struct std_log { template<class A> auto operator() (A a) const -> decltype(std::log (a)) { return std::log (a); } };
191 struct std_log10 { template<class A> auto operator() (A a) const -> decltype(std::log10(a)) { return std::log10(a); } };
192 struct std_sqrt { template<class A> auto operator() (A a) const -> decltype(std::sqrt (a)) { return std::sqrt (a); } };
193 struct std_sin { template<class A> auto operator() (A a) const -> decltype(std::sin (a)) { return std::sin (a); } };
194 struct std_cos { template<class A> auto operator() (A a) const -> decltype(std::cos (a)) { return std::cos (a); } };
195 struct std_tan { template<class A> auto operator() (A a) const -> decltype(std::tan (a)) { return std::tan (a); } };
196 struct std_asin { template<class A> auto operator() (A a) const -> decltype(std::asin (a)) { return std::asin (a); } };
197 struct std_acos { template<class A> auto operator() (A a) const -> decltype(std::acos (a)) { return std::acos (a); } };
198 struct std_atan { template<class A> auto operator() (A a) const -> decltype(std::atan (a)) { return std::atan (a); } };
199 struct std_sinh { template<class A> auto operator() (A a) const -> decltype(std::sinh (a)) { return std::sinh (a); } };
200 struct std_cosh { template<class A> auto operator() (A a) const -> decltype(std::cosh (a)) { return std::cosh (a); } };
201 struct std_tanh { template<class A> auto operator() (A a) const -> decltype(std::tanh (a)) { return std::tanh (a); } };
202 struct std_round { template<class A> auto operator() (A a) const -> decltype(std::round(a)) { return std::round(a); } };
203 struct std_fmod { template<class A, class B> auto operator() (A a, B b) const -> decltype(std::fmod (a, b)) { return std::fmod (a, b); } };
204 struct std_pow { template<class A, class B> auto operator() (A a, B b) const -> decltype(std::pow (a, b)) { return std::pow (a, b); } };
205 struct std_atan2 { template<class A, class B> auto operator() (A a, B b) const -> decltype(std::atan2 (a, b)) { return std::atan2 (a, b); } };
206 struct std_copysign { template<class A, class B> auto operator() (A a, B b) const -> decltype(std::copysign(a, b)) { return std::copysign(a, b); } };
207 }
208
209 // Small, fixed-length vector type, consisting of exactly M elements of type T, and presumed to be a column-vector unless otherwise noted
210 template<class T> struct vec<T,1>
211 {
212 T x;
213 constexpr vec() : x() {}
214 constexpr vec(const T & x_) : x(x_) {}
215 // NOTE: vec<T,1> does NOT have a constructor from pointer, this can conflict with initializing its single element from zero
216 template<class U>
217 constexpr explicit vec(const vec<U,1> & v) : vec(static_cast<T>(v.x)) {}
218 constexpr const T & operator[] (int i) const { return x; }
219 LINALG_CONSTEXPR14 T & operator[] (int i) { return x; }
220
221 template<class U, class=detail::conv_t<vec,U>> constexpr vec(const U & u) : vec(converter<vec,U>{}(u)) {}
222 template<class U, class=detail::conv_t<U,vec>> constexpr operator U () const { return converter<U,vec>{}(*this); }
223 };
224 template<class T> struct vec<T,2>
225 {
226 T x,y;
227 constexpr vec() : x(), y() {}
228 constexpr vec(const T & x_, const T & y_) : x(x_), y(y_) {}
229 constexpr explicit vec(const T & s) : vec(s, s) {}
230 constexpr explicit vec(const T * p) : vec(p[0], p[1]) {}
231 template<class U>
232 constexpr explicit vec(const vec<U,2> & v) : vec(static_cast<T>(v.x), static_cast<T>(v.y)) {}
233 constexpr const T & operator[] (int i) const { return i==0?x:y; }
234 LINALG_CONSTEXPR14 T & operator[] (int i) { return i==0?x:y; }
235
236 template<class U, class=detail::conv_t<vec,U>> constexpr vec(const U & u) : vec(converter<vec,U>{}(u)) {}
237 template<class U, class=detail::conv_t<U,vec>> constexpr operator U () const { return converter<U,vec>{}(*this); }
238 };
239 template<class T> struct vec<T,3>
240 {
241 T x,y,z;
242 constexpr vec() : x(), y(), z() {}
243 constexpr vec(const T & x_, const T & y_,
244 const T & z_) : x(x_), y(y_), z(z_) {}
245 constexpr vec(const vec<T,2> & xy,
246 const T & z_) : vec(xy.x, xy.y, z_) {}
247 constexpr explicit vec(const T & s) : vec(s, s, s) {}
248 constexpr explicit vec(const T * p) : vec(p[0], p[1], p[2]) {}
249 template<class U>
250 constexpr explicit vec(const vec<U,3> & v) : vec(static_cast<T>(v.x), static_cast<T>(v.y), static_cast<T>(v.z)) {}
251 constexpr const T & operator[] (int i) const { return i==0?x:i==1?y:z; }
252 LINALG_CONSTEXPR14 T & operator[] (int i) { return i==0?x:i==1?y:z; }
253 constexpr const vec<T,2> & xy() const { return *reinterpret_cast<const vec<T,2> *>(this); }
254 vec<T,2> & xy() { return *reinterpret_cast<vec<T,2> *>(this); }
255
256 template<class U, class=detail::conv_t<vec,U>> constexpr vec(const U & u) : vec(converter<vec,U>{}(u)) {}
257 template<class U, class=detail::conv_t<U,vec>> constexpr operator U () const { return converter<U,vec>{}(*this); }
258 };
259 template<class T> struct vec<T,4>
260 {
261 T x,y,z,w;
262 constexpr vec() : x(), y(), z(), w() {}
263 constexpr vec(const T & x_, const T & y_,
264 const T & z_, const T & w_) : x(x_), y(y_), z(z_), w(w_) {}
265 constexpr vec(const vec<T,2> & xy,
266 const T & z_, const T & w_) : vec(xy.x, xy.y, z_, w_) {}
267 constexpr vec(const vec<T,3> & xyz,
268 const T & w_) : vec(xyz.x, xyz.y, xyz.z, w_) {}
269 constexpr explicit vec(const T & s) : vec(s, s, s, s) {}
270 constexpr explicit vec(const T * p) : vec(p[0], p[1], p[2], p[3]) {}
271 template<class U>
272 constexpr explicit vec(const vec<U,4> & v) : vec(static_cast<T>(v.x), static_cast<T>(v.y), static_cast<T>(v.z), static_cast<T>(v.w)) {}
273 constexpr const T & operator[] (int i) const { return i==0?x:i==1?y:i==2?z:w; }
274 LINALG_CONSTEXPR14 T & operator[] (int i) { return i==0?x:i==1?y:i==2?z:w; }
275 constexpr const vec<T,2> & xy() const { return *reinterpret_cast<const vec<T,2> *>(this); }
276 constexpr const vec<T,3> & xyz() const { return *reinterpret_cast<const vec<T,3> *>(this); }
277 vec<T,2> & xy() { return *reinterpret_cast<vec<T,2> *>(this); }
278 vec<T,3> & xyz() { return *reinterpret_cast<vec<T,3> *>(this); }
279
280 template<class U, class=detail::conv_t<vec,U>> constexpr vec(const U & u) : vec(converter<vec,U>{}(u)) {}
281 template<class U, class=detail::conv_t<U,vec>> constexpr operator U () const { return converter<U,vec>{}(*this); }
282 };
283
284 // Small, fixed-size matrix type, consisting of exactly M rows and N columns of type T, stored in column-major order.
285 template<class T, int M> struct mat<T,M,1>
286 {
287 typedef vec<T,M> V;
288 V x;
289 constexpr mat() : x() {}
290 constexpr mat(const V & x_) : x(x_) {}
291 constexpr explicit mat(const T & s) : x(s) {}
292 constexpr explicit mat(const T * p) : x(p+M*0) {}
293 template<class U>
294 constexpr explicit mat(const mat<U,M,1> & m) : mat(V(m.x)) {}
295 constexpr vec<T,1> row(int i) const { return {x[i]}; }
296 constexpr const V & operator[] (int j) const { return x; }
297 LINALG_CONSTEXPR14 V & operator[] (int j) { return x; }
298
299 template<class U, class=detail::conv_t<mat,U>> constexpr mat(const U & u) : mat(converter<mat,U>{}(u)) {}
300 template<class U, class=detail::conv_t<U,mat>> constexpr operator U () const { return converter<U,mat>{}(*this); }
301 };
302 template<class T, int M> struct mat<T,M,2>
303 {
304 typedef vec<T,M> V;
305 V x,y;
306 constexpr mat() : x(), y() {}
307 constexpr mat(const V & x_, const V & y_) : x(x_), y(y_) {}
308 constexpr explicit mat(const T & s) : x(s), y(s) {}
309 constexpr explicit mat(const T * p) : x(p+M*0), y(p+M*1) {}
310 template<class U>
311 constexpr explicit mat(const mat<U,M,2> & m) : mat(V(m.x), V(m.y)) {}
312 constexpr vec<T,2> row(int i) const { return {x[i], y[i]}; }
313 constexpr const V & operator[] (int j) const { return j==0?x:y; }
314 LINALG_CONSTEXPR14 V & operator[] (int j) { return j==0?x:y; }
315
316 template<class U, class=detail::conv_t<mat,U>> constexpr mat(const U & u) : mat(converter<mat,U>{}(u)) {}
317 template<class U, class=detail::conv_t<U,mat>> constexpr operator U () const { return converter<U,mat>{}(*this); }
318 };
319 template<class T, int M> struct mat<T,M,3>
320 {
321 typedef vec<T,M> V;
322 V x,y,z;
323 constexpr mat() : x(), y(), z() {}
324 constexpr mat(const V & x_, const V & y_,
325 const V & z_) : x(x_), y(y_), z(z_) {}
326 constexpr explicit mat(const T & s) : x(s), y(s), z(s) {}
327 constexpr explicit mat(const T * p) : x(p+M*0), y(p+M*1), z(p+M*2) {}
328 template<class U>
329 constexpr explicit mat(const mat<U,M,3> & m) : mat(V(m.x), V(m.y), V(m.z)) {}
330 constexpr vec<T,3> row(int i) const { return {x[i], y[i], z[i]}; }
331 constexpr const V & operator[] (int j) const { return j==0?x:j==1?y:z; }
332 LINALG_CONSTEXPR14 V & operator[] (int j) { return j==0?x:j==1?y:z; }
333
334 template<class U, class=detail::conv_t<mat,U>> constexpr mat(const U & u) : mat(converter<mat,U>{}(u)) {}
335 template<class U, class=detail::conv_t<U,mat>> constexpr operator U () const { return converter<U,mat>{}(*this); }
336 };
337 template<class T, int M> struct mat<T,M,4>
338 {
339 typedef vec<T,M> V;
340 V x,y,z,w;
341 constexpr mat() : x(), y(), z(), w() {}
342 constexpr mat(const V & x_, const V & y_,
343 const V & z_, const V & w_) : x(x_), y(y_), z(z_), w(w_) {}
344 constexpr explicit mat(const T & s) : x(s), y(s), z(s), w(s) {}
345 constexpr explicit mat(const T * p) : x(p+M*0), y(p+M*1), z(p+M*2), w(p+M*3) {}
346 template<class U>
347 constexpr explicit mat(const mat<U,M,4> & m) : mat(V(m.x), V(m.y), V(m.z), V(m.w)) {}
348 constexpr vec<T,4> row(int i) const { return {x[i], y[i], z[i], w[i]}; }
349 constexpr const V & operator[] (int j) const { return j==0?x:j==1?y:j==2?z:w; }
350 LINALG_CONSTEXPR14 V & operator[] (int j) { return j==0?x:j==1?y:j==2?z:w; }
351
352 template<class U, class=detail::conv_t<mat,U>> constexpr mat(const U & u) : mat(converter<mat,U>{}(u)) {}
353 template<class U, class=detail::conv_t<U,mat>> constexpr operator U () const { return converter<U,mat>{}(*this); }
354 };
355
356 // Define a type which will convert to the multiplicative identity of any square matrix
357 struct identity_t { constexpr explicit identity_t(int) {} };
358 template<class T> struct converter<mat<T,1,1>, identity_t> { constexpr mat<T,1,1> operator() (identity_t) const { return {vec<T,1>{1}}; } };
359 template<class T> struct converter<mat<T,2,2>, identity_t> { constexpr mat<T,2,2> operator() (identity_t) const { return {{1,0},{0,1}}; } };
360 template<class T> struct converter<mat<T,3,3>, identity_t> { constexpr mat<T,3,3> operator() (identity_t) const { return {{1,0,0},{0,1,0},{0,0,1}}; } };
361 template<class T> struct converter<mat<T,4,4>, identity_t> { constexpr mat<T,4,4> operator() (identity_t) const { return {{1,0,0,0},{0,1,0,0},{0,0,1,0},{0,0,0,1}}; } };
362 constexpr identity_t identity {1};
363
364 // Produce a scalar by applying f(A,B) -> A to adjacent pairs of elements from a vec/mat in left-to-right/column-major order (matching the associativity of arithmetic and logical operators)
365 template<class F, class A, class B> constexpr A fold(F f, A a, const vec<B,1> & b) { return f(a, b.x); }
366 template<class F, class A, class B> constexpr A fold(F f, A a, const vec<B,2> & b) { return f(f(a, b.x), b.y); }
367 template<class F, class A, class B> constexpr A fold(F f, A a, const vec<B,3> & b) { return f(f(f(a, b.x), b.y), b.z); }
368 template<class F, class A, class B> constexpr A fold(F f, A a, const vec<B,4> & b) { return f(f(f(f(a, b.x), b.y), b.z), b.w); }
369 template<class F, class A, class B, int M> constexpr A fold(F f, A a, const mat<B,M,1> & b) { return fold(f, a, b.x); }
370 template<class F, class A, class B, int M> constexpr A fold(F f, A a, const mat<B,M,2> & b) { return fold(f, fold(f, a, b.x), b.y); }
371 template<class F, class A, class B, int M> constexpr A fold(F f, A a, const mat<B,M,3> & b) { return fold(f, fold(f, fold(f, a, b.x), b.y), b.z); }
372 template<class F, class A, class B, int M> constexpr A fold(F f, A a, const mat<B,M,4> & b) { return fold(f, fold(f, fold(f, fold(f, a, b.x), b.y), b.z), b.w); }
373
374 // Type aliases for the result of calling apply(...) with various arguments, can be used with return type SFINAE to constrian overload sets
375 template<class F, class... A> using apply_t = typename detail::apply<F,void,A...>::type;
376 template<class F, class... A> using mm_apply_t = typename std::enable_if<detail::apply<F,void,A...>::mm, apply_t<F,A...>>::type;
377 template<class F, class... A> using no_mm_apply_t = typename std::enable_if<!detail::apply<F,void,A...>::mm, apply_t<F,A...>>::type;
378 template<class A> using scalar_t = typename detail::scalar_type<A>::type; // Underlying scalar type when performing elementwise operations
379
380 // apply(f,...) applies the provided function in an elementwise fashion to its arguments, producing an object of the same dimensions
381 template<class F, class... A> constexpr apply_t<F,A...> apply(F func, const A & ... args) { return detail::apply<F,void,A...>::impl(detail::make_seq<0,detail::apply<F,void,A...>::size>{}, func, args...); }
382
383 // map(a,f) is equivalent to apply(f,a)
384 template<class A, class F> constexpr apply_t<F,A> map(const A & a, F func) { return apply(func, a); }
385
386 // zip(a,b,f) is equivalent to apply(f,a,b)
387 template<class A, class B, class F> constexpr apply_t<F,A,B> zip(const A & a, const B & b, F func) { return apply(func, a, b); }
388
389 // Relational operators are defined to compare the elements of two vectors or matrices lexicographically, in column-major order
390 template<class A, class B> constexpr typename detail::any_compare<A,B>::type compare(const A & a, const B & b) { return detail::any_compare<A,B>()(a,b); }
391 template<class A, class B> constexpr auto operator == (const A & a, const B & b) -> decltype(compare(a,b) == 0) { return compare(a,b) == 0; }
392 template<class A, class B> constexpr auto operator != (const A & a, const B & b) -> decltype(compare(a,b) != 0) { return compare(a,b) != 0; }
393 template<class A, class B> constexpr auto operator < (const A & a, const B & b) -> decltype(compare(a,b) < 0) { return compare(a,b) < 0; }
394 template<class A, class B> constexpr auto operator > (const A & a, const B & b) -> decltype(compare(a,b) > 0) { return compare(a,b) > 0; }
395 template<class A, class B> constexpr auto operator <= (const A & a, const B & b) -> decltype(compare(a,b) <= 0) { return compare(a,b) <= 0; }
396 template<class A, class B> constexpr auto operator >= (const A & a, const B & b) -> decltype(compare(a,b) >= 0) { return compare(a,b) >= 0; }
397
398 // Functions for coalescing scalar values
399 template<class A> constexpr bool any (const A & a) { return fold(detail::op_or{}, false, a); }
400 template<class A> constexpr bool all (const A & a) { return fold(detail::op_and{}, true, a); }
401 template<class A> constexpr scalar_t<A> sum (const A & a) { return fold(detail::op_add{}, scalar_t<A>(0), a); }
402 template<class A> constexpr scalar_t<A> product(const A & a) { return fold(detail::op_mul{}, scalar_t<A>(1), a); }
403 template<class A> constexpr scalar_t<A> minelem(const A & a) { return fold(detail::min{}, a.x, a); }
404 template<class A> constexpr scalar_t<A> maxelem(const A & a) { return fold(detail::max{}, a.x, a); }
405 template<class T, int M> int argmin(const vec<T,M> & a) { int j=0; for(int i=1; i<M; ++i) if(a[i] < a[j]) j = i; return j; }
406 template<class T, int M> int argmax(const vec<T,M> & a) { int j=0; for(int i=1; i<M; ++i) if(a[i] > a[j]) j = i; return j; }
407
408 // Unary operators are defined component-wise for linalg types
409 template<class A> constexpr apply_t<detail::op_pos, A> operator + (const A & a) { return apply(detail::op_pos{}, a); }
410 template<class A> constexpr apply_t<detail::op_neg, A> operator - (const A & a) { return apply(detail::op_neg{}, a); }
411 template<class A> constexpr apply_t<detail::op_cmp, A> operator ~ (const A & a) { return apply(detail::op_cmp{}, a); }
412 template<class A> constexpr apply_t<detail::op_not, A> operator ! (const A & a) { return apply(detail::op_not{}, a); }
413
414 // Binary operators are defined component-wise for linalg types, EXCEPT for `operator *`
415 template<class A, class B> constexpr apply_t<detail::op_add, A, B> operator + (const A & a, const B & b) { return apply(detail::op_add{}, a, b); }
416 template<class A, class B> constexpr apply_t<detail::op_sub, A, B> operator - (const A & a, const B & b) { return apply(detail::op_sub{}, a, b); }
417 template<class A, class B> constexpr apply_t<detail::op_mul, A, B> cmul (const A & a, const B & b) { return apply(detail::op_mul{}, a, b); }
418 template<class A, class B> constexpr apply_t<detail::op_div, A, B> operator / (const A & a, const B & b) { return apply(detail::op_div{}, a, b); }
419 template<class A, class B> constexpr apply_t<detail::op_mod, A, B> operator % (const A & a, const B & b) { return apply(detail::op_mod{}, a, b); }
420 template<class A, class B> constexpr apply_t<detail::op_un, A, B> operator | (const A & a, const B & b) { return apply(detail::op_un{}, a, b); }
421 template<class A, class B> constexpr apply_t<detail::op_xor, A, B> operator ^ (const A & a, const B & b) { return apply(detail::op_xor{}, a, b); }
422 template<class A, class B> constexpr apply_t<detail::op_int, A, B> operator & (const A & a, const B & b) { return apply(detail::op_int{}, a, b); }
423 template<class A, class B> constexpr apply_t<detail::op_lsh, A, B> operator << (const A & a, const B & b) { return apply(detail::op_lsh{}, a, b); }
424 template<class A, class B> constexpr apply_t<detail::op_rsh, A, B> operator >> (const A & a, const B & b) { return apply(detail::op_rsh{}, a, b); }
425
426 // Binary `operator *` was originally defined component-wise for all patterns, in a fashion consistent with the other operators. However,
427 // this was one of the most frequent sources of confusion among new users of this library, with the binary `operator *` being used accidentally
428 // by users who INTENDED the semantics of the algebraic matrix product, but RECEIVED the semantics of the Hadamard product. While there is
429 // precedent within the HLSL, Fortran, R, APL, J, and Mathematica programming languages for `operator *` having the semantics of the Hadamard
430 // product between matrices, it is counterintuitive to users of GLSL, Eigen, and many other languages and libraries that chose matrix product
431 // semantics for `operator *`.
432 //
433 // For these reasons, binary `operator *` is now DEPRECATED between pairs of matrices. Users may call `cmul(...)` for component-wise multiplication,
434 // or `mul(...)` for matrix multiplication. Binary `operator *` continues to be available for vector * vector, vector * scalar, matrix * scalar, etc.
435 template<class A, class B> constexpr no_mm_apply_t<detail::op_mul, A, B> operator * (const A & a, const B & b) { return cmul(a,b); }
436 #ifndef LINALG_FORWARD_COMPATIBLE
437 template<class A, class B> [[deprecated("`operator *` between pairs of matrices is deprecated. See the source text for details.")]] constexpr mm_apply_t<detail::op_mul, A, B> operator * (const A & a, const B & b) { return cmul(a,b); }
438 #endif
439
440 // Binary assignment operators a $= b is always defined as though it were explicitly written a = a $ b
441 template<class A, class B> constexpr auto operator += (A & a, const B & b) -> decltype(a = a + b) { return a = a + b; }
442 template<class A, class B> constexpr auto operator -= (A & a, const B & b) -> decltype(a = a - b) { return a = a - b; }
443 template<class A, class B> constexpr auto operator *= (A & a, const B & b) -> decltype(a = a * b) { return a = a * b; }
444 template<class A, class B> constexpr auto operator /= (A & a, const B & b) -> decltype(a = a / b) { return a = a / b; }
445 template<class A, class B> constexpr auto operator %= (A & a, const B & b) -> decltype(a = a % b) { return a = a % b; }
446 template<class A, class B> constexpr auto operator |= (A & a, const B & b) -> decltype(a = a | b) { return a = a | b; }
447 template<class A, class B> constexpr auto operator ^= (A & a, const B & b) -> decltype(a = a ^ b) { return a = a ^ b; }
448 template<class A, class B> constexpr auto operator &= (A & a, const B & b) -> decltype(a = a & b) { return a = a & b; }
449 template<class A, class B> constexpr auto operator <<= (A & a, const B & b) -> decltype(a = a << b) { return a = a << b; }
450 template<class A, class B> constexpr auto operator >>= (A & a, const B & b) -> decltype(a = a >> b) { return a = a >> b; }
451
452 // Swizzles and subobjects
453 template<int... I, class T, int M> constexpr vec<T,sizeof...(I)> swizzle(const vec<T,M> & a) { return {detail::getter<I>{}(a)...}; }
454 template<int I0, int I1, class T, int M> constexpr vec<T,I1-I0> subvec (const vec<T,M> & a) { return detail::swizzle(a, detail::make_seq<I0,I1>{}); }
455 template<int I0, int J0, int I1, int J1, class T, int M, int N> constexpr mat<T,I1-I0,J1-J0> submat (const mat<T,M,N> & a) { return detail::swizzle(a, detail::make_seq<I0,I1>{}, detail::make_seq<J0,J1>{}); }
456
457 // Component-wise standard library math functions
458 template<class A> apply_t<detail::std_abs, A> abs (const A & a) { return apply(detail::std_abs{}, a); }
459 template<class A> apply_t<detail::std_floor, A> floor(const A & a) { return apply(detail::std_floor{}, a); }
460 template<class A> apply_t<detail::std_ceil, A> ceil (const A & a) { return apply(detail::std_ceil{}, a); }
461 template<class A> apply_t<detail::std_exp, A> exp (const A & a) { return apply(detail::std_exp{}, a); }
462 template<class A> apply_t<detail::std_log, A> log (const A & a) { return apply(detail::std_log{}, a); }
463 template<class A> apply_t<detail::std_log10, A> log10(const A & a) { return apply(detail::std_log10{}, a); }
464 template<class A> apply_t<detail::std_sqrt, A> sqrt (const A & a) { return apply(detail::std_sqrt{}, a); }
465 template<class A> apply_t<detail::std_sin, A> sin (const A & a) { return apply(detail::std_sin{}, a); }
466 template<class A> apply_t<detail::std_cos, A> cos (const A & a) { return apply(detail::std_cos{}, a); }
467 template<class A> apply_t<detail::std_tan, A> tan (const A & a) { return apply(detail::std_tan{}, a); }
468 template<class A> apply_t<detail::std_asin, A> asin (const A & a) { return apply(detail::std_asin{}, a); }
469 template<class A> apply_t<detail::std_acos, A> acos (const A & a) { return apply(detail::std_acos{}, a); }
470 template<class A> apply_t<detail::std_atan, A> atan (const A & a) { return apply(detail::std_atan{}, a); }
471 template<class A> apply_t<detail::std_sinh, A> sinh (const A & a) { return apply(detail::std_sinh{}, a); }
472 template<class A> apply_t<detail::std_cosh, A> cosh (const A & a) { return apply(detail::std_cosh{}, a); }
473 template<class A> apply_t<detail::std_tanh, A> tanh (const A & a) { return apply(detail::std_tanh{}, a); }
474 template<class A> apply_t<detail::std_round, A> round(const A & a) { return apply(detail::std_round{}, a); }
475
476 template<class A, class B> apply_t<detail::std_fmod, A, B> fmod (const A & a, const B & b) { return apply(detail::std_fmod{}, a, b); }
477 template<class A, class B> apply_t<detail::std_pow, A, B> pow (const A & a, const B & b) { return apply(detail::std_pow{}, a, b); }
478 template<class A, class B> apply_t<detail::std_atan2, A, B> atan2 (const A & a, const B & b) { return apply(detail::std_atan2{}, a, b); }
479 template<class A, class B> apply_t<detail::std_copysign, A, B> copysign(const A & a, const B & b) { return apply(detail::std_copysign{}, a, b); }
480
481 // Component-wise relational functions on vectors
482 template<class A, class B> constexpr apply_t<detail::op_eq, A, B> equal (const A & a, const B & b) { return apply(detail::op_eq{}, a, b); }
483 template<class A, class B> constexpr apply_t<detail::op_ne, A, B> nequal (const A & a, const B & b) { return apply(detail::op_ne{}, a, b); }
484 template<class A, class B> constexpr apply_t<detail::op_lt, A, B> less (const A & a, const B & b) { return apply(detail::op_lt{}, a, b); }
485 template<class A, class B> constexpr apply_t<detail::op_gt, A, B> greater(const A & a, const B & b) { return apply(detail::op_gt{}, a, b); }
486 template<class A, class B> constexpr apply_t<detail::op_le, A, B> lequal (const A & a, const B & b) { return apply(detail::op_le{}, a, b); }
487 template<class A, class B> constexpr apply_t<detail::op_ge, A, B> gequal (const A & a, const B & b) { return apply(detail::op_ge{}, a, b); }
488
489 // Component-wise selection functions on vectors
490 template<class A, class B> constexpr apply_t<detail::min, A, B> min(const A & a, const B & b) { return apply(detail::min{}, a, b); }
491 template<class A, class B> constexpr apply_t<detail::max, A, B> max(const A & a, const B & b) { return apply(detail::max{}, a, b); }
492 template<class X, class L, class H> constexpr apply_t<detail::clamp, X, L, H> clamp (const X & x, const L & l, const H & h) { return apply(detail::clamp{}, x, l, h); }
493 template<class P, class A, class B> constexpr apply_t<detail::select, P, A, B> select(const P & p, const A & a, const B & b) { return apply(detail::select{}, p, a, b); }
494 template<class A, class B, class T> constexpr apply_t<detail::lerp, A, B, T> lerp (const A & a, const B & b, const T & t) { return apply(detail::lerp{}, a, b, t); }
495
496 // Support for vector algebra
497 template<class T> constexpr T cross (const vec<T,2> & a, const vec<T,2> & b) { return a.x*b.y-a.y*b.x; }
498 template<class T> constexpr vec<T,2> cross (T a, const vec<T,2> & b) { return {-a*b.y, a*b.x}; }
499 template<class T> constexpr vec<T,2> cross (const vec<T,2> & a, T b) { return {a.y*b, -a.x*b}; }
500 template<class T> constexpr vec<T,3> cross (const vec<T,3> & a, const vec<T,3> & b) { return {a.y*b.z-a.z*b.y, a.z*b.x-a.x*b.z, a.x*b.y-a.y*b.x}; }
501 template<class T, int M> constexpr T dot (const vec<T,M> & a, const vec<T,M> & b) { return sum(a*b); }
502 template<class T, int M> constexpr T length2 (const vec<T,M> & a) { return dot(a,a); }
503 template<class T, int M> T length (const vec<T,M> & a) { return std::sqrt(length2(a)); }
504 template<class T, int M> vec<T,M> normalize(const vec<T,M> & a) { return a / length(a); }
505 template<class T, int M> constexpr T distance2(const vec<T,M> & a, const vec<T,M> & b) { return length2(b-a); }
506 template<class T, int M> T distance (const vec<T,M> & a, const vec<T,M> & b) { return length(b-a); }
507 template<class T, int M> T uangle (const vec<T,M> & a, const vec<T,M> & b) { T d=dot(a,b); return d > 1 ? 0 : std::acos(d < -1 ? -1 : d); }
508 template<class T, int M> T angle (const vec<T,M> & a, const vec<T,M> & b) { return uangle(normalize(a), normalize(b)); }
509 template<class T> vec<T,2> rot (T a, const vec<T,2> & v) { const T s = std::sin(a), c = std::cos(a); return {v.x*c - v.y*s, v.x*s + v.y*c}; }
510 template<class T, int M> vec<T,M> nlerp (const vec<T,M> & a, const vec<T,M> & b, T t) { return normalize(lerp(a,b,t)); }
511 template<class T, int M> vec<T,M> slerp (const vec<T,M> & a, const vec<T,M> & b, T t) { T th=uangle(a,b); return th == 0 ? a : a*(std::sin(th*(1-t))/std::sin(th)) + b*(std::sin(th*t)/std::sin(th)); }
512
513 // Support for quaternion algebra using 4D vectors, representing xi + yj + zk + w
514 template<class T> constexpr vec<T,4> qconj(const vec<T,4> & q) { return {-q.x,-q.y,-q.z,q.w}; }
515 template<class T> vec<T,4> qinv (const vec<T,4> & q) { return qconj(q)/length2(q); }
516 template<class T> vec<T,4> qexp (const vec<T,4> & q) { const auto v = q.xyz(); const auto vv = length(v); return std::exp(q.w) * vec<T,4>{v * (vv > 0 ? std::sin(vv)/vv : 0), std::cos(vv)}; }
517 template<class T> vec<T,4> qlog (const vec<T,4> & q) { const auto v = q.xyz(); const auto vv = length(v), qq = length(q); return {v * (vv > 0 ? std::acos(q.w/qq)/vv : 0), std::log(qq)}; }
518 template<class T> vec<T,4> qpow (const vec<T,4> & q, const T & p) { const auto v = q.xyz(); const auto vv = length(v), qq = length(q), th = std::acos(q.w/qq); return std::pow(qq,p)*vec<T,4>{v * (vv > 0 ? std::sin(p*th)/vv : 0), std::cos(p*th)}; }
519 template<class T> constexpr vec<T,4> qmul (const vec<T,4> & a, const vec<T,4> & b) { return {a.x*b.w+a.w*b.x+a.y*b.z-a.z*b.y, a.y*b.w+a.w*b.y+a.z*b.x-a.x*b.z, a.z*b.w+a.w*b.z+a.x*b.y-a.y*b.x, a.w*b.w-a.x*b.x-a.y*b.y-a.z*b.z}; }
520 template<class T, class... R> constexpr vec<T,4> qmul(const vec<T,4> & a, R... r) { return qmul(a, qmul(r...)); }
521
522 // Support for 3D spatial rotations using quaternions, via qmul(qmul(q, v), qconj(q))
523 template<class T> constexpr vec<T,3> qxdir (const vec<T,4> & q) { return {q.w*q.w+q.x*q.x-q.y*q.y-q.z*q.z, (q.x*q.y+q.z*q.w)*2, (q.z*q.x-q.y*q.w)*2}; }
524 template<class T> constexpr vec<T,3> qydir (const vec<T,4> & q) { return {(q.x*q.y-q.z*q.w)*2, q.w*q.w-q.x*q.x+q.y*q.y-q.z*q.z, (q.y*q.z+q.x*q.w)*2}; }
525 template<class T> constexpr vec<T,3> qzdir (const vec<T,4> & q) { return {(q.z*q.x+q.y*q.w)*2, (q.y*q.z-q.x*q.w)*2, q.w*q.w-q.x*q.x-q.y*q.y+q.z*q.z}; }
526 template<class T> constexpr mat<T,3,3> qmat (const vec<T,4> & q) { return {qxdir(q), qydir(q), qzdir(q)}; }
527 template<class T> constexpr vec<T,3> qrot (const vec<T,4> & q, const vec<T,3> & v) { return qxdir(q)*v.x + qydir(q)*v.y + qzdir(q)*v.z; }
528 template<class T> T qangle(const vec<T,4> & q) { return std::atan2(length(q.xyz()), q.w)*2; }
529 template<class T> vec<T,3> qaxis (const vec<T,4> & q) { return normalize(q.xyz()); }
530 template<class T> vec<T,4> qnlerp(const vec<T,4> & a, const vec<T,4> & b, T t) { return nlerp(a, dot(a,b) < 0 ? -b : b, t); }
531 template<class T> vec<T,4> qslerp(const vec<T,4> & a, const vec<T,4> & b, T t) { return slerp(a, dot(a,b) < 0 ? -b : b, t); }
532
533 // Support for matrix algebra
534 template<class T, int M> constexpr vec<T,M> mul(const mat<T,M,1> & a, const vec<T,1> & b) { return a.x*b.x; }
535 template<class T, int M> constexpr vec<T,M> mul(const mat<T,M,2> & a, const vec<T,2> & b) { return a.x*b.x + a.y*b.y; }
536 template<class T, int M> constexpr vec<T,M> mul(const mat<T,M,3> & a, const vec<T,3> & b) { return a.x*b.x + a.y*b.y + a.z*b.z; }
537 template<class T, int M> constexpr vec<T,M> mul(const mat<T,M,4> & a, const vec<T,4> & b) { return a.x*b.x + a.y*b.y + a.z*b.z + a.w*b.w; }
538 template<class T, int M, int N> constexpr mat<T,M,1> mul(const mat<T,M,N> & a, const mat<T,N,1> & b) { return {mul(a,b.x)}; }
539 template<class T, int M, int N> constexpr mat<T,M,2> mul(const mat<T,M,N> & a, const mat<T,N,2> & b) { return {mul(a,b.x), mul(a,b.y)}; }
540 template<class T, int M, int N> constexpr mat<T,M,3> mul(const mat<T,M,N> & a, const mat<T,N,3> & b) { return {mul(a,b.x), mul(a,b.y), mul(a,b.z)}; }
541 template<class T, int M, int N> constexpr mat<T,M,4> mul(const mat<T,M,N> & a, const mat<T,N,4> & b) { return {mul(a,b.x), mul(a,b.y), mul(a,b.z), mul(a,b.w)}; }
542 template<class T, int M, int N, int P> constexpr vec<T,M> mul(const mat<T,M,N> & a, const mat<T,N,P> & b, const vec<T,P> & c) { return mul(mul(a,b),c); }
543 template<class T, int M, int N, int P, int Q> constexpr mat<T,M,Q> mul(const mat<T,M,N> & a, const mat<T,N,P> & b, const mat<T,P,Q> & c) { return mul(mul(a,b),c); }
544 template<class T, int M, int N, int P, int Q> constexpr vec<T,M> mul(const mat<T,M,N> & a, const mat<T,N,P> & b, const mat<T,P,Q> & c, const vec<T,Q> & d) { return mul(mul(a,b,c),d); }
545 template<class T, int M, int N, int P, int Q, int R> constexpr mat<T,M,R> mul(const mat<T,M,N> & a, const mat<T,N,P> & b, const mat<T,P,Q> & c, const mat<T,Q,R> & d) { return mul(mul(a,b,c),d); }
546 template<class T, int M> constexpr mat<T,M,1> outerprod(const vec<T,M> & a, const vec<T,1> & b) { return {a*b.x}; }
547 template<class T, int M> constexpr mat<T,M,2> outerprod(const vec<T,M> & a, const vec<T,2> & b) { return {a*b.x, a*b.y}; }
548 template<class T, int M> constexpr mat<T,M,3> outerprod(const vec<T,M> & a, const vec<T,3> & b) { return {a*b.x, a*b.y, a*b.z}; }
549 template<class T, int M> constexpr mat<T,M,4> outerprod(const vec<T,M> & a, const vec<T,4> & b) { return {a*b.x, a*b.y, a*b.z, a*b.w}; }
550 template<class T> constexpr vec<T,1> diagonal(const mat<T,1,1> & a) { return {a.x.x}; }
551 template<class T> constexpr vec<T,2> diagonal(const mat<T,2,2> & a) { return {a.x.x, a.y.y}; }
552 template<class T> constexpr vec<T,3> diagonal(const mat<T,3,3> & a) { return {a.x.x, a.y.y, a.z.z}; }
553 template<class T> constexpr vec<T,4> diagonal(const mat<T,4,4> & a) { return {a.x.x, a.y.y, a.z.z, a.w.w}; }
554 template<class T, int N> constexpr T trace(const mat<T,N,N> & a) { return sum(diagonal(a)); }
555 template<class T, int M> constexpr mat<T,M,1> transpose(const mat<T,1,M> & m) { return {m.row(0)}; }
556 template<class T, int M> constexpr mat<T,M,2> transpose(const mat<T,2,M> & m) { return {m.row(0), m.row(1)}; }
557 template<class T, int M> constexpr mat<T,M,3> transpose(const mat<T,3,M> & m) { return {m.row(0), m.row(1), m.row(2)}; }
558 template<class T, int M> constexpr mat<T,M,4> transpose(const mat<T,4,M> & m) { return {m.row(0), m.row(1), m.row(2), m.row(3)}; }
559 template<class T, int M> constexpr mat<T,1,M> transpose(const vec<T,M> & m) { return transpose(mat<T,M,1>(m)); }
560 template<class T> constexpr mat<T,1,1> adjugate(const mat<T,1,1> & a) { return {vec<T,1>{1}}; }
561 template<class T> constexpr mat<T,2,2> adjugate(const mat<T,2,2> & a) { return {{a.y.y, -a.x.y}, {-a.y.x, a.x.x}}; }
562 template<class T> constexpr mat<T,3,3> adjugate(const mat<T,3,3> & a);
563 template<class T> constexpr mat<T,4,4> adjugate(const mat<T,4,4> & a);
564 template<class T, int N> constexpr mat<T,N,N> comatrix(const mat<T,N,N> & a) { return transpose(adjugate(a)); }
565 template<class T> constexpr T determinant(const mat<T,1,1> & a) { return a.x.x; }
566 template<class T> constexpr T determinant(const mat<T,2,2> & a) { return a.x.x*a.y.y - a.x.y*a.y.x; }
567 template<class T> constexpr T determinant(const mat<T,3,3> & a) { return a.x.x*(a.y.y*a.z.z - a.z.y*a.y.z) + a.x.y*(a.y.z*a.z.x - a.z.z*a.y.x) + a.x.z*(a.y.x*a.z.y - a.z.x*a.y.y); }
568 template<class T> constexpr T determinant(const mat<T,4,4> & a);
569 template<class T, int N> constexpr mat<T,N,N> inverse(const mat<T,N,N> & a) { return adjugate(a)/determinant(a); }
570
571 // Vectors and matrices can be used as ranges
572 template<class T, int M> T * begin( vec<T,M> & a) { return &a.x; }
573 template<class T, int M> const T * begin(const vec<T,M> & a) { return &a.x; }
574 template<class T, int M> T * end ( vec<T,M> & a) { return begin(a) + M; }
575 template<class T, int M> const T * end (const vec<T,M> & a) { return begin(a) + M; }
576 template<class T, int M, int N> vec<T,M> * begin( mat<T,M,N> & a) { return &a.x; }
577 template<class T, int M, int N> const vec<T,M> * begin(const mat<T,M,N> & a) { return &a.x; }
578 template<class T, int M, int N> vec<T,M> * end ( mat<T,M,N> & a) { return begin(a) + N; }
579 template<class T, int M, int N> const vec<T,M> * end (const mat<T,M,N> & a) { return begin(a) + N; }
580
581 // Factory functions for 3D spatial transformations (will possibly be removed or changed in a future version)
582 enum fwd_axis { neg_z, pos_z }; // Should projection matrices be generated assuming forward is {0,0,-1} or {0,0,1}
583 enum z_range { neg_one_to_one, zero_to_one }; // Should projection matrices map z into the range of [-1,1] or [0,1]?
584 template<class T> vec<T,4> rotation_quat (const vec<T,3> & axis, T angle) { return {axis*std::sin(angle/2), std::cos(angle/2)}; }
585 template<class T> vec<T,4> rotation_quat (const mat<T,3,3> & m);
586 template<class T> mat<T,4,4> translation_matrix(const vec<T,3> & translation) { return {{1,0,0,0},{0,1,0,0},{0,0,1,0},{translation,1}}; }
587 template<class T> mat<T,4,4> rotation_matrix (const vec<T,4> & rotation) { return {{qxdir(rotation),0}, {qydir(rotation),0}, {qzdir(rotation),0}, {0,0,0,1}}; }
588 template<class T> mat<T,4,4> scaling_matrix (const vec<T,3> & scaling) { return {{scaling.x,0,0,0}, {0,scaling.y,0,0}, {0,0,scaling.z,0}, {0,0,0,1}}; }
589 template<class T> mat<T,4,4> pose_matrix (const vec<T,4> & q, const vec<T,3> & p) { return {{qxdir(q),0}, {qydir(q),0}, {qzdir(q),0}, {p,1}}; }
590 template<class T> mat<T,4,4> lookat_matrix (const vec<T,3> & eye, const vec<T,3> & center, const vec<T,3> & view_y_dir, fwd_axis fwd = neg_z);
591 template<class T> mat<T,4,4> frustum_matrix (T x0, T x1, T y0, T y1, T n, T f, fwd_axis a = neg_z, z_range z = neg_one_to_one);
592 template<class T> mat<T,4,4> perspective_matrix(T fovy, T aspect, T n, T f, fwd_axis a = neg_z, z_range z = neg_one_to_one) { T y = n*std::tan(fovy / 2), x = y*aspect; return frustum_matrix(-x, x, -y, y, n, f, a, z); }
593
594 // Provide implicit conversion between linalg::vec<T,M> and std::array<T,M>
595 template<class T> struct converter<vec<T,1>, std::array<T,1>> { vec<T,1> operator() (const std::array<T,1> & a) const { return {a[0]}; } };
596 template<class T> struct converter<vec<T,2>, std::array<T,2>> { vec<T,2> operator() (const std::array<T,2> & a) const { return {a[0], a[1]}; } };
597 template<class T> struct converter<vec<T,3>, std::array<T,3>> { vec<T,3> operator() (const std::array<T,3> & a) const { return {a[0], a[1], a[2]}; } };
598 template<class T> struct converter<vec<T,4>, std::array<T,4>> { vec<T,4> operator() (const std::array<T,4> & a) const { return {a[0], a[1], a[2], a[3]}; } };
599
600 template<class T> struct converter<std::array<T,1>, vec<T,1>> { std::array<T,1> operator() (const vec<T,1> & a) const { return {a[0]}; } };
601 template<class T> struct converter<std::array<T,2>, vec<T,2>> { std::array<T,2> operator() (const vec<T,2> & a) const { return {a[0], a[1]}; } };
602 template<class T> struct converter<std::array<T,3>, vec<T,3>> { std::array<T,3> operator() (const vec<T,3> & a) const { return {a[0], a[1], a[2]}; } };
603 template<class T> struct converter<std::array<T,4>, vec<T,4>> { std::array<T,4> operator() (const vec<T,4> & a) const { return {a[0], a[1], a[2], a[3]}; } };
604
605 // Provide typedefs for common element types and vector/matrix sizes
606 namespace aliases
607 {
608 typedef vec<bool,1> bool1; typedef vec<uint8_t,1> byte1; typedef vec<int16_t,1> short1; typedef vec<uint16_t,1> ushort1;
609 typedef vec<bool,2> bool2; typedef vec<uint8_t,2> byte2; typedef vec<int16_t,2> short2; typedef vec<uint16_t,2> ushort2;
610 typedef vec<bool,3> bool3; typedef vec<uint8_t,3> byte3; typedef vec<int16_t,3> short3; typedef vec<uint16_t,3> ushort3;
611 typedef vec<bool,4> bool4; typedef vec<uint8_t,4> byte4; typedef vec<int16_t,4> short4; typedef vec<uint16_t,4> ushort4;
612 typedef vec<int,1> int1; typedef vec<unsigned,1> uint1; typedef vec<float,1> float1; typedef vec<double,1> double1;
613 typedef vec<int,2> int2; typedef vec<unsigned,2> uint2; typedef vec<float,2> float2; typedef vec<double,2> double2;
614 typedef vec<int,3> int3; typedef vec<unsigned,3> uint3; typedef vec<float,3> float3; typedef vec<double,3> double3;
615 typedef vec<int,4> int4; typedef vec<unsigned,4> uint4; typedef vec<float,4> float4; typedef vec<double,4> double4;
616 typedef mat<bool,1,1> bool1x1; typedef mat<int,1,1> int1x1; typedef mat<float,1,1> float1x1; typedef mat<double,1,1> double1x1;
617 typedef mat<bool,1,2> bool1x2; typedef mat<int,1,2> int1x2; typedef mat<float,1,2> float1x2; typedef mat<double,1,2> double1x2;
618 typedef mat<bool,1,3> bool1x3; typedef mat<int,1,3> int1x3; typedef mat<float,1,3> float1x3; typedef mat<double,1,3> double1x3;
619 typedef mat<bool,1,4> bool1x4; typedef mat<int,1,4> int1x4; typedef mat<float,1,4> float1x4; typedef mat<double,1,4> double1x4;
620 typedef mat<bool,2,1> bool2x1; typedef mat<int,2,1> int2x1; typedef mat<float,2,1> float2x1; typedef mat<double,2,1> double2x1;
621 typedef mat<bool,2,2> bool2x2; typedef mat<int,2,2> int2x2; typedef mat<float,2,2> float2x2; typedef mat<double,2,2> double2x2;
622 typedef mat<bool,2,3> bool2x3; typedef mat<int,2,3> int2x3; typedef mat<float,2,3> float2x3; typedef mat<double,2,3> double2x3;
623 typedef mat<bool,2,4> bool2x4; typedef mat<int,2,4> int2x4; typedef mat<float,2,4> float2x4; typedef mat<double,2,4> double2x4;
624 typedef mat<bool,3,1> bool3x1; typedef mat<int,3,1> int3x1; typedef mat<float,3,1> float3x1; typedef mat<double,3,1> double3x1;
625 typedef mat<bool,3,2> bool3x2; typedef mat<int,3,2> int3x2; typedef mat<float,3,2> float3x2; typedef mat<double,3,2> double3x2;
626 typedef mat<bool,3,3> bool3x3; typedef mat<int,3,3> int3x3; typedef mat<float,3,3> float3x3; typedef mat<double,3,3> double3x3;
627 typedef mat<bool,3,4> bool3x4; typedef mat<int,3,4> int3x4; typedef mat<float,3,4> float3x4; typedef mat<double,3,4> double3x4;
628 typedef mat<bool,4,1> bool4x1; typedef mat<int,4,1> int4x1; typedef mat<float,4,1> float4x1; typedef mat<double,4,1> double4x1;
629 typedef mat<bool,4,2> bool4x2; typedef mat<int,4,2> int4x2; typedef mat<float,4,2> float4x2; typedef mat<double,4,2> double4x2;
630 typedef mat<bool,4,3> bool4x3; typedef mat<int,4,3> int4x3; typedef mat<float,4,3> float4x3; typedef mat<double,4,3> double4x3;
631 typedef mat<bool,4,4> bool4x4; typedef mat<int,4,4> int4x4; typedef mat<float,4,4> float4x4; typedef mat<double,4,4> double4x4;
632 }
633
634 // Provide output streaming operators, writing something that resembles an aggregate literal that could be used to construct the specified value
635 namespace ostream_overloads
636 {
637 template<class C, class T> std::basic_ostream<C> & operator << (std::basic_ostream<C> & out, const vec<T,1> & v) { return out << '{' << v[0] << '}'; }
638 template<class C, class T> std::basic_ostream<C> & operator << (std::basic_ostream<C> & out, const vec<T,2> & v) { return out << '{' << v[0] << ',' << v[1] << '}'; }
639 template<class C, class T> std::basic_ostream<C> & operator << (std::basic_ostream<C> & out, const vec<T,3> & v) { return out << '{' << v[0] << ',' << v[1] << ',' << v[2] << '}'; }
640 template<class C, class T> std::basic_ostream<C> & operator << (std::basic_ostream<C> & out, const vec<T,4> & v) { return out << '{' << v[0] << ',' << v[1] << ',' << v[2] << ',' << v[3] << '}'; }
641
642 template<class C, class T, int M> std::basic_ostream<C> & operator << (std::basic_ostream<C> & out, const mat<T,M,1> & m) { return out << '{' << m[0] << '}'; }
643 template<class C, class T, int M> std::basic_ostream<C> & operator << (std::basic_ostream<C> & out, const mat<T,M,2> & m) { return out << '{' << m[0] << ',' << m[1] << '}'; }
644 template<class C, class T, int M> std::basic_ostream<C> & operator << (std::basic_ostream<C> & out, const mat<T,M,3> & m) { return out << '{' << m[0] << ',' << m[1] << ',' << m[2] << '}'; }
645 template<class C, class T, int M> std::basic_ostream<C> & operator << (std::basic_ostream<C> & out, const mat<T,M,4> & m) { return out << '{' << m[0] << ',' << m[1] << ',' << m[2] << ',' << m[3] << '}'; }
646 }
647 }
648
649 namespace std
650 {
651 // Provide specializations for std::hash<...> with linalg types
652 template<class T> struct hash<linalg::vec<T,1>> { std::size_t operator()(const linalg::vec<T,1> & v) const { std::hash<T> h; return h(v.x); } };
653 template<class T> struct hash<linalg::vec<T,2>> { std::size_t operator()(const linalg::vec<T,2> & v) const { std::hash<T> h; return h(v.x) ^ (h(v.y) << 1); } };
654 template<class T> struct hash<linalg::vec<T,3>> { std::size_t operator()(const linalg::vec<T,3> & v) const { std::hash<T> h; return h(v.x) ^ (h(v.y) << 1) ^ (h(v.z) << 2); } };
655 template<class T> struct hash<linalg::vec<T,4>> { std::size_t operator()(const linalg::vec<T,4> & v) const { std::hash<T> h; return h(v.x) ^ (h(v.y) << 1) ^ (h(v.z) << 2) ^ (h(v.w) << 3); } };
656
657 template<class T, int M> struct hash<linalg::mat<T,M,1>> { std::size_t operator()(const linalg::mat<T,M,1> & v) const { std::hash<linalg::vec<T,M>> h; return h(v.x); } };
658 template<class T, int M> struct hash<linalg::mat<T,M,2>> { std::size_t operator()(const linalg::mat<T,M,2> & v) const { std::hash<linalg::vec<T,M>> h; return h(v.x) ^ (h(v.y) << M); } };
659 template<class T, int M> struct hash<linalg::mat<T,M,3>> { std::size_t operator()(const linalg::mat<T,M,3> & v) const { std::hash<linalg::vec<T,M>> h; return h(v.x) ^ (h(v.y) << M) ^ (h(v.z) << (M*2)); } };
660 template<class T, int M> struct hash<linalg::mat<T,M,4>> { std::size_t operator()(const linalg::mat<T,M,4> & v) const { std::hash<linalg::vec<T,M>> h; return h(v.x) ^ (h(v.y) << M) ^ (h(v.z) << (M*2)) ^ (h(v.w) << (M*3)); } };
661 }
662
663 // Definitions of functions too long to be defined inline
664 template<class T> constexpr linalg::mat<T,3,3> linalg::adjugate(const mat<T,3,3> & a)
665 {
666 return {{a.y.y*a.z.z - a.z.y*a.y.z, a.z.y*a.x.z - a.x.y*a.z.z, a.x.y*a.y.z - a.y.y*a.x.z},
667 {a.y.z*a.z.x - a.z.z*a.y.x, a.z.z*a.x.x - a.x.z*a.z.x, a.x.z*a.y.x - a.y.z*a.x.x},
668 {a.y.x*a.z.y - a.z.x*a.y.y, a.z.x*a.x.y - a.x.x*a.z.y, a.x.x*a.y.y - a.y.x*a.x.y}};
669 }
670
671 template<class T> constexpr linalg::mat<T,4,4> linalg::adjugate(const mat<T,4,4> & a)
672 {
673 return {{a.y.y*a.z.z*a.w.w + a.w.y*a.y.z*a.z.w + a.z.y*a.w.z*a.y.w - a.y.y*a.w.z*a.z.w - a.z.y*a.y.z*a.w.w - a.w.y*a.z.z*a.y.w,
674 a.x.y*a.w.z*a.z.w + a.z.y*a.x.z*a.w.w + a.w.y*a.z.z*a.x.w - a.w.y*a.x.z*a.z.w - a.z.y*a.w.z*a.x.w - a.x.y*a.z.z*a.w.w,
675 a.x.y*a.y.z*a.w.w + a.w.y*a.x.z*a.y.w + a.y.y*a.w.z*a.x.w - a.x.y*a.w.z*a.y.w - a.y.y*a.x.z*a.w.w - a.w.y*a.y.z*a.x.w,
676 a.x.y*a.z.z*a.y.w + a.y.y*a.x.z*a.z.w + a.z.y*a.y.z*a.x.w - a.x.y*a.y.z*a.z.w - a.z.y*a.x.z*a.y.w - a.y.y*a.z.z*a.x.w},
677 {a.y.z*a.w.w*a.z.x + a.z.z*a.y.w*a.w.x + a.w.z*a.z.w*a.y.x - a.y.z*a.z.w*a.w.x - a.w.z*a.y.w*a.z.x - a.z.z*a.w.w*a.y.x,
678 a.x.z*a.z.w*a.w.x + a.w.z*a.x.w*a.z.x + a.z.z*a.w.w*a.x.x - a.x.z*a.w.w*a.z.x - a.z.z*a.x.w*a.w.x - a.w.z*a.z.w*a.x.x,
679 a.x.z*a.w.w*a.y.x + a.y.z*a.x.w*a.w.x + a.w.z*a.y.w*a.x.x - a.x.z*a.y.w*a.w.x - a.w.z*a.x.w*a.y.x - a.y.z*a.w.w*a.x.x,
680 a.x.z*a.y.w*a.z.x + a.z.z*a.x.w*a.y.x + a.y.z*a.z.w*a.x.x - a.x.z*a.z.w*a.y.x - a.y.z*a.x.w*a.z.x - a.z.z*a.y.w*a.x.x},
681 {a.y.w*a.z.x*a.w.y + a.w.w*a.y.x*a.z.y + a.z.w*a.w.x*a.y.y - a.y.w*a.w.x*a.z.y - a.z.w*a.y.x*a.w.y - a.w.w*a.z.x*a.y.y,
682 a.x.w*a.w.x*a.z.y + a.z.w*a.x.x*a.w.y + a.w.w*a.z.x*a.x.y - a.x.w*a.z.x*a.w.y - a.w.w*a.x.x*a.z.y - a.z.w*a.w.x*a.x.y,
683 a.x.w*a.y.x*a.w.y + a.w.w*a.x.x*a.y.y + a.y.w*a.w.x*a.x.y - a.x.w*a.w.x*a.y.y - a.y.w*a.x.x*a.w.y - a.w.w*a.y.x*a.x.y,
684 a.x.w*a.z.x*a.y.y + a.y.w*a.x.x*a.z.y + a.z.w*a.y.x*a.x.y - a.x.w*a.y.x*a.z.y - a.z.w*a.x.x*a.y.y - a.y.w*a.z.x*a.x.y},
685 {a.y.x*a.w.y*a.z.z + a.z.x*a.y.y*a.w.z + a.w.x*a.z.y*a.y.z - a.y.x*a.z.y*a.w.z - a.w.x*a.y.y*a.z.z - a.z.x*a.w.y*a.y.z,
686 a.x.x*a.z.y*a.w.z + a.w.x*a.x.y*a.z.z + a.z.x*a.w.y*a.x.z - a.x.x*a.w.y*a.z.z - a.z.x*a.x.y*a.w.z - a.w.x*a.z.y*a.x.z,
687 a.x.x*a.w.y*a.y.z + a.y.x*a.x.y*a.w.z + a.w.x*a.y.y*a.x.z - a.x.x*a.y.y*a.w.z - a.w.x*a.x.y*a.y.z - a.y.x*a.w.y*a.x.z,
688 a.x.x*a.y.y*a.z.z + a.z.x*a.x.y*a.y.z + a.y.x*a.z.y*a.x.z - a.x.x*a.z.y*a.y.z - a.y.x*a.x.y*a.z.z - a.z.x*a.y.y*a.x.z}};
689 }
690
691 template<class T> constexpr T linalg::determinant(const mat<T,4,4> & a)
692 {
693 return a.x.x*(a.y.y*a.z.z*a.w.w + a.w.y*a.y.z*a.z.w + a.z.y*a.w.z*a.y.w - a.y.y*a.w.z*a.z.w - a.z.y*a.y.z*a.w.w - a.w.y*a.z.z*a.y.w)
694 + a.x.y*(a.y.z*a.w.w*a.z.x + a.z.z*a.y.w*a.w.x + a.w.z*a.z.w*a.y.x - a.y.z*a.z.w*a.w.x - a.w.z*a.y.w*a.z.x - a.z.z*a.w.w*a.y.x)
695 + a.x.z*(a.y.w*a.z.x*a.w.y + a.w.w*a.y.x*a.z.y + a.z.w*a.w.x*a.y.y - a.y.w*a.w.x*a.z.y - a.z.w*a.y.x*a.w.y - a.w.w*a.z.x*a.y.y)
696 + a.x.w*(a.y.x*a.w.y*a.z.z + a.z.x*a.y.y*a.w.z + a.w.x*a.z.y*a.y.z - a.y.x*a.z.y*a.w.z - a.w.x*a.y.y*a.z.z - a.z.x*a.w.y*a.y.z);
697 }
698
699 template<class T> linalg::vec<T,4> linalg::rotation_quat(const mat<T,3,3> & m)
700 {
701 const vec<T,4> q {m.x.x-m.y.y-m.z.z, m.y.y-m.x.x-m.z.z, m.z.z-m.x.x-m.y.y, m.x.x+m.y.y+m.z.z}, s[] {
702 {1, m.x.y + m.y.x, m.z.x + m.x.z, m.y.z - m.z.y},
703 {m.x.y + m.y.x, 1, m.y.z + m.z.y, m.z.x - m.x.z},
704 {m.x.z + m.z.x, m.y.z + m.z.y, 1, m.x.y - m.y.x},
705 {m.y.z - m.z.y, m.z.x - m.x.z, m.x.y - m.y.x, 1}};
706 return copysign(normalize(sqrt(max(T(0), T(1)+q))), s[argmax(q)]);
707 }
708
709 template<class T> linalg::mat<T,4,4> linalg::lookat_matrix(const vec<T,3> & eye, const vec<T,3> & center, const vec<T,3> & view_y_dir, fwd_axis a)
710 {
711 const vec<T,3> f = normalize(center - eye), z = a == pos_z ? f : -f, x = normalize(cross(view_y_dir, z)), y = cross(z, x);
712 return inverse(mat<T,4,4>{{x,0},{y,0},{z,0},{eye,1}});
713 }
714
715 template<class T> linalg::mat<T,4,4> linalg::frustum_matrix(T x0, T x1, T y0, T y1, T n, T f, fwd_axis a, z_range z)
716 {
717 const T s = a == pos_z ? T(1) : T(-1), o = z == neg_one_to_one ? n : 0;
718 return {{2*n/(x1-x0),0,0,0}, {0,2*n/(y1-y0),0,0}, {-s*(x0+x1)/(x1-x0),-s*(y0+y1)/(y1-y0),s*(f+o)/(f-n),s}, {0,0,-(n+o)*f/(f-n),0}};
719 }
720
721 #endif
File include/fighter.h added (mode: 100755) (index 0000000..8a155de)
1 #ifndef FIGHTER_H
2 #define FIGHTER_H
3
4 #ifndef FWORLD_H
5 #error Include fworld.h before fighter.h so the world can be referenced.
6 #endif
7
8 #include <stdio.h>
9
10 #include <cmath>
11 #include <cstdlib>
12
13 #include <functional>
14 #include <vector>
15
16 namespace fighter {
17
18 struct Fighter {
19 size_t entity_index;
20 int minimum_health;
21 };
22
23 fworld::Entity* FindTarget(
24 fworld::World* world,
25 fworld::Entity &entity,
26 bool attacking );
27
28 fworld::Entity* GetMeleeTarget(
29 fworld::World* world,
30 fworld::Entity &entity );
31
32 void AI(
33 std::vector<Fighter>* fighters,
34 fworld::World* world,
35 unsigned int rand_seed,
36 double d );
37
38 std::vector<Fighter> GetFighters( fworld::World* world );
39
40 fworld::Entity* FindTarget(
41 fworld::World* world,
42 fworld::Entity &entity,
43 bool attacking ){
44
45 // Make a list of targets.
46 std::vector<fworld::Entity*> targets;
47 for( auto &e : world->entities ){
48 long long tile_x = e.x + 0.5, tile_y = e.y + 0.5;
49 if( ( attacking
50 ? ( e.type == "spawn" || e.type == "player" )
51 : ( e.type == "base" )
52 ) && !world->entitiesBumping( entity, e )
53 && !world->tileBlocking( tile_x, tile_y, true )
54 && world->reachable( (long long)( entity.x + 0.5 ), (long long)( entity.y + 0.5 ), tile_x, tile_y, 15, true ) ){
55 targets.push_back( &e );
56 }
57 }
58 if( targets.size() > 0 ){
59 // Randomly pick a target. TODO: Attack the weakest.
60 return targets[(double)std::rand() / RAND_MAX * targets.size()];
61 }
62 return nullptr;
63 }
64
65 fworld::Entity* GetMeleeTarget(
66 fworld::World* world,
67 fworld::Entity &entity ){
68
69 // Make a list of targets.
70 std::vector<fworld::Entity*> targets;
71 for( auto &e : world->entities ){
72 if( ( e.type == "spawn" || e.type == "player" )
73 && world->entitiesBumping( entity, e ) ){
74 targets.push_back( &e );
75 }
76 }
77 if( targets.size() > 0 ){
78 // Randomly pick a target. TODO: Attack the weakest.
79 return targets[(double)std::rand() / RAND_MAX * targets.size()];
80 }
81 return nullptr;
82 }
83
84 void AI(
85 std::vector<Fighter>* fighters,
86 fworld::World* world,
87 unsigned int rand_seed,
88 double d,
89 std::function<void(fworld::Entity*,fworld::Entity*,int)> hit_callback ){
90
91 std::srand( rand_seed );
92 // Perform AI logic on all of the fighters.
93 for( auto &f : *fighters ){
94 if( f.entity_index >= world->entities.size()
95 || world->entities[f.entity_index].type != "fighter" ){
96 // Entity misalignment. Reassign fighters.
97 // The less this happens, the better. TODO
98 #ifndef __EMSCRIPTEN__
99 //fprintf( stderr, "Fighters misaligned. Correcting.\n" );
100 #endif
101 *fighters = GetFighters( world );
102 return;
103 }
104 auto &ent = world->entities[f.entity_index];
105 double patience = 0.1;
106 // Check if the entity can get a hit in on a player.
107 fworld::Entity *target = GetMeleeTarget( world, ent );
108 if( target ){
109 // Face the target.
110 world->entityLookAt( ent, *target );
111 // Only attack if not stunned.
112 if( ent.stun <= 0.0 ){
113 ent.task = fworld::TASK_MELEE;
114 ent.stun = ent.meleeRecovery;
115 ent.frame = 0.0;
116 target->health -= ent.meleeDamage;
117 // Call the callback, where sounds and blood can be handled.
118 hit_callback( &ent, target, ent.meleeDamage );
119 }
120 }
121 if( ent.task == fworld::TASK_MELEE ){
122 if( ent.stun <= 0.0 ){
123 // Stop melee and reset boredom.
124 ent.task = fworld::TASK_NONE;
125 ent.boredom = patience;
126 }
127 }else if( ent.task == fworld::TASK_NONE
128 || ent.path.size() == 0 ){
129 // Entity is standing still away from the player.
130 ent.task = fworld::TASK_NONE;
131 ent.boredom += d;
132 if( ent.boredom >= patience ){
133 ent.boredom = 0.0;
134 // If the entity has sufficient health, find a player
135 // for it to attack. If the entity does not have
136 // sufficient health or no player is in range, find a
137 // base instead.
138 bool attacking = ent.health >= f.minimum_health;
139 target = FindTarget( world, ent, attacking );
140 if( attacking && !target ){
141 attacking = false;
142 target = FindTarget( world, ent, attacking );
143 }
144 if( target ){
145 // Keep all paths open if attacking.
146 if( !attacking )
147 ent.task = fworld::TASK_BUMP;
148 world->solveEntityPath(
149 ent,
150 (long long)( target->x + 0.5 ),
151 (long long)( target->y + 0.5 ),
152 true
153 );
154 }
155 }
156 }
157 // Stop the entity's walking animation if not walking or fighting.
158 if( ent.path.size() == 0 && ent.task != fworld::TASK_MELEE ){
159 ent.walking = false;
160 ent.frame = 0.0;
161 }
162 }
163 }
164
165 std::vector<Fighter> GetFighters( fworld::World* world ){
166 std::vector<Fighter> fighters;
167 for( size_t i = 0; i < world->entities.size(); i++ ){
168 auto &ent = world->entities[i];
169 if( ent.type == "fighter" ){
170 Fighter f = {};
171 f.entity_index = i;
172 f.minimum_health = 20;
173 ent.task = fworld::TASK_NONE;
174 fighters.push_back( f );
175 }
176 }
177 return fighters;
178 }
179
180 } // namespace fighter
181
182 #endif // FIGHTER_H
File include/flora.h added (mode: 100755) (index 0000000..1c632b9)
1 #ifndef FLORA_H
2 #define FLORA_H
3
4 #ifndef FWORLD_H
5 # error Include fworld.h before flora.h so the world can be referenced.
6 #endif
7
8 #include <cmath>
9
10 #include <random>
11 #include <vector>
12
13 namespace flora {
14
15 // The largest collision radius to be considered nil.
16 static const double collision_epsilon = 0.000001;
17
18 // FixEntityTile constants.
19 static const bool
20 PLACE = true,
21 REMOVE = false;
22
23 struct Plant {
24 size_t entity_index;
25 double fertility;
26 };
27
28 /** Fix the tile at an entity's location.
29 *
30 * To be called when you want to place or remove an entity.
31 *
32 * When you place an entity, this function recalculates the tile at the
33 * entity's location. When you remove an entity, this function deletes
34 * the entity from the world's `entities` list and recalculates the tile
35 * at the entity's former location.
36 */
37 void FixEntityTile(
38 size_t entity_index,
39 fworld::World* world,
40 bool action ){
41
42 auto &ent = world->entities[entity_index];
43
44 long long
45 x = ent.x + 0.5,
46 y = ent.y + 0.5;
47
48 if( action == PLACE ){
49 // If the plant has collisions, recalculate the map's collision
50 // data. Note that this is a costly operation, especially within
51 // a loop. Because plants reproduce by default, you may soon
52 // have growth cycles where collision data is recalculated
53 // hundreds of times.
54 if( std::abs( ent.collisionRadius ) > collision_epsilon ){
55 world->recalculateMapEntities();
56 }else{
57 // No collisions? Then it's an F0.
58 world->mapEntities[y][x] = 0xF0;
59 }
60 }else{ // action == REMOVE
61 // Delete the entity.
62 world->removeEntity( entity_index );
63 }
64
65 // The map is now on a slippery slope with regards to memory.
66 // This flag signals that the memory has changed and caution should
67 // be exercised.
68 world->mapChanged = true;
69 }
70
71 /** Plant an entity at (x,y) and add it to the list of growing plants.
72 *
73 * You can construct any `fworld::Entity` and place it using this
74 * function. From this point onwards, it will be treated as a plant.
75 *
76 * @return `true` on success or `false` on failure.
77 */
78 bool Germinate(
79 std::vector<Plant>* plants,
80 fworld::World* world,
81 const fworld::Entity &ent,
82 unsigned int rand_seed,
83 double fertility,
84 long long x,
85 long long y ){
86
87 // Fail if the tile is blocked or filled by another static entity.
88 if( world->tileBlocking( x, y, true )
89 || world->mapEntities[y][x] >= 0xB0 ){
90 return false;
91 }
92
93 std::mt19937_64 mt( rand_seed );
94 std::uniform_real_distribution<double> unit_dist( 0.0, 1.0 );
95
96 Plant p = {};
97 p.entity_index = world->entities.size();
98 p.fertility = fertility;
99 plants->push_back( p );
100
101 // TODO(fluffrabbit): The plant's inventory.
102 world->entities.push_back( ent );
103 auto &new_ent = world->entities.back();
104 new_ent.type = "flora";
105 new_ent.x = x;
106 new_ent.y = y;
107 // Randomly age the plant to make its growth unpredictable.
108 new_ent.age = unit_dist( mt ) * 0.5;
109 new_ent.frame = 0.0;
110 new_ent.animationMode = fworld::ANIMATION_MANUAL;
111
112 FixEntityTile( p.entity_index, world, PLACE );
113
114 return true;
115 }
116
117 /** Kill the plant located at `plant_index` in `plants`.
118 */
119 void Kill(
120 size_t plant_index,
121 std::vector<Plant>* plants,
122 fworld::World* world ){
123
124 size_t entity_index = (*plants)[plant_index].entity_index;
125 FixEntityTile( entity_index, world, REMOVE );
126 plants->erase( plants->begin() + plant_index );
127 // Fix references to entities.
128 for( auto &p : *plants ){
129 // If plant's entity index would be affected by a deletion...
130 if( p.entity_index > entity_index ){
131 // Lower the plant's entity index by 1.
132 p.entity_index--;
133 }
134 }
135 }
136
137 /** Wrapper for `Kill()` that takes an entity index.
138 */
139 void KillEntity(
140 size_t entity_index,
141 std::vector<Plant>* plants,
142 fworld::World* world ){
143
144 // Find the entity.
145 for( size_t i = 0; i < plants->size(); i++ ){
146 if( (*plants)[i].entity_index == entity_index ){
147 // Entity indices match.
148 Kill( i, plants, world );
149 return;
150 }
151 }
152 }
153
154 /** Run the growth cycles for the plants.
155 */
156 void Grow(
157 std::vector<Plant>* plants,
158 fworld::World* world,
159 unsigned int rand_seed,
160 double growth_rate,
161 double fertility_rate = 1.444 ){ // 1.444 is usually pretty balanced.
162
163 // The germination probabilities match a standard 3x3 blur kernel.
164 // This should result in a roughly circular spread.
165 const double
166 prob_centered = fertility_rate * 0.25,
167 prob_cardinal = fertility_rate * 0.125,
168 prob_diagonal = fertility_rate * 0.0625;
169
170 std::mt19937_64 mt( rand_seed );
171 std::uniform_real_distribution<double> unit_dist( 0.0, 1.0 );
172
173 auto Seed = [&](
174 size_t plant_index,
175 long long x,
176 long long y ){
177
178 Plant &p = (*plants)[plant_index];
179 auto &ent = world->entities[p.entity_index];
180
181 // Round the parent plant's position to the nearest tile.
182 long long
183 e_x = ent.x + 0.5,
184 e_y = ent.y + 0.5;
185
186 // Determine the probability of germinating based on orientation
187 // relative to the parent plant.
188 double probability = prob_cardinal;
189 if( e_x != x && e_y != y ){
190 probability = prob_diagonal;
191 }else if( e_x == x && e_y == y ){
192 probability = prob_centered;
193 }
194
195 // There is a chance that the new plant will germinate at (x,y).
196 // Determining factors include orientation, reachability, and
197 // the parent plant's fertility.
198 if( unit_dist( mt ) < probability * p.fertility
199 && world->reachable( e_x, e_y, x, y, 3, true ) ){
200 // If the parent plant germinates on its own tile, reset it.
201 if( e_x == x && e_y == y ){
202 // Same random aging as in Germinate.
203 ent.age = unit_dist( mt ) * 0.5;
204 ent.frame = 0.0;
205 }else{
206 Germinate( plants, world, ent, rand_seed, p.fertility, x, y );
207 }
208 }
209 };
210
211 // Only iterate over the initial number of plants at the beginning
212 // of the growth cycle.
213 size_t max_cycle = plants->size();
214 for( size_t i = 0; i < max_cycle; i++ ){
215 Plant &p = (*plants)[i];
216 auto &ent = world->entities[p.entity_index];
217 ent.age += growth_rate;
218 ent.frame = std::floor( ent.age );
219 // If the a is at least 3.0 (fourth frame) the plant seeds.
220 if( ent.age >= 3.0 && p.fertility > 0.0 ){
221 // Round the parent plant's position to the nearest tile.
222 // Yes, this is redundant.
223 long long
224 e_x = ent.x + 0.5,
225 e_y = ent.y + 0.5;
226 // Seed in the 3x3 square centered at the parent plant.
227 for( long long x = e_x - 1; x <= e_x + 1; x++ ){
228 for( long long y = e_y - 1; y <= e_y + 1; y++ ){
229 Seed( i, x, y );
230 }
231 }
232 // If the plant did not reseed itself, it is now infertile.
233 if( ent.age >= 3.0 ){
234 p.fertility = 0.0;
235 }
236 }
237 }
238 // Delete the old plants.
239 for( size_t i = 0; i < plants->size(); i++ ){
240 Plant &p = (*plants)[i];
241 auto &ent = world->entities[p.entity_index];
242 // No plants live past this age.
243 if( ent.age >= 4.0 ){
244 Kill( i, plants, world );
245 }
246 }
247 }
248
249 /** Returns a vector of `Plant`s in a given world.
250 *
251 * Call this function whenever a new map is loaded or an entity is
252 * deleted externally.
253 */
254 std::vector<Plant> GetPlants( fworld::World* world ){
255
256 std::vector<Plant> plants;
257 for( size_t i = 0; i < world->entities.size(); i++ ){
258 auto &ent = world->entities[i];
259 if( ent.type == "flora" ){
260 ent.animationMode = fworld::ANIMATION_MANUAL;
261 Plant p = {};
262 p.entity_index = i;
263 // Only plants in the first 3 growth phases are fertile.
264 p.fertility = ent.age < 3.0 ? 1.0 : 0.0;
265 plants.push_back( p );
266 }
267 }
268 return plants;
269 }
270
271 } // namespace flora
272
273 #endif // FLORA_H
File include/force_link_glibc_2.25.h added (mode: 100644) (index 0000000..0e9ad40)
1 // from https://github.com/wheybags/glibc_version_header
2 #if !defined(SET_GLIBC_LINK_VERSIONS_HEADER) && !defined(__ASSEMBLER__)
3 #define SET_GLIBC_LINK_VERSIONS_HEADER
4 __asm__(".symver _Exit,_Exit@GLIBC_2.2.5");
5 __asm__(".symver _IO_2_1_stderr_,_IO_2_1_stderr_@GLIBC_2.2.5");
6 __asm__(".symver _IO_2_1_stdin_,_IO_2_1_stdin_@GLIBC_2.2.5");
7 __asm__(".symver _IO_2_1_stdout_,_IO_2_1_stdout_@GLIBC_2.2.5");
8 __asm__(".symver _IO_adjust_column,_IO_adjust_column@GLIBC_2.2.5");
9 __asm__(".symver _IO_adjust_wcolumn,_IO_adjust_wcolumn@GLIBC_2.2.5");
10 __asm__(".symver _IO_default_doallocate,_IO_default_doallocate@GLIBC_2.2.5");
11 __asm__(".symver _IO_default_finish,_IO_default_finish@GLIBC_2.2.5");
12 __asm__(".symver _IO_default_pbackfail,_IO_default_pbackfail@GLIBC_2.2.5");
13 __asm__(".symver _IO_default_uflow,_IO_default_uflow@GLIBC_2.2.5");
14 __asm__(".symver _IO_default_xsgetn,_IO_default_xsgetn@GLIBC_2.2.5");
15 __asm__(".symver _IO_default_xsputn,_IO_default_xsputn@GLIBC_2.2.5");
16 __asm__(".symver _IO_do_write,_IO_do_write@GLIBC_2.2.5");
17 __asm__(".symver _IO_doallocbuf,_IO_doallocbuf@GLIBC_2.2.5");
18 __asm__(".symver _IO_fclose,_IO_fclose@GLIBC_2.2.5");
19 __asm__(".symver _IO_fdopen,_IO_fdopen@GLIBC_2.2.5");
20 __asm__(".symver _IO_feof,_IO_feof@GLIBC_2.2.5");
21 __asm__(".symver _IO_ferror,_IO_ferror@GLIBC_2.2.5");
22 __asm__(".symver _IO_fflush,_IO_fflush@GLIBC_2.2.5");
23 __asm__(".symver _IO_fgetpos,_IO_fgetpos@GLIBC_2.2.5");
24 __asm__(".symver _IO_fgetpos64,_IO_fgetpos64@GLIBC_2.2.5");
25 __asm__(".symver _IO_fgets,_IO_fgets@GLIBC_2.2.5");
26 __asm__(".symver _IO_file_attach,_IO_file_attach@GLIBC_2.2.5");
27 __asm__(".symver _IO_file_close,_IO_file_close@GLIBC_2.2.5");
28 __asm__(".symver _IO_file_close_it,_IO_file_close_it@GLIBC_2.2.5");
29 __asm__(".symver _IO_file_doallocate,_IO_file_doallocate@GLIBC_2.2.5");
30 __asm__(".symver _IO_file_finish,_IO_file_finish@GLIBC_2.2.5");
31 __asm__(".symver _IO_file_fopen,_IO_file_fopen@GLIBC_2.2.5");
32 __asm__(".symver _IO_file_init,_IO_file_init@GLIBC_2.2.5");
33 __asm__(".symver _IO_file_jumps,_IO_file_jumps@GLIBC_2.2.5");
34 __asm__(".symver _IO_file_open,_IO_file_open@GLIBC_2.2.5");
35 __asm__(".symver _IO_file_overflow,_IO_file_overflow@GLIBC_2.2.5");
36 __asm__(".symver _IO_file_read,_IO_file_read@GLIBC_2.2.5");
37 __asm__(".symver _IO_file_seek,_IO_file_seek@GLIBC_2.2.5");
38 __asm__(".symver _IO_file_seekoff,_IO_file_seekoff@GLIBC_2.2.5");
39 __asm__(".symver _IO_file_setbuf,_IO_file_setbuf@GLIBC_2.2.5");
40 __asm__(".symver _IO_file_stat,_IO_file_stat@GLIBC_2.2.5");
41 __asm__(".symver _IO_file_sync,_IO_file_sync@GLIBC_2.2.5");
42 __asm__(".symver _IO_file_underflow,_IO_file_underflow@GLIBC_2.2.5");
43 __asm__(".symver _IO_file_write,_IO_file_write@GLIBC_2.2.5");
44 __asm__(".symver _IO_file_xsputn,_IO_file_xsputn@GLIBC_2.2.5");
45 __asm__(".symver _IO_flockfile,_IO_flockfile@GLIBC_2.2.5");
46 __asm__(".symver _IO_flush_all,_IO_flush_all@GLIBC_2.2.5");
47 __asm__(".symver _IO_flush_all_linebuffered,_IO_flush_all_linebuffered@GLIBC_2.2.5");
48 __asm__(".symver _IO_fopen,_IO_fopen@GLIBC_2.2.5");
49 __asm__(".symver _IO_fprintf,_IO_fprintf@GLIBC_2.2.5");
50 __asm__(".symver _IO_fputs,_IO_fputs@GLIBC_2.2.5");
51 __asm__(".symver _IO_fread,_IO_fread@GLIBC_2.2.5");
52 __asm__(".symver _IO_free_backup_area,_IO_free_backup_area@GLIBC_2.2.5");
53 __asm__(".symver _IO_free_wbackup_area,_IO_free_wbackup_area@GLIBC_2.2.5");
54 __asm__(".symver _IO_fsetpos,_IO_fsetpos@GLIBC_2.2.5");
55 __asm__(".symver _IO_fsetpos64,_IO_fsetpos64@GLIBC_2.2.5");
56 __asm__(".symver _IO_ftell,_IO_ftell@GLIBC_2.2.5");
57 __asm__(".symver _IO_ftrylockfile,_IO_ftrylockfile@GLIBC_2.2.5");
58 __asm__(".symver _IO_funlockfile,_IO_funlockfile@GLIBC_2.2.5");
59 __asm__(".symver _IO_fwrite,_IO_fwrite@GLIBC_2.2.5");
60 __asm__(".symver _IO_getc,_IO_getc@GLIBC_2.2.5");
61 __asm__(".symver _IO_getline,_IO_getline@GLIBC_2.2.5");
62 __asm__(".symver _IO_getline_info,_IO_getline_info@GLIBC_2.2.5");
63 __asm__(".symver _IO_gets,_IO_gets@GLIBC_2.2.5");
64 __asm__(".symver _IO_init,_IO_init@GLIBC_2.2.5");
65 __asm__(".symver _IO_init_marker,_IO_init_marker@GLIBC_2.2.5");
66 __asm__(".symver _IO_init_wmarker,_IO_init_wmarker@GLIBC_2.2.5");
67 __asm__(".symver _IO_iter_begin,_IO_iter_begin@GLIBC_2.2.5");
68 __asm__(".symver _IO_iter_end,_IO_iter_end@GLIBC_2.2.5");
69 __asm__(".symver _IO_iter_file,_IO_iter_file@GLIBC_2.2.5");
70 __asm__(".symver _IO_iter_next,_IO_iter_next@GLIBC_2.2.5");
71 __asm__(".symver _IO_least_wmarker,_IO_least_wmarker@GLIBC_2.2.5");
72 __asm__(".symver _IO_link_in,_IO_link_in@GLIBC_2.2.5");
73 __asm__(".symver _IO_list_all,_IO_list_all@GLIBC_2.2.5");
74 __asm__(".symver _IO_list_lock,_IO_list_lock@GLIBC_2.2.5");
75 __asm__(".symver _IO_list_resetlock,_IO_list_resetlock@GLIBC_2.2.5");
76 __asm__(".symver _IO_list_unlock,_IO_list_unlock@GLIBC_2.2.5");
77 __asm__(".symver _IO_marker_delta,_IO_marker_delta@GLIBC_2.2.5");
78 __asm__(".symver _IO_marker_difference,_IO_marker_difference@GLIBC_2.2.5");
79 __asm__(".symver _IO_padn,_IO_padn@GLIBC_2.2.5");
80 __asm__(".symver _IO_peekc_locked,_IO_peekc_locked@GLIBC_2.2.5");
81 __asm__(".symver _IO_popen,_IO_popen@GLIBC_2.2.5");
82 __asm__(".symver _IO_printf,_IO_printf@GLIBC_2.2.5");
83 __asm__(".symver _IO_proc_close,_IO_proc_close@GLIBC_2.2.5");
84 __asm__(".symver _IO_proc_open,_IO_proc_open@GLIBC_2.2.5");
85 __asm__(".symver _IO_putc,_IO_putc@GLIBC_2.2.5");
86 __asm__(".symver _IO_puts,_IO_puts@GLIBC_2.2.5");
87 __asm__(".symver _IO_remove_marker,_IO_remove_marker@GLIBC_2.2.5");
88 __asm__(".symver _IO_seekmark,_IO_seekmark@GLIBC_2.2.5");
89 __asm__(".symver _IO_seekoff,_IO_seekoff@GLIBC_2.2.5");
90 __asm__(".symver _IO_seekpos,_IO_seekpos@GLIBC_2.2.5");
91 __asm__(".symver _IO_seekwmark,_IO_seekwmark@GLIBC_2.2.5");
92 __asm__(".symver _IO_setb,_IO_setb@GLIBC_2.2.5");
93 __asm__(".symver _IO_setbuffer,_IO_setbuffer@GLIBC_2.2.5");
94 __asm__(".symver _IO_setvbuf,_IO_setvbuf@GLIBC_2.2.5");
95 __asm__(".symver _IO_sgetn,_IO_sgetn@GLIBC_2.2.5");
96 __asm__(".symver _IO_sprintf,_IO_sprintf@GLIBC_2.2.5");
97 __asm__(".symver _IO_sputbackc,_IO_sputbackc@GLIBC_2.2.5");
98 __asm__(".symver _IO_sputbackwc,_IO_sputbackwc@GLIBC_2.2.5");
99 __asm__(".symver _IO_sscanf,_IO_sscanf@GLIBC_2.2.5");
100 __asm__(".symver _IO_str_init_readonly,_IO_str_init_readonly@GLIBC_2.2.5");
101 __asm__(".symver _IO_str_init_static,_IO_str_init_static@GLIBC_2.2.5");
102 __asm__(".symver _IO_str_overflow,_IO_str_overflow@GLIBC_2.2.5");
103 __asm__(".symver _IO_str_pbackfail,_IO_str_pbackfail@GLIBC_2.2.5");
104 __asm__(".symver _IO_str_seekoff,_IO_str_seekoff@GLIBC_2.2.5");
105 __asm__(".symver _IO_str_underflow,_IO_str_underflow@GLIBC_2.2.5");
106 __asm__(".symver _IO_sungetc,_IO_sungetc@GLIBC_2.2.5");
107 __asm__(".symver _IO_sungetwc,_IO_sungetwc@GLIBC_2.2.5");
108 __asm__(".symver _IO_switch_to_get_mode,_IO_switch_to_get_mode@GLIBC_2.2.5");
109 __asm__(".symver _IO_switch_to_main_wget_area,_IO_switch_to_main_wget_area@GLIBC_2.2.5");
110 __asm__(".symver _IO_switch_to_wbackup_area,_IO_switch_to_wbackup_area@GLIBC_2.2.5");
111 __asm__(".symver _IO_switch_to_wget_mode,_IO_switch_to_wget_mode@GLIBC_2.2.5");
112 __asm__(".symver _IO_un_link,_IO_un_link@GLIBC_2.2.5");
113 __asm__(".symver _IO_ungetc,_IO_ungetc@GLIBC_2.2.5");
114 __asm__(".symver _IO_unsave_markers,_IO_unsave_markers@GLIBC_2.2.5");
115 __asm__(".symver _IO_unsave_wmarkers,_IO_unsave_wmarkers@GLIBC_2.2.5");
116 __asm__(".symver _IO_vfprintf,_IO_vfprintf@GLIBC_2.2.5");
117 __asm__(".symver _IO_vfscanf,_IO_vfscanf@GLIBC_2.2.5");
118 __asm__(".symver _IO_vsprintf,_IO_vsprintf@GLIBC_2.2.5");
119 __asm__(".symver _IO_wdefault_doallocate,_IO_wdefault_doallocate@GLIBC_2.2.5");
120 __asm__(".symver _IO_wdefault_finish,_IO_wdefault_finish@GLIBC_2.2.5");
121 __asm__(".symver _IO_wdefault_pbackfail,_IO_wdefault_pbackfail@GLIBC_2.2.5");
122 __asm__(".symver _IO_wdefault_uflow,_IO_wdefault_uflow@GLIBC_2.2.5");
123 __asm__(".symver _IO_wdefault_xsgetn,_IO_wdefault_xsgetn@GLIBC_2.2.5");
124 __asm__(".symver _IO_wdefault_xsputn,_IO_wdefault_xsputn@GLIBC_2.2.5");
125 __asm__(".symver _IO_wdo_write,_IO_wdo_write@GLIBC_2.2.5");
126 __asm__(".symver _IO_wdoallocbuf,_IO_wdoallocbuf@GLIBC_2.2.5");
127 __asm__(".symver _IO_wfile_jumps,_IO_wfile_jumps@GLIBC_2.2.5");
128 __asm__(".symver _IO_wfile_overflow,_IO_wfile_overflow@GLIBC_2.2.5");
129 __asm__(".symver _IO_wfile_seekoff,_IO_wfile_seekoff@GLIBC_2.2.5");
130 __asm__(".symver _IO_wfile_sync,_IO_wfile_sync@GLIBC_2.2.5");
131 __asm__(".symver _IO_wfile_underflow,_IO_wfile_underflow@GLIBC_2.2.5");
132 __asm__(".symver _IO_wfile_xsputn,_IO_wfile_xsputn@GLIBC_2.2.5");
133 __asm__(".symver _IO_wmarker_delta,_IO_wmarker_delta@GLIBC_2.2.5");
134 __asm__(".symver _IO_wsetb,_IO_wsetb@GLIBC_2.2.5");
135 __asm__(".symver _LIB_VERSION,_LIB_VERSION@GLIBC_2.2.5");
136 __asm__(".symver _ZGVbN2v_cos,_ZGVbN2v_cos@GLIBC_2.22");
137 __asm__(".symver _ZGVbN2v_exp,_ZGVbN2v_exp@GLIBC_2.22");
138 __asm__(".symver _ZGVbN2v_log,_ZGVbN2v_log@GLIBC_2.22");
139 __asm__(".symver _ZGVbN2v_sin,_ZGVbN2v_sin@GLIBC_2.22");
140 __asm__(".symver _ZGVbN2vv_pow,_ZGVbN2vv_pow@GLIBC_2.22");
141 __asm__(".symver _ZGVbN2vvv_sincos,_ZGVbN2vvv_sincos@GLIBC_2.22");
142 __asm__(".symver _ZGVbN4v_cosf,_ZGVbN4v_cosf@GLIBC_2.22");
143 __asm__(".symver _ZGVbN4v_expf,_ZGVbN4v_expf@GLIBC_2.22");
144 __asm__(".symver _ZGVbN4v_logf,_ZGVbN4v_logf@GLIBC_2.22");
145 __asm__(".symver _ZGVbN4v_sinf,_ZGVbN4v_sinf@GLIBC_2.22");
146 __asm__(".symver _ZGVbN4vv_powf,_ZGVbN4vv_powf@GLIBC_2.22");
147 __asm__(".symver _ZGVbN4vvv_sincosf,_ZGVbN4vvv_sincosf@GLIBC_2.22");
148 __asm__(".symver _ZGVcN4v_cos,_ZGVcN4v_cos@GLIBC_2.22");
149 __asm__(".symver _ZGVcN4v_exp,_ZGVcN4v_exp@GLIBC_2.22");
150 __asm__(".symver _ZGVcN4v_log,_ZGVcN4v_log@GLIBC_2.22");
151 __asm__(".symver _ZGVcN4v_sin,_ZGVcN4v_sin@GLIBC_2.22");
152 __asm__(".symver _ZGVcN4vv_pow,_ZGVcN4vv_pow@GLIBC_2.22");
153 __asm__(".symver _ZGVcN4vvv_sincos,_ZGVcN4vvv_sincos@GLIBC_2.22");
154 __asm__(".symver _ZGVcN8v_cosf,_ZGVcN8v_cosf@GLIBC_2.22");
155 __asm__(".symver _ZGVcN8v_expf,_ZGVcN8v_expf@GLIBC_2.22");
156 __asm__(".symver _ZGVcN8v_logf,_ZGVcN8v_logf@GLIBC_2.22");
157 __asm__(".symver _ZGVcN8v_sinf,_ZGVcN8v_sinf@GLIBC_2.22");
158 __asm__(".symver _ZGVcN8vv_powf,_ZGVcN8vv_powf@GLIBC_2.22");
159 __asm__(".symver _ZGVcN8vvv_sincosf,_ZGVcN8vvv_sincosf@GLIBC_2.22");
160 __asm__(".symver _ZGVdN4v_cos,_ZGVdN4v_cos@GLIBC_2.22");
161 __asm__(".symver _ZGVdN4v_exp,_ZGVdN4v_exp@GLIBC_2.22");
162 __asm__(".symver _ZGVdN4v_log,_ZGVdN4v_log@GLIBC_2.22");
163 __asm__(".symver _ZGVdN4v_sin,_ZGVdN4v_sin@GLIBC_2.22");
164 __asm__(".symver _ZGVdN4vv_pow,_ZGVdN4vv_pow@GLIBC_2.22");
165 __asm__(".symver _ZGVdN4vvv_sincos,_ZGVdN4vvv_sincos@GLIBC_2.22");
166 __asm__(".symver _ZGVdN8v_cosf,_ZGVdN8v_cosf@GLIBC_2.22");
167 __asm__(".symver _ZGVdN8v_expf,_ZGVdN8v_expf@GLIBC_2.22");
168 __asm__(".symver _ZGVdN8v_logf,_ZGVdN8v_logf@GLIBC_2.22");
169 __asm__(".symver _ZGVdN8v_sinf,_ZGVdN8v_sinf@GLIBC_2.22");
170 __asm__(".symver _ZGVdN8vv_powf,_ZGVdN8vv_powf@GLIBC_2.22");
171 __asm__(".symver _ZGVdN8vvv_sincosf,_ZGVdN8vvv_sincosf@GLIBC_2.22");
172 __asm__(".symver _ZGVeN16v_cosf,_ZGVeN16v_cosf@GLIBC_2.22");
173 __asm__(".symver _ZGVeN16v_expf,_ZGVeN16v_expf@GLIBC_2.22");
174 __asm__(".symver _ZGVeN16v_logf,_ZGVeN16v_logf@GLIBC_2.22");
175 __asm__(".symver _ZGVeN16v_sinf,_ZGVeN16v_sinf@GLIBC_2.22");
176 __asm__(".symver _ZGVeN16vv_powf,_ZGVeN16vv_powf@GLIBC_2.22");
177 __asm__(".symver _ZGVeN16vvv_sincosf,_ZGVeN16vvv_sincosf@GLIBC_2.22");
178 __asm__(".symver _ZGVeN8v_cos,_ZGVeN8v_cos@GLIBC_2.22");
179 __asm__(".symver _ZGVeN8v_exp,_ZGVeN8v_exp@GLIBC_2.22");
180 __asm__(".symver _ZGVeN8v_log,_ZGVeN8v_log@GLIBC_2.22");
181 __asm__(".symver _ZGVeN8v_sin,_ZGVeN8v_sin@GLIBC_2.22");
182 __asm__(".symver _ZGVeN8vv_pow,_ZGVeN8vv_pow@GLIBC_2.22");
183 __asm__(".symver _ZGVeN8vvv_sincos,_ZGVeN8vvv_sincos@GLIBC_2.22");
184 __asm__(".symver __acos_finite,__acos_finite@GLIBC_2.15");
185 __asm__(".symver __acosf_finite,__acosf_finite@GLIBC_2.15");
186 __asm__(".symver __acosh_finite,__acosh_finite@GLIBC_2.15");
187 __asm__(".symver __acoshf_finite,__acoshf_finite@GLIBC_2.15");
188 __asm__(".symver __acoshl_finite,__acoshl_finite@GLIBC_2.15");
189 __asm__(".symver __acosl_finite,__acosl_finite@GLIBC_2.15");
190 __asm__(".symver __adjtimex,__adjtimex@GLIBC_2.2.5");
191 __asm__(".symver __after_morecore_hook,__after_morecore_hook@GLIBC_2.2.5");
192 __asm__(".symver __arch_prctl,__arch_prctl@GLIBC_2.2.5");
193 __asm__(".symver __argz_count,__argz_count@GLIBC_2.2.5");
194 __asm__(".symver __argz_next,__argz_next@GLIBC_2.2.5");
195 __asm__(".symver __argz_stringify,__argz_stringify@GLIBC_2.2.5");
196 __asm__(".symver __asin_finite,__asin_finite@GLIBC_2.15");
197 __asm__(".symver __asinf_finite,__asinf_finite@GLIBC_2.15");
198 __asm__(".symver __asinl_finite,__asinl_finite@GLIBC_2.15");
199 __asm__(".symver __asprintf,__asprintf@GLIBC_2.2.5");
200 __asm__(".symver __asprintf_chk,__asprintf_chk@GLIBC_2.8");
201 __asm__(".symver __assert,__assert@GLIBC_2.2.5");
202 __asm__(".symver __assert_fail,__assert_fail@GLIBC_2.2.5");
203 __asm__(".symver __assert_perror_fail,__assert_perror_fail@GLIBC_2.2.5");
204 __asm__(".symver __atan2_finite,__atan2_finite@GLIBC_2.15");
205 __asm__(".symver __atan2f_finite,__atan2f_finite@GLIBC_2.15");
206 __asm__(".symver __atan2l_finite,__atan2l_finite@GLIBC_2.15");
207 __asm__(".symver __atanh_finite,__atanh_finite@GLIBC_2.15");
208 __asm__(".symver __atanhf_finite,__atanhf_finite@GLIBC_2.15");
209 __asm__(".symver __atanhl_finite,__atanhl_finite@GLIBC_2.15");
210 __asm__(".symver __b64_ntop,__b64_ntop@GLIBC_2.2.5");
211 __asm__(".symver __b64_pton,__b64_pton@GLIBC_2.2.5");
212 __asm__(".symver __backtrace,__backtrace@GLIBC_2.2.5");
213 __asm__(".symver __backtrace_symbols,__backtrace_symbols@GLIBC_2.2.5");
214 __asm__(".symver __backtrace_symbols_fd,__backtrace_symbols_fd@GLIBC_2.2.5");
215 __asm__(".symver __bsd_getpgrp,__bsd_getpgrp@GLIBC_2.2.5");
216 __asm__(".symver __bzero,__bzero@GLIBC_2.2.5");
217 __asm__(".symver __check_rhosts_file,__check_rhosts_file@GLIBC_2.2.5");
218 __asm__(".symver __chk_fail,__chk_fail@GLIBC_2.3.4");
219 __asm__(".symver __clog10,__clog10@GLIBC_2.2.5");
220 __asm__(".symver __clog10f,__clog10f@GLIBC_2.2.5");
221 __asm__(".symver __clog10l,__clog10l@GLIBC_2.2.5");
222 __asm__(".symver __clone,__clone@GLIBC_2.2.5");
223 __asm__(".symver __close,__close@GLIBC_2.2.5");
224 __asm__(".symver __cmsg_nxthdr,__cmsg_nxthdr@GLIBC_2.2.5");
225 __asm__(".symver __confstr_chk,__confstr_chk@GLIBC_2.4");
226 __asm__(".symver __connect,__connect@GLIBC_2.2.5");
227 __asm__(".symver __cosh_finite,__cosh_finite@GLIBC_2.15");
228 __asm__(".symver __coshf_finite,__coshf_finite@GLIBC_2.15");
229 __asm__(".symver __coshl_finite,__coshl_finite@GLIBC_2.15");
230 __asm__(".symver __ctype_b_loc,__ctype_b_loc@GLIBC_2.3");
231 __asm__(".symver __ctype_get_mb_cur_max,__ctype_get_mb_cur_max@GLIBC_2.2.5");
232 __asm__(".symver __ctype_tolower_loc,__ctype_tolower_loc@GLIBC_2.3");
233 __asm__(".symver __ctype_toupper_loc,__ctype_toupper_loc@GLIBC_2.3");
234 __asm__(".symver __curbrk,__curbrk@GLIBC_2.2.5");
235 __asm__(".symver __cxa_at_quick_exit,__cxa_at_quick_exit@GLIBC_2.10");
236 __asm__(".symver __cxa_atexit,__cxa_atexit@GLIBC_2.2.5");
237 __asm__(".symver __cxa_finalize,__cxa_finalize@GLIBC_2.2.5");
238 __asm__(".symver __cxa_thread_atexit_impl,__cxa_thread_atexit_impl@GLIBC_2.18");
239 __asm__(".symver __cyg_profile_func_enter,__cyg_profile_func_enter@GLIBC_2.2.5");
240 __asm__(".symver __cyg_profile_func_exit,__cyg_profile_func_exit@GLIBC_2.2.5");
241 __asm__(".symver __daylight,__daylight@GLIBC_2.2.5");
242 __asm__(".symver __dcgettext,__dcgettext@GLIBC_2.2.5");
243 __asm__(".symver __default_morecore,__default_morecore@GLIBC_2.2.5");
244 __asm__(".symver __dgettext,__dgettext@GLIBC_2.2.5");
245 __asm__(".symver __dn_comp,__dn_comp@GLIBC_2.2.5");
246 __asm__(".symver __dn_count_labels,__dn_count_labels@GLIBC_2.2.5");
247 __asm__(".symver __dn_expand,__dn_expand@GLIBC_2.2.5");
248 __asm__(".symver __dn_skipname,__dn_skipname@GLIBC_2.2.5");
249 __asm__(".symver __dprintf_chk,__dprintf_chk@GLIBC_2.8");
250 __asm__(".symver __dup2,__dup2@GLIBC_2.2.5");
251 __asm__(".symver __duplocale,__duplocale@GLIBC_2.2.5");
252 __asm__(".symver __endmntent,__endmntent@GLIBC_2.2.5");
253 __asm__(".symver __environ,__environ@GLIBC_2.2.5");
254 __asm__(".symver __errno_location,__errno_location@GLIBC_2.2.5");
255 __asm__(".symver __exp10_finite,__exp10_finite@GLIBC_2.15");
256 __asm__(".symver __exp10f_finite,__exp10f_finite@GLIBC_2.15");
257 __asm__(".symver __exp10l_finite,__exp10l_finite@GLIBC_2.15");
258 __asm__(".symver __exp2_finite,__exp2_finite@GLIBC_2.15");
259 __asm__(".symver __exp2f_finite,__exp2f_finite@GLIBC_2.15");
260 __asm__(".symver __exp2l_finite,__exp2l_finite@GLIBC_2.15");
261 __asm__(".symver __exp_finite,__exp_finite@GLIBC_2.15");
262 __asm__(".symver __expf_finite,__expf_finite@GLIBC_2.15");
263 __asm__(".symver __expl_finite,__expl_finite@GLIBC_2.15");
264 __asm__(".symver __explicit_bzero_chk,__explicit_bzero_chk@GLIBC_2.25");
265 __asm__(".symver __fbufsize,__fbufsize@GLIBC_2.2.5");
266 __asm__(".symver __fcntl,__fcntl@GLIBC_2.2.5");
267 __asm__(".symver __fdelt_chk,__fdelt_chk@GLIBC_2.15");
268 __asm__(".symver __fdelt_warn,__fdelt_warn@GLIBC_2.15");
269 __asm__(".symver __fentry__,__fentry__@GLIBC_2.13");
270 __asm__(".symver __ffs,__ffs@GLIBC_2.2.5");
271 __asm__(".symver __fgets_chk,__fgets_chk@GLIBC_2.4");
272 __asm__(".symver __fgets_unlocked_chk,__fgets_unlocked_chk@GLIBC_2.4");
273 __asm__(".symver __fgetws_chk,__fgetws_chk@GLIBC_2.4");
274 __asm__(".symver __fgetws_unlocked_chk,__fgetws_unlocked_chk@GLIBC_2.4");
275 __asm__(".symver __finite,__finite@GLIBC_2.2.5");
276 __asm__(".symver __finitef,__finitef@GLIBC_2.2.5");
277 __asm__(".symver __finitel,__finitel@GLIBC_2.2.5");
278 __asm__(".symver __flbf,__flbf@GLIBC_2.2.5");
279 __asm__(".symver __fmod_finite,__fmod_finite@GLIBC_2.15");
280 __asm__(".symver __fmodf_finite,__fmodf_finite@GLIBC_2.15");
281 __asm__(".symver __fmodl_finite,__fmodl_finite@GLIBC_2.15");
282 __asm__(".symver __fork,__fork@GLIBC_2.2.5");
283 __asm__(".symver __fp_nquery,__fp_nquery@GLIBC_2.2.5");
284 __asm__(".symver __fp_query,__fp_query@GLIBC_2.2.5");
285 __asm__(".symver __fp_resstat,__fp_resstat@GLIBC_2.2.5");
286 __asm__(".symver __fpclassify,__fpclassify@GLIBC_2.2.5");
287 __asm__(".symver __fpclassifyf,__fpclassifyf@GLIBC_2.2.5");
288 __asm__(".symver __fpclassifyl,__fpclassifyl@GLIBC_2.2.5");
289 __asm__(".symver __fpending,__fpending@GLIBC_2.2.5");
290 __asm__(".symver __fprintf_chk,__fprintf_chk@GLIBC_2.3.4");
291 __asm__(".symver __fpu_control,__fpu_control@GLIBC_2.2.5");
292 __asm__(".symver __fpurge,__fpurge@GLIBC_2.2.5");
293 __asm__(".symver __fread_chk,__fread_chk@GLIBC_2.7");
294 __asm__(".symver __fread_unlocked_chk,__fread_unlocked_chk@GLIBC_2.7");
295 __asm__(".symver __freadable,__freadable@GLIBC_2.2.5");
296 __asm__(".symver __freading,__freading@GLIBC_2.2.5");
297 __asm__(".symver __free_fdresult,__free_fdresult@GLIBC_2.2.5");
298 __asm__(".symver __free_hook,__free_hook@GLIBC_2.2.5");
299 __asm__(".symver __freelocale,__freelocale@GLIBC_2.2.5");
300 __asm__(".symver __fsetlocking,__fsetlocking@GLIBC_2.2.5");
301 __asm__(".symver __fwprintf_chk,__fwprintf_chk@GLIBC_2.4");
302 __asm__(".symver __fwritable,__fwritable@GLIBC_2.2.5");
303 __asm__(".symver __fwriting,__fwriting@GLIBC_2.2.5");
304 __asm__(".symver __fxstat,__fxstat@GLIBC_2.2.5");
305 __asm__(".symver __fxstat64,__fxstat64@GLIBC_2.2.5");
306 __asm__(".symver __fxstatat,__fxstatat@GLIBC_2.4");
307 __asm__(".symver __fxstatat64,__fxstatat64@GLIBC_2.4");
308 __asm__(".symver __gamma_r_finite,__gamma_r_finite@GLIBC_2.15");
309 __asm__(".symver __gammaf_r_finite,__gammaf_r_finite@GLIBC_2.15");
310 __asm__(".symver __gammal_r_finite,__gammal_r_finite@GLIBC_2.15");
311 __asm__(".symver __getauxval,__getauxval@GLIBC_2.16");
312 __asm__(".symver __getcwd_chk,__getcwd_chk@GLIBC_2.4");
313 __asm__(".symver __getdelim,__getdelim@GLIBC_2.2.5");
314 __asm__(".symver __getdomainname_chk,__getdomainname_chk@GLIBC_2.4");
315 __asm__(".symver __getgroups_chk,__getgroups_chk@GLIBC_2.4");
316 __asm__(".symver __gethostname_chk,__gethostname_chk@GLIBC_2.4");
317 __asm__(".symver __getlogin_r_chk,__getlogin_r_chk@GLIBC_2.4");
318 __asm__(".symver __getmntent_r,__getmntent_r@GLIBC_2.2.5");
319 __asm__(".symver __getpagesize,__getpagesize@GLIBC_2.2.5");
320 __asm__(".symver __getpgid,__getpgid@GLIBC_2.2.5");
321 __asm__(".symver __getpid,__getpid@GLIBC_2.2.5");
322 __asm__(".symver __gets_chk,__gets_chk@GLIBC_2.3.4");
323 __asm__(".symver __gettimeofday,__gettimeofday@GLIBC_2.2.5");
324 __asm__(".symver __getwd_chk,__getwd_chk@GLIBC_2.4");
325 __asm__(".symver __gmtime_r,__gmtime_r@GLIBC_2.2.5");
326 __asm__(".symver __h_errno_location,__h_errno_location@GLIBC_2.2.5");
327 __asm__(".symver __hostalias,__hostalias@GLIBC_2.2.5");
328 __asm__(".symver __hypot_finite,__hypot_finite@GLIBC_2.15");
329 __asm__(".symver __hypotf_finite,__hypotf_finite@GLIBC_2.15");
330 __asm__(".symver __hypotl_finite,__hypotl_finite@GLIBC_2.15");
331 __asm__(".symver __isalnum_l,__isalnum_l@GLIBC_2.2.5");
332 __asm__(".symver __isalpha_l,__isalpha_l@GLIBC_2.2.5");
333 __asm__(".symver __isascii_l,__isascii_l@GLIBC_2.2.5");
334 __asm__(".symver __isblank_l,__isblank_l@GLIBC_2.2.5");
335 __asm__(".symver __iscanonicall,__iscanonicall@GLIBC_2.25");
336 __asm__(".symver __iscntrl_l,__iscntrl_l@GLIBC_2.2.5");
337 __asm__(".symver __isctype,__isctype@GLIBC_2.3");
338 __asm__(".symver __isdigit_l,__isdigit_l@GLIBC_2.2.5");
339 __asm__(".symver __iseqsig,__iseqsig@GLIBC_2.25");
340 __asm__(".symver __iseqsigf,__iseqsigf@GLIBC_2.25");
341 __asm__(".symver __iseqsigl,__iseqsigl@GLIBC_2.25");
342 __asm__(".symver __isgraph_l,__isgraph_l@GLIBC_2.2.5");
343 __asm__(".symver __isinf,__isinf@GLIBC_2.2.5");
344 __asm__(".symver __isinff,__isinff@GLIBC_2.2.5");
345 __asm__(".symver __isinfl,__isinfl@GLIBC_2.2.5");
346 __asm__(".symver __islower_l,__islower_l@GLIBC_2.2.5");
347 __asm__(".symver __isnan,__isnan@GLIBC_2.2.5");
348 __asm__(".symver __isnanf,__isnanf@GLIBC_2.2.5");
349 __asm__(".symver __isnanl,__isnanl@GLIBC_2.2.5");
350 __asm__(".symver __isoc99_fscanf,__isoc99_fscanf@GLIBC_2.7");
351 __asm__(".symver __isoc99_fwscanf,__isoc99_fwscanf@GLIBC_2.7");
352 __asm__(".symver __isoc99_scanf,__isoc99_scanf@GLIBC_2.7");
353 __asm__(".symver __isoc99_sscanf,__isoc99_sscanf@GLIBC_2.7");
354 __asm__(".symver __isoc99_swscanf,__isoc99_swscanf@GLIBC_2.7");
355 __asm__(".symver __isoc99_vfscanf,__isoc99_vfscanf@GLIBC_2.7");
356 __asm__(".symver __isoc99_vfwscanf,__isoc99_vfwscanf@GLIBC_2.7");
357 __asm__(".symver __isoc99_vscanf,__isoc99_vscanf@GLIBC_2.7");
358 __asm__(".symver __isoc99_vsscanf,__isoc99_vsscanf@GLIBC_2.7");
359 __asm__(".symver __isoc99_vswscanf,__isoc99_vswscanf@GLIBC_2.7");
360 __asm__(".symver __isoc99_vwscanf,__isoc99_vwscanf@GLIBC_2.7");
361 __asm__(".symver __isoc99_wscanf,__isoc99_wscanf@GLIBC_2.7");
362 __asm__(".symver __isprint_l,__isprint_l@GLIBC_2.2.5");
363 __asm__(".symver __ispunct_l,__ispunct_l@GLIBC_2.2.5");
364 __asm__(".symver __issignaling,__issignaling@GLIBC_2.18");
365 __asm__(".symver __issignalingf,__issignalingf@GLIBC_2.18");
366 __asm__(".symver __issignalingl,__issignalingl@GLIBC_2.18");
367 __asm__(".symver __isspace_l,__isspace_l@GLIBC_2.2.5");
368 __asm__(".symver __isupper_l,__isupper_l@GLIBC_2.2.5");
369 __asm__(".symver __iswalnum_l,__iswalnum_l@GLIBC_2.2.5");
370 __asm__(".symver __iswalpha_l,__iswalpha_l@GLIBC_2.2.5");
371 __asm__(".symver __iswblank_l,__iswblank_l@GLIBC_2.2.5");
372 __asm__(".symver __iswcntrl_l,__iswcntrl_l@GLIBC_2.2.5");
373 __asm__(".symver __iswctype,__iswctype@GLIBC_2.2.5");
374 __asm__(".symver __iswctype_l,__iswctype_l@GLIBC_2.2.5");
375 __asm__(".symver __iswdigit_l,__iswdigit_l@GLIBC_2.2.5");
376 __asm__(".symver __iswgraph_l,__iswgraph_l@GLIBC_2.2.5");
377 __asm__(".symver __iswlower_l,__iswlower_l@GLIBC_2.2.5");
378 __asm__(".symver __iswprint_l,__iswprint_l@GLIBC_2.2.5");
379 __asm__(".symver __iswpunct_l,__iswpunct_l@GLIBC_2.2.5");
380 __asm__(".symver __iswspace_l,__iswspace_l@GLIBC_2.2.5");
381 __asm__(".symver __iswupper_l,__iswupper_l@GLIBC_2.2.5");
382 __asm__(".symver __iswxdigit_l,__iswxdigit_l@GLIBC_2.2.5");
383 __asm__(".symver __isxdigit_l,__isxdigit_l@GLIBC_2.2.5");
384 __asm__(".symver __ivaliduser,__ivaliduser@GLIBC_2.2.5");
385 __asm__(".symver __j0_finite,__j0_finite@GLIBC_2.15");
386 __asm__(".symver __j0f_finite,__j0f_finite@GLIBC_2.15");
387 __asm__(".symver __j0l_finite,__j0l_finite@GLIBC_2.15");
388 __asm__(".symver __j1_finite,__j1_finite@GLIBC_2.15");
389 __asm__(".symver __j1f_finite,__j1f_finite@GLIBC_2.15");
390 __asm__(".symver __j1l_finite,__j1l_finite@GLIBC_2.15");
391 __asm__(".symver __jn_finite,__jn_finite@GLIBC_2.15");
392 __asm__(".symver __jnf_finite,__jnf_finite@GLIBC_2.15");
393 __asm__(".symver __jnl_finite,__jnl_finite@GLIBC_2.15");
394 __asm__(".symver __key_decryptsession_pk_LOCAL,__key_decryptsession_pk_LOCAL@GLIBC_2.2.5");
395 __asm__(".symver __key_encryptsession_pk_LOCAL,__key_encryptsession_pk_LOCAL@GLIBC_2.2.5");
396 __asm__(".symver __key_gendes_LOCAL,__key_gendes_LOCAL@GLIBC_2.2.5");
397 __asm__(".symver __lgamma_r_finite,__lgamma_r_finite@GLIBC_2.15");
398 __asm__(".symver __lgammaf_r_finite,__lgammaf_r_finite@GLIBC_2.15");
399 __asm__(".symver __lgammal_r_finite,__lgammal_r_finite@GLIBC_2.15");
400 __asm__(".symver __libc_allocate_rtsig,__libc_allocate_rtsig@GLIBC_2.2.5");
401 __asm__(".symver __libc_calloc,__libc_calloc@GLIBC_2.2.5");
402 __asm__(".symver __libc_current_sigrtmax,__libc_current_sigrtmax@GLIBC_2.2.5");
403 __asm__(".symver __libc_current_sigrtmin,__libc_current_sigrtmin@GLIBC_2.2.5");
404 __asm__(".symver __libc_free,__libc_free@GLIBC_2.2.5");
405 __asm__(".symver __libc_freeres,__libc_freeres@GLIBC_2.2.5");
406 __asm__(".symver __libc_init_first,__libc_init_first@GLIBC_2.2.5");
407 __asm__(".symver __libc_mallinfo,__libc_mallinfo@GLIBC_2.2.5");
408 __asm__(".symver __libc_malloc,__libc_malloc@GLIBC_2.2.5");
409 __asm__(".symver __libc_mallopt,__libc_mallopt@GLIBC_2.2.5");
410 __asm__(".symver __libc_memalign,__libc_memalign@GLIBC_2.2.5");
411 __asm__(".symver __libc_pvalloc,__libc_pvalloc@GLIBC_2.2.5");
412 __asm__(".symver __libc_realloc,__libc_realloc@GLIBC_2.2.5");
413 __asm__(".symver __libc_sa_len,__libc_sa_len@GLIBC_2.2.5");
414 __asm__(".symver __libc_stack_end,__libc_stack_end@GLIBC_2.2.5");
415 __asm__(".symver __libc_start_main,__libc_start_main@GLIBC_2.2.5");
416 __asm__(".symver __libc_valloc,__libc_valloc@GLIBC_2.2.5");
417 __asm__(".symver __loc_aton,__loc_aton@GLIBC_2.2.5");
418 __asm__(".symver __loc_ntoa,__loc_ntoa@GLIBC_2.2.5");
419 __asm__(".symver __log10_finite,__log10_finite@GLIBC_2.15");
420 __asm__(".symver __log10f_finite,__log10f_finite@GLIBC_2.15");
421 __asm__(".symver __log10l_finite,__log10l_finite@GLIBC_2.15");
422 __asm__(".symver __log2_finite,__log2_finite@GLIBC_2.15");
423 __asm__(".symver __log2f_finite,__log2f_finite@GLIBC_2.15");
424 __asm__(".symver __log2l_finite,__log2l_finite@GLIBC_2.15");
425 __asm__(".symver __log_finite,__log_finite@GLIBC_2.15");
426 __asm__(".symver __logf_finite,__logf_finite@GLIBC_2.15");
427 __asm__(".symver __logl_finite,__logl_finite@GLIBC_2.15");
428 __asm__(".symver __longjmp_chk,__longjmp_chk@GLIBC_2.11");
429 __asm__(".symver __lseek,__lseek@GLIBC_2.2.5");
430 __asm__(".symver __lxstat,__lxstat@GLIBC_2.2.5");
431 __asm__(".symver __lxstat64,__lxstat64@GLIBC_2.2.5");
432 __asm__(".symver __malloc_hook,__malloc_hook@GLIBC_2.2.5");
433 __asm__(".symver __mbrlen,__mbrlen@GLIBC_2.2.5");
434 __asm__(".symver __mbrtowc,__mbrtowc@GLIBC_2.2.5");
435 __asm__(".symver __mbsnrtowcs_chk,__mbsnrtowcs_chk@GLIBC_2.4");
436 __asm__(".symver __mbsrtowcs_chk,__mbsrtowcs_chk@GLIBC_2.4");
437 __asm__(".symver __mbstowcs_chk,__mbstowcs_chk@GLIBC_2.4");
438 __asm__(".symver __memalign_hook,__memalign_hook@GLIBC_2.2.5");
439 __asm__(".symver __memcpy_chk,__memcpy_chk@GLIBC_2.3.4");
440 __asm__(".symver __memmove_chk,__memmove_chk@GLIBC_2.3.4");
441 __asm__(".symver __mempcpy,__mempcpy@GLIBC_2.2.5");
442 __asm__(".symver __mempcpy_chk,__mempcpy_chk@GLIBC_2.3.4");
443 __asm__(".symver __memset_chk,__memset_chk@GLIBC_2.3.4");
444 __asm__(".symver __monstartup,__monstartup@GLIBC_2.2.5");
445 __asm__(".symver __morecore,__morecore@GLIBC_2.2.5");
446 __asm__(".symver __mq_open_2,__mq_open_2@GLIBC_2.7");
447 __asm__(".symver __nanosleep,__nanosleep@GLIBC_2.2.6");
448 __asm__(".symver __newlocale,__newlocale@GLIBC_2.2.5");
449 __asm__(".symver __nis_default_access,__nis_default_access@GLIBC_2.2.5");
450 __asm__(".symver __nis_default_group,__nis_default_group@GLIBC_2.2.5");
451 __asm__(".symver __nis_default_owner,__nis_default_owner@GLIBC_2.2.5");
452 __asm__(".symver __nis_default_ttl,__nis_default_ttl@GLIBC_2.2.5");
453 __asm__(".symver __nis_finddirectory,__nis_finddirectory@GLIBC_2.2.5");
454 __asm__(".symver __nis_hash,__nis_hash@GLIBC_2.2.5");
455 __asm__(".symver __nisbind_connect,__nisbind_connect@GLIBC_2.2.5");
456 __asm__(".symver __nisbind_create,__nisbind_create@GLIBC_2.2.5");
457 __asm__(".symver __nisbind_destroy,__nisbind_destroy@GLIBC_2.2.5");
458 __asm__(".symver __nisbind_next,__nisbind_next@GLIBC_2.2.5");
459 __asm__(".symver __nl_langinfo_l,__nl_langinfo_l@GLIBC_2.2.5");
460 __asm__(".symver __nss_configure_lookup,__nss_configure_lookup@GLIBC_2.2.5");
461 __asm__(".symver __nss_database_lookup,__nss_database_lookup@GLIBC_2.2.5");
462 __asm__(".symver __nss_group_lookup,__nss_group_lookup@GLIBC_2.2.5");
463 __asm__(".symver __nss_hostname_digits_dots,__nss_hostname_digits_dots@GLIBC_2.2.5");
464 __asm__(".symver __nss_hosts_lookup,__nss_hosts_lookup@GLIBC_2.2.5");
465 __asm__(".symver __nss_next,__nss_next@GLIBC_2.2.5");
466 __asm__(".symver __nss_passwd_lookup,__nss_passwd_lookup@GLIBC_2.2.5");
467 __asm__(".symver __obstack_printf_chk,__obstack_printf_chk@GLIBC_2.8");
468 __asm__(".symver __obstack_vprintf_chk,__obstack_vprintf_chk@GLIBC_2.8");
469 __asm__(".symver __open,__open@GLIBC_2.2.5");
470 __asm__(".symver __open64,__open64@GLIBC_2.2.5");
471 __asm__(".symver __open64_2,__open64_2@GLIBC_2.7");
472 __asm__(".symver __open_2,__open_2@GLIBC_2.7");
473 __asm__(".symver __openat64_2,__openat64_2@GLIBC_2.7");
474 __asm__(".symver __openat_2,__openat_2@GLIBC_2.7");
475 __asm__(".symver __overflow,__overflow@GLIBC_2.2.5");
476 __asm__(".symver __p_cdname,__p_cdname@GLIBC_2.2.5");
477 __asm__(".symver __p_cdnname,__p_cdnname@GLIBC_2.2.5");
478 __asm__(".symver __p_class,__p_class@GLIBC_2.2.5");
479 __asm__(".symver __p_class_syms,__p_class_syms@GLIBC_2.2.5");
480 __asm__(".symver __p_fqname,__p_fqname@GLIBC_2.2.5");
481 __asm__(".symver __p_fqnname,__p_fqnname@GLIBC_2.2.5");
482 __asm__(".symver __p_option,__p_option@GLIBC_2.2.5");
483 __asm__(".symver __p_query,__p_query@GLIBC_2.2.5");
484 __asm__(".symver __p_rcode,__p_rcode@GLIBC_2.3.2");
485 __asm__(".symver __p_secstodate,__p_secstodate@GLIBC_2.2.5");
486 __asm__(".symver __p_time,__p_time@GLIBC_2.2.5");
487 __asm__(".symver __p_type,__p_type@GLIBC_2.2.5");
488 __asm__(".symver __p_type_syms,__p_type_syms@GLIBC_2.2.5");
489 __asm__(".symver __pipe,__pipe@GLIBC_2.2.5");
490 __asm__(".symver __poll,__poll@GLIBC_2.2.5");
491 __asm__(".symver __poll_chk,__poll_chk@GLIBC_2.16");
492 __asm__(".symver __posix_getopt,__posix_getopt@GLIBC_2.10");
493 __asm__(".symver __pow_finite,__pow_finite@GLIBC_2.15");
494 __asm__(".symver __powf_finite,__powf_finite@GLIBC_2.15");
495 __asm__(".symver __powl_finite,__powl_finite@GLIBC_2.15");
496 __asm__(".symver __ppoll_chk,__ppoll_chk@GLIBC_2.16");
497 __asm__(".symver __pread64,__pread64@GLIBC_2.2.5");
498 __asm__(".symver __pread64_chk,__pread64_chk@GLIBC_2.4");
499 __asm__(".symver __pread_chk,__pread_chk@GLIBC_2.4");
500 __asm__(".symver __printf_chk,__printf_chk@GLIBC_2.3.4");
501 __asm__(".symver __printf_fp,__printf_fp@GLIBC_2.2.5");
502 __asm__(".symver __profile_frequency,__profile_frequency@GLIBC_2.2.5");
503 __asm__(".symver __progname,__progname@GLIBC_2.2.5");
504 __asm__(".symver __progname_full,__progname_full@GLIBC_2.2.5");
505 __asm__(".symver __pthread_cleanup_routine,__pthread_cleanup_routine@GLIBC_2.3.3");
506 __asm__(".symver __pthread_getspecific,__pthread_getspecific@GLIBC_2.2.5");
507 #ifndef _GLIBCXX_SHARED
508 #ifndef IN_LIBGCC2
509 #ifdef _REENTRANT
510 __asm__(".symver __pthread_key_create,__pthread_key_create@GLIBC_2.2.5");
511 #endif
512 #endif
513 #endif
514 __asm__(".symver __pthread_mutex_destroy,__pthread_mutex_destroy@GLIBC_2.2.5");
515 __asm__(".symver __pthread_mutex_init,__pthread_mutex_init@GLIBC_2.2.5");
516 __asm__(".symver __pthread_mutex_lock,__pthread_mutex_lock@GLIBC_2.2.5");
517 __asm__(".symver __pthread_mutex_trylock,__pthread_mutex_trylock@GLIBC_2.2.5");
518 __asm__(".symver __pthread_mutex_unlock,__pthread_mutex_unlock@GLIBC_2.2.5");
519 __asm__(".symver __pthread_mutexattr_destroy,__pthread_mutexattr_destroy@GLIBC_2.2.5");
520 __asm__(".symver __pthread_mutexattr_init,__pthread_mutexattr_init@GLIBC_2.2.5");
521 __asm__(".symver __pthread_mutexattr_settype,__pthread_mutexattr_settype@GLIBC_2.2.5");
522 __asm__(".symver __pthread_once,__pthread_once@GLIBC_2.2.5");
523 __asm__(".symver __pthread_register_cancel,__pthread_register_cancel@GLIBC_2.3.3");
524 __asm__(".symver __pthread_register_cancel_defer,__pthread_register_cancel_defer@GLIBC_2.3.3");
525 __asm__(".symver __pthread_rwlock_destroy,__pthread_rwlock_destroy@GLIBC_2.2.5");
526 __asm__(".symver __pthread_rwlock_init,__pthread_rwlock_init@GLIBC_2.2.5");
527 __asm__(".symver __pthread_rwlock_rdlock,__pthread_rwlock_rdlock@GLIBC_2.2.5");
528 __asm__(".symver __pthread_rwlock_tryrdlock,__pthread_rwlock_tryrdlock@GLIBC_2.2.5");
529 __asm__(".symver __pthread_rwlock_trywrlock,__pthread_rwlock_trywrlock@GLIBC_2.2.5");
530 __asm__(".symver __pthread_rwlock_unlock,__pthread_rwlock_unlock@GLIBC_2.2.5");
531 __asm__(".symver __pthread_rwlock_wrlock,__pthread_rwlock_wrlock@GLIBC_2.2.5");
532 __asm__(".symver __pthread_setspecific,__pthread_setspecific@GLIBC_2.2.5");
533 __asm__(".symver __pthread_unregister_cancel,__pthread_unregister_cancel@GLIBC_2.3.3");
534 __asm__(".symver __pthread_unregister_cancel_restore,__pthread_unregister_cancel_restore@GLIBC_2.3.3");
535 __asm__(".symver __pthread_unwind_next,__pthread_unwind_next@GLIBC_2.3.3");
536 __asm__(".symver __ptsname_r_chk,__ptsname_r_chk@GLIBC_2.4");
537 __asm__(".symver __putlong,__putlong@GLIBC_2.2.5");
538 __asm__(".symver __putshort,__putshort@GLIBC_2.2.5");
539 __asm__(".symver __pwrite64,__pwrite64@GLIBC_2.2.5");
540 __asm__(".symver __rawmemchr,__rawmemchr@GLIBC_2.2.5");
541 __asm__(".symver __rcmd_errstr,__rcmd_errstr@GLIBC_2.2.5");
542 __asm__(".symver __read,__read@GLIBC_2.2.5");
543 __asm__(".symver __read_chk,__read_chk@GLIBC_2.4");
544 __asm__(".symver __readlink_chk,__readlink_chk@GLIBC_2.4");
545 __asm__(".symver __readlinkat_chk,__readlinkat_chk@GLIBC_2.5");
546 __asm__(".symver __realloc_hook,__realloc_hook@GLIBC_2.2.5");
547 __asm__(".symver __realpath_chk,__realpath_chk@GLIBC_2.4");
548 __asm__(".symver __recv_chk,__recv_chk@GLIBC_2.4");
549 __asm__(".symver __recvfrom_chk,__recvfrom_chk@GLIBC_2.4");
550 #ifdef _REENTRANT
551 __asm__(".symver __register_atfork,__register_atfork@GLIBC_2.3.2");
552 #endif
553 __asm__(".symver __remainder_finite,__remainder_finite@GLIBC_2.15");
554 __asm__(".symver __remainderf_finite,__remainderf_finite@GLIBC_2.15");
555 __asm__(".symver __remainderl_finite,__remainderl_finite@GLIBC_2.15");
556 __asm__(".symver __res_close,__res_close@GLIBC_2.2.5");
557 __asm__(".symver __res_dnok,__res_dnok@GLIBC_2.2.5");
558 __asm__(".symver __res_hnok,__res_hnok@GLIBC_2.2.5");
559 __asm__(".symver __res_hostalias,__res_hostalias@GLIBC_2.2.5");
560 __asm__(".symver __res_init,__res_init@GLIBC_2.2.5");
561 __asm__(".symver __res_isourserver,__res_isourserver@GLIBC_2.2.5");
562 __asm__(".symver __res_mailok,__res_mailok@GLIBC_2.2.5");
563 __asm__(".symver __res_mkquery,__res_mkquery@GLIBC_2.2.5");
564 __asm__(".symver __res_nameinquery,__res_nameinquery@GLIBC_2.2.5");
565 __asm__(".symver __res_nclose,__res_nclose@GLIBC_2.2.5");
566 __asm__(".symver __res_ninit,__res_ninit@GLIBC_2.2.5");
567 __asm__(".symver __res_nmkquery,__res_nmkquery@GLIBC_2.2.5");
568 __asm__(".symver __res_nquery,__res_nquery@GLIBC_2.2.5");
569 __asm__(".symver __res_nquerydomain,__res_nquerydomain@GLIBC_2.2.5");
570 __asm__(".symver __res_nsearch,__res_nsearch@GLIBC_2.2.5");
571 __asm__(".symver __res_nsend,__res_nsend@GLIBC_2.2.5");
572 __asm__(".symver __res_ownok,__res_ownok@GLIBC_2.2.5");
573 __asm__(".symver __res_queriesmatch,__res_queriesmatch@GLIBC_2.2.5");
574 __asm__(".symver __res_query,__res_query@GLIBC_2.2.5");
575 __asm__(".symver __res_querydomain,__res_querydomain@GLIBC_2.2.5");
576 __asm__(".symver __res_randomid,__res_randomid@GLIBC_2.2.5");
577 __asm__(".symver __res_search,__res_search@GLIBC_2.2.5");
578 __asm__(".symver __res_send,__res_send@GLIBC_2.2.5");
579 __asm__(".symver __res_state,__res_state@GLIBC_2.2.5");
580 __asm__(".symver __rpc_thread_svc_max_pollfd,__rpc_thread_svc_max_pollfd@GLIBC_2.2.5");
581 __asm__(".symver __rpc_thread_svc_pollfd,__rpc_thread_svc_pollfd@GLIBC_2.2.5");
582 __asm__(".symver __sbrk,__sbrk@GLIBC_2.2.5");
583 __asm__(".symver __scalb_finite,__scalb_finite@GLIBC_2.15");
584 __asm__(".symver __scalbf_finite,__scalbf_finite@GLIBC_2.15");
585 __asm__(".symver __scalbl_finite,__scalbl_finite@GLIBC_2.15");
586 __asm__(".symver __sched_cpualloc,__sched_cpualloc@GLIBC_2.7");
587 __asm__(".symver __sched_cpucount,__sched_cpucount@GLIBC_2.6");
588 __asm__(".symver __sched_cpufree,__sched_cpufree@GLIBC_2.7");
589 __asm__(".symver __sched_get_priority_max,__sched_get_priority_max@GLIBC_2.2.5");
590 __asm__(".symver __sched_get_priority_min,__sched_get_priority_min@GLIBC_2.2.5");
591 __asm__(".symver __sched_getparam,__sched_getparam@GLIBC_2.2.5");
592 __asm__(".symver __sched_getscheduler,__sched_getscheduler@GLIBC_2.2.5");
593 __asm__(".symver __sched_setscheduler,__sched_setscheduler@GLIBC_2.2.5");
594 __asm__(".symver __sched_yield,__sched_yield@GLIBC_2.2.5");
595 __asm__(".symver __select,__select@GLIBC_2.2.5");
596 __asm__(".symver __send,__send@GLIBC_2.2.5");
597 __asm__(".symver __setmntent,__setmntent@GLIBC_2.2.5");
598 __asm__(".symver __setpgid,__setpgid@GLIBC_2.2.5");
599 __asm__(".symver __sigaction,__sigaction@GLIBC_2.2.5");
600 __asm__(".symver __sigaddset,__sigaddset@GLIBC_2.2.5");
601 __asm__(".symver __sigdelset,__sigdelset@GLIBC_2.2.5");
602 __asm__(".symver __sigismember,__sigismember@GLIBC_2.2.5");
603 __asm__(".symver __signbit,__signbit@GLIBC_2.2.5");
604 __asm__(".symver __signbitf,__signbitf@GLIBC_2.2.5");
605 __asm__(".symver __signbitl,__signbitl@GLIBC_2.2.5");
606 __asm__(".symver __signgam,__signgam@GLIBC_2.23");
607 __asm__(".symver __sigpause,__sigpause@GLIBC_2.2.5");
608 __asm__(".symver __sigsetjmp,__sigsetjmp@GLIBC_2.2.5");
609 __asm__(".symver __sigsuspend,__sigsuspend@GLIBC_2.2.5");
610 __asm__(".symver __sinh_finite,__sinh_finite@GLIBC_2.15");
611 __asm__(".symver __sinhf_finite,__sinhf_finite@GLIBC_2.15");
612 __asm__(".symver __sinhl_finite,__sinhl_finite@GLIBC_2.15");
613 __asm__(".symver __snprintf_chk,__snprintf_chk@GLIBC_2.3.4");
614 __asm__(".symver __sprintf_chk,__sprintf_chk@GLIBC_2.3.4");
615 __asm__(".symver __sqrt_finite,__sqrt_finite@GLIBC_2.15");
616 __asm__(".symver __sqrtf_finite,__sqrtf_finite@GLIBC_2.15");
617 __asm__(".symver __sqrtl_finite,__sqrtl_finite@GLIBC_2.15");
618 __asm__(".symver __stack_chk_fail,__stack_chk_fail@GLIBC_2.4");
619 __asm__(".symver __statfs,__statfs@GLIBC_2.2.5");
620 __asm__(".symver __stpcpy,__stpcpy@GLIBC_2.2.5");
621 __asm__(".symver __stpcpy_chk,__stpcpy_chk@GLIBC_2.3.4");
622 __asm__(".symver __stpncpy,__stpncpy@GLIBC_2.2.5");
623 __asm__(".symver __stpncpy_chk,__stpncpy_chk@GLIBC_2.4");
624 __asm__(".symver __strcasecmp,__strcasecmp@GLIBC_2.2.5");
625 __asm__(".symver __strcasecmp_l,__strcasecmp_l@GLIBC_2.2.5");
626 __asm__(".symver __strcasestr,__strcasestr@GLIBC_2.2.5");
627 __asm__(".symver __strcat_chk,__strcat_chk@GLIBC_2.3.4");
628 __asm__(".symver __strcoll_l,__strcoll_l@GLIBC_2.2.5");
629 __asm__(".symver __strcpy_chk,__strcpy_chk@GLIBC_2.3.4");
630 __asm__(".symver __strdup,__strdup@GLIBC_2.2.5");
631 __asm__(".symver __strerror_r,__strerror_r@GLIBC_2.2.5");
632 __asm__(".symver __strfmon_l,__strfmon_l@GLIBC_2.2.5");
633 __asm__(".symver __strftime_l,__strftime_l@GLIBC_2.3");
634 __asm__(".symver __strncasecmp_l,__strncasecmp_l@GLIBC_2.2.5");
635 __asm__(".symver __strncat_chk,__strncat_chk@GLIBC_2.3.4");
636 __asm__(".symver __strncpy_chk,__strncpy_chk@GLIBC_2.3.4");
637 __asm__(".symver __strndup,__strndup@GLIBC_2.2.5");
638 __asm__(".symver __strsep_g,__strsep_g@GLIBC_2.2.5");
639 __asm__(".symver __strtod_internal,__strtod_internal@GLIBC_2.2.5");
640 __asm__(".symver __strtod_l,__strtod_l@GLIBC_2.2.5");
641 __asm__(".symver __strtof_internal,__strtof_internal@GLIBC_2.2.5");
642 __asm__(".symver __strtof_l,__strtof_l@GLIBC_2.2.5");
643 __asm__(".symver __strtok_r,__strtok_r@GLIBC_2.2.5");
644 __asm__(".symver __strtol_internal,__strtol_internal@GLIBC_2.2.5");
645 __asm__(".symver __strtol_l,__strtol_l@GLIBC_2.2.5");
646 __asm__(".symver __strtold_internal,__strtold_internal@GLIBC_2.2.5");
647 __asm__(".symver __strtold_l,__strtold_l@GLIBC_2.2.5");
648 __asm__(".symver __strtoll_internal,__strtoll_internal@GLIBC_2.2.5");
649 __asm__(".symver __strtoll_l,__strtoll_l@GLIBC_2.2.5");
650 __asm__(".symver __strtoul_internal,__strtoul_internal@GLIBC_2.2.5");
651 __asm__(".symver __strtoul_l,__strtoul_l@GLIBC_2.2.5");
652 __asm__(".symver __strtoull_internal,__strtoull_internal@GLIBC_2.2.5");
653 __asm__(".symver __strtoull_l,__strtoull_l@GLIBC_2.2.5");
654 __asm__(".symver __strverscmp,__strverscmp@GLIBC_2.2.5");
655 __asm__(".symver __strxfrm_l,__strxfrm_l@GLIBC_2.2.5");
656 __asm__(".symver __swprintf_chk,__swprintf_chk@GLIBC_2.4");
657 __asm__(".symver __sym_ntop,__sym_ntop@GLIBC_2.2.5");
658 __asm__(".symver __sym_ntos,__sym_ntos@GLIBC_2.2.5");
659 __asm__(".symver __sym_ston,__sym_ston@GLIBC_2.2.5");
660 __asm__(".symver __sysconf,__sysconf@GLIBC_2.2.5");
661 __asm__(".symver __sysctl,__sysctl@GLIBC_2.2.5");
662 __asm__(".symver __syslog_chk,__syslog_chk@GLIBC_2.4");
663 __asm__(".symver __sysv_signal,__sysv_signal@GLIBC_2.2.5");
664 __asm__(".symver __timezone,__timezone@GLIBC_2.2.5");
665 __asm__(".symver __tls_get_addr,__tls_get_addr@GLIBC_2.3");
666 __asm__(".symver __toascii_l,__toascii_l@GLIBC_2.2.5");
667 __asm__(".symver __tolower_l,__tolower_l@GLIBC_2.2.5");
668 __asm__(".symver __toupper_l,__toupper_l@GLIBC_2.2.5");
669 __asm__(".symver __towctrans,__towctrans@GLIBC_2.2.5");
670 __asm__(".symver __towctrans_l,__towctrans_l@GLIBC_2.2.5");
671 __asm__(".symver __towlower_l,__towlower_l@GLIBC_2.2.5");
672 __asm__(".symver __towupper_l,__towupper_l@GLIBC_2.2.5");
673 __asm__(".symver __ttyname_r_chk,__ttyname_r_chk@GLIBC_2.4");
674 __asm__(".symver __tzname,__tzname@GLIBC_2.2.5");
675 __asm__(".symver __uflow,__uflow@GLIBC_2.2.5");
676 __asm__(".symver __underflow,__underflow@GLIBC_2.2.5");
677 __asm__(".symver __uselocale,__uselocale@GLIBC_2.3");
678 __asm__(".symver __vasprintf_chk,__vasprintf_chk@GLIBC_2.8");
679 __asm__(".symver __vdprintf_chk,__vdprintf_chk@GLIBC_2.8");
680 __asm__(".symver __vfork,__vfork@GLIBC_2.2.5");
681 __asm__(".symver __vfprintf_chk,__vfprintf_chk@GLIBC_2.3.4");
682 __asm__(".symver __vfscanf,__vfscanf@GLIBC_2.2.5");
683 __asm__(".symver __vfwprintf_chk,__vfwprintf_chk@GLIBC_2.4");
684 __asm__(".symver __vprintf_chk,__vprintf_chk@GLIBC_2.3.4");
685 __asm__(".symver __vsnprintf,__vsnprintf@GLIBC_2.2.5");
686 __asm__(".symver __vsnprintf_chk,__vsnprintf_chk@GLIBC_2.3.4");
687 __asm__(".symver __vsprintf_chk,__vsprintf_chk@GLIBC_2.3.4");
688 __asm__(".symver __vsscanf,__vsscanf@GLIBC_2.2.5");
689 __asm__(".symver __vswprintf_chk,__vswprintf_chk@GLIBC_2.4");
690 __asm__(".symver __vsyslog_chk,__vsyslog_chk@GLIBC_2.4");
691 __asm__(".symver __vwprintf_chk,__vwprintf_chk@GLIBC_2.4");
692 __asm__(".symver __wait,__wait@GLIBC_2.2.5");
693 __asm__(".symver __waitpid,__waitpid@GLIBC_2.2.5");
694 __asm__(".symver __wcpcpy_chk,__wcpcpy_chk@GLIBC_2.4");
695 __asm__(".symver __wcpncpy_chk,__wcpncpy_chk@GLIBC_2.4");
696 __asm__(".symver __wcrtomb_chk,__wcrtomb_chk@GLIBC_2.4");
697 __asm__(".symver __wcscasecmp_l,__wcscasecmp_l@GLIBC_2.2.5");
698 __asm__(".symver __wcscat_chk,__wcscat_chk@GLIBC_2.4");
699 __asm__(".symver __wcscoll_l,__wcscoll_l@GLIBC_2.2.5");
700 __asm__(".symver __wcscpy_chk,__wcscpy_chk@GLIBC_2.4");
701 __asm__(".symver __wcsftime_l,__wcsftime_l@GLIBC_2.3");
702 __asm__(".symver __wcsncasecmp_l,__wcsncasecmp_l@GLIBC_2.2.5");
703 __asm__(".symver __wcsncat_chk,__wcsncat_chk@GLIBC_2.4");
704 __asm__(".symver __wcsncpy_chk,__wcsncpy_chk@GLIBC_2.4");
705 __asm__(".symver __wcsnrtombs_chk,__wcsnrtombs_chk@GLIBC_2.4");
706 __asm__(".symver __wcsrtombs_chk,__wcsrtombs_chk@GLIBC_2.4");
707 __asm__(".symver __wcstod_internal,__wcstod_internal@GLIBC_2.2.5");
708 __asm__(".symver __wcstod_l,__wcstod_l@GLIBC_2.2.5");
709 __asm__(".symver __wcstof_internal,__wcstof_internal@GLIBC_2.2.5");
710 __asm__(".symver __wcstof_l,__wcstof_l@GLIBC_2.2.5");
711 __asm__(".symver __wcstol_internal,__wcstol_internal@GLIBC_2.2.5");
712 __asm__(".symver __wcstol_l,__wcstol_l@GLIBC_2.2.5");
713 __asm__(".symver __wcstold_internal,__wcstold_internal@GLIBC_2.2.5");
714 __asm__(".symver __wcstold_l,__wcstold_l@GLIBC_2.2.5");
715 __asm__(".symver __wcstoll_internal,__wcstoll_internal@GLIBC_2.2.5");
716 __asm__(".symver __wcstoll_l,__wcstoll_l@GLIBC_2.2.5");
717 __asm__(".symver __wcstombs_chk,__wcstombs_chk@GLIBC_2.4");
718 __asm__(".symver __wcstoul_internal,__wcstoul_internal@GLIBC_2.2.5");
719 __asm__(".symver __wcstoul_l,__wcstoul_l@GLIBC_2.2.5");
720 __asm__(".symver __wcstoull_internal,__wcstoull_internal@GLIBC_2.2.5");
721 __asm__(".symver __wcstoull_l,__wcstoull_l@GLIBC_2.2.5");
722 __asm__(".symver __wcsxfrm_l,__wcsxfrm_l@GLIBC_2.2.5");
723 __asm__(".symver __wctomb_chk,__wctomb_chk@GLIBC_2.4");
724 __asm__(".symver __wctrans_l,__wctrans_l@GLIBC_2.2.5");
725 __asm__(".symver __wctype_l,__wctype_l@GLIBC_2.2.5");
726 __asm__(".symver __wmemcpy_chk,__wmemcpy_chk@GLIBC_2.4");
727 __asm__(".symver __wmemmove_chk,__wmemmove_chk@GLIBC_2.4");
728 __asm__(".symver __wmempcpy_chk,__wmempcpy_chk@GLIBC_2.4");
729 __asm__(".symver __wmemset_chk,__wmemset_chk@GLIBC_2.4");
730 __asm__(".symver __woverflow,__woverflow@GLIBC_2.2.5");
731 __asm__(".symver __wprintf_chk,__wprintf_chk@GLIBC_2.4");
732 __asm__(".symver __write,__write@GLIBC_2.2.5");
733 __asm__(".symver __wuflow,__wuflow@GLIBC_2.2.5");
734 __asm__(".symver __wunderflow,__wunderflow@GLIBC_2.2.5");
735 __asm__(".symver __xmknod,__xmknod@GLIBC_2.2.5");
736 __asm__(".symver __xmknodat,__xmknodat@GLIBC_2.4");
737 __asm__(".symver __xpg_basename,__xpg_basename@GLIBC_2.2.5");
738 __asm__(".symver __xpg_sigpause,__xpg_sigpause@GLIBC_2.2.5");
739 __asm__(".symver __xpg_strerror_r,__xpg_strerror_r@GLIBC_2.3.4");
740 __asm__(".symver __xstat,__xstat@GLIBC_2.2.5");
741 __asm__(".symver __xstat64,__xstat64@GLIBC_2.2.5");
742 __asm__(".symver __y0_finite,__y0_finite@GLIBC_2.15");
743 __asm__(".symver __y0f_finite,__y0f_finite@GLIBC_2.15");
744 __asm__(".symver __y0l_finite,__y0l_finite@GLIBC_2.15");
745 __asm__(".symver __y1_finite,__y1_finite@GLIBC_2.15");
746 __asm__(".symver __y1f_finite,__y1f_finite@GLIBC_2.15");
747 __asm__(".symver __y1l_finite,__y1l_finite@GLIBC_2.15");
748 __asm__(".symver __yn_finite,__yn_finite@GLIBC_2.15");
749 __asm__(".symver __ynf_finite,__ynf_finite@GLIBC_2.15");
750 __asm__(".symver __ynl_finite,__ynl_finite@GLIBC_2.15");
751 __asm__(".symver __yp_check,__yp_check@GLIBC_2.2.5");
752 __asm__(".symver _dl_mcount,_dl_mcount@GLIBC_2.2.5");
753 __asm__(".symver _dl_mcount_wrapper,_dl_mcount_wrapper@GLIBC_2.2.5");
754 __asm__(".symver _dl_mcount_wrapper_check,_dl_mcount_wrapper_check@GLIBC_2.2.5");
755 __asm__(".symver _environ,_environ@GLIBC_2.2.5");
756 __asm__(".symver _exit,_exit@GLIBC_2.2.5");
757 __asm__(".symver _flushlbf,_flushlbf@GLIBC_2.2.5");
758 __asm__(".symver _getlong,_getlong@GLIBC_2.2.5");
759 __asm__(".symver _getshort,_getshort@GLIBC_2.2.5");
760 __asm__(".symver _libc_intl_domainname,_libc_intl_domainname@GLIBC_2.2.5");
761 __asm__(".symver _longjmp,_longjmp@GLIBC_2.2.5");
762 __asm__(".symver _mcleanup,_mcleanup@GLIBC_2.2.5");
763 __asm__(".symver _mcount,_mcount@GLIBC_2.2.5");
764 __asm__(".symver _nl_default_dirname,_nl_default_dirname@GLIBC_2.2.5");
765 __asm__(".symver _nl_domain_bindings,_nl_domain_bindings@GLIBC_2.2.5");
766 __asm__(".symver _nl_msg_cat_cntr,_nl_msg_cat_cntr@GLIBC_2.2.5");
767 __asm__(".symver _obstack_allocated_p,_obstack_allocated_p@GLIBC_2.2.5");
768 __asm__(".symver _obstack_begin,_obstack_begin@GLIBC_2.2.5");
769 __asm__(".symver _obstack_begin_1,_obstack_begin_1@GLIBC_2.2.5");
770 __asm__(".symver _obstack_free,_obstack_free@GLIBC_2.2.5");
771 __asm__(".symver _obstack_memory_used,_obstack_memory_used@GLIBC_2.2.5");
772 __asm__(".symver _obstack_newchunk,_obstack_newchunk@GLIBC_2.2.5");
773 __asm__(".symver _pthread_cleanup_pop,_pthread_cleanup_pop@GLIBC_2.2.5");
774 __asm__(".symver _pthread_cleanup_pop_restore,_pthread_cleanup_pop_restore@GLIBC_2.2.5");
775 __asm__(".symver _pthread_cleanup_push,_pthread_cleanup_push@GLIBC_2.2.5");
776 __asm__(".symver _pthread_cleanup_push_defer,_pthread_cleanup_push_defer@GLIBC_2.2.5");
777 __asm__(".symver _r_debug,_r_debug@GLIBC_2.2.5");
778 __asm__(".symver _res_hconf,_res_hconf@GLIBC_2.2.5");
779 __asm__(".symver _res_opcodes,_res_opcodes@GLIBC_2.2.5");
780 __asm__(".symver _setjmp,_setjmp@GLIBC_2.2.5");
781 __asm__(".symver _sys_errlist,_sys_errlist@GLIBC_2.12");
782 __asm__(".symver _sys_nerr,_sys_nerr@GLIBC_2.12");
783 __asm__(".symver _sys_siglist,_sys_siglist@GLIBC_2.3.3");
784 __asm__(".symver _tolower,_tolower@GLIBC_2.2.5");
785 __asm__(".symver _toupper,_toupper@GLIBC_2.2.5");
786 __asm__(".symver a64l,a64l@GLIBC_2.2.5");
787 __asm__(".symver abort,abort@GLIBC_2.2.5");
788 __asm__(".symver abs,abs@GLIBC_2.2.5");
789 __asm__(".symver accept,accept@GLIBC_2.2.5");
790 __asm__(".symver accept4,accept4@GLIBC_2.10");
791 __asm__(".symver access,access@GLIBC_2.2.5");
792 __asm__(".symver acct,acct@GLIBC_2.2.5");
793 __asm__(".symver acos,acos@GLIBC_2.2.5");
794 __asm__(".symver acosf,acosf@GLIBC_2.2.5");
795 __asm__(".symver acosh,acosh@GLIBC_2.2.5");
796 __asm__(".symver acoshf,acoshf@GLIBC_2.2.5");
797 __asm__(".symver acoshl,acoshl@GLIBC_2.2.5");
798 __asm__(".symver acosl,acosl@GLIBC_2.2.5");
799 __asm__(".symver addmntent,addmntent@GLIBC_2.2.5");
800 __asm__(".symver addseverity,addseverity@GLIBC_2.2.5");
801 __asm__(".symver adjtime,adjtime@GLIBC_2.2.5");
802 __asm__(".symver adjtimex,adjtimex@GLIBC_2.2.5");
803 __asm__(".symver aio_cancel,aio_cancel@GLIBC_2.2.5");
804 __asm__(".symver aio_cancel64,aio_cancel64@GLIBC_2.2.5");
805 __asm__(".symver aio_error,aio_error@GLIBC_2.2.5");
806 __asm__(".symver aio_error64,aio_error64@GLIBC_2.2.5");
807 __asm__(".symver aio_fsync,aio_fsync@GLIBC_2.2.5");
808 __asm__(".symver aio_fsync64,aio_fsync64@GLIBC_2.2.5");
809 __asm__(".symver aio_init,aio_init@GLIBC_2.2.5");
810 __asm__(".symver aio_read,aio_read@GLIBC_2.2.5");
811 __asm__(".symver aio_read64,aio_read64@GLIBC_2.2.5");
812 __asm__(".symver aio_return,aio_return@GLIBC_2.2.5");
813 __asm__(".symver aio_return64,aio_return64@GLIBC_2.2.5");
814 __asm__(".symver aio_suspend,aio_suspend@GLIBC_2.2.5");
815 __asm__(".symver aio_suspend64,aio_suspend64@GLIBC_2.2.5");
816 __asm__(".symver aio_write,aio_write@GLIBC_2.2.5");
817 __asm__(".symver aio_write64,aio_write64@GLIBC_2.2.5");
818 __asm__(".symver alarm,alarm@GLIBC_2.2.5");
819 __asm__(".symver aligned_alloc,aligned_alloc@GLIBC_2.16");
820 __asm__(".symver alphasort,alphasort@GLIBC_2.2.5");
821 __asm__(".symver alphasort64,alphasort64@GLIBC_2.2.5");
822 __asm__(".symver arch_prctl,arch_prctl@GLIBC_2.2.5");
823 __asm__(".symver argp_err_exit_status,argp_err_exit_status@GLIBC_2.2.5");
824 __asm__(".symver argp_error,argp_error@GLIBC_2.2.5");
825 __asm__(".symver argp_failure,argp_failure@GLIBC_2.2.5");
826 __asm__(".symver argp_help,argp_help@GLIBC_2.2.5");
827 __asm__(".symver argp_parse,argp_parse@GLIBC_2.2.5");
828 __asm__(".symver argp_program_bug_address,argp_program_bug_address@GLIBC_2.2.5");
829 __asm__(".symver argp_program_version,argp_program_version@GLIBC_2.2.5");
830 __asm__(".symver argp_program_version_hook,argp_program_version_hook@GLIBC_2.2.5");
831 __asm__(".symver argp_state_help,argp_state_help@GLIBC_2.2.5");
832 __asm__(".symver argp_usage,argp_usage@GLIBC_2.2.5");
833 __asm__(".symver argz_add,argz_add@GLIBC_2.2.5");
834 __asm__(".symver argz_add_sep,argz_add_sep@GLIBC_2.2.5");
835 __asm__(".symver argz_append,argz_append@GLIBC_2.2.5");
836 __asm__(".symver argz_count,argz_count@GLIBC_2.2.5");
837 __asm__(".symver argz_create,argz_create@GLIBC_2.2.5");
838 __asm__(".symver argz_create_sep,argz_create_sep@GLIBC_2.2.5");
839 __asm__(".symver argz_delete,argz_delete@GLIBC_2.2.5");
840 __asm__(".symver argz_extract,argz_extract@GLIBC_2.2.5");
841 __asm__(".symver argz_insert,argz_insert@GLIBC_2.2.5");
842 __asm__(".symver argz_next,argz_next@GLIBC_2.2.5");
843 __asm__(".symver argz_replace,argz_replace@GLIBC_2.2.5");
844 __asm__(".symver argz_stringify,argz_stringify@GLIBC_2.2.5");
845 __asm__(".symver asctime,asctime@GLIBC_2.2.5");
846 __asm__(".symver asctime_r,asctime_r@GLIBC_2.2.5");
847 __asm__(".symver asin,asin@GLIBC_2.2.5");
848 __asm__(".symver asinf,asinf@GLIBC_2.2.5");
849 __asm__(".symver asinh,asinh@GLIBC_2.2.5");
850 __asm__(".symver asinhf,asinhf@GLIBC_2.2.5");
851 __asm__(".symver asinhl,asinhl@GLIBC_2.2.5");
852 __asm__(".symver asinl,asinl@GLIBC_2.2.5");
853 __asm__(".symver asprintf,asprintf@GLIBC_2.2.5");
854 __asm__(".symver atan,atan@GLIBC_2.2.5");
855 __asm__(".symver atan2,atan2@GLIBC_2.2.5");
856 __asm__(".symver atan2f,atan2f@GLIBC_2.2.5");
857 __asm__(".symver atan2l,atan2l@GLIBC_2.2.5");
858 __asm__(".symver atanf,atanf@GLIBC_2.2.5");
859 __asm__(".symver atanh,atanh@GLIBC_2.2.5");
860 __asm__(".symver atanhf,atanhf@GLIBC_2.2.5");
861 __asm__(".symver atanhl,atanhl@GLIBC_2.2.5");
862 __asm__(".symver atanl,atanl@GLIBC_2.2.5");
863 __asm__(".symver atof,atof@GLIBC_2.2.5");
864 __asm__(".symver atoi,atoi@GLIBC_2.2.5");
865 __asm__(".symver atol,atol@GLIBC_2.2.5");
866 __asm__(".symver atoll,atoll@GLIBC_2.2.5");
867 __asm__(".symver authdes_create,authdes_create@GLIBC_2.2.5");
868 __asm__(".symver authdes_pk_create,authdes_pk_create@GLIBC_2.2.5");
869 __asm__(".symver authunix_create_default,authunix_create_default@GLIBC_2.2.5");
870 __asm__(".symver backtrace,backtrace@GLIBC_2.2.5");
871 __asm__(".symver backtrace_symbols,backtrace_symbols@GLIBC_2.2.5");
872 __asm__(".symver backtrace_symbols_fd,backtrace_symbols_fd@GLIBC_2.2.5");
873 __asm__(".symver basename,basename@GLIBC_2.2.5");
874 __asm__(".symver bcmp,bcmp@GLIBC_2.2.5");
875 __asm__(".symver bcopy,bcopy@GLIBC_2.2.5");
876 __asm__(".symver bind,bind@GLIBC_2.2.5");
877 __asm__(".symver bind_textdomain_codeset,bind_textdomain_codeset@GLIBC_2.2.5");
878 __asm__(".symver bindresvport,bindresvport@GLIBC_2.2.5");
879 __asm__(".symver bindtextdomain,bindtextdomain@GLIBC_2.2.5");
880 __asm__(".symver brk,brk@GLIBC_2.2.5");
881 __asm__(".symver bsd_signal,bsd_signal@GLIBC_2.2.5");
882 __asm__(".symver bsearch,bsearch@GLIBC_2.2.5");
883 __asm__(".symver btowc,btowc@GLIBC_2.2.5");
884 __asm__(".symver bzero,bzero@GLIBC_2.2.5");
885 __asm__(".symver c16rtomb,c16rtomb@GLIBC_2.16");
886 __asm__(".symver c32rtomb,c32rtomb@GLIBC_2.16");
887 __asm__(".symver cabs,cabs@GLIBC_2.2.5");
888 __asm__(".symver cabsf,cabsf@GLIBC_2.2.5");
889 __asm__(".symver cabsl,cabsl@GLIBC_2.2.5");
890 __asm__(".symver cacos,cacos@GLIBC_2.2.5");
891 __asm__(".symver cacosf,cacosf@GLIBC_2.2.5");
892 __asm__(".symver cacosh,cacosh@GLIBC_2.2.5");
893 __asm__(".symver cacoshf,cacoshf@GLIBC_2.2.5");
894 __asm__(".symver cacoshl,cacoshl@GLIBC_2.2.5");
895 __asm__(".symver cacosl,cacosl@GLIBC_2.2.5");
896 __asm__(".symver calloc,calloc@GLIBC_2.2.5");
897 __asm__(".symver canonicalize,canonicalize@GLIBC_2.25");
898 __asm__(".symver canonicalize_file_name,canonicalize_file_name@GLIBC_2.2.5");
899 __asm__(".symver canonicalizef,canonicalizef@GLIBC_2.25");
900 __asm__(".symver canonicalizel,canonicalizel@GLIBC_2.25");
901 __asm__(".symver capget,capget@GLIBC_2.2.5");
902 __asm__(".symver capset,capset@GLIBC_2.2.5");
903 __asm__(".symver carg,carg@GLIBC_2.2.5");
904 __asm__(".symver cargf,cargf@GLIBC_2.2.5");
905 __asm__(".symver cargl,cargl@GLIBC_2.2.5");
906 __asm__(".symver casin,casin@GLIBC_2.2.5");
907 __asm__(".symver casinf,casinf@GLIBC_2.2.5");
908 __asm__(".symver casinh,casinh@GLIBC_2.2.5");
909 __asm__(".symver casinhf,casinhf@GLIBC_2.2.5");
910 __asm__(".symver casinhl,casinhl@GLIBC_2.2.5");
911 __asm__(".symver casinl,casinl@GLIBC_2.2.5");
912 __asm__(".symver catan,catan@GLIBC_2.2.5");
913 __asm__(".symver catanf,catanf@GLIBC_2.2.5");
914 __asm__(".symver catanh,catanh@GLIBC_2.2.5");
915 __asm__(".symver catanhf,catanhf@GLIBC_2.2.5");
916 __asm__(".symver catanhl,catanhl@GLIBC_2.2.5");
917 __asm__(".symver catanl,catanl@GLIBC_2.2.5");
918 __asm__(".symver catclose,catclose@GLIBC_2.2.5");
919 __asm__(".symver catgets,catgets@GLIBC_2.2.5");
920 __asm__(".symver catopen,catopen@GLIBC_2.2.5");
921 __asm__(".symver cbrt,cbrt@GLIBC_2.2.5");
922 __asm__(".symver cbrtf,cbrtf@GLIBC_2.2.5");
923 __asm__(".symver cbrtl,cbrtl@GLIBC_2.2.5");
924 __asm__(".symver ccos,ccos@GLIBC_2.2.5");
925 __asm__(".symver ccosf,ccosf@GLIBC_2.2.5");
926 __asm__(".symver ccosh,ccosh@GLIBC_2.2.5");
927 __asm__(".symver ccoshf,ccoshf@GLIBC_2.2.5");
928 __asm__(".symver ccoshl,ccoshl@GLIBC_2.2.5");
929 __asm__(".symver ccosl,ccosl@GLIBC_2.2.5");
930 __asm__(".symver ceil,ceil@GLIBC_2.2.5");
931 __asm__(".symver ceilf,ceilf@GLIBC_2.2.5");
932 __asm__(".symver ceill,ceill@GLIBC_2.2.5");
933 __asm__(".symver cexp,cexp@GLIBC_2.2.5");
934 __asm__(".symver cexpf,cexpf@GLIBC_2.2.5");
935 __asm__(".symver cexpl,cexpl@GLIBC_2.2.5");
936 __asm__(".symver cfgetispeed,cfgetispeed@GLIBC_2.2.5");
937 __asm__(".symver cfgetospeed,cfgetospeed@GLIBC_2.2.5");
938 __asm__(".symver cfmakeraw,cfmakeraw@GLIBC_2.2.5");
939 __asm__(".symver cfree,cfree@GLIBC_2.2.5");
940 __asm__(".symver cfsetispeed,cfsetispeed@GLIBC_2.2.5");
941 __asm__(".symver cfsetospeed,cfsetospeed@GLIBC_2.2.5");
942 __asm__(".symver cfsetspeed,cfsetspeed@GLIBC_2.2.5");
943 __asm__(".symver chdir,chdir@GLIBC_2.2.5");
944 __asm__(".symver chflags,chflags@GLIBC_2.2.5");
945 __asm__(".symver chmod,chmod@GLIBC_2.2.5");
946 __asm__(".symver chown,chown@GLIBC_2.2.5");
947 __asm__(".symver chroot,chroot@GLIBC_2.2.5");
948 __asm__(".symver cimag,cimag@GLIBC_2.2.5");
949 __asm__(".symver cimagf,cimagf@GLIBC_2.2.5");
950 __asm__(".symver cimagl,cimagl@GLIBC_2.2.5");
951 __asm__(".symver clearenv,clearenv@GLIBC_2.2.5");
952 __asm__(".symver clearerr,clearerr@GLIBC_2.2.5");
953 __asm__(".symver clearerr_unlocked,clearerr_unlocked@GLIBC_2.2.5");
954 __asm__(".symver clnt_create,clnt_create@GLIBC_2.2.5");
955 __asm__(".symver clnt_pcreateerror,clnt_pcreateerror@GLIBC_2.2.5");
956 __asm__(".symver clnt_perror,clnt_perror@GLIBC_2.2.5");
957 __asm__(".symver clnt_sperrno,clnt_sperrno@GLIBC_2.2.5");
958 __asm__(".symver clnttcp_create,clnttcp_create@GLIBC_2.2.5");
959 __asm__(".symver clntudp_create,clntudp_create@GLIBC_2.2.5");
960 __asm__(".symver clock,clock@GLIBC_2.2.5");
961 __asm__(".symver clock_adjtime,clock_adjtime@GLIBC_2.14");
962 __asm__(".symver clock_getcpuclockid,clock_getcpuclockid@GLIBC_2.17");
963 __asm__(".symver clock_getres,clock_getres@GLIBC_2.17");
964 __asm__(".symver clock_gettime,clock_gettime@GLIBC_2.17");
965 __asm__(".symver clock_nanosleep,clock_nanosleep@GLIBC_2.17");
966 __asm__(".symver clock_settime,clock_settime@GLIBC_2.17");
967 __asm__(".symver clog,clog@GLIBC_2.2.5");
968 __asm__(".symver clog10,clog10@GLIBC_2.2.5");
969 __asm__(".symver clog10f,clog10f@GLIBC_2.2.5");
970 __asm__(".symver clog10l,clog10l@GLIBC_2.2.5");
971 __asm__(".symver clogf,clogf@GLIBC_2.2.5");
972 __asm__(".symver clogl,clogl@GLIBC_2.2.5");
973 __asm__(".symver clone,clone@GLIBC_2.2.5");
974 __asm__(".symver close,close@GLIBC_2.2.5");
975 __asm__(".symver closedir,closedir@GLIBC_2.2.5");
976 __asm__(".symver closelog,closelog@GLIBC_2.2.5");
977 __asm__(".symver confstr,confstr@GLIBC_2.2.5");
978 __asm__(".symver conj,conj@GLIBC_2.2.5");
979 __asm__(".symver conjf,conjf@GLIBC_2.2.5");
980 __asm__(".symver conjl,conjl@GLIBC_2.2.5");
981 __asm__(".symver connect,connect@GLIBC_2.2.5");
982 __asm__(".symver copysign,copysign@GLIBC_2.2.5");
983 __asm__(".symver copysignf,copysignf@GLIBC_2.2.5");
984 __asm__(".symver copysignl,copysignl@GLIBC_2.2.5");
985 __asm__(".symver cos,cos@GLIBC_2.2.5");
986 __asm__(".symver cosf,cosf@GLIBC_2.2.5");
987 __asm__(".symver cosh,cosh@GLIBC_2.2.5");
988 __asm__(".symver coshf,coshf@GLIBC_2.2.5");
989 __asm__(".symver coshl,coshl@GLIBC_2.2.5");
990 __asm__(".symver cosl,cosl@GLIBC_2.2.5");
991 __asm__(".symver cpow,cpow@GLIBC_2.2.5");
992 __asm__(".symver cpowf,cpowf@GLIBC_2.2.5");
993 __asm__(".symver cpowl,cpowl@GLIBC_2.2.5");
994 __asm__(".symver cproj,cproj@GLIBC_2.2.5");
995 __asm__(".symver cprojf,cprojf@GLIBC_2.2.5");
996 __asm__(".symver cprojl,cprojl@GLIBC_2.2.5");
997 __asm__(".symver creal,creal@GLIBC_2.2.5");
998 __asm__(".symver crealf,crealf@GLIBC_2.2.5");
999 __asm__(".symver creall,creall@GLIBC_2.2.5");
1000 __asm__(".symver creat,creat@GLIBC_2.2.5");
1001 __asm__(".symver creat64,creat64@GLIBC_2.2.5");
1002 __asm__(".symver crypt,crypt@GLIBC_2.2.5");
1003 __asm__(".symver crypt_r,crypt_r@GLIBC_2.2.5");
1004 __asm__(".symver csin,csin@GLIBC_2.2.5");
1005 __asm__(".symver csinf,csinf@GLIBC_2.2.5");
1006 __asm__(".symver csinh,csinh@GLIBC_2.2.5");
1007 __asm__(".symver csinhf,csinhf@GLIBC_2.2.5");
1008 __asm__(".symver csinhl,csinhl@GLIBC_2.2.5");
1009 __asm__(".symver csinl,csinl@GLIBC_2.2.5");
1010 __asm__(".symver csqrt,csqrt@GLIBC_2.2.5");
1011 __asm__(".symver csqrtf,csqrtf@GLIBC_2.2.5");
1012 __asm__(".symver csqrtl,csqrtl@GLIBC_2.2.5");
1013 __asm__(".symver ctan,ctan@GLIBC_2.2.5");
1014 __asm__(".symver ctanf,ctanf@GLIBC_2.2.5");
1015 __asm__(".symver ctanh,ctanh@GLIBC_2.2.5");
1016 __asm__(".symver ctanhf,ctanhf@GLIBC_2.2.5");
1017 __asm__(".symver ctanhl,ctanhl@GLIBC_2.2.5");
1018 __asm__(".symver ctanl,ctanl@GLIBC_2.2.5");
1019 __asm__(".symver ctermid,ctermid@GLIBC_2.2.5");
1020 __asm__(".symver ctime,ctime@GLIBC_2.2.5");
1021 __asm__(".symver ctime_r,ctime_r@GLIBC_2.2.5");
1022 __asm__(".symver cuserid,cuserid@GLIBC_2.2.5");
1023 __asm__(".symver daemon,daemon@GLIBC_2.2.5");
1024 __asm__(".symver daylight,daylight@GLIBC_2.2.5");
1025 __asm__(".symver dcgettext,dcgettext@GLIBC_2.2.5");
1026 __asm__(".symver dcngettext,dcngettext@GLIBC_2.2.5");
1027 __asm__(".symver delete_module,delete_module@GLIBC_2.2.5");
1028 __asm__(".symver dgettext,dgettext@GLIBC_2.2.5");
1029 __asm__(".symver difftime,difftime@GLIBC_2.2.5");
1030 __asm__(".symver dirfd,dirfd@GLIBC_2.2.5");
1031 __asm__(".symver dirname,dirname@GLIBC_2.2.5");
1032 __asm__(".symver div,div@GLIBC_2.2.5");
1033 __asm__(".symver dl_iterate_phdr,dl_iterate_phdr@GLIBC_2.2.5");
1034 __asm__(".symver dladdr,dladdr@GLIBC_2.2.5");
1035 __asm__(".symver dladdr1,dladdr1@GLIBC_2.3.3");
1036 __asm__(".symver dlclose,dlclose@GLIBC_2.2.5");
1037 __asm__(".symver dlerror,dlerror@GLIBC_2.2.5");
1038 __asm__(".symver dlinfo,dlinfo@GLIBC_2.3.3");
1039 __asm__(".symver dlmopen,dlmopen@GLIBC_2.3.4");
1040 __asm__(".symver dlopen,dlopen@GLIBC_2.2.5");
1041 __asm__(".symver dlsym,dlsym@GLIBC_2.2.5");
1042 __asm__(".symver dlvsym,dlvsym@GLIBC_2.2.5");
1043 __asm__(".symver dngettext,dngettext@GLIBC_2.2.5");
1044 __asm__(".symver dprintf,dprintf@GLIBC_2.2.5");
1045 __asm__(".symver drand48,drand48@GLIBC_2.2.5");
1046 __asm__(".symver drand48_r,drand48_r@GLIBC_2.2.5");
1047 __asm__(".symver drem,drem@GLIBC_2.2.5");
1048 __asm__(".symver dremf,dremf@GLIBC_2.2.5");
1049 __asm__(".symver dreml,dreml@GLIBC_2.2.5");
1050 __asm__(".symver dup,dup@GLIBC_2.2.5");
1051 __asm__(".symver dup2,dup2@GLIBC_2.2.5");
1052 __asm__(".symver dup3,dup3@GLIBC_2.9");
1053 __asm__(".symver duplocale,duplocale@GLIBC_2.3");
1054 __asm__(".symver dysize,dysize@GLIBC_2.2.5");
1055 __asm__(".symver eaccess,eaccess@GLIBC_2.4");
1056 __asm__(".symver ecvt,ecvt@GLIBC_2.2.5");
1057 __asm__(".symver ecvt_r,ecvt_r@GLIBC_2.2.5");
1058 __asm__(".symver encrypt,encrypt@GLIBC_2.2.5");
1059 __asm__(".symver encrypt_r,encrypt_r@GLIBC_2.2.5");
1060 __asm__(".symver endaliasent,endaliasent@GLIBC_2.2.5");
1061 __asm__(".symver endfsent,endfsent@GLIBC_2.2.5");
1062 __asm__(".symver endgrent,endgrent@GLIBC_2.2.5");
1063 __asm__(".symver endhostent,endhostent@GLIBC_2.2.5");
1064 __asm__(".symver endmntent,endmntent@GLIBC_2.2.5");
1065 __asm__(".symver endnetent,endnetent@GLIBC_2.2.5");
1066 __asm__(".symver endnetgrent,endnetgrent@GLIBC_2.2.5");
1067 __asm__(".symver endprotoent,endprotoent@GLIBC_2.2.5");
1068 __asm__(".symver endpwent,endpwent@GLIBC_2.2.5");
1069 __asm__(".symver endrpcent,endrpcent@GLIBC_2.2.5");
1070 __asm__(".symver endservent,endservent@GLIBC_2.2.5");
1071 __asm__(".symver endsgent,endsgent@GLIBC_2.10");
1072 __asm__(".symver endspent,endspent@GLIBC_2.2.5");
1073 __asm__(".symver endttyent,endttyent@GLIBC_2.2.5");
1074 __asm__(".symver endusershell,endusershell@GLIBC_2.2.5");
1075 __asm__(".symver endutent,endutent@GLIBC_2.2.5");
1076 __asm__(".symver endutxent,endutxent@GLIBC_2.2.5");
1077 __asm__(".symver environ,environ@GLIBC_2.2.5");
1078 __asm__(".symver envz_add,envz_add@GLIBC_2.2.5");
1079 __asm__(".symver envz_entry,envz_entry@GLIBC_2.2.5");
1080 __asm__(".symver envz_get,envz_get@GLIBC_2.2.5");
1081 __asm__(".symver envz_merge,envz_merge@GLIBC_2.2.5");
1082 __asm__(".symver envz_remove,envz_remove@GLIBC_2.2.5");
1083 __asm__(".symver envz_strip,envz_strip@GLIBC_2.2.5");
1084 __asm__(".symver epoll_create,epoll_create@GLIBC_2.3.2");
1085 __asm__(".symver epoll_create1,epoll_create1@GLIBC_2.9");
1086 __asm__(".symver epoll_ctl,epoll_ctl@GLIBC_2.3.2");
1087 __asm__(".symver epoll_pwait,epoll_pwait@GLIBC_2.6");
1088 __asm__(".symver epoll_wait,epoll_wait@GLIBC_2.3.2");
1089 __asm__(".symver erand48,erand48@GLIBC_2.2.5");
1090 __asm__(".symver erand48_r,erand48_r@GLIBC_2.2.5");
1091 __asm__(".symver erf,erf@GLIBC_2.2.5");
1092 __asm__(".symver erfc,erfc@GLIBC_2.2.5");
1093 __asm__(".symver erfcf,erfcf@GLIBC_2.2.5");
1094 __asm__(".symver erfcl,erfcl@GLIBC_2.2.5");
1095 __asm__(".symver erff,erff@GLIBC_2.2.5");
1096 __asm__(".symver erfl,erfl@GLIBC_2.2.5");
1097 __asm__(".symver err,err@GLIBC_2.2.5");
1098 __asm__(".symver error,error@GLIBC_2.2.5");
1099 __asm__(".symver error_at_line,error_at_line@GLIBC_2.2.5");
1100 __asm__(".symver error_message_count,error_message_count@GLIBC_2.2.5");
1101 __asm__(".symver error_one_per_line,error_one_per_line@GLIBC_2.2.5");
1102 __asm__(".symver error_print_progname,error_print_progname@GLIBC_2.2.5");
1103 __asm__(".symver errx,errx@GLIBC_2.2.5");
1104 __asm__(".symver ether_aton,ether_aton@GLIBC_2.2.5");
1105 __asm__(".symver ether_aton_r,ether_aton_r@GLIBC_2.2.5");
1106 __asm__(".symver ether_hostton,ether_hostton@GLIBC_2.2.5");
1107 __asm__(".symver ether_line,ether_line@GLIBC_2.2.5");
1108 __asm__(".symver ether_ntoa,ether_ntoa@GLIBC_2.2.5");
1109 __asm__(".symver ether_ntoa_r,ether_ntoa_r@GLIBC_2.2.5");
1110 __asm__(".symver ether_ntohost,ether_ntohost@GLIBC_2.2.5");
1111 __asm__(".symver euidaccess,euidaccess@GLIBC_2.2.5");
1112 __asm__(".symver eventfd,eventfd@GLIBC_2.7");
1113 __asm__(".symver eventfd_read,eventfd_read@GLIBC_2.7");
1114 __asm__(".symver eventfd_write,eventfd_write@GLIBC_2.7");
1115 __asm__(".symver execl,execl@GLIBC_2.2.5");
1116 __asm__(".symver execle,execle@GLIBC_2.2.5");
1117 __asm__(".symver execlp,execlp@GLIBC_2.2.5");
1118 __asm__(".symver execv,execv@GLIBC_2.2.5");
1119 __asm__(".symver execve,execve@GLIBC_2.2.5");
1120 __asm__(".symver execvp,execvp@GLIBC_2.2.5");
1121 __asm__(".symver execvpe,execvpe@GLIBC_2.11");
1122 __asm__(".symver exit,exit@GLIBC_2.2.5");
1123 __asm__(".symver exp,exp@GLIBC_2.2.5");
1124 __asm__(".symver exp10,exp10@GLIBC_2.2.5");
1125 __asm__(".symver exp10f,exp10f@GLIBC_2.2.5");
1126 __asm__(".symver exp10l,exp10l@GLIBC_2.2.5");
1127 __asm__(".symver exp2,exp2@GLIBC_2.2.5");
1128 __asm__(".symver exp2f,exp2f@GLIBC_2.2.5");
1129 __asm__(".symver exp2l,exp2l@GLIBC_2.2.5");
1130 __asm__(".symver expf,expf@GLIBC_2.2.5");
1131 __asm__(".symver expl,expl@GLIBC_2.2.5");
1132 __asm__(".symver explicit_bzero,explicit_bzero@GLIBC_2.25");
1133 __asm__(".symver expm1,expm1@GLIBC_2.2.5");
1134 __asm__(".symver expm1f,expm1f@GLIBC_2.2.5");
1135 __asm__(".symver expm1l,expm1l@GLIBC_2.2.5");
1136 __asm__(".symver fabs,fabs@GLIBC_2.2.5");
1137 __asm__(".symver fabsf,fabsf@GLIBC_2.2.5");
1138 __asm__(".symver fabsl,fabsl@GLIBC_2.2.5");
1139 __asm__(".symver faccessat,faccessat@GLIBC_2.4");
1140 __asm__(".symver fallocate,fallocate@GLIBC_2.10");
1141 __asm__(".symver fallocate64,fallocate64@GLIBC_2.10");
1142 __asm__(".symver fanotify_init,fanotify_init@GLIBC_2.13");
1143 __asm__(".symver fanotify_mark,fanotify_mark@GLIBC_2.13");
1144 __asm__(".symver fattach,fattach@GLIBC_2.2.5");
1145 __asm__(".symver fchdir,fchdir@GLIBC_2.2.5");
1146 __asm__(".symver fchflags,fchflags@GLIBC_2.2.5");
1147 __asm__(".symver fchmod,fchmod@GLIBC_2.2.5");
1148 __asm__(".symver fchmodat,fchmodat@GLIBC_2.4");
1149 __asm__(".symver fchown,fchown@GLIBC_2.2.5");
1150 __asm__(".symver fchownat,fchownat@GLIBC_2.4");
1151 __asm__(".symver fclose,fclose@GLIBC_2.2.5");
1152 __asm__(".symver fcloseall,fcloseall@GLIBC_2.2.5");
1153 __asm__(".symver fcntl,fcntl@GLIBC_2.2.5");
1154 __asm__(".symver fcrypt,fcrypt@GLIBC_2.2.5");
1155 __asm__(".symver fcvt,fcvt@GLIBC_2.2.5");
1156 __asm__(".symver fcvt_r,fcvt_r@GLIBC_2.2.5");
1157 __asm__(".symver fdatasync,fdatasync@GLIBC_2.2.5");
1158 __asm__(".symver fdetach,fdetach@GLIBC_2.2.5");
1159 __asm__(".symver fdim,fdim@GLIBC_2.2.5");
1160 __asm__(".symver fdimf,fdimf@GLIBC_2.2.5");
1161 __asm__(".symver fdiml,fdiml@GLIBC_2.2.5");
1162 __asm__(".symver fdopen,fdopen@GLIBC_2.2.5");
1163 __asm__(".symver fdopendir,fdopendir@GLIBC_2.4");
1164 __asm__(".symver feclearexcept,feclearexcept@GLIBC_2.2.5");
1165 __asm__(".symver fedisableexcept,fedisableexcept@GLIBC_2.2.5");
1166 __asm__(".symver feenableexcept,feenableexcept@GLIBC_2.2.5");
1167 __asm__(".symver fegetenv,fegetenv@GLIBC_2.2.5");
1168 __asm__(".symver fegetexcept,fegetexcept@GLIBC_2.2.5");
1169 __asm__(".symver fegetexceptflag,fegetexceptflag@GLIBC_2.2.5");
1170 __asm__(".symver fegetmode,fegetmode@GLIBC_2.25");
1171 __asm__(".symver fegetround,fegetround@GLIBC_2.2.5");
1172 __asm__(".symver feholdexcept,feholdexcept@GLIBC_2.2.5");
1173 __asm__(".symver feof,feof@GLIBC_2.2.5");
1174 __asm__(".symver feof_unlocked,feof_unlocked@GLIBC_2.2.5");
1175 __asm__(".symver feraiseexcept,feraiseexcept@GLIBC_2.2.5");
1176 __asm__(".symver ferror,ferror@GLIBC_2.2.5");
1177 __asm__(".symver ferror_unlocked,ferror_unlocked@GLIBC_2.2.5");
1178 __asm__(".symver fesetenv,fesetenv@GLIBC_2.2.5");
1179 __asm__(".symver fesetexcept,fesetexcept@GLIBC_2.25");
1180 __asm__(".symver fesetexceptflag,fesetexceptflag@GLIBC_2.2.5");
1181 __asm__(".symver fesetmode,fesetmode@GLIBC_2.25");
1182 __asm__(".symver fesetround,fesetround@GLIBC_2.2.5");
1183 __asm__(".symver fetestexcept,fetestexcept@GLIBC_2.2.5");
1184 __asm__(".symver fetestexceptflag,fetestexceptflag@GLIBC_2.25");
1185 __asm__(".symver feupdateenv,feupdateenv@GLIBC_2.2.5");
1186 __asm__(".symver fexecve,fexecve@GLIBC_2.2.5");
1187 __asm__(".symver fflush,fflush@GLIBC_2.2.5");
1188 __asm__(".symver fflush_unlocked,fflush_unlocked@GLIBC_2.2.5");
1189 __asm__(".symver ffs,ffs@GLIBC_2.2.5");
1190 __asm__(".symver ffsl,ffsl@GLIBC_2.2.5");
1191 __asm__(".symver ffsll,ffsll@GLIBC_2.2.5");
1192 __asm__(".symver fgetc,fgetc@GLIBC_2.2.5");
1193 __asm__(".symver fgetc_unlocked,fgetc_unlocked@GLIBC_2.2.5");
1194 __asm__(".symver fgetgrent,fgetgrent@GLIBC_2.2.5");
1195 __asm__(".symver fgetgrent_r,fgetgrent_r@GLIBC_2.2.5");
1196 __asm__(".symver fgetpos,fgetpos@GLIBC_2.2.5");
1197 __asm__(".symver fgetpos64,fgetpos64@GLIBC_2.2.5");
1198 __asm__(".symver fgetpwent,fgetpwent@GLIBC_2.2.5");
1199 __asm__(".symver fgetpwent_r,fgetpwent_r@GLIBC_2.2.5");
1200 __asm__(".symver fgets,fgets@GLIBC_2.2.5");
1201 __asm__(".symver fgets_unlocked,fgets_unlocked@GLIBC_2.2.5");
1202 __asm__(".symver fgetsgent,fgetsgent@GLIBC_2.10");
1203 __asm__(".symver fgetsgent_r,fgetsgent_r@GLIBC_2.10");
1204 __asm__(".symver fgetspent,fgetspent@GLIBC_2.2.5");
1205 __asm__(".symver fgetspent_r,fgetspent_r@GLIBC_2.2.5");
1206 __asm__(".symver fgetwc,fgetwc@GLIBC_2.2.5");
1207 __asm__(".symver fgetwc_unlocked,fgetwc_unlocked@GLIBC_2.2.5");
1208 __asm__(".symver fgetws,fgetws@GLIBC_2.2.5");
1209 __asm__(".symver fgetws_unlocked,fgetws_unlocked@GLIBC_2.2.5");
1210 __asm__(".symver fgetxattr,fgetxattr@GLIBC_2.3");
1211 __asm__(".symver fileno,fileno@GLIBC_2.2.5");
1212 __asm__(".symver fileno_unlocked,fileno_unlocked@GLIBC_2.2.5");
1213 __asm__(".symver finite,finite@GLIBC_2.2.5");
1214 __asm__(".symver finitef,finitef@GLIBC_2.2.5");
1215 __asm__(".symver finitel,finitel@GLIBC_2.2.5");
1216 __asm__(".symver flistxattr,flistxattr@GLIBC_2.3");
1217 __asm__(".symver flock,flock@GLIBC_2.2.5");
1218 __asm__(".symver flockfile,flockfile@GLIBC_2.2.5");
1219 __asm__(".symver floor,floor@GLIBC_2.2.5");
1220 __asm__(".symver floorf,floorf@GLIBC_2.2.5");
1221 __asm__(".symver floorl,floorl@GLIBC_2.2.5");
1222 __asm__(".symver fma,fma@GLIBC_2.2.5");
1223 __asm__(".symver fmaf,fmaf@GLIBC_2.2.5");
1224 __asm__(".symver fmal,fmal@GLIBC_2.2.5");
1225 __asm__(".symver fmax,fmax@GLIBC_2.2.5");
1226 __asm__(".symver fmaxf,fmaxf@GLIBC_2.2.5");
1227 __asm__(".symver fmaxl,fmaxl@GLIBC_2.2.5");
1228 __asm__(".symver fmaxmag,fmaxmag@GLIBC_2.25");
1229 __asm__(".symver fmaxmagf,fmaxmagf@GLIBC_2.25");
1230 __asm__(".symver fmaxmagl,fmaxmagl@GLIBC_2.25");
1231 __asm__(".symver fmemopen,fmemopen@GLIBC_2.22");
1232 __asm__(".symver fmin,fmin@GLIBC_2.2.5");
1233 __asm__(".symver fminf,fminf@GLIBC_2.2.5");
1234 __asm__(".symver fminl,fminl@GLIBC_2.2.5");
1235 __asm__(".symver fminmag,fminmag@GLIBC_2.25");
1236 __asm__(".symver fminmagf,fminmagf@GLIBC_2.25");
1237 __asm__(".symver fminmagl,fminmagl@GLIBC_2.25");
1238 __asm__(".symver fmod,fmod@GLIBC_2.2.5");
1239 __asm__(".symver fmodf,fmodf@GLIBC_2.2.5");
1240 __asm__(".symver fmodl,fmodl@GLIBC_2.2.5");
1241 __asm__(".symver fmtmsg,fmtmsg@GLIBC_2.2.5");
1242 __asm__(".symver fnmatch,fnmatch@GLIBC_2.2.5");
1243 __asm__(".symver fopen,fopen@GLIBC_2.2.5");
1244 __asm__(".symver fopen64,fopen64@GLIBC_2.2.5");
1245 __asm__(".symver fopencookie,fopencookie@GLIBC_2.2.5");
1246 __asm__(".symver fork,fork@GLIBC_2.2.5");
1247 __asm__(".symver forkpty,forkpty@GLIBC_2.2.5");
1248 __asm__(".symver fpathconf,fpathconf@GLIBC_2.2.5");
1249 __asm__(".symver fprintf,fprintf@GLIBC_2.2.5");
1250 __asm__(".symver fputc,fputc@GLIBC_2.2.5");
1251 __asm__(".symver fputc_unlocked,fputc_unlocked@GLIBC_2.2.5");
1252 __asm__(".symver fputs,fputs@GLIBC_2.2.5");
1253 __asm__(".symver fputs_unlocked,fputs_unlocked@GLIBC_2.2.5");
1254 __asm__(".symver fputwc,fputwc@GLIBC_2.2.5");
1255 __asm__(".symver fputwc_unlocked,fputwc_unlocked@GLIBC_2.2.5");
1256 __asm__(".symver fputws,fputws@GLIBC_2.2.5");
1257 __asm__(".symver fputws_unlocked,fputws_unlocked@GLIBC_2.2.5");
1258 __asm__(".symver fread,fread@GLIBC_2.2.5");
1259 __asm__(".symver fread_unlocked,fread_unlocked@GLIBC_2.2.5");
1260 __asm__(".symver free,free@GLIBC_2.2.5");
1261 __asm__(".symver freeaddrinfo,freeaddrinfo@GLIBC_2.2.5");
1262 __asm__(".symver freeifaddrs,freeifaddrs@GLIBC_2.3");
1263 __asm__(".symver freelocale,freelocale@GLIBC_2.3");
1264 __asm__(".symver fremovexattr,fremovexattr@GLIBC_2.3");
1265 __asm__(".symver freopen,freopen@GLIBC_2.2.5");
1266 __asm__(".symver freopen64,freopen64@GLIBC_2.2.5");
1267 __asm__(".symver frexp,frexp@GLIBC_2.2.5");
1268 __asm__(".symver frexpf,frexpf@GLIBC_2.2.5");
1269 __asm__(".symver frexpl,frexpl@GLIBC_2.2.5");
1270 __asm__(".symver fromfp,fromfp@GLIBC_2.25");
1271 __asm__(".symver fromfpf,fromfpf@GLIBC_2.25");
1272 __asm__(".symver fromfpl,fromfpl@GLIBC_2.25");
1273 __asm__(".symver fromfpx,fromfpx@GLIBC_2.25");
1274 __asm__(".symver fromfpxf,fromfpxf@GLIBC_2.25");
1275 __asm__(".symver fromfpxl,fromfpxl@GLIBC_2.25");
1276 __asm__(".symver fscanf,fscanf@GLIBC_2.2.5");
1277 __asm__(".symver fseek,fseek@GLIBC_2.2.5");
1278 __asm__(".symver fseeko,fseeko@GLIBC_2.2.5");
1279 __asm__(".symver fseeko64,fseeko64@GLIBC_2.2.5");
1280 __asm__(".symver fsetpos,fsetpos@GLIBC_2.2.5");
1281 __asm__(".symver fsetpos64,fsetpos64@GLIBC_2.2.5");
1282 __asm__(".symver fsetxattr,fsetxattr@GLIBC_2.3");
1283 __asm__(".symver fstatfs,fstatfs@GLIBC_2.2.5");
1284 __asm__(".symver fstatfs64,fstatfs64@GLIBC_2.2.5");
1285 __asm__(".symver fstatvfs,fstatvfs@GLIBC_2.2.5");
1286 __asm__(".symver fstatvfs64,fstatvfs64@GLIBC_2.2.5");
1287 __asm__(".symver fsync,fsync@GLIBC_2.2.5");
1288 __asm__(".symver ftell,ftell@GLIBC_2.2.5");
1289 __asm__(".symver ftello,ftello@GLIBC_2.2.5");
1290 __asm__(".symver ftello64,ftello64@GLIBC_2.2.5");
1291 __asm__(".symver ftime,ftime@GLIBC_2.2.5");
1292 __asm__(".symver ftok,ftok@GLIBC_2.2.5");
1293 __asm__(".symver ftruncate,ftruncate@GLIBC_2.2.5");
1294 __asm__(".symver ftruncate64,ftruncate64@GLIBC_2.2.5");
1295 __asm__(".symver ftrylockfile,ftrylockfile@GLIBC_2.2.5");
1296 __asm__(".symver fts64_children,fts64_children@GLIBC_2.23");
1297 __asm__(".symver fts64_close,fts64_close@GLIBC_2.23");
1298 __asm__(".symver fts64_open,fts64_open@GLIBC_2.23");
1299 __asm__(".symver fts64_read,fts64_read@GLIBC_2.23");
1300 __asm__(".symver fts64_set,fts64_set@GLIBC_2.23");
1301 __asm__(".symver fts_children,fts_children@GLIBC_2.2.5");
1302 __asm__(".symver fts_close,fts_close@GLIBC_2.2.5");
1303 __asm__(".symver fts_open,fts_open@GLIBC_2.2.5");
1304 __asm__(".symver fts_read,fts_read@GLIBC_2.2.5");
1305 __asm__(".symver fts_set,fts_set@GLIBC_2.2.5");
1306 __asm__(".symver ftw,ftw@GLIBC_2.2.5");
1307 __asm__(".symver ftw64,ftw64@GLIBC_2.2.5");
1308 __asm__(".symver funlockfile,funlockfile@GLIBC_2.2.5");
1309 __asm__(".symver futimens,futimens@GLIBC_2.6");
1310 __asm__(".symver futimes,futimes@GLIBC_2.3");
1311 __asm__(".symver futimesat,futimesat@GLIBC_2.4");
1312 __asm__(".symver fwide,fwide@GLIBC_2.2.5");
1313 __asm__(".symver fwprintf,fwprintf@GLIBC_2.2.5");
1314 __asm__(".symver fwrite,fwrite@GLIBC_2.2.5");
1315 __asm__(".symver fwrite_unlocked,fwrite_unlocked@GLIBC_2.2.5");
1316 __asm__(".symver fwscanf,fwscanf@GLIBC_2.2.5");
1317 __asm__(".symver gai_cancel,gai_cancel@GLIBC_2.2.5");
1318 __asm__(".symver gai_error,gai_error@GLIBC_2.2.5");
1319 __asm__(".symver gai_strerror,gai_strerror@GLIBC_2.2.5");
1320 __asm__(".symver gai_suspend,gai_suspend@GLIBC_2.2.5");
1321 __asm__(".symver gamma,gamma@GLIBC_2.2.5");
1322 __asm__(".symver gammaf,gammaf@GLIBC_2.2.5");
1323 __asm__(".symver gammal,gammal@GLIBC_2.2.5");
1324 __asm__(".symver gcvt,gcvt@GLIBC_2.2.5");
1325 __asm__(".symver get_avphys_pages,get_avphys_pages@GLIBC_2.2.5");
1326 __asm__(".symver get_current_dir_name,get_current_dir_name@GLIBC_2.2.5");
1327 __asm__(".symver get_myaddress,get_myaddress@GLIBC_2.2.5");
1328 __asm__(".symver get_nprocs,get_nprocs@GLIBC_2.2.5");
1329 __asm__(".symver get_nprocs_conf,get_nprocs_conf@GLIBC_2.2.5");
1330 __asm__(".symver get_phys_pages,get_phys_pages@GLIBC_2.2.5");
1331 __asm__(".symver getaddrinfo,getaddrinfo@GLIBC_2.2.5");
1332 __asm__(".symver getaddrinfo_a,getaddrinfo_a@GLIBC_2.2.5");
1333 __asm__(".symver getaliasbyname,getaliasbyname@GLIBC_2.2.5");
1334 __asm__(".symver getaliasbyname_r,getaliasbyname_r@GLIBC_2.2.5");
1335 __asm__(".symver getaliasent,getaliasent@GLIBC_2.2.5");
1336 __asm__(".symver getaliasent_r,getaliasent_r@GLIBC_2.2.5");
1337 __asm__(".symver getauxval,getauxval@GLIBC_2.16");
1338 __asm__(".symver getc,getc@GLIBC_2.2.5");
1339 __asm__(".symver getc_unlocked,getc_unlocked@GLIBC_2.2.5");
1340 __asm__(".symver getchar,getchar@GLIBC_2.2.5");
1341 __asm__(".symver getchar_unlocked,getchar_unlocked@GLIBC_2.2.5");
1342 __asm__(".symver getcontext,getcontext@GLIBC_2.2.5");
1343 __asm__(".symver getcwd,getcwd@GLIBC_2.2.5");
1344 __asm__(".symver getdate,getdate@GLIBC_2.2.5");
1345 __asm__(".symver getdate_err,getdate_err@GLIBC_2.2.5");
1346 __asm__(".symver getdate_r,getdate_r@GLIBC_2.2.5");
1347 __asm__(".symver getdelim,getdelim@GLIBC_2.2.5");
1348 __asm__(".symver getdirentries,getdirentries@GLIBC_2.2.5");
1349 __asm__(".symver getdirentries64,getdirentries64@GLIBC_2.2.5");
1350 __asm__(".symver getdomainname,getdomainname@GLIBC_2.2.5");
1351 __asm__(".symver getdtablesize,getdtablesize@GLIBC_2.2.5");
1352 __asm__(".symver getegid,getegid@GLIBC_2.2.5");
1353 __asm__(".symver getentropy,getentropy@GLIBC_2.25");
1354 __asm__(".symver getenv,getenv@GLIBC_2.2.5");
1355 __asm__(".symver geteuid,geteuid@GLIBC_2.2.5");
1356 __asm__(".symver getfsent,getfsent@GLIBC_2.2.5");
1357 __asm__(".symver getfsfile,getfsfile@GLIBC_2.2.5");
1358 __asm__(".symver getfsspec,getfsspec@GLIBC_2.2.5");
1359 __asm__(".symver getgid,getgid@GLIBC_2.2.5");
1360 __asm__(".symver getgrent,getgrent@GLIBC_2.2.5");
1361 __asm__(".symver getgrent_r,getgrent_r@GLIBC_2.2.5");
1362 __asm__(".symver getgrgid,getgrgid@GLIBC_2.2.5");
1363 __asm__(".symver getgrgid_r,getgrgid_r@GLIBC_2.2.5");
1364 __asm__(".symver getgrnam,getgrnam@GLIBC_2.2.5");
1365 __asm__(".symver getgrnam_r,getgrnam_r@GLIBC_2.2.5");
1366 __asm__(".symver getgrouplist,getgrouplist@GLIBC_2.2.5");
1367 __asm__(".symver getgroups,getgroups@GLIBC_2.2.5");
1368 __asm__(".symver gethostbyaddr,gethostbyaddr@GLIBC_2.2.5");
1369 __asm__(".symver gethostbyaddr_r,gethostbyaddr_r@GLIBC_2.2.5");
1370 __asm__(".symver gethostbyname,gethostbyname@GLIBC_2.2.5");
1371 __asm__(".symver gethostbyname2,gethostbyname2@GLIBC_2.2.5");
1372 __asm__(".symver gethostbyname2_r,gethostbyname2_r@GLIBC_2.2.5");
1373 __asm__(".symver gethostbyname_r,gethostbyname_r@GLIBC_2.2.5");
1374 __asm__(".symver gethostent,gethostent@GLIBC_2.2.5");
1375 __asm__(".symver gethostent_r,gethostent_r@GLIBC_2.2.5");
1376 __asm__(".symver gethostid,gethostid@GLIBC_2.2.5");
1377 __asm__(".symver gethostname,gethostname@GLIBC_2.2.5");
1378 __asm__(".symver getifaddrs,getifaddrs@GLIBC_2.3");
1379 __asm__(".symver getipv4sourcefilter,getipv4sourcefilter@GLIBC_2.3.4");
1380 __asm__(".symver getitimer,getitimer@GLIBC_2.2.5");
1381 __asm__(".symver getline,getline@GLIBC_2.2.5");
1382 __asm__(".symver getloadavg,getloadavg@GLIBC_2.2.5");
1383 __asm__(".symver getlogin,getlogin@GLIBC_2.2.5");
1384 __asm__(".symver getlogin_r,getlogin_r@GLIBC_2.2.5");
1385 __asm__(".symver getmntent,getmntent@GLIBC_2.2.5");
1386 __asm__(".symver getmntent_r,getmntent_r@GLIBC_2.2.5");
1387 __asm__(".symver getmsg,getmsg@GLIBC_2.2.5");
1388 __asm__(".symver getnameinfo,getnameinfo@GLIBC_2.2.5");
1389 __asm__(".symver getnetbyaddr,getnetbyaddr@GLIBC_2.2.5");
1390 __asm__(".symver getnetbyaddr_r,getnetbyaddr_r@GLIBC_2.2.5");
1391 __asm__(".symver getnetbyname,getnetbyname@GLIBC_2.2.5");
1392 __asm__(".symver getnetbyname_r,getnetbyname_r@GLIBC_2.2.5");
1393 __asm__(".symver getnetent,getnetent@GLIBC_2.2.5");
1394 __asm__(".symver getnetent_r,getnetent_r@GLIBC_2.2.5");
1395 __asm__(".symver getnetgrent,getnetgrent@GLIBC_2.2.5");
1396 __asm__(".symver getnetgrent_r,getnetgrent_r@GLIBC_2.2.5");
1397 __asm__(".symver getopt,getopt@GLIBC_2.2.5");
1398 __asm__(".symver getopt_long,getopt_long@GLIBC_2.2.5");
1399 __asm__(".symver getopt_long_only,getopt_long_only@GLIBC_2.2.5");
1400 __asm__(".symver getpagesize,getpagesize@GLIBC_2.2.5");
1401 __asm__(".symver getpass,getpass@GLIBC_2.2.5");
1402 __asm__(".symver getpayload,getpayload@GLIBC_2.25");
1403 __asm__(".symver getpayloadf,getpayloadf@GLIBC_2.25");
1404 __asm__(".symver getpayloadl,getpayloadl@GLIBC_2.25");
1405 __asm__(".symver getpeername,getpeername@GLIBC_2.2.5");
1406 __asm__(".symver getpgid,getpgid@GLIBC_2.2.5");
1407 __asm__(".symver getpgrp,getpgrp@GLIBC_2.2.5");
1408 __asm__(".symver getpid,getpid@GLIBC_2.2.5");
1409 __asm__(".symver getpmsg,getpmsg@GLIBC_2.2.5");
1410 __asm__(".symver getppid,getppid@GLIBC_2.2.5");
1411 __asm__(".symver getpriority,getpriority@GLIBC_2.2.5");
1412 __asm__(".symver getprotobyname,getprotobyname@GLIBC_2.2.5");
1413 __asm__(".symver getprotobyname_r,getprotobyname_r@GLIBC_2.2.5");
1414 __asm__(".symver getprotobynumber,getprotobynumber@GLIBC_2.2.5");
1415 __asm__(".symver getprotobynumber_r,getprotobynumber_r@GLIBC_2.2.5");
1416 __asm__(".symver getprotoent,getprotoent@GLIBC_2.2.5");
1417 __asm__(".symver getprotoent_r,getprotoent_r@GLIBC_2.2.5");
1418 __asm__(".symver getpt,getpt@GLIBC_2.2.5");
1419 __asm__(".symver getpw,getpw@GLIBC_2.2.5");
1420 __asm__(".symver getpwent,getpwent@GLIBC_2.2.5");
1421 __asm__(".symver getpwent_r,getpwent_r@GLIBC_2.2.5");
1422 __asm__(".symver getpwnam,getpwnam@GLIBC_2.2.5");
1423 __asm__(".symver getpwnam_r,getpwnam_r@GLIBC_2.2.5");
1424 __asm__(".symver getpwuid,getpwuid@GLIBC_2.2.5");
1425 __asm__(".symver getpwuid_r,getpwuid_r@GLIBC_2.2.5");
1426 __asm__(".symver getrandom,getrandom@GLIBC_2.25");
1427 __asm__(".symver getresgid,getresgid@GLIBC_2.2.5");
1428 __asm__(".symver getresuid,getresuid@GLIBC_2.2.5");
1429 __asm__(".symver getrlimit,getrlimit@GLIBC_2.2.5");
1430 __asm__(".symver getrlimit64,getrlimit64@GLIBC_2.2.5");
1431 __asm__(".symver getrpcbyname,getrpcbyname@GLIBC_2.2.5");
1432 __asm__(".symver getrpcbyname_r,getrpcbyname_r@GLIBC_2.2.5");
1433 __asm__(".symver getrpcbynumber,getrpcbynumber@GLIBC_2.2.5");
1434 __asm__(".symver getrpcbynumber_r,getrpcbynumber_r@GLIBC_2.2.5");
1435 __asm__(".symver getrpcent,getrpcent@GLIBC_2.2.5");
1436 __asm__(".symver getrpcent_r,getrpcent_r@GLIBC_2.2.5");
1437 __asm__(".symver getrpcport,getrpcport@GLIBC_2.2.5");
1438 __asm__(".symver getrusage,getrusage@GLIBC_2.2.5");
1439 __asm__(".symver gets,gets@GLIBC_2.2.5");
1440 __asm__(".symver getservbyname,getservbyname@GLIBC_2.2.5");
1441 __asm__(".symver getservbyname_r,getservbyname_r@GLIBC_2.2.5");
1442 __asm__(".symver getservbyport,getservbyport@GLIBC_2.2.5");
1443 __asm__(".symver getservbyport_r,getservbyport_r@GLIBC_2.2.5");
1444 __asm__(".symver getservent,getservent@GLIBC_2.2.5");
1445 __asm__(".symver getservent_r,getservent_r@GLIBC_2.2.5");
1446 __asm__(".symver getsgent,getsgent@GLIBC_2.10");
1447 __asm__(".symver getsgent_r,getsgent_r@GLIBC_2.10");
1448 __asm__(".symver getsgnam,getsgnam@GLIBC_2.10");
1449 __asm__(".symver getsgnam_r,getsgnam_r@GLIBC_2.10");
1450 __asm__(".symver getsid,getsid@GLIBC_2.2.5");
1451 __asm__(".symver getsockname,getsockname@GLIBC_2.2.5");
1452 __asm__(".symver getsockopt,getsockopt@GLIBC_2.2.5");
1453 __asm__(".symver getsourcefilter,getsourcefilter@GLIBC_2.3.4");
1454 __asm__(".symver getspent,getspent@GLIBC_2.2.5");
1455 __asm__(".symver getspent_r,getspent_r@GLIBC_2.2.5");
1456 __asm__(".symver getspnam,getspnam@GLIBC_2.2.5");
1457 __asm__(".symver getspnam_r,getspnam_r@GLIBC_2.2.5");
1458 __asm__(".symver getsubopt,getsubopt@GLIBC_2.2.5");
1459 __asm__(".symver gettext,gettext@GLIBC_2.2.5");
1460 __asm__(".symver gettimeofday,gettimeofday@GLIBC_2.2.5");
1461 __asm__(".symver getttyent,getttyent@GLIBC_2.2.5");
1462 __asm__(".symver getttynam,getttynam@GLIBC_2.2.5");
1463 __asm__(".symver getuid,getuid@GLIBC_2.2.5");
1464 __asm__(".symver getusershell,getusershell@GLIBC_2.2.5");
1465 __asm__(".symver getutent,getutent@GLIBC_2.2.5");
1466 __asm__(".symver getutent_r,getutent_r@GLIBC_2.2.5");
1467 __asm__(".symver getutid,getutid@GLIBC_2.2.5");
1468 __asm__(".symver getutid_r,getutid_r@GLIBC_2.2.5");
1469 __asm__(".symver getutline,getutline@GLIBC_2.2.5");
1470 __asm__(".symver getutline_r,getutline_r@GLIBC_2.2.5");
1471 __asm__(".symver getutmp,getutmp@GLIBC_2.2.5");
1472 __asm__(".symver getutmpx,getutmpx@GLIBC_2.2.5");
1473 __asm__(".symver getutxent,getutxent@GLIBC_2.2.5");
1474 __asm__(".symver getutxid,getutxid@GLIBC_2.2.5");
1475 __asm__(".symver getutxline,getutxline@GLIBC_2.2.5");
1476 __asm__(".symver getw,getw@GLIBC_2.2.5");
1477 __asm__(".symver getwc,getwc@GLIBC_2.2.5");
1478 __asm__(".symver getwc_unlocked,getwc_unlocked@GLIBC_2.2.5");
1479 __asm__(".symver getwchar,getwchar@GLIBC_2.2.5");
1480 __asm__(".symver getwchar_unlocked,getwchar_unlocked@GLIBC_2.2.5");
1481 __asm__(".symver getwd,getwd@GLIBC_2.2.5");
1482 __asm__(".symver getxattr,getxattr@GLIBC_2.3");
1483 __asm__(".symver glob,glob@GLIBC_2.2.5");
1484 __asm__(".symver glob64,glob64@GLIBC_2.2.5");
1485 __asm__(".symver glob_pattern_p,glob_pattern_p@GLIBC_2.2.5");
1486 __asm__(".symver globfree,globfree@GLIBC_2.2.5");
1487 __asm__(".symver globfree64,globfree64@GLIBC_2.2.5");
1488 __asm__(".symver gmtime,gmtime@GLIBC_2.2.5");
1489 __asm__(".symver gmtime_r,gmtime_r@GLIBC_2.2.5");
1490 __asm__(".symver gnu_dev_major,gnu_dev_major@GLIBC_2.3.3");
1491 __asm__(".symver gnu_dev_makedev,gnu_dev_makedev@GLIBC_2.3.3");
1492 __asm__(".symver gnu_dev_minor,gnu_dev_minor@GLIBC_2.3.3");
1493 __asm__(".symver gnu_get_libc_release,gnu_get_libc_release@GLIBC_2.2.5");
1494 __asm__(".symver gnu_get_libc_version,gnu_get_libc_version@GLIBC_2.2.5");
1495 __asm__(".symver grantpt,grantpt@GLIBC_2.2.5");
1496 __asm__(".symver group_member,group_member@GLIBC_2.2.5");
1497 __asm__(".symver gsignal,gsignal@GLIBC_2.2.5");
1498 __asm__(".symver gtty,gtty@GLIBC_2.2.5");
1499 __asm__(".symver h_errlist,h_errlist@GLIBC_2.2.5");
1500 __asm__(".symver h_nerr,h_nerr@GLIBC_2.2.5");
1501 __asm__(".symver hasmntopt,hasmntopt@GLIBC_2.2.5");
1502 __asm__(".symver hcreate,hcreate@GLIBC_2.2.5");
1503 __asm__(".symver hcreate_r,hcreate_r@GLIBC_2.2.5");
1504 __asm__(".symver hdestroy,hdestroy@GLIBC_2.2.5");
1505 __asm__(".symver hdestroy_r,hdestroy_r@GLIBC_2.2.5");
1506 __asm__(".symver herror,herror@GLIBC_2.2.5");
1507 __asm__(".symver host2netname,host2netname@GLIBC_2.2.5");
1508 __asm__(".symver hsearch,hsearch@GLIBC_2.2.5");
1509 __asm__(".symver hsearch_r,hsearch_r@GLIBC_2.2.5");
1510 __asm__(".symver hstrerror,hstrerror@GLIBC_2.2.5");
1511 __asm__(".symver htonl,htonl@GLIBC_2.2.5");
1512 __asm__(".symver htons,htons@GLIBC_2.2.5");
1513 __asm__(".symver hypot,hypot@GLIBC_2.2.5");
1514 __asm__(".symver hypotf,hypotf@GLIBC_2.2.5");
1515 __asm__(".symver hypotl,hypotl@GLIBC_2.2.5");
1516 __asm__(".symver iconv,iconv@GLIBC_2.2.5");
1517 __asm__(".symver iconv_close,iconv_close@GLIBC_2.2.5");
1518 __asm__(".symver iconv_open,iconv_open@GLIBC_2.2.5");
1519 __asm__(".symver if_freenameindex,if_freenameindex@GLIBC_2.2.5");
1520 __asm__(".symver if_indextoname,if_indextoname@GLIBC_2.2.5");
1521 __asm__(".symver if_nameindex,if_nameindex@GLIBC_2.2.5");
1522 __asm__(".symver if_nametoindex,if_nametoindex@GLIBC_2.2.5");
1523 __asm__(".symver ilogb,ilogb@GLIBC_2.2.5");
1524 __asm__(".symver ilogbf,ilogbf@GLIBC_2.2.5");
1525 __asm__(".symver ilogbl,ilogbl@GLIBC_2.2.5");
1526 __asm__(".symver imaxabs,imaxabs@GLIBC_2.2.5");
1527 __asm__(".symver imaxdiv,imaxdiv@GLIBC_2.2.5");
1528 __asm__(".symver in6addr_any,in6addr_any@GLIBC_2.2.5");
1529 __asm__(".symver in6addr_loopback,in6addr_loopback@GLIBC_2.2.5");
1530 __asm__(".symver index,index@GLIBC_2.2.5");
1531 __asm__(".symver inet6_opt_append,inet6_opt_append@GLIBC_2.5");
1532 __asm__(".symver inet6_opt_find,inet6_opt_find@GLIBC_2.5");
1533 __asm__(".symver inet6_opt_finish,inet6_opt_finish@GLIBC_2.5");
1534 __asm__(".symver inet6_opt_get_val,inet6_opt_get_val@GLIBC_2.5");
1535 __asm__(".symver inet6_opt_init,inet6_opt_init@GLIBC_2.5");
1536 __asm__(".symver inet6_opt_next,inet6_opt_next@GLIBC_2.5");
1537 __asm__(".symver inet6_opt_set_val,inet6_opt_set_val@GLIBC_2.5");
1538 __asm__(".symver inet6_option_alloc,inet6_option_alloc@GLIBC_2.3.3");
1539 __asm__(".symver inet6_option_append,inet6_option_append@GLIBC_2.3.3");
1540 __asm__(".symver inet6_option_find,inet6_option_find@GLIBC_2.3.3");
1541 __asm__(".symver inet6_option_init,inet6_option_init@GLIBC_2.3.3");
1542 __asm__(".symver inet6_option_next,inet6_option_next@GLIBC_2.3.3");
1543 __asm__(".symver inet6_option_space,inet6_option_space@GLIBC_2.3.3");
1544 __asm__(".symver inet6_rth_add,inet6_rth_add@GLIBC_2.5");
1545 __asm__(".symver inet6_rth_getaddr,inet6_rth_getaddr@GLIBC_2.5");
1546 __asm__(".symver inet6_rth_init,inet6_rth_init@GLIBC_2.5");
1547 __asm__(".symver inet6_rth_reverse,inet6_rth_reverse@GLIBC_2.5");
1548 __asm__(".symver inet6_rth_segments,inet6_rth_segments@GLIBC_2.5");
1549 __asm__(".symver inet6_rth_space,inet6_rth_space@GLIBC_2.5");
1550 __asm__(".symver inet_addr,inet_addr@GLIBC_2.2.5");
1551 __asm__(".symver inet_aton,inet_aton@GLIBC_2.2.5");
1552 __asm__(".symver inet_lnaof,inet_lnaof@GLIBC_2.2.5");
1553 __asm__(".symver inet_makeaddr,inet_makeaddr@GLIBC_2.2.5");
1554 __asm__(".symver inet_net_ntop,inet_net_ntop@GLIBC_2.2.5");
1555 __asm__(".symver inet_net_pton,inet_net_pton@GLIBC_2.2.5");
1556 __asm__(".symver inet_neta,inet_neta@GLIBC_2.2.5");
1557 __asm__(".symver inet_netof,inet_netof@GLIBC_2.2.5");
1558 __asm__(".symver inet_network,inet_network@GLIBC_2.2.5");
1559 __asm__(".symver inet_nsap_addr,inet_nsap_addr@GLIBC_2.2.5");
1560 __asm__(".symver inet_nsap_ntoa,inet_nsap_ntoa@GLIBC_2.2.5");
1561 __asm__(".symver inet_ntoa,inet_ntoa@GLIBC_2.2.5");
1562 __asm__(".symver inet_ntop,inet_ntop@GLIBC_2.2.5");
1563 __asm__(".symver inet_pton,inet_pton@GLIBC_2.2.5");
1564 __asm__(".symver init_module,init_module@GLIBC_2.2.5");
1565 __asm__(".symver initgroups,initgroups@GLIBC_2.2.5");
1566 __asm__(".symver initstate,initstate@GLIBC_2.2.5");
1567 __asm__(".symver initstate_r,initstate_r@GLIBC_2.2.5");
1568 __asm__(".symver innetgr,innetgr@GLIBC_2.2.5");
1569 __asm__(".symver inotify_add_watch,inotify_add_watch@GLIBC_2.4");
1570 __asm__(".symver inotify_init,inotify_init@GLIBC_2.4");
1571 __asm__(".symver inotify_init1,inotify_init1@GLIBC_2.9");
1572 __asm__(".symver inotify_rm_watch,inotify_rm_watch@GLIBC_2.4");
1573 __asm__(".symver insque,insque@GLIBC_2.2.5");
1574 __asm__(".symver ioctl,ioctl@GLIBC_2.2.5");
1575 __asm__(".symver ioperm,ioperm@GLIBC_2.2.5");
1576 __asm__(".symver iopl,iopl@GLIBC_2.2.5");
1577 __asm__(".symver iruserok,iruserok@GLIBC_2.2.5");
1578 __asm__(".symver iruserok_af,iruserok_af@GLIBC_2.2.5");
1579 __asm__(".symver isalnum,isalnum@GLIBC_2.2.5");
1580 __asm__(".symver isalnum_l,isalnum_l@GLIBC_2.3");
1581 __asm__(".symver isalpha,isalpha@GLIBC_2.2.5");
1582 __asm__(".symver isalpha_l,isalpha_l@GLIBC_2.3");
1583 __asm__(".symver isascii,isascii@GLIBC_2.2.5");
1584 __asm__(".symver isastream,isastream@GLIBC_2.2.5");
1585 __asm__(".symver isatty,isatty@GLIBC_2.2.5");
1586 __asm__(".symver isblank,isblank@GLIBC_2.2.5");
1587 __asm__(".symver isblank_l,isblank_l@GLIBC_2.3");
1588 __asm__(".symver iscntrl,iscntrl@GLIBC_2.2.5");
1589 __asm__(".symver iscntrl_l,iscntrl_l@GLIBC_2.3");
1590 __asm__(".symver isctype,isctype@GLIBC_2.3");
1591 __asm__(".symver isdigit,isdigit@GLIBC_2.2.5");
1592 __asm__(".symver isdigit_l,isdigit_l@GLIBC_2.3");
1593 __asm__(".symver isfdtype,isfdtype@GLIBC_2.2.5");
1594 __asm__(".symver isgraph,isgraph@GLIBC_2.2.5");
1595 __asm__(".symver isgraph_l,isgraph_l@GLIBC_2.3");
1596 __asm__(".symver isinf,isinf@GLIBC_2.2.5");
1597 __asm__(".symver isinff,isinff@GLIBC_2.2.5");
1598 __asm__(".symver isinfl,isinfl@GLIBC_2.2.5");
1599 __asm__(".symver islower,islower@GLIBC_2.2.5");
1600 __asm__(".symver islower_l,islower_l@GLIBC_2.3");
1601 __asm__(".symver isnan,isnan@GLIBC_2.2.5");
1602 __asm__(".symver isnanf,isnanf@GLIBC_2.2.5");
1603 __asm__(".symver isnanl,isnanl@GLIBC_2.2.5");
1604 __asm__(".symver isprint,isprint@GLIBC_2.2.5");
1605 __asm__(".symver isprint_l,isprint_l@GLIBC_2.3");
1606 __asm__(".symver ispunct,ispunct@GLIBC_2.2.5");
1607 __asm__(".symver ispunct_l,ispunct_l@GLIBC_2.3");
1608 __asm__(".symver isspace,isspace@GLIBC_2.2.5");
1609 __asm__(".symver isspace_l,isspace_l@GLIBC_2.3");
1610 __asm__(".symver isupper,isupper@GLIBC_2.2.5");
1611 __asm__(".symver isupper_l,isupper_l@GLIBC_2.3");
1612 __asm__(".symver iswalnum,iswalnum@GLIBC_2.2.5");
1613 __asm__(".symver iswalnum_l,iswalnum_l@GLIBC_2.3");
1614 __asm__(".symver iswalpha,iswalpha@GLIBC_2.2.5");
1615 __asm__(".symver iswalpha_l,iswalpha_l@GLIBC_2.3");
1616 __asm__(".symver iswblank,iswblank@GLIBC_2.2.5");
1617 __asm__(".symver iswblank_l,iswblank_l@GLIBC_2.3");
1618 __asm__(".symver iswcntrl,iswcntrl@GLIBC_2.2.5");
1619 __asm__(".symver iswcntrl_l,iswcntrl_l@GLIBC_2.3");
1620 __asm__(".symver iswctype,iswctype@GLIBC_2.2.5");
1621 __asm__(".symver iswctype_l,iswctype_l@GLIBC_2.3");
1622 __asm__(".symver iswdigit,iswdigit@GLIBC_2.2.5");
1623 __asm__(".symver iswdigit_l,iswdigit_l@GLIBC_2.3");
1624 __asm__(".symver iswgraph,iswgraph@GLIBC_2.2.5");
1625 __asm__(".symver iswgraph_l,iswgraph_l@GLIBC_2.3");
1626 __asm__(".symver iswlower,iswlower@GLIBC_2.2.5");
1627 __asm__(".symver iswlower_l,iswlower_l@GLIBC_2.3");
1628 __asm__(".symver iswprint,iswprint@GLIBC_2.2.5");
1629 __asm__(".symver iswprint_l,iswprint_l@GLIBC_2.3");
1630 __asm__(".symver iswpunct,iswpunct@GLIBC_2.2.5");
1631 __asm__(".symver iswpunct_l,iswpunct_l@GLIBC_2.3");
1632 __asm__(".symver iswspace,iswspace@GLIBC_2.2.5");
1633 __asm__(".symver iswspace_l,iswspace_l@GLIBC_2.3");
1634 __asm__(".symver iswupper,iswupper@GLIBC_2.2.5");
1635 __asm__(".symver iswupper_l,iswupper_l@GLIBC_2.3");
1636 __asm__(".symver iswxdigit,iswxdigit@GLIBC_2.2.5");
1637 __asm__(".symver iswxdigit_l,iswxdigit_l@GLIBC_2.3");
1638 __asm__(".symver isxdigit,isxdigit@GLIBC_2.2.5");
1639 __asm__(".symver isxdigit_l,isxdigit_l@GLIBC_2.3");
1640 __asm__(".symver j0,j0@GLIBC_2.2.5");
1641 __asm__(".symver j0f,j0f@GLIBC_2.2.5");
1642 __asm__(".symver j0l,j0l@GLIBC_2.2.5");
1643 __asm__(".symver j1,j1@GLIBC_2.2.5");
1644 __asm__(".symver j1f,j1f@GLIBC_2.2.5");
1645 __asm__(".symver j1l,j1l@GLIBC_2.2.5");
1646 __asm__(".symver jn,jn@GLIBC_2.2.5");
1647 __asm__(".symver jnf,jnf@GLIBC_2.2.5");
1648 __asm__(".symver jnl,jnl@GLIBC_2.2.5");
1649 __asm__(".symver jrand48,jrand48@GLIBC_2.2.5");
1650 __asm__(".symver jrand48_r,jrand48_r@GLIBC_2.2.5");
1651 __asm__(".symver key_gendes,key_gendes@GLIBC_2.2.5");
1652 __asm__(".symver key_secretkey_is_set,key_secretkey_is_set@GLIBC_2.2.5");
1653 __asm__(".symver kill,kill@GLIBC_2.2.5");
1654 __asm__(".symver killpg,killpg@GLIBC_2.2.5");
1655 __asm__(".symver klogctl,klogctl@GLIBC_2.2.5");
1656 __asm__(".symver l64a,l64a@GLIBC_2.2.5");
1657 __asm__(".symver labs,labs@GLIBC_2.2.5");
1658 __asm__(".symver lchmod,lchmod@GLIBC_2.3.2");
1659 __asm__(".symver lchown,lchown@GLIBC_2.2.5");
1660 __asm__(".symver lckpwdf,lckpwdf@GLIBC_2.2.5");
1661 __asm__(".symver lcong48,lcong48@GLIBC_2.2.5");
1662 __asm__(".symver lcong48_r,lcong48_r@GLIBC_2.2.5");
1663 __asm__(".symver ldexp,ldexp@GLIBC_2.2.5");
1664 __asm__(".symver ldexpf,ldexpf@GLIBC_2.2.5");
1665 __asm__(".symver ldexpl,ldexpl@GLIBC_2.2.5");
1666 __asm__(".symver ldiv,ldiv@GLIBC_2.2.5");
1667 __asm__(".symver lfind,lfind@GLIBC_2.2.5");
1668 __asm__(".symver lgamma,lgamma@GLIBC_2.23");
1669 __asm__(".symver lgamma_r,lgamma_r@GLIBC_2.2.5");
1670 __asm__(".symver lgammaf,lgammaf@GLIBC_2.23");
1671 __asm__(".symver lgammaf_r,lgammaf_r@GLIBC_2.2.5");
1672 __asm__(".symver lgammal,lgammal@GLIBC_2.23");
1673 __asm__(".symver lgammal_r,lgammal_r@GLIBC_2.2.5");
1674 __asm__(".symver lgetxattr,lgetxattr@GLIBC_2.3");
1675 __asm__(".symver link,link@GLIBC_2.2.5");
1676 __asm__(".symver linkat,linkat@GLIBC_2.4");
1677 __asm__(".symver lio_listio,lio_listio@GLIBC_2.4");
1678 __asm__(".symver lio_listio64,lio_listio64@GLIBC_2.4");
1679 __asm__(".symver listen,listen@GLIBC_2.2.5");
1680 __asm__(".symver listxattr,listxattr@GLIBC_2.3");
1681 __asm__(".symver llabs,llabs@GLIBC_2.2.5");
1682 __asm__(".symver lldiv,lldiv@GLIBC_2.2.5");
1683 __asm__(".symver llistxattr,llistxattr@GLIBC_2.3");
1684 __asm__(".symver llogb,llogb@GLIBC_2.25");
1685 __asm__(".symver llogbf,llogbf@GLIBC_2.25");
1686 __asm__(".symver llogbl,llogbl@GLIBC_2.25");
1687 __asm__(".symver llrint,llrint@GLIBC_2.2.5");
1688 __asm__(".symver llrintf,llrintf@GLIBC_2.2.5");
1689 __asm__(".symver llrintl,llrintl@GLIBC_2.2.5");
1690 __asm__(".symver llround,llround@GLIBC_2.2.5");
1691 __asm__(".symver llroundf,llroundf@GLIBC_2.2.5");
1692 __asm__(".symver llroundl,llroundl@GLIBC_2.2.5");
1693 __asm__(".symver llseek,llseek@GLIBC_2.2.5");
1694 __asm__(".symver localeconv,localeconv@GLIBC_2.2.5");
1695 __asm__(".symver localtime,localtime@GLIBC_2.2.5");
1696 __asm__(".symver localtime_r,localtime_r@GLIBC_2.2.5");
1697 __asm__(".symver lockf,lockf@GLIBC_2.2.5");
1698 __asm__(".symver lockf64,lockf64@GLIBC_2.2.5");
1699 __asm__(".symver log,log@GLIBC_2.2.5");
1700 __asm__(".symver log10,log10@GLIBC_2.2.5");
1701 __asm__(".symver log10f,log10f@GLIBC_2.2.5");
1702 __asm__(".symver log10l,log10l@GLIBC_2.2.5");
1703 __asm__(".symver log1p,log1p@GLIBC_2.2.5");
1704 __asm__(".symver log1pf,log1pf@GLIBC_2.2.5");
1705 __asm__(".symver log1pl,log1pl@GLIBC_2.2.5");
1706 __asm__(".symver log2,log2@GLIBC_2.2.5");
1707 __asm__(".symver log2f,log2f@GLIBC_2.2.5");
1708 __asm__(".symver log2l,log2l@GLIBC_2.2.5");
1709 __asm__(".symver logb,logb@GLIBC_2.2.5");
1710 __asm__(".symver logbf,logbf@GLIBC_2.2.5");
1711 __asm__(".symver logbl,logbl@GLIBC_2.2.5");
1712 __asm__(".symver logf,logf@GLIBC_2.2.5");
1713 __asm__(".symver login,login@GLIBC_2.2.5");
1714 __asm__(".symver login_tty,login_tty@GLIBC_2.2.5");
1715 __asm__(".symver logl,logl@GLIBC_2.2.5");
1716 __asm__(".symver logout,logout@GLIBC_2.2.5");
1717 __asm__(".symver logwtmp,logwtmp@GLIBC_2.2.5");
1718 __asm__(".symver longjmp,longjmp@GLIBC_2.2.5");
1719 __asm__(".symver lrand48,lrand48@GLIBC_2.2.5");
1720 __asm__(".symver lrand48_r,lrand48_r@GLIBC_2.2.5");
1721 __asm__(".symver lremovexattr,lremovexattr@GLIBC_2.3");
1722 __asm__(".symver lrint,lrint@GLIBC_2.2.5");
1723 __asm__(".symver lrintf,lrintf@GLIBC_2.2.5");
1724 __asm__(".symver lrintl,lrintl@GLIBC_2.2.5");
1725 __asm__(".symver lround,lround@GLIBC_2.2.5");
1726 __asm__(".symver lroundf,lroundf@GLIBC_2.2.5");
1727 __asm__(".symver lroundl,lroundl@GLIBC_2.2.5");
1728 __asm__(".symver lsearch,lsearch@GLIBC_2.2.5");
1729 __asm__(".symver lseek,lseek@GLIBC_2.2.5");
1730 __asm__(".symver lseek64,lseek64@GLIBC_2.2.5");
1731 __asm__(".symver lsetxattr,lsetxattr@GLIBC_2.3");
1732 __asm__(".symver lutimes,lutimes@GLIBC_2.3");
1733 __asm__(".symver madvise,madvise@GLIBC_2.2.5");
1734 __asm__(".symver makecontext,makecontext@GLIBC_2.2.5");
1735 __asm__(".symver mallinfo,mallinfo@GLIBC_2.2.5");
1736 __asm__(".symver malloc,malloc@GLIBC_2.2.5");
1737 __asm__(".symver malloc_info,malloc_info@GLIBC_2.10");
1738 __asm__(".symver malloc_stats,malloc_stats@GLIBC_2.2.5");
1739 __asm__(".symver malloc_trim,malloc_trim@GLIBC_2.2.5");
1740 __asm__(".symver malloc_usable_size,malloc_usable_size@GLIBC_2.2.5");
1741 __asm__(".symver mallopt,mallopt@GLIBC_2.2.5");
1742 __asm__(".symver mallwatch,mallwatch@GLIBC_2.2.5");
1743 __asm__(".symver matherr,matherr@GLIBC_2.2.5");
1744 __asm__(".symver mblen,mblen@GLIBC_2.2.5");
1745 __asm__(".symver mbrlen,mbrlen@GLIBC_2.2.5");
1746 __asm__(".symver mbrtoc16,mbrtoc16@GLIBC_2.16");
1747 __asm__(".symver mbrtoc32,mbrtoc32@GLIBC_2.16");
1748 __asm__(".symver mbrtowc,mbrtowc@GLIBC_2.2.5");
1749 __asm__(".symver mbsinit,mbsinit@GLIBC_2.2.5");
1750 __asm__(".symver mbsnrtowcs,mbsnrtowcs@GLIBC_2.2.5");
1751 __asm__(".symver mbsrtowcs,mbsrtowcs@GLIBC_2.2.5");
1752 __asm__(".symver mbstowcs,mbstowcs@GLIBC_2.2.5");
1753 __asm__(".symver mbtowc,mbtowc@GLIBC_2.2.5");
1754 __asm__(".symver mcheck,mcheck@GLIBC_2.2.5");
1755 __asm__(".symver mcheck_check_all,mcheck_check_all@GLIBC_2.2.5");
1756 __asm__(".symver mcheck_pedantic,mcheck_pedantic@GLIBC_2.2.5");
1757 __asm__(".symver mcount,mcount@GLIBC_2.2.5");
1758 __asm__(".symver memalign,memalign@GLIBC_2.2.5");
1759 __asm__(".symver memccpy,memccpy@GLIBC_2.2.5");
1760 __asm__(".symver memchr,memchr@GLIBC_2.2.5");
1761 __asm__(".symver memcmp,memcmp@GLIBC_2.2.5");
1762 __asm__(".symver memcpy,memcpy@GLIBC_2.14");
1763 __asm__(".symver memfrob,memfrob@GLIBC_2.2.5");
1764 __asm__(".symver memmem,memmem@GLIBC_2.2.5");
1765 __asm__(".symver memmove,memmove@GLIBC_2.2.5");
1766 __asm__(".symver mempcpy,mempcpy@GLIBC_2.2.5");
1767 __asm__(".symver memrchr,memrchr@GLIBC_2.2.5");
1768 __asm__(".symver memset,memset@GLIBC_2.2.5");
1769 __asm__(".symver mincore,mincore@GLIBC_2.2.5");
1770 __asm__(".symver mkdir,mkdir@GLIBC_2.2.5");
1771 __asm__(".symver mkdirat,mkdirat@GLIBC_2.4");
1772 __asm__(".symver mkdtemp,mkdtemp@GLIBC_2.2.5");
1773 __asm__(".symver mkfifo,mkfifo@GLIBC_2.2.5");
1774 __asm__(".symver mkfifoat,mkfifoat@GLIBC_2.4");
1775 __asm__(".symver mkostemp,mkostemp@GLIBC_2.7");
1776 __asm__(".symver mkostemp64,mkostemp64@GLIBC_2.7");
1777 __asm__(".symver mkostemps,mkostemps@GLIBC_2.11");
1778 __asm__(".symver mkostemps64,mkostemps64@GLIBC_2.11");
1779 __asm__(".symver mkstemp,mkstemp@GLIBC_2.2.5");
1780 __asm__(".symver mkstemp64,mkstemp64@GLIBC_2.2.5");
1781 __asm__(".symver mkstemps,mkstemps@GLIBC_2.11");
1782 __asm__(".symver mkstemps64,mkstemps64@GLIBC_2.11");
1783 __asm__(".symver mktemp,mktemp@GLIBC_2.2.5");
1784 __asm__(".symver mktime,mktime@GLIBC_2.2.5");
1785 __asm__(".symver mlock,mlock@GLIBC_2.2.5");
1786 __asm__(".symver mlockall,mlockall@GLIBC_2.2.5");
1787 __asm__(".symver mmap,mmap@GLIBC_2.2.5");
1788 __asm__(".symver mmap64,mmap64@GLIBC_2.2.5");
1789 __asm__(".symver modf,modf@GLIBC_2.2.5");
1790 __asm__(".symver modff,modff@GLIBC_2.2.5");
1791 __asm__(".symver modfl,modfl@GLIBC_2.2.5");
1792 __asm__(".symver modify_ldt,modify_ldt@GLIBC_2.2.5");
1793 __asm__(".symver moncontrol,moncontrol@GLIBC_2.2.5");
1794 __asm__(".symver monstartup,monstartup@GLIBC_2.2.5");
1795 __asm__(".symver mount,mount@GLIBC_2.2.5");
1796 __asm__(".symver mprobe,mprobe@GLIBC_2.2.5");
1797 __asm__(".symver mprotect,mprotect@GLIBC_2.2.5");
1798 __asm__(".symver mq_close,mq_close@GLIBC_2.3.4");
1799 __asm__(".symver mq_getattr,mq_getattr@GLIBC_2.3.4");
1800 __asm__(".symver mq_notify,mq_notify@GLIBC_2.3.4");
1801 __asm__(".symver mq_open,mq_open@GLIBC_2.3.4");
1802 __asm__(".symver mq_receive,mq_receive@GLIBC_2.3.4");
1803 __asm__(".symver mq_send,mq_send@GLIBC_2.3.4");
1804 __asm__(".symver mq_setattr,mq_setattr@GLIBC_2.3.4");
1805 __asm__(".symver mq_timedreceive,mq_timedreceive@GLIBC_2.3.4");
1806 __asm__(".symver mq_timedsend,mq_timedsend@GLIBC_2.3.4");
1807 __asm__(".symver mq_unlink,mq_unlink@GLIBC_2.3.4");
1808 __asm__(".symver mrand48,mrand48@GLIBC_2.2.5");
1809 __asm__(".symver mrand48_r,mrand48_r@GLIBC_2.2.5");
1810 __asm__(".symver mremap,mremap@GLIBC_2.2.5");
1811 __asm__(".symver msgctl,msgctl@GLIBC_2.2.5");
1812 __asm__(".symver msgget,msgget@GLIBC_2.2.5");
1813 __asm__(".symver msgrcv,msgrcv@GLIBC_2.2.5");
1814 __asm__(".symver msgsnd,msgsnd@GLIBC_2.2.5");
1815 __asm__(".symver msync,msync@GLIBC_2.2.5");
1816 __asm__(".symver mtrace,mtrace@GLIBC_2.2.5");
1817 __asm__(".symver munlock,munlock@GLIBC_2.2.5");
1818 __asm__(".symver munlockall,munlockall@GLIBC_2.2.5");
1819 __asm__(".symver munmap,munmap@GLIBC_2.2.5");
1820 __asm__(".symver muntrace,muntrace@GLIBC_2.2.5");
1821 __asm__(".symver name_to_handle_at,name_to_handle_at@GLIBC_2.14");
1822 __asm__(".symver nan,nan@GLIBC_2.2.5");
1823 __asm__(".symver nanf,nanf@GLIBC_2.2.5");
1824 __asm__(".symver nanl,nanl@GLIBC_2.2.5");
1825 __asm__(".symver nanosleep,nanosleep@GLIBC_2.2.5");
1826 __asm__(".symver nearbyint,nearbyint@GLIBC_2.2.5");
1827 __asm__(".symver nearbyintf,nearbyintf@GLIBC_2.2.5");
1828 __asm__(".symver nearbyintl,nearbyintl@GLIBC_2.2.5");
1829 __asm__(".symver newlocale,newlocale@GLIBC_2.3");
1830 __asm__(".symver nextafter,nextafter@GLIBC_2.2.5");
1831 __asm__(".symver nextafterf,nextafterf@GLIBC_2.2.5");
1832 __asm__(".symver nextafterl,nextafterl@GLIBC_2.2.5");
1833 __asm__(".symver nextdown,nextdown@GLIBC_2.24");
1834 __asm__(".symver nextdownf,nextdownf@GLIBC_2.24");
1835 __asm__(".symver nextdownl,nextdownl@GLIBC_2.24");
1836 __asm__(".symver nexttoward,nexttoward@GLIBC_2.2.5");
1837 __asm__(".symver nexttowardf,nexttowardf@GLIBC_2.2.5");
1838 __asm__(".symver nexttowardl,nexttowardl@GLIBC_2.2.5");
1839 __asm__(".symver nextup,nextup@GLIBC_2.24");
1840 __asm__(".symver nextupf,nextupf@GLIBC_2.24");
1841 __asm__(".symver nextupl,nextupl@GLIBC_2.24");
1842 __asm__(".symver nfsservctl,nfsservctl@GLIBC_2.2.5");
1843 __asm__(".symver nftw,nftw@GLIBC_2.3.3");
1844 __asm__(".symver nftw64,nftw64@GLIBC_2.3.3");
1845 __asm__(".symver ngettext,ngettext@GLIBC_2.2.5");
1846 __asm__(".symver nice,nice@GLIBC_2.2.5");
1847 __asm__(".symver nis_add,nis_add@GLIBC_2.2.5");
1848 __asm__(".symver nis_add_entry,nis_add_entry@GLIBC_2.2.5");
1849 __asm__(".symver nis_addmember,nis_addmember@GLIBC_2.2.5");
1850 __asm__(".symver nis_checkpoint,nis_checkpoint@GLIBC_2.2.5");
1851 __asm__(".symver nis_clone_directory,nis_clone_directory@GLIBC_2.2.5");
1852 __asm__(".symver nis_clone_object,nis_clone_object@GLIBC_2.2.5");
1853 __asm__(".symver nis_clone_result,nis_clone_result@GLIBC_2.2.5");
1854 __asm__(".symver nis_creategroup,nis_creategroup@GLIBC_2.2.5");
1855 __asm__(".symver nis_destroy_object,nis_destroy_object@GLIBC_2.2.5");
1856 __asm__(".symver nis_destroygroup,nis_destroygroup@GLIBC_2.2.5");
1857 __asm__(".symver nis_dir_cmp,nis_dir_cmp@GLIBC_2.2.5");
1858 __asm__(".symver nis_domain_of,nis_domain_of@GLIBC_2.2.5");
1859 __asm__(".symver nis_domain_of_r,nis_domain_of_r@GLIBC_2.2.5");
1860 __asm__(".symver nis_first_entry,nis_first_entry@GLIBC_2.2.5");
1861 __asm__(".symver nis_free_directory,nis_free_directory@GLIBC_2.2.5");
1862 __asm__(".symver nis_free_object,nis_free_object@GLIBC_2.2.5");
1863 __asm__(".symver nis_free_request,nis_free_request@GLIBC_2.2.5");
1864 __asm__(".symver nis_freenames,nis_freenames@GLIBC_2.2.5");
1865 __asm__(".symver nis_freeresult,nis_freeresult@GLIBC_2.2.5");
1866 __asm__(".symver nis_freeservlist,nis_freeservlist@GLIBC_2.2.5");
1867 __asm__(".symver nis_freetags,nis_freetags@GLIBC_2.2.5");
1868 __asm__(".symver nis_getnames,nis_getnames@GLIBC_2.2.5");
1869 __asm__(".symver nis_getservlist,nis_getservlist@GLIBC_2.2.5");
1870 __asm__(".symver nis_ismember,nis_ismember@GLIBC_2.2.5");
1871 __asm__(".symver nis_leaf_of,nis_leaf_of@GLIBC_2.2.5");
1872 __asm__(".symver nis_leaf_of_r,nis_leaf_of_r@GLIBC_2.2.5");
1873 __asm__(".symver nis_lerror,nis_lerror@GLIBC_2.2.5");
1874 __asm__(".symver nis_list,nis_list@GLIBC_2.2.5");
1875 __asm__(".symver nis_local_directory,nis_local_directory@GLIBC_2.2.5");
1876 __asm__(".symver nis_local_group,nis_local_group@GLIBC_2.2.5");
1877 __asm__(".symver nis_local_host,nis_local_host@GLIBC_2.2.5");
1878 __asm__(".symver nis_local_principal,nis_local_principal@GLIBC_2.2.5");
1879 __asm__(".symver nis_lookup,nis_lookup@GLIBC_2.2.5");
1880 __asm__(".symver nis_mkdir,nis_mkdir@GLIBC_2.2.5");
1881 __asm__(".symver nis_modify,nis_modify@GLIBC_2.2.5");
1882 __asm__(".symver nis_modify_entry,nis_modify_entry@GLIBC_2.2.5");
1883 __asm__(".symver nis_name_of,nis_name_of@GLIBC_2.2.5");
1884 __asm__(".symver nis_name_of_r,nis_name_of_r@GLIBC_2.2.5");
1885 __asm__(".symver nis_next_entry,nis_next_entry@GLIBC_2.2.5");
1886 __asm__(".symver nis_perror,nis_perror@GLIBC_2.2.5");
1887 __asm__(".symver nis_ping,nis_ping@GLIBC_2.2.5");
1888 __asm__(".symver nis_print_directory,nis_print_directory@GLIBC_2.2.5");
1889 __asm__(".symver nis_print_entry,nis_print_entry@GLIBC_2.2.5");
1890 __asm__(".symver nis_print_group,nis_print_group@GLIBC_2.2.5");
1891 __asm__(".symver nis_print_group_entry,nis_print_group_entry@GLIBC_2.2.5");
1892 __asm__(".symver nis_print_link,nis_print_link@GLIBC_2.2.5");
1893 __asm__(".symver nis_print_object,nis_print_object@GLIBC_2.2.5");
1894 __asm__(".symver nis_print_result,nis_print_result@GLIBC_2.2.5");
1895 __asm__(".symver nis_print_rights,nis_print_rights@GLIBC_2.2.5");
1896 __asm__(".symver nis_print_table,nis_print_table@GLIBC_2.2.5");
1897 __asm__(".symver nis_read_obj,nis_read_obj@GLIBC_2.2.5");
1898 __asm__(".symver nis_remove,nis_remove@GLIBC_2.2.5");
1899 __asm__(".symver nis_remove_entry,nis_remove_entry@GLIBC_2.2.5");
1900 __asm__(".symver nis_removemember,nis_removemember@GLIBC_2.2.5");
1901 __asm__(".symver nis_rmdir,nis_rmdir@GLIBC_2.2.5");
1902 __asm__(".symver nis_servstate,nis_servstate@GLIBC_2.2.5");
1903 __asm__(".symver nis_sperrno,nis_sperrno@GLIBC_2.2.5");
1904 __asm__(".symver nis_sperror,nis_sperror@GLIBC_2.2.5");
1905 __asm__(".symver nis_sperror_r,nis_sperror_r@GLIBC_2.2.5");
1906 __asm__(".symver nis_stats,nis_stats@GLIBC_2.2.5");
1907 __asm__(".symver nis_verifygroup,nis_verifygroup@GLIBC_2.2.5");
1908 __asm__(".symver nis_write_obj,nis_write_obj@GLIBC_2.2.5");
1909 __asm__(".symver nl_langinfo,nl_langinfo@GLIBC_2.2.5");
1910 __asm__(".symver nl_langinfo_l,nl_langinfo_l@GLIBC_2.3");
1911 __asm__(".symver nrand48,nrand48@GLIBC_2.2.5");
1912 __asm__(".symver nrand48_r,nrand48_r@GLIBC_2.2.5");
1913 __asm__(".symver ns_datetosecs,ns_datetosecs@GLIBC_2.9");
1914 __asm__(".symver ns_format_ttl,ns_format_ttl@GLIBC_2.9");
1915 __asm__(".symver ns_get16,ns_get16@GLIBC_2.9");
1916 __asm__(".symver ns_get32,ns_get32@GLIBC_2.9");
1917 __asm__(".symver ns_initparse,ns_initparse@GLIBC_2.9");
1918 __asm__(".symver ns_makecanon,ns_makecanon@GLIBC_2.9");
1919 __asm__(".symver ns_msg_getflag,ns_msg_getflag@GLIBC_2.9");
1920 __asm__(".symver ns_name_compress,ns_name_compress@GLIBC_2.9");
1921 __asm__(".symver ns_name_ntol,ns_name_ntol@GLIBC_2.9");
1922 __asm__(".symver ns_name_ntop,ns_name_ntop@GLIBC_2.9");
1923 __asm__(".symver ns_name_pack,ns_name_pack@GLIBC_2.9");
1924 __asm__(".symver ns_name_pton,ns_name_pton@GLIBC_2.9");
1925 __asm__(".symver ns_name_rollback,ns_name_rollback@GLIBC_2.9");
1926 __asm__(".symver ns_name_skip,ns_name_skip@GLIBC_2.9");
1927 __asm__(".symver ns_name_uncompress,ns_name_uncompress@GLIBC_2.9");
1928 __asm__(".symver ns_name_unpack,ns_name_unpack@GLIBC_2.9");
1929 __asm__(".symver ns_parse_ttl,ns_parse_ttl@GLIBC_2.9");
1930 __asm__(".symver ns_parserr,ns_parserr@GLIBC_2.9");
1931 __asm__(".symver ns_put16,ns_put16@GLIBC_2.9");
1932 __asm__(".symver ns_put32,ns_put32@GLIBC_2.9");
1933 __asm__(".symver ns_samedomain,ns_samedomain@GLIBC_2.9");
1934 __asm__(".symver ns_samename,ns_samename@GLIBC_2.9");
1935 __asm__(".symver ns_skiprr,ns_skiprr@GLIBC_2.9");
1936 __asm__(".symver ns_sprintrr,ns_sprintrr@GLIBC_2.9");
1937 __asm__(".symver ns_sprintrrf,ns_sprintrrf@GLIBC_2.9");
1938 __asm__(".symver ns_subdomain,ns_subdomain@GLIBC_2.9");
1939 __asm__(".symver ntohl,ntohl@GLIBC_2.2.5");
1940 __asm__(".symver ntohs,ntohs@GLIBC_2.2.5");
1941 __asm__(".symver ntp_adjtime,ntp_adjtime@GLIBC_2.2.5");
1942 __asm__(".symver ntp_gettime,ntp_gettime@GLIBC_2.2.5");
1943 __asm__(".symver ntp_gettimex,ntp_gettimex@GLIBC_2.12");
1944 __asm__(".symver obstack_alloc_failed_handler,obstack_alloc_failed_handler@GLIBC_2.2.5");
1945 __asm__(".symver obstack_exit_failure,obstack_exit_failure@GLIBC_2.2.5");
1946 __asm__(".symver obstack_free,obstack_free@GLIBC_2.2.5");
1947 __asm__(".symver obstack_printf,obstack_printf@GLIBC_2.2.5");
1948 __asm__(".symver obstack_vprintf,obstack_vprintf@GLIBC_2.2.5");
1949 __asm__(".symver on_exit,on_exit@GLIBC_2.2.5");
1950 __asm__(".symver open,open@GLIBC_2.2.5");
1951 __asm__(".symver open64,open64@GLIBC_2.2.5");
1952 __asm__(".symver open_by_handle_at,open_by_handle_at@GLIBC_2.14");
1953 __asm__(".symver open_memstream,open_memstream@GLIBC_2.2.5");
1954 __asm__(".symver open_wmemstream,open_wmemstream@GLIBC_2.4");
1955 __asm__(".symver openat,openat@GLIBC_2.4");
1956 __asm__(".symver openat64,openat64@GLIBC_2.4");
1957 __asm__(".symver opendir,opendir@GLIBC_2.2.5");
1958 __asm__(".symver openlog,openlog@GLIBC_2.2.5");
1959 __asm__(".symver openpty,openpty@GLIBC_2.2.5");
1960 __asm__(".symver optarg,optarg@GLIBC_2.2.5");
1961 __asm__(".symver opterr,opterr@GLIBC_2.2.5");
1962 __asm__(".symver optind,optind@GLIBC_2.2.5");
1963 __asm__(".symver optopt,optopt@GLIBC_2.2.5");
1964 __asm__(".symver parse_printf_format,parse_printf_format@GLIBC_2.2.5");
1965 __asm__(".symver pathconf,pathconf@GLIBC_2.2.5");
1966 __asm__(".symver pause,pause@GLIBC_2.2.5");
1967 __asm__(".symver pclose,pclose@GLIBC_2.2.5");
1968 __asm__(".symver perror,perror@GLIBC_2.2.5");
1969 __asm__(".symver personality,personality@GLIBC_2.2.5");
1970 __asm__(".symver pipe,pipe@GLIBC_2.2.5");
1971 __asm__(".symver pipe2,pipe2@GLIBC_2.9");
1972 __asm__(".symver pivot_root,pivot_root@GLIBC_2.2.5");
1973 __asm__(".symver poll,poll@GLIBC_2.2.5");
1974 __asm__(".symver popen,popen@GLIBC_2.2.5");
1975 __asm__(".symver posix_fadvise,posix_fadvise@GLIBC_2.2.5");
1976 __asm__(".symver posix_fadvise64,posix_fadvise64@GLIBC_2.2.5");
1977 __asm__(".symver posix_fallocate,posix_fallocate@GLIBC_2.2.5");
1978 __asm__(".symver posix_fallocate64,posix_fallocate64@GLIBC_2.2.5");
1979 __asm__(".symver posix_madvise,posix_madvise@GLIBC_2.2.5");
1980 __asm__(".symver posix_memalign,posix_memalign@GLIBC_2.2.5");
1981 __asm__(".symver posix_openpt,posix_openpt@GLIBC_2.2.5");
1982 __asm__(".symver posix_spawn,posix_spawn@GLIBC_2.15");
1983 __asm__(".symver posix_spawn_file_actions_addclose,posix_spawn_file_actions_addclose@GLIBC_2.2.5");
1984 __asm__(".symver posix_spawn_file_actions_adddup2,posix_spawn_file_actions_adddup2@GLIBC_2.2.5");
1985 __asm__(".symver posix_spawn_file_actions_addopen,posix_spawn_file_actions_addopen@GLIBC_2.2.5");
1986 __asm__(".symver posix_spawn_file_actions_destroy,posix_spawn_file_actions_destroy@GLIBC_2.2.5");
1987 __asm__(".symver posix_spawn_file_actions_init,posix_spawn_file_actions_init@GLIBC_2.2.5");
1988 __asm__(".symver posix_spawnattr_destroy,posix_spawnattr_destroy@GLIBC_2.2.5");
1989 __asm__(".symver posix_spawnattr_getflags,posix_spawnattr_getflags@GLIBC_2.2.5");
1990 __asm__(".symver posix_spawnattr_getpgroup,posix_spawnattr_getpgroup@GLIBC_2.2.5");
1991 __asm__(".symver posix_spawnattr_getschedparam,posix_spawnattr_getschedparam@GLIBC_2.2.5");
1992 __asm__(".symver posix_spawnattr_getschedpolicy,posix_spawnattr_getschedpolicy@GLIBC_2.2.5");
1993 __asm__(".symver posix_spawnattr_getsigdefault,posix_spawnattr_getsigdefault@GLIBC_2.2.5");
1994 __asm__(".symver posix_spawnattr_getsigmask,posix_spawnattr_getsigmask@GLIBC_2.2.5");
1995 __asm__(".symver posix_spawnattr_init,posix_spawnattr_init@GLIBC_2.2.5");
1996 __asm__(".symver posix_spawnattr_setflags,posix_spawnattr_setflags@GLIBC_2.2.5");
1997 __asm__(".symver posix_spawnattr_setpgroup,posix_spawnattr_setpgroup@GLIBC_2.2.5");
1998 __asm__(".symver posix_spawnattr_setschedparam,posix_spawnattr_setschedparam@GLIBC_2.2.5");
1999 __asm__(".symver posix_spawnattr_setschedpolicy,posix_spawnattr_setschedpolicy@GLIBC_2.2.5");
2000 __asm__(".symver posix_spawnattr_setsigdefault,posix_spawnattr_setsigdefault@GLIBC_2.2.5");
2001 __asm__(".symver posix_spawnattr_setsigmask,posix_spawnattr_setsigmask@GLIBC_2.2.5");
2002 __asm__(".symver posix_spawnp,posix_spawnp@GLIBC_2.15");
2003 __asm__(".symver pow,pow@GLIBC_2.2.5");
2004 __asm__(".symver pow10,pow10@GLIBC_2.2.5");
2005 __asm__(".symver pow10f,pow10f@GLIBC_2.2.5");
2006 __asm__(".symver pow10l,pow10l@GLIBC_2.2.5");
2007 __asm__(".symver powf,powf@GLIBC_2.2.5");
2008 __asm__(".symver powl,powl@GLIBC_2.2.5");
2009 __asm__(".symver ppoll,ppoll@GLIBC_2.4");
2010 __asm__(".symver prctl,prctl@GLIBC_2.2.5");
2011 __asm__(".symver pread,pread@GLIBC_2.2.5");
2012 __asm__(".symver pread64,pread64@GLIBC_2.2.5");
2013 __asm__(".symver preadv,preadv@GLIBC_2.10");
2014 __asm__(".symver preadv64,preadv64@GLIBC_2.10");
2015 __asm__(".symver printf,printf@GLIBC_2.2.5");
2016 __asm__(".symver printf_size,printf_size@GLIBC_2.2.5");
2017 __asm__(".symver printf_size_info,printf_size_info@GLIBC_2.2.5");
2018 __asm__(".symver prlimit,prlimit@GLIBC_2.13");
2019 __asm__(".symver prlimit64,prlimit64@GLIBC_2.13");
2020 __asm__(".symver process_vm_readv,process_vm_readv@GLIBC_2.15");
2021 __asm__(".symver process_vm_writev,process_vm_writev@GLIBC_2.15");
2022 __asm__(".symver profil,profil@GLIBC_2.2.5");
2023 __asm__(".symver program_invocation_name,program_invocation_name@GLIBC_2.2.5");
2024 __asm__(".symver program_invocation_short_name,program_invocation_short_name@GLIBC_2.2.5");
2025 __asm__(".symver pselect,pselect@GLIBC_2.2.5");
2026 __asm__(".symver psiginfo,psiginfo@GLIBC_2.10");
2027 __asm__(".symver psignal,psignal@GLIBC_2.2.5");
2028 #ifdef _REENTRANT
2029 __asm__(".symver pthread_attr_destroy,pthread_attr_destroy@GLIBC_2.2.5");
2030 #endif
2031 __asm__(".symver pthread_attr_getaffinity_np,pthread_attr_getaffinity_np@GLIBC_2.3.4");
2032 #ifdef _REENTRANT
2033 __asm__(".symver pthread_attr_getdetachstate,pthread_attr_getdetachstate@GLIBC_2.2.5");
2034 #endif
2035 __asm__(".symver pthread_attr_getguardsize,pthread_attr_getguardsize@GLIBC_2.2.5");
2036 #ifdef _REENTRANT
2037 __asm__(".symver pthread_attr_getinheritsched,pthread_attr_getinheritsched@GLIBC_2.2.5");
2038 #endif
2039 #ifdef _REENTRANT
2040 __asm__(".symver pthread_attr_getschedparam,pthread_attr_getschedparam@GLIBC_2.2.5");
2041 #endif
2042 #ifdef _REENTRANT
2043 __asm__(".symver pthread_attr_getschedpolicy,pthread_attr_getschedpolicy@GLIBC_2.2.5");
2044 #endif
2045 #ifdef _REENTRANT
2046 __asm__(".symver pthread_attr_getscope,pthread_attr_getscope@GLIBC_2.2.5");
2047 #endif
2048 __asm__(".symver pthread_attr_getstack,pthread_attr_getstack@GLIBC_2.2.5");
2049 __asm__(".symver pthread_attr_getstackaddr,pthread_attr_getstackaddr@GLIBC_2.2.5");
2050 __asm__(".symver pthread_attr_getstacksize,pthread_attr_getstacksize@GLIBC_2.2.5");
2051 #ifdef _REENTRANT
2052 __asm__(".symver pthread_attr_init,pthread_attr_init@GLIBC_2.2.5");
2053 #endif
2054 __asm__(".symver pthread_attr_setaffinity_np,pthread_attr_setaffinity_np@GLIBC_2.3.4");
2055 #ifdef _REENTRANT
2056 __asm__(".symver pthread_attr_setdetachstate,pthread_attr_setdetachstate@GLIBC_2.2.5");
2057 #endif
2058 __asm__(".symver pthread_attr_setguardsize,pthread_attr_setguardsize@GLIBC_2.2.5");
2059 #ifdef _REENTRANT
2060 __asm__(".symver pthread_attr_setinheritsched,pthread_attr_setinheritsched@GLIBC_2.2.5");
2061 #endif
2062 #ifdef _REENTRANT
2063 __asm__(".symver pthread_attr_setschedparam,pthread_attr_setschedparam@GLIBC_2.2.5");
2064 #endif
2065 #ifdef _REENTRANT
2066 __asm__(".symver pthread_attr_setschedpolicy,pthread_attr_setschedpolicy@GLIBC_2.2.5");
2067 #endif
2068 #ifdef _REENTRANT
2069 __asm__(".symver pthread_attr_setscope,pthread_attr_setscope@GLIBC_2.2.5");
2070 #endif
2071 __asm__(".symver pthread_attr_setstack,pthread_attr_setstack@GLIBC_2.2.5");
2072 __asm__(".symver pthread_attr_setstackaddr,pthread_attr_setstackaddr@GLIBC_2.2.5");
2073 __asm__(".symver pthread_attr_setstacksize,pthread_attr_setstacksize@GLIBC_2.2.5");
2074 __asm__(".symver pthread_barrier_destroy,pthread_barrier_destroy@GLIBC_2.2.5");
2075 __asm__(".symver pthread_barrier_init,pthread_barrier_init@GLIBC_2.2.5");
2076 __asm__(".symver pthread_barrier_wait,pthread_barrier_wait@GLIBC_2.2.5");
2077 __asm__(".symver pthread_barrierattr_destroy,pthread_barrierattr_destroy@GLIBC_2.2.5");
2078 __asm__(".symver pthread_barrierattr_getpshared,pthread_barrierattr_getpshared@GLIBC_2.3.3");
2079 __asm__(".symver pthread_barrierattr_init,pthread_barrierattr_init@GLIBC_2.2.5");
2080 __asm__(".symver pthread_barrierattr_setpshared,pthread_barrierattr_setpshared@GLIBC_2.2.5");
2081 __asm__(".symver pthread_cancel,pthread_cancel@GLIBC_2.2.5");
2082 #ifdef _REENTRANT
2083 __asm__(".symver pthread_cond_broadcast,pthread_cond_broadcast@GLIBC_2.3.2");
2084 #endif
2085 #ifdef _REENTRANT
2086 __asm__(".symver pthread_cond_destroy,pthread_cond_destroy@GLIBC_2.3.2");
2087 #endif
2088 #ifdef _REENTRANT
2089 __asm__(".symver pthread_cond_init,pthread_cond_init@GLIBC_2.3.2");
2090 #endif
2091 __asm__(".symver pthread_cond_signal,pthread_cond_signal@GLIBC_2.3.2");
2092 #ifdef _REENTRANT
2093 __asm__(".symver pthread_cond_timedwait,pthread_cond_timedwait@GLIBC_2.3.2");
2094 #endif
2095 __asm__(".symver pthread_cond_wait,pthread_cond_wait@GLIBC_2.3.2");
2096 #ifdef _REENTRANT
2097 __asm__(".symver pthread_condattr_destroy,pthread_condattr_destroy@GLIBC_2.2.5");
2098 #endif
2099 __asm__(".symver pthread_condattr_getclock,pthread_condattr_getclock@GLIBC_2.3.3");
2100 __asm__(".symver pthread_condattr_getpshared,pthread_condattr_getpshared@GLIBC_2.2.5");
2101 #ifdef _REENTRANT
2102 __asm__(".symver pthread_condattr_init,pthread_condattr_init@GLIBC_2.2.5");
2103 #endif
2104 __asm__(".symver pthread_condattr_setclock,pthread_condattr_setclock@GLIBC_2.3.3");
2105 __asm__(".symver pthread_condattr_setpshared,pthread_condattr_setpshared@GLIBC_2.2.5");
2106 #ifndef _GLIBCXX_SHARED
2107 #ifdef _REENTRANT
2108 __asm__(".symver pthread_create,pthread_create@GLIBC_2.2.5");
2109 #endif
2110 #endif
2111 #ifndef _GLIBCXX_SHARED
2112 #ifdef _REENTRANT
2113 __asm__(".symver pthread_detach,pthread_detach@GLIBC_2.2.5");
2114 #endif
2115 #endif
2116 #ifdef _REENTRANT
2117 __asm__(".symver pthread_equal,pthread_equal@GLIBC_2.2.5");
2118 #endif
2119 #ifdef _REENTRANT
2120 __asm__(".symver pthread_exit,pthread_exit@GLIBC_2.2.5");
2121 #endif
2122 __asm__(".symver pthread_getaffinity_np,pthread_getaffinity_np@GLIBC_2.3.4");
2123 __asm__(".symver pthread_getattr_default_np,pthread_getattr_default_np@GLIBC_2.18");
2124 __asm__(".symver pthread_getattr_np,pthread_getattr_np@GLIBC_2.2.5");
2125 __asm__(".symver pthread_getconcurrency,pthread_getconcurrency@GLIBC_2.2.5");
2126 __asm__(".symver pthread_getcpuclockid,pthread_getcpuclockid@GLIBC_2.2.5");
2127 __asm__(".symver pthread_getname_np,pthread_getname_np@GLIBC_2.12");
2128 #ifdef _REENTRANT
2129 __asm__(".symver pthread_getschedparam,pthread_getschedparam@GLIBC_2.2.5");
2130 #endif
2131 #ifndef _GLIBCXX_SHARED
2132 #ifndef IN_LIBGCC2
2133 #ifdef _REENTRANT
2134 __asm__(".symver pthread_getspecific,pthread_getspecific@GLIBC_2.2.5");
2135 #endif
2136 #endif
2137 #endif
2138 #ifndef _GLIBCXX_SHARED
2139 #ifdef _REENTRANT
2140 __asm__(".symver pthread_join,pthread_join@GLIBC_2.2.5");
2141 #endif
2142 #endif
2143 #ifndef _GLIBCXX_SHARED
2144 #ifndef IN_LIBGCC2
2145 #ifdef _REENTRANT
2146 __asm__(".symver pthread_key_create,pthread_key_create@GLIBC_2.2.5");
2147 #endif
2148 #endif
2149 #endif
2150 #ifndef _GLIBCXX_SHARED
2151 #ifdef _REENTRANT
2152 __asm__(".symver pthread_key_delete,pthread_key_delete@GLIBC_2.2.5");
2153 #endif
2154 #endif
2155 __asm__(".symver pthread_kill,pthread_kill@GLIBC_2.2.5");
2156 __asm__(".symver pthread_mutex_consistent,pthread_mutex_consistent@GLIBC_2.12");
2157 __asm__(".symver pthread_mutex_consistent_np,pthread_mutex_consistent_np@GLIBC_2.4");
2158 #ifdef _REENTRANT
2159 __asm__(".symver pthread_mutex_destroy,pthread_mutex_destroy@GLIBC_2.2.5");
2160 #endif
2161 __asm__(".symver pthread_mutex_getprioceiling,pthread_mutex_getprioceiling@GLIBC_2.4");
2162 #ifdef _REENTRANT
2163 __asm__(".symver pthread_mutex_init,pthread_mutex_init@GLIBC_2.2.5");
2164 #endif
2165 #ifdef _REENTRANT
2166 __asm__(".symver pthread_mutex_lock,pthread_mutex_lock@GLIBC_2.2.5");
2167 #endif
2168 __asm__(".symver pthread_mutex_setprioceiling,pthread_mutex_setprioceiling@GLIBC_2.4");
2169 __asm__(".symver pthread_mutex_timedlock,pthread_mutex_timedlock@GLIBC_2.2.5");
2170 __asm__(".symver pthread_mutex_trylock,pthread_mutex_trylock@GLIBC_2.2.5");
2171 #ifdef _REENTRANT
2172 __asm__(".symver pthread_mutex_unlock,pthread_mutex_unlock@GLIBC_2.2.5");
2173 #endif
2174 __asm__(".symver pthread_mutexattr_destroy,pthread_mutexattr_destroy@GLIBC_2.2.5");
2175 __asm__(".symver pthread_mutexattr_getkind_np,pthread_mutexattr_getkind_np@GLIBC_2.2.5");
2176 __asm__(".symver pthread_mutexattr_getprioceiling,pthread_mutexattr_getprioceiling@GLIBC_2.4");
2177 __asm__(".symver pthread_mutexattr_getprotocol,pthread_mutexattr_getprotocol@GLIBC_2.4");
2178 __asm__(".symver pthread_mutexattr_getpshared,pthread_mutexattr_getpshared@GLIBC_2.2.5");
2179 __asm__(".symver pthread_mutexattr_getrobust,pthread_mutexattr_getrobust@GLIBC_2.12");
2180 __asm__(".symver pthread_mutexattr_getrobust_np,pthread_mutexattr_getrobust_np@GLIBC_2.4");
2181 __asm__(".symver pthread_mutexattr_gettype,pthread_mutexattr_gettype@GLIBC_2.2.5");
2182 __asm__(".symver pthread_mutexattr_init,pthread_mutexattr_init@GLIBC_2.2.5");
2183 __asm__(".symver pthread_mutexattr_setkind_np,pthread_mutexattr_setkind_np@GLIBC_2.2.5");
2184 __asm__(".symver pthread_mutexattr_setprioceiling,pthread_mutexattr_setprioceiling@GLIBC_2.4");
2185 __asm__(".symver pthread_mutexattr_setprotocol,pthread_mutexattr_setprotocol@GLIBC_2.4");
2186 __asm__(".symver pthread_mutexattr_setpshared,pthread_mutexattr_setpshared@GLIBC_2.2.5");
2187 __asm__(".symver pthread_mutexattr_setrobust,pthread_mutexattr_setrobust@GLIBC_2.12");
2188 __asm__(".symver pthread_mutexattr_setrobust_np,pthread_mutexattr_setrobust_np@GLIBC_2.4");
2189 __asm__(".symver pthread_mutexattr_settype,pthread_mutexattr_settype@GLIBC_2.2.5");
2190 #ifndef _GLIBCXX_SHARED
2191 #ifndef IN_LIBGCC2
2192 #ifdef _REENTRANT
2193 __asm__(".symver pthread_once,pthread_once@GLIBC_2.2.5");
2194 #endif
2195 #endif
2196 #endif
2197 __asm__(".symver pthread_rwlock_destroy,pthread_rwlock_destroy@GLIBC_2.2.5");
2198 __asm__(".symver pthread_rwlock_init,pthread_rwlock_init@GLIBC_2.2.5");
2199 __asm__(".symver pthread_rwlock_rdlock,pthread_rwlock_rdlock@GLIBC_2.2.5");
2200 __asm__(".symver pthread_rwlock_timedrdlock,pthread_rwlock_timedrdlock@GLIBC_2.2.5");
2201 __asm__(".symver pthread_rwlock_timedwrlock,pthread_rwlock_timedwrlock@GLIBC_2.2.5");
2202 __asm__(".symver pthread_rwlock_tryrdlock,pthread_rwlock_tryrdlock@GLIBC_2.2.5");
2203 __asm__(".symver pthread_rwlock_trywrlock,pthread_rwlock_trywrlock@GLIBC_2.2.5");
2204 __asm__(".symver pthread_rwlock_unlock,pthread_rwlock_unlock@GLIBC_2.2.5");
2205 __asm__(".symver pthread_rwlock_wrlock,pthread_rwlock_wrlock@GLIBC_2.2.5");
2206 __asm__(".symver pthread_rwlockattr_destroy,pthread_rwlockattr_destroy@GLIBC_2.2.5");
2207 __asm__(".symver pthread_rwlockattr_getkind_np,pthread_rwlockattr_getkind_np@GLIBC_2.2.5");
2208 __asm__(".symver pthread_rwlockattr_getpshared,pthread_rwlockattr_getpshared@GLIBC_2.2.5");
2209 __asm__(".symver pthread_rwlockattr_init,pthread_rwlockattr_init@GLIBC_2.2.5");
2210 __asm__(".symver pthread_rwlockattr_setkind_np,pthread_rwlockattr_setkind_np@GLIBC_2.2.5");
2211 __asm__(".symver pthread_rwlockattr_setpshared,pthread_rwlockattr_setpshared@GLIBC_2.2.5");
2212 #ifdef _REENTRANT
2213 __asm__(".symver pthread_self,pthread_self@GLIBC_2.2.5");
2214 #endif
2215 __asm__(".symver pthread_setaffinity_np,pthread_setaffinity_np@GLIBC_2.3.4");
2216 __asm__(".symver pthread_setattr_default_np,pthread_setattr_default_np@GLIBC_2.18");
2217 #ifdef _REENTRANT
2218 __asm__(".symver pthread_setcancelstate,pthread_setcancelstate@GLIBC_2.2.5");
2219 #endif
2220 #ifdef _REENTRANT
2221 __asm__(".symver pthread_setcanceltype,pthread_setcanceltype@GLIBC_2.2.5");
2222 #endif
2223 __asm__(".symver pthread_setconcurrency,pthread_setconcurrency@GLIBC_2.2.5");
2224 __asm__(".symver pthread_setname_np,pthread_setname_np@GLIBC_2.12");
2225 #ifdef _REENTRANT
2226 __asm__(".symver pthread_setschedparam,pthread_setschedparam@GLIBC_2.2.5");
2227 #endif
2228 __asm__(".symver pthread_setschedprio,pthread_setschedprio@GLIBC_2.3.4");
2229 #ifndef _GLIBCXX_SHARED
2230 #ifndef IN_LIBGCC2
2231 #ifdef _REENTRANT
2232 __asm__(".symver pthread_setspecific,pthread_setspecific@GLIBC_2.2.5");
2233 #endif
2234 #endif
2235 #endif
2236 __asm__(".symver pthread_sigmask,pthread_sigmask@GLIBC_2.2.5");
2237 __asm__(".symver pthread_sigqueue,pthread_sigqueue@GLIBC_2.11");
2238 __asm__(".symver pthread_spin_destroy,pthread_spin_destroy@GLIBC_2.2.5");
2239 __asm__(".symver pthread_spin_init,pthread_spin_init@GLIBC_2.2.5");
2240 __asm__(".symver pthread_spin_lock,pthread_spin_lock@GLIBC_2.2.5");
2241 __asm__(".symver pthread_spin_trylock,pthread_spin_trylock@GLIBC_2.2.5");
2242 __asm__(".symver pthread_spin_unlock,pthread_spin_unlock@GLIBC_2.2.5");
2243 __asm__(".symver pthread_testcancel,pthread_testcancel@GLIBC_2.2.5");
2244 __asm__(".symver pthread_timedjoin_np,pthread_timedjoin_np@GLIBC_2.3.3");
2245 __asm__(".symver pthread_tryjoin_np,pthread_tryjoin_np@GLIBC_2.3.3");
2246 __asm__(".symver pthread_yield,pthread_yield@GLIBC_2.2.5");
2247 __asm__(".symver ptrace,ptrace@GLIBC_2.2.5");
2248 __asm__(".symver ptsname,ptsname@GLIBC_2.2.5");
2249 __asm__(".symver ptsname_r,ptsname_r@GLIBC_2.2.5");
2250 __asm__(".symver putc,putc@GLIBC_2.2.5");
2251 __asm__(".symver putc_unlocked,putc_unlocked@GLIBC_2.2.5");
2252 __asm__(".symver putchar,putchar@GLIBC_2.2.5");
2253 __asm__(".symver putchar_unlocked,putchar_unlocked@GLIBC_2.2.5");
2254 __asm__(".symver putenv,putenv@GLIBC_2.2.5");
2255 __asm__(".symver putgrent,putgrent@GLIBC_2.2.5");
2256 __asm__(".symver putmsg,putmsg@GLIBC_2.2.5");
2257 __asm__(".symver putpmsg,putpmsg@GLIBC_2.2.5");
2258 __asm__(".symver putpwent,putpwent@GLIBC_2.2.5");
2259 __asm__(".symver puts,puts@GLIBC_2.2.5");
2260 __asm__(".symver putsgent,putsgent@GLIBC_2.10");
2261 __asm__(".symver putspent,putspent@GLIBC_2.2.5");
2262 __asm__(".symver pututline,pututline@GLIBC_2.2.5");
2263 __asm__(".symver pututxline,pututxline@GLIBC_2.2.5");
2264 __asm__(".symver putw,putw@GLIBC_2.2.5");
2265 __asm__(".symver putwc,putwc@GLIBC_2.2.5");
2266 __asm__(".symver putwc_unlocked,putwc_unlocked@GLIBC_2.2.5");
2267 __asm__(".symver putwchar,putwchar@GLIBC_2.2.5");
2268 __asm__(".symver putwchar_unlocked,putwchar_unlocked@GLIBC_2.2.5");
2269 __asm__(".symver pvalloc,pvalloc@GLIBC_2.2.5");
2270 __asm__(".symver pwrite,pwrite@GLIBC_2.2.5");
2271 __asm__(".symver pwrite64,pwrite64@GLIBC_2.2.5");
2272 __asm__(".symver pwritev,pwritev@GLIBC_2.10");
2273 __asm__(".symver pwritev64,pwritev64@GLIBC_2.10");
2274 __asm__(".symver qecvt,qecvt@GLIBC_2.2.5");
2275 __asm__(".symver qecvt_r,qecvt_r@GLIBC_2.2.5");
2276 __asm__(".symver qfcvt,qfcvt@GLIBC_2.2.5");
2277 __asm__(".symver qfcvt_r,qfcvt_r@GLIBC_2.2.5");
2278 __asm__(".symver qgcvt,qgcvt@GLIBC_2.2.5");
2279 __asm__(".symver qsort,qsort@GLIBC_2.2.5");
2280 __asm__(".symver qsort_r,qsort_r@GLIBC_2.8");
2281 __asm__(".symver quick_exit,quick_exit@GLIBC_2.24");
2282 __asm__(".symver quotactl,quotactl@GLIBC_2.2.5");
2283 __asm__(".symver raise,raise@GLIBC_2.2.5");
2284 __asm__(".symver rand,rand@GLIBC_2.2.5");
2285 __asm__(".symver rand_r,rand_r@GLIBC_2.2.5");
2286 __asm__(".symver random,random@GLIBC_2.2.5");
2287 __asm__(".symver random_r,random_r@GLIBC_2.2.5");
2288 __asm__(".symver rawmemchr,rawmemchr@GLIBC_2.2.5");
2289 __asm__(".symver rcmd,rcmd@GLIBC_2.2.5");
2290 __asm__(".symver rcmd_af,rcmd_af@GLIBC_2.2.5");
2291 __asm__(".symver re_comp,re_comp@GLIBC_2.2.5");
2292 __asm__(".symver re_compile_fastmap,re_compile_fastmap@GLIBC_2.2.5");
2293 __asm__(".symver re_compile_pattern,re_compile_pattern@GLIBC_2.2.5");
2294 __asm__(".symver re_exec,re_exec@GLIBC_2.2.5");
2295 __asm__(".symver re_match,re_match@GLIBC_2.2.5");
2296 __asm__(".symver re_match_2,re_match_2@GLIBC_2.2.5");
2297 __asm__(".symver re_max_failures,re_max_failures@GLIBC_2.2.5");
2298 __asm__(".symver re_search,re_search@GLIBC_2.2.5");
2299 __asm__(".symver re_search_2,re_search_2@GLIBC_2.2.5");
2300 __asm__(".symver re_set_registers,re_set_registers@GLIBC_2.2.5");
2301 __asm__(".symver re_set_syntax,re_set_syntax@GLIBC_2.2.5");
2302 __asm__(".symver re_syntax_options,re_syntax_options@GLIBC_2.2.5");
2303 __asm__(".symver read,read@GLIBC_2.2.5");
2304 __asm__(".symver readColdStartFile,readColdStartFile@GLIBC_2.2.5");
2305 __asm__(".symver readahead,readahead@GLIBC_2.3");
2306 __asm__(".symver readdir,readdir@GLIBC_2.2.5");
2307 __asm__(".symver readdir64,readdir64@GLIBC_2.2.5");
2308 __asm__(".symver readdir64_r,readdir64_r@GLIBC_2.2.5");
2309 __asm__(".symver readdir_r,readdir_r@GLIBC_2.2.5");
2310 __asm__(".symver readlink,readlink@GLIBC_2.2.5");
2311 __asm__(".symver readlinkat,readlinkat@GLIBC_2.4");
2312 __asm__(".symver readv,readv@GLIBC_2.2.5");
2313 __asm__(".symver realloc,realloc@GLIBC_2.2.5");
2314 __asm__(".symver realpath,realpath@GLIBC_2.3");
2315 __asm__(".symver reboot,reboot@GLIBC_2.2.5");
2316 __asm__(".symver recv,recv@GLIBC_2.2.5");
2317 __asm__(".symver recvfrom,recvfrom@GLIBC_2.2.5");
2318 __asm__(".symver recvmmsg,recvmmsg@GLIBC_2.12");
2319 __asm__(".symver recvmsg,recvmsg@GLIBC_2.2.5");
2320 __asm__(".symver regcomp,regcomp@GLIBC_2.2.5");
2321 __asm__(".symver regerror,regerror@GLIBC_2.2.5");
2322 __asm__(".symver regexec,regexec@GLIBC_2.3.4");
2323 __asm__(".symver regfree,regfree@GLIBC_2.2.5");
2324 __asm__(".symver register_printf_function,register_printf_function@GLIBC_2.2.5");
2325 __asm__(".symver register_printf_modifier,register_printf_modifier@GLIBC_2.10");
2326 __asm__(".symver register_printf_specifier,register_printf_specifier@GLIBC_2.10");
2327 __asm__(".symver register_printf_type,register_printf_type@GLIBC_2.10");
2328 __asm__(".symver remainder,remainder@GLIBC_2.2.5");
2329 __asm__(".symver remainderf,remainderf@GLIBC_2.2.5");
2330 __asm__(".symver remainderl,remainderl@GLIBC_2.2.5");
2331 __asm__(".symver remap_file_pages,remap_file_pages@GLIBC_2.3.3");
2332 __asm__(".symver remove,remove@GLIBC_2.2.5");
2333 __asm__(".symver removexattr,removexattr@GLIBC_2.3");
2334 __asm__(".symver remque,remque@GLIBC_2.2.5");
2335 __asm__(".symver remquo,remquo@GLIBC_2.2.5");
2336 __asm__(".symver remquof,remquof@GLIBC_2.2.5");
2337 __asm__(".symver remquol,remquol@GLIBC_2.2.5");
2338 __asm__(".symver rename,rename@GLIBC_2.2.5");
2339 __asm__(".symver renameat,renameat@GLIBC_2.4");
2340 __asm__(".symver revoke,revoke@GLIBC_2.2.5");
2341 __asm__(".symver rewind,rewind@GLIBC_2.2.5");
2342 __asm__(".symver rewinddir,rewinddir@GLIBC_2.2.5");
2343 __asm__(".symver rexec,rexec@GLIBC_2.2.5");
2344 __asm__(".symver rexec_af,rexec_af@GLIBC_2.2.5");
2345 __asm__(".symver rexecoptions,rexecoptions@GLIBC_2.2.5");
2346 __asm__(".symver rindex,rindex@GLIBC_2.2.5");
2347 __asm__(".symver rint,rint@GLIBC_2.2.5");
2348 __asm__(".symver rintf,rintf@GLIBC_2.2.5");
2349 __asm__(".symver rintl,rintl@GLIBC_2.2.5");
2350 __asm__(".symver rmdir,rmdir@GLIBC_2.2.5");
2351 __asm__(".symver round,round@GLIBC_2.2.5");
2352 __asm__(".symver roundeven,roundeven@GLIBC_2.25");
2353 __asm__(".symver roundevenf,roundevenf@GLIBC_2.25");
2354 __asm__(".symver roundevenl,roundevenl@GLIBC_2.25");
2355 __asm__(".symver roundf,roundf@GLIBC_2.2.5");
2356 __asm__(".symver roundl,roundl@GLIBC_2.2.5");
2357 __asm__(".symver rpc_createerr,rpc_createerr@GLIBC_2.2.5");
2358 __asm__(".symver rpmatch,rpmatch@GLIBC_2.2.5");
2359 __asm__(".symver rresvport,rresvport@GLIBC_2.2.5");
2360 __asm__(".symver rresvport_af,rresvport_af@GLIBC_2.2.5");
2361 __asm__(".symver ruserok,ruserok@GLIBC_2.2.5");
2362 __asm__(".symver ruserok_af,ruserok_af@GLIBC_2.2.5");
2363 __asm__(".symver ruserpass,ruserpass@GLIBC_2.2.5");
2364 __asm__(".symver sbrk,sbrk@GLIBC_2.2.5");
2365 __asm__(".symver scalb,scalb@GLIBC_2.2.5");
2366 __asm__(".symver scalbf,scalbf@GLIBC_2.2.5");
2367 __asm__(".symver scalbl,scalbl@GLIBC_2.2.5");
2368 __asm__(".symver scalbln,scalbln@GLIBC_2.2.5");
2369 __asm__(".symver scalblnf,scalblnf@GLIBC_2.2.5");
2370 __asm__(".symver scalblnl,scalblnl@GLIBC_2.2.5");
2371 __asm__(".symver scalbn,scalbn@GLIBC_2.2.5");
2372 __asm__(".symver scalbnf,scalbnf@GLIBC_2.2.5");
2373 __asm__(".symver scalbnl,scalbnl@GLIBC_2.2.5");
2374 __asm__(".symver scandir,scandir@GLIBC_2.2.5");
2375 __asm__(".symver scandir64,scandir64@GLIBC_2.2.5");
2376 __asm__(".symver scandirat,scandirat@GLIBC_2.15");
2377 __asm__(".symver scandirat64,scandirat64@GLIBC_2.15");
2378 __asm__(".symver scanf,scanf@GLIBC_2.2.5");
2379 __asm__(".symver sched_get_priority_max,sched_get_priority_max@GLIBC_2.2.5");
2380 __asm__(".symver sched_get_priority_min,sched_get_priority_min@GLIBC_2.2.5");
2381 __asm__(".symver sched_getaffinity,sched_getaffinity@GLIBC_2.3.4");
2382 __asm__(".symver sched_getcpu,sched_getcpu@GLIBC_2.6");
2383 __asm__(".symver sched_getparam,sched_getparam@GLIBC_2.2.5");
2384 __asm__(".symver sched_getscheduler,sched_getscheduler@GLIBC_2.2.5");
2385 __asm__(".symver sched_rr_get_interval,sched_rr_get_interval@GLIBC_2.2.5");
2386 __asm__(".symver sched_setaffinity,sched_setaffinity@GLIBC_2.3.4");
2387 __asm__(".symver sched_setparam,sched_setparam@GLIBC_2.2.5");
2388 __asm__(".symver sched_setscheduler,sched_setscheduler@GLIBC_2.2.5");
2389 __asm__(".symver sched_yield,sched_yield@GLIBC_2.2.5");
2390 __asm__(".symver secure_getenv,secure_getenv@GLIBC_2.17");
2391 __asm__(".symver seed48,seed48@GLIBC_2.2.5");
2392 __asm__(".symver seed48_r,seed48_r@GLIBC_2.2.5");
2393 __asm__(".symver seekdir,seekdir@GLIBC_2.2.5");
2394 __asm__(".symver select,select@GLIBC_2.2.5");
2395 __asm__(".symver sem_close,sem_close@GLIBC_2.2.5");
2396 __asm__(".symver sem_destroy,sem_destroy@GLIBC_2.2.5");
2397 __asm__(".symver sem_getvalue,sem_getvalue@GLIBC_2.2.5");
2398 __asm__(".symver sem_init,sem_init@GLIBC_2.2.5");
2399 __asm__(".symver sem_open,sem_open@GLIBC_2.2.5");
2400 __asm__(".symver sem_post,sem_post@GLIBC_2.2.5");
2401 __asm__(".symver sem_timedwait,sem_timedwait@GLIBC_2.2.5");
2402 __asm__(".symver sem_trywait,sem_trywait@GLIBC_2.2.5");
2403 __asm__(".symver sem_unlink,sem_unlink@GLIBC_2.2.5");
2404 __asm__(".symver sem_wait,sem_wait@GLIBC_2.2.5");
2405 __asm__(".symver semctl,semctl@GLIBC_2.2.5");
2406 __asm__(".symver semget,semget@GLIBC_2.2.5");
2407 __asm__(".symver semop,semop@GLIBC_2.2.5");
2408 __asm__(".symver semtimedop,semtimedop@GLIBC_2.3.3");
2409 __asm__(".symver send,send@GLIBC_2.2.5");
2410 __asm__(".symver sendfile,sendfile@GLIBC_2.2.5");
2411 __asm__(".symver sendfile64,sendfile64@GLIBC_2.3");
2412 __asm__(".symver sendmmsg,sendmmsg@GLIBC_2.14");
2413 __asm__(".symver sendmsg,sendmsg@GLIBC_2.2.5");
2414 __asm__(".symver sendto,sendto@GLIBC_2.2.5");
2415 __asm__(".symver setaliasent,setaliasent@GLIBC_2.2.5");
2416 __asm__(".symver setbuf,setbuf@GLIBC_2.2.5");
2417 __asm__(".symver setbuffer,setbuffer@GLIBC_2.2.5");
2418 __asm__(".symver setcontext,setcontext@GLIBC_2.2.5");
2419 __asm__(".symver setdomainname,setdomainname@GLIBC_2.2.5");
2420 __asm__(".symver setegid,setegid@GLIBC_2.2.5");
2421 __asm__(".symver setenv,setenv@GLIBC_2.2.5");
2422 __asm__(".symver seteuid,seteuid@GLIBC_2.2.5");
2423 __asm__(".symver setfsent,setfsent@GLIBC_2.2.5");
2424 __asm__(".symver setfsgid,setfsgid@GLIBC_2.2.5");
2425 __asm__(".symver setfsuid,setfsuid@GLIBC_2.2.5");
2426 __asm__(".symver setgid,setgid@GLIBC_2.2.5");
2427 __asm__(".symver setgrent,setgrent@GLIBC_2.2.5");
2428 __asm__(".symver setgroups,setgroups@GLIBC_2.2.5");
2429 __asm__(".symver sethostent,sethostent@GLIBC_2.2.5");
2430 __asm__(".symver sethostid,sethostid@GLIBC_2.2.5");
2431 __asm__(".symver sethostname,sethostname@GLIBC_2.2.5");
2432 __asm__(".symver setipv4sourcefilter,setipv4sourcefilter@GLIBC_2.3.4");
2433 __asm__(".symver setitimer,setitimer@GLIBC_2.2.5");
2434 __asm__(".symver setjmp,setjmp@GLIBC_2.2.5");
2435 __asm__(".symver setkey,setkey@GLIBC_2.2.5");
2436 __asm__(".symver setkey_r,setkey_r@GLIBC_2.2.5");
2437 __asm__(".symver setlinebuf,setlinebuf@GLIBC_2.2.5");
2438 __asm__(".symver setlocale,setlocale@GLIBC_2.2.5");
2439 __asm__(".symver setlogin,setlogin@GLIBC_2.2.5");
2440 __asm__(".symver setlogmask,setlogmask@GLIBC_2.2.5");
2441 __asm__(".symver setmntent,setmntent@GLIBC_2.2.5");
2442 __asm__(".symver setnetent,setnetent@GLIBC_2.2.5");
2443 __asm__(".symver setnetgrent,setnetgrent@GLIBC_2.2.5");
2444 __asm__(".symver setns,setns@GLIBC_2.14");
2445 __asm__(".symver setpayload,setpayload@GLIBC_2.25");
2446 __asm__(".symver setpayloadf,setpayloadf@GLIBC_2.25");
2447 __asm__(".symver setpayloadl,setpayloadl@GLIBC_2.25");
2448 __asm__(".symver setpayloadsig,setpayloadsig@GLIBC_2.25");
2449 __asm__(".symver setpayloadsigf,setpayloadsigf@GLIBC_2.25");
2450 __asm__(".symver setpayloadsigl,setpayloadsigl@GLIBC_2.25");
2451 __asm__(".symver setpgid,setpgid@GLIBC_2.2.5");
2452 __asm__(".symver setpgrp,setpgrp@GLIBC_2.2.5");
2453 __asm__(".symver setpriority,setpriority@GLIBC_2.2.5");
2454 __asm__(".symver setprotoent,setprotoent@GLIBC_2.2.5");
2455 __asm__(".symver setpwent,setpwent@GLIBC_2.2.5");
2456 __asm__(".symver setregid,setregid@GLIBC_2.2.5");
2457 __asm__(".symver setresgid,setresgid@GLIBC_2.2.5");
2458 __asm__(".symver setresuid,setresuid@GLIBC_2.2.5");
2459 __asm__(".symver setreuid,setreuid@GLIBC_2.2.5");
2460 __asm__(".symver setrlimit,setrlimit@GLIBC_2.2.5");
2461 __asm__(".symver setrlimit64,setrlimit64@GLIBC_2.2.5");
2462 __asm__(".symver setrpcent,setrpcent@GLIBC_2.2.5");
2463 __asm__(".symver setservent,setservent@GLIBC_2.2.5");
2464 __asm__(".symver setsgent,setsgent@GLIBC_2.10");
2465 __asm__(".symver setsid,setsid@GLIBC_2.2.5");
2466 __asm__(".symver setsockopt,setsockopt@GLIBC_2.2.5");
2467 __asm__(".symver setsourcefilter,setsourcefilter@GLIBC_2.3.4");
2468 __asm__(".symver setspent,setspent@GLIBC_2.2.5");
2469 __asm__(".symver setstate,setstate@GLIBC_2.2.5");
2470 __asm__(".symver setstate_r,setstate_r@GLIBC_2.2.5");
2471 __asm__(".symver settimeofday,settimeofday@GLIBC_2.2.5");
2472 __asm__(".symver setttyent,setttyent@GLIBC_2.2.5");
2473 __asm__(".symver setuid,setuid@GLIBC_2.2.5");
2474 __asm__(".symver setusershell,setusershell@GLIBC_2.2.5");
2475 __asm__(".symver setutent,setutent@GLIBC_2.2.5");
2476 __asm__(".symver setutxent,setutxent@GLIBC_2.2.5");
2477 __asm__(".symver setvbuf,setvbuf@GLIBC_2.2.5");
2478 __asm__(".symver setxattr,setxattr@GLIBC_2.3");
2479 __asm__(".symver sgetsgent,sgetsgent@GLIBC_2.10");
2480 __asm__(".symver sgetsgent_r,sgetsgent_r@GLIBC_2.10");
2481 __asm__(".symver sgetspent,sgetspent@GLIBC_2.2.5");
2482 __asm__(".symver sgetspent_r,sgetspent_r@GLIBC_2.2.5");
2483 __asm__(".symver shm_open,shm_open@GLIBC_2.2.5");
2484 __asm__(".symver shm_unlink,shm_unlink@GLIBC_2.2.5");
2485 __asm__(".symver shmat,shmat@GLIBC_2.2.5");
2486 __asm__(".symver shmctl,shmctl@GLIBC_2.2.5");
2487 __asm__(".symver shmdt,shmdt@GLIBC_2.2.5");
2488 __asm__(".symver shmget,shmget@GLIBC_2.2.5");
2489 __asm__(".symver shutdown,shutdown@GLIBC_2.2.5");
2490 __asm__(".symver sigaction,sigaction@GLIBC_2.2.5");
2491 __asm__(".symver sigaddset,sigaddset@GLIBC_2.2.5");
2492 __asm__(".symver sigaltstack,sigaltstack@GLIBC_2.2.5");
2493 __asm__(".symver sigandset,sigandset@GLIBC_2.2.5");
2494 __asm__(".symver sigblock,sigblock@GLIBC_2.2.5");
2495 __asm__(".symver sigdelset,sigdelset@GLIBC_2.2.5");
2496 __asm__(".symver sigemptyset,sigemptyset@GLIBC_2.2.5");
2497 __asm__(".symver sigfillset,sigfillset@GLIBC_2.2.5");
2498 __asm__(".symver siggetmask,siggetmask@GLIBC_2.2.5");
2499 __asm__(".symver sighold,sighold@GLIBC_2.2.5");
2500 __asm__(".symver sigignore,sigignore@GLIBC_2.2.5");
2501 __asm__(".symver siginterrupt,siginterrupt@GLIBC_2.2.5");
2502 __asm__(".symver sigisemptyset,sigisemptyset@GLIBC_2.2.5");
2503 __asm__(".symver sigismember,sigismember@GLIBC_2.2.5");
2504 __asm__(".symver siglongjmp,siglongjmp@GLIBC_2.2.5");
2505 __asm__(".symver signal,signal@GLIBC_2.2.5");
2506 __asm__(".symver signalfd,signalfd@GLIBC_2.7");
2507 __asm__(".symver signgam,signgam@GLIBC_2.2.5");
2508 __asm__(".symver significand,significand@GLIBC_2.2.5");
2509 __asm__(".symver significandf,significandf@GLIBC_2.2.5");
2510 __asm__(".symver significandl,significandl@GLIBC_2.2.5");
2511 __asm__(".symver sigorset,sigorset@GLIBC_2.2.5");
2512 __asm__(".symver sigpause,sigpause@GLIBC_2.2.5");
2513 __asm__(".symver sigpending,sigpending@GLIBC_2.2.5");
2514 __asm__(".symver sigprocmask,sigprocmask@GLIBC_2.2.5");
2515 __asm__(".symver sigqueue,sigqueue@GLIBC_2.2.5");
2516 __asm__(".symver sigrelse,sigrelse@GLIBC_2.2.5");
2517 __asm__(".symver sigreturn,sigreturn@GLIBC_2.2.5");
2518 __asm__(".symver sigset,sigset@GLIBC_2.2.5");
2519 __asm__(".symver sigsetmask,sigsetmask@GLIBC_2.2.5");
2520 __asm__(".symver sigstack,sigstack@GLIBC_2.2.5");
2521 __asm__(".symver sigsuspend,sigsuspend@GLIBC_2.2.5");
2522 __asm__(".symver sigtimedwait,sigtimedwait@GLIBC_2.2.5");
2523 __asm__(".symver sigwait,sigwait@GLIBC_2.2.5");
2524 __asm__(".symver sigwaitinfo,sigwaitinfo@GLIBC_2.2.5");
2525 __asm__(".symver sin,sin@GLIBC_2.2.5");
2526 __asm__(".symver sincos,sincos@GLIBC_2.2.5");
2527 __asm__(".symver sincosf,sincosf@GLIBC_2.2.5");
2528 __asm__(".symver sincosl,sincosl@GLIBC_2.2.5");
2529 __asm__(".symver sinf,sinf@GLIBC_2.2.5");
2530 __asm__(".symver sinh,sinh@GLIBC_2.2.5");
2531 __asm__(".symver sinhf,sinhf@GLIBC_2.2.5");
2532 __asm__(".symver sinhl,sinhl@GLIBC_2.2.5");
2533 __asm__(".symver sinl,sinl@GLIBC_2.2.5");
2534 __asm__(".symver sleep,sleep@GLIBC_2.2.5");
2535 __asm__(".symver snprintf,snprintf@GLIBC_2.2.5");
2536 __asm__(".symver sockatmark,sockatmark@GLIBC_2.2.5");
2537 __asm__(".symver socket,socket@GLIBC_2.2.5");
2538 __asm__(".symver socketpair,socketpair@GLIBC_2.2.5");
2539 __asm__(".symver splice,splice@GLIBC_2.5");
2540 __asm__(".symver sprintf,sprintf@GLIBC_2.2.5");
2541 __asm__(".symver sprofil,sprofil@GLIBC_2.2.5");
2542 __asm__(".symver sqrt,sqrt@GLIBC_2.2.5");
2543 __asm__(".symver sqrtf,sqrtf@GLIBC_2.2.5");
2544 __asm__(".symver sqrtl,sqrtl@GLIBC_2.2.5");
2545 __asm__(".symver srand,srand@GLIBC_2.2.5");
2546 __asm__(".symver srand48,srand48@GLIBC_2.2.5");
2547 __asm__(".symver srand48_r,srand48_r@GLIBC_2.2.5");
2548 __asm__(".symver srandom,srandom@GLIBC_2.2.5");
2549 __asm__(".symver srandom_r,srandom_r@GLIBC_2.2.5");
2550 __asm__(".symver sscanf,sscanf@GLIBC_2.2.5");
2551 __asm__(".symver ssignal,ssignal@GLIBC_2.2.5");
2552 __asm__(".symver sstk,sstk@GLIBC_2.2.5");
2553 __asm__(".symver statfs,statfs@GLIBC_2.2.5");
2554 __asm__(".symver statfs64,statfs64@GLIBC_2.2.5");
2555 __asm__(".symver statvfs,statvfs@GLIBC_2.2.5");
2556 __asm__(".symver statvfs64,statvfs64@GLIBC_2.2.5");
2557 __asm__(".symver stderr,stderr@GLIBC_2.2.5");
2558 __asm__(".symver stdin,stdin@GLIBC_2.2.5");
2559 __asm__(".symver stdout,stdout@GLIBC_2.2.5");
2560 __asm__(".symver stime,stime@GLIBC_2.2.5");
2561 __asm__(".symver stpcpy,stpcpy@GLIBC_2.2.5");
2562 __asm__(".symver stpncpy,stpncpy@GLIBC_2.2.5");
2563 __asm__(".symver strcasecmp,strcasecmp@GLIBC_2.2.5");
2564 __asm__(".symver strcasecmp_l,strcasecmp_l@GLIBC_2.3");
2565 __asm__(".symver strcasestr,strcasestr@GLIBC_2.2.5");
2566 __asm__(".symver strcat,strcat@GLIBC_2.2.5");
2567 __asm__(".symver strchr,strchr@GLIBC_2.2.5");
2568 __asm__(".symver strchrnul,strchrnul@GLIBC_2.2.5");
2569 __asm__(".symver strcmp,strcmp@GLIBC_2.2.5");
2570 __asm__(".symver strcoll,strcoll@GLIBC_2.2.5");
2571 __asm__(".symver strcoll_l,strcoll_l@GLIBC_2.3");
2572 __asm__(".symver strcpy,strcpy@GLIBC_2.2.5");
2573 __asm__(".symver strcspn,strcspn@GLIBC_2.2.5");
2574 __asm__(".symver strdup,strdup@GLIBC_2.2.5");
2575 __asm__(".symver strerror,strerror@GLIBC_2.2.5");
2576 __asm__(".symver strerror_l,strerror_l@GLIBC_2.6");
2577 __asm__(".symver strerror_r,strerror_r@GLIBC_2.2.5");
2578 __asm__(".symver strfmon,strfmon@GLIBC_2.2.5");
2579 __asm__(".symver strfmon_l,strfmon_l@GLIBC_2.3");
2580 __asm__(".symver strfromd,strfromd@GLIBC_2.25");
2581 __asm__(".symver strfromf,strfromf@GLIBC_2.25");
2582 __asm__(".symver strfroml,strfroml@GLIBC_2.25");
2583 __asm__(".symver strfry,strfry@GLIBC_2.2.5");
2584 __asm__(".symver strftime,strftime@GLIBC_2.2.5");
2585 __asm__(".symver strftime_l,strftime_l@GLIBC_2.3");
2586 __asm__(".symver strlen,strlen@GLIBC_2.2.5");
2587 __asm__(".symver strncasecmp,strncasecmp@GLIBC_2.2.5");
2588 __asm__(".symver strncasecmp_l,strncasecmp_l@GLIBC_2.3");
2589 __asm__(".symver strncat,strncat@GLIBC_2.2.5");
2590 __asm__(".symver strncmp,strncmp@GLIBC_2.2.5");
2591 __asm__(".symver strncpy,strncpy@GLIBC_2.2.5");
2592 __asm__(".symver strndup,strndup@GLIBC_2.2.5");
2593 __asm__(".symver strnlen,strnlen@GLIBC_2.2.5");
2594 __asm__(".symver strpbrk,strpbrk@GLIBC_2.2.5");
2595 __asm__(".symver strptime,strptime@GLIBC_2.2.5");
2596 __asm__(".symver strptime_l,strptime_l@GLIBC_2.3.2");
2597 __asm__(".symver strrchr,strrchr@GLIBC_2.2.5");
2598 __asm__(".symver strsep,strsep@GLIBC_2.2.5");
2599 __asm__(".symver strsignal,strsignal@GLIBC_2.2.5");
2600 __asm__(".symver strspn,strspn@GLIBC_2.2.5");
2601 __asm__(".symver strstr,strstr@GLIBC_2.2.5");
2602 __asm__(".symver strtod,strtod@GLIBC_2.2.5");
2603 __asm__(".symver strtod_l,strtod_l@GLIBC_2.3");
2604 __asm__(".symver strtof,strtof@GLIBC_2.2.5");
2605 __asm__(".symver strtof_l,strtof_l@GLIBC_2.3");
2606 __asm__(".symver strtoimax,strtoimax@GLIBC_2.2.5");
2607 __asm__(".symver strtok,strtok@GLIBC_2.2.5");
2608 __asm__(".symver strtok_r,strtok_r@GLIBC_2.2.5");
2609 __asm__(".symver strtol,strtol@GLIBC_2.2.5");
2610 __asm__(".symver strtol_l,strtol_l@GLIBC_2.3");
2611 __asm__(".symver strtold,strtold@GLIBC_2.2.5");
2612 __asm__(".symver strtold_l,strtold_l@GLIBC_2.3");
2613 __asm__(".symver strtoll,strtoll@GLIBC_2.2.5");
2614 __asm__(".symver strtoll_l,strtoll_l@GLIBC_2.3.3");
2615 __asm__(".symver strtoq,strtoq@GLIBC_2.2.5");
2616 __asm__(".symver strtoul,strtoul@GLIBC_2.2.5");
2617 __asm__(".symver strtoul_l,strtoul_l@GLIBC_2.3");
2618 __asm__(".symver strtoull,strtoull@GLIBC_2.2.5");
2619 __asm__(".symver strtoull_l,strtoull_l@GLIBC_2.3.3");
2620 __asm__(".symver strtoumax,strtoumax@GLIBC_2.2.5");
2621 __asm__(".symver strtouq,strtouq@GLIBC_2.2.5");
2622 __asm__(".symver strverscmp,strverscmp@GLIBC_2.2.5");
2623 __asm__(".symver strxfrm,strxfrm@GLIBC_2.2.5");
2624 __asm__(".symver strxfrm_l,strxfrm_l@GLIBC_2.3");
2625 __asm__(".symver stty,stty@GLIBC_2.2.5");
2626 __asm__(".symver svc_fdset,svc_fdset@GLIBC_2.2.5");
2627 __asm__(".symver svc_getreq_poll,svc_getreq_poll@GLIBC_2.2.5");
2628 __asm__(".symver svc_max_pollfd,svc_max_pollfd@GLIBC_2.2.5");
2629 __asm__(".symver svc_pollfd,svc_pollfd@GLIBC_2.2.5");
2630 __asm__(".symver svc_register,svc_register@GLIBC_2.2.5");
2631 __asm__(".symver svc_sendreply,svc_sendreply@GLIBC_2.2.5");
2632 __asm__(".symver svcauthdes_stats,svcauthdes_stats@GLIBC_2.2.5");
2633 __asm__(".symver svcerr_decode,svcerr_decode@GLIBC_2.2.5");
2634 __asm__(".symver svcerr_noproc,svcerr_noproc@GLIBC_2.2.5");
2635 __asm__(".symver svcerr_systemerr,svcerr_systemerr@GLIBC_2.2.5");
2636 __asm__(".symver svctcp_create,svctcp_create@GLIBC_2.2.5");
2637 __asm__(".symver svcudp_bufcreate,svcudp_bufcreate@GLIBC_2.2.5");
2638 __asm__(".symver swab,swab@GLIBC_2.2.5");
2639 __asm__(".symver swapcontext,swapcontext@GLIBC_2.2.5");
2640 __asm__(".symver swapoff,swapoff@GLIBC_2.2.5");
2641 __asm__(".symver swapon,swapon@GLIBC_2.2.5");
2642 __asm__(".symver swprintf,swprintf@GLIBC_2.2.5");
2643 __asm__(".symver swscanf,swscanf@GLIBC_2.2.5");
2644 __asm__(".symver symlink,symlink@GLIBC_2.2.5");
2645 __asm__(".symver symlinkat,symlinkat@GLIBC_2.4");
2646 __asm__(".symver sync,sync@GLIBC_2.2.5");
2647 __asm__(".symver sync_file_range,sync_file_range@GLIBC_2.6");
2648 __asm__(".symver syncfs,syncfs@GLIBC_2.14");
2649 __asm__(".symver sys_errlist,sys_errlist@GLIBC_2.12");
2650 __asm__(".symver sys_nerr,sys_nerr@GLIBC_2.12");
2651 __asm__(".symver sys_sigabbrev,sys_sigabbrev@GLIBC_2.3.3");
2652 __asm__(".symver sys_siglist,sys_siglist@GLIBC_2.3.3");
2653 __asm__(".symver syscall,syscall@GLIBC_2.2.5");
2654 __asm__(".symver sysconf,sysconf@GLIBC_2.2.5");
2655 __asm__(".symver sysctl,sysctl@GLIBC_2.2.5");
2656 __asm__(".symver sysinfo,sysinfo@GLIBC_2.2.5");
2657 __asm__(".symver syslog,syslog@GLIBC_2.2.5");
2658 __asm__(".symver system,system@GLIBC_2.2.5");
2659 __asm__(".symver sysv_signal,sysv_signal@GLIBC_2.2.5");
2660 __asm__(".symver tan,tan@GLIBC_2.2.5");
2661 __asm__(".symver tanf,tanf@GLIBC_2.2.5");
2662 __asm__(".symver tanh,tanh@GLIBC_2.2.5");
2663 __asm__(".symver tanhf,tanhf@GLIBC_2.2.5");
2664 __asm__(".symver tanhl,tanhl@GLIBC_2.2.5");
2665 __asm__(".symver tanl,tanl@GLIBC_2.2.5");
2666 __asm__(".symver tcdrain,tcdrain@GLIBC_2.2.5");
2667 __asm__(".symver tcflow,tcflow@GLIBC_2.2.5");
2668 __asm__(".symver tcflush,tcflush@GLIBC_2.2.5");
2669 __asm__(".symver tcgetattr,tcgetattr@GLIBC_2.2.5");
2670 __asm__(".symver tcgetpgrp,tcgetpgrp@GLIBC_2.2.5");
2671 __asm__(".symver tcgetsid,tcgetsid@GLIBC_2.2.5");
2672 __asm__(".symver tcsendbreak,tcsendbreak@GLIBC_2.2.5");
2673 __asm__(".symver tcsetattr,tcsetattr@GLIBC_2.2.5");
2674 __asm__(".symver tcsetpgrp,tcsetpgrp@GLIBC_2.2.5");
2675 __asm__(".symver td_init,td_init@GLIBC_2.2.5");
2676 __asm__(".symver td_log,td_log@GLIBC_2.2.5");
2677 __asm__(".symver td_symbol_list,td_symbol_list@GLIBC_2.2.5");
2678 __asm__(".symver td_ta_clear_event,td_ta_clear_event@GLIBC_2.2.5");
2679 __asm__(".symver td_ta_delete,td_ta_delete@GLIBC_2.2.5");
2680 __asm__(".symver td_ta_enable_stats,td_ta_enable_stats@GLIBC_2.2.5");
2681 __asm__(".symver td_ta_event_addr,td_ta_event_addr@GLIBC_2.2.5");
2682 __asm__(".symver td_ta_event_getmsg,td_ta_event_getmsg@GLIBC_2.2.5");
2683 __asm__(".symver td_ta_get_nthreads,td_ta_get_nthreads@GLIBC_2.2.5");
2684 __asm__(".symver td_ta_get_ph,td_ta_get_ph@GLIBC_2.2.5");
2685 __asm__(".symver td_ta_get_stats,td_ta_get_stats@GLIBC_2.2.5");
2686 __asm__(".symver td_ta_map_id2thr,td_ta_map_id2thr@GLIBC_2.2.5");
2687 __asm__(".symver td_ta_map_lwp2thr,td_ta_map_lwp2thr@GLIBC_2.2.5");
2688 __asm__(".symver td_ta_new,td_ta_new@GLIBC_2.2.5");
2689 __asm__(".symver td_ta_reset_stats,td_ta_reset_stats@GLIBC_2.2.5");
2690 __asm__(".symver td_ta_set_event,td_ta_set_event@GLIBC_2.2.5");
2691 __asm__(".symver td_ta_setconcurrency,td_ta_setconcurrency@GLIBC_2.2.5");
2692 __asm__(".symver td_ta_thr_iter,td_ta_thr_iter@GLIBC_2.2.5");
2693 __asm__(".symver td_ta_tsd_iter,td_ta_tsd_iter@GLIBC_2.2.5");
2694 __asm__(".symver td_thr_clear_event,td_thr_clear_event@GLIBC_2.2.5");
2695 __asm__(".symver td_thr_dbresume,td_thr_dbresume@GLIBC_2.2.5");
2696 __asm__(".symver td_thr_dbsuspend,td_thr_dbsuspend@GLIBC_2.2.5");
2697 __asm__(".symver td_thr_event_enable,td_thr_event_enable@GLIBC_2.2.5");
2698 __asm__(".symver td_thr_event_getmsg,td_thr_event_getmsg@GLIBC_2.2.5");
2699 __asm__(".symver td_thr_get_info,td_thr_get_info@GLIBC_2.2.5");
2700 __asm__(".symver td_thr_getfpregs,td_thr_getfpregs@GLIBC_2.2.5");
2701 __asm__(".symver td_thr_getgregs,td_thr_getgregs@GLIBC_2.2.5");
2702 __asm__(".symver td_thr_getxregs,td_thr_getxregs@GLIBC_2.2.5");
2703 __asm__(".symver td_thr_getxregsize,td_thr_getxregsize@GLIBC_2.2.5");
2704 __asm__(".symver td_thr_set_event,td_thr_set_event@GLIBC_2.2.5");
2705 __asm__(".symver td_thr_setfpregs,td_thr_setfpregs@GLIBC_2.2.5");
2706 __asm__(".symver td_thr_setgregs,td_thr_setgregs@GLIBC_2.2.5");
2707 __asm__(".symver td_thr_setprio,td_thr_setprio@GLIBC_2.2.5");
2708 __asm__(".symver td_thr_setsigpending,td_thr_setsigpending@GLIBC_2.2.5");
2709 __asm__(".symver td_thr_setxregs,td_thr_setxregs@GLIBC_2.2.5");
2710 __asm__(".symver td_thr_sigsetmask,td_thr_sigsetmask@GLIBC_2.2.5");
2711 __asm__(".symver td_thr_tls_get_addr,td_thr_tls_get_addr@GLIBC_2.3");
2712 __asm__(".symver td_thr_tlsbase,td_thr_tlsbase@GLIBC_2.3.3");
2713 __asm__(".symver td_thr_tsd,td_thr_tsd@GLIBC_2.2.5");
2714 __asm__(".symver td_thr_validate,td_thr_validate@GLIBC_2.2.5");
2715 __asm__(".symver tdelete,tdelete@GLIBC_2.2.5");
2716 __asm__(".symver tdestroy,tdestroy@GLIBC_2.2.5");
2717 __asm__(".symver tee,tee@GLIBC_2.5");
2718 __asm__(".symver telldir,telldir@GLIBC_2.2.5");
2719 __asm__(".symver tempnam,tempnam@GLIBC_2.2.5");
2720 __asm__(".symver textdomain,textdomain@GLIBC_2.2.5");
2721 __asm__(".symver tfind,tfind@GLIBC_2.2.5");
2722 __asm__(".symver tgamma,tgamma@GLIBC_2.2.5");
2723 __asm__(".symver tgammaf,tgammaf@GLIBC_2.2.5");
2724 __asm__(".symver tgammal,tgammal@GLIBC_2.2.5");
2725 __asm__(".symver time,time@GLIBC_2.2.5");
2726 __asm__(".symver timegm,timegm@GLIBC_2.2.5");
2727 __asm__(".symver timelocal,timelocal@GLIBC_2.2.5");
2728 __asm__(".symver timer_create,timer_create@GLIBC_2.3.3");
2729 __asm__(".symver timer_delete,timer_delete@GLIBC_2.3.3");
2730 __asm__(".symver timer_getoverrun,timer_getoverrun@GLIBC_2.3.3");
2731 __asm__(".symver timer_gettime,timer_gettime@GLIBC_2.3.3");
2732 __asm__(".symver timer_settime,timer_settime@GLIBC_2.3.3");
2733 __asm__(".symver timerfd_create,timerfd_create@GLIBC_2.8");
2734 __asm__(".symver timerfd_gettime,timerfd_gettime@GLIBC_2.8");
2735 __asm__(".symver timerfd_settime,timerfd_settime@GLIBC_2.8");
2736 __asm__(".symver times,times@GLIBC_2.2.5");
2737 __asm__(".symver timespec_get,timespec_get@GLIBC_2.16");
2738 __asm__(".symver timezone,timezone@GLIBC_2.2.5");
2739 __asm__(".symver tmpfile,tmpfile@GLIBC_2.2.5");
2740 __asm__(".symver tmpfile64,tmpfile64@GLIBC_2.2.5");
2741 __asm__(".symver tmpnam,tmpnam@GLIBC_2.2.5");
2742 __asm__(".symver tmpnam_r,tmpnam_r@GLIBC_2.2.5");
2743 __asm__(".symver toascii,toascii@GLIBC_2.2.5");
2744 __asm__(".symver tolower,tolower@GLIBC_2.2.5");
2745 __asm__(".symver tolower_l,tolower_l@GLIBC_2.3");
2746 __asm__(".symver totalorder,totalorder@GLIBC_2.25");
2747 __asm__(".symver totalorderf,totalorderf@GLIBC_2.25");
2748 __asm__(".symver totalorderl,totalorderl@GLIBC_2.25");
2749 __asm__(".symver totalordermag,totalordermag@GLIBC_2.25");
2750 __asm__(".symver totalordermagf,totalordermagf@GLIBC_2.25");
2751 __asm__(".symver totalordermagl,totalordermagl@GLIBC_2.25");
2752 __asm__(".symver toupper,toupper@GLIBC_2.2.5");
2753 __asm__(".symver toupper_l,toupper_l@GLIBC_2.3");
2754 __asm__(".symver towctrans,towctrans@GLIBC_2.2.5");
2755 __asm__(".symver towctrans_l,towctrans_l@GLIBC_2.3");
2756 __asm__(".symver towlower,towlower@GLIBC_2.2.5");
2757 __asm__(".symver towlower_l,towlower_l@GLIBC_2.3");
2758 __asm__(".symver towupper,towupper@GLIBC_2.2.5");
2759 __asm__(".symver towupper_l,towupper_l@GLIBC_2.3");
2760 __asm__(".symver tr_break,tr_break@GLIBC_2.2.5");
2761 __asm__(".symver trunc,trunc@GLIBC_2.2.5");
2762 __asm__(".symver truncate,truncate@GLIBC_2.2.5");
2763 __asm__(".symver truncate64,truncate64@GLIBC_2.2.5");
2764 __asm__(".symver truncf,truncf@GLIBC_2.2.5");
2765 __asm__(".symver truncl,truncl@GLIBC_2.2.5");
2766 __asm__(".symver tsearch,tsearch@GLIBC_2.2.5");
2767 __asm__(".symver ttyname,ttyname@GLIBC_2.2.5");
2768 __asm__(".symver ttyname_r,ttyname_r@GLIBC_2.2.5");
2769 __asm__(".symver ttyslot,ttyslot@GLIBC_2.2.5");
2770 __asm__(".symver twalk,twalk@GLIBC_2.2.5");
2771 __asm__(".symver tzname,tzname@GLIBC_2.2.5");
2772 __asm__(".symver tzset,tzset@GLIBC_2.2.5");
2773 __asm__(".symver ualarm,ualarm@GLIBC_2.2.5");
2774 __asm__(".symver ufromfp,ufromfp@GLIBC_2.25");
2775 __asm__(".symver ufromfpf,ufromfpf@GLIBC_2.25");
2776 __asm__(".symver ufromfpl,ufromfpl@GLIBC_2.25");
2777 __asm__(".symver ufromfpx,ufromfpx@GLIBC_2.25");
2778 __asm__(".symver ufromfpxf,ufromfpxf@GLIBC_2.25");
2779 __asm__(".symver ufromfpxl,ufromfpxl@GLIBC_2.25");
2780 __asm__(".symver ulckpwdf,ulckpwdf@GLIBC_2.2.5");
2781 __asm__(".symver ulimit,ulimit@GLIBC_2.2.5");
2782 __asm__(".symver umask,umask@GLIBC_2.2.5");
2783 __asm__(".symver umount,umount@GLIBC_2.2.5");
2784 __asm__(".symver umount2,umount2@GLIBC_2.2.5");
2785 __asm__(".symver uname,uname@GLIBC_2.2.5");
2786 __asm__(".symver ungetc,ungetc@GLIBC_2.2.5");
2787 __asm__(".symver ungetwc,ungetwc@GLIBC_2.2.5");
2788 __asm__(".symver unlink,unlink@GLIBC_2.2.5");
2789 __asm__(".symver unlinkat,unlinkat@GLIBC_2.4");
2790 __asm__(".symver unlockpt,unlockpt@GLIBC_2.2.5");
2791 __asm__(".symver unsetenv,unsetenv@GLIBC_2.2.5");
2792 __asm__(".symver unshare,unshare@GLIBC_2.4");
2793 __asm__(".symver updwtmp,updwtmp@GLIBC_2.2.5");
2794 __asm__(".symver updwtmpx,updwtmpx@GLIBC_2.2.5");
2795 __asm__(".symver uselocale,uselocale@GLIBC_2.3");
2796 __asm__(".symver usleep,usleep@GLIBC_2.2.5");
2797 __asm__(".symver ustat,ustat@GLIBC_2.2.5");
2798 __asm__(".symver utime,utime@GLIBC_2.2.5");
2799 __asm__(".symver utimensat,utimensat@GLIBC_2.6");
2800 __asm__(".symver utimes,utimes@GLIBC_2.2.5");
2801 __asm__(".symver utmpname,utmpname@GLIBC_2.2.5");
2802 __asm__(".symver utmpxname,utmpxname@GLIBC_2.2.5");
2803 __asm__(".symver valloc,valloc@GLIBC_2.2.5");
2804 __asm__(".symver vasprintf,vasprintf@GLIBC_2.2.5");
2805 __asm__(".symver vdprintf,vdprintf@GLIBC_2.2.5");
2806 __asm__(".symver verr,verr@GLIBC_2.2.5");
2807 __asm__(".symver verrx,verrx@GLIBC_2.2.5");
2808 __asm__(".symver versionsort,versionsort@GLIBC_2.2.5");
2809 __asm__(".symver versionsort64,versionsort64@GLIBC_2.2.5");
2810 __asm__(".symver vfork,vfork@GLIBC_2.2.5");
2811 __asm__(".symver vfprintf,vfprintf@GLIBC_2.2.5");
2812 __asm__(".symver vfscanf,vfscanf@GLIBC_2.2.5");
2813 __asm__(".symver vfwprintf,vfwprintf@GLIBC_2.2.5");
2814 __asm__(".symver vfwscanf,vfwscanf@GLIBC_2.2.5");
2815 __asm__(".symver vhangup,vhangup@GLIBC_2.2.5");
2816 __asm__(".symver vlimit,vlimit@GLIBC_2.2.5");
2817 __asm__(".symver vmsplice,vmsplice@GLIBC_2.5");
2818 __asm__(".symver vprintf,vprintf@GLIBC_2.2.5");
2819 __asm__(".symver vscanf,vscanf@GLIBC_2.2.5");
2820 __asm__(".symver vsnprintf,vsnprintf@GLIBC_2.2.5");
2821 __asm__(".symver vsprintf,vsprintf@GLIBC_2.2.5");
2822 __asm__(".symver vsscanf,vsscanf@GLIBC_2.2.5");
2823 __asm__(".symver vswprintf,vswprintf@GLIBC_2.2.5");
2824 __asm__(".symver vswscanf,vswscanf@GLIBC_2.2.5");
2825 __asm__(".symver vsyslog,vsyslog@GLIBC_2.2.5");
2826 __asm__(".symver vtimes,vtimes@GLIBC_2.2.5");
2827 __asm__(".symver vwarn,vwarn@GLIBC_2.2.5");
2828 __asm__(".symver vwarnx,vwarnx@GLIBC_2.2.5");
2829 __asm__(".symver vwprintf,vwprintf@GLIBC_2.2.5");
2830 __asm__(".symver vwscanf,vwscanf@GLIBC_2.2.5");
2831 __asm__(".symver wait,wait@GLIBC_2.2.5");
2832 __asm__(".symver wait3,wait3@GLIBC_2.2.5");
2833 __asm__(".symver wait4,wait4@GLIBC_2.2.5");
2834 __asm__(".symver waitid,waitid@GLIBC_2.2.5");
2835 __asm__(".symver waitpid,waitpid@GLIBC_2.2.5");
2836 __asm__(".symver warn,warn@GLIBC_2.2.5");
2837 __asm__(".symver warnx,warnx@GLIBC_2.2.5");
2838 __asm__(".symver wcpcpy,wcpcpy@GLIBC_2.2.5");
2839 __asm__(".symver wcpncpy,wcpncpy@GLIBC_2.2.5");
2840 __asm__(".symver wcrtomb,wcrtomb@GLIBC_2.2.5");
2841 __asm__(".symver wcscasecmp,wcscasecmp@GLIBC_2.2.5");
2842 __asm__(".symver wcscasecmp_l,wcscasecmp_l@GLIBC_2.3");
2843 __asm__(".symver wcscat,wcscat@GLIBC_2.2.5");
2844 __asm__(".symver wcschr,wcschr@GLIBC_2.2.5");
2845 __asm__(".symver wcschrnul,wcschrnul@GLIBC_2.2.5");
2846 __asm__(".symver wcscmp,wcscmp@GLIBC_2.2.5");
2847 __asm__(".symver wcscoll,wcscoll@GLIBC_2.2.5");
2848 __asm__(".symver wcscoll_l,wcscoll_l@GLIBC_2.3");
2849 __asm__(".symver wcscpy,wcscpy@GLIBC_2.2.5");
2850 __asm__(".symver wcscspn,wcscspn@GLIBC_2.2.5");
2851 __asm__(".symver wcsdup,wcsdup@GLIBC_2.2.5");
2852 __asm__(".symver wcsftime,wcsftime@GLIBC_2.2.5");
2853 __asm__(".symver wcsftime_l,wcsftime_l@GLIBC_2.3");
2854 __asm__(".symver wcslen,wcslen@GLIBC_2.2.5");
2855 __asm__(".symver wcsncasecmp,wcsncasecmp@GLIBC_2.2.5");
2856 __asm__(".symver wcsncasecmp_l,wcsncasecmp_l@GLIBC_2.3");
2857 __asm__(".symver wcsncat,wcsncat@GLIBC_2.2.5");
2858 __asm__(".symver wcsncmp,wcsncmp@GLIBC_2.2.5");
2859 __asm__(".symver wcsncpy,wcsncpy@GLIBC_2.2.5");
2860 __asm__(".symver wcsnlen,wcsnlen@GLIBC_2.2.5");
2861 __asm__(".symver wcsnrtombs,wcsnrtombs@GLIBC_2.2.5");
2862 __asm__(".symver wcspbrk,wcspbrk@GLIBC_2.2.5");
2863 __asm__(".symver wcsrchr,wcsrchr@GLIBC_2.2.5");
2864 __asm__(".symver wcsrtombs,wcsrtombs@GLIBC_2.2.5");
2865 __asm__(".symver wcsspn,wcsspn@GLIBC_2.2.5");
2866 __asm__(".symver wcsstr,wcsstr@GLIBC_2.2.5");
2867 __asm__(".symver wcstod,wcstod@GLIBC_2.2.5");
2868 __asm__(".symver wcstod_l,wcstod_l@GLIBC_2.3");
2869 __asm__(".symver wcstof,wcstof@GLIBC_2.2.5");
2870 __asm__(".symver wcstof_l,wcstof_l@GLIBC_2.3");
2871 __asm__(".symver wcstoimax,wcstoimax@GLIBC_2.2.5");
2872 __asm__(".symver wcstok,wcstok@GLIBC_2.2.5");
2873 __asm__(".symver wcstol,wcstol@GLIBC_2.2.5");
2874 __asm__(".symver wcstol_l,wcstol_l@GLIBC_2.3");
2875 __asm__(".symver wcstold,wcstold@GLIBC_2.2.5");
2876 __asm__(".symver wcstold_l,wcstold_l@GLIBC_2.3");
2877 __asm__(".symver wcstoll,wcstoll@GLIBC_2.2.5");
2878 __asm__(".symver wcstoll_l,wcstoll_l@GLIBC_2.3");
2879 __asm__(".symver wcstombs,wcstombs@GLIBC_2.2.5");
2880 __asm__(".symver wcstoq,wcstoq@GLIBC_2.2.5");
2881 __asm__(".symver wcstoul,wcstoul@GLIBC_2.2.5");
2882 __asm__(".symver wcstoul_l,wcstoul_l@GLIBC_2.3");
2883 __asm__(".symver wcstoull,wcstoull@GLIBC_2.2.5");
2884 __asm__(".symver wcstoull_l,wcstoull_l@GLIBC_2.3");
2885 __asm__(".symver wcstoumax,wcstoumax@GLIBC_2.2.5");
2886 __asm__(".symver wcstouq,wcstouq@GLIBC_2.2.5");
2887 __asm__(".symver wcswcs,wcswcs@GLIBC_2.2.5");
2888 __asm__(".symver wcswidth,wcswidth@GLIBC_2.2.5");
2889 __asm__(".symver wcsxfrm,wcsxfrm@GLIBC_2.2.5");
2890 __asm__(".symver wcsxfrm_l,wcsxfrm_l@GLIBC_2.3");
2891 __asm__(".symver wctob,wctob@GLIBC_2.2.5");
2892 __asm__(".symver wctomb,wctomb@GLIBC_2.2.5");
2893 __asm__(".symver wctrans,wctrans@GLIBC_2.2.5");
2894 __asm__(".symver wctrans_l,wctrans_l@GLIBC_2.3");
2895 __asm__(".symver wctype,wctype@GLIBC_2.2.5");
2896 __asm__(".symver wctype_l,wctype_l@GLIBC_2.3");
2897 __asm__(".symver wcwidth,wcwidth@GLIBC_2.2.5");
2898 __asm__(".symver wmemchr,wmemchr@GLIBC_2.2.5");
2899 __asm__(".symver wmemcmp,wmemcmp@GLIBC_2.2.5");
2900 __asm__(".symver wmemcpy,wmemcpy@GLIBC_2.2.5");
2901 __asm__(".symver wmemmove,wmemmove@GLIBC_2.2.5");
2902 __asm__(".symver wmempcpy,wmempcpy@GLIBC_2.2.5");
2903 __asm__(".symver wmemset,wmemset@GLIBC_2.2.5");
2904 __asm__(".symver wordexp,wordexp@GLIBC_2.2.5");
2905 __asm__(".symver wordfree,wordfree@GLIBC_2.2.5");
2906 __asm__(".symver wprintf,wprintf@GLIBC_2.2.5");
2907 __asm__(".symver write,write@GLIBC_2.2.5");
2908 __asm__(".symver writeColdStartFile,writeColdStartFile@GLIBC_2.2.5");
2909 __asm__(".symver writev,writev@GLIBC_2.2.5");
2910 __asm__(".symver wscanf,wscanf@GLIBC_2.2.5");
2911 __asm__(".symver xdecrypt,xdecrypt@GLIBC_2.2.5");
2912 __asm__(".symver xdr_array,xdr_array@GLIBC_2.2.5");
2913 __asm__(".symver xdr_bool,xdr_bool@GLIBC_2.2.5");
2914 __asm__(".symver xdr_bytes,xdr_bytes@GLIBC_2.2.5");
2915 __asm__(".symver xdr_cback_data,xdr_cback_data@GLIBC_2.2.5");
2916 __asm__(".symver xdr_domainname,xdr_domainname@GLIBC_2.2.5");
2917 __asm__(".symver xdr_enum,xdr_enum@GLIBC_2.2.5");
2918 __asm__(".symver xdr_free,xdr_free@GLIBC_2.2.5");
2919 __asm__(".symver xdr_int,xdr_int@GLIBC_2.2.5");
2920 __asm__(".symver xdr_keydat,xdr_keydat@GLIBC_2.2.5");
2921 __asm__(".symver xdr_mapname,xdr_mapname@GLIBC_2.2.5");
2922 __asm__(".symver xdr_netobj,xdr_netobj@GLIBC_2.2.5");
2923 __asm__(".symver xdr_obj_p,xdr_obj_p@GLIBC_2.2.5");
2924 __asm__(".symver xdr_opaque,xdr_opaque@GLIBC_2.2.5");
2925 __asm__(".symver xdr_peername,xdr_peername@GLIBC_2.2.5");
2926 __asm__(".symver xdr_pointer,xdr_pointer@GLIBC_2.2.5");
2927 __asm__(".symver xdr_sizeof,xdr_sizeof@GLIBC_2.2.5");
2928 __asm__(".symver xdr_string,xdr_string@GLIBC_2.2.5");
2929 __asm__(".symver xdr_u_char,xdr_u_char@GLIBC_2.2.5");
2930 __asm__(".symver xdr_u_int,xdr_u_int@GLIBC_2.2.5");
2931 __asm__(".symver xdr_uint32_t,xdr_uint32_t@GLIBC_2.2.5");
2932 __asm__(".symver xdr_valdat,xdr_valdat@GLIBC_2.2.5");
2933 __asm__(".symver xdr_void,xdr_void@GLIBC_2.2.5");
2934 __asm__(".symver xdr_yp_buf,xdr_yp_buf@GLIBC_2.2.5");
2935 __asm__(".symver xdr_ypall,xdr_ypall@GLIBC_2.2.5");
2936 __asm__(".symver xdr_ypbind_binding,xdr_ypbind_binding@GLIBC_2.2.5");
2937 __asm__(".symver xdr_ypbind_resp,xdr_ypbind_resp@GLIBC_2.2.5");
2938 __asm__(".symver xdr_ypbind_resptype,xdr_ypbind_resptype@GLIBC_2.2.5");
2939 __asm__(".symver xdr_ypbind_setdom,xdr_ypbind_setdom@GLIBC_2.2.5");
2940 __asm__(".symver xdr_ypdelete_args,xdr_ypdelete_args@GLIBC_2.2.5");
2941 __asm__(".symver xdr_ypmap_parms,xdr_ypmap_parms@GLIBC_2.2.5");
2942 __asm__(".symver xdr_ypmaplist,xdr_ypmaplist@GLIBC_2.2.5");
2943 __asm__(".symver xdr_yppush_status,xdr_yppush_status@GLIBC_2.2.5");
2944 __asm__(".symver xdr_yppushresp_xfr,xdr_yppushresp_xfr@GLIBC_2.2.5");
2945 __asm__(".symver xdr_ypreq_key,xdr_ypreq_key@GLIBC_2.2.5");
2946 __asm__(".symver xdr_ypreq_nokey,xdr_ypreq_nokey@GLIBC_2.2.5");
2947 __asm__(".symver xdr_ypreq_xfr,xdr_ypreq_xfr@GLIBC_2.2.5");
2948 __asm__(".symver xdr_ypresp_all,xdr_ypresp_all@GLIBC_2.2.5");
2949 __asm__(".symver xdr_ypresp_key_val,xdr_ypresp_key_val@GLIBC_2.2.5");
2950 __asm__(".symver xdr_ypresp_maplist,xdr_ypresp_maplist@GLIBC_2.2.5");
2951 __asm__(".symver xdr_ypresp_master,xdr_ypresp_master@GLIBC_2.2.5");
2952 __asm__(".symver xdr_ypresp_order,xdr_ypresp_order@GLIBC_2.2.5");
2953 __asm__(".symver xdr_ypresp_val,xdr_ypresp_val@GLIBC_2.2.5");
2954 __asm__(".symver xdr_ypresp_xfr,xdr_ypresp_xfr@GLIBC_2.2.5");
2955 __asm__(".symver xdr_ypstat,xdr_ypstat@GLIBC_2.2.5");
2956 __asm__(".symver xdr_ypupdate_args,xdr_ypupdate_args@GLIBC_2.2.5");
2957 __asm__(".symver xdr_ypxfrstat,xdr_ypxfrstat@GLIBC_2.2.5");
2958 __asm__(".symver xdrmem_create,xdrmem_create@GLIBC_2.2.5");
2959 __asm__(".symver xdrstdio_create,xdrstdio_create@GLIBC_2.2.5");
2960 __asm__(".symver xprt_unregister,xprt_unregister@GLIBC_2.2.5");
2961 __asm__(".symver y0,y0@GLIBC_2.2.5");
2962 __asm__(".symver y0f,y0f@GLIBC_2.2.5");
2963 __asm__(".symver y0l,y0l@GLIBC_2.2.5");
2964 __asm__(".symver y1,y1@GLIBC_2.2.5");
2965 __asm__(".symver y1f,y1f@GLIBC_2.2.5");
2966 __asm__(".symver y1l,y1l@GLIBC_2.2.5");
2967 __asm__(".symver yn,yn@GLIBC_2.2.5");
2968 __asm__(".symver ynf,ynf@GLIBC_2.2.5");
2969 __asm__(".symver ynl,ynl@GLIBC_2.2.5");
2970 __asm__(".symver yp_all,yp_all@GLIBC_2.2.5");
2971 __asm__(".symver yp_bind,yp_bind@GLIBC_2.2.5");
2972 __asm__(".symver yp_first,yp_first@GLIBC_2.2.5");
2973 __asm__(".symver yp_get_default_domain,yp_get_default_domain@GLIBC_2.2.5");
2974 __asm__(".symver yp_maplist,yp_maplist@GLIBC_2.2.5");
2975 __asm__(".symver yp_master,yp_master@GLIBC_2.2.5");
2976 __asm__(".symver yp_match,yp_match@GLIBC_2.2.5");
2977 __asm__(".symver yp_next,yp_next@GLIBC_2.2.5");
2978 __asm__(".symver yp_order,yp_order@GLIBC_2.2.5");
2979 __asm__(".symver yp_unbind,yp_unbind@GLIBC_2.2.5");
2980 __asm__(".symver yp_update,yp_update@GLIBC_2.2.5");
2981 __asm__(".symver ypbinderr_string,ypbinderr_string@GLIBC_2.2.5");
2982 __asm__(".symver yperr_string,yperr_string@GLIBC_2.2.5");
2983 __asm__(".symver ypprot_err,ypprot_err@GLIBC_2.2.5");
2984 __asm__(".symver __acosf128_finite,__acosf128_finite@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
2985 __asm__(".symver __acoshf128_finite,__acoshf128_finite@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
2986 __asm__(".symver __asinf128_finite,__asinf128_finite@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
2987 __asm__(".symver __atan2f128_finite,__atan2f128_finite@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
2988 __asm__(".symver __atanhf128_finite,__atanhf128_finite@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
2989 __asm__(".symver __coshf128_finite,__coshf128_finite@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
2990 __asm__(".symver __exp10f128_finite,__exp10f128_finite@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
2991 __asm__(".symver __exp2f128_finite,__exp2f128_finite@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
2992 __asm__(".symver __expf128_finite,__expf128_finite@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
2993 __asm__(".symver __finitef128,__finitef128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
2994 __asm__(".symver __fmodf128_finite,__fmodf128_finite@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
2995 __asm__(".symver __fpclassifyf128,__fpclassifyf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
2996 __asm__(".symver __gammaf128_r_finite,__gammaf128_r_finite@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
2997 __asm__(".symver __hypotf128_finite,__hypotf128_finite@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
2998 __asm__(".symver __iseqsigf128,__iseqsigf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
2999 __asm__(".symver __isinff128,__isinff128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3000 __asm__(".symver __isnanf128,__isnanf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3001 __asm__(".symver __issignalingf128,__issignalingf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3002 __asm__(".symver __j0f128_finite,__j0f128_finite@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3003 __asm__(".symver __j1f128_finite,__j1f128_finite@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3004 __asm__(".symver __jnf128_finite,__jnf128_finite@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3005 __asm__(".symver __lgammaf128_r_finite,__lgammaf128_r_finite@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3006 __asm__(".symver __log10f128_finite,__log10f128_finite@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3007 __asm__(".symver __log2f128_finite,__log2f128_finite@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3008 __asm__(".symver __logf128_finite,__logf128_finite@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3009 __asm__(".symver __malloc_initialize_hook,__malloc_initialize_hook@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3010 __asm__(".symver __mempcpy_small,__mempcpy_small@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3011 __asm__(".symver __powf128_finite,__powf128_finite@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3012 __asm__(".symver __remainderf128_finite,__remainderf128_finite@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3013 __asm__(".symver __rpc_thread_createerr,__rpc_thread_createerr@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3014 __asm__(".symver __rpc_thread_svc_fdset,__rpc_thread_svc_fdset@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3015 __asm__(".symver __secure_getenv,__secure_getenv@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3016 __asm__(".symver __signbitf128,__signbitf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3017 __asm__(".symver __sinhf128_finite,__sinhf128_finite@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3018 __asm__(".symver __sqrtf128_finite,__sqrtf128_finite@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3019 __asm__(".symver __stpcpy_small,__stpcpy_small@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3020 __asm__(".symver __strcpy_small,__strcpy_small@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3021 __asm__(".symver __strcspn_c1,__strcspn_c1@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3022 __asm__(".symver __strcspn_c2,__strcspn_c2@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3023 __asm__(".symver __strcspn_c3,__strcspn_c3@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3024 __asm__(".symver __strpbrk_c2,__strpbrk_c2@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3025 __asm__(".symver __strpbrk_c3,__strpbrk_c3@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3026 __asm__(".symver __strsep_1c,__strsep_1c@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3027 __asm__(".symver __strsep_2c,__strsep_2c@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3028 __asm__(".symver __strsep_3c,__strsep_3c@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3029 __asm__(".symver __strspn_c1,__strspn_c1@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3030 __asm__(".symver __strspn_c2,__strspn_c2@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3031 __asm__(".symver __strspn_c3,__strspn_c3@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3032 __asm__(".symver __strtof128_internal,__strtof128_internal@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3033 __asm__(".symver __strtok_r_1c,__strtok_r_1c@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3034 __asm__(".symver __wcstof128_internal,__wcstof128_internal@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3035 __asm__(".symver __y0f128_finite,__y0f128_finite@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3036 __asm__(".symver __y1f128_finite,__y1f128_finite@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3037 __asm__(".symver __ynf128_finite,__ynf128_finite@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3038 __asm__(".symver _authenticate,_authenticate@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3039 __asm__(".symver _gethtbyaddr,_gethtbyaddr@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3040 __asm__(".symver _gethtbyname,_gethtbyname@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3041 __asm__(".symver _gethtbyname2,_gethtbyname2@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3042 __asm__(".symver _gethtent,_gethtent@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3043 __asm__(".symver _null_auth,_null_auth@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3044 __asm__(".symver _rpc_dtablesize,_rpc_dtablesize@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3045 __asm__(".symver _seterr_reply,_seterr_reply@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3046 __asm__(".symver _sethtent,_sethtent@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3047 __asm__(".symver acosf128,acosf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3048 __asm__(".symver acosf32,acosf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3049 __asm__(".symver acosf32x,acosf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3050 __asm__(".symver acosf64,acosf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3051 __asm__(".symver acosf64x,acosf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3052 __asm__(".symver acoshf128,acoshf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3053 __asm__(".symver acoshf32,acoshf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3054 __asm__(".symver acoshf32x,acoshf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3055 __asm__(".symver acoshf64,acoshf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3056 __asm__(".symver acoshf64x,acoshf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3057 __asm__(".symver advance,advance@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3058 __asm__(".symver asinf128,asinf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3059 __asm__(".symver asinf32,asinf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3060 __asm__(".symver asinf32x,asinf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3061 __asm__(".symver asinf64,asinf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3062 __asm__(".symver asinf64x,asinf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3063 __asm__(".symver asinhf128,asinhf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3064 __asm__(".symver asinhf32,asinhf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3065 __asm__(".symver asinhf32x,asinhf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3066 __asm__(".symver asinhf64,asinhf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3067 __asm__(".symver asinhf64x,asinhf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3068 __asm__(".symver atan2f128,atan2f128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3069 __asm__(".symver atan2f32,atan2f32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3070 __asm__(".symver atan2f32x,atan2f32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3071 __asm__(".symver atan2f64,atan2f64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3072 __asm__(".symver atan2f64x,atan2f64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3073 __asm__(".symver atanf128,atanf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3074 __asm__(".symver atanf32,atanf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3075 __asm__(".symver atanf32x,atanf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3076 __asm__(".symver atanf64,atanf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3077 __asm__(".symver atanf64x,atanf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3078 __asm__(".symver atanhf128,atanhf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3079 __asm__(".symver atanhf32,atanhf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3080 __asm__(".symver atanhf32x,atanhf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3081 __asm__(".symver atanhf64,atanhf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3082 __asm__(".symver atanhf64x,atanhf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3083 __asm__(".symver authdes_getucred,authdes_getucred@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3084 __asm__(".symver authnone_create,authnone_create@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3085 __asm__(".symver authunix_create,authunix_create@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3086 __asm__(".symver bdflush,bdflush@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3087 __asm__(".symver cabsf128,cabsf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3088 __asm__(".symver cabsf32,cabsf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3089 __asm__(".symver cabsf32x,cabsf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3090 __asm__(".symver cabsf64,cabsf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3091 __asm__(".symver cabsf64x,cabsf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3092 __asm__(".symver cacosf128,cacosf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3093 __asm__(".symver cacosf32,cacosf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3094 __asm__(".symver cacosf32x,cacosf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3095 __asm__(".symver cacosf64,cacosf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3096 __asm__(".symver cacosf64x,cacosf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3097 __asm__(".symver cacoshf128,cacoshf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3098 __asm__(".symver cacoshf32,cacoshf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3099 __asm__(".symver cacoshf32x,cacoshf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3100 __asm__(".symver cacoshf64,cacoshf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3101 __asm__(".symver cacoshf64x,cacoshf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3102 __asm__(".symver callrpc,callrpc@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3103 __asm__(".symver canonicalizef128,canonicalizef128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3104 __asm__(".symver canonicalizef32,canonicalizef32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3105 __asm__(".symver canonicalizef32x,canonicalizef32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3106 __asm__(".symver canonicalizef64,canonicalizef64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3107 __asm__(".symver canonicalizef64x,canonicalizef64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3108 __asm__(".symver cargf128,cargf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3109 __asm__(".symver cargf32,cargf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3110 __asm__(".symver cargf32x,cargf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3111 __asm__(".symver cargf64,cargf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3112 __asm__(".symver cargf64x,cargf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3113 __asm__(".symver casinf128,casinf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3114 __asm__(".symver casinf32,casinf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3115 __asm__(".symver casinf32x,casinf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3116 __asm__(".symver casinf64,casinf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3117 __asm__(".symver casinf64x,casinf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3118 __asm__(".symver casinhf128,casinhf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3119 __asm__(".symver casinhf32,casinhf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3120 __asm__(".symver casinhf32x,casinhf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3121 __asm__(".symver casinhf64,casinhf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3122 __asm__(".symver casinhf64x,casinhf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3123 __asm__(".symver catanf128,catanf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3124 __asm__(".symver catanf32,catanf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3125 __asm__(".symver catanf32x,catanf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3126 __asm__(".symver catanf64,catanf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3127 __asm__(".symver catanf64x,catanf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3128 __asm__(".symver catanhf128,catanhf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3129 __asm__(".symver catanhf32,catanhf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3130 __asm__(".symver catanhf32x,catanhf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3131 __asm__(".symver catanhf64,catanhf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3132 __asm__(".symver catanhf64x,catanhf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3133 __asm__(".symver cbc_crypt,cbc_crypt@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3134 __asm__(".symver cbrtf128,cbrtf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3135 __asm__(".symver cbrtf32,cbrtf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3136 __asm__(".symver cbrtf32x,cbrtf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3137 __asm__(".symver cbrtf64,cbrtf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3138 __asm__(".symver cbrtf64x,cbrtf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3139 __asm__(".symver ccosf128,ccosf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3140 __asm__(".symver ccosf32,ccosf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3141 __asm__(".symver ccosf32x,ccosf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3142 __asm__(".symver ccosf64,ccosf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3143 __asm__(".symver ccosf64x,ccosf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3144 __asm__(".symver ccoshf128,ccoshf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3145 __asm__(".symver ccoshf32,ccoshf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3146 __asm__(".symver ccoshf32x,ccoshf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3147 __asm__(".symver ccoshf64,ccoshf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3148 __asm__(".symver ccoshf64x,ccoshf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3149 __asm__(".symver ceilf128,ceilf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3150 __asm__(".symver ceilf32,ceilf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3151 __asm__(".symver ceilf32x,ceilf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3152 __asm__(".symver ceilf64,ceilf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3153 __asm__(".symver ceilf64x,ceilf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3154 __asm__(".symver cexpf128,cexpf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3155 __asm__(".symver cexpf32,cexpf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3156 __asm__(".symver cexpf32x,cexpf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3157 __asm__(".symver cexpf64,cexpf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3158 __asm__(".symver cexpf64x,cexpf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3159 __asm__(".symver cimagf128,cimagf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3160 __asm__(".symver cimagf32,cimagf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3161 __asm__(".symver cimagf32x,cimagf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3162 __asm__(".symver cimagf64,cimagf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3163 __asm__(".symver cimagf64x,cimagf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3164 __asm__(".symver clnt_broadcast,clnt_broadcast@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3165 __asm__(".symver clnt_perrno,clnt_perrno@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3166 __asm__(".symver clnt_spcreateerror,clnt_spcreateerror@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3167 __asm__(".symver clnt_sperror,clnt_sperror@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3168 __asm__(".symver clntraw_create,clntraw_create@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3169 __asm__(".symver clntudp_bufcreate,clntudp_bufcreate@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3170 __asm__(".symver clntunix_create,clntunix_create@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3171 __asm__(".symver clog10f128,clog10f128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3172 __asm__(".symver clog10f32,clog10f32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3173 __asm__(".symver clog10f32x,clog10f32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3174 __asm__(".symver clog10f64,clog10f64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3175 __asm__(".symver clog10f64x,clog10f64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3176 __asm__(".symver clogf128,clogf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3177 __asm__(".symver clogf32,clogf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3178 __asm__(".symver clogf32x,clogf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3179 __asm__(".symver clogf64,clogf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3180 __asm__(".symver clogf64x,clogf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3181 __asm__(".symver conjf128,conjf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3182 __asm__(".symver conjf32,conjf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3183 __asm__(".symver conjf32x,conjf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3184 __asm__(".symver conjf64,conjf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3185 __asm__(".symver conjf64x,conjf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3186 __asm__(".symver copy_file_range,copy_file_range@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3187 __asm__(".symver copysignf128,copysignf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3188 __asm__(".symver copysignf32,copysignf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3189 __asm__(".symver copysignf32x,copysignf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3190 __asm__(".symver copysignf64,copysignf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3191 __asm__(".symver copysignf64x,copysignf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3192 __asm__(".symver cosf128,cosf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3193 __asm__(".symver cosf32,cosf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3194 __asm__(".symver cosf32x,cosf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3195 __asm__(".symver cosf64,cosf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3196 __asm__(".symver cosf64x,cosf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3197 __asm__(".symver coshf128,coshf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3198 __asm__(".symver coshf32,coshf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3199 __asm__(".symver coshf32x,coshf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3200 __asm__(".symver coshf64,coshf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3201 __asm__(".symver coshf64x,coshf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3202 __asm__(".symver cpowf128,cpowf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3203 __asm__(".symver cpowf32,cpowf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3204 __asm__(".symver cpowf32x,cpowf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3205 __asm__(".symver cpowf64,cpowf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3206 __asm__(".symver cpowf64x,cpowf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3207 __asm__(".symver cprojf128,cprojf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3208 __asm__(".symver cprojf32,cprojf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3209 __asm__(".symver cprojf32x,cprojf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3210 __asm__(".symver cprojf64,cprojf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3211 __asm__(".symver cprojf64x,cprojf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3212 __asm__(".symver crealf128,crealf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3213 __asm__(".symver crealf32,crealf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3214 __asm__(".symver crealf32x,crealf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3215 __asm__(".symver crealf64,crealf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3216 __asm__(".symver crealf64x,crealf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3217 __asm__(".symver create_module,create_module@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3218 __asm__(".symver csinf128,csinf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3219 __asm__(".symver csinf32,csinf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3220 __asm__(".symver csinf32x,csinf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3221 __asm__(".symver csinf64,csinf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3222 __asm__(".symver csinf64x,csinf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3223 __asm__(".symver csinhf128,csinhf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3224 __asm__(".symver csinhf32,csinhf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3225 __asm__(".symver csinhf32x,csinhf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3226 __asm__(".symver csinhf64,csinhf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3227 __asm__(".symver csinhf64x,csinhf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3228 __asm__(".symver csqrtf128,csqrtf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3229 __asm__(".symver csqrtf32,csqrtf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3230 __asm__(".symver csqrtf32x,csqrtf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3231 __asm__(".symver csqrtf64,csqrtf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3232 __asm__(".symver csqrtf64x,csqrtf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3233 __asm__(".symver ctanf128,ctanf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3234 __asm__(".symver ctanf32,ctanf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3235 __asm__(".symver ctanf32x,ctanf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3236 __asm__(".symver ctanf64,ctanf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3237 __asm__(".symver ctanf64x,ctanf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3238 __asm__(".symver ctanhf128,ctanhf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3239 __asm__(".symver ctanhf32,ctanhf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3240 __asm__(".symver ctanhf32x,ctanhf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3241 __asm__(".symver ctanhf64,ctanhf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3242 __asm__(".symver ctanhf64x,ctanhf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3243 __asm__(".symver des_setparity,des_setparity@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3244 __asm__(".symver ecb_crypt,ecb_crypt@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3245 __asm__(".symver erfcf128,erfcf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3246 __asm__(".symver erfcf32,erfcf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3247 __asm__(".symver erfcf32x,erfcf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3248 __asm__(".symver erfcf64,erfcf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3249 __asm__(".symver erfcf64x,erfcf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3250 __asm__(".symver erff128,erff128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3251 __asm__(".symver erff32,erff32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3252 __asm__(".symver erff32x,erff32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3253 __asm__(".symver erff64,erff64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3254 __asm__(".symver erff64x,erff64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3255 __asm__(".symver exp10f128,exp10f128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3256 __asm__(".symver exp10f32,exp10f32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3257 __asm__(".symver exp10f32x,exp10f32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3258 __asm__(".symver exp10f64,exp10f64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3259 __asm__(".symver exp10f64x,exp10f64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3260 __asm__(".symver exp2f128,exp2f128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3261 __asm__(".symver exp2f32,exp2f32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3262 __asm__(".symver exp2f32x,exp2f32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3263 __asm__(".symver exp2f64,exp2f64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3264 __asm__(".symver exp2f64x,exp2f64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3265 __asm__(".symver expf128,expf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3266 __asm__(".symver expf32,expf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3267 __asm__(".symver expf32x,expf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3268 __asm__(".symver expf64,expf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3269 __asm__(".symver expf64x,expf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3270 __asm__(".symver expm1f128,expm1f128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3271 __asm__(".symver expm1f32,expm1f32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3272 __asm__(".symver expm1f32x,expm1f32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3273 __asm__(".symver expm1f64,expm1f64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3274 __asm__(".symver expm1f64x,expm1f64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3275 __asm__(".symver fabsf128,fabsf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3276 __asm__(".symver fabsf32,fabsf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3277 __asm__(".symver fabsf32x,fabsf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3278 __asm__(".symver fabsf64,fabsf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3279 __asm__(".symver fabsf64x,fabsf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3280 __asm__(".symver fdimf128,fdimf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3281 __asm__(".symver fdimf32,fdimf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3282 __asm__(".symver fdimf32x,fdimf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3283 __asm__(".symver fdimf64,fdimf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3284 __asm__(".symver fdimf64x,fdimf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3285 __asm__(".symver floorf128,floorf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3286 __asm__(".symver floorf32,floorf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3287 __asm__(".symver floorf32x,floorf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3288 __asm__(".symver floorf64,floorf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3289 __asm__(".symver floorf64x,floorf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3290 __asm__(".symver fmaf128,fmaf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3291 __asm__(".symver fmaf32,fmaf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3292 __asm__(".symver fmaf32x,fmaf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3293 __asm__(".symver fmaf64,fmaf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3294 __asm__(".symver fmaf64x,fmaf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3295 __asm__(".symver fmaxf128,fmaxf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3296 __asm__(".symver fmaxf32,fmaxf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3297 __asm__(".symver fmaxf32x,fmaxf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3298 __asm__(".symver fmaxf64,fmaxf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3299 __asm__(".symver fmaxf64x,fmaxf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3300 __asm__(".symver fmaxmagf128,fmaxmagf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3301 __asm__(".symver fmaxmagf32,fmaxmagf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3302 __asm__(".symver fmaxmagf32x,fmaxmagf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3303 __asm__(".symver fmaxmagf64,fmaxmagf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3304 __asm__(".symver fmaxmagf64x,fmaxmagf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3305 __asm__(".symver fminf128,fminf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3306 __asm__(".symver fminf32,fminf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3307 __asm__(".symver fminf32x,fminf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3308 __asm__(".symver fminf64,fminf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3309 __asm__(".symver fminf64x,fminf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3310 __asm__(".symver fminmagf128,fminmagf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3311 __asm__(".symver fminmagf32,fminmagf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3312 __asm__(".symver fminmagf32x,fminmagf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3313 __asm__(".symver fminmagf64,fminmagf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3314 __asm__(".symver fminmagf64x,fminmagf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3315 __asm__(".symver fmodf128,fmodf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3316 __asm__(".symver fmodf32,fmodf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3317 __asm__(".symver fmodf32x,fmodf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3318 __asm__(".symver fmodf64,fmodf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3319 __asm__(".symver fmodf64x,fmodf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3320 __asm__(".symver frexpf128,frexpf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3321 __asm__(".symver frexpf32,frexpf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3322 __asm__(".symver frexpf32x,frexpf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3323 __asm__(".symver frexpf64,frexpf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3324 __asm__(".symver frexpf64x,frexpf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3325 __asm__(".symver fromfpf128,fromfpf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3326 __asm__(".symver fromfpf32,fromfpf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3327 __asm__(".symver fromfpf32x,fromfpf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3328 __asm__(".symver fromfpf64,fromfpf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3329 __asm__(".symver fromfpf64x,fromfpf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3330 __asm__(".symver fromfpxf128,fromfpxf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3331 __asm__(".symver fromfpxf32,fromfpxf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3332 __asm__(".symver fromfpxf32x,fromfpxf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3333 __asm__(".symver fromfpxf64,fromfpxf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3334 __asm__(".symver fromfpxf64x,fromfpxf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3335 __asm__(".symver get_kernel_syms,get_kernel_syms@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3336 __asm__(".symver getnetname,getnetname@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3337 __asm__(".symver getpayloadf128,getpayloadf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3338 __asm__(".symver getpayloadf32,getpayloadf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3339 __asm__(".symver getpayloadf32x,getpayloadf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3340 __asm__(".symver getpayloadf64,getpayloadf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3341 __asm__(".symver getpayloadf64x,getpayloadf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3342 __asm__(".symver getpublickey,getpublickey@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3343 __asm__(".symver getsecretkey,getsecretkey@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3344 __asm__(".symver hypotf128,hypotf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3345 __asm__(".symver hypotf32,hypotf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3346 __asm__(".symver hypotf32x,hypotf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3347 __asm__(".symver hypotf64,hypotf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3348 __asm__(".symver hypotf64x,hypotf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3349 __asm__(".symver ilogbf128,ilogbf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3350 __asm__(".symver ilogbf32,ilogbf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3351 __asm__(".symver ilogbf32x,ilogbf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3352 __asm__(".symver ilogbf64,ilogbf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3353 __asm__(".symver ilogbf64x,ilogbf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3354 __asm__(".symver j0f128,j0f128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3355 __asm__(".symver j0f32,j0f32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3356 __asm__(".symver j0f32x,j0f32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3357 __asm__(".symver j0f64,j0f64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3358 __asm__(".symver j0f64x,j0f64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3359 __asm__(".symver j1f128,j1f128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3360 __asm__(".symver j1f32,j1f32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3361 __asm__(".symver j1f32x,j1f32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3362 __asm__(".symver j1f64,j1f64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3363 __asm__(".symver j1f64x,j1f64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3364 __asm__(".symver jnf128,jnf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3365 __asm__(".symver jnf32,jnf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3366 __asm__(".symver jnf32x,jnf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3367 __asm__(".symver jnf64,jnf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3368 __asm__(".symver jnf64x,jnf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3369 __asm__(".symver key_decryptsession,key_decryptsession@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3370 __asm__(".symver key_decryptsession_pk,key_decryptsession_pk@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3371 __asm__(".symver key_encryptsession,key_encryptsession@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3372 __asm__(".symver key_encryptsession_pk,key_encryptsession_pk@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3373 __asm__(".symver key_get_conv,key_get_conv@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3374 __asm__(".symver key_setnet,key_setnet@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3375 __asm__(".symver key_setsecret,key_setsecret@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3376 __asm__(".symver ldexpf128,ldexpf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3377 __asm__(".symver ldexpf32,ldexpf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3378 __asm__(".symver ldexpf32x,ldexpf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3379 __asm__(".symver ldexpf64,ldexpf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3380 __asm__(".symver ldexpf64x,ldexpf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3381 __asm__(".symver lgammaf128,lgammaf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3382 __asm__(".symver lgammaf128_r,lgammaf128_r@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3383 __asm__(".symver lgammaf32,lgammaf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3384 __asm__(".symver lgammaf32_r,lgammaf32_r@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3385 __asm__(".symver lgammaf32x,lgammaf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3386 __asm__(".symver lgammaf32x_r,lgammaf32x_r@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3387 __asm__(".symver lgammaf64,lgammaf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3388 __asm__(".symver lgammaf64_r,lgammaf64_r@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3389 __asm__(".symver lgammaf64x,lgammaf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3390 __asm__(".symver lgammaf64x_r,lgammaf64x_r@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3391 __asm__(".symver llogbf128,llogbf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3392 __asm__(".symver llogbf32,llogbf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3393 __asm__(".symver llogbf32x,llogbf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3394 __asm__(".symver llogbf64,llogbf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3395 __asm__(".symver llogbf64x,llogbf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3396 __asm__(".symver llrintf128,llrintf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3397 __asm__(".symver llrintf32,llrintf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3398 __asm__(".symver llrintf32x,llrintf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3399 __asm__(".symver llrintf64,llrintf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3400 __asm__(".symver llrintf64x,llrintf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3401 __asm__(".symver llroundf128,llroundf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3402 __asm__(".symver llroundf32,llroundf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3403 __asm__(".symver llroundf32x,llroundf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3404 __asm__(".symver llroundf64,llroundf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3405 __asm__(".symver llroundf64x,llroundf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3406 __asm__(".symver loc1,loc1@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3407 __asm__(".symver loc2,loc2@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3408 __asm__(".symver locs,locs@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3409 __asm__(".symver log10f128,log10f128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3410 __asm__(".symver log10f32,log10f32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3411 __asm__(".symver log10f32x,log10f32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3412 __asm__(".symver log10f64,log10f64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3413 __asm__(".symver log10f64x,log10f64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3414 __asm__(".symver log1pf128,log1pf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3415 __asm__(".symver log1pf32,log1pf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3416 __asm__(".symver log1pf32x,log1pf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3417 __asm__(".symver log1pf64,log1pf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3418 __asm__(".symver log1pf64x,log1pf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3419 __asm__(".symver log2f128,log2f128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3420 __asm__(".symver log2f32,log2f32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3421 __asm__(".symver log2f32x,log2f32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3422 __asm__(".symver log2f64,log2f64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3423 __asm__(".symver log2f64x,log2f64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3424 __asm__(".symver logbf128,logbf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3425 __asm__(".symver logbf32,logbf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3426 __asm__(".symver logbf32x,logbf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3427 __asm__(".symver logbf64,logbf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3428 __asm__(".symver logbf64x,logbf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3429 __asm__(".symver logf128,logf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3430 __asm__(".symver logf32,logf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3431 __asm__(".symver logf32x,logf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3432 __asm__(".symver logf64,logf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3433 __asm__(".symver logf64x,logf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3434 __asm__(".symver lrintf128,lrintf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3435 __asm__(".symver lrintf32,lrintf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3436 __asm__(".symver lrintf32x,lrintf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3437 __asm__(".symver lrintf64,lrintf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3438 __asm__(".symver lrintf64x,lrintf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3439 __asm__(".symver lroundf128,lroundf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3440 __asm__(".symver lroundf32,lroundf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3441 __asm__(".symver lroundf32x,lroundf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3442 __asm__(".symver lroundf64,lroundf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3443 __asm__(".symver lroundf64x,lroundf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3444 __asm__(".symver malloc_get_state,malloc_get_state@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3445 __asm__(".symver malloc_set_state,malloc_set_state@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3446 __asm__(".symver memfd_create,memfd_create@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3447 __asm__(".symver mlock2,mlock2@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3448 __asm__(".symver modff128,modff128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3449 __asm__(".symver modff32,modff32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3450 __asm__(".symver modff32x,modff32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3451 __asm__(".symver modff64,modff64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3452 __asm__(".symver modff64x,modff64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3453 __asm__(".symver nanf128,nanf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3454 __asm__(".symver nanf32,nanf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3455 __asm__(".symver nanf32x,nanf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3456 __asm__(".symver nanf64,nanf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3457 __asm__(".symver nanf64x,nanf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3458 __asm__(".symver nearbyintf128,nearbyintf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3459 __asm__(".symver nearbyintf32,nearbyintf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3460 __asm__(".symver nearbyintf32x,nearbyintf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3461 __asm__(".symver nearbyintf64,nearbyintf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3462 __asm__(".symver nearbyintf64x,nearbyintf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3463 __asm__(".symver netname2host,netname2host@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3464 __asm__(".symver netname2user,netname2user@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3465 __asm__(".symver nextafterf128,nextafterf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3466 __asm__(".symver nextafterf32,nextafterf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3467 __asm__(".symver nextafterf32x,nextafterf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3468 __asm__(".symver nextafterf64,nextafterf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3469 __asm__(".symver nextafterf64x,nextafterf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3470 __asm__(".symver nextdownf128,nextdownf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3471 __asm__(".symver nextdownf32,nextdownf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3472 __asm__(".symver nextdownf32x,nextdownf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3473 __asm__(".symver nextdownf64,nextdownf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3474 __asm__(".symver nextdownf64x,nextdownf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3475 __asm__(".symver nextupf128,nextupf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3476 __asm__(".symver nextupf32,nextupf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3477 __asm__(".symver nextupf32x,nextupf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3478 __asm__(".symver nextupf64,nextupf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3479 __asm__(".symver nextupf64x,nextupf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3480 __asm__(".symver passwd2des,passwd2des@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3481 __asm__(".symver pkey_alloc,pkey_alloc@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3482 __asm__(".symver pkey_free,pkey_free@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3483 __asm__(".symver pkey_get,pkey_get@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3484 __asm__(".symver pkey_mprotect,pkey_mprotect@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3485 __asm__(".symver pkey_set,pkey_set@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3486 __asm__(".symver pmap_getmaps,pmap_getmaps@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3487 __asm__(".symver pmap_getport,pmap_getport@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3488 __asm__(".symver pmap_rmtcall,pmap_rmtcall@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3489 __asm__(".symver pmap_set,pmap_set@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3490 __asm__(".symver pmap_unset,pmap_unset@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3491 __asm__(".symver powf128,powf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3492 __asm__(".symver powf32,powf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3493 __asm__(".symver powf32x,powf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3494 __asm__(".symver powf64,powf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3495 __asm__(".symver powf64x,powf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3496 __asm__(".symver preadv2,preadv2@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3497 __asm__(".symver preadv64v2,preadv64v2@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3498 __asm__(".symver pwritev2,pwritev2@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3499 __asm__(".symver pwritev64v2,pwritev64v2@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3500 __asm__(".symver query_module,query_module@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3501 __asm__(".symver reallocarray,reallocarray@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3502 __asm__(".symver registerrpc,registerrpc@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3503 __asm__(".symver remainderf128,remainderf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3504 __asm__(".symver remainderf32,remainderf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3505 __asm__(".symver remainderf32x,remainderf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3506 __asm__(".symver remainderf64,remainderf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3507 __asm__(".symver remainderf64x,remainderf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3508 __asm__(".symver remquof128,remquof128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3509 __asm__(".symver remquof32,remquof32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3510 __asm__(".symver remquof32x,remquof32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3511 __asm__(".symver remquof64,remquof64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3512 __asm__(".symver remquof64x,remquof64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3513 __asm__(".symver res_gethostbyaddr,res_gethostbyaddr@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3514 __asm__(".symver res_gethostbyname,res_gethostbyname@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3515 __asm__(".symver res_gethostbyname2,res_gethostbyname2@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3516 __asm__(".symver res_send_setqhook,res_send_setqhook@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3517 __asm__(".symver res_send_setrhook,res_send_setrhook@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3518 __asm__(".symver rintf128,rintf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3519 __asm__(".symver rintf32,rintf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3520 __asm__(".symver rintf32x,rintf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3521 __asm__(".symver rintf64,rintf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3522 __asm__(".symver rintf64x,rintf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3523 __asm__(".symver roundevenf128,roundevenf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3524 __asm__(".symver roundevenf32,roundevenf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3525 __asm__(".symver roundevenf32x,roundevenf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3526 __asm__(".symver roundevenf64,roundevenf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3527 __asm__(".symver roundevenf64x,roundevenf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3528 __asm__(".symver roundf128,roundf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3529 __asm__(".symver roundf32,roundf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3530 __asm__(".symver roundf32x,roundf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3531 __asm__(".symver roundf64,roundf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3532 __asm__(".symver roundf64x,roundf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3533 __asm__(".symver rtime,rtime@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3534 __asm__(".symver scalblnf128,scalblnf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3535 __asm__(".symver scalblnf32,scalblnf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3536 __asm__(".symver scalblnf32x,scalblnf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3537 __asm__(".symver scalblnf64,scalblnf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3538 __asm__(".symver scalblnf64x,scalblnf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3539 __asm__(".symver scalbnf128,scalbnf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3540 __asm__(".symver scalbnf32,scalbnf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3541 __asm__(".symver scalbnf32x,scalbnf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3542 __asm__(".symver scalbnf64,scalbnf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3543 __asm__(".symver scalbnf64x,scalbnf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3544 __asm__(".symver setpayloadf128,setpayloadf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3545 __asm__(".symver setpayloadf32,setpayloadf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3546 __asm__(".symver setpayloadf32x,setpayloadf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3547 __asm__(".symver setpayloadf64,setpayloadf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3548 __asm__(".symver setpayloadf64x,setpayloadf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3549 __asm__(".symver setpayloadsigf128,setpayloadsigf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3550 __asm__(".symver setpayloadsigf32,setpayloadsigf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3551 __asm__(".symver setpayloadsigf32x,setpayloadsigf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3552 __asm__(".symver setpayloadsigf64,setpayloadsigf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3553 __asm__(".symver setpayloadsigf64x,setpayloadsigf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3554 __asm__(".symver sigvec,sigvec@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3555 __asm__(".symver sincosf128,sincosf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3556 __asm__(".symver sincosf32,sincosf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3557 __asm__(".symver sincosf32x,sincosf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3558 __asm__(".symver sincosf64,sincosf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3559 __asm__(".symver sincosf64x,sincosf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3560 __asm__(".symver sinf128,sinf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3561 __asm__(".symver sinf32,sinf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3562 __asm__(".symver sinf32x,sinf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3563 __asm__(".symver sinf64,sinf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3564 __asm__(".symver sinf64x,sinf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3565 __asm__(".symver sinhf128,sinhf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3566 __asm__(".symver sinhf32,sinhf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3567 __asm__(".symver sinhf32x,sinhf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3568 __asm__(".symver sinhf64,sinhf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3569 __asm__(".symver sinhf64x,sinhf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3570 __asm__(".symver sqrtf128,sqrtf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3571 __asm__(".symver sqrtf32,sqrtf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3572 __asm__(".symver sqrtf32x,sqrtf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3573 __asm__(".symver sqrtf64,sqrtf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3574 __asm__(".symver sqrtf64x,sqrtf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3575 __asm__(".symver step,step@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3576 __asm__(".symver strfromf128,strfromf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3577 __asm__(".symver strfromf32,strfromf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3578 __asm__(".symver strfromf32x,strfromf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3579 __asm__(".symver strfromf64,strfromf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3580 __asm__(".symver strfromf64x,strfromf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3581 __asm__(".symver strtof128,strtof128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3582 __asm__(".symver strtof128_l,strtof128_l@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3583 __asm__(".symver strtof32,strtof32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3584 __asm__(".symver strtof32_l,strtof32_l@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3585 __asm__(".symver strtof32x,strtof32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3586 __asm__(".symver strtof32x_l,strtof32x_l@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3587 __asm__(".symver strtof64,strtof64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3588 __asm__(".symver strtof64_l,strtof64_l@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3589 __asm__(".symver strtof64x,strtof64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3590 __asm__(".symver strtof64x_l,strtof64x_l@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3591 __asm__(".symver svc_exit,svc_exit@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3592 __asm__(".symver svc_getreq,svc_getreq@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3593 __asm__(".symver svc_getreq_common,svc_getreq_common@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3594 __asm__(".symver svc_getreqset,svc_getreqset@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3595 __asm__(".symver svc_run,svc_run@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3596 __asm__(".symver svc_unregister,svc_unregister@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3597 __asm__(".symver svcerr_auth,svcerr_auth@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3598 __asm__(".symver svcerr_noprog,svcerr_noprog@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3599 __asm__(".symver svcerr_progvers,svcerr_progvers@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3600 __asm__(".symver svcerr_weakauth,svcerr_weakauth@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3601 __asm__(".symver svcfd_create,svcfd_create@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3602 __asm__(".symver svcraw_create,svcraw_create@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3603 __asm__(".symver svcudp_create,svcudp_create@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3604 __asm__(".symver svcudp_enablecache,svcudp_enablecache@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3605 __asm__(".symver svcunix_create,svcunix_create@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3606 __asm__(".symver svcunixfd_create,svcunixfd_create@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3607 __asm__(".symver tanf128,tanf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3608 __asm__(".symver tanf32,tanf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3609 __asm__(".symver tanf32x,tanf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3610 __asm__(".symver tanf64,tanf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3611 __asm__(".symver tanf64x,tanf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3612 __asm__(".symver tanhf128,tanhf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3613 __asm__(".symver tanhf32,tanhf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3614 __asm__(".symver tanhf32x,tanhf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3615 __asm__(".symver tanhf64,tanhf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3616 __asm__(".symver tanhf64x,tanhf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3617 __asm__(".symver tgammaf128,tgammaf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3618 __asm__(".symver tgammaf32,tgammaf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3619 __asm__(".symver tgammaf32x,tgammaf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3620 __asm__(".symver tgammaf64,tgammaf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3621 __asm__(".symver tgammaf64x,tgammaf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3622 __asm__(".symver totalorderf128,totalorderf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3623 __asm__(".symver totalorderf32,totalorderf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3624 __asm__(".symver totalorderf32x,totalorderf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3625 __asm__(".symver totalorderf64,totalorderf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3626 __asm__(".symver totalorderf64x,totalorderf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3627 __asm__(".symver totalordermagf128,totalordermagf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3628 __asm__(".symver totalordermagf32,totalordermagf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3629 __asm__(".symver totalordermagf32x,totalordermagf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3630 __asm__(".symver totalordermagf64,totalordermagf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3631 __asm__(".symver totalordermagf64x,totalordermagf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3632 __asm__(".symver truncf128,truncf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3633 __asm__(".symver truncf32,truncf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3634 __asm__(".symver truncf32x,truncf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3635 __asm__(".symver truncf64,truncf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3636 __asm__(".symver truncf64x,truncf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3637 __asm__(".symver ufromfpf128,ufromfpf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3638 __asm__(".symver ufromfpf32,ufromfpf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3639 __asm__(".symver ufromfpf32x,ufromfpf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3640 __asm__(".symver ufromfpf64,ufromfpf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3641 __asm__(".symver ufromfpf64x,ufromfpf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3642 __asm__(".symver ufromfpxf128,ufromfpxf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3643 __asm__(".symver ufromfpxf32,ufromfpxf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3644 __asm__(".symver ufromfpxf32x,ufromfpxf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3645 __asm__(".symver ufromfpxf64,ufromfpxf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3646 __asm__(".symver ufromfpxf64x,ufromfpxf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3647 __asm__(".symver uselib,uselib@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3648 __asm__(".symver user2netname,user2netname@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3649 __asm__(".symver wcstof128,wcstof128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3650 __asm__(".symver wcstof128_l,wcstof128_l@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3651 __asm__(".symver wcstof32,wcstof32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3652 __asm__(".symver wcstof32_l,wcstof32_l@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3653 __asm__(".symver wcstof32x,wcstof32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3654 __asm__(".symver wcstof32x_l,wcstof32x_l@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3655 __asm__(".symver wcstof64,wcstof64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3656 __asm__(".symver wcstof64_l,wcstof64_l@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3657 __asm__(".symver wcstof64x,wcstof64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3658 __asm__(".symver wcstof64x_l,wcstof64x_l@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3659 __asm__(".symver xdr_accepted_reply,xdr_accepted_reply@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3660 __asm__(".symver xdr_authdes_cred,xdr_authdes_cred@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3661 __asm__(".symver xdr_authdes_verf,xdr_authdes_verf@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3662 __asm__(".symver xdr_authunix_parms,xdr_authunix_parms@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3663 __asm__(".symver xdr_callhdr,xdr_callhdr@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3664 __asm__(".symver xdr_callmsg,xdr_callmsg@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3665 __asm__(".symver xdr_char,xdr_char@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3666 __asm__(".symver xdr_cryptkeyarg,xdr_cryptkeyarg@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3667 __asm__(".symver xdr_cryptkeyarg2,xdr_cryptkeyarg2@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3668 __asm__(".symver xdr_cryptkeyres,xdr_cryptkeyres@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3669 __asm__(".symver xdr_des_block,xdr_des_block@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3670 __asm__(".symver xdr_double,xdr_double@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3671 __asm__(".symver xdr_float,xdr_float@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3672 __asm__(".symver xdr_getcredres,xdr_getcredres@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3673 __asm__(".symver xdr_hyper,xdr_hyper@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3674 __asm__(".symver xdr_int16_t,xdr_int16_t@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3675 __asm__(".symver xdr_int32_t,xdr_int32_t@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3676 __asm__(".symver xdr_int64_t,xdr_int64_t@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3677 __asm__(".symver xdr_int8_t,xdr_int8_t@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3678 __asm__(".symver xdr_key_netstarg,xdr_key_netstarg@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3679 __asm__(".symver xdr_key_netstres,xdr_key_netstres@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3680 __asm__(".symver xdr_keybuf,xdr_keybuf@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3681 __asm__(".symver xdr_keystatus,xdr_keystatus@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3682 __asm__(".symver xdr_long,xdr_long@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3683 __asm__(".symver xdr_longlong_t,xdr_longlong_t@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3684 __asm__(".symver xdr_netnamestr,xdr_netnamestr@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3685 __asm__(".symver xdr_opaque_auth,xdr_opaque_auth@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3686 __asm__(".symver xdr_pmap,xdr_pmap@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3687 __asm__(".symver xdr_pmaplist,xdr_pmaplist@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3688 __asm__(".symver xdr_quad_t,xdr_quad_t@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3689 __asm__(".symver xdr_reference,xdr_reference@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3690 __asm__(".symver xdr_rejected_reply,xdr_rejected_reply@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3691 __asm__(".symver xdr_replymsg,xdr_replymsg@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3692 __asm__(".symver xdr_rmtcall_args,xdr_rmtcall_args@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3693 __asm__(".symver xdr_rmtcallres,xdr_rmtcallres@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3694 __asm__(".symver xdr_short,xdr_short@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3695 __asm__(".symver xdr_u_hyper,xdr_u_hyper@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3696 __asm__(".symver xdr_u_long,xdr_u_long@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3697 __asm__(".symver xdr_u_longlong_t,xdr_u_longlong_t@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3698 __asm__(".symver xdr_u_quad_t,xdr_u_quad_t@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3699 __asm__(".symver xdr_u_short,xdr_u_short@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3700 __asm__(".symver xdr_uint16_t,xdr_uint16_t@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3701 __asm__(".symver xdr_uint64_t,xdr_uint64_t@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3702 __asm__(".symver xdr_uint8_t,xdr_uint8_t@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3703 __asm__(".symver xdr_union,xdr_union@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3704 __asm__(".symver xdr_unixcred,xdr_unixcred@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3705 __asm__(".symver xdr_vector,xdr_vector@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3706 __asm__(".symver xdr_wrapstring,xdr_wrapstring@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3707 __asm__(".symver xdrrec_create,xdrrec_create@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3708 __asm__(".symver xdrrec_endofrecord,xdrrec_endofrecord@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3709 __asm__(".symver xdrrec_eof,xdrrec_eof@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3710 __asm__(".symver xdrrec_skiprecord,xdrrec_skiprecord@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3711 __asm__(".symver xencrypt,xencrypt@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3712 __asm__(".symver xprt_register,xprt_register@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3713 __asm__(".symver y0f128,y0f128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3714 __asm__(".symver y0f32,y0f32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3715 __asm__(".symver y0f32x,y0f32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3716 __asm__(".symver y0f64,y0f64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3717 __asm__(".symver y0f64x,y0f64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3718 __asm__(".symver y1f128,y1f128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3719 __asm__(".symver y1f32,y1f32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3720 __asm__(".symver y1f32x,y1f32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3721 __asm__(".symver y1f64,y1f64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3722 __asm__(".symver y1f64x,y1f64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3723 __asm__(".symver ynf128,ynf128@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3724 __asm__(".symver ynf32,ynf32@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3725 __asm__(".symver ynf32x,ynf32x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3726 __asm__(".symver ynf64,ynf64@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3727 __asm__(".symver ynf64x,ynf64x@GLIBC_WRAP_ERROR_SYMBOL_NOT_PRESENT_IN_REQUESTED_VERSION");
3728 #endif
File include/fseq.h added (mode: 100644) (index 0000000..8e810d4)
1 #ifndef FSEQ_H
2 #define FSEQ_H
3
4 #ifndef CUTE_SOUND_H
5 #error Include cute_sound.h before fseq.h.
6 #endif
7
8 #include <stdint.h>
9 #include <stdio.h>
10
11 #include <string>
12 #include <vector>
13
14 namespace fseq {
15 // Transform a buffer into a hexadecimal string.
16 std::string ToHex( std::vector<uint8_t> data ){
17 const char *chars = "0123456789ABCDEF";
18 std::string str;
19
20 str.resize( data.size() * 2 );
21 // Transform every byte into 2 characters.
22 for( size_t i = 0; i < data.size(); i++ ){
23 str[i * 2] = chars[data[i] / 16];
24 str[i * 2 + 1] = chars[data[i] % 16];
25 }
26 return str;
27 }
28
29 // Transform a hexadecimal string into a buffer.
30 std::vector<uint8_t> FromHex( std::string str ){
31 std::vector<uint8_t> data;
32 int n1;
33 int n2;
34
35 data.resize( str.length() / 2 );
36 // Combine every 2 characters into a byte and add it to the
37 // buffer.
38 size_t i = 0;
39 while( i + 1 < str.length() ){
40 if( str[i] >= '0' && str[i] <= '9' ){
41 n1 = str[i] - '0';
42 }else{
43 n1 = str[i] + 10 - 'A';
44 }
45 if( str[i + 1] >= '0' && str[i + 1] <= '9' ){
46 n2 = str[i + 1] - '0';
47 }else{
48 n2 = str[i + 1] + 10 - 'A';
49 }
50 data[i / 2] = (uint8_t)( n1 * 16 + n2 );
51 i += 2;
52 }
53 return data;
54 }
55
56 void Play( cs_context_t *ctx, const std::vector<uint8_t> &buf ){
57 (void)ctx;
58 for( uint8_t b : buf ){
59 printf( "%d%d%d%d%d%d%d%d\n",
60 (int)!!( b & 128 ),
61 (int)!!( b & 64 ),
62 (int)!!( b & 32 ),
63 (int)!!( b & 16 ),
64 (int)!!( b & 8 ),
65 (int)!!( b & 4 ),
66 (int)!!( b & 2 ),
67 (int)!!( b & 1 ) );
68 }
69 }
70
71 // Test the functionality of fseq to make sure it works.
72 void Test( cs_context_t *ctx ){
73 std::string str = "01020408";
74 Play( ctx, FromHex( str ) );
75 }
76 } // namespace fseq
77
78 #endif // FSEQ_H
File include/fworld.h added (mode: 100755) (index 0000000..fdcd15a)
1 #ifndef FWORLD_H
2 #define FWORLD_H
3
4 #if !defined(FG2_H) && !defined(FG3_H) && !defined(FG4_H)
5 # error Include fg2.h, fg3.h, or fg4.h before fworld.h so graphics can be displayed.
6 #endif
7
8 #ifndef _TM_JSON_H_INCLUDED_
9 # error Include tm_json.h before fworld.h so maps can be loaded.
10 #endif
11
12 #include <stdio.h>
13
14 #include <cmath>
15
16 #include <algorithm>
17 #include <functional>
18 #include <map>
19 #include <string>
20 #include <utility>
21 #include <vector>
22
23 #if defined(FG2_H)
24 #define fgl fg2
25 #elif defined(FG3_H)
26 #define fgl fg3
27 #elif defined(FG4_H)
28 #define fgl fg4
29 #endif
30
31 namespace fworld {
32
33 bool verbose = true;
34
35 static const double epsilon = 0.0001;
36
37 // Animation mode flags.
38 static const int
39 ANIMATION_MANUAL = -2,
40 ANIMATION_AUTOPLAY = -1,
41 ANIMATION_RPG = 0,
42 ANIMATION_BEATEMUP = 1;
43
44 // Task flags.
45 static const int
46 TASK_NONE = 0,
47 TASK_TALK = 1,
48 TASK_BUMP = 2,
49 TASK_SLEEP = 3,
50 TASK_MELEE = 4,
51 TASK_DROP = 5;
52
53 // TODO: std::pair or std::map?
54 struct Image {
55 std::string imageName;
56 fgl::Texture imageTexture;
57 };
58
59 // `mesa` is a flat map class.
60 template<typename K,typename V>
61 class mesa : public std::vector<std::pair<K,V>> {
62 public:
63 bool contains( K key ){
64 for( auto &item : *this ){
65 if( item.first == key ){
66 return true;
67 }
68 }
69 return false;
70 }
71 V& get( K key ){
72 for( auto &item : *this ){
73 if( item.first == key ){
74 return item.second;
75 }
76 }
77 V* val = nullptr;
78 return *val;
79 }
80 void set( K key, V value ){
81 for( auto &item : *this ){
82 if( item.first == key ){
83 item.second = value;
84 return;
85 }
86 }
87 this->push_back( { key, value } );
88 }
89 };
90
91 typedef mesa<std::string,int> Inventory;
92
93 typedef std::vector<std::vector<int>> MapLayer;
94
95 struct Entity {
96 fgl::Texture sprite;
97 fgl::Texture meleeSprite;
98 fgl::Texture bribeSprite;
99 fgl::Texture shadow;
100 fgl::Texture sleep;
101 std::string name;
102 std::string type;
103 std::string itemName;
104 std::string dialogue;
105 std::string deathDialogue;
106 std::string bribeNewDialogue;
107 std::string bribeSuccess;
108 std::string bribeFail;
109 Inventory inventory;
110 Inventory bribeItems;
111 double speed;
112 double speedFactor;
113 double x;
114 double y;
115 double last_x;
116 double last_y;
117 double collisionRadius;
118 double fps;
119 double meleeRecovery;
120 double age;
121 double frame;
122 double boredom;
123 double stun;
124 bool walking;
125 bool staticCollisions;
126 int health;
127 int money;
128 int karma;
129 int sweetTooth;
130 int lactoseTolerance;
131 int meleeDamage;
132 int animationMode;
133 int task;
134 int direction;
135 int width;
136 int height;
137 #ifdef GRINNINGLIZARD_MICROPATHER_INCLUDED
138 MP_VECTOR<void*> path;
139 #else
140 std::vector<void*> path;
141 #endif
142 };
143
144 // For depth sorting.
145 struct EntityIndex {
146 double depth;
147 long long pos;
148 Entity *ptr;
149 };
150
151 struct Item {
152 fgl::Texture icon;
153 int stack;
154 int flavor;
155 int appearance;
156 int sweetness;
157 int lactose;
158 int price;
159 int yield;
160 std::string script;
161 std::map<std::string,int> recipe, byproducts;
162 Entity entity;
163 };
164
165 #ifdef GRINNINGLIZARD_MICROPATHER_INCLUDED
166
167 class World : micropather::Graph {
168 private:
169 micropather::MicroPather* pather;
170 MP_VECTOR<void*> pathBuffer;
171
172 void NodeToXY( void* node, intptr_t* x, intptr_t* y ){
173 intptr_t index = (intptr_t)node;
174 size_t MapW = mapInfo[0].size();
175 *y = index / MapW;
176 *x = index - *y * MapW;
177 }
178
179 void* XYToNode( intptr_t x, intptr_t y ){
180 return (void*)( y * mapInfo[0].size() + x );
181 }
182
183 virtual float LeastCostEstimate( void* nodeStart, void* nodeEnd ){
184 intptr_t xStart, yStart, xEnd, yEnd;
185 NodeToXY( nodeStart, &xStart, &yStart );
186 NodeToXY( nodeEnd, &xEnd, &yEnd );
187
188 // Compute the minimum path cost using distance measurement. It is possible
189 // to compute the exact minimum path using the fact that you can move only
190 // on a straight line or on a diagonal, and this will yield a better result.
191 intptr_t dx = xStart - xEnd;
192 intptr_t dy = yStart - yEnd;
193 return std::sqrt( (float)( dx * dx ) + (float)( dy * dy ) );
194 }
195
196 virtual void AdjacentCost( void* node, MP_VECTOR<micropather::StateCost>* neighbors ){
197 // 5 6 7
198 // 4 + 0
199 // 3 2 1
200 const intptr_t dx[8] = { 1, 1, 0, -1, -1, -1, 0, 1 };
201 const intptr_t dy[8] = { 0, 1, 1, 1, 0, -1, -1, -1 };
202 const float cost[8] = { 1.0f, 1.41f, 1.0f, 1.41f, 1.0f, 1.41f, 1.0f, 1.41f };
203 bool blocked[8];
204
205 intptr_t x, y;
206 NodeToXY( node, &x, &y );
207
208 for( int i = 0; i < 8; i++ ){
209 blocked[i] = tileBlocking( x + dx[i], y + dy[i], true );
210 }
211
212 if( blocked[0] || blocked[2] ){
213 blocked[1] = true; // Bottom right.
214 }
215 if( blocked[2] || blocked[4] ){
216 blocked[3] = true; // Bottom left.
217 }
218 if( blocked[4] || blocked[6] ){
219 blocked[5] = true; // Top left.
220 }
221 if( blocked[6] || blocked[0] ){
222 blocked[7] = true; // Top right.
223 }
224
225 for( int i = 0; i < 8; i++ ){
226 intptr_t nx = x + dx[i];
227 intptr_t ny = y + dy[i];
228 neighbors->push_back( {
229 XYToNode( nx, ny ),
230 blocked[i] ? FLT_MAX : cost[i]
231 } );
232 }
233 }
234
235 virtual void PrintStateInfo( void* node ){
236 intptr_t x, y;
237 NodeToXY( node, &x, &y );
238 printf( "(%ld,%ld)", (long int)x, (long int)y );
239 }
240
241 #else
242
243 class World {
244 private:
245
246 #endif
247
248 std::string viewToString( JsonStringView str ){
249 // Convert JsonStringView to std::string.
250 return std::string( str.data, str.size );
251 }
252 std::vector<EntityIndex> entityIndices;
253 bool cursorOverSprite( double posX, double posY, double spriteScale, double sourceW, double sourceH );
254 void calculateWorldCursor();
255 void tileCollisions( Entity &ent );
256 void entityCollisions( size_t pos, bool recurse = true );
257 void drawMapLayer( size_t pos );
258 public:
259 std::string mapFile;
260 std::vector<Image> images;
261 fgl::InstanceBuffer instanceBuf;
262 fgl::Texture tileset;
263 std::string tilesetDefinition;
264 std::vector<std::vector<unsigned char>> mapInfo;
265 std::vector<std::vector<unsigned char>> mapEntities;
266 std::vector<MapLayer> map;
267 std::vector<Entity> entities;
268 std::map<std::string,Item> items;
269 linalg::mat<double,4,4> spriteRotationMat;
270 linalg::mat<double,4,4> viewMat;
271 bool mapChanged;
272 int tileSize;
273 int screenWidth;
274 int screenHeight;
275 int followEntity;
276 int facingEntity;
277 int cursorOverEntity;
278 double cursorX;
279 double cursorY;
280 double cursorWorldX;
281 double cursorWorldY;
282 double cameraX;
283 double cameraY;
284 double scale;
285 double runningTime;
286 double mapFps;
287 void (*portalCallback)(std::string);
288 long double safeStold( const std::string &str );
289 fgl::Texture getTexture( std::string basePath, std::string imageName, bool filter );
290 bool tileBlocking( long long x, long long y, bool checkEntities = false );
291 void loadMap( std::string dataPath, std::string filePath );
292 void unloadMap();
293 void loadItems( std::string filePath );
294 void deleteInventoryZeroes( Inventory &inv );
295 char craft( int entIndex, std::vector<std::string> itemNames, int max_slots, std::string &resultName );
296 std::string encodeInventory( Inventory inv );
297 Inventory decodeInventory( std::string str_inv );
298 bool inventoryCanTakeAny( Inventory &inv_a, Inventory &inv_b, int max_slots );
299 bool inventoryCanTakeAll( Inventory &inv_a, Inventory &inv_b, int max_slots );
300 void transferInventory( Inventory &inv_a, Inventory &inv_b, int max_slots );
301 JsonValue getProp( JsonValue parent, const char* prop );
302 Entity parseEntity( const JsonValueStruct &o, std::string dataPath );
303 std::string serializeEntity( size_t idx );
304 void saveMap( std::string filePath );
305 void drawSprite( fgl::Texture &tex, double posX, double posY, double imageScale, int sourceX, int sourceY, int sourceW, int sourceH, bool bind = true );
306 void moveEntity( Entity &ent, double moveX, double moveY, double d );
307 void simulate( double d );
308 void drawMap();
309 void drawEntities( const std::vector<Entity> &extraEntities = {} );
310 void draw( double d );
311 void removeEntity( int entity_index );
312 void recalculateMapEntities();
313 bool solveEntityPath( Entity &ent, long long x, long long y, bool skipBadPath );
314 bool reachable( long long startX, long long startY, long long endX, long long endY, long long radius, bool checkEntities = false );
315 bool entitiesBumping( Entity &ent1, Entity &ent2 );
316 bool entityFacing( Entity &ent1, Entity &ent2 );
317 void entityLookAt( Entity &ent1, Entity &ent2 );
318 int clearZone( int zone );
319 int getEntityZone( int entity_index );
320 int xyToDirection( double x, double y );
321 };
322
323 #ifdef GRINNINGLIZARD_MICROPATHER_INCLUDED
324
325 bool World::solveEntityPath( Entity &ent, long long x, long long y, bool skipBadPath ){
326 if( x < 0 ) x = 0;
327 if( y < 0 ) y = 0;
328 if( x > (long long)mapInfo[0].size() - 1 ) x = mapInfo[0].size() - 1;
329 if( y > (long long)mapInfo.size() - 1 ) y = mapInfo.size() - 1;
330
331 intptr_t entX = ent.x + 0.5, entY = ent.y + 0.5;
332 if( entX < 0 ) entX = 0;
333 if( entY < 0 ) entY = 0;
334 if( entX > (intptr_t)mapInfo[0].size() - 1 ) entX = mapInfo[0].size() - 1;
335 if( entY > (intptr_t)mapInfo.size() - 1 ) entY = mapInfo.size() - 1;
336
337 auto nodeStart = XYToNode( entX, entY );
338 auto nodeEnd = XYToNode( x, y );
339
340 bool pathAvailable = false;
341
342 if( nodeStart != nodeEnd && !tileBlocking( x, y, true ) ){
343 // This is checked before pather->Solve to avoid infinite loops.
344 // Complexity is typically (radius * 2 + 1)^2, so with a radius
345 // of 15 it's 961 tileBlocking calls + <= 961 floodfill cycles.
346 // Doing 2000 things ain't no picnic, so if it lags this number
347 // can be lowered.
348 pathAvailable = reachable( entX, entY, x, y, 15, true );
349 }
350
351 float totalCost = 0.0f;
352 int result = micropather::MicroPather::NO_SOLUTION;
353
354 // If a path is available, solve it.
355 if( pathAvailable ){
356 result = pather->Solve( nodeStart, nodeEnd, &pathBuffer, &totalCost );
357 }
358
359 if( result == micropather::MicroPather::SOLVED || !skipBadPath ){
360 ent.path.clear();
361 // Manually copy pointers from one MP_VECTOR to the other.
362 for( size_t i = 0; i < pathBuffer.size(); i++ ){
363 ent.path.push_back( pathBuffer[i] );
364 }
365 }
366 pathBuffer.clear();
367
368 if( verbose ){
369 std::string pathText =
370 ( ent.name.length() > 0 ? ent.name : "entity" ) + "'s path from " +
371 std::to_string( entX ) + "," + std::to_string( entY ) + " to " +
372 std::to_string( x ) + "," + std::to_string( y ) + "\n";
373 if( result == micropather::MicroPather::SOLVED ){
374 printf( "Solved %s", pathText.c_str() );
375 for( size_t i = 0; i < ent.path.size(); i++ )
376 PrintStateInfo( ent.path[i] );
377 printf( "\n" );
378 }else{
379 printf( "No way to solve %s", pathText.c_str() );
380 }
381 }
382 return result == micropather::MicroPather::SOLVED;
383 }
384
385 #else
386
387 bool World::solveEntityPath( Entity &ent, long long x, long long y, bool skipBadPath ){
388 return false;
389 }
390
391 #endif
392
393 // Based on floodFillScanlineStack from here:
394 // https://lodev.org/cgtutor/floodfill.html
395 bool World::reachable( long long startX, long long startY, long long endX, long long endY, long long radius, bool checkEntities ){
396 const long long
397 minX = std::max<long long>( startX - radius, 0 ),
398 minY = std::max<long long>( startY - radius, 0 ),
399 maxX = std::min<long long>( startX + radius, mapInfo[0].size() - 1 ),
400 maxY = std::min<long long>( startY + radius, mapInfo.size() - 1 );
401
402 const long long
403 bw = maxX - minX + 1,
404 bh = maxY - minY + 1;
405
406 std::vector<bool> blockBuffer( bw * bh );
407
408 auto getBlock = [&]( long long x, long long y ){
409 return blockBuffer[x - minX + ( y - minY ) * bw];
410 };
411
412 auto setBlock = [&]( long long x, long long y, bool block ){
413 blockBuffer[x - minX + ( y - minY ) * bw] = block;
414 };
415
416 for( long long iy = minY; iy <= maxY; iy++ ){
417 for( long long ix = minX; ix <= maxX; ix++ ){
418 if( tileBlocking( ix, iy, checkEntities ) ){
419 setBlock( ix, iy, true );
420 }
421 }
422 }
423
424 long long
425 x = startX,
426 y = startY;
427
428 bool spanAbove, spanBelow;
429
430 std::vector<long long> stack;
431 stack.push_back( x );
432 stack.push_back( y );
433 while( stack.size() >= 2 ){
434 y = stack.back();
435 stack.pop_back();
436 x = stack.back();
437 stack.pop_back();
438 while( x >= minX && !getBlock( x, y ) ){
439 x--;
440 }
441 x++;
442 spanAbove = spanBelow = false;
443 while( x <= maxX && !getBlock( x, y ) ){
444 if( x == endX && y == endY ){
445 return true;
446 }
447 setBlock( x, y, true );
448 if( !spanAbove && y > minY && !getBlock( x, y - 1 ) ){
449 stack.push_back( x );
450 stack.push_back( y - 1 );
451 spanAbove = true;
452 }else if( spanAbove && y > minY && getBlock( x, y - 1 ) ){
453 spanAbove = false;
454 }
455 if( !spanBelow && y < maxY && !getBlock( x, y + 1 ) ){
456 stack.push_back( x );
457 stack.push_back( y + 1 );
458 spanBelow = true;
459 }else if( spanBelow && y < maxY && getBlock( x, y + 1 ) ){
460 spanBelow = false;
461 }
462 x++;
463 }
464 }
465 return false;
466 }
467
468 bool World::entitiesBumping( Entity &ent1, Entity &ent2 ){
469 // Check if the entities are within a forgiving distance. :/
470 return std::abs( ent1.x - ent2.x ) <= 1.0
471 && std::abs( ent1.y - ent2.y ) <= 1.0;
472 }
473
474 // Determine if ent1 is facing ent2 and close enough to be touching.
475 bool World::entityFacing( Entity &ent1, Entity &ent2 ){
476 static const double // Up, down, right, left.
477 offset_x[] = { 0.5, 0.5, 1.0, 0.0 },
478 offset_y[] = { 0.0, 1.0, 0.5, 0.5 };
479
480 double
481 facing_x = ent1.x + offset_x[ent1.direction],
482 facing_y = ent1.y + offset_y[ent1.direction];
483
484 // Use a small margin to make the function more generous.
485 return facing_x > ent2.x - 0.1 && facing_x < ent2.x + 1.1
486 && facing_y > ent2.y - 0.1 && facing_y < ent2.y + 1.1;
487 }
488
489 // Make ent1 face ent2.
490 void World::entityLookAt( Entity &ent1, Entity &ent2 ){
491 // Return if entity must look at itself.
492 if( &ent1 == &ent2 ) return;
493 if( ent1.animationMode == ANIMATION_RPG ){
494 ent1.direction =
495 xyToDirection( ent2.x - ent1.x, ent2.y - ent1.y );
496 }else if( ent1.animationMode == ANIMATION_BEATEMUP ){
497 if( ent2.x > ent1.x ){
498 ent1.direction = 2;
499 }else{
500 ent1.direction = 3;
501 }
502 }
503 }
504
505 // Remove all entities from the specified zone.
506 int World::clearZone( int zone ){
507 if( zone < 0 || (size_t)zone >= entities.size() ) return zone;
508 auto &zone_ent = entities[zone];
509 double
510 x1 = zone_ent.x + 1.0,
511 y1 = zone_ent.y + 1.0,
512 x2 = zone_ent.x + zone_ent.width / tileSize + 1.0,
513 y2 = zone_ent.y + zone_ent.height / tileSize + 1.0;
514 // Iterate backwards to safely remove entities.
515 for( int i = (int)entities.size() - 1; i >= 0; i-- ){
516 if( i != zone && i != followEntity ){
517 auto &ent = entities[i];
518 if( ent.x >= x1 && ent.y >= y1
519 && ent.x < x2 && ent.y < y2
520 && ( ent.type.length() < 4 || ent.type.substr( 0, 4 ) != "WARP" ) ){
521 // Remove the entity.
522 removeEntity( i );
523 // Handle index offsets.
524 if( i < zone ) zone--;
525 }
526 }
527 }
528 // Return the (possibly) adjusted zone index.
529 return zone;
530 }
531
532 // Get the first zone the specified entity is in, or -1 if not in a zone.
533 int World::getEntityZone( int entity_index ){
534 if( entity_index < 0 || (size_t)entity_index >= entities.size() )
535 return -1;
536 double
537 x = entities[entity_index].x,
538 y = entities[entity_index].y;
539 double s = 1.0 / tileSize;
540 for( size_t i = 0; i < entities.size(); i++ ){
541 auto &ent = entities[i];
542 if( !ent.sprite.success
543 && ent.type.length() >= 4
544 && ent.type.substr( 0, 4 ) == "zone"
545 && x >= ent.x && y >= ent.y
546 && x < ent.x + ent.width * s + 0.5
547 && y < ent.y + ent.height * s + 0.5 ){
548 // The specified entity is in the zone.
549 return i;
550 }
551 }
552 return -1;
553 }
554
555 int World::xyToDirection( double x, double y ){
556 double a = std::atan2( y, x );
557 if( std::abs( a - -1.57 ) < 0.786 ){
558 return 0; // Up
559 }else if( std::abs( a - 1.57 ) < 0.786 ){
560 return 1; // Down
561 }else if( std::abs( a ) < 0.786 ){
562 return 2; // Right
563 }else{
564 return 3; // Left
565 }
566 }
567
568 void World::recalculateMapEntities(){
569 #ifdef GRINNINGLIZARD_MICROPATHER_INCLUDED
570 pather->Reset();
571 #endif
572
573 mapEntities = mapInfo;
574
575 for( auto &ent : entities ){
576 if( ent.staticCollisions ){
577 bool collider = std::abs( ent.collisionRadius ) > epsilon;
578 intptr_t x = ent.x + 0.5, y = ent.y + 0.5;
579 if( x < 0 ) x = 0;
580 if( y < 0 ) y = 0;
581 if( x > (intptr_t)mapInfo[0].size() - 1 ) x = mapInfo[0].size() - 1;
582 if( y > (intptr_t)mapInfo.size() - 1 ) y = mapInfo.size() - 1;
583 if( collider ){
584 // Only center the entity on the tile if it's a collider.
585 ent.x = x;
586 ent.y = y;
587 }
588 auto infoTile = mapInfo[y][x];
589 if( infoTile >= 0xB0 && infoTile < 0xC0 ){
590 // Map tile is already blocking, so pass it up.
591 mapEntities[y][x] = infoTile;
592 }else if( infoTile >= 0xA0 && infoTile < 0xB0 && collider ){
593 // Only block the tile if it's a collider.
594 // Change from "allow" to "block" on the entities layer.
595 mapEntities[y][x] = infoTile + 0x10;
596 }else{
597 // A non-animated, non-colliding static entity.
598 mapEntities[y][x] = 0xF0;
599 }
600 }
601 }
602 }
603
604 long double World::safeStold( const std::string &str ){
605 char* p;
606 long double num = std::strtold( str.c_str(), &p );
607 if( *p ){
608 // Non-numeric value.
609 return 0.0;
610 }else{
611 // Numeric value.
612 return num;
613 }
614 }
615
616 fgl::Texture World::getTexture( std::string basePath, std::string imageName, bool filter ){
617 if( imageName.length() < 1 ){
618 return fgl::newTexture;
619 }
620 for( Image &i : images ){
621 if( i.imageName == imageName ){
622 return i.imageTexture;
623 }
624 }
625 #ifdef STBI_INCLUDE_STB_IMAGE_H
626 // Load the image from the base path but only record the image's canonical name.
627 std::string fileName = basePath + "/" + imageName;
628 int imgWidth, imgHeight, imgChannels;
629 unsigned char *imgData = stbi_load( fileName.c_str(), &imgWidth, &imgHeight, &imgChannels, 0 );
630 fgl::Texture imgTexture = fgl::loadTexture( imgData, imgWidth, imgHeight, imgChannels, false, filter );
631 stbi_image_free( imgData );
632 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
633 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
634 images.push_back( { imageName, imgTexture } );
635 if( !imgTexture.success ){
636 fprintf( stderr, "Failed to load image %s\n", fileName.c_str() );
637 }
638 return imgTexture;
639 #else
640 fprintf( stderr, "STBI_INCLUDE_STB_IMAGE_H not defined.\n" );
641 return fgl::newTexture;
642 #endif
643 }
644
645 bool World::tileBlocking( long long x, long long y, bool checkEntities ){
646 if( x < 0 ) x = 0;
647 if( y < 0 ) y = 0;
648 if( x > (long long)mapInfo[0].size() - 1 ) x = mapInfo[0].size() - 1;
649 if( y > (long long)mapInfo.size() - 1 ) y = mapInfo.size() - 1;
650
651 auto tileType = checkEntities ? mapEntities[y][x] : mapInfo[y][x];
652 return tileType >= 0xB0 && tileType < 0xC0;
653 }
654
655 void World::loadMap( std::string dataPath, std::string filePath ){
656 // dataPath: The full path (relative or absolute) to the game data.
657 // filePath: The full path (relative or absolute) to the map file.
658 // The map file can be anywhere, and all required files will be
659 // loaded from dataPath.
660
661 unloadMap();
662
663 mapFile = filePath;
664
665 // Load the map JSON file.
666 FILE* file = fopen( filePath.c_str(), "rb" );
667 if( !file ){
668 fprintf( stderr, "Failed to open %s\n", filePath.c_str() );
669 return;
670 }
671 std::string text = "";
672 char buf[4096];
673 while( size_t len = fread( buf, 1, sizeof( buf ), file ) ){
674 text += std::string( buf, len );
675 }
676 fclose( file );
677
678 // Parse the map JSON file.
679 auto allocatedDocument = jsonAllocateDocumentEx( text.c_str(), text.size(), JSON_READER_ALL );
680
681 if( allocatedDocument.document.error.type != JSON_OK ){
682 fprintf( stderr, "JSON error: %s at line %lu:%lu of %s\n\n",
683 jsonGetErrorString( allocatedDocument.document.error.type ),
684 (long unsigned int)allocatedDocument.document.error.line,
685 (long unsigned int)allocatedDocument.document.error.column,
686 filePath.c_str() );
687 jsonFreeDocument( &allocatedDocument );
688 return;
689 }
690
691 auto &info = allocatedDocument.document.root; // Map root.
692
693 tileSize = info["tilewidth"].getInt();
694
695 std::vector<unsigned char> tilesetInfo;
696
697 auto ts = info["tilesets"].getArray();
698 if( ts.size() > 0 ){
699 // Get the path to the tileset JSON file.
700 tilesetDefinition = viewToString( ts[0]["source"].getString() );
701 std::string tsPath = dataPath + "/" + tilesetDefinition;
702
703 // Load the tileset JSON file.
704 file = fopen( tsPath.c_str(), "rb" );
705 if( !file ){
706 fprintf( stderr, "Failed to open %s\n", tsPath.c_str() );
707 jsonFreeDocument( &allocatedDocument );
708 unloadMap();
709 return;
710 }
711 std::string tsText = "";
712 char buf[4096];
713 while( size_t len = fread( buf, 1, sizeof( buf ), file ) ){
714 tsText += std::string( buf, len );
715 }
716 fclose( file );
717
718 // Parse the tileset JSON file.
719 auto tsDocument = jsonAllocateDocumentEx( tsText.c_str(), tsText.size(), JSON_READER_ALL );
720 if( tsDocument.document.error.type != JSON_OK ){
721 fprintf( stderr, "JSON error: %s at line %lu:%lu of %s\n\n",
722 jsonGetErrorString( tsDocument.document.error.type ),
723 (long unsigned int)tsDocument.document.error.line,
724 (long unsigned int)tsDocument.document.error.column,
725 tsPath.c_str() );
726 jsonFreeDocument( &tsDocument );
727 jsonFreeDocument( &allocatedDocument );
728 unloadMap();
729 return;
730 }
731
732 // Tileset root.
733 auto &tsRoot = tsDocument.document.root;
734
735 // Load the image indicated by the tileset definition.
736 tileset = getTexture( dataPath, viewToString( tsRoot["image"].getString() ), false );
737 // Tiled indices start at 1; offsetting to compensate.
738 tilesetInfo.resize( tsRoot["tilecount"].getUInt() + 1 );
739 auto tileProperties = tsRoot["tileproperties"].getObject();
740 auto tiles = tsRoot["tiles"].getObject();
741 auto tileArray = tsRoot["tiles"].getArray();
742 for( size_t i = 1; i < tilesetInfo.size(); i++ ){
743 auto &ti = tilesetInfo[i];
744 auto t = tiles[std::to_string( i - 1 ).c_str()];
745 // Look up by integer id if key lookup fails.
746 if( !t ){
747 for( auto candidate : tileArray ){
748 if( candidate["id"].getUInt64() == i - 1 ){
749 t = candidate;
750 break;
751 }
752 }
753 }
754 auto tp = tileProperties[std::to_string( i - 1 ).c_str()];
755 // Support the new format, where "tiles" and
756 // "tileproperties" are combined.
757 if( !tp ) tp = t["properties"];
758 // Tiles initially become 0xB0 if "block" or 0xA0 otherwise.
759 ti = getProp(tp,"block").getBool() ? 0xB0 : 0xA0;
760 // Number of animation frames gets added to 0xA0 or 0xB0.
761 size_t ct = 0, id = 0, lastId = 0;
762 bool reverse = false;
763 for( auto f : t["animation"].getArray() ){
764 ct++;
765 id = f["tileid"].getUInt64();
766 if( id < lastId ) reverse = true;
767 lastId = id;
768 if( mapFps == 0.0 ){
769 mapFps = 1000.0 / (double)f["duration"].getInt();
770 }
771 }
772 // 2-8 frames (forward: 1-7, reverse: 8-E)
773 if( ct > 0 ){
774 ct--;
775 }
776 ti += ct + ( reverse ? 7 : 0 );
777 }
778 jsonFreeDocument( &tsDocument );
779 }
780
781 // Loop through map layers.
782 for( auto &l : info["layers"].getArray() ){
783 size_t width = l["width"].getUInt64();
784 size_t height = l["height"].getUInt64();
785
786 map.emplace_back();
787 MapLayer &layer = map.back();
788 layer.resize( height );
789
790 if( height > mapInfo.size() ){
791 mapInfo.resize( height );
792 }
793
794 size_t posX = 0, posY = 0;
795
796 if( height > 0 ){
797 // Loop through the layer's tiles.
798 for( auto &d : l["data"].getArray() ){
799 size_t idx = d.getInt();
800 layer[posY].push_back( idx );
801 // Only add to mapInfo as needed.
802 if( posX + 1 > mapInfo[posY].size() ){
803 mapInfo[posY].resize( posX + 1 );
804 }
805 if( tilesetInfo.size() > idx ){
806 auto &oldInfo = mapInfo[posY][posX];
807 auto newInfo = tilesetInfo[idx];
808 // Higher info values have more significant effects.
809 if( newInfo > oldInfo ){
810 oldInfo = newInfo;
811 }
812 }
813 posX++;
814 if( posX >= width ){
815 posX = 0;
816 posY++;
817 }
818 }
819 }
820
821 // Loop through the layer's objects.
822 for( auto &o : l["objects"].getArray() ){
823 entities.push_back( parseEntity( o, dataPath ) );
824 if( entities.back().type == "spawn" )
825 followEntity = entities.size() - 1;
826 }
827 }
828
829 jsonFreeDocument( &allocatedDocument );
830
831 #ifdef GRINNINGLIZARD_MICROPATHER_INCLUDED
832 // MicroPather does not have a destructor, so the size (acreage)
833 // of the first map should be similar to that of all subsequent
834 // maps loaded.
835 if( !pather ){
836 size_t allocate = mapInfo[0].size() * mapInfo.size() / 4;
837 if( allocate < 250 ){
838 allocate = 250;
839 }
840 // Parameters: class, allocation size, adjacent states, caching
841 pather = new micropather::MicroPather( this, allocate, 8, true );
842 }
843 #endif
844
845 recalculateMapEntities();
846 }
847
848 // Reset the map data.
849 void World::unloadMap(){
850 mapFile = "";
851
852 spriteRotationMat = linalg::rotation_matrix( fgl::eulerToQuat( 0.15, 0.0, 0.0 ) );
853
854 viewMat = linalg::pose_matrix(
855 fgl::eulerToQuat( 0.15, 0.0, 0.0 ),
856 linalg::vec<double,3>( 0.0, -0.23, 1.3 )
857 );
858
859 mapInfo.clear();
860 mapEntities.clear();
861 map.clear();
862 entities.clear();
863
864 mapChanged = false;
865
866 followEntity = -1;
867 facingEntity = -1;
868 }
869
870 void World::loadItems( std::string filePath ){
871 // Load the item table JSON file.
872 FILE* file = fopen( filePath.c_str(), "rb" );
873 if( !file ){
874 fprintf( stderr, "Failed to open %s\n", filePath.c_str() );
875 return;
876 }
877 std::string text = "";
878 char buf[4096];
879 while( size_t len = fread( buf, 1, sizeof( buf ), file ) ){
880 text += std::string( buf, len );
881 }
882 fclose( file );
883
884 // Parse the item table JSON file.
885 auto allocatedDocument = jsonAllocateDocumentEx( text.c_str(), text.size(), JSON_READER_ALL );
886
887 if( allocatedDocument.document.error.type != JSON_OK ){
888 fprintf( stderr, "JSON error: %s at line %lu:%lu of %s\n\n",
889 jsonGetErrorString( allocatedDocument.document.error.type ),
890 (long unsigned int)allocatedDocument.document.error.line,
891 (long unsigned int)allocatedDocument.document.error.column,
892 filePath.c_str() );
893 jsonFreeDocument( &allocatedDocument );
894 return;
895 }
896
897 // Store the items directory for loading constituent files.
898 std::string dataPath = filePath.substr( 0, filePath.find_last_of( '/' ) + 1 );
899
900 // Loop through the item definitions.
901 for( auto &itemDef : allocatedDocument.document.root.getObject() ){
902 std::string itemName = viewToString( itemDef.name );
903 std::string itemIcon = viewToString( itemDef.value["icon"].getString() );
904 std::map<std::string,int> itemRecipe, itemByproducts;
905 // Read the recipe.
906 for( auto &ingredient : itemDef.value["recipe"].getObject() ){
907 itemRecipe[viewToString( ingredient.name )] = ingredient.value.getInt();
908 }
909 // Read the byproducts.
910 for( auto &thing : itemDef.value["byproducts"].getObject() ){
911 itemByproducts[viewToString( thing.name )] = thing.value.getInt();
912 }
913 // Parse the entity.
914 auto entity = parseEntity( itemDef.value["entity"], dataPath );
915 if( entity.itemName.empty() ) entity.itemName = itemName;
916 if( !entity.sprite.success ){
917 // Entity is a no-go. Generate an entity with the item icon.
918 entity.sprite = getTexture( dataPath, itemIcon, false );
919 entity.width = entity.sprite.width;
920 entity.height = entity.sprite.height;
921 entity.type = "pickup";
922 entity.inventory.set( itemName, 1 );
923 entity.name = itemName;
924 }
925 // Add the item.
926 items[itemName] = {
927 getTexture( dataPath, itemIcon, false ),
928 itemDef.value["stack"] ? itemDef.value["stack"].getInt() : 1,
929 itemDef.value["flavor"].getInt(),
930 itemDef.value["appearance"].getInt(),
931 itemDef.value["sweetness"].getInt(),
932 itemDef.value["lactose"].getInt(),
933 itemDef.value["price"].getInt(),
934 itemDef.value["yield"].getInt(),
935 viewToString( itemDef.value["script"].getString() ),
936 itemRecipe,
937 itemByproducts,
938 entity
939 };
940 }
941
942 jsonFreeDocument( &allocatedDocument );
943 }
944
945 void World::deleteInventoryZeroes( Inventory &inv ){
946 // Delete zero-quantity items from the inventory.
947 for( auto it = inv.begin(); it != inv.end(); ){
948 if( it->second == 0 ){
949 it = inv.erase( it );
950 }else{
951 it++;
952 }
953 }
954 }
955
956 char World::craft(
957 int entIndex,
958 std::vector<std::string> itemNames,
959 int max_slots,
960 std::string &resultName ){
961
962 auto &ent = entities[entIndex];
963 // Find a recipe with the same ingredients.
964 std::string target = "";
965 resultName = "";
966 for( auto &itemInfo : items ){
967 if( itemInfo.second.recipe.size() == itemNames.size() ){
968 for( auto &name : itemNames ){
969 if( itemInfo.second.recipe.find( name )
970 == itemInfo.second.recipe.end() ){
971 // Mismatch.
972 goto nextItem;
973 }
974 }
975 target = itemInfo.first;
976 break;
977 }
978 nextItem:
979 continue;
980 }
981 if( target.length() > 0 ){
982 auto &recipe = items[target].recipe;
983 // Remove non-consumable items from the list.
984 for( size_t i = 0; i < itemNames.size(); i++ ){
985 auto &name = itemNames[i];
986 if( recipe[name] < 1 ){
987 // The recipe does not require a quantity of the item.
988 itemNames.erase( itemNames.begin() + i );
989 }else if( !ent.inventory.contains( name )
990 || ent.inventory.get( name ) < recipe[name] ){
991 // There is an insufficient quantity of the item.
992 return 'i';
993 }
994 }
995 ////////////////////////////////////////////////////////////////
996 // Add the target item and byproducts to an Inventory.
997 Inventory inv;
998 inv.set( target, items[target].yield );
999 for( auto &bp : items[target].byproducts ){
1000 inv.set( bp.first, bp.second );
1001 }
1002
1003 // Verify there will be enough space in the entity's inventory.
1004 Inventory future_inv = ent.inventory;
1005 for( std::string &name : itemNames ){
1006 future_inv.get( name ) -= recipe[name];
1007 }
1008 deleteInventoryZeroes( future_inv );
1009 if( !inventoryCanTakeAll( future_inv, inv, max_slots ) ){
1010 // There is insufficient space.
1011 return 'i';
1012 }
1013 // Good to go! Transfer items to the future inventory.
1014 transferInventory( inv, future_inv, max_slots );
1015 // The future is now the present.
1016 ent.inventory = future_inv;
1017 ////////////////////////////////////////////////////////////////
1018 // Check if there are sufficient ingredients for a second run.
1019 bool sufficient = true;
1020 for( auto &name : itemNames ){
1021 if( !ent.inventory.contains( name )
1022 || ent.inventory.get( name ) < recipe[name] ){
1023 // There is no longer enough to make another item.
1024 sufficient = false;
1025 }
1026 }
1027 ////////////////////////////////////////////////////////////////
1028 // Success.
1029 resultName = target;
1030 // Either we're good to continue or stuff is used up.
1031 return sufficient ? 'a' : 'b';
1032 }
1033 // No match.
1034 return 'n';
1035 }
1036
1037 std::string World::encodeInventory( Inventory inv ){
1038 std::string str_inv;
1039 size_t i = 0;
1040 for( auto &inv_item : inv ){
1041 str_inv += inv_item.first + ";" + std::to_string( inv_item.second );
1042 if( i < inv.size() - 1 ){
1043 str_inv += ",";
1044 }
1045 i++;
1046 }
1047 return str_inv;
1048 }
1049
1050 Inventory World::decodeInventory( std::string str_inv ){
1051 Inventory inv;
1052 auto AddItem = [&]( std::string item ){
1053 // Split an item declaration between name and count.
1054 size_t semi_at = item.find( ';' );
1055 std::pair<std::string,int> inv_item;
1056 if( semi_at > 0 && semi_at < item.size() - 1 ){
1057 inv_item = std::make_pair(
1058 item.substr( 0, semi_at ),
1059 (int)safeStold( item.substr( semi_at + 1 ) )
1060 );
1061 // Only add the item if the count is positive or negative.
1062 if( inv_item.second != 0 ){
1063 inv.push_back( inv_item );
1064 }
1065 }
1066 };
1067 size_t start = 0, end = 0;
1068 while( ( end = str_inv.find( ',', start ) ) != std::string::npos ){
1069 AddItem( str_inv.substr( start, end - start ) );
1070 start = end + 1;
1071 }
1072 AddItem( str_inv.substr( start ) );
1073 return inv;
1074 }
1075
1076 // inv_a can fit any one of the items from inv_b.
1077 bool World::inventoryCanTakeAny( Inventory &inv_a, Inventory &inv_b, int max_slots ){
1078 for( auto &item : inv_b ){
1079 if( item.second > 0 ){
1080 // The item has a positive quantity.
1081 if( inv_a.contains( item.first ) ){
1082 // The item already exists in inventory A.
1083 if( inv_a.get( item.first ) < items[item.first].stack ){
1084 // There is room on the stack.
1085 return true;
1086 }
1087 }else if( inv_a.size() < (size_t)max_slots ){
1088 // inv_a can fit the item in an empty slot.
1089 return true;
1090 }
1091 }
1092 }
1093 return false;
1094 }
1095
1096 // inv_a can fit all of the items from inv_b.
1097 bool World::inventoryCanTakeAll( Inventory &inv_a, Inventory &inv_b, int max_slots ){
1098 for( auto &item : inv_b ){
1099 if( item.second > 0 ){
1100 // The item has a positive quantity.
1101 if( inv_a.contains( item.first ) ){
1102 // The item already exists in inventory A.
1103 if( inv_a.get( item.first ) >= items[item.first].stack ){
1104 // No more room on the stack!
1105 return false;
1106 }
1107 }else if( inv_a.size() >= (size_t)max_slots ){
1108 // No more empty slots!
1109 return false;
1110 }
1111 }
1112 }
1113 return true;
1114 }
1115
1116 void World::transferInventory( Inventory &inv_a, Inventory &inv_b, int max_slots ){
1117 // Move all items possible from inv_a to inv_b.
1118 for( auto &item_a : inv_a ){
1119 if( item_a.second > 0 ){
1120 // item_a has a positive quantity.
1121 if( inv_b.contains( item_a.first ) ){
1122 // item_a already exists in inventory B.
1123 for( auto &item_b : inv_b ){
1124 if( item_a.first == item_b.first // Same item.
1125 && item_b.second < items[item_b.first].stack ){
1126 // There is room on the stack for more.
1127 int transfer_count = std::min( item_a.second,
1128 items[item_b.first].stack - item_b.second );
1129 // Put the items into inventory B.
1130 item_b.second += transfer_count;
1131 // Remove the items from inventory A.
1132 item_a.second -= transfer_count;
1133 }
1134 }
1135 }else{
1136 // Item does not yet exist in inventory B.
1137 if( (int)inv_b.size() < max_slots ){
1138 // Inventory B has a free slot.
1139 int transfer_count =
1140 std::min( item_a.second, items[item_a.first].stack );
1141 // Put the items into inv_b.
1142 inv_b.push_back( { item_a.first, transfer_count } );
1143 // Remove the items from inv_a.
1144 item_a.second -= transfer_count;
1145 }
1146 }
1147 }
1148 }
1149 deleteInventoryZeroes( inv_a );
1150 deleteInventoryZeroes( inv_b );
1151 }
1152
1153 JsonValue World::getProp( JsonValue parent, const char* prop ){
1154 auto p = parent[prop];
1155 // Hopefully p exists.
1156 if( p ) return p;
1157 // With the new map format, complexity increases exponentially.
1158 // Find the object for the property and return its value.
1159 auto a = parent.getArray();
1160 for( auto &candidate : a ){
1161 auto key = candidate["name"];
1162 // Does the object have a "name" field?
1163 if( key ){
1164 auto s = key.getString();
1165 // Does the object's name match prop?
1166 if( strncmp( s.data, prop, s.size ) == 0 )
1167 return candidate["value"];
1168 }
1169 }
1170 return p;
1171 }
1172
1173 Entity World::parseEntity( const JsonValueStruct &o, std::string dataPath ){
1174 std::string type = viewToString( o["type"].getString() );
1175 auto properties = o["properties"];
1176 std::string dialogueId = viewToString( getProp(properties,"dialogue").getString() );
1177 size_t pos = dialogueId.find_last_of( "/\\" );
1178 if( pos != std::string::npos ){
1179 dialogueId.erase( 0, pos + 1 );
1180 }
1181 std::string deathDialogueId = viewToString( getProp(properties,"deathDialogue").getString() );
1182 pos = deathDialogueId.find_last_of( "/\\" );
1183 if( pos != std::string::npos ){
1184 deathDialogueId.erase( 0, pos + 1 );
1185 }
1186 std::string bribeNewDialogueId = viewToString( getProp(properties,"bribeNewDialogue").getString() );
1187 pos = bribeNewDialogueId.find_last_of( "/\\" );
1188 if( pos != std::string::npos ){
1189 bribeNewDialogueId.erase( 0, pos + 1 );
1190 }
1191 double speed = getProp(properties,"speed").getDouble();
1192 // Default to 32px tile size if 0. TODO: This is not ideal.
1193 if( tileSize == 0 ) tileSize = 32;
1194 // Convert pixels to tile units.
1195 double x = o["x"].getDouble() / (double)tileSize;
1196 double y = o["y"].getDouble() / (double)tileSize - 1.0;
1197 bool staticCol = type == "static" || type == "sentry"
1198 || type == "flora" || type == "pickup" || type == "regrow";
1199 double collisionSize = getProp(properties,"collisionSize").getDouble();
1200 if( getProp(properties,"block").getBool() ){
1201 staticCol = true;
1202 if( !collisionSize ) collisionSize = (double)tileSize;
1203 }
1204 collisionSize *= 0.5 / (double)tileSize;
1205 double fps = getProp(properties,"fps").getDouble();
1206 int spriteWidth = getProp(properties,"spriteWidth").getInt();
1207 int spriteHeight = getProp(properties,"spriteHeight").getInt();
1208 // Return the entity.
1209 return {
1210 getTexture( dataPath, viewToString( getProp(properties,"spriteImage").getString() ), false ),
1211 getTexture( dataPath, viewToString( getProp(properties,"meleeSpriteImage").getString() ), false ),
1212 getTexture( dataPath, viewToString( getProp(properties,"bribeSpriteImage").getString() ), false ),
1213 getTexture( dataPath, viewToString( getProp(properties,"shadowImage").getString() ), true ),
1214 getTexture( dataPath, viewToString( getProp(properties,"sleepImage").getString() ), false ),
1215 viewToString( o["name"].getString() ),
1216 type,
1217 viewToString( getProp(properties,"itemName").getString() ),
1218 dialogueId,
1219 deathDialogueId,
1220 bribeNewDialogueId,
1221 viewToString( getProp(properties,"bribeSuccess").getString() ),
1222 viewToString( getProp(properties,"bribeFail").getString() ),
1223 decodeInventory( viewToString( getProp(properties,"inventory").getString() ) ),
1224 decodeInventory( viewToString( getProp(properties,"bribeItems").getString() ) ),
1225 speed ? speed : 3.0,
1226 1.0,
1227 x,
1228 y,
1229 x,
1230 y,
1231 collisionSize,
1232 fps ? fps : mapFps,
1233 getProp(properties,"meleeRecovery").getDouble(),
1234 getProp(properties,"age").getDouble(),
1235 0.0,
1236 0.0,
1237 0.0,
1238 false,
1239 staticCol,
1240 getProp(properties,"health").getInt(),
1241 getProp(properties,"money").getInt(),
1242 getProp(properties,"karma").getInt(),
1243 getProp(properties,"sweetTooth").getInt(),
1244 getProp(properties,"lactoseTolerance").getInt(),
1245 getProp(properties,"meleeDamage").getInt(),
1246 getProp(properties,"animationMode").getInt(),
1247 type == "corpse" ? TASK_SLEEP : TASK_NONE,
1248 getProp(properties,"direction").getInt(),
1249 spriteWidth ? spriteWidth : o["width"].getInt(),
1250 spriteHeight ? spriteHeight : o["height"].getInt(),
1251 {}
1252 };
1253 }
1254
1255 std::string World::serializeEntity( size_t idx ){
1256 Entity &ent = entities[idx];
1257 // Convert tile units to pixels.
1258 std::string str_x = std::to_string( (long long)( ent.x * (double)tileSize ) );
1259 std::string str_y = std::to_string( (long long)( ( ent.y + 1.0 ) * (double)tileSize ) );
1260 // Convert the entity's collision radius to a diameter in pixels.
1261 std::string str_col = std::to_string( ent.collisionRadius * 2.0 * (double)tileSize );
1262 // Prepend the dialogue folder to the file name if there is dialogue.
1263 std::string str_dialogue = ent.dialogue.size() ? ent.dialogue : "";
1264 std::string str_deathDialogue = ent.deathDialogue.size() ? ent.deathDialogue : "";
1265 std::string str_bribeNewDialogue = ent.bribeNewDialogue.size() ? ent.bribeNewDialogue : "";
1266 // Find the file names for the entity's textures.
1267 auto FindTextureName = [&]( fgl::Texture tex ){
1268 if( tex.success ){
1269 for( auto &img : images ){
1270 if( tex.texture == img.imageTexture.texture ){
1271 return img.imageName;
1272 }
1273 }
1274 }
1275 return std::string();
1276 };
1277 std::string str_meleesprite = FindTextureName( ent.meleeSprite );
1278 std::string str_bribesprite = FindTextureName( ent.bribeSprite );
1279 std::string str_shadow = FindTextureName( ent.shadow );
1280 std::string str_sprite = FindTextureName( ent.sprite );
1281 std::string str_sleep = FindTextureName( ent.sleep );
1282 // Put the entity's attributes into a string.
1283 return std::string( "{" )
1284 + "\n\"id\": " + std::to_string( idx ) + ","
1285 + "\n\"gid\": 1,"
1286 + "\n\"name\": \"" + ent.name + "\","
1287 + "\n\"type\": \"" + ent.type + "\","
1288 + "\n\"visible\": true,"
1289 + "\n\"x\": " + str_x + ","
1290 + "\n\"y\": " + str_y + ","
1291 + "\n\"width\": " + std::to_string( tileSize ) + ","
1292 + "\n\"height\": " + std::to_string( tileSize ) + ","
1293 + "\n\"properties\": {"
1294 + "\n \"age\": " + std::to_string( ent.age ) + ","
1295 + "\n \"animationMode\": " + std::to_string( ent.animationMode ) + ","
1296 + "\n \"block\": " + ( ent.staticCollisions && ent.collisionRadius > epsilon ? "true" : "false" ) + ","
1297 + "\n \"bribeFail\": \"" + ent.bribeFail + "\","
1298 + "\n \"bribeItems\": \"" + encodeInventory( ent.bribeItems ) + "\","
1299 + "\n \"bribeNewDialogue\": \"" + str_bribeNewDialogue + "\","
1300 + "\n \"bribeSpriteImage\": \"" + str_bribesprite + "\","
1301 + "\n \"bribeSuccess\": \"" + ent.bribeSuccess + "\","
1302 + "\n \"collisionSize\": " + str_col + ","
1303 + "\n \"deathDialogue\": \"" + str_deathDialogue + "\","
1304 + "\n \"dialogue\": \"" + str_dialogue + "\","
1305 + "\n \"direction\": " + std::to_string( ent.direction ) + ","
1306 + "\n \"fps\": " + std::to_string( ent.fps ) + ","
1307 + "\n \"health\": " + std::to_string( ent.health ) + ","
1308 + "\n \"inventory\": \"" + encodeInventory( ent.inventory ) + "\","
1309 + "\n \"itemName\": \"" + ent.itemName + "\","
1310 + "\n \"karma\": " + std::to_string( ent.karma ) + ","
1311 + "\n \"lactoseTolerance\": " + std::to_string( ent.lactoseTolerance ) + ","
1312 + "\n \"meleeDamage\": " + std::to_string( ent.meleeDamage ) + ","
1313 + "\n \"meleeRecovery\": " + std::to_string( ent.meleeRecovery ) + ","
1314 + "\n \"meleeSpriteImage\": \"" + str_meleesprite + "\","
1315 + "\n \"money\": " + std::to_string( ent.money ) + ","
1316 + "\n \"shadowImage\": \"" + str_shadow + "\","
1317 + "\n \"sleepImage\": \"" + str_sleep + "\","
1318 + "\n \"speed\": " + std::to_string( ent.speed ) + ","
1319 + "\n \"spriteHeight\": " + std::to_string( ent.height ) + ","
1320 + "\n \"spriteImage\": \"" + str_sprite + "\","
1321 + "\n \"spriteWidth\": " + std::to_string( ent.width ) + ","
1322 + "\n \"sweetTooth\": " + std::to_string( ent.sweetTooth )
1323 + "\n},"
1324 + "\n\"propertytypes\": {"
1325 + "\n \"age\": \"float\","
1326 + "\n \"animationMode\": \"int\","
1327 + "\n \"block\": \"bool\","
1328 + "\n \"bribeFail\": \"string\","
1329 + "\n \"bribeItems\": \"string\","
1330 + "\n \"bribeNewDialogue\": \"file\","
1331 + "\n \"bribeSpriteImage\": \"file\","
1332 + "\n \"bribeSuccess\": \"string\","
1333 + "\n \"collisionSize\": \"float\","
1334 + "\n \"deathDialogue\": \"file\","
1335 + "\n \"dialogue\": \"file\","
1336 + "\n \"direction\": \"int\","
1337 + "\n \"fps\": \"float\","
1338 + "\n \"health\": \"int\","
1339 + "\n \"inventory\": \"string\","
1340 + "\n \"itemName\": \"string\","
1341 + "\n \"karma\": \"int\","
1342 + "\n \"lactoseTolerance\": \"int\","
1343 + "\n \"meleeDamage\": \"int\","
1344 + "\n \"meleeRecovery\": \"float\","
1345 + "\n \"meleeSpriteImage\": \"file\","
1346 + "\n \"money\": \"int\","
1347 + "\n \"shadowImage\": \"file\","
1348 + "\n \"sleepImage\": \"file\","
1349 + "\n \"speed\": \"float\","
1350 + "\n \"spriteHeight\": \"int\","
1351 + "\n \"spriteImage\": \"file\","
1352 + "\n \"spriteWidth\": \"int\","
1353 + "\n \"sweetTooth\": \"int\""
1354 + "\n}"
1355 + "\n}";
1356 }
1357
1358 void World::saveMap( std::string filePath ){
1359 std::string result = std::string( "{" )
1360 + "\n\"tiledversion\": \"1.0.3\"," // Change this as necessary.
1361 + "\n\"version\": 1,"
1362 + "\n\"type\": \"map\","
1363 + "\n\"orientation\": \"orthogonal\","
1364 + "\n\"renderorder\": \"right-down\","
1365 + "\n\"width\": " + std::to_string( mapInfo[0].size() ) + ","
1366 + "\n\"height\": " + std::to_string( mapInfo.size() ) + ","
1367 + "\n\"tilewidth\": " + std::to_string( tileSize ) + ","
1368 + "\n\"tileheight\": " + std::to_string( tileSize ) + ","
1369 + "\n\"nextobjectid\": " + std::to_string( entities.size() ) + ","
1370 + "\n\"tilesets\": [{"
1371 + "\n\"firstgid\": 1," // May change to 0 in later Tiled versions.
1372 + "\n\"source\": \"" + tilesetDefinition + "\""
1373 + "\n}],"
1374 + "\n\"layers\": [\n";
1375 size_t layerIndex = 0;
1376 for( auto &layer : map ){
1377 if( layer.empty() ){
1378 continue;
1379 }
1380 layerIndex++;
1381 result += std::string( "{" )
1382 + "\n\"name\": \"Tile Layer " + std::to_string( layerIndex ) + "\","
1383 + "\n\"type\": \"tilelayer\","
1384 + "\n\"visible\": true,"
1385 + "\n\"opacity\": 1,"
1386 + "\n\"x\": 0,"
1387 + "\n\"y\": 0,"
1388 + "\n\"width\": " + std::to_string( layer[0].size() ) + ","
1389 + "\n\"height\": " + std::to_string( layer.size() ) + ","
1390 + "\n\"data\": [\n";
1391 for( size_t y = 0; y < layer.size(); y++ ){
1392 auto &row = layer[y];
1393 for( size_t x = 0; x < row.size(); x++ ){
1394 result += std::to_string( row[x] );
1395 if( x < row.size() - 1 || y < layer.size() - 1 ){
1396 result += ", ";
1397 }
1398 }
1399 }
1400 result += "\n]\n},\n";
1401 }
1402 result += std::string( "{" )
1403 + "\n\"name\": \"Object Layer 1\","
1404 + "\n\"type\": \"objectgroup\","
1405 + "\n\"visible\": true,"
1406 + "\n\"opacity\": 1,"
1407 + "\n\"x\": 0,"
1408 + "\n\"y\": 0,"
1409 + "\n\"draworder\": \"topdown\","
1410 + "\n\"objects\": [\n";
1411 for( size_t i = 0; i < entities.size(); i++ ){
1412 result += serializeEntity( i );
1413 if( i < entities.size() - 1 ){
1414 result += ",\n";
1415 }
1416 }
1417 result += "]\n}\n]\n}\n";
1418
1419 // Save the map JSON file.
1420 FILE* file = fopen( filePath.c_str(), "wb" );
1421 if( file ){
1422 // Treat the file as a regular string for string-like output.
1423 fputs( result.c_str(), file );
1424 fclose( file );
1425 }else{
1426 fprintf( stderr, "Failed to open %s for writing\n", filePath.c_str() );
1427 }
1428 }
1429
1430 void World::drawSprite( fgl::Texture &tex, double posX, double posY, double imageScale, int sourceX, int sourceY, int sourceW, int sourceH, bool bind ){
1431 bool flipX = false, flipY = false;
1432 if( sourceW < 0 ){
1433 sourceW *= -1;
1434 flipX = true;
1435 }
1436 if( sourceH < 0 ){
1437 sourceH *= -1;
1438 flipY = true;
1439 }
1440 posX += (double)sourceW * 0.5 * imageScale;
1441 posY += (double)sourceH * 0.5 * imageScale;
1442 fgl::texMatrix = linalg::mul(
1443 linalg::translation_matrix( linalg::vec<double,3>(
1444 (double)sourceX / (double)tex.width + 0.0001,
1445 (double)sourceY / (double)tex.height + 0.0001,
1446 0.0
1447 ) ),
1448 linalg::scaling_matrix( linalg::vec<double,3>(
1449 (double)sourceW / (double)tex.width * ( flipX ? -0.995 : 0.995 ),
1450 (double)sourceH / (double)tex.height * ( flipY ? -0.995 : 0.995 ),
1451 1.0
1452 ) )
1453 );
1454 linalg::mat<double,4,4> m = linalg::mul(
1455 linalg::translation_matrix( linalg::vec<double,3>(
1456 posX / (double)screenHeight * 2.0 - (double)screenWidth / (double)screenHeight,
1457 posY / (double)screenHeight * -2.0 + 1.0,
1458 bind ? (double)sourceH * imageScale / (double)screenHeight * 0.099 : 0.0
1459 ) ),
1460 linalg::mul(
1461 bind ? spriteRotationMat : linalg::identity,
1462 linalg::scaling_matrix( linalg::vec<double,3>(
1463 (double)( sourceW + 1 ) / (double)screenHeight * imageScale * 2.0,
1464 (double)( sourceH + 1 ) / (double)screenHeight * imageScale * 2.0,
1465 1.0
1466 ) )
1467 )
1468 );
1469 if( bind ){
1470 // Draw directly.
1471 if( !tex.success ) return;
1472 fgl::setTexture( tex, 0 );
1473 fgl::drawMesh(
1474 fgl::planeMesh,
1475 m,
1476 //linalg::identity,
1477 viewMat,
1478 //linalg::scaling_matrix( linalg::vec<double,3>( (double)screenHeight / (double)screenWidth, 1.0, 1.0 ) )
1479 linalg::perspective_matrix( 68.5 * 0.01745, (double)screenWidth / (double)screenHeight, 0.1, 44.0 )
1480 );
1481 fgl::texMatrix = linalg::identity;
1482 }else{
1483 // Draw instanced.
1484 instanceBuf.push( fgl::fogColor, m );
1485 }
1486 }
1487
1488 bool World::cursorOverSprite( double posX, double posY, double spriteScale, double sourceW, double sourceH ){
1489 // Perform the same transformations drawSprite does.
1490 auto modelMat = linalg::mul(
1491 linalg::translation_matrix( linalg::vec<double,3>(
1492 ( posX + sourceW * 0.5 * spriteScale ) / (double)screenHeight * 2.0 - (double)screenWidth / (double)screenHeight,
1493 ( posY + sourceH * 0.5 * spriteScale ) / (double)screenHeight * -2.0 + 1.0,
1494 sourceH * spriteScale / (double)screenHeight * 0.099
1495 ) ),
1496 linalg::mul(
1497 spriteRotationMat,
1498 linalg::scaling_matrix( linalg::vec<double,3>(
1499 ( sourceW + 1.0 ) / (double)screenHeight * spriteScale * 2.0,
1500 ( sourceH + 1.0 ) / (double)screenHeight * spriteScale * 2.0,
1501 1.0
1502 ) )
1503 )
1504 );
1505 auto projMat = linalg::perspective_matrix( 68.5 * 0.01745, (double)screenWidth / (double)screenHeight, 0.1, 44.0 );
1506 auto mvpMat = linalg::mul( projMat, linalg::mul( linalg::inverse( viewMat ), modelMat ) );
1507 // Transform sprite corners the same way OpenGL does.
1508 auto topLeft = linalg::mul( mvpMat, linalg::vec<double,4>( -0.5, 0.5, 0.0, 1.0 ) );
1509 topLeft /= topLeft.w;
1510 auto bottomRight = linalg::mul( mvpMat, linalg::vec<double,4>( 0.5, -0.5, 0.0, 1.0 ) );
1511 bottomRight /= bottomRight.w;
1512 double
1513 x0 = ( topLeft.x + 1.0 ) * 0.5 * (double)screenWidth,
1514 y0 = ( 1.0 - topLeft.y ) * 0.5 * (double)screenHeight,
1515 x1 = ( bottomRight.x + 1.0 ) * 0.5 * (double)screenWidth,
1516 y1 = ( 1.0 - bottomRight.y ) * 0.5 * (double)screenHeight;
1517 // Compare with the cursor position.
1518 return cursorX >= x0 && cursorY >= y0 && cursorX < x1 && cursorY < y1;
1519 }
1520
1521 void World::calculateWorldCursor(){
1522 // https://www.gamedev.net/forums/topic/323817-ray-plane-intersection-and-ray-triangle-intersection/
1523 // https://antongerdelan.net/opengl/raycasting.html
1524 // https://www.physicsforums.com/threads/what-does-this-mean-when-it-is-over-a-value.406598/
1525 // https://en.wikipedia.org/wiki/Line–plane_intersection
1526 // https://en.wikipedia.org/wiki/Vector_notation
1527 // https://www.cs.princeton.edu/courses/archive/fall00/cs426/lectures/raycast/sld008.htm
1528 // https://www.cs.princeton.edu/courses/archive/fall00/cs426/lectures/raycast/sld017.htm
1529 // https://sites.math.washington.edu/~king/coursedir/m445w04/notes/vector/equations.html
1530 // https://www.songho.ca/math/plane/plane.html
1531
1532 // Get the projection matrix.
1533 auto projMat = linalg::perspective_matrix( 68.5 * 0.01745, (double)screenWidth / (double)screenHeight, 0.1, 44.0 );
1534
1535 // Transform screen coordinates to clip coordinates.
1536 double cursorClipX = ( 2.0 * cursorX ) / (double)screenWidth - 1.0;
1537 double cursorClipY = 1.0 - ( 2.0 * cursorY ) / (double)screenHeight;
1538
1539 // Eye ray part 1. Multiply inverse projection matrix by (modified) clip coordinates.
1540 auto eyeRay = linalg::mul(
1541 linalg::inverse( projMat ),
1542 linalg::vec<double,4>( cursorClipX, -1.0 * cursorClipY, -1.0, 1.0 )
1543 );
1544
1545 // Eye ray part 2. Set ray Z and W coordinates to -1.0 and 0.0.
1546 eyeRay = linalg::vec<double,4>( eyeRay.x, eyeRay.y, -1.0, 0.0 );
1547
1548 // World ray V is inverse view matrix * eye ray.
1549 auto V = linalg::mul(
1550 linalg::inverse( viewMat ),
1551 eyeRay
1552 ).xyz();
1553
1554 // Normalize world ray.
1555 V = linalg::normalize( V );
1556
1557 // Ray origin.
1558 auto O = viewMat[3].xyz();
1559
1560 // P points along the plane.
1561 auto P = linalg::vec<double,3>( 0.0, 1.0, 0.0 );
1562
1563 // Plane normal points away from camera.
1564 auto N = linalg::vec<double,3>( 0.0, 0.0, -1.0 );
1565
1566 double d = -1.0 * linalg::dot( P, N );
1567
1568 // Length of ray to intersection.
1569 double t = -1.0 * ( linalg::dot( O, N ) + d ) / linalg::dot( V, N );
1570
1571 auto worldCursor = O + V * linalg::vec<double,3>( 1.0, -1.0, 1.0 ) * t;
1572
1573 double tilesPerScreen = (double)screenHeight / scale / (double)tileSize;
1574
1575 cursorWorldX = worldCursor.x * tilesPerScreen * 0.5 + cameraX;
1576 cursorWorldY = worldCursor.y * tilesPerScreen * -0.5 + cameraY;
1577 }
1578
1579 void World::drawMapLayer( size_t pos ){
1580 if( tileset.width < 1 ){
1581 fprintf( stderr, "Cannot draw map without a valid tileset image.\n" );
1582 fgl::end();
1583 }
1584
1585 // 840 is evenly divisible by everything here.
1586 int f = std::fmod( runningTime, 840.0 / mapFps ) * mapFps;
1587 int animOffsets[16] = {
1588 0,
1589 f % 2,
1590 f % 3,
1591 f % 4,
1592 f % 5,
1593 f % 6,
1594 f % 7,
1595 f % 8,
1596 0 - ( f % 2 ),
1597 0 - ( f % 3 ),
1598 0 - ( f % 4 ),
1599 0 - ( f % 5 ),
1600 0 - ( f % 6 ),
1601 0 - ( f % 7 ),
1602 0 - ( f % 8 ),
1603 0 // TODO: Animation that skips tiles.
1604 };
1605
1606 double offsetX = (double)screenWidth * 0.5 - cameraX * (double)tileSize * scale;
1607 double offsetY = (double)screenHeight * 0.5 - cameraY * (double)tileSize * scale;
1608
1609 double tileScreenSize = (double)tileSize * scale;
1610 double tileScreenScale = std::ceil( tileScreenSize ) / tileSize;
1611
1612 // Switch to the unlit instance pipeline.
1613 fgl::Pipeline old_pipeline = fgl::drawPipeline;
1614 fgl::setPipeline( fgl::unlitInstancePipeline );
1615
1616 fgl::setTexture( tileset, 0 );
1617
1618 MapLayer &layer = map[pos];
1619
1620 if( pos == 0 ){
1621 // For performance.
1622 glDisable( GL_BLEND );
1623 }else{
1624 glEnable( GL_BLEND );
1625 }
1626
1627 for( size_t y = 0; y < layer.size(); y++ ){
1628 double tileScreenY = (double)y * tileScreenSize + offsetY;
1629 if( tileScreenY + tileScreenSize > 0 && tileScreenY < screenHeight ){
1630 for( size_t x = 0; x < layer[y].size(); x++ ){
1631 double tileScreenX = (double)x * tileScreenSize + offsetX;
1632 if( tileScreenX + tileScreenSize > 0 && tileScreenX < screenWidth ){
1633 int tileNum = layer[y][x] - 1;
1634 if( tileNum > 0 ){
1635 auto ti = mapInfo[y][x];
1636 if( ti >= 0xA0 && ti < 0xC0 ){
1637 ti -= ti >= 0xB0 ? 0xB0 : 0xA0;
1638 tileNum += animOffsets[ti];
1639 }
1640 drawSprite(
1641 tileset,
1642 tileScreenX,
1643 tileScreenY,
1644 tileScreenScale,
1645 ( tileNum * tileSize ) % tileset.width,
1646 std::floor( tileNum * tileSize / tileset.width ) * tileSize,
1647 tileSize,
1648 tileSize,
1649 false // Turning rebind off enables instancing.
1650 );
1651 }
1652 }
1653 }
1654 }
1655 }
1656
1657 // Disable fog for the unlit instance pipeline.
1658 fgl::Color old_fog = fgl::fogColor;
1659 fgl::setFog( { 0.0f, 0.0f, 0.0f, 0.0f } );
1660
1661 // Draw and clear the instance buffer.
1662 instanceBuf.upload();
1663 auto projMat = linalg::perspective_matrix( 68.5 * 0.01745, (double)screenWidth / (double)screenHeight, 0.1, 44.0 );
1664 instanceBuf.draw( fgl::planeMesh, viewMat, projMat );
1665 instanceBuf.clear();
1666
1667 // Set fog to its old color.
1668 fgl::setFog( old_fog );
1669
1670 // Switch to the old pipeline.
1671 fgl::setPipeline( old_pipeline );
1672 }
1673
1674 void World::moveEntity( Entity &ent, double moveX, double moveY, double d ){
1675 // Infer stick-based movement if axis measurements are non-uniform.
1676 bool use_stick =
1677 ( std::abs( moveX ) > epsilon && std::abs( moveX ) < 1.0 ) ||
1678 ( std::abs( moveY ) > epsilon && std::abs( moveY ) < 1.0 );
1679 auto newVec = linalg::vec<double,2>( moveX, moveY );
1680 if( linalg::length( newVec ) > epsilon ){
1681 ent.walking = true;
1682 newVec = linalg::normalize( newVec );
1683 ent.x += newVec.x * ent.speed * ent.speedFactor * d;
1684 ent.y += newVec.y * ent.speed * ent.speedFactor * d;
1685 }else if( ent.path.size() == 0 ){
1686 ent.walking = false;
1687 if( ent.animationMode != ANIMATION_AUTOPLAY
1688 && ent.task != TASK_MELEE ){
1689 ent.frame = 0.0;
1690 }
1691 }
1692
1693 if( ent.animationMode == ANIMATION_RPG && use_stick ){
1694 // RPG movement with a joystick.
1695 ent.direction = xyToDirection( newVec.x, newVec.y );
1696 }else if( ent.animationMode == ANIMATION_RPG ){
1697 // RPG movement with digital directions.
1698 auto oldVec = linalg::vec<double,2>( 0.0, 0.0 );
1699 switch( ent.direction ){
1700 case 3: oldVec = { -1.0, 0.0 };
1701 break;
1702 case 2: oldVec = { 1.0, 0.0 };
1703 break;
1704 case 1: oldVec = { 0.0, 1.0 };
1705 break;
1706 case 0: oldVec = { 0.0, -1.0 };
1707 }
1708 // https://www.euclideanspace.com/maths/algebra/vectors/angleBetween/
1709 if( std::acos( linalg::dot( oldVec, newVec ) ) >= 3.14 * 0.5 ){
1710 // There is at least a 90 degree angular distance.
1711 if( newVec.x < -epsilon ) ent.direction = 3;
1712 if( newVec.x > epsilon ) ent.direction = 2;
1713 if( newVec.y > epsilon ) ent.direction = 1;
1714 if( newVec.y < -epsilon ) ent.direction = 0;
1715 }
1716 }else if( ent.animationMode == ANIMATION_BEATEMUP ){
1717 // Beat-em-up movement.
1718 if( newVec.x < -epsilon ){
1719 ent.direction = 3;
1720 }
1721 if( newVec.x > epsilon ){
1722 ent.direction = 2;
1723 }
1724 }
1725 }
1726
1727 // Physics handling.
1728 void World::simulate( double d ){
1729 // It's a cheap trick, but we're storing the length of the name of
1730 // the faced entity and prioritizing entities with longer names.
1731 size_t name_length = 0;
1732
1733 // Reset facingEntity.
1734 facingEntity = -1;
1735
1736 // Keep track of how long the simulation has been running.
1737 runningTime += d;
1738
1739 // Handle entity movement and collisions, then store a list of
1740 // depths and indices.
1741 entityIndices.clear();
1742 for( size_t i = 0; i < entities.size(); i++ ){
1743 Entity &e = entities[i];
1744 // Decrement the entity's stun timer. For use in other source files.
1745 e.stun = std::max( e.stun - d, 0.0 );
1746 // Increment the entity's age if it's not in manual animation mode.
1747 if( e.animationMode != ANIMATION_MANUAL ){
1748 e.age += d;
1749 }
1750 if( e.task == TASK_MELEE ){
1751 // 3-frame animation for melee.
1752 e.frame = std::min( e.frame + e.fps * d, 2.0 );
1753 }else if( e.animationMode == ANIMATION_AUTOPLAY ){
1754 // 4-frame animation cycle for autoplay.
1755 e.frame = std::fmod( e.frame + e.fps * d, 4.0 );
1756 }
1757 if( !e.staticCollisions ){
1758
1759 #ifdef GRINNINGLIZARD_MICROPATHER_INCLUDED
1760 if( e.path.size() > 0 ){
1761 // Get entity position.
1762 intptr_t entX = e.x + 0.5, entY = e.y + 0.5;
1763
1764 // Get next tile position.
1765 size_t n;
1766 intptr_t nextX = entX, nextY = entY;
1767
1768 // Check up to 5 tiles to avoid breakage on diagonal
1769 // movement.
1770 static const intptr_t
1771 xOff[5] = { 0, 1, -1, 0, 0 },
1772 yOff[5] = { 0, 0, 0, 1, -1 };
1773
1774 for( int j = 0; j < 5; j++ ){
1775 intptr_t currentX = entX + xOff[j], currentY = entY + yOff[j];
1776 if( currentX < 0 ) currentX = 0;
1777 if( currentY < 0 ) currentY = 0;
1778 if( currentX > (intptr_t)mapInfo[0].size() - 1 ) currentX = mapInfo[0].size() - 1;
1779 if( currentY > (intptr_t)mapInfo.size() - 1 ) currentY = mapInfo.size() - 1;
1780
1781 auto currentNode = XYToNode( currentX, currentY );
1782
1783 for( n = 0; n < e.path.size(); n++ ){
1784 if( e.path[n] == currentNode ){
1785 break;
1786 }
1787 }
1788
1789 if( n + 1 < e.path.size() ){
1790 NodeToXY( e.path[n + 1], &nextX, &nextY );
1791 break;
1792 }
1793 }
1794
1795 // Walk towards the next tile.
1796 double moveX = 0.0, moveY = 0.0;
1797 if( nextX > entX ) moveX += 1.0;
1798 if( nextX < entX ) moveX -= 1.0;
1799 if( nextY > entY ) moveY += 1.0;
1800 if( nextY < entY ) moveY -= 1.0;
1801 if( std::sqrt( moveX * moveX + moveY * moveY ) < epsilon ) e.path.clear();
1802 moveEntity( e, moveX, moveY, d );
1803 }
1804 #endif
1805
1806 entityCollisions( i );
1807 if( e.walking ){
1808 e.frame = std::fmod( e.frame + e.fps * d, 4.0 );
1809 }
1810 }
1811 // Push the index to the array for depth sorting.
1812 entityIndices.push_back( { e.y, (long long)i, &e } );
1813
1814 // Handle player interactions.
1815 if( followEntity >= 0 && i != (size_t)followEntity ){
1816 Entity &player = entities[followEntity];
1817 // Determine which entity the player is facing.
1818 if( ( facingEntity == -1 || e.name.length() >= name_length )
1819 && entityFacing( player, e ) ){
1820 name_length = e.name.length();
1821 facingEntity = i;
1822 }
1823 // Portals.
1824 if( portalCallback
1825 && std::abs( player.x - e.x ) < 0.5
1826 && std::abs( player.y - e.y ) < 0.5
1827 && e.type.length() >= 6
1828 && e.type.substr( 0, 6 ) == "portal" ){
1829 std::string param =
1830 e.type.length() >= 8 ? e.type.substr( 7 ) : "";
1831 (*portalCallback)( param );
1832 }
1833 }
1834 }
1835
1836 // Set followEntity to -1 for a free-moving camera.
1837 if( followEntity >= 0 && entities.size() >= 1 ){
1838 cameraX = entities[followEntity].x + 0.5;
1839 cameraY = entities[followEntity].y + 0.5;
1840 }
1841 }
1842
1843 // Draw the tiles.
1844 void World::drawMap(){
1845 for( size_t i = 0; i < map.size(); i++ ){
1846 drawMapLayer( i );
1847 }
1848 }
1849
1850 // Draw the entities.
1851 void World::drawEntities( const std::vector<Entity> &extraEntities ){
1852 for( const Entity &e : extraEntities ){
1853 // Push the index to the array for depth sorting, using the
1854 // interpolated position.
1855 entityIndices.push_back( { e.last_y, -1, (Entity*)&e } );
1856 }
1857
1858 // sort-em-up
1859 std::sort( entityIndices.begin(), entityIndices.end(),
1860 []( const EntityIndex &a, const EntityIndex &b ){
1861 return a.depth < b.depth;
1862 } );
1863
1864 calculateWorldCursor();
1865
1866 cursorOverEntity = -1;
1867
1868 // Calculate a screen margin of 3 tiles.
1869 double margin = tileSize * scale * 3.0;
1870
1871 glEnable( GL_BLEND );
1872 for( EntityIndex &ei : entityIndices ){
1873 Entity &e = *ei.ptr;
1874 // Point sentries at followEntity.
1875 if( ( e.animationMode == ANIMATION_RPG
1876 || e.animationMode == ANIMATION_BEATEMUP
1877 ) && followEntity >= 0 && e.staticCollisions
1878 && e.type == "sentry" ){
1879 entityLookAt( e, entities[followEntity] );
1880 }
1881 // Align the view position with the follow target if applicable.
1882 double screenX, screenY;
1883 if( ei.pos >= 0 && (int)ei.pos == followEntity ){
1884 screenX = ( screenWidth - (int)std::floor( (double)tileSize * scale ) ) / 2;
1885 screenY = screenHeight / 2 - (int)std::floor( ( e.height - (double)tileSize * 0.5 ) * scale );
1886 }else{
1887 // Show the interpolated positions for extraEntities.
1888 double x = ei.pos == -1 ? e.last_x : e.x;
1889 double y = ei.pos == -1 ? e.last_y : e.y;
1890 screenX = ( x - cameraX ) * (double)tileSize * scale + (double)screenWidth * 0.5;
1891 screenY = ( y - cameraY - (double)e.height / (double)tileSize + 1.0 ) * (double)tileSize * scale + (double)screenHeight * 0.5;
1892 }
1893 // Only draw on-screen entities within the margin.
1894 if( screenX < screenWidth + margin && screenY < screenHeight + margin
1895 && screenX + e.width >= -margin && screenY + e.height >= -margin ){
1896 if( e.task == TASK_SLEEP ){
1897 // Entity is sleeping.
1898 screenX += ( e.sleep.width - tileSize ) * -0.5 * scale;
1899 screenY += ( e.height - (double)tileSize ) * scale;
1900 drawSprite(
1901 e.sleep,
1902 screenX,
1903 screenY,
1904 scale,
1905 0,
1906 0,
1907 e.sleep.width,
1908 e.sleep.height
1909 );
1910 if( cursorOverSprite( screenX, screenY, scale, tileSize, tileSize ) ){
1911 cursorOverEntity = ei.pos;
1912 }
1913 }else{
1914 // Entity is not sleeping.
1915 drawSprite(
1916 e.shadow,
1917 screenX - ( e.shadow.width - tileSize ) * 0.5 * scale,
1918 screenY + ( e.height - (double)tileSize ) * scale,
1919 scale,
1920 0,
1921 0,
1922 e.shadow.width,
1923 e.shadow.height
1924 );
1925 int entityFrame =
1926 e.task == TASK_MELEE ? (int)e.frame
1927 : [&](){
1928 switch( (int)std::ceil( e.frame ) ){
1929 case 1: return 1;
1930 case 2: return 0;
1931 case 3: return 2;
1932 default: return 0; // 4 or 0.
1933 }
1934 }();
1935 int scrollX = 0, scrollY = 0;
1936 int spriteWidth = e.width, spriteHeight = e.height;
1937 switch( e.animationMode ){
1938 case ANIMATION_RPG: // RPG style.
1939 scrollX = e.direction * e.width;
1940 scrollY = entityFrame * e.height;
1941 break;
1942 case ANIMATION_BEATEMUP: // Beat-em-up style.
1943 entityFrame = (int)std::ceil( e.frame ) % 4;
1944 if( entityFrame == 3 ){
1945 entityFrame = 1;
1946 }
1947 scrollX = entityFrame * e.width;
1948 if( e.direction == 3 ){
1949 scrollX += spriteWidth;
1950 spriteWidth *= -1;
1951 }
1952 break;
1953 default: // Left-to-right animation with 4 frames.
1954 scrollX = ( (int)std::ceil( e.frame ) % 4 ) * e.width;
1955 if( e.direction == 3 ){
1956 scrollX += spriteWidth;
1957 spriteWidth *= -1;
1958 }
1959 }
1960 // Select a sprite based on the entity's task.
1961 drawSprite(
1962 e.task == TASK_MELEE ? e.meleeSprite : e.sprite,
1963 screenX - ( e.width - tileSize ) * 0.5 * scale,
1964 screenY,
1965 scale,
1966 scrollX,
1967 scrollY,
1968 spriteWidth,
1969 spriteHeight
1970 );
1971 if( cursorOverSprite( screenX, screenY, scale, tileSize, spriteHeight ) ){
1972 cursorOverEntity = ei.pos;
1973 }
1974 }
1975 }
1976 }
1977 }
1978
1979 // Simulate and draw everything. This is enough in some situations.
1980 void World::draw( double d ){
1981 simulate( d );
1982 drawMap();
1983 drawEntities();
1984 }
1985
1986 // Remove an entity from the world.
1987 void World::removeEntity( int entity_index ){
1988 auto &ent = entities[entity_index];
1989 // If the entity has a collision radius and static collisions,
1990 // recalculate the map's collision data.
1991 if( std::abs( ent.collisionRadius ) > epsilon
1992 && ent.staticCollisions ){
1993 recalculateMapEntities();
1994 }else{
1995 // No collisions? Then just set it to the info value.
1996 long long
1997 x = ent.x + 0.5,
1998 y = ent.y + 0.5;
1999 if( x < 0 ){
2000 x = 0;
2001 }else if( x > (long long)mapInfo[0].size() ){
2002 x = (long long)mapInfo[0].size();
2003 }
2004 if( y < 0 ){
2005 y = 0;
2006 }else if( y > (long long)mapInfo.size() ){
2007 y = (long long)mapInfo.size();
2008 }
2009 mapEntities[y][x] = mapInfo[y][x];
2010 }
2011 entities.erase( entities.begin() + entity_index );
2012 // Lower the followEntity index by 1 if necessary.
2013 if( followEntity > entity_index ){
2014 followEntity--;
2015 }
2016 // This flag signals that memory has changed and caution should be exercised.
2017 mapChanged = true;
2018 }
2019
2020 void World::tileCollisions( Entity &ent ){
2021 bool
2022 b00 = tileBlocking( (long long)ent.x, (long long)ent.y ),
2023 b10 = tileBlocking( (long long)ent.x + 1, (long long)ent.y ),
2024 b01 = tileBlocking( (long long)ent.x, (long long)ent.y + 1 ),
2025 b11 = tileBlocking( (long long)ent.x + 1, (long long)ent.y + 1);
2026 if( b01 && b10 ){ // ascending diagonal blocks
2027 if( ent.x - std::floor( ent.x ) < 0.5 )
2028 b11 = true;
2029 else
2030 b00 = true;
2031 }
2032 if( b00 && b11 ){ // descending diagonal blocks
2033 if( ent.x - std::floor( ent.x ) < 0.5 )
2034 b10 = true;
2035 else
2036 b01 = true;
2037 }
2038 bool checked = false;
2039 if( b00 && b10 ){ // wall above entity
2040 double overlap = ( std::floor( ent.y ) + 0.5 ) - ( ent.y - ent.collisionRadius );
2041 if( overlap > 0.0 ) ent.y += overlap;
2042 checked = true;
2043 }
2044 if( b01 && b11 ){ // wall below entity
2045 double overlap = ( ent.y + ent.collisionRadius ) - ( std::floor( ent.y ) + 0.5 );
2046 if( overlap > 0.0 ) ent.y -= overlap;
2047 checked = true;
2048 }
2049 if( b00 && b01 ){ // wall left of entity
2050 double overlap = ( std::floor( ent.x ) + 0.5 ) - ( ent.x - ent.collisionRadius );
2051 if( overlap > 0.0 ) ent.x += overlap;
2052 checked = true;
2053 }
2054 if( b10 && b11 ){ // wall right of entity
2055 double overlap = ( ent.x + ent.collisionRadius ) - ( std::floor( ent.x ) + 0.5 );
2056 if( overlap > 0.0 ) ent.x -= overlap;
2057 checked = true;
2058 }
2059 if( !checked && ( b00 || b10 || b01 || b11 ) ){ // block is cornered
2060 double circleX = std::floor( ent.x ) + ( ( b10 || b11 ) ? 1.0 : 0.0 );
2061 double circleY = std::floor( ent.y ) + ( ( b01 || b11 ) ? 1.0 : 0.0 );
2062 double dist = std::sqrt( std::pow( ent.x - circleX, 2 ) + std::pow( ent.y - circleY, 2 ) );
2063 double diam = ent.collisionRadius + 0.5;
2064 if( dist < diam ){
2065 double angle = std::atan2( circleX - ent.x, circleY - ent.y );
2066 ent.x -= std::sin( angle ) * ( diam - dist );
2067 ent.y -= std::cos( angle ) * ( diam - dist );
2068 }
2069 }
2070 }
2071
2072 void World::entityCollisions( size_t pos, bool recurse ){
2073 Entity &e1 = entities[pos];
2074 if( std::abs( e1.collisionRadius ) <= epsilon ){
2075 return;
2076 }
2077 if( recurse ){
2078 tileCollisions( e1 );
2079 }
2080 for( size_t i = 0; i < entities.size(); i++ ){
2081 Entity &e2 = entities[i];
2082 if( pos != i && std::abs( e2.collisionRadius ) > epsilon ){
2083 double dist = std::sqrt( std::pow( e1.x - e2.x, 2 ) + std::pow( e1.y - e2.y, 2 ) );
2084 double diam = e1.collisionRadius + e2.collisionRadius;
2085 if( dist < diam ){
2086 double angle = std::atan2( e2.x - e1.x, e2.y - e1.y );
2087 double pushX = std::sin( angle ) * ( diam - dist );
2088 double pushY = std::cos( angle ) * ( diam - dist );
2089 if( recurse ){
2090 if( e2.staticCollisions ){
2091 e1.x -= pushX;
2092 e1.y -= pushY;
2093 }else{
2094 e1.x -= pushX * 0.5;
2095 e2.x += pushX * 0.5;
2096 e1.y -= pushY * 0.5;
2097 e2.y += pushY * 0.5;
2098 tileCollisions( e2 );
2099 }
2100 entityCollisions( pos, false );
2101 }else{
2102 e1.x -= pushX;
2103 e1.y -= pushY;
2104 tileCollisions( e1 );
2105 }
2106 }
2107 }
2108 }
2109 }
2110
2111 } // namespace fworld
2112
2113 #endif // FWORLD_H
File include/genalg.h added (mode: 100755) (index 0000000..c7d952e)
1 #ifndef GENALG_H
2 #define GENALG_H
3
4 #include <climits>
5 #include <cmath>
6 //#include <cstdlib> // for rand()
7 #include <cstring>
8
9 #include <bitset>
10 #include <random>
11 #include <vector>
12
13 namespace genalg {
14
15 template<typename T>
16 struct Phenotype {
17 double fitness;
18 T chromosome;
19 };
20
21 //typedef double (*FitnessFunc)(Phenotype* p);
22
23 template<typename T, typename F, typename U, typename R>
24 std::vector<Phenotype<T>> Iterate(
25 std::vector<Phenotype<T>>* population,
26 const F &FitnessFunc,
27 U user_data,
28 R* rng,
29 double crossover_rate,
30 double mutation_rate );
31
32 template<typename T, typename R>
33 std::vector<Phenotype<T>> RandomGarbage(
34 size_t members,
35 R* rng );
36
37 #ifdef GENALG_IMPLEMENTATION
38
39 /** \brief Breeds a new generation of phenotypes.
40 *
41 * This is the main evolution function. Feed it your population and get
42 * a slightly evolved population out the other end. Do this many times
43 * to optimize for the fitness function.
44 *
45 * The new population's size will be a multiple of 2 due to how the
46 * recombination works. Aside from that, the input and output
47 * populations will always be the same size.
48 *
49 * When experimenting with crossover rates and mutation rates, a value
50 * of 0.7 has been suggested for the crossover and 0.01 or 0.001 for the
51 * mutation.
52 *
53 * Note that the human generational mutation rate is roughly on the
54 * order of 0.00000002, or 1 out of every 500 million base pairs. For
55 * most contemporary programs, this would translate to negligibly few
56 * mutations.
57 *
58 * Example:
59 * `population = genalg::Iterate( &population, MyFunc, my_data, &mt, 0.7, 0.01 );`
60 *
61 * @param population Pointer to `std::vector` of phenotypes.
62 * @param FitnessFunc Function that ingests a
63 * `Phenotype<MyChromosome>*` and user data and
64 * returns a floating-point fitness value.
65 * @param user_data A variable of any type to be passed as the
66 * second parameter to `FitnessFunc`.
67 * @param rng Pointer to instance of an RNG from `<random>`.
68 * @param crossover_rate The probability that 2 chosen chromosomes
69 * will swap bits.
70 * @param mutation_rate A bit's probability of flipping.
71 * @return `std::vector` of the new generation of phenotypes.
72 */
73 template<typename T, typename F, typename U, typename R>
74 std::vector<Phenotype<T>> Iterate(
75 std::vector<Phenotype<T>>* population,
76 const F &FitnessFunc,
77 U user_data,
78 R* rng,
79 double crossover_rate,
80 double mutation_rate ){
81
82 const size_t chromosome_bytes = sizeof(T);
83 const size_t chromosome_bits = chromosome_bytes * CHAR_BIT;
84 // TODO(fluffrabbit): Investigate the contiguousness of std::bitset.
85 std::bitset<chromosome_bits> bits[3];
86
87 double total_fitness = 0.0;
88
89 // Decide the fitness of each member of the population.
90 for( auto &p : *population ){
91 p.fitness = FitnessFunc( &p, user_data );
92 // Yes, negative fitness is possible.
93 total_fitness += std::max( 0.0, static_cast<double>( p.fitness ) );
94 }
95
96 // If the total fitness is infinity or NaN, just try not to cause a crash.
97 if( std::isinf( total_fitness ) || std::isnan( total_fitness ) ){
98 total_fitness = 0.0;
99 }
100
101 // Initialize the random number distributions.
102 std::uniform_real_distribution<double> roulette_dist( 0.0, total_fitness );
103 std::uniform_real_distribution<double> unit_dist( 0.0, 1.0 );
104 std::uniform_int_distribution<size_t> gene_dist( 0, chromosome_bits );
105
106 std::vector<Phenotype<T>> new_population;
107
108 // Iterate through the population, producing 2 new members for every 2 old members.
109 for( size_t half_n = 0; half_n < population->size() / 2; half_n++ ){
110 double
111 slot = 0.0,
112 ball1 = roulette_dist( *rng ),
113 ball2 = roulette_dist( *rng );
114 bool
115 got_bits1 = false,
116 got_bits2 = false;
117
118 // Pick 2 mates using roulette wheel selection.
119 for( auto &p : *population ){
120 int target = 0;
121 if( ball1 >= slot && ball1 < slot + p.fitness ){
122 target = 1;
123 got_bits1 = true;
124 }
125 if( ball2 >= slot && ball2 < slot + p.fitness ){
126 target = 2;
127 got_bits2 = true;
128 }
129 if( target > 0 ){
130 std::memcpy(
131 static_cast<void*>( target == 1 ? &bits[1] : &bits[2] ),
132 static_cast<void*>( &p.chromosome ),
133 chromosome_bytes
134 );
135 }
136 if( got_bits1 && got_bits2 ){
137 break;
138 }
139 slot += p.fitness;
140 }
141
142 if( unit_dist( *rng ) < crossover_rate ){
143 // Swap genes.
144 size_t gene_offset_bits = gene_dist( *rng );
145 size_t gene_offset_bytes = gene_offset_bits / CHAR_BIT;
146
147 // Use bits[0] as a buffer for the first chromosome's data.
148 std::memcpy(
149 static_cast<void*>( &bits[0] ),
150 static_cast<void*>( &bits[1] ),
151 chromosome_bytes
152 );
153
154 if( gene_offset_bytes > 0 ){
155 // Swap bytes from the starts of the chromosomes to the offset.
156 // This is faster than iterating over every bit.
157 std::memcpy(
158 static_cast<void*>( &bits[1] ),
159 static_cast<void*>( &bits[2] ),
160 gene_offset_bytes
161 );
162 std::memcpy(
163 static_cast<void*>( &bits[2] ),
164 static_cast<void*>( &bits[0] ),
165 gene_offset_bytes
166 );
167 }
168
169 // Swap the bits in the byte of the crossover.
170 for( size_t i = gene_offset_bytes * CHAR_BIT; i < gene_offset_bits; i++ ){
171 bits[1][i] = bits[2][i];
172 bits[2][i] = bits[0][i];
173 }
174 }
175
176 // Mutate the chromosomes.
177 for( size_t i = 0; i < chromosome_bits; i++ ){
178 if( unit_dist( *rng ) < mutation_rate ){
179 bits[1].flip( i );
180 }
181 if( unit_dist( *rng ) < mutation_rate ){
182 bits[2].flip( i );
183 }
184 }
185
186 // Add the phenotypes to the new population.
187 for( int i = 0; i < 2; i++ ){
188 new_population.push_back( { 0.0, {} } );
189 std::memcpy(
190 static_cast<void*>( &new_population.back().chromosome ),
191 static_cast<void*>( i == 0 ? &bits[1] : &bits[2] ),
192 chromosome_bytes
193 );
194 }
195 }
196
197 return new_population;
198 }
199
200 /** \brief Returns a randomized `std::vector` of `Phenotype`s.
201 *
202 * Returns a vector containing `Phenotype`s with randomized chromosomes.
203 * The randomization happens per byte without knowledge of what the
204 * chromosome affects. This is a worst-case initialization for a quick
205 * start that <b>should not be used in production</b>.
206 *
207 * Example:
208 * `auto population = genalg::RandomGarbage<MyChromosome>( 20, &mt );`
209 *
210 * You should initialize with plausible random values instead.
211 *
212 * @param <T> struct type to use for chromosomes.
213 * @param members Number of `Phenotype`s to create.
214 * @param rng Pointer to an instance of an RNG from `<random>`.
215 * @return `std::vector` of randomized `Phenotype`s.
216 */
217 template<typename T, typename R>
218 std::vector<Phenotype<T>> RandomGarbage(
219 size_t members,
220 R* rng ){
221
222 std::vector<Phenotype<T>> population;
223
224 unsigned char bytes[sizeof(T)];
225
226 std::uniform_int_distribution<int> byte_dist( 0, UCHAR_MAX );
227
228 // Create a random initial population.
229 for( size_t i = 0; i < members; i++ ){
230 for( unsigned char &b : bytes ){
231 //b = std::rand() % ( UCHAR_MAX + 1 );
232 b = byte_dist( *rng );
233 }
234 population.push_back( {
235 0.0,
236 *static_cast<T*>( static_cast<void*>( bytes ) )
237 } );
238 }
239 return population;
240 }
241
242 #endif // GENALG_IMPLEMENTATION
243
244 } // namespace genalg
245
246 #endif // GENALG_H
File include/ini.h added (mode: 100755) (index 0000000..986b8fb)
1 /*
2 ------------------------------------------------------------------------------
3 Licensing information can be found at the end of the file.
4 ------------------------------------------------------------------------------
5
6 ini.h - v1.2 - Simple ini-file reader for C/C++.
7
8 Do this:
9 #define INI_IMPLEMENTATION
10 before you include this file in *one* C/C++ file to create the implementation.
11 */
12
13 #ifndef ini_h
14 #define ini_h
15
16 #define INI_GLOBAL_SECTION ( 0 )
17 #define INI_NOT_FOUND ( -1 )
18
19 typedef struct ini_t ini_t;
20
21 ini_t* ini_create( void* memctx );
22 ini_t* ini_load( char const* data, void* memctx );
23
24 int ini_save( ini_t const* ini, char* data, int size );
25 void ini_destroy( ini_t* ini );
26
27 int ini_section_count( ini_t const* ini );
28 char const* ini_section_name( ini_t const* ini, int section );
29
30 int ini_property_count( ini_t const* ini, int section );
31 char const* ini_property_name( ini_t const* ini, int section, int property );
32 char const* ini_property_value( ini_t const* ini, int section, int property );
33
34 int ini_find_section( ini_t const* ini, char const* name, int name_length );
35 int ini_find_property( ini_t const* ini, int section, char const* name, int name_length );
36
37 int ini_section_add( ini_t* ini, char const* name, int length );
38 void ini_property_add( ini_t* ini, int section, char const* name, int name_length, char const* value, int value_length );
39 void ini_section_remove( ini_t* ini, int section );
40 void ini_property_remove( ini_t* ini, int section, int property );
41
42 void ini_section_name_set( ini_t* ini, int section, char const* name, int length );
43 void ini_property_name_set( ini_t* ini, int section, int property, char const* name, int length );
44 void ini_property_value_set( ini_t* ini, int section, int property, char const* value, int length );
45
46 #endif /* ini_h */
47
48
49 /**
50
51 Examples
52 ========
53
54 Loading an ini file and retrieving values
55 -----------------------------------------
56
57 #define INI_IMPLEMENTATION
58 #include "ini.h"
59
60 #include <stdio.h>
61 #include <stdlib.h>
62
63 int main()
64 {
65 FILE* fp = fopen( "test.ini", "r" );
66 fseek( fp, 0, SEEK_END );
67 int size = ftell( fp );
68 fseek( fp, 0, SEEK_SET );
69 char* data = (char*) malloc( size + 1 );
70 fread( data, 1, size, fp );
71 data[ size ] = '\0';
72 fclose( fp );
73
74 ini_t* ini = ini_load( data );
75 free( data );
76 int second_index = ini_find_property( ini, INI_GLOBAL_SECTION, "SecondSetting" );
77 char const* second = ini_property_value( ini, INI_GLOBAL_SECTION, second_index );
78 printf( "%s=%s\n", "SecondSetting", second );
79 int section = ini_find_section( ini, "MySection" );
80 int third_index = ini_find_property( ini, section, "ThirdSetting" );
81 char const* third = ini_property_value( ini, section, third_index );
82 printf( "%s=%s\n", "ThirdSetting", third );
83 ini_destroy( ini );
84
85 return 0;
86 }
87
88
89 Creating a new ini file
90 -----------------------
91
92 #define INI_IMPLEMENTATION
93 #include "ini.h"
94
95 #include <stdio.h>
96 #include <stdlib.h>
97
98 int main()
99 {
100 ini_t* ini = ini_create();
101 ini_property_add( ini, INI_GLOBAL_SECTION, "FirstSetting", "Test" );
102 ini_property_add( ini, INI_GLOBAL_SECTION, "SecondSetting", "2" );
103 int section = ini_section_add( ini, "MySection" );
104 ini_property_add( ini, section, "ThirdSetting", "Three" );
105
106 int size = ini_save( ini, NULL, 0 ); // Find the size needed
107 char* data = (char*) malloc( size );
108 size = ini_save( ini, data, size ); // Actually save the file
109 ini_destroy( ini );
110
111 FILE* fp = fopen( "test.ini", "w" );
112 fwrite( data, 1, size, fp );
113 fclose( fp );
114 free( data );
115
116 return 0;
117 }
118
119
120
121 API Documentation
122 =================
123
124 ini.h is a small library for reading classic .ini files. It is a single-header library, and does not need any .lib files
125 or other binaries, or any build scripts. To use it, you just include ini.h to get the API declarations. To get the
126 definitions, you must include ini.h from *one* single C or C++ file, and #define the symbol `INI_IMPLEMENTATION` before
127 you do.
128
129
130 Customization
131 -------------
132 There are a few different things in ini.h which are configurable by #defines. The customizations only affect the
133 implementation, so will only need to be defined in the file where you have the #define INI_IMPLEMENTATION.
134
135 Note that if all customizations are utilized, ini.h will include no external files whatsoever, which might be useful
136 if you need full control over what code is being built.
137
138
139 ### Custom memory allocators
140
141 To store the internal data structures, ini.h needs to do dynamic allocation by calling `malloc`. Programs might want to
142 keep track of allocations done, or use custom defined pools to allocate memory from. ini.h allows for specifying custom
143 memory allocation functions for `malloc` and `free`.
144 This is done with the following code:
145
146 #define INI_IMPLEMENTATION
147 #define INI_MALLOC( ctx, size ) ( my_custom_malloc( ctx, size ) )
148 #define INI_FREE( ctx, ptr ) ( my_custom_free( ctx, ptr ) )
149 #include "ini.h"
150
151 where `my_custom_malloc` and `my_custom_free` are your own memory allocation/deallocation functions. The `ctx` parameter
152 is an optional parameter of type `void*`. When `ini_create` or `ini_load` is called, you can pass in a `memctx`
153 parameter, which can be a pointer to anything you like, and which will be passed through as the `ctx` parameter to every
154 `INI_MALLOC`/`INI_FREE` call. For example, if you are doing memory tracking, you can pass a pointer to your tracking
155 data as `memctx`, and in your custom allocation/deallocation function, you can cast the `ctx` param back to the
156 right type, and access the tracking data.
157
158 If no custom allocator is defined, ini.h will default to `malloc` and `free` from the C runtime library.
159
160
161 ### Custom C runtime function
162
163 The library makes use of three additional functions from the C runtime library, and for full flexibility, it allows you
164 to substitute them for your own. Here's an example:
165
166 #define INI_IMPLEMENTATION
167 #define INI_MEMCPY( dst, src, cnt ) ( my_memcpy_func( dst, src, cnt ) )
168 #define INI_STRLEN( s ) ( my_strlen_func( s ) )
169 #define INI_STRNICMP( s1, s2, cnt ) ( my_strnicmp_func( s1, s2, cnt ) )
170 #include "ini.h"
171
172 If no custom function is defined, ini.h will default to the C runtime library equivalent.
173
174
175 ini_create
176 ----------
177
178 ini_t* ini_create( void* memctx )
179
180 Instantiates a new, empty ini structure, which can be manipulated with other API calls, to fill it with data. To save it
181 out to an ini-file string, use `ini_save`. When no longer needed, it can be destroyed by calling `ini_destroy`.
182 `memctx` is a pointer to user defined data which will be passed through to the custom INI_MALLOC/INI_FREE calls. It can
183 be NULL if no user defined data is needed.
184
185
186 ini_load
187 --------
188
189 ini_t* ini_load( char const* data, void* memctx )
190
191 Parse the zero-terminated string `data` containing an ini-file, and create a new ini_t instance containing the data.
192 The instance can be manipulated with other API calls to enumerate sections/properties and retrieve values. When no
193 longer needed, it can be destroyed by calling `ini_destroy`. `memctx` is a pointer to user defined data which will be
194 passed through to the custom INI_MALLOC/INI_FREE calls. It can be NULL if no user defined data is needed.
195
196
197 ini_save
198 --------
199
200 int ini_save( ini_t const* ini, char* data, int size )
201
202 Saves an ini structure as a zero-terminated ini-file string, into the specified buffer. Returns the number of bytes
203 written, including the zero terminator. If `data` is NULL, nothing is written, but `ini_save` still returns the number
204 of bytes it would have written. If the size of `data`, as specified in the `size` parameter, is smaller than that
205 required, only part of the ini-file string will be written. `ini_save` still returns the number of bytes it would have
206 written had the buffer been large enough.
207
208
209 ini_destroy
210 -----------
211
212 void ini_destroy( ini_t* ini )
213
214 Destroy an `ini_t` instance created by calling `ini_load` or `ini_create`, releasing the memory allocated by it. No
215 further API calls are valid on an `ini_t` instance after calling `ini_destroy` on it.
216
217
218 ini_section_count
219 -----------------
220
221 int ini_section_count( ini_t const* ini )
222
223 Returns the number of sections in an ini file. There's at least one section in an ini file (the global section), but
224 there can be many more, each specified in the file by the section name wrapped in square brackets [ ].
225
226
227 ini_section_name
228 ----------------
229
230 char const* ini_section_name( ini_t const* ini, int section )
231
232 Returns the name of the section with the specified index. `section` must be non-negative and less than the value
233 returned by `ini_section_count`, or `ini_section_name` will return NULL. The defined constant `INI_GLOBAL_SECTION` can
234 be used to indicate the global section.
235
236
237 ini_property_count
238 ------------------
239
240 int ini_property_count( ini_t const* ini, int section )
241
242 Returns the number of properties belonging to the section with the specified index. `section` must be non-negative and
243 less than the value returned by `ini_section_count`, or `ini_section_name` will return 0. The defined constant
244 `INI_GLOBAL_SECTION` can be used to indicate the global section. Properties are declared in the ini-file on he format
245 `name=value`.
246
247
248 ini_property_name
249 -----------------
250
251 char const* ini_property_name( ini_t const* ini, int section, int property )
252
253 Returns the name of the property with the specified index `property` in the section with the specified index `section`.
254 `section` must be non-negative and less than the value returned by `ini_section_count`, and `property` must be
255 non-negative and less than the value returned by `ini_property_count`, or `ini_property_name` will return NULL. The
256 defined constant `INI_GLOBAL_SECTION` can be used to indicate the global section.
257
258
259 ini_property_value
260 ------------------
261
262 char const* ini_property_value( ini_t const* ini, int section, int property )
263
264 Returns the value of the property with the specified index `property` in the section with the specified index `section`.
265 `section` must be non-negative and less than the value returned by `ini_section_count`, and `property` must be
266 non-negative and less than the value returned by `ini_property_count`, or `ini_property_value` will return NULL. The
267 defined constant `INI_GLOBAL_SECTION` can be used to indicate the global section.
268
269
270 ini_find_section
271 ----------------
272
273 int ini_find_section( ini_t const* ini, char const* name, int name_length )
274
275 Finds the section with the specified name, and returns its index. `name_length` specifies the number of characters in
276 `name`, which does not have to be zero-terminated. If `name_length` is zero, the length is determined automatically, but
277 in this case `name` has to be zero-terminated. If no section with the specified name could be found, the value
278 `INI_NOT_FOUND` is returned.
279
280
281 ini_find_property
282 -----------------
283
284 int ini_find_property( ini_t const* ini, int section, char const* name, int name_length )
285
286 Finds the property with the specified name, within the section with the specified index, and returns the index of the
287 property. `name_length` specifies the number of characters in `name`, which does not have to be zero-terminated. If
288 `name_length` is zero, the length is determined automatically, but in this case `name` has to be zero-terminated. If no
289 property with the specified name could be found within the specified section, the value `INI_NOT_FOUND` is returned.
290 `section` must be non-negative and less than the value returned by `ini_section_count`, or `ini_find_property` will
291 return `INI_NOT_FOUND`. The defined constant `INI_GLOBAL_SECTION` can be used to indicate the global section.
292
293
294 ini_section_add
295 ---------------
296
297 int ini_section_add( ini_t* ini, char const* name, int length )
298
299 Adds a section with the specified name, and returns the index it was added at. There is no check done to see if a
300 section with the specified name already exists - multiple sections of the same name are allowed. `length` specifies the
301 number of characters in `name`, which does not have to be zero-terminated. If `length` is zero, the length is determined
302 automatically, but in this case `name` has to be zero-terminated.
303
304
305 ini_property_add
306 ----------------
307
308 void ini_property_add( ini_t* ini, int section, char const* name, int name_length, char const* value, int value_length )
309
310 Adds a property with the specified name and value to the specified section, and returns the index it was added at. There
311 is no check done to see if a property with the specified name already exists - multiple properties of the same name are
312 allowed. `name_length` and `value_length` specifies the number of characters in `name` and `value`, which does not have
313 to be zero-terminated. If `name_length` or `value_length` is zero, the length is determined automatically, but in this
314 case `name`/`value` has to be zero-terminated. `section` must be non-negative and less than the value returned by
315 `ini_section_count`, or the property will not be added. The defined constant `INI_GLOBAL_SECTION` can be used to
316 indicate the global section.
317
318
319 ini_section_remove
320 ------------------
321
322 void ini_section_remove( ini_t* ini, int section )
323
324 Removes the section with the specified index, and all properties within it. `section` must be non-negative and less than
325 the value returned by `ini_section_count`. The defined constant `INI_GLOBAL_SECTION` can be used to indicate the global
326 section. Note that removing a section will shuffle section indices, so that section indices you may have stored will no
327 longer indicate the same section as it did before the remove. Use the find functions to update your indices.
328
329
330 ini_property_remove
331 -------------------
332
333 void ini_property_remove( ini_t* ini, int section, int property )
334
335 Removes the property with the specified index from the specified section. `section` must be non-negative and less than
336 the value returned by `ini_section_count`, and `property` must be non-negative and less than the value returned by
337 `ini_property_count`. The defined constant `INI_GLOBAL_SECTION` can be used to indicate the global section. Note that
338 removing a property will shuffle property indices within the specified section, so that property indices you may have
339 stored will no longer indicate the same property as it did before the remove. Use the find functions to update your
340 indices.
341
342
343 ini_section_name_set
344 --------------------
345
346 void ini_section_name_set( ini_t* ini, int section, char const* name, int length )
347
348 Change the name of the section with the specified index. `section` must be non-negative and less than the value returned
349 by `ini_section_count`. The defined constant `INI_GLOBAL_SECTION` can be used to indicate the global section. `length`
350 specifies the number of characters in `name`, which does not have to be zero-terminated. If `length` is zero, the length
351 is determined automatically, but in this case `name` has to be zero-terminated.
352
353
354 ini_property_name_set
355 ---------------------
356
357 void ini_property_name_set( ini_t* ini, int section, int property, char const* name, int length )
358
359 Change the name of the property with the specified index in the specified section. `section` must be non-negative and
360 less than the value returned by `ini_section_count`, and `property` must be non-negative and less than the value
361 returned by `ini_property_count`. The defined constant `INI_GLOBAL_SECTION` can be used to indicate the global section.
362 `length` specifies the number of characters in `name`, which does not have to be zero-terminated. If `length` is zero,
363 the length is determined automatically, but in this case `name` has to be zero-terminated.
364
365
366 ini_property_value_set
367 ----------------------
368
369 void ini_property_value_set( ini_t* ini, int section, int property, char const* value, int length )
370
371 Change the value of the property with the specified index in the specified section. `section` must be non-negative and
372 less than the value returned by `ini_section_count`, and `property` must be non-negative and less than the value
373 returned by `ini_property_count`. The defined constant `INI_GLOBAL_SECTION` can be used to indicate the global section.
374 `length` specifies the number of characters in `value`, which does not have to be zero-terminated. If `length` is zero,
375 the length is determined automatically, but in this case `value` has to be zero-terminated.
376
377 **/
378
379
380 /*
381 ----------------------
382 IMPLEMENTATION
383 ----------------------
384 */
385
386 #ifdef INI_IMPLEMENTATION
387 #undef INI_IMPLEMENTATION
388
389 #define INITIAL_CAPACITY ( 256 )
390
391 #undef _CRT_NONSTDC_NO_DEPRECATE
392 #define _CRT_NONSTDC_NO_DEPRECATE
393 #undef _CRT_SECURE_NO_WARNINGS
394 #define _CRT_SECURE_NO_WARNINGS
395 #include <stddef.h>
396
397 #ifndef INI_MALLOC
398 #include <stdlib.h>
399 #define INI_MALLOC( ctx, size ) ( malloc( size ) )
400 #define INI_FREE( ctx, ptr ) ( free( ptr ) )
401 #endif
402
403 #ifndef INI_MEMCPY
404 #include <string.h>
405 #define INI_MEMCPY( dst, src, cnt ) ( memcpy( dst, src, cnt ) )
406 #endif
407
408 #ifndef INI_STRLEN
409 #include <string.h>
410 #define INI_STRLEN( s ) ( strlen( s ) )
411 #endif
412
413 #ifndef INI_STRNICMP
414 #ifdef _WIN32
415 #include <string.h>
416 #define INI_STRNICMP( s1, s2, cnt ) ( strnicmp( s1, s2, cnt ) )
417 #else
418 #include <string.h>
419 #define INI_STRNICMP( s1, s2, cnt ) ( strncasecmp( s1, s2, cnt ) )
420 #endif
421 #endif
422
423
424 struct ini_internal_section_t
425 {
426 char name[ 32 ];
427 char* name_large;
428 };
429
430
431 struct ini_internal_property_t
432 {
433 int section;
434 char name[ 32 ];
435 char* name_large;
436 char value[ 64 ];
437 char* value_large;
438 };
439
440
441 struct ini_t
442 {
443 struct ini_internal_section_t* sections;
444 int section_capacity;
445 int section_count;
446
447 struct ini_internal_property_t* properties;
448 int property_capacity;
449 int property_count;
450
451 void* memctx;
452 };
453
454
455 static int ini_internal_property_index( ini_t const* ini, int section, int property )
456 {
457 int i;
458 int p;
459
460 if( ini && section >= 0 && section < ini->section_count )
461 {
462 p = 0;
463 for( i = 0; i < ini->property_count; ++i )
464 {
465 if( ini->properties[ i ].section == section )
466 {
467 if( p == property ) return i;
468 ++p;
469 }
470 }
471 }
472
473 return INI_NOT_FOUND;
474 }
475
476
477 ini_t* ini_create( void* memctx )
478 {
479 ini_t* ini;
480
481 ini = (ini_t*) INI_MALLOC( memctx, sizeof( ini_t ) );
482 ini->memctx = memctx;
483 ini->sections = (struct ini_internal_section_t*) INI_MALLOC( ini->memctx, INITIAL_CAPACITY * sizeof( ini->sections[ 0 ] ) );
484 ini->section_capacity = INITIAL_CAPACITY;
485 ini->section_count = 1; /* global section */
486 ini->sections[ 0 ].name[ 0 ] = '\0';
487 ini->sections[ 0 ].name_large = 0;
488 ini->properties = (struct ini_internal_property_t*) INI_MALLOC( ini->memctx, INITIAL_CAPACITY * sizeof( ini->properties[ 0 ] ) );
489 ini->property_capacity = INITIAL_CAPACITY;
490 ini->property_count = 0;
491 return ini;
492 }
493
494
495 ini_t* ini_load( char const* data, void* memctx )
496 {
497 ini_t* ini;
498 char const* ptr;
499 int s;
500 char const* start;
501 char const* start2;
502 int l;
503
504 ini = ini_create( memctx );
505
506 ptr = data;
507 if( ptr )
508 {
509 s = 0;
510 while( *ptr )
511 {
512 /* trim leading whitespace */
513 while( *ptr && *ptr <=' ' )
514 ++ptr;
515
516 /* done? */
517 if( !*ptr ) break;
518
519 /* comment */
520 else if( *ptr == ';' )
521 {
522 while( *ptr && *ptr !='\n' )
523 ++ptr;
524 }
525 /* section */
526 else if( *ptr == '[' )
527 {
528 ++ptr;
529 start = ptr;
530 while( *ptr && *ptr !=']' && *ptr != '\n' )
531 ++ptr;
532
533 if( *ptr == ']' )
534 {
535 s = ini_section_add( ini, start, (int)( ptr - start) );
536 ++ptr;
537 }
538 }
539 /* property */
540 else
541 {
542 start = ptr;
543 while( *ptr && *ptr !='=' && *ptr != '\n' )
544 ++ptr;
545
546 if( *ptr == '=' )
547 {
548 l = (int)( ptr - start);
549 ++ptr;
550 while( *ptr && *ptr <= ' ' && *ptr != '\n' )
551 ptr++;
552 start2 = ptr;
553 while( *ptr && *ptr != '\n' )
554 ++ptr;
555 while( *(--ptr) <= ' ' )
556 (void)ptr;
557 ptr++;
558 ini_property_add( ini, s, start, l, start2, (int)( ptr - start2) );
559 }
560 }
561 }
562 }
563
564 return ini;
565 }
566
567
568 int ini_save( ini_t const* ini, char* data, int size )
569 {
570 int s;
571 int p;
572 int i;
573 int l;
574 char* n;
575 int pos;
576
577 if( ini )
578 {
579 pos = 0;
580 for( s = 0; s < ini->section_count; ++s )
581 {
582 n = ini->sections[ s ].name_large ? ini->sections[ s ].name_large : ini->sections[ s ].name;
583 l = (int) INI_STRLEN( n );
584 if( l > 0 )
585 {
586 if( data && pos < size ) data[ pos ] = '[';
587 ++pos;
588 for( i = 0; i < l; ++i )
589 {
590 if( data && pos < size ) data[ pos ] = n[ i ];
591 ++pos;
592 }
593 if( data && pos < size ) data[ pos ] = ']';
594 ++pos;
595 if( data && pos < size ) data[ pos ] = '\n';
596 ++pos;
597 }
598
599 for( p = 0; p < ini->property_count; ++p )
600 {
601 if( ini->properties[ p ].section == s )
602 {
603 n = ini->properties[ p ].name_large ? ini->properties[ p ].name_large : ini->properties[ p ].name;
604 l = (int) INI_STRLEN( n );
605 for( i = 0; i < l; ++i )
606 {
607 if( data && pos < size ) data[ pos ] = n[ i ];
608 ++pos;
609 }
610 if( data && pos < size ) data[ pos ] = '=';
611 ++pos;
612 n = ini->properties[ p ].value_large ? ini->properties[ p ].value_large : ini->properties[ p ].value;
613 l = (int) INI_STRLEN( n );
614 for( i = 0; i < l; ++i )
615 {
616 if( data && pos < size ) data[ pos ] = n[ i ];
617 ++pos;
618 }
619 if( data && pos < size ) data[ pos ] = '\n';
620 ++pos;
621 }
622 }
623
624 if( pos > 0 )
625 {
626 if( data && pos < size ) data[ pos ] = '\n';
627 ++pos;
628 }
629 }
630
631 if( data && pos < size ) data[ pos ] = '\0';
632 ++pos;
633
634 return pos;
635 }
636
637 return 0;
638 }
639
640
641 void ini_destroy( ini_t* ini )
642 {
643 int i;
644
645 if( ini )
646 {
647 for( i = 0; i < ini->property_count; ++i )
648 {
649 if( ini->properties[ i ].value_large ) INI_FREE( ini->memctx, ini->properties[ i ].value_large );
650 if( ini->properties[ i ].name_large ) INI_FREE( ini->memctx, ini->properties[ i ].name_large );
651 }
652 for( i = 0; i < ini->section_count; ++i )
653 if( ini->sections[ i ].name_large ) INI_FREE( ini->memctx, ini->sections[ i ].name_large );
654 INI_FREE( ini->memctx, ini->properties );
655 INI_FREE( ini->memctx, ini->sections );
656 INI_FREE( ini->memctx, ini );
657 }
658 }
659
660
661 int ini_section_count( ini_t const* ini )
662 {
663 if( ini ) return ini->section_count;
664 return 0;
665 }
666
667
668 char const* ini_section_name( ini_t const* ini, int section )
669 {
670 if( ini && section >= 0 && section < ini->section_count )
671 return ini->sections[ section ].name_large ? ini->sections[ section ].name_large : ini->sections[ section ].name;
672
673 return NULL;
674 }
675
676
677 int ini_property_count( ini_t const* ini, int section )
678 {
679 int i;
680 int count;
681
682 if( ini )
683 {
684 count = 0;
685 for( i = 0; i < ini->property_count; ++i )
686 {
687 if( ini->properties[ i ].section == section ) ++count;
688 }
689 return count;
690 }
691
692 return 0;
693 }
694
695
696 char const* ini_property_name( ini_t const* ini, int section, int property )
697 {
698 int p;
699
700 if( ini && section >= 0 && section < ini->section_count )
701 {
702 p = ini_internal_property_index( ini, section, property );
703 if( p != INI_NOT_FOUND )
704 return ini->properties[ p ].name_large ? ini->properties[ p ].name_large : ini->properties[ p ].name;
705 }
706
707 return NULL;
708 }
709
710
711 char const* ini_property_value( ini_t const* ini, int section, int property )
712 {
713 int p;
714
715 if( ini && section >= 0 && section < ini->section_count )
716 {
717 p = ini_internal_property_index( ini, section, property );
718 if( p != INI_NOT_FOUND )
719 return ini->properties[ p ].value_large ? ini->properties[ p ].value_large : ini->properties[ p ].value;
720 }
721
722 return NULL;
723 }
724
725
726 int ini_find_section( ini_t const* ini, char const* name, int name_length )
727 {
728 int i;
729
730 if( ini && name )
731 {
732 if( name_length <= 0 ) name_length = (int) INI_STRLEN( name );
733 for( i = 0; i < ini->section_count; ++i )
734 {
735 char const* const other =
736 ini->sections[ i ].name_large ? ini->sections[ i ].name_large : ini->sections[ i ].name;
737 if( INI_STRNICMP( name, other, name_length ) == 0 )
738 return i;
739 }
740 }
741
742 return INI_NOT_FOUND;
743 }
744
745
746 int ini_find_property( ini_t const* ini, int section, char const* name, int name_length )
747 {
748 int i;
749 int c;
750
751 if( ini && name && section >= 0 && section < ini->section_count)
752 {
753 if( name_length <= 0 ) name_length = (int) INI_STRLEN( name );
754 c = 0;
755 for( i = 0; i < ini->property_capacity; ++i )
756 {
757 if( ini->properties[ i ].section == section )
758 {
759 char const* const other =
760 ini->properties[ i ].name_large ? ini->properties[ i ].name_large : ini->properties[ i ].name;
761 if( INI_STRNICMP( name, other, name_length ) == 0 )
762 return c;
763 ++c;
764 }
765 }
766 }
767
768 return INI_NOT_FOUND;
769 }
770
771
772 int ini_section_add( ini_t* ini, char const* name, int length )
773 {
774 struct ini_internal_section_t* new_sections;
775
776 if( ini && name )
777 {
778 if( length <= 0 ) length = (int) INI_STRLEN( name );
779 if( ini->section_count >= ini->section_capacity )
780 {
781 ini->section_capacity *= 2;
782 new_sections = (struct ini_internal_section_t*) INI_MALLOC( ini->memctx,
783 ini->section_capacity * sizeof( ini->sections[ 0 ] ) );
784 INI_MEMCPY( new_sections, ini->sections, ini->section_count * sizeof( ini->sections[ 0 ] ) );
785 INI_FREE( ini->memctx, ini->sections );
786 ini->sections = new_sections;
787 }
788
789 ini->sections[ ini->section_count ].name_large = 0;
790 if( (size_t) length + 1 >= sizeof( ini->sections[ 0 ].name ) )
791 {
792 ini->sections[ ini->section_count ].name_large = (char*) INI_MALLOC( ini->memctx, (size_t) length + 1 );
793 INI_MEMCPY( ini->sections[ ini->section_count ].name_large, name, (size_t) length );
794 ini->sections[ ini->section_count ].name_large[ length ] = '\0';
795 }
796 else
797 {
798 INI_MEMCPY( ini->sections[ ini->section_count ].name, name, (size_t) length );
799 ini->sections[ ini->section_count ].name[ length ] = '\0';
800 }
801
802 return ini->section_count++;
803 }
804 return INI_NOT_FOUND;
805 }
806
807
808 void ini_property_add( ini_t* ini, int section, char const* name, int name_length, char const* value, int value_length )
809 {
810 struct ini_internal_property_t* new_properties;
811
812 if( ini && name && section >= 0 && section < ini->section_count )
813 {
814 if( name_length <= 0 ) name_length = (int) INI_STRLEN( name );
815 if( value_length <= 0 ) value_length = (int) INI_STRLEN( value );
816
817 if( ini->property_count >= ini->property_capacity )
818 {
819
820 ini->property_capacity *= 2;
821 new_properties = (struct ini_internal_property_t*) INI_MALLOC( ini->memctx,
822 ini->property_capacity * sizeof( ini->properties[ 0 ] ) );
823 INI_MEMCPY( new_properties, ini->properties, ini->property_count * sizeof( ini->properties[ 0 ] ) );
824 INI_FREE( ini->memctx, ini->properties );
825 ini->properties = new_properties;
826 }
827
828 ini->properties[ ini->property_count ].section = section;
829 ini->properties[ ini->property_count ].name_large = 0;
830 ini->properties[ ini->property_count ].value_large = 0;
831
832 if( (size_t) name_length + 1 >= sizeof( ini->properties[ 0 ].name ) )
833 {
834 ini->properties[ ini->property_count ].name_large = (char*) INI_MALLOC( ini->memctx, (size_t) name_length + 1 );
835 INI_MEMCPY( ini->properties[ ini->property_count ].name_large, name, (size_t) name_length );
836 ini->properties[ ini->property_count ].name_large[ name_length ] = '\0';
837 }
838 else
839 {
840 INI_MEMCPY( ini->properties[ ini->property_count ].name, name, (size_t) name_length );
841 ini->properties[ ini->property_count ].name[ name_length ] = '\0';
842 }
843
844 if( (size_t) value_length + 1 >= sizeof( ini->properties[ 0 ].value ) )
845 {
846 ini->properties[ ini->property_count ].value_large = (char*) INI_MALLOC( ini->memctx, (size_t) value_length + 1 );
847 INI_MEMCPY( ini->properties[ ini->property_count ].value_large, value, (size_t) value_length );
848 ini->properties[ ini->property_count ].value_large[ value_length ] = '\0';
849 }
850 else
851 {
852 INI_MEMCPY( ini->properties[ ini->property_count ].value, value, (size_t) value_length );
853 ini->properties[ ini->property_count ].value[ value_length ] = '\0';
854 }
855
856 ++ini->property_count;
857 }
858 }
859
860
861 void ini_section_remove( ini_t* ini, int section )
862 {
863 int p;
864
865 if( ini && section >= 0 && section < ini->section_count )
866 {
867 if( ini->sections[ section ].name_large ) INI_FREE( ini->memctx, ini->sections[ section ].name_large );
868 for( p = ini->property_count - 1; p >= 0; --p )
869 {
870 if( ini->properties[ p ].section == section )
871 {
872 if( ini->properties[ p ].value_large ) INI_FREE( ini->memctx, ini->properties[ p ].value_large );
873 if( ini->properties[ p ].name_large ) INI_FREE( ini->memctx, ini->properties[ p ].name_large );
874 ini->properties[ p ] = ini->properties[ --ini->property_count ];
875 }
876 }
877
878 ini->sections[ section ] = ini->sections[ --ini->section_count ];
879
880 for( p = 0; p < ini->property_count; ++p )
881 {
882 if( ini->properties[ p ].section == ini->section_count )
883 ini->properties[ p ].section = section;
884 }
885 }
886 }
887
888
889 void ini_property_remove( ini_t* ini, int section, int property )
890 {
891 int p;
892
893 if( ini && section >= 0 && section < ini->section_count )
894 {
895 p = ini_internal_property_index( ini, section, property );
896 if( p != INI_NOT_FOUND )
897 {
898 if( ini->properties[ p ].value_large ) INI_FREE( ini->memctx, ini->properties[ p ].value_large );
899 if( ini->properties[ p ].name_large ) INI_FREE( ini->memctx, ini->properties[ p ].name_large );
900 ini->properties[ p ] = ini->properties[ --ini->property_count ];
901 return;
902 }
903 }
904 }
905
906
907 void ini_section_name_set( ini_t* ini, int section, char const* name, int length )
908 {
909 if( ini && name && section >= 0 && section < ini->section_count )
910 {
911 if( length <= 0 ) length = (int) INI_STRLEN( name );
912 if( ini->sections[ section ].name_large ) INI_FREE( ini->memctx, ini->sections[ section ].name_large );
913 ini->sections[ section ].name_large = 0;
914
915 if( (size_t) length + 1 >= sizeof( ini->sections[ 0 ].name ) )
916 {
917 ini->sections[ section ].name_large = (char*) INI_MALLOC( ini->memctx, (size_t) length + 1 );
918 INI_MEMCPY( ini->sections[ section ].name_large, name, (size_t) length );
919 ini->sections[ section ].name_large[ length ] = '\0';
920 }
921 else
922 {
923 INI_MEMCPY( ini->sections[ section ].name, name, (size_t) length );
924 ini->sections[ section ].name[ length ] = '\0';
925 }
926 }
927 }
928
929
930 void ini_property_name_set( ini_t* ini, int section, int property, char const* name, int length )
931 {
932 int p;
933
934 if( ini && name && section >= 0 && section < ini->section_count )
935 {
936 if( length <= 0 ) length = (int) INI_STRLEN( name );
937 p = ini_internal_property_index( ini, section, property );
938 if( p != INI_NOT_FOUND )
939 {
940 if( ini->properties[ p ].name_large ) INI_FREE( ini->memctx, ini->properties[ p ].name_large );
941 ini->properties[ ini->property_count ].name_large = 0;
942
943 if( (size_t) length + 1 >= sizeof( ini->properties[ 0 ].name ) )
944 {
945 ini->properties[ p ].name_large = (char*) INI_MALLOC( ini->memctx, (size_t) length + 1 );
946 INI_MEMCPY( ini->properties[ p ].name_large, name, (size_t) length );
947 ini->properties[ p ].name_large[ length ] = '\0';
948 }
949 else
950 {
951 INI_MEMCPY( ini->properties[ p ].name, name, (size_t) length );
952 ini->properties[ p ].name[ length ] = '\0';
953 }
954 }
955 }
956 }
957
958
959 void ini_property_value_set( ini_t* ini, int section, int property, char const* value, int length )
960 {
961 int p;
962
963 if( ini && value && section >= 0 && section < ini->section_count )
964 {
965 if( length <= 0 ) length = (int) INI_STRLEN( value );
966 p = ini_internal_property_index( ini, section, property );
967 if( p != INI_NOT_FOUND )
968 {
969 if( ini->properties[ p ].value_large ) INI_FREE( ini->memctx, ini->properties[ p ].value_large );
970 ini->properties[ ini->property_count ].value_large = 0;
971
972 if( (size_t) length + 1 >= sizeof( ini->properties[ 0 ].value ) )
973 {
974 ini->properties[ p ].value_large = (char*) INI_MALLOC( ini->memctx, (size_t) length + 1 );
975 INI_MEMCPY( ini->properties[ p ].value_large, value, (size_t) length );
976 ini->properties[ p ].value_large[ length ] = '\0';
977 }
978 else
979 {
980 INI_MEMCPY( ini->properties[ p ].value, value, (size_t) length );
981 ini->properties[ p ].value[ length ] = '\0';
982 }
983 }
984 }
985 }
986
987
988 #endif /* INI_IMPLEMENTATION */
989
990 /*
991
992 contributors:
993 Randy Gaul (copy-paste bug in ini_property_value_set)
994 Branimir Karadzic (INI_STRNICMP bugfix)
995
996 revision history:
997 1.2 using strnicmp for correct length compares, fixed copy-paste bug in ini_property_value_set
998 1.1 customization, added documentation, cleanup
999 1.0 first publicly released version
1000
1001 */
1002
1003 /*
1004 ------------------------------------------------------------------------------
1005
1006 This software is available under 2 licenses - you may choose the one you like.
1007
1008 ------------------------------------------------------------------------------
1009
1010 ALTERNATIVE A - MIT License
1011
1012 Copyright (c) 2015 Mattias Gustavsson
1013
1014 Permission is hereby granted, free of charge, to any person obtaining a copy of
1015 this software and associated documentation files (the "Software"), to deal in
1016 the Software without restriction, including without limitation the rights to
1017 use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
1018 of the Software, and to permit persons to whom the Software is furnished to do
1019 so, subject to the following conditions:
1020
1021 The above copyright notice and this permission notice shall be included in all
1022 copies or substantial portions of the Software.
1023
1024 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1025 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1026 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1027 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1028 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1029 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1030 SOFTWARE.
1031
1032 ------------------------------------------------------------------------------
1033
1034 ALTERNATIVE B - Public Domain (www.unlicense.org)
1035
1036 This is free and unencumbered software released into the public domain.
1037
1038 Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
1039 software, either in source code form or as a compiled binary, for any purpose,
1040 commercial or non-commercial, and by any means.
1041
1042 In jurisdictions that recognize copyright laws, the author or authors of this
1043 software dedicate any and all copyright interest in the software to the public
1044 domain. We make this dedication for the benefit of the public at large and to
1045 the detriment of our heirs and successors. We intend this dedication to be an
1046 overt act of relinquishment in perpetuity of all present and future rights to
1047 this software under copyright law.
1048
1049 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1050 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1051 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1052 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
1053 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
1054 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1055
1056 ------------------------------------------------------------------------------
1057 */
File include/micropather.h added (mode: 100755) (index 0000000..f263a7f)
1 /*
2 Copyright (c) 2000-2013 Lee Thomason (www.grinninglizard.com)
3 Micropather
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any
7 damages arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any
10 purpose, including commercial applications, and to alter it and
11 redistribute it freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must
14 not claim that you wrote the original software. If you use this
15 software in a product, an acknowledgment in the product documentation
16 would be appreciated but is not required.
17
18 2. Altered source versions must be plainly marked as such, and
19 must not be misrepresented as being the original software.
20
21 3. This notice may not be removed or altered from any source
22 distribution.
23 */
24
25 // This source code had been altered from its original form,
26 // to remove an erroneous semicolon near the end and to use std::vector.
27
28 #ifndef GRINNINGLIZARD_MICROPATHER_INCLUDED
29 #define GRINNINGLIZARD_MICROPATHER_INCLUDED
30
31
32 /** @mainpage MicroPather
33
34 MicroPather is a path finder and A* solver (astar or a-star) written in platform independent
35 C++ that can be easily integrated into existing code. MicroPather focuses on being a path
36 finding engine for video games but is a generic A* solver. MicroPather is open source, with
37 a license suitable for open source or commercial use.
38 */
39
40 // This probably works to remove.
41 //#define GRINLIZ_NO_STL
42
43 #ifdef GRINLIZ_NO_STL
44 # define MP_VECTOR micropather::MPVector
45 #else
46 # include <vector>
47 # define MP_VECTOR std::vector
48 #endif
49 #include <float.h>
50
51 #ifdef _DEBUG
52 #ifndef DEBUG
53 #define DEBUG
54 #endif
55 #endif
56
57
58 #if defined(DEBUG)
59 # if defined(_MSC_VER)
60 # // "(void)0," is for suppressing C4127 warning in "assert(false)", "assert(true)" and the like
61 # define MPASSERT( x ) if ( !((void)0,(x))) { __debugbreak(); } //if ( !(x)) WinDebugBreak()
62 # elif defined (ANDROID_NDK)
63 # include <android/log.h>
64 # define MPASSERT( x ) if ( !(x)) { __android_log_assert( "assert", "grinliz", "ASSERT in '%s' at %d.", __FILE__, __LINE__ ); }
65 # else
66 # include <assert.h>
67 # define MPASSERT assert
68 # endif
69 # else
70 # define MPASSERT( x ) {}
71 #endif
72
73
74 #if defined(_MSC_VER) && (_MSC_VER >= 1400 )
75 #include <stdlib.h>
76 typedef uintptr_t MP_UPTR;
77 #elif defined (__GNUC__) && (__GNUC__ >= 3 )
78 #include <stdint.h>
79 #include <stdlib.h>
80 typedef uintptr_t MP_UPTR;
81 #else
82 // Assume not 64 bit pointers. Get a new compiler.
83 typedef unsigned MP_UPTR;
84 #endif
85
86 namespace micropather
87 {
88 #ifdef GRINLIZ_NO_STL
89
90 /* WARNING: vector partial replacement. Does everything needed to replace std::vector
91 for micropather, but only works on Plain Old Data types. Doesn't call copy/construct/destruct
92 correctly for general use.
93 */
94 template <typename T>
95 class MPVector {
96 public:
97 MPVector() : m_allocated( 0 ), m_size( 0 ), m_buf ( 0 ) {}
98 ~MPVector() { delete [] m_buf; }
99
100 void clear() { m_size = 0; } // see warning above
101 void resize( unsigned s ) { capacity( s );
102 m_size = s;
103 }
104 T& operator[](unsigned i) { MPASSERT( i>=0 && i<m_size );
105 return m_buf[i];
106 }
107 const T& operator[](unsigned i) const { MPASSERT( i>=0 && i<m_size );
108 return m_buf[i];
109 }
110 void push_back( const T& t ) { capacity( m_size+1 );
111 m_buf[m_size++] = t;
112 }
113 unsigned size() const { return m_size; }
114
115 private:
116 void capacity( unsigned cap ) {
117 if ( m_allocated < cap ) {
118 unsigned newAllocated = cap * 3/2 + 16;
119 T* newBuf = new T[newAllocated];
120 MPASSERT( m_size <= m_allocated );
121 MPASSERT( m_size < newAllocated );
122 memcpy( newBuf, m_buf, sizeof(T)*m_size );
123 delete [] m_buf;
124 m_buf = newBuf;
125 m_allocated = newAllocated;
126 }
127 }
128 unsigned m_allocated;
129 unsigned m_size;
130 T* m_buf;
131 };
132 #endif
133
134 /**
135 Used to pass the cost of states from the cliet application to MicroPather. This
136 structure is copied in a vector.
137
138 @sa AdjacentCost
139 */
140 struct StateCost
141 {
142 void* state; ///< The state as a void*
143 float cost; ///< The cost to the state. Use FLT_MAX for infinite cost.
144 };
145
146
147 /**
148 A pure abstract class used to define a set of callbacks.
149 The client application inherits from
150 this class, and the methods will be called when MicroPather::Solve() is invoked.
151
152 The notion of a "state" is very important. It must have the following properties:
153 - Unique
154 - Unchanging (unless MicroPather::Reset() is called)
155
156 If the client application represents states as objects, then the state is usually
157 just the object cast to a void*. If the client application sees states as numerical
158 values, (x,y) for example, then state is an encoding of these values. MicroPather
159 never interprets or modifies the value of state.
160 */
161 class Graph
162 {
163 public:
164 virtual ~Graph() {}
165
166 /**
167 Return the least possible cost between 2 states. For example, if your pathfinding
168 is based on distance, this is simply the straight distance between 2 points on the
169 map. If you pathfinding is based on minimum time, it is the minimal travel time
170 between 2 points given the best possible terrain.
171 */
172 virtual float LeastCostEstimate( void* stateStart, void* stateEnd ) = 0;
173
174 /**
175 Return the exact cost from the given state to all its neighboring states. This
176 may be called multiple times, or cached by the solver. It *must* return the same
177 exact values for every call to MicroPather::Solve(). It should generally be a simple,
178 fast function with no callbacks into the pather.
179 */
180 virtual void AdjacentCost( void* state, MP_VECTOR< micropather::StateCost > *adjacent ) = 0;
181
182 /**
183 This function is only used in DEBUG mode - it dumps output to stdout. Since void*
184 aren't really human readable, normally you print out some concise info (like "(1,2)")
185 without an ending newline.
186 */
187 virtual void PrintStateInfo( void* state ) = 0;
188 };
189
190
191 class PathNode;
192
193 struct NodeCost
194 {
195 PathNode* node;
196 float cost;
197 };
198
199
200 /*
201 Every state (void*) is represented by a PathNode in MicroPather. There
202 can only be one PathNode for a given state.
203 */
204 class PathNode
205 {
206 public:
207 void Init( unsigned _frame,
208 void* _state,
209 float _costFromStart,
210 float _estToGoal,
211 PathNode* _parent );
212
213 void Clear();
214 void InitSentinel() {
215 Clear();
216 Init( 0, 0, FLT_MAX, FLT_MAX, 0 );
217 prev = next = this;
218 }
219
220 void *state; // the client state
221 float costFromStart; // exact
222 float estToGoal; // estimated
223 float totalCost; // could be a function, but save some math.
224 PathNode* parent; // the parent is used to reconstruct the path
225 unsigned frame; // unique id for this path, so the solver can distinguish
226 // correct from stale values
227
228 int numAdjacent; // -1 is unknown & needs to be queried
229 int cacheIndex; // position in cache
230
231 PathNode *child[2]; // Binary search in the hash table. [left, right]
232 PathNode *next, *prev; // used by open queue
233
234 bool inOpen;
235 bool inClosed;
236
237 void Unlink() {
238 next->prev = prev;
239 prev->next = next;
240 next = prev = 0;
241 }
242 void AddBefore( PathNode* addThis ) {
243 addThis->next = this;
244 addThis->prev = prev;
245 prev->next = addThis;
246 prev = addThis;
247 }
248 #ifdef DEBUG
249 void CheckList()
250 {
251 MPASSERT( totalCost == FLT_MAX );
252 for( PathNode* it = next; it != this; it=it->next ) {
253 MPASSERT( it->prev == this || it->totalCost >= it->prev->totalCost );
254 MPASSERT( it->totalCost <= it->next->totalCost );
255 }
256 }
257 #endif
258
259 void CalcTotalCost() {
260 if ( costFromStart < FLT_MAX && estToGoal < FLT_MAX )
261 totalCost = costFromStart + estToGoal;
262 else
263 totalCost = FLT_MAX;
264 }
265
266 private:
267
268 void operator=( const PathNode& );
269 };
270
271
272 /* Memory manager for the PathNodes. */
273 class PathNodePool
274 {
275 public:
276 PathNodePool( unsigned allocate, unsigned typicalAdjacent );
277 ~PathNodePool();
278
279 // Free all the memory except the first block. Resets all memory.
280 void Clear();
281
282 // Essentially:
283 // pNode = Find();
284 // if ( !pNode )
285 // pNode = New();
286 //
287 // Get the PathNode associated with this state. If the PathNode already
288 // exists (allocated and is on the current frame), it will be returned.
289 // Else a new PathNode is allocated and returned. The returned object
290 // is always fully initialized.
291 //
292 // NOTE: if the pathNode exists (and is current) all the initialization
293 // parameters are ignored.
294 PathNode* GetPathNode( unsigned frame,
295 void* _state,
296 float _costFromStart,
297 float _estToGoal,
298 PathNode* _parent );
299
300 // Get a pathnode that is already in the pool.
301 PathNode* FetchPathNode( void* state );
302
303 // Store stuff in cache
304 bool PushCache( const NodeCost* nodes, int nNodes, int* start );
305
306 // Get neighbors from the cache
307 // Note - always access this with an offset. Can get re-allocated.
308 void GetCache( int start, int nNodes, NodeCost* nodes );
309
310 // Return all the allocated states. Useful for visuallizing what
311 // the pather is doing.
312 void AllStates( unsigned frame, MP_VECTOR< void* >* stateVec );
313
314 private:
315 struct Block
316 {
317 Block* nextBlock;
318 PathNode pathNode[1];
319 };
320
321 unsigned Hash( void* voidval );
322 unsigned HashSize() const { return 1<<hashShift; }
323 unsigned HashMask() const { return ((1<<hashShift)-1); }
324 void AddPathNode( unsigned key, PathNode* p );
325 Block* NewBlock();
326 PathNode* Alloc();
327
328 PathNode** hashTable;
329 Block* firstBlock;
330 Block* blocks;
331
332 NodeCost* cache;
333 int cacheCap;
334 int cacheSize;
335
336 PathNode freeMemSentinel;
337 unsigned allocate; // how big a block of pathnodes to allocate at once
338 unsigned nAllocated; // number of pathnodes allocated (from Alloc())
339 unsigned nAvailable; // number available for allocation
340
341 unsigned hashShift;
342 unsigned totalCollide;
343 };
344
345
346 /* Used to cache results of paths. Much, much faster
347 to return an existing solution than to calculate
348 a new one. A post on this is here: http://grinninglizard.com/altera/programming/a-path-caching-2/
349 */
350 class PathCache
351 {
352 public:
353 struct Item {
354 // The key:
355 void* start;
356 void* end;
357
358 bool KeyEqual( const Item& item ) const { return start == item.start && end == item.end; }
359 bool Empty() const { return start == 0 && end == 0; }
360
361 // Data:
362 void* next;
363 float cost; // from 'start' to 'next'. FLT_MAX if unsolveable.
364
365 unsigned Hash() const {
366 const unsigned char *p = (const unsigned char *)(&start);
367 unsigned int h = 2166136261U;
368
369 for( unsigned i=0; i<sizeof(void*)*2; ++i, ++p ) {
370 h ^= *p;
371 h *= 16777619;
372 }
373 return h;
374 }
375 };
376
377 PathCache( int itemsToAllocate );
378 ~PathCache();
379
380 void Reset();
381 void Add( const MP_VECTOR< void* >& path, const MP_VECTOR< float >& cost );
382 void AddNoSolution( void* end, void* states[], int count );
383 int Solve( void* startState, void* endState, MP_VECTOR< void* >* path, float* totalCost );
384
385 int AllocatedBytes() const { return allocated * sizeof(Item); }
386 int UsedBytes() const { return nItems * sizeof(Item); }
387
388 int hit;
389 int miss;
390
391 private:
392 void AddItem( const Item& item );
393 const Item* Find( void* start, void* end );
394
395 Item* mem;
396 int allocated;
397 int nItems;
398 };
399
400 struct CacheData {
401 CacheData() : nBytesAllocated(0), nBytesUsed(0), memoryFraction(0), hit(0), miss(0), hitFraction(0) {}
402 int nBytesAllocated;
403 int nBytesUsed;
404 float memoryFraction;
405
406 int hit;
407 int miss;
408 float hitFraction;
409 };
410
411 /**
412 Create a MicroPather object to solve for a best path. Detailed usage notes are
413 on the main page.
414 */
415 class MicroPather
416 {
417 friend class micropather::PathNode;
418
419 public:
420 enum
421 {
422 SOLVED,
423 NO_SOLUTION,
424 START_END_SAME,
425
426 // internal
427 NOT_CACHED
428 };
429
430 /**
431 Construct the pather, passing a pointer to the object that implements
432 the Graph callbacks.
433
434 @param graph The "map" that implements the Graph callbacks.
435 @param allocate How many states should be internally allocated at a time. This
436 can be hard to get correct. The higher the value, the more memory
437 MicroPather will use.
438 - If you have a small map (a few thousand states?) it may make sense
439 to pass in the maximum value. This will cache everything, and MicroPather
440 will only need one main memory allocation. For a chess board, allocate
441 would be set to 8x8 (64)
442 - If your map is large, something like 1/4 the number of possible
443 states is good.
444 - If your state space is huge, use a multiple (5-10x) of the normal
445 path. "Occasionally" call Reset() to free unused memory.
446 @param typicalAdjacent Used to determine cache size. The typical number of adjacent states
447 to a given state. (On a chessboard, 8.) Higher values use a little
448 more memory.
449 @param cache Turn on path caching. Uses more memory (yet again) but at a huge speed
450 advantage if you may call the pather with the same path or sub-path, which
451 is common for pathing over maps in games.
452 */
453 MicroPather( Graph* graph, unsigned allocate = 250, unsigned typicalAdjacent=6, bool cache=true );
454 ~MicroPather();
455
456 /**
457 Solve for the path from start to end.
458
459 @param startState Input, the starting state for the path.
460 @param endState Input, the ending state for the path.
461 @param path Output, a vector of states that define the path. Empty if not found.
462 @param totalCost Output, the cost of the path, if found.
463 @return Success or failure, expressed as SOLVED, NO_SOLUTION, or START_END_SAME.
464 */
465 int Solve( void* startState, void* endState, MP_VECTOR< void* >* path, float* totalCost );
466
467 /**
468 Find all the states within a given cost from startState.
469
470 @param startState Input, the starting state for the path.
471 @param near All the states within 'maxCost' of 'startState', and cost to that state.
472 @param maxCost Input, the maximum cost that will be returned. (Higher values return
473 larger 'near' sets and take more time to compute.)
474 @return Success or failure, expressed as SOLVED or NO_SOLUTION.
475 */
476 int SolveForNearStates( void* startState, MP_VECTOR< StateCost >* near, float maxCost );
477
478 /** Should be called whenever the cost between states or the connection between states changes.
479 Also frees overhead memory used by MicroPather, and calling will free excess memory.
480 */
481 void Reset();
482
483 // Debugging function to return all states that were used by the last "solve"
484 void StatesInPool( MP_VECTOR< void* >* stateVec );
485 void GetCacheData( CacheData* data );
486
487 private:
488 MicroPather( const MicroPather& ); // undefined and unsupported
489 void operator=( const MicroPather ); // undefined and unsupported
490
491 void GoalReached( PathNode* node, void* start, void* end, MP_VECTOR< void* > *path );
492
493 void GetNodeNeighbors( PathNode* node, MP_VECTOR< NodeCost >* neighborNode );
494
495 #ifdef DEBUG
496 //void DumpStats();
497 #endif
498
499 PathNodePool pathNodePool;
500 MP_VECTOR< StateCost > stateCostVec; // local to Solve, but put here to reduce memory allocation
501 MP_VECTOR< NodeCost > nodeCostVec; // local to Solve, but put here to reduce memory allocation
502 MP_VECTOR< float > costVec;
503
504 Graph* graph;
505 unsigned frame; // incremented with every solve, used to determine if cached data needs to be refreshed
506 PathCache* pathCache;
507 };
508 } // namespace grinliz
509
510 #endif
511
File include/ne.h added (mode: 100755) (index 0000000..5e80231)
1 #ifndef NE_H
2 #define NE_H
3
4 #include <math.h>
5 #include <stdlib.h>
6
7 // From stretchy_buffer.h version 1.03 (https://github.com/nothings/stb)
8 #ifndef STB_STRETCHY_BUFFER_H_INCLUDED
9 #define STB_STRETCHY_BUFFER_H_INCLUDED
10
11 #ifndef NO_STRETCHY_BUFFER_SHORT_NAMES
12 #define sb_free stb_sb_free
13 #define sb_push stb_sb_push
14 #define sb_count stb_sb_count
15 #define sb_add stb_sb_add
16 #define sb_last stb_sb_last
17 #endif
18
19 #define stb_sb_free(a) ((a) ? free(stb__sbraw(a)),0 : 0)
20 #define stb_sb_push(a,v) (stb__sbmaybegrow(a,1), (a)[stb__sbn(a)++] = (v))
21 #define stb_sb_count(a) ((a) ? stb__sbn(a) : 0)
22 #define stb_sb_add(a,n) (stb__sbmaybegrow(a,n), stb__sbn(a)+=(n), &(a)[stb__sbn(a)-(n)])
23 #define stb_sb_last(a) ((a)[stb__sbn(a)-1])
24
25 #define stb__sbraw(a) ((int *) (a) - 2)
26 #define stb__sbm(a) stb__sbraw(a)[0]
27 #define stb__sbn(a) stb__sbraw(a)[1]
28
29 #define stb__sbneedgrow(a,n) ((a)==0 || stb__sbn(a)+(n) >= stb__sbm(a))
30 #define stb__sbmaybegrow(a,n) (stb__sbneedgrow(a,(n)) ? stb__sbgrow(a,n) : 0)
31 #define stb__sbgrow(a,n) (*((void **)&(a)) = stb__sbgrowf((a), (n), sizeof(*(a))))
32
33 static void * stb__sbgrowf(void *arr, int increment, int itemsize)
34 {
35 int dbl_cur = arr ? 2*stb__sbm(arr) : 0;
36 int min_needed = stb_sb_count(arr) + increment;
37 int m = dbl_cur > min_needed ? dbl_cur : min_needed;
38 int *p = (int *) realloc(arr ? stb__sbraw(arr) : 0, itemsize * m + sizeof(int)*2);
39 if (p) {
40 if (!arr)
41 p[1] = 0;
42 p[0] = m;
43 return p+2;
44 } else {
45 #ifdef STRETCHY_BUFFER_OUT_OF_MEMORY
46 STRETCHY_BUFFER_OUT_OF_MEMORY ;
47 #endif
48 return (void *) (2*sizeof(int)); // try to force a NULL pointer exception later
49 }
50 }
51 #endif // STB_STRETCHY_BUFFER_H_INCLUDED
52
53 #ifndef NE_REAL
54 #define NE_REAL float
55 #endif
56
57 typedef struct {
58 NE_REAL gradient;
59 NE_REAL bias;
60 NE_REAL* weights;
61 } ne_Neuron;
62
63 typedef ne_Neuron* ne_Layer;
64
65 typedef struct {
66 NE_REAL fitness;
67 ne_Layer* layers;
68 } ne_Network;
69
70 typedef ne_Network* ne_Population;
71
72 double ne_RandomUnit();
73
74 double ne_RandomClamped();
75
76 ne_Population ne_RandomNetworks(
77 int* topology,
78 int members,
79 unsigned int rand_seed );
80
81 void ne_CopyNetwork(
82 ne_Network* src,
83 ne_Network* dest );
84
85 void ne_FreeNetwork( ne_Network* net );
86
87 void ne_FreePopulation( ne_Population* population );
88
89 void ne_Iterate(
90 ne_Population* population,
91 unsigned int rand_seed,
92 double crossover_rate,
93 double mutation_rate,
94 int mutate_gradients );
95
96 void ne_GetOutputs(
97 ne_Network* net,
98 NE_REAL* inputs,
99 NE_REAL* outputs );
100
101 #ifdef NE_IMPLEMENTATION
102
103 /** \brief Returns a random `double` from 0.0 to 1.0.
104 *
105 * @return A random `double` from 0.0 to 1.0.
106 */
107 double ne_RandomUnit(){
108 return (double)rand() / (double)RAND_MAX;
109 }
110
111 /** \brief Returns a random `double` from -1.0 to 1.0.
112 *
113 * @return A random `double` from -1.0 to 1.0.
114 */
115 double ne_RandomClamped(){
116 return ( (double)rand() / (double)RAND_MAX - 0.5 ) * 2.0;
117 }
118
119 /** \brief Returns a stetchy buffer of randomized neural networks.
120 *
121 * Returns a stretchy buffer of networks with randomized weights
122 * centered at 0.0 and a standard deviation of
123 * `sqrt( 1.0 / input_weights )`. Biases are initialized to 0.0. As used
124 * with SELU.
125 *
126 * `members` must be a positive even number. If it is not, the program
127 * will have undefined behavior.
128 *
129 * Example:
130 * `ne_Population population = ne_RandomNetworks( topology, 20, seed );`
131 *
132 * @param topology Stretchy buffer of network layer sizes from input
133 * to output. The first value is the number of inputs.
134 * @param members Number of neural networks to create.
135 * @param rand_seed A seed for srand.
136 * @return Stretchy buffer of randomized neural networks.
137 */
138 ne_Population ne_RandomNetworks(
139 int* topology,
140 int members,
141 unsigned int rand_seed ){
142
143 static const ne_Network NewNetwork = { 0.0, NULL };
144 static const ne_Neuron NewNeuron = { 0.0, 0.0, NULL };
145
146 srand( rand_seed );
147
148 ne_Population population = NULL;
149
150 // ne_Iterate through the population.
151 for( int m = 0; m < members; m++ ){
152 // Add a network.
153 stb_sb_push( population, NewNetwork );
154 ne_Network* net = &stb_sb_last( population );
155 // Set the first layer's number of weights per neuron to the number of inputs.
156 int input_weights = topology[0];
157 // Iterate through the layers.
158 for( int i = 1; i < stb_sb_count( topology ); i++ ){
159 int t = topology[i];
160 //assert( t >= 1 );
161 // Add a layer.
162 stb_sb_push( net->layers, NULL );
163 ne_Layer* layer = &stb_sb_last( net->layers );
164 // Set the standard deviation for the layer's weights.
165 NE_REAL stddev = sqrt( 1.0 / input_weights );
166 // Iterate through the neurons.
167 for( int n = 0; n < t; n++ ){
168 // Add a neuron.
169 stb_sb_push( *layer, NewNeuron );
170 ne_Neuron* neuron = &stb_sb_last( *layer );
171 // Add random weights.
172 for( int w = 0; w < input_weights; w++ ){
173 NE_REAL weight = ne_RandomClamped() * stddev;
174 stb_sb_push( neuron->weights, weight );
175 }
176 }
177 input_weights = t;
178 }
179 }
180
181 return population;
182 }
183
184 /** \brief Deep copy `ne_Network` `src` into empty `ne_Network` `dest`.
185 *
186 * @param src Pointer to the source neural network.
187 * @param dest Pointer to the destination neural network.
188 */
189 void ne_CopyNetwork(
190 ne_Network* src,
191 ne_Network* dest ){
192
193 //assert( dest->layers == NULL );
194 dest->fitness = src->fitness;
195 dest->layers = stb_sb_add( dest->layers, stb_sb_count( src->layers ) );
196 for( int x = 0; x < stb_sb_count( src->layers ); x++ ){
197 ne_Layer* src_layer = &src->layers[x];
198 ne_Layer* dest_layer = &dest->layers[x];
199 *dest_layer = NULL;
200 *dest_layer = stb_sb_add( *dest_layer, stb_sb_count( *src_layer ) );
201 for( int y = 0; y < stb_sb_count( *src_layer ); y++ ){
202 ne_Neuron* src_neuron = &(*src_layer)[y];
203 ne_Neuron* dest_neuron = &(*dest_layer)[y];
204 dest_neuron->gradient = src_neuron->gradient;
205 dest_neuron->bias = src_neuron->bias;
206 dest_neuron->weights = NULL;
207 dest_neuron->weights = stb_sb_add(
208 dest_neuron->weights,
209 stb_sb_count( src_neuron->weights )
210 );
211 for( int i = 0; i < stb_sb_count( src_neuron->weights ); i++ ){
212 dest_neuron->weights[i] = src_neuron->weights[i];
213 }
214 }
215 }
216 }
217
218 /** \brief Deep free `ne_Network` `net`.
219 *
220 * @param net Pointer to the neural network to be freed.
221 */
222 void ne_FreeNetwork( ne_Network* net ){
223 static const ne_Network NewNetwork = { 0.0, NULL };
224 for( int x = 0; x < stb_sb_count( net->layers ); x++ ){
225 ne_Layer* layer = &net->layers[x];
226 for( int y = 0; y < stb_sb_count( *layer ); y++ ){
227 stb_sb_free( (*layer)[y].weights );
228 }
229 stb_sb_free( *layer );
230 }
231 stb_sb_free( net->layers );
232 *net = NewNetwork;
233 }
234
235 /** \brief Deep free a population.
236 *
237 * @param net Pointer to the `ne_Population` to be freed.
238 */
239 void ne_FreePopulation( ne_Population* population ){
240 for( int i = 0; i < stb_sb_count( *population ); i++ ){
241 ne_FreeNetwork( &(*population)[i] );
242 }
243 stb_sb_free( *population );
244 *population = NULL;
245 }
246
247 /** \brief Breeds a new generation of neural networks.
248 *
249 * This is the main evolution function. Feed it your population and get
250 * a slightly evolved population out the other end. Do this many times
251 * to optimize for the fitness function.
252 *
253 * The input and output populations will always have the same count,
254 * with the exception that passing in a population of negative or
255 * non-even count results in undefined behavior.
256 *
257 * Make sure you set the `fitness` of each network before calling this
258 * function.
259 *
260 * Example:
261 * `ne_Iterate( &population, seed, 0.7, 0.001 );`
262 *
263 * @param population A stretchy buffer of neural networks with a
264 * homogenous topology.
265 * @param rand_seed A seed for `srand`.
266 * @param crossover_rate The probability that 2 chosen networks will
267 * swap weights.
268 * @param mutation_rate A weight's probability of mutating.
269 * @param mutate_gradients Whether or not to allow `gradient` values to
270 * mutate.
271 */
272 void ne_Iterate(
273 ne_Population* population,
274 unsigned int rand_seed,
275 double crossover_rate,
276 double mutation_rate,
277 int mutate_gradients ){
278
279 static const ne_Network NewNetwork = { 0.0, NULL };
280
281 // Get the number of network inputs.
282 int num_inputs = stb_sb_count( (*population)[0].layers[0][0].weights );
283
284 // Recover the total number of weights from the first network.
285 int
286 num_weights = 0,
287 input_weights = num_inputs;
288 for( int i = 0; i < stb_sb_count( (*population)[0].layers ); i++ ){
289 int layer_size = stb_sb_count( (*population)[0].layers[i] );
290 // The bias counts as an extra weight.
291 num_weights += layer_size * ( input_weights + 1 );
292 input_weights = layer_size;
293 }
294
295 double total_fitness = 0.0;
296
297 // Add up the fitnesses.
298 for( int i = 0; i < stb_sb_count( *population ); i++ ){
299 NE_REAL* fit = &(*population)[i].fitness;
300 // Set negative or NaN fitnesses to 0, lest they cause a crash.
301 if( *fit < 0.0 || isnan( *fit ) ){
302 *fit = 0.0;
303 }
304 total_fitness += (double)( *fit );
305 }
306
307 srand( rand_seed );
308
309 ne_Population new_population = NULL;
310
311 // ne_Iterate through the population, producing 2 new members for every 2 old members.
312 for( int half_n = 0; half_n < stb_sb_count( *population ) / 2; half_n++ ){
313 // Create 2 networks.
314 ne_Network
315 net1 = NewNetwork,
316 net2 = NewNetwork;
317 // Pick 2 mates using roulette wheel selection.
318 double
319 slot = 0.0,
320 ball1 = ne_RandomUnit() * total_fitness,
321 ball2 = ne_RandomUnit() * total_fitness;
322 for( int i = 0; i < stb_sb_count( *population ); i++ ){
323 ne_Network* p = &(*population)[i];
324 if( ball1 >= slot && ball1 <= slot + p->fitness ){
325 ne_CopyNetwork( p, &net1 );
326 }
327 if( ball2 >= slot && ball2 <= slot + p->fitness ){
328 ne_CopyNetwork( p, &net2 );
329 }
330 if( stb_sb_count( net1.layers ) > 0 && stb_sb_count( net2.layers ) > 0 ){
331 break;
332 }
333 slot += fmax( 0.0, (double)p->fitness );
334 }
335
336 // Average old fitness for easy access if anything uses it.
337 NE_REAL old_fitness = ( net1.fitness + net2.fitness ) * 0.5;
338 net1.fitness = old_fitness;
339 net2.fitness = old_fitness;
340
341 // Swap weights for crossover_rate of couples.
342 if( ne_RandomUnit() <= crossover_rate ){
343 // Index weights by order of access as they are not contiguous in memory.
344 int
345 swap_offset = ne_RandomUnit() * num_weights,
346 idx = 0;
347 for( int l = 0; l < stb_sb_count( net1.layers ); l++ ){
348 if( idx >= swap_offset ){
349 break;
350 }
351 ne_Layer* layer1 = &net1.layers[l];
352 ne_Layer* layer2 = &net2.layers[l];
353 for( int n = 0; n < stb_sb_count( *layer1 ); n++ ){
354 if( idx >= swap_offset ){
355 break;
356 }
357 ne_Neuron* neuron1 = &(*layer1)[n];
358 ne_Neuron* neuron2 = &(*layer2)[n];
359 // Swap gradients as if they are part of the biases.
360 // It is mathematically questionable to group both
361 // values as one gene, but the entire neuron depends
362 // on the gradient if a backpropagation step is
363 // used, so some kind of grouping may be desirable.
364 NE_REAL weight_tmp = neuron1->gradient;
365 neuron1->gradient = neuron2->gradient;
366 neuron2->gradient = weight_tmp;
367 // Swap biases.
368 weight_tmp = neuron1->bias;
369 neuron1->bias = neuron2->bias;
370 neuron2->bias = weight_tmp;
371 idx++;
372 for( int w = 0; w < stb_sb_count( neuron1->weights ); w++ ){
373 if( idx >= swap_offset ){
374 break;
375 }
376 // Swap weights.
377 weight_tmp = neuron1->weights[w];
378 neuron1->weights[w] = neuron2->weights[w];
379 neuron2->weights[w] = weight_tmp;
380 idx++;
381 }
382 }
383 }
384 }
385
386 // Starting number of weights per neuron.
387 input_weights = num_inputs;
388
389 // Mutate the weights.
390 for( int l = 0; l < stb_sb_count( net1.layers ); l++ ){
391 ne_Layer* layer1 = &net1.layers[l];
392 ne_Layer* layer2 = &net2.layers[l];
393 // Set the standard deviation for the layers' weights.
394 NE_REAL stddev = sqrt( 1.0 / input_weights );
395 for( int n = 0; n < stb_sb_count( *layer1 ); n++ ){
396 ne_Neuron* neuron1 = &(*layer1)[n];
397 ne_Neuron* neuron2 = &(*layer2)[n];
398 // If a particle hits a real, re-randomize it.
399 if( mutate_gradients ){
400 // TODO: Investigate different standard deviations.
401 if( ne_RandomUnit() <= mutation_rate ){
402 neuron1->gradient = ne_RandomClamped() * stddev;
403 }
404 if( ne_RandomUnit() <= mutation_rate ){
405 neuron2->gradient = ne_RandomClamped() * stddev;
406 }
407 }
408 if( ne_RandomUnit() <= mutation_rate ){
409 neuron1->bias = ne_RandomClamped() * stddev;
410 }
411 if( ne_RandomUnit() <= mutation_rate ){
412 neuron2->bias = ne_RandomClamped() * stddev;
413 }
414 for( int w = 0; w < stb_sb_count( neuron1->weights ); w++ ){
415 if( ne_RandomUnit() <= mutation_rate ){
416 neuron1->weights[w] = ne_RandomClamped() * stddev;
417 }
418 if( ne_RandomUnit() <= mutation_rate ){
419 neuron2->weights[w] = ne_RandomClamped() * stddev;
420 }
421 }
422 }
423 input_weights = stb_sb_count( *layer1 );
424 }
425
426 // Add the networks to the new population.
427 stb_sb_push( new_population, net1 );
428 stb_sb_push( new_population, net2 );
429 }
430
431 for( int i = 0; i < stb_sb_count( *population ); i++ ){
432 // Deep free the old data.
433 ne_FreeNetwork( &(*population)[i] );
434 // Shallow copy the memory address.
435 (*population)[i] = new_population[i];
436 }
437 }
438
439 /** \brief Runs data through a neural network.
440 *
441 * This is the main neural network function. It ingests an array of
442 * values and outputs an array of other values that hopefully do what
443 * you want them to do.
444 *
445 * The quality of the outputs depends on the quality of the neural
446 * network. If you `ne_Iterate` the population the right number of times
447 * with a smartly constructed fitness function and a good enough network
448 * topology, then run the fittest member through `ne_GetOutputs`, you
449 * should get high-quality outputs from your inputs.
450 *
451 * If either your `inputs` or `outputs` array is not large enough for
452 * the network, you could get access violations, segmentation faults, or
453 * undefined behavior. The library has no way to check the size of these
454 * arrays.
455 *
456 * Stretchy buffers can be used instead of arrays for dynamic sizes of
457 * `inputs` and `outputs`. (Think scripting and dynamic topologies.)
458 * However, this function never checks the counts of these buffers.
459 *
460 * Example:
461 * `ne_GetOutputs( &net, inputs, outputs );`
462 *
463 * @param net Pointer to a neural network.
464 * @param inputs Array of `NE_REAL` numbers to be fed into the
465 * network's input layer. All numbers are valid. The size
466 * of the array must be at least the size of the
467 * network's input layer.
468 * @param outputs Array of `NE_REAL` numbers to be filled by the
469 * network. The size of the array must be at least the
470 * size of the network's output layer.
471 */
472 void ne_GetOutputs(
473 ne_Network* net,
474 NE_REAL* inputs,
475 NE_REAL* outputs ){
476
477 // SELU constants.
478 static const NE_REAL a = 1.6732632423543772848170429916717;
479 static const NE_REAL s = 1.0507009873554804934193349852946;
480
481 // Get the number of network inputs.
482 int num_inputs = stb_sb_count( net->layers[0][0].weights );
483
484 // Create temporary input and output buffers.
485 NE_REAL* in_tmp = NULL;
486 NE_REAL* out_tmp = NULL;
487 // The inputs array is assumed to be large enough to contain the
488 // network's inputs. This keeps the API syntax simple.
489 // Copy inputs into in_tmp.
490 in_tmp = stb_sb_add( in_tmp, num_inputs );
491 for( int i = 0; i < num_inputs; i++ ){
492 in_tmp[i] = inputs[i];
493 }
494
495 for( int x = 0; x < stb_sb_count( net->layers ); x++ ){
496 ne_Layer* layer = &net->layers[x];
497 for( int y = 0; y < stb_sb_count( *layer ); y++ ){
498 ne_Neuron* neuron = &(*layer)[y];
499 // "treat the threshold as a weight that is always
500 // multiplied by an input of -1. This is usually referred
501 // to as the bias."
502 NE_REAL activation = -1.0 * neuron->bias;
503 for( int i = 0; i < stb_sb_count( neuron->weights ); i++ ){
504 activation += in_tmp[i] * neuron->weights[i];
505 }
506 // SELU
507 if( activation < 0.0 ){
508 activation = a * exp( activation ) - a;
509 }
510 activation *= s;
511 stb_sb_push( out_tmp, activation );
512 }
513 stb_sb_free( in_tmp );
514 // Shallow copy the memory address.
515 in_tmp = out_tmp;
516 out_tmp = NULL;
517 }
518
519 // The outputs array is assumed to be large enough to contain the
520 // network's outputs.
521 for( int i = 0; i < stb_sb_count( in_tmp ); i++ ){
522 outputs[i] = in_tmp[i];
523 }
524 stb_sb_free( in_tmp );
525 }
526
527 #endif // #ifdef NE_IMPLEMENTATION
528
529 #endif // #ifndef NE_H
File include/proc.h added (mode: 100644) (index 0000000..e648e6d)
1 #ifndef PROC_H
2 #define PROC_H
3
4 #include <assert.h>
5 #include <stdint.h>
6
7 #include <utility>
8 #include <vector>
9
10 namespace proc {
11
12 // Xorshift32 generator. Does not decorrelate automatically. User
13 // should run it a few hundred times for a better seed.
14 uint32_t Xorshift32( uint32_t *seed );
15
16 // Returns a float from 0 (inclusive) to 1 (exclusive).
17 float RandFloat( uint32_t *seed );
18
19 // Returns true or false.
20 bool CoinFlip( uint32_t *seed );
21
22 // Returns -1 to 1 inclusive.
23 int DF( uint32_t *seed );
24
25 // Returns 1 to n inclusive.
26 int DN( uint32_t *seed, int n );
27
28 // Returns a randomly selected member of objects.
29 template<typename T>
30 inline T RandObject( uint32_t *seed, const std::vector<T> &objects ){
31 return objects[(size_t)( RandFloat( seed ) * objects.size() )];
32 }
33
34 // Returns a member via Monte Carlo sampling of the assigned
35 // probabilities of objects.
36 template<typename T>
37 inline T ProbObject(
38 uint32_t *seed,
39 const std::vector<std::pair<T,float>> &objects ){
40 float total = 0.0f;
41 for( auto &o : objects ){
42 // Assert if NaN or less than 0 to avoid other problems.
43 assert( o.second == o.second && o.second >= 0.0f );
44 total += o.second;
45 }
46 float slot = 0.0f, ball = RandFloat( seed ) * total;
47 for( auto &o : objects ){
48 if( ball >= slot && ball < slot + o.second ) return o.first;
49 slot += o.second;
50 }
51 // Default case: Return the first member.
52 return objects[0].first;
53 }
54
55 #ifdef PROC_IMPLEMENTATION
56
57 uint32_t Xorshift32( uint32_t *seed ){
58 uint32_t x = *seed;
59 x ^= x << 13;
60 x ^= x >> 17;
61 x ^= x << 5;
62 return ( *seed = x );
63 }
64
65 float RandFloat( uint32_t *seed ){
66 return
67 (double)Xorshift32( seed ) / ( (double)0xFFFFFFFF + 1.0 );
68 }
69
70 bool CoinFlip( uint32_t *seed ){
71 return RandFloat( seed ) < 0.5f;
72 }
73
74 int DF( uint32_t *seed ){
75 return (int)( RandFloat( seed ) * 3 ) - 1;
76 }
77
78 int DN( uint32_t *seed, int n ){
79 return (int)( RandFloat( seed ) * n ) + 1;
80 }
81
82 #endif // PROC_IMPLEMENTATION
83
84 } // namespace proc
85
86 #endif // PROC_H
The diff for file include/stb_image.h is too big (7762 changes) and cannot be shown.
File include/stb_perlin.h added (mode: 100755) (index 0000000..39d2cc9)
1 // stb_perlin.h - v0.4 - perlin noise
2 // public domain single-file C implementation by Sean Barrett
3 //
4 // LICENSE
5 //
6 // See end of file.
7 //
8 //
9 // to create the implementation,
10 // #define STB_PERLIN_IMPLEMENTATION
11 // in *one* C/CPP file that includes this file.
12 //
13 //
14 // Documentation:
15 //
16 // float stb_perlin_noise3( float x,
17 // float y,
18 // float z,
19 // int x_wrap=0,
20 // int y_wrap=0,
21 // int z_wrap=0)
22 //
23 // This function computes a random value at the coordinate (x,y,z).
24 // Adjacent random values are continuous but the noise fluctuates
25 // its randomness with period 1, i.e. takes on wholly unrelated values
26 // at integer points. Specifically, this implements Ken Perlin's
27 // revised noise function from 2002.
28 //
29 // The "wrap" parameters can be used to create wraparound noise that
30 // wraps at powers of two. The numbers MUST be powers of two. Specify
31 // 0 to mean "don't care". (The noise always wraps every 256 due
32 // details of the implementation, even if you ask for larger or no
33 // wrapping.)
34 //
35 // float stb_perlin_noise3_seed( float x,
36 // float y,
37 // float z,
38 // int x_wrap=0,
39 // int y_wrap=0,
40 // int z_wrap=0,
41 // int seed)
42 //
43 // As above, but 'seed' selects from multiple different variations of the
44 // noise function. The current implementation only uses the bottom 8 bits
45 // of 'seed', but possibly in the future more bits will be used.
46 //
47 //
48 // Fractal Noise:
49 //
50 // Three common fractal noise functions are included, which produce
51 // a wide variety of nice effects depending on the parameters
52 // provided. Note that each function will call stb_perlin_noise3
53 // 'octaves' times, so this parameter will affect runtime.
54 //
55 // float stb_perlin_ridge_noise3(float x, float y, float z,
56 // float lacunarity, float gain, float offset, int octaves)
57 //
58 // float stb_perlin_fbm_noise3(float x, float y, float z,
59 // float lacunarity, float gain, int octaves)
60 //
61 // float stb_perlin_turbulence_noise3(float x, float y, float z,
62 // float lacunarity, float gain, int octaves)
63 //
64 // Typical values to start playing with:
65 // octaves = 6 -- number of "octaves" of noise3() to sum
66 // lacunarity = ~ 2.0 -- spacing between successive octaves (use exactly 2.0 for wrapping output)
67 // gain = 0.5 -- relative weighting applied to each successive octave
68 // offset = 1.0? -- used to invert the ridges, may need to be larger, not sure
69 //
70 //
71 // Contributors:
72 // Jack Mott - additional noise functions
73 // Jordan Peck - seeded noise
74 //
75
76
77 #ifdef __cplusplus
78 extern "C" {
79 #endif
80 extern float stb_perlin_noise3(float x, float y, float z, int x_wrap, int y_wrap, int z_wrap);
81 extern float stb_perlin_noise3_seed(float x, float y, float z, int x_wrap, int y_wrap, int z_wrap, int seed);
82 extern float stb_perlin_ridge_noise3(float x, float y, float z, float lacunarity, float gain, float offset, int octaves);
83 extern float stb_perlin_fbm_noise3(float x, float y, float z, float lacunarity, float gain, int octaves);
84 extern float stb_perlin_turbulence_noise3(float x, float y, float z, float lacunarity, float gain, int octaves);
85 #ifdef __cplusplus
86 }
87 #endif
88
89 #ifdef STB_PERLIN_IMPLEMENTATION
90
91 #include <math.h> // fabs()
92
93 // not same permutation table as Perlin's reference to avoid copyright issues;
94 // Perlin's table can be found at http://mrl.nyu.edu/~perlin/noise/
95 static unsigned char stb__perlin_randtab[512] =
96 {
97 23, 125, 161, 52, 103, 117, 70, 37, 247, 101, 203, 169, 124, 126, 44, 123,
98 152, 238, 145, 45, 171, 114, 253, 10, 192, 136, 4, 157, 249, 30, 35, 72,
99 175, 63, 77, 90, 181, 16, 96, 111, 133, 104, 75, 162, 93, 56, 66, 240,
100 8, 50, 84, 229, 49, 210, 173, 239, 141, 1, 87, 18, 2, 198, 143, 57,
101 225, 160, 58, 217, 168, 206, 245, 204, 199, 6, 73, 60, 20, 230, 211, 233,
102 94, 200, 88, 9, 74, 155, 33, 15, 219, 130, 226, 202, 83, 236, 42, 172,
103 165, 218, 55, 222, 46, 107, 98, 154, 109, 67, 196, 178, 127, 158, 13, 243,
104 65, 79, 166, 248, 25, 224, 115, 80, 68, 51, 184, 128, 232, 208, 151, 122,
105 26, 212, 105, 43, 179, 213, 235, 148, 146, 89, 14, 195, 28, 78, 112, 76,
106 250, 47, 24, 251, 140, 108, 186, 190, 228, 170, 183, 139, 39, 188, 244, 246,
107 132, 48, 119, 144, 180, 138, 134, 193, 82, 182, 120, 121, 86, 220, 209, 3,
108 91, 241, 149, 85, 205, 150, 113, 216, 31, 100, 41, 164, 177, 214, 153, 231,
109 38, 71, 185, 174, 97, 201, 29, 95, 7, 92, 54, 254, 191, 118, 34, 221,
110 131, 11, 163, 99, 234, 81, 227, 147, 156, 176, 17, 142, 69, 12, 110, 62,
111 27, 255, 0, 194, 59, 116, 242, 252, 19, 21, 187, 53, 207, 129, 64, 135,
112 61, 40, 167, 237, 102, 223, 106, 159, 197, 189, 215, 137, 36, 32, 22, 5,
113
114 // and a second copy so we don't need an extra mask or static initializer
115 23, 125, 161, 52, 103, 117, 70, 37, 247, 101, 203, 169, 124, 126, 44, 123,
116 152, 238, 145, 45, 171, 114, 253, 10, 192, 136, 4, 157, 249, 30, 35, 72,
117 175, 63, 77, 90, 181, 16, 96, 111, 133, 104, 75, 162, 93, 56, 66, 240,
118 8, 50, 84, 229, 49, 210, 173, 239, 141, 1, 87, 18, 2, 198, 143, 57,
119 225, 160, 58, 217, 168, 206, 245, 204, 199, 6, 73, 60, 20, 230, 211, 233,
120 94, 200, 88, 9, 74, 155, 33, 15, 219, 130, 226, 202, 83, 236, 42, 172,
121 165, 218, 55, 222, 46, 107, 98, 154, 109, 67, 196, 178, 127, 158, 13, 243,
122 65, 79, 166, 248, 25, 224, 115, 80, 68, 51, 184, 128, 232, 208, 151, 122,
123 26, 212, 105, 43, 179, 213, 235, 148, 146, 89, 14, 195, 28, 78, 112, 76,
124 250, 47, 24, 251, 140, 108, 186, 190, 228, 170, 183, 139, 39, 188, 244, 246,
125 132, 48, 119, 144, 180, 138, 134, 193, 82, 182, 120, 121, 86, 220, 209, 3,
126 91, 241, 149, 85, 205, 150, 113, 216, 31, 100, 41, 164, 177, 214, 153, 231,
127 38, 71, 185, 174, 97, 201, 29, 95, 7, 92, 54, 254, 191, 118, 34, 221,
128 131, 11, 163, 99, 234, 81, 227, 147, 156, 176, 17, 142, 69, 12, 110, 62,
129 27, 255, 0, 194, 59, 116, 242, 252, 19, 21, 187, 53, 207, 129, 64, 135,
130 61, 40, 167, 237, 102, 223, 106, 159, 197, 189, 215, 137, 36, 32, 22, 5,
131 };
132
133
134 // perlin's gradient has 12 cases so some get used 1/16th of the time
135 // and some 2/16ths. We reduce bias by changing those fractions
136 // to 5/64ths and 6/64ths
137
138 // this array is designed to match the previous implementation
139 // of gradient hash: indices[stb__perlin_randtab[i]&63]
140 static unsigned char stb__perlin_randtab_grad_idx[512] =
141 {
142 7, 9, 5, 0, 11, 1, 6, 9, 3, 9, 11, 1, 8, 10, 4, 7,
143 8, 6, 1, 5, 3, 10, 9, 10, 0, 8, 4, 1, 5, 2, 7, 8,
144 7, 11, 9, 10, 1, 0, 4, 7, 5, 0, 11, 6, 1, 4, 2, 8,
145 8, 10, 4, 9, 9, 2, 5, 7, 9, 1, 7, 2, 2, 6, 11, 5,
146 5, 4, 6, 9, 0, 1, 1, 0, 7, 6, 9, 8, 4, 10, 3, 1,
147 2, 8, 8, 9, 10, 11, 5, 11, 11, 2, 6, 10, 3, 4, 2, 4,
148 9, 10, 3, 2, 6, 3, 6, 10, 5, 3, 4, 10, 11, 2, 9, 11,
149 1, 11, 10, 4, 9, 4, 11, 0, 4, 11, 4, 0, 0, 0, 7, 6,
150 10, 4, 1, 3, 11, 5, 3, 4, 2, 9, 1, 3, 0, 1, 8, 0,
151 6, 7, 8, 7, 0, 4, 6, 10, 8, 2, 3, 11, 11, 8, 0, 2,
152 4, 8, 3, 0, 0, 10, 6, 1, 2, 2, 4, 5, 6, 0, 1, 3,
153 11, 9, 5, 5, 9, 6, 9, 8, 3, 8, 1, 8, 9, 6, 9, 11,
154 10, 7, 5, 6, 5, 9, 1, 3, 7, 0, 2, 10, 11, 2, 6, 1,
155 3, 11, 7, 7, 2, 1, 7, 3, 0, 8, 1, 1, 5, 0, 6, 10,
156 11, 11, 0, 2, 7, 0, 10, 8, 3, 5, 7, 1, 11, 1, 0, 7,
157 9, 0, 11, 5, 10, 3, 2, 3, 5, 9, 7, 9, 8, 4, 6, 5,
158
159 // and a second copy so we don't need an extra mask or static initializer
160 7, 9, 5, 0, 11, 1, 6, 9, 3, 9, 11, 1, 8, 10, 4, 7,
161 8, 6, 1, 5, 3, 10, 9, 10, 0, 8, 4, 1, 5, 2, 7, 8,
162 7, 11, 9, 10, 1, 0, 4, 7, 5, 0, 11, 6, 1, 4, 2, 8,
163 8, 10, 4, 9, 9, 2, 5, 7, 9, 1, 7, 2, 2, 6, 11, 5,
164 5, 4, 6, 9, 0, 1, 1, 0, 7, 6, 9, 8, 4, 10, 3, 1,
165 2, 8, 8, 9, 10, 11, 5, 11, 11, 2, 6, 10, 3, 4, 2, 4,
166 9, 10, 3, 2, 6, 3, 6, 10, 5, 3, 4, 10, 11, 2, 9, 11,
167 1, 11, 10, 4, 9, 4, 11, 0, 4, 11, 4, 0, 0, 0, 7, 6,
168 10, 4, 1, 3, 11, 5, 3, 4, 2, 9, 1, 3, 0, 1, 8, 0,
169 6, 7, 8, 7, 0, 4, 6, 10, 8, 2, 3, 11, 11, 8, 0, 2,
170 4, 8, 3, 0, 0, 10, 6, 1, 2, 2, 4, 5, 6, 0, 1, 3,
171 11, 9, 5, 5, 9, 6, 9, 8, 3, 8, 1, 8, 9, 6, 9, 11,
172 10, 7, 5, 6, 5, 9, 1, 3, 7, 0, 2, 10, 11, 2, 6, 1,
173 3, 11, 7, 7, 2, 1, 7, 3, 0, 8, 1, 1, 5, 0, 6, 10,
174 11, 11, 0, 2, 7, 0, 10, 8, 3, 5, 7, 1, 11, 1, 0, 7,
175 9, 0, 11, 5, 10, 3, 2, 3, 5, 9, 7, 9, 8, 4, 6, 5,
176 };
177
178 static float stb__perlin_lerp(float a, float b, float t)
179 {
180 return a + (b-a) * t;
181 }
182
183 static int stb__perlin_fastfloor(float a)
184 {
185 int ai = (int) a;
186 return (a < ai) ? ai-1 : ai;
187 }
188
189 // different grad function from Perlin's, but easy to modify to match reference
190 static float stb__perlin_grad(int grad_idx, float x, float y, float z)
191 {
192 static float basis[12][4] =
193 {
194 { 1, 1, 0 },
195 { -1, 1, 0 },
196 { 1,-1, 0 },
197 { -1,-1, 0 },
198 { 1, 0, 1 },
199 { -1, 0, 1 },
200 { 1, 0,-1 },
201 { -1, 0,-1 },
202 { 0, 1, 1 },
203 { 0,-1, 1 },
204 { 0, 1,-1 },
205 { 0,-1,-1 },
206 };
207
208 float *grad = basis[grad_idx];
209 return grad[0]*x + grad[1]*y + grad[2]*z;
210 }
211
212 float stb_perlin_noise3_internal(float x, float y, float z, int x_wrap, int y_wrap, int z_wrap, unsigned char seed)
213 {
214 float u,v,w;
215 float n000,n001,n010,n011,n100,n101,n110,n111;
216 float n00,n01,n10,n11;
217 float n0,n1;
218
219 unsigned int x_mask = (x_wrap-1) & 255;
220 unsigned int y_mask = (y_wrap-1) & 255;
221 unsigned int z_mask = (z_wrap-1) & 255;
222 int px = stb__perlin_fastfloor(x);
223 int py = stb__perlin_fastfloor(y);
224 int pz = stb__perlin_fastfloor(z);
225 int x0 = px & x_mask, x1 = (px+1) & x_mask;
226 int y0 = py & y_mask, y1 = (py+1) & y_mask;
227 int z0 = pz & z_mask, z1 = (pz+1) & z_mask;
228 int r0,r1, r00,r01,r10,r11;
229
230 #define stb__perlin_ease(a) (((a*6-15)*a + 10) * a * a * a)
231
232 x -= px; u = stb__perlin_ease(x);
233 y -= py; v = stb__perlin_ease(y);
234 z -= pz; w = stb__perlin_ease(z);
235
236 r0 = stb__perlin_randtab[x0+seed];
237 r1 = stb__perlin_randtab[x1+seed];
238
239 r00 = stb__perlin_randtab[r0+y0];
240 r01 = stb__perlin_randtab[r0+y1];
241 r10 = stb__perlin_randtab[r1+y0];
242 r11 = stb__perlin_randtab[r1+y1];
243
244 n000 = stb__perlin_grad(stb__perlin_randtab_grad_idx[r00+z0], x , y , z );
245 n001 = stb__perlin_grad(stb__perlin_randtab_grad_idx[r00+z1], x , y , z-1 );
246 n010 = stb__perlin_grad(stb__perlin_randtab_grad_idx[r01+z0], x , y-1, z );
247 n011 = stb__perlin_grad(stb__perlin_randtab_grad_idx[r01+z1], x , y-1, z-1 );
248 n100 = stb__perlin_grad(stb__perlin_randtab_grad_idx[r10+z0], x-1, y , z );
249 n101 = stb__perlin_grad(stb__perlin_randtab_grad_idx[r10+z1], x-1, y , z-1 );
250 n110 = stb__perlin_grad(stb__perlin_randtab_grad_idx[r11+z0], x-1, y-1, z );
251 n111 = stb__perlin_grad(stb__perlin_randtab_grad_idx[r11+z1], x-1, y-1, z-1 );
252
253 n00 = stb__perlin_lerp(n000,n001,w);
254 n01 = stb__perlin_lerp(n010,n011,w);
255 n10 = stb__perlin_lerp(n100,n101,w);
256 n11 = stb__perlin_lerp(n110,n111,w);
257
258 n0 = stb__perlin_lerp(n00,n01,v);
259 n1 = stb__perlin_lerp(n10,n11,v);
260
261 return stb__perlin_lerp(n0,n1,u);
262 }
263
264 float stb_perlin_noise3(float x, float y, float z, int x_wrap, int y_wrap, int z_wrap)
265 {
266 return stb_perlin_noise3_internal(x,y,z,x_wrap,y_wrap,z_wrap,0);
267 }
268
269 float stb_perlin_noise3_seed(float x, float y, float z, int x_wrap, int y_wrap, int z_wrap, int seed)
270 {
271 return stb_perlin_noise3_internal(x,y,z,x_wrap,y_wrap,z_wrap, (unsigned char) seed);
272 }
273
274 float stb_perlin_ridge_noise3(float x, float y, float z, float lacunarity, float gain, float offset, int octaves)
275 {
276 int i;
277 float frequency = 1.0f;
278 float prev = 1.0f;
279 float amplitude = 0.5f;
280 float sum = 0.0f;
281
282 for (i = 0; i < octaves; i++) {
283 float r = stb_perlin_noise3_internal(x*frequency,y*frequency,z*frequency,0,0,0,(unsigned char)i);
284 r = offset - (float) fabs(r);
285 r = r*r;
286 sum += r*amplitude*prev;
287 prev = r;
288 frequency *= lacunarity;
289 amplitude *= gain;
290 }
291 return sum;
292 }
293
294 float stb_perlin_fbm_noise3(float x, float y, float z, float lacunarity, float gain, int octaves)
295 {
296 int i;
297 float frequency = 1.0f;
298 float amplitude = 1.0f;
299 float sum = 0.0f;
300
301 for (i = 0; i < octaves; i++) {
302 sum += stb_perlin_noise3_internal(x*frequency,y*frequency,z*frequency,0,0,0,(unsigned char)i)*amplitude;
303 frequency *= lacunarity;
304 amplitude *= gain;
305 }
306 return sum;
307 }
308
309 float stb_perlin_turbulence_noise3(float x, float y, float z, float lacunarity, float gain, int octaves)
310 {
311 int i;
312 float frequency = 1.0f;
313 float amplitude = 1.0f;
314 float sum = 0.0f;
315
316 for (i = 0; i < octaves; i++) {
317 float r = stb_perlin_noise3_internal(x*frequency,y*frequency,z*frequency,0,0,0,(unsigned char)i)*amplitude;
318 sum += (float) fabs(r);
319 frequency *= lacunarity;
320 amplitude *= gain;
321 }
322 return sum;
323 }
324
325 #endif // STB_PERLIN_IMPLEMENTATION
326
327 /*
328 ------------------------------------------------------------------------------
329 This software is available under 2 licenses -- choose whichever you prefer.
330 ------------------------------------------------------------------------------
331 ALTERNATIVE A - MIT License
332 Copyright (c) 2017 Sean Barrett
333 Permission is hereby granted, free of charge, to any person obtaining a copy of
334 this software and associated documentation files (the "Software"), to deal in
335 the Software without restriction, including without limitation the rights to
336 use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
337 of the Software, and to permit persons to whom the Software is furnished to do
338 so, subject to the following conditions:
339 The above copyright notice and this permission notice shall be included in all
340 copies or substantial portions of the Software.
341 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
342 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
343 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
344 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
345 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
346 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
347 SOFTWARE.
348 ------------------------------------------------------------------------------
349 ALTERNATIVE B - Public Domain (www.unlicense.org)
350 This is free and unencumbered software released into the public domain.
351 Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
352 software, either in source code form or as a compiled binary, for any purpose,
353 commercial or non-commercial, and by any means.
354 In jurisdictions that recognize copyright laws, the author or authors of this
355 software dedicate any and all copyright interest in the software to the public
356 domain. We make this dedication for the benefit of the public at large and to
357 the detriment of our heirs and successors. We intend this dedication to be an
358 overt act of relinquishment in perpetuity of all present and future rights to
359 this software under copyright law.
360 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
361 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
362 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
363 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
364 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
365 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
366 ------------------------------------------------------------------------------
367 */
The diff for file include/stb_truetype.h is too big (5011 changes) and cannot be shown.
The diff for file include/stb_vorbis.c is too big (5575 changes) and cannot be shown.
File include/tm_json.h added (mode: 100644) (index 0000000..3debe30)
1 /*
2 tm_json.h v0.9.1 - public domain - https://github.com/to-miz/tm
3 Author: Tolga Mizrak 2016
4
5 No warranty; use at your own risk.
6
7 LICENSE
8 See license notes at end of file.
9
10 USAGE
11 This file works as both the header and implementation.
12 To implement the interfaces in this header,
13 #define TM_JSON_IMPLEMENTATION
14 in ONE C or C++ source file before #including this header.
15
16 See SWITCHES for more options.
17
18 PURPOSE
19 A Utf-8 json parser, that is extensible using a lot of different flags.
20 Can be used as both a simple and lightweight non validating parser, as well as a strict
21 validating parser. Using the functions with the Ex extension, you can make the parser
22 accept Json5 files.
23 The parser only works with and expects valid Utf-8 encoded input. Utf-8 encoding is
24 not validated by the parser.
25
26 DOCUMENTATION
27 Nil Object:
28 Nil Array:
29 Nil Value:
30 Any function or method that returns a JsonObject or JsonArray directly returns a nil object
31 or array in case the value is not containing an object or array.
32 If you then pass these nil objects or arrays into functions that accept JsonObjects or
33 JsonArrays, you will be essentially performing a noop. Getting members of nil objects in
34 turn return nil values, which when converted into an int for instance return the default
35 value supplied to the conversion function.
36 Nil objects allow you to write code without having to check for validity whenever you do a
37 query. The code will run silently without raising errors and you will fill your data with
38 default values.
39 You can check whether an object, array or value is nil using a simple if in C++ (all of
40 them overload explicit operator bool) or using jsonIsValidObject/Array/Value.
41
42 Difference between Nil Values and Values that contain null:
43 Nil values are returned when querying for a value that does not exist in the json (nil =
44 not in list). Values contain null if they exist in the json and were assigned null
45 explicitly (ie "value": null).
46 You can differentiate between nil values and values that contain null by calling
47 jsonIsNull or isNull member function.
48 Nil values return false for jsonIsNull, but values that contain a null return true.
49
50 SWITCHES
51 You can change how most of the things inside this library are implemented.
52 Starting from which dependencies to use, you can make this library not use the crt by defining
53 the functions it depends on (see the block of #defines at TM_MEMCHR).
54 These need to be defined before the header is included.
55 You can toggle some extra functionality using these switches:
56 TMJ_NO_INT64:
57 define this if your target platform does not have 64bit integers.
58 TM_STRING_VIEW:
59 define this if you have a string_view class. This will enable some overloads that will
60 accept your string_view class. Define like this:
61 #define TM_STRING_VIEW my_string_view_class_name
62 #define TM_STRING_VIEW_DATA(name) (name).data()
63 #define TM_STRING_VIEW_SIZE(name) (name).size()
64 The example above assumes that getting the data and size of the string_view happens
65 through member functions. If your string_view interface differs, change accordingly.
66 TMJ_TO_INT(first, last, out_ptr, base):
67 TMJ_TO_UINT(first, last, out_ptr, base):
68 TMJ_TO_INT64(first, last, out_ptr, base):
69 TMJ_TO_UINT64(first, last, out_ptr, base):
70 TMJ_TO_FLOAT(first, last, out_ptr):
71 TMJ_TO_DOUBLE(first, last, out_ptr):
72 Define these macros if you have locale independent string conversion functions that
73 accept non nullterminated strings.
74 These macros represent functions with these signatures:
75 void to_int(const char* first, const char* last, int32_t* out_ptr, int32_t base)
76 void to_uint(const char* first, const char* last, uint32_t* out_ptr, int base)
77 void to_int64(const char* first, const char* last, int64_t* out_ptr, int base)
78 void to_uint64(const char* first, const char* last, uint64_t* out_ptr, int base)
79 void to_float(const char* first, const char* last, float* out_ptr)
80 void to_double(const char* first, const char* last, double* out_ptr)
81 Arguments:
82 first/last: A pair of iterators to a non nullterminated string.
83 out_ptr: Output value to be written on successful conversion. On error, it should
84 stay unmodified.
85 base: Base to use for the integer conversion.
86 If you do not define these, the implementation will use stdlib.h to implement them.
87 Since the crt string conversion functions do not allow non nullterminated strings, the
88 implementation has to copy the strings into a temporary buffer and nullterminate it
89 before passing them into the crt string conversion functions.
90 TMJ_DEFINE_INFINITY_AND_NAN:
91 Define this if you want to use the float extension flag and the math.h definitions of
92 INFINITY and NAN. If you do not wish to use the float extension flag
93 when parsing (JSON_READER_EXTENDED_FLOATS), you do not need to define these.
94 Otherwise define TM_INFINITY and TM_NAN yourself with the inf and nan representations
95 on your platform.
96 TM_INFINITY:
97 TM_NAN:
98 These are automatically defined if you define TMJ_DEFINE_INFINITY_AND_NAN and if math.h
99 has definitions for INFINITY and NAN. If you do not wish to use the float extension flag
100 when parsing (JSON_READER_EXTENDED_FLOATS), you do not need to define these.
101 Otherwise define TM_INFINITY and TM_NAN yourself with the inf and nan representations
102 on your platform.
103
104 ISSUES
105 - No Utf-8 encoding validation of input data.
106 Not really an issue but out of scope of this library, since the parsing functions expect
107 valid Utf-8 encoded input. Validation should be done before parsing, for instance by using
108 tm_unicode.h.
109 - Mismatched brackets will be reported as JERR_UNEXPECTED_EOF instead of JERR_MISMATCHED_BRACKETS
110 when using jsonMakeDocument, because jsonSkipCurrent skips until eof on mismatched brackets.
111 - Missing documentation and example usage code.
112 - Json objects aren't implemented as dictionaries/hashmaps, instead they use linear lookup.
113 Json objects should be turned into hashmaps manually when applicable.
114 - Fallback string conversion is based on <strlib.h> and thus locale dependent.
115 Workaround is not changing the LC_NUMERIC locale from the default "C" locale
116 or not using the fallback string conversion routines at all (see SWITCHES and TMJ_TO_INT).
117 - Json5 considers some multibyte unicode codepoints as whitespace. This parser currently only supports
118 single byte whitespace.
119 - Json5 unquoted identifiers don't allow for \u unicode escape sequences or unicode letters.
120
121 HISTORY
122 v0.9.1 08.11.20 Fixed some warnings with newest MSCV compiler.
123 v0.9.0 03.04.20 Added jsonResolveJsonPointer, that resolves Json Pointer according to
124 https://tools.ietf.org/html/rfc6901
125 v0.4.2 29.10.19 Fixed a buffer overrun error in skipWhitespace.
126 v0.4.1 29.10.19 Added JSON_READER_ALLOW_EXTENDED_WHITESPACE.
127 Fixed various issues with unquoted property names, escaped newlines and json5 string validation.
128 Parser is now tested against json5-tests (https://github.com/json5/json5-tests).
129 Added new issues regarding Json5 parsing.
130 v0.4.0 29.10.19 Fixed single line and block comments being incorrectly handled in allocated documents.
131 Added new internal token type JTOK_PROPERTYCOLON to allow for comments between property
132 names and colons.
133 Added JSON_READER_ALLOW_LEADING_AND_TRAILING_DECIMALPOINT for improved json5 parsing.
134 Fixed some json5 parsing issues regarding number parsing.
135 v0.3.1 30.07.19 Fixed a logic error in readNumber (missing parenthesis around logical expression).
136 v0.3.0 03.07.19 Fixed strict parsing, parser now allows for root level values.
137 Fixed false error reporting for some valid json files.
138 Parser is now tested against JSONTestSuite (https://github.com/nst/JSONTestSuite).
139 v0.2.5 13.04.19 Fixed macro argument names of TMJ_TO_INT etc. having wrong order.
140 v0.2.4 25.02.19 Implemented Unicode escape sequences.
141 Fixed a bug with unescaped string copying.
142 Fixed signed size_t compilation warnings.
143 v0.2.3 24.02.19 Fixed a bug with string escaping. Escaped quotation marks weren't detected properly.
144 v0.2.2 15.01.19 Changed signature of conversion functions to use sized integer types like int32_t.
145 v0.2.1 14.01.19 Fixed some compilation errors when both TM_SIGNED_SIZE_T and TM_STRING_VIEW
146 are defined.
147 Improved support for TM_STRING_VIEW.
148 v0.2.0 03.01.19 Removed TMJ_PASS_BY_POINTER.
149 Removed attempts ate locale independent string conversions based on CRT due to
150 being unsafe/slow.
151 Changed the TMJ_TO_INT/etc macros to be easier to redefine using <charconv>.
152 v0.1.8 01.01.19 Removed unnecessary debug assertion from jsonIsNull.
153 Made the fallback string conversion functions locale independent.
154 v0.1.7 31.12.18 Added stringStartsWith to be used when appropriate instead of stringEquals.
155 Fixed a bug with null values not being parsed properly.
156 Added more error info to jsonDocument.
157 Fixed GCC unused-function warning when building in release builds.
158 Improved default implementation of string conversion functions.
159 Fixed clang compilation errors for C99 compilation.
160 Fixed cl compilation errors for C99 compilation.
161 Switched from using toupper to tolower for case insensitive comparisons.
162 Fixed jsonToFloat to also use TM_INFINITY and TM_NAN.
163 Changed remaining assert calls to TM_ASSERT.
164 v0.1.6 29.12.18 Fixed GCC warnings for multi-line comment, missing-field-initializers
165 and implicit-fallthrough.
166 Fixed a bug with compareString acting like stringStartsWith.
167 Renamed compareString functions to stringEquals, since they only check equality.
168 Removed tmj_bool and TMJ_NULL, using tm_bool and TM_NULL instead.
169 Reformatted and switched to indentation using spaces.
170 v0.1.5 06.10.18 Refactored preprocessor.
171 Changed tmj_size_t to tm_size_t.
172 Changed TMJ_STRING_VIEW to TM_STRING_VIEW.
173 v0.1.4b 25.08.18 Added repository link.
174 v0.1.4a 22.07.18 Fixed some warnings on C99 compilation.
175 v0.1.4 22.07.18 Removed overloads of C functions for C++, updated licensing.
176 v0.1.3 10.02.17 String view operators are now preferred to const char* operators in JsonObject.
177 v0.1.2 28.01.17 Added jsonObjectArray for usage with C++11 range based loops.
178 v0.1.1d 10.01.17 Minor change from static const char* to static const char* const in some places.
179 v0.1.1c 07.11.16 Minor edits, no runtime changes.
180 v0.1.1b 10.10.16 Fixed some warnings when tm_size_t is signed.
181 v0.1.1a 07.10.16 Removed usage of unsigned arithmetic when tm_size_t is signed.
182 v0.1.1 13.09.16 Changed JsonValue interface to have operator[] overloads for convenience.
183 Added more string_view support through TM_STRING_VIEW.
184 v0.1 11.09.16 Initial commit.
185 */
186
187 /* Examples. */
188
189 #if 0
190 // Sample code to use C++17 <charconv> header as the backend for string conversions.
191 // <charconv> has the advantage that it is faster and locale independent from the get go.
192
193 #include <charconv>
194
195 #define TMJ_TO_INT(first, last, out_ptr, base) std::from_chars((first), (last), *(out_ptr), (base))
196 #define TMJ_TO_UINT(first, last, out_ptr, base) std::from_chars((first), (last), *(out_ptr), (base))
197 #define TMJ_TO_INT64(first, last, out_ptr, base) std::from_chars((first), (last), *(out_ptr), (base))
198 #define TMJ_TO_UINT64(first, last, out_ptr, base) std::from_chars((first), (last), *(out_ptr), (base))
199 #define TMJ_TO_FLOAT(first, last, out_ptr) std::from_chars((first), (last), *(out_ptr))
200 #define TMJ_TO_DOUBLE(first, last, out_ptr) std::from_chars((first), (last), *(out_ptr))
201 #define TM_JSON_IMPLEMENTATION
202 #include <tm_json.h>
203
204 // Now the implementation of tm_json will use <charconv> as the backend for string conversions.
205 #endif
206
207 /* clang-format off */
208 #ifdef TM_JSON_IMPLEMENTATION
209 /* define these to avoid crt */
210 #if !defined(TM_MEMCHR) || !defined(TM_STRLEN) || !defined(TM_STRCHR) \
211 || !defined(TM_MEMCMP) || !defined(TM_MEMCPY) || !defined(TM_MEMSET)
212
213 #include <string.h>
214 #ifndef TM_MEMCHR
215 #define TM_MEMCHR memchr
216 #endif
217 #ifndef TM_STRLEN
218 #define TM_STRLEN strlen
219 #endif
220 #ifndef TM_STRCHR
221 #define TM_STRCHR strchr
222 #endif
223 #ifndef TM_MEMCMP
224 #define TM_MEMCMP memcmp
225 #endif
226 #ifndef TM_MEMCPY
227 #define TM_MEMCPY memcpy
228 #endif
229 #ifndef TM_MEMSET
230 #define TM_MEMSET memset
231 #endif
232 #endif
233 #if !defined(TM_ISDIGIT) || !defined(TM_ISALPHA) || !defined(TM_ISXDIGIT) \
234 || !defined(TM_ISSPACE) || !defined(TM_TOLOWER)
235 #include <ctype.h>
236 #ifndef TM_ISDIGIT
237 #define TM_ISDIGIT isdigit
238 #endif
239 #ifndef TM_ISALPHA
240 #define TM_ISALPHA isalpha
241 #endif
242 #ifndef TM_ISXDIGIT
243 #define TM_ISXDIGIT isxdigit
244 #endif
245 #ifndef TM_ISSPACE
246 #define TM_ISSPACE isspace
247 #endif
248 #ifndef TM_TOLOWER
249 #define TM_TOLOWER tolower
250 #endif
251 #endif
252
253 /* Global allocation functions to use. */
254 #if !defined(TM_MALLOC) || !defined(TM_REALLOC) || !defined(TM_FREE)
255 // Either all or none have to be defined.
256 #include <stdlib.h>
257 #define TM_MALLOC(size, alignment) malloc((size))
258 #define TM_REALLOC(ptr, new_size, new_alignment) realloc((ptr), (new_size))
259 // #define TM_REALLOC_IN_PLACE(ptr, new_size, new_alignment) // Optional
260 #define TM_FREE(ptr) free((ptr))
261 // Define as 1 if alignment parameter is actually respected.
262 #define TM_MALLOC_ALIGNMENT_AWARE 0
263 #endif
264
265 // define this if you want to use infinity and nan extensions for json using math.h
266 // otherwise define TM_INFINITY and TM_NAN yourself with whatever the infinity and nan values
267 // are for your target platform
268 #ifdef TMJ_DEFINE_INFINITY_AND_NAN
269 #ifndef TM_INFINITY
270 #include <math.h>
271 #ifdef INFINITY
272 #define TM_INFINITY INFINITY
273 #endif
274 #ifdef NAN
275 #define TM_NAN NAN
276 #endif
277 #endif
278 #endif
279
280 // define these if you have string conversion functions that accept non nullterminated strings
281 // if you do not define TMJ_TO_INT etc, the implementation uses stdlib.h to implement these
282 // the signature of these functions are:
283 // str: a non nullterminated string
284 // len: the length of str
285 // base: base to use when converting str into the return value
286 // def: the default value to use if conversion fails
287 // for more details, see TMJ_TO_INT section at SWITCHES at the top of this file
288 #ifndef TMJ_TO_INT
289 #define TMJ_DEFINE_OWN_STRING_CONVERSIONS
290 #define TMJ_TO_INT(first, last, out_ptr, base) tmj_to_int((first), (last), (out_ptr), (base))
291 #define TMJ_TO_UINT(first, last, out_ptr, base) tmj_to_uint((first), (last), (out_ptr), (base))
292 #define TMJ_TO_INT64(first, last, out_ptr, base) tmj_to_int64((first), (last), (out_ptr), (base))
293 #define TMJ_TO_UINT64(first, last, out_ptr, base) tmj_to_uint64((first), (last), (out_ptr), (base))
294 #define TMJ_TO_FLOAT(first, last, out_ptr) tmj_to_float((first), (last), (out_ptr))
295 #define TMJ_TO_DOUBLE(first, last, out_ptr) tmj_to_double((first), (last), (out_ptr))
296 #endif
297 #endif
298
299 #ifndef _TM_JSON_H_INCLUDED_
300 #define _TM_JSON_H_INCLUDED_
301
302 #ifndef TM_ASSERT
303 #include <assert.h>
304 #define TM_ASSERT assert
305 #endif
306
307 #include <stdint.h>
308
309 /* size_t is unsigned by default, but we also allow for signed and/or 32bit size_t.
310 You can override this block by defining TM_SIZE_T_DEFINED and the typedefs before including this file. */
311 #ifndef TM_SIZE_T_DEFINED
312 #define TM_SIZE_T_DEFINED
313 #define TM_SIZE_T_IS_SIGNED 0 /* define to 1 if tm_size_t is signed */
314 #include <stddef.h> /* include C version so identifiers are in global namespace */
315 typedef size_t tm_size_t;
316 #endif /* !defined(TM_SIZE_T_DEFINED) */
317
318 typedef unsigned char tmj_nesting_count;
319 #define TMJ_MAX_NESTING_COUNT 255
320
321 #ifndef TMJ_STATIC
322 #define TMJ_DEF extern
323 #else
324 #define TMJ_DEF static
325 #endif
326
327 /* Use null of the underlying language. */
328 #ifndef TM_NULL
329 #ifdef __cplusplus
330 #define TM_NULL nullptr
331 #else
332 #define TM_NULL NULL
333 #endif
334 #endif
335
336 /* Native bools, override by defining TM_BOOL_DEFINED yourself before including this file. */
337 #ifndef TM_BOOL_DEFINED
338 #define TM_BOOL_DEFINED
339 #ifdef __cplusplus
340 typedef bool tm_bool;
341 #define TM_TRUE true
342 #define TM_FALSE false
343 #else
344 typedef _Bool tm_bool;
345 #define TM_TRUE 1
346 #define TM_FALSE 0
347 #endif
348 #endif /* !defined(TM_BOOL_DEFINED) */
349
350 /* clang-format on */
351
352 typedef enum {
353 JVAL_NULL,
354 JVAL_STRING,
355 JVAL_OBJECT,
356 JVAL_ARRAY,
357 JVAL_INT,
358 JVAL_UINT,
359 JVAL_BOOL,
360 JVAL_FLOAT,
361
362 // extended types
363 // JVAL_UINT_HEX,
364 JVAL_RAW_STRING,
365 JVAL_CONCAT_STRING,
366 } JsonValueType;
367
368 typedef enum {
369 JTOK_EOF,
370
371 JTOK_PROPERTYNAME,
372 JTOK_OBJECT_START,
373 JTOK_ARRAY_START,
374 JTOK_OBJECT_END,
375 JTOK_ARRAY_END,
376 JTOK_VALUE,
377 JTOK_COMMENT,
378
379 // These two tokens will not be returned by jsonNextToken and similar, they are internal only.
380 JTOK_COMMA,
381 JTOK_PROPERTYCOLON,
382
383 // Returned on tokenizing error.
384 JTOK_ERROR,
385 } JsonTokenType;
386
387 typedef enum {
388 // allow single line comments with '//'
389 JSON_READER_SINGLE_LINE_COMMENTS = (1u << 0u),
390
391 // allow block comments with '/**/'
392 JSON_READER_BLOCK_COMMENTS = (1u << 1u),
393
394 // allow python comments using '#'
395 JSON_READER_PYTHON_COMMENTS = (1u << 2u),
396
397 // allow trailing commas in arrays and objects
398 JSON_READER_TRAILING_COMMA = (1u << 3u),
399
400 // allow unquoted property names
401 JSON_READER_UNQUOTED_PROPERTY_NAMES = (1u << 4u),
402
403 // allow single quoted strings using '
404 JSON_READER_SINGLE_QUOTED_STRINGS = (1u << 5u),
405
406 // allow infinity, -infinity, nan, -nan
407 JSON_READER_EXTENDED_FLOATS = (1u << 6u),
408
409 // allow hexadecimal integers using prefix '0x'
410 JSON_READER_HEXADECIMAL = (1u << 7u),
411
412 /*
413 allow multiline strings using escaped newlines
414 example:
415 "property": "this is a multiline \
416 string"
417 */
418 JSON_READER_ESCAPED_MULTILINE_STRINGS = (1u << 8u),
419
420 // allow C++0x style raw string literals
421 // example
422 // "property": R"delim(...)delim"
423 // if both cpp style raw strings and python style raw strings are enabled,
424 // cpp style raw strings have precedence
425 JSON_READER_CPP_RAW_STRINGS = (1u << 9u),
426
427 // allow python style raw string literals
428 // example
429 // "property": r'...'
430 JSON_READER_PYTHON_RAW_STRINGS = (1u << 10u),
431
432 // allow C style concatenated multiline strings after a property name
433 // example
434 // "property": "this is a multiline "
435 // "string"
436 JSON_READER_CONCATENATED_STRINGS = (1u << 11u),
437
438 // allow C style concatenated multiline strings in arrays, errorprone in case a comma is
439 // forgotten mistakenly
440 JSON_READER_CONCATENATED_STRINGS_IN_ARRAYS = (1u << 12u),
441
442 // allow '=' and ':' for property names
443 JSON_READER_ALLOW_EQUAL = (1u << 13u),
444
445 // allow numbers to begin with an explicit plus sign
446 JSON_READER_ALLOW_PLUS_SIGN = (1u << 14u),
447
448 // allow case insensitive true, false, null keywords and infinity etc in case of extended floats
449 JSON_READER_IGNORE_CASE_KEYWORDS = (1u << 15u),
450
451 // allow decimal point to lead and trail numbers like .8 or 8.
452 JSON_READER_ALLOW_LEADING_AND_TRAILING_DECIMALPOINT = (1u << 16u),
453
454 // allow some whitespace that strict json doesn't allow in json files like form feed.
455 JSON_READER_ALLOW_EXTENDED_WHITESPACE = (1u << 17u),
456
457 // use these flags to parse json5 files
458 JSON_READER_JSON5 =
459 (JSON_READER_SINGLE_LINE_COMMENTS | JSON_READER_BLOCK_COMMENTS | JSON_READER_TRAILING_COMMA |
460 JSON_READER_UNQUOTED_PROPERTY_NAMES | JSON_READER_SINGLE_QUOTED_STRINGS | JSON_READER_EXTENDED_FLOATS |
461 JSON_READER_HEXADECIMAL | JSON_READER_ESCAPED_MULTILINE_STRINGS | JSON_READER_ALLOW_PLUS_SIGN |
462 JSON_READER_ALLOW_LEADING_AND_TRAILING_DECIMALPOINT | JSON_READER_ALLOW_EXTENDED_WHITESPACE),
463
464 // all flags
465 JSON_READER_ALL =
466 (JSON_READER_SINGLE_LINE_COMMENTS | JSON_READER_BLOCK_COMMENTS | JSON_READER_PYTHON_COMMENTS |
467 JSON_READER_TRAILING_COMMA | JSON_READER_UNQUOTED_PROPERTY_NAMES | JSON_READER_SINGLE_QUOTED_STRINGS |
468 JSON_READER_EXTENDED_FLOATS | JSON_READER_HEXADECIMAL | JSON_READER_ESCAPED_MULTILINE_STRINGS |
469 JSON_READER_CPP_RAW_STRINGS | JSON_READER_PYTHON_RAW_STRINGS | JSON_READER_CONCATENATED_STRINGS |
470 JSON_READER_CONCATENATED_STRINGS_IN_ARRAYS | JSON_READER_ALLOW_EQUAL | JSON_READER_ALLOW_PLUS_SIGN |
471 JSON_READER_IGNORE_CASE_KEYWORDS),
472
473 // reasonably extended json, most parsers allow at least this much
474 JSON_READER_REASONABLE = (JSON_READER_SINGLE_LINE_COMMENTS | JSON_READER_TRAILING_COMMA),
475
476 // strict
477 JSON_READER_STRICT = 0u
478 } JsonReaderFlags;
479
480 typedef enum { JSON_CONTEXT_NULL, JSON_CONTEXT_OBJECT, JSON_CONTEXT_ARRAY } JsonContext;
481
482 typedef enum {
483 JSON_OK,
484 JERR_UNEXPECTED_TOKEN,
485 JERR_UNEXPECTED_EOF,
486 JERR_ILLFORMED_STRING,
487 JERR_MISMATCHED_BRACKETS,
488 JERR_OUT_OF_CONTEXT_STACK_MEMORY, // Not enough contextStackMemory to parse a given json file,
489 // occurs if there are more alternating context (going from
490 // { to [ and back) switches than memory.
491 JERR_NO_ROOT,
492 JERR_OUT_OF_MEMORY,
493 JERR_INTERNAL_ERROR
494 } JsonErrorType;
495
496 TMJ_DEF const char* jsonGetErrorString(JsonErrorType error);
497
498 typedef struct JsonStringViewStruct {
499 const char* data;
500 tm_size_t size;
501
502 #if defined(__cplusplus) && defined(TM_STRING_VIEW)
503 inline operator TM_STRING_VIEW() const { return TM_STRING_VIEW_MAKE(data, size); };
504 #endif
505 } JsonStringView;
506 typedef struct {
507 int8_t context;
508 tmj_nesting_count count;
509 } JsonContextEntry;
510 typedef struct {
511 JsonContextEntry* data;
512 tm_size_t size;
513 tm_size_t capacity;
514 } JsonContextStack;
515 typedef struct {
516 const char* data; // parsing data
517 tm_size_t size;
518
519 tm_size_t line; // current line
520 tm_size_t column; // current column
521
522 // these next 3 fields are safe to access
523 JsonStringView current; // the contents of the current token
524 JsonTokenType lastToken; // last token that was parsed
525 JsonValueType valueType; // value type of token, if token is JTOK_VALUE
526
527 unsigned int flags; // parser flags
528
529 JsonContextStack contextStack; // contextStack used when parsing in non implicit mode
530 JsonErrorType errorType;
531 } JsonReader;
532
533 // getter functions if you are uncomfortable accessing the inner of JsonReader
534 inline JsonStringView jsonGetString(JsonReader* reader) { return reader->current; }
535 inline JsonValueType jsonGetValueType(JsonReader* reader) { return reader->valueType; }
536
537 // Initializes and returns a JsonReader.
538 // params:
539 // data: The Utf-8 json file contents. Must be a valid Utf-8 encoded string.
540 // size: Size of data in bytes.
541 // contextStackMemory:
542 // The stack memory the reader uses for bookkeeping. Only needed if you use jsonNextToken or
543 // jsonNextTokenEx. If you plan to use the implicit versions (jsonNextTokenImplicit or
544 // jsonNextTokenImplicitEx), this can be NULL.
545 // contextStackSize: Element count of contextStackMemory.
546 // flags: Parsing flags used when parsing. See enum JsonReaderFlags for all valid flags.
547 TMJ_DEF JsonReader jsonMakeReader(const char* data, tm_size_t size, JsonContextEntry* contextStackMemory,
548 tm_size_t contextStackSize, unsigned int flags);
549
550 // parses json only accepting the following parsing flags:
551 // - JSON_READER_SINGLE_QUOTED_STRINGS
552 // - JSON_READER_SINGLE_LINE_COMMENTS
553 // - JSON_READER_TRAILING_COMMA
554 // - JSON_READER_STRICT
555 // - JSON_READER_ALLOW_EQUAL
556 // - JSON_READER_ESCAPED_MULTILINE_STRINGS
557 // - JSON_READER_ALLOW_PLUS_SIGN
558 // - JSON_READER_ALLOW_LEADING_AND_TRAILING_DECIMALPOINT
559 // since there are fewer special cases, it is slightly faster than jsonNextTokenEx and
560 // jsonNextTokenImplicitEx
561 TMJ_DEF JsonTokenType jsonNextTokenImplicit(JsonReader* reader, JsonContext currentContext);
562 TMJ_DEF JsonTokenType jsonNextToken(JsonReader* reader);
563 // parses the json until reaching eof, call this after having reached the closing bracket of root
564 // to make sure that nothing follows after the closing bracket
565 TMJ_DEF tm_bool jsonIsValidUntilEof(JsonReader* reader);
566
567 // parses json accepting all flags
568 TMJ_DEF JsonTokenType jsonNextTokenImplicitEx(JsonReader* reader, JsonContext currentContext);
569 TMJ_DEF JsonTokenType jsonNextTokenEx(JsonReader* reader);
570 TMJ_DEF tm_bool jsonIsValidUntilEofEx(JsonReader* reader);
571
572 // reads from json until root type is encountered
573 TMJ_DEF JsonTokenType jsonReadRootType(JsonReader* reader, tm_bool ex);
574 // skips current context
575 TMJ_DEF tm_bool jsonSkipCurrent(JsonReader* reader, JsonContext currentContext, tm_bool ex);
576
577 // copy the unescaped version of str into buffer with size
578 // JsonReader only stores the unprocessed contents of the current token, so you need to call this to
579 // get a copy of the parsed/unescaped string.
580 tm_size_t jsonCopyUnescapedString(JsonStringView str, char* buffer, tm_size_t size);
581
582 // copy a concatenated string.
583 // You only need to call this if you use JSON_READER_CONCATENATED_STRINGS or
584 // JSON_READER_CONCATENATED_STRINGS_IN_ARRAYS and the valueType of the current token is
585 // JVAL_CONCAT_STRING
586 tm_size_t jsonCopyConcatenatedString(JsonStringView str, char* buffer, tm_size_t size);
587
588 struct JsonStackAllocatorStruct;
589 typedef struct JsonStackAllocatorStruct JsonStackAllocator;
590
591 // same as the copy versions above, but these use JsonStackAllocator to allocate the result
592 JsonStringView jsonAllocateUnescapedString(JsonStackAllocator* allocator, JsonStringView str);
593 JsonStringView jsonAllocateConcatenatedString(JsonStackAllocator* allocator, JsonStringView str);
594
595 // value conversion functions to turn the contents of the current token to values
596 TMJ_DEF int32_t jsonToInt(JsonStringView str, int32_t def);
597 TMJ_DEF uint32_t jsonToUInt(JsonStringView str, uint32_t def);
598 TMJ_DEF float jsonToFloat(JsonStringView str, float def);
599 TMJ_DEF double jsonToDouble(JsonStringView str, double def);
600 TMJ_DEF tm_bool jsonToBool(JsonStringView str, tm_bool def);
601 #ifndef TMJ_NO_INT64
602 TMJ_DEF int64_t jsonToInt64(JsonStringView str, int64_t def);
603 TMJ_DEF uint64_t jsonToUInt64(JsonStringView str, uint64_t def);
604 #endif
605
606 // json document
607 struct JsonValueStruct;
608 struct JsonNodeStruct;
609 typedef struct JsonNodeStruct JsonNode;
610 typedef struct JsonValueStruct JsonValue;
611
612 // string view wrappers
613 #ifdef TM_STRING_VIEW
614 typedef TM_STRING_VIEW tmj_string_arg;
615 typedef TM_STRING_VIEW tmj_string_view;
616 #define TMJ_STRING_VIEW_MAKE(data, size) TM_STRING_VIEW_MAKE(data, size)
617 #else
618 typedef const char* tmj_string_arg;
619 typedef JsonStringView tmj_string_view;
620 #define TMJ_STRING_VIEW_MAKE(data, size) {(data), (size)}
621 #endif
622
623 typedef struct JsonObjectStruct {
624 JsonNode* nodes;
625 tm_size_t count;
626
627 #ifdef __cplusplus
628 // caching of which node we accessed last, makes jsonGetMember and operator[] slightly more
629 // efficient. Not really part of the state of JsonObject, so mutable is fine here.
630 mutable tm_size_t lastAccess;
631
632 tm_size_t size() const;
633 inline explicit operator bool() const { return nodes != nullptr; }
634
635 bool exists(tmj_string_arg name) const;
636 JsonValue* find(tmj_string_arg name) const;
637 JsonValue operator[](tmj_string_arg name) const;
638 #endif
639 } JsonObject;
640
641 typedef struct JsonArrayStruct {
642 JsonValue* values;
643 tm_size_t count;
644
645 #ifdef __cplusplus
646 tm_size_t size() const;
647 JsonValue operator[](tm_size_t index) const;
648 inline explicit operator bool() const { return values != nullptr; }
649 #endif
650 } JsonArray;
651
652 typedef struct JsonObjectArrayStruct {
653 JsonValue* values;
654 tm_size_t count;
655
656 #ifdef __cplusplus
657 tm_size_t size() const;
658 JsonObject operator[](tm_size_t index) const;
659 inline explicit operator bool() const { return values != nullptr; }
660 #endif
661 } JsonObjectArray;
662
663 struct JsonValueStruct {
664 JsonValueType type;
665 union {
666 JsonStringView content;
667 JsonArray array;
668 JsonObject object;
669 } data;
670
671 #ifdef __cplusplus
672 tmj_string_view getString(tmj_string_view def = {}) const;
673
674 int32_t getInt(int32_t def = 0) const;
675 uint32_t getUInt(uint32_t def = 0) const;
676 float getFloat(float def = 0.0f) const;
677 double getDouble(double def = 0.0f) const;
678 bool getBool(bool def = false) const;
679 #ifndef TMJ_NO_INT64
680 int64_t getInt64(int64_t def = 0) const;
681 uint64_t getUInt64(uint64_t def = 0) const;
682 #endif
683
684 // same as jsonGetObject
685 // returns a JsonObject if value contains an object, returns a nil object otherwise
686 // see documentation at the top of the file for what nil objects are
687 JsonObject getObject() const;
688 // same as jsonGetArray
689 // returns a JsonArray if value contains an array, returns a nil array otherwise
690 // see documentation at the top of the file for what nil arrays are
691 JsonArray getArray() const;
692 JsonObjectArray getObjectArray() const;
693
694 // returns whether value is null
695 bool isNull() const;
696 // returns whether value is present
697 inline explicit operator bool() const { return type != JVAL_NULL; }
698
699 // convenience overload to treat a value as an object directly
700 // use getObject directly, if you need to invoke operator[] or jsonGetMember repeatedly
701 inline JsonValue operator[](tmj_string_arg name) const { return getObject()[name]; }
702
703 // convenience overload to treat a value as an array directly
704 // use getArray directly, if you need to invoke operator[] or jsonGetEntry repeatedly
705 inline JsonValue operator[](tm_size_t index) { return getArray()[index]; }
706
707 // returns true if value is int, uint, bool or float
708 bool isIntegral() const;
709 bool isString() const;
710 #endif
711 };
712 struct JsonNodeStruct {
713 JsonStringView name;
714 JsonValue value;
715 };
716
717 struct JsonStackAllocatorStruct {
718 char* ptr;
719 size_t size;
720 size_t capacity;
721 };
722 unsigned int jsonGetAlignmentOffset(const void* ptr, unsigned int alignment);
723 void* jsonAllocate(JsonStackAllocator* allocator, size_t size, unsigned int alignment);
724
725 typedef struct JsonDocumentStruct {
726 JsonValue root;
727 struct {
728 JsonErrorType type;
729 tm_size_t line;
730 tm_size_t column; // Byte column/offset from beginning of line.
731 tm_size_t offset; // Offset from beginning of the json file in bytes.
732 tm_size_t length; // Length of the token that caused the error.
733 } error;
734 #ifdef __cplusplus
735 inline explicit operator bool() const { return error.type == JSON_OK; }
736 #endif
737 } JsonDocument;
738
739 typedef struct JsonAllocatedDocumentStruct {
740 JsonDocument document;
741 char* pool;
742 size_t poolSize;
743 } JsonAllocatedDocument;
744
745 // parses json only accepting the following parsing flags:
746 // - JSON_READER_SINGLE_QUOTED_STRINGS
747 // - JSON_READER_SINGLE_LINE_COMMENTS
748 // - JSON_READER_TRAILING_COMMA
749 // - JSON_READER_STRICT
750 // - JSON_READER_ALLOW_EQUAL
751 // - JSON_READER_ESCAPED_MULTILINE_STRINGS
752 // - JSON_READER_ALLOW_PLUS_SIGN
753 // - JSON_READER_ALLOW_LEADING_AND_TRAILING_DECIMALPOINT
754 // since there are fewer special cases, it is slightly faster than jsonAllocateDocumentEx
755 TMJ_DEF JsonAllocatedDocument jsonAllocateDocument(const char* data, tm_size_t size, unsigned int flags);
756 TMJ_DEF void jsonFreeDocument(JsonAllocatedDocument* doc);
757 TMJ_DEF JsonDocument jsonMakeDocument(JsonStackAllocator* allocator, const char* data, tm_size_t size,
758 unsigned int flags);
759
760 // parses json accepting all flags
761 TMJ_DEF JsonAllocatedDocument jsonAllocateDocumentEx(const char* data, tm_size_t size, unsigned int flags);
762 TMJ_DEF JsonDocument jsonMakeDocumentEx(JsonStackAllocator* allocator, const char* data, tm_size_t size,
763 unsigned int flags);
764 /* clang-format off */
765 #ifdef __cplusplus
766 JsonNode* begin(const JsonObject& a);
767 JsonNode* end(const JsonObject& a);
768 JsonValue* begin(const JsonArray& a);
769 JsonValue* end(const JsonArray& a);
770
771 // iterator for range based loops that yield JsonObjects when dereferenced
772 struct JsonObjectArrayIterator {
773 JsonValue* ptr;
774
775 bool operator!=(JsonObjectArrayIterator other) const;
776 bool operator==(JsonObjectArrayIterator other) const;
777 JsonObjectArrayIterator& operator++();
778 JsonObjectArrayIterator operator++(int);
779 JsonObject operator*() const;
780 };
781
782 JsonObjectArrayIterator begin(const JsonObjectArray& a);
783 JsonObjectArrayIterator end(const JsonObjectArray& a);
784 #endif
785 /* clang-format on */
786
787 TMJ_DEF tm_bool jsonIsNull(const JsonValue* value);
788 TMJ_DEF tm_bool jsonIsIntegral(const JsonValue* value);
789 TMJ_DEF tm_bool jsonIsString(const JsonValue* value);
790 // returns a JsonObject if value contains an object, returns a nil object otherwise
791 // see documentation at the top of the file for what nil objects are
792 TMJ_DEF JsonObject jsonGetObject(const JsonValue* value);
793 // returns a JsonArray if value contains an array, returns a nil array otherwise
794 // see documentation at the top of the file for what nil arrays are
795 TMJ_DEF JsonArray jsonGetArray(const JsonValue* value);
796 TMJ_DEF JsonObjectArray jsonGetObjectArray(const JsonValue* value);
797
798 TMJ_DEF JsonValue jsonGetMember(const JsonObject* object, const char* name);
799 TMJ_DEF JsonValue* jsonQueryMember(const JsonObject* object, const char* name);
800 TMJ_DEF JsonValue jsonGetMemberCached(const JsonObject* object, const char* name, tm_size_t* lastAccess);
801 TMJ_DEF JsonValue* jsonQueryMemberCached(const JsonObject* object, const char* name, tm_size_t* lastAccess);
802 TMJ_DEF JsonValue jsonGetEntry(const JsonArray* object, tm_size_t index);
803
804 /*!
805 * @brief Resolves a json pointer, see https://tools.ietf.org/html/rfc6901 for reference.
806 * Might allocate memory to unescape json_pointer, but tries not to.
807 * @param value[IN] The value to start searching.
808 * @param json_pointer[IN] The json pointer as string. Can also be in fragment form.
809 */
810 TMJ_DEF JsonValue jsonResolveJsonPointer(const JsonValue* value, const char* json_pointer);
811
812 // string_view overloads
813 #if defined(__cplusplus) && defined(TM_STRING_VIEW)
814 TMJ_DEF JsonValue jsonGetMember(const JsonObject* object, TM_STRING_VIEW name);
815 TMJ_DEF JsonValue* jsonQueryMember(const JsonObject* object, TM_STRING_VIEW name);
816 TMJ_DEF JsonValue jsonGetMemberCached(const JsonObject* object, TM_STRING_VIEW name, tm_size_t* lastAccess);
817 TMJ_DEF JsonValue* jsonQueryMemberCached(const JsonObject* object, TM_STRING_VIEW name, tm_size_t* lastAccess);
818 #endif // defined( __cplusplus ) && defined( TM_STRING_VIEW )
819
820 TMJ_DEF tm_bool jsonIsValidObject(const JsonObject* object);
821 TMJ_DEF tm_bool jsonIsValidArray(const JsonArray* array);
822 TMJ_DEF tm_bool jsonIsValidValue(const JsonValue* value);
823
824 TMJ_DEF int32_t jsonGetInt(const JsonValue* value, int32_t def);
825 TMJ_DEF uint32_t jsonGetUInt(const JsonValue* value, uint32_t def);
826 TMJ_DEF float jsonGetFloat(const JsonValue* value, float def);
827 TMJ_DEF double jsonGetDouble(const JsonValue* value, double def);
828 TMJ_DEF tm_bool jsonGetBool(const JsonValue* value, tm_bool def);
829 #ifndef TMJ_NO_INT64
830 TMJ_DEF int64_t jsonGetInt64(const JsonValue* value, int64_t def);
831 TMJ_DEF uint64_t jsonGetUInt64(const JsonValue* value, uint64_t def);
832 #endif
833
834 // inline implementations
835
836 // define tmj_valid_index differently if tm_size_t is unsigned, so we don't get -Wtype-limits warning
837 #if !defined(TM_SIZE_T_IS_SIGNED) || TM_SIZE_T_IS_SIGNED
838 inline static tm_bool tmj_valid_index(tm_size_t index, tm_size_t size) { return index >= 0 && index < size; }
839 #else
840 inline static tm_bool tmj_valid_index(tm_size_t index, tm_size_t size) { return index < size; }
841 #endif
842
843 #ifdef __cplusplus
844 inline JsonNode* begin(const JsonObject& a) { return a.nodes; }
845 inline JsonNode* end(const JsonObject& a) { return a.nodes + a.count; }
846 inline JsonValue* begin(const JsonArray& a) { return a.values; }
847 inline JsonValue* end(const JsonArray& a) { return a.values + a.count; }
848
849 inline bool JsonObjectArrayIterator::operator!=(JsonObjectArrayIterator other) const { return ptr != other.ptr; }
850 inline bool JsonObjectArrayIterator::operator==(JsonObjectArrayIterator other) const { return ptr != other.ptr; }
851 inline JsonObjectArrayIterator& JsonObjectArrayIterator::operator++() {
852 ++ptr;
853 return *this;
854 }
855 inline JsonObjectArrayIterator JsonObjectArrayIterator::operator++(int) {
856 JsonObjectArrayIterator result = *this;
857 ++ptr;
858 return result;
859 }
860 inline JsonObject JsonObjectArrayIterator::operator*() const { return ptr->getObject(); }
861
862 inline JsonObjectArrayIterator begin(const JsonObjectArray& a) { return {a.values}; }
863 inline JsonObjectArrayIterator end(const JsonObjectArray& a) { return {a.values + a.count}; }
864
865 inline tmj_string_view JsonValueStruct::getString(tmj_string_view def) const {
866 if ((type == JVAL_NULL && data.content.size == 0) || type == JVAL_OBJECT || type == JVAL_ARRAY) {
867 return def;
868 }
869 return TMJ_STRING_VIEW_MAKE(data.content.data, data.content.size);
870 }
871
872 inline JsonObject JsonValueStruct::getObject() const { return jsonGetObject(this); }
873 inline JsonArray JsonValueStruct::getArray() const { return jsonGetArray(this); }
874 inline JsonObjectArray JsonValueStruct::getObjectArray() const { return jsonGetObjectArray(this); }
875 inline bool JsonValueStruct::isNull() const { return jsonIsNull(this); }
876 inline bool JsonValueStruct::isIntegral() const { return jsonIsIntegral(this); }
877 inline bool JsonValueStruct::isString() const { return jsonIsString(this); }
878
879 inline tm_size_t JsonArray::size() const { return count; }
880 inline JsonValue JsonArray::operator[](tm_size_t index) const { return jsonGetEntry(this, index); }
881
882 inline tm_size_t JsonObjectArray::size() const { return count; }
883 inline JsonObject JsonObjectArray::operator[](tm_size_t index) const {
884 TM_ASSERT(tmj_valid_index(index, count));
885 return jsonGetObject(&values[index]);
886 }
887
888 inline tm_size_t JsonObject::size() const { return count; }
889 inline JsonValue JsonObject::operator[](tmj_string_arg name) const { return jsonGetMember(this, name); }
890 inline bool JsonObject::exists(tmj_string_arg name) const { return jsonQueryMember(this, name) != TM_NULL; }
891 inline JsonValue* JsonObject::find(tmj_string_arg name) const { return jsonQueryMember(this, name); }
892
893 inline int32_t JsonValueStruct::getInt(int32_t def) const { return jsonGetInt(this, def); }
894 inline uint32_t JsonValueStruct::getUInt(uint32_t def) const { return jsonGetUInt(this, def); }
895 inline float JsonValueStruct::getFloat(float def) const { return jsonGetFloat(this, def); }
896 inline double JsonValueStruct::getDouble(double def) const { return jsonGetDouble(this, def); }
897 inline bool JsonValueStruct::getBool(bool def) const { return jsonGetBool(this, def); }
898 #ifndef TMJ_NO_INT64
899 inline int64_t JsonValueStruct::getInt64(int64_t def) const { return jsonGetInt64(this, def); }
900 inline uint64_t JsonValueStruct::getUInt64(uint64_t def) const { return jsonGetUInt64(this, def); }
901 #endif /* !defined(TMJ_NO_INT64) */
902 #endif /* defined(__cplusplus) */
903
904 #endif // _TM_JSON_H_INCLUDED_
905
906 // implementation
907 #ifdef TM_JSON_IMPLEMENTATION
908
909 // clang-format off
910 #ifndef TM_MIN
911 #define TM_MIN(a, b) (((a) < (b)) ? (a) : (b))
912 #endif
913
914 #ifndef TM_ASSERT_VALID_SIZE
915 #if defined(TM_SIZE_T_IS_SIGNED) && TM_SIZE_T_IS_SIGNED
916 #define TM_ASSERT_VALID_SIZE(x) TM_ASSERT((x) >= 0)
917 #else
918 /* always true if size_t is unsigned */
919 #define TM_ASSERT_VALID_SIZE(x) ((void)0)
920 #endif
921 #endif /* !defined(TM_ASSERT_VALID_SIZE) */
922 // clang-format on
923
924 static tm_bool stringEquals(const char* a, size_t aSize, const char* b, size_t bSize) {
925 if (aSize != bSize) return TM_FALSE;
926 return TM_MEMCMP(a, b, bSize) == 0;
927 }
928 static tm_bool stringEqualsIgnoreCase(const char* a, size_t aSize, const char* b, size_t bSize) {
929 if (aSize != bSize) return TM_FALSE;
930 do {
931 // We know that b is already uppercased.
932 if (TM_TOLOWER((unsigned char)*a) != (unsigned char)*b) return TM_FALSE;
933 ++a;
934 ++b;
935 --bSize;
936 } while (bSize);
937 return TM_TRUE;
938 }
939
940 static tm_bool stringStartsWith(const char* a, size_t aSize, const char* b, size_t bSize) {
941 if (bSize == 0) return TM_TRUE;
942 if (aSize < bSize) return TM_FALSE;
943 return TM_MEMCMP(a, b, bSize) == 0;
944 }
945
946 static tm_bool stringStartsWithIgnoreCase(const char* a, size_t aSize, const char* b, size_t bSize) {
947 if (bSize == 0) return TM_TRUE;
948 if (aSize < bSize) return TM_FALSE;
949 return stringEqualsIgnoreCase(a, bSize, b, bSize);
950 }
951
952 #ifdef TMJ_DEFINE_OWN_STRING_CONVERSIONS
953
954 #include <stdlib.h>
955 #include <errno.h>
956
957 static void tmj_to_int(const char* first, const char* last, int* value, int base) {
958 TM_ASSERT(value);
959 TM_ASSERT(last >= first);
960 size_t size = (size_t)(last - first);
961 if (size > 32) return;
962 char buffer[33];
963 TM_MEMCPY(buffer, first, size);
964 buffer[size] = 0;
965 errno = 0;
966 int result = (int)strtol(buffer, TM_NULL, base);
967 if (errno == ERANGE) return;
968 *value = result;
969 }
970 static void tmj_to_uint(const char* first, const char* last, unsigned int* value, int base) {
971 TM_ASSERT(value);
972 TM_ASSERT(last >= first);
973 size_t size = (size_t)(last - first);
974 if (size > 32) return;
975 char buffer[33];
976 TM_MEMCPY(buffer, first, size);
977 buffer[size] = 0;
978 errno = 0;
979 unsigned int result = (unsigned int)strtoul(buffer, TM_NULL, base);
980 if (errno == ERANGE) return;
981 *value = result;
982 }
983 static tm_bool tmj_to_double(const char* first, const char* last, double* value) {
984 TM_ASSERT(value);
985 TM_ASSERT(last >= first);
986 size_t size = (size_t)(last - first);
987 if (size > 511) return TM_FALSE;
988 char buffer[512];
989 TM_MEMCPY(buffer, first, size);
990 buffer[size] = 0;
991 errno = 0;
992 double result = strtod(buffer, TM_NULL);
993 if (errno == ERANGE) return TM_FALSE;
994 *value = result;
995 return TM_TRUE;
996 }
997 static void tmj_to_float(const char* first, const char* last, float* value) {
998 double val = 0;
999 if (tmj_to_double(first, last, &val)) {
1000 *value = (float)val;
1001 }
1002 }
1003 #ifndef TMJ_NO_INT64
1004 static void tmj_to_int64(const char* first, const char* last, int64_t* value, int base) {
1005 TM_ASSERT(value);
1006 TM_ASSERT(last >= first);
1007 size_t size = (size_t)(last - first);
1008 if (size > 64) return;
1009 char buffer[65];
1010 TM_MEMCPY(buffer, first, size);
1011 buffer[size] = 0;
1012 errno = 0;
1013 int64_t result = (int64_t)strtoll(buffer, TM_NULL, base);
1014 if (errno == ERANGE) return;
1015 *value = result;
1016 }
1017 static void tmj_to_uint64(const char* first, const char* last, uint64_t* value, int base) {
1018 TM_ASSERT(value);
1019 TM_ASSERT(last >= first);
1020 size_t size = (size_t)(last - first);
1021 if (size > 64) return;
1022 char buffer[65];
1023 TM_MEMCPY(buffer, first, size);
1024 buffer[size] = 0;
1025 errno = 0;
1026 uint64_t result = (uint64_t)strtoull(buffer, TM_NULL, base);
1027 if (errno == ERANGE) return;
1028 *value = result;
1029 }
1030 #endif // !defined(TMJ_NO_INT64)
1031
1032 #endif // defined(TMJ_DEFINE_OWN_STRING_CONVERSIONS)
1033
1034 TMJ_DEF int32_t jsonToInt(JsonStringView str, int32_t def) {
1035 if (str.size <= 0) return def;
1036 if (str.size >= 2 && str.data[0] == '0' && (str.data[1] == 'x' || str.data[1] == 'X')) {
1037 if (str.size == 2) return def;
1038 TMJ_TO_INT(str.data + 2, str.data + str.size - 2, &def, 16);
1039 } else {
1040 TMJ_TO_INT(str.data, str.data + str.size, &def, 10);
1041 }
1042 return def;
1043 }
1044 TMJ_DEF uint32_t jsonToUInt(JsonStringView str, uint32_t def) {
1045 if (str.size <= 0) return def;
1046 if (str.data[0] == '-') {
1047 // Special case for -0.
1048 if (str.size == 2 && str.data[1] == '0') return 0;
1049 return def;
1050 }
1051 if (str.size >= 2 && str.data[0] == '0' && (str.data[1] == 'x' || str.data[1] == 'X')) {
1052 if (str.size == 2) return def;
1053 TMJ_TO_UINT(str.data + 2, str.data + str.size - 2, &def, 16);
1054 } else {
1055 TMJ_TO_UINT(str.data, str.data + str.size, &def, 10);
1056 }
1057 return def;
1058 }
1059 TMJ_DEF float jsonToFloat(JsonStringView str, float def) {
1060 if (str.size <= 0) return def;
1061 #if defined(TM_INFINITY) || defined(TM_NAN)
1062 {
1063 // check for inf, nan etc
1064 tm_bool neg = TM_FALSE;
1065 JsonStringView str_ = str;
1066 if (str_.data[0] == '+') {
1067 ++str_.data;
1068 --str_.size;
1069 } else if (str_.data[0] == '-') {
1070 neg = TM_TRUE;
1071 ++str_.data;
1072 --str_.size;
1073 }
1074 #if defined(TM_INFINITY)
1075 if (stringEqualsIgnoreCase(str_.data, str_.size, "infinity", 8)) {
1076 return (float)((neg) ? (-TM_INFINITY) : (TM_INFINITY));
1077 }
1078 #endif
1079 #if defined(TM_NAN)
1080 if (stringEqualsIgnoreCase(str_.data, str_.size, "nan", 3)) {
1081 return (float)((neg) ? (-TM_NAN) : (TM_NAN));
1082 }
1083 #endif
1084 }
1085 #endif
1086 TMJ_TO_FLOAT(str.data, str.data + str.size, &def);
1087 return def;
1088 }
1089 TMJ_DEF double jsonToDouble(JsonStringView str, double def) {
1090 if (str.size <= 0) return def;
1091 #if defined(TM_INFINITY) || defined(TM_NAN)
1092 {
1093 // check for inf, nan etc
1094 tm_bool neg = TM_FALSE;
1095 JsonStringView str_ = str;
1096 if (str_.data[0] == '+') {
1097 ++str_.data;
1098 --str_.size;
1099 } else if (str_.data[0] == '-') {
1100 neg = TM_TRUE;
1101 ++str_.data;
1102 --str_.size;
1103 }
1104 #if defined(TM_INFINITY)
1105 if (stringEqualsIgnoreCase(str_.data, str_.size, "infinity", 8)) {
1106 return (neg) ? (-TM_INFINITY) : (TM_INFINITY);
1107 }
1108 #endif
1109 #if defined(TM_NAN)
1110 if (stringEqualsIgnoreCase(str_.data, str_.size, "nan", 3)) {
1111 return (neg) ? (-TM_NAN) : (TM_NAN);
1112 }
1113 #endif
1114 }
1115 #endif
1116 TMJ_TO_DOUBLE(str.data, str.data + str.size, &def);
1117 return def;
1118 }
1119 TMJ_DEF tm_bool jsonToBool(JsonStringView str, tm_bool def) {
1120 if (str.size <= 0) return def;
1121 if (str.size == 1) {
1122 switch (str.data[0]) {
1123 case '0':
1124 return TM_FALSE;
1125 case '1':
1126 return TM_TRUE;
1127 default:
1128 return def;
1129 }
1130 }
1131 if (stringEqualsIgnoreCase(str.data, str.size, "true", 4)) {
1132 return TM_TRUE;
1133 } else if (stringEqualsIgnoreCase(str.data, str.size, "false", 5)) {
1134 return TM_FALSE;
1135 }
1136 return def;
1137 }
1138 #ifndef TMJ_NO_INT64
1139 TMJ_DEF int64_t jsonToInt64(JsonStringView str, int64_t def) {
1140 if (str.size <= 0) return def;
1141 if (str.size >= 2 && str.data[0] == '0' && (str.data[1] == 'x' || str.data[1] == 'X')) {
1142 if (str.size == 2) return def;
1143 TMJ_TO_INT64(str.data + 2, str.data + str.size - 2, &def, 16);
1144 } else {
1145 TMJ_TO_INT64(str.data, str.data + str.size, &def, 10);
1146 }
1147 return def;
1148 }
1149 TMJ_DEF uint64_t jsonToUInt64(JsonStringView str, uint64_t def) {
1150 if (str.size <= 0) return def;
1151 if (str.data[0] == '-') {
1152 // Special case for -0.
1153 if (str.size == 2 && str.data[1] == '0') return 0;
1154 return def;
1155 }
1156 if (str.size >= 2 && str.data[0] == '0' && (str.data[1] == 'x' || str.data[1] == 'X')) {
1157 if (str.size == 2) return def;
1158 TMJ_TO_UINT64(str.data + 2, str.data + str.size - 2, &def, 16);
1159 } else {
1160 TMJ_TO_UINT64(str.data, str.data + str.size, &def, 10);
1161 }
1162 return def;
1163 }
1164 #endif
1165
1166 TMJ_DEF const char* jsonGetErrorString(JsonErrorType error) {
1167 TM_ASSERT(error >= 0 && error <= JERR_INTERNAL_ERROR);
1168 static const char* const ErrorStrings[] = {"Ok",
1169 "Unexpected Token",
1170 "Unexpected EOF",
1171 "Illformed String",
1172 "Mismatched Brackets",
1173 "Out Of Context Stack Memory",
1174 "No Root",
1175 "Out Of Memory",
1176 "Internal Error"};
1177 return ErrorStrings[error];
1178 }
1179
1180 #define TMJ_ROOT_ENTERED (1u << 31)
1181
1182 static void jsonAdvance(JsonReader* reader) {
1183 ++reader->data;
1184 ++reader->column;
1185 --reader->size;
1186 }
1187 static tm_size_t skipWhitespaceHelper(JsonReader* reader, const char* whitespace, size_t len) {
1188 const char* p;
1189 while (reader->size && (p = (const char*)TM_MEMCHR(whitespace, reader->data[0], len)) != TM_NULL) {
1190 if (reader->data[0] == '\n') {
1191 ++reader->line;
1192 reader->column = 0;
1193 } else {
1194 ++reader->column;
1195 }
1196 ++reader->data;
1197 --reader->size;
1198 }
1199 return reader->size;
1200 }
1201 static tm_size_t skipWhitespace(JsonReader* reader) {
1202 static const char* const whitespace = "\t\n\r ";
1203 return skipWhitespaceHelper(reader, whitespace, 4);
1204 }
1205 static tm_size_t skipWhitespaceEx(JsonReader* reader, tm_bool ex) {
1206 static const char* const json_whitespace = "\t\n\r ";
1207 /*
1208 Json5 considers these whitespace:
1209 U+0009 Horizontal tab
1210 U+000A Line feed
1211 U+000B Vertical tab
1212 U+000C Form feed
1213 U+000D Carriage return
1214 U+0020 Space
1215 U+00A0 Non-breaking space
1216 U+2028 Line separator
1217 U+2029 Paragraph separator
1218 U+FEFF Byte order mark
1219 Unicode Zs category Any other character in the Space Separator Unicode category
1220
1221 Currently Line separator (U+2028), Paragraph separator (U+2029), Byte order mark (U+FEFF)
1222 and Space Separator Unicode category are not supported, since whitespace skipping is not unicode based.
1223 */
1224 static const char* const json5_whitespace = "\x09\x0A\x0B\x0C\x0D\x20\xA0";
1225
1226 const char* whitespace;
1227 size_t len;
1228 if ((ex && (reader->flags & JSON_READER_ALLOW_EXTENDED_WHITESPACE))) {
1229 whitespace = json5_whitespace;
1230 len = 7;
1231 } else {
1232 whitespace = json_whitespace;
1233 len = 4;
1234 }
1235 return skipWhitespaceHelper(reader, whitespace, len);
1236 }
1237 static void setError(JsonReader* reader, JsonErrorType error) {
1238 reader->errorType = error;
1239 reader->current.data = reader->data;
1240 reader->current.size = 1;
1241 }
1242
1243 #define TMJ_MAX_UTF32 0x10FFFFu
1244 #define TMJ_LEAD_SURROGATE_MIN 0xD800u
1245 #define TMJ_LEAD_SURROGATE_MAX 0xDBFFu
1246 #define TMJ_TRAILING_SURROGATE_MIN 0xDC00u
1247 #define TMJ_TRAILING_SURROGATE_MAX 0xDFFFu
1248 #define TMJ_SURROGATE_OFFSET (0x10000u - (0xD800u << 10u) - 0xDC00u)
1249
1250 static tm_bool tmj_is_valid_codepoint(uint32_t codepoint) {
1251 return codepoint <= TMJ_MAX_UTF32 && (codepoint < TMJ_LEAD_SURROGATE_MIN || codepoint > TMJ_TRAILING_SURROGATE_MAX);
1252 }
1253
1254 static tm_size_t tmj_get_codepoint(const char* first, tm_size_t remaining, uint32_t* codepoint) {
1255 tm_size_t starting_size = remaining;
1256
1257 TM_ASSERT(codepoint);
1258 if (remaining < 4) return 0;
1259 if (!TM_ISXDIGIT((unsigned char)first[0]) || !TM_ISXDIGIT((unsigned char)first[1]) ||
1260 !TM_ISXDIGIT((unsigned char)first[2]) || !TM_ISXDIGIT((unsigned char)first[3])) {
1261 return 0;
1262 }
1263 uint32_t lead = 0xFFFFFFFFu;
1264 TMJ_TO_UINT(first, first + 4, &lead, 16);
1265 if (lead == 0xFFFFFFFFu) return 0;
1266 first += 4;
1267 remaining -= 4;
1268
1269 if (lead >= TMJ_LEAD_SURROGATE_MIN && lead <= TMJ_LEAD_SURROGATE_MAX) {
1270 if (remaining < 6) return 0;
1271 if (*first != '\\' || *(first + 1) != 'u') return 0;
1272 first += 2;
1273 remaining -= 2;
1274 if (!TM_ISXDIGIT((unsigned char)first[0]) || !TM_ISXDIGIT((unsigned char)first[1]) ||
1275 !TM_ISXDIGIT((unsigned char)first[2]) || !TM_ISXDIGIT((unsigned char)first[3])) {
1276 return 0;
1277 }
1278 uint32_t trail = 0xFFFFFFFFu;
1279 TMJ_TO_UINT(first, first + 4, &trail, 16);
1280 if (trail == 0xFFFFFFFFu) return 0;
1281 first += 4;
1282 remaining -= 4;
1283
1284 if (trail >= TMJ_TRAILING_SURROGATE_MIN && trail <= TMJ_TRAILING_SURROGATE_MAX) {
1285 *codepoint = (lead << 10) + trail + TMJ_SURROGATE_OFFSET;
1286 } else {
1287 return 0;
1288 }
1289 } else {
1290 *codepoint = lead;
1291 }
1292 if (!tmj_is_valid_codepoint(*codepoint)) return 0;
1293
1294 TM_ASSERT(starting_size > remaining);
1295 tm_size_t advance = starting_size - remaining;
1296 TM_ASSERT(advance == 4 || advance == 10);
1297 return advance;
1298 }
1299 static tm_size_t tmj_utf8_encode(uint32_t codepoint, char* out, tm_size_t out_len) {
1300 TM_ASSERT(out || out_len == 0);
1301 TM_ASSERT(tmj_is_valid_codepoint(codepoint));
1302
1303 if (codepoint < 0x80) {
1304 /* 1 byte sequence */
1305 if (out_len < 1) return 1;
1306 out[0] = (char)(codepoint);
1307 return 1;
1308 } else if (codepoint < 0x800) {
1309 /* 2 byte sequence 110xxxxx 10xxxxxx */
1310 if (out_len < 2) return 2;
1311 out[0] = (char)(0xC0 | (uint8_t)(codepoint >> 6));
1312 out[1] = (char)(0x80 | (uint8_t)(codepoint & 0x3F));
1313 return 2;
1314 } else if (codepoint < 0x10000) {
1315 /* 3 byte sequence 1110xxxx 10xxxxxx 10xxxxxx */
1316 if (out_len < 3) return 3;
1317 out[0] = (char)(0xE0 | (uint8_t)(codepoint >> 12));
1318 out[1] = (char)(0x80 | ((uint8_t)(codepoint >> 6) & 0x3F));
1319 out[2] = (char)(0x80 | ((uint8_t)(codepoint & 0x3F)));
1320 return 3;
1321 } else {
1322 /* 4 byte sequence 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx */
1323 if (out_len < 4) return 4;
1324 out[0] = (char)(0xF0 | ((uint8_t)(codepoint >> 18) & 0x7));
1325 out[1] = (char)(0x80 | ((uint8_t)(codepoint >> 12) & 0x3F));
1326 out[2] = (char)(0x80 | ((uint8_t)(codepoint >> 6) & 0x3F));
1327 out[3] = (char)(0x80 | ((uint8_t)(codepoint & 0x3F)));
1328 return 4;
1329 }
1330 }
1331 #undef TMJ_MAX_UTF32
1332 #undef TMJ_LEAD_SURROGATE_MIN
1333 #undef TMJ_LEAD_SURROGATE_MAX
1334 #undef TMJ_TRAILING_SURROGATE_MIN
1335 #undef TMJ_TRAILING_SURROGATE_MAX
1336 #undef TMJ_SURROGATE_OFFSET
1337
1338
1339 static tm_bool tmj_is_char_unescaped(const char* first, const char* last) {
1340 /* Count how many backslashes precede last. */
1341 const char* pos = last;
1342 while (pos > first && *(pos - 1) == '\\') --pos;
1343 TM_ASSERT(last >= pos);
1344 size_t preceding_escape_chars_count = (size_t)(last - pos);
1345 /* If there are even number of backslashes before last, they all escaped each other. */
1346 return (preceding_escape_chars_count & 1) == 0;
1347 }
1348
1349 static tm_bool tmj_is_valid_json_string(const char* first, tm_size_t size, char quote, tm_bool allow_escaped_newlines,
1350 tm_bool ex) {
1351 for (tm_size_t i = 0; i < size; ++i) {
1352 unsigned char c = (unsigned char)first[i];
1353 /* Raw control characters are not valid json strings. */
1354 if (c < 32) return TM_FALSE;
1355 if (c == '\\') {
1356 tm_size_t remaining = size - i;
1357 if (!remaining) return TM_FALSE;
1358 unsigned char next = (unsigned char)first[i + 1];
1359 ++i;
1360 switch (next) {
1361 case '\\':
1362 case '/':
1363 case 'b':
1364 case 'f':
1365 case 'n':
1366 case 'r':
1367 case 't':
1368 case 'u': {
1369 break;
1370 }
1371 case '"': {
1372 if (quote == '"') break;
1373 return TM_FALSE;
1374 }
1375 case '\'': {
1376 if (quote == '\'') break;
1377 return TM_FALSE;
1378 }
1379 case '\n': {
1380 if (allow_escaped_newlines) break;
1381 return TM_FALSE;
1382 }
1383 case '\r': {
1384 if (allow_escaped_newlines && ex) {
1385 // Treat \r\n as a single newline by skipping one char.
1386 if (remaining > 1 && first[i + 1] == '\n') ++i;
1387 break;
1388 }
1389 return TM_FALSE;
1390 }
1391 default: {
1392 return TM_FALSE;
1393 }
1394 }
1395 if (next == 'u') {
1396 ++i;
1397 /* Validate that \u is always followed by four hexadecimal digits. */
1398 uint32_t codepoint = 0;
1399 tm_size_t advance = tmj_get_codepoint(first + i, size - i, &codepoint);
1400 if (advance <= 0) return TM_FALSE;
1401 i += advance - 1;
1402 }
1403 }
1404 }
1405 return TM_TRUE;
1406 }
1407
1408 static const char* tmj_find_char_unescaped(const char* first, tm_size_t size, char c) {
1409 TM_ASSERT(first || size == 0);
1410
1411 if (size <= 0) return TM_NULL;
1412
1413 const char* str = first;
1414 const char* last = first + size;
1415 if (*str == c) return str;
1416 for (;;) {
1417 ++str;
1418 str = (const char*)TM_MEMCHR(str, (unsigned char)c, (size_t)(last - str));
1419 if (!str) return TM_NULL;
1420 if (tmj_is_char_unescaped(first, str)) return str;
1421 }
1422 }
1423
1424 static tm_bool readQuotedString(JsonReader* reader) {
1425 char quote = reader->data[0];
1426 TM_ASSERT(quote == '\'' || quote == '"');
1427 const char* start = reader->data;
1428 ++reader->data;
1429 --reader->size;
1430 reader->current.data = reader->data;
1431 reader->current.size = 0;
1432
1433 /* TODO: Profile to see which is faster, memchr twice over the string or go byte by byte once. */
1434 const char* p = tmj_find_char_unescaped(reader->data, reader->size, quote);
1435 if (p) {
1436 reader->size -= (tm_size_t)(p + 1 - reader->data);
1437 reader->data = p + 1;
1438 /* Unescaped quotation mark, we found the string. */
1439 reader->current.size = (tm_size_t)(reader->data - reader->current.data - 1);
1440 int ex = reader->flags & JSON_READER_ALLOW_EXTENDED_WHITESPACE;
1441 if (reader->flags & JSON_READER_ESCAPED_MULTILINE_STRINGS) {
1442 const char* last = reader->current.data;
1443 tm_size_t size = reader->current.size;
1444 for (;;) {
1445 if (ex) {
1446 p = (const char*)TM_MEMCHR(last, '\r', size);
1447 if (!p) p = (const char*)TM_MEMCHR(last, '\n', size);
1448 } else {
1449 p = (const char*)TM_MEMCHR(last, '\n', size);
1450 }
1451 if (!p) break;
1452 if (p == reader->current.data || tmj_is_char_unescaped(last, p)) {
1453 reader->errorType = JERR_ILLFORMED_STRING;
1454 reader->current.data = p;
1455 reader->current.size = 1;
1456 return TM_FALSE;
1457 }
1458 reader->column = 0;
1459 ++reader->line;
1460 if (ex && size > 1 && *p == '\r') {
1461 /* Skip \r\n */
1462 if (*(p + 1) == '\n') ++p;
1463 }
1464 size -= (tm_size_t)(p - last + 1);
1465 last = p + 1;
1466 }
1467 reader->column = size;
1468 } else {
1469 reader->column += reader->current.size + 1;
1470 }
1471 if (!tmj_is_valid_json_string(reader->current.data, reader->current.size, quote,
1472 (reader->flags & JSON_READER_ESCAPED_MULTILINE_STRINGS) != 0,
1473 reader->flags & JSON_READER_ALLOW_EXTENDED_WHITESPACE) != 0) {
1474 reader->errorType = JERR_ILLFORMED_STRING;
1475 reader->current.data = p;
1476 reader->current.size = 1;
1477 return TM_FALSE;
1478 }
1479 return TM_TRUE;
1480 }
1481
1482 // reached eof without reading a string
1483 reader->errorType = JERR_UNEXPECTED_EOF;
1484 reader->data += reader->size;
1485 reader->size = 0;
1486 // set current to the expected token before reaching eof
1487 reader->current.data = start;
1488 reader->current.size = 1;
1489 return TM_FALSE;
1490 }
1491
1492 static tm_bool readNumber(JsonReader* reader) {
1493 if (!reader->size) {
1494 setError(reader, JERR_UNEXPECTED_EOF);
1495 return TM_FALSE;
1496 }
1497
1498 reader->valueType = JVAL_UINT;
1499 reader->lastToken = JTOK_VALUE;
1500 reader->current.data = reader->data;
1501 if (reader->data[0] == '-') {
1502 reader->valueType = JVAL_INT;
1503 jsonAdvance(reader);
1504 } else if ((reader->flags & JSON_READER_ALLOW_PLUS_SIGN) && reader->data[0] == '+') {
1505 jsonAdvance(reader);
1506 // By skipping the plus sign in the token string we can use the usual json string conversion functions.
1507 reader->current.data = reader->data;
1508 }
1509
1510 if (!reader->size) {
1511 setError(reader, JERR_UNEXPECTED_EOF);
1512 return TM_FALSE;
1513 }
1514
1515 int has_leading_digits = TM_FALSE;
1516 int has_decimal_point = TM_FALSE;
1517 int has_trailing_digits = TM_FALSE;
1518
1519 if (reader->data[0] == '0') {
1520 has_leading_digits = TM_TRUE;
1521 jsonAdvance(reader);
1522 if (!reader->size) {
1523 reader->current.size = (tm_size_t)(reader->data - reader->current.data);
1524 return TM_TRUE;
1525 }
1526
1527 // hexadecimal
1528 if ((reader->data[0] == 'x' || reader->data[0] == 'X') && (reader->flags & JSON_READER_HEXADECIMAL)) {
1529 jsonAdvance(reader);
1530 if (!reader->size) {
1531 setError(reader, JERR_UNEXPECTED_EOF);
1532 return TM_FALSE;
1533 }
1534 if (!TM_ISXDIGIT((unsigned char)reader->data[0])) {
1535 setError(reader, JERR_UNEXPECTED_TOKEN);
1536 return TM_FALSE;
1537 }
1538 do {
1539 jsonAdvance(reader);
1540 } while (reader->size && TM_ISXDIGIT((unsigned char)reader->data[0]));
1541 reader->current.size = (tm_size_t)(reader->data - reader->current.data);
1542 return TM_TRUE;
1543 }
1544 } else if (TM_ISDIGIT((unsigned char)reader->data[0])) {
1545 has_leading_digits = TM_TRUE;
1546 do {
1547 jsonAdvance(reader);
1548 if (!reader->size) return TM_TRUE;
1549 } while (TM_ISDIGIT((unsigned char)reader->data[0]));
1550 } else if (!(reader->flags & JSON_READER_ALLOW_LEADING_AND_TRAILING_DECIMALPOINT) || reader->data[0] != '.') {
1551 setError(reader, JERR_UNEXPECTED_TOKEN);
1552 return TM_FALSE;
1553 }
1554
1555 if (reader->size && reader->data[0] == '.') {
1556 has_decimal_point = TM_TRUE;
1557 reader->valueType = JVAL_FLOAT;
1558 jsonAdvance(reader);
1559 if (!reader->size) {
1560 if (reader->flags & JSON_READER_ALLOW_LEADING_AND_TRAILING_DECIMALPOINT) return TM_TRUE;
1561 setError(reader, JERR_UNEXPECTED_EOF);
1562 return TM_FALSE;
1563 }
1564 // At least one digit has to follow after '.' unless explicitly allowed.
1565 has_trailing_digits = (TM_ISDIGIT((unsigned char)reader->data[0]) != 0);
1566 if (!has_trailing_digits) {
1567 if (!(reader->flags & JSON_READER_ALLOW_LEADING_AND_TRAILING_DECIMALPOINT)) {
1568 setError(reader, JERR_UNEXPECTED_TOKEN);
1569 return TM_FALSE;
1570 }
1571 } else {
1572 do {
1573 jsonAdvance(reader);
1574 } while (reader->size && TM_ISDIGIT((unsigned char)reader->data[0]));
1575 }
1576 }
1577
1578 if (reader->size && (reader->data[0] == 'e' || reader->data[0] == 'E')) {
1579 has_trailing_digits = TM_TRUE;
1580 if (!has_decimal_point && !has_leading_digits) {
1581 setError(reader, JERR_UNEXPECTED_TOKEN);
1582 return TM_FALSE;
1583 }
1584 reader->valueType = JVAL_FLOAT;
1585 jsonAdvance(reader);
1586 if (reader->data[0] == '+' || reader->data[0] == '-') {
1587 jsonAdvance(reader);
1588 }
1589 if (!TM_ISDIGIT((unsigned char)reader->data[0])) {
1590 setError(reader, JERR_UNEXPECTED_TOKEN);
1591 return TM_FALSE;
1592 }
1593 do {
1594 jsonAdvance(reader);
1595 } while (reader->size && TM_ISDIGIT((unsigned char)reader->data[0]));
1596 }
1597
1598 if (!has_leading_digits && !has_trailing_digits && has_decimal_point) {
1599 /* Unadvance to decimal point. */
1600 --reader->data;
1601 --reader->column;
1602 ++reader->size;
1603 TM_ASSERT(*reader->data == '.');
1604 setError(reader, JERR_UNEXPECTED_TOKEN);
1605 return TM_FALSE;
1606 }
1607
1608 reader->current.size = (tm_size_t)(reader->data - reader->current.data);
1609 return TM_TRUE;
1610 }
1611 static JsonTokenType advanceValue(JsonReader* reader, tm_size_t size) {
1612 reader->current.data = reader->data;
1613 reader->current.size = size;
1614 reader->data += size;
1615 reader->size -= size;
1616 reader->lastToken = JTOK_VALUE;
1617 return JTOK_VALUE;
1618 }
1619 static tm_bool readNumberEx(JsonReader* reader) {
1620 if (reader->flags & JSON_READER_EXTENDED_FLOATS) {
1621 if (reader->size) {
1622 const char* start = reader->data;
1623 tm_size_t size = reader->size;
1624 int offset = 0;
1625 if (*start == '-') {
1626 ++start;
1627 --size;
1628 offset = 1;
1629 } else if (*start == '+' && (reader->flags & JSON_READER_ALLOW_PLUS_SIGN)) {
1630 ++start;
1631 --size;
1632 offset = 1;
1633 }
1634 if (reader->flags & JSON_READER_IGNORE_CASE_KEYWORDS) {
1635 if (stringStartsWithIgnoreCase(start, size, "infinity", 8)) {
1636 reader->valueType = JVAL_FLOAT;
1637 advanceValue(reader, 8 + offset);
1638 return TM_TRUE;
1639 } else if (stringStartsWithIgnoreCase(start, size, "nan", 3)) {
1640 reader->valueType = JVAL_FLOAT;
1641 advanceValue(reader, 3 + offset);
1642 return TM_TRUE;
1643 }
1644 } else {
1645 if (stringStartsWith(start, size, "Infinity", 8)) {
1646 reader->valueType = JVAL_FLOAT;
1647 advanceValue(reader, 8 + offset);
1648 return TM_TRUE;
1649 } else if (stringStartsWith(start, size, "NaN", 3)) {
1650 reader->valueType = JVAL_FLOAT;
1651 advanceValue(reader, 3 + offset);
1652 return TM_TRUE;
1653 }
1654 }
1655 }
1656 }
1657 return readNumber(reader);
1658 }
1659 static JsonTokenType readValue(JsonReader* reader) {
1660 if (stringStartsWith(reader->data, reader->size, "true", 4)) {
1661 reader->valueType = JVAL_BOOL;
1662 return advanceValue(reader, 4);
1663 } else if (stringStartsWith(reader->data, reader->size, "false", 5)) {
1664 reader->valueType = JVAL_BOOL;
1665 return advanceValue(reader, 5);
1666 } else if (stringStartsWith(reader->data, reader->size, "null", 4)) {
1667 reader->valueType = JVAL_NULL;
1668 return advanceValue(reader, 4);
1669 } else if (readNumber(reader)) {
1670 return reader->lastToken;
1671 } else {
1672 setError(reader, JERR_UNEXPECTED_TOKEN);
1673 return JTOK_ERROR;
1674 }
1675 }
1676 static JsonTokenType readValueEx(JsonReader* reader) {
1677 if (reader->flags & JSON_READER_IGNORE_CASE_KEYWORDS) {
1678 if (stringStartsWithIgnoreCase(reader->data, reader->size, "true", 4)) {
1679 reader->valueType = JVAL_BOOL;
1680 return advanceValue(reader, 4);
1681 } else if (stringStartsWithIgnoreCase(reader->data, reader->size, "false", 5)) {
1682 reader->valueType = JVAL_BOOL;
1683 return advanceValue(reader, 5);
1684 } else if (stringStartsWithIgnoreCase(reader->data, reader->size, "null", 4)) {
1685 reader->valueType = JVAL_NULL;
1686 return advanceValue(reader, 4);
1687 }
1688 } else {
1689 if (stringStartsWith(reader->data, reader->size, "true", 4)) {
1690 reader->valueType = JVAL_BOOL;
1691 return advanceValue(reader, 4);
1692 } else if (stringStartsWith(reader->data, reader->size, "false", 5)) {
1693 reader->valueType = JVAL_BOOL;
1694 return advanceValue(reader, 5);
1695 } else if (stringStartsWith(reader->data, reader->size, "null", 4)) {
1696 reader->valueType = JVAL_NULL;
1697 return advanceValue(reader, 4);
1698 }
1699 }
1700 if (readNumberEx(reader)) {
1701 return reader->lastToken;
1702 } else {
1703 setError(reader, JERR_UNEXPECTED_TOKEN);
1704 return JTOK_ERROR;
1705 }
1706 }
1707
1708 static tm_bool jsonPushContext(JsonReader* reader, JsonContext context) {
1709 JsonContextStack* stack = &reader->contextStack;
1710 if (stack->size && (JsonContext)stack->data[stack->size - 1].context == context) {
1711 if (stack->data[stack->size - 1].count < TMJ_MAX_NESTING_COUNT) {
1712 ++stack->data[stack->size - 1].count;
1713 return TM_TRUE;
1714 }
1715 }
1716
1717 if (stack->size < stack->capacity) {
1718 JsonContextEntry* entry = &stack->data[stack->size++];
1719 entry->context = (int8_t)context;
1720 entry->count = 1;
1721 return TM_TRUE;
1722 } else {
1723 setError(reader, JERR_OUT_OF_CONTEXT_STACK_MEMORY);
1724 return TM_FALSE;
1725 }
1726 }
1727 static tm_bool jsonPopContext(JsonReader* reader, JsonContext context) {
1728 JsonContextStack* stack = &reader->contextStack;
1729 if (!stack->size || (JsonContext)stack->data[stack->size - 1].context != context) {
1730 setError(reader, JERR_MISMATCHED_BRACKETS);
1731 return TM_FALSE;
1732 }
1733 if (stack->data[stack->size - 1].count > 1) {
1734 --stack->data[stack->size - 1].count;
1735 } else {
1736 TM_ASSERT(stack->data[stack->size - 1].count == 1);
1737 --stack->size;
1738 }
1739 return TM_TRUE;
1740 }
1741 inline static JsonContext jsonCurrentContext(JsonReader* reader) {
1742 TM_ASSERT(reader->contextStack.size);
1743 return (JsonContext)reader->contextStack.data[reader->contextStack.size - 1].context;
1744 }
1745 static tm_bool jsonCanValueFollowLastToken(JsonReader* reader, JsonContext currentContext) {
1746 /* Check whether a value can follow last token in current context. */
1747 switch (currentContext) {
1748 case JSON_CONTEXT_NULL: {
1749 // A value can only exist at root level if no other value was parsed already.
1750 return (reader->flags & TMJ_ROOT_ENTERED) == 0;
1751 }
1752 case JSON_CONTEXT_OBJECT: {
1753 if (reader->lastToken != JTOK_PROPERTYCOLON) return TM_FALSE;
1754 break;
1755 }
1756 case JSON_CONTEXT_ARRAY: {
1757 if (reader->lastToken != JTOK_ARRAY_START && reader->lastToken != JTOK_COMMA) return TM_FALSE;
1758 break;
1759 }
1760 default: {
1761 return TM_FALSE;
1762 }
1763 }
1764 return TM_TRUE;
1765 }
1766 static tm_bool jsonCanEndBracketFollowLastToken(JsonReader* reader, JsonContext currentContext,
1767 JsonContext endingContext) {
1768 if (currentContext == JSON_CONTEXT_NULL || currentContext != endingContext) {
1769 return TM_FALSE;
1770 }
1771 switch (reader->lastToken) {
1772 case JTOK_COMMA: {
1773 if (!(reader->flags & JSON_READER_TRAILING_COMMA)) {
1774 return TM_FALSE;
1775 }
1776 break;
1777 }
1778 case JTOK_PROPERTYNAME:
1779 case JTOK_PROPERTYCOLON: {
1780 return TM_FALSE;
1781 }
1782 default: {
1783 break;
1784 }
1785 }
1786 return TM_TRUE;
1787 }
1788 inline static tm_bool jsonCompareCurrentContextTo(JsonReader* reader, int8_t context) {
1789 return reader->contextStack.size && reader->contextStack.data[reader->contextStack.size - 1].context == context;
1790 }
1791 static void jsonReadCommentLine(JsonReader* reader) {
1792 reader->current.data = reader->data;
1793 const char* p = (const char*)TM_MEMCHR(reader->data, '\n', reader->size);
1794 int has_newline = (p != TM_NULL);
1795 if (!has_newline) p = reader->data + reader->size;
1796 if (!has_newline && (reader->flags & JSON_READER_ALLOW_EXTENDED_WHITESPACE)) {
1797 const char* alt = (const char*)TM_MEMCHR(reader->data, '\r', reader->size);
1798 if (alt) {
1799 p = alt;
1800 has_newline = TM_TRUE;
1801 }
1802 }
1803 reader->current.size = (tm_size_t)(p - reader->data);
1804 reader->column = 0;
1805 ++reader->line;
1806 reader->data += reader->current.size + has_newline;
1807 reader->size -= reader->current.size + has_newline;
1808 }
1809 static void jsonCountNewlines(JsonReader* reader) {
1810 tm_size_t newlines = 0;
1811 const char* p;
1812 const char* last = reader->current.data;
1813 tm_size_t size = reader->current.size;
1814 while ((p = (const char*)TM_MEMCHR(last, '\n', size)) != TM_NULL) {
1815 ++newlines;
1816 size -= (tm_size_t)(p - last + 1);
1817 last = p + 1;
1818 }
1819 if (newlines) {
1820 reader->column = size;
1821 reader->line += newlines;
1822 } else {
1823 reader->column += size;
1824 }
1825 }
1826 static JsonTokenType jsonParseSingleLineComment(JsonReader* reader) {
1827 if (reader->flags & JSON_READER_SINGLE_LINE_COMMENTS) {
1828 jsonAdvance(reader);
1829 if (!reader->size) {
1830 setError(reader, JERR_UNEXPECTED_EOF);
1831 return JTOK_ERROR;
1832 }
1833 if (reader->data[0] == '/') {
1834 jsonAdvance(reader);
1835 jsonReadCommentLine(reader);
1836 // do not alter reader->lastToken, comments have no follow
1837 return JTOK_COMMENT;
1838 }
1839 }
1840 setError(reader, JERR_UNEXPECTED_TOKEN);
1841 return JTOK_ERROR;
1842 }
1843 static JsonTokenType jsonParsePythonComment(JsonReader* reader) {
1844 if (reader->flags & JSON_READER_PYTHON_COMMENTS) {
1845 if (reader->data[0] == '#') {
1846 jsonAdvance(reader);
1847 jsonReadCommentLine(reader);
1848 // do not alter reader->lastToken, comments have no follow
1849 return JTOK_COMMENT;
1850 }
1851 }
1852 setError(reader, JERR_UNEXPECTED_TOKEN);
1853 return JTOK_ERROR;
1854 }
1855 static JsonTokenType jsonParseBlockComment(JsonReader* reader) {
1856 if (reader->flags & JSON_READER_BLOCK_COMMENTS) {
1857 jsonAdvance(reader);
1858 if (!reader->size) {
1859 setError(reader, JERR_UNEXPECTED_EOF);
1860 return JTOK_ERROR;
1861 }
1862 if (reader->data[0] == '*') {
1863 jsonAdvance(reader);
1864 if (!reader->size) {
1865 setError(reader, JERR_UNEXPECTED_EOF);
1866 return JTOK_ERROR;
1867 }
1868 reader->current.data = reader->data;
1869 reader->current.size = 0;
1870 const char* p;
1871 while ((p = (const char*)TM_MEMCHR(reader->data, '*', reader->size)) != TM_NULL) {
1872 tm_size_t diff = (tm_size_t)(p - reader->data);
1873 reader->current.size += diff;
1874 reader->size -= diff + 1;
1875 reader->data = p + 1;
1876 if (!reader->size) {
1877 setError(reader, JERR_UNEXPECTED_EOF);
1878 return JTOK_ERROR;
1879 }
1880 if (*(p + 1) == '/') {
1881 reader->data += 1;
1882 reader->size -= 1;
1883 break;
1884 }
1885 reader->current.size++;
1886 }
1887 jsonCountNewlines(reader);
1888 reader->column += 2; // count */ too
1889 // do not alter reader->lastToken, comments have no follow
1890 return JTOK_COMMENT;
1891 }
1892 }
1893 setError(reader, JERR_UNEXPECTED_TOKEN);
1894 return JTOK_ERROR;
1895 }
1896 static JsonTokenType jsonParseComment(JsonReader* reader) {
1897 if ((reader->flags & JSON_READER_SINGLE_LINE_COMMENTS) || (reader->flags & JSON_READER_BLOCK_COMMENTS)) {
1898 if (reader->size < 2) {
1899 setError(reader, JERR_UNEXPECTED_EOF);
1900 return JTOK_ERROR;
1901 }
1902 switch (reader->data[1]) {
1903 case '/': {
1904 return jsonParseSingleLineComment(reader);
1905 }
1906 case '*': {
1907 return jsonParseBlockComment(reader);
1908 }
1909 }
1910 }
1911 setError(reader, JERR_UNEXPECTED_TOKEN);
1912 return JTOK_ERROR;
1913 }
1914 static JsonTokenType jsonParseQuotedString(JsonReader* reader, JsonContext currentContext) {
1915 if (!readQuotedString(reader)) {
1916 return JTOK_ERROR;
1917 }
1918 JsonTokenType result = JTOK_VALUE;
1919 reader->valueType = JVAL_STRING;
1920 if (currentContext == JSON_CONTEXT_NULL) {
1921 reader->lastToken = result;
1922 return result;
1923 }
1924 if (currentContext == JSON_CONTEXT_OBJECT &&
1925 (reader->lastToken == JTOK_OBJECT_START || reader->lastToken == JTOK_COMMA)) {
1926 result = JTOK_PROPERTYNAME;
1927 } else {
1928 if (!jsonCanValueFollowLastToken(reader, currentContext)) {
1929 setError(reader, JERR_UNEXPECTED_TOKEN);
1930 return JTOK_ERROR;
1931 }
1932 result = JTOK_VALUE;
1933 }
1934 reader->lastToken = result;
1935 return result;
1936 }
1937 static JsonTokenType jsonParseContextStart(JsonReader* reader, JsonContext currentContext, tm_bool isObject) {
1938 if (currentContext != JSON_CONTEXT_NULL) {
1939 if (!jsonCanValueFollowLastToken(reader, currentContext)) {
1940 setError(reader, JERR_UNEXPECTED_TOKEN);
1941 return JTOK_ERROR;
1942 }
1943 } else {
1944 if (reader->flags & TMJ_ROOT_ENTERED) {
1945 setError(reader, JERR_UNEXPECTED_TOKEN);
1946 return JTOK_ERROR;
1947 }
1948 reader->flags |= TMJ_ROOT_ENTERED;
1949 }
1950 JsonTokenType token = (isObject) ? (JTOK_OBJECT_START) : (JTOK_ARRAY_START);
1951 jsonAdvance(reader);
1952 reader->lastToken = token;
1953 return token;
1954 }
1955 static JsonTokenType jsonParseContextEnd(JsonReader* reader, JsonContext currentContext, tm_bool isObject) {
1956 JsonContext context = (isObject) ? (JSON_CONTEXT_OBJECT) : (JSON_CONTEXT_ARRAY);
1957 if (!jsonCanEndBracketFollowLastToken(reader, currentContext, context)) {
1958 setError(reader, JERR_UNEXPECTED_TOKEN);
1959 return JTOK_ERROR;
1960 }
1961 JsonTokenType token = (isObject) ? (JTOK_OBJECT_END) : (JTOK_ARRAY_END);
1962 jsonAdvance(reader);
1963 reader->lastToken = token;
1964 return token;
1965 }
1966
1967 TMJ_DEF JsonTokenType jsonNextTokenImplicit(JsonReader* reader, JsonContext currentContext) {
1968 TM_ASSERT(reader);
1969 TM_ASSERT(reader->data);
1970
1971 for (;;) {
1972 if (!skipWhitespace(reader)) {
1973 if (currentContext != JSON_CONTEXT_NULL) {
1974 setError(reader, JERR_UNEXPECTED_EOF);
1975 return JTOK_ERROR;
1976 }
1977 reader->lastToken = JTOK_EOF;
1978 return JTOK_EOF;
1979 }
1980 char c = reader->data[0];
1981 switch (c) {
1982 case '/': {
1983 return jsonParseSingleLineComment(reader);
1984 }
1985 case '\'': {
1986 if (!(reader->flags & JSON_READER_SINGLE_QUOTED_STRINGS)) {
1987 setError(reader, JERR_UNEXPECTED_TOKEN);
1988 return JTOK_ERROR;
1989 }
1990 // fallthrough into '"' case
1991 }
1992 // fallthrough
1993 case '"': {
1994 return jsonParseQuotedString(reader, currentContext);
1995 }
1996 case '{':
1997 case '[': {
1998 return jsonParseContextStart(reader, currentContext, c == '{');
1999 }
2000 case '}':
2001 case ']': {
2002 return jsonParseContextEnd(reader, currentContext, c == '}');
2003 }
2004 case ':':
2005 case '=': {
2006 if (currentContext != JSON_CONTEXT_OBJECT || reader->lastToken != JTOK_PROPERTYNAME ||
2007 (c == '=' && !(reader->flags & JSON_READER_ALLOW_EQUAL))) {
2008 setError(reader, JERR_UNEXPECTED_TOKEN);
2009 return JTOK_ERROR;
2010 }
2011 jsonAdvance(reader);
2012 reader->lastToken = JTOK_PROPERTYCOLON;
2013 break;
2014 }
2015 case ',': {
2016 if (currentContext == JSON_CONTEXT_NULL) {
2017 setError(reader, JERR_UNEXPECTED_TOKEN);
2018 return JTOK_ERROR;
2019 }
2020 switch (reader->lastToken) {
2021 case JTOK_OBJECT_END:
2022 case JTOK_ARRAY_END:
2023 case JTOK_VALUE: {
2024 break;
2025 }
2026 default: {
2027 setError(reader, JERR_UNEXPECTED_TOKEN);
2028 return JTOK_ERROR;
2029 }
2030 }
2031 jsonAdvance(reader);
2032 reader->lastToken = JTOK_COMMA;
2033 break;
2034 }
2035 default: {
2036 // json value case
2037 if (!jsonCanValueFollowLastToken(reader, currentContext)) {
2038 setError(reader, JERR_UNEXPECTED_TOKEN);
2039 return JTOK_ERROR;
2040 }
2041
2042 reader->flags |= TMJ_ROOT_ENTERED;
2043 return readValue(reader);
2044 }
2045 }
2046 }
2047 }
2048
2049 TMJ_DEF tm_bool jsonIsValidUntilEof(JsonReader* reader) {
2050 if (!reader->size || reader->lastToken == JTOK_EOF) {
2051 return TM_TRUE;
2052 }
2053 JsonTokenType token;
2054 for (;;) {
2055 const char* start_data = reader->data;
2056 tm_size_t start_size = reader->size;
2057 token = jsonNextTokenImplicit(reader, JSON_CONTEXT_NULL);
2058 switch (token) {
2059 case JTOK_COMMENT: {
2060 break;
2061 }
2062 case JTOK_EOF: {
2063 return TM_TRUE;
2064 }
2065 default: {
2066 if (reader->errorType == JSON_OK) {
2067 reader->data = start_data;
2068 reader->size = start_size;
2069 setError(reader, JERR_UNEXPECTED_TOKEN);
2070 }
2071 return TM_FALSE;
2072 }
2073 }
2074 }
2075 }
2076
2077 TMJ_DEF tm_bool jsonIsValidUntilEofEx(JsonReader* reader) {
2078 if (!reader->size || reader->lastToken == JTOK_EOF) {
2079 return TM_TRUE;
2080 }
2081 JsonTokenType token;
2082 for (;;) {
2083 token = jsonNextTokenImplicitEx(reader, JSON_CONTEXT_NULL);
2084 switch (token) {
2085 case JTOK_COMMENT: {
2086 break;
2087 }
2088 case JTOK_EOF: {
2089 return TM_TRUE;
2090 }
2091 default: {
2092 return TM_FALSE;
2093 }
2094 }
2095 }
2096 }
2097
2098 TMJ_DEF JsonTokenType jsonNextToken(JsonReader* reader) {
2099 JsonContext current;
2100 if (reader->contextStack.size) {
2101 current = (JsonContext)reader->contextStack.data[reader->contextStack.size - 1].context;
2102 } else {
2103 current = JSON_CONTEXT_NULL;
2104 }
2105 JsonTokenType token = jsonNextTokenImplicit(reader, current);
2106 switch (token) {
2107 case JTOK_OBJECT_START:
2108 case JTOK_ARRAY_START: {
2109 JsonContext context = (JsonContext)(token - JTOK_OBJECT_START + JSON_CONTEXT_OBJECT);
2110 if (!jsonPushContext(reader, context)) {
2111 return JTOK_ERROR;
2112 }
2113 break;
2114 }
2115 case JTOK_OBJECT_END:
2116 case JTOK_ARRAY_END: {
2117 JsonContext context = (JsonContext)(token - JTOK_OBJECT_END + JSON_CONTEXT_OBJECT);
2118 if (!jsonPopContext(reader, context)) {
2119 return JTOK_ERROR;
2120 }
2121 break;
2122 }
2123 default: {
2124 break;
2125 }
2126 }
2127 return token;
2128 }
2129
2130 static tm_bool jsonParseUnquotedPropertyName(JsonReader* reader, JsonContext currentContext) {
2131 if (currentContext == JSON_CONTEXT_OBJECT && (reader->flags & JSON_READER_UNQUOTED_PROPERTY_NAMES) &&
2132 reader->lastToken != JTOK_PROPERTYCOLON) {
2133 switch (reader->lastToken) {
2134 case JTOK_OBJECT_START:
2135 case JTOK_COMMA: {
2136 break;
2137 }
2138 default: {
2139 setError(reader, JERR_UNEXPECTED_TOKEN);
2140 return TM_FALSE;
2141 }
2142 }
2143 // parse identifier
2144 reader->current.data = reader->data;
2145 reader->current.size = 0;
2146 if (TM_ISDIGIT((unsigned char)reader->data[0]) ||
2147 (!TM_ISALPHA((unsigned char)reader->data[0]) && reader->data[0] != '_' && reader->data[0] != '$')) {
2148 return TM_FALSE;
2149 }
2150 jsonAdvance(reader);
2151 while (reader->size &&
2152 (TM_ISDIGIT((unsigned char)reader->data[0]) || TM_ISALPHA((unsigned char)reader->data[0]) ||
2153 reader->data[0] == '_' || reader->data[0] == '$')) {
2154 jsonAdvance(reader);
2155 }
2156 reader->current.size = (tm_size_t)(reader->data - reader->current.data);
2157 reader->lastToken = JTOK_PROPERTYNAME;
2158 return TM_TRUE;
2159 }
2160 return TM_FALSE;
2161 }
2162
2163 static tm_bool jsonParsePythonRawString(JsonReader* reader, JsonContext currentContext) {
2164 if ((currentContext == JSON_CONTEXT_ARRAY || reader->lastToken == JTOK_PROPERTYCOLON) &&
2165 (reader->flags & JSON_READER_PYTHON_RAW_STRINGS)) {
2166 if (reader->data[0] == 'r' || reader->data[0] == 'R') {
2167 jsonAdvance(reader);
2168 if (!reader->size) {
2169 setError(reader, JERR_UNEXPECTED_EOF);
2170 return TM_FALSE;
2171 }
2172 if ((reader->data[0] == '"' || reader->data[0] == '\'') && readQuotedString(reader)) {
2173 reader->lastToken = JTOK_VALUE;
2174 reader->valueType = JVAL_RAW_STRING;
2175 return TM_TRUE;
2176 } else {
2177 setError(reader, JERR_UNEXPECTED_TOKEN);
2178 return TM_FALSE;
2179 }
2180 }
2181 }
2182 return TM_FALSE;
2183 }
2184 inline static tm_bool jsonIsValidDelimChar(char c) {
2185 return c != ')' && c != '(' && c != '\\' && !TM_ISSPACE((unsigned char)c);
2186 }
2187 static tm_bool jsonParseCppRawString(JsonReader* reader, JsonContext currentContext) {
2188 if ((currentContext == JSON_CONTEXT_ARRAY || reader->lastToken == JTOK_PROPERTYCOLON) &&
2189 (reader->flags & JSON_READER_CPP_RAW_STRINGS)) {
2190 JsonReader stateGuard = *reader;
2191
2192 if (reader->data[0] == 'r' || reader->data[0] == 'R') {
2193 jsonAdvance(reader);
2194 if (!reader->size) {
2195 setError(reader, JERR_UNEXPECTED_EOF);
2196 return TM_FALSE;
2197 }
2198 if (reader->data[0] == '"') {
2199 jsonAdvance(reader);
2200 if (!reader->size) {
2201 setError(reader, JERR_UNEXPECTED_EOF);
2202 return TM_FALSE;
2203 }
2204 // get delimiter
2205 char delim[17];
2206 tm_size_t delimSize = 0;
2207 while (reader->size && jsonIsValidDelimChar(reader->data[0]) && delimSize < 16) {
2208 jsonAdvance(reader);
2209 delim[delimSize] = reader->data[0];
2210 ++delimSize;
2211 }
2212 if (reader->size && reader->data[0] == '(') {
2213 // append '"' to delimiter so that we do not need to check ending quotation mark
2214 delim[delimSize] = '"';
2215 ++delimSize;
2216
2217 jsonAdvance(reader);
2218 if (!reader->size) {
2219 setError(reader, JERR_UNEXPECTED_EOF);
2220 return TM_FALSE;
2221 }
2222
2223 reader->current.data = reader->data;
2224 reader->current.size = 0;
2225 const char* p;
2226 while ((p = (const char*)TM_MEMCHR(reader->data, ')', reader->size)) != TM_NULL) {
2227 reader->size -= (tm_size_t)(p - reader->data + 1);
2228 reader->data = p + 1;
2229 if (reader->size < delimSize) {
2230 setError(reader, JERR_UNEXPECTED_EOF);
2231 return TM_FALSE;
2232 }
2233 if (stringEquals(p + 1, delimSize, delim, delimSize)) {
2234 reader->current.size = (tm_size_t)(p - reader->current.data);
2235 reader->size -= delimSize;
2236 reader->data += delimSize;
2237 break;
2238 }
2239 }
2240 if (!p) {
2241 setError(reader, JERR_UNEXPECTED_EOF);
2242 return TM_FALSE;
2243 }
2244 // parse raw string
2245 reader->lastToken = JTOK_VALUE;
2246 reader->valueType = JVAL_RAW_STRING;
2247 return TM_TRUE;
2248 }
2249 }
2250 }
2251
2252 // undo any advances we did
2253 *reader = stateGuard;
2254 }
2255 // string isn't cpp style raw string
2256 return TM_FALSE;
2257 }
2258
2259 static JsonTokenType jsonParseQuotedStringEx(JsonReader* reader, JsonContext currentContext) {
2260 char quot = reader->data[0];
2261 JsonTokenType token = jsonParseQuotedString(reader, currentContext);
2262 JsonStringView current = reader->current;
2263 tm_bool allowConcatenated =
2264 (reader->flags & JSON_READER_CONCATENATED_STRINGS) && currentContext == JSON_CONTEXT_OBJECT;
2265 tm_bool allowConcatenatedArray =
2266 (reader->flags & JSON_READER_CONCATENATED_STRINGS_IN_ARRAYS) && currentContext == JSON_CONTEXT_ARRAY;
2267 if (token == JTOK_VALUE && (allowConcatenated || allowConcatenatedArray)) {
2268 do {
2269 if (!skipWhitespaceEx(reader, /*ex=*/TM_TRUE)) break;
2270 TM_ASSERT(reader->size);
2271 JsonReader stateGuard = *reader;
2272 if (reader->data[0] == quot && readQuotedString(reader)) {
2273 current.size = (tm_size_t)(reader->current.data + reader->current.size - current.data);
2274 reader->valueType = JVAL_CONCAT_STRING;
2275 } else {
2276 *reader = stateGuard;
2277 break;
2278 }
2279 } while (reader->data[0] == quot);
2280 if (reader->valueType == JVAL_CONCAT_STRING) {
2281 // we include the first quotation mark for concatenated strings, so that
2282 // jsonCopyConcatenatedString knows which quotation mark to use when concatenating
2283 --current.data;
2284 ++current.size;
2285 }
2286 reader->current = current;
2287 }
2288 return token;
2289 }
2290
2291 TMJ_DEF JsonTokenType jsonNextTokenImplicitEx(JsonReader* reader, JsonContext currentContext) {
2292 TM_ASSERT(reader);
2293 TM_ASSERT(reader->data);
2294
2295 for (;;) {
2296 if (!skipWhitespaceEx(reader, /*ex=*/TM_TRUE)) {
2297 if (currentContext != JSON_CONTEXT_NULL) {
2298 setError(reader, JERR_UNEXPECTED_EOF);
2299 return JTOK_ERROR;
2300 }
2301 reader->lastToken = JTOK_EOF;
2302 return JTOK_EOF;
2303 }
2304 char c = reader->data[0];
2305 switch (c) {
2306 case '/': {
2307 return jsonParseComment(reader);
2308 }
2309 case '#': {
2310 return jsonParsePythonComment(reader);
2311 }
2312 case '\'': {
2313 if (!(reader->flags & JSON_READER_SINGLE_QUOTED_STRINGS)) {
2314 setError(reader, JERR_UNEXPECTED_TOKEN);
2315 return JTOK_ERROR;
2316 }
2317 // fallthrough into '"' case
2318 }
2319 // fallthrough
2320 case '"': {
2321 return jsonParseQuotedStringEx(reader, currentContext);
2322 }
2323 case '{':
2324 case '[': {
2325 return jsonParseContextStart(reader, currentContext, c == '{');
2326 }
2327 case '}':
2328 case ']': {
2329 return jsonParseContextEnd(reader, currentContext, c == '}');
2330 }
2331 case ':':
2332 case '=': {
2333 if (currentContext != JSON_CONTEXT_OBJECT || reader->lastToken != JTOK_PROPERTYNAME ||
2334 (c == '=' && !(reader->flags & JSON_READER_ALLOW_EQUAL))) {
2335 setError(reader, JERR_UNEXPECTED_TOKEN);
2336 return JTOK_ERROR;
2337 }
2338 jsonAdvance(reader);
2339 reader->lastToken = JTOK_PROPERTYCOLON;
2340 break;
2341 }
2342 case ',': {
2343 if (currentContext == JSON_CONTEXT_NULL) {
2344 setError(reader, JERR_UNEXPECTED_TOKEN);
2345 return JTOK_ERROR;
2346 }
2347 switch (reader->lastToken) {
2348 case JTOK_OBJECT_END:
2349 case JTOK_ARRAY_END:
2350 case JTOK_VALUE: {
2351 break;
2352 }
2353 default: {
2354 setError(reader, JERR_UNEXPECTED_TOKEN);
2355 return JTOK_ERROR;
2356 }
2357 }
2358 jsonAdvance(reader);
2359 reader->lastToken = JTOK_COMMA;
2360 break;
2361 }
2362 default: {
2363 // Unqoted property name case.
2364 if (jsonParseUnquotedPropertyName(reader, currentContext)) return JTOK_PROPERTYNAME;
2365 // Check raw string cases.
2366 switch (c) {
2367 case 'r':
2368 case 'R': {
2369 if (jsonParseCppRawString(reader, currentContext)) return reader->lastToken;
2370 if (reader->errorType != JSON_OK) return JTOK_ERROR;
2371 if (jsonParsePythonRawString(reader, currentContext)) return reader->lastToken;
2372 if (reader->errorType != JSON_OK) return JTOK_ERROR;
2373 break;
2374 }
2375 }
2376 if (reader->errorType != JSON_OK) return JTOK_ERROR;
2377
2378 // Json value case.
2379 if (!jsonCanValueFollowLastToken(reader, currentContext)) {
2380 setError(reader, JERR_UNEXPECTED_TOKEN);
2381 return JTOK_ERROR;
2382 }
2383 reader->flags |= TMJ_ROOT_ENTERED;
2384 return readValueEx(reader);
2385 }
2386 }
2387 }
2388 }
2389 TMJ_DEF JsonTokenType jsonNextTokenEx(JsonReader* reader) {
2390 JsonContext current;
2391 if (reader->contextStack.size) {
2392 current = (JsonContext)reader->contextStack.data[reader->contextStack.size - 1].context;
2393 } else {
2394 current = JSON_CONTEXT_NULL;
2395 }
2396 JsonTokenType token = jsonNextTokenImplicitEx(reader, current);
2397 switch (token) {
2398 case JTOK_OBJECT_START:
2399 case JTOK_ARRAY_START: {
2400 JsonContext context = (JsonContext)(token - JTOK_OBJECT_START + JSON_CONTEXT_OBJECT);
2401 if (!jsonPushContext(reader, context)) return JTOK_ERROR;
2402 break;
2403 }
2404 case JTOK_OBJECT_END:
2405 case JTOK_ARRAY_END: {
2406 JsonContext context = (JsonContext)(token - JTOK_OBJECT_END + JSON_CONTEXT_OBJECT);
2407 if (!jsonPopContext(reader, context)) return JTOK_ERROR;
2408 break;
2409 }
2410 default: {
2411 break;
2412 }
2413 }
2414 return token;
2415 }
2416
2417 TMJ_DEF JsonTokenType jsonReadRootType(JsonReader* reader, tm_bool ex) {
2418 for (;;) {
2419 JsonTokenType token;
2420 if (ex) {
2421 token = jsonNextTokenImplicitEx(reader, JSON_CONTEXT_NULL);
2422 } else {
2423 token = jsonNextTokenImplicit(reader, JSON_CONTEXT_NULL);
2424 }
2425 switch (token) {
2426 case JTOK_OBJECT_START:
2427 case JTOK_ARRAY_START:
2428 case JTOK_VALUE: {
2429 return token;
2430 }
2431 case JTOK_COMMENT: {
2432 continue;
2433 }
2434 default: {
2435 setError(reader, JERR_UNEXPECTED_TOKEN);
2436 return JTOK_ERROR;
2437 }
2438 }
2439 }
2440 }
2441
2442 TMJ_DEF tm_bool jsonSkipCurrent(JsonReader* reader, JsonContext currentContext, tm_bool ex) {
2443 if (reader->errorType != JSON_OK) return TM_FALSE;
2444 if (!reader->size) return TM_FALSE;
2445 if (reader->lastToken != JTOK_OBJECT_START && reader->lastToken != JTOK_ARRAY_START &&
2446 reader->lastToken != JTOK_PROPERTYNAME) {
2447 return TM_FALSE;
2448 }
2449
2450 if (reader->lastToken == JTOK_PROPERTYNAME) {
2451 // skip ahead to content
2452 int run = 1;
2453 do {
2454 JsonTokenType token;
2455 if (ex) {
2456 token = jsonNextTokenImplicitEx(reader, currentContext);
2457 } else {
2458 token = jsonNextTokenImplicit(reader, currentContext);
2459 }
2460 switch (token) {
2461 case JTOK_OBJECT_START: {
2462 run = 0;
2463 currentContext = JSON_CONTEXT_OBJECT;
2464 break;
2465 }
2466 case JTOK_ARRAY_START: {
2467 run = 0;
2468 currentContext = JSON_CONTEXT_ARRAY;
2469 break;
2470 }
2471 case JTOK_VALUE: {
2472 return TM_TRUE;
2473 }
2474 case JTOK_COMMENT: {
2475 break;
2476 }
2477 default: {
2478 if (reader->errorType != JSON_OK) {
2479 return TM_FALSE;
2480 }
2481 TM_ASSERT(0 && "invalid code path");
2482 return TM_FALSE;
2483 }
2484 }
2485 } while (run);
2486 if (reader->errorType != JSON_OK) return TM_FALSE;
2487 }
2488 TM_ASSERT(reader->lastToken == JTOK_OBJECT_START || reader->lastToken == JTOK_ARRAY_START);
2489 JsonTokenType skipping = reader->lastToken;
2490
2491 unsigned int depth = 1;
2492
2493 while (reader->size) {
2494 if (!skipWhitespaceEx(reader, ex)) {
2495 if (currentContext != JSON_CONTEXT_NULL) {
2496 setError(reader, JERR_UNEXPECTED_EOF);
2497 return TM_FALSE;
2498 }
2499 reader->lastToken = JTOK_EOF;
2500 return JTOK_EOF;
2501 }
2502 char c = reader->data[0];
2503 jsonAdvance(reader);
2504 switch (c) {
2505 case '{': {
2506 if (skipping == JTOK_OBJECT_START) ++depth;
2507 break;
2508 }
2509 case '}': {
2510 if (skipping == JTOK_OBJECT_START) {
2511 --depth;
2512 if (depth == 0) {
2513 reader->lastToken = JTOK_OBJECT_END;
2514 return TM_TRUE;
2515 }
2516 }
2517 break;
2518 }
2519 case '[': {
2520 if (skipping == JTOK_ARRAY_START) ++depth;
2521 break;
2522 }
2523 case ']': {
2524 if (skipping == JTOK_ARRAY_START) {
2525 --depth;
2526 if (depth == 0) {
2527 reader->lastToken = JTOK_ARRAY_END;
2528 return TM_TRUE;
2529 }
2530 }
2531 break;
2532 }
2533 case '"': {
2534 --reader->data;
2535 ++reader->size;
2536 if (!readQuotedString(reader)) return TM_FALSE;
2537 break;
2538 }
2539 }
2540 }
2541
2542 return TM_FALSE;
2543 }
2544
2545 TMJ_DEF JsonReader jsonMakeReader(const char* data, tm_size_t size, JsonContextEntry* contextStackMemory,
2546 tm_size_t contextStackSize, unsigned int flags) {
2547 JsonReader reader;
2548 TM_MEMSET(&reader, 0, sizeof(JsonReader));
2549
2550 reader.data = data;
2551 reader.size = size;
2552 reader.line = 1;
2553 reader.flags = flags;
2554 reader.flags &= ~TMJ_ROOT_ENTERED;
2555 reader.contextStack.data = contextStackMemory;
2556 reader.contextStack.size = 0;
2557 reader.contextStack.capacity = contextStackSize;
2558 return reader;
2559 }
2560
2561 tm_size_t jsonCopyUnescapedString(JsonStringView str, char* buffer, tm_size_t size) {
2562 if (!str.data || str.size <= 0 || size <= 0) return 0;
2563 TM_ASSERT(buffer);
2564 const char* first = str.data;
2565 const char* last = str.data + str.size;
2566 const char* cur = first;
2567 char* buffer_start = buffer;
2568 tm_size_t buffer_remaining = size;
2569
2570 while ((cur = (const char*)TM_MEMCHR(first, (unsigned char)'\\', (size_t)(last - first))) != TM_NULL) {
2571 if (buffer_remaining <= 0) break;
2572
2573 tm_size_t range = (tm_size_t)(cur - first);
2574 if (range > buffer_remaining) range = buffer_remaining;
2575 TM_MEMCPY(buffer, first, range * sizeof(char));
2576 buffer += range;
2577 buffer_remaining -= range;
2578 first = cur + 1;
2579 if (first == last || first + 1 == last) break;
2580 ++first;
2581 switch (*(cur + 1)) {
2582 case '\n': {
2583 // escaped multiline string, ignore newline
2584 continue;
2585 }
2586 case 'b': {
2587 *buffer++ = '\b';
2588 break;
2589 }
2590 case 'f': {
2591 *buffer++ = '\f';
2592 break;
2593 }
2594 case 'n': {
2595 *buffer++ = '\n';
2596 break;
2597 }
2598 case 'r': {
2599 *buffer++ = '\r';
2600 break;
2601 }
2602 case 't': {
2603 *buffer++ = '\t';
2604 break;
2605 }
2606 case 'u': {
2607 tm_size_t remaining = (tm_size_t)(last - first);
2608 if (remaining < 4) return (tm_size_t)(buffer - buffer_start);
2609
2610 uint32_t codepoint = 0;
2611 tm_size_t advance = tmj_get_codepoint(first, remaining, &codepoint);
2612 if (advance <= 0) return (tm_size_t)(buffer - buffer_start);
2613
2614 tm_size_t written = tmj_utf8_encode(codepoint, buffer, buffer_remaining);
2615 if (written > buffer_remaining) return (tm_size_t)(buffer - buffer_start);
2616
2617 buffer += written;
2618 buffer_remaining -= written;
2619 first += advance;
2620 break;
2621 }
2622 default: {
2623 // Default behavior, just copy char after the escape as it is.
2624 *buffer++ = *(cur + 1);
2625 break;
2626 }
2627 }
2628 }
2629 if (first != last && buffer_remaining > 0) {
2630 tm_size_t range = (tm_size_t)(last - first);
2631 if (range > buffer_remaining) range = buffer_remaining;
2632 TM_MEMCPY(buffer, first, range * sizeof(char));
2633 buffer += range;
2634 buffer_remaining -= range;
2635 }
2636 return (tm_size_t)(buffer - buffer_start);
2637 }
2638 tm_size_t jsonCopyConcatenatedString(JsonStringView str, char* buffer, tm_size_t size) {
2639 if (!str.data || str.size <= 1 || size <= 0) return 0;
2640 char quot = str.data[0];
2641 ++str.data;
2642 --str.size;
2643 TM_ASSERT(buffer);
2644 tm_size_t sz = TM_MIN(size, str.size);
2645 const char* p = str.data;
2646 const char* next = TM_NULL;
2647 const char* start = buffer;
2648 tm_bool add = TM_TRUE;
2649 while ((next = (const char*)TM_MEMCHR(p, quot, sz)) != TM_NULL) {
2650 sz -= (tm_size_t)(next - p + 1);
2651 if (add) {
2652 tm_bool skip = TM_FALSE;
2653 if (next > p && !tmj_is_char_unescaped(p, next)) {
2654 // include escaped quotation when copying unescaped string
2655 ++next;
2656 skip = TM_TRUE;
2657 }
2658 JsonStringView current;
2659 current.data = p;
2660 current.size = (tm_size_t)(next - p);
2661 tm_size_t len = jsonCopyUnescapedString(current, buffer, size);
2662 buffer += len;
2663 size -= len;
2664 if (skip) {
2665 // skip to next part of string, since we haven't found an unescaped quot yet
2666 p = next;
2667 continue;
2668 }
2669 }
2670 p = next + 1;
2671 add = !add;
2672 }
2673 if (sz) {
2674 TM_MEMCPY(buffer, p, sz);
2675 buffer += sz;
2676 }
2677 tm_size_t result = (tm_size_t)(buffer - start);
2678 if (result < size) {
2679 // make resulting string nullterminated
2680 buffer[result] = 0;
2681 }
2682 return result;
2683 }
2684
2685 JsonStringView jsonAllocateUnescapedString(JsonStackAllocator* allocator, JsonStringView str) {
2686 JsonStringView result = {TM_NULL, 0};
2687 char* buffer = (char*)jsonAllocate(allocator, str.size, sizeof(char));
2688 if (buffer) {
2689 result.size = jsonCopyUnescapedString(str, buffer, str.size);
2690 result.data = buffer;
2691 if (result.size < str.size) {
2692 // give back unused size to allocator
2693 tm_size_t diff = (tm_size_t)(str.size - result.size);
2694 allocator->ptr -= diff;
2695 allocator->size += diff;
2696 }
2697 }
2698 return result;
2699 }
2700 JsonStringView jsonAllocateConcatenatedString(JsonStackAllocator* allocator, JsonStringView str) {
2701 JsonStringView result = {TM_NULL, 0};
2702 char* buffer = (char*)jsonAllocate(allocator, str.size, sizeof(char));
2703 if (buffer) {
2704 result.size = jsonCopyConcatenatedString(str, buffer, str.size);
2705 result.data = buffer;
2706 if (result.size < str.size) {
2707 // give back unused size to allocator
2708 tm_size_t diff = (tm_size_t)(str.size - result.size);
2709 allocator->ptr -= diff;
2710 allocator->size += diff;
2711 }
2712 }
2713 return result;
2714 }
2715
2716 inline static int jsonIsPowerOfTwo(unsigned int x) { return x && !(x & (x - 1)); }
2717 TMJ_DEF unsigned int jsonGetAlignmentOffset(const void* ptr, unsigned int alignment) {
2718 TM_ASSERT(alignment != 0 && jsonIsPowerOfTwo(alignment));
2719 unsigned int alignmentOffset = (alignment - ((uintptr_t)ptr)) & (alignment - 1);
2720 TM_ASSERT((((uintptr_t)((char*)ptr + alignmentOffset)) % (alignment)) == 0);
2721 return alignmentOffset;
2722 }
2723 TMJ_DEF void* jsonAllocate(JsonStackAllocator* allocator, size_t size, unsigned int alignment) {
2724 unsigned int offset = jsonGetAlignmentOffset(allocator->ptr + allocator->size, alignment);
2725 if (allocator->size + offset + size > allocator->capacity) {
2726 return TM_NULL;
2727 }
2728
2729 char* result = allocator->ptr + allocator->size + offset;
2730 allocator->size += offset + size;
2731 TM_ASSERT((((uintptr_t)((char*)result)) % (alignment)) == 0);
2732 return result;
2733 }
2734
2735 #define JSON_ALIGNMENT_OBJECT sizeof(void*)
2736 #define JSON_ALIGNMENT_ARRAY sizeof(void*)
2737 #define JSON_ALIGNMENT_NODE sizeof(void*)
2738 #define JSON_ALIGNMENT_VALUE JSON_ALIGNMENT_OBJECT
2739
2740 #ifdef __cplusplus
2741 static_assert(JSON_ALIGNMENT_OBJECT == alignof(JsonObject), "wrong object alignment");
2742 static_assert(JSON_ALIGNMENT_ARRAY == alignof(JsonArray), "wrong array alignment");
2743 static_assert(JSON_ALIGNMENT_NODE == alignof(JsonNode), "wrong node alignment");
2744 static_assert(JSON_ALIGNMENT_VALUE == alignof(JsonValue), "wrong value alignment");
2745 #endif
2746
2747 static JsonErrorType jsonReadArray(JsonReader* reader, JsonStackAllocator* allocator, JsonArray* out);
2748
2749 static JsonErrorType jsonReadObject(JsonReader* reader, JsonStackAllocator* allocator, JsonObject* out) {
2750 memset(out, 0, sizeof(JsonObject));
2751 JsonReader readerState = *reader;
2752
2753 // count number of members
2754 tm_size_t memberCount = 0;
2755 int run = 1;
2756 do {
2757 JsonTokenType token = jsonNextTokenImplicit(reader, JSON_CONTEXT_OBJECT);
2758 switch (token) {
2759 case JTOK_PROPERTYNAME: {
2760 ++memberCount;
2761 jsonSkipCurrent(reader, JSON_CONTEXT_OBJECT, TM_FALSE);
2762 break;
2763 }
2764 case JTOK_OBJECT_END: {
2765 run = 0;
2766 break;
2767 }
2768 case JTOK_COMMENT: {
2769 break;
2770 }
2771 default: {
2772 if (reader->errorType != JSON_OK) {
2773 return reader->errorType;
2774 }
2775 TM_ASSERT(0 && "invalid code path");
2776 return JERR_INTERNAL_ERROR;
2777 }
2778 }
2779 } while (run);
2780
2781 *reader = readerState;
2782 out->nodes = (JsonNode*)jsonAllocate(allocator, memberCount * sizeof(JsonNode), JSON_ALIGNMENT_NODE);
2783 if (!out->nodes) return JERR_OUT_OF_MEMORY;
2784 out->count = memberCount;
2785
2786 tm_size_t nodesIndex = 0;
2787 run = 1;
2788 do {
2789 JsonTokenType token = jsonNextTokenImplicit(reader, JSON_CONTEXT_OBJECT);
2790 switch (token) {
2791 case JTOK_PROPERTYNAME: {
2792 JsonNode* current = &out->nodes[nodesIndex++];
2793 current->name = reader->current;
2794 int searchContent = 1;
2795 do {
2796 switch (jsonNextTokenImplicit(reader, JSON_CONTEXT_OBJECT)) {
2797 case JTOK_OBJECT_START: {
2798 searchContent = 0;
2799 current->value.type = JVAL_OBJECT;
2800 JsonErrorType result = jsonReadObject(reader, allocator, &current->value.data.object);
2801 if (result != JSON_OK) {
2802 return result;
2803 }
2804 break;
2805 }
2806 case JTOK_ARRAY_START: {
2807 searchContent = 0;
2808 current->value.type = JVAL_ARRAY;
2809 JsonErrorType result = jsonReadArray(reader, allocator, &current->value.data.array);
2810 if (result != JSON_OK) {
2811 return result;
2812 }
2813 break;
2814 }
2815 case JTOK_VALUE: {
2816 searchContent = 0;
2817 current->value.type = reader->valueType;
2818 if (current->value.type == JVAL_STRING) {
2819 current->value.data.content = jsonAllocateUnescapedString(allocator, reader->current);
2820 } else {
2821 current->value.data.content = reader->current;
2822 }
2823 break;
2824 }
2825 case JTOK_COMMENT: {
2826 break;
2827 }
2828 default: {
2829 if (reader->errorType != JSON_OK) {
2830 return reader->errorType;
2831 }
2832 TM_ASSERT(0 && "invalid code path");
2833 return JERR_INTERNAL_ERROR;
2834 }
2835 }
2836 } while (searchContent);
2837 break;
2838 }
2839 case JTOK_COMMENT: {
2840 break;
2841 }
2842 case JTOK_OBJECT_END: {
2843 run = 0;
2844 break;
2845 }
2846 default: {
2847 if (reader->errorType != JSON_OK) {
2848 return reader->errorType;
2849 }
2850 TM_ASSERT(0 && "invalid code path");
2851 return JERR_INTERNAL_ERROR;
2852 }
2853 }
2854 } while (run);
2855
2856 return reader->errorType;
2857 }
2858 static JsonErrorType jsonReadArray(JsonReader* reader, JsonStackAllocator* allocator, JsonArray* out) {
2859 JsonReader readerState = *reader;
2860
2861 // count number of members
2862 int memberCount = 0;
2863 int run = 1;
2864 do {
2865 JsonTokenType token = jsonNextTokenImplicit(reader, JSON_CONTEXT_ARRAY);
2866 switch (token) {
2867 case JTOK_OBJECT_START:
2868 case JTOK_ARRAY_START: {
2869 ++memberCount;
2870 jsonSkipCurrent(reader, JSON_CONTEXT_ARRAY, TM_FALSE);
2871 break;
2872 }
2873 case JTOK_VALUE: {
2874 ++memberCount;
2875 break;
2876 }
2877 case JTOK_COMMENT: {
2878 break;
2879 }
2880 case JTOK_ARRAY_END: {
2881 run = 0;
2882 break;
2883 }
2884 default: {
2885 if (reader->errorType != JSON_OK) {
2886 return reader->errorType;
2887 }
2888 TM_ASSERT(0 && "invalid code path");
2889 return JERR_INTERNAL_ERROR;
2890 }
2891 }
2892 } while (run);
2893
2894 *reader = readerState;
2895 out->values = (JsonValue*)jsonAllocate(allocator, memberCount * sizeof(JsonValue), JSON_ALIGNMENT_VALUE);
2896 if (!out->values) return JERR_OUT_OF_MEMORY;
2897 out->count = memberCount;
2898
2899 int valuesIndex = 0;
2900 run = 1;
2901 do {
2902 JsonTokenType token = jsonNextTokenImplicit(reader, JSON_CONTEXT_ARRAY);
2903 switch (token) {
2904 case JTOK_OBJECT_START: {
2905 JsonValue* value = &out->values[valuesIndex++];
2906 value->type = JVAL_OBJECT;
2907 JsonErrorType result = jsonReadObject(reader, allocator, &value->data.object);
2908 if (result != JSON_OK) {
2909 return result;
2910 }
2911 break;
2912 }
2913 case JTOK_ARRAY_START: {
2914 JsonValue* value = &out->values[valuesIndex++];
2915 value->type = JVAL_ARRAY;
2916 JsonErrorType result = jsonReadArray(reader, allocator, &value->data.array);
2917 if (result != JSON_OK) {
2918 return result;
2919 }
2920 break;
2921 }
2922 case JTOK_VALUE: {
2923 JsonValue* value = &out->values[valuesIndex++];
2924 value->type = reader->valueType;
2925 if (value->type == JVAL_STRING) {
2926 value->data.content = jsonAllocateUnescapedString(allocator, reader->current);
2927 } else {
2928 value->data.content = reader->current;
2929 }
2930 break;
2931 }
2932 case JTOK_COMMENT: {
2933 break;
2934 }
2935 case JTOK_ARRAY_END: {
2936 run = 0;
2937 break;
2938 }
2939 default: {
2940 if (reader->errorType != JSON_OK) {
2941 return reader->errorType;
2942 }
2943 TM_ASSERT(0 && "invalid code path");
2944 return JERR_INTERNAL_ERROR;
2945 }
2946 }
2947 } while (run);
2948
2949 return reader->errorType;
2950 }
2951
2952 TMJ_DEF JsonAllocatedDocument jsonAllocateDocument(const char* data, tm_size_t size, unsigned int flags) {
2953 size_t poolSize = size * sizeof(JsonValue);
2954 char* pool = (char*)TM_MALLOC(poolSize, JSON_ALIGNMENT_VALUE);
2955 JsonStackAllocator allocator;
2956 allocator.ptr = pool;
2957 allocator.size = 0;
2958 allocator.capacity = size * sizeof(JsonValue);
2959 JsonAllocatedDocument result;
2960 result.document = jsonMakeDocument(&allocator, data, size, flags);
2961 result.pool = pool;
2962 result.poolSize = poolSize;
2963 return result;
2964 }
2965 TMJ_DEF JsonDocument jsonMakeDocument(JsonStackAllocator* allocator, const char* data, tm_size_t size,
2966 unsigned int flags) {
2967 JsonDocument result;
2968 TM_MEMSET(&result, 0, sizeof(JsonDocument));
2969
2970 JsonReader reader = jsonMakeReader(data, size, TM_NULL, 0, flags);
2971 JsonTokenType rootType = jsonReadRootType(&reader, /*ex=*/TM_FALSE);
2972 switch (rootType) {
2973 case JTOK_ERROR: {
2974 break;
2975 }
2976 case JTOK_OBJECT_START: {
2977 result.root.type = JVAL_OBJECT;
2978 result.error.type = jsonReadObject(&reader, allocator, &result.root.data.object);
2979 break;
2980 }
2981 case JTOK_ARRAY_START: {
2982 result.root.type = JVAL_ARRAY;
2983 result.error.type = jsonReadArray(&reader, allocator, &result.root.data.array);
2984 break;
2985 }
2986 case JTOK_VALUE: {
2987 result.root.type = reader.valueType;
2988 if (result.root.type == JVAL_STRING) {
2989 result.root.data.content = jsonAllocateUnescapedString(allocator, reader.current);
2990 } else {
2991 result.root.data.content = reader.current;
2992 }
2993 break;
2994 }
2995 default: {
2996 TM_ASSERT(0 && "invalid code path");
2997 result.error.type = JERR_INTERNAL_ERROR;
2998 break;
2999 }
3000 }
3001 if (reader.errorType == JSON_OK) jsonIsValidUntilEof(&reader);
3002 TM_ASSERT(reader.size == 0 || reader.errorType != JSON_OK);
3003 if (reader.errorType != JSON_OK) {
3004 TM_MEMSET(&result, 0, sizeof(JsonDocument));
3005 result.error.type = reader.errorType;
3006 result.error.line = reader.line;
3007 result.error.column = reader.column;
3008 result.error.offset = (tm_size_t)(reader.current.data - data);
3009 result.error.length = reader.current.size;
3010 }
3011 return result;
3012 }
3013
3014 static JsonErrorType jsonReadArrayEx(JsonReader* reader, JsonStackAllocator* allocator, JsonArray* out);
3015 static JsonValue jsonAllocateValueEx(JsonStackAllocator* allocator, JsonReader* reader) {
3016 JsonValue result;
3017 switch (reader->valueType) {
3018 case JVAL_STRING: {
3019 result.type = JVAL_STRING;
3020 result.data.content = jsonAllocateUnescapedString(allocator, reader->current);
3021 break;
3022 }
3023 case JVAL_CONCAT_STRING: {
3024 result.type = JVAL_STRING;
3025 result.data.content = jsonAllocateConcatenatedString(allocator, reader->current);
3026 break;
3027 }
3028 case JVAL_RAW_STRING: {
3029 result.type = JVAL_STRING;
3030 result.data.content = reader->current;
3031 break;
3032 }
3033 default: {
3034 result.type = reader->valueType;
3035 result.data.content = reader->current;
3036 break;
3037 }
3038 }
3039 return result;
3040 }
3041 static JsonErrorType jsonReadObjectEx(JsonReader* reader, JsonStackAllocator* allocator, JsonObject* out) {
3042 memset(out, 0, sizeof(JsonObject));
3043 JsonReader readerState = *reader;
3044
3045 // count number of members
3046 tm_size_t memberCount = 0;
3047 int run = 1;
3048 do {
3049 JsonTokenType token = jsonNextTokenImplicitEx(reader, JSON_CONTEXT_OBJECT);
3050 switch (token) {
3051 case JTOK_PROPERTYNAME: {
3052 ++memberCount;
3053 jsonSkipCurrent(reader, JSON_CONTEXT_OBJECT, TM_TRUE);
3054 break;
3055 }
3056 case JTOK_OBJECT_END: {
3057 run = 0;
3058 break;
3059 }
3060 case JTOK_COMMENT: {
3061 break;
3062 }
3063 default: {
3064 if (reader->errorType != JSON_OK) {
3065 return reader->errorType;
3066 }
3067 TM_ASSERT(0 && "invalid code path");
3068 return JERR_INTERNAL_ERROR;
3069 }
3070 }
3071 } while (run);
3072
3073 *reader = readerState;
3074 out->nodes = (JsonNode*)jsonAllocate(allocator, memberCount * sizeof(JsonNode), JSON_ALIGNMENT_NODE);
3075 if (!out->nodes) return JERR_OUT_OF_MEMORY;
3076 out->count = memberCount;
3077
3078 tm_size_t nodesIndex = 0;
3079 run = 1;
3080 do {
3081 JsonTokenType token = jsonNextTokenImplicitEx(reader, JSON_CONTEXT_OBJECT);
3082 switch (token) {
3083 case JTOK_PROPERTYNAME: {
3084 JsonNode* current = &out->nodes[nodesIndex++];
3085 current->name = reader->current;
3086 int searchContent = 1;
3087 do {
3088 switch (jsonNextTokenImplicitEx(reader, JSON_CONTEXT_OBJECT)) {
3089 case JTOK_OBJECT_START: {
3090 searchContent = 0;
3091 current->value.type = JVAL_OBJECT;
3092 JsonErrorType result = jsonReadObjectEx(reader, allocator, &current->value.data.object);
3093 if (result != JSON_OK) {
3094 return result;
3095 }
3096 break;
3097 }
3098 case JTOK_ARRAY_START: {
3099 searchContent = 0;
3100 current->value.type = JVAL_ARRAY;
3101 JsonErrorType result = jsonReadArrayEx(reader, allocator, &current->value.data.array);
3102 if (result != JSON_OK) {
3103 return result;
3104 }
3105 break;
3106 }
3107 case JTOK_VALUE: {
3108 searchContent = 0;
3109 current->value = jsonAllocateValueEx(allocator, reader);
3110 break;
3111 }
3112 case JTOK_COMMENT: {
3113 break;
3114 }
3115 default: {
3116 if (reader->errorType != JSON_OK) {
3117 return reader->errorType;
3118 }
3119 TM_ASSERT(0 && "invalid code path");
3120 return JERR_INTERNAL_ERROR;
3121 }
3122 }
3123 } while (searchContent);
3124 break;
3125 }
3126 case JTOK_COMMENT: {
3127 break;
3128 }
3129 case JTOK_OBJECT_END: {
3130 run = 0;
3131 break;
3132 }
3133 default: {
3134 if (reader->errorType != JSON_OK) {
3135 return reader->errorType;
3136 }
3137 TM_ASSERT(0 && "invalid code path");
3138 return JERR_INTERNAL_ERROR;
3139 }
3140 }
3141 } while (run);
3142
3143 return reader->errorType;
3144 }
3145 static JsonErrorType jsonReadArrayEx(JsonReader* reader, JsonStackAllocator* allocator, JsonArray* out) {
3146 JsonReader readerState = *reader;
3147
3148 // count number of members
3149 int memberCount = 0;
3150 int run = 1;
3151 do {
3152 JsonTokenType token = jsonNextTokenImplicitEx(reader, JSON_CONTEXT_ARRAY);
3153 switch (token) {
3154 case JTOK_OBJECT_START:
3155 case JTOK_ARRAY_START: {
3156 ++memberCount;
3157 jsonSkipCurrent(reader, JSON_CONTEXT_ARRAY, TM_TRUE);
3158 break;
3159 }
3160 case JTOK_VALUE: {
3161 ++memberCount;
3162 break;
3163 }
3164 case JTOK_COMMENT: {
3165 break;
3166 }
3167 case JTOK_ARRAY_END: {
3168 run = 0;
3169 break;
3170 }
3171 default: {
3172 if (reader->errorType != JSON_OK) {
3173 return reader->errorType;
3174 }
3175 TM_ASSERT(0 && "invalid code path");
3176 return JERR_INTERNAL_ERROR;
3177 }
3178 }
3179 } while (run);
3180
3181 *reader = readerState;
3182 out->values = (JsonValue*)jsonAllocate(allocator, memberCount * sizeof(JsonValue), JSON_ALIGNMENT_VALUE);
3183 if (!out->values) return JERR_OUT_OF_MEMORY;
3184 out->count = memberCount;
3185
3186 int valuesIndex = 0;
3187 run = 1;
3188 do {
3189 JsonTokenType token = jsonNextTokenImplicitEx(reader, JSON_CONTEXT_ARRAY);
3190 switch (token) {
3191 case JTOK_OBJECT_START: {
3192 JsonValue* value = &out->values[valuesIndex++];
3193 value->type = JVAL_OBJECT;
3194 JsonErrorType result = jsonReadObjectEx(reader, allocator, &value->data.object);
3195 if (result != JSON_OK) {
3196 return result;
3197 }
3198 break;
3199 }
3200 case JTOK_ARRAY_START: {
3201 JsonValue* value = &out->values[valuesIndex++];
3202 value->type = JVAL_ARRAY;
3203 JsonErrorType result = jsonReadArrayEx(reader, allocator, &value->data.array);
3204 if (result != JSON_OK) {
3205 return result;
3206 }
3207 break;
3208 }
3209 case JTOK_VALUE: {
3210 JsonValue* value = &out->values[valuesIndex++];
3211 *value = jsonAllocateValueEx(allocator, reader);
3212 break;
3213 }
3214 case JTOK_COMMENT: {
3215 break;
3216 }
3217 case JTOK_ARRAY_END: {
3218 run = 0;
3219 break;
3220 }
3221 default: {
3222 if (reader->errorType != JSON_OK) {
3223 return reader->errorType;
3224 }
3225 TM_ASSERT(0 && "invalid code path");
3226 return JERR_INTERNAL_ERROR;
3227 }
3228 }
3229 } while (run);
3230
3231 return reader->errorType;
3232 }
3233
3234 TMJ_DEF JsonAllocatedDocument jsonAllocateDocumentEx(const char* data, tm_size_t size, unsigned int flags) {
3235 size_t poolSize = size * sizeof(JsonValue);
3236 char* pool = (char*)TM_MALLOC(poolSize, JSON_ALIGNMENT_VALUE);
3237 JsonStackAllocator allocator;
3238 allocator.ptr = pool;
3239 allocator.size = 0;
3240 allocator.capacity = size * sizeof(JsonValue);
3241 JsonAllocatedDocument result;
3242 result.document = jsonMakeDocumentEx(&allocator, data, size, flags);
3243 result.pool = pool;
3244 result.poolSize = poolSize;
3245 return result;
3246 }
3247 TMJ_DEF JsonDocument jsonMakeDocumentEx(JsonStackAllocator* allocator, const char* data, tm_size_t size,
3248 unsigned int flags) {
3249 JsonDocument result;
3250 TM_MEMSET(&result, 0, sizeof(JsonDocument));
3251
3252 JsonReader reader = jsonMakeReader(data, size, TM_NULL, 0, flags);
3253 JsonTokenType rootType = jsonReadRootType(&reader, /*ex=*/TM_TRUE);
3254 switch (rootType) {
3255 case JTOK_ERROR: {
3256 break;
3257 }
3258 case JTOK_OBJECT_START: {
3259 result.root.type = JVAL_OBJECT;
3260 result.error.type = jsonReadObjectEx(&reader, allocator, &result.root.data.object);
3261 break;
3262 }
3263 case JTOK_ARRAY_START: {
3264 result.root.type = JVAL_ARRAY;
3265 result.error.type = jsonReadArrayEx(&reader, allocator, &result.root.data.array);
3266 break;
3267 }
3268 case JTOK_VALUE: {
3269 result.root = jsonAllocateValueEx(allocator, &reader);
3270 break;
3271 }
3272 default: {
3273 TM_ASSERT(0 && "invalid code path");
3274 result.error.type = JERR_INTERNAL_ERROR;
3275 break;
3276 }
3277 }
3278 if (reader.errorType == JSON_OK) jsonIsValidUntilEofEx(&reader);
3279 TM_ASSERT(reader.size == 0 || reader.errorType != JSON_OK);
3280 if (reader.errorType != JSON_OK) {
3281 TM_MEMSET(&result, 0, sizeof(JsonDocument));
3282 result.error.type = reader.errorType;
3283 result.error.line = reader.line;
3284 result.error.column = reader.column;
3285 result.error.offset = (tm_size_t)(reader.current.data - data);
3286 result.error.length = reader.current.size;
3287 }
3288 return result;
3289 }
3290 TMJ_DEF void jsonFreeDocument(JsonAllocatedDocument* doc) {
3291 if (doc->pool) {
3292 TM_FREE(doc->pool);
3293 doc->pool = TM_NULL;
3294 doc->poolSize = 0;
3295 }
3296 }
3297
3298 TMJ_DEF tm_bool jsonIsNull(const JsonValue* value) {
3299 TM_ASSERT(value);
3300 return value->type == JVAL_NULL && value->data.content.data != TM_NULL;
3301 }
3302 TMJ_DEF tm_bool jsonIsIntegral(const JsonValue* value) { return value->type >= JVAL_INT; }
3303 TMJ_DEF tm_bool jsonIsString(const JsonValue* value) { return value->type == JVAL_STRING; }
3304 TMJ_DEF JsonObject jsonGetObject(const JsonValue* value) {
3305 #ifdef __cplusplus
3306 JsonObject result = {TM_NULL, 0, 0};
3307 #else
3308 JsonObject result = {TM_NULL, 0};
3309 #endif
3310 if (value->type == JVAL_OBJECT) {
3311 result = value->data.object;
3312 }
3313 return result;
3314 }
3315 TMJ_DEF JsonArray jsonGetArray(const JsonValue* value) {
3316 JsonArray result = {TM_NULL, 0};
3317 if (value->type == JVAL_ARRAY) {
3318 result = value->data.array;
3319 }
3320 return result;
3321 }
3322 TMJ_DEF JsonObjectArray jsonGetObjectArray(const JsonValue* value) {
3323 JsonObjectArray result = {TM_NULL, 0};
3324 if (value->type == JVAL_ARRAY) {
3325 result.values = value->data.array.values;
3326 result.count = value->data.array.count;
3327 }
3328 return result;
3329 }
3330
3331 TMJ_DEF JsonValue jsonGetMember(const JsonObject* object, const char* name) {
3332 TM_ASSERT(object);
3333 #ifdef __cplusplus
3334 return jsonGetMemberCached(object, name, &object->lastAccess);
3335 #else
3336 JsonValue result = {0};
3337 JsonNode* it = object->nodes;
3338 JsonNode* last = object->nodes + object->count;
3339 size_t len = TM_STRLEN(name);
3340 for (; it < last; ++it) {
3341 if (stringEquals(it->name.data, it->name.size, name, len)) {
3342 result = it->value;
3343 break;
3344 }
3345 }
3346 return result;
3347 #endif
3348 }
3349 TMJ_DEF JsonValue* jsonQueryMember(const JsonObject* object, const char* name) {
3350 TM_ASSERT(object);
3351 #ifdef __cplusplus
3352 return jsonQueryMemberCached(object, name, &object->lastAccess);
3353 #else
3354 JsonNode* it = object->nodes;
3355 JsonNode* last = object->nodes + object->count;
3356 size_t len = TM_STRLEN(name);
3357 for (; it < last; ++it) {
3358 if (stringEquals(it->name.data, it->name.size, name, len)) {
3359 return &it->value;
3360 }
3361 }
3362 return TM_NULL;
3363 #endif
3364 }
3365 TMJ_DEF JsonValue jsonGetMemberCached(const JsonObject* object, const char* name, tm_size_t* lastAccess) {
3366 TM_ASSERT(object);
3367 JsonValue result = {JVAL_NULL, {{TM_NULL, 0}}};
3368 JsonValue* value = jsonQueryMemberCached(object, name, lastAccess);
3369 if (value) {
3370 result = *value;
3371 }
3372 return result;
3373 }
3374 TMJ_DEF JsonValue* jsonQueryMemberCached(const JsonObject* object, const char* name, tm_size_t* lastAccess) {
3375 TM_ASSERT(object);
3376 TM_ASSERT(lastAccess);
3377 JsonValue* result = TM_NULL;
3378 tm_bool found = TM_FALSE;
3379 JsonNode* it = object->nodes + *lastAccess;
3380 JsonNode* last = object->nodes + object->count;
3381 size_t len = TM_STRLEN(name);
3382 for (; it < last; ++it) {
3383 if (stringEquals(it->name.data, it->name.size, name, len)) {
3384 result = &it->value;
3385 *lastAccess = (tm_size_t)(it - object->nodes);
3386 found = TM_TRUE;
3387 break;
3388 }
3389 }
3390 if (!found) {
3391 it = object->nodes;
3392 last = object->nodes + *lastAccess;
3393 for (; it < last; ++it) {
3394 if (stringEquals(it->name.data, it->name.size, name, len)) {
3395 result = &it->value;
3396 *lastAccess = (tm_size_t)(it - object->nodes);
3397 break;
3398 }
3399 }
3400 }
3401 return result;
3402 }
3403
3404 #if defined(__cplusplus) && defined(TM_STRING_VIEW)
3405 TMJ_DEF JsonValue jsonGetMember(const JsonObject* object, TM_STRING_VIEW name) {
3406 TM_ASSERT(object);
3407 #ifdef __cplusplus
3408 return jsonGetMemberCached(object, name, &object->lastAccess);
3409 #else
3410 JsonValue result = {0};
3411 JsonNode* it = object->nodes;
3412 JsonNode* last = object->nodes + object->count;
3413 for (; it < last; ++it) {
3414 if (stringEquals(it->name.data, it->name.size, TM_STRING_VIEW_DATA(name), TM_STRING_VIEW_SIZE(name))) {
3415 result = it->value;
3416 break;
3417 }
3418 }
3419 return result;
3420 #endif
3421 }
3422 TMJ_DEF JsonValue* jsonQueryMember(const JsonObject* object, TM_STRING_VIEW name) {
3423 TM_ASSERT(object);
3424 #ifdef __cplusplus
3425 return jsonQueryMemberCached(object, name, &object->lastAccess);
3426 #else
3427 JsonNode* it = object->nodes;
3428 JsonNode* last = object->nodes + object->count;
3429 for (; it < last; ++it) {
3430 if (stringEquals(it->name.data, it->name.size, TM_STRING_VIEW_DATA(name), TM_STRING_VIEW_SIZE(name))) {
3431 return &it->value;
3432 }
3433 }
3434 return TM_NULL;
3435 #endif
3436 }
3437 TMJ_DEF JsonValue jsonGetMemberCached(const JsonObject* object, TM_STRING_VIEW name, tm_size_t* lastAccess) {
3438 TM_ASSERT(object);
3439 JsonValue result = {JVAL_NULL, {{TM_NULL, 0}}};
3440 if (JsonValue* value = jsonQueryMemberCached(object, name, lastAccess)) {
3441 result = *value;
3442 }
3443 return result;
3444 }
3445 TMJ_DEF JsonValue* jsonQueryMemberCached(const JsonObject* object, TM_STRING_VIEW name, tm_size_t* lastAccess) {
3446 TM_ASSERT(object);
3447 TM_ASSERT(lastAccess);
3448 JsonValue* result = TM_NULL;
3449 tm_bool found = TM_FALSE;
3450 JsonNode* it = object->nodes + *lastAccess;
3451 JsonNode* last = object->nodes + object->count;
3452 for (; it < last; ++it) {
3453 if (stringEquals(it->name.data, it->name.size, TM_STRING_VIEW_DATA(name), TM_STRING_VIEW_SIZE(name))) {
3454 result = &it->value;
3455 *lastAccess = (tm_size_t)(it - object->nodes);
3456 found = TM_TRUE;
3457 break;
3458 }
3459 }
3460 if (!found) {
3461 it = object->nodes;
3462 last = object->nodes + *lastAccess;
3463 for (; it < last; ++it) {
3464 if (stringEquals(it->name.data, it->name.size, TM_STRING_VIEW_DATA(name), TM_STRING_VIEW_SIZE(name))) {
3465 result = &it->value;
3466 *lastAccess = (tm_size_t)(it - object->nodes);
3467 break;
3468 }
3469 }
3470 }
3471 return result;
3472 }
3473 #endif // defined( __cplusplus ) && defined( TM_STRING_VIEW )
3474
3475 TMJ_DEF JsonValue jsonGetEntry(const JsonArray* array, tm_size_t index) {
3476 TM_ASSERT(array);
3477 TM_ASSERT(tmj_valid_index(index, array->count));
3478 return array->values[index];
3479 }
3480
3481 TMJ_DEF tm_bool jsonIsValidObject(const JsonObject* object) {
3482 TM_ASSERT(object);
3483 return object->nodes != TM_NULL;
3484 }
3485 TMJ_DEF tm_bool jsonIsValidArray(const JsonArray* array) {
3486 TM_ASSERT(array);
3487 return array->values != TM_NULL;
3488 }
3489 TMJ_DEF tm_bool jsonIsValidValue(const JsonValue* value) {
3490 TM_ASSERT(value);
3491 return value->type != JVAL_NULL;
3492 }
3493
3494 TMJ_DEF int32_t jsonGetInt(const JsonValue* value, int32_t def) {
3495 switch (value->type) {
3496 case JVAL_NULL:
3497 case JVAL_OBJECT:
3498 case JVAL_ARRAY: {
3499 return def;
3500 }
3501 default: {
3502 return jsonToInt(value->data.content, def);
3503 }
3504 }
3505 }
3506 TMJ_DEF uint32_t jsonGetUInt(const JsonValue* value, uint32_t def) {
3507 switch (value->type) {
3508 case JVAL_NULL:
3509 case JVAL_OBJECT:
3510 case JVAL_ARRAY: {
3511 return def;
3512 }
3513 default: {
3514 return jsonToUInt(value->data.content, def);
3515 }
3516 }
3517 }
3518 TMJ_DEF float jsonGetFloat(const JsonValue* value, float def) {
3519 switch (value->type) {
3520 case JVAL_NULL:
3521 case JVAL_OBJECT:
3522 case JVAL_ARRAY: {
3523 return def;
3524 }
3525 default: {
3526 return jsonToFloat(value->data.content, def);
3527 }
3528 }
3529 }
3530 TMJ_DEF double jsonGetDouble(const JsonValue* value, double def) {
3531 switch (value->type) {
3532 case JVAL_NULL:
3533 case JVAL_OBJECT:
3534 case JVAL_ARRAY: {
3535 return def;
3536 }
3537 default: {
3538 return jsonToDouble(value->data.content, def);
3539 }
3540 }
3541 }
3542 TMJ_DEF tm_bool jsonGetBool(const JsonValue* value, tm_bool def) {
3543 switch (value->type) {
3544 case JVAL_NULL:
3545 case JVAL_OBJECT:
3546 case JVAL_ARRAY: {
3547 return def;
3548 }
3549 default: {
3550 return jsonToBool(value->data.content, def);
3551 }
3552 }
3553 }
3554 #ifndef TMJ_NO_INT64
3555 TMJ_DEF int64_t jsonGetInt64(const JsonValue* value, int64_t def) {
3556 switch (value->type) {
3557 case JVAL_NULL:
3558 case JVAL_OBJECT:
3559 case JVAL_ARRAY: {
3560 return def;
3561 }
3562 default: {
3563 return jsonToInt64(value->data.content, def);
3564 }
3565 }
3566 }
3567 TMJ_DEF uint64_t jsonGetUInt64(const JsonValue* value, uint64_t def) {
3568 switch (value->type) {
3569 case JVAL_NULL:
3570 case JVAL_OBJECT:
3571 case JVAL_ARRAY: {
3572 return def;
3573 }
3574 default: {
3575 return jsonToUInt64(value->data.content, def);
3576 }
3577 }
3578 }
3579 #endif
3580
3581 TMJ_DEF JsonValue jsonResolveJsonPointer(const JsonValue* value, const char* json_pointer) {
3582 TM_ASSERT(value);
3583 TM_ASSERT(json_pointer);
3584
3585 JsonValue current = *value;
3586
3587 // Small buffer optimization, so we don't allocate too much memory.
3588 char sbo[64];
3589 char* buffer = sbo;
3590 size_t buffer_size = 64;
3591
3592 tm_bool is_fragment = (*json_pointer == '#');
3593 if (is_fragment) ++json_pointer;
3594
3595 /*
3596 Examples
3597 {
3598 "foo": ["bar", "baz"],
3599 "": 0,
3600 "a/b": 1,
3601 "c%d": 2,
3602 "e^f": 3,
3603 "g|h": 4,
3604 "i\\j": 5,
3605 "k\"l": 6,
3606 " ": 7,
3607 "m~n": 8
3608 }
3609
3610 "" // the whole document
3611 "/foo" ["bar", "baz"]
3612 "/foo/0" "bar"
3613 "/" 0
3614 "/a~1b" 1
3615 "/c%d" 2
3616 "/e^f" 3
3617 "/g|h" 4
3618 "/i\\j" 5
3619 "/k\"l" 6
3620 "/ " 7
3621 "/m~0n" 8
3622
3623 # // the whole document
3624 #/foo ["bar", "baz"]
3625 #/foo/0 "bar"
3626 #/ 0
3627 #/a~1b 1
3628 #/c%25d 2
3629 #/e%5Ef 3
3630 #/g%7Ch 4
3631 #/i%5Cj 5
3632 #/k%22l 6
3633 #/%20 7
3634 #/m~0n 8
3635
3636 */
3637
3638 tm_bool error = TM_FALSE;
3639
3640 const char* first = TM_STRCHR(json_pointer, '/');
3641 while (first) {
3642 ++first; // Skip "/"
3643 const char* next = TM_STRCHR(first, '/');
3644 if (!next) next = first + TM_STRLEN(first);
3645
3646 if (TM_ISDIGIT((unsigned char)first[0])) {
3647 // first refers to an array index.
3648 if (current.type != JVAL_ARRAY) {
3649 error = TM_TRUE;
3650 break;
3651 }
3652
3653 #ifndef TMJ_NO_INT64
3654 uint64_t index = 0;
3655 TMJ_TO_UINT64(first, next, &index, /*base=*/10);
3656 #else
3657 uint32_t index = 0;
3658 TMJ_TO_UINT32(first, next, &index, /*base=*/10);
3659 #endif
3660 if ((tm_size_t)index >= current.data.array.count) {
3661 error = TM_TRUE;
3662 break;
3663 }
3664
3665 current = current.data.array.values[index];
3666 } else {
3667 // first refers a field.
3668 if (current.type != JVAL_OBJECT) {
3669 error = TM_TRUE;
3670 break;
3671 }
3672
3673 // Copy segment to buffer, so we can unescape.
3674 size_t length = (size_t)(next - first);
3675 if (length + 1 > buffer_size) {
3676 size_t new_size = buffer_size * 2;
3677 if (new_size < length + 1) new_size = length + 1;
3678 char* new_buffer = TM_NULL;
3679 if (buffer == sbo) {
3680 new_buffer = (char*)TM_MALLOC(new_size * sizeof(char), sizeof(char));
3681 } else {
3682 new_buffer = (char*)TM_REALLOC(buffer, new_size * sizeof(char*), sizeof(char));
3683 }
3684 if (!new_buffer) {
3685 error = TM_TRUE;
3686 break;
3687 }
3688 buffer = new_buffer;
3689 buffer_size = new_size;
3690 }
3691
3692 TM_ASSERT(buffer);
3693 if (length) TM_MEMCPY(buffer, first, length * sizeof(char));
3694 buffer[length] = 0; // Nullterminate, just so we don't always have to do size comparisons.
3695
3696 size_t out_index = 0;
3697 // Unescape segment.
3698 if (is_fragment) {
3699 for (size_t i = 0; i < length; ++i, ++out_index) {
3700 if (buffer[i] == '%') {
3701 // Url decode something like %20 -> ' '.
3702 if (!TM_ISXDIGIT((unsigned char)buffer[i + 1]) || !TM_ISXDIGIT((unsigned char)buffer[i + 2])) {
3703 error = TM_TRUE;
3704 break;
3705 }
3706 uint32_t byte = 0;
3707 TMJ_TO_UINT(buffer + i + 1, buffer + i + 3, &byte, /*base=*/16);
3708 buffer[out_index] = (unsigned char)byte;
3709 i += 2;
3710 continue;
3711 }
3712
3713 if (buffer[i] == '~') {
3714 if (buffer[i + 1] == '0') {
3715 buffer[out_index] = '~';
3716 ++i;
3717 continue;
3718 } else if (buffer[i + 1] == '1') {
3719 buffer[out_index] = '/';
3720 ++i;
3721 continue;
3722 } else {
3723 error = TM_TRUE;
3724 break;
3725 }
3726 }
3727
3728 buffer[out_index] = buffer[i];
3729 }
3730 if (error) break;
3731 } else {
3732 for (size_t i = 0; i < length; ++i, ++out_index) {
3733 if (buffer[i] == '~') {
3734 if (buffer[i + 1] == '0') {
3735 buffer[out_index] = '~';
3736 ++i;
3737 continue;
3738 } else if (buffer[i + 1] == '1') {
3739 buffer[out_index] = '/';
3740 ++i;
3741 continue;
3742 } else {
3743 error = TM_TRUE;
3744 break;
3745 }
3746 }
3747 buffer[out_index] = buffer[i];
3748 }
3749 if (error) break;
3750 }
3751 buffer[out_index] = 0;
3752
3753 JsonObject obj = jsonGetObject(&current);
3754 current = jsonGetMember(&obj, buffer);
3755 }
3756
3757 if (*next == 0) break;
3758 first = next;
3759 }
3760
3761 if (buffer != sbo) {
3762 TM_FREE(buffer);
3763 }
3764
3765 if (error) {
3766 current.type = JVAL_NULL;
3767 current.data.content.data = TM_NULL;
3768 current.data.content.size = 0;
3769 }
3770
3771 return current;
3772 }
3773
3774 #endif // TM_JSON_IMPLEMENTATION
3775
3776 /*
3777 There are two licenses you can freely choose from - MIT or Public Domain
3778 ---------------------------------------------------------------------------
3779
3780 MIT License:
3781 Copyright (c) 2016 Tolga Mizrak
3782
3783 Permission is hereby granted, free of charge, to any person obtaining a
3784 copy of this software and associated documentation files (the "Software"),
3785 to deal in the Software without restriction, including without limitation
3786 the rights to use, copy, modify, merge, publish, distribute, sublicense,
3787 and/or sell copies of the Software, and to permit persons to whom the
3788 Software is furnished to do so, subject to the following conditions:
3789
3790 The above copyright notice and this permission notice shall be included
3791 in all copies or substantial portions of the Software.
3792
3793 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
3794 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
3795 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
3796 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
3797 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
3798 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
3799 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3800
3801 ---------------------------------------------------------------------------
3802
3803 Public Domain (www.unlicense.org):
3804 This is free and unencumbered software released into the public domain.
3805
3806 Anyone is free to copy, modify, publish, use, compile, sell, or
3807 distribute this software, either in source code form or as a compiled
3808 binary, for any purpose, commercial or non-commercial, and by any
3809 means.
3810
3811 In jurisdictions that recognize copyright laws, the author or authors
3812 of this software dedicate any and all copyright interest in the
3813 software to the public domain. We make this dedication for the benefit
3814 of the public at large and to the detriment of our heirs and
3815 successors. We intend this dedication to be an overt act of
3816 relinquishment in perpetuity of all present and future rights to this
3817 software under copyright law.
3818
3819 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
3820 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
3821 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
3822 IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
3823 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
3824 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
3825 OTHER DEALINGS IN THE SOFTWARE.
3826
3827 For more information, please refer to <http://unlicense.org/>
3828
3829 ---------------------------------------------------------------------------
3830 */
File include/wolf.h added (mode: 100755) (index 0000000..8b61a58)
1 #ifndef WOLF_H
2 #define WOLF_H
3
4 #ifndef FWORLD_H
5 # error Include fworld.h before wolf.h so the world can be referenced.
6 #endif
7
8 #ifndef NE_H
9 # error Include ne.h before wolf.h so the wolves can operate.
10 #endif
11
12 #include <cmath>
13
14 #include <vector>
15
16 namespace wolf {
17
18 struct Wolf {
19 size_t entity_index;
20 int member;
21 ne_Population population;
22 };
23
24 NE_REAL DoWolfStuff(
25 Wolf* w,
26 fworld::World* world,
27 double d ){
28
29 auto &ent = world->entities[w->entity_index];
30 auto &net = w->population[w->member];
31 long long
32 x = ent.x + 0.5,
33 y = ent.y + 0.5;
34 // For type reasons.
35 const NE_REAL NH = -0.5, Z = 0.0, H = 0.5, P = 1.0, F = 4.0;
36 // Proximity values are inverted because larger values stimulate.
37 NE_REAL inputs[6] = {
38 static_cast<NE_REAL>( ent.direction ) / F,
39 -( world->tileBlocking( x, y - 1, true ) ? H : Z ) + P
40 -( world->tileBlocking( x, y - 2, true ) ? H : Z ), // North
41 -( world->tileBlocking( x, y + 1, true ) ? H : Z ) + P
42 -( world->tileBlocking( x, y + 2, true ) ? H : Z ), // South
43 -( world->tileBlocking( x - 1, y, true ) ? H : Z ) + P
44 -( world->tileBlocking( x - 2, y, true ) ? H : Z ), // West
45 -( world->tileBlocking( x + 1, y, true ) ? H : Z ) + P
46 -( world->tileBlocking( x + 2, y, true ) ? H : Z ), // East
47 NH // Extra stimulation to stabilize the network.
48 };
49
50 int old_direction = 0;
51 double speed = 0.0;
52
53 auto MoveEnt = [&](){
54 NE_REAL outputs[4];
55 ne_GetOutputs( &net, inputs, outputs );
56 double
57 moveX = std::max( Z, outputs[3] ) - std::max( Z, outputs[2] ),
58 moveY = std::max( Z, outputs[1] ) - std::max( Z, outputs[0] );
59 if( moveX > 1.2 || moveX < -1.2 ){
60 moveX = 0.0;
61 }
62 if( moveY > 1.2 || moveY < -1.2 ){
63 moveY = 0.0;
64 }
65 double
66 oldX = ent.x,
67 oldY = ent.y;
68 old_direction = ent.direction;
69 world->moveEntity( ent, moveX * 1.0, moveY * -1.0, d );
70 double
71 diffX = ent.x - oldX,
72 diffY = ent.y - oldY;
73 speed = std::sqrt( diffX * diffX + diffY * diffY ) / d;
74 };
75
76 MoveEnt();
77
78 NE_REAL bonus = ( (long long)( ent.x + 0.5 ) != x || (long long)( ent.y + 0.5 ) != y ) ? 0.75 : 0.0;
79
80 return net.fitness * 0.5 + speed * ( ent.direction == old_direction ? 1.0 : 0.1 ) + bonus;
81 }
82
83 void AI(
84 std::vector<Wolf>* wolves,
85 fworld::World* world,
86 unsigned int rand_seed,
87 double d ){
88
89 for( int i = 0; i < 2; i++ ){
90 for( auto &w : *wolves ){
91 if( w.member >= stb_sb_count( w.population ) ){
92 ne_Iterate( &w.population, rand_seed, 0.7, 0.003, 0 );
93 w.member = 0;
94 }
95 w.population[w.member].fitness = DoWolfStuff( &w, world, d * 0.5 );
96 w.member++;
97 }
98 }
99 }
100
101 std::vector<Wolf> GetWolves(
102 fworld::World* world,
103 unsigned int rand_seed ){
104
105 int topovalues[9] = { 6, 50, 25, 25, 25, 25, 25, 16, 4 };
106 int* topology = NULL;
107 topology = stb_sb_add( topology, 9 );
108 for( int i = 0; i < 9; i++ ){
109 topology[i] = topovalues[i];
110 };
111
112 std::vector<Wolf> wolves;
113 for( size_t i = 0; i < world->entities.size(); i++ ){
114 auto &ent = world->entities[i];
115 if( ent.type == "wolf" ){
116 Wolf w = {};
117 w.entity_index = i;
118 w.member = 0;
119 w.population = ne_RandomNetworks( topology, 20, rand_seed );
120 wolves.push_back( w );
121 }
122 }
123
124 stb_sb_free( topology );
125
126 return wolves;
127 }
128
129 } // namespace wolf
130
131 #endif // WOLF_H
File libs.cpp added (mode: 100755) (index 0000000..dd7c0bd)
1 #ifndef __EMSCRIPTEN__
2 // https://www.boost.org/doc/libs/1_74_0/doc/html/boost_asio/using.html#boost_asio.using.optional_separate_compilation
3 #define BOOST_ASIO_SEPARATE_COMPILATION
4 #define BOOST_BEAST_SEPARATE_COMPILATION
5 #include <boost/asio/impl/src.hpp>
6 #include <boost/asio/ssl/impl/src.hpp>
7 #include <boost/beast/src.hpp>
8 #endif
9
10 #define STB_IMAGE_IMPLEMENTATION
11 #include <stb_image.h>
12
13 #define STB_TRUETYPE_IMPLEMENTATION
14 #include <stb_truetype.h>
15
16 #define STB_VORBIS_IMPLEMENTATION
17 #include <stb_vorbis.c>
18
19 #ifdef __EMSCRIPTEN__
20 #define CUTE_SOUND_SCALAR_MODE
21 #endif
22 //#ifndef _WIN32 // DirectSound mode causes builds to fail???
23 #define CUTE_SOUND_FORCE_SDL
24 //#endif
25 #define CUTE_SOUND_IMPLEMENTATION
26 #include <cute_sound.h>
27
28 //#define NE_IMPLEMENTATION
29 //#include <ne.h>
30
31 #define PROC_IMPLEMENTATION
32 #include <proc.h>
33
34 // Needed for proper JSON parsing.
35 #define TM_INFINITY ( 1.0 / 0.0 )
36 #define TM_NAN 0.0
37 #define TM_JSON_IMPLEMENTATION
38 #include <tm_json.h>
39
40 #define INI_IMPLEMENTATION
41 #include <ini.h>
42
43 #include "micropather.cpp"
File micropather.cpp added (mode: 100755) (index 0000000..8350a63)
1 /*
2 Copyright (c) 2000-2009 Lee Thomason (www.grinninglizard.com)
3
4 Grinning Lizard Utilities.
5
6 This software is provided 'as-is', without any express or implied
7 warranty. In no event will the authors be held liable for any
8 damages arising from the use of this software.
9
10 Permission is granted to anyone to use this software for any
11 purpose, including commercial applications, and to alter it and
12 redistribute it freely, subject to the following restrictions:
13
14 1. The origin of this software must not be misrepresented; you must
15 not claim that you wrote the original software. If you use this
16 software in a product, an acknowledgment in the product documentation
17 would be appreciated but is not required.
18
19 2. Altered source versions must be plainly marked as such, and
20 must not be misrepresented as being the original software.
21
22 3. This notice may not be removed or altered from any source
23 distribution.
24 */
25
26 // This source code had been altered from its original form,
27 // to make it compile under MinGW-w64-posix. (near renamed _near)
28
29 #ifdef _MSC_VER
30 #pragma warning( disable : 4786 ) // Debugger truncating names.
31 #pragma warning( disable : 4530 ) // Exception handler isn't used
32 #endif
33
34 #include <memory.h>
35 #include <stdio.h>
36
37 //#define DEBUG_PATH
38 //#define DEBUG_PATH_DEEP
39 //#define TRACK_COLLISION
40 //#define DEBUG_CACHING
41
42 #ifdef DEBUG_CACHING
43 #include "../grinliz/gldebug.h"
44 #endif
45
46 #include "micropather.h"
47
48 using namespace micropather;
49
50 class OpenQueue
51 {
52 public:
53 OpenQueue( Graph* _graph )
54 {
55 graph = _graph;
56 sentinel = (PathNode*) sentinelMem;
57 sentinel->InitSentinel();
58 #ifdef DEBUG
59 sentinel->CheckList();
60 #endif
61 }
62 ~OpenQueue() {}
63
64 void Push( PathNode* pNode );
65 PathNode* Pop();
66 void Update( PathNode* pNode );
67
68 bool Empty() { return sentinel->next == sentinel; }
69
70 private:
71 OpenQueue( const OpenQueue& ); // undefined and unsupported
72 void operator=( const OpenQueue& );
73
74 PathNode* sentinel;
75 int sentinelMem[ ( sizeof( PathNode ) + sizeof( int ) ) / sizeof( int ) ];
76 Graph* graph; // for debugging
77 };
78
79
80 void OpenQueue::Push( PathNode* pNode )
81 {
82
83 MPASSERT( pNode->inOpen == 0 );
84 MPASSERT( pNode->inClosed == 0 );
85
86 #ifdef DEBUG_PATH_DEEP
87 printf( "Open Push: " );
88 graph->PrintStateInfo( pNode->state );
89 printf( " total=%.1f\n", pNode->totalCost );
90 #endif
91
92 // Add sorted. Lowest to highest cost path. Note that the sentinel has
93 // a value of FLT_MAX, so it should always be sorted in.
94 MPASSERT( pNode->totalCost < FLT_MAX );
95 PathNode* iter = sentinel->next;
96 while ( true )
97 {
98 if ( pNode->totalCost < iter->totalCost ) {
99 iter->AddBefore( pNode );
100 pNode->inOpen = 1;
101 break;
102 }
103 iter = iter->next;
104 }
105 MPASSERT( pNode->inOpen ); // make sure this was actually added.
106 #ifdef DEBUG
107 sentinel->CheckList();
108 #endif
109 }
110
111 PathNode* OpenQueue::Pop()
112 {
113 MPASSERT( sentinel->next != sentinel );
114 PathNode* pNode = sentinel->next;
115 pNode->Unlink();
116 #ifdef DEBUG
117 sentinel->CheckList();
118 #endif
119
120 MPASSERT( pNode->inClosed == 0 );
121 MPASSERT( pNode->inOpen == 1 );
122 pNode->inOpen = 0;
123
124 #ifdef DEBUG_PATH_DEEP
125 printf( "Open Pop: " );
126 graph->PrintStateInfo( pNode->state );
127 printf( " total=%.1f\n", pNode->totalCost );
128 #endif
129
130 return pNode;
131 }
132
133 void OpenQueue::Update( PathNode* pNode )
134 {
135 #ifdef DEBUG_PATH_DEEP
136 printf( "Open Update: " );
137 graph->PrintStateInfo( pNode->state );
138 printf( " total=%.1f\n", pNode->totalCost );
139 #endif
140
141 MPASSERT( pNode->inOpen );
142
143 // If the node now cost less than the one before it,
144 // move it to the front of the list.
145 if ( pNode->prev != sentinel && pNode->totalCost < pNode->prev->totalCost ) {
146 pNode->Unlink();
147 sentinel->next->AddBefore( pNode );
148 }
149
150 // If the node is too high, move to the right.
151 if ( pNode->totalCost > pNode->next->totalCost ) {
152 PathNode* it = pNode->next;
153 pNode->Unlink();
154
155 while ( pNode->totalCost > it->totalCost )
156 it = it->next;
157
158 it->AddBefore( pNode );
159 #ifdef DEBUG
160 sentinel->CheckList();
161 #endif
162 }
163 }
164
165
166 class ClosedSet
167 {
168 public:
169 ClosedSet( Graph* _graph ) { this->graph = _graph; }
170 ~ClosedSet() {}
171
172 void Add( PathNode* pNode )
173 {
174 #ifdef DEBUG_PATH_DEEP
175 printf( "Closed add: " );
176 graph->PrintStateInfo( pNode->state );
177 printf( " total=%.1f\n", pNode->totalCost );
178 #endif
179 #ifdef DEBUG
180 MPASSERT( pNode->inClosed == 0 );
181 MPASSERT( pNode->inOpen == 0 );
182 #endif
183 pNode->inClosed = 1;
184 }
185
186 void Remove( PathNode* pNode )
187 {
188 #ifdef DEBUG_PATH_DEEP
189 printf( "Closed remove: " );
190 graph->PrintStateInfo( pNode->state );
191 printf( " total=%.1f\n", pNode->totalCost );
192 #endif
193 MPASSERT( pNode->inClosed == 1 );
194 MPASSERT( pNode->inOpen == 0 );
195
196 pNode->inClosed = 0;
197 }
198
199 private:
200 ClosedSet( const ClosedSet& );
201 void operator=( const ClosedSet& );
202 Graph* graph;
203 };
204
205
206 PathNodePool::PathNodePool( unsigned _allocate, unsigned _typicalAdjacent )
207 : firstBlock( 0 ),
208 blocks( 0 ),
209 #if defined( MICROPATHER_STRESS )
210 allocate( 32 ),
211 #else
212 allocate( _allocate ),
213 #endif
214 nAllocated( 0 ),
215 nAvailable( 0 )
216 {
217 freeMemSentinel.InitSentinel();
218
219 cacheCap = allocate * _typicalAdjacent;
220 cacheSize = 0;
221 cache = (NodeCost*)malloc(cacheCap * sizeof(NodeCost));
222
223 // Want the behavior that if the actual number of states is specified, the cache
224 // will be at least that big.
225 hashShift = 3; // 8 (only useful for stress testing)
226 #if !defined( MICROPATHER_STRESS )
227 while( HashSize() < allocate )
228 ++hashShift;
229 #endif
230 hashTable = (PathNode**)calloc( HashSize(), sizeof(PathNode*) );
231
232 blocks = firstBlock = NewBlock();
233 // printf( "HashSize=%d allocate=%d\n", HashSize(), allocate );
234 totalCollide = 0;
235 }
236
237
238 PathNodePool::~PathNodePool()
239 {
240 Clear();
241 free( firstBlock );
242 free( cache );
243 free( hashTable );
244 #ifdef TRACK_COLLISION
245 printf( "Total collide=%d HashSize=%d HashShift=%d\n", totalCollide, HashSize(), hashShift );
246 #endif
247 }
248
249
250 bool PathNodePool::PushCache( const NodeCost* nodes, int nNodes, int* start ) {
251 *start = -1;
252 if ( nNodes+cacheSize <= cacheCap ) {
253 for( int i=0; i<nNodes; ++i ) {
254 cache[i+cacheSize] = nodes[i];
255 }
256 *start = cacheSize;
257 cacheSize += nNodes;
258 return true;
259 }
260 return false;
261 }
262
263
264 void PathNodePool::GetCache( int start, int nNodes, NodeCost* nodes ) {
265 MPASSERT( start >= 0 && start < cacheCap );
266 MPASSERT( nNodes > 0 );
267 MPASSERT( start + nNodes <= cacheCap );
268 memcpy( nodes, &cache[start], sizeof(NodeCost)*nNodes );
269 }
270
271
272 void PathNodePool::Clear()
273 {
274 #ifdef TRACK_COLLISION
275 // Collision tracking code.
276 int collide=0;
277 for( unsigned i=0; i<HashSize(); ++i ) {
278 if ( hashTable[i] && (hashTable[i]->child[0] || hashTable[i]->child[1]) )
279 ++collide;
280 }
281 //printf( "PathNodePool %d/%d collision=%d %.1f%%\n", nAllocated, HashSize(), collide, 100.0f*(float)collide/(float)HashSize() );
282 totalCollide += collide;
283 #endif
284
285 Block* b = blocks;
286 while( b ) {
287 Block* temp = b->nextBlock;
288 if ( b != firstBlock ) {
289 free( b );
290 }
291 b = temp;
292 }
293 blocks = firstBlock; // Don't delete the first block (we always need at least that much memory.)
294
295 // Set up for new allocations (but don't do work we don't need to. Reset/Clear can be called frequently.)
296 if ( nAllocated > 0 ) {
297 freeMemSentinel.next = &freeMemSentinel;
298 freeMemSentinel.prev = &freeMemSentinel;
299
300 memset( hashTable, 0, sizeof(PathNode*)*HashSize() );
301 for( unsigned i=0; i<allocate; ++i ) {
302 freeMemSentinel.AddBefore( &firstBlock->pathNode[i] );
303 }
304 }
305 nAvailable = allocate;
306 nAllocated = 0;
307 cacheSize = 0;
308 }
309
310
311 PathNodePool::Block* PathNodePool::NewBlock()
312 {
313 Block* block = (Block*) calloc( 1, sizeof(Block) + sizeof(PathNode)*(allocate-1) );
314 block->nextBlock = 0;
315
316 nAvailable += allocate;
317 for( unsigned i=0; i<allocate; ++i ) {
318 freeMemSentinel.AddBefore( &block->pathNode[i] );
319 }
320 return block;
321 }
322
323
324 unsigned PathNodePool::Hash( void* voidval )
325 {
326 /*
327 Spent quite some time on this, and the result isn't quite satifactory. The
328 input set is the size of a void*, and is generally (x,y) pairs or memory pointers.
329
330 FNV resulting in about 45k collisions in a (large) test and some other approaches
331 about the same.
332
333 Simple folding reduces collisions to about 38k - big improvement. However, that may
334 be an artifact of the (x,y) pairs being well distributed. And for either the x,y case
335 or the pointer case, there are probably very poor hash table sizes that cause "overlaps"
336 and grouping. (An x,y encoding with a hashShift of 8 is begging for trouble.)
337
338 The best tested results are simple folding, but that seems to beg for a pathelogical case.
339 FNV-1a was the next best choice, without obvious pathelogical holes.
340
341 Finally settled on h%HashMask(). Simple, but doesn't have the obvious collision cases of folding.
342 */
343 /*
344 // Time: 567
345 // FNV-1a
346 // http://isthe.com/chongo/tech/comp/fnv/
347 // public domain.
348 MP_UPTR val = (MP_UPTR)(voidval);
349 const unsigned char *p = (unsigned char *)(&val);
350 unsigned int h = 2166136261;
351
352 for( size_t i=0; i<sizeof(MP_UPTR); ++i, ++p ) {
353 h ^= *p;
354 h *= 16777619;
355 }
356 // Fold the high bits to the low bits. Doesn't (generally) use all
357 // the bits since the shift is usually < 16, but better than not
358 // using the high bits at all.
359 return ( h ^ (h>>hashShift) ^ (h>>(hashShift*2)) ^ (h>>(hashShift*3)) ) & HashMask();
360 */
361 /*
362 // Time: 526
363 MP_UPTR h = (MP_UPTR)(voidval);
364 return ( h ^ (h>>hashShift) ^ (h>>(hashShift*2)) ^ (h>>(hashShift*3)) ) & HashMask();
365 */
366
367 // Time: 512
368 // The HashMask() is used as the divisor. h%1024 has lots of common
369 // repetitions, but h%1023 will move things out more.
370 MP_UPTR h = (MP_UPTR)(voidval);
371 return h % HashMask();
372 }
373
374
375
376 PathNode* PathNodePool::Alloc()
377 {
378 if ( freeMemSentinel.next == &freeMemSentinel ) {
379 MPASSERT( nAvailable == 0 );
380
381 Block* b = NewBlock();
382 b->nextBlock = blocks;
383 blocks = b;
384 MPASSERT( freeMemSentinel.next != &freeMemSentinel );
385 }
386 PathNode* pathNode = freeMemSentinel.next;
387 pathNode->Unlink();
388
389 ++nAllocated;
390 MPASSERT( nAvailable > 0 );
391 --nAvailable;
392 return pathNode;
393 }
394
395
396 void PathNodePool::AddPathNode( unsigned key, PathNode* root )
397 {
398 if ( hashTable[key] ) {
399 PathNode* p = hashTable[key];
400 while( true ) {
401 int dir = (root->state < p->state) ? 0 : 1;
402 if ( p->child[dir] ) {
403 p = p->child[dir];
404 }
405 else {
406 p->child[dir] = root;
407 break;
408 }
409 }
410 }
411 else {
412 hashTable[key] = root;
413 }
414 }
415
416
417 PathNode* PathNodePool::FetchPathNode( void* state )
418 {
419 unsigned key = Hash( state );
420
421 PathNode* root = hashTable[key];
422 while( root ) {
423 if ( root->state == state ) {
424 break;
425 }
426 root = ( state < root->state ) ? root->child[0] : root->child[1];
427 }
428 MPASSERT( root );
429 return root;
430 }
431
432
433 PathNode* PathNodePool::GetPathNode( unsigned frame, void* _state, float _costFromStart, float _estToGoal, PathNode* _parent )
434 {
435 unsigned key = Hash( _state );
436
437 PathNode* root = hashTable[key];
438 while( root ) {
439 if ( root->state == _state ) {
440 if ( root->frame == frame ) // This is the correct state and correct frame.
441 break;
442 // Correct state, wrong frame.
443 root->Init( frame, _state, _costFromStart, _estToGoal, _parent );
444 break;
445 }
446 root = ( _state < root->state ) ? root->child[0] : root->child[1];
447 }
448 if ( !root ) {
449 // allocate new one
450 root = Alloc();
451 root->Clear();
452 root->Init( frame, _state, _costFromStart, _estToGoal, _parent );
453 AddPathNode( key, root );
454 }
455 return root;
456 }
457
458
459 void PathNode::Init( unsigned _frame,
460 void* _state,
461 float _costFromStart,
462 float _estToGoal,
463 PathNode* _parent )
464 {
465 state = _state;
466 costFromStart = _costFromStart;
467 estToGoal = _estToGoal;
468 CalcTotalCost();
469 parent = _parent;
470 frame = _frame;
471 inOpen = 0;
472 inClosed = 0;
473 }
474
475
476 void PathNode::Clear()
477 {
478 memset( this, 0, sizeof( PathNode ) );
479 numAdjacent = -1;
480 cacheIndex = -1;
481 }
482
483 MicroPather::MicroPather( Graph* _graph, unsigned allocate, unsigned typicalAdjacent, bool cache )
484 : pathNodePool( allocate, typicalAdjacent ),
485 graph( _graph ),
486 frame( 0 )
487 {
488 MPASSERT( allocate );
489 MPASSERT( typicalAdjacent );
490 pathCache = 0;
491 if ( cache ) {
492 pathCache = new PathCache( allocate*4 ); // untuned arbitrary constant
493 }
494 }
495
496
497 MicroPather::~MicroPather()
498 {
499 delete pathCache;
500 }
501
502
503 void MicroPather::Reset()
504 {
505 pathNodePool.Clear();
506 if ( pathCache ) {
507 pathCache->Reset();
508 }
509 frame = 0;
510 }
511
512
513 void MicroPather::GoalReached( PathNode* node, void* start, void* end, MP_VECTOR< void* > *_path )
514 {
515 MP_VECTOR< void* >& path = *_path;
516 path.clear();
517
518 // We have reached the goal.
519 // How long is the path? Used to allocate the vector which is returned.
520 int count = 1;
521 PathNode* it = node;
522 while( it->parent )
523 {
524 ++count;
525 it = it->parent;
526 }
527
528 // Now that the path has a known length, allocate
529 // and fill the vector that will be returned.
530 if ( count < 3 )
531 {
532 // Handle the short, special case.
533 path.resize(2);
534 path[0] = start;
535 path[1] = end;
536 }
537 else
538 {
539 path.resize(count);
540
541 path[0] = start;
542 path[count-1] = end;
543 count-=2;
544 it = node->parent;
545
546 while ( it->parent )
547 {
548 path[count] = it->state;
549 it = it->parent;
550 --count;
551 }
552 }
553
554 if ( pathCache ) {
555 costVec.clear();
556
557 PathNode* pn0 = pathNodePool.FetchPathNode( path[0] );
558 PathNode* pn1 = 0;
559 for( unsigned i=0; i<path.size()-1; ++i ) {
560 pn1 = pathNodePool.FetchPathNode( path[i+1] );
561 nodeCostVec.clear();
562 GetNodeNeighbors( pn0, &nodeCostVec );
563 for( unsigned j=0; j<nodeCostVec.size(); ++j ) {
564 if ( nodeCostVec[j].node == pn1 ) {
565 costVec.push_back( nodeCostVec[j].cost );
566 break;
567 }
568 }
569 MPASSERT( costVec.size() == i+1 );
570 pn0 = pn1;
571 }
572 pathCache->Add( path, costVec );
573 }
574
575 #ifdef DEBUG_PATH
576 printf( "Path: " );
577 int counter=0;
578 #endif
579 for ( unsigned k=0; k<path.size(); ++k )
580 {
581 #ifdef DEBUG_PATH
582 graph->PrintStateInfo( path[k] );
583 printf( " " );
584 ++counter;
585 if ( counter == 8 )
586 {
587 printf( "\n" );
588 counter = 0;
589 }
590 #endif
591 }
592 #ifdef DEBUG_PATH
593 printf( "Cost=%.1f Checksum %d\n", node->costFromStart, checksum );
594 #endif
595 }
596
597
598 void MicroPather::GetNodeNeighbors( PathNode* node, MP_VECTOR< NodeCost >* pNodeCost )
599 {
600 if ( node->numAdjacent == 0 ) {
601 // it has no neighbors.
602 pNodeCost->resize( 0 );
603 }
604 else if ( node->cacheIndex < 0 )
605 {
606 // Not in the cache. Either the first time or just didn't fit. We don't know
607 // the number of neighbors and need to call back to the client.
608 stateCostVec.resize( 0 );
609 graph->AdjacentCost( node->state, &stateCostVec );
610
611 #ifdef DEBUG
612 {
613 // If this assert fires, you have passed a state
614 // as its own neighbor state. This is impossible --
615 // bad things will happen.
616 for ( unsigned i=0; i<stateCostVec.size(); ++i )
617 MPASSERT( stateCostVec[i].state != node->state );
618 }
619 #endif
620
621 pNodeCost->resize( stateCostVec.size() );
622 node->numAdjacent = stateCostVec.size();
623
624 if ( node->numAdjacent > 0 ) {
625 // Now convert to pathNodes.
626 // Note that the microsoft std library is actually pretty slow.
627 // Move things to temp vars to help.
628 const unsigned stateCostVecSize = stateCostVec.size();
629 const StateCost* stateCostVecPtr = &stateCostVec[0];
630 NodeCost* pNodeCostPtr = &(*pNodeCost)[0];
631
632 for( unsigned i=0; i<stateCostVecSize; ++i ) {
633 void* state = stateCostVecPtr[i].state;
634 pNodeCostPtr[i].cost = stateCostVecPtr[i].cost;
635 pNodeCostPtr[i].node = pathNodePool.GetPathNode( frame, state, FLT_MAX, FLT_MAX, 0 );
636 }
637
638 // Can this be cached?
639 int start = 0;
640 if ( pNodeCost->size() > 0 && pathNodePool.PushCache( pNodeCostPtr, pNodeCost->size(), &start ) ) {
641 node->cacheIndex = start;
642 }
643 }
644 }
645 else {
646 // In the cache!
647 pNodeCost->resize( node->numAdjacent );
648 NodeCost* pNodeCostPtr = &(*pNodeCost)[0];
649 pathNodePool.GetCache( node->cacheIndex, node->numAdjacent, pNodeCostPtr );
650
651 // A node is uninitialized (even if memory is allocated) if it is from a previous frame.
652 // Check for that, and Init() as necessary.
653 for( int i=0; i<node->numAdjacent; ++i ) {
654 PathNode* pNode = pNodeCostPtr[i].node;
655 if ( pNode->frame != frame ) {
656 pNode->Init( frame, pNode->state, FLT_MAX, FLT_MAX, 0 );
657 }
658 }
659 }
660 }
661
662
663 #ifdef DEBUG
664 /*
665 void MicroPather::DumpStats()
666 {
667 int hashTableEntries = 0;
668 for( int i=0; i<HASH_SIZE; ++i )
669 if ( hashTable[i] )
670 ++hashTableEntries;
671
672 int pathNodeBlocks = 0;
673 for( PathNode* node = pathNodeMem; node; node = node[ALLOCATE-1].left )
674 ++pathNodeBlocks;
675 printf( "HashTableEntries=%d/%d PathNodeBlocks=%d [%dk] PathNodes=%d SolverCalled=%d\n",
676 hashTableEntries, HASH_SIZE, pathNodeBlocks,
677 pathNodeBlocks*ALLOCATE*sizeof(PathNode)/1024,
678 pathNodeCount,
679 frame );
680 }
681 */
682 #endif
683
684
685 void MicroPather::StatesInPool( MP_VECTOR< void* >* stateVec )
686 {
687 stateVec->clear();
688 pathNodePool.AllStates( frame, stateVec );
689 }
690
691
692 void PathNodePool::AllStates( unsigned frame, MP_VECTOR< void* >* stateVec )
693 {
694 for ( Block* b=blocks; b; b=b->nextBlock )
695 {
696 for( unsigned i=0; i<allocate; ++i )
697 {
698 if ( b->pathNode[i].frame == frame )
699 stateVec->push_back( b->pathNode[i].state );
700 }
701 }
702 }
703
704
705 PathCache::PathCache( int _allocated )
706 {
707 mem = new Item[_allocated];
708 memset( mem, 0, sizeof(*mem)*_allocated );
709 allocated = _allocated;
710 nItems = 0;
711 hit = 0;
712 miss = 0;
713 }
714
715
716 PathCache::~PathCache()
717 {
718 delete [] mem;
719 }
720
721
722 void PathCache::Reset()
723 {
724 if ( nItems ) {
725 memset( mem, 0, sizeof(*mem)*allocated );
726 nItems = 0;
727 hit = 0;
728 miss = 0;
729 }
730 }
731
732
733 void PathCache::Add( const MP_VECTOR< void* >& path, const MP_VECTOR< float >& cost )
734 {
735 if ( nItems + (int)path.size() > allocated*3/4 ) {
736 return;
737 }
738
739 for( unsigned i=0; i<path.size()-1; ++i ) {
740 // example: a->b->c->d
741 // Huge memory saving to only store 3 paths to 'd'
742 // Can put more in cache with also adding path to b, c, & d
743 // But uses much more memory. Experiment with this commented
744 // in and out and how to set.
745
746 void* end = path[path.size()-1];
747 Item item = { path[i], end, path[i+1], cost[i] };
748 AddItem( item );
749 }
750 }
751
752
753 void PathCache::AddNoSolution( void* end, void* states[], int count )
754 {
755 if ( count + nItems > allocated*3/4 ) {
756 return;
757 }
758
759 for( int i=0; i<count; ++i ) {
760 Item item = { states[i], end, 0, FLT_MAX };
761 AddItem( item );
762 }
763 }
764
765
766 int PathCache::Solve( void* start, void* end, MP_VECTOR< void* >* path, float* totalCost )
767 {
768 const Item* item = Find( start, end );
769 if ( item ) {
770 if ( item->cost == FLT_MAX ) {
771 ++hit;
772 return MicroPather::NO_SOLUTION;
773 }
774
775 path->clear();
776 path->push_back( start );
777 *totalCost = 0;
778
779 for ( ;start != end; start=item->next, item=Find(start, end) ) {
780 MPASSERT( item );
781 *totalCost += item->cost;
782 path->push_back( item->next );
783 }
784 ++hit;
785 return MicroPather::SOLVED;
786 }
787 ++miss;
788 return MicroPather::NOT_CACHED;
789 }
790
791
792 void PathCache::AddItem( const Item& item )
793 {
794 MPASSERT( allocated );
795 unsigned index = item.Hash() % allocated;
796 while( true ) {
797 if ( mem[index].Empty() ) {
798 mem[index] = item;
799 ++nItems;
800 #ifdef DEBUG_CACHING
801 GLOUTPUT(( "Add: start=%x next=%x end=%x\n", item.start, item.next, item.end ));
802 #endif
803 break;
804 }
805 else if ( mem[index].KeyEqual( item ) ) {
806 MPASSERT( (mem[index].next && item.next) || (mem[index].next==0 && item.next == 0) );
807 // do nothing; in cache
808 break;
809 }
810 ++index;
811 if ( index == allocated )
812 index = 0;
813 }
814 }
815
816
817 const PathCache::Item* PathCache::Find( void* start, void* end )
818 {
819 MPASSERT( allocated );
820 Item fake = { start, end, 0, 0 };
821 unsigned index = fake.Hash() % allocated;
822 while( true ) {
823 if ( mem[index].Empty() ) {
824 return 0;
825 }
826 if ( mem[index].KeyEqual( fake )) {
827 return mem + index;
828 }
829 ++index;
830 if ( index == allocated )
831 index = 0;
832 }
833 }
834
835
836 void MicroPather::GetCacheData( CacheData* data )
837 {
838 memset( data, 0, sizeof(*data) );
839
840 if ( pathCache ) {
841 data->nBytesAllocated = pathCache->AllocatedBytes();
842 data->nBytesUsed = pathCache->UsedBytes();
843 data->memoryFraction = (float)( (double)data->nBytesUsed / (double)data->nBytesAllocated );
844
845 data->hit = pathCache->hit;
846 data->miss = pathCache->miss;
847 if ( data->hit + data->miss ) {
848 data->hitFraction = (float)( (double)(data->hit) / (double)(data->hit + data->miss) );
849 }
850 else {
851 data->hitFraction = 0;
852 }
853 }
854 }
855
856
857
858 int MicroPather::Solve( void* startNode, void* endNode, MP_VECTOR< void* >* path, float* cost )
859 {
860 // Important to clear() in case the caller doesn't check the return code. There
861 // can easily be a left over path from a previous call.
862 path->clear();
863
864 #ifdef DEBUG_PATH
865 printf( "Path: " );
866 graph->PrintStateInfo( startNode );
867 printf( " --> " );
868 graph->PrintStateInfo( endNode );
869 printf( " min cost=%f\n", graph->LeastCostEstimate( startNode, endNode ) );
870 #endif
871
872 *cost = 0.0f;
873
874 if ( startNode == endNode )
875 return START_END_SAME;
876
877 if ( pathCache ) {
878 int cacheResult = pathCache->Solve( startNode, endNode, path, cost );
879 if ( cacheResult == SOLVED || cacheResult == NO_SOLUTION ) {
880 #ifdef DEBUG_CACHING
881 GLOUTPUT(( "PathCache hit. result=%s\n", cacheResult == SOLVED ? "solved" : "no_solution" ));
882 #endif
883 return cacheResult;
884 }
885 #ifdef DEBUG_CACHING
886 GLOUTPUT(( "PathCache miss\n" ));
887 #endif
888 }
889
890 ++frame;
891
892 OpenQueue open( graph );
893 ClosedSet closed( graph );
894
895 PathNode* newPathNode = pathNodePool.GetPathNode( frame,
896 startNode,
897 0,
898 graph->LeastCostEstimate( startNode, endNode ),
899 0 );
900
901 open.Push( newPathNode );
902 stateCostVec.resize(0);
903 nodeCostVec.resize(0);
904
905 while ( !open.Empty() )
906 {
907 PathNode* node = open.Pop();
908
909 if ( node->state == endNode )
910 {
911 GoalReached( node, startNode, endNode, path );
912 *cost = node->costFromStart;
913 #ifdef DEBUG_PATH
914 DumpStats();
915 #endif
916 return SOLVED;
917 }
918 else
919 {
920 closed.Add( node );
921
922 // We have not reached the goal - add the neighbors.
923 GetNodeNeighbors( node, &nodeCostVec );
924
925 for( int i=0; i<node->numAdjacent; ++i )
926 {
927 // Not actually a neighbor, but useful. Filter out infinite cost.
928 if ( nodeCostVec[i].cost == FLT_MAX ) {
929 continue;
930 }
931 PathNode* child = nodeCostVec[i].node;
932 float newCost = node->costFromStart + nodeCostVec[i].cost;
933
934 PathNode* inOpen = child->inOpen ? child : 0;
935 PathNode* inClosed = child->inClosed ? child : 0;
936 PathNode* inEither = (PathNode*)( ((MP_UPTR)inOpen) | ((MP_UPTR)inClosed) );
937
938 MPASSERT( inEither != node );
939 MPASSERT( !( inOpen && inClosed ) );
940
941 if ( inEither ) {
942 if ( newCost < child->costFromStart ) {
943 child->parent = node;
944 child->costFromStart = newCost;
945 child->estToGoal = graph->LeastCostEstimate( child->state, endNode );
946 child->CalcTotalCost();
947 if ( inOpen ) {
948 open.Update( child );
949 }
950 }
951 }
952 else {
953 child->parent = node;
954 child->costFromStart = newCost;
955 child->estToGoal = graph->LeastCostEstimate( child->state, endNode ),
956 child->CalcTotalCost();
957
958 MPASSERT( !child->inOpen && !child->inClosed );
959 open.Push( child );
960 }
961 }
962 }
963 }
964 #ifdef DEBUG_PATH
965 DumpStats();
966 #endif
967 if ( pathCache ) {
968 // Could add a bunch more with a little tracking.
969 pathCache->AddNoSolution( endNode, &startNode, 1 );
970 }
971 return NO_SOLUTION;
972 }
973
974
975 int MicroPather::SolveForNearStates( void* startState, MP_VECTOR< StateCost >* _near, float maxCost )
976 {
977 /* http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm
978
979 1 function Dijkstra(Graph, source):
980 2 for each vertex v in Graph: // Initializations
981 3 dist[v] := infinity // Unknown distance function from source to v
982 4 previous[v] := undefined // Previous node in optimal path from source
983 5 dist[source] := 0 // Distance from source to source
984 6 Q := the set of all nodes in Graph
985 // All nodes in the graph are unoptimized - thus are in Q
986 7 while Q is not empty: // The main loop
987 8 u := vertex in Q with smallest dist[]
988 9 if dist[u] = infinity:
989 10 break // all remaining vertices are inaccessible from source
990 11 remove u from Q
991 12 for each neighbor v of u: // where v has not yet been removed from Q.
992 13 alt := dist[u] + dist_between(u, v)
993 14 if alt < dist[v]: // Relax (u,v,a)
994 15 dist[v] := alt
995 16 previous[v] := u
996 17 return dist[]
997 */
998
999 ++frame;
1000
1001 OpenQueue open( graph ); // nodes to look at
1002 ClosedSet closed( graph );
1003
1004 nodeCostVec.resize(0);
1005 stateCostVec.resize(0);
1006
1007 PathNode closedSentinel;
1008 closedSentinel.Clear();
1009 closedSentinel.Init( frame, 0, FLT_MAX, FLT_MAX, 0 );
1010 closedSentinel.next = closedSentinel.prev = &closedSentinel;
1011
1012 PathNode* newPathNode = pathNodePool.GetPathNode( frame, startState, 0, 0, 0 );
1013 open.Push( newPathNode );
1014
1015 while ( !open.Empty() )
1016 {
1017 PathNode* node = open.Pop(); // smallest dist
1018 closed.Add( node ); // add to the things we've looked at
1019 closedSentinel.AddBefore( node );
1020
1021 if ( node->totalCost > maxCost )
1022 continue; // Too far away to ever get here.
1023
1024 GetNodeNeighbors( node, &nodeCostVec );
1025
1026 for( int i=0; i<node->numAdjacent; ++i )
1027 {
1028 MPASSERT( node->costFromStart < FLT_MAX );
1029 float newCost = node->costFromStart + nodeCostVec[i].cost;
1030
1031 PathNode* inOpen = nodeCostVec[i].node->inOpen ? nodeCostVec[i].node : 0;
1032 PathNode* inClosed = nodeCostVec[i].node->inClosed ? nodeCostVec[i].node : 0;
1033 MPASSERT( !( inOpen && inClosed ) );
1034 PathNode* inEither = inOpen ? inOpen : inClosed;
1035 MPASSERT( inEither != node );
1036
1037 if ( inEither && inEither->costFromStart <= newCost ) {
1038 continue; // Do nothing. This path is not better than existing.
1039 }
1040 // Groovy. We have new information or improved information.
1041 PathNode* child = nodeCostVec[i].node;
1042 MPASSERT( child->state != newPathNode->state ); // should never re-process the parent.
1043
1044 child->parent = node;
1045 child->costFromStart = newCost;
1046 child->estToGoal = 0;
1047 child->totalCost = child->costFromStart;
1048
1049 if ( inOpen ) {
1050 open.Update( inOpen );
1051 }
1052 else if ( !inClosed ) {
1053 open.Push( child );
1054 }
1055 }
1056 }
1057 _near->clear();
1058
1059 for( PathNode* pNode=closedSentinel.next; pNode != &closedSentinel; pNode=pNode->next ) {
1060 if ( pNode->totalCost <= maxCost ) {
1061 StateCost sc;
1062 sc.cost = pNode->totalCost;
1063 sc.state = pNode->state;
1064
1065 _near->push_back( sc );
1066 }
1067 }
1068 #ifdef DEBUG
1069 for( unsigned i=0; i<_near->size(); ++i ) {
1070 for( unsigned k=i+1; k<_near->size(); ++k ) {
1071 MPASSERT( (*_near)[i].state != (*_near)[k].state );
1072 }
1073 }
1074 #endif
1075
1076 return SOLVED;
1077 }
1078
1079
1080
1081
File openjdk.pem added (mode: 100644) (index 0000000..e3a3425)
1 -----BEGIN CERTIFICATE-----
2 MIICjzCCAhWgAwIBAgIQXIuZxVqUxdJxVt7NiYDMJjAKBggqhkjOPQQDAzCBiDEL
3 MAkGA1UEBhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNl
4 eSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMT
5 JVVTRVJUcnVzdCBFQ0MgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTAwMjAx
6 MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBiDELMAkGA1UEBhMCVVMxEzARBgNVBAgT
7 Ck5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQKExVUaGUg
8 VVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBFQ0MgQ2VydGlm
9 aWNhdGlvbiBBdXRob3JpdHkwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQarFRaqflo
10 I+d61SRvU8Za2EurxtW20eZzca7dnNYMYf3boIkDuAUU7FfO7l0/4iGzzvfUinng
11 o4N+LZfQYcTxmdwlkWOrfzCjtHDix6EznPO/LlxTsV+zfTJ/ijTjeXmjQjBAMB0G
12 A1UdDgQWBBQ64QmG1M8ZwpZ2dEl23OA1xmNjmjAOBgNVHQ8BAf8EBAMCAQYwDwYD
13 VR0TAQH/BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjA2Z6EWCNzklwBBHU6+4WMB
14 zzuqQhFkoJ2UOQIReVx7Hfpkue4WQrO/isIJxOzksU0CMQDpKmFHjFJKS04YcPbW
15 RNZu9YO6bVi9JNlWSOrvxKJGgYhqOkbRqZtNyWHa0V1Xahg=
16 -----END CERTIFICATE-----
17
18 -----BEGIN CERTIFICATE-----
19 MIID3TCCAsWgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBjzELMAkGA1UEBhMCVVMx
20 EDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoT
21 HFN0YXJmaWVsZCBUZWNobm9sb2dpZXMsIEluYy4xMjAwBgNVBAMTKVN0YXJmaWVs
22 ZCBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5MDkwMTAwMDAw
23 MFoXDTM3MTIzMTIzNTk1OVowgY8xCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6
24 b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxTdGFyZmllbGQgVGVj
25 aG5vbG9naWVzLCBJbmMuMTIwMAYDVQQDEylTdGFyZmllbGQgUm9vdCBDZXJ0aWZp
26 Y2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
27 ggEBAL3twQP89o/8ArFvW59I2Z154qK3A2FWGMNHttfKPTUuiUP3oWmb3ooa/RMg
28 nLRJdzIpVv257IzdIvpy3Cdhl+72WoTsbhm5iSzchFvVdPtrX8WJpRBSiUZV9Lh1
29 HOZ/5FSuS/hVclcCGfgXcVnrHigHdMWdSL5stPSksPNkN3mSwOxGXn/hbVNMYq/N
30 Hwtjuzqd+/x5AJhhdM8mgkBj87JyahkNmcrUDnXMN/uLicFZ8WJ/X7NfZTD4p7dN
31 dloedl40wOiWVpmKs/B/pM293DIxfJHP4F8R+GuqSVzRmZTRouNjWwl2tVZi4Ut0
32 HZbUJtQIBFnQmA4O5t78w+wfkPECAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAO
33 BgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFHwMMh+n2TB/xH1oo2Kooc6rB1snMA0G
34 CSqGSIb3DQEBCwUAA4IBAQARWfolTwNvlJk7mh+ChTnUdgWUXuEok21iXQnCoKjU
35 sHU48TRqneSfioYmUeYs0cYtbpUgSpIB7LiKZ3sx4mcujJUDJi5DnUox9g61DLu3
36 4jd/IroAow57UvtruzvE03lRTs2Q9GcHGcg8RnoNAX3FWOdt5oUwF5okxBDgBPfg
37 8n/Uqgr/Qh037ZTlZFkSIHc40zI+OIF1lnP6aI+xy84fxez6nH7PfrHxBy22/L/K
38 pL/QlwVKvOoYKAKQvVR4CSFx09F9HdkWsKlhPdAKACL8x3vLCWRFCztAgfd9fDL1
39 mMpYjn0q7pBZc2T5NnReJaH1ZgUufzkVqSr7UIuOhWn0
40 -----END CERTIFICATE-----
41
42 -----BEGIN CERTIFICATE-----
43 MIIF2DCCA8CgAwIBAgIQTKr5yttjb+Af907YWwOGnTANBgkqhkiG9w0BAQwFADCB
44 hTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G
45 A1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNV
46 BAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTAwMTE5
47 MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMCR0IxGzAZBgNVBAgT
48 EkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMR
49 Q09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNh
50 dGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCR
51 6FSS0gpWsawNJN3Fz0RndJkrN6N9I3AAcbxT38T6KhKPS38QVr2fcHK3YX/JSw8X
52 pz3jsARh7v8Rl8f0hj4K+j5c+ZPmNHrZFGvnnLOFoIJ6dq9xkNfs/Q36nGz637CC
53 9BR++b7Epi9Pf5l/tfxnQ3K9DADWietrLNPtj5gcFKt+5eNu/Nio5JIk2kNrYrhV
54 /erBvGy2i/MOjZrkm2xpmfh4SDBF1a3hDTxFYPwyllEnvGfDyi62a+pGx8cgoLEf
55 Zd5ICLqkTqnyg0Y3hOvozIFIQ2dOciqbXL1MGyiKXCJ7tKuY2e7gUYPDCUZObT6Z
56 +pUX2nwzV0E8jVHtC7ZcryxjGt9XyD+86V3Em69FmeKjWiS0uqlWPc9vqv9JWL7w
57 qP/0uK3pN/u6uPQLOvnoQ0IeidiEyxPx2bvhiWC4jChWrBQdnArncevPDt09qZah
58 SL0896+1DSJMwBGB7FY79tOi4lu3sgQiUpWAk2nojkxl8ZEDLXB0AuqLZxUpaVIC
59 u9ffUGpVRr+goyhhf3DQw6KqLCGqR84onAZFdr+CGCe01a60y1Dma/RMhnEw6abf
60 Fobg2P9A3fvQQoh/ozM6LlweQRGBY84YcWsr7KaKtzFcOmpH4MN5WdYgGq/yapiq
61 crxXStJLnbsQ/LBMQeXtHT1eKJ2czL+zUdqnR+WEUwIDAQABo0IwQDAdBgNVHQ4E
62 FgQUu69+Aj36pvE8hI6t7jiY7NkyMtQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB
63 /wQFMAMBAf8wDQYJKoZIhvcNAQEMBQADggIBAArx1UaEt65Ru2yyTUEUAJNMnMvl
64 wFTPoCWOAvn9sKIN9SCYPBMtrFaisNZ+EZLpLrqeLppysb0ZRGxhNaKatBYSaVqM
65 4dc+pBroLwP0rmEdEBsqpIt6xf4FpuHA1sj+nq6PK7o9mfjYcwlYRm6mnPTXJ9OV
66 2jeDchzTc+CiR5kDOF3VSXkAKRzH7JsgHAckaVd4sjn8OoSgtZx8jb8uk2Intzna
67 FxiuvTwJaP+EmzzV1gsD41eeFPfR60/IvYcjt7ZJQ3mFXLrrkguhxuhoqEwWsRqZ
68 CuhTLJK7oQkYdQxlqHvLI7cawiiFwxv/0Cti76R7CZGYZ4wUAc1oBmpjIXUDgIiK
69 boHGhfKppC3n9KUkEEeDys30jXlYsQab5xoq2Z0B15R97QNKyvDb6KkBPvVWmcke
70 jkk9u+UJueBPSZI9FoJAzMxZxuY67RIuaTxslbH9qh17f4a+Hg4yRvv7E491f0yL
71 S0Zj/gA0QHDBw7mh3aZw4gSzQbzpgJHqZJx64SIDqZxubw5lT2yHh17zbqD5daWb
72 QOhTsiedSrnAdyGN/4fy3ryM7xfft0kL0fJuMAsaDk527RH89elWsn2/x20Kk4yl
73 0MC2Hb46TpSi125sC8KKfPog88Tk5c0NqMuRkrF8hey1FGlmDoLnzc7ILaZRfyHB
74 NVOFBkpdn627G190
75 -----END CERTIFICATE-----
76
77 -----BEGIN CERTIFICATE-----
78 MIIEPjCCAyagAwIBAgIESlOMKDANBgkqhkiG9w0BAQsFADCBvjELMAkGA1UEBhMC
79 VVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50
80 cnVzdC5uZXQvbGVnYWwtdGVybXMxOTA3BgNVBAsTMChjKSAyMDA5IEVudHJ1c3Qs
81 IEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ugb25seTEyMDAGA1UEAxMpRW50cnVz
82 dCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzIwHhcNMDkwNzA3MTcy
83 NTU0WhcNMzAxMjA3MTc1NTU0WjCBvjELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUVu
84 dHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwt
85 dGVybXMxOTA3BgNVBAsTMChjKSAyMDA5IEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0
86 aG9yaXplZCB1c2Ugb25seTEyMDAGA1UEAxMpRW50cnVzdCBSb290IENlcnRpZmlj
87 YXRpb24gQXV0aG9yaXR5IC0gRzIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK
88 AoIBAQC6hLZy254Ma+KZ6TABp3bqMriVQRrJ2mFOWHLP/vaCeb9zYQYKpSfYs1/T
89 RU4cctZOMvJyig/3gxnQaoCAAEUesMfnmr8SVycco2gvCoe9amsOXmXzHHfV1IWN
90 cCG0szLni6LVhjkCsbjSR87kyUnEO6fe+1R9V77w6G7CebI6C1XiUJgWMhNcL3hW
91 wcKUs/Ja5CeanyTXxuzQmyWC48zCxEXFjJd6BmsqEZ+pCm5IO2/b1BEZQvePB7/1
92 U1+cPvQXLOZprE4yTGJ36rfo5bs0vBmLrpxR57d+tVOxMyLlbc9wPBr64ptntoP0
93 jaWvYkxN4FisZDQSA/i2jZRjJKRxAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAP
94 BgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRqciZ60B7vfec7aVHUbI2fkBJmqzAN
95 BgkqhkiG9w0BAQsFAAOCAQEAeZ8dlsa2eT8ijYfThwMEYGprmi5ZiXMRrEPR9RP/
96 jTkrwPK9T3CMqS/qF8QLVJ7UG5aYMzyorWKiAHarWWluBh1+xLlEjZivEtRh2woZ
97 Rkfz6/djwUAFQKXSt/S1mja/qYh2iARVBCuch38aNzx+LaUa2NSJXsq9rD1s2G2v
98 1fN2D807iDginWyTmsQ9v4IbZT+mD12q/OWyFcq1rca8PdCE6OoGcrBNOTJ4vz4R
99 nAuknZoh8/CbCzB428Hch0P+vGOaysXCHMnHjf87ElgI5rY97HosTvuDls4MPGmH
100 VHOkc8KT/1EQrBVUAdj8BbGJoX90g5pJ19xOe4pIb4tF9g==
101 -----END CERTIFICATE-----
102
103 -----BEGIN CERTIFICATE-----
104 MIIEADCCAuigAwIBAgIBADANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEh
105 MB8GA1UEChMYVGhlIEdvIERhZGR5IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBE
106 YWRkeSBDbGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA0MDYyOTE3
107 MDYyMFoXDTM0MDYyOTE3MDYyMFowYzELMAkGA1UEBhMCVVMxITAfBgNVBAoTGFRo
108 ZSBHbyBEYWRkeSBHcm91cCwgSW5jLjExMC8GA1UECxMoR28gRGFkZHkgQ2xhc3Mg
109 MiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASAwDQYJKoZIhvcNAQEBBQADggEN
110 ADCCAQgCggEBAN6d1+pXGEmhW+vXX0iG6r7d/+TvZxz0ZWizV3GgXne77ZtJ6XCA
111 PVYYYwhv2vLM0D9/AlQiVBDYsoHUwHU9S3/Hd8M+eKsaA7Ugay9qK7HFiH7Eux6w
112 wdhFJ2+qN1j3hybX2C32qRe3H3I2TqYXP2WYktsqbl2i/ojgC95/5Y0V4evLOtXi
113 EqITLdiOr18SPaAIBQi2XKVlOARFmR6jYGB0xUGlcmIbYsUfb18aQr4CUWWoriMY
114 avx4A6lNf4DD+qta/KFApMoZFv6yyO9ecw3ud72a9nmYvLEHZ6IVDd2gWMZEewo+
115 YihfukEHU1jPEX44dMX4/7VpkI+EdOqXG68CAQOjgcAwgb0wHQYDVR0OBBYEFNLE
116 sNKR1EwRcbNhyz2h/t2oatTjMIGNBgNVHSMEgYUwgYKAFNLEsNKR1EwRcbNhyz2h
117 /t2oatTjoWekZTBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYVGhlIEdvIERhZGR5
118 IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRpZmlj
119 YXRpb24gQXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQAD
120 ggEBADJL87LKPpH8EsahB4yOd6AzBhRckB4Y9wimPQoZ+YeAEW5p5JYXMP80kWNy
121 OO7MHAGjHZQopDH2esRU1/blMVgDoszOYtuURXO1v0XJJLXVggKtI3lpjbi2Tc7P
122 TMozI+gciKqdi0FuFskg5YmezTvacPd+mSYgFFQlq25zheabIZ0KbIIOqPjCDPoQ
123 HmyW74cNxA9hi63ugyuV+I6ShHI56yDqg+2DzZduCLzrTia2cyvk0/ZM/iZx4mER
124 dEr/VxqHD3VILs9RaRegAhJhldXRQLIQTO7ErBBDpqWeCtWVYpoNz4iCxTIM5Cuf
125 ReYNnyicsbkqWletNw+vHX/bvZ8=
126 -----END CERTIFICATE-----
127
128 -----BEGIN CERTIFICATE-----
129 MIIDljCCAn6gAwIBAgIQC5McOtY5Z+pnI7/Dr5r0SzANBgkqhkiG9w0BAQsFADBl
130 MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
131 d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJv
132 b3QgRzIwHhcNMTMwODAxMTIwMDAwWhcNMzgwMTE1MTIwMDAwWjBlMQswCQYDVQQG
133 EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNl
134 cnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzIwggEi
135 MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDZ5ygvUj82ckmIkzTz+GoeMVSA
136 n61UQbVH35ao1K+ALbkKz3X9iaV9JPrjIgwrvJUXCzO/GU1BBpAAvQxNEP4Htecc
137 biJVMWWXvdMX0h5i89vqbFCMP4QMls+3ywPgym2hFEwbid3tALBSfK+RbLE4E9Hp
138 EgjAALAcKxHad3A2m67OeYfcgnDmCXRwVWmvo2ifv922ebPynXApVfSr/5Vh88lA
139 bx3RvpO704gqu52/clpWcTs/1PPRCv4o76Pu2ZmvA9OPYLfykqGxvYmJHzDNw6Yu
140 YjOuFgJ3RFrngQo8p0Quebg/BLxcoIfhG69Rjs3sLPr4/m3wOnyqi+RnlTGNAgMB
141 AAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQW
142 BBTOw0q5mVXyuNtgv6l+vVa1lzan1jANBgkqhkiG9w0BAQsFAAOCAQEAyqVVjOPI
143 QW5pJ6d1Ee88hjZv0p3GeDgdaZaikmkuOGybfQTUiaWxMTeKySHMq2zNixya1r9I
144 0jJmwYrA8y8678Dj1JGG0VDjA9tzd29KOVPt3ibHtX2vK0LRdWLjSisCx1BL4Gni
145 lmwORGYQRI+tBev4eaymG+g3NJ1TyWGqolKvSnAWhsI6yLETcDbYz+70CjTVW0z9
146 B5yiutkBclzzTcHdDrEcDcRjvq30FPuJ7KJBDkzMyFdA0G4Dqs0MjomZmWzwPDCv
147 ON9vvKO+KSAnq3T/EyJ43pdSVR6DtVQgA+6uwE9W3jfMw3+qBCe703e4YtsXfJwo
148 IhNzbM8m9Yop5w==
149 -----END CERTIFICATE-----
150
151 -----BEGIN CERTIFICATE-----
152 MIIFujCCA6KgAwIBAgIJALtAHEP1Xk+wMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV
153 BAYTAkNIMRUwEwYDVQQKEwxTd2lzc1NpZ24gQUcxHzAdBgNVBAMTFlN3aXNzU2ln
154 biBHb2xkIENBIC0gRzIwHhcNMDYxMDI1MDgzMDM1WhcNMzYxMDI1MDgzMDM1WjBF
155 MQswCQYDVQQGEwJDSDEVMBMGA1UEChMMU3dpc3NTaWduIEFHMR8wHQYDVQQDExZT
156 d2lzc1NpZ24gR29sZCBDQSAtIEcyMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC
157 CgKCAgEAr+TufoskDhJuqVAtFkQ7kpJcyrhdhJJCEyq8ZVeCQD5XJM1QiyUqt2/8
158 76LQwB8CJEoTlo8jE+YoWACjR8cGp4QjK7u9lit/VcyLwVcfDmJlD909Vopz2q5+
159 bbqBHH5CjCA12UNNhPqE21Is8w4ndwtrvxEvcnifLtg+5hg3Wipy+dpikJKVyh+c
160 6bM8K8vzARO/Ws/BtQpgvd21mWRTuKCWs2/iJneRjOBiEAKfNA+k1ZIzUd6+jbqE
161 emA8atufK+ze3gE/bk3lUIbLtK/tREDFylqM2tIrfKjuvqblCqoOpd8FUrdVxyJd
162 MmqXl2MT28nbeTZ7hTpKxVKJ+STnnXepgv9VHKVxaSvRAiTysybUa9oEVeXBCsdt
163 MDeQKuSeFDNeFhdVxVu1yzSJkvGdJo+hB9TGsnhQ2wwMC3wLjEHXuendjIj3o02y
164 MszYF9rNt85mndT9Xv+9lz4pded+p2JYryU0pUHHPbwNUMoDAw8IWh+Vc3hiv69y
165 FGkOpeUDDniOJihC8AcLYiAQZzlG+qkDzAQ4embvIIO1jEpWjpEA/I5cgt6IoMPi
166 aG59je883WX0XaxR7ySArqpWl2/5rX3aYT+YdzylkbYcjCbaZaIJbcHiVOO5ykxM
167 gI93e2CaHt+28kgeDrpOVG2Y4OGiGqJ3UM/EY5LsRxmd6+ZrzsECAwEAAaOBrDCB
168 qTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUWyV7
169 lqRlUX64OfPAeGZe6Drn8O4wHwYDVR0jBBgwFoAUWyV7lqRlUX64OfPAeGZe6Drn
170 8O4wRgYDVR0gBD8wPTA7BglghXQBWQECAQEwLjAsBggrBgEFBQcCARYgaHR0cDov
171 L3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIBACe6
172 45R88a7A3hfm5djV9VSwg/S7zV4Fe0+fdWavPOhWfvxyeDgD2StiGwC5+OlgzczO
173 UYrHUDFu4Up+GC9pWbY9ZIEr44OE5iKHjn3g7gKZYbge9LgriBIWhMIxkziWMaa5
174 O1M/wySTVltpkuzFwbs4AOPsF6m43Md8AYOfMke6UiI0HTJ6CVanfCU2qT1L2sCC
175 bwq7EsiHSycR+R4tx5M/nttfJmtS2S6K8RTGRI0Vqbe/vd6mGu6uLftIdxf+u+yv
176 GPUqUfA5hJeVbG4bwyvEdGB5JbAKJ9/fXtI5z0V9QkvfsywexcZdylU6oJxpmo/a
177 77KwPJ+HbBIrZXAVUjEaJM9vMSNQH4xPjyPDdEFjHFWoFN0+4FFQz/EbMFYOkrCC
178 hdiDyyJkvC24JdVUorgG6q2SpCSgwYa1ShNqR88uC1aVVMvOmttqtKay20EIhid3
179 92qgQmwLOM7XdVAyksLfKzAiSNDVQTglXaTpXZ/GlHXQRf0wl0OPkKsKx4ZzYEpp
180 Ld6leNcG2mqeSz53OiATIgHQv2ieY2BrNU0LbbqhPcCT4H8js1WtciVORvnSFu+w
181 ZMEBnunKoGqYDs/YYPIvSbjkQuE4NRb0yG5P94FW6LqjviOvrv1vA+ACOzB2+htt
182 Qc8Bsem4yWb02ybzOqR08kkkW8mw0FfB+j564ZfJ
183 -----END CERTIFICATE-----
184
185 -----BEGIN CERTIFICATE-----
186 MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/
187 MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT
188 DkRTVCBSb290IENBIFgzMB4XDTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVow
189 PzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMRcwFQYDVQQD
190 Ew5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB
191 AN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmTrE4O
192 rz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEq
193 OLl5CjH9UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9b
194 xiqKqy69cK3FCxolkHRyxXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw
195 7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40dutolucbY38EVAjqr2m7xPi71XAicPNaD
196 aeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNV
197 HQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQMA0GCSqG
198 SIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69
199 ikugdB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXr
200 AvHRAosZy5Q6XkjEGB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZz
201 R8srzJmwN0jP41ZL9c8PDHIyh8bwRLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5
202 JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubSfZGL+T0yjWW06XyxV3bqxbYo
203 Ob8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ
204 -----END CERTIFICATE-----
205
206 -----BEGIN CERTIFICATE-----
207 MIIFYDCCA0igAwIBAgIURFc0JFuBiZs18s64KztbpybwdSgwDQYJKoZIhvcNAQEL
208 BQAwSDELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAc
209 BgNVBAMTFVF1b1ZhZGlzIFJvb3QgQ0EgMiBHMzAeFw0xMjAxMTIxODU5MzJaFw00
210 MjAxMTIxODU5MzJaMEgxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM
211 aW1pdGVkMR4wHAYDVQQDExVRdW9WYWRpcyBSb290IENBIDIgRzMwggIiMA0GCSqG
212 SIb3DQEBAQUAA4ICDwAwggIKAoICAQChriWyARjcV4g/Ruv5r+LrI3HimtFhZiFf
213 qq8nUeVuGxbULX1QsFN3vXg6YOJkApt8hpvWGo6t/x8Vf9WVHhLL5hSEBMHfNrMW
214 n4rjyduYNM7YMxcoRvynyfDStNVNCXJJ+fKH46nafaF9a7I6JaltUkSs+L5u+9ym
215 c5GQYaYDFCDy54ejiK2toIz/pgslUiXnFgHVy7g1gQyjO/Dh4fxaXc6AcW34Sas+
216 O7q414AB+6XrW7PFXmAqMaCvN+ggOp+oMiwMzAkd056OXbxMmO7FGmh77FOm6RQ1
217 o9/NgJ8MSPsc9PG/Srj61YxxSscfrf5BmrODXfKEVu+lV0POKa2Mq1W/xPtbAd0j
218 IaFYAI7D0GoT7RPjEiuA3GfmlbLNHiJuKvhB1PLKFAeNilUSxmn1uIZoL1NesNKq
219 IcGY5jDjZ1XHm26sGahVpkUG0CM62+tlXSoREfA7T8pt9DTEceT/AFr2XK4jYIVz
220 8eQQsSWu1ZK7E8EM4DnatDlXtas1qnIhO4M15zHfeiFuuDIIfR0ykRVKYnLP43eh
221 vNURG3YBZwjgQQvD6xVu+KQZ2aKrr+InUlYrAoosFCT5v0ICvybIxo/gbjh9Uy3l
222 7ZizlWNof/k19N+IxWA1ksB8aRxhlRbQ694Lrz4EEEVlWFA4r0jyWbYW8jwNkALG
223 cC4BrTwV1wIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIB
224 BjAdBgNVHQ4EFgQU7edvdlq/YOxJW8ald7tyFnGbxD0wDQYJKoZIhvcNAQELBQAD
225 ggIBAJHfgD9DCX5xwvfrs4iP4VGyvD11+ShdyLyZm3tdquXK4Qr36LLTn91nMX66
226 AarHakE7kNQIXLJgapDwyM4DYvmL7ftuKtwGTTwpD4kWilhMSA/ohGHqPHKmd+RC
227 roijQ1h5fq7KpVMNqT1wvSAZYaRsOPxDMuHBR//47PERIjKWnML2W2mWeyAMQ0Ga
228 W/ZZGYjeVYg3UQt4XAoeo0L9x52ID8DyeAIkVJOviYeIyUqAHerQbj5hLja7NQ4n
229 lv1mNDthcnPxFlxHBlRJAHpYErAK74X9sbgzdWqTHBLmYF5vHX/JHyPLhGGfHoJE
230 +V+tYlUkmlKY7VHnoX6XOuYvHxHaU4AshZ6rNRDbIl9qxV6XU/IyAgkwo1jwDQHV
231 csaxfGl7w/U2Rcxhbl5MlMVerugOXou/983g7aEOGzPuVBj+D77vfoRrQ+NwmNtd
232 dbINWQeFFSM51vHfqSYP1kjHs6Yi9TM3WpVHn3u6GBVv/9YUZINJ0gpnIdsPNWNg
233 KCLjsZWDzYWm3S8P52dSbrsvhXz1SnPnxT7AvSESBT/8twNJAlvIJebiVDj1eYeM
234 HVOyToV7BjjHLPj4sHKNJeV3UvQDHEimUF+IIDBu8oJDqz2XhOdT+yHBTw8imoa4
235 WSr2Rz0ZiC3oheGe7IUIarFsNMkd7EgrO3jtZsSOeWmD3n+M
236 -----END CERTIFICATE-----
237
238 -----BEGIN CERTIFICATE-----
239 MIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCREUx
240 KzApBgNVBAoMIlQtU3lzdGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAd
241 BgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBDZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNl
242 YyBHbG9iYWxSb290IENsYXNzIDIwHhcNMDgxMDAxMTA0MDE0WhcNMzMxMDAxMjM1
243 OTU5WjCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoMIlQtU3lzdGVtcyBFbnRlcnBy
244 aXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBDZW50
245 ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDIwggEiMA0G
246 CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCqX9obX+hzkeXaXPSi5kfl82hVYAUd
247 AqSzm1nzHoqvNK38DcLZSBnuaY/JIPwhqgcZ7bBcrGXHX+0CfHt8LRvWurmAwhiC
248 FoT6ZrAIxlQjgeTNuUk/9k9uN0goOA/FvudocP05l03Sx5iRUKrERLMjfTlH6VJi
249 1hKTXrcxlkIF+3anHqP1wvzpesVsqXFP6st4vGCvx9702cu+fjOlbpSD8DT6Iavq
250 jnKgP6TeMFvvhk1qlVtDRKgQFRzlAVfFmPHmBiiRqiDFt1MmUUOyCxGVWOHAD3bZ
251 wI18gfNycJ5v/hqO2V81xrJvNHy+SE/iWjnX2J14np+GPgNeGYtEotXHAgMBAAGj
252 QjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBS/
253 WSA2AHmgoCJrjNXyYdK4LMuCSjANBgkqhkiG9w0BAQsFAAOCAQEAMQOiYQsfdOhy
254 NsZt+U2e+iKo4YFWz827n+qrkRk4r6p8FU3ztqONpfSO9kSpp+ghla0+AGIWiPAC
255 uvxhI+YzmzB6azZie60EI4RYZeLbK4rnJVM3YlNfvNoBYimipidx5joifsFvHZVw
256 IEoHNN/q/xWA5brXethbdXwFeilHfkCoMRN3zUA7tFFHei4R40cR3p1m0IvVVGb6
257 g1XqfMIpiRvpb7PO4gWEyS8+eIVibslfwXhjdFjASBgMmTnrpMwatXlajRWc2BQN
258 9noHV8cigwUtPJslJj0Ys6lDfMjIq2SPDqO/nBudMNva0Bkuqjzx+zOAduTNrRlP
259 BSeOE6Fuwg==
260 -----END CERTIFICATE-----
261
262 -----BEGIN CERTIFICATE-----
263 MIIDujCCAqKgAwIBAgILBAAAAAABD4Ym5g0wDQYJKoZIhvcNAQEFBQAwTDEgMB4G
264 A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjIxEzARBgNVBAoTCkdsb2JhbFNp
265 Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDYxMjE1MDgwMDAwWhcNMjExMjE1
266 MDgwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMjETMBEG
267 A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI
268 hvcNAQEBBQADggEPADCCAQoCggEBAKbPJA6+Lm8omUVCxKs+IVSbC9N/hHD6ErPL
269 v4dfxn+G07IwXNb9rfF73OX4YJYJkhD10FPe+3t+c4isUoh7SqbKSaZeqKeMWhG8
270 eoLrvozps6yWJQeXSpkqBy+0Hne/ig+1AnwblrjFuTosvNYSuetZfeLQBoZfXklq
271 tTleiDTsvHgMCJiEbKjNS7SgfQx5TfC4LcshytVsW33hoCmEofnTlEnLJGKRILzd
272 C9XZzPnqJworc5HGnRusyMvo4KD0L5CLTfuwNhv2GXqF4G3yYROIXJ/gkwpRl4pa
273 zq+r1feqCapgvdzZX99yqWATXgAByUr6P6TqBwMhAo6CygPCm48CAwEAAaOBnDCB
274 mTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUm+IH
275 V2ccHsBqBt5ZtJot39wZhi4wNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL2NybC5n
276 bG9iYWxzaWduLm5ldC9yb290LXIyLmNybDAfBgNVHSMEGDAWgBSb4gdXZxwewGoG
277 3lm0mi3f3BmGLjANBgkqhkiG9w0BAQUFAAOCAQEAmYFThxxol4aR7OBKuEQLq4Gs
278 J0/WwbgcQ3izDJr86iw8bmEbTUsp9Z8FHSbBuOmDAGJFtqkIk7mpM0sYmsL4h4hO
279 291xNBrBVNpGP+DTKqttVCL1OmLNIG+6KYnX3ZHu01yiPqFbQfXf5WRDLenVOavS
280 ot+3i9DAgBkcRcAtjOj4LaR0VknFBbVPFd5uRHg5h6h+u/N5GJG79G+dwfCMNYxd
281 AfvDbbnvRG15RjF+Cv6pgsH/76tuIMRQyV+dTZsXjAzlAcmgQWpzU/qlULRuJQ/7
282 TBj0/VLZjmmx6BEP3ojY+x1J96relc8geMJgEtslQIxq/H5COEBkEveegeGTLg==
283 -----END CERTIFICATE-----
284
285 -----BEGIN CERTIFICATE-----
286 MIIDuDCCAqCgAwIBAgIQDPCOXAgWpa1Cf/DrJxhZ0DANBgkqhkiG9w0BAQUFADBI
287 MQswCQYDVQQGEwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24x
288 FzAVBgNVBAMTDlNlY3VyZVRydXN0IENBMB4XDTA2MTEwNzE5MzExOFoXDTI5MTIz
289 MTE5NDA1NVowSDELMAkGA1UEBhMCVVMxIDAeBgNVBAoTF1NlY3VyZVRydXN0IENv
290 cnBvcmF0aW9uMRcwFQYDVQQDEw5TZWN1cmVUcnVzdCBDQTCCASIwDQYJKoZIhvcN
291 AQEBBQADggEPADCCAQoCggEBAKukgeWVzfX2FI7CT8rU4niVWJxB4Q2ZQCQXOZEz
292 Zum+4YOvYlyJ0fwkW2Gz4BERQRwdbvC4u/jep4G6pkjGnx29vo6pQT64lO0pGtSO
293 0gMdA+9tDWccV9cGrcrI9f4Or2YlSASWC12juhbDCE/RRvgUXPLIXgGZbf2IzIao
294 wW8xQmxSPmjL8xk037uHGFaAJsTQ3MBv396gwpEWoGQRS0S8Hvbn+mPeZqx2pHGj
295 7DaUaHp3pLHnDi+BeuK1cobvomuL8A/b01k/unK8RCSc43Oz969XL0Imnal0ugBS
296 8kvNU3xHCzaFDmapCJcWNFfBZveA4+1wVMeT4C4oFVmHursCAwEAAaOBnTCBmjAT
297 BgkrBgEEAYI3FAIEBh4EAEMAQTALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB
298 /zAdBgNVHQ4EFgQUQjK2FvoE/f5dS3rD/fdMQB1aQ68wNAYDVR0fBC0wKzApoCeg
299 JYYjaHR0cDovL2NybC5zZWN1cmV0cnVzdC5jb20vU1RDQS5jcmwwEAYJKwYBBAGC
300 NxUBBAMCAQAwDQYJKoZIhvcNAQEFBQADggEBADDtT0rhWDpSclu1pqNlGKa7UTt3
301 6Z3q059c4EVlew3KW+JwULKUBRSuSceNQQcSc5R+DCMh/bwQf2AQWnL1mA6s7Ll/
302 3XpvXdMc9P+IBWlCqQVxyLesJugutIxq/3HcuLHfmbx8IVQr5Fiiu1cprp6poxkm
303 D5kuCLDv/WnPmRoJjeOnnyvJNjR7JLN4TJUXpAYmHrZkUjZfYGfZnMUFdAvnZyPS
304 CPyI6a6Lf+Ew9Dd+/cYy2i2eRDAwbO4H3tI0/NL/QPZL9GZGBlSm8jIKYyYwa5vR
305 3ItHuuG51WLQoqD0ZwV4KWMabwTW+MZMo5qxN7SN5ShLHZ4swrhovO0C7jE=
306 -----END CERTIFICATE-----
307
308 -----BEGIN CERTIFICATE-----
309 MIIDAzCCAmwCEQC5L2DMiJ+hekYJuFtwbIqvMA0GCSqGSIb3DQEBBQUAMIHBMQsw
310 CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xPDA6BgNVBAsTM0Ns
311 YXNzIDIgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBH
312 MjE6MDgGA1UECxMxKGMpIDE5OTggVmVyaVNpZ24sIEluYy4gLSBGb3IgYXV0aG9y
313 aXplZCB1c2Ugb25seTEfMB0GA1UECxMWVmVyaVNpZ24gVHJ1c3QgTmV0d29yazAe
314 Fw05ODA1MTgwMDAwMDBaFw0yODA4MDEyMzU5NTlaMIHBMQswCQYDVQQGEwJVUzEX
315 MBUGA1UEChMOVmVyaVNpZ24sIEluYy4xPDA6BgNVBAsTM0NsYXNzIDIgUHVibGlj
316 IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMjE6MDgGA1UECxMx
317 KGMpIDE5OTggVmVyaVNpZ24sIEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25s
318 eTEfMB0GA1UECxMWVmVyaVNpZ24gVHJ1c3QgTmV0d29yazCBnzANBgkqhkiG9w0B
319 AQEFAAOBjQAwgYkCgYEAp4gBIXQs5xoD8JjhlzwPIQjxnNuX6Zr8wgQGE75fUsjM
320 HiwSViy4AWkszJkfrbCWrnkE8hM5wXuYuggs6MKEEyyqaekJ9MepAqRCwiNPStjw
321 DqL7MWzJ5m+ZJwf15vRMeJ5t60aG+rmGyVTyssSv1EYcWskVMP8NbPUtDm3Of3cC
322 AwEAATANBgkqhkiG9w0BAQUFAAOBgQByLvl/0fFx+8Se9sVeUYpAmLho+Jscg9ji
323 nb3/7aHmZuovCfTK1+qlK5X2JGCGTUQug6XELaDTrnhpb3LabK4I8GOSN+a7xDAX
324 rXfMSTWqz9iP0b63GJZHc2pUIjRkLbYWm1lbtFFZOrMLFPQS32eg9K0yZF6xRnIn
325 jBJ7xUS0rg==
326 -----END CERTIFICATE-----
327
328 -----BEGIN CERTIFICATE-----
329 MIIFwTCCA6mgAwIBAgIITrIAZwwDXU8wDQYJKoZIhvcNAQEFBQAwSTELMAkGA1UE
330 BhMCQ0gxFTATBgNVBAoTDFN3aXNzU2lnbiBBRzEjMCEGA1UEAxMaU3dpc3NTaWdu
331 IFBsYXRpbnVtIENBIC0gRzIwHhcNMDYxMDI1MDgzNjAwWhcNMzYxMDI1MDgzNjAw
332 WjBJMQswCQYDVQQGEwJDSDEVMBMGA1UEChMMU3dpc3NTaWduIEFHMSMwIQYDVQQD
333 ExpTd2lzc1NpZ24gUGxhdGludW0gQ0EgLSBHMjCCAiIwDQYJKoZIhvcNAQEBBQAD
334 ggIPADCCAgoCggIBAMrfogLi2vj8Bxax3mCq3pZcZB/HL37PZ/pEQtZ2Y5Wu669y
335 IIpFR4ZieIbWIDkm9K6j/SPnpZy1IiEZtzeTIsBQnIJ71NUERFzLtMKfkr4k2Htn
336 IuJpX+UFeNSH2XFwMyVTtIc7KZAoNppVRDBopIOXfw0enHb/FZ1glwCNioUD7IC+
337 6ixuEFGSzH7VozPY1kneWCqv9hbrS3uQMpe5up1Y8fhXSQQeol0GcN1x2/ndi5ob
338 jM89o03Oy3z2u5yg+gnOI2Ky6Q0f4nIoj5+saCB9bzuohTEJfwvH6GXp43gOCWcw
339 izSC+13gzJ2BbWLuCB4ELE6b7P6pT1/9aXjvCR+htL/68++QHkwFix7qepF6w9fl
340 +zC8bBsQWJj3Gl/QKTIDE0ZNYWqFTFJ0LwYfexHihJfGmfNtf9dng34TaNhxKFrY
341 zt3oEBSa/m0jh26OWnA81Y0JAKeqvLAxN23IhBQeW71FYyBrS3SMvds6DsHPWhaP
342 pZjydomyExI7C3d3rLvlPClKknLKYRorXkzig3R3+jVIeoVNjZpTxN94ypeRSCtF
343 KwH3HBqi7Ri6Cr2D+m+8jVeTO9TUps4e8aCxzqv9KyiaTxvXw3LbpMS/XUz13XuW
344 ae5ogObnmLo2t/5u7Su9IPhlGdpVCX4l3P5hYnL5fhgC72O00Puv5TtjjGePAgMB
345 AAGjgawwgakwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0O
346 BBYEFFCvzAeHFUdvOMW0ZdHelarp35zMMB8GA1UdIwQYMBaAFFCvzAeHFUdvOMW0
347 ZdHelarp35zMMEYGA1UdIAQ/MD0wOwYJYIV0AVkBAQEBMC4wLAYIKwYBBQUHAgEW
348 IGh0dHA6Ly9yZXBvc2l0b3J5LnN3aXNzc2lnbi5jb20vMA0GCSqGSIb3DQEBBQUA
349 A4ICAQAIhab1Fgz8RBrBY+D5VUYI/HAcQiiWjrfFwUF1TglxeeVtlspLpYhg0DB0
350 uMoI3LQwnkAHFmtllXcBrqS3NQuB2nEVqXQXOHtYyvkv+8Bldo1bAbl93oI9ZLi+
351 FHSjClTTLJUYFzX1UWs/j6KWYTl4a0vlpqD4U99REJNi54Av4tHgvI42Rncz7Lj7
352 jposiU0xEQ8mngS7twSNC/K5/FqdOxa3L8iYq/6KUFkuozv8KV2LwUvJ4ooTHbG/
353 u0IdUt1O2BReEMYxB+9xJ/cbOQncguqLs5WGXv312l0xpuAxtpTmREl0xRbl9x8D
354 YSjFyMsSoEJL+WuICI20MhjzdZ/EfwBPBZWcoxcCw7NTm6ogOSkrZvqdr16zktK1
355 puEa+S1BaYEUtLS17Yk9zvupnTVCRLEcFHOBzyoBNZox1S2PbYTfgE1X4z/FhHXa
356 icYwu+uPyyIIoK6q8QNsOktNCaUOcsZWayFCTiMlFGiudgp8DAdwZPmaL/YFOSbG
357 DI8Zf0NebvRbFS/bYV3mZy8/CJT5YLSYMdp08YSTcU1f+2BY0fvEwW2JorsgH51x
358 kcsymxM9Pn2SUjWskpSi0xjCfMfqr3YFFt1nJ8J+HAciIfNAChs0B0QTwoRqjt8Z
359 Wr9/6x3iGjjRXK9HkmuAtTClyY3YqzGBH9/CZjfTk6mFhnll0g==
360 -----END CERTIFICATE-----
361
362 -----BEGIN CERTIFICATE-----
363 MIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCB
364 yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL
365 ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJp
366 U2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxW
367 ZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0
368 aG9yaXR5IC0gRzUwHhcNMDYxMTA4MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCByjEL
369 MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZW
370 ZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2ln
371 biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJp
372 U2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9y
373 aXR5IC0gRzUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvJAgIKXo1
374 nmAMqudLO07cfLw8RRy7K+D+KQL5VwijZIUVJ/XxrcgxiV0i6CqqpkKzj/i5Vbex
375 t0uz/o9+B1fs70PbZmIVYc9gDaTY3vjgw2IIPVQT60nKWVSFJuUrjxuf6/WhkcIz
376 SdhDY2pSS9KP6HBRTdGJaXvHcPaz3BJ023tdS1bTlr8Vd6Gw9KIl8q8ckmcY5fQG
377 BO+QueQA5N06tRn/Arr0PO7gi+s3i+z016zy9vA9r911kTMZHRxAy3QkGSGT2RT+
378 rCpSx4/VBEnkjWNHiDxpg8v+R70rfk/Fla4OndTRQ8Bnc+MUCH7lP59zuDMKz10/
379 NIeWiu5T6CUVAgMBAAGjgbIwga8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8E
380 BAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2UvZ2lmMCEwHzAH
381 BgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVy
382 aXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFH/TZafC3ey78DAJ80M5+gKv
383 MzEzMA0GCSqGSIb3DQEBBQUAA4IBAQCTJEowX2LP2BqYLz3q3JktvXf2pXkiOOzE
384 p6B4Eq1iDkVwZMXnl2YtmAl+X6/WzChl8gGqCBpH3vn5fJJaCGkgDdk+bW48DW7Y
385 5gaRQBi5+MHt39tBquCWIMnNZBU4gcmU7qKEKQsTb47bDN0lAtukixlE0kF6BWlK
386 WE9gyn6CagsCqiUXObXbf+eEZSqVir2G3l6BFoMtEMze/aiCKm0oHw0LxOXnGiYZ
387 4fQRbxC1lfznQgUy286dUV4otp6F01vvpX1FQHKOtw5rDgb7MzVIcbidJ4vEZV8N
388 hnacRHr2lVz2XTIIM6RUthg/aFzyQkqFOFSDX9HoLPKsEdao7WNq
389 -----END CERTIFICATE-----
390
391 -----BEGIN CERTIFICATE-----
392 MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4G
393 A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNp
394 Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4
395 MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEG
396 A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI
397 hvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWtiHL8
398 RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsT
399 gHeMCOFJ0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmm
400 KPZpO/bLyCiR5Z2KYVc3rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zd
401 QQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjlOCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZ
402 XriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2xmmFghcCAwEAAaNCMEAw
403 DgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFI/wS3+o
404 LkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZU
405 RUm7lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMp
406 jjM5RcOO5LlXbKr8EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK
407 6fBdRoyV3XpYKBovHd7NADdBj+1EbddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQX
408 mcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18YIvDQVETI53O9zJrlAGomecs
409 Mx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7rkpeDMdmztcpH
410 WD9f
411 -----END CERTIFICATE-----
412
413 -----BEGIN CERTIFICATE-----
414 MIIEQzCCAyugAwIBAgIDCYP0MA0GCSqGSIb3DQEBCwUAMFAxCzAJBgNVBAYTAkRF
415 MRUwEwYDVQQKDAxELVRydXN0IEdtYkgxKjAoBgNVBAMMIUQtVFJVU1QgUm9vdCBD
416 bGFzcyAzIENBIDIgRVYgMjAwOTAeFw0wOTExMDUwODUwNDZaFw0yOTExMDUwODUw
417 NDZaMFAxCzAJBgNVBAYTAkRFMRUwEwYDVQQKDAxELVRydXN0IEdtYkgxKjAoBgNV
418 BAMMIUQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgRVYgMjAwOTCCASIwDQYJKoZI
419 hvcNAQEBBQADggEPADCCAQoCggEBAJnxhDRwui+3MKCOvXwEz75ivJn9gpfSegpn
420 ljgJ9hBOlSJzmY3aFS3nBfwZcyK3jpgAvDw9rKFs+9Z5JUut8Mxk2og+KbgPCdM0
421 3TP1YtHhzRnp7hhPTFiu4h7WDFsVWtg6uMQYZB7jM7K1iXdODL/ZlGsTl28So/6Z
422 qQTMFexgaDbtCHu39b+T7WYxg4zGcTSHThfqr4uRjRxWQa4iN1438h3Z0S0NL2lR
423 p75mpoo6Kr3HGrHhFPC+Oh25z1uxav60sUYgovseO3Dvk5h9jHOW8sXvhXCtKSb8
424 HgQ+HKDYD8tSg2J87otTlZCpV6LqYQXY+U3EJ/pure3511H3a6UCAwEAAaOCASQw
425 ggEgMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFNOUikxiEyoZLsyvcop9Ntea
426 HNxnMA4GA1UdDwEB/wQEAwIBBjCB3QYDVR0fBIHVMIHSMIGHoIGEoIGBhn9sZGFw
427 Oi8vZGlyZWN0b3J5LmQtdHJ1c3QubmV0L0NOPUQtVFJVU1QlMjBSb290JTIwQ2xh
428 c3MlMjAzJTIwQ0ElMjAyJTIwRVYlMjAyMDA5LE89RC1UcnVzdCUyMEdtYkgsQz1E
429 RT9jZXJ0aWZpY2F0ZXJldm9jYXRpb25saXN0MEagRKBChkBodHRwOi8vd3d3LmQt
430 dHJ1c3QubmV0L2NybC9kLXRydXN0X3Jvb3RfY2xhc3NfM19jYV8yX2V2XzIwMDku
431 Y3JsMA0GCSqGSIb3DQEBCwUAA4IBAQA07XtaPKSUiO8aEXUHL7P+PPoeUSbrh/Yp
432 3uDx1MYkCenBz1UbtDDZzhr+BlGmFaQt77JLvyAoJUnRpjZ3NOhk31KxEcdzes05
433 nsKtjHEh8lprr988TlWvsoRlFIm5d8sqMb7Po23Pb0iUMkZv53GMoKaEGTcH8gNF
434 CSuGdXzfX2lXANtu2KZyIktQ1HWYVt+3GP9DQ1CuekR78HlR10M9p9OB0/DJT7na
435 xpeG0ILD5EJt/rDiZE4OJudANCa1CInXCGNjOCd1HjPqbqjdn5lPdE2BiYBL3ZqX
436 KVwvvoFBuYz/6n1gBp7N1z3TLqMVvKjmJuVvw9y4AyHqnxbxLFS1
437 -----END CERTIFICATE-----
438
439 -----BEGIN CERTIFICATE-----
440 MIIEHjCCAwagAwIBAgIBATANBgkqhkiG9w0BAQUFADBnMQswCQYDVQQGEwJTRTEU
441 MBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3
442 b3JrMSMwIQYDVQQDExpBZGRUcnVzdCBRdWFsaWZpZWQgQ0EgUm9vdDAeFw0wMDA1
443 MzAxMDQ0NTBaFw0yMDA1MzAxMDQ0NTBaMGcxCzAJBgNVBAYTAlNFMRQwEgYDVQQK
444 EwtBZGRUcnVzdCBBQjEdMBsGA1UECxMUQWRkVHJ1c3QgVFRQIE5ldHdvcmsxIzAh
445 BgNVBAMTGkFkZFRydXN0IFF1YWxpZmllZCBDQSBSb290MIIBIjANBgkqhkiG9w0B
446 AQEFAAOCAQ8AMIIBCgKCAQEA5B6a/twJWoekn0e+EV+vhDTbYjx5eLfpMLXsDBwq
447 xBb/4Oxx64r1EW7tTw2R0hIYLUkVAcKkIhPHEWT/IhKauY5cLwjPcWqzZwFZ8V1G
448 87B4pfYOQnrjfxvM0PC3KP0q6p6zsLkEqv32x7SxuCqg+1jxGaBvcCV+PmlKfw8i
449 2O+tCBGaKZnhqkRFmhJePp1tUvznoD1oL/BLcHwTOK28FSXx1s6rosAx1i+f4P8U
450 WfyEk9mHfExUE+uf0S0R+Bg6Ot4l2ffTQO2kBhLEO+GRwVY18BTcZTYJbqukB8c1
451 0cIDMzZbdSZtQvESa0NvS3GU+jQd7RNuyoB/mC9suWXY6QIDAQABo4HUMIHRMB0G
452 A1UdDgQWBBQ5lYtii1zJ1IC6WA+XPxUIQ8yYpzALBgNVHQ8EBAMCAQYwDwYDVR0T
453 AQH/BAUwAwEB/zCBkQYDVR0jBIGJMIGGgBQ5lYtii1zJ1IC6WA+XPxUIQ8yYp6Fr
454 pGkwZzELMAkGA1UEBhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMR0wGwYDVQQL
455 ExRBZGRUcnVzdCBUVFAgTmV0d29yazEjMCEGA1UEAxMaQWRkVHJ1c3QgUXVhbGlm
456 aWVkIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBABmrder4i2VhlRO6aQTv
457 hsoToMeqT2QbPxj2qC0sVY8FtzDqQmodwCVRLae/DLPt7wh/bDxGGuoYQ992zPlm
458 hpwsaPXpF/gxsxjE1kh9I0xowX67ARRvxdlu3rsEQmr49lx95dr6h+sNNVJn0J6X
459 dgWTP5XHAeZpVTh/EGGZyeNfpso+gmNIquIISD6q8rKFYqa0p9m9N5xotS1WfbC3
460 P6CxB9bpT9zeRXEwMn8bLgn5v1Kh7sKAPgZcLlVAwRv1cEWw3F369nJad9Jjzc9Y
461 iQBCYz95OdBEsIJuQRno3eDBiFrRHnGTHyQwdOUeqN48Jzd/g66ed8/wMLH/S5no
462 xqE=
463 -----END CERTIFICATE-----
464
465 -----BEGIN CERTIFICATE-----
466 MIIF3jCCA8agAwIBAgIQAf1tMPyjylGoG7xkDjUDLTANBgkqhkiG9w0BAQwFADCB
467 iDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0pl
468 cnNleSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNV
469 BAMTJVVTRVJUcnVzdCBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTAw
470 MjAxMDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBiDELMAkGA1UEBhMCVVMxEzARBgNV
471 BAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQKExVU
472 aGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBSU0EgQ2Vy
473 dGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIK
474 AoICAQCAEmUXNg7D2wiz0KxXDXbtzSfTTK1Qg2HiqiBNCS1kCdzOiZ/MPans9s/B
475 3PHTsdZ7NygRK0faOca8Ohm0X6a9fZ2jY0K2dvKpOyuR+OJv0OwWIJAJPuLodMkY
476 tJHUYmTbf6MG8YgYapAiPLz+E/CHFHv25B+O1ORRxhFnRghRy4YUVD+8M/5+bJz/
477 Fp0YvVGONaanZshyZ9shZrHUm3gDwFA66Mzw3LyeTP6vBZY1H1dat//O+T23LLb2
478 VN3I5xI6Ta5MirdcmrS3ID3KfyI0rn47aGYBROcBTkZTmzNg95S+UzeQc0PzMsNT
479 79uq/nROacdrjGCT3sTHDN/hMq7MkztReJVni+49Vv4M0GkPGw/zJSZrM233bkf6
480 c0Plfg6lZrEpfDKEY1WJxA3Bk1QwGROs0303p+tdOmw1XNtB1xLaqUkL39iAigmT
481 Yo61Zs8liM2EuLE/pDkP2QKe6xJMlXzzawWpXhaDzLhn4ugTncxbgtNMs+1b/97l
482 c6wjOy0AvzVVdAlJ2ElYGn+SNuZRkg7zJn0cTRe8yexDJtC/QV9AqURE9JnnV4ee
483 UB9XVKg+/XRjL7FQZQnmWEIuQxpMtPAlR1n6BB6T1CZGSlCBst6+eLf8ZxXhyVeE
484 Hg9j1uliutZfVS7qXMYoCAQlObgOK6nyTJccBz8NUvXt7y+CDwIDAQABo0IwQDAd
485 BgNVHQ4EFgQUU3m/WqorSs9UgOHYm8Cd8rIDZsswDgYDVR0PAQH/BAQDAgEGMA8G
486 A1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEMBQADggIBAFzUfA3P9wF9QZllDHPF
487 Up/L+M+ZBn8b2kMVn54CVVeWFPFSPCeHlCjtHzoBN6J2/FNQwISbxmtOuowhT6KO
488 VWKR82kV2LyI48SqC/3vqOlLVSoGIG1VeCkZ7l8wXEskEVX/JJpuXior7gtNn3/3
489 ATiUFJVDBwn7YKnuHKsSjKCaXqeYalltiz8I+8jRRa8YFWSQEg9zKC7F4iRO/Fjs
490 8PRF/iKz6y+O0tlFYQXBl2+odnKPi4w2r78NBc5xjeambx9spnFixdjQg3IM8WcR
491 iQycE0xyNN+81XHfqnHd4blsjDwSXWXavVcStkNr/+XeTWYRUc+ZruwXtuhxkYze
492 Sf7dNXGiFSeUHM9h4ya7b6NnJSFd5t0dCy5oGzuCr+yDZ4XUmFF0sbmZgIn/f3gZ
493 XHlKYC6SQK5MNyosycdiyA5d9zZbyuAlJQG03RoHnHcAP9Dc1ew91Pq7P8yF1m9/
494 qS3fuQL39ZeatTXaw2ewh0qpKJ4jjv9cJ2vhsE/zB+4ALtRZh8tSQZXq9EfX7mRB
495 VXyNWQKV3WKdwrnuWih0hKWbt5DHDAff9Yk2dDLWKMGwsAvgnEzDHNb842m1R0aB
496 L6KCq9NjRHDEjf8tM7qtj3u1cIiuPhnPQCjY/MiQu12ZIvVS5ljFH4gxQ+6IHdfG
497 jjxDah2nGN59PRbxYvnKkKj9
498 -----END CERTIFICATE-----
499
500 -----BEGIN CERTIFICATE-----
501 MIIDtzCCAp+gAwIBAgIQDOfg5RfYRv6P5WD8G/AwOTANBgkqhkiG9w0BAQUFADBl
502 MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
503 d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJv
504 b3QgQ0EwHhcNMDYxMTEwMDAwMDAwWhcNMzExMTEwMDAwMDAwWjBlMQswCQYDVQQG
505 EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNl
506 cnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0EwggEi
507 MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCtDhXO5EOAXLGH87dg+XESpa7c
508 JpSIqvTO9SA5KFhgDPiA2qkVlTJhPLWxKISKityfCgyDF3qPkKyK53lTXDGEKvYP
509 mDI2dsze3Tyoou9q+yHyUmHfnyDXH+Kx2f4YZNISW1/5WBg1vEfNoTb5a3/UsDg+
510 wRvDjDPZ2C8Y/igPs6eD1sNuRMBhNZYW/lmci3Zt1/GiSw0r/wty2p5g0I6QNcZ4
511 VYcgoc/lbQrISXwxmDNsIumH0DJaoroTghHtORedmTpyoeb6pNnVFzF1roV9Iq4/
512 AUaG9ih5yLHa5FcXxH4cDrC0kqZWs72yl+2qp/C3xag/lRbQ/6GW6whfGHdPAgMB
513 AAGjYzBhMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQW
514 BBRF66Kv9JLLgjEtUYunpyGd823IDzAfBgNVHSMEGDAWgBRF66Kv9JLLgjEtUYun
515 pyGd823IDzANBgkqhkiG9w0BAQUFAAOCAQEAog683+Lt8ONyc3pklL/3cmbYMuRC
516 dWKuh+vy1dneVrOfzM4UKLkNl2BcEkxY5NM9g0lFWJc1aRqoR+pWxnmrEthngYTf
517 fwk8lOa4JiwgvT2zKIn3X/8i4peEH+ll74fg38FnSbNd67IJKusm7Xi+fT8r87cm
518 NW1fiQG2SVufAQWbqz0lwcy2f8Lxb4bG+mRo64EtlOtCt/qMHt1i8b5QZ7dsvfPx
519 H2sMNgcWfzd8qVttevESRmCD1ycEvkvOl77DZypoEd+A5wwzZr8TDRRu838fYxAe
520 +o0bJW1sj6W3YQGx0qMmoRBxna3iw/nDmVG3KwcIzi7mULKn+gpFL6Lw8g==
521 -----END CERTIFICATE-----
522
523 -----BEGIN CERTIFICATE-----
524 MIID/jCCAuagAwIBAgIQFaxulBmyeUtB9iepwxgPHzANBgkqhkiG9w0BAQsFADCB
525 mDELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsT
526 MChjKSAyMDA4IEdlb1RydXN0IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25s
527 eTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhv
528 cml0eSAtIEczMB4XDTA4MDQwMjAwMDAwMFoXDTM3MTIwMTIzNTk1OVowgZgxCzAJ
529 BgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAoYykg
530 MjAwOCBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0
531 BgNVBAMTLUdlb1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg
532 LSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANziXmJYHTNXOTIz
533 +uvLh4yn1ErdBojqZI4xmKU4kB6Yzy5jK/BGvESyiaHAKAxJcCGVn2TAppMSAmUm
534 hsalifD614SgcK9PGpc/BkTVyetyEH3kMSj7HGHmKAdEc5IiaacDiGydY8hS2pgn
535 5whMcD60yRLBxWeDXTPzAxHsatBT4tG6NmCUgLthY2xbF37fQJQeqw3CIShwiP/W
536 JmxsYAQlTlV+fe+/lEjetx3dcI0FX4ilm/LC7urRQEFtYjgdVgbFA0dRIBn8exAL
537 DmKudlW/X3e+PkkBUz2YJQN2JFodtNuJ6nnltrM7P7pMKEF/BqxqjsHQ9gUdfeZC
538 huOl1UcCAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYw
539 HQYDVR0OBBYEFMR5yo6hTgMdHNxr2zFblD4/MH8tMA0GCSqGSIb3DQEBCwUAA4IB
540 AQAtxRPPVoB7eni9n64smefv2t+UXglpp+duaIy9cr5HqQ6XErhK8WTTOd8lNNTB
541 zU6B8A8ExCSzNJbGpqow32hhc9f5joWJ7w5elShKKiePEI4ufIbEAp7aDHdlDkQN
542 kv39sxY2+hENHYwOB4lqKVb3cvTdFZx3NWZXqxNT2I7BQMXXExZacse3aQHEerGD
543 AWh9jUGhlBjBJVz88P6DAod8DQ3PLghcSkANPuyBYeYk28rgDi0Hsj5W3I31QYUH
544 SJsMC8tJP33st/3LjWeJGqvtux6jAAgIFyqCXDFdRootD4abdNlF+9RAsXqqaC2G
545 spki4cErx5z481+oghLrGREt
546 -----END CERTIFICATE-----
547
548 -----BEGIN CERTIFICATE-----
549 MIIFtzCCA5+gAwIBAgICBQkwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0x
550 GTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJv
551 b3QgQ0EgMjAeFw0wNjExMjQxODI3MDBaFw0zMTExMjQxODIzMzNaMEUxCzAJBgNV
552 BAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMRswGQYDVQQDExJRdW9W
553 YWRpcyBSb290IENBIDIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCa
554 GMpLlA0ALa8DKYrwD4HIrkwZhR0In6spRIXzL4GtMh6QRr+jhiYaHv5+HBg6XJxg
555 Fyo6dIMzMH1hVBHL7avg5tKifvVrbxi3Cgst/ek+7wrGsxDp3MJGF/hd/aTa/55J
556 WpzmM+Yklvc/ulsrHHo1wtZn/qtmUIttKGAr79dgw8eTvI02kfN/+NsRE8Scd3bB
557 rrcCaoF6qUWD4gXmuVbBlDePSHFjIuwXZQeVikvfj8ZaCuWw419eaxGrDPmF60Tp
558 +ARz8un+XJiM9XOva7R+zdRcAitMOeGylZUtQofX1bOQQ7dsE/He3fbE+Ik/0XX1
559 ksOR1YqI0JDs3G3eicJlcZaLDQP9nL9bFqyS2+r+eXyt66/3FsvbzSUr5R/7mp/i
560 Ucw6UwxI5g69ybR2BlLmEROFcmMDBOAENisgGQLodKcftslWZvB1JdxnwQ5hYIiz
561 PtGo/KPaHbDRsSNU30R2be1B2MGyIrZTHN81Hdyhdyox5C315eXbyOD/5YDXC2Og
562 /zOhD7osFRXql7PSorW+8oyWHhqPHWykYTe5hnMz15eWniN9gqRMgeKh0bpnX5UH
563 oycR7hYQe7xFSkyyBNKr79X9DFHOUGoIMfmR2gyPZFwDwzqLID9ujWc9Otb+fVuI
564 yV77zGHcizN300QyNQliBJIWENieJ0f7OyHj+OsdWwIDAQABo4GwMIGtMA8GA1Ud
565 EwEB/wQFMAMBAf8wCwYDVR0PBAQDAgEGMB0GA1UdDgQWBBQahGK8SEwzJQTU7tD2
566 A8QZRtGUazBuBgNVHSMEZzBlgBQahGK8SEwzJQTU7tD2A8QZRtGUa6FJpEcwRTEL
567 MAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMT
568 ElF1b1ZhZGlzIFJvb3QgQ0EgMoICBQkwDQYJKoZIhvcNAQEFBQADggIBAD4KFk2f
569 BluornFdLwUvZ+YTRYPENvbzwCYMDbVHZF34tHLJRqUDGCdViXh9duqWNIAXINzn
570 g/iN/Ae42l9NLmeyhP3ZRPx3UIHmfLTJDQtyU/h2BwdBR5YM++CCJpNVjP4iH2Bl
571 fF/nJrP3MpCYUNQ3cVX2kiF495V5+vgtJodmVjB3pjd4M1IQWK4/YY7yarHvGH5K
572 WWPKjaJW1acvvFYfzznB4vsKqBUsfU16Y8Zsl0Q80m/DShcK+JDSV6IZUaUtl0Ha
573 B0+pUNqQjZRG4T7wlP0QADj1O+hA4bRuVhogzG9Yje0uRY/W6ZM/57Es3zrWIozc
574 hLsib9D45MY56QSIPMO661V6bYCZJPVsAfv4l7CUW+v90m/xd2gNNWQjrLhVoQPR
575 TUIZ3Ph1WVaj+ahJefivDrkRoHy3au000LYmYjgahwz46P0u05B/B5EqHdZ+XIWD
576 mbA4CD/pXvk1B+TJYm5Xf6dQlfe6yJvmjqIBxdZmv3lh8zwc4bmCXF2gw+nYSL0Z
577 ohEUGW6yhhtoPkg3Goi3XZZenMfvJ2II4pEZXNLxId26F0KCl3GBUzGpn/Z9Yr9y
578 4aOTHcyKJloJONDO1w2AFrR4pTqHTI2KpdVGl/IsELm8VCLAAVBpQ570su9t+Oza
579 8eOx79+Rj1QqCyXBJhnEUhAFZdWCEOrCMc0u
580 -----END CERTIFICATE-----
581
582 -----BEGIN CERTIFICATE-----
583 MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkG
584 A1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv
585 b3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAw
586 MDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9i
587 YWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYDVQQDExJHbG9iYWxT
588 aWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDaDuaZ
589 jc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavp
590 xy0Sy6scTHAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp
591 1Wrjsok6Vjk4bwY8iGlbKk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdG
592 snUOhugZitVtbNV4FpWi6cgKOOvyJBNPc1STE4U6G7weNLWLBYy5d4ux2x8gkasJ
593 U26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrXgzT/LCrBbBlDSgeF59N8
594 9iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8E
595 BTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0B
596 AQUFAAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOz
597 yj1hTdNGCbM+w6DjY1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE
598 38NflNUVyRRBnMRddWQVDf9VMOyGj/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymP
599 AbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhHhm4qxFYxldBniYUr+WymXUad
600 DKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveCX4XSQRjbgbME
601 HMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A==
602 -----END CERTIFICATE-----
603
604 -----BEGIN CERTIFICATE-----
605 MIIFsDCCA5igAwIBAgIQFci9ZUdcr7iXAF7kBtK8nTANBgkqhkiG9w0BAQUFADBe
606 MQswCQYDVQQGEwJUVzEjMCEGA1UECgwaQ2h1bmdod2EgVGVsZWNvbSBDby4sIEx0
607 ZC4xKjAoBgNVBAsMIWVQS0kgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAe
608 Fw0wNDEyMjAwMjMxMjdaFw0zNDEyMjAwMjMxMjdaMF4xCzAJBgNVBAYTAlRXMSMw
609 IQYDVQQKDBpDaHVuZ2h3YSBUZWxlY29tIENvLiwgTHRkLjEqMCgGA1UECwwhZVBL
610 SSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjANBgkqhkiG9w0BAQEF
611 AAOCAg8AMIICCgKCAgEA4SUP7o3biDN1Z82tH306Tm2d0y8U82N0ywEhajfqhFAH
612 SyZbCUNsIZ5qyNUD9WBpj8zwIuQf5/dqIjG3LBXy4P4AakP/h2XGtRrBp0xtInAh
613 ijHyl3SJCRImHJ7K2RKilTza6We/CKBk49ZCt0Xvl/T29de1ShUCWH2YWEtgvM3X
614 DZoTM1PRYfl61dd4s5oz9wCGzh1NlDivqOx4UXCKXBCDUSH3ET00hl7lSM2XgYI1
615 TBnsZfZrxQWh7kcT1rMhJ5QQCtkkO7q+RBNGMD+XPNjX12ruOzjjK9SXDrkb5wdJ
616 fzcq+Xd4z1TtW0ado4AOkUPB1ltfFLqfpo0kR0BZv3I4sjZsN/+Z0V0OWQqraffA
617 sgRFelQArr5T9rXn4fg8ozHSqf4hUmTFpmfwdQcGlBSBVcYn5AGPF8Fqcde+S/uU
618 WH1+ETOxQvdibBjWzwloPn9s9h6PYq2lY9sJpx8iQkEeb5mKPtf5P0B6ebClAZLS
619 nT0IFaUQAS2zMnaolQ2zepr7BxB4EW/hj8e6DyUadCrlHJhBmd8hh+iVBmoKs2pH
620 dmX2Os+PYhcZewoozRrSgx4hxyy/vv9haLdnG7t4TY3OZ+XkwY63I2binZB1NJip
621 NiuKmpS5nezMirH4JYlcWrYvjB9teSSnUmjDhDXiZo1jDiVN1Rmy5nk3pyKdVDEC
622 AwEAAaNqMGgwHQYDVR0OBBYEFB4M97Zn8uGSJglFwFU5Lnc/QkqiMAwGA1UdEwQF
623 MAMBAf8wOQYEZyoHAAQxMC8wLQIBADAJBgUrDgMCGgUAMAcGBWcqAwAABBRFsMLH
624 ClZ87lt4DJX5GFPBphzYEDANBgkqhkiG9w0BAQUFAAOCAgEACbODU1kBPpVJufGB
625 uvl2ICO1J2B01GqZNF5sAFPZn/KmsSQHRGoqxqWOeBLoR9lYGxMqXnmbnwoqZ6Yl
626 PwZpVnPDimZI+ymBV3QGypzqKOg4ZyYr8dW1P2WT+DZdjo2NQCCHGervJ8A9tDkP
627 JXtoUHRVnAxZfVo9QZQlUgjgRywVMRnVvwdVxrsStZf0X4OFunHB2WyBEXYKCrC/
628 gpf36j36+uwtqSiUO1bd0lEursC9CBWMd1I0ltabrNMdjmEPNXubrjlpC2JgQCA2
629 j6/7Nu4tCEoduL+bXPjqpRugc6bY+G7gMwRfaKonh+3ZwZCc7b3jajWvY9+rGNm6
630 5ulK6lCKD2GTHuItGeIwlDWSXQ62B68ZgI9HkFFLLk3dheLSClIKF5r8GrBQAuUB
631 o2M3IUxExJtRmREOc5wGj1QupyheRDmHVi03vYVElOEMSyycw5KFNGHLD7ibSkNS
632 /jQ6fbjpKdx2qcgw+BRxgMYeNkh0IkFch4LoGHGLQYlE535YW6i4jRPpp2zDR+2z
633 Gp1iro2C6pSe3VkQw63d4k3jMdXH7OjysP6SHhYKGvzZ8/gntsm+HbRsZJB/9OTE
634 W9c3rkIO3aQab3yIVMUWbuF6aC74Or8NpDyJO3inTmODBCEIZ43ygknQW/2xzQ+D
635 hNQ+IIX3Sj0rnP0qCglN6oH4EZw=
636 -----END CERTIFICATE-----
637
638 -----BEGIN CERTIFICATE-----
639 MIIEDzCCAvegAwIBAgIBADANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJVUzEl
640 MCMGA1UEChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMp
641 U3RhcmZpZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQw
642 NjI5MTczOTE2WhcNMzQwNjI5MTczOTE2WjBoMQswCQYDVQQGEwJVUzElMCMGA1UE
643 ChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMpU3RhcmZp
644 ZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEgMA0GCSqGSIb3
645 DQEBAQUAA4IBDQAwggEIAoIBAQC3Msj+6XGmBIWtDBFk385N78gDGIc/oav7PKaf
646 8MOh2tTYbitTkPskpD6E8J7oX+zlJ0T1KKY/e97gKvDIr1MvnsoFAZMej2YcOadN
647 +lq2cwQlZut3f+dZxkqZJRRU6ybH838Z1TBwj6+wRir/resp7defqgSHo9T5iaU0
648 X9tDkYI22WY8sbi5gv2cOj4QyDvvBmVmepsZGD3/cVE8MC5fvj13c7JdBmzDI1aa
649 K4UmkhynArPkPw2vCHmCuDY96pzTNbO8acr1zJ3o/WSNF4Azbl5KXZnJHoe0nRrA
650 1W4TNSNe35tfPe/W93bC6j67eA0cQmdrBNj41tpvi/JEoAGrAgEDo4HFMIHCMB0G
651 A1UdDgQWBBS/X7fRzt0fhvRbVazc1xDCDqmI5zCBkgYDVR0jBIGKMIGHgBS/X7fR
652 zt0fhvRbVazc1xDCDqmI56FspGowaDELMAkGA1UEBhMCVVMxJTAjBgNVBAoTHFN0
653 YXJmaWVsZCBUZWNobm9sb2dpZXMsIEluYy4xMjAwBgNVBAsTKVN0YXJmaWVsZCBD
654 bGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8w
655 DQYJKoZIhvcNAQEFBQADggEBAAWdP4id0ckaVaGsafPzWdqbAYcaT1epoXkJKtv3
656 L7IezMdeatiDh6GX70k1PncGQVhiv45YuApnP+yz3SFmH8lU+nLMPUxA2IGvd56D
657 eruix/U0F47ZEUD0/CwqTRV/p2JdLiXTAAsgGh1o+Re49L2L7ShZ3U0WixeDyLJl
658 xy16paq8U4Zt3VekyvggQQto8PT7dL5WXXp59fkdheMtlb71cZBDzI0fmgAKhynp
659 VSJYACPq4xJDKVtHCN2MQWplBqjlIapBtJUhlbl90TSrE9atvNziPTnNvT51cKEY
660 WQPJIrSPnNVeKtelttQKbfi3QBFGmh95DmK/D5fs4C8fF5Q=
661 -----END CERTIFICATE-----
662
663 -----BEGIN CERTIFICATE-----
664 MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJ
665 RTESMBAGA1UEChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYD
666 VQQDExlCYWx0aW1vcmUgQ3liZXJUcnVzdCBSb290MB4XDTAwMDUxMjE4NDYwMFoX
667 DTI1MDUxMjIzNTkwMFowWjELMAkGA1UEBhMCSUUxEjAQBgNVBAoTCUJhbHRpbW9y
668 ZTETMBEGA1UECxMKQ3liZXJUcnVzdDEiMCAGA1UEAxMZQmFsdGltb3JlIEN5YmVy
669 VHJ1c3QgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKMEuyKr
670 mD1X6CZymrV51Cni4eiVgLGw41uOKymaZN+hXe2wCQVt2yguzmKiYv60iNoS6zjr
671 IZ3AQSsBUnuId9Mcj8e6uYi1agnnc+gRQKfRzMpijS3ljwumUNKoUMMo6vWrJYeK
672 mpYcqWe4PwzV9/lSEy/CG9VwcPCPwBLKBsua4dnKM3p31vjsufFoREJIE9LAwqSu
673 XmD+tqYF/LTdB1kC1FkYmGP1pWPgkAx9XbIGevOF6uvUA65ehD5f/xXtabz5OTZy
674 dc93Uk3zyZAsuT3lySNTPx8kmCFcB5kpvcY67Oduhjprl3RjM71oGDHweI12v/ye
675 jl0qhqdNkNwnGjkCAwEAAaNFMEMwHQYDVR0OBBYEFOWdWTCCR1jMrPoIVDaGezq1
676 BE3wMBIGA1UdEwEB/wQIMAYBAf8CAQMwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3
677 DQEBBQUAA4IBAQCFDF2O5G9RaEIFoN27TyclhAO992T9Ldcw46QQF+vaKSm2eT92
678 9hkTI7gQCvlYpNRhcL0EYWoSihfVCr3FvDB81ukMJY2GQE/szKN+OMY3EU/t3Wgx
679 jkzSswF07r51XgdIGn9w/xZchMB5hbgF/X++ZRGjD8ACtPhSNzkE1akxehi/oCr0
680 Epn3o0WC4zxe9Z2etciefC7IpJ5OCBRLbf1wbWsaY71k5h+3zvDyny67G7fyUIhz
681 ksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9HRCwBXbsdtTLS
682 R9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp
683 -----END CERTIFICATE-----
684
685 -----BEGIN CERTIFICATE-----
686 MIIEMjCCAxqgAwIBAgIBATANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJHQjEb
687 MBkGA1UECAwSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRow
688 GAYDVQQKDBFDb21vZG8gQ0EgTGltaXRlZDEhMB8GA1UEAwwYQUFBIENlcnRpZmlj
689 YXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAwMFoXDTI4MTIzMTIzNTk1OVowezEL
690 MAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UE
691 BwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxITAfBgNVBAMM
692 GEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEP
693 ADCCAQoCggEBAL5AnfRu4ep2hxxNRUSOvkbIgwadwSr+GB+O5AL686tdUIoWMQua
694 BtDFcCLNSS1UY8y2bmhGC1Pqy0wkwLxyTurxFa70VJoSCsN6sjNg4tqJVfMiWPPe
695 3M/vg4aijJRPn2jymJBGhCfHdr/jzDUsi14HZGWCwEiwqJH5YZ92IFCokcdmtet4
696 YgNW8IoaE+oxox6gmf049vYnMlhvB/VruPsUK6+3qszWY19zjNoFmag4qMsXeDZR
697 rOme9Hg6jc8P2ULimAyrL58OAd7vn5lJ8S3frHRNG5i1R8XlKdH5kBjHYpy+g8cm
698 ez6KJcfA3Z3mNWgQIJ2P2N7Sw4ScDV7oL8kCAwEAAaOBwDCBvTAdBgNVHQ4EFgQU
699 oBEKIz6W8Qfs4q8p74Klf9AwpLQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQF
700 MAMBAf8wewYDVR0fBHQwcjA4oDagNIYyaHR0cDovL2NybC5jb21vZG9jYS5jb20v
701 QUFBQ2VydGlmaWNhdGVTZXJ2aWNlcy5jcmwwNqA0oDKGMGh0dHA6Ly9jcmwuY29t
702 b2RvLm5ldC9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2VzLmNybDANBgkqhkiG9w0BAQUF
703 AAOCAQEACFb8AvCb6P+k+tZ7xkSAzk/ExfYAWMymtrwUSWgEdujm7l3sAg9g1o1Q
704 GE8mTgHj5rCl7r+8dFRBv/38ErjHT1r0iWAFf2C3BUrz9vHCv8S5dIa2LX1rzNLz
705 Rt0vxuBqw8M0Ayx9lt1awg6nCpnBBYurDC/zXDrPbDdVCYfeU0BsWO/8tqtlbgT2
706 G9w84FoVxp7Z8VlIMCFlA2zs6SFz7JsDoeA3raAVGI/6ugLOpyypEBMs1OUIJqsi
707 l2D4kF501KKaU73yqWjgom7C12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3
708 smPi9WIsgtRqAEFQ8TmDn5XpNpaYbg==
709 -----END CERTIFICATE-----
710
711 -----BEGIN CERTIFICATE-----
712 MIICjTCCAhSgAwIBAgIIdebfy8FoW6gwCgYIKoZIzj0EAwIwfDELMAkGA1UEBhMC
713 VVMxDjAMBgNVBAgMBVRleGFzMRAwDgYDVQQHDAdIb3VzdG9uMRgwFgYDVQQKDA9T
714 U0wgQ29ycG9yYXRpb24xMTAvBgNVBAMMKFNTTC5jb20gUm9vdCBDZXJ0aWZpY2F0
715 aW9uIEF1dGhvcml0eSBFQ0MwHhcNMTYwMjEyMTgxNDAzWhcNNDEwMjEyMTgxNDAz
716 WjB8MQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMxEDAOBgNVBAcMB0hvdXN0
717 b24xGDAWBgNVBAoMD1NTTCBDb3Jwb3JhdGlvbjExMC8GA1UEAwwoU1NMLmNvbSBS
718 b290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IEVDQzB2MBAGByqGSM49AgEGBSuB
719 BAAiA2IABEVuqVDEpiM2nl8ojRfLliJkP9x6jh3MCLOicSS6jkm5BBtHllirLZXI
720 7Z4INcgn64mMU1jrYor+8FsPazFSY0E7ic3s7LaNGdM0B9y7xgZ/wkWV7Mt/qCPg
721 CemB+vNH06NjMGEwHQYDVR0OBBYEFILRhXMw5zUE044CkvvlpNHEIejNMA8GA1Ud
722 EwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUgtGFczDnNQTTjgKS++Wk0cQh6M0wDgYD
723 VR0PAQH/BAQDAgGGMAoGCCqGSM49BAMCA2cAMGQCMG/n61kRpGDPYbCWe+0F+S8T
724 kdzt5fxQaxFGRrMcIQBiu77D5+jNB5n5DQtdcj7EqgIwH7y6C+IwJPt8bYBVCpk+
725 gA0z5Wajs6O7pdWLjwkspl1+4vAHCGht0nxpbl/f5Wpl
726 -----END CERTIFICATE-----
727
728 -----BEGIN CERTIFICATE-----
729 MIIEKjCCAxKgAwIBAgIEOGPe+DANBgkqhkiG9w0BAQUFADCBtDEUMBIGA1UEChML
730 RW50cnVzdC5uZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5ldC9DUFNfMjA0OCBp
731 bmNvcnAuIGJ5IHJlZi4gKGxpbWl0cyBsaWFiLikxJTAjBgNVBAsTHChjKSAxOTk5
732 IEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNVBAMTKkVudHJ1c3QubmV0IENlcnRp
733 ZmljYXRpb24gQXV0aG9yaXR5ICgyMDQ4KTAeFw05OTEyMjQxNzUwNTFaFw0yOTA3
734 MjQxNDE1MTJaMIG0MRQwEgYDVQQKEwtFbnRydXN0Lm5ldDFAMD4GA1UECxQ3d3d3
735 LmVudHJ1c3QubmV0L0NQU18yMDQ4IGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxp
736 YWIuKTElMCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEG
737 A1UEAxMqRW50cnVzdC5uZXQgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgKDIwNDgp
738 MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArU1LqRKGsuqjIAcVFmQq
739 K0vRvwtKTY7tgHalZ7d4QMBzQshowNtTK91euHaYNZOLGp18EzoOH1u3Hs/lJBQe
740 sYGpjX24zGtLA/ECDNyrpUAkAH90lKGdCCmziAv1h3edVc3kw37XamSrhRSGlVuX
741 MlBvPci6Zgzj/L24ScF2iUkZ/cCovYmjZy/Gn7xxGWC4LeksyZB2ZnuU4q941mVT
742 XTzWnLLPKQP5L6RQstRIzgUyVYr9smRMDuSYB3Xbf9+5CFVghTAp+XtIpGmG4zU/
743 HoZdenoVve8AjhUiVBcAkCaTvA5JaJG/+EfTnZVCwQ5N328mz8MYIWJmQ3DW1cAH
744 4QIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNV
745 HQ4EFgQUVeSB0RGAvtiJuQijMfmhJAkWuXAwDQYJKoZIhvcNAQEFBQADggEBADub
746 j1abMOdTmXx6eadNl9cZlZD7Bh/KM3xGY4+WZiT6QBshJ8rmcnPyT/4xmf3IDExo
747 U8aAghOY+rat2l098c5u9hURlIIM7j+VrxGrD9cv3h8Dj1csHsm7mhpElesYT6Yf
748 zX1XEC+bBAlahLVu2B064dae0Wx5XnkcFMXj0EyTO2U87d89vqbllRrDtRnDvV5b
749 u/8j72gZyxKTJ1wDLW8w0B62GqzeWvfRqqgnpv55gcR5mTNXuhKwqeBCbJPKVt7+
750 bYQLCIt+jerXmCHG8+c8eS9enNFMFY3h7CI3zJpDC5fcgJCNs2ebb0gIFVbPv/Er
751 fF6adulZkMV8gzURZVE=
752 -----END CERTIFICATE-----
753
754 -----BEGIN CERTIFICATE-----
755 MIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCREUx
756 KzApBgNVBAoMIlQtU3lzdGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAd
757 BgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBDZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNl
758 YyBHbG9iYWxSb290IENsYXNzIDMwHhcNMDgxMDAxMTAyOTU2WhcNMzMxMDAxMjM1
759 OTU5WjCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoMIlQtU3lzdGVtcyBFbnRlcnBy
760 aXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBDZW50
761 ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDMwggEiMA0G
762 CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9dZPwYiJvJK7genasfb3ZJNW4t/zN
763 8ELg63iIVl6bmlQdTQyK9tPPcPRStdiTBONGhnFBSivwKixVA9ZIw+A5OO3yXDw/
764 RLyTPWGrTs0NvvAgJ1gORH8EGoel15YUNpDQSXuhdfsaa3Ox+M6pCSzyU9XDFES4
765 hqX2iys52qMzVNn6chr3IhUciJFrf2blw2qAsCTz34ZFiP0Zf3WHHx+xGwpzJFu5
766 ZeAsVMhg02YXP+HMVDNzkQI6pn97djmiH5a2OK61yJN0HZ65tOVgnS9W0eDrXltM
767 EnAMbEQgqxHY9Bn20pxSN+f6tsIxO0rUFJmtxxr1XV/6B7h8DR/Wgx6zAgMBAAGj
768 QjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBS1
769 A/d2O2GCahKqGFPrAyGUv/7OyjANBgkqhkiG9w0BAQsFAAOCAQEAVj3vlNW92nOy
770 WL6ukK2YJ5f+AbGwUgC4TeQbIXQbfsDuXmkqJa9c1h3a0nnJ85cp4IaH3gRZD/FZ
771 1GSFS5mvJQQeyUapl96Cshtwn5z2r3Ex3XsFpSzTucpH9sry9uetuUg/vBa3wW30
772 6gmv7PO15wWeph6KU1HWk4HMdJP2udqmJQV0eVp+QD6CSyYRMG7hP0HHRwA11fXT
773 91Q+gT3aSWqas+8QPebrb9HIIkfLzM8BMZLZGOMivgkeGj5asuRrDFR6fUNOuIml
774 e9eiPZaGzPImNC1qkp2aGtAw4l1OBLBfiyB+d8E9lYLRRpo7PHi4b6HQDWSieB4p
775 TpPDpFQUWw==
776 -----END CERTIFICATE-----
777
778 -----BEGIN CERTIFICATE-----
779 MIIFYDCCA0igAwIBAgIUeFhfLq0sGUvjNwc1NBMotZbUZZMwDQYJKoZIhvcNAQEL
780 BQAwSDELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAc
781 BgNVBAMTFVF1b1ZhZGlzIFJvb3QgQ0EgMSBHMzAeFw0xMjAxMTIxNzI3NDRaFw00
782 MjAxMTIxNzI3NDRaMEgxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM
783 aW1pdGVkMR4wHAYDVQQDExVRdW9WYWRpcyBSb290IENBIDEgRzMwggIiMA0GCSqG
784 SIb3DQEBAQUAA4ICDwAwggIKAoICAQCgvlAQjunybEC0BJyFuTHK3C3kEakEPBtV
785 wedYMB0ktMPvhd6MLOHBPd+C5k+tR4ds7FtJwUrVu4/sh6x/gpqG7D0DmVIB0jWe
786 rNrwU8lmPNSsAgHaJNM7qAJGr6Qc4/hzWHa39g6QDbXwz8z6+cZM5cOGMAqNF341
787 68Xfuw6cwI2H44g4hWf6Pser4BOcBRiYz5P1sZK0/CPTz9XEJ0ngnjybCKOLXSoh
788 4Pw5qlPafX7PGglTvF0FBM+hSo+LdoINofjSxxR3W5A2B4GbPgb6Ul5jxaYA/qXp
789 UhtStZI5cgMJYr2wYBZupt0lwgNm3fME0UDiTouG9G/lg6AnhF4EwfWQvTA9xO+o
790 abw4m6SkltFi2mnAAZauy8RRNOoMqv8hjlmPSlzkYZqn0ukqeI1RPToV7qJZjqlc
791 3sX5kCLliEVx3ZGZbHqfPT2YfF72vhZooF6uCyP8Wg+qInYtyaEQHeTTRCOQiJ/G
792 KubX9ZqzWB4vMIkIG1SitZgj7Ah3HJVdYdHLiZxfokqRmu8hqkkWCKi9YSgxyXSt
793 hfbZxbGL0eUQMk1fiyA6PEkfM4VZDdvLCXVDaXP7a3F98N/ETH3Goy7IlXnLc6KO
794 Tk0k+17kBL5yG6YnLUlamXrXXAkgt3+UuU/xDRxeiEIbEbfnkduebPRq34wGmAOt
795 zCjvpUfzUwIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIB
796 BjAdBgNVHQ4EFgQUo5fW816iEOGrRZ88F2Q87gFwnMwwDQYJKoZIhvcNAQELBQAD
797 ggIBABj6W3X8PnrHX3fHyt/PX8MSxEBd1DKquGrX1RUVRpgjpeaQWxiZTOOtQqOC
798 MTaIzen7xASWSIsBx40Bz1szBpZGZnQdT+3Btrm0DWHMY37XLneMlhwqI2hrhVd2
799 cDMT/uFPpiN3GPoajOi9ZcnPP/TJF9zrx7zABC4tRi9pZsMbj/7sPtPKlL92CiUN
800 qXsCHKnQO18LwIE6PWThv6ctTr1NxNgpxiIY0MWscgKCP6o6ojoilzHdCGPDdRS5
801 YCgtW2jgFqlmgiNR9etT2DGbe+m3nUvriBbP+V04ikkwj+3x6xn0dxoxGE1nVGwv
802 b2X52z3sIexe9PSLymBlVNFxZPT5pqOBMzYzcfCkeF9OrYMh3jRJjehZrJ3ydlo2
803 8hP0r+AJx2EqbPfgna67hkooby7utHnNkDPDs3b69fBsnQGQ+p6Q9pxyz0fawx/k
804 NSBT8lTR32GDpgLiJTjehTItXnOQUl1CxM49S+H5GYQd1aJQzEH7QRTDvdbJWqNj
805 ZgKAvQU6O0ec7AAmTPWIUb+oI38YB7AL7YsmoWTTYUrrXJ/es69nA7Mf3W1daWhp
806 q1467HxpvMc7hU6eFbm0FU/DlXpY18ls6Wy58yljXrQs8C097Vpl4KlbQMJImYFt
807 nh8GKjwStIsPm6Ik8KaN1nrgS7ZklmOVhMJKzRwuJIczYOXD
808 -----END CERTIFICATE-----
809
810 -----BEGIN CERTIFICATE-----
811 MIIFODCCAyCgAwIBAgIRAJW+FqD3LkbxezmCcvqLzZYwDQYJKoZIhvcNAQEFBQAw
812 NzEUMBIGA1UECgwLVGVsaWFTb25lcmExHzAdBgNVBAMMFlRlbGlhU29uZXJhIFJv
813 b3QgQ0EgdjEwHhcNMDcxMDE4MTIwMDUwWhcNMzIxMDE4MTIwMDUwWjA3MRQwEgYD
814 VQQKDAtUZWxpYVNvbmVyYTEfMB0GA1UEAwwWVGVsaWFTb25lcmEgUm9vdCBDQSB2
815 MTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMK+6yfwIaPzaSZVfp3F
816 VRaRXP3vIb9TgHot0pGMYzHw7CTww6XScnwQbfQ3t+XmfHnqjLWCi65ItqwA3GV1
817 7CpNX8GH9SBlK4GoRz6JI5UwFpB/6FcHSOcZrr9FZ7E3GwYq/t75rH2D+1665I+X
818 Z75Ljo1kB1c4VWk0Nj0TSO9P4tNmHqTPGrdeNjPUtAa9GAH9d4RQAEX1jF3oI7x+
819 /jXh7VB7qTCNGdMJjmhnXb88lxhTuylixcpecsHHltTbLaC0H2kD7OriUPEMPPCs
820 81Mt8Bz17Ww5OXOAFshSsCPN4D7c3TxHoLs1iuKYaIu+5b9y7tL6pe0S7fyYGKkm
821 dtwoSxAgHNN/Fnct7W+A90m7UwW7XWjH1Mh1Fj+JWov3F0fUTPHSiXk+TT2YqGHe
822 Oh7S+F4D4MHJHIzTjU3TlTazN19jY5szFPAtJmtTfImMMsJu7D0hADnJoWjiUIMu
823 sDor8zagrC/kb2HCUQk5PotTubtn2txTuXZZNp1D5SDgPTJghSJRt8czu90VL6R4
824 pgd7gUY2BIbdeTXHlSw7sKMXNeVzH7RcWe/a6hBle3rQf5+ztCo3O3CLm1u5K7fs
825 slESl1MpWtTwEhDcTwK7EpIvYtQ/aUN8Ddb8WHUBiJ1YFkveupD/RwGJBmr2X7KQ
826 arMCpgKIv7NHfirZ1fpoeDVNAgMBAAGjPzA9MA8GA1UdEwEB/wQFMAMBAf8wCwYD
827 VR0PBAQDAgEGMB0GA1UdDgQWBBTwj1k4ALP1j5qWDNXr+nuqF+gTEjANBgkqhkiG
828 9w0BAQUFAAOCAgEAvuRcYk4k9AwI//DTDGjkk0kiP0Qnb7tt3oNmzqjMDfz1mgbl
829 dxSR651Be5kqhOX//CHBXfDkH1e3damhXwIm/9fH907eT/j3HEbAek9ALCI18Bmx
830 0GtnLLCo4MBANzX2hFxc469CeP6nyQ1Q6g2EdvZR74NTxnr/DlZJLo961gzmJ1Tj
831 TQpgcmLNkQfWpb/ImWvtxBnmq0wROMVvMeJuScg/doAmAyYp4Db29iBT4xdwNBed
832 Y2gea+zDTYa4EzAvXUYNR0PVG6pZDrlcjQZIrXSHX8f8MVRBE+LHIQ6e4B4N4cB7
833 Q4WQxYpYxmUKeFfyxiMPAdkgS94P+5KFdSpcc41teyWRyu5FrgZLAMzTsVlQ2jqI
834 OylDRl6XK1TOU2+NSueW+r9xDkKLfP0ooNBIytrEgUy7onOTJsjrDNYmiLbAJM+7
835 vVvrdX3pCI6GMyx5dwlppYn8s3CQh3aP0yK7Qs69cwsgJirQmz1wHiRszYd2qReW
836 t88NkvuOGKmYSdGe/mBEciG5Ge3C9THxOUiIkCR1VBatzvT4aRRkOfujuLpwQMcn
837 HL/EVlP6Y2XQ8xwOFvVrhlhNGNTkDY6lnVuR3HYkUD/GKvvZt5y11ubQ2egZixVx
838 SK236thZiNSQvxaz2emsWWFUyBy6ysHK4bkgTI86k4mloMy/0/Z1pHWWbVY=
839 -----END CERTIFICATE-----
840
841 -----BEGIN CERTIFICATE-----
842 MIIDIDCCAgigAwIBAgIBHTANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJGSTEP
843 MA0GA1UEChMGU29uZXJhMRkwFwYDVQQDExBTb25lcmEgQ2xhc3MyIENBMB4XDTAx
844 MDQwNjA3Mjk0MFoXDTIxMDQwNjA3Mjk0MFowOTELMAkGA1UEBhMCRkkxDzANBgNV
845 BAoTBlNvbmVyYTEZMBcGA1UEAxMQU29uZXJhIENsYXNzMiBDQTCCASIwDQYJKoZI
846 hvcNAQEBBQADggEPADCCAQoCggEBAJAXSjWdyvANlsdE+hY3/Ei9vX+ALTU74W+o
847 Z6m/AxxNjG8yR9VBaKQTBME1DJqEQ/xcHf+Js+gXGM2RX/uJ4+q/Tl18GybTdXnt
848 5oTjV+WtKcT0OijnpXuENmmz/V52vaMtmdOQTiMofRhj8VQ7Jp12W5dCsv+u8E7s
849 3TmVToMGf+dJQMjFAbJUWmYdPfz56TwKnoG4cPABi+QjVHzIrviQHgCWctRUz2Ej
850 vOr7nQKV0ba5cTppCD8PtOFCx4j1P5iop7oc4HFx71hXgVB6XGt0Rg6DA5jDjqhu
851 8nYybieDwnPz3BjotJPqdURrBGAgcVeHnfO+oJAjPYok4doh28MCAwEAAaMzMDEw
852 DwYDVR0TAQH/BAUwAwEB/zARBgNVHQ4ECgQISqCqWITTXjwwCwYDVR0PBAQDAgEG
853 MA0GCSqGSIb3DQEBBQUAA4IBAQBazof5FnIVV0sd2ZvnoiYw7JNn39Yt0jSv9zil
854 zqsWuasvfDXLrNAPtEwr/IDva4yRXzZ299uzGxnq9LIR/WFxRL8oszodv7ND6J+/
855 3DEIcbCdjdY0RzKQxmUk96BKfARzjzlvF4xytb1LyHr4e4PDKE6cCepnP7JnBBvD
856 FNr450kkkdAdavphOe9r5yF1BgfYErQhIHBCcYHaPJo2vqZbDWpsmh+Re/n570K6
857 Tk6ezAyNlNzZRZxe7EJQY670XcSxEtzKO6gunRRaBXW37Ndj4ro1tgQIkejanZz2
858 ZrUYrAqmVCY0M9IbwdR/GjqOC6oybtv8TyWf2TLHllpwrN9M
859 -----END CERTIFICATE-----
860
861 -----BEGIN CERTIFICATE-----
862 MIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG9w0BAQsF
863 ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6
864 b24gUm9vdCBDQSAxMB4XDTE1MDUyNjAwMDAwMFoXDTM4MDExNzAwMDAwMFowOTEL
865 MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJv
866 b3QgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJ4gHHKeNXj
867 ca9HgFB0fW7Y14h29Jlo91ghYPl0hAEvrAIthtOgQ3pOsqTQNroBvo3bSMgHFzZM
868 9O6II8c+6zf1tRn4SWiw3te5djgdYZ6k/oI2peVKVuRF4fn9tBb6dNqcmzU5L/qw
869 IFAGbHrQgLKm+a/sRxmPUDgH3KKHOVj4utWp+UhnMJbulHheb4mjUcAwhmahRWa6
870 VOujw5H5SNz/0egwLX0tdHA114gk957EWW67c4cX8jJGKLhD+rcdqsq08p8kDi1L
871 93FcXmn/6pUCyziKrlA4b9v7LWIbxcceVOF34GfID5yHI9Y/QCB/IIDEgEw+OyQm
872 jgSubJrIqg0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC
873 AYYwHQYDVR0OBBYEFIQYzIU07LwMlJQuCFmcx7IQTgoIMA0GCSqGSIb3DQEBCwUA
874 A4IBAQCY8jdaQZChGsV2USggNiMOruYou6r4lK5IpDB/G/wkjUu0yKGX9rbxenDI
875 U5PMCCjjmCXPI6T53iHTfIUJrU6adTrCC2qJeHZERxhlbI1Bjjt/msv0tadQ1wUs
876 N+gDS63pYaACbvXy8MWy7Vu33PqUXHeeE6V/Uq2V8viTO96LXFvKWlJbYK8U90vv
877 o/ufQJVtMVT8QtPHRh8jrdkPSHCa2XV4cdFyQzR1bldZwgJcJmApzyMZFo6IQ6XU
878 5MsI+yMRQ+hDKXJioaldXgjUkK642M4UwtBV8ob2xJNDd2ZhwLnoQdeXeGADbkpy
879 rqXRfboQnoZsG4q5WTP468SQvvG5
880 -----END CERTIFICATE-----
881
882 -----BEGIN CERTIFICATE-----
883 MIICRjCCAc2gAwIBAgIQC6Fa+h3foLVJRK/NJKBs7DAKBggqhkjOPQQDAzBlMQsw
884 CQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cu
885 ZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3Qg
886 RzMwHhcNMTMwODAxMTIwMDAwWhcNMzgwMTE1MTIwMDAwWjBlMQswCQYDVQQGEwJV
887 UzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQu
888 Y29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzMwdjAQBgcq
889 hkjOPQIBBgUrgQQAIgNiAAQZ57ysRGXtzbg/WPuNsVepRC0FFfLvC/8QdJ+1YlJf
890 Zn4f5dwbRXkLzMZTCp2NXQLZqVneAlr2lSoOjThKiknGvMYDOAdfVdp+CW7if17Q
891 RSAPWXYQ1qAk8C3eNvJsKTmjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/
892 BAQDAgGGMB0GA1UdDgQWBBTL0L2p4ZgFUaFNN6KDec6NHSrkhDAKBggqhkjOPQQD
893 AwNnADBkAjAlpIFFAmsSS3V0T8gj43DydXLefInwz5FyYZ5eEJJZVrmDxxDnOOlY
894 JjZ91eQ0hjkCMHw2U/Aw5WJjOpnitqM7mzT6HtoQknFekROn3aRukswy1vUhZscv
895 6pZjamVFkpUBtA==
896 -----END CERTIFICATE-----
897
898 -----BEGIN CERTIFICATE-----
899 MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEU
900 MBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFs
901 IFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290
902 MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFowbzELMAkGA1UEBhMCU0Ux
903 FDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRUcnVzdCBFeHRlcm5h
904 bCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0EgUm9v
905 dDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvt
906 H7xsD821+iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9
907 uMq/NzgtHj6RQa1wVsfwTz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzX
908 mk6vBbOmcZSccbNQYArHE504B4YCqOmoaSYYkKtMsE8jqzpPhNjfzp/haW+710LX
909 a0Tkx63ubUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy2xSoRcRdKn23tNbE7qzN
910 E0S3ySvdQwAl+mG5aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv77+ldU9U0
911 WicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYD
912 VR0PBAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0
913 Jvf6xCZU7wO94CTLVBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRU
914 cnVzdCBBQjEmMCQGA1UECxMdQWRkVHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsx
915 IjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENBIFJvb3SCAQEwDQYJKoZIhvcN
916 AQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZlj7DYd7usQWxH
917 YINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5
918 6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvC
919 Nr4TDea9Y355e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEX
920 c4g/VhsxOBi0cQ+azcgOno4uG+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5a
921 mnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ=
922 -----END CERTIFICATE-----
923
924 -----BEGIN CERTIFICATE-----
925 MIICHjCCAaSgAwIBAgIRYFlJ4CYuu1X5CneKcflK2GwwCgYIKoZIzj0EAwMwUDEk
926 MCIGA1UECxMbR2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI1MRMwEQYDVQQKEwpH
927 bG9iYWxTaWduMRMwEQYDVQQDEwpHbG9iYWxTaWduMB4XDTEyMTExMzAwMDAwMFoX
928 DTM4MDExOTAzMTQwN1owUDEkMCIGA1UECxMbR2xvYmFsU2lnbiBFQ0MgUm9vdCBD
929 QSAtIFI1MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQDEwpHbG9iYWxTaWdu
930 MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAER0UOlvt9Xb/pOdEh+J8LttV7HpI6SFkc
931 8GIxLcB6KP4ap1yztsyX50XUWPrRd21DosCHZTQKH3rd6zwzocWdTaRvQZU4f8ke
932 hOvRnkmSh5SHDDqFSmafnVmTTZdhBoZKo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYD
933 VR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUPeYpSJvqB8ohREom3m7e0oPQn1kwCgYI
934 KoZIzj0EAwMDaAAwZQIxAOVpEslu28YxuglB4Zf4+/2a4n0Sye18ZNPLBSWLVtmg
935 515dTguDnFt2KaAJJiFqYgIwcdK1j1zqO+F4CYWodZI7yFz9SO8NdCKoCOJuxUnO
936 xwy8p2Fp8fc74SrL+SvzZpA3
937 -----END CERTIFICATE-----
938
939 -----BEGIN CERTIFICATE-----
940 MIIHTzCCBTegAwIBAgIJAKPaQn6ksa7aMA0GCSqGSIb3DQEBBQUAMIGuMQswCQYD
941 VQQGEwJFVTFDMEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0
942 IHd3dy5jYW1lcmZpcm1hLmNvbS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3
943 MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMuQS4xKTAnBgNVBAMTIENoYW1iZXJz
944 IG9mIENvbW1lcmNlIFJvb3QgLSAyMDA4MB4XDTA4MDgwMTEyMjk1MFoXDTM4MDcz
945 MTEyMjk1MFowga4xCzAJBgNVBAYTAkVVMUMwQQYDVQQHEzpNYWRyaWQgKHNlZSBj
946 dXJyZW50IGFkZHJlc3MgYXQgd3d3LmNhbWVyZmlybWEuY29tL2FkZHJlc3MpMRIw
947 EAYDVQQFEwlBODI3NDMyODcxGzAZBgNVBAoTEkFDIENhbWVyZmlybWEgUy5BLjEp
948 MCcGA1UEAxMgQ2hhbWJlcnMgb2YgQ29tbWVyY2UgUm9vdCAtIDIwMDgwggIiMA0G
949 CSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCvAMtwNyuAWko6bHiUfaN/Gh/2NdW9
950 28sNRHI+JrKQUrpjOyhYb6WzbZSm891kDFX29ufyIiKAXuFixrYp4YFs8r/lfTJq
951 VKAyGVn+H4vXPWCGhSRv4xGzdz4gljUha7MI2XAuZPeEklPWDrCQiorjh40G072Q
952 DuKZoRuGDtqaCrsLYVAGUvGef3bsyw/QHg3PmTA9HMRFEFis1tPo1+XqxQEHd9ZR
953 5gN/ikilTWh1uem8nk4ZcfUyS5xtYBkL+8ydddy/Js2Pk3g5eXNeJQ7KXOt3EgfL
954 ZEFHcpOrUMPrCXZkNNI5t3YRCQ12RcSprj1qr7V9ZS+UWBDsXHyvfuK2GNnQm05a
955 Sd+pZgvMPMZ4fKecHePOjlO+Bd5gD2vlGts/4+EhySnB8esHnFIbAURRPHsl18Tl
956 UlRdJQfKFiC4reRB7noI/plvg6aRArBsNlVq5331lubKgdaX8ZSD6e2wsWsSaR6s
957 +12pxZjptFtYer49okQ6Y1nUCyXeG0+95QGezdIp1Z8XGQpvvwyQ0wlf2eOKNcx5
958 Wk0ZN5K3xMGtr/R5JJqyAQuxr1yW84Ay+1w9mPGgP0revq+ULtlVmhduYJ1jbLhj
959 ya6BXBg14JC7vjxPNyK5fuvPnnchpj04gftI2jE9K+OJ9dC1vX7gUMQSibMjmhAx
960 hduub+84Mxh2EQIDAQABo4IBbDCCAWgwEgYDVR0TAQH/BAgwBgEB/wIBDDAdBgNV
961 HQ4EFgQU+SSsD7K1+HnA+mCIG8TZTQKeFxkwgeMGA1UdIwSB2zCB2IAU+SSsD7K1
962 +HnA+mCIG8TZTQKeFxmhgbSkgbEwga4xCzAJBgNVBAYTAkVVMUMwQQYDVQQHEzpN
963 YWRyaWQgKHNlZSBjdXJyZW50IGFkZHJlc3MgYXQgd3d3LmNhbWVyZmlybWEuY29t
964 L2FkZHJlc3MpMRIwEAYDVQQFEwlBODI3NDMyODcxGzAZBgNVBAoTEkFDIENhbWVy
965 ZmlybWEgUy5BLjEpMCcGA1UEAxMgQ2hhbWJlcnMgb2YgQ29tbWVyY2UgUm9vdCAt
966 IDIwMDiCCQCj2kJ+pLGu2jAOBgNVHQ8BAf8EBAMCAQYwPQYDVR0gBDYwNDAyBgRV
967 HSAAMCowKAYIKwYBBQUHAgEWHGh0dHA6Ly9wb2xpY3kuY2FtZXJmaXJtYS5jb20w
968 DQYJKoZIhvcNAQEFBQADggIBAJASryI1wqM58C7e6bXpeHxIvj99RZJe6dqxGfwW
969 PJ+0W2aeaufDuV2I6A+tzyMP3iU6XsxPpcG1Lawk0lgH3qLPaYRgM+gQDROpI9CF
970 5Y57pp49chNyM/WqfcZjHwj0/gF/JM8rLFQJ3uIrbZLGOU8W6jx+ekbURWpGqOt1
971 glanq6B8aBMz9p0w8G8nOSQjKpD9kCk18pPfNKXG9/jvjA9iSnyu0/VU+I22mlaH
972 FoI6M6taIgj3grrqLuBHmrS1RaMFO9ncLkVAO+rcf+g769HsJtg1pDDFOqxXnrN2
973 pSB7+R5KBWIBpih1YJeSDW4+TTdDDZIVnBgizVGZoCkaPF+KMjNbMMeJL0eYD6MD
974 xvbxrN8y8NmBGuScvfaAFPDRLLmF9dijscilIeUcE5fuDr3fKanvNFNb0+RqE4QG
975 tjICxFKuItLcsiFCGtpA8CnJ7AoMXOLQusxI0zcKzBIKinmwPQN/aUv0NCB9szTq
976 jktk9T79syNnFQ0EuPAtwQlRPLJsFfClI9eDdOTlLsn+mCdCxqvGnrDQWzilm1De
977 fhiYtUU79nm06PcaewaD+9CL2rvHvRirCG88gGtAPxkZumWK5r7VXNM21+9AUiRg
978 OGcEMeyP84LG3rlV8zsxkVrctQgVrXYlCg17LofiDKYGvCYQbTed7N14jHyAxfDZ
979 d0jQ
980 -----END CERTIFICATE-----
981
982 -----BEGIN CERTIFICATE-----
983 MIIDAjCCAmsCEH3Z/gfPqB63EHln+6eJNMYwDQYJKoZIhvcNAQEFBQAwgcExCzAJ
984 BgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xh
985 c3MgMyBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcy
986 MTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3Jp
987 emVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMB4X
988 DTk4MDUxODAwMDAwMFoXDTI4MDgwMTIzNTk1OVowgcExCzAJBgNVBAYTAlVTMRcw
989 FQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMyBQdWJsaWMg
990 UHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEo
991 YykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5
992 MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMIGfMA0GCSqGSIb3DQEB
993 AQUAA4GNADCBiQKBgQDMXtERXVxp0KvTuWpMmR9ZmDCOFoUgRm1HP9SFIIThbbP4
994 pO0M8RcPO/mn+SXXwc+EY/J8Y8+iR/LGWzOOZEAEaMGAuWQcRXfH2G71lSk8UOg0
995 13gfqLptQ5GVj0VXXn7F+8qkBOvqlzdUMG+7AUcyM83cV5tkaWH4mx0ciU9cZwID
996 AQABMA0GCSqGSIb3DQEBBQUAA4GBAFFNzb5cy5gZnBWyATl4Lk0PZ3BwmcYQWpSk
997 U01UbSuvDV1Ai2TT1+7eVmGSX6bEHRBhNtMsJzzoKQm5EWR0zLVznxxIqbxhAe7i
998 F6YM40AIOw7n60RzKprxaZLvcRTDOaxxp5EJb+RxBrO6WVcmeQD2+A2iMzAo1KpY
999 oJ2daZH9
1000 -----END CERTIFICATE-----
1001
1002 -----BEGIN CERTIFICATE-----
1003 MIIFZjCCA06gAwIBAgIQCgFCgAAAAUUjz0Z8AAAAAjANBgkqhkiG9w0BAQsFADBN
1004 MQswCQYDVQQGEwJVUzESMBAGA1UEChMJSWRlblRydXN0MSowKAYDVQQDEyFJZGVu
1005 VHJ1c3QgUHVibGljIFNlY3RvciBSb290IENBIDEwHhcNMTQwMTE2MTc1MzMyWhcN
1006 MzQwMTE2MTc1MzMyWjBNMQswCQYDVQQGEwJVUzESMBAGA1UEChMJSWRlblRydXN0
1007 MSowKAYDVQQDEyFJZGVuVHJ1c3QgUHVibGljIFNlY3RvciBSb290IENBIDEwggIi
1008 MA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC2IpT8pEiv6EdrCvsnduTyP4o7
1009 ekosMSqMjbCpwzFrqHd2hCa2rIFCDQjrVVi7evi8ZX3yoG2LqEfpYnYeEe4IFNGy
1010 RBb06tD6Hi9e28tzQa68ALBKK0CyrOE7S8ItneShm+waOh7wCLPQ5CQ1B5+ctMlS
1011 bdsHyo+1W/CD80/HLaXIrcuVIKQxKFdYWuSNG5qrng0M8gozOSI5Cpcu81N3uURF
1012 /YTLNiCBWS2ab21ISGHKTN9T0a9SvESfqy9rg3LvdYDaBjMbXcjaY8ZNzaxmMc3R
1013 3j6HEDbhuaR672BQssvKplbgN6+rNBM5Jeg5ZuSYeqoSmJxZZoY+rfGwyj4GD3vw
1014 EUs3oERte8uojHH01bWRNszwFcYr3lEXsZdMUD2xlVl8BX0tIdUAvwFnol57plzy
1015 9yLxkA2T26pEUWbMfXYD62qoKjgZl3YNa4ph+bz27nb9cCvdKTz4Ch5bQhyLVi9V
1016 GxyhLrXHFub4qjySjmm2AcG1hp2JDws4lFTo6tyePSW8Uybt1as5qsVATFSrsrTZ
1017 2fjXctscvG29ZV/viDUqZi/u9rNl8DONfJhBaUYPQxxp+pu10GFqzcpL2UyQRqsV
1018 WaFHVCkugyhfHMKiq3IXAAaOReyL4jM9f9oZRORicsPfIsbyVtTdX5Vy7W1f90gD
1019 W/3FKqD2cyOEEBsB5wIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/
1020 BAUwAwEB/zAdBgNVHQ4EFgQU43HgntinQtnbcZFrlJPrw6PRFKMwDQYJKoZIhvcN
1021 AQELBQADggIBAEf63QqwEZE4rU1d9+UOl1QZgkiHVIyqZJnYWv6IAcVYpZmxI1Qj
1022 t2odIFflAWJBF9MJ23XLblSQdf4an4EKwt3X9wnQW3IV5B4Jaj0z8yGa5hV+rVHV
1023 DRDtfULAj+7AmgjVQdZcDiFpboBhDhXAuM/FSRJSzL46zNQuOAXeNf0fb7iAaJg9
1024 TaDKQGXSc3z1i9kKlT/YPyNtGtEqJBnZhbMX73huqVjRI9PHE+1yJX9dsXNw0H8G
1025 lwmEKYBhHfpe/3OsoOOJuBxxFcbeMX8S3OFtm6/n6J91eEyrRjuazr8FGF1NFTwW
1026 mhlQBJqymm9li1JfPFgEKCXAZmExfrngdbkaqIHWchezxQMxNRF4eKLg6TCMf4Df
1027 WN88uieW4oA0beOY02QnrEh+KHdcxiVhJfiFDGX6xDIvpZgF5PgLZxYWxoK4Mhn5
1028 +bl53B/N66+rDt0b20XkeucC4pVd/GnwU2lhlXV5C15V5jgclKlZM57IcXR5f1GJ
1029 tshquDDIajjDbp7hNxbqBWJMWxJH7ae0s1hWx0nzfxJoCTFx8G34Tkf71oXuxVhA
1030 GaQdp/lLQzfcaFpPz+vCZHTetBXZ9FRUGi8c15dxVJCO2SCdUyt/q4/i6jC8UDfv
1031 8Ue1fXwsBOxonbRJRBD0ckscZOf85muQ3Wl9af0AVqW3rLatt8o+Ae+c
1032 -----END CERTIFICATE-----
1033
1034 -----BEGIN CERTIFICATE-----
1035 MIICrjCCAjWgAwIBAgIQPLL0SAoA4v7rJDteYD7DazAKBggqhkjOPQQDAzCBmDEL
1036 MAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChj
1037 KSAyMDA3IEdlb1RydXN0IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2
1038 MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0
1039 eSAtIEcyMB4XDTA3MTEwNTAwMDAwMFoXDTM4MDExODIzNTk1OVowgZgxCzAJBgNV
1040 BAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAoYykgMjAw
1041 NyBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNV
1042 BAMTLUdlb1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBH
1043 MjB2MBAGByqGSM49AgEGBSuBBAAiA2IABBWx6P0DFUPlrOuHNxFi79KDNlJ9RVcL
1044 So17VDs6bl8VAsBQps8lL33KSLjHUGMcKiEIfJo22Av+0SbFWDEwKCXzXV2juLal
1045 tJLtbCyf691DiaI8S0iRHVDsJt/WYC69IaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAO
1046 BgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBVfNVdRVfslsq0DafwBo/q+EVXVMAoG
1047 CCqGSM49BAMDA2cAMGQCMGSWWaboCd6LuvpaiIjwH5HTRqjySkwCY/tsXzjbLkGT
1048 qQ7mndwxHLKgpxgceeHHNgIwOlavmnRs9vuD4DPTCF+hnMJbn0bWtsuRBmOiBucz
1049 rD6ogRLQy7rQkgu2npaqBA+K
1050 -----END CERTIFICATE-----
1051
1052 -----BEGIN CERTIFICATE-----
1053 MIIEMDCCAxigAwIBAgIQUJRs7Bjq1ZxN1ZfvdY+grTANBgkqhkiG9w0BAQUFADCB
1054 gjELMAkGA1UEBhMCVVMxHjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEk
1055 MCIGA1UEChMbWFJhbXAgU2VjdXJpdHkgU2VydmljZXMgSW5jMS0wKwYDVQQDEyRY
1056 UmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQxMTAxMTcx
1057 NDA0WhcNMzUwMTAxMDUzNzE5WjCBgjELMAkGA1UEBhMCVVMxHjAcBgNVBAsTFXd3
1058 dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2VjdXJpdHkgU2Vy
1059 dmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBB
1060 dXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCYJB69FbS6
1061 38eMpSe2OAtp87ZOqCwuIR1cRN8hXX4jdP5efrRKt6atH67gBhbim1vZZ3RrXYCP
1062 KZ2GG9mcDZhtdhAoWORlsH9KmHmf4MMxfoArtYzAQDsRhtDLooY2YKTVMIJt2W7Q
1063 DxIEM5dfT2Fa8OT5kavnHTu86M/0ay00fOJIYRyO82FEzG+gSqmUsE3a56k0enI4
1064 qEHMPJQRfevIpoy3hsvKMzvZPTeL+3o+hiznc9cKV6xkmxnr9A8ECIqsAxcZZPRa
1065 JSKNNCyy9mgdEm3Tih4U2sSPpuIjhdV6Db1q4Ons7Be7QhtnqiXtRYMh/MHJfNVi
1066 PvryxS3T/dRlAgMBAAGjgZ8wgZwwEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0P
1067 BAQDAgGGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFMZPoj0GY4QJnM5i5ASs
1068 jVy16bYbMDYGA1UdHwQvMC0wK6ApoCeGJWh0dHA6Ly9jcmwueHJhbXBzZWN1cml0
1069 eS5jb20vWEdDQS5jcmwwEAYJKwYBBAGCNxUBBAMCAQEwDQYJKoZIhvcNAQEFBQAD
1070 ggEBAJEVOQMBG2f7Shz5CmBbodpNl2L5JFMn14JkTpAuw0kbK5rc/Kh4ZzXxHfAR
1071 vbdI4xD2Dd8/0sm2qlWkSLoC295ZLhVbO50WfUfXN+pfTXYSNrsf16GBBEYgoyxt
1072 qZ4Bfj8pzgCT3/3JknOJiWSe5yvkHJEs0rnOfc5vMZnT5r7SHpDwCRR5XCOrTdLa
1073 IR9NmXmd4c8nnxCbHIgNsIpkQTG4DmyQJKSbXHGPurt+HBvbaoAPIbzp26a3QPSy
1074 i6mx5O+aGtA9aZnuqCij4Tyz8LIRnM98QObd50N9otg6tamN8jSZxNQQ4Qb9CYQQ
1075 O+7ETPTsJ3xCwnR8gooJybQDJbw=
1076 -----END CERTIFICATE-----
1077
1078 -----BEGIN CERTIFICATE-----
1079 MIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJOTzEd
1080 MBsGA1UECgwUQnV5cGFzcyBBUy05ODMxNjMzMjcxIDAeBgNVBAMMF0J1eXBhc3Mg
1081 Q2xhc3MgMyBSb290IENBMB4XDTEwMTAyNjA4Mjg1OFoXDTQwMTAyNjA4Mjg1OFow
1082 TjELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBhc3MgQVMtOTgzMTYzMzI3MSAw
1083 HgYDVQQDDBdCdXlwYXNzIENsYXNzIDMgUm9vdCBDQTCCAiIwDQYJKoZIhvcNAQEB
1084 BQADggIPADCCAgoCggIBAKXaCpUWUOOV8l6ddjEGMnqb8RB2uACatVI2zSRHsJ8Y
1085 ZLya9vrVediQYkwiL944PdbgqOkcLNt4EemOaFEVcsfzM4fkoF0LXOBXByow9c3E
1086 N3coTRiR5r/VUv1xLXA+58bEiuPwKAv0dpihi4dVsjoT/Lc+JzeOIuOoTyrvYLs9
1087 tznDDgFHmV0ST9tD+leh7fmdvhFHJlsTmKtdFoqwNxxXnUX/iJY2v7vKB3tvh2PX
1088 0DJq1l1sDPGzbjniazEuOQAnFN44wOwZZoYS6J1yFhNkUsepNxz9gjDthBgd9K5c
1089 /3ATAOux9TN6S9ZV+AWNS2mw9bMoNlwUxFFzTWsL8TQH2xc519woe2v1n/MuwU8X
1090 KhDzzMro6/1rqy6any2CbgTUUgGTLT2G/H783+9CHaZr77kgxve9oKeV/afmiSTY
1091 zIw0bOIjL9kSGiG5VZFvC5F5GQytQIgLcOJ60g7YaEi7ghM5EFjp2CoHxhLbWNvS
1092 O1UQRwUVZ2J+GGOmRj8JDlQyXr8NYnon74Do29lLBlo3WiXQCBJ31G8JUJc9yB3D
1093 34xFMFbG02SrZvPAXpacw8Tvw3xrizp5f7NJzz3iiZ+gMEuFuZyUJHmPfWupRWgP
1094 K9Dx2hzLabjKSWJtyNBjYt1gD1iqj6G8BaVmos8bdrKEZLFMOVLAMLrwjEsCsLa3
1095 AgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFEe4zf/lb+74suwv
1096 Tg75JbCOPGvDMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAgEAACAj
1097 QTUEkMJAYmDv4jVM1z+s4jSQuKFvdvoWFqRINyzpkMLyPPgKn9iB5btb2iUspKdV
1098 cSQy9sgL8rxq+JOssgfCX5/bzMiKqr5qb+FJEMwx14C7u8jYog5kV+qi9cKpMRXS
1099 IGrs/CIBKM+GuIAeqcwRpTzyFrNHnfzSgCHEy9BHcEGhyoMZCCxt8l13nIoUE9Q2
1100 HJLw5QY33KbmkJs4j1xrG0aGQ0JfPgEHU1RdZX33inOhmlRaHylDFCfChQ+1iHsa
1101 O5S3HWCntZznKWlXWpuTekMwGwPXYshApqr8ZORK15FTAaggiG6cX0S5y2CBNOxv
1102 033aSF/rtJC8LakcC6wc1aJoIIAE1vyxjy+7SjENSoYc6+I2KSb12tjE8nVhz36u
1103 dmNKekBlk4f4HoCMhuWG1o8O/FMsYOgWYRqiPkN7zTlgVGr18okmAWiDSKIz6MkE
1104 kbIRNBE+6tBDGR8Dk5AM/1E9V/RBbuHLoL7ryWPNbczk+DaqaJ3tvV2XcEQNtg41
1105 3OEMXbugUZTLfhbrES+jkkXITHHZvMmZUldGL1DPvTVp9D0VzgalLA8+9oG6lLvD
1106 u79leNKGef9JOxqDDPDeeOzI8k1MGt6CKfjBWtrt7uYnXuhF0J0cUahoq0Tj0Itq
1107 4/g7u9xN12TyUb7mqqta6THuBrxzvxNiCp/HuZc=
1108 -----END CERTIFICATE-----
1109
1110 -----BEGIN CERTIFICATE-----
1111 MIIFQTCCAymgAwIBAgITBmyf0pY1hp8KD+WGePhbJruKNzANBgkqhkiG9w0BAQwF
1112 ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6
1113 b24gUm9vdCBDQSAyMB4XDTE1MDUyNjAwMDAwMFoXDTQwMDUyNjAwMDAwMFowOTEL
1114 MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJv
1115 b3QgQ0EgMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAK2Wny2cSkxK
1116 gXlRmeyKy2tgURO8TW0G/LAIjd0ZEGrHJgw12MBvIITplLGbhQPDW9tK6Mj4kHbZ
1117 W0/jTOgGNk3Mmqw9DJArktQGGWCsN0R5hYGCrVo34A3MnaZMUnbqQ523BNFQ9lXg
1118 1dKmSYXpN+nKfq5clU1Imj+uIFptiJXZNLhSGkOQsL9sBbm2eLfq0OQ6PBJTYv9K
1119 8nu+NQWpEjTj82R0Yiw9AElaKP4yRLuH3WUnAnE72kr3H9rN9yFVkE8P7K6C4Z9r
1120 2UXTu/Bfh+08LDmG2j/e7HJV63mjrdvdfLC6HM783k81ds8P+HgfajZRRidhW+me
1121 z/CiVX18JYpvL7TFz4QuK/0NURBs+18bvBt+xa47mAExkv8LV/SasrlX6avvDXbR
1122 8O70zoan4G7ptGmh32n2M8ZpLpcTnqWHsFcQgTfJU7O7f/aS0ZzQGPSSbtqDT6Zj
1123 mUyl+17vIWR6IF9sZIUVyzfpYgwLKhbcAS4y2j5L9Z469hdAlO+ekQiG+r5jqFoz
1124 7Mt0Q5X5bGlSNscpb/xVA1wf+5+9R+vnSUeVC06JIglJ4PVhHvG/LopyboBZ/1c6
1125 +XUyo05f7O0oYtlNc/LMgRdg7c3r3NunysV+Ar3yVAhU/bQtCSwXVEqY0VThUWcI
1126 0u1ufm8/0i2BWSlmy5A5lREedCf+3euvAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMB
1127 Af8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBSwDPBMMPQFWAJI/TPlUq9LhONm
1128 UjANBgkqhkiG9w0BAQwFAAOCAgEAqqiAjw54o+Ci1M3m9Zh6O+oAA7CXDpO8Wqj2
1129 LIxyh6mx/H9z/WNxeKWHWc8w4Q0QshNabYL1auaAn6AFC2jkR2vHat+2/XcycuUY
1130 +gn0oJMsXdKMdYV2ZZAMA3m3MSNjrXiDCYZohMr/+c8mmpJ5581LxedhpxfL86kS
1131 k5Nrp+gvU5LEYFiwzAJRGFuFjWJZY7attN6a+yb3ACfAXVU3dJnJUH/jWS5E4ywl
1132 7uxMMne0nxrpS10gxdr9HIcWxkPo1LsmmkVwXqkLN1PiRnsn/eBG8om3zEK2yygm
1133 btmlyTrIQRNg91CMFa6ybRoVGld45pIq2WWQgj9sAq+uEjonljYE1x2igGOpm/Hl
1134 urR8FLBOybEfdF849lHqm/osohHUqS0nGkWxr7JOcQ3AWEbWaQbLU8uz/mtBzUF+
1135 fUwPfHJ5elnNXkoOrJupmHN5fLT0zLm4BwyydFy4x2+IoZCn9Kr5v2c69BoVYh63
1136 n749sSmvZ6ES8lgQGVMDMBu4Gon2nL2XA46jCfMdiyHxtN/kHNGfZQIG6lzWE7OE
1137 76KlXIx3KadowGuuQNKotOrN8I1LOJwZmhsoVLiJkO/KdYE+HvJkJMcYr07/R54H
1138 9jVlpNMKVv/1F2Rs76giJUmTtt8AF9pYfl3uxRuw0dFfIRDH+fO6AgonB8Xx1sfT
1139 4PsJYGw=
1140 -----END CERTIFICATE-----
1141
1142 -----BEGIN CERTIFICATE-----
1143 MIICPDCCAaUCEDyRMcsf9tAbDpq40ES/Er4wDQYJKoZIhvcNAQEFBQAwXzELMAkG
1144 A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz
1145 cyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2
1146 MDEyOTAwMDAwMFoXDTI4MDgwMjIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV
1147 BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmlt
1148 YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN
1149 ADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhE
1150 BarsAx94f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/is
1151 I19wKTakyYbnsZogy1Olhec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0G
1152 CSqGSIb3DQEBBQUAA4GBABByUqkFFBkyCEHwxWsKzH4PIRnN5GfcX6kb5sroc50i
1153 2JhucwNhkcV8sEVAbkSdjbCxlnRhLQ2pRdKkkirWmnWXbj9T/UWZYB2oK0z5XqcJ
1154 2HUw19JlYD1n1khVdWk/kfVIC0dpImmClr7JyDiGSnoscxlIaU5rfGW/D/xwzoiQ
1155 -----END CERTIFICATE-----
1156
1157 -----BEGIN CERTIFICATE-----
1158 MIIDhDCCAwqgAwIBAgIQL4D+I4wOIg9IZxIokYesszAKBggqhkjOPQQDAzCByjEL
1159 MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZW
1160 ZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2ln
1161 biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJp
1162 U2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9y
1163 aXR5IC0gRzQwHhcNMDcxMTA1MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCByjELMAkG
1164 A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJp
1165 U2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwg
1166 SW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2ln
1167 biBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5
1168 IC0gRzQwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAASnVnp8Utpkmw4tXNherJI9/gHm
1169 GUo9FANL+mAnINmDiWn6VMaaGF5VKmTeBvaNSjutEDxlPZCIBIngMGGzrl0Bp3ve
1170 fLK+ymVhAIau2o970ImtTR1ZmkGxvEeA3J5iw/mjgbIwga8wDwYDVR0TAQH/BAUw
1171 AwEB/zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJ
1172 aW1hZ2UvZ2lmMCEwHzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYj
1173 aHR0cDovL2xvZ28udmVyaXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFLMW
1174 kf3upm7ktS5Jj4d4gYDs5bG1MAoGCCqGSM49BAMDA2gAMGUCMGYhDBgmYFo4e1ZC
1175 4Kf8NoRRkSAsdk1DPcQdhCPQrNZ8NQbOzWm9kA3bbEhCHQ6qQgIxAJw9SDkjOVga
1176 FRJZap7v1VmyHVIsmXHNxynfGyphe3HR3vPA5Q06Sqotp9iGKt0uEA==
1177 -----END CERTIFICATE-----
1178
1179 -----BEGIN CERTIFICATE-----
1180 MIICiTCCAg+gAwIBAgIQH0evqmIAcFBUTAGem2OZKjAKBggqhkjOPQQDAzCBhTEL
1181 MAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UE
1182 BxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMT
1183 IkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDgwMzA2MDAw
1184 MDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdy
1185 ZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09N
1186 T0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlv
1187 biBBdXRob3JpdHkwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQDR3svdcmCFYX7deSR
1188 FtSrYpn1PlILBs5BAH+X4QokPB0BBO490o0JlwzgdeT6+3eKKvUDYEs2ixYjFq0J
1189 cfRK9ChQtP6IHG4/bC8vCVlbpVsLM5niwz2J+Wos77LTBumjQjBAMB0GA1UdDgQW
1190 BBR1cacZSBm8nZ3qQUfflMRId5nTeTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/
1191 BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjEA7wNbeqy3eApyt4jf/7VGFAkK+qDm
1192 fQjGGoe9GKhzvSbKYAydzpmfz1wPMOG+FDHqAjAU9JM8SaczepBGR7NjfRObTrdv
1193 GDeAU/7dIOA1mjbRxwG55tzd8/8dLDoWV9mSOdY=
1194 -----END CERTIFICATE-----
1195
1196 -----BEGIN CERTIFICATE-----
1197 MIIB8jCCAXigAwIBAgITBmyf18G7EEwpQ+Vxe3ssyBrBDjAKBggqhkjOPQQDAzA5
1198 MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24g
1199 Um9vdCBDQSA0MB4XDTE1MDUyNjAwMDAwMFoXDTQwMDUyNjAwMDAwMFowOTELMAkG
1200 A1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJvb3Qg
1201 Q0EgNDB2MBAGByqGSM49AgEGBSuBBAAiA2IABNKrijdPo1MN/sGKe0uoe0ZLY7Bi
1202 9i0b2whxIdIA6GO9mif78DluXeo9pcmBqqNbIJhFXRbb/egQbeOc4OO9X4Ri83Bk
1203 M6DLJC9wuoihKqB1+IGuYgbEgds5bimwHvouXKNCMEAwDwYDVR0TAQH/BAUwAwEB
1204 /zAOBgNVHQ8BAf8EBAMCAYYwHQYDVR0OBBYEFNPsxzplbszh2naaVvuc84ZtV+WB
1205 MAoGCCqGSM49BAMDA2gAMGUCMDqLIfG9fhGt0O9Yli/W651+kI0rz2ZVwyzjKKlw
1206 CkcO8DdZEv8tmZQoTipPNU0zWgIxAOp1AE47xDqUEpHJWEadIRNyp4iciuRMStuW
1207 1KyLa2tJElMzrdfkviT8tQp21KW8EA==
1208 -----END CERTIFICATE-----
1209
1210 -----BEGIN CERTIFICATE-----
1211 MIIFYDCCA0igAwIBAgIULvWbAiin23r/1aOp7r0DoM8Sah0wDQYJKoZIhvcNAQEL
1212 BQAwSDELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAc
1213 BgNVBAMTFVF1b1ZhZGlzIFJvb3QgQ0EgMyBHMzAeFw0xMjAxMTIyMDI2MzJaFw00
1214 MjAxMTIyMDI2MzJaMEgxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM
1215 aW1pdGVkMR4wHAYDVQQDExVRdW9WYWRpcyBSb290IENBIDMgRzMwggIiMA0GCSqG
1216 SIb3DQEBAQUAA4ICDwAwggIKAoICAQCzyw4QZ47qFJenMioKVjZ/aEzHs286IxSR
1217 /xl/pcqs7rN2nXrpixurazHb+gtTTK/FpRp5PIpM/6zfJd5O2YIyC0TeytuMrKNu
1218 FoM7pmRLMon7FhY4futD4tN0SsJiCnMK3UmzV9KwCoWdcTzeo8vAMvMBOSBDGzXR
1219 U7Ox7sWTaYI+FrUoRqHe6okJ7UO4BUaKhvVZR74bbwEhELn9qdIoyhA5CcoTNs+c
1220 ra1AdHkrAj80//ogaX3T7mH1urPnMNA3I4ZyYUUpSFlob3emLoG+B01vr87ERROR
1221 FHAGjx+f+IdpsQ7vw4kZ6+ocYfx6bIrc1gMLnia6Et3UVDmrJqMz6nWB2i3ND0/k
1222 A9HvFZcba5DFApCTZgIhsUfei5pKgLlVj7WiL8DWM2fafsSntARE60f75li59wzw
1223 eyuxwHApw0BiLTtIadwjPEjrewl5qW3aqDCYz4ByA4imW0aucnl8CAMhZa634Ryl
1224 sSqiMd5mBPfAdOhx3v89WcyWJhKLhZVXGqtrdQtEPREoPHtht+KPZ0/l7DxMYIBp
1225 VzgeAVuNVejH38DMdyM0SXV89pgR6y3e7UEuFAUCf+D+IOs15xGsIs5XPd7JMG0Q
1226 A4XN8f+MFrXBsj6IbGB/kE+V9/YtrQE5BwT6dYB9v0lQ7e/JxHwc64B+27bQ3RP+
1227 ydOc17KXqQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIB
1228 BjAdBgNVHQ4EFgQUxhfQvKjqAkPyGwaZXSuQILnXnOQwDQYJKoZIhvcNAQELBQAD
1229 ggIBADRh2Va1EodVTd2jNTFGu6QHcrxfYWLopfsLN7E8trP6KZ1/AvWkyaiTt3px
1230 KGmPc+FSkNrVvjrlt3ZqVoAh313m6Tqe5T72omnHKgqwGEfcIHB9UqM+WXzBusnI
1231 FUBhynLWcKzSt/Ac5IYp8M7vaGPQtSCKFWGafoaYtMnCdvvMujAWzKNhxnQT5Wvv
1232 oxXqA/4Ti2Tk08HS6IT7SdEQTXlm66r99I0xHnAUrdzeZxNMgRVhvLfZkXdxGYFg
1233 u/BYpbWcC/ePIlUnwEsBbTuZDdQdm2NnL9DuDcpmvJRPpq3t/O5jrFc/ZSXPsoaP
1234 0Aj/uHYUbt7lJ+yreLVTubY/6CD50qi+YUbKh4yE8/nxoGibIh6BJpsQBJFxwAYf
1235 3KDTuVan45gtf4Od34wrnDKOMpTwATwiKp9Dwi7DmDkHOHv8XgBCH/MyJnmDhPbl
1236 8MFREsALHgQjDFSlTC9JxUrRtm5gDWv8a4uFJGS3iQ6rJUdbPM9+Sb3H6QrG2vd+
1237 DhcI00iX0HGS8A85PjRqHH3Y8iKuu2n0M7SmSFXRDw4m6Oy2Cy2nhTXN/VnIn9HN
1238 PlopNLk9hM6xZdRZkZFWdSHBd575euFgndOtBBj0fOtek49TSiIp+EgrPk2GrFt/
1239 ywaZWWDYWGWVjUTR939+J399roD1B0y2PpxxVJkES/1Y+Zj0
1240 -----END CERTIFICATE-----
1241
1242 -----BEGIN CERTIFICATE-----
1243 MIIFgzCCA2ugAwIBAgIORea7A4Mzw4VlSOb/RVEwDQYJKoZIhvcNAQEMBQAwTDEg
1244 MB4GA1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjYxEzARBgNVBAoTCkdsb2Jh
1245 bFNpZ24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMTQxMjEwMDAwMDAwWhcNMzQx
1246 MjEwMDAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSNjET
1247 MBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCAiIwDQYJ
1248 KoZIhvcNAQEBBQADggIPADCCAgoCggIBAJUH6HPKZvnsFMp7PPcNCPG0RQssgrRI
1249 xutbPK6DuEGSMxSkb3/pKszGsIhrxbaJ0cay/xTOURQh7ErdG1rG1ofuTToVBu1k
1250 ZguSgMpE3nOUTvOniX9PeGMIyBJQbUJmL025eShNUhqKGoC3GYEOfsSKvGRMIRxD
1251 aNc9PIrFsmbVkJq3MQbFvuJtMgamHvm566qjuL++gmNQ0PAYid/kD3n16qIfKtJw
1252 LnvnvJO7bVPiSHyMEAc4/2ayd2F+4OqMPKq0pPbzlUoSB239jLKJz9CgYXfIWHSw
1253 1CM69106yqLbnQneXUQtkPGBzVeS+n68UARjNN9rkxi+azayOeSsJDa38O+2HBNX
1254 k7besvjihbdzorg1qkXy4J02oW9UivFyVm4uiMVRQkQVlO6jxTiWm05OWgtH8wY2
1255 SXcwvHE35absIQh1/OZhFj931dmRl4QKbNQCTXTAFO39OfuD8l4UoQSwC+n+7o/h
1256 bguyCLNhZglqsQY6ZZZZwPA1/cnaKI0aEYdwgQqomnUdnjqGBQCe24DWJfncBZ4n
1257 WUx2OVvq+aWh2IMP0f/fMBH5hc8zSPXKbWQULHpYT9NLCEnFlWQaYw55PfWzjMpY
1258 rZxCRXluDocZXFSxZba/jJvcE+kNb7gu3GduyYsRtYQUigAZcIN5kZeR1Bonvzce
1259 MgfYFGM8KEyvAgMBAAGjYzBhMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTAD
1260 AQH/MB0GA1UdDgQWBBSubAWjkxPioufi1xzWx/B/yGdToDAfBgNVHSMEGDAWgBSu
1261 bAWjkxPioufi1xzWx/B/yGdToDANBgkqhkiG9w0BAQwFAAOCAgEAgyXt6NH9lVLN
1262 nsAEoJFp5lzQhN7craJP6Ed41mWYqVuoPId8AorRbrcWc+ZfwFSY1XS+wc3iEZGt
1263 Ixg93eFyRJa0lV7Ae46ZeBZDE1ZXs6KzO7V33EByrKPrmzU+sQghoefEQzd5Mr61
1264 55wsTLxDKZmOMNOsIeDjHfrYBzN2VAAiKrlNIC5waNrlU/yDXNOd8v9EDERm8tLj
1265 vUYAGm0CuiVdjaExUd1URhxN25mW7xocBFymFe944Hn+Xds+qkxV/ZoVqW/hpvvf
1266 cDDpw+5CRu3CkwWJ+n1jez/QcYF8AOiYrg54NMMl+68KnyBr3TsTjxKM4kEaSHpz
1267 oHdpx7Zcf4LIHv5YGygrqGytXm3ABdJ7t+uA/iU3/gKbaKxCXcPu9czc8FB10jZp
1268 nOZ7BN9uBmm23goJSFmH63sUYHpkqmlD75HHTOwY3WzvUy2MmeFe8nI+z1TIvWfs
1269 pA9MRf/TuTAjB0yPEL+GltmZWrSZVxykzLsViVO6LAUP5MSeGbEYNNVMnbrt9x+v
1270 JJUEeKgDu+6B5dpffItKoZB0JaezPkvILFa9x8jvOOJckvB595yEunQtYQEgfn7R
1271 8k8HWV+LLUNS60YMlOH1Zkd5d9VUWx+tJDfLRVpOoERIyNiwmcUVhAn21klJwGW4
1272 5hpxbqCo8YLoRT5s1gLXCmeDBVrJpBA=
1273 -----END CERTIFICATE-----
1274
1275 -----BEGIN CERTIFICATE-----
1276 MIIEuTCCA6GgAwIBAgIQQBrEZCGzEyEDDrvkEhrFHTANBgkqhkiG9w0BAQsFADCB
1277 vTELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL
1278 ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJp
1279 U2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MTgwNgYDVQQDEy9W
1280 ZXJpU2lnbiBVbml2ZXJzYWwgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAe
1281 Fw0wODA0MDIwMDAwMDBaFw0zNzEyMDEyMzU5NTlaMIG9MQswCQYDVQQGEwJVUzEX
1282 MBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0
1283 IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAyMDA4IFZlcmlTaWduLCBJbmMuIC0gRm9y
1284 IGF1dGhvcml6ZWQgdXNlIG9ubHkxODA2BgNVBAMTL1ZlcmlTaWduIFVuaXZlcnNh
1285 bCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEF
1286 AAOCAQ8AMIIBCgKCAQEAx2E3XrEBNNti1xWb/1hajCMj1mCOkdeQmIN65lgZOIzF
1287 9uVkhbSicfvtvbnazU0AtMgtc6XHaXGVHzk8skQHnOgO+k1KxCHfKWGPMiJhgsWH
1288 H26MfF8WIFFE0XBPV+rjHOPMee5Y2A7Cs0WTwCznmhcrewA3ekEzeOEz4vMQGn+H
1289 LL729fdC4uW/h2KJXwBL38Xd5HVEMkE6HnFuacsLdUYI0crSK5XQz/u5QGtkjFdN
1290 /BMReYTtXlT2NJ8IAfMQJQYXStrxHXpma5hgZqTZ79IugvHw7wnqRMkVauIDbjPT
1291 rJ9VAMf2CGqUuV/c4DPxhGD5WycRtPwW8rtWaoAljQIDAQABo4GyMIGvMA8GA1Ud
1292 EwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMG0GCCsGAQUFBwEMBGEwX6FdoFsw
1293 WTBXMFUWCWltYWdlL2dpZjAhMB8wBwYFKw4DAhoEFI/l0xqGrI2Oa8PPgGrUSBgs
1294 exkuMCUWI2h0dHA6Ly9sb2dvLnZlcmlzaWduLmNvbS92c2xvZ28uZ2lmMB0GA1Ud
1295 DgQWBBS2d/ppSEefUxLVwuoHMnYH0ZcHGTANBgkqhkiG9w0BAQsFAAOCAQEASvj4
1296 sAPmLGd75JR3Y8xuTPl9Dg3cyLk1uXBPY/ok+myDjEedO2Pzmvl2MpWRsXe8rJq+
1297 seQxIcaBlVZaDrHC1LGmWazxY8u4TB1ZkErvkBYoH1quEPuBUDgMbMzxPcP1Y+Oz
1298 4yHJJDnp/RVmRvQbEdBNc6N9Rvk97ahfYtTxP/jgdFcrGJ2BtMQo2pSXpXDrrB2+
1299 BxHw1dvd5Yzw1TKwg+ZX4o+/vqGqvz0dtdQ46tewXDpPaj+PwGZsY6rp2aQW9IHR
1300 lRQOfc2VNNnSj3BzgXucfr2YYdhFh5iQxeuGMMY1v/D/w1WIg0vvBZIGcfK4mJO3
1301 7M2CYfE45k+XmCpajQ==
1302 -----END CERTIFICATE-----
1303
1304 -----BEGIN CERTIFICATE-----
1305 MIIDVDCCAjygAwIBAgIDAjRWMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVT
1306 MRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9i
1307 YWwgQ0EwHhcNMDIwNTIxMDQwMDAwWhcNMjIwNTIxMDQwMDAwWjBCMQswCQYDVQQG
1308 EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEbMBkGA1UEAxMSR2VvVHJ1c3Qg
1309 R2xvYmFsIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2swYYzD9
1310 9BcjGlZ+W988bDjkcbd4kdS8odhM+KhDtgPpTSEHCIjaWC9mOSm9BXiLnTjoBbdq
1311 fnGk5sRgprDvgOSJKA+eJdbtg/OtppHHmMlCGDUUna2YRpIuT8rxh0PBFpVXLVDv
1312 iS2Aelet8u5fa9IAjbkU+BQVNdnARqN7csiRv8lVK83Qlz6cJmTM386DGXHKTubU
1313 1XupGc1V3sjs0l44U+VcT4wt/lAjNvxm5suOpDkZALeVAjmRCw7+OC7RHQWa9k0+
1314 bw8HHa8sHo9gOeL6NlMTOdReJivbPagUvTLrGAMoUgRx5aszPeE4uwc2hGKceeoW
1315 MPRfwCvocWvk+QIDAQABo1MwUTAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTA
1316 ephojYn7qwVkDBF9qn1luMrMTjAfBgNVHSMEGDAWgBTAephojYn7qwVkDBF9qn1l
1317 uMrMTjANBgkqhkiG9w0BAQUFAAOCAQEANeMpauUvXVSOKVCUn5kaFOSPeCpilKIn
1318 Z57QzxpeR+nBsqTP3UEaBU6bS+5Kb1VSsyShNwrrZHYqLizz/Tt1kL/6cdjHPTfS
1319 tQWVYrmm3ok9Nns4d0iXrKYgjy6myQzCsplFAMfOEVEiIuCl6rYVSAlk6l5PdPcF
1320 PseKUgzbFbS9bZvlxrFUaKnjaZC2mqUPuLk/IH2uSrW4nOQdtqvmlKXBx4Ot2/Un
1321 hw4EbNX/3aBd7YdStysVAq45pmp06drE57xNNB6pXE0zX5IJL4hmXXeXxx12E6nV
1322 5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvmMw==
1323 -----END CERTIFICATE-----
1324
1325 -----BEGIN CERTIFICATE-----
1326 MIIEMzCCAxugAwIBAgIDCYPzMA0GCSqGSIb3DQEBCwUAME0xCzAJBgNVBAYTAkRF
1327 MRUwEwYDVQQKDAxELVRydXN0IEdtYkgxJzAlBgNVBAMMHkQtVFJVU1QgUm9vdCBD
1328 bGFzcyAzIENBIDIgMjAwOTAeFw0wOTExMDUwODM1NThaFw0yOTExMDUwODM1NTha
1329 ME0xCzAJBgNVBAYTAkRFMRUwEwYDVQQKDAxELVRydXN0IEdtYkgxJzAlBgNVBAMM
1330 HkQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgMjAwOTCCASIwDQYJKoZIhvcNAQEB
1331 BQADggEPADCCAQoCggEBANOySs96R+91myP6Oi/WUEWJNTrGa9v+2wBoqOADER03
1332 UAifTUpolDWzU9GUY6cgVq/eUXjsKj3zSEhQPgrfRlWLJ23DEE0NkVJD2IfgXU42
1333 tSHKXzlABF9bfsyjxiupQB7ZNoTWSPOSHjRGICTBpFGOShrvUD9pXRl/RcPHAY9R
1334 ySPocq60vFYJfxLLHLGvKZAKyVXMD9O0Gu1HNVpK7ZxzBCHQqr0ME7UAyiZsxGsM
1335 lFqVlNpQmvH/pStmMaTJOKDfHR+4CS7zp+hnUquVH+BGPtikw8paxTGA6Eian5Rp
1336 /hnd2HN8gcqW3o7tszIFZYQ05ub9VxC1X3a/L7AQDcUCAwEAAaOCARowggEWMA8G
1337 A1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFP3aFMSfMN4hvR5COfyrYyNJ4PGEMA4G
1338 A1UdDwEB/wQEAwIBBjCB0wYDVR0fBIHLMIHIMIGAoH6gfIZ6bGRhcDovL2RpcmVj
1339 dG9yeS5kLXRydXN0Lm5ldC9DTj1ELVRSVVNUJTIwUm9vdCUyMENsYXNzJTIwMyUy
1340 MENBJTIwMiUyMDIwMDksTz1ELVRydXN0JTIwR21iSCxDPURFP2NlcnRpZmljYXRl
1341 cmV2b2NhdGlvbmxpc3QwQ6BBoD+GPWh0dHA6Ly93d3cuZC10cnVzdC5uZXQvY3Js
1342 L2QtdHJ1c3Rfcm9vdF9jbGFzc18zX2NhXzJfMjAwOS5jcmwwDQYJKoZIhvcNAQEL
1343 BQADggEBAH+X2zDI36ScfSF6gHDOFBJpiBSVYEQBrLLpME+bUMJm2H6NMLVwMeni
1344 acfzcNsgFYbQDfC+rAF1hM5+n02/t2A7nPPKHeJeaNijnZflQGDSNiH+0LS4F9p0
1345 o3/U37CYAqxva2ssJSRyoWXuJVrl5jLn8t+rSfrzkGkj2wTZ51xY/GXUl77M/C4K
1346 zCUqNQT4YJEVdT1B/yMfGchs64JTBKbkTCJNjYy6zltz7GRUUG3RnFX7acM2w4y8
1347 PIWmawomDeCTmGCufsYkl4phX5GOZpIJhzbNi5stPvZR1FDUWSi9g/LMKHtThm3Y
1348 Johw1+qRzT65ysCQblrGXnRl11z+o+I=
1349 -----END CERTIFICATE-----
1350
1351 -----BEGIN CERTIFICATE-----
1352 MIIGnTCCBIWgAwIBAgICBcYwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0x
1353 GTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJv
1354 b3QgQ0EgMzAeFw0wNjExMjQxOTExMjNaFw0zMTExMjQxOTA2NDRaMEUxCzAJBgNV
1355 BAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMRswGQYDVQQDExJRdW9W
1356 YWRpcyBSb290IENBIDMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDM
1357 V0IWVJzmmNPTTe7+7cefQzlKZbPoFog02w1ZkXTPkrgEQK0CSzGrvI2RaNggDhoB
1358 4hp7Thdd4oq3P5kazethq8Jlph+3t723j/z9cI8LoGe+AaJZz3HmDyl2/7FWeUUr
1359 H556VOijKTVopAFPD6QuN+8bv+OPEKhyq1hX51SGyMnzW9os2l2ObjyjPtr7guXd
1360 8lyyBTNvijbO0BNO/79KDDRMpsMhvVAEVeuxu537RR5kFd5VAYwCdrXLoT9Cabwv
1361 vWhDFlaJKjdhkf2mrk7AyxRllDdLkgbvBNDInIjbC3uBr7E9KsRlOni27tyAsdLT
1362 mZw67mtaa7ONt9XOnMK+pUsvFrGeaDsGb659n/je7Mwpp5ijJUMv7/FfJuGITfhe
1363 btfZFG4ZM2mnO4SJk8RTVROhUXhA+LjJou57ulJCg54U7QVSWllWp5f8nT8KKdjc
1364 T5EOE7zelaTfi5m+rJsziO+1ga8bxiJTyPbH7pcUsMV8eFLI8M5ud2CEpukqdiDt
1365 WAEXMJPpGovgc2PZapKUSU60rUqFxKMiMPwJ7Wgic6aIDFUhWMXhOp8q3crhkODZ
1366 c6tsgLjoC2SToJyMGf+z0gzskSaHirOi4XCPLArlzW1oUevaPwV/izLmE1xr/l9A
1367 4iLItLRkT9a6fUg+qGkM17uGcclzuD87nSVL2v9A6wIDAQABo4IBlTCCAZEwDwYD
1368 VR0TAQH/BAUwAwEB/zCB4QYDVR0gBIHZMIHWMIHTBgkrBgEEAb5YAAMwgcUwgZMG
1369 CCsGAQUFBwICMIGGGoGDQW55IHVzZSBvZiB0aGlzIENlcnRpZmljYXRlIGNvbnN0
1370 aXR1dGVzIGFjY2VwdGFuY2Ugb2YgdGhlIFF1b1ZhZGlzIFJvb3QgQ0EgMyBDZXJ0
1371 aWZpY2F0ZSBQb2xpY3kgLyBDZXJ0aWZpY2F0aW9uIFByYWN0aWNlIFN0YXRlbWVu
1372 dC4wLQYIKwYBBQUHAgEWIWh0dHA6Ly93d3cucXVvdmFkaXNnbG9iYWwuY29tL2Nw
1373 czALBgNVHQ8EBAMCAQYwHQYDVR0OBBYEFPLAE+CCQz777i9nMpY1XNu4ywLQMG4G
1374 A1UdIwRnMGWAFPLAE+CCQz777i9nMpY1XNu4ywLQoUmkRzBFMQswCQYDVQQGEwJC
1375 TTEZMBcGA1UEChMQUXVvVmFkaXMgTGltaXRlZDEbMBkGA1UEAxMSUXVvVmFkaXMg
1376 Um9vdCBDQSAzggIFxjANBgkqhkiG9w0BAQUFAAOCAgEAT62gLEz6wPJv92ZVqyM0
1377 7ucp2sNbtrCD2dDQ4iH782CnO11gUyeim/YIIirnv6By5ZwkajGxkHon24QRiSem
1378 d1o417+shvzuXYO8BsbRd2sPbSQvS3pspweWyuOEn62Iix2rFo1bZhfZFvSLgNLd
1379 +LJ2w/w4E6oM3kJpK27zPOuAJ9v1pkQNn1pVWQvVDVJIxa6f8i+AxeoyUDUSly7B
1380 4f/xI4hROJ/yZlZ25w9Rl6VSDE1JUZU2Pb+iSwwQHYaZTKrzchGT5Or2m9qoXadN
1381 t54CrnMAyNojA+j56hl0YgCUyyIgvpSnWbWCar6ZeXqp8kokUvd0/bpO5qgdAm6x
1382 DYBEwa7TIzdfu4V8K5Iu6H6li92Z4b8nby1dqnuH/grdS/yO9SbkbnBCbjPsMZ57
1383 k8HkyWkaPcBrTiJt7qtYTcbQQcEr6k8Sh17rRdhs9ZgC06DYVYoGmRmioHfRMJ6s
1384 zHXug/WwYjnPbFfiTNKRCw51KBuav/0aQ/HKd/s7j2G4aSgWQgRecCocIdiP4b0j
1385 Wy10QJLZYxkNc91pvGJHvOB0K7Lrfb5BG7XARsWhIstfTsEokt4YutUqKLsRixeT
1386 mJlglFwjz1onl14LBQaTNx47aTbrqZ5hHY8y2o4M1nQ+ewkk2gF3R8Q7zTSMmfXK
1387 4SVhM7JZG+Ju1zdXtg2pEto=
1388 -----END CERTIFICATE-----
1389
1390 -----BEGIN CERTIFICATE-----
1391 MIIDTDCCAjSgAwIBAgIIfE8EORzUmS0wDQYJKoZIhvcNAQEFBQAwRDELMAkGA1UE
1392 BhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVz
1393 dCBOZXR3b3JraW5nMB4XDTEwMDEyOTE0MDgyNFoXDTMwMTIzMTE0MDgyNFowRDEL
1394 MAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZp
1395 cm1UcnVzdCBOZXR3b3JraW5nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC
1396 AQEAtITMMxcua5Rsa2FSoOujz3mUTOWUgJnLVWREZY9nZOIG41w3SfYvm4SEHi3y
1397 YJ0wTsyEheIszx6e/jarM3c1RNg1lho9Nuh6DtjVR6FqaYvZ/Ls6rnla1fTWcbua
1398 kCNrmreIdIcMHl+5ni36q1Mr3Lt2PpNMCAiMHqIjHNRqrSK6mQEubWXLviRmVSRL
1399 QESxG9fhwoXA3hA/Pe24/PHxI1Pcv2WXb9n5QHGNfb2V1M6+oF4nI979ptAmDgAp
1400 6zxG8D1gvz9Q0twmQVGeFDdCBKNwV6gbh+0t+nvujArjqWaJGctB+d1ENmHP4ndG
1401 yH329JKBNv3bNPFyfvMMFr20FQIDAQABo0IwQDAdBgNVHQ4EFgQUBx/S55zawm6i
1402 QLSwelAQUHTEyL0wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwDQYJ
1403 KoZIhvcNAQEFBQADggEBAIlXshZ6qML91tmbmzTCnLQyFE2npN/svqe++EPbkTfO
1404 tDIuUFUaNU52Q3Eg75N3ThVwLofDwR1t3Mu1J9QsVtFSUzpE0nPIxBsFZVpikpzu
1405 QY0x2+c06lkh1QF612S4ZDnNye2v7UsDSKegmQGA3GWjNq5lWUhPgkvIZfFXHeVZ
1406 Lgo/bNjR9eUJtGxUAArgFU2HdW23WJZa3W3SAKD0m0i+wzekujbgfIeFlxoVot4u
1407 olu9rxj5kFDNcFn4J2dHy8egBzp90SxdbBk6ZrV9/ZFvgrG+CJPbFEfxojfHRZ48
1408 x3evZKiT3/Zpg4Jg8klCNO1aAFSFHBY2kgxc+qatv9s=
1409 -----END CERTIFICATE-----
1410
1411 -----BEGIN CERTIFICATE-----
1412 MIIDDDCCAfSgAwIBAgIDAQAgMA0GCSqGSIb3DQEBBQUAMD4xCzAJBgNVBAYTAlBM
1413 MRswGQYDVQQKExJVbml6ZXRvIFNwLiB6IG8uby4xEjAQBgNVBAMTCUNlcnR1bSBD
1414 QTAeFw0wMjA2MTExMDQ2MzlaFw0yNzA2MTExMDQ2MzlaMD4xCzAJBgNVBAYTAlBM
1415 MRswGQYDVQQKExJVbml6ZXRvIFNwLiB6IG8uby4xEjAQBgNVBAMTCUNlcnR1bSBD
1416 QTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAM6xwS7TT3zNJc4YPk/E
1417 jG+AanPIW1H4m9LcuwBcsaD8dQPugfCI7iNS6eYVM42sLQnFdvkrOYCJ5JdLkKWo
1418 ePhzQ3ukYbDYWMzhbGZ+nPMJXlVjhNWo7/OxLjBos8Q82KxujZlakE403Daaj4GI
1419 ULdtlkIJ89eVgw1BS7Bqa/j8D35in2fE7SZfECYPCE/wpFcozo+47UX2bu4lXapu
1420 Ob7kky/ZR6By6/qmW6/KUz/iDsaWVhFu9+lmqSbYf5VT7QqFiLpPKaVCjF62/IUg
1421 AKpoC6EahQGcxEZjgoi2IrHu/qpGWX7PNSzVttpd90gzFFS269lvzs2I1qsb2pY7
1422 HVkCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEA
1423 uI3O7+cUus/usESSbLQ5PqKEbq24IXfS1HeCh+YgQYHu4vgRt2PRFze+GXYkHAQa
1424 TOs9qmdvLdTN/mUxcMUbpgIKumB7bVjCmkn+YzILa+M6wKyrO7Do0wlRjBCDxjTg
1425 xSvgGrZgFCdsMneMvLJymM/NzD+5yCRCFNZX/OYmQ6kd5YCQzgNUKD73P9P4Te1q
1426 CjqTE5s7FCMTY5w/0YcneeVMUeMBrYVdGjux1XMQpNPyvG5k9VpWkKjHDkx0Dy5x
1427 O/fIR/RpbxXyEV6DHpx8Uq79AtoSqFlnGNu8cN2bsWntgM6JQEhqDjXKKWYVIZQs
1428 6GAqm4VKQPNriiTsBhYscw==
1429 -----END CERTIFICATE-----
1430
1431 -----BEGIN CERTIFICATE-----
1432 MIIDWjCCAkKgAwIBAgIBADANBgkqhkiG9w0BAQUFADBQMQswCQYDVQQGEwJKUDEY
1433 MBYGA1UEChMPU0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21t
1434 dW5pY2F0aW9uIFJvb3RDQTEwHhcNMDMwOTMwMDQyMDQ5WhcNMjMwOTMwMDQyMDQ5
1435 WjBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMPU0VDT00gVHJ1c3QubmV0MScwJQYD
1436 VQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEwggEiMA0GCSqGSIb3
1437 DQEBAQUAA4IBDwAwggEKAoIBAQCzs/5/022x7xZ8V6UMbXaKL0u/ZPtM7orw8yl8
1438 9f/uKuDp6bpbZCKamm8sOiZpUQWZJtzVHGpxxpp9Hp3dfGzGjGdnSj74cbAZJ6kJ
1439 DKaVv0uMDPpVmDvY6CKhS3E4eayXkmmziX7qIWgGmBSWh9JhNrxtJ1aeV+7AwFb9
1440 Ms+k2Y7CI9eNqPPYJayX5HA49LY6tJ07lyZDo6G8SVlyTCMwhwFY9k6+HGhWZq/N
1441 QV3Is00qVUarH9oe4kA92819uZKAnDfdDJZkndwi92SL32HeFZRSFaB9UslLqCHJ
1442 xrHty8OVYNEP8Ktw+N/LTX7s1vqr2b1/VPKl6Xn62dZ2JChzAgMBAAGjPzA9MB0G
1443 A1UdDgQWBBSgc0mZaNyFW2XjmygvV5+9M7wHSDALBgNVHQ8EBAMCAQYwDwYDVR0T
1444 AQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAaECpqLvkT115swW1F7NgE+vG
1445 kl3g0dNq/vu+m22/xwVtWSDEHPC32oRYAmP6SBbvT6UL90qY8j+eG61Ha2POCEfr
1446 Uj94nK9NrvjVT8+amCoQQTlSxN3Zmw7vkwGusi7KaEIkQmywszo+zenaSMQVy+n5
1447 Bw+SUEmK3TGXX8npN6o7WWWXlDLJs58+OmJYxUmtYg5xpTKqL8aJdkNAExNnPaJU
1448 JRDL8Try2frbSVa7pv6nQTXD4IhhyYjH3zYQIphZ6rBK+1YWc26sTfcioU+tHXot
1449 RSflMMFe8toTyyVCUZVHA4xsIcx0Qu1T/zOLjw9XARYvz6buyXAiFL39vmwLAw==
1450 -----END CERTIFICATE-----
1451
1452 -----BEGIN CERTIFICATE-----
1453 MIIFazCCA1OgAwIBAgIRAIIQz7DSQONZRGPgu2OCiwAwDQYJKoZIhvcNAQELBQAw
1454 TzELMAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2Vh
1455 cmNoIEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDEwHhcNMTUwNjA0MTEwNDM4
1456 WhcNMzUwNjA0MTEwNDM4WjBPMQswCQYDVQQGEwJVUzEpMCcGA1UEChMgSW50ZXJu
1457 ZXQgU2VjdXJpdHkgUmVzZWFyY2ggR3JvdXAxFTATBgNVBAMTDElTUkcgUm9vdCBY
1458 MTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAK3oJHP0FDfzm54rVygc
1459 h77ct984kIxuPOZXoHj3dcKi/vVqbvYATyjb3miGbESTtrFj/RQSa78f0uoxmyF+
1460 0TM8ukj13Xnfs7j/EvEhmkvBioZxaUpmZmyPfjxwv60pIgbz5MDmgK7iS4+3mX6U
1461 A5/TR5d8mUgjU+g4rk8Kb4Mu0UlXjIB0ttov0DiNewNwIRt18jA8+o+u3dpjq+sW
1462 T8KOEUt+zwvo/7V3LvSye0rgTBIlDHCNAymg4VMk7BPZ7hm/ELNKjD+Jo2FR3qyH
1463 B5T0Y3HsLuJvW5iB4YlcNHlsdu87kGJ55tukmi8mxdAQ4Q7e2RCOFvu396j3x+UC
1464 B5iPNgiV5+I3lg02dZ77DnKxHZu8A/lJBdiB3QW0KtZB6awBdpUKD9jf1b0SHzUv
1465 KBds0pjBqAlkd25HN7rOrFleaJ1/ctaJxQZBKT5ZPt0m9STJEadao0xAH0ahmbWn
1466 OlFuhjuefXKnEgV4We0+UXgVCwOPjdAvBbI+e0ocS3MFEvzG6uBQE3xDk3SzynTn
1467 jh8BCNAw1FtxNrQHusEwMFxIt4I7mKZ9YIqioymCzLq9gwQbooMDQaHWBfEbwrbw
1468 qHyGO0aoSCqI3Haadr8faqU9GY/rOPNk3sgrDQoo//fb4hVC1CLQJ13hef4Y53CI
1469 rU7m2Ys6xt0nUW7/vGT1M0NPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV
1470 HRMBAf8EBTADAQH/MB0GA1UdDgQWBBR5tFnme7bl5AFzgAiIyBpY9umbbjANBgkq
1471 hkiG9w0BAQsFAAOCAgEAVR9YqbyyqFDQDLHYGmkgJykIrGF1XIpu+ILlaS/V9lZL
1472 ubhzEFnTIZd+50xx+7LSYK05qAvqFyFWhfFQDlnrzuBZ6brJFe+GnY+EgPbk6ZGQ
1473 3BebYhtF8GaV0nxvwuo77x/Py9auJ/GpsMiu/X1+mvoiBOv/2X/qkSsisRcOj/KK
1474 NFtY2PwByVS5uCbMiogziUwthDyC3+6WVwW6LLv3xLfHTjuCvjHIInNzktHCgKQ5
1475 ORAzI4JMPJ+GslWYHb4phowim57iaztXOoJwTdwJx4nLCgdNbOhdjsnvzqvHu7Ur
1476 TkXWStAmzOVyyghqpZXjFaH3pO3JLF+l+/+sKAIuvtd7u+Nxe5AW0wdeRlN8NwdC
1477 jNPElpzVmbUq4JUagEiuTDkHzsxHpFKVK7q4+63SM1N95R1NbdWhscdCb+ZAJzVc
1478 oyi3B43njTOQ5yOf+1CceWxG1bQVs5ZufpsMljq4Ui0/1lvh+wjChP4kqKOJ2qxq
1479 4RgqsahDYVvTH9w7jXbyLeiNdd8XM2w9U/t7y0Ff/9yi0GE44Za4rF2LN9d11TPA
1480 mRGunUHBcnWEvgJBQl9nJEiU0Zsnvgc/ubhPgXRR4Xq37Z0j4r7g1SgEEzwxA57d
1481 emyPxgcYxn/eR44/KJ4EBs+lVDR3veyJm+kXQ99b21/+jh5Xos1AnX5iItreGCc=
1482 -----END CERTIFICATE-----
1483
1484 -----BEGIN CERTIFICATE-----
1485 MIIEGjCCAwICEQCbfgZJoz5iudXukEhxKe9XMA0GCSqGSIb3DQEBBQUAMIHKMQsw
1486 CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZl
1487 cmlTaWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWdu
1488 LCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlT
1489 aWduIENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3Jp
1490 dHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQswCQYD
1491 VQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlT
1492 aWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJ
1493 bmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWdu
1494 IENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg
1495 LSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMu6nFL8eB8aHm8b
1496 N3O9+MlrlBIwT/A2R/XQkQr1F8ilYcEWQE37imGQ5XYgwREGfassbqb1EUGO+i2t
1497 KmFZpGcmTNDovFJbcCAEWNF6yaRpvIMXZK0Fi7zQWM6NjPXr8EJJC52XJ2cybuGu
1498 kxUccLwgTS8Y3pKI6GyFVxEa6X7jJhFUokWWVYPKMIno3Nij7SqAP395ZVc+FSBm
1499 CC+Vk7+qRy+oRpfwEuL+wgorUeZ25rdGt+INpsyow0xZVYnm6FNcHOqd8GIWC6fJ
1500 Xwzw3sJ2zq/3avL6QaaiMxTJ5Xpj055iN9WFZZ4O5lMkdBteHRJTW8cs54NJOxWu
1501 imi5V5cCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAERSWwauSCPc/L8my/uRan2Te
1502 2yFPhpk0djZX3dAVL8WtfxUfN2JzPtTnX84XA9s1+ivbrmAJXx5fj267Cz3qWhMe
1503 DGBvtcC1IyIuBwvLqXTLR7sdwdela8wv0kL9Sd2nic9TutoAWii/gt/4uhMdUIaC
1504 /Y4wjylGsB49Ndo4YhYYSq3mtlFs3q9i6wHQHiT+eo8SGhJouPtmmRQURVyu565p
1505 F4ErWjfJXir0xuKhXFSbplQAz/DxwceYMBo7Nhbbo27q/a2ywtrvAkcTisDxszGt
1506 TxzhT5yvDwyd93gN2PQ1VoDat20Xj50egWTh/sVFuq1ruQp6Tk9LhO5L8X3dEQ==
1507 -----END CERTIFICATE-----
1508
1509 -----BEGIN CERTIFICATE-----
1510 MIIF6zCCA9OgAwIBAgIIVrYpzTS8ePYwDQYJKoZIhvcNAQELBQAwgYIxCzAJBgNV
1511 BAYTAlVTMQ4wDAYDVQQIDAVUZXhhczEQMA4GA1UEBwwHSG91c3RvbjEYMBYGA1UE
1512 CgwPU1NMIENvcnBvcmF0aW9uMTcwNQYDVQQDDC5TU0wuY29tIEVWIFJvb3QgQ2Vy
1513 dGlmaWNhdGlvbiBBdXRob3JpdHkgUlNBIFIyMB4XDTE3MDUzMTE4MTQzN1oXDTQy
1514 MDUzMDE4MTQzN1owgYIxCzAJBgNVBAYTAlVTMQ4wDAYDVQQIDAVUZXhhczEQMA4G
1515 A1UEBwwHSG91c3RvbjEYMBYGA1UECgwPU1NMIENvcnBvcmF0aW9uMTcwNQYDVQQD
1516 DC5TU0wuY29tIEVWIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgUlNBIFIy
1517 MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAjzZlQOHWTcDXtOlG2mvq
1518 M0fNTPl9fb69LT3w23jhhqXZuglXaO1XPqDQCEGD5yhBJB/jchXQARr7XnAjssuf
1519 OePPxU7Gkm0mxnu7s9onnQqG6YE3Bf7wcXHswxzpY6IXFJ3vG2fThVUCAtZJycxa
1520 4bH3bzKfydQ7iEGonL3Lq9ttewkfokxykNorCPzPPFTOZw+oz12WGQvE43LrrdF9
1521 HSfvkusQv1vrO6/PgN3B0pYEW3p+pKk8OHakYo6gOV7qd89dAFmPZiw+B6KjBSYR
1522 aZfqhbcPlgtLyEDhULouisv3D5oi53+aNxPN8k0TayHRwMwi8qFG9kRpnMphNQcA
1523 b9ZhCBHqurj26bNg5U257J8UZslXWNvNh2n4ioYSA0e/ZhN2rHd9NCSFg83XqpyQ
1524 Gp8hLH94t2S42Oim9HizVcuE0jLEeK6jj2HdzghTreyI/BXkmg3mnxp3zkyPuBQV
1525 PWKchjgGAGYS5Fl2WlPAApiiECtoRHuOec4zSnaqW4EWG7WK2NAAe15itAnWhmMO
1526 pgWVSbooi4iTsjQc2KRVbrcc0N6ZVTsj9CLg+SlmJuwgUHfbSguPvuUCYHBBXtSu
1527 UDkiFCbLsjtzdFVHB3mBOagwE0TlBIqulhMlQg+5U8Sb/M3kHN48+qvWBkofZ6aY
1528 MBzdLNvcGJVXZsb/XItW9XcCAwEAAaNjMGEwDwYDVR0TAQH/BAUwAwEB/zAfBgNV
1529 HSMEGDAWgBT5YLvU49U09rj1BoAlp3PbRmmonjAdBgNVHQ4EFgQU+WC71OPVNPa4
1530 9QaAJadz20ZpqJ4wDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEBCwUAA4ICAQBW
1531 s47LCp1Jjr+kxJG7ZhcFUZh1++VQLHqe8RT6q9OKPv+RKY9ji9i0qVQBDb6Thi/5
1532 Sm3HXvVX+cpVHBK+Rw82xd9qt9t1wkclf7nxY/hoLVUE0fKNsKTPvDxeH3jnpaAg
1533 cLAExbf3cqfeIg29MyVGjGSSJuM+LmOW2puMPfgYCdcDzH2GguDKBAdRUNf/ktUM
1534 79qGn5nX67evaOI5JpS6aLe/g9Pqemc9YmeuJeVy6OLk7K4S9ksrPJ/psEDzOFSz
1535 /bdoyNrGj1E8svuR3Bznm53htw1yj+KkxKl4+esUrMZDBcJlOSgYAsOCsp0FvmXt
1536 ll9ldDz7CTUue5wT/RsPXcdtgTpWD8w74a8CLyKsRspGPKAcTNZEtF4uXBVmCeEm
1537 Kf7GUmG6sXP/wwyc5WxqlD8UykAWlYTzWamsX0xhk23RO8yilQwipmdnRC652dKK
1538 QbNmC1r7fSOl8hqw/96bg5Qu0T/fkreRrwU7ZcegbLHNYhLDkBvjJc40vG93drEQ
1539 w/cFGsDWr3RiSBd3kmmQYRzelYB0VI8YHMPzA9C/pEN1hlMYegouCRw2n5H9gooi
1540 S9EOUCXdywMMF8mDAAhONU2Ki+3wApRmLER/y5UnlhetCTCstnEXbosX9hwJ1C07
1541 mKVx01QT2WDz9UtmT/rx7iASjbSsV7FFY6GsdqnC+w==
1542 -----END CERTIFICATE-----
1543
1544 -----BEGIN CERTIFICATE-----
1545 MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBs
1546 MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
1547 d3cuZGlnaWNlcnQuY29tMSswKQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5j
1548 ZSBFViBSb290IENBMB4XDTA2MTExMDAwMDAwMFoXDTMxMTExMDAwMDAwMFowbDEL
1549 MAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZMBcGA1UECxMQd3d3
1550 LmRpZ2ljZXJ0LmNvbTErMCkGA1UEAxMiRGlnaUNlcnQgSGlnaCBBc3N1cmFuY2Ug
1551 RVYgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbM5XPm
1552 +9S75S0tMqbf5YE/yc0lSbZxKsPVlDRnogocsF9ppkCxxLeyj9CYpKlBWTrT3JTW
1553 PNt0OKRKzE0lgvdKpVMSOO7zSW1xkX5jtqumX8OkhPhPYlG++MXs2ziS4wblCJEM
1554 xChBVfvLWokVfnHoNb9Ncgk9vjo4UFt3MRuNs8ckRZqnrG0AFFoEt7oT61EKmEFB
1555 Ik5lYYeBQVCmeVyJ3hlKV9Uu5l0cUyx+mM0aBhakaHPQNAQTXKFx01p8VdteZOE3
1556 hzBWBOURtCmAEvF5OYiiAhF8J2a3iLd48soKqDirCmTCv2ZdlYTBoSUeh10aUAsg
1557 EsxBu24LUTi4S8sCAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQF
1558 MAMBAf8wHQYDVR0OBBYEFLE+w2kD+L9HAdSYJhoIAu9jZCvDMB8GA1UdIwQYMBaA
1559 FLE+w2kD+L9HAdSYJhoIAu9jZCvDMA0GCSqGSIb3DQEBBQUAA4IBAQAcGgaX3Nec
1560 nzyIZgYIVyHbIUf4KmeqvxgydkAQV8GK83rZEWWONfqe/EW1ntlMMUu4kehDLI6z
1561 eM7b41N5cdblIZQB2lWHmiRk9opmzN6cN82oNLFpmyPInngiK3BD41VHMWEZ71jF
1562 hS9OMPagMRYjyOfiZRYzy78aG6A9+MpeizGLYAiJLQwGXFK3xPkKmNEVX58Svnw2
1563 Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe
1564 vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep
1565 +OkuE6N36B9K
1566 -----END CERTIFICATE-----
1567
1568 -----BEGIN CERTIFICATE-----
1569 MIIFYDCCA0igAwIBAgIQCgFCgAAAAUUjyES1AAAAAjANBgkqhkiG9w0BAQsFADBK
1570 MQswCQYDVQQGEwJVUzESMBAGA1UEChMJSWRlblRydXN0MScwJQYDVQQDEx5JZGVu
1571 VHJ1c3QgQ29tbWVyY2lhbCBSb290IENBIDEwHhcNMTQwMTE2MTgxMjIzWhcNMzQw
1572 MTE2MTgxMjIzWjBKMQswCQYDVQQGEwJVUzESMBAGA1UEChMJSWRlblRydXN0MScw
1573 JQYDVQQDEx5JZGVuVHJ1c3QgQ29tbWVyY2lhbCBSb290IENBIDEwggIiMA0GCSqG
1574 SIb3DQEBAQUAA4ICDwAwggIKAoICAQCnUBneP5k91DNG8W9RYYKyqU+PZ4ldhNlT
1575 3Qwo2dfw/66VQ3KZ+bVdfIrBQuExUHTRgQ18zZshq0PirK1ehm7zCYofWjK9ouuU
1576 +ehcCuz/mNKvcbO0U59Oh++SvL3sTzIwiEsXXlfEU8L2ApeN2WIrvyQfYo3fw7gp
1577 S0l4PJNgiCL8mdo2yMKi1CxUAGc1bnO/AljwpN3lsKImesrgNqUZFvX9t++uP0D1
1578 bVoE/c40yiTcdCMbXTMTEl3EASX2MN0CXZ/g1Ue9tOsbobtJSdifWwLziuQkkORi
1579 T0/Br4sOdBeo0XKIanoBScy0RnnGF7HamB4HWfp1IYVl3ZBWzvurpWCdxJ35UrCL
1580 vYf5jysjCiN2O/cz4ckA82n5S6LgTrx+kzmEB/dEcH7+B1rlsazRGMzyNeVJSQjK
1581 Vsk9+w8YfYs7wRPCTY/JTw436R+hDmrfYi7LNQZReSzIJTj0+kuniVyc0uMNOYZK
1582 dHzVWYfCP04MXFL0PfdSgvHqo6z9STQaKPNBiDoT7uje/5kdX7rL6B7yuVBgwDHT
1583 c+XvvqDtMwt0viAgxGds8AgDelWAf0ZOlqf0Hj7h9tgJ4TNkK2PXMl6f+cB7D3hv
1584 l7yTmvmcEpB4eoCHFddydJxVdHixuuFucAS6T6C6aMN7/zHwcz09lCqxC0EOoP5N
1585 iGVreTO01wIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB
1586 /zAdBgNVHQ4EFgQU7UQZwNPwBovupHu+QucmVMiONnYwDQYJKoZIhvcNAQELBQAD
1587 ggIBAA2ukDL2pkt8RHYZYR4nKM1eVO8lvOMIkPkp165oCOGUAFjvLi5+U1KMtlwH
1588 6oi6mYtQlNeCgN9hCQCTrQ0U5s7B8jeUeLBfnLOic7iPBZM4zY0+sLj7wM+x8uwt
1589 LRvM7Kqas6pgghstO8OEPVeKlh6cdbjTMM1gCIOQ045U8U1mwF10A0Cj7oV+wh93
1590 nAbowacYXVKV7cndJZ5t+qntozo00Fl72u1Q8zW/7esUTTHHYPTa8Yec4kjixsU3
1591 +wYQ+nVZZjFHKdp2mhzpgq7vmrlR94gjmmmVYjzlVYA211QC//G5Xc7UI2/YRYRK
1592 W2XviQzdFKcgyxilJbQN+QHwotL0AMh0jqEqSI5l2xPE4iUXfeu+h1sXIFRRk0pT
1593 AwvsXcoz7WL9RccvW9xYoIA55vrX/hMUpu09lEpCdNTDd1lzzY9GvlU47/rokTLq
1594 l1gEIt44w8y8bckzOmoKaT+gyOpyj4xjhiO9bTyWnpXgSUyqorkqG5w2gXjtw+hG
1595 4iZZRHUe2XWJUc0QhJ1hYMtd+ZciTY6Y5uN/9lu7rs3KSoFrXgvzUeF0K+l+J6fZ
1596 mUlO+KWA2yUPHGNiiskzZ2s8EIPGrd6ozRaOjfAHN3Gf8qv8QfXBi+wAN10J5U6A
1597 7/qxXDgGpRtK4dw4LTzcqx+QGtVKnO7RcGzM7vRX+Bi6hG6H
1598 -----END CERTIFICATE-----
1599
1600 -----BEGIN CERTIFICATE-----
1601 MIIFRjCCAy6gAwIBAgIIbYwURrGmCu4wDQYJKoZIhvcNAQEMBQAwQTELMAkGA1UE
1602 BhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MRwwGgYDVQQDDBNBZmZpcm1UcnVz
1603 dCBQcmVtaXVtMB4XDTEwMDEyOTE0MTAzNloXDTQwMTIzMTE0MTAzNlowQTELMAkG
1604 A1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MRwwGgYDVQQDDBNBZmZpcm1U
1605 cnVzdCBQcmVtaXVtMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAxBLf
1606 qV/+Qd3d9Z+K4/as4Tx4mrzY8H96oDMq3I0gW64tb+eT2TZwamjPjlGjhVtnBKAQ
1607 JG9dKILBl1fYSCkTtuG+kU3fhQxTGJoeJKJPj/CihQvL9Cl/0qRY7iZNyaqoe5rZ
1608 +jjeRFcV5fiMyNlI4g0WJx0eyIOFJbe6qlVBzAMiSy2RjYvmia9mx+n/K+k8rNrS
1609 s8PhaJyJ+HoAVt70VZVs+7pk3WKL3wt3MutizCaam7uqYoNMtAZ6MMgpv+0GTZe5
1610 HMQxK9VfvFMSF5yZVylmd2EhMQcuJUmdGPLu8ytxjLW6OQdJd/zvLpKQBY0tL3d7
1611 70O/Nbua2Plzpyzy0FfuKE4mX4+QaAkvuPjcBukumj5Rp9EixAqnOEhss/n/fauG
1612 V+O61oV4d7pD6kh/9ti+I20ev9E2bFhc8e6kGVQa9QPSdubhjL08s9NIS+LI+H+S
1613 qHZGnEJlPqQewQcDWkYtuJfzt9WyVSHvutxMAJf7FJUnM7/oQ0dG0giZFmA7mn7S
1614 5u046uwBHjxIVkkJx0w3AJ6IDsBz4W9m6XJHMD4Q5QsDyZpCAGzFlH5hxIrff4Ia
1615 C1nEWTJ3s7xgaVY5/bQGeyzWZDbZvUjthB9+pSKPKrhC9IK31FOQeE4tGv2Bb0TX
1616 OwF0lkLgAOIua+rF7nKsu7/+6qqo+Nz2snmKtmcCAwEAAaNCMEAwHQYDVR0OBBYE
1617 FJ3AZ6YMItkm9UWrpmVSESfYRaxjMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/
1618 BAQDAgEGMA0GCSqGSIb3DQEBDAUAA4ICAQCzV00QYk465KzquByvMiPIs0laUZx2
1619 KI15qldGF9X1Uva3ROgIRL8YhNILgM3FEv0AVQVhh0HctSSePMTYyPtwni94loMg
1620 Nt58D2kTiKV1NpgIpsbfrM7jWNa3Pt668+s0QNiigfV4Py/VpfzZotReBA4Xrf5B
1621 8OWycvpEgjNC6C1Y91aMYj+6QrCcDFx+LmUmXFNPALJ4fqENmS2NuB2OosSw/WDQ
1622 MKSOyARiqcTtNd56l+0OOF6SL5Nwpamcb6d9Ex1+xghIsV5n61EIJenmJWtSKZGc
1623 0jlzCFfemQa0W50QBuHCAKi4HEoCChTQwUHK+4w1IX2COPKpVJEZNZOUbWo6xbLQ
1624 u4mGk+ibyQ86p3q4ofB4Rvr8Ny/lioTz3/4E2aFooC8k4gmVBtWVyuEklut89pMF
1625 u+1z6S3RdTnX5yTb2E5fQ4+e0BQ5v1VwSJlXMbSc7kqYA5YwH2AG7hsj/oFgIxpH
1626 YoWlzBk0gG+zrBrjn/B7SK3VAdlntqlyk+otZrWyuOQ9PLLvTIzq6we/qzWaVYa8
1627 GKa1qF60g2xraUDTn9zxw2lrueFtCfTxqlB2Cnp9ehehVZZCmTEJ3WARjQUwfuaO
1628 RtGdFNrHF+QFlozEJLUbzxQHskD4o55BhrwE0GuWyCqANP2/7waj3VjFhT0+j/6e
1629 KeC2uAloGRwYQw==
1630 -----END CERTIFICATE-----
1631
1632 -----BEGIN CERTIFICATE-----
1633 MIID7zCCAtegAwIBAgIBADANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UEBhMCVVMx
1634 EDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoT
1635 HFN0YXJmaWVsZCBUZWNobm9sb2dpZXMsIEluYy4xOzA5BgNVBAMTMlN0YXJmaWVs
1636 ZCBTZXJ2aWNlcyBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5
1637 MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgZgxCzAJBgNVBAYTAlVTMRAwDgYD
1638 VQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxTdGFy
1639 ZmllbGQgVGVjaG5vbG9naWVzLCBJbmMuMTswOQYDVQQDEzJTdGFyZmllbGQgU2Vy
1640 dmljZXMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZI
1641 hvcNAQEBBQADggEPADCCAQoCggEBANUMOsQq+U7i9b4Zl1+OiFOxHz/Lz58gE20p
1642 OsgPfTz3a3Y4Y9k2YKibXlwAgLIvWX/2h/klQ4bnaRtSmpDhcePYLQ1Ob/bISdm2
1643 8xpWriu2dBTrz/sm4xq6HZYuajtYlIlHVv8loJNwU4PahHQUw2eeBGg6345AWh1K
1644 Ts9DkTvnVtYAcMtS7nt9rjrnvDH5RfbCYM8TWQIrgMw0R9+53pBlbQLPLJGmpufe
1645 hRhJfGZOozptqbXuNC66DQO4M99H67FrjSXZm86B0UVGMpZwh94CDklDhbZsc7tk
1646 6mFBrMnUVN+HL8cisibMn1lUaJ/8viovxFUcdUBgF4UCVTmLfwUCAwEAAaNCMEAw
1647 DwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJxfAN+q
1648 AdcwKziIorhtSpzyEZGDMA0GCSqGSIb3DQEBCwUAA4IBAQBLNqaEd2ndOxmfZyMI
1649 bw5hyf2E3F/YNoHN2BtBLZ9g3ccaaNnRbobhiCPPE95Dz+I0swSdHynVv/heyNXB
1650 ve6SbzJ08pGCL72CQnqtKrcgfU28elUSwhXqvfdqlS5sdJ/PHLTyxQGjhdByPq1z
1651 qwubdQxtRbeOlKyWN7Wg0I8VRw7j6IPdj/3vQQF3zCepYoUz8jcI73HPdwbeyBkd
1652 iEDPfUYd/x7H4c7/I9vG+o1VTqkC50cRRj70/b17KSa7qWFiNyi2LSr2EIZkyXCn
1653 0q23KXB56jzaYyWf/Wi3MOxw+3WKt21gZ7IeyLnp2KhvAotnDU0mV3HaIPzBSlCN
1654 sSi6
1655 -----END CERTIFICATE-----
1656
1657 -----BEGIN CERTIFICATE-----
1658 MIIEvTCCA6WgAwIBAgIBADANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJFVTEn
1659 MCUGA1UEChMeQUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQL
1660 ExpodHRwOi8vd3d3LmNoYW1iZXJzaWduLm9yZzEiMCAGA1UEAxMZQ2hhbWJlcnMg
1661 b2YgQ29tbWVyY2UgUm9vdDAeFw0wMzA5MzAxNjEzNDNaFw0zNzA5MzAxNjEzNDRa
1662 MH8xCzAJBgNVBAYTAkVVMScwJQYDVQQKEx5BQyBDYW1lcmZpcm1hIFNBIENJRiBB
1663 ODI3NDMyODcxIzAhBgNVBAsTGmh0dHA6Ly93d3cuY2hhbWJlcnNpZ24ub3JnMSIw
1664 IAYDVQQDExlDaGFtYmVycyBvZiBDb21tZXJjZSBSb290MIIBIDANBgkqhkiG9w0B
1665 AQEFAAOCAQ0AMIIBCAKCAQEAtzZV5aVdGDDg2olUkfzIx1L4L1DZ77F1c2VHfRtb
1666 unXF/KGIJPov7coISjlUxFF6tdpg6jg8gbLL8bvZkSM/SAFwdakFKq0fcfPJVD0d
1667 BmpAPrMMhe5cG3nCYsS4No41XQEMIwRHNaqbYE6gZj3LJgqcQKH0XZi/caulAGgq
1668 7YN6D6IUtdQis4CwPAxaUWktWBiP7Zme8a7ileb2R6jWDA+wWFjbw2Y3npuRVDM3
1669 0pQcakjJyfKl2qUMI/cjDpwyVV5xnIQFUZot/eZOKjRa3spAN2cMVCFVd9oKDMyX
1670 roDclDZK9D7ONhMeU+SsTjoF7Nuucpw4i9A5O4kKPnf+dQIBA6OCAUQwggFAMBIG
1671 A1UdEwEB/wQIMAYBAf8CAQwwPAYDVR0fBDUwMzAxoC+gLYYraHR0cDovL2NybC5j
1672 aGFtYmVyc2lnbi5vcmcvY2hhbWJlcnNyb290LmNybDAdBgNVHQ4EFgQU45T1sU3p
1673 26EpW1eLTXYGduHRooowDgYDVR0PAQH/BAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIA
1674 BzAnBgNVHREEIDAegRxjaGFtYmVyc3Jvb3RAY2hhbWJlcnNpZ24ub3JnMCcGA1Ud
1675 EgQgMB6BHGNoYW1iZXJzcm9vdEBjaGFtYmVyc2lnbi5vcmcwWAYDVR0gBFEwTzBN
1676 BgsrBgEEAYGHLgoDATA+MDwGCCsGAQUFBwIBFjBodHRwOi8vY3BzLmNoYW1iZXJz
1677 aWduLm9yZy9jcHMvY2hhbWJlcnNyb290Lmh0bWwwDQYJKoZIhvcNAQEFBQADggEB
1678 AAxBl8IahsAifJ/7kPMa0QOx7xP5IV8EnNrJpY0nbJaHkb5BkAFyk+cefV/2icZd
1679 p0AJPaxJRUXcLo0waLIJuvvDL8y6C98/d3tGfToSJI6WjzwFCm/SlCgdbQzALogi
1680 1djPHRPH8EjX1wWnz8dHnjs8NMiAT9QUu/wNUPf6s+xCX6ndbcj0dc97wXImsQEc
1681 XCz9ek60AcUFV7nnPKoF2YjpB0ZBzu9Bga5Y34OirsrXdx/nADydb47kMgkdTXg0
1682 eDQ8lJsm7U9xxhl6vSAiSFr+S30Dt+dYvsYyTnQeaN2oaFuzPu5ifdmA6Ap1erfu
1683 tGWaIZDgqtCYvDi1czyL+Nw=
1684 -----END CERTIFICATE-----
1685
1686 -----BEGIN CERTIFICATE-----
1687 MIIF3TCCA8WgAwIBAgIIeyyb0xaAMpkwDQYJKoZIhvcNAQELBQAwfDELMAkGA1UE
1688 BhMCVVMxDjAMBgNVBAgMBVRleGFzMRAwDgYDVQQHDAdIb3VzdG9uMRgwFgYDVQQK
1689 DA9TU0wgQ29ycG9yYXRpb24xMTAvBgNVBAMMKFNTTC5jb20gUm9vdCBDZXJ0aWZp
1690 Y2F0aW9uIEF1dGhvcml0eSBSU0EwHhcNMTYwMjEyMTczOTM5WhcNNDEwMjEyMTcz
1691 OTM5WjB8MQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMxEDAOBgNVBAcMB0hv
1692 dXN0b24xGDAWBgNVBAoMD1NTTCBDb3Jwb3JhdGlvbjExMC8GA1UEAwwoU1NMLmNv
1693 bSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IFJTQTCCAiIwDQYJKoZIhvcN
1694 AQEBBQADggIPADCCAgoCggIBAPkP3aMrfcvQKv7sZ4Wm5y4bunfh4/WvpOz6Sl2R
1695 xFdHaxh3a3by/ZPkPQ/CFp4LZsNWlJ4Xg4XOVu/yFv0AYvUiCVToZRdOQbngT0aX
1696 qhvIuG5iXmmxX9sqAn78bMrzQdjt0Oj8P2FI7bADFB0QDksZ4LtO7IZl/zbzXmcC
1697 C52GVWH9ejjt/uIZALdvoVBidXQ8oPrIJZK0bnoix/geoeOy3ZExqysdBP+lSgQ3
1698 6YWkMyv94tZVNHwZpEpox7Ko07fKoZOI68GXvIz5HdkihCR0xwQ9aqkpk8zruFvh
1699 /l8lqjRYyMEjVJ0bmBHDOJx+PYZspQ9AhnwC9FwCTyjLrnGfDzrIM/4RJTXq/LrF
1700 YD3ZfBjVsqnTdXgDciLKOsMf7yzlLqn6niy2UUb9rwPW6mBo6oUWNmuF6R7As93E
1701 JNyAKoFBbZQ+yODJgUEAnl6/f8UImKIYLEJAs/lvOCdLToD0PYFH4Ih86hzOtXVc
1702 US4cK38acijnALXRdMbX5J+tB5O2UzU1/Dfkw/ZdFr4hc96SCvigY2q8lpJqPvi8
1703 ZVWb3vUNiSYE/CUapiVpy8JtynziWV+XrOvvLsi81xtZPCvM8hnIk2snYxnP/Okm
1704 +Mpxm3+T/jRnhE6Z6/yzeAkzcLpmpnbtG3PrGqUNxCITIJRWCk4sbE6x/c+cCbqi
1705 M+2HAgMBAAGjYzBhMB0GA1UdDgQWBBTdBAkHovV6fVJTEpKV7jiAJQ2mWTAPBgNV
1706 HRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFN0ECQei9Xp9UlMSkpXuOIAlDaZZMA4G
1707 A1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQsFAAOCAgEAIBgRlCn7Jp0cHh5wYfGV
1708 cpNxJK1ok1iOMq8bs3AD/CUrdIWQPXhq9LmLpZc7tRiRux6n+UBbkflVma8eEdBc
1709 Hadm47GUBwwyOabqG7B52B2ccETjit3E+ZUfijhDPwGFpUenPUayvOUiaPd7nNgs
1710 PgohyC0zrL/FgZkxdMF1ccW+sfAjRfSda/wZY52jvATGGAslu1OJD7OAUN5F7kR/
1711 q5R4ZJjT9ijdh9hwZXT7DrkT66cPYakylszeu+1jTBi7qUD3oFRuIIhxdRjqerQ0
1712 cuAjJ3dctpDqhiVAq+8zD8ufgr6iIPv2tS0a5sKFsXQP+8hlAqRSAUfdSSLBv9jr
1713 a6x+3uxjMxW3IwiPxg+NQVrdjsW5j+VFP3jbutIbQLH+cU0/4IGiul607BXgk90I
1714 H37hVZkLId6Tngr75qNJvTYw/ud3sqB1l7UtgYgXZSD32pAAn8lSzDLKNXz1PQ/Y
1715 K9f1JmzJBjSWFupwWRoyeXkLtoh/D1JIPb9s2KJELtFOt3JY04kTlf5Eq/jXixtu
1716 nLwsoFvVagCvXzfh1foQC5ichucmj87w7G6KVwuA406ywKBjYZC6VWg3dGq2ktuf
1717 oYYitmUnDuy2n0Jg5GfCtdpBC8TTi2EbvPofkSvXRAdeuims2cXp71NIWuuA8ShY
1718 Ic2wBlX7Jz9TkHCpBB5XJ7k=
1719 -----END CERTIFICATE-----
1720
1721 -----BEGIN CERTIFICATE-----
1722 MIICiDCCAg2gAwIBAgIQNfwmXNmET8k9Jj1Xm67XVjAKBggqhkjOPQQDAzCBhDEL
1723 MAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjE4MDYGA1UECxMvKGMp
1724 IDIwMDcgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAi
1725 BgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EgLSBHMjAeFw0wNzExMDUwMDAw
1726 MDBaFw0zODAxMTgyMzU5NTlaMIGEMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMdGhh
1727 d3RlLCBJbmMuMTgwNgYDVQQLEy8oYykgMjAwNyB0aGF3dGUsIEluYy4gLSBGb3Ig
1728 YXV0aG9yaXplZCB1c2Ugb25seTEkMCIGA1UEAxMbdGhhd3RlIFByaW1hcnkgUm9v
1729 dCBDQSAtIEcyMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEotWcgnuVnfFSeIf+iha/
1730 BebfowJPDQfGAFG6DAJSLSKkQjnE/o/qycG+1E3/n3qe4rF8mq2nhglzh9HnmuN6
1731 papu+7qzcMBniKI11KOasf2twu8x+qi58/sIxpHR+ymVo0IwQDAPBgNVHRMBAf8E
1732 BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUmtgAMADna3+FGO6Lts6K
1733 DPgR4bswCgYIKoZIzj0EAwMDaQAwZgIxAN344FdHW6fmCsO99YCKlzUNG4k8VIZ3
1734 KMqh9HneteY4sPBlcIx/AlTCv//YoT7ZzwIxAMSNlPzcU9LcnXgWHxUzI1NS41ox
1735 XZ3Krr0TKUQNJ1uo52icEvdYPy5yAlejj6EULg==
1736 -----END CERTIFICATE-----
1737
1738 -----BEGIN CERTIFICATE-----
1739 MIIGSzCCBDOgAwIBAgIRANm1Q3+vqTkPAAAAAFVlrVgwDQYJKoZIhvcNAQELBQAw
1740 gb4xCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQL
1741 Ex9TZWUgd3d3LmVudHJ1c3QubmV0L2xlZ2FsLXRlcm1zMTkwNwYDVQQLEzAoYykg
1742 MjAxNSBFbnRydXN0LCBJbmMuIC0gZm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxMjAw
1743 BgNVBAMTKUVudHJ1c3QgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEc0
1744 MB4XDTE1MDUyNzExMTExNloXDTM3MTIyNzExNDExNlowgb4xCzAJBgNVBAYTAlVT
1745 MRYwFAYDVQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQLEx9TZWUgd3d3LmVudHJ1
1746 c3QubmV0L2xlZ2FsLXRlcm1zMTkwNwYDVQQLEzAoYykgMjAxNSBFbnRydXN0LCBJ
1747 bmMuIC0gZm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxMjAwBgNVBAMTKUVudHJ1c3Qg
1748 Um9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEc0MIICIjANBgkqhkiG9w0B
1749 AQEFAAOCAg8AMIICCgKCAgEAsewsQu7i0TD/pZJH4i3DumSXbcr3DbVZwbPLqGgZ
1750 2K+EbTBwXX7zLtJTmeH+H17ZSK9dE43b/2MzTdMAArzE+NEGCJR5WIoV3imz/f3E
1751 T+iq4qA7ec2/a0My3dl0ELn39GjUu9CH1apLiipvKgS1sqbHoHrmSKvS0VnM1n4j
1752 5pds8ELl3FFLFUHtSUrJ3hCX1nbB76W1NhSXNdh4IjVS70O92yfbYVaCNNzLiGAM
1753 C1rlLAHGVK/XqsEQe9IFWrhAnoanw5CGAlZSCXqc0ieCU0plUmr1POeo8pyvi73T
1754 DtTUXm6Hnmo9RR3RXRv06QqsYJn7ibT/mCzPfB3pAqoEmh643IhuJbNsZvc8kPNX
1755 wbMv9W3y+8qh+CmdRouzavbmZwe+LGcKKh9asj5XxNMhIWNlUpEbsZmOeX7m640A
1756 2Vqq6nPopIICR5b+W45UYaPrL0swsIsjdXJ8ITzI9vF01Bx7owVV7rtNOzK+mndm
1757 nqxpkCIHH2E6lr7lmk/MBTwoWdPBDFSoWWG9yHJM6Nyfh3+9nEg2XpWjDrk4JFX8
1758 dWbrAuMINClKxuMrLzOg2qOGpRKX/YAr2hRC45K9PvJdXmd0LhyIRyk0X+IyqJwl
1759 N4y6mACXi0mWHv0liqzc2thddG5msP9E36EYxr5ILzeUePiVSj9/E15dWf10hkNj
1760 c0kCAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYD
1761 VR0OBBYEFJ84xFYjwznooHFs6FRM5Og6sb9nMA0GCSqGSIb3DQEBCwUAA4ICAQAS
1762 5UKme4sPDORGpbZgQIeMJX6tuGguW8ZAdjwD+MlZ9POrYs4QjbRaZIxowLByQzTS
1763 Gwv2LFPSypBLhmb8qoMi9IsabyZIrHZ3CL/FmFz0Jomee8O5ZDIBf9PD3Vht7LGr
1764 hFV0d4QEJ1JrhkzO3bll/9bGXp+aEJlLdWr+aumXIOTkdnrG0CSqkM0gkLpHZPt/
1765 B7NTeLUKYvJzQ85BK4FqLoUWlFPUa19yIqtRLULVAJyZv967lDtX/Zr1hstWO1uI
1766 AeV8KEsD+UmDfLJ/fOPtjqF/YFOOVZ1QNBIPt5d7bIdKROf1beyAN/BYGW5KaHbw
1767 H5Lk6rWS02FREAutp9lfx1/cH6NcjKF+m7ee01ZvZl4HliDtC3T7Zk6LERXpgUl+
1768 b7DUUH8i119lAg2m9IUe2K4GS0qn0jFmwvjO5QimpAKWRGhXxNUzzxkvFMSUHHuk
1769 2fCfDrGA4tGeEWSpiBE6doLlYsKA2KSD7ZPvfC+QsDJMlhVoSFLUmQjAJOgc47Ol
1770 IQ6SwJAfzyBfyjs4x7dtOvPmRLgOMWuIjnDrnBdSqEGULoe256YSxXXfW8AKbnuk
1771 5F6G+TaU33fD6Q3AOfF5u0aOq0NZJ7cguyPpVkAh7DE9ZapD8j3fcEThuk0mEDuY
1772 n/PIjhs4ViFqUZPTkcpG2om3PVODLAgfi49T3f+sHw==
1773 -----END CERTIFICATE-----
1774
1775 -----BEGIN CERTIFICATE-----
1776 MIIDuzCCAqOgAwIBAgIDBETAMA0GCSqGSIb3DQEBBQUAMH4xCzAJBgNVBAYTAlBM
1777 MSIwIAYDVQQKExlVbml6ZXRvIFRlY2hub2xvZ2llcyBTLkEuMScwJQYDVQQLEx5D
1778 ZXJ0dW0gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxIjAgBgNVBAMTGUNlcnR1bSBU
1779 cnVzdGVkIE5ldHdvcmsgQ0EwHhcNMDgxMDIyMTIwNzM3WhcNMjkxMjMxMTIwNzM3
1780 WjB+MQswCQYDVQQGEwJQTDEiMCAGA1UEChMZVW5pemV0byBUZWNobm9sb2dpZXMg
1781 Uy5BLjEnMCUGA1UECxMeQ2VydHVtIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MSIw
1782 IAYDVQQDExlDZXJ0dW0gVHJ1c3RlZCBOZXR3b3JrIENBMIIBIjANBgkqhkiG9w0B
1783 AQEFAAOCAQ8AMIIBCgKCAQEA4/t9o3K6wvDJFIf1awFO4W5AB7ptJ11/91sts1rH
1784 UV+rpDKmYYe2bg+G0jACl/jXaVehGDldamR5xgFZrDwxSjh80gTSSyjoIF87B6LM
1785 TXPb865Px1bVWqeWifrzq2jUI4ZZJ88JJ7ysbnKDHDBy3+Ci6dLhdHUZvSqeexVU
1786 BBvXQzmtVSjF4hq79MDkrjhJM8x2hZ85RdKknvISjFH4fOQtf/WsX+sWn7Et0brM
1787 kUJ3TCXJkDhv2/DM+44el1k+1WBO5gUo7Ul5E0u6SNsv+XLTOcr+H9g0cvW0QM8x
1788 AcPs3hEtF10fuFDRXhmnad4HMyjKUJX5p1TLVIZQRan5SQIDAQABo0IwQDAPBgNV
1789 HRMBAf8EBTADAQH/MB0GA1UdDgQWBBQIds3LB/8k9sXN7buQvOKEN0Z19zAOBgNV
1790 HQ8BAf8EBAMCAQYwDQYJKoZIhvcNAQEFBQADggEBAKaorSLOAT2mo/9i0Eidi15y
1791 sHhE49wcrwn9I0j6vSrEuVUEtRCjjSfeC4Jj0O7eDDd5QVsisrCaQVymcODU0HfL
1792 I9MA4GxWL+FpDQ3Zqr8hgVDZBqWo/5U30Kr+4rP1mS1FhIrlQgnXdAIv94nYmem8
1793 J9RHjboNRhx3zxSkHLmkMcScKHQDNP8zGSal6Q10tz6XxnboJ5ajZt3hrvJBW8qY
1794 VoNzcOSGGtIxQbovvi0TWnZvTuhOgQ4/WwMioBK+ZlgRSssDxLQqKi2WF+A5VLxI
1795 03YnnZotBqbJ7DnSq9ufmgsnAjUpsUCV5/nonFWIGUbWtzT1fs45mtk48VH3Tyw=
1796 -----END CERTIFICATE-----
1797
1798 -----BEGIN CERTIFICATE-----
1799 MIIDNjCCAp+gAwIBAgIQNhIilsXjOKUgodJfTNcJVDANBgkqhkiG9w0BAQUFADCB
1800 zjELMAkGA1UEBhMCWkExFTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJ
1801 Q2FwZSBUb3duMR0wGwYDVQQKExRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UE
1802 CxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UEAxMYVGhh
1803 d3RlIFByZW1pdW0gU2VydmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNl
1804 cnZlckB0aGF3dGUuY29tMB4XDTk2MDgwMTAwMDAwMFoXDTIxMDEwMTIzNTk1OVow
1805 gc4xCzAJBgNVBAYTAlpBMRUwEwYDVQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcT
1806 CUNhcGUgVG93bjEdMBsGA1UEChMUVGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNV
1807 BAsTH0NlcnRpZmljYXRpb24gU2VydmljZXMgRGl2aXNpb24xITAfBgNVBAMTGFRo
1808 YXd0ZSBQcmVtaXVtIFNlcnZlciBDQTEoMCYGCSqGSIb3DQEJARYZcHJlbWl1bS1z
1809 ZXJ2ZXJAdGhhd3RlLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0jY2
1810 aovXwlue2oFBYo847kkEVdbQ7xwblRZH7xhINTpS9CtqBo87L+pW46+GjZ4X9560
1811 ZXUCTe/LCaIhUdib0GfQug2SBhRz1JPLlyoAnFxODLz6FVL88kRu2hFKbgifLy3j
1812 +ao6hnO2RlNYyIkFvYMRuHM/qgeN9EJN50CdHDcCAwEAAaMTMBEwDwYDVR0TAQH/
1813 BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQBlkKyID1bZ5jA01CbH0FDxkt5r1DmI
1814 CSLGpmODA/eZd9iy5Ri4XWPz1HP7bJyZePFLeH0ZJMMrAoT4vCLZiiLXoPxx7JGH
1815 IPG47LHlVYCsPVLIOQ7C8MAFT9aCdYy9X9LcdpoFEsmvcsPcJX6kTY4XpeCHf+Ga
1816 WuFg3GQjPEIuTQ==
1817 -----END CERTIFICATE-----
1818
1819 -----BEGIN CERTIFICATE-----
1820 MIIFvTCCA6WgAwIBAgIITxvUL1S7L0swDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UE
1821 BhMCQ0gxFTATBgNVBAoTDFN3aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWdu
1822 IFNpbHZlciBDQSAtIEcyMB4XDTA2MTAyNTA4MzI0NloXDTM2MTAyNTA4MzI0Nlow
1823 RzELMAkGA1UEBhMCQ0gxFTATBgNVBAoTDFN3aXNzU2lnbiBBRzEhMB8GA1UEAxMY
1824 U3dpc3NTaWduIFNpbHZlciBDQSAtIEcyMIICIjANBgkqhkiG9w0BAQEFAAOCAg8A
1825 MIICCgKCAgEAxPGHf9N4Mfc4yfjDmUO8x/e8N+dOcbpLj6VzHVxumK4DV644N0Mv
1826 Fz0fyM5oEMF4rhkDKxD6LHmD9ui5aLlV8gREpzn5/ASLHvGiTSf5YXu6t+WiE7br
1827 YT7QbNHm+/pe7R20nqA1W6GSy/BJkv6FCgU+5tkL4k+73JU3/JHpMjUi0R86TieF
1828 nbAVlDLaYQ1HTWBCrpJH6INaUFjpiou5XaHc3ZlKHzZnu0jkg7Y360g6rw9njxcH
1829 6ATK72oxh9TAtvmUcXtnZLi2kUpCe2UuMGoM9ZDulebyzYLs2aFK7PayS+VFheZt
1830 eJMELpyCbTapxDFkH4aDCyr0NQp4yVXPQbBH6TCfmb5hqAaEuSh6XzjZG6k4sIN/
1831 c8HDO0gqgg8hm7jMqDXDhBuDsz6+pJVpATqJAHgE2cn0mRmrVn5bi4Y5FZGkECwJ
1832 MoBgs5PAKrYYC51+jUnyEEp/+dVGLxmSo5mnJqy7jDzmDrxHB9xzUfFwZC8I+bRH
1833 HTBsROopN4WSaGa8gzj+ezku01DwH/teYLappvonQfGbGHLy9YR0SslnxFSuSGTf
1834 jNFusB3hB48IHpmccelM2KX3RxIfdNFRnobzwqIjQAtz20um53MGjMGg6cFZrEb6
1835 5i/4z3GcRm25xBWNOHkDRUjvxF3XCO6HOSKGsg0PWEP3calILv3q1h8CAwEAAaOB
1836 rDCBqTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU
1837 F6DNweRBtjpbO8tFnb0cwpj6hlgwHwYDVR0jBBgwFoAUF6DNweRBtjpbO8tFnb0c
1838 wpj6hlgwRgYDVR0gBD8wPTA7BglghXQBWQEDAQEwLjAsBggrBgEFBQcCARYgaHR0
1839 cDovL3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIB
1840 AHPGgeAn0i0P4JUw4ppBf1AsX19iYamGamkYDHRJ1l2E6kFSGG9YrVBWIGrGvShp
1841 WJHckRE1qTodvBqlYJ7YH39FkWnZfrt4csEGDyrOj4VwYaygzQu4OSlWhDJOhrs9
1842 xCrZ1x9y7v5RoSJBsXECYxqCsGKrXlcSH9/L3XWgwF15kIwb4FDm3jH+mHtwX6WQ
1843 2K34ArZv02DdQEsixT2tOnqfGhpHkXkzuoLcMmkDlm4fS/Bx/uNncqCxv1yL5PqZ
1844 IseEuRuNI5c/7SXgz2W79WEE790eslpBIlqhn10s6FvJbakMDHiqYMZWjwFaDGi8
1845 aRl5xB9+lwW/xekkUV7U1UtT7dkjWjYDZaPBA61BMPNGG4WQr2W11bHkFlt4dR2X
1846 em1ZqSqPe97Dh4kQmUlzeMg9vVE1dCrV8X5pGyq7O70luJpaPXJhkGaH7gzWTdQR
1847 dAtq/gsD/KNVV4n+SsuuWxcFyPKNIzFTONItaj+CuY0IavdeQXRuwxF+B6wpYJE/
1848 OMpXEA29MC/HpeZBoNquBYeaoKRlbEwJDIm6uNO5wJOKMPqN5ZprFQFOZ6raYlY+
1849 hAhm0sQ2fac+EPyI4NSA5QC9qvNOBqN6avlicuMJT+ubDgEj8Z+7fNzcbBGXJbLy
1850 tGMU0gYqZ4yD9c7qB9iaah7s5Aq7KkzrCWA5zspi2C5u
1851 -----END CERTIFICATE-----
1852
1853 -----BEGIN CERTIFICATE-----
1854 MIIDTDCCAjSgAwIBAgIId3cGJyapsXwwDQYJKoZIhvcNAQELBQAwRDELMAkGA1UE
1855 BhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVz
1856 dCBDb21tZXJjaWFsMB4XDTEwMDEyOTE0MDYwNloXDTMwMTIzMTE0MDYwNlowRDEL
1857 MAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZp
1858 cm1UcnVzdCBDb21tZXJjaWFsMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC
1859 AQEA9htPZwcroRX1BiLLHwGy43NFBkRJLLtJJRTWzsO3qyxPxkEylFf6EqdbDuKP
1860 Hx6GGaeqtS25Xw2Kwq+FNXkyLbscYjfysVtKPcrNcV/pQr6U6Mje+SJIZMblq8Yr
1861 ba0F8PrVC8+a5fBQpIs7R6UjW3p6+DM/uO+Zl+MgwdYoic+U+7lF7eNAFxHUdPAL
1862 MeIrJmqbTFeurCA+ukV6BfO9m2kVrn1OIGPENXY6BwLJN/3HR+7o8XYdcxXyl6S1
1863 yHp52UKqK39c/s4mT6NmgTWvRLpUHhwwMmWd5jyTXlBOeuM61G7MGvv50jeuJCqr
1864 VwMiKA1JdX+3KNp1v47j3A55MQIDAQABo0IwQDAdBgNVHQ4EFgQUnZPGU4teyq8/
1865 nx4P5ZmVvCT2lI8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwDQYJ
1866 KoZIhvcNAQELBQADggEBAFis9AQOzcAN/wr91LoWXym9e2iZWEnStB03TX8nfUYG
1867 XUPGhi4+c7ImfU+TqbbEKpqrIZcUsd6M06uJFdhrJNTxFq7YpFzUf1GO7RgBsZNj
1868 vbz4YYCanrHOQnDiqX0GJX0nof5v7LMeJNrjS1UaADs1tDvZ110w/YETifLCBivt
1869 Z8SOyUOyXGsViQK8YvxO8rUzqrJv0wqiUOP2O+guRMLbZjipM1ZI8W0bM40NjD9g
1870 N53Tym1+NH4Nn3J2ixufcv1SNUFFApYvHLKac0khsUlHRUe072o0EclNmsxZt9YC
1871 nlpOZbWUrhvfKbAW8b8Angc6F2S1BLUjIZkKlTuXfO8=
1872 -----END CERTIFICATE-----
1873
1874 -----BEGIN CERTIFICATE-----
1875 MIIFwzCCA6ugAwIBAgIUCn6m30tEntpqJIWe5rgV0xZ/u7EwDQYJKoZIhvcNAQEL
1876 BQAwRjELMAkGA1UEBhMCTFUxFjAUBgNVBAoMDUx1eFRydXN0IFMuQS4xHzAdBgNV
1877 BAMMFkx1eFRydXN0IEdsb2JhbCBSb290IDIwHhcNMTUwMzA1MTMyMTU3WhcNMzUw
1878 MzA1MTMyMTU3WjBGMQswCQYDVQQGEwJMVTEWMBQGA1UECgwNTHV4VHJ1c3QgUy5B
1879 LjEfMB0GA1UEAwwWTHV4VHJ1c3QgR2xvYmFsIFJvb3QgMjCCAiIwDQYJKoZIhvcN
1880 AQEBBQADggIPADCCAgoCggIBANeFl78RmOnwYoNMPIf5U2o3C/IPPIfOb9wmKb3F
1881 ibrJgz337spbxm1Jc7TJRqMbNBM/wYlFV/TZsfs2ZUv7COJIcRHIbjuend+JZTem
1882 hfY7RBi2xjcwYkSSl2l9QjAk5A0MiWtj3sXh306pFGxT4GHO9hcvHTy95iJMHZP1
1883 EMShduxq3sVs35a0VkBCwGKSMKEtFZSg0iAGCW5qbeXrt77U8PEVfIvmTroTzEsn
1884 Xpk8F12PgX8zPU/TPxvsXD/wPEx1bvKm1Z3aLQdjAsZy6ZS8TEmVT4hSyNvoaYL4
1885 zDRbIvCGp4m9SAptZoFtyMhk+wHh9OHe2Z7d21vUKpkmFRseTJIpgp7VkoGSQXAZ
1886 96Tlk0u8d2cx3Rz9MXANF5kM+Qw5GSoXtTBxVdUPrljhPS80m8+f9niFwpN6cj5m
1887 j5wWEWCPnolvZ77gR1o7DJpni89Gxq44o/KnvObWhWszJHAiS8sIm7vI+AIpHb4g
1888 DEa/a4ebsypmQjVGbKq6rfmYe+lQVRQxv7HaLe2ArWgk+2mr2HETMOZns4dA/Yl+
1889 8kPREd8vZS9kzl8UubG/Mb2HeFpZZYiq/FkySIbWTLkpS5XTdvN3JW1CHDiDTf2j
1890 X5t/Lax5Gw5CMZdjpPuKadUiDTSQMC6otOBttpSsvItO13D8xTiOZCXhTTmQzsmH
1891 hFhxAgMBAAGjgagwgaUwDwYDVR0TAQH/BAUwAwEB/zBCBgNVHSAEOzA5MDcGByuB
1892 KwEBAQowLDAqBggrBgEFBQcCARYeaHR0cHM6Ly9yZXBvc2l0b3J5Lmx1eHRydXN0
1893 Lmx1MA4GA1UdDwEB/wQEAwIBBjAfBgNVHSMEGDAWgBT/GCh2+UgFLKGu8SsbK7JT
1894 +Et8szAdBgNVHQ4EFgQU/xgodvlIBSyhrvErGyuyU/hLfLMwDQYJKoZIhvcNAQEL
1895 BQADggIBAGoZFO1uecEsh9QNcH7X9njJCwROxLHOk3D+sFTAMs2ZMGQXvw/l4jP9
1896 BzZAcg4atmpZ1gDlaCDdLnINH2pkMSCEfUmmWjfrRcmF9dTHF5kH5ptV5AzoqbTO
1897 jFu1EVzPig4N1qx3gf4ynCSecs5U89BvolbW7MM3LGVYvlcAGvI1+ut7MV3CwRI9
1898 loGIlonBWVx65n9wNOeD4rHh4bhY79SV5GCc8JaXcozrhAIuZY+kt9J/Z93I055c
1899 qqmkoCUUBpvsT34tC38ddfEz2O3OuHVtPlu5mB0xDVbYQw8wkbIEa91WvpWAVWe+
1900 2M2D2RjuLg+GLZKecBPs3lHJQ3gCpU3I+V/EkVhGFndadKpAvAefMLmx9xIX3eP/
1901 JEAdemrRTxgKqpAd60Ae36EeRJIQmvKN4dFLRp7oRUKX6kWZ8+xm1QL68qZKJKre
1902 zrnK+T+Tb/mjuuqlPpmt/f97mfVl7vBZKGfXkJWkE4SphMHozs51k2MavDzq1WQf
1903 LSoSOcbDWjLtR5EWDrw4wVDej8oqkDQc7kGUnF4ZLvhFSZl0kbAEb+MEWrGrKqv+
1904 x9CWttrhSmQGbmBNvUJO/3jaJMobtNeWOWyu8Q6qp31IiyBMz2TWuJdGsE7RKlY6
1905 oJO9r4Ak4Ap+58rVyuiFVdw2KuGUaJPHZnJED4AhMmwlxyOAgwrr
1906 -----END CERTIFICATE-----
1907
1908 -----BEGIN CERTIFICATE-----
1909 MIIFuzCCA6OgAwIBAgIIVwoRl0LE48wwDQYJKoZIhvcNAQELBQAwazELMAkGA1UE
1910 BhMCSVQxDjAMBgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlzIFMucC5BLi8w
1911 MzM1ODUyMDk2NzEnMCUGA1UEAwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290
1912 IENBMB4XDTExMDkyMjExMjIwMloXDTMwMDkyMjExMjIwMlowazELMAkGA1UEBhMC
1913 SVQxDjAMBgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlzIFMucC5BLi8wMzM1
1914 ODUyMDk2NzEnMCUGA1UEAwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290IENB
1915 MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAp8bEpSmkLO/lGMWwUKNv
1916 UTufClrJwkg4CsIcoBh/kbWHuUA/3R1oHwiD1S0eiKD4j1aPbZkCkpAW1V8IbInX
1917 4ay8IMKx4INRimlNAJZaby/ARH6jDuSRzVju3PvHHkVH3Se5CAGfpiEd9UEtL0z9
1918 KK3giq0itFZljoZUj5NDKd45RnijMCO6zfB9E1fAXdKDa0hMxKufgFpbOr3JpyI/
1919 gCczWw63igxdBzcIy2zSekciRDXFzMwujt0q7bd9Zg1fYVEiVRvjRuPjPdA1Yprb
1920 rxTIW6HMiRvhMCb8oJsfgadHHwTrozmSBp+Z07/T6k9QnBn+locePGX2oxgkg4YQ
1921 51Q+qDp2JE+BIcXjDwL4k5RHILv+1A7TaLndxHqEguNTVHnd25zS8gebLra8Pu2F
1922 be8lEfKXGkJh90qX6IuxEAf6ZYGyojnP9zz/GPvG8VqLWeICrHuS0E4UT1lF9gxe
1923 KF+w6D9Fz8+vm2/7hNN3WpVvrJSEnu68wEqPSpP4RCHiMUVhUE4Q2OM1fEwZtN4F
1924 v6MGn8i1zeQf1xcGDXqVdFUNaBr8EBtiZJ1t4JWgw5QHVw0U5r0F+7if5t+L4sbn
1925 fpb2U8WANFAoWPASUHEXMLrmeGO89LKtmyuy/uE5jF66CyCU3nuDuP/jVo23Eek7
1926 jPKxwV2dpAtMK9myGPW1n0sCAwEAAaNjMGEwHQYDVR0OBBYEFFLYiDrIn3hm7Ynz
1927 ezhwlMkCAjbQMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUUtiIOsifeGbt
1928 ifN7OHCUyQICNtAwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBCwUAA4ICAQAL
1929 e3KHwGCmSUyIWOYdiPcUZEim2FgKDk8TNd81HdTtBjHIgT5q1d07GjLukD0R0i70
1930 jsNjLiNmsGe+b7bAEzlgqqI0JZN1Ut6nna0Oh4lScWoWPBkdg/iaKWW+9D+a2fDz
1931 WochcYBNy+A4mz+7+uAwTc+G02UQGRjRlwKxK3JCaKygvU5a2hi/a5iB0P2avl4V
1932 SM0RFbnAKVy06Ij3Pjaut2L9HmLecHgQHEhb2rykOLpn7VU+Xlff1ANATIGk0k9j
1933 pwlCCRT8AKnCgHNPLsBA2RF7SOp6AsDT6ygBJlh0wcBzIm2Tlf05fbsq4/aC4yyX
1934 X04fkZT6/iyj2HYauE2yOE+b+h1IYHkm4vP9qdCa6HCPSXrW5b0KDtst842/6+Ok
1935 fcvHlXHo2qN8xcL4dJIEG4aspCJTQLas/kx2z/uUMsA1n3Y/buWQbqCmJqK4LL7R
1936 K4X9p2jIugErsWx0Hbhzlefut8cl8ABMALJ+tguLHPPAUJ4lueAI3jZm/zel0btU
1937 ZCzJJ7VLkn5l/9Mt4blOvH+kQSGQQXemOR/qnuOf0GZvBeyqdn6/axag67XH/JJU
1938 LysRJyU3eExRarDzzFhdFPFqSBX/wge2sY0PjlxQRrM9vwGYT7JZVEc+NHt4bVaT
1939 LnPqZih4zR0Uv6CPLy64Lo7yFIrM6bV8+2ydDKXhlg==
1940 -----END CERTIFICATE-----
1941
1942 -----BEGIN CERTIFICATE-----
1943 MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh
1944 MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
1945 d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBD
1946 QTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAwMDAwMDBaMGExCzAJBgNVBAYTAlVT
1947 MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j
1948 b20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkqhkiG
1949 9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsB
1950 CSDMAZOnTjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97
1951 nh6Vfe63SKMI2tavegw5BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt
1952 43C/dxC//AH2hdmoRBBYMql1GNXRor5H4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7P
1953 T19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y7vrTC0LUq7dBMtoM1O/4
1954 gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQABo2MwYTAO
1955 BgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbR
1956 TLtm8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUw
1957 DQYJKoZIhvcNAQEFBQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/Esr
1958 hMAtudXH/vTBH1jLuG2cenTnmCmrEbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg
1959 06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIttep3Sp+dWOIrWcBAI+0tKIJF
1960 PnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886UAb3LujEV0ls
1961 YSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk
1962 CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4=
1963 -----END CERTIFICATE-----
1964
1965 -----BEGIN CERTIFICATE-----
1966 MIIFaDCCA1CgAwIBAgIBATANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJVUzEW
1967 MBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEeMBwGA1UEAxMVR2VvVHJ1c3QgVW5pdmVy
1968 c2FsIENBMB4XDTA0MDMwNDA1MDAwMFoXDTI5MDMwNDA1MDAwMFowRTELMAkGA1UE
1969 BhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xHjAcBgNVBAMTFUdlb1RydXN0
1970 IFVuaXZlcnNhbCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAKYV
1971 VaCjxuAfjJ0hUNfBvitbtaSeodlyWL0AG0y/YckUHUWCq8YdgNY96xCcOq9tJPi8
1972 cQGeBvV8Xx7BDlXKg5pZMK4ZyzBIle0iN430SppyZj6tlcDgFgDgEB8rMQ7XlFTT
1973 QjOgNB0eRXbdT8oYN+yFFXoZCPzVx5zw8qkuEKmS5j1YPakWaDwvdSEYfyh3peFh
1974 F7em6fgemdtzbvQKoiFs7tqqhZJmr/Z6a4LauiIINQ/PQvE1+mrufislzDoR5G2v
1975 c7J2Ha3QsnhnGqQ5HFELZ1aD/ThdDc7d8Lsrlh/eezJS/R27tQahsiFepdaVaH/w
1976 mZ7cRQg+59IJDTWU3YBOU5fXtQlEIGQWFwMCTFMNaN7VqnJNk22CDtucvc+081xd
1977 VHppCZbW2xHBjXWotM85yM48vCR85mLK4b19p71XZQvk/iXttmkQ3CgaRr0BHdCX
1978 teGYO8A3ZNY9lO4L4fUorgtWv3GLIylBjobFS1J72HGrH4oVpjuDWtdYAVHGTEHZ
1979 f9hBZ3KiKN9gg6meyHv8U3NyWfWTehd2Ds735VzZC1U0oqpbtWpU5xPKV+yXbfRe
1980 Bi9Fi1jUIxaS5BZuKGNZMN9QAZxjiRqf2xeUgnA3wySemkfWWspOqGmJch+RbNt+
1981 nhutxx9z3SxPGWX9f5NAEC7S8O08ni4oPmkmM8V7AgMBAAGjYzBhMA8GA1UdEwEB
1982 /wQFMAMBAf8wHQYDVR0OBBYEFNq7LqqwDLiIJlF0XG0D08DYj3rWMB8GA1UdIwQY
1983 MBaAFNq7LqqwDLiIJlF0XG0D08DYj3rWMA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG
1984 9w0BAQUFAAOCAgEAMXjmx7XfuJRAyXHEqDXsRh3ChfMoWIawC/yOsjmPRFWrZIRc
1985 aanQmjg8+uUfNeVE44B5lGiku8SfPeE0zTBGi1QrlaXv9z+ZhP015s8xxtxqv6fX
1986 IwjhmF7DWgh2qaavdy+3YL1ERmrvl/9zlcGO6JP7/TG37FcREUWbMPEaiDnBTzyn
1987 ANXH/KttgCJwpQzgXQQpAvvLoJHRfNbDflDVnVi+QTjruXU8FdmbyUqDWcDaU/0z
1988 uzYYm4UPFd3uLax2k7nZAY1IEKj79TiG8dsKxr2EoyNB3tZ3b4XUhRxQ4K5RirqN
1989 Pnbiucon8l+f725ZDQbYKxek0nxru18UGkiPGkzns0ccjkxFKyDuSN/n3QmOGKja
1990 QI2SJhFTYXNd673nxE0pN2HrrDktZy4W1vUAg4WhzH92xH3kt0tm7wNFYGm2DFKW
1991 koRepqO1pD4r2czYG0eq8kTaT/kD6PAUyz/zg97QwVTjt+gKN02LIFkDMBmhLMi9
1992 ER/frslKxfMnZmaGrGiR/9nmUxwPi1xpZQomyB40w11Re9epnAahNt3ViZS82eQt
1993 DF4JbAiXfKM9fJP/P6EUp8+1Xevb2xzEdt+Iub1FBZUbrvxGakyvSOPOrg/Sfuvm
1994 bJxPgWp6ZKy7PtXny3YuxadIwVyQD8vIP/rmMuGNG2+k5o7Y+SlIis5z/iw=
1995 -----END CERTIFICATE-----
1996
1997 -----BEGIN CERTIFICATE-----
1998 MIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJOTzEd
1999 MBsGA1UECgwUQnV5cGFzcyBBUy05ODMxNjMzMjcxIDAeBgNVBAMMF0J1eXBhc3Mg
2000 Q2xhc3MgMiBSb290IENBMB4XDTEwMTAyNjA4MzgwM1oXDTQwMTAyNjA4MzgwM1ow
2001 TjELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBhc3MgQVMtOTgzMTYzMzI3MSAw
2002 HgYDVQQDDBdCdXlwYXNzIENsYXNzIDIgUm9vdCBDQTCCAiIwDQYJKoZIhvcNAQEB
2003 BQADggIPADCCAgoCggIBANfHXvfBB9R3+0Mh9PT1aeTuMgHbo4Yf5FkNuud1g1Lr
2004 6hxhFUi7HQfKjK6w3Jad6sNgkoaCKHOcVgb/S2TwDCo3SbXlzwx87vFKu3MwZfPV
2005 L4O2fuPn9Z6rYPnT8Z2SdIrkHJasW4DptfQxh6NR/Md+oW+OU3fUl8FVM5I+GC91
2006 1K2GScuVr1QGbNgGE41b/+EmGVnAJLqBcXmQRFBoJJRfuLMR8SlBYaNByyM21cHx
2007 MlAQTn/0hpPshNOOvEu/XAFOBz3cFIqUCqTqc/sLUegTBxj6DvEr0VQVfTzh97QZ
2008 QmdiXnfgolXsttlpF9U6r0TtSsWe5HonfOV116rLJeffawrbD02TTqigzXsu8lkB
2009 arcNuAeBfos4GzjmCleZPe4h6KP1DBbdi+w0jpwqHAAVF41og9JwnxgIzRFo1clr
2010 Us3ERo/ctfPYV3Me6ZQ5BL/T3jjetFPsaRyifsSP5BtwrfKi+fv3FmRmaZ9JUaLi
2011 FRhnBkp/1Wy1TbMz4GHrXb7pmA8y1x1LPC5aAVKRCfLf6o3YBkBjqhHk/sM3nhRS
2012 P/TizPJhk9H9Z2vXUq6/aKtAQ6BXNVN48FP4YUIHZMbXb5tMOA1jrGKvNouicwoN
2013 9SG9dKpN6nIDSdvHXx1iY8f93ZHsM+71bbRuMGjeyNYmsHVee7QHIJihdjK4TWxP
2014 AgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFMmAd+BikoL1Rpzz
2015 uvdMw964o605MA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAgEAU18h
2016 9bqwOlI5LJKwbADJ784g7wbylp7ppHR/ehb8t/W2+xUbP6umwHJdELFx7rxP462s
2017 A20ucS6vxOOto70MEae0/0qyexAQH6dXQbLArvQsWdZHEIjzIVEpMMpghq9Gqx3t
2018 OluwlN5E40EIosHsHdb9T7bWR9AUC8rmyrV7d35BH16Dx7aMOZawP5aBQW9gkOLo
2019 +fsicdl9sz1Gv7SEr5AcD48Saq/v7h56rgJKihcrdv6sVIkkLE8/trKnToyokZf7
2020 KcZ7XC25y2a2t6hbElGFtQl+Ynhw/qlqYLYdDnkM/crqJIByw5c/8nerQyIKx+u2
2021 DISCLIBrQYoIwOula9+ZEsuK1V6ADJHgJgg2SMX6OBE1/yWDLfJ6v9r9jv6ly0Us
2022 H8SIU653DtmadsWOLB2jutXsMq7Aqqz30XpN69QH4kj3Io6wpJ9qzo6ysmD0oyLQ
2023 I+uUWnpp3Q+/QFesa1lQ2aOZ4W7+jQF5JyMV3pKdewlNWudLSDBaGOYKbeaP4NK7
2024 5t98biGCwWg5TbSYWGZizEqQXsP6JwSxeRV0mcy+rSDeJmAc61ZRpqPq5KM/p/9h
2025 3PFaTWwyI0PurKju7koSCTxdccK+efrCh2gdC/1cacwG0Jp9VJkqyTkaGa9LKkPz
2026 Y11aWOIv4x3kqdbQCtCev9eBCfHJxyYNrJgWVqA=
2027 -----END CERTIFICATE-----
2028
2029 -----BEGIN CERTIFICATE-----
2030 MIIC+TCCAoCgAwIBAgINAKaLeSkAAAAAUNCR+TAKBggqhkjOPQQDAzCBvzELMAkG
2031 A1UEBhMCVVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3
2032 d3cuZW50cnVzdC5uZXQvbGVnYWwtdGVybXMxOTA3BgNVBAsTMChjKSAyMDEyIEVu
2033 dHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ugb25seTEzMDEGA1UEAxMq
2034 RW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRUMxMB4XDTEy
2035 MTIxODE1MjUzNloXDTM3MTIxODE1NTUzNlowgb8xCzAJBgNVBAYTAlVTMRYwFAYD
2036 VQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQLEx9TZWUgd3d3LmVudHJ1c3QubmV0
2037 L2xlZ2FsLXRlcm1zMTkwNwYDVQQLEzAoYykgMjAxMiBFbnRydXN0LCBJbmMuIC0g
2038 Zm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxMzAxBgNVBAMTKkVudHJ1c3QgUm9vdCBD
2039 ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEVDMTB2MBAGByqGSM49AgEGBSuBBAAi
2040 A2IABIQTydC6bUF74mzQ61VfZgIaJPRbiWlH47jCffHyAsWfoPZb1YsGGYZPUxBt
2041 ByQnoaD41UcZYUx9ypMn6nQM72+WCf5j7HBdNq1nd67JnXxVRDqiY1Ef9eNi1KlH
2042 Bz7MIKNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0O
2043 BBYEFLdj5xrdjekIplWDpOBqUEFlEUJJMAoGCCqGSM49BAMDA2cAMGQCMGF52OVC
2044 R98crlOZF7ZvHH3hvxGU0QOIdeSNiaSKd0bebWHvAvX7td/M/k7//qnmpwIwW5nX
2045 hTcGtXsI/esni0qU+eH6p44mCOh8kmhtc9hvJqwhAriZtyZBWyVgrtBIGu4G
2046 -----END CERTIFICATE-----
2047
2048 -----BEGIN CERTIFICATE-----
2049 MIICPzCCAcWgAwIBAgIQBVVWvPJepDU1w6QP1atFcjAKBggqhkjOPQQDAzBhMQsw
2050 CQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cu
2051 ZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBHMzAe
2052 Fw0xMzA4MDExMjAwMDBaFw0zODAxMTUxMjAwMDBaMGExCzAJBgNVBAYTAlVTMRUw
2053 EwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20x
2054 IDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IEczMHYwEAYHKoZIzj0CAQYF
2055 K4EEACIDYgAE3afZu4q4C/sLfyHS8L6+c/MzXRq8NOrexpu80JX28MzQC7phW1FG
2056 fp4tn+6OYwwX7Adw9c+ELkCDnOg/QW07rdOkFFk2eJ0DQ+4QE2xy3q6Ip6FrtUPO
2057 Z9wj/wMco+I+o0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAd
2058 BgNVHQ4EFgQUs9tIpPmhxdiuNkHMEWNpYim8S8YwCgYIKoZIzj0EAwMDaAAwZQIx
2059 AK288mw/EkrRLTnDCgmXc/SINoyIJ7vmiI1Qhadj+Z4y3maTD/HMsQmP3Wyr+mt/
2060 oAIwOWZbwmSNuJ5Q3KjVSaLtx9zRSX8XAbjIho9OjIgrqJqpisXRAL34VOKa5Vt8
2061 sycX
2062 -----END CERTIFICATE-----
2063
2064 -----BEGIN CERTIFICATE-----
2065 MIIF0DCCBLigAwIBAgIEOrZQizANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJC
2066 TTEZMBcGA1UEChMQUXVvVmFkaXMgTGltaXRlZDElMCMGA1UECxMcUm9vdCBDZXJ0
2067 aWZpY2F0aW9uIEF1dGhvcml0eTEuMCwGA1UEAxMlUXVvVmFkaXMgUm9vdCBDZXJ0
2068 aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wMTAzMTkxODMzMzNaFw0yMTAzMTcxODMz
2069 MzNaMH8xCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMSUw
2070 IwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MS4wLAYDVQQDEyVR
2071 dW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG
2072 9w0BAQEFAAOCAQ8AMIIBCgKCAQEAv2G1lVO6V/z68mcLOhrfEYBklbTRvM16z/Yp
2073 li4kVEAkOPcahdxYTMukJ0KX0J+DisPkBgNbAKVRHnAEdOLB1Dqr1607BxgFjv2D
2074 rOpm2RgbaIr1VxqYuvXtdj182d6UajtLF8HVj71lODqV0D1VNk7feVcxKh7YWWVJ
2075 WCCYfqtffp/p1k3sg3Spx2zY7ilKhSoGFPlU5tPaZQeLYzcS19Dsw3sgQUSj7cug
2076 F+FxZc4dZjH3dgEZyH0DWLaVSR2mEiboxgx24ONmy+pdpibu5cxfvWenAScOospU
2077 xbF6lR1xHkopigPcakXBpBlebzbNw6Kwt/5cOOJSvPhEQ+aQuwIDAQABo4ICUjCC
2078 Ak4wPQYIKwYBBQUHAQEEMTAvMC0GCCsGAQUFBzABhiFodHRwczovL29jc3AucXVv
2079 dmFkaXNvZmZzaG9yZS5jb20wDwYDVR0TAQH/BAUwAwEB/zCCARoGA1UdIASCAREw
2080 ggENMIIBCQYJKwYBBAG+WAABMIH7MIHUBggrBgEFBQcCAjCBxxqBxFJlbGlhbmNl
2081 IG9uIHRoZSBRdW9WYWRpcyBSb290IENlcnRpZmljYXRlIGJ5IGFueSBwYXJ0eSBh
2082 c3N1bWVzIGFjY2VwdGFuY2Ugb2YgdGhlIHRoZW4gYXBwbGljYWJsZSBzdGFuZGFy
2083 ZCB0ZXJtcyBhbmQgY29uZGl0aW9ucyBvZiB1c2UsIGNlcnRpZmljYXRpb24gcHJh
2084 Y3RpY2VzLCBhbmQgdGhlIFF1b1ZhZGlzIENlcnRpZmljYXRlIFBvbGljeS4wIgYI
2085 KwYBBQUHAgEWFmh0dHA6Ly93d3cucXVvdmFkaXMuYm0wHQYDVR0OBBYEFItLbe3T
2086 KbkGGew5Oanwl4Rqy+/fMIGuBgNVHSMEgaYwgaOAFItLbe3TKbkGGew5Oanwl4Rq
2087 y+/foYGEpIGBMH8xCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1p
2088 dGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MS4wLAYD
2089 VQQDEyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggQ6tlCL
2090 MA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAitQUtf70mpKnGdSk
2091 fnIYj9lofFIk3WdvOXrEql494liwTXCYhGHoG+NpGA7O+0dQoE7/8CQfvbLO9Sf8
2092 7C9TqnN7Az10buYWnuulLsS/VidQK2K6vkscPFVcQR0kvoIgR13VRH56FmjffU1R
2093 cHhXHTMe/QKZnAzNCgVPx7uOpHX6Sm2xgI4JVrmcGmD+XcHXetwReNDWXcG31a0y
2094 mQM6isxUJTkxgXsTIlG6Rmyhu576BGxJJnSP0nPrzDCi5upZIof4l/UO/erMkqQW
2095 xFIY6iHOsfHmhIHluqmGKPJDWl0Snawe2ajlCmqnf6CHKc/yiU3U7MXi5nrQNiOK
2096 SnQ2+Q==
2097 -----END CERTIFICATE-----
2098
2099 -----BEGIN CERTIFICATE-----
2100 MIIB/jCCAYWgAwIBAgIIdJclisc/elQwCgYIKoZIzj0EAwMwRTELMAkGA1UEBhMC
2101 VVMxFDASBgNVBAoMC0FmZmlybVRydXN0MSAwHgYDVQQDDBdBZmZpcm1UcnVzdCBQ
2102 cmVtaXVtIEVDQzAeFw0xMDAxMjkxNDIwMjRaFw00MDEyMzExNDIwMjRaMEUxCzAJ
2103 BgNVBAYTAlVTMRQwEgYDVQQKDAtBZmZpcm1UcnVzdDEgMB4GA1UEAwwXQWZmaXJt
2104 VHJ1c3QgUHJlbWl1bSBFQ0MwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQNMF4bFZ0D
2105 0KF5Nbc6PJJ6yhUczWLznCZcBz3lVPqj1swS6vQUX+iOGasvLkjmrBhDeKzQN8O9
2106 ss0s5kfiGuZjuD0uL3jET9v0D6RoTFVya5UdThhClXjMNzyR4ptlKymjQjBAMB0G
2107 A1UdDgQWBBSaryl6wBE1NSZRMADDav5A1a7WPDAPBgNVHRMBAf8EBTADAQH/MA4G
2108 A1UdDwEB/wQEAwIBBjAKBggqhkjOPQQDAwNnADBkAjAXCfOHiFBar8jAQr9HX/Vs
2109 aobgxCd05DhT1wV/GzTjxi+zygk8N53X57hG8f2h4nECMEJZh0PUUd+60wkyWs6I
2110 flc9nF9Ca/UHLbXwgpP5WW+uZPpY5Yse42O+tYHNbwKMeQ==
2111 -----END CERTIFICATE-----
2112
2113 -----BEGIN CERTIFICATE-----
2114 MIIFkDCCA3igAwIBAgIQBZsbV56OITLiOQe9p3d1XDANBgkqhkiG9w0BAQwFADBi
2115 MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
2116 d3cuZGlnaWNlcnQuY29tMSEwHwYDVQQDExhEaWdpQ2VydCBUcnVzdGVkIFJvb3Qg
2117 RzQwHhcNMTMwODAxMTIwMDAwWhcNMzgwMTE1MTIwMDAwWjBiMQswCQYDVQQGEwJV
2118 UzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQu
2119 Y29tMSEwHwYDVQQDExhEaWdpQ2VydCBUcnVzdGVkIFJvb3QgRzQwggIiMA0GCSqG
2120 SIb3DQEBAQUAA4ICDwAwggIKAoICAQC/5pBzaN675F1KPDAiMGkz7MKnJS7JIT3y
2121 ithZwuEppz1Yq3aaza57G4QNxDAf8xukOBbrVsaXbR2rsnnyyhHS5F/WBTxSD1If
2122 xp4VpX6+n6lXFllVcq9ok3DCsrp1mWpzMpTREEQQLt+C8weE5nQ7bXHiLQwb7iDV
2123 ySAdYyktzuxeTsiT+CFhmzTrBcZe7FsavOvJz82sNEBfsXpm7nfISKhmV1efVFiO
2124 DCu3T6cw2Vbuyntd463JT17lNecxy9qTXtyOj4DatpGYQJB5w3jHtrHEtWoYOAMQ
2125 jdjUN6QuBX2I9YI+EJFwq1WCQTLX2wRzKm6RAXwhTNS8rhsDdV14Ztk6MUSaM0C/
2126 CNdaSaTC5qmgZ92kJ7yhTzm1EVgX9yRcRo9k98FpiHaYdj1ZXUJ2h4mXaXpI8OCi
2127 EhtmmnTK3kse5w5jrubU75KSOp493ADkRSWJtppEGSt+wJS00mFt6zPZxd9LBADM
2128 fRyVw4/3IbKyEbe7f/LVjHAsQWCqsWMYRJUadmJ+9oCw++hkpjPRiQfhvbfmQ6QY
2129 uKZ3AeEPlAwhHbJUKSWJbOUOUlFHdL4mrLZBdd56rF+NP8m800ERElvlEFDrMcXK
2130 chYiCd98THU/Y+whX8QgUWtvsauGi0/C1kVfnSD8oR7FwI+isX4KJpn15GkvmB0t
2131 9dmpsh3lGwIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIB
2132 hjAdBgNVHQ4EFgQU7NfjgtJxXWRM3y5nP+e6mK4cD08wDQYJKoZIhvcNAQEMBQAD
2133 ggIBALth2X2pbL4XxJEbw6GiAI3jZGgPVs93rnD5/ZpKmbnJeFwMDF/k5hQpVgs2
2134 SV1EY+CtnJYYZhsjDT156W1r1lT40jzBQ0CuHVD1UvyQO7uYmWlrx8GnqGikJ9yd
2135 +SeuMIW59mdNOj6PWTkiU0TryF0Dyu1Qen1iIQqAyHNm0aAFYF/opbSnr6j3bTWc
2136 fFqK1qI4mfN4i/RN0iAL3gTujJtHgXINwBQy7zBZLq7gcfJW5GqXb5JQbZaNaHqa
2137 sjYUegbyJLkJEVDXCLG4iXqEI2FCKeWjzaIgQdfRnGTZ6iahixTXTBmyUEFxPT9N
2138 cCOGDErcgdLMMpSEDQgJlxxPwO5rIHQw0uA5NBCFIRUBCOhVMt5xSdkoF1BN5r5N
2139 0XWs0Mr7QbhDparTwwVETyw2m+L64kW4I1NsBm9nVX9GtUw/bihaeSbSpKhil9Ie
2140 4u1Ki7wb/UdKDd9nZn6yW0HQO+T0O/QEY+nvwlQAUaCKKsnOeMzV6ocEGLPOr0mI
2141 r/OSmbaz5mEP0oUA51Aa5BuVnRmhuZyxm7EAHu/QD09CbMkKvO5D+jpxpchNJqU1
2142 /YldvIViHTLSoCtU7ZpXwdv6EM8Zt4tKG48BtieVU+i2iW1bvGjUI+iLUaJW+fCm
2143 gKDWHrO8Dw9TdSmq6hN35N6MgSGtBxBHEa2HPQfRdbzP82Z+
2144 -----END CERTIFICATE-----
2145
2146 -----BEGIN CERTIFICATE-----
2147 MIIEkTCCA3mgAwIBAgIERWtQVDANBgkqhkiG9w0BAQUFADCBsDELMAkGA1UEBhMC
2148 VVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xOTA3BgNVBAsTMHd3dy5lbnRydXN0
2149 Lm5ldC9DUFMgaXMgaW5jb3Jwb3JhdGVkIGJ5IHJlZmVyZW5jZTEfMB0GA1UECxMW
2150 KGMpIDIwMDYgRW50cnVzdCwgSW5jLjEtMCsGA1UEAxMkRW50cnVzdCBSb290IENl
2151 cnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA2MTEyNzIwMjM0MloXDTI2MTEyNzIw
2152 NTM0MlowgbAxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMuMTkw
2153 NwYDVQQLEzB3d3cuZW50cnVzdC5uZXQvQ1BTIGlzIGluY29ycG9yYXRlZCBieSBy
2154 ZWZlcmVuY2UxHzAdBgNVBAsTFihjKSAyMDA2IEVudHJ1c3QsIEluYy4xLTArBgNV
2155 BAMTJEVudHJ1c3QgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASIwDQYJ
2156 KoZIhvcNAQEBBQADggEPADCCAQoCggEBALaVtkNC+sZtKm9I35RMOVcF7sN5EUFo
2157 Nu3s/poBj6E4KPz3EEZmLk0eGrEaTsbRwJWIsMn/MYszA9u3g3s+IIRe7bJWKKf4
2158 4LlAcTfFy0cOlypowCKVYhXbR9n10Cv/gkvJrT7eTNuQgFA/CYqEAOwwCj0Yzfv9
2159 KlmaI5UXLEWeH25DeW0MXJj+SKfFI0dcXv1u5x609mhF0YaDW6KKjbHjKYD+JXGI
2160 rb68j6xSlkuqUY3kEzEZ6E5Nn9uss2rVvDlUccp6en+Q3X0dgNmBu1kmwhH+5pPi
2161 94DkZfs0Nw4pgHBNrziGLp5/V6+eF67rHMsoIV+2HNjnogQi+dPa2MsCAwEAAaOB
2162 sDCBrTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zArBgNVHRAEJDAi
2163 gA8yMDA2MTEyNzIwMjM0MlqBDzIwMjYxMTI3MjA1MzQyWjAfBgNVHSMEGDAWgBRo
2164 kORnpKZTgMeGZqTx90tD+4S9bTAdBgNVHQ4EFgQUaJDkZ6SmU4DHhmak8fdLQ/uE
2165 vW0wHQYJKoZIhvZ9B0EABBAwDhsIVjcuMTo0LjADAgSQMA0GCSqGSIb3DQEBBQUA
2166 A4IBAQCT1DCw1wMgKtD5Y+iRDAUgqV8ZyntyTtSx29CW+1RaGSwMCPeyvIWonX9t
2167 O1KzKtvn1ISMY/YPyyYBkVBs9F8U4pN0wBOeMDpQ47RgxRzwIkSNcUesyBrJ6Zua
2168 AGAT/3B+XxFNSRuzFVJ7yVTav52Vr2ua2J7p8eRDjeIRRDq/r72DQnNSi6q7pynP
2169 9WQcCk3RvKqsnyrQ/39/2n3qse0wJcGE2jTSW3iDVuycNsMm4hH2Z0kdkquM++v/
2170 eu6FSqdQgPCnXEqULl8FmTxSQeDNtGPPAUO6nIPcj2A781q0tHuu2guQOHXvgR1m
2171 0vdXcDazv/wor3ElhVsT/h5/WrQ8
2172 -----END CERTIFICATE-----
2173
2174 -----BEGIN CERTIFICATE-----
2175 MIIHSTCCBTGgAwIBAgIJAMnN0+nVfSPOMA0GCSqGSIb3DQEBBQUAMIGsMQswCQYD
2176 VQQGEwJFVTFDMEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0
2177 IHd3dy5jYW1lcmZpcm1hLmNvbS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3
2178 MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMuQS4xJzAlBgNVBAMTHkdsb2JhbCBD
2179 aGFtYmVyc2lnbiBSb290IC0gMjAwODAeFw0wODA4MDExMjMxNDBaFw0zODA3MzEx
2180 MjMxNDBaMIGsMQswCQYDVQQGEwJFVTFDMEEGA1UEBxM6TWFkcmlkIChzZWUgY3Vy
2181 cmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNvbS9hZGRyZXNzKTESMBAG
2182 A1UEBRMJQTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMuQS4xJzAl
2183 BgNVBAMTHkdsb2JhbCBDaGFtYmVyc2lnbiBSb290IC0gMjAwODCCAiIwDQYJKoZI
2184 hvcNAQEBBQADggIPADCCAgoCggIBAMDfVtPkOpt2RbQT2//BthmLN0EYlVJH6xed
2185 KYiONWwGMi5HYvNJBL99RDaxccy9Wglz1dmFRP+RVyXfXjaOcNFccUMd2drvXNL7
2186 G706tcuto8xEpw2uIRU/uXpbknXYpBI4iRmKt4DS4jJvVpyR1ogQC7N0ZJJ0YPP2
2187 zxhPYLIj0Mc7zmFLmY/CDNBAspjcDahOo7kKrmCgrUVSY7pmvWjg+b4aqIG7HkF4
2188 ddPB/gBVsIdU6CeQNR1MM62X/JcumIS/LMmjv9GYERTtY/jKmIhYF5ntRQOXfjyG
2189 HoiMvvKRhI9lNNgATH23MRdaKXoKGCQwoze1eqkBfSbW+Q6OWfH9GzO1KTsXO0G2
2190 Id3UwD2ln58fQ1DJu7xsepeY7s2MH/ucUa6LcL0nn3HAa6x9kGbo1106DbDVwo3V
2191 yJ2dwW3Q0L9R5OP4wzg2rtandeavhENdk5IMagfeOx2YItaswTXbo6Al/3K1dh3e
2192 beksZixShNBFks4c5eUzHdwHU1SjqoI7mjcv3N2gZOnm3b2u/GSFHTynyQbehP9r
2193 6GsaPMWis0L7iwk+XwhSx2LE1AVxv8Rk5Pihg+g+EpuoHtQ2TS9x9o0o9oOpE9Jh
2194 wZG7SMA0j0GMS0zbaRL/UJScIINZc+18ofLx/d33SdNDWKBWY8o9PeU1VlnpDsog
2195 zCtLkykPAgMBAAGjggFqMIIBZjASBgNVHRMBAf8ECDAGAQH/AgEMMB0GA1UdDgQW
2196 BBS5CcqcHtvTbDprru1U8VuTBjUuXjCB4QYDVR0jBIHZMIHWgBS5CcqcHtvTbDpr
2197 ru1U8VuTBjUuXqGBsqSBrzCBrDELMAkGA1UEBhMCRVUxQzBBBgNVBAcTOk1hZHJp
2198 ZCAoc2VlIGN1cnJlbnQgYWRkcmVzcyBhdCB3d3cuY2FtZXJmaXJtYS5jb20vYWRk
2199 cmVzcykxEjAQBgNVBAUTCUE4Mjc0MzI4NzEbMBkGA1UEChMSQUMgQ2FtZXJmaXJt
2200 YSBTLkEuMScwJQYDVQQDEx5HbG9iYWwgQ2hhbWJlcnNpZ24gUm9vdCAtIDIwMDiC
2201 CQDJzdPp1X0jzjAOBgNVHQ8BAf8EBAMCAQYwPQYDVR0gBDYwNDAyBgRVHSAAMCow
2202 KAYIKwYBBQUHAgEWHGh0dHA6Ly9wb2xpY3kuY2FtZXJmaXJtYS5jb20wDQYJKoZI
2203 hvcNAQEFBQADggIBAICIf3DekijZBZRG/5BXqfEv3xoNa/p8DhxJJHkn2EaqbylZ
2204 UohwEurdPfWbU1Rv4WCiqAm57OtZfMY18dwY6fFn5a+6ReAJ3spED8IXDneRRXoz
2205 X1+WLGiLwUePmJs9wOzL9dWCkoQ10b42OFZyMVtHLaoXpGNR6woBrX/sdZ7LoR/x
2206 fxKxueRkf2fWIyr0uDldmOghp+G9PUIadJpwr2hsUF1Jz//7Dl3mLEfXgTpZALVz
2207 a2Mg9jFFCDkO9HB+QHBaP9BrQql0PSgvAm11cpUJjUhjxsYjV5KTXjXBjfkK9yyd
2208 Yhz2rXzdpjEetrHHfoUm+qRqtdpjMNHvkzeyZi99Bffnt0uYlDXA2TopwZ2yUDMd
2209 SqlapskD7+3056huirRXhOukP9DuqqqHW2Pok+JrqNS4cnhrG+055F3Lm6qH1U9O
2210 AP7Zap88MQ8oAgF9mOinsKJknnn4SPIVqczmyETrP3iZ8ntxPjzxmKfFGBI/5rso
2211 M0LpRQp8bfKGeS/Fghl9CYl8slR2iK7ewfPM4W7bMdaTrpmg7yVqc5iJWzouE4ge
2212 v8CSlDQb4ye3ix5vQv/n6TebUB0tovkC7stYWDpxvGjjqsGvHCgfotwjZT+B6q6Z
2213 09gwzxMNTxXJhLynSC34MCN32EZLeW32jO06f2ARePTpm67VVMB0gNELQp/B
2214 -----END CERTIFICATE-----
2215
2216 -----BEGIN CERTIFICATE-----
2217 MIIB4TCCAYegAwIBAgIRKjikHJYKBN5CsiilC+g0mAIwCgYIKoZIzj0EAwIwUDEk
2218 MCIGA1UECxMbR2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI0MRMwEQYDVQQKEwpH
2219 bG9iYWxTaWduMRMwEQYDVQQDEwpHbG9iYWxTaWduMB4XDTEyMTExMzAwMDAwMFoX
2220 DTM4MDExOTAzMTQwN1owUDEkMCIGA1UECxMbR2xvYmFsU2lnbiBFQ0MgUm9vdCBD
2221 QSAtIFI0MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQDEwpHbG9iYWxTaWdu
2222 MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEuMZ5049sJQ6fLjkZHAOkrprlOQcJ
2223 FspjsbmG+IpXwVfOQvpzofdlQv8ewQCybnMO/8ch5RikqtlxP6jUuc6MHaNCMEAw
2224 DgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFFSwe61F
2225 uOJAf/sKbvu+M8k8o4TVMAoGCCqGSM49BAMCA0gAMEUCIQDckqGgE6bPA7DmxCGX
2226 kPoUVy0D7O48027KqGx2vKLeuwIgJ6iFJzWbVsaj8kfSt24bAgAXqmemFZHe+pTs
2227 ewv4n4Q=
2228 -----END CERTIFICATE-----
2229
2230 -----BEGIN CERTIFICATE-----
2231 MIIDZDCCAkygAwIBAgICC7gwDQYJKoZIhvcNAQELBQAwRDELMAkGA1UEBhMCTFUx
2232 FjAUBgNVBAoTDUx1eFRydXN0IHMuYS4xHTAbBgNVBAMTFEx1eFRydXN0IEdsb2Jh
2233 bCBSb290MB4XDTExMDMxNzA5NTEzN1oXDTIxMDMxNzA5NTEzN1owRDELMAkGA1UE
2234 BhMCTFUxFjAUBgNVBAoTDUx1eFRydXN0IHMuYS4xHTAbBgNVBAMTFEx1eFRydXN0
2235 IEdsb2JhbCBSb290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsn+n
2236 QPAiygz267Hxyw6VV0B1r6A/Ps7sqjJX5hmxZ0OYWmt8s7j6eJyqpoSyYBuAQc5j
2237 zR8XCJmk9e8+EsdMsFeaXHhAePxFjdqRZ9w6Ubltc+a3OY52OrQfBfVpVfmTz3iI
2238 Sr6qm9d7R1tGBEyCFqY19vx039a0r9jitScRdFmiwmYsaArhmIiIPIoFdRTjuK7z
2239 CISbasE/MRivJ6VLm6T9eTHemD0OYcqHmMH4ijCc+j4z1aXEAwfh95Z0GAAnOCfR
2240 K6qq4UFFi2/xJcLcopeVx0IUM115hCNq52XAV6DYXaljAeew5Ivo+MVjuOVsdJA9
2241 x3f8K7p56aTGEnin/wIDAQABo2AwXjAMBgNVHRMEBTADAQH/MA4GA1UdDwEB/wQE
2242 AwIBBjAfBgNVHSMEGDAWgBQXFYWJCS8kh28/HRvk8pZ5g0gTzjAdBgNVHQ4EFgQU
2243 FxWFiQkvJIdvPx0b5PKWeYNIE84wDQYJKoZIhvcNAQELBQADggEBAFrwHNDUUM9B
2244 fua4nX3DcNBeNv9ujnov3kgR1TQuPLdFwlQlp+HBHjeDtpSutkVIA+qVvuucarQ3
2245 XB8u02uCgUNbCj8RVWOs+nwIAjegPDkEM/6XMshS5dklTbDG7mgfcKpzzlcD3H0K
2246 DTPy0lrfCmw7zBFRlxqkIaKFNQLXgCLShLL4wKpov9XrqsMLq6F8K/f1O4fhVFfs
2247 BSTveUJO84ton+Ruy4KZycwq3FPCH3CDqyEPVrRI/98HIrOM+R2mBN8tAza53W/+
2248 MYhm/2xtRDSvCHc+JtJy9LtHVpM8mGPhM7uZI5K1g3noHZ9nrWLWidb2/CfeMifL
2249 hNp3hSGhEiE=
2250 -----END CERTIFICATE-----
2251
2252 -----BEGIN CERTIFICATE-----
2253 MIIEKjCCAxKgAwIBAgIQYAGXt0an6rS0mtZLL/eQ+zANBgkqhkiG9w0BAQsFADCB
2254 rjELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMf
2255 Q2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIw
2256 MDggdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAiBgNV
2257 BAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EgLSBHMzAeFw0wODA0MDIwMDAwMDBa
2258 Fw0zNzEyMDEyMzU5NTlaMIGuMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMdGhhd3Rl
2259 LCBJbmMuMSgwJgYDVQQLEx9DZXJ0aWZpY2F0aW9uIFNlcnZpY2VzIERpdmlzaW9u
2260 MTgwNgYDVQQLEy8oYykgMjAwOCB0aGF3dGUsIEluYy4gLSBGb3IgYXV0aG9yaXpl
2261 ZCB1c2Ugb25seTEkMCIGA1UEAxMbdGhhd3RlIFByaW1hcnkgUm9vdCBDQSAtIEcz
2262 MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsr8nLPvb2FvdeHsbnndm
2263 gcs+vHyu86YnmjSjaDFxODNi5PNxZnmxqWWjpYvVj2AtP0LMqmsywCPLLEHd5N/8
2264 YZzic7IilRFDGF/Eth9XbAoFWCLINkw6fKXRz4aviKdEAhN0cXMKQlkC+BsUa0Lf
2265 b1+6a4KinVvnSr0eAXLbS3ToO39/fR8EtCab4LRarEc9VbjXsCZSKAExQGbY2SS9
2266 9irY7CFJXJv2eul/VTV+lmuNk5Mny5K76qxAwJ/C+IDPXfRa3M50hqY+bAtTyr2S
2267 zhkGcuYMXDhpxwTWvGzOW/b3aJzcJRVIiKHpqfiYnODz1TEoYRFsZ5aNOZnLwkUk
2268 OQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNV
2269 HQ4EFgQUrWyqlGCc7eT/+j4KdCtjA/e2Wb8wDQYJKoZIhvcNAQELBQADggEBABpA
2270 2JVlrAmSicY59BDlqQ5mU1143vokkbvnRFHfxhY0Cu9qRFHqKweKA3rD6z8KLFIW
2271 oCtDuSWQP3CpMyVtRRooOyfPqsMpQhvfO0zAMzRbQYi/aytlryjvsvXDqmbOe1bu
2272 t8jLZ8HJnBoYuMTDSQPxYA5QzUbF83d597YV4Djbxy8ooAw/dyZ02SUS2jHaGh7c
2273 KUGRIjxpp7sC8rZcJwOJ9Abqm+RyguOhCcHpABnTPtRwa7pxpqpYrvS76Wy274fM
2274 m7v/OeZWYdMKp8RcTGB7BXcmer/YB1IsYvdwY9k5vG8cwnncdimvzsUsZAReiDZu
2275 MdRAGmI0Nj81Aa6sY6A=
2276 -----END CERTIFICATE-----
2277
2278 -----BEGIN CERTIFICATE-----
2279 MIIDfDCCAmSgAwIBAgIQGKy1av1pthU6Y2yv2vrEoTANBgkqhkiG9w0BAQUFADBY
2280 MQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjExMC8GA1UEAxMo
2281 R2VvVHJ1c3QgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjEx
2282 MjcwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMFgxCzAJBgNVBAYTAlVTMRYwFAYDVQQK
2283 Ew1HZW9UcnVzdCBJbmMuMTEwLwYDVQQDEyhHZW9UcnVzdCBQcmltYXJ5IENlcnRp
2284 ZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC
2285 AQEAvrgVe//UfH1nrYNke8hCUy3f9oQIIGHWAVlqnEQRr+92/ZV+zmEwu3qDXwK9
2286 AWbK7hWNb6EwnL2hhZ6UOvNWiAAxz9juapYC2e0DjPt1befquFUWBRaa9OBesYjA
2287 ZIVcFU2Ix7e64HXprQU9nceJSOC7KMgD4TCTZF5SwFlwIjVXiIrxlQqD17wxcwE0
2288 7e9GceBrAqg1cmuXm2bgyxx5X9gaBGgeRwLmnWDiNpcB3841kt++Z8dtd1k7j53W
2289 kBWUvEI0EME5+bEnPn7WinXFsq+W06Lem+SYvn3h6YGttm/81w7a4DSwDRp35+MI
2290 mO9Y+pyEtzavwt+s0vQQBnBxNQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4G
2291 A1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQULNVQQZcVi/CPNmFbSvtr2ZnJM5IwDQYJ
2292 KoZIhvcNAQEFBQADggEBAFpwfyzdtzRP9YZRqSa+S7iq8XEN3GHHoOo0Hnp3DwQ1
2293 6CePbJC/kRYkRj5KTs4rFtULUh38H2eiAkUxT87z+gOneZ1TatnaYzr4gNfTmeGl
2294 4b7UVXGYNTq+k+qurUKykG/g/CFNNWMziUnWm07Kx+dOCQD32sfvmWKZd7aVIl6K
2295 oKv0uHiYyjgZmclynnjNS6yvGaBzEi38wkG6gZHaFloxt/m0cYASSJlyc1pZU8Fj
2296 UjPtp8nSOQJw+uCxQmYpqptR7TBUIhRf2asdweSU8Pj1K/fqynhG1riR/aYNKxoU
2297 AT6A8EKglQdebc3MS6RFjasS6LPeWuWgfOgPIh1a6Vk=
2298 -----END CERTIFICATE-----
2299
2300 -----BEGIN CERTIFICATE-----
2301 MIICsDCCAhmgAwIBAgIQZ8jh6OO+HL38kTuOpiOHSTANBgkqhkiG9w0BAQUFADCB
2302 izELMAkGA1UEBhMCWkExFTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTEUMBIGA1UEBxML
2303 RHVyYmFudmlsbGUxDzANBgNVBAoTBlRoYXd0ZTEdMBsGA1UECxMUVGhhd3RlIENl
2304 cnRpZmljYXRpb24xHzAdBgNVBAMTFlRoYXd0ZSBUaW1lc3RhbXBpbmcgQ0EwHhcN
2305 OTcwMTAxMDAwMDAwWhcNMjEwMTAxMjM1OTU5WjCBizELMAkGA1UEBhMCWkExFTAT
2306 BgNVBAgTDFdlc3Rlcm4gQ2FwZTEUMBIGA1UEBxMLRHVyYmFudmlsbGUxDzANBgNV
2307 BAoTBlRoYXd0ZTEdMBsGA1UECxMUVGhhd3RlIENlcnRpZmljYXRpb24xHzAdBgNV
2308 BAMTFlRoYXd0ZSBUaW1lc3RhbXBpbmcgQ0EwgZ8wDQYJKoZIhvcNAQEBBQADgY0A
2309 MIGJAoGBANYrWHhhRYZT6jR7UZztsOYuGA7+4F+oJ9O0yeB8WU4WDnNUYMF/9p8u
2310 6TqFJBU820cEY8OexJQaWt9MevPZQx08EHp5JduQ/vBR5zDWQQD9nyjfeb6Uu522
2311 FOMjhdepQeBMpHmwKxqL8vg7ij5FrHGSALSQQZj7X+36ty6K+Ig3AgMBAAGjEzAR
2312 MA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAS+mqF4EF+3kKMZ/F
2313 QfRWVKvpwuWXjhj+kckMPiZkyaFMJ2SnvQGTVXFuF0853BvcSTUQOSP/ypvIz2Y/
2314 3Ewa1IEGQlIf4SaxFhe65nByMUToTo1b5NP50OOPJWQx5yr4GIg2GlLFDUE1G2m3
2315 JvUXzMEZXkt8XOKDgJH6L/uatxY=
2316 -----END CERTIFICATE-----
2317
2318 -----BEGIN CERTIFICATE-----
2319 MIIDxTCCAq2gAwIBAgIBADANBgkqhkiG9w0BAQsFADCBgzELMAkGA1UEBhMCVVMx
2320 EDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxGjAYBgNVBAoT
2321 EUdvRGFkZHkuY29tLCBJbmMuMTEwLwYDVQQDEyhHbyBEYWRkeSBSb290IENlcnRp
2322 ZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIz
2323 NTk1OVowgYMxCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6b25hMRMwEQYDVQQH
2324 EwpTY290dHNkYWxlMRowGAYDVQQKExFHb0RhZGR5LmNvbSwgSW5jLjExMC8GA1UE
2325 AxMoR28gRGFkZHkgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIw
2326 DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL9xYgjx+lk09xvJGKP3gElY6SKD
2327 E6bFIEMBO4Tx5oVJnyfq9oQbTqC023CYxzIBsQU+B07u9PpPL1kwIuerGVZr4oAH
2328 /PMWdYA5UXvl+TW2dE6pjYIT5LY/qQOD+qK+ihVqf94Lw7YZFAXK6sOoBJQ7Rnwy
2329 DfMAZiLIjWltNowRGLfTshxgtDj6AozO091GB94KPutdfMh8+7ArU6SSYmlRJQVh
2330 GkSBjCypQ5Yj36w6gZoOKcUcqeldHraenjAKOc7xiID7S13MMuyFYkMlNAJWJwGR
2331 tDtwKj9useiciAF9n9T521NtYJ2/LOdYq7hfRvzOxBsDPAnrSTFcaUaz4EcCAwEA
2332 AaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYE
2333 FDqahQcQZyi27/a9BUFuIMGU2g/eMA0GCSqGSIb3DQEBCwUAA4IBAQCZ21151fmX
2334 WWcDYfF+OwYxdS2hII5PZYe096acvNjpL9DbWu7PdIxztDhC2gV7+AJ1uP2lsdeu
2335 9tfeE8tTEH6KRtGX+rcuKxGrkLAngPnon1rpN5+r5N9ss4UXnT3ZJE95kTXWXwTr
2336 gIOrmgIttRD02JDHBHNA7XIloKmf7J6raBKZV8aPEjoJpL1E/QYVN8Gb5DKj7Tjo
2337 2GTzLH4U/ALqn83/B2gX2yKQOC16jdFU8WnjXzPKej17CuPKf1855eJ1usV2GDPO
2338 LPAvTK33sefOT6jEm0pUBsV/fdUID+Ic/n4XuKxe9tQWskMJDE32p2u0mYRlynqI
2339 4uJEvlz36hz1
2340 -----END CERTIFICATE-----
2341
2342 -----BEGIN CERTIFICATE-----
2343 MIIBtjCCAVugAwIBAgITBmyf1XSXNmY/Owua2eiedgPySjAKBggqhkjOPQQDAjA5
2344 MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24g
2345 Um9vdCBDQSAzMB4XDTE1MDUyNjAwMDAwMFoXDTQwMDUyNjAwMDAwMFowOTELMAkG
2346 A1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJvb3Qg
2347 Q0EgMzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABCmXp8ZBf8ANm+gBG1bG8lKl
2348 ui2yEujSLtf6ycXYqm0fc4E7O5hrOXwzpcVOho6AF2hiRVd9RFgdszflZwjrZt6j
2349 QjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBSr
2350 ttvXBp43rDCGB5Fwx5zEGbF4wDAKBggqhkjOPQQDAgNJADBGAiEA4IWSoxe3jfkr
2351 BqWTrBqYaGFy+uGh0PsceGCmQ5nFuMQCIQCcAu/xlJyzlvnrxir4tiz+OpAUFteM
2352 YyRIHN8wfdVoOw==
2353 -----END CERTIFICATE-----
2354
2355 -----BEGIN CERTIFICATE-----
2356 MIIEIDCCAwigAwIBAgIQNE7VVyDV7exJ9C/ON9srbTANBgkqhkiG9w0BAQUFADCB
2357 qTELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMf
2358 Q2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIw
2359 MDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxHzAdBgNV
2360 BAMTFnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwHhcNMDYxMTE3MDAwMDAwWhcNMzYw
2361 NzE2MjM1OTU5WjCBqTELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5j
2362 LjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYG
2363 A1UECxMvKGMpIDIwMDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl
2364 IG9ubHkxHzAdBgNVBAMTFnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwggEiMA0GCSqG
2365 SIb3DQEBAQUAA4IBDwAwggEKAoIBAQCsoPD7gFnUnMekz52hWXMJEEUMDSxuaPFs
2366 W0hoSVk3/AszGcJ3f8wQLZU0HObrTQmnHNK4yZc2AreJ1CRfBsDMRJSUjQJib+ta
2367 3RGNKJpchJAQeg29dGYvajig4tVUROsdB58Hum/u6f1OCyn1PoSgAfGcq/gcfomk
2368 6KHYcWUNo1F77rzSImANuVud37r8UVsLr5iy6S7pBOhih94ryNdOwUxkHt3Ph1i6
2369 Sk/KaAcdHJ1KxtUvkcx8cXIcxcBn6zL9yZJclNqFwJu/U30rCfSMnZEfl2pSy94J
2370 NqR32HuHUETVPm4pafs5SSYeCaWAe0At6+gnhcn+Yf1+5nyXHdWdAgMBAAGjQjBA
2371 MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBR7W0XP
2372 r87Lev0xkhpqtvNG61dIUDANBgkqhkiG9w0BAQUFAAOCAQEAeRHAS7ORtvzw6WfU
2373 DW5FvlXok9LOAz/t2iWwHVfLHjp2oEzsUHboZHIMpKnxuIvW1oeEuzLlQRHAd9mz
2374 YJ3rG9XRbkREqaYB7FViHXe4XI5ISXycO1cRrK1zN44veFyQaEfZYGDm/Ac9IiAX
2375 xPcW6cTYcvnIc3zfFi8VqT79aie2oetaupgf1eNNZAqdE8hhuvU5HIe6uL17In/2
2376 /qxAeeWsEG89jxt5dovEN7MhGITlNgDrYyCZuen+MwS7QcjBAvlEYyCegc5C09Y/
2377 LHbTY5xZ3Y+m4Q6gLkH3LpVHz7z9M/P2C2F+fpErgUfCJzDupxBdN49cOSvkBPB7
2378 jVaMaA==
2379 -----END CERTIFICATE-----
2380
2381 -----BEGIN CERTIFICATE-----
2382 MIIDdzCCAl+gAwIBAgIBADANBgkqhkiG9w0BAQsFADBdMQswCQYDVQQGEwJKUDEl
2383 MCMGA1UEChMcU0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEnMCUGA1UECxMe
2384 U2VjdXJpdHkgQ29tbXVuaWNhdGlvbiBSb290Q0EyMB4XDTA5MDUyOTA1MDAzOVoX
2385 DTI5MDUyOTA1MDAzOVowXTELMAkGA1UEBhMCSlAxJTAjBgNVBAoTHFNFQ09NIFRy
2386 dXN0IFN5c3RlbXMgQ08uLExURC4xJzAlBgNVBAsTHlNlY3VyaXR5IENvbW11bmlj
2387 YXRpb24gUm9vdENBMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANAV
2388 OVKxUrO6xVmCxF1SrjpDZYBLx/KWvNs2l9amZIyoXvDjChz335c9S672XewhtUGr
2389 zbl+dp+++T42NKA7wfYxEUV0kz1XgMX5iZnK5atq1LXaQZAQwdbWQonCv/Q4EpVM
2390 VAX3NuRFg3sUZdbcDE3R3n4MqzvEFb46VqZab3ZpUql6ucjrappdUtAtCms1FgkQ
2391 hNBqyjoGADdH5H5XTz+L62e4iKrFvlNVspHEfbmwhRkGeC7bYRr6hfVKkaHnFtWO
2392 ojnflLhwHyg/i/xAXmODPIMqGplrz95Zajv8bxbXH/1KEOtOghY6rCcMU/Gt1SSw
2393 awNQwS08Ft1ENCcadfsCAwEAAaNCMEAwHQYDVR0OBBYEFAqFqXdlBZh8QIH4D5cs
2394 OPEK7DzPMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3
2395 DQEBCwUAA4IBAQBMOqNErLlFsceTfsgLCkLfZOoc7llsCLqJX2rKSpWeeo8HxdpF
2396 coJxDjrSzG+ntKEju/Ykn8sX/oymzsLS28yN/HH8AynBbF0zX2S2ZTuJbxh2ePXc
2397 okgfGT+Ok+vx+hfuzU7jBBJV1uXk3fs+BXziHV7Gp7yXT2g69ekuCkO2r1dcYmh8
2398 t/2jioSgrGK+KwmHNPBqAbubKVY8/gA3zyNs8U6qtnRGEmyR7jTV7JqR50S+kDFy
2399 1UkC9gLl9B/rfNmWVan/7Ir5mUf/NVoCqgTLiluHcSmRvaS0eg29mvVXIwAHIRc/
2400 SjnRBUkLp7Y3gaVdjKozXoEofKd9J+sAro03
2401 -----END CERTIFICATE-----
2402
2403 -----BEGIN CERTIFICATE-----
2404 MIIDjjCCAnagAwIBAgIQAzrx5qcRqaC7KGSxHQn65TANBgkqhkiG9w0BAQsFADBh
2405 MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
2406 d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBH
2407 MjAeFw0xMzA4MDExMjAwMDBaFw0zODAxMTUxMjAwMDBaMGExCzAJBgNVBAYTAlVT
2408 MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j
2409 b20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IEcyMIIBIjANBgkqhkiG
2410 9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuzfNNNx7a8myaJCtSnX/RrohCgiN9RlUyfuI
2411 2/Ou8jqJkTx65qsGGmvPrC3oXgkkRLpimn7Wo6h+4FR1IAWsULecYxpsMNzaHxmx
2412 1x7e/dfgy5SDN67sH0NO3Xss0r0upS/kqbitOtSZpLYl6ZtrAGCSYP9PIUkY92eQ
2413 q2EGnI/yuum06ZIya7XzV+hdG82MHauVBJVJ8zUtluNJbd134/tJS7SsVQepj5Wz
2414 tCO7TG1F8PapspUwtP1MVYwnSlcUfIKdzXOS0xZKBgyMUNGPHgm+F6HmIcr9g+UQ
2415 vIOlCsRnKPZzFBQ9RnbDhxSJITRNrw9FDKZJobq7nMWxM4MphQIDAQABo0IwQDAP
2416 BgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUTiJUIBiV
2417 5uNu5g/6+rkS7QYXjzkwDQYJKoZIhvcNAQELBQADggEBAGBnKJRvDkhj6zHd6mcY
2418 1Yl9PMWLSn/pvtsrF9+wX3N3KjITOYFnQoQj8kVnNeyIv/iPsGEMNKSuIEyExtv4
2419 NeF22d+mQrvHRAiGfzZ0JFrabA0UWTW98kndth/Jsw1HKj2ZL7tcu7XUIOGZX1NG
2420 Fdtom/DzMNU+MeKNhJ7jitralj41E6Vf8PlwUHBHQRFXGU7Aj64GxJUTFy8bJZ91
2421 8rGOmaFvE7FBcf6IKshPECBV1/MUReXgRPTqh5Uykw7+U0b6LJ3/iyK5S9kJRaTe
2422 pLiaWN0bfVKfjllDiIGknibVb63dDcY3fe0Dkhvld1927jyNxF1WW6LZZm6zNTfl
2423 MrY=
2424 -----END CERTIFICATE-----
2425
2426 -----BEGIN CERTIFICATE-----
2427 MIIEZjCCA06gAwIBAgIQRL4Mi1AAJLQR0zYt4LNfGzANBgkqhkiG9w0BAQUFADCB
2428 lTELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2Ug
2429 Q2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExho
2430 dHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xHTAbBgNVBAMTFFVUTi1VU0VSRmlyc3Qt
2431 T2JqZWN0MB4XDTk5MDcwOTE4MzEyMFoXDTE5MDcwOTE4NDAzNlowgZUxCzAJBgNV
2432 BAYTAlVTMQswCQYDVQQIEwJVVDEXMBUGA1UEBxMOU2FsdCBMYWtlIENpdHkxHjAc
2433 BgNVBAoTFVRoZSBVU0VSVFJVU1QgTmV0d29yazEhMB8GA1UECxMYaHR0cDovL3d3
2434 dy51c2VydHJ1c3QuY29tMR0wGwYDVQQDExRVVE4tVVNFUkZpcnN0LU9iamVjdDCC
2435 ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAM6qgT+jo2F4qjEAVZURnicP
2436 HxzfOpuCaDDASmEd8S8O+r5596Uj71VRloTN2+O5bj4x2AogZ8f02b+U60cEPgLO
2437 KqJdhwQJ9jCdGIqXsqoc/EHSoTbL+z2RuufZcDX65OeQw5ujm9M89RKZd7G3CeBo
2438 5hy485RjiGpq/gt2yb70IuRnuasaXnfBhQfdDWy/7gbHd2pBnqcP1/vulBe3/IW+
2439 pKvEHDHd17bR5PDv3xaPslKT16HUiaEHLr/hARJCHhrh2JU022R5KP+6LhHC5ehb
2440 kkj7RwvCbNqtMoNB86XlQXD9ZZBt+vpRxPm9lisZBCzTbafc8H9vg2XiaquHhnUC
2441 AwEAAaOBrzCBrDALBgNVHQ8EBAMCAcYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4E
2442 FgQU2u1kdBScFDyr3ZmpvVsoTYs8ydgwQgYDVR0fBDswOTA3oDWgM4YxaHR0cDov
2443 L2NybC51c2VydHJ1c3QuY29tL1VUTi1VU0VSRmlyc3QtT2JqZWN0LmNybDApBgNV
2444 HSUEIjAgBggrBgEFBQcDAwYIKwYBBQUHAwgGCisGAQQBgjcKAwQwDQYJKoZIhvcN
2445 AQEFBQADggEBAAgfUrE3RHjb/c652pWWmKpVZIC1WkDdIaXFwfNfLEzIR1pp6ujw
2446 NTX00CXzyKakh0q9G7FzCL3Uw8q2NbtZhncxzaeAFK4T7/yxSPlrJSUtUbYsbUXB
2447 mMiKVl0+7kNOPmsnjtA6S4ULX9Ptaqd1y9Fahy85dRNacrACgZ++8A+EVCBibGnU
2448 4U3GDZlDAQ0Slox4nb9QorFEqmrPF3rPbw/U+CRVX/A0FklmPlBGyWNxODFiuGK5
2449 81OtbLUrohKqGU8J2l7nk8aOFAj+8DCAGKCGhU3IfdeLA/5u1fedFqySLKAj5ZyR
2450 Uh+U3xeUc8OzwcFxBSAAeL0TUh2oPs0AH8g=
2451 -----END CERTIFICATE-----
File steam_appid.txt added (mode: 100755) (index 0000000..e9a7418)
1 1181900
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/mse/ConfectionerEngine

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/mse/ConfectionerEngine

Clone this repository using git:
git clone git://git.rocketgit.com/user/mse/ConfectionerEngine

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main