├── .vscode
├── c_cpp_properties.json
├── launch.json
└── tasks.json
├── LICENSE
├── README.md
├── glfw3.dll
├── include
├── GLFW
│ ├── glfw3.h
│ └── glfw3native.h
├── KHR
│ └── khrplatform.h
└── glad
│ └── glad.h
├── lib
└── libglfw3dll.a
└── src
├── glad.c
└── main.cpp
/.vscode/c_cpp_properties.json:
--------------------------------------------------------------------------------
1 | {
2 | "configurations": [
3 | {
4 | "name": "Win32",
5 | "includePath": [
6 | "${workspaceFolder}/**"
7 | ],
8 | "defines": [
9 | "_DEBUG",
10 | "UNICODE",
11 | "_UNICODE"
12 | ],
13 | "compilerPath": "C:\\Program Files (x86)\\mingw-w64\\i686-8.1.0-posix-dwarf-rt_v6-rev0\\mingw32\\bin\\gcc.exe",
14 | "cStandard": "c11",
15 | "cppStandard": "gnu++14",
16 | "intelliSenseMode": "clang-x86"
17 | }
18 | ],
19 | "version": 4
20 | }
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | "version": "0.2.0",
6 | "configurations": [
7 | {
8 | "name": "g++.exe - Build and debug active file",
9 | "type": "cppdbg",
10 | "request": "launch",
11 | "program": "${workspaceFolder}/myprogram.exe",
12 | "args": [],
13 | "stopAtEntry": false,
14 | "cwd": "${workspaceFolder}",
15 | "environment": [],
16 | "externalConsole": false,
17 | "MIMode": "gdb",
18 | "miDebuggerPath": "C:\\Program Files (x86)\\mingw-w64\\i686-8.1.0-posix-dwarf-rt_v6-rev0\\mingw32\\bin\\gdb.exe",
19 | "setupCommands": [
20 | {
21 | "description": "Enable pretty-printing for gdb",
22 | "text": "-enable-pretty-printing",
23 | "ignoreFailures": true
24 | }
25 | ],
26 | "preLaunchTask": "C/C++: g++.exe build active file"
27 | }
28 | ]
29 | }
--------------------------------------------------------------------------------
/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "2.0.0",
3 | "tasks": [
4 | {
5 | "type": "shell",
6 | "label": "C/C++: g++.exe build active file",
7 | "command": "C:\\Program Files (x86)\\mingw-w64\\i686-8.1.0-posix-dwarf-rt_v6-rev0\\mingw32\\bin\\g++.exe",
8 | "args": [
9 | "-g",
10 | "-std=c++17",
11 | // ISSUE: problem in some OS regarding "fatal error: glad/glad.h not found."
12 | // SOL.: use the workspace directory path variable here:
13 | "-I${workspaceFolder}/include",
14 | "-L${workspaceFolder}/lib",
15 | "${workspaceFolder}/src/\\*.cpp",
16 | "${workspaceFolder}/src/glad.c",
17 | "-lglfw3dll",
18 | "-o",
19 | "${workspaceFolder}/myprogram.exe"
20 | ],
21 | "options": {
22 | "cwd": "${workspaceFolder}"
23 | },
24 | "problemMatcher": [
25 | "$gcc"
26 | ],
27 | "group": {
28 | "kind": "build",
29 | "isDefault": true
30 | }
31 | }
32 | ]
33 | }
34 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # opengl-cpp-template
2 | Opengl c++ template for vscode ide
3 |
4 | This template is source code for this article https://medium.com/@vivekjha92/setup-opengl-with-vs-code-82852c653c43
5 |
6 | Requirements for this template to work
7 | 1. To run this template you should have GCC C++ compiler and the C/C++ extension for VS Code.
8 | To setup both, follow this https://code.visualstudio.com/docs/cpp/config-mingw#_prerequisites
9 |
10 | How to run this project
11 |
12 | 1. Clone this repo
13 | 2. Open this repo as a folder in Visual Studio Code
14 | 3. In VSCode menu under `Run` option select `run without debugging`
--------------------------------------------------------------------------------
/glfw3.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vkphillia/opengl-cpp-template/f0df93ce2cfa7cdbbe3631089374111ff82acc24/glfw3.dll
--------------------------------------------------------------------------------
/include/GLFW/glfw3native.h:
--------------------------------------------------------------------------------
1 | /*************************************************************************
2 | * GLFW 3.3 - www.glfw.org
3 | * A library for OpenGL, window and input
4 | *------------------------------------------------------------------------
5 | * Copyright (c) 2002-2006 Marcus Geelnard
6 | * Copyright (c) 2006-2018 Camilla Löwy
7 | *
8 | * This software is provided 'as-is', without any express or implied
9 | * warranty. In no event will the authors be held liable for any damages
10 | * arising from the use of this software.
11 | *
12 | * Permission is granted to anyone to use this software for any purpose,
13 | * including commercial applications, and to alter it and redistribute it
14 | * freely, subject to the following restrictions:
15 | *
16 | * 1. The origin of this software must not be misrepresented; you must not
17 | * claim that you wrote the original software. If you use this software
18 | * in a product, an acknowledgment in the product documentation would
19 | * be appreciated but is not required.
20 | *
21 | * 2. Altered source versions must be plainly marked as such, and must not
22 | * be misrepresented as being the original software.
23 | *
24 | * 3. This notice may not be removed or altered from any source
25 | * distribution.
26 | *
27 | *************************************************************************/
28 |
29 | #ifndef _glfw3_native_h_
30 | #define _glfw3_native_h_
31 |
32 | #ifdef __cplusplus
33 | extern "C" {
34 | #endif
35 |
36 |
37 | /*************************************************************************
38 | * Doxygen documentation
39 | *************************************************************************/
40 |
41 | /*! @file glfw3native.h
42 | * @brief The header of the native access functions.
43 | *
44 | * This is the header file of the native access functions. See @ref native for
45 | * more information.
46 | */
47 | /*! @defgroup native Native access
48 | * @brief Functions related to accessing native handles.
49 | *
50 | * **By using the native access functions you assert that you know what you're
51 | * doing and how to fix problems caused by using them. If you don't, you
52 | * shouldn't be using them.**
53 | *
54 | * Before the inclusion of @ref glfw3native.h, you may define zero or more
55 | * window system API macro and zero or more context creation API macros.
56 | *
57 | * The chosen backends must match those the library was compiled for. Failure
58 | * to do this will cause a link-time error.
59 | *
60 | * The available window API macros are:
61 | * * `GLFW_EXPOSE_NATIVE_WIN32`
62 | * * `GLFW_EXPOSE_NATIVE_COCOA`
63 | * * `GLFW_EXPOSE_NATIVE_X11`
64 | * * `GLFW_EXPOSE_NATIVE_WAYLAND`
65 | *
66 | * The available context API macros are:
67 | * * `GLFW_EXPOSE_NATIVE_WGL`
68 | * * `GLFW_EXPOSE_NATIVE_NSGL`
69 | * * `GLFW_EXPOSE_NATIVE_GLX`
70 | * * `GLFW_EXPOSE_NATIVE_EGL`
71 | * * `GLFW_EXPOSE_NATIVE_OSMESA`
72 | *
73 | * These macros select which of the native access functions that are declared
74 | * and which platform-specific headers to include. It is then up your (by
75 | * definition platform-specific) code to handle which of these should be
76 | * defined.
77 | */
78 |
79 |
80 | /*************************************************************************
81 | * System headers and types
82 | *************************************************************************/
83 |
84 | #if defined(GLFW_EXPOSE_NATIVE_WIN32) || defined(GLFW_EXPOSE_NATIVE_WGL)
85 | // This is a workaround for the fact that glfw3.h needs to export APIENTRY (for
86 | // example to allow applications to correctly declare a GL_ARB_debug_output
87 | // callback) but windows.h assumes no one will define APIENTRY before it does
88 | #if defined(GLFW_APIENTRY_DEFINED)
89 | #undef APIENTRY
90 | #undef GLFW_APIENTRY_DEFINED
91 | #endif
92 | #include
93 | #elif defined(GLFW_EXPOSE_NATIVE_COCOA) || defined(GLFW_EXPOSE_NATIVE_NSGL)
94 | #if defined(__OBJC__)
95 | #import
96 | #else
97 | #include
98 | typedef void* id;
99 | #endif
100 | #elif defined(GLFW_EXPOSE_NATIVE_X11) || defined(GLFW_EXPOSE_NATIVE_GLX)
101 | #include
102 | #include
103 | #elif defined(GLFW_EXPOSE_NATIVE_WAYLAND)
104 | #include
105 | #endif
106 |
107 | #if defined(GLFW_EXPOSE_NATIVE_WGL)
108 | /* WGL is declared by windows.h */
109 | #endif
110 | #if defined(GLFW_EXPOSE_NATIVE_NSGL)
111 | /* NSGL is declared by Cocoa.h */
112 | #endif
113 | #if defined(GLFW_EXPOSE_NATIVE_GLX)
114 | #include
115 | #endif
116 | #if defined(GLFW_EXPOSE_NATIVE_EGL)
117 | #include
118 | #endif
119 | #if defined(GLFW_EXPOSE_NATIVE_OSMESA)
120 | #include
121 | #endif
122 |
123 |
124 | /*************************************************************************
125 | * Functions
126 | *************************************************************************/
127 |
128 | #if defined(GLFW_EXPOSE_NATIVE_WIN32)
129 | /*! @brief Returns the adapter device name of the specified monitor.
130 | *
131 | * @return The UTF-8 encoded adapter device name (for example `\\.\DISPLAY1`)
132 | * of the specified monitor, or `NULL` if an [error](@ref error_handling)
133 | * occurred.
134 | *
135 | * @thread_safety This function may be called from any thread. Access is not
136 | * synchronized.
137 | *
138 | * @since Added in version 3.1.
139 | *
140 | * @ingroup native
141 | */
142 | GLFWAPI const char* glfwGetWin32Adapter(GLFWmonitor* monitor);
143 |
144 | /*! @brief Returns the display device name of the specified monitor.
145 | *
146 | * @return The UTF-8 encoded display device name (for example
147 | * `\\.\DISPLAY1\Monitor0`) of the specified monitor, or `NULL` if an
148 | * [error](@ref error_handling) occurred.
149 | *
150 | * @thread_safety This function may be called from any thread. Access is not
151 | * synchronized.
152 | *
153 | * @since Added in version 3.1.
154 | *
155 | * @ingroup native
156 | */
157 | GLFWAPI const char* glfwGetWin32Monitor(GLFWmonitor* monitor);
158 |
159 | /*! @brief Returns the `HWND` of the specified window.
160 | *
161 | * @return The `HWND` of the specified window, or `NULL` if an
162 | * [error](@ref error_handling) occurred.
163 | *
164 | * @thread_safety This function may be called from any thread. Access is not
165 | * synchronized.
166 | *
167 | * @since Added in version 3.0.
168 | *
169 | * @ingroup native
170 | */
171 | GLFWAPI HWND glfwGetWin32Window(GLFWwindow* window);
172 | #endif
173 |
174 | #if defined(GLFW_EXPOSE_NATIVE_WGL)
175 | /*! @brief Returns the `HGLRC` of the specified window.
176 | *
177 | * @return The `HGLRC` of the specified window, or `NULL` if an
178 | * [error](@ref error_handling) occurred.
179 | *
180 | * @thread_safety This function may be called from any thread. Access is not
181 | * synchronized.
182 | *
183 | * @since Added in version 3.0.
184 | *
185 | * @ingroup native
186 | */
187 | GLFWAPI HGLRC glfwGetWGLContext(GLFWwindow* window);
188 | #endif
189 |
190 | #if defined(GLFW_EXPOSE_NATIVE_COCOA)
191 | /*! @brief Returns the `CGDirectDisplayID` of the specified monitor.
192 | *
193 | * @return The `CGDirectDisplayID` of the specified monitor, or
194 | * `kCGNullDirectDisplay` if an [error](@ref error_handling) occurred.
195 | *
196 | * @thread_safety This function may be called from any thread. Access is not
197 | * synchronized.
198 | *
199 | * @since Added in version 3.1.
200 | *
201 | * @ingroup native
202 | */
203 | GLFWAPI CGDirectDisplayID glfwGetCocoaMonitor(GLFWmonitor* monitor);
204 |
205 | /*! @brief Returns the `NSWindow` of the specified window.
206 | *
207 | * @return The `NSWindow` of the specified window, or `nil` if an
208 | * [error](@ref error_handling) occurred.
209 | *
210 | * @thread_safety This function may be called from any thread. Access is not
211 | * synchronized.
212 | *
213 | * @since Added in version 3.0.
214 | *
215 | * @ingroup native
216 | */
217 | GLFWAPI id glfwGetCocoaWindow(GLFWwindow* window);
218 | #endif
219 |
220 | #if defined(GLFW_EXPOSE_NATIVE_NSGL)
221 | /*! @brief Returns the `NSOpenGLContext` of the specified window.
222 | *
223 | * @return The `NSOpenGLContext` of the specified window, or `nil` if an
224 | * [error](@ref error_handling) occurred.
225 | *
226 | * @thread_safety This function may be called from any thread. Access is not
227 | * synchronized.
228 | *
229 | * @since Added in version 3.0.
230 | *
231 | * @ingroup native
232 | */
233 | GLFWAPI id glfwGetNSGLContext(GLFWwindow* window);
234 | #endif
235 |
236 | #if defined(GLFW_EXPOSE_NATIVE_X11)
237 | /*! @brief Returns the `Display` used by GLFW.
238 | *
239 | * @return The `Display` used by GLFW, or `NULL` if an
240 | * [error](@ref error_handling) occurred.
241 | *
242 | * @thread_safety This function may be called from any thread. Access is not
243 | * synchronized.
244 | *
245 | * @since Added in version 3.0.
246 | *
247 | * @ingroup native
248 | */
249 | GLFWAPI Display* glfwGetX11Display(void);
250 |
251 | /*! @brief Returns the `RRCrtc` of the specified monitor.
252 | *
253 | * @return The `RRCrtc` of the specified monitor, or `None` if an
254 | * [error](@ref error_handling) occurred.
255 | *
256 | * @thread_safety This function may be called from any thread. Access is not
257 | * synchronized.
258 | *
259 | * @since Added in version 3.1.
260 | *
261 | * @ingroup native
262 | */
263 | GLFWAPI RRCrtc glfwGetX11Adapter(GLFWmonitor* monitor);
264 |
265 | /*! @brief Returns the `RROutput` of the specified monitor.
266 | *
267 | * @return The `RROutput` of the specified monitor, or `None` if an
268 | * [error](@ref error_handling) occurred.
269 | *
270 | * @thread_safety This function may be called from any thread. Access is not
271 | * synchronized.
272 | *
273 | * @since Added in version 3.1.
274 | *
275 | * @ingroup native
276 | */
277 | GLFWAPI RROutput glfwGetX11Monitor(GLFWmonitor* monitor);
278 |
279 | /*! @brief Returns the `Window` of the specified window.
280 | *
281 | * @return The `Window` of the specified window, or `None` if an
282 | * [error](@ref error_handling) occurred.
283 | *
284 | * @thread_safety This function may be called from any thread. Access is not
285 | * synchronized.
286 | *
287 | * @since Added in version 3.0.
288 | *
289 | * @ingroup native
290 | */
291 | GLFWAPI Window glfwGetX11Window(GLFWwindow* window);
292 |
293 | /*! @brief Sets the current primary selection to the specified string.
294 | *
295 | * @param[in] string A UTF-8 encoded string.
296 | *
297 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
298 | * GLFW_PLATFORM_ERROR.
299 | *
300 | * @pointer_lifetime The specified string is copied before this function
301 | * returns.
302 | *
303 | * @thread_safety This function must only be called from the main thread.
304 | *
305 | * @sa @ref clipboard
306 | * @sa glfwGetX11SelectionString
307 | * @sa glfwSetClipboardString
308 | *
309 | * @since Added in version 3.3.
310 | *
311 | * @ingroup native
312 | */
313 | GLFWAPI void glfwSetX11SelectionString(const char* string);
314 |
315 | /*! @brief Returns the contents of the current primary selection as a string.
316 | *
317 | * If the selection is empty or if its contents cannot be converted, `NULL`
318 | * is returned and a @ref GLFW_FORMAT_UNAVAILABLE error is generated.
319 | *
320 | * @return The contents of the selection as a UTF-8 encoded string, or `NULL`
321 | * if an [error](@ref error_handling) occurred.
322 | *
323 | * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
324 | * GLFW_PLATFORM_ERROR.
325 | *
326 | * @pointer_lifetime The returned string is allocated and freed by GLFW. You
327 | * should not free it yourself. It is valid until the next call to @ref
328 | * glfwGetX11SelectionString or @ref glfwSetX11SelectionString, or until the
329 | * library is terminated.
330 | *
331 | * @thread_safety This function must only be called from the main thread.
332 | *
333 | * @sa @ref clipboard
334 | * @sa glfwSetX11SelectionString
335 | * @sa glfwGetClipboardString
336 | *
337 | * @since Added in version 3.3.
338 | *
339 | * @ingroup native
340 | */
341 | GLFWAPI const char* glfwGetX11SelectionString(void);
342 | #endif
343 |
344 | #if defined(GLFW_EXPOSE_NATIVE_GLX)
345 | /*! @brief Returns the `GLXContext` of the specified window.
346 | *
347 | * @return The `GLXContext` of the specified window, or `NULL` if an
348 | * [error](@ref error_handling) occurred.
349 | *
350 | * @thread_safety This function may be called from any thread. Access is not
351 | * synchronized.
352 | *
353 | * @since Added in version 3.0.
354 | *
355 | * @ingroup native
356 | */
357 | GLFWAPI GLXContext glfwGetGLXContext(GLFWwindow* window);
358 |
359 | /*! @brief Returns the `GLXWindow` of the specified window.
360 | *
361 | * @return The `GLXWindow` of the specified window, or `None` if an
362 | * [error](@ref error_handling) occurred.
363 | *
364 | * @thread_safety This function may be called from any thread. Access is not
365 | * synchronized.
366 | *
367 | * @since Added in version 3.2.
368 | *
369 | * @ingroup native
370 | */
371 | GLFWAPI GLXWindow glfwGetGLXWindow(GLFWwindow* window);
372 | #endif
373 |
374 | #if defined(GLFW_EXPOSE_NATIVE_WAYLAND)
375 | /*! @brief Returns the `struct wl_display*` used by GLFW.
376 | *
377 | * @return The `struct wl_display*` used by GLFW, or `NULL` if an
378 | * [error](@ref error_handling) occurred.
379 | *
380 | * @thread_safety This function may be called from any thread. Access is not
381 | * synchronized.
382 | *
383 | * @since Added in version 3.2.
384 | *
385 | * @ingroup native
386 | */
387 | GLFWAPI struct wl_display* glfwGetWaylandDisplay(void);
388 |
389 | /*! @brief Returns the `struct wl_output*` of the specified monitor.
390 | *
391 | * @return The `struct wl_output*` of the specified monitor, or `NULL` if an
392 | * [error](@ref error_handling) occurred.
393 | *
394 | * @thread_safety This function may be called from any thread. Access is not
395 | * synchronized.
396 | *
397 | * @since Added in version 3.2.
398 | *
399 | * @ingroup native
400 | */
401 | GLFWAPI struct wl_output* glfwGetWaylandMonitor(GLFWmonitor* monitor);
402 |
403 | /*! @brief Returns the main `struct wl_surface*` of the specified window.
404 | *
405 | * @return The main `struct wl_surface*` of the specified window, or `NULL` if
406 | * an [error](@ref error_handling) occurred.
407 | *
408 | * @thread_safety This function may be called from any thread. Access is not
409 | * synchronized.
410 | *
411 | * @since Added in version 3.2.
412 | *
413 | * @ingroup native
414 | */
415 | GLFWAPI struct wl_surface* glfwGetWaylandWindow(GLFWwindow* window);
416 | #endif
417 |
418 | #if defined(GLFW_EXPOSE_NATIVE_EGL)
419 | /*! @brief Returns the `EGLDisplay` used by GLFW.
420 | *
421 | * @return The `EGLDisplay` used by GLFW, or `EGL_NO_DISPLAY` if an
422 | * [error](@ref error_handling) occurred.
423 | *
424 | * @thread_safety This function may be called from any thread. Access is not
425 | * synchronized.
426 | *
427 | * @since Added in version 3.0.
428 | *
429 | * @ingroup native
430 | */
431 | GLFWAPI EGLDisplay glfwGetEGLDisplay(void);
432 |
433 | /*! @brief Returns the `EGLContext` of the specified window.
434 | *
435 | * @return The `EGLContext` of the specified window, or `EGL_NO_CONTEXT` if an
436 | * [error](@ref error_handling) occurred.
437 | *
438 | * @thread_safety This function may be called from any thread. Access is not
439 | * synchronized.
440 | *
441 | * @since Added in version 3.0.
442 | *
443 | * @ingroup native
444 | */
445 | GLFWAPI EGLContext glfwGetEGLContext(GLFWwindow* window);
446 |
447 | /*! @brief Returns the `EGLSurface` of the specified window.
448 | *
449 | * @return The `EGLSurface` of the specified window, or `EGL_NO_SURFACE` if an
450 | * [error](@ref error_handling) occurred.
451 | *
452 | * @thread_safety This function may be called from any thread. Access is not
453 | * synchronized.
454 | *
455 | * @since Added in version 3.0.
456 | *
457 | * @ingroup native
458 | */
459 | GLFWAPI EGLSurface glfwGetEGLSurface(GLFWwindow* window);
460 | #endif
461 |
462 | #if defined(GLFW_EXPOSE_NATIVE_OSMESA)
463 | /*! @brief Retrieves the color buffer associated with the specified window.
464 | *
465 | * @param[in] window The window whose color buffer to retrieve.
466 | * @param[out] width Where to store the width of the color buffer, or `NULL`.
467 | * @param[out] height Where to store the height of the color buffer, or `NULL`.
468 | * @param[out] format Where to store the OSMesa pixel format of the color
469 | * buffer, or `NULL`.
470 | * @param[out] buffer Where to store the address of the color buffer, or
471 | * `NULL`.
472 | * @return `GLFW_TRUE` if successful, or `GLFW_FALSE` if an
473 | * [error](@ref error_handling) occurred.
474 | *
475 | * @thread_safety This function may be called from any thread. Access is not
476 | * synchronized.
477 | *
478 | * @since Added in version 3.3.
479 | *
480 | * @ingroup native
481 | */
482 | GLFWAPI int glfwGetOSMesaColorBuffer(GLFWwindow* window, int* width, int* height, int* format, void** buffer);
483 |
484 | /*! @brief Retrieves the depth buffer associated with the specified window.
485 | *
486 | * @param[in] window The window whose depth buffer to retrieve.
487 | * @param[out] width Where to store the width of the depth buffer, or `NULL`.
488 | * @param[out] height Where to store the height of the depth buffer, or `NULL`.
489 | * @param[out] bytesPerValue Where to store the number of bytes per depth
490 | * buffer element, or `NULL`.
491 | * @param[out] buffer Where to store the address of the depth buffer, or
492 | * `NULL`.
493 | * @return `GLFW_TRUE` if successful, or `GLFW_FALSE` if an
494 | * [error](@ref error_handling) occurred.
495 | *
496 | * @thread_safety This function may be called from any thread. Access is not
497 | * synchronized.
498 | *
499 | * @since Added in version 3.3.
500 | *
501 | * @ingroup native
502 | */
503 | GLFWAPI int glfwGetOSMesaDepthBuffer(GLFWwindow* window, int* width, int* height, int* bytesPerValue, void** buffer);
504 |
505 | /*! @brief Returns the `OSMesaContext` of the specified window.
506 | *
507 | * @return The `OSMesaContext` of the specified window, or `NULL` if an
508 | * [error](@ref error_handling) occurred.
509 | *
510 | * @thread_safety This function may be called from any thread. Access is not
511 | * synchronized.
512 | *
513 | * @since Added in version 3.3.
514 | *
515 | * @ingroup native
516 | */
517 | GLFWAPI OSMesaContext glfwGetOSMesaContext(GLFWwindow* window);
518 | #endif
519 |
520 | #ifdef __cplusplus
521 | }
522 | #endif
523 |
524 | #endif /* _glfw3_native_h_ */
525 |
526 |
--------------------------------------------------------------------------------
/include/KHR/khrplatform.h:
--------------------------------------------------------------------------------
1 | #ifndef __khrplatform_h_
2 | #define __khrplatform_h_
3 |
4 | /*
5 | ** Copyright (c) 2008-2018 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 | * The master copy of khrplatform.h is maintained in the Khronos EGL
30 | * Registry repository at https://github.com/KhronosGroup/EGL-Registry
31 | * The last semantic modification to khrplatform.h was at commit ID:
32 | * 67a3e0864c2d75ea5287b9f3d2eb74a745936692
33 | *
34 | * Adopters may modify this file to suit their platform. Adopters are
35 | * encouraged to submit platform specific modifications to the Khronos
36 | * group so that they can be included in future versions of this file.
37 | * Please submit changes by filing pull requests or issues on
38 | * the EGL Registry repository linked above.
39 | *
40 | *
41 | * See the Implementer's Guidelines for information about where this file
42 | * should be located on your system and for more details of its use:
43 | * http://www.khronos.org/registry/implementers_guide.pdf
44 | *
45 | * This file should be included as
46 | * #include
47 | * by Khronos client API header files that use its types and defines.
48 | *
49 | * The types in khrplatform.h should only be used to define API-specific types.
50 | *
51 | * Types defined in khrplatform.h:
52 | * khronos_int8_t signed 8 bit
53 | * khronos_uint8_t unsigned 8 bit
54 | * khronos_int16_t signed 16 bit
55 | * khronos_uint16_t unsigned 16 bit
56 | * khronos_int32_t signed 32 bit
57 | * khronos_uint32_t unsigned 32 bit
58 | * khronos_int64_t signed 64 bit
59 | * khronos_uint64_t unsigned 64 bit
60 | * khronos_intptr_t signed same number of bits as a pointer
61 | * khronos_uintptr_t unsigned same number of bits as a pointer
62 | * khronos_ssize_t signed size
63 | * khronos_usize_t unsigned size
64 | * khronos_float_t signed 32 bit floating point
65 | * khronos_time_ns_t unsigned 64 bit time in nanoseconds
66 | * khronos_utime_nanoseconds_t unsigned time interval or absolute time in
67 | * nanoseconds
68 | * khronos_stime_nanoseconds_t signed time interval in nanoseconds
69 | * khronos_boolean_enum_t enumerated boolean type. This should
70 | * only be used as a base type when a client API's boolean type is
71 | * an enum. Client APIs which use an integer or other type for
72 | * booleans cannot use this as the base type for their boolean.
73 | *
74 | * Tokens defined in khrplatform.h:
75 | *
76 | * KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values.
77 | *
78 | * KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0.
79 | * KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0.
80 | *
81 | * Calling convention macros defined in this file:
82 | * KHRONOS_APICALL
83 | * KHRONOS_APIENTRY
84 | * KHRONOS_APIATTRIBUTES
85 | *
86 | * These may be used in function prototypes as:
87 | *
88 | * KHRONOS_APICALL void KHRONOS_APIENTRY funcname(
89 | * int arg1,
90 | * int arg2) KHRONOS_APIATTRIBUTES;
91 | */
92 |
93 | #if defined(__SCITECH_SNAP__) && !defined(KHRONOS_STATIC)
94 | # define KHRONOS_STATIC 1
95 | #endif
96 |
97 | /*-------------------------------------------------------------------------
98 | * Definition of KHRONOS_APICALL
99 | *-------------------------------------------------------------------------
100 | * This precedes the return type of the function in the function prototype.
101 | */
102 | #if defined(KHRONOS_STATIC)
103 | /* If the preprocessor constant KHRONOS_STATIC is defined, make the
104 | * header compatible with static linking. */
105 | # define KHRONOS_APICALL
106 | #elif defined(_WIN32)
107 | # define KHRONOS_APICALL __declspec(dllimport)
108 | #elif defined (__SYMBIAN32__)
109 | # define KHRONOS_APICALL IMPORT_C
110 | #elif defined(__ANDROID__)
111 | # define KHRONOS_APICALL __attribute__((visibility("default")))
112 | #else
113 | # define KHRONOS_APICALL
114 | #endif
115 |
116 | /*-------------------------------------------------------------------------
117 | * Definition of KHRONOS_APIENTRY
118 | *-------------------------------------------------------------------------
119 | * This follows the return type of the function and precedes the function
120 | * name in the function prototype.
121 | */
122 | #if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__)
123 | /* Win32 but not WinCE */
124 | # define KHRONOS_APIENTRY __stdcall
125 | #else
126 | # define KHRONOS_APIENTRY
127 | #endif
128 |
129 | /*-------------------------------------------------------------------------
130 | * Definition of KHRONOS_APIATTRIBUTES
131 | *-------------------------------------------------------------------------
132 | * This follows the closing parenthesis of the function prototype arguments.
133 | */
134 | #if defined (__ARMCC_2__)
135 | #define KHRONOS_APIATTRIBUTES __softfp
136 | #else
137 | #define KHRONOS_APIATTRIBUTES
138 | #endif
139 |
140 | /*-------------------------------------------------------------------------
141 | * basic type definitions
142 | *-----------------------------------------------------------------------*/
143 | #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__)
144 |
145 |
146 | /*
147 | * Using
148 | */
149 | #include
150 | typedef int32_t khronos_int32_t;
151 | typedef uint32_t khronos_uint32_t;
152 | typedef int64_t khronos_int64_t;
153 | typedef uint64_t khronos_uint64_t;
154 | #define KHRONOS_SUPPORT_INT64 1
155 | #define KHRONOS_SUPPORT_FLOAT 1
156 |
157 | #elif defined(__VMS ) || defined(__sgi)
158 |
159 | /*
160 | * Using
161 | */
162 | #include
163 | typedef int32_t khronos_int32_t;
164 | typedef uint32_t khronos_uint32_t;
165 | typedef int64_t khronos_int64_t;
166 | typedef uint64_t khronos_uint64_t;
167 | #define KHRONOS_SUPPORT_INT64 1
168 | #define KHRONOS_SUPPORT_FLOAT 1
169 |
170 | #elif defined(_WIN32) && !defined(__SCITECH_SNAP__)
171 |
172 | /*
173 | * Win32
174 | */
175 | typedef __int32 khronos_int32_t;
176 | typedef unsigned __int32 khronos_uint32_t;
177 | typedef __int64 khronos_int64_t;
178 | typedef unsigned __int64 khronos_uint64_t;
179 | #define KHRONOS_SUPPORT_INT64 1
180 | #define KHRONOS_SUPPORT_FLOAT 1
181 |
182 | #elif defined(__sun__) || defined(__digital__)
183 |
184 | /*
185 | * Sun or Digital
186 | */
187 | typedef int khronos_int32_t;
188 | typedef unsigned int khronos_uint32_t;
189 | #if defined(__arch64__) || defined(_LP64)
190 | typedef long int khronos_int64_t;
191 | typedef unsigned long int khronos_uint64_t;
192 | #else
193 | typedef long long int khronos_int64_t;
194 | typedef unsigned long long int khronos_uint64_t;
195 | #endif /* __arch64__ */
196 | #define KHRONOS_SUPPORT_INT64 1
197 | #define KHRONOS_SUPPORT_FLOAT 1
198 |
199 | #elif 0
200 |
201 | /*
202 | * Hypothetical platform with no float or int64 support
203 | */
204 | typedef int khronos_int32_t;
205 | typedef unsigned int khronos_uint32_t;
206 | #define KHRONOS_SUPPORT_INT64 0
207 | #define KHRONOS_SUPPORT_FLOAT 0
208 |
209 | #else
210 |
211 | /*
212 | * Generic fallback
213 | */
214 | #include
215 | typedef int32_t khronos_int32_t;
216 | typedef uint32_t khronos_uint32_t;
217 | typedef int64_t khronos_int64_t;
218 | typedef uint64_t khronos_uint64_t;
219 | #define KHRONOS_SUPPORT_INT64 1
220 | #define KHRONOS_SUPPORT_FLOAT 1
221 |
222 | #endif
223 |
224 |
225 | /*
226 | * Types that are (so far) the same on all platforms
227 | */
228 | typedef signed char khronos_int8_t;
229 | typedef unsigned char khronos_uint8_t;
230 | typedef signed short int khronos_int16_t;
231 | typedef unsigned short int khronos_uint16_t;
232 |
233 | /*
234 | * Types that differ between LLP64 and LP64 architectures - in LLP64,
235 | * pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
236 | * to be the only LLP64 architecture in current use.
237 | */
238 | #ifdef _WIN64
239 | typedef signed long long int khronos_intptr_t;
240 | typedef unsigned long long int khronos_uintptr_t;
241 | typedef signed long long int khronos_ssize_t;
242 | typedef unsigned long long int khronos_usize_t;
243 | #else
244 | typedef signed long int khronos_intptr_t;
245 | typedef unsigned long int khronos_uintptr_t;
246 | typedef signed long int khronos_ssize_t;
247 | typedef unsigned long int khronos_usize_t;
248 | #endif
249 |
250 | #if KHRONOS_SUPPORT_FLOAT
251 | /*
252 | * Float type
253 | */
254 | typedef float khronos_float_t;
255 | #endif
256 |
257 | #if KHRONOS_SUPPORT_INT64
258 | /* Time types
259 | *
260 | * These types can be used to represent a time interval in nanoseconds or
261 | * an absolute Unadjusted System Time. Unadjusted System Time is the number
262 | * of nanoseconds since some arbitrary system event (e.g. since the last
263 | * time the system booted). The Unadjusted System Time is an unsigned
264 | * 64 bit value that wraps back to 0 every 584 years. Time intervals
265 | * may be either signed or unsigned.
266 | */
267 | typedef khronos_uint64_t khronos_utime_nanoseconds_t;
268 | typedef khronos_int64_t khronos_stime_nanoseconds_t;
269 | #endif
270 |
271 | /*
272 | * Dummy value used to pad enum types to 32 bits.
273 | */
274 | #ifndef KHRONOS_MAX_ENUM
275 | #define KHRONOS_MAX_ENUM 0x7FFFFFFF
276 | #endif
277 |
278 | /*
279 | * Enumerated boolean type
280 | *
281 | * Values other than zero should be considered to be true. Therefore
282 | * comparisons should not be made against KHRONOS_TRUE.
283 | */
284 | typedef enum {
285 | KHRONOS_FALSE = 0,
286 | KHRONOS_TRUE = 1,
287 | KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM
288 | } khronos_boolean_enum_t;
289 |
290 | #endif /* __khrplatform_h_ */
291 |
--------------------------------------------------------------------------------
/lib/libglfw3dll.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vkphillia/opengl-cpp-template/f0df93ce2cfa7cdbbe3631089374111ff82acc24/lib/libglfw3dll.a
--------------------------------------------------------------------------------
/src/glad.c:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | OpenGL loader generated by glad 0.1.34 on Mon Oct 5 05:15:45 2020.
4 |
5 | Language/Generator: C/C++
6 | Specification: gl
7 | APIs: gl=3.3
8 | Profile: core
9 | Extensions:
10 |
11 | Loader: True
12 | Local files: False
13 | Omit khrplatform: False
14 | Reproducible: False
15 |
16 | Commandline:
17 | --profile="core" --api="gl=3.3" --generator="c" --spec="gl" --extensions=""
18 | Online:
19 | https://glad.dav1d.de/#profile=core&language=c&specification=gl&loader=on&api=gl%3D3.3
20 | */
21 |
22 | #include
23 | #include
24 | #include
25 | #include
26 |
27 | static void* get_proc(const char *namez);
28 |
29 | #if defined(_WIN32) || defined(__CYGWIN__)
30 | #ifndef _WINDOWS_
31 | #undef APIENTRY
32 | #endif
33 | #include
34 | static HMODULE libGL;
35 |
36 | typedef void* (APIENTRYP PFNWGLGETPROCADDRESSPROC_PRIVATE)(const char*);
37 | static PFNWGLGETPROCADDRESSPROC_PRIVATE gladGetProcAddressPtr;
38 |
39 | #ifdef _MSC_VER
40 | #ifdef __has_include
41 | #if __has_include()
42 | #define HAVE_WINAPIFAMILY 1
43 | #endif
44 | #elif _MSC_VER >= 1700 && !_USING_V110_SDK71_
45 | #define HAVE_WINAPIFAMILY 1
46 | #endif
47 | #endif
48 |
49 | #ifdef HAVE_WINAPIFAMILY
50 | #include
51 | #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
52 | #define IS_UWP 1
53 | #endif
54 | #endif
55 |
56 | static
57 | int open_gl(void) {
58 | #ifndef IS_UWP
59 | libGL = LoadLibraryW(L"opengl32.dll");
60 | if(libGL != NULL) {
61 | void (* tmp)(void);
62 | tmp = (void(*)(void)) GetProcAddress(libGL, "wglGetProcAddress");
63 | gladGetProcAddressPtr = (PFNWGLGETPROCADDRESSPROC_PRIVATE) tmp;
64 | return gladGetProcAddressPtr != NULL;
65 | }
66 | #endif
67 |
68 | return 0;
69 | }
70 |
71 | static
72 | void close_gl(void) {
73 | if(libGL != NULL) {
74 | FreeLibrary((HMODULE) libGL);
75 | libGL = NULL;
76 | }
77 | }
78 | #else
79 | #include
80 | static void* libGL;
81 |
82 | #if !defined(__APPLE__) && !defined(__HAIKU__)
83 | typedef void* (APIENTRYP PFNGLXGETPROCADDRESSPROC_PRIVATE)(const char*);
84 | static PFNGLXGETPROCADDRESSPROC_PRIVATE gladGetProcAddressPtr;
85 | #endif
86 |
87 | static
88 | int open_gl(void) {
89 | #ifdef __APPLE__
90 | static const char *NAMES[] = {
91 | "../Frameworks/OpenGL.framework/OpenGL",
92 | "/Library/Frameworks/OpenGL.framework/OpenGL",
93 | "/System/Library/Frameworks/OpenGL.framework/OpenGL",
94 | "/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL"
95 | };
96 | #else
97 | static const char *NAMES[] = {"libGL.so.1", "libGL.so"};
98 | #endif
99 |
100 | unsigned int index = 0;
101 | for(index = 0; index < (sizeof(NAMES) / sizeof(NAMES[0])); index++) {
102 | libGL = dlopen(NAMES[index], RTLD_NOW | RTLD_GLOBAL);
103 |
104 | if(libGL != NULL) {
105 | #if defined(__APPLE__) || defined(__HAIKU__)
106 | return 1;
107 | #else
108 | gladGetProcAddressPtr = (PFNGLXGETPROCADDRESSPROC_PRIVATE)dlsym(libGL,
109 | "glXGetProcAddressARB");
110 | return gladGetProcAddressPtr != NULL;
111 | #endif
112 | }
113 | }
114 |
115 | return 0;
116 | }
117 |
118 | static
119 | void close_gl(void) {
120 | if(libGL != NULL) {
121 | dlclose(libGL);
122 | libGL = NULL;
123 | }
124 | }
125 | #endif
126 |
127 | static
128 | void* get_proc(const char *namez) {
129 | void* result = NULL;
130 | if(libGL == NULL) return NULL;
131 |
132 | #if !defined(__APPLE__) && !defined(__HAIKU__)
133 | if(gladGetProcAddressPtr != NULL) {
134 | result = gladGetProcAddressPtr(namez);
135 | }
136 | #endif
137 | if(result == NULL) {
138 | #if defined(_WIN32) || defined(__CYGWIN__)
139 | result = (void*)GetProcAddress((HMODULE) libGL, namez);
140 | #else
141 | result = dlsym(libGL, namez);
142 | #endif
143 | }
144 |
145 | return result;
146 | }
147 |
148 | int gladLoadGL(void) {
149 | int status = 0;
150 |
151 | if(open_gl()) {
152 | status = gladLoadGLLoader(&get_proc);
153 | close_gl();
154 | }
155 |
156 | return status;
157 | }
158 |
159 | struct gladGLversionStruct GLVersion = { 0, 0 };
160 |
161 | #if defined(GL_ES_VERSION_3_0) || defined(GL_VERSION_3_0)
162 | #define _GLAD_IS_SOME_NEW_VERSION 1
163 | #endif
164 |
165 | static int max_loaded_major;
166 | static int max_loaded_minor;
167 |
168 | static const char *exts = NULL;
169 | static int num_exts_i = 0;
170 | static char **exts_i = NULL;
171 |
172 | static int get_exts(void) {
173 | #ifdef _GLAD_IS_SOME_NEW_VERSION
174 | if(max_loaded_major < 3) {
175 | #endif
176 | exts = (const char *)glGetString(GL_EXTENSIONS);
177 | #ifdef _GLAD_IS_SOME_NEW_VERSION
178 | } else {
179 | unsigned int index;
180 |
181 | num_exts_i = 0;
182 | glGetIntegerv(GL_NUM_EXTENSIONS, &num_exts_i);
183 | if (num_exts_i > 0) {
184 | exts_i = (char **)malloc((size_t)num_exts_i * (sizeof *exts_i));
185 | }
186 |
187 | if (exts_i == NULL) {
188 | return 0;
189 | }
190 |
191 | for(index = 0; index < (unsigned)num_exts_i; index++) {
192 | const char *gl_str_tmp = (const char*)glGetStringi(GL_EXTENSIONS, index);
193 | size_t len = strlen(gl_str_tmp);
194 |
195 | char *local_str = (char*)malloc((len+1) * sizeof(char));
196 | if(local_str != NULL) {
197 | memcpy(local_str, gl_str_tmp, (len+1) * sizeof(char));
198 | }
199 | exts_i[index] = local_str;
200 | }
201 | }
202 | #endif
203 | return 1;
204 | }
205 |
206 | static void free_exts(void) {
207 | if (exts_i != NULL) {
208 | int index;
209 | for(index = 0; index < num_exts_i; index++) {
210 | free((char *)exts_i[index]);
211 | }
212 | free((void *)exts_i);
213 | exts_i = NULL;
214 | }
215 | }
216 |
217 | static int has_ext(const char *ext) {
218 | #ifdef _GLAD_IS_SOME_NEW_VERSION
219 | if(max_loaded_major < 3) {
220 | #endif
221 | const char *extensions;
222 | const char *loc;
223 | const char *terminator;
224 | extensions = exts;
225 | if(extensions == NULL || ext == NULL) {
226 | return 0;
227 | }
228 |
229 | while(1) {
230 | loc = strstr(extensions, ext);
231 | if(loc == NULL) {
232 | return 0;
233 | }
234 |
235 | terminator = loc + strlen(ext);
236 | if((loc == extensions || *(loc - 1) == ' ') &&
237 | (*terminator == ' ' || *terminator == '\0')) {
238 | return 1;
239 | }
240 | extensions = terminator;
241 | }
242 | #ifdef _GLAD_IS_SOME_NEW_VERSION
243 | } else {
244 | int index;
245 | if(exts_i == NULL) return 0;
246 | for(index = 0; index < num_exts_i; index++) {
247 | const char *e = exts_i[index];
248 |
249 | if(exts_i[index] != NULL && strcmp(e, ext) == 0) {
250 | return 1;
251 | }
252 | }
253 | }
254 | #endif
255 |
256 | return 0;
257 | }
258 | int GLAD_GL_VERSION_1_0 = 0;
259 | int GLAD_GL_VERSION_1_1 = 0;
260 | int GLAD_GL_VERSION_1_2 = 0;
261 | int GLAD_GL_VERSION_1_3 = 0;
262 | int GLAD_GL_VERSION_1_4 = 0;
263 | int GLAD_GL_VERSION_1_5 = 0;
264 | int GLAD_GL_VERSION_2_0 = 0;
265 | int GLAD_GL_VERSION_2_1 = 0;
266 | int GLAD_GL_VERSION_3_0 = 0;
267 | int GLAD_GL_VERSION_3_1 = 0;
268 | int GLAD_GL_VERSION_3_2 = 0;
269 | int GLAD_GL_VERSION_3_3 = 0;
270 | PFNGLACTIVETEXTUREPROC glad_glActiveTexture = NULL;
271 | PFNGLATTACHSHADERPROC glad_glAttachShader = NULL;
272 | PFNGLBEGINCONDITIONALRENDERPROC glad_glBeginConditionalRender = NULL;
273 | PFNGLBEGINQUERYPROC glad_glBeginQuery = NULL;
274 | PFNGLBEGINTRANSFORMFEEDBACKPROC glad_glBeginTransformFeedback = NULL;
275 | PFNGLBINDATTRIBLOCATIONPROC glad_glBindAttribLocation = NULL;
276 | PFNGLBINDBUFFERPROC glad_glBindBuffer = NULL;
277 | PFNGLBINDBUFFERBASEPROC glad_glBindBufferBase = NULL;
278 | PFNGLBINDBUFFERRANGEPROC glad_glBindBufferRange = NULL;
279 | PFNGLBINDFRAGDATALOCATIONPROC glad_glBindFragDataLocation = NULL;
280 | PFNGLBINDFRAGDATALOCATIONINDEXEDPROC glad_glBindFragDataLocationIndexed = NULL;
281 | PFNGLBINDFRAMEBUFFERPROC glad_glBindFramebuffer = NULL;
282 | PFNGLBINDRENDERBUFFERPROC glad_glBindRenderbuffer = NULL;
283 | PFNGLBINDSAMPLERPROC glad_glBindSampler = NULL;
284 | PFNGLBINDTEXTUREPROC glad_glBindTexture = NULL;
285 | PFNGLBINDVERTEXARRAYPROC glad_glBindVertexArray = NULL;
286 | PFNGLBLENDCOLORPROC glad_glBlendColor = NULL;
287 | PFNGLBLENDEQUATIONPROC glad_glBlendEquation = NULL;
288 | PFNGLBLENDEQUATIONSEPARATEPROC glad_glBlendEquationSeparate = NULL;
289 | PFNGLBLENDFUNCPROC glad_glBlendFunc = NULL;
290 | PFNGLBLENDFUNCSEPARATEPROC glad_glBlendFuncSeparate = NULL;
291 | PFNGLBLITFRAMEBUFFERPROC glad_glBlitFramebuffer = NULL;
292 | PFNGLBUFFERDATAPROC glad_glBufferData = NULL;
293 | PFNGLBUFFERSUBDATAPROC glad_glBufferSubData = NULL;
294 | PFNGLCHECKFRAMEBUFFERSTATUSPROC glad_glCheckFramebufferStatus = NULL;
295 | PFNGLCLAMPCOLORPROC glad_glClampColor = NULL;
296 | PFNGLCLEARPROC glad_glClear = NULL;
297 | PFNGLCLEARBUFFERFIPROC glad_glClearBufferfi = NULL;
298 | PFNGLCLEARBUFFERFVPROC glad_glClearBufferfv = NULL;
299 | PFNGLCLEARBUFFERIVPROC glad_glClearBufferiv = NULL;
300 | PFNGLCLEARBUFFERUIVPROC glad_glClearBufferuiv = NULL;
301 | PFNGLCLEARCOLORPROC glad_glClearColor = NULL;
302 | PFNGLCLEARDEPTHPROC glad_glClearDepth = NULL;
303 | PFNGLCLEARSTENCILPROC glad_glClearStencil = NULL;
304 | PFNGLCLIENTWAITSYNCPROC glad_glClientWaitSync = NULL;
305 | PFNGLCOLORMASKPROC glad_glColorMask = NULL;
306 | PFNGLCOLORMASKIPROC glad_glColorMaski = NULL;
307 | PFNGLCOLORP3UIPROC glad_glColorP3ui = NULL;
308 | PFNGLCOLORP3UIVPROC glad_glColorP3uiv = NULL;
309 | PFNGLCOLORP4UIPROC glad_glColorP4ui = NULL;
310 | PFNGLCOLORP4UIVPROC glad_glColorP4uiv = NULL;
311 | PFNGLCOMPILESHADERPROC glad_glCompileShader = NULL;
312 | PFNGLCOMPRESSEDTEXIMAGE1DPROC glad_glCompressedTexImage1D = NULL;
313 | PFNGLCOMPRESSEDTEXIMAGE2DPROC glad_glCompressedTexImage2D = NULL;
314 | PFNGLCOMPRESSEDTEXIMAGE3DPROC glad_glCompressedTexImage3D = NULL;
315 | PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC glad_glCompressedTexSubImage1D = NULL;
316 | PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glad_glCompressedTexSubImage2D = NULL;
317 | PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glad_glCompressedTexSubImage3D = NULL;
318 | PFNGLCOPYBUFFERSUBDATAPROC glad_glCopyBufferSubData = NULL;
319 | PFNGLCOPYTEXIMAGE1DPROC glad_glCopyTexImage1D = NULL;
320 | PFNGLCOPYTEXIMAGE2DPROC glad_glCopyTexImage2D = NULL;
321 | PFNGLCOPYTEXSUBIMAGE1DPROC glad_glCopyTexSubImage1D = NULL;
322 | PFNGLCOPYTEXSUBIMAGE2DPROC glad_glCopyTexSubImage2D = NULL;
323 | PFNGLCOPYTEXSUBIMAGE3DPROC glad_glCopyTexSubImage3D = NULL;
324 | PFNGLCREATEPROGRAMPROC glad_glCreateProgram = NULL;
325 | PFNGLCREATESHADERPROC glad_glCreateShader = NULL;
326 | PFNGLCULLFACEPROC glad_glCullFace = NULL;
327 | PFNGLDELETEBUFFERSPROC glad_glDeleteBuffers = NULL;
328 | PFNGLDELETEFRAMEBUFFERSPROC glad_glDeleteFramebuffers = NULL;
329 | PFNGLDELETEPROGRAMPROC glad_glDeleteProgram = NULL;
330 | PFNGLDELETEQUERIESPROC glad_glDeleteQueries = NULL;
331 | PFNGLDELETERENDERBUFFERSPROC glad_glDeleteRenderbuffers = NULL;
332 | PFNGLDELETESAMPLERSPROC glad_glDeleteSamplers = NULL;
333 | PFNGLDELETESHADERPROC glad_glDeleteShader = NULL;
334 | PFNGLDELETESYNCPROC glad_glDeleteSync = NULL;
335 | PFNGLDELETETEXTURESPROC glad_glDeleteTextures = NULL;
336 | PFNGLDELETEVERTEXARRAYSPROC glad_glDeleteVertexArrays = NULL;
337 | PFNGLDEPTHFUNCPROC glad_glDepthFunc = NULL;
338 | PFNGLDEPTHMASKPROC glad_glDepthMask = NULL;
339 | PFNGLDEPTHRANGEPROC glad_glDepthRange = NULL;
340 | PFNGLDETACHSHADERPROC glad_glDetachShader = NULL;
341 | PFNGLDISABLEPROC glad_glDisable = NULL;
342 | PFNGLDISABLEVERTEXATTRIBARRAYPROC glad_glDisableVertexAttribArray = NULL;
343 | PFNGLDISABLEIPROC glad_glDisablei = NULL;
344 | PFNGLDRAWARRAYSPROC glad_glDrawArrays = NULL;
345 | PFNGLDRAWARRAYSINSTANCEDPROC glad_glDrawArraysInstanced = NULL;
346 | PFNGLDRAWBUFFERPROC glad_glDrawBuffer = NULL;
347 | PFNGLDRAWBUFFERSPROC glad_glDrawBuffers = NULL;
348 | PFNGLDRAWELEMENTSPROC glad_glDrawElements = NULL;
349 | PFNGLDRAWELEMENTSBASEVERTEXPROC glad_glDrawElementsBaseVertex = NULL;
350 | PFNGLDRAWELEMENTSINSTANCEDPROC glad_glDrawElementsInstanced = NULL;
351 | PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC glad_glDrawElementsInstancedBaseVertex = NULL;
352 | PFNGLDRAWRANGEELEMENTSPROC glad_glDrawRangeElements = NULL;
353 | PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC glad_glDrawRangeElementsBaseVertex = NULL;
354 | PFNGLENABLEPROC glad_glEnable = NULL;
355 | PFNGLENABLEVERTEXATTRIBARRAYPROC glad_glEnableVertexAttribArray = NULL;
356 | PFNGLENABLEIPROC glad_glEnablei = NULL;
357 | PFNGLENDCONDITIONALRENDERPROC glad_glEndConditionalRender = NULL;
358 | PFNGLENDQUERYPROC glad_glEndQuery = NULL;
359 | PFNGLENDTRANSFORMFEEDBACKPROC glad_glEndTransformFeedback = NULL;
360 | PFNGLFENCESYNCPROC glad_glFenceSync = NULL;
361 | PFNGLFINISHPROC glad_glFinish = NULL;
362 | PFNGLFLUSHPROC glad_glFlush = NULL;
363 | PFNGLFLUSHMAPPEDBUFFERRANGEPROC glad_glFlushMappedBufferRange = NULL;
364 | PFNGLFRAMEBUFFERRENDERBUFFERPROC glad_glFramebufferRenderbuffer = NULL;
365 | PFNGLFRAMEBUFFERTEXTUREPROC glad_glFramebufferTexture = NULL;
366 | PFNGLFRAMEBUFFERTEXTURE1DPROC glad_glFramebufferTexture1D = NULL;
367 | PFNGLFRAMEBUFFERTEXTURE2DPROC glad_glFramebufferTexture2D = NULL;
368 | PFNGLFRAMEBUFFERTEXTURE3DPROC glad_glFramebufferTexture3D = NULL;
369 | PFNGLFRAMEBUFFERTEXTURELAYERPROC glad_glFramebufferTextureLayer = NULL;
370 | PFNGLFRONTFACEPROC glad_glFrontFace = NULL;
371 | PFNGLGENBUFFERSPROC glad_glGenBuffers = NULL;
372 | PFNGLGENFRAMEBUFFERSPROC glad_glGenFramebuffers = NULL;
373 | PFNGLGENQUERIESPROC glad_glGenQueries = NULL;
374 | PFNGLGENRENDERBUFFERSPROC glad_glGenRenderbuffers = NULL;
375 | PFNGLGENSAMPLERSPROC glad_glGenSamplers = NULL;
376 | PFNGLGENTEXTURESPROC glad_glGenTextures = NULL;
377 | PFNGLGENVERTEXARRAYSPROC glad_glGenVertexArrays = NULL;
378 | PFNGLGENERATEMIPMAPPROC glad_glGenerateMipmap = NULL;
379 | PFNGLGETACTIVEATTRIBPROC glad_glGetActiveAttrib = NULL;
380 | PFNGLGETACTIVEUNIFORMPROC glad_glGetActiveUniform = NULL;
381 | PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC glad_glGetActiveUniformBlockName = NULL;
382 | PFNGLGETACTIVEUNIFORMBLOCKIVPROC glad_glGetActiveUniformBlockiv = NULL;
383 | PFNGLGETACTIVEUNIFORMNAMEPROC glad_glGetActiveUniformName = NULL;
384 | PFNGLGETACTIVEUNIFORMSIVPROC glad_glGetActiveUniformsiv = NULL;
385 | PFNGLGETATTACHEDSHADERSPROC glad_glGetAttachedShaders = NULL;
386 | PFNGLGETATTRIBLOCATIONPROC glad_glGetAttribLocation = NULL;
387 | PFNGLGETBOOLEANI_VPROC glad_glGetBooleani_v = NULL;
388 | PFNGLGETBOOLEANVPROC glad_glGetBooleanv = NULL;
389 | PFNGLGETBUFFERPARAMETERI64VPROC glad_glGetBufferParameteri64v = NULL;
390 | PFNGLGETBUFFERPARAMETERIVPROC glad_glGetBufferParameteriv = NULL;
391 | PFNGLGETBUFFERPOINTERVPROC glad_glGetBufferPointerv = NULL;
392 | PFNGLGETBUFFERSUBDATAPROC glad_glGetBufferSubData = NULL;
393 | PFNGLGETCOMPRESSEDTEXIMAGEPROC glad_glGetCompressedTexImage = NULL;
394 | PFNGLGETDOUBLEVPROC glad_glGetDoublev = NULL;
395 | PFNGLGETERRORPROC glad_glGetError = NULL;
396 | PFNGLGETFLOATVPROC glad_glGetFloatv = NULL;
397 | PFNGLGETFRAGDATAINDEXPROC glad_glGetFragDataIndex = NULL;
398 | PFNGLGETFRAGDATALOCATIONPROC glad_glGetFragDataLocation = NULL;
399 | PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetFramebufferAttachmentParameteriv = NULL;
400 | PFNGLGETINTEGER64I_VPROC glad_glGetInteger64i_v = NULL;
401 | PFNGLGETINTEGER64VPROC glad_glGetInteger64v = NULL;
402 | PFNGLGETINTEGERI_VPROC glad_glGetIntegeri_v = NULL;
403 | PFNGLGETINTEGERVPROC glad_glGetIntegerv = NULL;
404 | PFNGLGETMULTISAMPLEFVPROC glad_glGetMultisamplefv = NULL;
405 | PFNGLGETPROGRAMINFOLOGPROC glad_glGetProgramInfoLog = NULL;
406 | PFNGLGETPROGRAMIVPROC glad_glGetProgramiv = NULL;
407 | PFNGLGETQUERYOBJECTI64VPROC glad_glGetQueryObjecti64v = NULL;
408 | PFNGLGETQUERYOBJECTIVPROC glad_glGetQueryObjectiv = NULL;
409 | PFNGLGETQUERYOBJECTUI64VPROC glad_glGetQueryObjectui64v = NULL;
410 | PFNGLGETQUERYOBJECTUIVPROC glad_glGetQueryObjectuiv = NULL;
411 | PFNGLGETQUERYIVPROC glad_glGetQueryiv = NULL;
412 | PFNGLGETRENDERBUFFERPARAMETERIVPROC glad_glGetRenderbufferParameteriv = NULL;
413 | PFNGLGETSAMPLERPARAMETERIIVPROC glad_glGetSamplerParameterIiv = NULL;
414 | PFNGLGETSAMPLERPARAMETERIUIVPROC glad_glGetSamplerParameterIuiv = NULL;
415 | PFNGLGETSAMPLERPARAMETERFVPROC glad_glGetSamplerParameterfv = NULL;
416 | PFNGLGETSAMPLERPARAMETERIVPROC glad_glGetSamplerParameteriv = NULL;
417 | PFNGLGETSHADERINFOLOGPROC glad_glGetShaderInfoLog = NULL;
418 | PFNGLGETSHADERSOURCEPROC glad_glGetShaderSource = NULL;
419 | PFNGLGETSHADERIVPROC glad_glGetShaderiv = NULL;
420 | PFNGLGETSTRINGPROC glad_glGetString = NULL;
421 | PFNGLGETSTRINGIPROC glad_glGetStringi = NULL;
422 | PFNGLGETSYNCIVPROC glad_glGetSynciv = NULL;
423 | PFNGLGETTEXIMAGEPROC glad_glGetTexImage = NULL;
424 | PFNGLGETTEXLEVELPARAMETERFVPROC glad_glGetTexLevelParameterfv = NULL;
425 | PFNGLGETTEXLEVELPARAMETERIVPROC glad_glGetTexLevelParameteriv = NULL;
426 | PFNGLGETTEXPARAMETERIIVPROC glad_glGetTexParameterIiv = NULL;
427 | PFNGLGETTEXPARAMETERIUIVPROC glad_glGetTexParameterIuiv = NULL;
428 | PFNGLGETTEXPARAMETERFVPROC glad_glGetTexParameterfv = NULL;
429 | PFNGLGETTEXPARAMETERIVPROC glad_glGetTexParameteriv = NULL;
430 | PFNGLGETTRANSFORMFEEDBACKVARYINGPROC glad_glGetTransformFeedbackVarying = NULL;
431 | PFNGLGETUNIFORMBLOCKINDEXPROC glad_glGetUniformBlockIndex = NULL;
432 | PFNGLGETUNIFORMINDICESPROC glad_glGetUniformIndices = NULL;
433 | PFNGLGETUNIFORMLOCATIONPROC glad_glGetUniformLocation = NULL;
434 | PFNGLGETUNIFORMFVPROC glad_glGetUniformfv = NULL;
435 | PFNGLGETUNIFORMIVPROC glad_glGetUniformiv = NULL;
436 | PFNGLGETUNIFORMUIVPROC glad_glGetUniformuiv = NULL;
437 | PFNGLGETVERTEXATTRIBIIVPROC glad_glGetVertexAttribIiv = NULL;
438 | PFNGLGETVERTEXATTRIBIUIVPROC glad_glGetVertexAttribIuiv = NULL;
439 | PFNGLGETVERTEXATTRIBPOINTERVPROC glad_glGetVertexAttribPointerv = NULL;
440 | PFNGLGETVERTEXATTRIBDVPROC glad_glGetVertexAttribdv = NULL;
441 | PFNGLGETVERTEXATTRIBFVPROC glad_glGetVertexAttribfv = NULL;
442 | PFNGLGETVERTEXATTRIBIVPROC glad_glGetVertexAttribiv = NULL;
443 | PFNGLHINTPROC glad_glHint = NULL;
444 | PFNGLISBUFFERPROC glad_glIsBuffer = NULL;
445 | PFNGLISENABLEDPROC glad_glIsEnabled = NULL;
446 | PFNGLISENABLEDIPROC glad_glIsEnabledi = NULL;
447 | PFNGLISFRAMEBUFFERPROC glad_glIsFramebuffer = NULL;
448 | PFNGLISPROGRAMPROC glad_glIsProgram = NULL;
449 | PFNGLISQUERYPROC glad_glIsQuery = NULL;
450 | PFNGLISRENDERBUFFERPROC glad_glIsRenderbuffer = NULL;
451 | PFNGLISSAMPLERPROC glad_glIsSampler = NULL;
452 | PFNGLISSHADERPROC glad_glIsShader = NULL;
453 | PFNGLISSYNCPROC glad_glIsSync = NULL;
454 | PFNGLISTEXTUREPROC glad_glIsTexture = NULL;
455 | PFNGLISVERTEXARRAYPROC glad_glIsVertexArray = NULL;
456 | PFNGLLINEWIDTHPROC glad_glLineWidth = NULL;
457 | PFNGLLINKPROGRAMPROC glad_glLinkProgram = NULL;
458 | PFNGLLOGICOPPROC glad_glLogicOp = NULL;
459 | PFNGLMAPBUFFERPROC glad_glMapBuffer = NULL;
460 | PFNGLMAPBUFFERRANGEPROC glad_glMapBufferRange = NULL;
461 | PFNGLMULTIDRAWARRAYSPROC glad_glMultiDrawArrays = NULL;
462 | PFNGLMULTIDRAWELEMENTSPROC glad_glMultiDrawElements = NULL;
463 | PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC glad_glMultiDrawElementsBaseVertex = NULL;
464 | PFNGLMULTITEXCOORDP1UIPROC glad_glMultiTexCoordP1ui = NULL;
465 | PFNGLMULTITEXCOORDP1UIVPROC glad_glMultiTexCoordP1uiv = NULL;
466 | PFNGLMULTITEXCOORDP2UIPROC glad_glMultiTexCoordP2ui = NULL;
467 | PFNGLMULTITEXCOORDP2UIVPROC glad_glMultiTexCoordP2uiv = NULL;
468 | PFNGLMULTITEXCOORDP3UIPROC glad_glMultiTexCoordP3ui = NULL;
469 | PFNGLMULTITEXCOORDP3UIVPROC glad_glMultiTexCoordP3uiv = NULL;
470 | PFNGLMULTITEXCOORDP4UIPROC glad_glMultiTexCoordP4ui = NULL;
471 | PFNGLMULTITEXCOORDP4UIVPROC glad_glMultiTexCoordP4uiv = NULL;
472 | PFNGLNORMALP3UIPROC glad_glNormalP3ui = NULL;
473 | PFNGLNORMALP3UIVPROC glad_glNormalP3uiv = NULL;
474 | PFNGLPIXELSTOREFPROC glad_glPixelStoref = NULL;
475 | PFNGLPIXELSTOREIPROC glad_glPixelStorei = NULL;
476 | PFNGLPOINTPARAMETERFPROC glad_glPointParameterf = NULL;
477 | PFNGLPOINTPARAMETERFVPROC glad_glPointParameterfv = NULL;
478 | PFNGLPOINTPARAMETERIPROC glad_glPointParameteri = NULL;
479 | PFNGLPOINTPARAMETERIVPROC glad_glPointParameteriv = NULL;
480 | PFNGLPOINTSIZEPROC glad_glPointSize = NULL;
481 | PFNGLPOLYGONMODEPROC glad_glPolygonMode = NULL;
482 | PFNGLPOLYGONOFFSETPROC glad_glPolygonOffset = NULL;
483 | PFNGLPRIMITIVERESTARTINDEXPROC glad_glPrimitiveRestartIndex = NULL;
484 | PFNGLPROVOKINGVERTEXPROC glad_glProvokingVertex = NULL;
485 | PFNGLQUERYCOUNTERPROC glad_glQueryCounter = NULL;
486 | PFNGLREADBUFFERPROC glad_glReadBuffer = NULL;
487 | PFNGLREADPIXELSPROC glad_glReadPixels = NULL;
488 | PFNGLRENDERBUFFERSTORAGEPROC glad_glRenderbufferStorage = NULL;
489 | PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC glad_glRenderbufferStorageMultisample = NULL;
490 | PFNGLSAMPLECOVERAGEPROC glad_glSampleCoverage = NULL;
491 | PFNGLSAMPLEMASKIPROC glad_glSampleMaski = NULL;
492 | PFNGLSAMPLERPARAMETERIIVPROC glad_glSamplerParameterIiv = NULL;
493 | PFNGLSAMPLERPARAMETERIUIVPROC glad_glSamplerParameterIuiv = NULL;
494 | PFNGLSAMPLERPARAMETERFPROC glad_glSamplerParameterf = NULL;
495 | PFNGLSAMPLERPARAMETERFVPROC glad_glSamplerParameterfv = NULL;
496 | PFNGLSAMPLERPARAMETERIPROC glad_glSamplerParameteri = NULL;
497 | PFNGLSAMPLERPARAMETERIVPROC glad_glSamplerParameteriv = NULL;
498 | PFNGLSCISSORPROC glad_glScissor = NULL;
499 | PFNGLSECONDARYCOLORP3UIPROC glad_glSecondaryColorP3ui = NULL;
500 | PFNGLSECONDARYCOLORP3UIVPROC glad_glSecondaryColorP3uiv = NULL;
501 | PFNGLSHADERSOURCEPROC glad_glShaderSource = NULL;
502 | PFNGLSTENCILFUNCPROC glad_glStencilFunc = NULL;
503 | PFNGLSTENCILFUNCSEPARATEPROC glad_glStencilFuncSeparate = NULL;
504 | PFNGLSTENCILMASKPROC glad_glStencilMask = NULL;
505 | PFNGLSTENCILMASKSEPARATEPROC glad_glStencilMaskSeparate = NULL;
506 | PFNGLSTENCILOPPROC glad_glStencilOp = NULL;
507 | PFNGLSTENCILOPSEPARATEPROC glad_glStencilOpSeparate = NULL;
508 | PFNGLTEXBUFFERPROC glad_glTexBuffer = NULL;
509 | PFNGLTEXCOORDP1UIPROC glad_glTexCoordP1ui = NULL;
510 | PFNGLTEXCOORDP1UIVPROC glad_glTexCoordP1uiv = NULL;
511 | PFNGLTEXCOORDP2UIPROC glad_glTexCoordP2ui = NULL;
512 | PFNGLTEXCOORDP2UIVPROC glad_glTexCoordP2uiv = NULL;
513 | PFNGLTEXCOORDP3UIPROC glad_glTexCoordP3ui = NULL;
514 | PFNGLTEXCOORDP3UIVPROC glad_glTexCoordP3uiv = NULL;
515 | PFNGLTEXCOORDP4UIPROC glad_glTexCoordP4ui = NULL;
516 | PFNGLTEXCOORDP4UIVPROC glad_glTexCoordP4uiv = NULL;
517 | PFNGLTEXIMAGE1DPROC glad_glTexImage1D = NULL;
518 | PFNGLTEXIMAGE2DPROC glad_glTexImage2D = NULL;
519 | PFNGLTEXIMAGE2DMULTISAMPLEPROC glad_glTexImage2DMultisample = NULL;
520 | PFNGLTEXIMAGE3DPROC glad_glTexImage3D = NULL;
521 | PFNGLTEXIMAGE3DMULTISAMPLEPROC glad_glTexImage3DMultisample = NULL;
522 | PFNGLTEXPARAMETERIIVPROC glad_glTexParameterIiv = NULL;
523 | PFNGLTEXPARAMETERIUIVPROC glad_glTexParameterIuiv = NULL;
524 | PFNGLTEXPARAMETERFPROC glad_glTexParameterf = NULL;
525 | PFNGLTEXPARAMETERFVPROC glad_glTexParameterfv = NULL;
526 | PFNGLTEXPARAMETERIPROC glad_glTexParameteri = NULL;
527 | PFNGLTEXPARAMETERIVPROC glad_glTexParameteriv = NULL;
528 | PFNGLTEXSUBIMAGE1DPROC glad_glTexSubImage1D = NULL;
529 | PFNGLTEXSUBIMAGE2DPROC glad_glTexSubImage2D = NULL;
530 | PFNGLTEXSUBIMAGE3DPROC glad_glTexSubImage3D = NULL;
531 | PFNGLTRANSFORMFEEDBACKVARYINGSPROC glad_glTransformFeedbackVaryings = NULL;
532 | PFNGLUNIFORM1FPROC glad_glUniform1f = NULL;
533 | PFNGLUNIFORM1FVPROC glad_glUniform1fv = NULL;
534 | PFNGLUNIFORM1IPROC glad_glUniform1i = NULL;
535 | PFNGLUNIFORM1IVPROC glad_glUniform1iv = NULL;
536 | PFNGLUNIFORM1UIPROC glad_glUniform1ui = NULL;
537 | PFNGLUNIFORM1UIVPROC glad_glUniform1uiv = NULL;
538 | PFNGLUNIFORM2FPROC glad_glUniform2f = NULL;
539 | PFNGLUNIFORM2FVPROC glad_glUniform2fv = NULL;
540 | PFNGLUNIFORM2IPROC glad_glUniform2i = NULL;
541 | PFNGLUNIFORM2IVPROC glad_glUniform2iv = NULL;
542 | PFNGLUNIFORM2UIPROC glad_glUniform2ui = NULL;
543 | PFNGLUNIFORM2UIVPROC glad_glUniform2uiv = NULL;
544 | PFNGLUNIFORM3FPROC glad_glUniform3f = NULL;
545 | PFNGLUNIFORM3FVPROC glad_glUniform3fv = NULL;
546 | PFNGLUNIFORM3IPROC glad_glUniform3i = NULL;
547 | PFNGLUNIFORM3IVPROC glad_glUniform3iv = NULL;
548 | PFNGLUNIFORM3UIPROC glad_glUniform3ui = NULL;
549 | PFNGLUNIFORM3UIVPROC glad_glUniform3uiv = NULL;
550 | PFNGLUNIFORM4FPROC glad_glUniform4f = NULL;
551 | PFNGLUNIFORM4FVPROC glad_glUniform4fv = NULL;
552 | PFNGLUNIFORM4IPROC glad_glUniform4i = NULL;
553 | PFNGLUNIFORM4IVPROC glad_glUniform4iv = NULL;
554 | PFNGLUNIFORM4UIPROC glad_glUniform4ui = NULL;
555 | PFNGLUNIFORM4UIVPROC glad_glUniform4uiv = NULL;
556 | PFNGLUNIFORMBLOCKBINDINGPROC glad_glUniformBlockBinding = NULL;
557 | PFNGLUNIFORMMATRIX2FVPROC glad_glUniformMatrix2fv = NULL;
558 | PFNGLUNIFORMMATRIX2X3FVPROC glad_glUniformMatrix2x3fv = NULL;
559 | PFNGLUNIFORMMATRIX2X4FVPROC glad_glUniformMatrix2x4fv = NULL;
560 | PFNGLUNIFORMMATRIX3FVPROC glad_glUniformMatrix3fv = NULL;
561 | PFNGLUNIFORMMATRIX3X2FVPROC glad_glUniformMatrix3x2fv = NULL;
562 | PFNGLUNIFORMMATRIX3X4FVPROC glad_glUniformMatrix3x4fv = NULL;
563 | PFNGLUNIFORMMATRIX4FVPROC glad_glUniformMatrix4fv = NULL;
564 | PFNGLUNIFORMMATRIX4X2FVPROC glad_glUniformMatrix4x2fv = NULL;
565 | PFNGLUNIFORMMATRIX4X3FVPROC glad_glUniformMatrix4x3fv = NULL;
566 | PFNGLUNMAPBUFFERPROC glad_glUnmapBuffer = NULL;
567 | PFNGLUSEPROGRAMPROC glad_glUseProgram = NULL;
568 | PFNGLVALIDATEPROGRAMPROC glad_glValidateProgram = NULL;
569 | PFNGLVERTEXATTRIB1DPROC glad_glVertexAttrib1d = NULL;
570 | PFNGLVERTEXATTRIB1DVPROC glad_glVertexAttrib1dv = NULL;
571 | PFNGLVERTEXATTRIB1FPROC glad_glVertexAttrib1f = NULL;
572 | PFNGLVERTEXATTRIB1FVPROC glad_glVertexAttrib1fv = NULL;
573 | PFNGLVERTEXATTRIB1SPROC glad_glVertexAttrib1s = NULL;
574 | PFNGLVERTEXATTRIB1SVPROC glad_glVertexAttrib1sv = NULL;
575 | PFNGLVERTEXATTRIB2DPROC glad_glVertexAttrib2d = NULL;
576 | PFNGLVERTEXATTRIB2DVPROC glad_glVertexAttrib2dv = NULL;
577 | PFNGLVERTEXATTRIB2FPROC glad_glVertexAttrib2f = NULL;
578 | PFNGLVERTEXATTRIB2FVPROC glad_glVertexAttrib2fv = NULL;
579 | PFNGLVERTEXATTRIB2SPROC glad_glVertexAttrib2s = NULL;
580 | PFNGLVERTEXATTRIB2SVPROC glad_glVertexAttrib2sv = NULL;
581 | PFNGLVERTEXATTRIB3DPROC glad_glVertexAttrib3d = NULL;
582 | PFNGLVERTEXATTRIB3DVPROC glad_glVertexAttrib3dv = NULL;
583 | PFNGLVERTEXATTRIB3FPROC glad_glVertexAttrib3f = NULL;
584 | PFNGLVERTEXATTRIB3FVPROC glad_glVertexAttrib3fv = NULL;
585 | PFNGLVERTEXATTRIB3SPROC glad_glVertexAttrib3s = NULL;
586 | PFNGLVERTEXATTRIB3SVPROC glad_glVertexAttrib3sv = NULL;
587 | PFNGLVERTEXATTRIB4NBVPROC glad_glVertexAttrib4Nbv = NULL;
588 | PFNGLVERTEXATTRIB4NIVPROC glad_glVertexAttrib4Niv = NULL;
589 | PFNGLVERTEXATTRIB4NSVPROC glad_glVertexAttrib4Nsv = NULL;
590 | PFNGLVERTEXATTRIB4NUBPROC glad_glVertexAttrib4Nub = NULL;
591 | PFNGLVERTEXATTRIB4NUBVPROC glad_glVertexAttrib4Nubv = NULL;
592 | PFNGLVERTEXATTRIB4NUIVPROC glad_glVertexAttrib4Nuiv = NULL;
593 | PFNGLVERTEXATTRIB4NUSVPROC glad_glVertexAttrib4Nusv = NULL;
594 | PFNGLVERTEXATTRIB4BVPROC glad_glVertexAttrib4bv = NULL;
595 | PFNGLVERTEXATTRIB4DPROC glad_glVertexAttrib4d = NULL;
596 | PFNGLVERTEXATTRIB4DVPROC glad_glVertexAttrib4dv = NULL;
597 | PFNGLVERTEXATTRIB4FPROC glad_glVertexAttrib4f = NULL;
598 | PFNGLVERTEXATTRIB4FVPROC glad_glVertexAttrib4fv = NULL;
599 | PFNGLVERTEXATTRIB4IVPROC glad_glVertexAttrib4iv = NULL;
600 | PFNGLVERTEXATTRIB4SPROC glad_glVertexAttrib4s = NULL;
601 | PFNGLVERTEXATTRIB4SVPROC glad_glVertexAttrib4sv = NULL;
602 | PFNGLVERTEXATTRIB4UBVPROC glad_glVertexAttrib4ubv = NULL;
603 | PFNGLVERTEXATTRIB4UIVPROC glad_glVertexAttrib4uiv = NULL;
604 | PFNGLVERTEXATTRIB4USVPROC glad_glVertexAttrib4usv = NULL;
605 | PFNGLVERTEXATTRIBDIVISORPROC glad_glVertexAttribDivisor = NULL;
606 | PFNGLVERTEXATTRIBI1IPROC glad_glVertexAttribI1i = NULL;
607 | PFNGLVERTEXATTRIBI1IVPROC glad_glVertexAttribI1iv = NULL;
608 | PFNGLVERTEXATTRIBI1UIPROC glad_glVertexAttribI1ui = NULL;
609 | PFNGLVERTEXATTRIBI1UIVPROC glad_glVertexAttribI1uiv = NULL;
610 | PFNGLVERTEXATTRIBI2IPROC glad_glVertexAttribI2i = NULL;
611 | PFNGLVERTEXATTRIBI2IVPROC glad_glVertexAttribI2iv = NULL;
612 | PFNGLVERTEXATTRIBI2UIPROC glad_glVertexAttribI2ui = NULL;
613 | PFNGLVERTEXATTRIBI2UIVPROC glad_glVertexAttribI2uiv = NULL;
614 | PFNGLVERTEXATTRIBI3IPROC glad_glVertexAttribI3i = NULL;
615 | PFNGLVERTEXATTRIBI3IVPROC glad_glVertexAttribI3iv = NULL;
616 | PFNGLVERTEXATTRIBI3UIPROC glad_glVertexAttribI3ui = NULL;
617 | PFNGLVERTEXATTRIBI3UIVPROC glad_glVertexAttribI3uiv = NULL;
618 | PFNGLVERTEXATTRIBI4BVPROC glad_glVertexAttribI4bv = NULL;
619 | PFNGLVERTEXATTRIBI4IPROC glad_glVertexAttribI4i = NULL;
620 | PFNGLVERTEXATTRIBI4IVPROC glad_glVertexAttribI4iv = NULL;
621 | PFNGLVERTEXATTRIBI4SVPROC glad_glVertexAttribI4sv = NULL;
622 | PFNGLVERTEXATTRIBI4UBVPROC glad_glVertexAttribI4ubv = NULL;
623 | PFNGLVERTEXATTRIBI4UIPROC glad_glVertexAttribI4ui = NULL;
624 | PFNGLVERTEXATTRIBI4UIVPROC glad_glVertexAttribI4uiv = NULL;
625 | PFNGLVERTEXATTRIBI4USVPROC glad_glVertexAttribI4usv = NULL;
626 | PFNGLVERTEXATTRIBIPOINTERPROC glad_glVertexAttribIPointer = NULL;
627 | PFNGLVERTEXATTRIBP1UIPROC glad_glVertexAttribP1ui = NULL;
628 | PFNGLVERTEXATTRIBP1UIVPROC glad_glVertexAttribP1uiv = NULL;
629 | PFNGLVERTEXATTRIBP2UIPROC glad_glVertexAttribP2ui = NULL;
630 | PFNGLVERTEXATTRIBP2UIVPROC glad_glVertexAttribP2uiv = NULL;
631 | PFNGLVERTEXATTRIBP3UIPROC glad_glVertexAttribP3ui = NULL;
632 | PFNGLVERTEXATTRIBP3UIVPROC glad_glVertexAttribP3uiv = NULL;
633 | PFNGLVERTEXATTRIBP4UIPROC glad_glVertexAttribP4ui = NULL;
634 | PFNGLVERTEXATTRIBP4UIVPROC glad_glVertexAttribP4uiv = NULL;
635 | PFNGLVERTEXATTRIBPOINTERPROC glad_glVertexAttribPointer = NULL;
636 | PFNGLVERTEXP2UIPROC glad_glVertexP2ui = NULL;
637 | PFNGLVERTEXP2UIVPROC glad_glVertexP2uiv = NULL;
638 | PFNGLVERTEXP3UIPROC glad_glVertexP3ui = NULL;
639 | PFNGLVERTEXP3UIVPROC glad_glVertexP3uiv = NULL;
640 | PFNGLVERTEXP4UIPROC glad_glVertexP4ui = NULL;
641 | PFNGLVERTEXP4UIVPROC glad_glVertexP4uiv = NULL;
642 | PFNGLVIEWPORTPROC glad_glViewport = NULL;
643 | PFNGLWAITSYNCPROC glad_glWaitSync = NULL;
644 | static void load_GL_VERSION_1_0(GLADloadproc load) {
645 | if(!GLAD_GL_VERSION_1_0) return;
646 | glad_glCullFace = (PFNGLCULLFACEPROC)load("glCullFace");
647 | glad_glFrontFace = (PFNGLFRONTFACEPROC)load("glFrontFace");
648 | glad_glHint = (PFNGLHINTPROC)load("glHint");
649 | glad_glLineWidth = (PFNGLLINEWIDTHPROC)load("glLineWidth");
650 | glad_glPointSize = (PFNGLPOINTSIZEPROC)load("glPointSize");
651 | glad_glPolygonMode = (PFNGLPOLYGONMODEPROC)load("glPolygonMode");
652 | glad_glScissor = (PFNGLSCISSORPROC)load("glScissor");
653 | glad_glTexParameterf = (PFNGLTEXPARAMETERFPROC)load("glTexParameterf");
654 | glad_glTexParameterfv = (PFNGLTEXPARAMETERFVPROC)load("glTexParameterfv");
655 | glad_glTexParameteri = (PFNGLTEXPARAMETERIPROC)load("glTexParameteri");
656 | glad_glTexParameteriv = (PFNGLTEXPARAMETERIVPROC)load("glTexParameteriv");
657 | glad_glTexImage1D = (PFNGLTEXIMAGE1DPROC)load("glTexImage1D");
658 | glad_glTexImage2D = (PFNGLTEXIMAGE2DPROC)load("glTexImage2D");
659 | glad_glDrawBuffer = (PFNGLDRAWBUFFERPROC)load("glDrawBuffer");
660 | glad_glClear = (PFNGLCLEARPROC)load("glClear");
661 | glad_glClearColor = (PFNGLCLEARCOLORPROC)load("glClearColor");
662 | glad_glClearStencil = (PFNGLCLEARSTENCILPROC)load("glClearStencil");
663 | glad_glClearDepth = (PFNGLCLEARDEPTHPROC)load("glClearDepth");
664 | glad_glStencilMask = (PFNGLSTENCILMASKPROC)load("glStencilMask");
665 | glad_glColorMask = (PFNGLCOLORMASKPROC)load("glColorMask");
666 | glad_glDepthMask = (PFNGLDEPTHMASKPROC)load("glDepthMask");
667 | glad_glDisable = (PFNGLDISABLEPROC)load("glDisable");
668 | glad_glEnable = (PFNGLENABLEPROC)load("glEnable");
669 | glad_glFinish = (PFNGLFINISHPROC)load("glFinish");
670 | glad_glFlush = (PFNGLFLUSHPROC)load("glFlush");
671 | glad_glBlendFunc = (PFNGLBLENDFUNCPROC)load("glBlendFunc");
672 | glad_glLogicOp = (PFNGLLOGICOPPROC)load("glLogicOp");
673 | glad_glStencilFunc = (PFNGLSTENCILFUNCPROC)load("glStencilFunc");
674 | glad_glStencilOp = (PFNGLSTENCILOPPROC)load("glStencilOp");
675 | glad_glDepthFunc = (PFNGLDEPTHFUNCPROC)load("glDepthFunc");
676 | glad_glPixelStoref = (PFNGLPIXELSTOREFPROC)load("glPixelStoref");
677 | glad_glPixelStorei = (PFNGLPIXELSTOREIPROC)load("glPixelStorei");
678 | glad_glReadBuffer = (PFNGLREADBUFFERPROC)load("glReadBuffer");
679 | glad_glReadPixels = (PFNGLREADPIXELSPROC)load("glReadPixels");
680 | glad_glGetBooleanv = (PFNGLGETBOOLEANVPROC)load("glGetBooleanv");
681 | glad_glGetDoublev = (PFNGLGETDOUBLEVPROC)load("glGetDoublev");
682 | glad_glGetError = (PFNGLGETERRORPROC)load("glGetError");
683 | glad_glGetFloatv = (PFNGLGETFLOATVPROC)load("glGetFloatv");
684 | glad_glGetIntegerv = (PFNGLGETINTEGERVPROC)load("glGetIntegerv");
685 | glad_glGetString = (PFNGLGETSTRINGPROC)load("glGetString");
686 | glad_glGetTexImage = (PFNGLGETTEXIMAGEPROC)load("glGetTexImage");
687 | glad_glGetTexParameterfv = (PFNGLGETTEXPARAMETERFVPROC)load("glGetTexParameterfv");
688 | glad_glGetTexParameteriv = (PFNGLGETTEXPARAMETERIVPROC)load("glGetTexParameteriv");
689 | glad_glGetTexLevelParameterfv = (PFNGLGETTEXLEVELPARAMETERFVPROC)load("glGetTexLevelParameterfv");
690 | glad_glGetTexLevelParameteriv = (PFNGLGETTEXLEVELPARAMETERIVPROC)load("glGetTexLevelParameteriv");
691 | glad_glIsEnabled = (PFNGLISENABLEDPROC)load("glIsEnabled");
692 | glad_glDepthRange = (PFNGLDEPTHRANGEPROC)load("glDepthRange");
693 | glad_glViewport = (PFNGLVIEWPORTPROC)load("glViewport");
694 | }
695 | static void load_GL_VERSION_1_1(GLADloadproc load) {
696 | if(!GLAD_GL_VERSION_1_1) return;
697 | glad_glDrawArrays = (PFNGLDRAWARRAYSPROC)load("glDrawArrays");
698 | glad_glDrawElements = (PFNGLDRAWELEMENTSPROC)load("glDrawElements");
699 | glad_glPolygonOffset = (PFNGLPOLYGONOFFSETPROC)load("glPolygonOffset");
700 | glad_glCopyTexImage1D = (PFNGLCOPYTEXIMAGE1DPROC)load("glCopyTexImage1D");
701 | glad_glCopyTexImage2D = (PFNGLCOPYTEXIMAGE2DPROC)load("glCopyTexImage2D");
702 | glad_glCopyTexSubImage1D = (PFNGLCOPYTEXSUBIMAGE1DPROC)load("glCopyTexSubImage1D");
703 | glad_glCopyTexSubImage2D = (PFNGLCOPYTEXSUBIMAGE2DPROC)load("glCopyTexSubImage2D");
704 | glad_glTexSubImage1D = (PFNGLTEXSUBIMAGE1DPROC)load("glTexSubImage1D");
705 | glad_glTexSubImage2D = (PFNGLTEXSUBIMAGE2DPROC)load("glTexSubImage2D");
706 | glad_glBindTexture = (PFNGLBINDTEXTUREPROC)load("glBindTexture");
707 | glad_glDeleteTextures = (PFNGLDELETETEXTURESPROC)load("glDeleteTextures");
708 | glad_glGenTextures = (PFNGLGENTEXTURESPROC)load("glGenTextures");
709 | glad_glIsTexture = (PFNGLISTEXTUREPROC)load("glIsTexture");
710 | }
711 | static void load_GL_VERSION_1_2(GLADloadproc load) {
712 | if(!GLAD_GL_VERSION_1_2) return;
713 | glad_glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC)load("glDrawRangeElements");
714 | glad_glTexImage3D = (PFNGLTEXIMAGE3DPROC)load("glTexImage3D");
715 | glad_glTexSubImage3D = (PFNGLTEXSUBIMAGE3DPROC)load("glTexSubImage3D");
716 | glad_glCopyTexSubImage3D = (PFNGLCOPYTEXSUBIMAGE3DPROC)load("glCopyTexSubImage3D");
717 | }
718 | static void load_GL_VERSION_1_3(GLADloadproc load) {
719 | if(!GLAD_GL_VERSION_1_3) return;
720 | glad_glActiveTexture = (PFNGLACTIVETEXTUREPROC)load("glActiveTexture");
721 | glad_glSampleCoverage = (PFNGLSAMPLECOVERAGEPROC)load("glSampleCoverage");
722 | glad_glCompressedTexImage3D = (PFNGLCOMPRESSEDTEXIMAGE3DPROC)load("glCompressedTexImage3D");
723 | glad_glCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC)load("glCompressedTexImage2D");
724 | glad_glCompressedTexImage1D = (PFNGLCOMPRESSEDTEXIMAGE1DPROC)load("glCompressedTexImage1D");
725 | glad_glCompressedTexSubImage3D = (PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC)load("glCompressedTexSubImage3D");
726 | glad_glCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)load("glCompressedTexSubImage2D");
727 | glad_glCompressedTexSubImage1D = (PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC)load("glCompressedTexSubImage1D");
728 | glad_glGetCompressedTexImage = (PFNGLGETCOMPRESSEDTEXIMAGEPROC)load("glGetCompressedTexImage");
729 | }
730 | static void load_GL_VERSION_1_4(GLADloadproc load) {
731 | if(!GLAD_GL_VERSION_1_4) return;
732 | glad_glBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC)load("glBlendFuncSeparate");
733 | glad_glMultiDrawArrays = (PFNGLMULTIDRAWARRAYSPROC)load("glMultiDrawArrays");
734 | glad_glMultiDrawElements = (PFNGLMULTIDRAWELEMENTSPROC)load("glMultiDrawElements");
735 | glad_glPointParameterf = (PFNGLPOINTPARAMETERFPROC)load("glPointParameterf");
736 | glad_glPointParameterfv = (PFNGLPOINTPARAMETERFVPROC)load("glPointParameterfv");
737 | glad_glPointParameteri = (PFNGLPOINTPARAMETERIPROC)load("glPointParameteri");
738 | glad_glPointParameteriv = (PFNGLPOINTPARAMETERIVPROC)load("glPointParameteriv");
739 | glad_glBlendColor = (PFNGLBLENDCOLORPROC)load("glBlendColor");
740 | glad_glBlendEquation = (PFNGLBLENDEQUATIONPROC)load("glBlendEquation");
741 | }
742 | static void load_GL_VERSION_1_5(GLADloadproc load) {
743 | if(!GLAD_GL_VERSION_1_5) return;
744 | glad_glGenQueries = (PFNGLGENQUERIESPROC)load("glGenQueries");
745 | glad_glDeleteQueries = (PFNGLDELETEQUERIESPROC)load("glDeleteQueries");
746 | glad_glIsQuery = (PFNGLISQUERYPROC)load("glIsQuery");
747 | glad_glBeginQuery = (PFNGLBEGINQUERYPROC)load("glBeginQuery");
748 | glad_glEndQuery = (PFNGLENDQUERYPROC)load("glEndQuery");
749 | glad_glGetQueryiv = (PFNGLGETQUERYIVPROC)load("glGetQueryiv");
750 | glad_glGetQueryObjectiv = (PFNGLGETQUERYOBJECTIVPROC)load("glGetQueryObjectiv");
751 | glad_glGetQueryObjectuiv = (PFNGLGETQUERYOBJECTUIVPROC)load("glGetQueryObjectuiv");
752 | glad_glBindBuffer = (PFNGLBINDBUFFERPROC)load("glBindBuffer");
753 | glad_glDeleteBuffers = (PFNGLDELETEBUFFERSPROC)load("glDeleteBuffers");
754 | glad_glGenBuffers = (PFNGLGENBUFFERSPROC)load("glGenBuffers");
755 | glad_glIsBuffer = (PFNGLISBUFFERPROC)load("glIsBuffer");
756 | glad_glBufferData = (PFNGLBUFFERDATAPROC)load("glBufferData");
757 | glad_glBufferSubData = (PFNGLBUFFERSUBDATAPROC)load("glBufferSubData");
758 | glad_glGetBufferSubData = (PFNGLGETBUFFERSUBDATAPROC)load("glGetBufferSubData");
759 | glad_glMapBuffer = (PFNGLMAPBUFFERPROC)load("glMapBuffer");
760 | glad_glUnmapBuffer = (PFNGLUNMAPBUFFERPROC)load("glUnmapBuffer");
761 | glad_glGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC)load("glGetBufferParameteriv");
762 | glad_glGetBufferPointerv = (PFNGLGETBUFFERPOINTERVPROC)load("glGetBufferPointerv");
763 | }
764 | static void load_GL_VERSION_2_0(GLADloadproc load) {
765 | if(!GLAD_GL_VERSION_2_0) return;
766 | glad_glBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC)load("glBlendEquationSeparate");
767 | glad_glDrawBuffers = (PFNGLDRAWBUFFERSPROC)load("glDrawBuffers");
768 | glad_glStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC)load("glStencilOpSeparate");
769 | glad_glStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC)load("glStencilFuncSeparate");
770 | glad_glStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC)load("glStencilMaskSeparate");
771 | glad_glAttachShader = (PFNGLATTACHSHADERPROC)load("glAttachShader");
772 | glad_glBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC)load("glBindAttribLocation");
773 | glad_glCompileShader = (PFNGLCOMPILESHADERPROC)load("glCompileShader");
774 | glad_glCreateProgram = (PFNGLCREATEPROGRAMPROC)load("glCreateProgram");
775 | glad_glCreateShader = (PFNGLCREATESHADERPROC)load("glCreateShader");
776 | glad_glDeleteProgram = (PFNGLDELETEPROGRAMPROC)load("glDeleteProgram");
777 | glad_glDeleteShader = (PFNGLDELETESHADERPROC)load("glDeleteShader");
778 | glad_glDetachShader = (PFNGLDETACHSHADERPROC)load("glDetachShader");
779 | glad_glDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC)load("glDisableVertexAttribArray");
780 | glad_glEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC)load("glEnableVertexAttribArray");
781 | glad_glGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC)load("glGetActiveAttrib");
782 | glad_glGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC)load("glGetActiveUniform");
783 | glad_glGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC)load("glGetAttachedShaders");
784 | glad_glGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC)load("glGetAttribLocation");
785 | glad_glGetProgramiv = (PFNGLGETPROGRAMIVPROC)load("glGetProgramiv");
786 | glad_glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC)load("glGetProgramInfoLog");
787 | glad_glGetShaderiv = (PFNGLGETSHADERIVPROC)load("glGetShaderiv");
788 | glad_glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC)load("glGetShaderInfoLog");
789 | glad_glGetShaderSource = (PFNGLGETSHADERSOURCEPROC)load("glGetShaderSource");
790 | glad_glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC)load("glGetUniformLocation");
791 | glad_glGetUniformfv = (PFNGLGETUNIFORMFVPROC)load("glGetUniformfv");
792 | glad_glGetUniformiv = (PFNGLGETUNIFORMIVPROC)load("glGetUniformiv");
793 | glad_glGetVertexAttribdv = (PFNGLGETVERTEXATTRIBDVPROC)load("glGetVertexAttribdv");
794 | glad_glGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC)load("glGetVertexAttribfv");
795 | glad_glGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC)load("glGetVertexAttribiv");
796 | glad_glGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC)load("glGetVertexAttribPointerv");
797 | glad_glIsProgram = (PFNGLISPROGRAMPROC)load("glIsProgram");
798 | glad_glIsShader = (PFNGLISSHADERPROC)load("glIsShader");
799 | glad_glLinkProgram = (PFNGLLINKPROGRAMPROC)load("glLinkProgram");
800 | glad_glShaderSource = (PFNGLSHADERSOURCEPROC)load("glShaderSource");
801 | glad_glUseProgram = (PFNGLUSEPROGRAMPROC)load("glUseProgram");
802 | glad_glUniform1f = (PFNGLUNIFORM1FPROC)load("glUniform1f");
803 | glad_glUniform2f = (PFNGLUNIFORM2FPROC)load("glUniform2f");
804 | glad_glUniform3f = (PFNGLUNIFORM3FPROC)load("glUniform3f");
805 | glad_glUniform4f = (PFNGLUNIFORM4FPROC)load("glUniform4f");
806 | glad_glUniform1i = (PFNGLUNIFORM1IPROC)load("glUniform1i");
807 | glad_glUniform2i = (PFNGLUNIFORM2IPROC)load("glUniform2i");
808 | glad_glUniform3i = (PFNGLUNIFORM3IPROC)load("glUniform3i");
809 | glad_glUniform4i = (PFNGLUNIFORM4IPROC)load("glUniform4i");
810 | glad_glUniform1fv = (PFNGLUNIFORM1FVPROC)load("glUniform1fv");
811 | glad_glUniform2fv = (PFNGLUNIFORM2FVPROC)load("glUniform2fv");
812 | glad_glUniform3fv = (PFNGLUNIFORM3FVPROC)load("glUniform3fv");
813 | glad_glUniform4fv = (PFNGLUNIFORM4FVPROC)load("glUniform4fv");
814 | glad_glUniform1iv = (PFNGLUNIFORM1IVPROC)load("glUniform1iv");
815 | glad_glUniform2iv = (PFNGLUNIFORM2IVPROC)load("glUniform2iv");
816 | glad_glUniform3iv = (PFNGLUNIFORM3IVPROC)load("glUniform3iv");
817 | glad_glUniform4iv = (PFNGLUNIFORM4IVPROC)load("glUniform4iv");
818 | glad_glUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC)load("glUniformMatrix2fv");
819 | glad_glUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC)load("glUniformMatrix3fv");
820 | glad_glUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC)load("glUniformMatrix4fv");
821 | glad_glValidateProgram = (PFNGLVALIDATEPROGRAMPROC)load("glValidateProgram");
822 | glad_glVertexAttrib1d = (PFNGLVERTEXATTRIB1DPROC)load("glVertexAttrib1d");
823 | glad_glVertexAttrib1dv = (PFNGLVERTEXATTRIB1DVPROC)load("glVertexAttrib1dv");
824 | glad_glVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC)load("glVertexAttrib1f");
825 | glad_glVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC)load("glVertexAttrib1fv");
826 | glad_glVertexAttrib1s = (PFNGLVERTEXATTRIB1SPROC)load("glVertexAttrib1s");
827 | glad_glVertexAttrib1sv = (PFNGLVERTEXATTRIB1SVPROC)load("glVertexAttrib1sv");
828 | glad_glVertexAttrib2d = (PFNGLVERTEXATTRIB2DPROC)load("glVertexAttrib2d");
829 | glad_glVertexAttrib2dv = (PFNGLVERTEXATTRIB2DVPROC)load("glVertexAttrib2dv");
830 | glad_glVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC)load("glVertexAttrib2f");
831 | glad_glVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC)load("glVertexAttrib2fv");
832 | glad_glVertexAttrib2s = (PFNGLVERTEXATTRIB2SPROC)load("glVertexAttrib2s");
833 | glad_glVertexAttrib2sv = (PFNGLVERTEXATTRIB2SVPROC)load("glVertexAttrib2sv");
834 | glad_glVertexAttrib3d = (PFNGLVERTEXATTRIB3DPROC)load("glVertexAttrib3d");
835 | glad_glVertexAttrib3dv = (PFNGLVERTEXATTRIB3DVPROC)load("glVertexAttrib3dv");
836 | glad_glVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC)load("glVertexAttrib3f");
837 | glad_glVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC)load("glVertexAttrib3fv");
838 | glad_glVertexAttrib3s = (PFNGLVERTEXATTRIB3SPROC)load("glVertexAttrib3s");
839 | glad_glVertexAttrib3sv = (PFNGLVERTEXATTRIB3SVPROC)load("glVertexAttrib3sv");
840 | glad_glVertexAttrib4Nbv = (PFNGLVERTEXATTRIB4NBVPROC)load("glVertexAttrib4Nbv");
841 | glad_glVertexAttrib4Niv = (PFNGLVERTEXATTRIB4NIVPROC)load("glVertexAttrib4Niv");
842 | glad_glVertexAttrib4Nsv = (PFNGLVERTEXATTRIB4NSVPROC)load("glVertexAttrib4Nsv");
843 | glad_glVertexAttrib4Nub = (PFNGLVERTEXATTRIB4NUBPROC)load("glVertexAttrib4Nub");
844 | glad_glVertexAttrib4Nubv = (PFNGLVERTEXATTRIB4NUBVPROC)load("glVertexAttrib4Nubv");
845 | glad_glVertexAttrib4Nuiv = (PFNGLVERTEXATTRIB4NUIVPROC)load("glVertexAttrib4Nuiv");
846 | glad_glVertexAttrib4Nusv = (PFNGLVERTEXATTRIB4NUSVPROC)load("glVertexAttrib4Nusv");
847 | glad_glVertexAttrib4bv = (PFNGLVERTEXATTRIB4BVPROC)load("glVertexAttrib4bv");
848 | glad_glVertexAttrib4d = (PFNGLVERTEXATTRIB4DPROC)load("glVertexAttrib4d");
849 | glad_glVertexAttrib4dv = (PFNGLVERTEXATTRIB4DVPROC)load("glVertexAttrib4dv");
850 | glad_glVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC)load("glVertexAttrib4f");
851 | glad_glVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC)load("glVertexAttrib4fv");
852 | glad_glVertexAttrib4iv = (PFNGLVERTEXATTRIB4IVPROC)load("glVertexAttrib4iv");
853 | glad_glVertexAttrib4s = (PFNGLVERTEXATTRIB4SPROC)load("glVertexAttrib4s");
854 | glad_glVertexAttrib4sv = (PFNGLVERTEXATTRIB4SVPROC)load("glVertexAttrib4sv");
855 | glad_glVertexAttrib4ubv = (PFNGLVERTEXATTRIB4UBVPROC)load("glVertexAttrib4ubv");
856 | glad_glVertexAttrib4uiv = (PFNGLVERTEXATTRIB4UIVPROC)load("glVertexAttrib4uiv");
857 | glad_glVertexAttrib4usv = (PFNGLVERTEXATTRIB4USVPROC)load("glVertexAttrib4usv");
858 | glad_glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC)load("glVertexAttribPointer");
859 | }
860 | static void load_GL_VERSION_2_1(GLADloadproc load) {
861 | if(!GLAD_GL_VERSION_2_1) return;
862 | glad_glUniformMatrix2x3fv = (PFNGLUNIFORMMATRIX2X3FVPROC)load("glUniformMatrix2x3fv");
863 | glad_glUniformMatrix3x2fv = (PFNGLUNIFORMMATRIX3X2FVPROC)load("glUniformMatrix3x2fv");
864 | glad_glUniformMatrix2x4fv = (PFNGLUNIFORMMATRIX2X4FVPROC)load("glUniformMatrix2x4fv");
865 | glad_glUniformMatrix4x2fv = (PFNGLUNIFORMMATRIX4X2FVPROC)load("glUniformMatrix4x2fv");
866 | glad_glUniformMatrix3x4fv = (PFNGLUNIFORMMATRIX3X4FVPROC)load("glUniformMatrix3x4fv");
867 | glad_glUniformMatrix4x3fv = (PFNGLUNIFORMMATRIX4X3FVPROC)load("glUniformMatrix4x3fv");
868 | }
869 | static void load_GL_VERSION_3_0(GLADloadproc load) {
870 | if(!GLAD_GL_VERSION_3_0) return;
871 | glad_glColorMaski = (PFNGLCOLORMASKIPROC)load("glColorMaski");
872 | glad_glGetBooleani_v = (PFNGLGETBOOLEANI_VPROC)load("glGetBooleani_v");
873 | glad_glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)load("glGetIntegeri_v");
874 | glad_glEnablei = (PFNGLENABLEIPROC)load("glEnablei");
875 | glad_glDisablei = (PFNGLDISABLEIPROC)load("glDisablei");
876 | glad_glIsEnabledi = (PFNGLISENABLEDIPROC)load("glIsEnabledi");
877 | glad_glBeginTransformFeedback = (PFNGLBEGINTRANSFORMFEEDBACKPROC)load("glBeginTransformFeedback");
878 | glad_glEndTransformFeedback = (PFNGLENDTRANSFORMFEEDBACKPROC)load("glEndTransformFeedback");
879 | glad_glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)load("glBindBufferRange");
880 | glad_glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)load("glBindBufferBase");
881 | glad_glTransformFeedbackVaryings = (PFNGLTRANSFORMFEEDBACKVARYINGSPROC)load("glTransformFeedbackVaryings");
882 | glad_glGetTransformFeedbackVarying = (PFNGLGETTRANSFORMFEEDBACKVARYINGPROC)load("glGetTransformFeedbackVarying");
883 | glad_glClampColor = (PFNGLCLAMPCOLORPROC)load("glClampColor");
884 | glad_glBeginConditionalRender = (PFNGLBEGINCONDITIONALRENDERPROC)load("glBeginConditionalRender");
885 | glad_glEndConditionalRender = (PFNGLENDCONDITIONALRENDERPROC)load("glEndConditionalRender");
886 | glad_glVertexAttribIPointer = (PFNGLVERTEXATTRIBIPOINTERPROC)load("glVertexAttribIPointer");
887 | glad_glGetVertexAttribIiv = (PFNGLGETVERTEXATTRIBIIVPROC)load("glGetVertexAttribIiv");
888 | glad_glGetVertexAttribIuiv = (PFNGLGETVERTEXATTRIBIUIVPROC)load("glGetVertexAttribIuiv");
889 | glad_glVertexAttribI1i = (PFNGLVERTEXATTRIBI1IPROC)load("glVertexAttribI1i");
890 | glad_glVertexAttribI2i = (PFNGLVERTEXATTRIBI2IPROC)load("glVertexAttribI2i");
891 | glad_glVertexAttribI3i = (PFNGLVERTEXATTRIBI3IPROC)load("glVertexAttribI3i");
892 | glad_glVertexAttribI4i = (PFNGLVERTEXATTRIBI4IPROC)load("glVertexAttribI4i");
893 | glad_glVertexAttribI1ui = (PFNGLVERTEXATTRIBI1UIPROC)load("glVertexAttribI1ui");
894 | glad_glVertexAttribI2ui = (PFNGLVERTEXATTRIBI2UIPROC)load("glVertexAttribI2ui");
895 | glad_glVertexAttribI3ui = (PFNGLVERTEXATTRIBI3UIPROC)load("glVertexAttribI3ui");
896 | glad_glVertexAttribI4ui = (PFNGLVERTEXATTRIBI4UIPROC)load("glVertexAttribI4ui");
897 | glad_glVertexAttribI1iv = (PFNGLVERTEXATTRIBI1IVPROC)load("glVertexAttribI1iv");
898 | glad_glVertexAttribI2iv = (PFNGLVERTEXATTRIBI2IVPROC)load("glVertexAttribI2iv");
899 | glad_glVertexAttribI3iv = (PFNGLVERTEXATTRIBI3IVPROC)load("glVertexAttribI3iv");
900 | glad_glVertexAttribI4iv = (PFNGLVERTEXATTRIBI4IVPROC)load("glVertexAttribI4iv");
901 | glad_glVertexAttribI1uiv = (PFNGLVERTEXATTRIBI1UIVPROC)load("glVertexAttribI1uiv");
902 | glad_glVertexAttribI2uiv = (PFNGLVERTEXATTRIBI2UIVPROC)load("glVertexAttribI2uiv");
903 | glad_glVertexAttribI3uiv = (PFNGLVERTEXATTRIBI3UIVPROC)load("glVertexAttribI3uiv");
904 | glad_glVertexAttribI4uiv = (PFNGLVERTEXATTRIBI4UIVPROC)load("glVertexAttribI4uiv");
905 | glad_glVertexAttribI4bv = (PFNGLVERTEXATTRIBI4BVPROC)load("glVertexAttribI4bv");
906 | glad_glVertexAttribI4sv = (PFNGLVERTEXATTRIBI4SVPROC)load("glVertexAttribI4sv");
907 | glad_glVertexAttribI4ubv = (PFNGLVERTEXATTRIBI4UBVPROC)load("glVertexAttribI4ubv");
908 | glad_glVertexAttribI4usv = (PFNGLVERTEXATTRIBI4USVPROC)load("glVertexAttribI4usv");
909 | glad_glGetUniformuiv = (PFNGLGETUNIFORMUIVPROC)load("glGetUniformuiv");
910 | glad_glBindFragDataLocation = (PFNGLBINDFRAGDATALOCATIONPROC)load("glBindFragDataLocation");
911 | glad_glGetFragDataLocation = (PFNGLGETFRAGDATALOCATIONPROC)load("glGetFragDataLocation");
912 | glad_glUniform1ui = (PFNGLUNIFORM1UIPROC)load("glUniform1ui");
913 | glad_glUniform2ui = (PFNGLUNIFORM2UIPROC)load("glUniform2ui");
914 | glad_glUniform3ui = (PFNGLUNIFORM3UIPROC)load("glUniform3ui");
915 | glad_glUniform4ui = (PFNGLUNIFORM4UIPROC)load("glUniform4ui");
916 | glad_glUniform1uiv = (PFNGLUNIFORM1UIVPROC)load("glUniform1uiv");
917 | glad_glUniform2uiv = (PFNGLUNIFORM2UIVPROC)load("glUniform2uiv");
918 | glad_glUniform3uiv = (PFNGLUNIFORM3UIVPROC)load("glUniform3uiv");
919 | glad_glUniform4uiv = (PFNGLUNIFORM4UIVPROC)load("glUniform4uiv");
920 | glad_glTexParameterIiv = (PFNGLTEXPARAMETERIIVPROC)load("glTexParameterIiv");
921 | glad_glTexParameterIuiv = (PFNGLTEXPARAMETERIUIVPROC)load("glTexParameterIuiv");
922 | glad_glGetTexParameterIiv = (PFNGLGETTEXPARAMETERIIVPROC)load("glGetTexParameterIiv");
923 | glad_glGetTexParameterIuiv = (PFNGLGETTEXPARAMETERIUIVPROC)load("glGetTexParameterIuiv");
924 | glad_glClearBufferiv = (PFNGLCLEARBUFFERIVPROC)load("glClearBufferiv");
925 | glad_glClearBufferuiv = (PFNGLCLEARBUFFERUIVPROC)load("glClearBufferuiv");
926 | glad_glClearBufferfv = (PFNGLCLEARBUFFERFVPROC)load("glClearBufferfv");
927 | glad_glClearBufferfi = (PFNGLCLEARBUFFERFIPROC)load("glClearBufferfi");
928 | glad_glGetStringi = (PFNGLGETSTRINGIPROC)load("glGetStringi");
929 | glad_glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC)load("glIsRenderbuffer");
930 | glad_glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC)load("glBindRenderbuffer");
931 | glad_glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC)load("glDeleteRenderbuffers");
932 | glad_glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC)load("glGenRenderbuffers");
933 | glad_glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC)load("glRenderbufferStorage");
934 | glad_glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC)load("glGetRenderbufferParameteriv");
935 | glad_glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC)load("glIsFramebuffer");
936 | glad_glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC)load("glBindFramebuffer");
937 | glad_glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)load("glDeleteFramebuffers");
938 | glad_glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC)load("glGenFramebuffers");
939 | glad_glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC)load("glCheckFramebufferStatus");
940 | glad_glFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC)load("glFramebufferTexture1D");
941 | glad_glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC)load("glFramebufferTexture2D");
942 | glad_glFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC)load("glFramebufferTexture3D");
943 | glad_glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC)load("glFramebufferRenderbuffer");
944 | glad_glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)load("glGetFramebufferAttachmentParameteriv");
945 | glad_glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC)load("glGenerateMipmap");
946 | glad_glBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC)load("glBlitFramebuffer");
947 | glad_glRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)load("glRenderbufferStorageMultisample");
948 | glad_glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC)load("glFramebufferTextureLayer");
949 | glad_glMapBufferRange = (PFNGLMAPBUFFERRANGEPROC)load("glMapBufferRange");
950 | glad_glFlushMappedBufferRange = (PFNGLFLUSHMAPPEDBUFFERRANGEPROC)load("glFlushMappedBufferRange");
951 | glad_glBindVertexArray = (PFNGLBINDVERTEXARRAYPROC)load("glBindVertexArray");
952 | glad_glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC)load("glDeleteVertexArrays");
953 | glad_glGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC)load("glGenVertexArrays");
954 | glad_glIsVertexArray = (PFNGLISVERTEXARRAYPROC)load("glIsVertexArray");
955 | }
956 | static void load_GL_VERSION_3_1(GLADloadproc load) {
957 | if(!GLAD_GL_VERSION_3_1) return;
958 | glad_glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDPROC)load("glDrawArraysInstanced");
959 | glad_glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDPROC)load("glDrawElementsInstanced");
960 | glad_glTexBuffer = (PFNGLTEXBUFFERPROC)load("glTexBuffer");
961 | glad_glPrimitiveRestartIndex = (PFNGLPRIMITIVERESTARTINDEXPROC)load("glPrimitiveRestartIndex");
962 | glad_glCopyBufferSubData = (PFNGLCOPYBUFFERSUBDATAPROC)load("glCopyBufferSubData");
963 | glad_glGetUniformIndices = (PFNGLGETUNIFORMINDICESPROC)load("glGetUniformIndices");
964 | glad_glGetActiveUniformsiv = (PFNGLGETACTIVEUNIFORMSIVPROC)load("glGetActiveUniformsiv");
965 | glad_glGetActiveUniformName = (PFNGLGETACTIVEUNIFORMNAMEPROC)load("glGetActiveUniformName");
966 | glad_glGetUniformBlockIndex = (PFNGLGETUNIFORMBLOCKINDEXPROC)load("glGetUniformBlockIndex");
967 | glad_glGetActiveUniformBlockiv = (PFNGLGETACTIVEUNIFORMBLOCKIVPROC)load("glGetActiveUniformBlockiv");
968 | glad_glGetActiveUniformBlockName = (PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)load("glGetActiveUniformBlockName");
969 | glad_glUniformBlockBinding = (PFNGLUNIFORMBLOCKBINDINGPROC)load("glUniformBlockBinding");
970 | glad_glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)load("glBindBufferRange");
971 | glad_glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)load("glBindBufferBase");
972 | glad_glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)load("glGetIntegeri_v");
973 | }
974 | static void load_GL_VERSION_3_2(GLADloadproc load) {
975 | if(!GLAD_GL_VERSION_3_2) return;
976 | glad_glDrawElementsBaseVertex = (PFNGLDRAWELEMENTSBASEVERTEXPROC)load("glDrawElementsBaseVertex");
977 | glad_glDrawRangeElementsBaseVertex = (PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC)load("glDrawRangeElementsBaseVertex");
978 | glad_glDrawElementsInstancedBaseVertex = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC)load("glDrawElementsInstancedBaseVertex");
979 | glad_glMultiDrawElementsBaseVertex = (PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC)load("glMultiDrawElementsBaseVertex");
980 | glad_glProvokingVertex = (PFNGLPROVOKINGVERTEXPROC)load("glProvokingVertex");
981 | glad_glFenceSync = (PFNGLFENCESYNCPROC)load("glFenceSync");
982 | glad_glIsSync = (PFNGLISSYNCPROC)load("glIsSync");
983 | glad_glDeleteSync = (PFNGLDELETESYNCPROC)load("glDeleteSync");
984 | glad_glClientWaitSync = (PFNGLCLIENTWAITSYNCPROC)load("glClientWaitSync");
985 | glad_glWaitSync = (PFNGLWAITSYNCPROC)load("glWaitSync");
986 | glad_glGetInteger64v = (PFNGLGETINTEGER64VPROC)load("glGetInteger64v");
987 | glad_glGetSynciv = (PFNGLGETSYNCIVPROC)load("glGetSynciv");
988 | glad_glGetInteger64i_v = (PFNGLGETINTEGER64I_VPROC)load("glGetInteger64i_v");
989 | glad_glGetBufferParameteri64v = (PFNGLGETBUFFERPARAMETERI64VPROC)load("glGetBufferParameteri64v");
990 | glad_glFramebufferTexture = (PFNGLFRAMEBUFFERTEXTUREPROC)load("glFramebufferTexture");
991 | glad_glTexImage2DMultisample = (PFNGLTEXIMAGE2DMULTISAMPLEPROC)load("glTexImage2DMultisample");
992 | glad_glTexImage3DMultisample = (PFNGLTEXIMAGE3DMULTISAMPLEPROC)load("glTexImage3DMultisample");
993 | glad_glGetMultisamplefv = (PFNGLGETMULTISAMPLEFVPROC)load("glGetMultisamplefv");
994 | glad_glSampleMaski = (PFNGLSAMPLEMASKIPROC)load("glSampleMaski");
995 | }
996 | static void load_GL_VERSION_3_3(GLADloadproc load) {
997 | if(!GLAD_GL_VERSION_3_3) return;
998 | glad_glBindFragDataLocationIndexed = (PFNGLBINDFRAGDATALOCATIONINDEXEDPROC)load("glBindFragDataLocationIndexed");
999 | glad_glGetFragDataIndex = (PFNGLGETFRAGDATAINDEXPROC)load("glGetFragDataIndex");
1000 | glad_glGenSamplers = (PFNGLGENSAMPLERSPROC)load("glGenSamplers");
1001 | glad_glDeleteSamplers = (PFNGLDELETESAMPLERSPROC)load("glDeleteSamplers");
1002 | glad_glIsSampler = (PFNGLISSAMPLERPROC)load("glIsSampler");
1003 | glad_glBindSampler = (PFNGLBINDSAMPLERPROC)load("glBindSampler");
1004 | glad_glSamplerParameteri = (PFNGLSAMPLERPARAMETERIPROC)load("glSamplerParameteri");
1005 | glad_glSamplerParameteriv = (PFNGLSAMPLERPARAMETERIVPROC)load("glSamplerParameteriv");
1006 | glad_glSamplerParameterf = (PFNGLSAMPLERPARAMETERFPROC)load("glSamplerParameterf");
1007 | glad_glSamplerParameterfv = (PFNGLSAMPLERPARAMETERFVPROC)load("glSamplerParameterfv");
1008 | glad_glSamplerParameterIiv = (PFNGLSAMPLERPARAMETERIIVPROC)load("glSamplerParameterIiv");
1009 | glad_glSamplerParameterIuiv = (PFNGLSAMPLERPARAMETERIUIVPROC)load("glSamplerParameterIuiv");
1010 | glad_glGetSamplerParameteriv = (PFNGLGETSAMPLERPARAMETERIVPROC)load("glGetSamplerParameteriv");
1011 | glad_glGetSamplerParameterIiv = (PFNGLGETSAMPLERPARAMETERIIVPROC)load("glGetSamplerParameterIiv");
1012 | glad_glGetSamplerParameterfv = (PFNGLGETSAMPLERPARAMETERFVPROC)load("glGetSamplerParameterfv");
1013 | glad_glGetSamplerParameterIuiv = (PFNGLGETSAMPLERPARAMETERIUIVPROC)load("glGetSamplerParameterIuiv");
1014 | glad_glQueryCounter = (PFNGLQUERYCOUNTERPROC)load("glQueryCounter");
1015 | glad_glGetQueryObjecti64v = (PFNGLGETQUERYOBJECTI64VPROC)load("glGetQueryObjecti64v");
1016 | glad_glGetQueryObjectui64v = (PFNGLGETQUERYOBJECTUI64VPROC)load("glGetQueryObjectui64v");
1017 | glad_glVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISORPROC)load("glVertexAttribDivisor");
1018 | glad_glVertexAttribP1ui = (PFNGLVERTEXATTRIBP1UIPROC)load("glVertexAttribP1ui");
1019 | glad_glVertexAttribP1uiv = (PFNGLVERTEXATTRIBP1UIVPROC)load("glVertexAttribP1uiv");
1020 | glad_glVertexAttribP2ui = (PFNGLVERTEXATTRIBP2UIPROC)load("glVertexAttribP2ui");
1021 | glad_glVertexAttribP2uiv = (PFNGLVERTEXATTRIBP2UIVPROC)load("glVertexAttribP2uiv");
1022 | glad_glVertexAttribP3ui = (PFNGLVERTEXATTRIBP3UIPROC)load("glVertexAttribP3ui");
1023 | glad_glVertexAttribP3uiv = (PFNGLVERTEXATTRIBP3UIVPROC)load("glVertexAttribP3uiv");
1024 | glad_glVertexAttribP4ui = (PFNGLVERTEXATTRIBP4UIPROC)load("glVertexAttribP4ui");
1025 | glad_glVertexAttribP4uiv = (PFNGLVERTEXATTRIBP4UIVPROC)load("glVertexAttribP4uiv");
1026 | glad_glVertexP2ui = (PFNGLVERTEXP2UIPROC)load("glVertexP2ui");
1027 | glad_glVertexP2uiv = (PFNGLVERTEXP2UIVPROC)load("glVertexP2uiv");
1028 | glad_glVertexP3ui = (PFNGLVERTEXP3UIPROC)load("glVertexP3ui");
1029 | glad_glVertexP3uiv = (PFNGLVERTEXP3UIVPROC)load("glVertexP3uiv");
1030 | glad_glVertexP4ui = (PFNGLVERTEXP4UIPROC)load("glVertexP4ui");
1031 | glad_glVertexP4uiv = (PFNGLVERTEXP4UIVPROC)load("glVertexP4uiv");
1032 | glad_glTexCoordP1ui = (PFNGLTEXCOORDP1UIPROC)load("glTexCoordP1ui");
1033 | glad_glTexCoordP1uiv = (PFNGLTEXCOORDP1UIVPROC)load("glTexCoordP1uiv");
1034 | glad_glTexCoordP2ui = (PFNGLTEXCOORDP2UIPROC)load("glTexCoordP2ui");
1035 | glad_glTexCoordP2uiv = (PFNGLTEXCOORDP2UIVPROC)load("glTexCoordP2uiv");
1036 | glad_glTexCoordP3ui = (PFNGLTEXCOORDP3UIPROC)load("glTexCoordP3ui");
1037 | glad_glTexCoordP3uiv = (PFNGLTEXCOORDP3UIVPROC)load("glTexCoordP3uiv");
1038 | glad_glTexCoordP4ui = (PFNGLTEXCOORDP4UIPROC)load("glTexCoordP4ui");
1039 | glad_glTexCoordP4uiv = (PFNGLTEXCOORDP4UIVPROC)load("glTexCoordP4uiv");
1040 | glad_glMultiTexCoordP1ui = (PFNGLMULTITEXCOORDP1UIPROC)load("glMultiTexCoordP1ui");
1041 | glad_glMultiTexCoordP1uiv = (PFNGLMULTITEXCOORDP1UIVPROC)load("glMultiTexCoordP1uiv");
1042 | glad_glMultiTexCoordP2ui = (PFNGLMULTITEXCOORDP2UIPROC)load("glMultiTexCoordP2ui");
1043 | glad_glMultiTexCoordP2uiv = (PFNGLMULTITEXCOORDP2UIVPROC)load("glMultiTexCoordP2uiv");
1044 | glad_glMultiTexCoordP3ui = (PFNGLMULTITEXCOORDP3UIPROC)load("glMultiTexCoordP3ui");
1045 | glad_glMultiTexCoordP3uiv = (PFNGLMULTITEXCOORDP3UIVPROC)load("glMultiTexCoordP3uiv");
1046 | glad_glMultiTexCoordP4ui = (PFNGLMULTITEXCOORDP4UIPROC)load("glMultiTexCoordP4ui");
1047 | glad_glMultiTexCoordP4uiv = (PFNGLMULTITEXCOORDP4UIVPROC)load("glMultiTexCoordP4uiv");
1048 | glad_glNormalP3ui = (PFNGLNORMALP3UIPROC)load("glNormalP3ui");
1049 | glad_glNormalP3uiv = (PFNGLNORMALP3UIVPROC)load("glNormalP3uiv");
1050 | glad_glColorP3ui = (PFNGLCOLORP3UIPROC)load("glColorP3ui");
1051 | glad_glColorP3uiv = (PFNGLCOLORP3UIVPROC)load("glColorP3uiv");
1052 | glad_glColorP4ui = (PFNGLCOLORP4UIPROC)load("glColorP4ui");
1053 | glad_glColorP4uiv = (PFNGLCOLORP4UIVPROC)load("glColorP4uiv");
1054 | glad_glSecondaryColorP3ui = (PFNGLSECONDARYCOLORP3UIPROC)load("glSecondaryColorP3ui");
1055 | glad_glSecondaryColorP3uiv = (PFNGLSECONDARYCOLORP3UIVPROC)load("glSecondaryColorP3uiv");
1056 | }
1057 | static int find_extensionsGL(void) {
1058 | if (!get_exts()) return 0;
1059 | (void)&has_ext;
1060 | free_exts();
1061 | return 1;
1062 | }
1063 |
1064 | static void find_coreGL(void) {
1065 |
1066 | /* Thank you @elmindreda
1067 | * https://github.com/elmindreda/greg/blob/master/templates/greg.c.in#L176
1068 | * https://github.com/glfw/glfw/blob/master/src/context.c#L36
1069 | */
1070 | int i, major, minor;
1071 |
1072 | const char* version;
1073 | const char* prefixes[] = {
1074 | "OpenGL ES-CM ",
1075 | "OpenGL ES-CL ",
1076 | "OpenGL ES ",
1077 | NULL
1078 | };
1079 |
1080 | version = (const char*) glGetString(GL_VERSION);
1081 | if (!version) return;
1082 |
1083 | for (i = 0; prefixes[i]; i++) {
1084 | const size_t length = strlen(prefixes[i]);
1085 | if (strncmp(version, prefixes[i], length) == 0) {
1086 | version += length;
1087 | break;
1088 | }
1089 | }
1090 |
1091 | /* PR #18 */
1092 | #ifdef _MSC_VER
1093 | sscanf_s(version, "%d.%d", &major, &minor);
1094 | #else
1095 | sscanf(version, "%d.%d", &major, &minor);
1096 | #endif
1097 |
1098 | GLVersion.major = major; GLVersion.minor = minor;
1099 | max_loaded_major = major; max_loaded_minor = minor;
1100 | GLAD_GL_VERSION_1_0 = (major == 1 && minor >= 0) || major > 1;
1101 | GLAD_GL_VERSION_1_1 = (major == 1 && minor >= 1) || major > 1;
1102 | GLAD_GL_VERSION_1_2 = (major == 1 && minor >= 2) || major > 1;
1103 | GLAD_GL_VERSION_1_3 = (major == 1 && minor >= 3) || major > 1;
1104 | GLAD_GL_VERSION_1_4 = (major == 1 && minor >= 4) || major > 1;
1105 | GLAD_GL_VERSION_1_5 = (major == 1 && minor >= 5) || major > 1;
1106 | GLAD_GL_VERSION_2_0 = (major == 2 && minor >= 0) || major > 2;
1107 | GLAD_GL_VERSION_2_1 = (major == 2 && minor >= 1) || major > 2;
1108 | GLAD_GL_VERSION_3_0 = (major == 3 && minor >= 0) || major > 3;
1109 | GLAD_GL_VERSION_3_1 = (major == 3 && minor >= 1) || major > 3;
1110 | GLAD_GL_VERSION_3_2 = (major == 3 && minor >= 2) || major > 3;
1111 | GLAD_GL_VERSION_3_3 = (major == 3 && minor >= 3) || major > 3;
1112 | if (GLVersion.major > 3 || (GLVersion.major >= 3 && GLVersion.minor >= 3)) {
1113 | max_loaded_major = 3;
1114 | max_loaded_minor = 3;
1115 | }
1116 | }
1117 |
1118 | int gladLoadGLLoader(GLADloadproc load) {
1119 | GLVersion.major = 0; GLVersion.minor = 0;
1120 | glGetString = (PFNGLGETSTRINGPROC)load("glGetString");
1121 | if(glGetString == NULL) return 0;
1122 | if(glGetString(GL_VERSION) == NULL) return 0;
1123 | find_coreGL();
1124 | load_GL_VERSION_1_0(load);
1125 | load_GL_VERSION_1_1(load);
1126 | load_GL_VERSION_1_2(load);
1127 | load_GL_VERSION_1_3(load);
1128 | load_GL_VERSION_1_4(load);
1129 | load_GL_VERSION_1_5(load);
1130 | load_GL_VERSION_2_0(load);
1131 | load_GL_VERSION_2_1(load);
1132 | load_GL_VERSION_3_0(load);
1133 | load_GL_VERSION_3_1(load);
1134 | load_GL_VERSION_3_2(load);
1135 | load_GL_VERSION_3_3(load);
1136 |
1137 | if (!find_extensionsGL()) return 0;
1138 | return GLVersion.major != 0 || GLVersion.minor != 0;
1139 | }
1140 |
1141 |
--------------------------------------------------------------------------------
/src/main.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 |
5 | void framebuffer_size_callback(GLFWwindow *window, int width, int height);
6 | void processInput(GLFWwindow *window);
7 |
8 | // settings
9 | const unsigned int SCR_WIDTH = 800;
10 | const unsigned int SCR_HEIGHT = 600;
11 | int main()
12 | {
13 | // glfw: initialize and configure
14 | // ------------------------------
15 | glfwInit();
16 | glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
17 | glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
18 | glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
19 | #ifdef __APPLE__
20 | glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); //uncomment this statement to fix compilation on OS X
21 | #endif
22 | // glfw window creation
23 | // --------------------
24 | GLFWwindow *window = glfwCreateWindow(SCR_WIDTH, SCR_HEIGHT, "LearnOpenGL", NULL, NULL);
25 | if (window == NULL)
26 | {
27 | std::cout << "Failed to create GLFW window" << std::endl;
28 | glfwTerminate();
29 | return -1;
30 | }
31 | glfwMakeContextCurrent(window);
32 | // glad: load all OpenGL function pointers
33 | // ---------------------------------------
34 | if (!gladLoadGLLoader((GLADloadproc)glfwGetProcAddress))
35 | {
36 | std::cout << "Failed to initialize GLAD" << std::endl;
37 | return -1;
38 | }
39 | // render loop
40 | // -----------
41 | while (!glfwWindowShouldClose(window))
42 | {
43 | // input
44 | // -----
45 | processInput(window);
46 |
47 | // render
48 | // ------
49 | // glClearColor(0.2f, 0.3f, 0.3f, 1.0f);
50 | glClear(GL_COLOR_BUFFER_BIT);
51 |
52 | // glfw: swap buffers and poll IO events (keys pressed/released, mouse moved etc.)
53 | // -------------------------------------------------------------------------------
54 | glfwSwapBuffers(window);
55 | glfwPollEvents();
56 | }
57 | // glfw: terminate, clearing all previously allocated GLFWresources.
58 | //---------------------------------------------------------------
59 | glfwTerminate();
60 | return 0;
61 | }
62 |
63 | void processInput(GLFWwindow *window)
64 | {
65 | if (glfwGetKey(window, GLFW_KEY_ESCAPE) == GLFW_PRESS)
66 | glfwSetWindowShouldClose(window, true);
67 | }
68 |
69 | // glfw: whenever the window size changed (by OS or user resize) this callback function executes
70 | // ---------------------------------------------------------------------------------------------
71 | void framebuffer_size_callback(GLFWwindow *window, int width, int height)
72 | {
73 | // make sure the viewport matches the new window dimensions; note that width and
74 | // height will be significantly larger than specified on retina displays.
75 | glViewport(0, 0, width, height);
76 | }
--------------------------------------------------------------------------------