mirror of
https://github.com/gwm17/glfw.git
synced 2025-04-12 11:38:49 -04:00
Compare commits
2944 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
a3005b6cbe | ||
|
3fa2360720 | ||
|
0b94e1b29b | ||
|
f27daa34ad | ||
|
6f2d7064be | ||
|
9cce2896ee | ||
|
23ab972724 | ||
|
fbdb53b9ca | ||
|
cd466cf9fd | ||
|
39f0e86228 | ||
|
efa9297a41 | ||
|
91c837ace5 | ||
|
6d9083af03 | ||
|
4cf510511c | ||
|
c1a79c1c41 | ||
|
8397b39afa | ||
|
735fc101f5 | ||
|
228428fa4f | ||
|
82e77dbff4 | ||
|
9a87635686 | ||
|
2b580012da | ||
|
5c463a9070 | ||
|
9b1f63bad9 | ||
|
1c9fcdc9df | ||
|
30b91c8b60 | ||
|
e0ae1c45df | ||
|
8f470597d6 | ||
|
57cbded076 | ||
|
41d8da1cea | ||
|
00967cbb8a | ||
|
7fdb858a47 | ||
|
dd8a678a66 | ||
|
97b9e49637 | ||
|
b2b087cd8e | ||
|
d299d9f788 | ||
|
ed1d9e1ca7 | ||
|
ab3ea8ac9f | ||
|
c812b9d87c | ||
|
8a72918bcd | ||
|
ab1b1edfd0 | ||
|
93e93135f2 | ||
|
e057666642 | ||
|
6b57e08bb0 | ||
|
2c0f34b60f | ||
|
ef6c9d8b4f | ||
|
c18851f52e | ||
|
55aad3c37b | ||
|
0f9a9578f3 | ||
|
7d73629e50 | ||
|
2efc598d70 | ||
|
2e12ef00bb | ||
|
3a60992a41 | ||
|
3a5c726d1b | ||
|
7be6a2cabe | ||
|
488008e0a2 | ||
|
a46f829de8 | ||
|
03af6b3d4c | ||
|
09ebf3f0bf | ||
|
e85b645b8a | ||
|
b9ed25d2e9 | ||
|
26b85215c0 | ||
|
6987294df9 | ||
|
71be34a6c3 | ||
|
7cc8b053b8 | ||
|
91a96ed434 | ||
|
c424fe5589 | ||
|
c50d53160f | ||
|
40b5a8a37c | ||
|
9180923ea0 | ||
|
a1a73ee862 | ||
|
e47cb7c1e2 | ||
|
4df24735ef | ||
|
d77aaa770f | ||
|
aa80d24d01 | ||
|
fd7e737216 | ||
|
6dd526fb1a | ||
|
2796e61af7 | ||
|
88a39006e3 | ||
|
5c948a6e6e | ||
|
8e725338bf | ||
|
060631c965 | ||
|
36f0bf00a9 | ||
|
84e165ef64 | ||
|
2db528d8cd | ||
|
78b19548d9 | ||
|
dfb26023fc | ||
|
9b7713cf92 | ||
|
3b3d58df47 | ||
|
510a08cde2 | ||
|
0d599026d0 | ||
|
6f8ec4075b | ||
|
98d6e8485b | ||
|
da6713cd09 | ||
|
d578c2ddfe | ||
|
74b4ceb835 | ||
|
c4fbe80d90 | ||
|
be7f4513c0 | ||
|
47193f15de | ||
|
80dc0533cf | ||
|
29b7669bc6 | ||
|
f35e2274cb | ||
|
3203599cac | ||
|
2df0ce07fa | ||
|
83a134a92f | ||
|
eb9c3bee71 | ||
|
0cd1916de3 | ||
|
77819c0c54 | ||
|
e52046955d | ||
|
55fcfb1bb6 | ||
|
203002ef2c | ||
|
85f5a51912 | ||
|
9ad9f5c52a | ||
|
5002522f73 | ||
|
91f18fb576 | ||
|
e37ba80b13 | ||
|
c3ad3d49ed | ||
|
209f6cf093 | ||
|
33d37782c6 | ||
|
229d628ec4 | ||
|
c28d420060 | ||
|
18df0baea6 | ||
|
a7b6f35500 | ||
|
0f5b095042 | ||
|
24cdc5afda | ||
|
75295f4878 | ||
|
040712ce99 | ||
|
2877fea550 | ||
|
e33db6d7aa | ||
|
afb127769a | ||
|
ed39ff43f9 | ||
|
98c9961f32 | ||
|
3bbb41eacc | ||
|
0b76e3a6f1 | ||
|
6857995498 | ||
|
fdc72edf81 | ||
|
f39ffefb6a | ||
|
ddd087d662 | ||
|
523fdf50c1 | ||
|
facec25e0e | ||
|
d3ede7b684 | ||
|
a465c1c32e | ||
|
2ae3e0c8d7 | ||
|
ad3dbeb65f | ||
|
05f6c13d11 | ||
|
edec334b32 | ||
|
26920a1a38 | ||
|
736a88b067 | ||
|
2c204ab52e | ||
|
e9c58bc181 | ||
|
31670c954a | ||
|
ce28bbccea | ||
|
441c15250f | ||
|
62e175ef9f | ||
|
ce85c7dcaf | ||
|
5c3ebfb9cc | ||
|
7dfd84c458 | ||
|
685de9089f | ||
|
09653b8c54 | ||
|
72642ea0d1 | ||
|
8f050b5655 | ||
|
acf0c10e7a | ||
|
80e31ce9e1 | ||
|
d3c2121221 | ||
|
23e6e8e4b7 | ||
|
f60547ac80 | ||
|
06089a91a6 | ||
|
82ccbb3ef0 | ||
|
a8d8b760fb | ||
|
2d281d7928 | ||
|
89514cf0fc | ||
|
10e9033a29 | ||
|
29523dbfbf | ||
|
f843d53333 | ||
|
4cb36872a5 | ||
|
0f38382e25 | ||
|
f010335b8c | ||
|
b7a3af9b79 | ||
|
967282c2e6 | ||
|
8d216054ad | ||
|
34418951cc | ||
|
ad4a9e42f0 | ||
|
e0889736fd | ||
|
c132135332 | ||
|
4651165272 | ||
|
8d87be1268 | ||
|
89d3ea8d69 | ||
|
990dc4b388 | ||
|
a4460b694e | ||
|
4506175023 | ||
|
ba11e60859 | ||
|
2d45681bc3 | ||
|
4c110bba41 | ||
|
738b1c73b5 | ||
|
b386371f57 | ||
|
9c95cfb9f1 | ||
|
920d110b6c | ||
|
554cbdb205 | ||
|
955fbd9d26 | ||
|
07a5518c3e | ||
|
66a4882eb1 | ||
|
8d9231fe5e | ||
|
03cfe957e7 | ||
|
add0521efb | ||
|
535c3ce632 | ||
|
3ee5031fd7 | ||
|
9cc252a406 | ||
|
46950a5e61 | ||
|
1461c59aa2 | ||
|
b54fb0af10 | ||
|
8f9ff8503e | ||
|
aa803f7de5 | ||
|
34573798f4 | ||
|
8ff9ed92b4 | ||
|
723f3eb40d | ||
|
1eef3a363e | ||
|
367d06deaf | ||
|
a730acf8e5 | ||
|
adc202d2c3 | ||
|
d78b0a4ead | ||
|
1e0c3bca7f | ||
|
71742d9a27 | ||
|
a32cbf6d4f | ||
|
7ce1f3e1cf | ||
|
bb9d699ae6 | ||
|
203a7c59d2 | ||
|
3c2913dcb9 | ||
|
84b0923fe6 | ||
|
cd22e28495 | ||
|
363d471441 | ||
|
87970b7f26 | ||
|
1e987cb92e | ||
|
92b5c67b50 | ||
|
d3e4fcf8b7 | ||
|
ad01c1b614 | ||
|
789d2924c0 | ||
|
2e656afc49 | ||
|
20adc18aa5 | ||
|
152f50cd01 | ||
|
4a68926bfd | ||
|
a28adba06a | ||
|
97da62a027 | ||
|
e023618daa | ||
|
7f6aa587f8 | ||
|
df8d7bc892 | ||
|
0ce611958e | ||
|
1a7da42e6e | ||
|
bf99587005 | ||
|
293d19a153 | ||
|
b70259e52d | ||
|
fe7be39793 | ||
|
17a9e34fbc | ||
|
cb22c54119 | ||
|
37b7540db9 | ||
|
715b874db3 | ||
|
8aaea57421 | ||
|
25c521cbe5 | ||
|
c05acf6246 | ||
|
12c2ccd609 | ||
|
216ea3d735 | ||
|
c1ecd4673e | ||
|
7bede13b1d | ||
|
a3d1633e1d | ||
|
3f5dfeaf29 | ||
|
850893a39f | ||
|
79e7e65c9d | ||
|
855d338a65 | ||
|
8edbc4971d | ||
|
05b0e2fab2 | ||
|
31b0208bba | ||
|
68fa5b50c4 | ||
|
7d060ba4f1 | ||
|
f8ef3ca719 | ||
|
094aa6d3c7 | ||
|
e24fe4b189 | ||
|
c2f0a0ae59 | ||
|
6281f498c8 | ||
|
68879081cb | ||
|
963e728881 | ||
|
900848ad0c | ||
|
cd01187b9d | ||
|
c19f36b28d | ||
|
53d86c64d7 | ||
|
fbfd7e65c8 | ||
|
d1efa32983 | ||
|
79de08db06 | ||
|
e40fa3bb94 | ||
|
9cd4d2fa20 | ||
|
37fc28bff6 | ||
|
706d1f1653 | ||
|
b3a98f8555 | ||
|
eacc1cafba | ||
|
a30cd6acef | ||
|
bb193325cc | ||
|
b55a517ae0 | ||
|
544790666b | ||
|
fb0f2f92a3 | ||
|
83d3fb08ec | ||
|
999962bd2f | ||
|
f75c251dec | ||
|
575d2971d4 | ||
|
2a78a2cf82 | ||
|
76a5f781db | ||
|
393eac458b | ||
|
db91507956 | ||
|
ee6ff939a5 | ||
|
68534cc2ce | ||
|
4005f70eef | ||
|
53d7622a3a | ||
|
41ebcf1eed | ||
|
0fe96ec202 | ||
|
3d52f7e345 | ||
|
f4d0365a5a | ||
|
309d79376f | ||
|
6efaaec9ce | ||
|
38dd515524 | ||
|
727db55c3a | ||
|
56a4cb0a3a | ||
|
ff9d9515f6 | ||
|
36ea36736d | ||
|
09f9773e6f | ||
|
bdfe6b09af | ||
|
b6834bf2a1 | ||
|
35f3b58c21 | ||
|
f5758d75d0 | ||
|
b7d0c6037d | ||
|
e31deedc99 | ||
|
6d51b39106 | ||
|
d0776e04a3 | ||
|
8b8d10bc01 | ||
|
0a9488e3f0 | ||
|
efe764b492 | ||
|
983c44b255 | ||
|
cca9008db2 | ||
|
0391b7b277 | ||
|
1d8d1ff3d0 | ||
|
4be0444ee6 | ||
|
6a20053102 | ||
|
7614d088e9 | ||
|
6ed5294223 | ||
|
157ebb80aa | ||
|
e7758c506d | ||
|
4cbe743b74 | ||
|
216d5e8402 | ||
|
11ce43798b | ||
|
d78bf8a1a3 | ||
|
63da04e5ce | ||
|
8e23579842 | ||
|
150744ecca | ||
|
8c8def5de5 | ||
|
4f077c4133 | ||
|
7c25dff002 | ||
|
daed5edd6e | ||
|
d7b7c3b12a | ||
|
62074f3dea | ||
|
518e26e16e | ||
|
22b586b3d8 | ||
|
4e557437f2 | ||
|
2ac7e20aaf | ||
|
85348c67cd | ||
|
071d7c0f46 | ||
|
71829a0f0d | ||
|
244948e174 | ||
|
d83849792b | ||
|
dffe203c17 | ||
|
256d8243b4 | ||
|
c0f7fed0b8 | ||
|
baf21e6e67 | ||
|
87d5646f5d | ||
|
9a0e88a016 | ||
|
aff00d0dd8 | ||
|
111c02d74e | ||
|
58b48a3a00 | ||
|
201400b974 | ||
|
afa78b4270 | ||
|
0c90e1a33f | ||
|
01778329ec | ||
|
56092814f3 | ||
|
3dc7349c35 | ||
|
9e1ee3f263 | ||
|
ab34cc51c6 | ||
|
1d88a2e3d6 | ||
|
076bfd55be | ||
|
836e709503 | ||
|
3b95970482 | ||
|
b6f7ead3c5 | ||
|
1a5e07fd4b | ||
|
f010d8b77d | ||
|
6876cf8d7e | ||
|
52d8347d34 | ||
|
a89fcd20d8 | ||
|
5b73fc8b80 | ||
|
6f7c61c6b3 | ||
|
15e05adf67 | ||
|
787295b3af | ||
|
78380c7761 | ||
|
3b13228650 | ||
|
4e788fc6dc | ||
|
5a6001a83b | ||
|
df15a33e10 | ||
|
114776a246 | ||
|
fd79b02840 | ||
|
184377b493 | ||
|
04f21abb52 | ||
|
da236ba807 | ||
|
a39115a27b | ||
|
bbbbd3e870 | ||
|
e17ffcd0db | ||
|
9a3a8bc267 | ||
|
a646f51bca | ||
|
0e9ec7788b | ||
|
e3f916808d | ||
|
061a0263a9 | ||
|
85bce8a8ea | ||
|
ec621a00bd | ||
|
330f7da746 | ||
|
0beadfdc66 | ||
|
4c90e21e8f | ||
|
f90df24244 | ||
|
a25e8eb50d | ||
|
84f95a7d7f | ||
|
f4a7329604 | ||
|
9416a43404 | ||
|
33cd8b865d | ||
|
291f6dc32c | ||
|
52ba8c7f07 | ||
|
17ae300d96 | ||
|
9c62a21ba9 | ||
|
1f34295a74 | ||
|
4afa227a05 | ||
|
2c7f3ce91b | ||
|
b925a54ef1 | ||
|
729c9988d0 | ||
|
410890aa80 | ||
|
6de084000b | ||
|
9477311130 | ||
|
384ff74a46 | ||
|
f8d6801a50 | ||
|
3959ee8949 | ||
|
8ab40399d3 | ||
|
2bc52ca82e | ||
|
5aff72aa00 | ||
|
8b11867464 | ||
|
552209fe46 | ||
|
f5af421a6b | ||
|
5d1d1a01e3 | ||
|
3a8ebb1903 | ||
|
6ce6b50787 | ||
|
761f97d6b6 | ||
|
0b9e48fa3d | ||
|
1adfbde4d7 | ||
|
08e5a17063 | ||
|
7e8da57094 | ||
|
0dc1005c85 | ||
|
3327050ca6 | ||
|
5c928ff452 | ||
|
2f76f70c76 | ||
|
420b165bff | ||
|
a62a6c5019 | ||
|
d5f32dfb3b | ||
|
a6f8cc9d44 | ||
|
af8f9713dd | ||
|
0bccc3852b | ||
|
ac627706ef | ||
|
6b78419c9a | ||
|
9b140d08d7 | ||
|
35f3508ecd | ||
|
c940695eb0 | ||
|
0ef149c8f2 | ||
|
a506a8dc73 | ||
|
8d47dc5894 | ||
|
48aa567d0c | ||
|
53b1396a09 | ||
|
60e7364b30 | ||
|
166611cef5 | ||
|
0b2660f39f | ||
|
40d150c399 | ||
|
8aaf072842 | ||
|
2e6fb7fe22 | ||
|
2747e47393 | ||
|
1353f37a51 | ||
|
539535a367 | ||
|
73ef5f0abb | ||
|
58df92acad | ||
|
96f9f5c4b9 | ||
|
1ed1489831 | ||
|
bb1d917c2f | ||
|
59196f9ad8 | ||
|
9d7897f961 | ||
|
b3a79103a6 | ||
|
b9dfce0070 | ||
|
7765451d0f | ||
|
cd0dc76c7c | ||
|
da26eefc61 | ||
|
b488c3f87f | ||
|
05dd2fa298 | ||
|
a2674a9034 | ||
|
0cc13ceafc | ||
|
c01acc267a | ||
|
e0f7ce402b | ||
|
f771d41292 | ||
|
782e6b6cef | ||
|
f760b124ca | ||
|
5f60c22cfa | ||
|
5c92cd9f52 | ||
|
686e18fd72 | ||
|
3207fc7120 | ||
|
74b9f309a9 | ||
|
a122d91303 | ||
|
dfeacee000 | ||
|
1095a43708 | ||
|
6d2003d07a | ||
|
7da3e52c86 | ||
|
68e4261d73 | ||
|
e81d381256 | ||
|
d285a9fdeb | ||
|
6c031af245 | ||
|
49dbcfcb8c | ||
|
ceb20c7f97 | ||
|
4ae93e0547 | ||
|
9a3664b4a9 | ||
|
6ce2070392 | ||
|
e47832ffcf | ||
|
ad9eb768c9 | ||
|
854ce1db4e | ||
|
f5f060e6bf | ||
|
0dea8a4441 | ||
|
e6a6a99813 | ||
|
1cecb8beb0 | ||
|
36f8250321 | ||
|
b420ca7404 | ||
|
4e3b43383a | ||
|
8a69a0d7e5 | ||
|
2539d03747 | ||
|
bcb8558189 | ||
|
aec9fae8f3 | ||
|
d7f7b0e1b5 | ||
|
b66f105f3e | ||
|
bf1c62b261 | ||
|
3a3c32c6b1 | ||
|
81f475bccb | ||
|
c1f60ab5dc | ||
|
e47705d8fb | ||
|
8369880b56 | ||
|
cfc23cd087 | ||
|
69ff0b8ee0 | ||
|
e0c77f71f9 | ||
|
c72da994ba | ||
|
399c2a1fad | ||
|
9a87c2a4b4 | ||
|
fbf8aae44f | ||
|
7486e12f88 | ||
|
105cf32e0b | ||
|
a84a30ab63 | ||
|
250b94cd03 | ||
|
d4f5074535 | ||
|
91eebe922d | ||
|
51a465ee2b | ||
|
5f9dfe3d83 | ||
|
27295b508f | ||
|
ef5220d6b1 | ||
|
a17a1b2011 | ||
|
e07925c404 | ||
|
cf3a03a85d | ||
|
0c403c8ca6 | ||
|
844bc8031c | ||
|
67c720d117 | ||
|
d7ae90a790 | ||
|
41a19ed49c | ||
|
949275bbed | ||
|
cab41529da | ||
|
318e08d914 | ||
|
560304e0f4 | ||
|
9ecacf1d7f | ||
|
ee45b58647 | ||
|
215a05af3d | ||
|
a41a58a95e | ||
|
e65de2941c | ||
|
2c8e0512dd | ||
|
44b5d06583 | ||
|
350ba73267 | ||
|
9516df52a4 | ||
|
72366ac9a9 | ||
|
6aca3e99f0 | ||
|
4381b86b6b | ||
|
27d19d06ca | ||
|
4b8ac11aa3 | ||
|
a0a5cc57df | ||
|
0c27ed1d0e | ||
|
d1ae7bac60 | ||
|
40c7e471e3 | ||
|
76406c7894 | ||
|
d973acc123 | ||
|
46c7c1cdff | ||
|
13479ed27d | ||
|
a5e5b782c7 | ||
|
65cfe743af | ||
|
d862d56acb | ||
|
190673e779 | ||
|
789a2bcb39 | ||
|
5f1631cb0e | ||
|
a491b0698c | ||
|
562c17d131 | ||
|
7da87aaae7 | ||
|
15d91801b7 | ||
|
c5cb4a253a | ||
|
9372ba95fa | ||
|
aa5e313561 | ||
|
fe57e3c292 | ||
|
6b01affd89 | ||
|
bf292f0083 | ||
|
781fbbadb0 | ||
|
5dd207048c | ||
|
a3d28ef52c | ||
|
8149a5fc00 | ||
|
74a46dfa0c | ||
|
4ec7daf3e9 | ||
|
c3ca88055f | ||
|
54e8e0b092 | ||
|
b4a8eb9b19 | ||
|
28773a069e | ||
|
73a8ebb691 | ||
|
4e70c95aa3 | ||
|
9db156421f | ||
|
0b652a44d2 | ||
|
9b6d68ec70 | ||
|
4837b78ffe | ||
|
bc3be40f21 | ||
|
da3f20d860 | ||
|
fb0028c766 | ||
|
994c3b4e48 | ||
|
18307467b4 | ||
|
49c5d837b4 | ||
|
8a5fd0c5a4 | ||
|
a5ed740d9d | ||
|
a264d32987 | ||
|
081484ed34 | ||
|
506a6aafde | ||
|
a875a536b7 | ||
|
2551829f75 | ||
|
7e03bce138 | ||
|
ac30ef3e0c | ||
|
a43f545677 | ||
|
59055d585f | ||
|
8a1f4940fc | ||
|
5f4a6f689a | ||
|
c016b26852 | ||
|
db76abb63c | ||
|
c194193797 | ||
|
9dc365f192 | ||
|
c81def70be | ||
|
197193ac0b | ||
|
135d87aa3c | ||
|
2fb336268f | ||
|
9486ec0c02 | ||
|
dff6253ca7 | ||
|
bc7b19cbd1 | ||
|
ce9d124243 | ||
|
f6d44cedfd | ||
|
d74c18117d | ||
|
92c70b2a83 | ||
|
7dd14a4b20 | ||
|
fa60269245 | ||
|
6e6805000a | ||
|
b3544ca43e | ||
|
382943f2b0 | ||
|
ef6189f348 | ||
|
7dbdd2e6a5 | ||
|
80fde12fda | ||
|
a80788c17f | ||
|
a9f674e719 | ||
|
b5d4f24f74 | ||
|
d861d7bffe | ||
|
c42d8f3e5b | ||
|
50a6270e55 | ||
|
b804379463 | ||
|
359758bb53 | ||
|
e96dc5d219 | ||
|
2c519709be | ||
|
bd452016be | ||
|
bac15f9449 | ||
|
c819f27ce3 | ||
|
94cb0347ab | ||
|
953a1c3f8b | ||
|
70a3104c49 | ||
|
bc5523e994 | ||
|
8e288dc94c | ||
|
de23429455 | ||
|
08f01c31a0 | ||
|
20e522cdf4 | ||
|
c5f1ca3e41 | ||
|
b69fb99031 | ||
|
c88ee1c9d3 | ||
|
28d8507700 | ||
|
75294462b3 | ||
|
5fc4c01302 | ||
|
33683ec60e | ||
|
04f7f55f07 | ||
|
4d0ae4ffa7 | ||
|
82978bb3af | ||
|
376897a344 | ||
|
36c547875c | ||
|
692754a2c5 | ||
|
3a37a08998 | ||
|
7749aac50d | ||
|
1e20218b3d | ||
|
545f409592 | ||
|
8f852e0833 | ||
|
f71b55f83d | ||
|
d25248343e | ||
|
1bd0a55aa7 | ||
|
3d2540c373 | ||
|
3ec8f4a7f5 | ||
|
243b1bc292 | ||
|
7105ff2dfd | ||
|
7f02898264 | ||
|
aa8e8ab960 | ||
|
26aac53e1d | ||
|
2777f6a754 | ||
|
cbf23e5615 | ||
|
56ca0cb3b3 | ||
|
4cc5d2e623 | ||
|
f764836e58 | ||
|
2c7ef5b480 | ||
|
711b9694a1 | ||
|
efda4afb49 | ||
|
65748fb8f3 | ||
|
6abad2efd2 | ||
|
eecf83c5d0 | ||
|
2e039d9275 | ||
|
b430bc4935 | ||
|
062a1c22b5 | ||
|
a4d910b4a7 | ||
|
4f0b8b0dda | ||
|
7bd0af3089 | ||
|
84b13113ed | ||
|
62b7fe8311 | ||
|
773f4495f0 | ||
|
5bea122211 | ||
|
d232bcfcdd | ||
|
36f90800d8 | ||
|
c6b95e3b07 | ||
|
e463e85bba | ||
|
3a5e99e59a | ||
|
3262c29440 | ||
|
1d62157268 | ||
|
1f508530f0 | ||
|
fad9896d38 | ||
|
0c6b505619 | ||
|
2db3b9688d | ||
|
d834f01ca4 | ||
|
537ea4ccf1 | ||
|
51bb76c7c3 | ||
|
71e6ff386d | ||
|
98dde03ce1 | ||
|
e1d9e2ba73 | ||
|
84ec99bb01 | ||
|
d0c3fa900a | ||
|
267e06a41e | ||
|
bb6945a18a | ||
|
22a6c02a4c | ||
|
3fd4e79adb | ||
|
56aad76b16 | ||
|
feaa532886 | ||
|
e91d0fc499 | ||
|
3cf7645b96 | ||
|
e4aba7feaa | ||
|
a639d6e635 | ||
|
d44bfe0264 | ||
|
f61d0916fd | ||
|
c415c71947 | ||
|
144c98bcb3 | ||
|
fa025d8f80 | ||
|
700d1f28d8 | ||
|
0b01d850ed | ||
|
57bf6b2f75 | ||
|
ceb16cb5f1 | ||
|
0ccb690853 | ||
|
535491c4f3 | ||
|
7dc36dd7da | ||
|
c0eabc594f | ||
|
8ee589e43b | ||
|
cd290f767f | ||
|
a255e7ace6 | ||
|
5c5963f1c0 | ||
|
090b16bfae | ||
|
42a3e4434f | ||
|
15af302f77 | ||
|
be71147ad5 | ||
|
ff7d42a55e | ||
|
599fb3de34 | ||
|
a337c56848 | ||
|
b079610962 | ||
|
186e9372d5 | ||
|
ab118b2529 | ||
|
1f91697cd3 | ||
|
334a485968 | ||
|
0e74265426 | ||
|
3c3981a4f0 | ||
|
d0b7f539e2 | ||
|
62d296992e | ||
|
5f4e66b21a | ||
|
f03614277d | ||
|
45a62adf82 | ||
|
718609275d | ||
|
28f118f4de | ||
|
224e9205e0 | ||
|
bd23be2594 | ||
|
93962ec168 | ||
|
f4f1002d14 | ||
|
d7e30b1c74 | ||
|
3461d1c2a5 | ||
|
0fa77ea63a | ||
|
c585bf010b | ||
|
0267cebe00 | ||
|
f8a70aca67 | ||
|
422bf79e8f | ||
|
5644b66bac | ||
|
6e382c9b7f | ||
|
87458617e0 | ||
|
297999c9e1 | ||
|
b702577cd2 | ||
|
1857fc2272 | ||
|
a507872051 | ||
|
c0a3a9aefe | ||
|
5292914ce1 | ||
|
8d4fd40b64 | ||
|
02874d9c14 | ||
|
0d355379e0 | ||
|
c32dc3a085 | ||
|
cad22cb2f6 | ||
|
1fca33b3c1 | ||
|
9420e6f0d0 | ||
|
980fc9b52f | ||
|
e108c0de0d | ||
|
9e54b97cfa | ||
|
056c5d3f90 | ||
|
a4fbc6fe91 | ||
|
8055dad7e4 | ||
|
8d7e5cdb49 | ||
|
f8bcc7e65c | ||
|
ba761ab06e | ||
|
d0e8d06d95 | ||
|
3615d437a7 | ||
|
82ca58da04 | ||
|
4e3204d86d | ||
|
9883cb64f0 | ||
|
4b20fb705b | ||
|
a43d1a4937 | ||
|
3a2a97f15d | ||
|
4f14c1e776 | ||
|
d82e7b5cb1 | ||
|
0118743333 | ||
|
a726942bfe | ||
|
68fd4e8bb3 | ||
|
ba4e78e57f | ||
|
222ac78a44 | ||
|
bea4818030 | ||
|
f1d40fa046 | ||
|
6907629cbf | ||
|
e6d22346f9 | ||
|
154db76a6c | ||
|
3fd70cc513 | ||
|
f7733c7b4f | ||
|
5c752355cb | ||
|
c733ab0a22 | ||
|
be295ccbea | ||
|
c20754c4a6 | ||
|
621ece63c8 | ||
|
2fbb560eb7 | ||
|
7c3aaf8065 | ||
|
44af6bb936 | ||
|
1155c83013 | ||
|
9e29f556fd | ||
|
5f9cbd0ebc | ||
|
ec3784f3d7 | ||
|
782f7fe0c7 | ||
|
bcd8f9aff2 | ||
|
45bd991ea9 | ||
|
edf0a07174 | ||
|
36ce73bbfd | ||
|
1d95acdf56 | ||
|
2e70950c0f | ||
|
2a27eb95e4 | ||
|
e2fa82ffbb | ||
|
cf79f06257 | ||
|
90e22947c6 | ||
|
463ef7eb71 | ||
|
51ca41dd9f | ||
|
530b37f4db | ||
|
78e6a0063d | ||
|
7f4dde15e4 | ||
|
b41cd34143 | ||
|
d5ab3e919a | ||
|
a46104ee69 | ||
|
757cd3aea2 | ||
|
29d8ca4ce4 | ||
|
3d748cf530 | ||
|
babafc13db | ||
|
9b0c16596c | ||
|
2053f3ed22 | ||
|
55b1a16f90 | ||
|
ea7eb2ddab | ||
|
9a9568212c | ||
|
72c3908e14 | ||
|
cde0aaaab1 | ||
|
c90c7b9710 | ||
|
1635fe2826 | ||
|
9ac9d7b85a | ||
|
e29882523e | ||
|
3531c320af | ||
|
52c7a4fc7f | ||
|
3201eedc34 | ||
|
a533c9b3ca | ||
|
064dfaa549 | ||
|
751c6f9a27 | ||
|
8c611fd5d0 | ||
|
8e313d911b | ||
|
3b255af4c3 | ||
|
a59315ed6a | ||
|
f4a304ff03 | ||
|
86e7bf4169 | ||
|
91c1ff1b7d | ||
|
c4903d9267 | ||
|
cf0857f79a | ||
|
cc621765e5 | ||
|
17a15a20f2 | ||
|
c3ed70a4b7 | ||
|
88c5edb409 | ||
|
f9923e9095 | ||
|
df7f36a316 | ||
|
bb2ca1da13 | ||
|
f680001b95 | ||
|
18145a7f3d | ||
|
9bfdd218fb | ||
|
a9892acb94 | ||
|
041167895d | ||
|
fb01b16b94 | ||
|
bc5a24fee6 | ||
|
1fe340982f | ||
|
53c8c72c67 | ||
|
9bb50db6dd | ||
|
cc3552465d | ||
|
62993d9391 | ||
|
da8f3bc174 | ||
|
85fd5aa6c4 | ||
|
769f727e47 | ||
|
d9466050d9 | ||
|
5595fa3ae6 | ||
|
6dfc12a439 | ||
|
245461eb86 | ||
|
031a8f9583 | ||
|
6a199c1f5e | ||
|
64c034edfb | ||
|
c08abffc50 | ||
|
8b54e28c4e | ||
|
3c4b9a7eef | ||
|
92b3fd02e5 | ||
|
2de2589f91 | ||
|
0b3677c2b1 | ||
|
868f1e7bfc | ||
|
e779280802 | ||
|
1725d1c4f5 | ||
|
6bd264244a | ||
|
fac7d531ec | ||
|
5afcd0981b | ||
|
cc805c0963 | ||
|
e75af5f531 | ||
|
dcd2a19d90 | ||
|
3e884aea46 | ||
|
ab16fcc8db | ||
|
754b7feaa1 | ||
|
4d3f0fb5df | ||
|
15cad02235 | ||
|
e0b83bbe8d | ||
|
321062833a | ||
|
5ea6e6cda2 | ||
|
dede6d6886 | ||
|
685f2a5f91 | ||
|
eeac43c3f7 | ||
|
089ea9af22 | ||
|
5294439595 | ||
|
b3efdcb38a | ||
|
3238f2291f | ||
|
ed12a54afd | ||
|
338afe3c6d | ||
|
b1b21292b9 | ||
|
a67d8afbd4 | ||
|
d4cbe451fc | ||
|
096ace5a68 | ||
|
8d3595fb4d | ||
|
018ab7229b | ||
|
f4764f7288 | ||
|
ccef385f02 | ||
|
e1495c013d | ||
|
f82a8f09eb | ||
|
0be4f3f75a | ||
|
bf6551a3ca | ||
|
617a322bd8 | ||
|
fdfb5ab466 | ||
|
a9a5a0b016 | ||
|
8d1a64c831 | ||
|
15d89bdff6 | ||
|
2167bee551 | ||
|
7ef34eb06d | ||
|
c443b02472 | ||
|
fcc244ea6d | ||
|
8b9221d845 | ||
|
50eccd298a | ||
|
819a2205e5 | ||
|
5d8b04a7ac | ||
|
d222a40046 | ||
|
23dfeee4cb | ||
|
474fa73e6c | ||
|
0a3c4f5d80 | ||
|
2884915000 | ||
|
5f8108e8a9 | ||
|
b4c99aacd4 | ||
|
30f5f97370 | ||
|
34d20b0f03 | ||
|
94ffc12b38 | ||
|
ab3bfb4205 | ||
|
8d98a6e37d | ||
|
b88be7c1e9 | ||
|
77879736af | ||
|
0d4534733b | ||
|
2926ce4838 | ||
|
a8e551cffa | ||
|
a0dbffb8f2 | ||
|
dfc7eacd50 | ||
|
0c4ca85149 | ||
|
c9d691e65e | ||
|
60e82ba472 | ||
|
f51c219b1c | ||
|
31cea7fa24 | ||
|
58b21d336c | ||
|
5e5bc14468 | ||
|
8ed91e8a77 | ||
|
4e31dc5e6e | ||
|
1f8ec20b55 | ||
|
4a42364a19 | ||
|
9f7ec6b094 | ||
|
9dc18a62a6 | ||
|
5b65b9b860 | ||
|
552e40a4be | ||
|
79e16baca3 | ||
|
9a7656364e | ||
|
2de3605b4c | ||
|
d6b9d00ceb | ||
|
f67b610dd4 | ||
|
608f055c72 | ||
|
84d10b32c3 | ||
|
8bc0c5c2c0 | ||
|
97bf16e5b6 | ||
|
90f5edc0b8 | ||
|
c14a35e21e | ||
|
f4cd470bcb | ||
|
3c9011030f | ||
|
2040309d0c | ||
|
58cc4b2c5c | ||
|
b020467192 | ||
|
d10463ac91 | ||
|
cfb5cb8805 | ||
|
1d75b205cb | ||
|
f940a97500 | ||
|
ff6a8891d4 | ||
|
c29e4455bb | ||
|
9bfa499d94 | ||
|
53b193a161 | ||
|
e98102162f | ||
|
f5d3954568 | ||
|
ae53cd29ef | ||
|
a678665c49 | ||
|
8a8eefa0d8 | ||
|
525ad7bfb8 | ||
|
eb7c9994bf | ||
|
94c7aa0d67 | ||
|
f2617a671f | ||
|
4778d02c67 | ||
|
f710db6504 | ||
|
0e759c9422 | ||
|
a162004a90 | ||
|
ae44a28125 | ||
|
14856e8b60 | ||
|
73567ae5be | ||
|
0d5f7a9eab | ||
|
a199efae44 | ||
|
14ad79f035 | ||
|
f9b0dc9827 | ||
|
440e7e36f3 | ||
|
407a3e2860 | ||
|
5fbf4ddde8 | ||
|
6e69f63ffa | ||
|
eb732457ea | ||
|
973bf29622 | ||
|
bb3ab87a18 | ||
|
d6b3a60fbc | ||
|
6c421f131d | ||
|
93186e4999 | ||
|
2c1fc13ee4 | ||
|
20b12204af | ||
|
ee9dffcd66 | ||
|
370eac3c48 | ||
|
1034b6e0db | ||
|
ac94014ef8 | ||
|
9f91bd6ea9 | ||
|
84077401e9 | ||
|
10c18f8124 | ||
|
09e0714284 | ||
|
7c2c7858c6 | ||
|
9da2285b14 | ||
|
6158801aeb | ||
|
3d493b60f1 | ||
|
18ee28bf82 | ||
|
5f8431d7ca | ||
|
0ee9a03b1e | ||
|
c3cba58a71 | ||
|
ce4672d74b | ||
|
8dab9f6ab1 | ||
|
682f1cf203 | ||
|
0e8c4ea7ce | ||
|
fd72eb917e | ||
|
d81946a35b | ||
|
638c4b604e | ||
|
b8df6ae3c1 | ||
|
df434c839a | ||
|
c2858e9ed7 | ||
|
7c87948eaf | ||
|
30489c5aa1 | ||
|
390a66d2e7 | ||
|
9e6c0c747b | ||
|
8094a1c99e | ||
|
bfe2d42af4 | ||
|
1a250234ea | ||
|
3169179de1 | ||
|
fe9c7a01c5 | ||
|
65166858ff | ||
|
b5e24676a4 | ||
|
40ab709aac | ||
|
d18431338a | ||
|
cc87d5ab10 | ||
|
25cf67667f | ||
|
bb13275b72 | ||
|
9c513346ad | ||
|
68809869f9 | ||
|
1fe319d234 | ||
|
d630684654 | ||
|
8b81a03a5a | ||
|
9903f88947 | ||
|
d73ab0bd58 | ||
|
11e47f08b1 | ||
|
aef4edadd0 | ||
|
bf7cc2ffac | ||
|
adebcc7111 | ||
|
fb4f633243 | ||
|
49130ab8ec | ||
|
baed2dad56 | ||
|
98990217bc | ||
|
71018b4ab5 | ||
|
79e2433eb0 | ||
|
546c99a3a3 | ||
|
7b877c4e24 | ||
|
31cbb20ba2 | ||
|
f2756d0b3f | ||
|
9718675d86 | ||
|
80d181f12d | ||
|
a7a70cf34d | ||
|
2867ca1e5b | ||
|
a1154247fa | ||
|
fcedb0be32 | ||
|
bf09dba95b | ||
|
16bf872117 | ||
|
1be81a1540 | ||
|
81963967e5 | ||
|
66c0394ae1 | ||
|
f308228a19 | ||
|
56ecd62f58 | ||
|
94ee10e655 | ||
|
07cc6e00da | ||
|
6d463d36fa | ||
|
95e282d5a0 | ||
|
5aeb37d1b8 | ||
|
da68ec56c3 | ||
|
5d0d30db38 | ||
|
32e78aeb2e | ||
|
93e66661d3 | ||
|
ac009a5f5c | ||
|
51f0cd3b51 | ||
|
019609b6cd | ||
|
eed94448fd | ||
|
25b7eba4a0 | ||
|
176ab9a5d2 | ||
|
f4fb25b63d | ||
|
e3be6b8ae0 | ||
|
3d110d2e1b | ||
|
0b5023bc62 | ||
|
9dbc935afb | ||
|
f7dc6df02c | ||
|
f30acd8f74 | ||
|
16ae02ab85 | ||
|
4637c31d82 | ||
|
7f0d5e0a03 | ||
|
f8668c5a9f | ||
|
1955c37c48 | ||
|
d099181307 | ||
|
b97039f3f5 | ||
|
a368d89c94 | ||
|
d80d4be030 | ||
|
d8551b73f6 | ||
|
45ca8b8d19 | ||
|
58a247b26d | ||
|
2f8b71d7a1 | ||
|
ce5e649d3b | ||
|
80e4922b5e | ||
|
c23fca6343 | ||
|
0882fffc37 | ||
|
ad9458a14c | ||
|
0d6937b33b | ||
|
af866e05d2 | ||
|
b4ea2d32e6 | ||
|
0c70eb8d5c | ||
|
08737bdc02 | ||
|
0d9e71fe81 | ||
|
ac01da6953 | ||
|
99e72830ea | ||
|
3f852c321f | ||
|
15d102b75e | ||
|
0019f7a45e | ||
|
2d0ffd788b | ||
|
e27dc50689 | ||
|
b7a0f225ea | ||
|
29a75ab09d | ||
|
3ee7f8f695 | ||
|
e376404d38 | ||
|
079518617c | ||
|
549308051d | ||
|
5bc1c38159 | ||
|
f95c9d1bf3 | ||
|
75e44abf09 | ||
|
a397195d3f | ||
|
ab2247f8f3 | ||
|
5b7281bd41 | ||
|
85eda77d35 | ||
|
213dd2d0d6 | ||
|
00d2efb9ab | ||
|
4feede6dd5 | ||
|
c0bc10427c | ||
|
2d8d8f5917 | ||
|
472e5fc4a9 | ||
|
e55e616f1f | ||
|
50a228394f | ||
|
afbd589348 | ||
|
82284b86eb | ||
|
d3247a8c83 | ||
|
67c9155f3b | ||
|
8e899ccc29 | ||
|
d55c57b504 | ||
|
ea6c50d9e2 | ||
|
6634c47e57 | ||
|
2fa90ae19f | ||
|
2e9aff759e | ||
|
617c42b20a | ||
|
953106e74d | ||
|
07bf2b166b | ||
|
8c0512027f | ||
|
be51c201dd | ||
|
57f872054c | ||
|
9bb5e880ae | ||
|
9610d68f19 | ||
|
539a728063 | ||
|
58c05ba8ee | ||
|
d5de48ab53 | ||
|
99762ad7f0 | ||
|
6da26c8d6c | ||
|
d2952e4e92 | ||
|
206f9ca4bc | ||
|
d1a2ec4d20 | ||
|
78666204a1 | ||
|
2ca9a0979e | ||
|
5bcf9c76fd | ||
|
4dee58d480 | ||
|
32f482a6d8 | ||
|
0321bec232 | ||
|
2bb8517e9e | ||
|
f4ea29cd06 | ||
|
52f7684487 | ||
|
d2779aa765 | ||
|
a3007b9b0e | ||
|
14a3fe0ac0 | ||
|
beaeb0d4af | ||
|
c48127fa9e | ||
|
372e908682 | ||
|
bc7ebc1a89 | ||
|
186d03b32a | ||
|
c8ea64976f | ||
|
2023095d8e | ||
|
8597002a17 | ||
|
4f7102be26 | ||
|
e4e3e50867 | ||
|
fa0b5e1b85 | ||
|
018ae69b33 | ||
|
244d6d7823 | ||
|
d1d08ef99f | ||
|
85c6168bba | ||
|
2f5e230338 | ||
|
baa9cd8968 | ||
|
412eb6a611 | ||
|
4e8e25a521 | ||
|
731ff91acd | ||
|
b234e28d5d | ||
|
d6fcbdc38b | ||
|
f737e8ce9f | ||
|
6350641f0a | ||
|
16ddfafeaa | ||
|
4884232360 | ||
|
9457cf33d1 | ||
|
66b16f1fc1 | ||
|
2226e60944 | ||
|
9558b85f7b | ||
|
c9003b5547 | ||
|
9f63a8abfa | ||
|
4ff66a7818 | ||
|
72d58d7b93 | ||
|
11c15b562d | ||
|
9b81d72c46 | ||
|
b0277a129b | ||
|
120082ee3a | ||
|
6abb5cbcbb | ||
|
b215a989f5 | ||
|
5fe4dfb511 | ||
|
cf2eab5b4e | ||
|
55d0560746 | ||
|
1982543cd2 | ||
|
aaf2800c9c | ||
|
62414bff6e | ||
|
2376d3b16a | ||
|
6a65341e14 | ||
|
bff31f006e | ||
|
7410346c5c | ||
|
27a8b3c17b | ||
|
7c070f55be | ||
|
3d8aa53573 | ||
|
7c88c92778 | ||
|
21355e31db | ||
|
97dbd8b63b | ||
|
0df9cc2fc5 | ||
|
e2ce3026a0 | ||
|
6a8ade99c7 | ||
|
43fc399cd1 | ||
|
5ae781586f | ||
|
798d7c6d68 | ||
|
368dec7ac7 | ||
|
12dcfd08b8 | ||
|
0e0862cfc7 | ||
|
5b306f0390 | ||
|
d88347ee7d | ||
|
7a8516d296 | ||
|
c50aba1335 | ||
|
6d9a58bfef | ||
|
071a049f07 | ||
|
e019f7e7f2 | ||
|
315c9455d5 | ||
|
97b0c645bf | ||
|
53f46d32e2 | ||
|
e9560ef021 | ||
|
a44f2c0e65 | ||
|
c54b5da403 | ||
|
c745f434f5 | ||
|
3fa6f48ac6 | ||
|
ce8fe645f4 | ||
|
79eaf49ec0 | ||
|
9950d8a319 | ||
|
4928e2bf0a | ||
|
a570d0a129 | ||
|
918b4e81d2 | ||
|
dd96d0ac93 | ||
|
106a617fa8 | ||
|
3817b4e1c5 | ||
|
2ba461e348 | ||
|
5352e2caa0 | ||
|
463930761b | ||
|
980f955f6c | ||
|
f69829f7b4 | ||
|
c3fd757b03 | ||
|
343288c1f6 | ||
|
355b46e6c5 | ||
|
366b90be1a | ||
|
77a8f103d8 | ||
|
4250725a60 | ||
|
b151904316 | ||
|
558afefc04 | ||
|
21eabd3938 | ||
|
0c090a8c8b | ||
|
926d2beddb | ||
|
98bdd36231 | ||
|
8e870d4cc0 | ||
|
afb5449ca4 | ||
|
5a74b5008d | ||
|
72ac5badb0 | ||
|
3af0c47c97 | ||
|
a46c95c7f2 | ||
|
6801478a13 | ||
|
ef5a21496c | ||
|
67a55efa27 | ||
|
c5694b3013 | ||
|
466347a335 | ||
|
9cfaf0944c | ||
|
bfd564f257 | ||
|
43c1910453 | ||
|
260dbf0a1d | ||
|
f3e20ca437 | ||
|
a2867ff6ea | ||
|
9689f7b925 | ||
|
2037b5ce39 | ||
|
f4c5e6568e | ||
|
865bf67b1a | ||
|
f474b6da85 | ||
|
a578bc2fad | ||
|
5a11d19940 | ||
|
c28778e28c | ||
|
c873327fe3 | ||
|
d25b427efe | ||
|
9cd378caa7 | ||
|
b0258803c6 | ||
|
77eb94409c | ||
|
0735250eb1 | ||
|
fa21cd13d2 | ||
|
d74fffd5de | ||
|
e7722af9a2 | ||
|
0cd409bd6d | ||
|
2ea7f9769a | ||
|
221451b817 | ||
|
48a795c101 | ||
|
f29c963030 | ||
|
dd81707992 | ||
|
ec410fb6fe | ||
|
3edaa5280d | ||
|
51e415a026 | ||
|
04f559e28d | ||
|
ecda05af29 | ||
|
4661315192 | ||
|
0f488ac286 | ||
|
e649708cb2 | ||
|
f656d95339 | ||
|
6eae8f22dc | ||
|
21eeaffc23 | ||
|
831426ca63 | ||
|
58ceab5f1e | ||
|
766a9dc9fd | ||
|
0e8ba24f32 | ||
|
744cee6ec9 | ||
|
32eb50b75e | ||
|
887e58bd21 | ||
|
11a2413476 | ||
|
be4eb6fb2b | ||
|
9e56099edd | ||
|
d92bb41e25 | ||
|
69e351b44a | ||
|
ce161c2c02 | ||
|
f383f7721c | ||
|
1252016b9c | ||
|
1b17a5293c | ||
|
3e4752f99e | ||
|
f44307da4e | ||
|
fd127d59fa | ||
|
29b72c59f3 | ||
|
11376a2dd0 | ||
|
cc9168bda1 | ||
|
f4d0c83181 | ||
|
096efdf798 | ||
|
20735bf840 | ||
|
e3c3e780ae | ||
|
9190cf8796 | ||
|
d19a21bd01 | ||
|
94b8486d4b | ||
|
cce430fbfa | ||
|
5b8051581e | ||
|
0e8d129efb | ||
|
62012e3c68 | ||
|
b8c71e7f2d | ||
|
ac83639631 | ||
|
fef21361c5 | ||
|
368fa9475d | ||
|
a90ee65f7b | ||
|
e83be1d73a | ||
|
e8c3e54dda | ||
|
2aee114950 | ||
|
4d322a97e1 | ||
|
8210f89b12 | ||
|
a28baabefe | ||
|
e94d16667b | ||
|
c3db1cae3f | ||
|
017162e3fd | ||
|
fef25ea934 | ||
|
a9282bad29 | ||
|
67931bdeb2 | ||
|
85f867983f | ||
|
ec17161651 | ||
|
3d4bd9667a | ||
|
7420814fe2 | ||
|
8d6f265441 | ||
|
bc8b0480e9 | ||
|
046d281abc | ||
|
efc6b35615 | ||
|
bf747e32b4 | ||
|
ef15735161 | ||
|
99c65bb67c | ||
|
967e837c73 | ||
|
ca084d40c1 | ||
|
238ebb600d | ||
|
a49601ba87 | ||
|
aa10ec6e45 | ||
|
be935debe9 | ||
|
1c8a74b661 | ||
|
73ddbc3acd | ||
|
7f9840cecf | ||
|
cc3036860a | ||
|
2af40c3fe6 | ||
|
ea1958a948 | ||
|
9d42e146e7 | ||
|
c156b50e4c | ||
|
3752d68e7d | ||
|
cb860e8150 | ||
|
434238fcd4 | ||
|
2d10547266 | ||
|
f9a21281c4 | ||
|
d590eb074f | ||
|
66ff4aae89 | ||
|
450d0d69af | ||
|
28889954ef | ||
|
f0a55df963 | ||
|
40fff219b5 | ||
|
2ed818bc03 | ||
|
9017eaee08 | ||
|
38aae024cd | ||
|
1fc11c27e7 | ||
|
c4a8930909 | ||
|
a280c97321 | ||
|
dfd1c85916 | ||
|
fc86d741db | ||
|
ca38af0d83 | ||
|
f7584bf14c | ||
|
0090ce3df7 | ||
|
433db8f9f9 | ||
|
7e9e321c38 | ||
|
6ac1ed18ea | ||
|
54930ddd33 | ||
|
3e59b7345c | ||
|
838c4e938c | ||
|
f79a52fe9b | ||
|
2eb1657d91 | ||
|
e6a32db7b9 | ||
|
acce7ec9cf | ||
|
fbb2d5e10d | ||
|
f86edf8d3c | ||
|
08ba147241 | ||
|
2b6a139526 | ||
|
9f60cd18e3 | ||
|
ac7b3e405c | ||
|
bb3cb8f233 | ||
|
e745b0dd47 | ||
|
f17d60da64 | ||
|
afb6e485b7 | ||
|
ccfd6dde45 | ||
|
706868dad8 | ||
|
3b3a1390ad | ||
|
fafe1732b5 | ||
|
5ff7d9505f | ||
|
2e6a110181 | ||
|
1592b40e25 | ||
|
9cd0c101f0 | ||
|
3d62c9ed9d | ||
|
53fafad915 | ||
|
999f3556fd | ||
|
4f5731ac39 | ||
|
4aafdea5a7 | ||
|
c18d3aecbc | ||
|
f1c536fe13 | ||
|
ad9233e620 | ||
|
f88a609000 | ||
|
80ba9944e5 | ||
|
0f12be7549 | ||
|
b581799c9a | ||
|
067d1d6935 | ||
|
ada1fdc14d | ||
|
c98d09f15d | ||
|
a6676e6bc2 | ||
|
51e59f4873 | ||
|
74ed35792f | ||
|
25914d381a | ||
|
fcdef1d0a0 | ||
|
1d3240ff9c | ||
|
7c3706763a | ||
|
8bdb105897 | ||
|
d3775b973e | ||
|
e77a76a284 | ||
|
00b91a07cb | ||
|
52e47b5a53 | ||
|
7be62631ae | ||
|
d2686c8413 | ||
|
cba652e4f3 | ||
|
370cd14b46 | ||
|
d3e288cc4d | ||
|
06a6629eef | ||
|
a19490c291 | ||
|
d4eb88b255 | ||
|
c844fea9df | ||
|
923568a279 | ||
|
2c32503b10 | ||
|
fe0317aee5 | ||
|
751be1ae8c | ||
|
f48b63de38 | ||
|
3beb200c68 | ||
|
d43b743ff4 | ||
|
70423af38c | ||
|
f7006f64fb | ||
|
6431c26e8b | ||
|
04d05fbdc2 | ||
|
614debd13f | ||
|
2060de5ed0 | ||
|
d5e00e6b0f | ||
|
52d801bd19 | ||
|
ac09592355 | ||
|
fb418b26d7 | ||
|
4888d7d410 | ||
|
89bc316a7a | ||
|
c1b1e0aab1 | ||
|
2bea621f7d | ||
|
868f248696 | ||
|
30111efc6d | ||
|
a28236d939 | ||
|
6fd4a87881 | ||
|
9c5b994369 | ||
|
9befef1b03 | ||
|
0ff22e4a49 | ||
|
18b6ba0af4 | ||
|
9f14ac291f | ||
|
65d4652e92 | ||
|
613868b893 | ||
|
73abf8a800 | ||
|
3bb5c459d6 | ||
|
145ea03ca2 | ||
|
49f429018e | ||
|
66149a29da | ||
|
0ee8159f6c | ||
|
e81f4b29db | ||
|
1b82546b90 | ||
|
e250c226ca | ||
|
d67a0259cf | ||
|
7f2e4d8ace | ||
|
6f313ff245 | ||
|
a991c01731 | ||
|
b5aae7e901 | ||
|
5b7d6ed8b9 | ||
|
38856886e6 | ||
|
f2ba78e04b | ||
|
ae32d968b9 | ||
|
df5dcf5162 | ||
|
76801973e1 | ||
|
b6b8ff591d | ||
|
9a781cef53 | ||
|
aaccfd8201 | ||
|
4bccb3dc9f | ||
|
d8c278bf52 | ||
|
407385dc72 | ||
|
f6ec835599 | ||
|
5f17b61ff2 | ||
|
d203ccbf5e | ||
|
757eea2779 | ||
|
6a8e169001 | ||
|
9e86826eab | ||
|
278bffe059 | ||
|
f5b71f5329 | ||
|
20ac3d321f | ||
|
4adbeced25 | ||
|
7314501d62 | ||
|
1615edf5fb | ||
|
28d4c9e9f4 | ||
|
ed076b7c5b | ||
|
915a98c560 | ||
|
2d2756cbad | ||
|
03db3ed6e9 | ||
|
20bce151c1 | ||
|
85f6c6b2df | ||
|
bda031f4ac | ||
|
797ee8d8e3 | ||
|
0e846883bf | ||
|
72b3a7a59f | ||
|
32f38b97d5 | ||
|
7fd7dca375 | ||
|
0a668be1bf | ||
|
edb284f189 | ||
|
54cb23d234 | ||
|
c4c99727c5 | ||
|
57f4ba7b37 | ||
|
325729d0f6 | ||
|
cd49efa84e | ||
|
bc649e1632 | ||
|
3c1a83d61f | ||
|
4eb7cbac47 | ||
|
a502152075 | ||
|
ef80beab81 | ||
|
9d50a346f0 | ||
|
12a695696d | ||
|
e640d840b7 | ||
|
11d051b69a | ||
|
932a161d44 | ||
|
211bdab51f | ||
|
6fcedb5396 | ||
|
3f25610d2f | ||
|
078bd8ef40 | ||
|
e44fd87fa3 | ||
|
f000b5daff | ||
|
1e82832737 | ||
|
c301a1e51a | ||
|
e673bdc617 | ||
|
71cedc6cfe | ||
|
5034c6c65e | ||
|
f0f5d9f644 | ||
|
0b6a4313dd | ||
|
3b0b5dacf5 | ||
|
d97044d9ac | ||
|
99dc2c48bd | ||
|
95439ba529 | ||
|
e2d5071e59 | ||
|
135ed7feb4 | ||
|
bd345164d3 | ||
|
c41b029ca4 | ||
|
9e35bc7dae | ||
|
c2fd61fa01 | ||
|
7cbdae1bed | ||
|
3aebb0bfe3 | ||
|
8a7fa306ce | ||
|
bdd17c337f | ||
|
3bbc8e3191 | ||
|
eb3577c1eb | ||
|
9f1474c1d0 | ||
|
608a33f72b | ||
|
c580949417 | ||
|
ae4ece840d | ||
|
13e2ad2840 | ||
|
c234a19423 | ||
|
20574fa81f | ||
|
29e232f4b2 | ||
|
bc713dabc4 | ||
|
33c68a24a0 | ||
|
f96d865b93 | ||
|
925208d28f | ||
|
7ab7d8b4b1 | ||
|
5661d03be8 | ||
|
5eb2e83c82 | ||
|
c1e4c45c7a | ||
|
3503cba5d9 | ||
|
728a088cd7 | ||
|
17bcefeac1 | ||
|
6570d0c4b7 | ||
|
fb8a31ba3f | ||
|
e37dbd8b8d | ||
|
fc3acdacf6 | ||
|
0365f1ec82 | ||
|
99c925efd8 | ||
|
ea888114fa | ||
|
3a6fe042ea | ||
|
0d1dd82b89 | ||
|
ea73ccf22d | ||
|
86751b42a6 | ||
|
9a78fd049d | ||
|
cdea4209fc | ||
|
89f438de5a | ||
|
9dceda8a03 | ||
|
4e4b8727fc | ||
|
d2338f3a49 | ||
|
d998e3eebe | ||
|
b823f7151e | ||
|
793eef1d0a | ||
|
1e51813d05 | ||
|
ee33dcdf33 | ||
|
defaea3496 | ||
|
46fce40fd5 | ||
|
9f890bb6fa | ||
|
3b2e96e0b1 | ||
|
fca5a8ab48 | ||
|
5620895e88 | ||
|
337c77a39b | ||
|
26cfd75d05 | ||
|
9fb00f2ad0 | ||
|
487557b343 | ||
|
31f67dd3cc | ||
|
8221aadea3 | ||
|
3c9142f37e | ||
|
663ee327b0 | ||
|
de2d4c7763 | ||
|
5fa7e2faa4 | ||
|
da44625970 | ||
|
b2d2e30ac8 | ||
|
5dc9d0f581 | ||
|
6494da3101 | ||
|
e51e27fcab | ||
|
73216e5fb1 | ||
|
dd4d66d1bf | ||
|
4b63f70285 | ||
|
239ede725d | ||
|
22a09a53e6 | ||
|
a9b9c4cc33 | ||
|
e7bb03d8e7 | ||
|
59dbd3b6ce | ||
|
3107c9548d | ||
|
9f5658c8ac | ||
|
ca1f4db50c | ||
|
d3f5d036f8 | ||
|
baf574494d | ||
|
de3e413aab | ||
|
93b4c828c1 | ||
|
165171f9c8 | ||
|
0ea193c4e2 | ||
|
d956dbbd2c | ||
|
db49aa6bd9 | ||
|
9160a7ceb3 | ||
|
71c72db1e3 | ||
|
cb08dc574c | ||
|
c7f3bd0d22 | ||
|
bb3b3452f3 | ||
|
70ffae7430 | ||
|
4702be7488 | ||
|
97fc9b437d | ||
|
7669ade19c | ||
|
2be2e0fa86 | ||
|
bda18bc899 | ||
|
a10caa4631 | ||
|
8c4ce9a3de | ||
|
710586367c | ||
|
f3f0eaa59e | ||
|
cbcadded18 | ||
|
80c203f3bb | ||
|
001c50cfc6 | ||
|
3b64bae323 | ||
|
7da0ffa5ea | ||
|
bad778c1c4 | ||
|
6e103d5dca | ||
|
65870346e4 | ||
|
5e5fea2293 | ||
|
b6a72db2ad | ||
|
c56af32bb7 | ||
|
511183e76c | ||
|
2826f3d42f | ||
|
bdbad880c4 | ||
|
b0b77bc0f2 | ||
|
2accdb76bd | ||
|
be94eb67be | ||
|
08ea80b708 | ||
|
95c44ab298 | ||
|
41b82903a8 | ||
|
b955936ee1 | ||
|
d6975a708a | ||
|
eabc64fb7d | ||
|
96cdcec58a | ||
|
440466524e | ||
|
9b75bffc88 | ||
|
c2efe87cff | ||
|
1e452d5fca | ||
|
f7228bb562 | ||
|
386b60396f | ||
|
49d228207f | ||
|
d6e0a4390c | ||
|
ca21a5c7b4 | ||
|
f51cf81148 | ||
|
58a83ca8ad | ||
|
d93d9fb7be | ||
|
69c5559e53 | ||
|
ebe88c3869 | ||
|
a6bec2ebdc | ||
|
9ffeae554b | ||
|
422044b778 | ||
|
f21ac15c6c | ||
|
f22edf13dc | ||
|
b63b992fd6 | ||
|
7f7ad39e15 | ||
|
075140aefe | ||
|
453631773e | ||
|
8637612908 | ||
|
a247f7d797 | ||
|
23d34747f4 | ||
|
6466c9d406 | ||
|
832c2ffa3b | ||
|
951a9583fa | ||
|
5499fd307a | ||
|
e94fa1c9b3 | ||
|
7e91b26bb1 | ||
|
276b1bc07a | ||
|
12d49eaf6c | ||
|
0ebdad53e8 | ||
|
d0649e6868 | ||
|
2cc6caf182 | ||
|
80cef67580 | ||
|
d2d57c70e2 | ||
|
06899bd9a6 | ||
|
cf6c11cfaa | ||
|
06479ba535 | ||
|
ecd04539ec | ||
|
864ca4dd57 | ||
|
f079d0625d | ||
|
37c93ba031 | ||
|
addb977ef1 | ||
|
810bab7391 | ||
|
87883b592f | ||
|
b56fce1570 | ||
|
10c0eb648a | ||
|
ec9fe02a30 | ||
|
6b0f660180 | ||
|
12871db0f9 | ||
|
45efb935c5 | ||
|
2b52008405 | ||
|
7fec7a0569 | ||
|
12b6c56903 | ||
|
0a3b5952e0 | ||
|
66b462d6e1 | ||
|
02fdd6459e | ||
|
0df4e06f11 | ||
|
8f0f1cf6c1 | ||
|
ee27930628 | ||
|
a61d8dea36 | ||
|
eea46be4e6 | ||
|
fdc65e49e4 | ||
|
75f1dfaf8a | ||
|
72632a846b | ||
|
5668b64839 | ||
|
b3d0bd6081 | ||
|
1ea66b9033 | ||
|
e82e2b7570 | ||
|
001761ed58 | ||
|
5c98a44603 | ||
|
4cd493dd9a | ||
|
b4b210526a | ||
|
1bf33a7402 | ||
|
12903ee9b5 | ||
|
fc250c3df7 | ||
|
486354d63f | ||
|
9ac9c61433 | ||
|
580c7da559 | ||
|
994d8ae54d | ||
|
d9e43ea120 | ||
|
27462c1078 | ||
|
dc373d2e0e | ||
|
e046d0696b | ||
|
d4079ad3a2 | ||
|
b22a0ec7d8 | ||
|
d3e5a3024c | ||
|
9c315412e1 | ||
|
67c6a45e0e | ||
|
584d5f0f31 | ||
|
24f41c8c4c | ||
|
dc1b9ce7f0 | ||
|
43d6292328 | ||
|
3efaa065a5 | ||
|
a36e3a2033 | ||
|
bce20c3280 | ||
|
98b478fec1 | ||
|
9d3a3c32d6 | ||
|
d00579bf60 | ||
|
9d71eb46b8 | ||
|
5006ef3f56 | ||
|
4c06426d46 | ||
|
9f3636a103 | ||
|
6a41d5e7ad | ||
|
3489b759a0 | ||
|
d725eeaf84 | ||
|
37b20124f9 | ||
|
ba1f1f8ee9 | ||
|
ec7f4d3232 | ||
|
51c0c88772 | ||
|
afb04c9133 | ||
|
25878d68e0 | ||
|
cdf08c1ff3 | ||
|
43f4afef78 | ||
|
c117965072 | ||
|
048966bb44 | ||
|
23bf1b530b | ||
|
97d8ea8119 | ||
|
d946337724 | ||
|
7be8209d14 | ||
|
962497bdc9 | ||
|
496f559c9a | ||
|
0fda5b7b80 | ||
|
0ebe8ce4c5 | ||
|
f52ce00bf1 | ||
|
f5855968bb | ||
|
678cc54c44 | ||
|
dc5e56c2f3 | ||
|
efdbfd3883 | ||
|
e8f3de0f2e | ||
|
d95b77ebec | ||
|
154b01e8cf | ||
|
5fd9709a8b | ||
|
f62084ffea | ||
|
88660fdf64 | ||
|
f47e2f3ae4 | ||
|
318e8acfae | ||
|
b312f5e208 | ||
|
c9040bce55 | ||
|
ce52210832 | ||
|
37b10d1a0e | ||
|
143c52e4cd | ||
|
156cd33c7f | ||
|
bbae72cea2 | ||
|
02b1710ab2 | ||
|
e4a38c10f4 | ||
|
af5b82acf5 | ||
|
42efd26698 | ||
|
aee6b8765e | ||
|
a94a84b507 | ||
|
9dd3b8101a | ||
|
d84772d620 | ||
|
8e062afdd8 | ||
|
a7b75792ec | ||
|
9ea5291c48 | ||
|
219e697dd9 | ||
|
a3985c3406 | ||
|
0aca5082ab | ||
|
3795d78b14 | ||
|
a407a673dd | ||
|
074aafa814 | ||
|
b3509fd3de | ||
|
8aaa6d2162 | ||
|
22eca139fb | ||
|
1b1ef31228 | ||
|
bf123b5299 | ||
|
d4c5d4d104 | ||
|
ac9a6f8504 | ||
|
bf7cce25dc | ||
|
0eccf75f65 | ||
|
13fbb4748a | ||
|
95a07f3340 | ||
|
30306e5470 | ||
|
755f913b02 | ||
|
fb6fbcf700 | ||
|
adf130965c | ||
|
be65829055 | ||
|
e0084617d5 | ||
|
8b2da399ee | ||
|
e163d21f23 | ||
|
0d759c8c1a | ||
|
87ad8c0561 | ||
|
842aeb8c47 | ||
|
3dc53e21e5 | ||
|
f5cbdbab4f | ||
|
cf9079c783 | ||
|
0b65053ffd | ||
|
7c6a8775eb | ||
|
40da56fbf7 | ||
|
c8e068712b | ||
|
f6f0771770 | ||
|
4ad00fa388 | ||
|
4b4cb9ce66 | ||
|
67eadf1e97 | ||
|
6123937bde | ||
|
da3a77b4e3 | ||
|
255f9f0234 | ||
|
ba4504a9c7 | ||
|
7e13a4909e | ||
|
afe4aadade | ||
|
8db7528ac7 | ||
|
2d39dff84a | ||
|
b69b4a9f2a | ||
|
85a01bfd9b | ||
|
352a4f2757 | ||
|
41287694cb | ||
|
04a439a0a0 | ||
|
e528a8c7a4 | ||
|
362751e4ef | ||
|
0db3940cc4 | ||
|
e2bb5e1726 | ||
|
572ac09660 | ||
|
9f5a483256 | ||
|
cc752ad6a0 | ||
|
ce2ec035f4 | ||
|
20ed0a15a4 | ||
|
a02aeaf972 | ||
|
ca8912375c | ||
|
6b8d490249 | ||
|
84b512c62c | ||
|
1343ef5915 | ||
|
65f3bb01be | ||
|
10805cb6ec | ||
|
dd01dd7bef | ||
|
1057bd38cf | ||
|
fcd6ec99d3 | ||
|
d2113dc9f5 | ||
|
3d62ff0e07 | ||
|
90adbe0451 | ||
|
f6defeff5d | ||
|
0a1225d0df | ||
|
527952102a | ||
|
8a4e939a10 | ||
|
f8395886d3 | ||
|
9527c93a1c | ||
|
37e13361f5 | ||
|
bb6db74167 | ||
|
1f95fac699 | ||
|
24e4e674a5 | ||
|
460e5d792d | ||
|
02d821c0ab | ||
|
d12b34388d | ||
|
e686f5a249 | ||
|
33c7c28dde | ||
|
04c057238b | ||
|
bfe55118dd | ||
|
f825af06f0 | ||
|
2205bdd469 | ||
|
0f3b69c79d | ||
|
cf10e318d6 | ||
|
1ab9dbab60 | ||
|
4f0fc55385 | ||
|
23195693ed | ||
|
a7fa41612c | ||
|
5f91ea34de | ||
|
ea9c186e36 | ||
|
a97477337d | ||
|
fec6f187d1 | ||
|
1a96c294ee | ||
|
19a28e2c9f | ||
|
1984d40e33 | ||
|
cf4206d987 | ||
|
cc4c232956 | ||
|
226f85efcb | ||
|
2aa8e17c88 | ||
|
3365139a6c | ||
|
2cc3c16ab1 | ||
|
3a0b397054 | ||
|
b15eaeda16 | ||
|
e049190ff1 | ||
|
dba59cf903 | ||
|
56122cbe2f | ||
|
c77edaee34 | ||
|
21ce21cc07 | ||
|
6cf15615e8 | ||
|
a1399426c3 | ||
|
81249724e3 | ||
|
bdcffa90eb | ||
|
1ee4c4ba62 | ||
|
7935a366f4 | ||
|
08b3af4387 | ||
|
8e96402819 | ||
|
1c104a385d | ||
|
ec6f0811a0 | ||
|
a257e7a3ee | ||
|
acaddf9cd9 | ||
|
bb50368d55 | ||
|
8503d53018 | ||
|
8d4ba0aa83 | ||
|
5abf7841f8 | ||
|
ff67e06844 | ||
|
5f74c2afdf | ||
|
96b3f17d02 | ||
|
58c2c10cdb | ||
|
e6cc3c4752 | ||
|
9f0e359d73 | ||
|
82c5dfc30a | ||
|
ee2d036bbf | ||
|
cf363103d2 | ||
|
41af5aaae2 | ||
|
f0212f3f15 | ||
|
81144bb969 | ||
|
b00a7d0619 | ||
|
ef6dec17ba | ||
|
b067bb6304 | ||
|
ed18c145cd | ||
|
8247e6069d | ||
|
38ca109766 | ||
|
6d5753c548 | ||
|
0fa909a889 | ||
|
38ae319bea | ||
|
287e30239c | ||
|
530fc5a431 | ||
|
d3e25db395 | ||
|
f3cd42887d | ||
|
3c52cb1790 | ||
|
8309e0ecb0 | ||
|
22e9451192 | ||
|
a1641cdec9 | ||
|
8f0fd7ecf5 | ||
|
c7f564e866 | ||
|
c9ae3f4efe | ||
|
6d0698ba0e | ||
|
155da0cd09 | ||
|
b4f3adb6ee | ||
|
6b232bd8f6 | ||
|
323d4a484d | ||
|
6af25fb423 | ||
|
35b6c72634 | ||
|
5f7f6319eb | ||
|
47592fbf42 | ||
|
80a38c1e45 | ||
|
c599ea0737 | ||
|
9040c64e5b | ||
|
905073a506 | ||
|
656666e722 | ||
|
460c34df4b | ||
|
d1ea1ec21b | ||
|
e253beaa2b | ||
|
9021e52a6f | ||
|
5b6e67119f | ||
|
ad1739c63f | ||
|
b415b9aacf | ||
|
dc9d287e33 | ||
|
135be952fe | ||
|
c21a8573b4 | ||
|
5733b0e4cb | ||
|
5c3f8efd23 | ||
|
076d9311fa | ||
|
c5099ff407 | ||
|
4277e9f5d6 | ||
|
882b770ecb | ||
|
a21f586c3b | ||
|
2fbd948a67 | ||
|
49cf82a0ac | ||
|
6412dcb896 | ||
|
16e80258b8 | ||
|
b875bbcdf1 | ||
|
6b21c4f6c9 | ||
|
e8bceaa284 | ||
|
59abeeb097 | ||
|
d95b79f9eb | ||
|
1861cf4975 | ||
|
427c79b24b | ||
|
f3270d4ce8 | ||
|
4974585d04 | ||
|
5268914b3f | ||
|
29b40112c2 | ||
|
1d7898b5ea | ||
|
3d204b1afd | ||
|
821f3e674a | ||
|
1a004264f4 | ||
|
8f08661d9e | ||
|
eb7688df8f | ||
|
e8f8ec027d | ||
|
d493a82f9e | ||
|
a75e43ef22 | ||
|
cb11b7ca6f | ||
|
75b7720d00 | ||
|
5bbc2b4949 | ||
|
76fff4d042 | ||
|
c43f082993 | ||
|
6e20cda7fd | ||
|
4596663232 | ||
|
d79beb9539 | ||
|
46888206be | ||
|
c1dce0f617 | ||
|
6e9788a9e6 | ||
|
d90f5e0429 | ||
|
bbfdedff01 | ||
|
8d910d7950 | ||
|
48f4a591de | ||
|
e8ce4ab8e8 | ||
|
d586fe6737 | ||
|
c5353646b6 | ||
|
1247fc030f | ||
|
a8bc2af649 | ||
|
4d146cb39d | ||
|
cf7dc1d737 | ||
|
a343e9a475 | ||
|
dc4f0f6c91 | ||
|
98e36753e6 | ||
|
85de0db05d | ||
|
11c22d6a17 | ||
|
75a6d87542 | ||
|
5f21e213df | ||
|
f4c127f75a | ||
|
93855ae6ab | ||
|
ac8dba2a80 | ||
|
f5c9265d1b | ||
|
21280ca775 | ||
|
ead8a1c333 | ||
|
4188c263e3 | ||
|
3efff4e8de | ||
|
479fa6408a | ||
|
ce196232a7 | ||
|
ce8f97c23c | ||
|
4e375d0e74 | ||
|
500f5ebf04 | ||
|
1591caa0e5 | ||
|
bb338a2b9c | ||
|
4329a78011 | ||
|
023f337735 | ||
|
d311e28038 | ||
|
6c7509c942 | ||
|
0e3cb945e8 | ||
|
40d1a491ca | ||
|
dcc78017b0 | ||
|
9ec1a4361b | ||
|
40f7d4fce0 | ||
|
ead3937394 | ||
|
cbc18bf968 | ||
|
0fcbaeb596 | ||
|
fe7a4eb4ff | ||
|
2b57d176df | ||
|
bb3dd31dd7 | ||
|
e132945f71 | ||
|
58e9d7a8ec | ||
|
439417a22c | ||
|
3c70155504 | ||
|
138feb8be6 | ||
|
2085876da6 | ||
|
e64699bd54 | ||
|
5f6aa9c34c | ||
|
893e03e5d2 | ||
|
59afffb373 | ||
|
1634742177 | ||
|
d459145d28 | ||
|
641761ddb0 | ||
|
f9c1f85f02 | ||
|
3833a70b8d | ||
|
45eebb39fb | ||
|
a6ded4d3fe | ||
|
287514e849 | ||
|
aa7f827e72 | ||
|
2bed33ab15 | ||
|
54a1fad13b | ||
|
e480c76a11 | ||
|
e57da19d4a | ||
|
81bcefe86c | ||
|
4783b17fa3 | ||
|
56202ee7c6 | ||
|
b19fb4c24d | ||
|
5964f74e3a | ||
|
e0132c3099 | ||
|
01c0c3ca1f | ||
|
9aa15aa710 | ||
|
a611144d0c | ||
|
b2030f6d73 | ||
|
44372b89f6 | ||
|
2a1375e97c | ||
|
1495134398 | ||
|
2b62858770 | ||
|
a6ba9d6bcd | ||
|
1dc84989bf | ||
|
ce0e74f6a9 | ||
|
0c44a6be7f | ||
|
e1ae9af5a0 | ||
|
b81a19928d | ||
|
1021948313 | ||
|
e778b83667 | ||
|
a71a52ddd6 | ||
|
d300aa3255 | ||
|
f306ea2f5d | ||
|
0a5d57eade | ||
|
a8b0d1c8e0 | ||
|
cc10527706 | ||
|
5c003d3fbe | ||
|
916371e04c | ||
|
e059f012d7 | ||
|
46c0dc4788 | ||
|
13ac6e9a82 | ||
|
10a74924e3 | ||
|
8d5043f409 | ||
|
c03f273941 | ||
|
4674ed367d | ||
|
f4f525549c | ||
|
ac73c2bd6c | ||
|
cb4ccc59c2 | ||
|
d76d56ce74 | ||
|
50cf4cfda3 | ||
|
9bd0fae684 | ||
|
8712d84bcc | ||
|
49696d0134 | ||
|
4295b77582 | ||
|
46c9663ed7 | ||
|
10d1d278f3 | ||
|
cfb7d2f036 | ||
|
bc219056a6 | ||
|
899117e785 | ||
|
382133b384 | ||
|
8de5c4e3b8 | ||
|
c112804539 | ||
|
70c349f36b | ||
|
34bf1b13e9 | ||
|
9f58d8d715 | ||
|
1285e07f1b | ||
|
49ec306a0a | ||
|
6743761c2c | ||
|
da7fec86c4 | ||
|
3b9a14fc9c | ||
|
4c64e94d39 | ||
|
b4c4ba0439 | ||
|
f611ba8aa0 | ||
|
5052b2d7e0 | ||
|
a21f2377bc | ||
|
b140606a49 | ||
|
6a3779d635 | ||
|
2d13eb0920 | ||
|
496567d3f1 | ||
|
3afa831e28 | ||
|
f4a467a864 | ||
|
5f13279557 | ||
|
bb98eae131 | ||
|
8167e8897e | ||
|
b2ddb85e62 | ||
|
653079b792 | ||
|
a6c57dc6f1 | ||
|
fb90d5b0ec | ||
|
45d528baed | ||
|
2a255e49e2 | ||
|
96d230becb | ||
|
e0c26f0ec5 | ||
|
6be821c18b | ||
|
95654cfada | ||
|
4dd669661b | ||
|
b1033a3443 | ||
|
cd51d285e6 | ||
|
6e8e94837d | ||
|
468714cab9 | ||
|
4918514eaf | ||
|
2488c67798 | ||
|
4591ad2d64 | ||
|
c769061a8a | ||
|
cec63f3cb5 | ||
|
49579165a7 | ||
|
e57b8212ce | ||
|
58c390991c | ||
|
4b27050afe | ||
|
a0742e99e3 | ||
|
99cedceef5 | ||
|
1b6d8a6ed6 | ||
|
8fd69bc6c2 | ||
|
5bbb837635 | ||
|
5ca875a7ff | ||
|
e9c7314d50 | ||
|
4ae6eae58d | ||
|
7dba90b7ca | ||
|
41d998eb3c | ||
|
25204b1ec7 | ||
|
8d170c7f47 | ||
|
66c3af7628 | ||
|
4aa9174e76 | ||
|
3fcc2a6cb2 | ||
|
f8d80a936f | ||
|
c85294e0b2 | ||
|
82dc6c8b8f | ||
|
2eb5ed33be | ||
|
b1fd3c00d0 | ||
|
c700978c45 | ||
|
5d525c4a5f | ||
|
e5d890a1aa | ||
|
44c899ce70 | ||
|
cfc47abf0d | ||
|
77d2a2131d | ||
|
9ccb966a3a | ||
|
d5cf713c20 | ||
|
10ee8b4e27 | ||
|
a5281df501 | ||
|
59d1aa52f2 | ||
|
626dbf6057 | ||
|
452e95d02a | ||
|
4ce884fa52 | ||
|
839721b926 | ||
|
8cd88ddf61 | ||
|
87fb437d76 | ||
|
e74ebf0be3 | ||
|
26f86ac50a | ||
|
b4d4fc8f79 | ||
|
3b7d34a1d5 | ||
|
aa4ec94d71 | ||
|
dd043d737f | ||
|
6e0ea02f17 | ||
|
87490316c8 | ||
|
036da0fb4e | ||
|
a7c9ca3b43 | ||
|
c39ebfe1b8 | ||
|
434d0947e5 | ||
|
acf6bfb1f6 | ||
|
2c5c6a1ff5 | ||
|
08dccc390d | ||
|
70fd348432 | ||
|
cd93df4fe0 | ||
|
0364457947 | ||
|
9c545d6a14 | ||
|
c015852498 | ||
|
7135f203f5 | ||
|
5a48f3123f | ||
|
ef60891c2c | ||
|
704dc3e34d | ||
|
3eae79f6e0 | ||
|
76f78cf123 | ||
|
2230a68e42 | ||
|
896d040c68 | ||
|
9ac854b7bb | ||
|
2f71bfc152 | ||
|
819e148510 | ||
|
7d373477ed | ||
|
a75cf5a163 | ||
|
4c68049d86 | ||
|
dea861abd8 | ||
|
51208601a4 | ||
|
2ea74e60f9 | ||
|
db5b089cee | ||
|
ce3ff08932 | ||
|
30eccfd454 | ||
|
eb13951fb2 | ||
|
271d9fc76e | ||
|
55b5ca0bcc | ||
|
46a56ea742 | ||
|
96b12ee504 | ||
|
9b6c14b7ae | ||
|
215924f797 | ||
|
e8e05d462c | ||
|
a7b9deb2ca | ||
|
8ac54e8b14 | ||
|
dcc3e72d39 | ||
|
0a4796b2a0 | ||
|
9e72bb1775 | ||
|
f3b65445dc | ||
|
7cb217ed4a | ||
|
cdd44849b8 | ||
|
35fd08f594 | ||
|
11587f1dde | ||
|
3ce7bfef07 | ||
|
c9808586b3 | ||
|
281013002d | ||
|
25e7ff1196 | ||
|
4fb5da75dc | ||
|
5e008ad074 | ||
|
20792526c6 | ||
|
7123bcfc3e | ||
|
20b7ac0518 | ||
|
2f30d3e5a3 | ||
|
cb9d194f86 | ||
|
7653f3af49 | ||
|
ae469ee614 | ||
|
0493d717a4 | ||
|
093029c2f5 | ||
|
c6e02c09ff | ||
|
8f2336f02c | ||
|
0ffe934a3e | ||
|
aa5be2dbc3 | ||
|
04ea2112bd | ||
|
4923f1cf7e | ||
|
56f0bb8613 | ||
|
b91116e2bc | ||
|
dc5c264e26 | ||
|
22e1b525a5 | ||
|
d95b1b33e5 | ||
|
b889aa7841 | ||
|
e02b278db1 | ||
|
deed44a4af | ||
|
aa6f8d40bd | ||
|
5ea485e197 | ||
|
60eeaeee69 | ||
|
cda5b25cb2 | ||
|
f91d1d967f | ||
|
42bf473b18 | ||
|
f6f5b4ab0d | ||
|
f1cb1f8420 | ||
|
9becd733af | ||
|
646c1cb8a8 | ||
|
1fed6f8abd | ||
|
1127c0e6e5 | ||
|
48619a385e | ||
|
eaf3bd5ca4 | ||
|
12b28c4bb9 | ||
|
7c925353a5 | ||
|
8113c00712 | ||
|
17d9051b82 | ||
|
7a4623e034 | ||
|
115c6bc000 | ||
|
fce0114174 | ||
|
0e4096e201 | ||
|
d6243c63fe | ||
|
420f3f7840 | ||
|
ede7a585bf | ||
|
5491bd4fd2 | ||
|
78fc96518f | ||
|
660034332d | ||
|
6acbfe863d | ||
|
22095d12f5 | ||
|
b7fc8099f1 | ||
|
f312b5e386 | ||
|
8e99996321 | ||
|
99c98407c9 | ||
|
c1ed0b2d5b | ||
|
70c1aff94c | ||
|
9c0ec39770 | ||
|
b29fbc82c2 | ||
|
eaff0f73d1 | ||
|
7911c9300d | ||
|
bbc12ade7f | ||
|
df1c895076 | ||
|
4a8f6ba58c | ||
|
b126939b5d | ||
|
f5a996a5af | ||
|
b54c76d6a3 | ||
|
ebb7145ccc | ||
|
584879c759 | ||
|
1900d9a656 | ||
|
8061bb54fe | ||
|
78efc18079 | ||
|
2889f484f4 | ||
|
0c58df06d5 | ||
|
d6e0e0de2b | ||
|
40f69d7abf | ||
|
eb3f75e03e | ||
|
d3ae574418 | ||
|
d7882cb89b | ||
|
5c8121e7a8 | ||
|
bf0adc2c70 | ||
|
2e8d17e7b7 | ||
|
5b5717e539 | ||
|
0e20577af4 | ||
|
a9c7377e0a | ||
|
68d757113b | ||
|
af61bd3137 | ||
|
dc987edf34 | ||
|
9209d9b304 | ||
|
7ac3d85126 | ||
|
8fa9cc0de3 | ||
|
608de57358 | ||
|
40c04a7565 | ||
|
30f86286f5 | ||
|
aaac715060 | ||
|
7ebd10a868 | ||
|
8ebd135536 | ||
|
6a03ed74fb | ||
|
a7f93060dd | ||
|
b2b3f170a9 | ||
|
22c5192b3d | ||
|
d79be3f7fc | ||
|
2200f87492 | ||
|
c84bd6d393 | ||
|
5c23071a81 | ||
|
43095307da | ||
|
bebae14223 | ||
|
d2cc815009 | ||
|
a859c10fa1 | ||
|
4889b4ceee | ||
|
d7c42c8132 | ||
|
78f1b8bd15 | ||
|
87dd7b89f5 | ||
|
41fd1655bd | ||
|
1ccc23268c | ||
|
9309f75704 | ||
|
98552f1d75 | ||
|
27c5760b0c | ||
|
f2813633b0 | ||
|
6e990b77d1 | ||
|
596b1e69ce | ||
|
d2205aa1a0 | ||
|
76eefcc08a | ||
|
eb460c30ce | ||
|
6d8e78cc95 | ||
|
0701d4ce6e | ||
|
d169557b00 | ||
|
a89a02ff85 | ||
|
ae8393c06e | ||
|
e2d6f2761c | ||
|
6029585f19 | ||
|
aaea58fa2e | ||
|
9ddaf76b68 | ||
|
04b4e605a0 | ||
|
754536404e | ||
|
a75c457620 | ||
|
bf389f7183 | ||
|
96433cdf19 | ||
|
128e678815 | ||
|
2ec0acc972 | ||
|
54fac457bf | ||
|
91e069f979 | ||
|
b3c461bd7e | ||
|
135ee0d93f | ||
|
69e10b88b0 | ||
|
7f4e947447 | ||
|
d0d2332193 | ||
|
9beba1ba31 | ||
|
c1446618cf | ||
|
0cd31782d4 | ||
|
cf177905e5 | ||
|
6fef0f1351 | ||
|
9cc8107c6b | ||
|
84377c6175 | ||
|
b4c03b992c | ||
|
a70bcb97bb | ||
|
5114339136 | ||
|
1d3f3e65a0 | ||
|
58db8622bd | ||
|
5ed23e593c | ||
|
dd02b96c94 | ||
|
13156de8c3 | ||
|
a4b8b0f114 | ||
|
611006af18 | ||
|
0163bc05d6 | ||
|
040552fcca | ||
|
2edc25b729 | ||
|
b4001b78b9 | ||
|
d73e15d08f | ||
|
0b8cd09435 | ||
|
313480a09c | ||
|
8f349e84ae | ||
|
ed4c8b27f1 | ||
|
cd54dc84c4 | ||
|
2b876da52d | ||
|
ad9f880d61 | ||
|
8ae063bb1b | ||
|
89d0723ba3 | ||
|
0548c713e8 | ||
|
beb7e5909f | ||
|
6eec7970c1 | ||
|
7bbd3943c9 | ||
|
18c635f474 | ||
|
af78508488 | ||
|
c789238741 | ||
|
83195f0745 | ||
|
c64d2787f8 | ||
|
4658e72b84 | ||
|
e0a26aa62f | ||
|
54b8d0d3c8 | ||
|
75f916db44 | ||
|
16eb97dbc3 | ||
|
2733cce8ff | ||
|
fc92c5cc73 | ||
|
6e0015f022 | ||
|
0c21dd3924 | ||
|
fe05515f43 | ||
|
89627e4cd0 | ||
|
457403586d | ||
|
3f9117ef85 | ||
|
d9f53c78a0 | ||
|
e38740d6ef | ||
|
7341f8b635 | ||
|
7e806a8567 | ||
|
eab31f228f | ||
|
d937b74b8f | ||
|
0e8dace18c | ||
|
b17bed28c8 | ||
|
4eea3175f1 | ||
|
cf458fa7a2 | ||
|
8ac7cab100 | ||
|
0108a6bdeb | ||
|
402189ba14 | ||
|
61ccb034d0 | ||
|
50c694fab4 | ||
|
a18b187494 | ||
|
5668eb0732 | ||
|
56e600d7a1 | ||
|
2ae46fa90a | ||
|
0c0bb28d39 | ||
|
ed98e06651 | ||
|
06289110e7 | ||
|
8443848637 | ||
|
823cc38ac1 | ||
|
5ef4f77fb5 | ||
|
e0ee90d50c | ||
|
171538d01c | ||
|
c21745c886 | ||
|
2db0401a57 | ||
|
9979da59e3 | ||
|
8b1b322771 | ||
|
0ccbddf767 | ||
|
23021422f3 | ||
|
bb3f29d8bc | ||
|
87e6417353 | ||
|
95c7029e19 | ||
|
45368f410a | ||
|
a79b93f5bc | ||
|
4fe88a52fa | ||
|
a5b6a306ae | ||
|
109e3d13ed | ||
|
7af99bce88 | ||
|
d82095d7ea | ||
|
76afd41727 | ||
|
bc625b21b3 | ||
|
adbd52ba27 | ||
|
b9d4875f3e | ||
|
a79c844c4d | ||
|
b13c84f854 | ||
|
b410cff68c | ||
|
4013f733fe | ||
|
cc4c7167fd | ||
|
6c12ffc902 | ||
|
a83d257ac6 | ||
|
ec5cb9c6f7 | ||
|
e7c7ebf665 | ||
|
cc7f0bd532 | ||
|
97ae40496d | ||
|
e4a87b8a1c | ||
|
f18aef4aec | ||
|
1cbd06c8a2 | ||
|
785e68bb0d | ||
|
86e50b1044 | ||
|
eabbb20d17 | ||
|
0153dab346 | ||
|
1a4ffa497a | ||
|
58045a5c07 | ||
|
7d1ae7aea7 | ||
|
174c72f2c0 | ||
|
b9fb45f408 | ||
|
9c4b925a96 | ||
|
394c44ccf9 | ||
|
baf100f78c | ||
|
5be45d214b | ||
|
e309a784d1 | ||
|
99f40ede1b | ||
|
db8e6bed7a | ||
|
6172e2cfcc | ||
|
bc8ff545ca | ||
|
e576bdc894 | ||
|
d78510457c | ||
|
dbdf01d4a0 | ||
|
7ef7beb9fb | ||
|
16e63adc40 | ||
|
e85455719d | ||
|
23ff318f59 | ||
|
0041699048 | ||
|
a5df39e14f | ||
|
4175c9edea | ||
|
1695fd08f0 | ||
|
2c920fbb8b | ||
|
7dd8770e6f | ||
|
9c15e2ff86 | ||
|
7775c87cd6 | ||
|
1047d5646d | ||
|
fa765ee719 | ||
|
50850602b2 | ||
|
553cc8ac96 | ||
|
f2a04a56a4 | ||
|
a8ff81fd8a | ||
|
aab08712dd | ||
|
99784fb8f0 | ||
|
0e7c6e1d82 | ||
|
4e3c990656 | ||
|
e9694cca47 | ||
|
9e0c07b7ba | ||
|
209de7b56d | ||
|
16a8fafab2 | ||
|
6e68d89e0f | ||
|
9c5d9f8614 | ||
|
161065ac19 | ||
|
2053767709 | ||
|
55530dbd14 | ||
|
12f0d8d4ca | ||
|
34f1c298b6 | ||
|
8194f1e2ae | ||
|
a7af3b2c8f | ||
|
6d9d85670f | ||
|
521fa7d005 | ||
|
5759d0fdf2 | ||
|
07db5daa61 | ||
|
201d0a78b1 | ||
|
1f6696d433 | ||
|
59422ec980 | ||
|
fd3813f0d9 | ||
|
25eb8dc277 | ||
|
ebe38eedd8 | ||
|
96c5aea3ba | ||
|
cca61d752d | ||
|
6af51e049f | ||
|
3af1c411ca | ||
|
d3f22b8a04 | ||
|
fd4ea8bc25 | ||
|
d3f3e2d6c5 | ||
|
546c794321 | ||
|
d69796d9e0 | ||
|
4ff8095dee | ||
|
3415f3ccde | ||
|
6770ae0556 | ||
|
bb5581690d | ||
|
57b8be1c24 | ||
|
c93b120252 | ||
|
5cf8587269 | ||
|
b998d4fe01 | ||
|
d0a0e37b2b | ||
|
3f74712540 | ||
|
124bc392ab | ||
|
8c1588b14e | ||
|
58aef89521 | ||
|
f54b4e174d | ||
|
83f57ff0ce | ||
|
71c07feffd | ||
|
9c20737b60 | ||
|
951f02acf3 | ||
|
735bc2d815 | ||
|
a024e61bf8 | ||
|
082fc019c7 | ||
|
ffb699fb06 | ||
|
d318de7c00 | ||
|
68bd6687d6 | ||
|
a3ca7ad93a | ||
|
261f290abf | ||
|
63a191eb8d | ||
|
a6a5fa937c | ||
|
670070e61a | ||
|
3cfc400cf9 | ||
|
6e85924bd3 | ||
|
f7282e86c0 | ||
|
9d0e102135 | ||
|
5b8ff4a2fc | ||
|
c99b7fe7da | ||
|
bd2d571c31 | ||
|
bea59f64b2 | ||
|
00d004a528 | ||
|
53cf4a3b4d | ||
|
7e8c7843c5 | ||
|
5655e26315 | ||
|
0463e196b4 | ||
|
b12c973922 | ||
|
f1397843ee | ||
|
6632cc7c1d | ||
|
45653c5549 | ||
|
f67c7b49ab | ||
|
50b2961d34 | ||
|
d10eff4531 | ||
|
e67ee935a2 | ||
|
41a1374744 | ||
|
c8b01f61d6 | ||
|
3b4eb2f0a0 | ||
|
d20aa0428a | ||
|
1c80e99008 | ||
|
0e12fb869c | ||
|
a55c3f48eb | ||
|
4b7ae4918b | ||
|
763ec6cbcb | ||
|
dcb4d8ee32 | ||
|
58c69a9ac4 | ||
|
7a03ca8dbc | ||
|
d7512f529c | ||
|
209a470a5f | ||
|
1947557eb1 | ||
|
621753e8a8 | ||
|
fca5a4687c | ||
|
5f37d36d4a | ||
|
2656bf8f9f | ||
|
194e22dbbe | ||
|
4883073b91 | ||
|
a17dad4f44 | ||
|
2ce9e8e6b2 | ||
|
b6b57b5249 | ||
|
659157928e | ||
|
933005a022 | ||
|
3be3f58a92 | ||
|
e11a5e3973 | ||
|
96259004be | ||
|
5c54987285 | ||
|
c10bf9ba9c | ||
|
5ae2e376a2 | ||
|
f5f55e3ff8 | ||
|
10017b27bb | ||
|
1de60a4ff7 | ||
|
01ccc56423 | ||
|
305c66db31 |
47
.appveyor.yml
Normal file
47
.appveyor.yml
Normal file
|
@ -0,0 +1,47 @@
|
|||
image:
|
||||
- Visual Studio 2015
|
||||
branches:
|
||||
only:
|
||||
- ci
|
||||
- master
|
||||
- latest
|
||||
- 3.3-stable
|
||||
skip_tags: true
|
||||
environment:
|
||||
matrix:
|
||||
- GENERATOR: MinGW Makefiles
|
||||
BUILD_SHARED_LIBS: ON
|
||||
CFLAGS: -Werror
|
||||
- GENERATOR: MinGW Makefiles
|
||||
BUILD_SHARED_LIBS: OFF
|
||||
CFLAGS: -Werror
|
||||
- GENERATOR: Visual Studio 10 2010
|
||||
BUILD_SHARED_LIBS: ON
|
||||
CFLAGS: /WX
|
||||
- GENERATOR: Visual Studio 10 2010
|
||||
BUILD_SHARED_LIBS: OFF
|
||||
CFLAGS: /WX
|
||||
matrix:
|
||||
fast_finish: true
|
||||
for:
|
||||
-
|
||||
matrix:
|
||||
only:
|
||||
- GENERATOR: MinGW Makefiles
|
||||
build_script:
|
||||
- set PATH=%PATH:C:\Program Files\Git\usr\bin=C:\MinGW\bin%
|
||||
- cmake -S . -B build -G "%GENERATOR%" -DBUILD_SHARED_LIBS=%BUILD_SHARED_LIBS%
|
||||
- cmake --build build
|
||||
-
|
||||
matrix:
|
||||
only:
|
||||
- GENERATOR: Visual Studio 10 2010
|
||||
build_script:
|
||||
- cmake -S . -B build -G "%GENERATOR%" -DBUILD_SHARED_LIBS=%BUILD_SHARED_LIBS%
|
||||
- cmake --build build --target glfw
|
||||
notifications:
|
||||
- provider: Email
|
||||
to:
|
||||
- ci@glfw.org
|
||||
on_build_failure: true
|
||||
on_build_success: false
|
5
.gitattributes
vendored
Normal file
5
.gitattributes
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
*.m linguist-language=Objective-C
|
||||
.gitignore export-ignore
|
||||
.gitattributes export-ignore
|
||||
.travis.yml export-ignore
|
||||
.appveyor.yml export-ignore
|
10
.github/CODEOWNERS
vendored
Normal file
10
.github/CODEOWNERS
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
|
||||
* @elmindreda
|
||||
|
||||
src/wl_* @linkmauve
|
||||
|
||||
docs/*.css @glfw/webdev
|
||||
docs/*.scss @glfw/webdev
|
||||
docs/*.html @glfw/webdev
|
||||
docs/*.xml @glfw/webdev
|
||||
|
94
.github/workflows/build.yml
vendored
Normal file
94
.github/workflows/build.yml
vendored
Normal file
|
@ -0,0 +1,94 @@
|
|||
name: Build
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches: [ ci, master, latest, 3.3-stable ]
|
||||
workflow_dispatch:
|
||||
permissions:
|
||||
statuses: write
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build-linux-x11-clang:
|
||||
name: X11 (Linux, Clang)
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CC: clang
|
||||
CFLAGS: -Werror
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev
|
||||
|
||||
- name: Configure static library
|
||||
run: cmake -S . -B build-static
|
||||
- name: Build static library
|
||||
run: cmake --build build-static --parallel
|
||||
|
||||
- name: Configure shared library
|
||||
run: cmake -S . -B build-shared -D BUILD_SHARED_LIBS=ON
|
||||
- name: Build shared library
|
||||
run: cmake --build build-shared --parallel
|
||||
|
||||
build-linux-full-clang:
|
||||
name: X11+Wayland (Linux, Clang)
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CC: clang
|
||||
CFLAGS: -Werror
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev wayland-protocols libwayland-dev libxkbcommon-dev
|
||||
|
||||
- name: Configure static library
|
||||
run: cmake -S . -B build-static -D GLFW_BUILD_WAYLAND=ON
|
||||
- name: Build static library
|
||||
run: cmake --build build-static --parallel
|
||||
|
||||
- name: Configure shared library
|
||||
run: cmake -S . -B build-shared -D GLFW_BUILD_WAYLAND=ON -D BUILD_SHARED_LIBS=ON
|
||||
- name: Build shared library
|
||||
run: cmake --build build-shared --parallel
|
||||
|
||||
build-macos-cocoa-clang:
|
||||
name: Cocoa (macOS, Clang)
|
||||
runs-on: macos-latest
|
||||
env:
|
||||
CFLAGS: -Werror
|
||||
MACOSX_DEPLOYMENT_TARGET: 10.8
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Configure static library
|
||||
run: cmake -S . -B build-static
|
||||
- name: Build static library
|
||||
run: cmake --build build-static --parallel
|
||||
|
||||
- name: Configure shared library
|
||||
run: cmake -S . -B build-shared -D BUILD_SHARED_LIBS=ON
|
||||
- name: Build shared library
|
||||
run: cmake --build build-shared --parallel
|
||||
|
||||
build-windows-win32-vs2022:
|
||||
name: Win32 (Windows, VS2022)
|
||||
runs-on: windows-latest
|
||||
env:
|
||||
CFLAGS: /WX
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Configure static library
|
||||
run: cmake -S . -B build-static -G "Visual Studio 17 2022"
|
||||
- name: Build static library
|
||||
run: cmake --build build-static --parallel
|
||||
|
||||
- name: Configure shared library
|
||||
run: cmake -S . -B build-shared -G "Visual Studio 17 2022" -D BUILD_SHARED_LIBS=ON
|
||||
- name: Build shared library
|
||||
run: cmake --build build-shared --parallel
|
||||
|
68
.gitignore
vendored
68
.gitignore
vendored
|
@ -1,19 +1,45 @@
|
|||
# External junk
|
||||
.DS_Store
|
||||
# The canonical out-of-tree build subdirectory
|
||||
build
|
||||
|
||||
# Visual Studio clutter
|
||||
_ReSharper*
|
||||
*.opensdf
|
||||
*.sdf
|
||||
*.suo
|
||||
*.dir
|
||||
*.vcxproj*
|
||||
*.sln
|
||||
.vs
|
||||
CMakeSettings.json
|
||||
Win32
|
||||
x64
|
||||
Debug
|
||||
Release
|
||||
MinSizeRel
|
||||
RelWithDebInfo
|
||||
*.opensdf
|
||||
|
||||
# CMake files
|
||||
# Xcode clutter
|
||||
GLFW.build
|
||||
GLFW.xcodeproj
|
||||
|
||||
# macOS clutter
|
||||
.DS_Store
|
||||
|
||||
# Makefile generator clutter
|
||||
Makefile
|
||||
|
||||
# Ninja generator clutter
|
||||
build.ninja
|
||||
rules.ninja
|
||||
.ninja_deps
|
||||
.ninja_log
|
||||
|
||||
# CMake clutter
|
||||
CMakeCache.txt
|
||||
CMakeFiles
|
||||
CMakeScripts
|
||||
CMakeDoxyfile.in
|
||||
CMakeDoxygenDefaults.cmake
|
||||
cmake_install.cmake
|
||||
cmake_uninstall.cmake
|
||||
|
||||
|
@ -21,49 +47,57 @@ cmake_uninstall.cmake
|
|||
docs/Doxyfile
|
||||
docs/html
|
||||
docs/warnings.txt
|
||||
src/config.h
|
||||
docs/doxygen_sqlite3.db
|
||||
src/glfw_config.h
|
||||
src/glfw3.pc
|
||||
src/glfwConfig.cmake
|
||||
src/glfwConfigVersion.cmake
|
||||
src/glfw3Config.cmake
|
||||
src/glfw3ConfigVersion.cmake
|
||||
|
||||
# Compiled binaries
|
||||
src/libglfw.so
|
||||
src/libglfw.so.3
|
||||
src/libglfw.so.3.0
|
||||
src/libglfw.so.3.4
|
||||
src/libglfw.dylib
|
||||
src/libglfw.dylib
|
||||
src/libglfw.3.dylib
|
||||
src/libglfw.3.0.dylib
|
||||
src/libglfw.3.4.dylib
|
||||
src/libglfw3.a
|
||||
src/glfw3.lib
|
||||
src/glfw3.dll
|
||||
src/glfw3dll.lib
|
||||
src/libglfw3dll.a
|
||||
examples/*.app
|
||||
examples/*.exe
|
||||
examples/boing
|
||||
examples/gears
|
||||
examples/heightmap
|
||||
examples/offscreen
|
||||
examples/particles
|
||||
examples/splitview
|
||||
examples/simple
|
||||
examples/sharing
|
||||
examples/triangle-opengl
|
||||
examples/wave
|
||||
examples/windows
|
||||
tests/*.app
|
||||
tests/*.exe
|
||||
tests/accuracy
|
||||
tests/clipboard
|
||||
tests/defaults
|
||||
tests/cursor
|
||||
tests/empty
|
||||
tests/events
|
||||
tests/fsaa
|
||||
tests/gamma
|
||||
tests/glfwinfo
|
||||
tests/icon
|
||||
tests/iconify
|
||||
tests/inputlag
|
||||
tests/joysticks
|
||||
tests/modes
|
||||
tests/peter
|
||||
tests/monitors
|
||||
tests/msaa
|
||||
tests/reopen
|
||||
tests/sharing
|
||||
tests/tearing
|
||||
tests/threads
|
||||
tests/timeout
|
||||
tests/title
|
||||
tests/version
|
||||
tests/triangle-vulkan
|
||||
tests/window
|
||||
tests/windows
|
||||
|
||||
|
|
10
.mailmap
Normal file
10
.mailmap
Normal file
|
@ -0,0 +1,10 @@
|
|||
Camilla Löwy <elmindreda@glfw.org> <elmindreda@users.sourceforge.net>
|
||||
Camilla Löwy <elmindreda@glfw.org> <elmindreda@elmindreda.org>
|
||||
Camilla Löwy <elmindreda@glfw.org>
|
||||
|
||||
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
|
||||
|
||||
Marcus Geelnard <m@bitsnbites.eu> <marcus256@users.sourceforge.net>
|
||||
Marcus Geelnard <m@bitsnbites.eu> <marcus@geelnards-pc.(none)>
|
||||
Marcus Geelnard <m@bitsnbites.eu>
|
||||
|
48
CMake/GenerateMappings.cmake
Normal file
48
CMake/GenerateMappings.cmake
Normal file
|
@ -0,0 +1,48 @@
|
|||
# Usage:
|
||||
# cmake -P GenerateMappings.cmake <path/to/mappings.h.in> <path/to/mappings.h>
|
||||
|
||||
set(source_url "https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt")
|
||||
set(source_path "${CMAKE_CURRENT_BINARY_DIR}/gamecontrollerdb.txt")
|
||||
set(template_path "${CMAKE_ARGV3}")
|
||||
set(target_path "${CMAKE_ARGV4}")
|
||||
|
||||
if (NOT EXISTS "${template_path}")
|
||||
message(FATAL_ERROR "Failed to find template file ${template_path}")
|
||||
endif()
|
||||
|
||||
file(DOWNLOAD "${source_url}" "${source_path}"
|
||||
STATUS download_status
|
||||
TLS_VERIFY on)
|
||||
|
||||
list(GET download_status 0 status_code)
|
||||
list(GET download_status 1 status_message)
|
||||
|
||||
if (status_code)
|
||||
message(FATAL_ERROR "Failed to download ${source_url}: ${status_message}")
|
||||
endif()
|
||||
|
||||
file(STRINGS "${source_path}" lines)
|
||||
foreach(line ${lines})
|
||||
if (line MATCHES "^[0-9a-fA-F]")
|
||||
if (line MATCHES "platform:Windows")
|
||||
if (GLFW_WIN32_MAPPINGS)
|
||||
string(APPEND GLFW_WIN32_MAPPINGS "\n")
|
||||
endif()
|
||||
string(APPEND GLFW_WIN32_MAPPINGS "\"${line}\",")
|
||||
elseif (line MATCHES "platform:Mac OS X")
|
||||
if (GLFW_COCOA_MAPPINGS)
|
||||
string(APPEND GLFW_COCOA_MAPPINGS "\n")
|
||||
endif()
|
||||
string(APPEND GLFW_COCOA_MAPPINGS "\"${line}\",")
|
||||
elseif (line MATCHES "platform:Linux")
|
||||
if (GLFW_LINUX_MAPPINGS)
|
||||
string(APPEND GLFW_LINUX_MAPPINGS "\n")
|
||||
endif()
|
||||
string(APPEND GLFW_LINUX_MAPPINGS "\"${line}\",")
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
configure_file("${template_path}" "${target_path}" @ONLY NEWLINE_STYLE UNIX)
|
||||
file(REMOVE "${source_path}")
|
||||
|
38
CMake/Info.plist.in
Normal file
38
CMake/Info.plist.in
Normal file
|
@ -0,0 +1,38 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>${MACOSX_BUNDLE_INFO_STRING}</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>${MACOSX_BUNDLE_ICON_FILE}</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleLongVersionString</key>
|
||||
<string>${MACOSX_BUNDLE_LONG_VERSION_STRING}</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
|
||||
<key>CSResourcesFileMapped</key>
|
||||
<true/>
|
||||
<key>LSRequiresCarbon</key>
|
||||
<true/>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>${MACOSX_BUNDLE_COPYRIGHT}</string>
|
||||
<key>NSHighResolutionCapable</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
|
@ -1,18 +0,0 @@
|
|||
This directory contains a collection of toolchain definitions for
|
||||
cross-compiling for Windows using MinGW on various other systems.
|
||||
|
||||
To use these files you add a special parameter when configuring the source tree:
|
||||
|
||||
cmake -DCMAKE_TOOLCHAIN_FILE=<toolchain-file> .
|
||||
|
||||
The exact file to use depends on the prefix used by the MinGW binaries on your
|
||||
system. You can usually see this in the /usr directory, i.e. the Ubuntu
|
||||
MinGW-w64 packages have /usr/x86_64-w64-mingw32 for the 64-bit compilers, so the
|
||||
correct invocation would be:
|
||||
|
||||
cmake -DCMAKE_TOOLCHAIN_FILE=CMake/x86_64-w64-mingw32.cmake .
|
||||
|
||||
For more details see this article:
|
||||
|
||||
http://www.paraview.org/Wiki/CMake_Cross_Compiling
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
# Define the environment for cross compiling from Linux to Win64
|
||||
SET(CMAKE_SYSTEM_NAME Windows)
|
||||
SET(CMAKE_SYSTEM_VERSION 1)
|
||||
SET(CMAKE_C_COMPILER "amd64-mingw32msvc-gcc")
|
||||
SET(CMAKE_CXX_COMPILER "amd64-mingw32msvc-g++")
|
||||
SET(CMAKE_RC_COMPILER "amd64-mingw32msvc-windres")
|
||||
SET(CMAKE_RANLIB "amd64-mingw32msvc-ranlib")
|
||||
|
||||
# Configure the behaviour of the find commands
|
||||
SET(CMAKE_FIND_ROOT_PATH "/usr/amd64-mingw32msvc")
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
|
@ -1,9 +1,9 @@
|
|||
|
||||
if (NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
|
||||
message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
|
||||
if (NOT EXISTS "@GLFW_BINARY_DIR@/install_manifest.txt")
|
||||
message(FATAL_ERROR "Cannot find install manifest: \"@GLFW_BINARY_DIR@/install_manifest.txt\"")
|
||||
endif()
|
||||
|
||||
file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
|
||||
file(READ "@GLFW_BINARY_DIR@/install_manifest.txt" files)
|
||||
string(REGEX REPLACE "\n" ";" files "${files}")
|
||||
|
||||
foreach (file ${files})
|
13
CMake/glfw3.pc.in
Normal file
13
CMake/glfw3.pc.in
Normal file
|
@ -0,0 +1,13 @@
|
|||
prefix=@CMAKE_INSTALL_PREFIX@
|
||||
exec_prefix=${prefix}
|
||||
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
|
||||
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
|
||||
|
||||
Name: GLFW
|
||||
Description: A multi-platform library for OpenGL, window and input
|
||||
Version: @GLFW_VERSION@
|
||||
URL: https://www.glfw.org/
|
||||
Requires.private: @GLFW_PKG_CONFIG_REQUIRES_PRIVATE@
|
||||
Libs: -L${libdir} -l@GLFW_LIB_NAME@
|
||||
Libs.private: @GLFW_PKG_CONFIG_LIBS_PRIVATE@
|
||||
Cflags: -I${includedir}
|
3
CMake/glfw3Config.cmake.in
Normal file
3
CMake/glfw3Config.cmake.in
Normal file
|
@ -0,0 +1,3 @@
|
|||
include(CMakeFindDependencyMacro)
|
||||
find_dependency(Threads)
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/glfw3Targets.cmake")
|
|
@ -1,13 +0,0 @@
|
|||
# Define the environment for cross compiling from Linux to Win32
|
||||
SET(CMAKE_SYSTEM_NAME Windows)
|
||||
SET(CMAKE_SYSTEM_VERSION 1)
|
||||
SET(CMAKE_C_COMPILER "i586-mingw32msvc-gcc")
|
||||
SET(CMAKE_CXX_COMPILER "i586-mingw32msvc-g++")
|
||||
SET(CMAKE_RC_COMPILER "i586-mingw32msvc-windres")
|
||||
SET(CMAKE_RANLIB "i586-mingw32msvc-ranlib")
|
||||
|
||||
# Configure the behaviour of the find commands
|
||||
SET(CMAKE_FIND_ROOT_PATH "/usr/i586-mingw32msvc")
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
|
@ -1,13 +0,0 @@
|
|||
# Define the environment for cross compiling from Linux to Win32
|
||||
SET(CMAKE_SYSTEM_NAME Windows) # Target system name
|
||||
SET(CMAKE_SYSTEM_VERSION 1)
|
||||
SET(CMAKE_C_COMPILER "i686-pc-mingw32-gcc")
|
||||
SET(CMAKE_CXX_COMPILER "i686-pc-mingw32-g++")
|
||||
SET(CMAKE_RC_COMPILER "i686-pc-mingw32-windres")
|
||||
SET(CMAKE_RANLIB "i686-pc-mingw32-ranlib")
|
||||
|
||||
#Configure the behaviour of the find commands
|
||||
SET(CMAKE_FIND_ROOT_PATH "/opt/mingw/usr/i686-pc-mingw32")
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
13
CMake/i686-w64-mingw32-clang.cmake
Normal file
13
CMake/i686-w64-mingw32-clang.cmake
Normal file
|
@ -0,0 +1,13 @@
|
|||
# Define the environment for cross-compiling with 32-bit MinGW-w64 Clang
|
||||
SET(CMAKE_SYSTEM_NAME Windows) # Target system name
|
||||
SET(CMAKE_SYSTEM_VERSION 1)
|
||||
SET(CMAKE_C_COMPILER "i686-w64-mingw32-clang")
|
||||
SET(CMAKE_CXX_COMPILER "i686-w64-mingw32-clang++")
|
||||
SET(CMAKE_RC_COMPILER "i686-w64-mingw32-windres")
|
||||
SET(CMAKE_RANLIB "i686-w64-mingw32-ranlib")
|
||||
|
||||
# Configure the behaviour of the find commands
|
||||
SET(CMAKE_FIND_ROOT_PATH "/usr/i686-w64-mingw32")
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
|
@ -1,4 +1,4 @@
|
|||
# Define the environment for cross compiling from Linux to Win32
|
||||
# Define the environment for cross-compiling with 32-bit MinGW-w64 GCC
|
||||
SET(CMAKE_SYSTEM_NAME Windows) # Target system name
|
||||
SET(CMAKE_SYSTEM_VERSION 1)
|
||||
SET(CMAKE_C_COMPILER "i686-w64-mingw32-gcc")
|
||||
|
@ -6,7 +6,7 @@ SET(CMAKE_CXX_COMPILER "i686-w64-mingw32-g++")
|
|||
SET(CMAKE_RC_COMPILER "i686-w64-mingw32-windres")
|
||||
SET(CMAKE_RANLIB "i686-w64-mingw32-ranlib")
|
||||
|
||||
# Configure the behaviour of the find commands
|
||||
# Configure the behaviour of the find commands
|
||||
SET(CMAKE_FIND_ROOT_PATH "/usr/i686-w64-mingw32")
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
# Find EGL
|
||||
#
|
||||
# EGL_INCLUDE_DIR
|
||||
# EGL_LIBRARY
|
||||
# EGL_FOUND
|
||||
|
||||
find_path(EGL_INCLUDE_DIR NAMES EGL/egl.h)
|
||||
|
||||
set(EGL_NAMES ${EGL_NAMES} egl EGL)
|
||||
find_library(EGL_LIBRARY NAMES ${EGL_NAMES})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(EGL DEFAULT_MSG EGL_LIBRARY EGL_INCLUDE_DIR)
|
||||
|
||||
mark_as_advanced(EGL_INCLUDE_DIR EGL_LIBRARY)
|
||||
|
17
CMake/modules/FindEpollShim.cmake
Normal file
17
CMake/modules/FindEpollShim.cmake
Normal file
|
@ -0,0 +1,17 @@
|
|||
# Find EpollShim
|
||||
# Once done, this will define
|
||||
#
|
||||
# EPOLLSHIM_FOUND - System has EpollShim
|
||||
# EPOLLSHIM_INCLUDE_DIRS - The EpollShim include directories
|
||||
# EPOLLSHIM_LIBRARIES - The libraries needed to use EpollShim
|
||||
|
||||
find_path(EPOLLSHIM_INCLUDE_DIRS NAMES sys/epoll.h sys/timerfd.h HINTS /usr/local/include/libepoll-shim)
|
||||
find_library(EPOLLSHIM_LIBRARIES NAMES epoll-shim libepoll-shim HINTS /usr/local/lib)
|
||||
|
||||
if (EPOLLSHIM_INCLUDE_DIRS AND EPOLLSHIM_LIBRARIES)
|
||||
set(EPOLLSHIM_FOUND TRUE)
|
||||
endif (EPOLLSHIM_INCLUDE_DIRS AND EPOLLSHIM_LIBRARIES)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(EpollShim DEFAULT_MSG EPOLLSHIM_LIBRARIES EPOLLSHIM_INCLUDE_DIRS)
|
||||
mark_as_advanced(EPOLLSHIM_INCLUDE_DIRS EPOLLSHIM_LIBRARIES)
|
|
@ -1,16 +0,0 @@
|
|||
# Find GLESv1
|
||||
#
|
||||
# GLESv1_INCLUDE_DIR
|
||||
# GLESv1_LIBRARY
|
||||
# GLESv1_FOUND
|
||||
|
||||
find_path(GLESv1_INCLUDE_DIR NAMES GLES/gl.h)
|
||||
|
||||
set(GLESv1_NAMES ${GLESv1_NAMES} GLESv1_CM)
|
||||
find_library(GLESv1_LIBRARY NAMES ${GLESv1_NAMES})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(GLESv1 DEFAULT_MSG GLESv1_LIBRARY GLESv1_INCLUDE_DIR)
|
||||
|
||||
mark_as_advanced(GLESv1_INCLUDE_DIR GLESv1_LIBRARY)
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
# Find GLESv2
|
||||
#
|
||||
# GLESv2_INCLUDE_DIR
|
||||
# GLESv2_LIBRARY
|
||||
# GLESv2_FOUND
|
||||
|
||||
find_path(GLESv2_INCLUDE_DIR NAMES GLES2/gl2.h)
|
||||
|
||||
set(GLESv2_NAMES ${GLESv2_NAMES} GLESv2)
|
||||
find_library(GLESv2_LIBRARY NAMES ${GLESv2_NAMES})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(GLESv2 DEFAULT_MSG GLESv2_LIBRARY GLESv2_INCLUDE_DIR)
|
||||
|
||||
mark_as_advanced(GLESv2_INCLUDE_DIR GLESv2_LIBRARY)
|
||||
|
18
CMake/modules/FindOSMesa.cmake
Normal file
18
CMake/modules/FindOSMesa.cmake
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Try to find OSMesa on a Unix system
|
||||
#
|
||||
# This will define:
|
||||
#
|
||||
# OSMESA_LIBRARIES - Link these to use OSMesa
|
||||
# OSMESA_INCLUDE_DIR - Include directory for OSMesa
|
||||
#
|
||||
# Copyright (c) 2014 Brandon Schaefer <brandon.schaefer@canonical.com>
|
||||
|
||||
if (NOT WIN32)
|
||||
|
||||
find_package (PkgConfig)
|
||||
pkg_check_modules (PKG_OSMESA QUIET osmesa)
|
||||
|
||||
set (OSMESA_INCLUDE_DIR ${PKG_OSMESA_INCLUDE_DIRS})
|
||||
set (OSMESA_LIBRARIES ${PKG_OSMESA_LIBRARIES})
|
||||
|
||||
endif ()
|
13
CMake/x86_64-w64-mingw32-clang.cmake
Normal file
13
CMake/x86_64-w64-mingw32-clang.cmake
Normal file
|
@ -0,0 +1,13 @@
|
|||
# Define the environment for cross-compiling with 64-bit MinGW-w64 Clang
|
||||
SET(CMAKE_SYSTEM_NAME Windows) # Target system name
|
||||
SET(CMAKE_SYSTEM_VERSION 1)
|
||||
SET(CMAKE_C_COMPILER "x86_64-w64-mingw32-clang")
|
||||
SET(CMAKE_CXX_COMPILER "x86_64-w64-mingw32-clang++")
|
||||
SET(CMAKE_RC_COMPILER "x86_64-w64-mingw32-windres")
|
||||
SET(CMAKE_RANLIB "x86_64-w64-mingw32-ranlib")
|
||||
|
||||
# Configure the behaviour of the find commands
|
||||
SET(CMAKE_FIND_ROOT_PATH "/usr/x86_64-w64-mingw32")
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
|
@ -1,4 +1,4 @@
|
|||
# Define the environment for cross compiling from Linux to Win32
|
||||
# Define the environment for cross-compiling with 64-bit MinGW-w64 GCC
|
||||
SET(CMAKE_SYSTEM_NAME Windows) # Target system name
|
||||
SET(CMAKE_SYSTEM_VERSION 1)
|
||||
SET(CMAKE_C_COMPILER "x86_64-w64-mingw32-gcc")
|
||||
|
@ -6,7 +6,7 @@ SET(CMAKE_CXX_COMPILER "x86_64-w64-mingw32-g++")
|
|||
SET(CMAKE_RC_COMPILER "x86_64-w64-mingw32-windres")
|
||||
SET(CMAKE_RANLIB "x86_64-w64-mingw32-ranlib")
|
||||
|
||||
# Configure the behaviour of the find commands
|
||||
# Configure the behaviour of the find commands
|
||||
SET(CMAKE_FIND_ROOT_PATH "/usr/x86_64-w64-mingw32")
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
|
|
478
CMakeLists.txt
478
CMakeLists.txt
|
@ -1,368 +1,121 @@
|
|||
project(GLFW C)
|
||||
cmake_minimum_required(VERSION 3.4...3.20 FATAL_ERROR)
|
||||
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
project(GLFW VERSION 3.4.0 LANGUAGES C)
|
||||
|
||||
set(GLFW_VERSION_MAJOR "3")
|
||||
set(GLFW_VERSION_MINOR "0")
|
||||
set(GLFW_VERSION_PATCH "1")
|
||||
set(GLFW_VERSION_EXTRA "")
|
||||
set(GLFW_VERSION "${GLFW_VERSION_MAJOR}.${GLFW_VERSION_MINOR}")
|
||||
set(GLFW_VERSION_FULL "${GLFW_VERSION}.${GLFW_VERSION_PATCH}${GLFW_VERSION_EXTRA}")
|
||||
set(LIB_SUFFIX "" CACHE STRING "Takes an empty string or 64. Directory where lib will be installed: lib or lib64")
|
||||
if (POLICY CMP0069)
|
||||
cmake_policy(SET CMP0069 NEW)
|
||||
endif()
|
||||
|
||||
if (POLICY CMP0077)
|
||||
cmake_policy(SET CMP0077 NEW)
|
||||
endif()
|
||||
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
||||
string(COMPARE EQUAL "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_SOURCE_DIR}" GLFW_STANDALONE)
|
||||
|
||||
option(GLFW_BUILD_EXAMPLES "Build the GLFW example programs" ON)
|
||||
option(GLFW_BUILD_TESTS "Build the GLFW test programs" ON)
|
||||
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
|
||||
option(GLFW_BUILD_EXAMPLES "Build the GLFW example programs" ${GLFW_STANDALONE})
|
||||
option(GLFW_BUILD_TESTS "Build the GLFW test programs" ${GLFW_STANDALONE})
|
||||
option(GLFW_BUILD_DOCS "Build the GLFW documentation" ON)
|
||||
option(GLFW_INSTALL "Generate installation target" ON)
|
||||
|
||||
set(DOXYGEN_SKIP_DOT TRUE)
|
||||
find_package(Doxygen)
|
||||
include(GNUInstallDirs)
|
||||
include(CMakeDependentOption)
|
||||
|
||||
option(GLFW_DOCUMENT_INTERNALS "Include internals in documentation" OFF)
|
||||
if (GLFW_DOCUMENT_INTERNALS)
|
||||
set(GLFW_INTERNAL_DOCS "${GLFW_SOURCE_DIR}/src/internal.h ${GLFW_SOURCE_DIR}/docs/internal.dox")
|
||||
if (GLFW_USE_OSMESA)
|
||||
message(FATAL_ERROR "GLFW_USE_OSMESA has been removed; set the GLFW_PLATFORM init hint")
|
||||
endif()
|
||||
|
||||
if (APPLE)
|
||||
option(GLFW_USE_CHDIR "Make glfwInit chdir to Contents/Resources" ON)
|
||||
option(GLFW_USE_MENUBAR "Populate the menu bar on first window creation" ON)
|
||||
else()
|
||||
option(GLFW_USE_EGL "Use EGL for context creation" OFF)
|
||||
endif()
|
||||
cmake_dependent_option(GLFW_BUILD_WIN32 "Build support for Win32" ON "WIN32" OFF)
|
||||
cmake_dependent_option(GLFW_BUILD_COCOA "Build support for Cocoa" ON "APPLE" OFF)
|
||||
cmake_dependent_option(GLFW_BUILD_X11 "Build support for X11" ON "UNIX;NOT APPLE" OFF)
|
||||
cmake_dependent_option(GLFW_BUILD_WAYLAND "Build support for Wayland"
|
||||
"${GLFW_USE_WAYLAND}" "UNIX;NOT APPLE" OFF)
|
||||
|
||||
if (GLFW_USE_EGL)
|
||||
set(GLFW_CLIENT_LIBRARY "opengl" CACHE STRING
|
||||
"The client library to use; one of opengl, glesv1 or glesv2")
|
||||
cmake_dependent_option(GLFW_USE_HYBRID_HPG "Force use of high-performance GPU on hybrid systems" OFF
|
||||
"WIN32" OFF)
|
||||
cmake_dependent_option(USE_MSVC_RUNTIME_LIBRARY_DLL "Use MSVC runtime library DLL" ON
|
||||
"MSVC" OFF)
|
||||
|
||||
if (${GLFW_CLIENT_LIBRARY} STREQUAL "opengl")
|
||||
set(_GLFW_USE_OPENGL 1)
|
||||
elseif (${GLFW_CLIENT_LIBRARY} STREQUAL "glesv1")
|
||||
set(_GLFW_USE_GLESV1 1)
|
||||
elseif (${GLFW_CLIENT_LIBRARY} STREQUAL "glesv2")
|
||||
set(_GLFW_USE_GLESV2 1)
|
||||
set(GLFW_LIBRARY_TYPE "${GLFW_LIBRARY_TYPE}" CACHE STRING
|
||||
"Library type override for GLFW (SHARED, STATIC, OBJECT, or empty to follow BUILD_SHARED_LIBS)")
|
||||
|
||||
if (GLFW_LIBRARY_TYPE)
|
||||
if (GLFW_LIBRARY_TYPE STREQUAL "SHARED")
|
||||
set(GLFW_BUILD_SHARED_LIBRARY TRUE)
|
||||
else()
|
||||
message(FATAL_ERROR "Unsupported client library")
|
||||
endif()
|
||||
|
||||
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMake/modules)
|
||||
find_package(EGL REQUIRED)
|
||||
|
||||
if (NOT _GLFW_USE_OPENGL)
|
||||
set(GLFW_BUILD_EXAMPLES OFF)
|
||||
set(GLFW_BUILD_TESTS OFF)
|
||||
message(STATUS "NOTE: Examples and tests require OpenGL")
|
||||
set(GLFW_BUILD_SHARED_LIBRARY FALSE)
|
||||
endif()
|
||||
else()
|
||||
set(_GLFW_USE_OPENGL 1)
|
||||
set(GLFW_BUILD_SHARED_LIBRARY ${BUILD_SHARED_LIBS})
|
||||
endif()
|
||||
|
||||
if (_GLFW_USE_OPENGL)
|
||||
find_package(OpenGL REQUIRED)
|
||||
elseif (_GLFW_USE_GLESV1)
|
||||
find_package(GLESv1 REQUIRED)
|
||||
elseif (_GLFW_USE_GLESV2)
|
||||
find_package(GLESv2 REQUIRED)
|
||||
endif()
|
||||
list(APPEND CMAKE_MODULE_PATH "${GLFW_SOURCE_DIR}/CMake/modules")
|
||||
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Enable all warnings on GCC, regardless of OS
|
||||
#--------------------------------------------------------------------
|
||||
if (CMAKE_COMPILER_IS_GNUCC)
|
||||
add_definitions(-Wall)
|
||||
if (GLFW_BUILD_DOCS)
|
||||
set(DOXYGEN_SKIP_DOT TRUE)
|
||||
find_package(Doxygen)
|
||||
endif()
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Export shared library / dynamic library / DLL build option
|
||||
# Report backend selection
|
||||
#--------------------------------------------------------------------
|
||||
if (BUILD_SHARED_LIBS)
|
||||
set(_GLFW_BUILD_DLL 1)
|
||||
if (UNIX)
|
||||
add_definitions(-fvisibility=hidden)
|
||||
endif()
|
||||
if (GLFW_BUILD_WIN32)
|
||||
message(STATUS "Including Win32 support")
|
||||
endif()
|
||||
if (GLFW_BUILD_COCOA)
|
||||
message(STATUS "Including Cocoa support")
|
||||
endif()
|
||||
if (GLFW_BUILD_WAYLAND)
|
||||
message(STATUS "Including Wayland support")
|
||||
endif()
|
||||
if (GLFW_BUILD_X11)
|
||||
message(STATUS "Including X11 support")
|
||||
endif()
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Detect and select backend APIs
|
||||
# Apply Microsoft C runtime library option
|
||||
# This is here because it also applies to tests and examples
|
||||
#--------------------------------------------------------------------
|
||||
if (WIN32)
|
||||
set(_GLFW_WIN32 1)
|
||||
message(STATUS "Using Win32 for window creation")
|
||||
if (MSVC AND NOT USE_MSVC_RUNTIME_LIBRARY_DLL)
|
||||
if (CMAKE_VERSION VERSION_LESS 3.15)
|
||||
foreach (flag CMAKE_C_FLAGS
|
||||
CMAKE_C_FLAGS_DEBUG
|
||||
CMAKE_C_FLAGS_RELEASE
|
||||
CMAKE_C_FLAGS_MINSIZEREL
|
||||
CMAKE_C_FLAGS_RELWITHDEBINFO)
|
||||
|
||||
if (GLFW_USE_EGL)
|
||||
set(_GLFW_EGL 1)
|
||||
message(STATUS "Using EGL for context creation")
|
||||
if (flag MATCHES "/MD")
|
||||
string(REGEX REPLACE "/MD" "/MT" ${flag} "${${flag}}")
|
||||
endif()
|
||||
if (flag MATCHES "/MDd")
|
||||
string(REGEX REPLACE "/MDd" "/MTd" ${flag} "${${flag}}")
|
||||
endif()
|
||||
|
||||
endforeach()
|
||||
else()
|
||||
set(_GLFW_WGL 1)
|
||||
message(STATUS "Using WGL for context creation")
|
||||
endif()
|
||||
elseif (APPLE)
|
||||
set(_GLFW_COCOA 1)
|
||||
message(STATUS "Using Cocoa for window creation")
|
||||
set(_GLFW_NSGL 1)
|
||||
message(STATUS "Using NSGL for context creation")
|
||||
elseif (UNIX)
|
||||
set(_GLFW_X11 1)
|
||||
message(STATUS "Using X11 for window creation")
|
||||
|
||||
if (GLFW_USE_EGL)
|
||||
set(_GLFW_EGL 1)
|
||||
message(STATUS "Using EGL for context creation")
|
||||
else()
|
||||
set(_GLFW_GLX 1)
|
||||
message(STATUS "Using GLX for context creation")
|
||||
endif()
|
||||
else()
|
||||
message(FATAL_ERROR "No supported platform was detected")
|
||||
endif()
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Use Win32 for window creation
|
||||
#--------------------------------------------------------------------
|
||||
if (_GLFW_WIN32)
|
||||
|
||||
if (MSVC)
|
||||
option(USE_MSVC_RUNTIME_LIBRARY_DLL "Use MSVC runtime library DLL" ON)
|
||||
|
||||
if (NOT USE_MSVC_RUNTIME_LIBRARY_DLL)
|
||||
foreach (flag CMAKE_C_FLAGS
|
||||
CMAKE_C_FLAGS_DEBUG
|
||||
CMAKE_C_FLAGS_RELEASE
|
||||
CMAKE_C_FLAGS_MINSIZEREL
|
||||
CMAKE_C_FLAGS_RELWITHDEBINFO)
|
||||
|
||||
if (${flag} MATCHES "/MD")
|
||||
string(REGEX REPLACE "/MD" "/MT" ${flag} "${${flag}}")
|
||||
endif()
|
||||
if (${flag} MATCHES "/MDd")
|
||||
string(REGEX REPLACE "/MDd" "/MTd" ${flag} "${${flag}}")
|
||||
endif()
|
||||
|
||||
endforeach()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(_GLFW_NO_DLOAD_WINMM ${BUILD_SHARED_LIBS})
|
||||
|
||||
if (BUILD_SHARED_LIBS)
|
||||
list(APPEND glfw_LIBRARIES winmm)
|
||||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Use WGL for context creation
|
||||
# Create generated files
|
||||
#--------------------------------------------------------------------
|
||||
if (_GLFW_WGL)
|
||||
list(APPEND glfw_INCLUDE_DIRS ${OPENGL_INCLUDE_DIR})
|
||||
list(APPEND glfw_LIBRARIES ${OPENGL_gl_LIBRARY})
|
||||
endif()
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Use X11 for window creation
|
||||
#--------------------------------------------------------------------
|
||||
if (_GLFW_X11)
|
||||
set(GLFW_CONFIG_PATH "${CMAKE_INSTALL_LIBDIR}/cmake/glfw3")
|
||||
|
||||
find_package(X11 REQUIRED)
|
||||
configure_package_config_file(CMake/glfw3Config.cmake.in
|
||||
src/glfw3Config.cmake
|
||||
INSTALL_DESTINATION "${GLFW_CONFIG_PATH}"
|
||||
NO_CHECK_REQUIRED_COMPONENTS_MACRO)
|
||||
|
||||
set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} x11")
|
||||
|
||||
# Set up library and include paths
|
||||
list(APPEND glfw_INCLUDE_DIRS ${X11_X11_INCLUDE_PATH})
|
||||
list(APPEND glfw_LIBRARIES ${X11_X11_LIB} ${CMAKE_THREAD_LIBS_INIT})
|
||||
if (UNIX AND NOT APPLE)
|
||||
list(APPEND glfw_LIBRARIES ${RT_LIBRARY})
|
||||
endif()
|
||||
|
||||
# Check for XRandR (modern resolution switching and gamma control)
|
||||
if (NOT X11_Xrandr_FOUND)
|
||||
message(FATAL_ERROR "The RandR library and headers were not found")
|
||||
endif()
|
||||
|
||||
list(APPEND glfw_INCLUDE_DIRS ${X11_Xrandr_INCLUDE_PATH})
|
||||
list(APPEND glfw_LIBRARIES ${X11_Xrandr_LIB})
|
||||
set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} xrandr")
|
||||
|
||||
# Check for XInput (high-resolution cursor motion)
|
||||
if (NOT X11_Xinput_FOUND)
|
||||
message(FATAL_ERROR "The XInput library and headers were not found")
|
||||
endif()
|
||||
|
||||
list(APPEND glfw_INCLUDE_DIRS ${X11_Xinput_INCLUDE_PATH})
|
||||
list(APPEND glfw_LIBRARIES ${X11_Xinput_LIB})
|
||||
set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} xi")
|
||||
|
||||
# Check for Xf86VidMode (fallback gamma control)
|
||||
if (NOT X11_xf86vmode_FOUND)
|
||||
message(FATAL_ERROR "The Xf86VidMode library and headers were not found")
|
||||
endif()
|
||||
|
||||
list(APPEND glfw_INCLUDE_DIRS ${X11_xf86vmode_INCLUDE_PATH})
|
||||
set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} xxf86vm")
|
||||
|
||||
if (X11_Xxf86vm_LIB)
|
||||
list(APPEND glfw_LIBRARIES ${X11_Xxf86vm_LIB})
|
||||
else()
|
||||
# Backwards compatibility (see CMake bug 0006976)
|
||||
list(APPEND glfw_LIBRARIES Xxf86vm)
|
||||
endif()
|
||||
|
||||
# Check for Xkb (X keyboard extension)
|
||||
if (NOT X11_Xkb_FOUND)
|
||||
message(FATAL_ERROR "The X keyboard extension headers were not found")
|
||||
endif()
|
||||
|
||||
list(APPEND glfw_INCLUDE_DIR ${X11_Xkb_INCLUDE_PATH})
|
||||
|
||||
find_library(RT_LIBRARY rt)
|
||||
mark_as_advanced(RT_LIBRARY)
|
||||
if (RT_LIBRARY)
|
||||
list(APPEND glfw_LIBRARIES ${RT_LIBRARY})
|
||||
set(GLFW_PKG_LIBS "${GLFW_PKG_LIBS} -lrt")
|
||||
endif()
|
||||
|
||||
find_library(MATH_LIBRARY m)
|
||||
mark_as_advanced(MATH_LIBRARY)
|
||||
if (MATH_LIBRARY)
|
||||
list(APPEND glfw_LIBRARIES ${MATH_LIBRARY})
|
||||
set(GLFW_PKG_LIBS "${GLFW_PKG_LIBS} -lm")
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Use GLX for context creation
|
||||
#--------------------------------------------------------------------
|
||||
if (_GLFW_GLX)
|
||||
|
||||
list(APPEND glfw_INCLUDE_DIRS ${OPENGL_INCLUDE_DIR})
|
||||
list(APPEND glfw_LIBRARIES ${OPENGL_gl_LIBRARY})
|
||||
|
||||
set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} gl")
|
||||
|
||||
include(CheckFunctionExists)
|
||||
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${OPENGL_gl_LIBRARY})
|
||||
|
||||
check_function_exists(glXGetProcAddress _GLFW_HAS_GLXGETPROCADDRESS)
|
||||
|
||||
if (NOT _GLFW_HAS_GLXGETPROCADDRESS)
|
||||
check_function_exists(glXGetProcAddressARB _GLFW_HAS_GLXGETPROCADDRESSARB)
|
||||
endif()
|
||||
|
||||
if (NOT _GLFW_HAS_GLXGETPROCADDRESS AND NOT _GLFW_HAS_GLXGETPROCADDRESSARB)
|
||||
check_function_exists(glXGetProcAddressEXT _GLFW_HAS_GLXGETPROCADDRESSEXT)
|
||||
endif()
|
||||
|
||||
if (NOT _GLFW_HAS_GLXGETPROCADDRESS AND
|
||||
NOT _GLFW_HAS_GLXGETPROCADDRESSARB AND
|
||||
NOT _GLFW_HAS_GLXGETPROCADDRESSEXT)
|
||||
message(WARNING "No glXGetProcAddressXXX variant found")
|
||||
|
||||
# Check for dlopen support as a fallback
|
||||
|
||||
find_library(DL_LIBRARY dl)
|
||||
mark_as_advanced(DL_LIBRARY)
|
||||
if (DL_LIBRARY)
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${DL_LIBRARY})
|
||||
else()
|
||||
set(CMAKE_REQUIRED_LIBRARIES "")
|
||||
endif()
|
||||
|
||||
check_function_exists(dlopen _GLFW_HAS_DLOPEN)
|
||||
|
||||
if (NOT _GLFW_HAS_DLOPEN)
|
||||
message(FATAL_ERROR "No entry point retrieval mechanism found")
|
||||
endif()
|
||||
|
||||
if (DL_LIBRARY)
|
||||
list(APPEND glfw_LIBRARIES ${DL_LIBRARY})
|
||||
set(GLFW_PKG_LIBS "${GLFW_PKG_LIBS} -ldl")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Use EGL for context creation
|
||||
#--------------------------------------------------------------------
|
||||
if (_GLFW_EGL)
|
||||
|
||||
list(APPEND glfw_INCLUDE_DIRS ${EGL_INCLUDE_DIR})
|
||||
list(APPEND glfw_LIBRARIES ${EGL_LIBRARY})
|
||||
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${EGL_LIBRARY})
|
||||
|
||||
if (UNIX)
|
||||
set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} egl")
|
||||
endif()
|
||||
|
||||
if (_GLFW_USE_OPENGL)
|
||||
list(APPEND glfw_LIBRARIES ${OPENGL_gl_LIBRARY})
|
||||
list(APPEND glfw_INCLUDE_DIRS ${OPENGL_INCLUDE_DIR})
|
||||
set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} gl")
|
||||
elseif (_GLFW_USE_GLESV1)
|
||||
list(APPEND glfw_LIBRARIES ${GLESv1_LIBRARY})
|
||||
list(APPEND glfw_INCLUDE_DIRS ${GLESv1_INCLUDE_DIR})
|
||||
set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} glesv1_cm")
|
||||
elseif (_GLFW_USE_GLESV2)
|
||||
list(APPEND glfw_LIBRARIES ${GLESv2_LIBRARY})
|
||||
list(APPEND glfw_INCLUDE_DIRS ${GLESv2_INCLUDE_DIR})
|
||||
set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} glesv2")
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Use Cocoa for window creation and NSOpenGL for context creation
|
||||
#--------------------------------------------------------------------
|
||||
if (_GLFW_COCOA AND _GLFW_NSGL)
|
||||
|
||||
option(GLFW_BUILD_UNIVERSAL "Build GLFW as a Universal Binary" OFF)
|
||||
|
||||
if (GLFW_USE_MENUBAR)
|
||||
set(_GLFW_USE_MENUBAR 1)
|
||||
endif()
|
||||
|
||||
if (GLFW_USE_CHDIR)
|
||||
set(_GLFW_USE_CHDIR 1)
|
||||
endif()
|
||||
|
||||
# Universal build
|
||||
if (GLFW_BUILD_UNIVERSAL)
|
||||
message(STATUS "Building GLFW as Universal Binaries")
|
||||
set(CMAKE_OSX_ARCHITECTURES i386;x86_64)
|
||||
else()
|
||||
message(STATUS "Building GLFW only for the native architecture")
|
||||
endif()
|
||||
|
||||
# Set up library and include paths
|
||||
find_library(COCOA_FRAMEWORK Cocoa)
|
||||
find_library(IOKIT_FRAMEWORK IOKit)
|
||||
find_library(CORE_FOUNDATION_FRAMEWORK CoreFoundation)
|
||||
list(APPEND glfw_LIBRARIES ${COCOA_FRAMEWORK}
|
||||
${OPENGL_gl_LIBRARY}
|
||||
${IOKIT_FRAMEWORK}
|
||||
${CORE_FOUNDATION_FRAMEWORK})
|
||||
|
||||
set(GLFW_PKG_DEPS "")
|
||||
set(GLFW_PKG_LIBS "-framework Cocoa -framework OpenGL -framework IOKit -framework CoreFoundation")
|
||||
endif()
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Export GLFW library dependencies
|
||||
#--------------------------------------------------------------------
|
||||
set(GLFW_LIBRARIES ${glfw_LIBRARIES} CACHE STRING "Dependencies of GLFW")
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Choose library output name
|
||||
#--------------------------------------------------------------------
|
||||
if (BUILD_SHARED_LIBS AND UNIX)
|
||||
# On Unix-like systems, shared libraries can use the soname system.
|
||||
set(GLFW_LIB_NAME glfw)
|
||||
else()
|
||||
set(GLFW_LIB_NAME glfw3)
|
||||
endif()
|
||||
write_basic_package_version_file(src/glfw3ConfigVersion.cmake
|
||||
VERSION ${GLFW_VERSION}
|
||||
COMPATIBILITY SameMajorVersion)
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Add subdirectories
|
||||
|
@ -377,59 +130,42 @@ if (GLFW_BUILD_TESTS)
|
|||
add_subdirectory(tests)
|
||||
endif()
|
||||
|
||||
if (DOXYGEN_FOUND)
|
||||
if (DOXYGEN_FOUND AND GLFW_BUILD_DOCS)
|
||||
add_subdirectory(docs)
|
||||
endif()
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Create generated files
|
||||
#--------------------------------------------------------------------
|
||||
configure_file(${GLFW_SOURCE_DIR}/docs/Doxyfile.in
|
||||
${GLFW_BINARY_DIR}/docs/Doxyfile @ONLY)
|
||||
|
||||
configure_file(${GLFW_SOURCE_DIR}/src/config.h.in
|
||||
${GLFW_BINARY_DIR}/src/config.h @ONLY)
|
||||
|
||||
configure_file(${GLFW_SOURCE_DIR}/src/glfwConfig.cmake.in
|
||||
${GLFW_BINARY_DIR}/src/glfwConfig.cmake @ONLY)
|
||||
|
||||
configure_file(${GLFW_SOURCE_DIR}/src/glfwConfigVersion.cmake.in
|
||||
${GLFW_BINARY_DIR}/src/glfwConfigVersion.cmake @ONLY)
|
||||
|
||||
if (UNIX)
|
||||
configure_file(${GLFW_SOURCE_DIR}/src/glfw3.pc.in
|
||||
${GLFW_BINARY_DIR}/src/glfw3.pc @ONLY)
|
||||
endif()
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Install files
|
||||
# Install files other than the library
|
||||
# The library is installed by src/CMakeLists.txt
|
||||
#--------------------------------------------------------------------
|
||||
if (GLFW_INSTALL)
|
||||
install(DIRECTORY include/GLFW DESTINATION include
|
||||
install(DIRECTORY include/GLFW DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||
FILES_MATCHING PATTERN glfw3.h PATTERN glfw3native.h)
|
||||
|
||||
install(FILES ${GLFW_BINARY_DIR}/src/glfwConfig.cmake
|
||||
${GLFW_BINARY_DIR}/src/glfwConfigVersion.cmake
|
||||
DESTINATION lib${LIB_SUFFIX}/cmake/glfw)
|
||||
install(FILES "${GLFW_BINARY_DIR}/src/glfw3Config.cmake"
|
||||
"${GLFW_BINARY_DIR}/src/glfw3ConfigVersion.cmake"
|
||||
DESTINATION "${GLFW_CONFIG_PATH}")
|
||||
|
||||
if (UNIX)
|
||||
install(EXPORT glfwTargets DESTINATION lib${LIB_SUFFIX}/cmake/glfw)
|
||||
install(FILES ${GLFW_BINARY_DIR}/src/glfw3.pc
|
||||
DESTINATION lib${LIB_SUFFIX}/pkgconfig)
|
||||
install(EXPORT glfwTargets FILE glfw3Targets.cmake
|
||||
EXPORT_LINK_INTERFACE_LIBRARIES
|
||||
DESTINATION "${GLFW_CONFIG_PATH}")
|
||||
install(FILES "${GLFW_BINARY_DIR}/src/glfw3.pc"
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
|
||||
|
||||
if (DOXYGEN_FOUND AND GLFW_BUILD_DOCS)
|
||||
install(DIRECTORY "${GLFW_BINARY_DIR}/docs/html"
|
||||
DESTINATION "${CMAKE_INSTALL_DOCDIR}")
|
||||
endif()
|
||||
|
||||
# Only generate this target if no higher-level project already has
|
||||
if (NOT TARGET uninstall)
|
||||
configure_file(CMake/cmake_uninstall.cmake.in
|
||||
cmake_uninstall.cmake IMMEDIATE @ONLY)
|
||||
|
||||
add_custom_target(uninstall
|
||||
"${CMAKE_COMMAND}" -P
|
||||
"${GLFW_BINARY_DIR}/cmake_uninstall.cmake")
|
||||
set_target_properties(uninstall PROPERTIES FOLDER "GLFW3")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Uninstall operation
|
||||
# Don't generate this target if a higher-level project already has
|
||||
#--------------------------------------------------------------------
|
||||
if (GLFW_INSTALL AND NOT TARGET uninstall)
|
||||
configure_file(${GLFW_SOURCE_DIR}/cmake_uninstall.cmake.in
|
||||
${GLFW_BINARY_DIR}/cmake_uninstall.cmake IMMEDIATE @ONLY)
|
||||
|
||||
add_custom_target(uninstall
|
||||
${CMAKE_COMMAND} -P
|
||||
${GLFW_BINARY_DIR}/cmake_uninstall.cmake)
|
||||
endif()
|
||||
|
||||
|
|
268
CONTRIBUTORS.md
Normal file
268
CONTRIBUTORS.md
Normal file
|
@ -0,0 +1,268 @@
|
|||
# Acknowledgements
|
||||
|
||||
GLFW exists because people around the world donated their time and lent their
|
||||
skills. This list only includes contributions to the main repository and
|
||||
excludes other invaluable contributions like language bindings and text and
|
||||
video tutorials.
|
||||
|
||||
- Bobyshev Alexander
|
||||
- Laurent Aphecetche
|
||||
- Matt Arsenault
|
||||
- Takuro Ashie
|
||||
- ashishgamedev
|
||||
- David Avedissian
|
||||
- Luca Bacci
|
||||
- Keith Bauer
|
||||
- John Bartholomew
|
||||
- Coşku Baş
|
||||
- Niklas Behrens
|
||||
- Andrew Belt
|
||||
- Nevyn Bengtsson
|
||||
- Niklas Bergström
|
||||
- Denis Bernard
|
||||
- BiBi
|
||||
- Doug Binks
|
||||
- blanco
|
||||
- Waris Boonyasiriwat
|
||||
- Kyle Brenneman
|
||||
- Rok Breulj
|
||||
- TheBrokenRail
|
||||
- Kai Burjack
|
||||
- Martin Capitanio
|
||||
- Nicolas Caramelli
|
||||
- David Carlier
|
||||
- Arturo Castro
|
||||
- Chi-kwan Chan
|
||||
- TheChocolateOre
|
||||
- Ali Chraghi
|
||||
- Joseph Chua
|
||||
- Ian Clarkson
|
||||
- Michał Cichoń
|
||||
- Lambert Clara
|
||||
- Anna Clarke
|
||||
- Josh Codd
|
||||
- Yaron Cohen-Tal
|
||||
- Omar Cornut
|
||||
- Andrew Corrigan
|
||||
- Bailey Cosier
|
||||
- Noel Cower
|
||||
- CuriouserThing
|
||||
- Jason Daly
|
||||
- danhambleton
|
||||
- Jarrod Davis
|
||||
- Olivier Delannoy
|
||||
- Paul R. Deppe
|
||||
- Michael Dickens
|
||||
- Роман Донченко
|
||||
- Mario Dorn
|
||||
- Wolfgang Draxinger
|
||||
- Jonathan Dummer
|
||||
- Ralph Eastwood
|
||||
- Fredrik Ehnbom
|
||||
- Robin Eklind
|
||||
- Jan Ekström
|
||||
- Siavash Eliasi
|
||||
- Ahmad Fatoum
|
||||
- Nikita Fediuchin
|
||||
- Felipe Ferreira
|
||||
- Michael Fogleman
|
||||
- Jason Francis
|
||||
- Gerald Franz
|
||||
- Mário Freitas
|
||||
- GeO4d
|
||||
- Marcus Geelnard
|
||||
- ghuser404
|
||||
- Charles Giessen
|
||||
- Ryan C. Gordon
|
||||
- Stephen Gowen
|
||||
- Kovid Goyal
|
||||
- Kevin Grandemange
|
||||
- Eloi Marín Gratacós
|
||||
- Stefan Gustavson
|
||||
- Andrew Gutekanst
|
||||
- Stephen Gutekanst
|
||||
- Jonathan Hale
|
||||
- hdf89shfdfs
|
||||
- Sylvain Hellegouarch
|
||||
- Björn Hempel
|
||||
- Matthew Henry
|
||||
- heromyth
|
||||
- Lucas Hinderberger
|
||||
- Paul Holden
|
||||
- Hajime Hoshi
|
||||
- Warren Hu
|
||||
- Charles Huber
|
||||
- Brent Huisman
|
||||
- illustris
|
||||
- InKryption
|
||||
- IntellectualKitty
|
||||
- Aaron Jacobs
|
||||
- JannikGM
|
||||
- Erik S. V. Jansson
|
||||
- jjYBdx4IL
|
||||
- Toni Jovanoski
|
||||
- Arseny Kapoulkine
|
||||
- Cem Karan
|
||||
- Osman Keskin
|
||||
- Koray Kilinc
|
||||
- Josh Kilmer
|
||||
- Byunghoon Kim
|
||||
- Cameron King
|
||||
- Peter Knut
|
||||
- Christoph Kubisch
|
||||
- Yuri Kunde Schlesner
|
||||
- Rokas Kupstys
|
||||
- Konstantin Käfer
|
||||
- Eric Larson
|
||||
- Francis Lecavalier
|
||||
- Jong Won Lee
|
||||
- Robin Leffmann
|
||||
- Glenn Lewis
|
||||
- Shane Liesegang
|
||||
- Anders Lindqvist
|
||||
- Leon Linhart
|
||||
- Marco Lizza
|
||||
- Eyal Lotem
|
||||
- Aaron Loucks
|
||||
- Luflosi
|
||||
- lukect
|
||||
- Tristam MacDonald
|
||||
- Hans Mackowiak
|
||||
- Ramiro Magno
|
||||
- Дмитри Малышев
|
||||
- Zbigniew Mandziejewicz
|
||||
- Adam Marcus
|
||||
- Célestin Marot
|
||||
- Kyle McDonald
|
||||
- David V. McKay
|
||||
- David Medlock
|
||||
- Bryce Mehring
|
||||
- Jonathan Mercier
|
||||
- Marcel Metz
|
||||
- Liam Middlebrook
|
||||
- Ave Milia
|
||||
- Jonathan Miller
|
||||
- Kenneth Miller
|
||||
- Bruce Mitchener
|
||||
- Jack Moffitt
|
||||
- Ravi Mohan
|
||||
- Jeff Molofee
|
||||
- Alexander Monakov
|
||||
- Pierre Morel
|
||||
- Jon Morton
|
||||
- Pierre Moulon
|
||||
- Martins Mozeiko
|
||||
- Pascal Muetschard
|
||||
- James Murphy
|
||||
- Julian Møller
|
||||
- ndogxj
|
||||
- F. Nedelec
|
||||
- n3rdopolis
|
||||
- Kristian Nielsen
|
||||
- Joel Niemelä
|
||||
- Kamil Nowakowski
|
||||
- onox
|
||||
- Denis Ovod
|
||||
- Ozzy
|
||||
- Andri Pálsson
|
||||
- luz paz
|
||||
- Peoro
|
||||
- Braden Pellett
|
||||
- Christopher Pelloux
|
||||
- Michael Pennington
|
||||
- Arturo J. Pérez
|
||||
- Vladimir Perminov
|
||||
- Olivier Perret
|
||||
- Anthony Pesch
|
||||
- Orson Peters
|
||||
- Emmanuel Gil Peyrot
|
||||
- Cyril Pichard
|
||||
- Pilzschaf
|
||||
- Keith Pitt
|
||||
- Stanislav Podgorskiy
|
||||
- Konstantin Podsvirov
|
||||
- Nathan Poirier
|
||||
- Alexandre Pretyman
|
||||
- Pablo Prietz
|
||||
- przemekmirek
|
||||
- pthom
|
||||
- Martin Pulec
|
||||
- Guillaume Racicot
|
||||
- Juan Ramos
|
||||
- Christian Rauch
|
||||
- Philip Rideout
|
||||
- Eddie Ringle
|
||||
- Max Risuhin
|
||||
- Joe Roback
|
||||
- Jorge Rodriguez
|
||||
- Jari Ronkainen
|
||||
- Luca Rood
|
||||
- Ed Ropple
|
||||
- Aleksey Rybalkin
|
||||
- Mikko Rytkönen
|
||||
- Riku Salminen
|
||||
- Yoshinori Sano
|
||||
- Brandon Schaefer
|
||||
- Sebastian Schuberth
|
||||
- Christian Sdunek
|
||||
- Matt Sealey
|
||||
- Steve Sexton
|
||||
- Arkady Shapkin
|
||||
- Ali Sherief
|
||||
- Yoshiki Shibukawa
|
||||
- Dmitri Shuralyov
|
||||
- Joao da Silva
|
||||
- Daniel Sieger
|
||||
- Daniel Skorupski
|
||||
- Slemmie
|
||||
- Anthony Smith
|
||||
- Bradley Smith
|
||||
- Cliff Smolinsky
|
||||
- Patrick Snape
|
||||
- Erlend Sogge Heggen
|
||||
- Olivier Sohn
|
||||
- Julian Squires
|
||||
- Johannes Stein
|
||||
- Pontus Stenetorp
|
||||
- Michael Stocker
|
||||
- Justin Stoecker
|
||||
- Elviss Strazdins
|
||||
- Paul Sultana
|
||||
- Nathan Sweet
|
||||
- TTK-Bandit
|
||||
- Jared Tiala
|
||||
- Sergey Tikhomirov
|
||||
- Arthur Tombs
|
||||
- TronicLabs
|
||||
- Ioannis Tsakpinis
|
||||
- Samuli Tuomola
|
||||
- Matthew Turner
|
||||
- urraka
|
||||
- Elias Vanderstuyft
|
||||
- Stef Velzel
|
||||
- Jari Vetoniemi
|
||||
- Ricardo Vieira
|
||||
- Nicholas Vitovitch
|
||||
- Simon Voordouw
|
||||
- Corentin Wallez
|
||||
- Torsten Walluhn
|
||||
- Patrick Walton
|
||||
- Xo Wang
|
||||
- Andre Weissflog
|
||||
- Jay Weisskopf
|
||||
- Frank Wille
|
||||
- Andy Williams
|
||||
- Joel Winarske
|
||||
- Richard A. Wilkes
|
||||
- Tatsuya Yatagawa
|
||||
- Ryogo Yoshimura
|
||||
- Lukas Zanner
|
||||
- Andrey Zholos
|
||||
- Aihui Zhu
|
||||
- Santi Zupancic
|
||||
- Jonas Ådahl
|
||||
- Lasse Öörni
|
||||
- Leonard König
|
||||
- All the unmentioned and anonymous contributors in the GLFW community, for bug
|
||||
reports, patches, feedback, testing and encouragement
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
Copyright (c) 2002-2006 Marcus Geelnard
|
||||
Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>
|
||||
|
||||
Copyright (c) 2006-2019 Camilla Löwy
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
567
README.md
567
README.md
|
@ -1,213 +1,422 @@
|
|||
# GLFW
|
||||
|
||||
[](https://github.com/glfw/glfw/actions)
|
||||
[](https://ci.appveyor.com/project/elmindreda/glfw)
|
||||
[](https://scan.coverity.com/projects/glfw-glfw)
|
||||
|
||||
## Introduction
|
||||
|
||||
GLFW is a free, Open Source, portable library for OpenGL and OpenGL ES
|
||||
GLFW is an Open Source, multi-platform library for OpenGL, OpenGL ES and Vulkan
|
||||
application development. It provides a simple, platform-independent API for
|
||||
creating windows and contexts, reading input, handling events, etc.
|
||||
creating windows, contexts and surfaces, reading input, handling events, etc.
|
||||
|
||||
Version 3.0.1 adds fixes for a number of bugs that together affect all supported
|
||||
platforms. As this is a patch release, there are no API changes.
|
||||
GLFW natively supports Windows, macOS and Linux and other Unix-like systems. On
|
||||
Linux both X11 and Wayland are supported.
|
||||
|
||||
GLFW is licensed under the [zlib/libpng
|
||||
license](https://www.glfw.org/license.html).
|
||||
|
||||
You can [download](https://www.glfw.org/download.html) the latest stable release
|
||||
as source or Windows binaries, or fetch the `latest` branch from GitHub. Each
|
||||
release starting with 3.0 also has a corresponding [annotated
|
||||
tag](https://github.com/glfw/glfw/releases) with source and binary archives.
|
||||
|
||||
The [documentation](https://www.glfw.org/docs/latest/) is available online and is
|
||||
included in all source and binary archives. See the [release
|
||||
notes](https://www.glfw.org/docs/latest/news.html) for new features, caveats and
|
||||
deprecations in the latest release. For more details see the [version
|
||||
history](https://www.glfw.org/changelog.html).
|
||||
|
||||
The `master` branch is the stable integration branch and _should_ always compile
|
||||
and run on all supported platforms, although details of newly added features may
|
||||
change until they have been included in a release. New features and many bug
|
||||
fixes live in [other branches](https://github.com/glfw/glfw/branches/all) until
|
||||
they are stable enough to merge.
|
||||
|
||||
If you are new to GLFW, you may find the
|
||||
[introductory tutorial](http://www.glfw.org/docs/3.0/quick.html) for GLFW
|
||||
3 useful. If
|
||||
you have used GLFW 2 in the past, there is a
|
||||
[transition guide](http://www.glfw.org/docs/3.0/moving.html) for moving to the
|
||||
GLFW 3 API.
|
||||
[tutorial](https://www.glfw.org/docs/latest/quick.html) for GLFW 3 useful. If
|
||||
you have used GLFW 2 in the past, there is a [transition
|
||||
guide](https://www.glfw.org/docs/latest/moving.html) for moving to the GLFW
|
||||
3 API.
|
||||
|
||||
GLFW exists because of the contributions of [many people](CONTRIBUTORS.md)
|
||||
around the world, whether by reporting bugs, providing community support, adding
|
||||
features, reviewing or testing code, debugging, proofreading docs, suggesting
|
||||
features or fixing bugs.
|
||||
|
||||
|
||||
## Compiling GLFW
|
||||
|
||||
To compile GLFW and the accompanying example programs, you will need the
|
||||
[CMake](http://www.cmake.org/) build system.
|
||||
GLFW itself requires only the headers and libraries for your OS and window
|
||||
system. It does not need the headers for any context creation API (WGL, GLX,
|
||||
EGL, NSGL, OSMesa) or rendering API (OpenGL, OpenGL ES, Vulkan) to enable
|
||||
support for them.
|
||||
|
||||
GLFW supports compilation on Windows with Visual C++ 2010 and later, MinGW and
|
||||
MinGW-w64, on macOS with Clang and on Linux and other Unix-like systems with GCC
|
||||
and Clang. It will likely compile in other environments as well, but this is
|
||||
not regularly tested.
|
||||
|
||||
### Dependencies
|
||||
There are [pre-compiled Windows binaries](https://www.glfw.org/download.html)
|
||||
available for all supported compilers.
|
||||
|
||||
#### X11 dependencies
|
||||
|
||||
To compile GLFW for X11 and GLX, you need to have the X and OpenGL header
|
||||
packages installed. For example, on Ubuntu and other distributions based on
|
||||
Debian GNU/Linux, you need to install the `xorg-dev` and `libglu1-mesa-dev`
|
||||
packages. Note that using header files from Mesa *will not* tie your binary to
|
||||
the Mesa implementation of OpenGL.
|
||||
|
||||
|
||||
### CMake options
|
||||
|
||||
There are a number of CMake build options for GLFW, although not all are
|
||||
available on all supported platforms. Some of these are de facto standards
|
||||
among CMake users and so have no `GLFW_` prefix.
|
||||
|
||||
|
||||
#### Shared options
|
||||
|
||||
`BUILD_SHARED_LIBS` determines whether GLFW is built as a static
|
||||
library or as a DLL / shared library / dynamic library.
|
||||
|
||||
`LIB_SUFFIX` affects where the GLFW shared /dynamic library is
|
||||
installed. If it is empty, it is installed to `$PREFIX/lib`. If it is set to
|
||||
`64`, it is installed to `$PREFIX/lib64`.
|
||||
|
||||
`GLFW_BUILD_EXAMPLES` determines whether the GLFW examples are built
|
||||
along with the library.
|
||||
|
||||
`GLFW_BUILD_TESTS` determines whether the GLFW test programs are
|
||||
built along with the library.
|
||||
|
||||
|
||||
#### Mac OS X specific options
|
||||
|
||||
`GLFW_USE_CHDIR` determines whether `glfwInit` changes the current
|
||||
directory of bundled applications to the `Contents/Resources` directory.
|
||||
|
||||
`GLFW_USE_MENUBAR` determines whether the first call to
|
||||
`glfwCreateWindow` sets up a minimal menu bar.
|
||||
|
||||
`GLFW_BUILD_UNIVERSAL` determines whether to build Universal Binaries.
|
||||
|
||||
|
||||
#### Windows specific options
|
||||
|
||||
`USE_MSVC_RUNTIME_LIBRARY_DLL` determines whether to use the DLL version of the
|
||||
Visual C++ runtime library.
|
||||
|
||||
|
||||
#### EGL specific options
|
||||
|
||||
`GLFW_USE_EGL` determines whether to use EGL instead of the platform-specific
|
||||
context creation API. Note that EGL is not yet provided on all supported
|
||||
platforms.
|
||||
|
||||
`GLFW_CLIENT_LIBRARY` determines which client API library to use. If set to
|
||||
`opengl` the OpenGL library is used, if set to `glesv1` for the OpenGL ES 1.x
|
||||
library is used, or if set to `glesv2` the OpenGL ES 2.0 library is used. The
|
||||
selected library and its header files must be present on the system for this to
|
||||
work.
|
||||
|
||||
|
||||
## Installing GLFW
|
||||
|
||||
A rudimentary installation target is provided for all supported platforms via
|
||||
CMake.
|
||||
See the [compilation guide](https://www.glfw.org/docs/latest/compile.html) for
|
||||
more information about how to compile GLFW yourself.
|
||||
|
||||
|
||||
## Using GLFW
|
||||
|
||||
See the [GLFW 3.0 documentation](http://www.glfw.org/docs/3.0/).
|
||||
See the [documentation](https://www.glfw.org/docs/latest/) for tutorials, guides
|
||||
and the API reference.
|
||||
|
||||
|
||||
## Contributing to GLFW
|
||||
|
||||
See the [contribution
|
||||
guide](https://github.com/glfw/glfw/blob/master/docs/CONTRIBUTING.md) for
|
||||
more information.
|
||||
|
||||
|
||||
## System requirements
|
||||
|
||||
GLFW supports Windows XP and later and macOS 10.8 and later. Linux and other
|
||||
Unix-like systems running the X Window System are supported even without
|
||||
a desktop environment or modern extensions, although some features require
|
||||
a running window or clipboard manager. The OSMesa backend requires Mesa 6.3.
|
||||
|
||||
See the [compatibility guide](https://www.glfw.org/docs/latest/compat.html)
|
||||
in the documentation for more information.
|
||||
|
||||
|
||||
## Dependencies
|
||||
|
||||
GLFW itself needs only CMake 3.1 or later and the headers and libraries for your
|
||||
OS and window system.
|
||||
|
||||
The examples and test programs depend on a number of tiny libraries. These are
|
||||
located in the `deps/` directory.
|
||||
|
||||
- [getopt\_port](https://github.com/kimgr/getopt_port/) for examples
|
||||
with command-line options
|
||||
- [TinyCThread](https://github.com/tinycthread/tinycthread) for threaded
|
||||
examples
|
||||
- [glad2](https://github.com/Dav1dde/glad) for loading OpenGL and Vulkan
|
||||
functions
|
||||
- [linmath.h](https://github.com/datenwolf/linmath.h) for linear algebra in
|
||||
examples
|
||||
- [Nuklear](https://github.com/Immediate-Mode-UI/Nuklear) for test and example UI
|
||||
- [stb\_image\_write](https://github.com/nothings/stb) for writing images to disk
|
||||
|
||||
The documentation is generated with [Doxygen](https://doxygen.org/) if CMake can
|
||||
find that tool.
|
||||
|
||||
|
||||
## Reporting bugs
|
||||
|
||||
Bugs are reported to our [issue tracker](https://github.com/glfw/glfw/issues).
|
||||
Please check the [contribution
|
||||
guide](https://github.com/glfw/glfw/blob/master/docs/CONTRIBUTING.md) for
|
||||
information on what to include when reporting a bug.
|
||||
|
||||
|
||||
## Changelog
|
||||
|
||||
- Bugfix: The wrong name was used for the CMake variable for the Xxf86vm
|
||||
library
|
||||
- [Cocoa] Bugfix: `glfwGetFramebufferSize` return the size in screen
|
||||
coordinates
|
||||
- [Cocoa] Bugfix: Messages not supported on Mac OS X 10.6 were used without
|
||||
tests for precence
|
||||
- [Cocoa] Bugfix: Process transformation was not performed if menu bar creation
|
||||
was disabled
|
||||
- [Win32] Bugfix: Context creation was attempted even if no valid pixel formats
|
||||
had been found
|
||||
- [X11] Bugfix: Duplicate window position and window and framebuffer size
|
||||
events were reported
|
||||
- Added `GLFW_PLATFORM` init hint for runtime platform selection (#1958)
|
||||
- Added `GLFW_ANY_PLATFORM`, `GLFW_PLATFORM_WIN32`, `GLFW_PLATFORM_COCOA`,
|
||||
`GLFW_PLATFORM_WAYLAND`, `GLFW_PLATFORM_X11` and `GLFW_PLATFORM_NULL` symbols to
|
||||
specify the desired platform (#1958)
|
||||
- Added `glfwGetPlatform` function to query what platform was selected (#1655,#1958)
|
||||
- Added `glfwPlatformSupported` function to query if a platform is supported
|
||||
(#1655,#1958)
|
||||
- Added `glfwInitAllocator` for setting a custom memory allocator (#544,#1628,#1947)
|
||||
- Added `GLFWallocator` struct and `GLFWallocatefun`, `GLFWreallocatefun` and
|
||||
`GLFWdeallocatefun` types (#544,#1628,#1947)
|
||||
- Added `glfwInitVulkanLoader` for using a non-default Vulkan loader (#1374,#1890)
|
||||
- Added `GLFW_RESIZE_NWSE_CURSOR`, `GLFW_RESIZE_NESW_CURSOR`,
|
||||
`GLFW_RESIZE_ALL_CURSOR` and `GLFW_NOT_ALLOWED_CURSOR` cursor shapes (#427)
|
||||
- Added `GLFW_RESIZE_EW_CURSOR` alias for `GLFW_HRESIZE_CURSOR` (#427)
|
||||
- Added `GLFW_RESIZE_NS_CURSOR` alias for `GLFW_VRESIZE_CURSOR` (#427)
|
||||
- Added `GLFW_POINTING_HAND_CURSOR` alias for `GLFW_HAND_CURSOR` (#427)
|
||||
- Added `GLFW_MOUSE_PASSTHROUGH` window hint for letting mouse input pass
|
||||
through the window (#1236,#1568)
|
||||
- Added `GLFW_CURSOR_CAPTURED` cursor mode to confine the cursor to the window
|
||||
content area (#58)
|
||||
- Added `GLFW_POSITION_X` and `GLFW_POSITION_Y` window hints for initial position
|
||||
(#1603,#1747)
|
||||
- Added `GLFW_ANY_POSITION` hint value for letting the window manager choose (#1603,#1747)
|
||||
- Added `GLFW_PLATFORM_UNAVAILABLE` error for platform detection failures (#1958)
|
||||
- Added `GLFW_FEATURE_UNAVAILABLE` error for platform limitations (#1692)
|
||||
- Added `GLFW_FEATURE_UNIMPLEMENTED` error for incomplete backends (#1692)
|
||||
- Added `GLFW_WAYLAND_APP_ID` window hint string for Wayland app\_id selection
|
||||
(#2121,#2122)
|
||||
- Added `GLFW_ANGLE_PLATFORM_TYPE` init hint and `GLFW_ANGLE_PLATFORM_TYPE_*`
|
||||
values to select ANGLE backend (#1380)
|
||||
- Added `GLFW_X11_XCB_VULKAN_SURFACE` init hint for selecting X11 Vulkan
|
||||
surface extension (#1793)
|
||||
- Added `GLFW_NATIVE_INCLUDE_NONE` for disabling inclusion of native headers (#1348)
|
||||
- Added `GLFW_BUILD_WIN32` CMake option for enabling Win32 support (#1958)
|
||||
- Added `GLFW_BUILD_COCOA` CMake option for enabling Cocoa support (#1958)
|
||||
- Added `GLFW_BUILD_X11` CMake option for enabling X11 support (#1958)
|
||||
- Added `GLFW_LIBRARY_TYPE` CMake variable for overriding the library type
|
||||
(#279,#1307,#1497,#1574,#1928)
|
||||
- Added `GLFW_PKG_CONFIG_REQUIRES_PRIVATE` and `GLFW_PKG_CONFIG_LIBS_PRIVATE` CMake
|
||||
variables exposing pkg-config dependencies (#1307)
|
||||
- Made joystick subsystem initialize at first use (#1284,#1646)
|
||||
- Made `GLFW_DOUBLEBUFFER` a read-only window attribute
|
||||
- Updated the minimum required CMake version to 3.1
|
||||
- Updated gamepad mappings from upstream
|
||||
- Disabled tests and examples by default when built as a CMake subdirectory
|
||||
- Renamed `GLFW_USE_WAYLAND` CMake option to `GLFW_BUILD_WAYLAND` (#1958)
|
||||
- Removed `GLFW_USE_OSMESA` CMake option enabling the Null platform (#1958)
|
||||
- Removed CMake generated configuration header
|
||||
- Bugfix: The CMake config-file package used an absolute path and was not
|
||||
relocatable (#1470)
|
||||
- Bugfix: Video modes with a duplicate screen area were discarded (#1555,#1556)
|
||||
- Bugfix: Compiling with -Wextra-semi caused warnings (#1440)
|
||||
- Bugfix: Built-in mappings failed because some OEMs re-used VID/PID (#1583)
|
||||
- Bugfix: Some extension loader headers did not prevent default OpenGL header
|
||||
inclusion (#1695)
|
||||
- Bugfix: Buffers were swapped at creation on single-buffered windows (#1873)
|
||||
- Bugfix: Gamepad mapping updates could spam `GLFW_INVALID_VALUE` due to
|
||||
incompatible controllers sharing hardware ID (#1763)
|
||||
- Bugfix: Native access functions for context handles did not check that the API matched
|
||||
- Bugfix: `glfwMakeContextCurrent` would access TLS slot before initialization
|
||||
- Bugfix: `glfwSetGammaRamp` could emit `GLFW_INVALID_VALUE` before initialization
|
||||
- Bugfix: `glfwGetJoystickUserPointer` returned `NULL` during disconnection (#2092)
|
||||
- [Win32] Added the `GLFW_WIN32_KEYBOARD_MENU` window hint for enabling access
|
||||
to the window menu
|
||||
- [Win32] Added a version info resource to the GLFW DLL
|
||||
- [Win32] Made hidden helper window use its own window class
|
||||
- [Win32] Disabled framebuffer transparency on Windows 7 when DWM windows are
|
||||
opaque (#1512)
|
||||
- [Win32] Bugfix: `GLFW_INCLUDE_VULKAN` plus `VK_USE_PLATFORM_WIN32_KHR` caused
|
||||
symbol redefinition (#1524)
|
||||
- [Win32] Bugfix: The cursor position event was emitted before its cursor enter
|
||||
event (#1490)
|
||||
- [Win32] Bugfix: The window hint `GLFW_MAXIMIZED` did not move or resize the
|
||||
window (#1499)
|
||||
- [Win32] Bugfix: Disabled cursor mode interfered with some non-client actions
|
||||
- [Win32] Bugfix: Super key was not released after Win+V hotkey (#1622)
|
||||
- [Win32] Bugfix: `glfwGetKeyName` could access out of bounds and return an
|
||||
invalid pointer
|
||||
- [Win32] Bugfix: Some synthetic key events were reported as `GLFW_KEY_UNKNOWN`
|
||||
(#1623)
|
||||
- [Win32] Bugfix: Non-BMP Unicode codepoint input was reported as UTF-16
|
||||
- [Win32] Bugfix: Monitor functions could return invalid values after
|
||||
configuration change (#1761)
|
||||
- [Win32] Bugfix: Initialization would segfault on Windows 8 (not 8.1) (#1775)
|
||||
- [Win32] Bugfix: Duplicate size events were not filtered (#1610)
|
||||
- [Win32] Bugfix: Full screen windows were incorrectly resized by DPI changes
|
||||
(#1582)
|
||||
- [Win32] Bugfix: `GLFW_SCALE_TO_MONITOR` had no effect on systems older than
|
||||
Windows 10 version 1703 (#1511)
|
||||
- [Win32] Bugfix: `USE_MSVC_RUNTIME_LIBRARY_DLL` had no effect on CMake 3.15 or
|
||||
later (#1783,#1796)
|
||||
- [Win32] Bugfix: Compilation with LLVM for Windows failed (#1807,#1824,#1874)
|
||||
- [Win32] Bugfix: The foreground lock timeout was overridden, ignoring the user
|
||||
- [Win32] Bugfix: Content scale queries could fail silently (#1615)
|
||||
- [Win32] Bugfix: Content scales could have garbage values if monitor was recently
|
||||
disconnected (#1615)
|
||||
- [Win32] Bugfix: A window created maximized and undecorated would cover the whole
|
||||
monitor (#1806)
|
||||
- [Win32] Bugfix: The default restored window position was lost when creating a maximized
|
||||
window
|
||||
- [Win32] Bugfix: `glfwMaximizeWindow` would make a hidden window visible
|
||||
- [Win32] Bugfix: `Alt+PrtSc` would emit `GLFW_KEY_UNKNOWN` and a different
|
||||
scancode than `PrtSc` (#1993)
|
||||
- [Win32] Bugfix: `GLFW_KEY_PAUSE` scancode from `glfwGetKeyScancode` did not
|
||||
match event scancode (#1993)
|
||||
- [Win32] Bugfix: Instance-local operations used executable instance (#469,#1296,#1395)
|
||||
- [Win32] Bugfix: The OSMesa library was not unloaded on termination
|
||||
- [Win32] Bugfix: Right shift emitted `GLFW_KEY_UNKNOWN` when using a CJK IME (#2050)
|
||||
- [Cocoa] Added support for `VK_EXT_metal_surface` (#1619)
|
||||
- [Cocoa] Added locating the Vulkan loader at runtime in an application bundle
|
||||
- [Cocoa] Moved main menu creation to GLFW initialization time (#1649)
|
||||
- [Cocoa] Changed `EGLNativeWindowType` from `NSView` to `CALayer` (#1169)
|
||||
- [Cocoa] Changed F13 key to report Print Screen for cross-platform consistency
|
||||
(#1786)
|
||||
- [Cocoa] Disabled macOS fullscreen when `GLFW_RESIZABLE` is false
|
||||
- [Cocoa] Removed dependency on the CoreVideo framework
|
||||
- [Cocoa] Bugfix: `glfwSetWindowSize` used a bottom-left anchor point (#1553)
|
||||
- [Cocoa] Bugfix: Window remained on screen after destruction until event poll
|
||||
(#1412)
|
||||
- [Cocoa] Bugfix: Event processing before window creation would assert (#1543)
|
||||
- [Cocoa] Bugfix: Undecorated windows could not be iconified on recent macOS
|
||||
- [Cocoa] Bugfix: Touching event queue from secondary thread before main thread
|
||||
would abort (#1649)
|
||||
- [Cocoa] Bugfix: Non-BMP Unicode codepoint input was reported as UTF-16
|
||||
(#1635)
|
||||
- [Cocoa] Bugfix: Failing to retrieve the refresh rate of built-in displays
|
||||
could leak memory
|
||||
- [Cocoa] Bugfix: Objective-C files were compiled as C with CMake 3.19 (#1787)
|
||||
- [Cocoa] Bugfix: Duplicate video modes were not filtered out (#1830)
|
||||
- [Cocoa] Bugfix: Menu bar was not clickable on macOS 10.15+ until it lost and
|
||||
regained focus (#1648,#1802)
|
||||
- [Cocoa] Bugfix: Monitor name query could segfault on macOS 11 (#1809,#1833)
|
||||
- [Cocoa] Bugfix: The install name of the installed dylib was relative (#1504)
|
||||
- [Cocoa] Bugfix: The MoltenVK layer contents scale was updated only after
|
||||
related events were emitted
|
||||
- [Cocoa] Bugfix: Moving the cursor programmatically would freeze it for
|
||||
a fraction of a second (#1962)
|
||||
- [Cocoa] Bugfix: `kIOMasterPortDefault` was deprecated in macOS 12.0 (#1980)
|
||||
- [Cocoa] Bugfix: `kUTTypeURL` was deprecated in macOS 12.0 (#2003)
|
||||
- [Cocoa] Bugfix: A connected Apple AirPlay would emit a useless error (#1791)
|
||||
- [Cocoa] Bugfix: The EGL and OSMesa libraries were not unloaded on termination
|
||||
- [Cocoa] Bugfix: `GLFW_MAXIMIZED` was always true when `GLFW_RESIZABLE` was false
|
||||
- [Cocoa] Bugfix: Changing `GLFW_DECORATED` in macOS fullscreen would abort
|
||||
application (#1886)
|
||||
- [Cocoa] Bugfix: Setting a monitor from macOS fullscreen would abort
|
||||
application (#2110)
|
||||
- [Cocoa] Bugfix: The Vulkan loader was not loaded from the `Frameworks` bundle
|
||||
subdirectory (#2113,#2120)
|
||||
- [X11] Bugfix: The CMake files did not check for the XInput headers (#1480)
|
||||
- [X11] Bugfix: Key names were not updated when the keyboard layout changed
|
||||
(#1462,#1528)
|
||||
- [X11] Bugfix: Decorations could not be enabled after window creation (#1566)
|
||||
- [X11] Bugfix: Content scale fallback value could be inconsistent (#1578)
|
||||
- [X11] Bugfix: `glfwMaximizeWindow` had no effect on hidden windows
|
||||
- [X11] Bugfix: Clearing `GLFW_FLOATING` on a hidden window caused invalid read
|
||||
- [X11] Bugfix: Changing `GLFW_FLOATING` on a hidden window could silently fail
|
||||
- [X11] Bugfix: Disabled cursor mode was interrupted by indicator windows
|
||||
- [X11] Bugfix: Monitor physical dimensions could be reported as zero mm
|
||||
- [X11] Bugfix: Window position events were not emitted during resizing (#1613)
|
||||
- [X11] Bugfix: `glfwFocusWindow` could terminate on older WMs or without a WM
|
||||
- [X11] Bugfix: Querying a disconnected monitor could segfault (#1602)
|
||||
- [X11] Bugfix: IME input of CJK was broken for "C" locale (#1587,#1636)
|
||||
- [X11] Bugfix: Termination would segfault if the IM had been destroyed
|
||||
- [X11] Bugfix: Any IM started after initialization would not be detected
|
||||
- [X11] Bugfix: Xlib errors caused by other parts of the application could be
|
||||
reported as GLFW errors
|
||||
- [X11] Bugfix: A handle race condition could cause a `BadWindow` error (#1633)
|
||||
- [X11] Bugfix: XKB path used keysyms instead of physical locations for
|
||||
non-printable keys (#1598)
|
||||
- [X11] Bugfix: Function keys were mapped to `GLFW_KEY_UNKNOWN` for some layout
|
||||
combinations (#1598)
|
||||
- [X11] Bugfix: Keys pressed simultaneously with others were not always
|
||||
reported (#1112,#1415,#1472,#1616)
|
||||
- [X11] Bugfix: Some window attributes were not applied on leaving fullscreen
|
||||
(#1863)
|
||||
- [X11] Bugfix: Changing `GLFW_FLOATING` could leak memory
|
||||
- [X11] Bugfix: Icon pixel format conversion worked only by accident, relying on
|
||||
undefined behavior (#1986)
|
||||
- [X11] Bugfix: Dynamic loading on OpenBSD failed due to soname differences
|
||||
- [X11] Bugfix: Waiting for events would fail if file descriptor was too large
|
||||
(#2024)
|
||||
- [X11] Bugfix: Joystick events could lead to busy-waiting (#1872)
|
||||
- [X11] Bugfix: `glfwWaitEvents*` did not continue for joystick events
|
||||
- [X11] Bugfix: `glfwPostEmptyEvent` could be ignored due to race condition
|
||||
(#379,#1281,#1285,#2033)
|
||||
- [X11] Bugfix: Dynamic loading on NetBSD failed due to soname differences
|
||||
- [X11] Bugfix: Left shift of int constant relied on undefined behavior (#1951)
|
||||
- [X11] Bugfix: The OSMesa libray was not unloaded on termination
|
||||
- [X11] Bugfix: A malformed response during selection transfer could cause a segfault
|
||||
- [X11] Bugfix: Some calls would reset Xlib to the default error handler (#2108)
|
||||
- [Wayland] Added improved fallback window decorations via libdecor (#1639,#1693)
|
||||
- [Wayland] Added dynamic loading of all Wayland libraries
|
||||
- [Wayland] Added support for key names via xkbcommon
|
||||
- [Wayland] Added support for file path drop events (#2040)
|
||||
- [Wayland] Added support for more human-readable monitor names where available
|
||||
- [Wayland] Disabled alpha channel for opaque windows on systems lacking
|
||||
`EGL_EXT_present_opaque` (#1895)
|
||||
- [Wayland] Removed support for `wl_shell` (#1443)
|
||||
- [Wayland] Bugfix: The `GLFW_HAND_CURSOR` shape used the wrong image (#1432)
|
||||
- [Wayland] Bugfix: `CLOCK_MONOTONIC` was not correctly enabled
|
||||
- [Wayland] Bugfix: Repeated keys could be reported with `NULL` window (#1704)
|
||||
- [Wayland] Bugfix: Retrieving partial framebuffer size would segfault
|
||||
- [Wayland] Bugfix: Scrolling offsets were inverted compared to other platforms
|
||||
(#1463)
|
||||
- [Wayland] Bugfix: Client-Side Decorations were destroyed in the wrong order
|
||||
(#1798)
|
||||
- [Wayland] Bugfix: Monitors physical size could report zero (#1784,#1792)
|
||||
- [Wayland] Bugfix: Some keys were not repeating in Wayland (#1908)
|
||||
- [Wayland] Bugfix: Non-arrow cursors are offset from the hotspot (#1706,#1899)
|
||||
- [Wayland] Bugfix: The `O_CLOEXEC` flag was not defined on FreeBSD
|
||||
- [Wayland] Bugfix: Key repeat could lead to a race condition (#1710)
|
||||
- [Wayland] Bugfix: Activating a window would emit two input focus events
|
||||
- [Wayland] Bugfix: Disable key repeat mechanism when window loses input focus
|
||||
- [Wayland] Bugfix: Window hiding and showing did not work (#1492,#1731)
|
||||
- [Wayland] Bugfix: A key being repeated was not released when window lost focus
|
||||
- [Wayland] Bugfix: Showing a hidden window did not emit a window refresh event
|
||||
- [Wayland] Bugfix: Full screen window creation did not ignore `GLFW_VISIBLE`
|
||||
- [Wayland] Bugfix: Some keys were reported as wrong key or `GLFW_KEY_UNKNOWN`
|
||||
- [Wayland] Bugfix: Text input did not repeat along with key repeat
|
||||
- [Wayland] Bugfix: `glfwPostEmptyEvent` sometimes had no effect (#1520,#1521)
|
||||
- [Wayland] Bugfix: `glfwSetClipboardString` would fail if set to result of
|
||||
`glfwGetClipboardString`
|
||||
- [Wayland] Bugfix: Data source creation error would cause double free at termination
|
||||
- [Wayland] Bugfix: Partial writes of clipboard string would cause beginning to repeat
|
||||
- [Wayland] Bugfix: Some errors would cause clipboard string transfer to hang
|
||||
- [Wayland] Bugfix: Drag and drop data was misinterpreted as clipboard string
|
||||
- [Wayland] Bugfix: MIME type matching was not performed for clipboard string
|
||||
- [Wayland] Bugfix: The OSMesa library was not unloaded on termination
|
||||
- [Wayland] Bugfix: `glfwCreateWindow` could emit `GLFW_FEATURE_UNAVAILABLE`
|
||||
- [Wayland] Bugfix: Lock key modifier bits were only set when lock keys were pressed
|
||||
- [Wayland] Bugfix: A window leaving full screen mode would be iconified (#1995)
|
||||
- [Wayland] Bugfix: A window leaving full screen mode ignored its desired size
|
||||
- [Wayland] Bugfix: `glfwSetWindowMonitor` did not update windowed mode size
|
||||
- [Wayland] Bugfix: `glfwRestoreWindow` would make a full screen window windowed
|
||||
- [Wayland] Bugfix: A window maximized or restored by the user would enter an
|
||||
inconsistent state
|
||||
- [Wayland] Bugfix: Window maximization events were not emitted
|
||||
- [Wayland] Bugfix: `glfwRestoreWindow` assumed it was always in windowed mode
|
||||
- [Wayland] Bugfix: `glfwSetWindowSize` would resize a full screen window
|
||||
- [Wayland] Bugfix: A window content scale event would be emitted every time
|
||||
the window resized
|
||||
- [Wayland] Bugfix: If `glfwInit` failed it would close stdin
|
||||
- [Wayland] Bugfix: Manual resizing with fallback decorations behaved erratically
|
||||
(#1991,#2115,#2127)
|
||||
- [Wayland] Bugfix: Size limits included frame size for fallback decorations
|
||||
- [Wayland] Bugfix: Updating `GLFW_DECORATED` had no effect on server-side
|
||||
decorations
|
||||
- [Wayland] Bugfix: A monitor would be reported as connected again if its scale
|
||||
changed
|
||||
- [Wayland] Bugfix: `glfwTerminate` would segfault if any monitor had changed
|
||||
scale
|
||||
- [Wayland] Bugfix: Window content scale events were not emitted when monitor
|
||||
scale changed
|
||||
- [Wayland] Bugfix: `glfwSetWindowAspectRatio` reported an error instead of
|
||||
applying the specified ratio
|
||||
- [Wayland] Bugfix: `GLFW_MAXIMIZED` window hint had no effect
|
||||
- [Wayland] Bugfix: `glfwRestoreWindow` had no effect before first show
|
||||
- [Wayland] Bugfix: Hiding and then showing a window caused program abort on
|
||||
wlroots compositors (#1268)
|
||||
- [Wayland] Bugfix: `GLFW_DECORATED` was ignored when showing a window with XDG
|
||||
decorations
|
||||
- [Wayland] Bugfix: Connecting a mouse after `glfwInit` would segfault (#1450)
|
||||
- [Wayland] Bugfix: Joysticks connected after `glfwInit` were not detected (#2198)
|
||||
- [POSIX] Removed use of deprecated function `gettimeofday`
|
||||
- [POSIX] Bugfix: `CLOCK_MONOTONIC` was not correctly tested for or enabled
|
||||
- [Linux] Bugfix: Joysticks without buttons were ignored (#2042,#2043)
|
||||
- [WGL] Disabled the DWM swap interval hack for Windows 8 and later (#1072)
|
||||
- [NSGL] Removed enforcement of forward-compatible flag for core contexts
|
||||
- [NSGL] Bugfix: `GLFW_COCOA_RETINA_FRAMEBUFFER` had no effect on newer
|
||||
macOS versions (#1442)
|
||||
- [NSGL] Bugfix: Workaround for swap interval on 10.14 broke on 10.12 (#1483)
|
||||
- [NSGL] Bugfix: Defining `GL_SILENCE_DEPRECATION` externally caused
|
||||
a duplicate definition warning (#1840)
|
||||
- [EGL] Added platform selection via the `EGL_EXT_platform_base` extension
|
||||
(#442)
|
||||
- [EGL] Added ANGLE backend selection via `EGL_ANGLE_platform_angle` extension
|
||||
(#1380)
|
||||
[EGL] Added loading of glvnd `libOpenGL.so.0` where available for OpenGL
|
||||
- [EGL] Bugfix: The `GLFW_DOUBLEBUFFER` context attribute was ignored (#1843)
|
||||
- [GLX] Added loading of glvnd `libGLX.so.0` where available
|
||||
- [GLX] Bugfix: Context creation failed if GLX 1.4 was not exported by GLX library
|
||||
|
||||
|
||||
## Contact
|
||||
|
||||
The official website for GLFW is [glfw.org](http://www.glfw.org/). There you
|
||||
can find the latest version of GLFW, as well as news, documentation and other
|
||||
information about the project.
|
||||
On [glfw.org](https://www.glfw.org/) you can find the latest version of GLFW, as
|
||||
well as news, documentation and other information about the project.
|
||||
|
||||
If you have questions related to the use of GLFW, we have a
|
||||
[support forum](https://sourceforge.net/p/glfw/discussion/247562/), and the IRC
|
||||
channel `#glfw` on [Freenode](http://freenode.net/).
|
||||
[forum](https://discourse.glfw.org/), and the `#glfw` IRC channel on
|
||||
[Libera.Chat](https://libera.chat/).
|
||||
|
||||
If you have a bug to report, a patch to submit or a feature you'd like to
|
||||
request, please file it in one of the
|
||||
[issue trackers](https://sourceforge.net/p/glfw/_list/tickets) on SF.net.
|
||||
request, please file it in the
|
||||
[issue tracker](https://github.com/glfw/glfw/issues) on GitHub.
|
||||
|
||||
Finally, if you're interested in helping out with the development of GLFW or
|
||||
porting it to your favorite platform, we have a
|
||||
[developer's mailing list](https://lists.stacken.kth.se/mailman/listinfo/glfw-dev),
|
||||
or you could join us on `#glfw`.
|
||||
|
||||
|
||||
## Acknowledgements
|
||||
|
||||
GLFW exists because people around the world donated their time and lent their
|
||||
skills.
|
||||
|
||||
- Bobyshev Alexander
|
||||
- artblanc
|
||||
- Matt Arsenault
|
||||
- Keith Bauer
|
||||
- John Bartholomew
|
||||
- Niklas Behrens
|
||||
- Niklas Bergström
|
||||
- blanco
|
||||
- Lambert Clara
|
||||
- Noel Cower
|
||||
- Jarrod Davis
|
||||
- Olivier Delannoy
|
||||
- Paul R. Deppe
|
||||
- Jonathan Dummer
|
||||
- Ralph Eastwood
|
||||
- Gerald Franz
|
||||
- GeO4d
|
||||
- Marcus Geelnard
|
||||
- Stefan Gustavson
|
||||
- Sylvain Hellegouarch
|
||||
- heromyth
|
||||
- Paul Holden
|
||||
- Toni Jovanoski
|
||||
- Osman Keskin
|
||||
- Cameron King
|
||||
- Peter Knut
|
||||
- Robin Leffmann
|
||||
- Glenn Lewis
|
||||
- Shane Liesegang
|
||||
- Дмитри Малышев
|
||||
- Martins Mozeiko
|
||||
- Tristam MacDonald
|
||||
- Hans Mackowiak
|
||||
- Kyle McDonald
|
||||
- David Medlock
|
||||
- Jonathan Mercier
|
||||
- Marcel Metz
|
||||
- Kenneth Miller
|
||||
- Jeff Molofee
|
||||
- Jon Morton
|
||||
- Julian Møller
|
||||
- Ozzy at Orkysquad
|
||||
- Peoro
|
||||
- Braden Pellett
|
||||
- Arturo J. Pérez
|
||||
- Jorge Rodriguez
|
||||
- Ed Ropple
|
||||
- Riku Salminen
|
||||
- Sebastian Schuberth
|
||||
- Matt Sealey
|
||||
- SephiRok
|
||||
- Steve Sexton
|
||||
- Dmitri Shuralyov
|
||||
- Daniel Skorupski
|
||||
- Bradley Smith
|
||||
- Julian Squires
|
||||
- Johannes Stein
|
||||
- Nathan Sweet
|
||||
- TTK-Bandit
|
||||
- Sergey Tikhomirov
|
||||
- Samuli Tuomola
|
||||
- Jari Vetoniemi
|
||||
- Simon Voordouw
|
||||
- Torsten Walluhn
|
||||
- Jay Weisskopf
|
||||
- Frank Wille
|
||||
- yuriks
|
||||
- Santi Zupancic
|
||||
- Lasse Öörni
|
||||
- All the unmentioned and anonymous contributors in the GLFW community, for bug
|
||||
reports, patches, feedback, testing and encouragement
|
||||
porting it to your favorite platform, join us on the forum, GitHub or IRC.
|
||||
|
||||
|
|
565
deps/EGL/eglext.h
vendored
565
deps/EGL/eglext.h
vendored
|
@ -1,565 +0,0 @@
|
|||
#ifndef __eglext_h_
|
||||
#define __eglext_h_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2007-2013 The Khronos Group Inc.
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person obtaining a
|
||||
** copy of this software and/or associated documentation files (the
|
||||
** "Materials"), to deal in the Materials without restriction, including
|
||||
** without limitation the rights to use, copy, modify, merge, publish,
|
||||
** distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
** permit persons to whom the Materials are furnished to do so, subject to
|
||||
** the following conditions:
|
||||
**
|
||||
** The above copyright notice and this permission notice shall be included
|
||||
** in all copies or substantial portions of the Materials.
|
||||
**
|
||||
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*/
|
||||
|
||||
#include <EGL/eglplatform.h>
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
/* Header file version number */
|
||||
/* Current version at http://www.khronos.org/registry/egl/ */
|
||||
/* $Revision: 20690 $ on $Date: 2013-02-22 17:15:05 -0800 (Fri, 22 Feb 2013) $ */
|
||||
#define EGL_EGLEXT_VERSION 15
|
||||
|
||||
#ifndef EGL_KHR_config_attribs
|
||||
#define EGL_KHR_config_attribs 1
|
||||
#define EGL_CONFORMANT_KHR 0x3042 /* EGLConfig attribute */
|
||||
#define EGL_VG_COLORSPACE_LINEAR_BIT_KHR 0x0020 /* EGL_SURFACE_TYPE bitfield */
|
||||
#define EGL_VG_ALPHA_FORMAT_PRE_BIT_KHR 0x0040 /* EGL_SURFACE_TYPE bitfield */
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_lock_surface
|
||||
#define EGL_KHR_lock_surface 1
|
||||
#define EGL_READ_SURFACE_BIT_KHR 0x0001 /* EGL_LOCK_USAGE_HINT_KHR bitfield */
|
||||
#define EGL_WRITE_SURFACE_BIT_KHR 0x0002 /* EGL_LOCK_USAGE_HINT_KHR bitfield */
|
||||
#define EGL_LOCK_SURFACE_BIT_KHR 0x0080 /* EGL_SURFACE_TYPE bitfield */
|
||||
#define EGL_OPTIMAL_FORMAT_BIT_KHR 0x0100 /* EGL_SURFACE_TYPE bitfield */
|
||||
#define EGL_MATCH_FORMAT_KHR 0x3043 /* EGLConfig attribute */
|
||||
#define EGL_FORMAT_RGB_565_EXACT_KHR 0x30C0 /* EGL_MATCH_FORMAT_KHR value */
|
||||
#define EGL_FORMAT_RGB_565_KHR 0x30C1 /* EGL_MATCH_FORMAT_KHR value */
|
||||
#define EGL_FORMAT_RGBA_8888_EXACT_KHR 0x30C2 /* EGL_MATCH_FORMAT_KHR value */
|
||||
#define EGL_FORMAT_RGBA_8888_KHR 0x30C3 /* EGL_MATCH_FORMAT_KHR value */
|
||||
#define EGL_MAP_PRESERVE_PIXELS_KHR 0x30C4 /* eglLockSurfaceKHR attribute */
|
||||
#define EGL_LOCK_USAGE_HINT_KHR 0x30C5 /* eglLockSurfaceKHR attribute */
|
||||
#define EGL_BITMAP_POINTER_KHR 0x30C6 /* eglQuerySurface attribute */
|
||||
#define EGL_BITMAP_PITCH_KHR 0x30C7 /* eglQuerySurface attribute */
|
||||
#define EGL_BITMAP_ORIGIN_KHR 0x30C8 /* eglQuerySurface attribute */
|
||||
#define EGL_BITMAP_PIXEL_RED_OFFSET_KHR 0x30C9 /* eglQuerySurface attribute */
|
||||
#define EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR 0x30CA /* eglQuerySurface attribute */
|
||||
#define EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR 0x30CB /* eglQuerySurface attribute */
|
||||
#define EGL_BITMAP_PIXEL_ALPHA_OFFSET_KHR 0x30CC /* eglQuerySurface attribute */
|
||||
#define EGL_BITMAP_PIXEL_LUMINANCE_OFFSET_KHR 0x30CD /* eglQuerySurface attribute */
|
||||
#define EGL_LOWER_LEFT_KHR 0x30CE /* EGL_BITMAP_ORIGIN_KHR value */
|
||||
#define EGL_UPPER_LEFT_KHR 0x30CF /* EGL_BITMAP_ORIGIN_KHR value */
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglLockSurfaceKHR (EGLDisplay display, EGLSurface surface, const EGLint *attrib_list);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglUnlockSurfaceKHR (EGLDisplay display, EGLSurface surface);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLLOCKSURFACEKHRPROC) (EGLDisplay display, EGLSurface surface, const EGLint *attrib_list);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNLOCKSURFACEKHRPROC) (EGLDisplay display, EGLSurface surface);
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_image
|
||||
#define EGL_KHR_image 1
|
||||
#define EGL_NATIVE_PIXMAP_KHR 0x30B0 /* eglCreateImageKHR target */
|
||||
typedef void *EGLImageKHR;
|
||||
#define EGL_NO_IMAGE_KHR ((EGLImageKHR)0)
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLImageKHR EGLAPIENTRY eglCreateImageKHR (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImageKHR (EGLDisplay dpy, EGLImageKHR image);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEIMAGEKHRPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGLImageKHR image);
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_vg_parent_image
|
||||
#define EGL_KHR_vg_parent_image 1
|
||||
#define EGL_VG_PARENT_IMAGE_KHR 0x30BA /* eglCreateImageKHR target */
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_gl_texture_2D_image
|
||||
#define EGL_KHR_gl_texture_2D_image 1
|
||||
#define EGL_GL_TEXTURE_2D_KHR 0x30B1 /* eglCreateImageKHR target */
|
||||
#define EGL_GL_TEXTURE_LEVEL_KHR 0x30BC /* eglCreateImageKHR attribute */
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_gl_texture_cubemap_image
|
||||
#define EGL_KHR_gl_texture_cubemap_image 1
|
||||
#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X_KHR 0x30B3 /* eglCreateImageKHR target */
|
||||
#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X_KHR 0x30B4 /* eglCreateImageKHR target */
|
||||
#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y_KHR 0x30B5 /* eglCreateImageKHR target */
|
||||
#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_KHR 0x30B6 /* eglCreateImageKHR target */
|
||||
#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z_KHR 0x30B7 /* eglCreateImageKHR target */
|
||||
#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_KHR 0x30B8 /* eglCreateImageKHR target */
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_gl_texture_3D_image
|
||||
#define EGL_KHR_gl_texture_3D_image 1
|
||||
#define EGL_GL_TEXTURE_3D_KHR 0x30B2 /* eglCreateImageKHR target */
|
||||
#define EGL_GL_TEXTURE_ZOFFSET_KHR 0x30BD /* eglCreateImageKHR attribute */
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_gl_renderbuffer_image
|
||||
#define EGL_KHR_gl_renderbuffer_image 1
|
||||
#define EGL_GL_RENDERBUFFER_KHR 0x30B9 /* eglCreateImageKHR target */
|
||||
#endif
|
||||
|
||||
#if KHRONOS_SUPPORT_INT64 /* EGLTimeKHR requires 64-bit uint support */
|
||||
#ifndef EGL_KHR_reusable_sync
|
||||
#define EGL_KHR_reusable_sync 1
|
||||
|
||||
typedef void* EGLSyncKHR;
|
||||
typedef khronos_utime_nanoseconds_t EGLTimeKHR;
|
||||
|
||||
#define EGL_SYNC_STATUS_KHR 0x30F1
|
||||
#define EGL_SIGNALED_KHR 0x30F2
|
||||
#define EGL_UNSIGNALED_KHR 0x30F3
|
||||
#define EGL_TIMEOUT_EXPIRED_KHR 0x30F5
|
||||
#define EGL_CONDITION_SATISFIED_KHR 0x30F6
|
||||
#define EGL_SYNC_TYPE_KHR 0x30F7
|
||||
#define EGL_SYNC_REUSABLE_KHR 0x30FA
|
||||
#define EGL_SYNC_FLUSH_COMMANDS_BIT_KHR 0x0001 /* eglClientWaitSyncKHR <flags> bitfield */
|
||||
#define EGL_FOREVER_KHR 0xFFFFFFFFFFFFFFFFull
|
||||
#define EGL_NO_SYNC_KHR ((EGLSyncKHR)0)
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync);
|
||||
EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESYNCKHRPROC) (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync);
|
||||
typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_image_base
|
||||
#define EGL_KHR_image_base 1
|
||||
/* Most interfaces defined by EGL_KHR_image_pixmap above */
|
||||
#define EGL_IMAGE_PRESERVED_KHR 0x30D2 /* eglCreateImageKHR attribute */
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_image_pixmap
|
||||
#define EGL_KHR_image_pixmap 1
|
||||
/* Interfaces defined by EGL_KHR_image above */
|
||||
#endif
|
||||
|
||||
#ifndef EGL_IMG_context_priority
|
||||
#define EGL_IMG_context_priority 1
|
||||
#define EGL_CONTEXT_PRIORITY_LEVEL_IMG 0x3100
|
||||
#define EGL_CONTEXT_PRIORITY_HIGH_IMG 0x3101
|
||||
#define EGL_CONTEXT_PRIORITY_MEDIUM_IMG 0x3102
|
||||
#define EGL_CONTEXT_PRIORITY_LOW_IMG 0x3103
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_lock_surface2
|
||||
#define EGL_KHR_lock_surface2 1
|
||||
#define EGL_BITMAP_PIXEL_SIZE_KHR 0x3110
|
||||
#endif
|
||||
|
||||
#ifndef EGL_NV_coverage_sample
|
||||
#define EGL_NV_coverage_sample 1
|
||||
#define EGL_COVERAGE_BUFFERS_NV 0x30E0
|
||||
#define EGL_COVERAGE_SAMPLES_NV 0x30E1
|
||||
#endif
|
||||
|
||||
#ifndef EGL_NV_depth_nonlinear
|
||||
#define EGL_NV_depth_nonlinear 1
|
||||
#define EGL_DEPTH_ENCODING_NV 0x30E2
|
||||
#define EGL_DEPTH_ENCODING_NONE_NV 0
|
||||
#define EGL_DEPTH_ENCODING_NONLINEAR_NV 0x30E3
|
||||
#endif
|
||||
|
||||
#if KHRONOS_SUPPORT_INT64 /* EGLTimeNV requires 64-bit uint support */
|
||||
#ifndef EGL_NV_sync
|
||||
#define EGL_NV_sync 1
|
||||
#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_NV 0x30E6
|
||||
#define EGL_SYNC_STATUS_NV 0x30E7
|
||||
#define EGL_SIGNALED_NV 0x30E8
|
||||
#define EGL_UNSIGNALED_NV 0x30E9
|
||||
#define EGL_SYNC_FLUSH_COMMANDS_BIT_NV 0x0001
|
||||
#define EGL_FOREVER_NV 0xFFFFFFFFFFFFFFFFull
|
||||
#define EGL_ALREADY_SIGNALED_NV 0x30EA
|
||||
#define EGL_TIMEOUT_EXPIRED_NV 0x30EB
|
||||
#define EGL_CONDITION_SATISFIED_NV 0x30EC
|
||||
#define EGL_SYNC_TYPE_NV 0x30ED
|
||||
#define EGL_SYNC_CONDITION_NV 0x30EE
|
||||
#define EGL_SYNC_FENCE_NV 0x30EF
|
||||
#define EGL_NO_SYNC_NV ((EGLSyncNV)0)
|
||||
typedef void* EGLSyncNV;
|
||||
typedef khronos_utime_nanoseconds_t EGLTimeNV;
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLSyncNV EGLAPIENTRY eglCreateFenceSyncNV (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncNV (EGLSyncNV sync);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglFenceNV (EGLSyncNV sync);
|
||||
EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncNV (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncNV (EGLSyncNV sync, EGLenum mode);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribNV (EGLSyncNV sync, EGLint attribute, EGLint *value);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLSyncNV (EGLAPIENTRYP PFNEGLCREATEFENCESYNCNVPROC) (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCNVPROC) (EGLSyncNV sync);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLFENCENVPROC) (EGLSyncNV sync);
|
||||
typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCNVPROC) (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCNVPROC) (EGLSyncNV sync, EGLenum mode);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBNVPROC) (EGLSyncNV sync, EGLint attribute, EGLint *value);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if KHRONOS_SUPPORT_INT64 /* Dependent on EGL_KHR_reusable_sync which requires 64-bit uint support */
|
||||
#ifndef EGL_KHR_fence_sync
|
||||
#define EGL_KHR_fence_sync 1
|
||||
/* Reuses most tokens and entry points from EGL_KHR_reusable_sync */
|
||||
#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR 0x30F0
|
||||
#define EGL_SYNC_CONDITION_KHR 0x30F8
|
||||
#define EGL_SYNC_FENCE_KHR 0x30F9
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef EGL_HI_clientpixmap
|
||||
#define EGL_HI_clientpixmap 1
|
||||
|
||||
/* Surface Attribute */
|
||||
#define EGL_CLIENT_PIXMAP_POINTER_HI 0x8F74
|
||||
/*
|
||||
* Structure representing a client pixmap
|
||||
* (pixmap's data is in client-space memory).
|
||||
*/
|
||||
struct EGLClientPixmapHI
|
||||
{
|
||||
void* pData;
|
||||
EGLint iWidth;
|
||||
EGLint iHeight;
|
||||
EGLint iStride;
|
||||
};
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurfaceHI(EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI* pixmap);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPIXMAPSURFACEHIPROC) (EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI* pixmap);
|
||||
#endif /* EGL_HI_clientpixmap */
|
||||
|
||||
#ifndef EGL_HI_colorformats
|
||||
#define EGL_HI_colorformats 1
|
||||
/* Config Attribute */
|
||||
#define EGL_COLOR_FORMAT_HI 0x8F70
|
||||
/* Color Formats */
|
||||
#define EGL_COLOR_RGB_HI 0x8F71
|
||||
#define EGL_COLOR_RGBA_HI 0x8F72
|
||||
#define EGL_COLOR_ARGB_HI 0x8F73
|
||||
#endif /* EGL_HI_colorformats */
|
||||
|
||||
#ifndef EGL_MESA_drm_image
|
||||
#define EGL_MESA_drm_image 1
|
||||
#define EGL_DRM_BUFFER_FORMAT_MESA 0x31D0 /* CreateDRMImageMESA attribute */
|
||||
#define EGL_DRM_BUFFER_USE_MESA 0x31D1 /* CreateDRMImageMESA attribute */
|
||||
#define EGL_DRM_BUFFER_FORMAT_ARGB32_MESA 0x31D2 /* EGL_IMAGE_FORMAT_MESA attribute value */
|
||||
#define EGL_DRM_BUFFER_MESA 0x31D3 /* eglCreateImageKHR target */
|
||||
#define EGL_DRM_BUFFER_STRIDE_MESA 0x31D4
|
||||
#define EGL_DRM_BUFFER_USE_SCANOUT_MESA 0x00000001 /* EGL_DRM_BUFFER_USE_MESA bits */
|
||||
#define EGL_DRM_BUFFER_USE_SHARE_MESA 0x00000002 /* EGL_DRM_BUFFER_USE_MESA bits */
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLImageKHR EGLAPIENTRY eglCreateDRMImageMESA (EGLDisplay dpy, const EGLint *attrib_list);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglExportDRMImageMESA (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEDRMIMAGEMESAPROC) (EGLDisplay dpy, const EGLint *attrib_list);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDRMIMAGEMESAPROC) (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride);
|
||||
#endif
|
||||
|
||||
#ifndef EGL_NV_post_sub_buffer
|
||||
#define EGL_NV_post_sub_buffer 1
|
||||
#define EGL_POST_SUB_BUFFER_SUPPORTED_NV 0x30BE
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglPostSubBufferNV (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLPOSTSUBBUFFERNVPROC) (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height);
|
||||
#endif
|
||||
|
||||
#ifndef EGL_ANGLE_query_surface_pointer
|
||||
#define EGL_ANGLE_query_surface_pointer 1
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLBoolean eglQuerySurfacePointerANGLE(EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value);
|
||||
#endif
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSURFACEPOINTERANGLEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value);
|
||||
#endif
|
||||
|
||||
#ifndef EGL_ANGLE_surface_d3d_texture_2d_share_handle
|
||||
#define EGL_ANGLE_surface_d3d_texture_2d_share_handle 1
|
||||
#define EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE 0x3200
|
||||
#endif
|
||||
|
||||
#ifndef EGL_NV_coverage_sample_resolve
|
||||
#define EGL_NV_coverage_sample_resolve 1
|
||||
#define EGL_COVERAGE_SAMPLE_RESOLVE_NV 0x3131
|
||||
#define EGL_COVERAGE_SAMPLE_RESOLVE_DEFAULT_NV 0x3132
|
||||
#define EGL_COVERAGE_SAMPLE_RESOLVE_NONE_NV 0x3133
|
||||
#endif
|
||||
|
||||
#if KHRONOS_SUPPORT_INT64 /* EGLuint64NV requires 64-bit uint support */
|
||||
#ifndef EGL_NV_system_time
|
||||
#define EGL_NV_system_time 1
|
||||
typedef khronos_utime_nanoseconds_t EGLuint64NV;
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeFrequencyNV(void);
|
||||
EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeNV(void);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC) (void);
|
||||
typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMENVPROC) (void);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if KHRONOS_SUPPORT_INT64 /* EGLuint64KHR requires 64-bit uint support */
|
||||
#ifndef EGL_KHR_stream
|
||||
#define EGL_KHR_stream 1
|
||||
typedef void* EGLStreamKHR;
|
||||
typedef khronos_uint64_t EGLuint64KHR;
|
||||
#define EGL_NO_STREAM_KHR ((EGLStreamKHR)0)
|
||||
#define EGL_CONSUMER_LATENCY_USEC_KHR 0x3210
|
||||
#define EGL_PRODUCER_FRAME_KHR 0x3212
|
||||
#define EGL_CONSUMER_FRAME_KHR 0x3213
|
||||
#define EGL_STREAM_STATE_KHR 0x3214
|
||||
#define EGL_STREAM_STATE_CREATED_KHR 0x3215
|
||||
#define EGL_STREAM_STATE_CONNECTING_KHR 0x3216
|
||||
#define EGL_STREAM_STATE_EMPTY_KHR 0x3217
|
||||
#define EGL_STREAM_STATE_NEW_FRAME_AVAILABLE_KHR 0x3218
|
||||
#define EGL_STREAM_STATE_OLD_FRAME_AVAILABLE_KHR 0x3219
|
||||
#define EGL_STREAM_STATE_DISCONNECTED_KHR 0x321A
|
||||
#define EGL_BAD_STREAM_KHR 0x321B
|
||||
#define EGL_BAD_STATE_KHR 0x321C
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamKHR(EGLDisplay dpy, const EGLint *attrib_list);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglDestroyStreamKHR(EGLDisplay dpy, EGLStreamKHR stream);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglStreamAttribKHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamKHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamu64KHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMKHRPROC)(EGLDisplay dpy, const EGLint *attrib_list);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSTREAMKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMATTRIBKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMU64KHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef EGL_KHR_stream /* Requires KHR_stream extension */
|
||||
#ifndef EGL_KHR_stream_consumer_gltexture
|
||||
#define EGL_KHR_stream_consumer_gltexture 1
|
||||
#define EGL_CONSUMER_ACQUIRE_TIMEOUT_USEC_KHR 0x321E
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerGLTextureExternalKHR(EGLDisplay dpy, EGLStreamKHR stream);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerAcquireKHR(EGLDisplay dpy, EGLStreamKHR stream);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerReleaseKHR(EGLDisplay dpy, EGLStreamKHR stream);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERACQUIREKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERRELEASEKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef EGL_KHR_stream /* Requires KHR_stream extension */
|
||||
#ifndef EGL_KHR_stream_producer_eglsurface
|
||||
#define EGL_KHR_stream_producer_eglsurface 1
|
||||
#define EGL_STREAM_BIT_KHR 0x0800
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLSurface EGLAPIENTRY eglCreateStreamProducerSurfaceKHR(EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint *attrib_list);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC)(EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint *attrib_list);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef EGL_KHR_stream /* Requires KHR_stream extension */
|
||||
#ifndef EGL_KHR_stream_producer_aldatalocator
|
||||
#define EGL_KHR_stream_producer_aldatalocator 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef EGL_KHR_stream /* Requires KHR_stream extension */
|
||||
#ifndef EGL_KHR_stream_fifo
|
||||
#define EGL_KHR_stream_fifo 1
|
||||
/* reuse EGLTimeKHR */
|
||||
#define EGL_STREAM_FIFO_LENGTH_KHR 0x31FC
|
||||
#define EGL_STREAM_TIME_NOW_KHR 0x31FD
|
||||
#define EGL_STREAM_TIME_CONSUMER_KHR 0x31FE
|
||||
#define EGL_STREAM_TIME_PRODUCER_KHR 0x31FF
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamTimeKHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR *value);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMTIMEKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR *value);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef EGL_EXT_create_context_robustness
|
||||
#define EGL_EXT_create_context_robustness 1
|
||||
#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT 0x30BF
|
||||
#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT 0x3138
|
||||
#define EGL_NO_RESET_NOTIFICATION_EXT 0x31BE
|
||||
#define EGL_LOSE_CONTEXT_ON_RESET_EXT 0x31BF
|
||||
#endif
|
||||
|
||||
#ifndef EGL_ANGLE_d3d_share_handle_client_buffer
|
||||
#define EGL_ANGLE_d3d_share_handle_client_buffer 1
|
||||
/* reuse EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE */
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_create_context
|
||||
#define EGL_KHR_create_context 1
|
||||
#define EGL_CONTEXT_MAJOR_VERSION_KHR EGL_CONTEXT_CLIENT_VERSION
|
||||
#define EGL_CONTEXT_MINOR_VERSION_KHR 0x30FB
|
||||
#define EGL_CONTEXT_FLAGS_KHR 0x30FC
|
||||
#define EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR 0x30FD
|
||||
#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR 0x31BD
|
||||
#define EGL_NO_RESET_NOTIFICATION_KHR 0x31BE
|
||||
#define EGL_LOSE_CONTEXT_ON_RESET_KHR 0x31BF
|
||||
#define EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR 0x00000001
|
||||
#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR 0x00000002
|
||||
#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR 0x00000004
|
||||
#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR 0x00000001
|
||||
#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR 0x00000002
|
||||
#define EGL_OPENGL_ES3_BIT_KHR 0x00000040
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_surfaceless_context
|
||||
#define EGL_KHR_surfaceless_context 1
|
||||
/* No tokens/entry points, just relaxes an error condition */
|
||||
#endif
|
||||
|
||||
#ifdef EGL_KHR_stream /* Requires KHR_stream extension */
|
||||
#ifndef EGL_KHR_stream_cross_process_fd
|
||||
#define EGL_KHR_stream_cross_process_fd 1
|
||||
typedef int EGLNativeFileDescriptorKHR;
|
||||
#define EGL_NO_FILE_DESCRIPTOR_KHR ((EGLNativeFileDescriptorKHR)(-1))
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLNativeFileDescriptorKHR EGLAPIENTRY eglGetStreamFileDescriptorKHR(EGLDisplay dpy, EGLStreamKHR stream);
|
||||
EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamFromFileDescriptorKHR(EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLNativeFileDescriptorKHR (EGLAPIENTRYP PFNEGLGETSTREAMFILEDESCRIPTORKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream);
|
||||
typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMFROMFILEDESCRIPTORKHRPROC)(EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef EGL_EXT_multiview_window
|
||||
#define EGL_EXT_multiview_window 1
|
||||
#define EGL_MULTIVIEW_VIEW_COUNT_EXT 0x3134
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_wait_sync
|
||||
#define EGL_KHR_wait_sync 1
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLint EGLAPIENTRY eglWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLint (EGLAPIENTRYP PFNEGLWAITSYNCKHRPROC)(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags);
|
||||
#endif
|
||||
|
||||
#ifndef EGL_NV_post_convert_rounding
|
||||
#define EGL_NV_post_convert_rounding 1
|
||||
/* No tokens or entry points, just relaxes behavior of SwapBuffers */
|
||||
#endif
|
||||
|
||||
#ifndef EGL_NV_native_query
|
||||
#define EGL_NV_native_query 1
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativeDisplayNV( EGLDisplay dpy, EGLNativeDisplayType* display_id);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativeWindowNV( EGLDisplay dpy, EGLSurface surf, EGLNativeWindowType* window);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativePixmapNV( EGLDisplay dpy, EGLSurface surf, EGLNativePixmapType* pixmap);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEDISPLAYNVPROC)(EGLDisplay dpy, EGLNativeDisplayType *display_id);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEWINDOWNVPROC)(EGLDisplay dpy, EGLSurface surf, EGLNativeWindowType *window);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEPIXMAPNVPROC)(EGLDisplay dpy, EGLSurface surf, EGLNativePixmapType *pixmap);
|
||||
#endif
|
||||
|
||||
#ifndef EGL_NV_3dvision_surface
|
||||
#define EGL_NV_3dvision_surface 1
|
||||
#define EGL_AUTO_STEREO_NV 0x3136
|
||||
#endif
|
||||
|
||||
#ifndef EGL_ANDROID_framebuffer_target
|
||||
#define EGL_ANDROID_framebuffer_target 1
|
||||
#define EGL_FRAMEBUFFER_TARGET_ANDROID 0x3147
|
||||
#endif
|
||||
|
||||
#ifndef EGL_ANDROID_blob_cache
|
||||
#define EGL_ANDROID_blob_cache 1
|
||||
typedef khronos_ssize_t EGLsizeiANDROID;
|
||||
typedef void (*EGLSetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, const void *value, EGLsizeiANDROID valueSize);
|
||||
typedef EGLsizeiANDROID (*EGLGetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, void *value, EGLsizeiANDROID valueSize);
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI void EGLAPIENTRY eglSetBlobCacheFuncsANDROID(EGLDisplay dpy, EGLSetBlobFuncANDROID set, EGLGetBlobFuncANDROID get);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef void (EGLAPIENTRYP PFNEGLSETBLOBCACHEFUNCSANDROIDPROC)(EGLDisplay dpy, EGLSetBlobFuncANDROID set, EGLGetBlobFuncANDROID get);
|
||||
#endif
|
||||
|
||||
#ifndef EGL_ANDROID_image_native_buffer
|
||||
#define EGL_ANDROID_image_native_buffer 1
|
||||
#define EGL_NATIVE_BUFFER_ANDROID 0x3140
|
||||
#endif
|
||||
|
||||
#ifndef EGL_ANDROID_native_fence_sync
|
||||
#define EGL_ANDROID_native_fence_sync 1
|
||||
#define EGL_SYNC_NATIVE_FENCE_ANDROID 0x3144
|
||||
#define EGL_SYNC_NATIVE_FENCE_FD_ANDROID 0x3145
|
||||
#define EGL_SYNC_NATIVE_FENCE_SIGNALED_ANDROID 0x3146
|
||||
#define EGL_NO_NATIVE_FENCE_FD_ANDROID -1
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLint EGLAPIENTRY eglDupNativeFenceFDANDROID( EGLDisplay dpy, EGLSyncKHR);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLint (EGLAPIENTRYP PFNEGLDUPNATIVEFENCEFDANDROIDPROC)(EGLDisplay dpy, EGLSyncKHR);
|
||||
#endif
|
||||
|
||||
#ifndef EGL_ANDROID_recordable
|
||||
#define EGL_ANDROID_recordable 1
|
||||
#define EGL_RECORDABLE_ANDROID 0x3142
|
||||
#endif
|
||||
|
||||
#ifndef EGL_EXT_buffer_age
|
||||
#define EGL_EXT_buffer_age 1
|
||||
#define EGL_BUFFER_AGE_EXT 0x313D
|
||||
#endif
|
||||
|
||||
#ifndef EGL_EXT_image_dma_buf_import
|
||||
#define EGL_EXT_image_dma_buf_import 1
|
||||
#define EGL_LINUX_DMA_BUF_EXT 0x3270
|
||||
#define EGL_LINUX_DRM_FOURCC_EXT 0x3271
|
||||
#define EGL_DMA_BUF_PLANE0_FD_EXT 0x3272
|
||||
#define EGL_DMA_BUF_PLANE0_OFFSET_EXT 0x3273
|
||||
#define EGL_DMA_BUF_PLANE0_PITCH_EXT 0x3274
|
||||
#define EGL_DMA_BUF_PLANE1_FD_EXT 0x3275
|
||||
#define EGL_DMA_BUF_PLANE1_OFFSET_EXT 0x3276
|
||||
#define EGL_DMA_BUF_PLANE1_PITCH_EXT 0x3277
|
||||
#define EGL_DMA_BUF_PLANE2_FD_EXT 0x3278
|
||||
#define EGL_DMA_BUF_PLANE2_OFFSET_EXT 0x3279
|
||||
#define EGL_DMA_BUF_PLANE2_PITCH_EXT 0x327A
|
||||
#define EGL_YUV_COLOR_SPACE_HINT_EXT 0x327B
|
||||
#define EGL_SAMPLE_RANGE_HINT_EXT 0x327C
|
||||
#define EGL_YUV_CHROMA_HORIZONTAL_SITING_HINT_EXT 0x327D
|
||||
#define EGL_YUV_CHROMA_VERTICAL_SITING_HINT_EXT 0x327E
|
||||
#define EGL_ITU_REC601_EXT 0x327F
|
||||
#define EGL_ITU_REC709_EXT 0x3280
|
||||
#define EGL_ITU_REC2020_EXT 0x3281
|
||||
#define EGL_YUV_FULL_RANGE_EXT 0x3282
|
||||
#define EGL_YUV_NARROW_RANGE_EXT 0x3283
|
||||
#define EGL_YUV_CHROMA_SITING_0_EXT 0x3284
|
||||
#define EGL_YUV_CHROMA_SITING_0_5_EXT 0x3285
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __eglext_h_ */
|
12740
deps/GL/glext.h
vendored
12740
deps/GL/glext.h
vendored
File diff suppressed because it is too large
Load Diff
1009
deps/GL/glxext.h
vendored
1009
deps/GL/glxext.h
vendored
File diff suppressed because it is too large
Load Diff
943
deps/GL/wglext.h
vendored
943
deps/GL/wglext.h
vendored
|
@ -1,943 +0,0 @@
|
|||
#ifndef __wglext_h_
|
||||
#define __wglext_h_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2007-2012 The Khronos Group Inc.
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person obtaining a
|
||||
** copy of this software and/or associated documentation files (the
|
||||
** "Materials"), to deal in the Materials without restriction, including
|
||||
** without limitation the rights to use, copy, modify, merge, publish,
|
||||
** distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
** permit persons to whom the Materials are furnished to do so, subject to
|
||||
** the following conditions:
|
||||
**
|
||||
** The above copyright notice and this permission notice shall be included
|
||||
** in all copies or substantial portions of the Materials.
|
||||
**
|
||||
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*/
|
||||
|
||||
/* Function declaration macros - to move into glplatform.h */
|
||||
|
||||
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
|
||||
#define WIN32_LEAN_AND_MEAN 1
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#ifndef APIENTRY
|
||||
#define APIENTRY
|
||||
#endif
|
||||
#ifndef APIENTRYP
|
||||
#define APIENTRYP APIENTRY *
|
||||
#endif
|
||||
#ifndef GLAPI
|
||||
#define GLAPI extern
|
||||
#endif
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
/* Header file version number */
|
||||
/* wglext.h last updated 2012/01/04 */
|
||||
/* Current version at http://www.opengl.org/registry/ */
|
||||
#define WGL_WGLEXT_VERSION 24
|
||||
|
||||
#ifndef WGL_ARB_buffer_region
|
||||
#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001
|
||||
#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002
|
||||
#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004
|
||||
#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_multisample
|
||||
#define WGL_SAMPLE_BUFFERS_ARB 0x2041
|
||||
#define WGL_SAMPLES_ARB 0x2042
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_extensions_string
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_pixel_format
|
||||
#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000
|
||||
#define WGL_DRAW_TO_WINDOW_ARB 0x2001
|
||||
#define WGL_DRAW_TO_BITMAP_ARB 0x2002
|
||||
#define WGL_ACCELERATION_ARB 0x2003
|
||||
#define WGL_NEED_PALETTE_ARB 0x2004
|
||||
#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005
|
||||
#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006
|
||||
#define WGL_SWAP_METHOD_ARB 0x2007
|
||||
#define WGL_NUMBER_OVERLAYS_ARB 0x2008
|
||||
#define WGL_NUMBER_UNDERLAYS_ARB 0x2009
|
||||
#define WGL_TRANSPARENT_ARB 0x200A
|
||||
#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037
|
||||
#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038
|
||||
#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039
|
||||
#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A
|
||||
#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B
|
||||
#define WGL_SHARE_DEPTH_ARB 0x200C
|
||||
#define WGL_SHARE_STENCIL_ARB 0x200D
|
||||
#define WGL_SHARE_ACCUM_ARB 0x200E
|
||||
#define WGL_SUPPORT_GDI_ARB 0x200F
|
||||
#define WGL_SUPPORT_OPENGL_ARB 0x2010
|
||||
#define WGL_DOUBLE_BUFFER_ARB 0x2011
|
||||
#define WGL_STEREO_ARB 0x2012
|
||||
#define WGL_PIXEL_TYPE_ARB 0x2013
|
||||
#define WGL_COLOR_BITS_ARB 0x2014
|
||||
#define WGL_RED_BITS_ARB 0x2015
|
||||
#define WGL_RED_SHIFT_ARB 0x2016
|
||||
#define WGL_GREEN_BITS_ARB 0x2017
|
||||
#define WGL_GREEN_SHIFT_ARB 0x2018
|
||||
#define WGL_BLUE_BITS_ARB 0x2019
|
||||
#define WGL_BLUE_SHIFT_ARB 0x201A
|
||||
#define WGL_ALPHA_BITS_ARB 0x201B
|
||||
#define WGL_ALPHA_SHIFT_ARB 0x201C
|
||||
#define WGL_ACCUM_BITS_ARB 0x201D
|
||||
#define WGL_ACCUM_RED_BITS_ARB 0x201E
|
||||
#define WGL_ACCUM_GREEN_BITS_ARB 0x201F
|
||||
#define WGL_ACCUM_BLUE_BITS_ARB 0x2020
|
||||
#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021
|
||||
#define WGL_DEPTH_BITS_ARB 0x2022
|
||||
#define WGL_STENCIL_BITS_ARB 0x2023
|
||||
#define WGL_AUX_BUFFERS_ARB 0x2024
|
||||
#define WGL_NO_ACCELERATION_ARB 0x2025
|
||||
#define WGL_GENERIC_ACCELERATION_ARB 0x2026
|
||||
#define WGL_FULL_ACCELERATION_ARB 0x2027
|
||||
#define WGL_SWAP_EXCHANGE_ARB 0x2028
|
||||
#define WGL_SWAP_COPY_ARB 0x2029
|
||||
#define WGL_SWAP_UNDEFINED_ARB 0x202A
|
||||
#define WGL_TYPE_RGBA_ARB 0x202B
|
||||
#define WGL_TYPE_COLORINDEX_ARB 0x202C
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_make_current_read
|
||||
#define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043
|
||||
#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_pbuffer
|
||||
#define WGL_DRAW_TO_PBUFFER_ARB 0x202D
|
||||
#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E
|
||||
#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F
|
||||
#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030
|
||||
#define WGL_PBUFFER_LARGEST_ARB 0x2033
|
||||
#define WGL_PBUFFER_WIDTH_ARB 0x2034
|
||||
#define WGL_PBUFFER_HEIGHT_ARB 0x2035
|
||||
#define WGL_PBUFFER_LOST_ARB 0x2036
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_render_texture
|
||||
#define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070
|
||||
#define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071
|
||||
#define WGL_TEXTURE_FORMAT_ARB 0x2072
|
||||
#define WGL_TEXTURE_TARGET_ARB 0x2073
|
||||
#define WGL_MIPMAP_TEXTURE_ARB 0x2074
|
||||
#define WGL_TEXTURE_RGB_ARB 0x2075
|
||||
#define WGL_TEXTURE_RGBA_ARB 0x2076
|
||||
#define WGL_NO_TEXTURE_ARB 0x2077
|
||||
#define WGL_TEXTURE_CUBE_MAP_ARB 0x2078
|
||||
#define WGL_TEXTURE_1D_ARB 0x2079
|
||||
#define WGL_TEXTURE_2D_ARB 0x207A
|
||||
#define WGL_MIPMAP_LEVEL_ARB 0x207B
|
||||
#define WGL_CUBE_MAP_FACE_ARB 0x207C
|
||||
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D
|
||||
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E
|
||||
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F
|
||||
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080
|
||||
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081
|
||||
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082
|
||||
#define WGL_FRONT_LEFT_ARB 0x2083
|
||||
#define WGL_FRONT_RIGHT_ARB 0x2084
|
||||
#define WGL_BACK_LEFT_ARB 0x2085
|
||||
#define WGL_BACK_RIGHT_ARB 0x2086
|
||||
#define WGL_AUX0_ARB 0x2087
|
||||
#define WGL_AUX1_ARB 0x2088
|
||||
#define WGL_AUX2_ARB 0x2089
|
||||
#define WGL_AUX3_ARB 0x208A
|
||||
#define WGL_AUX4_ARB 0x208B
|
||||
#define WGL_AUX5_ARB 0x208C
|
||||
#define WGL_AUX6_ARB 0x208D
|
||||
#define WGL_AUX7_ARB 0x208E
|
||||
#define WGL_AUX8_ARB 0x208F
|
||||
#define WGL_AUX9_ARB 0x2090
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_pixel_format_float
|
||||
#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_framebuffer_sRGB
|
||||
#define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_create_context
|
||||
#define WGL_CONTEXT_DEBUG_BIT_ARB 0x00000001
|
||||
#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002
|
||||
#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091
|
||||
#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092
|
||||
#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093
|
||||
#define WGL_CONTEXT_FLAGS_ARB 0x2094
|
||||
#define ERROR_INVALID_VERSION_ARB 0x2095
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_create_context_profile
|
||||
#define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126
|
||||
#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001
|
||||
#define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002
|
||||
#define ERROR_INVALID_PROFILE_ARB 0x2096
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_create_context_robustness
|
||||
#define WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004
|
||||
#define WGL_LOSE_CONTEXT_ON_RESET_ARB 0x8252
|
||||
#define WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
|
||||
#define WGL_NO_RESET_NOTIFICATION_ARB 0x8261
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_make_current_read
|
||||
#define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_pixel_format
|
||||
#define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000
|
||||
#define WGL_DRAW_TO_WINDOW_EXT 0x2001
|
||||
#define WGL_DRAW_TO_BITMAP_EXT 0x2002
|
||||
#define WGL_ACCELERATION_EXT 0x2003
|
||||
#define WGL_NEED_PALETTE_EXT 0x2004
|
||||
#define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005
|
||||
#define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006
|
||||
#define WGL_SWAP_METHOD_EXT 0x2007
|
||||
#define WGL_NUMBER_OVERLAYS_EXT 0x2008
|
||||
#define WGL_NUMBER_UNDERLAYS_EXT 0x2009
|
||||
#define WGL_TRANSPARENT_EXT 0x200A
|
||||
#define WGL_TRANSPARENT_VALUE_EXT 0x200B
|
||||
#define WGL_SHARE_DEPTH_EXT 0x200C
|
||||
#define WGL_SHARE_STENCIL_EXT 0x200D
|
||||
#define WGL_SHARE_ACCUM_EXT 0x200E
|
||||
#define WGL_SUPPORT_GDI_EXT 0x200F
|
||||
#define WGL_SUPPORT_OPENGL_EXT 0x2010
|
||||
#define WGL_DOUBLE_BUFFER_EXT 0x2011
|
||||
#define WGL_STEREO_EXT 0x2012
|
||||
#define WGL_PIXEL_TYPE_EXT 0x2013
|
||||
#define WGL_COLOR_BITS_EXT 0x2014
|
||||
#define WGL_RED_BITS_EXT 0x2015
|
||||
#define WGL_RED_SHIFT_EXT 0x2016
|
||||
#define WGL_GREEN_BITS_EXT 0x2017
|
||||
#define WGL_GREEN_SHIFT_EXT 0x2018
|
||||
#define WGL_BLUE_BITS_EXT 0x2019
|
||||
#define WGL_BLUE_SHIFT_EXT 0x201A
|
||||
#define WGL_ALPHA_BITS_EXT 0x201B
|
||||
#define WGL_ALPHA_SHIFT_EXT 0x201C
|
||||
#define WGL_ACCUM_BITS_EXT 0x201D
|
||||
#define WGL_ACCUM_RED_BITS_EXT 0x201E
|
||||
#define WGL_ACCUM_GREEN_BITS_EXT 0x201F
|
||||
#define WGL_ACCUM_BLUE_BITS_EXT 0x2020
|
||||
#define WGL_ACCUM_ALPHA_BITS_EXT 0x2021
|
||||
#define WGL_DEPTH_BITS_EXT 0x2022
|
||||
#define WGL_STENCIL_BITS_EXT 0x2023
|
||||
#define WGL_AUX_BUFFERS_EXT 0x2024
|
||||
#define WGL_NO_ACCELERATION_EXT 0x2025
|
||||
#define WGL_GENERIC_ACCELERATION_EXT 0x2026
|
||||
#define WGL_FULL_ACCELERATION_EXT 0x2027
|
||||
#define WGL_SWAP_EXCHANGE_EXT 0x2028
|
||||
#define WGL_SWAP_COPY_EXT 0x2029
|
||||
#define WGL_SWAP_UNDEFINED_EXT 0x202A
|
||||
#define WGL_TYPE_RGBA_EXT 0x202B
|
||||
#define WGL_TYPE_COLORINDEX_EXT 0x202C
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_pbuffer
|
||||
#define WGL_DRAW_TO_PBUFFER_EXT 0x202D
|
||||
#define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E
|
||||
#define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F
|
||||
#define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030
|
||||
#define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031
|
||||
#define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032
|
||||
#define WGL_PBUFFER_LARGEST_EXT 0x2033
|
||||
#define WGL_PBUFFER_WIDTH_EXT 0x2034
|
||||
#define WGL_PBUFFER_HEIGHT_EXT 0x2035
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_depth_float
|
||||
#define WGL_DEPTH_FLOAT_EXT 0x2040
|
||||
#endif
|
||||
|
||||
#ifndef WGL_3DFX_multisample
|
||||
#define WGL_SAMPLE_BUFFERS_3DFX 0x2060
|
||||
#define WGL_SAMPLES_3DFX 0x2061
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_multisample
|
||||
#define WGL_SAMPLE_BUFFERS_EXT 0x2041
|
||||
#define WGL_SAMPLES_EXT 0x2042
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_digital_video_control
|
||||
#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050
|
||||
#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051
|
||||
#define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052
|
||||
#define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_gamma
|
||||
#define WGL_GAMMA_TABLE_SIZE_I3D 0x204E
|
||||
#define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_genlock
|
||||
#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044
|
||||
#define WGL_GENLOCK_SOURCE_EXTENAL_SYNC_I3D 0x2045
|
||||
#define WGL_GENLOCK_SOURCE_EXTENAL_FIELD_I3D 0x2046
|
||||
#define WGL_GENLOCK_SOURCE_EXTENAL_TTL_I3D 0x2047
|
||||
#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048
|
||||
#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049
|
||||
#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A
|
||||
#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B
|
||||
#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_image_buffer
|
||||
#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001
|
||||
#define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_swap_frame_lock
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_render_depth_texture
|
||||
#define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4
|
||||
#define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5
|
||||
#define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6
|
||||
#define WGL_DEPTH_COMPONENT_NV 0x20A7
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_render_texture_rectangle
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1
|
||||
#define WGL_TEXTURE_RECTANGLE_NV 0x20A2
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ATI_pixel_format_float
|
||||
#define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_float_buffer
|
||||
#define WGL_FLOAT_COMPONENTS_NV 0x20B0
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4
|
||||
#define WGL_TEXTURE_FLOAT_R_NV 0x20B5
|
||||
#define WGL_TEXTURE_FLOAT_RG_NV 0x20B6
|
||||
#define WGL_TEXTURE_FLOAT_RGB_NV 0x20B7
|
||||
#define WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8
|
||||
#endif
|
||||
|
||||
#ifndef WGL_3DL_stereo_control
|
||||
#define WGL_STEREO_EMITTER_ENABLE_3DL 0x2055
|
||||
#define WGL_STEREO_EMITTER_DISABLE_3DL 0x2056
|
||||
#define WGL_STEREO_POLARITY_NORMAL_3DL 0x2057
|
||||
#define WGL_STEREO_POLARITY_INVERT_3DL 0x2058
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_pixel_format_packed_float
|
||||
#define WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_framebuffer_sRGB
|
||||
#define WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_present_video
|
||||
#define WGL_NUM_VIDEO_SLOTS_NV 0x20F0
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_video_out
|
||||
#define WGL_BIND_TO_VIDEO_RGB_NV 0x20C0
|
||||
#define WGL_BIND_TO_VIDEO_RGBA_NV 0x20C1
|
||||
#define WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV 0x20C2
|
||||
#define WGL_VIDEO_OUT_COLOR_NV 0x20C3
|
||||
#define WGL_VIDEO_OUT_ALPHA_NV 0x20C4
|
||||
#define WGL_VIDEO_OUT_DEPTH_NV 0x20C5
|
||||
#define WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6
|
||||
#define WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7
|
||||
#define WGL_VIDEO_OUT_FRAME 0x20C8
|
||||
#define WGL_VIDEO_OUT_FIELD_1 0x20C9
|
||||
#define WGL_VIDEO_OUT_FIELD_2 0x20CA
|
||||
#define WGL_VIDEO_OUT_STACKED_FIELDS_1_2 0x20CB
|
||||
#define WGL_VIDEO_OUT_STACKED_FIELDS_2_1 0x20CC
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_swap_group
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_gpu_affinity
|
||||
#define WGL_ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0
|
||||
#define WGL_ERROR_MISSING_AFFINITY_MASK_NV 0x20D1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_AMD_gpu_association
|
||||
#define WGL_GPU_VENDOR_AMD 0x1F00
|
||||
#define WGL_GPU_RENDERER_STRING_AMD 0x1F01
|
||||
#define WGL_GPU_OPENGL_VERSION_STRING_AMD 0x1F02
|
||||
#define WGL_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2
|
||||
#define WGL_GPU_RAM_AMD 0x21A3
|
||||
#define WGL_GPU_CLOCK_AMD 0x21A4
|
||||
#define WGL_GPU_NUM_PIPES_AMD 0x21A5
|
||||
#define WGL_GPU_NUM_SIMD_AMD 0x21A6
|
||||
#define WGL_GPU_NUM_RB_AMD 0x21A7
|
||||
#define WGL_GPU_NUM_SPI_AMD 0x21A8
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_video_capture
|
||||
#define WGL_UNIQUE_ID_NV 0x20CE
|
||||
#define WGL_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_copy_image
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_multisample_coverage
|
||||
#define WGL_COVERAGE_SAMPLES_NV 0x2042
|
||||
#define WGL_COLOR_SAMPLES_NV 0x20B9
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_create_context_es2_profile
|
||||
#define WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_DX_interop
|
||||
#define WGL_ACCESS_READ_ONLY_NV 0x00000000
|
||||
#define WGL_ACCESS_READ_WRITE_NV 0x00000001
|
||||
#define WGL_ACCESS_WRITE_DISCARD_NV 0x00000002
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_DX_interop2
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_swap_control_tear
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
#ifndef WGL_ARB_pbuffer
|
||||
DECLARE_HANDLE(HPBUFFERARB);
|
||||
#endif
|
||||
#ifndef WGL_EXT_pbuffer
|
||||
DECLARE_HANDLE(HPBUFFEREXT);
|
||||
#endif
|
||||
#ifndef WGL_NV_present_video
|
||||
DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV);
|
||||
#endif
|
||||
#ifndef WGL_NV_video_output
|
||||
DECLARE_HANDLE(HPVIDEODEV);
|
||||
#endif
|
||||
#ifndef WGL_NV_gpu_affinity
|
||||
DECLARE_HANDLE(HPGPUNV);
|
||||
DECLARE_HANDLE(HGPUNV);
|
||||
|
||||
typedef struct _GPU_DEVICE {
|
||||
DWORD cb;
|
||||
CHAR DeviceName[32];
|
||||
CHAR DeviceString[128];
|
||||
DWORD Flags;
|
||||
RECT rcVirtualScreen;
|
||||
} GPU_DEVICE, *PGPU_DEVICE;
|
||||
#endif
|
||||
#ifndef WGL_NV_video_capture
|
||||
DECLARE_HANDLE(HVIDEOINPUTDEVICENV);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_buffer_region
|
||||
#define WGL_ARB_buffer_region 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern HANDLE WINAPI wglCreateBufferRegionARB (HDC hDC, int iLayerPlane, UINT uType);
|
||||
extern VOID WINAPI wglDeleteBufferRegionARB (HANDLE hRegion);
|
||||
extern BOOL WINAPI wglSaveBufferRegionARB (HANDLE hRegion, int x, int y, int width, int height);
|
||||
extern BOOL WINAPI wglRestoreBufferRegionARB (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType);
|
||||
typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion);
|
||||
typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height);
|
||||
typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_multisample
|
||||
#define WGL_ARB_multisample 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_extensions_string
|
||||
#define WGL_ARB_extensions_string 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern const char * WINAPI wglGetExtensionsStringARB (HDC hdc);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_pixel_format
|
||||
#define WGL_ARB_pixel_format 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglGetPixelFormatAttribivARB (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues);
|
||||
extern BOOL WINAPI wglGetPixelFormatAttribfvARB (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues);
|
||||
extern BOOL WINAPI wglChoosePixelFormatARB (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues);
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues);
|
||||
typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_make_current_read
|
||||
#define WGL_ARB_make_current_read 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglMakeContextCurrentARB (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
|
||||
extern HDC WINAPI wglGetCurrentReadDCARB (void);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
|
||||
typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (void);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_pbuffer
|
||||
#define WGL_ARB_pbuffer 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern HPBUFFERARB WINAPI wglCreatePbufferARB (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
|
||||
extern HDC WINAPI wglGetPbufferDCARB (HPBUFFERARB hPbuffer);
|
||||
extern int WINAPI wglReleasePbufferDCARB (HPBUFFERARB hPbuffer, HDC hDC);
|
||||
extern BOOL WINAPI wglDestroyPbufferARB (HPBUFFERARB hPbuffer);
|
||||
extern BOOL WINAPI wglQueryPbufferARB (HPBUFFERARB hPbuffer, int iAttribute, int *piValue);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
|
||||
typedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer);
|
||||
typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC);
|
||||
typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int *piValue);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_render_texture
|
||||
#define WGL_ARB_render_texture 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglBindTexImageARB (HPBUFFERARB hPbuffer, int iBuffer);
|
||||
extern BOOL WINAPI wglReleaseTexImageARB (HPBUFFERARB hPbuffer, int iBuffer);
|
||||
extern BOOL WINAPI wglSetPbufferAttribARB (HPBUFFERARB hPbuffer, const int *piAttribList);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int *piAttribList);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_pixel_format_float
|
||||
#define WGL_ARB_pixel_format_float 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_framebuffer_sRGB
|
||||
#define WGL_ARB_framebuffer_sRGB 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_create_context
|
||||
#define WGL_ARB_create_context 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern HGLRC WINAPI wglCreateContextAttribsARB (HDC hDC, HGLRC hShareContext, const int *attribList);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int *attribList);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_create_context_profile
|
||||
#define WGL_ARB_create_context_profile 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_create_context_robustness
|
||||
#define WGL_ARB_create_context_robustness 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_display_color_table
|
||||
#define WGL_EXT_display_color_table 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern GLboolean WINAPI wglCreateDisplayColorTableEXT (GLushort id);
|
||||
extern GLboolean WINAPI wglLoadDisplayColorTableEXT (const GLushort *table, GLuint length);
|
||||
extern GLboolean WINAPI wglBindDisplayColorTableEXT (GLushort id);
|
||||
extern VOID WINAPI wglDestroyDisplayColorTableEXT (GLushort id);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id);
|
||||
typedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (const GLushort *table, GLuint length);
|
||||
typedef GLboolean (WINAPI * PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id);
|
||||
typedef VOID (WINAPI * PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_extensions_string
|
||||
#define WGL_EXT_extensions_string 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern const char * WINAPI wglGetExtensionsStringEXT (void);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_make_current_read
|
||||
#define WGL_EXT_make_current_read 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglMakeContextCurrentEXT (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
|
||||
extern HDC WINAPI wglGetCurrentReadDCEXT (void);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
|
||||
typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (void);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_pbuffer
|
||||
#define WGL_EXT_pbuffer 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern HPBUFFEREXT WINAPI wglCreatePbufferEXT (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
|
||||
extern HDC WINAPI wglGetPbufferDCEXT (HPBUFFEREXT hPbuffer);
|
||||
extern int WINAPI wglReleasePbufferDCEXT (HPBUFFEREXT hPbuffer, HDC hDC);
|
||||
extern BOOL WINAPI wglDestroyPbufferEXT (HPBUFFEREXT hPbuffer);
|
||||
extern BOOL WINAPI wglQueryPbufferEXT (HPBUFFEREXT hPbuffer, int iAttribute, int *piValue);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
|
||||
typedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer);
|
||||
typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC);
|
||||
typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int *piValue);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_pixel_format
|
||||
#define WGL_EXT_pixel_format 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglGetPixelFormatAttribivEXT (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues);
|
||||
extern BOOL WINAPI wglGetPixelFormatAttribfvEXT (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues);
|
||||
extern BOOL WINAPI wglChoosePixelFormatEXT (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues);
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues);
|
||||
typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_swap_control
|
||||
#define WGL_EXT_swap_control 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglSwapIntervalEXT (int interval);
|
||||
extern int WINAPI wglGetSwapIntervalEXT (void);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval);
|
||||
typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_depth_float
|
||||
#define WGL_EXT_depth_float 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_vertex_array_range
|
||||
#define WGL_NV_vertex_array_range 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern void* WINAPI wglAllocateMemoryNV (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
|
||||
extern void WINAPI wglFreeMemoryNV (void *pointer);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef void* (WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
|
||||
typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_3DFX_multisample
|
||||
#define WGL_3DFX_multisample 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_multisample
|
||||
#define WGL_EXT_multisample 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_OML_sync_control
|
||||
#define WGL_OML_sync_control 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglGetSyncValuesOML (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||
extern BOOL WINAPI wglGetMscRateOML (HDC hdc, INT32 *numerator, INT32 *denominator);
|
||||
extern INT64 WINAPI wglSwapBuffersMscOML (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder);
|
||||
extern INT64 WINAPI wglSwapLayerBuffersMscOML (HDC hdc, int fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder);
|
||||
extern BOOL WINAPI wglWaitForMscOML (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||
extern BOOL WINAPI wglWaitForSbcOML (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||
typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32 *numerator, INT32 *denominator);
|
||||
typedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder);
|
||||
typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, int fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder);
|
||||
typedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||
typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_digital_video_control
|
||||
#define WGL_I3D_digital_video_control 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglGetDigitalVideoParametersI3D (HDC hDC, int iAttribute, int *piValue);
|
||||
extern BOOL WINAPI wglSetDigitalVideoParametersI3D (HDC hDC, int iAttribute, const int *piValue);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue);
|
||||
typedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_gamma
|
||||
#define WGL_I3D_gamma 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglGetGammaTableParametersI3D (HDC hDC, int iAttribute, int *piValue);
|
||||
extern BOOL WINAPI wglSetGammaTableParametersI3D (HDC hDC, int iAttribute, const int *piValue);
|
||||
extern BOOL WINAPI wglGetGammaTableI3D (HDC hDC, int iEntries, USHORT *puRed, USHORT *puGreen, USHORT *puBlue);
|
||||
extern BOOL WINAPI wglSetGammaTableI3D (HDC hDC, int iEntries, const USHORT *puRed, const USHORT *puGreen, const USHORT *puBlue);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue);
|
||||
typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT *puRed, USHORT *puGreen, USHORT *puBlue);
|
||||
typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT *puRed, const USHORT *puGreen, const USHORT *puBlue);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_genlock
|
||||
#define WGL_I3D_genlock 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglEnableGenlockI3D (HDC hDC);
|
||||
extern BOOL WINAPI wglDisableGenlockI3D (HDC hDC);
|
||||
extern BOOL WINAPI wglIsEnabledGenlockI3D (HDC hDC, BOOL *pFlag);
|
||||
extern BOOL WINAPI wglGenlockSourceI3D (HDC hDC, UINT uSource);
|
||||
extern BOOL WINAPI wglGetGenlockSourceI3D (HDC hDC, UINT *uSource);
|
||||
extern BOOL WINAPI wglGenlockSourceEdgeI3D (HDC hDC, UINT uEdge);
|
||||
extern BOOL WINAPI wglGetGenlockSourceEdgeI3D (HDC hDC, UINT *uEdge);
|
||||
extern BOOL WINAPI wglGenlockSampleRateI3D (HDC hDC, UINT uRate);
|
||||
extern BOOL WINAPI wglGetGenlockSampleRateI3D (HDC hDC, UINT *uRate);
|
||||
extern BOOL WINAPI wglGenlockSourceDelayI3D (HDC hDC, UINT uDelay);
|
||||
extern BOOL WINAPI wglGetGenlockSourceDelayI3D (HDC hDC, UINT *uDelay);
|
||||
extern BOOL WINAPI wglQueryGenlockMaxSourceDelayI3D (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC);
|
||||
typedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC);
|
||||
typedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL *pFlag);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT *uSource);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT *uEdge);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT *uRate);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT *uDelay);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_image_buffer
|
||||
#define WGL_I3D_image_buffer 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern LPVOID WINAPI wglCreateImageBufferI3D (HDC hDC, DWORD dwSize, UINT uFlags);
|
||||
extern BOOL WINAPI wglDestroyImageBufferI3D (HDC hDC, LPVOID pAddress);
|
||||
extern BOOL WINAPI wglAssociateImageBufferEventsI3D (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count);
|
||||
extern BOOL WINAPI wglReleaseImageBufferEventsI3D (HDC hDC, const LPVOID *pAddress, UINT count);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags);
|
||||
typedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress);
|
||||
typedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count);
|
||||
typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const LPVOID *pAddress, UINT count);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_swap_frame_lock
|
||||
#define WGL_I3D_swap_frame_lock 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglEnableFrameLockI3D (void);
|
||||
extern BOOL WINAPI wglDisableFrameLockI3D (void);
|
||||
extern BOOL WINAPI wglIsEnabledFrameLockI3D (BOOL *pFlag);
|
||||
extern BOOL WINAPI wglQueryFrameLockMasterI3D (BOOL *pFlag);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (void);
|
||||
typedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (void);
|
||||
typedef BOOL (WINAPI * PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL *pFlag);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL *pFlag);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_I3D_swap_frame_usage
|
||||
#define WGL_I3D_swap_frame_usage 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglGetFrameUsageI3D (float *pUsage);
|
||||
extern BOOL WINAPI wglBeginFrameTrackingI3D (void);
|
||||
extern BOOL WINAPI wglEndFrameTrackingI3D (void);
|
||||
extern BOOL WINAPI wglQueryFrameTrackingI3D (DWORD *pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float *pUsage);
|
||||
typedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void);
|
||||
typedef BOOL (WINAPI * PFNWGLENDFRAMETRACKINGI3DPROC) (void);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD *pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ATI_pixel_format_float
|
||||
#define WGL_ATI_pixel_format_float 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_float_buffer
|
||||
#define WGL_NV_float_buffer 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_3DL_stereo_control
|
||||
#define WGL_3DL_stereo_control 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglSetStereoEmitterState3DL (HDC hDC, UINT uState);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLSETSTEREOEMITTERSTATE3DLPROC) (HDC hDC, UINT uState);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_pixel_format_packed_float
|
||||
#define WGL_EXT_pixel_format_packed_float 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_framebuffer_sRGB
|
||||
#define WGL_EXT_framebuffer_sRGB 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_present_video
|
||||
#define WGL_NV_present_video 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern int WINAPI wglEnumerateVideoDevicesNV (HDC hDC, HVIDEOOUTPUTDEVICENV *phDeviceList);
|
||||
extern BOOL WINAPI wglBindVideoDeviceNV (HDC hDC, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int *piAttribList);
|
||||
extern BOOL WINAPI wglQueryCurrentContextNV (int iAttribute, int *piValue);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef int (WINAPI * PFNWGLENUMERATEVIDEODEVICESNVPROC) (HDC hDC, HVIDEOOUTPUTDEVICENV *phDeviceList);
|
||||
typedef BOOL (WINAPI * PFNWGLBINDVIDEODEVICENVPROC) (HDC hDC, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int *piAttribList);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYCURRENTCONTEXTNVPROC) (int iAttribute, int *piValue);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_video_output
|
||||
#define WGL_NV_video_output 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglGetVideoDeviceNV (HDC hDC, int numDevices, HPVIDEODEV *hVideoDevice);
|
||||
extern BOOL WINAPI wglReleaseVideoDeviceNV (HPVIDEODEV hVideoDevice);
|
||||
extern BOOL WINAPI wglBindVideoImageNV (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer);
|
||||
extern BOOL WINAPI wglReleaseVideoImageNV (HPBUFFERARB hPbuffer, int iVideoBuffer);
|
||||
extern BOOL WINAPI wglSendPbufferToVideoNV (HPBUFFERARB hPbuffer, int iBufferType, unsigned long *pulCounterPbuffer, BOOL bBlock);
|
||||
extern BOOL WINAPI wglGetVideoInfoNV (HPVIDEODEV hpVideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLGETVIDEODEVICENVPROC) (HDC hDC, int numDevices, HPVIDEODEV *hVideoDevice);
|
||||
typedef BOOL (WINAPI * PFNWGLRELEASEVIDEODEVICENVPROC) (HPVIDEODEV hVideoDevice);
|
||||
typedef BOOL (WINAPI * PFNWGLBINDVIDEOIMAGENVPROC) (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOIMAGENVPROC) (HPBUFFERARB hPbuffer, int iVideoBuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLSENDPBUFFERTOVIDEONVPROC) (HPBUFFERARB hPbuffer, int iBufferType, unsigned long *pulCounterPbuffer, BOOL bBlock);
|
||||
typedef BOOL (WINAPI * PFNWGLGETVIDEOINFONVPROC) (HPVIDEODEV hpVideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_swap_group
|
||||
#define WGL_NV_swap_group 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglJoinSwapGroupNV (HDC hDC, GLuint group);
|
||||
extern BOOL WINAPI wglBindSwapBarrierNV (GLuint group, GLuint barrier);
|
||||
extern BOOL WINAPI wglQuerySwapGroupNV (HDC hDC, GLuint *group, GLuint *barrier);
|
||||
extern BOOL WINAPI wglQueryMaxSwapGroupsNV (HDC hDC, GLuint *maxGroups, GLuint *maxBarriers);
|
||||
extern BOOL WINAPI wglQueryFrameCountNV (HDC hDC, GLuint *count);
|
||||
extern BOOL WINAPI wglResetFrameCountNV (HDC hDC);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLJOINSWAPGROUPNVPROC) (HDC hDC, GLuint group);
|
||||
typedef BOOL (WINAPI * PFNWGLBINDSWAPBARRIERNVPROC) (GLuint group, GLuint barrier);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYSWAPGROUPNVPROC) (HDC hDC, GLuint *group, GLuint *barrier);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYMAXSWAPGROUPSNVPROC) (HDC hDC, GLuint *maxGroups, GLuint *maxBarriers);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYFRAMECOUNTNVPROC) (HDC hDC, GLuint *count);
|
||||
typedef BOOL (WINAPI * PFNWGLRESETFRAMECOUNTNVPROC) (HDC hDC);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_gpu_affinity
|
||||
#define WGL_NV_gpu_affinity 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglEnumGpusNV (UINT iGpuIndex, HGPUNV *phGpu);
|
||||
extern BOOL WINAPI wglEnumGpuDevicesNV (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice);
|
||||
extern HDC WINAPI wglCreateAffinityDCNV (const HGPUNV *phGpuList);
|
||||
extern BOOL WINAPI wglEnumGpusFromAffinityDCNV (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu);
|
||||
extern BOOL WINAPI wglDeleteDCNV (HDC hdc);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLENUMGPUSNVPROC) (UINT iGpuIndex, HGPUNV *phGpu);
|
||||
typedef BOOL (WINAPI * PFNWGLENUMGPUDEVICESNVPROC) (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice);
|
||||
typedef HDC (WINAPI * PFNWGLCREATEAFFINITYDCNVPROC) (const HGPUNV *phGpuList);
|
||||
typedef BOOL (WINAPI * PFNWGLENUMGPUSFROMAFFINITYDCNVPROC) (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu);
|
||||
typedef BOOL (WINAPI * PFNWGLDELETEDCNVPROC) (HDC hdc);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_AMD_gpu_association
|
||||
#define WGL_AMD_gpu_association 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern UINT WINAPI wglGetGPUIDsAMD (UINT maxCount, UINT *ids);
|
||||
extern INT WINAPI wglGetGPUInfoAMD (UINT id, int property, GLenum dataType, UINT size, void *data);
|
||||
extern UINT WINAPI wglGetContextGPUIDAMD (HGLRC hglrc);
|
||||
extern HGLRC WINAPI wglCreateAssociatedContextAMD (UINT id);
|
||||
extern HGLRC WINAPI wglCreateAssociatedContextAttribsAMD (UINT id, HGLRC hShareContext, const int *attribList);
|
||||
extern BOOL WINAPI wglDeleteAssociatedContextAMD (HGLRC hglrc);
|
||||
extern BOOL WINAPI wglMakeAssociatedContextCurrentAMD (HGLRC hglrc);
|
||||
extern HGLRC WINAPI wglGetCurrentAssociatedContextAMD (void);
|
||||
extern VOID WINAPI wglBlitContextFramebufferAMD (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef UINT (WINAPI * PFNWGLGETGPUIDSAMDPROC) (UINT maxCount, UINT *ids);
|
||||
typedef INT (WINAPI * PFNWGLGETGPUINFOAMDPROC) (UINT id, int property, GLenum dataType, UINT size, void *data);
|
||||
typedef UINT (WINAPI * PFNWGLGETCONTEXTGPUIDAMDPROC) (HGLRC hglrc);
|
||||
typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC) (UINT id);
|
||||
typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (UINT id, HGLRC hShareContext, const int *attribList);
|
||||
typedef BOOL (WINAPI * PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC) (HGLRC hglrc);
|
||||
typedef BOOL (WINAPI * PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (HGLRC hglrc);
|
||||
typedef HGLRC (WINAPI * PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void);
|
||||
typedef VOID (WINAPI * PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC) (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_video_capture
|
||||
#define WGL_NV_video_capture 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglBindVideoCaptureDeviceNV (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice);
|
||||
extern UINT WINAPI wglEnumerateVideoCaptureDevicesNV (HDC hDc, HVIDEOINPUTDEVICENV *phDeviceList);
|
||||
extern BOOL WINAPI wglLockVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
|
||||
extern BOOL WINAPI wglQueryVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int *piValue);
|
||||
extern BOOL WINAPI wglReleaseVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLBINDVIDEOCAPTUREDEVICENVPROC) (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice);
|
||||
typedef UINT (WINAPI * PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC) (HDC hDc, HVIDEOINPUTDEVICENV *phDeviceList);
|
||||
typedef BOOL (WINAPI * PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int *piValue);
|
||||
typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_copy_image
|
||||
#define WGL_NV_copy_image 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglCopyImageSubDataNV (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLCOPYIMAGESUBDATANVPROC) (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_multisample_coverage
|
||||
#define WGL_NV_multisample_coverage 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_DX_interop
|
||||
#define WGL_NV_DX_interop 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglDXSetResourceShareHandleNV (void *dxObject, HANDLE shareHandle);
|
||||
extern HANDLE WINAPI wglDXOpenDeviceNV (void *dxDevice);
|
||||
extern BOOL WINAPI wglDXCloseDeviceNV (HANDLE hDevice);
|
||||
extern HANDLE WINAPI wglDXRegisterObjectNV (HANDLE hDevice, void *dxObject, GLuint name, GLenum type, GLenum access);
|
||||
extern BOOL WINAPI wglDXUnregisterObjectNV (HANDLE hDevice, HANDLE hObject);
|
||||
extern BOOL WINAPI wglDXObjectAccessNV (HANDLE hObject, GLenum access);
|
||||
extern BOOL WINAPI wglDXLockObjectsNV (HANDLE hDevice, GLint count, HANDLE *hObjects);
|
||||
extern BOOL WINAPI wglDXUnlockObjectsNV (HANDLE hDevice, GLint count, HANDLE *hObjects);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLDXSETRESOURCESHAREHANDLENVPROC) (void *dxObject, HANDLE shareHandle);
|
||||
typedef HANDLE (WINAPI * PFNWGLDXOPENDEVICENVPROC) (void *dxDevice);
|
||||
typedef BOOL (WINAPI * PFNWGLDXCLOSEDEVICENVPROC) (HANDLE hDevice);
|
||||
typedef HANDLE (WINAPI * PFNWGLDXREGISTEROBJECTNVPROC) (HANDLE hDevice, void *dxObject, GLuint name, GLenum type, GLenum access);
|
||||
typedef BOOL (WINAPI * PFNWGLDXUNREGISTEROBJECTNVPROC) (HANDLE hDevice, HANDLE hObject);
|
||||
typedef BOOL (WINAPI * PFNWGLDXOBJECTACCESSNVPROC) (HANDLE hObject, GLenum access);
|
||||
typedef BOOL (WINAPI * PFNWGLDXLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE *hObjects);
|
||||
typedef BOOL (WINAPI * PFNWGLDXUNLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE *hObjects);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_NV_DX_interop2
|
||||
#define WGL_NV_DX_interop2 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_swap_control_tear
|
||||
#define WGL_EXT_swap_control_tear 1
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
467
deps/getopt.c
vendored
467
deps/getopt.c
vendored
|
@ -1,267 +1,230 @@
|
|||
/*****************************************************************************
|
||||
* getopt.c - competent and free getopt library.
|
||||
* $Header: /cvsroot/freegetopt/freegetopt/getopt.c,v 1.2 2003/10/26 03:10:20 vindaci Exp $
|
||||
*
|
||||
* Copyright (c)2002-2003 Mark K. Kim
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* * Neither the original author of this software nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||
* THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
* DAMAGE.
|
||||
*/
|
||||
#ifndef _CRT_SECURE_NO_WARNINGS
|
||||
#define _CRT_SECURE_NO_WARNINGS
|
||||
#endif
|
||||
/* Copyright (c) 2012, Kim Gräsman
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* * Neither the name of Kim Gräsman nor the names of contributors may be used
|
||||
* to endorse or promote products derived from this software without specific
|
||||
* prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL KIM GRÄSMAN BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "getopt.h"
|
||||
|
||||
/* 2013-01-06 Camilla Berglund <elmindreda@elmindreda.org>
|
||||
*
|
||||
* Only define _CRT_SECURE_NO_WARNINGS if not already defined.
|
||||
*/
|
||||
/* 2012-08-12 Lambert Clara <lambert.clara@yahoo.fr>
|
||||
*
|
||||
* Constify third argument of getopt.
|
||||
*/
|
||||
/* 2011-07-27 Camilla Berglund <elmindreda@elmindreda.org>
|
||||
*
|
||||
* Added _CRT_SECURE_NO_WARNINGS macro.
|
||||
*/
|
||||
/* 2009-10-12 Camilla Berglund <elmindreda@elmindreda.org>
|
||||
*
|
||||
* Removed unused global static variable 'ID'.
|
||||
*/
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
|
||||
char* optarg = NULL;
|
||||
int optind = 0;
|
||||
int opterr = 1;
|
||||
int optopt = '?';
|
||||
const int no_argument = 0;
|
||||
const int required_argument = 1;
|
||||
const int optional_argument = 2;
|
||||
|
||||
char* optarg;
|
||||
int optopt;
|
||||
/* The variable optind [...] shall be initialized to 1 by the system. */
|
||||
int optind = 1;
|
||||
int opterr;
|
||||
|
||||
static char** prev_argv = NULL; /* Keep a copy of argv and argc to */
|
||||
static int prev_argc = 0; /* tell if getopt params change */
|
||||
static int argv_index = 0; /* Option we're checking */
|
||||
static int argv_index2 = 0; /* Option argument we're checking */
|
||||
static int opt_offset = 0; /* Index into compounded "-option" */
|
||||
static int dashdash = 0; /* True if "--" option reached */
|
||||
static int nonopt = 0; /* How many nonopts we've found */
|
||||
static char* optcursor = NULL;
|
||||
|
||||
static void increment_index()
|
||||
{
|
||||
/* Move onto the next option */
|
||||
if(argv_index < argv_index2)
|
||||
{
|
||||
while(prev_argv[++argv_index] && prev_argv[argv_index][0] != '-'
|
||||
&& argv_index < argv_index2+1);
|
||||
}
|
||||
else argv_index++;
|
||||
opt_offset = 1;
|
||||
}
|
||||
/* Implemented based on [1] and [2] for optional arguments.
|
||||
optopt is handled FreeBSD-style, per [3].
|
||||
Other GNU and FreeBSD extensions are purely accidental.
|
||||
|
||||
|
||||
/*
|
||||
* Permutes argv[] so that the argument currently being processed is moved
|
||||
* to the end.
|
||||
[1] http://pubs.opengroup.org/onlinepubs/000095399/functions/getopt.html
|
||||
[2] http://www.kernel.org/doc/man-pages/online/pages/man3/getopt.3.html
|
||||
[3] http://www.freebsd.org/cgi/man.cgi?query=getopt&sektion=3&manpath=FreeBSD+9.0-RELEASE
|
||||
*/
|
||||
static int permute_argv_once()
|
||||
{
|
||||
/* Movability check */
|
||||
if(argv_index + nonopt >= prev_argc) return 1;
|
||||
/* Move the current option to the end, bring the others to front */
|
||||
else
|
||||
{
|
||||
char* tmp = prev_argv[argv_index];
|
||||
int getopt(int argc, char* const argv[], const char* optstring) {
|
||||
int optchar = -1;
|
||||
const char* optdecl = NULL;
|
||||
|
||||
/* Move the data */
|
||||
memmove(&prev_argv[argv_index], &prev_argv[argv_index+1],
|
||||
sizeof(char**) * (prev_argc - argv_index - 1));
|
||||
prev_argv[prev_argc - 1] = tmp;
|
||||
optarg = NULL;
|
||||
opterr = 0;
|
||||
optopt = 0;
|
||||
|
||||
nonopt++;
|
||||
return 0;
|
||||
}
|
||||
/* Unspecified, but we need it to avoid overrunning the argv bounds. */
|
||||
if (optind >= argc)
|
||||
goto no_more_optchars;
|
||||
|
||||
/* If, when getopt() is called argv[optind] is a null pointer, getopt()
|
||||
shall return -1 without changing optind. */
|
||||
if (argv[optind] == NULL)
|
||||
goto no_more_optchars;
|
||||
|
||||
/* If, when getopt() is called *argv[optind] is not the character '-',
|
||||
getopt() shall return -1 without changing optind. */
|
||||
if (*argv[optind] != '-')
|
||||
goto no_more_optchars;
|
||||
|
||||
/* If, when getopt() is called argv[optind] points to the string "-",
|
||||
getopt() shall return -1 without changing optind. */
|
||||
if (strcmp(argv[optind], "-") == 0)
|
||||
goto no_more_optchars;
|
||||
|
||||
/* If, when getopt() is called argv[optind] points to the string "--",
|
||||
getopt() shall return -1 after incrementing optind. */
|
||||
if (strcmp(argv[optind], "--") == 0) {
|
||||
++optind;
|
||||
goto no_more_optchars;
|
||||
}
|
||||
|
||||
if (optcursor == NULL || *optcursor == '\0')
|
||||
optcursor = argv[optind] + 1;
|
||||
|
||||
optchar = *optcursor;
|
||||
|
||||
/* FreeBSD: The variable optopt saves the last known option character
|
||||
returned by getopt(). */
|
||||
optopt = optchar;
|
||||
|
||||
/* The getopt() function shall return the next option character (if one is
|
||||
found) from argv that matches a character in optstring, if there is
|
||||
one that matches. */
|
||||
optdecl = strchr(optstring, optchar);
|
||||
if (optdecl) {
|
||||
/* [I]f a character is followed by a colon, the option takes an
|
||||
argument. */
|
||||
if (optdecl[1] == ':') {
|
||||
optarg = ++optcursor;
|
||||
if (*optarg == '\0') {
|
||||
/* GNU extension: Two colons mean an option takes an
|
||||
optional arg; if there is text in the current argv-element
|
||||
(i.e., in the same word as the option name itself, for example,
|
||||
"-oarg"), then it is returned in optarg, otherwise optarg is set
|
||||
to zero. */
|
||||
if (optdecl[2] != ':') {
|
||||
/* If the option was the last character in the string pointed to by
|
||||
an element of argv, then optarg shall contain the next element
|
||||
of argv, and optind shall be incremented by 2. If the resulting
|
||||
value of optind is greater than argc, this indicates a missing
|
||||
option-argument, and getopt() shall return an error indication.
|
||||
|
||||
Otherwise, optarg shall point to the string following the
|
||||
option character in that element of argv, and optind shall be
|
||||
incremented by 1.
|
||||
*/
|
||||
if (++optind < argc) {
|
||||
optarg = argv[optind];
|
||||
} else {
|
||||
/* If it detects a missing option-argument, it shall return the
|
||||
colon character ( ':' ) if the first character of optstring
|
||||
was a colon, or a question-mark character ( '?' ) otherwise.
|
||||
*/
|
||||
optarg = NULL;
|
||||
optchar = (optstring[0] == ':') ? ':' : '?';
|
||||
}
|
||||
} else {
|
||||
optarg = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
optcursor = NULL;
|
||||
}
|
||||
} else {
|
||||
/* If getopt() encounters an option character that is not contained in
|
||||
optstring, it shall return the question-mark ( '?' ) character. */
|
||||
optchar = '?';
|
||||
}
|
||||
|
||||
if (optcursor == NULL || *++optcursor == '\0')
|
||||
++optind;
|
||||
|
||||
return optchar;
|
||||
|
||||
no_more_optchars:
|
||||
optcursor = NULL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Implementation based on [1].
|
||||
|
||||
int getopt(int argc, char** argv, const char* optstr)
|
||||
{
|
||||
int c = 0;
|
||||
|
||||
/* If we have new argv, reinitialize */
|
||||
if(prev_argv != argv || prev_argc != argc)
|
||||
{
|
||||
/* Initialize variables */
|
||||
prev_argv = argv;
|
||||
prev_argc = argc;
|
||||
argv_index = 1;
|
||||
argv_index2 = 1;
|
||||
opt_offset = 1;
|
||||
dashdash = 0;
|
||||
nonopt = 0;
|
||||
}
|
||||
|
||||
/* Jump point in case we want to ignore the current argv_index */
|
||||
getopt_top:
|
||||
|
||||
/* Misc. initializations */
|
||||
optarg = NULL;
|
||||
|
||||
/* Dash-dash check */
|
||||
if(argv[argv_index] && !strcmp(argv[argv_index], "--"))
|
||||
{
|
||||
dashdash = 1;
|
||||
increment_index();
|
||||
}
|
||||
|
||||
/* If we're at the end of argv, that's it. */
|
||||
if(argv[argv_index] == NULL)
|
||||
{
|
||||
c = -1;
|
||||
}
|
||||
/* Are we looking at a string? Single dash is also a string */
|
||||
else if(dashdash || argv[argv_index][0] != '-' || !strcmp(argv[argv_index], "-"))
|
||||
{
|
||||
/* If we want a string... */
|
||||
if(optstr[0] == '-')
|
||||
{
|
||||
c = 1;
|
||||
optarg = argv[argv_index];
|
||||
increment_index();
|
||||
}
|
||||
/* If we really don't want it (we're in POSIX mode), we're done */
|
||||
else if(optstr[0] == '+' || getenv("POSIXLY_CORRECT"))
|
||||
{
|
||||
c = -1;
|
||||
|
||||
/* Everything else is a non-opt argument */
|
||||
nonopt = argc - argv_index;
|
||||
}
|
||||
/* If we mildly don't want it, then move it back */
|
||||
else
|
||||
{
|
||||
if(!permute_argv_once()) goto getopt_top;
|
||||
else c = -1;
|
||||
}
|
||||
}
|
||||
/* Otherwise we're looking at an option */
|
||||
else
|
||||
{
|
||||
char* opt_ptr = NULL;
|
||||
|
||||
/* Grab the option */
|
||||
c = argv[argv_index][opt_offset++];
|
||||
|
||||
/* Is the option in the optstr? */
|
||||
if(optstr[0] == '-') opt_ptr = strchr(optstr+1, c);
|
||||
else opt_ptr = strchr(optstr, c);
|
||||
/* Invalid argument */
|
||||
if(!opt_ptr)
|
||||
{
|
||||
if(opterr)
|
||||
{
|
||||
fprintf(stderr, "%s: invalid option -- %c\n", argv[0], c);
|
||||
}
|
||||
|
||||
optopt = c;
|
||||
c = '?';
|
||||
|
||||
/* Move onto the next option */
|
||||
increment_index();
|
||||
}
|
||||
/* Option takes argument */
|
||||
else if(opt_ptr[1] == ':')
|
||||
{
|
||||
/* ie, -oARGUMENT, -xxxoARGUMENT, etc. */
|
||||
if(argv[argv_index][opt_offset] != '\0')
|
||||
{
|
||||
optarg = &argv[argv_index][opt_offset];
|
||||
increment_index();
|
||||
}
|
||||
/* ie, -o ARGUMENT (only if it's a required argument) */
|
||||
else if(opt_ptr[2] != ':')
|
||||
{
|
||||
/* One of those "you're not expected to understand this" moment */
|
||||
if(argv_index2 < argv_index) argv_index2 = argv_index;
|
||||
while(argv[++argv_index2] && argv[argv_index2][0] == '-');
|
||||
optarg = argv[argv_index2];
|
||||
|
||||
/* Don't cross into the non-option argument list */
|
||||
if(argv_index2 + nonopt >= prev_argc) optarg = NULL;
|
||||
|
||||
/* Move onto the next option */
|
||||
increment_index();
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Move onto the next option */
|
||||
increment_index();
|
||||
}
|
||||
|
||||
/* In case we got no argument for an option with required argument */
|
||||
if(optarg == NULL && opt_ptr[2] != ':')
|
||||
{
|
||||
optopt = c;
|
||||
c = '?';
|
||||
|
||||
if(opterr)
|
||||
{
|
||||
fprintf(stderr,"%s: option requires an argument -- %c\n",
|
||||
argv[0], optopt);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Option does not take argument */
|
||||
else
|
||||
{
|
||||
/* Next argv_index */
|
||||
if(argv[argv_index][opt_offset] == '\0')
|
||||
{
|
||||
increment_index();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Calculate optind */
|
||||
if(c == -1)
|
||||
{
|
||||
optind = argc - nonopt;
|
||||
}
|
||||
else
|
||||
{
|
||||
optind = argv_index;
|
||||
}
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
|
||||
/* vim:ts=3
|
||||
[1] http://www.kernel.org/doc/man-pages/online/pages/man3/getopt.3.html
|
||||
*/
|
||||
int getopt_long(int argc, char* const argv[], const char* optstring,
|
||||
const struct option* longopts, int* longindex) {
|
||||
const struct option* o = longopts;
|
||||
const struct option* match = NULL;
|
||||
int num_matches = 0;
|
||||
size_t argument_name_length = 0;
|
||||
const char* current_argument = NULL;
|
||||
int retval = -1;
|
||||
|
||||
optarg = NULL;
|
||||
optopt = 0;
|
||||
|
||||
if (optind >= argc)
|
||||
return -1;
|
||||
|
||||
if (strlen(argv[optind]) < 3 || strncmp(argv[optind], "--", 2) != 0)
|
||||
return getopt(argc, argv, optstring);
|
||||
|
||||
/* It's an option; starts with -- and is longer than two chars. */
|
||||
current_argument = argv[optind] + 2;
|
||||
argument_name_length = strcspn(current_argument, "=");
|
||||
for (; o->name; ++o) {
|
||||
if (strncmp(o->name, current_argument, argument_name_length) == 0) {
|
||||
match = o;
|
||||
++num_matches;
|
||||
}
|
||||
}
|
||||
|
||||
if (num_matches == 1) {
|
||||
/* If longindex is not NULL, it points to a variable which is set to the
|
||||
index of the long option relative to longopts. */
|
||||
if (longindex)
|
||||
*longindex = (int) (match - longopts);
|
||||
|
||||
/* If flag is NULL, then getopt_long() shall return val.
|
||||
Otherwise, getopt_long() returns 0, and flag shall point to a variable
|
||||
which shall be set to val if the option is found, but left unchanged if
|
||||
the option is not found. */
|
||||
if (match->flag)
|
||||
*(match->flag) = match->val;
|
||||
|
||||
retval = match->flag ? 0 : match->val;
|
||||
|
||||
if (match->has_arg != no_argument) {
|
||||
optarg = strchr(argv[optind], '=');
|
||||
if (optarg != NULL)
|
||||
++optarg;
|
||||
|
||||
if (match->has_arg == required_argument) {
|
||||
/* Only scan the next argv for required arguments. Behavior is not
|
||||
specified, but has been observed with Ubuntu and Mac OSX. */
|
||||
if (optarg == NULL && ++optind < argc) {
|
||||
optarg = argv[optind];
|
||||
}
|
||||
|
||||
if (optarg == NULL)
|
||||
retval = ':';
|
||||
}
|
||||
} else if (strchr(argv[optind], '=')) {
|
||||
/* An argument was provided to a non-argument option.
|
||||
I haven't seen this specified explicitly, but both GNU and BSD-based
|
||||
implementations show this behavior.
|
||||
*/
|
||||
retval = '?';
|
||||
}
|
||||
} else {
|
||||
/* Unknown option or ambiguous match. */
|
||||
retval = '?';
|
||||
}
|
||||
|
||||
++optind;
|
||||
return retval;
|
||||
}
|
||||
|
|
94
deps/getopt.h
vendored
94
deps/getopt.h
vendored
|
@ -1,63 +1,57 @@
|
|||
/*****************************************************************************
|
||||
* getopt.h - competent and free getopt library.
|
||||
* $Header: /cvsroot/freegetopt/freegetopt/getopt.h,v 1.2 2003/10/26 03:10:20 vindaci Exp $
|
||||
*
|
||||
* Copyright (c)2002-2003 Mark K. Kim
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* * Neither the original author of this software nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||
* THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
* DAMAGE.
|
||||
*/
|
||||
#ifndef GETOPT_H_
|
||||
#define GETOPT_H_
|
||||
/* Copyright (c) 2012, Kim Gräsman
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* * Neither the name of Kim Gräsman nor the names of contributors may be used
|
||||
* to endorse or promote products derived from this software without specific
|
||||
* prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL KIM GRÄSMAN BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef INCLUDED_GETOPT_PORT_H
|
||||
#define INCLUDED_GETOPT_PORT_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern const int no_argument;
|
||||
extern const int required_argument;
|
||||
extern const int optional_argument;
|
||||
|
||||
extern char* optarg;
|
||||
extern int optind;
|
||||
extern int opterr;
|
||||
extern int optopt;
|
||||
extern int optind, opterr, optopt;
|
||||
|
||||
int getopt(int argc, char** argv, const char* optstr);
|
||||
struct option {
|
||||
const char* name;
|
||||
int has_arg;
|
||||
int* flag;
|
||||
int val;
|
||||
};
|
||||
|
||||
int getopt(int argc, char* const argv[], const char* optstring);
|
||||
|
||||
#ifdef __cplusplus
|
||||
int getopt_long(int argc, char* const argv[],
|
||||
const char* optstring, const struct option* longopts, int* longindex);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* GETOPT_H_ */
|
||||
|
||||
|
||||
/* vim:ts=3
|
||||
*/
|
||||
#endif // INCLUDED_GETOPT_PORT_H
|
||||
|
|
5996
deps/glad/gl.h
vendored
Normal file
5996
deps/glad/gl.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1805
deps/glad/gles2.h
vendored
Normal file
1805
deps/glad/gles2.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
6330
deps/glad/vulkan.h
vendored
Normal file
6330
deps/glad/vulkan.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
606
deps/linmath.h
vendored
Normal file
606
deps/linmath.h
vendored
Normal file
|
@ -0,0 +1,606 @@
|
|||
#ifndef LINMATH_H
|
||||
#define LINMATH_H
|
||||
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
|
||||
/* 2021-03-21 Camilla Löwy <elmindreda@elmindreda.org>
|
||||
* - Replaced double constants with float equivalents
|
||||
*/
|
||||
|
||||
#ifdef LINMATH_NO_INLINE
|
||||
#define LINMATH_H_FUNC static
|
||||
#else
|
||||
#define LINMATH_H_FUNC static inline
|
||||
#endif
|
||||
|
||||
#define LINMATH_H_DEFINE_VEC(n) \
|
||||
typedef float vec##n[n]; \
|
||||
LINMATH_H_FUNC void vec##n##_add(vec##n r, vec##n const a, vec##n const b) \
|
||||
{ \
|
||||
int i; \
|
||||
for(i=0; i<n; ++i) \
|
||||
r[i] = a[i] + b[i]; \
|
||||
} \
|
||||
LINMATH_H_FUNC void vec##n##_sub(vec##n r, vec##n const a, vec##n const b) \
|
||||
{ \
|
||||
int i; \
|
||||
for(i=0; i<n; ++i) \
|
||||
r[i] = a[i] - b[i]; \
|
||||
} \
|
||||
LINMATH_H_FUNC void vec##n##_scale(vec##n r, vec##n const v, float const s) \
|
||||
{ \
|
||||
int i; \
|
||||
for(i=0; i<n; ++i) \
|
||||
r[i] = v[i] * s; \
|
||||
} \
|
||||
LINMATH_H_FUNC float vec##n##_mul_inner(vec##n const a, vec##n const b) \
|
||||
{ \
|
||||
float p = 0.f; \
|
||||
int i; \
|
||||
for(i=0; i<n; ++i) \
|
||||
p += b[i]*a[i]; \
|
||||
return p; \
|
||||
} \
|
||||
LINMATH_H_FUNC float vec##n##_len(vec##n const v) \
|
||||
{ \
|
||||
return sqrtf(vec##n##_mul_inner(v,v)); \
|
||||
} \
|
||||
LINMATH_H_FUNC void vec##n##_norm(vec##n r, vec##n const v) \
|
||||
{ \
|
||||
float k = 1.f / vec##n##_len(v); \
|
||||
vec##n##_scale(r, v, k); \
|
||||
} \
|
||||
LINMATH_H_FUNC void vec##n##_min(vec##n r, vec##n const a, vec##n const b) \
|
||||
{ \
|
||||
int i; \
|
||||
for(i=0; i<n; ++i) \
|
||||
r[i] = a[i]<b[i] ? a[i] : b[i]; \
|
||||
} \
|
||||
LINMATH_H_FUNC void vec##n##_max(vec##n r, vec##n const a, vec##n const b) \
|
||||
{ \
|
||||
int i; \
|
||||
for(i=0; i<n; ++i) \
|
||||
r[i] = a[i]>b[i] ? a[i] : b[i]; \
|
||||
} \
|
||||
LINMATH_H_FUNC void vec##n##_dup(vec##n r, vec##n const src) \
|
||||
{ \
|
||||
int i; \
|
||||
for(i=0; i<n; ++i) \
|
||||
r[i] = src[i]; \
|
||||
}
|
||||
|
||||
LINMATH_H_DEFINE_VEC(2)
|
||||
LINMATH_H_DEFINE_VEC(3)
|
||||
LINMATH_H_DEFINE_VEC(4)
|
||||
|
||||
LINMATH_H_FUNC void vec3_mul_cross(vec3 r, vec3 const a, vec3 const b)
|
||||
{
|
||||
r[0] = a[1]*b[2] - a[2]*b[1];
|
||||
r[1] = a[2]*b[0] - a[0]*b[2];
|
||||
r[2] = a[0]*b[1] - a[1]*b[0];
|
||||
}
|
||||
|
||||
LINMATH_H_FUNC void vec3_reflect(vec3 r, vec3 const v, vec3 const n)
|
||||
{
|
||||
float p = 2.f * vec3_mul_inner(v, n);
|
||||
int i;
|
||||
for(i=0;i<3;++i)
|
||||
r[i] = v[i] - p*n[i];
|
||||
}
|
||||
|
||||
LINMATH_H_FUNC void vec4_mul_cross(vec4 r, vec4 const a, vec4 const b)
|
||||
{
|
||||
r[0] = a[1]*b[2] - a[2]*b[1];
|
||||
r[1] = a[2]*b[0] - a[0]*b[2];
|
||||
r[2] = a[0]*b[1] - a[1]*b[0];
|
||||
r[3] = 1.f;
|
||||
}
|
||||
|
||||
LINMATH_H_FUNC void vec4_reflect(vec4 r, vec4 const v, vec4 const n)
|
||||
{
|
||||
float p = 2.f*vec4_mul_inner(v, n);
|
||||
int i;
|
||||
for(i=0;i<4;++i)
|
||||
r[i] = v[i] - p*n[i];
|
||||
}
|
||||
|
||||
typedef vec4 mat4x4[4];
|
||||
LINMATH_H_FUNC void mat4x4_identity(mat4x4 M)
|
||||
{
|
||||
int i, j;
|
||||
for(i=0; i<4; ++i)
|
||||
for(j=0; j<4; ++j)
|
||||
M[i][j] = i==j ? 1.f : 0.f;
|
||||
}
|
||||
LINMATH_H_FUNC void mat4x4_dup(mat4x4 M, mat4x4 const N)
|
||||
{
|
||||
int i;
|
||||
for(i=0; i<4; ++i)
|
||||
vec4_dup(M[i], N[i]);
|
||||
}
|
||||
LINMATH_H_FUNC void mat4x4_row(vec4 r, mat4x4 const M, int i)
|
||||
{
|
||||
int k;
|
||||
for(k=0; k<4; ++k)
|
||||
r[k] = M[k][i];
|
||||
}
|
||||
LINMATH_H_FUNC void mat4x4_col(vec4 r, mat4x4 const M, int i)
|
||||
{
|
||||
int k;
|
||||
for(k=0; k<4; ++k)
|
||||
r[k] = M[i][k];
|
||||
}
|
||||
LINMATH_H_FUNC void mat4x4_transpose(mat4x4 M, mat4x4 const N)
|
||||
{
|
||||
// Note: if M and N are the same, the user has to
|
||||
// explicitly make a copy of M and set it to N.
|
||||
int i, j;
|
||||
for(j=0; j<4; ++j)
|
||||
for(i=0; i<4; ++i)
|
||||
M[i][j] = N[j][i];
|
||||
}
|
||||
LINMATH_H_FUNC void mat4x4_add(mat4x4 M, mat4x4 const a, mat4x4 const b)
|
||||
{
|
||||
int i;
|
||||
for(i=0; i<4; ++i)
|
||||
vec4_add(M[i], a[i], b[i]);
|
||||
}
|
||||
LINMATH_H_FUNC void mat4x4_sub(mat4x4 M, mat4x4 const a, mat4x4 const b)
|
||||
{
|
||||
int i;
|
||||
for(i=0; i<4; ++i)
|
||||
vec4_sub(M[i], a[i], b[i]);
|
||||
}
|
||||
LINMATH_H_FUNC void mat4x4_scale(mat4x4 M, mat4x4 const a, float k)
|
||||
{
|
||||
int i;
|
||||
for(i=0; i<4; ++i)
|
||||
vec4_scale(M[i], a[i], k);
|
||||
}
|
||||
LINMATH_H_FUNC void mat4x4_scale_aniso(mat4x4 M, mat4x4 const a, float x, float y, float z)
|
||||
{
|
||||
vec4_scale(M[0], a[0], x);
|
||||
vec4_scale(M[1], a[1], y);
|
||||
vec4_scale(M[2], a[2], z);
|
||||
vec4_dup(M[3], a[3]);
|
||||
}
|
||||
LINMATH_H_FUNC void mat4x4_mul(mat4x4 M, mat4x4 const a, mat4x4 const b)
|
||||
{
|
||||
mat4x4 temp;
|
||||
int k, r, c;
|
||||
for(c=0; c<4; ++c) for(r=0; r<4; ++r) {
|
||||
temp[c][r] = 0.f;
|
||||
for(k=0; k<4; ++k)
|
||||
temp[c][r] += a[k][r] * b[c][k];
|
||||
}
|
||||
mat4x4_dup(M, temp);
|
||||
}
|
||||
LINMATH_H_FUNC void mat4x4_mul_vec4(vec4 r, mat4x4 const M, vec4 const v)
|
||||
{
|
||||
int i, j;
|
||||
for(j=0; j<4; ++j) {
|
||||
r[j] = 0.f;
|
||||
for(i=0; i<4; ++i)
|
||||
r[j] += M[i][j] * v[i];
|
||||
}
|
||||
}
|
||||
LINMATH_H_FUNC void mat4x4_translate(mat4x4 T, float x, float y, float z)
|
||||
{
|
||||
mat4x4_identity(T);
|
||||
T[3][0] = x;
|
||||
T[3][1] = y;
|
||||
T[3][2] = z;
|
||||
}
|
||||
LINMATH_H_FUNC void mat4x4_translate_in_place(mat4x4 M, float x, float y, float z)
|
||||
{
|
||||
vec4 t = {x, y, z, 0};
|
||||
vec4 r;
|
||||
int i;
|
||||
for (i = 0; i < 4; ++i) {
|
||||
mat4x4_row(r, M, i);
|
||||
M[3][i] += vec4_mul_inner(r, t);
|
||||
}
|
||||
}
|
||||
LINMATH_H_FUNC void mat4x4_from_vec3_mul_outer(mat4x4 M, vec3 const a, vec3 const b)
|
||||
{
|
||||
int i, j;
|
||||
for(i=0; i<4; ++i) for(j=0; j<4; ++j)
|
||||
M[i][j] = i<3 && j<3 ? a[i] * b[j] : 0.f;
|
||||
}
|
||||
LINMATH_H_FUNC void mat4x4_rotate(mat4x4 R, mat4x4 const M, float x, float y, float z, float angle)
|
||||
{
|
||||
float s = sinf(angle);
|
||||
float c = cosf(angle);
|
||||
vec3 u = {x, y, z};
|
||||
|
||||
if(vec3_len(u) > 1e-4) {
|
||||
vec3_norm(u, u);
|
||||
mat4x4 T;
|
||||
mat4x4_from_vec3_mul_outer(T, u, u);
|
||||
|
||||
mat4x4 S = {
|
||||
{ 0, u[2], -u[1], 0},
|
||||
{-u[2], 0, u[0], 0},
|
||||
{ u[1], -u[0], 0, 0},
|
||||
{ 0, 0, 0, 0}
|
||||
};
|
||||
mat4x4_scale(S, S, s);
|
||||
|
||||
mat4x4 C;
|
||||
mat4x4_identity(C);
|
||||
mat4x4_sub(C, C, T);
|
||||
|
||||
mat4x4_scale(C, C, c);
|
||||
|
||||
mat4x4_add(T, T, C);
|
||||
mat4x4_add(T, T, S);
|
||||
|
||||
T[3][3] = 1.f;
|
||||
mat4x4_mul(R, M, T);
|
||||
} else {
|
||||
mat4x4_dup(R, M);
|
||||
}
|
||||
}
|
||||
LINMATH_H_FUNC void mat4x4_rotate_X(mat4x4 Q, mat4x4 const M, float angle)
|
||||
{
|
||||
float s = sinf(angle);
|
||||
float c = cosf(angle);
|
||||
mat4x4 R = {
|
||||
{1.f, 0.f, 0.f, 0.f},
|
||||
{0.f, c, s, 0.f},
|
||||
{0.f, -s, c, 0.f},
|
||||
{0.f, 0.f, 0.f, 1.f}
|
||||
};
|
||||
mat4x4_mul(Q, M, R);
|
||||
}
|
||||
LINMATH_H_FUNC void mat4x4_rotate_Y(mat4x4 Q, mat4x4 const M, float angle)
|
||||
{
|
||||
float s = sinf(angle);
|
||||
float c = cosf(angle);
|
||||
mat4x4 R = {
|
||||
{ c, 0.f, -s, 0.f},
|
||||
{ 0.f, 1.f, 0.f, 0.f},
|
||||
{ s, 0.f, c, 0.f},
|
||||
{ 0.f, 0.f, 0.f, 1.f}
|
||||
};
|
||||
mat4x4_mul(Q, M, R);
|
||||
}
|
||||
LINMATH_H_FUNC void mat4x4_rotate_Z(mat4x4 Q, mat4x4 const M, float angle)
|
||||
{
|
||||
float s = sinf(angle);
|
||||
float c = cosf(angle);
|
||||
mat4x4 R = {
|
||||
{ c, s, 0.f, 0.f},
|
||||
{ -s, c, 0.f, 0.f},
|
||||
{ 0.f, 0.f, 1.f, 0.f},
|
||||
{ 0.f, 0.f, 0.f, 1.f}
|
||||
};
|
||||
mat4x4_mul(Q, M, R);
|
||||
}
|
||||
LINMATH_H_FUNC void mat4x4_invert(mat4x4 T, mat4x4 const M)
|
||||
{
|
||||
float s[6];
|
||||
float c[6];
|
||||
s[0] = M[0][0]*M[1][1] - M[1][0]*M[0][1];
|
||||
s[1] = M[0][0]*M[1][2] - M[1][0]*M[0][2];
|
||||
s[2] = M[0][0]*M[1][3] - M[1][0]*M[0][3];
|
||||
s[3] = M[0][1]*M[1][2] - M[1][1]*M[0][2];
|
||||
s[4] = M[0][1]*M[1][3] - M[1][1]*M[0][3];
|
||||
s[5] = M[0][2]*M[1][3] - M[1][2]*M[0][3];
|
||||
|
||||
c[0] = M[2][0]*M[3][1] - M[3][0]*M[2][1];
|
||||
c[1] = M[2][0]*M[3][2] - M[3][0]*M[2][2];
|
||||
c[2] = M[2][0]*M[3][3] - M[3][0]*M[2][3];
|
||||
c[3] = M[2][1]*M[3][2] - M[3][1]*M[2][2];
|
||||
c[4] = M[2][1]*M[3][3] - M[3][1]*M[2][3];
|
||||
c[5] = M[2][2]*M[3][3] - M[3][2]*M[2][3];
|
||||
|
||||
/* Assumes it is invertible */
|
||||
float idet = 1.0f/( s[0]*c[5]-s[1]*c[4]+s[2]*c[3]+s[3]*c[2]-s[4]*c[1]+s[5]*c[0] );
|
||||
|
||||
T[0][0] = ( M[1][1] * c[5] - M[1][2] * c[4] + M[1][3] * c[3]) * idet;
|
||||
T[0][1] = (-M[0][1] * c[5] + M[0][2] * c[4] - M[0][3] * c[3]) * idet;
|
||||
T[0][2] = ( M[3][1] * s[5] - M[3][2] * s[4] + M[3][3] * s[3]) * idet;
|
||||
T[0][3] = (-M[2][1] * s[5] + M[2][2] * s[4] - M[2][3] * s[3]) * idet;
|
||||
|
||||
T[1][0] = (-M[1][0] * c[5] + M[1][2] * c[2] - M[1][3] * c[1]) * idet;
|
||||
T[1][1] = ( M[0][0] * c[5] - M[0][2] * c[2] + M[0][3] * c[1]) * idet;
|
||||
T[1][2] = (-M[3][0] * s[5] + M[3][2] * s[2] - M[3][3] * s[1]) * idet;
|
||||
T[1][3] = ( M[2][0] * s[5] - M[2][2] * s[2] + M[2][3] * s[1]) * idet;
|
||||
|
||||
T[2][0] = ( M[1][0] * c[4] - M[1][1] * c[2] + M[1][3] * c[0]) * idet;
|
||||
T[2][1] = (-M[0][0] * c[4] + M[0][1] * c[2] - M[0][3] * c[0]) * idet;
|
||||
T[2][2] = ( M[3][0] * s[4] - M[3][1] * s[2] + M[3][3] * s[0]) * idet;
|
||||
T[2][3] = (-M[2][0] * s[4] + M[2][1] * s[2] - M[2][3] * s[0]) * idet;
|
||||
|
||||
T[3][0] = (-M[1][0] * c[3] + M[1][1] * c[1] - M[1][2] * c[0]) * idet;
|
||||
T[3][1] = ( M[0][0] * c[3] - M[0][1] * c[1] + M[0][2] * c[0]) * idet;
|
||||
T[3][2] = (-M[3][0] * s[3] + M[3][1] * s[1] - M[3][2] * s[0]) * idet;
|
||||
T[3][3] = ( M[2][0] * s[3] - M[2][1] * s[1] + M[2][2] * s[0]) * idet;
|
||||
}
|
||||
LINMATH_H_FUNC void mat4x4_orthonormalize(mat4x4 R, mat4x4 const M)
|
||||
{
|
||||
mat4x4_dup(R, M);
|
||||
float s = 1.f;
|
||||
vec3 h;
|
||||
|
||||
vec3_norm(R[2], R[2]);
|
||||
|
||||
s = vec3_mul_inner(R[1], R[2]);
|
||||
vec3_scale(h, R[2], s);
|
||||
vec3_sub(R[1], R[1], h);
|
||||
vec3_norm(R[1], R[1]);
|
||||
|
||||
s = vec3_mul_inner(R[0], R[2]);
|
||||
vec3_scale(h, R[2], s);
|
||||
vec3_sub(R[0], R[0], h);
|
||||
|
||||
s = vec3_mul_inner(R[0], R[1]);
|
||||
vec3_scale(h, R[1], s);
|
||||
vec3_sub(R[0], R[0], h);
|
||||
vec3_norm(R[0], R[0]);
|
||||
}
|
||||
|
||||
LINMATH_H_FUNC void mat4x4_frustum(mat4x4 M, float l, float r, float b, float t, float n, float f)
|
||||
{
|
||||
M[0][0] = 2.f*n/(r-l);
|
||||
M[0][1] = M[0][2] = M[0][3] = 0.f;
|
||||
|
||||
M[1][1] = 2.f*n/(t-b);
|
||||
M[1][0] = M[1][2] = M[1][3] = 0.f;
|
||||
|
||||
M[2][0] = (r+l)/(r-l);
|
||||
M[2][1] = (t+b)/(t-b);
|
||||
M[2][2] = -(f+n)/(f-n);
|
||||
M[2][3] = -1.f;
|
||||
|
||||
M[3][2] = -2.f*(f*n)/(f-n);
|
||||
M[3][0] = M[3][1] = M[3][3] = 0.f;
|
||||
}
|
||||
LINMATH_H_FUNC void mat4x4_ortho(mat4x4 M, float l, float r, float b, float t, float n, float f)
|
||||
{
|
||||
M[0][0] = 2.f/(r-l);
|
||||
M[0][1] = M[0][2] = M[0][3] = 0.f;
|
||||
|
||||
M[1][1] = 2.f/(t-b);
|
||||
M[1][0] = M[1][2] = M[1][3] = 0.f;
|
||||
|
||||
M[2][2] = -2.f/(f-n);
|
||||
M[2][0] = M[2][1] = M[2][3] = 0.f;
|
||||
|
||||
M[3][0] = -(r+l)/(r-l);
|
||||
M[3][1] = -(t+b)/(t-b);
|
||||
M[3][2] = -(f+n)/(f-n);
|
||||
M[3][3] = 1.f;
|
||||
}
|
||||
LINMATH_H_FUNC void mat4x4_perspective(mat4x4 m, float y_fov, float aspect, float n, float f)
|
||||
{
|
||||
/* NOTE: Degrees are an unhandy unit to work with.
|
||||
* linmath.h uses radians for everything! */
|
||||
float const a = 1.f / tanf(y_fov / 2.f);
|
||||
|
||||
m[0][0] = a / aspect;
|
||||
m[0][1] = 0.f;
|
||||
m[0][2] = 0.f;
|
||||
m[0][3] = 0.f;
|
||||
|
||||
m[1][0] = 0.f;
|
||||
m[1][1] = a;
|
||||
m[1][2] = 0.f;
|
||||
m[1][3] = 0.f;
|
||||
|
||||
m[2][0] = 0.f;
|
||||
m[2][1] = 0.f;
|
||||
m[2][2] = -((f + n) / (f - n));
|
||||
m[2][3] = -1.f;
|
||||
|
||||
m[3][0] = 0.f;
|
||||
m[3][1] = 0.f;
|
||||
m[3][2] = -((2.f * f * n) / (f - n));
|
||||
m[3][3] = 0.f;
|
||||
}
|
||||
LINMATH_H_FUNC void mat4x4_look_at(mat4x4 m, vec3 const eye, vec3 const center, vec3 const up)
|
||||
{
|
||||
/* Adapted from Android's OpenGL Matrix.java. */
|
||||
/* See the OpenGL GLUT documentation for gluLookAt for a description */
|
||||
/* of the algorithm. We implement it in a straightforward way: */
|
||||
|
||||
/* TODO: The negation of of can be spared by swapping the order of
|
||||
* operands in the following cross products in the right way. */
|
||||
vec3 f;
|
||||
vec3_sub(f, center, eye);
|
||||
vec3_norm(f, f);
|
||||
|
||||
vec3 s;
|
||||
vec3_mul_cross(s, f, up);
|
||||
vec3_norm(s, s);
|
||||
|
||||
vec3 t;
|
||||
vec3_mul_cross(t, s, f);
|
||||
|
||||
m[0][0] = s[0];
|
||||
m[0][1] = t[0];
|
||||
m[0][2] = -f[0];
|
||||
m[0][3] = 0.f;
|
||||
|
||||
m[1][0] = s[1];
|
||||
m[1][1] = t[1];
|
||||
m[1][2] = -f[1];
|
||||
m[1][3] = 0.f;
|
||||
|
||||
m[2][0] = s[2];
|
||||
m[2][1] = t[2];
|
||||
m[2][2] = -f[2];
|
||||
m[2][3] = 0.f;
|
||||
|
||||
m[3][0] = 0.f;
|
||||
m[3][1] = 0.f;
|
||||
m[3][2] = 0.f;
|
||||
m[3][3] = 1.f;
|
||||
|
||||
mat4x4_translate_in_place(m, -eye[0], -eye[1], -eye[2]);
|
||||
}
|
||||
|
||||
typedef float quat[4];
|
||||
#define quat_add vec4_add
|
||||
#define quat_sub vec4_sub
|
||||
#define quat_norm vec4_norm
|
||||
#define quat_scale vec4_scale
|
||||
#define quat_mul_inner vec4_mul_inner
|
||||
|
||||
LINMATH_H_FUNC void quat_identity(quat q)
|
||||
{
|
||||
q[0] = q[1] = q[2] = 0.f;
|
||||
q[3] = 1.f;
|
||||
}
|
||||
LINMATH_H_FUNC void quat_mul(quat r, quat const p, quat const q)
|
||||
{
|
||||
vec3 w;
|
||||
vec3_mul_cross(r, p, q);
|
||||
vec3_scale(w, p, q[3]);
|
||||
vec3_add(r, r, w);
|
||||
vec3_scale(w, q, p[3]);
|
||||
vec3_add(r, r, w);
|
||||
r[3] = p[3]*q[3] - vec3_mul_inner(p, q);
|
||||
}
|
||||
LINMATH_H_FUNC void quat_conj(quat r, quat const q)
|
||||
{
|
||||
int i;
|
||||
for(i=0; i<3; ++i)
|
||||
r[i] = -q[i];
|
||||
r[3] = q[3];
|
||||
}
|
||||
LINMATH_H_FUNC void quat_rotate(quat r, float angle, vec3 const axis) {
|
||||
vec3 axis_norm;
|
||||
vec3_norm(axis_norm, axis);
|
||||
float s = sinf(angle / 2);
|
||||
float c = cosf(angle / 2);
|
||||
vec3_scale(r, axis_norm, s);
|
||||
r[3] = c;
|
||||
}
|
||||
LINMATH_H_FUNC void quat_mul_vec3(vec3 r, quat const q, vec3 const v)
|
||||
{
|
||||
/*
|
||||
* Method by Fabian 'ryg' Giessen (of Farbrausch)
|
||||
t = 2 * cross(q.xyz, v)
|
||||
v' = v + q.w * t + cross(q.xyz, t)
|
||||
*/
|
||||
vec3 t;
|
||||
vec3 q_xyz = {q[0], q[1], q[2]};
|
||||
vec3 u = {q[0], q[1], q[2]};
|
||||
|
||||
vec3_mul_cross(t, q_xyz, v);
|
||||
vec3_scale(t, t, 2);
|
||||
|
||||
vec3_mul_cross(u, q_xyz, t);
|
||||
vec3_scale(t, t, q[3]);
|
||||
|
||||
vec3_add(r, v, t);
|
||||
vec3_add(r, r, u);
|
||||
}
|
||||
LINMATH_H_FUNC void mat4x4_from_quat(mat4x4 M, quat const q)
|
||||
{
|
||||
float a = q[3];
|
||||
float b = q[0];
|
||||
float c = q[1];
|
||||
float d = q[2];
|
||||
float a2 = a*a;
|
||||
float b2 = b*b;
|
||||
float c2 = c*c;
|
||||
float d2 = d*d;
|
||||
|
||||
M[0][0] = a2 + b2 - c2 - d2;
|
||||
M[0][1] = 2.f*(b*c + a*d);
|
||||
M[0][2] = 2.f*(b*d - a*c);
|
||||
M[0][3] = 0.f;
|
||||
|
||||
M[1][0] = 2*(b*c - a*d);
|
||||
M[1][1] = a2 - b2 + c2 - d2;
|
||||
M[1][2] = 2.f*(c*d + a*b);
|
||||
M[1][3] = 0.f;
|
||||
|
||||
M[2][0] = 2.f*(b*d + a*c);
|
||||
M[2][1] = 2.f*(c*d - a*b);
|
||||
M[2][2] = a2 - b2 - c2 + d2;
|
||||
M[2][3] = 0.f;
|
||||
|
||||
M[3][0] = M[3][1] = M[3][2] = 0.f;
|
||||
M[3][3] = 1.f;
|
||||
}
|
||||
|
||||
LINMATH_H_FUNC void mat4x4o_mul_quat(mat4x4 R, mat4x4 const M, quat const q)
|
||||
{
|
||||
/* XXX: The way this is written only works for orthogonal matrices. */
|
||||
/* TODO: Take care of non-orthogonal case. */
|
||||
quat_mul_vec3(R[0], q, M[0]);
|
||||
quat_mul_vec3(R[1], q, M[1]);
|
||||
quat_mul_vec3(R[2], q, M[2]);
|
||||
|
||||
R[3][0] = R[3][1] = R[3][2] = 0.f;
|
||||
R[0][3] = M[0][3];
|
||||
R[1][3] = M[1][3];
|
||||
R[2][3] = M[2][3];
|
||||
R[3][3] = M[3][3]; // typically 1.0, but here we make it general
|
||||
}
|
||||
LINMATH_H_FUNC void quat_from_mat4x4(quat q, mat4x4 const M)
|
||||
{
|
||||
float r=0.f;
|
||||
int i;
|
||||
|
||||
int perm[] = { 0, 1, 2, 0, 1 };
|
||||
int *p = perm;
|
||||
|
||||
for(i = 0; i<3; i++) {
|
||||
float m = M[i][i];
|
||||
if( m < r )
|
||||
continue;
|
||||
m = r;
|
||||
p = &perm[i];
|
||||
}
|
||||
|
||||
r = sqrtf(1.f + M[p[0]][p[0]] - M[p[1]][p[1]] - M[p[2]][p[2]] );
|
||||
|
||||
if(r < 1e-6) {
|
||||
q[0] = 1.f;
|
||||
q[1] = q[2] = q[3] = 0.f;
|
||||
return;
|
||||
}
|
||||
|
||||
q[0] = r/2.f;
|
||||
q[1] = (M[p[0]][p[1]] - M[p[1]][p[0]])/(2.f*r);
|
||||
q[2] = (M[p[2]][p[0]] - M[p[0]][p[2]])/(2.f*r);
|
||||
q[3] = (M[p[2]][p[1]] - M[p[1]][p[2]])/(2.f*r);
|
||||
}
|
||||
|
||||
LINMATH_H_FUNC void mat4x4_arcball(mat4x4 R, mat4x4 const M, vec2 const _a, vec2 const _b, float s)
|
||||
{
|
||||
vec2 a; memcpy(a, _a, sizeof(a));
|
||||
vec2 b; memcpy(b, _b, sizeof(b));
|
||||
|
||||
float z_a = 0.f;
|
||||
float z_b = 0.f;
|
||||
|
||||
if(vec2_len(a) < 1.f) {
|
||||
z_a = sqrtf(1.f - vec2_mul_inner(a, a));
|
||||
} else {
|
||||
vec2_norm(a, a);
|
||||
}
|
||||
|
||||
if(vec2_len(b) < 1.f) {
|
||||
z_b = sqrtf(1.f - vec2_mul_inner(b, b));
|
||||
} else {
|
||||
vec2_norm(b, b);
|
||||
}
|
||||
|
||||
vec3 a_ = {a[0], a[1], z_a};
|
||||
vec3 b_ = {b[0], b[1], z_b};
|
||||
|
||||
vec3 c_;
|
||||
vec3_mul_cross(c_, a_, b_);
|
||||
|
||||
float const angle = acos(vec3_mul_inner(a_, b_)) * s;
|
||||
mat4x4_rotate(R, M, c_[0], c_[1], c_[2], angle);
|
||||
}
|
||||
#endif
|
117
deps/mingw/_mingw_dxhelper.h
vendored
Normal file
117
deps/mingw/_mingw_dxhelper.h
vendored
Normal file
|
@ -0,0 +1,117 @@
|
|||
/**
|
||||
* This file has no copyright assigned and is placed in the Public Domain.
|
||||
* This file is part of the mingw-w64 runtime package.
|
||||
* No warranty is given; refer to the file DISCLAIMER within this package.
|
||||
*/
|
||||
|
||||
#if defined(_MSC_VER) && !defined(_MSC_EXTENSIONS)
|
||||
#define NONAMELESSUNION 1
|
||||
#endif
|
||||
#if defined(NONAMELESSSTRUCT) && \
|
||||
!defined(NONAMELESSUNION)
|
||||
#define NONAMELESSUNION 1
|
||||
#endif
|
||||
#if defined(NONAMELESSUNION) && \
|
||||
!defined(NONAMELESSSTRUCT)
|
||||
#define NONAMELESSSTRUCT 1
|
||||
#endif
|
||||
#if !defined(__GNU_EXTENSION)
|
||||
#if defined(__GNUC__) || defined(__GNUG__)
|
||||
#define __GNU_EXTENSION __extension__
|
||||
#else
|
||||
#define __GNU_EXTENSION
|
||||
#endif
|
||||
#endif /* __extension__ */
|
||||
|
||||
#ifndef __ANONYMOUS_DEFINED
|
||||
#define __ANONYMOUS_DEFINED
|
||||
#if defined(__GNUC__) || defined(__GNUG__)
|
||||
#define _ANONYMOUS_UNION __extension__
|
||||
#define _ANONYMOUS_STRUCT __extension__
|
||||
#else
|
||||
#define _ANONYMOUS_UNION
|
||||
#define _ANONYMOUS_STRUCT
|
||||
#endif
|
||||
#ifndef NONAMELESSUNION
|
||||
#define _UNION_NAME(x)
|
||||
#define _STRUCT_NAME(x)
|
||||
#else /* NONAMELESSUNION */
|
||||
#define _UNION_NAME(x) x
|
||||
#define _STRUCT_NAME(x) x
|
||||
#endif
|
||||
#endif /* __ANONYMOUS_DEFINED */
|
||||
|
||||
#ifndef DUMMYUNIONNAME
|
||||
# ifdef NONAMELESSUNION
|
||||
# define DUMMYUNIONNAME u
|
||||
# define DUMMYUNIONNAME1 u1 /* Wine uses this variant */
|
||||
# define DUMMYUNIONNAME2 u2
|
||||
# define DUMMYUNIONNAME3 u3
|
||||
# define DUMMYUNIONNAME4 u4
|
||||
# define DUMMYUNIONNAME5 u5
|
||||
# define DUMMYUNIONNAME6 u6
|
||||
# define DUMMYUNIONNAME7 u7
|
||||
# define DUMMYUNIONNAME8 u8
|
||||
# define DUMMYUNIONNAME9 u9
|
||||
# else /* NONAMELESSUNION */
|
||||
# define DUMMYUNIONNAME
|
||||
# define DUMMYUNIONNAME1 /* Wine uses this variant */
|
||||
# define DUMMYUNIONNAME2
|
||||
# define DUMMYUNIONNAME3
|
||||
# define DUMMYUNIONNAME4
|
||||
# define DUMMYUNIONNAME5
|
||||
# define DUMMYUNIONNAME6
|
||||
# define DUMMYUNIONNAME7
|
||||
# define DUMMYUNIONNAME8
|
||||
# define DUMMYUNIONNAME9
|
||||
# endif
|
||||
#endif /* DUMMYUNIONNAME */
|
||||
|
||||
#if !defined(DUMMYUNIONNAME1) /* MinGW does not define this one */
|
||||
# ifdef NONAMELESSUNION
|
||||
# define DUMMYUNIONNAME1 u1 /* Wine uses this variant */
|
||||
# else
|
||||
# define DUMMYUNIONNAME1 /* Wine uses this variant */
|
||||
# endif
|
||||
#endif /* DUMMYUNIONNAME1 */
|
||||
|
||||
#ifndef DUMMYSTRUCTNAME
|
||||
# ifdef NONAMELESSUNION
|
||||
# define DUMMYSTRUCTNAME s
|
||||
# define DUMMYSTRUCTNAME1 s1 /* Wine uses this variant */
|
||||
# define DUMMYSTRUCTNAME2 s2
|
||||
# define DUMMYSTRUCTNAME3 s3
|
||||
# define DUMMYSTRUCTNAME4 s4
|
||||
# define DUMMYSTRUCTNAME5 s5
|
||||
# else
|
||||
# define DUMMYSTRUCTNAME
|
||||
# define DUMMYSTRUCTNAME1 /* Wine uses this variant */
|
||||
# define DUMMYSTRUCTNAME2
|
||||
# define DUMMYSTRUCTNAME3
|
||||
# define DUMMYSTRUCTNAME4
|
||||
# define DUMMYSTRUCTNAME5
|
||||
# endif
|
||||
#endif /* DUMMYSTRUCTNAME */
|
||||
|
||||
/* These are for compatibility with the Wine source tree */
|
||||
|
||||
#ifndef WINELIB_NAME_AW
|
||||
# ifdef __MINGW_NAME_AW
|
||||
# define WINELIB_NAME_AW __MINGW_NAME_AW
|
||||
# else
|
||||
# ifdef UNICODE
|
||||
# define WINELIB_NAME_AW(func) func##W
|
||||
# else
|
||||
# define WINELIB_NAME_AW(func) func##A
|
||||
# endif
|
||||
# endif
|
||||
#endif /* WINELIB_NAME_AW */
|
||||
|
||||
#ifndef DECL_WINELIB_TYPE_AW
|
||||
# ifdef __MINGW_TYPEDEF_AW
|
||||
# define DECL_WINELIB_TYPE_AW __MINGW_TYPEDEF_AW
|
||||
# else
|
||||
# define DECL_WINELIB_TYPE_AW(type) typedef WINELIB_NAME_AW(type) type;
|
||||
# endif
|
||||
#endif /* DECL_WINELIB_TYPE_AW */
|
||||
|
2467
deps/mingw/dinput.h
vendored
Normal file
2467
deps/mingw/dinput.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
239
deps/mingw/xinput.h
vendored
Normal file
239
deps/mingw/xinput.h
vendored
Normal file
|
@ -0,0 +1,239 @@
|
|||
/*
|
||||
* The Wine project - Xinput Joystick Library
|
||||
* Copyright 2008 Andrew Fenn
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#ifndef __WINE_XINPUT_H
|
||||
#define __WINE_XINPUT_H
|
||||
|
||||
#include <windef.h>
|
||||
|
||||
/*
|
||||
* Bitmasks for the joysticks buttons, determines what has
|
||||
* been pressed on the joystick, these need to be mapped
|
||||
* to whatever device you're using instead of an xbox 360
|
||||
* joystick
|
||||
*/
|
||||
|
||||
#define XINPUT_GAMEPAD_DPAD_UP 0x0001
|
||||
#define XINPUT_GAMEPAD_DPAD_DOWN 0x0002
|
||||
#define XINPUT_GAMEPAD_DPAD_LEFT 0x0004
|
||||
#define XINPUT_GAMEPAD_DPAD_RIGHT 0x0008
|
||||
#define XINPUT_GAMEPAD_START 0x0010
|
||||
#define XINPUT_GAMEPAD_BACK 0x0020
|
||||
#define XINPUT_GAMEPAD_LEFT_THUMB 0x0040
|
||||
#define XINPUT_GAMEPAD_RIGHT_THUMB 0x0080
|
||||
#define XINPUT_GAMEPAD_LEFT_SHOULDER 0x0100
|
||||
#define XINPUT_GAMEPAD_RIGHT_SHOULDER 0x0200
|
||||
#define XINPUT_GAMEPAD_A 0x1000
|
||||
#define XINPUT_GAMEPAD_B 0x2000
|
||||
#define XINPUT_GAMEPAD_X 0x4000
|
||||
#define XINPUT_GAMEPAD_Y 0x8000
|
||||
|
||||
/*
|
||||
* Defines the flags used to determine if the user is pushing
|
||||
* down on a button, not holding a button, etc
|
||||
*/
|
||||
|
||||
#define XINPUT_KEYSTROKE_KEYDOWN 0x0001
|
||||
#define XINPUT_KEYSTROKE_KEYUP 0x0002
|
||||
#define XINPUT_KEYSTROKE_REPEAT 0x0004
|
||||
|
||||
/*
|
||||
* Defines the codes which are returned by XInputGetKeystroke
|
||||
*/
|
||||
|
||||
#define VK_PAD_A 0x5800
|
||||
#define VK_PAD_B 0x5801
|
||||
#define VK_PAD_X 0x5802
|
||||
#define VK_PAD_Y 0x5803
|
||||
#define VK_PAD_RSHOULDER 0x5804
|
||||
#define VK_PAD_LSHOULDER 0x5805
|
||||
#define VK_PAD_LTRIGGER 0x5806
|
||||
#define VK_PAD_RTRIGGER 0x5807
|
||||
#define VK_PAD_DPAD_UP 0x5810
|
||||
#define VK_PAD_DPAD_DOWN 0x5811
|
||||
#define VK_PAD_DPAD_LEFT 0x5812
|
||||
#define VK_PAD_DPAD_RIGHT 0x5813
|
||||
#define VK_PAD_START 0x5814
|
||||
#define VK_PAD_BACK 0x5815
|
||||
#define VK_PAD_LTHUMB_PRESS 0x5816
|
||||
#define VK_PAD_RTHUMB_PRESS 0x5817
|
||||
#define VK_PAD_LTHUMB_UP 0x5820
|
||||
#define VK_PAD_LTHUMB_DOWN 0x5821
|
||||
#define VK_PAD_LTHUMB_RIGHT 0x5822
|
||||
#define VK_PAD_LTHUMB_LEFT 0x5823
|
||||
#define VK_PAD_LTHUMB_UPLEFT 0x5824
|
||||
#define VK_PAD_LTHUMB_UPRIGHT 0x5825
|
||||
#define VK_PAD_LTHUMB_DOWNRIGHT 0x5826
|
||||
#define VK_PAD_LTHUMB_DOWNLEFT 0x5827
|
||||
#define VK_PAD_RTHUMB_UP 0x5830
|
||||
#define VK_PAD_RTHUMB_DOWN 0x5831
|
||||
#define VK_PAD_RTHUMB_RIGHT 0x5832
|
||||
#define VK_PAD_RTHUMB_LEFT 0x5833
|
||||
#define VK_PAD_RTHUMB_UPLEFT 0x5834
|
||||
#define VK_PAD_RTHUMB_UPRIGHT 0x5835
|
||||
#define VK_PAD_RTHUMB_DOWNRIGHT 0x5836
|
||||
#define VK_PAD_RTHUMB_DOWNLEFT 0x5837
|
||||
|
||||
/*
|
||||
* Deadzones are for analogue joystick controls on the joypad
|
||||
* which determine when input should be assumed to be in the
|
||||
* middle of the pad. This is a threshold to stop a joypad
|
||||
* controlling the game when the player isn't touching the
|
||||
* controls.
|
||||
*/
|
||||
|
||||
#define XINPUT_GAMEPAD_LEFT_THUMB_DEADZONE 7849
|
||||
#define XINPUT_GAMEPAD_RIGHT_THUMB_DEADZONE 8689
|
||||
#define XINPUT_GAMEPAD_TRIGGER_THRESHOLD 30
|
||||
|
||||
|
||||
/*
|
||||
* Defines what type of abilities the type of joystick has
|
||||
* DEVTYPE_GAMEPAD is available for all joysticks, however
|
||||
* there may be more specific identifiers for other joysticks
|
||||
* which are being used.
|
||||
*/
|
||||
|
||||
#define XINPUT_DEVTYPE_GAMEPAD 0x01
|
||||
#define XINPUT_DEVSUBTYPE_GAMEPAD 0x01
|
||||
#define XINPUT_DEVSUBTYPE_WHEEL 0x02
|
||||
#define XINPUT_DEVSUBTYPE_ARCADE_STICK 0x03
|
||||
#define XINPUT_DEVSUBTYPE_FLIGHT_SICK 0x04
|
||||
#define XINPUT_DEVSUBTYPE_DANCE_PAD 0x05
|
||||
#define XINPUT_DEVSUBTYPE_GUITAR 0x06
|
||||
#define XINPUT_DEVSUBTYPE_DRUM_KIT 0x08
|
||||
|
||||
/*
|
||||
* These are used with the XInputGetCapabilities function to
|
||||
* determine the abilities to the joystick which has been
|
||||
* plugged in.
|
||||
*/
|
||||
|
||||
#define XINPUT_CAPS_VOICE_SUPPORTED 0x0004
|
||||
#define XINPUT_FLAG_GAMEPAD 0x00000001
|
||||
|
||||
/*
|
||||
* Defines the status of the battery if one is used in the
|
||||
* attached joystick. The first two define if the joystick
|
||||
* supports a battery. Disconnected means that the joystick
|
||||
* isn't connected. Wired shows that the joystick is a wired
|
||||
* joystick.
|
||||
*/
|
||||
|
||||
#define BATTERY_DEVTYPE_GAMEPAD 0x00
|
||||
#define BATTERY_DEVTYPE_HEADSET 0x01
|
||||
#define BATTERY_TYPE_DISCONNECTED 0x00
|
||||
#define BATTERY_TYPE_WIRED 0x01
|
||||
#define BATTERY_TYPE_ALKALINE 0x02
|
||||
#define BATTERY_TYPE_NIMH 0x03
|
||||
#define BATTERY_TYPE_UNKNOWN 0xFF
|
||||
#define BATTERY_LEVEL_EMPTY 0x00
|
||||
#define BATTERY_LEVEL_LOW 0x01
|
||||
#define BATTERY_LEVEL_MEDIUM 0x02
|
||||
#define BATTERY_LEVEL_FULL 0x03
|
||||
|
||||
/*
|
||||
* How many joysticks can be used with this library. Games that
|
||||
* use the xinput library will not go over this number.
|
||||
*/
|
||||
|
||||
#define XUSER_MAX_COUNT 4
|
||||
#define XUSER_INDEX_ANY 0x000000FF
|
||||
|
||||
/*
|
||||
* Defines the structure of an xbox 360 joystick.
|
||||
*/
|
||||
|
||||
typedef struct _XINPUT_GAMEPAD {
|
||||
WORD wButtons;
|
||||
BYTE bLeftTrigger;
|
||||
BYTE bRightTrigger;
|
||||
SHORT sThumbLX;
|
||||
SHORT sThumbLY;
|
||||
SHORT sThumbRX;
|
||||
SHORT sThumbRY;
|
||||
} XINPUT_GAMEPAD, *PXINPUT_GAMEPAD;
|
||||
|
||||
typedef struct _XINPUT_STATE {
|
||||
DWORD dwPacketNumber;
|
||||
XINPUT_GAMEPAD Gamepad;
|
||||
} XINPUT_STATE, *PXINPUT_STATE;
|
||||
|
||||
/*
|
||||
* Defines the structure of how much vibration is set on both the
|
||||
* right and left motors in a joystick. If you're not using a 360
|
||||
* joystick you will have to map these to your device.
|
||||
*/
|
||||
|
||||
typedef struct _XINPUT_VIBRATION {
|
||||
WORD wLeftMotorSpeed;
|
||||
WORD wRightMotorSpeed;
|
||||
} XINPUT_VIBRATION, *PXINPUT_VIBRATION;
|
||||
|
||||
/*
|
||||
* Defines the structure for what kind of abilities the joystick has
|
||||
* such abilities are things such as if the joystick has the ability
|
||||
* to send and receive audio, if the joystick is in fact a driving
|
||||
* wheel or perhaps if the joystick is some kind of dance pad or
|
||||
* guitar.
|
||||
*/
|
||||
|
||||
typedef struct _XINPUT_CAPABILITIES {
|
||||
BYTE Type;
|
||||
BYTE SubType;
|
||||
WORD Flags;
|
||||
XINPUT_GAMEPAD Gamepad;
|
||||
XINPUT_VIBRATION Vibration;
|
||||
} XINPUT_CAPABILITIES, *PXINPUT_CAPABILITIES;
|
||||
|
||||
/*
|
||||
* Defines the structure for a joystick input event which is
|
||||
* retrieved using the function XInputGetKeystroke
|
||||
*/
|
||||
typedef struct _XINPUT_KEYSTROKE {
|
||||
WORD VirtualKey;
|
||||
WCHAR Unicode;
|
||||
WORD Flags;
|
||||
BYTE UserIndex;
|
||||
BYTE HidCode;
|
||||
} XINPUT_KEYSTROKE, *PXINPUT_KEYSTROKE;
|
||||
|
||||
typedef struct _XINPUT_BATTERY_INFORMATION
|
||||
{
|
||||
BYTE BatteryType;
|
||||
BYTE BatteryLevel;
|
||||
} XINPUT_BATTERY_INFORMATION, *PXINPUT_BATTERY_INFORMATION;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void WINAPI XInputEnable(WINBOOL);
|
||||
DWORD WINAPI XInputSetState(DWORD, XINPUT_VIBRATION*);
|
||||
DWORD WINAPI XInputGetState(DWORD, XINPUT_STATE*);
|
||||
DWORD WINAPI XInputGetKeystroke(DWORD, DWORD, PXINPUT_KEYSTROKE);
|
||||
DWORD WINAPI XInputGetCapabilities(DWORD, DWORD, XINPUT_CAPABILITIES*);
|
||||
DWORD WINAPI XInputGetDSoundAudioDeviceGuids(DWORD, GUID*, GUID*);
|
||||
DWORD WINAPI XInputGetBatteryInformation(DWORD, BYTE, XINPUT_BATTERY_INFORMATION*);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __WINE_XINPUT_H */
|
25778
deps/nuklear.h
vendored
Normal file
25778
deps/nuklear.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
381
deps/nuklear_glfw_gl2.h
vendored
Normal file
381
deps/nuklear_glfw_gl2.h
vendored
Normal file
|
@ -0,0 +1,381 @@
|
|||
/*
|
||||
* Nuklear - v1.32.0 - public domain
|
||||
* no warrenty implied; use at your own risk.
|
||||
* authored from 2015-2017 by Micha Mettke
|
||||
*/
|
||||
/*
|
||||
* ==============================================================
|
||||
*
|
||||
* API
|
||||
*
|
||||
* ===============================================================
|
||||
*/
|
||||
#ifndef NK_GLFW_GL2_H_
|
||||
#define NK_GLFW_GL2_H_
|
||||
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
enum nk_glfw_init_state{
|
||||
NK_GLFW3_DEFAULT = 0,
|
||||
NK_GLFW3_INSTALL_CALLBACKS
|
||||
};
|
||||
NK_API struct nk_context* nk_glfw3_init(GLFWwindow *win, enum nk_glfw_init_state);
|
||||
NK_API void nk_glfw3_font_stash_begin(struct nk_font_atlas **atlas);
|
||||
NK_API void nk_glfw3_font_stash_end(void);
|
||||
|
||||
NK_API void nk_glfw3_new_frame(void);
|
||||
NK_API void nk_glfw3_render(enum nk_anti_aliasing);
|
||||
NK_API void nk_glfw3_shutdown(void);
|
||||
|
||||
NK_API void nk_glfw3_char_callback(GLFWwindow *win, unsigned int codepoint);
|
||||
NK_API void nk_gflw3_scroll_callback(GLFWwindow *win, double xoff, double yoff);
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* ==============================================================
|
||||
*
|
||||
* IMPLEMENTATION
|
||||
*
|
||||
* ===============================================================
|
||||
*/
|
||||
#ifdef NK_GLFW_GL2_IMPLEMENTATION
|
||||
|
||||
#ifndef NK_GLFW_TEXT_MAX
|
||||
#define NK_GLFW_TEXT_MAX 256
|
||||
#endif
|
||||
#ifndef NK_GLFW_DOUBLE_CLICK_LO
|
||||
#define NK_GLFW_DOUBLE_CLICK_LO 0.02
|
||||
#endif
|
||||
#ifndef NK_GLFW_DOUBLE_CLICK_HI
|
||||
#define NK_GLFW_DOUBLE_CLICK_HI 0.2
|
||||
#endif
|
||||
|
||||
struct nk_glfw_device {
|
||||
struct nk_buffer cmds;
|
||||
struct nk_draw_null_texture null;
|
||||
GLuint font_tex;
|
||||
};
|
||||
|
||||
struct nk_glfw_vertex {
|
||||
float position[2];
|
||||
float uv[2];
|
||||
nk_byte col[4];
|
||||
};
|
||||
|
||||
static struct nk_glfw {
|
||||
GLFWwindow *win;
|
||||
int width, height;
|
||||
int display_width, display_height;
|
||||
struct nk_glfw_device ogl;
|
||||
struct nk_context ctx;
|
||||
struct nk_font_atlas atlas;
|
||||
struct nk_vec2 fb_scale;
|
||||
unsigned int text[NK_GLFW_TEXT_MAX];
|
||||
int text_len;
|
||||
struct nk_vec2 scroll;
|
||||
double last_button_click;
|
||||
int is_double_click_down;
|
||||
struct nk_vec2 double_click_pos;
|
||||
} glfw;
|
||||
|
||||
NK_INTERN void
|
||||
nk_glfw3_device_upload_atlas(const void *image, int width, int height)
|
||||
{
|
||||
struct nk_glfw_device *dev = &glfw.ogl;
|
||||
glGenTextures(1, &dev->font_tex);
|
||||
glBindTexture(GL_TEXTURE_2D, dev->font_tex);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, (GLsizei)width, (GLsizei)height, 0,
|
||||
GL_RGBA, GL_UNSIGNED_BYTE, image);
|
||||
}
|
||||
|
||||
NK_API void
|
||||
nk_glfw3_render(enum nk_anti_aliasing AA)
|
||||
{
|
||||
/* setup global state */
|
||||
struct nk_glfw_device *dev = &glfw.ogl;
|
||||
glPushAttrib(GL_ENABLE_BIT|GL_COLOR_BUFFER_BIT|GL_TRANSFORM_BIT);
|
||||
glDisable(GL_CULL_FACE);
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
glEnable(GL_SCISSOR_TEST);
|
||||
glEnable(GL_BLEND);
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
/* setup viewport/project */
|
||||
glViewport(0,0,(GLsizei)glfw.display_width,(GLsizei)glfw.display_height);
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glPushMatrix();
|
||||
glLoadIdentity();
|
||||
glOrtho(0.0f, glfw.width, glfw.height, 0.0f, -1.0f, 1.0f);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glPushMatrix();
|
||||
glLoadIdentity();
|
||||
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glEnableClientState(GL_COLOR_ARRAY);
|
||||
{
|
||||
GLsizei vs = sizeof(struct nk_glfw_vertex);
|
||||
size_t vp = offsetof(struct nk_glfw_vertex, position);
|
||||
size_t vt = offsetof(struct nk_glfw_vertex, uv);
|
||||
size_t vc = offsetof(struct nk_glfw_vertex, col);
|
||||
|
||||
/* convert from command queue into draw list and draw to screen */
|
||||
const struct nk_draw_command *cmd;
|
||||
const nk_draw_index *offset = NULL;
|
||||
struct nk_buffer vbuf, ebuf;
|
||||
|
||||
/* fill convert configuration */
|
||||
struct nk_convert_config config;
|
||||
static const struct nk_draw_vertex_layout_element vertex_layout[] = {
|
||||
{NK_VERTEX_POSITION, NK_FORMAT_FLOAT, NK_OFFSETOF(struct nk_glfw_vertex, position)},
|
||||
{NK_VERTEX_TEXCOORD, NK_FORMAT_FLOAT, NK_OFFSETOF(struct nk_glfw_vertex, uv)},
|
||||
{NK_VERTEX_COLOR, NK_FORMAT_R8G8B8A8, NK_OFFSETOF(struct nk_glfw_vertex, col)},
|
||||
{NK_VERTEX_LAYOUT_END}
|
||||
};
|
||||
NK_MEMSET(&config, 0, sizeof(config));
|
||||
config.vertex_layout = vertex_layout;
|
||||
config.vertex_size = sizeof(struct nk_glfw_vertex);
|
||||
config.vertex_alignment = NK_ALIGNOF(struct nk_glfw_vertex);
|
||||
config.null = dev->null;
|
||||
config.circle_segment_count = 22;
|
||||
config.curve_segment_count = 22;
|
||||
config.arc_segment_count = 22;
|
||||
config.global_alpha = 1.0f;
|
||||
config.shape_AA = AA;
|
||||
config.line_AA = AA;
|
||||
|
||||
/* convert shapes into vertexes */
|
||||
nk_buffer_init_default(&vbuf);
|
||||
nk_buffer_init_default(&ebuf);
|
||||
nk_convert(&glfw.ctx, &dev->cmds, &vbuf, &ebuf, &config);
|
||||
|
||||
/* setup vertex buffer pointer */
|
||||
{const void *vertices = nk_buffer_memory_const(&vbuf);
|
||||
glVertexPointer(2, GL_FLOAT, vs, (const void*)((const nk_byte*)vertices + vp));
|
||||
glTexCoordPointer(2, GL_FLOAT, vs, (const void*)((const nk_byte*)vertices + vt));
|
||||
glColorPointer(4, GL_UNSIGNED_BYTE, vs, (const void*)((const nk_byte*)vertices + vc));}
|
||||
|
||||
/* iterate over and execute each draw command */
|
||||
offset = (const nk_draw_index*)nk_buffer_memory_const(&ebuf);
|
||||
nk_draw_foreach(cmd, &glfw.ctx, &dev->cmds)
|
||||
{
|
||||
if (!cmd->elem_count) continue;
|
||||
glBindTexture(GL_TEXTURE_2D, (GLuint)cmd->texture.id);
|
||||
glScissor(
|
||||
(GLint)(cmd->clip_rect.x * glfw.fb_scale.x),
|
||||
(GLint)((glfw.height - (GLint)(cmd->clip_rect.y + cmd->clip_rect.h)) * glfw.fb_scale.y),
|
||||
(GLint)(cmd->clip_rect.w * glfw.fb_scale.x),
|
||||
(GLint)(cmd->clip_rect.h * glfw.fb_scale.y));
|
||||
glDrawElements(GL_TRIANGLES, (GLsizei)cmd->elem_count, GL_UNSIGNED_SHORT, offset);
|
||||
offset += cmd->elem_count;
|
||||
}
|
||||
nk_clear(&glfw.ctx);
|
||||
nk_buffer_free(&vbuf);
|
||||
nk_buffer_free(&ebuf);
|
||||
}
|
||||
|
||||
/* default OpenGL state */
|
||||
glDisableClientState(GL_VERTEX_ARRAY);
|
||||
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glDisableClientState(GL_COLOR_ARRAY);
|
||||
|
||||
glDisable(GL_CULL_FACE);
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
glDisable(GL_SCISSOR_TEST);
|
||||
glDisable(GL_BLEND);
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, 0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glPopMatrix();
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glPopMatrix();
|
||||
glPopAttrib();
|
||||
}
|
||||
|
||||
NK_API void
|
||||
nk_glfw3_char_callback(GLFWwindow *win, unsigned int codepoint)
|
||||
{
|
||||
(void)win;
|
||||
if (glfw.text_len < NK_GLFW_TEXT_MAX)
|
||||
glfw.text[glfw.text_len++] = codepoint;
|
||||
}
|
||||
|
||||
NK_API void
|
||||
nk_gflw3_scroll_callback(GLFWwindow *win, double xoff, double yoff)
|
||||
{
|
||||
(void)win; (void)xoff;
|
||||
glfw.scroll.x += (float)xoff;
|
||||
glfw.scroll.y += (float)yoff;
|
||||
}
|
||||
|
||||
NK_API void
|
||||
nk_glfw3_mouse_button_callback(GLFWwindow* window, int button, int action, int mods)
|
||||
{
|
||||
double x, y;
|
||||
if (button != GLFW_MOUSE_BUTTON_LEFT) return;
|
||||
glfwGetCursorPos(window, &x, &y);
|
||||
if (action == GLFW_PRESS) {
|
||||
double dt = glfwGetTime() - glfw.last_button_click;
|
||||
if (dt > NK_GLFW_DOUBLE_CLICK_LO && dt < NK_GLFW_DOUBLE_CLICK_HI) {
|
||||
glfw.is_double_click_down = nk_true;
|
||||
glfw.double_click_pos = nk_vec2((float)x, (float)y);
|
||||
}
|
||||
glfw.last_button_click = glfwGetTime();
|
||||
} else glfw.is_double_click_down = nk_false;
|
||||
}
|
||||
|
||||
NK_INTERN void
|
||||
nk_glfw3_clipboard_paste(nk_handle usr, struct nk_text_edit *edit)
|
||||
{
|
||||
const char *text = glfwGetClipboardString(glfw.win);
|
||||
if (text) nk_textedit_paste(edit, text, nk_strlen(text));
|
||||
(void)usr;
|
||||
}
|
||||
|
||||
NK_INTERN void
|
||||
nk_glfw3_clipboard_copy(nk_handle usr, const char *text, int len)
|
||||
{
|
||||
char *str = 0;
|
||||
(void)usr;
|
||||
if (!len) return;
|
||||
str = (char*)malloc((size_t)len+1);
|
||||
if (!str) return;
|
||||
NK_MEMCPY(str, text, (size_t)len);
|
||||
str[len] = '\0';
|
||||
glfwSetClipboardString(glfw.win, str);
|
||||
free(str);
|
||||
}
|
||||
|
||||
NK_API struct nk_context*
|
||||
nk_glfw3_init(GLFWwindow *win, enum nk_glfw_init_state init_state)
|
||||
{
|
||||
glfw.win = win;
|
||||
if (init_state == NK_GLFW3_INSTALL_CALLBACKS) {
|
||||
glfwSetScrollCallback(win, nk_gflw3_scroll_callback);
|
||||
glfwSetCharCallback(win, nk_glfw3_char_callback);
|
||||
glfwSetMouseButtonCallback(win, nk_glfw3_mouse_button_callback);
|
||||
}
|
||||
nk_init_default(&glfw.ctx, 0);
|
||||
glfw.ctx.clip.copy = nk_glfw3_clipboard_copy;
|
||||
glfw.ctx.clip.paste = nk_glfw3_clipboard_paste;
|
||||
glfw.ctx.clip.userdata = nk_handle_ptr(0);
|
||||
nk_buffer_init_default(&glfw.ogl.cmds);
|
||||
|
||||
glfw.is_double_click_down = nk_false;
|
||||
glfw.double_click_pos = nk_vec2(0, 0);
|
||||
|
||||
return &glfw.ctx;
|
||||
}
|
||||
|
||||
NK_API void
|
||||
nk_glfw3_font_stash_begin(struct nk_font_atlas **atlas)
|
||||
{
|
||||
nk_font_atlas_init_default(&glfw.atlas);
|
||||
nk_font_atlas_begin(&glfw.atlas);
|
||||
*atlas = &glfw.atlas;
|
||||
}
|
||||
|
||||
NK_API void
|
||||
nk_glfw3_font_stash_end(void)
|
||||
{
|
||||
const void *image; int w, h;
|
||||
image = nk_font_atlas_bake(&glfw.atlas, &w, &h, NK_FONT_ATLAS_RGBA32);
|
||||
nk_glfw3_device_upload_atlas(image, w, h);
|
||||
nk_font_atlas_end(&glfw.atlas, nk_handle_id((int)glfw.ogl.font_tex), &glfw.ogl.null);
|
||||
if (glfw.atlas.default_font)
|
||||
nk_style_set_font(&glfw.ctx, &glfw.atlas.default_font->handle);
|
||||
}
|
||||
|
||||
NK_API void
|
||||
nk_glfw3_new_frame(void)
|
||||
{
|
||||
int i;
|
||||
double x, y;
|
||||
struct nk_context *ctx = &glfw.ctx;
|
||||
struct GLFWwindow *win = glfw.win;
|
||||
|
||||
glfwGetWindowSize(win, &glfw.width, &glfw.height);
|
||||
glfwGetFramebufferSize(win, &glfw.display_width, &glfw.display_height);
|
||||
glfw.fb_scale.x = (float)glfw.display_width/(float)glfw.width;
|
||||
glfw.fb_scale.y = (float)glfw.display_height/(float)glfw.height;
|
||||
|
||||
nk_input_begin(ctx);
|
||||
for (i = 0; i < glfw.text_len; ++i)
|
||||
nk_input_unicode(ctx, glfw.text[i]);
|
||||
|
||||
/* optional grabbing behavior */
|
||||
if (ctx->input.mouse.grab)
|
||||
glfwSetInputMode(glfw.win, GLFW_CURSOR, GLFW_CURSOR_HIDDEN);
|
||||
else if (ctx->input.mouse.ungrab)
|
||||
glfwSetInputMode(glfw.win, GLFW_CURSOR, GLFW_CURSOR_NORMAL);
|
||||
|
||||
nk_input_key(ctx, NK_KEY_DEL, glfwGetKey(win, GLFW_KEY_DELETE) == GLFW_PRESS);
|
||||
nk_input_key(ctx, NK_KEY_ENTER, glfwGetKey(win, GLFW_KEY_ENTER) == GLFW_PRESS);
|
||||
nk_input_key(ctx, NK_KEY_TAB, glfwGetKey(win, GLFW_KEY_TAB) == GLFW_PRESS);
|
||||
nk_input_key(ctx, NK_KEY_BACKSPACE, glfwGetKey(win, GLFW_KEY_BACKSPACE) == GLFW_PRESS);
|
||||
nk_input_key(ctx, NK_KEY_UP, glfwGetKey(win, GLFW_KEY_UP) == GLFW_PRESS);
|
||||
nk_input_key(ctx, NK_KEY_DOWN, glfwGetKey(win, GLFW_KEY_DOWN) == GLFW_PRESS);
|
||||
nk_input_key(ctx, NK_KEY_TEXT_START, glfwGetKey(win, GLFW_KEY_HOME) == GLFW_PRESS);
|
||||
nk_input_key(ctx, NK_KEY_TEXT_END, glfwGetKey(win, GLFW_KEY_END) == GLFW_PRESS);
|
||||
nk_input_key(ctx, NK_KEY_SCROLL_START, glfwGetKey(win, GLFW_KEY_HOME) == GLFW_PRESS);
|
||||
nk_input_key(ctx, NK_KEY_SCROLL_END, glfwGetKey(win, GLFW_KEY_END) == GLFW_PRESS);
|
||||
nk_input_key(ctx, NK_KEY_SCROLL_DOWN, glfwGetKey(win, GLFW_KEY_PAGE_DOWN) == GLFW_PRESS);
|
||||
nk_input_key(ctx, NK_KEY_SCROLL_UP, glfwGetKey(win, GLFW_KEY_PAGE_UP) == GLFW_PRESS);
|
||||
nk_input_key(ctx, NK_KEY_SHIFT, glfwGetKey(win, GLFW_KEY_LEFT_SHIFT) == GLFW_PRESS||
|
||||
glfwGetKey(win, GLFW_KEY_RIGHT_SHIFT) == GLFW_PRESS);
|
||||
|
||||
if (glfwGetKey(win, GLFW_KEY_LEFT_CONTROL) == GLFW_PRESS ||
|
||||
glfwGetKey(win, GLFW_KEY_RIGHT_CONTROL) == GLFW_PRESS) {
|
||||
nk_input_key(ctx, NK_KEY_COPY, glfwGetKey(win, GLFW_KEY_C) == GLFW_PRESS);
|
||||
nk_input_key(ctx, NK_KEY_PASTE, glfwGetKey(win, GLFW_KEY_V) == GLFW_PRESS);
|
||||
nk_input_key(ctx, NK_KEY_CUT, glfwGetKey(win, GLFW_KEY_X) == GLFW_PRESS);
|
||||
nk_input_key(ctx, NK_KEY_TEXT_UNDO, glfwGetKey(win, GLFW_KEY_Z) == GLFW_PRESS);
|
||||
nk_input_key(ctx, NK_KEY_TEXT_REDO, glfwGetKey(win, GLFW_KEY_R) == GLFW_PRESS);
|
||||
nk_input_key(ctx, NK_KEY_TEXT_WORD_LEFT, glfwGetKey(win, GLFW_KEY_LEFT) == GLFW_PRESS);
|
||||
nk_input_key(ctx, NK_KEY_TEXT_WORD_RIGHT, glfwGetKey(win, GLFW_KEY_RIGHT) == GLFW_PRESS);
|
||||
nk_input_key(ctx, NK_KEY_TEXT_LINE_START, glfwGetKey(win, GLFW_KEY_B) == GLFW_PRESS);
|
||||
nk_input_key(ctx, NK_KEY_TEXT_LINE_END, glfwGetKey(win, GLFW_KEY_E) == GLFW_PRESS);
|
||||
} else {
|
||||
nk_input_key(ctx, NK_KEY_LEFT, glfwGetKey(win, GLFW_KEY_LEFT) == GLFW_PRESS);
|
||||
nk_input_key(ctx, NK_KEY_RIGHT, glfwGetKey(win, GLFW_KEY_RIGHT) == GLFW_PRESS);
|
||||
nk_input_key(ctx, NK_KEY_COPY, 0);
|
||||
nk_input_key(ctx, NK_KEY_PASTE, 0);
|
||||
nk_input_key(ctx, NK_KEY_CUT, 0);
|
||||
nk_input_key(ctx, NK_KEY_SHIFT, 0);
|
||||
}
|
||||
|
||||
glfwGetCursorPos(win, &x, &y);
|
||||
nk_input_motion(ctx, (int)x, (int)y);
|
||||
if (ctx->input.mouse.grabbed) {
|
||||
glfwSetCursorPos(glfw.win, (double)ctx->input.mouse.prev.x, (double)ctx->input.mouse.prev.y);
|
||||
ctx->input.mouse.pos.x = ctx->input.mouse.prev.x;
|
||||
ctx->input.mouse.pos.y = ctx->input.mouse.prev.y;
|
||||
}
|
||||
|
||||
nk_input_button(ctx, NK_BUTTON_LEFT, (int)x, (int)y, glfwGetMouseButton(win, GLFW_MOUSE_BUTTON_LEFT) == GLFW_PRESS);
|
||||
nk_input_button(ctx, NK_BUTTON_MIDDLE, (int)x, (int)y, glfwGetMouseButton(win, GLFW_MOUSE_BUTTON_MIDDLE) == GLFW_PRESS);
|
||||
nk_input_button(ctx, NK_BUTTON_RIGHT, (int)x, (int)y, glfwGetMouseButton(win, GLFW_MOUSE_BUTTON_RIGHT) == GLFW_PRESS);
|
||||
nk_input_button(ctx, NK_BUTTON_DOUBLE, (int)glfw.double_click_pos.x, (int)glfw.double_click_pos.y, glfw.is_double_click_down);
|
||||
nk_input_scroll(ctx, glfw.scroll);
|
||||
nk_input_end(&glfw.ctx);
|
||||
glfw.text_len = 0;
|
||||
glfw.scroll = nk_vec2(0,0);
|
||||
}
|
||||
|
||||
NK_API
|
||||
void nk_glfw3_shutdown(void)
|
||||
{
|
||||
struct nk_glfw_device *dev = &glfw.ogl;
|
||||
nk_font_atlas_clear(&glfw.atlas);
|
||||
nk_free(&glfw.ctx);
|
||||
glDeleteTextures(1, &dev->font_tex);
|
||||
nk_buffer_free(&dev->cmds);
|
||||
NK_MEMSET(&glfw, 0, sizeof(glfw));
|
||||
}
|
||||
|
||||
#endif
|
1724
deps/stb_image_write.h
vendored
Normal file
1724
deps/stb_image_write.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
9
deps/tinycthread.c
vendored
9
deps/tinycthread.c
vendored
|
@ -21,9 +21,10 @@ freely, subject to the following restrictions:
|
|||
distribution.
|
||||
*/
|
||||
|
||||
/* 2013-01-06 Camilla Berglund <elmindreda@elmindreda.org>
|
||||
*
|
||||
/* 2013-01-06 Camilla Löwy <elmindreda@glfw.org>
|
||||
*
|
||||
* Added casts from time_t to DWORD to avoid warnings on VC++.
|
||||
* Fixed time retrieval on POSIX systems.
|
||||
*/
|
||||
|
||||
#include "tinycthread.h"
|
||||
|
@ -294,7 +295,7 @@ int cnd_timedwait(cnd_t *cond, mtx_t *mtx, const struct timespec *ts)
|
|||
{
|
||||
#if defined(_TTHREAD_WIN32_)
|
||||
struct timespec now;
|
||||
if (clock_gettime(TIME_UTC, &now) == 0)
|
||||
if (clock_gettime(CLOCK_REALTIME, &now) == 0)
|
||||
{
|
||||
DWORD delta = (DWORD) ((ts->tv_sec - now.tv_sec) * 1000 +
|
||||
(ts->tv_nsec - now.tv_nsec + 500000) / 1000000);
|
||||
|
@ -471,7 +472,7 @@ int thrd_sleep(const struct timespec *time_point, struct timespec *remaining)
|
|||
#endif
|
||||
|
||||
/* Get the current time */
|
||||
if (clock_gettime(TIME_UTC, &now) != 0)
|
||||
if (clock_gettime(CLOCK_REALTIME, &now) != 0)
|
||||
return -2; // FIXME: Some specific error code?
|
||||
|
||||
#if defined(_TTHREAD_WIN32_)
|
||||
|
|
4
deps/tinycthread.h
vendored
4
deps/tinycthread.h
vendored
|
@ -78,6 +78,7 @@ freely, subject to the following restrictions:
|
|||
|
||||
/* Platform specific includes */
|
||||
#if defined(_TTHREAD_POSIX_)
|
||||
#include <sys/time.h>
|
||||
#include <pthread.h>
|
||||
#elif defined(_TTHREAD_WIN32_)
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
|
@ -122,6 +123,9 @@ typedef int _tthread_clockid_t;
|
|||
/* Emulate clock_gettime */
|
||||
int _tthread_clock_gettime(clockid_t clk_id, struct timespec *ts);
|
||||
#define clock_gettime _tthread_clock_gettime
|
||||
#ifndef CLOCK_REALTIME
|
||||
#define CLOCK_REALTIME 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
|
247
deps/vs2008/stdint.h
vendored
Normal file
247
deps/vs2008/stdint.h
vendored
Normal file
|
@ -0,0 +1,247 @@
|
|||
// ISO C9x compliant stdint.h for Microsoft Visual Studio
|
||||
// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
|
||||
//
|
||||
// Copyright (c) 2006-2008 Alexander Chemeris
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// 3. The name of the author may be used to endorse or promote products
|
||||
// derived from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _MSC_VER // [
|
||||
#error "Use this header only with Microsoft Visual C++ compilers!"
|
||||
#endif // _MSC_VER ]
|
||||
|
||||
#ifndef _MSC_STDINT_H_ // [
|
||||
#define _MSC_STDINT_H_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
// For Visual Studio 6 in C++ mode and for many Visual Studio versions when
|
||||
// compiling for ARM we should wrap <wchar.h> include with 'extern "C++" {}'
|
||||
// or compiler give many errors like this:
|
||||
// error C2733: second C linkage of overloaded function 'wmemchr' not allowed
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
# include <wchar.h>
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
// Define _W64 macros to mark types changing their size, like intptr_t.
|
||||
#ifndef _W64
|
||||
# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300
|
||||
# define _W64 __w64
|
||||
# else
|
||||
# define _W64
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
// 7.18.1 Integer types
|
||||
|
||||
// 7.18.1.1 Exact-width integer types
|
||||
|
||||
// Visual Studio 6 and Embedded Visual C++ 4 doesn't
|
||||
// realize that, e.g. char has the same size as __int8
|
||||
// so we give up on __intX for them.
|
||||
#if (_MSC_VER < 1300)
|
||||
typedef signed char int8_t;
|
||||
typedef signed short int16_t;
|
||||
typedef signed int int32_t;
|
||||
typedef unsigned char uint8_t;
|
||||
typedef unsigned short uint16_t;
|
||||
typedef unsigned int uint32_t;
|
||||
#else
|
||||
typedef signed __int8 int8_t;
|
||||
typedef signed __int16 int16_t;
|
||||
typedef signed __int32 int32_t;
|
||||
typedef unsigned __int8 uint8_t;
|
||||
typedef unsigned __int16 uint16_t;
|
||||
typedef unsigned __int32 uint32_t;
|
||||
#endif
|
||||
typedef signed __int64 int64_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
|
||||
|
||||
// 7.18.1.2 Minimum-width integer types
|
||||
typedef int8_t int_least8_t;
|
||||
typedef int16_t int_least16_t;
|
||||
typedef int32_t int_least32_t;
|
||||
typedef int64_t int_least64_t;
|
||||
typedef uint8_t uint_least8_t;
|
||||
typedef uint16_t uint_least16_t;
|
||||
typedef uint32_t uint_least32_t;
|
||||
typedef uint64_t uint_least64_t;
|
||||
|
||||
// 7.18.1.3 Fastest minimum-width integer types
|
||||
typedef int8_t int_fast8_t;
|
||||
typedef int16_t int_fast16_t;
|
||||
typedef int32_t int_fast32_t;
|
||||
typedef int64_t int_fast64_t;
|
||||
typedef uint8_t uint_fast8_t;
|
||||
typedef uint16_t uint_fast16_t;
|
||||
typedef uint32_t uint_fast32_t;
|
||||
typedef uint64_t uint_fast64_t;
|
||||
|
||||
// 7.18.1.4 Integer types capable of holding object pointers
|
||||
#ifdef _WIN64 // [
|
||||
typedef signed __int64 intptr_t;
|
||||
typedef unsigned __int64 uintptr_t;
|
||||
#else // _WIN64 ][
|
||||
typedef _W64 signed int intptr_t;
|
||||
typedef _W64 unsigned int uintptr_t;
|
||||
#endif // _WIN64 ]
|
||||
|
||||
// 7.18.1.5 Greatest-width integer types
|
||||
typedef int64_t intmax_t;
|
||||
typedef uint64_t uintmax_t;
|
||||
|
||||
|
||||
// 7.18.2 Limits of specified-width integer types
|
||||
|
||||
#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259
|
||||
|
||||
// 7.18.2.1 Limits of exact-width integer types
|
||||
#define INT8_MIN ((int8_t)_I8_MIN)
|
||||
#define INT8_MAX _I8_MAX
|
||||
#define INT16_MIN ((int16_t)_I16_MIN)
|
||||
#define INT16_MAX _I16_MAX
|
||||
#define INT32_MIN ((int32_t)_I32_MIN)
|
||||
#define INT32_MAX _I32_MAX
|
||||
#define INT64_MIN ((int64_t)_I64_MIN)
|
||||
#define INT64_MAX _I64_MAX
|
||||
#define UINT8_MAX _UI8_MAX
|
||||
#define UINT16_MAX _UI16_MAX
|
||||
#define UINT32_MAX _UI32_MAX
|
||||
#define UINT64_MAX _UI64_MAX
|
||||
|
||||
// 7.18.2.2 Limits of minimum-width integer types
|
||||
#define INT_LEAST8_MIN INT8_MIN
|
||||
#define INT_LEAST8_MAX INT8_MAX
|
||||
#define INT_LEAST16_MIN INT16_MIN
|
||||
#define INT_LEAST16_MAX INT16_MAX
|
||||
#define INT_LEAST32_MIN INT32_MIN
|
||||
#define INT_LEAST32_MAX INT32_MAX
|
||||
#define INT_LEAST64_MIN INT64_MIN
|
||||
#define INT_LEAST64_MAX INT64_MAX
|
||||
#define UINT_LEAST8_MAX UINT8_MAX
|
||||
#define UINT_LEAST16_MAX UINT16_MAX
|
||||
#define UINT_LEAST32_MAX UINT32_MAX
|
||||
#define UINT_LEAST64_MAX UINT64_MAX
|
||||
|
||||
// 7.18.2.3 Limits of fastest minimum-width integer types
|
||||
#define INT_FAST8_MIN INT8_MIN
|
||||
#define INT_FAST8_MAX INT8_MAX
|
||||
#define INT_FAST16_MIN INT16_MIN
|
||||
#define INT_FAST16_MAX INT16_MAX
|
||||
#define INT_FAST32_MIN INT32_MIN
|
||||
#define INT_FAST32_MAX INT32_MAX
|
||||
#define INT_FAST64_MIN INT64_MIN
|
||||
#define INT_FAST64_MAX INT64_MAX
|
||||
#define UINT_FAST8_MAX UINT8_MAX
|
||||
#define UINT_FAST16_MAX UINT16_MAX
|
||||
#define UINT_FAST32_MAX UINT32_MAX
|
||||
#define UINT_FAST64_MAX UINT64_MAX
|
||||
|
||||
// 7.18.2.4 Limits of integer types capable of holding object pointers
|
||||
#ifdef _WIN64 // [
|
||||
# define INTPTR_MIN INT64_MIN
|
||||
# define INTPTR_MAX INT64_MAX
|
||||
# define UINTPTR_MAX UINT64_MAX
|
||||
#else // _WIN64 ][
|
||||
# define INTPTR_MIN INT32_MIN
|
||||
# define INTPTR_MAX INT32_MAX
|
||||
# define UINTPTR_MAX UINT32_MAX
|
||||
#endif // _WIN64 ]
|
||||
|
||||
// 7.18.2.5 Limits of greatest-width integer types
|
||||
#define INTMAX_MIN INT64_MIN
|
||||
#define INTMAX_MAX INT64_MAX
|
||||
#define UINTMAX_MAX UINT64_MAX
|
||||
|
||||
// 7.18.3 Limits of other integer types
|
||||
|
||||
#ifdef _WIN64 // [
|
||||
# define PTRDIFF_MIN _I64_MIN
|
||||
# define PTRDIFF_MAX _I64_MAX
|
||||
#else // _WIN64 ][
|
||||
# define PTRDIFF_MIN _I32_MIN
|
||||
# define PTRDIFF_MAX _I32_MAX
|
||||
#endif // _WIN64 ]
|
||||
|
||||
#define SIG_ATOMIC_MIN INT_MIN
|
||||
#define SIG_ATOMIC_MAX INT_MAX
|
||||
|
||||
#ifndef SIZE_MAX // [
|
||||
# ifdef _WIN64 // [
|
||||
# define SIZE_MAX _UI64_MAX
|
||||
# else // _WIN64 ][
|
||||
# define SIZE_MAX _UI32_MAX
|
||||
# endif // _WIN64 ]
|
||||
#endif // SIZE_MAX ]
|
||||
|
||||
// WCHAR_MIN and WCHAR_MAX are also defined in <wchar.h>
|
||||
#ifndef WCHAR_MIN // [
|
||||
# define WCHAR_MIN 0
|
||||
#endif // WCHAR_MIN ]
|
||||
#ifndef WCHAR_MAX // [
|
||||
# define WCHAR_MAX _UI16_MAX
|
||||
#endif // WCHAR_MAX ]
|
||||
|
||||
#define WINT_MIN 0
|
||||
#define WINT_MAX _UI16_MAX
|
||||
|
||||
#endif // __STDC_LIMIT_MACROS ]
|
||||
|
||||
|
||||
// 7.18.4 Limits of other integer types
|
||||
|
||||
#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260
|
||||
|
||||
// 7.18.4.1 Macros for minimum-width integer constants
|
||||
|
||||
#define INT8_C(val) val##i8
|
||||
#define INT16_C(val) val##i16
|
||||
#define INT32_C(val) val##i32
|
||||
#define INT64_C(val) val##i64
|
||||
|
||||
#define UINT8_C(val) val##ui8
|
||||
#define UINT16_C(val) val##ui16
|
||||
#define UINT32_C(val) val##ui32
|
||||
#define UINT64_C(val) val##ui64
|
||||
|
||||
// 7.18.4.2 Macros for greatest-width integer constants
|
||||
#define INTMAX_C INT64_C
|
||||
#define UINTMAX_C UINT64_C
|
||||
|
||||
#endif // __STDC_CONSTANT_MACROS ]
|
||||
|
||||
|
||||
#endif // _MSC_STDINT_H_ ]
|
|
@ -1,5 +1,46 @@
|
|||
|
||||
add_custom_target(docs ALL ${DOXYGEN_EXECUTABLE}
|
||||
WORKING_DIRECTORY ${GLFW_BINARY_DIR}/docs
|
||||
COMMENT "Generating HTML documentation" VERBATIM)
|
||||
|
||||
|
||||
# NOTE: The order of this list determines the order of items in the Guides
|
||||
# (i.e. Pages) list in the generated documentation
|
||||
set(source_files
|
||||
main.dox
|
||||
news.dox
|
||||
quick.dox
|
||||
moving.dox
|
||||
compile.dox
|
||||
build.dox
|
||||
intro.dox
|
||||
context.dox
|
||||
monitor.dox
|
||||
window.dox
|
||||
input.dox
|
||||
vulkan.dox
|
||||
compat.dox
|
||||
internal.dox)
|
||||
|
||||
set(extra_files DoxygenLayout.xml header.html footer.html extra.css spaces.svg)
|
||||
|
||||
set(header_paths
|
||||
"${GLFW_SOURCE_DIR}/include/GLFW/glfw3.h"
|
||||
"${GLFW_SOURCE_DIR}/include/GLFW/glfw3native.h")
|
||||
|
||||
# Format the source list into a Doxyfile INPUT value that Doxygen can parse
|
||||
foreach(path IN LISTS header_paths)
|
||||
string(APPEND GLFW_DOXYGEN_INPUT " \\\n\"${path}\"")
|
||||
endforeach()
|
||||
foreach(file IN LISTS source_files)
|
||||
string(APPEND GLFW_DOXYGEN_INPUT " \\\n\"${CMAKE_CURRENT_SOURCE_DIR}/${file}\"")
|
||||
endforeach()
|
||||
|
||||
configure_file(Doxyfile.in Doxyfile @ONLY)
|
||||
|
||||
add_custom_command(OUTPUT "html/index.html"
|
||||
COMMAND "${DOXYGEN_EXECUTABLE}"
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
|
||||
MAIN_DEPENDENCY Doxyfile
|
||||
DEPENDS ${header_paths} ${source_files} ${extra_files}
|
||||
COMMENT "Generating HTML documentation"
|
||||
VERBATIM)
|
||||
|
||||
add_custom_target(docs ALL SOURCES "html/index.html")
|
||||
set_target_properties(docs PROPERTIES FOLDER "GLFW3")
|
||||
|
||||
|
|
391
docs/CONTRIBUTING.md
Normal file
391
docs/CONTRIBUTING.md
Normal file
|
@ -0,0 +1,391 @@
|
|||
# Contribution Guide
|
||||
|
||||
## Contents
|
||||
|
||||
- [Asking a question](#asking-a-question)
|
||||
- [Reporting a bug](#reporting-a-bug)
|
||||
- [Reporting a compile or link bug](#reporting-a-compile-or-link-bug)
|
||||
- [Reporting a segfault or other crash bug](#reporting-a-segfault-or-other-crash-bug)
|
||||
- [Reporting a context creation bug](#reporting-a-context-creation-bug)
|
||||
- [Reporting a monitor or video mode bug](#reporting-a-monitor-or-video-mode-bug)
|
||||
- [Reporting a window, input or event bug](#reporting-a-window-input-or-event-bug)
|
||||
- [Reporting some other library bug](#reporting-some-other-library-bug)
|
||||
- [Reporting a documentation bug](#reporting-a-documentation-bug)
|
||||
- [Reporting a website bug](#reporting-a-website-bug)
|
||||
- [Requesting a feature](#requesting-a-feature)
|
||||
- [Contributing a bug fix](#contributing-a-bug-fix)
|
||||
- [Contributing a feature](#contributing-a-feature)
|
||||
|
||||
|
||||
## Asking a question
|
||||
|
||||
Questions about how to use GLFW should be asked either in the [support
|
||||
section](https://discourse.glfw.org/c/support) of the forum, under the [Stack
|
||||
Overflow tag](https://stackoverflow.com/questions/tagged/glfw) or [Game
|
||||
Development tag](https://gamedev.stackexchange.com/questions/tagged/glfw) on
|
||||
Stack Exchange or in the IRC channel `#glfw` on
|
||||
[Libera.Chat](https://libera.chat/).
|
||||
|
||||
Questions about the design or implementation of GLFW or about future plans
|
||||
should be asked in the [dev section](https://discourse.glfw.org/c/dev) of the
|
||||
forum or in the IRC channel. Please don't open a GitHub issue to discuss design
|
||||
questions without first checking with a maintainer.
|
||||
|
||||
|
||||
## Reporting a bug
|
||||
|
||||
If GLFW is behaving unexpectedly at run-time, start by setting an [error
|
||||
callback](https://www.glfw.org/docs/latest/intro_guide.html#error_handling).
|
||||
GLFW will often tell you the cause of an error via this callback. If it
|
||||
doesn't, that might be a separate bug.
|
||||
|
||||
If GLFW is crashing or triggering asserts, make sure that all your object
|
||||
handles and other pointers are valid.
|
||||
|
||||
For bugs where it makes sense, a short, self contained example is absolutely
|
||||
invaluable. Just put it inline in the body text. Note that if the bug is
|
||||
reproducible with one of the test programs that come with GLFW, just mention
|
||||
that instead.
|
||||
|
||||
__Don't worry about adding too much information__. Unimportant information can
|
||||
be abbreviated or removed later, but missing information can stall bug fixing,
|
||||
especially when your schedule doesn't align with that of the maintainer.
|
||||
|
||||
__Please provide text as text, not as images__. This includes code, error
|
||||
messages and any other text. Text in images cannot be found by other users
|
||||
searching for the same problem and may have to be re-typed by maintainers when
|
||||
debugging.
|
||||
|
||||
You don't need to manually indent your code or other text to quote it with
|
||||
GitHub Markdown; just surround it with triple backticks:
|
||||
|
||||
```
|
||||
Some quoted text.
|
||||
```
|
||||
|
||||
You can also add syntax highlighting by appending the common file extension:
|
||||
|
||||
```c
|
||||
int five(void)
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
```
|
||||
|
||||
There are issue labels for both platforms and GPU manufacturers, so there is no
|
||||
need to mention these in the subject line. If you do, it will be removed when
|
||||
the issue is labeled.
|
||||
|
||||
If your bug is already reported, please add any new information you have, or if
|
||||
it already has everything, give it a :+1:.
|
||||
|
||||
|
||||
### Reporting a compile or link bug
|
||||
|
||||
__Note:__ GLFW needs many system APIs to do its job, which on some platforms
|
||||
means linking to many system libraries. If you are using GLFW as a static
|
||||
library, that means your application needs to link to these in addition to GLFW.
|
||||
|
||||
__Note:__ Check the [Compiling
|
||||
GLFW](https://www.glfw.org/docs/latest/compile.html) guide and or [Building
|
||||
applications](https://www.glfw.org/docs/latest/build.html) guide for before
|
||||
opening an issue of this kind. Most issues are caused by a missing package or
|
||||
linker flag.
|
||||
|
||||
Always include the __operating system name and version__ (e.g. `Windows
|
||||
7 64-bit` or `Ubuntu 15.10`) and the __compiler name and version__ (e.g. `Visual
|
||||
C++ 2015 Update 2`). If you are using an official release of GLFW,
|
||||
include the __GLFW release version__ (e.g. `3.1.2`), otherwise include the
|
||||
__GLFW commit ID__ (e.g. `3795d78b14ef06008889cc422a1fb8d642597751`) from Git.
|
||||
|
||||
Please also include the __complete build log__ from your compiler and linker,
|
||||
even if it's long. It can always be shortened later, if necessary.
|
||||
|
||||
|
||||
#### Quick template
|
||||
|
||||
```
|
||||
OS and version:
|
||||
Compiler version:
|
||||
Release or commit:
|
||||
Build log:
|
||||
```
|
||||
|
||||
|
||||
### Reporting a segfault or other crash bug
|
||||
|
||||
Always include the __operating system name and version__ (e.g. `Windows
|
||||
7 64-bit` or `Ubuntu 15.10`). If you are using an official release of GLFW,
|
||||
include the __GLFW release version__ (e.g. `3.1.2`), otherwise include the
|
||||
__GLFW commit ID__ (e.g. `3795d78b14ef06008889cc422a1fb8d642597751`) from Git.
|
||||
|
||||
Please also include any __error messages__ provided to your application via the
|
||||
[error
|
||||
callback](https://www.glfw.org/docs/latest/intro_guide.html#error_handling) and
|
||||
the __full call stack__ of the crash, or if the crash does not occur in debug
|
||||
mode, mention that instead.
|
||||
|
||||
|
||||
#### Quick template
|
||||
|
||||
```
|
||||
OS and version:
|
||||
Release or commit:
|
||||
Error messages:
|
||||
Call stack:
|
||||
```
|
||||
|
||||
|
||||
### Reporting a context creation bug
|
||||
|
||||
__Note:__ Windows ships with graphics drivers that do not support OpenGL. If
|
||||
GLFW says that your machine lacks support for OpenGL, it very likely does.
|
||||
Install drivers from the computer manufacturer or graphics card manufacturer
|
||||
([Nvidia](https://www.geforce.com/drivers),
|
||||
[AMD](https://www.amd.com/en/support),
|
||||
[Intel](https://www-ssl.intel.com/content/www/us/en/support/detect.html)) to
|
||||
fix this.
|
||||
|
||||
__Note:__ AMD only supports OpenGL ES on Windows via EGL. See the
|
||||
[GLFW\_CONTEXT\_CREATION\_API](https://www.glfw.org/docs/latest/window_guide.html#window_hints_ctx)
|
||||
hint for how to select EGL.
|
||||
|
||||
Please verify that context creation also fails with the `glfwinfo` tool before
|
||||
reporting it as a bug. This tool is included in the GLFW source tree as
|
||||
`tests/glfwinfo.c` and is built along with the library. It has switches for all
|
||||
GLFW context and framebuffer hints. Run `glfwinfo -h` for a complete list.
|
||||
|
||||
Always include the __operating system name and version__ (e.g. `Windows
|
||||
7 64-bit` or `Ubuntu 15.10`). If you are using an official release of GLFW,
|
||||
include the __GLFW release version__ (e.g. `3.1.2`), otherwise include the
|
||||
__GLFW commit ID__ (e.g. `3795d78b14ef06008889cc422a1fb8d642597751`) from Git.
|
||||
|
||||
If you are running your program in a virtual machine, please mention this and
|
||||
include the __VM name and version__ (e.g. `VirtualBox 5.1`).
|
||||
|
||||
Please also include the __GLFW version string__ (`3.2.0 X11 EGL clock_gettime
|
||||
/dev/js`), as described
|
||||
[here](https://www.glfw.org/docs/latest/intro.html#intro_version_string), the
|
||||
__GPU model and driver version__ (e.g. `GeForce GTX660 with 352.79`), and the
|
||||
__output of `glfwinfo`__ (with switches matching any hints you set in your
|
||||
code) when reporting this kind of bug. If this tool doesn't run on the machine,
|
||||
mention that instead.
|
||||
|
||||
|
||||
#### Quick template
|
||||
|
||||
```
|
||||
OS and version:
|
||||
GPU and driver:
|
||||
Release or commit:
|
||||
Version string:
|
||||
glfwinfo output:
|
||||
```
|
||||
|
||||
|
||||
### Reporting a monitor or video mode bug
|
||||
|
||||
__Note:__ On headless systems on some platforms, no monitors are reported. This
|
||||
causes glfwGetPrimaryMonitor to return `NULL`, which not all applications are
|
||||
prepared for.
|
||||
|
||||
__Note:__ Some third-party tools report more video modes than are approved of
|
||||
by the OS. For safety and compatibility, GLFW only reports video modes the OS
|
||||
wants programs to use. This is not a bug.
|
||||
|
||||
The `monitors` tool is included in the GLFW source tree as `tests/monitors.c`
|
||||
and is built along with the library. It lists all information GLFW provides
|
||||
about monitors it detects.
|
||||
|
||||
Always include the __operating system name and version__ (e.g. `Windows
|
||||
7 64-bit` or `Ubuntu 15.10`). If you are using an official release of GLFW,
|
||||
include the __GLFW release version__ (e.g. `3.1.2`), otherwise include the
|
||||
__GLFW commit ID__ (e.g. `3795d78b14ef06008889cc422a1fb8d642597751`) from Git.
|
||||
|
||||
If you are running your program in a virtual machine, please mention this and
|
||||
include the __VM name and version__ (e.g. `VirtualBox 5.1`).
|
||||
|
||||
Please also include any __error messages__ provided to your application via the
|
||||
[error
|
||||
callback](https://www.glfw.org/docs/latest/intro_guide.html#error_handling) and
|
||||
the __output of `monitors`__ when reporting this kind of bug. If this tool
|
||||
doesn't run on the machine, mention this instead.
|
||||
|
||||
|
||||
#### Quick template
|
||||
|
||||
```
|
||||
OS and version:
|
||||
Release or commit:
|
||||
Error messages:
|
||||
monitors output:
|
||||
```
|
||||
|
||||
|
||||
### Reporting a window, input or event bug
|
||||
|
||||
__Note:__ The exact ordering of related window events will sometimes differ.
|
||||
|
||||
__Note:__ Window moving and resizing (by the user) will block the main thread on
|
||||
some platforms. This is not a bug. Set a [refresh
|
||||
callback](https://www.glfw.org/docs/latest/window.html#window_refresh) if you
|
||||
want to keep the window contents updated during a move or size operation.
|
||||
|
||||
The `events` tool is included in the GLFW source tree as `tests/events.c` and is
|
||||
built along with the library. It prints all information provided to every
|
||||
callback supported by GLFW as events occur. Each event is listed with the time
|
||||
and a unique number to make discussions about event logs easier. The tool has
|
||||
command-line options for creating multiple windows and full screen windows.
|
||||
|
||||
Always include the __operating system name and version__ (e.g. `Windows
|
||||
7 64-bit` or `Ubuntu 15.10`). If you are using an official release of GLFW,
|
||||
include the __GLFW release version__ (e.g. `3.1.2`), otherwise include the
|
||||
__GLFW commit ID__ (e.g. `3795d78b14ef06008889cc422a1fb8d642597751`) from Git.
|
||||
|
||||
If you are running your program in a virtual machine, please mention this and
|
||||
include the __VM name and version__ (e.g. `VirtualBox 5.1`).
|
||||
|
||||
Please also include any __error messages__ provided to your application via the
|
||||
[error
|
||||
callback](https://www.glfw.org/docs/latest/intro_guide.html#error_handling) and
|
||||
if relevant, the __output of `events`__ when reporting this kind of bug. If
|
||||
this tool doesn't run on the machine, mention this instead.
|
||||
|
||||
__X11:__ If possible, please include what desktop environment (e.g. GNOME,
|
||||
Unity, KDE) and/or window manager (e.g. Openbox, dwm, Window Maker) you are
|
||||
running. If the bug is related to keyboard input, please include any input
|
||||
method (e.g. ibus, SCIM) you are using.
|
||||
|
||||
|
||||
#### Quick template
|
||||
|
||||
```
|
||||
OS and version:
|
||||
Release or commit:
|
||||
Error messages:
|
||||
events output:
|
||||
```
|
||||
|
||||
|
||||
### Reporting some other library bug
|
||||
|
||||
Always include the __operating system name and version__ (e.g. `Windows
|
||||
7 64-bit` or `Ubuntu 15.10`). If you are using an official release of GLFW,
|
||||
include the __GLFW release version__ (e.g. `3.1.2`), otherwise include the
|
||||
__GLFW commit ID__ (e.g. `3795d78b14ef06008889cc422a1fb8d642597751`) from Git.
|
||||
|
||||
Please also include any __error messages__ provided to your application via the
|
||||
[error
|
||||
callback](https://www.glfw.org/docs/latest/intro_guide.html#error_handling), if
|
||||
relevant.
|
||||
|
||||
|
||||
#### Quick template
|
||||
|
||||
```
|
||||
OS and version:
|
||||
Release or commit:
|
||||
Error messages:
|
||||
```
|
||||
|
||||
|
||||
### Reporting a documentation bug
|
||||
|
||||
If you found a bug in the documentation, including this file, then it's fine to
|
||||
just link to that web page or mention that source file. You don't need to match
|
||||
the source to the output or vice versa.
|
||||
|
||||
|
||||
### Reporting a website bug
|
||||
|
||||
If the bug is in the documentation (anything under `/docs/`) then please see the
|
||||
section above. Bugs in the rest of the site are reported to the [website
|
||||
source repository](https://github.com/glfw/website/issues).
|
||||
|
||||
|
||||
## Requesting a feature
|
||||
|
||||
Please explain why you need the feature and how you intend to use it. If you
|
||||
have a specific API design in mind, please add that as well. If you have or are
|
||||
planning to write code for the feature, see the section below.
|
||||
|
||||
If there already is a request for the feature you need, add your specific use
|
||||
case unless it is already mentioned. If it is, give it a :+1:.
|
||||
|
||||
|
||||
## Contributing a bug fix
|
||||
|
||||
__Note:__ You must have all necessary [intellectual
|
||||
property rights](https://en.wikipedia.org/wiki/Intellectual_property) to any
|
||||
code you contribute. If you did not write the code yourself, you must explain
|
||||
where it came from and under what license you received it. Even code using the
|
||||
same license as GLFW may not be copied without attribution.
|
||||
|
||||
__There is no preferred patch size__. A one character fix is just as welcome as
|
||||
a thousand line one, if that is the appropriate size for the fix.
|
||||
|
||||
In addition to the code, a complete bug fix includes:
|
||||
|
||||
- Change log entry in `README.md`, describing the incorrect behavior
|
||||
- Credits entries for all authors of the bug fix
|
||||
|
||||
Bug fixes will not be rejected because they don't include all the above parts,
|
||||
but please keep in mind that maintainer time is finite and that there are many
|
||||
other bugs and features to work on.
|
||||
|
||||
If the patch fixes a bug introduced after the last release, it should not get
|
||||
a change log entry.
|
||||
|
||||
If you haven't already, read the excellent article [How to Write a Git Commit
|
||||
Message](https://chris.beams.io/posts/git-commit/).
|
||||
|
||||
|
||||
## Contributing a feature
|
||||
|
||||
__Note:__ You must have all necessary rights to any code you contribute. If you
|
||||
did not write the code yourself, you must explain where it came from and under
|
||||
what license. Even code using the same license as GLFW may not be copied
|
||||
without attribution.
|
||||
|
||||
__Note:__ If you haven't already implemented the feature, check first if there
|
||||
already is an open issue for it and if it's already being developed in an
|
||||
[experimental branch](https://github.com/glfw/glfw/branches/all).
|
||||
|
||||
__There is no preferred patch size__. A one-character change is just as welcome
|
||||
as one adding a thousand lines, if that is the appropriate size for the
|
||||
feature.
|
||||
|
||||
In addition to the code, a complete feature includes:
|
||||
|
||||
- Change log entry in `README.md`, listing all new symbols
|
||||
- News page entry, briefly describing the feature
|
||||
- Guide documentation, with minimal examples, in the relevant guide
|
||||
- Reference documentation, with all applicable tags
|
||||
- Cross-references and mentions in appropriate places
|
||||
- Credits entries for all authors of the feature
|
||||
|
||||
If the feature requires platform-specific code, at minimum stubs must be added
|
||||
for the new platform function to all supported and experimental platforms.
|
||||
|
||||
If it adds a new callback, support for it must be added to `tests/event.c`.
|
||||
|
||||
If it adds a new monitor property, support for it must be added to
|
||||
`tests/monitor.c`.
|
||||
|
||||
If it adds a new OpenGL, OpenGL ES or Vulkan option or extension, support
|
||||
for it must be added to `tests/glfwinfo.c` and the behavior of the library when
|
||||
the extension is missing documented in `docs/compat.dox`.
|
||||
|
||||
If you haven't already, read the excellent article [How to Write a Git Commit
|
||||
Message](https://chris.beams.io/posts/git-commit/).
|
||||
|
||||
Features will not be rejected because they don't include all the above parts,
|
||||
but please keep in mind that maintainer time is finite and that there are many
|
||||
other features and bugs to work on.
|
||||
|
||||
Please also keep in mind that any part of the public API that has been included
|
||||
in a release cannot be changed until the next _major_ version. Features can be
|
||||
added and existing parts can sometimes be overloaded (in the general sense of
|
||||
doing more things, not in the C++ sense), but code written to the API of one
|
||||
minor release should both compile and run on subsequent minor releases.
|
||||
|
2832
docs/Doxyfile.in
2832
docs/Doxyfile.in
File diff suppressed because it is too large
Load Diff
71
docs/DoxygenLayout.xml
Normal file
71
docs/DoxygenLayout.xml
Normal file
|
@ -0,0 +1,71 @@
|
|||
<doxygenlayout version="1.0">
|
||||
<!-- Generated by doxygen 1.8.14 -->
|
||||
<!-- Navigation index tabs for HTML output -->
|
||||
<navindex>
|
||||
<tab type="mainpage" visible="yes" title="Introduction"/>
|
||||
<tab type="user" url="quick_guide.html" title="Tutorial"/>
|
||||
<tab type="pages" visible="yes" title="Guides" intro=""/>
|
||||
<tab type="modules" visible="yes" title="Reference" intro=""/>
|
||||
<tab type="filelist" visible="yes" title="Files"/>
|
||||
</navindex>
|
||||
|
||||
<!-- Layout definition for a file page -->
|
||||
<file>
|
||||
<detaileddescription title="Description"/>
|
||||
<includes visible="$SHOW_INCLUDE_FILES"/>
|
||||
<sourcelink visible="yes"/>
|
||||
<memberdecl>
|
||||
<constantgroups visible="yes" title=""/>
|
||||
<defines title=""/>
|
||||
<typedefs title=""/>
|
||||
<enums title=""/>
|
||||
<functions title=""/>
|
||||
<variables title=""/>
|
||||
<membergroups visible="yes"/>
|
||||
</memberdecl>
|
||||
<memberdef>
|
||||
<defines title=""/>
|
||||
<typedefs title=""/>
|
||||
<enums title=""/>
|
||||
<functions title=""/>
|
||||
<variables title=""/>
|
||||
</memberdef>
|
||||
<authorsection/>
|
||||
</file>
|
||||
|
||||
<!-- Layout definition for a group page -->
|
||||
<group>
|
||||
<detaileddescription title="Description"/>
|
||||
<memberdecl>
|
||||
<nestedgroups visible="yes" title=""/>
|
||||
<dirs visible="yes" title=""/>
|
||||
<files visible="yes" title=""/>
|
||||
<defines title=""/>
|
||||
<typedefs title=""/>
|
||||
<enums title=""/>
|
||||
<enumvalues title=""/>
|
||||
<functions title=""/>
|
||||
<variables title=""/>
|
||||
</memberdecl>
|
||||
<memberdef>
|
||||
<pagedocs/>
|
||||
<defines title=""/>
|
||||
<typedefs title=""/>
|
||||
<enums title=""/>
|
||||
<enumvalues title=""/>
|
||||
<functions title=""/>
|
||||
<variables title=""/>
|
||||
</memberdef>
|
||||
<authorsection visible="yes"/>
|
||||
</group>
|
||||
|
||||
<!-- Layout definition for a directory page -->
|
||||
<directory>
|
||||
<briefdescription visible="yes"/>
|
||||
<memberdecl>
|
||||
<dirs visible="yes"/>
|
||||
<files visible="yes"/>
|
||||
</memberdecl>
|
||||
<detaileddescription title=""/>
|
||||
</directory>
|
||||
</doxygenlayout>
|
14
docs/SUPPORT.md
Normal file
14
docs/SUPPORT.md
Normal file
|
@ -0,0 +1,14 @@
|
|||
# Support resources
|
||||
|
||||
See the [latest documentation](https://www.glfw.org/docs/latest/) for tutorials,
|
||||
guides and the API reference.
|
||||
|
||||
If you have questions about using GLFW, we have a
|
||||
[forum](https://discourse.glfw.org/), and the `#glfw` IRC channel on
|
||||
[Libera.Chat](https://libera.chat/).
|
||||
|
||||
Bugs are reported to our [issue tracker](https://github.com/glfw/glfw/issues).
|
||||
Please check the [contribution
|
||||
guide](https://github.com/glfw/glfw/blob/master/docs/CONTRIBUTING.md) for
|
||||
information on what to include when reporting a bug.
|
||||
|
363
docs/build.dox
363
docs/build.dox
|
@ -1,161 +1,338 @@
|
|||
/*!
|
||||
|
||||
@page build Building programs using GLFW
|
||||
@page build_guide Building applications
|
||||
|
||||
@tableofcontents
|
||||
|
||||
This is about compiling and linking programs that use GLFW. For information on
|
||||
how to *write* such programs, start with the [introductory tutorial](@ref quick).
|
||||
This is about compiling and linking applications that use GLFW. For information on
|
||||
how to write such applications, start with the
|
||||
[introductory tutorial](@ref quick_guide). For information on how to compile
|
||||
the GLFW library itself, see @ref compile_guide.
|
||||
|
||||
This is not a tutorial on compilation or linking. It assumes basic
|
||||
understanding of how to compile and link a C program as well as how to use the
|
||||
specific compiler of your chosen development environment. The compilation
|
||||
and linking process should be explained in your C programming material and in
|
||||
the documentation for your development environment.
|
||||
|
||||
|
||||
@section build_include Including the GLFW header file
|
||||
|
||||
In the files of your program where you use OpenGL or GLFW, you should include
|
||||
the GLFW 3 header file, i.e.:
|
||||
You should include the GLFW header in the source files where you use OpenGL or
|
||||
GLFW.
|
||||
|
||||
@code
|
||||
#include <GLFW/glfw3.h>
|
||||
@endcode
|
||||
|
||||
This defines all the constants, types and function prototypes of the GLFW API.
|
||||
It also includes the chosen client API header files (by default OpenGL), and
|
||||
defines all the constants and types necessary for those headers to work on that
|
||||
platform.
|
||||
This header defines all the constants and declares all the types and function
|
||||
prototypes of the GLFW API. By default, it also includes the OpenGL header from
|
||||
your development environment. See [option macros](@ref build_macros) below for
|
||||
how to select OpenGL ES headers and more.
|
||||
|
||||
For example, under Windows you are normally required to include `windows.h`
|
||||
before including `GL/gl.h`. This would make your source file tied to Windows
|
||||
and pollute your code's namespace with the whole Win32 API.
|
||||
The GLFW header also defines any platform-specific macros needed by your OpenGL
|
||||
header, so that it can be included without needing any window system headers.
|
||||
|
||||
Instead, the GLFW header takes care of this for you, not by including
|
||||
`windows.h`, but rather by itself duplicating only the necessary parts of it.
|
||||
It does this only where needed, so if `windows.h` *is* included, the GLFW header
|
||||
does not try to redefine those symbols.
|
||||
It does this only when needed, so if window system headers are included, the
|
||||
GLFW header does not try to redefine those symbols. The reverse is not true,
|
||||
i.e. `windows.h` cannot cope if any Win32 symbols have already been defined.
|
||||
|
||||
In other words:
|
||||
|
||||
- Do *not* include the OpenGL headers yourself, as GLFW does this for you
|
||||
- Do *not* include `windows.h` or other platform-specific headers unless you
|
||||
plan on using those APIs directly
|
||||
- If you *do* need to include such headers, do it *before* including
|
||||
the GLFW one and it will detect this
|
||||
- Use the GLFW header to include OpenGL or OpenGL ES headers portably
|
||||
- Do not include window system headers unless you will use those APIs directly
|
||||
- If you do need such headers, include them before the GLFW header
|
||||
|
||||
If you are using an OpenGL extension loading library such as
|
||||
[GLEW](http://glew.sourceforge.net/), the GLEW header should also be included
|
||||
*before* the GLFW one. The GLEW header defines macros that disable any OpenGL
|
||||
header that the GLFW header includes and GLEW will work as expected.
|
||||
[glad](https://github.com/Dav1dde/glad), the extension loader header should
|
||||
be included before the GLFW one. GLFW attempts to detect any OpenGL or OpenGL
|
||||
ES header or extension loader header included before it and will then disable
|
||||
the inclusion of the default OpenGL header. Most extension loaders also define
|
||||
macros that disable similar headers below it.
|
||||
|
||||
@code
|
||||
#include <glad/gl.h>
|
||||
#include <GLFW/glfw3.h>
|
||||
@endcode
|
||||
|
||||
Both of these mechanisms depend on the extension loader header defining a known
|
||||
macro. If yours doesn't or you don't know which one your users will pick, the
|
||||
@ref GLFW_INCLUDE_NONE macro will explicitly prevent the GLFW header from
|
||||
including the OpenGL header. This will also allow you to include the two
|
||||
headers in any order.
|
||||
|
||||
@code
|
||||
#define GLFW_INCLUDE_NONE
|
||||
#include <GLFW/glfw3.h>
|
||||
#include <glad/gl.h>
|
||||
@endcode
|
||||
|
||||
|
||||
@subsection build_macros GLFW header option macros
|
||||
|
||||
These macros may be defined before the inclusion of the GLFW header and affect
|
||||
how that header behaves.
|
||||
its behavior.
|
||||
|
||||
`GLFW_INCLUDE_GLCOREARB` makes the header include the modern `GL/glcorearb.h`
|
||||
header (`OpenGL/gl3.h` on Mac OS X) instead of the regular OpenGL header.
|
||||
@anchor GLFW_DLL
|
||||
__GLFW_DLL__ is required on Windows when using the GLFW DLL, to tell the
|
||||
compiler that the GLFW functions are defined in a DLL.
|
||||
|
||||
`GLFW_INCLUDE_ES1` makes the header include the OpenGL ES 1.x `GLES/gl.h` header
|
||||
instead of the regular OpenGL header.
|
||||
The following macros control which OpenGL or OpenGL ES API header is included.
|
||||
Only one of these may be defined at a time.
|
||||
|
||||
`GLFW_INCLUDE_ES2` makes the header include the OpenGL ES 2.0 `GLES2/gl2.h`
|
||||
@note GLFW does not provide any of the API headers mentioned below. They are
|
||||
provided by your development environment or your OpenGL, OpenGL ES or Vulkan
|
||||
SDK, and most of them can be downloaded from the
|
||||
[Khronos Registry](https://www.khronos.org/registry/).
|
||||
|
||||
@anchor GLFW_INCLUDE_GLCOREARB
|
||||
__GLFW_INCLUDE_GLCOREARB__ makes the GLFW header include the modern
|
||||
`GL/glcorearb.h` header (`OpenGL/gl3.h` on macOS) instead of the regular OpenGL
|
||||
header.
|
||||
|
||||
@anchor GLFW_INCLUDE_ES1
|
||||
__GLFW_INCLUDE_ES1__ makes the GLFW header include the OpenGL ES 1.x `GLES/gl.h`
|
||||
header instead of the regular OpenGL header.
|
||||
|
||||
`GLFW_INCLUDE_ES3` makes the header include the OpenGL ES 3.0 `GLES3/gl3.h`
|
||||
header instead of the regular OpenGL header.
|
||||
@anchor GLFW_INCLUDE_ES2
|
||||
__GLFW_INCLUDE_ES2__ makes the GLFW header include the OpenGL ES 2.0
|
||||
`GLES2/gl2.h` header instead of the regular OpenGL header.
|
||||
|
||||
`GLFW_INCLUDE_NONE` makes the header not include any client API header.
|
||||
@anchor GLFW_INCLUDE_ES3
|
||||
__GLFW_INCLUDE_ES3__ makes the GLFW header include the OpenGL ES 3.0
|
||||
`GLES3/gl3.h` header instead of the regular OpenGL header.
|
||||
|
||||
`GLFW_INCLUDE_GLU` makes the header include the GLU header. This only makes
|
||||
sense if you are using OpenGL.
|
||||
@anchor GLFW_INCLUDE_ES31
|
||||
__GLFW_INCLUDE_ES31__ makes the GLFW header include the OpenGL ES 3.1
|
||||
`GLES3/gl31.h` header instead of the regular OpenGL header.
|
||||
|
||||
`GLFW_DLL` is necessary when using the GLFW DLL on Windows, in order to explain
|
||||
to the compiler that the GLFW functions will be coming from another executable.
|
||||
@anchor GLFW_INCLUDE_ES32
|
||||
__GLFW_INCLUDE_ES32__ makes the GLFW header include the OpenGL ES 3.2
|
||||
`GLES3/gl32.h` header instead of the regular OpenGL header.
|
||||
|
||||
@anchor GLFW_INCLUDE_NONE
|
||||
__GLFW_INCLUDE_NONE__ makes the GLFW header not include any OpenGL or OpenGL ES
|
||||
API header. This is useful in combination with an extension loading library.
|
||||
|
||||
If none of the above inclusion macros are defined, the standard OpenGL `GL/gl.h`
|
||||
header (`OpenGL/gl.h` on macOS) is included, unless GLFW detects the inclusion
|
||||
guards of any OpenGL, OpenGL ES or extension loader header it knows about.
|
||||
|
||||
The following macros control the inclusion of additional API headers. Any
|
||||
number of these may be defined simultaneously, and/or together with one of the
|
||||
above macros.
|
||||
|
||||
@anchor GLFW_INCLUDE_VULKAN
|
||||
__GLFW_INCLUDE_VULKAN__ makes the GLFW header include the Vulkan
|
||||
`vulkan/vulkan.h` header in addition to any selected OpenGL or OpenGL ES header.
|
||||
|
||||
@anchor GLFW_INCLUDE_GLEXT
|
||||
__GLFW_INCLUDE_GLEXT__ makes the GLFW header include the appropriate extension
|
||||
header for the OpenGL or OpenGL ES header selected above after and in addition
|
||||
to that header.
|
||||
|
||||
@anchor GLFW_INCLUDE_GLU
|
||||
__GLFW_INCLUDE_GLU__ makes the header include the GLU header in addition to the
|
||||
header selected above. This should only be used with the standard OpenGL header
|
||||
and only for compatibility with legacy code. GLU has been deprecated and should
|
||||
not be used in new code.
|
||||
|
||||
@note None of these macros may be defined during the compilation of GLFW itself.
|
||||
If your build includes GLFW and you define any these in your build files, make
|
||||
sure they are not applied to the GLFW sources.
|
||||
|
||||
|
||||
@section build_link Link with the right libraries
|
||||
|
||||
@subsection build_link_cmake Using GLFW from CMake
|
||||
GLFW is essentially a wrapper of various platform-specific APIs and therefore
|
||||
needs to link against many different system libraries. If you are using GLFW as
|
||||
a shared library / dynamic library / DLL then it takes care of these links.
|
||||
However, if you are using GLFW as a static library then your executable will
|
||||
need to link against these libraries.
|
||||
|
||||
The `GLFW_LIBRARIES` cache variable contains all link-time dependencies of GLFW
|
||||
as it is currently configured, so to link against GLFW simply do:
|
||||
On Windows and macOS, the list of system libraries is static and can be
|
||||
hard-coded into your build environment. See the section for your development
|
||||
environment below. On Linux and other Unix-like operating systems, the list
|
||||
varies but can be retrieved in various ways as described below.
|
||||
|
||||
target_link_libraries(myapp glfw ${GLFW_LIBRARIES})
|
||||
|
||||
Note that this does not include GLU, as GLFW does not use it. If your
|
||||
application needs GLU, you can add it to the list of dependencies with the
|
||||
`OPENGL_glu_LIBRARY` cache variable.
|
||||
A good general introduction to linking is
|
||||
[Beginner's Guide to Linkers](https://www.lurklurk.org/linkers/linkers.html) by
|
||||
David Drysdale.
|
||||
|
||||
|
||||
@subsection build_link_win32 Windows
|
||||
@subsection build_link_win32 With MinGW or Visual C++ on Windows
|
||||
|
||||
The static version of the GLFW library is named `glfw3`. When using this
|
||||
version, it is also necessary to link with some libraries that GLFW uses.
|
||||
|
||||
When linking a program under Windows that uses the static version of GLFW, you
|
||||
must link with `opengl32`. If you are using GLU, you must also link with
|
||||
`glu32`.
|
||||
When using MinGW to link an application with the static version of GLFW, you
|
||||
must also explicitly link with `gdi32`. Other toolchains including MinGW-w64
|
||||
include it in the set of default libraries along with other dependencies like
|
||||
`user32` and `kernel32`.
|
||||
|
||||
The link library for the GLFW DLL is named `glfw3dll`. When compiling a program
|
||||
that uses the DLL version of GLFW, you need to define the `GLFW_DLL` macro
|
||||
*before* any inclusion of the GLFW header. This can be done either with
|
||||
a compiler switch or by defining it in your source code.
|
||||
|
||||
A program using the GLFW DLL does not need to link against any of its
|
||||
dependencies, but you still have to link against `opengl32` if your program uses
|
||||
OpenGL and `glu32` if it uses GLU.
|
||||
The link library for the GLFW DLL is named `glfw3dll`. When compiling an
|
||||
application that uses the DLL version of GLFW, you need to define the @ref
|
||||
GLFW_DLL macro _before_ any inclusion of the GLFW header. This can be done
|
||||
either with a compiler switch or by defining it in your source code.
|
||||
|
||||
|
||||
@subsection build_link_unix Unix with X11
|
||||
@subsection build_link_cmake_source With CMake and GLFW source
|
||||
|
||||
GLFW supports [pkg-config](http://www.freedesktop.org/wiki/Software/pkg-config/),
|
||||
and `glfw3.pc` file is generated when the library is built and installed along
|
||||
with it. You can use it without installation using the `PKG_CONFIG_PATH`
|
||||
environment variable. See the documentation for pkg-config for more details.
|
||||
This section is about using CMake to compile and link GLFW along with your
|
||||
application. If you want to use an installed binary instead, see @ref
|
||||
build_link_cmake_package.
|
||||
|
||||
A typical compile and link command-line when using the static may look like this:
|
||||
With a few changes to your `CMakeLists.txt` you can have the GLFW source tree
|
||||
built along with your application.
|
||||
|
||||
cc `pkg-config --cflags glfw3` -o myprog myprog.c `pkg-config --static --libs glfw3`
|
||||
Add the root directory of the GLFW source tree to your project. This will add
|
||||
the `glfw` target to your project.
|
||||
|
||||
If you are using the shared library, simply omit the `--static` flag.
|
||||
@code{.cmake}
|
||||
add_subdirectory(path/to/glfw)
|
||||
@endcode
|
||||
|
||||
If you are using GLU, you should also add `-lGLU` to your link flags.
|
||||
Once GLFW has been added, link your application against the `glfw` target.
|
||||
This adds the GLFW library and its link-time dependencies as it is currently
|
||||
configured, the include directory for the GLFW header and, when applicable, the
|
||||
@ref GLFW_DLL macro.
|
||||
|
||||
@code{.cmake}
|
||||
target_link_libraries(myapp glfw)
|
||||
@endcode
|
||||
|
||||
Note that the `glfw` target does not depend on OpenGL, as GLFW loads any OpenGL,
|
||||
OpenGL ES or Vulkan libraries it needs at runtime. If your application calls
|
||||
OpenGL directly, instead of using a modern
|
||||
[extension loader library](@ref context_glext_auto), use the OpenGL CMake
|
||||
package.
|
||||
|
||||
@code{.cmake}
|
||||
find_package(OpenGL REQUIRED)
|
||||
@endcode
|
||||
|
||||
If OpenGL is found, the `OpenGL::GL` target is added to your project, containing
|
||||
library and include directory paths. Link against this like any other library.
|
||||
|
||||
@code{.cmake}
|
||||
target_link_libraries(myapp OpenGL::GL)
|
||||
@endcode
|
||||
|
||||
For a minimal example of a program and GLFW sources built with CMake, see the
|
||||
[GLFW CMake Starter](https://github.com/juliettef/GLFW-CMake-starter) on GitHub.
|
||||
|
||||
|
||||
@subsection build_link_osx Mac OS X
|
||||
@subsection build_link_cmake_package With CMake and installed GLFW binaries
|
||||
|
||||
GLFW on Mac OS X uses the Cocoa, OpenGL and IOKit frameworks.
|
||||
This section is about using CMake to link GLFW after it has been built and
|
||||
installed. If you want to build it along with your application instead, see
|
||||
@ref build_link_cmake_source.
|
||||
|
||||
If you are using Xcode, you can simply add the GLFW library and these frameworks
|
||||
as dependencies.
|
||||
With a few changes to your `CMakeLists.txt` you can locate the package and
|
||||
target files generated when GLFW is installed.
|
||||
|
||||
If you are building from the
|
||||
command-line, it is recommended that you use pkg-config
|
||||
@code{.cmake}
|
||||
find_package(glfw3 3.4 REQUIRED)
|
||||
@endcode
|
||||
|
||||
GLFW supports [pkg-config](http://www.freedesktop.org/wiki/Software/pkg-config/),
|
||||
and `glfw3.pc` file is generated when the library is built and installed along
|
||||
with it. You can use it without installation using the `PKG_CONFIG_PATH`
|
||||
environment variable. See the documentation for pkg-config for more details.
|
||||
Once GLFW has been added to the project, link against it with the `glfw` target.
|
||||
This adds the GLFW library and its link-time dependencies, the include directory
|
||||
for the GLFW header and, when applicable, the @ref GLFW_DLL macro.
|
||||
|
||||
You can find pkg-config in most package systems such as
|
||||
[Fink](http://www.finkproject.org/) and [MacPorts](http://www.macports.org/), so
|
||||
if you have one of them installed, simply install pkg-config. Once you have
|
||||
pkg-config available, the command-line for compiling and linking your
|
||||
program is:
|
||||
@code{.cmake}
|
||||
target_link_libraries(myapp glfw)
|
||||
@endcode
|
||||
|
||||
cc `pkg-config --cflags glfw3` -o myprog myprog.c `pkg-config --static --libs glfw3`
|
||||
Note that the `glfw` target does not depend on OpenGL, as GLFW loads any OpenGL,
|
||||
OpenGL ES or Vulkan libraries it needs at runtime. If your application calls
|
||||
OpenGL directly, instead of using a modern
|
||||
[extension loader library](@ref context_glext_auto), use the OpenGL CMake
|
||||
package.
|
||||
|
||||
If you do not wish to use pkg-config, you need to add the required frameworks
|
||||
and libraries to your command-line using the `-l` and `-framework` switches,
|
||||
i.e.:
|
||||
@code{.cmake}
|
||||
find_package(OpenGL REQUIRED)
|
||||
@endcode
|
||||
|
||||
cc -o myprog myprog.c -lglfw -framework Cocoa -framework OpenGL -framework IOKit
|
||||
If OpenGL is found, the `OpenGL::GL` target is added to your project, containing
|
||||
library and include directory paths. Link against this like any other library.
|
||||
|
||||
Note that you do not add the `.framework` extension to a framework when adding
|
||||
it from the command-line.
|
||||
@code{.cmake}
|
||||
target_link_libraries(myapp OpenGL::GL)
|
||||
@endcode
|
||||
|
||||
The OpenGL framework contains both the OpenGL and GLU APIs, so there is no need
|
||||
to add additional libraries or frameworks when using GLU. Also note that even
|
||||
though your machine may have `libGL`-style OpenGL libraries, they are for use
|
||||
with the X Window System and will *not* work with the Mac OS X native version of
|
||||
GLFW.
|
||||
|
||||
@subsection build_link_pkgconfig With makefiles and pkg-config on Unix
|
||||
|
||||
GLFW supports [pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config/),
|
||||
and the `glfw3.pc` pkg-config file is generated when the GLFW library is built
|
||||
and is installed along with it. A pkg-config file describes all necessary
|
||||
compile-time and link-time flags and dependencies needed to use a library. When
|
||||
they are updated or if they differ between systems, you will get the correct
|
||||
ones automatically.
|
||||
|
||||
A typical compile and link command-line when using the static version of the
|
||||
GLFW library may look like this:
|
||||
|
||||
@code{.sh}
|
||||
cc $(pkg-config --cflags glfw3) -o myprog myprog.c $(pkg-config --static --libs glfw3)
|
||||
@endcode
|
||||
|
||||
If you are using the shared version of the GLFW library, omit the `--static`
|
||||
flag.
|
||||
|
||||
@code{.sh}
|
||||
cc $(pkg-config --cflags glfw3) -o myprog myprog.c $(pkg-config --libs glfw3)
|
||||
@endcode
|
||||
|
||||
You can also use the `glfw3.pc` file without installing it first, by using the
|
||||
`PKG_CONFIG_PATH` environment variable.
|
||||
|
||||
@code{.sh}
|
||||
env PKG_CONFIG_PATH=path/to/glfw/src cc $(pkg-config --cflags glfw3) -o myprog myprog.c $(pkg-config --libs glfw3)
|
||||
@endcode
|
||||
|
||||
The dependencies do not include OpenGL, as GLFW loads any OpenGL, OpenGL ES or
|
||||
Vulkan libraries it needs at runtime. If your application calls OpenGL
|
||||
directly, instead of using a modern
|
||||
[extension loader library](@ref context_glext_auto), you should add the `gl`
|
||||
pkg-config package.
|
||||
|
||||
@code{.sh}
|
||||
cc $(pkg-config --cflags glfw3 gl) -o myprog myprog.c $(pkg-config --libs glfw3 gl)
|
||||
@endcode
|
||||
|
||||
|
||||
@subsection build_link_xcode With Xcode on macOS
|
||||
|
||||
If you are using the dynamic library version of GLFW, add it to the project
|
||||
dependencies.
|
||||
|
||||
If you are using the static library version of GLFW, add it and the Cocoa,
|
||||
OpenGL and IOKit frameworks to the project as dependencies. They can all be
|
||||
found in `/System/Library/Frameworks`.
|
||||
|
||||
|
||||
@subsection build_link_osx With command-line on macOS
|
||||
|
||||
It is recommended that you use [pkg-config](@ref build_link_pkgconfig) when
|
||||
building from the command line on macOS. That way you will get any new
|
||||
dependencies added automatically. If you still wish to build manually, you need
|
||||
to add the required frameworks and libraries to your command-line yourself using
|
||||
the `-l` and `-framework` switches.
|
||||
|
||||
If you are using the dynamic GLFW library, which is named `libglfw.3.dylib`, do:
|
||||
|
||||
@code{.sh}
|
||||
cc -o myprog myprog.c -lglfw -framework Cocoa -framework OpenGL -framework IOKit
|
||||
@endcode
|
||||
|
||||
If you are using the static library, named `libglfw3.a`, substitute `-lglfw3`
|
||||
for `-lglfw`.
|
||||
|
||||
Note that you do not add the `.framework` extension to a framework when linking
|
||||
against it from the command-line.
|
||||
|
||||
@note Your machine may have `libGL.*.dylib` style OpenGL library, but that is
|
||||
for the X Window System and will not work with the macOS native version of GLFW.
|
||||
|
||||
*/
|
||||
|
|
259
docs/compat.dox
259
docs/compat.dox
|
@ -1,32 +1,37 @@
|
|||
/*!
|
||||
|
||||
@page compat Standards conformance
|
||||
@page compat_guide Standards conformance
|
||||
|
||||
@tableofcontents
|
||||
|
||||
This chapter describes the various API extensions used by this version of GLFW.
|
||||
This guide describes the various API extensions used by this version of GLFW.
|
||||
It lists what are essentially implementation details, but which are nonetheless
|
||||
vital knowledge for developers wishing to deploy their applications on machines
|
||||
with varied specifications.
|
||||
vital knowledge for developers intending to deploy their applications on a wide
|
||||
range of machines.
|
||||
|
||||
Note that the information in this appendix is not a part of the API
|
||||
specification but merely list some of the preconditions for certain parts of the
|
||||
API to function on a given machine. As such, any part of it may change in
|
||||
future versions without this being considered a breaking API change.
|
||||
The information in this guide is not a part of GLFW API, but merely
|
||||
preconditions for some parts of the library to function on a given machine. Any
|
||||
part of this information may change in future versions of GLFW and that will not
|
||||
be considered a breaking API change.
|
||||
|
||||
@section compat_wm ICCCM and EWMH conformance
|
||||
|
||||
As GLFW uses Xlib, directly, without any intervening toolkit
|
||||
@section compat_x11 X11 extensions, protocols and IPC standards
|
||||
|
||||
As GLFW uses Xlib directly, without any intervening toolkit
|
||||
library, it has sole responsibility for interacting well with the many and
|
||||
varied window managers in use on Unix-like systems. In order for applications
|
||||
and window managers to work well together, a number of standards and
|
||||
conventions have been developed that regulate behavior outside the scope of the
|
||||
X11 API; most importantly the
|
||||
[Inter-Client Communication Conventions Manual](http://www.tronche.com/gui/x/icccm/)
|
||||
[Inter-Client Communication Conventions Manual](https://www.tronche.com/gui/x/icccm/)
|
||||
(ICCCM) and
|
||||
[Extended Window Manager Hints](http://standards.freedesktop.org/wm-spec/wm-spec-latest.html)
|
||||
[Extended Window Manager Hints](https://standards.freedesktop.org/wm-spec/wm-spec-latest.html)
|
||||
(EWMH) standards.
|
||||
|
||||
GLFW uses the `_MOTIF_WM_HINTS` window property to support borderless windows.
|
||||
If the running window manager does not support this property, the
|
||||
`GLFW_DECORATED` hint will have no effect.
|
||||
|
||||
GLFW uses the ICCCM `WM_DELETE_WINDOW` protocol to intercept the user
|
||||
attempting to close the GLFW window. If the running window manager does not
|
||||
support this protocol, the close callback will never be called.
|
||||
|
@ -36,31 +41,126 @@ the user when the application has stopped responding, i.e. when it has ceased to
|
|||
process events. If the running window manager does not support this protocol,
|
||||
the user will not be notified if the application locks up.
|
||||
|
||||
GLFW uses the EWMH `_NET_WM_STATE` protocol to tell the window manager to make
|
||||
the GLFW window full screen. If the running window manager does not support this
|
||||
protocol, full screen windows may not work properly. GLFW has a fallback code
|
||||
path in case this protocol is unavailable, but every window manager behaves
|
||||
slightly differently in this regard.
|
||||
GLFW uses the EWMH `_NET_WM_STATE_FULLSCREEN` window state to tell the window
|
||||
manager to make the GLFW window full screen. If the running window manager does
|
||||
not support this state, full screen windows may not work properly. GLFW has
|
||||
a fallback code path in case this state is unavailable, but every window manager
|
||||
behaves slightly differently in this regard.
|
||||
|
||||
GLFW uses the EWMH `_NET_WM_BYPASS_COMPOSITOR` window property to tell a
|
||||
compositing window manager to un-redirect full screen GLFW windows. If the
|
||||
running window manager uses compositing but does not support this property then
|
||||
additional copying may be performed for each buffer swap of full screen windows.
|
||||
|
||||
GLFW uses the
|
||||
[clipboard manager protocol](http://www.freedesktop.org/wiki/ClipboardManager/)
|
||||
[clipboard manager protocol](https://www.freedesktop.org/wiki/ClipboardManager/)
|
||||
to push a clipboard string (i.e. selection) owned by a GLFW window about to be
|
||||
destroyed to the clipboard manager. If there is no running clipboard manager,
|
||||
the clipboard string will be unavailable once the window has been destroyed.
|
||||
|
||||
GLFW uses the
|
||||
[X drag-and-drop protocol](https://www.freedesktop.org/wiki/Specifications/XDND/)
|
||||
to provide file drop events. If the application originating the drag does not
|
||||
support this protocol, drag and drop will not work.
|
||||
|
||||
GLFW uses the XRandR 1.3 extension to provide multi-monitor support. If the
|
||||
running X server does not support this version of this extension, multi-monitor
|
||||
support will not function and only a single, desktop-spanning monitor will be
|
||||
reported.
|
||||
|
||||
GLFW uses the XRandR 1.3 and Xf86vidmode extensions to provide gamma ramp
|
||||
support. If the running X server does not support either or both of these
|
||||
extensions, gamma ramp support will not function.
|
||||
|
||||
GLFW uses the Xkb extension and detectable auto-repeat to provide keyboard
|
||||
input. If the running X server does not support this extension, a non-Xkb
|
||||
fallback path is used.
|
||||
|
||||
GLFW uses the XInput2 extension to provide raw, non-accelerated mouse motion
|
||||
when the cursor is disabled. If the running X server does not support this
|
||||
extension, regular accelerated mouse motion will be used.
|
||||
|
||||
GLFW uses both the XRender extension and the compositing manager to support
|
||||
transparent window framebuffers. If the running X server does not support this
|
||||
extension or there is no running compositing manager, the
|
||||
`GLFW_TRANSPARENT_FRAMEBUFFER` framebuffer hint will have no effect.
|
||||
|
||||
GLFW uses both the Xcursor extension and the freedesktop cursor conventions to
|
||||
provide an expanded set of standard cursor shapes. If the running X server does
|
||||
not support this extension or the current cursor theme does not support the
|
||||
conventions, the `GLFW_RESIZE_NWSE_CURSOR`, `GLFW_RESIZE_NESW_CURSOR` and
|
||||
`GLFW_NOT_ALLOWED_CURSOR` shapes will not be available and other shapes may use
|
||||
legacy images.
|
||||
|
||||
|
||||
@section compat_wayland Wayland protocols and IPC standards
|
||||
|
||||
As GLFW uses libwayland directly, without any intervening toolkit library, it
|
||||
has sole responsibility for interacting well with every compositor in use on
|
||||
Unix-like systems. Most of the features are provided by the core protocol,
|
||||
while cursor support is provided by the libwayland-cursor helper library, EGL
|
||||
integration by libwayland-egl, and keyboard handling by
|
||||
[libxkbcommon](https://xkbcommon.org/). In addition, GLFW uses some protocols
|
||||
from wayland-protocols to provide additional features if the compositor
|
||||
supports them.
|
||||
|
||||
GLFW uses xkbcommon 0.5.0 to provide key and text input support. Earlier
|
||||
versions are not supported.
|
||||
|
||||
GLFW uses the [xdg-shell
|
||||
protocol](https://cgit.freedesktop.org/wayland/wayland-protocols/tree/stable/xdg-shell/xdg-shell.xml)
|
||||
to provide better window management. This protocol is part of
|
||||
wayland-protocols 1.12, and is mandatory for GLFW to display a window.
|
||||
|
||||
GLFW uses the [relative pointer
|
||||
protocol](https://cgit.freedesktop.org/wayland/wayland-protocols/tree/unstable/relative-pointer/relative-pointer-unstable-v1.xml)
|
||||
alongside the [pointer constraints
|
||||
protocol](https://cgit.freedesktop.org/wayland/wayland-protocols/tree/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml)
|
||||
to implement disabled cursor. These two protocols are part of
|
||||
wayland-protocols 1.1, and mandatory at build time. If the running compositor
|
||||
does not support both of these protocols, disabling the cursor will have no
|
||||
effect.
|
||||
|
||||
GLFW uses the [idle inhibit
|
||||
protocol](https://cgit.freedesktop.org/wayland/wayland-protocols/tree/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml)
|
||||
to prohibit the screensaver from starting. This protocol is part of
|
||||
wayland-protocols 1.6, and mandatory at build time. If the running compositor
|
||||
does not support this protocol, the screensaver may start even for full screen
|
||||
windows.
|
||||
|
||||
GLFW uses the [libdecor library](https://gitlab.freedesktop.org/libdecor/libdecor)
|
||||
for window decorations, where available. This in turn provides good quality
|
||||
client-side decorations (drawn by the application) on desktop systems that do
|
||||
not support server-side decorations (drawn by the window manager). On systems
|
||||
that do not provide either libdecor or xdg-decoration, very basic window
|
||||
decorations are provided. These do not include the window title or any caption
|
||||
buttons.
|
||||
|
||||
GLFW uses the [xdg-decoration
|
||||
protocol](https://cgit.freedesktop.org/wayland/wayland-protocols/tree/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml)
|
||||
to request decorations to be drawn around its windows. This protocol is part
|
||||
of wayland-protocols 1.15, and mandatory at build time. If the running
|
||||
compositor does not support this protocol, a very simple frame will be drawn by
|
||||
GLFW itself, using the [viewporter
|
||||
protocol](https://cgit.freedesktop.org/wayland/wayland-protocols/tree/stable/viewporter/viewporter.xml)
|
||||
alongside
|
||||
[subsurfaces](https://cgit.freedesktop.org/wayland/wayland/tree/protocol/wayland.xml#n2598).
|
||||
This protocol is part of wayland-protocols 1.4, and mandatory at build time.
|
||||
If the running compositor does not support this protocol either, no decorations
|
||||
will be drawn around windows.
|
||||
|
||||
|
||||
@section compat_glx GLX extensions
|
||||
|
||||
The GLX API is the default API used to create OpenGL contexts on Unix-like
|
||||
systems using the X Window System.
|
||||
|
||||
GLFW uses the `GLXFBConfig` API to enumerate and select framebuffer pixel
|
||||
formats. This requires either GLX 1.3 or greater, or the `GLX_SGIX_fbconfig`
|
||||
extension. Where both are available, the SGIX extension is preferred. If
|
||||
neither is available, GLFW will be unable to create windows.
|
||||
GLFW uses the GLX 1.3 `GLXFBConfig` functions to enumerate and select framebuffer pixel
|
||||
formats. If GLX 1.3 is not supported, @ref glfwInit will fail.
|
||||
|
||||
GLFW uses the `GLX_MESA_swap_control,` `GLX_EXT_swap_control` and
|
||||
`GLX_SGI_swap_control` extensions to provide vertical retrace synchronization
|
||||
(or "vsync"), in that order of preference. Where none of these extension are
|
||||
(or _vsync_), in that order of preference. When none of these extensions are
|
||||
available, calling @ref glfwSwapInterval will have no effect.
|
||||
|
||||
GLFW uses the `GLX_ARB_multisample` extension to create contexts with
|
||||
|
@ -70,15 +170,25 @@ multisampling anti-aliasing. Where this extension is unavailable, the
|
|||
GLFW uses the `GLX_ARB_create_context` extension when available, even when
|
||||
creating OpenGL contexts of version 2.1 and below. Where this extension is
|
||||
unavailable, the `GLFW_CONTEXT_VERSION_MAJOR` and `GLFW_CONTEXT_VERSION_MINOR`
|
||||
hints will only be partially supported, the `GLFW_OPENGL_DEBUG_CONTEXT` hint
|
||||
will have no effect, and setting the `GLFW_OPENGL_PROFILE` or
|
||||
`GLFW_OPENGL_FORWARD_COMPAT` hints to a non-zero value will cause @ref
|
||||
glfwCreateWindow to fail.
|
||||
hints will only be partially supported, the `GLFW_CONTEXT_DEBUG` hint will have
|
||||
no effect, and setting the `GLFW_OPENGL_PROFILE` or `GLFW_OPENGL_FORWARD_COMPAT`
|
||||
hints to `GLFW_TRUE` will cause @ref glfwCreateWindow to fail.
|
||||
|
||||
GLFW uses the `GLX_ARB_create_context_profile` extension to provide support for
|
||||
context profiles. Where this extension is unavailable, setting the
|
||||
`GLFW_OPENGL_PROFILE` hint to anything but zero, or setting `GLFW_CLIENT_API` to
|
||||
anything but `GLFW_OPENGL_API` will cause @ref glfwCreateWindow to fail.
|
||||
`GLFW_OPENGL_PROFILE` hint to anything but `GLFW_OPENGL_ANY_PROFILE`, or setting
|
||||
`GLFW_CLIENT_API` to anything but `GLFW_OPENGL_API` or `GLFW_NO_API` will cause
|
||||
@ref glfwCreateWindow to fail.
|
||||
|
||||
GLFW uses the `GLX_ARB_context_flush_control` extension to provide control over
|
||||
whether a context is flushed when it is released (made non-current). Where this
|
||||
extension is unavailable, the `GLFW_CONTEXT_RELEASE_BEHAVIOR` hint will have no
|
||||
effect and the context will always be flushed when released.
|
||||
|
||||
GLFW uses the `GLX_ARB_framebuffer_sRGB` and `GLX_EXT_framebuffer_sRGB`
|
||||
extensions to provide support for sRGB framebuffers. Where both of these
|
||||
extensions are unavailable, the `GLFW_SRGB_CAPABLE` hint will have no effect.
|
||||
|
||||
|
||||
@section compat_wgl WGL extensions
|
||||
|
||||
|
@ -92,7 +202,7 @@ neither is available, no other extensions are used and many GLFW features
|
|||
related to context creation will have no effect or cause errors when used.
|
||||
|
||||
GLFW uses the `WGL_EXT_swap_control` extension to provide vertical retrace
|
||||
synchronization (or 'vsync'). Where this extension is unavailable, calling @ref
|
||||
synchronization (or _vsync_). Where this extension is unavailable, calling @ref
|
||||
glfwSwapInterval will have no effect.
|
||||
|
||||
GLFW uses the `WGL_ARB_pixel_format` and `WGL_ARB_multisample` extensions to
|
||||
|
@ -102,34 +212,81 @@ unavailable, the `GLFW_SAMPLES` hint will have no effect.
|
|||
GLFW uses the `WGL_ARB_create_context` extension when available, even when
|
||||
creating OpenGL contexts of version 2.1 and below. Where this extension is
|
||||
unavailable, the `GLFW_CONTEXT_VERSION_MAJOR` and `GLFW_CONTEXT_VERSION_MINOR`
|
||||
hints will only be partially supported, the `GLFW_OPENGL_DEBUG_CONTEXT` hint
|
||||
will have no effect, and setting the `GLFW_OPENGL_PROFILE` or
|
||||
`GLFW_OPENGL_FORWARD_COMPAT` hints to a non-zero value will cause @ref
|
||||
glfwCreateWindow to fail.
|
||||
hints will only be partially supported, the `GLFW_CONTEXT_DEBUG` hint will have
|
||||
no effect, and setting the `GLFW_OPENGL_PROFILE` or `GLFW_OPENGL_FORWARD_COMPAT`
|
||||
hints to `GLFW_TRUE` will cause @ref glfwCreateWindow to fail.
|
||||
|
||||
GLFW uses the `WGL_ARB_create_context_profile` extension to provide support for
|
||||
context profiles. Where this extension is unavailable, setting the
|
||||
`GLFW_OPENGL_PROFILE` hint to anything but zero will cause @ref glfwCreateWindow
|
||||
to fail.
|
||||
`GLFW_OPENGL_PROFILE` hint to anything but `GLFW_OPENGL_ANY_PROFILE` will cause
|
||||
@ref glfwCreateWindow to fail.
|
||||
|
||||
@section cmopat_osx OpenGL 3.2 on Mac OS X
|
||||
GLFW uses the `WGL_ARB_context_flush_control` extension to provide control over
|
||||
whether a context is flushed when it is released (made non-current). Where this
|
||||
extension is unavailable, the `GLFW_CONTEXT_RELEASE_BEHAVIOR` hint will have no
|
||||
effect and the context will always be flushed when released.
|
||||
|
||||
Support for OpenGL 3.0 and above was introduced with Mac OS X 10.7, and even
|
||||
then only forward-compatible OpenGL 3.2 core profile contexts are supported.
|
||||
There is also still no mechanism for requesting debug contexts. Versions of
|
||||
Mac OS X earlier than 10.7 support at most OpenGL version 2.1.
|
||||
GLFW uses the `WGL_ARB_framebuffer_sRGB` and `WGL_EXT_framebuffer_sRGB`
|
||||
extensions to provide support for sRGB framebuffers. When both of these
|
||||
extensions are unavailable, the `GLFW_SRGB_CAPABLE` hint will have no effect.
|
||||
|
||||
Because of this, on Mac OS X 10.7, the `GLFW_CONTEXT_VERSION_MAJOR` and
|
||||
`GLFW_CONTEXT_VERSION_MINOR` hints will fail if given a version above 3.2, the
|
||||
`GLFW_OPENGL_FORWARD_COMPAT` is required for creating OpenGL 3.2 contexts, the
|
||||
`GLFW_OPENGL_DEBUG_CONTEXT` hint is ignored and setting the
|
||||
`GLFW_OPENGL_PROFILE` hint to anything except `GLFW_OPENGL_CORE_PROFILE` will
|
||||
cause @ref glfwCreateWindow to fail.
|
||||
|
||||
@section compat_osx OpenGL on macOS
|
||||
|
||||
Support for OpenGL 3.2 and above was introduced with OS X 10.7 and even then
|
||||
only forward-compatible, core profile contexts are supported. Support for
|
||||
OpenGL 4.1 was introduced with OS X 10.9, also limited to forward-compatible,
|
||||
core profile contexts. There is also still no mechanism for requesting debug
|
||||
contexts or no-error contexts. Versions of Mac OS X earlier than 10.7 support
|
||||
at most OpenGL version 2.1.
|
||||
|
||||
Because of this, on OS X 10.7 and later, the `GLFW_CONTEXT_VERSION_MAJOR` and
|
||||
`GLFW_CONTEXT_VERSION_MINOR` hints will cause @ref glfwCreateWindow to fail if
|
||||
given version 3.0 or 3.1. The `GLFW_OPENGL_PROFILE` hint must be set to
|
||||
`GLFW_OPENGL_CORE_PROFILE` when creating OpenGL 3.2 and later contexts. The
|
||||
`GLFW_CONTEXT_DEBUG` and `GLFW_CONTEXT_NO_ERROR` hints are ignored.
|
||||
|
||||
Also, on Mac OS X 10.6 and below, the `GLFW_CONTEXT_VERSION_MAJOR` and
|
||||
`GLFW_CONTEXT_VERSION_MINOR` hints will fail if given a version above 2.1, the
|
||||
`GLFW_OPENGL_DEBUG_CONTEXT` hint will have no effect, and setting the
|
||||
`GLFW_OPENGL_PROFILE` or `GLFW_OPENGL_FORWARD_COMPAT` hints to a non-zero value
|
||||
will cause @ref glfwCreateWindow to fail.
|
||||
`GLFW_CONTEXT_VERSION_MINOR` hints will fail if given a version above 2.1,
|
||||
setting the `GLFW_OPENGL_PROFILE` or `GLFW_OPENGL_FORWARD_COMPAT` hints to
|
||||
a non-default value will cause @ref glfwCreateWindow to fail and the
|
||||
`GLFW_CONTEXT_DEBUG` hint is ignored.
|
||||
|
||||
|
||||
@section compat_vulkan Vulkan loader and API
|
||||
|
||||
By default, GLFW uses the standard system-wide Vulkan loader to access the
|
||||
Vulkan API on all platforms except macOS. This is installed by both graphics
|
||||
drivers and Vulkan SDKs. If either the loader or at least one minimally
|
||||
functional ICD is missing, @ref glfwVulkanSupported will return `GLFW_FALSE` and
|
||||
all other Vulkan-related functions will fail with an @ref GLFW_API_UNAVAILABLE
|
||||
error.
|
||||
|
||||
|
||||
@section compat_wsi Vulkan WSI extensions
|
||||
|
||||
The Vulkan WSI extensions are used to create Vulkan surfaces for GLFW windows on
|
||||
all supported platforms.
|
||||
|
||||
GLFW uses the `VK_KHR_surface` and `VK_KHR_win32_surface` extensions to create
|
||||
surfaces on Microsoft Windows. If any of these extensions are not available,
|
||||
@ref glfwGetRequiredInstanceExtensions will return an empty list and window
|
||||
surface creation will fail.
|
||||
|
||||
GLFW uses the `VK_KHR_surface` and either the `VK_MVK_macos_surface` or
|
||||
`VK_EXT_metal_surface` extensions to create surfaces on macOS. If any of these
|
||||
extensions are not available, @ref glfwGetRequiredInstanceExtensions will
|
||||
return an empty list and window surface creation will fail.
|
||||
|
||||
GLFW uses the `VK_KHR_surface` and either the `VK_KHR_xlib_surface` or
|
||||
`VK_KHR_xcb_surface` extensions to create surfaces on X11. If `VK_KHR_surface`
|
||||
or both `VK_KHR_xlib_surface` and `VK_KHR_xcb_surface` are not available, @ref
|
||||
glfwGetRequiredInstanceExtensions will return an empty list and window surface
|
||||
creation will fail.
|
||||
|
||||
GLFW uses the `VK_KHR_surface` and `VK_KHR_wayland_surface` extensions to create
|
||||
surfaces on Wayland. If any of these extensions are not available, @ref
|
||||
glfwGetRequiredInstanceExtensions will return an empty list and window surface
|
||||
creation will fail.
|
||||
|
||||
*/
|
||||
|
|
394
docs/compile.dox
Normal file
394
docs/compile.dox
Normal file
|
@ -0,0 +1,394 @@
|
|||
/*!
|
||||
|
||||
@page compile_guide Compiling GLFW
|
||||
|
||||
@tableofcontents
|
||||
|
||||
This is about compiling the GLFW library itself. For information on how to
|
||||
build applications that use GLFW, see @ref build_guide.
|
||||
|
||||
|
||||
@section compile_cmake Using CMake
|
||||
|
||||
GLFW behaves like most other libraries that use CMake so this guide mostly
|
||||
describes the standard configure, generate and compile sequence. If you are already
|
||||
familiar with this from other projects, you may want to focus on the @ref
|
||||
compile_deps and @ref compile_options sections for GLFW-specific information.
|
||||
|
||||
GLFW uses [CMake](https://cmake.org/) to generate project files or makefiles
|
||||
for your chosen development environment. To compile GLFW, first generate these
|
||||
files with CMake and then use them to compile the GLFW library.
|
||||
|
||||
If you are on Windows and macOS you can
|
||||
[download CMake](https://cmake.org/download/) from their site.
|
||||
|
||||
If you are on a Unix-like system such as Linux, FreeBSD or Cygwin or have
|
||||
a package system like Fink, MacPorts or Homebrew, you can install its CMake
|
||||
package.
|
||||
|
||||
CMake is a complex tool and this guide will only show a few of the possible ways
|
||||
to set up and compile GLFW. The CMake project has their own much more detailed
|
||||
[CMake user guide](https://cmake.org/cmake/help/latest/guide/user-interaction/)
|
||||
that includes everything in this guide not specific to GLFW. It may be a useful
|
||||
companion to this one.
|
||||
|
||||
|
||||
@subsection compile_deps Installing dependencies
|
||||
|
||||
The C/C++ development environments in Visual Studio, Xcode and MinGW come with
|
||||
all necessary dependencies for compiling GLFW, but on Unix-like systems like
|
||||
Linux and FreeBSD you will need a few extra packages.
|
||||
|
||||
|
||||
@subsubsection compile_deps_x11 Dependencies for X11
|
||||
|
||||
To compile GLFW for X11, you need to have the X11 development packages
|
||||
installed. They are not needed to build or run programs that use GLFW.
|
||||
|
||||
On Debian and derivatives like Ubuntu and Linux Mint the `xorg-dev` meta-package
|
||||
pulls in the development packages for all of X11.
|
||||
|
||||
@code{.sh}
|
||||
sudo apt install xorg-dev
|
||||
@endcode
|
||||
|
||||
On Fedora and derivatives like Red Hat the X11 extension packages
|
||||
`libXcursor-devel`, `libXi-devel`, `libXinerama-devel` and `libXrandr-devel`
|
||||
required by GLFW pull in all its other dependencies.
|
||||
|
||||
@code{.sh}
|
||||
sudo dnf install libXcursor-devel libXi-devel libXinerama-devel libXrandr-devel
|
||||
@endcode
|
||||
|
||||
On FreeBSD the X11 headers are installed along the end-user X11 packages, so if
|
||||
you have an X server running you should have the headers as well. If not,
|
||||
install the `xorgproto` package.
|
||||
|
||||
@code{.sh}
|
||||
pkg install xorgproto
|
||||
@endcode
|
||||
|
||||
On Cygwin the `libXcursor-devel`, `libXi-devel`, `libXinerama-devel`,
|
||||
`libXrandr-devel` and `libXrender-devel` packages in the Libs section of the GUI
|
||||
installer will install all the headers and other development related files GLFW
|
||||
requires for X11.
|
||||
|
||||
Once you have the required dependencies, move on to @ref compile_generate.
|
||||
|
||||
|
||||
@subsubsection compile_deps_wayland Dependencies for Wayland and X11
|
||||
|
||||
To compile GLFW for both Wayland and X11, you need to have the X11, Wayland and xkbcommon
|
||||
development packages installed. They are not needed to build or run programs that use
|
||||
GLFW. You will also need to set the @ref GLFW_BUILD_WAYLAND CMake option in the next
|
||||
step when generating build files.
|
||||
|
||||
On Debian and derivatives like Ubuntu and Linux Mint you will need the `libwayland-dev`,
|
||||
`libxkbcommon-dev` and `wayland-protocols` packages and the `xorg-dev` meta-package.
|
||||
These will pull in all other dependencies.
|
||||
|
||||
@code{.sh}
|
||||
sudo apt install libwayland-dev libxkbcommon-dev wayland-protocols xorg-dev
|
||||
@endcode
|
||||
|
||||
On Fedora and derivatives like Red Hat you will need the `wayland-devel`,
|
||||
`libxkbcommon-devel`, `wayland-protocols-devel`, `libXcursor-devel`, `libXi-devel`,
|
||||
`libXinerama-devel` and `libXrandr-devel` packages. These will pull in all other
|
||||
dependencies.
|
||||
|
||||
@code{.sh}
|
||||
sudo dnf install wayland-devel libxkbcommon-devel wayland-protocols-devel libXcursor-devel libXi-devel libXinerama-devel libXrandr-devel
|
||||
@endcode
|
||||
|
||||
On FreeBSD you will need the `wayland`, `libxkbcommon` and `wayland-protocols` packages.
|
||||
The X11 headers are installed along the end-user X11 packages, so if you have an X server
|
||||
running you should have the headers as well. If not, install the `xorgproto` package.
|
||||
|
||||
@code{.sh}
|
||||
pkg install wayland libxkbcommon wayland-protocols xorgproto
|
||||
@endcode
|
||||
|
||||
Once you have the required dependencies, move on to @ref compile_generate.
|
||||
|
||||
|
||||
@subsection compile_generate Generating build files with CMake
|
||||
|
||||
Once you have all necessary dependencies it is time to generate the project
|
||||
files or makefiles for your development environment. CMake needs two paths for
|
||||
this:
|
||||
|
||||
- the path to the root directory of the GLFW source tree (not its `src`
|
||||
subdirectory)
|
||||
- the path to the directory where the generated build files and compiled
|
||||
binaries will be placed
|
||||
|
||||
If these are the same, it is called an in-tree build, otherwise it is called an
|
||||
out-of-tree build.
|
||||
|
||||
Out-of-tree builds are recommended as they avoid cluttering up the source tree.
|
||||
They also allow you to have several build directories for different
|
||||
configurations all using the same source tree.
|
||||
|
||||
A common pattern when building a single configuration is to have a build
|
||||
directory named `build` in the root of the source tree.
|
||||
|
||||
|
||||
@subsubsection compile_generate_gui Generating with the CMake GUI
|
||||
|
||||
Start the CMake GUI and set the paths to the source and build directories
|
||||
described above. Then press _Configure_ and _Generate_.
|
||||
|
||||
If you wish change any CMake variables in the list, press _Configure_ and then
|
||||
_Generate_ to have the new values take effect. The variable list will be
|
||||
populated after the first configure step.
|
||||
|
||||
By default, GLFW will use X11 on Linux and other Unix-like systems other than macOS. To
|
||||
include support for Wayland as well, set the @ref GLFW_BUILD_WAYLAND option in the GLFW
|
||||
section of the variable list, then apply the new value as described above.
|
||||
|
||||
Once you have generated the project files or makefiles for your chosen
|
||||
development environment, move on to @ref compile_compile.
|
||||
|
||||
|
||||
@subsubsection compile_generate_cli Generating with command-line CMake
|
||||
|
||||
To make a build directory, pass the source and build directories to the `cmake`
|
||||
command. These can be relative or absolute paths. The build directory is
|
||||
created if it doesn't already exist.
|
||||
|
||||
@code{.sh}
|
||||
cmake -S path/to/glfw -B path/to/build
|
||||
@endcode
|
||||
|
||||
It is common to name the build directory `build` and place it in the root of the
|
||||
source tree when only planning to build a single configuration.
|
||||
|
||||
@code{.sh}
|
||||
cd path/to/glfw
|
||||
cmake -S . -B build
|
||||
@endcode
|
||||
|
||||
Without other flags these will generate Visual Studio project files on Windows
|
||||
and makefiles on other platforms. You can choose other targets using the `-G`
|
||||
flag.
|
||||
|
||||
@code{.sh}
|
||||
cmake -S path/to/glfw -B path/to/build -G Xcode
|
||||
@endcode
|
||||
|
||||
By default, GLFW will use X11 on Linux and other Unix-like systems other
|
||||
than macOS. To also include support for Wayland, set the @ref GLFW_BUILD_WAYLAND CMake
|
||||
option.
|
||||
|
||||
@code{.sh}
|
||||
cmake -S path/to/glfw -B path/to/build -D GLFW_BUILD_WAYLAND=1
|
||||
@endcode
|
||||
|
||||
Once you have generated the project files or makefiles for your chosen
|
||||
development environment, move on to @ref compile_compile.
|
||||
|
||||
|
||||
@subsection compile_compile Compiling the library
|
||||
|
||||
You should now have all required dependencies and the project files or makefiles
|
||||
necessary to compile GLFW. Go ahead and compile the actual GLFW library with
|
||||
these files as you would with any other project.
|
||||
|
||||
With Visual Studio open `GLFW.sln` and use the Build menu. With Xcode open
|
||||
`GLFW.xcodeproj` and use the Project menu.
|
||||
|
||||
With Linux, macOS and other forms of Unix, run `make`.
|
||||
|
||||
@code{.sh}
|
||||
cd path/to/build
|
||||
make
|
||||
@endcode
|
||||
|
||||
With MinGW, it is `mingw32-make`.
|
||||
|
||||
@code{.sh}
|
||||
cd path/to/build
|
||||
mingw32-make
|
||||
@endcode
|
||||
|
||||
Any CMake build directory can also be built with the `cmake` command and the
|
||||
`--build` flag.
|
||||
|
||||
@code{.sh}
|
||||
cmake --build path/to/build
|
||||
@endcode
|
||||
|
||||
This will run the platform specific build tool the directory was generated for.
|
||||
|
||||
Once the GLFW library is compiled you are ready to build your application,
|
||||
linking it to the GLFW library. See @ref build_guide for more information.
|
||||
|
||||
|
||||
@section compile_options CMake options
|
||||
|
||||
The CMake files for GLFW provide a number of options, although not all are
|
||||
available on all supported platforms. Some of these are de facto standards
|
||||
among projects using CMake and so have no `GLFW_` prefix.
|
||||
|
||||
If you are using the GUI version of CMake, these are listed and can be changed
|
||||
from there. If you are using the command-line version of CMake you can use the
|
||||
`ccmake` ncurses GUI to set options. Some package systems like Ubuntu and other
|
||||
distributions based on Debian GNU/Linux have this tool in a separate
|
||||
`cmake-curses-gui` package.
|
||||
|
||||
Finally, if you don't want to use any GUI, you can set options from the `cmake`
|
||||
command-line with the `-D` flag.
|
||||
|
||||
@code{.sh}
|
||||
cmake -S path/to/glfw -B path/to/build -D BUILD_SHARED_LIBS=ON
|
||||
@endcode
|
||||
|
||||
|
||||
@subsection compile_options_shared Shared CMake options
|
||||
|
||||
@anchor BUILD_SHARED_LIBS
|
||||
__BUILD_SHARED_LIBS__ determines whether GLFW is built as a static library or as
|
||||
a DLL / shared library / dynamic library. This is disabled by default,
|
||||
producing a static GLFW library. This variable has no `GLFW_` prefix because it
|
||||
is defined by CMake. If you want to change the library only for GLFW when it is
|
||||
part of a larger project, see @ref GLFW_LIBRARY_TYPE.
|
||||
|
||||
@anchor GLFW_LIBRARY_TYPE
|
||||
__GLFW_LIBRARY_TYPE__ allows you to override @ref BUILD_SHARED_LIBS only for
|
||||
GLFW, without affecting other libraries in a larger project. When set, the
|
||||
value of this option must be a valid CMake library type. Set it to `STATIC` to
|
||||
build GLFW as a static library, `SHARED` to build it as a shared library
|
||||
/ dynamic library / DLL, or `OBJECT` to make GLFW a CMake object library.
|
||||
|
||||
@anchor GLFW_BUILD_EXAMPLES
|
||||
__GLFW_BUILD_EXAMPLES__ determines whether the GLFW examples are built
|
||||
along with the library. This is enabled by default unless GLFW is being built
|
||||
as a subproject of a larger CMake project.
|
||||
|
||||
@anchor GLFW_BUILD_TESTS
|
||||
__GLFW_BUILD_TESTS__ determines whether the GLFW test programs are
|
||||
built along with the library. This is enabled by default unless GLFW is being
|
||||
built as a subproject of a larger CMake project.
|
||||
|
||||
@anchor GLFW_BUILD_DOCS
|
||||
__GLFW_BUILD_DOCS__ determines whether the GLFW documentation is built along
|
||||
with the library. This is enabled by default if
|
||||
[Doxygen](https://www.doxygen.nl/) is found by CMake during configuration.
|
||||
|
||||
|
||||
@subsection compile_options_win32 Win32 specific CMake options
|
||||
|
||||
@anchor GLFW_BUILD_WIN32
|
||||
__GLFW_BUILD_WIN32__ determines whether to include support for Win32 when compiling the
|
||||
library. This option is only available when compiling for Windows. This is enabled by
|
||||
default.
|
||||
|
||||
@anchor USE_MSVC_RUNTIME_LIBRARY_DLL
|
||||
__USE_MSVC_RUNTIME_LIBRARY_DLL__ determines whether to use the DLL version or the
|
||||
static library version of the Visual C++ runtime library. When enabled, the
|
||||
DLL version of the Visual C++ library is used. This is enabled by default.
|
||||
|
||||
On CMake 3.15 and later you can set the standard CMake
|
||||
[CMAKE_MSVC_RUNTIME_LIBRARY](https://cmake.org/cmake/help/latest/variable/CMAKE_MSVC_RUNTIME_LIBRARY.html)
|
||||
variable instead of this GLFW-specific option.
|
||||
|
||||
@anchor GLFW_USE_HYBRID_HPG
|
||||
__GLFW_USE_HYBRID_HPG__ determines whether to export the `NvOptimusEnablement` and
|
||||
`AmdPowerXpressRequestHighPerformance` symbols, which force the use of the
|
||||
high-performance GPU on Nvidia Optimus and AMD PowerXpress systems. These symbols
|
||||
need to be exported by the EXE to be detected by the driver, so the override
|
||||
will not work if GLFW is built as a DLL. This is disabled by default, letting
|
||||
the operating system and driver decide.
|
||||
|
||||
|
||||
@subsection compile_options_macos macOS specific CMake options
|
||||
|
||||
@anchor GLFW_BUILD_COCOA
|
||||
__GLFW_BUILD_COCOA__ determines whether to include support for Cocoa when compiling the
|
||||
library. This option is only available when compiling for macOS. This is enabled by
|
||||
default.
|
||||
|
||||
|
||||
@subsection compile_options_unix Unix-like system specific CMake options
|
||||
|
||||
@anchor GLFW_BUILD_WAYLAND
|
||||
__GLFW_BUILD_WAYLAND__ determines whether to include support for Wayland when compiling
|
||||
the library. This option is only available when compiling for Linux and other Unix-like
|
||||
systems other than macOS. This is disabled by default.
|
||||
|
||||
@anchor GLFW_BUILD_X11
|
||||
__GLFW_BUILD_X11__ determines whether to include support for X11 when compiling the
|
||||
library. This option is only available when compiling for Linux and other Unix-like
|
||||
systems other than macOS. This is enabled by default.
|
||||
|
||||
|
||||
@section compile_mingw_cross Cross-compilation with CMake and MinGW
|
||||
|
||||
Both Cygwin and many Linux distributions have MinGW or MinGW-w64 packages. For
|
||||
example, Cygwin has the `mingw64-i686-gcc` and `mingw64-x86_64-gcc` packages
|
||||
for 32- and 64-bit version of MinGW-w64, while Debian GNU/Linux and derivatives
|
||||
like Ubuntu have the `mingw-w64` package for both.
|
||||
|
||||
GLFW has CMake toolchain files in the `CMake` subdirectory that set up
|
||||
cross-compilation of Windows binaries. To use these files you set the
|
||||
`CMAKE_TOOLCHAIN_FILE` CMake variable with the `-D` flag add an option when
|
||||
configuring and generating the build files.
|
||||
|
||||
@code{.sh}
|
||||
cmake -S path/to/glfw -B path/to/build -D CMAKE_TOOLCHAIN_FILE=path/to/file
|
||||
@endcode
|
||||
|
||||
The exact toolchain file to use depends on the prefix used by the MinGW or
|
||||
MinGW-w64 binaries on your system. You can usually see this in the /usr
|
||||
directory. For example, both the Ubuntu and Cygwin MinGW-w64 packages have
|
||||
`/usr/x86_64-w64-mingw32` for the 64-bit compilers, so the correct invocation
|
||||
would be:
|
||||
|
||||
@code{.sh}
|
||||
cmake -S path/to/glfw -B path/to/build -D CMAKE_TOOLCHAIN_FILE=CMake/x86_64-w64-mingw32.cmake
|
||||
@endcode
|
||||
|
||||
The path to the toolchain file is relative to the path to the GLFW source tree
|
||||
passed to the `-S` flag, not to the current directory.
|
||||
|
||||
For more details see the
|
||||
[CMake toolchain guide](https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html).
|
||||
|
||||
|
||||
@section compile_manual Compiling GLFW manually
|
||||
|
||||
If you wish to compile GLFW without its CMake build environment then you will have to do
|
||||
at least some platform-detection yourself. There are preprocessor macros for
|
||||
enabling support for the platforms (window systems) available. There are also optional,
|
||||
platform-specific macros for various features.
|
||||
|
||||
When building, GLFW will expect the necessary configuration macros to be defined
|
||||
on the command-line. The GLFW CMake files set these as private compile
|
||||
definitions on the GLFW target but if you compile the GLFW sources manually you
|
||||
will need to define them yourself.
|
||||
|
||||
The window system is used to create windows, handle input, monitors, gamma ramps and
|
||||
clipboard. The options are:
|
||||
|
||||
- @b _GLFW_COCOA to use the Cocoa frameworks
|
||||
- @b _GLFW_WIN32 to use the Win32 API
|
||||
- @b _GLFW_X11 to use the X Window System
|
||||
- @b _GLFW_WAYLAND to use the Wayland API (incomplete)
|
||||
|
||||
The @b _GLFW_WAYLAND and @b _GLFW_X11 macros may be combined and produces a library that
|
||||
attempts to detect the appropriate platform at initialization.
|
||||
|
||||
If you are building GLFW as a shared library / dynamic library / DLL then you
|
||||
must also define @b _GLFW_BUILD_DLL. Otherwise, you must not define it.
|
||||
|
||||
If you are using a custom name for the Vulkan, EGL, GLX, OSMesa, OpenGL, GLESv1
|
||||
or GLESv2 library, you can override the default names by defining those you need
|
||||
of @b _GLFW_VULKAN_LIBRARY, @b _GLFW_EGL_LIBRARY, @b _GLFW_GLX_LIBRARY, @b
|
||||
_GLFW_OSMESA_LIBRARY, @b _GLFW_OPENGL_LIBRARY, @b _GLFW_GLESV1_LIBRARY and @b
|
||||
_GLFW_GLESV2_LIBRARY. Otherwise, GLFW will use the built-in default names.
|
||||
|
||||
@note None of the @ref build_macros may be defined during the compilation of
|
||||
GLFW. If you define any of these in your build files, make sure they are not
|
||||
applied to the GLFW sources.
|
||||
|
||||
*/
|
323
docs/context.dox
323
docs/context.dox
|
@ -1,129 +1,305 @@
|
|||
/*!
|
||||
|
||||
@page context Context handling guide
|
||||
@page context_guide Context guide
|
||||
|
||||
@tableofcontents
|
||||
|
||||
The primary purpose of GLFW is to provide a simple interface to window
|
||||
management and OpenGL and OpenGL ES context creation. GLFW supports
|
||||
multiple windows, each of which has its own context.
|
||||
This guide introduces the OpenGL and OpenGL ES context related functions of
|
||||
GLFW. For details on a specific function in this category, see the @ref
|
||||
context. There are also guides for the other areas of the GLFW API.
|
||||
|
||||
- @ref intro_guide
|
||||
- @ref window_guide
|
||||
- @ref vulkan_guide
|
||||
- @ref monitor_guide
|
||||
- @ref input_guide
|
||||
|
||||
|
||||
@section context_object Context handles
|
||||
@section context_object Context objects
|
||||
|
||||
The @ref GLFWwindow object encapsulates both a window and a context. They are
|
||||
created with @ref glfwCreateWindow and destroyed with @ref glfwDestroyWindow (or
|
||||
@ref glfwTerminate, if any remain). As the window and context are inseparably
|
||||
linked, the object pointer is used as both a context and window handle.
|
||||
A window object encapsulates both a top-level window and an OpenGL or OpenGL ES
|
||||
context. It is created with @ref glfwCreateWindow and destroyed with @ref
|
||||
glfwDestroyWindow or @ref glfwTerminate. See @ref window_creation for more
|
||||
information.
|
||||
|
||||
As the window and context are inseparably linked, the window object also serves
|
||||
as the context handle.
|
||||
|
||||
To test the creation of various kinds of contexts and see their properties, run
|
||||
the `glfwinfo` test program.
|
||||
|
||||
@note Vulkan does not have a context and the Vulkan instance is created via the
|
||||
Vulkan API itself. If you will be using Vulkan to render to a window, disable
|
||||
context creation by setting the [GLFW_CLIENT_API](@ref GLFW_CLIENT_API_hint)
|
||||
hint to `GLFW_NO_API`. For more information, see the @ref vulkan_guide.
|
||||
|
||||
|
||||
@section context_hints Context creation hints
|
||||
@subsection context_hints Context creation hints
|
||||
|
||||
There are a number of hints, specified using @ref glfwWindowHint, related to
|
||||
what kind of context is created. See
|
||||
[context related hints](@ref window_hints_ctx) in the window handling guide.
|
||||
[context related hints](@ref window_hints_ctx) in the window guide.
|
||||
|
||||
|
||||
@subsection context_sharing Context object sharing
|
||||
|
||||
When creating a window and its OpenGL or OpenGL ES context with @ref
|
||||
glfwCreateWindow, you can specify another window whose context the new one
|
||||
should share its objects (textures, vertex and element buffers, etc.) with.
|
||||
|
||||
@code
|
||||
GLFWwindow* second_window = glfwCreateWindow(640, 480, "Second Window", NULL, first_window);
|
||||
@endcode
|
||||
|
||||
Object sharing is implemented by the operating system and graphics driver. On
|
||||
platforms where it is possible to choose which types of objects are shared, GLFW
|
||||
requests that all types are shared.
|
||||
|
||||
See the relevant chapter of the [OpenGL](https://www.opengl.org/registry/) or
|
||||
[OpenGL ES](https://www.khronos.org/opengles/) reference documents for more
|
||||
information. The name and number of this chapter unfortunately varies between
|
||||
versions and APIs, but has at times been named _Shared Objects and Multiple
|
||||
Contexts_.
|
||||
|
||||
GLFW comes with a bare-bones object sharing example program called `sharing`.
|
||||
|
||||
|
||||
@subsection context_offscreen Offscreen contexts
|
||||
|
||||
GLFW doesn't support creating contexts without an associated window. However,
|
||||
contexts with hidden windows can be created with the
|
||||
[GLFW_VISIBLE](@ref GLFW_VISIBLE_hint) window hint.
|
||||
|
||||
@code
|
||||
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
|
||||
|
||||
GLFWwindow* offscreen_context = glfwCreateWindow(640, 480, "", NULL, NULL);
|
||||
@endcode
|
||||
|
||||
The window never needs to be shown and its context can be used as a plain
|
||||
offscreen context. Depending on the window manager, the size of a hidden
|
||||
window's framebuffer may not be usable or modifiable, so framebuffer
|
||||
objects are recommended for rendering with such contexts.
|
||||
|
||||
You should still [process events](@ref events) as long as you have at least one
|
||||
window, even if none of them are visible.
|
||||
|
||||
|
||||
@subsection context_less Windows without contexts
|
||||
|
||||
You can disable context creation by setting the
|
||||
[GLFW_CLIENT_API](@ref GLFW_CLIENT_API_hint) hint to `GLFW_NO_API`. Windows
|
||||
without contexts must not be passed to @ref glfwMakeContextCurrent or @ref
|
||||
glfwSwapBuffers.
|
||||
|
||||
|
||||
@section context_current Current context
|
||||
|
||||
Before you can use the OpenGL or OpenGL ES APIs, you need to have a current
|
||||
context of the proper type. The context encapsulates all render state and all
|
||||
objects like textures and shaders.
|
||||
Before you can make OpenGL or OpenGL ES calls, you need to have a current
|
||||
context of the correct type. A context can only be current for a single thread
|
||||
at a time, and a thread can only have a single context current at a time.
|
||||
|
||||
Note that a context can only be current for a single thread at a time, and
|
||||
a thread can only have a single context at a time.
|
||||
When moving a context between threads, you must make it non-current on the old
|
||||
thread before making it current on the new one.
|
||||
|
||||
A context is made current with @ref glfwMakeContextCurrent.
|
||||
The context of a window is made current with @ref glfwMakeContextCurrent.
|
||||
|
||||
@code
|
||||
glfwMakeContextCurrent(window);
|
||||
@endcode
|
||||
|
||||
The current context is returned by @ref glfwGetCurrentContext.
|
||||
The window of the current context is returned by @ref glfwGetCurrentContext.
|
||||
|
||||
@code
|
||||
GLFWwindow* window = glfwGetCurrentContext();
|
||||
@endcode
|
||||
|
||||
The following GLFW functions require a context to be current. Calling any these
|
||||
functions without a current context will generate a @ref GLFW_NO_CURRENT_CONTEXT
|
||||
error.
|
||||
|
||||
@section context_swap Swapping buffers
|
||||
|
||||
See [swapping buffers](@ref window_swap) in the window handling guide.
|
||||
- @ref glfwSwapInterval
|
||||
- @ref glfwExtensionSupported
|
||||
- @ref glfwGetProcAddress
|
||||
|
||||
|
||||
@section context_glext OpenGL extension handling
|
||||
@section context_swap Buffer swapping
|
||||
|
||||
One of the benefits of OpenGL is its extensibility. Independent hardware
|
||||
vendors (IHVs) may include functionality in their OpenGL implementations that
|
||||
expand upon the OpenGL standard before that functionality is included in a new
|
||||
version of the OpenGL specification.
|
||||
See @ref buffer_swap in the window guide.
|
||||
|
||||
|
||||
@section context_glext OpenGL and OpenGL ES extensions
|
||||
|
||||
One of the benefits of OpenGL and OpenGL ES is their extensibility.
|
||||
Hardware vendors may include extensions in their implementations that extend the
|
||||
API before that functionality is included in a new version of the OpenGL or
|
||||
OpenGL ES specification, and some extensions are never included and remain
|
||||
as extensions until they become obsolete.
|
||||
|
||||
An extension is defined by:
|
||||
|
||||
- An extension name (e.g. `GL_ARB_debug_output`)
|
||||
- New OpenGL tokens (e.g. `GL_DEBUG_SEVERITY_HIGH_ARB`)
|
||||
- New OpenGL functions (e.g. `glGetDebugMessageLogARB`)
|
||||
- An extension name (e.g. `GL_ARB_gl_spirv`)
|
||||
- New OpenGL tokens (e.g. `GL_SPIR_V_BINARY_ARB`)
|
||||
- New OpenGL functions (e.g. `glSpecializeShaderARB`)
|
||||
|
||||
Note the `ARB` affix, which stands for Architecture Review Board and is used
|
||||
for official extensions. There are many different affixes, depending on who
|
||||
wrote the extension. A list of extensions, together with their specifications,
|
||||
can be found at the [OpenGL Registry](http://www.opengl.org/registry/).
|
||||
for official extensions. The extension above was created by the ARB, but there
|
||||
are many different affixes, like `NV` for Nvidia and `AMD` for, well, AMD. Any
|
||||
group may also use the generic `EXT` affix. Lists of extensions, together with
|
||||
their specifications, can be found at the
|
||||
[OpenGL Registry](https://www.opengl.org/registry/) and
|
||||
[OpenGL ES Registry](https://www.khronos.org/registry/gles/).
|
||||
|
||||
|
||||
@subsection context_glext_auto Loading extension with a loader library
|
||||
|
||||
An extension loader library is the easiest and best way to access both OpenGL and
|
||||
OpenGL ES extensions and modern versions of the core OpenGL or OpenGL ES APIs.
|
||||
They will take care of all the details of declaring and loading everything you
|
||||
need. One such library is [glad](https://github.com/Dav1dde/glad) and there are
|
||||
several others.
|
||||
|
||||
The following example will use glad but all extension loader libraries work
|
||||
similarly.
|
||||
|
||||
First you need to generate the source files using the glad Python script. This
|
||||
example generates a loader for any version of OpenGL, which is the default for
|
||||
both GLFW and glad, but loaders for OpenGL ES, as well as loaders for specific
|
||||
API versions and extension sets can be generated. The generated files are
|
||||
written to the `output` directory.
|
||||
|
||||
@code{.sh}
|
||||
python main.py --generator c --no-loader --out-path output
|
||||
@endcode
|
||||
|
||||
The `--no-loader` option is added because GLFW already provides a function for
|
||||
loading OpenGL and OpenGL ES function pointers, one that automatically uses the
|
||||
selected context creation API, and glad can call this instead of having to
|
||||
implement its own. There are several other command-line options as well. See
|
||||
the glad documentation for details.
|
||||
|
||||
Add the generated `output/src/glad.c`, `output/include/glad/glad.h` and
|
||||
`output/include/KHR/khrplatform.h` files to your build. Then you need to
|
||||
include the glad header file, which will replace the OpenGL header of your
|
||||
development environment. By including the glad header before the GLFW header,
|
||||
it suppresses the development environment's OpenGL or OpenGL ES header.
|
||||
|
||||
@code
|
||||
#include <glad/glad.h>
|
||||
#include <GLFW/glfw3.h>
|
||||
@endcode
|
||||
|
||||
Finally, you need to initialize glad once you have a suitable current context.
|
||||
|
||||
@code
|
||||
window = glfwCreateWindow(640, 480, "My Window", NULL, NULL);
|
||||
if (!window)
|
||||
{
|
||||
...
|
||||
}
|
||||
|
||||
glfwMakeContextCurrent(window);
|
||||
|
||||
gladLoadGLLoader((GLADloadproc) glfwGetProcAddress);
|
||||
@endcode
|
||||
|
||||
Once glad has been loaded, you have access to all OpenGL core and extension
|
||||
functions supported by both the context you created and the glad loader you
|
||||
generated. After that, you are ready to start rendering.
|
||||
|
||||
You can specify a minimum required OpenGL or OpenGL ES version with
|
||||
[context hints](@ref window_hints_ctx). If your needs are more complex, you can
|
||||
check the actual OpenGL or OpenGL ES version with
|
||||
[context attributes](@ref window_attribs_ctx), or you can check whether
|
||||
a specific version is supported by the current context with the
|
||||
`GLAD_GL_VERSION_x_x` booleans.
|
||||
|
||||
@code
|
||||
if (GLAD_GL_VERSION_3_2)
|
||||
{
|
||||
// Call OpenGL 3.2+ specific code
|
||||
}
|
||||
@endcode
|
||||
|
||||
To check whether a specific extension is supported, use the `GLAD_GL_xxx`
|
||||
booleans.
|
||||
|
||||
@code
|
||||
if (GLAD_GL_ARB_gl_spirv)
|
||||
{
|
||||
// Use GL_ARB_gl_spirv
|
||||
}
|
||||
@endcode
|
||||
|
||||
|
||||
@subsection context_glext_manual Loading extensions manually
|
||||
|
||||
__Do not use this technique__ unless it is absolutely necessary. An
|
||||
[extension loader library](@ref context_glext_auto) will save you a ton of
|
||||
tedious, repetitive, error prone work.
|
||||
|
||||
To use a certain extension, you must first check whether the context supports
|
||||
that extension and then, if it introduces new functions, retrieve the pointers
|
||||
to those functions.
|
||||
to those functions. GLFW provides @ref glfwExtensionSupported and @ref
|
||||
glfwGetProcAddress for manual loading of extensions and new API functions.
|
||||
|
||||
This can be done with GLFW, as will be described in this section, but usually
|
||||
you will instead want to use a dedicated extension loading library such as
|
||||
[GLEW](http://glew.sourceforge.net/). This kind of library greatly reduces the
|
||||
amount of work necessary to use both OpenGL extensions and modern versions of
|
||||
the OpenGL API. GLEW in particular has been extensively tested with and works
|
||||
well with GLFW.
|
||||
This section will demonstrate manual loading of OpenGL extensions. The loading
|
||||
of OpenGL ES extensions is identical except for the name of the extension header.
|
||||
|
||||
|
||||
@subsection context_glext_header The glext.h header
|
||||
@subsubsection context_glext_header The glext.h header
|
||||
|
||||
The `glext.h` header is a continually updated file that defines the interfaces
|
||||
for all OpenGL extensions. The latest version of this can always be found at
|
||||
the [OpenGL Registry](http://www.opengl.org/registry/). It it strongly
|
||||
recommended that you use your own copy, as the one shipped with your development
|
||||
environment may be several years out of date and may not include the extensions
|
||||
you wish to use.
|
||||
The `glext.h` extension header is a continually updated file that defines the
|
||||
interfaces for all OpenGL extensions. The latest version of this can always be
|
||||
found at the [OpenGL Registry](https://www.opengl.org/registry/). There are also
|
||||
extension headers for the various versions of OpenGL ES at the
|
||||
[OpenGL ES Registry](https://www.khronos.org/registry/gles/). It it strongly
|
||||
recommended that you use your own copy of the extension header, as the one
|
||||
included in your development environment may be several years out of date and
|
||||
may not include the extensions you wish to use.
|
||||
|
||||
The header defines function pointer types for all functions of all extensions it
|
||||
supports. These have names like `PFNGLGETDEBUGMESSAGELOGARB` (for
|
||||
`glGetDebugMessageLogARB`), i.e. the name is made uppercase and `PFN` and `PROC`
|
||||
are added to the ends.
|
||||
supports. These have names like `PFNGLSPECIALIZESHADERARBPROC` (for
|
||||
`glSpecializeShaderARB`), i.e. the name is made uppercase and `PFN` (pointer
|
||||
to function) and `PROC` (procedure) are added to the ends.
|
||||
|
||||
To include the extension header, define @ref GLFW_INCLUDE_GLEXT before including
|
||||
the GLFW header.
|
||||
|
||||
@code
|
||||
#define GLFW_INCLUDE_GLEXT
|
||||
#include <GLFW/glfw3.h>
|
||||
@endcode
|
||||
|
||||
|
||||
@subsection context_glext_string Checking for extensions
|
||||
@subsubsection context_glext_string Checking for extensions
|
||||
|
||||
A given machine may not actually support the extension (it may have older
|
||||
drivers or a graphics card that lacks the necessary hardware features), so it
|
||||
is necessary to check whether the context supports the extension. This is done
|
||||
with @ref glfwExtensionSupported.
|
||||
is necessary to check at run-time whether the context supports the extension.
|
||||
This is done with @ref glfwExtensionSupported.
|
||||
|
||||
@code
|
||||
if (glfwExtensionSupported("GL_ARB_debug_output"))
|
||||
if (glfwExtensionSupported("GL_ARB_gl_spirv"))
|
||||
{
|
||||
// The extension is supported by the current context
|
||||
}
|
||||
@endcode
|
||||
|
||||
The argument is a null terminated ASCII string with the extension name. If the
|
||||
extension is supported, @ref glfwExtensionSupported returns non-zero, otherwise
|
||||
it returns zero.
|
||||
extension is supported, @ref glfwExtensionSupported returns `GLFW_TRUE`,
|
||||
otherwise it returns `GLFW_FALSE`.
|
||||
|
||||
|
||||
@subsection context_glext_proc Fetching function pointers
|
||||
@subsubsection context_glext_proc Fetching function pointers
|
||||
|
||||
Many extensions, though not all, require the use of new OpenGL functions.
|
||||
These entry points are often not exposed by your link libraries, making
|
||||
it necessary to fetch them at run time. With @ref glfwGetProcAddress you can
|
||||
retrieve the address of extension and non-extension OpenGL functions.
|
||||
These functions often do not have entry points in the client API libraries of
|
||||
your operating system, making it necessary to fetch them at run time. You can
|
||||
retrieve pointers to these functions with @ref glfwGetProcAddress.
|
||||
|
||||
@code
|
||||
PFNGLGETDEBUGMESSAGELOGARB pfnGetDebugMessageLog = glfwGetProcAddress("glGetDebugMessageLogARB");
|
||||
PFNGLSPECIALIZESHADERARBPROC pfnSpecializeShaderARB = glfwGetProcAddress("glSpecializeShaderARB");
|
||||
@endcode
|
||||
|
||||
In general, you should avoid giving the function pointer variables the (exact)
|
||||
|
@ -134,31 +310,32 @@ Now that all the pieces have been introduced, here is what they might look like
|
|||
when used together.
|
||||
|
||||
@code
|
||||
#include "glext.h"
|
||||
#define GLFW_INCLUDE_GLEXT
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
#define glGetDebugMessageLogARB pfnGetDebugMessageLog
|
||||
PFNGLGETDEBUGMESSAGELOGARB pfnGetDebugMessageLog;
|
||||
#define glSpecializeShaderARB pfnSpecializeShaderARB
|
||||
PFNGLSPECIALIZESHADERARBPROC pfnSpecializeShaderARB;
|
||||
|
||||
// Flag indicating whether the extension is supported
|
||||
int has_debug_output = 0;
|
||||
int has_ARB_gl_spirv = 0;
|
||||
|
||||
void load_extensions(void)
|
||||
{
|
||||
if (glfwExtensionSupported("GL_ARB_debug_output"))
|
||||
if (glfwExtensionSupported("GL_ARB_gl_spirv"))
|
||||
{
|
||||
pfnGetDebugMessageLog = (PFNGLGETDEBUGMESSAGELOGARB) glfwGetProcAddress("glGetDebugMessageLogARB");
|
||||
if (pfnGetDebugMessageLog)
|
||||
{
|
||||
// Both the extension name and the function pointer are present
|
||||
has_debug_output = 1;
|
||||
}
|
||||
pfnSpecializeShaderARB = (PFNGLSPECIALIZESHADERARBPROC)
|
||||
glfwGetProcAddress("glSpecializeShaderARB");
|
||||
has_ARB_gl_spirv = 1;
|
||||
}
|
||||
}
|
||||
|
||||
void some_function(void)
|
||||
{
|
||||
// Now the extension function can be called as usual
|
||||
glGetDebugMessageLogARB(...);
|
||||
if (has_ARB_gl_spirv)
|
||||
{
|
||||
// Now the extension function can be called as usual
|
||||
glSpecializeShaderARB(...);
|
||||
}
|
||||
}
|
||||
@endcode
|
||||
|
||||
|
|
2
docs/extra.css
Normal file
2
docs/extra.css
Normal file
File diff suppressed because one or more lines are too long
7
docs/extra.css.map
Normal file
7
docs/extra.css.map
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"version": 3,
|
||||
"mappings": "AA8EA,2GAA4G,CAC3G,UAAU,CAAC,IAAI,CACf,WAAW,CAAC,IAAI,CAGjB,wBAAyB,CACxB,YAAY,CAAC,2CAAsD,CAGpE,4HAA6H,CAC5H,YAAY,CAAC,wCAAuD,CAGrE,wIAAyI,CACxI,YAAY,CAAC,wCAAuD,CAGrE,kBAAmB,CAClB,UAAU,CA9EgB,IAAa,CA+EvC,WAAW,CAAC,IAAI,CAGjB,sBAAuB,CACtB,KAAK,CAzFe,OAAa,CA0FjC,WAAW,CAAC,IAAI,CAGjB,4UAA6U,CAC5U,UAAU,CAAC,IAAI,CAGhB,kJAAmJ,CAClJ,MAAM,CAAC,IAAI,CAGZ,wHAAyH,CACxH,WAAW,CAAC,IAAI,CAGjB,qBAAsB,CACrB,UAAU,CAAC,IAAI,CAGhB,2LAA4L,CAC3L,OAAO,CAAC,CAAC,CAGV,wCAAyC,CACxC,OAAO,CAAC,IAAI,CAGb,iMAAkM,CACjM,UAAU,CApGW,OAA+B,CAuGrD,IAAK,CACJ,KAAK,CA1He,OAAa,CA6HlC,SAAU,CACN,SAAS,CAAE,IAAI,CACf,MAAM,CAAE,aAAa,CAGzB,qDAAsD,CACrD,KAAK,CApHU,OAAa,CAqH5B,aAAa,CAAC,IAAI,CAGnB,EAAG,CACF,WAAW,CAAC,KAAK,CACjB,SAAS,CAAC,IAAI,CAGf,EAAG,CACF,WAAW,CAAC,KAAK,CACjB,aAAa,CAAC,CAAC,CACf,SAAS,CAAC,IAAI,CAGf,EAAG,CACF,WAAW,CAAC,KAAK,CACjB,aAAa,CAAC,CAAC,CACf,SAAS,CAAC,IAAI,CAGf,WAAY,CACX,SAAS,CAAC,IAAI,CACd,UAAU,CAAC,IAAI,CACf,SAAS,CAAC,KAAK,CACf,OAAO,CAAC,MAAM,CACd,MAAM,CAAC,MAAM,CAEb,OAAO,CAAE,IAAI,CACb,cAAc,CAAE,GAAG,CACnB,SAAS,CAAE,IAAI,CACf,eAAe,CAAE,UAAU,CAC3B,WAAW,CAAE,MAAM,CACnB,aAAa,CAAE,OAAO,CAGvB,SAAU,CACT,WAAW,CAAC,IAAI,CAChB,aAAa,CAAC,IAAI,CAClB,KAAK,CApKqB,IAAa,CAqKvC,SAAS,CAAC,KAAK,CACf,UAAU,CAAC,yDAAyD,CAGrE,WAAY,CACX,eAAe,CAAC,IAAI,CACpB,MAAM,CAAC,UAAU,CACjB,KAAK,CAAC,KAAK,CAGZ,wBAAyB,CACxB,KAAK,CAAC,IAAI,CAGX,mCAAoC,CACnC,WAAW,CAAC,IAAI,CAChB,WAAW,CAAC,GAAG,CACf,OAAO,CAAC,KAAK,CACb,KAAK,CAvLqB,IAAa,CA0LxC,WAAY,CACX,YAAY,CAAE,CAAC,CAGhB,6CAA8C,CAC7C,UAAU,CAAC,SAAS,CAGrB,kBAAmB,CAClB,KAAK,CAnMqB,IAAa,CAsMxC,cAAe,CACd,UAAU,CAAC,MAAM,CACjB,OAAO,CAAC,GAAG,CACX,UAAU,CAAC,GAAG,CAGf,IAAK,CACJ,UAAU,CA7MgB,IAAa,CAgNxC,SAAU,CACT,SAAS,CAAC,KAAK,CACf,MAAM,CAAC,MAAM,CACb,SAAS,CAAC,IAAI,CAGf,UAAW,CACV,SAAS,CAAC,KAAK,CACf,MAAM,CAAC,MAAM,CACb,SAAS,CAAC,IAAI,CAGf,SAAU,CACT,OAAO,CAAC,IAAI,CAGb,kBAAmB,CAClB,WAAW,CAAC,IAAI,CAChB,WAAW,CAAC,IAAI,CAGjB,UAAW,CACV,UAAU,CAAC,IAAI,CACf,OAAO,CAAE,IAAI,CACb,cAAc,CAAE,GAAG,CACnB,SAAS,CAAE,IAAI,CACf,eAAe,CAAE,UAAU,CAC3B,WAAW,CAAE,MAAM,CACnB,aAAa,CAAE,OAAO,CAGvB,kEAAmE,CAClE,KAAK,CApOgB,OAA+B,CAuOrD,+BAAgC,CAC/B,KAAK,CA1Pe,OAAa,CA6PlC,qCAAsC,CACrC,KAAK,CA1NoB,IAAsB,CA6NhD,wBAA2B,CAC1B,MAAM,CAAE,UAAU,CAGnB,SAAU,CACT,UAAU,CAAC,KAAK,CAGjB,uBAAwB,CACvB,SAAS,CAAC,KAAK,CACf,MAAM,CAAC,MAAM,CACb,OAAO,CAAC,MAAM,CACd,UAAU,CAAC,SAA8B,CAG1C,sDAAuD,CACtD,UAAU,CAAC,iDAAoF,CAC/F,UAAU,CAAC,mBAAuC,CAClD,WAAW,CAAC,kBAAgD,CAC5D,UAAU,CAAC,IAAI,CACf,KAAK,CAlPa,IAAe,CAqPlC,kBAAmB,CAClB,KAAK,CArPoB,IAAsB,CAsP/C,OAAO,CAAC,IAAI,CACZ,aAAa,CAAC,GAAG,CACjB,gBAAgB,CAAC,OAAiC,CAGnD,OAAQ,CACP,KAAK,CAAC,KAAK,CACX,KAAK,CAAC,GAAG,CAGV,oCAAoC,CACnC,OAAQ,CACP,KAAK,CAAC,IAAI,CACV,KAAK,CAAC,OAAO,CACb,MAAM,CAAC,CAAC,EAIV,UAAW,CACV,SAAS,CAAC,MAAM,CAGjB,UAAW,CACV,YAAY,CAAC,KAAK,CAGnB,UAAW,CACV,SAAS,CAAC,GAAG,CACb,YAAY,CAAC,CAAC,CACd,eAAe,CAAC,IAAI,CAIjB,mCAAqB,CACjB,WAAW,CAAC,KAAK,CAIzB,mCAAoC,CACnC,UAAU,CAAC,oDAAgF,CAC3F,UAAU,CAAC,sBAAqC,CAChD,WAAW,CAAC,cAA8C,CAC1D,KAAK,CArTU,OAAa,CAsT5B,MAAM,CAAC,iBAAgC,CACvC,aAAa,CAAC,GAAG,CAGlB,UAAW,CACV,KAAK,CA9RkB,OAAgC,CAiSxD,aAAc,CACb,MAAM,CAAC,cAA+B,CACtC,sBAAsB,CAAC,GAAG,CAC1B,uBAAuB,CAAC,GAAG,CAC3B,aAAa,CAAC,IAAI,CAGnB,aAAc,CACb,MAAM,CAAC,cAA+B,CACtC,0BAA0B,CAAC,GAAG,CAC9B,yBAAyB,CAAC,GAAG,CAC7B,UAAU,CAAC,IAAI,CAGhB,kCAAmC,CAClC,eAAe,CAAC,OAAO,CACvB,cAAc,CAAC,CAAC,CAChB,MAAM,CAAC,cAA+B,CACtC,aAAa,CAAC,GAAG,CAGlB,+HAAgI,CAC/H,KAAK,CA/ToB,IAAsB,CAgU/C,eAAe,CAAC,IAAI,CAGrB,aAAc,CACb,eAAe,CAAC,OAAO,CACvB,cAAc,CAAC,CAAC,CAChB,MAAM,CAAC,cAA+B,CACtC,aAAa,CAAC,GAAG,CAGlB,gBAAiB,CAChB,MAAM,CAAC,GAAG,CACV,UAAU,CAAC,gEAAiH,CAG7H,mCAAoC,CAvTnC,UAAU,CAAC,oDAAuE,CAClF,UAAU,CAAC,sBAAsC,CACjD,KAAK,CAAC,OAAwB,CAC9B,MAAM,CAAC,iBAAmD,CAwT3D,uBAAwB,CA3TvB,UAAU,CAAC,oDAAuE,CAClF,UAAU,CAAC,sBAAsC,CACjD,KAAK,CAAC,OAAwB,CAC9B,MAAM,CAAC,iBAAmD,CA4T3D,oBAAqB,CA/TpB,UAAU,CAAC,oDAAuE,CAClF,UAAU,CAAC,sBAAsC,CACjD,KAAK,CAAC,OAAwB,CAC9B,MAAM,CAAC,iBAAmD,CAgU3D,eAAgB,CAnUf,UAAU,CAAC,oDAAuE,CAClF,UAAU,CAAC,sBAAsC,CACjD,KAAK,CAAC,OAAwB,CAC9B,MAAM,CAAC,iBAAmD,CAoU3D,gGAAiG,CAChG,aAAa,CAAC,GAAG,CACjB,OAAO,CAAC,GAAG,CACX,WAAW,CAAC,cAAwB,CACpC,MAAM,CAAC,KAAK,CAGb,iRAAkR,CACjR,KAAK,CAAC,OAAO,CAGd,QAAS,CACR,WAAW,CAAC,OAAO,CAGpB,yBAA0B,CACzB,UAAU,CAAC,OAAa,CACxB,aAAa,CAAC,GAAG,CACjB,MAAM,CAAC,IAAI,CACX,OAAO,CAAC,GAAG,CACX,QAAQ,CAAC,IAAI,CACb,WAAW,CAAC,cAAuB,CACnC,MAAM,CAAC,KAAK,CAGb,8CAA+C,CAC9C,KAAK,CA7Ze,OAAa,CAgalC,8BAA+B,CAC9B,KAAK,CAAC,OAAiB,CAGxB,qBAAsB,CACrB,KAAK,CAAC,OAAgB,CAGvB,8CAA+C,CAC9C,KAAK,CAAC,OAA+B,CACrC,WAAW,CAAC,IAAI,CAGjB,kBAAmB,CAClB,KAAK,CAAC,OAAiB,CAGxB,IAAK,CACJ,OAAO,CAAC,IAAI,CACZ,aAAa,CAAC,GAAG",
|
||||
"sources": ["extra.scss"],
|
||||
"names": [],
|
||||
"file": "extra.css"
|
||||
}
|
449
docs/extra.scss
Normal file
449
docs/extra.scss
Normal file
|
@ -0,0 +1,449 @@
|
|||
// NOTE: Please use this file to perform modifications on default style sheets.
|
||||
//
|
||||
// You need to install the official Sass CLI tool:
|
||||
// npm install -g sass
|
||||
//
|
||||
// Run this command to regenerate extra.css after you're finished with changes:
|
||||
// sass --style=compressed extra.scss extra.css
|
||||
//
|
||||
// Alternatively you can use online services to regenerate extra.css.
|
||||
|
||||
|
||||
// Default text color for page contents
|
||||
$default-text-color: hsl(0,0%,30%);
|
||||
|
||||
// Page header, footer, table rows, inline codes and definition lists
|
||||
$header-footer-background-color: hsl(0,0%,95%);
|
||||
|
||||
// Page header, footer links and navigation bar background
|
||||
$header-footer-link-color: hsl(0,0%,40%);
|
||||
|
||||
// Doxygen navigation bar links
|
||||
$navbar-link-color: $header-footer-background-color;
|
||||
|
||||
// Page content background color
|
||||
$content-background-color: hsl(0,0%,100%);
|
||||
|
||||
// Bold, italic, h1, h2, ... and table of contents
|
||||
$heading-color: hsl(0,0%,10%);
|
||||
|
||||
// Function, enum and macro definition separator
|
||||
$def-separator-color: $header-footer-background-color;
|
||||
|
||||
// Base color hue
|
||||
$base-hue: 24;
|
||||
|
||||
// Default color used for links
|
||||
$default-link-color: hsl($base-hue,100%,50%);
|
||||
|
||||
// Doxygen navigation bar active tab
|
||||
$tab-text-color: hsl(0,0%,100%);
|
||||
$tab-background-color1: $default-link-color;
|
||||
$tab-background-color2: lighten(adjust-hue($tab-background-color1, 10), 10%);
|
||||
|
||||
// Table borders
|
||||
$default-border-color: $default-link-color;
|
||||
|
||||
// Table header
|
||||
$table-text-color: $tab-text-color;
|
||||
$table-background-color1: $tab-background-color1;
|
||||
$table-background-color2: $tab-background-color2;
|
||||
|
||||
// Table of contents, data structure index and prototypes
|
||||
$toc-background-color1: hsl(0,0%,90%);
|
||||
$toc-background-color2: lighten($toc-background-color1, 5%);
|
||||
|
||||
// Function prototype parameters color
|
||||
$prototype-param-color: darken($default-link-color, 25%);
|
||||
|
||||
// Message box color: note, pre, post and invariant
|
||||
$box-note-color: hsl(103,80%,85%);
|
||||
|
||||
// Message box color: warning and attention
|
||||
$box-warning-color: hsl(34,80%,85%);
|
||||
|
||||
// Message box color: deprecated and bug
|
||||
$box-bug-color: hsl(333,80%,85%);
|
||||
|
||||
// Message box color: todo and test
|
||||
$box-todo-color: hsl(200,80%,85%);
|
||||
|
||||
// Message box helper function
|
||||
@mixin message-box($base-color){
|
||||
background:linear-gradient(to bottom,lighten($base-color, 5%) 0%,$base-color 100%);
|
||||
box-shadow:inset 0 0 32px darken($base-color, 5%);
|
||||
color:darken($base-color, 67%);
|
||||
border:2px solid desaturate(darken($base-color, 10%), 20%);
|
||||
}
|
||||
|
||||
.sm-dox,.sm-dox a,.sm-dox a:focus,.sm-dox a:active,.sm-dox a:hover,.sm-dox a.highlighted,.sm-dox ul a:hover {
|
||||
background:none;
|
||||
text-shadow:none;
|
||||
}
|
||||
|
||||
.sm-dox a span.sub-arrow {
|
||||
border-color:$navbar-link-color transparent transparent transparent;
|
||||
}
|
||||
|
||||
.sm-dox a span.sub-arrow:active,.sm-dox a span.sub-arrow:focus,.sm-dox a span.sub-arrow:hover,.sm-dox a:hover span.sub-arrow {
|
||||
border-color:$default-link-color transparent transparent transparent;
|
||||
}
|
||||
|
||||
.sm-dox ul a span.sub-arrow:active,.sm-dox ul a span.sub-arrow:focus,.sm-dox ul a span.sub-arrow:hover,.sm-dox ul a:hover span.sub-arrow {
|
||||
border-color:transparent transparent transparent $default-link-color;
|
||||
}
|
||||
|
||||
.sm-dox ul a:hover {
|
||||
background:$header-footer-link-color;
|
||||
text-shadow:none;
|
||||
}
|
||||
|
||||
.sm-dox ul.sm-nowrap a {
|
||||
color:$default-text-color;
|
||||
text-shadow:none;
|
||||
}
|
||||
|
||||
#main-nav,#main-menu,#main-menu a,#main-menu a:visited,#main-menu a:hover,#main-menu li,.memdoc,dl.reflist dd,div.toc li,.ah,span.lineno,span.lineno a,span.lineno a:hover,.note code,.pre code,.post code,.invariant code,.warning code,.attention code,.deprecated code,.bug code,.todo code,.test code,.doxtable code,.markdownTable code {
|
||||
background:none;
|
||||
}
|
||||
|
||||
#titlearea,.footer,.contents,div.header,.memdoc,table.doxtable td,table.doxtable th,table.markdownTable td,table.markdownTable th,hr,.memSeparator {
|
||||
border:none;
|
||||
}
|
||||
|
||||
#main-menu a,#main-menu a:visited,#main-menu a:hover,#main-menu li,.reflist dt a.el,.levels span,.directory .levels span {
|
||||
text-shadow:none;
|
||||
}
|
||||
|
||||
.memdoc,dl.reflist dd {
|
||||
box-shadow:none;
|
||||
}
|
||||
|
||||
div.headertitle,.note code,.pre code,.post code,.invariant code,.warning code,.attention code,.deprecated code,.bug code,.todo code,.test code,table.doxtable code,table.markdownTable code {
|
||||
padding:0;
|
||||
}
|
||||
|
||||
#nav-path,.directory .levels,span.lineno {
|
||||
display:none;
|
||||
}
|
||||
|
||||
html,#titlearea,.footer,tr.even,.directory tr.even,.doxtable tr:nth-child(even),tr.markdownTableBody:nth-child(even),.mdescLeft,.mdescRight,.memItemLeft,.memItemRight,code,.markdownTableRowEven {
|
||||
background:$header-footer-background-color;
|
||||
}
|
||||
|
||||
body {
|
||||
color:$default-text-color;
|
||||
}
|
||||
|
||||
div.title {
|
||||
font-size: 170%;
|
||||
margin: 1em 0 0.5em 0;
|
||||
}
|
||||
|
||||
h1,h2,h2.groupheader,h3,div.toc h3,h4,h5,h6,strong,em {
|
||||
color:$heading-color;
|
||||
border-bottom:none;
|
||||
}
|
||||
|
||||
h1 {
|
||||
padding-top:0.5em;
|
||||
font-size:150%;
|
||||
}
|
||||
|
||||
h2 {
|
||||
padding-top:0.5em;
|
||||
margin-bottom:0;
|
||||
font-size:130%;
|
||||
}
|
||||
|
||||
h3 {
|
||||
padding-top:0.5em;
|
||||
margin-bottom:0;
|
||||
font-size:110%;
|
||||
}
|
||||
|
||||
.glfwheader {
|
||||
font-size:16px;
|
||||
min-height:64px;
|
||||
max-width:920px;
|
||||
padding:0 32px;
|
||||
margin:0 auto;
|
||||
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
align-content: stretch;
|
||||
}
|
||||
|
||||
#glfwhome {
|
||||
line-height:64px;
|
||||
padding-right:48px;
|
||||
color:$header-footer-link-color;
|
||||
font-size:2.5em;
|
||||
background:url("https://www.glfw.org/css/arrow.png") no-repeat right;
|
||||
}
|
||||
|
||||
.glfwnavbar {
|
||||
list-style-type:none;
|
||||
margin:0 0 0 auto;
|
||||
float:right;
|
||||
}
|
||||
|
||||
#glfwhome,.glfwnavbar li {
|
||||
float:left;
|
||||
}
|
||||
|
||||
.glfwnavbar a,.glfwnavbar a:visited {
|
||||
line-height:64px;
|
||||
margin-left:2em;
|
||||
display:block;
|
||||
color:$header-footer-link-color;
|
||||
}
|
||||
|
||||
.glfwnavbar {
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
#glfwhome,.glfwnavbar a,.glfwnavbar a:visited {
|
||||
transition:.35s ease;
|
||||
}
|
||||
|
||||
#titlearea,.footer {
|
||||
color:$header-footer-link-color;
|
||||
}
|
||||
|
||||
address.footer {
|
||||
text-align:center;
|
||||
padding:2em;
|
||||
margin-top:3em;
|
||||
}
|
||||
|
||||
#top {
|
||||
background:$header-footer-link-color;
|
||||
}
|
||||
|
||||
#main-nav {
|
||||
max-width:960px;
|
||||
margin:0 auto;
|
||||
font-size:13px;
|
||||
}
|
||||
|
||||
#main-menu {
|
||||
max-width:920px;
|
||||
margin:0 auto;
|
||||
font-size:13px;
|
||||
}
|
||||
|
||||
.memtitle {
|
||||
display:none;
|
||||
}
|
||||
|
||||
.memproto,.memname {
|
||||
font-weight:bold;
|
||||
text-shadow:none;
|
||||
}
|
||||
|
||||
#main-menu {
|
||||
min-height:36px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
align-content: stretch;
|
||||
}
|
||||
|
||||
#main-menu a,#main-menu a:visited,#main-menu a:hover,#main-menu li {
|
||||
color:$navbar-link-color;
|
||||
}
|
||||
|
||||
#main-menu li ul.sm-nowrap li a {
|
||||
color:$default-text-color;
|
||||
}
|
||||
|
||||
#main-menu li ul.sm-nowrap li a:hover {
|
||||
color:$default-link-color;
|
||||
}
|
||||
|
||||
#main-menu > li:last-child {
|
||||
margin: 0 0 0 auto;
|
||||
}
|
||||
|
||||
.contents {
|
||||
min-height:590px;
|
||||
}
|
||||
|
||||
div.contents,div.header {
|
||||
max-width:920px;
|
||||
margin:0 auto;
|
||||
padding:0 32px;
|
||||
background:$content-background-color none;
|
||||
}
|
||||
|
||||
table.doxtable th,table.markdownTable th,dl.reflist dt {
|
||||
background:linear-gradient(to bottom,$table-background-color2 0%,$table-background-color1 100%);
|
||||
box-shadow:inset 0 0 32px $table-background-color1;
|
||||
text-shadow:0 -1px 1px darken($table-background-color1, 15%);
|
||||
text-align:left;
|
||||
color:$table-text-color;
|
||||
}
|
||||
|
||||
dl.reflist dt a.el {
|
||||
color:$default-link-color;
|
||||
padding:.2em;
|
||||
border-radius:4px;
|
||||
background-color:lighten($default-link-color, 40%);
|
||||
}
|
||||
|
||||
div.toc {
|
||||
float:right;
|
||||
width:35%;
|
||||
}
|
||||
|
||||
@media screen and (max-width:600px) {
|
||||
div.toc {
|
||||
float:none;
|
||||
width:inherit;
|
||||
margin:0;
|
||||
}
|
||||
}
|
||||
|
||||
div.toc h3 {
|
||||
font-size:1.17em;
|
||||
}
|
||||
|
||||
div.toc ul {
|
||||
padding-left:1.5em;
|
||||
}
|
||||
|
||||
div.toc li {
|
||||
font-size:1em;
|
||||
padding-left:0;
|
||||
list-style-type:disc;
|
||||
}
|
||||
|
||||
div.toc {
|
||||
li.level2, li.level3 {
|
||||
margin-left:0.5em;
|
||||
}
|
||||
}
|
||||
|
||||
div.toc,.memproto,div.qindex,div.ah {
|
||||
background:linear-gradient(to bottom,$toc-background-color2 0%,$toc-background-color1 100%);
|
||||
box-shadow:inset 0 0 32px $toc-background-color1;
|
||||
text-shadow:0 1px 1px lighten($toc-background-color2, 10%);
|
||||
color:$heading-color;
|
||||
border:2px solid $toc-background-color1;
|
||||
border-radius:4px;
|
||||
}
|
||||
|
||||
.paramname {
|
||||
color:$prototype-param-color;
|
||||
}
|
||||
|
||||
dl.reflist dt {
|
||||
border:2px solid $default-border-color;
|
||||
border-top-left-radius:4px;
|
||||
border-top-right-radius:4px;
|
||||
border-bottom:none;
|
||||
}
|
||||
|
||||
dl.reflist dd {
|
||||
border:2px solid $default-border-color;
|
||||
border-bottom-right-radius:4px;
|
||||
border-bottom-left-radius:4px;
|
||||
border-top:none;
|
||||
}
|
||||
|
||||
table.doxtable,table.markdownTable {
|
||||
border-collapse:inherit;
|
||||
border-spacing:0;
|
||||
border:2px solid $default-border-color;
|
||||
border-radius:4px;
|
||||
}
|
||||
|
||||
a,a:hover,a:visited,a:visited:hover,.contents a:visited,.el,a.el:visited,#glfwhome:hover,#main-menu a:hover,span.lineno a:hover {
|
||||
color:$default-link-color;
|
||||
text-decoration:none;
|
||||
}
|
||||
|
||||
div.directory {
|
||||
border-collapse:inherit;
|
||||
border-spacing:0;
|
||||
border:2px solid $default-border-color;
|
||||
border-radius:4px;
|
||||
}
|
||||
|
||||
hr,.memSeparator {
|
||||
height:2px;
|
||||
background:linear-gradient(to right,$def-separator-color 0%,darken($def-separator-color, 10%) 50%,$def-separator-color 100%);
|
||||
}
|
||||
|
||||
dl.note,dl.pre,dl.post,dl.invariant {
|
||||
@include message-box($box-note-color);
|
||||
}
|
||||
|
||||
dl.warning,dl.attention {
|
||||
@include message-box($box-warning-color);
|
||||
}
|
||||
|
||||
dl.deprecated,dl.bug {
|
||||
@include message-box($box-bug-color);
|
||||
}
|
||||
|
||||
dl.todo,dl.test {
|
||||
@include message-box($box-todo-color);
|
||||
}
|
||||
|
||||
dl.note,dl.pre,dl.post,dl.invariant,dl.warning,dl.attention,dl.deprecated,dl.bug,dl.todo,dl.test {
|
||||
border-radius:4px;
|
||||
padding:1em;
|
||||
text-shadow:0 1px 1px hsl(0,0%,100%);
|
||||
margin:1em 0;
|
||||
}
|
||||
|
||||
.note a,.pre a,.post a,.invariant a,.warning a,.attention a,.deprecated a,.bug a,.todo a,.test a,.note a:visited,.pre a:visited,.post a:visited,.invariant a:visited,.warning a:visited,.attention a:visited,.deprecated a:visited,.bug a:visited,.todo a:visited,.test a:visited {
|
||||
color:inherit;
|
||||
}
|
||||
|
||||
div.line {
|
||||
line-height:inherit;
|
||||
}
|
||||
|
||||
div.fragment,pre.fragment {
|
||||
background:hsl(0,0%,95%);
|
||||
border-radius:4px;
|
||||
border:none;
|
||||
padding:1em;
|
||||
overflow:auto;
|
||||
border-left:4px solid hsl(0,0%,80%);
|
||||
margin:1em 0;
|
||||
}
|
||||
|
||||
.lineno a,.lineno a:visited,.line,pre.fragment {
|
||||
color:$default-text-color;
|
||||
}
|
||||
|
||||
span.preprocessor,span.comment {
|
||||
color:hsl(193,100%,30%);
|
||||
}
|
||||
|
||||
a.code,a.code:visited {
|
||||
color:hsl(18,100%,45%);
|
||||
}
|
||||
|
||||
span.keyword,span.keywordtype,span.keywordflow {
|
||||
color:darken($default-text-color, 5%);
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
span.stringliteral {
|
||||
color:hsl(261,100%,30%);
|
||||
}
|
||||
|
||||
code {
|
||||
padding:.1em;
|
||||
border-radius:4px;
|
||||
}
|
7
docs/footer.html
Normal file
7
docs/footer.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
<address class="footer">
|
||||
<p>
|
||||
Last update on $date for $projectname $projectnumber
|
||||
</p>
|
||||
</address>
|
||||
</body>
|
||||
</html>
|
34
docs/header.html
Normal file
34
docs/header.html
Normal file
|
@ -0,0 +1,34 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||
<meta name="generator" content="Doxygen $doxygenversion"/>
|
||||
<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->
|
||||
<!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME-->
|
||||
<link href="$relpath^tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="$relpath^jquery.js"></script>
|
||||
<script type="text/javascript" src="$relpath^dynsections.js"></script>
|
||||
$treeview
|
||||
$search
|
||||
$mathjax
|
||||
<link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" />
|
||||
$extrastylesheet
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
|
||||
<!--BEGIN TITLEAREA-->
|
||||
<div id="titlearea">
|
||||
<div class="glfwheader">
|
||||
<a href="https://www.glfw.org/" id="glfwhome">GLFW</a>
|
||||
<ul class="glfwnavbar">
|
||||
<li><a href="https://www.glfw.org/documentation.html">Documentation</a></li>
|
||||
<li><a href="https://www.glfw.org/download.html">Download</a></li>
|
||||
<li><a href="https://www.glfw.org/community.html">Community</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!--END TITLEAREA-->
|
||||
<!-- end header part -->
|
977
docs/input.dox
Normal file
977
docs/input.dox
Normal file
|
@ -0,0 +1,977 @@
|
|||
/*!
|
||||
|
||||
@page input_guide Input guide
|
||||
|
||||
@tableofcontents
|
||||
|
||||
This guide introduces the input related functions of GLFW. For details on
|
||||
a specific function in this category, see the @ref input. There are also guides
|
||||
for the other areas of GLFW.
|
||||
|
||||
- @ref intro_guide
|
||||
- @ref window_guide
|
||||
- @ref context_guide
|
||||
- @ref vulkan_guide
|
||||
- @ref monitor_guide
|
||||
|
||||
GLFW provides many kinds of input. While some can only be polled, like time, or
|
||||
only received via callbacks, like scrolling, many provide both callbacks and
|
||||
polling. Callbacks are more work to use than polling but is less CPU intensive
|
||||
and guarantees that you do not miss state changes.
|
||||
|
||||
All input callbacks receive a window handle. By using the
|
||||
[window user pointer](@ref window_userptr), you can access non-global structures
|
||||
or objects from your callbacks.
|
||||
|
||||
To get a better feel for how the various events callbacks behave, run the
|
||||
`events` test program. It registers every callback supported by GLFW and prints
|
||||
out all arguments provided for every event, along with time and sequence
|
||||
information.
|
||||
|
||||
|
||||
@section events Event processing
|
||||
|
||||
GLFW needs to poll the window system for events both to provide input to the
|
||||
application and to prove to the window system that the application hasn't locked
|
||||
up. Event processing is normally done each frame after
|
||||
[buffer swapping](@ref buffer_swap). Even when you have no windows, event
|
||||
polling needs to be done in order to receive monitor and joystick connection
|
||||
events.
|
||||
|
||||
There are three functions for processing pending events. @ref glfwPollEvents,
|
||||
processes only those events that have already been received and then returns
|
||||
immediately.
|
||||
|
||||
@code
|
||||
glfwPollEvents();
|
||||
@endcode
|
||||
|
||||
This is the best choice when rendering continuously, like most games do.
|
||||
|
||||
If you only need to update the contents of the window when you receive new
|
||||
input, @ref glfwWaitEvents is a better choice.
|
||||
|
||||
@code
|
||||
glfwWaitEvents();
|
||||
@endcode
|
||||
|
||||
It puts the thread to sleep until at least one event has been received and then
|
||||
processes all received events. This saves a great deal of CPU cycles and is
|
||||
useful for, for example, editing tools.
|
||||
|
||||
If you want to wait for events but have UI elements or other tasks that need
|
||||
periodic updates, @ref glfwWaitEventsTimeout lets you specify a timeout.
|
||||
|
||||
@code
|
||||
glfwWaitEventsTimeout(0.7);
|
||||
@endcode
|
||||
|
||||
It puts the thread to sleep until at least one event has been received, or until
|
||||
the specified number of seconds have elapsed. It then processes any received
|
||||
events.
|
||||
|
||||
If the main thread is sleeping in @ref glfwWaitEvents, you can wake it from
|
||||
another thread by posting an empty event to the event queue with @ref
|
||||
glfwPostEmptyEvent.
|
||||
|
||||
@code
|
||||
glfwPostEmptyEvent();
|
||||
@endcode
|
||||
|
||||
Do not assume that callbacks will _only_ be called in response to the above
|
||||
functions. While it is necessary to process events in one or more of the ways
|
||||
above, window systems that require GLFW to register callbacks of its own can
|
||||
pass events to GLFW in response to many window system function calls. GLFW will
|
||||
pass those events on to the application callbacks before returning.
|
||||
|
||||
For example, on Windows the system function that @ref glfwSetWindowSize is
|
||||
implemented with will send window size events directly to the event callback
|
||||
that every window has and that GLFW implements for its windows. If you have set
|
||||
a [window size callback](@ref window_size) GLFW will call it in turn with the
|
||||
new size before everything returns back out of the @ref glfwSetWindowSize call.
|
||||
|
||||
|
||||
@section input_keyboard Keyboard input
|
||||
|
||||
GLFW divides keyboard input into two categories; key events and character
|
||||
events. Key events relate to actual physical keyboard keys, whereas character
|
||||
events relate to the Unicode code points generated by pressing some of them.
|
||||
|
||||
Keys and characters do not map 1:1. A single key press may produce several
|
||||
characters, and a single character may require several keys to produce. This
|
||||
may not be the case on your machine, but your users are likely not all using the
|
||||
same keyboard layout, input method or even operating system as you.
|
||||
|
||||
|
||||
@subsection input_key Key input
|
||||
|
||||
If you wish to be notified when a physical key is pressed or released or when it
|
||||
repeats, set a key callback.
|
||||
|
||||
@code
|
||||
glfwSetKeyCallback(window, key_callback);
|
||||
@endcode
|
||||
|
||||
The callback function receives the [keyboard key](@ref keys), platform-specific
|
||||
scancode, key action and [modifier bits](@ref mods).
|
||||
|
||||
@code
|
||||
void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
|
||||
{
|
||||
if (key == GLFW_KEY_E && action == GLFW_PRESS)
|
||||
activate_airship();
|
||||
}
|
||||
@endcode
|
||||
|
||||
The action is one of `GLFW_PRESS`, `GLFW_REPEAT` or `GLFW_RELEASE`. Events with
|
||||
`GLFW_PRESS` and `GLFW_RELEASE` actions are emitted for every key press. Most
|
||||
keys will also emit events with `GLFW_REPEAT` actions while a key is held down.
|
||||
|
||||
Key events with `GLFW_REPEAT` actions are intended for text input. They are
|
||||
emitted at the rate set in the user's keyboard settings. At most one key is
|
||||
repeated even if several keys are held down. `GLFW_REPEAT` actions should not
|
||||
be relied on to know which keys are being held down or to drive animation.
|
||||
Instead you should either save the state of relevant keys based on `GLFW_PRESS`
|
||||
and `GLFW_RELEASE` actions, or call @ref glfwGetKey, which provides basic cached
|
||||
key state.
|
||||
|
||||
The key will be one of the existing [key tokens](@ref keys), or
|
||||
`GLFW_KEY_UNKNOWN` if GLFW lacks a token for it, for example _E-mail_ and _Play_
|
||||
keys.
|
||||
|
||||
The scancode is unique for every key, regardless of whether it has a key token.
|
||||
Scancodes are platform-specific but consistent over time, so keys will have
|
||||
different scancodes depending on the platform but they are safe to save to disk.
|
||||
You can query the scancode for any [named key](@ref keys) on the current
|
||||
platform with @ref glfwGetKeyScancode.
|
||||
|
||||
@code
|
||||
const int scancode = glfwGetKeyScancode(GLFW_KEY_X);
|
||||
set_key_mapping(scancode, swap_weapons);
|
||||
@endcode
|
||||
|
||||
The last reported state for every [named key](@ref keys) is also saved in
|
||||
per-window state arrays that can be polled with @ref glfwGetKey.
|
||||
|
||||
@code
|
||||
int state = glfwGetKey(window, GLFW_KEY_E);
|
||||
if (state == GLFW_PRESS)
|
||||
{
|
||||
activate_airship();
|
||||
}
|
||||
@endcode
|
||||
|
||||
The returned state is one of `GLFW_PRESS` or `GLFW_RELEASE`.
|
||||
|
||||
This function only returns cached key event state. It does not poll the
|
||||
system for the current physical state of the key.
|
||||
|
||||
@anchor GLFW_STICKY_KEYS
|
||||
Whenever you poll state, you risk missing the state change you are looking for.
|
||||
If a pressed key is released again before you poll its state, you will have
|
||||
missed the key press. The recommended solution for this is to use a
|
||||
key callback, but there is also the `GLFW_STICKY_KEYS` input mode.
|
||||
|
||||
@code
|
||||
glfwSetInputMode(window, GLFW_STICKY_KEYS, GLFW_TRUE);
|
||||
@endcode
|
||||
|
||||
When sticky keys mode is enabled, the pollable state of a key will remain
|
||||
`GLFW_PRESS` until the state of that key is polled with @ref glfwGetKey. Once
|
||||
it has been polled, if a key release event had been processed in the meantime,
|
||||
the state will reset to `GLFW_RELEASE`, otherwise it will remain `GLFW_PRESS`.
|
||||
|
||||
@anchor GLFW_LOCK_KEY_MODS
|
||||
If you wish to know what the state of the Caps Lock and Num Lock keys was when
|
||||
input events were generated, set the `GLFW_LOCK_KEY_MODS` input mode.
|
||||
|
||||
@code
|
||||
glfwSetInputMode(window, GLFW_LOCK_KEY_MODS, GLFW_TRUE);
|
||||
@endcode
|
||||
|
||||
When this input mode is enabled, any callback that receives
|
||||
[modifier bits](@ref mods) will have the @ref GLFW_MOD_CAPS_LOCK bit set if Caps
|
||||
Lock was on when the event occurred and the @ref GLFW_MOD_NUM_LOCK bit set if
|
||||
Num Lock was on.
|
||||
|
||||
The `GLFW_KEY_LAST` constant holds the highest value of any
|
||||
[named key](@ref keys).
|
||||
|
||||
|
||||
@subsection input_char Text input
|
||||
|
||||
GLFW supports text input in the form of a stream of
|
||||
[Unicode code points](https://en.wikipedia.org/wiki/Unicode), as produced by the
|
||||
operating system text input system. Unlike key input, text input obeys keyboard
|
||||
layouts and modifier keys and supports composing characters using
|
||||
[dead keys](https://en.wikipedia.org/wiki/Dead_key). Once received, you can
|
||||
encode the code points into UTF-8 or any other encoding you prefer.
|
||||
|
||||
Because an `unsigned int` is 32 bits long on all platforms supported by GLFW,
|
||||
you can treat the code point argument as native endian UTF-32.
|
||||
|
||||
If you wish to offer regular text input, set a character callback.
|
||||
|
||||
@code
|
||||
glfwSetCharCallback(window, character_callback);
|
||||
@endcode
|
||||
|
||||
The callback function receives Unicode code points for key events that would
|
||||
have led to regular text input and generally behaves as a standard text field on
|
||||
that platform.
|
||||
|
||||
@code
|
||||
void character_callback(GLFWwindow* window, unsigned int codepoint)
|
||||
{
|
||||
}
|
||||
@endcode
|
||||
|
||||
|
||||
@subsection input_key_name Key names
|
||||
|
||||
If you wish to refer to keys by name, you can query the keyboard layout
|
||||
dependent name of printable keys with @ref glfwGetKeyName.
|
||||
|
||||
@code
|
||||
const char* key_name = glfwGetKeyName(GLFW_KEY_W, 0);
|
||||
show_tutorial_hint("Press %s to move forward", key_name);
|
||||
@endcode
|
||||
|
||||
This function can handle both [keys and scancodes](@ref input_key). If the
|
||||
specified key is `GLFW_KEY_UNKNOWN` then the scancode is used, otherwise it is
|
||||
ignored. This matches the behavior of the key callback, meaning the callback
|
||||
arguments can always be passed unmodified to this function.
|
||||
|
||||
|
||||
@section input_mouse Mouse input
|
||||
|
||||
Mouse input comes in many forms, including mouse motion, button presses and
|
||||
scrolling offsets. The cursor appearance can also be changed, either to
|
||||
a custom image or a standard cursor shape from the system theme.
|
||||
|
||||
|
||||
@subsection cursor_pos Cursor position
|
||||
|
||||
If you wish to be notified when the cursor moves over the window, set a cursor
|
||||
position callback.
|
||||
|
||||
@code
|
||||
glfwSetCursorPosCallback(window, cursor_position_callback);
|
||||
@endcode
|
||||
|
||||
The callback functions receives the cursor position, measured in screen
|
||||
coordinates but relative to the top-left corner of the window content area. On
|
||||
platforms that provide it, the full sub-pixel cursor position is passed on.
|
||||
|
||||
@code
|
||||
static void cursor_position_callback(GLFWwindow* window, double xpos, double ypos)
|
||||
{
|
||||
}
|
||||
@endcode
|
||||
|
||||
The cursor position is also saved per-window and can be polled with @ref
|
||||
glfwGetCursorPos.
|
||||
|
||||
@code
|
||||
double xpos, ypos;
|
||||
glfwGetCursorPos(window, &xpos, &ypos);
|
||||
@endcode
|
||||
|
||||
|
||||
@subsection cursor_mode Cursor mode
|
||||
|
||||
@anchor GLFW_CURSOR
|
||||
The `GLFW_CURSOR` input mode provides several cursor modes for special forms of
|
||||
mouse motion input. By default, the cursor mode is `GLFW_CURSOR_NORMAL`,
|
||||
meaning the regular arrow cursor (or another cursor set with @ref glfwSetCursor)
|
||||
is used and cursor motion is not limited.
|
||||
|
||||
If you wish to implement mouse motion based camera controls or other input
|
||||
schemes that require unlimited mouse movement, set the cursor mode to
|
||||
`GLFW_CURSOR_DISABLED`.
|
||||
|
||||
@code
|
||||
glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_DISABLED);
|
||||
@endcode
|
||||
|
||||
This will hide the cursor and lock it to the specified window. GLFW will then
|
||||
take care of all the details of cursor re-centering and offset calculation and
|
||||
providing the application with a virtual cursor position. This virtual position
|
||||
is provided normally via both the cursor position callback and through polling.
|
||||
|
||||
@note You should not implement your own version of this functionality using
|
||||
other features of GLFW. It is not supported and will not work as robustly as
|
||||
`GLFW_CURSOR_DISABLED`.
|
||||
|
||||
If you only wish the cursor to become hidden when it is over a window but still
|
||||
want it to behave normally, set the cursor mode to `GLFW_CURSOR_HIDDEN`.
|
||||
|
||||
@code
|
||||
glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_HIDDEN);
|
||||
@endcode
|
||||
|
||||
This mode puts no limit on the motion of the cursor.
|
||||
|
||||
If you wish the cursor to be visible but confined to the content area of the
|
||||
window, set the cursor mode to `GLFW_CURSOR_CAPTURED`.
|
||||
|
||||
@code
|
||||
glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_CAPTURED);
|
||||
@endcode
|
||||
|
||||
The cursor will behave normally inside the content area but will not be able to
|
||||
leave unless the window loses focus.
|
||||
|
||||
To exit out of either of these special modes, restore the `GLFW_CURSOR_NORMAL`
|
||||
cursor mode.
|
||||
|
||||
@code
|
||||
glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_NORMAL);
|
||||
@endcode
|
||||
|
||||
If the cursor was disabled, this will move it back to its last visible position.
|
||||
|
||||
|
||||
@anchor GLFW_RAW_MOUSE_MOTION
|
||||
@subsection raw_mouse_motion Raw mouse motion
|
||||
|
||||
When the cursor is disabled, raw (unscaled and unaccelerated) mouse motion can
|
||||
be enabled if available.
|
||||
|
||||
Raw mouse motion is closer to the actual motion of the mouse across a surface.
|
||||
It is not affected by the scaling and acceleration applied to the motion of the
|
||||
desktop cursor. That processing is suitable for a cursor while raw motion is
|
||||
better for controlling for example a 3D camera. Because of this, raw mouse
|
||||
motion is only provided when the cursor is disabled.
|
||||
|
||||
Call @ref glfwRawMouseMotionSupported to check if the current machine provides
|
||||
raw motion and set the `GLFW_RAW_MOUSE_MOTION` input mode to enable it. It is
|
||||
disabled by default.
|
||||
|
||||
@code
|
||||
if (glfwRawMouseMotionSupported())
|
||||
glfwSetInputMode(window, GLFW_RAW_MOUSE_MOTION, GLFW_TRUE);
|
||||
@endcode
|
||||
|
||||
If supported, raw mouse motion can be enabled or disabled per-window and at any
|
||||
time but it will only be provided when the cursor is disabled.
|
||||
|
||||
|
||||
@subsection cursor_object Cursor objects
|
||||
|
||||
GLFW supports creating both custom and system theme cursor images, encapsulated
|
||||
as @ref GLFWcursor objects. They are created with @ref glfwCreateCursor or @ref
|
||||
glfwCreateStandardCursor and destroyed with @ref glfwDestroyCursor, or @ref
|
||||
glfwTerminate, if any remain.
|
||||
|
||||
|
||||
@subsubsection cursor_custom Custom cursor creation
|
||||
|
||||
A custom cursor is created with @ref glfwCreateCursor, which returns a handle to
|
||||
the created cursor object. For example, this creates a 16x16 white square
|
||||
cursor with the hot-spot in the upper-left corner:
|
||||
|
||||
@code
|
||||
unsigned char pixels[16 * 16 * 4];
|
||||
memset(pixels, 0xff, sizeof(pixels));
|
||||
|
||||
GLFWimage image;
|
||||
image.width = 16;
|
||||
image.height = 16;
|
||||
image.pixels = pixels;
|
||||
|
||||
GLFWcursor* cursor = glfwCreateCursor(&image, 0, 0);
|
||||
@endcode
|
||||
|
||||
If cursor creation fails, `NULL` will be returned, so it is necessary to check
|
||||
the return value.
|
||||
|
||||
The image data is 32-bit, little-endian, non-premultiplied RGBA, i.e. eight bits
|
||||
per channel with the red channel first. The pixels are arranged canonically as
|
||||
sequential rows, starting from the top-left corner.
|
||||
|
||||
|
||||
@subsubsection cursor_standard Standard cursor creation
|
||||
|
||||
A cursor with a [standard shape](@ref shapes) from the current system cursor
|
||||
theme can be created with @ref glfwCreateStandardCursor.
|
||||
|
||||
@code
|
||||
GLFWcursor* url_cursor = glfwCreateStandardCursor(GLFW_POINTING_HAND_CURSOR);
|
||||
@endcode
|
||||
|
||||
These cursor objects behave in the exact same way as those created with @ref
|
||||
glfwCreateCursor except that the system cursor theme provides the actual image.
|
||||
|
||||
A few of these shapes are not available everywhere. If a shape is unavailable,
|
||||
`NULL` is returned. See @ref glfwCreateStandardCursor for details.
|
||||
|
||||
|
||||
@subsubsection cursor_destruction Cursor destruction
|
||||
|
||||
When a cursor is no longer needed, destroy it with @ref glfwDestroyCursor.
|
||||
|
||||
@code
|
||||
glfwDestroyCursor(cursor);
|
||||
@endcode
|
||||
|
||||
Cursor destruction always succeeds. If the cursor is current for any window,
|
||||
that window will revert to the default cursor. This does not affect the cursor
|
||||
mode. All remaining cursors are destroyed when @ref glfwTerminate is called.
|
||||
|
||||
|
||||
@subsubsection cursor_set Cursor setting
|
||||
|
||||
A cursor can be set as current for a window with @ref glfwSetCursor.
|
||||
|
||||
@code
|
||||
glfwSetCursor(window, cursor);
|
||||
@endcode
|
||||
|
||||
Once set, the cursor image will be used as long as the system cursor is over the
|
||||
content area of the window and the [cursor mode](@ref cursor_mode) is set
|
||||
to `GLFW_CURSOR_NORMAL`.
|
||||
|
||||
A single cursor may be set for any number of windows.
|
||||
|
||||
To revert to the default cursor, set the cursor of that window to `NULL`.
|
||||
|
||||
@code
|
||||
glfwSetCursor(window, NULL);
|
||||
@endcode
|
||||
|
||||
When a cursor is destroyed, any window that has it set will revert to the
|
||||
default cursor. This does not affect the cursor mode.
|
||||
|
||||
|
||||
@subsection cursor_enter Cursor enter/leave events
|
||||
|
||||
If you wish to be notified when the cursor enters or leaves the content area of
|
||||
a window, set a cursor enter/leave callback.
|
||||
|
||||
@code
|
||||
glfwSetCursorEnterCallback(window, cursor_enter_callback);
|
||||
@endcode
|
||||
|
||||
The callback function receives the new classification of the cursor.
|
||||
|
||||
@code
|
||||
void cursor_enter_callback(GLFWwindow* window, int entered)
|
||||
{
|
||||
if (entered)
|
||||
{
|
||||
// The cursor entered the content area of the window
|
||||
}
|
||||
else
|
||||
{
|
||||
// The cursor left the content area of the window
|
||||
}
|
||||
}
|
||||
@endcode
|
||||
|
||||
You can query whether the cursor is currently inside the content area of the
|
||||
window with the [GLFW_HOVERED](@ref GLFW_HOVERED_attrib) window attribute.
|
||||
|
||||
@code
|
||||
if (glfwGetWindowAttrib(window, GLFW_HOVERED))
|
||||
{
|
||||
highlight_interface();
|
||||
}
|
||||
@endcode
|
||||
|
||||
|
||||
@subsection input_mouse_button Mouse button input
|
||||
|
||||
If you wish to be notified when a mouse button is pressed or released, set
|
||||
a mouse button callback.
|
||||
|
||||
@code
|
||||
glfwSetMouseButtonCallback(window, mouse_button_callback);
|
||||
@endcode
|
||||
|
||||
The callback function receives the [mouse button](@ref buttons), button action
|
||||
and [modifier bits](@ref mods).
|
||||
|
||||
@code
|
||||
void mouse_button_callback(GLFWwindow* window, int button, int action, int mods)
|
||||
{
|
||||
if (button == GLFW_MOUSE_BUTTON_RIGHT && action == GLFW_PRESS)
|
||||
popup_menu();
|
||||
}
|
||||
@endcode
|
||||
|
||||
The action is one of `GLFW_PRESS` or `GLFW_RELEASE`.
|
||||
|
||||
Mouse button states for [named buttons](@ref buttons) are also saved in
|
||||
per-window state arrays that can be polled with @ref glfwGetMouseButton.
|
||||
|
||||
@code
|
||||
int state = glfwGetMouseButton(window, GLFW_MOUSE_BUTTON_LEFT);
|
||||
if (state == GLFW_PRESS)
|
||||
{
|
||||
upgrade_cow();
|
||||
}
|
||||
@endcode
|
||||
|
||||
The returned state is one of `GLFW_PRESS` or `GLFW_RELEASE`.
|
||||
|
||||
This function only returns cached mouse button event state. It does not poll
|
||||
the system for the current state of the mouse button.
|
||||
|
||||
@anchor GLFW_STICKY_MOUSE_BUTTONS
|
||||
Whenever you poll state, you risk missing the state change you are looking for.
|
||||
If a pressed mouse button is released again before you poll its state, you will have
|
||||
missed the button press. The recommended solution for this is to use a
|
||||
mouse button callback, but there is also the `GLFW_STICKY_MOUSE_BUTTONS`
|
||||
input mode.
|
||||
|
||||
@code
|
||||
glfwSetInputMode(window, GLFW_STICKY_MOUSE_BUTTONS, GLFW_TRUE);
|
||||
@endcode
|
||||
|
||||
When sticky mouse buttons mode is enabled, the pollable state of a mouse button
|
||||
will remain `GLFW_PRESS` until the state of that button is polled with @ref
|
||||
glfwGetMouseButton. Once it has been polled, if a mouse button release event
|
||||
had been processed in the meantime, the state will reset to `GLFW_RELEASE`,
|
||||
otherwise it will remain `GLFW_PRESS`.
|
||||
|
||||
The `GLFW_MOUSE_BUTTON_LAST` constant holds the highest value of any
|
||||
[named button](@ref buttons).
|
||||
|
||||
|
||||
@subsection scrolling Scroll input
|
||||
|
||||
If you wish to be notified when the user scrolls, whether with a mouse wheel or
|
||||
touchpad gesture, set a scroll callback.
|
||||
|
||||
@code
|
||||
glfwSetScrollCallback(window, scroll_callback);
|
||||
@endcode
|
||||
|
||||
The callback function receives two-dimensional scroll offsets.
|
||||
|
||||
@code
|
||||
void scroll_callback(GLFWwindow* window, double xoffset, double yoffset)
|
||||
{
|
||||
}
|
||||
@endcode
|
||||
|
||||
A normal mouse wheel, being vertical, provides offsets along the Y-axis.
|
||||
|
||||
|
||||
@section joystick Joystick input
|
||||
|
||||
The joystick functions expose connected joysticks and controllers, with both
|
||||
referred to as joysticks. It supports up to sixteen joysticks, ranging from
|
||||
`GLFW_JOYSTICK_1`, `GLFW_JOYSTICK_2` up to and including `GLFW_JOYSTICK_16` or
|
||||
`GLFW_JOYSTICK_LAST`. You can test whether a [joystick](@ref joysticks) is
|
||||
present with @ref glfwJoystickPresent.
|
||||
|
||||
@code
|
||||
int present = glfwJoystickPresent(GLFW_JOYSTICK_1);
|
||||
@endcode
|
||||
|
||||
Each joystick has zero or more axes, zero or more buttons, zero or more hats,
|
||||
a human-readable name, a user pointer and an SDL compatible GUID.
|
||||
|
||||
Detected joysticks are added to the beginning of the array. Once a joystick is
|
||||
detected, it keeps its assigned ID until it is disconnected or the library is
|
||||
terminated, so as joysticks are connected and disconnected, there may appear
|
||||
gaps in the IDs.
|
||||
|
||||
Joystick axis, button and hat state is updated when polled and does not require
|
||||
a window to be created or events to be processed. However, if you want joystick
|
||||
connection and disconnection events reliably delivered to the
|
||||
[joystick callback](@ref joystick_event) then you must
|
||||
[process events](@ref events).
|
||||
|
||||
To see all the properties of all connected joysticks in real-time, run the
|
||||
`joysticks` test program.
|
||||
|
||||
|
||||
@subsection joystick_axis Joystick axis states
|
||||
|
||||
The positions of all axes of a joystick are returned by @ref
|
||||
glfwGetJoystickAxes. See the reference documentation for the lifetime of the
|
||||
returned array.
|
||||
|
||||
@code
|
||||
int count;
|
||||
const float* axes = glfwGetJoystickAxes(GLFW_JOYSTICK_5, &count);
|
||||
@endcode
|
||||
|
||||
Each element in the returned array is a value between -1.0 and 1.0.
|
||||
|
||||
|
||||
@subsection joystick_button Joystick button states
|
||||
|
||||
The states of all buttons of a joystick are returned by @ref
|
||||
glfwGetJoystickButtons. See the reference documentation for the lifetime of the
|
||||
returned array.
|
||||
|
||||
@code
|
||||
int count;
|
||||
const unsigned char* buttons = glfwGetJoystickButtons(GLFW_JOYSTICK_3, &count);
|
||||
@endcode
|
||||
|
||||
Each element in the returned array is either `GLFW_PRESS` or `GLFW_RELEASE`.
|
||||
|
||||
For backward compatibility with earlier versions that did not have @ref
|
||||
glfwGetJoystickHats, the button array by default also includes all hats. See
|
||||
the reference documentation for @ref glfwGetJoystickButtons for details.
|
||||
|
||||
|
||||
@subsection joystick_hat Joystick hat states
|
||||
|
||||
The states of all hats are returned by @ref glfwGetJoystickHats. See the
|
||||
reference documentation for the lifetime of the returned array.
|
||||
|
||||
@code
|
||||
int count;
|
||||
const unsigned char* hats = glfwGetJoystickHats(GLFW_JOYSTICK_7, &count);
|
||||
@endcode
|
||||
|
||||
Each element in the returned array is one of the following:
|
||||
|
||||
Name | Value
|
||||
---- | -----
|
||||
`GLFW_HAT_CENTERED` | 0
|
||||
`GLFW_HAT_UP` | 1
|
||||
`GLFW_HAT_RIGHT` | 2
|
||||
`GLFW_HAT_DOWN` | 4
|
||||
`GLFW_HAT_LEFT` | 8
|
||||
`GLFW_HAT_RIGHT_UP` | `GLFW_HAT_RIGHT` \| `GLFW_HAT_UP`
|
||||
`GLFW_HAT_RIGHT_DOWN` | `GLFW_HAT_RIGHT` \| `GLFW_HAT_DOWN`
|
||||
`GLFW_HAT_LEFT_UP` | `GLFW_HAT_LEFT` \| `GLFW_HAT_UP`
|
||||
`GLFW_HAT_LEFT_DOWN` | `GLFW_HAT_LEFT` \| `GLFW_HAT_DOWN`
|
||||
|
||||
The diagonal directions are bitwise combinations of the primary (up, right, down
|
||||
and left) directions and you can test for these individually by ANDing it with
|
||||
the corresponding direction.
|
||||
|
||||
@code
|
||||
if (hats[2] & GLFW_HAT_RIGHT)
|
||||
{
|
||||
// State of hat 2 could be right-up, right or right-down
|
||||
}
|
||||
@endcode
|
||||
|
||||
For backward compatibility with earlier versions that did not have @ref
|
||||
glfwGetJoystickHats, all hats are by default also included in the button array.
|
||||
See the reference documentation for @ref glfwGetJoystickButtons for details.
|
||||
|
||||
|
||||
@subsection joystick_name Joystick name
|
||||
|
||||
The human-readable, UTF-8 encoded name of a joystick is returned by @ref
|
||||
glfwGetJoystickName. See the reference documentation for the lifetime of the
|
||||
returned string.
|
||||
|
||||
@code
|
||||
const char* name = glfwGetJoystickName(GLFW_JOYSTICK_4);
|
||||
@endcode
|
||||
|
||||
Joystick names are not guaranteed to be unique. Two joysticks of the same model
|
||||
and make may have the same name. Only the [joystick ID](@ref joysticks) is
|
||||
guaranteed to be unique, and only until that joystick is disconnected.
|
||||
|
||||
|
||||
@subsection joystick_userptr Joystick user pointer
|
||||
|
||||
Each joystick has a user pointer that can be set with @ref
|
||||
glfwSetJoystickUserPointer and queried with @ref glfwGetJoystickUserPointer.
|
||||
This can be used for any purpose you need and will not be modified by GLFW. The
|
||||
value will be kept until the joystick is disconnected or until the library is
|
||||
terminated.
|
||||
|
||||
The initial value of the pointer is `NULL`.
|
||||
|
||||
|
||||
@subsection joystick_event Joystick configuration changes
|
||||
|
||||
If you wish to be notified when a joystick is connected or disconnected, set
|
||||
a joystick callback.
|
||||
|
||||
@code
|
||||
glfwSetJoystickCallback(joystick_callback);
|
||||
@endcode
|
||||
|
||||
The callback function receives the ID of the joystick that has been connected
|
||||
and disconnected and the event that occurred.
|
||||
|
||||
@code
|
||||
void joystick_callback(int jid, int event)
|
||||
{
|
||||
if (event == GLFW_CONNECTED)
|
||||
{
|
||||
// The joystick was connected
|
||||
}
|
||||
else if (event == GLFW_DISCONNECTED)
|
||||
{
|
||||
// The joystick was disconnected
|
||||
}
|
||||
}
|
||||
@endcode
|
||||
|
||||
For joystick connection and disconnection events to be delivered on all
|
||||
platforms, you need to call one of the [event processing](@ref events)
|
||||
functions. Joystick disconnection may also be detected and the callback
|
||||
called by joystick functions. The function will then return whatever it
|
||||
returns for a disconnected joystick.
|
||||
|
||||
Only @ref glfwGetJoystickName and @ref glfwGetJoystickUserPointer will return
|
||||
useful values for a disconnected joystick and only before the monitor callback
|
||||
returns.
|
||||
|
||||
|
||||
@subsection gamepad Gamepad input
|
||||
|
||||
The joystick functions provide unlabeled axes, buttons and hats, with no
|
||||
indication of where they are located on the device. Their order may also vary
|
||||
between platforms even with the same device.
|
||||
|
||||
To solve this problem the SDL community crowdsourced the
|
||||
[SDL_GameControllerDB](https://github.com/gabomdq/SDL_GameControllerDB) project,
|
||||
a database of mappings from many different devices to an Xbox-like gamepad.
|
||||
|
||||
GLFW supports this mapping format and contains a copy of the mappings
|
||||
available at the time of release. See @ref gamepad_mapping for how to update
|
||||
this at runtime. Mappings will be assigned to joysticks automatically any time
|
||||
a joystick is connected or the mappings are updated.
|
||||
|
||||
You can check whether a joystick is both present and has a gamepad mapping with
|
||||
@ref glfwJoystickIsGamepad.
|
||||
|
||||
@code
|
||||
if (glfwJoystickIsGamepad(GLFW_JOYSTICK_2))
|
||||
{
|
||||
// Use as gamepad
|
||||
}
|
||||
@endcode
|
||||
|
||||
If you are only interested in gamepad input you can use this function instead of
|
||||
@ref glfwJoystickPresent.
|
||||
|
||||
You can query the human-readable name provided by the gamepad mapping with @ref
|
||||
glfwGetGamepadName. This may or may not be the same as the
|
||||
[joystick name](@ref joystick_name).
|
||||
|
||||
@code
|
||||
const char* name = glfwGetGamepadName(GLFW_JOYSTICK_7);
|
||||
@endcode
|
||||
|
||||
To retrieve the gamepad state of a joystick, call @ref glfwGetGamepadState.
|
||||
|
||||
@code
|
||||
GLFWgamepadstate state;
|
||||
|
||||
if (glfwGetGamepadState(GLFW_JOYSTICK_3, &state))
|
||||
{
|
||||
if (state.buttons[GLFW_GAMEPAD_BUTTON_A])
|
||||
{
|
||||
input_jump();
|
||||
}
|
||||
|
||||
input_speed(state.axes[GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER]);
|
||||
}
|
||||
@endcode
|
||||
|
||||
The @ref GLFWgamepadstate struct has two arrays; one for button states and one
|
||||
for axis states. The values for each button and axis are the same as for the
|
||||
@ref glfwGetJoystickButtons and @ref glfwGetJoystickAxes functions, i.e.
|
||||
`GLFW_PRESS` or `GLFW_RELEASE` for buttons and -1.0 to 1.0 inclusive for axes.
|
||||
|
||||
The sizes of the arrays and the positions within each array are fixed.
|
||||
|
||||
The [button indices](@ref gamepad_buttons) are `GLFW_GAMEPAD_BUTTON_A`,
|
||||
`GLFW_GAMEPAD_BUTTON_B`, `GLFW_GAMEPAD_BUTTON_X`, `GLFW_GAMEPAD_BUTTON_Y`,
|
||||
`GLFW_GAMEPAD_BUTTON_LEFT_BUMPER`, `GLFW_GAMEPAD_BUTTON_RIGHT_BUMPER`,
|
||||
`GLFW_GAMEPAD_BUTTON_BACK`, `GLFW_GAMEPAD_BUTTON_START`,
|
||||
`GLFW_GAMEPAD_BUTTON_GUIDE`, `GLFW_GAMEPAD_BUTTON_LEFT_THUMB`,
|
||||
`GLFW_GAMEPAD_BUTTON_RIGHT_THUMB`, `GLFW_GAMEPAD_BUTTON_DPAD_UP`,
|
||||
`GLFW_GAMEPAD_BUTTON_DPAD_RIGHT`, `GLFW_GAMEPAD_BUTTON_DPAD_DOWN` and
|
||||
`GLFW_GAMEPAD_BUTTON_DPAD_LEFT`.
|
||||
|
||||
For those who prefer, there are also the `GLFW_GAMEPAD_BUTTON_CROSS`,
|
||||
`GLFW_GAMEPAD_BUTTON_CIRCLE`, `GLFW_GAMEPAD_BUTTON_SQUARE` and
|
||||
`GLFW_GAMEPAD_BUTTON_TRIANGLE` aliases for the A, B, X and Y button indices.
|
||||
|
||||
The [axis indices](@ref gamepad_axes) are `GLFW_GAMEPAD_AXIS_LEFT_X`,
|
||||
`GLFW_GAMEPAD_AXIS_LEFT_Y`, `GLFW_GAMEPAD_AXIS_RIGHT_X`,
|
||||
`GLFW_GAMEPAD_AXIS_RIGHT_Y`, `GLFW_GAMEPAD_AXIS_LEFT_TRIGGER` and
|
||||
`GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER`.
|
||||
|
||||
The `GLFW_GAMEPAD_BUTTON_LAST` and `GLFW_GAMEPAD_AXIS_LAST` constants equal
|
||||
the largest available index for each array.
|
||||
|
||||
|
||||
@subsection gamepad_mapping Gamepad mappings
|
||||
|
||||
GLFW contains a copy of the mappings available in
|
||||
[SDL_GameControllerDB](https://github.com/gabomdq/SDL_GameControllerDB) at the
|
||||
time of release. Newer ones can be added at runtime with @ref
|
||||
glfwUpdateGamepadMappings.
|
||||
|
||||
@code
|
||||
const char* mappings = load_file_contents("game/data/gamecontrollerdb.txt");
|
||||
|
||||
glfwUpdateGamepadMappings(mappings);
|
||||
@endcode
|
||||
|
||||
This function supports everything from single lines up to and including the
|
||||
unmodified contents of the whole `gamecontrollerdb.txt` file.
|
||||
|
||||
If you are compiling GLFW from source with CMake you can update the built-in mappings by
|
||||
building the _update_mappings_ target. This runs the `GenerateMappings.cmake` CMake
|
||||
script, which downloads `gamecontrollerdb.txt` and regenerates the `mappings.h` header
|
||||
file.
|
||||
|
||||
Below is a description of the mapping format. Please keep in mind that __this
|
||||
description is not authoritative__. The format is defined by the SDL and
|
||||
SDL_GameControllerDB projects and their documentation and code takes precedence.
|
||||
|
||||
Each mapping is a single line of comma-separated values describing the GUID,
|
||||
name and layout of the gamepad. Lines that do not begin with a hexadecimal
|
||||
digit are ignored.
|
||||
|
||||
The first value is always the gamepad GUID, a 32 character long hexadecimal
|
||||
string that typically identifies its make, model, revision and the type of
|
||||
connection to the computer. When this information is not available, the GUID is
|
||||
generated using the gamepad name. GLFW uses the SDL 2.0.5+ GUID format but can
|
||||
convert from the older formats.
|
||||
|
||||
The second value is always the human-readable name of the gamepad.
|
||||
|
||||
All subsequent values are in the form `<field>:<value>` and describe the layout
|
||||
of the mapping. These fields may not all be present and may occur in any order.
|
||||
|
||||
The button fields are `a`, `b`, `x`, `y`, `back`, `start`, `guide`, `dpup`,
|
||||
`dpright`, `dpdown`, `dpleft`, `leftshoulder`, `rightshoulder`, `leftstick` and
|
||||
`rightstick`.
|
||||
|
||||
The axis fields are `leftx`, `lefty`, `rightx`, `righty`, `lefttrigger` and
|
||||
`righttrigger`.
|
||||
|
||||
The value of an axis or button field can be a joystick button, a joystick axis,
|
||||
a hat bitmask or empty. Joystick buttons are specified as `bN`, for example
|
||||
`b2` for the third button. Joystick axes are specified as `aN`, for example
|
||||
`a7` for the eighth button. Joystick hat bit masks are specified as `hN.N`, for
|
||||
example `h0.8` for left on the first hat. More than one bit may be set in the
|
||||
mask.
|
||||
|
||||
Before an axis there may be a `+` or `-` range modifier, for example `+a3` for
|
||||
the positive half of the fourth axis. This restricts input to only the positive
|
||||
or negative halves of the joystick axis. After an axis or half-axis there may
|
||||
be the `~` inversion modifier, for example `a2~` or `-a7~`. This negates the
|
||||
values of the gamepad axis.
|
||||
|
||||
The hat bit mask match the [hat states](@ref hat_state) in the joystick
|
||||
functions.
|
||||
|
||||
There is also the special `platform` field that specifies which platform the
|
||||
mapping is valid for. Possible values are `Windows`, `Mac OS X` and `Linux`.
|
||||
|
||||
Below is an example of what a gamepad mapping might look like. It is the
|
||||
one built into GLFW for Xbox controllers accessed via the XInput API on Windows.
|
||||
This example has been broken into several lines to fit on the page, but real
|
||||
gamepad mappings must be a single line.
|
||||
|
||||
@code{.unparsed}
|
||||
78696e70757401000000000000000000,XInput Gamepad (GLFW),platform:Windows,a:b0,
|
||||
b:b1,x:b2,y:b3,leftshoulder:b4,rightshoulder:b5,back:b6,start:b7,leftstick:b8,
|
||||
rightstick:b9,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,
|
||||
righttrigger:a5,dpup:h0.1,dpright:h0.2,dpdown:h0.4,dpleft:h0.8,
|
||||
@endcode
|
||||
|
||||
@note GLFW does not yet support the output range and modifiers `+` and `-` that
|
||||
were recently added to SDL. The input modifiers `+`, `-` and `~` are supported
|
||||
and described above.
|
||||
|
||||
|
||||
@section time Time input
|
||||
|
||||
GLFW provides high-resolution time input, in seconds, with @ref glfwGetTime.
|
||||
|
||||
@code
|
||||
double seconds = glfwGetTime();
|
||||
@endcode
|
||||
|
||||
It returns the number of seconds since the library was initialized with @ref
|
||||
glfwInit. The platform-specific time sources used typically have micro- or
|
||||
nanosecond resolution.
|
||||
|
||||
You can modify the base time with @ref glfwSetTime.
|
||||
|
||||
@code
|
||||
glfwSetTime(4.0);
|
||||
@endcode
|
||||
|
||||
This sets the time to the specified time, in seconds, and it continues to count
|
||||
from there.
|
||||
|
||||
You can also access the raw timer used to implement the functions above,
|
||||
with @ref glfwGetTimerValue.
|
||||
|
||||
@code
|
||||
uint64_t value = glfwGetTimerValue();
|
||||
@endcode
|
||||
|
||||
This value is in 1 / frequency seconds. The frequency of the raw
|
||||
timer varies depending on the operating system and hardware. You can query the
|
||||
frequency, in Hz, with @ref glfwGetTimerFrequency.
|
||||
|
||||
@code
|
||||
uint64_t frequency = glfwGetTimerFrequency();
|
||||
@endcode
|
||||
|
||||
|
||||
@section clipboard Clipboard input and output
|
||||
|
||||
If the system clipboard contains a UTF-8 encoded string or if it can be
|
||||
converted to one, you can retrieve it with @ref glfwGetClipboardString. See the
|
||||
reference documentation for the lifetime of the returned string.
|
||||
|
||||
@code
|
||||
const char* text = glfwGetClipboardString(NULL);
|
||||
if (text)
|
||||
{
|
||||
insert_text(text);
|
||||
}
|
||||
@endcode
|
||||
|
||||
If the clipboard is empty or if its contents could not be converted, `NULL` is
|
||||
returned.
|
||||
|
||||
The contents of the system clipboard can be set to a UTF-8 encoded string with
|
||||
@ref glfwSetClipboardString.
|
||||
|
||||
@code
|
||||
glfwSetClipboardString(NULL, "A string with words in it");
|
||||
@endcode
|
||||
|
||||
|
||||
@section path_drop Path drop input
|
||||
|
||||
If you wish to receive the paths of files and/or directories dropped on
|
||||
a window, set a file drop callback.
|
||||
|
||||
@code
|
||||
glfwSetDropCallback(window, drop_callback);
|
||||
@endcode
|
||||
|
||||
The callback function receives an array of paths encoded as UTF-8.
|
||||
|
||||
@code
|
||||
void drop_callback(GLFWwindow* window, int count, const char** paths)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < count; i++)
|
||||
handle_dropped_file(paths[i]);
|
||||
}
|
||||
@endcode
|
||||
|
||||
The path array and its strings are only valid until the file drop callback
|
||||
returns, as they may have been generated specifically for that event. You need
|
||||
to make a deep copy of the array if you want to keep the paths.
|
||||
|
||||
*/
|
|
@ -1,6 +1,6 @@
|
|||
/*!
|
||||
|
||||
@page internals Internal structure
|
||||
@page internals_guide Internal structure
|
||||
|
||||
@tableofcontents
|
||||
|
||||
|
@ -19,8 +19,7 @@ The public interface uses the OpenGL naming conventions except with GLFW and
|
|||
glfw instead of GL and gl. For struct members, where OpenGL sets no precedent,
|
||||
it use headless camel case.
|
||||
|
||||
Examples: @ref glfwCreateWindow, @ref GLFWwindow, @ref GLFWvidmode.redBits,
|
||||
`GLFW_RED_BITS`
|
||||
Examples: `glfwCreateWindow`, `GLFWwindow`, `GLFW_RED_BITS`
|
||||
|
||||
|
||||
@section internals_native Native interface
|
||||
|
@ -34,7 +33,7 @@ The function names of the native interface are similar to those of the public
|
|||
interface, but embeds the name of the interface that the returned handle is
|
||||
from.
|
||||
|
||||
Examples: @ref glfwGetX11Window, @ref glfwGetWGLContext
|
||||
Examples: `glfwGetX11Window`, `glfwGetWGLContext`
|
||||
|
||||
|
||||
@section internals_internal Internal interface
|
||||
|
@ -50,24 +49,33 @@ a `_GLFWlibrary` struct named `_glfw`.
|
|||
The internal interface uses the same style as the public interface, except all
|
||||
global names have a leading underscore.
|
||||
|
||||
Examples: @ref _glfwIsValidContextConfig, @ref _GLFWwindow, `_glfw.currentRamp`
|
||||
Examples: `_glfwIsValidContextConfig`, `_GLFWwindow`, `_glfw.monitorCount`
|
||||
|
||||
|
||||
@section internals_platform Platform interface
|
||||
|
||||
The platform interface implements all platform-specific operations as a service
|
||||
to the public interface. This includes event processing. The platform
|
||||
interface is never directly called by users of GLFW and never directly calls the
|
||||
user's code. It is also prohibited from modifying the platform-independent part
|
||||
of the internal structs. Instead, it calls the event interface when events
|
||||
interesting to GLFW are received.
|
||||
interface is never directly called by application code and never directly calls
|
||||
application-provided callbacks. It is also prohibited from modifying the
|
||||
platform-independent part of the internal structs. Instead, it calls the event
|
||||
interface when events interesting to GLFW are received.
|
||||
|
||||
The platform interface mirrors those parts of the public interface that needs to
|
||||
perform platform-specific operations on some or all platforms. The are also
|
||||
named the same except that the glfw function prefix is replaced by
|
||||
_glfwPlatform.
|
||||
The platform interface mostly mirrors those parts of the public interface that needs to
|
||||
perform platform-specific operations on some or all platforms.
|
||||
|
||||
Examples: @ref _glfwPlatformCreateWindow
|
||||
The window system bits of the platform API is called through the `_GLFWplatform` struct of
|
||||
function pointers, to allow runtime selection of platform. This includes the window and
|
||||
context creation, input and event processing, monitor and Vulkan surface creation parts of
|
||||
GLFW. This is located in the global `_glfw` struct.
|
||||
|
||||
Examples: `_glfw.platform.createWindow`
|
||||
|
||||
The timer, threading and module loading bits of the platform API are plain functions with
|
||||
a `_glfwPlatform` prefix, as these things are independent of what window system is being
|
||||
used.
|
||||
|
||||
Examples: `_glfwPlatformGetTimerValue`
|
||||
|
||||
The platform interface also defines structs that contain platform-specific
|
||||
global and per-object state. Their names mirror those of the internal
|
||||
|
@ -79,19 +87,19 @@ These structs are incorporated as members into the internal interface structs
|
|||
using special macros that name them after the specific interface used. This
|
||||
prevents shared code from accidentally using these members.
|
||||
|
||||
Examples: `window.win32.handle`, `_glfw.x11.display`
|
||||
Examples: `window->win32.handle`, `_glfw.x11.display`
|
||||
|
||||
|
||||
@section internals_event Event interface
|
||||
|
||||
The event interface is implemented in the same shared source files as the public
|
||||
interface and is responsible for delivering the events it receives to the user,
|
||||
either via callbacks, via window state changes or both.
|
||||
interface and is responsible for delivering the events it receives to the
|
||||
application, either via callbacks, via window state changes or both.
|
||||
|
||||
The function names of the event interface use a `_glfwInput` prefix and the
|
||||
ObjectEvent pattern.
|
||||
|
||||
Examples: @ref _glfwInputWindowFocus, @ref _glfwInputCursorMotion
|
||||
Examples: `_glfwInputWindowFocus`, `_glfwInputCursorPos`
|
||||
|
||||
|
||||
@section internals_static Static functions
|
||||
|
@ -99,18 +107,17 @@ Examples: @ref _glfwInputWindowFocus, @ref _glfwInputCursorMotion
|
|||
Static functions may be used by any interface and have no prefixes or suffixes.
|
||||
These use headless camel case.
|
||||
|
||||
Examples: `clearScrollOffsets`
|
||||
Examples: `isValidElementForJoystick`
|
||||
|
||||
|
||||
@section internals_config Configuration macros
|
||||
|
||||
GLFW uses a number of configuration macros to select at compile time which
|
||||
interfaces and code paths to use. They are defined in the config.h header file,
|
||||
which is generated from the `config.h.in` file by CMake.
|
||||
interfaces and code paths to use. They are defined in the GLFW CMake target.
|
||||
|
||||
Configuration macros the same style as tokens in the public interface, except
|
||||
with a leading underscore.
|
||||
|
||||
Examples: `_GLFW_HAS_GLXGETPROCADDRESS`
|
||||
Examples: `_GLFW_WIN32`, `_GLFW_BUILD_DLL`
|
||||
|
||||
*/
|
||||
|
|
629
docs/intro.dox
Normal file
629
docs/intro.dox
Normal file
|
@ -0,0 +1,629 @@
|
|||
/*!
|
||||
|
||||
@page intro_guide Introduction to the API
|
||||
|
||||
@tableofcontents
|
||||
|
||||
This guide introduces the basic concepts of GLFW and describes initialization,
|
||||
error handling and API guarantees and limitations. For a broad but shallow
|
||||
tutorial, see @ref quick_guide instead. For details on a specific function in
|
||||
this category, see the @ref init.
|
||||
|
||||
There are also guides for the other areas of GLFW.
|
||||
|
||||
- @ref window_guide
|
||||
- @ref context_guide
|
||||
- @ref vulkan_guide
|
||||
- @ref monitor_guide
|
||||
- @ref input_guide
|
||||
|
||||
|
||||
@section intro_init Initialization and termination
|
||||
|
||||
Before most GLFW functions may be called, the library must be initialized.
|
||||
This initialization checks what features are available on the machine,
|
||||
enumerates monitors, initializes the timer and performs any required
|
||||
platform-specific initialization.
|
||||
|
||||
Only the following functions may be called before the library has been
|
||||
successfully initialized, and only from the main thread.
|
||||
|
||||
- @ref glfwGetVersion
|
||||
- @ref glfwGetVersionString
|
||||
- @ref glfwPlatformSupported
|
||||
- @ref glfwGetError
|
||||
- @ref glfwSetErrorCallback
|
||||
- @ref glfwInitHint
|
||||
- @ref glfwInitAllocator
|
||||
- @ref glfwInitVulkanLoader
|
||||
- @ref glfwInit
|
||||
- @ref glfwTerminate
|
||||
|
||||
Calling any other function before successful initialization will cause a @ref
|
||||
GLFW_NOT_INITIALIZED error.
|
||||
|
||||
|
||||
@subsection intro_init_init Initializing GLFW
|
||||
|
||||
The library is initialized with @ref glfwInit, which returns `GLFW_FALSE` if an
|
||||
error occurred.
|
||||
|
||||
@code
|
||||
if (!glfwInit())
|
||||
{
|
||||
// Handle initialization failure
|
||||
}
|
||||
@endcode
|
||||
|
||||
If any part of initialization fails, any parts that succeeded are terminated as
|
||||
if @ref glfwTerminate had been called. The library only needs to be initialized
|
||||
once and additional calls to an already initialized library will return
|
||||
`GLFW_TRUE` immediately.
|
||||
|
||||
Once the library has been successfully initialized, it should be terminated
|
||||
before the application exits. Modern systems are very good at freeing resources
|
||||
allocated by programs that exit, but GLFW sometimes has to change global system
|
||||
settings and these might not be restored without termination.
|
||||
|
||||
@macos When the library is initialized the main menu and dock icon are created.
|
||||
These are not desirable for a command-line only program. The creation of the
|
||||
main menu and dock icon can be disabled with the @ref GLFW_COCOA_MENUBAR init
|
||||
hint.
|
||||
|
||||
|
||||
@subsection init_hints Initialization hints
|
||||
|
||||
Initialization hints are set before @ref glfwInit and affect how the library
|
||||
behaves until termination. Hints are set with @ref glfwInitHint.
|
||||
|
||||
@code
|
||||
glfwInitHint(GLFW_JOYSTICK_HAT_BUTTONS, GLFW_FALSE);
|
||||
@endcode
|
||||
|
||||
The values you set hints to are never reset by GLFW, but they only take effect
|
||||
during initialization. Once GLFW has been initialized, any values you set will
|
||||
be ignored until the library is terminated and initialized again.
|
||||
|
||||
Some hints are platform specific. These may be set on any platform but they
|
||||
will only affect their specific platform. Other platforms will ignore them.
|
||||
Setting these hints requires no platform specific headers or functions.
|
||||
|
||||
|
||||
@subsubsection init_hints_shared Shared init hints
|
||||
|
||||
@anchor GLFW_PLATFORM
|
||||
__GLFW_PLATFORM__ specifies the platform to use for windowing and input.
|
||||
Possible values are `GLFW_ANY_PLATFORM`, `GLFW_PLATFORM_WIN32`,
|
||||
`GLFW_PLATFORM_COCOA`, `GLFW_PLATFORM_X11`, `GLFW_PLATFORM_WAYLAND` and
|
||||
`GLFW_PLATFORM_NULL`. The default value is `GLFW_ANY_PLATFORM`, which will
|
||||
choose any platform the library includes support for except for the Null
|
||||
backend.
|
||||
|
||||
|
||||
@anchor GLFW_JOYSTICK_HAT_BUTTONS
|
||||
__GLFW_JOYSTICK_HAT_BUTTONS__ specifies whether to also expose joystick hats as
|
||||
buttons, for compatibility with earlier versions of GLFW that did not have @ref
|
||||
glfwGetJoystickHats. Possible values are `GLFW_TRUE` and `GLFW_FALSE`.
|
||||
|
||||
@anchor GLFW_ANGLE_PLATFORM_TYPE_hint
|
||||
__GLFW_ANGLE_PLATFORM_TYPE__ specifies the platform type (rendering backend) to
|
||||
request when using OpenGL ES and EGL via
|
||||
[ANGLE](https://chromium.googlesource.com/angle/angle/). If the requested
|
||||
platform type is unavailable, ANGLE will use its default. Possible values are
|
||||
one of `GLFW_ANGLE_PLATFORM_TYPE_NONE`, `GLFW_ANGLE_PLATFORM_TYPE_OPENGL`,
|
||||
`GLFW_ANGLE_PLATFORM_TYPE_OPENGLES`, `GLFW_ANGLE_PLATFORM_TYPE_D3D9`,
|
||||
`GLFW_ANGLE_PLATFORM_TYPE_D3D11`, `GLFW_ANGLE_PLATFORM_TYPE_VULKAN` and
|
||||
`GLFW_ANGLE_PLATFORM_TYPE_METAL`.
|
||||
|
||||
The ANGLE platform type is specified via the `EGL_ANGLE_platform_angle`
|
||||
extension. This extension is not used if this hint is
|
||||
`GLFW_ANGLE_PLATFORM_TYPE_NONE`, which is the default value.
|
||||
|
||||
|
||||
@subsubsection init_hints_osx macOS specific init hints
|
||||
|
||||
@anchor GLFW_COCOA_CHDIR_RESOURCES_hint
|
||||
__GLFW_COCOA_CHDIR_RESOURCES__ specifies whether to set the current directory to
|
||||
the application to the `Contents/Resources` subdirectory of the application's
|
||||
bundle, if present. Possible values are `GLFW_TRUE` and `GLFW_FALSE`. This is
|
||||
ignored on other platforms.
|
||||
|
||||
@anchor GLFW_COCOA_MENUBAR_hint
|
||||
__GLFW_COCOA_MENUBAR__ specifies whether to create the menu bar and dock icon
|
||||
when GLFW is initialized. This applies whether the menu bar is created from
|
||||
a nib or manually by GLFW. Possible values are `GLFW_TRUE` and `GLFW_FALSE`.
|
||||
This is ignored on other platforms.
|
||||
|
||||
|
||||
@subsubsection init_hints_x11 X11 specific init hints
|
||||
|
||||
@anchor GLFW_X11_XCB_VULKAN_SURFACE_hint
|
||||
__GLFW_X11_XCB_VULKAN_SURFACE__ specifies whether to prefer the
|
||||
`VK_KHR_xcb_surface` extension for creating Vulkan surfaces, or whether to use
|
||||
the `VK_KHR_xlib_surface` extension. Possible values are `GLFW_TRUE` and
|
||||
`GLFW_FALSE`. This is ignored on other platforms.
|
||||
|
||||
|
||||
@subsubsection init_hints_wayland Wayland specific init hints
|
||||
|
||||
@anchor GLFW_WAYLAND_LIBDECOR_hint
|
||||
__GLFW_WAYLAND_LIBDECOR__ specifies whether to use
|
||||
[libdecor](https://gitlab.freedesktop.org/libdecor/libdecor) for window
|
||||
decorations where available. Possible values are `GLFW_WAYLAND_PREFER_LIBDECOR`
|
||||
and `GLFW_WAYLAND_DISABLE_LIBDECOR`. This is ignored on other platforms.
|
||||
|
||||
|
||||
@subsubsection init_hints_values Supported and default values
|
||||
|
||||
Initialization hint | Default value | Supported values
|
||||
-------------------------------- | ------------------------------- | ----------------
|
||||
@ref GLFW_PLATFORM | `GLFW_ANY_PLATFORM` | `GLFW_ANY_PLATFORM`, `GLFW_PLATFORM_WIN32`, `GLFW_PLATFORM_COCOA`, `GLFW_PLATFORM_X11`, `GLFW_PLATFORM_WAYLAND` or `GLFW_PLATFORM_NULL`
|
||||
@ref GLFW_JOYSTICK_HAT_BUTTONS | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE`
|
||||
@ref GLFW_ANGLE_PLATFORM_TYPE | `GLFW_ANGLE_PLATFORM_TYPE_NONE` | `GLFW_ANGLE_PLATFORM_TYPE_NONE`, `GLFW_ANGLE_PLATFORM_TYPE_OPENGL`, `GLFW_ANGLE_PLATFORM_TYPE_OPENGLES`, `GLFW_ANGLE_PLATFORM_TYPE_D3D9`, `GLFW_ANGLE_PLATFORM_TYPE_D3D11`, `GLFW_ANGLE_PLATFORM_TYPE_VULKAN` or `GLFW_ANGLE_PLATFORM_TYPE_METAL`
|
||||
@ref GLFW_COCOA_CHDIR_RESOURCES | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE`
|
||||
@ref GLFW_COCOA_MENUBAR | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE`
|
||||
@ref GLFW_X11_XCB_VULKAN_SURFACE | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE`
|
||||
@ref GLFW_WAYLAND_LIBDECOR | `GLFW_WAYLAND_PREFER_LIBDECOR` | `GLFW_WAYLAND_PREFER_LIBDECOR` or `GLFW_WAYLAND_DISABLE_LIBDECOR`
|
||||
|
||||
|
||||
@subsection platform Runtime platform selection
|
||||
|
||||
GLFW can be compiled for more than one platform (window system) at once. This lets
|
||||
a single library binary support both X11 and Wayland on Linux and other Unix-like systems.
|
||||
|
||||
You can control platform selection via the @ref GLFW_PLATFORM initialization hint. By
|
||||
default, this is set to @ref GLFW_ANY_PLATFORM, which will look for supported window
|
||||
systems in order of priority and select the first one it finds. It can also be set to any
|
||||
specific platform to have GLFW only look for that one.
|
||||
|
||||
@code
|
||||
glfwInitHint(GLFW_PLATFORM, GLFW_PLATFORM_X11);
|
||||
@endcode
|
||||
|
||||
This mechanism also provides the Null platform, which is always supported but needs to be
|
||||
explicitly requested. This platform is effectively a stub, emulating a window system on
|
||||
a single 1080p monitor, but will not interact with any actual window system.
|
||||
|
||||
@code
|
||||
glfwInitHint(GLFW_PLATFORM, GLFW_PLATFORM_NULL);
|
||||
@endcode
|
||||
|
||||
You can test whether a library binary was compiled with support for a specific platform
|
||||
with @ref glfwPlatformSupported.
|
||||
|
||||
@code
|
||||
if (glfwPlatformSupported(GLFW_PLATFORM_WAYLAND))
|
||||
glfwInitHint(GLFW_PLATFORM, GLFW_PLATFORM_WAYLAND);
|
||||
@endcode
|
||||
|
||||
Once GLFW has been initialized, you can query which platform was selected with @ref
|
||||
glfwGetPlatform.
|
||||
|
||||
@code
|
||||
int platform = glfwGetPlatform();
|
||||
@endcode
|
||||
|
||||
If you are using any [native access functions](@ref native), especially on Linux and other
|
||||
Unix-like systems, then you may need to check that you are calling the ones matching the
|
||||
selected platform.
|
||||
|
||||
|
||||
@subsection init_allocator Custom heap memory allocator
|
||||
|
||||
The heap memory allocator can be customized before initialization with @ref
|
||||
glfwInitAllocator.
|
||||
|
||||
@code
|
||||
GLFWallocator allocator;
|
||||
allocator.allocate = my_malloc;
|
||||
allocator.reallocate = my_realloc;
|
||||
allocator.deallocate = my_free;
|
||||
allocator.user = NULL;
|
||||
|
||||
glfwInitAllocator(&allocator);
|
||||
@endcode
|
||||
|
||||
The allocator will be picked up at the beginning of initialization and will be
|
||||
used until GLFW has been fully terminated. Any allocator set after
|
||||
initialization will be picked up only at the next initialization.
|
||||
|
||||
The allocator will only be used for allocations that would have been made with
|
||||
the C standard library. Memory allocations that must be made with platform
|
||||
specific APIs will still use those.
|
||||
|
||||
The allocation function must have a signature matching @ref GLFWallocatefun. It receives
|
||||
the desired size, in bytes, and the user pointer passed to @ref glfwInitAllocator and
|
||||
returns the address to the allocated memory block.
|
||||
|
||||
@code
|
||||
void* my_malloc(size_t size, void* user)
|
||||
{
|
||||
...
|
||||
}
|
||||
@endcode
|
||||
|
||||
The reallocation function must have a function signature matching @ref GLFWreallocatefun.
|
||||
It receives the memory block to be reallocated, the new desired size, in bytes, and the user
|
||||
pointer passed to @ref glfwInitAllocator and returns the address to the resized memory
|
||||
block.
|
||||
|
||||
@code
|
||||
void* my_realloc(void* block, size_t size, void* user)
|
||||
{
|
||||
...
|
||||
}
|
||||
@endcode
|
||||
|
||||
The deallocation function must have a function signature matching @ref GLFWdeallocatefun.
|
||||
It receives the memory block to be deallocated and the user pointer passed to @ref
|
||||
glfwInitAllocator.
|
||||
|
||||
@code
|
||||
void my_free(void* block, void* user)
|
||||
{
|
||||
...
|
||||
}
|
||||
@endcode
|
||||
|
||||
|
||||
@subsection intro_init_terminate Terminating GLFW
|
||||
|
||||
Before your application exits, you should terminate the GLFW library if it has
|
||||
been initialized. This is done with @ref glfwTerminate.
|
||||
|
||||
@code
|
||||
glfwTerminate();
|
||||
@endcode
|
||||
|
||||
This will destroy any remaining window, monitor and cursor objects, restore any
|
||||
modified gamma ramps, re-enable the screensaver if it had been disabled and free
|
||||
any other resources allocated by GLFW.
|
||||
|
||||
Once the library is terminated, it is as if it had never been initialized, therefore
|
||||
you will need to initialize it again before being able to use GLFW. If the
|
||||
library was not initialized or had already been terminated, it returns
|
||||
immediately.
|
||||
|
||||
|
||||
@section error_handling Error handling
|
||||
|
||||
Some GLFW functions have return values that indicate an error, but this is often
|
||||
not very helpful when trying to figure out what happened or why it occurred.
|
||||
Other functions have no return value reserved for errors, so error notification
|
||||
needs a separate channel. Finally, far from all GLFW functions have return
|
||||
values.
|
||||
|
||||
The last [error code](@ref errors) for the calling thread can be queried at any
|
||||
time with @ref glfwGetError.
|
||||
|
||||
@code
|
||||
int code = glfwGetError(NULL);
|
||||
|
||||
if (code != GLFW_NO_ERROR)
|
||||
handle_error(code);
|
||||
@endcode
|
||||
|
||||
If no error has occurred since the last call, @ref GLFW_NO_ERROR (zero) is
|
||||
returned. The error is cleared before the function returns.
|
||||
|
||||
The error code indicates the general category of the error. Some error codes,
|
||||
such as @ref GLFW_NOT_INITIALIZED has only a single meaning, whereas others like
|
||||
@ref GLFW_PLATFORM_ERROR are used for many different errors.
|
||||
|
||||
GLFW often has more information about an error than its general category. You
|
||||
can retrieve a UTF-8 encoded human-readable description along with the error
|
||||
code. If no error has occurred since the last call, the description is set to
|
||||
`NULL`.
|
||||
|
||||
@code
|
||||
const char* description;
|
||||
int code = glfwGetError(&description);
|
||||
|
||||
if (description)
|
||||
display_error_message(code, description);
|
||||
@endcode
|
||||
|
||||
The retrieved description string is only valid until the next error occurs.
|
||||
This means you must make a copy of it if you want to keep it.
|
||||
|
||||
You can also set an error callback, which will be called each time an error
|
||||
occurs. It is set with @ref glfwSetErrorCallback.
|
||||
|
||||
@code
|
||||
glfwSetErrorCallback(error_callback);
|
||||
@endcode
|
||||
|
||||
The error callback receives the same error code and human-readable description
|
||||
returned by @ref glfwGetError.
|
||||
|
||||
@code
|
||||
void error_callback(int code, const char* description)
|
||||
{
|
||||
display_error_message(code, description);
|
||||
}
|
||||
@endcode
|
||||
|
||||
The error callback is called after the error is stored, so calling @ref
|
||||
glfwGetError from within the error callback returns the same values as the
|
||||
callback argument.
|
||||
|
||||
The description string passed to the callback is only valid until the error
|
||||
callback returns. This means you must make a copy of it if you want to keep it.
|
||||
|
||||
__Reported errors are never fatal.__ As long as GLFW was successfully
|
||||
initialized, it will remain initialized and in a safe state until terminated
|
||||
regardless of how many errors occur. If an error occurs during initialization
|
||||
that causes @ref glfwInit to fail, any part of the library that was initialized
|
||||
will be safely terminated.
|
||||
|
||||
Do not rely on a currently invalid call to generate a specific error, as in the
|
||||
future that same call may generate a different error or become valid.
|
||||
|
||||
|
||||
@section coordinate_systems Coordinate systems
|
||||
|
||||
GLFW has two primary coordinate systems: the _virtual screen_ and the window
|
||||
_content area_ or _content area_. Both use the same unit: _virtual screen
|
||||
coordinates_, or just _screen coordinates_, which don't necessarily correspond
|
||||
to pixels.
|
||||
|
||||
<img src="spaces.svg" width="90%" />
|
||||
|
||||
Both the virtual screen and the content area coordinate systems have the X-axis
|
||||
pointing to the right and the Y-axis pointing down.
|
||||
|
||||
Window and monitor positions are specified as the position of the upper-left
|
||||
corners of their content areas relative to the virtual screen, while cursor
|
||||
positions are specified relative to a window's content area.
|
||||
|
||||
Because the origin of the window's content area coordinate system is also the
|
||||
point from which the window position is specified, you can translate content
|
||||
area coordinates to the virtual screen by adding the window position. The
|
||||
window frame, when present, extends out from the content area but does not
|
||||
affect the window position.
|
||||
|
||||
Almost all positions and sizes in GLFW are measured in screen coordinates
|
||||
relative to one of the two origins above. This includes cursor positions,
|
||||
window positions and sizes, window frame sizes, monitor positions and video mode
|
||||
resolutions.
|
||||
|
||||
Two exceptions are the [monitor physical size](@ref monitor_size), which is
|
||||
measured in millimetres, and [framebuffer size](@ref window_fbsize), which is
|
||||
measured in pixels.
|
||||
|
||||
Pixels and screen coordinates may map 1:1 on your machine, but they won't on
|
||||
every other machine, for example on a Mac with a Retina display. The ratio
|
||||
between screen coordinates and pixels may also change at run-time depending on
|
||||
which monitor the window is currently considered to be on.
|
||||
|
||||
|
||||
@section guarantees_limitations Guarantees and limitations
|
||||
|
||||
This section describes the conditions under which GLFW can be expected to
|
||||
function, barring bugs in the operating system or drivers. Use of GLFW outside
|
||||
these limits may work on some platforms, or on some machines, or some of the
|
||||
time, or on some versions of GLFW, but it may break at any time and this will
|
||||
not be considered a bug.
|
||||
|
||||
|
||||
@subsection lifetime Pointer lifetimes
|
||||
|
||||
GLFW will never free any pointer you provide to it, and you must never free any
|
||||
pointer it provides to you.
|
||||
|
||||
Many GLFW functions return pointers to dynamically allocated structures, strings
|
||||
or arrays, and some callbacks are provided with strings or arrays. These are
|
||||
always managed by GLFW and should never be freed by the application. The
|
||||
lifetime of these pointers is documented for each GLFW function and callback.
|
||||
If you need to keep this data, you must copy it before its lifetime expires.
|
||||
|
||||
Many GLFW functions accept pointers to structures or strings allocated by the
|
||||
application. These are never freed by GLFW and are always the responsibility of
|
||||
the application. If GLFW needs to keep the data in these structures or strings,
|
||||
it is copied before the function returns.
|
||||
|
||||
Pointer lifetimes are guaranteed not to be shortened in future minor or patch
|
||||
releases.
|
||||
|
||||
|
||||
@subsection reentrancy Reentrancy
|
||||
|
||||
GLFW event processing and object destruction are not reentrant. This means that
|
||||
the following functions must not be called from any callback function:
|
||||
|
||||
- @ref glfwDestroyWindow
|
||||
- @ref glfwDestroyCursor
|
||||
- @ref glfwPollEvents
|
||||
- @ref glfwWaitEvents
|
||||
- @ref glfwWaitEventsTimeout
|
||||
- @ref glfwTerminate
|
||||
|
||||
These functions may be made reentrant in future minor or patch releases, but
|
||||
functions not on this list will not be made non-reentrant.
|
||||
|
||||
|
||||
@subsection thread_safety Thread safety
|
||||
|
||||
Most GLFW functions must only be called from the main thread (the thread that
|
||||
calls main), but some may be called from any thread once the library has been
|
||||
initialized. Before initialization the whole library is thread-unsafe.
|
||||
|
||||
The reference documentation for every GLFW function states whether it is limited
|
||||
to the main thread.
|
||||
|
||||
Initialization, termination, event processing and the creation and
|
||||
destruction of windows, cursors and OpenGL and OpenGL ES contexts are all
|
||||
restricted to the main thread due to limitations of one or several platforms.
|
||||
|
||||
Because event processing must be performed on the main thread, all callbacks
|
||||
except for the error callback will only be called on that thread. The error
|
||||
callback may be called on any thread, as any GLFW function may generate errors.
|
||||
|
||||
The error code and description may be queried from any thread.
|
||||
|
||||
- @ref glfwGetError
|
||||
|
||||
Empty events may be posted from any thread.
|
||||
|
||||
- @ref glfwPostEmptyEvent
|
||||
|
||||
The window user pointer and close flag may be read and written from any thread,
|
||||
but this is not synchronized by GLFW.
|
||||
|
||||
- @ref glfwGetWindowUserPointer
|
||||
- @ref glfwSetWindowUserPointer
|
||||
- @ref glfwWindowShouldClose
|
||||
- @ref glfwSetWindowShouldClose
|
||||
|
||||
These functions for working with OpenGL and OpenGL ES contexts may be called
|
||||
from any thread, but the window object is not synchronized by GLFW.
|
||||
|
||||
- @ref glfwMakeContextCurrent
|
||||
- @ref glfwGetCurrentContext
|
||||
- @ref glfwSwapBuffers
|
||||
- @ref glfwSwapInterval
|
||||
- @ref glfwExtensionSupported
|
||||
- @ref glfwGetProcAddress
|
||||
|
||||
The raw timer functions may be called from any thread.
|
||||
|
||||
- @ref glfwGetTimerFrequency
|
||||
- @ref glfwGetTimerValue
|
||||
|
||||
The regular timer may be used from any thread, but reading and writing the timer
|
||||
offset is not synchronized by GLFW.
|
||||
|
||||
- @ref glfwGetTime
|
||||
- @ref glfwSetTime
|
||||
|
||||
Library version information may be queried from any thread.
|
||||
|
||||
- @ref glfwGetVersion
|
||||
- @ref glfwGetVersionString
|
||||
|
||||
Platform information may be queried from any thread.
|
||||
|
||||
- @ref glfwPlatformSupported
|
||||
- @ref glfwGetPlatform
|
||||
|
||||
All Vulkan related functions may be called from any thread.
|
||||
|
||||
- @ref glfwVulkanSupported
|
||||
- @ref glfwGetRequiredInstanceExtensions
|
||||
- @ref glfwGetInstanceProcAddress
|
||||
- @ref glfwGetPhysicalDevicePresentationSupport
|
||||
- @ref glfwCreateWindowSurface
|
||||
|
||||
GLFW uses synchronization objects internally only to manage the per-thread
|
||||
context and error states. Additional synchronization is left to the
|
||||
application.
|
||||
|
||||
Functions that may currently be called from any thread will always remain so,
|
||||
but functions that are currently limited to the main thread may be updated to
|
||||
allow calls from any thread in future releases.
|
||||
|
||||
|
||||
@subsection compatibility Version compatibility
|
||||
|
||||
GLFW uses [Semantic Versioning](https://semver.org/). This guarantees source
|
||||
and binary backward compatibility with earlier minor versions of the API. This
|
||||
means that you can drop in a newer version of the library and existing programs
|
||||
will continue to compile and existing binaries will continue to run.
|
||||
|
||||
Once a function or constant has been added, the signature of that function or
|
||||
value of that constant will remain unchanged until the next major version of
|
||||
GLFW. No compatibility of any kind is guaranteed between major versions.
|
||||
|
||||
Undocumented behavior, i.e. behavior that is not described in the documentation,
|
||||
may change at any time until it is documented.
|
||||
|
||||
If the reference documentation and the implementation differ, the reference
|
||||
documentation will almost always take precedence and the implementation will be
|
||||
fixed in the next release. The reference documentation will also take
|
||||
precedence over anything stated in a guide.
|
||||
|
||||
|
||||
@subsection event_order Event order
|
||||
|
||||
The order of arrival of related events is not guaranteed to be consistent
|
||||
across platforms. The exception is synthetic key and mouse button release
|
||||
events, which are always delivered after the window defocus event.
|
||||
|
||||
|
||||
@section intro_version Version management
|
||||
|
||||
GLFW provides mechanisms for identifying what version of GLFW your application
|
||||
was compiled against as well as what version it is currently running against.
|
||||
If you are loading GLFW dynamically (not just linking dynamically), you can use
|
||||
this to verify that the library binary is compatible with your application.
|
||||
|
||||
|
||||
@subsection intro_version_compile Compile-time version
|
||||
|
||||
The compile-time version of GLFW is provided by the GLFW header with the
|
||||
`GLFW_VERSION_MAJOR`, `GLFW_VERSION_MINOR` and `GLFW_VERSION_REVISION` macros.
|
||||
|
||||
@code
|
||||
printf("Compiled against GLFW %i.%i.%i\n",
|
||||
GLFW_VERSION_MAJOR,
|
||||
GLFW_VERSION_MINOR,
|
||||
GLFW_VERSION_REVISION);
|
||||
@endcode
|
||||
|
||||
|
||||
@subsection intro_version_runtime Run-time version
|
||||
|
||||
The run-time version can be retrieved with @ref glfwGetVersion, a function that
|
||||
may be called regardless of whether GLFW is initialized.
|
||||
|
||||
@code
|
||||
int major, minor, revision;
|
||||
glfwGetVersion(&major, &minor, &revision);
|
||||
|
||||
printf("Running against GLFW %i.%i.%i\n", major, minor, revision);
|
||||
@endcode
|
||||
|
||||
|
||||
@subsection intro_version_string Version string
|
||||
|
||||
GLFW 3 also provides a compile-time generated version string that describes the
|
||||
version, platform, compiler and any platform-specific compile-time options.
|
||||
This is primarily intended for submitting bug reports, to allow developers to
|
||||
see which code paths are enabled in a binary.
|
||||
|
||||
The version string is returned by @ref glfwGetVersionString, a function that may
|
||||
be called regardless of whether GLFW is initialized.
|
||||
|
||||
__Do not use the version string__ to parse the GLFW library version. The @ref
|
||||
glfwGetVersion function already provides the version of the running library
|
||||
binary.
|
||||
|
||||
__Do not use the version string__ to parse what platforms are supported. The @ref
|
||||
glfwPlatformSupported function lets you query platform support.
|
||||
|
||||
__GLFW 3.4:__ The format of this string was changed to support the addition of
|
||||
[runtime platform selection](@ref platform).
|
||||
|
||||
The format of the string is as follows:
|
||||
- The version of GLFW
|
||||
- For each supported platform:
|
||||
- The name of the window system API
|
||||
- The name of the window system specific context creation API, if applicable
|
||||
- The names of the always supported context creation APIs EGL and OSMesa
|
||||
- Any additional compile-time options, APIs and (on Windows) what compiler was used
|
||||
|
||||
For example, compiling GLFW 3.4 with MinGW as a DLL for Windows, may result in a version string
|
||||
like this:
|
||||
|
||||
@code
|
||||
3.4.0 Win32 WGL Null EGL OSMesa MinGW DLL
|
||||
@endcode
|
||||
|
||||
Compiling GLFW as a static library for Linux, with both Wayland and X11 enabled, may
|
||||
result in a version string like this:
|
||||
|
||||
@code
|
||||
3.4.0 Wayland X11 GLX Null EGL OSMesa monotonic
|
||||
@endcode
|
||||
|
||||
*/
|
|
@ -4,17 +4,43 @@
|
|||
|
||||
@section main_intro Introduction
|
||||
|
||||
GLFW is a free, Open Source, multi-platform library for opening a window,
|
||||
creating an OpenGL context and managing input. It is easy to integrate into
|
||||
existing applications and does not lay claim to the main loop.
|
||||
GLFW is a free, Open Source, multi-platform library for OpenGL, OpenGL ES and
|
||||
Vulkan application development. It provides a simple, platform-independent API
|
||||
for creating windows, contexts and surfaces, reading input, handling events, etc.
|
||||
|
||||
This is the documentation for version 3.0, which has [many new features](@ref news).
|
||||
@ref news_34 list new features, caveats and deprecations.
|
||||
|
||||
There is a [quick tutorial](@ref quick) for people new to GLFW, which shows how
|
||||
to write a small but complete program.
|
||||
@ref quick_guide is a guide for users new to GLFW. It takes you through how to
|
||||
write a small but complete program.
|
||||
|
||||
If you have used GLFW 2.x in the past, there is a
|
||||
[transition guide](@ref moving) that explains what has changed and how to update
|
||||
existing code to use the new API.
|
||||
There are guides for each section of the API:
|
||||
|
||||
- @ref intro_guide – initialization, error handling and high-level design
|
||||
- @ref window_guide – creating and working with windows and framebuffers
|
||||
- @ref context_guide – working with OpenGL and OpenGL ES contexts
|
||||
- @ref vulkan_guide - working with Vulkan objects and extensions
|
||||
- @ref monitor_guide – enumerating and working with monitors and video modes
|
||||
- @ref input_guide – receiving events, polling and processing input
|
||||
|
||||
Once you have written a program, see @ref compile_guide and @ref build_guide.
|
||||
|
||||
The [reference documentation](modules.html) provides more detailed information
|
||||
about specific functions.
|
||||
|
||||
@ref moving_guide explains what has changed and how to update existing code to
|
||||
use the new API.
|
||||
|
||||
There is a section on @ref guarantees_limitations for pointer lifetimes,
|
||||
reentrancy, thread safety, event order and backward and forward compatibility.
|
||||
|
||||
The [FAQ](https://www.glfw.org/faq.html) answers many common questions about the
|
||||
design, implementation and use of GLFW.
|
||||
|
||||
Finally, @ref compat_guide explains what APIs, standards and protocols GLFW uses
|
||||
and what happens when they are not present on a given machine.
|
||||
|
||||
This documentation was generated with Doxygen. The sources for it are available
|
||||
in both the [source distribution](https://www.glfw.org/download.html) and
|
||||
[GitHub repository](https://github.com/glfw/glfw).
|
||||
|
||||
*/
|
||||
|
|
222
docs/monitor.dox
222
docs/monitor.dox
|
@ -1,16 +1,45 @@
|
|||
/*!
|
||||
|
||||
@page monitor Multi-monitor guide
|
||||
@page monitor_guide Monitor guide
|
||||
|
||||
@tableofcontents
|
||||
|
||||
This guide introduces the monitor related functions of GLFW. For details on
|
||||
a specific function in this category, see the @ref monitor. There are also
|
||||
guides for the other areas of GLFW.
|
||||
|
||||
@section monitor_objects Monitor objects
|
||||
- @ref intro_guide
|
||||
- @ref window_guide
|
||||
- @ref context_guide
|
||||
- @ref vulkan_guide
|
||||
- @ref input_guide
|
||||
|
||||
The @ref GLFWmonitor object represents a currently connected monitor.
|
||||
|
||||
The primary monitor is returned by @ref glfwGetPrimaryMonitor. It is usually
|
||||
the user's preferred monitor and the one with global UI elements like task bar
|
||||
@section monitor_object Monitor objects
|
||||
|
||||
A monitor object represents a currently connected monitor and is represented as
|
||||
a pointer to the [opaque](https://en.wikipedia.org/wiki/Opaque_data_type) type
|
||||
@ref GLFWmonitor. Monitor objects cannot be created or destroyed by the
|
||||
application and retain their addresses until the monitors they represent are
|
||||
disconnected or until the library is [terminated](@ref intro_init_terminate).
|
||||
|
||||
Each monitor has a current video mode, a list of supported video modes,
|
||||
a virtual position, a human-readable name, an estimated physical size and
|
||||
a gamma ramp. One of the monitors is the primary monitor.
|
||||
|
||||
The virtual position of a monitor is in
|
||||
[screen coordinates](@ref coordinate_systems) and, together with the current
|
||||
video mode, describes the viewports that the connected monitors provide into the
|
||||
virtual desktop that spans them.
|
||||
|
||||
To see how GLFW views your monitor setup and its available video modes, run the
|
||||
`monitors` test program.
|
||||
|
||||
|
||||
@subsection monitor_monitors Retrieving monitors
|
||||
|
||||
The primary monitor is returned by @ref glfwGetPrimaryMonitor. It is the user's
|
||||
preferred monitor and is usually the one with global UI elements like task bar
|
||||
or menu bar.
|
||||
|
||||
@code
|
||||
|
@ -18,68 +47,203 @@ GLFWmonitor* primary = glfwGetPrimaryMonitor();
|
|||
@endcode
|
||||
|
||||
You can retrieve all currently connected monitors with @ref glfwGetMonitors.
|
||||
See the reference documentation for the lifetime of the returned array.
|
||||
|
||||
@code
|
||||
int count;
|
||||
GLFWmonitor** monitors = glfwGetMonitors(&count);
|
||||
@endcode
|
||||
|
||||
The primary monitor is always the first monitor in the returned array, but other
|
||||
monitors may be moved to a different index when a monitor is connected or
|
||||
disconnected.
|
||||
|
||||
@section monitor_modes Querying video modes
|
||||
|
||||
Although GLFW generally does a good job at selecting a suitable video
|
||||
mode for you when you open a full screen window, it is sometimes useful to
|
||||
know exactly which modes are available on a certain system. For example,
|
||||
you may want to present the user with a list of video modes to select
|
||||
from. To get a list of available video modes, you can use the function
|
||||
@ref glfwGetVideoModes.
|
||||
@subsection monitor_event Monitor configuration changes
|
||||
|
||||
If you wish to be notified when a monitor is connected or disconnected, set
|
||||
a monitor callback.
|
||||
|
||||
@code
|
||||
glfwSetMonitorCallback(monitor_callback);
|
||||
@endcode
|
||||
|
||||
The callback function receives the handle for the monitor that has been
|
||||
connected or disconnected and the event that occurred.
|
||||
|
||||
@code
|
||||
void monitor_callback(GLFWmonitor* monitor, int event)
|
||||
{
|
||||
if (event == GLFW_CONNECTED)
|
||||
{
|
||||
// The monitor was connected
|
||||
}
|
||||
else if (event == GLFW_DISCONNECTED)
|
||||
{
|
||||
// The monitor was disconnected
|
||||
}
|
||||
}
|
||||
@endcode
|
||||
|
||||
If a monitor is disconnected, all windows that are full screen on it will be
|
||||
switched to windowed mode before the callback is called. Only @ref
|
||||
glfwGetMonitorName and @ref glfwGetMonitorUserPointer will return useful values
|
||||
for a disconnected monitor and only before the monitor callback returns.
|
||||
|
||||
|
||||
@section monitor_properties Monitor properties
|
||||
|
||||
Each monitor has a current video mode, a list of supported video modes,
|
||||
a virtual position, a content scale, a human-readable name, a user pointer, an
|
||||
estimated physical size and a gamma ramp.
|
||||
|
||||
|
||||
@subsection monitor_modes Video modes
|
||||
|
||||
GLFW generally does a good job selecting a suitable video mode when you create
|
||||
a full screen window, change its video mode or make a windowed one full
|
||||
screen, but it is sometimes useful to know exactly which video modes are
|
||||
supported.
|
||||
|
||||
Video modes are represented as @ref GLFWvidmode structures. You can get an
|
||||
array of the video modes supported by a monitor with @ref glfwGetVideoModes.
|
||||
See the reference documentation for the lifetime of the returned array.
|
||||
|
||||
@code
|
||||
int count;
|
||||
GLFWvidmode* modes = glfwGetVideoModes(monitor, &count);
|
||||
@endcode
|
||||
|
||||
To get the current video mode of a monitor call @ref glfwGetVideoMode.
|
||||
To get the current video mode of a monitor call @ref glfwGetVideoMode. See the
|
||||
reference documentation for the lifetime of the returned pointer.
|
||||
|
||||
@code
|
||||
const GLFWvidmode* mode = glfwGetVideoMode(monitor);
|
||||
@endcode
|
||||
|
||||
The resolution of a video mode is specified in
|
||||
[screen coordinates](@ref coordinate_systems), not pixels.
|
||||
|
||||
@section monitor_size Monitor physical size
|
||||
|
||||
The physical size in millimetres of a monitor, or an approximation of it, can be
|
||||
retrieved with @ref glfwGetMonitorPhysicalSize. This can, for example, be used
|
||||
together with the current video mode to calculate DPI.
|
||||
@subsection monitor_size Physical size
|
||||
|
||||
The physical size of a monitor in millimetres, or an estimation of it, can be
|
||||
retrieved with @ref glfwGetMonitorPhysicalSize. This has no relation to its
|
||||
current _resolution_, i.e. the width and height of its current
|
||||
[video mode](@ref monitor_modes).
|
||||
|
||||
@code
|
||||
int widthMM, heightMM;
|
||||
glfwGetMonitorPhysicalSize(monitor, &widthMM, &heightMM);
|
||||
int width_mm, height_mm;
|
||||
glfwGetMonitorPhysicalSize(monitor, &width_mm, &height_mm);
|
||||
@endcode
|
||||
|
||||
While this can be used to calculate the raw DPI of a monitor, this is often not
|
||||
useful. Instead, use the [monitor content scale](@ref monitor_scale) and
|
||||
[window content scale](@ref window_scale) to scale your content.
|
||||
|
||||
|
||||
@subsection monitor_scale Content scale
|
||||
|
||||
The content scale for a monitor can be retrieved with @ref
|
||||
glfwGetMonitorContentScale.
|
||||
|
||||
@code
|
||||
float xscale, yscale;
|
||||
glfwGetMonitorContentScale(monitor, &xscale, &yscale);
|
||||
@endcode
|
||||
|
||||
The content scale is the ratio between the current DPI and the platform's
|
||||
default DPI. This is especially important for text and any UI elements. If the
|
||||
pixel dimensions of your UI scaled by this look appropriate on your machine then
|
||||
it should appear at a reasonable size on other machines regardless of their DPI
|
||||
and scaling settings. This relies on the system DPI and scaling settings being
|
||||
somewhat correct.
|
||||
|
||||
The content scale may depend on both the monitor resolution and pixel density
|
||||
and on user settings. It may be very different from the raw DPI calculated from
|
||||
the physical size and current resolution.
|
||||
|
||||
|
||||
@subsection monitor_pos Virtual position
|
||||
|
||||
The position of the monitor on the virtual desktop, in
|
||||
[screen coordinates](@ref coordinate_systems), can be retrieved with @ref
|
||||
glfwGetMonitorPos.
|
||||
|
||||
@code
|
||||
int xpos, ypos;
|
||||
glfwGetMonitorPos(monitor, &xpos, &ypos);
|
||||
@endcode
|
||||
|
||||
|
||||
@section monitor_name Monitor name
|
||||
@subsection monitor_workarea Work area
|
||||
|
||||
The name of a monitor is returned by @ref glfwGetMonitorName.
|
||||
The area of a monitor not occupied by global task bars or menu bars is the work
|
||||
area. This is specified in [screen coordinates](@ref coordinate_systems) and
|
||||
can be retrieved with @ref glfwGetMonitorWorkarea.
|
||||
|
||||
@code
|
||||
int xpos, ypos, width, height;
|
||||
glfwGetMonitorWorkarea(monitor, &xpos, &ypos, &width, &height);
|
||||
@endcode
|
||||
|
||||
|
||||
@subsection monitor_name Human-readable name
|
||||
|
||||
The human-readable, UTF-8 encoded name of a monitor is returned by @ref
|
||||
glfwGetMonitorName. See the reference documentation for the lifetime of the
|
||||
returned string.
|
||||
|
||||
@code
|
||||
const char* name = glfwGetMonitorName(monitor);
|
||||
@endcode
|
||||
|
||||
The monitor name is a regular C string using the UTF-8 encoding. Note that
|
||||
monitor names are not guaranteed to be unique.
|
||||
Monitor names are not guaranteed to be unique. Two monitors of the same model
|
||||
and make may have the same name. Only the monitor handle is guaranteed to be
|
||||
unique, and only until that monitor is disconnected.
|
||||
|
||||
|
||||
@section monitor_gamma Monitor gamma ramp
|
||||
@subsection monitor_userptr User pointer
|
||||
|
||||
Each monitor has a user pointer that can be set with @ref
|
||||
glfwSetMonitorUserPointer and queried with @ref glfwGetMonitorUserPointer. This
|
||||
can be used for any purpose you need and will not be modified by GLFW. The
|
||||
value will be kept until the monitor is disconnected or until the library is
|
||||
terminated.
|
||||
|
||||
The initial value of the pointer is `NULL`.
|
||||
|
||||
|
||||
@subsection monitor_gamma Gamma ramp
|
||||
|
||||
The gamma ramp of a monitor can be set with @ref glfwSetGammaRamp, which accepts
|
||||
a monitor handle and a pointer to a @ref GLFWgammaramp structure.
|
||||
|
||||
@code
|
||||
GLFWgammaramp ramp;
|
||||
unsigned short red[256], green[256], blue[256];
|
||||
|
||||
ramp.size = 256;
|
||||
ramp.red = red;
|
||||
ramp.green = green;
|
||||
ramp.blue = blue;
|
||||
|
||||
for (i = 0; i < ramp.size; i++)
|
||||
{
|
||||
// Fill out gamma ramp arrays as desired
|
||||
}
|
||||
|
||||
glfwSetGammaRamp(monitor, &ramp);
|
||||
@endcode
|
||||
|
||||
The current gamma ramp for a monitor is returned by @ref glfwGetGammaRamp.
|
||||
The gamma ramp data is copied before the function returns, so there is no need
|
||||
to keep it around once the ramp has been set.
|
||||
|
||||
It is recommended that your gamma ramp have the same size as the current gamma
|
||||
ramp for that monitor.
|
||||
|
||||
The current gamma ramp for a monitor is returned by @ref glfwGetGammaRamp. See
|
||||
the reference documentation for the lifetime of the returned structure.
|
||||
|
||||
@code
|
||||
const GLFWgammaramp* ramp = glfwGetGammaRamp(monitor);
|
||||
|
@ -93,4 +257,12 @@ glfwSetGammaRamp with the resulting ramp.
|
|||
glfwSetGamma(monitor, 1.0);
|
||||
@endcode
|
||||
|
||||
To experiment with gamma correction via the @ref glfwSetGamma function, run the
|
||||
`gamma` test program.
|
||||
|
||||
@note The software controlled gamma ramp is applied _in addition_ to the
|
||||
hardware gamma correction, which today is typically an approximation of sRGB
|
||||
gamma. This means that setting a perfectly linear ramp, or gamma 1.0, will
|
||||
produce the default (usually sRGB-like) behavior.
|
||||
|
||||
*/
|
||||
|
|
553
docs/moving.dox
553
docs/moving.dox
|
@ -1,59 +1,286 @@
|
|||
/*!
|
||||
|
||||
@page moving Moving from GLFW 2 to 3
|
||||
@page moving_guide Moving from GLFW 2 to 3
|
||||
|
||||
@tableofcontents
|
||||
|
||||
This is a transition guide for moving from GLFW 2 to 3. It describes what has
|
||||
changed or been removed, but does *not* include
|
||||
changed or been removed, but does _not_ include
|
||||
[new features](@ref news) unless they are required when moving an existing code
|
||||
base onto the new API. For example, use of the new multi-monitor functions are
|
||||
base onto the new API. For example, the new multi-monitor functions are
|
||||
required to create full screen windows with GLFW 3.
|
||||
|
||||
|
||||
@section moving_removed Removed features
|
||||
@section moving_removed Changed and removed features
|
||||
|
||||
@subsection moving_threads Threading functions
|
||||
@subsection moving_renamed_files Renamed library and header file
|
||||
|
||||
The threading functions have been removed, including the sleep function. They
|
||||
were fairly primitive, under-used, poorly integrated and took time away from the
|
||||
focus of GLFW (i.e. context, input and window). There are better threading
|
||||
libraries available and native threading support is available in both C++11 and
|
||||
C11, both of which are gaining traction.
|
||||
The GLFW 3 header is named @ref glfw3.h and moved to the `GLFW` directory, to
|
||||
avoid collisions with the headers of other major versions. Similarly, the GLFW
|
||||
3 library is named `glfw3,` except when it's installed as a shared library on
|
||||
Unix-like systems, where it uses the
|
||||
[soname](https://en.wikipedia.org/wiki/soname) `libglfw.so.3`.
|
||||
|
||||
@par Old syntax
|
||||
@code
|
||||
#include <GL/glfw.h>
|
||||
@endcode
|
||||
|
||||
@par New syntax
|
||||
@code
|
||||
#include <GLFW/glfw3.h>
|
||||
@endcode
|
||||
|
||||
|
||||
@subsection moving_threads Removal of threading functions
|
||||
|
||||
The threading functions have been removed, including the per-thread sleep
|
||||
function. They were fairly primitive, under-used, poorly integrated and took
|
||||
time away from the focus of GLFW (i.e. context, input and window). There are
|
||||
better threading libraries available and native threading support is available
|
||||
in both [C++11](https://en.cppreference.com/w/cpp/thread) and
|
||||
[C11](https://en.cppreference.com/w/c/thread), both of which are gaining
|
||||
traction.
|
||||
|
||||
If you wish to use the C++11 or C11 facilities but your compiler doesn't yet
|
||||
support them, see the
|
||||
[TinyThread++](https://gitorious.org/tinythread/tinythreadpp) and
|
||||
[TinyCThread](https://gitorious.org/tinythread/tinycthread) projects created by
|
||||
[TinyCThread](https://github.com/tinycthread/tinycthread) projects created by
|
||||
the original author of GLFW. These libraries implement a usable subset of the
|
||||
threading APIs in C++11 and C11, and in fact some GLFW 3 test programs use
|
||||
TinyCThread.
|
||||
|
||||
However, GLFW 3 has better support for *use from multiple threads* than GLFW
|
||||
2 had. Contexts can be made current on and rendered with from secondary
|
||||
threads, and the documentation explicitly states which functions may be used
|
||||
from secondary threads and which may only be used from the main thread, i.e. the
|
||||
thread that calls main.
|
||||
However, GLFW 3 has better support for _use from multiple threads_ than GLFW
|
||||
2 had. Contexts can be made current on any thread, although only a single
|
||||
thread at a time, and the documentation explicitly states which functions may be
|
||||
used from any thread and which must only be used from the main thread.
|
||||
|
||||
@par Removed functions
|
||||
`glfwSleep`, `glfwCreateThread`, `glfwDestroyThread`, `glfwWaitThread`,
|
||||
`glfwGetThreadID`, `glfwCreateMutex`, `glfwDestroyMutex`, `glfwLockMutex`,
|
||||
`glfwUnlockMutex`, `glfwCreateCond`, `glfwDestroyCond`, `glfwWaitCond`,
|
||||
`glfwSignalCond`, `glfwBroadcastCond` and `glfwGetNumberOfProcessors`.
|
||||
|
||||
@par Removed types
|
||||
`GLFWthreadfun`
|
||||
|
||||
|
||||
@subsection moving_image Image and texture loading
|
||||
@subsection moving_image Removal of image and texture loading
|
||||
|
||||
The image and texture loading functions have been removed. They only supported
|
||||
the Targa image format, making them mostly useful for beginner level examples.
|
||||
To become of sufficiently high quality to warrant keeping them in GLFW 3, they
|
||||
would need not only to support other formats, but also modern extensions to the
|
||||
OpenGL texturing facilities. This would either add a number of external
|
||||
would need not only to support other formats, but also modern extensions to
|
||||
OpenGL texturing. This would either add a number of external
|
||||
dependencies (libjpeg, libpng, etc.), or force GLFW to ship with inline versions
|
||||
of these libraries.
|
||||
of these libraries.
|
||||
|
||||
As there already are libraries doing this, it seems unnecessary both to
|
||||
duplicate this work and to tie this duplicate to GLFW. Projects similar to
|
||||
GLFW, such as freeglut, could also gain from such a library. Also, would be no
|
||||
platform-specific part of such a library, as both OpenGL and stdio are available
|
||||
wherever GLFW is.
|
||||
As there already are libraries doing this, it is unnecessary both to duplicate
|
||||
the work and to tie the duplicate to GLFW. The resulting library would also be
|
||||
platform-independent, as both OpenGL and stdio are available wherever GLFW is.
|
||||
|
||||
@par Removed functions
|
||||
`glfwReadImage`, `glfwReadMemoryImage`, `glfwFreeImage`, `glfwLoadTexture2D`,
|
||||
`glfwLoadMemoryTexture2D` and `glfwLoadTextureImage2D`.
|
||||
|
||||
|
||||
@subsection moving_char_up Character actions
|
||||
@subsection moving_stdcall Removal of GLFWCALL macro
|
||||
|
||||
The `GLFWCALL` macro, which made callback functions use
|
||||
[__stdcall](https://msdn.microsoft.com/en-us/library/zxk0tw93.aspx) on Windows,
|
||||
has been removed. GLFW is written in C, not Pascal. Removing this macro means
|
||||
there's one less thing for application programmers to remember, i.e. the
|
||||
requirement to mark all callback functions with `GLFWCALL`. It also simplifies
|
||||
the creation of DLLs and DLL link libraries, as there's no need to explicitly
|
||||
disable `@n` entry point suffixes.
|
||||
|
||||
@par Old syntax
|
||||
@code
|
||||
void GLFWCALL callback_function(...);
|
||||
@endcode
|
||||
|
||||
@par New syntax
|
||||
@code
|
||||
void callback_function(...);
|
||||
@endcode
|
||||
|
||||
|
||||
@subsection moving_window_handles Window handle parameters
|
||||
|
||||
Because GLFW 3 supports multiple windows, window handle parameters have been
|
||||
added to all window-related GLFW functions and callbacks. The handle of
|
||||
a newly created window is returned by @ref glfwCreateWindow (formerly
|
||||
`glfwOpenWindow`). Window handles are pointers to the
|
||||
[opaque](https://en.wikipedia.org/wiki/Opaque_data_type) type @ref GLFWwindow.
|
||||
|
||||
@par Old syntax
|
||||
@code
|
||||
glfwSetWindowTitle("New Window Title");
|
||||
@endcode
|
||||
|
||||
@par New syntax
|
||||
@code
|
||||
glfwSetWindowTitle(window, "New Window Title");
|
||||
@endcode
|
||||
|
||||
|
||||
@subsection moving_monitor Explicit monitor selection
|
||||
|
||||
GLFW 3 provides support for multiple monitors. To request a full screen mode window,
|
||||
instead of passing `GLFW_FULLSCREEN` you specify which monitor you wish the
|
||||
window to use. The @ref glfwGetPrimaryMonitor function returns the monitor that
|
||||
GLFW 2 would have selected, but there are many other
|
||||
[monitor functions](@ref monitor_guide). Monitor handles are pointers to the
|
||||
[opaque](https://en.wikipedia.org/wiki/Opaque_data_type) type @ref GLFWmonitor.
|
||||
|
||||
@par Old basic full screen
|
||||
@code
|
||||
glfwOpenWindow(640, 480, 8, 8, 8, 0, 24, 0, GLFW_FULLSCREEN);
|
||||
@endcode
|
||||
|
||||
@par New basic full screen
|
||||
@code
|
||||
window = glfwCreateWindow(640, 480, "My Window", glfwGetPrimaryMonitor(), NULL);
|
||||
@endcode
|
||||
|
||||
@note The framebuffer bit depth parameters of `glfwOpenWindow` have been turned
|
||||
into [window hints](@ref window_hints), but as they have been given
|
||||
[sane defaults](@ref window_hints_values) you rarely need to set these hints.
|
||||
|
||||
|
||||
@subsection moving_autopoll Removal of automatic event polling
|
||||
|
||||
GLFW 3 does not automatically poll for events in @ref glfwSwapBuffers, meaning
|
||||
you need to call @ref glfwPollEvents or @ref glfwWaitEvents yourself. Unlike
|
||||
buffer swap, which acts on a single window, the event processing functions act
|
||||
on all windows at once.
|
||||
|
||||
@par Old basic main loop
|
||||
@code
|
||||
while (...)
|
||||
{
|
||||
// Process input
|
||||
// Render output
|
||||
glfwSwapBuffers();
|
||||
}
|
||||
@endcode
|
||||
|
||||
@par New basic main loop
|
||||
@code
|
||||
while (...)
|
||||
{
|
||||
// Process input
|
||||
// Render output
|
||||
glfwSwapBuffers(window);
|
||||
glfwPollEvents();
|
||||
}
|
||||
@endcode
|
||||
|
||||
|
||||
@subsection moving_context Explicit context management
|
||||
|
||||
Each GLFW 3 window has its own OpenGL context and only you, the application
|
||||
programmer, can know which context should be current on which thread at any
|
||||
given time. Therefore, GLFW 3 leaves that decision to you.
|
||||
|
||||
This means that you need to call @ref glfwMakeContextCurrent after creating
|
||||
a window before you can call any OpenGL functions.
|
||||
|
||||
|
||||
@subsection moving_hidpi Separation of window and framebuffer sizes
|
||||
|
||||
Window positions and sizes now use screen coordinates, which may not be the same
|
||||
as pixels on machines with high-DPI monitors. This is important as OpenGL uses
|
||||
pixels, not screen coordinates. For example, the rectangle specified with
|
||||
`glViewport` needs to use pixels. Therefore, framebuffer size functions have
|
||||
been added. You can retrieve the size of the framebuffer of a window with @ref
|
||||
glfwGetFramebufferSize function. A framebuffer size callback has also been
|
||||
added, which can be set with @ref glfwSetFramebufferSizeCallback.
|
||||
|
||||
@par Old basic viewport setup
|
||||
@code
|
||||
glfwGetWindowSize(&width, &height);
|
||||
glViewport(0, 0, width, height);
|
||||
@endcode
|
||||
|
||||
@par New basic viewport setup
|
||||
@code
|
||||
glfwGetFramebufferSize(window, &width, &height);
|
||||
glViewport(0, 0, width, height);
|
||||
@endcode
|
||||
|
||||
|
||||
@subsection moving_window_close Window closing changes
|
||||
|
||||
The `GLFW_OPENED` window parameter has been removed. As long as the window has
|
||||
not been destroyed, whether through @ref glfwDestroyWindow or @ref
|
||||
glfwTerminate, the window is "open".
|
||||
|
||||
A user attempting to close a window is now just an event like any other. Unlike
|
||||
GLFW 2, windows and contexts created with GLFW 3 will never be destroyed unless
|
||||
you choose them to be. Each window now has a close flag that is set to
|
||||
`GLFW_TRUE` when the user attempts to close that window. By default, nothing else
|
||||
happens and the window stays visible. It is then up to you to either destroy
|
||||
the window, take some other action or ignore the request.
|
||||
|
||||
You can query the close flag at any time with @ref glfwWindowShouldClose and set
|
||||
it at any time with @ref glfwSetWindowShouldClose.
|
||||
|
||||
@par Old basic main loop
|
||||
@code
|
||||
while (glfwGetWindowParam(GLFW_OPENED))
|
||||
{
|
||||
...
|
||||
}
|
||||
@endcode
|
||||
|
||||
@par New basic main loop
|
||||
@code
|
||||
while (!glfwWindowShouldClose(window))
|
||||
{
|
||||
...
|
||||
}
|
||||
@endcode
|
||||
|
||||
The close callback no longer returns a value. Instead, it is called after the
|
||||
close flag has been set, so it can optionally override its value, before
|
||||
event processing completes. You may however not call @ref glfwDestroyWindow
|
||||
from the close callback (or any other window related callback).
|
||||
|
||||
@par Old syntax
|
||||
@code
|
||||
int GLFWCALL window_close_callback(void);
|
||||
@endcode
|
||||
|
||||
@par New syntax
|
||||
@code
|
||||
void window_close_callback(GLFWwindow* window);
|
||||
@endcode
|
||||
|
||||
@note GLFW never clears the close flag to `GLFW_FALSE`, meaning you can use it
|
||||
for other reasons to close the window as well, for example the user choosing
|
||||
Quit from an in-game menu.
|
||||
|
||||
|
||||
@subsection moving_hints Persistent window hints
|
||||
|
||||
The `glfwOpenWindowHint` function has been renamed to @ref glfwWindowHint.
|
||||
|
||||
Window hints are no longer reset to their default values on window creation, but
|
||||
instead retain their values until modified by @ref glfwWindowHint or @ref
|
||||
glfwDefaultWindowHints, or until the library is terminated and re-initialized.
|
||||
|
||||
|
||||
@subsection moving_video_modes Video mode enumeration
|
||||
|
||||
Video mode enumeration is now per-monitor. The @ref glfwGetVideoModes function
|
||||
now returns all available modes for a specific monitor instead of requiring you
|
||||
to guess how large an array you need. The `glfwGetDesktopMode` function, which
|
||||
had poorly defined behavior, has been replaced by @ref glfwGetVideoMode, which
|
||||
returns the current mode of a monitor.
|
||||
|
||||
|
||||
@subsection moving_char_up Removal of character actions
|
||||
|
||||
The action parameter of the [character callback](@ref GLFWcharfun) has been
|
||||
removed. This was an artefact of the origin of GLFW, i.e. being developed in
|
||||
|
@ -61,35 +288,98 @@ English by a Swede. However, many keyboard layouts require more than one key to
|
|||
produce characters with diacritical marks. Even the Swedish keyboard layout
|
||||
requires this for uncommon cases like ü.
|
||||
|
||||
Note that this is only the removal of the *action parameter* of the character
|
||||
callback, *not* the removal of the character callback itself.
|
||||
@par Old syntax
|
||||
@code
|
||||
void GLFWCALL character_callback(int character, int action);
|
||||
@endcode
|
||||
|
||||
@par New syntax
|
||||
@code
|
||||
void character_callback(GLFWwindow* window, int character);
|
||||
@endcode
|
||||
|
||||
|
||||
@subsection moving_wheel Mouse wheel position
|
||||
@subsection moving_cursorpos Cursor position changes
|
||||
|
||||
The `glfwGetMouseWheel` function has been removed. Scroll events do not
|
||||
represent an absolute state, but is instead an interpretation of a relative
|
||||
change in state, like character input. So, like character input, there is no
|
||||
sane 'current state' to return. The mouse wheel callback has been replaced by
|
||||
a [scroll callback](@ref GLFWscrollfun) that receives two-dimensional scroll
|
||||
offsets.
|
||||
The `glfwGetMousePos` function has been renamed to @ref glfwGetCursorPos,
|
||||
`glfwSetMousePos` to @ref glfwSetCursorPos and `glfwSetMousePosCallback` to @ref
|
||||
glfwSetCursorPosCallback.
|
||||
|
||||
The cursor position is now `double` instead of `int`, both for the direct
|
||||
functions and for the callback. Some platforms can provide sub-pixel cursor
|
||||
movement and this data is now passed on to the application where available. On
|
||||
platforms where this is not provided, the decimal part is zero.
|
||||
|
||||
GLFW 3 only allows you to position the cursor within a window using @ref
|
||||
glfwSetCursorPos (formerly `glfwSetMousePos`) when that window is active.
|
||||
Unless the window is active, the function fails silently.
|
||||
|
||||
|
||||
@subsection moving_stdcall GLFWCALL macro
|
||||
@subsection moving_wheel Wheel position replaced by scroll offsets
|
||||
|
||||
The `GLFWCALL` macro, which made callback functions use
|
||||
[__stdcall](http://msdn.microsoft.com/en-us/library/zxk0tw93.aspx) on Windows,
|
||||
has been removed. GLFW is written in C, not Pascal. Removing this macro means
|
||||
there's one less thing for users of GLFW to remember, i.e. the requirement to
|
||||
mark all callback functions with `GLFWCALL`. It also simplifies the creation of
|
||||
DLLs and DLL link libraries, as there's no need to explicitly disable `@n` entry
|
||||
point suffixes.
|
||||
The `glfwGetMouseWheel` function has been removed. Scrolling is the input of
|
||||
offsets and has no absolute position. The mouse wheel callback has been
|
||||
replaced by a [scroll callback](@ref GLFWscrollfun) that receives
|
||||
two-dimensional floating point scroll offsets. This allows you to receive
|
||||
precise scroll data from for example modern touchpads.
|
||||
|
||||
@par Old syntax
|
||||
@code
|
||||
void GLFWCALL mouse_wheel_callback(int position);
|
||||
@endcode
|
||||
|
||||
@par New syntax
|
||||
@code
|
||||
void scroll_callback(GLFWwindow* window, double xoffset, double yoffset);
|
||||
@endcode
|
||||
|
||||
@par Removed functions
|
||||
`glfwGetMouseWheel`
|
||||
|
||||
|
||||
@subsection moving_repeat Key repeat action
|
||||
|
||||
The `GLFW_KEY_REPEAT` enable has been removed and key repeat is always enabled
|
||||
for both keys and characters. A new key action, `GLFW_REPEAT`, has been added
|
||||
to allow the [key callback](@ref GLFWkeyfun) to distinguish an initial key press
|
||||
from a repeat. Note that @ref glfwGetKey still returns only `GLFW_PRESS` or
|
||||
`GLFW_RELEASE`.
|
||||
|
||||
|
||||
@subsection moving_keys Physical key input
|
||||
|
||||
GLFW 3 key tokens map to physical keys, unlike in GLFW 2 where they mapped to
|
||||
the values generated by the current keyboard layout. The tokens are named
|
||||
according to the values they would have in the standard US layout, but this
|
||||
is only a convenience, as most programmers are assumed to know that layout.
|
||||
This means that (for example) `GLFW_KEY_LEFT_BRACKET` is always a single key and
|
||||
is the same key in the same place regardless of what keyboard layouts the users
|
||||
of your program have.
|
||||
|
||||
The key input facility was never meant for text input, although using it that
|
||||
way worked slightly better in GLFW 2. If you were using it to input text, you
|
||||
should be using the character callback instead, on both GLFW 2 and 3. This will
|
||||
give you the characters being input, as opposed to the keys being pressed.
|
||||
|
||||
GLFW 3 has key tokens for all keys on a standard 105 key keyboard, so instead of
|
||||
having to remember whether to check for `a` or `A`, you now check for
|
||||
@ref GLFW_KEY_A.
|
||||
|
||||
|
||||
@subsection moving_joystick Joystick function changes
|
||||
|
||||
The `glfwGetJoystickPos` function has been renamed to @ref glfwGetJoystickAxes.
|
||||
|
||||
The `glfwGetJoystickParam` function and the `GLFW_PRESENT`, `GLFW_AXES` and
|
||||
`GLFW_BUTTONS` tokens have been replaced by the @ref glfwJoystickPresent
|
||||
function as well as axis and button counts returned by the @ref
|
||||
glfwGetJoystickAxes and @ref glfwGetJoystickButtons functions.
|
||||
|
||||
|
||||
@subsection moving_mbcs Win32 MBCS support
|
||||
|
||||
The Win32 port of GLFW 3 will not compile in
|
||||
[MBCS mode](http://msdn.microsoft.com/en-us/library/5z097dxa.aspx).
|
||||
[MBCS mode](https://msdn.microsoft.com/en-us/library/5z097dxa.aspx).
|
||||
However, because the use of the Unicode version of the Win32 API doesn't affect
|
||||
the process as a whole, but only those windows created using it, it's perfectly
|
||||
possible to call MBCS functions from other parts of the same application.
|
||||
|
@ -103,7 +393,7 @@ All explicit support for version of Windows older than XP has been removed.
|
|||
There is no code that actively prevents GLFW 3 from running on these earlier
|
||||
versions, but it uses Win32 functions that those versions lack.
|
||||
|
||||
Windows XP was released in 2001, and by now (2013) it has not only
|
||||
Windows XP was released in 2001, and by now (January 2015) it has not only
|
||||
replaced almost all earlier versions of Windows, but is itself rapidly being
|
||||
replaced by Windows 7 and 8. The MSDN library doesn't even provide
|
||||
documentation for version older than Windows 2000, making it difficult to
|
||||
|
@ -125,144 +415,50 @@ or something else, are nowadays expected to be good desktop citizens and allow
|
|||
these hotkeys to function even when running in full screen mode.
|
||||
|
||||
|
||||
@subsection moving_autopoll Automatic polling of events
|
||||
|
||||
GLFW 3 does not automatically poll for events on @ref glfwSwapBuffers, which
|
||||
means you need to call @ref glfwPollEvents or @ref glfwWaitEvents yourself.
|
||||
Unlike buffer swap, the event processing functions act on all windows at once.
|
||||
|
||||
|
||||
@subsection moving_terminate Automatic termination
|
||||
|
||||
GLFW 3 does not register @ref glfwTerminate with `atexit` at initialization. To
|
||||
properly release all resources allocated by GLFW, you should therefore call @ref
|
||||
glfwTerminate yourself before exiting.
|
||||
GLFW 3 does not register @ref glfwTerminate with `atexit` at initialization,
|
||||
because `exit` calls registered functions from the calling thread and while it
|
||||
is permitted to call `exit` from any thread, @ref glfwTerminate must only be
|
||||
called from the main thread.
|
||||
|
||||
To release all resources allocated by GLFW, you should call @ref glfwTerminate
|
||||
yourself, from the main thread, before the program terminates. Note that this
|
||||
destroys all windows not already destroyed with @ref glfwDestroyWindow,
|
||||
invalidating any window handles you may still have.
|
||||
|
||||
|
||||
@subsection moving_glu GLU header inclusion
|
||||
|
||||
GLFW 3 does not include the GLU header by default and GLU itself has been
|
||||
deprecated, but you can request that the GLFW 3 header includes it by defining
|
||||
`GLFW_INCLUDE_GLU` before the inclusion of the GLFW 3 header.
|
||||
GLFW 3 does not by default include the GLU header and GLU itself has been
|
||||
deprecated by [Khronos](https://en.wikipedia.org/wiki/Khronos_Group). __New
|
||||
projects should not use GLU__, but if you need it for legacy code that
|
||||
has been moved to GLFW 3, you can request that the GLFW header includes it by
|
||||
defining @ref GLFW_INCLUDE_GLU before the inclusion of the GLFW header.
|
||||
|
||||
@par Old syntax
|
||||
@code
|
||||
#include <GL/glfw.h>
|
||||
@endcode
|
||||
|
||||
@par New syntax
|
||||
@code
|
||||
#define GLFW_INCLUDE_GLU
|
||||
#include <GLFW/glfw3.h>
|
||||
@endcode
|
||||
|
||||
There are many libraries that offer replacements for the functionality offered
|
||||
by GLU. For the matrix helper functions, see math libraries like
|
||||
[GLM](https://github.com/g-truc/glm) (for C++),
|
||||
[linmath.h](https://github.com/datenwolf/linmath.h) (for C) and others. For the
|
||||
tessellation functions, see for example
|
||||
[libtess2](https://github.com/memononen/libtess2).
|
||||
|
||||
|
||||
@section moving_changed Changes to existing features
|
||||
|
||||
@subsection moving_window_handles Window handles
|
||||
|
||||
Because GLFW 3 supports multiple windows, window handle parameters have been
|
||||
added to all window-related GLFW functions and callbacks. The handle of
|
||||
a newly created window is returned by @ref glfwCreateWindow (formerly
|
||||
`glfwOpenWindow`). Window handles are of the `GLFWwindow*` type, i.e. a pointer
|
||||
to an opaque struct.
|
||||
@section moving_tables Name change tables
|
||||
|
||||
|
||||
@subsection moving_monitor Multi-monitor support
|
||||
|
||||
GLFW 3 provides support for multiple monitors, adding the `GLFWmonitor*` handle
|
||||
type and a set of related functions. To request a full screen mode window,
|
||||
instead of passing `GLFW_FULLSCREEN` you specify which monitor you wish the
|
||||
window to use. There is @ref glfwGetPrimaryMonitor that provides behaviour
|
||||
similar to that of GLFW 2.
|
||||
|
||||
|
||||
@subsection moving_window_close Window closing
|
||||
|
||||
Window closing is now just an event like any other. GLFW 3 windows won't
|
||||
disappear from underfoot even when no close callback is set; instead the
|
||||
window's close flag is set. You can query this flag using @ref
|
||||
glfwWindowShouldClose, or capture close events by setting a close callback. The
|
||||
close flag can be modified from any point in your program using @ref
|
||||
glfwSetWindowShouldClose.
|
||||
|
||||
|
||||
@subsection moving_context Explicit context management
|
||||
|
||||
Each GLFW 3 window has its own OpenGL context and only you, the user, can know
|
||||
which context should be current on which thread at any given time. Therefore,
|
||||
GLFW 3 makes no assumptions about when you want a certain context to be current,
|
||||
leaving that decision to you.
|
||||
|
||||
This means, among other things, that you need to call @ref
|
||||
glfwMakeContextCurrent after creating a window before you can call any OpenGL
|
||||
functions.
|
||||
|
||||
|
||||
@subsection moving_repeat Key repeat
|
||||
|
||||
The `GLFW_KEY_REPEAT` enable has been removed and key repeat is always enabled
|
||||
for both keys and characters. A new key action, `GLFW_REPEAT`, has been added
|
||||
to allow the [key callback](@ref GLFWkeyfun) to distinguish an initial key press
|
||||
from a repeat. Note that @ref glfwGetKey still returns only `GLFW_PRESS` or
|
||||
`GLFW_RELEASE`.
|
||||
|
||||
|
||||
@subsection moving_keys Physical key input
|
||||
|
||||
GLFW 3 key tokens map to physical keys, unlike in GLFW 2 where they mapped to
|
||||
the values generated by the current keyboard layout. The tokens are named
|
||||
according to the values they would have using the standard US layout, but this
|
||||
is only a convenience, as most programmers are assumed to know that layout.
|
||||
This means that (for example) `GLFW_KEY_LEFT_BRACKET` is always a single key and
|
||||
is the same key in the same place regardless of what keyboard layouts the users
|
||||
of your program has.
|
||||
|
||||
The key input facility was never meant for text input, although using it that
|
||||
way worked slightly better in GLFW 2. If you were using it to input text, you
|
||||
should be using the character callback instead, on both GLFW 2 and 3. This will
|
||||
give you the characters being input, as opposed to the keys being pressed.
|
||||
|
||||
GLFW 3 has key tokens for all keys on a standard 105 key keyboard, so instead of
|
||||
having to remember whether to check for `'a'` or `'A'`, you now check for
|
||||
`GLFW_KEY_A`.
|
||||
|
||||
|
||||
@subsection moving_joystick Joystick input
|
||||
|
||||
The `glfwGetJoystickPos` function has been renamed to @ref glfwGetJoystickAxes.
|
||||
|
||||
The `glfwGetJoystickParam` function and the `GLFW_PRESENT`, `GLFW_AXES` and
|
||||
`GLFW_BUTTONS` tokens have been replaced by the @ref glfwJoystickPresent
|
||||
function as well as axis and button counts returned by the @ref
|
||||
glfwGetJoystickAxes and @ref glfwGetJoystickButtons functions.
|
||||
|
||||
|
||||
@subsection moving_video_modes Video mode enumeration
|
||||
|
||||
Video mode enumeration is now per-monitor. The @ref glfwGetVideoModes function
|
||||
now returns all available modes for a specific monitor instead of requiring you
|
||||
to guess how large an array you need. The `glfwGetDesktopMode` function, which
|
||||
had poorly defined behavior, has been replaced by @ref glfwGetVideoMode, which
|
||||
returns the current mode of a monitor.
|
||||
|
||||
|
||||
@subsection moving_cursor Cursor positioning
|
||||
|
||||
GLFW 3 only allows you to position the cursor within a window using @ref
|
||||
glfwSetCursorPos (formerly `glfwSetMousePos`) when that window is active.
|
||||
Unless the window is active, the function fails silently.
|
||||
|
||||
|
||||
@subsection moving_hints Persistent window hints
|
||||
|
||||
Window hints are no longer reset to their default values on window creation, but
|
||||
instead retain their values until modified by @ref glfwWindowHint (formerly
|
||||
`glfwOpenWindowHint`) or @ref glfwDefaultWindowHints, or until the library is
|
||||
terminated and re-initialized.
|
||||
|
||||
|
||||
@section moving_renamed Name changes
|
||||
|
||||
@subsection moving_renamed_files Library and header file
|
||||
|
||||
The GLFW 3 header is named @ref glfw3.h and moved to the `GLFW` directory, to
|
||||
avoid collisions with the headers of other major versions. Similarly, the GLFW
|
||||
3 library is named `glfw3,` except when it's installed as a shared library on
|
||||
Unix-like systems, where it uses the
|
||||
[soname](https://en.wikipedia.org/wiki/soname) `libglfw.so.3`.
|
||||
|
||||
|
||||
@subsection moving_renamed_functions Functions
|
||||
@subsection moving_renamed_functions Renamed functions
|
||||
|
||||
| GLFW 2 | GLFW 3 | Notes |
|
||||
| --------------------------- | ----------------------------- | ----- |
|
||||
|
@ -281,7 +477,16 @@ Unix-like systems, where it uses the
|
|||
| `glfwGetDesktopMode` | @ref glfwGetVideoMode | Returns the current mode of a monitor |
|
||||
| `glfwGetJoystickParam` | @ref glfwJoystickPresent | The axis and button counts are provided by @ref glfwGetJoystickAxes and @ref glfwGetJoystickButtons |
|
||||
|
||||
@subsection moving_renamed_tokens Tokens
|
||||
|
||||
@subsection moving_renamed_types Renamed types
|
||||
|
||||
| GLFW 2 | GLFW 3 | Notes |
|
||||
| ------------------- | --------------------- | |
|
||||
| `GLFWmousewheelfun` | @ref GLFWscrollfun | |
|
||||
| `GLFWmouseposfun` | @ref GLFWcursorposfun | |
|
||||
|
||||
|
||||
@subsection moving_renamed_tokens Renamed tokens
|
||||
|
||||
| GLFW 2 | GLFW 3 | Notes |
|
||||
| --------------------------- | ---------------------------- | ----- |
|
||||
|
|
311
docs/news.dox
311
docs/news.dox
|
@ -1,173 +1,292 @@
|
|||
/*!
|
||||
|
||||
@page news New features
|
||||
@page news Release notes
|
||||
|
||||
@tableofcontents
|
||||
|
||||
|
||||
@section news_30 New features in version 3.0
|
||||
@section news_34 Release notes for version 3.4
|
||||
|
||||
@subsection news_30_cmake CMake build system
|
||||
@subsection features_34 New features in version 3.4
|
||||
|
||||
GLFW now uses the CMake build system instead of the various makefiles and
|
||||
project files used by earlier versions. CMake is available for all platforms
|
||||
supported by GLFW, is present in most package systems and can generate
|
||||
makefiles and/or project files for most popular development environments.
|
||||
@subsubsection runtime_platform_34 Runtime platform selection
|
||||
|
||||
For more information on how to use CMake, see the
|
||||
[CMake manual](http://cmake.org/cmake/help/documentation.html).
|
||||
GLFW now supports being compiled for multiple backends and selecting between
|
||||
them at runtime with the @ref GLFW_PLATFORM init hint. After initialization the
|
||||
selected platform can be queried with @ref glfwGetPlatform. You can check if
|
||||
support for a given platform is compiled in with @ref glfwPlatformSupported.
|
||||
|
||||
|
||||
@subsection new_30_multiwnd Multi-window support
|
||||
@subsubsection standard_cursors_34 More standard cursors
|
||||
|
||||
GLFW now supports the creation of multiple windows, each with their own OpenGL
|
||||
or OpenGL ES context, and all window functions now take a window handle. Event
|
||||
callbacks are now per-window and are provided with the handle of the window that
|
||||
received the event. The @ref glfwMakeContextCurrent function has been added to
|
||||
select which context is current on a given thread.
|
||||
GLFW now provides the standard cursor shapes @ref GLFW_RESIZE_NWSE_CURSOR and
|
||||
@ref GLFW_RESIZE_NESW_CURSOR for diagonal resizing, @ref GLFW_RESIZE_ALL_CURSOR
|
||||
for omnidirectional resizing and @ref GLFW_NOT_ALLOWED_CURSOR for showing an
|
||||
action is not allowed.
|
||||
|
||||
Unlike the original set, these shapes may not be available everywhere and
|
||||
creation will then fail with the new @ref GLFW_CURSOR_UNAVAILABLE error.
|
||||
|
||||
@subsection news_30_multimon Multi-monitor support
|
||||
The cursors for horizontal and vertical resizing are now referred to as @ref
|
||||
GLFW_RESIZE_EW_CURSOR and @ref GLFW_RESIZE_NS_CURSOR, and the pointing hand
|
||||
cursor is now referred to as @ref GLFW_POINTING_HAND_CURSOR. The older names
|
||||
are still available.
|
||||
|
||||
GLFW now explicitly supports multiple monitors. They can be enumerated with
|
||||
@ref glfwGetMonitors, queried with @ref glfwGetVideoModes, @ref
|
||||
glfwGetMonitorPos, @ref glfwGetMonitorName and @ref glfwGetMonitorPhysicalSize,
|
||||
and specified at window creation to make the newly created window full screen on
|
||||
that specific monitor.
|
||||
For more information see @ref cursor_standard.
|
||||
|
||||
|
||||
@subsection news_30_unicode Unicode support
|
||||
@subsubsection mouse_passthrough_34 Mouse event passthrough
|
||||
|
||||
All string arguments to GLFW functions and all strings returned by GLFW now use
|
||||
the UTF-8 encoding. This includes the window title, error string, clipboard
|
||||
text, monitor and joystick names as well as the extension function arguments (as
|
||||
ASCII is a subset of UTF-8).
|
||||
GLFW now provides the [GLFW_MOUSE_PASSTHROUGH](@ref GLFW_MOUSE_PASSTHROUGH_hint)
|
||||
window hint for making a window transparent to mouse input, lettings events pass
|
||||
to whatever window is behind it. This can also be changed after window
|
||||
creation with the matching [window attribute](@ref GLFW_MOUSE_PASSTHROUGH_attrib).
|
||||
|
||||
|
||||
@subsection news_30_clipboard Clipboard text I/O
|
||||
@subsubsection wayland_libdecor_34 Wayland libdecor decorations
|
||||
|
||||
GLFW now supports reading and writing plain text to and from the system
|
||||
clipboard, with the @ref glfwGetClipboardString and @ref glfwSetClipboardString
|
||||
functions.
|
||||
GLFW now supports improved fallback window decorations via
|
||||
[libdecor](https://gitlab.freedesktop.org/libdecor/libdecor).
|
||||
|
||||
Support for libdecor can be toggled before GLFW is initialized with the
|
||||
[GLFW_WAYLAND_LIBDECOR](@ref GLFW_WAYLAND_LIBDECOR_hint) init hint. It is
|
||||
enabled by default.
|
||||
|
||||
@subsection news_30_gamma Gamma ramp support
|
||||
|
||||
GLFW now supports setting and reading back the gamma ramp of monitors, with the
|
||||
@ref glfwGetGammaRamp and @ref glfwSetGammaRamp functions. There is also @ref
|
||||
glfwSetGamma, which generates a ramp from a gamma value and then sets it.
|
||||
@subsubsection wayland_app_id_34 Wayland app_id specification
|
||||
|
||||
GLFW now supports specifying the app_id for a Wayland window using the
|
||||
[GLFW_WAYLAND_APP_ID](@ref GLFW_WAYLAND_APP_ID_hint) window hint string.
|
||||
|
||||
@subsection news_30_gles OpenGL ES support
|
||||
|
||||
GLFW now supports the creation of OpenGL ES contexts, by setting the
|
||||
`GLFW_CLIENT_API` window hint to `GLFW_OPENGL_ES_API`, where creation of such
|
||||
contexts are supported. Note that GLFW *does not implement* OpenGL ES, so your
|
||||
driver must provide support in a way usable by GLFW. Modern nVidia and Intel
|
||||
drivers support creation of OpenGL ES context using the GLX and WGL APIs, while
|
||||
AMD provides an EGL implementation instead.
|
||||
@subsubsection features_34_angle_backend Support for ANGLE rendering backend selection
|
||||
|
||||
GLFW now provides the
|
||||
[GLFW_ANGLE_PLATFORM_TYPE](@ref GLFW_ANGLE_PLATFORM_TYPE_hint) init hint for
|
||||
requesting a specific rendering backend when using
|
||||
[ANGLE](https://chromium.googlesource.com/angle/angle/) to create OpenGL ES
|
||||
contexts.
|
||||
|
||||
@subsection news_30_egl (Experimental) EGL support
|
||||
|
||||
GLFW now has an experimental EGL context creation back end that can be selected
|
||||
through CMake options.
|
||||
@subsubsection captured_cursor_34 Captured cursor mode
|
||||
|
||||
GLFW now supports confining the cursor to the window content area with the @ref
|
||||
GLFW_CURSOR_CAPTURED cursor mode.
|
||||
|
||||
@subsection news_30_hidpi High-DPI support
|
||||
For more information see @ref cursor_mode.
|
||||
|
||||
GLFW now supports high-DPI monitors on both Windows and OS X, giving windows full
|
||||
resolution framebuffers where other UI elements are scaled up. To achieve this,
|
||||
@ref glfwGetFramebufferSize and @ref glfwSetFramebufferSizeCallback have been
|
||||
added. These work with pixels, while the rest of the GLFW API work with screen
|
||||
coordinates.
|
||||
|
||||
@subsubsection features_34_init_allocator Support for custom memory allocator
|
||||
|
||||
@subsection news_30_error Error callback
|
||||
GLFW now supports plugging a custom memory allocator at initialization with @ref
|
||||
glfwInitAllocator. The allocator is a struct of type @ref GLFWallocator with
|
||||
function pointers corresponding to the standard library functions `malloc`,
|
||||
`realloc` and `free`.
|
||||
|
||||
GLFW now has an error callback, which can provide your application with much
|
||||
more detailed diagnostics than was previously possible. The callback is passed
|
||||
an error code and a description string.
|
||||
For more information see @ref init_allocator.
|
||||
|
||||
|
||||
@subsection news_30_wndptr Per-window user pointer
|
||||
@subsubsection features_34_position_hint Window hints for initial position
|
||||
|
||||
Each window now has a user-defined pointer, retrieved with @ref
|
||||
glfwGetWindowUserPointer and set with @ref glfwSetWindowUserPointer, to make it
|
||||
easier to integrate GLFW into C++ code.
|
||||
GLFW now provides the @ref GLFW_POSITION_X and @ref GLFW_POSITION_Y window hints for
|
||||
specifying the initial position of the window. This removes the need to create a hidden
|
||||
window, move it and then show it. The default value of these hints is
|
||||
`GLFW_ANY_POSITION`, which selects the previous behavior.
|
||||
|
||||
|
||||
@subsection news_30_iconifyfun Window iconification callback
|
||||
@subsubsection features_34_win32_keymenu Support for keyboard access to Windows window menu
|
||||
|
||||
Each window now has a callback for iconification and restoration events,
|
||||
which is set with @ref glfwSetWindowIconifyCallback.
|
||||
GLFW now provides the
|
||||
[GLFW_WIN32_KEYBOARD_MENU](@ref GLFW_WIN32_KEYBOARD_MENU_hint) window hint for
|
||||
enabling keyboard access to the window menu via the Alt+Space and
|
||||
Alt-and-then-Space shortcuts. This may be useful for more GUI-oriented
|
||||
applications.
|
||||
|
||||
|
||||
@subsection news_30_wndposfun Window position callback
|
||||
@subsection caveats Caveats for version 3.4
|
||||
|
||||
Each window now has a callback for position events, which is set with @ref
|
||||
glfwSetWindowPosCallback.
|
||||
@subsubsection native_34 Multiple sets of native access functions
|
||||
|
||||
Because GLFW now supports runtime selection of platform (window system), a library binary
|
||||
may export native access functions for multiple platforms. Starting with version 3.4 you
|
||||
must not assume that GLFW is running on a platform just because it exports native access
|
||||
functions for it. After initialization, you can query the selected platform with @ref
|
||||
glfwGetPlatform.
|
||||
|
||||
@subsection news_30_wndpos Window position query
|
||||
|
||||
The position of a window can now be retrieved using @ref glfwGetWindowPos.
|
||||
@subsubsection version_string_34 Version string format has been changed
|
||||
|
||||
Because GLFW now supports runtime selection of platform (window system), the version
|
||||
string returned by @ref glfwGetVersionString has been expanded. It now contains the names
|
||||
of all APIs for all the platforms that the library binary supports.
|
||||
|
||||
@subsection news_30_focusfun Window focus callback
|
||||
|
||||
Each windows now has a callback for focus events, which is set with @ref
|
||||
glfwSetWindowFocusCallback.
|
||||
@subsubsection joysticks_34 Joystick support is initialized on demand
|
||||
|
||||
The joystick part of GLFW is now initialized when first used, primarily to work
|
||||
around faulty Windows drivers that cause DirectInput to take up to several
|
||||
seconds to enumerate devices.
|
||||
|
||||
@subsection news_30_enterleave Cursor enter/leave callback
|
||||
This change will usually not be observable. However, if your application waits
|
||||
for events without having first called any joystick function or created any
|
||||
visible windows, the wait may never unblock as GLFW may not yet have subscribed
|
||||
to joystick related OS events.
|
||||
|
||||
Each window now has a callback for when the mouse cursor enters or leaves its
|
||||
client area, which is set with @ref glfwSetCursorEnterCallback.
|
||||
To work around this, call any joystick function before waiting for events, for
|
||||
example by setting a [joystick callback](@ref joystick_event).
|
||||
|
||||
|
||||
@subsection news_30_wndtitle Initial window title
|
||||
@subsubsection wayland_alpha_34 Frambuffer may lack alpha channel on older Wayland systems
|
||||
|
||||
The title of a window is now specified at creation time, as one of the arguments
|
||||
to @ref glfwCreateWindow.
|
||||
On Wayland, when creating an EGL context on a machine lacking the new
|
||||
`EGL_EXT_present_opaque` extension, the @ref GLFW_ALPHA_BITS window hint will be
|
||||
ignored and the framebuffer will have no alpha channel. This is because some
|
||||
Wayland compositors treat any buffer with an alpha channel as per-pixel
|
||||
transparent.
|
||||
|
||||
If you want a per-pixel transparent window, see the
|
||||
[GLFW_TRANSPARENT_FRAMEBUFFER](@ref GLFW_TRANSPARENT_FRAMEBUFFER_hint) window
|
||||
hint.
|
||||
|
||||
@subsection news_30_hidden Hidden windows
|
||||
|
||||
Windows can now be hidden with @ref glfwHideWindow, shown using @ref
|
||||
glfwShowWindow and created initially hidden with the `GLFW_VISIBLE` window hint.
|
||||
This allows for off-screen rendering in a way compatible with most drivers, as
|
||||
well as moving a window to a specific position before showing it.
|
||||
@subsubsection standalone_34 Tests and examples are disabled when built as a subproject
|
||||
|
||||
GLFW now does not build the tests and examples when it is added as
|
||||
a subdirectory of another CMake project. To enable these, set the @ref
|
||||
GLFW_BUILD_TESTS and @ref GLFW_BUILD_EXAMPLES cache variables before adding the
|
||||
GLFW subdirectory.
|
||||
|
||||
@subsection news_30_undecorated Undecorated windows
|
||||
@code{.cmake}
|
||||
set(GLFW_BUILD_EXAMPLES ON CACHE BOOL "" FORCE)
|
||||
set(GLFW_BUILD_TESTS ON CACHE BOOL "" FORCE)
|
||||
add_subdirectory(path/to/glfw)
|
||||
@endcode
|
||||
|
||||
Windowed mode windows can now be created without decorations, i.e. things like
|
||||
a frame, a title bar, with the `GLFW_DECORATED` window hint. This allows for
|
||||
the creation of things like splash screens.
|
||||
|
||||
@subsubsection initmenu_34 macOS main menu now created at initialization
|
||||
|
||||
@subsection news_30_keymods Modifier key bit masks
|
||||
GLFW now creates the main menu and completes the initialization of NSApplication
|
||||
during initialization. Programs that do not want a main menu can disable it
|
||||
with the [GLFW_COCOA_MENUBAR](@ref GLFW_COCOA_MENUBAR_hint) init hint.
|
||||
|
||||
[Modifier key bit mask](@ref mods) parameters have been added to the
|
||||
[mouse button](@ref GLFWmousebuttonfun) and [key](@ref GLFWkeyfun) callbacks.
|
||||
|
||||
@subsubsection corevideo_34 CoreVideo dependency has been removed
|
||||
|
||||
@subsection news_30_scancode Platform-specific scancodes
|
||||
GLFW no longer depends on the CoreVideo framework on macOS and it no longer
|
||||
needs to be specified during compilation or linking.
|
||||
|
||||
A scancode parameter has been added to the [key callback](@ref GLFWkeyfun). Keys
|
||||
that don't have a [key token](@ref keys) still get passed on with the key
|
||||
parameter set to `GLFW_KEY_UNKNOWN`. These scancodes will vary between machines
|
||||
and are intended to be used for key bindings.
|
||||
|
||||
@subsubsection caveat_fbtransparency_34 Framebuffer transparency requires DWM transparency
|
||||
|
||||
@subsection news_30_jsname Joystick names
|
||||
GLFW no longer supports framebuffer transparency enabled via @ref
|
||||
GLFW_TRANSPARENT_FRAMEBUFFER on Windows 7 if DWM transparency is off
|
||||
(the Transparency setting under Personalization > Window Color).
|
||||
|
||||
The name of a joystick can now be retrieved using @ref glfwGetJoystickName.
|
||||
|
||||
@subsubsection emptyevents_34 Empty events on X11 no longer round-trip to server
|
||||
|
||||
@subsection news_30_doxygen Doxygen documentation
|
||||
Events posted with @ref glfwPostEmptyEvent now use a separate unnamed pipe
|
||||
instead of sending an X11 client event to the helper window.
|
||||
|
||||
You are reading it.
|
||||
|
||||
@subsection deprecations_34 Deprecations in version 3.4
|
||||
|
||||
@subsection removals_34 Removals in 3.4
|
||||
|
||||
@subsubsection vulkan_static_34 GLFW_VULKAN_STATIC CMake option has been removed
|
||||
|
||||
This option was used to compile GLFW directly linked with the Vulkan loader, instead of
|
||||
using dynamic loading to get hold of `vkGetInstanceProcAddr` at initialization. This is
|
||||
now done by calling the @ref glfwInitVulkanLoader function before initialization.
|
||||
|
||||
If you need backward compatibility, this macro can still be defined for GLFW 3.4 and will
|
||||
have no effect. The call to @ref glfwInitVulkanLoader can be conditionally enabled in
|
||||
your code by checking the @ref GLFW_VERSION_MAJOR and @ref GLFW_VERSION_MINOR macros.
|
||||
|
||||
|
||||
@subsubsection osmesa_option_34 GLFW_USE_OSMESA CMake option has been removed
|
||||
|
||||
This option was used to compile GLFW for the Null platform. The Null platform is now
|
||||
always supported. To produce a library binary that only supports this platform, the way
|
||||
this CMake option used to do, you will instead need to disable the default platform for
|
||||
the target OS. This means setting the @ref GLFW_BUILD_WIN32, @ref GLFW_BUILD_COCOA or
|
||||
@ref GLFW_BUILD_X11 CMake option to false.
|
||||
|
||||
You can set all of them to false and the ones that don't apply for the target OS will be
|
||||
ignored.
|
||||
|
||||
|
||||
@subsubsection wl_shell_34 Support for the wl_shell protocol has been removed
|
||||
|
||||
Support for the wl_shell protocol has been removed and GLFW now only supports
|
||||
the XDG-Shell protocol. If your Wayland compositor does not support XDG-Shell
|
||||
then GLFW will fail to initialize.
|
||||
|
||||
|
||||
@subsection symbols_34 New symbols in version 3.4
|
||||
|
||||
@subsubsection functions_34 New functions in version 3.4
|
||||
|
||||
- @ref glfwInitAllocator
|
||||
- @ref glfwGetPlatform
|
||||
- @ref glfwPlatformSupported
|
||||
- @ref glfwInitVulkanLoader
|
||||
|
||||
|
||||
@subsubsection types_34 New types in version 3.4
|
||||
|
||||
- @ref GLFWallocator
|
||||
- @ref GLFWallocatefun
|
||||
- @ref GLFWreallocatefun
|
||||
- @ref GLFWdeallocatefun
|
||||
|
||||
|
||||
@subsubsection constants_34 New constants in version 3.4
|
||||
|
||||
- @ref GLFW_PLATFORM
|
||||
- @ref GLFW_ANY_PLATFORM
|
||||
- @ref GLFW_PLATFORM_WIN32
|
||||
- @ref GLFW_PLATFORM_COCOA
|
||||
- @ref GLFW_PLATFORM_WAYLAND
|
||||
- @ref GLFW_PLATFORM_X11
|
||||
- @ref GLFW_PLATFORM_NULL
|
||||
- @ref GLFW_PLATFORM_UNAVAILABLE
|
||||
- @ref GLFW_POINTING_HAND_CURSOR
|
||||
- @ref GLFW_RESIZE_EW_CURSOR
|
||||
- @ref GLFW_RESIZE_NS_CURSOR
|
||||
- @ref GLFW_RESIZE_NWSE_CURSOR
|
||||
- @ref GLFW_RESIZE_NESW_CURSOR
|
||||
- @ref GLFW_RESIZE_ALL_CURSOR
|
||||
- @ref GLFW_MOUSE_PASSTHROUGH
|
||||
- @ref GLFW_NOT_ALLOWED_CURSOR
|
||||
- @ref GLFW_CURSOR_UNAVAILABLE
|
||||
- @ref GLFW_WIN32_KEYBOARD_MENU
|
||||
- @ref GLFW_CONTEXT_DEBUG
|
||||
- @ref GLFW_FEATURE_UNAVAILABLE
|
||||
- @ref GLFW_FEATURE_UNIMPLEMENTED
|
||||
- @ref GLFW_ANGLE_PLATFORM_TYPE
|
||||
- @ref GLFW_ANGLE_PLATFORM_TYPE_NONE
|
||||
- @ref GLFW_ANGLE_PLATFORM_TYPE_OPENGL
|
||||
- @ref GLFW_ANGLE_PLATFORM_TYPE_OPENGLES
|
||||
- @ref GLFW_ANGLE_PLATFORM_TYPE_D3D9
|
||||
- @ref GLFW_ANGLE_PLATFORM_TYPE_D3D11
|
||||
- @ref GLFW_ANGLE_PLATFORM_TYPE_VULKAN
|
||||
- @ref GLFW_ANGLE_PLATFORM_TYPE_METAL
|
||||
- @ref GLFW_X11_XCB_VULKAN_SURFACE
|
||||
- @ref GLFW_CURSOR_CAPTURED
|
||||
- @ref GLFW_POSITION_X
|
||||
- @ref GLFW_POSITION_Y
|
||||
- @ref GLFW_ANY_POSITION
|
||||
- @ref GLFW_WAYLAND_LIBDECOR
|
||||
- @ref GLFW_WAYLAND_PREFER_LIBDECOR
|
||||
- @ref GLFW_WAYLAND_DISABLE_LIBDECOR
|
||||
|
||||
|
||||
@section news_archive Release notes for earlier versions
|
||||
|
||||
- [Release notes for 3.3](https://www.glfw.org/docs/3.3/news.html)
|
||||
- [Release notes for 3.2](https://www.glfw.org/docs/3.2/news.html)
|
||||
- [Release notes for 3.1](https://www.glfw.org/docs/3.1/news.html)
|
||||
- [Release notes for 3.0](https://www.glfw.org/docs/3.0/news.html)
|
||||
|
||||
*/
|
||||
|
|
352
docs/quick.dox
352
docs/quick.dox
|
@ -1,151 +1,155 @@
|
|||
/*!
|
||||
|
||||
@page quick Getting started
|
||||
@page quick_guide Getting started
|
||||
|
||||
@tableofcontents
|
||||
|
||||
This guide will show how to write simple OpenGL applications using GLFW 3. It
|
||||
will introduce a few of the most commonly used functions, but there are many
|
||||
others. To see detailed documentation on any GLFW function, just click on its
|
||||
name.
|
||||
This guide takes you through writing a small application using GLFW 3. The
|
||||
application will create a window and OpenGL context, render a rotating triangle
|
||||
and exit when the user closes the window or presses _Escape_. This guide will
|
||||
introduce a few of the most commonly used functions, but there are many more.
|
||||
|
||||
This guide assumes no experience with earlier versions of GLFW. If you
|
||||
have used GLFW 2.x in the past, you should also read the
|
||||
[transition guide](@ref moving).
|
||||
have used GLFW 2 in the past, read @ref moving_guide, as some functions
|
||||
behave differently in GLFW 3.
|
||||
|
||||
|
||||
@section quick_include Including the GLFW header
|
||||
@section quick_steps Step by step
|
||||
|
||||
In the files of your program where you use OpenGL or GLFW, you need to include
|
||||
the GLFW 3 header file.
|
||||
@subsection quick_include Including the GLFW header
|
||||
|
||||
In the source files of your application where you use GLFW, you need to include
|
||||
its header file.
|
||||
|
||||
@code
|
||||
#include <GLFW/glfw3.h>
|
||||
@endcode
|
||||
|
||||
This defines all the constants, types and function prototypes of the GLFW API.
|
||||
It also includes the OpenGL header, and defines all the constants and types
|
||||
necessary for it to work on your platform.
|
||||
This header provides all the constants, types and function prototypes of the
|
||||
GLFW API.
|
||||
|
||||
For example, under Windows you are normally required to include `windows.h`
|
||||
before including `GL/gl.h`. This would make your source file tied to Windows
|
||||
and pollute your code's namespace with the whole Win32 API.
|
||||
By default it also includes the OpenGL header from your development environment.
|
||||
On some platforms this header only supports older versions of OpenGL. The most
|
||||
extreme case is Windows, where it typically only supports OpenGL 1.2.
|
||||
|
||||
Instead, the GLFW header takes care of this for you, not by including
|
||||
`windows.h`, but rather by itself duplicating only the necessary parts of it.
|
||||
It does this only where needed, so if `windows.h` *is* included, the GLFW header
|
||||
does not try to redefine those symbols.
|
||||
|
||||
In other words:
|
||||
|
||||
- Do *not* include the OpenGL headers yourself, as GLFW does this for you
|
||||
- Do *not* include `windows.h` or other platform-specific headers unless
|
||||
you plan on using those APIs directly
|
||||
- If you *do* need to include such headers, do it *before* including the
|
||||
GLFW one and it will detect this
|
||||
|
||||
Starting with version 3.0, the GLU header `glu.h` is no longer included by
|
||||
default. If you wish to include it, define `GLFW_INCLUDE_GLU` before the
|
||||
inclusion of the GLFW header.
|
||||
Most programs will instead use an
|
||||
[extension loader library](@ref context_glext_auto) and include its header.
|
||||
This example uses files generated by [glad](https://gen.glad.sh/). The GLFW
|
||||
header can detect most such headers if they are included first and will then not
|
||||
include the one from your development environment.
|
||||
|
||||
@code
|
||||
#define GLFW_INCLUDE_GLU
|
||||
#include <glad/gl.h>
|
||||
#include <GLFW/glfw3.h>
|
||||
@endcode
|
||||
|
||||
To make sure there will be no header conflicts, you can define @ref
|
||||
GLFW_INCLUDE_NONE before the GLFW header to explicitly disable inclusion of the
|
||||
development environment header. This also allows the two headers to be included
|
||||
in any order.
|
||||
|
||||
@section quick_init_term Initializing and terminating GLFW
|
||||
@code
|
||||
#define GLFW_INCLUDE_NONE
|
||||
#include <GLFW/glfw3.h>
|
||||
#include <glad/gl.h>
|
||||
@endcode
|
||||
|
||||
Before you can use most GLFW functions, the library must be initialized. This
|
||||
is done with @ref glfwInit, which returns non-zero if successful, or zero if an
|
||||
error occurred.
|
||||
|
||||
@subsection quick_init_term Initializing and terminating GLFW
|
||||
|
||||
Before you can use most GLFW functions, the library must be initialized. On
|
||||
successful initialization, `GLFW_TRUE` is returned. If an error occurred,
|
||||
`GLFW_FALSE` is returned.
|
||||
|
||||
@code
|
||||
if (!glfwInit())
|
||||
exit(EXIT_FAILURE);
|
||||
{
|
||||
// Initialization failed
|
||||
}
|
||||
@endcode
|
||||
|
||||
When you are done using GLFW, typically at the very end of the program, you need
|
||||
to call @ref glfwTerminate.
|
||||
Note that `GLFW_TRUE` and `GLFW_FALSE` are and will always be one and zero.
|
||||
|
||||
When you are done using GLFW, typically just before the application exits, you
|
||||
need to terminate GLFW.
|
||||
|
||||
@code
|
||||
glfwTerminate();
|
||||
@endcode
|
||||
|
||||
This destroys any remaining windows and releases any other resources allocated by
|
||||
GLFW. After this call, you must call @ref glfwInit again before using any GLFW
|
||||
GLFW. After this call, you must initialize GLFW again before using any GLFW
|
||||
functions that require it.
|
||||
|
||||
|
||||
@section quick_capture_error Setting an error callback
|
||||
@subsection quick_capture_error Setting an error callback
|
||||
|
||||
Most events are reported through callbacks, whether it's a key being pressed,
|
||||
a GLFW window being moved, or an error occurring. Callbacks are simply
|
||||
C functions (or C++ static methods) that are called by GLFW with arguments
|
||||
describing the event.
|
||||
a GLFW window being moved, or an error occurring. Callbacks are C functions (or
|
||||
C++ static methods) that are called by GLFW with arguments describing the event.
|
||||
|
||||
In case @ref glfwInit or any other GLFW function fails, an error is reported to
|
||||
the GLFW error callback. You can receive these reports by setting the error
|
||||
callback. The callback function itself should match the signature of @ref
|
||||
GLFWerrorfun. Here is a simple error callback that just prints the error
|
||||
description to `stderr`.
|
||||
In case a GLFW function fails, an error is reported to the GLFW error callback.
|
||||
You can receive these reports with an error callback. This function must have
|
||||
the signature below but may do anything permitted in other callbacks.
|
||||
|
||||
@code
|
||||
void error_callback(int error, const char* description)
|
||||
{
|
||||
fputs(description, stderr);
|
||||
fprintf(stderr, "Error: %s\n", description);
|
||||
}
|
||||
@endcode
|
||||
|
||||
Setting the callback, so GLFW knows to call it, is done with @ref
|
||||
glfwSetErrorCallback. This is one of the few GLFW functions that may be called
|
||||
before @ref glfwInit, which lets you be notified of errors during
|
||||
initialization, so you should set it before you do anything else with GLFW.
|
||||
Callback functions must be set, so GLFW knows to call them. The function to set
|
||||
the error callback is one of the few GLFW functions that may be called before
|
||||
initialization, which lets you be notified of errors both during and after
|
||||
initialization.
|
||||
|
||||
@code
|
||||
glfwSetErrorCallback(error_callback);
|
||||
@endcode
|
||||
|
||||
|
||||
@section quick_create_window Creating a window and context
|
||||
@subsection quick_create_window Creating a window and context
|
||||
|
||||
The window (and its context) is created with @ref glfwCreateWindow, which
|
||||
returns a handle to the created window. For example, this creates a 640 by 480
|
||||
windowed mode window:
|
||||
The window and its OpenGL context are created with a single call to @ref
|
||||
glfwCreateWindow, which returns a handle to the created combined window and
|
||||
context object
|
||||
|
||||
@code
|
||||
GLFWwindow* window = glfwCreateWindow(640, 480, "My Title", NULL, NULL);
|
||||
@endcode
|
||||
|
||||
If window creation fails, `NULL` will be returned, so you need to check whether
|
||||
it did.
|
||||
|
||||
@code
|
||||
if (!window)
|
||||
{
|
||||
glfwTerminate();
|
||||
exit(EXIT_FAILURE);
|
||||
// Window or OpenGL context creation failed
|
||||
}
|
||||
@endcode
|
||||
|
||||
This handle is then passed to all window related functions, and is provided to
|
||||
you along with input events, so you know which window received the input.
|
||||
This creates a 640 by 480 windowed mode window with an OpenGL context. If
|
||||
window or OpenGL context creation fails, `NULL` will be returned. You should
|
||||
always check the return value. While window creation rarely fails, context
|
||||
creation depends on properly installed drivers and may fail even on machines
|
||||
with the necessary hardware.
|
||||
|
||||
To create a full screen window, you need to specify which monitor the window
|
||||
should use. In most cases, the user's primary monitor is a good choice. You
|
||||
can get this with @ref glfwGetPrimaryMonitor. To make the above window
|
||||
full screen, just pass along the monitor handle:
|
||||
By default, the OpenGL context GLFW creates may have any version. You can
|
||||
require a minimum OpenGL version by setting the `GLFW_CONTEXT_VERSION_MAJOR` and
|
||||
`GLFW_CONTEXT_VERSION_MINOR` hints _before_ creation. If the required minimum
|
||||
version is not supported on the machine, context (and window) creation fails.
|
||||
|
||||
You can select the OpenGL profile by setting the `GLFW_OPENGL_PROFILE` hint.
|
||||
This program uses the core profile as that is the only profile macOS supports
|
||||
for OpenGL 3.x and 4.x.
|
||||
|
||||
@code
|
||||
GLFWwindow* window = glfwCreateWindow(640, 480, "My Title", glfwGetPrimaryMonitor(), NULL);
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
|
||||
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
|
||||
GLFWwindow* window = glfwCreateWindow(640, 480, "My Title", NULL, NULL);
|
||||
if (!window)
|
||||
{
|
||||
// Window or context creation failed
|
||||
}
|
||||
@endcode
|
||||
|
||||
Full screen windows cover the entire screen, have no border or decorations, and
|
||||
change the monitor's resolution to the one most closely matching the requested
|
||||
window size.
|
||||
|
||||
When you are done with the window, destroy it with the @ref glfwDestroyWindow
|
||||
function.
|
||||
When a window and context is no longer needed, destroy it.
|
||||
|
||||
@code
|
||||
glfwDestroyWindow(window);
|
||||
|
@ -155,26 +159,35 @@ Once this function is called, no more events will be delivered for that window
|
|||
and its handle becomes invalid.
|
||||
|
||||
|
||||
@section quick_context_current Making the OpenGL context current
|
||||
@subsection quick_context_current Making the OpenGL context current
|
||||
|
||||
Before you can use the OpenGL API, it must have a current OpenGL context. You
|
||||
make a window's context current with @ref glfwMakeContextCurrent. It will then
|
||||
remain as the current context until you make another context current or until
|
||||
the window owning it is destroyed.
|
||||
Before you can use the OpenGL API, you must have a current OpenGL context.
|
||||
|
||||
@code
|
||||
glfwMakeContextCurrent(window);
|
||||
@endcode
|
||||
|
||||
The context will remain current until you make another context current or until
|
||||
the window owning the current context is destroyed.
|
||||
|
||||
@section quick_window_close Checking the window close flag
|
||||
If you are using an [extension loader library](@ref context_glext_auto) to
|
||||
access modern OpenGL then this is when to initialize it, as the loader needs
|
||||
a current context to load from. This example uses
|
||||
[glad](https://github.com/Dav1dde/glad), but the same rule applies to all such
|
||||
libraries.
|
||||
|
||||
Each window has a flag indicating whether the window should be closed. This can
|
||||
be checked with @ref glfwWindowShouldClose.
|
||||
@code
|
||||
gladLoadGL(glfwGetProcAddress);
|
||||
@endcode
|
||||
|
||||
|
||||
@subsection quick_window_close Checking the window close flag
|
||||
|
||||
Each window has a flag indicating whether the window should be closed.
|
||||
|
||||
When the user attempts to close the window, either by pressing the close widget
|
||||
in the title bar or using a key combination like Alt+F4, this flag is set to 1.
|
||||
Note that **the window isn't actually closed**, so you are expected to monitor
|
||||
Note that __the window isn't actually closed__, so you are expected to monitor
|
||||
this flag and either destroy the window or give some kind of feedback to the
|
||||
user.
|
||||
|
||||
|
@ -185,39 +198,44 @@ while (!glfwWindowShouldClose(window))
|
|||
}
|
||||
@endcode
|
||||
|
||||
You can be notified when user is attempting to close the window by setting
|
||||
You can be notified when the user is attempting to close the window by setting
|
||||
a close callback with @ref glfwSetWindowCloseCallback. The callback will be
|
||||
called immediately after the close flag has been set.
|
||||
|
||||
You can also set it yourself with @ref glfwSetWindowShouldClose. This can be
|
||||
useful if you want to interpret other kinds of input as closing the window, like
|
||||
for example pressing the escape key.
|
||||
for example pressing the _Escape_ key.
|
||||
|
||||
|
||||
@section quick_key_input Receiving input events
|
||||
@subsection quick_key_input Receiving input events
|
||||
|
||||
Each window has a large number of callbacks that can be set to receive all the
|
||||
various kinds of events. To receive key press and release events, a
|
||||
[key callback](@ref GLFWkeyfun) is set using @ref glfwSetKeyCallback.
|
||||
various kinds of events. To receive key press and release events, create a key
|
||||
callback function.
|
||||
|
||||
@code
|
||||
static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
|
||||
{
|
||||
if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
|
||||
glfwSetWindowShouldClose(window, GL_TRUE);
|
||||
glfwSetWindowShouldClose(window, GLFW_TRUE);
|
||||
}
|
||||
@endcode
|
||||
|
||||
For event callbacks to actually be called when an event occurs, you need to
|
||||
process events as described below.
|
||||
The key callback, like other window related callbacks, are set per-window.
|
||||
|
||||
@code
|
||||
glfwSetKeyCallback(window, key_callback);
|
||||
@endcode
|
||||
|
||||
In order for event callbacks to be called when events occur, you need to process
|
||||
events as described below.
|
||||
|
||||
|
||||
@section quick_render Rendering with OpenGL
|
||||
@subsection quick_render Rendering with OpenGL
|
||||
|
||||
Once you have a current OpenGL context, you can use OpenGL normally. In this
|
||||
tutorial, a multi-colored rotating triangle will be rendered. The framebuffer
|
||||
size, needed by this example for `glViewport` and `glOrtho`, is retrieved with
|
||||
@ref glfwGetFramebufferSize.
|
||||
tutorial, a multicolored rotating triangle will be rendered. The framebuffer
|
||||
size needs to be retrieved for `glViewport`.
|
||||
|
||||
@code
|
||||
int width, height;
|
||||
|
@ -225,81 +243,125 @@ glfwGetFramebufferSize(window, &width, &height);
|
|||
glViewport(0, 0, width, height);
|
||||
@endcode
|
||||
|
||||
However, you can also set a framebuffer size callback using @ref
|
||||
glfwSetFramebufferSizeCallback and call `glViewport` from there.
|
||||
You can also set a framebuffer size callback using @ref
|
||||
glfwSetFramebufferSizeCallback and be notified when the size changes.
|
||||
|
||||
@code
|
||||
void framebuffer_size_callback(GLFWwindow* window, int width, int height)
|
||||
{
|
||||
glViewport(0, 0, width, height);
|
||||
}
|
||||
@endcode
|
||||
The details of how to render with OpenGL is outside the scope of this tutorial,
|
||||
but there are many excellent resources for learning modern OpenGL. Here are
|
||||
a few of them:
|
||||
|
||||
- [Anton's OpenGL 4 Tutorials](https://antongerdelan.net/opengl/)
|
||||
- [Learn OpenGL](https://learnopengl.com/)
|
||||
- [Open.GL](https://open.gl/)
|
||||
|
||||
These all happen to use GLFW, but OpenGL itself works the same whatever API you
|
||||
use to create the window and context.
|
||||
|
||||
|
||||
@section quick_timer Reading the timer
|
||||
@subsection quick_timer Reading the timer
|
||||
|
||||
For the triangle to rotate properly, a time source is needed. GLFW provides
|
||||
@ref glfwGetTime, which returns the number of seconds since @ref glfwInit as
|
||||
a `double`. The time source used is the most accurate on each platform and
|
||||
generally has micro- or nanosecond resolution.
|
||||
To create smooth animation, a time source is needed. GLFW provides a timer that
|
||||
returns the number of seconds since initialization. The time source used is the
|
||||
most accurate on each platform and generally has micro- or nanosecond
|
||||
resolution.
|
||||
|
||||
@code
|
||||
double time = glfwGetTime();
|
||||
@endcode
|
||||
|
||||
|
||||
@section quick_swap_buffers Swapping buffers
|
||||
@subsection quick_swap_buffers Swapping buffers
|
||||
|
||||
GLFW windows always use double-buffering. That means that you have two
|
||||
rendering buffers; a front buffer and a back buffer. The front buffer is the
|
||||
one being displayed and the back buffer the one you render to.
|
||||
GLFW windows by default use double buffering. That means that each window has
|
||||
two rendering buffers; a front buffer and a back buffer. The front buffer is
|
||||
the one being displayed and the back buffer the one you render to.
|
||||
|
||||
When the entire frame has been rendered, it is time to swap the back and the
|
||||
front buffers in order to display the rendered frame, and begin rendering a new
|
||||
frame. This is done with @ref glfwSwapBuffers.
|
||||
When the entire frame has been rendered, the buffers need to be swapped with one
|
||||
another, so the back buffer becomes the front buffer and vice versa.
|
||||
|
||||
@code
|
||||
glfwSwapBuffers(window);
|
||||
@endcode
|
||||
|
||||
The swap interval indicates how many frames to wait until swapping the buffers,
|
||||
commonly known as _vsync_. By default, the swap interval is zero, meaning
|
||||
buffer swapping will occur immediately. On fast machines, many of those frames
|
||||
will never be seen, as the screen is still only updated typically 60-75 times
|
||||
per second, so this wastes a lot of CPU and GPU cycles.
|
||||
|
||||
@section quick_process_events Processing events
|
||||
Also, because the buffers will be swapped in the middle the screen update,
|
||||
leading to [screen tearing](https://en.wikipedia.org/wiki/Screen_tearing).
|
||||
|
||||
For these reasons, applications will typically want to set the swap interval to
|
||||
one. It can be set to higher values, but this is usually not recommended,
|
||||
because of the input latency it leads to.
|
||||
|
||||
@code
|
||||
glfwSwapInterval(1);
|
||||
@endcode
|
||||
|
||||
This function acts on the current context and will fail unless a context is
|
||||
current.
|
||||
|
||||
|
||||
@subsection quick_process_events Processing events
|
||||
|
||||
GLFW needs to communicate regularly with the window system both in order to
|
||||
receive events and to show that it hasn't locked up. Event processing must be
|
||||
done regularly and is normally done each frame before rendering but after buffer
|
||||
swap.
|
||||
receive events and to show that the application hasn't locked up. Event
|
||||
processing must be done regularly while you have visible windows and is normally
|
||||
done each frame after buffer swapping.
|
||||
|
||||
There are two ways to process pending events. @ref glfwPollEvents processes
|
||||
only those events that have already been received and then returns immediately.
|
||||
This is the best choice when rendering continually, like most games do.
|
||||
There are two methods for processing pending events; polling and waiting. This
|
||||
example will use event polling, which processes only those events that have
|
||||
already been received and then returns immediately.
|
||||
|
||||
@code
|
||||
glfwPollEvents();
|
||||
@endcode
|
||||
|
||||
If instead you only need to update your rendering once you have received new
|
||||
input, @ref glfwWaitEvents is a better choice. It waits until at least one
|
||||
event has been received, putting the thread to sleep in the meantime, and then
|
||||
processes all received events just like @ref glfwPollEvents does. This saves
|
||||
a great deal of CPU cycles and is useful for, for example, many kinds of editing
|
||||
tools.
|
||||
|
||||
@code
|
||||
glfwWaitEvents();
|
||||
@endcode
|
||||
This is the best choice when rendering continually, like most games do. If
|
||||
instead you only need to update your rendering once you have received new input,
|
||||
@ref glfwWaitEvents is a better choice. It waits until at least one event has
|
||||
been received, putting the thread to sleep in the meantime, and then processes
|
||||
all received events. This saves a great deal of CPU cycles and is useful for,
|
||||
for example, many kinds of editing tools.
|
||||
|
||||
|
||||
@section quick_example Putting it together: A small GLFW application
|
||||
@section quick_example Putting it together
|
||||
|
||||
Now that you know how to initialize GLFW, create a window and poll for
|
||||
keyboard input, it's possible to create a simple program.
|
||||
keyboard input, it's possible to create a small program.
|
||||
|
||||
@snippet simple.c code
|
||||
This program creates a 640 by 480 windowed mode window and starts a loop that
|
||||
clears the screen, renders a triangle and processes events until the user either
|
||||
presses _Escape_ or closes the window.
|
||||
|
||||
This program creates a 640 by 480 windowed mode window and runs a loop clearing
|
||||
the screen, rendering a triangle and processing events until the user closes the
|
||||
window. It can be found in the source distribution as `examples/simple.c`, and
|
||||
is by default compiled along with all other examples when you build GLFW.
|
||||
@snippet triangle-opengl.c code
|
||||
|
||||
The program above can be found in the
|
||||
[source package](https://www.glfw.org/download.html) as
|
||||
`examples/triangle-opengl.c` and is compiled along with all other examples when
|
||||
you build GLFW. If you built GLFW from the source package then you already have
|
||||
this as `triangle-opengl.exe` on Windows, `triangle-opengl` on Linux or
|
||||
`triangle-opengl.app` on macOS.
|
||||
|
||||
This tutorial used only a few of the many functions GLFW provides. There are
|
||||
guides for each of the areas covered by GLFW. Each guide will introduce all the
|
||||
functions for that category.
|
||||
|
||||
- @ref intro_guide
|
||||
- @ref window_guide
|
||||
- @ref context_guide
|
||||
- @ref monitor_guide
|
||||
- @ref input_guide
|
||||
|
||||
You can access reference documentation for any GLFW function by clicking it and
|
||||
the reference for each function links to related functions and guide sections.
|
||||
|
||||
The tutorial ends here. Once you have written a program that uses GLFW, you
|
||||
will need to compile and link it. How to do that depends on the development
|
||||
environment you are using and is best explained by the documentation for that
|
||||
environment. To learn about the details that are specific to GLFW, see
|
||||
@ref build_guide.
|
||||
|
||||
*/
|
||||
|
|
877
docs/spaces.svg
Normal file
877
docs/spaces.svg
Normal file
|
@ -0,0 +1,877 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="688.48718"
|
||||
height="327.98221"
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
|
||||
sodipodi:docname="spaces.svg">
|
||||
<defs
|
||||
id="defs4">
|
||||
<marker
|
||||
inkscape:stockid="Arrow2Lend"
|
||||
orient="auto"
|
||||
refY="0.0"
|
||||
refX="0.0"
|
||||
id="Arrow2Lend"
|
||||
style="overflow:visible;">
|
||||
<path
|
||||
id="path3888"
|
||||
style="fill-rule:evenodd;stroke-width:0.62500000;stroke-linejoin:round;"
|
||||
d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
|
||||
transform="scale(1.1) rotate(180) translate(1,0)" />
|
||||
</marker>
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="1.8110012"
|
||||
inkscape:cx="320.68941"
|
||||
inkscape:cy="159.80509"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1021"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="30"
|
||||
inkscape:window-maximized="1"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0"
|
||||
units="px"
|
||||
showborder="false"
|
||||
inkscape:showpageshadow="false" />
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(-12.627039,-339.86462)">
|
||||
<rect
|
||||
style="fill:#ffffff;fill-opacity:1;stroke:#0000ff;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:3,3;stroke-dashoffset:0"
|
||||
id="rect2985"
|
||||
width="687.36469"
|
||||
height="326.85971"
|
||||
x="13.188287"
|
||||
y="340.42587"
|
||||
inkscape:export-filename="/home/elmindreda/projects/glfw/glfw/docs/spaces.png"
|
||||
inkscape:export-xdpi="109.89113"
|
||||
inkscape:export-ydpi="109.89113" />
|
||||
<rect
|
||||
style="fill:#f3fff3;fill-opacity:1;stroke:#00b800;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
id="rect3757"
|
||||
width="318.05698"
|
||||
height="277.04684"
|
||||
x="38.315689"
|
||||
y="366.05841"
|
||||
inkscape:export-filename="/home/elmindreda/projects/glfw/glfw/docs/spaces.png"
|
||||
inkscape:export-xdpi="109.89113"
|
||||
inkscape:export-ydpi="109.89113" />
|
||||
<rect
|
||||
style="fill:#f3fff3;fill-opacity:1;stroke:#00b800;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
id="rect3767"
|
||||
width="319.01456"
|
||||
height="198.09369"
|
||||
x="356.36722"
|
||||
y="366.01291"
|
||||
inkscape:export-filename="/home/elmindreda/projects/glfw/glfw/docs/spaces.png"
|
||||
inkscape:export-xdpi="109.89113"
|
||||
inkscape:export-ydpi="109.89113" />
|
||||
<g
|
||||
style="font-size:12px;font-style:normal;font-weight:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
|
||||
id="text3769">
|
||||
<path
|
||||
d="m 365.3732,374.63632 0,2.73926 1.24023,0 c 0.45898,0 0.8138,-0.11881 1.06446,-0.35645 0.25064,-0.23762 0.37597,-0.57616 0.37597,-1.01562 0,-0.43619 -0.12533,-0.77311 -0.37597,-1.01074 -0.25066,-0.23763 -0.60548,-0.35644 -1.06446,-0.35645 l -1.24023,0 m -0.98633,-0.81054 2.22656,0 c 0.81706,0 1.43392,0.18555 1.85059,0.55664 0.41992,0.36784 0.62988,0.9082 0.62988,1.62109 0,0.7194 -0.20996,1.26302 -0.62988,1.63086 -0.41667,0.36784 -1.03353,0.55176 -1.85059,0.55176 l -1.24023,0 0,2.92968 -0.98633,0 0,-7.29003"
|
||||
style="font-size:10px"
|
||||
id="path3281" />
|
||||
<path
|
||||
d="m 373.37613,376.48691 c -0.10092,-0.0586 -0.21159,-0.10091 -0.33203,-0.12696 -0.11719,-0.0293 -0.2474,-0.0439 -0.39063,-0.0439 -0.50781,0 -0.89844,0.16602 -1.17187,0.49805 -0.27019,0.32878 -0.40528,0.80241 -0.40528,1.42089 l 0,2.88086 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.1888,-0.33202 0.43457,-0.57779 0.73731,-0.7373 0.30273,-0.16276 0.67057,-0.24414 1.10351,-0.24414 0.0618,0 0.13021,0.005 0.20508,0.0147 0.0749,0.007 0.15788,0.0179 0.24903,0.0342 l 0.005,0.92285"
|
||||
style="font-size:10px"
|
||||
id="path3283" />
|
||||
<path
|
||||
d="m 374.32828,375.64706 0.89844,0 0,5.46875 -0.89844,0 0,-5.46875 m 0,-2.1289 0.89844,0 0,1.13769 -0.89844,0 0,-1.13769"
|
||||
style="font-size:10px"
|
||||
id="path3285" />
|
||||
<path
|
||||
d="m 381.35953,376.69687 c 0.2246,-0.40364 0.49316,-0.70149 0.80566,-0.89356 0.3125,-0.19205 0.68033,-0.28808 1.10352,-0.28808 0.56965,0 1.0091,0.2002 1.31836,0.60058 0.30923,0.39714 0.46385,0.96355 0.46386,1.69922 l 0,3.30078 -0.90332,0 0,-3.27148 c 0,-0.52408 -0.0928,-0.91308 -0.27832,-1.16699 -0.18555,-0.2539 -0.46875,-0.38086 -0.84961,-0.38086 -0.4655,0 -0.83334,0.15463 -1.10351,0.46387 -0.27019,0.30924 -0.40528,0.73079 -0.40528,1.26464 l 0,3.09082 -0.90332,0 0,-3.27148 c 0,-0.52734 -0.0928,-0.91634 -0.27832,-1.16699 -0.18555,-0.2539 -0.472,-0.38086 -0.85937,-0.38086 -0.45899,0 -0.82357,0.15625 -1.09375,0.46875 -0.27019,0.30925 -0.40528,0.72917 -0.40527,1.25976 l 0,3.09082 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.20507,-0.33528 0.45084,-0.58267 0.7373,-0.74218 0.28646,-0.1595 0.62662,-0.23926 1.02051,-0.23926 0.39713,0 0.73404,0.10092 1.01074,0.30273 0.27994,0.20183 0.48665,0.4948 0.62012,0.87891"
|
||||
style="font-size:10px"
|
||||
id="path3287" />
|
||||
<path
|
||||
d="m 389.33316,378.36679 c -0.72591,0 -1.22884,0.083 -1.50879,0.24902 -0.27995,0.16602 -0.41992,0.44923 -0.41992,0.84961 0,0.31902 0.10416,0.57292 0.3125,0.76172 0.21159,0.18555 0.49804,0.27832 0.85937,0.27832 0.49805,0 0.89681,-0.17578 1.19629,-0.52734 0.30273,-0.35482 0.4541,-0.82519 0.45411,-1.41113 l 0,-0.2002 -0.89356,0 m 1.79199,-0.37109 0,3.12011 -0.89843,0 0,-0.83007 c -0.20509,0.33203 -0.46062,0.5778 -0.76661,0.7373 -0.30599,0.15625 -0.68034,0.23438 -1.12304,0.23438 -0.5599,0 -1.00586,-0.15625 -1.33789,-0.46875 -0.32878,-0.31576 -0.49317,-0.73731 -0.49317,-1.26465 0,-0.61523 0.20508,-1.0791 0.61524,-1.3916 0.41341,-0.3125 1.02864,-0.46875 1.8457,-0.46875 l 1.25977,0 0,-0.0879 c -10e-6,-0.41341 -0.13673,-0.73242 -0.41016,-0.95704 -0.27019,-0.22786 -0.65105,-0.34179 -1.14258,-0.34179 -0.3125,0 -0.61686,0.0374 -0.91309,0.1123 -0.29622,0.0749 -0.58105,0.18718 -0.85449,0.33692 l 0,-0.83008 c 0.32878,-0.12695 0.64779,-0.22135 0.95703,-0.28321 0.30925,-0.0651 0.61035,-0.0977 0.90332,-0.0977 0.79102,0 1.38184,0.20508 1.77247,0.61523 0.39062,0.41016 0.58593,1.03191 0.58593,1.86524"
|
||||
style="font-size:10px"
|
||||
id="path3289" />
|
||||
<path
|
||||
d="m 396.14957,376.48691 c -0.10092,-0.0586 -0.2116,-0.10091 -0.33203,-0.12696 -0.1172,-0.0293 -0.2474,-0.0439 -0.39063,-0.0439 -0.50781,0 -0.89844,0.16602 -1.17187,0.49805 -0.27019,0.32878 -0.40528,0.80241 -0.40528,1.42089 l 0,2.88086 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.1888,-0.33202 0.43457,-0.57779 0.73731,-0.7373 0.30273,-0.16276 0.67057,-0.24414 1.10351,-0.24414 0.0618,0 0.13021,0.005 0.20508,0.0147 0.0749,0.007 0.15787,0.0179 0.24902,0.0342 l 0.005,0.92285"
|
||||
style="font-size:10px"
|
||||
id="path3291" />
|
||||
<path
|
||||
d="m 399.37711,381.62363 c -0.25391,0.65104 -0.50131,1.07584 -0.74219,1.27441 -0.24089,0.19857 -0.56315,0.29785 -0.9668,0.29785 l -0.71777,0 0,-0.75195 0.52734,0 c 0.2474,0 0.43945,-0.0586 0.57617,-0.17578 0.13672,-0.11719 0.28809,-0.39388 0.45411,-0.83008 l 0.16113,-0.41016 -2.21192,-5.38086 0.95215,0 1.70899,4.27735 1.70898,-4.27735 0.95215,0 -2.40234,5.97657"
|
||||
style="font-size:10px"
|
||||
id="path3293" />
|
||||
<path
|
||||
d="m 410.46109,376.69687 c 0.2246,-0.40364 0.49316,-0.70149 0.80566,-0.89356 0.3125,-0.19205 0.68034,-0.28808 1.10352,-0.28808 0.56965,0 1.00911,0.2002 1.31836,0.60058 0.30924,0.39714 0.46386,0.96355 0.46387,1.69922 l 0,3.30078 -0.90332,0 0,-3.27148 c -1e-5,-0.52408 -0.0928,-0.91308 -0.27832,-1.16699 -0.18556,-0.2539 -0.46876,-0.38086 -0.84961,-0.38086 -0.4655,0 -0.83334,0.15463 -1.10352,0.46387 -0.27019,0.30924 -0.40528,0.73079 -0.40527,1.26464 l 0,3.09082 -0.90332,0 0,-3.27148 c -10e-6,-0.52734 -0.0928,-0.91634 -0.27832,-1.16699 -0.18555,-0.2539 -0.47201,-0.38086 -0.85938,-0.38086 -0.45899,0 -0.82357,0.15625 -1.09375,0.46875 -0.27018,0.30925 -0.40527,0.72917 -0.40527,1.25976 l 0,3.09082 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.20507,-0.33528 0.45084,-0.58267 0.7373,-0.74218 0.28646,-0.1595 0.62663,-0.23926 1.02051,-0.23926 0.39713,0 0.73405,0.10092 1.01074,0.30273 0.27995,0.20183 0.48665,0.4948 0.62012,0.87891"
|
||||
style="font-size:10px"
|
||||
id="path3295" />
|
||||
<path
|
||||
d="m 418.06851,376.27695 c -0.48177,0 -0.86263,0.1888 -1.14258,0.5664 -0.27995,0.37436 -0.41992,0.88868 -0.41992,1.54297 0,0.6543 0.13835,1.17025 0.41504,1.54785 0.27995,0.37435 0.66243,0.56153 1.14746,0.56153 0.47851,0 0.85775,-0.1888 1.1377,-0.56641 0.27994,-0.3776 0.41991,-0.89192 0.41992,-1.54297 -10e-6,-0.64778 -0.13998,-1.16048 -0.41992,-1.53808 -0.27995,-0.38086 -0.65919,-0.57129 -1.1377,-0.57129 m 0,-0.76172 c 0.78125,0 1.39485,0.25391 1.84082,0.76172 0.44596,0.50781 0.66894,1.21094 0.66895,2.10937 -1e-5,0.89519 -0.22299,1.59831 -0.66895,2.10938 -0.44597,0.50781 -1.05957,0.76172 -1.84082,0.76172 -0.78451,0 -1.39974,-0.25391 -1.8457,-0.76172 -0.44271,-0.51107 -0.66406,-1.21419 -0.66406,-2.10938 0,-0.89843 0.22135,-1.60156 0.66406,-2.10937 0.44596,-0.50781 1.06119,-0.76172 1.8457,-0.76172"
|
||||
style="font-size:10px"
|
||||
id="path3297" />
|
||||
<path
|
||||
d="m 426.60855,377.81503 0,3.30078 -0.89844,0 0,-3.27148 c 0,-0.51757 -0.10091,-0.90494 -0.30273,-1.16211 -0.20183,-0.25716 -0.50456,-0.38574 -0.9082,-0.38574 -0.48503,0 -0.86752,0.15463 -1.14746,0.46387 -0.27995,0.30924 -0.41993,0.73079 -0.41993,1.26464 l 0,3.09082 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.21484,-0.32877 0.46712,-0.57454 0.75684,-0.7373 0.29297,-0.16276 0.62988,-0.24414 1.01074,-0.24414 0.62825,0 1.10351,0.19532 1.42578,0.58594 0.32226,0.38737 0.4834,0.95866 0.4834,1.71386"
|
||||
style="font-size:10px"
|
||||
id="path3299" />
|
||||
<path
|
||||
d="m 428.41031,375.64706 0.89844,0 0,5.46875 -0.89844,0 0,-5.46875 m 0,-2.1289 0.89844,0 0,1.13769 -0.89844,0 0,-1.13769"
|
||||
style="font-size:10px"
|
||||
id="path3301" />
|
||||
<path
|
||||
d="m 432.07242,374.09433 0,1.55273 1.85058,0 0,0.69825 -1.85058,0 0,2.96875 c 0,0.44596 0.0602,0.73242 0.18066,0.85937 0.1237,0.12696 0.37272,0.19043 0.74707,0.19043 l 0.92285,0 0,0.75195 -0.92285,0 c -0.69336,0 -1.17187,-0.12858 -1.43554,-0.38574 -0.26368,-0.26041 -0.39551,-0.73242 -0.39551,-1.41601 l 0,-2.96875 -0.65918,0 0,-0.69825 0.65918,0 0,-1.55273 0.90332,0"
|
||||
style="font-size:10px"
|
||||
id="path3303" />
|
||||
<path
|
||||
d="m 437.22867,376.27695 c -0.48178,0 -0.86263,0.1888 -1.14258,0.5664 -0.27995,0.37436 -0.41992,0.88868 -0.41992,1.54297 0,0.6543 0.13834,1.17025 0.41504,1.54785 0.27994,0.37435 0.66243,0.56153 1.14746,0.56153 0.47851,0 0.85774,-0.1888 1.13769,-0.56641 0.27995,-0.3776 0.41992,-0.89192 0.41993,-1.54297 -1e-5,-0.64778 -0.13998,-1.16048 -0.41993,-1.53808 -0.27995,-0.38086 -0.65918,-0.57129 -1.13769,-0.57129 m 0,-0.76172 c 0.78124,0 1.39485,0.25391 1.84082,0.76172 0.44596,0.50781 0.66894,1.21094 0.66894,2.10937 0,0.89519 -0.22298,1.59831 -0.66894,2.10938 -0.44597,0.50781 -1.05958,0.76172 -1.84082,0.76172 -0.78451,0 -1.39974,-0.25391 -1.8457,-0.76172 -0.44271,-0.51107 -0.66407,-1.21419 -0.66407,-2.10938 0,-0.89843 0.22136,-1.60156 0.66407,-2.10937 0.44596,-0.50781 1.06119,-0.76172 1.8457,-0.76172"
|
||||
style="font-size:10px"
|
||||
id="path3305" />
|
||||
<path
|
||||
d="m 444.39175,376.48691 c -0.10091,-0.0586 -0.21159,-0.10091 -0.33203,-0.12696 -0.11719,-0.0293 -0.2474,-0.0439 -0.39062,-0.0439 -0.50782,0 -0.89844,0.16602 -1.17188,0.49805 -0.27018,0.32878 -0.40527,0.80241 -0.40527,1.42089 l 0,2.88086 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.1888,-0.33202 0.43457,-0.57779 0.7373,-0.7373 0.30274,-0.16276 0.67057,-0.24414 1.10352,-0.24414 0.0618,0 0.1302,0.005 0.20508,0.0147 0.0749,0.007 0.15787,0.0179 0.24902,0.0342 l 0.005,0.92285"
|
||||
style="font-size:10px"
|
||||
id="path3307" />
|
||||
<path
|
||||
d="m 449.39664,380.2955 0,2.90039 -0.90332,0 0,-7.54883 0.90332,0 0,0.83008 c 0.1888,-0.32551 0.42643,-0.5664 0.71289,-0.72265 0.28971,-0.1595 0.63476,-0.23926 1.03515,-0.23926 0.66406,0 1.2028,0.26368 1.61621,0.79101 0.41667,0.52735 0.625,1.22071 0.625,2.08008 0,0.85938 -0.20833,1.55274 -0.625,2.08008 -0.41341,0.52734 -0.95215,0.79102 -1.61621,0.79102 -0.40039,0 -0.74544,-0.0781 -1.03515,-0.23438 -0.28646,-0.1595 -0.52409,-0.40202 -0.71289,-0.72754 m 3.05664,-1.90918 c -1e-5,-0.6608 -0.13673,-1.17838 -0.41016,-1.55273 -0.27019,-0.3776 -0.64291,-0.5664 -1.11816,-0.56641 -0.47527,1e-5 -0.84961,0.18881 -1.12305,0.56641 -0.27018,0.37435 -0.40527,0.89193 -0.40527,1.55273 0,0.66081 0.13509,1.18002 0.40527,1.55762 0.27344,0.37435 0.64778,0.56152 1.12305,0.56152 0.47525,0 0.84797,-0.18717 1.11816,-0.56152 0.27343,-0.3776 0.41015,-0.89681 0.41016,-1.55762"
|
||||
style="font-size:10px"
|
||||
id="path3309" />
|
||||
<path
|
||||
d="m 456.99429,376.27695 c -0.48177,0 -0.86263,0.1888 -1.14257,0.5664 -0.27995,0.37436 -0.41993,0.88868 -0.41993,1.54297 0,0.6543 0.13835,1.17025 0.41504,1.54785 0.27995,0.37435 0.66243,0.56153 1.14746,0.56153 0.47852,0 0.85775,-0.1888 1.1377,-0.56641 0.27994,-0.3776 0.41992,-0.89192 0.41992,-1.54297 0,-0.64778 -0.13998,-1.16048 -0.41992,-1.53808 -0.27995,-0.38086 -0.65918,-0.57129 -1.1377,-0.57129 m 0,-0.76172 c 0.78125,0 1.39486,0.25391 1.84082,0.76172 0.44596,0.50781 0.66894,1.21094 0.66895,2.10937 -10e-6,0.89519 -0.22299,1.59831 -0.66895,2.10938 -0.44596,0.50781 -1.05957,0.76172 -1.84082,0.76172 -0.7845,0 -1.39974,-0.25391 -1.8457,-0.76172 -0.44271,-0.51107 -0.66406,-1.21419 -0.66406,-2.10938 0,-0.89843 0.22135,-1.60156 0.66406,-2.10937 0.44596,-0.50781 1.0612,-0.76172 1.8457,-0.76172"
|
||||
style="font-size:10px"
|
||||
id="path3311" />
|
||||
<path
|
||||
d="m 464.47476,375.8082 0,0.84961 c -0.25391,-0.13021 -0.51758,-0.22786 -0.79101,-0.29297 -0.27344,-0.0651 -0.55665,-0.0976 -0.84961,-0.0977 -0.44597,1e-5 -0.78126,0.0684 -1.00586,0.20508 -0.22136,0.13672 -0.33204,0.3418 -0.33203,0.61523 -10e-6,0.20834 0.0798,0.37273 0.23925,0.49317 0.15951,0.11719 0.48015,0.22949 0.96192,0.33691 l 0.30762,0.0684 c 0.63801,0.13672 1.09049,0.33041 1.35742,0.58106 0.27017,0.24739 0.40527,0.59407 0.40527,1.04004 0,0.50781 -0.20183,0.90983 -0.60547,1.20605 -0.40039,0.29622 -0.95215,0.44434 -1.65527,0.44434 -0.29297,0 -0.59896,-0.0293 -0.91797,-0.0879 -0.31576,-0.0553 -0.64942,-0.13998 -1.00098,-0.25391 l 0,-0.92774 c 0.33203,0.17253 0.65918,0.30274 0.98145,0.39063 0.32226,0.0846 0.64127,0.12695 0.95703,0.12695 0.42317,0 0.74869,-0.0716 0.97656,-0.21484 0.22786,-0.14648 0.3418,-0.35156 0.3418,-0.61524 0,-0.24413 -0.083,-0.43131 -0.24902,-0.56152 -0.16277,-0.13021 -0.52247,-0.25553 -1.07911,-0.37598 l -0.3125,-0.0732 c -0.55664,-0.11718 -0.95866,-0.29622 -1.20605,-0.53711 -0.2474,-0.24413 -0.37109,-0.57779 -0.37109,-1.00097 0,-0.51432 0.18229,-0.91146 0.54687,-1.19141 0.36458,-0.27994 0.88216,-0.41992 1.55274,-0.41992 0.33202,0 0.64452,0.0244 0.9375,0.0732 0.29296,0.0488 0.56314,0.12208 0.81054,0.21973"
|
||||
style="font-size:10px"
|
||||
id="path3313" />
|
||||
<path
|
||||
d="m 466.20328,375.64706 0.89844,0 0,5.46875 -0.89844,0 0,-5.46875 m 0,-2.1289 0.89844,0 0,1.13769 -0.89844,0 0,-1.13769"
|
||||
style="font-size:10px"
|
||||
id="path3315" />
|
||||
<path
|
||||
d="m 469.86539,374.09433 0,1.55273 1.85058,0 0,0.69825 -1.85058,0 0,2.96875 c 0,0.44596 0.0602,0.73242 0.18066,0.85937 0.1237,0.12696 0.37272,0.19043 0.74707,0.19043 l 0.92285,0 0,0.75195 -0.92285,0 c -0.69336,0 -1.17188,-0.12858 -1.43555,-0.38574 -0.26367,-0.26041 -0.3955,-0.73242 -0.3955,-1.41601 l 0,-2.96875 -0.65918,0 0,-0.69825 0.65918,0 0,-1.55273 0.90332,0"
|
||||
style="font-size:10px"
|
||||
id="path3317" />
|
||||
<path
|
||||
d="m 472.9025,375.64706 0.89843,0 0,5.46875 -0.89843,0 0,-5.46875 m 0,-2.1289 0.89843,0 0,1.13769 -0.89843,0 0,-1.13769"
|
||||
style="font-size:10px"
|
||||
id="path3319" />
|
||||
<path
|
||||
d="m 477.79507,376.27695 c -0.48177,0 -0.86263,0.1888 -1.14257,0.5664 -0.27995,0.37436 -0.41993,0.88868 -0.41993,1.54297 0,0.6543 0.13835,1.17025 0.41504,1.54785 0.27995,0.37435 0.66244,0.56153 1.14746,0.56153 0.47852,0 0.85775,-0.1888 1.1377,-0.56641 0.27994,-0.3776 0.41992,-0.89192 0.41992,-1.54297 0,-0.64778 -0.13998,-1.16048 -0.41992,-1.53808 -0.27995,-0.38086 -0.65918,-0.57129 -1.1377,-0.57129 m 0,-0.76172 c 0.78125,0 1.39486,0.25391 1.84082,0.76172 0.44596,0.50781 0.66894,1.21094 0.66895,2.10937 -1e-5,0.89519 -0.22299,1.59831 -0.66895,2.10938 -0.44596,0.50781 -1.05957,0.76172 -1.84082,0.76172 -0.7845,0 -1.39974,-0.25391 -1.8457,-0.76172 -0.44271,-0.51107 -0.66406,-1.21419 -0.66406,-2.10938 0,-0.89843 0.22135,-1.60156 0.66406,-2.10937 0.44596,-0.50781 1.0612,-0.76172 1.8457,-0.76172"
|
||||
style="font-size:10px"
|
||||
id="path3321" />
|
||||
<path
|
||||
d="m 486.33511,377.81503 0,3.30078 -0.89843,0 0,-3.27148 c -1e-5,-0.51757 -0.10092,-0.90494 -0.30274,-1.16211 -0.20183,-0.25716 -0.50456,-0.38574 -0.9082,-0.38574 -0.48503,0 -0.86752,0.15463 -1.14746,0.46387 -0.27995,0.30924 -0.41993,0.73079 -0.41992,1.26464 l 0,3.09082 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.21484,-0.32877 0.46712,-0.57454 0.75683,-0.7373 0.29297,-0.16276 0.62988,-0.24414 1.01074,-0.24414 0.62825,0 1.10351,0.19532 1.42579,0.58594 0.32226,0.38737 0.48339,0.95866 0.48339,1.71386"
|
||||
style="font-size:10px"
|
||||
id="path3323" />
|
||||
</g>
|
||||
<g
|
||||
style="font-size:12px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#00b800;fill-opacity:1;stroke:none;font-family:Sans"
|
||||
id="text3773">
|
||||
<path
|
||||
d="m 242.85294,625.22699 0,1.1543 c -0.44923,-0.21484 -0.87306,-0.375 -1.27149,-0.48047 -0.39844,-0.10546 -0.78321,-0.1582 -1.1543,-0.15821 -0.64453,10e-6 -1.14258,0.12501 -1.49414,0.375 -0.34765,0.25001 -0.52148,0.60548 -0.52148,1.06641 0,0.38673 0.11523,0.67969 0.3457,0.87891 0.23438,0.19532 0.67578,0.35352 1.32422,0.47461 l 0.71485,0.14648 c 0.8828,0.16797 1.53319,0.46485 1.95117,0.89063 0.42187,0.42187 0.6328,0.98828 0.63281,1.69921 -1e-5,0.84766 -0.28516,1.49024 -0.85547,1.92774 -0.56641,0.4375 -1.39844,0.65625 -2.49609,0.65625 -0.41407,0 -0.85547,-0.0469 -1.32422,-0.14063 -0.46485,-0.0937 -0.94727,-0.23242 -1.44727,-0.41601 l 0,-1.21875 c 0.48047,0.26953 0.95117,0.47266 1.41211,0.60937 0.46094,0.13672 0.91406,0.20508 1.35938,0.20508 0.67577,0 1.19726,-0.13281 1.56445,-0.39844 0.36718,-0.26562 0.55078,-0.64453 0.55078,-1.13671 0,-0.42969 -0.13282,-0.76563 -0.39844,-1.00782 -0.26172,-0.24218 -0.69336,-0.42382 -1.29492,-0.54492 l -0.7207,-0.14062 c -0.88282,-0.17578 -1.52149,-0.45117 -1.91602,-0.82618 -0.39453,-0.37499 -0.59179,-0.89647 -0.59179,-1.56445 0,-0.77343 0.27148,-1.3828 0.81445,-1.82812 0.54687,-0.44531 1.29882,-0.66796 2.25586,-0.66797 0.41015,10e-6 0.82812,0.0371 1.25391,0.11133 0.42577,0.0742 0.86132,0.18555 1.30664,0.33398"
|
||||
style=""
|
||||
id="path3355" />
|
||||
<path
|
||||
d="m 250.79239,630.13715 0,0.52734 -4.95703,0 c 0.0469,0.74219 0.26953,1.3086 0.66797,1.69922 0.40234,0.38672 0.96093,0.58008 1.67578,0.58008 0.41406,0 0.81445,-0.0508 1.20117,-0.15235 0.39062,-0.10156 0.77734,-0.2539 1.16016,-0.45703 l 0,1.01953 c -0.38673,0.16407 -0.78321,0.28907 -1.18946,0.375 -0.40625,0.0859 -0.81836,0.12891 -1.23633,0.12891 -1.04687,0 -1.87695,-0.30469 -2.49023,-0.91406 -0.60938,-0.60938 -0.91406,-1.43359 -0.91406,-2.47266 0,-1.07421 0.28906,-1.92578 0.86719,-2.55469 0.58202,-0.6328 1.36523,-0.94921 2.3496,-0.94922 0.88281,10e-6 1.58008,0.28517 2.0918,0.85547 0.51562,0.56641 0.77343,1.3379 0.77344,2.31446 m -1.07813,-0.31641 c -0.008,-0.58984 -0.17383,-1.06054 -0.49804,-1.41211 -0.32032,-0.35156 -0.7461,-0.52734 -1.27735,-0.52734 -0.60156,0 -1.08398,0.16992 -1.44726,0.50976 -0.35938,0.33985 -0.56641,0.81837 -0.6211,1.43555 l 3.84375,-0.006"
|
||||
style=""
|
||||
id="path3357" />
|
||||
<path
|
||||
d="m 257.28458,627.37738 0,1.00781 c -0.3047,-0.16796 -0.61134,-0.29296 -0.91993,-0.375 -0.30469,-0.0859 -0.61328,-0.1289 -0.92578,-0.1289 -0.69922,0 -1.24219,0.22266 -1.6289,0.66797 -0.38672,0.44141 -0.58008,1.0625 -0.58008,1.86328 0,0.80078 0.19336,1.42383 0.58008,1.86914 0.38671,0.4414 0.92968,0.66211 1.6289,0.66211 0.3125,0 0.62109,-0.041 0.92578,-0.12305 0.30859,-0.0859 0.61523,-0.21289 0.91993,-0.38086 l 0,0.99609 c -0.30079,0.14063 -0.61329,0.2461 -0.9375,0.31641 -0.32032,0.0703 -0.66212,0.10547 -1.02539,0.10547 -0.98829,0 -1.77344,-0.31055 -2.35547,-0.93164 -0.58204,-0.62109 -0.87305,-1.45898 -0.87305,-2.51367 0,-1.07031 0.29297,-1.91211 0.87891,-2.52539 0.58984,-0.61328 1.39648,-0.91992 2.41992,-0.91993 0.33203,10e-6 0.65624,0.0352 0.97265,0.10547 0.31641,0.0664 0.62305,0.16798 0.91993,0.30469"
|
||||
style=""
|
||||
id="path3359" />
|
||||
<path
|
||||
d="m 261.71426,627.88129 c -0.57812,0 -1.03515,0.22656 -1.37109,0.67968 -0.33594,0.44923 -0.50391,1.06641 -0.50391,1.85157 0,0.78516 0.16602,1.4043 0.49805,1.85742 0.33594,0.44922 0.79492,0.67383 1.37695,0.67383 0.57422,0 1.0293,-0.22656 1.36524,-0.67969 0.33593,-0.45312 0.5039,-1.07031 0.5039,-1.85156 0,-0.77734 -0.16797,-1.39258 -0.5039,-1.84571 -0.33594,-0.45702 -0.79102,-0.68554 -1.36524,-0.68554 m 0,-0.91407 c 0.9375,10e-6 1.67383,0.3047 2.20899,0.91407 0.53515,0.60938 0.80273,1.45313 0.80273,2.53125 0,1.07422 -0.26758,1.91797 -0.80273,2.53125 -0.53516,0.60937 -1.27149,0.91406 -2.20899,0.91406 -0.94141,0 -1.67969,-0.30469 -2.21484,-0.91406 -0.53125,-0.61328 -0.79688,-1.45703 -0.79687,-2.53125 -10e-6,-1.07812 0.26562,-1.92187 0.79687,-2.53125 0.53515,-0.60937 1.27343,-0.91406 2.21484,-0.91407"
|
||||
style=""
|
||||
id="path3361" />
|
||||
<path
|
||||
d="m 271.96231,629.72699 0,3.96094 -1.07812,0 0,-3.92578 c -10e-6,-0.62109 -0.1211,-1.08594 -0.36329,-1.39454 -0.24219,-0.30858 -0.60547,-0.46288 -1.08984,-0.46289 -0.58203,10e-6 -1.04102,0.18556 -1.37695,0.55664 -0.33594,0.3711 -0.50391,0.87696 -0.50391,1.51758 l 0,3.70899 -1.08398,0 0,-6.5625 1.08398,0 0,1.01953 c 0.25781,-0.39453 0.56055,-0.68945 0.9082,-0.88477 0.35156,-0.1953 0.75586,-0.29296 1.2129,-0.29297 0.7539,10e-6 1.32421,0.23439 1.71093,0.70313 0.38672,0.46485 0.58007,1.15039 0.58008,2.05664"
|
||||
style=""
|
||||
id="path3363" />
|
||||
<path
|
||||
d="m 278.44278,628.12152 0,-3.55078 1.07812,0 0,9.11719 -1.07812,0 0,-0.98438 c -0.22657,0.39063 -0.51368,0.68164 -0.86133,0.87305 -0.34375,0.1875 -0.75781,0.28125 -1.24219,0.28125 -0.79297,0 -1.43945,-0.31641 -1.93945,-0.94922 -0.49609,-0.63281 -0.74414,-1.46484 -0.74414,-2.49609 0,-1.03125 0.24805,-1.86328 0.74414,-2.4961 0.5,-0.6328 1.14648,-0.94921 1.93945,-0.94922 0.48438,10e-6 0.89844,0.0957 1.24219,0.28711 0.34765,0.18751 0.63476,0.47657 0.86133,0.86719 m -3.67383,2.29102 c 0,0.79297 0.16211,1.41601 0.48633,1.86914 0.32812,0.44922 0.77734,0.67383 1.34766,0.67383 0.5703,0 1.01952,-0.22461 1.34765,-0.67383 0.32812,-0.45313 0.49218,-1.07617 0.49219,-1.86914 -1e-5,-0.79297 -0.16407,-1.41406 -0.49219,-1.86328 -0.32813,-0.45312 -0.77735,-0.67969 -1.34765,-0.67969 -0.57032,0 -1.01954,0.22657 -1.34766,0.67969 -0.32422,0.44922 -0.48633,1.07031 -0.48633,1.86328"
|
||||
style=""
|
||||
id="path3365" />
|
||||
<path
|
||||
d="m 284.72403,630.3891 c -0.8711,0 -1.47461,0.0996 -1.81055,0.29883 -0.33594,0.19922 -0.50391,0.53906 -0.5039,1.01953 -1e-5,0.38281 0.12499,0.6875 0.375,0.91406 0.2539,0.22266 0.59765,0.33399 1.03125,0.33399 0.59765,0 1.07616,-0.21094 1.43554,-0.63282 0.36328,-0.42578 0.54492,-0.99023 0.54493,-1.69336 l 0,-0.24023 -1.07227,0 m 2.15039,-0.44531 0,3.74414 -1.07812,0 0,-0.9961 c -0.2461,0.39844 -0.55274,0.69336 -0.91993,0.88477 -0.36719,0.1875 -0.81641,0.28125 -1.34765,0.28125 -0.67188,0 -1.20704,-0.1875 -1.60547,-0.5625 -0.39453,-0.37891 -0.5918,-0.88477 -0.5918,-1.51758 0,-0.73828 0.24609,-1.29492 0.73828,-1.66992 0.49609,-0.375 1.23437,-0.5625 2.21485,-0.5625 l 1.51172,0 0,-0.10547 c -10e-6,-0.49609 -0.16407,-0.8789 -0.49219,-1.14844 -0.32423,-0.27343 -0.78126,-0.41015 -1.3711,-0.41015 -0.375,0 -0.74023,0.0449 -1.0957,0.13476 -0.35547,0.0899 -0.69727,0.22462 -1.02539,0.4043 l 0,-0.99609 c 0.39453,-0.15234 0.77734,-0.26562 1.14844,-0.33985 0.37109,-0.0781 0.73242,-0.11718 1.08398,-0.11719 0.94922,10e-6 1.6582,0.2461 2.12696,0.73829 0.46874,0.49219 0.70311,1.23828 0.70312,2.23828"
|
||||
style=""
|
||||
id="path3367" />
|
||||
<path
|
||||
d="m 292.90372,628.13324 c -0.1211,-0.0703 -0.25391,-0.12109 -0.39844,-0.15234 -0.14063,-0.0352 -0.29688,-0.0527 -0.46875,-0.0527 -0.60938,10e-6 -1.07813,0.19923 -1.40625,0.59766 -0.32422,0.39453 -0.48633,0.96289 -0.48633,1.70508 l 0,3.45703 -1.08398,0 0,-6.5625 1.08398,0 0,1.01953 c 0.22656,-0.39843 0.52148,-0.69335 0.88477,-0.88477 0.36327,-0.1953 0.80468,-0.29296 1.32422,-0.29297 0.0742,10e-6 0.15624,0.006 0.24609,0.0176 0.0898,0.008 0.18945,0.0215 0.29883,0.041 l 0.006,1.10742"
|
||||
style=""
|
||||
id="path3369" />
|
||||
<path
|
||||
d="m 296.77676,634.2973 c -0.30469,0.78125 -0.60156,1.29102 -0.89062,1.5293 -0.28907,0.23828 -0.67578,0.35742 -1.16016,0.35742 l -0.86133,0 0,-0.90234 0.63282,0 c 0.29687,0 0.52734,-0.0703 0.6914,-0.21094 0.16406,-0.14063 0.3457,-0.47266 0.54493,-0.99609 l 0.19335,-0.49219 -2.65429,-6.45703 1.14258,0 2.05078,5.13281 2.05078,-5.13281 1.14258,0 -2.88282,7.17187"
|
||||
style=""
|
||||
id="path3371" />
|
||||
<path
|
||||
d="m 305.01505,624.93988 1.76367,0 2.23242,5.95313 2.24414,-5.95313 1.76367,0 0,8.74805 -1.1543,0 0,-7.68164 -2.25585,6 -1.18946,0 -2.25586,-6 0,7.68164 -1.14843,0 0,-8.74805"
|
||||
style=""
|
||||
id="path3373" />
|
||||
<path
|
||||
d="m 317.87051,627.88129 c -0.57812,0 -1.03515,0.22656 -1.37109,0.67968 -0.33594,0.44923 -0.50391,1.06641 -0.50391,1.85157 0,0.78516 0.16602,1.4043 0.49805,1.85742 0.33594,0.44922 0.79492,0.67383 1.37695,0.67383 0.57422,0 1.0293,-0.22656 1.36524,-0.67969 0.33593,-0.45312 0.5039,-1.07031 0.5039,-1.85156 0,-0.77734 -0.16797,-1.39258 -0.5039,-1.84571 -0.33594,-0.45702 -0.79102,-0.68554 -1.36524,-0.68554 m 0,-0.91407 c 0.9375,10e-6 1.67383,0.3047 2.20899,0.91407 0.53515,0.60938 0.80273,1.45313 0.80273,2.53125 0,1.07422 -0.26758,1.91797 -0.80273,2.53125 -0.53516,0.60937 -1.27149,0.91406 -2.20899,0.91406 -0.94141,0 -1.67969,-0.30469 -2.21484,-0.91406 -0.53125,-0.61328 -0.79688,-1.45703 -0.79687,-2.53125 -10e-6,-1.07812 0.26562,-1.92187 0.79687,-2.53125 0.53515,-0.60937 1.27343,-0.91406 2.21484,-0.91407"
|
||||
style=""
|
||||
id="path3375" />
|
||||
<path
|
||||
d="m 328.11856,629.72699 0,3.96094 -1.07812,0 0,-3.92578 c -10e-6,-0.62109 -0.1211,-1.08594 -0.36329,-1.39454 -0.24219,-0.30858 -0.60547,-0.46288 -1.08984,-0.46289 -0.58203,10e-6 -1.04102,0.18556 -1.37695,0.55664 -0.33594,0.3711 -0.50391,0.87696 -0.50391,1.51758 l 0,3.70899 -1.08398,0 0,-6.5625 1.08398,0 0,1.01953 c 0.25781,-0.39453 0.56055,-0.68945 0.9082,-0.88477 0.35156,-0.1953 0.75586,-0.29296 1.2129,-0.29297 0.7539,10e-6 1.32421,0.23439 1.71093,0.70313 0.38672,0.46485 0.58007,1.15039 0.58008,2.05664"
|
||||
style=""
|
||||
id="path3377" />
|
||||
<path
|
||||
d="m 330.28067,627.12543 1.07813,0 0,6.5625 -1.07813,0 0,-6.5625 m 0,-2.55469 1.07813,0 0,1.36523 -1.07813,0 0,-1.36523"
|
||||
style=""
|
||||
id="path3379" />
|
||||
<path
|
||||
d="m 334.6752,625.26215 0,1.86328 2.2207,0 0,0.83789 -2.2207,0 0,3.5625 c 0,0.53516 0.0723,0.87891 0.2168,1.03125 0.14843,0.15234 0.44726,0.22851 0.89648,0.22851 l 1.10742,0 0,0.90235 -1.10742,0 c -0.83203,0 -1.40625,-0.1543 -1.72265,-0.46289 -0.31641,-0.3125 -0.47461,-0.87891 -0.47461,-1.69922 l 0,-3.5625 -0.79102,0 0,-0.83789 0.79102,0 0,-1.86328 1.08398,0"
|
||||
style=""
|
||||
id="path3381" />
|
||||
<path
|
||||
d="m 340.8627,627.88129 c -0.57813,0 -1.03516,0.22656 -1.37109,0.67968 -0.33594,0.44923 -0.50391,1.06641 -0.50391,1.85157 0,0.78516 0.16602,1.4043 0.49805,1.85742 0.33593,0.44922 0.79492,0.67383 1.37695,0.67383 0.57422,0 1.02929,-0.22656 1.36524,-0.67969 0.33593,-0.45312 0.5039,-1.07031 0.5039,-1.85156 0,-0.77734 -0.16797,-1.39258 -0.5039,-1.84571 -0.33595,-0.45702 -0.79102,-0.68554 -1.36524,-0.68554 m 0,-0.91407 c 0.9375,10e-6 1.67382,0.3047 2.20899,0.91407 0.53515,0.60938 0.80272,1.45313 0.80273,2.53125 -10e-6,1.07422 -0.26758,1.91797 -0.80273,2.53125 -0.53517,0.60937 -1.27149,0.91406 -2.20899,0.91406 -0.94141,0 -1.67969,-0.30469 -2.21484,-0.91406 -0.53125,-0.61328 -0.79688,-1.45703 -0.79688,-2.53125 0,-1.07812 0.26563,-1.92187 0.79688,-2.53125 0.53515,-0.60937 1.27343,-0.91406 2.21484,-0.91407"
|
||||
style=""
|
||||
id="path3383" />
|
||||
<path
|
||||
d="m 349.4584,628.13324 c -0.12109,-0.0703 -0.25391,-0.12109 -0.39843,-0.15234 -0.14063,-0.0352 -0.29688,-0.0527 -0.46875,-0.0527 -0.60938,10e-6 -1.07813,0.19923 -1.40625,0.59766 -0.32422,0.39453 -0.48633,0.96289 -0.48633,1.70508 l 0,3.45703 -1.08399,0 0,-6.5625 1.08399,0 0,1.01953 c 0.22656,-0.39843 0.52148,-0.69335 0.88476,-0.88477 0.36328,-0.1953 0.80469,-0.29296 1.32422,-0.29297 0.0742,10e-6 0.15625,0.006 0.2461,0.0176 0.0898,0.008 0.18945,0.0215 0.29883,0.041 l 0.006,1.10742"
|
||||
style=""
|
||||
id="path3385" />
|
||||
</g>
|
||||
<g
|
||||
style="font-size:12px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#00b800;fill-opacity:1;stroke:none;font-family:Sans"
|
||||
id="text3777">
|
||||
<path
|
||||
d="m 575.27002,547.52673 0,3.28711 1.48828,0 c 0.55078,10e-6 0.97656,-0.14257 1.27734,-0.42773 0.30078,-0.28515 0.45117,-0.6914 0.45118,-1.21875 -10e-6,-0.52343 -0.1504,-0.92773 -0.45118,-1.21289 -0.30078,-0.28515 -0.72656,-0.42773 -1.27734,-0.42774 l -1.48828,0 m -1.18359,-0.97265 2.67187,0 c 0.98046,10e-6 1.7207,0.22266 2.2207,0.66797 0.5039,0.44141 0.75586,1.08985 0.75586,1.94531 0,0.86328 -0.25196,1.51563 -0.75586,1.95703 -0.5,0.44141 -1.24024,0.66211 -2.2207,0.66211 l -1.48828,0 0,3.51562 -1.18359,0 0,-8.74804"
|
||||
style=""
|
||||
id="path3326" />
|
||||
<path
|
||||
d="m 584.87354,549.74744 c -0.1211,-0.0703 -0.25392,-0.12109 -0.39844,-0.15235 -0.14063,-0.0352 -0.29688,-0.0527 -0.46875,-0.0527 -0.60938,0 -1.07813,0.19922 -1.40625,0.59765 -0.32422,0.39454 -0.48633,0.9629 -0.48633,1.70508 l 0,3.45703 -1.08398,0 0,-6.5625 1.08398,0 0,1.01954 c 0.22656,-0.39844 0.52148,-0.69336 0.88477,-0.88477 0.36327,-0.19531 0.80468,-0.29296 1.32421,-0.29297 0.0742,10e-6 0.15625,0.006 0.2461,0.0176 0.0898,0.008 0.18945,0.0215 0.29883,0.041 l 0.006,1.10743"
|
||||
style=""
|
||||
id="path3328" />
|
||||
<path
|
||||
d="m 586.01611,548.73962 1.07813,0 0,6.5625 -1.07813,0 0,-6.5625 m 0,-2.55468 1.07813,0 0,1.36523 -1.07813,0 0,-1.36523"
|
||||
style=""
|
||||
id="path3330" />
|
||||
<path
|
||||
d="m 594.45361,549.99939 c 0.26953,-0.48437 0.59179,-0.84179 0.9668,-1.07227 0.37499,-0.23046 0.8164,-0.34569 1.32422,-0.3457 0.68358,10e-6 1.21093,0.24024 1.58203,0.7207 0.37108,0.47657 0.55663,1.15626 0.55664,2.03907 l 0,3.96093 -1.08398,0 0,-3.92578 c -10e-6,-0.6289 -0.11134,-1.0957 -0.33399,-1.40039 -0.22266,-0.30468 -0.56251,-0.45702 -1.01953,-0.45703 -0.5586,10e-6 -1.00001,0.18555 -1.32422,0.55664 -0.32422,0.3711 -0.48633,0.87696 -0.48633,1.51758 l 0,3.70898 -1.08398,0 0,-3.92578 c -1e-5,-0.63281 -0.11133,-1.0996 -0.33398,-1.40039 -0.22267,-0.30468 -0.56642,-0.45702 -1.03125,-0.45703 -0.55079,10e-6 -0.98829,0.18751 -1.3125,0.5625 -0.32423,0.3711 -0.48634,0.87501 -0.48633,1.51172 l 0,3.70898 -1.08399,0 0,-6.5625 1.08399,0 0,1.01954 c 0.24609,-0.40234 0.54101,-0.69922 0.88476,-0.89063 0.34375,-0.1914 0.75195,-0.2871 1.22461,-0.28711 0.47656,10e-6 0.88086,0.1211 1.21289,0.36328 0.33593,0.2422 0.58398,0.59376 0.74414,1.05469"
|
||||
style=""
|
||||
id="path3332" />
|
||||
<path
|
||||
d="m 604.02197,552.0033 c -0.87109,0 -1.47461,0.0996 -1.81054,0.29882 -0.33594,0.19923 -0.50391,0.53907 -0.50391,1.01954 0,0.38281 0.125,0.6875 0.375,0.91406 0.2539,0.22265 0.59765,0.33398 1.03125,0.33398 0.59765,0 1.07617,-0.21093 1.43555,-0.63281 0.36327,-0.42578 0.54491,-0.99023 0.54492,-1.69336 l 0,-0.24023 -1.07227,0 m 2.15039,-0.44532 0,3.74414 -1.07812,0 0,-0.99609 c -0.2461,0.39844 -0.55274,0.69336 -0.91992,0.88477 -0.36719,0.1875 -0.81641,0.28125 -1.34766,0.28125 -0.67188,0 -1.20703,-0.1875 -1.60547,-0.5625 -0.39453,-0.37891 -0.5918,-0.88477 -0.5918,-1.51758 0,-0.73828 0.2461,-1.29492 0.73829,-1.66992 0.49609,-0.375 1.23437,-0.5625 2.21484,-0.5625 l 1.51172,0 0,-0.10547 c -10e-6,-0.49609 -0.16407,-0.8789 -0.49219,-1.14844 -0.32422,-0.27343 -0.78125,-0.41015 -1.37109,-0.41016 -0.37501,10e-6 -0.74024,0.0449 -1.09571,0.13477 -0.35547,0.0898 -0.69726,0.22461 -1.02539,0.4043 l 0,-0.9961 c 0.39453,-0.15234 0.77735,-0.26562 1.14844,-0.33984 0.37109,-0.0781 0.73242,-0.11718 1.08399,-0.11719 0.94921,10e-6 1.65819,0.2461 2.12695,0.73828 0.46874,0.4922 0.70312,1.23829 0.70312,2.23828"
|
||||
style=""
|
||||
id="path3334" />
|
||||
<path
|
||||
d="m 612.20166,549.74744 c -0.1211,-0.0703 -0.25391,-0.12109 -0.39844,-0.15235 -0.14063,-0.0352 -0.29688,-0.0527 -0.46875,-0.0527 -0.60938,0 -1.07813,0.19922 -1.40625,0.59765 -0.32422,0.39454 -0.48633,0.9629 -0.48633,1.70508 l 0,3.45703 -1.08398,0 0,-6.5625 1.08398,0 0,1.01954 c 0.22656,-0.39844 0.52149,-0.69336 0.88477,-0.88477 0.36328,-0.19531 0.80468,-0.29296 1.32422,-0.29297 0.0742,10e-6 0.15624,0.006 0.24609,0.0176 0.0898,0.008 0.18945,0.0215 0.29883,0.041 l 0.006,1.10743"
|
||||
style=""
|
||||
id="path3336" />
|
||||
<path
|
||||
d="m 616.07471,555.9115 c -0.30469,0.78125 -0.60157,1.29101 -0.89063,1.5293 -0.28906,0.23827 -0.67578,0.35742 -1.16015,0.35742 l -0.86133,0 0,-0.90235 0.63281,0 c 0.29687,0 0.52734,-0.0703 0.69141,-0.21093 0.16406,-0.14063 0.3457,-0.47266 0.54492,-0.9961 l 0.19336,-0.49218 -2.6543,-6.45704 1.14258,0 2.05078,5.13282 2.05078,-5.13282 1.14258,0 -2.88281,7.17188"
|
||||
style=""
|
||||
id="path3338" />
|
||||
<path
|
||||
d="m 624.31299,546.55408 1.76367,0 2.23242,5.95312 2.24414,-5.95312 1.76367,0 0,8.74804 -1.15429,0 0,-7.68164 -2.25586,6 -1.18945,0 -2.25586,-6 0,7.68164 -1.14844,0 0,-8.74804"
|
||||
style=""
|
||||
id="path3340" />
|
||||
<path
|
||||
d="m 637.16846,549.49548 c -0.57813,10e-6 -1.03516,0.22657 -1.3711,0.67969 -0.33594,0.44922 -0.5039,1.06641 -0.5039,1.85156 0,0.78516 0.16601,1.4043 0.49804,1.85743 0.33594,0.44921 0.79492,0.67382 1.37696,0.67382 0.57421,0 1.02929,-0.22656 1.36523,-0.67968 0.33593,-0.45313 0.5039,-1.07031 0.50391,-1.85157 -10e-6,-0.77734 -0.16798,-1.39257 -0.50391,-1.8457 -0.33594,-0.45703 -0.79102,-0.68554 -1.36523,-0.68555 m 0,-0.91406 c 0.93749,10e-6 1.67382,0.30469 2.20898,0.91406 0.53515,0.60938 0.80273,1.45313 0.80274,2.53125 -10e-6,1.07422 -0.26759,1.91797 -0.80274,2.53125 -0.53516,0.60938 -1.27149,0.91407 -2.20898,0.91407 -0.94141,0 -1.67969,-0.30469 -2.21485,-0.91407 -0.53125,-0.61328 -0.79687,-1.45703 -0.79687,-2.53125 0,-1.07812 0.26562,-1.92187 0.79687,-2.53125 0.53516,-0.60937 1.27344,-0.91405 2.21485,-0.91406"
|
||||
style=""
|
||||
id="path3342" />
|
||||
<path
|
||||
d="m 647.4165,551.34119 0,3.96093 -1.07812,0 0,-3.92578 c -10e-6,-0.62109 -0.1211,-1.08593 -0.36328,-1.39453 -0.24219,-0.30859 -0.60548,-0.46288 -1.08985,-0.46289 -0.58203,10e-6 -1.04101,0.18555 -1.37695,0.55664 -0.33594,0.3711 -0.50391,0.87696 -0.50391,1.51758 l 0,3.70898 -1.08398,0 0,-6.5625 1.08398,0 0,1.01954 c 0.25781,-0.39453 0.56055,-0.68945 0.90821,-0.88477 0.35156,-0.19531 0.75585,-0.29296 1.21289,-0.29297 0.7539,10e-6 1.32421,0.23438 1.71094,0.70313 0.38671,0.46485 0.58007,1.15039 0.58007,2.05664"
|
||||
style=""
|
||||
id="path3344" />
|
||||
<path
|
||||
d="m 649.57861,548.73962 1.07813,0 0,6.5625 -1.07813,0 0,-6.5625 m 0,-2.55468 1.07813,0 0,1.36523 -1.07813,0 0,-1.36523"
|
||||
style=""
|
||||
id="path3346" />
|
||||
<path
|
||||
d="m 653.97314,546.87634 0,1.86328 2.22071,0 0,0.83789 -2.22071,0 0,3.5625 c 0,0.53516 0.0723,0.87891 0.2168,1.03125 0.14844,0.15235 0.44726,0.22852 0.89649,0.22852 l 1.10742,0 0,0.90234 -1.10742,0 c -0.83204,0 -1.40626,-0.15429 -1.72266,-0.46289 -0.31641,-0.3125 -0.47461,-0.8789 -0.47461,-1.69922 l 0,-3.5625 -0.79102,0 0,-0.83789 0.79102,0 0,-1.86328 1.08398,0"
|
||||
style=""
|
||||
id="path3348" />
|
||||
<path
|
||||
d="m 660.16064,549.49548 c -0.57812,10e-6 -1.03515,0.22657 -1.37109,0.67969 -0.33594,0.44922 -0.50391,1.06641 -0.50391,1.85156 0,0.78516 0.16602,1.4043 0.49805,1.85743 0.33594,0.44921 0.79492,0.67382 1.37695,0.67382 0.57422,0 1.0293,-0.22656 1.36524,-0.67968 0.33593,-0.45313 0.5039,-1.07031 0.50391,-1.85157 -1e-5,-0.77734 -0.16798,-1.39257 -0.50391,-1.8457 -0.33594,-0.45703 -0.79102,-0.68554 -1.36524,-0.68555 m 0,-0.91406 c 0.9375,10e-6 1.67383,0.30469 2.20899,0.91406 0.53515,0.60938 0.80273,1.45313 0.80273,2.53125 0,1.07422 -0.26758,1.91797 -0.80273,2.53125 -0.53516,0.60938 -1.27149,0.91407 -2.20899,0.91407 -0.9414,0 -1.67968,-0.30469 -2.21484,-0.91407 -0.53125,-0.61328 -0.79687,-1.45703 -0.79687,-2.53125 0,-1.07812 0.26562,-1.92187 0.79687,-2.53125 0.53516,-0.60937 1.27344,-0.91405 2.21484,-0.91406"
|
||||
style=""
|
||||
id="path3350" />
|
||||
<path
|
||||
d="m 668.75635,549.74744 c -0.1211,-0.0703 -0.25391,-0.12109 -0.39844,-0.15235 -0.14063,-0.0352 -0.29688,-0.0527 -0.46875,-0.0527 -0.60938,0 -1.07813,0.19922 -1.40625,0.59765 -0.32422,0.39454 -0.48633,0.9629 -0.48633,1.70508 l 0,3.45703 -1.08398,0 0,-6.5625 1.08398,0 0,1.01954 c 0.22656,-0.39844 0.52148,-0.69336 0.88477,-0.88477 0.36328,-0.19531 0.80468,-0.29296 1.32422,-0.29297 0.0742,10e-6 0.15624,0.006 0.24609,0.0176 0.0898,0.008 0.18945,0.0215 0.29883,0.041 l 0.006,1.10743"
|
||||
style=""
|
||||
id="path3352" />
|
||||
</g>
|
||||
<g
|
||||
style="font-size:12px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#0000ff;fill-opacity:1;stroke:none;font-family:Sans"
|
||||
id="text3781">
|
||||
<path
|
||||
d="m 612.64136,657.77118 -3.33985,-8.74805 1.23633,0 2.77149,7.36524 2.77734,-7.36524 1.23047,0 -3.33399,8.74805 -1.34179,0"
|
||||
style=""
|
||||
id="path3401" />
|
||||
<path
|
||||
d="m 618.28394,651.20868 1.07812,0 0,6.5625 -1.07812,0 0,-6.5625 m 0,-2.55469 1.07812,0 0,1.36524 -1.07812,0 0,-1.36524"
|
||||
style=""
|
||||
id="path3403" />
|
||||
<path
|
||||
d="m 625.41479,652.21649 c -0.12109,-0.0703 -0.25391,-0.12109 -0.39843,-0.15234 -0.14063,-0.0352 -0.29688,-0.0527 -0.46875,-0.0527 -0.60938,1e-5 -1.07813,0.19923 -1.40625,0.59766 -0.32422,0.39454 -0.48633,0.96289 -0.48633,1.70508 l 0,3.45703 -1.08399,0 0,-6.5625 1.08399,0 0,1.01953 c 0.22656,-0.39843 0.52148,-0.69335 0.88476,-0.88477 0.36328,-0.1953 0.80469,-0.29296 1.32422,-0.29296 0.0742,0 0.15625,0.006 0.2461,0.0176 0.0898,0.008 0.18945,0.0215 0.29883,0.041 l 0.006,1.10742"
|
||||
style=""
|
||||
id="path3405" />
|
||||
<path
|
||||
d="m 627.62378,649.3454 0,1.86328 2.2207,0 0,0.83789 -2.2207,0 0,3.5625 c 0,0.53516 0.0723,0.87891 0.2168,1.03125 0.14843,0.15234 0.44726,0.22852 0.89648,0.22852 l 1.10742,0 0,0.90234 -1.10742,0 c -0.83203,0 -1.40625,-0.1543 -1.72266,-0.46289 -0.3164,-0.3125 -0.47461,-0.87891 -0.47461,-1.69922 l 0,-3.5625 -0.79101,0 0,-0.83789 0.79101,0 0,-1.86328 1.08399,0"
|
||||
style=""
|
||||
id="path3407" />
|
||||
<path
|
||||
d="m 631.15698,655.18134 0,-3.97266 1.07813,0 0,3.93164 c 0,0.6211 0.12109,1.08789 0.36328,1.40039 0.24218,0.3086 0.60546,0.46289 1.08984,0.46289 0.58203,0 1.04101,-0.18554 1.37696,-0.55664 0.33983,-0.37109 0.50976,-0.87695 0.50976,-1.51758 l 0,-3.7207 1.07813,0 0,6.5625 -1.07813,0 0,-1.00781 c -0.26172,0.39843 -0.56641,0.69531 -0.91406,0.89062 -0.34376,0.19141 -0.74415,0.28711 -1.20117,0.28711 -0.75391,0 -1.32618,-0.23437 -1.7168,-0.70312 -0.39063,-0.46875 -0.58594,-1.1543 -0.58594,-2.05664 m 2.71289,-4.13086 0,0"
|
||||
style=""
|
||||
id="path3409" />
|
||||
<path
|
||||
d="m 641.86792,654.47235 c -0.8711,0 -1.47461,0.0996 -1.81055,0.29883 -0.33594,0.19922 -0.50391,0.53906 -0.5039,1.01953 -10e-6,0.38281 0.12499,0.6875 0.375,0.91406 0.2539,0.22266 0.59765,0.33399 1.03125,0.33399 0.59765,0 1.07616,-0.21094 1.43554,-0.63282 0.36328,-0.42577 0.54492,-0.99023 0.54493,-1.69335 l 0,-0.24024 -1.07227,0 m 2.15039,-0.44531 0,3.74414 -1.07812,0 0,-0.99609 c -0.2461,0.39843 -0.55274,0.69336 -0.91993,0.88476 -0.36719,0.1875 -0.81641,0.28125 -1.34765,0.28125 -0.67188,0 -1.20704,-0.1875 -1.60547,-0.5625 -0.39453,-0.3789 -0.5918,-0.88476 -0.5918,-1.51758 0,-0.73828 0.24609,-1.29492 0.73828,-1.66992 0.49609,-0.37499 1.23438,-0.56249 2.21485,-0.5625 l 1.51172,0 0,-0.10547 c -10e-6,-0.49609 -0.16407,-0.8789 -0.49219,-1.14844 -0.32423,-0.27343 -0.78126,-0.41015 -1.3711,-0.41015 -0.375,0 -0.74023,0.0449 -1.0957,0.13476 -0.35547,0.0899 -0.69727,0.22462 -1.02539,0.4043 l 0,-0.99609 c 0.39453,-0.15234 0.77734,-0.26562 1.14844,-0.33985 0.37109,-0.0781 0.73242,-0.11718 1.08398,-0.11718 0.94922,0 1.6582,0.2461 2.12696,0.73828 0.46874,0.49219 0.70311,1.23828 0.70312,2.23828"
|
||||
style=""
|
||||
id="path3411" />
|
||||
<path
|
||||
d="m 646.24487,648.65399 1.07813,0 0,9.11719 -1.07813,0 0,-9.11719"
|
||||
style=""
|
||||
id="path3413" />
|
||||
<path
|
||||
d="m 658.68433,649.31024 0,1.1543 c -0.44923,-0.21484 -0.87306,-0.37499 -1.27149,-0.48047 -0.39844,-0.10546 -0.78321,-0.1582 -1.1543,-0.1582 -0.64453,0 -1.14258,0.125 -1.49414,0.375 -0.34765,0.25 -0.52148,0.60547 -0.52148,1.0664 0,0.38673 0.11523,0.6797 0.3457,0.87891 0.23438,0.19532 0.67578,0.35352 1.32422,0.47461 l 0.71485,0.14648 c 0.8828,0.16798 1.53319,0.46485 1.95117,0.89063 0.42187,0.42188 0.6328,0.98828 0.63281,1.69922 -10e-6,0.84765 -0.28516,1.49023 -0.85547,1.92773 -0.56641,0.4375 -1.39844,0.65625 -2.49609,0.65625 -0.41407,0 -0.85547,-0.0469 -1.32422,-0.14062 -0.46485,-0.0937 -0.94727,-0.23243 -1.44727,-0.41602 l 0,-1.21875 c 0.48047,0.26953 0.95117,0.47266 1.41211,0.60938 0.46094,0.13672 0.91406,0.20507 1.35938,0.20507 0.67577,0 1.19726,-0.13281 1.56445,-0.39843 0.36718,-0.26563 0.55078,-0.64453 0.55078,-1.13672 0,-0.42969 -0.13282,-0.76562 -0.39844,-1.00782 -0.26172,-0.24218 -0.69336,-0.42382 -1.29492,-0.54492 l -0.7207,-0.14062 c -0.88282,-0.17578 -1.52149,-0.45117 -1.91602,-0.82617 -0.39453,-0.375 -0.59179,-0.89648 -0.59179,-1.56446 0,-0.77343 0.27148,-1.3828 0.81445,-1.82812 0.54687,-0.44531 1.29883,-0.66796 2.25586,-0.66797 0.41015,1e-5 0.82812,0.0371 1.25391,0.11133 0.42577,0.0742 0.86132,0.18555 1.30664,0.33398"
|
||||
style=""
|
||||
id="path3415" />
|
||||
<path
|
||||
d="m 665.73315,651.46063 0,1.00781 c -0.30469,-0.16796 -0.61133,-0.29296 -0.91992,-0.375 -0.30469,-0.0859 -0.61328,-0.1289 -0.92578,-0.1289 -0.69922,0 -1.24219,0.22266 -1.62891,0.66797 -0.38672,0.44141 -0.58008,1.0625 -0.58007,1.86328 -10e-6,0.80078 0.19335,1.42383 0.58007,1.86914 0.38672,0.44141 0.92969,0.66211 1.62891,0.66211 0.3125,0 0.62109,-0.041 0.92578,-0.12305 0.30859,-0.0859 0.61523,-0.21289 0.91992,-0.38086 l 0,0.9961 c -0.30078,0.14062 -0.61328,0.24609 -0.9375,0.3164 -0.32031,0.0703 -0.66211,0.10547 -1.02539,0.10547 -0.98828,0 -1.77344,-0.31055 -2.35547,-0.93164 -0.58203,-0.62109 -0.87304,-1.45898 -0.87304,-2.51367 0,-1.07031 0.29297,-1.91211 0.8789,-2.52539 0.58985,-0.61328 1.39649,-0.91992 2.41993,-0.91992 0.33202,0 0.65624,0.0352 0.97265,0.10546 0.3164,0.0664 0.62304,0.16798 0.91992,0.30469"
|
||||
style=""
|
||||
id="path3417" />
|
||||
<path
|
||||
d="m 671.42261,652.21649 c -0.1211,-0.0703 -0.25391,-0.12109 -0.39844,-0.15234 -0.14063,-0.0352 -0.29688,-0.0527 -0.46875,-0.0527 -0.60938,1e-5 -1.07813,0.19923 -1.40625,0.59766 -0.32422,0.39454 -0.48633,0.96289 -0.48633,1.70508 l 0,3.45703 -1.08398,0 0,-6.5625 1.08398,0 0,1.01953 c 0.22656,-0.39843 0.52148,-0.69335 0.88477,-0.88477 0.36328,-0.1953 0.80468,-0.29296 1.32422,-0.29296 0.0742,0 0.15624,0.006 0.24609,0.0176 0.0898,0.008 0.18945,0.0215 0.29883,0.041 l 0.006,1.10742"
|
||||
style=""
|
||||
id="path3419" />
|
||||
<path
|
||||
d="m 677.92065,654.2204 0,0.52734 -4.95703,0 c 0.0469,0.74219 0.26953,1.3086 0.66797,1.69922 0.40234,0.38672 0.96094,0.58008 1.67578,0.58008 0.41406,0 0.81445,-0.0508 1.20117,-0.15235 0.39062,-0.10156 0.77734,-0.2539 1.16016,-0.45703 l 0,1.01953 c -0.38672,0.16407 -0.78321,0.28907 -1.18945,0.375 -0.40626,0.0859 -0.81837,0.12891 -1.23633,0.12891 -1.04688,0 -1.87696,-0.30469 -2.49023,-0.91406 -0.60938,-0.60938 -0.91407,-1.43359 -0.91407,-2.47266 0,-1.07421 0.28906,-1.92577 0.86719,-2.55469 0.58203,-0.6328 1.36523,-0.94921 2.34961,-0.94921 0.88281,0 1.58007,0.28516 2.0918,0.85546 0.51562,0.56642 0.77343,1.3379 0.77343,2.31446 m -1.07812,-0.31641 c -0.008,-0.58984 -0.17383,-1.06054 -0.49805,-1.41211 -0.32031,-0.35155 -0.7461,-0.52734 -1.27734,-0.52734 -0.60157,0 -1.08399,0.16993 -1.44727,0.50976 -0.35937,0.33985 -0.56641,0.81837 -0.62109,1.43555 l 3.84375,-0.006"
|
||||
style=""
|
||||
id="path3421" />
|
||||
<path
|
||||
d="m 685.30347,654.2204 0,0.52734 -4.95703,0 c 0.0469,0.74219 0.26952,1.3086 0.66796,1.69922 0.40235,0.38672 0.96094,0.58008 1.67579,0.58008 0.41405,0 0.81444,-0.0508 1.20117,-0.15235 0.39062,-0.10156 0.77734,-0.2539 1.16015,-0.45703 l 0,1.01953 c -0.38672,0.16407 -0.78321,0.28907 -1.18945,0.375 -0.40625,0.0859 -0.81836,0.12891 -1.23633,0.12891 -1.04688,0 -1.87695,-0.30469 -2.49023,-0.91406 -0.60938,-0.60938 -0.91407,-1.43359 -0.91406,-2.47266 -10e-6,-1.07421 0.28906,-1.92577 0.86718,-2.55469 0.58203,-0.6328 1.36523,-0.94921 2.34961,-0.94921 0.88281,0 1.58008,0.28516 2.0918,0.85546 0.51562,0.56642 0.77343,1.3379 0.77344,2.31446 m -1.07813,-0.31641 c -0.008,-0.58984 -0.17383,-1.06054 -0.49805,-1.41211 -0.32031,-0.35155 -0.74609,-0.52734 -1.27734,-0.52734 -0.60156,0 -1.08399,0.16993 -1.44726,0.50976 -0.35938,0.33985 -0.56641,0.81837 -0.6211,1.43555 l 3.84375,-0.006"
|
||||
style=""
|
||||
id="path3423" />
|
||||
<path
|
||||
d="m 692.52808,653.81024 0,3.96094 -1.07813,0 0,-3.92578 c 0,-0.62109 -0.1211,-1.08593 -0.36328,-1.39453 -0.24219,-0.30859 -0.60547,-0.46289 -1.08984,-0.46289 -0.58204,0 -1.04102,0.18555 -1.37696,0.55664 -0.33594,0.3711 -0.50391,0.87695 -0.5039,1.51757 l 0,3.70899 -1.08399,0 0,-6.5625 1.08399,0 0,1.01953 c 0.25781,-0.39452 0.56054,-0.68945 0.9082,-0.88477 0.35156,-0.1953 0.75586,-0.29296 1.21289,-0.29296 0.7539,0 1.32421,0.23438 1.71094,0.70312 0.38671,0.46485 0.58007,1.1504 0.58008,2.05664"
|
||||
style=""
|
||||
id="path3425" />
|
||||
</g>
|
||||
<rect
|
||||
style="fill:#b8b8b8;fill-opacity:1;stroke:#b8b8b8;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
|
||||
id="rect5577"
|
||||
width="173.25098"
|
||||
height="141.43118"
|
||||
x="157.75581"
|
||||
y="436.97159" />
|
||||
<rect
|
||||
style="fill:#ededed;fill-opacity:1;stroke:#ededed;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
id="rect3789"
|
||||
width="168.99611"
|
||||
height="136.87178"
|
||||
x="159.87543"
|
||||
y="439.39697"
|
||||
inkscape:export-filename="/home/elmindreda/projects/glfw/glfw/docs/spaces.png"
|
||||
inkscape:export-xdpi="109.89113"
|
||||
inkscape:export-ydpi="109.89113" />
|
||||
<g
|
||||
style="font-size:12px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#454545;fill-opacity:1;stroke:none;font-family:Sans"
|
||||
id="text3791">
|
||||
<path
|
||||
d="m 274.28683,558.98682 1.19532,0 1.83984,7.39453 1.83399,-7.39453 1.33007,0 1.83985,7.39453 1.83398,-7.39453 1.20117,0 -2.19726,8.74804 -1.48828,0 -1.84571,-7.59375 -1.86328,7.59375 -1.48828,0 -2.19141,-8.74804"
|
||||
style=""
|
||||
id="path3388" />
|
||||
<path
|
||||
d="m 286.62082,561.17236 1.07812,0 0,6.5625 -1.07812,0 0,-6.5625 m 0,-2.55468 1.07812,0 0,1.36523 -1.07812,0 0,-1.36523"
|
||||
style=""
|
||||
id="path3390" />
|
||||
<path
|
||||
d="m 295.40402,563.77393 0,3.96093 -1.07812,0 0,-3.92578 c -10e-6,-0.62109 -0.1211,-1.08593 -0.36328,-1.39453 -0.2422,-0.30859 -0.60548,-0.46288 -1.08985,-0.46289 -0.58203,1e-5 -1.04102,0.18555 -1.37695,0.55664 -0.33594,0.3711 -0.50391,0.87696 -0.50391,1.51758 l 0,3.70898 -1.08398,0 0,-6.5625 1.08398,0 0,1.01953 c 0.25781,-0.39452 0.56055,-0.68944 0.90821,-0.88476 0.35156,-0.19531 0.75585,-0.29296 1.21289,-0.29297 0.7539,1e-5 1.32421,0.23438 1.71093,0.70313 0.38672,0.46484 0.58008,1.15039 0.58008,2.05664"
|
||||
style=""
|
||||
id="path3392" />
|
||||
<path
|
||||
d="m 301.88449,562.16846 0,-3.55078 1.07813,0 0,9.11718 -1.07813,0 0,-0.98437 c -0.22657,0.39062 -0.51368,0.68164 -0.86133,0.87305 -0.34375,0.1875 -0.75781,0.28124 -1.24218,0.28125 -0.79298,-1e-5 -1.43946,-0.31641 -1.93946,-0.94922 -0.49609,-0.63281 -0.74414,-1.46485 -0.74414,-2.4961 0,-1.03124 0.24805,-1.86327 0.74414,-2.49609 0.5,-0.63281 1.14648,-0.94921 1.93946,-0.94922 0.48437,1e-5 0.89843,0.0957 1.24218,0.28711 0.34765,0.18751 0.63476,0.47657 0.86133,0.86719 m -3.67383,2.29101 c 0,0.79297 0.16211,1.41602 0.48633,1.86914 0.32812,0.44922 0.77734,0.67383 1.34766,0.67383 0.57031,0 1.01952,-0.22461 1.34765,-0.67383 0.32812,-0.45312 0.49219,-1.07617 0.49219,-1.86914 0,-0.79296 -0.16407,-1.41406 -0.49219,-1.86328 -0.32813,-0.45312 -0.77734,-0.67968 -1.34765,-0.67969 -0.57032,10e-6 -1.01954,0.22657 -1.34766,0.67969 -0.32422,0.44922 -0.48633,1.07032 -0.48633,1.86328"
|
||||
style=""
|
||||
id="path3394" />
|
||||
<path
|
||||
d="m 307.72629,561.92822 c -0.57813,10e-6 -1.03516,0.22657 -1.3711,0.67969 -0.33594,0.44922 -0.5039,1.06641 -0.5039,1.85156 0,0.78516 0.16601,1.4043 0.49804,1.85742 0.33594,0.44922 0.79492,0.67383 1.37696,0.67383 0.57421,0 1.02929,-0.22656 1.36523,-0.67968 0.33593,-0.45313 0.5039,-1.07031 0.50391,-1.85157 -1e-5,-0.77734 -0.16798,-1.39257 -0.50391,-1.8457 -0.33594,-0.45703 -0.79102,-0.68554 -1.36523,-0.68555 m 0,-0.91406 c 0.93749,1e-5 1.67382,0.30469 2.20898,0.91406 0.53515,0.60938 0.80273,1.45313 0.80274,2.53125 -10e-6,1.07422 -0.26759,1.91797 -0.80274,2.53125 -0.53516,0.60938 -1.27149,0.91406 -2.20898,0.91407 -0.94141,-1e-5 -1.67969,-0.30469 -2.21485,-0.91407 -0.53125,-0.61328 -0.79687,-1.45703 -0.79687,-2.53125 0,-1.07812 0.26562,-1.92187 0.79687,-2.53125 0.53516,-0.60937 1.27344,-0.91405 2.21485,-0.91406"
|
||||
style=""
|
||||
id="path3396" />
|
||||
<path
|
||||
d="m 311.8923,561.17236 1.07813,0 1.34765,5.1211 1.3418,-5.1211 1.27149,0 1.34765,5.1211 1.3418,-5.1211 1.07812,0 -1.71679,6.5625 -1.27149,0 -1.41211,-5.3789 -1.41797,5.3789 -1.27148,0 -1.7168,-6.5625"
|
||||
style=""
|
||||
id="path3398" />
|
||||
</g>
|
||||
<rect
|
||||
y="439.39581"
|
||||
x="159.87428"
|
||||
height="8.8251209"
|
||||
width="168.99841"
|
||||
id="rect3795"
|
||||
style="fill:#7b7bff;fill-opacity:1;stroke:#7b7bff;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
inkscape:export-filename="/home/elmindreda/projects/glfw/glfw/docs/spaces.png"
|
||||
inkscape:export-xdpi="109.89113"
|
||||
inkscape:export-ydpi="109.89113" />
|
||||
<path
|
||||
sodipodi:type="arc"
|
||||
style="fill:#000000;fill-opacity:1;stroke:none"
|
||||
id="path3797"
|
||||
sodipodi:cx="352.54324"
|
||||
sodipodi:cy="373.03461"
|
||||
sodipodi:rx="2.5253813"
|
||||
sodipodi:ry="2.5253813"
|
||||
d="m 355.06862,373.03461 c 0,1.39473 -1.13065,2.52538 -2.52538,2.52538 -1.39473,0 -2.52538,-1.13065 -2.52538,-2.52538 0,-1.39473 1.13065,-2.52538 2.52538,-2.52538 1.39473,0 2.52538,1.13065 2.52538,2.52538 z"
|
||||
transform="matrix(0.66107369,0,0,0.66107369,123.32145,119.41326)"
|
||||
inkscape:export-filename="/home/elmindreda/projects/glfw/glfw/docs/spaces.png"
|
||||
inkscape:export-xdpi="109.89113"
|
||||
inkscape:export-ydpi="109.89113" />
|
||||
<path
|
||||
transform="matrix(0.66107369,0,0,0.66107369,-194.73594,119.44704)"
|
||||
d="m 355.06862,373.03461 c 0,1.39473 -1.13065,2.52538 -2.52538,2.52538 -1.39473,0 -2.52538,-1.13065 -2.52538,-2.52538 0,-1.39473 1.13065,-2.52538 2.52538,-2.52538 1.39473,0 2.52538,1.13065 2.52538,2.52538 z"
|
||||
sodipodi:ry="2.5253813"
|
||||
sodipodi:rx="2.5253813"
|
||||
sodipodi:cy="373.03461"
|
||||
sodipodi:cx="352.54324"
|
||||
id="path3799"
|
||||
style="fill:#000000;fill-opacity:1;stroke:none"
|
||||
sodipodi:type="arc"
|
||||
inkscape:export-filename="/home/elmindreda/projects/glfw/glfw/docs/spaces.png"
|
||||
inkscape:export-xdpi="109.89113"
|
||||
inkscape:export-ydpi="109.89113" />
|
||||
<path
|
||||
sodipodi:type="arc"
|
||||
style="fill:#000000;fill-opacity:1;stroke:none"
|
||||
id="path3801"
|
||||
sodipodi:cx="352.54324"
|
||||
sodipodi:cy="373.03461"
|
||||
sodipodi:rx="2.5253813"
|
||||
sodipodi:ry="2.5253813"
|
||||
d="m 355.06862,373.03461 c 0,1.39473 -1.13065,2.52538 -2.52538,2.52538 -1.39473,0 -2.52538,-1.13065 -2.52538,-2.52538 0,-1.39473 1.13065,-2.52538 2.52538,-2.52538 1.39473,0 2.52538,1.13065 2.52538,2.52538 z"
|
||||
transform="matrix(0.66107369,0,0,0.66107369,-73.218648,201.61091)"
|
||||
inkscape:export-filename="/home/elmindreda/projects/glfw/glfw/docs/spaces.png"
|
||||
inkscape:export-xdpi="109.89113"
|
||||
inkscape:export-ydpi="109.89113" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none"
|
||||
x="21.213203"
|
||||
y="340.20465"
|
||||
id="text3803"
|
||||
inkscape:export-filename="/home/elmindreda/projects/glfw/glfw/docs/spaces.png"
|
||||
inkscape:export-xdpi="109.89113"
|
||||
inkscape:export-ydpi="109.89113"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan3805"
|
||||
x="21.213203"
|
||||
y="340.20465"
|
||||
style="font-size:12px;line-height:1.25;font-family:sans-serif"> </tspan></text>
|
||||
<g
|
||||
style="font-size:12px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
|
||||
id="text3807">
|
||||
<path
|
||||
d="m 71.179893,455.55557 0.996094,0 1.533203,6.16211 1.528321,-6.16211 1.108398,0 1.533203,6.16211 1.528321,-6.16211 1.000976,0 -1.831055,7.29004 -1.240234,0 -1.538086,-6.32812 -1.552734,6.32812 -1.240235,0 -1.826172,-7.29004"
|
||||
style="font-size:10px"
|
||||
id="path3164" />
|
||||
<path
|
||||
d="m 81.458214,457.37686 0.898437,0 0,5.46875 -0.898437,0 0,-5.46875 m 0,-2.1289 0.898437,0 0,1.13769 -0.898437,0 0,-1.13769"
|
||||
style="font-size:10px"
|
||||
id="path3166" />
|
||||
<path
|
||||
d="m 88.77755,459.54483 0,3.30078 -0.898438,0 0,-3.27148 c -4e-6,-0.51758 -0.100916,-0.90495 -0.302734,-1.16211 -0.201827,-0.25716 -0.504561,-0.38574 -0.908203,-0.38574 -0.485029,0 -0.867516,0.15462 -1.147461,0.46386 -0.27995,0.30925 -0.419924,0.7308 -0.419922,1.26465 l 0,3.09082 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.214842,-0.32877 0.46712,-0.57454 0.756836,-0.7373 0.292966,-0.16276 0.629879,-0.24414 1.010742,-0.24414 0.628251,0 1.103511,0.19531 1.425781,0.58593 0.322261,0.38738 0.483393,0.95867 0.483399,1.71387"
|
||||
style="font-size:10px"
|
||||
id="path3168" />
|
||||
<path
|
||||
d="m 94.17794,458.20694 0,-2.95898 0.898438,0 0,7.59765 -0.898438,0 0,-0.82031 c -0.188806,0.32552 -0.428064,0.56803 -0.717773,0.72754 -0.286462,0.15625 -0.631514,0.23437 -1.035156,0.23437 -0.66081,0 -1.199546,-0.26367 -1.616211,-0.79101 -0.413412,-0.52735 -0.620118,-1.2207 -0.620117,-2.08008 -10e-7,-0.85937 0.206705,-1.55273 0.620117,-2.08008 0.416665,-0.52734 0.955401,-0.79101 1.616211,-0.79101 0.403642,0 0.748694,0.0797 1.035156,0.23925 0.289709,0.15626 0.528967,0.39714 0.717773,0.72266 m -3.061523,1.90918 c -2e-6,0.66081 0.135089,1.18001 0.405273,1.55762 0.273436,0.37435 0.647784,0.56152 1.123047,0.56152 0.475257,0 0.849606,-0.18717 1.123047,-0.56152 0.273433,-0.37761 0.410152,-0.89681 0.410156,-1.55762 -4e-6,-0.6608 -0.136723,-1.17838 -0.410156,-1.55273 -0.273441,-0.3776 -0.64779,-0.56641 -1.123047,-0.56641 -0.475263,0 -0.849611,0.18881 -1.123047,0.56641 -0.270184,0.37435 -0.405275,0.89193 -0.405273,1.55273"
|
||||
style="font-size:10px"
|
||||
id="path3170" />
|
||||
<path
|
||||
d="m 99.046104,458.00674 c -0.481773,1e-5 -0.862632,0.18881 -1.142578,0.56641 -0.279949,0.37435 -0.419923,0.88868 -0.419922,1.54297 -10e-7,0.6543 0.138345,1.17025 0.415039,1.54785 0.279946,0.37435 0.662433,0.56153 1.147461,0.56152 0.478513,1e-5 0.857744,-0.1888 1.137696,-0.5664 0.27994,-0.3776 0.41992,-0.89193 0.41992,-1.54297 0,-0.64778 -0.13998,-1.16048 -0.41992,-1.53809 -0.279952,-0.38085 -0.659183,-0.57128 -1.137696,-0.57129 m 0,-0.76171 c 0.781247,0 1.394856,0.25391 1.840816,0.76171 0.44596,0.50782 0.66894,1.21095 0.66895,2.10938 -1e-5,0.89518 -0.22299,1.59831 -0.66895,2.10937 -0.44596,0.50782 -1.059569,0.76172 -1.840816,0.76172 -0.784507,0 -1.399741,-0.2539 -1.845703,-0.76172 -0.442709,-0.51106 -0.664063,-1.21419 -0.664062,-2.10937 -10e-7,-0.89843 0.221353,-1.60156 0.664062,-2.10938 0.445962,-0.5078 1.061196,-0.76171 1.845703,-0.76171"
|
||||
style="font-size:10px"
|
||||
id="path3172" />
|
||||
<path
|
||||
d="m 102.51778,457.37686 0.89844,0 1.12305,4.26758 1.11816,-4.26758 1.05957,0 1.12305,4.26758 1.11816,-4.26758 0.89844,0 -1.43066,5.46875 -1.05957,0 -1.17676,-4.48242 -1.18164,4.48242 -1.05957,0 -1.43067,-5.46875"
|
||||
style="font-size:10px"
|
||||
id="path3174" />
|
||||
<path
|
||||
d="m 115.27657,462.0253 0,2.90039 -0.90332,0 0,-7.54883 0.90332,0 0,0.83008 c 0.1888,-0.32552 0.42643,-0.5664 0.71289,-0.72266 0.28971,-0.1595 0.63477,-0.23925 1.03516,-0.23925 0.66406,0 1.20279,0.26367 1.61621,0.79101 0.41666,0.52735 0.625,1.22071 0.625,2.08008 0,0.85938 -0.20834,1.55273 -0.625,2.08008 -0.41342,0.52734 -0.95215,0.79101 -1.61621,0.79101 -0.40039,0 -0.74545,-0.0781 -1.03516,-0.23437 -0.28646,-0.15951 -0.52409,-0.40202 -0.71289,-0.72754 m 3.05664,-1.90918 c 0,-0.6608 -0.13672,-1.17838 -0.41015,-1.55273 -0.27019,-0.3776 -0.64291,-0.56641 -1.11817,-0.56641 -0.47526,0 -0.84961,0.18881 -1.12304,0.56641 -0.27019,0.37435 -0.40528,0.89193 -0.40528,1.55273 0,0.66081 0.13509,1.18001 0.40528,1.55762 0.27343,0.37435 0.64778,0.56152 1.12304,0.56152 0.47526,0 0.84798,-0.18717 1.11817,-0.56152 0.27343,-0.37761 0.41015,-0.89681 0.41015,-1.55762"
|
||||
style="font-size:10px"
|
||||
id="path3176" />
|
||||
<path
|
||||
d="m 122.87423,458.00674 c -0.48177,1e-5 -0.86263,0.18881 -1.14258,0.56641 -0.27995,0.37435 -0.41992,0.88868 -0.41992,1.54297 0,0.6543 0.13834,1.17025 0.41504,1.54785 0.27994,0.37435 0.66243,0.56153 1.14746,0.56152 0.47851,1e-5 0.85774,-0.1888 1.13769,-0.5664 0.27995,-0.3776 0.41992,-0.89193 0.41993,-1.54297 -1e-5,-0.64778 -0.13998,-1.16048 -0.41993,-1.53809 -0.27995,-0.38085 -0.65918,-0.57128 -1.13769,-0.57129 m 0,-0.76171 c 0.78125,0 1.39485,0.25391 1.84082,0.76171 0.44596,0.50782 0.66894,1.21095 0.66895,2.10938 -1e-5,0.89518 -0.22299,1.59831 -0.66895,2.10937 -0.44597,0.50782 -1.05957,0.76172 -1.84082,0.76172 -0.78451,0 -1.39974,-0.2539 -1.8457,-0.76172 -0.44271,-0.51106 -0.66407,-1.21419 -0.66407,-2.10937 0,-0.89843 0.22136,-1.60156 0.66407,-2.10938 0.44596,-0.5078 1.06119,-0.76171 1.8457,-0.76171"
|
||||
style="font-size:10px"
|
||||
id="path3178" />
|
||||
<path
|
||||
d="m 130.3547,457.53799 0,0.84961 c -0.25391,-0.1302 -0.51758,-0.22786 -0.79102,-0.29296 -0.27344,-0.0651 -0.55664,-0.0977 -0.84961,-0.0977 -0.44596,0 -0.78125,0.0684 -1.00586,0.20508 -0.22135,0.13672 -0.33203,0.3418 -0.33203,0.61523 0,0.20834 0.0797,0.37273 0.23926,0.49317 0.1595,0.11719 0.48014,0.22949 0.96191,0.33691 l 0.30762,0.0684 c 0.63802,0.13672 1.09049,0.33041 1.35742,0.58105 0.27018,0.2474 0.40527,0.59408 0.40528,1.04004 -1e-5,0.50782 -0.20183,0.90983 -0.60547,1.20606 -0.4004,0.29622 -0.95215,0.44433 -1.65528,0.44433 -0.29297,0 -0.59896,-0.0293 -0.91796,-0.0879 -0.31576,-0.0553 -0.64942,-0.13997 -1.00098,-0.2539 l 0,-0.92774 c 0.33203,0.17253 0.65918,0.30274 0.98144,0.39063 0.32227,0.0846 0.64128,0.12695 0.95704,0.12695 0.42317,0 0.74869,-0.0716 0.97656,-0.21484 0.22786,-0.14649 0.34179,-0.35157 0.3418,-0.61524 -1e-5,-0.24414 -0.083,-0.43131 -0.24903,-0.56152 -0.16276,-0.13021 -0.52246,-0.25553 -1.0791,-0.37598 l -0.3125,-0.0732 c -0.55664,-0.11719 -0.95866,-0.29622 -1.20605,-0.53711 -0.2474,-0.24414 -0.3711,-0.5778 -0.3711,-1.00098 0,-0.51431 0.18229,-0.91145 0.54688,-1.1914 0.36458,-0.27994 0.88216,-0.41992 1.55273,-0.41992 0.33203,0 0.64453,0.0244 0.9375,0.0732 0.29297,0.0488 0.56315,0.12207 0.81055,0.21972"
|
||||
style="font-size:10px"
|
||||
id="path3180" />
|
||||
<path
|
||||
d="m 132.08321,457.37686 0.89844,0 0,5.46875 -0.89844,0 0,-5.46875 m 0,-2.1289 0.89844,0 0,1.13769 -0.89844,0 0,-1.13769"
|
||||
style="font-size:10px"
|
||||
id="path3182" />
|
||||
<path
|
||||
d="m 135.74532,455.82413 0,1.55273 1.85059,0 0,0.69824 -1.85059,0 0,2.96875 c 0,0.44597 0.0602,0.73243 0.18067,0.85938 0.12369,0.12695 0.37272,0.19043 0.74707,0.19043 l 0.92285,0 0,0.75195 -0.92285,0 c -0.69336,0 -1.17188,-0.12858 -1.43555,-0.38574 -0.26367,-0.26042 -0.39551,-0.73242 -0.39551,-1.41602 l 0,-2.96875 -0.65918,0 0,-0.69824 0.65918,0 0,-1.55273 0.90332,0"
|
||||
style="font-size:10px"
|
||||
id="path3184" />
|
||||
<path
|
||||
d="m 138.78243,457.37686 0.89844,0 0,5.46875 -0.89844,0 0,-5.46875 m 0,-2.1289 0.89844,0 0,1.13769 -0.89844,0 0,-1.13769"
|
||||
style="font-size:10px"
|
||||
id="path3186" />
|
||||
<path
|
||||
d="m 143.67501,458.00674 c -0.48177,1e-5 -0.86263,0.18881 -1.14258,0.56641 -0.27995,0.37435 -0.41992,0.88868 -0.41992,1.54297 0,0.6543 0.13835,1.17025 0.41504,1.54785 0.27995,0.37435 0.66243,0.56153 1.14746,0.56152 0.47851,1e-5 0.85774,-0.1888 1.1377,-0.5664 0.27994,-0.3776 0.41991,-0.89193 0.41992,-1.54297 -1e-5,-0.64778 -0.13998,-1.16048 -0.41992,-1.53809 -0.27996,-0.38085 -0.65919,-0.57128 -1.1377,-0.57129 m 0,-0.76171 c 0.78125,0 1.39485,0.25391 1.84082,0.76171 0.44596,0.50782 0.66894,1.21095 0.66895,2.10938 -1e-5,0.89518 -0.22299,1.59831 -0.66895,2.10937 -0.44597,0.50782 -1.05957,0.76172 -1.84082,0.76172 -0.78451,0 -1.39974,-0.2539 -1.8457,-0.76172 -0.44271,-0.51106 -0.66407,-1.21419 -0.66406,-2.10937 -10e-6,-0.89843 0.22135,-1.60156 0.66406,-2.10938 0.44596,-0.5078 1.06119,-0.76171 1.8457,-0.76171"
|
||||
style="font-size:10px"
|
||||
id="path3188" />
|
||||
<path
|
||||
d="m 152.21505,459.54483 0,3.30078 -0.89844,0 0,-3.27148 c 0,-0.51758 -0.10091,-0.90495 -0.30273,-1.16211 -0.20183,-0.25716 -0.50456,-0.38574 -0.90821,-0.38574 -0.48502,0 -0.86751,0.15462 -1.14746,0.46386 -0.27995,0.30925 -0.41992,0.7308 -0.41992,1.26465 l 0,3.09082 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.21484,-0.32877 0.46712,-0.57454 0.75684,-0.7373 0.29296,-0.16276 0.62988,-0.24414 1.01074,-0.24414 0.62825,0 1.10351,0.19531 1.42578,0.58593 0.32226,0.38738 0.48339,0.95867 0.4834,1.71387"
|
||||
style="font-size:10px"
|
||||
id="path3190" />
|
||||
</g>
|
||||
<g
|
||||
style="font-size:12px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
|
||||
id="text3817">
|
||||
<path
|
||||
d="m 49.798271,374.06503 0,0.96192 c -0.374354,-0.17903 -0.727544,-0.3125 -1.05957,-0.40039 -0.332035,-0.0879 -0.652673,-0.13183 -0.961914,-0.13184 -0.537112,1e-5 -0.952151,0.10417 -1.245117,0.3125 -0.289716,0.20834 -0.434572,0.50456 -0.434571,0.88867 -10e-7,0.32227 0.09603,0.56641 0.288086,0.73242 0.195311,0.16277 0.563149,0.2946 1.103516,0.39551 l 0.595703,0.12207 c 0.735673,0.13998 1.277664,0.38738 1.625977,0.74219 0.351556,0.35157 0.527338,0.82357 0.527343,1.41602 -5e-6,0.70638 -0.237635,1.24186 -0.71289,1.60644 -0.47201,0.36458 -1.165369,0.54688 -2.080078,0.54688 -0.345055,0 -0.712893,-0.0391 -1.103516,-0.11719 -0.387371,-0.0781 -0.789389,-0.19369 -1.206055,-0.34668 l 0,-1.01563 c 0.40039,0.22461 0.792642,0.39388 1.176758,0.50782 0.384112,0.11393 0.761716,0.1709 1.132813,0.17089 0.563147,10e-6 0.997717,-0.11067 1.30371,-0.33203 0.305985,-0.22135 0.45898,-0.5371 0.458985,-0.94726 -5e-6,-0.35807 -0.110682,-0.63802 -0.332031,-0.83985 -0.218104,-0.20182 -0.577804,-0.35318 -1.079102,-0.4541 l -0.600586,-0.11719 c -0.735679,-0.14648 -1.267905,-0.37597 -1.59668,-0.68847 -0.328776,-0.3125 -0.493164,-0.74707 -0.493164,-1.30371 0,-0.64453 0.226236,-1.15234 0.678711,-1.52344 0.455728,-0.37109 1.082355,-0.55663 1.879883,-0.55664 0.341793,10e-6 0.6901,0.0309 1.044922,0.0928 0.354813,0.0619 0.717768,0.15463 1.088867,0.27832"
|
||||
style="font-size:10px"
|
||||
id="path3193" />
|
||||
<path
|
||||
d="m 56.414482,378.15683 0,0.43945 -4.130859,0 c 0.03906,0.61849 0.224607,1.0905 0.55664,1.41602 0.335284,0.32226 0.800779,0.4834 1.396485,0.4834 0.345048,0 0.678707,-0.0423 1.000976,-0.12696 0.325516,-0.0846 0.647782,-0.21158 0.966797,-0.38086 l 0,0.84961 c -0.322271,0.13672 -0.652674,0.24089 -0.991211,0.3125 -0.338546,0.0716 -0.68197,0.10743 -1.030273,0.10743 -0.872399,0 -1.56413,-0.25391 -2.075196,-0.76172 -0.507813,-0.50781 -0.761719,-1.19466 -0.761718,-2.06055 -10e-7,-0.89518 0.240884,-1.60481 0.722656,-2.12891 0.485024,-0.52733 1.137693,-0.79101 1.958008,-0.79101 0.735673,0 1.316727,0.23763 1.743164,0.71289 0.429682,0.47201 0.644525,1.11491 0.644531,1.92871 m -0.898437,-0.26367 c -0.0065,-0.49153 -0.144862,-0.88379 -0.415039,-1.17676 -0.266932,-0.29296 -0.621749,-0.43945 -1.064454,-0.43945 -0.501304,0 -0.903322,0.1416 -1.206054,0.4248 -0.299481,0.28321 -0.472007,0.68197 -0.517578,1.19629 l 3.203125,-0.005"
|
||||
style="font-size:10px"
|
||||
id="path3195" />
|
||||
<path
|
||||
d="m 61.824638,375.85703 0,0.83984 c -0.253911,-0.13997 -0.509444,-0.24414 -0.766601,-0.3125 -0.25391,-0.0716 -0.511072,-0.10742 -0.771485,-0.10742 -0.582685,0 -1.035158,0.18555 -1.357421,0.55664 -0.322268,0.36784 -0.4834,0.88542 -0.483399,1.55273 -10e-7,0.66732 0.161131,1.18653 0.483399,1.55762 0.322263,0.36784 0.774736,0.55176 1.357421,0.55176 0.260413,0 0.517575,-0.0342 0.771485,-0.10254 0.257157,-0.0716 0.51269,-0.17741 0.766601,-0.31738 l 0,0.83007 c -0.250655,0.11719 -0.511072,0.20508 -0.78125,0.26368 -0.266931,0.0586 -0.551761,0.0879 -0.854492,0.0879 -0.82357,0 -1.477866,-0.25879 -1.96289,-0.77637 -0.485027,-0.51758 -0.72754,-1.21582 -0.72754,-2.09473 0,-0.89192 0.24414,-1.59342 0.732422,-2.10449 0.491535,-0.51106 1.163735,-0.7666 2.016602,-0.7666 0.276689,0 0.546871,0.0293 0.810547,0.0879 0.263667,0.0553 0.519201,0.13998 0.766601,0.25391"
|
||||
style="font-size:10px"
|
||||
id="path3197" />
|
||||
<path
|
||||
d="m 65.516045,376.27695 c -0.481774,0 -0.862633,0.1888 -1.142579,0.5664 -0.279949,0.37436 -0.419923,0.88868 -0.419921,1.54297 -2e-6,0.6543 0.138344,1.17025 0.415039,1.54785 0.279945,0.37435 0.662432,0.56153 1.147461,0.56153 0.478512,0 0.857743,-0.1888 1.137695,-0.56641 0.279943,-0.3776 0.419917,-0.89192 0.419922,-1.54297 -5e-6,-0.64778 -0.139979,-1.16048 -0.419922,-1.53808 -0.279952,-0.38086 -0.659183,-0.57129 -1.137695,-0.57129 m 0,-0.76172 c 0.781246,0 1.394852,0.25391 1.84082,0.76172 0.445958,0.50781 0.66894,1.21094 0.668945,2.10937 -5e-6,0.89519 -0.222987,1.59831 -0.668945,2.10938 -0.445968,0.50781 -1.059574,0.76172 -1.84082,0.76172 -0.784508,0 -1.399742,-0.25391 -1.845704,-0.76172 -0.442709,-0.51107 -0.664063,-1.21419 -0.664062,-2.10938 -10e-7,-0.89843 0.221353,-1.60156 0.664062,-2.10937 0.445962,-0.50781 1.061196,-0.76172 1.845704,-0.76172"
|
||||
style="font-size:10px"
|
||||
id="path3199" />
|
||||
<path
|
||||
d="m 74.056084,377.81503 0,3.30078 -0.898438,0 0,-3.27148 c -4e-6,-0.51757 -0.100916,-0.90494 -0.302734,-1.16211 -0.201827,-0.25716 -0.504561,-0.38574 -0.908203,-0.38574 -0.485029,0 -0.867516,0.15463 -1.147461,0.46387 -0.27995,0.30924 -0.419924,0.73079 -0.419922,1.26464 l 0,3.09082 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.214842,-0.32877 0.46712,-0.57454 0.756836,-0.7373 0.292966,-0.16276 0.629879,-0.24414 1.010742,-0.24414 0.628251,0 1.103511,0.19532 1.425781,0.58594 0.322261,0.38737 0.483393,0.95866 0.483399,1.71386"
|
||||
style="font-size:10px"
|
||||
id="path3201" />
|
||||
<path
|
||||
d="m 79.456474,376.47714 0,-2.95898 0.898438,0 0,7.59765 -0.898438,0 0,-0.82031 c -0.188806,0.32552 -0.428064,0.56804 -0.717773,0.72754 -0.286462,0.15625 -0.631514,0.23438 -1.035156,0.23438 -0.66081,0 -1.199546,-0.26368 -1.616211,-0.79102 -0.413413,-0.52734 -0.620118,-1.2207 -0.620118,-2.08008 0,-0.85937 0.206705,-1.55273 0.620118,-2.08008 0.416665,-0.52733 0.955401,-0.79101 1.616211,-0.79101 0.403642,0 0.748694,0.0798 1.035156,0.23926 0.289709,0.15625 0.528967,0.39714 0.717773,0.72265 m -3.061523,1.90918 c -2e-6,0.66081 0.135089,1.18002 0.405273,1.55762 0.273436,0.37435 0.647784,0.56152 1.123047,0.56152 0.475257,0 0.849606,-0.18717 1.123047,-0.56152 0.273433,-0.3776 0.410152,-0.89681 0.410156,-1.55762 -4e-6,-0.6608 -0.136723,-1.17838 -0.410156,-1.55273 -0.273441,-0.3776 -0.64779,-0.5664 -1.123047,-0.56641 -0.475263,1e-5 -0.849611,0.18881 -1.123047,0.56641 -0.270184,0.37435 -0.405275,0.89193 -0.405273,1.55273"
|
||||
style="font-size:10px"
|
||||
id="path3203" />
|
||||
<path
|
||||
d="m 84.690849,378.36679 c -0.725914,0 -1.228843,0.083 -1.508789,0.24902 -0.279949,0.16602 -0.419923,0.44923 -0.419922,0.84961 -10e-7,0.31902 0.104165,0.57292 0.3125,0.76172 0.211587,0.18555 0.498045,0.27832 0.859375,0.27832 0.498044,0 0.896807,-0.17578 1.196289,-0.52734 0.302731,-0.35482 0.454098,-0.82519 0.454102,-1.41113 l 0,-0.2002 -0.893555,0 m 1.791992,-0.37109 0,3.12011 -0.898437,0 0,-0.83007 c -0.205082,0.33203 -0.460616,0.5778 -0.766602,0.7373 -0.305992,0.15625 -0.680341,0.23438 -1.123046,0.23438 -0.559898,0 -1.005861,-0.15625 -1.337891,-0.46875 -0.328777,-0.31576 -0.493165,-0.73731 -0.493164,-1.26465 -1e-6,-0.61523 0.205077,-1.0791 0.615234,-1.3916 0.41341,-0.3125 1.028644,-0.46875 1.845703,-0.46875 l 1.259766,0 0,-0.0879 c -4e-6,-0.41341 -0.136723,-0.73242 -0.410156,-0.95704 -0.270186,-0.22786 -0.651045,-0.34179 -1.142578,-0.34179 -0.312503,0 -0.616865,0.0374 -0.913086,0.1123 -0.296226,0.0749 -0.581056,0.18718 -0.854493,0.33692 l 0,-0.83008 c 0.328775,-0.12695 0.647785,-0.22135 0.957032,-0.28321 0.309242,-0.0651 0.610349,-0.0977 0.90332,-0.0977 0.791012,0 1.381832,0.20508 1.772461,0.61523 0.39062,0.41016 0.585932,1.03191 0.585937,1.86524"
|
||||
style="font-size:10px"
|
||||
id="path3205" />
|
||||
<path
|
||||
d="m 91.507256,376.48691 c -0.100916,-0.0586 -0.211593,-0.10091 -0.332032,-0.12696 -0.117191,-0.0293 -0.247399,-0.0439 -0.390625,-0.0439 -0.507815,0 -0.89844,0.16602 -1.171875,0.49805 -0.270184,0.32878 -0.405275,0.80241 -0.405273,1.42089 l 0,2.88086 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.1888,-0.33202 0.434568,-0.57779 0.737305,-0.7373 0.302731,-0.16276 0.670569,-0.24414 1.103515,-0.24414 0.06185,0 0.130205,0.005 0.205078,0.0147 0.07487,0.007 0.157874,0.0179 0.249024,0.0342 l 0.0049,0.92285"
|
||||
style="font-size:10px"
|
||||
id="path3207" />
|
||||
<path
|
||||
d="m 94.734795,381.62363 c -0.25391,0.65104 -0.501305,1.07584 -0.742188,1.27441 -0.240888,0.19857 -0.563153,0.29785 -0.966797,0.29785 l -0.717773,0 0,-0.75195 0.527344,0 c 0.247394,0 0.439451,-0.0586 0.576171,-0.17578 0.136717,-0.11719 0.288084,-0.39388 0.454102,-0.83008 l 0.161133,-0.41016 -2.211914,-5.38086 0.952148,0 1.708985,4.27735 1.708984,-4.27735 0.952148,0 -2.402343,5.97657"
|
||||
style="font-size:10px"
|
||||
id="path3209" />
|
||||
<path
|
||||
d="m 105.81878,376.69687 c 0.2246,-0.40364 0.49316,-0.70149 0.80566,-0.89356 0.3125,-0.19205 0.68033,-0.28808 1.10352,-0.28808 0.56965,0 1.00911,0.2002 1.31836,0.60058 0.30923,0.39714 0.46386,0.96355 0.46387,1.69922 l 0,3.30078 -0.90333,0 0,-3.27148 c 0,-0.52408 -0.0928,-0.91308 -0.27832,-1.16699 -0.18555,-0.2539 -0.46875,-0.38086 -0.8496,-0.38086 -0.46551,0 -0.83334,0.15463 -1.10352,0.46387 -0.27019,0.30924 -0.40528,0.73079 -0.40527,1.26464 l 0,3.09082 -0.90332,0 0,-3.27148 c -10e-6,-0.52734 -0.0928,-0.91634 -0.27832,-1.16699 -0.18556,-0.2539 -0.47201,-0.38086 -0.85938,-0.38086 -0.45899,0 -0.82357,0.15625 -1.09375,0.46875 -0.27018,0.30925 -0.40527,0.72917 -0.40527,1.25976 l 0,3.09082 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.20507,-0.33528 0.45084,-0.58267 0.7373,-0.74218 0.28646,-0.1595 0.62663,-0.23926 1.02051,-0.23926 0.39713,0 0.73404,0.10092 1.01074,0.30273 0.27994,0.20183 0.48665,0.4948 0.62012,0.87891"
|
||||
style="font-size:10px"
|
||||
id="path3211" />
|
||||
<path
|
||||
d="m 113.4262,376.27695 c -0.48177,0 -0.86263,0.1888 -1.14258,0.5664 -0.27995,0.37436 -0.41992,0.88868 -0.41992,1.54297 0,0.6543 0.13835,1.17025 0.41504,1.54785 0.27995,0.37435 0.66243,0.56153 1.14746,0.56153 0.47851,0 0.85774,-0.1888 1.1377,-0.56641 0.27994,-0.3776 0.41991,-0.89192 0.41992,-1.54297 -10e-6,-0.64778 -0.13998,-1.16048 -0.41992,-1.53808 -0.27996,-0.38086 -0.65919,-0.57129 -1.1377,-0.57129 m 0,-0.76172 c 0.78125,0 1.39485,0.25391 1.84082,0.76172 0.44596,0.50781 0.66894,1.21094 0.66895,2.10937 -1e-5,0.89519 -0.22299,1.59831 -0.66895,2.10938 -0.44597,0.50781 -1.05957,0.76172 -1.84082,0.76172 -0.78451,0 -1.39974,-0.25391 -1.8457,-0.76172 -0.44271,-0.51107 -0.66407,-1.21419 -0.66406,-2.10938 -10e-6,-0.89843 0.22135,-1.60156 0.66406,-2.10937 0.44596,-0.50781 1.06119,-0.76172 1.8457,-0.76172"
|
||||
style="font-size:10px"
|
||||
id="path3213" />
|
||||
<path
|
||||
d="m 121.96624,377.81503 0,3.30078 -0.89844,0 0,-3.27148 c 0,-0.51757 -0.10091,-0.90494 -0.30273,-1.16211 -0.20183,-0.25716 -0.50456,-0.38574 -0.90821,-0.38574 -0.48502,0 -0.86751,0.15463 -1.14746,0.46387 -0.27995,0.30924 -0.41992,0.73079 -0.41992,1.26464 l 0,3.09082 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.21484,-0.32877 0.46712,-0.57454 0.75684,-0.7373 0.29296,-0.16276 0.62988,-0.24414 1.01074,-0.24414 0.62825,0 1.10351,0.19532 1.42578,0.58594 0.32226,0.38737 0.48339,0.95866 0.4834,1.71386"
|
||||
style="font-size:10px"
|
||||
id="path3215" />
|
||||
<path
|
||||
d="m 123.768,375.64706 0.89844,0 0,5.46875 -0.89844,0 0,-5.46875 m 0,-2.1289 0.89844,0 0,1.13769 -0.89844,0 0,-1.13769"
|
||||
style="font-size:10px"
|
||||
id="path3217" />
|
||||
<path
|
||||
d="m 127.43011,374.09433 0,1.55273 1.85058,0 0,0.69825 -1.85058,0 0,2.96875 c 0,0.44596 0.0602,0.73242 0.18066,0.85937 0.1237,0.12696 0.37272,0.19043 0.74707,0.19043 l 0.92285,0 0,0.75195 -0.92285,0 c -0.69336,0 -1.17188,-0.12858 -1.43555,-0.38574 -0.26367,-0.26041 -0.3955,-0.73242 -0.3955,-1.41601 l 0,-2.96875 -0.65918,0 0,-0.69825 0.65918,0 0,-1.55273 0.90332,0"
|
||||
style="font-size:10px"
|
||||
id="path3219" />
|
||||
<path
|
||||
d="m 132.58636,376.27695 c -0.48178,0 -0.86264,0.1888 -1.14258,0.5664 -0.27995,0.37436 -0.41992,0.88868 -0.41992,1.54297 0,0.6543 0.13834,1.17025 0.41504,1.54785 0.27994,0.37435 0.66243,0.56153 1.14746,0.56153 0.47851,0 0.85774,-0.1888 1.13769,-0.56641 0.27995,-0.3776 0.41992,-0.89192 0.41992,-1.54297 0,-0.64778 -0.13997,-1.16048 -0.41992,-1.53808 -0.27995,-0.38086 -0.65918,-0.57129 -1.13769,-0.57129 m 0,-0.76172 c 0.78124,0 1.39485,0.25391 1.84082,0.76172 0.44596,0.50781 0.66894,1.21094 0.66894,2.10937 0,0.89519 -0.22298,1.59831 -0.66894,2.10938 -0.44597,0.50781 -1.05958,0.76172 -1.84082,0.76172 -0.78451,0 -1.39974,-0.25391 -1.84571,-0.76172 -0.44271,-0.51107 -0.66406,-1.21419 -0.66406,-2.10938 0,-0.89843 0.22135,-1.60156 0.66406,-2.10937 0.44597,-0.50781 1.0612,-0.76172 1.84571,-0.76172"
|
||||
style="font-size:10px"
|
||||
id="path3221" />
|
||||
<path
|
||||
d="m 139.74944,376.48691 c -0.10091,-0.0586 -0.21159,-0.10091 -0.33203,-0.12696 -0.11719,-0.0293 -0.2474,-0.0439 -0.39062,-0.0439 -0.50782,0 -0.89844,0.16602 -1.17188,0.49805 -0.27018,0.32878 -0.40527,0.80241 -0.40527,1.42089 l 0,2.88086 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.1888,-0.33202 0.43457,-0.57779 0.7373,-0.7373 0.30273,-0.16276 0.67057,-0.24414 1.10352,-0.24414 0.0618,0 0.1302,0.005 0.20508,0.0147 0.0749,0.007 0.15787,0.0179 0.24902,0.0342 l 0.005,0.92285"
|
||||
style="font-size:10px"
|
||||
id="path3223" />
|
||||
<path
|
||||
d="m 144.75433,380.2955 0,2.90039 -0.90332,0 0,-7.54883 0.90332,0 0,0.83008 c 0.1888,-0.32551 0.42643,-0.5664 0.71289,-0.72265 0.28971,-0.1595 0.63476,-0.23926 1.03515,-0.23926 0.66406,0 1.2028,0.26368 1.61621,0.79101 0.41666,0.52735 0.625,1.22071 0.625,2.08008 0,0.85938 -0.20834,1.55274 -0.625,2.08008 -0.41341,0.52734 -0.95215,0.79102 -1.61621,0.79102 -0.40039,0 -0.74544,-0.0781 -1.03515,-0.23438 -0.28646,-0.1595 -0.52409,-0.40202 -0.71289,-0.72754 m 3.05664,-1.90918 c -1e-5,-0.6608 -0.13673,-1.17838 -0.41016,-1.55273 -0.27019,-0.3776 -0.64291,-0.5664 -1.11816,-0.56641 -0.47527,1e-5 -0.84962,0.18881 -1.12305,0.56641 -0.27018,0.37435 -0.40528,0.89193 -0.40527,1.55273 -1e-5,0.66081 0.13509,1.18002 0.40527,1.55762 0.27343,0.37435 0.64778,0.56152 1.12305,0.56152 0.47525,0 0.84797,-0.18717 1.11816,-0.56152 0.27343,-0.3776 0.41015,-0.89681 0.41016,-1.55762"
|
||||
style="font-size:10px"
|
||||
id="path3225" />
|
||||
<path
|
||||
d="m 152.35198,376.27695 c -0.48177,0 -0.86263,0.1888 -1.14258,0.5664 -0.27995,0.37436 -0.41992,0.88868 -0.41992,1.54297 0,0.6543 0.13835,1.17025 0.41504,1.54785 0.27995,0.37435 0.66243,0.56153 1.14746,0.56153 0.47851,0 0.85775,-0.1888 1.1377,-0.56641 0.27994,-0.3776 0.41991,-0.89192 0.41992,-1.54297 -1e-5,-0.64778 -0.13998,-1.16048 -0.41992,-1.53808 -0.27995,-0.38086 -0.65919,-0.57129 -1.1377,-0.57129 m 0,-0.76172 c 0.78125,0 1.39485,0.25391 1.84082,0.76172 0.44596,0.50781 0.66894,1.21094 0.66895,2.10937 -1e-5,0.89519 -0.22299,1.59831 -0.66895,2.10938 -0.44597,0.50781 -1.05957,0.76172 -1.84082,0.76172 -0.78451,0 -1.39974,-0.25391 -1.8457,-0.76172 -0.44271,-0.51107 -0.66406,-1.21419 -0.66406,-2.10938 0,-0.89843 0.22135,-1.60156 0.66406,-2.10937 0.44596,-0.50781 1.06119,-0.76172 1.8457,-0.76172"
|
||||
style="font-size:10px"
|
||||
id="path3227" />
|
||||
<path
|
||||
d="m 159.83245,375.8082 0,0.84961 c -0.25391,-0.13021 -0.51758,-0.22786 -0.79101,-0.29297 -0.27345,-0.0651 -0.55665,-0.0976 -0.84961,-0.0977 -0.44597,1e-5 -0.78126,0.0684 -1.00586,0.20508 -0.22136,0.13672 -0.33204,0.3418 -0.33203,0.61523 -1e-5,0.20834 0.0798,0.37273 0.23925,0.49317 0.15951,0.11719 0.48014,0.22949 0.96192,0.33691 l 0.30761,0.0684 c 0.63802,0.13672 1.0905,0.33041 1.35743,0.58106 0.27017,0.24739 0.40526,0.59407 0.40527,1.04004 -1e-5,0.50781 -0.20183,0.90983 -0.60547,1.20605 -0.40039,0.29622 -0.95215,0.44434 -1.65527,0.44434 -0.29297,0 -0.59896,-0.0293 -0.91797,-0.0879 -0.31576,-0.0553 -0.64942,-0.13998 -1.00098,-0.25391 l 0,-0.92774 c 0.33203,0.17253 0.65918,0.30274 0.98145,0.39063 0.32226,0.0846 0.64127,0.12695 0.95703,0.12695 0.42317,0 0.74869,-0.0716 0.97656,-0.21484 0.22786,-0.14648 0.34179,-0.35156 0.3418,-0.61524 -1e-5,-0.24413 -0.083,-0.43131 -0.24903,-0.56152 -0.16276,-0.13021 -0.52246,-0.25553 -1.0791,-0.37598 l -0.3125,-0.0732 c -0.55664,-0.11718 -0.95866,-0.29622 -1.20605,-0.53711 -0.2474,-0.24413 -0.3711,-0.57779 -0.3711,-1.00097 0,-0.51432 0.1823,-0.91146 0.54688,-1.19141 0.36458,-0.27994 0.88216,-0.41992 1.55273,-0.41992 0.33203,0 0.64453,0.0244 0.9375,0.0732 0.29297,0.0488 0.56315,0.12208 0.81055,0.21973"
|
||||
style="font-size:10px"
|
||||
id="path3229" />
|
||||
<path
|
||||
d="m 161.56097,375.64706 0.89843,0 0,5.46875 -0.89843,0 0,-5.46875 m 0,-2.1289 0.89843,0 0,1.13769 -0.89843,0 0,-1.13769"
|
||||
style="font-size:10px"
|
||||
id="path3231" />
|
||||
<path
|
||||
d="m 165.22308,374.09433 0,1.55273 1.85058,0 0,0.69825 -1.85058,0 0,2.96875 c -1e-5,0.44596 0.0602,0.73242 0.18066,0.85937 0.1237,0.12696 0.37272,0.19043 0.74707,0.19043 l 0.92285,0 0,0.75195 -0.92285,0 c -0.69336,0 -1.17188,-0.12858 -1.43555,-0.38574 -0.26367,-0.26041 -0.39551,-0.73242 -0.3955,-1.41601 l 0,-2.96875 -0.65918,0 0,-0.69825 0.65918,0 0,-1.55273 0.90332,0"
|
||||
style="font-size:10px"
|
||||
id="path3233" />
|
||||
<path
|
||||
d="m 168.26019,375.64706 0.89843,0 0,5.46875 -0.89843,0 0,-5.46875 m 0,-2.1289 0.89843,0 0,1.13769 -0.89843,0 0,-1.13769"
|
||||
style="font-size:10px"
|
||||
id="path3235" />
|
||||
<path
|
||||
d="m 173.15276,376.27695 c -0.48177,0 -0.86263,0.1888 -1.14257,0.5664 -0.27995,0.37436 -0.41993,0.88868 -0.41993,1.54297 0,0.6543 0.13835,1.17025 0.41504,1.54785 0.27995,0.37435 0.66243,0.56153 1.14746,0.56153 0.47852,0 0.85775,-0.1888 1.1377,-0.56641 0.27994,-0.3776 0.41992,-0.89192 0.41992,-1.54297 0,-0.64778 -0.13998,-1.16048 -0.41992,-1.53808 -0.27995,-0.38086 -0.65918,-0.57129 -1.1377,-0.57129 m 0,-0.76172 c 0.78125,0 1.39486,0.25391 1.84082,0.76172 0.44596,0.50781 0.66894,1.21094 0.66895,2.10937 -1e-5,0.89519 -0.22299,1.59831 -0.66895,2.10938 -0.44596,0.50781 -1.05957,0.76172 -1.84082,0.76172 -0.7845,0 -1.39974,-0.25391 -1.8457,-0.76172 -0.44271,-0.51107 -0.66406,-1.21419 -0.66406,-2.10938 0,-0.89843 0.22135,-1.60156 0.66406,-2.10937 0.44596,-0.50781 1.0612,-0.76172 1.8457,-0.76172"
|
||||
style="font-size:10px"
|
||||
id="path3237" />
|
||||
<path
|
||||
d="m 181.6928,377.81503 0,3.30078 -0.89844,0 0,-3.27148 c 0,-0.51757 -0.10091,-0.90494 -0.30273,-1.16211 -0.20183,-0.25716 -0.50456,-0.38574 -0.9082,-0.38574 -0.48503,0 -0.86752,0.15463 -1.14746,0.46387 -0.27995,0.30924 -0.41993,0.73079 -0.41993,1.26464 l 0,3.09082 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.21485,-0.32877 0.46712,-0.57454 0.75684,-0.7373 0.29297,-0.16276 0.62988,-0.24414 1.01074,-0.24414 0.62825,0 1.10351,0.19532 1.42578,0.58594 0.32226,0.38737 0.4834,0.95866 0.4834,1.71386"
|
||||
style="font-size:10px"
|
||||
id="path3239" />
|
||||
</g>
|
||||
<g
|
||||
style="font-size:12px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
|
||||
id="text3017">
|
||||
<path
|
||||
d="m 367.17007,356.71783 -2.7832,-7.29003 1.03027,0 2.30958,6.13769 2.31445,-6.13769 1.02539,0 -2.77832,7.29003 -1.11817,0"
|
||||
style="font-size:10px"
|
||||
id="path3242" />
|
||||
<path
|
||||
d="m 371.87222,351.24908 0.89844,0 0,5.46875 -0.89844,0 0,-5.46875 m 0,-2.1289 0.89844,0 0,1.13769 -0.89844,0 0,-1.13769"
|
||||
style="font-size:10px"
|
||||
id="path3244" />
|
||||
<path
|
||||
d="m 377.81461,352.08893 c -0.10092,-0.0586 -0.2116,-0.10091 -0.33204,-0.12695 -0.11719,-0.0293 -0.24739,-0.0439 -0.39062,-0.0439 -0.50782,0 -0.89844,0.16602 -1.17188,0.49805 -0.27018,0.32878 -0.40527,0.80241 -0.40527,1.4209 l 0,2.88085 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.1888,-0.33202 0.43457,-0.57779 0.73731,-0.7373 0.30273,-0.16276 0.67057,-0.24414 1.10351,-0.24414 0.0618,0 0.13021,0.005 0.20508,0.0146 0.0749,0.007 0.15787,0.0179 0.24902,0.0342 l 0.005,0.92285"
|
||||
style="font-size:10px"
|
||||
id="path3246" />
|
||||
<path
|
||||
d="m 379.65543,349.69635 0,1.55273 1.85058,0 0,0.69825 -1.85058,0 0,2.96875 c -1e-5,0.44596 0.0602,0.73242 0.18066,0.85937 0.1237,0.12696 0.37272,0.19043 0.74707,0.19043 l 0.92285,0 0,0.75195 -0.92285,0 c -0.69336,0 -1.17188,-0.12858 -1.43555,-0.38574 -0.26367,-0.26041 -0.39551,-0.73242 -0.3955,-1.41601 l 0,-2.96875 -0.65918,0 0,-0.69825 0.65918,0 0,-1.55273 0.90332,0"
|
||||
style="font-size:10px"
|
||||
id="path3248" />
|
||||
<path
|
||||
d="m 382.59976,354.55963 0,-3.31055 0.89844,0 0,3.27637 c 0,0.51758 0.10091,0.90658 0.30273,1.16699 0.20182,0.25717 0.50456,0.38575 0.90821,0.38575 0.48502,0 0.86751,-0.15463 1.14746,-0.46387 0.2832,-0.30924 0.4248,-0.73079 0.4248,-1.26465 l 0,-3.10059 0.89844,0 0,5.46875 -0.89844,0 0,-0.83984 c -0.2181,0.33203 -0.47201,0.57943 -0.76172,0.74219 -0.28646,0.1595 -0.62012,0.23926 -1.00097,0.23926 -0.62826,0 -1.10515,-0.19532 -1.43067,-0.58594 -0.32552,-0.39063 -0.48828,-0.96191 -0.48828,-1.71387 m 2.26074,-3.44238 0,0"
|
||||
style="font-size:10px"
|
||||
id="path3250" />
|
||||
<path
|
||||
d="m 391.52554,353.96881 c -0.72591,0 -1.22884,0.083 -1.50879,0.24902 -0.27995,0.16602 -0.41992,0.44923 -0.41992,0.84961 0,0.31902 0.10417,0.57292 0.3125,0.76172 0.21159,0.18555 0.49805,0.27832 0.85938,0.27832 0.49804,0 0.8968,-0.17578 1.19629,-0.52734 0.30273,-0.35482 0.45409,-0.82519 0.4541,-1.41113 l 0,-0.2002 -0.89356,0 m 1.792,-0.37109 0,3.12011 -0.89844,0 0,-0.83007 c -0.20508,0.33203 -0.46062,0.5778 -0.7666,0.7373 -0.306,0.15625 -0.68035,0.23438 -1.12305,0.23438 -0.5599,0 -1.00586,-0.15625 -1.33789,-0.46875 -0.32878,-0.31576 -0.49317,-0.73731 -0.49317,-1.26465 0,-0.61523 0.20508,-1.0791 0.61524,-1.3916 0.41341,-0.3125 1.02864,-0.46875 1.8457,-0.46875 l 1.25977,0 0,-0.0879 c -1e-5,-0.41341 -0.13673,-0.73242 -0.41016,-0.95704 -0.27018,-0.22786 -0.65104,-0.34179 -1.14258,-0.34179 -0.3125,0 -0.61686,0.0374 -0.91308,0.1123 -0.29623,0.0749 -0.58106,0.18718 -0.85449,0.33692 l 0,-0.83008 c 0.32877,-0.12695 0.64778,-0.22135 0.95703,-0.28321 0.30924,-0.0651 0.61035,-0.0976 0.90332,-0.0976 0.79101,0 1.38183,0.20508 1.77246,0.61523 0.39062,0.41016 0.58593,1.03191 0.58594,1.86524"
|
||||
style="font-size:10px"
|
||||
id="path3252" />
|
||||
<path
|
||||
d="m 395.173,349.12018 0.89844,0 0,7.59765 -0.89844,0 0,-7.59765"
|
||||
style="font-size:10px"
|
||||
id="path3254" />
|
||||
<path
|
||||
d="m 404.61636,351.41022 0,0.84961 c -0.25391,-0.13021 -0.51758,-0.22786 -0.79101,-0.29297 -0.27344,-0.0651 -0.55665,-0.0976 -0.84961,-0.0977 -0.44597,1e-5 -0.78125,0.0684 -1.00586,0.20508 -0.22136,0.13672 -0.33203,0.3418 -0.33203,0.61523 0,0.20834 0.0797,0.37273 0.23926,0.49317 0.1595,0.11719 0.48014,0.22949 0.96191,0.33691 l 0.30762,0.0684 c 0.63801,0.13672 1.09049,0.33041 1.35742,0.58106 0.27018,0.24739 0.40527,0.59407 0.40527,1.04004 0,0.50781 -0.20183,0.90983 -0.60547,1.20605 -0.40039,0.29622 -0.95215,0.44434 -1.65527,0.44434 -0.29297,0 -0.59896,-0.0293 -0.91797,-0.0879 -0.31576,-0.0553 -0.64941,-0.13998 -1.00098,-0.25391 l 0,-0.92774 c 0.33204,0.17253 0.65918,0.30274 0.98145,0.39063 0.32226,0.0846 0.64127,0.12695 0.95703,0.12695 0.42318,0 0.7487,-0.0716 0.97656,-0.21484 0.22786,-0.14648 0.3418,-0.35156 0.3418,-0.61524 0,-0.24413 -0.083,-0.43131 -0.24902,-0.56152 -0.16277,-0.1302 -0.52247,-0.25553 -1.0791,-0.37598 l -0.3125,-0.0732 c -0.55665,-0.11718 -0.95866,-0.29622 -1.20606,-0.53711 -0.2474,-0.24413 -0.37109,-0.57779 -0.37109,-1.00097 0,-0.51432 0.18229,-0.91146 0.54687,-1.19141 0.36458,-0.27994 0.88216,-0.41992 1.55274,-0.41992 0.33202,0 0.64452,0.0244 0.9375,0.0732 0.29296,0.0488 0.56314,0.12208 0.81054,0.21973"
|
||||
style="font-size:10px"
|
||||
id="path3256" />
|
||||
<path
|
||||
d="m 410.28043,351.45905 0,0.83984 c -0.25391,-0.13997 -0.50945,-0.24414 -0.76661,-0.3125 -0.25391,-0.0716 -0.51107,-0.10742 -0.77148,-0.10742 -0.58268,0 -1.03516,0.18555 -1.35742,0.55664 -0.32227,0.36784 -0.4834,0.88542 -0.4834,1.55273 0,0.66732 0.16113,1.18653 0.4834,1.55762 0.32226,0.36784 0.77474,0.55176 1.35742,0.55176 0.26041,0 0.51757,-0.0342 0.77148,-0.10254 0.25716,-0.0716 0.5127,-0.17741 0.76661,-0.31738 l 0,0.83007 c -0.25066,0.11719 -0.51108,0.20508 -0.78125,0.26368 -0.26693,0.0586 -0.55177,0.0879 -0.8545,0.0879 -0.82357,0 -1.47786,-0.25879 -1.96289,-0.77637 -0.48502,-0.51758 -0.72754,-1.21582 -0.72754,-2.09473 0,-0.89192 0.24414,-1.59342 0.73243,-2.10449 0.49153,-0.51106 1.16373,-0.7666 2.0166,-0.7666 0.27669,0 0.54687,0.0293 0.81054,0.0879 0.26367,0.0553 0.51921,0.13998 0.76661,0.25391"
|
||||
style="font-size:10px"
|
||||
id="path3258" />
|
||||
<path
|
||||
d="m 415.02164,352.08893 c -0.10092,-0.0586 -0.2116,-0.10091 -0.33203,-0.12695 -0.1172,-0.0293 -0.2474,-0.0439 -0.39063,-0.0439 -0.50781,0 -0.89844,0.16602 -1.17187,0.49805 -0.27019,0.32878 -0.40528,0.80241 -0.40528,1.4209 l 0,2.88085 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.1888,-0.33202 0.43457,-0.57779 0.73731,-0.7373 0.30273,-0.16276 0.67057,-0.24414 1.10351,-0.24414 0.0618,0 0.13021,0.005 0.20508,0.0146 0.0749,0.007 0.15787,0.0179 0.24902,0.0342 l 0.005,0.92285"
|
||||
style="font-size:10px"
|
||||
id="path3260" />
|
||||
<path
|
||||
d="m 420.43668,353.75885 0,0.43945 -4.13086,0 c 0.0391,0.61849 0.2246,1.0905 0.55664,1.41602 0.33528,0.32227 0.80078,0.4834 1.39648,0.4834 0.34505,0 0.67871,-0.0423 1.00098,-0.12696 0.32551,-0.0846 0.64778,-0.21158 0.9668,-0.38086 l 0,0.84961 c -0.32228,0.13672 -0.65268,0.24089 -0.99122,0.3125 -0.33854,0.0716 -0.68197,0.10743 -1.03027,0.10743 -0.8724,0 -1.56413,-0.25391 -2.07519,-0.76172 -0.50782,-0.50781 -0.76172,-1.19466 -0.76172,-2.06055 0,-0.89518 0.24088,-1.60481 0.72265,-2.12891 0.48503,-0.52733 1.1377,-0.79101 1.95801,-0.79101 0.73567,0 1.31673,0.23763 1.74316,0.71289 0.42969,0.47201 0.64453,1.11491 0.64454,1.92871 m -0.89844,-0.26367 c -0.007,-0.49153 -0.14486,-0.88379 -0.41504,-1.17676 -0.26693,-0.29296 -0.62175,-0.43945 -1.06445,-0.43945 -0.50131,0 -0.90333,0.1416 -1.20606,0.4248 -0.29948,0.28321 -0.47201,0.68197 -0.51758,1.19629 l 3.20313,-0.005"
|
||||
style="font-size:10px"
|
||||
id="path3262" />
|
||||
<path
|
||||
d="m 426.58902,353.75885 0,0.43945 -4.13086,0 c 0.0391,0.61849 0.22461,1.0905 0.55664,1.41602 0.33529,0.32227 0.80078,0.4834 1.39649,0.4834 0.34504,0 0.6787,-0.0423 1.00097,-0.12696 0.32552,-0.0846 0.64778,-0.21158 0.9668,-0.38086 l 0,0.84961 c -0.32227,0.13672 -0.65268,0.24089 -0.99121,0.3125 -0.33855,0.0716 -0.68197,0.10743 -1.03028,0.10743 -0.87239,0 -1.56412,-0.25391 -2.07519,-0.76172 -0.50781,-0.50781 -0.76172,-1.19466 -0.76172,-2.06055 0,-0.89518 0.24089,-1.60481 0.72266,-2.12891 0.48502,-0.52733 1.13769,-0.79101 1.958,-0.79101 0.73568,0 1.31673,0.23763 1.74317,0.71289 0.42968,0.47201 0.64452,1.11491 0.64453,1.92871 m -0.89844,-0.26367 c -0.007,-0.49153 -0.14486,-0.88379 -0.41504,-1.17676 -0.26693,-0.29296 -0.62175,-0.43945 -1.06445,-0.43945 -0.5013,0 -0.90332,0.1416 -1.20605,0.4248 -0.29949,0.28321 -0.47201,0.68197 -0.51758,1.19629 l 3.20312,-0.005"
|
||||
style="font-size:10px"
|
||||
id="path3264" />
|
||||
<path
|
||||
d="m 432.60953,353.41705 0,3.30078 -0.89844,0 0,-3.27148 c 0,-0.51757 -0.10092,-0.90494 -0.30273,-1.16211 -0.20183,-0.25716 -0.50457,-0.38574 -0.90821,-0.38574 -0.48503,0 -0.86751,0.15463 -1.14746,0.46387 -0.27995,0.30924 -0.41992,0.73079 -0.41992,1.26464 l 0,3.09082 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.21484,-0.32877 0.46712,-0.57454 0.75684,-0.7373 0.29296,-0.16276 0.62988,-0.24414 1.01074,-0.24414 0.62825,0 1.10351,0.19532 1.42578,0.58594 0.32226,0.38737 0.48339,0.95866 0.4834,1.71386"
|
||||
style="font-size:10px"
|
||||
id="path3266" />
|
||||
<path
|
||||
d="m 439.71402,351.87897 c -0.48177,0 -0.86263,0.1888 -1.14258,0.5664 -0.27995,0.37436 -0.41992,0.88868 -0.41992,1.54297 0,0.6543 0.13834,1.17025 0.41504,1.54785 0.27994,0.37435 0.66243,0.56153 1.14746,0.56153 0.47851,0 0.85774,-0.1888 1.1377,-0.56641 0.27994,-0.3776 0.41991,-0.89192 0.41992,-1.54297 -10e-6,-0.64778 -0.13998,-1.16048 -0.41992,-1.53808 -0.27996,-0.38086 -0.65919,-0.57129 -1.1377,-0.57129 m 0,-0.76172 c 0.78125,0 1.39485,0.25391 1.84082,0.76172 0.44596,0.50781 0.66894,1.21094 0.66895,2.10937 -1e-5,0.89519 -0.22299,1.59831 -0.66895,2.10938 -0.44597,0.50781 -1.05957,0.76172 -1.84082,0.76172 -0.78451,0 -1.39974,-0.25391 -1.8457,-0.76172 -0.44271,-0.51107 -0.66407,-1.21419 -0.66407,-2.10938 0,-0.89843 0.22136,-1.60156 0.66407,-2.10937 0.44596,-0.50781 1.06119,-0.76172 1.8457,-0.76172"
|
||||
style="font-size:10px"
|
||||
id="path3268" />
|
||||
<path
|
||||
d="m 446.87711,352.08893 c -0.10092,-0.0586 -0.2116,-0.10091 -0.33204,-0.12695 -0.11719,-0.0293 -0.24739,-0.0439 -0.39062,-0.0439 -0.50782,0 -0.89844,0.16602 -1.17188,0.49805 -0.27018,0.32878 -0.40527,0.80241 -0.40527,1.4209 l 0,2.88085 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.1888,-0.33202 0.43457,-0.57779 0.73731,-0.7373 0.30273,-0.16276 0.67057,-0.24414 1.10351,-0.24414 0.0618,0 0.13021,0.005 0.20508,0.0146 0.0749,0.007 0.15787,0.0179 0.24902,0.0342 l 0.005,0.92285"
|
||||
style="font-size:10px"
|
||||
id="path3270" />
|
||||
<path
|
||||
d="m 447.82925,351.24908 0.89844,0 0,5.46875 -0.89844,0 0,-5.46875 m 0,-2.1289 0.89844,0 0,1.13769 -0.89844,0 0,-1.13769"
|
||||
style="font-size:10px"
|
||||
id="path3272" />
|
||||
<path
|
||||
d="m 454.20132,353.91998 c 0,-0.65104 -0.13509,-1.15559 -0.40527,-1.51367 -0.26693,-0.35807 -0.64291,-0.5371 -1.12793,-0.53711 -0.48177,1e-5 -0.85775,0.17904 -1.12793,0.53711 -0.26693,0.35808 -0.40039,0.86263 -0.40039,1.51367 0,0.64779 0.13346,1.15072 0.40039,1.50879 0.27018,0.35808 0.64616,0.53711 1.12793,0.53711 0.48502,0 0.861,-0.17903 1.12793,-0.53711 0.27018,-0.35807 0.40527,-0.861 0.40527,-1.50879 m 0.89844,2.11914 c 0,0.93099 -0.20671,1.62272 -0.62012,2.0752 -0.41341,0.45573 -1.04655,0.68359 -1.89941,0.68359 -0.31576,0 -0.61361,-0.0244 -0.89355,-0.0732 -0.27995,-0.0456 -0.55176,-0.11719 -0.81543,-0.21484 l 0,-0.87403 c 0.26367,0.14323 0.52408,0.24903 0.78125,0.31739 0.25716,0.0684 0.5192,0.10253 0.78613,0.10254 0.58919,-10e-6 1.03027,-0.15463 1.32324,-0.46387 0.29297,-0.30599 0.43945,-0.76986 0.43945,-1.3916 l 0,-0.44434 c -0.18555,0.32227 -0.42318,0.56315 -0.71289,0.72266 -0.28971,0.1595 -0.63639,0.23925 -1.04004,0.23925 -0.67057,0 -1.21093,-0.25553 -1.62109,-0.7666 -0.41016,-0.51106 -0.61523,-1.18815 -0.61523,-2.03125 0,-0.84635 0.20507,-1.52506 0.61523,-2.03613 0.41016,-0.51106 0.95052,-0.7666 1.62109,-0.7666 0.40365,0 0.75033,0.0798 1.04004,0.23926 0.28971,0.15951 0.52734,0.40039 0.71289,0.72265 l 0,-0.83008 0.89844,0 0,4.79004"
|
||||
style="font-size:10px"
|
||||
id="path3274" />
|
||||
<path
|
||||
d="m 456.95035,351.24908 0.89844,0 0,5.46875 -0.89844,0 0,-5.46875 m 0,-2.1289 0.89844,0 0,1.13769 -0.89844,0 0,-1.13769"
|
||||
style="font-size:10px"
|
||||
id="path3276" />
|
||||
<path
|
||||
d="m 464.26968,353.41705 0,3.30078 -0.89843,0 0,-3.27148 c -10e-6,-0.51757 -0.10092,-0.90494 -0.30274,-1.16211 -0.20183,-0.25716 -0.50456,-0.38574 -0.9082,-0.38574 -0.48503,0 -0.86752,0.15463 -1.14746,0.46387 -0.27995,0.30924 -0.41993,0.73079 -0.41992,1.26464 l 0,3.09082 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.21484,-0.32877 0.46712,-0.57454 0.75683,-0.7373 0.29297,-0.16276 0.62988,-0.24414 1.01074,-0.24414 0.62826,0 1.10352,0.19532 1.42579,0.58594 0.32226,0.38737 0.48339,0.95866 0.48339,1.71386"
|
||||
style="font-size:10px"
|
||||
id="path3278" />
|
||||
</g>
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow2Lend)"
|
||||
d="m 343.73692,26.224389 0.01,294.941191"
|
||||
id="path3861"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cc"
|
||||
transform="translate(12.627039,339.86462)" />
|
||||
<path
|
||||
sodipodi:nodetypes="cc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path4307"
|
||||
d="m 356.48533,366.00457 336.31202,-0.0196"
|
||||
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow2Lend);stroke-miterlimit:4;stroke-dasharray:none" />
|
||||
<path
|
||||
sodipodi:nodetypes="cc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path4309"
|
||||
d="m 159.89916,447.6257 -0.0625,145.00422"
|
||||
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow2Lend)" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow2Lend)"
|
||||
d="m 160.03997,448.23877 184.95568,-0.0159"
|
||||
id="path4493"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cc" />
|
||||
<g
|
||||
style="font-size:12px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
|
||||
id="text4495">
|
||||
<path
|
||||
d="m 228.57881,442.02737 0.49805,0 0.7666,3.08106 0.76416,-3.08106 0.5542,0 0.7666,3.08106 0.76416,-3.08106 0.50049,0 -0.91553,3.64502 -0.62012,0 -0.76904,-3.16406 -0.77637,3.16406 -0.62011,0 -0.91309,-3.64502"
|
||||
style="font-size:5px"
|
||||
id="path3141" />
|
||||
<path
|
||||
d="m 233.71797,442.93802 0.44922,0 0,2.73437 -0.44922,0 0,-2.73437 m 0,-1.06445 0.44922,0 0,0.56884 -0.44922,0 0,-0.56884"
|
||||
style="font-size:5px"
|
||||
id="path3143" />
|
||||
<path
|
||||
d="m 237.37764,444.022 0,1.65039 -0.44922,0 0,-1.63574 c 0,-0.25879 -0.0505,-0.45247 -0.15137,-0.58105 -0.10091,-0.12858 -0.25228,-0.19287 -0.4541,-0.19287 -0.24251,0 -0.43376,0.0773 -0.57373,0.23193 -0.13997,0.15462 -0.20996,0.3654 -0.20996,0.63232 l 0,1.54541 -0.45166,0 0,-2.73437 0.45166,0 0,0.4248 c 0.10742,-0.16438 0.23356,-0.28727 0.37842,-0.36865 0.14648,-0.0814 0.31494,-0.12207 0.50537,-0.12207 0.31413,0 0.55176,0.0977 0.71289,0.29297 0.16113,0.19369 0.2417,0.47933 0.2417,0.85693"
|
||||
style="font-size:5px"
|
||||
id="path3145" />
|
||||
<path
|
||||
d="m 240.07784,443.35306 0,-1.47949 0.44921,0 0,3.79882 -0.44921,0 0,-0.41015 c -0.0944,0.16276 -0.21404,0.28401 -0.35889,0.36377 -0.14323,0.0781 -0.31576,0.11718 -0.51758,0.11718 -0.3304,0 -0.59977,-0.13183 -0.80811,-0.3955 -0.2067,-0.26367 -0.31005,-0.61035 -0.31005,-1.04004 0,-0.42969 0.10335,-0.77637 0.31005,-1.04004 0.20834,-0.26367 0.47771,-0.39551 0.80811,-0.39551 0.20182,0 0.37435,0.0399 0.51758,0.11963 0.14485,0.0781 0.26448,0.19857 0.35889,0.36133 m -1.53077,0.95459 c 0,0.3304 0.0676,0.59 0.20264,0.77881 0.13672,0.18717 0.32389,0.28076 0.56152,0.28076 0.23763,0 0.42481,-0.0936 0.56153,-0.28076 0.13671,-0.18881 0.20507,-0.44841 0.20508,-0.77881 -1e-5,-0.3304 -0.0684,-0.58919 -0.20508,-0.77637 -0.13672,-0.1888 -0.3239,-0.2832 -0.56153,-0.2832 -0.23763,0 -0.4248,0.0944 -0.56152,0.2832 -0.13509,0.18718 -0.20264,0.44597 -0.20264,0.77637"
|
||||
style="font-size:5px"
|
||||
id="path3147" />
|
||||
<path
|
||||
d="m 242.51192,443.25296 c -0.24089,0 -0.43132,0.0944 -0.57129,0.2832 -0.13998,0.18718 -0.20996,0.44434 -0.20996,0.77149 0,0.32715 0.0692,0.58512 0.20752,0.77392 0.13997,0.18718 0.33121,0.28077 0.57373,0.28077 0.23925,0 0.42887,-0.0944 0.56884,-0.28321 0.13998,-0.1888 0.20996,-0.44596 0.20997,-0.77148 -1e-5,-0.32389 -0.07,-0.58024 -0.20997,-0.76905 -0.13997,-0.19042 -0.32959,-0.28564 -0.56884,-0.28564 m 0,-0.38086 c 0.39062,0 0.69742,0.12696 0.92041,0.38086 0.22298,0.25391 0.33447,0.60547 0.33447,1.05469 0,0.44759 -0.11149,0.79915 -0.33447,1.05469 -0.22299,0.2539 -0.52979,0.38085 -0.92041,0.38085 -0.39226,0 -0.69987,-0.12695 -0.92285,-0.38085 -0.22136,-0.25554 -0.33204,-0.6071 -0.33204,-1.05469 0,-0.44922 0.11068,-0.80078 0.33204,-1.05469 0.22298,-0.2539 0.53059,-0.38086 0.92285,-0.38086"
|
||||
style="font-size:5px"
|
||||
id="path3149" />
|
||||
<path
|
||||
d="m 244.24776,442.93802 0.44922,0 0.56152,2.13379 0.55908,-2.13379 0.52979,0 0.56152,2.13379 0.55908,-2.13379 0.44922,0 -0.71533,2.73437 -0.52979,0 -0.58838,-2.24121 -0.59082,2.24121 -0.52978,0 -0.71533,-2.73437"
|
||||
style="font-size:5px"
|
||||
id="path3151" />
|
||||
<path
|
||||
d="m 249.70674,442.02737 3.0835,0 0,0.41504 -1.29395,0 0,3.22998 -0.4956,0 0,-3.22998 -1.29395,0 0,-0.41504"
|
||||
style="font-size:5px"
|
||||
id="path3153" />
|
||||
<path
|
||||
d="m 253.09297,442.93802 0.44922,0 0,2.73437 -0.44922,0 0,-2.73437 m 0,-1.06445 0.44922,0 0,0.56884 -0.44922,0 0,-0.56884"
|
||||
style="font-size:5px"
|
||||
id="path3155" />
|
||||
<path
|
||||
d="m 254.92403,442.16165 0,0.77637 0.92529,0 0,0.34912 -0.92529,0 0,1.48437 c 0,0.22299 0.0301,0.36622 0.0903,0.42969 0.0618,0.0635 0.18636,0.0952 0.37353,0.0952 l 0.46143,0 0,0.37597 -0.46143,0 c -0.34668,0 -0.58593,-0.0643 -0.71777,-0.19287 -0.13184,-0.13021 -0.19775,-0.36621 -0.19775,-0.70801 l 0,-1.48437 -0.32959,0 0,-0.34912 0.32959,0 0,-0.77637 0.45166,0"
|
||||
style="font-size:5px"
|
||||
id="path3157" />
|
||||
<path
|
||||
d="m 256.44258,441.87357 0.44922,0 0,3.79882 -0.44922,0 0,-3.79882"
|
||||
style="font-size:5px"
|
||||
id="path3159" />
|
||||
<path
|
||||
d="m 260.16817,444.1929 0,0.21973 -2.06543,0 c 0.0195,0.30924 0.1123,0.54525 0.27832,0.70801 0.16764,0.16113 0.40039,0.2417 0.69824,0.2417 0.17252,0 0.33935,-0.0212 0.50049,-0.0635 0.16276,-0.0423 0.32389,-0.1058 0.4834,-0.19043 l 0,0.4248 c -0.16114,0.0684 -0.32634,0.12045 -0.49561,0.15625 -0.16927,0.0358 -0.34098,0.0537 -0.51514,0.0537 -0.43619,0 -0.78206,-0.12695 -1.03759,-0.38085 -0.25391,-0.25391 -0.38086,-0.59733 -0.38086,-1.03028 0,-0.44759 0.12044,-0.8024 0.36133,-1.06445 0.24251,-0.26367 0.56884,-0.39551 0.979,-0.39551 0.36784,0 0.65836,0.11882 0.87158,0.35645 0.21484,0.236 0.32226,0.55745 0.32227,0.96435 m -0.44922,-0.13183 c -0.003,-0.24577 -0.0724,-0.4419 -0.20752,-0.58838 -0.13347,-0.14649 -0.31088,-0.21973 -0.53223,-0.21973 -0.25065,0 -0.45166,0.0708 -0.60303,0.2124 -0.14974,0.14161 -0.236,0.34099 -0.25878,0.59815 l 1.60156,-0.002"
|
||||
style="font-size:5px"
|
||||
id="path3161" />
|
||||
</g>
|
||||
<g
|
||||
aria-label="Content area origin"
|
||||
style="font-style:normal;font-weight:normal;font-size:40px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none"
|
||||
id="text4089">
|
||||
<path
|
||||
d="m 172.21587,456.09125 v 1.04004 q -0.49805,-0.46387 -1.06446,-0.69336 -0.56152,-0.22949 -1.19629,-0.22949 -1.25,0 -1.91406,0.7666 -0.66406,0.76172 -0.66406,2.20703 0,1.44043 0.66406,2.20703 0.66406,0.76172 1.91406,0.76172 0.63477,0 1.19629,-0.22949 0.56641,-0.2295 1.06446,-0.69336 v 1.03027 q -0.51758,0.35156 -1.09864,0.52734 -0.57617,0.17578 -1.2207,0.17578 -1.65527,0 -2.60742,-1.01074 -0.95215,-1.01562 -0.95215,-2.76855 0,-1.75781 0.95215,-2.76856 0.95215,-1.01562 2.60742,-1.01562 0.6543,0 1.23047,0.17578 0.58105,0.1709 1.08887,0.51758 z"
|
||||
style="font-size:10px"
|
||||
id="path4091" />
|
||||
<path
|
||||
d="m 175.82915,457.9809 q -0.72266,0 -1.14258,0.5664 -0.41992,0.56153 -0.41992,1.54297 0,0.98145 0.41504,1.54785 0.41992,0.56153 1.14746,0.56153 0.71777,0 1.13769,-0.56641 0.41992,-0.56641 0.41992,-1.54297 0,-0.97168 -0.41992,-1.53808 -0.41992,-0.57129 -1.13769,-0.57129 z m 0,-0.76172 q 1.17187,0 1.84082,0.76172 0.66894,0.76171 0.66894,2.10937 0,1.34277 -0.66894,2.10938 -0.66895,0.76171 -1.84082,0.76171 -1.17676,0 -1.84571,-0.76171 -0.66406,-0.76661 -0.66406,-2.10938 0,-1.34766 0.66406,-2.10937 0.66895,-0.76172 1.84571,-0.76172 z"
|
||||
style="font-size:10px"
|
||||
id="path4093" />
|
||||
<path
|
||||
d="m 184.36919,459.51898 v 3.30078 h -0.89844 v -3.27148 q 0,-0.77637 -0.30274,-1.16211 -0.30273,-0.38574 -0.9082,-0.38574 -0.72754,0 -1.14746,0.46386 -0.41992,0.46387 -0.41992,1.26465 v 3.09082 h -0.90332 v -5.46875 h 0.90332 v 0.84961 q 0.32226,-0.49316 0.75683,-0.7373 0.43946,-0.24414 1.01075,-0.24414 0.94238,0 1.42578,0.58593 0.4834,0.58106 0.4834,1.71387 z"
|
||||
style="font-size:10px"
|
||||
id="path4095" />
|
||||
<path
|
||||
d="m 187.05962,455.79828 v 1.55273 h 1.85058 v 0.69825 h -1.85058 v 2.96875 q 0,0.66894 0.18066,0.85937 0.18555,0.19043 0.74707,0.19043 h 0.92285 v 0.75195 h -0.92285 q -1.04004,0 -1.43555,-0.38574 -0.3955,-0.39062 -0.3955,-1.41601 v -2.96875 h -0.65918 v -0.69825 h 0.65918 v -1.55273 z"
|
||||
style="font-size:10px"
|
||||
id="path4097" />
|
||||
<path
|
||||
d="m 194.77446,459.86078 v 0.43945 h -4.13086 q 0.0586,0.92774 0.55664,1.41602 0.50293,0.4834 1.39649,0.4834 0.51757,0 1.00097,-0.12696 0.48828,-0.12695 0.9668,-0.38086 v 0.84961 q -0.4834,0.20508 -0.99121,0.3125 -0.50781,0.10742 -1.03028,0.10742 -1.30859,0 -2.07519,-0.76171 -0.76172,-0.76172 -0.76172,-2.06055 0,-1.34277 0.72266,-2.12891 0.72754,-0.79101 1.958,-0.79101 1.10352,0 1.74317,0.71289 0.64453,0.70801 0.64453,1.92871 z m -0.89844,-0.26367 q -0.01,-0.73731 -0.41504,-1.17676 -0.40039,-0.43945 -1.06445,-0.43945 -0.75195,0 -1.20605,0.4248 -0.44922,0.42481 -0.51758,1.19629 z"
|
||||
style="font-size:10px"
|
||||
id="path4099" />
|
||||
<path
|
||||
d="m 200.79497,459.51898 v 3.30078 h -0.89844 v -3.27148 q 0,-0.77637 -0.30273,-1.16211 -0.30274,-0.38574 -0.90821,-0.38574 -0.72754,0 -1.14746,0.46386 -0.41992,0.46387 -0.41992,1.26465 v 3.09082 h -0.90332 v -5.46875 h 0.90332 v 0.84961 q 0.32227,-0.49316 0.75684,-0.7373 0.43945,-0.24414 1.01074,-0.24414 0.94238,0 1.42578,0.58593 0.4834,0.58106 0.4834,1.71387 z"
|
||||
style="font-size:10px"
|
||||
id="path4101" />
|
||||
<path
|
||||
d="m 203.4854,455.79828 v 1.55273 h 1.85058 v 0.69825 h -1.85058 v 2.96875 q 0,0.66894 0.18066,0.85937 0.18555,0.19043 0.74707,0.19043 h 0.92285 v 0.75195 h -0.92285 q -1.04004,0 -1.43555,-0.38574 -0.3955,-0.39062 -0.3955,-1.41601 v -2.96875 h -0.65918 v -0.69825 h 0.65918 v -1.55273 z"
|
||||
style="font-size:10px"
|
||||
id="path4103" />
|
||||
<path
|
||||
d="m 212.19145,460.07074 q -1.08887,0 -1.50879,0.24902 -0.41992,0.24903 -0.41992,0.84961 0,0.47852 0.3125,0.76172 0.31738,0.27832 0.85938,0.27832 0.74707,0 1.19629,-0.52734 0.4541,-0.53223 0.4541,-1.41113 v -0.2002 z m 1.79199,-0.37109 v 3.12011 h -0.89843 v -0.83007 q -0.30762,0.49804 -0.7666,0.7373 -0.45899,0.23437 -1.12305,0.23437 -0.83985,0 -1.33789,-0.46875 -0.49317,-0.47363 -0.49317,-1.26464 0,-0.92286 0.61524,-1.39161 0.62012,-0.46875 1.8457,-0.46875 h 1.25977 v -0.0879 q 0,-0.62011 -0.41016,-0.95703 -0.40527,-0.34179 -1.14258,-0.34179 -0.46875,0 -0.91308,0.1123 -0.44434,0.11231 -0.8545,0.33691 v -0.83007 q 0.49317,-0.19043 0.95704,-0.28321 0.46386,-0.0976 0.90332,-0.0976 1.18652,0 1.77246,0.61523 0.58593,0.61524 0.58593,1.86524 z"
|
||||
style="font-size:10px"
|
||||
id="path4105" />
|
||||
<path
|
||||
d="m 219.00786,458.19086 q -0.15137,-0.0879 -0.33203,-0.12696 -0.17578,-0.0439 -0.39063,-0.0439 -0.76172,0 -1.17187,0.49805 -0.40528,0.49316 -0.40528,1.42089 v 2.88086 h -0.90332 v -5.46875 h 0.90332 v 0.84961 q 0.28321,-0.49804 0.73731,-0.7373 0.4541,-0.24414 1.10351,-0.24414 0.0928,0 0.20508,0.0147 0.11231,0.01 0.24903,0.0342 z"
|
||||
style="font-size:10px"
|
||||
id="path4107" />
|
||||
<path
|
||||
d="m 224.4229,459.86078 v 0.43945 h -4.13086 q 0.0586,0.92774 0.55664,1.41602 0.50293,0.4834 1.39648,0.4834 0.51758,0 1.00098,-0.12696 0.48828,-0.12695 0.9668,-0.38086 v 0.84961 q -0.4834,0.20508 -0.99121,0.3125 -0.50782,0.10742 -1.03028,0.10742 -1.30859,0 -2.07519,-0.76171 -0.76172,-0.76172 -0.76172,-2.06055 0,-1.34277 0.72265,-2.12891 0.72754,-0.79101 1.95801,-0.79101 1.10352,0 1.74317,0.71289 0.64453,0.70801 0.64453,1.92871 z m -0.89844,-0.26367 q -0.01,-0.73731 -0.41504,-1.17676 -0.40039,-0.43945 -1.06445,-0.43945 -0.75196,0 -1.20606,0.4248 -0.44922,0.42481 -0.51758,1.19629 z"
|
||||
style="font-size:10px"
|
||||
id="path4109" />
|
||||
<path
|
||||
d="m 228.38286,460.07074 q -1.08887,0 -1.50879,0.24902 -0.41992,0.24903 -0.41992,0.84961 0,0.47852 0.3125,0.76172 0.31738,0.27832 0.85937,0.27832 0.74707,0 1.19629,-0.52734 0.4541,-0.53223 0.4541,-1.41113 v -0.2002 z m 1.79199,-0.37109 v 3.12011 h -0.89844 v -0.83007 q -0.30761,0.49804 -0.7666,0.7373 -0.45898,0.23437 -1.12305,0.23437 -0.83984,0 -1.33789,-0.46875 -0.49316,-0.47363 -0.49316,-1.26464 0,-0.92286 0.61523,-1.39161 0.62012,-0.46875 1.84571,-0.46875 h 1.25976 v -0.0879 q 0,-0.62011 -0.41015,-0.95703 -0.40528,-0.34179 -1.14258,-0.34179 -0.46875,0 -0.91309,0.1123 -0.44433,0.11231 -0.85449,0.33691 v -0.83007 q 0.49316,-0.19043 0.95703,-0.28321 0.46387,-0.0976 0.90332,-0.0976 1.18653,0 1.77246,0.61523 0.58594,0.61524 0.58594,1.86524 z"
|
||||
style="font-size:10px"
|
||||
id="path4111" />
|
||||
<path
|
||||
d="m 237.33305,457.9809 q -0.72265,0 -1.14257,0.5664 -0.41993,0.56153 -0.41993,1.54297 0,0.98145 0.41504,1.54785 0.41992,0.56153 1.14746,0.56153 0.71778,0 1.1377,-0.56641 0.41992,-0.56641 0.41992,-1.54297 0,-0.97168 -0.41992,-1.53808 -0.41992,-0.57129 -1.1377,-0.57129 z m 0,-0.76172 q 1.17188,0 1.84082,0.76172 0.66895,0.76171 0.66895,2.10937 0,1.34277 -0.66895,2.10938 -0.66894,0.76171 -1.84082,0.76171 -1.17675,0 -1.8457,-0.76171 -0.66406,-0.76661 -0.66406,-2.10938 0,-1.34766 0.66406,-2.10937 0.66895,-0.76172 1.8457,-0.76172 z"
|
||||
style="font-size:10px"
|
||||
id="path4113" />
|
||||
<path
|
||||
d="m 244.49614,458.19086 q -0.15137,-0.0879 -0.33203,-0.12696 -0.17578,-0.0439 -0.39063,-0.0439 -0.76172,0 -1.17187,0.49805 -0.40528,0.49316 -0.40528,1.42089 v 2.88086 h -0.90332 v -5.46875 h 0.90332 v 0.84961 q 0.28321,-0.49804 0.73731,-0.7373 0.4541,-0.24414 1.10352,-0.24414 0.0928,0 0.20507,0.0147 0.11231,0.01 0.24903,0.0342 z"
|
||||
style="font-size:10px"
|
||||
id="path4115" />
|
||||
<path
|
||||
d="m 245.44829,457.35101 h 0.89844 v 5.46875 h -0.89844 z m 0,-2.1289 h 0.89844 v 1.13769 h -0.89844 z"
|
||||
style="font-size:10px"
|
||||
id="path4117" />
|
||||
<path
|
||||
d="m 251.82036,460.02191 q 0,-0.97656 -0.40528,-1.51367 -0.40039,-0.53711 -1.12792,-0.53711 -0.72266,0 -1.12793,0.53711 -0.4004,0.53711 -0.4004,1.51367 0,0.97168 0.4004,1.50879 0.40527,0.53711 1.12793,0.53711 0.72753,0 1.12792,-0.53711 0.40528,-0.53711 0.40528,-1.50879 z m 0.89844,2.11914 q 0,1.39649 -0.62012,2.0752 -0.62012,0.68359 -1.89942,0.68359 -0.47363,0 -0.89355,-0.0732 -0.41992,-0.0684 -0.81543,-0.21484 v -0.87403 q 0.39551,0.21485 0.78125,0.31738 0.38574,0.10254 0.78613,0.10254 0.88379,0 1.32325,-0.46386 0.43945,-0.45899 0.43945,-1.3916 v -0.44434 q -0.27832,0.4834 -0.71289,0.72266 -0.43457,0.23925 -1.04004,0.23925 -1.00586,0 -1.6211,-0.7666 -0.61523,-0.7666 -0.61523,-2.03125 0,-1.26953 0.61523,-2.03613 0.61524,-0.7666 1.6211,-0.7666 0.60547,0 1.04004,0.23926 0.43457,0.23925 0.71289,0.72265 v -0.83008 h 0.89844 z"
|
||||
style="font-size:10px"
|
||||
id="path4119" />
|
||||
<path
|
||||
d="m 254.56938,457.35101 h 0.89844 v 5.46875 h -0.89844 z m 0,-2.1289 h 0.89844 v 1.13769 h -0.89844 z"
|
||||
style="font-size:10px"
|
||||
id="path4121" />
|
||||
<path
|
||||
d="m 261.88872,459.51898 v 3.30078 h -0.89844 v -3.27148 q 0,-0.77637 -0.30273,-1.16211 -0.30274,-0.38574 -0.90821,-0.38574 -0.72754,0 -1.14746,0.46386 -0.41992,0.46387 -0.41992,1.26465 v 3.09082 h -0.90332 v -5.46875 h 0.90332 v 0.84961 q 0.32227,-0.49316 0.75684,-0.7373 0.43945,-0.24414 1.01074,-0.24414 0.94238,0 1.42578,0.58593 0.4834,0.58106 0.4834,1.71387 z"
|
||||
style="font-size:10px"
|
||||
id="path4123" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 108 KiB |
253
docs/vulkan.dox
Normal file
253
docs/vulkan.dox
Normal file
|
@ -0,0 +1,253 @@
|
|||
/*!
|
||||
|
||||
@page vulkan_guide Vulkan guide
|
||||
|
||||
@tableofcontents
|
||||
|
||||
This guide is intended to fill the gaps between the official [Vulkan
|
||||
resources](https://www.khronos.org/vulkan/) and the rest of the GLFW
|
||||
documentation and is not a replacement for either. It assumes some familiarity
|
||||
with Vulkan concepts like loaders, devices, queues and surfaces and leaves it to
|
||||
the Vulkan documentation to explain the details of Vulkan functions.
|
||||
|
||||
To develop for Vulkan you should download the [LunarG Vulkan
|
||||
SDK](https://vulkan.lunarg.com/) for your platform. Apart from headers and link
|
||||
libraries, they also provide the validation layers necessary for development.
|
||||
|
||||
The [Vulkan Tutorial](https://vulkan-tutorial.com/) has more information on how
|
||||
to use GLFW and Vulkan. The [Khronos Vulkan
|
||||
Samples](https://github.com/KhronosGroup/Vulkan-Samples) also use GLFW, although
|
||||
with a small framework in between.
|
||||
|
||||
For details on a specific Vulkan support function, see the @ref vulkan. There
|
||||
are also guides for the other areas of the GLFW API.
|
||||
|
||||
- @ref intro_guide
|
||||
- @ref window_guide
|
||||
- @ref context_guide
|
||||
- @ref monitor_guide
|
||||
- @ref input_guide
|
||||
|
||||
|
||||
@section vulkan_loader Finding the Vulkan loader
|
||||
|
||||
GLFW itself does not ever need to be linked against the Vulkan loader.
|
||||
|
||||
By default, GLFW will load the Vulkan loader dynamically at runtime via its standard name:
|
||||
`vulkan-1.dll` on Windows, `libvulkan.so.1` on Linux and other Unix-like systems and
|
||||
`libvulkan.1.dylib` on macOS.
|
||||
|
||||
@macos GLFW will also look up and search the `Frameworks` subdirectory of your
|
||||
application bundle.
|
||||
|
||||
If your code is using a Vulkan loader with a different name or in a non-standard location
|
||||
you will need to direct GLFW to it. Pass your version of `vkGetInstanceProcAddr` to @ref
|
||||
glfwInitVulkanLoader before initializing GLFW and it will use that function for all Vulkan
|
||||
entry point retrieval. This prevents GLFW from dynamically loading the Vulkan loader.
|
||||
|
||||
@code
|
||||
glfwInitVulkanLoader(vkGetInstanceProcAddr);
|
||||
@endcode
|
||||
|
||||
@macos To make your application be redistributable you will need to set up the application
|
||||
bundle according to the LunarG SDK documentation. This is explained in more detail in the
|
||||
[SDK documentation for macOS](https://vulkan.lunarg.com/doc/sdk/latest/mac/getting_started.html).
|
||||
|
||||
|
||||
@section vulkan_include Including the Vulkan header file
|
||||
|
||||
To have GLFW include the Vulkan header, define @ref GLFW_INCLUDE_VULKAN before including
|
||||
the GLFW header.
|
||||
|
||||
@code
|
||||
#define GLFW_INCLUDE_VULKAN
|
||||
#include <GLFW/glfw3.h>
|
||||
@endcode
|
||||
|
||||
If you instead want to include the Vulkan header from a custom location or use
|
||||
your own custom Vulkan header then do this before the GLFW header.
|
||||
|
||||
@code
|
||||
#include <path/to/vulkan.h>
|
||||
#include <GLFW/glfw3.h>
|
||||
@endcode
|
||||
|
||||
Unless a Vulkan header is included, either by the GLFW header or above it, the following
|
||||
GLFW functions will not be declared, as depend on Vulkan types.
|
||||
|
||||
- @ref glfwInitVulkanLoader
|
||||
- @ref glfwGetInstanceProcAddress
|
||||
- @ref glfwGetPhysicalDevicePresentationSupport
|
||||
- @ref glfwCreateWindowSurface
|
||||
|
||||
The `VK_USE_PLATFORM_*_KHR` macros do not need to be defined for the Vulkan part
|
||||
of GLFW to work. Define them only if you are using these extensions directly.
|
||||
|
||||
|
||||
@section vulkan_support Querying for Vulkan support
|
||||
|
||||
If you are linking directly against the Vulkan loader then you can skip this
|
||||
section. The canonical desktop loader library exports all Vulkan core and
|
||||
Khronos extension functions, allowing them to be called directly.
|
||||
|
||||
If you are loading the Vulkan loader dynamically instead of linking directly
|
||||
against it, you can check for the availability of a loader and ICD with @ref
|
||||
glfwVulkanSupported.
|
||||
|
||||
@code
|
||||
if (glfwVulkanSupported())
|
||||
{
|
||||
// Vulkan is available, at least for compute
|
||||
}
|
||||
@endcode
|
||||
|
||||
This function returns `GLFW_TRUE` if the Vulkan loader and any minimally
|
||||
functional ICD was found.
|
||||
|
||||
If one or both were not found, calling any other Vulkan related GLFW function
|
||||
will generate a @ref GLFW_API_UNAVAILABLE error.
|
||||
|
||||
|
||||
@subsection vulkan_proc Querying Vulkan function pointers
|
||||
|
||||
To load any Vulkan core or extension function from the found loader, call @ref
|
||||
glfwGetInstanceProcAddress. To load functions needed for instance creation,
|
||||
pass `NULL` as the instance.
|
||||
|
||||
@code
|
||||
PFN_vkCreateInstance pfnCreateInstance = (PFN_vkCreateInstance)
|
||||
glfwGetInstanceProcAddress(NULL, "vkCreateInstance");
|
||||
@endcode
|
||||
|
||||
Once you have created an instance, you can load from it all other Vulkan core
|
||||
functions and functions from any instance extensions you enabled.
|
||||
|
||||
@code
|
||||
PFN_vkCreateDevice pfnCreateDevice = (PFN_vkCreateDevice)
|
||||
glfwGetInstanceProcAddress(instance, "vkCreateDevice");
|
||||
@endcode
|
||||
|
||||
This function in turn calls `vkGetInstanceProcAddr`. If that fails, the
|
||||
function falls back to a platform-specific query of the Vulkan loader (i.e.
|
||||
`dlsym` or `GetProcAddress`). If that also fails, the function returns `NULL`.
|
||||
For more information about `vkGetInstanceProcAddr`, see the Vulkan
|
||||
documentation.
|
||||
|
||||
Vulkan also provides `vkGetDeviceProcAddr` for loading device-specific versions
|
||||
of Vulkan function. This function can be retrieved from an instance with @ref
|
||||
glfwGetInstanceProcAddress.
|
||||
|
||||
@code
|
||||
PFN_vkGetDeviceProcAddr pfnGetDeviceProcAddr = (PFN_vkGetDeviceProcAddr)
|
||||
glfwGetInstanceProcAddress(instance, "vkGetDeviceProcAddr");
|
||||
@endcode
|
||||
|
||||
Device-specific functions may execute a little faster, due to not having to
|
||||
dispatch internally based on the device passed to them. For more information
|
||||
about `vkGetDeviceProcAddr`, see the Vulkan documentation.
|
||||
|
||||
|
||||
@section vulkan_ext Querying required Vulkan extensions
|
||||
|
||||
To do anything useful with Vulkan you need to create an instance. If you want
|
||||
to use Vulkan to render to a window, you must enable the instance extensions
|
||||
GLFW requires to create Vulkan surfaces.
|
||||
|
||||
To query the instance extensions required, call @ref
|
||||
glfwGetRequiredInstanceExtensions.
|
||||
|
||||
@code
|
||||
uint32_t count;
|
||||
const char** extensions = glfwGetRequiredInstanceExtensions(&count);
|
||||
@endcode
|
||||
|
||||
These extensions must all be enabled when creating instances that are going to
|
||||
be passed to @ref glfwGetPhysicalDevicePresentationSupport and @ref
|
||||
glfwCreateWindowSurface. The set of extensions will vary depending on platform
|
||||
and may also vary depending on graphics drivers and other factors.
|
||||
|
||||
If it fails it will return `NULL` and GLFW will not be able to create Vulkan
|
||||
window surfaces. You can still use Vulkan for off-screen rendering and compute
|
||||
work.
|
||||
|
||||
If successful the returned array will always include `VK_KHR_surface`, so if
|
||||
you don't require any additional extensions you can pass this list directly to
|
||||
the `VkInstanceCreateInfo` struct.
|
||||
|
||||
@code
|
||||
VkInstanceCreateInfo ici;
|
||||
|
||||
memset(&ici, 0, sizeof(ici));
|
||||
ici.enabledExtensionCount = count;
|
||||
ici.ppEnabledExtensionNames = extensions;
|
||||
...
|
||||
@endcode
|
||||
|
||||
Additional extensions may be required by future versions of GLFW. You should
|
||||
check whether any extensions you wish to enable are already in the returned
|
||||
array, as it is an error to specify an extension more than once in the
|
||||
`VkInstanceCreateInfo` struct.
|
||||
|
||||
@macos MoltenVK is (as of July 2022) not yet a fully conformant implementation
|
||||
of Vulkan. As of Vulkan SDK 1.3.216.0, this means you must also enable the
|
||||
`VK_KHR_portability_enumeration` instance extension and set the
|
||||
`VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR` bit in the instance creation
|
||||
info flags for MoltenVK to show up in the list of physical devices. For more
|
||||
information, see the Vulkan and MoltenVK documentation.
|
||||
|
||||
|
||||
@section vulkan_present Querying for Vulkan presentation support
|
||||
|
||||
Not every queue family of every Vulkan device can present images to surfaces.
|
||||
To check whether a specific queue family of a physical device supports image
|
||||
presentation without first having to create a window and surface, call @ref
|
||||
glfwGetPhysicalDevicePresentationSupport.
|
||||
|
||||
@code
|
||||
if (glfwGetPhysicalDevicePresentationSupport(instance, physical_device, queue_family_index))
|
||||
{
|
||||
// Queue family supports image presentation
|
||||
}
|
||||
@endcode
|
||||
|
||||
The `VK_KHR_surface` extension additionally provides the
|
||||
`vkGetPhysicalDeviceSurfaceSupportKHR` function, which performs the same test on
|
||||
an existing Vulkan surface.
|
||||
|
||||
|
||||
@section vulkan_window Creating the window
|
||||
|
||||
Unless you will be using OpenGL or OpenGL ES with the same window as Vulkan,
|
||||
there is no need to create a context. You can disable context creation with the
|
||||
[GLFW_CLIENT_API](@ref GLFW_CLIENT_API_hint) hint.
|
||||
|
||||
@code
|
||||
glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
|
||||
GLFWwindow* window = glfwCreateWindow(640, 480, "Window Title", NULL, NULL);
|
||||
@endcode
|
||||
|
||||
See @ref context_less for more information.
|
||||
|
||||
|
||||
@section vulkan_surface Creating a Vulkan window surface
|
||||
|
||||
You can create a Vulkan surface (as defined by the `VK_KHR_surface` extension)
|
||||
for a GLFW window with @ref glfwCreateWindowSurface.
|
||||
|
||||
@code
|
||||
VkSurfaceKHR surface;
|
||||
VkResult err = glfwCreateWindowSurface(instance, window, NULL, &surface);
|
||||
if (err)
|
||||
{
|
||||
// Window surface creation failed
|
||||
}
|
||||
@endcode
|
||||
|
||||
If an OpenGL or OpenGL ES context was created on the window, the context has
|
||||
ownership of the presentation on the window and a Vulkan surface cannot be
|
||||
created.
|
||||
|
||||
It is your responsibility to destroy the surface. GLFW does not destroy it for
|
||||
you. Call `vkDestroySurfaceKHR` function from the same extension to destroy it.
|
||||
|
||||
*/
|
1482
docs/window.dox
1482
docs/window.dox
File diff suppressed because it is too large
Load Diff
|
@ -1,64 +1,83 @@
|
|||
|
||||
link_libraries(glfw ${OPENGL_glu_LIBRARY})
|
||||
link_libraries(glfw)
|
||||
|
||||
if (BUILD_SHARED_LIBS)
|
||||
add_definitions(-DGLFW_DLL)
|
||||
link_libraries(${OPENGL_gl_LIBRARY} ${MATH_LIBRARY})
|
||||
else()
|
||||
link_libraries(${glfw_LIBRARIES})
|
||||
include_directories("${GLFW_SOURCE_DIR}/deps")
|
||||
|
||||
if (MATH_LIBRARY)
|
||||
link_libraries("${MATH_LIBRARY}")
|
||||
endif()
|
||||
|
||||
include_directories(${GLFW_SOURCE_DIR}/include
|
||||
${GLFW_SOURCE_DIR}/deps)
|
||||
|
||||
if (MSVC)
|
||||
# Workaround for the MS CRT deprecating parts of the standard library
|
||||
if (MSVC OR CMAKE_C_SIMULATE_ID STREQUAL "MSVC")
|
||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
||||
endif()
|
||||
|
||||
if (NOT APPLE)
|
||||
# HACK: This is NOTFOUND on OS X 10.8
|
||||
include_directories(${OPENGL_INCLUDE_DIR})
|
||||
if (WIN32)
|
||||
set(ICON glfw.rc)
|
||||
elseif (APPLE)
|
||||
set(ICON glfw.icns)
|
||||
endif()
|
||||
|
||||
set(GETOPT ${GLFW_SOURCE_DIR}/deps/getopt.h
|
||||
${GLFW_SOURCE_DIR}/deps/getopt.c)
|
||||
set(GLAD_GL "${GLFW_SOURCE_DIR}/deps/glad/gl.h")
|
||||
set(GLAD_GLES2 "${GLFW_SOURCE_DIR}/deps/glad/gles2.h")
|
||||
set(GETOPT "${GLFW_SOURCE_DIR}/deps/getopt.h"
|
||||
"${GLFW_SOURCE_DIR}/deps/getopt.c")
|
||||
set(TINYCTHREAD "${GLFW_SOURCE_DIR}/deps/tinycthread.h"
|
||||
"${GLFW_SOURCE_DIR}/deps/tinycthread.c")
|
||||
|
||||
if (APPLE)
|
||||
# Set fancy names for bundles
|
||||
add_executable(Boing MACOSX_BUNDLE boing.c)
|
||||
add_executable(Gears MACOSX_BUNDLE gears.c)
|
||||
add_executable(Simple MACOSX_BUNDLE simple.c)
|
||||
add_executable("Split View" MACOSX_BUNDLE splitview.c)
|
||||
add_executable(Wave MACOSX_BUNDLE wave.c)
|
||||
add_executable(boing WIN32 MACOSX_BUNDLE boing.c ${ICON} ${GLAD_GL})
|
||||
add_executable(gears WIN32 MACOSX_BUNDLE gears.c ${ICON} ${GLAD_GL})
|
||||
add_executable(heightmap WIN32 MACOSX_BUNDLE heightmap.c ${ICON} ${GLAD_GL})
|
||||
add_executable(offscreen offscreen.c ${ICON} ${GLAD_GL})
|
||||
add_executable(particles WIN32 MACOSX_BUNDLE particles.c ${ICON} ${TINYCTHREAD} ${GETOPT} ${GLAD_GL})
|
||||
add_executable(sharing WIN32 MACOSX_BUNDLE sharing.c ${ICON} ${GLAD_GL})
|
||||
add_executable(splitview WIN32 MACOSX_BUNDLE splitview.c ${ICON} ${GLAD_GL})
|
||||
add_executable(triangle-opengl WIN32 MACOSX_BUNDLE triangle-opengl.c ${ICON} ${GLAD_GL})
|
||||
add_executable(triangle-opengles WIN32 MACOSX_BUNDLE triangle-opengles.c ${ICON} ${GLAD_GLES2})
|
||||
add_executable(wave WIN32 MACOSX_BUNDLE wave.c ${ICON} ${GLAD_GL})
|
||||
add_executable(windows WIN32 MACOSX_BUNDLE windows.c ${ICON} ${GLAD_GL})
|
||||
|
||||
set_target_properties(Boing PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Boing")
|
||||
set_target_properties(Gears PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Gears")
|
||||
set_target_properties(Simple PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Simple")
|
||||
set_target_properties("Split View" PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Split View")
|
||||
set_target_properties(Wave PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Wave")
|
||||
else()
|
||||
# Set boring names for executables
|
||||
add_executable(boing WIN32 boing.c)
|
||||
add_executable(gears WIN32 gears.c)
|
||||
add_executable(heightmap WIN32 heightmap.c ${GETOPT})
|
||||
add_executable(simple WIN32 simple.c)
|
||||
add_executable(splitview WIN32 splitview.c)
|
||||
add_executable(wave WIN32 wave.c)
|
||||
target_link_libraries(particles Threads::Threads)
|
||||
if (RT_LIBRARY)
|
||||
target_link_libraries(particles "${RT_LIBRARY}")
|
||||
endif()
|
||||
|
||||
set(GUI_ONLY_BINARIES boing gears heightmap particles sharing splitview
|
||||
triangle-opengl triangle-opengles wave windows)
|
||||
set(CONSOLE_BINARIES offscreen)
|
||||
|
||||
set_target_properties(${GUI_ONLY_BINARIES} ${CONSOLE_BINARIES} PROPERTIES
|
||||
C_STANDARD 99
|
||||
FOLDER "GLFW3/Examples")
|
||||
|
||||
if (MSVC)
|
||||
set(WINDOWS_BINARIES boing gears heightmap simple splitview wave)
|
||||
|
||||
# Tell MSVC to use main instead of WinMain for Windows subsystem executables
|
||||
set_target_properties(${WINDOWS_BINARIES} PROPERTIES
|
||||
# Tell MSVC to use main instead of WinMain
|
||||
set_target_properties(${GUI_ONLY_BINARIES} PROPERTIES
|
||||
LINK_FLAGS "/ENTRY:mainCRTStartup")
|
||||
elseif (CMAKE_C_SIMULATE_ID STREQUAL "MSVC")
|
||||
# Tell Clang using MS CRT to use main instead of WinMain
|
||||
set_target_properties(${GUI_ONLY_BINARIES} PROPERTIES
|
||||
LINK_FLAGS "-Wl,/entry:mainCRTStartup")
|
||||
endif()
|
||||
|
||||
if (APPLE)
|
||||
set(BUNDLE_BINARIES Boing Gears Simple "Split View" Wave)
|
||||
set_target_properties(boing PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Boing")
|
||||
set_target_properties(gears PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Gears")
|
||||
set_target_properties(heightmap PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Heightmap")
|
||||
set_target_properties(particles PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Particles")
|
||||
set_target_properties(sharing PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Sharing")
|
||||
set_target_properties(triangle-opengl PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "OpenGL Triangle")
|
||||
set_target_properties(triangle-opengles PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "OpenGL ES Triangle")
|
||||
set_target_properties(splitview PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "SplitView")
|
||||
set_target_properties(wave PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Wave")
|
||||
set_target_properties(windows PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Windows")
|
||||
|
||||
set_target_properties(${BUNDLE_BINARIES} PROPERTIES
|
||||
set_source_files_properties(glfw.icns PROPERTIES
|
||||
MACOSX_PACKAGE_LOCATION "Resources")
|
||||
set_target_properties(${GUI_ONLY_BINARIES} PROPERTIES
|
||||
MACOSX_BUNDLE_SHORT_VERSION_STRING ${GLFW_VERSION}
|
||||
MACOSX_BUNDLE_LONG_VERSION_STRING ${GLFW_VERSION_FULL})
|
||||
MACOSX_BUNDLE_LONG_VERSION_STRING ${GLFW_VERSION}
|
||||
MACOSX_BUNDLE_ICON_FILE glfw.icns
|
||||
MACOSX_BUNDLE_INFO_PLIST "${GLFW_SOURCE_DIR}/CMake/Info.plist.in")
|
||||
endif()
|
||||
|
||||
|
|
146
examples/boing.c
146
examples/boing.c
|
@ -27,13 +27,22 @@
|
|||
* a hidden computer or VCR.
|
||||
*****************************************************************************/
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
// Make MS math.h define M_PI
|
||||
#define _USE_MATH_DEFINES
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
|
||||
#define GLFW_INCLUDE_GLU
|
||||
#define GLAD_GL_IMPLEMENTATION
|
||||
#include <glad/gl.h>
|
||||
#define GLFW_INCLUDE_NONE
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
#include <linmath.h>
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Various declarations and macros
|
||||
|
@ -44,6 +53,8 @@ void init( void );
|
|||
void display( void );
|
||||
void reshape( GLFWwindow* window, int w, int h );
|
||||
void key_callback( GLFWwindow* window, int key, int scancode, int action, int mods );
|
||||
void mouse_button_callback( GLFWwindow* window, int button, int action, int mods );
|
||||
void cursor_position_callback( GLFWwindow* window, double x, double y );
|
||||
void DrawBoingBall( void );
|
||||
void BounceBall( double dt );
|
||||
void DrawBoingBallBand( GLfloat long_lo, GLfloat long_hi );
|
||||
|
@ -80,8 +91,13 @@ typedef enum { DRAW_BALL, DRAW_BALL_SHADOW } DRAW_BALL_ENUM;
|
|||
typedef struct {float x; float y; float z;} vertex_t;
|
||||
|
||||
/* Global vars */
|
||||
int windowed_xpos, windowed_ypos, windowed_width, windowed_height;
|
||||
int width, height;
|
||||
GLfloat deg_rot_y = 0.f;
|
||||
GLfloat deg_rot_y_inc = 2.f;
|
||||
int override_pos = GLFW_FALSE;
|
||||
GLfloat cursor_x = 0.f;
|
||||
GLfloat cursor_y = 0.f;
|
||||
GLfloat ball_x = -RADIUS;
|
||||
GLfloat ball_y = -RADIUS;
|
||||
GLfloat ball_x_inc = 1.f;
|
||||
|
@ -96,11 +112,6 @@ double dt;
|
|||
#define RAND_MAX 4095
|
||||
#endif
|
||||
|
||||
/* PI */
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.1415926535897932384626433832795
|
||||
#endif
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Truncate a degree.
|
||||
|
@ -156,33 +167,11 @@ void CrossProduct( vertex_t a, vertex_t b, vertex_t c, vertex_t *n )
|
|||
v2 = c.y - a.y;
|
||||
v3 = c.z - a.z;
|
||||
|
||||
n->x = u2 * v3 - v2 * v3;
|
||||
n->x = u2 * v3 - v2 * u3;
|
||||
n->y = u3 * v1 - v3 * u1;
|
||||
n->z = u1 * v2 - v1 * u2;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* Calculate the angle to be passed to gluPerspective() so that a scene
|
||||
* is visible. This function originates from the OpenGL Red Book.
|
||||
*
|
||||
* Parms : size
|
||||
* The size of the segment when the angle is intersected at "dist"
|
||||
* (ie at the outermost edge of the angle of vision).
|
||||
*
|
||||
* dist
|
||||
* Distance from viewpoint to scene.
|
||||
*****************************************************************************/
|
||||
GLfloat PerspectiveAngle( GLfloat size,
|
||||
GLfloat dist )
|
||||
{
|
||||
GLfloat radTheta, degTheta;
|
||||
|
||||
radTheta = 2.f * (GLfloat) atan2( size / 2.f, dist );
|
||||
degTheta = (180.f * radTheta) / (GLfloat) M_PI;
|
||||
return degTheta;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#define BOING_DEBUG 0
|
||||
|
||||
|
@ -227,28 +216,86 @@ void display(void)
|
|||
*****************************************************************************/
|
||||
void reshape( GLFWwindow* window, int w, int h )
|
||||
{
|
||||
mat4x4 projection, view;
|
||||
|
||||
glViewport( 0, 0, (GLsizei)w, (GLsizei)h );
|
||||
|
||||
glMatrixMode( GL_PROJECTION );
|
||||
glLoadIdentity();
|
||||
|
||||
gluPerspective( PerspectiveAngle( RADIUS * 2, 200 ),
|
||||
(GLfloat)w / (GLfloat)h,
|
||||
1.0,
|
||||
VIEW_SCENE_DIST );
|
||||
mat4x4_perspective( projection,
|
||||
2.f * (float) atan2( RADIUS, 200.f ),
|
||||
(float)w / (float)h,
|
||||
1.f, VIEW_SCENE_DIST );
|
||||
glLoadMatrixf((const GLfloat*) projection);
|
||||
|
||||
glMatrixMode( GL_MODELVIEW );
|
||||
glLoadIdentity();
|
||||
|
||||
gluLookAt( 0.0, 0.0, VIEW_SCENE_DIST,/* eye */
|
||||
0.0, 0.0, 0.0, /* center of vision */
|
||||
0.0, -1.0, 0.0 ); /* up vector */
|
||||
{
|
||||
vec3 eye = { 0.f, 0.f, VIEW_SCENE_DIST };
|
||||
vec3 center = { 0.f, 0.f, 0.f };
|
||||
vec3 up = { 0.f, -1.f, 0.f };
|
||||
mat4x4_look_at( view, eye, center, up );
|
||||
}
|
||||
glLoadMatrixf((const GLfloat*) view);
|
||||
}
|
||||
|
||||
void key_callback( GLFWwindow* window, int key, int scancode, int action, int mods )
|
||||
{
|
||||
if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
|
||||
glfwSetWindowShouldClose(window, GL_TRUE);
|
||||
if (action != GLFW_PRESS)
|
||||
return;
|
||||
|
||||
if (key == GLFW_KEY_ESCAPE && mods == 0)
|
||||
glfwSetWindowShouldClose(window, GLFW_TRUE);
|
||||
if ((key == GLFW_KEY_ENTER && mods == GLFW_MOD_ALT) ||
|
||||
(key == GLFW_KEY_F11 && mods == GLFW_MOD_ALT))
|
||||
{
|
||||
if (glfwGetWindowMonitor(window))
|
||||
{
|
||||
glfwSetWindowMonitor(window, NULL,
|
||||
windowed_xpos, windowed_ypos,
|
||||
windowed_width, windowed_height, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
GLFWmonitor* monitor = glfwGetPrimaryMonitor();
|
||||
if (monitor)
|
||||
{
|
||||
const GLFWvidmode* mode = glfwGetVideoMode(monitor);
|
||||
glfwGetWindowPos(window, &windowed_xpos, &windowed_ypos);
|
||||
glfwGetWindowSize(window, &windowed_width, &windowed_height);
|
||||
glfwSetWindowMonitor(window, monitor, 0, 0, mode->width, mode->height, mode->refreshRate);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void set_ball_pos ( GLfloat x, GLfloat y )
|
||||
{
|
||||
ball_x = (width / 2) - x;
|
||||
ball_y = y - (height / 2);
|
||||
}
|
||||
|
||||
void mouse_button_callback( GLFWwindow* window, int button, int action, int mods )
|
||||
{
|
||||
if (button != GLFW_MOUSE_BUTTON_LEFT)
|
||||
return;
|
||||
|
||||
if (action == GLFW_PRESS)
|
||||
{
|
||||
override_pos = GLFW_TRUE;
|
||||
set_ball_pos(cursor_x, cursor_y);
|
||||
}
|
||||
else
|
||||
{
|
||||
override_pos = GLFW_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
void cursor_position_callback( GLFWwindow* window, double x, double y )
|
||||
{
|
||||
cursor_x = (float) x;
|
||||
cursor_y = (float) y;
|
||||
|
||||
if ( override_pos )
|
||||
set_ball_pos(cursor_x, cursor_y);
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
|
@ -257,7 +304,7 @@ void key_callback( GLFWwindow* window, int key, int scancode, int action, int mo
|
|||
* The Boing ball is sphere in which each facet is a rectangle.
|
||||
* Facet colors alternate between red and white.
|
||||
* The ball is built by stacking latitudinal circles. Each circle is composed
|
||||
* of a widely-separated set of points, so that each facet is noticably large.
|
||||
* of a widely-separated set of points, so that each facet is noticeably large.
|
||||
*****************************************************************************/
|
||||
void DrawBoingBall( void )
|
||||
{
|
||||
|
@ -341,6 +388,9 @@ void BounceBall( double delta_t )
|
|||
GLfloat sign;
|
||||
GLfloat deg;
|
||||
|
||||
if ( override_pos )
|
||||
return;
|
||||
|
||||
/* Bounce on walls */
|
||||
if ( ball_x > (BOUNCE_WIDTH/2 + WALL_R_OFFSET ) )
|
||||
{
|
||||
|
@ -398,7 +448,7 @@ void DrawBoingBallBand( GLfloat long_lo,
|
|||
static int colorToggle = 0;
|
||||
|
||||
/*
|
||||
* Iterate thru the points of a latitude circle.
|
||||
* Iterate through the points of a latitude circle.
|
||||
* A latitude circle is a 2D set of X,Z points.
|
||||
*/
|
||||
for ( lat_deg = 0;
|
||||
|
@ -574,14 +624,11 @@ void DrawGrid( void )
|
|||
int main( void )
|
||||
{
|
||||
GLFWwindow* window;
|
||||
int width, height;
|
||||
|
||||
/* Init GLFW */
|
||||
if( !glfwInit() )
|
||||
exit( EXIT_FAILURE );
|
||||
|
||||
glfwWindowHint(GLFW_DEPTH_BITS, 16);
|
||||
|
||||
window = glfwCreateWindow( 400, 400, "Boing (classic Amiga demo)", NULL, NULL );
|
||||
if (!window)
|
||||
{
|
||||
|
@ -589,10 +636,15 @@ int main( void )
|
|||
exit( EXIT_FAILURE );
|
||||
}
|
||||
|
||||
glfwSetWindowAspectRatio(window, 1, 1);
|
||||
|
||||
glfwSetFramebufferSizeCallback(window, reshape);
|
||||
glfwSetKeyCallback(window, key_callback);
|
||||
glfwSetMouseButtonCallback(window, mouse_button_callback);
|
||||
glfwSetCursorPosCallback(window, cursor_position_callback);
|
||||
|
||||
glfwMakeContextCurrent(window);
|
||||
gladLoadGL(glfwGetProcAddress);
|
||||
glfwSwapInterval( 1 );
|
||||
|
||||
glfwGetFramebufferSize(window, &width, &height);
|
||||
|
|
|
@ -15,27 +15,27 @@
|
|||
* - Slightly modified camera that should work better for stereo viewing
|
||||
*
|
||||
*
|
||||
* Camilla Berglund:
|
||||
* Camilla Löwy:
|
||||
* - Removed FPS counter (this is not a benchmark)
|
||||
* - Added a few comments
|
||||
* - Enabled vsync
|
||||
*/
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
// Make MS math.h define M_PI
|
||||
#define _USE_MATH_DEFINES
|
||||
#endif
|
||||
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#define GLAD_GL_IMPLEMENTATION
|
||||
#include <glad/gl.h>
|
||||
#define GLFW_INCLUDE_NONE
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.141592654
|
||||
#endif
|
||||
|
||||
/* If non-zero, the program exits after that many seconds
|
||||
*/
|
||||
static int autoexit = 0;
|
||||
|
||||
/**
|
||||
|
||||
Draw a gear wheel. You'll probably want to call this function when
|
||||
|
@ -174,6 +174,7 @@ static GLfloat angle = 0.f;
|
|||
/* OpenGL draw function & timing */
|
||||
static void draw(void)
|
||||
{
|
||||
glClearColor(0.0, 0.0, 0.0, 0.0);
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
glPushMatrix();
|
||||
|
@ -223,7 +224,7 @@ void key( GLFWwindow* window, int k, int s, int action, int mods )
|
|||
view_rotz += 5.0;
|
||||
break;
|
||||
case GLFW_KEY_ESCAPE:
|
||||
glfwSetWindowShouldClose(window, GL_TRUE);
|
||||
glfwSetWindowShouldClose(window, GLFW_TRUE);
|
||||
break;
|
||||
case GLFW_KEY_UP:
|
||||
view_rotx += 5.0;
|
||||
|
@ -264,13 +265,12 @@ void reshape( GLFWwindow* window, int width, int height )
|
|||
|
||||
|
||||
/* program & OpenGL initialization */
|
||||
static void init(int argc, char *argv[])
|
||||
static void init(void)
|
||||
{
|
||||
static GLfloat pos[4] = {5.f, 5.f, 10.f, 0.f};
|
||||
static GLfloat red[4] = {0.8f, 0.1f, 0.f, 1.f};
|
||||
static GLfloat green[4] = {0.f, 0.8f, 0.2f, 1.f};
|
||||
static GLfloat blue[4] = {0.2f, 0.2f, 1.f, 1.f};
|
||||
GLint i;
|
||||
|
||||
glLightfv(GL_LIGHT0, GL_POSITION, pos);
|
||||
glEnable(GL_CULL_FACE);
|
||||
|
@ -298,19 +298,6 @@ static void init(int argc, char *argv[])
|
|||
glEndList();
|
||||
|
||||
glEnable(GL_NORMALIZE);
|
||||
|
||||
for ( i=1; i<argc; i++ ) {
|
||||
if (strcmp(argv[i], "-info")==0) {
|
||||
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
|
||||
printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
|
||||
printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
|
||||
printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS));
|
||||
}
|
||||
else if ( strcmp(argv[i], "-exit")==0) {
|
||||
autoexit = 30;
|
||||
printf("Auto Exit after %i seconds.\n", autoexit );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -327,6 +314,7 @@ int main(int argc, char *argv[])
|
|||
}
|
||||
|
||||
glfwWindowHint(GLFW_DEPTH_BITS, 16);
|
||||
glfwWindowHint(GLFW_TRANSPARENT_FRAMEBUFFER, GLFW_TRUE);
|
||||
|
||||
window = glfwCreateWindow( 300, 300, "Gears", NULL, NULL );
|
||||
if (!window)
|
||||
|
@ -341,13 +329,14 @@ int main(int argc, char *argv[])
|
|||
glfwSetKeyCallback(window, key);
|
||||
|
||||
glfwMakeContextCurrent(window);
|
||||
gladLoadGL(glfwGetProcAddress);
|
||||
glfwSwapInterval( 1 );
|
||||
|
||||
glfwGetFramebufferSize(window, &width, &height);
|
||||
reshape(window, width, height);
|
||||
|
||||
// Parse command-line options
|
||||
init(argc, argv);
|
||||
init();
|
||||
|
||||
// Main loop
|
||||
while( !glfwWindowShouldClose(window) )
|
||||
|
|
BIN
examples/glfw.icns
Normal file
BIN
examples/glfw.icns
Normal file
Binary file not shown.
BIN
examples/glfw.ico
Normal file
BIN
examples/glfw.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 21 KiB |
3
examples/glfw.rc
Normal file
3
examples/glfw.rc
Normal file
|
@ -0,0 +1,3 @@
|
|||
|
||||
GLFW_ICON ICON "glfw.ico"
|
||||
|
|
@ -28,37 +28,11 @@
|
|||
#include <math.h>
|
||||
#include <assert.h>
|
||||
#include <stddef.h>
|
||||
#include "getopt.h"
|
||||
|
||||
#define GLAD_GL_IMPLEMENTATION
|
||||
#include <glad/gl.h>
|
||||
#define GLFW_INCLUDE_NONE
|
||||
#include <GLFW/glfw3.h>
|
||||
#include <GL/glext.h>
|
||||
|
||||
/* OpenGL function pointers */
|
||||
static PFNGLGENBUFFERSPROC pglGenBuffers = NULL;
|
||||
static PFNGLGENVERTEXARRAYSPROC pglGenVertexArrays = NULL;
|
||||
static PFNGLDELETEVERTEXARRAYSPROC pglDeleteVertexArrays = NULL;
|
||||
static PFNGLCREATESHADERPROC pglCreateShader = NULL;
|
||||
static PFNGLSHADERSOURCEPROC pglShaderSource = NULL;
|
||||
static PFNGLCOMPILESHADERPROC pglCompileShader = NULL;
|
||||
static PFNGLGETSHADERIVPROC pglGetShaderiv = NULL;
|
||||
static PFNGLGETSHADERINFOLOGPROC pglGetShaderInfoLog = NULL;
|
||||
static PFNGLDELETESHADERPROC pglDeleteShader = NULL;
|
||||
static PFNGLCREATEPROGRAMPROC pglCreateProgram = NULL;
|
||||
static PFNGLATTACHSHADERPROC pglAttachShader = NULL;
|
||||
static PFNGLLINKPROGRAMPROC pglLinkProgram = NULL;
|
||||
static PFNGLUSEPROGRAMPROC pglUseProgram = NULL;
|
||||
static PFNGLGETPROGRAMIVPROC pglGetProgramiv = NULL;
|
||||
static PFNGLGETPROGRAMINFOLOGPROC pglGetProgramInfoLog = NULL;
|
||||
static PFNGLDELETEPROGRAMPROC pglDeleteProgram = NULL;
|
||||
static PFNGLGETUNIFORMLOCATIONPROC pglGetUniformLocation = NULL;
|
||||
static PFNGLUNIFORMMATRIX4FVPROC pglUniformMatrix4fv = NULL;
|
||||
static PFNGLGETATTRIBLOCATIONPROC pglGetAttribLocation = NULL;
|
||||
static PFNGLBINDVERTEXARRAYPROC pglBindVertexArray = NULL;
|
||||
static PFNGLBUFFERDATAPROC pglBufferData = NULL;
|
||||
static PFNGLBINDBUFFERPROC pglBindBuffer = NULL;
|
||||
static PFNGLBUFFERSUBDATAPROC pglBufferSubData = NULL;
|
||||
static PFNGLENABLEVERTEXATTRIBARRAYPROC pglEnableVertexAttribArray = NULL;
|
||||
static PFNGLVERTEXATTRIBPOINTERPROC pglVertexAttribPointer = NULL;
|
||||
|
||||
/* Map height updates */
|
||||
#define MAX_CIRCLE_SIZE (5.0f)
|
||||
|
@ -75,54 +49,11 @@ static PFNGLVERTEXATTRIBPOINTERPROC pglVertexAttribPointer = NULL;
|
|||
2 * (MAP_NUM_VERTICES - 1))
|
||||
|
||||
|
||||
/* OpenGL function pointers */
|
||||
|
||||
#define RESOLVE_GL_FCN(type, var, name) \
|
||||
if (status == GL_TRUE) \
|
||||
{\
|
||||
var = (type) glfwGetProcAddress((name));\
|
||||
if ((var) == NULL)\
|
||||
{\
|
||||
status = GL_FALSE;\
|
||||
}\
|
||||
}
|
||||
|
||||
|
||||
static GLboolean init_opengl(void)
|
||||
{
|
||||
GLboolean status = GL_TRUE;
|
||||
RESOLVE_GL_FCN(PFNGLCREATESHADERPROC, pglCreateShader, "glCreateShader");
|
||||
RESOLVE_GL_FCN(PFNGLSHADERSOURCEPROC, pglShaderSource, "glShaderSource");
|
||||
RESOLVE_GL_FCN(PFNGLCOMPILESHADERPROC, pglCompileShader, "glCompileShader");
|
||||
RESOLVE_GL_FCN(PFNGLGETSHADERIVPROC, pglGetShaderiv, "glGetShaderiv");
|
||||
RESOLVE_GL_FCN(PFNGLGETSHADERINFOLOGPROC, pglGetShaderInfoLog, "glGetShaderInfoLog");
|
||||
RESOLVE_GL_FCN(PFNGLDELETESHADERPROC, pglDeleteShader, "glDeleteShader");
|
||||
RESOLVE_GL_FCN(PFNGLCREATEPROGRAMPROC, pglCreateProgram, "glCreateProgram");
|
||||
RESOLVE_GL_FCN(PFNGLATTACHSHADERPROC, pglAttachShader, "glAttachShader");
|
||||
RESOLVE_GL_FCN(PFNGLLINKPROGRAMPROC, pglLinkProgram, "glLinkProgram");
|
||||
RESOLVE_GL_FCN(PFNGLUSEPROGRAMPROC, pglUseProgram, "glUseProgram");
|
||||
RESOLVE_GL_FCN(PFNGLGETPROGRAMIVPROC, pglGetProgramiv, "glGetProgramiv");
|
||||
RESOLVE_GL_FCN(PFNGLGETPROGRAMINFOLOGPROC, pglGetProgramInfoLog, "glGetProgramInfoLog");
|
||||
RESOLVE_GL_FCN(PFNGLDELETEPROGRAMPROC, pglDeleteProgram, "glDeleteProgram");
|
||||
RESOLVE_GL_FCN(PFNGLGETUNIFORMLOCATIONPROC, pglGetUniformLocation, "glGetUniformLocation");
|
||||
RESOLVE_GL_FCN(PFNGLUNIFORMMATRIX4FVPROC, pglUniformMatrix4fv, "glUniformMatrix4fv");
|
||||
RESOLVE_GL_FCN(PFNGLGETATTRIBLOCATIONPROC, pglGetAttribLocation, "glGetAttribLocation");
|
||||
RESOLVE_GL_FCN(PFNGLGENVERTEXARRAYSPROC, pglGenVertexArrays, "glGenVertexArrays");
|
||||
RESOLVE_GL_FCN(PFNGLDELETEVERTEXARRAYSPROC, pglDeleteVertexArrays, "glDeleteVertexArrays");
|
||||
RESOLVE_GL_FCN(PFNGLBINDVERTEXARRAYPROC, pglBindVertexArray, "glBindVertexArray");
|
||||
RESOLVE_GL_FCN(PFNGLGENBUFFERSPROC, pglGenBuffers, "glGenBuffers");
|
||||
RESOLVE_GL_FCN(PFNGLBINDBUFFERPROC, pglBindBuffer, "glBindBuffer");
|
||||
RESOLVE_GL_FCN(PFNGLBUFFERDATAPROC, pglBufferData, "glBufferData");
|
||||
RESOLVE_GL_FCN(PFNGLBUFFERSUBDATAPROC, pglBufferSubData, "glBufferSubData");
|
||||
RESOLVE_GL_FCN(PFNGLENABLEVERTEXATTRIBARRAYPROC, pglEnableVertexAttribArray, "glEnableVertexAttribArray");
|
||||
RESOLVE_GL_FCN(PFNGLVERTEXATTRIBPOINTERPROC, pglVertexAttribPointer, "glVertexAttribPointer");
|
||||
return status;
|
||||
}
|
||||
/**********************************************************************
|
||||
* Default shader programs
|
||||
*********************************************************************/
|
||||
|
||||
static const char* default_vertex_shader =
|
||||
static const char* vertex_shader_text =
|
||||
"#version 150\n"
|
||||
"uniform mat4 project;\n"
|
||||
"uniform mat4 modelview;\n"
|
||||
|
@ -135,12 +66,12 @@ static const char* default_vertex_shader =
|
|||
" gl_Position = project * modelview * vec4(x, y, z, 1.0);\n"
|
||||
"}\n";
|
||||
|
||||
static const char* default_fragment_shader =
|
||||
static const char* fragment_shader_text =
|
||||
"#version 150\n"
|
||||
"out vec4 gl_FragColor;\n"
|
||||
"out vec4 color;\n"
|
||||
"void main()\n"
|
||||
"{\n"
|
||||
" gl_FragColor = vec4(0.2, 1.0, 0.2, 1.0); \n"
|
||||
" color = vec4(0.2, 1.0, 0.2, 1.0); \n"
|
||||
"}\n";
|
||||
|
||||
/**********************************************************************
|
||||
|
@ -188,53 +119,27 @@ static GLuint mesh_vbo[4];
|
|||
* OpenGL helper functions
|
||||
*********************************************************************/
|
||||
|
||||
/* Load a (text) file into memory and return its contents
|
||||
*/
|
||||
static char* read_file_content(const char* filename)
|
||||
{
|
||||
FILE* fd;
|
||||
size_t size = 0;
|
||||
char* result = NULL;
|
||||
|
||||
fd = fopen(filename, "r");
|
||||
if (fd != NULL)
|
||||
{
|
||||
size = fseek(fd, 0, SEEK_END);
|
||||
(void) fseek(fd, 0, SEEK_SET);
|
||||
|
||||
result = malloc(size + 1);
|
||||
result[size] = '\0';
|
||||
if (fread(result, size, 1, fd) != 1)
|
||||
{
|
||||
free(result);
|
||||
result = NULL;
|
||||
}
|
||||
(void) fclose(fd);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/* Creates a shader object of the specified type using the specified text
|
||||
*/
|
||||
static GLuint make_shader(GLenum type, const char* shader_src)
|
||||
static GLuint make_shader(GLenum type, const char* text)
|
||||
{
|
||||
GLuint shader;
|
||||
GLint shader_ok;
|
||||
GLsizei log_length;
|
||||
char info_log[8192];
|
||||
|
||||
shader = pglCreateShader(type);
|
||||
shader = glCreateShader(type);
|
||||
if (shader != 0)
|
||||
{
|
||||
pglShaderSource(shader, 1, (const GLchar**)&shader_src, NULL);
|
||||
pglCompileShader(shader);
|
||||
pglGetShaderiv(shader, GL_COMPILE_STATUS, &shader_ok);
|
||||
glShaderSource(shader, 1, (const GLchar**)&text, NULL);
|
||||
glCompileShader(shader);
|
||||
glGetShaderiv(shader, GL_COMPILE_STATUS, &shader_ok);
|
||||
if (shader_ok != GL_TRUE)
|
||||
{
|
||||
fprintf(stderr, "ERROR: Failed to compile %s shader\n", (type == GL_FRAGMENT_SHADER) ? "fragment" : "vertex" );
|
||||
pglGetShaderInfoLog(shader, 8192, &log_length,info_log);
|
||||
glGetShaderInfoLog(shader, 8192, &log_length,info_log);
|
||||
fprintf(stderr, "ERROR: \n%s\n\n", info_log);
|
||||
pglDeleteShader(shader);
|
||||
glDeleteShader(shader);
|
||||
shader = 0;
|
||||
}
|
||||
}
|
||||
|
@ -243,7 +148,7 @@ static GLuint make_shader(GLenum type, const char* shader_src)
|
|||
|
||||
/* Creates a program object using the specified vertex and fragment text
|
||||
*/
|
||||
static GLuint make_shader_program(const char* vertex_shader_src, const char* fragment_shader_src)
|
||||
static GLuint make_shader_program(const char* vs_text, const char* fs_text)
|
||||
{
|
||||
GLuint program = 0u;
|
||||
GLint program_ok;
|
||||
|
@ -252,30 +157,30 @@ static GLuint make_shader_program(const char* vertex_shader_src, const char* fra
|
|||
GLsizei log_length;
|
||||
char info_log[8192];
|
||||
|
||||
vertex_shader = make_shader(GL_VERTEX_SHADER, (vertex_shader_src == NULL) ? default_vertex_shader : vertex_shader_src);
|
||||
vertex_shader = make_shader(GL_VERTEX_SHADER, vs_text);
|
||||
if (vertex_shader != 0u)
|
||||
{
|
||||
fragment_shader = make_shader(GL_FRAGMENT_SHADER, (fragment_shader_src == NULL) ? default_fragment_shader : fragment_shader_src);
|
||||
fragment_shader = make_shader(GL_FRAGMENT_SHADER, fs_text);
|
||||
if (fragment_shader != 0u)
|
||||
{
|
||||
/* make the program that connect the two shader and link it */
|
||||
program = pglCreateProgram();
|
||||
program = glCreateProgram();
|
||||
if (program != 0u)
|
||||
{
|
||||
/* attach both shader and link */
|
||||
pglAttachShader(program, vertex_shader);
|
||||
pglAttachShader(program, fragment_shader);
|
||||
pglLinkProgram(program);
|
||||
pglGetProgramiv(program, GL_LINK_STATUS, &program_ok);
|
||||
glAttachShader(program, vertex_shader);
|
||||
glAttachShader(program, fragment_shader);
|
||||
glLinkProgram(program);
|
||||
glGetProgramiv(program, GL_LINK_STATUS, &program_ok);
|
||||
|
||||
if (program_ok != GL_TRUE)
|
||||
{
|
||||
fprintf(stderr, "ERROR, failed to link shader program\n");
|
||||
pglGetProgramInfoLog(program, 8192, &log_length, info_log);
|
||||
glGetProgramInfoLog(program, 8192, &log_length, info_log);
|
||||
fprintf(stderr, "ERROR: \n%s\n\n", info_log);
|
||||
pglDeleteProgram(program);
|
||||
pglDeleteShader(fragment_shader);
|
||||
pglDeleteShader(vertex_shader);
|
||||
glDeleteProgram(program);
|
||||
glDeleteShader(fragment_shader);
|
||||
glDeleteShader(vertex_shader);
|
||||
program = 0u;
|
||||
}
|
||||
}
|
||||
|
@ -283,7 +188,7 @@ static GLuint make_shader_program(const char* vertex_shader_src, const char* fra
|
|||
else
|
||||
{
|
||||
fprintf(stderr, "ERROR: Unable to load fragment shader\n");
|
||||
pglDeleteShader(vertex_shader);
|
||||
glDeleteShader(vertex_shader);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -388,12 +293,12 @@ static void generate_heightmap__circle(float* center_x, float* center_y,
|
|||
{
|
||||
float sign;
|
||||
/* random value for element in between [0-1.0] */
|
||||
*center_x = (MAP_SIZE * rand()) / (1.0f * RAND_MAX);
|
||||
*center_y = (MAP_SIZE * rand()) / (1.0f * RAND_MAX);
|
||||
*size = (MAX_CIRCLE_SIZE * rand()) / (1.0f * RAND_MAX);
|
||||
sign = (1.0f * rand()) / (1.0f * RAND_MAX);
|
||||
*center_x = (MAP_SIZE * rand()) / (float) RAND_MAX;
|
||||
*center_y = (MAP_SIZE * rand()) / (float) RAND_MAX;
|
||||
*size = (MAX_CIRCLE_SIZE * rand()) / (float) RAND_MAX;
|
||||
sign = (1.0f * rand()) / (float) RAND_MAX;
|
||||
sign = (sign < DISPLACEMENT_SIGN_LIMIT) ? -1.0f : 1.0f;
|
||||
*displacement = (sign * (MAX_DISPLACEMENT * rand())) / (1.0f * RAND_MAX);
|
||||
*displacement = (sign * (MAX_DISPLACEMENT * rand())) / (float) RAND_MAX;
|
||||
}
|
||||
|
||||
/* Run the specified number of iterations of the generation process for the
|
||||
|
@ -416,7 +321,7 @@ static void update_map(int num_iter)
|
|||
{
|
||||
GLfloat dx = center_x - map_vertices[0][ii];
|
||||
GLfloat dz = center_z - map_vertices[2][ii];
|
||||
GLfloat pd = (2.0f * sqrtf((dx * dx) + (dz * dz))) / circle_size;
|
||||
GLfloat pd = (2.0f * (float) sqrt((dx * dx) + (dz * dz))) / circle_size;
|
||||
if (fabs(pd) <= 1.0f)
|
||||
{
|
||||
/* tx,tz is within the circle */
|
||||
|
@ -439,38 +344,38 @@ static void make_mesh(GLuint program)
|
|||
{
|
||||
GLuint attrloc;
|
||||
|
||||
pglGenVertexArrays(1, &mesh);
|
||||
pglGenBuffers(4, mesh_vbo);
|
||||
pglBindVertexArray(mesh);
|
||||
glGenVertexArrays(1, &mesh);
|
||||
glGenBuffers(4, mesh_vbo);
|
||||
glBindVertexArray(mesh);
|
||||
/* Prepare the data for drawing through a buffer inidices */
|
||||
pglBindBuffer(GL_ELEMENT_ARRAY_BUFFER, mesh_vbo[3]);
|
||||
pglBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(GLuint)* MAP_NUM_LINES * 2, map_line_indices, GL_STATIC_DRAW);
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, mesh_vbo[3]);
|
||||
glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(GLuint)* MAP_NUM_LINES * 2, map_line_indices, GL_STATIC_DRAW);
|
||||
|
||||
/* Prepare the attributes for rendering */
|
||||
attrloc = pglGetAttribLocation(program, "x");
|
||||
pglBindBuffer(GL_ARRAY_BUFFER, mesh_vbo[0]);
|
||||
pglBufferData(GL_ARRAY_BUFFER, sizeof(GLfloat) * MAP_NUM_TOTAL_VERTICES, &map_vertices[0][0], GL_STATIC_DRAW);
|
||||
pglEnableVertexAttribArray(attrloc);
|
||||
pglVertexAttribPointer(attrloc, 1, GL_FLOAT, GL_FALSE, 0, 0);
|
||||
attrloc = glGetAttribLocation(program, "x");
|
||||
glBindBuffer(GL_ARRAY_BUFFER, mesh_vbo[0]);
|
||||
glBufferData(GL_ARRAY_BUFFER, sizeof(GLfloat) * MAP_NUM_TOTAL_VERTICES, &map_vertices[0][0], GL_STATIC_DRAW);
|
||||
glEnableVertexAttribArray(attrloc);
|
||||
glVertexAttribPointer(attrloc, 1, GL_FLOAT, GL_FALSE, 0, 0);
|
||||
|
||||
attrloc = pglGetAttribLocation(program, "z");
|
||||
pglBindBuffer(GL_ARRAY_BUFFER, mesh_vbo[2]);
|
||||
pglBufferData(GL_ARRAY_BUFFER, sizeof(GLfloat) * MAP_NUM_TOTAL_VERTICES, &map_vertices[2][0], GL_STATIC_DRAW);
|
||||
pglEnableVertexAttribArray(attrloc);
|
||||
pglVertexAttribPointer(attrloc, 1, GL_FLOAT, GL_FALSE, 0, 0);
|
||||
attrloc = glGetAttribLocation(program, "z");
|
||||
glBindBuffer(GL_ARRAY_BUFFER, mesh_vbo[2]);
|
||||
glBufferData(GL_ARRAY_BUFFER, sizeof(GLfloat) * MAP_NUM_TOTAL_VERTICES, &map_vertices[2][0], GL_STATIC_DRAW);
|
||||
glEnableVertexAttribArray(attrloc);
|
||||
glVertexAttribPointer(attrloc, 1, GL_FLOAT, GL_FALSE, 0, 0);
|
||||
|
||||
attrloc = pglGetAttribLocation(program, "y");
|
||||
pglBindBuffer(GL_ARRAY_BUFFER, mesh_vbo[1]);
|
||||
pglBufferData(GL_ARRAY_BUFFER, sizeof(GLfloat) * MAP_NUM_TOTAL_VERTICES, &map_vertices[1][0], GL_DYNAMIC_DRAW);
|
||||
pglEnableVertexAttribArray(attrloc);
|
||||
pglVertexAttribPointer(attrloc, 1, GL_FLOAT, GL_FALSE, 0, 0);
|
||||
attrloc = glGetAttribLocation(program, "y");
|
||||
glBindBuffer(GL_ARRAY_BUFFER, mesh_vbo[1]);
|
||||
glBufferData(GL_ARRAY_BUFFER, sizeof(GLfloat) * MAP_NUM_TOTAL_VERTICES, &map_vertices[1][0], GL_DYNAMIC_DRAW);
|
||||
glEnableVertexAttribArray(attrloc);
|
||||
glVertexAttribPointer(attrloc, 1, GL_FLOAT, GL_FALSE, 0, 0);
|
||||
}
|
||||
|
||||
/* Update VBO vertices from source data
|
||||
*/
|
||||
static void update_mesh(void)
|
||||
{
|
||||
pglBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(GLfloat) * MAP_NUM_TOTAL_VERTICES, &map_vertices[1][0]);
|
||||
glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(GLfloat) * MAP_NUM_TOTAL_VERTICES, &map_vertices[1][0]);
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
|
@ -483,103 +388,44 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action,
|
|||
{
|
||||
case GLFW_KEY_ESCAPE:
|
||||
/* Exit program on Escape */
|
||||
glfwSetWindowShouldClose(window, GL_TRUE);
|
||||
glfwSetWindowShouldClose(window, GLFW_TRUE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Print usage information */
|
||||
static void usage(void)
|
||||
static void error_callback(int error, const char* description)
|
||||
{
|
||||
printf("Usage: heightmap [-v <vertex_shader_path>] [-f <fragment_shader_path>]\n");
|
||||
printf(" heightmap [-h]\n");
|
||||
fprintf(stderr, "Error: %s\n", description);
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
GLFWwindow* window;
|
||||
int ch, iter;
|
||||
int iter;
|
||||
double dt;
|
||||
double last_update_time;
|
||||
int frame;
|
||||
float f;
|
||||
GLint uloc_modelview;
|
||||
GLint uloc_project;
|
||||
int width, height;
|
||||
|
||||
char* vertex_shader_path = NULL;
|
||||
char* fragment_shader_path = NULL;
|
||||
char* vertex_shader_src = NULL;
|
||||
char* fragment_shader_src = NULL;
|
||||
GLuint shader_program;
|
||||
|
||||
while ((ch = getopt(argc, argv, "f:v:h")) != -1)
|
||||
{
|
||||
switch (ch)
|
||||
{
|
||||
case 'f':
|
||||
fragment_shader_path = optarg;
|
||||
break;
|
||||
case 'v':
|
||||
vertex_shader_path = optarg;
|
||||
break;
|
||||
case 'h':
|
||||
usage();
|
||||
exit(EXIT_SUCCESS);
|
||||
default:
|
||||
usage();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
if (fragment_shader_path)
|
||||
{
|
||||
vertex_shader_src = read_file_content(fragment_shader_path);
|
||||
if (!fragment_shader_src)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"ERROR: unable to load fragment shader from '%s'\n",
|
||||
fragment_shader_path);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
if (vertex_shader_path)
|
||||
{
|
||||
vertex_shader_src = read_file_content(vertex_shader_path);
|
||||
if (!vertex_shader_src)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"ERROR: unable to load vertex shader from '%s'\n",
|
||||
fragment_shader_path);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
glfwSetErrorCallback(error_callback);
|
||||
|
||||
if (!glfwInit())
|
||||
{
|
||||
fprintf(stderr, "ERROR: Unable to initialize GLFW\n");
|
||||
usage();
|
||||
|
||||
free(vertex_shader_src);
|
||||
free(fragment_shader_src);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
glfwWindowHint(GLFW_RESIZABLE, GL_FALSE);
|
||||
glfwWindowHint(GLFW_RESIZABLE, GLFW_FALSE);
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
|
||||
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
|
||||
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_FALSE);
|
||||
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GLFW_TRUE);
|
||||
|
||||
window = glfwCreateWindow(800, 600, "GLFW OpenGL3 Heightmap demo", NULL, NULL);
|
||||
if (! window )
|
||||
{
|
||||
fprintf(stderr, "ERROR: Unable to create the OpenGL context and associated window\n");
|
||||
usage();
|
||||
|
||||
free(vertex_shader_src);
|
||||
free(fragment_shader_src);
|
||||
|
||||
glfwTerminate();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
@ -588,32 +434,20 @@ int main(int argc, char** argv)
|
|||
glfwSetKeyCallback(window, key_callback);
|
||||
|
||||
glfwMakeContextCurrent(window);
|
||||
if (GL_TRUE != init_opengl())
|
||||
{
|
||||
fprintf(stderr, "ERROR: unable to resolve OpenGL function pointers\n");
|
||||
free(vertex_shader_src);
|
||||
free(fragment_shader_src);
|
||||
gladLoadGL(glfwGetProcAddress);
|
||||
|
||||
glfwTerminate();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
/* Prepare opengl resources for rendering */
|
||||
shader_program = make_shader_program(vertex_shader_src , fragment_shader_src);
|
||||
free(vertex_shader_src);
|
||||
free(fragment_shader_src);
|
||||
shader_program = make_shader_program(vertex_shader_text, fragment_shader_text);
|
||||
|
||||
if (shader_program == 0u)
|
||||
{
|
||||
fprintf(stderr, "ERROR: during creation of the shader program\n");
|
||||
usage();
|
||||
|
||||
glfwTerminate();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
pglUseProgram(shader_program);
|
||||
uloc_project = pglGetUniformLocation(shader_program, "project");
|
||||
uloc_modelview = pglGetUniformLocation(shader_program, "modelview");
|
||||
glUseProgram(shader_program);
|
||||
uloc_project = glGetUniformLocation(shader_program, "project");
|
||||
uloc_modelview = glGetUniformLocation(shader_program, "modelview");
|
||||
|
||||
/* Compute the projection matrix */
|
||||
f = 1.0f / tanf(view_angle / 2.0f);
|
||||
|
@ -622,13 +456,13 @@ int main(int argc, char** argv)
|
|||
projection_matrix[10] = (z_far + z_near)/ (z_near - z_far);
|
||||
projection_matrix[11] = -1.0f;
|
||||
projection_matrix[14] = 2.0f * (z_far * z_near) / (z_near - z_far);
|
||||
pglUniformMatrix4fv(uloc_project, 1, GL_FALSE, projection_matrix);
|
||||
glUniformMatrix4fv(uloc_project, 1, GL_FALSE, projection_matrix);
|
||||
|
||||
/* Set the camera position */
|
||||
modelview_matrix[12] = -5.0f;
|
||||
modelview_matrix[13] = -5.0f;
|
||||
modelview_matrix[14] = -20.0f;
|
||||
pglUniformMatrix4fv(uloc_modelview, 1, GL_FALSE, modelview_matrix);
|
||||
glUniformMatrix4fv(uloc_modelview, 1, GL_FALSE, modelview_matrix);
|
||||
|
||||
/* Create mesh data */
|
||||
init_map();
|
||||
|
@ -638,13 +472,14 @@ int main(int argc, char** argv)
|
|||
/* Create the vbo to store all the information for the grid and the height */
|
||||
|
||||
/* setup the scene ready for rendering */
|
||||
glViewport(0, 0, 800, 600);
|
||||
glfwGetFramebufferSize(window, &width, &height);
|
||||
glViewport(0, 0, width, height);
|
||||
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
|
||||
/* main loop */
|
||||
frame = 0;
|
||||
iter = 0;
|
||||
dt = last_update_time = glfwGetTime();
|
||||
last_update_time = glfwGetTime();
|
||||
|
||||
while (!glfwWindowShouldClose(window))
|
||||
{
|
||||
|
|
165
examples/offscreen.c
Normal file
165
examples/offscreen.c
Normal file
|
@ -0,0 +1,165 @@
|
|||
//========================================================================
|
||||
// Offscreen rendering example
|
||||
// Copyright (c) Camilla Löwy <elmindreda@glfw.org>
|
||||
//
|
||||
// This software is provided 'as-is', without any express or implied
|
||||
// warranty. In no event will the authors be held liable for any damages
|
||||
// arising from the use of this software.
|
||||
//
|
||||
// Permission is granted to anyone to use this software for any purpose,
|
||||
// including commercial applications, and to alter it and redistribute it
|
||||
// freely, subject to the following restrictions:
|
||||
//
|
||||
// 1. The origin of this software must not be misrepresented; you must not
|
||||
// claim that you wrote the original software. If you use this software
|
||||
// in a product, an acknowledgment in the product documentation would
|
||||
// be appreciated but is not required.
|
||||
//
|
||||
// 2. Altered source versions must be plainly marked as such, and must not
|
||||
// be misrepresented as being the original software.
|
||||
//
|
||||
// 3. This notice may not be removed or altered from any source
|
||||
// distribution.
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
#define GLAD_GL_IMPLEMENTATION
|
||||
#include <glad/gl.h>
|
||||
#define GLFW_INCLUDE_NONE
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
#include "linmath.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define STB_IMAGE_WRITE_IMPLEMENTATION
|
||||
#include <stb_image_write.h>
|
||||
|
||||
static const struct
|
||||
{
|
||||
float x, y;
|
||||
float r, g, b;
|
||||
} vertices[3] =
|
||||
{
|
||||
{ -0.6f, -0.4f, 1.f, 0.f, 0.f },
|
||||
{ 0.6f, -0.4f, 0.f, 1.f, 0.f },
|
||||
{ 0.f, 0.6f, 0.f, 0.f, 1.f }
|
||||
};
|
||||
|
||||
static const char* vertex_shader_text =
|
||||
"#version 110\n"
|
||||
"uniform mat4 MVP;\n"
|
||||
"attribute vec3 vCol;\n"
|
||||
"attribute vec2 vPos;\n"
|
||||
"varying vec3 color;\n"
|
||||
"void main()\n"
|
||||
"{\n"
|
||||
" gl_Position = MVP * vec4(vPos, 0.0, 1.0);\n"
|
||||
" color = vCol;\n"
|
||||
"}\n";
|
||||
|
||||
static const char* fragment_shader_text =
|
||||
"#version 110\n"
|
||||
"varying vec3 color;\n"
|
||||
"void main()\n"
|
||||
"{\n"
|
||||
" gl_FragColor = vec4(color, 1.0);\n"
|
||||
"}\n";
|
||||
|
||||
static void error_callback(int error, const char* description)
|
||||
{
|
||||
fprintf(stderr, "Error: %s\n", description);
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
GLFWwindow* window;
|
||||
GLuint vertex_buffer, vertex_shader, fragment_shader, program;
|
||||
GLint mvp_location, vpos_location, vcol_location;
|
||||
float ratio;
|
||||
int width, height;
|
||||
mat4x4 mvp;
|
||||
char* buffer;
|
||||
|
||||
glfwSetErrorCallback(error_callback);
|
||||
|
||||
glfwInitHint(GLFW_COCOA_MENUBAR, GLFW_FALSE);
|
||||
|
||||
if (!glfwInit())
|
||||
exit(EXIT_FAILURE);
|
||||
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2);
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
|
||||
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
|
||||
|
||||
window = glfwCreateWindow(640, 480, "Simple example", NULL, NULL);
|
||||
if (!window)
|
||||
{
|
||||
glfwTerminate();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
glfwMakeContextCurrent(window);
|
||||
gladLoadGL(glfwGetProcAddress);
|
||||
|
||||
// NOTE: OpenGL error checks have been omitted for brevity
|
||||
|
||||
glGenBuffers(1, &vertex_buffer);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer);
|
||||
glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
|
||||
|
||||
vertex_shader = glCreateShader(GL_VERTEX_SHADER);
|
||||
glShaderSource(vertex_shader, 1, &vertex_shader_text, NULL);
|
||||
glCompileShader(vertex_shader);
|
||||
|
||||
fragment_shader = glCreateShader(GL_FRAGMENT_SHADER);
|
||||
glShaderSource(fragment_shader, 1, &fragment_shader_text, NULL);
|
||||
glCompileShader(fragment_shader);
|
||||
|
||||
program = glCreateProgram();
|
||||
glAttachShader(program, vertex_shader);
|
||||
glAttachShader(program, fragment_shader);
|
||||
glLinkProgram(program);
|
||||
|
||||
mvp_location = glGetUniformLocation(program, "MVP");
|
||||
vpos_location = glGetAttribLocation(program, "vPos");
|
||||
vcol_location = glGetAttribLocation(program, "vCol");
|
||||
|
||||
glEnableVertexAttribArray(vpos_location);
|
||||
glVertexAttribPointer(vpos_location, 2, GL_FLOAT, GL_FALSE,
|
||||
sizeof(vertices[0]), (void*) 0);
|
||||
glEnableVertexAttribArray(vcol_location);
|
||||
glVertexAttribPointer(vcol_location, 3, GL_FLOAT, GL_FALSE,
|
||||
sizeof(vertices[0]), (void*) (sizeof(float) * 2));
|
||||
|
||||
glfwGetFramebufferSize(window, &width, &height);
|
||||
ratio = width / (float) height;
|
||||
|
||||
glViewport(0, 0, width, height);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
mat4x4_ortho(mvp, -ratio, ratio, -1.f, 1.f, 1.f, -1.f);
|
||||
|
||||
glUseProgram(program);
|
||||
glUniformMatrix4fv(mvp_location, 1, GL_FALSE, (const GLfloat*) mvp);
|
||||
glDrawArrays(GL_TRIANGLES, 0, 3);
|
||||
glFinish();
|
||||
|
||||
buffer = calloc(4, width * height);
|
||||
glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
|
||||
|
||||
// Write image Y-flipped because OpenGL
|
||||
stbi_write_png("offscreen.png",
|
||||
width, height, 4,
|
||||
buffer + (width * 4 * (height - 1)),
|
||||
-width * 4);
|
||||
|
||||
free(buffer);
|
||||
|
||||
glfwDestroyWindow(window);
|
||||
|
||||
glfwTerminate();
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
1074
examples/particles.c
Normal file
1074
examples/particles.c
Normal file
File diff suppressed because it is too large
Load Diff
235
examples/sharing.c
Normal file
235
examples/sharing.c
Normal file
|
@ -0,0 +1,235 @@
|
|||
//========================================================================
|
||||
// Context sharing example
|
||||
// Copyright (c) Camilla Löwy <elmindreda@glfw.org>
|
||||
//
|
||||
// This software is provided 'as-is', without any express or implied
|
||||
// warranty. In no event will the authors be held liable for any damages
|
||||
// arising from the use of this software.
|
||||
//
|
||||
// Permission is granted to anyone to use this software for any purpose,
|
||||
// including commercial applications, and to alter it and redistribute it
|
||||
// freely, subject to the following restrictions:
|
||||
//
|
||||
// 1. The origin of this software must not be misrepresented; you must not
|
||||
// claim that you wrote the original software. If you use this software
|
||||
// in a product, an acknowledgment in the product documentation would
|
||||
// be appreciated but is not required.
|
||||
//
|
||||
// 2. Altered source versions must be plainly marked as such, and must not
|
||||
// be misrepresented as being the original software.
|
||||
//
|
||||
// 3. This notice may not be removed or altered from any source
|
||||
// distribution.
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
#define GLAD_GL_IMPLEMENTATION
|
||||
#include <glad/gl.h>
|
||||
#define GLFW_INCLUDE_NONE
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "getopt.h"
|
||||
#include "linmath.h"
|
||||
|
||||
static const char* vertex_shader_text =
|
||||
"#version 110\n"
|
||||
"uniform mat4 MVP;\n"
|
||||
"attribute vec2 vPos;\n"
|
||||
"varying vec2 texcoord;\n"
|
||||
"void main()\n"
|
||||
"{\n"
|
||||
" gl_Position = MVP * vec4(vPos, 0.0, 1.0);\n"
|
||||
" texcoord = vPos;\n"
|
||||
"}\n";
|
||||
|
||||
static const char* fragment_shader_text =
|
||||
"#version 110\n"
|
||||
"uniform sampler2D texture;\n"
|
||||
"uniform vec3 color;\n"
|
||||
"varying vec2 texcoord;\n"
|
||||
"void main()\n"
|
||||
"{\n"
|
||||
" gl_FragColor = vec4(color * texture2D(texture, texcoord).rgb, 1.0);\n"
|
||||
"}\n";
|
||||
|
||||
static const vec2 vertices[4] =
|
||||
{
|
||||
{ 0.f, 0.f },
|
||||
{ 1.f, 0.f },
|
||||
{ 1.f, 1.f },
|
||||
{ 0.f, 1.f }
|
||||
};
|
||||
|
||||
static void error_callback(int error, const char* description)
|
||||
{
|
||||
fprintf(stderr, "Error: %s\n", description);
|
||||
}
|
||||
|
||||
static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
|
||||
{
|
||||
if (action == GLFW_PRESS && key == GLFW_KEY_ESCAPE)
|
||||
glfwSetWindowShouldClose(window, GLFW_TRUE);
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
GLFWwindow* windows[2];
|
||||
GLuint texture, program, vertex_buffer;
|
||||
GLint mvp_location, vpos_location, color_location, texture_location;
|
||||
|
||||
glfwSetErrorCallback(error_callback);
|
||||
|
||||
if (!glfwInit())
|
||||
exit(EXIT_FAILURE);
|
||||
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2);
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
|
||||
|
||||
windows[0] = glfwCreateWindow(400, 400, "First", NULL, NULL);
|
||||
if (!windows[0])
|
||||
{
|
||||
glfwTerminate();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
glfwSetKeyCallback(windows[0], key_callback);
|
||||
|
||||
glfwMakeContextCurrent(windows[0]);
|
||||
|
||||
// Only enable vsync for the first of the windows to be swapped to
|
||||
// avoid waiting out the interval for each window
|
||||
glfwSwapInterval(1);
|
||||
|
||||
// The contexts are created with the same APIs so the function
|
||||
// pointers should be re-usable between them
|
||||
gladLoadGL(glfwGetProcAddress);
|
||||
|
||||
// Create the OpenGL objects inside the first context, created above
|
||||
// All objects will be shared with the second context, created below
|
||||
{
|
||||
int x, y;
|
||||
char pixels[16 * 16];
|
||||
GLuint vertex_shader, fragment_shader;
|
||||
|
||||
glGenTextures(1, &texture);
|
||||
glBindTexture(GL_TEXTURE_2D, texture);
|
||||
|
||||
srand((unsigned int) glfwGetTimerValue());
|
||||
|
||||
for (y = 0; y < 16; y++)
|
||||
{
|
||||
for (x = 0; x < 16; x++)
|
||||
pixels[y * 16 + x] = rand() % 256;
|
||||
}
|
||||
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, 16, 16, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, pixels);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
|
||||
vertex_shader = glCreateShader(GL_VERTEX_SHADER);
|
||||
glShaderSource(vertex_shader, 1, &vertex_shader_text, NULL);
|
||||
glCompileShader(vertex_shader);
|
||||
|
||||
fragment_shader = glCreateShader(GL_FRAGMENT_SHADER);
|
||||
glShaderSource(fragment_shader, 1, &fragment_shader_text, NULL);
|
||||
glCompileShader(fragment_shader);
|
||||
|
||||
program = glCreateProgram();
|
||||
glAttachShader(program, vertex_shader);
|
||||
glAttachShader(program, fragment_shader);
|
||||
glLinkProgram(program);
|
||||
|
||||
mvp_location = glGetUniformLocation(program, "MVP");
|
||||
color_location = glGetUniformLocation(program, "color");
|
||||
texture_location = glGetUniformLocation(program, "texture");
|
||||
vpos_location = glGetAttribLocation(program, "vPos");
|
||||
|
||||
glGenBuffers(1, &vertex_buffer);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer);
|
||||
glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
|
||||
}
|
||||
|
||||
glUseProgram(program);
|
||||
glUniform1i(texture_location, 0);
|
||||
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glBindTexture(GL_TEXTURE_2D, texture);
|
||||
|
||||
glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer);
|
||||
glEnableVertexAttribArray(vpos_location);
|
||||
glVertexAttribPointer(vpos_location, 2, GL_FLOAT, GL_FALSE,
|
||||
sizeof(vertices[0]), (void*) 0);
|
||||
|
||||
windows[1] = glfwCreateWindow(400, 400, "Second", NULL, windows[0]);
|
||||
if (!windows[1])
|
||||
{
|
||||
glfwTerminate();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
// Place the second window to the right of the first
|
||||
{
|
||||
int xpos, ypos, left, right, width;
|
||||
|
||||
glfwGetWindowSize(windows[0], &width, NULL);
|
||||
glfwGetWindowFrameSize(windows[0], &left, NULL, &right, NULL);
|
||||
glfwGetWindowPos(windows[0], &xpos, &ypos);
|
||||
|
||||
glfwSetWindowPos(windows[1], xpos + width + left + right, ypos);
|
||||
}
|
||||
|
||||
glfwSetKeyCallback(windows[1], key_callback);
|
||||
|
||||
glfwMakeContextCurrent(windows[1]);
|
||||
|
||||
// While objects are shared, the global context state is not and will
|
||||
// need to be set up for each context
|
||||
|
||||
glUseProgram(program);
|
||||
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glBindTexture(GL_TEXTURE_2D, texture);
|
||||
|
||||
glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer);
|
||||
glEnableVertexAttribArray(vpos_location);
|
||||
glVertexAttribPointer(vpos_location, 2, GL_FLOAT, GL_FALSE,
|
||||
sizeof(vertices[0]), (void*) 0);
|
||||
|
||||
while (!glfwWindowShouldClose(windows[0]) &&
|
||||
!glfwWindowShouldClose(windows[1]))
|
||||
{
|
||||
int i;
|
||||
const vec3 colors[2] =
|
||||
{
|
||||
{ 0.8f, 0.4f, 1.f },
|
||||
{ 0.3f, 0.4f, 1.f }
|
||||
};
|
||||
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
int width, height;
|
||||
mat4x4 mvp;
|
||||
|
||||
glfwGetFramebufferSize(windows[i], &width, &height);
|
||||
glfwMakeContextCurrent(windows[i]);
|
||||
|
||||
glViewport(0, 0, width, height);
|
||||
|
||||
mat4x4_ortho(mvp, 0.f, 1.f, 0.f, 1.f, 0.f, 1.f);
|
||||
glUniformMatrix4fv(mvp_location, 1, GL_FALSE, (const GLfloat*) mvp);
|
||||
glUniform3fv(color_location, 1, colors[i]);
|
||||
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
|
||||
|
||||
glfwSwapBuffers(windows[i]);
|
||||
}
|
||||
|
||||
glfwWaitEvents();
|
||||
}
|
||||
|
||||
glfwTerminate();
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
|
@ -2,24 +2,29 @@
|
|||
// This is an example program for the GLFW library
|
||||
//
|
||||
// The program uses a "split window" view, rendering four views of the
|
||||
// same scene in one window (e.g. uesful for 3D modelling software). This
|
||||
// demo uses scissors to separete the four different rendering areas from
|
||||
// same scene in one window (e.g. useful for 3D modelling software). This
|
||||
// demo uses scissors to separate the four different rendering areas from
|
||||
// each other.
|
||||
//
|
||||
// (If the code seems a little bit strange here and there, it may be
|
||||
// because I am not a friend of orthogonal projections)
|
||||
//========================================================================
|
||||
|
||||
#define GLFW_INCLUDE_GLU
|
||||
#define GLAD_GL_IMPLEMENTATION
|
||||
#include <glad/gl.h>
|
||||
#define GLFW_INCLUDE_NONE
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
// Make MS math.h define M_PI
|
||||
#define _USE_MATH_DEFINES
|
||||
#endif
|
||||
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265358979323846
|
||||
#endif
|
||||
#include <linmath.h>
|
||||
|
||||
|
||||
//========================================================================
|
||||
|
@ -149,6 +154,7 @@ static void drawGrid(float scale, int steps)
|
|||
{
|
||||
int i;
|
||||
float x, y;
|
||||
mat4x4 view;
|
||||
|
||||
glPushMatrix();
|
||||
|
||||
|
@ -157,10 +163,13 @@ static void drawGrid(float scale, int steps)
|
|||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
// Setup modelview matrix (flat XY view)
|
||||
glLoadIdentity();
|
||||
gluLookAt(0.0, 0.0, 1.0,
|
||||
0.0, 0.0, 0.0,
|
||||
0.0, 1.0, 0.0);
|
||||
{
|
||||
vec3 eye = { 0.f, 0.f, 1.f };
|
||||
vec3 center = { 0.f, 0.f, 0.f };
|
||||
vec3 up = { 0.f, 1.f, 0.f };
|
||||
mat4x4_look_at(view, eye, center, up);
|
||||
}
|
||||
glLoadMatrixf((const GLfloat*) view);
|
||||
|
||||
// We don't want to update the Z-buffer
|
||||
glDepthMask(GL_FALSE);
|
||||
|
@ -209,13 +218,14 @@ static void drawAllViews(void)
|
|||
const GLfloat light_diffuse[4] = {1.0f, 1.0f, 1.0f, 1.0f};
|
||||
const GLfloat light_specular[4] = {1.0f, 1.0f, 1.0f, 1.0f};
|
||||
const GLfloat light_ambient[4] = {0.2f, 0.2f, 0.3f, 1.0f};
|
||||
double aspect;
|
||||
float aspect;
|
||||
mat4x4 view, projection;
|
||||
|
||||
// Calculate aspect of window
|
||||
if (height > 0)
|
||||
aspect = (double) width / (double) height;
|
||||
aspect = (float) width / (float) height;
|
||||
else
|
||||
aspect = 1.0;
|
||||
aspect = 1.f;
|
||||
|
||||
// Clear screen
|
||||
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
|
@ -247,10 +257,13 @@ static void drawAllViews(void)
|
|||
glViewport(0, height / 2, width / 2, height / 2);
|
||||
glScissor(0, height / 2, width / 2, height / 2);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
gluLookAt(0.0f, 10.0f, 1e-3f, // Eye-position (above)
|
||||
0.0f, 0.0f, 0.0f, // View-point
|
||||
0.0f, 1.0f, 0.0f); // Up-vector
|
||||
{
|
||||
vec3 eye = { 0.f, 10.f, 1e-3f };
|
||||
vec3 center = { 0.f, 0.f, 0.f };
|
||||
vec3 up = { 0.f, 1.f, 0.f };
|
||||
mat4x4_look_at( view, eye, center, up );
|
||||
}
|
||||
glLoadMatrixf((const GLfloat*) view);
|
||||
drawGrid(0.5, 12);
|
||||
drawScene();
|
||||
|
||||
|
@ -258,10 +271,13 @@ static void drawAllViews(void)
|
|||
glViewport(0, 0, width / 2, height / 2);
|
||||
glScissor(0, 0, width / 2, height / 2);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
gluLookAt(0.0f, 0.0f, 10.0f, // Eye-position (in front of)
|
||||
0.0f, 0.0f, 0.0f, // View-point
|
||||
0.0f, 1.0f, 0.0f); // Up-vector
|
||||
{
|
||||
vec3 eye = { 0.f, 0.f, 10.f };
|
||||
vec3 center = { 0.f, 0.f, 0.f };
|
||||
vec3 up = { 0.f, 1.f, 0.f };
|
||||
mat4x4_look_at( view, eye, center, up );
|
||||
}
|
||||
glLoadMatrixf((const GLfloat*) view);
|
||||
drawGrid(0.5, 12);
|
||||
drawScene();
|
||||
|
||||
|
@ -269,10 +285,13 @@ static void drawAllViews(void)
|
|||
glViewport(width / 2, 0, width / 2, height / 2);
|
||||
glScissor(width / 2, 0, width / 2, height / 2);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
gluLookAt(10.0f, 0.0f, 0.0f, // Eye-position (to the right)
|
||||
0.0f, 0.0f, 0.0f, // View-point
|
||||
0.0f, 1.0f, 0.0f); // Up-vector
|
||||
{
|
||||
vec3 eye = { 10.f, 0.f, 0.f };
|
||||
vec3 center = { 0.f, 0.f, 0.f };
|
||||
vec3 up = { 0.f, 1.f, 0.f };
|
||||
mat4x4_look_at( view, eye, center, up );
|
||||
}
|
||||
glLoadMatrixf((const GLfloat*) view);
|
||||
drawGrid(0.5, 12);
|
||||
drawScene();
|
||||
|
||||
|
@ -292,17 +311,23 @@ static void drawAllViews(void)
|
|||
|
||||
// Setup perspective projection matrix
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
gluPerspective(65.0f, aspect, 1.0f, 50.0f);
|
||||
mat4x4_perspective(projection,
|
||||
65.f * (float) M_PI / 180.f,
|
||||
aspect,
|
||||
1.f, 50.f);
|
||||
glLoadMatrixf((const GLfloat*) projection);
|
||||
|
||||
// Upper right view (PERSPECTIVE VIEW)
|
||||
glViewport(width / 2, height / 2, width / 2, height / 2);
|
||||
glScissor(width / 2, height / 2, width / 2, height / 2);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
gluLookAt(3.0f, 1.5f, 3.0f, // Eye-position
|
||||
0.0f, 0.0f, 0.0f, // View-point
|
||||
0.0f, 1.0f, 0.0f); // Up-vector
|
||||
{
|
||||
vec3 eye = { 3.f, 1.5f, 3.f };
|
||||
vec3 center = { 0.f, 0.f, 0.f };
|
||||
vec3 up = { 0.f, 1.f, 0.f };
|
||||
mat4x4_look_at( view, eye, center, up );
|
||||
}
|
||||
glLoadMatrixf((const GLfloat*) view);
|
||||
|
||||
// Configure and enable light source 1
|
||||
glLightfv(GL_LIGHT1, GL_POSITION, light_position);
|
||||
|
@ -371,7 +396,9 @@ static void framebufferSizeFun(GLFWwindow* window, int w, int h)
|
|||
|
||||
static void windowRefreshFun(GLFWwindow* window)
|
||||
{
|
||||
do_redraw = 1;
|
||||
drawAllViews();
|
||||
glfwSwapBuffers(window);
|
||||
do_redraw = 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -381,6 +408,17 @@ static void windowRefreshFun(GLFWwindow* window)
|
|||
|
||||
static void cursorPosFun(GLFWwindow* window, double x, double y)
|
||||
{
|
||||
int wnd_width, wnd_height, fb_width, fb_height;
|
||||
double scale;
|
||||
|
||||
glfwGetWindowSize(window, &wnd_width, &wnd_height);
|
||||
glfwGetFramebufferSize(window, &fb_width, &fb_height);
|
||||
|
||||
scale = (double) fb_width / (double) wnd_width;
|
||||
|
||||
x *= scale;
|
||||
y *= scale;
|
||||
|
||||
// Depending on which view was selected, rotate around different axes
|
||||
switch (active_view)
|
||||
{
|
||||
|
@ -437,7 +475,7 @@ static void mouseButtonFun(GLFWwindow* window, int button, int action, int mods)
|
|||
static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
|
||||
{
|
||||
if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
|
||||
glfwSetWindowShouldClose(window, GL_TRUE);
|
||||
glfwSetWindowShouldClose(window, GLFW_TRUE);
|
||||
}
|
||||
|
||||
|
||||
|
@ -456,6 +494,8 @@ int main(void)
|
|||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
glfwWindowHint(GLFW_SAMPLES, 4);
|
||||
|
||||
// Open OpenGL window
|
||||
window = glfwCreateWindow(500, 500, "Split view demo", NULL, NULL);
|
||||
if (!window)
|
||||
|
@ -475,8 +515,12 @@ int main(void)
|
|||
|
||||
// Enable vsync
|
||||
glfwMakeContextCurrent(window);
|
||||
gladLoadGL(glfwGetProcAddress);
|
||||
glfwSwapInterval(1);
|
||||
|
||||
if (GLAD_GL_ARB_multisample || GLAD_GL_VERSION_1_3)
|
||||
glEnable(GL_MULTISAMPLE_ARB);
|
||||
|
||||
glfwGetFramebufferSize(window, &width, &height);
|
||||
framebufferSizeFun(window, width, height);
|
||||
|
||||
|
@ -485,15 +529,7 @@ int main(void)
|
|||
{
|
||||
// Only redraw if we need to
|
||||
if (do_redraw)
|
||||
{
|
||||
// Draw all views
|
||||
drawAllViews();
|
||||
|
||||
// Swap buffers
|
||||
glfwSwapBuffers(window);
|
||||
|
||||
do_redraw = 0;
|
||||
}
|
||||
windowRefreshFun(window);
|
||||
|
||||
// Wait for new events
|
||||
glfwWaitEvents();
|
||||
|
|
171
examples/triangle-opengl.c
Normal file
171
examples/triangle-opengl.c
Normal file
|
@ -0,0 +1,171 @@
|
|||
//========================================================================
|
||||
// OpenGL triangle example
|
||||
// Copyright (c) Camilla Löwy <elmindreda@glfw.org>
|
||||
//
|
||||
// This software is provided 'as-is', without any express or implied
|
||||
// warranty. In no event will the authors be held liable for any damages
|
||||
// arising from the use of this software.
|
||||
//
|
||||
// Permission is granted to anyone to use this software for any purpose,
|
||||
// including commercial applications, and to alter it and redistribute it
|
||||
// freely, subject to the following restrictions:
|
||||
//
|
||||
// 1. The origin of this software must not be misrepresented; you must not
|
||||
// claim that you wrote the original software. If you use this software
|
||||
// in a product, an acknowledgment in the product documentation would
|
||||
// be appreciated but is not required.
|
||||
//
|
||||
// 2. Altered source versions must be plainly marked as such, and must not
|
||||
// be misrepresented as being the original software.
|
||||
//
|
||||
// 3. This notice may not be removed or altered from any source
|
||||
// distribution.
|
||||
//
|
||||
//========================================================================
|
||||
//! [code]
|
||||
|
||||
#define GLAD_GL_IMPLEMENTATION
|
||||
#include <glad/gl.h>
|
||||
#define GLFW_INCLUDE_NONE
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
#include "linmath.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
|
||||
typedef struct Vertex
|
||||
{
|
||||
vec2 pos;
|
||||
vec3 col;
|
||||
} Vertex;
|
||||
|
||||
static const Vertex vertices[3] =
|
||||
{
|
||||
{ { -0.6f, -0.4f }, { 1.f, 0.f, 0.f } },
|
||||
{ { 0.6f, -0.4f }, { 0.f, 1.f, 0.f } },
|
||||
{ { 0.f, 0.6f }, { 0.f, 0.f, 1.f } }
|
||||
};
|
||||
|
||||
static const char* vertex_shader_text =
|
||||
"#version 330\n"
|
||||
"uniform mat4 MVP;\n"
|
||||
"in vec3 vCol;\n"
|
||||
"in vec2 vPos;\n"
|
||||
"out vec3 color;\n"
|
||||
"void main()\n"
|
||||
"{\n"
|
||||
" gl_Position = MVP * vec4(vPos, 0.0, 1.0);\n"
|
||||
" color = vCol;\n"
|
||||
"}\n";
|
||||
|
||||
static const char* fragment_shader_text =
|
||||
"#version 330\n"
|
||||
"in vec3 color;\n"
|
||||
"out vec4 fragment;\n"
|
||||
"void main()\n"
|
||||
"{\n"
|
||||
" fragment = vec4(color, 1.0);\n"
|
||||
"}\n";
|
||||
|
||||
static void error_callback(int error, const char* description)
|
||||
{
|
||||
fprintf(stderr, "Error: %s\n", description);
|
||||
}
|
||||
|
||||
static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
|
||||
{
|
||||
if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
|
||||
glfwSetWindowShouldClose(window, GLFW_TRUE);
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
glfwSetErrorCallback(error_callback);
|
||||
|
||||
if (!glfwInit())
|
||||
exit(EXIT_FAILURE);
|
||||
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
|
||||
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
|
||||
|
||||
GLFWwindow* window = glfwCreateWindow(640, 480, "OpenGL Triangle", NULL, NULL);
|
||||
if (!window)
|
||||
{
|
||||
glfwTerminate();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
glfwSetKeyCallback(window, key_callback);
|
||||
|
||||
glfwMakeContextCurrent(window);
|
||||
gladLoadGL(glfwGetProcAddress);
|
||||
glfwSwapInterval(1);
|
||||
|
||||
// NOTE: OpenGL error checks have been omitted for brevity
|
||||
|
||||
GLuint vertex_buffer;
|
||||
glGenBuffers(1, &vertex_buffer);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer);
|
||||
glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
|
||||
|
||||
const GLuint vertex_shader = glCreateShader(GL_VERTEX_SHADER);
|
||||
glShaderSource(vertex_shader, 1, &vertex_shader_text, NULL);
|
||||
glCompileShader(vertex_shader);
|
||||
|
||||
const GLuint fragment_shader = glCreateShader(GL_FRAGMENT_SHADER);
|
||||
glShaderSource(fragment_shader, 1, &fragment_shader_text, NULL);
|
||||
glCompileShader(fragment_shader);
|
||||
|
||||
const GLuint program = glCreateProgram();
|
||||
glAttachShader(program, vertex_shader);
|
||||
glAttachShader(program, fragment_shader);
|
||||
glLinkProgram(program);
|
||||
|
||||
const GLint mvp_location = glGetUniformLocation(program, "MVP");
|
||||
const GLint vpos_location = glGetAttribLocation(program, "vPos");
|
||||
const GLint vcol_location = glGetAttribLocation(program, "vCol");
|
||||
|
||||
GLuint vertex_array;
|
||||
glGenVertexArrays(1, &vertex_array);
|
||||
glBindVertexArray(vertex_array);
|
||||
glEnableVertexAttribArray(vpos_location);
|
||||
glVertexAttribPointer(vpos_location, 2, GL_FLOAT, GL_FALSE,
|
||||
sizeof(Vertex), (void*) offsetof(Vertex, pos));
|
||||
glEnableVertexAttribArray(vcol_location);
|
||||
glVertexAttribPointer(vcol_location, 3, GL_FLOAT, GL_FALSE,
|
||||
sizeof(Vertex), (void*) offsetof(Vertex, col));
|
||||
|
||||
while (!glfwWindowShouldClose(window))
|
||||
{
|
||||
int width, height;
|
||||
glfwGetFramebufferSize(window, &width, &height);
|
||||
const float ratio = width / (float) height;
|
||||
|
||||
glViewport(0, 0, width, height);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
mat4x4 m, p, mvp;
|
||||
mat4x4_identity(m);
|
||||
mat4x4_rotate_Z(m, m, (float) glfwGetTime());
|
||||
mat4x4_ortho(p, -ratio, ratio, -1.f, 1.f, 1.f, -1.f);
|
||||
mat4x4_mul(mvp, p, m);
|
||||
|
||||
glUseProgram(program);
|
||||
glUniformMatrix4fv(mvp_location, 1, GL_FALSE, (const GLfloat*) &mvp);
|
||||
glBindVertexArray(vertex_array);
|
||||
glDrawArrays(GL_TRIANGLES, 0, 3);
|
||||
|
||||
glfwSwapBuffers(window);
|
||||
glfwPollEvents();
|
||||
}
|
||||
|
||||
glfwDestroyWindow(window);
|
||||
|
||||
glfwTerminate();
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
//! [code]
|
170
examples/triangle-opengles.c
Normal file
170
examples/triangle-opengles.c
Normal file
|
@ -0,0 +1,170 @@
|
|||
//========================================================================
|
||||
// OpenGL ES 2.0 triangle example
|
||||
// Copyright (c) Camilla Löwy <elmindreda@glfw.org>
|
||||
//
|
||||
// This software is provided 'as-is', without any express or implied
|
||||
// warranty. In no event will the authors be held liable for any damages
|
||||
// arising from the use of this software.
|
||||
//
|
||||
// Permission is granted to anyone to use this software for any purpose,
|
||||
// including commercial applications, and to alter it and redistribute it
|
||||
// freely, subject to the following restrictions:
|
||||
//
|
||||
// 1. The origin of this software must not be misrepresented; you must not
|
||||
// claim that you wrote the original software. If you use this software
|
||||
// in a product, an acknowledgment in the product documentation would
|
||||
// be appreciated but is not required.
|
||||
//
|
||||
// 2. Altered source versions must be plainly marked as such, and must not
|
||||
// be misrepresented as being the original software.
|
||||
//
|
||||
// 3. This notice may not be removed or altered from any source
|
||||
// distribution.
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
#define GLAD_GLES2_IMPLEMENTATION
|
||||
#include <glad/gles2.h>
|
||||
#define GLFW_INCLUDE_NONE
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
#include "linmath.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
|
||||
typedef struct Vertex
|
||||
{
|
||||
vec2 pos;
|
||||
vec3 col;
|
||||
} Vertex;
|
||||
|
||||
static const Vertex vertices[3] =
|
||||
{
|
||||
{ { -0.6f, -0.4f }, { 1.f, 0.f, 0.f } },
|
||||
{ { 0.6f, -0.4f }, { 0.f, 1.f, 0.f } },
|
||||
{ { 0.f, 0.6f }, { 0.f, 0.f, 1.f } }
|
||||
};
|
||||
|
||||
static const char* vertex_shader_text =
|
||||
"#version 100\n"
|
||||
"precision mediump float;\n"
|
||||
"uniform mat4 MVP;\n"
|
||||
"attribute vec3 vCol;\n"
|
||||
"attribute vec2 vPos;\n"
|
||||
"varying vec3 color;\n"
|
||||
"void main()\n"
|
||||
"{\n"
|
||||
" gl_Position = MVP * vec4(vPos, 0.0, 1.0);\n"
|
||||
" color = vCol;\n"
|
||||
"}\n";
|
||||
|
||||
static const char* fragment_shader_text =
|
||||
"#version 100\n"
|
||||
"precision mediump float;\n"
|
||||
"varying vec3 color;\n"
|
||||
"void main()\n"
|
||||
"{\n"
|
||||
" gl_FragColor = vec4(color, 1.0);\n"
|
||||
"}\n";
|
||||
|
||||
static void error_callback(int error, const char* description)
|
||||
{
|
||||
fprintf(stderr, "GLFW Error: %s\n", description);
|
||||
}
|
||||
|
||||
static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
|
||||
{
|
||||
if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
|
||||
glfwSetWindowShouldClose(window, GLFW_TRUE);
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
glfwSetErrorCallback(error_callback);
|
||||
|
||||
if (!glfwInit())
|
||||
exit(EXIT_FAILURE);
|
||||
|
||||
glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_ES_API);
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2);
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
|
||||
glfwWindowHint(GLFW_CONTEXT_CREATION_API, GLFW_EGL_CONTEXT_API);
|
||||
|
||||
GLFWwindow* window = glfwCreateWindow(640, 480, "OpenGL ES 2.0 Triangle (EGL)", NULL, NULL);
|
||||
if (!window)
|
||||
{
|
||||
glfwWindowHint(GLFW_CONTEXT_CREATION_API, GLFW_NATIVE_CONTEXT_API);
|
||||
window = glfwCreateWindow(640, 480, "OpenGL ES 2.0 Triangle", NULL, NULL);
|
||||
if (!window)
|
||||
{
|
||||
glfwTerminate();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
glfwSetKeyCallback(window, key_callback);
|
||||
|
||||
glfwMakeContextCurrent(window);
|
||||
gladLoadGLES2(glfwGetProcAddress);
|
||||
glfwSwapInterval(1);
|
||||
|
||||
GLuint vertex_buffer;
|
||||
glGenBuffers(1, &vertex_buffer);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer);
|
||||
glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
|
||||
|
||||
const GLuint vertex_shader = glCreateShader(GL_VERTEX_SHADER);
|
||||
glShaderSource(vertex_shader, 1, &vertex_shader_text, NULL);
|
||||
glCompileShader(vertex_shader);
|
||||
|
||||
const GLuint fragment_shader = glCreateShader(GL_FRAGMENT_SHADER);
|
||||
glShaderSource(fragment_shader, 1, &fragment_shader_text, NULL);
|
||||
glCompileShader(fragment_shader);
|
||||
|
||||
const GLuint program = glCreateProgram();
|
||||
glAttachShader(program, vertex_shader);
|
||||
glAttachShader(program, fragment_shader);
|
||||
glLinkProgram(program);
|
||||
|
||||
const GLint mvp_location = glGetUniformLocation(program, "MVP");
|
||||
const GLint vpos_location = glGetAttribLocation(program, "vPos");
|
||||
const GLint vcol_location = glGetAttribLocation(program, "vCol");
|
||||
|
||||
glEnableVertexAttribArray(vpos_location);
|
||||
glEnableVertexAttribArray(vcol_location);
|
||||
glVertexAttribPointer(vpos_location, 2, GL_FLOAT, GL_FALSE,
|
||||
sizeof(Vertex), (void*) offsetof(Vertex, pos));
|
||||
glVertexAttribPointer(vcol_location, 3, GL_FLOAT, GL_FALSE,
|
||||
sizeof(Vertex), (void*) offsetof(Vertex, col));
|
||||
|
||||
while (!glfwWindowShouldClose(window))
|
||||
{
|
||||
int width, height;
|
||||
glfwGetFramebufferSize(window, &width, &height);
|
||||
const float ratio = width / (float) height;
|
||||
|
||||
glViewport(0, 0, width, height);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
mat4x4 m, p, mvp;
|
||||
mat4x4_identity(m);
|
||||
mat4x4_rotate_Z(m, m, (float) glfwGetTime());
|
||||
mat4x4_ortho(p, -ratio, ratio, -1.f, 1.f, 1.f, -1.f);
|
||||
mat4x4_mul(mvp, p, m);
|
||||
|
||||
glUseProgram(program);
|
||||
glUniformMatrix4fv(mvp_location, 1, GL_FALSE, (const GLfloat*) &mvp);
|
||||
glDrawArrays(GL_TRIANGLES, 0, 3);
|
||||
|
||||
glfwSwapBuffers(window);
|
||||
glfwPollEvents();
|
||||
}
|
||||
|
||||
glfwDestroyWindow(window);
|
||||
|
||||
glfwTerminate();
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
|
@ -5,19 +5,24 @@
|
|||
* Modified for GLFW by Sylvain Hellegouarch - sh@programmationworld.com
|
||||
* Modified for variable frame rate by Marcus Geelnard
|
||||
* 2003-Jan-31: Minor cleanups and speedups / MG
|
||||
* 2010-10-24: Formatting and cleanup - Camilla Berglund
|
||||
* 2010-10-24: Formatting and cleanup - Camilla Löwy
|
||||
*****************************************************************************/
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
// Make MS math.h define M_PI
|
||||
#define _USE_MATH_DEFINES
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
|
||||
#define GLFW_INCLUDE_GLU
|
||||
#define GLAD_GL_IMPLEMENTATION
|
||||
#include <glad/gl.h>
|
||||
#define GLFW_INCLUDE_NONE
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.1415926535897932384626433832795
|
||||
#endif
|
||||
#include <linmath.h>
|
||||
|
||||
// Maximum delta T to allow for differential calculations
|
||||
#define MAX_DELTA_T 0.01
|
||||
|
@ -28,10 +33,8 @@
|
|||
GLfloat alpha = 210.f, beta = -70.f;
|
||||
GLfloat zoom = 2.f;
|
||||
|
||||
GLboolean locked = GL_FALSE;
|
||||
|
||||
int cursorX;
|
||||
int cursorY;
|
||||
double cursorX;
|
||||
double cursorY;
|
||||
|
||||
struct Vertex
|
||||
{
|
||||
|
@ -278,7 +281,7 @@ void key_callback(GLFWwindow* window, int key, int scancode, int action, int mod
|
|||
switch (key)
|
||||
{
|
||||
case GLFW_KEY_ESCAPE:
|
||||
glfwSetWindowShouldClose(window, GL_TRUE);
|
||||
glfwSetWindowShouldClose(window, GLFW_TRUE);
|
||||
break;
|
||||
case GLFW_KEY_SPACE:
|
||||
init_grid();
|
||||
|
@ -321,13 +324,10 @@ void mouse_button_callback(GLFWwindow* window, int button, int action, int mods)
|
|||
if (action == GLFW_PRESS)
|
||||
{
|
||||
glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_DISABLED);
|
||||
locked = GL_TRUE;
|
||||
glfwGetCursorPos(window, &cursorX, &cursorY);
|
||||
}
|
||||
else
|
||||
{
|
||||
locked = GL_FALSE;
|
||||
glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_NORMAL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -337,14 +337,14 @@ void mouse_button_callback(GLFWwindow* window, int button, int action, int mods)
|
|||
|
||||
void cursor_position_callback(GLFWwindow* window, double x, double y)
|
||||
{
|
||||
if (locked)
|
||||
if (glfwGetInputMode(window, GLFW_CURSOR) == GLFW_CURSOR_DISABLED)
|
||||
{
|
||||
alpha += (GLfloat) (x - cursorX) / 10.f;
|
||||
beta += (GLfloat) (y - cursorY) / 10.f;
|
||||
}
|
||||
|
||||
cursorX = (int) x;
|
||||
cursorY = (int) y;
|
||||
cursorX = x;
|
||||
cursorY = y;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -367,6 +367,7 @@ void scroll_callback(GLFWwindow* window, double x, double y)
|
|||
void framebuffer_size_callback(GLFWwindow* window, int width, int height)
|
||||
{
|
||||
float ratio = 1.f;
|
||||
mat4x4 projection;
|
||||
|
||||
if (height > 0)
|
||||
ratio = (float) width / (float) height;
|
||||
|
@ -376,8 +377,11 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height)
|
|||
|
||||
// Change to the projection matrix and set our viewing volume
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
gluPerspective(60.0, ratio, 1.0, 1024.0);
|
||||
mat4x4_perspective(projection,
|
||||
60.f * (float) M_PI / 180.f,
|
||||
ratio,
|
||||
1.f, 1024.f);
|
||||
glLoadMatrixf((const GLfloat*) projection);
|
||||
}
|
||||
|
||||
|
||||
|
@ -410,6 +414,7 @@ int main(int argc, char* argv[])
|
|||
glfwSetScrollCallback(window, scroll_callback);
|
||||
|
||||
glfwMakeContextCurrent(window);
|
||||
gladLoadGL(glfwGetProcAddress);
|
||||
glfwSwapInterval(1);
|
||||
|
||||
glfwGetFramebufferSize(window, &width, &height);
|
||||
|
@ -452,6 +457,7 @@ int main(int argc, char* argv[])
|
|||
glfwPollEvents();
|
||||
}
|
||||
|
||||
glfwTerminate();
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
|
|
106
examples/windows.c
Normal file
106
examples/windows.c
Normal file
|
@ -0,0 +1,106 @@
|
|||
//========================================================================
|
||||
// Simple multi-window example
|
||||
// Copyright (c) Camilla Löwy <elmindreda@glfw.org>
|
||||
//
|
||||
// This software is provided 'as-is', without any express or implied
|
||||
// warranty. In no event will the authors be held liable for any damages
|
||||
// arising from the use of this software.
|
||||
//
|
||||
// Permission is granted to anyone to use this software for any purpose,
|
||||
// including commercial applications, and to alter it and redistribute it
|
||||
// freely, subject to the following restrictions:
|
||||
//
|
||||
// 1. The origin of this software must not be misrepresented; you must not
|
||||
// claim that you wrote the original software. If you use this software
|
||||
// in a product, an acknowledgment in the product documentation would
|
||||
// be appreciated but is not required.
|
||||
//
|
||||
// 2. Altered source versions must be plainly marked as such, and must not
|
||||
// be misrepresented as being the original software.
|
||||
//
|
||||
// 3. This notice may not be removed or altered from any source
|
||||
// distribution.
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
#define GLAD_GL_IMPLEMENTATION
|
||||
#include <glad/gl.h>
|
||||
#define GLFW_INCLUDE_NONE
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
int xpos, ypos, height;
|
||||
const char* description;
|
||||
GLFWwindow* windows[4];
|
||||
|
||||
if (!glfwInit())
|
||||
{
|
||||
glfwGetError(&description);
|
||||
printf("Error: %s\n", description);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
glfwWindowHint(GLFW_DECORATED, GLFW_FALSE);
|
||||
|
||||
glfwGetMonitorWorkarea(glfwGetPrimaryMonitor(), &xpos, &ypos, NULL, &height);
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
const int size = height / 5;
|
||||
const struct
|
||||
{
|
||||
float r, g, b;
|
||||
} colors[] =
|
||||
{
|
||||
{ 0.95f, 0.32f, 0.11f },
|
||||
{ 0.50f, 0.80f, 0.16f },
|
||||
{ 0.f, 0.68f, 0.94f },
|
||||
{ 0.98f, 0.74f, 0.04f }
|
||||
};
|
||||
|
||||
if (i > 0)
|
||||
glfwWindowHint(GLFW_FOCUS_ON_SHOW, GLFW_FALSE);
|
||||
|
||||
glfwWindowHint(GLFW_POSITION_X, xpos + size * (1 + (i & 1)));
|
||||
glfwWindowHint(GLFW_POSITION_Y, ypos + size * (1 + (i >> 1)));
|
||||
|
||||
windows[i] = glfwCreateWindow(size, size, "Multi-Window Example", NULL, NULL);
|
||||
if (!windows[i])
|
||||
{
|
||||
glfwGetError(&description);
|
||||
printf("Error: %s\n", description);
|
||||
glfwTerminate();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
glfwSetInputMode(windows[i], GLFW_STICKY_KEYS, GLFW_TRUE);
|
||||
|
||||
glfwMakeContextCurrent(windows[i]);
|
||||
gladLoadGL(glfwGetProcAddress);
|
||||
glClearColor(colors[i].r, colors[i].g, colors[i].b, 1.f);
|
||||
}
|
||||
|
||||
for (;;)
|
||||
{
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
glfwMakeContextCurrent(windows[i]);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
glfwSwapBuffers(windows[i]);
|
||||
|
||||
if (glfwWindowShouldClose(windows[i]) ||
|
||||
glfwGetKey(windows[i], GLFW_KEY_ESCAPE))
|
||||
{
|
||||
glfwTerminate();
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
}
|
||||
|
||||
glfwWaitEvents();
|
||||
}
|
||||
}
|
||||
|
5665
include/GLFW/glfw3.h
5665
include/GLFW/glfw3.h
File diff suppressed because it is too large
Load Diff
|
@ -1,10 +1,9 @@
|
|||
/*************************************************************************
|
||||
* GLFW - An OpenGL library
|
||||
* API version: 3.0
|
||||
* WWW: http://www.glfw.org/
|
||||
* GLFW 3.4 - www.glfw.org
|
||||
* A library for OpenGL, window and input
|
||||
*------------------------------------------------------------------------
|
||||
* Copyright (c) 2002-2006 Marcus Geelnard
|
||||
* Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>
|
||||
* Copyright (c) 2006-2018 Camilla Löwy <elmindreda@glfw.org>
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any damages
|
||||
|
@ -39,31 +38,52 @@ extern "C" {
|
|||
* Doxygen documentation
|
||||
*************************************************************************/
|
||||
|
||||
/*! @file glfw3native.h
|
||||
* @brief The header of the native access functions.
|
||||
*
|
||||
* This is the header file of the native access functions. See @ref native for
|
||||
* more information.
|
||||
*/
|
||||
/*! @defgroup native Native access
|
||||
* @brief Functions related to accessing native handles.
|
||||
*
|
||||
* **By using the native API, you assert that you know what you are doing and
|
||||
* how to fix problems caused by using it. If you don't, you shouldn't be
|
||||
* using it.**
|
||||
* **By using the native access functions you assert that you know what you're
|
||||
* doing and how to fix problems caused by using them. If you don't, you
|
||||
* shouldn't be using them.**
|
||||
*
|
||||
* Before the inclusion of @ref glfw3native.h, you must define exactly one
|
||||
* window API macro and exactly one context API macro. Failure to do this
|
||||
* will cause a compile-time error.
|
||||
* Before the inclusion of @ref glfw3native.h, you may define zero or more
|
||||
* window system API macro and zero or more context creation API macros.
|
||||
*
|
||||
* The chosen backends must match those the library was compiled for. Failure
|
||||
* to do this will cause a link-time error.
|
||||
*
|
||||
* The available window API macros are:
|
||||
* * `GLFW_EXPOSE_NATIVE_WIN32`
|
||||
* * `GLFW_EXPOSE_NATIVE_COCOA`
|
||||
* * `GLFW_EXPOSE_NATIVE_X11`
|
||||
* * `GLFW_EXPOSE_NATIVE_WAYLAND`
|
||||
*
|
||||
* The available context API macros are:
|
||||
* * `GLFW_EXPOSE_NATIVE_WGL`
|
||||
* * `GLFW_EXPOSE_NATIVE_NSGL`
|
||||
* * `GLFW_EXPOSE_NATIVE_GLX`
|
||||
* * `GLFW_EXPOSE_NATIVE_EGL`
|
||||
* * `GLFW_EXPOSE_NATIVE_OSMESA`
|
||||
*
|
||||
* These macros select which of the native access functions that are declared
|
||||
* and which platform-specific headers to include. It is then up your (by
|
||||
* definition platform-specific) code to handle which of these should be
|
||||
* defined.
|
||||
*
|
||||
* If you do not want the platform-specific headers to be included, define
|
||||
* `GLFW_NATIVE_INCLUDE_NONE` before including the @ref glfw3native.h header.
|
||||
*
|
||||
* @code
|
||||
* #define GLFW_EXPOSE_NATIVE_WIN32
|
||||
* #define GLFW_EXPOSE_NATIVE_WGL
|
||||
* #define GLFW_NATIVE_INCLUDE_NONE
|
||||
* #include <GLFW/glfw3native.h>
|
||||
* @endcode
|
||||
*/
|
||||
|
||||
|
||||
|
@ -71,31 +91,71 @@ extern "C" {
|
|||
* System headers and types
|
||||
*************************************************************************/
|
||||
|
||||
#if defined(GLFW_EXPOSE_NATIVE_WIN32)
|
||||
#include <windows.h>
|
||||
#elif defined(GLFW_EXPOSE_NATIVE_COCOA)
|
||||
#if defined(__OBJC__)
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#else
|
||||
typedef void* id;
|
||||
#endif
|
||||
#elif defined(GLFW_EXPOSE_NATIVE_X11)
|
||||
#include <X11/Xlib.h>
|
||||
#else
|
||||
#error "No window API specified"
|
||||
#endif
|
||||
#if !defined(GLFW_NATIVE_INCLUDE_NONE)
|
||||
|
||||
#if defined(GLFW_EXPOSE_NATIVE_WGL)
|
||||
/* WGL is declared by windows.h */
|
||||
#elif defined(GLFW_EXPOSE_NATIVE_NSGL)
|
||||
/* NSGL is declared by Cocoa.h */
|
||||
#elif defined(GLFW_EXPOSE_NATIVE_GLX)
|
||||
#include <GL/glx.h>
|
||||
#elif defined(GLFW_EXPOSE_NATIVE_EGL)
|
||||
#include <EGL/egl.h>
|
||||
#else
|
||||
#error "No context API specified"
|
||||
#endif
|
||||
#if defined(GLFW_EXPOSE_NATIVE_WIN32) || defined(GLFW_EXPOSE_NATIVE_WGL)
|
||||
/* This is a workaround for the fact that glfw3.h needs to export APIENTRY (for
|
||||
* example to allow applications to correctly declare a GL_KHR_debug callback)
|
||||
* but windows.h assumes no one will define APIENTRY before it does
|
||||
*/
|
||||
#if defined(GLFW_APIENTRY_DEFINED)
|
||||
#undef APIENTRY
|
||||
#undef GLFW_APIENTRY_DEFINED
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#if defined(GLFW_EXPOSE_NATIVE_COCOA) || defined(GLFW_EXPOSE_NATIVE_NSGL)
|
||||
#if defined(__OBJC__)
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#else
|
||||
#include <ApplicationServices/ApplicationServices.h>
|
||||
#include <objc/objc.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(GLFW_EXPOSE_NATIVE_X11) || defined(GLFW_EXPOSE_NATIVE_GLX)
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/extensions/Xrandr.h>
|
||||
#endif
|
||||
|
||||
#if defined(GLFW_EXPOSE_NATIVE_WAYLAND)
|
||||
#include <wayland-client.h>
|
||||
#endif
|
||||
|
||||
#if defined(GLFW_EXPOSE_NATIVE_WGL)
|
||||
/* WGL is declared by windows.h */
|
||||
#endif
|
||||
#if defined(GLFW_EXPOSE_NATIVE_NSGL)
|
||||
/* NSGL is declared by Cocoa.h */
|
||||
#endif
|
||||
#if defined(GLFW_EXPOSE_NATIVE_GLX)
|
||||
/* This is a workaround for the fact that glfw3.h defines GLAPIENTRY because by
|
||||
* default it also acts as an OpenGL header
|
||||
* However, glx.h will include gl.h, which will define it unconditionally
|
||||
*/
|
||||
#if defined(GLFW_GLAPIENTRY_DEFINED)
|
||||
#undef GLAPIENTRY
|
||||
#undef GLFW_GLAPIENTRY_DEFINED
|
||||
#endif
|
||||
#include <GL/glx.h>
|
||||
#endif
|
||||
#if defined(GLFW_EXPOSE_NATIVE_EGL)
|
||||
#include <EGL/egl.h>
|
||||
#endif
|
||||
#if defined(GLFW_EXPOSE_NATIVE_OSMESA)
|
||||
/* This is a workaround for the fact that glfw3.h defines GLAPIENTRY because by
|
||||
* default it also acts as an OpenGL header
|
||||
* However, osmesa.h will include gl.h, which will define it unconditionally
|
||||
*/
|
||||
#if defined(GLFW_GLAPIENTRY_DEFINED)
|
||||
#undef GLAPIENTRY
|
||||
#undef GLFW_GLAPIENTRY_DEFINED
|
||||
#endif
|
||||
#include <GL/osmesa.h>
|
||||
#endif
|
||||
|
||||
#endif /*GLFW_NATIVE_INCLUDE_NONE*/
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
|
@ -103,8 +163,60 @@ extern "C" {
|
|||
*************************************************************************/
|
||||
|
||||
#if defined(GLFW_EXPOSE_NATIVE_WIN32)
|
||||
/*! @brief Returns the adapter device name of the specified monitor.
|
||||
*
|
||||
* @return The UTF-8 encoded adapter device name (for example `\\.\DISPLAY1`)
|
||||
* of the specified monitor, or `NULL` if an [error](@ref error_handling)
|
||||
* occurred.
|
||||
*
|
||||
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
|
||||
*
|
||||
* @thread_safety This function may be called from any thread. Access is not
|
||||
* synchronized.
|
||||
*
|
||||
* @since Added in version 3.1.
|
||||
*
|
||||
* @ingroup native
|
||||
*/
|
||||
GLFWAPI const char* glfwGetWin32Adapter(GLFWmonitor* monitor);
|
||||
|
||||
/*! @brief Returns the display device name of the specified monitor.
|
||||
*
|
||||
* @return The UTF-8 encoded display device name (for example
|
||||
* `\\.\DISPLAY1\Monitor0`) of the specified monitor, or `NULL` if an
|
||||
* [error](@ref error_handling) occurred.
|
||||
*
|
||||
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
|
||||
*
|
||||
* @thread_safety This function may be called from any thread. Access is not
|
||||
* synchronized.
|
||||
*
|
||||
* @since Added in version 3.1.
|
||||
*
|
||||
* @ingroup native
|
||||
*/
|
||||
GLFWAPI const char* glfwGetWin32Monitor(GLFWmonitor* monitor);
|
||||
|
||||
/*! @brief Returns the `HWND` of the specified window.
|
||||
* @return The `HWND` of the specified window.
|
||||
*
|
||||
* @return The `HWND` of the specified window, or `NULL` if an
|
||||
* [error](@ref error_handling) occurred.
|
||||
*
|
||||
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
|
||||
*
|
||||
* @remark The `HDC` associated with the window can be queried with the
|
||||
* [GetDC](https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getdc)
|
||||
* function.
|
||||
* @code
|
||||
* HDC dc = GetDC(glfwGetWin32Window(window));
|
||||
* @endcode
|
||||
* This DC is private and does not need to be released.
|
||||
*
|
||||
* @thread_safety This function may be called from any thread. Access is not
|
||||
* synchronized.
|
||||
*
|
||||
* @since Added in version 3.0.
|
||||
*
|
||||
* @ingroup native
|
||||
*/
|
||||
GLFWAPI HWND glfwGetWin32Window(GLFWwindow* window);
|
||||
|
@ -112,15 +224,60 @@ GLFWAPI HWND glfwGetWin32Window(GLFWwindow* window);
|
|||
|
||||
#if defined(GLFW_EXPOSE_NATIVE_WGL)
|
||||
/*! @brief Returns the `HGLRC` of the specified window.
|
||||
* @return The `HGLRC` of the specified window.
|
||||
*
|
||||
* @return The `HGLRC` of the specified window, or `NULL` if an
|
||||
* [error](@ref error_handling) occurred.
|
||||
*
|
||||
* @errors Possible errors include @ref GLFW_NO_WINDOW_CONTEXT and @ref
|
||||
* GLFW_NOT_INITIALIZED.
|
||||
*
|
||||
* @remark The `HDC` associated with the window can be queried with the
|
||||
* [GetDC](https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getdc)
|
||||
* function.
|
||||
* @code
|
||||
* HDC dc = GetDC(glfwGetWin32Window(window));
|
||||
* @endcode
|
||||
* This DC is private and does not need to be released.
|
||||
*
|
||||
* @thread_safety This function may be called from any thread. Access is not
|
||||
* synchronized.
|
||||
*
|
||||
* @since Added in version 3.0.
|
||||
*
|
||||
* @ingroup native
|
||||
*/
|
||||
GLFWAPI HGLRC glfwGetWGLContext(GLFWwindow* window);
|
||||
#endif
|
||||
|
||||
#if defined(GLFW_EXPOSE_NATIVE_COCOA)
|
||||
/*! @brief Returns the `CGDirectDisplayID` of the specified monitor.
|
||||
*
|
||||
* @return The `CGDirectDisplayID` of the specified monitor, or
|
||||
* `kCGNullDirectDisplay` if an [error](@ref error_handling) occurred.
|
||||
*
|
||||
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
|
||||
*
|
||||
* @thread_safety This function may be called from any thread. Access is not
|
||||
* synchronized.
|
||||
*
|
||||
* @since Added in version 3.1.
|
||||
*
|
||||
* @ingroup native
|
||||
*/
|
||||
GLFWAPI CGDirectDisplayID glfwGetCocoaMonitor(GLFWmonitor* monitor);
|
||||
|
||||
/*! @brief Returns the `NSWindow` of the specified window.
|
||||
* @return The `NSWindow` of the specified window.
|
||||
*
|
||||
* @return The `NSWindow` of the specified window, or `nil` if an
|
||||
* [error](@ref error_handling) occurred.
|
||||
*
|
||||
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
|
||||
*
|
||||
* @thread_safety This function may be called from any thread. Access is not
|
||||
* synchronized.
|
||||
*
|
||||
* @since Added in version 3.0.
|
||||
*
|
||||
* @ingroup native
|
||||
*/
|
||||
GLFWAPI id glfwGetCocoaWindow(GLFWwindow* window);
|
||||
|
@ -128,7 +285,18 @@ GLFWAPI id glfwGetCocoaWindow(GLFWwindow* window);
|
|||
|
||||
#if defined(GLFW_EXPOSE_NATIVE_NSGL)
|
||||
/*! @brief Returns the `NSOpenGLContext` of the specified window.
|
||||
* @return The `NSOpenGLContext` of the specified window.
|
||||
*
|
||||
* @return The `NSOpenGLContext` of the specified window, or `nil` if an
|
||||
* [error](@ref error_handling) occurred.
|
||||
*
|
||||
* @errors Possible errors include @ref GLFW_NO_WINDOW_CONTEXT and @ref
|
||||
* GLFW_NOT_INITIALIZED.
|
||||
*
|
||||
* @thread_safety This function may be called from any thread. Access is not
|
||||
* synchronized.
|
||||
*
|
||||
* @since Added in version 3.0.
|
||||
*
|
||||
* @ingroup native
|
||||
*/
|
||||
GLFWAPI id glfwGetNSGLContext(GLFWwindow* window);
|
||||
|
@ -136,43 +304,328 @@ GLFWAPI id glfwGetNSGLContext(GLFWwindow* window);
|
|||
|
||||
#if defined(GLFW_EXPOSE_NATIVE_X11)
|
||||
/*! @brief Returns the `Display` used by GLFW.
|
||||
* @return The `Display` used by GLFW.
|
||||
*
|
||||
* @return The `Display` used by GLFW, or `NULL` if an
|
||||
* [error](@ref error_handling) occurred.
|
||||
*
|
||||
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
|
||||
*
|
||||
* @thread_safety This function may be called from any thread. Access is not
|
||||
* synchronized.
|
||||
*
|
||||
* @since Added in version 3.0.
|
||||
*
|
||||
* @ingroup native
|
||||
*/
|
||||
GLFWAPI Display* glfwGetX11Display(void);
|
||||
|
||||
/*! @brief Returns the `RRCrtc` of the specified monitor.
|
||||
*
|
||||
* @return The `RRCrtc` of the specified monitor, or `None` if an
|
||||
* [error](@ref error_handling) occurred.
|
||||
*
|
||||
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
|
||||
*
|
||||
* @thread_safety This function may be called from any thread. Access is not
|
||||
* synchronized.
|
||||
*
|
||||
* @since Added in version 3.1.
|
||||
*
|
||||
* @ingroup native
|
||||
*/
|
||||
GLFWAPI RRCrtc glfwGetX11Adapter(GLFWmonitor* monitor);
|
||||
|
||||
/*! @brief Returns the `RROutput` of the specified monitor.
|
||||
*
|
||||
* @return The `RROutput` of the specified monitor, or `None` if an
|
||||
* [error](@ref error_handling) occurred.
|
||||
*
|
||||
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
|
||||
*
|
||||
* @thread_safety This function may be called from any thread. Access is not
|
||||
* synchronized.
|
||||
*
|
||||
* @since Added in version 3.1.
|
||||
*
|
||||
* @ingroup native
|
||||
*/
|
||||
GLFWAPI RROutput glfwGetX11Monitor(GLFWmonitor* monitor);
|
||||
|
||||
/*! @brief Returns the `Window` of the specified window.
|
||||
* @return The `Window` of the specified window.
|
||||
*
|
||||
* @return The `Window` of the specified window, or `None` if an
|
||||
* [error](@ref error_handling) occurred.
|
||||
*
|
||||
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
|
||||
*
|
||||
* @thread_safety This function may be called from any thread. Access is not
|
||||
* synchronized.
|
||||
*
|
||||
* @since Added in version 3.0.
|
||||
*
|
||||
* @ingroup native
|
||||
*/
|
||||
GLFWAPI Window glfwGetX11Window(GLFWwindow* window);
|
||||
|
||||
/*! @brief Sets the current primary selection to the specified string.
|
||||
*
|
||||
* @param[in] string A UTF-8 encoded string.
|
||||
*
|
||||
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
|
||||
* GLFW_PLATFORM_ERROR.
|
||||
*
|
||||
* @pointer_lifetime The specified string is copied before this function
|
||||
* returns.
|
||||
*
|
||||
* @thread_safety This function must only be called from the main thread.
|
||||
*
|
||||
* @sa @ref clipboard
|
||||
* @sa glfwGetX11SelectionString
|
||||
* @sa glfwSetClipboardString
|
||||
*
|
||||
* @since Added in version 3.3.
|
||||
*
|
||||
* @ingroup native
|
||||
*/
|
||||
GLFWAPI void glfwSetX11SelectionString(const char* string);
|
||||
|
||||
/*! @brief Returns the contents of the current primary selection as a string.
|
||||
*
|
||||
* If the selection is empty or if its contents cannot be converted, `NULL`
|
||||
* is returned and a @ref GLFW_FORMAT_UNAVAILABLE error is generated.
|
||||
*
|
||||
* @return The contents of the selection as a UTF-8 encoded string, or `NULL`
|
||||
* if an [error](@ref error_handling) occurred.
|
||||
*
|
||||
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
|
||||
* GLFW_PLATFORM_ERROR.
|
||||
*
|
||||
* @pointer_lifetime The returned string is allocated and freed by GLFW. You
|
||||
* should not free it yourself. It is valid until the next call to @ref
|
||||
* glfwGetX11SelectionString or @ref glfwSetX11SelectionString, or until the
|
||||
* library is terminated.
|
||||
*
|
||||
* @thread_safety This function must only be called from the main thread.
|
||||
*
|
||||
* @sa @ref clipboard
|
||||
* @sa glfwSetX11SelectionString
|
||||
* @sa glfwGetClipboardString
|
||||
*
|
||||
* @since Added in version 3.3.
|
||||
*
|
||||
* @ingroup native
|
||||
*/
|
||||
GLFWAPI const char* glfwGetX11SelectionString(void);
|
||||
#endif
|
||||
|
||||
#if defined(GLFW_EXPOSE_NATIVE_GLX)
|
||||
/*! @brief Returns the `GLXContext` of the specified window.
|
||||
* @return The `GLXContext` of the specified window.
|
||||
*
|
||||
* @return The `GLXContext` of the specified window, or `NULL` if an
|
||||
* [error](@ref error_handling) occurred.
|
||||
*
|
||||
* @errors Possible errors include @ref GLFW_NO_WINDOW_CONTEXT and @ref
|
||||
* GLFW_NOT_INITIALIZED.
|
||||
*
|
||||
* @thread_safety This function may be called from any thread. Access is not
|
||||
* synchronized.
|
||||
*
|
||||
* @since Added in version 3.0.
|
||||
*
|
||||
* @ingroup native
|
||||
*/
|
||||
GLFWAPI GLXContext glfwGetGLXContext(GLFWwindow* window);
|
||||
|
||||
/*! @brief Returns the `GLXWindow` of the specified window.
|
||||
*
|
||||
* @return The `GLXWindow` of the specified window, or `None` if an
|
||||
* [error](@ref error_handling) occurred.
|
||||
*
|
||||
* @errors Possible errors include @ref GLFW_NO_WINDOW_CONTEXT and @ref
|
||||
* GLFW_NOT_INITIALIZED.
|
||||
*
|
||||
* @thread_safety This function may be called from any thread. Access is not
|
||||
* synchronized.
|
||||
*
|
||||
* @since Added in version 3.2.
|
||||
*
|
||||
* @ingroup native
|
||||
*/
|
||||
GLFWAPI GLXWindow glfwGetGLXWindow(GLFWwindow* window);
|
||||
#endif
|
||||
|
||||
#if defined(GLFW_EXPOSE_NATIVE_WAYLAND)
|
||||
/*! @brief Returns the `struct wl_display*` used by GLFW.
|
||||
*
|
||||
* @return The `struct wl_display*` used by GLFW, or `NULL` if an
|
||||
* [error](@ref error_handling) occurred.
|
||||
*
|
||||
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
|
||||
*
|
||||
* @thread_safety This function may be called from any thread. Access is not
|
||||
* synchronized.
|
||||
*
|
||||
* @since Added in version 3.2.
|
||||
*
|
||||
* @ingroup native
|
||||
*/
|
||||
GLFWAPI struct wl_display* glfwGetWaylandDisplay(void);
|
||||
|
||||
/*! @brief Returns the `struct wl_output*` of the specified monitor.
|
||||
*
|
||||
* @return The `struct wl_output*` of the specified monitor, or `NULL` if an
|
||||
* [error](@ref error_handling) occurred.
|
||||
*
|
||||
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
|
||||
*
|
||||
* @thread_safety This function may be called from any thread. Access is not
|
||||
* synchronized.
|
||||
*
|
||||
* @since Added in version 3.2.
|
||||
*
|
||||
* @ingroup native
|
||||
*/
|
||||
GLFWAPI struct wl_output* glfwGetWaylandMonitor(GLFWmonitor* monitor);
|
||||
|
||||
/*! @brief Returns the main `struct wl_surface*` of the specified window.
|
||||
*
|
||||
* @return The main `struct wl_surface*` of the specified window, or `NULL` if
|
||||
* an [error](@ref error_handling) occurred.
|
||||
*
|
||||
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
|
||||
*
|
||||
* @thread_safety This function may be called from any thread. Access is not
|
||||
* synchronized.
|
||||
*
|
||||
* @since Added in version 3.2.
|
||||
*
|
||||
* @ingroup native
|
||||
*/
|
||||
GLFWAPI struct wl_surface* glfwGetWaylandWindow(GLFWwindow* window);
|
||||
#endif
|
||||
|
||||
#if defined(GLFW_EXPOSE_NATIVE_EGL)
|
||||
/*! @brief Returns the `EGLDisplay` used by GLFW.
|
||||
* @return The `EGLDisplay` used by GLFW.
|
||||
*
|
||||
* @return The `EGLDisplay` used by GLFW, or `EGL_NO_DISPLAY` if an
|
||||
* [error](@ref error_handling) occurred.
|
||||
*
|
||||
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
|
||||
*
|
||||
* @remark Because EGL is initialized on demand, this function will return
|
||||
* `EGL_NO_DISPLAY` until the first context has been created via EGL.
|
||||
*
|
||||
* @thread_safety This function may be called from any thread. Access is not
|
||||
* synchronized.
|
||||
*
|
||||
* @since Added in version 3.0.
|
||||
*
|
||||
* @ingroup native
|
||||
*/
|
||||
GLFWAPI EGLDisplay glfwGetEGLDisplay(void);
|
||||
|
||||
/*! @brief Returns the `EGLContext` of the specified window.
|
||||
* @return The `EGLContext` of the specified window.
|
||||
*
|
||||
* @return The `EGLContext` of the specified window, or `EGL_NO_CONTEXT` if an
|
||||
* [error](@ref error_handling) occurred.
|
||||
*
|
||||
* @errors Possible errors include @ref GLFW_NO_WINDOW_CONTEXT and @ref
|
||||
* GLFW_NOT_INITIALIZED.
|
||||
*
|
||||
* @thread_safety This function may be called from any thread. Access is not
|
||||
* synchronized.
|
||||
*
|
||||
* @since Added in version 3.0.
|
||||
*
|
||||
* @ingroup native
|
||||
*/
|
||||
GLFWAPI EGLContext glfwGetEGLContext(GLFWwindow* window);
|
||||
|
||||
/*! @brief Returns the `EGLSurface` of the specified window.
|
||||
* @return The `EGLSurface` of the specified window.
|
||||
*
|
||||
* @return The `EGLSurface` of the specified window, or `EGL_NO_SURFACE` if an
|
||||
* [error](@ref error_handling) occurred.
|
||||
*
|
||||
* @errors Possible errors include @ref GLFW_NO_WINDOW_CONTEXT and @ref
|
||||
* GLFW_NOT_INITIALIZED.
|
||||
*
|
||||
* @thread_safety This function may be called from any thread. Access is not
|
||||
* synchronized.
|
||||
*
|
||||
* @since Added in version 3.0.
|
||||
*
|
||||
* @ingroup native
|
||||
*/
|
||||
GLFWAPI EGLSurface glfwGetEGLSurface(GLFWwindow* window);
|
||||
#endif
|
||||
|
||||
#if defined(GLFW_EXPOSE_NATIVE_OSMESA)
|
||||
/*! @brief Retrieves the color buffer associated with the specified window.
|
||||
*
|
||||
* @param[in] window The window whose color buffer to retrieve.
|
||||
* @param[out] width Where to store the width of the color buffer, or `NULL`.
|
||||
* @param[out] height Where to store the height of the color buffer, or `NULL`.
|
||||
* @param[out] format Where to store the OSMesa pixel format of the color
|
||||
* buffer, or `NULL`.
|
||||
* @param[out] buffer Where to store the address of the color buffer, or
|
||||
* `NULL`.
|
||||
* @return `GLFW_TRUE` if successful, or `GLFW_FALSE` if an
|
||||
* [error](@ref error_handling) occurred.
|
||||
*
|
||||
* @errors Possible errors include @ref GLFW_NO_WINDOW_CONTEXT and @ref
|
||||
* GLFW_NOT_INITIALIZED.
|
||||
*
|
||||
* @thread_safety This function may be called from any thread. Access is not
|
||||
* synchronized.
|
||||
*
|
||||
* @since Added in version 3.3.
|
||||
*
|
||||
* @ingroup native
|
||||
*/
|
||||
GLFWAPI int glfwGetOSMesaColorBuffer(GLFWwindow* window, int* width, int* height, int* format, void** buffer);
|
||||
|
||||
/*! @brief Retrieves the depth buffer associated with the specified window.
|
||||
*
|
||||
* @param[in] window The window whose depth buffer to retrieve.
|
||||
* @param[out] width Where to store the width of the depth buffer, or `NULL`.
|
||||
* @param[out] height Where to store the height of the depth buffer, or `NULL`.
|
||||
* @param[out] bytesPerValue Where to store the number of bytes per depth
|
||||
* buffer element, or `NULL`.
|
||||
* @param[out] buffer Where to store the address of the depth buffer, or
|
||||
* `NULL`.
|
||||
* @return `GLFW_TRUE` if successful, or `GLFW_FALSE` if an
|
||||
* [error](@ref error_handling) occurred.
|
||||
*
|
||||
* @errors Possible errors include @ref GLFW_NO_WINDOW_CONTEXT and @ref
|
||||
* GLFW_NOT_INITIALIZED.
|
||||
*
|
||||
* @thread_safety This function may be called from any thread. Access is not
|
||||
* synchronized.
|
||||
*
|
||||
* @since Added in version 3.3.
|
||||
*
|
||||
* @ingroup native
|
||||
*/
|
||||
GLFWAPI int glfwGetOSMesaDepthBuffer(GLFWwindow* window, int* width, int* height, int* bytesPerValue, void** buffer);
|
||||
|
||||
/*! @brief Returns the `OSMesaContext` of the specified window.
|
||||
*
|
||||
* @return The `OSMesaContext` of the specified window, or `NULL` if an
|
||||
* [error](@ref error_handling) occurred.
|
||||
*
|
||||
* @errors Possible errors include @ref GLFW_NO_WINDOW_CONTEXT and @ref
|
||||
* GLFW_NOT_INITIALIZED.
|
||||
*
|
||||
* @thread_safety This function may be called from any thread. Access is not
|
||||
* synchronized.
|
||||
*
|
||||
* @since Added in version 3.3.
|
||||
*
|
||||
* @ingroup native
|
||||
*/
|
||||
GLFWAPI OSMesaContext glfwGetOSMesaContext(GLFWwindow* window);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
109
premake5.lua
Normal file
109
premake5.lua
Normal file
|
@ -0,0 +1,109 @@
|
|||
project "GLFW"
|
||||
kind "StaticLib"
|
||||
language "C"
|
||||
staticruntime "on"
|
||||
|
||||
targetdir ("bin/" .. outputdir .. "/%{prj.name}")
|
||||
objdir ("bin-int/" .. outputdir .. "/%{prj.name}")
|
||||
|
||||
files
|
||||
{
|
||||
"include/GLFW/glfw3.h",
|
||||
"include/GLFW/glfw3native.h",
|
||||
"src/glfw_config.h",
|
||||
"src/context.c",
|
||||
"src/init.c",
|
||||
"src/input.c",
|
||||
"src/monitor.c",
|
||||
"src/vulkan.c",
|
||||
"src/window.c",
|
||||
"src/platform.c",
|
||||
"src/null_init.c",
|
||||
"src/null_monitor.c",
|
||||
"src/null_window.c",
|
||||
"src/null_joystick.c"
|
||||
}
|
||||
filter "system:linux"
|
||||
pic "On"
|
||||
|
||||
systemversion "latest"
|
||||
|
||||
files
|
||||
{
|
||||
"src/x11_init.c",
|
||||
"src/x11_monitor.c",
|
||||
"src/x11_window.c",
|
||||
"src/xkb_unicode.c",
|
||||
"src/posix_time.c",
|
||||
"src/posix_thread.c",
|
||||
"src/posix_module.c",
|
||||
"src/posix_poll.c",
|
||||
"src/glx_context.c",
|
||||
"src/egl_context.c",
|
||||
"src/osmesa_context.c",
|
||||
"src/linux_joystick.c",
|
||||
"src/posix_poll.c"
|
||||
}
|
||||
|
||||
defines
|
||||
{
|
||||
"_GLFW_X11"
|
||||
}
|
||||
filter "system:macosx"
|
||||
pic "On"
|
||||
systemversion "latest"
|
||||
|
||||
sysincludedirs {"include"}
|
||||
files
|
||||
{
|
||||
"src/cocoa_init.m",
|
||||
"src/cocoa_joystick.m",
|
||||
"src/cocoa_monitor.m",
|
||||
"src/cocoa_window.m",
|
||||
"src/cocoa_time.c",
|
||||
"src/posix_thread.c",
|
||||
"src/posix_module.c",
|
||||
"src/posix_poll.c",
|
||||
"src/nsgl_context.m",
|
||||
"src/egl_context.c",
|
||||
"src/osmesa_context.c"
|
||||
}
|
||||
|
||||
defines
|
||||
{
|
||||
defines "_GLFW_COCOA"
|
||||
}
|
||||
|
||||
filter "files:**.m"
|
||||
compileas "Objective-C"
|
||||
|
||||
filter "system:windows"
|
||||
systemversion "latest"
|
||||
|
||||
files
|
||||
{
|
||||
"src/win32_init.c",
|
||||
"src/win32_joystick.c",
|
||||
"src/win32_monitor.c",
|
||||
"src/win32_time.c",
|
||||
"src/win32_thread.c",
|
||||
"src/win32_window.c",
|
||||
"src/win32_module.c",
|
||||
"src/wgl_context.c",
|
||||
"src/egl_context.c",
|
||||
"src/osmesa_context.c"
|
||||
}
|
||||
|
||||
defines
|
||||
{
|
||||
"_GLFW_WIN32",
|
||||
"_CRT_SECURE_NO_WARNINGS"
|
||||
}
|
||||
|
||||
filter "configurations:Debug"
|
||||
runtime "Debug"
|
||||
symbols "on"
|
||||
|
||||
filter "configurations:Release"
|
||||
runtime "Release"
|
||||
optimize "on"
|
|
@ -1,87 +1,400 @@
|
|||
|
||||
include_directories(${GLFW_SOURCE_DIR}/src
|
||||
${GLFW_BINARY_DIR}/src
|
||||
${glfw_INCLUDE_DIRS})
|
||||
|
||||
if (MSVC)
|
||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
||||
endif()
|
||||
|
||||
set(common_HEADERS ${GLFW_SOURCE_DIR}/include/GLFW/glfw3.h internal.h)
|
||||
set(common_SOURCES clipboard.c context.c gamma.c init.c input.c joystick.c
|
||||
monitor.c time.c window.c)
|
||||
|
||||
if (_GLFW_COCOA)
|
||||
set(glfw_HEADERS ${common_HEADERS} cocoa_platform.h)
|
||||
set(glfw_SOURCES ${common_SOURCES} cocoa_clipboard.m cocoa_gamma.c
|
||||
cocoa_init.m cocoa_joystick.m cocoa_monitor.m cocoa_time.c
|
||||
cocoa_window.m)
|
||||
elseif (_GLFW_WIN32)
|
||||
set(glfw_HEADERS ${common_HEADERS} win32_platform.h)
|
||||
set(glfw_SOURCES ${common_SOURCES} win32_clipboard.c win32_gamma.c
|
||||
win32_init.c win32_joystick.c win32_monitor.c win32_time.c
|
||||
win32_window.c)
|
||||
elseif (_GLFW_X11)
|
||||
set(glfw_HEADERS ${common_HEADERS} x11_platform.h)
|
||||
set(glfw_SOURCES ${common_SOURCES} x11_clipboard.c x11_gamma.c x11_init.c
|
||||
x11_joystick.c x11_monitor.c x11_time.c x11_window.c
|
||||
x11_unicode.c)
|
||||
endif()
|
||||
|
||||
if (_GLFW_EGL)
|
||||
list(APPEND glfw_HEADERS ${common_HEADERS} egl_platform.h)
|
||||
list(APPEND glfw_SOURCES ${common_SOURCES} egl_context.c)
|
||||
elseif (_GLFW_NSGL)
|
||||
list(APPEND glfw_HEADERS ${common_HEADERS} nsgl_platform.h)
|
||||
list(APPEND glfw_SOURCES ${common_SOURCES} nsgl_context.m)
|
||||
elseif (_GLFW_WGL)
|
||||
list(APPEND glfw_HEADERS ${common_HEADERS} wgl_platform.h)
|
||||
list(APPEND glfw_SOURCES ${common_SOURCES} wgl_context.c)
|
||||
elseif (_GLFW_X11)
|
||||
list(APPEND glfw_HEADERS ${common_HEADERS} glx_platform.h)
|
||||
list(APPEND glfw_SOURCES ${common_SOURCES} glx_context.c)
|
||||
endif()
|
||||
add_library(glfw ${GLFW_LIBRARY_TYPE}
|
||||
"${GLFW_SOURCE_DIR}/include/GLFW/glfw3.h"
|
||||
"${GLFW_SOURCE_DIR}/include/GLFW/glfw3native.h"
|
||||
internal.h platform.h mappings.h
|
||||
context.c init.c input.c monitor.c platform.c vulkan.c window.c
|
||||
egl_context.c osmesa_context.c null_platform.h null_joystick.h
|
||||
null_init.c null_monitor.c null_window.c null_joystick.c)
|
||||
|
||||
# The time, thread and module code is shared between all backends on a given OS,
|
||||
# including the null backend, which still needs those bits to be functional
|
||||
if (APPLE)
|
||||
# For some reason, CMake doesn't know about .m
|
||||
set_source_files_properties(${glfw_SOURCES} PROPERTIES LANGUAGE C)
|
||||
target_sources(glfw PRIVATE cocoa_time.h cocoa_time.c posix_thread.h
|
||||
posix_module.c posix_thread.c)
|
||||
elseif (WIN32)
|
||||
target_sources(glfw PRIVATE win32_time.h win32_thread.h win32_module.c
|
||||
win32_time.c win32_thread.c)
|
||||
else()
|
||||
target_sources(glfw PRIVATE posix_time.h posix_thread.h posix_module.c
|
||||
posix_time.c posix_thread.c)
|
||||
endif()
|
||||
|
||||
add_library(glfw ${glfw_SOURCES} ${glfw_HEADERS})
|
||||
set_target_properties(glfw PROPERTIES OUTPUT_NAME "${GLFW_LIB_NAME}")
|
||||
add_custom_target(update_mappings
|
||||
COMMAND "${CMAKE_COMMAND}" -P "${GLFW_SOURCE_DIR}/CMake/GenerateMappings.cmake" mappings.h.in mappings.h
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
COMMENT "Updating gamepad mappings from upstream repository"
|
||||
SOURCES mappings.h.in "${GLFW_SOURCE_DIR}/CMake/GenerateMappings.cmake"
|
||||
VERBATIM)
|
||||
|
||||
if (BUILD_SHARED_LIBS)
|
||||
# Include version information in the output
|
||||
set_target_properties(glfw PROPERTIES VERSION ${GLFW_VERSION})
|
||||
if (UNIX)
|
||||
set_target_properties(glfw PROPERTIES SOVERSION ${GLFW_VERSION_MAJOR})
|
||||
set_target_properties(update_mappings PROPERTIES FOLDER "GLFW3")
|
||||
|
||||
if (GLFW_BUILD_COCOA)
|
||||
target_compile_definitions(glfw PRIVATE _GLFW_COCOA)
|
||||
target_sources(glfw PRIVATE cocoa_platform.h cocoa_joystick.h cocoa_init.m
|
||||
cocoa_joystick.m cocoa_monitor.m cocoa_window.m
|
||||
nsgl_context.m)
|
||||
endif()
|
||||
|
||||
if (GLFW_BUILD_WIN32)
|
||||
target_compile_definitions(glfw PRIVATE _GLFW_WIN32)
|
||||
target_sources(glfw PRIVATE win32_platform.h win32_joystick.h win32_init.c
|
||||
win32_joystick.c win32_monitor.c win32_window.c
|
||||
wgl_context.c)
|
||||
endif()
|
||||
|
||||
if (GLFW_BUILD_X11)
|
||||
target_compile_definitions(glfw PRIVATE _GLFW_X11)
|
||||
target_sources(glfw PRIVATE x11_platform.h xkb_unicode.h x11_init.c
|
||||
x11_monitor.c x11_window.c xkb_unicode.c
|
||||
glx_context.c)
|
||||
endif()
|
||||
|
||||
if (GLFW_BUILD_WAYLAND)
|
||||
target_compile_definitions(glfw PRIVATE _GLFW_WAYLAND)
|
||||
target_sources(glfw PRIVATE wl_platform.h xkb_unicode.h wl_init.c
|
||||
wl_monitor.c wl_window.c xkb_unicode.c)
|
||||
endif()
|
||||
|
||||
if (GLFW_BUILD_X11 OR GLFW_BUILD_WAYLAND)
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
target_sources(glfw PRIVATE linux_joystick.h linux_joystick.c)
|
||||
endif()
|
||||
target_sources(glfw PRIVATE posix_poll.h posix_poll.c)
|
||||
endif()
|
||||
|
||||
if (GLFW_BUILD_WAYLAND)
|
||||
include(CheckIncludeFiles)
|
||||
include(CheckFunctionExists)
|
||||
check_function_exists(memfd_create HAVE_MEMFD_CREATE)
|
||||
if (HAVE_MEMFD_CREATE)
|
||||
target_compile_definitions(glfw PRIVATE HAVE_MEMFD_CREATE)
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
# The GLFW DLL needs a special compile-time macro and import library name
|
||||
set_target_properties(glfw PROPERTIES PREFIX "" IMPORT_PREFIX "")
|
||||
find_program(WAYLAND_SCANNER_EXECUTABLE NAMES wayland-scanner)
|
||||
|
||||
include(FindPkgConfig)
|
||||
pkg_check_modules(WAYLAND_PROTOCOLS REQUIRED wayland-protocols>=1.15)
|
||||
pkg_get_variable(WAYLAND_PROTOCOLS_BASE wayland-protocols pkgdatadir)
|
||||
pkg_get_variable(WAYLAND_CLIENT_PKGDATADIR wayland-client pkgdatadir)
|
||||
|
||||
macro(wayland_generate protocol_file output_file)
|
||||
add_custom_command(OUTPUT "${output_file}.h"
|
||||
COMMAND "${WAYLAND_SCANNER_EXECUTABLE}" client-header "${protocol_file}" "${output_file}.h"
|
||||
DEPENDS "${protocol_file}"
|
||||
VERBATIM)
|
||||
|
||||
add_custom_command(OUTPUT "${output_file}-code.h"
|
||||
COMMAND "${WAYLAND_SCANNER_EXECUTABLE}" private-code "${protocol_file}" "${output_file}-code.h"
|
||||
DEPENDS "${protocol_file}"
|
||||
VERBATIM)
|
||||
|
||||
target_sources(glfw PRIVATE "${output_file}.h" "${output_file}-code.h")
|
||||
endmacro()
|
||||
|
||||
wayland_generate(
|
||||
"${WAYLAND_CLIENT_PKGDATADIR}/wayland.xml"
|
||||
"${GLFW_BINARY_DIR}/src/wayland-client-protocol")
|
||||
wayland_generate(
|
||||
"${WAYLAND_PROTOCOLS_BASE}/stable/xdg-shell/xdg-shell.xml"
|
||||
"${GLFW_BINARY_DIR}/src/wayland-xdg-shell-client-protocol")
|
||||
wayland_generate(
|
||||
"${WAYLAND_PROTOCOLS_BASE}/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml"
|
||||
"${GLFW_BINARY_DIR}/src/wayland-xdg-decoration-client-protocol")
|
||||
wayland_generate(
|
||||
"${WAYLAND_PROTOCOLS_BASE}/stable/viewporter/viewporter.xml"
|
||||
"${GLFW_BINARY_DIR}/src/wayland-viewporter-client-protocol")
|
||||
wayland_generate(
|
||||
"${WAYLAND_PROTOCOLS_BASE}/unstable/relative-pointer/relative-pointer-unstable-v1.xml"
|
||||
"${GLFW_BINARY_DIR}/src/wayland-relative-pointer-unstable-v1-client-protocol")
|
||||
wayland_generate(
|
||||
"${WAYLAND_PROTOCOLS_BASE}/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml"
|
||||
"${GLFW_BINARY_DIR}/src/wayland-pointer-constraints-unstable-v1-client-protocol")
|
||||
wayland_generate(
|
||||
"${WAYLAND_PROTOCOLS_BASE}/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml"
|
||||
"${GLFW_BINARY_DIR}/src/wayland-idle-inhibit-unstable-v1-client-protocol")
|
||||
endif()
|
||||
|
||||
if (WIN32 AND GLFW_BUILD_SHARED_LIBRARY)
|
||||
configure_file(glfw.rc.in glfw.rc @ONLY)
|
||||
target_sources(glfw PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/glfw.rc")
|
||||
endif()
|
||||
|
||||
if (UNIX AND GLFW_BUILD_SHARED_LIBRARY)
|
||||
# On Unix-like systems, shared libraries can use the soname system.
|
||||
set(GLFW_LIB_NAME glfw)
|
||||
else()
|
||||
set(GLFW_LIB_NAME glfw3)
|
||||
endif()
|
||||
|
||||
set_target_properties(glfw PROPERTIES
|
||||
OUTPUT_NAME ${GLFW_LIB_NAME}
|
||||
VERSION ${GLFW_VERSION_MAJOR}.${GLFW_VERSION_MINOR}
|
||||
SOVERSION ${GLFW_VERSION_MAJOR}
|
||||
POSITION_INDEPENDENT_CODE ON
|
||||
C_STANDARD 99
|
||||
C_EXTENSIONS OFF
|
||||
DEFINE_SYMBOL _GLFW_BUILD_DLL
|
||||
FOLDER "GLFW3")
|
||||
|
||||
target_include_directories(glfw PUBLIC
|
||||
"$<BUILD_INTERFACE:${GLFW_SOURCE_DIR}/include>"
|
||||
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")
|
||||
target_include_directories(glfw PRIVATE
|
||||
"${GLFW_SOURCE_DIR}/src"
|
||||
"${GLFW_BINARY_DIR}/src")
|
||||
target_link_libraries(glfw PRIVATE Threads::Threads)
|
||||
|
||||
# Workaround for CMake not knowing about .m files before version 3.16
|
||||
if (CMAKE_VERSION VERSION_LESS "3.16" AND APPLE)
|
||||
set_source_files_properties(cocoa_init.m cocoa_joystick.m cocoa_monitor.m
|
||||
cocoa_window.m nsgl_context.m PROPERTIES
|
||||
LANGUAGE C)
|
||||
endif()
|
||||
|
||||
if (GLFW_BUILD_WIN32)
|
||||
list(APPEND glfw_PKG_LIBS "-lgdi32")
|
||||
endif()
|
||||
|
||||
if (GLFW_BUILD_COCOA)
|
||||
target_link_libraries(glfw PRIVATE "-framework Cocoa"
|
||||
"-framework IOKit"
|
||||
"-framework CoreFoundation")
|
||||
|
||||
set(glfw_PKG_DEPS "")
|
||||
set(glfw_PKG_LIBS "-framework Cocoa -framework IOKit -framework CoreFoundation")
|
||||
endif()
|
||||
|
||||
if (GLFW_BUILD_WAYLAND)
|
||||
pkg_check_modules(Wayland REQUIRED
|
||||
wayland-client>=0.2.7
|
||||
wayland-cursor>=0.2.7
|
||||
wayland-egl>=0.2.7
|
||||
xkbcommon>=0.5.0)
|
||||
|
||||
target_include_directories(glfw PRIVATE ${Wayland_INCLUDE_DIRS})
|
||||
|
||||
if (NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
find_package(EpollShim)
|
||||
if (EPOLLSHIM_FOUND)
|
||||
target_include_directories(glfw PRIVATE ${EPOLLSHIM_INCLUDE_DIRS})
|
||||
target_link_libraries(glfw PRIVATE ${EPOLLSHIM_LIBRARIES})
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (GLFW_BUILD_X11)
|
||||
find_package(X11 REQUIRED)
|
||||
target_include_directories(glfw PRIVATE "${X11_X11_INCLUDE_PATH}")
|
||||
|
||||
# Check for XRandR (modern resolution switching and gamma control)
|
||||
if (NOT X11_Xrandr_INCLUDE_PATH)
|
||||
message(FATAL_ERROR "RandR headers not found; install libxrandr development package")
|
||||
endif()
|
||||
target_include_directories(glfw PRIVATE "${X11_Xrandr_INCLUDE_PATH}")
|
||||
|
||||
# Check for Xinerama (legacy multi-monitor support)
|
||||
if (NOT X11_Xinerama_INCLUDE_PATH)
|
||||
message(FATAL_ERROR "Xinerama headers not found; install libxinerama development package")
|
||||
endif()
|
||||
target_include_directories(glfw PRIVATE "${X11_Xinerama_INCLUDE_PATH}")
|
||||
|
||||
# Check for Xkb (X keyboard extension)
|
||||
if (NOT X11_Xkb_INCLUDE_PATH)
|
||||
message(FATAL_ERROR "XKB headers not found; install X11 development package")
|
||||
endif()
|
||||
target_include_directories(glfw PRIVATE "${X11_Xkb_INCLUDE_PATH}")
|
||||
|
||||
# Check for Xcursor (cursor creation from RGBA images)
|
||||
if (NOT X11_Xcursor_INCLUDE_PATH)
|
||||
message(FATAL_ERROR "Xcursor headers not found; install libxcursor development package")
|
||||
endif()
|
||||
target_include_directories(glfw PRIVATE "${X11_Xcursor_INCLUDE_PATH}")
|
||||
|
||||
# Check for XInput (modern HID input)
|
||||
if (NOT X11_Xi_INCLUDE_PATH)
|
||||
message(FATAL_ERROR "XInput headers not found; install libxi development package")
|
||||
endif()
|
||||
target_include_directories(glfw PRIVATE "${X11_Xi_INCLUDE_PATH}")
|
||||
|
||||
# Check for X Shape (custom window input shape)
|
||||
if (NOT X11_Xshape_INCLUDE_PATH)
|
||||
message(FATAL_ERROR "X Shape headers not found; install libxext development package")
|
||||
endif()
|
||||
target_include_directories(glfw PRIVATE "${X11_Xshape_INCLUDE_PATH}")
|
||||
endif()
|
||||
|
||||
if (UNIX AND NOT APPLE)
|
||||
find_library(RT_LIBRARY rt)
|
||||
mark_as_advanced(RT_LIBRARY)
|
||||
if (RT_LIBRARY)
|
||||
target_link_libraries(glfw PRIVATE "${RT_LIBRARY}")
|
||||
list(APPEND glfw_PKG_LIBS "-lrt")
|
||||
endif()
|
||||
|
||||
find_library(MATH_LIBRARY m)
|
||||
mark_as_advanced(MATH_LIBRARY)
|
||||
if (MATH_LIBRARY)
|
||||
target_link_libraries(glfw PRIVATE "${MATH_LIBRARY}")
|
||||
list(APPEND glfw_PKG_LIBS "-lm")
|
||||
endif()
|
||||
|
||||
if (CMAKE_DL_LIBS)
|
||||
target_link_libraries(glfw PRIVATE "${CMAKE_DL_LIBS}")
|
||||
list(APPEND glfw_PKG_LIBS "-l${CMAKE_DL_LIBS}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Make GCC warn about declarations that VS 2010 and 2012 won't accept for all
|
||||
# source files that VS will build (Clang ignores this because we set -std=c99)
|
||||
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||
set_source_files_properties(context.c init.c input.c monitor.c platform.c vulkan.c
|
||||
window.c null_init.c null_joystick.c null_monitor.c
|
||||
null_window.c win32_init.c win32_joystick.c win32_module.c
|
||||
win32_monitor.c win32_time.c win32_thread.c win32_window.c
|
||||
wgl_context.c egl_context.c osmesa_context.c PROPERTIES
|
||||
COMPILE_FLAGS -Wdeclaration-after-statement)
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
if (GLFW_USE_HYBRID_HPG)
|
||||
target_compile_definitions(glfw PRIVATE _GLFW_USE_HYBRID_HPG)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Enable a reasonable set of warnings
|
||||
# NOTE: The order matters here, Clang-CL matches both MSVC and Clang
|
||||
if (MSVC)
|
||||
target_compile_options(glfw PRIVATE "/W3")
|
||||
elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR
|
||||
CMAKE_C_COMPILER_ID STREQUAL "Clang" OR
|
||||
CMAKE_C_COMPILER_ID STREQUAL "AppleClang")
|
||||
|
||||
target_compile_options(glfw PRIVATE "-Wall")
|
||||
endif()
|
||||
|
||||
if (GLFW_BUILD_WIN32)
|
||||
target_compile_definitions(glfw PRIVATE UNICODE _UNICODE)
|
||||
endif()
|
||||
|
||||
# HACK: When building on MinGW, WINVER and UNICODE need to be defined before
|
||||
# the inclusion of stddef.h (by glfw3.h), which is itself included before
|
||||
# win32_platform.h. We define them here until a saner solution can be found
|
||||
# NOTE: MinGW-w64 and Visual C++ do /not/ need this hack.
|
||||
if (MINGW)
|
||||
target_compile_definitions(glfw PRIVATE WINVER=0x0501)
|
||||
endif()
|
||||
|
||||
# Workaround for legacy MinGW not providing XInput and DirectInput
|
||||
if (MINGW)
|
||||
include(CheckIncludeFile)
|
||||
check_include_file(dinput.h DINPUT_H_FOUND)
|
||||
check_include_file(xinput.h XINPUT_H_FOUND)
|
||||
if (NOT DINPUT_H_FOUND OR NOT XINPUT_H_FOUND)
|
||||
target_include_directories(glfw PRIVATE "${GLFW_SOURCE_DIR}/deps/mingw")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Workaround for the MS CRT deprecating parts of the standard library
|
||||
if (MSVC OR CMAKE_C_SIMULATE_ID STREQUAL "MSVC")
|
||||
target_compile_definitions(glfw PRIVATE _CRT_SECURE_NO_WARNINGS)
|
||||
endif()
|
||||
|
||||
# Workaround for VS 2008 not shipping with stdint.h
|
||||
if (MSVC90)
|
||||
target_include_directories(glfw PUBLIC "${GLFW_SOURCE_DIR}/deps/vs2008")
|
||||
endif()
|
||||
|
||||
# Check for the DirectX 9 SDK as it is not included with VS 2008
|
||||
if (MSVC90)
|
||||
include(CheckIncludeFile)
|
||||
check_include_file(dinput.h DINPUT_H_FOUND)
|
||||
if (NOT DINPUT_H_FOUND)
|
||||
message(FATAL_ERROR "DirectX 9 headers not found; install DirectX 9 SDK")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Workaround for -std=c99 on Linux disabling _DEFAULT_SOURCE (POSIX 2008 and more)
|
||||
if (GLFW_BUILD_X11 OR GLFW_BUILD_WAYLAND)
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
target_compile_definitions(glfw PRIVATE _DEFAULT_SOURCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (GLFW_BUILD_SHARED_LIBRARY)
|
||||
if (WIN32)
|
||||
if (MINGW)
|
||||
# Remove the dependency on the shared version of libgcc
|
||||
# NOTE: MinGW-w64 has the correct default but MinGW needs this
|
||||
target_link_libraries(glfw PRIVATE "-static-libgcc")
|
||||
|
||||
# Remove the lib prefix on the DLL (but not the import library)
|
||||
set_target_properties(glfw PROPERTIES PREFIX "")
|
||||
|
||||
# Add a suffix to the import library to avoid naming conflicts
|
||||
set_target_properties(glfw PROPERTIES IMPORT_SUFFIX "dll.a")
|
||||
else()
|
||||
# Add a suffix to the import library to avoid naming conflicts
|
||||
set_target_properties(glfw PROPERTIES IMPORT_SUFFIX "dll.lib")
|
||||
endif()
|
||||
elseif (APPLE)
|
||||
# Append -fno-common to the compile flags to work around a bug in
|
||||
# Apple's GCC
|
||||
get_target_property(glfw_CFLAGS glfw COMPILE_FLAGS)
|
||||
if (NOT glfw_CFLAGS)
|
||||
set(glfw_CFLAGS "")
|
||||
endif()
|
||||
set_target_properties(glfw PROPERTIES
|
||||
COMPILE_FLAGS "${glfw_CFLAGS} -fno-common")
|
||||
|
||||
target_compile_definitions(glfw INTERFACE GLFW_DLL)
|
||||
endif()
|
||||
|
||||
target_link_libraries(glfw ${glfw_LIBRARIES})
|
||||
target_link_libraries(glfw LINK_INTERFACE_LIBRARIES)
|
||||
if (MINGW)
|
||||
# Enable link-time exploit mitigation features enabled by default on MSVC
|
||||
include(CheckCCompilerFlag)
|
||||
|
||||
# Compatibility with data execution prevention (DEP)
|
||||
set(CMAKE_REQUIRED_FLAGS "-Wl,--nxcompat")
|
||||
check_c_compiler_flag("" _GLFW_HAS_DEP)
|
||||
if (_GLFW_HAS_DEP)
|
||||
target_link_libraries(glfw PRIVATE "-Wl,--nxcompat")
|
||||
endif()
|
||||
|
||||
# Compatibility with address space layout randomization (ASLR)
|
||||
set(CMAKE_REQUIRED_FLAGS "-Wl,--dynamicbase")
|
||||
check_c_compiler_flag("" _GLFW_HAS_ASLR)
|
||||
if (_GLFW_HAS_ASLR)
|
||||
target_link_libraries(glfw PRIVATE "-Wl,--dynamicbase")
|
||||
endif()
|
||||
|
||||
# Compatibility with 64-bit address space layout randomization (ASLR)
|
||||
set(CMAKE_REQUIRED_FLAGS "-Wl,--high-entropy-va")
|
||||
check_c_compiler_flag("" _GLFW_HAS_64ASLR)
|
||||
if (_GLFW_HAS_64ASLR)
|
||||
target_link_libraries(glfw PRIVATE "-Wl,--high-entropy-va")
|
||||
endif()
|
||||
|
||||
# Clear flags again to avoid breaking later tests
|
||||
set(CMAKE_REQUIRED_FLAGS)
|
||||
endif()
|
||||
|
||||
if (UNIX)
|
||||
# Hide symbols not explicitly tagged for export from the shared library
|
||||
target_compile_options(glfw PRIVATE "-fvisibility=hidden")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
foreach(arg ${glfw_PKG_DEPS})
|
||||
string(APPEND deps " ${arg}")
|
||||
endforeach()
|
||||
foreach(arg ${glfw_PKG_LIBS})
|
||||
string(APPEND libs " ${arg}")
|
||||
endforeach()
|
||||
|
||||
set(GLFW_PKG_CONFIG_REQUIRES_PRIVATE "${deps}" CACHE INTERNAL
|
||||
"GLFW pkg-config Requires.private")
|
||||
set(GLFW_PKG_CONFIG_LIBS_PRIVATE "${libs}" CACHE INTERNAL
|
||||
"GLFW pkg-config Libs.private")
|
||||
|
||||
configure_file("${GLFW_SOURCE_DIR}/CMake/glfw3.pc.in" glfw3.pc @ONLY)
|
||||
|
||||
if (GLFW_INSTALL)
|
||||
install(TARGETS glfw EXPORT glfwTargets DESTINATION lib${LIB_SUFFIX})
|
||||
install(TARGETS glfw
|
||||
EXPORT glfwTargets
|
||||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
||||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
||||
endif()
|
||||
|
||||
|
|
|
@ -1,87 +0,0 @@
|
|||
//========================================================================
|
||||
// GLFW - An OpenGL library
|
||||
// Platform: Cocoa
|
||||
// API version: 3.0
|
||||
// WWW: http://www.glfw.org/
|
||||
//------------------------------------------------------------------------
|
||||
// Copyright (c) 2010 Camilla Berglund <elmindreda@elmindreda.org>
|
||||
//
|
||||
// This software is provided 'as-is', without any express or implied
|
||||
// warranty. In no event will the authors be held liable for any damages
|
||||
// arising from the use of this software.
|
||||
//
|
||||
// Permission is granted to anyone to use this software for any purpose,
|
||||
// including commercial applications, and to alter it and redistribute it
|
||||
// freely, subject to the following restrictions:
|
||||
//
|
||||
// 1. The origin of this software must not be misrepresented; you must not
|
||||
// claim that you wrote the original software. If you use this software
|
||||
// in a product, an acknowledgment in the product documentation would
|
||||
// be appreciated but is not required.
|
||||
//
|
||||
// 2. Altered source versions must be plainly marked as such, and must not
|
||||
// be misrepresented as being the original software.
|
||||
//
|
||||
// 3. This notice may not be removed or altered from any source
|
||||
// distribution.
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
#include "internal.h"
|
||||
|
||||
#include <limits.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <ApplicationServices/ApplicationServices.h>
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
////// GLFW platform API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void _glfwPlatformGetGammaRamp(_GLFWmonitor* monitor, GLFWgammaramp* ramp)
|
||||
{
|
||||
uint32_t i, size = CGDisplayGammaTableCapacity(monitor->ns.displayID);
|
||||
CGGammaValue* values = (CGGammaValue*) malloc(size * 3 * sizeof(CGGammaValue));
|
||||
|
||||
CGGetDisplayTransferByTable(monitor->ns.displayID,
|
||||
size,
|
||||
values,
|
||||
values + size,
|
||||
values + size * 2,
|
||||
&size);
|
||||
|
||||
_glfwAllocGammaRamp(ramp, size);
|
||||
|
||||
for (i = 0; i < size; i++)
|
||||
{
|
||||
ramp->red[i] = (unsigned short) (values[i] * 65535);
|
||||
ramp->green[i] = (unsigned short) (values[i + size] * 65535);
|
||||
ramp->blue[i] = (unsigned short) (values[i + size * 2] * 65535);
|
||||
}
|
||||
|
||||
free(values);
|
||||
}
|
||||
|
||||
void _glfwPlatformSetGammaRamp(_GLFWmonitor* monitor, const GLFWgammaramp* ramp)
|
||||
{
|
||||
int i;
|
||||
CGGammaValue* values = (CGGammaValue*) malloc(ramp->size * 3 * sizeof(CGGammaValue));
|
||||
|
||||
for (i = 0; i < ramp->size; i++)
|
||||
{
|
||||
values[i] = ramp->red[i] / 65535.f;
|
||||
values[i + ramp->size] = ramp->green[i] / 65535.f;
|
||||
values[i + ramp->size * 2] = ramp->blue[i] / 65535.f;
|
||||
}
|
||||
|
||||
CGSetDisplayTransferByTable(monitor->ns.displayID,
|
||||
ramp->size,
|
||||
values,
|
||||
values + ramp->size,
|
||||
values + ramp->size * 2);
|
||||
|
||||
free(values);
|
||||
}
|
||||
|
648
src/cocoa_init.m
648
src/cocoa_init.m
|
@ -1,10 +1,7 @@
|
|||
//========================================================================
|
||||
// GLFW - An OpenGL library
|
||||
// Platform: Cocoa/NSOpenGL
|
||||
// API Version: 3.0
|
||||
// WWW: http://www.glfw.org/
|
||||
// GLFW 3.4 macOS - www.glfw.org
|
||||
//------------------------------------------------------------------------
|
||||
// Copyright (c) 2009-2010 Camilla Berglund <elmindreda@elmindreda.org>
|
||||
// Copyright (c) 2009-2019 Camilla Löwy <elmindreda@glfw.org>
|
||||
//
|
||||
// This software is provided 'as-is', without any express or implied
|
||||
// warranty. In no event will the authors be held liable for any damages
|
||||
|
@ -26,12 +23,17 @@
|
|||
// distribution.
|
||||
//
|
||||
//========================================================================
|
||||
// It is fine to use C99 in this file because it will not be built with VS
|
||||
//========================================================================
|
||||
|
||||
#include "internal.h"
|
||||
|
||||
#if defined(_GLFW_COCOA)
|
||||
|
||||
#include <sys/param.h> // For MAXPATHLEN
|
||||
|
||||
|
||||
#if defined(_GLFW_USE_CHDIR)
|
||||
// Needed for _NSGetProgname
|
||||
#include <crt_externs.h>
|
||||
|
||||
// Change to our application bundle's resources directory, if present
|
||||
//
|
||||
|
@ -69,77 +71,627 @@ static void changeToResourcesDirectory(void)
|
|||
chdir(resourcesPath);
|
||||
}
|
||||
|
||||
#endif /* _GLFW_USE_CHDIR */
|
||||
// Set up the menu bar (manually)
|
||||
// This is nasty, nasty stuff -- calls to undocumented semi-private APIs that
|
||||
// could go away at any moment, lots of stuff that really should be
|
||||
// localize(d|able), etc. Add a nib to save us this horror.
|
||||
//
|
||||
static void createMenuBar(void)
|
||||
{
|
||||
NSString* appName = nil;
|
||||
NSDictionary* bundleInfo = [[NSBundle mainBundle] infoDictionary];
|
||||
NSString* nameKeys[] =
|
||||
{
|
||||
@"CFBundleDisplayName",
|
||||
@"CFBundleName",
|
||||
@"CFBundleExecutable",
|
||||
};
|
||||
|
||||
// Try to figure out what the calling application is called
|
||||
|
||||
for (size_t i = 0; i < sizeof(nameKeys) / sizeof(nameKeys[0]); i++)
|
||||
{
|
||||
id name = bundleInfo[nameKeys[i]];
|
||||
if (name &&
|
||||
[name isKindOfClass:[NSString class]] &&
|
||||
![name isEqualToString:@""])
|
||||
{
|
||||
appName = name;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!appName)
|
||||
{
|
||||
char** progname = _NSGetProgname();
|
||||
if (progname && *progname)
|
||||
appName = @(*progname);
|
||||
else
|
||||
appName = @"GLFW Application";
|
||||
}
|
||||
|
||||
NSMenu* bar = [[NSMenu alloc] init];
|
||||
[NSApp setMainMenu:bar];
|
||||
|
||||
NSMenuItem* appMenuItem =
|
||||
[bar addItemWithTitle:@"" action:NULL keyEquivalent:@""];
|
||||
NSMenu* appMenu = [[NSMenu alloc] init];
|
||||
[appMenuItem setSubmenu:appMenu];
|
||||
|
||||
[appMenu addItemWithTitle:[NSString stringWithFormat:@"About %@", appName]
|
||||
action:@selector(orderFrontStandardAboutPanel:)
|
||||
keyEquivalent:@""];
|
||||
[appMenu addItem:[NSMenuItem separatorItem]];
|
||||
NSMenu* servicesMenu = [[NSMenu alloc] init];
|
||||
[NSApp setServicesMenu:servicesMenu];
|
||||
[[appMenu addItemWithTitle:@"Services"
|
||||
action:NULL
|
||||
keyEquivalent:@""] setSubmenu:servicesMenu];
|
||||
[servicesMenu release];
|
||||
[appMenu addItem:[NSMenuItem separatorItem]];
|
||||
[appMenu addItemWithTitle:[NSString stringWithFormat:@"Hide %@", appName]
|
||||
action:@selector(hide:)
|
||||
keyEquivalent:@"h"];
|
||||
[[appMenu addItemWithTitle:@"Hide Others"
|
||||
action:@selector(hideOtherApplications:)
|
||||
keyEquivalent:@"h"]
|
||||
setKeyEquivalentModifierMask:NSEventModifierFlagOption | NSEventModifierFlagCommand];
|
||||
[appMenu addItemWithTitle:@"Show All"
|
||||
action:@selector(unhideAllApplications:)
|
||||
keyEquivalent:@""];
|
||||
[appMenu addItem:[NSMenuItem separatorItem]];
|
||||
[appMenu addItemWithTitle:[NSString stringWithFormat:@"Quit %@", appName]
|
||||
action:@selector(terminate:)
|
||||
keyEquivalent:@"q"];
|
||||
|
||||
NSMenuItem* windowMenuItem =
|
||||
[bar addItemWithTitle:@"" action:NULL keyEquivalent:@""];
|
||||
[bar release];
|
||||
NSMenu* windowMenu = [[NSMenu alloc] initWithTitle:@"Window"];
|
||||
[NSApp setWindowsMenu:windowMenu];
|
||||
[windowMenuItem setSubmenu:windowMenu];
|
||||
|
||||
[windowMenu addItemWithTitle:@"Minimize"
|
||||
action:@selector(performMiniaturize:)
|
||||
keyEquivalent:@"m"];
|
||||
[windowMenu addItemWithTitle:@"Zoom"
|
||||
action:@selector(performZoom:)
|
||||
keyEquivalent:@""];
|
||||
[windowMenu addItem:[NSMenuItem separatorItem]];
|
||||
[windowMenu addItemWithTitle:@"Bring All to Front"
|
||||
action:@selector(arrangeInFront:)
|
||||
keyEquivalent:@""];
|
||||
|
||||
// TODO: Make this appear at the bottom of the menu (for consistency)
|
||||
[windowMenu addItem:[NSMenuItem separatorItem]];
|
||||
[[windowMenu addItemWithTitle:@"Enter Full Screen"
|
||||
action:@selector(toggleFullScreen:)
|
||||
keyEquivalent:@"f"]
|
||||
setKeyEquivalentModifierMask:NSEventModifierFlagControl | NSEventModifierFlagCommand];
|
||||
|
||||
// Prior to Snow Leopard, we need to use this oddly-named semi-private API
|
||||
// to get the application menu working properly.
|
||||
SEL setAppleMenuSelector = NSSelectorFromString(@"setAppleMenu:");
|
||||
[NSApp performSelector:setAppleMenuSelector withObject:appMenu];
|
||||
}
|
||||
|
||||
// Create key code translation tables
|
||||
//
|
||||
static void createKeyTables(void)
|
||||
{
|
||||
memset(_glfw.ns.keycodes, -1, sizeof(_glfw.ns.keycodes));
|
||||
memset(_glfw.ns.scancodes, -1, sizeof(_glfw.ns.scancodes));
|
||||
|
||||
_glfw.ns.keycodes[0x1D] = GLFW_KEY_0;
|
||||
_glfw.ns.keycodes[0x12] = GLFW_KEY_1;
|
||||
_glfw.ns.keycodes[0x13] = GLFW_KEY_2;
|
||||
_glfw.ns.keycodes[0x14] = GLFW_KEY_3;
|
||||
_glfw.ns.keycodes[0x15] = GLFW_KEY_4;
|
||||
_glfw.ns.keycodes[0x17] = GLFW_KEY_5;
|
||||
_glfw.ns.keycodes[0x16] = GLFW_KEY_6;
|
||||
_glfw.ns.keycodes[0x1A] = GLFW_KEY_7;
|
||||
_glfw.ns.keycodes[0x1C] = GLFW_KEY_8;
|
||||
_glfw.ns.keycodes[0x19] = GLFW_KEY_9;
|
||||
_glfw.ns.keycodes[0x00] = GLFW_KEY_A;
|
||||
_glfw.ns.keycodes[0x0B] = GLFW_KEY_B;
|
||||
_glfw.ns.keycodes[0x08] = GLFW_KEY_C;
|
||||
_glfw.ns.keycodes[0x02] = GLFW_KEY_D;
|
||||
_glfw.ns.keycodes[0x0E] = GLFW_KEY_E;
|
||||
_glfw.ns.keycodes[0x03] = GLFW_KEY_F;
|
||||
_glfw.ns.keycodes[0x05] = GLFW_KEY_G;
|
||||
_glfw.ns.keycodes[0x04] = GLFW_KEY_H;
|
||||
_glfw.ns.keycodes[0x22] = GLFW_KEY_I;
|
||||
_glfw.ns.keycodes[0x26] = GLFW_KEY_J;
|
||||
_glfw.ns.keycodes[0x28] = GLFW_KEY_K;
|
||||
_glfw.ns.keycodes[0x25] = GLFW_KEY_L;
|
||||
_glfw.ns.keycodes[0x2E] = GLFW_KEY_M;
|
||||
_glfw.ns.keycodes[0x2D] = GLFW_KEY_N;
|
||||
_glfw.ns.keycodes[0x1F] = GLFW_KEY_O;
|
||||
_glfw.ns.keycodes[0x23] = GLFW_KEY_P;
|
||||
_glfw.ns.keycodes[0x0C] = GLFW_KEY_Q;
|
||||
_glfw.ns.keycodes[0x0F] = GLFW_KEY_R;
|
||||
_glfw.ns.keycodes[0x01] = GLFW_KEY_S;
|
||||
_glfw.ns.keycodes[0x11] = GLFW_KEY_T;
|
||||
_glfw.ns.keycodes[0x20] = GLFW_KEY_U;
|
||||
_glfw.ns.keycodes[0x09] = GLFW_KEY_V;
|
||||
_glfw.ns.keycodes[0x0D] = GLFW_KEY_W;
|
||||
_glfw.ns.keycodes[0x07] = GLFW_KEY_X;
|
||||
_glfw.ns.keycodes[0x10] = GLFW_KEY_Y;
|
||||
_glfw.ns.keycodes[0x06] = GLFW_KEY_Z;
|
||||
|
||||
_glfw.ns.keycodes[0x27] = GLFW_KEY_APOSTROPHE;
|
||||
_glfw.ns.keycodes[0x2A] = GLFW_KEY_BACKSLASH;
|
||||
_glfw.ns.keycodes[0x2B] = GLFW_KEY_COMMA;
|
||||
_glfw.ns.keycodes[0x18] = GLFW_KEY_EQUAL;
|
||||
_glfw.ns.keycodes[0x32] = GLFW_KEY_GRAVE_ACCENT;
|
||||
_glfw.ns.keycodes[0x21] = GLFW_KEY_LEFT_BRACKET;
|
||||
_glfw.ns.keycodes[0x1B] = GLFW_KEY_MINUS;
|
||||
_glfw.ns.keycodes[0x2F] = GLFW_KEY_PERIOD;
|
||||
_glfw.ns.keycodes[0x1E] = GLFW_KEY_RIGHT_BRACKET;
|
||||
_glfw.ns.keycodes[0x29] = GLFW_KEY_SEMICOLON;
|
||||
_glfw.ns.keycodes[0x2C] = GLFW_KEY_SLASH;
|
||||
_glfw.ns.keycodes[0x0A] = GLFW_KEY_WORLD_1;
|
||||
|
||||
_glfw.ns.keycodes[0x33] = GLFW_KEY_BACKSPACE;
|
||||
_glfw.ns.keycodes[0x39] = GLFW_KEY_CAPS_LOCK;
|
||||
_glfw.ns.keycodes[0x75] = GLFW_KEY_DELETE;
|
||||
_glfw.ns.keycodes[0x7D] = GLFW_KEY_DOWN;
|
||||
_glfw.ns.keycodes[0x77] = GLFW_KEY_END;
|
||||
_glfw.ns.keycodes[0x24] = GLFW_KEY_ENTER;
|
||||
_glfw.ns.keycodes[0x35] = GLFW_KEY_ESCAPE;
|
||||
_glfw.ns.keycodes[0x7A] = GLFW_KEY_F1;
|
||||
_glfw.ns.keycodes[0x78] = GLFW_KEY_F2;
|
||||
_glfw.ns.keycodes[0x63] = GLFW_KEY_F3;
|
||||
_glfw.ns.keycodes[0x76] = GLFW_KEY_F4;
|
||||
_glfw.ns.keycodes[0x60] = GLFW_KEY_F5;
|
||||
_glfw.ns.keycodes[0x61] = GLFW_KEY_F6;
|
||||
_glfw.ns.keycodes[0x62] = GLFW_KEY_F7;
|
||||
_glfw.ns.keycodes[0x64] = GLFW_KEY_F8;
|
||||
_glfw.ns.keycodes[0x65] = GLFW_KEY_F9;
|
||||
_glfw.ns.keycodes[0x6D] = GLFW_KEY_F10;
|
||||
_glfw.ns.keycodes[0x67] = GLFW_KEY_F11;
|
||||
_glfw.ns.keycodes[0x6F] = GLFW_KEY_F12;
|
||||
_glfw.ns.keycodes[0x69] = GLFW_KEY_PRINT_SCREEN;
|
||||
_glfw.ns.keycodes[0x6B] = GLFW_KEY_F14;
|
||||
_glfw.ns.keycodes[0x71] = GLFW_KEY_F15;
|
||||
_glfw.ns.keycodes[0x6A] = GLFW_KEY_F16;
|
||||
_glfw.ns.keycodes[0x40] = GLFW_KEY_F17;
|
||||
_glfw.ns.keycodes[0x4F] = GLFW_KEY_F18;
|
||||
_glfw.ns.keycodes[0x50] = GLFW_KEY_F19;
|
||||
_glfw.ns.keycodes[0x5A] = GLFW_KEY_F20;
|
||||
_glfw.ns.keycodes[0x73] = GLFW_KEY_HOME;
|
||||
_glfw.ns.keycodes[0x72] = GLFW_KEY_INSERT;
|
||||
_glfw.ns.keycodes[0x7B] = GLFW_KEY_LEFT;
|
||||
_glfw.ns.keycodes[0x3A] = GLFW_KEY_LEFT_ALT;
|
||||
_glfw.ns.keycodes[0x3B] = GLFW_KEY_LEFT_CONTROL;
|
||||
_glfw.ns.keycodes[0x38] = GLFW_KEY_LEFT_SHIFT;
|
||||
_glfw.ns.keycodes[0x37] = GLFW_KEY_LEFT_SUPER;
|
||||
_glfw.ns.keycodes[0x6E] = GLFW_KEY_MENU;
|
||||
_glfw.ns.keycodes[0x47] = GLFW_KEY_NUM_LOCK;
|
||||
_glfw.ns.keycodes[0x79] = GLFW_KEY_PAGE_DOWN;
|
||||
_glfw.ns.keycodes[0x74] = GLFW_KEY_PAGE_UP;
|
||||
_glfw.ns.keycodes[0x7C] = GLFW_KEY_RIGHT;
|
||||
_glfw.ns.keycodes[0x3D] = GLFW_KEY_RIGHT_ALT;
|
||||
_glfw.ns.keycodes[0x3E] = GLFW_KEY_RIGHT_CONTROL;
|
||||
_glfw.ns.keycodes[0x3C] = GLFW_KEY_RIGHT_SHIFT;
|
||||
_glfw.ns.keycodes[0x36] = GLFW_KEY_RIGHT_SUPER;
|
||||
_glfw.ns.keycodes[0x31] = GLFW_KEY_SPACE;
|
||||
_glfw.ns.keycodes[0x30] = GLFW_KEY_TAB;
|
||||
_glfw.ns.keycodes[0x7E] = GLFW_KEY_UP;
|
||||
|
||||
_glfw.ns.keycodes[0x52] = GLFW_KEY_KP_0;
|
||||
_glfw.ns.keycodes[0x53] = GLFW_KEY_KP_1;
|
||||
_glfw.ns.keycodes[0x54] = GLFW_KEY_KP_2;
|
||||
_glfw.ns.keycodes[0x55] = GLFW_KEY_KP_3;
|
||||
_glfw.ns.keycodes[0x56] = GLFW_KEY_KP_4;
|
||||
_glfw.ns.keycodes[0x57] = GLFW_KEY_KP_5;
|
||||
_glfw.ns.keycodes[0x58] = GLFW_KEY_KP_6;
|
||||
_glfw.ns.keycodes[0x59] = GLFW_KEY_KP_7;
|
||||
_glfw.ns.keycodes[0x5B] = GLFW_KEY_KP_8;
|
||||
_glfw.ns.keycodes[0x5C] = GLFW_KEY_KP_9;
|
||||
_glfw.ns.keycodes[0x45] = GLFW_KEY_KP_ADD;
|
||||
_glfw.ns.keycodes[0x41] = GLFW_KEY_KP_DECIMAL;
|
||||
_glfw.ns.keycodes[0x4B] = GLFW_KEY_KP_DIVIDE;
|
||||
_glfw.ns.keycodes[0x4C] = GLFW_KEY_KP_ENTER;
|
||||
_glfw.ns.keycodes[0x51] = GLFW_KEY_KP_EQUAL;
|
||||
_glfw.ns.keycodes[0x43] = GLFW_KEY_KP_MULTIPLY;
|
||||
_glfw.ns.keycodes[0x4E] = GLFW_KEY_KP_SUBTRACT;
|
||||
|
||||
for (int scancode = 0; scancode < 256; scancode++)
|
||||
{
|
||||
// Store the reverse translation for faster key name lookup
|
||||
if (_glfw.ns.keycodes[scancode] >= 0)
|
||||
_glfw.ns.scancodes[_glfw.ns.keycodes[scancode]] = scancode;
|
||||
}
|
||||
}
|
||||
|
||||
// Retrieve Unicode data for the current keyboard layout
|
||||
//
|
||||
static GLFWbool updateUnicodeData(void)
|
||||
{
|
||||
if (_glfw.ns.inputSource)
|
||||
{
|
||||
CFRelease(_glfw.ns.inputSource);
|
||||
_glfw.ns.inputSource = NULL;
|
||||
_glfw.ns.unicodeData = nil;
|
||||
}
|
||||
|
||||
_glfw.ns.inputSource = TISCopyCurrentKeyboardLayoutInputSource();
|
||||
if (!_glfw.ns.inputSource)
|
||||
{
|
||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||
"Cocoa: Failed to retrieve keyboard layout input source");
|
||||
return GLFW_FALSE;
|
||||
}
|
||||
|
||||
_glfw.ns.unicodeData =
|
||||
TISGetInputSourceProperty(_glfw.ns.inputSource,
|
||||
kTISPropertyUnicodeKeyLayoutData);
|
||||
if (!_glfw.ns.unicodeData)
|
||||
{
|
||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||
"Cocoa: Failed to retrieve keyboard layout Unicode data");
|
||||
return GLFW_FALSE;
|
||||
}
|
||||
|
||||
return GLFW_TRUE;
|
||||
}
|
||||
|
||||
// Load HIToolbox.framework and the TIS symbols we need from it
|
||||
//
|
||||
static GLFWbool initializeTIS(void)
|
||||
{
|
||||
// This works only because Cocoa has already loaded it properly
|
||||
_glfw.ns.tis.bundle =
|
||||
CFBundleGetBundleWithIdentifier(CFSTR("com.apple.HIToolbox"));
|
||||
if (!_glfw.ns.tis.bundle)
|
||||
{
|
||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||
"Cocoa: Failed to load HIToolbox.framework");
|
||||
return GLFW_FALSE;
|
||||
}
|
||||
|
||||
CFStringRef* kPropertyUnicodeKeyLayoutData =
|
||||
CFBundleGetDataPointerForName(_glfw.ns.tis.bundle,
|
||||
CFSTR("kTISPropertyUnicodeKeyLayoutData"));
|
||||
_glfw.ns.tis.CopyCurrentKeyboardLayoutInputSource =
|
||||
CFBundleGetFunctionPointerForName(_glfw.ns.tis.bundle,
|
||||
CFSTR("TISCopyCurrentKeyboardLayoutInputSource"));
|
||||
_glfw.ns.tis.GetInputSourceProperty =
|
||||
CFBundleGetFunctionPointerForName(_glfw.ns.tis.bundle,
|
||||
CFSTR("TISGetInputSourceProperty"));
|
||||
_glfw.ns.tis.GetKbdType =
|
||||
CFBundleGetFunctionPointerForName(_glfw.ns.tis.bundle,
|
||||
CFSTR("LMGetKbdType"));
|
||||
|
||||
if (!kPropertyUnicodeKeyLayoutData ||
|
||||
!TISCopyCurrentKeyboardLayoutInputSource ||
|
||||
!TISGetInputSourceProperty ||
|
||||
!LMGetKbdType)
|
||||
{
|
||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||
"Cocoa: Failed to load TIS API symbols");
|
||||
return GLFW_FALSE;
|
||||
}
|
||||
|
||||
_glfw.ns.tis.kPropertyUnicodeKeyLayoutData =
|
||||
*kPropertyUnicodeKeyLayoutData;
|
||||
|
||||
return updateUnicodeData();
|
||||
}
|
||||
|
||||
@interface GLFWHelper : NSObject
|
||||
@end
|
||||
|
||||
@implementation GLFWHelper
|
||||
|
||||
- (void)selectedKeyboardInputSourceChanged:(NSObject* )object
|
||||
{
|
||||
updateUnicodeData();
|
||||
}
|
||||
|
||||
- (void)doNothing:(id)object
|
||||
{
|
||||
}
|
||||
|
||||
@end // GLFWHelper
|
||||
|
||||
@interface GLFWApplicationDelegate : NSObject <NSApplicationDelegate>
|
||||
@end
|
||||
|
||||
@implementation GLFWApplicationDelegate
|
||||
|
||||
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender
|
||||
{
|
||||
for (_GLFWwindow* window = _glfw.windowListHead; window; window = window->next)
|
||||
_glfwInputWindowCloseRequest(window);
|
||||
|
||||
return NSTerminateCancel;
|
||||
}
|
||||
|
||||
- (void)applicationDidChangeScreenParameters:(NSNotification *) notification
|
||||
{
|
||||
for (_GLFWwindow* window = _glfw.windowListHead; window; window = window->next)
|
||||
{
|
||||
if (window->context.client != GLFW_NO_API)
|
||||
[window->context.nsgl.object update];
|
||||
}
|
||||
|
||||
_glfwPollMonitorsCocoa();
|
||||
}
|
||||
|
||||
- (void)applicationWillFinishLaunching:(NSNotification *)notification
|
||||
{
|
||||
if (_glfw.hints.init.ns.menubar)
|
||||
{
|
||||
// Menu bar setup must go between sharedApplication and finishLaunching
|
||||
// in order to properly emulate the behavior of NSApplicationMain
|
||||
|
||||
if ([[NSBundle mainBundle] pathForResource:@"MainMenu" ofType:@"nib"])
|
||||
{
|
||||
[[NSBundle mainBundle] loadNibNamed:@"MainMenu"
|
||||
owner:NSApp
|
||||
topLevelObjects:&_glfw.ns.nibObjects];
|
||||
}
|
||||
else
|
||||
createMenuBar();
|
||||
}
|
||||
}
|
||||
|
||||
- (void)applicationDidFinishLaunching:(NSNotification *)notification
|
||||
{
|
||||
_glfwPostEmptyEventCocoa();
|
||||
[NSApp stop:nil];
|
||||
}
|
||||
|
||||
- (void)applicationDidHide:(NSNotification *)notification
|
||||
{
|
||||
for (int i = 0; i < _glfw.monitorCount; i++)
|
||||
_glfwRestoreVideoModeCocoa(_glfw.monitors[i]);
|
||||
}
|
||||
|
||||
@end // GLFWApplicationDelegate
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
////// GLFW internal API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void* _glfwLoadLocalVulkanLoaderCocoa(void)
|
||||
{
|
||||
CFBundleRef bundle = CFBundleGetMainBundle();
|
||||
if (!bundle)
|
||||
return NULL;
|
||||
|
||||
CFURLRef frameworksUrl = CFBundleCopyPrivateFrameworksURL(bundle);
|
||||
if (!frameworksUrl)
|
||||
return NULL;
|
||||
|
||||
CFURLRef loaderUrl = CFURLCreateCopyAppendingPathComponent(
|
||||
kCFAllocatorDefault, frameworksUrl, CFSTR("libvulkan.1.dylib"), false);
|
||||
if (!loaderUrl)
|
||||
{
|
||||
CFRelease(frameworksUrl);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char path[PATH_MAX];
|
||||
void* handle = NULL;
|
||||
|
||||
if (CFURLGetFileSystemRepresentation(loaderUrl, true, (UInt8*) path, sizeof(path) - 1))
|
||||
handle = _glfwPlatformLoadModule(path);
|
||||
|
||||
CFRelease(loaderUrl);
|
||||
CFRelease(frameworksUrl);
|
||||
return handle;
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
////// GLFW platform API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
int _glfwPlatformInit(void)
|
||||
GLFWbool _glfwConnectCocoa(int platformID, _GLFWplatform* platform)
|
||||
{
|
||||
_glfw.ns.autoreleasePool = [[NSAutoreleasePool alloc] init];
|
||||
const _GLFWplatform cocoa =
|
||||
{
|
||||
GLFW_PLATFORM_COCOA,
|
||||
_glfwInitCocoa,
|
||||
_glfwTerminateCocoa,
|
||||
_glfwGetCursorPosCocoa,
|
||||
_glfwSetCursorPosCocoa,
|
||||
_glfwSetCursorModeCocoa,
|
||||
_glfwSetRawMouseMotionCocoa,
|
||||
_glfwRawMouseMotionSupportedCocoa,
|
||||
_glfwCreateCursorCocoa,
|
||||
_glfwCreateStandardCursorCocoa,
|
||||
_glfwDestroyCursorCocoa,
|
||||
_glfwSetCursorCocoa,
|
||||
_glfwGetScancodeNameCocoa,
|
||||
_glfwGetKeyScancodeCocoa,
|
||||
_glfwSetClipboardStringCocoa,
|
||||
_glfwGetClipboardStringCocoa,
|
||||
_glfwInitJoysticksCocoa,
|
||||
_glfwTerminateJoysticksCocoa,
|
||||
_glfwPollJoystickCocoa,
|
||||
_glfwGetMappingNameCocoa,
|
||||
_glfwUpdateGamepadGUIDCocoa,
|
||||
_glfwFreeMonitorCocoa,
|
||||
_glfwGetMonitorPosCocoa,
|
||||
_glfwGetMonitorContentScaleCocoa,
|
||||
_glfwGetMonitorWorkareaCocoa,
|
||||
_glfwGetVideoModesCocoa,
|
||||
_glfwGetVideoModeCocoa,
|
||||
_glfwGetGammaRampCocoa,
|
||||
_glfwSetGammaRampCocoa,
|
||||
_glfwCreateWindowCocoa,
|
||||
_glfwDestroyWindowCocoa,
|
||||
_glfwSetWindowTitleCocoa,
|
||||
_glfwSetWindowIconCocoa,
|
||||
_glfwGetWindowPosCocoa,
|
||||
_glfwSetWindowPosCocoa,
|
||||
_glfwGetWindowSizeCocoa,
|
||||
_glfwSetWindowSizeCocoa,
|
||||
_glfwSetWindowSizeLimitsCocoa,
|
||||
_glfwSetWindowAspectRatioCocoa,
|
||||
_glfwGetFramebufferSizeCocoa,
|
||||
_glfwGetWindowFrameSizeCocoa,
|
||||
_glfwGetWindowContentScaleCocoa,
|
||||
_glfwIconifyWindowCocoa,
|
||||
_glfwRestoreWindowCocoa,
|
||||
_glfwMaximizeWindowCocoa,
|
||||
_glfwShowWindowCocoa,
|
||||
_glfwHideWindowCocoa,
|
||||
_glfwRequestWindowAttentionCocoa,
|
||||
_glfwFocusWindowCocoa,
|
||||
_glfwSetWindowMonitorCocoa,
|
||||
_glfwWindowFocusedCocoa,
|
||||
_glfwWindowIconifiedCocoa,
|
||||
_glfwWindowVisibleCocoa,
|
||||
_glfwWindowMaximizedCocoa,
|
||||
_glfwWindowHoveredCocoa,
|
||||
_glfwFramebufferTransparentCocoa,
|
||||
_glfwGetWindowOpacityCocoa,
|
||||
_glfwSetWindowResizableCocoa,
|
||||
_glfwSetWindowDecoratedCocoa,
|
||||
_glfwSetWindowFloatingCocoa,
|
||||
_glfwSetWindowOpacityCocoa,
|
||||
_glfwSetWindowMousePassthroughCocoa,
|
||||
_glfwPollEventsCocoa,
|
||||
_glfwWaitEventsCocoa,
|
||||
_glfwWaitEventsTimeoutCocoa,
|
||||
_glfwPostEmptyEventCocoa,
|
||||
_glfwGetEGLPlatformCocoa,
|
||||
_glfwGetEGLNativeDisplayCocoa,
|
||||
_glfwGetEGLNativeWindowCocoa,
|
||||
_glfwGetRequiredInstanceExtensionsCocoa,
|
||||
_glfwGetPhysicalDevicePresentationSupportCocoa,
|
||||
_glfwCreateWindowSurfaceCocoa,
|
||||
};
|
||||
|
||||
#if defined(_GLFW_USE_CHDIR)
|
||||
changeToResourcesDirectory();
|
||||
#endif
|
||||
*platform = cocoa;
|
||||
return GLFW_TRUE;
|
||||
}
|
||||
|
||||
_glfwInitTimer();
|
||||
int _glfwInitCocoa(void)
|
||||
{
|
||||
@autoreleasepool {
|
||||
|
||||
_glfwInitJoysticks();
|
||||
_glfw.ns.helper = [[GLFWHelper alloc] init];
|
||||
|
||||
if (!_glfwInitContextAPI())
|
||||
return GL_FALSE;
|
||||
[NSThread detachNewThreadSelector:@selector(doNothing:)
|
||||
toTarget:_glfw.ns.helper
|
||||
withObject:nil];
|
||||
|
||||
[NSApplication sharedApplication];
|
||||
|
||||
_glfw.ns.delegate = [[GLFWApplicationDelegate alloc] init];
|
||||
if (_glfw.ns.delegate == nil)
|
||||
{
|
||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||
"Cocoa: Failed to create application delegate");
|
||||
return GLFW_FALSE;
|
||||
}
|
||||
|
||||
[NSApp setDelegate:_glfw.ns.delegate];
|
||||
|
||||
NSEvent* (^block)(NSEvent*) = ^ NSEvent* (NSEvent* event)
|
||||
{
|
||||
if ([event modifierFlags] & NSEventModifierFlagCommand)
|
||||
[[NSApp keyWindow] sendEvent:event];
|
||||
|
||||
return event;
|
||||
};
|
||||
|
||||
_glfw.ns.keyUpMonitor =
|
||||
[NSEvent addLocalMonitorForEventsMatchingMask:NSEventMaskKeyUp
|
||||
handler:block];
|
||||
|
||||
if (_glfw.hints.init.ns.chdir)
|
||||
changeToResourcesDirectory();
|
||||
|
||||
// Press and Hold prevents some keys from emitting repeated characters
|
||||
NSDictionary* defaults = @{@"ApplePressAndHoldEnabled":@NO};
|
||||
[[NSUserDefaults standardUserDefaults] registerDefaults:defaults];
|
||||
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
addObserver:_glfw.ns.helper
|
||||
selector:@selector(selectedKeyboardInputSourceChanged:)
|
||||
name:NSTextInputContextKeyboardSelectionDidChangeNotification
|
||||
object:nil];
|
||||
|
||||
createKeyTables();
|
||||
|
||||
_glfw.ns.eventSource = CGEventSourceCreate(kCGEventSourceStateHIDSystemState);
|
||||
if (!_glfw.ns.eventSource)
|
||||
return GL_FALSE;
|
||||
return GLFW_FALSE;
|
||||
|
||||
CGEventSourceSetLocalEventsSuppressionInterval(_glfw.ns.eventSource, 0.0);
|
||||
|
||||
return GL_TRUE;
|
||||
if (!initializeTIS())
|
||||
return GLFW_FALSE;
|
||||
|
||||
_glfwPollMonitorsCocoa();
|
||||
|
||||
if (![[NSRunningApplication currentApplication] isFinishedLaunching])
|
||||
[NSApp run];
|
||||
|
||||
// In case we are unbundled, make us a proper UI application
|
||||
if (_glfw.hints.init.ns.menubar)
|
||||
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
|
||||
|
||||
return GLFW_TRUE;
|
||||
|
||||
} // autoreleasepool
|
||||
}
|
||||
|
||||
void _glfwPlatformTerminate(void)
|
||||
void _glfwTerminateCocoa(void)
|
||||
{
|
||||
@autoreleasepool {
|
||||
|
||||
if (_glfw.ns.inputSource)
|
||||
{
|
||||
CFRelease(_glfw.ns.inputSource);
|
||||
_glfw.ns.inputSource = NULL;
|
||||
_glfw.ns.unicodeData = nil;
|
||||
}
|
||||
|
||||
if (_glfw.ns.eventSource)
|
||||
{
|
||||
CFRelease(_glfw.ns.eventSource);
|
||||
_glfw.ns.eventSource = NULL;
|
||||
}
|
||||
|
||||
[NSApp setDelegate:nil];
|
||||
[_glfw.ns.delegate release];
|
||||
_glfw.ns.delegate = nil;
|
||||
if (_glfw.ns.delegate)
|
||||
{
|
||||
[NSApp setDelegate:nil];
|
||||
[_glfw.ns.delegate release];
|
||||
_glfw.ns.delegate = nil;
|
||||
}
|
||||
|
||||
[_glfw.ns.autoreleasePool release];
|
||||
_glfw.ns.autoreleasePool = nil;
|
||||
if (_glfw.ns.helper)
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
removeObserver:_glfw.ns.helper
|
||||
name:NSTextInputContextKeyboardSelectionDidChangeNotification
|
||||
object:nil];
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
removeObserver:_glfw.ns.helper];
|
||||
[_glfw.ns.helper release];
|
||||
_glfw.ns.helper = nil;
|
||||
}
|
||||
|
||||
[_glfw.ns.cursor release];
|
||||
_glfw.ns.cursor = nil;
|
||||
if (_glfw.ns.keyUpMonitor)
|
||||
[NSEvent removeMonitor:_glfw.ns.keyUpMonitor];
|
||||
|
||||
_glfwTerminateJoysticks();
|
||||
_glfw_free(_glfw.ns.clipboardString);
|
||||
|
||||
_glfwTerminateContextAPI();
|
||||
_glfwTerminateNSGL();
|
||||
_glfwTerminateEGL();
|
||||
_glfwTerminateOSMesa();
|
||||
|
||||
} // autoreleasepool
|
||||
}
|
||||
|
||||
const char* _glfwPlatformGetVersionString(void)
|
||||
{
|
||||
const char* version = _GLFW_VERSION_FULL " Cocoa"
|
||||
#if defined(_GLFW_NSGL)
|
||||
" NSGL"
|
||||
#endif
|
||||
#if defined(_GLFW_USE_CHDIR)
|
||||
" chdir"
|
||||
#endif
|
||||
#if defined(_GLFW_USE_MENUBAR)
|
||||
" menubar"
|
||||
#endif
|
||||
#if defined(_GLFW_BUILD_DLL)
|
||||
" dynamic"
|
||||
#endif
|
||||
;
|
||||
|
||||
return version;
|
||||
}
|
||||
#endif // _GLFW_COCOA
|
||||
|
||||
|
|
49
src/cocoa_joystick.h
Normal file
49
src/cocoa_joystick.h
Normal file
|
@ -0,0 +1,49 @@
|
|||
//========================================================================
|
||||
// GLFW 3.4 Cocoa - www.glfw.org
|
||||
//------------------------------------------------------------------------
|
||||
// Copyright (c) 2006-2017 Camilla Löwy <elmindreda@glfw.org>
|
||||
//
|
||||
// This software is provided 'as-is', without any express or implied
|
||||
// warranty. In no event will the authors be held liable for any damages
|
||||
// arising from the use of this software.
|
||||
//
|
||||
// Permission is granted to anyone to use this software for any purpose,
|
||||
// including commercial applications, and to alter it and redistribute it
|
||||
// freely, subject to the following restrictions:
|
||||
//
|
||||
// 1. The origin of this software must not be misrepresented; you must not
|
||||
// claim that you wrote the original software. If you use this software
|
||||
// in a product, an acknowledgment in the product documentation would
|
||||
// be appreciated but is not required.
|
||||
//
|
||||
// 2. Altered source versions must be plainly marked as such, and must not
|
||||
// be misrepresented as being the original software.
|
||||
//
|
||||
// 3. This notice may not be removed or altered from any source
|
||||
// distribution.
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
#include <IOKit/IOKitLib.h>
|
||||
#include <IOKit/IOCFPlugIn.h>
|
||||
#include <IOKit/hid/IOHIDKeys.h>
|
||||
|
||||
#define GLFW_COCOA_JOYSTICK_STATE _GLFWjoystickNS ns;
|
||||
#define GLFW_COCOA_LIBRARY_JOYSTICK_STATE
|
||||
|
||||
// Cocoa-specific per-joystick data
|
||||
//
|
||||
typedef struct _GLFWjoystickNS
|
||||
{
|
||||
IOHIDDeviceRef device;
|
||||
CFMutableArrayRef axes;
|
||||
CFMutableArrayRef buttons;
|
||||
CFMutableArrayRef hats;
|
||||
} _GLFWjoystickNS;
|
||||
|
||||
GLFWbool _glfwInitJoysticksCocoa(void);
|
||||
void _glfwTerminateJoysticksCocoa(void);
|
||||
GLFWbool _glfwPollJoystickCocoa(_GLFWjoystick* js, int mode);
|
||||
const char* _glfwGetMappingNameCocoa(void);
|
||||
void _glfwUpdateGamepadGUIDCocoa(char* guid);
|
||||
|
|
@ -1,10 +1,7 @@
|
|||
//========================================================================
|
||||
// GLFW - An OpenGL library
|
||||
// Platform: Cocoa
|
||||
// API Version: 3.0
|
||||
// WWW: http://www.glfw.org/
|
||||
// GLFW 3.4 Cocoa - www.glfw.org
|
||||
//------------------------------------------------------------------------
|
||||
// Copyright (c) 2009-2010 Camilla Berglund <elmindreda@elmindreda.org>
|
||||
// Copyright (c) 2009-2019 Camilla Löwy <elmindreda@glfw.org>
|
||||
// Copyright (c) 2012 Torsten Walluhn <tw@mad-cad.net>
|
||||
//
|
||||
// This software is provided 'as-is', without any express or implied
|
||||
|
@ -27,11 +24,16 @@
|
|||
// distribution.
|
||||
//
|
||||
//========================================================================
|
||||
// It is fine to use C99 in this file because it will not be built with VS
|
||||
//========================================================================
|
||||
|
||||
#include "internal.h"
|
||||
|
||||
#if defined(_GLFW_COCOA)
|
||||
|
||||
#include <unistd.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <mach/mach.h>
|
||||
#include <mach/mach_error.h>
|
||||
|
@ -40,414 +42,258 @@
|
|||
#include <Kernel/IOKit/hidsystem/IOHIDUsageTables.h>
|
||||
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Joystick element information
|
||||
//------------------------------------------------------------------------
|
||||
typedef struct
|
||||
{
|
||||
IOHIDElementCookie cookie;
|
||||
|
||||
long min;
|
||||
long max;
|
||||
|
||||
long minReport;
|
||||
long maxReport;
|
||||
|
||||
} _GLFWjoyelement;
|
||||
|
||||
|
||||
static void getElementsCFArrayHandler(const void* value, void* parameter);
|
||||
|
||||
|
||||
// Adds an element to the specified joystick
|
||||
//
|
||||
static void addJoystickElement(_GLFWjoy* joystick, CFTypeRef elementRef)
|
||||
typedef struct _GLFWjoyelementNS
|
||||
{
|
||||
long elementType, usagePage, usage;
|
||||
CFMutableArrayRef elementsArray = NULL;
|
||||
IOHIDElementRef native;
|
||||
uint32_t usage;
|
||||
int index;
|
||||
long minimum;
|
||||
long maximum;
|
||||
|
||||
CFNumberGetValue(CFDictionaryGetValue(elementRef, CFSTR(kIOHIDElementTypeKey)),
|
||||
kCFNumberLongType, &elementType);
|
||||
CFNumberGetValue(CFDictionaryGetValue(elementRef, CFSTR(kIOHIDElementUsagePageKey)),
|
||||
kCFNumberLongType, &usagePage);
|
||||
CFNumberGetValue(CFDictionaryGetValue(elementRef, CFSTR(kIOHIDElementUsageKey)),
|
||||
kCFNumberLongType, &usage);
|
||||
} _GLFWjoyelementNS;
|
||||
|
||||
if ((elementType == kIOHIDElementTypeInput_Axis) ||
|
||||
(elementType == kIOHIDElementTypeInput_Button) ||
|
||||
(elementType == kIOHIDElementTypeInput_Misc))
|
||||
{
|
||||
switch (usagePage)
|
||||
{
|
||||
case kHIDPage_GenericDesktop:
|
||||
{
|
||||
switch (usage)
|
||||
{
|
||||
case kHIDUsage_GD_X:
|
||||
case kHIDUsage_GD_Y:
|
||||
case kHIDUsage_GD_Z:
|
||||
case kHIDUsage_GD_Rx:
|
||||
case kHIDUsage_GD_Ry:
|
||||
case kHIDUsage_GD_Rz:
|
||||
case kHIDUsage_GD_Slider:
|
||||
case kHIDUsage_GD_Dial:
|
||||
case kHIDUsage_GD_Wheel:
|
||||
elementsArray = joystick->axisElements;
|
||||
break;
|
||||
case kHIDUsage_GD_Hatswitch:
|
||||
elementsArray = joystick->hatElements;
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case kHIDPage_Button:
|
||||
elementsArray = joystick->buttonElements;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (elementsArray)
|
||||
{
|
||||
long number;
|
||||
CFTypeRef numberRef;
|
||||
_GLFWjoyelement* element = (_GLFWjoyelement*) malloc(sizeof(_GLFWjoyelement));
|
||||
|
||||
CFArrayAppendValue(elementsArray, element);
|
||||
|
||||
numberRef = CFDictionaryGetValue(elementRef, CFSTR(kIOHIDElementCookieKey));
|
||||
if (numberRef && CFNumberGetValue(numberRef, kCFNumberLongType, &number))
|
||||
element->cookie = (IOHIDElementCookie) number;
|
||||
|
||||
numberRef = CFDictionaryGetValue(elementRef, CFSTR(kIOHIDElementMinKey));
|
||||
if (numberRef && CFNumberGetValue(numberRef, kCFNumberLongType, &number))
|
||||
element->minReport = element->min = number;
|
||||
|
||||
numberRef = CFDictionaryGetValue(elementRef, CFSTR(kIOHIDElementMaxKey));
|
||||
if (numberRef && CFNumberGetValue(numberRef, kCFNumberLongType, &number))
|
||||
element->maxReport = element->max = number;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
CFTypeRef array = CFDictionaryGetValue(elementRef, CFSTR(kIOHIDElementKey));
|
||||
if (array)
|
||||
{
|
||||
if (CFGetTypeID(array) == CFArrayGetTypeID())
|
||||
{
|
||||
CFRange range = { 0, CFArrayGetCount(array) };
|
||||
CFArrayApplyFunction(array, range, getElementsCFArrayHandler, joystick);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Adds an element to the specified joystick
|
||||
//
|
||||
static void getElementsCFArrayHandler(const void* value, void* parameter)
|
||||
{
|
||||
if (CFGetTypeID(value) == CFDictionaryGetTypeID())
|
||||
addJoystickElement((_GLFWjoy*) parameter, (CFTypeRef) value);
|
||||
}
|
||||
|
||||
// Returns the value of the specified element of the specified joystick
|
||||
//
|
||||
static long getElementValue(_GLFWjoy* joystick, _GLFWjoyelement* element)
|
||||
static long getElementValue(_GLFWjoystick* js, _GLFWjoyelementNS* element)
|
||||
{
|
||||
IOReturn result = kIOReturnSuccess;
|
||||
IOHIDEventStruct hidEvent;
|
||||
hidEvent.value = 0;
|
||||
IOHIDValueRef valueRef;
|
||||
long value = 0;
|
||||
|
||||
if (joystick && element && joystick->interface)
|
||||
if (js->ns.device)
|
||||
{
|
||||
result = (*(joystick->interface))->getElementValue(joystick->interface,
|
||||
element->cookie,
|
||||
&hidEvent);
|
||||
if (kIOReturnSuccess == result)
|
||||
if (IOHIDDeviceGetValue(js->ns.device,
|
||||
element->native,
|
||||
&valueRef) == kIOReturnSuccess)
|
||||
{
|
||||
// Record min and max for auto calibration
|
||||
if (hidEvent.value < element->minReport)
|
||||
element->minReport = hidEvent.value;
|
||||
if (hidEvent.value > element->maxReport)
|
||||
element->maxReport = hidEvent.value;
|
||||
value = IOHIDValueGetIntegerValue(valueRef);
|
||||
}
|
||||
}
|
||||
|
||||
// Auto user scale
|
||||
return (long) hidEvent.value;
|
||||
return value;
|
||||
}
|
||||
|
||||
// Comparison function for matching the SDL element order
|
||||
//
|
||||
static CFComparisonResult compareElements(const void* fp,
|
||||
const void* sp,
|
||||
void* user)
|
||||
{
|
||||
const _GLFWjoyelementNS* fe = fp;
|
||||
const _GLFWjoyelementNS* se = sp;
|
||||
if (fe->usage < se->usage)
|
||||
return kCFCompareLessThan;
|
||||
if (fe->usage > se->usage)
|
||||
return kCFCompareGreaterThan;
|
||||
if (fe->index < se->index)
|
||||
return kCFCompareLessThan;
|
||||
if (fe->index > se->index)
|
||||
return kCFCompareGreaterThan;
|
||||
return kCFCompareEqualTo;
|
||||
}
|
||||
|
||||
// Removes the specified joystick
|
||||
//
|
||||
static void removeJoystick(_GLFWjoy* joystick)
|
||||
static void closeJoystick(_GLFWjoystick* js)
|
||||
{
|
||||
int i;
|
||||
_glfwInputJoystick(js, GLFW_DISCONNECTED);
|
||||
|
||||
if (!joystick->present)
|
||||
return;
|
||||
for (int i = 0; i < CFArrayGetCount(js->ns.axes); i++)
|
||||
_glfw_free((void*) CFArrayGetValueAtIndex(js->ns.axes, i));
|
||||
CFRelease(js->ns.axes);
|
||||
|
||||
for (i = 0; i < CFArrayGetCount(joystick->axisElements); i++)
|
||||
free((void*) CFArrayGetValueAtIndex(joystick->axisElements, i));
|
||||
CFArrayRemoveAllValues(joystick->axisElements);
|
||||
for (int i = 0; i < CFArrayGetCount(js->ns.buttons); i++)
|
||||
_glfw_free((void*) CFArrayGetValueAtIndex(js->ns.buttons, i));
|
||||
CFRelease(js->ns.buttons);
|
||||
|
||||
for (i = 0; i < CFArrayGetCount(joystick->buttonElements); i++)
|
||||
free((void*) CFArrayGetValueAtIndex(joystick->buttonElements, i));
|
||||
CFArrayRemoveAllValues(joystick->buttonElements);
|
||||
for (int i = 0; i < CFArrayGetCount(js->ns.hats); i++)
|
||||
_glfw_free((void*) CFArrayGetValueAtIndex(js->ns.hats, i));
|
||||
CFRelease(js->ns.hats);
|
||||
|
||||
for (i = 0; i < CFArrayGetCount(joystick->hatElements); i++)
|
||||
free((void*) CFArrayGetValueAtIndex(joystick->hatElements, i));
|
||||
CFArrayRemoveAllValues(joystick->hatElements);
|
||||
_glfwFreeJoystick(js);
|
||||
}
|
||||
|
||||
free(joystick->axes);
|
||||
free(joystick->buttons);
|
||||
// Callback for user-initiated joystick addition
|
||||
//
|
||||
static void matchCallback(void* context,
|
||||
IOReturn result,
|
||||
void* sender,
|
||||
IOHIDDeviceRef device)
|
||||
{
|
||||
int jid;
|
||||
char name[256];
|
||||
char guid[33];
|
||||
CFTypeRef property;
|
||||
uint32_t vendor = 0, product = 0, version = 0;
|
||||
_GLFWjoystick* js;
|
||||
CFMutableArrayRef axes, buttons, hats;
|
||||
|
||||
(*(joystick->interface))->close(joystick->interface);
|
||||
(*(joystick->interface))->Release(joystick->interface);
|
||||
for (jid = 0; jid <= GLFW_JOYSTICK_LAST; jid++)
|
||||
{
|
||||
if (_glfw.joysticks[jid].ns.device == device)
|
||||
return;
|
||||
}
|
||||
|
||||
memset(joystick, 0, sizeof(_GLFWjoy));
|
||||
axes = CFArrayCreateMutable(NULL, 0, NULL);
|
||||
buttons = CFArrayCreateMutable(NULL, 0, NULL);
|
||||
hats = CFArrayCreateMutable(NULL, 0, NULL);
|
||||
|
||||
property = IOHIDDeviceGetProperty(device, CFSTR(kIOHIDProductKey));
|
||||
if (property)
|
||||
{
|
||||
CFStringGetCString(property,
|
||||
name,
|
||||
sizeof(name),
|
||||
kCFStringEncodingUTF8);
|
||||
}
|
||||
else
|
||||
strncpy(name, "Unknown", sizeof(name));
|
||||
|
||||
property = IOHIDDeviceGetProperty(device, CFSTR(kIOHIDVendorIDKey));
|
||||
if (property)
|
||||
CFNumberGetValue(property, kCFNumberSInt32Type, &vendor);
|
||||
|
||||
property = IOHIDDeviceGetProperty(device, CFSTR(kIOHIDProductIDKey));
|
||||
if (property)
|
||||
CFNumberGetValue(property, kCFNumberSInt32Type, &product);
|
||||
|
||||
property = IOHIDDeviceGetProperty(device, CFSTR(kIOHIDVersionNumberKey));
|
||||
if (property)
|
||||
CFNumberGetValue(property, kCFNumberSInt32Type, &version);
|
||||
|
||||
// Generate a joystick GUID that matches the SDL 2.0.5+ one
|
||||
if (vendor && product)
|
||||
{
|
||||
sprintf(guid, "03000000%02x%02x0000%02x%02x0000%02x%02x0000",
|
||||
(uint8_t) vendor, (uint8_t) (vendor >> 8),
|
||||
(uint8_t) product, (uint8_t) (product >> 8),
|
||||
(uint8_t) version, (uint8_t) (version >> 8));
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(guid, "05000000%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x00",
|
||||
name[0], name[1], name[2], name[3],
|
||||
name[4], name[5], name[6], name[7],
|
||||
name[8], name[9], name[10]);
|
||||
}
|
||||
|
||||
CFArrayRef elements =
|
||||
IOHIDDeviceCopyMatchingElements(device, NULL, kIOHIDOptionsTypeNone);
|
||||
|
||||
for (CFIndex i = 0; i < CFArrayGetCount(elements); i++)
|
||||
{
|
||||
IOHIDElementRef native = (IOHIDElementRef)
|
||||
CFArrayGetValueAtIndex(elements, i);
|
||||
if (CFGetTypeID(native) != IOHIDElementGetTypeID())
|
||||
continue;
|
||||
|
||||
const IOHIDElementType type = IOHIDElementGetType(native);
|
||||
if ((type != kIOHIDElementTypeInput_Axis) &&
|
||||
(type != kIOHIDElementTypeInput_Button) &&
|
||||
(type != kIOHIDElementTypeInput_Misc))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
CFMutableArrayRef target = NULL;
|
||||
|
||||
const uint32_t usage = IOHIDElementGetUsage(native);
|
||||
const uint32_t page = IOHIDElementGetUsagePage(native);
|
||||
if (page == kHIDPage_GenericDesktop)
|
||||
{
|
||||
switch (usage)
|
||||
{
|
||||
case kHIDUsage_GD_X:
|
||||
case kHIDUsage_GD_Y:
|
||||
case kHIDUsage_GD_Z:
|
||||
case kHIDUsage_GD_Rx:
|
||||
case kHIDUsage_GD_Ry:
|
||||
case kHIDUsage_GD_Rz:
|
||||
case kHIDUsage_GD_Slider:
|
||||
case kHIDUsage_GD_Dial:
|
||||
case kHIDUsage_GD_Wheel:
|
||||
target = axes;
|
||||
break;
|
||||
case kHIDUsage_GD_Hatswitch:
|
||||
target = hats;
|
||||
break;
|
||||
case kHIDUsage_GD_DPadUp:
|
||||
case kHIDUsage_GD_DPadRight:
|
||||
case kHIDUsage_GD_DPadDown:
|
||||
case kHIDUsage_GD_DPadLeft:
|
||||
case kHIDUsage_GD_SystemMainMenu:
|
||||
case kHIDUsage_GD_Select:
|
||||
case kHIDUsage_GD_Start:
|
||||
target = buttons;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (page == kHIDPage_Simulation)
|
||||
{
|
||||
switch (usage)
|
||||
{
|
||||
case kHIDUsage_Sim_Accelerator:
|
||||
case kHIDUsage_Sim_Brake:
|
||||
case kHIDUsage_Sim_Throttle:
|
||||
case kHIDUsage_Sim_Rudder:
|
||||
case kHIDUsage_Sim_Steering:
|
||||
target = axes;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (page == kHIDPage_Button || page == kHIDPage_Consumer)
|
||||
target = buttons;
|
||||
|
||||
if (target)
|
||||
{
|
||||
_GLFWjoyelementNS* element = _glfw_calloc(1, sizeof(_GLFWjoyelementNS));
|
||||
element->native = native;
|
||||
element->usage = usage;
|
||||
element->index = (int) CFArrayGetCount(target);
|
||||
element->minimum = IOHIDElementGetLogicalMin(native);
|
||||
element->maximum = IOHIDElementGetLogicalMax(native);
|
||||
CFArrayAppendValue(target, element);
|
||||
}
|
||||
}
|
||||
|
||||
CFRelease(elements);
|
||||
|
||||
CFArraySortValues(axes, CFRangeMake(0, CFArrayGetCount(axes)),
|
||||
compareElements, NULL);
|
||||
CFArraySortValues(buttons, CFRangeMake(0, CFArrayGetCount(buttons)),
|
||||
compareElements, NULL);
|
||||
CFArraySortValues(hats, CFRangeMake(0, CFArrayGetCount(hats)),
|
||||
compareElements, NULL);
|
||||
|
||||
js = _glfwAllocJoystick(name, guid,
|
||||
(int) CFArrayGetCount(axes),
|
||||
(int) CFArrayGetCount(buttons),
|
||||
(int) CFArrayGetCount(hats));
|
||||
|
||||
js->ns.device = device;
|
||||
js->ns.axes = axes;
|
||||
js->ns.buttons = buttons;
|
||||
js->ns.hats = hats;
|
||||
|
||||
_glfwInputJoystick(js, GLFW_CONNECTED);
|
||||
}
|
||||
|
||||
// Callback for user-initiated joystick removal
|
||||
//
|
||||
static void removalCallback(void* target, IOReturn result, void* refcon, void* sender)
|
||||
static void removeCallback(void* context,
|
||||
IOReturn result,
|
||||
void* sender,
|
||||
IOHIDDeviceRef device)
|
||||
{
|
||||
removeJoystick((_GLFWjoy*) refcon);
|
||||
}
|
||||
|
||||
// Polls for joystick events and updates GLFW state
|
||||
//
|
||||
static void pollJoystickEvents(void)
|
||||
{
|
||||
int joy;
|
||||
|
||||
for (joy = 0; joy <= GLFW_JOYSTICK_LAST; joy++)
|
||||
for (int jid = 0; jid <= GLFW_JOYSTICK_LAST; jid++)
|
||||
{
|
||||
CFIndex i;
|
||||
int buttonIndex = 0;
|
||||
_GLFWjoy* joystick = _glfw.ns.joysticks + joy;
|
||||
|
||||
if (!joystick->present)
|
||||
continue;
|
||||
|
||||
for (i = 0; i < CFArrayGetCount(joystick->buttonElements); i++)
|
||||
if (_glfw.joysticks[jid].connected && _glfw.joysticks[jid].ns.device == device)
|
||||
{
|
||||
_GLFWjoyelement* button =
|
||||
(_GLFWjoyelement*) CFArrayGetValueAtIndex(joystick->buttonElements, i);
|
||||
|
||||
if (getElementValue(joystick, button))
|
||||
joystick->buttons[buttonIndex++] = GLFW_PRESS;
|
||||
else
|
||||
joystick->buttons[buttonIndex++] = GLFW_RELEASE;
|
||||
}
|
||||
|
||||
for (i = 0; i < CFArrayGetCount(joystick->axisElements); i++)
|
||||
{
|
||||
_GLFWjoyelement* axis =
|
||||
(_GLFWjoyelement*) CFArrayGetValueAtIndex(joystick->axisElements, i);
|
||||
|
||||
long value = getElementValue(joystick, axis);
|
||||
long readScale = axis->maxReport - axis->minReport;
|
||||
|
||||
if (readScale == 0)
|
||||
joystick->axes[i] = value;
|
||||
else
|
||||
joystick->axes[i] = (2.f * (value - axis->minReport) / readScale) - 1.f;
|
||||
|
||||
if (i & 1)
|
||||
joystick->axes[i] = -joystick->axes[i];
|
||||
}
|
||||
|
||||
for (i = 0; i < CFArrayGetCount(joystick->hatElements); i++)
|
||||
{
|
||||
_GLFWjoyelement* hat =
|
||||
(_GLFWjoyelement*) CFArrayGetValueAtIndex(joystick->hatElements, i);
|
||||
|
||||
// Bit fields of button presses for each direction, including nil
|
||||
const int directions[9] = { 1, 3, 2, 6, 4, 12, 8, 9, 0 };
|
||||
|
||||
long j, value = getElementValue(joystick, hat);
|
||||
if (value < 0 || value > 8)
|
||||
value = 8;
|
||||
|
||||
for (j = 0; j < 4; j++)
|
||||
{
|
||||
if (directions[value] & (1 << j))
|
||||
joystick->buttons[buttonIndex++] = GLFW_PRESS;
|
||||
else
|
||||
joystick->buttons[buttonIndex++] = GLFW_RELEASE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
////// GLFW internal API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Initialize joystick interface
|
||||
//
|
||||
void _glfwInitJoysticks(void)
|
||||
{
|
||||
int joy = 0;
|
||||
IOReturn result = kIOReturnSuccess;
|
||||
mach_port_t masterPort = 0;
|
||||
io_iterator_t objectIterator = 0;
|
||||
CFMutableDictionaryRef hidMatchDictionary = NULL;
|
||||
io_object_t ioHIDDeviceObject = 0;
|
||||
|
||||
result = IOMasterPort(bootstrap_port, &masterPort);
|
||||
hidMatchDictionary = IOServiceMatching(kIOHIDDeviceKey);
|
||||
if (kIOReturnSuccess != result || !hidMatchDictionary)
|
||||
{
|
||||
if (hidMatchDictionary)
|
||||
CFRelease(hidMatchDictionary);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
result = IOServiceGetMatchingServices(masterPort,
|
||||
hidMatchDictionary,
|
||||
&objectIterator);
|
||||
if (result != kIOReturnSuccess)
|
||||
return;
|
||||
|
||||
if (!objectIterator)
|
||||
{
|
||||
// There are no joysticks
|
||||
return;
|
||||
}
|
||||
|
||||
while ((ioHIDDeviceObject = IOIteratorNext(objectIterator)))
|
||||
{
|
||||
kern_return_t result;
|
||||
CFTypeRef valueRef = 0;
|
||||
|
||||
IOCFPlugInInterface** ppPlugInInterface = NULL;
|
||||
HRESULT plugInResult = S_OK;
|
||||
SInt32 score = 0;
|
||||
|
||||
long usagePage, usage;
|
||||
|
||||
// Check device type
|
||||
valueRef = IORegistryEntryCreateCFProperty(ioHIDDeviceObject,
|
||||
CFSTR(kIOHIDPrimaryUsagePageKey),
|
||||
kCFAllocatorDefault,
|
||||
kNilOptions);
|
||||
if (valueRef)
|
||||
{
|
||||
CFNumberGetValue(valueRef, kCFNumberLongType, &usagePage);
|
||||
if (usagePage != kHIDPage_GenericDesktop)
|
||||
{
|
||||
// This device is not relevant to GLFW
|
||||
continue;
|
||||
}
|
||||
|
||||
CFRelease(valueRef);
|
||||
}
|
||||
|
||||
valueRef = IORegistryEntryCreateCFProperty(ioHIDDeviceObject,
|
||||
CFSTR(kIOHIDPrimaryUsageKey),
|
||||
kCFAllocatorDefault,
|
||||
kNilOptions);
|
||||
if (valueRef)
|
||||
{
|
||||
CFNumberGetValue(valueRef, kCFNumberLongType, &usage);
|
||||
|
||||
if ((usage != kHIDUsage_GD_Joystick &&
|
||||
usage != kHIDUsage_GD_GamePad &&
|
||||
usage != kHIDUsage_GD_MultiAxisController))
|
||||
{
|
||||
// This device is not relevant to GLFW
|
||||
continue;
|
||||
}
|
||||
|
||||
CFRelease(valueRef);
|
||||
}
|
||||
|
||||
_GLFWjoy* joystick = _glfw.ns.joysticks + joy;
|
||||
joystick->present = GL_TRUE;
|
||||
|
||||
result = IOCreatePlugInInterfaceForService(ioHIDDeviceObject,
|
||||
kIOHIDDeviceUserClientTypeID,
|
||||
kIOCFPlugInInterfaceID,
|
||||
&ppPlugInInterface,
|
||||
&score);
|
||||
|
||||
if (kIOReturnSuccess != result)
|
||||
return;
|
||||
|
||||
plugInResult = (*ppPlugInInterface)->QueryInterface(
|
||||
ppPlugInInterface,
|
||||
CFUUIDGetUUIDBytes(kIOHIDDeviceInterfaceID),
|
||||
(void *) &(joystick->interface));
|
||||
|
||||
if (plugInResult != S_OK)
|
||||
return;
|
||||
|
||||
(*ppPlugInInterface)->Release(ppPlugInInterface);
|
||||
|
||||
(*(joystick->interface))->open(joystick->interface, 0);
|
||||
(*(joystick->interface))->setRemovalCallback(joystick->interface,
|
||||
removalCallback,
|
||||
joystick,
|
||||
joystick);
|
||||
|
||||
// Get product string
|
||||
valueRef = IORegistryEntryCreateCFProperty(ioHIDDeviceObject,
|
||||
CFSTR(kIOHIDProductKey),
|
||||
kCFAllocatorDefault,
|
||||
kNilOptions);
|
||||
if (valueRef)
|
||||
{
|
||||
CFStringGetCString(valueRef,
|
||||
joystick->name,
|
||||
sizeof(joystick->name),
|
||||
kCFStringEncodingUTF8);
|
||||
CFRelease(valueRef);
|
||||
}
|
||||
|
||||
joystick->axisElements = CFArrayCreateMutable(NULL, 0, NULL);
|
||||
joystick->buttonElements = CFArrayCreateMutable(NULL, 0, NULL);
|
||||
joystick->hatElements = CFArrayCreateMutable(NULL, 0, NULL);
|
||||
|
||||
valueRef = IORegistryEntryCreateCFProperty(ioHIDDeviceObject,
|
||||
CFSTR(kIOHIDElementKey),
|
||||
kCFAllocatorDefault,
|
||||
kNilOptions);
|
||||
if (CFGetTypeID(valueRef) == CFArrayGetTypeID())
|
||||
{
|
||||
CFRange range = { 0, CFArrayGetCount(valueRef) };
|
||||
CFArrayApplyFunction(valueRef,
|
||||
range,
|
||||
getElementsCFArrayHandler,
|
||||
(void*) joystick);
|
||||
CFRelease(valueRef);
|
||||
}
|
||||
|
||||
joystick->axes = (float*) calloc(CFArrayGetCount(joystick->axisElements),
|
||||
sizeof(float));
|
||||
joystick->buttons = (unsigned char*) calloc(CFArrayGetCount(joystick->buttonElements) +
|
||||
CFArrayGetCount(joystick->hatElements) * 4, 1);
|
||||
|
||||
joy++;
|
||||
if (joy > GLFW_JOYSTICK_LAST)
|
||||
closeJoystick(&_glfw.joysticks[jid]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Close all opened joystick handles
|
||||
//
|
||||
void _glfwTerminateJoysticks(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < GLFW_JOYSTICK_LAST + 1; i++)
|
||||
{
|
||||
_GLFWjoy* joystick = &_glfw.ns.joysticks[i];
|
||||
removeJoystick(joystick);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -456,44 +302,181 @@ void _glfwTerminateJoysticks(void)
|
|||
////// GLFW platform API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
int _glfwPlatformJoystickPresent(int joy)
|
||||
GLFWbool _glfwInitJoysticksCocoa(void)
|
||||
{
|
||||
pollJoystickEvents();
|
||||
CFMutableArrayRef matching;
|
||||
const long usages[] =
|
||||
{
|
||||
kHIDUsage_GD_Joystick,
|
||||
kHIDUsage_GD_GamePad,
|
||||
kHIDUsage_GD_MultiAxisController
|
||||
};
|
||||
|
||||
return _glfw.ns.joysticks[joy].present;
|
||||
_glfw.ns.hidManager = IOHIDManagerCreate(kCFAllocatorDefault,
|
||||
kIOHIDOptionsTypeNone);
|
||||
|
||||
matching = CFArrayCreateMutable(kCFAllocatorDefault,
|
||||
0,
|
||||
&kCFTypeArrayCallBacks);
|
||||
if (!matching)
|
||||
{
|
||||
_glfwInputError(GLFW_PLATFORM_ERROR, "Cocoa: Failed to create array");
|
||||
return GLFW_FALSE;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < sizeof(usages) / sizeof(long); i++)
|
||||
{
|
||||
const long page = kHIDPage_GenericDesktop;
|
||||
|
||||
CFMutableDictionaryRef dict =
|
||||
CFDictionaryCreateMutable(kCFAllocatorDefault,
|
||||
0,
|
||||
&kCFTypeDictionaryKeyCallBacks,
|
||||
&kCFTypeDictionaryValueCallBacks);
|
||||
if (!dict)
|
||||
continue;
|
||||
|
||||
CFNumberRef pageRef = CFNumberCreate(kCFAllocatorDefault,
|
||||
kCFNumberLongType,
|
||||
&page);
|
||||
CFNumberRef usageRef = CFNumberCreate(kCFAllocatorDefault,
|
||||
kCFNumberLongType,
|
||||
&usages[i]);
|
||||
if (pageRef && usageRef)
|
||||
{
|
||||
CFDictionarySetValue(dict,
|
||||
CFSTR(kIOHIDDeviceUsagePageKey),
|
||||
pageRef);
|
||||
CFDictionarySetValue(dict,
|
||||
CFSTR(kIOHIDDeviceUsageKey),
|
||||
usageRef);
|
||||
CFArrayAppendValue(matching, dict);
|
||||
}
|
||||
|
||||
if (pageRef)
|
||||
CFRelease(pageRef);
|
||||
if (usageRef)
|
||||
CFRelease(usageRef);
|
||||
|
||||
CFRelease(dict);
|
||||
}
|
||||
|
||||
IOHIDManagerSetDeviceMatchingMultiple(_glfw.ns.hidManager, matching);
|
||||
CFRelease(matching);
|
||||
|
||||
IOHIDManagerRegisterDeviceMatchingCallback(_glfw.ns.hidManager,
|
||||
&matchCallback, NULL);
|
||||
IOHIDManagerRegisterDeviceRemovalCallback(_glfw.ns.hidManager,
|
||||
&removeCallback, NULL);
|
||||
IOHIDManagerScheduleWithRunLoop(_glfw.ns.hidManager,
|
||||
CFRunLoopGetMain(),
|
||||
kCFRunLoopDefaultMode);
|
||||
IOHIDManagerOpen(_glfw.ns.hidManager, kIOHIDOptionsTypeNone);
|
||||
|
||||
// Execute the run loop once in order to register any initially-attached
|
||||
// joysticks
|
||||
CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);
|
||||
return GLFW_TRUE;
|
||||
}
|
||||
|
||||
const float* _glfwPlatformGetJoystickAxes(int joy, int* count)
|
||||
void _glfwTerminateJoysticksCocoa(void)
|
||||
{
|
||||
_GLFWjoy* joystick = _glfw.ns.joysticks + joy;
|
||||
for (int jid = 0; jid <= GLFW_JOYSTICK_LAST; jid++)
|
||||
{
|
||||
if (_glfw.joysticks[jid].connected)
|
||||
closeJoystick(&_glfw.joysticks[jid]);
|
||||
}
|
||||
|
||||
pollJoystickEvents();
|
||||
|
||||
if (!joystick->present)
|
||||
return NULL;
|
||||
|
||||
*count = (int) CFArrayGetCount(joystick->axisElements);
|
||||
return joystick->axes;
|
||||
if (_glfw.ns.hidManager)
|
||||
{
|
||||
CFRelease(_glfw.ns.hidManager);
|
||||
_glfw.ns.hidManager = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
const unsigned char* _glfwPlatformGetJoystickButtons(int joy, int* count)
|
||||
|
||||
GLFWbool _glfwPollJoystickCocoa(_GLFWjoystick* js, int mode)
|
||||
{
|
||||
_GLFWjoy* joystick = _glfw.ns.joysticks + joy;
|
||||
if (mode & _GLFW_POLL_AXES)
|
||||
{
|
||||
for (CFIndex i = 0; i < CFArrayGetCount(js->ns.axes); i++)
|
||||
{
|
||||
_GLFWjoyelementNS* axis = (_GLFWjoyelementNS*)
|
||||
CFArrayGetValueAtIndex(js->ns.axes, i);
|
||||
|
||||
pollJoystickEvents();
|
||||
const long raw = getElementValue(js, axis);
|
||||
// Perform auto calibration
|
||||
if (raw < axis->minimum)
|
||||
axis->minimum = raw;
|
||||
if (raw > axis->maximum)
|
||||
axis->maximum = raw;
|
||||
|
||||
if (!joystick->present)
|
||||
return NULL;
|
||||
const long size = axis->maximum - axis->minimum;
|
||||
if (size == 0)
|
||||
_glfwInputJoystickAxis(js, (int) i, 0.f);
|
||||
else
|
||||
{
|
||||
const float value = (2.f * (raw - axis->minimum) / size) - 1.f;
|
||||
_glfwInputJoystickAxis(js, (int) i, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
*count = (int) CFArrayGetCount(joystick->buttonElements) +
|
||||
(int) CFArrayGetCount(joystick->hatElements) * 4;
|
||||
return joystick->buttons;
|
||||
if (mode & _GLFW_POLL_BUTTONS)
|
||||
{
|
||||
for (CFIndex i = 0; i < CFArrayGetCount(js->ns.buttons); i++)
|
||||
{
|
||||
_GLFWjoyelementNS* button = (_GLFWjoyelementNS*)
|
||||
CFArrayGetValueAtIndex(js->ns.buttons, i);
|
||||
const char value = getElementValue(js, button) - button->minimum;
|
||||
const int state = (value > 0) ? GLFW_PRESS : GLFW_RELEASE;
|
||||
_glfwInputJoystickButton(js, (int) i, state);
|
||||
}
|
||||
|
||||
for (CFIndex i = 0; i < CFArrayGetCount(js->ns.hats); i++)
|
||||
{
|
||||
const int states[9] =
|
||||
{
|
||||
GLFW_HAT_UP,
|
||||
GLFW_HAT_RIGHT_UP,
|
||||
GLFW_HAT_RIGHT,
|
||||
GLFW_HAT_RIGHT_DOWN,
|
||||
GLFW_HAT_DOWN,
|
||||
GLFW_HAT_LEFT_DOWN,
|
||||
GLFW_HAT_LEFT,
|
||||
GLFW_HAT_LEFT_UP,
|
||||
GLFW_HAT_CENTERED
|
||||
};
|
||||
|
||||
_GLFWjoyelementNS* hat = (_GLFWjoyelementNS*)
|
||||
CFArrayGetValueAtIndex(js->ns.hats, i);
|
||||
long state = getElementValue(js, hat) - hat->minimum;
|
||||
if (state < 0 || state > 8)
|
||||
state = 8;
|
||||
|
||||
_glfwInputJoystickHat(js, (int) i, states[state]);
|
||||
}
|
||||
}
|
||||
|
||||
return js->connected;
|
||||
}
|
||||
|
||||
const char* _glfwPlatformGetJoystickName(int joy)
|
||||
const char* _glfwGetMappingNameCocoa(void)
|
||||
{
|
||||
pollJoystickEvents();
|
||||
|
||||
return _glfw.ns.joysticks[joy].name;
|
||||
return "Mac OS X";
|
||||
}
|
||||
|
||||
void _glfwUpdateGamepadGUIDCocoa(char* guid)
|
||||
{
|
||||
if ((strncmp(guid + 4, "000000000000", 12) == 0) &&
|
||||
(strncmp(guid + 20, "000000000000", 12) == 0))
|
||||
{
|
||||
char original[33];
|
||||
strncpy(original, guid, sizeof(original) - 1);
|
||||
sprintf(guid, "03000000%.4s0000%.4s000000000000",
|
||||
original, original + 16);
|
||||
}
|
||||
}
|
||||
|
||||
#endif // _GLFW_COCOA
|
||||
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
//========================================================================
|
||||
// GLFW - An OpenGL library
|
||||
// Platform: Cocoa
|
||||
// API version: 3.0
|
||||
// WWW: http://www.glfw.org/
|
||||
// GLFW 3.4 macOS - www.glfw.org
|
||||
//------------------------------------------------------------------------
|
||||
// Copyright (c) 2002-2006 Marcus Geelnard
|
||||
// Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.org>
|
||||
// Copyright (c) 2006-2019 Camilla Löwy <elmindreda@glfw.org>
|
||||
//
|
||||
// This software is provided 'as-is', without any express or implied
|
||||
// warranty. In no event will the authors be held liable for any damages
|
||||
|
@ -27,85 +24,149 @@
|
|||
// distribution.
|
||||
//
|
||||
//========================================================================
|
||||
// It is fine to use C99 in this file because it will not be built with VS
|
||||
//========================================================================
|
||||
|
||||
#include "internal.h"
|
||||
|
||||
#if defined(_GLFW_COCOA)
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <limits.h>
|
||||
#include <math.h>
|
||||
|
||||
#include <IOKit/graphics/IOGraphicsLib.h>
|
||||
#include <ApplicationServices/ApplicationServices.h>
|
||||
|
||||
|
||||
// Get the name of the specified display
|
||||
// Get the name of the specified display, or NULL
|
||||
//
|
||||
static const char* getDisplayName(CGDirectDisplayID displayID)
|
||||
static char* getMonitorName(CGDirectDisplayID displayID, NSScreen* screen)
|
||||
{
|
||||
char* name;
|
||||
CFDictionaryRef info, names;
|
||||
CFStringRef value;
|
||||
CFIndex size;
|
||||
|
||||
info = IODisplayCreateInfoDictionary(CGDisplayIOServicePort(displayID),
|
||||
kIODisplayOnlyPreferredName);
|
||||
names = CFDictionaryGetValue(info, CFSTR(kDisplayProductName));
|
||||
|
||||
if (!CFDictionaryGetValueIfPresent(names, CFSTR("en_US"),
|
||||
(const void**) &value))
|
||||
// IOKit doesn't work on Apple Silicon anymore
|
||||
// Luckily, 10.15 introduced -[NSScreen localizedName].
|
||||
// Use it if available, and fall back to IOKit otherwise.
|
||||
if (screen)
|
||||
{
|
||||
CFRelease(info);
|
||||
return strdup("Unknown");
|
||||
if ([screen respondsToSelector:@selector(localizedName)])
|
||||
{
|
||||
NSString* name = [screen valueForKey:@"localizedName"];
|
||||
if (name)
|
||||
return _glfw_strdup([name UTF8String]);
|
||||
}
|
||||
}
|
||||
|
||||
size = CFStringGetMaximumSizeForEncoding(CFStringGetLength(value),
|
||||
kCFStringEncodingUTF8);
|
||||
name = (char*) malloc(size + 1);
|
||||
CFStringGetCString(value, name, size, kCFStringEncodingUTF8);
|
||||
io_iterator_t it;
|
||||
io_service_t service;
|
||||
CFDictionaryRef info;
|
||||
|
||||
if (IOServiceGetMatchingServices(MACH_PORT_NULL,
|
||||
IOServiceMatching("IODisplayConnect"),
|
||||
&it) != 0)
|
||||
{
|
||||
// This may happen if a desktop Mac is running headless
|
||||
return _glfw_strdup("Display");
|
||||
}
|
||||
|
||||
while ((service = IOIteratorNext(it)) != 0)
|
||||
{
|
||||
info = IODisplayCreateInfoDictionary(service,
|
||||
kIODisplayOnlyPreferredName);
|
||||
|
||||
CFNumberRef vendorIDRef =
|
||||
CFDictionaryGetValue(info, CFSTR(kDisplayVendorID));
|
||||
CFNumberRef productIDRef =
|
||||
CFDictionaryGetValue(info, CFSTR(kDisplayProductID));
|
||||
if (!vendorIDRef || !productIDRef)
|
||||
{
|
||||
CFRelease(info);
|
||||
continue;
|
||||
}
|
||||
|
||||
unsigned int vendorID, productID;
|
||||
CFNumberGetValue(vendorIDRef, kCFNumberIntType, &vendorID);
|
||||
CFNumberGetValue(productIDRef, kCFNumberIntType, &productID);
|
||||
|
||||
if (CGDisplayVendorNumber(displayID) == vendorID &&
|
||||
CGDisplayModelNumber(displayID) == productID)
|
||||
{
|
||||
// Info dictionary is used and freed below
|
||||
break;
|
||||
}
|
||||
|
||||
CFRelease(info);
|
||||
}
|
||||
|
||||
IOObjectRelease(it);
|
||||
|
||||
if (!service)
|
||||
return _glfw_strdup("Display");
|
||||
|
||||
CFDictionaryRef names =
|
||||
CFDictionaryGetValue(info, CFSTR(kDisplayProductName));
|
||||
|
||||
CFStringRef nameRef;
|
||||
|
||||
if (!names || !CFDictionaryGetValueIfPresent(names, CFSTR("en_US"),
|
||||
(const void**) &nameRef))
|
||||
{
|
||||
// This may happen if a desktop Mac is running headless
|
||||
CFRelease(info);
|
||||
return _glfw_strdup("Display");
|
||||
}
|
||||
|
||||
const CFIndex size =
|
||||
CFStringGetMaximumSizeForEncoding(CFStringGetLength(nameRef),
|
||||
kCFStringEncodingUTF8);
|
||||
char* name = _glfw_calloc(size + 1, 1);
|
||||
CFStringGetCString(nameRef, name, size, kCFStringEncodingUTF8);
|
||||
|
||||
CFRelease(info);
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
// Check whether the display mode should be included in enumeration
|
||||
//
|
||||
static GLboolean modeIsGood(CGDisplayModeRef mode)
|
||||
static GLFWbool modeIsGood(CGDisplayModeRef mode)
|
||||
{
|
||||
uint32_t flags = CGDisplayModeGetIOFlags(mode);
|
||||
|
||||
if (!(flags & kDisplayModeValidFlag) || !(flags & kDisplayModeSafeFlag))
|
||||
return GL_FALSE;
|
||||
|
||||
return GLFW_FALSE;
|
||||
if (flags & kDisplayModeInterlacedFlag)
|
||||
return GL_FALSE;
|
||||
|
||||
if (flags & kDisplayModeTelevisionFlag)
|
||||
return GL_FALSE;
|
||||
|
||||
return GLFW_FALSE;
|
||||
if (flags & kDisplayModeStretchedFlag)
|
||||
return GL_FALSE;
|
||||
return GLFW_FALSE;
|
||||
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED <= 101100
|
||||
CFStringRef format = CGDisplayModeCopyPixelEncoding(mode);
|
||||
if (CFStringCompare(format, CFSTR(IO16BitDirectPixels), 0) &&
|
||||
CFStringCompare(format, CFSTR(IO32BitDirectPixels), 0))
|
||||
{
|
||||
CFRelease(format);
|
||||
return GL_FALSE;
|
||||
return GLFW_FALSE;
|
||||
}
|
||||
|
||||
CFRelease(format);
|
||||
return GL_TRUE;
|
||||
#endif /* MAC_OS_X_VERSION_MAX_ALLOWED */
|
||||
return GLFW_TRUE;
|
||||
}
|
||||
|
||||
// Convert Core Graphics display mode to GLFW video mode
|
||||
//
|
||||
static GLFWvidmode vidmodeFromCGDisplayMode(CGDisplayModeRef mode)
|
||||
static GLFWvidmode vidmodeFromCGDisplayMode(CGDisplayModeRef mode,
|
||||
double fallbackRefreshRate)
|
||||
{
|
||||
GLFWvidmode result;
|
||||
result.width = CGDisplayModeGetWidth(mode);
|
||||
result.height = CGDisplayModeGetHeight(mode);
|
||||
result.refreshRate = (int) CGDisplayModeGetRefreshRate(mode);
|
||||
result.width = (int) CGDisplayModeGetWidth(mode);
|
||||
result.height = (int) CGDisplayModeGetHeight(mode);
|
||||
result.refreshRate = (int) round(CGDisplayModeGetRefreshRate(mode));
|
||||
|
||||
if (result.refreshRate == 0)
|
||||
result.refreshRate = (int) round(fallbackRefreshRate);
|
||||
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED <= 101100
|
||||
CFStringRef format = CGDisplayModeCopyPixelEncoding(mode);
|
||||
|
||||
if (CFStringCompare(format, CFSTR(IO16BitDirectPixels), 0) == 0)
|
||||
{
|
||||
result.redBits = 5;
|
||||
|
@ -113,13 +174,16 @@ static GLFWvidmode vidmodeFromCGDisplayMode(CGDisplayModeRef mode)
|
|||
result.blueBits = 5;
|
||||
}
|
||||
else
|
||||
#endif /* MAC_OS_X_VERSION_MAX_ALLOWED */
|
||||
{
|
||||
result.redBits = 8;
|
||||
result.greenBits = 8;
|
||||
result.blueBits = 8;
|
||||
}
|
||||
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED <= 101100
|
||||
CFRelease(format);
|
||||
#endif /* MAC_OS_X_VERSION_MAX_ALLOWED */
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -130,7 +194,13 @@ static CGDisplayFadeReservationToken beginFadeReservation(void)
|
|||
CGDisplayFadeReservationToken token = kCGDisplayFadeReservationInvalidToken;
|
||||
|
||||
if (CGAcquireDisplayFadeReservation(5, &token) == kCGErrorSuccess)
|
||||
CGDisplayFade(token, 0.3, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0.0, 0.0, 0.0, TRUE);
|
||||
{
|
||||
CGDisplayFade(token, 0.3,
|
||||
kCGDisplayBlendNormal,
|
||||
kCGDisplayBlendSolidColor,
|
||||
0.0, 0.0, 0.0,
|
||||
TRUE);
|
||||
}
|
||||
|
||||
return token;
|
||||
}
|
||||
|
@ -141,101 +211,233 @@ static void endFadeReservation(CGDisplayFadeReservationToken token)
|
|||
{
|
||||
if (token != kCGDisplayFadeReservationInvalidToken)
|
||||
{
|
||||
CGDisplayFade(token, 0.5, kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0.0, 0.0, 0.0, FALSE);
|
||||
CGDisplayFade(token, 0.5,
|
||||
kCGDisplayBlendSolidColor,
|
||||
kCGDisplayBlendNormal,
|
||||
0.0, 0.0, 0.0,
|
||||
FALSE);
|
||||
CGReleaseDisplayFadeReservation(token);
|
||||
}
|
||||
}
|
||||
|
||||
// Returns the display refresh rate queried from the I/O registry
|
||||
//
|
||||
static double getFallbackRefreshRate(CGDirectDisplayID displayID)
|
||||
{
|
||||
double refreshRate = 60.0;
|
||||
|
||||
io_iterator_t it;
|
||||
io_service_t service;
|
||||
|
||||
if (IOServiceGetMatchingServices(MACH_PORT_NULL,
|
||||
IOServiceMatching("IOFramebuffer"),
|
||||
&it) != 0)
|
||||
{
|
||||
return refreshRate;
|
||||
}
|
||||
|
||||
while ((service = IOIteratorNext(it)) != 0)
|
||||
{
|
||||
const CFNumberRef indexRef =
|
||||
IORegistryEntryCreateCFProperty(service,
|
||||
CFSTR("IOFramebufferOpenGLIndex"),
|
||||
kCFAllocatorDefault,
|
||||
kNilOptions);
|
||||
if (!indexRef)
|
||||
continue;
|
||||
|
||||
uint32_t index = 0;
|
||||
CFNumberGetValue(indexRef, kCFNumberIntType, &index);
|
||||
CFRelease(indexRef);
|
||||
|
||||
if (CGOpenGLDisplayMaskToDisplayID(1 << index) != displayID)
|
||||
continue;
|
||||
|
||||
const CFNumberRef clockRef =
|
||||
IORegistryEntryCreateCFProperty(service,
|
||||
CFSTR("IOFBCurrentPixelClock"),
|
||||
kCFAllocatorDefault,
|
||||
kNilOptions);
|
||||
const CFNumberRef countRef =
|
||||
IORegistryEntryCreateCFProperty(service,
|
||||
CFSTR("IOFBCurrentPixelCount"),
|
||||
kCFAllocatorDefault,
|
||||
kNilOptions);
|
||||
|
||||
uint32_t clock = 0, count = 0;
|
||||
|
||||
if (clockRef)
|
||||
{
|
||||
CFNumberGetValue(clockRef, kCFNumberIntType, &clock);
|
||||
CFRelease(clockRef);
|
||||
}
|
||||
|
||||
if (countRef)
|
||||
{
|
||||
CFNumberGetValue(countRef, kCFNumberIntType, &count);
|
||||
CFRelease(countRef);
|
||||
}
|
||||
|
||||
if (clock > 0 && count > 0)
|
||||
refreshRate = clock / (double) count;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
IOObjectRelease(it);
|
||||
return refreshRate;
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
////// GLFW internal API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Change the current video mode
|
||||
// Poll for changes in the set of connected monitors
|
||||
//
|
||||
GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired)
|
||||
void _glfwPollMonitorsCocoa(void)
|
||||
{
|
||||
CGDisplayModeRef bestMode = NULL;
|
||||
CFArrayRef modes;
|
||||
CFIndex count, i;
|
||||
unsigned int sizeDiff, leastSizeDiff = UINT_MAX;
|
||||
unsigned int rateDiff, leastRateDiff = UINT_MAX;
|
||||
const int bpp = desired->redBits - desired->greenBits - desired->blueBits;
|
||||
uint32_t displayCount;
|
||||
CGGetOnlineDisplayList(0, NULL, &displayCount);
|
||||
CGDirectDisplayID* displays = _glfw_calloc(displayCount, sizeof(CGDirectDisplayID));
|
||||
CGGetOnlineDisplayList(displayCount, displays, &displayCount);
|
||||
|
||||
modes = CGDisplayCopyAllDisplayModes(monitor->ns.displayID, NULL);
|
||||
count = CFArrayGetCount(modes);
|
||||
for (int i = 0; i < _glfw.monitorCount; i++)
|
||||
_glfw.monitors[i]->ns.screen = nil;
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
_GLFWmonitor** disconnected = NULL;
|
||||
uint32_t disconnectedCount = _glfw.monitorCount;
|
||||
if (disconnectedCount)
|
||||
{
|
||||
CGDisplayModeRef mode = (CGDisplayModeRef) CFArrayGetValueAtIndex(modes, i);
|
||||
if (!modeIsGood(mode))
|
||||
disconnected = _glfw_calloc(_glfw.monitorCount, sizeof(_GLFWmonitor*));
|
||||
memcpy(disconnected,
|
||||
_glfw.monitors,
|
||||
_glfw.monitorCount * sizeof(_GLFWmonitor*));
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < displayCount; i++)
|
||||
{
|
||||
if (CGDisplayIsAsleep(displays[i]))
|
||||
continue;
|
||||
|
||||
int modeBPP;
|
||||
const uint32_t unitNumber = CGDisplayUnitNumber(displays[i]);
|
||||
NSScreen* screen = nil;
|
||||
|
||||
// Identify display mode pixel encoding
|
||||
for (screen in [NSScreen screens])
|
||||
{
|
||||
CFStringRef format = CGDisplayModeCopyPixelEncoding(mode);
|
||||
NSNumber* screenNumber = [screen deviceDescription][@"NSScreenNumber"];
|
||||
|
||||
if (CFStringCompare(format, CFSTR(IO16BitDirectPixels), 0) == 0)
|
||||
modeBPP = 16;
|
||||
else
|
||||
modeBPP = 32;
|
||||
|
||||
CFRelease(format);
|
||||
// HACK: Compare unit numbers instead of display IDs to work around
|
||||
// display replacement on machines with automatic graphics
|
||||
// switching
|
||||
if (CGDisplayUnitNumber([screenNumber unsignedIntValue]) == unitNumber)
|
||||
break;
|
||||
}
|
||||
|
||||
const int modeWidth = (int) CGDisplayModeGetWidth(mode);
|
||||
const int modeHeight = (int) CGDisplayModeGetHeight(mode);
|
||||
const int modeRate = (int) CGDisplayModeGetRefreshRate(mode);
|
||||
|
||||
sizeDiff = (abs(modeBPP - bpp) << 25) |
|
||||
((modeWidth - desired->width) * (modeWidth - desired->width) +
|
||||
(modeHeight - desired->height) * (modeHeight - desired->height));
|
||||
|
||||
if (desired->refreshRate)
|
||||
rateDiff = abs(modeRate - desired->refreshRate);
|
||||
else
|
||||
rateDiff = UINT_MAX - modeRate;
|
||||
|
||||
if ((sizeDiff < leastSizeDiff) ||
|
||||
(sizeDiff == leastSizeDiff && rateDiff < leastRateDiff))
|
||||
// HACK: Compare unit numbers instead of display IDs to work around
|
||||
// display replacement on machines with automatic graphics
|
||||
// switching
|
||||
uint32_t j;
|
||||
for (j = 0; j < disconnectedCount; j++)
|
||||
{
|
||||
bestMode = mode;
|
||||
leastSizeDiff = sizeDiff;
|
||||
leastRateDiff = rateDiff;
|
||||
if (disconnected[j] && disconnected[j]->ns.unitNumber == unitNumber)
|
||||
{
|
||||
disconnected[j]->ns.screen = screen;
|
||||
disconnected[j] = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (j < disconnectedCount)
|
||||
continue;
|
||||
|
||||
const CGSize size = CGDisplayScreenSize(displays[i]);
|
||||
char* name = getMonitorName(displays[i], screen);
|
||||
if (!name)
|
||||
continue;
|
||||
|
||||
_GLFWmonitor* monitor = _glfwAllocMonitor(name, size.width, size.height);
|
||||
monitor->ns.displayID = displays[i];
|
||||
monitor->ns.unitNumber = unitNumber;
|
||||
monitor->ns.screen = screen;
|
||||
|
||||
_glfw_free(name);
|
||||
|
||||
CGDisplayModeRef mode = CGDisplayCopyDisplayMode(displays[i]);
|
||||
if (CGDisplayModeGetRefreshRate(mode) == 0.0)
|
||||
monitor->ns.fallbackRefreshRate = getFallbackRefreshRate(displays[i]);
|
||||
CGDisplayModeRelease(mode);
|
||||
|
||||
_glfwInputMonitor(monitor, GLFW_CONNECTED, _GLFW_INSERT_LAST);
|
||||
}
|
||||
|
||||
if (!bestMode)
|
||||
for (uint32_t i = 0; i < disconnectedCount; i++)
|
||||
{
|
||||
CFRelease(modes);
|
||||
return GL_FALSE;
|
||||
if (disconnected[i])
|
||||
_glfwInputMonitor(disconnected[i], GLFW_DISCONNECTED, 0);
|
||||
}
|
||||
|
||||
monitor->ns.previousMode = CGDisplayCopyDisplayMode(monitor->ns.displayID);
|
||||
_glfw_free(disconnected);
|
||||
_glfw_free(displays);
|
||||
}
|
||||
|
||||
CGDisplayFadeReservationToken token = beginFadeReservation();
|
||||
// Change the current video mode
|
||||
//
|
||||
void _glfwSetVideoModeCocoa(_GLFWmonitor* monitor, const GLFWvidmode* desired)
|
||||
{
|
||||
GLFWvidmode current;
|
||||
_glfwGetVideoModeCocoa(monitor, ¤t);
|
||||
|
||||
CGDisplayCapture(monitor->ns.displayID);
|
||||
CGDisplaySetDisplayMode(monitor->ns.displayID, bestMode, NULL);
|
||||
const GLFWvidmode* best = _glfwChooseVideoMode(monitor, desired);
|
||||
if (_glfwCompareVideoModes(¤t, best) == 0)
|
||||
return;
|
||||
|
||||
endFadeReservation(token);
|
||||
CFArrayRef modes = CGDisplayCopyAllDisplayModes(monitor->ns.displayID, NULL);
|
||||
const CFIndex count = CFArrayGetCount(modes);
|
||||
CGDisplayModeRef native = NULL;
|
||||
|
||||
for (CFIndex i = 0; i < count; i++)
|
||||
{
|
||||
CGDisplayModeRef dm = (CGDisplayModeRef) CFArrayGetValueAtIndex(modes, i);
|
||||
if (!modeIsGood(dm))
|
||||
continue;
|
||||
|
||||
const GLFWvidmode mode =
|
||||
vidmodeFromCGDisplayMode(dm, monitor->ns.fallbackRefreshRate);
|
||||
if (_glfwCompareVideoModes(best, &mode) == 0)
|
||||
{
|
||||
native = dm;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (native)
|
||||
{
|
||||
if (monitor->ns.previousMode == NULL)
|
||||
monitor->ns.previousMode = CGDisplayCopyDisplayMode(monitor->ns.displayID);
|
||||
|
||||
CGDisplayFadeReservationToken token = beginFadeReservation();
|
||||
CGDisplaySetDisplayMode(monitor->ns.displayID, native, NULL);
|
||||
endFadeReservation(token);
|
||||
}
|
||||
|
||||
CFRelease(modes);
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
// Restore the previously saved (original) video mode
|
||||
//
|
||||
void _glfwRestoreVideoMode(_GLFWmonitor* monitor)
|
||||
void _glfwRestoreVideoModeCocoa(_GLFWmonitor* monitor)
|
||||
{
|
||||
CGDisplayFadeReservationToken token = beginFadeReservation();
|
||||
if (monitor->ns.previousMode)
|
||||
{
|
||||
CGDisplayFadeReservationToken token = beginFadeReservation();
|
||||
CGDisplaySetDisplayMode(monitor->ns.displayID,
|
||||
monitor->ns.previousMode, NULL);
|
||||
endFadeReservation(token);
|
||||
|
||||
CGDisplaySetDisplayMode(monitor->ns.displayID, monitor->ns.previousMode, NULL);
|
||||
CGDisplayRelease(monitor->ns.displayID);
|
||||
|
||||
endFadeReservation(token);
|
||||
CGDisplayModeRelease(monitor->ns.previousMode);
|
||||
monitor->ns.previousMode = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -243,129 +445,187 @@ void _glfwRestoreVideoMode(_GLFWmonitor* monitor)
|
|||
////// GLFW platform API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
_GLFWmonitor** _glfwPlatformGetMonitors(int* count)
|
||||
void _glfwFreeMonitorCocoa(_GLFWmonitor* monitor)
|
||||
{
|
||||
uint32_t i, found = 0, monitorCount;
|
||||
_GLFWmonitor** monitors;
|
||||
CGDirectDisplayID* displays;
|
||||
|
||||
*count = 0;
|
||||
|
||||
CGGetActiveDisplayList(0, NULL, &monitorCount);
|
||||
|
||||
displays = (CGDirectDisplayID*) calloc(monitorCount, sizeof(CGDirectDisplayID));
|
||||
monitors = (_GLFWmonitor**) calloc(monitorCount, sizeof(_GLFWmonitor*));
|
||||
|
||||
CGGetActiveDisplayList(monitorCount, displays, &monitorCount);
|
||||
|
||||
for (i = 0; i < monitorCount; i++)
|
||||
{
|
||||
const CGSize size = CGDisplayScreenSize(displays[i]);
|
||||
|
||||
monitors[found] = _glfwCreateMonitor(getDisplayName(displays[i]),
|
||||
size.width, size.height);
|
||||
|
||||
monitors[found]->ns.displayID = displays[i];
|
||||
found++;
|
||||
}
|
||||
|
||||
free(displays);
|
||||
|
||||
for (i = 0; i < monitorCount; i++)
|
||||
{
|
||||
if (CGDisplayIsMain(monitors[i]->ns.displayID))
|
||||
{
|
||||
_GLFWmonitor* temp = monitors[0];
|
||||
monitors[0] = monitors[i];
|
||||
monitors[i] = temp;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
NSArray* screens = [NSScreen screens];
|
||||
|
||||
for (i = 0; i < monitorCount; i++)
|
||||
{
|
||||
int j;
|
||||
|
||||
for (j = 0; j < [screens count]; j++)
|
||||
{
|
||||
NSScreen* screen = [screens objectAtIndex:j];
|
||||
NSDictionary* dictionary = [screen deviceDescription];
|
||||
NSNumber* number = [dictionary objectForKey:@"NSScreenNumber"];
|
||||
|
||||
if (monitors[i]->ns.displayID == [number unsignedIntegerValue])
|
||||
{
|
||||
monitors[i]->ns.screen = screen;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (monitors[i]->ns.screen == nil)
|
||||
{
|
||||
_glfwDestroyMonitors(monitors, monitorCount);
|
||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||
"Cocoa: Failed to find NSScreen for CGDisplay %s",
|
||||
monitors[i]->name);
|
||||
|
||||
free(monitors);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
*count = monitorCount;
|
||||
return monitors;
|
||||
}
|
||||
|
||||
GLboolean _glfwPlatformIsSameMonitor(_GLFWmonitor* first, _GLFWmonitor* second)
|
||||
void _glfwGetMonitorPosCocoa(_GLFWmonitor* monitor, int* xpos, int* ypos)
|
||||
{
|
||||
return first->ns.displayID == second->ns.displayID;
|
||||
}
|
||||
@autoreleasepool {
|
||||
|
||||
void _glfwPlatformGetMonitorPos(_GLFWmonitor* monitor, int* xpos, int* ypos)
|
||||
{
|
||||
const CGRect bounds = CGDisplayBounds(monitor->ns.displayID);
|
||||
|
||||
if (xpos)
|
||||
*xpos = (int) bounds.origin.x;
|
||||
if (ypos)
|
||||
*ypos = (int) bounds.origin.y;
|
||||
|
||||
} // autoreleasepool
|
||||
}
|
||||
|
||||
GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* found)
|
||||
void _glfwGetMonitorContentScaleCocoa(_GLFWmonitor* monitor,
|
||||
float* xscale, float* yscale)
|
||||
{
|
||||
CFArrayRef modes;
|
||||
CFIndex count, i;
|
||||
GLFWvidmode* result;
|
||||
@autoreleasepool {
|
||||
|
||||
modes = CGDisplayCopyAllDisplayModes(monitor->ns.displayID, NULL);
|
||||
count = CFArrayGetCount(modes);
|
||||
|
||||
result = (GLFWvidmode*) malloc(sizeof(GLFWvidmode) * count);
|
||||
*found = 0;
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
if (!monitor->ns.screen)
|
||||
{
|
||||
CGDisplayModeRef mode;
|
||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||
"Cocoa: Cannot query content scale without screen");
|
||||
}
|
||||
|
||||
mode = (CGDisplayModeRef) CFArrayGetValueAtIndex(modes, i);
|
||||
if (modeIsGood(mode))
|
||||
const NSRect points = [monitor->ns.screen frame];
|
||||
const NSRect pixels = [monitor->ns.screen convertRectToBacking:points];
|
||||
|
||||
if (xscale)
|
||||
*xscale = (float) (pixels.size.width / points.size.width);
|
||||
if (yscale)
|
||||
*yscale = (float) (pixels.size.height / points.size.height);
|
||||
|
||||
} // autoreleasepool
|
||||
}
|
||||
|
||||
void _glfwGetMonitorWorkareaCocoa(_GLFWmonitor* monitor,
|
||||
int* xpos, int* ypos,
|
||||
int* width, int* height)
|
||||
{
|
||||
@autoreleasepool {
|
||||
|
||||
if (!monitor->ns.screen)
|
||||
{
|
||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||
"Cocoa: Cannot query workarea without screen");
|
||||
}
|
||||
|
||||
const NSRect frameRect = [monitor->ns.screen visibleFrame];
|
||||
|
||||
if (xpos)
|
||||
*xpos = frameRect.origin.x;
|
||||
if (ypos)
|
||||
*ypos = _glfwTransformYCocoa(frameRect.origin.y + frameRect.size.height - 1);
|
||||
if (width)
|
||||
*width = frameRect.size.width;
|
||||
if (height)
|
||||
*height = frameRect.size.height;
|
||||
|
||||
} // autoreleasepool
|
||||
}
|
||||
|
||||
GLFWvidmode* _glfwGetVideoModesCocoa(_GLFWmonitor* monitor, int* count)
|
||||
{
|
||||
@autoreleasepool {
|
||||
|
||||
*count = 0;
|
||||
|
||||
CFArrayRef modes = CGDisplayCopyAllDisplayModes(monitor->ns.displayID, NULL);
|
||||
const CFIndex found = CFArrayGetCount(modes);
|
||||
GLFWvidmode* result = _glfw_calloc(found, sizeof(GLFWvidmode));
|
||||
|
||||
for (CFIndex i = 0; i < found; i++)
|
||||
{
|
||||
CGDisplayModeRef dm = (CGDisplayModeRef) CFArrayGetValueAtIndex(modes, i);
|
||||
if (!modeIsGood(dm))
|
||||
continue;
|
||||
|
||||
const GLFWvidmode mode =
|
||||
vidmodeFromCGDisplayMode(dm, monitor->ns.fallbackRefreshRate);
|
||||
CFIndex j;
|
||||
|
||||
for (j = 0; j < *count; j++)
|
||||
{
|
||||
result[*found] = vidmodeFromCGDisplayMode(mode);
|
||||
(*found)++;
|
||||
if (_glfwCompareVideoModes(result + j, &mode) == 0)
|
||||
break;
|
||||
}
|
||||
|
||||
// Skip duplicate modes
|
||||
if (j < *count)
|
||||
continue;
|
||||
|
||||
(*count)++;
|
||||
result[*count - 1] = mode;
|
||||
}
|
||||
|
||||
CFRelease(modes);
|
||||
return result;
|
||||
|
||||
} // autoreleasepool
|
||||
}
|
||||
|
||||
void _glfwPlatformGetVideoMode(_GLFWmonitor* monitor, GLFWvidmode *mode)
|
||||
void _glfwGetVideoModeCocoa(_GLFWmonitor* monitor, GLFWvidmode *mode)
|
||||
{
|
||||
CGDisplayModeRef displayMode;
|
||||
@autoreleasepool {
|
||||
|
||||
displayMode = CGDisplayCopyDisplayMode(monitor->ns.displayID);
|
||||
*mode = vidmodeFromCGDisplayMode(displayMode);
|
||||
CGDisplayModeRelease(displayMode);
|
||||
CGDisplayModeRef native = CGDisplayCopyDisplayMode(monitor->ns.displayID);
|
||||
*mode = vidmodeFromCGDisplayMode(native, monitor->ns.fallbackRefreshRate);
|
||||
CGDisplayModeRelease(native);
|
||||
|
||||
} // autoreleasepool
|
||||
}
|
||||
|
||||
GLFWbool _glfwGetGammaRampCocoa(_GLFWmonitor* monitor, GLFWgammaramp* ramp)
|
||||
{
|
||||
@autoreleasepool {
|
||||
|
||||
uint32_t size = CGDisplayGammaTableCapacity(monitor->ns.displayID);
|
||||
CGGammaValue* values = _glfw_calloc(size * 3, sizeof(CGGammaValue));
|
||||
|
||||
CGGetDisplayTransferByTable(monitor->ns.displayID,
|
||||
size,
|
||||
values,
|
||||
values + size,
|
||||
values + size * 2,
|
||||
&size);
|
||||
|
||||
_glfwAllocGammaArrays(ramp, size);
|
||||
|
||||
for (uint32_t i = 0; i < size; i++)
|
||||
{
|
||||
ramp->red[i] = (unsigned short) (values[i] * 65535);
|
||||
ramp->green[i] = (unsigned short) (values[i + size] * 65535);
|
||||
ramp->blue[i] = (unsigned short) (values[i + size * 2] * 65535);
|
||||
}
|
||||
|
||||
_glfw_free(values);
|
||||
return GLFW_TRUE;
|
||||
|
||||
} // autoreleasepool
|
||||
}
|
||||
|
||||
void _glfwSetGammaRampCocoa(_GLFWmonitor* monitor, const GLFWgammaramp* ramp)
|
||||
{
|
||||
@autoreleasepool {
|
||||
|
||||
CGGammaValue* values = _glfw_calloc(ramp->size * 3, sizeof(CGGammaValue));
|
||||
|
||||
for (unsigned int i = 0; i < ramp->size; i++)
|
||||
{
|
||||
values[i] = ramp->red[i] / 65535.f;
|
||||
values[i + ramp->size] = ramp->green[i] / 65535.f;
|
||||
values[i + ramp->size * 2] = ramp->blue[i] / 65535.f;
|
||||
}
|
||||
|
||||
CGSetDisplayTransferByTable(monitor->ns.displayID,
|
||||
ramp->size,
|
||||
values,
|
||||
values + ramp->size,
|
||||
values + ramp->size * 2);
|
||||
|
||||
_glfw_free(values);
|
||||
|
||||
} // autoreleasepool
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
////// GLFW native API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
GLFWAPI CGDirectDisplayID glfwGetCocoaMonitor(GLFWmonitor* handle)
|
||||
{
|
||||
_GLFWmonitor* monitor = (_GLFWmonitor*) handle;
|
||||
_GLFW_REQUIRE_INIT_OR_RETURN(kCGNullDirectDisplay);
|
||||
return monitor->ns.displayID;
|
||||
}
|
||||
|
||||
#endif // _GLFW_COCOA
|
||||
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
//========================================================================
|
||||
// GLFW - An OpenGL library
|
||||
// Platform: Cocoa
|
||||
// API Version: 3.0
|
||||
// WWW: http://www.glfw.org/
|
||||
// GLFW 3.4 macOS - www.glfw.org
|
||||
//------------------------------------------------------------------------
|
||||
// Copyright (c) 2009-2010 Camilla Berglund <elmindreda@elmindreda.org>
|
||||
// Copyright (c) 2009-2019 Camilla Löwy <elmindreda@glfw.org>
|
||||
//
|
||||
// This software is provided 'as-is', without any express or implied
|
||||
// warranty. In no event will the authors be held liable for any damages
|
||||
|
@ -27,128 +24,279 @@
|
|||
//
|
||||
//========================================================================
|
||||
|
||||
#ifndef _cocoa_platform_h_
|
||||
#define _cocoa_platform_h_
|
||||
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <Carbon/Carbon.h>
|
||||
#include <IOKit/hid/IOHIDLib.h>
|
||||
|
||||
// NOTE: All of NSGL was deprecated in the 10.14 SDK
|
||||
// This disables the pointless warnings for every symbol we use
|
||||
#ifndef GL_SILENCE_DEPRECATION
|
||||
#define GL_SILENCE_DEPRECATION
|
||||
#endif
|
||||
|
||||
#if defined(__OBJC__)
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#else
|
||||
#include <ApplicationServices/ApplicationServices.h>
|
||||
typedef void* id;
|
||||
#endif
|
||||
|
||||
#if defined(_GLFW_NSGL)
|
||||
#include "nsgl_platform.h"
|
||||
#else
|
||||
#error "No supported context creation API selected"
|
||||
// NOTE: Many Cocoa enum values have been renamed and we need to build across
|
||||
// SDK versions where one is unavailable or deprecated.
|
||||
// We use the newer names in code and replace them with the older names if
|
||||
// the base SDK does not provide the newer names.
|
||||
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < 101400
|
||||
#define NSOpenGLContextParameterSwapInterval NSOpenGLCPSwapInterval
|
||||
#define NSOpenGLContextParameterSurfaceOpacity NSOpenGLCPSurfaceOpacity
|
||||
#endif
|
||||
|
||||
#include <IOKit/IOKitLib.h>
|
||||
#include <IOKit/IOCFPlugIn.h>
|
||||
#include <IOKit/hid/IOHIDLib.h>
|
||||
#include <IOKit/hid/IOHIDKeys.h>
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < 101200
|
||||
#define NSBitmapFormatAlphaNonpremultiplied NSAlphaNonpremultipliedBitmapFormat
|
||||
#define NSEventMaskAny NSAnyEventMask
|
||||
#define NSEventMaskKeyUp NSKeyUpMask
|
||||
#define NSEventModifierFlagCapsLock NSAlphaShiftKeyMask
|
||||
#define NSEventModifierFlagCommand NSCommandKeyMask
|
||||
#define NSEventModifierFlagControl NSControlKeyMask
|
||||
#define NSEventModifierFlagDeviceIndependentFlagsMask NSDeviceIndependentModifierFlagsMask
|
||||
#define NSEventModifierFlagOption NSAlternateKeyMask
|
||||
#define NSEventModifierFlagShift NSShiftKeyMask
|
||||
#define NSEventTypeApplicationDefined NSApplicationDefined
|
||||
#define NSWindowStyleMaskBorderless NSBorderlessWindowMask
|
||||
#define NSWindowStyleMaskClosable NSClosableWindowMask
|
||||
#define NSWindowStyleMaskMiniaturizable NSMiniaturizableWindowMask
|
||||
#define NSWindowStyleMaskResizable NSResizableWindowMask
|
||||
#define NSWindowStyleMaskTitled NSTitledWindowMask
|
||||
#endif
|
||||
|
||||
#define _GLFW_PLATFORM_WINDOW_STATE _GLFWwindowNS ns
|
||||
#define _GLFW_PLATFORM_LIBRARY_WINDOW_STATE _GLFWlibraryNS ns
|
||||
#define _GLFW_PLATFORM_MONITOR_STATE _GLFWmonitorNS ns
|
||||
// NOTE: Many Cocoa dynamically linked constants have been renamed and we need
|
||||
// to build across SDK versions where one is unavailable or deprecated.
|
||||
// We use the newer names in code and replace them with the older names if
|
||||
// the deployment target is older than the newer names.
|
||||
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < 101300
|
||||
#define NSPasteboardTypeURL NSURLPboardType
|
||||
#endif
|
||||
|
||||
typedef VkFlags VkMacOSSurfaceCreateFlagsMVK;
|
||||
typedef VkFlags VkMetalSurfaceCreateFlagsEXT;
|
||||
|
||||
typedef struct VkMacOSSurfaceCreateInfoMVK
|
||||
{
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkMacOSSurfaceCreateFlagsMVK flags;
|
||||
const void* pView;
|
||||
} VkMacOSSurfaceCreateInfoMVK;
|
||||
|
||||
typedef struct VkMetalSurfaceCreateInfoEXT
|
||||
{
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkMetalSurfaceCreateFlagsEXT flags;
|
||||
const void* pLayer;
|
||||
} VkMetalSurfaceCreateInfoEXT;
|
||||
|
||||
typedef VkResult (APIENTRY *PFN_vkCreateMacOSSurfaceMVK)(VkInstance,const VkMacOSSurfaceCreateInfoMVK*,const VkAllocationCallbacks*,VkSurfaceKHR*);
|
||||
typedef VkResult (APIENTRY *PFN_vkCreateMetalSurfaceEXT)(VkInstance,const VkMetalSurfaceCreateInfoEXT*,const VkAllocationCallbacks*,VkSurfaceKHR*);
|
||||
|
||||
#define GLFW_COCOA_WINDOW_STATE _GLFWwindowNS ns;
|
||||
#define GLFW_COCOA_LIBRARY_WINDOW_STATE _GLFWlibraryNS ns;
|
||||
#define GLFW_COCOA_MONITOR_STATE _GLFWmonitorNS ns;
|
||||
#define GLFW_COCOA_CURSOR_STATE _GLFWcursorNS ns;
|
||||
|
||||
#define GLFW_NSGL_CONTEXT_STATE _GLFWcontextNSGL nsgl;
|
||||
#define GLFW_NSGL_LIBRARY_CONTEXT_STATE _GLFWlibraryNSGL nsgl;
|
||||
|
||||
// HIToolbox.framework pointer typedefs
|
||||
#define kTISPropertyUnicodeKeyLayoutData _glfw.ns.tis.kPropertyUnicodeKeyLayoutData
|
||||
typedef TISInputSourceRef (*PFN_TISCopyCurrentKeyboardLayoutInputSource)(void);
|
||||
#define TISCopyCurrentKeyboardLayoutInputSource _glfw.ns.tis.CopyCurrentKeyboardLayoutInputSource
|
||||
typedef void* (*PFN_TISGetInputSourceProperty)(TISInputSourceRef,CFStringRef);
|
||||
#define TISGetInputSourceProperty _glfw.ns.tis.GetInputSourceProperty
|
||||
typedef UInt8 (*PFN_LMGetKbdType)(void);
|
||||
#define LMGetKbdType _glfw.ns.tis.GetKbdType
|
||||
|
||||
|
||||
//========================================================================
|
||||
// GLFW platform specific types
|
||||
//========================================================================
|
||||
// NSGL-specific per-context data
|
||||
//
|
||||
typedef struct _GLFWcontextNSGL
|
||||
{
|
||||
id pixelFormat;
|
||||
id object;
|
||||
} _GLFWcontextNSGL;
|
||||
|
||||
// NSGL-specific global data
|
||||
//
|
||||
typedef struct _GLFWlibraryNSGL
|
||||
{
|
||||
// dlopen handle for OpenGL.framework (for glfwGetProcAddress)
|
||||
CFBundleRef framework;
|
||||
} _GLFWlibraryNSGL;
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Platform-specific window structure
|
||||
//------------------------------------------------------------------------
|
||||
// Cocoa-specific per-window data
|
||||
//
|
||||
typedef struct _GLFWwindowNS
|
||||
{
|
||||
id object;
|
||||
id delegate;
|
||||
id delegate;
|
||||
id view;
|
||||
unsigned int modifierFlags;
|
||||
id layer;
|
||||
|
||||
GLFWbool maximized;
|
||||
GLFWbool occluded;
|
||||
GLFWbool retina;
|
||||
|
||||
// Cached window properties to filter out duplicate events
|
||||
int width, height;
|
||||
int fbWidth, fbHeight;
|
||||
float xscale, yscale;
|
||||
|
||||
// The total sum of the distances the cursor has been warped
|
||||
// since the last cursor motion event was processed
|
||||
// This is kept to counteract Cocoa doing the same internally
|
||||
double cursorWarpDeltaX, cursorWarpDeltaY;
|
||||
} _GLFWwindowNS;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Joystick information & state
|
||||
//------------------------------------------------------------------------
|
||||
typedef struct
|
||||
{
|
||||
int present;
|
||||
char name[256];
|
||||
|
||||
IOHIDDeviceInterface** interface;
|
||||
|
||||
CFMutableArrayRef axisElements;
|
||||
CFMutableArrayRef buttonElements;
|
||||
CFMutableArrayRef hatElements;
|
||||
|
||||
float* axes;
|
||||
unsigned char* buttons;
|
||||
|
||||
} _GLFWjoy;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Platform-specific library global data for Cocoa
|
||||
//------------------------------------------------------------------------
|
||||
// Cocoa-specific global data
|
||||
//
|
||||
typedef struct _GLFWlibraryNS
|
||||
{
|
||||
CGEventSourceRef eventSource;
|
||||
id delegate;
|
||||
GLFWbool cursorHidden;
|
||||
TISInputSourceRef inputSource;
|
||||
IOHIDManagerRef hidManager;
|
||||
id unicodeData;
|
||||
id helper;
|
||||
id keyUpMonitor;
|
||||
id nibObjects;
|
||||
|
||||
char keynames[GLFW_KEY_LAST + 1][17];
|
||||
short int keycodes[256];
|
||||
short int scancodes[GLFW_KEY_LAST + 1];
|
||||
char* clipboardString;
|
||||
CGPoint cascadePoint;
|
||||
// Where to place the cursor when re-enabled
|
||||
double restoreCursorPosX, restoreCursorPosY;
|
||||
// The window whose disabled cursor mode is active
|
||||
_GLFWwindow* disabledCursorWindow;
|
||||
|
||||
struct {
|
||||
double base;
|
||||
double resolution;
|
||||
} timer;
|
||||
|
||||
CGEventSourceRef eventSource;
|
||||
id delegate;
|
||||
id autoreleasePool;
|
||||
id cursor;
|
||||
|
||||
GLboolean cursorHidden;
|
||||
|
||||
char* clipboardString;
|
||||
|
||||
_GLFWjoy joysticks[GLFW_JOYSTICK_LAST + 1];
|
||||
CFBundleRef bundle;
|
||||
PFN_TISCopyCurrentKeyboardLayoutInputSource CopyCurrentKeyboardLayoutInputSource;
|
||||
PFN_TISGetInputSourceProperty GetInputSourceProperty;
|
||||
PFN_LMGetKbdType GetKbdType;
|
||||
CFStringRef kPropertyUnicodeKeyLayoutData;
|
||||
} tis;
|
||||
} _GLFWlibraryNS;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Platform-specific monitor structure
|
||||
//------------------------------------------------------------------------
|
||||
// Cocoa-specific per-monitor data
|
||||
//
|
||||
typedef struct _GLFWmonitorNS
|
||||
{
|
||||
CGDirectDisplayID displayID;
|
||||
CGDisplayModeRef previousMode;
|
||||
uint32_t unitNumber;
|
||||
id screen;
|
||||
|
||||
double fallbackRefreshRate;
|
||||
} _GLFWmonitorNS;
|
||||
|
||||
// Cocoa-specific per-cursor data
|
||||
//
|
||||
typedef struct _GLFWcursorNS
|
||||
{
|
||||
id object;
|
||||
} _GLFWcursorNS;
|
||||
|
||||
//========================================================================
|
||||
// Prototypes for platform specific internal functions
|
||||
//========================================================================
|
||||
|
||||
// Time
|
||||
void _glfwInitTimer(void);
|
||||
GLFWbool _glfwConnectCocoa(int platformID, _GLFWplatform* platform);
|
||||
int _glfwInitCocoa(void);
|
||||
void _glfwTerminateCocoa(void);
|
||||
|
||||
// Joystick input
|
||||
void _glfwInitJoysticks(void);
|
||||
void _glfwTerminateJoysticks(void);
|
||||
GLFWbool _glfwCreateWindowCocoa(_GLFWwindow* window, const _GLFWwndconfig* wndconfig, const _GLFWctxconfig* ctxconfig, const _GLFWfbconfig* fbconfig);
|
||||
void _glfwDestroyWindowCocoa(_GLFWwindow* window);
|
||||
void _glfwSetWindowTitleCocoa(_GLFWwindow* window, const char* title);
|
||||
void _glfwSetWindowIconCocoa(_GLFWwindow* window, int count, const GLFWimage* images);
|
||||
void _glfwGetWindowPosCocoa(_GLFWwindow* window, int* xpos, int* ypos);
|
||||
void _glfwSetWindowPosCocoa(_GLFWwindow* window, int xpos, int ypos);
|
||||
void _glfwGetWindowSizeCocoa(_GLFWwindow* window, int* width, int* height);
|
||||
void _glfwSetWindowSizeCocoa(_GLFWwindow* window, int width, int height);
|
||||
void _glfwSetWindowSizeLimitsCocoa(_GLFWwindow* window, int minwidth, int minheight, int maxwidth, int maxheight);
|
||||
void _glfwSetWindowAspectRatioCocoa(_GLFWwindow* window, int numer, int denom);
|
||||
void _glfwGetFramebufferSizeCocoa(_GLFWwindow* window, int* width, int* height);
|
||||
void _glfwGetWindowFrameSizeCocoa(_GLFWwindow* window, int* left, int* top, int* right, int* bottom);
|
||||
void _glfwGetWindowContentScaleCocoa(_GLFWwindow* window, float* xscale, float* yscale);
|
||||
void _glfwIconifyWindowCocoa(_GLFWwindow* window);
|
||||
void _glfwRestoreWindowCocoa(_GLFWwindow* window);
|
||||
void _glfwMaximizeWindowCocoa(_GLFWwindow* window);
|
||||
void _glfwShowWindowCocoa(_GLFWwindow* window);
|
||||
void _glfwHideWindowCocoa(_GLFWwindow* window);
|
||||
void _glfwRequestWindowAttentionCocoa(_GLFWwindow* window);
|
||||
void _glfwFocusWindowCocoa(_GLFWwindow* window);
|
||||
void _glfwSetWindowMonitorCocoa(_GLFWwindow* window, _GLFWmonitor* monitor, int xpos, int ypos, int width, int height, int refreshRate);
|
||||
GLFWbool _glfwWindowFocusedCocoa(_GLFWwindow* window);
|
||||
GLFWbool _glfwWindowIconifiedCocoa(_GLFWwindow* window);
|
||||
GLFWbool _glfwWindowVisibleCocoa(_GLFWwindow* window);
|
||||
GLFWbool _glfwWindowMaximizedCocoa(_GLFWwindow* window);
|
||||
GLFWbool _glfwWindowHoveredCocoa(_GLFWwindow* window);
|
||||
GLFWbool _glfwFramebufferTransparentCocoa(_GLFWwindow* window);
|
||||
void _glfwSetWindowResizableCocoa(_GLFWwindow* window, GLFWbool enabled);
|
||||
void _glfwSetWindowDecoratedCocoa(_GLFWwindow* window, GLFWbool enabled);
|
||||
void _glfwSetWindowFloatingCocoa(_GLFWwindow* window, GLFWbool enabled);
|
||||
float _glfwGetWindowOpacityCocoa(_GLFWwindow* window);
|
||||
void _glfwSetWindowOpacityCocoa(_GLFWwindow* window, float opacity);
|
||||
void _glfwSetWindowMousePassthroughCocoa(_GLFWwindow* window, GLFWbool enabled);
|
||||
|
||||
// Fullscreen
|
||||
GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired);
|
||||
void _glfwRestoreVideoMode(_GLFWmonitor* monitor);
|
||||
void _glfwSetRawMouseMotionCocoa(_GLFWwindow *window, GLFWbool enabled);
|
||||
GLFWbool _glfwRawMouseMotionSupportedCocoa(void);
|
||||
|
||||
// OpenGL support
|
||||
int _glfwInitContextAPI(void);
|
||||
void _glfwTerminateContextAPI(void);
|
||||
int _glfwCreateContext(_GLFWwindow* window,
|
||||
const _GLFWwndconfig* wndconfig,
|
||||
const _GLFWfbconfig* fbconfig);
|
||||
void _glfwDestroyContext(_GLFWwindow* window);
|
||||
void _glfwPollEventsCocoa(void);
|
||||
void _glfwWaitEventsCocoa(void);
|
||||
void _glfwWaitEventsTimeoutCocoa(double timeout);
|
||||
void _glfwPostEmptyEventCocoa(void);
|
||||
|
||||
void _glfwGetCursorPosCocoa(_GLFWwindow* window, double* xpos, double* ypos);
|
||||
void _glfwSetCursorPosCocoa(_GLFWwindow* window, double xpos, double ypos);
|
||||
void _glfwSetCursorModeCocoa(_GLFWwindow* window, int mode);
|
||||
const char* _glfwGetScancodeNameCocoa(int scancode);
|
||||
int _glfwGetKeyScancodeCocoa(int key);
|
||||
GLFWbool _glfwCreateCursorCocoa(_GLFWcursor* cursor, const GLFWimage* image, int xhot, int yhot);
|
||||
GLFWbool _glfwCreateStandardCursorCocoa(_GLFWcursor* cursor, int shape);
|
||||
void _glfwDestroyCursorCocoa(_GLFWcursor* cursor);
|
||||
void _glfwSetCursorCocoa(_GLFWwindow* window, _GLFWcursor* cursor);
|
||||
void _glfwSetClipboardStringCocoa(const char* string);
|
||||
const char* _glfwGetClipboardStringCocoa(void);
|
||||
|
||||
EGLenum _glfwGetEGLPlatformCocoa(EGLint** attribs);
|
||||
EGLNativeDisplayType _glfwGetEGLNativeDisplayCocoa(void);
|
||||
EGLNativeWindowType _glfwGetEGLNativeWindowCocoa(_GLFWwindow* window);
|
||||
|
||||
void _glfwGetRequiredInstanceExtensionsCocoa(char** extensions);
|
||||
GLFWbool _glfwGetPhysicalDevicePresentationSupportCocoa(VkInstance instance, VkPhysicalDevice device, uint32_t queuefamily);
|
||||
VkResult _glfwCreateWindowSurfaceCocoa(VkInstance instance, _GLFWwindow* window, const VkAllocationCallbacks* allocator, VkSurfaceKHR* surface);
|
||||
|
||||
void _glfwFreeMonitorCocoa(_GLFWmonitor* monitor);
|
||||
void _glfwGetMonitorPosCocoa(_GLFWmonitor* monitor, int* xpos, int* ypos);
|
||||
void _glfwGetMonitorContentScaleCocoa(_GLFWmonitor* monitor, float* xscale, float* yscale);
|
||||
void _glfwGetMonitorWorkareaCocoa(_GLFWmonitor* monitor, int* xpos, int* ypos, int* width, int* height);
|
||||
GLFWvidmode* _glfwGetVideoModesCocoa(_GLFWmonitor* monitor, int* count);
|
||||
void _glfwGetVideoModeCocoa(_GLFWmonitor* monitor, GLFWvidmode* mode);
|
||||
GLFWbool _glfwGetGammaRampCocoa(_GLFWmonitor* monitor, GLFWgammaramp* ramp);
|
||||
void _glfwSetGammaRampCocoa(_GLFWmonitor* monitor, const GLFWgammaramp* ramp);
|
||||
|
||||
void _glfwPollMonitorsCocoa(void);
|
||||
void _glfwSetVideoModeCocoa(_GLFWmonitor* monitor, const GLFWvidmode* desired);
|
||||
void _glfwRestoreVideoModeCocoa(_GLFWmonitor* monitor);
|
||||
|
||||
float _glfwTransformYCocoa(float y);
|
||||
|
||||
void* _glfwLoadLocalVulkanLoaderCocoa(void);
|
||||
|
||||
GLFWbool _glfwInitNSGL(void);
|
||||
void _glfwTerminateNSGL(void);
|
||||
GLFWbool _glfwCreateContextNSGL(_GLFWwindow* window,
|
||||
const _GLFWctxconfig* ctxconfig,
|
||||
const _GLFWfbconfig* fbconfig);
|
||||
void _glfwDestroyContextNSGL(_GLFWwindow* window);
|
||||
|
||||
#endif // _cocoa_platform_h_
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
//========================================================================
|
||||
// GLFW - An OpenGL library
|
||||
// Platform: Cocoa
|
||||
// API Version: 3.0
|
||||
// WWW: http://www.glfw.org/
|
||||
// GLFW 3.4 macOS - www.glfw.org
|
||||
//------------------------------------------------------------------------
|
||||
// Copyright (c) 2009-2010 Camilla Berglund <elmindreda@elmindreda.org>
|
||||
// Copyright (c) 2009-2016 Camilla Löwy <elmindreda@glfw.org>
|
||||
//
|
||||
// This software is provided 'as-is', without any express or implied
|
||||
// warranty. In no event will the authors be held liable for any damages
|
||||
|
@ -26,49 +23,37 @@
|
|||
// distribution.
|
||||
//
|
||||
//========================================================================
|
||||
// It is fine to use C99 in this file because it will not be built with VS
|
||||
//========================================================================
|
||||
|
||||
#include "internal.h"
|
||||
|
||||
#if defined(GLFW_BUILD_COCOA_TIMER)
|
||||
|
||||
#include <mach/mach_time.h>
|
||||
|
||||
|
||||
// Return raw time
|
||||
//
|
||||
static uint64_t getRawTime(void)
|
||||
{
|
||||
return mach_absolute_time();
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
////// GLFW internal API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Initialise timer
|
||||
//
|
||||
void _glfwInitTimer(void)
|
||||
{
|
||||
mach_timebase_info_data_t info;
|
||||
mach_timebase_info(&info);
|
||||
|
||||
_glfw.ns.timer.resolution = (double) info.numer / (info.denom * 1.0e9);
|
||||
_glfw.ns.timer.base = getRawTime();
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
////// GLFW platform API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
double _glfwPlatformGetTime(void)
|
||||
void _glfwPlatformInitTimer(void)
|
||||
{
|
||||
return (double) (getRawTime() - _glfw.ns.timer.base) *
|
||||
_glfw.ns.timer.resolution;
|
||||
mach_timebase_info_data_t info;
|
||||
mach_timebase_info(&info);
|
||||
|
||||
_glfw.timer.ns.frequency = (info.denom * 1e9) / info.numer;
|
||||
}
|
||||
|
||||
void _glfwPlatformSetTime(double time)
|
||||
uint64_t _glfwPlatformGetTimerValue(void)
|
||||
{
|
||||
_glfw.ns.timer.base = getRawTime() -
|
||||
(uint64_t) (time / _glfw.ns.timer.resolution);
|
||||
return mach_absolute_time();
|
||||
}
|
||||
|
||||
uint64_t _glfwPlatformGetTimerFrequency(void)
|
||||
{
|
||||
return _glfw.timer.ns.frequency;
|
||||
}
|
||||
|
||||
#endif // GLFW_BUILD_COCOA_TIMER
|
||||
|
||||
|
|
35
src/cocoa_time.h
Normal file
35
src/cocoa_time.h
Normal file
|
@ -0,0 +1,35 @@
|
|||
//========================================================================
|
||||
// GLFW 3.4 macOS - www.glfw.org
|
||||
//------------------------------------------------------------------------
|
||||
// Copyright (c) 2009-2021 Camilla Löwy <elmindreda@glfw.org>
|
||||
//
|
||||
// This software is provided 'as-is', without any express or implied
|
||||
// warranty. In no event will the authors be held liable for any damages
|
||||
// arising from the use of this software.
|
||||
//
|
||||
// Permission is granted to anyone to use this software for any purpose,
|
||||
// including commercial applications, and to alter it and redistribute it
|
||||
// freely, subject to the following restrictions:
|
||||
//
|
||||
// 1. The origin of this software must not be misrepresented; you must not
|
||||
// claim that you wrote the original software. If you use this software
|
||||
// in a product, an acknowledgment in the product documentation would
|
||||
// be appreciated but is not required.
|
||||
//
|
||||
// 2. Altered source versions must be plainly marked as such, and must not
|
||||
// be misrepresented as being the original software.
|
||||
//
|
||||
// 3. This notice may not be removed or altered from any source
|
||||
// distribution.
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
#define GLFW_COCOA_LIBRARY_TIMER_STATE _GLFWtimerNS ns;
|
||||
|
||||
// Cocoa-specific global timer data
|
||||
//
|
||||
typedef struct _GLFWtimerNS
|
||||
{
|
||||
uint64_t frequency;
|
||||
} _GLFWtimerNS;
|
||||
|
2141
src/cocoa_window.m
2141
src/cocoa_window.m
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user