List of commits:
Subject Hash Author Date (UTC)
Initial commit cd1f3278f6f9a79255ba17b3b9eb0c224c8fd091 fluffrabbit 2024-07-10 17:32:30
Commit cd1f3278f6f9a79255ba17b3b9eb0c224c8fd091 - Initial commit
Author: fluffrabbit
Author date (UTC): 2024-07-10 17:32
Committer name: fluffrabbit
Committer date (UTC): 2024-07-10 17:32
Parent(s):
Signer:
Signing key:
Signing status: N
Tree: 6af3c73d20fb30b560bc863254aeb59894a0df08
File Lines added Lines deleted
.gitignore 7 0
Makefile 93 0
README.md 21 0
base/pagoda.obj 457 0
base/pagoda.png 0 0
base/paused.png 0 0
base/wall.png 0 0
include/dvector.h 735 0
include/fgc.h 1720 0
include/glad/gl.h 3601 0
include/glad/gles3.h 2834 0
include/glad/glx.h 1006 0
include/stb_image.h 7985 0
include/zone.h 78 0
src/cfps.c 382 0
File .gitignore added (mode: 100644) (index 0000000..695eda7)
1 *.a
2 *.o
3 *.so
4 *.exe
5 *.zip
6 *.tar.*
7 cfps
File Makefile added (mode: 100644) (index 0000000..cbeae2f)
1 ANDROID_SDK=/usr/lib/android-sdk
2 ANDROID_TOOLS_ZIP=commandlinetools-linux-8092744_latest.zip
3
4 PROGRAM=cfps
5 LINCC := gcc -march=x86-64
6 WINCC := i686-w64-mingw32-gcc-win32 -march=pentium4
7 CFLAGS=-std=c99 -Wall -Wextra -Wpedantic -O3
8
9 # SDL
10 SDL_VER=2.30.3
11 SDL_DIR=SDL2-$(SDL_VER)
12 SDL_TAR=$(SDL_DIR).tar.gz
13 SDL_WIN_TAR=SDL2-devel-$(SDL_VER)-mingw.tar.gz
14
15 # Object files.
16 OBJECTS_LIN_DYNAMIC=
17 OBJECTS_LIN_STATIC=$(OBJECTS_LIN_DYNAMIC) libSDL2.a
18
19 # Dynamic libraries.
20 DYLIBS_LIN_STATIC=-lm -ldl -pthread
21 DYLIBS_LIN_DYNAMIC=-lSDL2 $(DYLIBS_LIN_STATIC)
22
23 # PC stuff.
24
25 $(PROGRAM): $(OBJECTS_LIN_DYNAMIC) src/$(PROGRAM).c include/*
26 # Building for GNU/Linux (dynamic SDL).
27 $(LINCC) $(CFLAGS) -o $@ -Iinclude src/$(PROGRAM).c $(OBJECTS_LIN_DYNAMIC) -Wl,-rpath,. -L. $(DYLIBS_LIN_DYNAMIC)
28
29 $(PROGRAM)-static: $(OBJECTS_LIN_STATIC) src/$(PROGRAM).c include/*
30 # Building for GNU/Linux (static SDL).
31 $(LINCC) $(CFLAGS) -o $@ -Iinclude src/$(PROGRAM).c $(OBJECTS_LIN_STATIC) -Wl,-rpath,. -L. $(DYLIBS_LIN_STATIC)
32
33 # Android stuff.
34
35 android:
36 PATH="/usr/lib/android-ndk:$PATH" && \
37 PATH="/usr/lib/android-sdk/tools:$PATH" && \
38 PATH="/usr/lib/android-sdk/platform-tools:$PATH" && \
39 export ANDROID_HOME=/usr/lib/android-sdk && \
40 export ANDROID_SDK_ROOT=$ANDROID_HOME && \
41 export ANDROID_NDK_HOME=$ANDROID_HOME/ndk/21.3.6528147/ && \
42 cd SDL2-2.0.20/build-scripts && \
43 ./androidbuild.sh com.mse.$(PROGRAM) ../../src/$(PROGRAM).c && \
44 cd ../build/com.mse.$(PROGRAM) && \
45 ./gradlew --offline --no-rebuild installDebug
46
47 # Needs to run as root because apparently phase 2 of the NDK installation happens in this step.
48 android-deprecated: ccstrap .ndk .license-check
49 cp -rf include/* SDL2-2.0.20/include/
50 sudo ./ccstrap
51
52 # Needs to run as root because it installs the NDK in the SDK folder.
53 .ndk: .cmdline-tools
54 yes | sudo ./cmdline-tools/bin/sdkmanager --sdk_root=$(ANDROID_SDK) --install "ndk;21.3.6528147" --channel=0
55 touch $@
56
57 .license-check: .cmdline-tools
58 yes | ./cmdline-tools/bin/sdkmanager --sdk_root=$(ANDROID_SDK) --licenses
59 touch $@
60
61 .cmdline-tools: $(ANDROID_TOOLS_ZIP)
62 unzip $(ANDROID_TOOLS_ZIP)
63 touch $@
64
65 $(ANDROID_TOOLS_ZIP):
66 wget https://dl.google.com/android/repository/$(ANDROID_TOOLS_ZIP)
67
68 # Build SDL2 for Linux as compatibly as possible.
69 libSDL2.a: $(SDL_DIR)
70 rm -r -f $(SDL_DIR)/build
71 mkdir -p $(SDL_DIR)/build
72 export CC="$(LINCC)" ;\
73 cd $(SDL_DIR)/build; ../configure --disable-sndio --disable-esd \
74 --disable-arts --disable-video-directfb --disable-rpath \
75 --enable-alsa --enable-alsa-shared --enable-pulseaudio \
76 --enable-pulseaudio-shared --enable-x11-shared --enable-sdl-dlopen \
77 --disable-input-tslib CFLAGS="-O3" && make
78 cp $(SDL_DIR)/build/build/.libs/libSDL2.a $@
79 touch $@
80
81 $(SDL_DIR): $(SDL_TAR)
82 $(RM) -r $@
83 tar xzvf $(SDL_TAR) $@
84 touch $@
85
86 $(SDL_TAR):
87 wget https://libsdl.org/release/$(SDL_TAR)
88
89 clean:
90 $(RM) $(PROGRAM) $(PROGRAM)-static
91
92 distclean: clean
93 rm -rf $(OBJECTS_LIN_STATIC) $(SDL_DIR)
File README.md added (mode: 100644) (index 0000000..fdf801a)
1 # CFPS
2
3 FGC is a 3D graphics library written in C99. It can be used as a foundation for building graphics applications. Currently supports PC and Android targets.
4
5 CFPS is a game engine built on top of FGC.
6
7 ## Philosophy
8
9 Keep it lightweight and simple above all else. Use mature tools and GL3/GLES3 for compatibility. Make it feel good to use and easy to change.
10
11 ## Boring details
12
13 FGC provides a public API that is primarily designed to display 3D graphics with OpenGL ES 2.0. However, it utilizes abstracted generality in the forms of internal helper functions and external helper libraries. These helpers do mundane things like context initialization and image loading. Advanced features like GPU selection are ignored. The public API provides a high level of abstraction to make graphics application development go faster.
14
15 For example, the internal function `_fgcLoadSurface` loads an `SDL_Surface` into client memory, utilizing commands from SDL, SDL_Image, and stb_image, depending which headers were included before `fgc.h`. The `.bmp` format is always supported, but SDL_Image and stb_image each allow loading `.png`, `.jpg`, and other formats. `fgcLoadTexture` uses `_fgcLoadSurface` internally to load textures.
16
17 Each FGC API call represents dozens or even hundreds of lines of code. This high level of abstraction makes things simple for you, the application programmer. If you need more advanced features, you can modify the library. API documentation is provided in `fgc.h`. `test.c` provides an example of usage.
18
19 ## Android
20
21 Android earned *persona non grata* status in the larger software development community by being a royal pain to work with. Fortunately, FGC apps run on Android if you have 8 GB of free space for compilation.
File base/pagoda.obj added (mode: 100644) (index 0000000..4bb6c8c)
1 # 161 vertex positions
2 v 0 0.4280000030994415 1.191200017929077
3 v 1.191200017929077 0.4280000030994415 1.191200017929077
4 v 0 0.8162999749183655 0
5 v 0 0.4280000030994415 -1.191200017929077
6 v 1.191200017929077 0.4280000030994415 -1.191200017929077
7 v -1.191200017929077 0.4280000030994415 1.191200017929077
8 v -1.191200017929077 0.4280000030994415 -1.191200017929077
9 v 1.191200017929077 0.4280000030994415 0
10 v -1.191200017929077 0.4280000030994415 0
11 v 0 0.7267000079154968 -1.014600038528442
12 v 1.014600038528442 0.7267000079154968 0
13 v 0 0.7267000079154968 1.014600038528442
14 v -1.014600038528442 0.7267000079154968 0
15 v -1.014600038528442 0.7267000079154968 -1.014600038528442
16 v 1.014600038528442 0.7267000079154968 -1.014600038528442
17 v 1.014600038528442 0.7267000079154968 1.014600038528442
18 v -1.014600038528442 0.7267000079154968 1.014600038528442
19 v 0 1.057399988174438 0
20 v 0 1.012400031089783 0.7815999984741211
21 v 0.7815999984741211 1.012400031089783 0.7815999984741211
22 v 0 1.295500040054321 0
23 v 0 1.012400031089783 -0.7815999984741211
24 v 0.7815999984741211 1.012400031089783 -0.7815999984741211
25 v -0.7815999984741211 1.012400031089783 0.7815999984741211
26 v -0.7815999984741211 1.012400031089783 -0.7815999984741211
27 v 0.7815999984741211 1.012400031089783 0
28 v -0.7815999984741211 1.012400031089783 0
29 v 0 1.287600040435791 -0.5953999757766724
30 v 0.5953999757766724 1.287600040435791 0
31 v 0 1.287600040435791 0.5953999757766724
32 v -0.5953999757766724 1.287600040435791 0
33 v -0.5953999757766724 1.287600040435791 -0.5953999757766724
34 v 0.5953999757766724 1.287600040435791 -0.5953999757766724
35 v 0.5953999757766724 1.287600040435791 0.5953999757766724
36 v -0.5953999757766724 1.287600040435791 0.5953999757766724
37 v 0 1.530200004577637 0
38 v 0 1.559099912643433 0.4442999958992004
39 v 0.4442999958992004 1.559099912643433 0.4442999958992004
40 v 0 1.747699975967407 0
41 v 0 1.559099912643433 -0.4442999958992004
42 v 0.4442999958992004 1.559099912643433 -0.4442999958992004
43 v -0.4442999958992004 1.559099912643433 0.4442999958992004
44 v -0.4442999958992004 1.559099912643433 -0.4442999958992004
45 v 0.4442999958992004 1.559099912643433 0
46 v -0.4442999958992004 1.559099912643433 0
47 v -0.04690000042319298 1.798799991607666 0.04690000042319298
48 v 0.04690000042319298 1.798799991607666 0.04690000042319298
49 v -0.04690000042319298 1.798799991607666 -0.04690000042319298
50 v 0.04690000042319298 1.798799991607666 -0.04690000042319298
51 v -0.04690000042319298 1.705100059509277 0.04690000042319298
52 v -0.04690000042319298 1.705100059509277 -0.04690000042319298
53 v 0.04690000042319298 1.705100059509277 -0.04690000042319298
54 v 0.04690000042319298 1.705100059509277 0.04690000042319298
55 v -0.3197000026702881 1.354300022125244 -0.3197000026702881
56 v -0.3197000026702881 1.354300022125244 0.3197000026702881
57 v -0.3197000026702881 1.56060004234314 -0.3197000026702881
58 v -0.3197000026702881 1.56060004234314 0.3197000026702881
59 v 0.3197000026702881 1.354300022125244 0.3197000026702881
60 v 0.3197000026702881 1.56060004234314 -0.3197000026702881
61 v 0.3197000026702881 1.56060004234314 0.3197000026702881
62 v 0.3197000026702881 1.354300022125244 -0.3197000026702881
63 v 0.4372999966144562 1.289399981498718 0.4372999966144562
64 v -0.4372999966144562 1.289399981498718 0.4372999966144562
65 v 0.4372999966144562 1.047500014305115 0.4372999966144562
66 v -0.4372999966144562 1.047500014305115 0.4372999966144562
67 v -0.4372999966144562 1.289399981498718 -0.4372999966144562
68 v 0.4372999966144562 1.289399981498718 -0.4372999966144562
69 v -0.4372999966144562 1.047500014305115 -0.4372999966144562
70 v 0.4372999966144562 1.047500014305115 -0.4372999966144562
71 v -0.5831999778747559 0.7796000242233276 0
72 v -0.5831999778747559 1.014400005340576 0
73 v -0.5831999778747559 0.7796000242233276 -0.5831999778747559
74 v -0.5831999778747559 1.014400005340576 -0.5831999778747559
75 v -0.5831999778747559 0.7796000242233276 0.5831999778747559
76 v -0.5831999778747559 1.014400005340576 0.5831999778747559
77 v 0.5831999778747559 0.7796000242233276 0
78 v 0.5831999778747559 0.7796000242233276 -0.5831999778747559
79 v 0.5831999778747559 1.014400005340576 0
80 v 0.5831999778747559 1.014400005340576 -0.5831999778747559
81 v 0.5831999778747559 0.7796000242233276 0.5831999778747559
82 v 0.5831999778747559 1.014400005340576 0.5831999778747559
83 v 0 1.014400005340576 -0.5831999778747559
84 v 0 0.7796000242233276 -0.5831999778747559
85 v 0 1.014400005340576 0.5831999778747559
86 v 0 0.7796000242233276 0.5831999778747559
87 v 0.7666000127792358 0.7290999889373779 0.7666000127792358
88 v 0 0.7290999889373779 0.7666000127792358
89 v 0.7666000127792358 0.4889000058174133 0.7666000127792358
90 v 0 0.4889000058174133 0.7666000127792358
91 v 0.7666000127792358 0.7290999889373779 -0.7666000127792358
92 v 0.7666000127792358 0.4889000058174133 -0.7666000127792358
93 v 0 0.7290999889373779 -0.7666000127792358
94 v 0 0.4889000058174133 -0.7666000127792358
95 v -0.7666000127792358 0.7290999889373779 0.7666000127792358
96 v -0.7666000127792358 0.4889000058174133 0.7666000127792358
97 v -0.7666000127792358 0.7290999889373779 -0.7666000127792358
98 v -0.7666000127792358 0.4889000058174133 -0.7666000127792358
99 v 0.7666000127792358 0.4889000058174133 0
100 v 0.7666000127792358 0.7290999889373779 0
101 v -0.7666000127792358 0.4889000058174133 0
102 v -0.7666000127792358 0.7290999889373779 0
103 v -0.949999988079071 0.03079999983310699 -0.949999988079071
104 v -0.2000000029802322 0.03079999983310699 -0.949999988079071
105 v -0.949999988079071 0.4307999908924103 -0.949999988079071
106 v -0.2000000029802322 0.4307999908924103 -0.949999988079071
107 v -0.949999988079071 0.03079999983310699 0.949999988079071
108 v -0.949999988079071 0.4307999908924103 0.949999988079071
109 v -0.2000000029802322 0.03079999983310699 0.949999988079071
110 v -0.2000000029802322 0.4307999908924103 0.949999988079071
111 v 0.949999988079071 0.03079999983310699 -0.949999988079071
112 v 0.949999988079071 0.4307999908924103 -0.949999988079071
113 v 0.2000000029802322 0.03079999983310699 -0.949999988079071
114 v 0.2000000029802322 0.4307999908924103 -0.949999988079071
115 v 0.949999988079071 0.03079999983310699 0.949999988079071
116 v 0.2000000029802322 0.03079999983310699 0.949999988079071
117 v 0.949999988079071 0.4307999908924103 0.949999988079071
118 v 0.2000000029802322 0.4307999908924103 0.949999988079071
119 v -0.949999988079071 0.4307999908924103 -0.2000000029802322
120 v -0.949999988079071 0.03079999983310699 -0.2000000029802322
121 v -0.949999988079071 0.4307999908924103 0.2000000029802322
122 v -0.949999988079071 0.03079999983310699 0.2000000029802322
123 v 0.949999988079071 0.4307999908924103 -0.2000000029802322
124 v 0.949999988079071 0.03079999983310699 -0.2000000029802322
125 v 0.949999988079071 0.4307999908924103 0.2000000029802322
126 v 0.949999988079071 0.03079999983310699 0.2000000029802322
127 v -1 0.4307999908924103 -0.2000000029802322
128 v -1 0.03079999983310699 -0.2000000029802322
129 v -1 0.4307999908924103 0.2000000029802322
130 v -1 0.03079999983310699 0.2000000029802322
131 v 1 0.4307999908924103 -0.2000000029802322
132 v 1 0.03079999983310699 -0.2000000029802322
133 v 1 0.4307999908924103 0.2000000029802322
134 v 1 0.03079999983310699 0.2000000029802322
135 v -0.2000000029802322 0.03079999983310699 -1
136 v -0.2000000029802322 0.4307999908924103 -1
137 v -0.2000000029802322 0.03079999983310699 1
138 v -0.2000000029802322 0.4307999908924103 1
139 v 0.2000000029802322 0.03079999983310699 -1
140 v 0.2000000029802322 0.4307999908924103 -1
141 v 0.2000000029802322 0.03079999983310699 1
142 v 0.2000000029802322 0.4307999908924103 1
143 v -1 0.03079999983310699 -1
144 v -1 0.4307999908924103 -1
145 v -1 0.03079999983310699 1
146 v -1 0.4307999908924103 1
147 v 1 0.03079999983310699 -1
148 v 1 0.4307999908924103 -1
149 v 1 0.03079999983310699 1
150 v 1 0.4307999908924103 1
151 v -1.171499967575073 9.999999747378752e-05 1.171499967575073
152 v -1.171499967575073 -0.000199999994947575 -1.171499967575073
153 v 1.171499967575073 9.999999747378752e-05 1.171499967575073
154 v 1.171499967575073 9.999999747378752e-05 -1.171499967575073
155 v -0.6000000238418579 0.03079999983310699 0.6000000238418579
156 v -0.6000000238418579 0.4307999908924103 0.6000000238418579
157 v -0.6000000238418579 0.03079999983310699 -0.6000000238418579
158 v -0.6000000238418579 0.4307999908924103 -0.6000000238418579
159 v 0.6000000238418579 0.4307999908924103 0.6000000238418579
160 v 0.6000000238418579 0.03079999983310699 -0.6000000238418579
161 v 0.6000000238418579 0.4307999908924103 -0.6000000238418579
162 v 0.6000000238418579 0.03079999983310699 0.6000000238418579
163
164 # 31 UV coordinates
165 vt 0.563398003578186 1.510972023010254 0
166 vt 0.9883790016174316 1.510972023010254 0
167 vt 0.5633990168571472 1.982826948165894 0
168 vt 0.02500000037252903 1.75 0
169 vt 0.25 1.975000023841858 0
170 vt 0.02500000037252903 1.975000023841858 0
171 vt 0.4749999940395355 1.75 0
172 vt 0.4749999940395355 1.975000023841858 0
173 vt 0.4749999940395355 1.524999976158142 0
174 vt 0.25 1.524999976158142 0
175 vt 0.02500000037252903 1.524999976158142 0
176 vt 0.4749999940395355 1.525001049041748 0
177 vt 0.02500000037252903 1.974998950958252 0
178 vt 2 1.5 0
179 vt 0 1.5 0
180 vt 2 1.122069954872131 0
181 vt 0 1.122069954872131 0
182 vt 0 1 0
183 vt 2 1 0
184 vt 0 1.499999046325684 0
185 vt 2 1.000000953674316 0
186 vt 0.0003910000086762011 1.5 0
187 vt 0.0003910000086762011 1 0
188 vt 0.05039099976420403 1.5 0
189 vt 0.05039099976420403 1 0
190 vt 0.9496089816093445 1 0
191 vt 0.9996089935302734 1 0
192 vt 0.9496089816093445 1.5 0
193 vt 0.9996089935302734 1.5 0
194 vt -1 1 0
195 vt -1 1.5 0
196
197 # 61 vertex normals
198 vn 0 -0.9590139985084534 0.2832730114459991
199 vn 0.3091529905796051 0.8993189930915833 0.3091529905796051
200 vn 0 1 0
201 vn 0 -0.9590139985084534 -0.2832730114459991
202 vn 0.3091529905796051 0.8993189930915833 -0.3091529905796051
203 vn -0.3091529905796051 0.8993189930915833 0.3091529905796051
204 vn -0.3091529905796051 0.8993189930915833 -0.3091529905796051
205 vn 0.4914090037345886 -0.8709070086479187 0
206 vn -0.4914090037345886 -0.8709070086479187 0
207 vn 0 -0.9520249962806702 0.3059180080890656
208 vn 0.3393050134181976 0.8773159980773926 0.3393050134181976
209 vn 0 -0.9520249962806702 -0.3059180080890656
210 vn 0.3393050134181976 0.8773159980773926 -0.3393050134181976
211 vn -0.3393050134181976 0.8773159980773926 0.3393050134181976
212 vn -0.3393050134181976 0.8773159980773926 -0.3393050134181976
213 vn 0.5197299718856812 -0.8543050289154053 0
214 vn -0.5197299718856812 -0.8543050289154053 0
215 vn 0 -0.9434490203857422 -0.331492006778717
216 vn 0.5493639707565308 -0.835565984249115 0
217 vn 0 -0.9434490203857422 0.331492006778717
218 vn -0.5493639707565308 -0.835565984249115 0
219 vn -0.3752860128879547 0.8474990129470825 -0.3752860128879547
220 vn 0.3752860128879547 0.8474990129470825 -0.3752860128879547
221 vn 0.3752860128879547 0.8474990129470825 0.3752860128879547
222 vn -0.3752860128879547 0.8474990129470825 0.3752860128879547
223 vn 0 -0.9403060078620911 0.3402810096740723
224 vn 0.3881950080394745 0.8357800245285034 0.3881950080394745
225 vn 0 -0.9403060078620911 -0.3402810096740723
226 vn 0.3881950080394745 0.8357800245285034 -0.3881950080394745
227 vn -0.3881950080394745 0.8357800245285034 0.3881950080394745
228 vn -0.3881950080394745 0.8357800245285034 -0.3881950080394745
229 vn 0.5589770078659058 -0.8291569948196411 0
230 vn -0.5589770078659058 -0.8291569948196411 0
231 vn -0.8164920210838318 0.4082460105419159 0.4082460105419159
232 vn 0.5773490071296692 0.5773490071296692 0.5773490071296692
233 vn -0.4082460105419159 0.8164920210838318 -0.4082460105419159
234 vn 0.4082460105419159 0.4082460105419159 -0.8164920210838318
235 vn -0.4471879899501801 0 0.8944060206413269
236 vn -0.707082986831665 0 -0.707082986831665
237 vn 0.8944060206413269 0 -0.4471879899501801
238 vn 0.707082986831665 0 0.707082986831665
239 vn -0.4471879899501801 0 -0.8944060206413269
240 vn -0.8944060206413269 0 0.4471879899501801
241 vn -0.8944060206413269 0 -0.4471879899501801
242 vn 0.707082986831665 0 -0.707082986831665
243 vn -1 0 0
244 vn -0.707082986831665 0 0.707082986831665
245 vn 1 0 0
246 vn 0 0 -1
247 vn 0 0 1
248 vn 0.4471879899501801 0 0.8944060206413269
249 vn 0.8944060206413269 0 0.4471879899501801
250 vn 0.4471879899501801 0 -0.8944060206413269
251 vn -0.4656209945678711 0.8483840227127075 -0.2518079876899719
252 vn -0.4177980124950409 0.8762469887733459 0.239997997879982
253 vn 0.4174929857254028 0.8762779831886292 -0.2403330057859421
254 vn 0.4653159976005554 0.8486279845237732 0.2515029907226562
255 vn -0.1762440055608749 0.9684439897537231 0.1761219948530197
256 vn -0.1770070046186447 0.9681389927864075 -0.1770070046186447
257 vn 0.1761830002069473 0.9684439897537231 0.1761830002069473
258 vn 0.1761530041694641 0.9684439897537231 -0.1762440055608749
259
260 # Mesh 'Pagoda' with 196 faces
261 g Pagoda
262 f 1/1/1 2/2/2 3/3/3
263 f 4/1/4 3/3/3 5/2/5
264 f 1/1/1 3/3/3 6/2/6
265 f 4/1/4 7/2/7 3/3/3
266 f 8/1/8 5/2/5 3/3/3
267 f 9/1/9 3/3/3 7/2/7
268 f 8/1/8 3/3/3 2/2/2
269 f 9/1/9 6/2/6 3/3/3
270 f 9/4/9 1/5/1 6/6/6
271 f 1/5/1 8/7/8 2/8/2
272 f 5/9/5 8/7/8 4/10/4
273 f 9/4/9 7/11/7 4/10/4
274 f 9/4/9 4/10/4 1/5/1
275 f 4/10/4 8/7/8 1/5/1
276 f 10/10/4 11/7/8 12/5/1
277 f 13/4/9 10/10/4 12/5/1
278 f 13/4/9 14/11/7 10/10/4
279 f 15/9/5 11/7/8 10/10/4
280 f 12/5/1 11/7/8 16/8/2
281 f 13/4/9 12/5/1 17/6/6
282 f 13/1/9 17/2/6 18/3/3
283 f 11/1/8 18/3/3 16/2/2
284 f 13/1/9 18/3/3 14/2/7
285 f 11/1/8 15/2/5 18/3/3
286 f 10/1/4 14/2/7 18/3/3
287 f 12/1/1 18/3/3 17/2/6
288 f 10/1/4 18/3/3 15/2/5
289 f 12/1/1 16/2/2 18/3/3
290 f 19/1/10 20/2/11 21/3/3
291 f 22/1/12 21/3/3 23/2/13
292 f 19/1/10 21/3/3 24/2/14
293 f 22/1/12 25/2/15 21/3/3
294 f 26/1/16 23/2/13 21/3/3
295 f 27/1/17 21/3/3 25/2/15
296 f 26/1/16 21/3/3 20/2/11
297 f 27/1/17 24/2/14 21/3/3
298 f 27/4/17 19/5/10 24/6/14
299 f 19/5/10 26/7/16 20/8/11
300 f 23/9/13 26/7/16 22/10/12
301 f 27/4/17 25/11/15 22/10/12
302 f 27/4/17 22/10/12 19/5/10
303 f 22/10/12 26/7/16 19/5/10
304 f 28/10/18 29/7/19 30/5/20
305 f 31/4/21 28/10/18 30/5/20
306 f 31/4/21 32/11/22 28/10/18
307 f 33/9/23 29/7/19 28/10/18
308 f 30/5/20 29/7/19 34/8/24
309 f 31/4/21 30/5/20 35/6/25
310 f 31/1/21 35/2/25 36/3/3
311 f 29/1/19 36/3/3 34/2/24
312 f 31/1/21 36/3/3 32/2/22
313 f 29/1/19 33/2/23 36/3/3
314 f 28/1/18 32/2/22 36/3/3
315 f 30/1/20 36/3/3 35/2/25
316 f 28/1/18 36/3/3 33/2/23
317 f 30/1/20 34/2/24 36/3/3
318 f 37/1/26 38/2/27 39/3/3
319 f 40/1/28 39/3/3 41/2/29
320 f 37/1/26 39/3/3 42/2/30
321 f 40/1/28 43/2/31 39/3/3
322 f 44/1/32 41/2/29 39/3/3
323 f 45/1/33 39/3/3 43/2/31
324 f 44/1/32 39/3/3 38/2/27
325 f 45/1/33 42/2/30 39/3/3
326 f 45/4/33 37/5/26 42/6/30
327 f 37/5/26 44/7/32 38/8/27
328 f 41/9/29 44/7/32 40/10/28
329 f 45/4/33 43/11/31 40/10/28
330 f 45/4/33 40/10/28 37/5/26
331 f 40/10/28 44/7/32 37/5/26
332 f 46/9/34 47/8/35 48/11/36
333 f 47/8/35 49/6/37 48/11/36
334 f 50/9/38 46/8/34 51/11/39
335 f 46/8/34 48/6/36 51/11/39
336 f 47/9/35 52/6/40 49/11/37
337 f 53/8/41 52/6/40 47/9/35
338 f 46/9/34 50/8/38 47/11/35
339 f 50/8/38 53/6/41 47/11/35
340 f 48/11/36 49/9/37 51/6/39
341 f 49/9/37 52/8/40 51/6/39
342 f 54/11/42 55/12/43 56/13/44
343 f 55/12/43 57/8/38 56/13/44
344 f 58/11/41 59/8/45 60/6/41
345 f 61/9/45 59/8/45 58/11/41
346 f 56/8/44 59/6/45 54/9/42
347 f 59/6/45 61/11/45 54/9/42
348 f 60/8/41 57/6/38 58/9/41
349 f 57/6/38 55/11/43 58/9/41
350 f 62/14/41 63/15/38 64/16/41
351 f 63/15/38 65/17/43 64/16/41
352 f 66/14/44 67/15/45 68/16/42
353 f 67/15/45 69/17/45 68/16/42
354 f 64/16/41 67/15/45 62/14/41
355 f 69/17/45 67/15/45 64/16/41
356 f 68/16/42 65/17/43 66/14/44
357 f 65/17/43 63/15/38 66/14/44
358 f 70/16/46 71/14/46 72/17/39
359 f 71/14/46 73/15/39 72/17/39
360 f 70/16/46 74/17/47 71/14/46
361 f 74/17/47 75/15/47 71/14/46
362 f 76/16/48 77/17/45 78/14/48
363 f 77/17/45 79/15/45 78/14/48
364 f 76/16/48 78/14/48 80/17/41
365 f 78/14/48 81/15/41 80/17/41
366 f 73/14/39 82/15/49 72/16/39
367 f 82/15/49 83/17/49 72/16/39
368 f 75/14/47 74/16/47 84/15/50
369 f 74/16/47 85/17/50 84/15/50
370 f 79/14/45 77/16/45 82/15/49
371 f 77/16/45 83/17/49 82/15/49
372 f 81/14/41 84/15/50 80/16/41
373 f 84/15/50 85/17/50 80/16/41
374 f 86/14/41 87/15/50 88/16/41
375 f 87/15/50 89/17/50 88/16/41
376 f 90/14/45 91/16/45 92/15/49
377 f 91/16/45 93/17/49 92/15/49
378 f 94/14/47 95/16/47 87/15/50
379 f 95/16/47 89/17/50 87/15/50
380 f 96/14/39 92/15/49 97/16/39
381 f 92/15/49 93/17/49 97/16/39
382 f 98/16/48 99/14/48 88/17/41
383 f 99/14/48 86/15/41 88/17/41
384 f 98/16/48 91/17/45 99/14/48
385 f 91/17/45 90/15/45 99/14/48
386 f 100/16/46 95/17/47 101/14/46
387 f 95/17/47 94/15/47 101/14/46
388 f 100/16/46 101/14/46 97/17/39
389 f 101/14/46 96/15/39 97/17/39
390 f 102/18/41 103/19/51 104/15/41
391 f 103/19/51 105/14/52 104/15/41
392 f 106/18/45 107/15/45 108/19/53
393 f 107/15/45 109/14/40 108/19/53
394 f 110/18/47 111/15/47 112/19/38
395 f 111/15/47 113/14/43 112/19/38
396 f 114/18/39 115/19/42 116/15/39
397 f 115/19/42 117/14/44 116/15/39
398 f 118/20/51 119/18/52 104/14/41
399 f 119/18/52 102/21/41 104/14/41
400 f 120/20/53 107/14/45 121/18/40
401 f 107/14/45 106/21/45 121/18/40
402 f 122/20/38 111/14/47 123/18/43
403 f 111/14/47 110/21/47 123/18/43
404 f 124/20/42 125/18/44 116/14/39
405 f 125/18/44 114/21/39 116/14/39
406 f 126/22/43 127/23/38 118/24/51
407 f 127/23/38 119/25/52 118/24/51
408 f 128/22/44 120/24/53 129/23/42
409 f 120/24/53 121/25/40 129/23/42
410 f 130/22/52 122/24/38 131/23/51
411 f 122/24/38 123/25/43 131/23/51
412 f 132/22/40 133/23/53 124/24/42
413 f 133/23/53 125/25/44 124/24/42
414 f 103/26/51 134/27/45 105/28/52
415 f 134/27/45 135/29/45 105/28/52
416 f 108/26/53 109/28/40 136/27/41
417 f 109/28/40 137/29/41 136/27/41
418 f 112/26/38 113/28/43 138/27/39
419 f 113/28/43 139/29/39 138/27/39
420 f 115/26/42 140/27/47 117/28/44
421 f 140/27/47 141/29/47 117/28/44
422 f 127/19/38 126/14/43 142/18/54
423 f 126/14/43 143/15/42 142/18/54
424 f 129/19/42 144/18/55 128/14/44
425 f 144/18/55 145/15/38 128/14/44
426 f 131/19/51 146/18/56 130/14/52
427 f 146/18/56 147/15/53 130/14/52
428 f 133/19/53 132/14/40 148/18/57
429 f 132/14/40 149/15/51 148/18/57
430 f 143/14/42 134/18/45 142/19/54
431 f 135/15/45 134/18/45 143/14/42
432 f 145/14/38 136/18/41 137/15/41
433 f 144/19/55 136/18/41 145/14/38
434 f 147/14/53 138/18/39 139/15/39
435 f 146/19/56 138/18/39 147/14/53
436 f 149/14/51 140/18/47 148/19/57
437 f 141/15/47 140/18/47 149/14/51
438 f 144/6/55 148/8/57 142/11/54
439 f 148/8/57 146/9/56 142/11/54
440 f 150/6/58 144/8/55 151/11/59
441 f 144/8/55 142/9/54 151/11/59
442 f 152/6/60 151/9/59 153/11/61
443 f 150/8/58 151/9/59 152/6/60
444 f 148/6/57 152/8/60 146/11/56
445 f 152/8/60 153/9/61 146/11/56
446 f 144/6/55 152/9/60 148/11/57
447 f 150/8/58 152/9/60 144/6/55
448 f 142/6/54 146/8/56 151/11/59
449 f 146/8/56 153/9/61 151/11/59
450 f 154/19/47 155/14/47 156/30/44
451 f 155/14/47 157/31/42 156/30/44
452 f 158/31/52 159/19/45 160/14/45
453 f 161/30/51 159/19/45 158/31/52
454 f 155/31/47 161/19/51 158/14/52
455 f 154/30/47 161/19/51 155/31/47
456 f 157/14/42 159/30/45 156/19/44
457 f 160/31/45 159/30/45 157/14/42
File base/pagoda.png added (mode: 100644) (index 0000000..7890dcf)
File base/paused.png added (mode: 100644) (index 0000000..2868254)
File base/wall.png added (mode: 100644) (index 0000000..41c35cb)
File include/dvector.h added (mode: 100644) (index 0000000..62ff543)
1 /*
2 dvector.h - Portable, single-file, 2D/3D vector/quaternion/matrix math library, originally based on ccVector
3
4 To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring
5 rights to this software to the public domain worldwide. This software is distributed without any warranty.
6 You should have received a copy of the CC0 Public Domain Dedication along with this software.
7 If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
8 */
9
10 /*
11 dvector supports the following three configurations:
12 #define DVECTOR_EXTERN
13 Default, should be used when using dvector in multiple compilation units within the same project.
14 #define DVECTOR_IMPLEMENTATION
15 Must be defined in exactly one source file within a project for dvector to be found by the linker.
16 #define DVECTOR_STATIC
17 Defines all dvector functions as static, useful if dvector is only used in a single compilation unit.
18
19 dvector supports the following additional options:
20 #define DVECTOR_DOUBLE
21 Configures dvector to use double instead of the default float. Cannot use both float and double versions in the same compilation unit.
22 #define DVECTOR_ISOC
23 Changes the way dvector types are defined for compatibility with ISO C99. Only affects convenience without limiting functionality.
24
25 dvector types:
26 Supports vec2, vec3, vec4, quat, mat2, mat3, and mat4 types with various property aliases for flexible use and concise code.
27 Each of the above types comes with a TYPE_ZERO and TYPE_IDEN (for quat and matrix types) constant which translates to a literal.
28 Function-like macros of the form TYPE(...) also exist and are meant to provide a concise alternative to typing out literals.
29 The auxiliary frst type supports frustum generation from a projview matrix and simple frustum culling of bounding volumes.
30
31 dvector functions:
32 Provided functions should be reasonably self-explanatory, and use of macros was deliberately kept low for better readability.
33 All equality functions use direct comparison (no epsilon), therefore floating point errors may break equality for some values.
34 All quat functions should return normalized quats, occasional normalization is recommended due to float error accumulation.
35 All angles are in radians. Frustum culling of volumes returns 1 for volumes inside the frustum, 0 for volumes outside it.
36 All coordinate systems are right-handed unless otherwise noted. Projection functions assume OpenGL-style screen space.
37 */
38
39 //header section
40 #ifndef DVECTOR_H
41 #define DVECTOR_H
42
43 //process configuration
44 #ifdef DVECTOR_STATIC
45 #define DVECTOR_IMPLEMENTATION
46 #define DVDEF static
47 #else //DVECTOR_EXTERN
48 #define DVDEF extern
49 #endif
50
51 /*
52 Use the below macros and constants for function parameters and variable
53 definitions in local scope. To initialize globals, use naked literals.
54 Example:
55 vec3 default_position = {0, 0, 0};
56 void foo(){
57 bar(VEC3_ZERO);
58 }
59 */
60
61 //macros
62 #ifdef DVECTOR_ISOC
63 #define VEC2(X, Y) (vec2){X, Y}
64 #define VEC3(X, Y, Z) (vec3){X, Y, Z}
65 #define VEC4(X, Y, Z, W) (vec4){X, Y, Z, W}
66 #define QUAT(X, Y, Z, W) (quat){X, Y, Z, W}
67 #else
68 #define VEC2(X, Y) (vec2){{X, Y}}
69 #define VEC3(X, Y, Z) (vec3){{X, Y, Z}}
70 #define VEC4(X, Y, Z, W) (vec4){{X, Y, Z, W}}
71 #define QUAT(X, Y, Z, W) (quat){{X, Y, Z, W}}
72 #endif
73 #define MAT2(M00, M01, M10, M11) (mat2){{{M00, M01}, {M10, M11}}}
74 #define MAT3(M00, M01, M02, M10, M11, M12, M20, M21, M22) (mat3){{{M00, M01, M02}, {M10, M11, M12}, {M20, M21, M22}}}
75 #define MAT4(M00, M01, M02, M03, M10, M11, M12, M13, M20, M21, M22, M23, M30, M31, M32, M33) \
76 (mat4){{{M00, M01, M02, M03}, {M10, M11, M12, M13}, {M20, M21, M22, M23}, {M30, M31, M32, M33}}}
77
78 //constants
79 #define VEC2_ZERO VEC2(0, 0)
80 #define VEC3_ZERO VEC3(0, 0, 0)
81 #define VEC4_ZERO VEC4(0, 0, 0, 0)
82 #define QUAT_IDEN QUAT(0, 0, 0, 1)
83 #define MAT2_ZERO MAT2(0, 0, 0, 0)
84 #define MAT2_IDEN MAT2(1, 0, 0, 1)
85 #define MAT3_ZERO MAT3(0, 0, 0, 0, 0, 0, 0, 0, 0)
86 #define MAT3_IDEN MAT3(1, 0, 0, 0, 1, 0, 0, 0, 1)
87 #define MAT4_ZERO MAT4(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
88 #define MAT4_IDEN MAT4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)
89
90 //math configuration
91 #include <math.h>
92 #ifdef DVECTOR_DOUBLE
93 #define DVTYPE double
94 #define DVCOS cos
95 #define DVSIN sin
96 #define DVTAN tan
97 #define DVACOS acos
98 #define DVHYPOT hypot
99 #else
100 #define DVTYPE float
101 #define DVCOS cosf
102 #define DVSIN sinf
103 #define DVTAN tanf
104 #define DVACOS acosf
105 #define DVHYPOT hypotf
106 #endif
107
108 //types
109 #ifdef DVECTOR_ISOC
110 typedef struct vec2 {
111 DVTYPE x, y;
112 } vec2;
113 typedef struct vec3 {
114 DVTYPE x, y, z;
115 } vec3;
116 typedef struct vec4 {
117 DVTYPE x, y, z, w;
118 } vec4, quat;
119 typedef union mat2 {
120 DVTYPE m[2][2];
121 vec2 col[2];
122 } mat2;
123 typedef union mat3 {
124 DVTYPE m[3][3];
125 vec3 col[3];
126 } mat3;
127 typedef union mat4 {
128 DVTYPE m[4][4];
129 vec4 col[4];
130 } mat4;
131 typedef union frst {
132 DVTYPE f[24];
133 vec4 pln[6];
134 } frst;
135 #else
136 typedef union vec2 {
137 DVTYPE v[2];
138 struct {DVTYPE x, y;};
139 } vec2;
140 typedef union vec3 {
141 DVTYPE v[3];
142 struct {DVTYPE x, y, z;};
143 struct {vec2 xy; DVTYPE _z;};
144 struct {DVTYPE _x; vec2 yz;};
145 } vec3;
146 typedef union vec4 {
147 DVTYPE v[4];
148 struct {DVTYPE x, y, z, w;};
149 struct {vec3 xyz; DVTYPE _w;};
150 struct {DVTYPE _x; vec3 yzw;};
151 struct {vec2 xy; vec2 zw;};
152 struct {DVTYPE __x; vec2 yz; DVTYPE __w;};
153 } vec4, quat;
154 typedef union mat2 {
155 DVTYPE m[2][2];
156 struct {DVTYPE m00, m01, m10, m11;};
157 vec2 col[2];
158 struct {vec2 col0, col1;};
159 } mat2;
160 typedef union mat3 {
161 DVTYPE m[3][3];
162 struct {DVTYPE m00, m01, m02, m10, m11, m12, m20, m21, m22;};
163 vec3 col[3];
164 struct {vec3 col0, col1, col2;};
165 } mat3;
166 typedef union mat4 {
167 DVTYPE m[4][4];
168 struct {DVTYPE m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33;};
169 vec4 col[4];
170 struct {vec4 col0, col1, col2, col3;};
171 } mat4;
172 typedef union frst {
173 DVTYPE f[24];
174 vec4 pln[6];
175 struct {vec4 left, right, top, bottom, near, far;};
176 } frst;
177 #endif
178
179 //vec2 function declarations
180 DVDEF DVTYPE vec2Length(vec2);
181 DVDEF DVTYPE vec2DotProduct(vec2, vec2);
182 DVDEF vec2 vec2Negate(vec2);
183 DVDEF vec2 vec2Normalize(vec2);
184 DVDEF vec2 vec2Multiply(vec2, DVTYPE);
185 DVDEF vec2 vec2Divide(vec2, DVTYPE);
186 DVDEF vec2 vec2Rotate(vec2, DVTYPE);
187 DVDEF vec2 vec2RotateXZ(vec2, DVTYPE);
188 DVDEF vec2 vec2Add(vec2, vec2);
189 DVDEF vec2 vec2Subtract(vec2, vec2);
190 DVDEF vec2 vec2Reflect(vec2, vec2);
191 DVDEF vec2 vec2Mix(vec2, vec2, DVTYPE);
192 DVDEF int vec2Equal(vec2, vec2);
193
194 //vec3 function declarations
195 DVDEF DVTYPE vec3Length(vec3);
196 DVDEF DVTYPE vec3DotProduct(vec3, vec3);
197 DVDEF vec2 vec3GetXZ(vec3);
198 DVDEF vec3 vec3Negate(vec3);
199 DVDEF vec3 vec3Normalize(vec3);
200 DVDEF vec3 vec3Multiply(vec3, DVTYPE);
201 DVDEF vec3 vec3Divide(vec3, DVTYPE);
202 DVDEF vec3 vec3Add(vec3, vec3);
203 DVDEF vec3 vec3Subtract(vec3, vec3);
204 DVDEF vec3 vec3Reflect(vec3, vec3);
205 DVDEF vec3 vec3CrossProduct(vec3, vec3);
206 DVDEF vec3 vec3Mix(vec3, vec3, DVTYPE);
207 DVDEF int vec3Equal(vec3, vec3);
208
209 //vec4 function declarations
210 DVDEF vec3 vec4GetXYZ(vec4);
211 DVDEF DVTYPE vec4Length(vec4);
212 DVDEF DVTYPE vec4DotProduct(vec4, vec4);
213 DVDEF vec4 vec4Negate(vec4);
214 DVDEF vec4 vec4Normalize(vec4);
215 DVDEF vec4 vec4Multiply(vec4, DVTYPE);
216 DVDEF vec4 vec4Divide(vec4, DVTYPE);
217 DVDEF vec4 vec4Add(vec4, vec4);
218 DVDEF vec4 vec4Subtract(vec4, vec4);
219 DVDEF vec4 vec4Reflect(vec4, vec4);
220 DVDEF vec4 vec4Mix(vec4, vec4, DVTYPE);
221 DVDEF int vec4Equal(vec4, vec4);
222
223 //quat function declarations
224 DVDEF vec3 quatGetXYZ(quat);
225 DVDEF vec3 quatMultiplyVector(quat, vec3);
226 DVDEF quat quatAxisAngle(vec3, DVTYPE);
227 DVDEF quat quatEulerXYZ(DVTYPE, DVTYPE, DVTYPE);
228 DVDEF quat quatEulerXZY(DVTYPE, DVTYPE, DVTYPE);
229 DVDEF quat quatEulerYXZ(DVTYPE, DVTYPE, DVTYPE);
230 DVDEF quat quatEulerYZX(DVTYPE, DVTYPE, DVTYPE);
231 DVDEF quat quatEulerZXY(DVTYPE, DVTYPE, DVTYPE);
232 DVDEF quat quatEulerZYX(DVTYPE, DVTYPE, DVTYPE);
233 DVDEF quat quatNormalize(quat);
234 DVDEF quat quatConjugate(quat);
235 DVDEF quat quatLerp(quat, quat, DVTYPE);
236 DVDEF quat quatSlerp(quat, quat, DVTYPE);
237 DVDEF quat quatMultiply(quat, quat);
238 DVDEF int quatEqual(quat, quat);
239
240 //mat2 function declarations
241 DVDEF vec2 mat2MultiplyVector(mat2, vec2);
242 DVDEF mat2 mat2Transpose(mat2);
243 DVDEF mat2 mat2Inverse(mat2);
244 DVDEF mat2 mat2MultiplyScalar(mat2, DVTYPE);
245 DVDEF mat2 mat2MultiplyMatrix(mat2, mat2);
246 DVDEF mat2 mat2Add(mat2, mat2);
247 DVDEF mat2 mat2Subtract(mat2, mat2);
248 DVDEF int mat2Equal(mat2, mat2);
249
250 //mat3 function declarations
251 DVDEF vec3 mat3MultiplyVector(mat3, vec3);
252 DVDEF mat3 mat3SetRotation(DVTYPE);
253 DVDEF mat3 mat3SetScale(DVTYPE);
254 DVDEF mat3 mat3SetScaleXY(vec2);
255 DVDEF mat3 mat3SetTranslation(vec2);
256 DVDEF mat3 mat3Transpose(mat3);
257 DVDEF mat3 mat3Inverse(mat3);
258 DVDEF mat3 mat3MultiplyScalar(mat3, DVTYPE);
259 DVDEF mat3 mat3Rotate(mat3, DVTYPE);
260 DVDEF mat3 mat3Scale(mat3, DVTYPE);
261 DVDEF mat3 mat3ScaleXY(mat3, vec2);
262 DVDEF mat3 mat3Translate(mat3, vec2);
263 DVDEF mat3 mat3MultiplyMatrix(mat3, mat3);
264 DVDEF mat3 mat3Add(mat3, mat3);
265 DVDEF mat3 mat3Subtract(mat3, mat3);
266 DVDEF int mat3Equal(mat3, mat3);
267
268 //mat4 function declarations
269 DVDEF vec4 mat4MultiplyVector(mat4, vec4);
270 DVDEF mat4 mat4SetRotationX(DVTYPE);
271 DVDEF mat4 mat4SetRotationY(DVTYPE);
272 DVDEF mat4 mat4SetRotationZ(DVTYPE);
273 DVDEF mat4 mat4SetRotationQuaternion(quat);
274 DVDEF mat4 mat4SetScale(DVTYPE);
275 DVDEF mat4 mat4SetScaleXYZ(vec3);
276 DVDEF mat4 mat4SetTranslation(vec3);
277 DVDEF mat4 mat4LookAt(vec3, vec3, vec3);
278 DVDEF mat4 mat4Perspective(DVTYPE, DVTYPE, DVTYPE, DVTYPE);
279 DVDEF mat4 mat4Ortho(DVTYPE, DVTYPE, DVTYPE, DVTYPE, DVTYPE, DVTYPE);
280 DVDEF mat4 mat4Transpose(mat4);
281 DVDEF mat4 mat4Inverse(mat4);
282 DVDEF mat4 mat4MultiplyScalar(mat4, DVTYPE);
283 DVDEF mat4 mat4RotateX(mat4, DVTYPE);
284 DVDEF mat4 mat4RotateY(mat4, DVTYPE);
285 DVDEF mat4 mat4RotateZ(mat4, DVTYPE);
286 DVDEF mat4 mat4RotateQuaternion(mat4, quat);
287 DVDEF mat4 mat4Scale(mat4, DVTYPE);
288 DVDEF mat4 mat4ScaleXYZ(mat4, vec3);
289 DVDEF mat4 mat4Translate(mat4, vec3);
290 DVDEF mat4 mat4MultiplyMatrix(mat4, mat4);
291 DVDEF mat4 mat4Add(mat4, mat4);
292 DVDEF mat4 mat4Subtract(mat4, mat4);
293 DVDEF int mat4Equal(mat4, mat4);
294
295 //frst function declarations
296 DVDEF frst frstFromMatrix(mat4);
297 DVDEF int frstCullSphere(frst, vec3, DVTYPE);
298 DVDEF int frstCullAABB(frst, vec3, vec3);
299
300 #endif //DVECTOR_H
301
302 //implementation section
303 #ifdef DVECTOR_IMPLEMENTATION
304 #undef DVECTOR_IMPLEMENTATION
305
306 //vec2 functions
307 DVDEF DVTYPE vec2Length (vec2 v) {
308 return DVHYPOT(v.x, v.y);
309 }
310 DVDEF DVTYPE vec2DotProduct (vec2 v1, vec2 v2) {
311 return v1.x*v2.x + v1.y*v2.y;
312 }
313 DVDEF vec2 vec2Negate (vec2 v) {
314 return VEC2(-v.x, -v.y);
315 }
316 DVDEF vec2 vec2Normalize (vec2 v) {
317 return vec2Divide(v, vec2Length(v));
318 }
319 DVDEF vec2 vec2Multiply (vec2 v, DVTYPE s) {
320 return VEC2(v.x*s, v.y*s);
321 }
322 DVDEF vec2 vec2Divide (vec2 v, DVTYPE s) {
323 return VEC2(v.x/s, v.y/s);
324 }
325 DVDEF vec2 vec2Rotate (vec2 v, DVTYPE r) {
326 DVTYPE c = DVCOS(r), s = DVSIN(r);
327 return VEC2(v.x*c-v.y*s, v.y*c+v.x*s);
328 }
329 DVDEF vec2 vec2RotateXZ (vec2 v, DVTYPE r) {
330 DVTYPE c = DVCOS(r), s = DVSIN(r);
331 return VEC2(v.x*c+v.y*s, v.y*c-v.x*s);
332 }
333 DVDEF vec2 vec2Add (vec2 v1, vec2 v2) {
334 return VEC2(v1.x+v2.x, v1.y+v2.y);
335 }
336 DVDEF vec2 vec2Subtract (vec2 v1, vec2 v2) {
337 return VEC2(v1.x-v2.x, v1.y-v2.y);
338 }
339 DVDEF vec2 vec2Reflect (vec2 v1, vec2 v2) {
340 return vec2Subtract(v1, vec2Multiply(v2, 2*vec2DotProduct(v1, v2)));
341 }
342 DVDEF vec2 vec2Mix (vec2 v1, vec2 v2, DVTYPE s) {
343 return VEC2(v1.x+(v2.x-v1.x)*s, v1.y+(v2.y-v1.y)*s);
344 }
345 DVDEF int vec2Equal (vec2 v1, vec2 v2) {
346 return (v1.x == v2.x)&&(v1.y == v2.y);
347 }
348
349 //vec3 functions
350 DVDEF DVTYPE vec3Length (vec3 v) {
351 return DVHYPOT(DVHYPOT(v.x, v.y), v.z);
352 }
353 DVDEF DVTYPE vec3DotProduct (vec3 v1, vec3 v2) {
354 return v1.x*v2.x + v1.y*v2.y + v1.z*v2.z;
355 }
356 DVDEF vec2 vec3GetXZ (vec3 v) {
357 return VEC2(v.x, v.z);
358 }
359 DVDEF vec3 vec3Negate (vec3 v) {
360 return VEC3(-v.x, -v.y, -v.z);
361 }
362 DVDEF vec3 vec3Normalize (vec3 v) {
363 return vec3Divide(v, vec3Length(v));
364 }
365 DVDEF vec3 vec3Multiply (vec3 v, DVTYPE s) {
366 return VEC3(v.x*s, v.y*s, v.z*s);
367 }
368 DVDEF vec3 vec3Divide (vec3 v, DVTYPE s) {
369 return VEC3(v.x/s, v.y/s, v.z/s);
370 }
371 DVDEF vec3 vec3Add (vec3 v1, vec3 v2) {
372 return VEC3(v1.x+v2.x, v1.y+v2.y, v1.z+v2.z);
373 }
374 DVDEF vec3 vec3Subtract (vec3 v1, vec3 v2) {
375 return VEC3(v1.x-v2.x, v1.y-v2.y, v1.z-v2.z);
376 }
377 DVDEF vec3 vec3Reflect (vec3 v1, vec3 v2) {
378 return vec3Subtract(v1, vec3Multiply(v2, 2*vec3DotProduct(v1, v2)));
379 }
380 DVDEF vec3 vec3CrossProduct (vec3 v1, vec3 v2) {
381 return VEC3(v1.y*v2.z - v1.z*v2.y, v1.z*v2.x - v1.x*v2.z, v1.x*v2.y - v1.y*v2.x);
382 }
383 DVDEF vec3 vec3Mix (vec3 v1, vec3 v2, DVTYPE s) {
384 return VEC3(v1.x+(v2.x-v1.x)*s, v1.y+(v2.y-v1.y)*s, v1.z+(v2.z-v1.z)*s);
385 }
386 DVDEF int vec3Equal (vec3 v1, vec3 v2) {
387 return (v1.x == v2.x)&&(v1.y == v2.y)&&(v1.z == v2.z);
388 }
389
390
391 //vec4 functions
392 DVDEF vec3 vec4GetXYZ (vec4 v) {
393 return VEC3(v.x, v.y, v.z);
394 }
395 DVDEF DVTYPE vec4Length (vec4 v) {
396 return DVHYPOT(DVHYPOT(v.x, v.y), DVHYPOT(v.z, v.w));
397 }
398 DVDEF DVTYPE vec4DotProduct (vec4 v1, vec4 v2) {
399 return v1.x*v2.x + v1.y*v2.y + v1.z*v2.z + v1.w*v2.w;
400 }
401 DVDEF vec4 vec4Negate (vec4 v) {
402 return VEC4(-v.x, -v.y, -v.z, -v.w);
403 }
404 DVDEF vec4 vec4Normalize (vec4 v) {
405 return vec4Divide(v, vec4Length(v));
406 }
407 DVDEF vec4 vec4Multiply (vec4 v, DVTYPE s) {
408 return VEC4(v.x*s, v.y*s, v.z*s, v.w*s);
409 }
410 DVDEF vec4 vec4Divide (vec4 v, DVTYPE s) {
411 return VEC4(v.x/s, v.y/s, v.z/s, v.w/s);
412 }
413 DVDEF vec4 vec4Add (vec4 v1, vec4 v2) {
414 return VEC4(v1.x+v2.x, v1.y+v2.y, v1.z+v2.z, v1.w+v2.w);
415 }
416 DVDEF vec4 vec4Subtract (vec4 v1, vec4 v2) {
417 return VEC4(v1.x-v2.x, v1.y-v2.y, v1.z-v2.z, v1.w-v2.w);
418 }
419 DVDEF vec4 vec4Reflect (vec4 v1, vec4 v2) {
420 return vec4Subtract(v1, vec4Multiply(v2, 2*vec4DotProduct(v1, v2)));
421 }
422 DVDEF vec4 vec4Mix (vec4 v1, vec4 v2, DVTYPE s) {
423 return VEC4(v1.x+(v2.x-v1.x)*s, v1.y+(v2.y-v1.y)*s, v1.z+(v2.z-v1.z)*s, v1.w+(v2.w-v1.w)*s);
424 }
425 DVDEF int vec4Equal (vec4 v1, vec4 v2) {
426 return (v1.x == v2.x)&&(v1.y == v2.y)&&(v1.z == v2.z)&&(v1.w == v2.w);
427 }
428
429 //quat functions
430 DVDEF vec3 quatGetXYZ (quat q) {
431 return VEC3(q.x, q.y, q.z);
432 }
433 DVDEF vec3 quatMultiplyVector (quat q, vec3 v) {
434 vec3 q_xyz = VEC3(q.x, q.y, q.z);
435 vec3 t = vec3Multiply(vec3CrossProduct(q_xyz, v), 2);
436 return vec3Add(vec3Add(v, vec3Multiply(t, q.w)), vec3CrossProduct(q_xyz, t));
437 }
438 DVDEF quat quatAxisAngle (vec3 a, DVTYPE r) {
439 DVTYPE s = DVSIN(r/2);
440 return QUAT(a.x*s, a.y*s, a.z*s, DVCOS(r/2));
441 }
442 DVDEF quat quatEulerXYZ (DVTYPE a, DVTYPE b, DVTYPE c) {
443 return quatMultiply(quatAxisAngle(VEC3(0, 0, 1), c), quatMultiply(quatAxisAngle(VEC3(0, 1, 0), b), quatAxisAngle(VEC3(1, 0, 0), a)));
444 }
445 DVDEF quat quatEulerXZY (DVTYPE a, DVTYPE b, DVTYPE c) {
446 return quatMultiply(quatAxisAngle(VEC3(0, 1, 0), c), quatMultiply(quatAxisAngle(VEC3(0, 0, 1), b), quatAxisAngle(VEC3(1, 0, 0), a)));
447 }
448 DVDEF quat quatEulerYXZ (DVTYPE a, DVTYPE b, DVTYPE c) {
449 return quatMultiply(quatAxisAngle(VEC3(0, 0, 1), c), quatMultiply(quatAxisAngle(VEC3(1, 0, 0), b), quatAxisAngle(VEC3(0, 1, 0), a)));
450 }
451 DVDEF quat quatEulerYZX (DVTYPE a, DVTYPE b, DVTYPE c) {
452 return quatMultiply(quatAxisAngle(VEC3(1, 0, 0), c), quatMultiply(quatAxisAngle(VEC3(0, 0, 1), b), quatAxisAngle(VEC3(0, 1, 0), a)));
453 }
454 DVDEF quat quatEulerZXY (DVTYPE a, DVTYPE b, DVTYPE c) {
455 return quatMultiply(quatAxisAngle(VEC3(0, 1, 0), c), quatMultiply(quatAxisAngle(VEC3(1, 0, 0), b), quatAxisAngle(VEC3(0, 0, 1), a)));
456 }
457 DVDEF quat quatEulerZYX (DVTYPE a, DVTYPE b, DVTYPE c) {
458 return quatMultiply(quatAxisAngle(VEC3(1, 0, 0), c), quatMultiply(quatAxisAngle(VEC3(0, 1, 0), b), quatAxisAngle(VEC3(0, 0, 1), a)));
459 }
460 DVDEF quat quatNormalize (quat q) {
461 return vec4Normalize(q);
462 }
463 DVDEF quat quatConjugate (quat q) {
464 return QUAT(-q.x, -q.y, -q.z, q.w);
465 }
466 DVDEF quat quatLerp (quat q1, quat q2, DVTYPE s) {
467 return quatNormalize(QUAT((1-s)*q1.x + s*q2.x, (1-s)*q1.y + s*q2.y, (1-s)*q1.z + s*q2.z, (1-s)*q1.w + s*q2.w));
468 }
469 DVDEF quat quatSlerp (quat q1, quat q2, DVTYPE s) {
470 DVTYPE th = DVACOS(q1.x*q2.x + q1.y*q2.y + q1.z*q2.z + q1.w*q2.w), sn = DVSIN(th), wa = DVSIN((1-s)*th)/sn, wb = DVSIN(s*th)/sn;
471 return quatNormalize(QUAT(wa*q1.x + wb*q2.x, wa*q1.y + wb*q2.y, wa*q1.z + wb*q2.z, wa*q1.w + wb*q2.w));
472 }
473 DVDEF quat quatMultiply (quat q1, quat q2) {
474 return QUAT(q1.x*q2.w + q1.y*q2.z - q1.z*q2.y + q1.w*q2.x, -q1.x*q2.z + q1.y*q2.w + q1.z*q2.x + q1.w*q2.y,
475 q1.x*q2.y - q1.y*q2.x + q1.z*q2.w + q1.w*q2.z, -q1.x*q2.x - q1.y*q2.y - q1.z*q2.z + q1.w*q2.w);
476 }
477 DVDEF int quatEqual (quat q1, quat q2) {
478 return (q1.x == q2.x)&&(q1.y == q2.y)&&(q1.z == q2.z)&&(q1.w == q2.w);
479 }
480
481 //mat2 functions
482 DVDEF vec2 mat2MultiplyVector (mat2 m, vec2 v) {
483 return VEC2(m.m[0][0]*v.x + m.m[1][0]*v.y, m.m[0][1]*v.x + m.m[1][1]*v.y);
484 }
485 DVDEF mat2 mat2Transpose (mat2 m) {
486 return MAT2(m.m[0][0], m.m[1][0], m.m[0][1], m.m[1][1]);
487 }
488 DVDEF mat2 mat2Inverse (mat2 m) {
489 return mat2MultiplyScalar(MAT2(m.m[1][1], -m.m[0][1], -m.m[1][0], m.m[0][0]), 1/(m.m[0][0]*m.m[1][1]-m.m[1][0]*m.m[0][1]));
490 }
491 DVDEF mat2 mat2MultiplyScalar (mat2 m, DVTYPE s) {
492 return MAT2(m.m[0][0]*s, m.m[0][1]*s, m.m[1][0]*s, m.m[1][1]*s);
493 }
494 DVDEF mat2 mat2MultiplyMatrix (mat2 m1, mat2 m2) {
495 mat2 m;
496 for (int i = 0; i < 2; i++)
497 for (int j = 0; j < 2; j++)
498 m.m[i][j] = m1.m[i][0]*m2.m[0][j] + m1.m[i][1]*m2.m[1][j];
499 return m;
500 }
501 DVDEF mat2 mat2Add (mat2 m1, mat2 m2) {
502 return MAT2(m1.m[0][0]+m2.m[0][0], m1.m[0][1]+m2.m[0][1], m1.m[1][0]+m2.m[1][0], m1.m[1][1]+m2.m[1][1]);
503 }
504 DVDEF mat2 mat2Subtract (mat2 m1, mat2 m2) {
505 return MAT2(m1.m[0][0]-m2.m[0][0], m1.m[0][1]-m2.m[0][1], m1.m[1][0]-m2.m[1][0], m1.m[1][1]-m2.m[1][1]);
506 }
507 DVDEF int mat2Equal (mat2 m1, mat2 m2) {
508 return (m1.m[0][0] == m2.m[0][0])&&(m1.m[0][1] == m2.m[0][1])&&(m1.m[1][0] == m2.m[1][0])&&(m1.m[1][1] == m2.m[1][1]);
509 }
510
511 //mat3 function declarations
512 DVDEF vec3 mat3MultiplyVector (mat3 m, vec3 v) {
513 DVTYPE r[3];
514 for (int i = 0; i < 3; i++)
515 r[i] = m.m[0][i]*v.x + m.m[1][i]*v.y + m.m[2][i]*v.z;
516 return VEC3(r[0], r[1], r[2]);
517 }
518 DVDEF mat3 mat3SetRotation (DVTYPE r) {
519 DVTYPE c = DVCOS(r), s = DVSIN(r);
520 return MAT3(c, s, 0, -s, c, 0, 0, 0, 1);
521 }
522 DVDEF mat3 mat3SetScale (DVTYPE s) {
523 return MAT3(s, 0, 0, 0, s, 0, 0, 0, 1);
524 }
525 DVDEF mat3 mat3SetScaleXY (vec2 s) {
526 return MAT3(s.x, 0, 0, 0, s.y, 0, 0, 0, 1);
527 }
528 DVDEF mat3 mat3SetTranslation (vec2 v) {
529 return MAT3(1, 0, 0, 0, 1, 0, v.x, v.y, 1);
530 }
531 DVDEF mat3 mat3Transpose (mat3 m) {
532 return MAT3(m.m[0][0], m.m[1][0], m.m[2][0], m.m[0][1], m.m[1][1], m.m[2][1], m.m[0][2], m.m[1][2], m.m[2][2]);
533 }
534 DVDEF mat3 mat3Inverse (mat3 m) {
535 mat3 t = MAT3(m.m[1][1]*m.m[2][2] - m.m[2][1]*m.m[1][2], m.m[1][2]*m.m[2][0] - m.m[1][0]*m.m[2][2], m.m[1][0]*m.m[2][1] - m.m[1][1]*m.m[2][0],
536 m.m[2][1]*m.m[0][2] - m.m[0][1]*m.m[2][2], m.m[0][0]*m.m[2][2] - m.m[0][2]*m.m[2][0], m.m[0][1]*m.m[2][0] - m.m[0][0]*m.m[2][1],
537 m.m[0][1]*m.m[1][2] - m.m[1][1]*m.m[0][2], m.m[0][2]*m.m[1][0] - m.m[0][0]*m.m[1][2], m.m[0][0]*m.m[1][1] - m.m[0][1]*m.m[1][0]);
538 return mat3MultiplyScalar(t, 1/(m.m[0][0]*t.m[0][0] + m.m[1][0]*t.m[1][0] + m.m[2][0]*t.m[2][0]));
539 }
540 DVDEF mat3 mat3MultiplyScalar (mat3 m, DVTYPE s) {
541 for (int i = 0; i < 3; i++)
542 for (int j = 0; j < 3; j++)
543 m.m[i][j] *= s;
544 return m;
545 }
546 DVDEF mat3 mat3Rotate (mat3 m, DVTYPE r) {
547 return mat3MultiplyMatrix(m, mat3SetRotation(r));
548 }
549 DVDEF mat3 mat3Scale (mat3 m, DVTYPE s) {
550 return mat3MultiplyMatrix(m, mat3SetScale(s));
551 }
552 DVDEF mat3 mat3ScaleXY (mat3 m, vec2 v) {
553 return mat3MultiplyMatrix(m, mat3SetScaleXY(v));
554 }
555 DVDEF mat3 mat3Translate (mat3 m, vec2 v) {
556 return mat3MultiplyMatrix(m, mat3SetTranslation(v));
557 }
558 DVDEF mat3 mat3MultiplyMatrix (mat3 m1, mat3 m2) {
559 mat3 m;
560 for (int i = 0; i < 3; i++)
561 for (int j = 0; j < 3; j++)
562 m.m[i][j] = m1.m[i][0]*m2.m[0][j] + m1.m[i][1]*m2.m[1][j] + m1.m[i][2]*m2.m[2][j];
563 return m;
564 }
565 DVDEF mat3 mat3Add (mat3 m1, mat3 m2) {
566 mat3 m;
567 for (int i = 0; i < 3; i++)
568 for (int j = 0; j < 3; j++)
569 m.m[i][j] = m1.m[i][j] + m2.m[i][j];
570 return m;
571 }
572 DVDEF mat3 mat3Subtract (mat3 m1, mat3 m2) {
573 mat3 m;
574 for (int i = 0; i < 3; i++)
575 for (int j = 0; j < 3; j++)
576 m.m[i][j] = m1.m[i][j] - m2.m[i][j];
577 return m;
578 }
579 DVDEF int mat3Equal (mat3 m1, mat3 m2) {
580 for (int i = 0; i < 3; i++)
581 for (int j = 0; j < 3; j++)
582 if (m1.m[i][j] != m2.m[i][j])
583 return 0;
584 return 1;
585 }
586
587 //mat4 function declarations
588 DVDEF vec4 mat4MultiplyVector (mat4 m, vec4 v) {
589 DVTYPE r[4];
590 for (int i = 0; i < 4; i++)
591 r[i] = m.m[0][i]*v.x + m.m[1][i]*v.y + m.m[2][i]*v.z + m.m[3][i]*v.w;
592 return VEC4(r[0], r[1], r[2], r[3]);
593 }
594 DVDEF mat4 mat4SetRotationX (DVTYPE r) {
595 DVTYPE c = DVCOS(r), s = DVSIN(r);
596 return MAT4(1, 0, 0, 0, 0, c, s, 0, 0, -s, c, 0, 0, 0, 0, 1);
597 }
598 DVDEF mat4 mat4SetRotationY (DVTYPE r) {
599 DVTYPE c = DVCOS(r), s = DVSIN(r);
600 return MAT4(c, 0, -s, 0, 0, 1, 0, 0, s, 0, c, 0, 0, 0, 0, 1);
601 }
602 DVDEF mat4 mat4SetRotationZ (DVTYPE r) {
603 DVTYPE c = DVCOS(r), s = DVSIN(r);
604 return MAT4(c, s, 0, 0, -s, c, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
605 }
606 DVDEF mat4 mat4SetRotationQuaternion (quat q) {
607 DVTYPE xx = q.x*q.x, xy = q.x*q.y, xz = q.x*q.z, xw = q.x*q.w, yy = q.y*q.y, yz = q.y*q.z, yw = q.y*q.w, zz = q.z*q.z, zw = q.z*q.w;
608 return MAT4(1-2*yy-2*zz, 2*xy+2*zw, 2*xz-2*yw, 0, 2*xy-2*zw, 1-2*xx-2*zz, 2*yz+2*xw, 0, 2*xz+2*yw, 2*yz-2*xw, 1-2*xx-2*yy, 0, 0, 0, 0, 1);
609 }
610 DVDEF mat4 mat4SetScale (DVTYPE s) {
611 return MAT4(s, 0, 0, 0, 0, s, 0, 0, 0, 0, s, 0, 0, 0, 0, 1);
612 }
613 DVDEF mat4 mat4SetScaleXYZ (vec3 v) {
614 return MAT4(v.x, 0, 0, 0, 0, v.y, 0, 0, 0, 0, v.z, 0, 0, 0, 0, 1);
615 }
616 DVDEF mat4 mat4SetTranslation (vec3 v) {
617 return MAT4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, v.x, v.y, v.z, 1);
618 }
619 DVDEF mat4 mat4LookAt (vec3 from, vec3 to, vec3 up) {
620 vec3 f = vec3Normalize(vec3Subtract(to, from)), s = vec3Normalize(vec3CrossProduct(f, up)), t = vec3CrossProduct(s, f);
621 mat4 m = MAT4(s.x, t.x, -f.x, 0, s.y, t.y, -f.y, 0, s.z, t.z, -f.z, 0, 0, 0, 0, 1);
622 for (int i = 0; i < 3; i++)
623 m.m[3][i] = -vec3DotProduct(VEC3(m.m[0][i], m.m[1][i], m.m[2][i]), from);
624 return m;
625 }
626 DVDEF mat4 mat4Perspective (DVTYPE vfov, DVTYPE aspect, DVTYPE ndist, DVTYPE fdist) {
627 DVTYPE a = 1/DVTAN(vfov/2);
628 return MAT4(a/aspect, 0, 0, 0, 0, a, 0, 0, 0, 0, -((fdist+ndist)/(fdist-ndist)), -1, 0, 0, -((2*fdist*ndist)/(fdist-ndist)), 0);
629 }
630 DVDEF mat4 mat4Ortho (DVTYPE left, DVTYPE right, DVTYPE bottom, DVTYPE top, DVTYPE ndist, DVTYPE fdist) {
631 return MAT4(2/(right-left), 0, 0, 0, 0, 2/(top-bottom), 0, 0, 0, 0, -2/(fdist-ndist), 0,
632 -(right+left)/(right-left), -(top+bottom)/(top-bottom), -(fdist+ndist)/(fdist-ndist), 1);
633 }
634 DVDEF mat4 mat4Transpose (mat4 m) {
635 return MAT4(m.m[0][0], m.m[1][0], m.m[2][0], m.m[3][0], m.m[0][1], m.m[1][1], m.m[2][1], m.m[3][1],
636 m.m[0][2], m.m[1][2], m.m[2][2], m.m[3][2], m.m[0][3], m.m[1][3], m.m[2][3], m.m[3][3]);
637 }
638 DVDEF mat4 mat4Inverse (mat4 m) {
639 DVTYPE s[6] = {m.m[0][0]*m.m[1][1] - m.m[1][0]*m.m[0][1], m.m[0][0]*m.m[1][2] - m.m[1][0]*m.m[0][2], m.m[0][0]*m.m[1][3] - m.m[1][0]*m.m[0][3],
640 m.m[0][1]*m.m[1][2] - m.m[1][1]*m.m[0][2], m.m[0][1]*m.m[1][3] - m.m[1][1]*m.m[0][3], m.m[0][2]*m.m[1][3] - m.m[1][2]*m.m[0][3]};
641 DVTYPE c[6] = {m.m[2][0]*m.m[3][1] - m.m[3][0]*m.m[2][1], m.m[2][0]*m.m[3][2] - m.m[3][0]*m.m[2][2], m.m[2][0]*m.m[3][3] - m.m[3][0]*m.m[2][3],
642 m.m[2][1]*m.m[3][2] - m.m[3][1]*m.m[2][2], m.m[2][1]*m.m[3][3] - m.m[3][1]*m.m[2][3], m.m[2][2]*m.m[3][3] - m.m[3][2]*m.m[2][3]};
643 return mat4MultiplyScalar(MAT4(m.m[1][1]*c[5] - m.m[1][2]*c[4] + m.m[1][3]*c[3], m.m[0][2]*c[4] - m.m[0][1]*c[5] - m.m[0][3]*c[3],
644 m.m[3][1]*s[5] - m.m[3][2]*s[4] + m.m[3][3]*s[3], m.m[2][2]*s[4] - m.m[2][1]*s[5] - m.m[2][3]*s[3], m.m[1][2]*c[2] - m.m[1][0]*c[5] - m.m[1][3]*c[1],
645 m.m[0][0]*c[5] - m.m[0][2]*c[2] + m.m[0][3]*c[1], m.m[3][2]*s[2] - m.m[3][0]*s[5] - m.m[3][3]*s[1], m.m[2][0]*s[5] - m.m[2][2]*s[2] + m.m[2][3]*s[1],
646 m.m[1][0]*c[4] - m.m[1][1]*c[2] + m.m[1][3]*c[0], m.m[0][1]*c[2] - m.m[0][0]*c[4] - m.m[0][3]*c[0], m.m[3][0]*s[4] - m.m[3][1]*s[2] + m.m[3][3]*s[0],
647 m.m[2][1]*s[2] - m.m[2][0]*s[4] - m.m[2][3]*s[0], m.m[1][1]*c[1] - m.m[1][0]*c[3] - m.m[1][2]*c[0], m.m[0][0]*c[3] - m.m[0][1]*c[1] + m.m[0][2]*c[0],
648 m.m[3][1]*s[1] - m.m[3][0]*s[3] - m.m[3][2]*s[0], m.m[2][0]*s[3] - m.m[2][1]*s[1] + m.m[2][2]*s[0]),
649 1/(s[0]*c[5] - s[1]*c[4] + s[2]*c[3] + s[3]*c[2] - s[4]*c[1] + s[5]*c[0]));
650 }
651 DVDEF mat4 mat4MultiplyScalar (mat4 m, DVTYPE s) {
652 for (int i = 0; i < 4; i++)
653 for (int j = 0; j < 4; j++)
654 m.m[i][j] *= s;
655 return m;
656 }
657 DVDEF mat4 mat4RotateX (mat4 m, DVTYPE r) {
658 return mat4MultiplyMatrix(mat4SetRotationX(r), m);
659 }
660 DVDEF mat4 mat4RotateY (mat4 m, DVTYPE r) {
661 return mat4MultiplyMatrix(mat4SetRotationY(r), m);
662 }
663 DVDEF mat4 mat4RotateZ (mat4 m, DVTYPE r) {
664 return mat4MultiplyMatrix(mat4SetRotationZ(r), m);
665 }
666 DVDEF mat4 mat4RotateQuaternion (mat4 m, quat q) {
667 return mat4MultiplyMatrix(mat4SetRotationQuaternion(q), m);
668 }
669 DVDEF mat4 mat4Scale (mat4 m, DVTYPE s) {
670 return mat4MultiplyMatrix(mat4SetScale(s), m);
671 }
672 DVDEF mat4 mat4ScaleXYZ (mat4 m, vec3 v) {
673 return mat4MultiplyMatrix(mat4SetScaleXYZ(v), m);
674 }
675 DVDEF mat4 mat4Translate (mat4 m, vec3 v) {
676 return mat4MultiplyMatrix(mat4SetTranslation(v), m);
677 }
678 DVDEF mat4 mat4MultiplyMatrix (mat4 m1, mat4 m2) {
679 mat4 m;
680 for (int i = 0; i < 4; i++)
681 for (int j = 0; j < 4; j++)
682 m.m[i][j] = m1.m[0][j]*m2.m[i][0] + m1.m[1][j]*m2.m[i][1] + m1.m[2][j]*m2.m[i][2] + m1.m[3][j]*m2.m[i][3];
683 return m;
684 }
685 DVDEF mat4 mat4Add (mat4 m1, mat4 m2) {
686 mat4 m;
687 for (int i = 0; i < 4; i++)
688 for (int j = 0; j < 4; j++)
689 m.m[i][j] = m1.m[i][j] + m2.m[i][j];
690 return m;
691 }
692 DVDEF mat4 mat4Subtract (mat4 m1, mat4 m2) {
693 mat4 m;
694 for (int i = 0; i < 4; i++)
695 for (int j = 0; j < 4; j++)
696 m.m[i][j] = m1.m[i][j] - m2.m[i][j];
697 return m;
698 }
699 DVDEF int mat4Equal (mat4 m1, mat4 m2) {
700 for (int i = 0; i < 4; i++)
701 for (int j = 0; j < 4; j++)
702 if (m1.m[i][j] != m2.m[i][j])
703 return 0;
704 return 1;
705 }
706
707 //frst functions
708 DVDEF frst frstFromMatrix (mat4 m) {
709 frst f;
710 f.pln[0] = VEC4(m.m[0][3]+m.m[0][0], m.m[1][3]+m.m[1][0], m.m[2][3]+m.m[2][0], m.m[3][3]+m.m[3][0]); //left
711 f.pln[1] = VEC4(m.m[0][3]-m.m[0][0], m.m[1][3]-m.m[1][0], m.m[2][3]-m.m[2][0], m.m[3][3]-m.m[3][0]); //right
712 f.pln[2] = VEC4(m.m[0][3]-m.m[0][1], m.m[1][3]-m.m[1][1], m.m[2][3]-m.m[2][1], m.m[3][3]-m.m[3][1]); //top
713 f.pln[3] = VEC4(m.m[0][3]+m.m[0][1], m.m[1][3]+m.m[1][1], m.m[2][3]+m.m[2][1], m.m[3][3]+m.m[3][1]); //bottom
714 f.pln[4] = VEC4(m.m[0][3]+m.m[0][2], m.m[1][3]+m.m[1][2], m.m[2][3]+m.m[2][2], m.m[3][3]+m.m[3][2]); //near
715 f.pln[5] = VEC4(m.m[0][3]-m.m[0][2], m.m[1][3]-m.m[1][2], m.m[2][3]-m.m[2][2], m.m[3][3]-m.m[3][2]); //far
716 for (int i = 0; i < 6; i++)
717 f.pln[i] = vec4Divide(f.pln[i], vec3Length(vec4GetXYZ(f.pln[i])));
718 return f;
719 }
720 DVDEF int frstCullSphere (frst f, vec3 v, DVTYPE s) {
721 for (int i = 0; i < 6; i++)
722 if (vec3DotProduct(vec4GetXYZ(f.pln[i]), v) + f.pln[i].w + s < 0)
723 return 0;
724 return 1;
725 }
726 DVDEF int frstCullAABB (frst f, vec3 min, vec3 max) {
727 for (int i = 0; i < 6; i++) {
728 const vec3 v = VEC3(f.pln[i].x > 0 ? max.x : min.x, f.pln[i].y > 0 ? max.y : min.y, f.pln[i].z > 0 ? max.z : min.z);
729 if (vec3DotProduct(vec4GetXYZ(f.pln[i]), v) + f.pln[i].w < 0)
730 return 0;
731 }
732 return 1;
733 }
734
735 #endif //DVECTOR_IMPLEMENTATION
File include/fgc.h added (mode: 100644) (index 0000000..057f0e5)
1 #ifndef FGC_H
2 #define FGC_H
3
4 #if defined(__APPLE__)
5 # include <TargetConditionals.h>
6 # if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE==1
7 # define GLAD_GLES2_IMPLEMENTATION
8 # include "glad/gles3.h"
9 # else
10 # define GLAD_GL_IMPLEMENTATION
11 # include "glad/gl.h"
12 # endif
13 #elif defined(__ANDROID__)
14 # define GLAD_GLES2_IMPLEMENTATION
15 # include "glad/gles3.h"
16 #else
17 # define GLAD_GL_IMPLEMENTATION
18 # include "glad/gl.h"
19 #endif
20
21 #define DVECTOR_IMPLEMENTATION
22 #define DVECTOR_ISOC
23 #define DVECTOR_DOUBLE
24 #include "dvector.h"
25
26 #include <SDL2/SDL.h>
27
28 #include <stdbool.h>
29 #include <stdio.h>
30 #include <stdlib.h>
31
32 bool fgcVerbose = true;
33
34 const char* fgcShaderHeader =
35 #ifdef GLAD_GL
36 "#version 330\n";
37 #else // GLES
38 "#version 300 es\nprecision highp float;\n";
39 #endif
40
41 // vec2/3 can become vec4 automatically
42 // https://stackoverflow.com/questions/18935203/shader-position-vec4-or-vec3
43
44 const char* fgcUnlitVert =
45 "uniform mat4 u_matrices[6]; // 0:mvp 1:mv 2:m 3:nrm 4:tex 5:light \n"
46 "layout(location = 0) in vec4 a_Position; \n"
47 "layout(location = 1) in vec4 a_Normal; \n"
48 "layout(location = 2) in vec4 a_UV; \n"
49 "out vec2 v_UV; \n"
50 "out vec4 v_RelativePos; \n"
51 "void main(){ \n"
52 " v_UV = vec2( u_matrices[4] * a_UV ); \n"
53 " v_RelativePos = u_matrices[1] * a_Position; \n"
54 " gl_Position = u_matrices[0] * a_Position; \n"
55 "}";
56
57 const char* fgcUnlitFrag =
58 "uniform sampler2D u_texture; \n"
59 "uniform vec4 u_fog; \n"
60 "uniform vec3 u_camera; \n"
61 "in vec2 v_UV; \n"
62 "in vec4 v_RelativePos; \n"
63 "layout(location = 0) out vec4 fragColor; \n"
64 "void main(){ \n"
65 " vec4 texColor = texture( u_texture, v_UV ); \n"
66 " if( texColor.a < 0.001 ) discard; \n"
67 " if( u_fog.a > 0.0 ){ \n"
68 " float fogFactor = 1.0 - clamp( \n"
69 " 1.0 / exp( length( v_RelativePos ) * u_fog.a ), \n"
70 " 0.0, \n"
71 " 1.0 ); \n"
72 " fragColor = vec4( \n"
73 " mix( texColor.rgb, u_fog.rgb, fogFactor ), \n"
74 " texColor.a ); \n"
75 " }else{ \n"
76 " fragColor = texColor; \n"
77 " } \n"
78 "}";
79
80 const char* fgcUnlitSamplers[] = { "u_texture", 0 };
81
82 const GLchar* fgcColorModFrag =
83 "uniform sampler2D u_texture; \n"
84 "uniform vec4 u_fog; \n"
85 "uniform vec3 u_camera; \n"
86 "in vec2 v_UV; \n"
87 "in vec4 v_RelativePos; \n"
88 "layout(location = 0) out vec4 fragColor; \n"
89 "void main(){ \n"
90 " vec4 texColor = texture( u_texture, v_UV ); \n"
91 " if( texColor.a < 0.001 ) discard; \n"
92 " fragColor = texColor * u_fog; \n"
93 "}";
94
95 const char* fgcColorModSamplers[] = { "u_texture", 0 };
96
97 const char* fgcSkyboxVert =
98 "uniform mat4 u_matrices[6]; // 0:mvp 1:mv 2:m 3:nrm 4:tex 5:light \n"
99 "layout(location = 0) in vec4 a_Position; \n"
100 "layout(location = 1) in vec4 a_Normal; \n"
101 "layout(location = 2) in vec4 a_UV; \n"
102 "out vec3 v_STR; \n"
103 "void main(){ \n"
104 " v_STR = a_Position.xyz; \n"
105 " vec4 pos = u_matrices[0] * a_Position; \n"
106 " gl_Position = pos.xyww; \n"
107 "}";
108
109 const char* fgcSkyboxFrag =
110 "uniform samplerCube u_cubemap; \n"
111 "uniform vec4 u_fog; \n"
112 "uniform vec3 u_camera; \n"
113 "in vec3 v_STR; \n"
114 "layout(location = 0) out vec4 fragColor; \n"
115 "void main(){ \n"
116 " fragColor = texture( u_cubemap, v_STR ); \n"
117 "}";
118
119 const char* fgcSkyboxSamplers[] = { "u_cubemap", 0 };
120
121 typedef struct {
122 size_t item_size;
123 size_t length;
124 size_t capacity;
125 void *data;
126 } FGCArray;
127
128 typedef struct {
129 GLfloat position[3];
130 GLfloat normal[3];
131 GLfloat uv[2];
132 } FGCVertex;
133
134 typedef GLuint FGCIndex;
135
136 typedef struct {
137 GLfloat r;
138 GLfloat g;
139 GLfloat b;
140 GLfloat a;
141 } FGCColor;
142
143 typedef struct {
144 bool success;
145 GLuint programObject;
146 GLuint u_metallicFactor;
147 GLuint u_roughnessFactor;
148 GLuint u_matrices;
149 GLuint u_fog;
150 GLuint u_camera;
151 GLuint slots[16];
152 } FGCPipeline;
153
154 typedef struct {
155 bool success;
156 size_t nvertices;
157 size_t nindices;
158 FGCVertex *vertices;
159 FGCIndex *indices;
160 GLuint vao[3]; // VAO state, vertex buffer, index buffer
161 GLfloat xmin;
162 GLfloat xmax;
163 GLfloat ymin;
164 GLfloat ymax;
165 GLfloat zmin;
166 GLfloat zmax;
167 } FGCMesh;
168
169 typedef struct {
170 bool success;
171 GLuint texture;
172 GLsizei width;
173 GLsizei height;
174 int channels;
175 bool mipmap;
176 GLenum type;
177 } FGCTexture;
178
179 typedef struct {
180 bool success;
181 GLuint fbo;
182 GLuint texture;
183 GLuint texture_z;
184 GLenum texture_type;
185 GLenum texture_fmt;
186 GLuint rbo;
187 GLsizei width;
188 GLsizei height;
189 GLsizei multisample;
190 } FGCFramebuffer;
191
192 typedef struct {
193 bool success;
194 int width;
195 int height;
196 } FGCDisplayInfo;
197
198 const Uint8 *fgcKeyStates;
199 SDL_Window *fgcWindow = NULL;
200 SDL_GLContext fgcContext = 0;
201
202 FGCPipeline
203 fgcDrawPipeline,
204 fgcUnlitPipeline,
205 fgcColorModPipeline,
206 fgcSkyboxPipeline;
207
208 FGCColor fgcFogColor = { 0.0f, 0.0f, 0.0f, 0.0f };
209
210 FGCMesh fgcPlaneMesh, fgcCubeMesh;
211
212 mat4 fgcTexMatrix = {{{1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 1, 0}, {0, 0, 0, 1}}};
213 mat4 fgcLightMatrix = {{{1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 1, 0}, {0, 0, 0, 1}}};
214
215 double fgcMouseX = 0.0, fgcMouseY = 0.0, fgcMouseMoveX = 0.0, fgcMouseMoveY = 0.0;
216 int fgcMouseWheel = 0;
217 int fgcMouseButtonMask = 0;
218 bool fgcMouseTrapped = false;
219 bool fgcFingerTouch = false;
220
221 bool fgcHasFocus = true;
222
223 // Private functions.
224
225 // Duplicate a buffer to the heap.
226 static inline void *_fgcBufDup( void *buf, size_t num ){
227 return memcpy( malloc( num ), buf, num );
228 }
229
230 // Load an SDL_Surface with RGBA pixel format from an image file.
231 static inline SDL_Surface *_fgcLoadSurface( const char* filePath ){
232 Uint32 rMask, gMask, bMask, aMask;
233 #if SDL_BYTEORDER == SDL_BIG_ENDIAN
234 rMask = 0xff000000;
235 gMask = 0x00ff0000;
236 bMask = 0x0000ff00;
237 aMask = 0x000000ff;
238 #else
239 rMask = 0x000000ff;
240 gMask = 0x0000ff00;
241 bMask = 0x00ff0000;
242 aMask = 0xff000000;
243 #endif
244 #if defined(STBI_VERSION)
245 int width = 0, height = 0, n = 0;
246 unsigned char *data =
247 stbi_load( filePath, &width, &height, &n, 4 );
248 // Use the RGBA stb_image buffer in an RGBA SDL_Surface.
249 // The data is not actually copied, so we do not free it here.
250 SDL_Surface *originalSurface = SDL_CreateRGBSurfaceFrom(
251 data,
252 width,
253 height,
254 32,
255 4 * width,
256 rMask, gMask, bMask, aMask
257 );
258 #elif defined(SDL_IMAGE_MAJOR_VERSION)
259 SDL_Surface *originalSurface = IMG_Load( filePath );
260 #else
261 SDL_Surface *originalSurface = SDL_LoadBMP( filePath );
262 #endif
263 if( !originalSurface ) return originalSurface;
264 // Blit the original SDL_Surface onto an RGBA SDL_Surface.
265 SDL_Surface *surface = SDL_CreateRGBSurface(
266 0,
267 originalSurface->w,
268 originalSurface->h,
269 32,
270 rMask, gMask, bMask, aMask
271 );
272 SDL_BlitSurface( originalSurface, NULL, surface, NULL );
273 SDL_FreeSurface( originalSurface );
274 #if defined(STBI_VERSION)
275 // https://wiki.libsdl.org/SDL2/SDL_CreateRGBSurfaceFrom
276 // "you must free the surface before you free the pixel data"
277 free( data );
278 #endif
279 return surface;
280 }
281
282 // Public functions.
283
284 FGCArray fgcCreateArray(size_t item_size);
285 void fgcDestroyArray(FGCArray *array);
286 void *fgcArrayGet(FGCArray *array, size_t index);
287 void fgcArraySet(FGCArray *array, size_t index, void *item);
288 void fgcArrayClear(FGCArray *array);
289 void fgcArrayPush(FGCArray *array, void *item);
290 void fgcArrayPop(FGCArray *array);
291
292 quat fgcEulerToQuat( double aX, double aY, double aZ );
293
294 double fgcWrapAngle( double a );
295
296 FGCPipeline fgcLoadPipeline(
297 const char* vertSrc,
298 const char* fragSrc,
299 const char** samplers );
300
301 void fgcSetPipeline( FGCPipeline pipeline );
302
303 void fgcSetFog( FGCColor col );
304
305 FGCFramebuffer fgcCreateFramebuffer( GLsizei width, GLsizei height, bool cubemap, GLenum internalFmt, GLsizei multisample );
306 void fgcResizeFramebuffer( FGCFramebuffer *fb, GLsizei width, GLsizei height, GLsizei multisample );
307 FGCTexture fgcGetFramebufferTexture( FGCFramebuffer *fb );
308 void fgcSetFramebuffer( FGCFramebuffer *fb, float viewScale );
309 void fgcDrawFramebuffer( FGCFramebuffer *fb, bool drawZ, float viewScale );
310
311 FGCMesh fgcLoadMesh(
312 size_t nvertices,
313 size_t nindices,
314 FGCVertex *vertices,
315 FGCIndex *indices,
316 bool streaming );
317
318 FGCMesh fgcLoadOBJ( const char* filePath );
319
320 void fgcFreeMesh( FGCMesh *mesh );
321
322 void fgcUpdateMesh(
323 FGCMesh *mesh,
324 size_t nvertices,
325 size_t nindices,
326 FGCVertex *vertices,
327 FGCIndex *indices,
328 bool streaming );
329
330 void fgcDrawMesh(
331 FGCMesh *mesh,
332 mat4 modelMat,
333 mat4 viewMat,
334 mat4 projMat );
335
336 void fgcDrawSkybox(
337 FGCTexture tex,
338 mat4 viewMat,
339 mat4 projMat,
340 FGCColor tint );
341
342 FGCTexture fgcLoadTexture(
343 const char* filePath,
344 bool mipmap,
345 bool filter );
346
347 FGCTexture fgcLoadSolidColorTexture( FGCColor c );
348
349 void fgcSetTexture( FGCTexture tex, GLuint texSlot );
350
351 FGCDisplayInfo fgcCreateDisplay(
352 int width,
353 int height,
354 const char* title,
355 int multisample,
356 bool hidef,
357 bool vsync );
358
359 int fgcGetDisplayWidth();
360
361 int fgcGetDisplayHeight();
362
363 int fgcUpKey();
364 int fgcDownKey();
365 int fgcLeftKey();
366 int fgcRightKey();
367 int fgcShiftKey();
368 int fgcAltKey();
369 int fgcCommandKey();
370 int fgcControlKey();
371 int fgcEnterKey();
372 int fgcEscapeKey();
373 int fgcSpaceKey();
374 int fgcTabKey();
375 int fgcCharKey( char key );
376
377 bool fgcMouseButton( int button );
378 void fgcShowMouse( bool show );
379 void fgcTrapMouse( bool trap );
380
381 void fgcSetMainLoop( void (*loop)(double) );
382
383 // Create a dynamic array.
384 FGCArray fgcCreateArray(size_t item_size){
385 FGCArray array;
386 array.item_size = item_size;
387 array.length = 0;
388 array.capacity = 1;
389 array.data = realloc(NULL, array.item_size * array.capacity);
390 return array;
391 }
392
393 // Free a dynamic array's internal data.
394 void fgcDestroyArray(FGCArray *array){
395 free(array->data);
396 array->data = NULL;
397 array->item_size = 0;
398 array->length = 0;
399 array->capacity = 0;
400 }
401
402 // Get a pointer to the item at index.
403 void *fgcArrayGet(FGCArray *array, size_t index){
404 return (void*)
405 ((uintptr_t)array->data + (uintptr_t)array->item_size * index);
406 }
407
408 // Copy the contents of item to index.
409 void fgcArraySet(FGCArray *array, size_t index, void *item){
410 memcpy((void*)((uintptr_t)array->data + array->item_size * index),
411 item, array->item_size);
412 }
413
414 // Set the array's length to 0.
415 void fgcArrayClear(FGCArray *array){
416 array->length = 0;
417 }
418
419 // Add item to the end of the array.
420 void fgcArrayPush(FGCArray *array, void *item){
421 if(array->length + 1 > array->capacity){
422 array->capacity *= 2;
423 array->data =
424 realloc(array->data, array->item_size * array->capacity);
425 }
426 memcpy(
427 (void*)((uintptr_t)array->data + array->item_size * array->length),
428 item, array->item_size);
429 array->length++;
430 }
431
432 // Remove the last item.
433 void fgcArrayPop(FGCArray *array){
434 if(array->length > 0) array->length--;
435 }
436
437 // Convert Euler rotations to a quaternion. Rotation order is optimized
438 // for standard first-person camera control. (X: pitch, Y: yaw, Z: roll)
439 quat fgcEulerToQuat( double aX, double aY, double aZ ){
440 double
441 c1 = cos( aY * 0.5 ),
442 c2 = cos( aZ * 0.5 ),
443 c3 = cos( aX * 0.5 ),
444 s1 = sin( aY * 0.5 ),
445 s2 = sin( aZ * 0.5 ),
446 s3 = sin( aX * 0.5 );
447
448 return QUAT(
449 s1 * s2 * c3 + c1 * c2 * s3,
450 s1 * c2 * c3 + c1 * s2 * s3,
451 c1 * s2 * c3 - s1 * c2 * s3,
452 c1 * c2 * c3 - s1 * s2 * s3
453 );
454 }
455
456 double fgcWrapAngle( double a ){
457 double divisor = acos(-1) * 2.0;
458 return a - round( a / divisor ) * divisor;
459 }
460
461 // Load a graphics pipeline from vertex shader source, fragment shader
462 // source, and a list of strings identifying up to 16 sampler uniforms.
463 FGCPipeline fgcLoadPipeline(
464 const char* vertSrc,
465 const char* fragSrc,
466 const char** samplers ){
467 FGCPipeline pipeline;
468 pipeline.success = false;
469
470 GLint infoLen;
471 GLint compiled;
472
473 // Load and compile the vertex shader.
474 GLuint vert;
475 if( ( vert = glCreateShader( GL_VERTEX_SHADER ) ) == 0 )
476 return pipeline;
477 const char* vertStrings[] = { fgcShaderHeader, vertSrc };
478 glShaderSource( vert, 2, vertStrings, NULL );
479 glCompileShader( vert );
480 glGetShaderiv( vert, GL_COMPILE_STATUS, &compiled );
481 if( !compiled ){
482 fprintf( stderr, "Failed to compile vertex shader.\n" );
483 // Display debug output.
484 glGetShaderiv( vert, GL_INFO_LOG_LENGTH, &infoLen );
485 if( infoLen > 1 ){
486 char* infoLog = (char*)malloc( infoLen );
487 glGetShaderInfoLog( vert, infoLen, NULL, infoLog );
488 fprintf( stderr, "%s\n", infoLog );
489 free( infoLog );
490 }
491 // Delete the shader and return.
492 glDeleteShader( vert );
493 return pipeline;
494 }
495
496 // Load and compile the fragment shader.
497 GLuint frag;
498 if( ( frag = glCreateShader( GL_FRAGMENT_SHADER ) ) == 0 )
499 return pipeline;
500 const char* fragStrings[] = { fgcShaderHeader, fragSrc };
501 glShaderSource( frag, 2, fragStrings, NULL );
502 glCompileShader( frag );
503 glGetShaderiv( frag, GL_COMPILE_STATUS, &compiled );
504 if( !compiled ){
505 fprintf( stderr, "Failed to compile fragment shader.\n" );
506 glGetShaderiv( frag, GL_INFO_LOG_LENGTH, &infoLen );
507 if( infoLen > 1 ){
508 char* infoLog = (char*)malloc( infoLen );
509 glGetShaderInfoLog( frag, infoLen, NULL, infoLog );
510 fprintf( stderr, "%s\n", infoLog );
511 free( infoLog );
512 }
513 // Delete both shaders and return.
514 glDeleteShader( vert );
515 glDeleteShader( frag );
516 return pipeline;
517 }
518
519 GLuint programObject;
520 if( ( programObject = glCreateProgram() ) == 0 ) return pipeline;
521 glAttachShader( programObject, vert );
522 glAttachShader( programObject, frag );
523
524 glLinkProgram( programObject );
525 GLint linked;
526 glGetProgramiv( programObject, GL_LINK_STATUS, &linked );
527 if( !linked ){
528 fprintf( stderr, "Failed to link shader program.\n" );
529 glGetProgramiv( programObject, GL_INFO_LOG_LENGTH, &infoLen );
530 if( infoLen > 1 ){
531 char* infoLog = (char*)malloc( infoLen );
532 glGetProgramInfoLog( programObject, infoLen, NULL, infoLog );
533 fprintf( stderr, "%s\n", infoLog );
534 free( infoLog );
535 }
536 glDeleteProgram( programObject );
537 return pipeline;
538 }
539
540 // https://stackoverflow.com/questions/39784072/is-there-garbage-collection-on-the-gpu
541 // https://gamedev.stackexchange.com/questions/47910/after-a-succesful-gllinkprogram-should-i-delete-detach-my-shaders
542 glDetachShader( programObject, vert );
543 glDeleteShader( vert );
544 glDetachShader( programObject, frag );
545 glDeleteShader( frag );
546
547 pipeline.success = true;
548 pipeline.programObject = programObject;
549 pipeline.u_metallicFactor = glGetUniformLocation( programObject, "u_metallicFactor" );
550 pipeline.u_roughnessFactor = glGetUniformLocation( programObject, "u_roughnessFactor" );
551 pipeline.u_matrices = glGetUniformLocation( programObject, "u_matrices" );
552 pipeline.u_fog = glGetUniformLocation( programObject, "u_fog" );
553 pipeline.u_camera = glGetUniformLocation( programObject, "u_camera" );
554
555 // Add the sampler locations to be bound in fglSetPipeline.
556 int i = 0;
557 while( i < 16 && samplers[i] ){
558 pipeline.slots[i] =
559 glGetUniformLocation( programObject, samplers[i] );
560 i++;
561 }
562 if( i < 16 ) pipeline.slots[i] = 0;
563
564 return pipeline;
565 }
566
567 // Switch to the specified graphics pipeline.
568 void fgcSetPipeline( FGCPipeline pipeline ){
569 if( pipeline.success ){
570 fgcDrawPipeline = pipeline;
571 glUseProgram( pipeline.programObject );
572 glUniform4f(
573 fgcDrawPipeline.u_fog,
574 fgcFogColor.r,
575 fgcFogColor.g,
576 fgcFogColor.b,
577 fgcFogColor.a
578 );
579 // Bind the sampler locations.
580 int i = 0;
581 while( i < 16 && pipeline.slots[i] ){
582 glUniform1i( pipeline.slots[i], i );
583 i++;
584 }
585 }
586 }
587
588 // Set the fog color for the current pipeline.
589 void fgcSetFog( FGCColor col ){
590 glUniform4f( fgcDrawPipeline.u_fog, col.r, col.g, col.b, col.a );
591 fgcFogColor = col;
592 }
593
594 FGCFramebuffer fgcCreateFramebuffer( GLsizei width, GLsizei height, bool cubemap, GLenum internalFmt, GLsizei multisample ){
595 // https://stackoverflow.com/questions/46535341
596 // This framebuffer API does not currently support mipmapping.
597
598 FGCFramebuffer fb;
599 glGenFramebuffers( 1, &fb.fbo );
600 glBindFramebuffer( GL_FRAMEBUFFER, fb.fbo );
601
602 // Multisample textures are not available in core GLES 3.0.
603 #ifdef GLAD_GLES2
604 multisample = 0;
605 fb.texture_type = cubemap ? GL_TEXTURE_CUBE_MAP : GL_TEXTURE_2D;
606 #else
607 fb.texture_type = cubemap ? GL_TEXTURE_CUBE_MAP
608 : ( multisample > 0 ? GL_TEXTURE_2D_MULTISAMPLE : GL_TEXTURE_2D );
609 #endif
610
611 fb.texture_fmt = internalFmt;
612 glGenTextures( 1, &fb.texture );
613 glBindTexture( fb.texture_type, fb.texture );
614
615 GLenum format, pixType;
616 if( internalFmt == GL_RGB ){
617 format = GL_RGB;
618 pixType = GL_UNSIGNED_BYTE;
619 }else if( internalFmt == GL_RG16F ){
620 format = GL_RG;
621 pixType = GL_HALF_FLOAT;
622 }else if( internalFmt == GL_RGB16F ){
623 format = GL_RGB;
624 pixType = GL_HALF_FLOAT;
625 }else if( internalFmt == GL_RG32F ){
626 format = GL_RG;
627 pixType = GL_FLOAT;
628 }else if( internalFmt == GL_RGB32F ){
629 format = GL_RGB;
630 pixType = GL_FLOAT;
631 }else{
632 fprintf( stderr, "Unrecognized internalFmt. Using GL_RGB.\n" );
633 internalFmt = GL_RGB;
634 format = GL_RGB;
635 pixType = GL_UNSIGNED_BYTE;
636 }
637
638 if( cubemap ){
639 // Create 6 blank faces.
640 for( unsigned int i = 0; i < 6; i++ ){
641 glTexImage2D(
642 GL_TEXTURE_CUBE_MAP_POSITIVE_X + i,
643 0,
644 internalFmt,
645 width,
646 height,
647 0,
648 format,
649 pixType,
650 NULL
651 );
652 glFramebufferTexture2D(
653 GL_FRAMEBUFFER,
654 GL_COLOR_ATTACHMENT0,
655 GL_TEXTURE_CUBE_MAP_POSITIVE_X + i,
656 fb.texture,
657 0
658 );
659 }
660 glTexParameteri( fb.texture_type, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE );
661 }else{
662 // Create a blank surface.
663 #ifdef GLAD_GL
664 if( fb.texture_type == GL_TEXTURE_2D_MULTISAMPLE )
665 glTexImage2DMultisample( GL_TEXTURE_2D_MULTISAMPLE, multisample, internalFmt, width, height, GL_TRUE );
666 else
667 #endif
668 glTexImage2D( GL_TEXTURE_2D, 0, internalFmt, width, height, 0, format, pixType, NULL );
669
670 glFramebufferTexture2D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, fb.texture_type, fb.texture, 0 );
671 }
672
673 if( multisample == 0 ){
674 glTexParameteri( fb.texture_type, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
675 glTexParameteri( fb.texture_type, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
676 glTexParameteri( fb.texture_type, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
677 glTexParameteri( fb.texture_type, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
678 }
679
680 // Unbind the texture.
681 glBindTexture( fb.texture_type, 0 );
682
683 if( cubemap
684 #ifdef GLAD_GL
685 || fb.texture_type == GL_TEXTURE_2D_MULTISAMPLE
686 #endif
687 ){
688 // Cubemap depth textures are unsupported.
689 fb.texture_z = 0;
690 // Create a depth renderbuffer.
691 glGenRenderbuffers( 1, &fb.rbo );
692 glBindRenderbuffer( GL_RENDERBUFFER, fb.rbo );
693 #ifdef GLAD_GL
694 if( fb.texture_type == GL_TEXTURE_2D_MULTISAMPLE )
695 glRenderbufferStorageMultisample( GL_RENDERBUFFER, multisample, GL_DEPTH_COMPONENT32F, width, height );
696 else
697 #endif
698 glRenderbufferStorage( GL_RENDERBUFFER, GL_DEPTH_COMPONENT32F, width, height );
699
700 glFramebufferRenderbuffer( GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, fb.rbo );
701 }else{
702 fb.rbo = 0;
703 // Create a depth texture.
704 glGenTextures( 1, &fb.texture_z );
705 glBindTexture( fb.texture_type, fb.texture_z );
706 glTexImage2D( fb.texture_type, 0, GL_DEPTH_COMPONENT32F, width, height, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL );
707 glFramebufferTexture2D( GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, fb.texture_type, fb.texture_z, 0 );
708 glTexParameteri( fb.texture_type, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
709 glTexParameteri( fb.texture_type, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
710 glTexParameteri( fb.texture_type, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
711 glTexParameteri( fb.texture_type, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
712 // Unbind the texture.
713 glBindTexture( fb.texture_type, 0 );
714 }
715
716 int status = glCheckFramebufferStatus( GL_FRAMEBUFFER );
717 fb.success = status == GL_FRAMEBUFFER_COMPLETE;
718 if( !fb.success ){
719 fprintf( stderr, "createFramebuffer failed. multisample: %d status: %d\n", multisample, status );
720 }
721
722 GLenum glerr;
723 while( ( glerr = glGetError() ) != GL_NO_ERROR ){
724 printf( "OpenGL error: 0x%.4X\n", glerr );
725 }
726
727 fb.width = width;
728 fb.height = height;
729 fb.multisample = multisample;
730 return fb;
731 }
732
733 void fgcResizeFramebuffer( FGCFramebuffer *fb, GLsizei width, GLsizei height, GLsizei multisample ){
734 #ifdef GLAD_GLES2
735 multisample = 0;
736 #endif
737
738 // Only resize if necessary.
739 if( fb->width == width && fb->height == height
740 && fb->multisample == multisample ){
741 return;
742 }
743
744 glBindFramebuffer( GL_FRAMEBUFFER, fb->fbo );
745
746 glBindTexture( fb->texture_type, fb->texture );
747
748 GLenum format, pixType;
749 if( fb->texture_fmt == GL_RG16F ){
750 format = GL_RG;
751 pixType = GL_HALF_FLOAT;
752 }else if( fb->texture_fmt == GL_RGB16F ){
753 format = GL_RGB;
754 pixType = GL_HALF_FLOAT;
755 }else if( fb->texture_fmt == GL_RG32F ){
756 format = GL_RG;
757 pixType = GL_FLOAT;
758 }else if( fb->texture_fmt == GL_RGB32F ){
759 format = GL_RGB;
760 pixType = GL_FLOAT;
761 }else{
762 format = GL_RGB;
763 pixType = GL_UNSIGNED_BYTE;
764 }
765
766 if( fb->texture_type == GL_TEXTURE_CUBE_MAP ){
767 // Resize the 6 faces.
768 for( unsigned int i = 0; i < 6; i++ ){
769 glTexImage2D(
770 GL_TEXTURE_CUBE_MAP_POSITIVE_X + i,
771 0,
772 fb->texture_fmt,
773 width,
774 height,
775 0,
776 format,
777 pixType,
778 NULL
779 );
780 }
781 }else{
782 // Resize the texture.
783 #ifdef GLAD_GL
784 if( fb->texture_type == GL_TEXTURE_2D_MULTISAMPLE )
785 glTexImage2DMultisample( GL_TEXTURE_2D_MULTISAMPLE, multisample, fb->texture_fmt, width, height, GL_TRUE );
786 else
787 #endif
788 glTexImage2D( GL_TEXTURE_2D, 0, fb->texture_fmt, width, height, 0, format, pixType, NULL );
789 }
790
791 // Unbind the texture.
792 glBindTexture( fb->texture_type, 0 );
793
794 if( fb->texture_type == GL_TEXTURE_CUBE_MAP
795 #ifdef GLAD_GL
796 || fb->texture_type == GL_TEXTURE_2D_MULTISAMPLE
797 #endif
798 ){
799 // Replace the depth renderbuffer.
800 glDeleteRenderbuffers( 1, &fb->rbo );
801 glGenRenderbuffers( 1, &fb->rbo );
802 glBindRenderbuffer( GL_RENDERBUFFER, fb->rbo );
803 #ifdef GLAD_GL
804 if( fb->texture_type == GL_TEXTURE_2D_MULTISAMPLE )
805 glRenderbufferStorageMultisample( GL_RENDERBUFFER, multisample, GL_DEPTH_COMPONENT32F, width, height );
806 else
807 #endif
808 glRenderbufferStorage( GL_RENDERBUFFER, GL_DEPTH_COMPONENT32F, width, height );
809
810 glFramebufferRenderbuffer( GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, fb->rbo );
811 }else{
812 // Resize the depth texture.
813 glBindTexture( fb->texture_type, fb->texture_z );
814 glTexImage2D( fb->texture_type, 0, GL_DEPTH_COMPONENT32F, width, height, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL );
815 // Unbind the texture.
816 glBindTexture( fb->texture_type, 0 );
817 }
818
819 fb->success = glCheckFramebufferStatus( GL_FRAMEBUFFER ) == GL_FRAMEBUFFER_COMPLETE;
820 fb->width = width;
821 fb->height = height;
822 fb->multisample = multisample;
823 }
824
825 FGCTexture fgcGetFramebufferTexture( FGCFramebuffer *fb ){
826 FGCTexture tex;
827 tex.success = fb->success;
828 tex.texture = fb->texture;
829 tex.width = fb->width;
830 tex.height = fb->height;
831 tex.channels = 4; // TODO: Is this accurate?
832 tex.mipmap = false; // TODO: mipmapping
833 tex.type = fb->texture_type;
834 return tex;
835 }
836
837 // Set the drawing target to the framebuffer or the screen.
838 void fgcSetFramebuffer( FGCFramebuffer *fb, float viewScale ){
839 if( fb && fb->success ){
840 glBindFramebuffer( GL_FRAMEBUFFER, fb->fbo );
841 glViewport( 0, 0, fb->width * viewScale, fb->height * viewScale );
842 }else{
843 glBindFramebuffer( GL_FRAMEBUFFER, 0 );
844 glViewport( 0, 0, fgcGetDisplayWidth(), fgcGetDisplayHeight() );
845 }
846 }
847
848 void fgcDrawFramebuffer( FGCFramebuffer *fb, bool drawZ, float viewScale ){
849 if( !fb || !fb->success ) return;
850 if( fb->multisample > 0 ){
851 // Blit and rely on OpenGL to resolve samples.
852 glBindFramebuffer( GL_READ_FRAMEBUFFER, fb->fbo );
853 glBlitFramebuffer(
854 0, 0, fb->width, fb->height, // source
855 0, 0, fb->width, fb->height, // destination
856 GL_COLOR_BUFFER_BIT,
857 GL_NEAREST
858 );
859 }else{
860 // Draw using a shader.
861 glDisable( GL_DEPTH_TEST );
862 glDisable( GL_CULL_FACE );
863 glActiveTexture( GL_TEXTURE0 );
864 glBindTexture( fb->texture_type, drawZ ? fb->texture_z : fb->texture );
865 fgcTexMatrix = MAT4_IDEN;
866 // Stretch to screen bounds and flip vertically.
867 fgcDrawMesh(
868 &fgcPlaneMesh,
869 mat4SetScaleXYZ(VEC3(2.0 / viewScale, -2.0 / viewScale, 0.0)),
870 mat4SetTranslation(VEC3(1.0 - 1.0 / viewScale, 1.0 - 1.0 / viewScale, 0.0)),
871 MAT4_IDEN
872 );
873 glEnable( GL_DEPTH_TEST );
874 glEnable( GL_CULL_FACE );
875 }
876 }
877
878 // Load a 3D mesh from a list of vertices and a list of indices.
879 // fgcLoadMesh does not manage heap memory for *vertices and *indices.
880 // You must malloc them before calling this function and free them when
881 // deleting the mesh.
882 FGCMesh fgcLoadMesh(
883 size_t nvertices,
884 size_t nindices,
885 FGCVertex *vertices,
886 FGCIndex *indices,
887 bool streaming ){
888 FGCMesh mesh;
889 mesh.success = false;
890 mesh.nvertices = nvertices;
891 mesh.nindices = nindices;
892 mesh.vertices = vertices;
893 mesh.indices = indices;
894
895 if( nvertices > 0 ){
896 // Measure the farthest bounds of the vertices.
897 // Start with the first vertex so that the origin does not matter.
898 GLfloat *p = vertices[0].position;
899 mesh.xmin = p[0];
900 mesh.xmax = p[0];
901 mesh.ymin = p[1];
902 mesh.ymax = p[1];
903 mesh.zmin = p[2];
904 mesh.zmax = p[2];
905 for( size_t i = 1; i < nvertices; i++ ){
906 p = vertices[i].position;
907 if( p[0] < mesh.xmin ) mesh.xmin = p[0];
908 if( p[0] > mesh.xmax ) mesh.xmax = p[0];
909 if( p[1] < mesh.ymin ) mesh.ymin = p[1];
910 if( p[1] > mesh.ymax ) mesh.ymax = p[1];
911 if( p[2] < mesh.zmin ) mesh.zmin = p[2];
912 if( p[2] > mesh.zmax ) mesh.zmax = p[2];
913 }
914 }
915
916 if( fgcVerbose ){
917 printf( "%s%s\n", ( streaming ? "STREAMING " : "" ), "VAO" );
918 printf( "Number of vertices: %lu\n", nvertices );
919 printf( "Number of indices: %lu\n", nindices );
920 }
921
922 // Generate a VAO (1 per mesh)
923 glGenVertexArrays( 1, &mesh.vao[0] );
924 // Switch graphics memory to the VAO
925 glBindVertexArray( mesh.vao[0] );
926
927 // Turn on 4 attribute arrays.
928 glEnableVertexAttribArray( 0 ); // Position
929 glEnableVertexAttribArray( 1 ); // Normal
930 glEnableVertexAttribArray( 2 ); // UV
931
932 // Generate a vertex buffer and an index buffer.
933 glGenBuffers( 2, &mesh.vao[1] );
934
935 // Switch to the vertex buffer.
936 glBindBuffer( GL_ARRAY_BUFFER, mesh.vao[1] );
937 // Upload the vertices, passing the size in bytes.
938 glBufferData(
939 GL_ARRAY_BUFFER,
940 nvertices * sizeof(FGCVertex),
941 vertices,
942 streaming ? GL_STREAM_DRAW : GL_STATIC_DRAW
943 );
944
945 // Set vertex attribute offsets.
946 size_t pointer = 0;
947 glVertexAttribPointer( 0, 3, GL_FLOAT, GL_FALSE, sizeof(FGCVertex), (const GLvoid*)pointer ); // Position
948 pointer += 3 * sizeof(GLfloat);
949 glVertexAttribPointer( 1, 3, GL_FLOAT, GL_FALSE, sizeof(FGCVertex), (const GLvoid*)pointer ); // Normal
950 pointer += 3 * sizeof(GLfloat);
951 glVertexAttribPointer( 2, 2, GL_FLOAT, GL_FALSE, sizeof(FGCVertex), (const GLvoid*)pointer ); // UV
952
953 // Switch to the index buffer.
954 glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, mesh.vao[2] );
955 // Upload the indices, passing the size in bytes.
956 glBufferData(
957 GL_ELEMENT_ARRAY_BUFFER,
958 nindices * sizeof(FGCIndex),
959 indices,
960 streaming ? GL_STREAM_DRAW : GL_STATIC_DRAW
961 );
962
963 // Switch out of the VAO.
964 glBindVertexArray( 0 );
965
966 // TODO: Failure conditions.
967 mesh.success = true;
968
969 return mesh;
970 }
971
972 FGCMesh fgcLoadOBJ( const char* filePath ){
973 if( fgcVerbose ) printf( "OBJ MESH\n" );
974
975 FILE* file = fopen( filePath, "rb" );
976
977 if( !file ){
978 fprintf( stderr, "Failed to open %s\n", filePath );
979 FGCMesh mesh;
980 mesh.success = false;
981 return mesh;
982 }
983
984 FGCVertex *verts = realloc( NULL, sizeof(FGCVertex) );
985 FGCIndex *inds = realloc( NULL, sizeof(FGCIndex) );
986
987 struct float3 { GLfloat x, y, z; };
988 struct float2 { GLfloat u, v; };
989 struct obdex { int v1, vt1, vn1, v2, vt2, vn2, v3, vt3, vn3; };
990
991 //std::vector<float3> obj_v, obj_vn;
992 //std::vector<float2> obj_vt;
993 //std::vector<obdex> obj_f;
994
995 char ln[1024];
996
997 // Read the file, one line at a time.
998 while( fgets( ln, sizeof(ln), file ) ){
999 if( ln[0] && ln[0] != '#' ){
1000 // TODO.
1001 // { strtof( str, str_end ), strtof( str, str_end ), strtof( str, str_end ) }
1002 }
1003 }
1004
1005 fclose( file );
1006
1007 /*
1008 size_t head = 0, tail = 0;
1009
1010 do{
1011 line++;
1012 tail = text.find_first_of( "\n", head );
1013 if( tail == std::string::npos ) tail = text.size();
1014 if( text[ head ] != '#' ){
1015 std::string ln = text.substr( head, tail - head );
1016
1017 std::vector<std::string> s;
1018
1019 size_t i1 = 0, i2 = 0;
1020
1021 do{
1022 i2 = ln.find_first_of( " \r/", i1 );
1023 if( i2 == std::string::npos ) i2 = ln.size();
1024 std::string value = ln.substr( i1, i2 - i1 );
1025 if( value.length() > 0 ) s.push_back( value );
1026 i1 = i2 + 1;
1027 }while( i1 < ln.size() );
1028
1029 if( s.size() > 0 ){
1030 if( s[0] == "v" && s.size() >= 4 ){
1031 obj_v.push_back( { std::stof(s[1]), std::stof(s[2]), std::stof(s[3]) } );
1032 }else if( s[0] == "vt" && s.size() >= 3 ){
1033 // Flip the vertical texture coordinate.
1034 obj_vt.push_back( { std::stof(s[1]), 1.0f - std::stof(s[2]) } );
1035 }else if( s[0] == "vn" && s.size() >= 4 ){
1036 obj_vn.push_back( { std::stof(s[1]), std::stof(s[2]), std::stof(s[3]) } );
1037 }else if( s[0] == "f" && s.size() >= 10 ){
1038 obj_f.push_back( {
1039 std::stoi(s[1]),
1040 std::stoi(s[2]),
1041 std::stoi(s[3]),
1042 std::stoi(s[4]),
1043 std::stoi(s[5]),
1044 std::stoi(s[6]),
1045 std::stoi(s[7]),
1046 std::stoi(s[8]),
1047 std::stoi(s[9])
1048 } );
1049 }
1050 }
1051 }
1052 head = tail + 1;
1053 }while( head < text.size() );
1054
1055 if( verbose ){
1056 printf( "Vertex positions: %lu\n", obj_v.size() );
1057 printf( "Vertex texcoords: %lu\n", obj_vt.size() );
1058 printf( "Vertex normals: %lu\n", obj_vn.size() );
1059 printf( "Faces: %lu\n", obj_f.size() );
1060 }
1061
1062 // Group vertex attributes by texture coordinates.
1063 std::vector<Vertex> verts( obj_vt.size() );
1064 std::vector<Index> inds;
1065
1066 for( obdex f : obj_f ){
1067 Index a = f.vt1 - 1, b = f.vt2 - 1, c = f.vt3 - 1;
1068 verts[ a ] = {
1069 { obj_v[ f.v1 - 1 ].x, obj_v[ f.v1 - 1 ].y, obj_v[ f.v1 - 1 ].z },
1070 { obj_vn[ f.vn1 - 1 ].x, obj_vn[ f.vn1 - 1 ].y, obj_vn[ f.vn1 - 1 ].z },
1071 { 0.0f, 0.0f, 0.0f },
1072 { obj_vt[ a ].u, obj_vt[ a ].v }
1073 };
1074 verts[ b ] = {
1075 { obj_v[ f.v2 - 1 ].x, obj_v[ f.v2 - 1 ].y, obj_v[ f.v2 - 1 ].z },
1076 { obj_vn[ f.vn2 - 1 ].x, obj_vn[ f.vn2 - 1 ].y, obj_vn[ f.vn2 - 1 ].z },
1077 { 0.0f, 0.0f, 0.0f },
1078 { obj_vt[ b ].u, obj_vt[ b ].v }
1079 };
1080 verts[ c ] = {
1081 { obj_v[ f.v3 - 1 ].x, obj_v[ f.v3 - 1 ].y, obj_v[ f.v3 - 1 ].z },
1082 { obj_vn[ f.vn3 - 1 ].x, obj_vn[ f.vn3 - 1 ].y, obj_vn[ f.vn3 - 1 ].z },
1083 { 0.0f, 0.0f, 0.0f },
1084 { obj_vt[ c ].u, obj_vt[ c ].v }
1085 };
1086 Index i[3] = { a, b, c };
1087 inds.insert( std::end( inds ), std::begin( i ), std::end( i ) );
1088 }
1089
1090 normalizeVertices( verts );
1091 */
1092
1093 // TODO: Use actual counts.
1094 if( fgcVerbose ){
1095 printf( "Vertices: %lu\n", (size_t)1 );
1096 printf( "Indices: %lu\n", (size_t)1 );
1097 }
1098
1099 return fgcLoadMesh( 1, 1, verts, inds, false );
1100 }
1101
1102 // Free the VAO and buffers.
1103 // This does not free the mesh's vertices and indices stored in client
1104 // memory. You must manage that area of memory yourself using malloc and
1105 // free or similar. See fgcLoadMesh.
1106 void fgcFreeMesh( FGCMesh *mesh ){
1107 glDeleteBuffers( 2, &mesh->vao[1] );
1108 glDeleteVertexArrays( 1, &mesh->vao[0] );
1109 mesh->success = false;
1110 }
1111
1112 // Update an existing VAO with new vertices and indices.
1113 // fgcUpdateMesh does not manage heap memory for *vertices and *indices.
1114 // You must malloc them before calling this function and free them when
1115 // deleting the mesh.
1116 void fgcUpdateMesh(
1117 FGCMesh *mesh,
1118 size_t nvertices,
1119 size_t nindices,
1120 FGCVertex *vertices,
1121 FGCIndex *indices,
1122 bool streaming ){
1123 // Switch graphics memory to the VAO.
1124 glBindVertexArray( mesh->vao[0] );
1125
1126 // Switch to the vertex buffer.
1127 glBindBuffer( GL_ARRAY_BUFFER, mesh->vao[1] );
1128 // Upload the vertices, passing the size in bytes.
1129 glBufferData(
1130 GL_ARRAY_BUFFER,
1131 nvertices * sizeof(FGCVertex),
1132 vertices,
1133 streaming ? GL_STREAM_DRAW : GL_STATIC_DRAW
1134 );
1135
1136 // Switch to the index buffer.
1137 glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, mesh->vao[2] );
1138 // Upload the indices, passing the size in bytes.
1139 glBufferData(
1140 GL_ELEMENT_ARRAY_BUFFER,
1141 nindices * sizeof(FGCIndex),
1142 indices,
1143 streaming ? GL_STREAM_DRAW : GL_STATIC_DRAW
1144 );
1145
1146 mesh->vertices = vertices;
1147 mesh->indices = indices;
1148 }
1149
1150 // Draw a VAO with a world space object transform specified by modelMat,
1151 // a world space camera transform specified by viewMat, and a camera
1152 // projection matrix specified by projMat.
1153 // You should set properties such as textures and lighting before
1154 // calling this function.
1155 void fgcDrawMesh(
1156 FGCMesh *mesh,
1157 mat4 modelMat,
1158 mat4 viewMat,
1159 mat4 projMat ){
1160 if( !mesh->success ){
1161 return;
1162 }
1163
1164 mat4 mv = mat4MultiplyMatrix( mat4Inverse( viewMat ), modelMat );
1165 mat4 mvp = mat4MultiplyMatrix( projMat, mv );
1166 mat4 normal = mat4Transpose( mat4Inverse( modelMat ) );
1167
1168 const GLfloat glmats[96] = { // TODO: Don't send all matrices at once.
1169 (GLfloat)mvp.m[0][0], (GLfloat)mvp.m[0][1], (GLfloat)mvp.m[0][2], (GLfloat)mvp.m[0][3],
1170 (GLfloat)mvp.m[1][0], (GLfloat)mvp.m[1][1], (GLfloat)mvp.m[1][2], (GLfloat)mvp.m[1][3],
1171 (GLfloat)mvp.m[2][0], (GLfloat)mvp.m[2][1], (GLfloat)mvp.m[2][2], (GLfloat)mvp.m[2][3],
1172 (GLfloat)mvp.m[3][0], (GLfloat)mvp.m[3][1], (GLfloat)mvp.m[3][2], (GLfloat)mvp.m[3][3],
1173 (GLfloat)mv.m[0][0], (GLfloat)mv.m[0][1], (GLfloat)mv.m[0][2], (GLfloat)mv.m[0][3],
1174 (GLfloat)mv.m[1][0], (GLfloat)mv.m[1][1], (GLfloat)mv.m[1][2], (GLfloat)mv.m[1][3],
1175 (GLfloat)mv.m[2][0], (GLfloat)mv.m[2][1], (GLfloat)mv.m[2][2], (GLfloat)mv.m[2][3],
1176 (GLfloat)mv.m[3][0], (GLfloat)mv.m[3][1], (GLfloat)mv.m[3][2], (GLfloat)mv.m[3][3],
1177 (GLfloat)modelMat.m[0][0], (GLfloat)modelMat.m[0][1], (GLfloat)modelMat.m[0][2], (GLfloat)modelMat.m[0][3],
1178 (GLfloat)modelMat.m[1][0], (GLfloat)modelMat.m[1][1], (GLfloat)modelMat.m[1][2], (GLfloat)modelMat.m[1][3],
1179 (GLfloat)modelMat.m[2][0], (GLfloat)modelMat.m[2][1], (GLfloat)modelMat.m[2][2], (GLfloat)modelMat.m[2][3],
1180 (GLfloat)modelMat.m[3][0], (GLfloat)modelMat.m[3][1], (GLfloat)modelMat.m[3][2], (GLfloat)modelMat.m[3][3],
1181 (GLfloat)normal.m[0][0], (GLfloat)normal.m[0][1], (GLfloat)normal.m[0][2], (GLfloat)normal.m[0][3],
1182 (GLfloat)normal.m[1][0], (GLfloat)normal.m[1][1], (GLfloat)normal.m[1][2], (GLfloat)normal.m[1][3],
1183 (GLfloat)normal.m[2][0], (GLfloat)normal.m[2][1], (GLfloat)normal.m[2][2], (GLfloat)normal.m[2][3],
1184 (GLfloat)normal.m[3][0], (GLfloat)normal.m[3][1], (GLfloat)normal.m[3][2], (GLfloat)normal.m[3][3],
1185 (GLfloat)fgcTexMatrix.m[0][0], (GLfloat)fgcTexMatrix.m[0][1], (GLfloat)fgcTexMatrix.m[0][2], (GLfloat)fgcTexMatrix.m[0][3],
1186 (GLfloat)fgcTexMatrix.m[1][0], (GLfloat)fgcTexMatrix.m[1][1], (GLfloat)fgcTexMatrix.m[1][2], (GLfloat)fgcTexMatrix.m[1][3],
1187 (GLfloat)fgcTexMatrix.m[2][0], (GLfloat)fgcTexMatrix.m[2][1], (GLfloat)fgcTexMatrix.m[2][2], (GLfloat)fgcTexMatrix.m[2][3],
1188 (GLfloat)fgcTexMatrix.m[3][0], (GLfloat)fgcTexMatrix.m[3][1], (GLfloat)fgcTexMatrix.m[3][2], (GLfloat)fgcTexMatrix.m[3][3],
1189 (GLfloat)fgcLightMatrix.m[0][0], (GLfloat)fgcLightMatrix.m[0][1], (GLfloat)fgcLightMatrix.m[0][2], (GLfloat)fgcLightMatrix.m[0][3],
1190 (GLfloat)fgcLightMatrix.m[1][0], (GLfloat)fgcLightMatrix.m[1][1], (GLfloat)fgcLightMatrix.m[1][2], (GLfloat)fgcLightMatrix.m[1][3],
1191 (GLfloat)fgcLightMatrix.m[2][0], (GLfloat)fgcLightMatrix.m[2][1], (GLfloat)fgcLightMatrix.m[2][2], (GLfloat)fgcLightMatrix.m[2][3],
1192 (GLfloat)fgcLightMatrix.m[3][0], (GLfloat)fgcLightMatrix.m[3][1], (GLfloat)fgcLightMatrix.m[3][2], (GLfloat)fgcLightMatrix.m[3][3]
1193 };
1194
1195 glUniformMatrix4fv( fgcDrawPipeline.u_matrices, 6, GL_FALSE, glmats );
1196
1197 // Send the camera position relative to the object's origin.
1198 glUniform3f(
1199 fgcDrawPipeline.u_camera,
1200 viewMat.m[3][0] - modelMat.m[3][0],
1201 viewMat.m[3][1] - modelMat.m[3][1],
1202 viewMat.m[3][2] - modelMat.m[3][2]
1203 );
1204
1205 // Switch graphics memory to the VAO.
1206 glBindVertexArray( mesh->vao[0] );
1207
1208 glDrawElements( GL_TRIANGLES, mesh->nindices, GL_UNSIGNED_INT, (const GLvoid*)0 );
1209 }
1210
1211 // Draw a skybox behind the objects that have already been drawn.
1212 // Uses the Z-buffer for front-to-back rendering.
1213 void fgcDrawSkybox(
1214 FGCTexture tex,
1215 mat4 viewMat,
1216 mat4 projMat,
1217 FGCColor tint ){
1218 if( !fgcSkyboxPipeline.success ) return;
1219 FGCPipeline old_pipeline = fgcDrawPipeline;
1220 fgcSetPipeline( fgcSkyboxPipeline );
1221 glUniform4f( fgcDrawPipeline.u_fog, tint.r, tint.g, tint.b, tint.a );
1222 glDisable( GL_CULL_FACE );
1223 fgcSetTexture( tex, 0 );
1224 // Extract the 3x3 rotation matrix from the view matrix.
1225 // The camera is effectively at <0,0,0> with the skybox.
1226 fgcDrawMesh(
1227 &fgcCubeMesh,
1228 MAT4_IDEN,
1229 MAT4(
1230 viewMat.m[0][0], viewMat.m[0][1], viewMat.m[0][2], 0.0,
1231 viewMat.m[1][0], viewMat.m[1][1], viewMat.m[1][2], 0.0,
1232 viewMat.m[2][0], viewMat.m[2][1], viewMat.m[2][2], 0.0,
1233 0.0, 0.0, 0.0, 1.0
1234 ),
1235 projMat
1236 );
1237 glUniform4f( fgcDrawPipeline.u_fog, fgcFogColor.r, fgcFogColor.g, fgcFogColor.b, fgcFogColor.a );
1238 fgcSetPipeline( old_pipeline );
1239 glEnable( GL_CULL_FACE );
1240 }
1241
1242 // Load a texture from an image file.
1243 FGCTexture fgcLoadTexture(
1244 const char* filePath,
1245 bool mipmap,
1246 bool filter ){
1247 FGCTexture tex;
1248 tex.success = false;
1249
1250 SDL_Surface *surface = _fgcLoadSurface( filePath );
1251 if( !surface ) return tex;
1252
1253 glGenTextures( 1, &tex.texture );
1254 glBindTexture( GL_TEXTURE_2D, tex.texture );
1255
1256 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
1257 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );
1258
1259 glTexParameteri(
1260 GL_TEXTURE_2D,
1261 GL_TEXTURE_MIN_FILTER,
1262 mipmap ? ( filter ? GL_LINEAR_MIPMAP_LINEAR : GL_NEAREST_MIPMAP_LINEAR ) : ( filter ? GL_LINEAR : GL_NEAREST )
1263 );
1264 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter ? GL_LINEAR : GL_NEAREST );
1265
1266 glPixelStorei(
1267 GL_UNPACK_ALIGNMENT,
1268 surface->pitch % 8 == 0 ? 8 // most efficient
1269 : ( surface->pitch % 4 == 0 ? 4 // common value
1270 : ( surface->pitch % 2 == 0 ? 2 // dubious efficiency
1271 : 1 // least efficient
1272 ) ) );
1273
1274 // GLES2 has no concept of gamma correction or sRGB. TODO
1275 // https://www.khronos.org/registry/OpenGL-Refpages/es2.0/xhtml/glTexImage2D.xml
1276 glTexImage2D(
1277 GL_TEXTURE_2D,
1278 0,
1279 GL_RGBA,
1280 surface->w,
1281 surface->h,
1282 0,
1283 GL_RGBA,
1284 GL_UNSIGNED_BYTE,
1285 surface->pixels
1286 );
1287 if( mipmap ) glGenerateMipmap( GL_TEXTURE_2D );
1288
1289 tex.success = true;
1290 tex.width = surface->w;
1291 tex.height = surface->h;
1292 tex.channels = 4;
1293 tex.mipmap = mipmap;
1294 tex.type = GL_TEXTURE_2D;
1295
1296 SDL_FreeSurface( surface );
1297
1298 return tex;
1299 }
1300
1301 // Generate and load a 1x1 pixel texture whose only content is a color.
1302 FGCTexture fgcLoadSolidColorTexture( FGCColor c ){
1303 FGCTexture tex;
1304
1305 unsigned char bytes[] = {
1306 (unsigned char)round( c.r * 255.0 ),
1307 (unsigned char)round( c.g * 255.0 ),
1308 (unsigned char)round( c.b * 255.0 ),
1309 (unsigned char)round( c.a * 255.0 )
1310 };
1311
1312 glGenTextures( 1, &tex.texture );
1313 glBindTexture( GL_TEXTURE_2D, tex.texture );
1314
1315 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
1316 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
1317
1318 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
1319 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
1320
1321 // Image is exactly 4 bytes.
1322 glPixelStorei( GL_UNPACK_ALIGNMENT, 4 );
1323
1324 glTexImage2D(
1325 GL_TEXTURE_2D,
1326 0,
1327 GL_RGBA,
1328 1,
1329 1,
1330 0,
1331 GL_RGBA,
1332 GL_UNSIGNED_BYTE,
1333 bytes
1334 );
1335
1336 tex.success = true;
1337 tex.width = 1;
1338 tex.height = 1;
1339 tex.channels = 4;
1340 tex.mipmap = false;
1341 tex.type = GL_TEXTURE_2D;
1342
1343 return tex;
1344 }
1345
1346 // Switch the specified texture slot to the specified texture.
1347 void fgcSetTexture( FGCTexture tex, GLuint texSlot ){
1348 if( tex.success ){
1349 glActiveTexture( GL_TEXTURE0 + texSlot );
1350 glBindTexture( tex.type, tex.texture );
1351 }
1352 }
1353
1354 // Open a window with a GL context.
1355 // FGCDisplayInfo disp = fghCreateDisplay( 800, 600, "Test", 0, false, true );
1356 FGCDisplayInfo fgcCreateDisplay(
1357 int width,
1358 int height,
1359 const char* title,
1360 int multisample,
1361 bool hidef,
1362 bool vsync ){
1363 FGCDisplayInfo disp;
1364 disp.success = false;
1365 disp.width = width;
1366 disp.height = height;
1367
1368 if( SDL_Init( SDL_INIT_VIDEO ) < 0 ){
1369 fprintf( stderr, "Failed to initialize SDL.\n" );
1370 return disp;
1371 }
1372
1373 if( fgcVerbose ) printf( "Creating GL window...\n" );
1374
1375 SDL_GL_LoadLibrary( NULL );
1376 #ifdef GLAD_GL
1377 SDL_GL_SetAttribute( SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE );
1378 SDL_GL_SetAttribute( SDL_GL_CONTEXT_MAJOR_VERSION, 3 );
1379 SDL_GL_SetAttribute( SDL_GL_CONTEXT_MINOR_VERSION, 3 );
1380 #else // GLES
1381 SDL_GL_SetAttribute( SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES );
1382 SDL_GL_SetAttribute( SDL_GL_CONTEXT_MAJOR_VERSION, 3 );
1383 SDL_GL_SetAttribute( SDL_GL_CONTEXT_MINOR_VERSION, 0 );
1384 #endif
1385
1386 if( multisample > 1 ){
1387 SDL_GL_SetAttribute( SDL_GL_MULTISAMPLEBUFFERS, 1 );
1388 SDL_GL_SetAttribute( SDL_GL_MULTISAMPLESAMPLES, multisample );
1389 }
1390
1391 if( width == 0 && height == 0 ){
1392 fgcWindow = SDL_CreateWindow(
1393 title,
1394 SDL_WINDOWPOS_UNDEFINED,
1395 SDL_WINDOWPOS_UNDEFINED,
1396 0,
1397 0,
1398 hidef ?
1399 ( SDL_WINDOW_FULLSCREEN_DESKTOP | SDL_WINDOW_OPENGL | SDL_WINDOW_ALLOW_HIGHDPI ) :
1400 ( SDL_WINDOW_FULLSCREEN_DESKTOP | SDL_WINDOW_OPENGL )
1401 );
1402 SDL_GL_GetDrawableSize( fgcWindow, &disp.width, &disp.height );
1403 }else{
1404 fgcWindow = SDL_CreateWindow(
1405 title,
1406 SDL_WINDOWPOS_CENTERED,
1407 SDL_WINDOWPOS_CENTERED,
1408 width,
1409 height,
1410 hidef ?
1411 ( SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI ) :
1412 ( SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE )
1413 );
1414 }
1415 if( !fgcWindow ){
1416 fprintf( stderr, "Failed to create GL window.\n" );
1417 return disp;
1418 }
1419 fgcContext = SDL_GL_CreateContext( fgcWindow );
1420 if( !fgcContext ){
1421 fprintf( stderr, "Failed to create GL context.\n" );
1422 return disp;
1423 }
1424
1425 if( vsync ){
1426 // Try to set up late swap tearing or vsync.
1427 if( SDL_GL_SetSwapInterval( -1 ) < 0 )
1428 if( SDL_GL_SetSwapInterval( 1 ) < 0 ) SDL_GL_SetSwapInterval( 0 );
1429 }else{
1430 // No vsync.
1431 SDL_GL_SetSwapInterval( 0 );
1432 }
1433
1434 #ifdef GLAD_GL
1435 if( gladLoadGL( (GLADloadfunc)SDL_GL_GetProcAddress ) == 0 ){
1436 #else // GLES
1437 if( gladLoadGLES2( (GLADloadfunc)SDL_GL_GetProcAddress ) == 0 ){
1438 #endif
1439 fprintf( stderr, "Failed to use extension loader.\n" );
1440 return disp;
1441 }
1442
1443 if( fgcVerbose ){
1444 printf( "Success!\n" );
1445 printf( "OpenGL vendor: %s\n", glGetString( GL_VENDOR ) );
1446 printf( "OpenGL renderer: %s\n", glGetString( GL_RENDERER ) );
1447 printf( "OpenGL version: %s\n", glGetString( GL_VERSION ) );
1448 printf( "GLSL version: %s\n", glGetString( GL_SHADING_LANGUAGE_VERSION ) );
1449 }
1450
1451 glEnable( GL_CULL_FACE );
1452 glEnable( GL_DEPTH_TEST );
1453 glDepthFunc( GL_LEQUAL );
1454 glDepthMask( GL_TRUE );
1455
1456 // Default to a white background, as is standard on a webpage.
1457 glClearColor( 1.0f, 1.0f, 1.0f, 1.0f );
1458
1459 fgcUnlitPipeline =
1460 fgcLoadPipeline( fgcUnlitVert, fgcUnlitFrag, fgcUnlitSamplers );
1461 if( fgcUnlitPipeline.success ){
1462 if( fgcVerbose )
1463 printf( "Unlit pipeline loaded successfully.\n" );
1464 }else{
1465 fprintf( stderr, "Failed to load unlit pipeline.\n" );
1466 return disp;
1467 }
1468 fgcSetPipeline( fgcUnlitPipeline );
1469
1470 fgcColorModPipeline =
1471 fgcLoadPipeline( fgcUnlitVert, fgcColorModFrag, fgcColorModSamplers );
1472 if( fgcColorModPipeline.success ){
1473 if( fgcVerbose )
1474 printf( "Color mod pipeline loaded successfully.\n" );
1475 }else{
1476 fprintf( stderr, "Failed to load color mod pipeline.\n" );
1477 return disp;
1478 }
1479
1480 fgcSkyboxPipeline =
1481 fgcLoadPipeline( fgcSkyboxVert, fgcSkyboxFrag, fgcSkyboxSamplers );
1482 if( fgcSkyboxPipeline.success ){
1483 if( fgcVerbose )
1484 printf( "Skybox pipeline loaded successfully.\n" );
1485 }else{
1486 fprintf( stderr, "Failed to load skybox pipeline.\n" );
1487 return disp;
1488 }
1489
1490 size_t nvertices = 4, nindices = 6;
1491 FGCVertex *vertices = (FGCVertex*)malloc( nvertices * sizeof(FGCVertex) );
1492 vertices[0] = (FGCVertex){ { -0.5, 0.5, 0.0 }, { 0.0, 0.0, 1.0 }, { 0.0, 0.0 } };
1493 vertices[1] = (FGCVertex){ { -0.5, -0.5, 0.0 }, { 0.0, 0.0, 1.0 }, { 0.0, 1.0 } };
1494 vertices[2] = (FGCVertex){ { 0.5, -0.5, 0.0 }, { 0.0, 0.0, 1.0 }, { 1.0, 1.0 } };
1495 vertices[3] = (FGCVertex){ { 0.5, 0.5, 0.0 }, { 0.0, 0.0, 1.0 }, { 1.0, 0.0 } };
1496 FGCIndex planeInds[] = { 0, 1, 2, 2, 3, 0 };
1497 fgcPlaneMesh = fgcLoadMesh(
1498 nvertices,
1499 nindices,
1500 vertices,
1501 (FGCIndex*)_fgcBufDup( (void*)planeInds, nindices * sizeof(FGCIndex) ),
1502 false
1503 );
1504 if( fgcPlaneMesh.success ){
1505 if( fgcVerbose ) printf( "Plane mesh loaded successfully.\n" );
1506 }else{
1507 fprintf( stderr, "Failed to load plane mesh.\n" );
1508 return disp;
1509 }
1510
1511 nvertices = 24;
1512 nindices = 36;
1513 vertices = (FGCVertex*)malloc( nvertices * sizeof(FGCVertex) );
1514 vertices[ 0] = (FGCVertex){ { -0.5, 0.5, 0.5 }, { 0.0, 0.0, 1.0 }, { 0.0, 0.0 } };
1515 vertices[ 1] = (FGCVertex){ { -0.5, -0.5, 0.5 }, { 0.0, 0.0, 1.0 }, { 0.0, 1.0 } };
1516 vertices[ 2] = (FGCVertex){ { 0.5, -0.5, 0.5 }, { 0.0, 0.0, 1.0 }, { 1.0, 1.0 } };
1517 vertices[ 3] = (FGCVertex){ { 0.5, 0.5, 0.5 }, { 0.0, 0.0, 1.0 }, { 1.0, 0.0 } };
1518 vertices[ 4] = (FGCVertex){ { 0.5, 0.5, 0.5 }, { 1.0, 0.0, 0.0 }, { 0.0, 0.0 } };
1519 vertices[ 5] = (FGCVertex){ { 0.5, -0.5, 0.5 }, { 1.0, 0.0, 0.0 }, { 0.0, 1.0 } };
1520 vertices[ 6] = (FGCVertex){ { 0.5, -0.5, -0.5 }, { 1.0, 0.0, 0.0 }, { 1.0, 1.0 } };
1521 vertices[ 7] = (FGCVertex){ { 0.5, 0.5, -0.5 }, { 1.0, 0.0, 0.0 }, { 1.0, 0.0 } };
1522 vertices[ 8] = (FGCVertex){ { -0.5, 0.5, -0.5 }, { -1.0, 0.0, 0.0 }, { 0.0, 0.0 } };
1523 vertices[ 9] = (FGCVertex){ { -0.5, -0.5, -0.5 }, { -1.0, 0.0, 0.0 }, { 0.0, 1.0 } };
1524 vertices[10] = (FGCVertex){ { -0.5, -0.5, 0.5 }, { -1.0, 0.0, 0.0 }, { 1.0, 1.0 } };
1525 vertices[11] = (FGCVertex){ { -0.5, 0.5, 0.5 }, { -1.0, 0.0, 0.0 }, { 1.0, 0.0 } };
1526 vertices[12] = (FGCVertex){ { 0.5, 0.5, -0.5 }, { 0.0, 0.0, -1.0 }, { 0.0, 0.0 } };
1527 vertices[13] = (FGCVertex){ { 0.5, -0.5, -0.5 }, { 0.0, 0.0, -1.0 }, { 0.0, 1.0 } };
1528 vertices[14] = (FGCVertex){ { -0.5, -0.5, -0.5 }, { 0.0, 0.0, -1.0 }, { 1.0, 1.0 } };
1529 vertices[15] = (FGCVertex){ { -0.5, 0.5, -0.5 }, { 0.0, 0.0, -1.0 }, { 1.0, 0.0 } };
1530 vertices[16] = (FGCVertex){ { -0.5, 0.5, -0.5 }, { 0.0, 1.0, 0.0 }, { 1.0, 1.0 } };
1531 vertices[17] = (FGCVertex){ { -0.5, 0.5, 0.5 }, { 0.0, 1.0, 0.0 }, { 1.0, 0.0 } };
1532 vertices[18] = (FGCVertex){ { 0.5, 0.5, 0.5 }, { 0.0, 1.0, 0.0 }, { 0.0, 0.0 } };
1533 vertices[19] = (FGCVertex){ { 0.5, 0.5, -0.5 }, { 0.0, 1.0, 0.0 }, { 0.0, 1.0 } };
1534 vertices[20] = (FGCVertex){ { -0.5, -0.5, 0.5 }, { 0.0, -1.0, 0.0 }, { 0.0, 0.0 } };
1535 vertices[21] = (FGCVertex){ { -0.5, -0.5, -0.5 }, { 0.0, -1.0, 0.0 }, { 0.0, 1.0 } };
1536 vertices[22] = (FGCVertex){ { 0.5, -0.5, -0.5 }, { 0.0, -1.0, 0.0 }, { 1.0, 1.0 } };
1537 vertices[23] = (FGCVertex){ { 0.5, -0.5, 0.5 }, { 0.0, -1.0, 0.0 }, { 1.0, 0.0 } };
1538 FGCIndex cubeInds[] = {
1539 0, 1, 2, 2, 3, 0,
1540 4, 5, 6, 6, 7, 4,
1541 8, 9, 10, 10, 11, 8,
1542 12, 13, 14, 14, 15, 12,
1543 16, 17, 18, 18, 19, 16,
1544 20, 21, 22, 22, 23, 20
1545 };
1546 fgcCubeMesh = fgcLoadMesh(
1547 nvertices,
1548 nindices,
1549 vertices,
1550 (FGCIndex*)_fgcBufDup( (void*)cubeInds, nindices * sizeof(FGCIndex) ),
1551 false
1552 );
1553 if( fgcCubeMesh.success ){
1554 if( fgcVerbose ) printf( "Cube mesh loaded successfully.\n" );
1555 }else{
1556 fprintf( stderr, "Failed to load cube mesh.\n" );
1557 return disp;
1558 }
1559
1560 disp.success = true;
1561
1562 return disp;
1563 }
1564
1565 // Get the width of the drawing surface in pixels.
1566 int fgcGetDisplayWidth(){
1567 int width;
1568 SDL_GL_GetDrawableSize( fgcWindow, &width, NULL );
1569 return width;
1570 }
1571
1572 // Get the height of the drawing surface in pixels.
1573 int fgcGetDisplayHeight(){
1574 int height;
1575 SDL_GL_GetDrawableSize( fgcWindow, NULL, &height );
1576 return height;
1577 }
1578
1579 int fgcUpKey(){
1580 return fgcKeyStates[ SDL_SCANCODE_UP ];
1581 }
1582
1583 int fgcDownKey(){
1584 return fgcKeyStates[ SDL_SCANCODE_DOWN ];
1585 }
1586
1587 int fgcLeftKey(){
1588 return fgcKeyStates[ SDL_SCANCODE_LEFT ];
1589 }
1590
1591 int fgcRightKey(){
1592 return fgcKeyStates[ SDL_SCANCODE_RIGHT ];
1593 }
1594
1595 int fgcShiftKey(){
1596 return fgcKeyStates[ SDL_SCANCODE_LSHIFT ]
1597 || fgcKeyStates[ SDL_SCANCODE_RSHIFT ];
1598 }
1599
1600 int fgcAltKey(){
1601 return fgcKeyStates[ SDL_SCANCODE_LALT ]
1602 || fgcKeyStates[ SDL_SCANCODE_RALT ];
1603 }
1604
1605 int fgcCommandKey(){
1606 return fgcKeyStates[ SDL_SCANCODE_LGUI ]
1607 || fgcKeyStates[ SDL_SCANCODE_RGUI ];
1608 }
1609
1610 int fgcControlKey(){
1611 return fgcKeyStates[ SDL_SCANCODE_LCTRL ]
1612 || fgcKeyStates[ SDL_SCANCODE_RCTRL ];
1613 }
1614
1615 int fgcEnterKey(){
1616 return fgcKeyStates[ SDL_SCANCODE_RETURN ]
1617 || fgcKeyStates[ SDL_SCANCODE_KP_ENTER ];
1618 }
1619
1620 int fgcEscapeKey(){
1621 return fgcKeyStates[ SDL_SCANCODE_ESCAPE ];
1622 }
1623
1624 int fgcSpaceKey(){
1625 return fgcKeyStates[ SDL_SCANCODE_SPACE ];
1626 }
1627
1628 int fgcTabKey(){
1629 return fgcKeyStates[ SDL_SCANCODE_TAB ];
1630 }
1631
1632 int fgcCharKey( char key ){
1633 if( key >= 'A' && key <= 'Z' ) key = key - 'A' + 'a';
1634 if( key >= 'a' && key <= 'z' ){
1635 return fgcKeyStates[ key - 'a' + SDL_SCANCODE_A ];
1636 }else if( key >= '0' && key <= '9' ){
1637 key = key == '0' ? 9 : key - '1';
1638 return fgcKeyStates[ key + SDL_SCANCODE_1 ] || fgcKeyStates[ key + SDL_SCANCODE_KP_1 ];
1639 }
1640 return 0;
1641 }
1642
1643 // Returns true if the specified button is pressed. The button numbers
1644 // on a 3-button mouse are 1, 2, and 4.
1645 bool fgcMouseButton( int button ){
1646 return ( fgcMouseButtonMask & button ) != 0;
1647 }
1648
1649 void fgcShowMouse( bool show ){
1650 SDL_ShowCursor( show ? SDL_ENABLE : SDL_DISABLE );
1651 }
1652
1653 void fgcTrapMouse( bool trap ){
1654 if( SDL_SetRelativeMouseMode( trap ? SDL_TRUE : SDL_FALSE ) > -1 ){
1655 fgcMouseTrapped = trap;
1656 }else{
1657 fgcMouseTrapped = false;
1658 }
1659 }
1660
1661 // Use loop as the program's main render loop. Executes synchronously on
1662 // desktop. The loop function must accept a delta time parameter as
1663 // double.
1664 void fgcSetMainLoop( void (*loop)(double) ){
1665 Uint64 last = 0;
1666 while( true ){
1667 Uint64 now = SDL_GetPerformanceCounter();
1668 if( last == 0 ) last = now;
1669 int width, height;
1670 SDL_GL_GetDrawableSize( fgcWindow, &width, &height );
1671 // For consistency, always call glViewport.
1672 glViewport( 0, 0, width, height );
1673 // Clear the viewport after resizing, as is standard in WebGL.
1674 glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
1675 // Zero mouse variables.
1676 fgcMouseMoveX = 0.0;
1677 fgcMouseMoveY = 0.0;
1678 fgcMouseWheel = 0;
1679 // Poll events.
1680 SDL_Event event;
1681 while( SDL_PollEvent( &event ) ){
1682 if( event.type == SDL_MOUSEMOTION ){
1683 fgcMouseMoveX += event.motion.xrel;
1684 fgcMouseMoveY += event.motion.yrel;
1685 fgcMouseX = event.motion.x;
1686 fgcMouseY = event.motion.y;
1687 }else if( event.type == SDL_MOUSEWHEEL ){
1688 fgcMouseWheel =
1689 event.wheel.direction == SDL_MOUSEWHEEL_FLIPPED
1690 ? event.wheel.y * -1 : event.wheel.y;
1691 }else if( event.type == SDL_FINGERDOWN
1692 || event.type == SDL_FINGERMOTION ){
1693 fgcMouseX = event.tfinger.x * width;
1694 fgcMouseY = event.tfinger.y * height;
1695 fgcFingerTouch = true;
1696 }else if( event.type == SDL_FINGERUP ){
1697 fgcFingerTouch = false;
1698 }else if( event.type == SDL_QUIT ){
1699 SDL_GL_DeleteContext( fgcContext );
1700 SDL_DestroyWindow( fgcWindow );
1701 SDL_Quit();
1702 exit( 0 );
1703 }else if( event.type == SDL_WINDOWEVENT ){
1704 // Window events.
1705 if( event.window.event == SDL_WINDOWEVENT_FOCUS_GAINED ){
1706 fgcHasFocus = true;
1707 }else if( event.window.event == SDL_WINDOWEVENT_FOCUS_LOST ){
1708 fgcHasFocus = false;
1709 }
1710 }
1711 }
1712 fgcKeyStates = SDL_GetKeyboardState( NULL );
1713 fgcMouseButtonMask = (int)SDL_GetMouseState( NULL, NULL );
1714 loop( ( now - last ) / (double)SDL_GetPerformanceFrequency() );
1715 SDL_GL_SwapWindow( fgcWindow );
1716 last = now;
1717 }
1718 }
1719
1720 #endif // FGC_H
File include/glad/gl.h added (mode: 100644) (index 0000000..fed3da4)
1 /**
2 * Loader generated by glad 2.0.0-beta on Wed May 26 10:25:45 2021
3 *
4 * Generator: C/C++
5 * Specification: gl
6 * Extensions: 0
7 *
8 * APIs:
9 * - gl:core=3.3
10 *
11 * Options:
12 * - ALIAS = False
13 * - DEBUG = False
14 * - HEADER_ONLY = True
15 * - LOADER = True
16 * - MX = False
17 * - MX_GLOBAL = False
18 * - ON_DEMAND = False
19 *
20 * Commandline:
21 * --api='gl:core=3.3' --extensions='' c --header-only --loader
22 *
23 * Online:
24 * http://glad.sh/#api=gl%3Acore%3D3.3&extensions=&generator=c&options=HEADER_ONLY%2CLOADER
25 *
26 */
27
28 #ifndef GLAD_GL_H_
29 #define GLAD_GL_H_
30
31 #ifdef __clang__
32 #pragma clang diagnostic push
33 #pragma clang diagnostic ignored "-Wreserved-id-macro"
34 #endif
35 #ifdef __gl_h_
36 #error OpenGL (gl.h) header already included (API: gl), remove previous include!
37 #endif
38 #define __gl_h_ 1
39 #ifdef __gl3_h_
40 #error OpenGL (gl3.h) header already included (API: gl), remove previous include!
41 #endif
42 #define __gl3_h_ 1
43 #ifdef __glext_h_
44 #error OpenGL (glext.h) header already included (API: gl), remove previous include!
45 #endif
46 #define __glext_h_ 1
47 #ifdef __gl3ext_h_
48 #error OpenGL (gl3ext.h) header already included (API: gl), remove previous include!
49 #endif
50 #define __gl3ext_h_ 1
51 #ifdef __clang__
52 #pragma clang diagnostic pop
53 #endif
54
55 #define GLAD_GL
56 #define GLAD_OPTION_GL_HEADER_ONLY
57 #define GLAD_OPTION_GL_LOADER
58
59 #ifdef __cplusplus
60 extern "C" {
61 #endif
62
63 #ifndef GLAD_PLATFORM_H_
64 #define GLAD_PLATFORM_H_
65
66 #ifndef GLAD_PLATFORM_WIN32
67 #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__MINGW32__)
68 #define GLAD_PLATFORM_WIN32 1
69 #else
70 #define GLAD_PLATFORM_WIN32 0
71 #endif
72 #endif
73
74 #ifndef GLAD_PLATFORM_APPLE
75 #ifdef __APPLE__
76 #define GLAD_PLATFORM_APPLE 1
77 #else
78 #define GLAD_PLATFORM_APPLE 0
79 #endif
80 #endif
81
82 #ifndef GLAD_PLATFORM_EMSCRIPTEN
83 #ifdef __EMSCRIPTEN__
84 #define GLAD_PLATFORM_EMSCRIPTEN 1
85 #else
86 #define GLAD_PLATFORM_EMSCRIPTEN 0
87 #endif
88 #endif
89
90 #ifndef GLAD_PLATFORM_UWP
91 #if defined(_MSC_VER) && !defined(GLAD_INTERNAL_HAVE_WINAPIFAMILY)
92 #ifdef __has_include
93 #if __has_include(<winapifamily.h>)
94 #define GLAD_INTERNAL_HAVE_WINAPIFAMILY 1
95 #endif
96 #elif _MSC_VER >= 1700 && !_USING_V110_SDK71_
97 #define GLAD_INTERNAL_HAVE_WINAPIFAMILY 1
98 #endif
99 #endif
100
101 #ifdef GLAD_INTERNAL_HAVE_WINAPIFAMILY
102 #include <winapifamily.h>
103 #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
104 #define GLAD_PLATFORM_UWP 1
105 #endif
106 #endif
107
108 #ifndef GLAD_PLATFORM_UWP
109 #define GLAD_PLATFORM_UWP 0
110 #endif
111 #endif
112
113 #ifdef __GNUC__
114 #define GLAD_GNUC_EXTENSION __extension__
115 #else
116 #define GLAD_GNUC_EXTENSION
117 #endif
118
119 #ifndef GLAD_API_CALL
120 #if defined(GLAD_API_CALL_EXPORT)
121 #if GLAD_PLATFORM_WIN32 || defined(__CYGWIN__)
122 #if defined(GLAD_API_CALL_EXPORT_BUILD)
123 #if defined(__GNUC__)
124 #define GLAD_API_CALL __attribute__ ((dllexport)) extern
125 #else
126 #define GLAD_API_CALL __declspec(dllexport) extern
127 #endif
128 #else
129 #if defined(__GNUC__)
130 #define GLAD_API_CALL __attribute__ ((dllimport)) extern
131 #else
132 #define GLAD_API_CALL __declspec(dllimport) extern
133 #endif
134 #endif
135 #elif defined(__GNUC__) && defined(GLAD_API_CALL_EXPORT_BUILD)
136 #define GLAD_API_CALL __attribute__ ((visibility ("default"))) extern
137 #else
138 #define GLAD_API_CALL extern
139 #endif
140 #else
141 #define GLAD_API_CALL extern
142 #endif
143 #endif
144
145 #ifdef APIENTRY
146 #define GLAD_API_PTR APIENTRY
147 #elif GLAD_PLATFORM_WIN32
148 #define GLAD_API_PTR __stdcall
149 #else
150 #define GLAD_API_PTR
151 #endif
152
153 #ifndef GLAPI
154 #define GLAPI GLAD_API_CALL
155 #endif
156
157 #ifndef GLAPIENTRY
158 #define GLAPIENTRY GLAD_API_PTR
159 #endif
160
161 #define GLAD_MAKE_VERSION(major, minor) (major * 10000 + minor)
162 #define GLAD_VERSION_MAJOR(version) (version / 10000)
163 #define GLAD_VERSION_MINOR(version) (version % 10000)
164
165 #define GLAD_GENERATOR_VERSION "2.0.0-beta"
166
167 typedef void (*GLADapiproc)(void);
168
169 typedef GLADapiproc (*GLADloadfunc)(const char *name);
170 typedef GLADapiproc (*GLADuserptrloadfunc)(void *userptr, const char *name);
171
172 typedef void (*GLADprecallback)(const char *name, GLADapiproc apiproc, int len_args, ...);
173 typedef void (*GLADpostcallback)(void *ret, const char *name, GLADapiproc apiproc, int len_args, ...);
174
175 #endif /* GLAD_PLATFORM_H_ */
176
177 #define GL_ACTIVE_ATTRIBUTES 0x8B89
178 #define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
179 #define GL_ACTIVE_TEXTURE 0x84E0
180 #define GL_ACTIVE_UNIFORMS 0x8B86
181 #define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36
182 #define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35
183 #define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
184 #define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
185 #define GL_ALPHA 0x1906
186 #define GL_ALREADY_SIGNALED 0x911A
187 #define GL_ALWAYS 0x0207
188 #define GL_AND 0x1501
189 #define GL_AND_INVERTED 0x1504
190 #define GL_AND_REVERSE 0x1502
191 #define GL_ANY_SAMPLES_PASSED 0x8C2F
192 #define GL_ARRAY_BUFFER 0x8892
193 #define GL_ARRAY_BUFFER_BINDING 0x8894
194 #define GL_ATTACHED_SHADERS 0x8B85
195 #define GL_BACK 0x0405
196 #define GL_BACK_LEFT 0x0402
197 #define GL_BACK_RIGHT 0x0403
198 #define GL_BGR 0x80E0
199 #define GL_BGRA 0x80E1
200 #define GL_BGRA_INTEGER 0x8D9B
201 #define GL_BGR_INTEGER 0x8D9A
202 #define GL_BLEND 0x0BE2
203 #define GL_BLEND_COLOR 0x8005
204 #define GL_BLEND_DST 0x0BE0
205 #define GL_BLEND_DST_ALPHA 0x80CA
206 #define GL_BLEND_DST_RGB 0x80C8
207 #define GL_BLEND_EQUATION 0x8009
208 #define GL_BLEND_EQUATION_ALPHA 0x883D
209 #define GL_BLEND_EQUATION_RGB 0x8009
210 #define GL_BLEND_SRC 0x0BE1
211 #define GL_BLEND_SRC_ALPHA 0x80CB
212 #define GL_BLEND_SRC_RGB 0x80C9
213 #define GL_BLUE 0x1905
214 #define GL_BLUE_INTEGER 0x8D96
215 #define GL_BOOL 0x8B56
216 #define GL_BOOL_VEC2 0x8B57
217 #define GL_BOOL_VEC3 0x8B58
218 #define GL_BOOL_VEC4 0x8B59
219 #define GL_BUFFER_ACCESS 0x88BB
220 #define GL_BUFFER_ACCESS_FLAGS 0x911F
221 #define GL_BUFFER_MAPPED 0x88BC
222 #define GL_BUFFER_MAP_LENGTH 0x9120
223 #define GL_BUFFER_MAP_OFFSET 0x9121
224 #define GL_BUFFER_MAP_POINTER 0x88BD
225 #define GL_BUFFER_SIZE 0x8764
226 #define GL_BUFFER_USAGE 0x8765
227 #define GL_BYTE 0x1400
228 #define GL_CCW 0x0901
229 #define GL_CLAMP_READ_COLOR 0x891C
230 #define GL_CLAMP_TO_BORDER 0x812D
231 #define GL_CLAMP_TO_EDGE 0x812F
232 #define GL_CLEAR 0x1500
233 #define GL_CLIP_DISTANCE0 0x3000
234 #define GL_CLIP_DISTANCE1 0x3001
235 #define GL_CLIP_DISTANCE2 0x3002
236 #define GL_CLIP_DISTANCE3 0x3003
237 #define GL_CLIP_DISTANCE4 0x3004
238 #define GL_CLIP_DISTANCE5 0x3005
239 #define GL_CLIP_DISTANCE6 0x3006
240 #define GL_CLIP_DISTANCE7 0x3007
241 #define GL_COLOR 0x1800
242 #define GL_COLOR_ATTACHMENT0 0x8CE0
243 #define GL_COLOR_ATTACHMENT1 0x8CE1
244 #define GL_COLOR_ATTACHMENT10 0x8CEA
245 #define GL_COLOR_ATTACHMENT11 0x8CEB
246 #define GL_COLOR_ATTACHMENT12 0x8CEC
247 #define GL_COLOR_ATTACHMENT13 0x8CED
248 #define GL_COLOR_ATTACHMENT14 0x8CEE
249 #define GL_COLOR_ATTACHMENT15 0x8CEF
250 #define GL_COLOR_ATTACHMENT16 0x8CF0
251 #define GL_COLOR_ATTACHMENT17 0x8CF1
252 #define GL_COLOR_ATTACHMENT18 0x8CF2
253 #define GL_COLOR_ATTACHMENT19 0x8CF3
254 #define GL_COLOR_ATTACHMENT2 0x8CE2
255 #define GL_COLOR_ATTACHMENT20 0x8CF4
256 #define GL_COLOR_ATTACHMENT21 0x8CF5
257 #define GL_COLOR_ATTACHMENT22 0x8CF6
258 #define GL_COLOR_ATTACHMENT23 0x8CF7
259 #define GL_COLOR_ATTACHMENT24 0x8CF8
260 #define GL_COLOR_ATTACHMENT25 0x8CF9
261 #define GL_COLOR_ATTACHMENT26 0x8CFA
262 #define GL_COLOR_ATTACHMENT27 0x8CFB
263 #define GL_COLOR_ATTACHMENT28 0x8CFC
264 #define GL_COLOR_ATTACHMENT29 0x8CFD
265 #define GL_COLOR_ATTACHMENT3 0x8CE3
266 #define GL_COLOR_ATTACHMENT30 0x8CFE
267 #define GL_COLOR_ATTACHMENT31 0x8CFF
268 #define GL_COLOR_ATTACHMENT4 0x8CE4
269 #define GL_COLOR_ATTACHMENT5 0x8CE5
270 #define GL_COLOR_ATTACHMENT6 0x8CE6
271 #define GL_COLOR_ATTACHMENT7 0x8CE7
272 #define GL_COLOR_ATTACHMENT8 0x8CE8
273 #define GL_COLOR_ATTACHMENT9 0x8CE9
274 #define GL_COLOR_BUFFER_BIT 0x00004000
275 #define GL_COLOR_CLEAR_VALUE 0x0C22
276 #define GL_COLOR_LOGIC_OP 0x0BF2
277 #define GL_COLOR_WRITEMASK 0x0C23
278 #define GL_COMPARE_REF_TO_TEXTURE 0x884E
279 #define GL_COMPILE_STATUS 0x8B81
280 #define GL_COMPRESSED_RED 0x8225
281 #define GL_COMPRESSED_RED_RGTC1 0x8DBB
282 #define GL_COMPRESSED_RG 0x8226
283 #define GL_COMPRESSED_RGB 0x84ED
284 #define GL_COMPRESSED_RGBA 0x84EE
285 #define GL_COMPRESSED_RG_RGTC2 0x8DBD
286 #define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC
287 #define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE
288 #define GL_COMPRESSED_SRGB 0x8C48
289 #define GL_COMPRESSED_SRGB_ALPHA 0x8C49
290 #define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
291 #define GL_CONDITION_SATISFIED 0x911C
292 #define GL_CONSTANT_ALPHA 0x8003
293 #define GL_CONSTANT_COLOR 0x8001
294 #define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002
295 #define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001
296 #define GL_CONTEXT_FLAGS 0x821E
297 #define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x00000001
298 #define GL_CONTEXT_PROFILE_MASK 0x9126
299 #define GL_COPY 0x1503
300 #define GL_COPY_INVERTED 0x150C
301 #define GL_COPY_READ_BUFFER 0x8F36
302 #define GL_COPY_WRITE_BUFFER 0x8F37
303 #define GL_CULL_FACE 0x0B44
304 #define GL_CULL_FACE_MODE 0x0B45
305 #define GL_CURRENT_PROGRAM 0x8B8D
306 #define GL_CURRENT_QUERY 0x8865
307 #define GL_CURRENT_VERTEX_ATTRIB 0x8626
308 #define GL_CW 0x0900
309 #define GL_DECR 0x1E03
310 #define GL_DECR_WRAP 0x8508
311 #define GL_DELETE_STATUS 0x8B80
312 #define GL_DEPTH 0x1801
313 #define GL_DEPTH24_STENCIL8 0x88F0
314 #define GL_DEPTH32F_STENCIL8 0x8CAD
315 #define GL_DEPTH_ATTACHMENT 0x8D00
316 #define GL_DEPTH_BUFFER_BIT 0x00000100
317 #define GL_DEPTH_CLAMP 0x864F
318 #define GL_DEPTH_CLEAR_VALUE 0x0B73
319 #define GL_DEPTH_COMPONENT 0x1902
320 #define GL_DEPTH_COMPONENT16 0x81A5
321 #define GL_DEPTH_COMPONENT24 0x81A6
322 #define GL_DEPTH_COMPONENT32 0x81A7
323 #define GL_DEPTH_COMPONENT32F 0x8CAC
324 #define GL_DEPTH_FUNC 0x0B74
325 #define GL_DEPTH_RANGE 0x0B70
326 #define GL_DEPTH_STENCIL 0x84F9
327 #define GL_DEPTH_STENCIL_ATTACHMENT 0x821A
328 #define GL_DEPTH_TEST 0x0B71
329 #define GL_DEPTH_WRITEMASK 0x0B72
330 #define GL_DITHER 0x0BD0
331 #define GL_DONT_CARE 0x1100
332 #define GL_DOUBLE 0x140A
333 #define GL_DOUBLEBUFFER 0x0C32
334 #define GL_DRAW_BUFFER 0x0C01
335 #define GL_DRAW_BUFFER0 0x8825
336 #define GL_DRAW_BUFFER1 0x8826
337 #define GL_DRAW_BUFFER10 0x882F
338 #define GL_DRAW_BUFFER11 0x8830
339 #define GL_DRAW_BUFFER12 0x8831
340 #define GL_DRAW_BUFFER13 0x8832
341 #define GL_DRAW_BUFFER14 0x8833
342 #define GL_DRAW_BUFFER15 0x8834
343 #define GL_DRAW_BUFFER2 0x8827
344 #define GL_DRAW_BUFFER3 0x8828
345 #define GL_DRAW_BUFFER4 0x8829
346 #define GL_DRAW_BUFFER5 0x882A
347 #define GL_DRAW_BUFFER6 0x882B
348 #define GL_DRAW_BUFFER7 0x882C
349 #define GL_DRAW_BUFFER8 0x882D
350 #define GL_DRAW_BUFFER9 0x882E
351 #define GL_DRAW_FRAMEBUFFER 0x8CA9
352 #define GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6
353 #define GL_DST_ALPHA 0x0304
354 #define GL_DST_COLOR 0x0306
355 #define GL_DYNAMIC_COPY 0x88EA
356 #define GL_DYNAMIC_DRAW 0x88E8
357 #define GL_DYNAMIC_READ 0x88E9
358 #define GL_ELEMENT_ARRAY_BUFFER 0x8893
359 #define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
360 #define GL_EQUAL 0x0202
361 #define GL_EQUIV 0x1509
362 #define GL_EXTENSIONS 0x1F03
363 #define GL_FALSE 0
364 #define GL_FASTEST 0x1101
365 #define GL_FILL 0x1B02
366 #define GL_FIRST_VERTEX_CONVENTION 0x8E4D
367 #define GL_FIXED_ONLY 0x891D
368 #define GL_FLOAT 0x1406
369 #define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD
370 #define GL_FLOAT_MAT2 0x8B5A
371 #define GL_FLOAT_MAT2x3 0x8B65
372 #define GL_FLOAT_MAT2x4 0x8B66
373 #define GL_FLOAT_MAT3 0x8B5B
374 #define GL_FLOAT_MAT3x2 0x8B67
375 #define GL_FLOAT_MAT3x4 0x8B68
376 #define GL_FLOAT_MAT4 0x8B5C
377 #define GL_FLOAT_MAT4x2 0x8B69
378 #define GL_FLOAT_MAT4x3 0x8B6A
379 #define GL_FLOAT_VEC2 0x8B50
380 #define GL_FLOAT_VEC3 0x8B51
381 #define GL_FLOAT_VEC4 0x8B52
382 #define GL_FRAGMENT_SHADER 0x8B30
383 #define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B
384 #define GL_FRAMEBUFFER 0x8D40
385 #define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215
386 #define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214
387 #define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210
388 #define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211
389 #define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216
390 #define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213
391 #define GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7
392 #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
393 #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
394 #define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212
395 #define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217
396 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
397 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4
398 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
399 #define GL_FRAMEBUFFER_BINDING 0x8CA6
400 #define GL_FRAMEBUFFER_COMPLETE 0x8CD5
401 #define GL_FRAMEBUFFER_DEFAULT 0x8218
402 #define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
403 #define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB
404 #define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8
405 #define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
406 #define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56
407 #define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC
408 #define GL_FRAMEBUFFER_SRGB 0x8DB9
409 #define GL_FRAMEBUFFER_UNDEFINED 0x8219
410 #define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
411 #define GL_FRONT 0x0404
412 #define GL_FRONT_AND_BACK 0x0408
413 #define GL_FRONT_FACE 0x0B46
414 #define GL_FRONT_LEFT 0x0400
415 #define GL_FRONT_RIGHT 0x0401
416 #define GL_FUNC_ADD 0x8006
417 #define GL_FUNC_REVERSE_SUBTRACT 0x800B
418 #define GL_FUNC_SUBTRACT 0x800A
419 #define GL_GEOMETRY_INPUT_TYPE 0x8917
420 #define GL_GEOMETRY_OUTPUT_TYPE 0x8918
421 #define GL_GEOMETRY_SHADER 0x8DD9
422 #define GL_GEOMETRY_VERTICES_OUT 0x8916
423 #define GL_GEQUAL 0x0206
424 #define GL_GREATER 0x0204
425 #define GL_GREEN 0x1904
426 #define GL_GREEN_INTEGER 0x8D95
427 #define GL_HALF_FLOAT 0x140B
428 #define GL_INCR 0x1E02
429 #define GL_INCR_WRAP 0x8507
430 #define GL_INFO_LOG_LENGTH 0x8B84
431 #define GL_INT 0x1404
432 #define GL_INTERLEAVED_ATTRIBS 0x8C8C
433 #define GL_INT_2_10_10_10_REV 0x8D9F
434 #define GL_INT_SAMPLER_1D 0x8DC9
435 #define GL_INT_SAMPLER_1D_ARRAY 0x8DCE
436 #define GL_INT_SAMPLER_2D 0x8DCA
437 #define GL_INT_SAMPLER_2D_ARRAY 0x8DCF
438 #define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109
439 #define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C
440 #define GL_INT_SAMPLER_2D_RECT 0x8DCD
441 #define GL_INT_SAMPLER_3D 0x8DCB
442 #define GL_INT_SAMPLER_BUFFER 0x8DD0
443 #define GL_INT_SAMPLER_CUBE 0x8DCC
444 #define GL_INT_VEC2 0x8B53
445 #define GL_INT_VEC3 0x8B54
446 #define GL_INT_VEC4 0x8B55
447 #define GL_INVALID_ENUM 0x0500
448 #define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
449 #define GL_INVALID_INDEX 0xFFFFFFFF
450 #define GL_INVALID_OPERATION 0x0502
451 #define GL_INVALID_VALUE 0x0501
452 #define GL_INVERT 0x150A
453 #define GL_KEEP 0x1E00
454 #define GL_LAST_VERTEX_CONVENTION 0x8E4E
455 #define GL_LEFT 0x0406
456 #define GL_LEQUAL 0x0203
457 #define GL_LESS 0x0201
458 #define GL_LINE 0x1B01
459 #define GL_LINEAR 0x2601
460 #define GL_LINEAR_MIPMAP_LINEAR 0x2703
461 #define GL_LINEAR_MIPMAP_NEAREST 0x2701
462 #define GL_LINES 0x0001
463 #define GL_LINES_ADJACENCY 0x000A
464 #define GL_LINE_LOOP 0x0002
465 #define GL_LINE_SMOOTH 0x0B20
466 #define GL_LINE_SMOOTH_HINT 0x0C52
467 #define GL_LINE_STRIP 0x0003
468 #define GL_LINE_STRIP_ADJACENCY 0x000B
469 #define GL_LINE_WIDTH 0x0B21
470 #define GL_LINE_WIDTH_GRANULARITY 0x0B23
471 #define GL_LINE_WIDTH_RANGE 0x0B22
472 #define GL_LINK_STATUS 0x8B82
473 #define GL_LOGIC_OP_MODE 0x0BF0
474 #define GL_LOWER_LEFT 0x8CA1
475 #define GL_MAJOR_VERSION 0x821B
476 #define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010
477 #define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008
478 #define GL_MAP_INVALIDATE_RANGE_BIT 0x0004
479 #define GL_MAP_READ_BIT 0x0001
480 #define GL_MAP_UNSYNCHRONIZED_BIT 0x0020
481 #define GL_MAP_WRITE_BIT 0x0002
482 #define GL_MAX 0x8008
483 #define GL_MAX_3D_TEXTURE_SIZE 0x8073
484 #define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF
485 #define GL_MAX_CLIP_DISTANCES 0x0D32
486 #define GL_MAX_COLOR_ATTACHMENTS 0x8CDF
487 #define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E
488 #define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33
489 #define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32
490 #define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
491 #define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E
492 #define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31
493 #define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
494 #define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F
495 #define GL_MAX_DRAW_BUFFERS 0x8824
496 #define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS 0x88FC
497 #define GL_MAX_ELEMENTS_INDICES 0x80E9
498 #define GL_MAX_ELEMENTS_VERTICES 0x80E8
499 #define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125
500 #define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D
501 #define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49
502 #define GL_MAX_GEOMETRY_INPUT_COMPONENTS 0x9123
503 #define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124
504 #define GL_MAX_GEOMETRY_OUTPUT_VERTICES 0x8DE0
505 #define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29
506 #define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1
507 #define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C
508 #define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF
509 #define GL_MAX_INTEGER_SAMPLES 0x9110
510 #define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905
511 #define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8
512 #define GL_MAX_RENDERBUFFER_SIZE 0x84E8
513 #define GL_MAX_SAMPLES 0x8D57
514 #define GL_MAX_SAMPLE_MASK_WORDS 0x8E59
515 #define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111
516 #define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B
517 #define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
518 #define GL_MAX_TEXTURE_LOD_BIAS 0x84FD
519 #define GL_MAX_TEXTURE_SIZE 0x0D33
520 #define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A
521 #define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B
522 #define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80
523 #define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30
524 #define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F
525 #define GL_MAX_VARYING_COMPONENTS 0x8B4B
526 #define GL_MAX_VARYING_FLOATS 0x8B4B
527 #define GL_MAX_VERTEX_ATTRIBS 0x8869
528 #define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122
529 #define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
530 #define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B
531 #define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A
532 #define GL_MAX_VIEWPORT_DIMS 0x0D3A
533 #define GL_MIN 0x8007
534 #define GL_MINOR_VERSION 0x821C
535 #define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904
536 #define GL_MIRRORED_REPEAT 0x8370
537 #define GL_MULTISAMPLE 0x809D
538 #define GL_NAND 0x150E
539 #define GL_NEAREST 0x2600
540 #define GL_NEAREST_MIPMAP_LINEAR 0x2702
541 #define GL_NEAREST_MIPMAP_NEAREST 0x2700
542 #define GL_NEVER 0x0200
543 #define GL_NICEST 0x1102
544 #define GL_NONE 0
545 #define GL_NOOP 0x1505
546 #define GL_NOR 0x1508
547 #define GL_NOTEQUAL 0x0205
548 #define GL_NO_ERROR 0
549 #define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
550 #define GL_NUM_EXTENSIONS 0x821D
551 #define GL_OBJECT_TYPE 0x9112
552 #define GL_ONE 1
553 #define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
554 #define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
555 #define GL_ONE_MINUS_DST_ALPHA 0x0305
556 #define GL_ONE_MINUS_DST_COLOR 0x0307
557 #define GL_ONE_MINUS_SRC1_ALPHA 0x88FB
558 #define GL_ONE_MINUS_SRC1_COLOR 0x88FA
559 #define GL_ONE_MINUS_SRC_ALPHA 0x0303
560 #define GL_ONE_MINUS_SRC_COLOR 0x0301
561 #define GL_OR 0x1507
562 #define GL_OR_INVERTED 0x150D
563 #define GL_OR_REVERSE 0x150B
564 #define GL_OUT_OF_MEMORY 0x0505
565 #define GL_PACK_ALIGNMENT 0x0D05
566 #define GL_PACK_IMAGE_HEIGHT 0x806C
567 #define GL_PACK_LSB_FIRST 0x0D01
568 #define GL_PACK_ROW_LENGTH 0x0D02
569 #define GL_PACK_SKIP_IMAGES 0x806B
570 #define GL_PACK_SKIP_PIXELS 0x0D04
571 #define GL_PACK_SKIP_ROWS 0x0D03
572 #define GL_PACK_SWAP_BYTES 0x0D00
573 #define GL_PIXEL_PACK_BUFFER 0x88EB
574 #define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED
575 #define GL_PIXEL_UNPACK_BUFFER 0x88EC
576 #define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF
577 #define GL_POINT 0x1B00
578 #define GL_POINTS 0x0000
579 #define GL_POINT_FADE_THRESHOLD_SIZE 0x8128
580 #define GL_POINT_SIZE 0x0B11
581 #define GL_POINT_SIZE_GRANULARITY 0x0B13
582 #define GL_POINT_SIZE_RANGE 0x0B12
583 #define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0
584 #define GL_POLYGON_MODE 0x0B40
585 #define GL_POLYGON_OFFSET_FACTOR 0x8038
586 #define GL_POLYGON_OFFSET_FILL 0x8037
587 #define GL_POLYGON_OFFSET_LINE 0x2A02
588 #define GL_POLYGON_OFFSET_POINT 0x2A01
589 #define GL_POLYGON_OFFSET_UNITS 0x2A00
590 #define GL_POLYGON_SMOOTH 0x0B41
591 #define GL_POLYGON_SMOOTH_HINT 0x0C53
592 #define GL_PRIMITIVES_GENERATED 0x8C87
593 #define GL_PRIMITIVE_RESTART 0x8F9D
594 #define GL_PRIMITIVE_RESTART_INDEX 0x8F9E
595 #define GL_PROGRAM_POINT_SIZE 0x8642
596 #define GL_PROVOKING_VERTEX 0x8E4F
597 #define GL_PROXY_TEXTURE_1D 0x8063
598 #define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19
599 #define GL_PROXY_TEXTURE_2D 0x8064
600 #define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B
601 #define GL_PROXY_TEXTURE_2D_MULTISAMPLE 0x9101
602 #define GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103
603 #define GL_PROXY_TEXTURE_3D 0x8070
604 #define GL_PROXY_TEXTURE_CUBE_MAP 0x851B
605 #define GL_PROXY_TEXTURE_RECTANGLE 0x84F7
606 #define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C
607 #define GL_QUERY_BY_REGION_NO_WAIT 0x8E16
608 #define GL_QUERY_BY_REGION_WAIT 0x8E15
609 #define GL_QUERY_COUNTER_BITS 0x8864
610 #define GL_QUERY_NO_WAIT 0x8E14
611 #define GL_QUERY_RESULT 0x8866
612 #define GL_QUERY_RESULT_AVAILABLE 0x8867
613 #define GL_QUERY_WAIT 0x8E13
614 #define GL_R11F_G11F_B10F 0x8C3A
615 #define GL_R16 0x822A
616 #define GL_R16F 0x822D
617 #define GL_R16I 0x8233
618 #define GL_R16UI 0x8234
619 #define GL_R16_SNORM 0x8F98
620 #define GL_R32F 0x822E
621 #define GL_R32I 0x8235
622 #define GL_R32UI 0x8236
623 #define GL_R3_G3_B2 0x2A10
624 #define GL_R8 0x8229
625 #define GL_R8I 0x8231
626 #define GL_R8UI 0x8232
627 #define GL_R8_SNORM 0x8F94
628 #define GL_RASTERIZER_DISCARD 0x8C89
629 #define GL_READ_BUFFER 0x0C02
630 #define GL_READ_FRAMEBUFFER 0x8CA8
631 #define GL_READ_FRAMEBUFFER_BINDING 0x8CAA
632 #define GL_READ_ONLY 0x88B8
633 #define GL_READ_WRITE 0x88BA
634 #define GL_RED 0x1903
635 #define GL_RED_INTEGER 0x8D94
636 #define GL_RENDERBUFFER 0x8D41
637 #define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53
638 #define GL_RENDERBUFFER_BINDING 0x8CA7
639 #define GL_RENDERBUFFER_BLUE_SIZE 0x8D52
640 #define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54
641 #define GL_RENDERBUFFER_GREEN_SIZE 0x8D51
642 #define GL_RENDERBUFFER_HEIGHT 0x8D43
643 #define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44
644 #define GL_RENDERBUFFER_RED_SIZE 0x8D50
645 #define GL_RENDERBUFFER_SAMPLES 0x8CAB
646 #define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55
647 #define GL_RENDERBUFFER_WIDTH 0x8D42
648 #define GL_RENDERER 0x1F01
649 #define GL_REPEAT 0x2901
650 #define GL_REPLACE 0x1E01
651 #define GL_RG 0x8227
652 #define GL_RG16 0x822C
653 #define GL_RG16F 0x822F
654 #define GL_RG16I 0x8239
655 #define GL_RG16UI 0x823A
656 #define GL_RG16_SNORM 0x8F99
657 #define GL_RG32F 0x8230
658 #define GL_RG32I 0x823B
659 #define GL_RG32UI 0x823C
660 #define GL_RG8 0x822B
661 #define GL_RG8I 0x8237
662 #define GL_RG8UI 0x8238
663 #define GL_RG8_SNORM 0x8F95
664 #define GL_RGB 0x1907
665 #define GL_RGB10 0x8052
666 #define GL_RGB10_A2 0x8059
667 #define GL_RGB10_A2UI 0x906F
668 #define GL_RGB12 0x8053
669 #define GL_RGB16 0x8054
670 #define GL_RGB16F 0x881B
671 #define GL_RGB16I 0x8D89
672 #define GL_RGB16UI 0x8D77
673 #define GL_RGB16_SNORM 0x8F9A
674 #define GL_RGB32F 0x8815
675 #define GL_RGB32I 0x8D83
676 #define GL_RGB32UI 0x8D71
677 #define GL_RGB4 0x804F
678 #define GL_RGB5 0x8050
679 #define GL_RGB5_A1 0x8057
680 #define GL_RGB8 0x8051
681 #define GL_RGB8I 0x8D8F
682 #define GL_RGB8UI 0x8D7D
683 #define GL_RGB8_SNORM 0x8F96
684 #define GL_RGB9_E5 0x8C3D
685 #define GL_RGBA 0x1908
686 #define GL_RGBA12 0x805A
687 #define GL_RGBA16 0x805B
688 #define GL_RGBA16F 0x881A
689 #define GL_RGBA16I 0x8D88
690 #define GL_RGBA16UI 0x8D76
691 #define GL_RGBA16_SNORM 0x8F9B
692 #define GL_RGBA2 0x8055
693 #define GL_RGBA32F 0x8814
694 #define GL_RGBA32I 0x8D82
695 #define GL_RGBA32UI 0x8D70
696 #define GL_RGBA4 0x8056
697 #define GL_RGBA8 0x8058
698 #define GL_RGBA8I 0x8D8E
699 #define GL_RGBA8UI 0x8D7C
700 #define GL_RGBA8_SNORM 0x8F97
701 #define GL_RGBA_INTEGER 0x8D99
702 #define GL_RGB_INTEGER 0x8D98
703 #define GL_RG_INTEGER 0x8228
704 #define GL_RIGHT 0x0407
705 #define GL_SAMPLER_1D 0x8B5D
706 #define GL_SAMPLER_1D_ARRAY 0x8DC0
707 #define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3
708 #define GL_SAMPLER_1D_SHADOW 0x8B61
709 #define GL_SAMPLER_2D 0x8B5E
710 #define GL_SAMPLER_2D_ARRAY 0x8DC1
711 #define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4
712 #define GL_SAMPLER_2D_MULTISAMPLE 0x9108
713 #define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B
714 #define GL_SAMPLER_2D_RECT 0x8B63
715 #define GL_SAMPLER_2D_RECT_SHADOW 0x8B64
716 #define GL_SAMPLER_2D_SHADOW 0x8B62
717 #define GL_SAMPLER_3D 0x8B5F
718 #define GL_SAMPLER_BINDING 0x8919
719 #define GL_SAMPLER_BUFFER 0x8DC2
720 #define GL_SAMPLER_CUBE 0x8B60
721 #define GL_SAMPLER_CUBE_SHADOW 0x8DC5
722 #define GL_SAMPLES 0x80A9
723 #define GL_SAMPLES_PASSED 0x8914
724 #define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
725 #define GL_SAMPLE_ALPHA_TO_ONE 0x809F
726 #define GL_SAMPLE_BUFFERS 0x80A8
727 #define GL_SAMPLE_COVERAGE 0x80A0
728 #define GL_SAMPLE_COVERAGE_INVERT 0x80AB
729 #define GL_SAMPLE_COVERAGE_VALUE 0x80AA
730 #define GL_SAMPLE_MASK 0x8E51
731 #define GL_SAMPLE_MASK_VALUE 0x8E52
732 #define GL_SAMPLE_POSITION 0x8E50
733 #define GL_SCISSOR_BOX 0x0C10
734 #define GL_SCISSOR_TEST 0x0C11
735 #define GL_SEPARATE_ATTRIBS 0x8C8D
736 #define GL_SET 0x150F
737 #define GL_SHADER_SOURCE_LENGTH 0x8B88
738 #define GL_SHADER_TYPE 0x8B4F
739 #define GL_SHADING_LANGUAGE_VERSION 0x8B8C
740 #define GL_SHORT 0x1402
741 #define GL_SIGNALED 0x9119
742 #define GL_SIGNED_NORMALIZED 0x8F9C
743 #define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23
744 #define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22
745 #define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13
746 #define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12
747 #define GL_SRC1_ALPHA 0x8589
748 #define GL_SRC1_COLOR 0x88F9
749 #define GL_SRC_ALPHA 0x0302
750 #define GL_SRC_ALPHA_SATURATE 0x0308
751 #define GL_SRC_COLOR 0x0300
752 #define GL_SRGB 0x8C40
753 #define GL_SRGB8 0x8C41
754 #define GL_SRGB8_ALPHA8 0x8C43
755 #define GL_SRGB_ALPHA 0x8C42
756 #define GL_STATIC_COPY 0x88E6
757 #define GL_STATIC_DRAW 0x88E4
758 #define GL_STATIC_READ 0x88E5
759 #define GL_STENCIL 0x1802
760 #define GL_STENCIL_ATTACHMENT 0x8D20
761 #define GL_STENCIL_BACK_FAIL 0x8801
762 #define GL_STENCIL_BACK_FUNC 0x8800
763 #define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802
764 #define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803
765 #define GL_STENCIL_BACK_REF 0x8CA3
766 #define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
767 #define GL_STENCIL_BACK_WRITEMASK 0x8CA5
768 #define GL_STENCIL_BUFFER_BIT 0x00000400
769 #define GL_STENCIL_CLEAR_VALUE 0x0B91
770 #define GL_STENCIL_FAIL 0x0B94
771 #define GL_STENCIL_FUNC 0x0B92
772 #define GL_STENCIL_INDEX 0x1901
773 #define GL_STENCIL_INDEX1 0x8D46
774 #define GL_STENCIL_INDEX16 0x8D49
775 #define GL_STENCIL_INDEX4 0x8D47
776 #define GL_STENCIL_INDEX8 0x8D48
777 #define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
778 #define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
779 #define GL_STENCIL_REF 0x0B97
780 #define GL_STENCIL_TEST 0x0B90
781 #define GL_STENCIL_VALUE_MASK 0x0B93
782 #define GL_STENCIL_WRITEMASK 0x0B98
783 #define GL_STEREO 0x0C33
784 #define GL_STREAM_COPY 0x88E2
785 #define GL_STREAM_DRAW 0x88E0
786 #define GL_STREAM_READ 0x88E1
787 #define GL_SUBPIXEL_BITS 0x0D50
788 #define GL_SYNC_CONDITION 0x9113
789 #define GL_SYNC_FENCE 0x9116
790 #define GL_SYNC_FLAGS 0x9115
791 #define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001
792 #define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117
793 #define GL_SYNC_STATUS 0x9114
794 #define GL_TEXTURE 0x1702
795 #define GL_TEXTURE0 0x84C0
796 #define GL_TEXTURE1 0x84C1
797 #define GL_TEXTURE10 0x84CA
798 #define GL_TEXTURE11 0x84CB
799 #define GL_TEXTURE12 0x84CC
800 #define GL_TEXTURE13 0x84CD
801 #define GL_TEXTURE14 0x84CE
802 #define GL_TEXTURE15 0x84CF
803 #define GL_TEXTURE16 0x84D0
804 #define GL_TEXTURE17 0x84D1
805 #define GL_TEXTURE18 0x84D2
806 #define GL_TEXTURE19 0x84D3
807 #define GL_TEXTURE2 0x84C2
808 #define GL_TEXTURE20 0x84D4
809 #define GL_TEXTURE21 0x84D5
810 #define GL_TEXTURE22 0x84D6
811 #define GL_TEXTURE23 0x84D7
812 #define GL_TEXTURE24 0x84D8
813 #define GL_TEXTURE25 0x84D9
814 #define GL_TEXTURE26 0x84DA
815 #define GL_TEXTURE27 0x84DB
816 #define GL_TEXTURE28 0x84DC
817 #define GL_TEXTURE29 0x84DD
818 #define GL_TEXTURE3 0x84C3
819 #define GL_TEXTURE30 0x84DE
820 #define GL_TEXTURE31 0x84DF
821 #define GL_TEXTURE4 0x84C4
822 #define GL_TEXTURE5 0x84C5
823 #define GL_TEXTURE6 0x84C6
824 #define GL_TEXTURE7 0x84C7
825 #define GL_TEXTURE8 0x84C8
826 #define GL_TEXTURE9 0x84C9
827 #define GL_TEXTURE_1D 0x0DE0
828 #define GL_TEXTURE_1D_ARRAY 0x8C18
829 #define GL_TEXTURE_2D 0x0DE1
830 #define GL_TEXTURE_2D_ARRAY 0x8C1A
831 #define GL_TEXTURE_2D_MULTISAMPLE 0x9100
832 #define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102
833 #define GL_TEXTURE_3D 0x806F
834 #define GL_TEXTURE_ALPHA_SIZE 0x805F
835 #define GL_TEXTURE_ALPHA_TYPE 0x8C13
836 #define GL_TEXTURE_BASE_LEVEL 0x813C
837 #define GL_TEXTURE_BINDING_1D 0x8068
838 #define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C
839 #define GL_TEXTURE_BINDING_2D 0x8069
840 #define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D
841 #define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104
842 #define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105
843 #define GL_TEXTURE_BINDING_3D 0x806A
844 #define GL_TEXTURE_BINDING_BUFFER 0x8C2C
845 #define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
846 #define GL_TEXTURE_BINDING_RECTANGLE 0x84F6
847 #define GL_TEXTURE_BLUE_SIZE 0x805E
848 #define GL_TEXTURE_BLUE_TYPE 0x8C12
849 #define GL_TEXTURE_BORDER_COLOR 0x1004
850 #define GL_TEXTURE_BUFFER 0x8C2A
851 #define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D
852 #define GL_TEXTURE_COMPARE_FUNC 0x884D
853 #define GL_TEXTURE_COMPARE_MODE 0x884C
854 #define GL_TEXTURE_COMPRESSED 0x86A1
855 #define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0
856 #define GL_TEXTURE_COMPRESSION_HINT 0x84EF
857 #define GL_TEXTURE_CUBE_MAP 0x8513
858 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
859 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
860 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
861 #define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
862 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
863 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
864 #define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F
865 #define GL_TEXTURE_DEPTH 0x8071
866 #define GL_TEXTURE_DEPTH_SIZE 0x884A
867 #define GL_TEXTURE_DEPTH_TYPE 0x8C16
868 #define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107
869 #define GL_TEXTURE_GREEN_SIZE 0x805D
870 #define GL_TEXTURE_GREEN_TYPE 0x8C11
871 #define GL_TEXTURE_HEIGHT 0x1001
872 #define GL_TEXTURE_INTERNAL_FORMAT 0x1003
873 #define GL_TEXTURE_LOD_BIAS 0x8501
874 #define GL_TEXTURE_MAG_FILTER 0x2800
875 #define GL_TEXTURE_MAX_LEVEL 0x813D
876 #define GL_TEXTURE_MAX_LOD 0x813B
877 #define GL_TEXTURE_MIN_FILTER 0x2801
878 #define GL_TEXTURE_MIN_LOD 0x813A
879 #define GL_TEXTURE_RECTANGLE 0x84F5
880 #define GL_TEXTURE_RED_SIZE 0x805C
881 #define GL_TEXTURE_RED_TYPE 0x8C10
882 #define GL_TEXTURE_SAMPLES 0x9106
883 #define GL_TEXTURE_SHARED_SIZE 0x8C3F
884 #define GL_TEXTURE_STENCIL_SIZE 0x88F1
885 #define GL_TEXTURE_SWIZZLE_A 0x8E45
886 #define GL_TEXTURE_SWIZZLE_B 0x8E44
887 #define GL_TEXTURE_SWIZZLE_G 0x8E43
888 #define GL_TEXTURE_SWIZZLE_R 0x8E42
889 #define GL_TEXTURE_SWIZZLE_RGBA 0x8E46
890 #define GL_TEXTURE_WIDTH 0x1000
891 #define GL_TEXTURE_WRAP_R 0x8072
892 #define GL_TEXTURE_WRAP_S 0x2802
893 #define GL_TEXTURE_WRAP_T 0x2803
894 #define GL_TIMEOUT_EXPIRED 0x911B
895 #define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFF
896 #define GL_TIMESTAMP 0x8E28
897 #define GL_TIME_ELAPSED 0x88BF
898 #define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E
899 #define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F
900 #define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F
901 #define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85
902 #define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84
903 #define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88
904 #define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83
905 #define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76
906 #define GL_TRIANGLES 0x0004
907 #define GL_TRIANGLES_ADJACENCY 0x000C
908 #define GL_TRIANGLE_FAN 0x0006
909 #define GL_TRIANGLE_STRIP 0x0005
910 #define GL_TRIANGLE_STRIP_ADJACENCY 0x000D
911 #define GL_TRUE 1
912 #define GL_UNIFORM_ARRAY_STRIDE 0x8A3C
913 #define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42
914 #define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43
915 #define GL_UNIFORM_BLOCK_BINDING 0x8A3F
916 #define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40
917 #define GL_UNIFORM_BLOCK_INDEX 0x8A3A
918 #define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41
919 #define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46
920 #define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45
921 #define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44
922 #define GL_UNIFORM_BUFFER 0x8A11
923 #define GL_UNIFORM_BUFFER_BINDING 0x8A28
924 #define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34
925 #define GL_UNIFORM_BUFFER_SIZE 0x8A2A
926 #define GL_UNIFORM_BUFFER_START 0x8A29
927 #define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E
928 #define GL_UNIFORM_MATRIX_STRIDE 0x8A3D
929 #define GL_UNIFORM_NAME_LENGTH 0x8A39
930 #define GL_UNIFORM_OFFSET 0x8A3B
931 #define GL_UNIFORM_SIZE 0x8A38
932 #define GL_UNIFORM_TYPE 0x8A37
933 #define GL_UNPACK_ALIGNMENT 0x0CF5
934 #define GL_UNPACK_IMAGE_HEIGHT 0x806E
935 #define GL_UNPACK_LSB_FIRST 0x0CF1
936 #define GL_UNPACK_ROW_LENGTH 0x0CF2
937 #define GL_UNPACK_SKIP_IMAGES 0x806D
938 #define GL_UNPACK_SKIP_PIXELS 0x0CF4
939 #define GL_UNPACK_SKIP_ROWS 0x0CF3
940 #define GL_UNPACK_SWAP_BYTES 0x0CF0
941 #define GL_UNSIGNALED 0x9118
942 #define GL_UNSIGNED_BYTE 0x1401
943 #define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362
944 #define GL_UNSIGNED_BYTE_3_3_2 0x8032
945 #define GL_UNSIGNED_INT 0x1405
946 #define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B
947 #define GL_UNSIGNED_INT_10_10_10_2 0x8036
948 #define GL_UNSIGNED_INT_24_8 0x84FA
949 #define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
950 #define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E
951 #define GL_UNSIGNED_INT_8_8_8_8 0x8035
952 #define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367
953 #define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1
954 #define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6
955 #define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2
956 #define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7
957 #define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A
958 #define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D
959 #define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5
960 #define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3
961 #define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8
962 #define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4
963 #define GL_UNSIGNED_INT_VEC2 0x8DC6
964 #define GL_UNSIGNED_INT_VEC3 0x8DC7
965 #define GL_UNSIGNED_INT_VEC4 0x8DC8
966 #define GL_UNSIGNED_NORMALIZED 0x8C17
967 #define GL_UNSIGNED_SHORT 0x1403
968 #define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366
969 #define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
970 #define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365
971 #define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
972 #define GL_UNSIGNED_SHORT_5_6_5 0x8363
973 #define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364
974 #define GL_UPPER_LEFT 0x8CA2
975 #define GL_VALIDATE_STATUS 0x8B83
976 #define GL_VENDOR 0x1F00
977 #define GL_VERSION 0x1F02
978 #define GL_VERTEX_ARRAY_BINDING 0x85B5
979 #define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
980 #define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE
981 #define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
982 #define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD
983 #define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
984 #define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
985 #define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
986 #define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
987 #define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
988 #define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642
989 #define GL_VERTEX_SHADER 0x8B31
990 #define GL_VIEWPORT 0x0BA2
991 #define GL_WAIT_FAILED 0x911D
992 #define GL_WRITE_ONLY 0x88B9
993 #define GL_XOR 0x1506
994 #define GL_ZERO 0
995
996
997 #ifndef __khrplatform_h_
998 #define __khrplatform_h_
999
1000 /*
1001 ** Copyright (c) 2008-2018 The Khronos Group Inc.
1002 **
1003 ** Permission is hereby granted, free of charge, to any person obtaining a
1004 ** copy of this software and/or associated documentation files (the
1005 ** "Materials"), to deal in the Materials without restriction, including
1006 ** without limitation the rights to use, copy, modify, merge, publish,
1007 ** distribute, sublicense, and/or sell copies of the Materials, and to
1008 ** permit persons to whom the Materials are furnished to do so, subject to
1009 ** the following conditions:
1010 **
1011 ** The above copyright notice and this permission notice shall be included
1012 ** in all copies or substantial portions of the Materials.
1013 **
1014 ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
1015 ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1016 ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1017 ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
1018 ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
1019 ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
1020 ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
1021 */
1022
1023 /* Khronos platform-specific types and definitions.
1024 *
1025 * The master copy of khrplatform.h is maintained in the Khronos EGL
1026 * Registry repository at https://github.com/KhronosGroup/EGL-Registry
1027 * The last semantic modification to khrplatform.h was at commit ID:
1028 * 67a3e0864c2d75ea5287b9f3d2eb74a745936692
1029 *
1030 * Adopters may modify this file to suit their platform. Adopters are
1031 * encouraged to submit platform specific modifications to the Khronos
1032 * group so that they can be included in future versions of this file.
1033 * Please submit changes by filing pull requests or issues on
1034 * the EGL Registry repository linked above.
1035 *
1036 *
1037 * See the Implementer's Guidelines for information about where this file
1038 * should be located on your system and for more details of its use:
1039 * http://www.khronos.org/registry/implementers_guide.pdf
1040 *
1041 * This file should be included as
1042 * #include <KHR/khrplatform.h>
1043 * by Khronos client API header files that use its types and defines.
1044 *
1045 * The types in khrplatform.h should only be used to define API-specific types.
1046 *
1047 * Types defined in khrplatform.h:
1048 * khronos_int8_t signed 8 bit
1049 * khronos_uint8_t unsigned 8 bit
1050 * khronos_int16_t signed 16 bit
1051 * khronos_uint16_t unsigned 16 bit
1052 * khronos_int32_t signed 32 bit
1053 * khronos_uint32_t unsigned 32 bit
1054 * khronos_int64_t signed 64 bit
1055 * khronos_uint64_t unsigned 64 bit
1056 * khronos_intptr_t signed same number of bits as a pointer
1057 * khronos_uintptr_t unsigned same number of bits as a pointer
1058 * khronos_ssize_t signed size
1059 * khronos_usize_t unsigned size
1060 * khronos_float_t signed 32 bit floating point
1061 * khronos_time_ns_t unsigned 64 bit time in nanoseconds
1062 * khronos_utime_nanoseconds_t unsigned time interval or absolute time in
1063 * nanoseconds
1064 * khronos_stime_nanoseconds_t signed time interval in nanoseconds
1065 * khronos_boolean_enum_t enumerated boolean type. This should
1066 * only be used as a base type when a client API's boolean type is
1067 * an enum. Client APIs which use an integer or other type for
1068 * booleans cannot use this as the base type for their boolean.
1069 *
1070 * Tokens defined in khrplatform.h:
1071 *
1072 * KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values.
1073 *
1074 * KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0.
1075 * KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0.
1076 *
1077 * Calling convention macros defined in this file:
1078 * KHRONOS_APICALL
1079 * KHRONOS_GLAD_API_PTR
1080 * KHRONOS_APIATTRIBUTES
1081 *
1082 * These may be used in function prototypes as:
1083 *
1084 * KHRONOS_APICALL void KHRONOS_GLAD_API_PTR funcname(
1085 * int arg1,
1086 * int arg2) KHRONOS_APIATTRIBUTES;
1087 */
1088
1089 #if defined(__SCITECH_SNAP__) && !defined(KHRONOS_STATIC)
1090 # define KHRONOS_STATIC 1
1091 #endif
1092
1093 /*-------------------------------------------------------------------------
1094 * Definition of KHRONOS_APICALL
1095 *-------------------------------------------------------------------------
1096 * This precedes the return type of the function in the function prototype.
1097 */
1098 #if defined(KHRONOS_STATIC)
1099 /* If the preprocessor constant KHRONOS_STATIC is defined, make the
1100 * header compatible with static linking. */
1101 # define KHRONOS_APICALL
1102 #elif defined(_WIN32)
1103 # define KHRONOS_APICALL __declspec(dllimport)
1104 #elif defined (__SYMBIAN32__)
1105 # define KHRONOS_APICALL IMPORT_C
1106 #elif defined(__ANDROID__)
1107 # define KHRONOS_APICALL __attribute__((visibility("default")))
1108 #else
1109 # define KHRONOS_APICALL
1110 #endif
1111
1112 /*-------------------------------------------------------------------------
1113 * Definition of KHRONOS_GLAD_API_PTR
1114 *-------------------------------------------------------------------------
1115 * This follows the return type of the function and precedes the function
1116 * name in the function prototype.
1117 */
1118 #if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__)
1119 /* Win32 but not WinCE */
1120 # define KHRONOS_GLAD_API_PTR __stdcall
1121 #else
1122 # define KHRONOS_GLAD_API_PTR
1123 #endif
1124
1125 /*-------------------------------------------------------------------------
1126 * Definition of KHRONOS_APIATTRIBUTES
1127 *-------------------------------------------------------------------------
1128 * This follows the closing parenthesis of the function prototype arguments.
1129 */
1130 #if defined (__ARMCC_2__)
1131 #define KHRONOS_APIATTRIBUTES __softfp
1132 #else
1133 #define KHRONOS_APIATTRIBUTES
1134 #endif
1135
1136 /*-------------------------------------------------------------------------
1137 * basic type definitions
1138 *-----------------------------------------------------------------------*/
1139 #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__)
1140
1141
1142 /*
1143 * Using <stdint.h>
1144 */
1145 #include <stdint.h>
1146 typedef int32_t khronos_int32_t;
1147 typedef uint32_t khronos_uint32_t;
1148 typedef int64_t khronos_int64_t;
1149 typedef uint64_t khronos_uint64_t;
1150 #define KHRONOS_SUPPORT_INT64 1
1151 #define KHRONOS_SUPPORT_FLOAT 1
1152
1153 #elif defined(__VMS ) || defined(__sgi)
1154
1155 /*
1156 * Using <inttypes.h>
1157 */
1158 #include <inttypes.h>
1159 typedef int32_t khronos_int32_t;
1160 typedef uint32_t khronos_uint32_t;
1161 typedef int64_t khronos_int64_t;
1162 typedef uint64_t khronos_uint64_t;
1163 #define KHRONOS_SUPPORT_INT64 1
1164 #define KHRONOS_SUPPORT_FLOAT 1
1165
1166 #elif defined(_WIN32) && !defined(__SCITECH_SNAP__)
1167
1168 /*
1169 * Win32
1170 */
1171 typedef __int32 khronos_int32_t;
1172 typedef unsigned __int32 khronos_uint32_t;
1173 typedef __int64 khronos_int64_t;
1174 typedef unsigned __int64 khronos_uint64_t;
1175 #define KHRONOS_SUPPORT_INT64 1
1176 #define KHRONOS_SUPPORT_FLOAT 1
1177
1178 #elif defined(__sun__) || defined(__digital__)
1179
1180 /*
1181 * Sun or Digital
1182 */
1183 typedef int khronos_int32_t;
1184 typedef unsigned int khronos_uint32_t;
1185 #if defined(__arch64__) || defined(_LP64)
1186 typedef long int khronos_int64_t;
1187 typedef unsigned long int khronos_uint64_t;
1188 #else
1189 typedef long long int khronos_int64_t;
1190 typedef unsigned long long int khronos_uint64_t;
1191 #endif /* __arch64__ */
1192 #define KHRONOS_SUPPORT_INT64 1
1193 #define KHRONOS_SUPPORT_FLOAT 1
1194
1195 #elif 0
1196
1197 /*
1198 * Hypothetical platform with no float or int64 support
1199 */
1200 typedef int khronos_int32_t;
1201 typedef unsigned int khronos_uint32_t;
1202 #define KHRONOS_SUPPORT_INT64 0
1203 #define KHRONOS_SUPPORT_FLOAT 0
1204
1205 #else
1206
1207 /*
1208 * Generic fallback
1209 */
1210 #include <stdint.h>
1211 typedef int32_t khronos_int32_t;
1212 typedef uint32_t khronos_uint32_t;
1213 typedef int64_t khronos_int64_t;
1214 typedef uint64_t khronos_uint64_t;
1215 #define KHRONOS_SUPPORT_INT64 1
1216 #define KHRONOS_SUPPORT_FLOAT 1
1217
1218 #endif
1219
1220
1221 /*
1222 * Types that are (so far) the same on all platforms
1223 */
1224 typedef signed char khronos_int8_t;
1225 typedef unsigned char khronos_uint8_t;
1226 typedef signed short int khronos_int16_t;
1227 typedef unsigned short int khronos_uint16_t;
1228
1229 /*
1230 * Types that differ between LLP64 and LP64 architectures - in LLP64,
1231 * pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
1232 * to be the only LLP64 architecture in current use.
1233 */
1234 #ifdef _WIN64
1235 typedef signed long long int khronos_intptr_t;
1236 typedef unsigned long long int khronos_uintptr_t;
1237 typedef signed long long int khronos_ssize_t;
1238 typedef unsigned long long int khronos_usize_t;
1239 #else
1240 typedef signed long int khronos_intptr_t;
1241 typedef unsigned long int khronos_uintptr_t;
1242 typedef signed long int khronos_ssize_t;
1243 typedef unsigned long int khronos_usize_t;
1244 #endif
1245
1246 #if KHRONOS_SUPPORT_FLOAT
1247 /*
1248 * Float type
1249 */
1250 typedef float khronos_float_t;
1251 #endif
1252
1253 #if KHRONOS_SUPPORT_INT64
1254 /* Time types
1255 *
1256 * These types can be used to represent a time interval in nanoseconds or
1257 * an absolute Unadjusted System Time. Unadjusted System Time is the number
1258 * of nanoseconds since some arbitrary system event (e.g. since the last
1259 * time the system booted). The Unadjusted System Time is an unsigned
1260 * 64 bit value that wraps back to 0 every 584 years. Time intervals
1261 * may be either signed or unsigned.
1262 */
1263 typedef khronos_uint64_t khronos_utime_nanoseconds_t;
1264 typedef khronos_int64_t khronos_stime_nanoseconds_t;
1265 #endif
1266
1267 /*
1268 * Dummy value used to pad enum types to 32 bits.
1269 */
1270 #ifndef KHRONOS_MAX_ENUM
1271 #define KHRONOS_MAX_ENUM 0x7FFFFFFF
1272 #endif
1273
1274 /*
1275 * Enumerated boolean type
1276 *
1277 * Values other than zero should be considered to be true. Therefore
1278 * comparisons should not be made against KHRONOS_TRUE.
1279 */
1280 typedef enum {
1281 KHRONOS_FALSE = 0,
1282 KHRONOS_TRUE = 1,
1283 KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM
1284 } khronos_boolean_enum_t;
1285
1286 #endif /* __khrplatform_h_ */
1287
1288 typedef unsigned int GLenum;
1289
1290 typedef unsigned char GLboolean;
1291
1292 typedef unsigned int GLbitfield;
1293
1294 typedef void GLvoid;
1295
1296 typedef khronos_int8_t GLbyte;
1297
1298 typedef khronos_uint8_t GLubyte;
1299
1300 typedef khronos_int16_t GLshort;
1301
1302 typedef khronos_uint16_t GLushort;
1303
1304 typedef int GLint;
1305
1306 typedef unsigned int GLuint;
1307
1308 typedef khronos_int32_t GLclampx;
1309
1310 typedef int GLsizei;
1311
1312 typedef khronos_float_t GLfloat;
1313
1314 typedef khronos_float_t GLclampf;
1315
1316 typedef double GLdouble;
1317
1318 typedef double GLclampd;
1319
1320 typedef void *GLeglClientBufferEXT;
1321
1322 typedef void *GLeglImageOES;
1323
1324 typedef char GLchar;
1325
1326 typedef char GLcharARB;
1327
1328 #ifdef __APPLE__
1329 typedef void *GLhandleARB;
1330 #else
1331 typedef unsigned int GLhandleARB;
1332 #endif
1333
1334 typedef khronos_uint16_t GLhalf;
1335
1336 typedef khronos_uint16_t GLhalfARB;
1337
1338 typedef khronos_int32_t GLfixed;
1339
1340 #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
1341 typedef khronos_intptr_t GLintptr;
1342 #else
1343 typedef khronos_intptr_t GLintptr;
1344 #endif
1345
1346 #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
1347 typedef khronos_intptr_t GLintptrARB;
1348 #else
1349 typedef khronos_intptr_t GLintptrARB;
1350 #endif
1351
1352 #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
1353 typedef khronos_ssize_t GLsizeiptr;
1354 #else
1355 typedef khronos_ssize_t GLsizeiptr;
1356 #endif
1357
1358 #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
1359 typedef khronos_ssize_t GLsizeiptrARB;
1360 #else
1361 typedef khronos_ssize_t GLsizeiptrARB;
1362 #endif
1363
1364 typedef khronos_int64_t GLint64;
1365
1366 typedef khronos_int64_t GLint64EXT;
1367
1368 typedef khronos_uint64_t GLuint64;
1369
1370 typedef khronos_uint64_t GLuint64EXT;
1371
1372 typedef struct __GLsync *GLsync;
1373
1374 struct _cl_context;
1375
1376 struct _cl_event;
1377
1378 typedef void (GLAD_API_PTR *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
1379
1380 typedef void (GLAD_API_PTR *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
1381
1382 typedef void (GLAD_API_PTR *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
1383
1384 typedef void (GLAD_API_PTR *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,void *userParam);
1385
1386 typedef unsigned short GLhalfNV;
1387
1388 typedef GLintptr GLvdpauSurfaceNV;
1389
1390 typedef void (GLAD_API_PTR *GLVULKANPROCNV)(void);
1391
1392
1393
1394 #define GL_VERSION_1_0 1
1395 GLAD_API_CALL int GLAD_GL_VERSION_1_0;
1396 #define GL_VERSION_1_1 1
1397 GLAD_API_CALL int GLAD_GL_VERSION_1_1;
1398 #define GL_VERSION_1_2 1
1399 GLAD_API_CALL int GLAD_GL_VERSION_1_2;
1400 #define GL_VERSION_1_3 1
1401 GLAD_API_CALL int GLAD_GL_VERSION_1_3;
1402 #define GL_VERSION_1_4 1
1403 GLAD_API_CALL int GLAD_GL_VERSION_1_4;
1404 #define GL_VERSION_1_5 1
1405 GLAD_API_CALL int GLAD_GL_VERSION_1_5;
1406 #define GL_VERSION_2_0 1
1407 GLAD_API_CALL int GLAD_GL_VERSION_2_0;
1408 #define GL_VERSION_2_1 1
1409 GLAD_API_CALL int GLAD_GL_VERSION_2_1;
1410 #define GL_VERSION_3_0 1
1411 GLAD_API_CALL int GLAD_GL_VERSION_3_0;
1412 #define GL_VERSION_3_1 1
1413 GLAD_API_CALL int GLAD_GL_VERSION_3_1;
1414 #define GL_VERSION_3_2 1
1415 GLAD_API_CALL int GLAD_GL_VERSION_3_2;
1416 #define GL_VERSION_3_3 1
1417 GLAD_API_CALL int GLAD_GL_VERSION_3_3;
1418
1419
1420 typedef void (GLAD_API_PTR *PFNGLACTIVETEXTUREPROC)(GLenum texture);
1421 typedef void (GLAD_API_PTR *PFNGLATTACHSHADERPROC)(GLuint program, GLuint shader);
1422 typedef void (GLAD_API_PTR *PFNGLBEGINCONDITIONALRENDERPROC)(GLuint id, GLenum mode);
1423 typedef void (GLAD_API_PTR *PFNGLBEGINQUERYPROC)(GLenum target, GLuint id);
1424 typedef void (GLAD_API_PTR *PFNGLBEGINTRANSFORMFEEDBACKPROC)(GLenum primitiveMode);
1425 typedef void (GLAD_API_PTR *PFNGLBINDATTRIBLOCATIONPROC)(GLuint program, GLuint index, const GLchar * name);
1426 typedef void (GLAD_API_PTR *PFNGLBINDBUFFERPROC)(GLenum target, GLuint buffer);
1427 typedef void (GLAD_API_PTR *PFNGLBINDBUFFERBASEPROC)(GLenum target, GLuint index, GLuint buffer);
1428 typedef void (GLAD_API_PTR *PFNGLBINDBUFFERRANGEPROC)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
1429 typedef void (GLAD_API_PTR *PFNGLBINDFRAGDATALOCATIONPROC)(GLuint program, GLuint color, const GLchar * name);
1430 typedef void (GLAD_API_PTR *PFNGLBINDFRAGDATALOCATIONINDEXEDPROC)(GLuint program, GLuint colorNumber, GLuint index, const GLchar * name);
1431 typedef void (GLAD_API_PTR *PFNGLBINDFRAMEBUFFERPROC)(GLenum target, GLuint framebuffer);
1432 typedef void (GLAD_API_PTR *PFNGLBINDRENDERBUFFERPROC)(GLenum target, GLuint renderbuffer);
1433 typedef void (GLAD_API_PTR *PFNGLBINDSAMPLERPROC)(GLuint unit, GLuint sampler);
1434 typedef void (GLAD_API_PTR *PFNGLBINDTEXTUREPROC)(GLenum target, GLuint texture);
1435 typedef void (GLAD_API_PTR *PFNGLBINDVERTEXARRAYPROC)(GLuint array);
1436 typedef void (GLAD_API_PTR *PFNGLBLENDCOLORPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
1437 typedef void (GLAD_API_PTR *PFNGLBLENDEQUATIONPROC)(GLenum mode);
1438 typedef void (GLAD_API_PTR *PFNGLBLENDEQUATIONSEPARATEPROC)(GLenum modeRGB, GLenum modeAlpha);
1439 typedef void (GLAD_API_PTR *PFNGLBLENDFUNCPROC)(GLenum sfactor, GLenum dfactor);
1440 typedef void (GLAD_API_PTR *PFNGLBLENDFUNCSEPARATEPROC)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
1441 typedef void (GLAD_API_PTR *PFNGLBLITFRAMEBUFFERPROC)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
1442 typedef void (GLAD_API_PTR *PFNGLBUFFERDATAPROC)(GLenum target, GLsizeiptr size, const void * data, GLenum usage);
1443 typedef void (GLAD_API_PTR *PFNGLBUFFERSUBDATAPROC)(GLenum target, GLintptr offset, GLsizeiptr size, const void * data);
1444 typedef GLenum (GLAD_API_PTR *PFNGLCHECKFRAMEBUFFERSTATUSPROC)(GLenum target);
1445 typedef void (GLAD_API_PTR *PFNGLCLAMPCOLORPROC)(GLenum target, GLenum clamp);
1446 typedef void (GLAD_API_PTR *PFNGLCLEARPROC)(GLbitfield mask);
1447 typedef void (GLAD_API_PTR *PFNGLCLEARBUFFERFIPROC)(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
1448 typedef void (GLAD_API_PTR *PFNGLCLEARBUFFERFVPROC)(GLenum buffer, GLint drawbuffer, const GLfloat * value);
1449 typedef void (GLAD_API_PTR *PFNGLCLEARBUFFERIVPROC)(GLenum buffer, GLint drawbuffer, const GLint * value);
1450 typedef void (GLAD_API_PTR *PFNGLCLEARBUFFERUIVPROC)(GLenum buffer, GLint drawbuffer, const GLuint * value);
1451 typedef void (GLAD_API_PTR *PFNGLCLEARCOLORPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
1452 typedef void (GLAD_API_PTR *PFNGLCLEARDEPTHPROC)(GLdouble depth);
1453 typedef void (GLAD_API_PTR *PFNGLCLEARSTENCILPROC)(GLint s);
1454 typedef GLenum (GLAD_API_PTR *PFNGLCLIENTWAITSYNCPROC)(GLsync sync, GLbitfield flags, GLuint64 timeout);
1455 typedef void (GLAD_API_PTR *PFNGLCOLORMASKPROC)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
1456 typedef void (GLAD_API_PTR *PFNGLCOLORMASKIPROC)(GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
1457 typedef void (GLAD_API_PTR *PFNGLCOMPILESHADERPROC)(GLuint shader);
1458 typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXIMAGE1DPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void * data);
1459 typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXIMAGE2DPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void * data);
1460 typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXIMAGE3DPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void * data);
1461 typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void * data);
1462 typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void * data);
1463 typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void * data);
1464 typedef void (GLAD_API_PTR *PFNGLCOPYBUFFERSUBDATAPROC)(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
1465 typedef void (GLAD_API_PTR *PFNGLCOPYTEXIMAGE1DPROC)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
1466 typedef void (GLAD_API_PTR *PFNGLCOPYTEXIMAGE2DPROC)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
1467 typedef void (GLAD_API_PTR *PFNGLCOPYTEXSUBIMAGE1DPROC)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
1468 typedef void (GLAD_API_PTR *PFNGLCOPYTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
1469 typedef void (GLAD_API_PTR *PFNGLCOPYTEXSUBIMAGE3DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
1470 typedef GLuint (GLAD_API_PTR *PFNGLCREATEPROGRAMPROC)(void);
1471 typedef GLuint (GLAD_API_PTR *PFNGLCREATESHADERPROC)(GLenum type);
1472 typedef void (GLAD_API_PTR *PFNGLCULLFACEPROC)(GLenum mode);
1473 typedef void (GLAD_API_PTR *PFNGLDELETEBUFFERSPROC)(GLsizei n, const GLuint * buffers);
1474 typedef void (GLAD_API_PTR *PFNGLDELETEFRAMEBUFFERSPROC)(GLsizei n, const GLuint * framebuffers);
1475 typedef void (GLAD_API_PTR *PFNGLDELETEPROGRAMPROC)(GLuint program);
1476 typedef void (GLAD_API_PTR *PFNGLDELETEQUERIESPROC)(GLsizei n, const GLuint * ids);
1477 typedef void (GLAD_API_PTR *PFNGLDELETERENDERBUFFERSPROC)(GLsizei n, const GLuint * renderbuffers);
1478 typedef void (GLAD_API_PTR *PFNGLDELETESAMPLERSPROC)(GLsizei count, const GLuint * samplers);
1479 typedef void (GLAD_API_PTR *PFNGLDELETESHADERPROC)(GLuint shader);
1480 typedef void (GLAD_API_PTR *PFNGLDELETESYNCPROC)(GLsync sync);
1481 typedef void (GLAD_API_PTR *PFNGLDELETETEXTURESPROC)(GLsizei n, const GLuint * textures);
1482 typedef void (GLAD_API_PTR *PFNGLDELETEVERTEXARRAYSPROC)(GLsizei n, const GLuint * arrays);
1483 typedef void (GLAD_API_PTR *PFNGLDEPTHFUNCPROC)(GLenum func);
1484 typedef void (GLAD_API_PTR *PFNGLDEPTHMASKPROC)(GLboolean flag);
1485 typedef void (GLAD_API_PTR *PFNGLDEPTHRANGEPROC)(GLdouble n, GLdouble f);
1486 typedef void (GLAD_API_PTR *PFNGLDETACHSHADERPROC)(GLuint program, GLuint shader);
1487 typedef void (GLAD_API_PTR *PFNGLDISABLEPROC)(GLenum cap);
1488 typedef void (GLAD_API_PTR *PFNGLDISABLEVERTEXATTRIBARRAYPROC)(GLuint index);
1489 typedef void (GLAD_API_PTR *PFNGLDISABLEIPROC)(GLenum target, GLuint index);
1490 typedef void (GLAD_API_PTR *PFNGLDRAWARRAYSPROC)(GLenum mode, GLint first, GLsizei count);
1491 typedef void (GLAD_API_PTR *PFNGLDRAWARRAYSINSTANCEDPROC)(GLenum mode, GLint first, GLsizei count, GLsizei instancecount);
1492 typedef void (GLAD_API_PTR *PFNGLDRAWBUFFERPROC)(GLenum buf);
1493 typedef void (GLAD_API_PTR *PFNGLDRAWBUFFERSPROC)(GLsizei n, const GLenum * bufs);
1494 typedef void (GLAD_API_PTR *PFNGLDRAWELEMENTSPROC)(GLenum mode, GLsizei count, GLenum type, const void * indices);
1495 typedef void (GLAD_API_PTR *PFNGLDRAWELEMENTSBASEVERTEXPROC)(GLenum mode, GLsizei count, GLenum type, const void * indices, GLint basevertex);
1496 typedef void (GLAD_API_PTR *PFNGLDRAWELEMENTSINSTANCEDPROC)(GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei instancecount);
1497 typedef void (GLAD_API_PTR *PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC)(GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei instancecount, GLint basevertex);
1498 typedef void (GLAD_API_PTR *PFNGLDRAWRANGEELEMENTSPROC)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void * indices);
1499 typedef void (GLAD_API_PTR *PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void * indices, GLint basevertex);
1500 typedef void (GLAD_API_PTR *PFNGLENABLEPROC)(GLenum cap);
1501 typedef void (GLAD_API_PTR *PFNGLENABLEVERTEXATTRIBARRAYPROC)(GLuint index);
1502 typedef void (GLAD_API_PTR *PFNGLENABLEIPROC)(GLenum target, GLuint index);
1503 typedef void (GLAD_API_PTR *PFNGLENDCONDITIONALRENDERPROC)(void);
1504 typedef void (GLAD_API_PTR *PFNGLENDQUERYPROC)(GLenum target);
1505 typedef void (GLAD_API_PTR *PFNGLENDTRANSFORMFEEDBACKPROC)(void);
1506 typedef GLsync (GLAD_API_PTR *PFNGLFENCESYNCPROC)(GLenum condition, GLbitfield flags);
1507 typedef void (GLAD_API_PTR *PFNGLFINISHPROC)(void);
1508 typedef void (GLAD_API_PTR *PFNGLFLUSHPROC)(void);
1509 typedef void (GLAD_API_PTR *PFNGLFLUSHMAPPEDBUFFERRANGEPROC)(GLenum target, GLintptr offset, GLsizeiptr length);
1510 typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERRENDERBUFFERPROC)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
1511 typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERTEXTUREPROC)(GLenum target, GLenum attachment, GLuint texture, GLint level);
1512 typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERTEXTURE1DPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
1513 typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERTEXTURE2DPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
1514 typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERTEXTURE3DPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
1515 typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERTEXTURELAYERPROC)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
1516 typedef void (GLAD_API_PTR *PFNGLFRONTFACEPROC)(GLenum mode);
1517 typedef void (GLAD_API_PTR *PFNGLGENBUFFERSPROC)(GLsizei n, GLuint * buffers);
1518 typedef void (GLAD_API_PTR *PFNGLGENFRAMEBUFFERSPROC)(GLsizei n, GLuint * framebuffers);
1519 typedef void (GLAD_API_PTR *PFNGLGENQUERIESPROC)(GLsizei n, GLuint * ids);
1520 typedef void (GLAD_API_PTR *PFNGLGENRENDERBUFFERSPROC)(GLsizei n, GLuint * renderbuffers);
1521 typedef void (GLAD_API_PTR *PFNGLGENSAMPLERSPROC)(GLsizei count, GLuint * samplers);
1522 typedef void (GLAD_API_PTR *PFNGLGENTEXTURESPROC)(GLsizei n, GLuint * textures);
1523 typedef void (GLAD_API_PTR *PFNGLGENVERTEXARRAYSPROC)(GLsizei n, GLuint * arrays);
1524 typedef void (GLAD_API_PTR *PFNGLGENERATEMIPMAPPROC)(GLenum target);
1525 typedef void (GLAD_API_PTR *PFNGLGETACTIVEATTRIBPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name);
1526 typedef void (GLAD_API_PTR *PFNGLGETACTIVEUNIFORMPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name);
1527 typedef void (GLAD_API_PTR *PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei * length, GLchar * uniformBlockName);
1528 typedef void (GLAD_API_PTR *PFNGLGETACTIVEUNIFORMBLOCKIVPROC)(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint * params);
1529 typedef void (GLAD_API_PTR *PFNGLGETACTIVEUNIFORMNAMEPROC)(GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei * length, GLchar * uniformName);
1530 typedef void (GLAD_API_PTR *PFNGLGETACTIVEUNIFORMSIVPROC)(GLuint program, GLsizei uniformCount, const GLuint * uniformIndices, GLenum pname, GLint * params);
1531 typedef void (GLAD_API_PTR *PFNGLGETATTACHEDSHADERSPROC)(GLuint program, GLsizei maxCount, GLsizei * count, GLuint * shaders);
1532 typedef GLint (GLAD_API_PTR *PFNGLGETATTRIBLOCATIONPROC)(GLuint program, const GLchar * name);
1533 typedef void (GLAD_API_PTR *PFNGLGETBOOLEANI_VPROC)(GLenum target, GLuint index, GLboolean * data);
1534 typedef void (GLAD_API_PTR *PFNGLGETBOOLEANVPROC)(GLenum pname, GLboolean * data);
1535 typedef void (GLAD_API_PTR *PFNGLGETBUFFERPARAMETERI64VPROC)(GLenum target, GLenum pname, GLint64 * params);
1536 typedef void (GLAD_API_PTR *PFNGLGETBUFFERPARAMETERIVPROC)(GLenum target, GLenum pname, GLint * params);
1537 typedef void (GLAD_API_PTR *PFNGLGETBUFFERPOINTERVPROC)(GLenum target, GLenum pname, void ** params);
1538 typedef void (GLAD_API_PTR *PFNGLGETBUFFERSUBDATAPROC)(GLenum target, GLintptr offset, GLsizeiptr size, void * data);
1539 typedef void (GLAD_API_PTR *PFNGLGETCOMPRESSEDTEXIMAGEPROC)(GLenum target, GLint level, void * img);
1540 typedef void (GLAD_API_PTR *PFNGLGETDOUBLEVPROC)(GLenum pname, GLdouble * data);
1541 typedef GLenum (GLAD_API_PTR *PFNGLGETERRORPROC)(void);
1542 typedef void (GLAD_API_PTR *PFNGLGETFLOATVPROC)(GLenum pname, GLfloat * data);
1543 typedef GLint (GLAD_API_PTR *PFNGLGETFRAGDATAINDEXPROC)(GLuint program, const GLchar * name);
1544 typedef GLint (GLAD_API_PTR *PFNGLGETFRAGDATALOCATIONPROC)(GLuint program, const GLchar * name);
1545 typedef void (GLAD_API_PTR *PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)(GLenum target, GLenum attachment, GLenum pname, GLint * params);
1546 typedef void (GLAD_API_PTR *PFNGLGETINTEGER64I_VPROC)(GLenum target, GLuint index, GLint64 * data);
1547 typedef void (GLAD_API_PTR *PFNGLGETINTEGER64VPROC)(GLenum pname, GLint64 * data);
1548 typedef void (GLAD_API_PTR *PFNGLGETINTEGERI_VPROC)(GLenum target, GLuint index, GLint * data);
1549 typedef void (GLAD_API_PTR *PFNGLGETINTEGERVPROC)(GLenum pname, GLint * data);
1550 typedef void (GLAD_API_PTR *PFNGLGETMULTISAMPLEFVPROC)(GLenum pname, GLuint index, GLfloat * val);
1551 typedef void (GLAD_API_PTR *PFNGLGETPROGRAMINFOLOGPROC)(GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog);
1552 typedef void (GLAD_API_PTR *PFNGLGETPROGRAMIVPROC)(GLuint program, GLenum pname, GLint * params);
1553 typedef void (GLAD_API_PTR *PFNGLGETQUERYOBJECTI64VPROC)(GLuint id, GLenum pname, GLint64 * params);
1554 typedef void (GLAD_API_PTR *PFNGLGETQUERYOBJECTIVPROC)(GLuint id, GLenum pname, GLint * params);
1555 typedef void (GLAD_API_PTR *PFNGLGETQUERYOBJECTUI64VPROC)(GLuint id, GLenum pname, GLuint64 * params);
1556 typedef void (GLAD_API_PTR *PFNGLGETQUERYOBJECTUIVPROC)(GLuint id, GLenum pname, GLuint * params);
1557 typedef void (GLAD_API_PTR *PFNGLGETQUERYIVPROC)(GLenum target, GLenum pname, GLint * params);
1558 typedef void (GLAD_API_PTR *PFNGLGETRENDERBUFFERPARAMETERIVPROC)(GLenum target, GLenum pname, GLint * params);
1559 typedef void (GLAD_API_PTR *PFNGLGETSAMPLERPARAMETERIIVPROC)(GLuint sampler, GLenum pname, GLint * params);
1560 typedef void (GLAD_API_PTR *PFNGLGETSAMPLERPARAMETERIUIVPROC)(GLuint sampler, GLenum pname, GLuint * params);
1561 typedef void (GLAD_API_PTR *PFNGLGETSAMPLERPARAMETERFVPROC)(GLuint sampler, GLenum pname, GLfloat * params);
1562 typedef void (GLAD_API_PTR *PFNGLGETSAMPLERPARAMETERIVPROC)(GLuint sampler, GLenum pname, GLint * params);
1563 typedef void (GLAD_API_PTR *PFNGLGETSHADERINFOLOGPROC)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog);
1564 typedef void (GLAD_API_PTR *PFNGLGETSHADERSOURCEPROC)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * source);
1565 typedef void (GLAD_API_PTR *PFNGLGETSHADERIVPROC)(GLuint shader, GLenum pname, GLint * params);
1566 typedef const GLubyte * (GLAD_API_PTR *PFNGLGETSTRINGPROC)(GLenum name);
1567 typedef const GLubyte * (GLAD_API_PTR *PFNGLGETSTRINGIPROC)(GLenum name, GLuint index);
1568 typedef void (GLAD_API_PTR *PFNGLGETSYNCIVPROC)(GLsync sync, GLenum pname, GLsizei count, GLsizei * length, GLint * values);
1569 typedef void (GLAD_API_PTR *PFNGLGETTEXIMAGEPROC)(GLenum target, GLint level, GLenum format, GLenum type, void * pixels);
1570 typedef void (GLAD_API_PTR *PFNGLGETTEXLEVELPARAMETERFVPROC)(GLenum target, GLint level, GLenum pname, GLfloat * params);
1571 typedef void (GLAD_API_PTR *PFNGLGETTEXLEVELPARAMETERIVPROC)(GLenum target, GLint level, GLenum pname, GLint * params);
1572 typedef void (GLAD_API_PTR *PFNGLGETTEXPARAMETERIIVPROC)(GLenum target, GLenum pname, GLint * params);
1573 typedef void (GLAD_API_PTR *PFNGLGETTEXPARAMETERIUIVPROC)(GLenum target, GLenum pname, GLuint * params);
1574 typedef void (GLAD_API_PTR *PFNGLGETTEXPARAMETERFVPROC)(GLenum target, GLenum pname, GLfloat * params);
1575 typedef void (GLAD_API_PTR *PFNGLGETTEXPARAMETERIVPROC)(GLenum target, GLenum pname, GLint * params);
1576 typedef void (GLAD_API_PTR *PFNGLGETTRANSFORMFEEDBACKVARYINGPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, GLchar * name);
1577 typedef GLuint (GLAD_API_PTR *PFNGLGETUNIFORMBLOCKINDEXPROC)(GLuint program, const GLchar * uniformBlockName);
1578 typedef void (GLAD_API_PTR *PFNGLGETUNIFORMINDICESPROC)(GLuint program, GLsizei uniformCount, const GLchar *const* uniformNames, GLuint * uniformIndices);
1579 typedef GLint (GLAD_API_PTR *PFNGLGETUNIFORMLOCATIONPROC)(GLuint program, const GLchar * name);
1580 typedef void (GLAD_API_PTR *PFNGLGETUNIFORMFVPROC)(GLuint program, GLint location, GLfloat * params);
1581 typedef void (GLAD_API_PTR *PFNGLGETUNIFORMIVPROC)(GLuint program, GLint location, GLint * params);
1582 typedef void (GLAD_API_PTR *PFNGLGETUNIFORMUIVPROC)(GLuint program, GLint location, GLuint * params);
1583 typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBIIVPROC)(GLuint index, GLenum pname, GLint * params);
1584 typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBIUIVPROC)(GLuint index, GLenum pname, GLuint * params);
1585 typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBPOINTERVPROC)(GLuint index, GLenum pname, void ** pointer);
1586 typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBDVPROC)(GLuint index, GLenum pname, GLdouble * params);
1587 typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBFVPROC)(GLuint index, GLenum pname, GLfloat * params);
1588 typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBIVPROC)(GLuint index, GLenum pname, GLint * params);
1589 typedef void (GLAD_API_PTR *PFNGLHINTPROC)(GLenum target, GLenum mode);
1590 typedef GLboolean (GLAD_API_PTR *PFNGLISBUFFERPROC)(GLuint buffer);
1591 typedef GLboolean (GLAD_API_PTR *PFNGLISENABLEDPROC)(GLenum cap);
1592 typedef GLboolean (GLAD_API_PTR *PFNGLISENABLEDIPROC)(GLenum target, GLuint index);
1593 typedef GLboolean (GLAD_API_PTR *PFNGLISFRAMEBUFFERPROC)(GLuint framebuffer);
1594 typedef GLboolean (GLAD_API_PTR *PFNGLISPROGRAMPROC)(GLuint program);
1595 typedef GLboolean (GLAD_API_PTR *PFNGLISQUERYPROC)(GLuint id);
1596 typedef GLboolean (GLAD_API_PTR *PFNGLISRENDERBUFFERPROC)(GLuint renderbuffer);
1597 typedef GLboolean (GLAD_API_PTR *PFNGLISSAMPLERPROC)(GLuint sampler);
1598 typedef GLboolean (GLAD_API_PTR *PFNGLISSHADERPROC)(GLuint shader);
1599 typedef GLboolean (GLAD_API_PTR *PFNGLISSYNCPROC)(GLsync sync);
1600 typedef GLboolean (GLAD_API_PTR *PFNGLISTEXTUREPROC)(GLuint texture);
1601 typedef GLboolean (GLAD_API_PTR *PFNGLISVERTEXARRAYPROC)(GLuint array);
1602 typedef void (GLAD_API_PTR *PFNGLLINEWIDTHPROC)(GLfloat width);
1603 typedef void (GLAD_API_PTR *PFNGLLINKPROGRAMPROC)(GLuint program);
1604 typedef void (GLAD_API_PTR *PFNGLLOGICOPPROC)(GLenum opcode);
1605 typedef void * (GLAD_API_PTR *PFNGLMAPBUFFERPROC)(GLenum target, GLenum access);
1606 typedef void * (GLAD_API_PTR *PFNGLMAPBUFFERRANGEPROC)(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
1607 typedef void (GLAD_API_PTR *PFNGLMULTIDRAWARRAYSPROC)(GLenum mode, const GLint * first, const GLsizei * count, GLsizei drawcount);
1608 typedef void (GLAD_API_PTR *PFNGLMULTIDRAWELEMENTSPROC)(GLenum mode, const GLsizei * count, GLenum type, const void *const* indices, GLsizei drawcount);
1609 typedef void (GLAD_API_PTR *PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC)(GLenum mode, const GLsizei * count, GLenum type, const void *const* indices, GLsizei drawcount, const GLint * basevertex);
1610 typedef void (GLAD_API_PTR *PFNGLPIXELSTOREFPROC)(GLenum pname, GLfloat param);
1611 typedef void (GLAD_API_PTR *PFNGLPIXELSTOREIPROC)(GLenum pname, GLint param);
1612 typedef void (GLAD_API_PTR *PFNGLPOINTPARAMETERFPROC)(GLenum pname, GLfloat param);
1613 typedef void (GLAD_API_PTR *PFNGLPOINTPARAMETERFVPROC)(GLenum pname, const GLfloat * params);
1614 typedef void (GLAD_API_PTR *PFNGLPOINTPARAMETERIPROC)(GLenum pname, GLint param);
1615 typedef void (GLAD_API_PTR *PFNGLPOINTPARAMETERIVPROC)(GLenum pname, const GLint * params);
1616 typedef void (GLAD_API_PTR *PFNGLPOINTSIZEPROC)(GLfloat size);
1617 typedef void (GLAD_API_PTR *PFNGLPOLYGONMODEPROC)(GLenum face, GLenum mode);
1618 typedef void (GLAD_API_PTR *PFNGLPOLYGONOFFSETPROC)(GLfloat factor, GLfloat units);
1619 typedef void (GLAD_API_PTR *PFNGLPRIMITIVERESTARTINDEXPROC)(GLuint index);
1620 typedef void (GLAD_API_PTR *PFNGLPROVOKINGVERTEXPROC)(GLenum mode);
1621 typedef void (GLAD_API_PTR *PFNGLQUERYCOUNTERPROC)(GLuint id, GLenum target);
1622 typedef void (GLAD_API_PTR *PFNGLREADBUFFERPROC)(GLenum src);
1623 typedef void (GLAD_API_PTR *PFNGLREADPIXELSPROC)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void * pixels);
1624 typedef void (GLAD_API_PTR *PFNGLRENDERBUFFERSTORAGEPROC)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
1625 typedef void (GLAD_API_PTR *PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
1626 typedef void (GLAD_API_PTR *PFNGLSAMPLECOVERAGEPROC)(GLfloat value, GLboolean invert);
1627 typedef void (GLAD_API_PTR *PFNGLSAMPLEMASKIPROC)(GLuint maskNumber, GLbitfield mask);
1628 typedef void (GLAD_API_PTR *PFNGLSAMPLERPARAMETERIIVPROC)(GLuint sampler, GLenum pname, const GLint * param);
1629 typedef void (GLAD_API_PTR *PFNGLSAMPLERPARAMETERIUIVPROC)(GLuint sampler, GLenum pname, const GLuint * param);
1630 typedef void (GLAD_API_PTR *PFNGLSAMPLERPARAMETERFPROC)(GLuint sampler, GLenum pname, GLfloat param);
1631 typedef void (GLAD_API_PTR *PFNGLSAMPLERPARAMETERFVPROC)(GLuint sampler, GLenum pname, const GLfloat * param);
1632 typedef void (GLAD_API_PTR *PFNGLSAMPLERPARAMETERIPROC)(GLuint sampler, GLenum pname, GLint param);
1633 typedef void (GLAD_API_PTR *PFNGLSAMPLERPARAMETERIVPROC)(GLuint sampler, GLenum pname, const GLint * param);
1634 typedef void (GLAD_API_PTR *PFNGLSCISSORPROC)(GLint x, GLint y, GLsizei width, GLsizei height);
1635 typedef void (GLAD_API_PTR *PFNGLSHADERSOURCEPROC)(GLuint shader, GLsizei count, const GLchar *const* string, const GLint * length);
1636 typedef void (GLAD_API_PTR *PFNGLSTENCILFUNCPROC)(GLenum func, GLint ref, GLuint mask);
1637 typedef void (GLAD_API_PTR *PFNGLSTENCILFUNCSEPARATEPROC)(GLenum face, GLenum func, GLint ref, GLuint mask);
1638 typedef void (GLAD_API_PTR *PFNGLSTENCILMASKPROC)(GLuint mask);
1639 typedef void (GLAD_API_PTR *PFNGLSTENCILMASKSEPARATEPROC)(GLenum face, GLuint mask);
1640 typedef void (GLAD_API_PTR *PFNGLSTENCILOPPROC)(GLenum fail, GLenum zfail, GLenum zpass);
1641 typedef void (GLAD_API_PTR *PFNGLSTENCILOPSEPARATEPROC)(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
1642 typedef void (GLAD_API_PTR *PFNGLTEXBUFFERPROC)(GLenum target, GLenum internalformat, GLuint buffer);
1643 typedef void (GLAD_API_PTR *PFNGLTEXIMAGE1DPROC)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void * pixels);
1644 typedef void (GLAD_API_PTR *PFNGLTEXIMAGE2DPROC)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void * pixels);
1645 typedef void (GLAD_API_PTR *PFNGLTEXIMAGE2DMULTISAMPLEPROC)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
1646 typedef void (GLAD_API_PTR *PFNGLTEXIMAGE3DPROC)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void * pixels);
1647 typedef void (GLAD_API_PTR *PFNGLTEXIMAGE3DMULTISAMPLEPROC)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
1648 typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERIIVPROC)(GLenum target, GLenum pname, const GLint * params);
1649 typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERIUIVPROC)(GLenum target, GLenum pname, const GLuint * params);
1650 typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERFPROC)(GLenum target, GLenum pname, GLfloat param);
1651 typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERFVPROC)(GLenum target, GLenum pname, const GLfloat * params);
1652 typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERIPROC)(GLenum target, GLenum pname, GLint param);
1653 typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERIVPROC)(GLenum target, GLenum pname, const GLint * params);
1654 typedef void (GLAD_API_PTR *PFNGLTEXSUBIMAGE1DPROC)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void * pixels);
1655 typedef void (GLAD_API_PTR *PFNGLTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void * pixels);
1656 typedef void (GLAD_API_PTR *PFNGLTEXSUBIMAGE3DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void * pixels);
1657 typedef void (GLAD_API_PTR *PFNGLTRANSFORMFEEDBACKVARYINGSPROC)(GLuint program, GLsizei count, const GLchar *const* varyings, GLenum bufferMode);
1658 typedef void (GLAD_API_PTR *PFNGLUNIFORM1FPROC)(GLint location, GLfloat v0);
1659 typedef void (GLAD_API_PTR *PFNGLUNIFORM1FVPROC)(GLint location, GLsizei count, const GLfloat * value);
1660 typedef void (GLAD_API_PTR *PFNGLUNIFORM1IPROC)(GLint location, GLint v0);
1661 typedef void (GLAD_API_PTR *PFNGLUNIFORM1IVPROC)(GLint location, GLsizei count, const GLint * value);
1662 typedef void (GLAD_API_PTR *PFNGLUNIFORM1UIPROC)(GLint location, GLuint v0);
1663 typedef void (GLAD_API_PTR *PFNGLUNIFORM1UIVPROC)(GLint location, GLsizei count, const GLuint * value);
1664 typedef void (GLAD_API_PTR *PFNGLUNIFORM2FPROC)(GLint location, GLfloat v0, GLfloat v1);
1665 typedef void (GLAD_API_PTR *PFNGLUNIFORM2FVPROC)(GLint location, GLsizei count, const GLfloat * value);
1666 typedef void (GLAD_API_PTR *PFNGLUNIFORM2IPROC)(GLint location, GLint v0, GLint v1);
1667 typedef void (GLAD_API_PTR *PFNGLUNIFORM2IVPROC)(GLint location, GLsizei count, const GLint * value);
1668 typedef void (GLAD_API_PTR *PFNGLUNIFORM2UIPROC)(GLint location, GLuint v0, GLuint v1);
1669 typedef void (GLAD_API_PTR *PFNGLUNIFORM2UIVPROC)(GLint location, GLsizei count, const GLuint * value);
1670 typedef void (GLAD_API_PTR *PFNGLUNIFORM3FPROC)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
1671 typedef void (GLAD_API_PTR *PFNGLUNIFORM3FVPROC)(GLint location, GLsizei count, const GLfloat * value);
1672 typedef void (GLAD_API_PTR *PFNGLUNIFORM3IPROC)(GLint location, GLint v0, GLint v1, GLint v2);
1673 typedef void (GLAD_API_PTR *PFNGLUNIFORM3IVPROC)(GLint location, GLsizei count, const GLint * value);
1674 typedef void (GLAD_API_PTR *PFNGLUNIFORM3UIPROC)(GLint location, GLuint v0, GLuint v1, GLuint v2);
1675 typedef void (GLAD_API_PTR *PFNGLUNIFORM3UIVPROC)(GLint location, GLsizei count, const GLuint * value);
1676 typedef void (GLAD_API_PTR *PFNGLUNIFORM4FPROC)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
1677 typedef void (GLAD_API_PTR *PFNGLUNIFORM4FVPROC)(GLint location, GLsizei count, const GLfloat * value);
1678 typedef void (GLAD_API_PTR *PFNGLUNIFORM4IPROC)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
1679 typedef void (GLAD_API_PTR *PFNGLUNIFORM4IVPROC)(GLint location, GLsizei count, const GLint * value);
1680 typedef void (GLAD_API_PTR *PFNGLUNIFORM4UIPROC)(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
1681 typedef void (GLAD_API_PTR *PFNGLUNIFORM4UIVPROC)(GLint location, GLsizei count, const GLuint * value);
1682 typedef void (GLAD_API_PTR *PFNGLUNIFORMBLOCKBINDINGPROC)(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
1683 typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX2FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
1684 typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX2X3FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
1685 typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX2X4FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
1686 typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX3FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
1687 typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX3X2FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
1688 typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX3X4FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
1689 typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX4FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
1690 typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX4X2FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
1691 typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX4X3FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
1692 typedef GLboolean (GLAD_API_PTR *PFNGLUNMAPBUFFERPROC)(GLenum target);
1693 typedef void (GLAD_API_PTR *PFNGLUSEPROGRAMPROC)(GLuint program);
1694 typedef void (GLAD_API_PTR *PFNGLVALIDATEPROGRAMPROC)(GLuint program);
1695 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB1DPROC)(GLuint index, GLdouble x);
1696 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB1DVPROC)(GLuint index, const GLdouble * v);
1697 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB1FPROC)(GLuint index, GLfloat x);
1698 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB1FVPROC)(GLuint index, const GLfloat * v);
1699 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB1SPROC)(GLuint index, GLshort x);
1700 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB1SVPROC)(GLuint index, const GLshort * v);
1701 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB2DPROC)(GLuint index, GLdouble x, GLdouble y);
1702 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB2DVPROC)(GLuint index, const GLdouble * v);
1703 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB2FPROC)(GLuint index, GLfloat x, GLfloat y);
1704 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB2FVPROC)(GLuint index, const GLfloat * v);
1705 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB2SPROC)(GLuint index, GLshort x, GLshort y);
1706 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB2SVPROC)(GLuint index, const GLshort * v);
1707 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB3DPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z);
1708 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB3DVPROC)(GLuint index, const GLdouble * v);
1709 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB3FPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z);
1710 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB3FVPROC)(GLuint index, const GLfloat * v);
1711 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB3SPROC)(GLuint index, GLshort x, GLshort y, GLshort z);
1712 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB3SVPROC)(GLuint index, const GLshort * v);
1713 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4NBVPROC)(GLuint index, const GLbyte * v);
1714 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4NIVPROC)(GLuint index, const GLint * v);
1715 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4NSVPROC)(GLuint index, const GLshort * v);
1716 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4NUBPROC)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
1717 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4NUBVPROC)(GLuint index, const GLubyte * v);
1718 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4NUIVPROC)(GLuint index, const GLuint * v);
1719 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4NUSVPROC)(GLuint index, const GLushort * v);
1720 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4BVPROC)(GLuint index, const GLbyte * v);
1721 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4DPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
1722 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4DVPROC)(GLuint index, const GLdouble * v);
1723 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4FPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
1724 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4FVPROC)(GLuint index, const GLfloat * v);
1725 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4IVPROC)(GLuint index, const GLint * v);
1726 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4SPROC)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
1727 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4SVPROC)(GLuint index, const GLshort * v);
1728 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4UBVPROC)(GLuint index, const GLubyte * v);
1729 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4UIVPROC)(GLuint index, const GLuint * v);
1730 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4USVPROC)(GLuint index, const GLushort * v);
1731 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBDIVISORPROC)(GLuint index, GLuint divisor);
1732 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI1IPROC)(GLuint index, GLint x);
1733 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI1IVPROC)(GLuint index, const GLint * v);
1734 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI1UIPROC)(GLuint index, GLuint x);
1735 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI1UIVPROC)(GLuint index, const GLuint * v);
1736 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI2IPROC)(GLuint index, GLint x, GLint y);
1737 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI2IVPROC)(GLuint index, const GLint * v);
1738 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI2UIPROC)(GLuint index, GLuint x, GLuint y);
1739 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI2UIVPROC)(GLuint index, const GLuint * v);
1740 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI3IPROC)(GLuint index, GLint x, GLint y, GLint z);
1741 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI3IVPROC)(GLuint index, const GLint * v);
1742 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI3UIPROC)(GLuint index, GLuint x, GLuint y, GLuint z);
1743 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI3UIVPROC)(GLuint index, const GLuint * v);
1744 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4BVPROC)(GLuint index, const GLbyte * v);
1745 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4IPROC)(GLuint index, GLint x, GLint y, GLint z, GLint w);
1746 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4IVPROC)(GLuint index, const GLint * v);
1747 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4SVPROC)(GLuint index, const GLshort * v);
1748 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4UBVPROC)(GLuint index, const GLubyte * v);
1749 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4UIPROC)(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
1750 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4UIVPROC)(GLuint index, const GLuint * v);
1751 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4USVPROC)(GLuint index, const GLushort * v);
1752 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBIPOINTERPROC)(GLuint index, GLint size, GLenum type, GLsizei stride, const void * pointer);
1753 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBP1UIPROC)(GLuint index, GLenum type, GLboolean normalized, GLuint value);
1754 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBP1UIVPROC)(GLuint index, GLenum type, GLboolean normalized, const GLuint * value);
1755 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBP2UIPROC)(GLuint index, GLenum type, GLboolean normalized, GLuint value);
1756 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBP2UIVPROC)(GLuint index, GLenum type, GLboolean normalized, const GLuint * value);
1757 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBP3UIPROC)(GLuint index, GLenum type, GLboolean normalized, GLuint value);
1758 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBP3UIVPROC)(GLuint index, GLenum type, GLboolean normalized, const GLuint * value);
1759 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBP4UIPROC)(GLuint index, GLenum type, GLboolean normalized, GLuint value);
1760 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBP4UIVPROC)(GLuint index, GLenum type, GLboolean normalized, const GLuint * value);
1761 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBPOINTERPROC)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void * pointer);
1762 typedef void (GLAD_API_PTR *PFNGLVIEWPORTPROC)(GLint x, GLint y, GLsizei width, GLsizei height);
1763 typedef void (GLAD_API_PTR *PFNGLWAITSYNCPROC)(GLsync sync, GLbitfield flags, GLuint64 timeout);
1764
1765 GLAD_API_CALL PFNGLACTIVETEXTUREPROC glad_glActiveTexture;
1766 #define glActiveTexture glad_glActiveTexture
1767 GLAD_API_CALL PFNGLATTACHSHADERPROC glad_glAttachShader;
1768 #define glAttachShader glad_glAttachShader
1769 GLAD_API_CALL PFNGLBEGINCONDITIONALRENDERPROC glad_glBeginConditionalRender;
1770 #define glBeginConditionalRender glad_glBeginConditionalRender
1771 GLAD_API_CALL PFNGLBEGINQUERYPROC glad_glBeginQuery;
1772 #define glBeginQuery glad_glBeginQuery
1773 GLAD_API_CALL PFNGLBEGINTRANSFORMFEEDBACKPROC glad_glBeginTransformFeedback;
1774 #define glBeginTransformFeedback glad_glBeginTransformFeedback
1775 GLAD_API_CALL PFNGLBINDATTRIBLOCATIONPROC glad_glBindAttribLocation;
1776 #define glBindAttribLocation glad_glBindAttribLocation
1777 GLAD_API_CALL PFNGLBINDBUFFERPROC glad_glBindBuffer;
1778 #define glBindBuffer glad_glBindBuffer
1779 GLAD_API_CALL PFNGLBINDBUFFERBASEPROC glad_glBindBufferBase;
1780 #define glBindBufferBase glad_glBindBufferBase
1781 GLAD_API_CALL PFNGLBINDBUFFERRANGEPROC glad_glBindBufferRange;
1782 #define glBindBufferRange glad_glBindBufferRange
1783 GLAD_API_CALL PFNGLBINDFRAGDATALOCATIONPROC glad_glBindFragDataLocation;
1784 #define glBindFragDataLocation glad_glBindFragDataLocation
1785 GLAD_API_CALL PFNGLBINDFRAGDATALOCATIONINDEXEDPROC glad_glBindFragDataLocationIndexed;
1786 #define glBindFragDataLocationIndexed glad_glBindFragDataLocationIndexed
1787 GLAD_API_CALL PFNGLBINDFRAMEBUFFERPROC glad_glBindFramebuffer;
1788 #define glBindFramebuffer glad_glBindFramebuffer
1789 GLAD_API_CALL PFNGLBINDRENDERBUFFERPROC glad_glBindRenderbuffer;
1790 #define glBindRenderbuffer glad_glBindRenderbuffer
1791 GLAD_API_CALL PFNGLBINDSAMPLERPROC glad_glBindSampler;
1792 #define glBindSampler glad_glBindSampler
1793 GLAD_API_CALL PFNGLBINDTEXTUREPROC glad_glBindTexture;
1794 #define glBindTexture glad_glBindTexture
1795 GLAD_API_CALL PFNGLBINDVERTEXARRAYPROC glad_glBindVertexArray;
1796 #define glBindVertexArray glad_glBindVertexArray
1797 GLAD_API_CALL PFNGLBLENDCOLORPROC glad_glBlendColor;
1798 #define glBlendColor glad_glBlendColor
1799 GLAD_API_CALL PFNGLBLENDEQUATIONPROC glad_glBlendEquation;
1800 #define glBlendEquation glad_glBlendEquation
1801 GLAD_API_CALL PFNGLBLENDEQUATIONSEPARATEPROC glad_glBlendEquationSeparate;
1802 #define glBlendEquationSeparate glad_glBlendEquationSeparate
1803 GLAD_API_CALL PFNGLBLENDFUNCPROC glad_glBlendFunc;
1804 #define glBlendFunc glad_glBlendFunc
1805 GLAD_API_CALL PFNGLBLENDFUNCSEPARATEPROC glad_glBlendFuncSeparate;
1806 #define glBlendFuncSeparate glad_glBlendFuncSeparate
1807 GLAD_API_CALL PFNGLBLITFRAMEBUFFERPROC glad_glBlitFramebuffer;
1808 #define glBlitFramebuffer glad_glBlitFramebuffer
1809 GLAD_API_CALL PFNGLBUFFERDATAPROC glad_glBufferData;
1810 #define glBufferData glad_glBufferData
1811 GLAD_API_CALL PFNGLBUFFERSUBDATAPROC glad_glBufferSubData;
1812 #define glBufferSubData glad_glBufferSubData
1813 GLAD_API_CALL PFNGLCHECKFRAMEBUFFERSTATUSPROC glad_glCheckFramebufferStatus;
1814 #define glCheckFramebufferStatus glad_glCheckFramebufferStatus
1815 GLAD_API_CALL PFNGLCLAMPCOLORPROC glad_glClampColor;
1816 #define glClampColor glad_glClampColor
1817 GLAD_API_CALL PFNGLCLEARPROC glad_glClear;
1818 #define glClear glad_glClear
1819 GLAD_API_CALL PFNGLCLEARBUFFERFIPROC glad_glClearBufferfi;
1820 #define glClearBufferfi glad_glClearBufferfi
1821 GLAD_API_CALL PFNGLCLEARBUFFERFVPROC glad_glClearBufferfv;
1822 #define glClearBufferfv glad_glClearBufferfv
1823 GLAD_API_CALL PFNGLCLEARBUFFERIVPROC glad_glClearBufferiv;
1824 #define glClearBufferiv glad_glClearBufferiv
1825 GLAD_API_CALL PFNGLCLEARBUFFERUIVPROC glad_glClearBufferuiv;
1826 #define glClearBufferuiv glad_glClearBufferuiv
1827 GLAD_API_CALL PFNGLCLEARCOLORPROC glad_glClearColor;
1828 #define glClearColor glad_glClearColor
1829 GLAD_API_CALL PFNGLCLEARDEPTHPROC glad_glClearDepth;
1830 #define glClearDepth glad_glClearDepth
1831 GLAD_API_CALL PFNGLCLEARSTENCILPROC glad_glClearStencil;
1832 #define glClearStencil glad_glClearStencil
1833 GLAD_API_CALL PFNGLCLIENTWAITSYNCPROC glad_glClientWaitSync;
1834 #define glClientWaitSync glad_glClientWaitSync
1835 GLAD_API_CALL PFNGLCOLORMASKPROC glad_glColorMask;
1836 #define glColorMask glad_glColorMask
1837 GLAD_API_CALL PFNGLCOLORMASKIPROC glad_glColorMaski;
1838 #define glColorMaski glad_glColorMaski
1839 GLAD_API_CALL PFNGLCOMPILESHADERPROC glad_glCompileShader;
1840 #define glCompileShader glad_glCompileShader
1841 GLAD_API_CALL PFNGLCOMPRESSEDTEXIMAGE1DPROC glad_glCompressedTexImage1D;
1842 #define glCompressedTexImage1D glad_glCompressedTexImage1D
1843 GLAD_API_CALL PFNGLCOMPRESSEDTEXIMAGE2DPROC glad_glCompressedTexImage2D;
1844 #define glCompressedTexImage2D glad_glCompressedTexImage2D
1845 GLAD_API_CALL PFNGLCOMPRESSEDTEXIMAGE3DPROC glad_glCompressedTexImage3D;
1846 #define glCompressedTexImage3D glad_glCompressedTexImage3D
1847 GLAD_API_CALL PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC glad_glCompressedTexSubImage1D;
1848 #define glCompressedTexSubImage1D glad_glCompressedTexSubImage1D
1849 GLAD_API_CALL PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glad_glCompressedTexSubImage2D;
1850 #define glCompressedTexSubImage2D glad_glCompressedTexSubImage2D
1851 GLAD_API_CALL PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glad_glCompressedTexSubImage3D;
1852 #define glCompressedTexSubImage3D glad_glCompressedTexSubImage3D
1853 GLAD_API_CALL PFNGLCOPYBUFFERSUBDATAPROC glad_glCopyBufferSubData;
1854 #define glCopyBufferSubData glad_glCopyBufferSubData
1855 GLAD_API_CALL PFNGLCOPYTEXIMAGE1DPROC glad_glCopyTexImage1D;
1856 #define glCopyTexImage1D glad_glCopyTexImage1D
1857 GLAD_API_CALL PFNGLCOPYTEXIMAGE2DPROC glad_glCopyTexImage2D;
1858 #define glCopyTexImage2D glad_glCopyTexImage2D
1859 GLAD_API_CALL PFNGLCOPYTEXSUBIMAGE1DPROC glad_glCopyTexSubImage1D;
1860 #define glCopyTexSubImage1D glad_glCopyTexSubImage1D
1861 GLAD_API_CALL PFNGLCOPYTEXSUBIMAGE2DPROC glad_glCopyTexSubImage2D;
1862 #define glCopyTexSubImage2D glad_glCopyTexSubImage2D
1863 GLAD_API_CALL PFNGLCOPYTEXSUBIMAGE3DPROC glad_glCopyTexSubImage3D;
1864 #define glCopyTexSubImage3D glad_glCopyTexSubImage3D
1865 GLAD_API_CALL PFNGLCREATEPROGRAMPROC glad_glCreateProgram;
1866 #define glCreateProgram glad_glCreateProgram
1867 GLAD_API_CALL PFNGLCREATESHADERPROC glad_glCreateShader;
1868 #define glCreateShader glad_glCreateShader
1869 GLAD_API_CALL PFNGLCULLFACEPROC glad_glCullFace;
1870 #define glCullFace glad_glCullFace
1871 GLAD_API_CALL PFNGLDELETEBUFFERSPROC glad_glDeleteBuffers;
1872 #define glDeleteBuffers glad_glDeleteBuffers
1873 GLAD_API_CALL PFNGLDELETEFRAMEBUFFERSPROC glad_glDeleteFramebuffers;
1874 #define glDeleteFramebuffers glad_glDeleteFramebuffers
1875 GLAD_API_CALL PFNGLDELETEPROGRAMPROC glad_glDeleteProgram;
1876 #define glDeleteProgram glad_glDeleteProgram
1877 GLAD_API_CALL PFNGLDELETEQUERIESPROC glad_glDeleteQueries;
1878 #define glDeleteQueries glad_glDeleteQueries
1879 GLAD_API_CALL PFNGLDELETERENDERBUFFERSPROC glad_glDeleteRenderbuffers;
1880 #define glDeleteRenderbuffers glad_glDeleteRenderbuffers
1881 GLAD_API_CALL PFNGLDELETESAMPLERSPROC glad_glDeleteSamplers;
1882 #define glDeleteSamplers glad_glDeleteSamplers
1883 GLAD_API_CALL PFNGLDELETESHADERPROC glad_glDeleteShader;
1884 #define glDeleteShader glad_glDeleteShader
1885 GLAD_API_CALL PFNGLDELETESYNCPROC glad_glDeleteSync;
1886 #define glDeleteSync glad_glDeleteSync
1887 GLAD_API_CALL PFNGLDELETETEXTURESPROC glad_glDeleteTextures;
1888 #define glDeleteTextures glad_glDeleteTextures
1889 GLAD_API_CALL PFNGLDELETEVERTEXARRAYSPROC glad_glDeleteVertexArrays;
1890 #define glDeleteVertexArrays glad_glDeleteVertexArrays
1891 GLAD_API_CALL PFNGLDEPTHFUNCPROC glad_glDepthFunc;
1892 #define glDepthFunc glad_glDepthFunc
1893 GLAD_API_CALL PFNGLDEPTHMASKPROC glad_glDepthMask;
1894 #define glDepthMask glad_glDepthMask
1895 GLAD_API_CALL PFNGLDEPTHRANGEPROC glad_glDepthRange;
1896 #define glDepthRange glad_glDepthRange
1897 GLAD_API_CALL PFNGLDETACHSHADERPROC glad_glDetachShader;
1898 #define glDetachShader glad_glDetachShader
1899 GLAD_API_CALL PFNGLDISABLEPROC glad_glDisable;
1900 #define glDisable glad_glDisable
1901 GLAD_API_CALL PFNGLDISABLEVERTEXATTRIBARRAYPROC glad_glDisableVertexAttribArray;
1902 #define glDisableVertexAttribArray glad_glDisableVertexAttribArray
1903 GLAD_API_CALL PFNGLDISABLEIPROC glad_glDisablei;
1904 #define glDisablei glad_glDisablei
1905 GLAD_API_CALL PFNGLDRAWARRAYSPROC glad_glDrawArrays;
1906 #define glDrawArrays glad_glDrawArrays
1907 GLAD_API_CALL PFNGLDRAWARRAYSINSTANCEDPROC glad_glDrawArraysInstanced;
1908 #define glDrawArraysInstanced glad_glDrawArraysInstanced
1909 GLAD_API_CALL PFNGLDRAWBUFFERPROC glad_glDrawBuffer;
1910 #define glDrawBuffer glad_glDrawBuffer
1911 GLAD_API_CALL PFNGLDRAWBUFFERSPROC glad_glDrawBuffers;
1912 #define glDrawBuffers glad_glDrawBuffers
1913 GLAD_API_CALL PFNGLDRAWELEMENTSPROC glad_glDrawElements;
1914 #define glDrawElements glad_glDrawElements
1915 GLAD_API_CALL PFNGLDRAWELEMENTSBASEVERTEXPROC glad_glDrawElementsBaseVertex;
1916 #define glDrawElementsBaseVertex glad_glDrawElementsBaseVertex
1917 GLAD_API_CALL PFNGLDRAWELEMENTSINSTANCEDPROC glad_glDrawElementsInstanced;
1918 #define glDrawElementsInstanced glad_glDrawElementsInstanced
1919 GLAD_API_CALL PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC glad_glDrawElementsInstancedBaseVertex;
1920 #define glDrawElementsInstancedBaseVertex glad_glDrawElementsInstancedBaseVertex
1921 GLAD_API_CALL PFNGLDRAWRANGEELEMENTSPROC glad_glDrawRangeElements;
1922 #define glDrawRangeElements glad_glDrawRangeElements
1923 GLAD_API_CALL PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC glad_glDrawRangeElementsBaseVertex;
1924 #define glDrawRangeElementsBaseVertex glad_glDrawRangeElementsBaseVertex
1925 GLAD_API_CALL PFNGLENABLEPROC glad_glEnable;
1926 #define glEnable glad_glEnable
1927 GLAD_API_CALL PFNGLENABLEVERTEXATTRIBARRAYPROC glad_glEnableVertexAttribArray;
1928 #define glEnableVertexAttribArray glad_glEnableVertexAttribArray
1929 GLAD_API_CALL PFNGLENABLEIPROC glad_glEnablei;
1930 #define glEnablei glad_glEnablei
1931 GLAD_API_CALL PFNGLENDCONDITIONALRENDERPROC glad_glEndConditionalRender;
1932 #define glEndConditionalRender glad_glEndConditionalRender
1933 GLAD_API_CALL PFNGLENDQUERYPROC glad_glEndQuery;
1934 #define glEndQuery glad_glEndQuery
1935 GLAD_API_CALL PFNGLENDTRANSFORMFEEDBACKPROC glad_glEndTransformFeedback;
1936 #define glEndTransformFeedback glad_glEndTransformFeedback
1937 GLAD_API_CALL PFNGLFENCESYNCPROC glad_glFenceSync;
1938 #define glFenceSync glad_glFenceSync
1939 GLAD_API_CALL PFNGLFINISHPROC glad_glFinish;
1940 #define glFinish glad_glFinish
1941 GLAD_API_CALL PFNGLFLUSHPROC glad_glFlush;
1942 #define glFlush glad_glFlush
1943 GLAD_API_CALL PFNGLFLUSHMAPPEDBUFFERRANGEPROC glad_glFlushMappedBufferRange;
1944 #define glFlushMappedBufferRange glad_glFlushMappedBufferRange
1945 GLAD_API_CALL PFNGLFRAMEBUFFERRENDERBUFFERPROC glad_glFramebufferRenderbuffer;
1946 #define glFramebufferRenderbuffer glad_glFramebufferRenderbuffer
1947 GLAD_API_CALL PFNGLFRAMEBUFFERTEXTUREPROC glad_glFramebufferTexture;
1948 #define glFramebufferTexture glad_glFramebufferTexture
1949 GLAD_API_CALL PFNGLFRAMEBUFFERTEXTURE1DPROC glad_glFramebufferTexture1D;
1950 #define glFramebufferTexture1D glad_glFramebufferTexture1D
1951 GLAD_API_CALL PFNGLFRAMEBUFFERTEXTURE2DPROC glad_glFramebufferTexture2D;
1952 #define glFramebufferTexture2D glad_glFramebufferTexture2D
1953 GLAD_API_CALL PFNGLFRAMEBUFFERTEXTURE3DPROC glad_glFramebufferTexture3D;
1954 #define glFramebufferTexture3D glad_glFramebufferTexture3D
1955 GLAD_API_CALL PFNGLFRAMEBUFFERTEXTURELAYERPROC glad_glFramebufferTextureLayer;
1956 #define glFramebufferTextureLayer glad_glFramebufferTextureLayer
1957 GLAD_API_CALL PFNGLFRONTFACEPROC glad_glFrontFace;
1958 #define glFrontFace glad_glFrontFace
1959 GLAD_API_CALL PFNGLGENBUFFERSPROC glad_glGenBuffers;
1960 #define glGenBuffers glad_glGenBuffers
1961 GLAD_API_CALL PFNGLGENFRAMEBUFFERSPROC glad_glGenFramebuffers;
1962 #define glGenFramebuffers glad_glGenFramebuffers
1963 GLAD_API_CALL PFNGLGENQUERIESPROC glad_glGenQueries;
1964 #define glGenQueries glad_glGenQueries
1965 GLAD_API_CALL PFNGLGENRENDERBUFFERSPROC glad_glGenRenderbuffers;
1966 #define glGenRenderbuffers glad_glGenRenderbuffers
1967 GLAD_API_CALL PFNGLGENSAMPLERSPROC glad_glGenSamplers;
1968 #define glGenSamplers glad_glGenSamplers
1969 GLAD_API_CALL PFNGLGENTEXTURESPROC glad_glGenTextures;
1970 #define glGenTextures glad_glGenTextures
1971 GLAD_API_CALL PFNGLGENVERTEXARRAYSPROC glad_glGenVertexArrays;
1972 #define glGenVertexArrays glad_glGenVertexArrays
1973 GLAD_API_CALL PFNGLGENERATEMIPMAPPROC glad_glGenerateMipmap;
1974 #define glGenerateMipmap glad_glGenerateMipmap
1975 GLAD_API_CALL PFNGLGETACTIVEATTRIBPROC glad_glGetActiveAttrib;
1976 #define glGetActiveAttrib glad_glGetActiveAttrib
1977 GLAD_API_CALL PFNGLGETACTIVEUNIFORMPROC glad_glGetActiveUniform;
1978 #define glGetActiveUniform glad_glGetActiveUniform
1979 GLAD_API_CALL PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC glad_glGetActiveUniformBlockName;
1980 #define glGetActiveUniformBlockName glad_glGetActiveUniformBlockName
1981 GLAD_API_CALL PFNGLGETACTIVEUNIFORMBLOCKIVPROC glad_glGetActiveUniformBlockiv;
1982 #define glGetActiveUniformBlockiv glad_glGetActiveUniformBlockiv
1983 GLAD_API_CALL PFNGLGETACTIVEUNIFORMNAMEPROC glad_glGetActiveUniformName;
1984 #define glGetActiveUniformName glad_glGetActiveUniformName
1985 GLAD_API_CALL PFNGLGETACTIVEUNIFORMSIVPROC glad_glGetActiveUniformsiv;
1986 #define glGetActiveUniformsiv glad_glGetActiveUniformsiv
1987 GLAD_API_CALL PFNGLGETATTACHEDSHADERSPROC glad_glGetAttachedShaders;
1988 #define glGetAttachedShaders glad_glGetAttachedShaders
1989 GLAD_API_CALL PFNGLGETATTRIBLOCATIONPROC glad_glGetAttribLocation;
1990 #define glGetAttribLocation glad_glGetAttribLocation
1991 GLAD_API_CALL PFNGLGETBOOLEANI_VPROC glad_glGetBooleani_v;
1992 #define glGetBooleani_v glad_glGetBooleani_v
1993 GLAD_API_CALL PFNGLGETBOOLEANVPROC glad_glGetBooleanv;
1994 #define glGetBooleanv glad_glGetBooleanv
1995 GLAD_API_CALL PFNGLGETBUFFERPARAMETERI64VPROC glad_glGetBufferParameteri64v;
1996 #define glGetBufferParameteri64v glad_glGetBufferParameteri64v
1997 GLAD_API_CALL PFNGLGETBUFFERPARAMETERIVPROC glad_glGetBufferParameteriv;
1998 #define glGetBufferParameteriv glad_glGetBufferParameteriv
1999 GLAD_API_CALL PFNGLGETBUFFERPOINTERVPROC glad_glGetBufferPointerv;
2000 #define glGetBufferPointerv glad_glGetBufferPointerv
2001 GLAD_API_CALL PFNGLGETBUFFERSUBDATAPROC glad_glGetBufferSubData;
2002 #define glGetBufferSubData glad_glGetBufferSubData
2003 GLAD_API_CALL PFNGLGETCOMPRESSEDTEXIMAGEPROC glad_glGetCompressedTexImage;
2004 #define glGetCompressedTexImage glad_glGetCompressedTexImage
2005 GLAD_API_CALL PFNGLGETDOUBLEVPROC glad_glGetDoublev;
2006 #define glGetDoublev glad_glGetDoublev
2007 GLAD_API_CALL PFNGLGETERRORPROC glad_glGetError;
2008 #define glGetError glad_glGetError
2009 GLAD_API_CALL PFNGLGETFLOATVPROC glad_glGetFloatv;
2010 #define glGetFloatv glad_glGetFloatv
2011 GLAD_API_CALL PFNGLGETFRAGDATAINDEXPROC glad_glGetFragDataIndex;
2012 #define glGetFragDataIndex glad_glGetFragDataIndex
2013 GLAD_API_CALL PFNGLGETFRAGDATALOCATIONPROC glad_glGetFragDataLocation;
2014 #define glGetFragDataLocation glad_glGetFragDataLocation
2015 GLAD_API_CALL PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetFramebufferAttachmentParameteriv;
2016 #define glGetFramebufferAttachmentParameteriv glad_glGetFramebufferAttachmentParameteriv
2017 GLAD_API_CALL PFNGLGETINTEGER64I_VPROC glad_glGetInteger64i_v;
2018 #define glGetInteger64i_v glad_glGetInteger64i_v
2019 GLAD_API_CALL PFNGLGETINTEGER64VPROC glad_glGetInteger64v;
2020 #define glGetInteger64v glad_glGetInteger64v
2021 GLAD_API_CALL PFNGLGETINTEGERI_VPROC glad_glGetIntegeri_v;
2022 #define glGetIntegeri_v glad_glGetIntegeri_v
2023 GLAD_API_CALL PFNGLGETINTEGERVPROC glad_glGetIntegerv;
2024 #define glGetIntegerv glad_glGetIntegerv
2025 GLAD_API_CALL PFNGLGETMULTISAMPLEFVPROC glad_glGetMultisamplefv;
2026 #define glGetMultisamplefv glad_glGetMultisamplefv
2027 GLAD_API_CALL PFNGLGETPROGRAMINFOLOGPROC glad_glGetProgramInfoLog;
2028 #define glGetProgramInfoLog glad_glGetProgramInfoLog
2029 GLAD_API_CALL PFNGLGETPROGRAMIVPROC glad_glGetProgramiv;
2030 #define glGetProgramiv glad_glGetProgramiv
2031 GLAD_API_CALL PFNGLGETQUERYOBJECTI64VPROC glad_glGetQueryObjecti64v;
2032 #define glGetQueryObjecti64v glad_glGetQueryObjecti64v
2033 GLAD_API_CALL PFNGLGETQUERYOBJECTIVPROC glad_glGetQueryObjectiv;
2034 #define glGetQueryObjectiv glad_glGetQueryObjectiv
2035 GLAD_API_CALL PFNGLGETQUERYOBJECTUI64VPROC glad_glGetQueryObjectui64v;
2036 #define glGetQueryObjectui64v glad_glGetQueryObjectui64v
2037 GLAD_API_CALL PFNGLGETQUERYOBJECTUIVPROC glad_glGetQueryObjectuiv;
2038 #define glGetQueryObjectuiv glad_glGetQueryObjectuiv
2039 GLAD_API_CALL PFNGLGETQUERYIVPROC glad_glGetQueryiv;
2040 #define glGetQueryiv glad_glGetQueryiv
2041 GLAD_API_CALL PFNGLGETRENDERBUFFERPARAMETERIVPROC glad_glGetRenderbufferParameteriv;
2042 #define glGetRenderbufferParameteriv glad_glGetRenderbufferParameteriv
2043 GLAD_API_CALL PFNGLGETSAMPLERPARAMETERIIVPROC glad_glGetSamplerParameterIiv;
2044 #define glGetSamplerParameterIiv glad_glGetSamplerParameterIiv
2045 GLAD_API_CALL PFNGLGETSAMPLERPARAMETERIUIVPROC glad_glGetSamplerParameterIuiv;
2046 #define glGetSamplerParameterIuiv glad_glGetSamplerParameterIuiv
2047 GLAD_API_CALL PFNGLGETSAMPLERPARAMETERFVPROC glad_glGetSamplerParameterfv;
2048 #define glGetSamplerParameterfv glad_glGetSamplerParameterfv
2049 GLAD_API_CALL PFNGLGETSAMPLERPARAMETERIVPROC glad_glGetSamplerParameteriv;
2050 #define glGetSamplerParameteriv glad_glGetSamplerParameteriv
2051 GLAD_API_CALL PFNGLGETSHADERINFOLOGPROC glad_glGetShaderInfoLog;
2052 #define glGetShaderInfoLog glad_glGetShaderInfoLog
2053 GLAD_API_CALL PFNGLGETSHADERSOURCEPROC glad_glGetShaderSource;
2054 #define glGetShaderSource glad_glGetShaderSource
2055 GLAD_API_CALL PFNGLGETSHADERIVPROC glad_glGetShaderiv;
2056 #define glGetShaderiv glad_glGetShaderiv
2057 GLAD_API_CALL PFNGLGETSTRINGPROC glad_glGetString;
2058 #define glGetString glad_glGetString
2059 GLAD_API_CALL PFNGLGETSTRINGIPROC glad_glGetStringi;
2060 #define glGetStringi glad_glGetStringi
2061 GLAD_API_CALL PFNGLGETSYNCIVPROC glad_glGetSynciv;
2062 #define glGetSynciv glad_glGetSynciv
2063 GLAD_API_CALL PFNGLGETTEXIMAGEPROC glad_glGetTexImage;
2064 #define glGetTexImage glad_glGetTexImage
2065 GLAD_API_CALL PFNGLGETTEXLEVELPARAMETERFVPROC glad_glGetTexLevelParameterfv;
2066 #define glGetTexLevelParameterfv glad_glGetTexLevelParameterfv
2067 GLAD_API_CALL PFNGLGETTEXLEVELPARAMETERIVPROC glad_glGetTexLevelParameteriv;
2068 #define glGetTexLevelParameteriv glad_glGetTexLevelParameteriv
2069 GLAD_API_CALL PFNGLGETTEXPARAMETERIIVPROC glad_glGetTexParameterIiv;
2070 #define glGetTexParameterIiv glad_glGetTexParameterIiv
2071 GLAD_API_CALL PFNGLGETTEXPARAMETERIUIVPROC glad_glGetTexParameterIuiv;
2072 #define glGetTexParameterIuiv glad_glGetTexParameterIuiv
2073 GLAD_API_CALL PFNGLGETTEXPARAMETERFVPROC glad_glGetTexParameterfv;
2074 #define glGetTexParameterfv glad_glGetTexParameterfv
2075 GLAD_API_CALL PFNGLGETTEXPARAMETERIVPROC glad_glGetTexParameteriv;
2076 #define glGetTexParameteriv glad_glGetTexParameteriv
2077 GLAD_API_CALL PFNGLGETTRANSFORMFEEDBACKVARYINGPROC glad_glGetTransformFeedbackVarying;
2078 #define glGetTransformFeedbackVarying glad_glGetTransformFeedbackVarying
2079 GLAD_API_CALL PFNGLGETUNIFORMBLOCKINDEXPROC glad_glGetUniformBlockIndex;
2080 #define glGetUniformBlockIndex glad_glGetUniformBlockIndex
2081 GLAD_API_CALL PFNGLGETUNIFORMINDICESPROC glad_glGetUniformIndices;
2082 #define glGetUniformIndices glad_glGetUniformIndices
2083 GLAD_API_CALL PFNGLGETUNIFORMLOCATIONPROC glad_glGetUniformLocation;
2084 #define glGetUniformLocation glad_glGetUniformLocation
2085 GLAD_API_CALL PFNGLGETUNIFORMFVPROC glad_glGetUniformfv;
2086 #define glGetUniformfv glad_glGetUniformfv
2087 GLAD_API_CALL PFNGLGETUNIFORMIVPROC glad_glGetUniformiv;
2088 #define glGetUniformiv glad_glGetUniformiv
2089 GLAD_API_CALL PFNGLGETUNIFORMUIVPROC glad_glGetUniformuiv;
2090 #define glGetUniformuiv glad_glGetUniformuiv
2091 GLAD_API_CALL PFNGLGETVERTEXATTRIBIIVPROC glad_glGetVertexAttribIiv;
2092 #define glGetVertexAttribIiv glad_glGetVertexAttribIiv
2093 GLAD_API_CALL PFNGLGETVERTEXATTRIBIUIVPROC glad_glGetVertexAttribIuiv;
2094 #define glGetVertexAttribIuiv glad_glGetVertexAttribIuiv
2095 GLAD_API_CALL PFNGLGETVERTEXATTRIBPOINTERVPROC glad_glGetVertexAttribPointerv;
2096 #define glGetVertexAttribPointerv glad_glGetVertexAttribPointerv
2097 GLAD_API_CALL PFNGLGETVERTEXATTRIBDVPROC glad_glGetVertexAttribdv;
2098 #define glGetVertexAttribdv glad_glGetVertexAttribdv
2099 GLAD_API_CALL PFNGLGETVERTEXATTRIBFVPROC glad_glGetVertexAttribfv;
2100 #define glGetVertexAttribfv glad_glGetVertexAttribfv
2101 GLAD_API_CALL PFNGLGETVERTEXATTRIBIVPROC glad_glGetVertexAttribiv;
2102 #define glGetVertexAttribiv glad_glGetVertexAttribiv
2103 GLAD_API_CALL PFNGLHINTPROC glad_glHint;
2104 #define glHint glad_glHint
2105 GLAD_API_CALL PFNGLISBUFFERPROC glad_glIsBuffer;
2106 #define glIsBuffer glad_glIsBuffer
2107 GLAD_API_CALL PFNGLISENABLEDPROC glad_glIsEnabled;
2108 #define glIsEnabled glad_glIsEnabled
2109 GLAD_API_CALL PFNGLISENABLEDIPROC glad_glIsEnabledi;
2110 #define glIsEnabledi glad_glIsEnabledi
2111 GLAD_API_CALL PFNGLISFRAMEBUFFERPROC glad_glIsFramebuffer;
2112 #define glIsFramebuffer glad_glIsFramebuffer
2113 GLAD_API_CALL PFNGLISPROGRAMPROC glad_glIsProgram;
2114 #define glIsProgram glad_glIsProgram
2115 GLAD_API_CALL PFNGLISQUERYPROC glad_glIsQuery;
2116 #define glIsQuery glad_glIsQuery
2117 GLAD_API_CALL PFNGLISRENDERBUFFERPROC glad_glIsRenderbuffer;
2118 #define glIsRenderbuffer glad_glIsRenderbuffer
2119 GLAD_API_CALL PFNGLISSAMPLERPROC glad_glIsSampler;
2120 #define glIsSampler glad_glIsSampler
2121 GLAD_API_CALL PFNGLISSHADERPROC glad_glIsShader;
2122 #define glIsShader glad_glIsShader
2123 GLAD_API_CALL PFNGLISSYNCPROC glad_glIsSync;
2124 #define glIsSync glad_glIsSync
2125 GLAD_API_CALL PFNGLISTEXTUREPROC glad_glIsTexture;
2126 #define glIsTexture glad_glIsTexture
2127 GLAD_API_CALL PFNGLISVERTEXARRAYPROC glad_glIsVertexArray;
2128 #define glIsVertexArray glad_glIsVertexArray
2129 GLAD_API_CALL PFNGLLINEWIDTHPROC glad_glLineWidth;
2130 #define glLineWidth glad_glLineWidth
2131 GLAD_API_CALL PFNGLLINKPROGRAMPROC glad_glLinkProgram;
2132 #define glLinkProgram glad_glLinkProgram
2133 GLAD_API_CALL PFNGLLOGICOPPROC glad_glLogicOp;
2134 #define glLogicOp glad_glLogicOp
2135 GLAD_API_CALL PFNGLMAPBUFFERPROC glad_glMapBuffer;
2136 #define glMapBuffer glad_glMapBuffer
2137 GLAD_API_CALL PFNGLMAPBUFFERRANGEPROC glad_glMapBufferRange;
2138 #define glMapBufferRange glad_glMapBufferRange
2139 GLAD_API_CALL PFNGLMULTIDRAWARRAYSPROC glad_glMultiDrawArrays;
2140 #define glMultiDrawArrays glad_glMultiDrawArrays
2141 GLAD_API_CALL PFNGLMULTIDRAWELEMENTSPROC glad_glMultiDrawElements;
2142 #define glMultiDrawElements glad_glMultiDrawElements
2143 GLAD_API_CALL PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC glad_glMultiDrawElementsBaseVertex;
2144 #define glMultiDrawElementsBaseVertex glad_glMultiDrawElementsBaseVertex
2145 GLAD_API_CALL PFNGLPIXELSTOREFPROC glad_glPixelStoref;
2146 #define glPixelStoref glad_glPixelStoref
2147 GLAD_API_CALL PFNGLPIXELSTOREIPROC glad_glPixelStorei;
2148 #define glPixelStorei glad_glPixelStorei
2149 GLAD_API_CALL PFNGLPOINTPARAMETERFPROC glad_glPointParameterf;
2150 #define glPointParameterf glad_glPointParameterf
2151 GLAD_API_CALL PFNGLPOINTPARAMETERFVPROC glad_glPointParameterfv;
2152 #define glPointParameterfv glad_glPointParameterfv
2153 GLAD_API_CALL PFNGLPOINTPARAMETERIPROC glad_glPointParameteri;
2154 #define glPointParameteri glad_glPointParameteri
2155 GLAD_API_CALL PFNGLPOINTPARAMETERIVPROC glad_glPointParameteriv;
2156 #define glPointParameteriv glad_glPointParameteriv
2157 GLAD_API_CALL PFNGLPOINTSIZEPROC glad_glPointSize;
2158 #define glPointSize glad_glPointSize
2159 GLAD_API_CALL PFNGLPOLYGONMODEPROC glad_glPolygonMode;
2160 #define glPolygonMode glad_glPolygonMode
2161 GLAD_API_CALL PFNGLPOLYGONOFFSETPROC glad_glPolygonOffset;
2162 #define glPolygonOffset glad_glPolygonOffset
2163 GLAD_API_CALL PFNGLPRIMITIVERESTARTINDEXPROC glad_glPrimitiveRestartIndex;
2164 #define glPrimitiveRestartIndex glad_glPrimitiveRestartIndex
2165 GLAD_API_CALL PFNGLPROVOKINGVERTEXPROC glad_glProvokingVertex;
2166 #define glProvokingVertex glad_glProvokingVertex
2167 GLAD_API_CALL PFNGLQUERYCOUNTERPROC glad_glQueryCounter;
2168 #define glQueryCounter glad_glQueryCounter
2169 GLAD_API_CALL PFNGLREADBUFFERPROC glad_glReadBuffer;
2170 #define glReadBuffer glad_glReadBuffer
2171 GLAD_API_CALL PFNGLREADPIXELSPROC glad_glReadPixels;
2172 #define glReadPixels glad_glReadPixels
2173 GLAD_API_CALL PFNGLRENDERBUFFERSTORAGEPROC glad_glRenderbufferStorage;
2174 #define glRenderbufferStorage glad_glRenderbufferStorage
2175 GLAD_API_CALL PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC glad_glRenderbufferStorageMultisample;
2176 #define glRenderbufferStorageMultisample glad_glRenderbufferStorageMultisample
2177 GLAD_API_CALL PFNGLSAMPLECOVERAGEPROC glad_glSampleCoverage;
2178 #define glSampleCoverage glad_glSampleCoverage
2179 GLAD_API_CALL PFNGLSAMPLEMASKIPROC glad_glSampleMaski;
2180 #define glSampleMaski glad_glSampleMaski
2181 GLAD_API_CALL PFNGLSAMPLERPARAMETERIIVPROC glad_glSamplerParameterIiv;
2182 #define glSamplerParameterIiv glad_glSamplerParameterIiv
2183 GLAD_API_CALL PFNGLSAMPLERPARAMETERIUIVPROC glad_glSamplerParameterIuiv;
2184 #define glSamplerParameterIuiv glad_glSamplerParameterIuiv
2185 GLAD_API_CALL PFNGLSAMPLERPARAMETERFPROC glad_glSamplerParameterf;
2186 #define glSamplerParameterf glad_glSamplerParameterf
2187 GLAD_API_CALL PFNGLSAMPLERPARAMETERFVPROC glad_glSamplerParameterfv;
2188 #define glSamplerParameterfv glad_glSamplerParameterfv
2189 GLAD_API_CALL PFNGLSAMPLERPARAMETERIPROC glad_glSamplerParameteri;
2190 #define glSamplerParameteri glad_glSamplerParameteri
2191 GLAD_API_CALL PFNGLSAMPLERPARAMETERIVPROC glad_glSamplerParameteriv;
2192 #define glSamplerParameteriv glad_glSamplerParameteriv
2193 GLAD_API_CALL PFNGLSCISSORPROC glad_glScissor;
2194 #define glScissor glad_glScissor
2195 GLAD_API_CALL PFNGLSHADERSOURCEPROC glad_glShaderSource;
2196 #define glShaderSource glad_glShaderSource
2197 GLAD_API_CALL PFNGLSTENCILFUNCPROC glad_glStencilFunc;
2198 #define glStencilFunc glad_glStencilFunc
2199 GLAD_API_CALL PFNGLSTENCILFUNCSEPARATEPROC glad_glStencilFuncSeparate;
2200 #define glStencilFuncSeparate glad_glStencilFuncSeparate
2201 GLAD_API_CALL PFNGLSTENCILMASKPROC glad_glStencilMask;
2202 #define glStencilMask glad_glStencilMask
2203 GLAD_API_CALL PFNGLSTENCILMASKSEPARATEPROC glad_glStencilMaskSeparate;
2204 #define glStencilMaskSeparate glad_glStencilMaskSeparate
2205 GLAD_API_CALL PFNGLSTENCILOPPROC glad_glStencilOp;
2206 #define glStencilOp glad_glStencilOp
2207 GLAD_API_CALL PFNGLSTENCILOPSEPARATEPROC glad_glStencilOpSeparate;
2208 #define glStencilOpSeparate glad_glStencilOpSeparate
2209 GLAD_API_CALL PFNGLTEXBUFFERPROC glad_glTexBuffer;
2210 #define glTexBuffer glad_glTexBuffer
2211 GLAD_API_CALL PFNGLTEXIMAGE1DPROC glad_glTexImage1D;
2212 #define glTexImage1D glad_glTexImage1D
2213 GLAD_API_CALL PFNGLTEXIMAGE2DPROC glad_glTexImage2D;
2214 #define glTexImage2D glad_glTexImage2D
2215 GLAD_API_CALL PFNGLTEXIMAGE2DMULTISAMPLEPROC glad_glTexImage2DMultisample;
2216 #define glTexImage2DMultisample glad_glTexImage2DMultisample
2217 GLAD_API_CALL PFNGLTEXIMAGE3DPROC glad_glTexImage3D;
2218 #define glTexImage3D glad_glTexImage3D
2219 GLAD_API_CALL PFNGLTEXIMAGE3DMULTISAMPLEPROC glad_glTexImage3DMultisample;
2220 #define glTexImage3DMultisample glad_glTexImage3DMultisample
2221 GLAD_API_CALL PFNGLTEXPARAMETERIIVPROC glad_glTexParameterIiv;
2222 #define glTexParameterIiv glad_glTexParameterIiv
2223 GLAD_API_CALL PFNGLTEXPARAMETERIUIVPROC glad_glTexParameterIuiv;
2224 #define glTexParameterIuiv glad_glTexParameterIuiv
2225 GLAD_API_CALL PFNGLTEXPARAMETERFPROC glad_glTexParameterf;
2226 #define glTexParameterf glad_glTexParameterf
2227 GLAD_API_CALL PFNGLTEXPARAMETERFVPROC glad_glTexParameterfv;
2228 #define glTexParameterfv glad_glTexParameterfv
2229 GLAD_API_CALL PFNGLTEXPARAMETERIPROC glad_glTexParameteri;
2230 #define glTexParameteri glad_glTexParameteri
2231 GLAD_API_CALL PFNGLTEXPARAMETERIVPROC glad_glTexParameteriv;
2232 #define glTexParameteriv glad_glTexParameteriv
2233 GLAD_API_CALL PFNGLTEXSUBIMAGE1DPROC glad_glTexSubImage1D;
2234 #define glTexSubImage1D glad_glTexSubImage1D
2235 GLAD_API_CALL PFNGLTEXSUBIMAGE2DPROC glad_glTexSubImage2D;
2236 #define glTexSubImage2D glad_glTexSubImage2D
2237 GLAD_API_CALL PFNGLTEXSUBIMAGE3DPROC glad_glTexSubImage3D;
2238 #define glTexSubImage3D glad_glTexSubImage3D
2239 GLAD_API_CALL PFNGLTRANSFORMFEEDBACKVARYINGSPROC glad_glTransformFeedbackVaryings;
2240 #define glTransformFeedbackVaryings glad_glTransformFeedbackVaryings
2241 GLAD_API_CALL PFNGLUNIFORM1FPROC glad_glUniform1f;
2242 #define glUniform1f glad_glUniform1f
2243 GLAD_API_CALL PFNGLUNIFORM1FVPROC glad_glUniform1fv;
2244 #define glUniform1fv glad_glUniform1fv
2245 GLAD_API_CALL PFNGLUNIFORM1IPROC glad_glUniform1i;
2246 #define glUniform1i glad_glUniform1i
2247 GLAD_API_CALL PFNGLUNIFORM1IVPROC glad_glUniform1iv;
2248 #define glUniform1iv glad_glUniform1iv
2249 GLAD_API_CALL PFNGLUNIFORM1UIPROC glad_glUniform1ui;
2250 #define glUniform1ui glad_glUniform1ui
2251 GLAD_API_CALL PFNGLUNIFORM1UIVPROC glad_glUniform1uiv;
2252 #define glUniform1uiv glad_glUniform1uiv
2253 GLAD_API_CALL PFNGLUNIFORM2FPROC glad_glUniform2f;
2254 #define glUniform2f glad_glUniform2f
2255 GLAD_API_CALL PFNGLUNIFORM2FVPROC glad_glUniform2fv;
2256 #define glUniform2fv glad_glUniform2fv
2257 GLAD_API_CALL PFNGLUNIFORM2IPROC glad_glUniform2i;
2258 #define glUniform2i glad_glUniform2i
2259 GLAD_API_CALL PFNGLUNIFORM2IVPROC glad_glUniform2iv;
2260 #define glUniform2iv glad_glUniform2iv
2261 GLAD_API_CALL PFNGLUNIFORM2UIPROC glad_glUniform2ui;
2262 #define glUniform2ui glad_glUniform2ui
2263 GLAD_API_CALL PFNGLUNIFORM2UIVPROC glad_glUniform2uiv;
2264 #define glUniform2uiv glad_glUniform2uiv
2265 GLAD_API_CALL PFNGLUNIFORM3FPROC glad_glUniform3f;
2266 #define glUniform3f glad_glUniform3f
2267 GLAD_API_CALL PFNGLUNIFORM3FVPROC glad_glUniform3fv;
2268 #define glUniform3fv glad_glUniform3fv
2269 GLAD_API_CALL PFNGLUNIFORM3IPROC glad_glUniform3i;
2270 #define glUniform3i glad_glUniform3i
2271 GLAD_API_CALL PFNGLUNIFORM3IVPROC glad_glUniform3iv;
2272 #define glUniform3iv glad_glUniform3iv
2273 GLAD_API_CALL PFNGLUNIFORM3UIPROC glad_glUniform3ui;
2274 #define glUniform3ui glad_glUniform3ui
2275 GLAD_API_CALL PFNGLUNIFORM3UIVPROC glad_glUniform3uiv;
2276 #define glUniform3uiv glad_glUniform3uiv
2277 GLAD_API_CALL PFNGLUNIFORM4FPROC glad_glUniform4f;
2278 #define glUniform4f glad_glUniform4f
2279 GLAD_API_CALL PFNGLUNIFORM4FVPROC glad_glUniform4fv;
2280 #define glUniform4fv glad_glUniform4fv
2281 GLAD_API_CALL PFNGLUNIFORM4IPROC glad_glUniform4i;
2282 #define glUniform4i glad_glUniform4i
2283 GLAD_API_CALL PFNGLUNIFORM4IVPROC glad_glUniform4iv;
2284 #define glUniform4iv glad_glUniform4iv
2285 GLAD_API_CALL PFNGLUNIFORM4UIPROC glad_glUniform4ui;
2286 #define glUniform4ui glad_glUniform4ui
2287 GLAD_API_CALL PFNGLUNIFORM4UIVPROC glad_glUniform4uiv;
2288 #define glUniform4uiv glad_glUniform4uiv
2289 GLAD_API_CALL PFNGLUNIFORMBLOCKBINDINGPROC glad_glUniformBlockBinding;
2290 #define glUniformBlockBinding glad_glUniformBlockBinding
2291 GLAD_API_CALL PFNGLUNIFORMMATRIX2FVPROC glad_glUniformMatrix2fv;
2292 #define glUniformMatrix2fv glad_glUniformMatrix2fv
2293 GLAD_API_CALL PFNGLUNIFORMMATRIX2X3FVPROC glad_glUniformMatrix2x3fv;
2294 #define glUniformMatrix2x3fv glad_glUniformMatrix2x3fv
2295 GLAD_API_CALL PFNGLUNIFORMMATRIX2X4FVPROC glad_glUniformMatrix2x4fv;
2296 #define glUniformMatrix2x4fv glad_glUniformMatrix2x4fv
2297 GLAD_API_CALL PFNGLUNIFORMMATRIX3FVPROC glad_glUniformMatrix3fv;
2298 #define glUniformMatrix3fv glad_glUniformMatrix3fv
2299 GLAD_API_CALL PFNGLUNIFORMMATRIX3X2FVPROC glad_glUniformMatrix3x2fv;
2300 #define glUniformMatrix3x2fv glad_glUniformMatrix3x2fv
2301 GLAD_API_CALL PFNGLUNIFORMMATRIX3X4FVPROC glad_glUniformMatrix3x4fv;
2302 #define glUniformMatrix3x4fv glad_glUniformMatrix3x4fv
2303 GLAD_API_CALL PFNGLUNIFORMMATRIX4FVPROC glad_glUniformMatrix4fv;
2304 #define glUniformMatrix4fv glad_glUniformMatrix4fv
2305 GLAD_API_CALL PFNGLUNIFORMMATRIX4X2FVPROC glad_glUniformMatrix4x2fv;
2306 #define glUniformMatrix4x2fv glad_glUniformMatrix4x2fv
2307 GLAD_API_CALL PFNGLUNIFORMMATRIX4X3FVPROC glad_glUniformMatrix4x3fv;
2308 #define glUniformMatrix4x3fv glad_glUniformMatrix4x3fv
2309 GLAD_API_CALL PFNGLUNMAPBUFFERPROC glad_glUnmapBuffer;
2310 #define glUnmapBuffer glad_glUnmapBuffer
2311 GLAD_API_CALL PFNGLUSEPROGRAMPROC glad_glUseProgram;
2312 #define glUseProgram glad_glUseProgram
2313 GLAD_API_CALL PFNGLVALIDATEPROGRAMPROC glad_glValidateProgram;
2314 #define glValidateProgram glad_glValidateProgram
2315 GLAD_API_CALL PFNGLVERTEXATTRIB1DPROC glad_glVertexAttrib1d;
2316 #define glVertexAttrib1d glad_glVertexAttrib1d
2317 GLAD_API_CALL PFNGLVERTEXATTRIB1DVPROC glad_glVertexAttrib1dv;
2318 #define glVertexAttrib1dv glad_glVertexAttrib1dv
2319 GLAD_API_CALL PFNGLVERTEXATTRIB1FPROC glad_glVertexAttrib1f;
2320 #define glVertexAttrib1f glad_glVertexAttrib1f
2321 GLAD_API_CALL PFNGLVERTEXATTRIB1FVPROC glad_glVertexAttrib1fv;
2322 #define glVertexAttrib1fv glad_glVertexAttrib1fv
2323 GLAD_API_CALL PFNGLVERTEXATTRIB1SPROC glad_glVertexAttrib1s;
2324 #define glVertexAttrib1s glad_glVertexAttrib1s
2325 GLAD_API_CALL PFNGLVERTEXATTRIB1SVPROC glad_glVertexAttrib1sv;
2326 #define glVertexAttrib1sv glad_glVertexAttrib1sv
2327 GLAD_API_CALL PFNGLVERTEXATTRIB2DPROC glad_glVertexAttrib2d;
2328 #define glVertexAttrib2d glad_glVertexAttrib2d
2329 GLAD_API_CALL PFNGLVERTEXATTRIB2DVPROC glad_glVertexAttrib2dv;
2330 #define glVertexAttrib2dv glad_glVertexAttrib2dv
2331 GLAD_API_CALL PFNGLVERTEXATTRIB2FPROC glad_glVertexAttrib2f;
2332 #define glVertexAttrib2f glad_glVertexAttrib2f
2333 GLAD_API_CALL PFNGLVERTEXATTRIB2FVPROC glad_glVertexAttrib2fv;
2334 #define glVertexAttrib2fv glad_glVertexAttrib2fv
2335 GLAD_API_CALL PFNGLVERTEXATTRIB2SPROC glad_glVertexAttrib2s;
2336 #define glVertexAttrib2s glad_glVertexAttrib2s
2337 GLAD_API_CALL PFNGLVERTEXATTRIB2SVPROC glad_glVertexAttrib2sv;
2338 #define glVertexAttrib2sv glad_glVertexAttrib2sv
2339 GLAD_API_CALL PFNGLVERTEXATTRIB3DPROC glad_glVertexAttrib3d;
2340 #define glVertexAttrib3d glad_glVertexAttrib3d
2341 GLAD_API_CALL PFNGLVERTEXATTRIB3DVPROC glad_glVertexAttrib3dv;
2342 #define glVertexAttrib3dv glad_glVertexAttrib3dv
2343 GLAD_API_CALL PFNGLVERTEXATTRIB3FPROC glad_glVertexAttrib3f;
2344 #define glVertexAttrib3f glad_glVertexAttrib3f
2345 GLAD_API_CALL PFNGLVERTEXATTRIB3FVPROC glad_glVertexAttrib3fv;
2346 #define glVertexAttrib3fv glad_glVertexAttrib3fv
2347 GLAD_API_CALL PFNGLVERTEXATTRIB3SPROC glad_glVertexAttrib3s;
2348 #define glVertexAttrib3s glad_glVertexAttrib3s
2349 GLAD_API_CALL PFNGLVERTEXATTRIB3SVPROC glad_glVertexAttrib3sv;
2350 #define glVertexAttrib3sv glad_glVertexAttrib3sv
2351 GLAD_API_CALL PFNGLVERTEXATTRIB4NBVPROC glad_glVertexAttrib4Nbv;
2352 #define glVertexAttrib4Nbv glad_glVertexAttrib4Nbv
2353 GLAD_API_CALL PFNGLVERTEXATTRIB4NIVPROC glad_glVertexAttrib4Niv;
2354 #define glVertexAttrib4Niv glad_glVertexAttrib4Niv
2355 GLAD_API_CALL PFNGLVERTEXATTRIB4NSVPROC glad_glVertexAttrib4Nsv;
2356 #define glVertexAttrib4Nsv glad_glVertexAttrib4Nsv
2357 GLAD_API_CALL PFNGLVERTEXATTRIB4NUBPROC glad_glVertexAttrib4Nub;
2358 #define glVertexAttrib4Nub glad_glVertexAttrib4Nub
2359 GLAD_API_CALL PFNGLVERTEXATTRIB4NUBVPROC glad_glVertexAttrib4Nubv;
2360 #define glVertexAttrib4Nubv glad_glVertexAttrib4Nubv
2361 GLAD_API_CALL PFNGLVERTEXATTRIB4NUIVPROC glad_glVertexAttrib4Nuiv;
2362 #define glVertexAttrib4Nuiv glad_glVertexAttrib4Nuiv
2363 GLAD_API_CALL PFNGLVERTEXATTRIB4NUSVPROC glad_glVertexAttrib4Nusv;
2364 #define glVertexAttrib4Nusv glad_glVertexAttrib4Nusv
2365 GLAD_API_CALL PFNGLVERTEXATTRIB4BVPROC glad_glVertexAttrib4bv;
2366 #define glVertexAttrib4bv glad_glVertexAttrib4bv
2367 GLAD_API_CALL PFNGLVERTEXATTRIB4DPROC glad_glVertexAttrib4d;
2368 #define glVertexAttrib4d glad_glVertexAttrib4d
2369 GLAD_API_CALL PFNGLVERTEXATTRIB4DVPROC glad_glVertexAttrib4dv;
2370 #define glVertexAttrib4dv glad_glVertexAttrib4dv
2371 GLAD_API_CALL PFNGLVERTEXATTRIB4FPROC glad_glVertexAttrib4f;
2372 #define glVertexAttrib4f glad_glVertexAttrib4f
2373 GLAD_API_CALL PFNGLVERTEXATTRIB4FVPROC glad_glVertexAttrib4fv;
2374 #define glVertexAttrib4fv glad_glVertexAttrib4fv
2375 GLAD_API_CALL PFNGLVERTEXATTRIB4IVPROC glad_glVertexAttrib4iv;
2376 #define glVertexAttrib4iv glad_glVertexAttrib4iv
2377 GLAD_API_CALL PFNGLVERTEXATTRIB4SPROC glad_glVertexAttrib4s;
2378 #define glVertexAttrib4s glad_glVertexAttrib4s
2379 GLAD_API_CALL PFNGLVERTEXATTRIB4SVPROC glad_glVertexAttrib4sv;
2380 #define glVertexAttrib4sv glad_glVertexAttrib4sv
2381 GLAD_API_CALL PFNGLVERTEXATTRIB4UBVPROC glad_glVertexAttrib4ubv;
2382 #define glVertexAttrib4ubv glad_glVertexAttrib4ubv
2383 GLAD_API_CALL PFNGLVERTEXATTRIB4UIVPROC glad_glVertexAttrib4uiv;
2384 #define glVertexAttrib4uiv glad_glVertexAttrib4uiv
2385 GLAD_API_CALL PFNGLVERTEXATTRIB4USVPROC glad_glVertexAttrib4usv;
2386 #define glVertexAttrib4usv glad_glVertexAttrib4usv
2387 GLAD_API_CALL PFNGLVERTEXATTRIBDIVISORPROC glad_glVertexAttribDivisor;
2388 #define glVertexAttribDivisor glad_glVertexAttribDivisor
2389 GLAD_API_CALL PFNGLVERTEXATTRIBI1IPROC glad_glVertexAttribI1i;
2390 #define glVertexAttribI1i glad_glVertexAttribI1i
2391 GLAD_API_CALL PFNGLVERTEXATTRIBI1IVPROC glad_glVertexAttribI1iv;
2392 #define glVertexAttribI1iv glad_glVertexAttribI1iv
2393 GLAD_API_CALL PFNGLVERTEXATTRIBI1UIPROC glad_glVertexAttribI1ui;
2394 #define glVertexAttribI1ui glad_glVertexAttribI1ui
2395 GLAD_API_CALL PFNGLVERTEXATTRIBI1UIVPROC glad_glVertexAttribI1uiv;
2396 #define glVertexAttribI1uiv glad_glVertexAttribI1uiv
2397 GLAD_API_CALL PFNGLVERTEXATTRIBI2IPROC glad_glVertexAttribI2i;
2398 #define glVertexAttribI2i glad_glVertexAttribI2i
2399 GLAD_API_CALL PFNGLVERTEXATTRIBI2IVPROC glad_glVertexAttribI2iv;
2400 #define glVertexAttribI2iv glad_glVertexAttribI2iv
2401 GLAD_API_CALL PFNGLVERTEXATTRIBI2UIPROC glad_glVertexAttribI2ui;
2402 #define glVertexAttribI2ui glad_glVertexAttribI2ui
2403 GLAD_API_CALL PFNGLVERTEXATTRIBI2UIVPROC glad_glVertexAttribI2uiv;
2404 #define glVertexAttribI2uiv glad_glVertexAttribI2uiv
2405 GLAD_API_CALL PFNGLVERTEXATTRIBI3IPROC glad_glVertexAttribI3i;
2406 #define glVertexAttribI3i glad_glVertexAttribI3i
2407 GLAD_API_CALL PFNGLVERTEXATTRIBI3IVPROC glad_glVertexAttribI3iv;
2408 #define glVertexAttribI3iv glad_glVertexAttribI3iv
2409 GLAD_API_CALL PFNGLVERTEXATTRIBI3UIPROC glad_glVertexAttribI3ui;
2410 #define glVertexAttribI3ui glad_glVertexAttribI3ui
2411 GLAD_API_CALL PFNGLVERTEXATTRIBI3UIVPROC glad_glVertexAttribI3uiv;
2412 #define glVertexAttribI3uiv glad_glVertexAttribI3uiv
2413 GLAD_API_CALL PFNGLVERTEXATTRIBI4BVPROC glad_glVertexAttribI4bv;
2414 #define glVertexAttribI4bv glad_glVertexAttribI4bv
2415 GLAD_API_CALL PFNGLVERTEXATTRIBI4IPROC glad_glVertexAttribI4i;
2416 #define glVertexAttribI4i glad_glVertexAttribI4i
2417 GLAD_API_CALL PFNGLVERTEXATTRIBI4IVPROC glad_glVertexAttribI4iv;
2418 #define glVertexAttribI4iv glad_glVertexAttribI4iv
2419 GLAD_API_CALL PFNGLVERTEXATTRIBI4SVPROC glad_glVertexAttribI4sv;
2420 #define glVertexAttribI4sv glad_glVertexAttribI4sv
2421 GLAD_API_CALL PFNGLVERTEXATTRIBI4UBVPROC glad_glVertexAttribI4ubv;
2422 #define glVertexAttribI4ubv glad_glVertexAttribI4ubv
2423 GLAD_API_CALL PFNGLVERTEXATTRIBI4UIPROC glad_glVertexAttribI4ui;
2424 #define glVertexAttribI4ui glad_glVertexAttribI4ui
2425 GLAD_API_CALL PFNGLVERTEXATTRIBI4UIVPROC glad_glVertexAttribI4uiv;
2426 #define glVertexAttribI4uiv glad_glVertexAttribI4uiv
2427 GLAD_API_CALL PFNGLVERTEXATTRIBI4USVPROC glad_glVertexAttribI4usv;
2428 #define glVertexAttribI4usv glad_glVertexAttribI4usv
2429 GLAD_API_CALL PFNGLVERTEXATTRIBIPOINTERPROC glad_glVertexAttribIPointer;
2430 #define glVertexAttribIPointer glad_glVertexAttribIPointer
2431 GLAD_API_CALL PFNGLVERTEXATTRIBP1UIPROC glad_glVertexAttribP1ui;
2432 #define glVertexAttribP1ui glad_glVertexAttribP1ui
2433 GLAD_API_CALL PFNGLVERTEXATTRIBP1UIVPROC glad_glVertexAttribP1uiv;
2434 #define glVertexAttribP1uiv glad_glVertexAttribP1uiv
2435 GLAD_API_CALL PFNGLVERTEXATTRIBP2UIPROC glad_glVertexAttribP2ui;
2436 #define glVertexAttribP2ui glad_glVertexAttribP2ui
2437 GLAD_API_CALL PFNGLVERTEXATTRIBP2UIVPROC glad_glVertexAttribP2uiv;
2438 #define glVertexAttribP2uiv glad_glVertexAttribP2uiv
2439 GLAD_API_CALL PFNGLVERTEXATTRIBP3UIPROC glad_glVertexAttribP3ui;
2440 #define glVertexAttribP3ui glad_glVertexAttribP3ui
2441 GLAD_API_CALL PFNGLVERTEXATTRIBP3UIVPROC glad_glVertexAttribP3uiv;
2442 #define glVertexAttribP3uiv glad_glVertexAttribP3uiv
2443 GLAD_API_CALL PFNGLVERTEXATTRIBP4UIPROC glad_glVertexAttribP4ui;
2444 #define glVertexAttribP4ui glad_glVertexAttribP4ui
2445 GLAD_API_CALL PFNGLVERTEXATTRIBP4UIVPROC glad_glVertexAttribP4uiv;
2446 #define glVertexAttribP4uiv glad_glVertexAttribP4uiv
2447 GLAD_API_CALL PFNGLVERTEXATTRIBPOINTERPROC glad_glVertexAttribPointer;
2448 #define glVertexAttribPointer glad_glVertexAttribPointer
2449 GLAD_API_CALL PFNGLVIEWPORTPROC glad_glViewport;
2450 #define glViewport glad_glViewport
2451 GLAD_API_CALL PFNGLWAITSYNCPROC glad_glWaitSync;
2452 #define glWaitSync glad_glWaitSync
2453
2454
2455
2456
2457
2458 GLAD_API_CALL int gladLoadGLUserPtr( GLADuserptrloadfunc load, void *userptr);
2459 GLAD_API_CALL int gladLoadGL( GLADloadfunc load);
2460
2461
2462 #ifdef GLAD_GL
2463
2464 GLAD_API_CALL int gladLoaderLoadGL(void);
2465 GLAD_API_CALL void gladLoaderUnloadGL(void);
2466
2467 #endif
2468
2469 #ifdef __cplusplus
2470 }
2471 #endif
2472 #endif
2473
2474 /* Source */
2475 #ifdef GLAD_GL_IMPLEMENTATION
2476 #include <stdio.h>
2477 #include <stdlib.h>
2478 #include <string.h>
2479
2480 #ifndef GLAD_IMPL_UTIL_C_
2481 #define GLAD_IMPL_UTIL_C_
2482
2483 #ifdef _MSC_VER
2484 #define GLAD_IMPL_UTIL_SSCANF sscanf_s
2485 #else
2486 #define GLAD_IMPL_UTIL_SSCANF sscanf
2487 #endif
2488
2489 #endif /* GLAD_IMPL_UTIL_C_ */
2490
2491 #ifdef __cplusplus
2492 extern "C" {
2493 #endif
2494
2495
2496
2497 int GLAD_GL_VERSION_1_0 = 0;
2498 int GLAD_GL_VERSION_1_1 = 0;
2499 int GLAD_GL_VERSION_1_2 = 0;
2500 int GLAD_GL_VERSION_1_3 = 0;
2501 int GLAD_GL_VERSION_1_4 = 0;
2502 int GLAD_GL_VERSION_1_5 = 0;
2503 int GLAD_GL_VERSION_2_0 = 0;
2504 int GLAD_GL_VERSION_2_1 = 0;
2505 int GLAD_GL_VERSION_3_0 = 0;
2506 int GLAD_GL_VERSION_3_1 = 0;
2507 int GLAD_GL_VERSION_3_2 = 0;
2508 int GLAD_GL_VERSION_3_3 = 0;
2509
2510
2511
2512 PFNGLACTIVETEXTUREPROC glad_glActiveTexture = NULL;
2513 PFNGLATTACHSHADERPROC glad_glAttachShader = NULL;
2514 PFNGLBEGINCONDITIONALRENDERPROC glad_glBeginConditionalRender = NULL;
2515 PFNGLBEGINQUERYPROC glad_glBeginQuery = NULL;
2516 PFNGLBEGINTRANSFORMFEEDBACKPROC glad_glBeginTransformFeedback = NULL;
2517 PFNGLBINDATTRIBLOCATIONPROC glad_glBindAttribLocation = NULL;
2518 PFNGLBINDBUFFERPROC glad_glBindBuffer = NULL;
2519 PFNGLBINDBUFFERBASEPROC glad_glBindBufferBase = NULL;
2520 PFNGLBINDBUFFERRANGEPROC glad_glBindBufferRange = NULL;
2521 PFNGLBINDFRAGDATALOCATIONPROC glad_glBindFragDataLocation = NULL;
2522 PFNGLBINDFRAGDATALOCATIONINDEXEDPROC glad_glBindFragDataLocationIndexed = NULL;
2523 PFNGLBINDFRAMEBUFFERPROC glad_glBindFramebuffer = NULL;
2524 PFNGLBINDRENDERBUFFERPROC glad_glBindRenderbuffer = NULL;
2525 PFNGLBINDSAMPLERPROC glad_glBindSampler = NULL;
2526 PFNGLBINDTEXTUREPROC glad_glBindTexture = NULL;
2527 PFNGLBINDVERTEXARRAYPROC glad_glBindVertexArray = NULL;
2528 PFNGLBLENDCOLORPROC glad_glBlendColor = NULL;
2529 PFNGLBLENDEQUATIONPROC glad_glBlendEquation = NULL;
2530 PFNGLBLENDEQUATIONSEPARATEPROC glad_glBlendEquationSeparate = NULL;
2531 PFNGLBLENDFUNCPROC glad_glBlendFunc = NULL;
2532 PFNGLBLENDFUNCSEPARATEPROC glad_glBlendFuncSeparate = NULL;
2533 PFNGLBLITFRAMEBUFFERPROC glad_glBlitFramebuffer = NULL;
2534 PFNGLBUFFERDATAPROC glad_glBufferData = NULL;
2535 PFNGLBUFFERSUBDATAPROC glad_glBufferSubData = NULL;
2536 PFNGLCHECKFRAMEBUFFERSTATUSPROC glad_glCheckFramebufferStatus = NULL;
2537 PFNGLCLAMPCOLORPROC glad_glClampColor = NULL;
2538 PFNGLCLEARPROC glad_glClear = NULL;
2539 PFNGLCLEARBUFFERFIPROC glad_glClearBufferfi = NULL;
2540 PFNGLCLEARBUFFERFVPROC glad_glClearBufferfv = NULL;
2541 PFNGLCLEARBUFFERIVPROC glad_glClearBufferiv = NULL;
2542 PFNGLCLEARBUFFERUIVPROC glad_glClearBufferuiv = NULL;
2543 PFNGLCLEARCOLORPROC glad_glClearColor = NULL;
2544 PFNGLCLEARDEPTHPROC glad_glClearDepth = NULL;
2545 PFNGLCLEARSTENCILPROC glad_glClearStencil = NULL;
2546 PFNGLCLIENTWAITSYNCPROC glad_glClientWaitSync = NULL;
2547 PFNGLCOLORMASKPROC glad_glColorMask = NULL;
2548 PFNGLCOLORMASKIPROC glad_glColorMaski = NULL;
2549 PFNGLCOMPILESHADERPROC glad_glCompileShader = NULL;
2550 PFNGLCOMPRESSEDTEXIMAGE1DPROC glad_glCompressedTexImage1D = NULL;
2551 PFNGLCOMPRESSEDTEXIMAGE2DPROC glad_glCompressedTexImage2D = NULL;
2552 PFNGLCOMPRESSEDTEXIMAGE3DPROC glad_glCompressedTexImage3D = NULL;
2553 PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC glad_glCompressedTexSubImage1D = NULL;
2554 PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glad_glCompressedTexSubImage2D = NULL;
2555 PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glad_glCompressedTexSubImage3D = NULL;
2556 PFNGLCOPYBUFFERSUBDATAPROC glad_glCopyBufferSubData = NULL;
2557 PFNGLCOPYTEXIMAGE1DPROC glad_glCopyTexImage1D = NULL;
2558 PFNGLCOPYTEXIMAGE2DPROC glad_glCopyTexImage2D = NULL;
2559 PFNGLCOPYTEXSUBIMAGE1DPROC glad_glCopyTexSubImage1D = NULL;
2560 PFNGLCOPYTEXSUBIMAGE2DPROC glad_glCopyTexSubImage2D = NULL;
2561 PFNGLCOPYTEXSUBIMAGE3DPROC glad_glCopyTexSubImage3D = NULL;
2562 PFNGLCREATEPROGRAMPROC glad_glCreateProgram = NULL;
2563 PFNGLCREATESHADERPROC glad_glCreateShader = NULL;
2564 PFNGLCULLFACEPROC glad_glCullFace = NULL;
2565 PFNGLDELETEBUFFERSPROC glad_glDeleteBuffers = NULL;
2566 PFNGLDELETEFRAMEBUFFERSPROC glad_glDeleteFramebuffers = NULL;
2567 PFNGLDELETEPROGRAMPROC glad_glDeleteProgram = NULL;
2568 PFNGLDELETEQUERIESPROC glad_glDeleteQueries = NULL;
2569 PFNGLDELETERENDERBUFFERSPROC glad_glDeleteRenderbuffers = NULL;
2570 PFNGLDELETESAMPLERSPROC glad_glDeleteSamplers = NULL;
2571 PFNGLDELETESHADERPROC glad_glDeleteShader = NULL;
2572 PFNGLDELETESYNCPROC glad_glDeleteSync = NULL;
2573 PFNGLDELETETEXTURESPROC glad_glDeleteTextures = NULL;
2574 PFNGLDELETEVERTEXARRAYSPROC glad_glDeleteVertexArrays = NULL;
2575 PFNGLDEPTHFUNCPROC glad_glDepthFunc = NULL;
2576 PFNGLDEPTHMASKPROC glad_glDepthMask = NULL;
2577 PFNGLDEPTHRANGEPROC glad_glDepthRange = NULL;
2578 PFNGLDETACHSHADERPROC glad_glDetachShader = NULL;
2579 PFNGLDISABLEPROC glad_glDisable = NULL;
2580 PFNGLDISABLEVERTEXATTRIBARRAYPROC glad_glDisableVertexAttribArray = NULL;
2581 PFNGLDISABLEIPROC glad_glDisablei = NULL;
2582 PFNGLDRAWARRAYSPROC glad_glDrawArrays = NULL;
2583 PFNGLDRAWARRAYSINSTANCEDPROC glad_glDrawArraysInstanced = NULL;
2584 PFNGLDRAWBUFFERPROC glad_glDrawBuffer = NULL;
2585 PFNGLDRAWBUFFERSPROC glad_glDrawBuffers = NULL;
2586 PFNGLDRAWELEMENTSPROC glad_glDrawElements = NULL;
2587 PFNGLDRAWELEMENTSBASEVERTEXPROC glad_glDrawElementsBaseVertex = NULL;
2588 PFNGLDRAWELEMENTSINSTANCEDPROC glad_glDrawElementsInstanced = NULL;
2589 PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC glad_glDrawElementsInstancedBaseVertex = NULL;
2590 PFNGLDRAWRANGEELEMENTSPROC glad_glDrawRangeElements = NULL;
2591 PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC glad_glDrawRangeElementsBaseVertex = NULL;
2592 PFNGLENABLEPROC glad_glEnable = NULL;
2593 PFNGLENABLEVERTEXATTRIBARRAYPROC glad_glEnableVertexAttribArray = NULL;
2594 PFNGLENABLEIPROC glad_glEnablei = NULL;
2595 PFNGLENDCONDITIONALRENDERPROC glad_glEndConditionalRender = NULL;
2596 PFNGLENDQUERYPROC glad_glEndQuery = NULL;
2597 PFNGLENDTRANSFORMFEEDBACKPROC glad_glEndTransformFeedback = NULL;
2598 PFNGLFENCESYNCPROC glad_glFenceSync = NULL;
2599 PFNGLFINISHPROC glad_glFinish = NULL;
2600 PFNGLFLUSHPROC glad_glFlush = NULL;
2601 PFNGLFLUSHMAPPEDBUFFERRANGEPROC glad_glFlushMappedBufferRange = NULL;
2602 PFNGLFRAMEBUFFERRENDERBUFFERPROC glad_glFramebufferRenderbuffer = NULL;
2603 PFNGLFRAMEBUFFERTEXTUREPROC glad_glFramebufferTexture = NULL;
2604 PFNGLFRAMEBUFFERTEXTURE1DPROC glad_glFramebufferTexture1D = NULL;
2605 PFNGLFRAMEBUFFERTEXTURE2DPROC glad_glFramebufferTexture2D = NULL;
2606 PFNGLFRAMEBUFFERTEXTURE3DPROC glad_glFramebufferTexture3D = NULL;
2607 PFNGLFRAMEBUFFERTEXTURELAYERPROC glad_glFramebufferTextureLayer = NULL;
2608 PFNGLFRONTFACEPROC glad_glFrontFace = NULL;
2609 PFNGLGENBUFFERSPROC glad_glGenBuffers = NULL;
2610 PFNGLGENFRAMEBUFFERSPROC glad_glGenFramebuffers = NULL;
2611 PFNGLGENQUERIESPROC glad_glGenQueries = NULL;
2612 PFNGLGENRENDERBUFFERSPROC glad_glGenRenderbuffers = NULL;
2613 PFNGLGENSAMPLERSPROC glad_glGenSamplers = NULL;
2614 PFNGLGENTEXTURESPROC glad_glGenTextures = NULL;
2615 PFNGLGENVERTEXARRAYSPROC glad_glGenVertexArrays = NULL;
2616 PFNGLGENERATEMIPMAPPROC glad_glGenerateMipmap = NULL;
2617 PFNGLGETACTIVEATTRIBPROC glad_glGetActiveAttrib = NULL;
2618 PFNGLGETACTIVEUNIFORMPROC glad_glGetActiveUniform = NULL;
2619 PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC glad_glGetActiveUniformBlockName = NULL;
2620 PFNGLGETACTIVEUNIFORMBLOCKIVPROC glad_glGetActiveUniformBlockiv = NULL;
2621 PFNGLGETACTIVEUNIFORMNAMEPROC glad_glGetActiveUniformName = NULL;
2622 PFNGLGETACTIVEUNIFORMSIVPROC glad_glGetActiveUniformsiv = NULL;
2623 PFNGLGETATTACHEDSHADERSPROC glad_glGetAttachedShaders = NULL;
2624 PFNGLGETATTRIBLOCATIONPROC glad_glGetAttribLocation = NULL;
2625 PFNGLGETBOOLEANI_VPROC glad_glGetBooleani_v = NULL;
2626 PFNGLGETBOOLEANVPROC glad_glGetBooleanv = NULL;
2627 PFNGLGETBUFFERPARAMETERI64VPROC glad_glGetBufferParameteri64v = NULL;
2628 PFNGLGETBUFFERPARAMETERIVPROC glad_glGetBufferParameteriv = NULL;
2629 PFNGLGETBUFFERPOINTERVPROC glad_glGetBufferPointerv = NULL;
2630 PFNGLGETBUFFERSUBDATAPROC glad_glGetBufferSubData = NULL;
2631 PFNGLGETCOMPRESSEDTEXIMAGEPROC glad_glGetCompressedTexImage = NULL;
2632 PFNGLGETDOUBLEVPROC glad_glGetDoublev = NULL;
2633 PFNGLGETERRORPROC glad_glGetError = NULL;
2634 PFNGLGETFLOATVPROC glad_glGetFloatv = NULL;
2635 PFNGLGETFRAGDATAINDEXPROC glad_glGetFragDataIndex = NULL;
2636 PFNGLGETFRAGDATALOCATIONPROC glad_glGetFragDataLocation = NULL;
2637 PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetFramebufferAttachmentParameteriv = NULL;
2638 PFNGLGETINTEGER64I_VPROC glad_glGetInteger64i_v = NULL;
2639 PFNGLGETINTEGER64VPROC glad_glGetInteger64v = NULL;
2640 PFNGLGETINTEGERI_VPROC glad_glGetIntegeri_v = NULL;
2641 PFNGLGETINTEGERVPROC glad_glGetIntegerv = NULL;
2642 PFNGLGETMULTISAMPLEFVPROC glad_glGetMultisamplefv = NULL;
2643 PFNGLGETPROGRAMINFOLOGPROC glad_glGetProgramInfoLog = NULL;
2644 PFNGLGETPROGRAMIVPROC glad_glGetProgramiv = NULL;
2645 PFNGLGETQUERYOBJECTI64VPROC glad_glGetQueryObjecti64v = NULL;
2646 PFNGLGETQUERYOBJECTIVPROC glad_glGetQueryObjectiv = NULL;
2647 PFNGLGETQUERYOBJECTUI64VPROC glad_glGetQueryObjectui64v = NULL;
2648 PFNGLGETQUERYOBJECTUIVPROC glad_glGetQueryObjectuiv = NULL;
2649 PFNGLGETQUERYIVPROC glad_glGetQueryiv = NULL;
2650 PFNGLGETRENDERBUFFERPARAMETERIVPROC glad_glGetRenderbufferParameteriv = NULL;
2651 PFNGLGETSAMPLERPARAMETERIIVPROC glad_glGetSamplerParameterIiv = NULL;
2652 PFNGLGETSAMPLERPARAMETERIUIVPROC glad_glGetSamplerParameterIuiv = NULL;
2653 PFNGLGETSAMPLERPARAMETERFVPROC glad_glGetSamplerParameterfv = NULL;
2654 PFNGLGETSAMPLERPARAMETERIVPROC glad_glGetSamplerParameteriv = NULL;
2655 PFNGLGETSHADERINFOLOGPROC glad_glGetShaderInfoLog = NULL;
2656 PFNGLGETSHADERSOURCEPROC glad_glGetShaderSource = NULL;
2657 PFNGLGETSHADERIVPROC glad_glGetShaderiv = NULL;
2658 PFNGLGETSTRINGPROC glad_glGetString = NULL;
2659 PFNGLGETSTRINGIPROC glad_glGetStringi = NULL;
2660 PFNGLGETSYNCIVPROC glad_glGetSynciv = NULL;
2661 PFNGLGETTEXIMAGEPROC glad_glGetTexImage = NULL;
2662 PFNGLGETTEXLEVELPARAMETERFVPROC glad_glGetTexLevelParameterfv = NULL;
2663 PFNGLGETTEXLEVELPARAMETERIVPROC glad_glGetTexLevelParameteriv = NULL;
2664 PFNGLGETTEXPARAMETERIIVPROC glad_glGetTexParameterIiv = NULL;
2665 PFNGLGETTEXPARAMETERIUIVPROC glad_glGetTexParameterIuiv = NULL;
2666 PFNGLGETTEXPARAMETERFVPROC glad_glGetTexParameterfv = NULL;
2667 PFNGLGETTEXPARAMETERIVPROC glad_glGetTexParameteriv = NULL;
2668 PFNGLGETTRANSFORMFEEDBACKVARYINGPROC glad_glGetTransformFeedbackVarying = NULL;
2669 PFNGLGETUNIFORMBLOCKINDEXPROC glad_glGetUniformBlockIndex = NULL;
2670 PFNGLGETUNIFORMINDICESPROC glad_glGetUniformIndices = NULL;
2671 PFNGLGETUNIFORMLOCATIONPROC glad_glGetUniformLocation = NULL;
2672 PFNGLGETUNIFORMFVPROC glad_glGetUniformfv = NULL;
2673 PFNGLGETUNIFORMIVPROC glad_glGetUniformiv = NULL;
2674 PFNGLGETUNIFORMUIVPROC glad_glGetUniformuiv = NULL;
2675 PFNGLGETVERTEXATTRIBIIVPROC glad_glGetVertexAttribIiv = NULL;
2676 PFNGLGETVERTEXATTRIBIUIVPROC glad_glGetVertexAttribIuiv = NULL;
2677 PFNGLGETVERTEXATTRIBPOINTERVPROC glad_glGetVertexAttribPointerv = NULL;
2678 PFNGLGETVERTEXATTRIBDVPROC glad_glGetVertexAttribdv = NULL;
2679 PFNGLGETVERTEXATTRIBFVPROC glad_glGetVertexAttribfv = NULL;
2680 PFNGLGETVERTEXATTRIBIVPROC glad_glGetVertexAttribiv = NULL;
2681 PFNGLHINTPROC glad_glHint = NULL;
2682 PFNGLISBUFFERPROC glad_glIsBuffer = NULL;
2683 PFNGLISENABLEDPROC glad_glIsEnabled = NULL;
2684 PFNGLISENABLEDIPROC glad_glIsEnabledi = NULL;
2685 PFNGLISFRAMEBUFFERPROC glad_glIsFramebuffer = NULL;
2686 PFNGLISPROGRAMPROC glad_glIsProgram = NULL;
2687 PFNGLISQUERYPROC glad_glIsQuery = NULL;
2688 PFNGLISRENDERBUFFERPROC glad_glIsRenderbuffer = NULL;
2689 PFNGLISSAMPLERPROC glad_glIsSampler = NULL;
2690 PFNGLISSHADERPROC glad_glIsShader = NULL;
2691 PFNGLISSYNCPROC glad_glIsSync = NULL;
2692 PFNGLISTEXTUREPROC glad_glIsTexture = NULL;
2693 PFNGLISVERTEXARRAYPROC glad_glIsVertexArray = NULL;
2694 PFNGLLINEWIDTHPROC glad_glLineWidth = NULL;
2695 PFNGLLINKPROGRAMPROC glad_glLinkProgram = NULL;
2696 PFNGLLOGICOPPROC glad_glLogicOp = NULL;
2697 PFNGLMAPBUFFERPROC glad_glMapBuffer = NULL;
2698 PFNGLMAPBUFFERRANGEPROC glad_glMapBufferRange = NULL;
2699 PFNGLMULTIDRAWARRAYSPROC glad_glMultiDrawArrays = NULL;
2700 PFNGLMULTIDRAWELEMENTSPROC glad_glMultiDrawElements = NULL;
2701 PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC glad_glMultiDrawElementsBaseVertex = NULL;
2702 PFNGLPIXELSTOREFPROC glad_glPixelStoref = NULL;
2703 PFNGLPIXELSTOREIPROC glad_glPixelStorei = NULL;
2704 PFNGLPOINTPARAMETERFPROC glad_glPointParameterf = NULL;
2705 PFNGLPOINTPARAMETERFVPROC glad_glPointParameterfv = NULL;
2706 PFNGLPOINTPARAMETERIPROC glad_glPointParameteri = NULL;
2707 PFNGLPOINTPARAMETERIVPROC glad_glPointParameteriv = NULL;
2708 PFNGLPOINTSIZEPROC glad_glPointSize = NULL;
2709 PFNGLPOLYGONMODEPROC glad_glPolygonMode = NULL;
2710 PFNGLPOLYGONOFFSETPROC glad_glPolygonOffset = NULL;
2711 PFNGLPRIMITIVERESTARTINDEXPROC glad_glPrimitiveRestartIndex = NULL;
2712 PFNGLPROVOKINGVERTEXPROC glad_glProvokingVertex = NULL;
2713 PFNGLQUERYCOUNTERPROC glad_glQueryCounter = NULL;
2714 PFNGLREADBUFFERPROC glad_glReadBuffer = NULL;
2715 PFNGLREADPIXELSPROC glad_glReadPixels = NULL;
2716 PFNGLRENDERBUFFERSTORAGEPROC glad_glRenderbufferStorage = NULL;
2717 PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC glad_glRenderbufferStorageMultisample = NULL;
2718 PFNGLSAMPLECOVERAGEPROC glad_glSampleCoverage = NULL;
2719 PFNGLSAMPLEMASKIPROC glad_glSampleMaski = NULL;
2720 PFNGLSAMPLERPARAMETERIIVPROC glad_glSamplerParameterIiv = NULL;
2721 PFNGLSAMPLERPARAMETERIUIVPROC glad_glSamplerParameterIuiv = NULL;
2722 PFNGLSAMPLERPARAMETERFPROC glad_glSamplerParameterf = NULL;
2723 PFNGLSAMPLERPARAMETERFVPROC glad_glSamplerParameterfv = NULL;
2724 PFNGLSAMPLERPARAMETERIPROC glad_glSamplerParameteri = NULL;
2725 PFNGLSAMPLERPARAMETERIVPROC glad_glSamplerParameteriv = NULL;
2726 PFNGLSCISSORPROC glad_glScissor = NULL;
2727 PFNGLSHADERSOURCEPROC glad_glShaderSource = NULL;
2728 PFNGLSTENCILFUNCPROC glad_glStencilFunc = NULL;
2729 PFNGLSTENCILFUNCSEPARATEPROC glad_glStencilFuncSeparate = NULL;
2730 PFNGLSTENCILMASKPROC glad_glStencilMask = NULL;
2731 PFNGLSTENCILMASKSEPARATEPROC glad_glStencilMaskSeparate = NULL;
2732 PFNGLSTENCILOPPROC glad_glStencilOp = NULL;
2733 PFNGLSTENCILOPSEPARATEPROC glad_glStencilOpSeparate = NULL;
2734 PFNGLTEXBUFFERPROC glad_glTexBuffer = NULL;
2735 PFNGLTEXIMAGE1DPROC glad_glTexImage1D = NULL;
2736 PFNGLTEXIMAGE2DPROC glad_glTexImage2D = NULL;
2737 PFNGLTEXIMAGE2DMULTISAMPLEPROC glad_glTexImage2DMultisample = NULL;
2738 PFNGLTEXIMAGE3DPROC glad_glTexImage3D = NULL;
2739 PFNGLTEXIMAGE3DMULTISAMPLEPROC glad_glTexImage3DMultisample = NULL;
2740 PFNGLTEXPARAMETERIIVPROC glad_glTexParameterIiv = NULL;
2741 PFNGLTEXPARAMETERIUIVPROC glad_glTexParameterIuiv = NULL;
2742 PFNGLTEXPARAMETERFPROC glad_glTexParameterf = NULL;
2743 PFNGLTEXPARAMETERFVPROC glad_glTexParameterfv = NULL;
2744 PFNGLTEXPARAMETERIPROC glad_glTexParameteri = NULL;
2745 PFNGLTEXPARAMETERIVPROC glad_glTexParameteriv = NULL;
2746 PFNGLTEXSUBIMAGE1DPROC glad_glTexSubImage1D = NULL;
2747 PFNGLTEXSUBIMAGE2DPROC glad_glTexSubImage2D = NULL;
2748 PFNGLTEXSUBIMAGE3DPROC glad_glTexSubImage3D = NULL;
2749 PFNGLTRANSFORMFEEDBACKVARYINGSPROC glad_glTransformFeedbackVaryings = NULL;
2750 PFNGLUNIFORM1FPROC glad_glUniform1f = NULL;
2751 PFNGLUNIFORM1FVPROC glad_glUniform1fv = NULL;
2752 PFNGLUNIFORM1IPROC glad_glUniform1i = NULL;
2753 PFNGLUNIFORM1IVPROC glad_glUniform1iv = NULL;
2754 PFNGLUNIFORM1UIPROC glad_glUniform1ui = NULL;
2755 PFNGLUNIFORM1UIVPROC glad_glUniform1uiv = NULL;
2756 PFNGLUNIFORM2FPROC glad_glUniform2f = NULL;
2757 PFNGLUNIFORM2FVPROC glad_glUniform2fv = NULL;
2758 PFNGLUNIFORM2IPROC glad_glUniform2i = NULL;
2759 PFNGLUNIFORM2IVPROC glad_glUniform2iv = NULL;
2760 PFNGLUNIFORM2UIPROC glad_glUniform2ui = NULL;
2761 PFNGLUNIFORM2UIVPROC glad_glUniform2uiv = NULL;
2762 PFNGLUNIFORM3FPROC glad_glUniform3f = NULL;
2763 PFNGLUNIFORM3FVPROC glad_glUniform3fv = NULL;
2764 PFNGLUNIFORM3IPROC glad_glUniform3i = NULL;
2765 PFNGLUNIFORM3IVPROC glad_glUniform3iv = NULL;
2766 PFNGLUNIFORM3UIPROC glad_glUniform3ui = NULL;
2767 PFNGLUNIFORM3UIVPROC glad_glUniform3uiv = NULL;
2768 PFNGLUNIFORM4FPROC glad_glUniform4f = NULL;
2769 PFNGLUNIFORM4FVPROC glad_glUniform4fv = NULL;
2770 PFNGLUNIFORM4IPROC glad_glUniform4i = NULL;
2771 PFNGLUNIFORM4IVPROC glad_glUniform4iv = NULL;
2772 PFNGLUNIFORM4UIPROC glad_glUniform4ui = NULL;
2773 PFNGLUNIFORM4UIVPROC glad_glUniform4uiv = NULL;
2774 PFNGLUNIFORMBLOCKBINDINGPROC glad_glUniformBlockBinding = NULL;
2775 PFNGLUNIFORMMATRIX2FVPROC glad_glUniformMatrix2fv = NULL;
2776 PFNGLUNIFORMMATRIX2X3FVPROC glad_glUniformMatrix2x3fv = NULL;
2777 PFNGLUNIFORMMATRIX2X4FVPROC glad_glUniformMatrix2x4fv = NULL;
2778 PFNGLUNIFORMMATRIX3FVPROC glad_glUniformMatrix3fv = NULL;
2779 PFNGLUNIFORMMATRIX3X2FVPROC glad_glUniformMatrix3x2fv = NULL;
2780 PFNGLUNIFORMMATRIX3X4FVPROC glad_glUniformMatrix3x4fv = NULL;
2781 PFNGLUNIFORMMATRIX4FVPROC glad_glUniformMatrix4fv = NULL;
2782 PFNGLUNIFORMMATRIX4X2FVPROC glad_glUniformMatrix4x2fv = NULL;
2783 PFNGLUNIFORMMATRIX4X3FVPROC glad_glUniformMatrix4x3fv = NULL;
2784 PFNGLUNMAPBUFFERPROC glad_glUnmapBuffer = NULL;
2785 PFNGLUSEPROGRAMPROC glad_glUseProgram = NULL;
2786 PFNGLVALIDATEPROGRAMPROC glad_glValidateProgram = NULL;
2787 PFNGLVERTEXATTRIB1DPROC glad_glVertexAttrib1d = NULL;
2788 PFNGLVERTEXATTRIB1DVPROC glad_glVertexAttrib1dv = NULL;
2789 PFNGLVERTEXATTRIB1FPROC glad_glVertexAttrib1f = NULL;
2790 PFNGLVERTEXATTRIB1FVPROC glad_glVertexAttrib1fv = NULL;
2791 PFNGLVERTEXATTRIB1SPROC glad_glVertexAttrib1s = NULL;
2792 PFNGLVERTEXATTRIB1SVPROC glad_glVertexAttrib1sv = NULL;
2793 PFNGLVERTEXATTRIB2DPROC glad_glVertexAttrib2d = NULL;
2794 PFNGLVERTEXATTRIB2DVPROC glad_glVertexAttrib2dv = NULL;
2795 PFNGLVERTEXATTRIB2FPROC glad_glVertexAttrib2f = NULL;
2796 PFNGLVERTEXATTRIB2FVPROC glad_glVertexAttrib2fv = NULL;
2797 PFNGLVERTEXATTRIB2SPROC glad_glVertexAttrib2s = NULL;
2798 PFNGLVERTEXATTRIB2SVPROC glad_glVertexAttrib2sv = NULL;
2799 PFNGLVERTEXATTRIB3DPROC glad_glVertexAttrib3d = NULL;
2800 PFNGLVERTEXATTRIB3DVPROC glad_glVertexAttrib3dv = NULL;
2801 PFNGLVERTEXATTRIB3FPROC glad_glVertexAttrib3f = NULL;
2802 PFNGLVERTEXATTRIB3FVPROC glad_glVertexAttrib3fv = NULL;
2803 PFNGLVERTEXATTRIB3SPROC glad_glVertexAttrib3s = NULL;
2804 PFNGLVERTEXATTRIB3SVPROC glad_glVertexAttrib3sv = NULL;
2805 PFNGLVERTEXATTRIB4NBVPROC glad_glVertexAttrib4Nbv = NULL;
2806 PFNGLVERTEXATTRIB4NIVPROC glad_glVertexAttrib4Niv = NULL;
2807 PFNGLVERTEXATTRIB4NSVPROC glad_glVertexAttrib4Nsv = NULL;
2808 PFNGLVERTEXATTRIB4NUBPROC glad_glVertexAttrib4Nub = NULL;
2809 PFNGLVERTEXATTRIB4NUBVPROC glad_glVertexAttrib4Nubv = NULL;
2810 PFNGLVERTEXATTRIB4NUIVPROC glad_glVertexAttrib4Nuiv = NULL;
2811 PFNGLVERTEXATTRIB4NUSVPROC glad_glVertexAttrib4Nusv = NULL;
2812 PFNGLVERTEXATTRIB4BVPROC glad_glVertexAttrib4bv = NULL;
2813 PFNGLVERTEXATTRIB4DPROC glad_glVertexAttrib4d = NULL;
2814 PFNGLVERTEXATTRIB4DVPROC glad_glVertexAttrib4dv = NULL;
2815 PFNGLVERTEXATTRIB4FPROC glad_glVertexAttrib4f = NULL;
2816 PFNGLVERTEXATTRIB4FVPROC glad_glVertexAttrib4fv = NULL;
2817 PFNGLVERTEXATTRIB4IVPROC glad_glVertexAttrib4iv = NULL;
2818 PFNGLVERTEXATTRIB4SPROC glad_glVertexAttrib4s = NULL;
2819 PFNGLVERTEXATTRIB4SVPROC glad_glVertexAttrib4sv = NULL;
2820 PFNGLVERTEXATTRIB4UBVPROC glad_glVertexAttrib4ubv = NULL;
2821 PFNGLVERTEXATTRIB4UIVPROC glad_glVertexAttrib4uiv = NULL;
2822 PFNGLVERTEXATTRIB4USVPROC glad_glVertexAttrib4usv = NULL;
2823 PFNGLVERTEXATTRIBDIVISORPROC glad_glVertexAttribDivisor = NULL;
2824 PFNGLVERTEXATTRIBI1IPROC glad_glVertexAttribI1i = NULL;
2825 PFNGLVERTEXATTRIBI1IVPROC glad_glVertexAttribI1iv = NULL;
2826 PFNGLVERTEXATTRIBI1UIPROC glad_glVertexAttribI1ui = NULL;
2827 PFNGLVERTEXATTRIBI1UIVPROC glad_glVertexAttribI1uiv = NULL;
2828 PFNGLVERTEXATTRIBI2IPROC glad_glVertexAttribI2i = NULL;
2829 PFNGLVERTEXATTRIBI2IVPROC glad_glVertexAttribI2iv = NULL;
2830 PFNGLVERTEXATTRIBI2UIPROC glad_glVertexAttribI2ui = NULL;
2831 PFNGLVERTEXATTRIBI2UIVPROC glad_glVertexAttribI2uiv = NULL;
2832 PFNGLVERTEXATTRIBI3IPROC glad_glVertexAttribI3i = NULL;
2833 PFNGLVERTEXATTRIBI3IVPROC glad_glVertexAttribI3iv = NULL;
2834 PFNGLVERTEXATTRIBI3UIPROC glad_glVertexAttribI3ui = NULL;
2835 PFNGLVERTEXATTRIBI3UIVPROC glad_glVertexAttribI3uiv = NULL;
2836 PFNGLVERTEXATTRIBI4BVPROC glad_glVertexAttribI4bv = NULL;
2837 PFNGLVERTEXATTRIBI4IPROC glad_glVertexAttribI4i = NULL;
2838 PFNGLVERTEXATTRIBI4IVPROC glad_glVertexAttribI4iv = NULL;
2839 PFNGLVERTEXATTRIBI4SVPROC glad_glVertexAttribI4sv = NULL;
2840 PFNGLVERTEXATTRIBI4UBVPROC glad_glVertexAttribI4ubv = NULL;
2841 PFNGLVERTEXATTRIBI4UIPROC glad_glVertexAttribI4ui = NULL;
2842 PFNGLVERTEXATTRIBI4UIVPROC glad_glVertexAttribI4uiv = NULL;
2843 PFNGLVERTEXATTRIBI4USVPROC glad_glVertexAttribI4usv = NULL;
2844 PFNGLVERTEXATTRIBIPOINTERPROC glad_glVertexAttribIPointer = NULL;
2845 PFNGLVERTEXATTRIBP1UIPROC glad_glVertexAttribP1ui = NULL;
2846 PFNGLVERTEXATTRIBP1UIVPROC glad_glVertexAttribP1uiv = NULL;
2847 PFNGLVERTEXATTRIBP2UIPROC glad_glVertexAttribP2ui = NULL;
2848 PFNGLVERTEXATTRIBP2UIVPROC glad_glVertexAttribP2uiv = NULL;
2849 PFNGLVERTEXATTRIBP3UIPROC glad_glVertexAttribP3ui = NULL;
2850 PFNGLVERTEXATTRIBP3UIVPROC glad_glVertexAttribP3uiv = NULL;
2851 PFNGLVERTEXATTRIBP4UIPROC glad_glVertexAttribP4ui = NULL;
2852 PFNGLVERTEXATTRIBP4UIVPROC glad_glVertexAttribP4uiv = NULL;
2853 PFNGLVERTEXATTRIBPOINTERPROC glad_glVertexAttribPointer = NULL;
2854 PFNGLVIEWPORTPROC glad_glViewport = NULL;
2855 PFNGLWAITSYNCPROC glad_glWaitSync = NULL;
2856
2857
2858 static void glad_gl_load_GL_VERSION_1_0( GLADuserptrloadfunc load, void* userptr) {
2859 if(!GLAD_GL_VERSION_1_0) return;
2860 glad_glBlendFunc = (PFNGLBLENDFUNCPROC) load(userptr, "glBlendFunc");
2861 glad_glClear = (PFNGLCLEARPROC) load(userptr, "glClear");
2862 glad_glClearColor = (PFNGLCLEARCOLORPROC) load(userptr, "glClearColor");
2863 glad_glClearDepth = (PFNGLCLEARDEPTHPROC) load(userptr, "glClearDepth");
2864 glad_glClearStencil = (PFNGLCLEARSTENCILPROC) load(userptr, "glClearStencil");
2865 glad_glColorMask = (PFNGLCOLORMASKPROC) load(userptr, "glColorMask");
2866 glad_glCullFace = (PFNGLCULLFACEPROC) load(userptr, "glCullFace");
2867 glad_glDepthFunc = (PFNGLDEPTHFUNCPROC) load(userptr, "glDepthFunc");
2868 glad_glDepthMask = (PFNGLDEPTHMASKPROC) load(userptr, "glDepthMask");
2869 glad_glDepthRange = (PFNGLDEPTHRANGEPROC) load(userptr, "glDepthRange");
2870 glad_glDisable = (PFNGLDISABLEPROC) load(userptr, "glDisable");
2871 glad_glDrawBuffer = (PFNGLDRAWBUFFERPROC) load(userptr, "glDrawBuffer");
2872 glad_glEnable = (PFNGLENABLEPROC) load(userptr, "glEnable");
2873 glad_glFinish = (PFNGLFINISHPROC) load(userptr, "glFinish");
2874 glad_glFlush = (PFNGLFLUSHPROC) load(userptr, "glFlush");
2875 glad_glFrontFace = (PFNGLFRONTFACEPROC) load(userptr, "glFrontFace");
2876 glad_glGetBooleanv = (PFNGLGETBOOLEANVPROC) load(userptr, "glGetBooleanv");
2877 glad_glGetDoublev = (PFNGLGETDOUBLEVPROC) load(userptr, "glGetDoublev");
2878 glad_glGetError = (PFNGLGETERRORPROC) load(userptr, "glGetError");
2879 glad_glGetFloatv = (PFNGLGETFLOATVPROC) load(userptr, "glGetFloatv");
2880 glad_glGetIntegerv = (PFNGLGETINTEGERVPROC) load(userptr, "glGetIntegerv");
2881 glad_glGetString = (PFNGLGETSTRINGPROC) load(userptr, "glGetString");
2882 glad_glGetTexImage = (PFNGLGETTEXIMAGEPROC) load(userptr, "glGetTexImage");
2883 glad_glGetTexLevelParameterfv = (PFNGLGETTEXLEVELPARAMETERFVPROC) load(userptr, "glGetTexLevelParameterfv");
2884 glad_glGetTexLevelParameteriv = (PFNGLGETTEXLEVELPARAMETERIVPROC) load(userptr, "glGetTexLevelParameteriv");
2885 glad_glGetTexParameterfv = (PFNGLGETTEXPARAMETERFVPROC) load(userptr, "glGetTexParameterfv");
2886 glad_glGetTexParameteriv = (PFNGLGETTEXPARAMETERIVPROC) load(userptr, "glGetTexParameteriv");
2887 glad_glHint = (PFNGLHINTPROC) load(userptr, "glHint");
2888 glad_glIsEnabled = (PFNGLISENABLEDPROC) load(userptr, "glIsEnabled");
2889 glad_glLineWidth = (PFNGLLINEWIDTHPROC) load(userptr, "glLineWidth");
2890 glad_glLogicOp = (PFNGLLOGICOPPROC) load(userptr, "glLogicOp");
2891 glad_glPixelStoref = (PFNGLPIXELSTOREFPROC) load(userptr, "glPixelStoref");
2892 glad_glPixelStorei = (PFNGLPIXELSTOREIPROC) load(userptr, "glPixelStorei");
2893 glad_glPointSize = (PFNGLPOINTSIZEPROC) load(userptr, "glPointSize");
2894 glad_glPolygonMode = (PFNGLPOLYGONMODEPROC) load(userptr, "glPolygonMode");
2895 glad_glReadBuffer = (PFNGLREADBUFFERPROC) load(userptr, "glReadBuffer");
2896 glad_glReadPixels = (PFNGLREADPIXELSPROC) load(userptr, "glReadPixels");
2897 glad_glScissor = (PFNGLSCISSORPROC) load(userptr, "glScissor");
2898 glad_glStencilFunc = (PFNGLSTENCILFUNCPROC) load(userptr, "glStencilFunc");
2899 glad_glStencilMask = (PFNGLSTENCILMASKPROC) load(userptr, "glStencilMask");
2900 glad_glStencilOp = (PFNGLSTENCILOPPROC) load(userptr, "glStencilOp");
2901 glad_glTexImage1D = (PFNGLTEXIMAGE1DPROC) load(userptr, "glTexImage1D");
2902 glad_glTexImage2D = (PFNGLTEXIMAGE2DPROC) load(userptr, "glTexImage2D");
2903 glad_glTexParameterf = (PFNGLTEXPARAMETERFPROC) load(userptr, "glTexParameterf");
2904 glad_glTexParameterfv = (PFNGLTEXPARAMETERFVPROC) load(userptr, "glTexParameterfv");
2905 glad_glTexParameteri = (PFNGLTEXPARAMETERIPROC) load(userptr, "glTexParameteri");
2906 glad_glTexParameteriv = (PFNGLTEXPARAMETERIVPROC) load(userptr, "glTexParameteriv");
2907 glad_glViewport = (PFNGLVIEWPORTPROC) load(userptr, "glViewport");
2908 }
2909 static void glad_gl_load_GL_VERSION_1_1( GLADuserptrloadfunc load, void* userptr) {
2910 if(!GLAD_GL_VERSION_1_1) return;
2911 glad_glBindTexture = (PFNGLBINDTEXTUREPROC) load(userptr, "glBindTexture");
2912 glad_glCopyTexImage1D = (PFNGLCOPYTEXIMAGE1DPROC) load(userptr, "glCopyTexImage1D");
2913 glad_glCopyTexImage2D = (PFNGLCOPYTEXIMAGE2DPROC) load(userptr, "glCopyTexImage2D");
2914 glad_glCopyTexSubImage1D = (PFNGLCOPYTEXSUBIMAGE1DPROC) load(userptr, "glCopyTexSubImage1D");
2915 glad_glCopyTexSubImage2D = (PFNGLCOPYTEXSUBIMAGE2DPROC) load(userptr, "glCopyTexSubImage2D");
2916 glad_glDeleteTextures = (PFNGLDELETETEXTURESPROC) load(userptr, "glDeleteTextures");
2917 glad_glDrawArrays = (PFNGLDRAWARRAYSPROC) load(userptr, "glDrawArrays");
2918 glad_glDrawElements = (PFNGLDRAWELEMENTSPROC) load(userptr, "glDrawElements");
2919 glad_glGenTextures = (PFNGLGENTEXTURESPROC) load(userptr, "glGenTextures");
2920 glad_glIsTexture = (PFNGLISTEXTUREPROC) load(userptr, "glIsTexture");
2921 glad_glPolygonOffset = (PFNGLPOLYGONOFFSETPROC) load(userptr, "glPolygonOffset");
2922 glad_glTexSubImage1D = (PFNGLTEXSUBIMAGE1DPROC) load(userptr, "glTexSubImage1D");
2923 glad_glTexSubImage2D = (PFNGLTEXSUBIMAGE2DPROC) load(userptr, "glTexSubImage2D");
2924 }
2925 static void glad_gl_load_GL_VERSION_1_2( GLADuserptrloadfunc load, void* userptr) {
2926 if(!GLAD_GL_VERSION_1_2) return;
2927 glad_glCopyTexSubImage3D = (PFNGLCOPYTEXSUBIMAGE3DPROC) load(userptr, "glCopyTexSubImage3D");
2928 glad_glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC) load(userptr, "glDrawRangeElements");
2929 glad_glTexImage3D = (PFNGLTEXIMAGE3DPROC) load(userptr, "glTexImage3D");
2930 glad_glTexSubImage3D = (PFNGLTEXSUBIMAGE3DPROC) load(userptr, "glTexSubImage3D");
2931 }
2932 static void glad_gl_load_GL_VERSION_1_3( GLADuserptrloadfunc load, void* userptr) {
2933 if(!GLAD_GL_VERSION_1_3) return;
2934 glad_glActiveTexture = (PFNGLACTIVETEXTUREPROC) load(userptr, "glActiveTexture");
2935 glad_glCompressedTexImage1D = (PFNGLCOMPRESSEDTEXIMAGE1DPROC) load(userptr, "glCompressedTexImage1D");
2936 glad_glCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC) load(userptr, "glCompressedTexImage2D");
2937 glad_glCompressedTexImage3D = (PFNGLCOMPRESSEDTEXIMAGE3DPROC) load(userptr, "glCompressedTexImage3D");
2938 glad_glCompressedTexSubImage1D = (PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) load(userptr, "glCompressedTexSubImage1D");
2939 glad_glCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) load(userptr, "glCompressedTexSubImage2D");
2940 glad_glCompressedTexSubImage3D = (PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) load(userptr, "glCompressedTexSubImage3D");
2941 glad_glGetCompressedTexImage = (PFNGLGETCOMPRESSEDTEXIMAGEPROC) load(userptr, "glGetCompressedTexImage");
2942 glad_glSampleCoverage = (PFNGLSAMPLECOVERAGEPROC) load(userptr, "glSampleCoverage");
2943 }
2944 static void glad_gl_load_GL_VERSION_1_4( GLADuserptrloadfunc load, void* userptr) {
2945 if(!GLAD_GL_VERSION_1_4) return;
2946 glad_glBlendColor = (PFNGLBLENDCOLORPROC) load(userptr, "glBlendColor");
2947 glad_glBlendEquation = (PFNGLBLENDEQUATIONPROC) load(userptr, "glBlendEquation");
2948 glad_glBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC) load(userptr, "glBlendFuncSeparate");
2949 glad_glMultiDrawArrays = (PFNGLMULTIDRAWARRAYSPROC) load(userptr, "glMultiDrawArrays");
2950 glad_glMultiDrawElements = (PFNGLMULTIDRAWELEMENTSPROC) load(userptr, "glMultiDrawElements");
2951 glad_glPointParameterf = (PFNGLPOINTPARAMETERFPROC) load(userptr, "glPointParameterf");
2952 glad_glPointParameterfv = (PFNGLPOINTPARAMETERFVPROC) load(userptr, "glPointParameterfv");
2953 glad_glPointParameteri = (PFNGLPOINTPARAMETERIPROC) load(userptr, "glPointParameteri");
2954 glad_glPointParameteriv = (PFNGLPOINTPARAMETERIVPROC) load(userptr, "glPointParameteriv");
2955 }
2956 static void glad_gl_load_GL_VERSION_1_5( GLADuserptrloadfunc load, void* userptr) {
2957 if(!GLAD_GL_VERSION_1_5) return;
2958 glad_glBeginQuery = (PFNGLBEGINQUERYPROC) load(userptr, "glBeginQuery");
2959 glad_glBindBuffer = (PFNGLBINDBUFFERPROC) load(userptr, "glBindBuffer");
2960 glad_glBufferData = (PFNGLBUFFERDATAPROC) load(userptr, "glBufferData");
2961 glad_glBufferSubData = (PFNGLBUFFERSUBDATAPROC) load(userptr, "glBufferSubData");
2962 glad_glDeleteBuffers = (PFNGLDELETEBUFFERSPROC) load(userptr, "glDeleteBuffers");
2963 glad_glDeleteQueries = (PFNGLDELETEQUERIESPROC) load(userptr, "glDeleteQueries");
2964 glad_glEndQuery = (PFNGLENDQUERYPROC) load(userptr, "glEndQuery");
2965 glad_glGenBuffers = (PFNGLGENBUFFERSPROC) load(userptr, "glGenBuffers");
2966 glad_glGenQueries = (PFNGLGENQUERIESPROC) load(userptr, "glGenQueries");
2967 glad_glGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC) load(userptr, "glGetBufferParameteriv");
2968 glad_glGetBufferPointerv = (PFNGLGETBUFFERPOINTERVPROC) load(userptr, "glGetBufferPointerv");
2969 glad_glGetBufferSubData = (PFNGLGETBUFFERSUBDATAPROC) load(userptr, "glGetBufferSubData");
2970 glad_glGetQueryObjectiv = (PFNGLGETQUERYOBJECTIVPROC) load(userptr, "glGetQueryObjectiv");
2971 glad_glGetQueryObjectuiv = (PFNGLGETQUERYOBJECTUIVPROC) load(userptr, "glGetQueryObjectuiv");
2972 glad_glGetQueryiv = (PFNGLGETQUERYIVPROC) load(userptr, "glGetQueryiv");
2973 glad_glIsBuffer = (PFNGLISBUFFERPROC) load(userptr, "glIsBuffer");
2974 glad_glIsQuery = (PFNGLISQUERYPROC) load(userptr, "glIsQuery");
2975 glad_glMapBuffer = (PFNGLMAPBUFFERPROC) load(userptr, "glMapBuffer");
2976 glad_glUnmapBuffer = (PFNGLUNMAPBUFFERPROC) load(userptr, "glUnmapBuffer");
2977 }
2978 static void glad_gl_load_GL_VERSION_2_0( GLADuserptrloadfunc load, void* userptr) {
2979 if(!GLAD_GL_VERSION_2_0) return;
2980 glad_glAttachShader = (PFNGLATTACHSHADERPROC) load(userptr, "glAttachShader");
2981 glad_glBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC) load(userptr, "glBindAttribLocation");
2982 glad_glBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC) load(userptr, "glBlendEquationSeparate");
2983 glad_glCompileShader = (PFNGLCOMPILESHADERPROC) load(userptr, "glCompileShader");
2984 glad_glCreateProgram = (PFNGLCREATEPROGRAMPROC) load(userptr, "glCreateProgram");
2985 glad_glCreateShader = (PFNGLCREATESHADERPROC) load(userptr, "glCreateShader");
2986 glad_glDeleteProgram = (PFNGLDELETEPROGRAMPROC) load(userptr, "glDeleteProgram");
2987 glad_glDeleteShader = (PFNGLDELETESHADERPROC) load(userptr, "glDeleteShader");
2988 glad_glDetachShader = (PFNGLDETACHSHADERPROC) load(userptr, "glDetachShader");
2989 glad_glDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC) load(userptr, "glDisableVertexAttribArray");
2990 glad_glDrawBuffers = (PFNGLDRAWBUFFERSPROC) load(userptr, "glDrawBuffers");
2991 glad_glEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC) load(userptr, "glEnableVertexAttribArray");
2992 glad_glGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC) load(userptr, "glGetActiveAttrib");
2993 glad_glGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC) load(userptr, "glGetActiveUniform");
2994 glad_glGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC) load(userptr, "glGetAttachedShaders");
2995 glad_glGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC) load(userptr, "glGetAttribLocation");
2996 glad_glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC) load(userptr, "glGetProgramInfoLog");
2997 glad_glGetProgramiv = (PFNGLGETPROGRAMIVPROC) load(userptr, "glGetProgramiv");
2998 glad_glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC) load(userptr, "glGetShaderInfoLog");
2999 glad_glGetShaderSource = (PFNGLGETSHADERSOURCEPROC) load(userptr, "glGetShaderSource");
3000 glad_glGetShaderiv = (PFNGLGETSHADERIVPROC) load(userptr, "glGetShaderiv");
3001 glad_glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC) load(userptr, "glGetUniformLocation");
3002 glad_glGetUniformfv = (PFNGLGETUNIFORMFVPROC) load(userptr, "glGetUniformfv");
3003 glad_glGetUniformiv = (PFNGLGETUNIFORMIVPROC) load(userptr, "glGetUniformiv");
3004 glad_glGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC) load(userptr, "glGetVertexAttribPointerv");
3005 glad_glGetVertexAttribdv = (PFNGLGETVERTEXATTRIBDVPROC) load(userptr, "glGetVertexAttribdv");
3006 glad_glGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC) load(userptr, "glGetVertexAttribfv");
3007 glad_glGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC) load(userptr, "glGetVertexAttribiv");
3008 glad_glIsProgram = (PFNGLISPROGRAMPROC) load(userptr, "glIsProgram");
3009 glad_glIsShader = (PFNGLISSHADERPROC) load(userptr, "glIsShader");
3010 glad_glLinkProgram = (PFNGLLINKPROGRAMPROC) load(userptr, "glLinkProgram");
3011 glad_glShaderSource = (PFNGLSHADERSOURCEPROC) load(userptr, "glShaderSource");
3012 glad_glStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC) load(userptr, "glStencilFuncSeparate");
3013 glad_glStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC) load(userptr, "glStencilMaskSeparate");
3014 glad_glStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC) load(userptr, "glStencilOpSeparate");
3015 glad_glUniform1f = (PFNGLUNIFORM1FPROC) load(userptr, "glUniform1f");
3016 glad_glUniform1fv = (PFNGLUNIFORM1FVPROC) load(userptr, "glUniform1fv");
3017 glad_glUniform1i = (PFNGLUNIFORM1IPROC) load(userptr, "glUniform1i");
3018 glad_glUniform1iv = (PFNGLUNIFORM1IVPROC) load(userptr, "glUniform1iv");
3019 glad_glUniform2f = (PFNGLUNIFORM2FPROC) load(userptr, "glUniform2f");
3020 glad_glUniform2fv = (PFNGLUNIFORM2FVPROC) load(userptr, "glUniform2fv");
3021 glad_glUniform2i = (PFNGLUNIFORM2IPROC) load(userptr, "glUniform2i");
3022 glad_glUniform2iv = (PFNGLUNIFORM2IVPROC) load(userptr, "glUniform2iv");
3023 glad_glUniform3f = (PFNGLUNIFORM3FPROC) load(userptr, "glUniform3f");
3024 glad_glUniform3fv = (PFNGLUNIFORM3FVPROC) load(userptr, "glUniform3fv");
3025 glad_glUniform3i = (PFNGLUNIFORM3IPROC) load(userptr, "glUniform3i");
3026 glad_glUniform3iv = (PFNGLUNIFORM3IVPROC) load(userptr, "glUniform3iv");
3027 glad_glUniform4f = (PFNGLUNIFORM4FPROC) load(userptr, "glUniform4f");
3028 glad_glUniform4fv = (PFNGLUNIFORM4FVPROC) load(userptr, "glUniform4fv");
3029 glad_glUniform4i = (PFNGLUNIFORM4IPROC) load(userptr, "glUniform4i");
3030 glad_glUniform4iv = (PFNGLUNIFORM4IVPROC) load(userptr, "glUniform4iv");
3031 glad_glUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC) load(userptr, "glUniformMatrix2fv");
3032 glad_glUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC) load(userptr, "glUniformMatrix3fv");
3033 glad_glUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC) load(userptr, "glUniformMatrix4fv");
3034 glad_glUseProgram = (PFNGLUSEPROGRAMPROC) load(userptr, "glUseProgram");
3035 glad_glValidateProgram = (PFNGLVALIDATEPROGRAMPROC) load(userptr, "glValidateProgram");
3036 glad_glVertexAttrib1d = (PFNGLVERTEXATTRIB1DPROC) load(userptr, "glVertexAttrib1d");
3037 glad_glVertexAttrib1dv = (PFNGLVERTEXATTRIB1DVPROC) load(userptr, "glVertexAttrib1dv");
3038 glad_glVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC) load(userptr, "glVertexAttrib1f");
3039 glad_glVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC) load(userptr, "glVertexAttrib1fv");
3040 glad_glVertexAttrib1s = (PFNGLVERTEXATTRIB1SPROC) load(userptr, "glVertexAttrib1s");
3041 glad_glVertexAttrib1sv = (PFNGLVERTEXATTRIB1SVPROC) load(userptr, "glVertexAttrib1sv");
3042 glad_glVertexAttrib2d = (PFNGLVERTEXATTRIB2DPROC) load(userptr, "glVertexAttrib2d");
3043 glad_glVertexAttrib2dv = (PFNGLVERTEXATTRIB2DVPROC) load(userptr, "glVertexAttrib2dv");
3044 glad_glVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC) load(userptr, "glVertexAttrib2f");
3045 glad_glVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC) load(userptr, "glVertexAttrib2fv");
3046 glad_glVertexAttrib2s = (PFNGLVERTEXATTRIB2SPROC) load(userptr, "glVertexAttrib2s");
3047 glad_glVertexAttrib2sv = (PFNGLVERTEXATTRIB2SVPROC) load(userptr, "glVertexAttrib2sv");
3048 glad_glVertexAttrib3d = (PFNGLVERTEXATTRIB3DPROC) load(userptr, "glVertexAttrib3d");
3049 glad_glVertexAttrib3dv = (PFNGLVERTEXATTRIB3DVPROC) load(userptr, "glVertexAttrib3dv");
3050 glad_glVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC) load(userptr, "glVertexAttrib3f");
3051 glad_glVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC) load(userptr, "glVertexAttrib3fv");
3052 glad_glVertexAttrib3s = (PFNGLVERTEXATTRIB3SPROC) load(userptr, "glVertexAttrib3s");
3053 glad_glVertexAttrib3sv = (PFNGLVERTEXATTRIB3SVPROC) load(userptr, "glVertexAttrib3sv");
3054 glad_glVertexAttrib4Nbv = (PFNGLVERTEXATTRIB4NBVPROC) load(userptr, "glVertexAttrib4Nbv");
3055 glad_glVertexAttrib4Niv = (PFNGLVERTEXATTRIB4NIVPROC) load(userptr, "glVertexAttrib4Niv");
3056 glad_glVertexAttrib4Nsv = (PFNGLVERTEXATTRIB4NSVPROC) load(userptr, "glVertexAttrib4Nsv");
3057 glad_glVertexAttrib4Nub = (PFNGLVERTEXATTRIB4NUBPROC) load(userptr, "glVertexAttrib4Nub");
3058 glad_glVertexAttrib4Nubv = (PFNGLVERTEXATTRIB4NUBVPROC) load(userptr, "glVertexAttrib4Nubv");
3059 glad_glVertexAttrib4Nuiv = (PFNGLVERTEXATTRIB4NUIVPROC) load(userptr, "glVertexAttrib4Nuiv");
3060 glad_glVertexAttrib4Nusv = (PFNGLVERTEXATTRIB4NUSVPROC) load(userptr, "glVertexAttrib4Nusv");
3061 glad_glVertexAttrib4bv = (PFNGLVERTEXATTRIB4BVPROC) load(userptr, "glVertexAttrib4bv");
3062 glad_glVertexAttrib4d = (PFNGLVERTEXATTRIB4DPROC) load(userptr, "glVertexAttrib4d");
3063 glad_glVertexAttrib4dv = (PFNGLVERTEXATTRIB4DVPROC) load(userptr, "glVertexAttrib4dv");
3064 glad_glVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC) load(userptr, "glVertexAttrib4f");
3065 glad_glVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC) load(userptr, "glVertexAttrib4fv");
3066 glad_glVertexAttrib4iv = (PFNGLVERTEXATTRIB4IVPROC) load(userptr, "glVertexAttrib4iv");
3067 glad_glVertexAttrib4s = (PFNGLVERTEXATTRIB4SPROC) load(userptr, "glVertexAttrib4s");
3068 glad_glVertexAttrib4sv = (PFNGLVERTEXATTRIB4SVPROC) load(userptr, "glVertexAttrib4sv");
3069 glad_glVertexAttrib4ubv = (PFNGLVERTEXATTRIB4UBVPROC) load(userptr, "glVertexAttrib4ubv");
3070 glad_glVertexAttrib4uiv = (PFNGLVERTEXATTRIB4UIVPROC) load(userptr, "glVertexAttrib4uiv");
3071 glad_glVertexAttrib4usv = (PFNGLVERTEXATTRIB4USVPROC) load(userptr, "glVertexAttrib4usv");
3072 glad_glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC) load(userptr, "glVertexAttribPointer");
3073 }
3074 static void glad_gl_load_GL_VERSION_2_1( GLADuserptrloadfunc load, void* userptr) {
3075 if(!GLAD_GL_VERSION_2_1) return;
3076 glad_glUniformMatrix2x3fv = (PFNGLUNIFORMMATRIX2X3FVPROC) load(userptr, "glUniformMatrix2x3fv");
3077 glad_glUniformMatrix2x4fv = (PFNGLUNIFORMMATRIX2X4FVPROC) load(userptr, "glUniformMatrix2x4fv");
3078 glad_glUniformMatrix3x2fv = (PFNGLUNIFORMMATRIX3X2FVPROC) load(userptr, "glUniformMatrix3x2fv");
3079 glad_glUniformMatrix3x4fv = (PFNGLUNIFORMMATRIX3X4FVPROC) load(userptr, "glUniformMatrix3x4fv");
3080 glad_glUniformMatrix4x2fv = (PFNGLUNIFORMMATRIX4X2FVPROC) load(userptr, "glUniformMatrix4x2fv");
3081 glad_glUniformMatrix4x3fv = (PFNGLUNIFORMMATRIX4X3FVPROC) load(userptr, "glUniformMatrix4x3fv");
3082 }
3083 static void glad_gl_load_GL_VERSION_3_0( GLADuserptrloadfunc load, void* userptr) {
3084 if(!GLAD_GL_VERSION_3_0) return;
3085 glad_glBeginConditionalRender = (PFNGLBEGINCONDITIONALRENDERPROC) load(userptr, "glBeginConditionalRender");
3086 glad_glBeginTransformFeedback = (PFNGLBEGINTRANSFORMFEEDBACKPROC) load(userptr, "glBeginTransformFeedback");
3087 glad_glBindBufferBase = (PFNGLBINDBUFFERBASEPROC) load(userptr, "glBindBufferBase");
3088 glad_glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC) load(userptr, "glBindBufferRange");
3089 glad_glBindFragDataLocation = (PFNGLBINDFRAGDATALOCATIONPROC) load(userptr, "glBindFragDataLocation");
3090 glad_glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC) load(userptr, "glBindFramebuffer");
3091 glad_glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC) load(userptr, "glBindRenderbuffer");
3092 glad_glBindVertexArray = (PFNGLBINDVERTEXARRAYPROC) load(userptr, "glBindVertexArray");
3093 glad_glBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC) load(userptr, "glBlitFramebuffer");
3094 glad_glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC) load(userptr, "glCheckFramebufferStatus");
3095 glad_glClampColor = (PFNGLCLAMPCOLORPROC) load(userptr, "glClampColor");
3096 glad_glClearBufferfi = (PFNGLCLEARBUFFERFIPROC) load(userptr, "glClearBufferfi");
3097 glad_glClearBufferfv = (PFNGLCLEARBUFFERFVPROC) load(userptr, "glClearBufferfv");
3098 glad_glClearBufferiv = (PFNGLCLEARBUFFERIVPROC) load(userptr, "glClearBufferiv");
3099 glad_glClearBufferuiv = (PFNGLCLEARBUFFERUIVPROC) load(userptr, "glClearBufferuiv");
3100 glad_glColorMaski = (PFNGLCOLORMASKIPROC) load(userptr, "glColorMaski");
3101 glad_glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC) load(userptr, "glDeleteFramebuffers");
3102 glad_glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC) load(userptr, "glDeleteRenderbuffers");
3103 glad_glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC) load(userptr, "glDeleteVertexArrays");
3104 glad_glDisablei = (PFNGLDISABLEIPROC) load(userptr, "glDisablei");
3105 glad_glEnablei = (PFNGLENABLEIPROC) load(userptr, "glEnablei");
3106 glad_glEndConditionalRender = (PFNGLENDCONDITIONALRENDERPROC) load(userptr, "glEndConditionalRender");
3107 glad_glEndTransformFeedback = (PFNGLENDTRANSFORMFEEDBACKPROC) load(userptr, "glEndTransformFeedback");
3108 glad_glFlushMappedBufferRange = (PFNGLFLUSHMAPPEDBUFFERRANGEPROC) load(userptr, "glFlushMappedBufferRange");
3109 glad_glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC) load(userptr, "glFramebufferRenderbuffer");
3110 glad_glFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC) load(userptr, "glFramebufferTexture1D");
3111 glad_glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC) load(userptr, "glFramebufferTexture2D");
3112 glad_glFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC) load(userptr, "glFramebufferTexture3D");
3113 glad_glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC) load(userptr, "glFramebufferTextureLayer");
3114 glad_glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC) load(userptr, "glGenFramebuffers");
3115 glad_glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC) load(userptr, "glGenRenderbuffers");
3116 glad_glGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC) load(userptr, "glGenVertexArrays");
3117 glad_glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC) load(userptr, "glGenerateMipmap");
3118 glad_glGetBooleani_v = (PFNGLGETBOOLEANI_VPROC) load(userptr, "glGetBooleani_v");
3119 glad_glGetFragDataLocation = (PFNGLGETFRAGDATALOCATIONPROC) load(userptr, "glGetFragDataLocation");
3120 glad_glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) load(userptr, "glGetFramebufferAttachmentParameteriv");
3121 glad_glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC) load(userptr, "glGetIntegeri_v");
3122 glad_glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC) load(userptr, "glGetRenderbufferParameteriv");
3123 glad_glGetStringi = (PFNGLGETSTRINGIPROC) load(userptr, "glGetStringi");
3124 glad_glGetTexParameterIiv = (PFNGLGETTEXPARAMETERIIVPROC) load(userptr, "glGetTexParameterIiv");
3125 glad_glGetTexParameterIuiv = (PFNGLGETTEXPARAMETERIUIVPROC) load(userptr, "glGetTexParameterIuiv");
3126 glad_glGetTransformFeedbackVarying = (PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) load(userptr, "glGetTransformFeedbackVarying");
3127 glad_glGetUniformuiv = (PFNGLGETUNIFORMUIVPROC) load(userptr, "glGetUniformuiv");
3128 glad_glGetVertexAttribIiv = (PFNGLGETVERTEXATTRIBIIVPROC) load(userptr, "glGetVertexAttribIiv");
3129 glad_glGetVertexAttribIuiv = (PFNGLGETVERTEXATTRIBIUIVPROC) load(userptr, "glGetVertexAttribIuiv");
3130 glad_glIsEnabledi = (PFNGLISENABLEDIPROC) load(userptr, "glIsEnabledi");
3131 glad_glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC) load(userptr, "glIsFramebuffer");
3132 glad_glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC) load(userptr, "glIsRenderbuffer");
3133 glad_glIsVertexArray = (PFNGLISVERTEXARRAYPROC) load(userptr, "glIsVertexArray");
3134 glad_glMapBufferRange = (PFNGLMAPBUFFERRANGEPROC) load(userptr, "glMapBufferRange");
3135 glad_glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC) load(userptr, "glRenderbufferStorage");
3136 glad_glRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) load(userptr, "glRenderbufferStorageMultisample");
3137 glad_glTexParameterIiv = (PFNGLTEXPARAMETERIIVPROC) load(userptr, "glTexParameterIiv");
3138 glad_glTexParameterIuiv = (PFNGLTEXPARAMETERIUIVPROC) load(userptr, "glTexParameterIuiv");
3139 glad_glTransformFeedbackVaryings = (PFNGLTRANSFORMFEEDBACKVARYINGSPROC) load(userptr, "glTransformFeedbackVaryings");
3140 glad_glUniform1ui = (PFNGLUNIFORM1UIPROC) load(userptr, "glUniform1ui");
3141 glad_glUniform1uiv = (PFNGLUNIFORM1UIVPROC) load(userptr, "glUniform1uiv");
3142 glad_glUniform2ui = (PFNGLUNIFORM2UIPROC) load(userptr, "glUniform2ui");
3143 glad_glUniform2uiv = (PFNGLUNIFORM2UIVPROC) load(userptr, "glUniform2uiv");
3144 glad_glUniform3ui = (PFNGLUNIFORM3UIPROC) load(userptr, "glUniform3ui");
3145 glad_glUniform3uiv = (PFNGLUNIFORM3UIVPROC) load(userptr, "glUniform3uiv");
3146 glad_glUniform4ui = (PFNGLUNIFORM4UIPROC) load(userptr, "glUniform4ui");
3147 glad_glUniform4uiv = (PFNGLUNIFORM4UIVPROC) load(userptr, "glUniform4uiv");
3148 glad_glVertexAttribI1i = (PFNGLVERTEXATTRIBI1IPROC) load(userptr, "glVertexAttribI1i");
3149 glad_glVertexAttribI1iv = (PFNGLVERTEXATTRIBI1IVPROC) load(userptr, "glVertexAttribI1iv");
3150 glad_glVertexAttribI1ui = (PFNGLVERTEXATTRIBI1UIPROC) load(userptr, "glVertexAttribI1ui");
3151 glad_glVertexAttribI1uiv = (PFNGLVERTEXATTRIBI1UIVPROC) load(userptr, "glVertexAttribI1uiv");
3152 glad_glVertexAttribI2i = (PFNGLVERTEXATTRIBI2IPROC) load(userptr, "glVertexAttribI2i");
3153 glad_glVertexAttribI2iv = (PFNGLVERTEXATTRIBI2IVPROC) load(userptr, "glVertexAttribI2iv");
3154 glad_glVertexAttribI2ui = (PFNGLVERTEXATTRIBI2UIPROC) load(userptr, "glVertexAttribI2ui");
3155 glad_glVertexAttribI2uiv = (PFNGLVERTEXATTRIBI2UIVPROC) load(userptr, "glVertexAttribI2uiv");
3156 glad_glVertexAttribI3i = (PFNGLVERTEXATTRIBI3IPROC) load(userptr, "glVertexAttribI3i");
3157 glad_glVertexAttribI3iv = (PFNGLVERTEXATTRIBI3IVPROC) load(userptr, "glVertexAttribI3iv");
3158 glad_glVertexAttribI3ui = (PFNGLVERTEXATTRIBI3UIPROC) load(userptr, "glVertexAttribI3ui");
3159 glad_glVertexAttribI3uiv = (PFNGLVERTEXATTRIBI3UIVPROC) load(userptr, "glVertexAttribI3uiv");
3160 glad_glVertexAttribI4bv = (PFNGLVERTEXATTRIBI4BVPROC) load(userptr, "glVertexAttribI4bv");
3161 glad_glVertexAttribI4i = (PFNGLVERTEXATTRIBI4IPROC) load(userptr, "glVertexAttribI4i");
3162 glad_glVertexAttribI4iv = (PFNGLVERTEXATTRIBI4IVPROC) load(userptr, "glVertexAttribI4iv");
3163 glad_glVertexAttribI4sv = (PFNGLVERTEXATTRIBI4SVPROC) load(userptr, "glVertexAttribI4sv");
3164 glad_glVertexAttribI4ubv = (PFNGLVERTEXATTRIBI4UBVPROC) load(userptr, "glVertexAttribI4ubv");
3165 glad_glVertexAttribI4ui = (PFNGLVERTEXATTRIBI4UIPROC) load(userptr, "glVertexAttribI4ui");
3166 glad_glVertexAttribI4uiv = (PFNGLVERTEXATTRIBI4UIVPROC) load(userptr, "glVertexAttribI4uiv");
3167 glad_glVertexAttribI4usv = (PFNGLVERTEXATTRIBI4USVPROC) load(userptr, "glVertexAttribI4usv");
3168 glad_glVertexAttribIPointer = (PFNGLVERTEXATTRIBIPOINTERPROC) load(userptr, "glVertexAttribIPointer");
3169 }
3170 static void glad_gl_load_GL_VERSION_3_1( GLADuserptrloadfunc load, void* userptr) {
3171 if(!GLAD_GL_VERSION_3_1) return;
3172 glad_glBindBufferBase = (PFNGLBINDBUFFERBASEPROC) load(userptr, "glBindBufferBase");
3173 glad_glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC) load(userptr, "glBindBufferRange");
3174 glad_glCopyBufferSubData = (PFNGLCOPYBUFFERSUBDATAPROC) load(userptr, "glCopyBufferSubData");
3175 glad_glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDPROC) load(userptr, "glDrawArraysInstanced");
3176 glad_glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDPROC) load(userptr, "glDrawElementsInstanced");
3177 glad_glGetActiveUniformBlockName = (PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) load(userptr, "glGetActiveUniformBlockName");
3178 glad_glGetActiveUniformBlockiv = (PFNGLGETACTIVEUNIFORMBLOCKIVPROC) load(userptr, "glGetActiveUniformBlockiv");
3179 glad_glGetActiveUniformName = (PFNGLGETACTIVEUNIFORMNAMEPROC) load(userptr, "glGetActiveUniformName");
3180 glad_glGetActiveUniformsiv = (PFNGLGETACTIVEUNIFORMSIVPROC) load(userptr, "glGetActiveUniformsiv");
3181 glad_glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC) load(userptr, "glGetIntegeri_v");
3182 glad_glGetUniformBlockIndex = (PFNGLGETUNIFORMBLOCKINDEXPROC) load(userptr, "glGetUniformBlockIndex");
3183 glad_glGetUniformIndices = (PFNGLGETUNIFORMINDICESPROC) load(userptr, "glGetUniformIndices");
3184 glad_glPrimitiveRestartIndex = (PFNGLPRIMITIVERESTARTINDEXPROC) load(userptr, "glPrimitiveRestartIndex");
3185 glad_glTexBuffer = (PFNGLTEXBUFFERPROC) load(userptr, "glTexBuffer");
3186 glad_glUniformBlockBinding = (PFNGLUNIFORMBLOCKBINDINGPROC) load(userptr, "glUniformBlockBinding");
3187 }
3188 static void glad_gl_load_GL_VERSION_3_2( GLADuserptrloadfunc load, void* userptr) {
3189 if(!GLAD_GL_VERSION_3_2) return;
3190 glad_glClientWaitSync = (PFNGLCLIENTWAITSYNCPROC) load(userptr, "glClientWaitSync");
3191 glad_glDeleteSync = (PFNGLDELETESYNCPROC) load(userptr, "glDeleteSync");
3192 glad_glDrawElementsBaseVertex = (PFNGLDRAWELEMENTSBASEVERTEXPROC) load(userptr, "glDrawElementsBaseVertex");
3193 glad_glDrawElementsInstancedBaseVertex = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) load(userptr, "glDrawElementsInstancedBaseVertex");
3194 glad_glDrawRangeElementsBaseVertex = (PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC) load(userptr, "glDrawRangeElementsBaseVertex");
3195 glad_glFenceSync = (PFNGLFENCESYNCPROC) load(userptr, "glFenceSync");
3196 glad_glFramebufferTexture = (PFNGLFRAMEBUFFERTEXTUREPROC) load(userptr, "glFramebufferTexture");
3197 glad_glGetBufferParameteri64v = (PFNGLGETBUFFERPARAMETERI64VPROC) load(userptr, "glGetBufferParameteri64v");
3198 glad_glGetInteger64i_v = (PFNGLGETINTEGER64I_VPROC) load(userptr, "glGetInteger64i_v");
3199 glad_glGetInteger64v = (PFNGLGETINTEGER64VPROC) load(userptr, "glGetInteger64v");
3200 glad_glGetMultisamplefv = (PFNGLGETMULTISAMPLEFVPROC) load(userptr, "glGetMultisamplefv");
3201 glad_glGetSynciv = (PFNGLGETSYNCIVPROC) load(userptr, "glGetSynciv");
3202 glad_glIsSync = (PFNGLISSYNCPROC) load(userptr, "glIsSync");
3203 glad_glMultiDrawElementsBaseVertex = (PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) load(userptr, "glMultiDrawElementsBaseVertex");
3204 glad_glProvokingVertex = (PFNGLPROVOKINGVERTEXPROC) load(userptr, "glProvokingVertex");
3205 glad_glSampleMaski = (PFNGLSAMPLEMASKIPROC) load(userptr, "glSampleMaski");
3206 glad_glTexImage2DMultisample = (PFNGLTEXIMAGE2DMULTISAMPLEPROC) load(userptr, "glTexImage2DMultisample");
3207 glad_glTexImage3DMultisample = (PFNGLTEXIMAGE3DMULTISAMPLEPROC) load(userptr, "glTexImage3DMultisample");
3208 glad_glWaitSync = (PFNGLWAITSYNCPROC) load(userptr, "glWaitSync");
3209 }
3210 static void glad_gl_load_GL_VERSION_3_3( GLADuserptrloadfunc load, void* userptr) {
3211 if(!GLAD_GL_VERSION_3_3) return;
3212 glad_glBindFragDataLocationIndexed = (PFNGLBINDFRAGDATALOCATIONINDEXEDPROC) load(userptr, "glBindFragDataLocationIndexed");
3213 glad_glBindSampler = (PFNGLBINDSAMPLERPROC) load(userptr, "glBindSampler");
3214 glad_glDeleteSamplers = (PFNGLDELETESAMPLERSPROC) load(userptr, "glDeleteSamplers");
3215 glad_glGenSamplers = (PFNGLGENSAMPLERSPROC) load(userptr, "glGenSamplers");
3216 glad_glGetFragDataIndex = (PFNGLGETFRAGDATAINDEXPROC) load(userptr, "glGetFragDataIndex");
3217 glad_glGetQueryObjecti64v = (PFNGLGETQUERYOBJECTI64VPROC) load(userptr, "glGetQueryObjecti64v");
3218 glad_glGetQueryObjectui64v = (PFNGLGETQUERYOBJECTUI64VPROC) load(userptr, "glGetQueryObjectui64v");
3219 glad_glGetSamplerParameterIiv = (PFNGLGETSAMPLERPARAMETERIIVPROC) load(userptr, "glGetSamplerParameterIiv");
3220 glad_glGetSamplerParameterIuiv = (PFNGLGETSAMPLERPARAMETERIUIVPROC) load(userptr, "glGetSamplerParameterIuiv");
3221 glad_glGetSamplerParameterfv = (PFNGLGETSAMPLERPARAMETERFVPROC) load(userptr, "glGetSamplerParameterfv");
3222 glad_glGetSamplerParameteriv = (PFNGLGETSAMPLERPARAMETERIVPROC) load(userptr, "glGetSamplerParameteriv");
3223 glad_glIsSampler = (PFNGLISSAMPLERPROC) load(userptr, "glIsSampler");
3224 glad_glQueryCounter = (PFNGLQUERYCOUNTERPROC) load(userptr, "glQueryCounter");
3225 glad_glSamplerParameterIiv = (PFNGLSAMPLERPARAMETERIIVPROC) load(userptr, "glSamplerParameterIiv");
3226 glad_glSamplerParameterIuiv = (PFNGLSAMPLERPARAMETERIUIVPROC) load(userptr, "glSamplerParameterIuiv");
3227 glad_glSamplerParameterf = (PFNGLSAMPLERPARAMETERFPROC) load(userptr, "glSamplerParameterf");
3228 glad_glSamplerParameterfv = (PFNGLSAMPLERPARAMETERFVPROC) load(userptr, "glSamplerParameterfv");
3229 glad_glSamplerParameteri = (PFNGLSAMPLERPARAMETERIPROC) load(userptr, "glSamplerParameteri");
3230 glad_glSamplerParameteriv = (PFNGLSAMPLERPARAMETERIVPROC) load(userptr, "glSamplerParameteriv");
3231 glad_glVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISORPROC) load(userptr, "glVertexAttribDivisor");
3232 glad_glVertexAttribP1ui = (PFNGLVERTEXATTRIBP1UIPROC) load(userptr, "glVertexAttribP1ui");
3233 glad_glVertexAttribP1uiv = (PFNGLVERTEXATTRIBP1UIVPROC) load(userptr, "glVertexAttribP1uiv");
3234 glad_glVertexAttribP2ui = (PFNGLVERTEXATTRIBP2UIPROC) load(userptr, "glVertexAttribP2ui");
3235 glad_glVertexAttribP2uiv = (PFNGLVERTEXATTRIBP2UIVPROC) load(userptr, "glVertexAttribP2uiv");
3236 glad_glVertexAttribP3ui = (PFNGLVERTEXATTRIBP3UIPROC) load(userptr, "glVertexAttribP3ui");
3237 glad_glVertexAttribP3uiv = (PFNGLVERTEXATTRIBP3UIVPROC) load(userptr, "glVertexAttribP3uiv");
3238 glad_glVertexAttribP4ui = (PFNGLVERTEXATTRIBP4UIPROC) load(userptr, "glVertexAttribP4ui");
3239 glad_glVertexAttribP4uiv = (PFNGLVERTEXATTRIBP4UIVPROC) load(userptr, "glVertexAttribP4uiv");
3240 }
3241
3242
3243
3244 #if defined(GL_ES_VERSION_3_0) || defined(GL_VERSION_3_0)
3245 #define GLAD_GL_IS_SOME_NEW_VERSION 1
3246 #else
3247 #define GLAD_GL_IS_SOME_NEW_VERSION 0
3248 #endif
3249
3250 static int glad_gl_get_extensions( int version, const char **out_exts, unsigned int *out_num_exts_i, char ***out_exts_i) {
3251 #if GLAD_GL_IS_SOME_NEW_VERSION
3252 if(GLAD_VERSION_MAJOR(version) < 3) {
3253 #else
3254 (void) version;
3255 (void) out_num_exts_i;
3256 (void) out_exts_i;
3257 #endif
3258 if (glad_glGetString == NULL) {
3259 return 0;
3260 }
3261 *out_exts = (const char *)glad_glGetString(GL_EXTENSIONS);
3262 #if GLAD_GL_IS_SOME_NEW_VERSION
3263 } else {
3264 unsigned int index = 0;
3265 unsigned int num_exts_i = 0;
3266 char **exts_i = NULL;
3267 if (glad_glGetStringi == NULL || glad_glGetIntegerv == NULL) {
3268 return 0;
3269 }
3270 glad_glGetIntegerv(GL_NUM_EXTENSIONS, (int*) &num_exts_i);
3271 if (num_exts_i > 0) {
3272 exts_i = (char **) malloc(num_exts_i * (sizeof *exts_i));
3273 }
3274 if (exts_i == NULL) {
3275 return 0;
3276 }
3277 for(index = 0; index < num_exts_i; index++) {
3278 const char *gl_str_tmp = (const char*) glad_glGetStringi(GL_EXTENSIONS, index);
3279 size_t len = strlen(gl_str_tmp) + 1;
3280
3281 char *local_str = (char*) malloc(len * sizeof(char));
3282 if(local_str != NULL) {
3283 memcpy(local_str, gl_str_tmp, len * sizeof(char));
3284 }
3285
3286 exts_i[index] = local_str;
3287 }
3288
3289 *out_num_exts_i = num_exts_i;
3290 *out_exts_i = exts_i;
3291 }
3292 #endif
3293 return 1;
3294 }
3295 static void glad_gl_free_extensions(char **exts_i, unsigned int num_exts_i) {
3296 if (exts_i != NULL) {
3297 unsigned int index;
3298 for(index = 0; index < num_exts_i; index++) {
3299 free((void *) (exts_i[index]));
3300 }
3301 free((void *)exts_i);
3302 exts_i = NULL;
3303 }
3304 }
3305 static int glad_gl_has_extension(int version, const char *exts, unsigned int num_exts_i, char **exts_i, const char *ext) {
3306 if(GLAD_VERSION_MAJOR(version) < 3 || !GLAD_GL_IS_SOME_NEW_VERSION) {
3307 const char *extensions;
3308 const char *loc;
3309 const char *terminator;
3310 extensions = exts;
3311 if(extensions == NULL || ext == NULL) {
3312 return 0;
3313 }
3314 while(1) {
3315 loc = strstr(extensions, ext);
3316 if(loc == NULL) {
3317 return 0;
3318 }
3319 terminator = loc + strlen(ext);
3320 if((loc == extensions || *(loc - 1) == ' ') &&
3321 (*terminator == ' ' || *terminator == '\0')) {
3322 return 1;
3323 }
3324 extensions = terminator;
3325 }
3326 } else {
3327 unsigned int index;
3328 for(index = 0; index < num_exts_i; index++) {
3329 const char *e = exts_i[index];
3330 if(strcmp(e, ext) == 0) {
3331 return 1;
3332 }
3333 }
3334 }
3335 return 0;
3336 }
3337
3338 static GLADapiproc glad_gl_get_proc_from_userptr(void *userptr, const char* name) {
3339 return (GLAD_GNUC_EXTENSION (GLADapiproc (*)(const char *name)) userptr)(name);
3340 }
3341
3342 static int glad_gl_find_extensions_gl( int version) {
3343 const char *exts = NULL;
3344 unsigned int num_exts_i = 0;
3345 char **exts_i = NULL;
3346 if (!glad_gl_get_extensions(version, &exts, &num_exts_i, &exts_i)) return 0;
3347
3348 (void) glad_gl_has_extension;
3349
3350 glad_gl_free_extensions(exts_i, num_exts_i);
3351
3352 return 1;
3353 }
3354
3355 static int glad_gl_find_core_gl(void) {
3356 int i, major, minor;
3357 const char* version;
3358 const char* prefixes[] = {
3359 "OpenGL ES-CM ",
3360 "OpenGL ES-CL ",
3361 "OpenGL ES ",
3362 NULL
3363 };
3364 version = (const char*) glad_glGetString(GL_VERSION);
3365 if (!version) return 0;
3366 for (i = 0; prefixes[i]; i++) {
3367 const size_t length = strlen(prefixes[i]);
3368 if (strncmp(version, prefixes[i], length) == 0) {
3369 version += length;
3370 break;
3371 }
3372 }
3373
3374 GLAD_IMPL_UTIL_SSCANF(version, "%d.%d", &major, &minor);
3375
3376 GLAD_GL_VERSION_1_0 = (major == 1 && minor >= 0) || major > 1;
3377 GLAD_GL_VERSION_1_1 = (major == 1 && minor >= 1) || major > 1;
3378 GLAD_GL_VERSION_1_2 = (major == 1 && minor >= 2) || major > 1;
3379 GLAD_GL_VERSION_1_3 = (major == 1 && minor >= 3) || major > 1;
3380 GLAD_GL_VERSION_1_4 = (major == 1 && minor >= 4) || major > 1;
3381 GLAD_GL_VERSION_1_5 = (major == 1 && minor >= 5) || major > 1;
3382 GLAD_GL_VERSION_2_0 = (major == 2 && minor >= 0) || major > 2;
3383 GLAD_GL_VERSION_2_1 = (major == 2 && minor >= 1) || major > 2;
3384 GLAD_GL_VERSION_3_0 = (major == 3 && minor >= 0) || major > 3;
3385 GLAD_GL_VERSION_3_1 = (major == 3 && minor >= 1) || major > 3;
3386 GLAD_GL_VERSION_3_2 = (major == 3 && minor >= 2) || major > 3;
3387 GLAD_GL_VERSION_3_3 = (major == 3 && minor >= 3) || major > 3;
3388
3389 return GLAD_MAKE_VERSION(major, minor);
3390 }
3391
3392 int gladLoadGLUserPtr( GLADuserptrloadfunc load, void *userptr) {
3393 int version;
3394
3395 glad_glGetString = (PFNGLGETSTRINGPROC) load(userptr, "glGetString");
3396 if(glad_glGetString == NULL) return 0;
3397 if(glad_glGetString(GL_VERSION) == NULL) return 0;
3398 version = glad_gl_find_core_gl();
3399
3400 glad_gl_load_GL_VERSION_1_0(load, userptr);
3401 glad_gl_load_GL_VERSION_1_1(load, userptr);
3402 glad_gl_load_GL_VERSION_1_2(load, userptr);
3403 glad_gl_load_GL_VERSION_1_3(load, userptr);
3404 glad_gl_load_GL_VERSION_1_4(load, userptr);
3405 glad_gl_load_GL_VERSION_1_5(load, userptr);
3406 glad_gl_load_GL_VERSION_2_0(load, userptr);
3407 glad_gl_load_GL_VERSION_2_1(load, userptr);
3408 glad_gl_load_GL_VERSION_3_0(load, userptr);
3409 glad_gl_load_GL_VERSION_3_1(load, userptr);
3410 glad_gl_load_GL_VERSION_3_2(load, userptr);
3411 glad_gl_load_GL_VERSION_3_3(load, userptr);
3412
3413 if (!glad_gl_find_extensions_gl(version)) return 0;
3414
3415
3416
3417 return version;
3418 }
3419
3420
3421 int gladLoadGL( GLADloadfunc load) {
3422 return gladLoadGLUserPtr( glad_gl_get_proc_from_userptr, GLAD_GNUC_EXTENSION (void*) load);
3423 }
3424
3425
3426
3427
3428
3429 #ifdef GLAD_GL
3430
3431 #ifndef GLAD_LOADER_LIBRARY_C_
3432 #define GLAD_LOADER_LIBRARY_C_
3433
3434 #include <stddef.h>
3435 #include <stdlib.h>
3436
3437 #if GLAD_PLATFORM_WIN32
3438 #include <windows.h>
3439 #else
3440 #include <dlfcn.h>
3441 #endif
3442
3443
3444 static void* glad_get_dlopen_handle(const char *lib_names[], int length) {
3445 void *handle = NULL;
3446 int i;
3447
3448 for (i = 0; i < length; ++i) {
3449 #if GLAD_PLATFORM_WIN32
3450 #if GLAD_PLATFORM_UWP
3451 size_t buffer_size = (strlen(lib_names[i]) + 1) * sizeof(WCHAR);
3452 LPWSTR buffer = (LPWSTR) malloc(buffer_size);
3453 if (buffer != NULL) {
3454 int ret = MultiByteToWideChar(CP_ACP, 0, lib_names[i], -1, buffer, buffer_size);
3455 if (ret != 0) {
3456 handle = (void*) LoadPackagedLibrary(buffer, 0);
3457 }
3458 free((void*) buffer);
3459 }
3460 #else
3461 handle = (void*) LoadLibraryA(lib_names[i]);
3462 #endif
3463 #else
3464 handle = dlopen(lib_names[i], RTLD_LAZY | RTLD_LOCAL);
3465 #endif
3466 if (handle != NULL) {
3467 return handle;
3468 }
3469 }
3470
3471 return NULL;
3472 }
3473
3474 static void glad_close_dlopen_handle(void* handle) {
3475 if (handle != NULL) {
3476 #if GLAD_PLATFORM_WIN32
3477 FreeLibrary((HMODULE) handle);
3478 #else
3479 dlclose(handle);
3480 #endif
3481 }
3482 }
3483
3484 static GLADapiproc glad_dlsym_handle(void* handle, const char *name) {
3485 if (handle == NULL) {
3486 return NULL;
3487 }
3488
3489 #if GLAD_PLATFORM_WIN32
3490 return (GLADapiproc) GetProcAddress((HMODULE) handle, name);
3491 #else
3492 return GLAD_GNUC_EXTENSION (GLADapiproc) dlsym(handle, name);
3493 #endif
3494 }
3495
3496 #endif /* GLAD_LOADER_LIBRARY_C_ */
3497
3498 typedef void* (GLAD_API_PTR *GLADglprocaddrfunc)(const char*);
3499 struct _glad_gl_userptr {
3500 void *handle;
3501 GLADglprocaddrfunc gl_get_proc_address_ptr;
3502 };
3503
3504 static GLADapiproc glad_gl_get_proc(void *vuserptr, const char *name) {
3505 struct _glad_gl_userptr userptr = *(struct _glad_gl_userptr*) vuserptr;
3506 GLADapiproc result = NULL;
3507
3508 if(userptr.gl_get_proc_address_ptr != NULL) {
3509 result = GLAD_GNUC_EXTENSION (GLADapiproc) userptr.gl_get_proc_address_ptr(name);
3510 }
3511 if(result == NULL) {
3512 result = glad_dlsym_handle(userptr.handle, name);
3513 }
3514
3515 return result;
3516 }
3517
3518 static void* _gl_handle = NULL;
3519
3520 static void* glad_gl_dlopen_handle(void) {
3521 #if GLAD_PLATFORM_APPLE
3522 static const char *NAMES[] = {
3523 "../Frameworks/OpenGL.framework/OpenGL",
3524 "/Library/Frameworks/OpenGL.framework/OpenGL",
3525 "/System/Library/Frameworks/OpenGL.framework/OpenGL",
3526 "/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL"
3527 };
3528 #elif GLAD_PLATFORM_WIN32
3529 static const char *NAMES[] = {"opengl32.dll"};
3530 #else
3531 static const char *NAMES[] = {
3532 #if defined(__CYGWIN__)
3533 "libGL-1.so",
3534 #endif
3535 "libGL.so.1",
3536 "libGL.so"
3537 };
3538 #endif
3539
3540 if (_gl_handle == NULL) {
3541 _gl_handle = glad_get_dlopen_handle(NAMES, sizeof(NAMES) / sizeof(NAMES[0]));
3542 }
3543
3544 return _gl_handle;
3545 }
3546
3547 static struct _glad_gl_userptr glad_gl_build_userptr(void *handle) {
3548 struct _glad_gl_userptr userptr;
3549
3550 userptr.handle = handle;
3551 #if GLAD_PLATFORM_APPLE || defined(__HAIKU__)
3552 userptr.gl_get_proc_address_ptr = NULL;
3553 #elif GLAD_PLATFORM_WIN32
3554 userptr.gl_get_proc_address_ptr =
3555 (GLADglprocaddrfunc) glad_dlsym_handle(handle, "wglGetProcAddress");
3556 #else
3557 userptr.gl_get_proc_address_ptr =
3558 (GLADglprocaddrfunc) glad_dlsym_handle(handle, "glXGetProcAddressARB");
3559 #endif
3560
3561 return userptr;
3562 }
3563
3564 int gladLoaderLoadGL(void) {
3565 int version = 0;
3566 void *handle;
3567 int did_load = 0;
3568 struct _glad_gl_userptr userptr;
3569
3570 did_load = _gl_handle == NULL;
3571 handle = glad_gl_dlopen_handle();
3572 if (handle) {
3573 userptr = glad_gl_build_userptr(handle);
3574
3575 version = gladLoadGLUserPtr(glad_gl_get_proc, &userptr);
3576
3577 if (did_load) {
3578 gladLoaderUnloadGL();
3579 }
3580 }
3581
3582 return version;
3583 }
3584
3585
3586
3587 void gladLoaderUnloadGL(void) {
3588 if (_gl_handle != NULL) {
3589 glad_close_dlopen_handle(_gl_handle);
3590 _gl_handle = NULL;
3591 }
3592 }
3593
3594 #endif /* GLAD_GL */
3595
3596 #ifdef __cplusplus
3597 }
3598 #endif
3599
3600 #endif /* GLAD_GL_IMPLEMENTATION */
3601
File include/glad/gles3.h added (mode: 100644) (index 0000000..c8e2f2f)
1 /**
2 * Loader generated by glad 2.0.0-beta on Wed May 26 10:26:46 2021
3 *
4 * Generator: C/C++
5 * Specification: gl
6 * Extensions: 0
7 *
8 * APIs:
9 * - gles2=3.0
10 *
11 * Options:
12 * - ALIAS = False
13 * - DEBUG = False
14 * - HEADER_ONLY = True
15 * - LOADER = True
16 * - MX = False
17 * - MX_GLOBAL = False
18 * - ON_DEMAND = False
19 *
20 * Commandline:
21 * --api='gles2=3.0' --extensions='' c --header-only --loader
22 *
23 * Online:
24 * http://glad.sh/#api=gles2%3D3.0&extensions=&generator=c&options=HEADER_ONLY%2CLOADER
25 *
26 */
27
28 #ifndef GLAD_GLES2_H_
29 #define GLAD_GLES2_H_
30
31 #ifdef __clang__
32 #pragma clang diagnostic push
33 #pragma clang diagnostic ignored "-Wreserved-id-macro"
34 #endif
35 #ifdef __gl2_h_
36 #error OpenGL ES 2 header already included (API: gles2), remove previous include!
37 #endif
38 #define __gl2_h_ 1
39 #ifdef __gl3_h_
40 #error OpenGL ES 3 header already included (API: gles2), remove previous include!
41 #endif
42 #define __gl3_h_ 1
43 #ifdef __clang__
44 #pragma clang diagnostic pop
45 #endif
46
47 #define GLAD_GLES2
48 #define GLAD_OPTION_GLES2_HEADER_ONLY
49 #define GLAD_OPTION_GLES2_LOADER
50
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54
55 #ifndef GLAD_PLATFORM_H_
56 #define GLAD_PLATFORM_H_
57
58 #ifndef GLAD_PLATFORM_WIN32
59 #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__MINGW32__)
60 #define GLAD_PLATFORM_WIN32 1
61 #else
62 #define GLAD_PLATFORM_WIN32 0
63 #endif
64 #endif
65
66 #ifndef GLAD_PLATFORM_APPLE
67 #ifdef __APPLE__
68 #define GLAD_PLATFORM_APPLE 1
69 #else
70 #define GLAD_PLATFORM_APPLE 0
71 #endif
72 #endif
73
74 #ifndef GLAD_PLATFORM_EMSCRIPTEN
75 #ifdef __EMSCRIPTEN__
76 #define GLAD_PLATFORM_EMSCRIPTEN 1
77 #else
78 #define GLAD_PLATFORM_EMSCRIPTEN 0
79 #endif
80 #endif
81
82 #ifndef GLAD_PLATFORM_UWP
83 #if defined(_MSC_VER) && !defined(GLAD_INTERNAL_HAVE_WINAPIFAMILY)
84 #ifdef __has_include
85 #if __has_include(<winapifamily.h>)
86 #define GLAD_INTERNAL_HAVE_WINAPIFAMILY 1
87 #endif
88 #elif _MSC_VER >= 1700 && !_USING_V110_SDK71_
89 #define GLAD_INTERNAL_HAVE_WINAPIFAMILY 1
90 #endif
91 #endif
92
93 #ifdef GLAD_INTERNAL_HAVE_WINAPIFAMILY
94 #include <winapifamily.h>
95 #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
96 #define GLAD_PLATFORM_UWP 1
97 #endif
98 #endif
99
100 #ifndef GLAD_PLATFORM_UWP
101 #define GLAD_PLATFORM_UWP 0
102 #endif
103 #endif
104
105 #ifdef __GNUC__
106 #define GLAD_GNUC_EXTENSION __extension__
107 #else
108 #define GLAD_GNUC_EXTENSION
109 #endif
110
111 #ifndef GLAD_API_CALL
112 #if defined(GLAD_API_CALL_EXPORT)
113 #if GLAD_PLATFORM_WIN32 || defined(__CYGWIN__)
114 #if defined(GLAD_API_CALL_EXPORT_BUILD)
115 #if defined(__GNUC__)
116 #define GLAD_API_CALL __attribute__ ((dllexport)) extern
117 #else
118 #define GLAD_API_CALL __declspec(dllexport) extern
119 #endif
120 #else
121 #if defined(__GNUC__)
122 #define GLAD_API_CALL __attribute__ ((dllimport)) extern
123 #else
124 #define GLAD_API_CALL __declspec(dllimport) extern
125 #endif
126 #endif
127 #elif defined(__GNUC__) && defined(GLAD_API_CALL_EXPORT_BUILD)
128 #define GLAD_API_CALL __attribute__ ((visibility ("default"))) extern
129 #else
130 #define GLAD_API_CALL extern
131 #endif
132 #else
133 #define GLAD_API_CALL extern
134 #endif
135 #endif
136
137 #ifdef APIENTRY
138 #define GLAD_API_PTR APIENTRY
139 #elif GLAD_PLATFORM_WIN32
140 #define GLAD_API_PTR __stdcall
141 #else
142 #define GLAD_API_PTR
143 #endif
144
145 #ifndef GLAPI
146 #define GLAPI GLAD_API_CALL
147 #endif
148
149 #ifndef GLAPIENTRY
150 #define GLAPIENTRY GLAD_API_PTR
151 #endif
152
153 #define GLAD_MAKE_VERSION(major, minor) (major * 10000 + minor)
154 #define GLAD_VERSION_MAJOR(version) (version / 10000)
155 #define GLAD_VERSION_MINOR(version) (version % 10000)
156
157 #define GLAD_GENERATOR_VERSION "2.0.0-beta"
158
159 typedef void (*GLADapiproc)(void);
160
161 typedef GLADapiproc (*GLADloadfunc)(const char *name);
162 typedef GLADapiproc (*GLADuserptrloadfunc)(void *userptr, const char *name);
163
164 typedef void (*GLADprecallback)(const char *name, GLADapiproc apiproc, int len_args, ...);
165 typedef void (*GLADpostcallback)(void *ret, const char *name, GLADapiproc apiproc, int len_args, ...);
166
167 #endif /* GLAD_PLATFORM_H_ */
168
169 #define GL_ACTIVE_ATTRIBUTES 0x8B89
170 #define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
171 #define GL_ACTIVE_TEXTURE 0x84E0
172 #define GL_ACTIVE_UNIFORMS 0x8B86
173 #define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36
174 #define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35
175 #define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
176 #define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
177 #define GL_ALIASED_POINT_SIZE_RANGE 0x846D
178 #define GL_ALPHA 0x1906
179 #define GL_ALPHA_BITS 0x0D55
180 #define GL_ALREADY_SIGNALED 0x911A
181 #define GL_ALWAYS 0x0207
182 #define GL_ANY_SAMPLES_PASSED 0x8C2F
183 #define GL_ANY_SAMPLES_PASSED_CONSERVATIVE 0x8D6A
184 #define GL_ARRAY_BUFFER 0x8892
185 #define GL_ARRAY_BUFFER_BINDING 0x8894
186 #define GL_ATTACHED_SHADERS 0x8B85
187 #define GL_BACK 0x0405
188 #define GL_BLEND 0x0BE2
189 #define GL_BLEND_COLOR 0x8005
190 #define GL_BLEND_DST_ALPHA 0x80CA
191 #define GL_BLEND_DST_RGB 0x80C8
192 #define GL_BLEND_EQUATION 0x8009
193 #define GL_BLEND_EQUATION_ALPHA 0x883D
194 #define GL_BLEND_EQUATION_RGB 0x8009
195 #define GL_BLEND_SRC_ALPHA 0x80CB
196 #define GL_BLEND_SRC_RGB 0x80C9
197 #define GL_BLUE 0x1905
198 #define GL_BLUE_BITS 0x0D54
199 #define GL_BOOL 0x8B56
200 #define GL_BOOL_VEC2 0x8B57
201 #define GL_BOOL_VEC3 0x8B58
202 #define GL_BOOL_VEC4 0x8B59
203 #define GL_BUFFER_ACCESS_FLAGS 0x911F
204 #define GL_BUFFER_MAPPED 0x88BC
205 #define GL_BUFFER_MAP_LENGTH 0x9120
206 #define GL_BUFFER_MAP_OFFSET 0x9121
207 #define GL_BUFFER_MAP_POINTER 0x88BD
208 #define GL_BUFFER_SIZE 0x8764
209 #define GL_BUFFER_USAGE 0x8765
210 #define GL_BYTE 0x1400
211 #define GL_CCW 0x0901
212 #define GL_CLAMP_TO_EDGE 0x812F
213 #define GL_COLOR 0x1800
214 #define GL_COLOR_ATTACHMENT0 0x8CE0
215 #define GL_COLOR_ATTACHMENT1 0x8CE1
216 #define GL_COLOR_ATTACHMENT10 0x8CEA
217 #define GL_COLOR_ATTACHMENT11 0x8CEB
218 #define GL_COLOR_ATTACHMENT12 0x8CEC
219 #define GL_COLOR_ATTACHMENT13 0x8CED
220 #define GL_COLOR_ATTACHMENT14 0x8CEE
221 #define GL_COLOR_ATTACHMENT15 0x8CEF
222 #define GL_COLOR_ATTACHMENT16 0x8CF0
223 #define GL_COLOR_ATTACHMENT17 0x8CF1
224 #define GL_COLOR_ATTACHMENT18 0x8CF2
225 #define GL_COLOR_ATTACHMENT19 0x8CF3
226 #define GL_COLOR_ATTACHMENT2 0x8CE2
227 #define GL_COLOR_ATTACHMENT20 0x8CF4
228 #define GL_COLOR_ATTACHMENT21 0x8CF5
229 #define GL_COLOR_ATTACHMENT22 0x8CF6
230 #define GL_COLOR_ATTACHMENT23 0x8CF7
231 #define GL_COLOR_ATTACHMENT24 0x8CF8
232 #define GL_COLOR_ATTACHMENT25 0x8CF9
233 #define GL_COLOR_ATTACHMENT26 0x8CFA
234 #define GL_COLOR_ATTACHMENT27 0x8CFB
235 #define GL_COLOR_ATTACHMENT28 0x8CFC
236 #define GL_COLOR_ATTACHMENT29 0x8CFD
237 #define GL_COLOR_ATTACHMENT3 0x8CE3
238 #define GL_COLOR_ATTACHMENT30 0x8CFE
239 #define GL_COLOR_ATTACHMENT31 0x8CFF
240 #define GL_COLOR_ATTACHMENT4 0x8CE4
241 #define GL_COLOR_ATTACHMENT5 0x8CE5
242 #define GL_COLOR_ATTACHMENT6 0x8CE6
243 #define GL_COLOR_ATTACHMENT7 0x8CE7
244 #define GL_COLOR_ATTACHMENT8 0x8CE8
245 #define GL_COLOR_ATTACHMENT9 0x8CE9
246 #define GL_COLOR_BUFFER_BIT 0x00004000
247 #define GL_COLOR_CLEAR_VALUE 0x0C22
248 #define GL_COLOR_WRITEMASK 0x0C23
249 #define GL_COMPARE_REF_TO_TEXTURE 0x884E
250 #define GL_COMPARE_R_TO_TEXTURE 0x884E
251 #define GL_COMPILE_STATUS 0x8B81
252 #define GL_COMPRESSED_R11_EAC 0x9270
253 #define GL_COMPRESSED_RG11_EAC 0x9272
254 #define GL_COMPRESSED_RGB8_ETC2 0x9274
255 #define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276
256 #define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278
257 #define GL_COMPRESSED_SIGNED_R11_EAC 0x9271
258 #define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273
259 #define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279
260 #define GL_COMPRESSED_SRGB8_ETC2 0x9275
261 #define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277
262 #define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
263 #define GL_CONDITION_SATISFIED 0x911C
264 #define GL_CONSTANT_ALPHA 0x8003
265 #define GL_CONSTANT_COLOR 0x8001
266 #define GL_COPY_READ_BUFFER 0x8F36
267 #define GL_COPY_READ_BUFFER_BINDING 0x8F36
268 #define GL_COPY_WRITE_BUFFER 0x8F37
269 #define GL_COPY_WRITE_BUFFER_BINDING 0x8F37
270 #define GL_CULL_FACE 0x0B44
271 #define GL_CULL_FACE_MODE 0x0B45
272 #define GL_CURRENT_PROGRAM 0x8B8D
273 #define GL_CURRENT_QUERY 0x8865
274 #define GL_CURRENT_VERTEX_ATTRIB 0x8626
275 #define GL_CW 0x0900
276 #define GL_DECR 0x1E03
277 #define GL_DECR_WRAP 0x8508
278 #define GL_DELETE_STATUS 0x8B80
279 #define GL_DEPTH 0x1801
280 #define GL_DEPTH24_STENCIL8 0x88F0
281 #define GL_DEPTH32F_STENCIL8 0x8CAD
282 #define GL_DEPTH_ATTACHMENT 0x8D00
283 #define GL_DEPTH_BITS 0x0D56
284 #define GL_DEPTH_BUFFER_BIT 0x00000100
285 #define GL_DEPTH_CLEAR_VALUE 0x0B73
286 #define GL_DEPTH_COMPONENT 0x1902
287 #define GL_DEPTH_COMPONENT16 0x81A5
288 #define GL_DEPTH_COMPONENT24 0x81A6
289 #define GL_DEPTH_COMPONENT32F 0x8CAC
290 #define GL_DEPTH_FUNC 0x0B74
291 #define GL_DEPTH_RANGE 0x0B70
292 #define GL_DEPTH_STENCIL 0x84F9
293 #define GL_DEPTH_STENCIL_ATTACHMENT 0x821A
294 #define GL_DEPTH_TEST 0x0B71
295 #define GL_DEPTH_WRITEMASK 0x0B72
296 #define GL_DITHER 0x0BD0
297 #define GL_DONT_CARE 0x1100
298 #define GL_DRAW_BUFFER0 0x8825
299 #define GL_DRAW_BUFFER1 0x8826
300 #define GL_DRAW_BUFFER10 0x882F
301 #define GL_DRAW_BUFFER11 0x8830
302 #define GL_DRAW_BUFFER12 0x8831
303 #define GL_DRAW_BUFFER13 0x8832
304 #define GL_DRAW_BUFFER14 0x8833
305 #define GL_DRAW_BUFFER15 0x8834
306 #define GL_DRAW_BUFFER2 0x8827
307 #define GL_DRAW_BUFFER3 0x8828
308 #define GL_DRAW_BUFFER4 0x8829
309 #define GL_DRAW_BUFFER5 0x882A
310 #define GL_DRAW_BUFFER6 0x882B
311 #define GL_DRAW_BUFFER7 0x882C
312 #define GL_DRAW_BUFFER8 0x882D
313 #define GL_DRAW_BUFFER9 0x882E
314 #define GL_DRAW_FRAMEBUFFER 0x8CA9
315 #define GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6
316 #define GL_DST_ALPHA 0x0304
317 #define GL_DST_COLOR 0x0306
318 #define GL_DYNAMIC_COPY 0x88EA
319 #define GL_DYNAMIC_DRAW 0x88E8
320 #define GL_DYNAMIC_READ 0x88E9
321 #define GL_ELEMENT_ARRAY_BUFFER 0x8893
322 #define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
323 #define GL_EQUAL 0x0202
324 #define GL_EXTENSIONS 0x1F03
325 #define GL_FALSE 0
326 #define GL_FASTEST 0x1101
327 #define GL_FIXED 0x140C
328 #define GL_FLOAT 0x1406
329 #define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD
330 #define GL_FLOAT_MAT2 0x8B5A
331 #define GL_FLOAT_MAT2x3 0x8B65
332 #define GL_FLOAT_MAT2x4 0x8B66
333 #define GL_FLOAT_MAT3 0x8B5B
334 #define GL_FLOAT_MAT3x2 0x8B67
335 #define GL_FLOAT_MAT3x4 0x8B68
336 #define GL_FLOAT_MAT4 0x8B5C
337 #define GL_FLOAT_MAT4x2 0x8B69
338 #define GL_FLOAT_MAT4x3 0x8B6A
339 #define GL_FLOAT_VEC2 0x8B50
340 #define GL_FLOAT_VEC3 0x8B51
341 #define GL_FLOAT_VEC4 0x8B52
342 #define GL_FRAGMENT_SHADER 0x8B30
343 #define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B
344 #define GL_FRAMEBUFFER 0x8D40
345 #define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215
346 #define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214
347 #define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210
348 #define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211
349 #define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216
350 #define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213
351 #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
352 #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
353 #define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212
354 #define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217
355 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
356 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4
357 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
358 #define GL_FRAMEBUFFER_BINDING 0x8CA6
359 #define GL_FRAMEBUFFER_COMPLETE 0x8CD5
360 #define GL_FRAMEBUFFER_DEFAULT 0x8218
361 #define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
362 #define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9
363 #define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
364 #define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56
365 #define GL_FRAMEBUFFER_UNDEFINED 0x8219
366 #define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
367 #define GL_FRONT 0x0404
368 #define GL_FRONT_AND_BACK 0x0408
369 #define GL_FRONT_FACE 0x0B46
370 #define GL_FUNC_ADD 0x8006
371 #define GL_FUNC_REVERSE_SUBTRACT 0x800B
372 #define GL_FUNC_SUBTRACT 0x800A
373 #define GL_GENERATE_MIPMAP_HINT 0x8192
374 #define GL_GEQUAL 0x0206
375 #define GL_GREATER 0x0204
376 #define GL_GREEN 0x1904
377 #define GL_GREEN_BITS 0x0D53
378 #define GL_HALF_FLOAT 0x140B
379 #define GL_HIGH_FLOAT 0x8DF2
380 #define GL_HIGH_INT 0x8DF5
381 #define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
382 #define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A
383 #define GL_INCR 0x1E02
384 #define GL_INCR_WRAP 0x8507
385 #define GL_INFO_LOG_LENGTH 0x8B84
386 #define GL_INT 0x1404
387 #define GL_INTERLEAVED_ATTRIBS 0x8C8C
388 #define GL_INT_2_10_10_10_REV 0x8D9F
389 #define GL_INT_SAMPLER_2D 0x8DCA
390 #define GL_INT_SAMPLER_2D_ARRAY 0x8DCF
391 #define GL_INT_SAMPLER_3D 0x8DCB
392 #define GL_INT_SAMPLER_CUBE 0x8DCC
393 #define GL_INT_VEC2 0x8B53
394 #define GL_INT_VEC3 0x8B54
395 #define GL_INT_VEC4 0x8B55
396 #define GL_INVALID_ENUM 0x0500
397 #define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
398 #define GL_INVALID_INDEX 0xFFFFFFFF
399 #define GL_INVALID_OPERATION 0x0502
400 #define GL_INVALID_VALUE 0x0501
401 #define GL_INVERT 0x150A
402 #define GL_KEEP 0x1E00
403 #define GL_LEQUAL 0x0203
404 #define GL_LESS 0x0201
405 #define GL_LINEAR 0x2601
406 #define GL_LINEAR_MIPMAP_LINEAR 0x2703
407 #define GL_LINEAR_MIPMAP_NEAREST 0x2701
408 #define GL_LINES 0x0001
409 #define GL_LINE_LOOP 0x0002
410 #define GL_LINE_STRIP 0x0003
411 #define GL_LINE_WIDTH 0x0B21
412 #define GL_LINK_STATUS 0x8B82
413 #define GL_LOW_FLOAT 0x8DF0
414 #define GL_LOW_INT 0x8DF3
415 #define GL_LUMINANCE 0x1909
416 #define GL_LUMINANCE_ALPHA 0x190A
417 #define GL_MAJOR_VERSION 0x821B
418 #define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010
419 #define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008
420 #define GL_MAP_INVALIDATE_RANGE_BIT 0x0004
421 #define GL_MAP_READ_BIT 0x0001
422 #define GL_MAP_UNSYNCHRONIZED_BIT 0x0020
423 #define GL_MAP_WRITE_BIT 0x0002
424 #define GL_MAX 0x8008
425 #define GL_MAX_3D_TEXTURE_SIZE 0x8073
426 #define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF
427 #define GL_MAX_COLOR_ATTACHMENTS 0x8CDF
428 #define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33
429 #define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
430 #define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E
431 #define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31
432 #define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
433 #define GL_MAX_DRAW_BUFFERS 0x8824
434 #define GL_MAX_ELEMENTS_INDICES 0x80E9
435 #define GL_MAX_ELEMENTS_VERTICES 0x80E8
436 #define GL_MAX_ELEMENT_INDEX 0x8D6B
437 #define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125
438 #define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D
439 #define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49
440 #define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD
441 #define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905
442 #define GL_MAX_RENDERBUFFER_SIZE 0x84E8
443 #define GL_MAX_SAMPLES 0x8D57
444 #define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111
445 #define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
446 #define GL_MAX_TEXTURE_LOD_BIAS 0x84FD
447 #define GL_MAX_TEXTURE_SIZE 0x0D33
448 #define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A
449 #define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B
450 #define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80
451 #define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30
452 #define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F
453 #define GL_MAX_VARYING_COMPONENTS 0x8B4B
454 #define GL_MAX_VARYING_FLOATS 0x8B4B
455 #define GL_MAX_VARYING_VECTORS 0x8DFC
456 #define GL_MAX_VERTEX_ATTRIBS 0x8869
457 #define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122
458 #define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
459 #define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B
460 #define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A
461 #define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB
462 #define GL_MAX_VIEWPORT_DIMS 0x0D3A
463 #define GL_MEDIUM_FLOAT 0x8DF1
464 #define GL_MEDIUM_INT 0x8DF4
465 #define GL_MIN 0x8007
466 #define GL_MINOR_VERSION 0x821C
467 #define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904
468 #define GL_MIRRORED_REPEAT 0x8370
469 #define GL_NEAREST 0x2600
470 #define GL_NEAREST_MIPMAP_LINEAR 0x2702
471 #define GL_NEAREST_MIPMAP_NEAREST 0x2700
472 #define GL_NEVER 0x0200
473 #define GL_NICEST 0x1102
474 #define GL_NONE 0
475 #define GL_NOTEQUAL 0x0205
476 #define GL_NO_ERROR 0
477 #define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
478 #define GL_NUM_EXTENSIONS 0x821D
479 #define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE
480 #define GL_NUM_SAMPLE_COUNTS 0x9380
481 #define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9
482 #define GL_OBJECT_TYPE 0x9112
483 #define GL_ONE 1
484 #define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
485 #define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
486 #define GL_ONE_MINUS_DST_ALPHA 0x0305
487 #define GL_ONE_MINUS_DST_COLOR 0x0307
488 #define GL_ONE_MINUS_SRC_ALPHA 0x0303
489 #define GL_ONE_MINUS_SRC_COLOR 0x0301
490 #define GL_OUT_OF_MEMORY 0x0505
491 #define GL_PACK_ALIGNMENT 0x0D05
492 #define GL_PACK_ROW_LENGTH 0x0D02
493 #define GL_PACK_SKIP_PIXELS 0x0D04
494 #define GL_PACK_SKIP_ROWS 0x0D03
495 #define GL_PIXEL_PACK_BUFFER 0x88EB
496 #define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED
497 #define GL_PIXEL_UNPACK_BUFFER 0x88EC
498 #define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF
499 #define GL_POINTS 0x0000
500 #define GL_POLYGON_OFFSET_FACTOR 0x8038
501 #define GL_POLYGON_OFFSET_FILL 0x8037
502 #define GL_POLYGON_OFFSET_UNITS 0x2A00
503 #define GL_PRIMITIVE_RESTART_FIXED_INDEX 0x8D69
504 #define GL_PROGRAM_BINARY_FORMATS 0x87FF
505 #define GL_PROGRAM_BINARY_LENGTH 0x8741
506 #define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257
507 #define GL_QUERY_RESULT 0x8866
508 #define GL_QUERY_RESULT_AVAILABLE 0x8867
509 #define GL_R11F_G11F_B10F 0x8C3A
510 #define GL_R16F 0x822D
511 #define GL_R16I 0x8233
512 #define GL_R16UI 0x8234
513 #define GL_R32F 0x822E
514 #define GL_R32I 0x8235
515 #define GL_R32UI 0x8236
516 #define GL_R8 0x8229
517 #define GL_R8I 0x8231
518 #define GL_R8UI 0x8232
519 #define GL_R8_SNORM 0x8F94
520 #define GL_RASTERIZER_DISCARD 0x8C89
521 #define GL_READ_BUFFER 0x0C02
522 #define GL_READ_FRAMEBUFFER 0x8CA8
523 #define GL_READ_FRAMEBUFFER_BINDING 0x8CAA
524 #define GL_RED 0x1903
525 #define GL_RED_BITS 0x0D52
526 #define GL_RED_INTEGER 0x8D94
527 #define GL_RENDERBUFFER 0x8D41
528 #define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53
529 #define GL_RENDERBUFFER_BINDING 0x8CA7
530 #define GL_RENDERBUFFER_BLUE_SIZE 0x8D52
531 #define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54
532 #define GL_RENDERBUFFER_GREEN_SIZE 0x8D51
533 #define GL_RENDERBUFFER_HEIGHT 0x8D43
534 #define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44
535 #define GL_RENDERBUFFER_RED_SIZE 0x8D50
536 #define GL_RENDERBUFFER_SAMPLES 0x8CAB
537 #define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55
538 #define GL_RENDERBUFFER_WIDTH 0x8D42
539 #define GL_RENDERER 0x1F01
540 #define GL_REPEAT 0x2901
541 #define GL_REPLACE 0x1E01
542 #define GL_RG 0x8227
543 #define GL_RG16F 0x822F
544 #define GL_RG16I 0x8239
545 #define GL_RG16UI 0x823A
546 #define GL_RG32F 0x8230
547 #define GL_RG32I 0x823B
548 #define GL_RG32UI 0x823C
549 #define GL_RG8 0x822B
550 #define GL_RG8I 0x8237
551 #define GL_RG8UI 0x8238
552 #define GL_RG8_SNORM 0x8F95
553 #define GL_RGB 0x1907
554 #define GL_RGB10_A2 0x8059
555 #define GL_RGB10_A2UI 0x906F
556 #define GL_RGB16F 0x881B
557 #define GL_RGB16I 0x8D89
558 #define GL_RGB16UI 0x8D77
559 #define GL_RGB32F 0x8815
560 #define GL_RGB32I 0x8D83
561 #define GL_RGB32UI 0x8D71
562 #define GL_RGB565 0x8D62
563 #define GL_RGB5_A1 0x8057
564 #define GL_RGB8 0x8051
565 #define GL_RGB8I 0x8D8F
566 #define GL_RGB8UI 0x8D7D
567 #define GL_RGB8_SNORM 0x8F96
568 #define GL_RGB9_E5 0x8C3D
569 #define GL_RGBA 0x1908
570 #define GL_RGBA16F 0x881A
571 #define GL_RGBA16I 0x8D88
572 #define GL_RGBA16UI 0x8D76
573 #define GL_RGBA32F 0x8814
574 #define GL_RGBA32I 0x8D82
575 #define GL_RGBA32UI 0x8D70
576 #define GL_RGBA4 0x8056
577 #define GL_RGBA8 0x8058
578 #define GL_RGBA8I 0x8D8E
579 #define GL_RGBA8UI 0x8D7C
580 #define GL_RGBA8_SNORM 0x8F97
581 #define GL_RGBA_INTEGER 0x8D99
582 #define GL_RGB_INTEGER 0x8D98
583 #define GL_RG_INTEGER 0x8228
584 #define GL_SAMPLER_2D 0x8B5E
585 #define GL_SAMPLER_2D_ARRAY 0x8DC1
586 #define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4
587 #define GL_SAMPLER_2D_SHADOW 0x8B62
588 #define GL_SAMPLER_3D 0x8B5F
589 #define GL_SAMPLER_BINDING 0x8919
590 #define GL_SAMPLER_CUBE 0x8B60
591 #define GL_SAMPLER_CUBE_SHADOW 0x8DC5
592 #define GL_SAMPLES 0x80A9
593 #define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
594 #define GL_SAMPLE_BUFFERS 0x80A8
595 #define GL_SAMPLE_COVERAGE 0x80A0
596 #define GL_SAMPLE_COVERAGE_INVERT 0x80AB
597 #define GL_SAMPLE_COVERAGE_VALUE 0x80AA
598 #define GL_SCISSOR_BOX 0x0C10
599 #define GL_SCISSOR_TEST 0x0C11
600 #define GL_SEPARATE_ATTRIBS 0x8C8D
601 #define GL_SHADER_BINARY_FORMATS 0x8DF8
602 #define GL_SHADER_COMPILER 0x8DFA
603 #define GL_SHADER_SOURCE_LENGTH 0x8B88
604 #define GL_SHADER_TYPE 0x8B4F
605 #define GL_SHADING_LANGUAGE_VERSION 0x8B8C
606 #define GL_SHORT 0x1402
607 #define GL_SIGNALED 0x9119
608 #define GL_SIGNED_NORMALIZED 0x8F9C
609 #define GL_SRC_ALPHA 0x0302
610 #define GL_SRC_ALPHA_SATURATE 0x0308
611 #define GL_SRC_COLOR 0x0300
612 #define GL_SRGB 0x8C40
613 #define GL_SRGB8 0x8C41
614 #define GL_SRGB8_ALPHA8 0x8C43
615 #define GL_STATIC_COPY 0x88E6
616 #define GL_STATIC_DRAW 0x88E4
617 #define GL_STATIC_READ 0x88E5
618 #define GL_STENCIL 0x1802
619 #define GL_STENCIL_ATTACHMENT 0x8D20
620 #define GL_STENCIL_BACK_FAIL 0x8801
621 #define GL_STENCIL_BACK_FUNC 0x8800
622 #define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802
623 #define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803
624 #define GL_STENCIL_BACK_REF 0x8CA3
625 #define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
626 #define GL_STENCIL_BACK_WRITEMASK 0x8CA5
627 #define GL_STENCIL_BITS 0x0D57
628 #define GL_STENCIL_BUFFER_BIT 0x00000400
629 #define GL_STENCIL_CLEAR_VALUE 0x0B91
630 #define GL_STENCIL_FAIL 0x0B94
631 #define GL_STENCIL_FUNC 0x0B92
632 #define GL_STENCIL_INDEX8 0x8D48
633 #define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
634 #define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
635 #define GL_STENCIL_REF 0x0B97
636 #define GL_STENCIL_TEST 0x0B90
637 #define GL_STENCIL_VALUE_MASK 0x0B93
638 #define GL_STENCIL_WRITEMASK 0x0B98
639 #define GL_STREAM_COPY 0x88E2
640 #define GL_STREAM_DRAW 0x88E0
641 #define GL_STREAM_READ 0x88E1
642 #define GL_SUBPIXEL_BITS 0x0D50
643 #define GL_SYNC_CONDITION 0x9113
644 #define GL_SYNC_FENCE 0x9116
645 #define GL_SYNC_FLAGS 0x9115
646 #define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001
647 #define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117
648 #define GL_SYNC_STATUS 0x9114
649 #define GL_TEXTURE 0x1702
650 #define GL_TEXTURE0 0x84C0
651 #define GL_TEXTURE1 0x84C1
652 #define GL_TEXTURE10 0x84CA
653 #define GL_TEXTURE11 0x84CB
654 #define GL_TEXTURE12 0x84CC
655 #define GL_TEXTURE13 0x84CD
656 #define GL_TEXTURE14 0x84CE
657 #define GL_TEXTURE15 0x84CF
658 #define GL_TEXTURE16 0x84D0
659 #define GL_TEXTURE17 0x84D1
660 #define GL_TEXTURE18 0x84D2
661 #define GL_TEXTURE19 0x84D3
662 #define GL_TEXTURE2 0x84C2
663 #define GL_TEXTURE20 0x84D4
664 #define GL_TEXTURE21 0x84D5
665 #define GL_TEXTURE22 0x84D6
666 #define GL_TEXTURE23 0x84D7
667 #define GL_TEXTURE24 0x84D8
668 #define GL_TEXTURE25 0x84D9
669 #define GL_TEXTURE26 0x84DA
670 #define GL_TEXTURE27 0x84DB
671 #define GL_TEXTURE28 0x84DC
672 #define GL_TEXTURE29 0x84DD
673 #define GL_TEXTURE3 0x84C3
674 #define GL_TEXTURE30 0x84DE
675 #define GL_TEXTURE31 0x84DF
676 #define GL_TEXTURE4 0x84C4
677 #define GL_TEXTURE5 0x84C5
678 #define GL_TEXTURE6 0x84C6
679 #define GL_TEXTURE7 0x84C7
680 #define GL_TEXTURE8 0x84C8
681 #define GL_TEXTURE9 0x84C9
682 #define GL_TEXTURE_2D 0x0DE1
683 #define GL_TEXTURE_2D_ARRAY 0x8C1A
684 #define GL_TEXTURE_3D 0x806F
685 #define GL_TEXTURE_BASE_LEVEL 0x813C
686 #define GL_TEXTURE_BINDING_2D 0x8069
687 #define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D
688 #define GL_TEXTURE_BINDING_3D 0x806A
689 #define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
690 #define GL_TEXTURE_COMPARE_FUNC 0x884D
691 #define GL_TEXTURE_COMPARE_MODE 0x884C
692 #define GL_TEXTURE_CUBE_MAP 0x8513
693 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
694 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
695 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
696 #define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
697 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
698 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
699 #define GL_TEXTURE_IMMUTABLE_FORMAT 0x912F
700 #define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF
701 #define GL_TEXTURE_MAG_FILTER 0x2800
702 #define GL_TEXTURE_MAX_LEVEL 0x813D
703 #define GL_TEXTURE_MAX_LOD 0x813B
704 #define GL_TEXTURE_MIN_FILTER 0x2801
705 #define GL_TEXTURE_MIN_LOD 0x813A
706 #define GL_TEXTURE_SWIZZLE_A 0x8E45
707 #define GL_TEXTURE_SWIZZLE_B 0x8E44
708 #define GL_TEXTURE_SWIZZLE_G 0x8E43
709 #define GL_TEXTURE_SWIZZLE_R 0x8E42
710 #define GL_TEXTURE_WRAP_R 0x8072
711 #define GL_TEXTURE_WRAP_S 0x2802
712 #define GL_TEXTURE_WRAP_T 0x2803
713 #define GL_TIMEOUT_EXPIRED 0x911B
714 #define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFF
715 #define GL_TRANSFORM_FEEDBACK 0x8E22
716 #define GL_TRANSFORM_FEEDBACK_ACTIVE 0x8E24
717 #define GL_TRANSFORM_FEEDBACK_BINDING 0x8E25
718 #define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E
719 #define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE 0x8E24
720 #define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F
721 #define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F
722 #define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED 0x8E23
723 #define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85
724 #define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84
725 #define GL_TRANSFORM_FEEDBACK_PAUSED 0x8E23
726 #define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88
727 #define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83
728 #define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76
729 #define GL_TRIANGLES 0x0004
730 #define GL_TRIANGLE_FAN 0x0006
731 #define GL_TRIANGLE_STRIP 0x0005
732 #define GL_TRUE 1
733 #define GL_UNIFORM_ARRAY_STRIDE 0x8A3C
734 #define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42
735 #define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43
736 #define GL_UNIFORM_BLOCK_BINDING 0x8A3F
737 #define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40
738 #define GL_UNIFORM_BLOCK_INDEX 0x8A3A
739 #define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41
740 #define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46
741 #define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44
742 #define GL_UNIFORM_BUFFER 0x8A11
743 #define GL_UNIFORM_BUFFER_BINDING 0x8A28
744 #define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34
745 #define GL_UNIFORM_BUFFER_SIZE 0x8A2A
746 #define GL_UNIFORM_BUFFER_START 0x8A29
747 #define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E
748 #define GL_UNIFORM_MATRIX_STRIDE 0x8A3D
749 #define GL_UNIFORM_NAME_LENGTH 0x8A39
750 #define GL_UNIFORM_OFFSET 0x8A3B
751 #define GL_UNIFORM_SIZE 0x8A38
752 #define GL_UNIFORM_TYPE 0x8A37
753 #define GL_UNPACK_ALIGNMENT 0x0CF5
754 #define GL_UNPACK_IMAGE_HEIGHT 0x806E
755 #define GL_UNPACK_ROW_LENGTH 0x0CF2
756 #define GL_UNPACK_SKIP_IMAGES 0x806D
757 #define GL_UNPACK_SKIP_PIXELS 0x0CF4
758 #define GL_UNPACK_SKIP_ROWS 0x0CF3
759 #define GL_UNSIGNALED 0x9118
760 #define GL_UNSIGNED_BYTE 0x1401
761 #define GL_UNSIGNED_INT 0x1405
762 #define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B
763 #define GL_UNSIGNED_INT_24_8 0x84FA
764 #define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
765 #define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E
766 #define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2
767 #define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7
768 #define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3
769 #define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4
770 #define GL_UNSIGNED_INT_VEC2 0x8DC6
771 #define GL_UNSIGNED_INT_VEC3 0x8DC7
772 #define GL_UNSIGNED_INT_VEC4 0x8DC8
773 #define GL_UNSIGNED_NORMALIZED 0x8C17
774 #define GL_UNSIGNED_SHORT 0x1403
775 #define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
776 #define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
777 #define GL_UNSIGNED_SHORT_5_6_5 0x8363
778 #define GL_VALIDATE_STATUS 0x8B83
779 #define GL_VENDOR 0x1F00
780 #define GL_VERSION 0x1F02
781 #define GL_VERTEX_ARRAY_BINDING 0x85B5
782 #define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
783 #define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE
784 #define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
785 #define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD
786 #define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
787 #define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
788 #define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
789 #define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
790 #define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
791 #define GL_VERTEX_SHADER 0x8B31
792 #define GL_VIEWPORT 0x0BA2
793 #define GL_WAIT_FAILED 0x911D
794 #define GL_ZERO 0
795
796
797 #ifndef __khrplatform_h_
798 #define __khrplatform_h_
799
800 /*
801 ** Copyright (c) 2008-2018 The Khronos Group Inc.
802 **
803 ** Permission is hereby granted, free of charge, to any person obtaining a
804 ** copy of this software and/or associated documentation files (the
805 ** "Materials"), to deal in the Materials without restriction, including
806 ** without limitation the rights to use, copy, modify, merge, publish,
807 ** distribute, sublicense, and/or sell copies of the Materials, and to
808 ** permit persons to whom the Materials are furnished to do so, subject to
809 ** the following conditions:
810 **
811 ** The above copyright notice and this permission notice shall be included
812 ** in all copies or substantial portions of the Materials.
813 **
814 ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
815 ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
816 ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
817 ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
818 ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
819 ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
820 ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
821 */
822
823 /* Khronos platform-specific types and definitions.
824 *
825 * The master copy of khrplatform.h is maintained in the Khronos EGL
826 * Registry repository at https://github.com/KhronosGroup/EGL-Registry
827 * The last semantic modification to khrplatform.h was at commit ID:
828 * 67a3e0864c2d75ea5287b9f3d2eb74a745936692
829 *
830 * Adopters may modify this file to suit their platform. Adopters are
831 * encouraged to submit platform specific modifications to the Khronos
832 * group so that they can be included in future versions of this file.
833 * Please submit changes by filing pull requests or issues on
834 * the EGL Registry repository linked above.
835 *
836 *
837 * See the Implementer's Guidelines for information about where this file
838 * should be located on your system and for more details of its use:
839 * http://www.khronos.org/registry/implementers_guide.pdf
840 *
841 * This file should be included as
842 * #include <KHR/khrplatform.h>
843 * by Khronos client API header files that use its types and defines.
844 *
845 * The types in khrplatform.h should only be used to define API-specific types.
846 *
847 * Types defined in khrplatform.h:
848 * khronos_int8_t signed 8 bit
849 * khronos_uint8_t unsigned 8 bit
850 * khronos_int16_t signed 16 bit
851 * khronos_uint16_t unsigned 16 bit
852 * khronos_int32_t signed 32 bit
853 * khronos_uint32_t unsigned 32 bit
854 * khronos_int64_t signed 64 bit
855 * khronos_uint64_t unsigned 64 bit
856 * khronos_intptr_t signed same number of bits as a pointer
857 * khronos_uintptr_t unsigned same number of bits as a pointer
858 * khronos_ssize_t signed size
859 * khronos_usize_t unsigned size
860 * khronos_float_t signed 32 bit floating point
861 * khronos_time_ns_t unsigned 64 bit time in nanoseconds
862 * khronos_utime_nanoseconds_t unsigned time interval or absolute time in
863 * nanoseconds
864 * khronos_stime_nanoseconds_t signed time interval in nanoseconds
865 * khronos_boolean_enum_t enumerated boolean type. This should
866 * only be used as a base type when a client API's boolean type is
867 * an enum. Client APIs which use an integer or other type for
868 * booleans cannot use this as the base type for their boolean.
869 *
870 * Tokens defined in khrplatform.h:
871 *
872 * KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values.
873 *
874 * KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0.
875 * KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0.
876 *
877 * Calling convention macros defined in this file:
878 * KHRONOS_APICALL
879 * KHRONOS_GLAD_API_PTR
880 * KHRONOS_APIATTRIBUTES
881 *
882 * These may be used in function prototypes as:
883 *
884 * KHRONOS_APICALL void KHRONOS_GLAD_API_PTR funcname(
885 * int arg1,
886 * int arg2) KHRONOS_APIATTRIBUTES;
887 */
888
889 #if defined(__SCITECH_SNAP__) && !defined(KHRONOS_STATIC)
890 # define KHRONOS_STATIC 1
891 #endif
892
893 /*-------------------------------------------------------------------------
894 * Definition of KHRONOS_APICALL
895 *-------------------------------------------------------------------------
896 * This precedes the return type of the function in the function prototype.
897 */
898 #if defined(KHRONOS_STATIC)
899 /* If the preprocessor constant KHRONOS_STATIC is defined, make the
900 * header compatible with static linking. */
901 # define KHRONOS_APICALL
902 #elif defined(_WIN32)
903 # define KHRONOS_APICALL __declspec(dllimport)
904 #elif defined (__SYMBIAN32__)
905 # define KHRONOS_APICALL IMPORT_C
906 #elif defined(__ANDROID__)
907 # define KHRONOS_APICALL __attribute__((visibility("default")))
908 #else
909 # define KHRONOS_APICALL
910 #endif
911
912 /*-------------------------------------------------------------------------
913 * Definition of KHRONOS_GLAD_API_PTR
914 *-------------------------------------------------------------------------
915 * This follows the return type of the function and precedes the function
916 * name in the function prototype.
917 */
918 #if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__)
919 /* Win32 but not WinCE */
920 # define KHRONOS_GLAD_API_PTR __stdcall
921 #else
922 # define KHRONOS_GLAD_API_PTR
923 #endif
924
925 /*-------------------------------------------------------------------------
926 * Definition of KHRONOS_APIATTRIBUTES
927 *-------------------------------------------------------------------------
928 * This follows the closing parenthesis of the function prototype arguments.
929 */
930 #if defined (__ARMCC_2__)
931 #define KHRONOS_APIATTRIBUTES __softfp
932 #else
933 #define KHRONOS_APIATTRIBUTES
934 #endif
935
936 /*-------------------------------------------------------------------------
937 * basic type definitions
938 *-----------------------------------------------------------------------*/
939 #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__)
940
941
942 /*
943 * Using <stdint.h>
944 */
945 #include <stdint.h>
946 typedef int32_t khronos_int32_t;
947 typedef uint32_t khronos_uint32_t;
948 typedef int64_t khronos_int64_t;
949 typedef uint64_t khronos_uint64_t;
950 #define KHRONOS_SUPPORT_INT64 1
951 #define KHRONOS_SUPPORT_FLOAT 1
952
953 #elif defined(__VMS ) || defined(__sgi)
954
955 /*
956 * Using <inttypes.h>
957 */
958 #include <inttypes.h>
959 typedef int32_t khronos_int32_t;
960 typedef uint32_t khronos_uint32_t;
961 typedef int64_t khronos_int64_t;
962 typedef uint64_t khronos_uint64_t;
963 #define KHRONOS_SUPPORT_INT64 1
964 #define KHRONOS_SUPPORT_FLOAT 1
965
966 #elif defined(_WIN32) && !defined(__SCITECH_SNAP__)
967
968 /*
969 * Win32
970 */
971 typedef __int32 khronos_int32_t;
972 typedef unsigned __int32 khronos_uint32_t;
973 typedef __int64 khronos_int64_t;
974 typedef unsigned __int64 khronos_uint64_t;
975 #define KHRONOS_SUPPORT_INT64 1
976 #define KHRONOS_SUPPORT_FLOAT 1
977
978 #elif defined(__sun__) || defined(__digital__)
979
980 /*
981 * Sun or Digital
982 */
983 typedef int khronos_int32_t;
984 typedef unsigned int khronos_uint32_t;
985 #if defined(__arch64__) || defined(_LP64)
986 typedef long int khronos_int64_t;
987 typedef unsigned long int khronos_uint64_t;
988 #else
989 typedef long long int khronos_int64_t;
990 typedef unsigned long long int khronos_uint64_t;
991 #endif /* __arch64__ */
992 #define KHRONOS_SUPPORT_INT64 1
993 #define KHRONOS_SUPPORT_FLOAT 1
994
995 #elif 0
996
997 /*
998 * Hypothetical platform with no float or int64 support
999 */
1000 typedef int khronos_int32_t;
1001 typedef unsigned int khronos_uint32_t;
1002 #define KHRONOS_SUPPORT_INT64 0
1003 #define KHRONOS_SUPPORT_FLOAT 0
1004
1005 #else
1006
1007 /*
1008 * Generic fallback
1009 */
1010 #include <stdint.h>
1011 typedef int32_t khronos_int32_t;
1012 typedef uint32_t khronos_uint32_t;
1013 typedef int64_t khronos_int64_t;
1014 typedef uint64_t khronos_uint64_t;
1015 #define KHRONOS_SUPPORT_INT64 1
1016 #define KHRONOS_SUPPORT_FLOAT 1
1017
1018 #endif
1019
1020
1021 /*
1022 * Types that are (so far) the same on all platforms
1023 */
1024 typedef signed char khronos_int8_t;
1025 typedef unsigned char khronos_uint8_t;
1026 typedef signed short int khronos_int16_t;
1027 typedef unsigned short int khronos_uint16_t;
1028
1029 /*
1030 * Types that differ between LLP64 and LP64 architectures - in LLP64,
1031 * pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
1032 * to be the only LLP64 architecture in current use.
1033 */
1034 #ifdef _WIN64
1035 typedef signed long long int khronos_intptr_t;
1036 typedef unsigned long long int khronos_uintptr_t;
1037 typedef signed long long int khronos_ssize_t;
1038 typedef unsigned long long int khronos_usize_t;
1039 #else
1040 typedef signed long int khronos_intptr_t;
1041 typedef unsigned long int khronos_uintptr_t;
1042 typedef signed long int khronos_ssize_t;
1043 typedef unsigned long int khronos_usize_t;
1044 #endif
1045
1046 #if KHRONOS_SUPPORT_FLOAT
1047 /*
1048 * Float type
1049 */
1050 typedef float khronos_float_t;
1051 #endif
1052
1053 #if KHRONOS_SUPPORT_INT64
1054 /* Time types
1055 *
1056 * These types can be used to represent a time interval in nanoseconds or
1057 * an absolute Unadjusted System Time. Unadjusted System Time is the number
1058 * of nanoseconds since some arbitrary system event (e.g. since the last
1059 * time the system booted). The Unadjusted System Time is an unsigned
1060 * 64 bit value that wraps back to 0 every 584 years. Time intervals
1061 * may be either signed or unsigned.
1062 */
1063 typedef khronos_uint64_t khronos_utime_nanoseconds_t;
1064 typedef khronos_int64_t khronos_stime_nanoseconds_t;
1065 #endif
1066
1067 /*
1068 * Dummy value used to pad enum types to 32 bits.
1069 */
1070 #ifndef KHRONOS_MAX_ENUM
1071 #define KHRONOS_MAX_ENUM 0x7FFFFFFF
1072 #endif
1073
1074 /*
1075 * Enumerated boolean type
1076 *
1077 * Values other than zero should be considered to be true. Therefore
1078 * comparisons should not be made against KHRONOS_TRUE.
1079 */
1080 typedef enum {
1081 KHRONOS_FALSE = 0,
1082 KHRONOS_TRUE = 1,
1083 KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM
1084 } khronos_boolean_enum_t;
1085
1086 #endif /* __khrplatform_h_ */
1087
1088 typedef unsigned int GLenum;
1089
1090 typedef unsigned char GLboolean;
1091
1092 typedef unsigned int GLbitfield;
1093
1094 typedef void GLvoid;
1095
1096 typedef khronos_int8_t GLbyte;
1097
1098 typedef khronos_uint8_t GLubyte;
1099
1100 typedef khronos_int16_t GLshort;
1101
1102 typedef khronos_uint16_t GLushort;
1103
1104 typedef int GLint;
1105
1106 typedef unsigned int GLuint;
1107
1108 typedef khronos_int32_t GLclampx;
1109
1110 typedef int GLsizei;
1111
1112 typedef khronos_float_t GLfloat;
1113
1114 typedef khronos_float_t GLclampf;
1115
1116 typedef double GLdouble;
1117
1118 typedef double GLclampd;
1119
1120 typedef void *GLeglClientBufferEXT;
1121
1122 typedef void *GLeglImageOES;
1123
1124 typedef char GLchar;
1125
1126 typedef char GLcharARB;
1127
1128 #ifdef __APPLE__
1129 typedef void *GLhandleARB;
1130 #else
1131 typedef unsigned int GLhandleARB;
1132 #endif
1133
1134 typedef khronos_uint16_t GLhalf;
1135
1136 typedef khronos_uint16_t GLhalfARB;
1137
1138 typedef khronos_int32_t GLfixed;
1139
1140 #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
1141 typedef khronos_intptr_t GLintptr;
1142 #else
1143 typedef khronos_intptr_t GLintptr;
1144 #endif
1145
1146 #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
1147 typedef khronos_intptr_t GLintptrARB;
1148 #else
1149 typedef khronos_intptr_t GLintptrARB;
1150 #endif
1151
1152 #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
1153 typedef khronos_ssize_t GLsizeiptr;
1154 #else
1155 typedef khronos_ssize_t GLsizeiptr;
1156 #endif
1157
1158 #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
1159 typedef khronos_ssize_t GLsizeiptrARB;
1160 #else
1161 typedef khronos_ssize_t GLsizeiptrARB;
1162 #endif
1163
1164 typedef khronos_int64_t GLint64;
1165
1166 typedef khronos_int64_t GLint64EXT;
1167
1168 typedef khronos_uint64_t GLuint64;
1169
1170 typedef khronos_uint64_t GLuint64EXT;
1171
1172 typedef struct __GLsync *GLsync;
1173
1174 struct _cl_context;
1175
1176 struct _cl_event;
1177
1178 typedef void (GLAD_API_PTR *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
1179
1180 typedef void (GLAD_API_PTR *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
1181
1182 typedef void (GLAD_API_PTR *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
1183
1184 typedef void (GLAD_API_PTR *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,void *userParam);
1185
1186 typedef unsigned short GLhalfNV;
1187
1188 typedef GLintptr GLvdpauSurfaceNV;
1189
1190 typedef void (GLAD_API_PTR *GLVULKANPROCNV)(void);
1191
1192
1193
1194 #define GL_ES_VERSION_2_0 1
1195 GLAD_API_CALL int GLAD_GL_ES_VERSION_2_0;
1196 #define GL_ES_VERSION_3_0 1
1197 GLAD_API_CALL int GLAD_GL_ES_VERSION_3_0;
1198
1199
1200 typedef void (GLAD_API_PTR *PFNGLACTIVETEXTUREPROC)(GLenum texture);
1201 typedef void (GLAD_API_PTR *PFNGLATTACHSHADERPROC)(GLuint program, GLuint shader);
1202 typedef void (GLAD_API_PTR *PFNGLBEGINQUERYPROC)(GLenum target, GLuint id);
1203 typedef void (GLAD_API_PTR *PFNGLBEGINTRANSFORMFEEDBACKPROC)(GLenum primitiveMode);
1204 typedef void (GLAD_API_PTR *PFNGLBINDATTRIBLOCATIONPROC)(GLuint program, GLuint index, const GLchar * name);
1205 typedef void (GLAD_API_PTR *PFNGLBINDBUFFERPROC)(GLenum target, GLuint buffer);
1206 typedef void (GLAD_API_PTR *PFNGLBINDBUFFERBASEPROC)(GLenum target, GLuint index, GLuint buffer);
1207 typedef void (GLAD_API_PTR *PFNGLBINDBUFFERRANGEPROC)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
1208 typedef void (GLAD_API_PTR *PFNGLBINDFRAMEBUFFERPROC)(GLenum target, GLuint framebuffer);
1209 typedef void (GLAD_API_PTR *PFNGLBINDRENDERBUFFERPROC)(GLenum target, GLuint renderbuffer);
1210 typedef void (GLAD_API_PTR *PFNGLBINDSAMPLERPROC)(GLuint unit, GLuint sampler);
1211 typedef void (GLAD_API_PTR *PFNGLBINDTEXTUREPROC)(GLenum target, GLuint texture);
1212 typedef void (GLAD_API_PTR *PFNGLBINDTRANSFORMFEEDBACKPROC)(GLenum target, GLuint id);
1213 typedef void (GLAD_API_PTR *PFNGLBINDVERTEXARRAYPROC)(GLuint array);
1214 typedef void (GLAD_API_PTR *PFNGLBLENDCOLORPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
1215 typedef void (GLAD_API_PTR *PFNGLBLENDEQUATIONPROC)(GLenum mode);
1216 typedef void (GLAD_API_PTR *PFNGLBLENDEQUATIONSEPARATEPROC)(GLenum modeRGB, GLenum modeAlpha);
1217 typedef void (GLAD_API_PTR *PFNGLBLENDFUNCPROC)(GLenum sfactor, GLenum dfactor);
1218 typedef void (GLAD_API_PTR *PFNGLBLENDFUNCSEPARATEPROC)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
1219 typedef void (GLAD_API_PTR *PFNGLBLITFRAMEBUFFERPROC)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
1220 typedef void (GLAD_API_PTR *PFNGLBUFFERDATAPROC)(GLenum target, GLsizeiptr size, const void * data, GLenum usage);
1221 typedef void (GLAD_API_PTR *PFNGLBUFFERSUBDATAPROC)(GLenum target, GLintptr offset, GLsizeiptr size, const void * data);
1222 typedef GLenum (GLAD_API_PTR *PFNGLCHECKFRAMEBUFFERSTATUSPROC)(GLenum target);
1223 typedef void (GLAD_API_PTR *PFNGLCLEARPROC)(GLbitfield mask);
1224 typedef void (GLAD_API_PTR *PFNGLCLEARBUFFERFIPROC)(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
1225 typedef void (GLAD_API_PTR *PFNGLCLEARBUFFERFVPROC)(GLenum buffer, GLint drawbuffer, const GLfloat * value);
1226 typedef void (GLAD_API_PTR *PFNGLCLEARBUFFERIVPROC)(GLenum buffer, GLint drawbuffer, const GLint * value);
1227 typedef void (GLAD_API_PTR *PFNGLCLEARBUFFERUIVPROC)(GLenum buffer, GLint drawbuffer, const GLuint * value);
1228 typedef void (GLAD_API_PTR *PFNGLCLEARCOLORPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
1229 typedef void (GLAD_API_PTR *PFNGLCLEARDEPTHFPROC)(GLfloat d);
1230 typedef void (GLAD_API_PTR *PFNGLCLEARSTENCILPROC)(GLint s);
1231 typedef GLenum (GLAD_API_PTR *PFNGLCLIENTWAITSYNCPROC)(GLsync sync, GLbitfield flags, GLuint64 timeout);
1232 typedef void (GLAD_API_PTR *PFNGLCOLORMASKPROC)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
1233 typedef void (GLAD_API_PTR *PFNGLCOMPILESHADERPROC)(GLuint shader);
1234 typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXIMAGE2DPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void * data);
1235 typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXIMAGE3DPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void * data);
1236 typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void * data);
1237 typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void * data);
1238 typedef void (GLAD_API_PTR *PFNGLCOPYBUFFERSUBDATAPROC)(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
1239 typedef void (GLAD_API_PTR *PFNGLCOPYTEXIMAGE2DPROC)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
1240 typedef void (GLAD_API_PTR *PFNGLCOPYTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
1241 typedef void (GLAD_API_PTR *PFNGLCOPYTEXSUBIMAGE3DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
1242 typedef GLuint (GLAD_API_PTR *PFNGLCREATEPROGRAMPROC)(void);
1243 typedef GLuint (GLAD_API_PTR *PFNGLCREATESHADERPROC)(GLenum type);
1244 typedef void (GLAD_API_PTR *PFNGLCULLFACEPROC)(GLenum mode);
1245 typedef void (GLAD_API_PTR *PFNGLDELETEBUFFERSPROC)(GLsizei n, const GLuint * buffers);
1246 typedef void (GLAD_API_PTR *PFNGLDELETEFRAMEBUFFERSPROC)(GLsizei n, const GLuint * framebuffers);
1247 typedef void (GLAD_API_PTR *PFNGLDELETEPROGRAMPROC)(GLuint program);
1248 typedef void (GLAD_API_PTR *PFNGLDELETEQUERIESPROC)(GLsizei n, const GLuint * ids);
1249 typedef void (GLAD_API_PTR *PFNGLDELETERENDERBUFFERSPROC)(GLsizei n, const GLuint * renderbuffers);
1250 typedef void (GLAD_API_PTR *PFNGLDELETESAMPLERSPROC)(GLsizei count, const GLuint * samplers);
1251 typedef void (GLAD_API_PTR *PFNGLDELETESHADERPROC)(GLuint shader);
1252 typedef void (GLAD_API_PTR *PFNGLDELETESYNCPROC)(GLsync sync);
1253 typedef void (GLAD_API_PTR *PFNGLDELETETEXTURESPROC)(GLsizei n, const GLuint * textures);
1254 typedef void (GLAD_API_PTR *PFNGLDELETETRANSFORMFEEDBACKSPROC)(GLsizei n, const GLuint * ids);
1255 typedef void (GLAD_API_PTR *PFNGLDELETEVERTEXARRAYSPROC)(GLsizei n, const GLuint * arrays);
1256 typedef void (GLAD_API_PTR *PFNGLDEPTHFUNCPROC)(GLenum func);
1257 typedef void (GLAD_API_PTR *PFNGLDEPTHMASKPROC)(GLboolean flag);
1258 typedef void (GLAD_API_PTR *PFNGLDEPTHRANGEFPROC)(GLfloat n, GLfloat f);
1259 typedef void (GLAD_API_PTR *PFNGLDETACHSHADERPROC)(GLuint program, GLuint shader);
1260 typedef void (GLAD_API_PTR *PFNGLDISABLEPROC)(GLenum cap);
1261 typedef void (GLAD_API_PTR *PFNGLDISABLEVERTEXATTRIBARRAYPROC)(GLuint index);
1262 typedef void (GLAD_API_PTR *PFNGLDRAWARRAYSPROC)(GLenum mode, GLint first, GLsizei count);
1263 typedef void (GLAD_API_PTR *PFNGLDRAWARRAYSINSTANCEDPROC)(GLenum mode, GLint first, GLsizei count, GLsizei instancecount);
1264 typedef void (GLAD_API_PTR *PFNGLDRAWBUFFERSPROC)(GLsizei n, const GLenum * bufs);
1265 typedef void (GLAD_API_PTR *PFNGLDRAWELEMENTSPROC)(GLenum mode, GLsizei count, GLenum type, const void * indices);
1266 typedef void (GLAD_API_PTR *PFNGLDRAWELEMENTSINSTANCEDPROC)(GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei instancecount);
1267 typedef void (GLAD_API_PTR *PFNGLDRAWRANGEELEMENTSPROC)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void * indices);
1268 typedef void (GLAD_API_PTR *PFNGLENABLEPROC)(GLenum cap);
1269 typedef void (GLAD_API_PTR *PFNGLENABLEVERTEXATTRIBARRAYPROC)(GLuint index);
1270 typedef void (GLAD_API_PTR *PFNGLENDQUERYPROC)(GLenum target);
1271 typedef void (GLAD_API_PTR *PFNGLENDTRANSFORMFEEDBACKPROC)(void);
1272 typedef GLsync (GLAD_API_PTR *PFNGLFENCESYNCPROC)(GLenum condition, GLbitfield flags);
1273 typedef void (GLAD_API_PTR *PFNGLFINISHPROC)(void);
1274 typedef void (GLAD_API_PTR *PFNGLFLUSHPROC)(void);
1275 typedef void (GLAD_API_PTR *PFNGLFLUSHMAPPEDBUFFERRANGEPROC)(GLenum target, GLintptr offset, GLsizeiptr length);
1276 typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERRENDERBUFFERPROC)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
1277 typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERTEXTURE2DPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
1278 typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERTEXTURELAYERPROC)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
1279 typedef void (GLAD_API_PTR *PFNGLFRONTFACEPROC)(GLenum mode);
1280 typedef void (GLAD_API_PTR *PFNGLGENBUFFERSPROC)(GLsizei n, GLuint * buffers);
1281 typedef void (GLAD_API_PTR *PFNGLGENFRAMEBUFFERSPROC)(GLsizei n, GLuint * framebuffers);
1282 typedef void (GLAD_API_PTR *PFNGLGENQUERIESPROC)(GLsizei n, GLuint * ids);
1283 typedef void (GLAD_API_PTR *PFNGLGENRENDERBUFFERSPROC)(GLsizei n, GLuint * renderbuffers);
1284 typedef void (GLAD_API_PTR *PFNGLGENSAMPLERSPROC)(GLsizei count, GLuint * samplers);
1285 typedef void (GLAD_API_PTR *PFNGLGENTEXTURESPROC)(GLsizei n, GLuint * textures);
1286 typedef void (GLAD_API_PTR *PFNGLGENTRANSFORMFEEDBACKSPROC)(GLsizei n, GLuint * ids);
1287 typedef void (GLAD_API_PTR *PFNGLGENVERTEXARRAYSPROC)(GLsizei n, GLuint * arrays);
1288 typedef void (GLAD_API_PTR *PFNGLGENERATEMIPMAPPROC)(GLenum target);
1289 typedef void (GLAD_API_PTR *PFNGLGETACTIVEATTRIBPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name);
1290 typedef void (GLAD_API_PTR *PFNGLGETACTIVEUNIFORMPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name);
1291 typedef void (GLAD_API_PTR *PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei * length, GLchar * uniformBlockName);
1292 typedef void (GLAD_API_PTR *PFNGLGETACTIVEUNIFORMBLOCKIVPROC)(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint * params);
1293 typedef void (GLAD_API_PTR *PFNGLGETACTIVEUNIFORMSIVPROC)(GLuint program, GLsizei uniformCount, const GLuint * uniformIndices, GLenum pname, GLint * params);
1294 typedef void (GLAD_API_PTR *PFNGLGETATTACHEDSHADERSPROC)(GLuint program, GLsizei maxCount, GLsizei * count, GLuint * shaders);
1295 typedef GLint (GLAD_API_PTR *PFNGLGETATTRIBLOCATIONPROC)(GLuint program, const GLchar * name);
1296 typedef void (GLAD_API_PTR *PFNGLGETBOOLEANVPROC)(GLenum pname, GLboolean * data);
1297 typedef void (GLAD_API_PTR *PFNGLGETBUFFERPARAMETERI64VPROC)(GLenum target, GLenum pname, GLint64 * params);
1298 typedef void (GLAD_API_PTR *PFNGLGETBUFFERPARAMETERIVPROC)(GLenum target, GLenum pname, GLint * params);
1299 typedef void (GLAD_API_PTR *PFNGLGETBUFFERPOINTERVPROC)(GLenum target, GLenum pname, void ** params);
1300 typedef GLenum (GLAD_API_PTR *PFNGLGETERRORPROC)(void);
1301 typedef void (GLAD_API_PTR *PFNGLGETFLOATVPROC)(GLenum pname, GLfloat * data);
1302 typedef GLint (GLAD_API_PTR *PFNGLGETFRAGDATALOCATIONPROC)(GLuint program, const GLchar * name);
1303 typedef void (GLAD_API_PTR *PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)(GLenum target, GLenum attachment, GLenum pname, GLint * params);
1304 typedef void (GLAD_API_PTR *PFNGLGETINTEGER64I_VPROC)(GLenum target, GLuint index, GLint64 * data);
1305 typedef void (GLAD_API_PTR *PFNGLGETINTEGER64VPROC)(GLenum pname, GLint64 * data);
1306 typedef void (GLAD_API_PTR *PFNGLGETINTEGERI_VPROC)(GLenum target, GLuint index, GLint * data);
1307 typedef void (GLAD_API_PTR *PFNGLGETINTEGERVPROC)(GLenum pname, GLint * data);
1308 typedef void (GLAD_API_PTR *PFNGLGETINTERNALFORMATIVPROC)(GLenum target, GLenum internalformat, GLenum pname, GLsizei count, GLint * params);
1309 typedef void (GLAD_API_PTR *PFNGLGETPROGRAMBINARYPROC)(GLuint program, GLsizei bufSize, GLsizei * length, GLenum * binaryFormat, void * binary);
1310 typedef void (GLAD_API_PTR *PFNGLGETPROGRAMINFOLOGPROC)(GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog);
1311 typedef void (GLAD_API_PTR *PFNGLGETPROGRAMIVPROC)(GLuint program, GLenum pname, GLint * params);
1312 typedef void (GLAD_API_PTR *PFNGLGETQUERYOBJECTUIVPROC)(GLuint id, GLenum pname, GLuint * params);
1313 typedef void (GLAD_API_PTR *PFNGLGETQUERYIVPROC)(GLenum target, GLenum pname, GLint * params);
1314 typedef void (GLAD_API_PTR *PFNGLGETRENDERBUFFERPARAMETERIVPROC)(GLenum target, GLenum pname, GLint * params);
1315 typedef void (GLAD_API_PTR *PFNGLGETSAMPLERPARAMETERFVPROC)(GLuint sampler, GLenum pname, GLfloat * params);
1316 typedef void (GLAD_API_PTR *PFNGLGETSAMPLERPARAMETERIVPROC)(GLuint sampler, GLenum pname, GLint * params);
1317 typedef void (GLAD_API_PTR *PFNGLGETSHADERINFOLOGPROC)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog);
1318 typedef void (GLAD_API_PTR *PFNGLGETSHADERPRECISIONFORMATPROC)(GLenum shadertype, GLenum precisiontype, GLint * range, GLint * precision);
1319 typedef void (GLAD_API_PTR *PFNGLGETSHADERSOURCEPROC)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * source);
1320 typedef void (GLAD_API_PTR *PFNGLGETSHADERIVPROC)(GLuint shader, GLenum pname, GLint * params);
1321 typedef const GLubyte * (GLAD_API_PTR *PFNGLGETSTRINGPROC)(GLenum name);
1322 typedef const GLubyte * (GLAD_API_PTR *PFNGLGETSTRINGIPROC)(GLenum name, GLuint index);
1323 typedef void (GLAD_API_PTR *PFNGLGETSYNCIVPROC)(GLsync sync, GLenum pname, GLsizei count, GLsizei * length, GLint * values);
1324 typedef void (GLAD_API_PTR *PFNGLGETTEXPARAMETERFVPROC)(GLenum target, GLenum pname, GLfloat * params);
1325 typedef void (GLAD_API_PTR *PFNGLGETTEXPARAMETERIVPROC)(GLenum target, GLenum pname, GLint * params);
1326 typedef void (GLAD_API_PTR *PFNGLGETTRANSFORMFEEDBACKVARYINGPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, GLchar * name);
1327 typedef GLuint (GLAD_API_PTR *PFNGLGETUNIFORMBLOCKINDEXPROC)(GLuint program, const GLchar * uniformBlockName);
1328 typedef void (GLAD_API_PTR *PFNGLGETUNIFORMINDICESPROC)(GLuint program, GLsizei uniformCount, const GLchar *const* uniformNames, GLuint * uniformIndices);
1329 typedef GLint (GLAD_API_PTR *PFNGLGETUNIFORMLOCATIONPROC)(GLuint program, const GLchar * name);
1330 typedef void (GLAD_API_PTR *PFNGLGETUNIFORMFVPROC)(GLuint program, GLint location, GLfloat * params);
1331 typedef void (GLAD_API_PTR *PFNGLGETUNIFORMIVPROC)(GLuint program, GLint location, GLint * params);
1332 typedef void (GLAD_API_PTR *PFNGLGETUNIFORMUIVPROC)(GLuint program, GLint location, GLuint * params);
1333 typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBIIVPROC)(GLuint index, GLenum pname, GLint * params);
1334 typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBIUIVPROC)(GLuint index, GLenum pname, GLuint * params);
1335 typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBPOINTERVPROC)(GLuint index, GLenum pname, void ** pointer);
1336 typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBFVPROC)(GLuint index, GLenum pname, GLfloat * params);
1337 typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBIVPROC)(GLuint index, GLenum pname, GLint * params);
1338 typedef void (GLAD_API_PTR *PFNGLHINTPROC)(GLenum target, GLenum mode);
1339 typedef void (GLAD_API_PTR *PFNGLINVALIDATEFRAMEBUFFERPROC)(GLenum target, GLsizei numAttachments, const GLenum * attachments);
1340 typedef void (GLAD_API_PTR *PFNGLINVALIDATESUBFRAMEBUFFERPROC)(GLenum target, GLsizei numAttachments, const GLenum * attachments, GLint x, GLint y, GLsizei width, GLsizei height);
1341 typedef GLboolean (GLAD_API_PTR *PFNGLISBUFFERPROC)(GLuint buffer);
1342 typedef GLboolean (GLAD_API_PTR *PFNGLISENABLEDPROC)(GLenum cap);
1343 typedef GLboolean (GLAD_API_PTR *PFNGLISFRAMEBUFFERPROC)(GLuint framebuffer);
1344 typedef GLboolean (GLAD_API_PTR *PFNGLISPROGRAMPROC)(GLuint program);
1345 typedef GLboolean (GLAD_API_PTR *PFNGLISQUERYPROC)(GLuint id);
1346 typedef GLboolean (GLAD_API_PTR *PFNGLISRENDERBUFFERPROC)(GLuint renderbuffer);
1347 typedef GLboolean (GLAD_API_PTR *PFNGLISSAMPLERPROC)(GLuint sampler);
1348 typedef GLboolean (GLAD_API_PTR *PFNGLISSHADERPROC)(GLuint shader);
1349 typedef GLboolean (GLAD_API_PTR *PFNGLISSYNCPROC)(GLsync sync);
1350 typedef GLboolean (GLAD_API_PTR *PFNGLISTEXTUREPROC)(GLuint texture);
1351 typedef GLboolean (GLAD_API_PTR *PFNGLISTRANSFORMFEEDBACKPROC)(GLuint id);
1352 typedef GLboolean (GLAD_API_PTR *PFNGLISVERTEXARRAYPROC)(GLuint array);
1353 typedef void (GLAD_API_PTR *PFNGLLINEWIDTHPROC)(GLfloat width);
1354 typedef void (GLAD_API_PTR *PFNGLLINKPROGRAMPROC)(GLuint program);
1355 typedef void * (GLAD_API_PTR *PFNGLMAPBUFFERRANGEPROC)(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
1356 typedef void (GLAD_API_PTR *PFNGLPAUSETRANSFORMFEEDBACKPROC)(void);
1357 typedef void (GLAD_API_PTR *PFNGLPIXELSTOREIPROC)(GLenum pname, GLint param);
1358 typedef void (GLAD_API_PTR *PFNGLPOLYGONOFFSETPROC)(GLfloat factor, GLfloat units);
1359 typedef void (GLAD_API_PTR *PFNGLPROGRAMBINARYPROC)(GLuint program, GLenum binaryFormat, const void * binary, GLsizei length);
1360 typedef void (GLAD_API_PTR *PFNGLPROGRAMPARAMETERIPROC)(GLuint program, GLenum pname, GLint value);
1361 typedef void (GLAD_API_PTR *PFNGLREADBUFFERPROC)(GLenum src);
1362 typedef void (GLAD_API_PTR *PFNGLREADPIXELSPROC)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void * pixels);
1363 typedef void (GLAD_API_PTR *PFNGLRELEASESHADERCOMPILERPROC)(void);
1364 typedef void (GLAD_API_PTR *PFNGLRENDERBUFFERSTORAGEPROC)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
1365 typedef void (GLAD_API_PTR *PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
1366 typedef void (GLAD_API_PTR *PFNGLRESUMETRANSFORMFEEDBACKPROC)(void);
1367 typedef void (GLAD_API_PTR *PFNGLSAMPLECOVERAGEPROC)(GLfloat value, GLboolean invert);
1368 typedef void (GLAD_API_PTR *PFNGLSAMPLERPARAMETERFPROC)(GLuint sampler, GLenum pname, GLfloat param);
1369 typedef void (GLAD_API_PTR *PFNGLSAMPLERPARAMETERFVPROC)(GLuint sampler, GLenum pname, const GLfloat * param);
1370 typedef void (GLAD_API_PTR *PFNGLSAMPLERPARAMETERIPROC)(GLuint sampler, GLenum pname, GLint param);
1371 typedef void (GLAD_API_PTR *PFNGLSAMPLERPARAMETERIVPROC)(GLuint sampler, GLenum pname, const GLint * param);
1372 typedef void (GLAD_API_PTR *PFNGLSCISSORPROC)(GLint x, GLint y, GLsizei width, GLsizei height);
1373 typedef void (GLAD_API_PTR *PFNGLSHADERBINARYPROC)(GLsizei count, const GLuint * shaders, GLenum binaryFormat, const void * binary, GLsizei length);
1374 typedef void (GLAD_API_PTR *PFNGLSHADERSOURCEPROC)(GLuint shader, GLsizei count, const GLchar *const* string, const GLint * length);
1375 typedef void (GLAD_API_PTR *PFNGLSTENCILFUNCPROC)(GLenum func, GLint ref, GLuint mask);
1376 typedef void (GLAD_API_PTR *PFNGLSTENCILFUNCSEPARATEPROC)(GLenum face, GLenum func, GLint ref, GLuint mask);
1377 typedef void (GLAD_API_PTR *PFNGLSTENCILMASKPROC)(GLuint mask);
1378 typedef void (GLAD_API_PTR *PFNGLSTENCILMASKSEPARATEPROC)(GLenum face, GLuint mask);
1379 typedef void (GLAD_API_PTR *PFNGLSTENCILOPPROC)(GLenum fail, GLenum zfail, GLenum zpass);
1380 typedef void (GLAD_API_PTR *PFNGLSTENCILOPSEPARATEPROC)(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
1381 typedef void (GLAD_API_PTR *PFNGLTEXIMAGE2DPROC)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void * pixels);
1382 typedef void (GLAD_API_PTR *PFNGLTEXIMAGE3DPROC)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void * pixels);
1383 typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERFPROC)(GLenum target, GLenum pname, GLfloat param);
1384 typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERFVPROC)(GLenum target, GLenum pname, const GLfloat * params);
1385 typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERIPROC)(GLenum target, GLenum pname, GLint param);
1386 typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERIVPROC)(GLenum target, GLenum pname, const GLint * params);
1387 typedef void (GLAD_API_PTR *PFNGLTEXSTORAGE2DPROC)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
1388 typedef void (GLAD_API_PTR *PFNGLTEXSTORAGE3DPROC)(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
1389 typedef void (GLAD_API_PTR *PFNGLTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void * pixels);
1390 typedef void (GLAD_API_PTR *PFNGLTEXSUBIMAGE3DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void * pixels);
1391 typedef void (GLAD_API_PTR *PFNGLTRANSFORMFEEDBACKVARYINGSPROC)(GLuint program, GLsizei count, const GLchar *const* varyings, GLenum bufferMode);
1392 typedef void (GLAD_API_PTR *PFNGLUNIFORM1FPROC)(GLint location, GLfloat v0);
1393 typedef void (GLAD_API_PTR *PFNGLUNIFORM1FVPROC)(GLint location, GLsizei count, const GLfloat * value);
1394 typedef void (GLAD_API_PTR *PFNGLUNIFORM1IPROC)(GLint location, GLint v0);
1395 typedef void (GLAD_API_PTR *PFNGLUNIFORM1IVPROC)(GLint location, GLsizei count, const GLint * value);
1396 typedef void (GLAD_API_PTR *PFNGLUNIFORM1UIPROC)(GLint location, GLuint v0);
1397 typedef void (GLAD_API_PTR *PFNGLUNIFORM1UIVPROC)(GLint location, GLsizei count, const GLuint * value);
1398 typedef void (GLAD_API_PTR *PFNGLUNIFORM2FPROC)(GLint location, GLfloat v0, GLfloat v1);
1399 typedef void (GLAD_API_PTR *PFNGLUNIFORM2FVPROC)(GLint location, GLsizei count, const GLfloat * value);
1400 typedef void (GLAD_API_PTR *PFNGLUNIFORM2IPROC)(GLint location, GLint v0, GLint v1);
1401 typedef void (GLAD_API_PTR *PFNGLUNIFORM2IVPROC)(GLint location, GLsizei count, const GLint * value);
1402 typedef void (GLAD_API_PTR *PFNGLUNIFORM2UIPROC)(GLint location, GLuint v0, GLuint v1);
1403 typedef void (GLAD_API_PTR *PFNGLUNIFORM2UIVPROC)(GLint location, GLsizei count, const GLuint * value);
1404 typedef void (GLAD_API_PTR *PFNGLUNIFORM3FPROC)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
1405 typedef void (GLAD_API_PTR *PFNGLUNIFORM3FVPROC)(GLint location, GLsizei count, const GLfloat * value);
1406 typedef void (GLAD_API_PTR *PFNGLUNIFORM3IPROC)(GLint location, GLint v0, GLint v1, GLint v2);
1407 typedef void (GLAD_API_PTR *PFNGLUNIFORM3IVPROC)(GLint location, GLsizei count, const GLint * value);
1408 typedef void (GLAD_API_PTR *PFNGLUNIFORM3UIPROC)(GLint location, GLuint v0, GLuint v1, GLuint v2);
1409 typedef void (GLAD_API_PTR *PFNGLUNIFORM3UIVPROC)(GLint location, GLsizei count, const GLuint * value);
1410 typedef void (GLAD_API_PTR *PFNGLUNIFORM4FPROC)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
1411 typedef void (GLAD_API_PTR *PFNGLUNIFORM4FVPROC)(GLint location, GLsizei count, const GLfloat * value);
1412 typedef void (GLAD_API_PTR *PFNGLUNIFORM4IPROC)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
1413 typedef void (GLAD_API_PTR *PFNGLUNIFORM4IVPROC)(GLint location, GLsizei count, const GLint * value);
1414 typedef void (GLAD_API_PTR *PFNGLUNIFORM4UIPROC)(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
1415 typedef void (GLAD_API_PTR *PFNGLUNIFORM4UIVPROC)(GLint location, GLsizei count, const GLuint * value);
1416 typedef void (GLAD_API_PTR *PFNGLUNIFORMBLOCKBINDINGPROC)(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
1417 typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX2FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
1418 typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX2X3FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
1419 typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX2X4FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
1420 typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX3FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
1421 typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX3X2FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
1422 typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX3X4FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
1423 typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX4FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
1424 typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX4X2FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
1425 typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX4X3FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
1426 typedef GLboolean (GLAD_API_PTR *PFNGLUNMAPBUFFERPROC)(GLenum target);
1427 typedef void (GLAD_API_PTR *PFNGLUSEPROGRAMPROC)(GLuint program);
1428 typedef void (GLAD_API_PTR *PFNGLVALIDATEPROGRAMPROC)(GLuint program);
1429 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB1FPROC)(GLuint index, GLfloat x);
1430 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB1FVPROC)(GLuint index, const GLfloat * v);
1431 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB2FPROC)(GLuint index, GLfloat x, GLfloat y);
1432 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB2FVPROC)(GLuint index, const GLfloat * v);
1433 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB3FPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z);
1434 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB3FVPROC)(GLuint index, const GLfloat * v);
1435 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4FPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
1436 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4FVPROC)(GLuint index, const GLfloat * v);
1437 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBDIVISORPROC)(GLuint index, GLuint divisor);
1438 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4IPROC)(GLuint index, GLint x, GLint y, GLint z, GLint w);
1439 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4IVPROC)(GLuint index, const GLint * v);
1440 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4UIPROC)(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
1441 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4UIVPROC)(GLuint index, const GLuint * v);
1442 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBIPOINTERPROC)(GLuint index, GLint size, GLenum type, GLsizei stride, const void * pointer);
1443 typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBPOINTERPROC)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void * pointer);
1444 typedef void (GLAD_API_PTR *PFNGLVIEWPORTPROC)(GLint x, GLint y, GLsizei width, GLsizei height);
1445 typedef void (GLAD_API_PTR *PFNGLWAITSYNCPROC)(GLsync sync, GLbitfield flags, GLuint64 timeout);
1446
1447 GLAD_API_CALL PFNGLACTIVETEXTUREPROC glad_glActiveTexture;
1448 #define glActiveTexture glad_glActiveTexture
1449 GLAD_API_CALL PFNGLATTACHSHADERPROC glad_glAttachShader;
1450 #define glAttachShader glad_glAttachShader
1451 GLAD_API_CALL PFNGLBEGINQUERYPROC glad_glBeginQuery;
1452 #define glBeginQuery glad_glBeginQuery
1453 GLAD_API_CALL PFNGLBEGINTRANSFORMFEEDBACKPROC glad_glBeginTransformFeedback;
1454 #define glBeginTransformFeedback glad_glBeginTransformFeedback
1455 GLAD_API_CALL PFNGLBINDATTRIBLOCATIONPROC glad_glBindAttribLocation;
1456 #define glBindAttribLocation glad_glBindAttribLocation
1457 GLAD_API_CALL PFNGLBINDBUFFERPROC glad_glBindBuffer;
1458 #define glBindBuffer glad_glBindBuffer
1459 GLAD_API_CALL PFNGLBINDBUFFERBASEPROC glad_glBindBufferBase;
1460 #define glBindBufferBase glad_glBindBufferBase
1461 GLAD_API_CALL PFNGLBINDBUFFERRANGEPROC glad_glBindBufferRange;
1462 #define glBindBufferRange glad_glBindBufferRange
1463 GLAD_API_CALL PFNGLBINDFRAMEBUFFERPROC glad_glBindFramebuffer;
1464 #define glBindFramebuffer glad_glBindFramebuffer
1465 GLAD_API_CALL PFNGLBINDRENDERBUFFERPROC glad_glBindRenderbuffer;
1466 #define glBindRenderbuffer glad_glBindRenderbuffer
1467 GLAD_API_CALL PFNGLBINDSAMPLERPROC glad_glBindSampler;
1468 #define glBindSampler glad_glBindSampler
1469 GLAD_API_CALL PFNGLBINDTEXTUREPROC glad_glBindTexture;
1470 #define glBindTexture glad_glBindTexture
1471 GLAD_API_CALL PFNGLBINDTRANSFORMFEEDBACKPROC glad_glBindTransformFeedback;
1472 #define glBindTransformFeedback glad_glBindTransformFeedback
1473 GLAD_API_CALL PFNGLBINDVERTEXARRAYPROC glad_glBindVertexArray;
1474 #define glBindVertexArray glad_glBindVertexArray
1475 GLAD_API_CALL PFNGLBLENDCOLORPROC glad_glBlendColor;
1476 #define glBlendColor glad_glBlendColor
1477 GLAD_API_CALL PFNGLBLENDEQUATIONPROC glad_glBlendEquation;
1478 #define glBlendEquation glad_glBlendEquation
1479 GLAD_API_CALL PFNGLBLENDEQUATIONSEPARATEPROC glad_glBlendEquationSeparate;
1480 #define glBlendEquationSeparate glad_glBlendEquationSeparate
1481 GLAD_API_CALL PFNGLBLENDFUNCPROC glad_glBlendFunc;
1482 #define glBlendFunc glad_glBlendFunc
1483 GLAD_API_CALL PFNGLBLENDFUNCSEPARATEPROC glad_glBlendFuncSeparate;
1484 #define glBlendFuncSeparate glad_glBlendFuncSeparate
1485 GLAD_API_CALL PFNGLBLITFRAMEBUFFERPROC glad_glBlitFramebuffer;
1486 #define glBlitFramebuffer glad_glBlitFramebuffer
1487 GLAD_API_CALL PFNGLBUFFERDATAPROC glad_glBufferData;
1488 #define glBufferData glad_glBufferData
1489 GLAD_API_CALL PFNGLBUFFERSUBDATAPROC glad_glBufferSubData;
1490 #define glBufferSubData glad_glBufferSubData
1491 GLAD_API_CALL PFNGLCHECKFRAMEBUFFERSTATUSPROC glad_glCheckFramebufferStatus;
1492 #define glCheckFramebufferStatus glad_glCheckFramebufferStatus
1493 GLAD_API_CALL PFNGLCLEARPROC glad_glClear;
1494 #define glClear glad_glClear
1495 GLAD_API_CALL PFNGLCLEARBUFFERFIPROC glad_glClearBufferfi;
1496 #define glClearBufferfi glad_glClearBufferfi
1497 GLAD_API_CALL PFNGLCLEARBUFFERFVPROC glad_glClearBufferfv;
1498 #define glClearBufferfv glad_glClearBufferfv
1499 GLAD_API_CALL PFNGLCLEARBUFFERIVPROC glad_glClearBufferiv;
1500 #define glClearBufferiv glad_glClearBufferiv
1501 GLAD_API_CALL PFNGLCLEARBUFFERUIVPROC glad_glClearBufferuiv;
1502 #define glClearBufferuiv glad_glClearBufferuiv
1503 GLAD_API_CALL PFNGLCLEARCOLORPROC glad_glClearColor;
1504 #define glClearColor glad_glClearColor
1505 GLAD_API_CALL PFNGLCLEARDEPTHFPROC glad_glClearDepthf;
1506 #define glClearDepthf glad_glClearDepthf
1507 GLAD_API_CALL PFNGLCLEARSTENCILPROC glad_glClearStencil;
1508 #define glClearStencil glad_glClearStencil
1509 GLAD_API_CALL PFNGLCLIENTWAITSYNCPROC glad_glClientWaitSync;
1510 #define glClientWaitSync glad_glClientWaitSync
1511 GLAD_API_CALL PFNGLCOLORMASKPROC glad_glColorMask;
1512 #define glColorMask glad_glColorMask
1513 GLAD_API_CALL PFNGLCOMPILESHADERPROC glad_glCompileShader;
1514 #define glCompileShader glad_glCompileShader
1515 GLAD_API_CALL PFNGLCOMPRESSEDTEXIMAGE2DPROC glad_glCompressedTexImage2D;
1516 #define glCompressedTexImage2D glad_glCompressedTexImage2D
1517 GLAD_API_CALL PFNGLCOMPRESSEDTEXIMAGE3DPROC glad_glCompressedTexImage3D;
1518 #define glCompressedTexImage3D glad_glCompressedTexImage3D
1519 GLAD_API_CALL PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glad_glCompressedTexSubImage2D;
1520 #define glCompressedTexSubImage2D glad_glCompressedTexSubImage2D
1521 GLAD_API_CALL PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glad_glCompressedTexSubImage3D;
1522 #define glCompressedTexSubImage3D glad_glCompressedTexSubImage3D
1523 GLAD_API_CALL PFNGLCOPYBUFFERSUBDATAPROC glad_glCopyBufferSubData;
1524 #define glCopyBufferSubData glad_glCopyBufferSubData
1525 GLAD_API_CALL PFNGLCOPYTEXIMAGE2DPROC glad_glCopyTexImage2D;
1526 #define glCopyTexImage2D glad_glCopyTexImage2D
1527 GLAD_API_CALL PFNGLCOPYTEXSUBIMAGE2DPROC glad_glCopyTexSubImage2D;
1528 #define glCopyTexSubImage2D glad_glCopyTexSubImage2D
1529 GLAD_API_CALL PFNGLCOPYTEXSUBIMAGE3DPROC glad_glCopyTexSubImage3D;
1530 #define glCopyTexSubImage3D glad_glCopyTexSubImage3D
1531 GLAD_API_CALL PFNGLCREATEPROGRAMPROC glad_glCreateProgram;
1532 #define glCreateProgram glad_glCreateProgram
1533 GLAD_API_CALL PFNGLCREATESHADERPROC glad_glCreateShader;
1534 #define glCreateShader glad_glCreateShader
1535 GLAD_API_CALL PFNGLCULLFACEPROC glad_glCullFace;
1536 #define glCullFace glad_glCullFace
1537 GLAD_API_CALL PFNGLDELETEBUFFERSPROC glad_glDeleteBuffers;
1538 #define glDeleteBuffers glad_glDeleteBuffers
1539 GLAD_API_CALL PFNGLDELETEFRAMEBUFFERSPROC glad_glDeleteFramebuffers;
1540 #define glDeleteFramebuffers glad_glDeleteFramebuffers
1541 GLAD_API_CALL PFNGLDELETEPROGRAMPROC glad_glDeleteProgram;
1542 #define glDeleteProgram glad_glDeleteProgram
1543 GLAD_API_CALL PFNGLDELETEQUERIESPROC glad_glDeleteQueries;
1544 #define glDeleteQueries glad_glDeleteQueries
1545 GLAD_API_CALL PFNGLDELETERENDERBUFFERSPROC glad_glDeleteRenderbuffers;
1546 #define glDeleteRenderbuffers glad_glDeleteRenderbuffers
1547 GLAD_API_CALL PFNGLDELETESAMPLERSPROC glad_glDeleteSamplers;
1548 #define glDeleteSamplers glad_glDeleteSamplers
1549 GLAD_API_CALL PFNGLDELETESHADERPROC glad_glDeleteShader;
1550 #define glDeleteShader glad_glDeleteShader
1551 GLAD_API_CALL PFNGLDELETESYNCPROC glad_glDeleteSync;
1552 #define glDeleteSync glad_glDeleteSync
1553 GLAD_API_CALL PFNGLDELETETEXTURESPROC glad_glDeleteTextures;
1554 #define glDeleteTextures glad_glDeleteTextures
1555 GLAD_API_CALL PFNGLDELETETRANSFORMFEEDBACKSPROC glad_glDeleteTransformFeedbacks;
1556 #define glDeleteTransformFeedbacks glad_glDeleteTransformFeedbacks
1557 GLAD_API_CALL PFNGLDELETEVERTEXARRAYSPROC glad_glDeleteVertexArrays;
1558 #define glDeleteVertexArrays glad_glDeleteVertexArrays
1559 GLAD_API_CALL PFNGLDEPTHFUNCPROC glad_glDepthFunc;
1560 #define glDepthFunc glad_glDepthFunc
1561 GLAD_API_CALL PFNGLDEPTHMASKPROC glad_glDepthMask;
1562 #define glDepthMask glad_glDepthMask
1563 GLAD_API_CALL PFNGLDEPTHRANGEFPROC glad_glDepthRangef;
1564 #define glDepthRangef glad_glDepthRangef
1565 GLAD_API_CALL PFNGLDETACHSHADERPROC glad_glDetachShader;
1566 #define glDetachShader glad_glDetachShader
1567 GLAD_API_CALL PFNGLDISABLEPROC glad_glDisable;
1568 #define glDisable glad_glDisable
1569 GLAD_API_CALL PFNGLDISABLEVERTEXATTRIBARRAYPROC glad_glDisableVertexAttribArray;
1570 #define glDisableVertexAttribArray glad_glDisableVertexAttribArray
1571 GLAD_API_CALL PFNGLDRAWARRAYSPROC glad_glDrawArrays;
1572 #define glDrawArrays glad_glDrawArrays
1573 GLAD_API_CALL PFNGLDRAWARRAYSINSTANCEDPROC glad_glDrawArraysInstanced;
1574 #define glDrawArraysInstanced glad_glDrawArraysInstanced
1575 GLAD_API_CALL PFNGLDRAWBUFFERSPROC glad_glDrawBuffers;
1576 #define glDrawBuffers glad_glDrawBuffers
1577 GLAD_API_CALL PFNGLDRAWELEMENTSPROC glad_glDrawElements;
1578 #define glDrawElements glad_glDrawElements
1579 GLAD_API_CALL PFNGLDRAWELEMENTSINSTANCEDPROC glad_glDrawElementsInstanced;
1580 #define glDrawElementsInstanced glad_glDrawElementsInstanced
1581 GLAD_API_CALL PFNGLDRAWRANGEELEMENTSPROC glad_glDrawRangeElements;
1582 #define glDrawRangeElements glad_glDrawRangeElements
1583 GLAD_API_CALL PFNGLENABLEPROC glad_glEnable;
1584 #define glEnable glad_glEnable
1585 GLAD_API_CALL PFNGLENABLEVERTEXATTRIBARRAYPROC glad_glEnableVertexAttribArray;
1586 #define glEnableVertexAttribArray glad_glEnableVertexAttribArray
1587 GLAD_API_CALL PFNGLENDQUERYPROC glad_glEndQuery;
1588 #define glEndQuery glad_glEndQuery
1589 GLAD_API_CALL PFNGLENDTRANSFORMFEEDBACKPROC glad_glEndTransformFeedback;
1590 #define glEndTransformFeedback glad_glEndTransformFeedback
1591 GLAD_API_CALL PFNGLFENCESYNCPROC glad_glFenceSync;
1592 #define glFenceSync glad_glFenceSync
1593 GLAD_API_CALL PFNGLFINISHPROC glad_glFinish;
1594 #define glFinish glad_glFinish
1595 GLAD_API_CALL PFNGLFLUSHPROC glad_glFlush;
1596 #define glFlush glad_glFlush
1597 GLAD_API_CALL PFNGLFLUSHMAPPEDBUFFERRANGEPROC glad_glFlushMappedBufferRange;
1598 #define glFlushMappedBufferRange glad_glFlushMappedBufferRange
1599 GLAD_API_CALL PFNGLFRAMEBUFFERRENDERBUFFERPROC glad_glFramebufferRenderbuffer;
1600 #define glFramebufferRenderbuffer glad_glFramebufferRenderbuffer
1601 GLAD_API_CALL PFNGLFRAMEBUFFERTEXTURE2DPROC glad_glFramebufferTexture2D;
1602 #define glFramebufferTexture2D glad_glFramebufferTexture2D
1603 GLAD_API_CALL PFNGLFRAMEBUFFERTEXTURELAYERPROC glad_glFramebufferTextureLayer;
1604 #define glFramebufferTextureLayer glad_glFramebufferTextureLayer
1605 GLAD_API_CALL PFNGLFRONTFACEPROC glad_glFrontFace;
1606 #define glFrontFace glad_glFrontFace
1607 GLAD_API_CALL PFNGLGENBUFFERSPROC glad_glGenBuffers;
1608 #define glGenBuffers glad_glGenBuffers
1609 GLAD_API_CALL PFNGLGENFRAMEBUFFERSPROC glad_glGenFramebuffers;
1610 #define glGenFramebuffers glad_glGenFramebuffers
1611 GLAD_API_CALL PFNGLGENQUERIESPROC glad_glGenQueries;
1612 #define glGenQueries glad_glGenQueries
1613 GLAD_API_CALL PFNGLGENRENDERBUFFERSPROC glad_glGenRenderbuffers;
1614 #define glGenRenderbuffers glad_glGenRenderbuffers
1615 GLAD_API_CALL PFNGLGENSAMPLERSPROC glad_glGenSamplers;
1616 #define glGenSamplers glad_glGenSamplers
1617 GLAD_API_CALL PFNGLGENTEXTURESPROC glad_glGenTextures;
1618 #define glGenTextures glad_glGenTextures
1619 GLAD_API_CALL PFNGLGENTRANSFORMFEEDBACKSPROC glad_glGenTransformFeedbacks;
1620 #define glGenTransformFeedbacks glad_glGenTransformFeedbacks
1621 GLAD_API_CALL PFNGLGENVERTEXARRAYSPROC glad_glGenVertexArrays;
1622 #define glGenVertexArrays glad_glGenVertexArrays
1623 GLAD_API_CALL PFNGLGENERATEMIPMAPPROC glad_glGenerateMipmap;
1624 #define glGenerateMipmap glad_glGenerateMipmap
1625 GLAD_API_CALL PFNGLGETACTIVEATTRIBPROC glad_glGetActiveAttrib;
1626 #define glGetActiveAttrib glad_glGetActiveAttrib
1627 GLAD_API_CALL PFNGLGETACTIVEUNIFORMPROC glad_glGetActiveUniform;
1628 #define glGetActiveUniform glad_glGetActiveUniform
1629 GLAD_API_CALL PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC glad_glGetActiveUniformBlockName;
1630 #define glGetActiveUniformBlockName glad_glGetActiveUniformBlockName
1631 GLAD_API_CALL PFNGLGETACTIVEUNIFORMBLOCKIVPROC glad_glGetActiveUniformBlockiv;
1632 #define glGetActiveUniformBlockiv glad_glGetActiveUniformBlockiv
1633 GLAD_API_CALL PFNGLGETACTIVEUNIFORMSIVPROC glad_glGetActiveUniformsiv;
1634 #define glGetActiveUniformsiv glad_glGetActiveUniformsiv
1635 GLAD_API_CALL PFNGLGETATTACHEDSHADERSPROC glad_glGetAttachedShaders;
1636 #define glGetAttachedShaders glad_glGetAttachedShaders
1637 GLAD_API_CALL PFNGLGETATTRIBLOCATIONPROC glad_glGetAttribLocation;
1638 #define glGetAttribLocation glad_glGetAttribLocation
1639 GLAD_API_CALL PFNGLGETBOOLEANVPROC glad_glGetBooleanv;
1640 #define glGetBooleanv glad_glGetBooleanv
1641 GLAD_API_CALL PFNGLGETBUFFERPARAMETERI64VPROC glad_glGetBufferParameteri64v;
1642 #define glGetBufferParameteri64v glad_glGetBufferParameteri64v
1643 GLAD_API_CALL PFNGLGETBUFFERPARAMETERIVPROC glad_glGetBufferParameteriv;
1644 #define glGetBufferParameteriv glad_glGetBufferParameteriv
1645 GLAD_API_CALL PFNGLGETBUFFERPOINTERVPROC glad_glGetBufferPointerv;
1646 #define glGetBufferPointerv glad_glGetBufferPointerv
1647 GLAD_API_CALL PFNGLGETERRORPROC glad_glGetError;
1648 #define glGetError glad_glGetError
1649 GLAD_API_CALL PFNGLGETFLOATVPROC glad_glGetFloatv;
1650 #define glGetFloatv glad_glGetFloatv
1651 GLAD_API_CALL PFNGLGETFRAGDATALOCATIONPROC glad_glGetFragDataLocation;
1652 #define glGetFragDataLocation glad_glGetFragDataLocation
1653 GLAD_API_CALL PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetFramebufferAttachmentParameteriv;
1654 #define glGetFramebufferAttachmentParameteriv glad_glGetFramebufferAttachmentParameteriv
1655 GLAD_API_CALL PFNGLGETINTEGER64I_VPROC glad_glGetInteger64i_v;
1656 #define glGetInteger64i_v glad_glGetInteger64i_v
1657 GLAD_API_CALL PFNGLGETINTEGER64VPROC glad_glGetInteger64v;
1658 #define glGetInteger64v glad_glGetInteger64v
1659 GLAD_API_CALL PFNGLGETINTEGERI_VPROC glad_glGetIntegeri_v;
1660 #define glGetIntegeri_v glad_glGetIntegeri_v
1661 GLAD_API_CALL PFNGLGETINTEGERVPROC glad_glGetIntegerv;
1662 #define glGetIntegerv glad_glGetIntegerv
1663 GLAD_API_CALL PFNGLGETINTERNALFORMATIVPROC glad_glGetInternalformativ;
1664 #define glGetInternalformativ glad_glGetInternalformativ
1665 GLAD_API_CALL PFNGLGETPROGRAMBINARYPROC glad_glGetProgramBinary;
1666 #define glGetProgramBinary glad_glGetProgramBinary
1667 GLAD_API_CALL PFNGLGETPROGRAMINFOLOGPROC glad_glGetProgramInfoLog;
1668 #define glGetProgramInfoLog glad_glGetProgramInfoLog
1669 GLAD_API_CALL PFNGLGETPROGRAMIVPROC glad_glGetProgramiv;
1670 #define glGetProgramiv glad_glGetProgramiv
1671 GLAD_API_CALL PFNGLGETQUERYOBJECTUIVPROC glad_glGetQueryObjectuiv;
1672 #define glGetQueryObjectuiv glad_glGetQueryObjectuiv
1673 GLAD_API_CALL PFNGLGETQUERYIVPROC glad_glGetQueryiv;
1674 #define glGetQueryiv glad_glGetQueryiv
1675 GLAD_API_CALL PFNGLGETRENDERBUFFERPARAMETERIVPROC glad_glGetRenderbufferParameteriv;
1676 #define glGetRenderbufferParameteriv glad_glGetRenderbufferParameteriv
1677 GLAD_API_CALL PFNGLGETSAMPLERPARAMETERFVPROC glad_glGetSamplerParameterfv;
1678 #define glGetSamplerParameterfv glad_glGetSamplerParameterfv
1679 GLAD_API_CALL PFNGLGETSAMPLERPARAMETERIVPROC glad_glGetSamplerParameteriv;
1680 #define glGetSamplerParameteriv glad_glGetSamplerParameteriv
1681 GLAD_API_CALL PFNGLGETSHADERINFOLOGPROC glad_glGetShaderInfoLog;
1682 #define glGetShaderInfoLog glad_glGetShaderInfoLog
1683 GLAD_API_CALL PFNGLGETSHADERPRECISIONFORMATPROC glad_glGetShaderPrecisionFormat;
1684 #define glGetShaderPrecisionFormat glad_glGetShaderPrecisionFormat
1685 GLAD_API_CALL PFNGLGETSHADERSOURCEPROC glad_glGetShaderSource;
1686 #define glGetShaderSource glad_glGetShaderSource
1687 GLAD_API_CALL PFNGLGETSHADERIVPROC glad_glGetShaderiv;
1688 #define glGetShaderiv glad_glGetShaderiv
1689 GLAD_API_CALL PFNGLGETSTRINGPROC glad_glGetString;
1690 #define glGetString glad_glGetString
1691 GLAD_API_CALL PFNGLGETSTRINGIPROC glad_glGetStringi;
1692 #define glGetStringi glad_glGetStringi
1693 GLAD_API_CALL PFNGLGETSYNCIVPROC glad_glGetSynciv;
1694 #define glGetSynciv glad_glGetSynciv
1695 GLAD_API_CALL PFNGLGETTEXPARAMETERFVPROC glad_glGetTexParameterfv;
1696 #define glGetTexParameterfv glad_glGetTexParameterfv
1697 GLAD_API_CALL PFNGLGETTEXPARAMETERIVPROC glad_glGetTexParameteriv;
1698 #define glGetTexParameteriv glad_glGetTexParameteriv
1699 GLAD_API_CALL PFNGLGETTRANSFORMFEEDBACKVARYINGPROC glad_glGetTransformFeedbackVarying;
1700 #define glGetTransformFeedbackVarying glad_glGetTransformFeedbackVarying
1701 GLAD_API_CALL PFNGLGETUNIFORMBLOCKINDEXPROC glad_glGetUniformBlockIndex;
1702 #define glGetUniformBlockIndex glad_glGetUniformBlockIndex
1703 GLAD_API_CALL PFNGLGETUNIFORMINDICESPROC glad_glGetUniformIndices;
1704 #define glGetUniformIndices glad_glGetUniformIndices
1705 GLAD_API_CALL PFNGLGETUNIFORMLOCATIONPROC glad_glGetUniformLocation;
1706 #define glGetUniformLocation glad_glGetUniformLocation
1707 GLAD_API_CALL PFNGLGETUNIFORMFVPROC glad_glGetUniformfv;
1708 #define glGetUniformfv glad_glGetUniformfv
1709 GLAD_API_CALL PFNGLGETUNIFORMIVPROC glad_glGetUniformiv;
1710 #define glGetUniformiv glad_glGetUniformiv
1711 GLAD_API_CALL PFNGLGETUNIFORMUIVPROC glad_glGetUniformuiv;
1712 #define glGetUniformuiv glad_glGetUniformuiv
1713 GLAD_API_CALL PFNGLGETVERTEXATTRIBIIVPROC glad_glGetVertexAttribIiv;
1714 #define glGetVertexAttribIiv glad_glGetVertexAttribIiv
1715 GLAD_API_CALL PFNGLGETVERTEXATTRIBIUIVPROC glad_glGetVertexAttribIuiv;
1716 #define glGetVertexAttribIuiv glad_glGetVertexAttribIuiv
1717 GLAD_API_CALL PFNGLGETVERTEXATTRIBPOINTERVPROC glad_glGetVertexAttribPointerv;
1718 #define glGetVertexAttribPointerv glad_glGetVertexAttribPointerv
1719 GLAD_API_CALL PFNGLGETVERTEXATTRIBFVPROC glad_glGetVertexAttribfv;
1720 #define glGetVertexAttribfv glad_glGetVertexAttribfv
1721 GLAD_API_CALL PFNGLGETVERTEXATTRIBIVPROC glad_glGetVertexAttribiv;
1722 #define glGetVertexAttribiv glad_glGetVertexAttribiv
1723 GLAD_API_CALL PFNGLHINTPROC glad_glHint;
1724 #define glHint glad_glHint
1725 GLAD_API_CALL PFNGLINVALIDATEFRAMEBUFFERPROC glad_glInvalidateFramebuffer;
1726 #define glInvalidateFramebuffer glad_glInvalidateFramebuffer
1727 GLAD_API_CALL PFNGLINVALIDATESUBFRAMEBUFFERPROC glad_glInvalidateSubFramebuffer;
1728 #define glInvalidateSubFramebuffer glad_glInvalidateSubFramebuffer
1729 GLAD_API_CALL PFNGLISBUFFERPROC glad_glIsBuffer;
1730 #define glIsBuffer glad_glIsBuffer
1731 GLAD_API_CALL PFNGLISENABLEDPROC glad_glIsEnabled;
1732 #define glIsEnabled glad_glIsEnabled
1733 GLAD_API_CALL PFNGLISFRAMEBUFFERPROC glad_glIsFramebuffer;
1734 #define glIsFramebuffer glad_glIsFramebuffer
1735 GLAD_API_CALL PFNGLISPROGRAMPROC glad_glIsProgram;
1736 #define glIsProgram glad_glIsProgram
1737 GLAD_API_CALL PFNGLISQUERYPROC glad_glIsQuery;
1738 #define glIsQuery glad_glIsQuery
1739 GLAD_API_CALL PFNGLISRENDERBUFFERPROC glad_glIsRenderbuffer;
1740 #define glIsRenderbuffer glad_glIsRenderbuffer
1741 GLAD_API_CALL PFNGLISSAMPLERPROC glad_glIsSampler;
1742 #define glIsSampler glad_glIsSampler
1743 GLAD_API_CALL PFNGLISSHADERPROC glad_glIsShader;
1744 #define glIsShader glad_glIsShader
1745 GLAD_API_CALL PFNGLISSYNCPROC glad_glIsSync;
1746 #define glIsSync glad_glIsSync
1747 GLAD_API_CALL PFNGLISTEXTUREPROC glad_glIsTexture;
1748 #define glIsTexture glad_glIsTexture
1749 GLAD_API_CALL PFNGLISTRANSFORMFEEDBACKPROC glad_glIsTransformFeedback;
1750 #define glIsTransformFeedback glad_glIsTransformFeedback
1751 GLAD_API_CALL PFNGLISVERTEXARRAYPROC glad_glIsVertexArray;
1752 #define glIsVertexArray glad_glIsVertexArray
1753 GLAD_API_CALL PFNGLLINEWIDTHPROC glad_glLineWidth;
1754 #define glLineWidth glad_glLineWidth
1755 GLAD_API_CALL PFNGLLINKPROGRAMPROC glad_glLinkProgram;
1756 #define glLinkProgram glad_glLinkProgram
1757 GLAD_API_CALL PFNGLMAPBUFFERRANGEPROC glad_glMapBufferRange;
1758 #define glMapBufferRange glad_glMapBufferRange
1759 GLAD_API_CALL PFNGLPAUSETRANSFORMFEEDBACKPROC glad_glPauseTransformFeedback;
1760 #define glPauseTransformFeedback glad_glPauseTransformFeedback
1761 GLAD_API_CALL PFNGLPIXELSTOREIPROC glad_glPixelStorei;
1762 #define glPixelStorei glad_glPixelStorei
1763 GLAD_API_CALL PFNGLPOLYGONOFFSETPROC glad_glPolygonOffset;
1764 #define glPolygonOffset glad_glPolygonOffset
1765 GLAD_API_CALL PFNGLPROGRAMBINARYPROC glad_glProgramBinary;
1766 #define glProgramBinary glad_glProgramBinary
1767 GLAD_API_CALL PFNGLPROGRAMPARAMETERIPROC glad_glProgramParameteri;
1768 #define glProgramParameteri glad_glProgramParameteri
1769 GLAD_API_CALL PFNGLREADBUFFERPROC glad_glReadBuffer;
1770 #define glReadBuffer glad_glReadBuffer
1771 GLAD_API_CALL PFNGLREADPIXELSPROC glad_glReadPixels;
1772 #define glReadPixels glad_glReadPixels
1773 GLAD_API_CALL PFNGLRELEASESHADERCOMPILERPROC glad_glReleaseShaderCompiler;
1774 #define glReleaseShaderCompiler glad_glReleaseShaderCompiler
1775 GLAD_API_CALL PFNGLRENDERBUFFERSTORAGEPROC glad_glRenderbufferStorage;
1776 #define glRenderbufferStorage glad_glRenderbufferStorage
1777 GLAD_API_CALL PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC glad_glRenderbufferStorageMultisample;
1778 #define glRenderbufferStorageMultisample glad_glRenderbufferStorageMultisample
1779 GLAD_API_CALL PFNGLRESUMETRANSFORMFEEDBACKPROC glad_glResumeTransformFeedback;
1780 #define glResumeTransformFeedback glad_glResumeTransformFeedback
1781 GLAD_API_CALL PFNGLSAMPLECOVERAGEPROC glad_glSampleCoverage;
1782 #define glSampleCoverage glad_glSampleCoverage
1783 GLAD_API_CALL PFNGLSAMPLERPARAMETERFPROC glad_glSamplerParameterf;
1784 #define glSamplerParameterf glad_glSamplerParameterf
1785 GLAD_API_CALL PFNGLSAMPLERPARAMETERFVPROC glad_glSamplerParameterfv;
1786 #define glSamplerParameterfv glad_glSamplerParameterfv
1787 GLAD_API_CALL PFNGLSAMPLERPARAMETERIPROC glad_glSamplerParameteri;
1788 #define glSamplerParameteri glad_glSamplerParameteri
1789 GLAD_API_CALL PFNGLSAMPLERPARAMETERIVPROC glad_glSamplerParameteriv;
1790 #define glSamplerParameteriv glad_glSamplerParameteriv
1791 GLAD_API_CALL PFNGLSCISSORPROC glad_glScissor;
1792 #define glScissor glad_glScissor
1793 GLAD_API_CALL PFNGLSHADERBINARYPROC glad_glShaderBinary;
1794 #define glShaderBinary glad_glShaderBinary
1795 GLAD_API_CALL PFNGLSHADERSOURCEPROC glad_glShaderSource;
1796 #define glShaderSource glad_glShaderSource
1797 GLAD_API_CALL PFNGLSTENCILFUNCPROC glad_glStencilFunc;
1798 #define glStencilFunc glad_glStencilFunc
1799 GLAD_API_CALL PFNGLSTENCILFUNCSEPARATEPROC glad_glStencilFuncSeparate;
1800 #define glStencilFuncSeparate glad_glStencilFuncSeparate
1801 GLAD_API_CALL PFNGLSTENCILMASKPROC glad_glStencilMask;
1802 #define glStencilMask glad_glStencilMask
1803 GLAD_API_CALL PFNGLSTENCILMASKSEPARATEPROC glad_glStencilMaskSeparate;
1804 #define glStencilMaskSeparate glad_glStencilMaskSeparate
1805 GLAD_API_CALL PFNGLSTENCILOPPROC glad_glStencilOp;
1806 #define glStencilOp glad_glStencilOp
1807 GLAD_API_CALL PFNGLSTENCILOPSEPARATEPROC glad_glStencilOpSeparate;
1808 #define glStencilOpSeparate glad_glStencilOpSeparate
1809 GLAD_API_CALL PFNGLTEXIMAGE2DPROC glad_glTexImage2D;
1810 #define glTexImage2D glad_glTexImage2D
1811 GLAD_API_CALL PFNGLTEXIMAGE3DPROC glad_glTexImage3D;
1812 #define glTexImage3D glad_glTexImage3D
1813 GLAD_API_CALL PFNGLTEXPARAMETERFPROC glad_glTexParameterf;
1814 #define glTexParameterf glad_glTexParameterf
1815 GLAD_API_CALL PFNGLTEXPARAMETERFVPROC glad_glTexParameterfv;
1816 #define glTexParameterfv glad_glTexParameterfv
1817 GLAD_API_CALL PFNGLTEXPARAMETERIPROC glad_glTexParameteri;
1818 #define glTexParameteri glad_glTexParameteri
1819 GLAD_API_CALL PFNGLTEXPARAMETERIVPROC glad_glTexParameteriv;
1820 #define glTexParameteriv glad_glTexParameteriv
1821 GLAD_API_CALL PFNGLTEXSTORAGE2DPROC glad_glTexStorage2D;
1822 #define glTexStorage2D glad_glTexStorage2D
1823 GLAD_API_CALL PFNGLTEXSTORAGE3DPROC glad_glTexStorage3D;
1824 #define glTexStorage3D glad_glTexStorage3D
1825 GLAD_API_CALL PFNGLTEXSUBIMAGE2DPROC glad_glTexSubImage2D;
1826 #define glTexSubImage2D glad_glTexSubImage2D
1827 GLAD_API_CALL PFNGLTEXSUBIMAGE3DPROC glad_glTexSubImage3D;
1828 #define glTexSubImage3D glad_glTexSubImage3D
1829 GLAD_API_CALL PFNGLTRANSFORMFEEDBACKVARYINGSPROC glad_glTransformFeedbackVaryings;
1830 #define glTransformFeedbackVaryings glad_glTransformFeedbackVaryings
1831 GLAD_API_CALL PFNGLUNIFORM1FPROC glad_glUniform1f;
1832 #define glUniform1f glad_glUniform1f
1833 GLAD_API_CALL PFNGLUNIFORM1FVPROC glad_glUniform1fv;
1834 #define glUniform1fv glad_glUniform1fv
1835 GLAD_API_CALL PFNGLUNIFORM1IPROC glad_glUniform1i;
1836 #define glUniform1i glad_glUniform1i
1837 GLAD_API_CALL PFNGLUNIFORM1IVPROC glad_glUniform1iv;
1838 #define glUniform1iv glad_glUniform1iv
1839 GLAD_API_CALL PFNGLUNIFORM1UIPROC glad_glUniform1ui;
1840 #define glUniform1ui glad_glUniform1ui
1841 GLAD_API_CALL PFNGLUNIFORM1UIVPROC glad_glUniform1uiv;
1842 #define glUniform1uiv glad_glUniform1uiv
1843 GLAD_API_CALL PFNGLUNIFORM2FPROC glad_glUniform2f;
1844 #define glUniform2f glad_glUniform2f
1845 GLAD_API_CALL PFNGLUNIFORM2FVPROC glad_glUniform2fv;
1846 #define glUniform2fv glad_glUniform2fv
1847 GLAD_API_CALL PFNGLUNIFORM2IPROC glad_glUniform2i;
1848 #define glUniform2i glad_glUniform2i
1849 GLAD_API_CALL PFNGLUNIFORM2IVPROC glad_glUniform2iv;
1850 #define glUniform2iv glad_glUniform2iv
1851 GLAD_API_CALL PFNGLUNIFORM2UIPROC glad_glUniform2ui;
1852 #define glUniform2ui glad_glUniform2ui
1853 GLAD_API_CALL PFNGLUNIFORM2UIVPROC glad_glUniform2uiv;
1854 #define glUniform2uiv glad_glUniform2uiv
1855 GLAD_API_CALL PFNGLUNIFORM3FPROC glad_glUniform3f;
1856 #define glUniform3f glad_glUniform3f
1857 GLAD_API_CALL PFNGLUNIFORM3FVPROC glad_glUniform3fv;
1858 #define glUniform3fv glad_glUniform3fv
1859 GLAD_API_CALL PFNGLUNIFORM3IPROC glad_glUniform3i;
1860 #define glUniform3i glad_glUniform3i
1861 GLAD_API_CALL PFNGLUNIFORM3IVPROC glad_glUniform3iv;
1862 #define glUniform3iv glad_glUniform3iv
1863 GLAD_API_CALL PFNGLUNIFORM3UIPROC glad_glUniform3ui;
1864 #define glUniform3ui glad_glUniform3ui
1865 GLAD_API_CALL PFNGLUNIFORM3UIVPROC glad_glUniform3uiv;
1866 #define glUniform3uiv glad_glUniform3uiv
1867 GLAD_API_CALL PFNGLUNIFORM4FPROC glad_glUniform4f;
1868 #define glUniform4f glad_glUniform4f
1869 GLAD_API_CALL PFNGLUNIFORM4FVPROC glad_glUniform4fv;
1870 #define glUniform4fv glad_glUniform4fv
1871 GLAD_API_CALL PFNGLUNIFORM4IPROC glad_glUniform4i;
1872 #define glUniform4i glad_glUniform4i
1873 GLAD_API_CALL PFNGLUNIFORM4IVPROC glad_glUniform4iv;
1874 #define glUniform4iv glad_glUniform4iv
1875 GLAD_API_CALL PFNGLUNIFORM4UIPROC glad_glUniform4ui;
1876 #define glUniform4ui glad_glUniform4ui
1877 GLAD_API_CALL PFNGLUNIFORM4UIVPROC glad_glUniform4uiv;
1878 #define glUniform4uiv glad_glUniform4uiv
1879 GLAD_API_CALL PFNGLUNIFORMBLOCKBINDINGPROC glad_glUniformBlockBinding;
1880 #define glUniformBlockBinding glad_glUniformBlockBinding
1881 GLAD_API_CALL PFNGLUNIFORMMATRIX2FVPROC glad_glUniformMatrix2fv;
1882 #define glUniformMatrix2fv glad_glUniformMatrix2fv
1883 GLAD_API_CALL PFNGLUNIFORMMATRIX2X3FVPROC glad_glUniformMatrix2x3fv;
1884 #define glUniformMatrix2x3fv glad_glUniformMatrix2x3fv
1885 GLAD_API_CALL PFNGLUNIFORMMATRIX2X4FVPROC glad_glUniformMatrix2x4fv;
1886 #define glUniformMatrix2x4fv glad_glUniformMatrix2x4fv
1887 GLAD_API_CALL PFNGLUNIFORMMATRIX3FVPROC glad_glUniformMatrix3fv;
1888 #define glUniformMatrix3fv glad_glUniformMatrix3fv
1889 GLAD_API_CALL PFNGLUNIFORMMATRIX3X2FVPROC glad_glUniformMatrix3x2fv;
1890 #define glUniformMatrix3x2fv glad_glUniformMatrix3x2fv
1891 GLAD_API_CALL PFNGLUNIFORMMATRIX3X4FVPROC glad_glUniformMatrix3x4fv;
1892 #define glUniformMatrix3x4fv glad_glUniformMatrix3x4fv
1893 GLAD_API_CALL PFNGLUNIFORMMATRIX4FVPROC glad_glUniformMatrix4fv;
1894 #define glUniformMatrix4fv glad_glUniformMatrix4fv
1895 GLAD_API_CALL PFNGLUNIFORMMATRIX4X2FVPROC glad_glUniformMatrix4x2fv;
1896 #define glUniformMatrix4x2fv glad_glUniformMatrix4x2fv
1897 GLAD_API_CALL PFNGLUNIFORMMATRIX4X3FVPROC glad_glUniformMatrix4x3fv;
1898 #define glUniformMatrix4x3fv glad_glUniformMatrix4x3fv
1899 GLAD_API_CALL PFNGLUNMAPBUFFERPROC glad_glUnmapBuffer;
1900 #define glUnmapBuffer glad_glUnmapBuffer
1901 GLAD_API_CALL PFNGLUSEPROGRAMPROC glad_glUseProgram;
1902 #define glUseProgram glad_glUseProgram
1903 GLAD_API_CALL PFNGLVALIDATEPROGRAMPROC glad_glValidateProgram;
1904 #define glValidateProgram glad_glValidateProgram
1905 GLAD_API_CALL PFNGLVERTEXATTRIB1FPROC glad_glVertexAttrib1f;
1906 #define glVertexAttrib1f glad_glVertexAttrib1f
1907 GLAD_API_CALL PFNGLVERTEXATTRIB1FVPROC glad_glVertexAttrib1fv;
1908 #define glVertexAttrib1fv glad_glVertexAttrib1fv
1909 GLAD_API_CALL PFNGLVERTEXATTRIB2FPROC glad_glVertexAttrib2f;
1910 #define glVertexAttrib2f glad_glVertexAttrib2f
1911 GLAD_API_CALL PFNGLVERTEXATTRIB2FVPROC glad_glVertexAttrib2fv;
1912 #define glVertexAttrib2fv glad_glVertexAttrib2fv
1913 GLAD_API_CALL PFNGLVERTEXATTRIB3FPROC glad_glVertexAttrib3f;
1914 #define glVertexAttrib3f glad_glVertexAttrib3f
1915 GLAD_API_CALL PFNGLVERTEXATTRIB3FVPROC glad_glVertexAttrib3fv;
1916 #define glVertexAttrib3fv glad_glVertexAttrib3fv
1917 GLAD_API_CALL PFNGLVERTEXATTRIB4FPROC glad_glVertexAttrib4f;
1918 #define glVertexAttrib4f glad_glVertexAttrib4f
1919 GLAD_API_CALL PFNGLVERTEXATTRIB4FVPROC glad_glVertexAttrib4fv;
1920 #define glVertexAttrib4fv glad_glVertexAttrib4fv
1921 GLAD_API_CALL PFNGLVERTEXATTRIBDIVISORPROC glad_glVertexAttribDivisor;
1922 #define glVertexAttribDivisor glad_glVertexAttribDivisor
1923 GLAD_API_CALL PFNGLVERTEXATTRIBI4IPROC glad_glVertexAttribI4i;
1924 #define glVertexAttribI4i glad_glVertexAttribI4i
1925 GLAD_API_CALL PFNGLVERTEXATTRIBI4IVPROC glad_glVertexAttribI4iv;
1926 #define glVertexAttribI4iv glad_glVertexAttribI4iv
1927 GLAD_API_CALL PFNGLVERTEXATTRIBI4UIPROC glad_glVertexAttribI4ui;
1928 #define glVertexAttribI4ui glad_glVertexAttribI4ui
1929 GLAD_API_CALL PFNGLVERTEXATTRIBI4UIVPROC glad_glVertexAttribI4uiv;
1930 #define glVertexAttribI4uiv glad_glVertexAttribI4uiv
1931 GLAD_API_CALL PFNGLVERTEXATTRIBIPOINTERPROC glad_glVertexAttribIPointer;
1932 #define glVertexAttribIPointer glad_glVertexAttribIPointer
1933 GLAD_API_CALL PFNGLVERTEXATTRIBPOINTERPROC glad_glVertexAttribPointer;
1934 #define glVertexAttribPointer glad_glVertexAttribPointer
1935 GLAD_API_CALL PFNGLVIEWPORTPROC glad_glViewport;
1936 #define glViewport glad_glViewport
1937 GLAD_API_CALL PFNGLWAITSYNCPROC glad_glWaitSync;
1938 #define glWaitSync glad_glWaitSync
1939
1940
1941
1942
1943
1944 GLAD_API_CALL int gladLoadGLES2UserPtr( GLADuserptrloadfunc load, void *userptr);
1945 GLAD_API_CALL int gladLoadGLES2( GLADloadfunc load);
1946
1947
1948 #ifdef GLAD_GLES2
1949
1950 GLAD_API_CALL int gladLoaderLoadGLES2(void);
1951 GLAD_API_CALL void gladLoaderUnloadGLES2(void);
1952
1953 #endif /* GLAD_GLES2 */
1954
1955
1956 #ifdef __cplusplus
1957 }
1958 #endif
1959 #endif
1960
1961 /* Source */
1962 #ifdef GLAD_GLES2_IMPLEMENTATION
1963 #include <stdio.h>
1964 #include <stdlib.h>
1965 #include <string.h>
1966
1967 #ifndef GLAD_IMPL_UTIL_C_
1968 #define GLAD_IMPL_UTIL_C_
1969
1970 #ifdef _MSC_VER
1971 #define GLAD_IMPL_UTIL_SSCANF sscanf_s
1972 #else
1973 #define GLAD_IMPL_UTIL_SSCANF sscanf
1974 #endif
1975
1976 #endif /* GLAD_IMPL_UTIL_C_ */
1977
1978 #ifdef __cplusplus
1979 extern "C" {
1980 #endif
1981
1982
1983
1984 int GLAD_GL_ES_VERSION_2_0 = 0;
1985 int GLAD_GL_ES_VERSION_3_0 = 0;
1986
1987
1988
1989 PFNGLACTIVETEXTUREPROC glad_glActiveTexture = NULL;
1990 PFNGLATTACHSHADERPROC glad_glAttachShader = NULL;
1991 PFNGLBEGINQUERYPROC glad_glBeginQuery = NULL;
1992 PFNGLBEGINTRANSFORMFEEDBACKPROC glad_glBeginTransformFeedback = NULL;
1993 PFNGLBINDATTRIBLOCATIONPROC glad_glBindAttribLocation = NULL;
1994 PFNGLBINDBUFFERPROC glad_glBindBuffer = NULL;
1995 PFNGLBINDBUFFERBASEPROC glad_glBindBufferBase = NULL;
1996 PFNGLBINDBUFFERRANGEPROC glad_glBindBufferRange = NULL;
1997 PFNGLBINDFRAMEBUFFERPROC glad_glBindFramebuffer = NULL;
1998 PFNGLBINDRENDERBUFFERPROC glad_glBindRenderbuffer = NULL;
1999 PFNGLBINDSAMPLERPROC glad_glBindSampler = NULL;
2000 PFNGLBINDTEXTUREPROC glad_glBindTexture = NULL;
2001 PFNGLBINDTRANSFORMFEEDBACKPROC glad_glBindTransformFeedback = NULL;
2002 PFNGLBINDVERTEXARRAYPROC glad_glBindVertexArray = NULL;
2003 PFNGLBLENDCOLORPROC glad_glBlendColor = NULL;
2004 PFNGLBLENDEQUATIONPROC glad_glBlendEquation = NULL;
2005 PFNGLBLENDEQUATIONSEPARATEPROC glad_glBlendEquationSeparate = NULL;
2006 PFNGLBLENDFUNCPROC glad_glBlendFunc = NULL;
2007 PFNGLBLENDFUNCSEPARATEPROC glad_glBlendFuncSeparate = NULL;
2008 PFNGLBLITFRAMEBUFFERPROC glad_glBlitFramebuffer = NULL;
2009 PFNGLBUFFERDATAPROC glad_glBufferData = NULL;
2010 PFNGLBUFFERSUBDATAPROC glad_glBufferSubData = NULL;
2011 PFNGLCHECKFRAMEBUFFERSTATUSPROC glad_glCheckFramebufferStatus = NULL;
2012 PFNGLCLEARPROC glad_glClear = NULL;
2013 PFNGLCLEARBUFFERFIPROC glad_glClearBufferfi = NULL;
2014 PFNGLCLEARBUFFERFVPROC glad_glClearBufferfv = NULL;
2015 PFNGLCLEARBUFFERIVPROC glad_glClearBufferiv = NULL;
2016 PFNGLCLEARBUFFERUIVPROC glad_glClearBufferuiv = NULL;
2017 PFNGLCLEARCOLORPROC glad_glClearColor = NULL;
2018 PFNGLCLEARDEPTHFPROC glad_glClearDepthf = NULL;
2019 PFNGLCLEARSTENCILPROC glad_glClearStencil = NULL;
2020 PFNGLCLIENTWAITSYNCPROC glad_glClientWaitSync = NULL;
2021 PFNGLCOLORMASKPROC glad_glColorMask = NULL;
2022 PFNGLCOMPILESHADERPROC glad_glCompileShader = NULL;
2023 PFNGLCOMPRESSEDTEXIMAGE2DPROC glad_glCompressedTexImage2D = NULL;
2024 PFNGLCOMPRESSEDTEXIMAGE3DPROC glad_glCompressedTexImage3D = NULL;
2025 PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glad_glCompressedTexSubImage2D = NULL;
2026 PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glad_glCompressedTexSubImage3D = NULL;
2027 PFNGLCOPYBUFFERSUBDATAPROC glad_glCopyBufferSubData = NULL;
2028 PFNGLCOPYTEXIMAGE2DPROC glad_glCopyTexImage2D = NULL;
2029 PFNGLCOPYTEXSUBIMAGE2DPROC glad_glCopyTexSubImage2D = NULL;
2030 PFNGLCOPYTEXSUBIMAGE3DPROC glad_glCopyTexSubImage3D = NULL;
2031 PFNGLCREATEPROGRAMPROC glad_glCreateProgram = NULL;
2032 PFNGLCREATESHADERPROC glad_glCreateShader = NULL;
2033 PFNGLCULLFACEPROC glad_glCullFace = NULL;
2034 PFNGLDELETEBUFFERSPROC glad_glDeleteBuffers = NULL;
2035 PFNGLDELETEFRAMEBUFFERSPROC glad_glDeleteFramebuffers = NULL;
2036 PFNGLDELETEPROGRAMPROC glad_glDeleteProgram = NULL;
2037 PFNGLDELETEQUERIESPROC glad_glDeleteQueries = NULL;
2038 PFNGLDELETERENDERBUFFERSPROC glad_glDeleteRenderbuffers = NULL;
2039 PFNGLDELETESAMPLERSPROC glad_glDeleteSamplers = NULL;
2040 PFNGLDELETESHADERPROC glad_glDeleteShader = NULL;
2041 PFNGLDELETESYNCPROC glad_glDeleteSync = NULL;
2042 PFNGLDELETETEXTURESPROC glad_glDeleteTextures = NULL;
2043 PFNGLDELETETRANSFORMFEEDBACKSPROC glad_glDeleteTransformFeedbacks = NULL;
2044 PFNGLDELETEVERTEXARRAYSPROC glad_glDeleteVertexArrays = NULL;
2045 PFNGLDEPTHFUNCPROC glad_glDepthFunc = NULL;
2046 PFNGLDEPTHMASKPROC glad_glDepthMask = NULL;
2047 PFNGLDEPTHRANGEFPROC glad_glDepthRangef = NULL;
2048 PFNGLDETACHSHADERPROC glad_glDetachShader = NULL;
2049 PFNGLDISABLEPROC glad_glDisable = NULL;
2050 PFNGLDISABLEVERTEXATTRIBARRAYPROC glad_glDisableVertexAttribArray = NULL;
2051 PFNGLDRAWARRAYSPROC glad_glDrawArrays = NULL;
2052 PFNGLDRAWARRAYSINSTANCEDPROC glad_glDrawArraysInstanced = NULL;
2053 PFNGLDRAWBUFFERSPROC glad_glDrawBuffers = NULL;
2054 PFNGLDRAWELEMENTSPROC glad_glDrawElements = NULL;
2055 PFNGLDRAWELEMENTSINSTANCEDPROC glad_glDrawElementsInstanced = NULL;
2056 PFNGLDRAWRANGEELEMENTSPROC glad_glDrawRangeElements = NULL;
2057 PFNGLENABLEPROC glad_glEnable = NULL;
2058 PFNGLENABLEVERTEXATTRIBARRAYPROC glad_glEnableVertexAttribArray = NULL;
2059 PFNGLENDQUERYPROC glad_glEndQuery = NULL;
2060 PFNGLENDTRANSFORMFEEDBACKPROC glad_glEndTransformFeedback = NULL;
2061 PFNGLFENCESYNCPROC glad_glFenceSync = NULL;
2062 PFNGLFINISHPROC glad_glFinish = NULL;
2063 PFNGLFLUSHPROC glad_glFlush = NULL;
2064 PFNGLFLUSHMAPPEDBUFFERRANGEPROC glad_glFlushMappedBufferRange = NULL;
2065 PFNGLFRAMEBUFFERRENDERBUFFERPROC glad_glFramebufferRenderbuffer = NULL;
2066 PFNGLFRAMEBUFFERTEXTURE2DPROC glad_glFramebufferTexture2D = NULL;
2067 PFNGLFRAMEBUFFERTEXTURELAYERPROC glad_glFramebufferTextureLayer = NULL;
2068 PFNGLFRONTFACEPROC glad_glFrontFace = NULL;
2069 PFNGLGENBUFFERSPROC glad_glGenBuffers = NULL;
2070 PFNGLGENFRAMEBUFFERSPROC glad_glGenFramebuffers = NULL;
2071 PFNGLGENQUERIESPROC glad_glGenQueries = NULL;
2072 PFNGLGENRENDERBUFFERSPROC glad_glGenRenderbuffers = NULL;
2073 PFNGLGENSAMPLERSPROC glad_glGenSamplers = NULL;
2074 PFNGLGENTEXTURESPROC glad_glGenTextures = NULL;
2075 PFNGLGENTRANSFORMFEEDBACKSPROC glad_glGenTransformFeedbacks = NULL;
2076 PFNGLGENVERTEXARRAYSPROC glad_glGenVertexArrays = NULL;
2077 PFNGLGENERATEMIPMAPPROC glad_glGenerateMipmap = NULL;
2078 PFNGLGETACTIVEATTRIBPROC glad_glGetActiveAttrib = NULL;
2079 PFNGLGETACTIVEUNIFORMPROC glad_glGetActiveUniform = NULL;
2080 PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC glad_glGetActiveUniformBlockName = NULL;
2081 PFNGLGETACTIVEUNIFORMBLOCKIVPROC glad_glGetActiveUniformBlockiv = NULL;
2082 PFNGLGETACTIVEUNIFORMSIVPROC glad_glGetActiveUniformsiv = NULL;
2083 PFNGLGETATTACHEDSHADERSPROC glad_glGetAttachedShaders = NULL;
2084 PFNGLGETATTRIBLOCATIONPROC glad_glGetAttribLocation = NULL;
2085 PFNGLGETBOOLEANVPROC glad_glGetBooleanv = NULL;
2086 PFNGLGETBUFFERPARAMETERI64VPROC glad_glGetBufferParameteri64v = NULL;
2087 PFNGLGETBUFFERPARAMETERIVPROC glad_glGetBufferParameteriv = NULL;
2088 PFNGLGETBUFFERPOINTERVPROC glad_glGetBufferPointerv = NULL;
2089 PFNGLGETERRORPROC glad_glGetError = NULL;
2090 PFNGLGETFLOATVPROC glad_glGetFloatv = NULL;
2091 PFNGLGETFRAGDATALOCATIONPROC glad_glGetFragDataLocation = NULL;
2092 PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetFramebufferAttachmentParameteriv = NULL;
2093 PFNGLGETINTEGER64I_VPROC glad_glGetInteger64i_v = NULL;
2094 PFNGLGETINTEGER64VPROC glad_glGetInteger64v = NULL;
2095 PFNGLGETINTEGERI_VPROC glad_glGetIntegeri_v = NULL;
2096 PFNGLGETINTEGERVPROC glad_glGetIntegerv = NULL;
2097 PFNGLGETINTERNALFORMATIVPROC glad_glGetInternalformativ = NULL;
2098 PFNGLGETPROGRAMBINARYPROC glad_glGetProgramBinary = NULL;
2099 PFNGLGETPROGRAMINFOLOGPROC glad_glGetProgramInfoLog = NULL;
2100 PFNGLGETPROGRAMIVPROC glad_glGetProgramiv = NULL;
2101 PFNGLGETQUERYOBJECTUIVPROC glad_glGetQueryObjectuiv = NULL;
2102 PFNGLGETQUERYIVPROC glad_glGetQueryiv = NULL;
2103 PFNGLGETRENDERBUFFERPARAMETERIVPROC glad_glGetRenderbufferParameteriv = NULL;
2104 PFNGLGETSAMPLERPARAMETERFVPROC glad_glGetSamplerParameterfv = NULL;
2105 PFNGLGETSAMPLERPARAMETERIVPROC glad_glGetSamplerParameteriv = NULL;
2106 PFNGLGETSHADERINFOLOGPROC glad_glGetShaderInfoLog = NULL;
2107 PFNGLGETSHADERPRECISIONFORMATPROC glad_glGetShaderPrecisionFormat = NULL;
2108 PFNGLGETSHADERSOURCEPROC glad_glGetShaderSource = NULL;
2109 PFNGLGETSHADERIVPROC glad_glGetShaderiv = NULL;
2110 PFNGLGETSTRINGPROC glad_glGetString = NULL;
2111 PFNGLGETSTRINGIPROC glad_glGetStringi = NULL;
2112 PFNGLGETSYNCIVPROC glad_glGetSynciv = NULL;
2113 PFNGLGETTEXPARAMETERFVPROC glad_glGetTexParameterfv = NULL;
2114 PFNGLGETTEXPARAMETERIVPROC glad_glGetTexParameteriv = NULL;
2115 PFNGLGETTRANSFORMFEEDBACKVARYINGPROC glad_glGetTransformFeedbackVarying = NULL;
2116 PFNGLGETUNIFORMBLOCKINDEXPROC glad_glGetUniformBlockIndex = NULL;
2117 PFNGLGETUNIFORMINDICESPROC glad_glGetUniformIndices = NULL;
2118 PFNGLGETUNIFORMLOCATIONPROC glad_glGetUniformLocation = NULL;
2119 PFNGLGETUNIFORMFVPROC glad_glGetUniformfv = NULL;
2120 PFNGLGETUNIFORMIVPROC glad_glGetUniformiv = NULL;
2121 PFNGLGETUNIFORMUIVPROC glad_glGetUniformuiv = NULL;
2122 PFNGLGETVERTEXATTRIBIIVPROC glad_glGetVertexAttribIiv = NULL;
2123 PFNGLGETVERTEXATTRIBIUIVPROC glad_glGetVertexAttribIuiv = NULL;
2124 PFNGLGETVERTEXATTRIBPOINTERVPROC glad_glGetVertexAttribPointerv = NULL;
2125 PFNGLGETVERTEXATTRIBFVPROC glad_glGetVertexAttribfv = NULL;
2126 PFNGLGETVERTEXATTRIBIVPROC glad_glGetVertexAttribiv = NULL;
2127 PFNGLHINTPROC glad_glHint = NULL;
2128 PFNGLINVALIDATEFRAMEBUFFERPROC glad_glInvalidateFramebuffer = NULL;
2129 PFNGLINVALIDATESUBFRAMEBUFFERPROC glad_glInvalidateSubFramebuffer = NULL;
2130 PFNGLISBUFFERPROC glad_glIsBuffer = NULL;
2131 PFNGLISENABLEDPROC glad_glIsEnabled = NULL;
2132 PFNGLISFRAMEBUFFERPROC glad_glIsFramebuffer = NULL;
2133 PFNGLISPROGRAMPROC glad_glIsProgram = NULL;
2134 PFNGLISQUERYPROC glad_glIsQuery = NULL;
2135 PFNGLISRENDERBUFFERPROC glad_glIsRenderbuffer = NULL;
2136 PFNGLISSAMPLERPROC glad_glIsSampler = NULL;
2137 PFNGLISSHADERPROC glad_glIsShader = NULL;
2138 PFNGLISSYNCPROC glad_glIsSync = NULL;
2139 PFNGLISTEXTUREPROC glad_glIsTexture = NULL;
2140 PFNGLISTRANSFORMFEEDBACKPROC glad_glIsTransformFeedback = NULL;
2141 PFNGLISVERTEXARRAYPROC glad_glIsVertexArray = NULL;
2142 PFNGLLINEWIDTHPROC glad_glLineWidth = NULL;
2143 PFNGLLINKPROGRAMPROC glad_glLinkProgram = NULL;
2144 PFNGLMAPBUFFERRANGEPROC glad_glMapBufferRange = NULL;
2145 PFNGLPAUSETRANSFORMFEEDBACKPROC glad_glPauseTransformFeedback = NULL;
2146 PFNGLPIXELSTOREIPROC glad_glPixelStorei = NULL;
2147 PFNGLPOLYGONOFFSETPROC glad_glPolygonOffset = NULL;
2148 PFNGLPROGRAMBINARYPROC glad_glProgramBinary = NULL;
2149 PFNGLPROGRAMPARAMETERIPROC glad_glProgramParameteri = NULL;
2150 PFNGLREADBUFFERPROC glad_glReadBuffer = NULL;
2151 PFNGLREADPIXELSPROC glad_glReadPixels = NULL;
2152 PFNGLRELEASESHADERCOMPILERPROC glad_glReleaseShaderCompiler = NULL;
2153 PFNGLRENDERBUFFERSTORAGEPROC glad_glRenderbufferStorage = NULL;
2154 PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC glad_glRenderbufferStorageMultisample = NULL;
2155 PFNGLRESUMETRANSFORMFEEDBACKPROC glad_glResumeTransformFeedback = NULL;
2156 PFNGLSAMPLECOVERAGEPROC glad_glSampleCoverage = NULL;
2157 PFNGLSAMPLERPARAMETERFPROC glad_glSamplerParameterf = NULL;
2158 PFNGLSAMPLERPARAMETERFVPROC glad_glSamplerParameterfv = NULL;
2159 PFNGLSAMPLERPARAMETERIPROC glad_glSamplerParameteri = NULL;
2160 PFNGLSAMPLERPARAMETERIVPROC glad_glSamplerParameteriv = NULL;
2161 PFNGLSCISSORPROC glad_glScissor = NULL;
2162 PFNGLSHADERBINARYPROC glad_glShaderBinary = NULL;
2163 PFNGLSHADERSOURCEPROC glad_glShaderSource = NULL;
2164 PFNGLSTENCILFUNCPROC glad_glStencilFunc = NULL;
2165 PFNGLSTENCILFUNCSEPARATEPROC glad_glStencilFuncSeparate = NULL;
2166 PFNGLSTENCILMASKPROC glad_glStencilMask = NULL;
2167 PFNGLSTENCILMASKSEPARATEPROC glad_glStencilMaskSeparate = NULL;
2168 PFNGLSTENCILOPPROC glad_glStencilOp = NULL;
2169 PFNGLSTENCILOPSEPARATEPROC glad_glStencilOpSeparate = NULL;
2170 PFNGLTEXIMAGE2DPROC glad_glTexImage2D = NULL;
2171 PFNGLTEXIMAGE3DPROC glad_glTexImage3D = NULL;
2172 PFNGLTEXPARAMETERFPROC glad_glTexParameterf = NULL;
2173 PFNGLTEXPARAMETERFVPROC glad_glTexParameterfv = NULL;
2174 PFNGLTEXPARAMETERIPROC glad_glTexParameteri = NULL;
2175 PFNGLTEXPARAMETERIVPROC glad_glTexParameteriv = NULL;
2176 PFNGLTEXSTORAGE2DPROC glad_glTexStorage2D = NULL;
2177 PFNGLTEXSTORAGE3DPROC glad_glTexStorage3D = NULL;
2178 PFNGLTEXSUBIMAGE2DPROC glad_glTexSubImage2D = NULL;
2179 PFNGLTEXSUBIMAGE3DPROC glad_glTexSubImage3D = NULL;
2180 PFNGLTRANSFORMFEEDBACKVARYINGSPROC glad_glTransformFeedbackVaryings = NULL;
2181 PFNGLUNIFORM1FPROC glad_glUniform1f = NULL;
2182 PFNGLUNIFORM1FVPROC glad_glUniform1fv = NULL;
2183 PFNGLUNIFORM1IPROC glad_glUniform1i = NULL;
2184 PFNGLUNIFORM1IVPROC glad_glUniform1iv = NULL;
2185 PFNGLUNIFORM1UIPROC glad_glUniform1ui = NULL;
2186 PFNGLUNIFORM1UIVPROC glad_glUniform1uiv = NULL;
2187 PFNGLUNIFORM2FPROC glad_glUniform2f = NULL;
2188 PFNGLUNIFORM2FVPROC glad_glUniform2fv = NULL;
2189 PFNGLUNIFORM2IPROC glad_glUniform2i = NULL;
2190 PFNGLUNIFORM2IVPROC glad_glUniform2iv = NULL;
2191 PFNGLUNIFORM2UIPROC glad_glUniform2ui = NULL;
2192 PFNGLUNIFORM2UIVPROC glad_glUniform2uiv = NULL;
2193 PFNGLUNIFORM3FPROC glad_glUniform3f = NULL;
2194 PFNGLUNIFORM3FVPROC glad_glUniform3fv = NULL;
2195 PFNGLUNIFORM3IPROC glad_glUniform3i = NULL;
2196 PFNGLUNIFORM3IVPROC glad_glUniform3iv = NULL;
2197 PFNGLUNIFORM3UIPROC glad_glUniform3ui = NULL;
2198 PFNGLUNIFORM3UIVPROC glad_glUniform3uiv = NULL;
2199 PFNGLUNIFORM4FPROC glad_glUniform4f = NULL;
2200 PFNGLUNIFORM4FVPROC glad_glUniform4fv = NULL;
2201 PFNGLUNIFORM4IPROC glad_glUniform4i = NULL;
2202 PFNGLUNIFORM4IVPROC glad_glUniform4iv = NULL;
2203 PFNGLUNIFORM4UIPROC glad_glUniform4ui = NULL;
2204 PFNGLUNIFORM4UIVPROC glad_glUniform4uiv = NULL;
2205 PFNGLUNIFORMBLOCKBINDINGPROC glad_glUniformBlockBinding = NULL;
2206 PFNGLUNIFORMMATRIX2FVPROC glad_glUniformMatrix2fv = NULL;
2207 PFNGLUNIFORMMATRIX2X3FVPROC glad_glUniformMatrix2x3fv = NULL;
2208 PFNGLUNIFORMMATRIX2X4FVPROC glad_glUniformMatrix2x4fv = NULL;
2209 PFNGLUNIFORMMATRIX3FVPROC glad_glUniformMatrix3fv = NULL;
2210 PFNGLUNIFORMMATRIX3X2FVPROC glad_glUniformMatrix3x2fv = NULL;
2211 PFNGLUNIFORMMATRIX3X4FVPROC glad_glUniformMatrix3x4fv = NULL;
2212 PFNGLUNIFORMMATRIX4FVPROC glad_glUniformMatrix4fv = NULL;
2213 PFNGLUNIFORMMATRIX4X2FVPROC glad_glUniformMatrix4x2fv = NULL;
2214 PFNGLUNIFORMMATRIX4X3FVPROC glad_glUniformMatrix4x3fv = NULL;
2215 PFNGLUNMAPBUFFERPROC glad_glUnmapBuffer = NULL;
2216 PFNGLUSEPROGRAMPROC glad_glUseProgram = NULL;
2217 PFNGLVALIDATEPROGRAMPROC glad_glValidateProgram = NULL;
2218 PFNGLVERTEXATTRIB1FPROC glad_glVertexAttrib1f = NULL;
2219 PFNGLVERTEXATTRIB1FVPROC glad_glVertexAttrib1fv = NULL;
2220 PFNGLVERTEXATTRIB2FPROC glad_glVertexAttrib2f = NULL;
2221 PFNGLVERTEXATTRIB2FVPROC glad_glVertexAttrib2fv = NULL;
2222 PFNGLVERTEXATTRIB3FPROC glad_glVertexAttrib3f = NULL;
2223 PFNGLVERTEXATTRIB3FVPROC glad_glVertexAttrib3fv = NULL;
2224 PFNGLVERTEXATTRIB4FPROC glad_glVertexAttrib4f = NULL;
2225 PFNGLVERTEXATTRIB4FVPROC glad_glVertexAttrib4fv = NULL;
2226 PFNGLVERTEXATTRIBDIVISORPROC glad_glVertexAttribDivisor = NULL;
2227 PFNGLVERTEXATTRIBI4IPROC glad_glVertexAttribI4i = NULL;
2228 PFNGLVERTEXATTRIBI4IVPROC glad_glVertexAttribI4iv = NULL;
2229 PFNGLVERTEXATTRIBI4UIPROC glad_glVertexAttribI4ui = NULL;
2230 PFNGLVERTEXATTRIBI4UIVPROC glad_glVertexAttribI4uiv = NULL;
2231 PFNGLVERTEXATTRIBIPOINTERPROC glad_glVertexAttribIPointer = NULL;
2232 PFNGLVERTEXATTRIBPOINTERPROC glad_glVertexAttribPointer = NULL;
2233 PFNGLVIEWPORTPROC glad_glViewport = NULL;
2234 PFNGLWAITSYNCPROC glad_glWaitSync = NULL;
2235
2236
2237 static void glad_gl_load_GL_ES_VERSION_2_0( GLADuserptrloadfunc load, void* userptr) {
2238 if(!GLAD_GL_ES_VERSION_2_0) return;
2239 glad_glActiveTexture = (PFNGLACTIVETEXTUREPROC) load(userptr, "glActiveTexture");
2240 glad_glAttachShader = (PFNGLATTACHSHADERPROC) load(userptr, "glAttachShader");
2241 glad_glBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC) load(userptr, "glBindAttribLocation");
2242 glad_glBindBuffer = (PFNGLBINDBUFFERPROC) load(userptr, "glBindBuffer");
2243 glad_glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC) load(userptr, "glBindFramebuffer");
2244 glad_glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC) load(userptr, "glBindRenderbuffer");
2245 glad_glBindTexture = (PFNGLBINDTEXTUREPROC) load(userptr, "glBindTexture");
2246 glad_glBlendColor = (PFNGLBLENDCOLORPROC) load(userptr, "glBlendColor");
2247 glad_glBlendEquation = (PFNGLBLENDEQUATIONPROC) load(userptr, "glBlendEquation");
2248 glad_glBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC) load(userptr, "glBlendEquationSeparate");
2249 glad_glBlendFunc = (PFNGLBLENDFUNCPROC) load(userptr, "glBlendFunc");
2250 glad_glBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC) load(userptr, "glBlendFuncSeparate");
2251 glad_glBufferData = (PFNGLBUFFERDATAPROC) load(userptr, "glBufferData");
2252 glad_glBufferSubData = (PFNGLBUFFERSUBDATAPROC) load(userptr, "glBufferSubData");
2253 glad_glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC) load(userptr, "glCheckFramebufferStatus");
2254 glad_glClear = (PFNGLCLEARPROC) load(userptr, "glClear");
2255 glad_glClearColor = (PFNGLCLEARCOLORPROC) load(userptr, "glClearColor");
2256 glad_glClearDepthf = (PFNGLCLEARDEPTHFPROC) load(userptr, "glClearDepthf");
2257 glad_glClearStencil = (PFNGLCLEARSTENCILPROC) load(userptr, "glClearStencil");
2258 glad_glColorMask = (PFNGLCOLORMASKPROC) load(userptr, "glColorMask");
2259 glad_glCompileShader = (PFNGLCOMPILESHADERPROC) load(userptr, "glCompileShader");
2260 glad_glCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC) load(userptr, "glCompressedTexImage2D");
2261 glad_glCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) load(userptr, "glCompressedTexSubImage2D");
2262 glad_glCopyTexImage2D = (PFNGLCOPYTEXIMAGE2DPROC) load(userptr, "glCopyTexImage2D");
2263 glad_glCopyTexSubImage2D = (PFNGLCOPYTEXSUBIMAGE2DPROC) load(userptr, "glCopyTexSubImage2D");
2264 glad_glCreateProgram = (PFNGLCREATEPROGRAMPROC) load(userptr, "glCreateProgram");
2265 glad_glCreateShader = (PFNGLCREATESHADERPROC) load(userptr, "glCreateShader");
2266 glad_glCullFace = (PFNGLCULLFACEPROC) load(userptr, "glCullFace");
2267 glad_glDeleteBuffers = (PFNGLDELETEBUFFERSPROC) load(userptr, "glDeleteBuffers");
2268 glad_glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC) load(userptr, "glDeleteFramebuffers");
2269 glad_glDeleteProgram = (PFNGLDELETEPROGRAMPROC) load(userptr, "glDeleteProgram");
2270 glad_glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC) load(userptr, "glDeleteRenderbuffers");
2271 glad_glDeleteShader = (PFNGLDELETESHADERPROC) load(userptr, "glDeleteShader");
2272 glad_glDeleteTextures = (PFNGLDELETETEXTURESPROC) load(userptr, "glDeleteTextures");
2273 glad_glDepthFunc = (PFNGLDEPTHFUNCPROC) load(userptr, "glDepthFunc");
2274 glad_glDepthMask = (PFNGLDEPTHMASKPROC) load(userptr, "glDepthMask");
2275 glad_glDepthRangef = (PFNGLDEPTHRANGEFPROC) load(userptr, "glDepthRangef");
2276 glad_glDetachShader = (PFNGLDETACHSHADERPROC) load(userptr, "glDetachShader");
2277 glad_glDisable = (PFNGLDISABLEPROC) load(userptr, "glDisable");
2278 glad_glDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC) load(userptr, "glDisableVertexAttribArray");
2279 glad_glDrawArrays = (PFNGLDRAWARRAYSPROC) load(userptr, "glDrawArrays");
2280 glad_glDrawElements = (PFNGLDRAWELEMENTSPROC) load(userptr, "glDrawElements");
2281 glad_glEnable = (PFNGLENABLEPROC) load(userptr, "glEnable");
2282 glad_glEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC) load(userptr, "glEnableVertexAttribArray");
2283 glad_glFinish = (PFNGLFINISHPROC) load(userptr, "glFinish");
2284 glad_glFlush = (PFNGLFLUSHPROC) load(userptr, "glFlush");
2285 glad_glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC) load(userptr, "glFramebufferRenderbuffer");
2286 glad_glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC) load(userptr, "glFramebufferTexture2D");
2287 glad_glFrontFace = (PFNGLFRONTFACEPROC) load(userptr, "glFrontFace");
2288 glad_glGenBuffers = (PFNGLGENBUFFERSPROC) load(userptr, "glGenBuffers");
2289 glad_glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC) load(userptr, "glGenFramebuffers");
2290 glad_glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC) load(userptr, "glGenRenderbuffers");
2291 glad_glGenTextures = (PFNGLGENTEXTURESPROC) load(userptr, "glGenTextures");
2292 glad_glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC) load(userptr, "glGenerateMipmap");
2293 glad_glGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC) load(userptr, "glGetActiveAttrib");
2294 glad_glGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC) load(userptr, "glGetActiveUniform");
2295 glad_glGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC) load(userptr, "glGetAttachedShaders");
2296 glad_glGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC) load(userptr, "glGetAttribLocation");
2297 glad_glGetBooleanv = (PFNGLGETBOOLEANVPROC) load(userptr, "glGetBooleanv");
2298 glad_glGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC) load(userptr, "glGetBufferParameteriv");
2299 glad_glGetError = (PFNGLGETERRORPROC) load(userptr, "glGetError");
2300 glad_glGetFloatv = (PFNGLGETFLOATVPROC) load(userptr, "glGetFloatv");
2301 glad_glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) load(userptr, "glGetFramebufferAttachmentParameteriv");
2302 glad_glGetIntegerv = (PFNGLGETINTEGERVPROC) load(userptr, "glGetIntegerv");
2303 glad_glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC) load(userptr, "glGetProgramInfoLog");
2304 glad_glGetProgramiv = (PFNGLGETPROGRAMIVPROC) load(userptr, "glGetProgramiv");
2305 glad_glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC) load(userptr, "glGetRenderbufferParameteriv");
2306 glad_glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC) load(userptr, "glGetShaderInfoLog");
2307 glad_glGetShaderPrecisionFormat = (PFNGLGETSHADERPRECISIONFORMATPROC) load(userptr, "glGetShaderPrecisionFormat");
2308 glad_glGetShaderSource = (PFNGLGETSHADERSOURCEPROC) load(userptr, "glGetShaderSource");
2309 glad_glGetShaderiv = (PFNGLGETSHADERIVPROC) load(userptr, "glGetShaderiv");
2310 glad_glGetString = (PFNGLGETSTRINGPROC) load(userptr, "glGetString");
2311 glad_glGetTexParameterfv = (PFNGLGETTEXPARAMETERFVPROC) load(userptr, "glGetTexParameterfv");
2312 glad_glGetTexParameteriv = (PFNGLGETTEXPARAMETERIVPROC) load(userptr, "glGetTexParameteriv");
2313 glad_glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC) load(userptr, "glGetUniformLocation");
2314 glad_glGetUniformfv = (PFNGLGETUNIFORMFVPROC) load(userptr, "glGetUniformfv");
2315 glad_glGetUniformiv = (PFNGLGETUNIFORMIVPROC) load(userptr, "glGetUniformiv");
2316 glad_glGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC) load(userptr, "glGetVertexAttribPointerv");
2317 glad_glGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC) load(userptr, "glGetVertexAttribfv");
2318 glad_glGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC) load(userptr, "glGetVertexAttribiv");
2319 glad_glHint = (PFNGLHINTPROC) load(userptr, "glHint");
2320 glad_glIsBuffer = (PFNGLISBUFFERPROC) load(userptr, "glIsBuffer");
2321 glad_glIsEnabled = (PFNGLISENABLEDPROC) load(userptr, "glIsEnabled");
2322 glad_glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC) load(userptr, "glIsFramebuffer");
2323 glad_glIsProgram = (PFNGLISPROGRAMPROC) load(userptr, "glIsProgram");
2324 glad_glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC) load(userptr, "glIsRenderbuffer");
2325 glad_glIsShader = (PFNGLISSHADERPROC) load(userptr, "glIsShader");
2326 glad_glIsTexture = (PFNGLISTEXTUREPROC) load(userptr, "glIsTexture");
2327 glad_glLineWidth = (PFNGLLINEWIDTHPROC) load(userptr, "glLineWidth");
2328 glad_glLinkProgram = (PFNGLLINKPROGRAMPROC) load(userptr, "glLinkProgram");
2329 glad_glPixelStorei = (PFNGLPIXELSTOREIPROC) load(userptr, "glPixelStorei");
2330 glad_glPolygonOffset = (PFNGLPOLYGONOFFSETPROC) load(userptr, "glPolygonOffset");
2331 glad_glReadPixels = (PFNGLREADPIXELSPROC) load(userptr, "glReadPixels");
2332 glad_glReleaseShaderCompiler = (PFNGLRELEASESHADERCOMPILERPROC) load(userptr, "glReleaseShaderCompiler");
2333 glad_glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC) load(userptr, "glRenderbufferStorage");
2334 glad_glSampleCoverage = (PFNGLSAMPLECOVERAGEPROC) load(userptr, "glSampleCoverage");
2335 glad_glScissor = (PFNGLSCISSORPROC) load(userptr, "glScissor");
2336 glad_glShaderBinary = (PFNGLSHADERBINARYPROC) load(userptr, "glShaderBinary");
2337 glad_glShaderSource = (PFNGLSHADERSOURCEPROC) load(userptr, "glShaderSource");
2338 glad_glStencilFunc = (PFNGLSTENCILFUNCPROC) load(userptr, "glStencilFunc");
2339 glad_glStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC) load(userptr, "glStencilFuncSeparate");
2340 glad_glStencilMask = (PFNGLSTENCILMASKPROC) load(userptr, "glStencilMask");
2341 glad_glStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC) load(userptr, "glStencilMaskSeparate");
2342 glad_glStencilOp = (PFNGLSTENCILOPPROC) load(userptr, "glStencilOp");
2343 glad_glStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC) load(userptr, "glStencilOpSeparate");
2344 glad_glTexImage2D = (PFNGLTEXIMAGE2DPROC) load(userptr, "glTexImage2D");
2345 glad_glTexParameterf = (PFNGLTEXPARAMETERFPROC) load(userptr, "glTexParameterf");
2346 glad_glTexParameterfv = (PFNGLTEXPARAMETERFVPROC) load(userptr, "glTexParameterfv");
2347 glad_glTexParameteri = (PFNGLTEXPARAMETERIPROC) load(userptr, "glTexParameteri");
2348 glad_glTexParameteriv = (PFNGLTEXPARAMETERIVPROC) load(userptr, "glTexParameteriv");
2349 glad_glTexSubImage2D = (PFNGLTEXSUBIMAGE2DPROC) load(userptr, "glTexSubImage2D");
2350 glad_glUniform1f = (PFNGLUNIFORM1FPROC) load(userptr, "glUniform1f");
2351 glad_glUniform1fv = (PFNGLUNIFORM1FVPROC) load(userptr, "glUniform1fv");
2352 glad_glUniform1i = (PFNGLUNIFORM1IPROC) load(userptr, "glUniform1i");
2353 glad_glUniform1iv = (PFNGLUNIFORM1IVPROC) load(userptr, "glUniform1iv");
2354 glad_glUniform2f = (PFNGLUNIFORM2FPROC) load(userptr, "glUniform2f");
2355 glad_glUniform2fv = (PFNGLUNIFORM2FVPROC) load(userptr, "glUniform2fv");
2356 glad_glUniform2i = (PFNGLUNIFORM2IPROC) load(userptr, "glUniform2i");
2357 glad_glUniform2iv = (PFNGLUNIFORM2IVPROC) load(userptr, "glUniform2iv");
2358 glad_glUniform3f = (PFNGLUNIFORM3FPROC) load(userptr, "glUniform3f");
2359 glad_glUniform3fv = (PFNGLUNIFORM3FVPROC) load(userptr, "glUniform3fv");
2360 glad_glUniform3i = (PFNGLUNIFORM3IPROC) load(userptr, "glUniform3i");
2361 glad_glUniform3iv = (PFNGLUNIFORM3IVPROC) load(userptr, "glUniform3iv");
2362 glad_glUniform4f = (PFNGLUNIFORM4FPROC) load(userptr, "glUniform4f");
2363 glad_glUniform4fv = (PFNGLUNIFORM4FVPROC) load(userptr, "glUniform4fv");
2364 glad_glUniform4i = (PFNGLUNIFORM4IPROC) load(userptr, "glUniform4i");
2365 glad_glUniform4iv = (PFNGLUNIFORM4IVPROC) load(userptr, "glUniform4iv");
2366 glad_glUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC) load(userptr, "glUniformMatrix2fv");
2367 glad_glUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC) load(userptr, "glUniformMatrix3fv");
2368 glad_glUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC) load(userptr, "glUniformMatrix4fv");
2369 glad_glUseProgram = (PFNGLUSEPROGRAMPROC) load(userptr, "glUseProgram");
2370 glad_glValidateProgram = (PFNGLVALIDATEPROGRAMPROC) load(userptr, "glValidateProgram");
2371 glad_glVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC) load(userptr, "glVertexAttrib1f");
2372 glad_glVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC) load(userptr, "glVertexAttrib1fv");
2373 glad_glVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC) load(userptr, "glVertexAttrib2f");
2374 glad_glVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC) load(userptr, "glVertexAttrib2fv");
2375 glad_glVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC) load(userptr, "glVertexAttrib3f");
2376 glad_glVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC) load(userptr, "glVertexAttrib3fv");
2377 glad_glVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC) load(userptr, "glVertexAttrib4f");
2378 glad_glVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC) load(userptr, "glVertexAttrib4fv");
2379 glad_glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC) load(userptr, "glVertexAttribPointer");
2380 glad_glViewport = (PFNGLVIEWPORTPROC) load(userptr, "glViewport");
2381 }
2382 static void glad_gl_load_GL_ES_VERSION_3_0( GLADuserptrloadfunc load, void* userptr) {
2383 if(!GLAD_GL_ES_VERSION_3_0) return;
2384 glad_glBeginQuery = (PFNGLBEGINQUERYPROC) load(userptr, "glBeginQuery");
2385 glad_glBeginTransformFeedback = (PFNGLBEGINTRANSFORMFEEDBACKPROC) load(userptr, "glBeginTransformFeedback");
2386 glad_glBindBufferBase = (PFNGLBINDBUFFERBASEPROC) load(userptr, "glBindBufferBase");
2387 glad_glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC) load(userptr, "glBindBufferRange");
2388 glad_glBindSampler = (PFNGLBINDSAMPLERPROC) load(userptr, "glBindSampler");
2389 glad_glBindTransformFeedback = (PFNGLBINDTRANSFORMFEEDBACKPROC) load(userptr, "glBindTransformFeedback");
2390 glad_glBindVertexArray = (PFNGLBINDVERTEXARRAYPROC) load(userptr, "glBindVertexArray");
2391 glad_glBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC) load(userptr, "glBlitFramebuffer");
2392 glad_glClearBufferfi = (PFNGLCLEARBUFFERFIPROC) load(userptr, "glClearBufferfi");
2393 glad_glClearBufferfv = (PFNGLCLEARBUFFERFVPROC) load(userptr, "glClearBufferfv");
2394 glad_glClearBufferiv = (PFNGLCLEARBUFFERIVPROC) load(userptr, "glClearBufferiv");
2395 glad_glClearBufferuiv = (PFNGLCLEARBUFFERUIVPROC) load(userptr, "glClearBufferuiv");
2396 glad_glClientWaitSync = (PFNGLCLIENTWAITSYNCPROC) load(userptr, "glClientWaitSync");
2397 glad_glCompressedTexImage3D = (PFNGLCOMPRESSEDTEXIMAGE3DPROC) load(userptr, "glCompressedTexImage3D");
2398 glad_glCompressedTexSubImage3D = (PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) load(userptr, "glCompressedTexSubImage3D");
2399 glad_glCopyBufferSubData = (PFNGLCOPYBUFFERSUBDATAPROC) load(userptr, "glCopyBufferSubData");
2400 glad_glCopyTexSubImage3D = (PFNGLCOPYTEXSUBIMAGE3DPROC) load(userptr, "glCopyTexSubImage3D");
2401 glad_glDeleteQueries = (PFNGLDELETEQUERIESPROC) load(userptr, "glDeleteQueries");
2402 glad_glDeleteSamplers = (PFNGLDELETESAMPLERSPROC) load(userptr, "glDeleteSamplers");
2403 glad_glDeleteSync = (PFNGLDELETESYNCPROC) load(userptr, "glDeleteSync");
2404 glad_glDeleteTransformFeedbacks = (PFNGLDELETETRANSFORMFEEDBACKSPROC) load(userptr, "glDeleteTransformFeedbacks");
2405 glad_glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC) load(userptr, "glDeleteVertexArrays");
2406 glad_glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDPROC) load(userptr, "glDrawArraysInstanced");
2407 glad_glDrawBuffers = (PFNGLDRAWBUFFERSPROC) load(userptr, "glDrawBuffers");
2408 glad_glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDPROC) load(userptr, "glDrawElementsInstanced");
2409 glad_glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC) load(userptr, "glDrawRangeElements");
2410 glad_glEndQuery = (PFNGLENDQUERYPROC) load(userptr, "glEndQuery");
2411 glad_glEndTransformFeedback = (PFNGLENDTRANSFORMFEEDBACKPROC) load(userptr, "glEndTransformFeedback");
2412 glad_glFenceSync = (PFNGLFENCESYNCPROC) load(userptr, "glFenceSync");
2413 glad_glFlushMappedBufferRange = (PFNGLFLUSHMAPPEDBUFFERRANGEPROC) load(userptr, "glFlushMappedBufferRange");
2414 glad_glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC) load(userptr, "glFramebufferTextureLayer");
2415 glad_glGenQueries = (PFNGLGENQUERIESPROC) load(userptr, "glGenQueries");
2416 glad_glGenSamplers = (PFNGLGENSAMPLERSPROC) load(userptr, "glGenSamplers");
2417 glad_glGenTransformFeedbacks = (PFNGLGENTRANSFORMFEEDBACKSPROC) load(userptr, "glGenTransformFeedbacks");
2418 glad_glGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC) load(userptr, "glGenVertexArrays");
2419 glad_glGetActiveUniformBlockName = (PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) load(userptr, "glGetActiveUniformBlockName");
2420 glad_glGetActiveUniformBlockiv = (PFNGLGETACTIVEUNIFORMBLOCKIVPROC) load(userptr, "glGetActiveUniformBlockiv");
2421 glad_glGetActiveUniformsiv = (PFNGLGETACTIVEUNIFORMSIVPROC) load(userptr, "glGetActiveUniformsiv");
2422 glad_glGetBufferParameteri64v = (PFNGLGETBUFFERPARAMETERI64VPROC) load(userptr, "glGetBufferParameteri64v");
2423 glad_glGetBufferPointerv = (PFNGLGETBUFFERPOINTERVPROC) load(userptr, "glGetBufferPointerv");
2424 glad_glGetFragDataLocation = (PFNGLGETFRAGDATALOCATIONPROC) load(userptr, "glGetFragDataLocation");
2425 glad_glGetInteger64i_v = (PFNGLGETINTEGER64I_VPROC) load(userptr, "glGetInteger64i_v");
2426 glad_glGetInteger64v = (PFNGLGETINTEGER64VPROC) load(userptr, "glGetInteger64v");
2427 glad_glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC) load(userptr, "glGetIntegeri_v");
2428 glad_glGetInternalformativ = (PFNGLGETINTERNALFORMATIVPROC) load(userptr, "glGetInternalformativ");
2429 glad_glGetProgramBinary = (PFNGLGETPROGRAMBINARYPROC) load(userptr, "glGetProgramBinary");
2430 glad_glGetQueryObjectuiv = (PFNGLGETQUERYOBJECTUIVPROC) load(userptr, "glGetQueryObjectuiv");
2431 glad_glGetQueryiv = (PFNGLGETQUERYIVPROC) load(userptr, "glGetQueryiv");
2432 glad_glGetSamplerParameterfv = (PFNGLGETSAMPLERPARAMETERFVPROC) load(userptr, "glGetSamplerParameterfv");
2433 glad_glGetSamplerParameteriv = (PFNGLGETSAMPLERPARAMETERIVPROC) load(userptr, "glGetSamplerParameteriv");
2434 glad_glGetStringi = (PFNGLGETSTRINGIPROC) load(userptr, "glGetStringi");
2435 glad_glGetSynciv = (PFNGLGETSYNCIVPROC) load(userptr, "glGetSynciv");
2436 glad_glGetTransformFeedbackVarying = (PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) load(userptr, "glGetTransformFeedbackVarying");
2437 glad_glGetUniformBlockIndex = (PFNGLGETUNIFORMBLOCKINDEXPROC) load(userptr, "glGetUniformBlockIndex");
2438 glad_glGetUniformIndices = (PFNGLGETUNIFORMINDICESPROC) load(userptr, "glGetUniformIndices");
2439 glad_glGetUniformuiv = (PFNGLGETUNIFORMUIVPROC) load(userptr, "glGetUniformuiv");
2440 glad_glGetVertexAttribIiv = (PFNGLGETVERTEXATTRIBIIVPROC) load(userptr, "glGetVertexAttribIiv");
2441 glad_glGetVertexAttribIuiv = (PFNGLGETVERTEXATTRIBIUIVPROC) load(userptr, "glGetVertexAttribIuiv");
2442 glad_glInvalidateFramebuffer = (PFNGLINVALIDATEFRAMEBUFFERPROC) load(userptr, "glInvalidateFramebuffer");
2443 glad_glInvalidateSubFramebuffer = (PFNGLINVALIDATESUBFRAMEBUFFERPROC) load(userptr, "glInvalidateSubFramebuffer");
2444 glad_glIsQuery = (PFNGLISQUERYPROC) load(userptr, "glIsQuery");
2445 glad_glIsSampler = (PFNGLISSAMPLERPROC) load(userptr, "glIsSampler");
2446 glad_glIsSync = (PFNGLISSYNCPROC) load(userptr, "glIsSync");
2447 glad_glIsTransformFeedback = (PFNGLISTRANSFORMFEEDBACKPROC) load(userptr, "glIsTransformFeedback");
2448 glad_glIsVertexArray = (PFNGLISVERTEXARRAYPROC) load(userptr, "glIsVertexArray");
2449 glad_glMapBufferRange = (PFNGLMAPBUFFERRANGEPROC) load(userptr, "glMapBufferRange");
2450 glad_glPauseTransformFeedback = (PFNGLPAUSETRANSFORMFEEDBACKPROC) load(userptr, "glPauseTransformFeedback");
2451 glad_glProgramBinary = (PFNGLPROGRAMBINARYPROC) load(userptr, "glProgramBinary");
2452 glad_glProgramParameteri = (PFNGLPROGRAMPARAMETERIPROC) load(userptr, "glProgramParameteri");
2453 glad_glReadBuffer = (PFNGLREADBUFFERPROC) load(userptr, "glReadBuffer");
2454 glad_glRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) load(userptr, "glRenderbufferStorageMultisample");
2455 glad_glResumeTransformFeedback = (PFNGLRESUMETRANSFORMFEEDBACKPROC) load(userptr, "glResumeTransformFeedback");
2456 glad_glSamplerParameterf = (PFNGLSAMPLERPARAMETERFPROC) load(userptr, "glSamplerParameterf");
2457 glad_glSamplerParameterfv = (PFNGLSAMPLERPARAMETERFVPROC) load(userptr, "glSamplerParameterfv");
2458 glad_glSamplerParameteri = (PFNGLSAMPLERPARAMETERIPROC) load(userptr, "glSamplerParameteri");
2459 glad_glSamplerParameteriv = (PFNGLSAMPLERPARAMETERIVPROC) load(userptr, "glSamplerParameteriv");
2460 glad_glTexImage3D = (PFNGLTEXIMAGE3DPROC) load(userptr, "glTexImage3D");
2461 glad_glTexStorage2D = (PFNGLTEXSTORAGE2DPROC) load(userptr, "glTexStorage2D");
2462 glad_glTexStorage3D = (PFNGLTEXSTORAGE3DPROC) load(userptr, "glTexStorage3D");
2463 glad_glTexSubImage3D = (PFNGLTEXSUBIMAGE3DPROC) load(userptr, "glTexSubImage3D");
2464 glad_glTransformFeedbackVaryings = (PFNGLTRANSFORMFEEDBACKVARYINGSPROC) load(userptr, "glTransformFeedbackVaryings");
2465 glad_glUniform1ui = (PFNGLUNIFORM1UIPROC) load(userptr, "glUniform1ui");
2466 glad_glUniform1uiv = (PFNGLUNIFORM1UIVPROC) load(userptr, "glUniform1uiv");
2467 glad_glUniform2ui = (PFNGLUNIFORM2UIPROC) load(userptr, "glUniform2ui");
2468 glad_glUniform2uiv = (PFNGLUNIFORM2UIVPROC) load(userptr, "glUniform2uiv");
2469 glad_glUniform3ui = (PFNGLUNIFORM3UIPROC) load(userptr, "glUniform3ui");
2470 glad_glUniform3uiv = (PFNGLUNIFORM3UIVPROC) load(userptr, "glUniform3uiv");
2471 glad_glUniform4ui = (PFNGLUNIFORM4UIPROC) load(userptr, "glUniform4ui");
2472 glad_glUniform4uiv = (PFNGLUNIFORM4UIVPROC) load(userptr, "glUniform4uiv");
2473 glad_glUniformBlockBinding = (PFNGLUNIFORMBLOCKBINDINGPROC) load(userptr, "glUniformBlockBinding");
2474 glad_glUniformMatrix2x3fv = (PFNGLUNIFORMMATRIX2X3FVPROC) load(userptr, "glUniformMatrix2x3fv");
2475 glad_glUniformMatrix2x4fv = (PFNGLUNIFORMMATRIX2X4FVPROC) load(userptr, "glUniformMatrix2x4fv");
2476 glad_glUniformMatrix3x2fv = (PFNGLUNIFORMMATRIX3X2FVPROC) load(userptr, "glUniformMatrix3x2fv");
2477 glad_glUniformMatrix3x4fv = (PFNGLUNIFORMMATRIX3X4FVPROC) load(userptr, "glUniformMatrix3x4fv");
2478 glad_glUniformMatrix4x2fv = (PFNGLUNIFORMMATRIX4X2FVPROC) load(userptr, "glUniformMatrix4x2fv");
2479 glad_glUniformMatrix4x3fv = (PFNGLUNIFORMMATRIX4X3FVPROC) load(userptr, "glUniformMatrix4x3fv");
2480 glad_glUnmapBuffer = (PFNGLUNMAPBUFFERPROC) load(userptr, "glUnmapBuffer");
2481 glad_glVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISORPROC) load(userptr, "glVertexAttribDivisor");
2482 glad_glVertexAttribI4i = (PFNGLVERTEXATTRIBI4IPROC) load(userptr, "glVertexAttribI4i");
2483 glad_glVertexAttribI4iv = (PFNGLVERTEXATTRIBI4IVPROC) load(userptr, "glVertexAttribI4iv");
2484 glad_glVertexAttribI4ui = (PFNGLVERTEXATTRIBI4UIPROC) load(userptr, "glVertexAttribI4ui");
2485 glad_glVertexAttribI4uiv = (PFNGLVERTEXATTRIBI4UIVPROC) load(userptr, "glVertexAttribI4uiv");
2486 glad_glVertexAttribIPointer = (PFNGLVERTEXATTRIBIPOINTERPROC) load(userptr, "glVertexAttribIPointer");
2487 glad_glWaitSync = (PFNGLWAITSYNCPROC) load(userptr, "glWaitSync");
2488 }
2489
2490
2491
2492 #if defined(GL_ES_VERSION_3_0) || defined(GL_VERSION_3_0)
2493 #define GLAD_GL_IS_SOME_NEW_VERSION 1
2494 #else
2495 #define GLAD_GL_IS_SOME_NEW_VERSION 0
2496 #endif
2497
2498 static int glad_gl_get_extensions( int version, const char **out_exts, unsigned int *out_num_exts_i, char ***out_exts_i) {
2499 #if GLAD_GL_IS_SOME_NEW_VERSION
2500 if(GLAD_VERSION_MAJOR(version) < 3) {
2501 #else
2502 (void) version;
2503 (void) out_num_exts_i;
2504 (void) out_exts_i;
2505 #endif
2506 if (glad_glGetString == NULL) {
2507 return 0;
2508 }
2509 *out_exts = (const char *)glad_glGetString(GL_EXTENSIONS);
2510 #if GLAD_GL_IS_SOME_NEW_VERSION
2511 } else {
2512 unsigned int index = 0;
2513 unsigned int num_exts_i = 0;
2514 char **exts_i = NULL;
2515 if (glad_glGetStringi == NULL || glad_glGetIntegerv == NULL) {
2516 return 0;
2517 }
2518 glad_glGetIntegerv(GL_NUM_EXTENSIONS, (int*) &num_exts_i);
2519 if (num_exts_i > 0) {
2520 exts_i = (char **) malloc(num_exts_i * (sizeof *exts_i));
2521 }
2522 if (exts_i == NULL) {
2523 return 0;
2524 }
2525 for(index = 0; index < num_exts_i; index++) {
2526 const char *gl_str_tmp = (const char*) glad_glGetStringi(GL_EXTENSIONS, index);
2527 size_t len = strlen(gl_str_tmp) + 1;
2528
2529 char *local_str = (char*) malloc(len * sizeof(char));
2530 if(local_str != NULL) {
2531 memcpy(local_str, gl_str_tmp, len * sizeof(char));
2532 }
2533
2534 exts_i[index] = local_str;
2535 }
2536
2537 *out_num_exts_i = num_exts_i;
2538 *out_exts_i = exts_i;
2539 }
2540 #endif
2541 return 1;
2542 }
2543 static void glad_gl_free_extensions(char **exts_i, unsigned int num_exts_i) {
2544 if (exts_i != NULL) {
2545 unsigned int index;
2546 for(index = 0; index < num_exts_i; index++) {
2547 free((void *) (exts_i[index]));
2548 }
2549 free((void *)exts_i);
2550 exts_i = NULL;
2551 }
2552 }
2553 static int glad_gl_has_extension(int version, const char *exts, unsigned int num_exts_i, char **exts_i, const char *ext) {
2554 if(GLAD_VERSION_MAJOR(version) < 3 || !GLAD_GL_IS_SOME_NEW_VERSION) {
2555 const char *extensions;
2556 const char *loc;
2557 const char *terminator;
2558 extensions = exts;
2559 if(extensions == NULL || ext == NULL) {
2560 return 0;
2561 }
2562 while(1) {
2563 loc = strstr(extensions, ext);
2564 if(loc == NULL) {
2565 return 0;
2566 }
2567 terminator = loc + strlen(ext);
2568 if((loc == extensions || *(loc - 1) == ' ') &&
2569 (*terminator == ' ' || *terminator == '\0')) {
2570 return 1;
2571 }
2572 extensions = terminator;
2573 }
2574 } else {
2575 unsigned int index;
2576 for(index = 0; index < num_exts_i; index++) {
2577 const char *e = exts_i[index];
2578 if(strcmp(e, ext) == 0) {
2579 return 1;
2580 }
2581 }
2582 }
2583 return 0;
2584 }
2585
2586 static GLADapiproc glad_gl_get_proc_from_userptr(void *userptr, const char* name) {
2587 return (GLAD_GNUC_EXTENSION (GLADapiproc (*)(const char *name)) userptr)(name);
2588 }
2589
2590 static int glad_gl_find_extensions_gles2( int version) {
2591 const char *exts = NULL;
2592 unsigned int num_exts_i = 0;
2593 char **exts_i = NULL;
2594 if (!glad_gl_get_extensions(version, &exts, &num_exts_i, &exts_i)) return 0;
2595
2596 (void) glad_gl_has_extension;
2597
2598 glad_gl_free_extensions(exts_i, num_exts_i);
2599
2600 return 1;
2601 }
2602
2603 static int glad_gl_find_core_gles2(void) {
2604 int i, major, minor;
2605 const char* version;
2606 const char* prefixes[] = {
2607 "OpenGL ES-CM ",
2608 "OpenGL ES-CL ",
2609 "OpenGL ES ",
2610 NULL
2611 };
2612 version = (const char*) glad_glGetString(GL_VERSION);
2613 if (!version) return 0;
2614 for (i = 0; prefixes[i]; i++) {
2615 const size_t length = strlen(prefixes[i]);
2616 if (strncmp(version, prefixes[i], length) == 0) {
2617 version += length;
2618 break;
2619 }
2620 }
2621
2622 GLAD_IMPL_UTIL_SSCANF(version, "%d.%d", &major, &minor);
2623
2624 GLAD_GL_ES_VERSION_2_0 = (major == 2 && minor >= 0) || major > 2;
2625 GLAD_GL_ES_VERSION_3_0 = (major == 3 && minor >= 0) || major > 3;
2626
2627 return GLAD_MAKE_VERSION(major, minor);
2628 }
2629
2630 int gladLoadGLES2UserPtr( GLADuserptrloadfunc load, void *userptr) {
2631 int version;
2632
2633 glad_glGetString = (PFNGLGETSTRINGPROC) load(userptr, "glGetString");
2634 if(glad_glGetString == NULL) return 0;
2635 if(glad_glGetString(GL_VERSION) == NULL) return 0;
2636 version = glad_gl_find_core_gles2();
2637
2638 glad_gl_load_GL_ES_VERSION_2_0(load, userptr);
2639 glad_gl_load_GL_ES_VERSION_3_0(load, userptr);
2640
2641 if (!glad_gl_find_extensions_gles2(version)) return 0;
2642
2643
2644
2645 return version;
2646 }
2647
2648
2649 int gladLoadGLES2( GLADloadfunc load) {
2650 return gladLoadGLES2UserPtr( glad_gl_get_proc_from_userptr, GLAD_GNUC_EXTENSION (void*) load);
2651 }
2652
2653
2654
2655
2656
2657 #ifdef GLAD_GLES2
2658
2659 #ifndef GLAD_LOADER_LIBRARY_C_
2660 #define GLAD_LOADER_LIBRARY_C_
2661
2662 #include <stddef.h>
2663 #include <stdlib.h>
2664
2665 #if GLAD_PLATFORM_WIN32
2666 #include <windows.h>
2667 #else
2668 #include <dlfcn.h>
2669 #endif
2670
2671
2672 static void* glad_get_dlopen_handle(const char *lib_names[], int length) {
2673 void *handle = NULL;
2674 int i;
2675
2676 for (i = 0; i < length; ++i) {
2677 #if GLAD_PLATFORM_WIN32
2678 #if GLAD_PLATFORM_UWP
2679 size_t buffer_size = (strlen(lib_names[i]) + 1) * sizeof(WCHAR);
2680 LPWSTR buffer = (LPWSTR) malloc(buffer_size);
2681 if (buffer != NULL) {
2682 int ret = MultiByteToWideChar(CP_ACP, 0, lib_names[i], -1, buffer, buffer_size);
2683 if (ret != 0) {
2684 handle = (void*) LoadPackagedLibrary(buffer, 0);
2685 }
2686 free((void*) buffer);
2687 }
2688 #else
2689 handle = (void*) LoadLibraryA(lib_names[i]);
2690 #endif
2691 #else
2692 handle = dlopen(lib_names[i], RTLD_LAZY | RTLD_LOCAL);
2693 #endif
2694 if (handle != NULL) {
2695 return handle;
2696 }
2697 }
2698
2699 return NULL;
2700 }
2701
2702 static void glad_close_dlopen_handle(void* handle) {
2703 if (handle != NULL) {
2704 #if GLAD_PLATFORM_WIN32
2705 FreeLibrary((HMODULE) handle);
2706 #else
2707 dlclose(handle);
2708 #endif
2709 }
2710 }
2711
2712 static GLADapiproc glad_dlsym_handle(void* handle, const char *name) {
2713 if (handle == NULL) {
2714 return NULL;
2715 }
2716
2717 #if GLAD_PLATFORM_WIN32
2718 return (GLADapiproc) GetProcAddress((HMODULE) handle, name);
2719 #else
2720 return GLAD_GNUC_EXTENSION (GLADapiproc) dlsym(handle, name);
2721 #endif
2722 }
2723
2724 #endif /* GLAD_LOADER_LIBRARY_C_ */
2725
2726 #if GLAD_PLATFORM_EMSCRIPTEN
2727 typedef void* (GLAD_API_PTR *PFNEGLGETPROCADDRESSPROC)(const char *name);
2728 extern void* emscripten_GetProcAddress(const char *name);
2729 #else
2730 #include <glad/egl.h>
2731 #endif
2732
2733
2734 struct _glad_gles2_userptr {
2735 void *handle;
2736 PFNEGLGETPROCADDRESSPROC get_proc_address_ptr;
2737 };
2738
2739
2740 static GLADapiproc glad_gles2_get_proc(void *vuserptr, const char* name) {
2741 struct _glad_gles2_userptr userptr = *(struct _glad_gles2_userptr*) vuserptr;
2742 GLADapiproc result = NULL;
2743
2744 #if !GLAD_PLATFORM_EMSCRIPTEN
2745 result = glad_dlsym_handle(userptr.handle, name);
2746 #endif
2747 if (result == NULL) {
2748 result = userptr.get_proc_address_ptr(name);
2749 }
2750
2751 return result;
2752 }
2753
2754 static void* _gles2_handle = NULL;
2755
2756 static void* glad_gles2_dlopen_handle(void) {
2757 #if GLAD_PLATFORM_EMSCRIPTEN
2758 #elif GLAD_PLATFORM_APPLE
2759 static const char *NAMES[] = {"libGLESv2.dylib"};
2760 #elif GLAD_PLATFORM_WIN32
2761 static const char *NAMES[] = {"GLESv2.dll", "libGLESv2.dll"};
2762 #else
2763 static const char *NAMES[] = {"libGLESv2.so.2", "libGLESv2.so"};
2764 #endif
2765
2766 #if GLAD_PLATFORM_EMSCRIPTEN
2767 return NULL;
2768 #else
2769 if (_gles2_handle == NULL) {
2770 _gles2_handle = glad_get_dlopen_handle(NAMES, sizeof(NAMES) / sizeof(NAMES[0]));
2771 }
2772
2773 return _gles2_handle;
2774 #endif
2775 }
2776
2777 static struct _glad_gles2_userptr glad_gles2_build_userptr(void *handle) {
2778 struct _glad_gles2_userptr userptr;
2779 #if GLAD_PLATFORM_EMSCRIPTEN
2780 userptr.get_proc_address_ptr = emscripten_GetProcAddress;
2781 #else
2782 userptr.handle = handle;
2783 userptr.get_proc_address_ptr = eglGetProcAddress;
2784 #endif
2785 return userptr;
2786 }
2787
2788 int gladLoaderLoadGLES2(void) {
2789 int version = 0;
2790 void *handle = NULL;
2791 int did_load = 0;
2792 struct _glad_gles2_userptr userptr;
2793
2794 #if GLAD_PLATFORM_EMSCRIPTEN
2795 userptr.get_proc_address_ptr = emscripten_GetProcAddress;
2796 version = gladLoadGLES2UserPtr(glad_gles2_get_proc, &userptr);
2797 #else
2798 if (eglGetProcAddress == NULL) {
2799 return 0;
2800 }
2801
2802 did_load = _gles2_handle == NULL;
2803 handle = glad_gles2_dlopen_handle();
2804 if (handle != NULL) {
2805 userptr = glad_gles2_build_userptr(handle);
2806
2807 version = gladLoadGLES2UserPtr(glad_gles2_get_proc, &userptr);
2808
2809 if (!version && did_load) {
2810 gladLoaderUnloadGLES2();
2811 }
2812 }
2813 #endif
2814
2815 return version;
2816 }
2817
2818
2819
2820 void gladLoaderUnloadGLES2(void) {
2821 if (_gles2_handle != NULL) {
2822 glad_close_dlopen_handle(_gles2_handle);
2823 _gles2_handle = NULL;
2824 }
2825 }
2826
2827 #endif /* GLAD_GLES2 */
2828
2829 #ifdef __cplusplus
2830 }
2831 #endif
2832
2833 #endif /* GLAD_GLES2_IMPLEMENTATION */
2834
File include/glad/glx.h added (mode: 100644) (index 0000000..a012975)
1 /**
2 * Loader generated by glad 2.0.0-beta on Wed May 12 23:20:38 2021
3 *
4 * Generator: C/C++
5 * Specification: glx
6 * Extensions: 5
7 *
8 * APIs:
9 * - glx=1.4
10 *
11 * Options:
12 * - ALIAS = False
13 * - DEBUG = False
14 * - HEADER_ONLY = True
15 * - LOADER = True
16 * - MX = False
17 * - MX_GLOBAL = False
18 * - ON_DEMAND = False
19 *
20 * Commandline:
21 * --api='glx=1.4' --extensions='GLX_ARB_create_context,GLX_ARB_create_context_profile,GLX_ARB_multisample,GLX_EXT_swap_control,GLX_MESA_swap_control' c --header-only --loader
22 *
23 * Online:
24 * http://glad.sh/#api=glx%3D1.4&extensions=GLX_ARB_create_context%2CGLX_ARB_create_context_profile%2CGLX_ARB_multisample%2CGLX_EXT_swap_control%2CGLX_MESA_swap_control&generator=c&options=HEADER_ONLY%2CLOADER
25 *
26 */
27
28 #ifndef GLAD_GLX_H_
29 #define GLAD_GLX_H_
30
31 #ifdef GLX_H
32 #error GLX header already included (API: glx), remove previous include!
33 #endif
34 #define GLX_H 1
35
36
37 #include <X11/X.h>
38 #include <X11/Xlib.h>
39 #include <X11/Xutil.h>
40
41 #include <glad/gl.h>
42
43 #define GLAD_GLX
44 #define GLAD_OPTION_GLX_HEADER_ONLY
45 #define GLAD_OPTION_GLX_LOADER
46
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50
51 #ifndef GLAD_PLATFORM_H_
52 #define GLAD_PLATFORM_H_
53
54 #ifndef GLAD_PLATFORM_WIN32
55 #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__MINGW32__)
56 #define GLAD_PLATFORM_WIN32 1
57 #else
58 #define GLAD_PLATFORM_WIN32 0
59 #endif
60 #endif
61
62 #ifndef GLAD_PLATFORM_APPLE
63 #ifdef __APPLE__
64 #define GLAD_PLATFORM_APPLE 1
65 #else
66 #define GLAD_PLATFORM_APPLE 0
67 #endif
68 #endif
69
70 #ifndef GLAD_PLATFORM_EMSCRIPTEN
71 #ifdef __EMSCRIPTEN__
72 #define GLAD_PLATFORM_EMSCRIPTEN 1
73 #else
74 #define GLAD_PLATFORM_EMSCRIPTEN 0
75 #endif
76 #endif
77
78 #ifndef GLAD_PLATFORM_UWP
79 #if defined(_MSC_VER) && !defined(GLAD_INTERNAL_HAVE_WINAPIFAMILY)
80 #ifdef __has_include
81 #if __has_include(<winapifamily.h>)
82 #define GLAD_INTERNAL_HAVE_WINAPIFAMILY 1
83 #endif
84 #elif _MSC_VER >= 1700 && !_USING_V110_SDK71_
85 #define GLAD_INTERNAL_HAVE_WINAPIFAMILY 1
86 #endif
87 #endif
88
89 #ifdef GLAD_INTERNAL_HAVE_WINAPIFAMILY
90 #include <winapifamily.h>
91 #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
92 #define GLAD_PLATFORM_UWP 1
93 #endif
94 #endif
95
96 #ifndef GLAD_PLATFORM_UWP
97 #define GLAD_PLATFORM_UWP 0
98 #endif
99 #endif
100
101 #ifdef __GNUC__
102 #define GLAD_GNUC_EXTENSION __extension__
103 #else
104 #define GLAD_GNUC_EXTENSION
105 #endif
106
107 #ifndef GLAD_API_CALL
108 #if defined(GLAD_API_CALL_EXPORT)
109 #if GLAD_PLATFORM_WIN32 || defined(__CYGWIN__)
110 #if defined(GLAD_API_CALL_EXPORT_BUILD)
111 #if defined(__GNUC__)
112 #define GLAD_API_CALL __attribute__ ((dllexport)) extern
113 #else
114 #define GLAD_API_CALL __declspec(dllexport) extern
115 #endif
116 #else
117 #if defined(__GNUC__)
118 #define GLAD_API_CALL __attribute__ ((dllimport)) extern
119 #else
120 #define GLAD_API_CALL __declspec(dllimport) extern
121 #endif
122 #endif
123 #elif defined(__GNUC__) && defined(GLAD_API_CALL_EXPORT_BUILD)
124 #define GLAD_API_CALL __attribute__ ((visibility ("default"))) extern
125 #else
126 #define GLAD_API_CALL extern
127 #endif
128 #else
129 #define GLAD_API_CALL extern
130 #endif
131 #endif
132
133 #ifdef APIENTRY
134 #define GLAD_API_PTR APIENTRY
135 #elif GLAD_PLATFORM_WIN32
136 #define GLAD_API_PTR __stdcall
137 #else
138 #define GLAD_API_PTR
139 #endif
140
141 #ifndef GLAPI
142 #define GLAPI GLAD_API_CALL
143 #endif
144
145 #ifndef GLAPIENTRY
146 #define GLAPIENTRY GLAD_API_PTR
147 #endif
148
149 #define GLAD_MAKE_VERSION(major, minor) (major * 10000 + minor)
150 #define GLAD_VERSION_MAJOR(version) (version / 10000)
151 #define GLAD_VERSION_MINOR(version) (version % 10000)
152
153 #define GLAD_GENERATOR_VERSION "2.0.0-beta"
154
155 typedef void (*GLADapiproc)(void);
156
157 typedef GLADapiproc (*GLADloadfunc)(const char *name);
158 typedef GLADapiproc (*GLADuserptrloadfunc)(void *userptr, const char *name);
159
160 typedef void (*GLADprecallback)(const char *name, GLADapiproc apiproc, int len_args, ...);
161 typedef void (*GLADpostcallback)(void *ret, const char *name, GLADapiproc apiproc, int len_args, ...);
162
163 #endif /* GLAD_PLATFORM_H_ */
164
165 #define GLX_ACCUM_ALPHA_SIZE 17
166 #define GLX_ACCUM_BLUE_SIZE 16
167 #define GLX_ACCUM_BUFFER_BIT 0x00000080
168 #define GLX_ACCUM_GREEN_SIZE 15
169 #define GLX_ACCUM_RED_SIZE 14
170 #define GLX_ALPHA_SIZE 11
171 #define GLX_AUX_BUFFERS 7
172 #define GLX_AUX_BUFFERS_BIT 0x00000010
173 #define GLX_BACK_LEFT_BUFFER_BIT 0x00000004
174 #define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008
175 #define GLX_BAD_ATTRIBUTE 2
176 #define GLX_BAD_CONTEXT 5
177 #define GLX_BAD_ENUM 7
178 #define GLX_BAD_SCREEN 1
179 #define GLX_BAD_VALUE 6
180 #define GLX_BAD_VISUAL 4
181 #define GLX_BLUE_SIZE 10
182 #define GLX_BUFFER_SIZE 2
183 #define GLX_BufferSwapComplete 1
184 #define GLX_COLOR_INDEX_BIT 0x00000002
185 #define GLX_COLOR_INDEX_TYPE 0x8015
186 #define GLX_CONFIG_CAVEAT 0x20
187 #define GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002
188 #define GLX_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001
189 #define GLX_CONTEXT_DEBUG_BIT_ARB 0x00000001
190 #define GLX_CONTEXT_FLAGS_ARB 0x2094
191 #define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002
192 #define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091
193 #define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092
194 #define GLX_CONTEXT_PROFILE_MASK_ARB 0x9126
195 #define GLX_DAMAGED 0x8020
196 #define GLX_DEPTH_BUFFER_BIT 0x00000020
197 #define GLX_DEPTH_SIZE 12
198 #define GLX_DIRECT_COLOR 0x8003
199 #define GLX_DONT_CARE 0xFFFFFFFF
200 #define GLX_DOUBLEBUFFER 5
201 #define GLX_DRAWABLE_TYPE 0x8010
202 #define GLX_EVENT_MASK 0x801F
203 #define GLX_EXTENSIONS 0x3
204 #define GLX_EXTENSION_NAME "GLX"
205 #define GLX_FBCONFIG_ID 0x8013
206 #define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001
207 #define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002
208 #define GLX_GRAY_SCALE 0x8006
209 #define GLX_GREEN_SIZE 9
210 #define GLX_HEIGHT 0x801E
211 #define GLX_LARGEST_PBUFFER 0x801C
212 #define GLX_LEVEL 3
213 #define GLX_MAX_PBUFFER_HEIGHT 0x8017
214 #define GLX_MAX_PBUFFER_PIXELS 0x8018
215 #define GLX_MAX_PBUFFER_WIDTH 0x8016
216 #define GLX_MAX_SWAP_INTERVAL_EXT 0x20F2
217 #define GLX_NONE 0x8000
218 #define GLX_NON_CONFORMANT_CONFIG 0x800D
219 #define GLX_NO_EXTENSION 3
220 #define GLX_PBUFFER 0x8023
221 #define GLX_PBUFFER_BIT 0x00000004
222 #define GLX_PBUFFER_CLOBBER_MASK 0x08000000
223 #define GLX_PBUFFER_HEIGHT 0x8040
224 #define GLX_PBUFFER_WIDTH 0x8041
225 #define GLX_PIXMAP_BIT 0x00000002
226 #define GLX_PRESERVED_CONTENTS 0x801B
227 #define GLX_PSEUDO_COLOR 0x8004
228 #define GLX_PbufferClobber 0
229 #define GLX_RED_SIZE 8
230 #define GLX_RENDER_TYPE 0x8011
231 #define GLX_RGBA 4
232 #define GLX_RGBA_BIT 0x00000001
233 #define GLX_RGBA_TYPE 0x8014
234 #define GLX_SAMPLES 100001
235 #define GLX_SAMPLES_ARB 100001
236 #define GLX_SAMPLE_BUFFERS 100000
237 #define GLX_SAMPLE_BUFFERS_ARB 100000
238 #define GLX_SAVED 0x8021
239 #define GLX_SCREEN 0x800C
240 #define GLX_SLOW_CONFIG 0x8001
241 #define GLX_STATIC_COLOR 0x8005
242 #define GLX_STATIC_GRAY 0x8007
243 #define GLX_STENCIL_BUFFER_BIT 0x00000040
244 #define GLX_STENCIL_SIZE 13
245 #define GLX_STEREO 6
246 #define GLX_SWAP_INTERVAL_EXT 0x20F1
247 #define GLX_TRANSPARENT_ALPHA_VALUE 0x28
248 #define GLX_TRANSPARENT_BLUE_VALUE 0x27
249 #define GLX_TRANSPARENT_GREEN_VALUE 0x26
250 #define GLX_TRANSPARENT_INDEX 0x8009
251 #define GLX_TRANSPARENT_INDEX_VALUE 0x24
252 #define GLX_TRANSPARENT_RED_VALUE 0x25
253 #define GLX_TRANSPARENT_RGB 0x8008
254 #define GLX_TRANSPARENT_TYPE 0x23
255 #define GLX_TRUE_COLOR 0x8002
256 #define GLX_USE_GL 1
257 #define GLX_VENDOR 0x1
258 #define GLX_VERSION 0x2
259 #define GLX_VISUAL_ID 0x800B
260 #define GLX_WIDTH 0x801D
261 #define GLX_WINDOW 0x8022
262 #define GLX_WINDOW_BIT 0x00000001
263 #define GLX_X_RENDERABLE 0x8012
264 #define GLX_X_VISUAL_TYPE 0x22
265 #define __GLX_NUMBER_EVENTS 17
266
267
268 #ifndef GLEXT_64_TYPES_DEFINED
269 /* This code block is duplicated in glext.h, so must be protected */
270 #define GLEXT_64_TYPES_DEFINED
271 /* Define int32_t, int64_t, and uint64_t types for UST/MSC */
272 /* (as used in the GLX_OML_sync_control extension). */
273 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
274 #include <inttypes.h>
275 #elif defined(__sun__) || defined(__digital__)
276 #include <inttypes.h>
277 #if defined(__STDC__)
278 #if defined(__arch64__) || defined(_LP64)
279 typedef long int int64_t;
280 typedef unsigned long int uint64_t;
281 #else
282 typedef long long int int64_t;
283 typedef unsigned long long int uint64_t;
284 #endif /* __arch64__ */
285 #endif /* __STDC__ */
286 #elif defined( __VMS ) || defined(__sgi)
287 #include <inttypes.h>
288 #elif defined(__SCO__) || defined(__USLC__)
289 #include <stdint.h>
290 #elif defined(__UNIXOS2__) || defined(__SOL64__)
291 typedef long int int32_t;
292 typedef long long int int64_t;
293 typedef unsigned long long int uint64_t;
294 #elif defined(_WIN32) && defined(__GNUC__)
295 #include <stdint.h>
296 #elif defined(_WIN32)
297 typedef __int32 int32_t;
298 typedef __int64 int64_t;
299 typedef unsigned __int64 uint64_t;
300 #else
301 /* Fallback if nothing above works */
302 #include <inttypes.h>
303 #endif
304 #endif
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322 #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
323
324 #else
325
326 #endif
327
328
329 #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
330
331 #else
332
333 #endif
334
335
336
337
338
339
340
341
342 typedef XID GLXFBConfigID;
343
344 typedef struct __GLXFBConfigRec *GLXFBConfig;
345
346 typedef XID GLXContextID;
347
348 typedef struct __GLXcontextRec *GLXContext;
349
350 typedef XID GLXPixmap;
351
352 typedef XID GLXDrawable;
353
354 typedef XID GLXWindow;
355
356 typedef XID GLXPbuffer;
357
358 typedef void (GLAD_API_PTR *__GLXextFuncPtr)(void);
359
360 typedef XID GLXVideoCaptureDeviceNV;
361
362 typedef unsigned int GLXVideoDeviceNV;
363
364 typedef XID GLXVideoSourceSGIX;
365
366 typedef XID GLXFBConfigIDSGIX;
367
368 typedef struct __GLXFBConfigRec *GLXFBConfigSGIX;
369
370 typedef XID GLXPbufferSGIX;
371
372 typedef struct {
373 int event_type; /* GLX_DAMAGED or GLX_SAVED */
374 int draw_type; /* GLX_WINDOW or GLX_PBUFFER */
375 unsigned long serial; /* # of last request processed by server */
376 Bool send_event; /* true if this came for SendEvent request */
377 Display *display; /* display the event was read from */
378 GLXDrawable drawable; /* XID of Drawable */
379 unsigned int buffer_mask; /* mask indicating which buffers are affected */
380 unsigned int aux_buffer; /* which aux buffer was affected */
381 int x, y;
382 int width, height;
383 int count; /* if nonzero, at least this many more */
384 } GLXPbufferClobberEvent;
385
386 typedef struct {
387 int type;
388 unsigned long serial; /* # of last request processed by server */
389 Bool send_event; /* true if this came from a SendEvent request */
390 Display *display; /* Display the event was read from */
391 GLXDrawable drawable; /* drawable on which event was requested in event mask */
392 int event_type;
393 int64_t ust;
394 int64_t msc;
395 int64_t sbc;
396 } GLXBufferSwapComplete;
397
398 typedef union __GLXEvent {
399 GLXPbufferClobberEvent glxpbufferclobber;
400 GLXBufferSwapComplete glxbufferswapcomplete;
401 long pad[24];
402 } GLXEvent;
403
404 typedef struct {
405 int type;
406 unsigned long serial;
407 Bool send_event;
408 Display *display;
409 int extension;
410 int evtype;
411 GLXDrawable window;
412 Bool stereo_tree;
413 } GLXStereoNotifyEventEXT;
414
415 typedef struct {
416 int type;
417 unsigned long serial; /* # of last request processed by server */
418 Bool send_event; /* true if this came for SendEvent request */
419 Display *display; /* display the event was read from */
420 GLXDrawable drawable; /* i.d. of Drawable */
421 int event_type; /* GLX_DAMAGED_SGIX or GLX_SAVED_SGIX */
422 int draw_type; /* GLX_WINDOW_SGIX or GLX_PBUFFER_SGIX */
423 unsigned int mask; /* mask indicating which buffers are affected*/
424 int x, y;
425 int width, height;
426 int count; /* if nonzero, at least this many more */
427 } GLXBufferClobberEventSGIX;
428
429 typedef struct {
430 char pipeName[80]; /* Should be [GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX] */
431 int networkId;
432 } GLXHyperpipeNetworkSGIX;
433
434 typedef struct {
435 char pipeName[80]; /* Should be [GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX] */
436 int channel;
437 unsigned int participationType;
438 int timeSlice;
439 } GLXHyperpipeConfigSGIX;
440
441 typedef struct {
442 char pipeName[80]; /* Should be [GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX] */
443 int srcXOrigin, srcYOrigin, srcWidth, srcHeight;
444 int destXOrigin, destYOrigin, destWidth, destHeight;
445 } GLXPipeRect;
446
447 typedef struct {
448 char pipeName[80]; /* Should be [GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX] */
449 int XOrigin, YOrigin, maxHeight, maxWidth;
450 } GLXPipeRectLimits;
451
452
453
454 #define GLX_VERSION_1_0 1
455 GLAD_API_CALL int GLAD_GLX_VERSION_1_0;
456 #define GLX_VERSION_1_1 1
457 GLAD_API_CALL int GLAD_GLX_VERSION_1_1;
458 #define GLX_VERSION_1_2 1
459 GLAD_API_CALL int GLAD_GLX_VERSION_1_2;
460 #define GLX_VERSION_1_3 1
461 GLAD_API_CALL int GLAD_GLX_VERSION_1_3;
462 #define GLX_VERSION_1_4 1
463 GLAD_API_CALL int GLAD_GLX_VERSION_1_4;
464 #define GLX_ARB_create_context 1
465 GLAD_API_CALL int GLAD_GLX_ARB_create_context;
466 #define GLX_ARB_create_context_profile 1
467 GLAD_API_CALL int GLAD_GLX_ARB_create_context_profile;
468 #define GLX_ARB_multisample 1
469 GLAD_API_CALL int GLAD_GLX_ARB_multisample;
470 #define GLX_EXT_swap_control 1
471 GLAD_API_CALL int GLAD_GLX_EXT_swap_control;
472 #define GLX_MESA_swap_control 1
473 GLAD_API_CALL int GLAD_GLX_MESA_swap_control;
474
475
476 typedef GLXFBConfig * (GLAD_API_PTR *PFNGLXCHOOSEFBCONFIGPROC)(Display * dpy, int screen, const int * attrib_list, int * nelements);
477 typedef XVisualInfo * (GLAD_API_PTR *PFNGLXCHOOSEVISUALPROC)(Display * dpy, int screen, int * attribList);
478 typedef void (GLAD_API_PTR *PFNGLXCOPYCONTEXTPROC)(Display * dpy, GLXContext src, GLXContext dst, unsigned long mask);
479 typedef GLXContext (GLAD_API_PTR *PFNGLXCREATECONTEXTPROC)(Display * dpy, XVisualInfo * vis, GLXContext shareList, Bool direct);
480 typedef GLXContext (GLAD_API_PTR *PFNGLXCREATECONTEXTATTRIBSARBPROC)(Display * dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int * attrib_list);
481 typedef GLXPixmap (GLAD_API_PTR *PFNGLXCREATEGLXPIXMAPPROC)(Display * dpy, XVisualInfo * visual, Pixmap pixmap);
482 typedef GLXContext (GLAD_API_PTR *PFNGLXCREATENEWCONTEXTPROC)(Display * dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
483 typedef GLXPbuffer (GLAD_API_PTR *PFNGLXCREATEPBUFFERPROC)(Display * dpy, GLXFBConfig config, const int * attrib_list);
484 typedef GLXPixmap (GLAD_API_PTR *PFNGLXCREATEPIXMAPPROC)(Display * dpy, GLXFBConfig config, Pixmap pixmap, const int * attrib_list);
485 typedef GLXWindow (GLAD_API_PTR *PFNGLXCREATEWINDOWPROC)(Display * dpy, GLXFBConfig config, Window win, const int * attrib_list);
486 typedef void (GLAD_API_PTR *PFNGLXDESTROYCONTEXTPROC)(Display * dpy, GLXContext ctx);
487 typedef void (GLAD_API_PTR *PFNGLXDESTROYGLXPIXMAPPROC)(Display * dpy, GLXPixmap pixmap);
488 typedef void (GLAD_API_PTR *PFNGLXDESTROYPBUFFERPROC)(Display * dpy, GLXPbuffer pbuf);
489 typedef void (GLAD_API_PTR *PFNGLXDESTROYPIXMAPPROC)(Display * dpy, GLXPixmap pixmap);
490 typedef void (GLAD_API_PTR *PFNGLXDESTROYWINDOWPROC)(Display * dpy, GLXWindow win);
491 typedef const char * (GLAD_API_PTR *PFNGLXGETCLIENTSTRINGPROC)(Display * dpy, int name);
492 typedef int (GLAD_API_PTR *PFNGLXGETCONFIGPROC)(Display * dpy, XVisualInfo * visual, int attrib, int * value);
493 typedef GLXContext (GLAD_API_PTR *PFNGLXGETCURRENTCONTEXTPROC)(void);
494 typedef Display * (GLAD_API_PTR *PFNGLXGETCURRENTDISPLAYPROC)(void);
495 typedef GLXDrawable (GLAD_API_PTR *PFNGLXGETCURRENTDRAWABLEPROC)(void);
496 typedef GLXDrawable (GLAD_API_PTR *PFNGLXGETCURRENTREADDRAWABLEPROC)(void);
497 typedef int (GLAD_API_PTR *PFNGLXGETFBCONFIGATTRIBPROC)(Display * dpy, GLXFBConfig config, int attribute, int * value);
498 typedef GLXFBConfig * (GLAD_API_PTR *PFNGLXGETFBCONFIGSPROC)(Display * dpy, int screen, int * nelements);
499 typedef __GLXextFuncPtr (GLAD_API_PTR *PFNGLXGETPROCADDRESSPROC)(const GLubyte * procName);
500 typedef void (GLAD_API_PTR *PFNGLXGETSELECTEDEVENTPROC)(Display * dpy, GLXDrawable draw, unsigned long * event_mask);
501 typedef int (GLAD_API_PTR *PFNGLXGETSWAPINTERVALMESAPROC)(void);
502 typedef XVisualInfo * (GLAD_API_PTR *PFNGLXGETVISUALFROMFBCONFIGPROC)(Display * dpy, GLXFBConfig config);
503 typedef Bool (GLAD_API_PTR *PFNGLXISDIRECTPROC)(Display * dpy, GLXContext ctx);
504 typedef Bool (GLAD_API_PTR *PFNGLXMAKECONTEXTCURRENTPROC)(Display * dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
505 typedef Bool (GLAD_API_PTR *PFNGLXMAKECURRENTPROC)(Display * dpy, GLXDrawable drawable, GLXContext ctx);
506 typedef int (GLAD_API_PTR *PFNGLXQUERYCONTEXTPROC)(Display * dpy, GLXContext ctx, int attribute, int * value);
507 typedef void (GLAD_API_PTR *PFNGLXQUERYDRAWABLEPROC)(Display * dpy, GLXDrawable draw, int attribute, unsigned int * value);
508 typedef Bool (GLAD_API_PTR *PFNGLXQUERYEXTENSIONPROC)(Display * dpy, int * errorb, int * event);
509 typedef const char * (GLAD_API_PTR *PFNGLXQUERYEXTENSIONSSTRINGPROC)(Display * dpy, int screen);
510 typedef const char * (GLAD_API_PTR *PFNGLXQUERYSERVERSTRINGPROC)(Display * dpy, int screen, int name);
511 typedef Bool (GLAD_API_PTR *PFNGLXQUERYVERSIONPROC)(Display * dpy, int * maj, int * min);
512 typedef void (GLAD_API_PTR *PFNGLXSELECTEVENTPROC)(Display * dpy, GLXDrawable draw, unsigned long event_mask);
513 typedef void (GLAD_API_PTR *PFNGLXSWAPBUFFERSPROC)(Display * dpy, GLXDrawable drawable);
514 typedef void (GLAD_API_PTR *PFNGLXSWAPINTERVALEXTPROC)(Display * dpy, GLXDrawable drawable, int interval);
515 typedef int (GLAD_API_PTR *PFNGLXSWAPINTERVALMESAPROC)(unsigned int interval);
516 typedef void (GLAD_API_PTR *PFNGLXUSEXFONTPROC)(Font font, int first, int count, int list);
517 typedef void (GLAD_API_PTR *PFNGLXWAITGLPROC)(void);
518 typedef void (GLAD_API_PTR *PFNGLXWAITXPROC)(void);
519
520 GLAD_API_CALL PFNGLXCHOOSEFBCONFIGPROC glad_glXChooseFBConfig;
521 #define glXChooseFBConfig glad_glXChooseFBConfig
522 GLAD_API_CALL PFNGLXCHOOSEVISUALPROC glad_glXChooseVisual;
523 #define glXChooseVisual glad_glXChooseVisual
524 GLAD_API_CALL PFNGLXCOPYCONTEXTPROC glad_glXCopyContext;
525 #define glXCopyContext glad_glXCopyContext
526 GLAD_API_CALL PFNGLXCREATECONTEXTPROC glad_glXCreateContext;
527 #define glXCreateContext glad_glXCreateContext
528 GLAD_API_CALL PFNGLXCREATECONTEXTATTRIBSARBPROC glad_glXCreateContextAttribsARB;
529 #define glXCreateContextAttribsARB glad_glXCreateContextAttribsARB
530 GLAD_API_CALL PFNGLXCREATEGLXPIXMAPPROC glad_glXCreateGLXPixmap;
531 #define glXCreateGLXPixmap glad_glXCreateGLXPixmap
532 GLAD_API_CALL PFNGLXCREATENEWCONTEXTPROC glad_glXCreateNewContext;
533 #define glXCreateNewContext glad_glXCreateNewContext
534 GLAD_API_CALL PFNGLXCREATEPBUFFERPROC glad_glXCreatePbuffer;
535 #define glXCreatePbuffer glad_glXCreatePbuffer
536 GLAD_API_CALL PFNGLXCREATEPIXMAPPROC glad_glXCreatePixmap;
537 #define glXCreatePixmap glad_glXCreatePixmap
538 GLAD_API_CALL PFNGLXCREATEWINDOWPROC glad_glXCreateWindow;
539 #define glXCreateWindow glad_glXCreateWindow
540 GLAD_API_CALL PFNGLXDESTROYCONTEXTPROC glad_glXDestroyContext;
541 #define glXDestroyContext glad_glXDestroyContext
542 GLAD_API_CALL PFNGLXDESTROYGLXPIXMAPPROC glad_glXDestroyGLXPixmap;
543 #define glXDestroyGLXPixmap glad_glXDestroyGLXPixmap
544 GLAD_API_CALL PFNGLXDESTROYPBUFFERPROC glad_glXDestroyPbuffer;
545 #define glXDestroyPbuffer glad_glXDestroyPbuffer
546 GLAD_API_CALL PFNGLXDESTROYPIXMAPPROC glad_glXDestroyPixmap;
547 #define glXDestroyPixmap glad_glXDestroyPixmap
548 GLAD_API_CALL PFNGLXDESTROYWINDOWPROC glad_glXDestroyWindow;
549 #define glXDestroyWindow glad_glXDestroyWindow
550 GLAD_API_CALL PFNGLXGETCLIENTSTRINGPROC glad_glXGetClientString;
551 #define glXGetClientString glad_glXGetClientString
552 GLAD_API_CALL PFNGLXGETCONFIGPROC glad_glXGetConfig;
553 #define glXGetConfig glad_glXGetConfig
554 GLAD_API_CALL PFNGLXGETCURRENTCONTEXTPROC glad_glXGetCurrentContext;
555 #define glXGetCurrentContext glad_glXGetCurrentContext
556 GLAD_API_CALL PFNGLXGETCURRENTDISPLAYPROC glad_glXGetCurrentDisplay;
557 #define glXGetCurrentDisplay glad_glXGetCurrentDisplay
558 GLAD_API_CALL PFNGLXGETCURRENTDRAWABLEPROC glad_glXGetCurrentDrawable;
559 #define glXGetCurrentDrawable glad_glXGetCurrentDrawable
560 GLAD_API_CALL PFNGLXGETCURRENTREADDRAWABLEPROC glad_glXGetCurrentReadDrawable;
561 #define glXGetCurrentReadDrawable glad_glXGetCurrentReadDrawable
562 GLAD_API_CALL PFNGLXGETFBCONFIGATTRIBPROC glad_glXGetFBConfigAttrib;
563 #define glXGetFBConfigAttrib glad_glXGetFBConfigAttrib
564 GLAD_API_CALL PFNGLXGETFBCONFIGSPROC glad_glXGetFBConfigs;
565 #define glXGetFBConfigs glad_glXGetFBConfigs
566 GLAD_API_CALL PFNGLXGETPROCADDRESSPROC glad_glXGetProcAddress;
567 #define glXGetProcAddress glad_glXGetProcAddress
568 GLAD_API_CALL PFNGLXGETSELECTEDEVENTPROC glad_glXGetSelectedEvent;
569 #define glXGetSelectedEvent glad_glXGetSelectedEvent
570 GLAD_API_CALL PFNGLXGETSWAPINTERVALMESAPROC glad_glXGetSwapIntervalMESA;
571 #define glXGetSwapIntervalMESA glad_glXGetSwapIntervalMESA
572 GLAD_API_CALL PFNGLXGETVISUALFROMFBCONFIGPROC glad_glXGetVisualFromFBConfig;
573 #define glXGetVisualFromFBConfig glad_glXGetVisualFromFBConfig
574 GLAD_API_CALL PFNGLXISDIRECTPROC glad_glXIsDirect;
575 #define glXIsDirect glad_glXIsDirect
576 GLAD_API_CALL PFNGLXMAKECONTEXTCURRENTPROC glad_glXMakeContextCurrent;
577 #define glXMakeContextCurrent glad_glXMakeContextCurrent
578 GLAD_API_CALL PFNGLXMAKECURRENTPROC glad_glXMakeCurrent;
579 #define glXMakeCurrent glad_glXMakeCurrent
580 GLAD_API_CALL PFNGLXQUERYCONTEXTPROC glad_glXQueryContext;
581 #define glXQueryContext glad_glXQueryContext
582 GLAD_API_CALL PFNGLXQUERYDRAWABLEPROC glad_glXQueryDrawable;
583 #define glXQueryDrawable glad_glXQueryDrawable
584 GLAD_API_CALL PFNGLXQUERYEXTENSIONPROC glad_glXQueryExtension;
585 #define glXQueryExtension glad_glXQueryExtension
586 GLAD_API_CALL PFNGLXQUERYEXTENSIONSSTRINGPROC glad_glXQueryExtensionsString;
587 #define glXQueryExtensionsString glad_glXQueryExtensionsString
588 GLAD_API_CALL PFNGLXQUERYSERVERSTRINGPROC glad_glXQueryServerString;
589 #define glXQueryServerString glad_glXQueryServerString
590 GLAD_API_CALL PFNGLXQUERYVERSIONPROC glad_glXQueryVersion;
591 #define glXQueryVersion glad_glXQueryVersion
592 GLAD_API_CALL PFNGLXSELECTEVENTPROC glad_glXSelectEvent;
593 #define glXSelectEvent glad_glXSelectEvent
594 GLAD_API_CALL PFNGLXSWAPBUFFERSPROC glad_glXSwapBuffers;
595 #define glXSwapBuffers glad_glXSwapBuffers
596 GLAD_API_CALL PFNGLXSWAPINTERVALEXTPROC glad_glXSwapIntervalEXT;
597 #define glXSwapIntervalEXT glad_glXSwapIntervalEXT
598 GLAD_API_CALL PFNGLXSWAPINTERVALMESAPROC glad_glXSwapIntervalMESA;
599 #define glXSwapIntervalMESA glad_glXSwapIntervalMESA
600 GLAD_API_CALL PFNGLXUSEXFONTPROC glad_glXUseXFont;
601 #define glXUseXFont glad_glXUseXFont
602 GLAD_API_CALL PFNGLXWAITGLPROC glad_glXWaitGL;
603 #define glXWaitGL glad_glXWaitGL
604 GLAD_API_CALL PFNGLXWAITXPROC glad_glXWaitX;
605 #define glXWaitX glad_glXWaitX
606
607
608
609
610
611 GLAD_API_CALL int gladLoadGLXUserPtr(Display *display, int screen, GLADuserptrloadfunc load, void *userptr);
612 GLAD_API_CALL int gladLoadGLX(Display *display, int screen, GLADloadfunc load);
613
614 #ifdef GLAD_GLX
615
616 GLAD_API_CALL int gladLoaderLoadGLX(Display *display, int screen);
617
618 GLAD_API_CALL void gladLoaderUnloadGLX(void);
619
620 #endif
621 #ifdef __cplusplus
622 }
623 #endif
624 #endif
625
626 /* Source */
627 #ifdef GLAD_GLX_IMPLEMENTATION
628 #include <stdio.h>
629 #include <stdlib.h>
630 #include <string.h>
631
632 #ifndef GLAD_IMPL_UTIL_C_
633 #define GLAD_IMPL_UTIL_C_
634
635 #ifdef _MSC_VER
636 #define GLAD_IMPL_UTIL_SSCANF sscanf_s
637 #else
638 #define GLAD_IMPL_UTIL_SSCANF sscanf
639 #endif
640
641 #endif /* GLAD_IMPL_UTIL_C_ */
642
643 #ifdef __cplusplus
644 extern "C" {
645 #endif
646
647
648
649 int GLAD_GLX_VERSION_1_0 = 0;
650 int GLAD_GLX_VERSION_1_1 = 0;
651 int GLAD_GLX_VERSION_1_2 = 0;
652 int GLAD_GLX_VERSION_1_3 = 0;
653 int GLAD_GLX_VERSION_1_4 = 0;
654 int GLAD_GLX_ARB_create_context = 0;
655 int GLAD_GLX_ARB_create_context_profile = 0;
656 int GLAD_GLX_ARB_multisample = 0;
657 int GLAD_GLX_EXT_swap_control = 0;
658 int GLAD_GLX_MESA_swap_control = 0;
659
660
661
662 PFNGLXCHOOSEFBCONFIGPROC glad_glXChooseFBConfig = NULL;
663 PFNGLXCHOOSEVISUALPROC glad_glXChooseVisual = NULL;
664 PFNGLXCOPYCONTEXTPROC glad_glXCopyContext = NULL;
665 PFNGLXCREATECONTEXTPROC glad_glXCreateContext = NULL;
666 PFNGLXCREATECONTEXTATTRIBSARBPROC glad_glXCreateContextAttribsARB = NULL;
667 PFNGLXCREATEGLXPIXMAPPROC glad_glXCreateGLXPixmap = NULL;
668 PFNGLXCREATENEWCONTEXTPROC glad_glXCreateNewContext = NULL;
669 PFNGLXCREATEPBUFFERPROC glad_glXCreatePbuffer = NULL;
670 PFNGLXCREATEPIXMAPPROC glad_glXCreatePixmap = NULL;
671 PFNGLXCREATEWINDOWPROC glad_glXCreateWindow = NULL;
672 PFNGLXDESTROYCONTEXTPROC glad_glXDestroyContext = NULL;
673 PFNGLXDESTROYGLXPIXMAPPROC glad_glXDestroyGLXPixmap = NULL;
674 PFNGLXDESTROYPBUFFERPROC glad_glXDestroyPbuffer = NULL;
675 PFNGLXDESTROYPIXMAPPROC glad_glXDestroyPixmap = NULL;
676 PFNGLXDESTROYWINDOWPROC glad_glXDestroyWindow = NULL;
677 PFNGLXGETCLIENTSTRINGPROC glad_glXGetClientString = NULL;
678 PFNGLXGETCONFIGPROC glad_glXGetConfig = NULL;
679 PFNGLXGETCURRENTCONTEXTPROC glad_glXGetCurrentContext = NULL;
680 PFNGLXGETCURRENTDISPLAYPROC glad_glXGetCurrentDisplay = NULL;
681 PFNGLXGETCURRENTDRAWABLEPROC glad_glXGetCurrentDrawable = NULL;
682 PFNGLXGETCURRENTREADDRAWABLEPROC glad_glXGetCurrentReadDrawable = NULL;
683 PFNGLXGETFBCONFIGATTRIBPROC glad_glXGetFBConfigAttrib = NULL;
684 PFNGLXGETFBCONFIGSPROC glad_glXGetFBConfigs = NULL;
685 PFNGLXGETPROCADDRESSPROC glad_glXGetProcAddress = NULL;
686 PFNGLXGETSELECTEDEVENTPROC glad_glXGetSelectedEvent = NULL;
687 PFNGLXGETSWAPINTERVALMESAPROC glad_glXGetSwapIntervalMESA = NULL;
688 PFNGLXGETVISUALFROMFBCONFIGPROC glad_glXGetVisualFromFBConfig = NULL;
689 PFNGLXISDIRECTPROC glad_glXIsDirect = NULL;
690 PFNGLXMAKECONTEXTCURRENTPROC glad_glXMakeContextCurrent = NULL;
691 PFNGLXMAKECURRENTPROC glad_glXMakeCurrent = NULL;
692 PFNGLXQUERYCONTEXTPROC glad_glXQueryContext = NULL;
693 PFNGLXQUERYDRAWABLEPROC glad_glXQueryDrawable = NULL;
694 PFNGLXQUERYEXTENSIONPROC glad_glXQueryExtension = NULL;
695 PFNGLXQUERYEXTENSIONSSTRINGPROC glad_glXQueryExtensionsString = NULL;
696 PFNGLXQUERYSERVERSTRINGPROC glad_glXQueryServerString = NULL;
697 PFNGLXQUERYVERSIONPROC glad_glXQueryVersion = NULL;
698 PFNGLXSELECTEVENTPROC glad_glXSelectEvent = NULL;
699 PFNGLXSWAPBUFFERSPROC glad_glXSwapBuffers = NULL;
700 PFNGLXSWAPINTERVALEXTPROC glad_glXSwapIntervalEXT = NULL;
701 PFNGLXSWAPINTERVALMESAPROC glad_glXSwapIntervalMESA = NULL;
702 PFNGLXUSEXFONTPROC glad_glXUseXFont = NULL;
703 PFNGLXWAITGLPROC glad_glXWaitGL = NULL;
704 PFNGLXWAITXPROC glad_glXWaitX = NULL;
705
706
707 static void glad_glx_load_GLX_VERSION_1_0( GLADuserptrloadfunc load, void* userptr) {
708 if(!GLAD_GLX_VERSION_1_0) return;
709 glad_glXChooseVisual = (PFNGLXCHOOSEVISUALPROC) load(userptr, "glXChooseVisual");
710 glad_glXCopyContext = (PFNGLXCOPYCONTEXTPROC) load(userptr, "glXCopyContext");
711 glad_glXCreateContext = (PFNGLXCREATECONTEXTPROC) load(userptr, "glXCreateContext");
712 glad_glXCreateGLXPixmap = (PFNGLXCREATEGLXPIXMAPPROC) load(userptr, "glXCreateGLXPixmap");
713 glad_glXDestroyContext = (PFNGLXDESTROYCONTEXTPROC) load(userptr, "glXDestroyContext");
714 glad_glXDestroyGLXPixmap = (PFNGLXDESTROYGLXPIXMAPPROC) load(userptr, "glXDestroyGLXPixmap");
715 glad_glXGetConfig = (PFNGLXGETCONFIGPROC) load(userptr, "glXGetConfig");
716 glad_glXGetCurrentContext = (PFNGLXGETCURRENTCONTEXTPROC) load(userptr, "glXGetCurrentContext");
717 glad_glXGetCurrentDrawable = (PFNGLXGETCURRENTDRAWABLEPROC) load(userptr, "glXGetCurrentDrawable");
718 glad_glXIsDirect = (PFNGLXISDIRECTPROC) load(userptr, "glXIsDirect");
719 glad_glXMakeCurrent = (PFNGLXMAKECURRENTPROC) load(userptr, "glXMakeCurrent");
720 glad_glXQueryExtension = (PFNGLXQUERYEXTENSIONPROC) load(userptr, "glXQueryExtension");
721 glad_glXQueryVersion = (PFNGLXQUERYVERSIONPROC) load(userptr, "glXQueryVersion");
722 glad_glXSwapBuffers = (PFNGLXSWAPBUFFERSPROC) load(userptr, "glXSwapBuffers");
723 glad_glXUseXFont = (PFNGLXUSEXFONTPROC) load(userptr, "glXUseXFont");
724 glad_glXWaitGL = (PFNGLXWAITGLPROC) load(userptr, "glXWaitGL");
725 glad_glXWaitX = (PFNGLXWAITXPROC) load(userptr, "glXWaitX");
726 }
727 static void glad_glx_load_GLX_VERSION_1_1( GLADuserptrloadfunc load, void* userptr) {
728 if(!GLAD_GLX_VERSION_1_1) return;
729 glad_glXGetClientString = (PFNGLXGETCLIENTSTRINGPROC) load(userptr, "glXGetClientString");
730 glad_glXQueryExtensionsString = (PFNGLXQUERYEXTENSIONSSTRINGPROC) load(userptr, "glXQueryExtensionsString");
731 glad_glXQueryServerString = (PFNGLXQUERYSERVERSTRINGPROC) load(userptr, "glXQueryServerString");
732 }
733 static void glad_glx_load_GLX_VERSION_1_2( GLADuserptrloadfunc load, void* userptr) {
734 if(!GLAD_GLX_VERSION_1_2) return;
735 glad_glXGetCurrentDisplay = (PFNGLXGETCURRENTDISPLAYPROC) load(userptr, "glXGetCurrentDisplay");
736 }
737 static void glad_glx_load_GLX_VERSION_1_3( GLADuserptrloadfunc load, void* userptr) {
738 if(!GLAD_GLX_VERSION_1_3) return;
739 glad_glXChooseFBConfig = (PFNGLXCHOOSEFBCONFIGPROC) load(userptr, "glXChooseFBConfig");
740 glad_glXCreateNewContext = (PFNGLXCREATENEWCONTEXTPROC) load(userptr, "glXCreateNewContext");
741 glad_glXCreatePbuffer = (PFNGLXCREATEPBUFFERPROC) load(userptr, "glXCreatePbuffer");
742 glad_glXCreatePixmap = (PFNGLXCREATEPIXMAPPROC) load(userptr, "glXCreatePixmap");
743 glad_glXCreateWindow = (PFNGLXCREATEWINDOWPROC) load(userptr, "glXCreateWindow");
744 glad_glXDestroyPbuffer = (PFNGLXDESTROYPBUFFERPROC) load(userptr, "glXDestroyPbuffer");
745 glad_glXDestroyPixmap = (PFNGLXDESTROYPIXMAPPROC) load(userptr, "glXDestroyPixmap");
746 glad_glXDestroyWindow = (PFNGLXDESTROYWINDOWPROC) load(userptr, "glXDestroyWindow");
747 glad_glXGetCurrentReadDrawable = (PFNGLXGETCURRENTREADDRAWABLEPROC) load(userptr, "glXGetCurrentReadDrawable");
748 glad_glXGetFBConfigAttrib = (PFNGLXGETFBCONFIGATTRIBPROC) load(userptr, "glXGetFBConfigAttrib");
749 glad_glXGetFBConfigs = (PFNGLXGETFBCONFIGSPROC) load(userptr, "glXGetFBConfigs");
750 glad_glXGetSelectedEvent = (PFNGLXGETSELECTEDEVENTPROC) load(userptr, "glXGetSelectedEvent");
751 glad_glXGetVisualFromFBConfig = (PFNGLXGETVISUALFROMFBCONFIGPROC) load(userptr, "glXGetVisualFromFBConfig");
752 glad_glXMakeContextCurrent = (PFNGLXMAKECONTEXTCURRENTPROC) load(userptr, "glXMakeContextCurrent");
753 glad_glXQueryContext = (PFNGLXQUERYCONTEXTPROC) load(userptr, "glXQueryContext");
754 glad_glXQueryDrawable = (PFNGLXQUERYDRAWABLEPROC) load(userptr, "glXQueryDrawable");
755 glad_glXSelectEvent = (PFNGLXSELECTEVENTPROC) load(userptr, "glXSelectEvent");
756 }
757 static void glad_glx_load_GLX_VERSION_1_4( GLADuserptrloadfunc load, void* userptr) {
758 if(!GLAD_GLX_VERSION_1_4) return;
759 glad_glXGetProcAddress = (PFNGLXGETPROCADDRESSPROC) load(userptr, "glXGetProcAddress");
760 }
761 static void glad_glx_load_GLX_ARB_create_context( GLADuserptrloadfunc load, void* userptr) {
762 if(!GLAD_GLX_ARB_create_context) return;
763 glad_glXCreateContextAttribsARB = (PFNGLXCREATECONTEXTATTRIBSARBPROC) load(userptr, "glXCreateContextAttribsARB");
764 }
765 static void glad_glx_load_GLX_EXT_swap_control( GLADuserptrloadfunc load, void* userptr) {
766 if(!GLAD_GLX_EXT_swap_control) return;
767 glad_glXSwapIntervalEXT = (PFNGLXSWAPINTERVALEXTPROC) load(userptr, "glXSwapIntervalEXT");
768 }
769 static void glad_glx_load_GLX_MESA_swap_control( GLADuserptrloadfunc load, void* userptr) {
770 if(!GLAD_GLX_MESA_swap_control) return;
771 glad_glXGetSwapIntervalMESA = (PFNGLXGETSWAPINTERVALMESAPROC) load(userptr, "glXGetSwapIntervalMESA");
772 glad_glXSwapIntervalMESA = (PFNGLXSWAPINTERVALMESAPROC) load(userptr, "glXSwapIntervalMESA");
773 }
774
775
776
777 static int glad_glx_has_extension(Display *display, int screen, const char *ext) {
778 #ifndef GLX_VERSION_1_1
779 (void) display;
780 (void) screen;
781 (void) ext;
782 #else
783 const char *terminator;
784 const char *loc;
785 const char *extensions;
786
787 if (glXQueryExtensionsString == NULL) {
788 return 0;
789 }
790
791 extensions = glXQueryExtensionsString(display, screen);
792
793 if(extensions == NULL || ext == NULL) {
794 return 0;
795 }
796
797 while(1) {
798 loc = strstr(extensions, ext);
799 if(loc == NULL)
800 break;
801
802 terminator = loc + strlen(ext);
803 if((loc == extensions || *(loc - 1) == ' ') &&
804 (*terminator == ' ' || *terminator == '\0')) {
805 return 1;
806 }
807 extensions = terminator;
808 }
809 #endif
810
811 return 0;
812 }
813
814 static GLADapiproc glad_glx_get_proc_from_userptr(void *userptr, const char* name) {
815 return (GLAD_GNUC_EXTENSION (GLADapiproc (*)(const char *name)) userptr)(name);
816 }
817
818 static int glad_glx_find_extensions(Display *display, int screen) {
819 GLAD_GLX_ARB_create_context = glad_glx_has_extension(display, screen, "GLX_ARB_create_context");
820 GLAD_GLX_ARB_create_context_profile = glad_glx_has_extension(display, screen, "GLX_ARB_create_context_profile");
821 GLAD_GLX_ARB_multisample = glad_glx_has_extension(display, screen, "GLX_ARB_multisample");
822 GLAD_GLX_EXT_swap_control = glad_glx_has_extension(display, screen, "GLX_EXT_swap_control");
823 GLAD_GLX_MESA_swap_control = glad_glx_has_extension(display, screen, "GLX_MESA_swap_control");
824 return 1;
825 }
826
827 static int glad_glx_find_core_glx(Display **display, int *screen) {
828 int major = 0, minor = 0;
829 if(*display == NULL) {
830 #ifdef GLAD_GLX_NO_X11
831 (void) screen;
832 return 0;
833 #else
834 *display = XOpenDisplay(0);
835 if (*display == NULL) {
836 return 0;
837 }
838 *screen = XScreenNumberOfScreen(XDefaultScreenOfDisplay(*display));
839 #endif
840 }
841 glXQueryVersion(*display, &major, &minor);
842 GLAD_GLX_VERSION_1_0 = (major == 1 && minor >= 0) || major > 1;
843 GLAD_GLX_VERSION_1_1 = (major == 1 && minor >= 1) || major > 1;
844 GLAD_GLX_VERSION_1_2 = (major == 1 && minor >= 2) || major > 1;
845 GLAD_GLX_VERSION_1_3 = (major == 1 && minor >= 3) || major > 1;
846 GLAD_GLX_VERSION_1_4 = (major == 1 && minor >= 4) || major > 1;
847 return GLAD_MAKE_VERSION(major, minor);
848 }
849
850 int gladLoadGLXUserPtr(Display *display, int screen, GLADuserptrloadfunc load, void *userptr) {
851 int version;
852 glXQueryVersion = (PFNGLXQUERYVERSIONPROC) load(userptr, "glXQueryVersion");
853 if(glXQueryVersion == NULL) return 0;
854 version = glad_glx_find_core_glx(&display, &screen);
855
856 glad_glx_load_GLX_VERSION_1_0(load, userptr);
857 glad_glx_load_GLX_VERSION_1_1(load, userptr);
858 glad_glx_load_GLX_VERSION_1_2(load, userptr);
859 glad_glx_load_GLX_VERSION_1_3(load, userptr);
860 glad_glx_load_GLX_VERSION_1_4(load, userptr);
861
862 if (!glad_glx_find_extensions(display, screen)) return 0;
863 glad_glx_load_GLX_ARB_create_context(load, userptr);
864 glad_glx_load_GLX_EXT_swap_control(load, userptr);
865 glad_glx_load_GLX_MESA_swap_control(load, userptr);
866
867 return version;
868 }
869
870 int gladLoadGLX(Display *display, int screen, GLADloadfunc load) {
871 return gladLoadGLXUserPtr(display, screen, glad_glx_get_proc_from_userptr, GLAD_GNUC_EXTENSION (void*) load);
872 }
873
874
875
876 #ifdef GLAD_GLX
877
878 #ifndef GLAD_LOADER_LIBRARY_C_
879 #define GLAD_LOADER_LIBRARY_C_
880
881 #include <stddef.h>
882 #include <stdlib.h>
883
884 #if GLAD_PLATFORM_WIN32
885 #include <windows.h>
886 #else
887 #include <dlfcn.h>
888 #endif
889
890
891 static void* glad_get_dlopen_handle(const char *lib_names[], int length) {
892 void *handle = NULL;
893 int i;
894
895 for (i = 0; i < length; ++i) {
896 #if GLAD_PLATFORM_WIN32
897 #if GLAD_PLATFORM_UWP
898 size_t buffer_size = (strlen(lib_names[i]) + 1) * sizeof(WCHAR);
899 LPWSTR buffer = (LPWSTR) malloc(buffer_size);
900 if (buffer != NULL) {
901 int ret = MultiByteToWideChar(CP_ACP, 0, lib_names[i], -1, buffer, buffer_size);
902 if (ret != 0) {
903 handle = (void*) LoadPackagedLibrary(buffer, 0);
904 }
905 free((void*) buffer);
906 }
907 #else
908 handle = (void*) LoadLibraryA(lib_names[i]);
909 #endif
910 #else
911 handle = dlopen(lib_names[i], RTLD_LAZY | RTLD_LOCAL);
912 #endif
913 if (handle != NULL) {
914 return handle;
915 }
916 }
917
918 return NULL;
919 }
920
921 static void glad_close_dlopen_handle(void* handle) {
922 if (handle != NULL) {
923 #if GLAD_PLATFORM_WIN32
924 FreeLibrary((HMODULE) handle);
925 #else
926 dlclose(handle);
927 #endif
928 }
929 }
930
931 static GLADapiproc glad_dlsym_handle(void* handle, const char *name) {
932 if (handle == NULL) {
933 return NULL;
934 }
935
936 #if GLAD_PLATFORM_WIN32
937 return (GLADapiproc) GetProcAddress((HMODULE) handle, name);
938 #else
939 return GLAD_GNUC_EXTENSION (GLADapiproc) dlsym(handle, name);
940 #endif
941 }
942
943 #endif /* GLAD_LOADER_LIBRARY_C_ */
944
945 typedef void* (GLAD_API_PTR *GLADglxprocaddrfunc)(const char*);
946
947 static GLADapiproc glad_glx_get_proc(void *userptr, const char *name) {
948 return GLAD_GNUC_EXTENSION ((GLADapiproc (*)(const char *name)) userptr)(name);
949 }
950
951 static void* _glx_handle;
952
953 static void* glad_glx_dlopen_handle(void) {
954 static const char *NAMES[] = {
955 #if defined __CYGWIN__
956 "libGL-1.so",
957 #endif
958 "libGL.so.1",
959 "libGL.so"
960 };
961
962 if (_glx_handle == NULL) {
963 _glx_handle = glad_get_dlopen_handle(NAMES, sizeof(NAMES) / sizeof(NAMES[0]));
964 }
965
966 return _glx_handle;
967 }
968
969 int gladLoaderLoadGLX(Display *display, int screen) {
970 int version = 0;
971 void *handle = NULL;
972 int did_load = 0;
973 GLADglxprocaddrfunc loader;
974
975 did_load = _glx_handle == NULL;
976 handle = glad_glx_dlopen_handle();
977 if (handle != NULL) {
978 loader = (GLADglxprocaddrfunc) glad_dlsym_handle(handle, "glXGetProcAddressARB");
979 if (loader != NULL) {
980 version = gladLoadGLXUserPtr(display, screen, glad_glx_get_proc, GLAD_GNUC_EXTENSION (void*) loader);
981 }
982
983 if (!version && did_load) {
984 gladLoaderUnloadGLX();
985 }
986 }
987
988 return version;
989 }
990
991
992 void gladLoaderUnloadGLX() {
993 if (_glx_handle != NULL) {
994 glad_close_dlopen_handle(_glx_handle);
995 _glx_handle = NULL;
996 }
997 }
998
999 #endif /* GLAD_GLX */
1000
1001 #ifdef __cplusplus
1002 }
1003 #endif
1004
1005 #endif /* GLAD_GLX_IMPLEMENTATION */
1006
The diff for file include/stb_image.h is too big (7985 changes) and cannot be shown.
File include/zone.h added (mode: 100644) (index 0000000..1345811)
1 #ifndef ZONE_H
2 #define ZONE_H
3
4 #ifndef ZONE_DATA
5 #error Please define ZONE_DATA members before including zone.h.
6 #endif
7
8 #include <string.h>
9
10 typedef struct Zone {
11 ZONE_DATA
12 double xmin, xmax, ymin, ymax, zmin, zmax;
13 int priority;
14 struct Zone *prev, *next;
15 } Zone;
16
17 // List of zones.
18 Zone *zones = NULL;
19
20 // Zones to interpolate between.
21 Zone *zoneA = NULL, *zoneB = NULL;
22 // Zone interpolator.
23 double zoneF = 0.0;
24
25 /// The zone to render with. ///
26 Zone visualZone =
27 #ifdef __cplusplus
28 {};
29 #else
30 {0};
31 #endif
32
33 Zone *ZoneAdd(Zone podzone){
34 // Allocate a Zone object.
35 Zone *z = (Zone*)malloc(sizeof(Zone));
36 if(!z) return NULL;
37 // Copy podzone into the Zone object.
38 memcpy(z, &podzone, sizeof(Zone));
39 // Push the Zone object to the back of the list.
40 if(zones){
41 Zone *zones_ptr = zones;
42 while(zones_ptr->next)
43 zones_ptr = zones_ptr->next;
44 zones_ptr->next = z;
45 z->prev = zones_ptr;
46 }else{
47 zones = z;
48 z->prev = NULL;
49 }
50 z->next = NULL;
51 return z;
52 }
53
54 void ZoneUpdate(double camx, double camy, double camz, double dt){
55 // Set zoneB to the zone the camera is currently in.
56 int priority = -1;
57 Zone *z = zones;
58 while(z){
59 if((z->priority > priority)
60 && (camx > z->xmin) && (camx < z->xmax)
61 && (camy > z->ymin) && (camy < z->ymax)
62 && (camz > z->zmin) && (camz < z->zmax)){
63 priority = z->priority;
64 zoneB = z;
65 }
66 z = z->next;
67 }
68 // Linearly interpolate between zones.
69 // User code can interpolate the ZONE_DATA values from zoneA to zoneB.
70 zoneF += dt;
71 if(zoneF > 1.0 || zoneA == NULL) zoneA = zoneB;
72 if(zoneA == zoneB) zoneF = 0.0;
73 //printf("%lld, %lld\nzoneA: 0x%llx\nzoneB: 0x%llx\nzoneF: %f\n",
74 // (long long)camx, (long long)camz,
75 // (unsigned long long)zoneA, (unsigned long long)zoneB, (float)zoneF);
76 }
77
78 #endif // ZONE_H
File src/cfps.c added (mode: 100644) (index 0000000..17a84f1)
1 #define STB_IMAGE_IMPLEMENTATION
2 #include <stb_image.h>
3
4 #include <fgc.h>
5
6 #define ZONE_DATA FGCColor backFog, backSky, foreFog, foreSky;
7 #include <zone.h>
8
9 FGCTexture tex_cyan, tex_paused, tex_wall;
10
11 mat4 viewMat, projMat;
12
13 double cameraAngleX = 0.0, cameraAngleY = 0.0;
14 vec3 cameraPosition = {0.0, 1.5, 3.0};
15
16 double meshAngle = 0.0;
17
18 bool paused = false;
19
20 FGCFramebuffer gbuffer =
21 #ifdef __cplusplus
22 {};
23 #else
24 {0};
25 #endif
26
27 const char* skyLitVert =
28 "uniform mat4 u_matrices[6]; // 0:mvp 1:mv 2:m 3:nrm 4:tex 5:light \n"
29 "uniform vec3 u_camera; \n"
30 "layout(location = 0) in vec4 a_Position; \n"
31 "layout(location = 1) in vec4 a_Normal; \n"
32 "layout(location = 2) in vec4 a_UV; \n"
33 "out vec2 v_UV; \n"
34 "out vec4 v_RelativePos; \n"
35 "out vec3 v_Normal; \n"
36 "out vec3 v_Position; \n"
37 "out vec3 v_ToCamera; \n"
38 "void main(){ \n"
39 " v_UV = vec2(u_matrices[4] * a_UV); \n"
40 " v_RelativePos = u_matrices[1] * a_Position; \n"
41 " v_Normal = vec3(u_matrices[3] * a_Normal); \n"
42 " mat4 m = u_matrices[2]; \n"
43 " // Remove the positional offset from the model matrix. \n"
44 " m[3] = vec4(0.0, 0.0, 0.0, 1.0); \n"
45 " v_Position = vec3(m * a_Position); \n"
46 " // (relative cam pos) - (vert pos without model pos offset) \n"
47 " v_ToCamera = u_camera - v_Position; \n"
48 " gl_Position = u_matrices[0] * a_Position; \n"
49 "}";
50
51 const char* skyLitFrag =
52 "uniform sampler2D u_texture; \n"
53 "uniform vec4 u_fog; \n"
54 "uniform vec4 u_sky; \n"
55 "uniform vec3 u_camera; \n"
56 "in vec2 v_UV; \n"
57 "in vec4 v_RelativePos; \n"
58 "in vec3 v_Normal; \n"
59 "in vec3 v_Position; \n"
60 "in vec3 v_ToCamera; \n"
61 "layout(location = 0) out vec4 fragColor; \n"
62 "vec4 SkyColor(vec3 A, float hard){ \n"
63 " float v = max(A.y, 0.0); \n"
64 " float hardCurve = pow(hard, 8.0) * 100.0; \n"
65 " vec3 glow = u_sky.rgb * (1.0 - v) \n"
66 " * clamp(A.y * hardCurve + 1.0, 0.0, 1.0); \n"
67 " return vec4(u_fog.rgb + glow, 1.0); \n"
68 "} \n"
69 "vec3 FresnelSchlickRoughness(float cosTheta, vec3 F0, float rough){ \n"
70 " return F0 + (max(vec3(1.0-rough),F0)-F0) * pow(1.0-cosTheta,5.0);\n"
71 "} \n"
72 "void main(){ \n"
73 " vec4 baseColor = texture(u_texture, v_UV); \n"
74 " if(baseColor.a < 0.001) discard; \n"
75 " float rough = 0.4; \n"
76 " vec3 N = normalize(v_Normal); \n"
77 " vec3 V = normalize(u_camera - v_Position); \n"
78 " vec3 R = reflect(-V, N); \n"
79 " // Dot product of camera and normal vectors. \n"
80 " float cosTheta = max(dot(normalize(v_ToCamera), N), -0.1); \n"
81 " // Schlick's approximation. \n"
82 " vec3 kS = FresnelSchlickRoughness(cosTheta, vec3(0.04), rough); \n"
83 " vec3 kD = 1.0 - kS; \n"
84 " // Specular. \n"
85 " vec3 spec = kS * SkyColor(R, 1.0 - rough * 0.5).xyz; \n"
86 " // Diffuse. Multiply the irradiant light by the base color. \n"
87 " vec3 dif = baseColor.rgb * kD * SkyColor(N, 0.5).xyz; \n"
88 " // Interpolate between lit color and sky. \n"
89 " float vis = 1.0 / exp(length(v_RelativePos) * u_fog.a); \n"
90 " fragColor = \n"
91 " //vec4(mix(SkyColor(-V, 1.0-vis).xyz, dif+spec, vis), baseColor.a);\n"
92 "vec4(N, baseColor.a);"
93 "}";
94
95 const char* skyLitSamplers[] = { "u_texture", 0 };
96
97 FGCPipeline skyLitPipeline;
98
99 const char* skyVert =
100 "uniform mat4 u_matrices[6]; // 0:mvp 1:mv 2:m 3:nrm 4:tex 5:light \n"
101 "layout(location = 0) in vec4 a_Position; \n"
102 "layout(location = 1) in vec4 a_Normal; \n"
103 "layout(location = 2) in vec4 a_UV; \n"
104 "out vec3 v_STR; \n"
105 "void main(){ \n"
106 " v_STR = a_Position.xyz; \n"
107 " vec4 pos = u_matrices[0] * a_Position; \n"
108 " gl_Position = pos.xyww; \n"
109 "}";
110
111 const char* gradientSkyFrag =
112 "uniform vec4 u_fog; \n"
113 "uniform vec4 u_sky; \n"
114 "uniform vec3 u_camera; \n"
115 "in vec3 v_STR; \n"
116 "layout(location = 0) out vec4 fragColor; \n"
117 "//https://gist.github.com/patriciogonzalezvivo/670c22f3966e662d2f83 \n"
118 "vec4 mod289(vec4 x){return x - floor(x * (1.0 / 289.0)) * 289.0;} \n"
119 "vec4 perm(vec4 x){return mod289(((x * 34.0) + 1.0) * x);} \n"
120 "float Noise(vec3 p){ \n"
121 " vec3 a = floor(p); \n"
122 " vec3 d = p - a; \n"
123 " d = d * d * (3.0 - 2.0 * d); \n"
124 " vec4 b = a.xxyy + vec4(0.0, 1.0, 0.0, 1.0); \n"
125 " vec4 k1 = perm(b.xyxy); \n"
126 " vec4 k2 = perm(k1.xyxy + b.zzww); \n"
127 " vec4 c = k2 + a.zzzz; \n"
128 " vec4 k3 = perm(c); \n"
129 " vec4 k4 = perm(c + 1.0); \n"
130 " vec4 o1 = fract(k3 * (1.0 / 41.0)); \n"
131 " vec4 o2 = fract(k4 * (1.0 / 41.0)); \n"
132 " vec4 o3 = o2 * d.z + o1 * (1.0 - d.z); \n"
133 " vec2 o4 = o3.yw * d.x + o3.xz * (1.0 - d.x); \n"
134 " return o4.y * d.y + o4.x * (1.0 - d.y); \n"
135 "} \n"
136 "vec4 SkyColor(vec3 A, float hard){ \n"
137 " float v = max(A.y, 0.0); \n"
138 " float hardCurve = pow(hard, 8.0) * 100.0; \n"
139 " vec3 glow = u_sky.rgb * (1.0 - v) \n"
140 " * clamp(A.y * hardCurve + 1.0, 0.0, 1.0); \n"
141 " return vec4(u_fog.rgb + glow, 1.0) \n"
142 " + clamp((Noise(normalize(A)*180.0)*0.194-0.189)*180.0,0.0,1.0) \n"
143 " * u_sky.a * clamp(A.y * 100.0 + 1.0, 0.0, 1.0); // Horizon. \n"
144 "} \n"
145 "void main(){ \n"
146 " vec3 N = normalize(v_STR); \n"
147 " fragColor = SkyColor(N, 1.0); \n"
148 "}";
149
150 const char* gradientSkySamplers[] = {0};
151
152 FGCPipeline gradientSkyPipeline;
153
154 FGCColor LerpColor(FGCColor ca, FGCColor cb, float f){
155 return (FGCColor){
156 f * (cb.r - ca.r) + ca.r,
157 f * (cb.g - ca.g) + ca.g,
158 f * (cb.b - ca.b) + ca.b,
159 f * (cb.a - ca.a) + ca.a
160 };
161 }
162
163 void DrawSky(
164 mat4 viewMat,
165 mat4 projMat,
166 FGCPipeline pipe,
167 FGCColor fog,
168 FGCColor sky){
169 if(!pipe.success) return;
170 FGCPipeline old_pipeline = fgcDrawPipeline;
171 fgcSetPipeline(pipe);
172 glUniform4f(fgcDrawPipeline.u_fog, fog.r, fog.g, fog.b, fog.a);
173 glUniform4f( // TODO: Maybe store this uniform location somewhere.
174 glGetUniformLocation(fgcDrawPipeline.programObject, "u_sky"),
175 sky.r, sky.g, sky.b, sky.a
176 );
177 glDisable(GL_CULL_FACE);
178 // Extract the 3x3 rotation matrix from the view matrix.
179 // The camera is effectively at <0,0,0> with the skybox.
180 fgcDrawMesh(
181 &fgcCubeMesh,
182 MAT4_IDEN,
183 MAT4(
184 viewMat.m[0][0], viewMat.m[0][1], viewMat.m[0][2], 0.0,
185 viewMat.m[1][0], viewMat.m[1][1], viewMat.m[1][2], 0.0,
186 viewMat.m[2][0], viewMat.m[2][1], viewMat.m[2][2], 0.0,
187 0.0, 0.0, 0.0, 1.0
188 ),
189 projMat
190 );
191 glUniform4f(fgcDrawPipeline.u_fog, fgcFogColor.r, fgcFogColor.g, fgcFogColor.b, fgcFogColor.a);
192 fgcSetPipeline(old_pipeline);
193 glEnable(GL_CULL_FACE);
194 }
195
196 // Draw an image with position, rotation, and scaling.
197 void DrawImage(FGCTexture tex, float posX, float posY, float angle, float scaleX, float scaleY){
198 double screenWidth = fgcGetDisplayWidth(), screenHeight = fgcGetDisplayHeight();
199 double textureWidth = tex.width, textureHeight = tex.height;
200 fgcSetTexture(tex, 0);
201 fgcDrawMesh(
202 &fgcPlaneMesh,
203 mat4MultiplyMatrix(
204 mat4SetTranslation(VEC3(
205 (textureWidth * 0.5 * scaleX + posX) / screenHeight * 2.0 - screenWidth / screenHeight,
206 (textureHeight * 0.5 * scaleY + posY) / screenHeight * -2.0 + 1.0,
207 0.0
208 )),
209 mat4MultiplyMatrix(
210 mat4SetRotationQuaternion(fgcEulerToQuat(0.0, 0.0, angle)),
211 mat4SetScaleXYZ(VEC3(
212 textureWidth / screenHeight * scaleX * 2.0,
213 textureHeight / screenHeight * scaleY * 2.0,
214 1.0
215 ))
216 )
217 ),
218 MAT4_IDEN,
219 mat4SetScaleXYZ(VEC3(screenHeight / screenWidth, 1.0, 1.0))
220 );
221 }
222
223 // Pause or unpause the game.
224 void PauseGame(bool pause){
225 paused = pause;
226 if(fgcMouseTrapped == pause) fgcTrapMouse(!pause);
227 }
228
229 void SubjectiveCamera(double sensitivity, double speed, bool fly){
230 // Rotate the camera with the mouse.
231 cameraAngleX = fmin(fmax(cameraAngleX - fgcMouseMoveY * sensitivity, -1.570796), 1.570796);
232 cameraAngleY -= fgcMouseMoveX * sensitivity;
233 // Move the player with directional input.
234 vec2 move = VEC2(
235 (fgcRightKey() || fgcCharKey('d')) -
236 (fgcLeftKey() || fgcCharKey('a')),
237 (fgcDownKey() || fgcCharKey('s')) -
238 (fgcUpKey() || fgcCharKey('w')));
239 // Get the length of the Y plane of the translation vector.
240 double moveLength = vec2Length(move);
241 // Apply the lateral translation.
242 if(moveLength > 0.1){
243 // Get the Y angle of the move vector plus the Y angle of the camera.
244 move = vec2Normalize(move);
245 double moveAngle = atan2(move.x, move.y) + cameraAngleY;
246 cameraPosition.x += sin(moveAngle) * speed;
247 cameraPosition.z += cos(moveAngle) * speed;
248 }
249 // Apply the vertical translation.
250 if(fly)
251 cameraPosition.y += (fgcSpaceKey() - fgcControlKey()) * speed;
252 }
253
254 void Render(double d){
255 if(fgcEscapeKey() || fgcAltKey() || !fgcHasFocus) PauseGame(true);
256 if(paused) d = 0.0;
257 double width = fgcGetDisplayWidth();
258 double height = fgcGetDisplayHeight();
259 double aspect = width / height;
260
261 // Resize the gbuffer to the screen.
262 fgcResizeFramebuffer(&gbuffer, width, height, 0);
263 // Draw to the gbuffer.
264 fgcSetFramebuffer(&gbuffer, 1.0f);
265 // Clear the depth buffer.
266 glClear(GL_DEPTH_BUFFER_BIT);
267
268 if(!paused) SubjectiveCamera(0.003, 3.0 * d, false);
269
270 mat4 viewRot = mat4SetRotationQuaternion(fgcEulerToQuat(cameraAngleX, cameraAngleY, 0.0));
271 viewMat = mat4Translate(viewRot, cameraPosition);
272 projMat = mat4Perspective(acos(-1) * 0.4, aspect, 0.1, 100.0);
273
274 meshAngle = fgcWrapAngle(meshAngle - d);
275
276 // Update visualZone.
277 ZoneUpdate(viewMat.col[3].x, viewMat.col[3].y, viewMat.col[3].z, d * 2.0);
278 if(zoneA && zoneB){
279 visualZone.backFog = LerpColor(zoneA->backFog, zoneB->backFog, (float)zoneF);
280 visualZone.backSky = LerpColor(zoneA->backSky, zoneB->backSky, (float)zoneF);
281 visualZone.foreFog = LerpColor(zoneA->foreFog, zoneB->foreFog, (float)zoneF);
282 visualZone.foreSky = LerpColor(zoneA->foreSky, zoneB->foreSky, (float)zoneF);
283 }
284
285 fgcSetPipeline(skyLitPipeline);
286
287 // Set foreground parameters.
288 fgcSetFog(visualZone.foreFog);
289 glUniform4f(
290 glGetUniformLocation(skyLitPipeline.programObject, "u_sky"),
291 visualZone.foreSky.r, visualZone.foreSky.g, visualZone.foreSky.b, visualZone.foreSky.a
292 );
293
294 // Draw opaque.
295 glDisable(GL_BLEND);
296
297 fgcSetTexture(tex_wall, 0);
298 mat4 cubemat = mat4Translate(
299 mat4SetRotationQuaternion(fgcEulerToQuat(0.67, meshAngle, 0.67)),
300 VEC3(0.0, 0.9, 0.0));
301 fgcDrawMesh(&fgcCubeMesh, cubemat, viewMat, projMat);
302 fgcTexMatrix = mat4SetScaleXYZ(VEC3(16.0, 16.0, 16.0));
303 fgcDrawMesh(&fgcPlaneMesh, mat4Scale(mat4SetRotationX(-1.570796), 32.0), viewMat, projMat);
304 fgcTexMatrix = MAT4_IDEN;
305
306 // Draw the sky/background.
307 // Exterior sky colors should generally be used regardless of interior ambient lighting conditions.
308 DrawSky(viewRot, projMat, gradientSkyPipeline, visualZone.backFog, visualZone.backSky);
309
310 // End of lighting pass.
311 fgcSetPipeline(fgcUnlitPipeline);
312
313 // Draw the gbuffer to the screen.
314 fgcSetFramebuffer(NULL, 1.0f);
315 fgcDrawFramebuffer(&gbuffer, false, 1.0f);
316
317 // Draw transparent.
318 glEnable(GL_BLEND);
319 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
320
321 if(paused){
322 fgcSetTexture(tex_paused, 0);
323 fgcDrawMesh(&fgcPlaneMesh, mat4SetScaleXYZ(VEC3(height / width, 1.0, 1.0)), MAT4_IDEN, MAT4_IDEN);
324 if(fgcMouseButton(1)) PauseGame(false);
325 // Reduce power consumption by imposing a small delay.
326 SDL_Delay(50);
327 }
328 }
329
330 int main(){
331 #if defined(__GLIBC__) && defined(__GLIBC_MINOR__)
332 printf("Built with glibc %d.%d\n", __GLIBC__, __GLIBC_MINOR__);
333 #endif
334
335 FGCDisplayInfo disp = fgcCreateDisplay(1024, 576, "cfps", 0, false, true);
336 if(!disp.success) return 0;
337
338 skyLitPipeline =
339 fgcLoadPipeline(skyLitVert, skyLitFrag, skyLitSamplers);
340 if(skyLitPipeline.success){
341 if(fgcVerbose)
342 printf("Sky-lit pipeline loaded successfully.\n");
343 }else{
344 fprintf(stderr, "Failed to load sky-lit pipeline.\n");
345 }
346
347 gradientSkyPipeline =
348 fgcLoadPipeline(skyVert, gradientSkyFrag, gradientSkySamplers);
349 if(gradientSkyPipeline.success){
350 if(fgcVerbose)
351 printf("Gradient sky pipeline loaded successfully.\n");
352 }else{
353 fprintf(stderr, "Failed to load gradient sky pipeline.\n");
354 }
355
356 // Create the gbuffer.
357 gbuffer = fgcCreateFramebuffer(fgcGetDisplayWidth(), fgcGetDisplayHeight(), false, GL_RGB, 0);
358
359 tex_cyan = fgcLoadSolidColorTexture((FGCColor){0.0, 1.0, 1.0, 1.0});
360 tex_paused = fgcLoadTexture("base/paused.png", true, true);
361 tex_wall = fgcLoadTexture("base/wall.png", true, true);
362
363 // Create the lowest-priority zone with +/- 100km extents.
364 ZoneAdd((Zone){(FGCColor){0.0, 0.2, 0.35, 0.05},
365 (FGCColor){0.1, 0.1, 0.0, 1.0},
366 (FGCColor){0.0, 0.2, 0.35, 0.05},
367 (FGCColor){0.1, 0.1, 0.0, 1.0}, -1e5, 1e5, -1e5, 1e5, -1e5, 1e5,
368 0, NULL, NULL});
369
370 // Create an interior zone.
371 ZoneAdd((Zone){(FGCColor){0.0, 0.2, 0.35, 0.05},
372 (FGCColor){0.1, 0.1, 0.0, 1.0},
373 (FGCColor){0.0, 0.2, 0.35, 0.05},
374 (FGCColor){0.0, 0.0, 0.0, 1.0}, -2.0, 2.0, 0.0, 3.0, -2.0, 2.0,
375 1, NULL, NULL});
376
377 PauseGame(false);
378
379 fgcSetMainLoop(Render);
380
381 return 0;
382 }
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

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

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

Clone this repository using git:
git clone git://git.rocketgit.com/user/fluffrabbit/cfps

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