Compare commits
890 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5e7591f94c | ||
|
|
9e5e5e35a0 | ||
|
|
4d99e5b2e7 | ||
|
|
f6df34ecbe | ||
|
|
d491f7bc14 | ||
|
|
1fb583c50d | ||
|
|
6738d2ac78 | ||
|
|
293b786cee | ||
|
|
af197f5f8f | ||
|
|
aba535e765 | ||
|
|
76f8274daf | ||
|
|
1b25898946 | ||
|
|
24ae7c4c1f | ||
|
|
e4276667da | ||
|
|
65c6ca9179 | ||
|
|
03d6c4c2db | ||
|
|
2db44ffe9d | ||
|
|
e9ba8e9214 | ||
|
|
cd1cefae91 | ||
|
|
cc22179cd8 | ||
|
|
1178ed817f | ||
|
|
688601911c | ||
|
|
ae47121fa3 | ||
|
|
1676268eab | ||
|
|
baace9ffca | ||
|
|
5ed63e0895 | ||
|
|
d3778fc129 | ||
|
|
a2162e4228 | ||
|
|
57b46ee6ea | ||
|
|
e67d632d99 | ||
|
|
5891a5dd55 | ||
|
|
0ce9f39d23 | ||
|
|
5fd13173a1 | ||
|
|
fabc30cfdd | ||
|
|
36822c50ad | ||
|
|
4a497e649b | ||
|
|
a5455bb374 | ||
|
|
6f365c21d7 | ||
|
|
775355a88a | ||
|
|
0fab0702b0 | ||
|
|
470a7b4874 | ||
|
|
a1164746e7 | ||
|
|
ae14499101 | ||
|
|
e4f84b4936 | ||
|
|
b20cea3902 | ||
|
|
51b36396ae | ||
|
|
abd5134965 | ||
|
|
bd58a63fe8 | ||
|
|
2c2a956a3a | ||
|
|
4b7d6f216b | ||
|
|
a7de8b6776 | ||
|
|
8a039ffe0a | ||
|
|
741c2e6434 | ||
|
|
4097590bc6 | ||
|
|
21f80baa35 | ||
|
|
e715c4a62d | ||
|
|
987caacbeb | ||
|
|
b5d3f2c521 | ||
|
|
529e48bb0f | ||
|
|
47a3c67fa6 | ||
|
|
71f2c401c5 | ||
|
|
84cac8441f | ||
|
|
e4a01fd7e1 | ||
|
|
655ba5d992 | ||
|
|
ffa10b1c3b | ||
|
|
645c1cef13 | ||
|
|
736fcbec47 | ||
|
|
5ff1c613ea | ||
|
|
b0bb4f6226 | ||
|
|
b95884c53d | ||
|
|
2a3cc7d907 | ||
|
|
c98da4d99a | ||
|
|
12c1bee87f | ||
|
|
e203c9cdd8 | ||
|
|
7cf50e137d | ||
|
|
bcebfe647f | ||
|
|
9228e17bb5 | ||
|
|
55ed11bac5 | ||
|
|
874ae72495 | ||
|
|
f6e0e92beb | ||
|
|
6f0ab1d868 | ||
|
|
e34d63f087 | ||
|
|
04a6c35819 | ||
|
|
7943b349d6 | ||
|
|
8bd0693101 | ||
|
|
6b1e4ea5a5 | ||
|
|
300e1056f5 | ||
|
|
3893e638e6 | ||
|
|
e7e38a47a8 | ||
|
|
e9482d004f | ||
|
|
d577248b89 | ||
|
|
ca78774fc7 | ||
|
|
569b5f32b9 | ||
|
|
758a21f104 | ||
|
|
1341f40dfe | ||
|
|
5439ab0683 | ||
|
|
89dae684aa | ||
|
|
47cf442c11 | ||
|
|
441a4af435 | ||
|
|
dbd0dad580 | ||
|
|
c47a5327d3 | ||
|
|
5071b0812f | ||
|
|
a51f07d5a1 | ||
|
|
9e48553ccc | ||
|
|
80532da3bf | ||
|
|
d57bcbed46 | ||
|
|
0ab16e0134 | ||
|
|
649971518c | ||
|
|
f89035b8c4 | ||
|
|
9bf68ad963 | ||
|
|
9cf779e7ac | ||
|
|
b8d091d350 | ||
|
|
53e4ebd4e3 | ||
|
|
d29e9dfe93 | ||
|
|
c6083e1dc4 | ||
|
|
b8f9980999 | ||
|
|
5759f53934 | ||
|
|
6d1055c967 | ||
|
|
1a3e034b12 | ||
|
|
a5cc6155d4 | ||
|
|
dbed202744 | ||
|
|
bd3d9b9d04 | ||
|
|
8b6a91a93f | ||
|
|
e296d7f0e4 | ||
|
|
ad51be1ad4 | ||
|
|
72deb502d7 | ||
|
|
bc69de5f21 | ||
|
|
7954a0cafd | ||
|
|
f2bcadec7c | ||
|
|
f50bbbf855 | ||
|
|
8acb7e9ea2 | ||
|
|
20dc7e6945 | ||
|
|
b9f2494bfc | ||
|
|
91979127ec | ||
|
|
7884aa151f | ||
|
|
a41edc31ce | ||
|
|
61cb081a35 | ||
|
|
78023e9808 | ||
|
|
7b9ff48d02 | ||
|
|
f2bfc66c5d | ||
|
|
cd487af90b | ||
|
|
5f2230c7bf | ||
|
|
bcf749e83a | ||
|
|
335634b807 | ||
|
|
e809379caf | ||
|
|
0a716cdff8 | ||
|
|
0ff31445f2 | ||
|
|
bc920f08f5 | ||
|
|
dae62174c5 | ||
|
|
c5e907e501 | ||
|
|
95d0fe9c11 | ||
|
|
c329f0824c | ||
|
|
43caa5c09a | ||
|
|
a2519c8aed | ||
|
|
1b3528fe63 | ||
|
|
652a14a215 | ||
|
|
a03463303d | ||
|
|
9e351d52ae | ||
|
|
5028216c81 | ||
|
|
531ac77263 | ||
|
|
fe5cb830b1 | ||
|
|
104c9fde4e | ||
|
|
70bb907286 | ||
|
|
adcc2ce92b | ||
|
|
7448e33768 | ||
|
|
5b976943ee | ||
|
|
f4a003c3ca | ||
|
|
0e14d6d68e | ||
|
|
16837e4219 | ||
|
|
ac4a41d198 | ||
|
|
3d49061bfc | ||
|
|
d92f615fe5 | ||
|
|
1018a16f39 | ||
|
|
f358988f2e | ||
|
|
04a374bd05 | ||
|
|
51c0c71811 | ||
|
|
27b0758a94 | ||
|
|
1832f1cc86 | ||
|
|
75978bd85e | ||
|
|
4dbd625eaf | ||
|
|
785c3469f4 | ||
|
|
f20ea88f88 | ||
|
|
11785d441d | ||
|
|
908be619fd | ||
|
|
8bce6a217a | ||
|
|
5a2f32b102 | ||
|
|
830bf65275 | ||
|
|
73ccfa0e9a | ||
|
|
3bfd0e6f9f | ||
|
|
31acab88f2 | ||
|
|
08b3ff10d3 | ||
|
|
df4fd765d5 | ||
|
|
8753bd8900 | ||
|
|
691f58930b | ||
|
|
29acfe5bd4 | ||
|
|
ad608fe44d | ||
|
|
cb6ae7b16b | ||
|
|
b570a180da | ||
|
|
0a31a67269 | ||
|
|
1c85aa3332 | ||
|
|
3518a7950f | ||
|
|
e3a7cc1f9e | ||
|
|
5ff4075a69 | ||
|
|
4c00e30ef0 | ||
|
|
54207dfde6 | ||
|
|
18acf6e6f1 | ||
|
|
3004bf8fd7 | ||
|
|
2b7c042525 | ||
|
|
72fc93302c | ||
|
|
bcfe3936a8 | ||
|
|
15eddf38fb | ||
|
|
a6c6fce7e8 | ||
|
|
0d47d26a68 | ||
|
|
62c24f315b | ||
|
|
a2ade36eb1 | ||
|
|
bf478280eb | ||
|
|
77ff5e038a | ||
|
|
608889d18f | ||
|
|
93de8d3d86 | ||
|
|
6ac852d45b | ||
|
|
33143303fe | ||
|
|
148bd34079 | ||
|
|
8a09c3a34b | ||
|
|
c818d6cce5 | ||
|
|
30c75badd1 | ||
|
|
d3abe14a3a | ||
|
|
2aacac9a5d | ||
|
|
01429fa46a | ||
|
|
36f3712e85 | ||
|
|
7d58f44f73 | ||
|
|
bb0830da9e | ||
|
|
bb95cf8934 | ||
|
|
bc80faa7d9 | ||
|
|
a9e2abdcfb | ||
|
|
2e1ed6447a | ||
|
|
9d205e3542 | ||
|
|
373aea11c8 | ||
|
|
67f7554232 | ||
|
|
347b3f0daf | ||
|
|
e116d3b3e5 | ||
|
|
7b0b2ec73a | ||
|
|
5e23af22f7 | ||
|
|
afc5699b08 | ||
|
|
ed39a43b8c | ||
|
|
2780ed4b97 | ||
|
|
3d5815f463 | ||
|
|
ee403ff0ba | ||
|
|
1b2fef5c28 | ||
|
|
8e48a232fe | ||
|
|
c41edfb7c4 | ||
|
|
3d9168025c | ||
|
|
f1f288182e | ||
|
|
16a8e986ce | ||
|
|
d082417dae | ||
|
|
5bfaa2f12e | ||
|
|
38e3675d7d | ||
|
|
0a59ca6cae | ||
|
|
38f28665bf | ||
|
|
53933fe9db | ||
|
|
29cded2654 | ||
|
|
c7aeb8bf1f | ||
|
|
46560b94ae | ||
|
|
3c257e187b | ||
|
|
fb8af6fc97 | ||
|
|
81e3955acf | ||
|
|
197c526d63 | ||
|
|
19d1e43261 | ||
|
|
a767bff929 | ||
|
|
5479e93031 | ||
|
|
8afa9e593b | ||
|
|
0a355dc010 | ||
|
|
25a5dc2ea7 | ||
|
|
06ed3f0a0a | ||
|
|
6dbb39025c | ||
|
|
5535aca5df | ||
|
|
0bc933a460 | ||
|
|
2bb04cad14 | ||
|
|
425fea1c34 | ||
|
|
577f318e0e | ||
|
|
63fae71713 | ||
|
|
355da23785 | ||
|
|
39557c3921 | ||
|
|
6d62d7f321 | ||
|
|
4672b2d88c | ||
|
|
b3678f1080 | ||
|
|
8b7dfa8526 | ||
|
|
7387394e59 | ||
|
|
19bf744556 | ||
|
|
3427e3547e | ||
|
|
df1e73af7a | ||
|
|
ea1bfcc80a | ||
|
|
2f177e2906 | ||
|
|
7acad72a1a | ||
|
|
8806915c3a | ||
|
|
a13df148df | ||
|
|
1a59875367 | ||
|
|
e9313a64c1 | ||
|
|
d2733fa196 | ||
|
|
8ac1f97e9e | ||
|
|
6f3178a3be | ||
|
|
1639518b64 | ||
|
|
935d5e5daa | ||
|
|
0299ad7532 | ||
|
|
c8cfbf7c19 | ||
|
|
2743def830 | ||
|
|
fa6be6e77a | ||
|
|
f5328c534d | ||
|
|
16cdc6ab12 | ||
|
|
56671022f9 | ||
|
|
b5f0de18b9 | ||
|
|
23f48064b8 | ||
|
|
815ad714b4 | ||
|
|
f3e3178751 | ||
|
|
68af9a0773 | ||
|
|
4e856077b7 | ||
|
|
6507d9249d | ||
|
|
e18599a6c3 | ||
|
|
92eac1c765 | ||
|
|
b048d8e084 | ||
|
|
7098924599 | ||
|
|
d9bf6ccce9 | ||
|
|
371ef9c058 | ||
|
|
ad7ce73609 | ||
|
|
264c6fd177 | ||
|
|
3fa4bd008c | ||
|
|
7ea33579e7 | ||
|
|
6b406bf09d | ||
|
|
2f9757f344 | ||
|
|
2c3d34c905 | ||
|
|
6e550baa0a | ||
|
|
bcc513ebf5 | ||
|
|
47489c0721 | ||
|
|
c6e2d29cde | ||
|
|
eb11fa73ec | ||
|
|
47cbbcc1b6 | ||
|
|
1bb327ebdb | ||
|
|
84c8964116 | ||
|
|
77cc447b96 | ||
|
|
24fab8e250 | ||
|
|
b082abc28f | ||
|
|
c6742cedee | ||
|
|
3709db0e17 | ||
|
|
3df1e04b10 | ||
|
|
2a938d3ab7 | ||
|
|
79b2d13ae2 | ||
|
|
d4eb665c60 | ||
|
|
467037de22 | ||
|
|
22144ab755 | ||
|
|
57ffddba98 | ||
|
|
de6a2e0d19 | ||
|
|
d8aa0269cd | ||
|
|
b1b4036656 | ||
|
|
53e4bf9afd | ||
|
|
ca8c6a0337 | ||
|
|
95e02a210e | ||
|
|
896e8bd2d7 | ||
|
|
417ed16a88 | ||
|
|
a28fa45ab7 | ||
|
|
01915e90e6 | ||
|
|
eac57f009e | ||
|
|
9cb9401e87 | ||
|
|
4da75f6d91 | ||
|
|
b51b0a847d | ||
|
|
249aebdd35 | ||
|
|
90ea526114 | ||
|
|
be3d539dac | ||
|
|
ac859a4cbd | ||
|
|
75280a2c74 | ||
|
|
89700a4abd | ||
|
|
0ceb82b838 | ||
|
|
3db5374e66 | ||
|
|
d395251b35 | ||
|
|
d49081302a | ||
|
|
3c646597cf | ||
|
|
a11c0bcf97 | ||
|
|
865322f931 | ||
|
|
d62269757b | ||
|
|
188f2949ea | ||
|
|
0883634178 | ||
|
|
19bbfc6263 | ||
|
|
85312e6db1 | ||
|
|
eb2b63877a | ||
|
|
6a2d72ecff | ||
|
|
6da33b1249 | ||
|
|
0fe593a71e | ||
|
|
d89c87ac40 | ||
|
|
b4203c1c49 | ||
|
|
0221e4d6c8 | ||
|
|
feb555af03 | ||
|
|
be3602da41 | ||
|
|
6a9851d72d | ||
|
|
bf8b5f99a1 | ||
|
|
2eb801cda2 | ||
|
|
8753b1c397 | ||
|
|
bed4c5bf58 | ||
|
|
18c516655f | ||
|
|
01a5dd879b | ||
|
|
6975540db2 | ||
|
|
806e20f463 | ||
|
|
511378b05d | ||
|
|
eb198d2702 | ||
|
|
1f57563b9d | ||
|
|
30038ecaa2 | ||
|
|
feca368c29 | ||
|
|
0d04827f6d | ||
|
|
74b775e14d | ||
|
|
dab76b4dc5 | ||
|
|
ea83bacf9c | ||
|
|
69c283e061 | ||
|
|
abe094e4a1 | ||
|
|
4eebc90a17 | ||
|
|
8bbc71f2eb | ||
|
|
0a0595f2d3 | ||
|
|
03ca5eb58f | ||
|
|
d6c3f73fb4 | ||
|
|
1399d7650d | ||
|
|
c499ce31ba | ||
|
|
0c75c4c417 | ||
|
|
2aadbf41df | ||
|
|
aaf5a9bb08 | ||
|
|
e75d2424e5 | ||
|
|
8f9a594ac8 | ||
|
|
f7e1dfeaef | ||
|
|
23e8d46e07 | ||
|
|
8a42f6b359 | ||
|
|
4539e9195d | ||
|
|
46b0988c67 | ||
|
|
2448fc7dee | ||
|
|
86ca15ece7 | ||
|
|
c6b2a92613 | ||
|
|
4e52e192b2 | ||
|
|
4de3ded28a | ||
|
|
4e492363f0 | ||
|
|
b5fb4fd55b | ||
|
|
88c5ceb650 | ||
|
|
c3a4dbfbd6 | ||
|
|
45323646bd | ||
|
|
10686f42c9 | ||
|
|
dc866313af | ||
|
|
8f28f4850b | ||
|
|
479fa1db1d | ||
|
|
a81b3532f7 | ||
|
|
3c84ab90f2 | ||
|
|
15bf1cd129 | ||
|
|
ccc8b9239c | ||
|
|
18ce0f1254 | ||
|
|
9db3f95ace | ||
|
|
1f12a07380 | ||
|
|
1ceda0f84f | ||
|
|
9a0b12ab00 | ||
|
|
b4736f5e17 | ||
|
|
5c55aa4e61 | ||
|
|
a1f1586bcb | ||
|
|
b8e1c70ec1 | ||
|
|
fb1565bcdd | ||
|
|
6830123a4c | ||
|
|
43bc364af4 | ||
|
|
03d967abb5 | ||
|
|
6628bc9cff | ||
|
|
dde2da64b5 | ||
|
|
78ad878b66 | ||
|
|
f378ab825c | ||
|
|
8e39ad2cd6 | ||
|
|
16461f7c53 | ||
|
|
d1baa05439 | ||
|
|
8fd9f1748d | ||
|
|
228748bc49 | ||
|
|
d8bc5a9eba | ||
|
|
db7a3318aa | ||
|
|
71270195d5 | ||
|
|
6e9f8b7cdb | ||
|
|
fe69cb4b9b | ||
|
|
6d689e8a69 | ||
|
|
eeb861df0b | ||
|
|
d68b699291 | ||
|
|
e56cc3970f | ||
|
|
f2515fa83e | ||
|
|
426628c374 | ||
|
|
326f9ddd8a | ||
|
|
ba70e59e82 | ||
|
|
961b7cad05 | ||
|
|
184a575a00 | ||
|
|
407b487017 | ||
|
|
d98fdad3bf | ||
|
|
5c1e7fa6ee | ||
|
|
4b90e68ac6 | ||
|
|
e5dfe384ad | ||
|
|
d6dd0fceb1 | ||
|
|
f3da389ae0 | ||
|
|
ab36c9aa1c | ||
|
|
9533fd1842 | ||
|
|
74b493a5e6 | ||
|
|
125fddc31d | ||
|
|
6140a8c65f | ||
|
|
4e3e9ac8fb | ||
|
|
2b2e62154d | ||
|
|
b6bcae5698 | ||
|
|
ab0c886a6c | ||
|
|
f2718b0966 | ||
|
|
39927e60ea | ||
|
|
c0bcd2ca99 | ||
|
|
547bbcabff | ||
|
|
d292b83d1a | ||
|
|
d43a5943d8 | ||
|
|
230928ad5f | ||
|
|
3fd01320f1 | ||
|
|
ab8b047ae5 | ||
|
|
8415686ea2 | ||
|
|
321f67c472 | ||
|
|
a087c7421b | ||
|
|
3f9ee180a8 | ||
|
|
e448d6cf0c | ||
|
|
ce656b6a0a | ||
|
|
bfa023921c | ||
|
|
d7fc376de8 | ||
|
|
7a1f3a37a1 | ||
|
|
b980b2eeb6 | ||
|
|
44d8de433e | ||
|
|
e9bf776711 | ||
|
|
78477947de | ||
|
|
ba8f6172bd | ||
|
|
c851646050 | ||
|
|
8cbc573eae | ||
|
|
2d7e25c9ff | ||
|
|
f4b02d1a26 | ||
|
|
58e9917053 | ||
|
|
f22c04cdae | ||
|
|
6517211e12 | ||
|
|
2fd9c8690f | ||
|
|
63cca75e63 | ||
|
|
1c768645c5 | ||
|
|
d14fce03f0 | ||
|
|
08dfacd425 | ||
|
|
6532db9868 | ||
|
|
3b399df638 | ||
|
|
c1d89d4391 | ||
|
|
a580e1adb7 | ||
|
|
3041d05bbc | ||
|
|
8446d1bab1 | ||
|
|
6f89984fed | ||
|
|
ef68e7bf71 | ||
|
|
88f3b89a2c | ||
|
|
e5d6fb20a5 | ||
|
|
123ff6549b | ||
|
|
bc28306f4a | ||
|
|
4e96ac080a | ||
|
|
a884b4b811 | ||
|
|
4292e9c06b | ||
|
|
20911cb17c | ||
|
|
1b686cedf4 | ||
|
|
376d022e4a | ||
|
|
ae8ec0b30d | ||
|
|
93259cdfa1 | ||
|
|
719344b23e | ||
|
|
770169f230 | ||
|
|
9ef50d5826 | ||
|
|
cab974cf6c | ||
|
|
d1ff1f6798 | ||
|
|
05ecec6f49 | ||
|
|
9da422c639 | ||
|
|
f1d6b38441 | ||
|
|
74e2dd38ed | ||
|
|
783d7dfcbf | ||
|
|
083e466f88 | ||
|
|
daabce72db | ||
|
|
4536021a62 | ||
|
|
a2003c2895 | ||
|
|
b0dbd3ed13 | ||
|
|
ac522d4756 | ||
|
|
813882526d | ||
|
|
3cbbef53bc | ||
|
|
062bc07bde | ||
|
|
75639547e7 | ||
|
|
b38ad54c41 | ||
|
|
3afb7a0f70 | ||
|
|
b04bcd14ee | ||
|
|
14586916b9 | ||
|
|
90f042ae8d | ||
|
|
8aa019d2ef | ||
|
|
ab6e78f3a0 | ||
|
|
89c9a4cbf2 | ||
|
|
2f911cdf17 | ||
|
|
67adba15a2 | ||
|
|
90f8ebfd8f | ||
|
|
2e5819270b | ||
|
|
ec15398681 | ||
|
|
23b1503d79 | ||
|
|
fed386cdc0 | ||
|
|
536ede7e00 | ||
|
|
1c6701e1e1 | ||
|
|
cba2ca94f1 | ||
|
|
06d05afdd6 | ||
|
|
fb7899bfec | ||
|
|
c1b97d91c7 | ||
|
|
83886a5a7f | ||
|
|
ab9e273c75 | ||
|
|
2ac44e2509 | ||
|
|
fac5fd258c | ||
|
|
7853901372 | ||
|
|
28861b192f | ||
|
|
7f55eb2b14 | ||
|
|
86ca491ade | ||
|
|
bfea97321c | ||
|
|
45015e4d79 | ||
|
|
4304790e3e | ||
|
|
6a35de3cc3 | ||
|
|
72ef753d5c | ||
|
|
297dfa0fbf | ||
|
|
a864432fb4 | ||
|
|
50478ded80 | ||
|
|
33b2dcf0da | ||
|
|
68656667b2 | ||
|
|
9aff6cfdc3 | ||
|
|
65dcc30599 | ||
|
|
b014986fdb | ||
|
|
ad2ac216fa | ||
|
|
00608a79dc | ||
|
|
cdfba5d375 | ||
|
|
30e5ef86a0 | ||
|
|
dbd1e2b599 | ||
|
|
22f5dc74c7 | ||
|
|
5e3bc0c2a2 | ||
|
|
fbe3726050 | ||
|
|
e3048be8ba | ||
|
|
0c000ec90c | ||
|
|
c34cea7de5 | ||
|
|
26d729581f | ||
|
|
5c0dccc896 | ||
|
|
baf3e77ee2 | ||
|
|
3c2e1022ed | ||
|
|
189476f265 | ||
|
|
ce2733b7cc | ||
|
|
2ac294e67f | ||
|
|
1487b3ea3e | ||
|
|
a852378a62 | ||
|
|
b12d8e3b0d | ||
|
|
54d7a74532 | ||
|
|
a13fab59ae | ||
|
|
ede37839ae | ||
|
|
9b5bb5939b | ||
|
|
6b2eab1869 | ||
|
|
912d3a04c1 | ||
|
|
5a9026c65d | ||
|
|
9e83e8c790 | ||
|
|
23caf20169 | ||
|
|
1795166732 | ||
|
|
0a82c75eab | ||
|
|
24a32627d9 | ||
|
|
30971cd098 | ||
|
|
4fae0260a6 | ||
|
|
f930330d5f | ||
|
|
c19d783e07 | ||
|
|
1e1aac034c | ||
|
|
6b8ae62d6b | ||
|
|
a2c4c98023 | ||
|
|
d45fdeae35 | ||
|
|
dd11e7664d | ||
|
|
7351049dba | ||
|
|
e7f55e76db | ||
|
|
bc58b7b409 | ||
|
|
b5012e1ee1 | ||
|
|
df37d5f2db | ||
|
|
8a9507442a | ||
|
|
78bb78d1c3 | ||
|
|
ba41b8afb1 | ||
|
|
6c4268204b | ||
|
|
db6aa58267 | ||
|
|
8e3366fda7 | ||
|
|
3d960a0d84 | ||
|
|
71be653edc | ||
|
|
5605385194 | ||
|
|
14425aeca1 | ||
|
|
7298e71360 | ||
|
|
2d595d7020 | ||
|
|
8d915cb6fb | ||
|
|
4f3e7cd3cf | ||
|
|
8fa6b363db | ||
|
|
790ea3dc7f | ||
|
|
861ca519ab | ||
|
|
b2ad0754b0 | ||
|
|
0070d398d1 | ||
|
|
7798374e47 | ||
|
|
14940c4ffe | ||
|
|
1e885f6e6c | ||
|
|
ec0585883a | ||
|
|
cd03ed4f54 | ||
|
|
7c20642b10 | ||
|
|
c6f348cbc9 | ||
|
|
a190221f70 | ||
|
|
8e4fa8c3e6 | ||
|
|
44bd53f259 | ||
|
|
fcb23bbd6e | ||
|
|
75d7425061 | ||
|
|
5f5632c424 | ||
|
|
861eb8eb16 | ||
|
|
563d26b247 | ||
|
|
b35ec1ca05 | ||
|
|
9f568e512f | ||
|
|
acdb6db846 | ||
|
|
fda3b1a4b1 | ||
|
|
724abeb058 | ||
|
|
e3a051e053 | ||
|
|
6e0f0f51e0 | ||
|
|
039bf534aa | ||
|
|
efeddebe81 | ||
|
|
365dc68c39 | ||
|
|
9499e017b7 | ||
|
|
caef4a35d6 | ||
|
|
6ad2c5b59a | ||
|
|
69676ac379 | ||
|
|
a96308c37d | ||
|
|
a457549967 | ||
|
|
193005393d | ||
|
|
ebb248aa5c | ||
|
|
699bc7b73d | ||
|
|
c893a015d8 | ||
|
|
ba643a2094 | ||
|
|
a897b335be | ||
|
|
1aa958bc9c | ||
|
|
1c4b3f4dfb | ||
|
|
7dd57a48e1 | ||
|
|
a14cbff8e5 | ||
|
|
fe5d67d95f | ||
|
|
ba58a6665f | ||
|
|
b4df56fcd9 | ||
|
|
7460cfabbc | ||
|
|
66202b75d5 | ||
|
|
7ceffd0e0d | ||
|
|
27a26bfc4b | ||
|
|
21d073d55a | ||
|
|
9a4a958a5c | ||
|
|
6cdf09749c | ||
|
|
0448488e11 | ||
|
|
5a501fbd09 | ||
|
|
5bb27edac0 | ||
|
|
edda9ae9fb | ||
|
|
ac018f5494 | ||
|
|
fc2427e81b | ||
|
|
e188b6e1f1 | ||
|
|
eb326f5f01 | ||
|
|
d0d7d62120 | ||
|
|
d475730357 | ||
|
|
a2d2aed64a | ||
|
|
9c7ca850fd | ||
|
|
a5b66333fb | ||
|
|
9f0bb59c53 | ||
|
|
cc50ed60b3 | ||
|
|
6aafd2491c | ||
|
|
ce938b307e | ||
|
|
d367216678 | ||
|
|
1873b567b2 | ||
|
|
1100b4daa3 | ||
|
|
35324a6c60 | ||
|
|
1791901468 | ||
|
|
fdf2033bda | ||
|
|
2c7e6334ec | ||
|
|
fa849a0e16 | ||
|
|
55590ee810 | ||
|
|
476609c539 | ||
|
|
16eb23a0cb | ||
|
|
22f1ca0131 | ||
|
|
9c05c0494d | ||
|
|
4f66498304 | ||
|
|
e92dd16605 | ||
|
|
eb6c6439ae | ||
|
|
37a6211795 | ||
|
|
574c456a5a | ||
|
|
f142a0830a | ||
|
|
643be95416 | ||
|
|
6542324cb0 | ||
|
|
b1394fa92a | ||
|
|
3b18a36f21 | ||
|
|
63c113a31b | ||
|
|
423f2b2884 | ||
|
|
b9b329d1e5 | ||
|
|
5e0bb98abd | ||
|
|
5aa1c1cd5f | ||
|
|
1c56fdc707 | ||
|
|
f3c399ec11 | ||
|
|
345a71a9cb | ||
|
|
4ed1d0b2c0 | ||
|
|
1ff933b452 | ||
|
|
98b3dd40f7 | ||
|
|
771b975528 | ||
|
|
4360bd7c76 | ||
|
|
cefc42f1ba | ||
|
|
008e4e7e39 | ||
|
|
0e52184c48 | ||
|
|
f7a4bcaf79 | ||
|
|
64a23a0f9c | ||
|
|
23316033db | ||
|
|
ae18872bc7 | ||
|
|
a94ee16534 | ||
|
|
881ec9ee67 | ||
|
|
8d4bd87c1a | ||
|
|
e4b684ce49 | ||
|
|
d49b34a233 | ||
|
|
b8cc150836 | ||
|
|
4df1f7c7ba | ||
|
|
82cfcfa63a | ||
|
|
b9466fca3e | ||
|
|
8f39dd1e62 | ||
|
|
038573aae7 | ||
|
|
b506d8753d | ||
|
|
9a2da667f3 | ||
|
|
399ae35ac6 | ||
|
|
9d3e5db9fc | ||
|
|
7f7b205259 | ||
|
|
48c6a6ecd2 | ||
|
|
e18e0e98fe | ||
|
|
46dbaec56a | ||
|
|
2bf5d9470d | ||
|
|
8ad306baf6 | ||
|
|
c4c639c9a4 | ||
|
|
18f73b622f | ||
|
|
16c3ea9459 | ||
|
|
693f81be4c | ||
|
|
38d3f3d660 | ||
|
|
724f2939f4 | ||
|
|
afa61173a8 | ||
|
|
37cfb3b5c2 | ||
|
|
f96ce6a707 | ||
|
|
c52fc9b49c | ||
|
|
9c27278acf | ||
|
|
f75d697c03 | ||
|
|
45f3634ce3 | ||
|
|
3a71d05e53 | ||
|
|
dca39e8911 | ||
|
|
01e54753ff | ||
|
|
bc6f07856f | ||
|
|
513d486e75 | ||
|
|
a805bb9691 | ||
|
|
bfc6ee1b13 | ||
|
|
e8a84a93aa | ||
|
|
bed573586e | ||
|
|
328cb0b512 | ||
|
|
b3fdfa1246 | ||
|
|
15915b03d0 | ||
|
|
5a0d3dc7b3 | ||
|
|
b92d64e150 | ||
|
|
f93b3dd69e | ||
|
|
116970154d | ||
|
|
8e053916c8 | ||
|
|
289d47eee5 | ||
|
|
148fb313c5 | ||
|
|
e8e20ae598 | ||
|
|
8aee2a3326 | ||
|
|
ef9025a641 | ||
|
|
5d3a95714c | ||
|
|
cf8eebee07 | ||
|
|
732dd6f417 | ||
|
|
147b08328a | ||
|
|
7e70874420 | ||
|
|
b5b5c52034 | ||
|
|
f4f4dab25a | ||
|
|
043654bbfb | ||
|
|
9b61162d43 | ||
|
|
3f8a70e5dd | ||
|
|
a6d46f6b99 | ||
|
|
d4b799b60c | ||
|
|
46e8a51383 | ||
|
|
6339e621f5 | ||
|
|
fa4525e289 | ||
|
|
b1097f24a8 | ||
|
|
e716184cae | ||
|
|
6f0294ca47 | ||
|
|
e98276c859 | ||
|
|
dff7924e25 | ||
|
|
094e2f1a67 | ||
|
|
7aac6d6b8e | ||
|
|
8deec7bf5f | ||
|
|
963946d3d7 | ||
|
|
d4f6695a3e | ||
|
|
042066887b | ||
|
|
507d83e4cc | ||
|
|
ddf69f247f | ||
|
|
585d191ae7 | ||
|
|
bd0f7f42d6 | ||
|
|
6f173cafbd | ||
|
|
b8d907a9bb | ||
|
|
ee2ef90b7f | ||
|
|
769439a23d | ||
|
|
00277e836d | ||
|
|
6d04725282 | ||
|
|
390488d12e | ||
|
|
85dc4e7a77 | ||
|
|
974e468e6d | ||
|
|
6998c71458 | ||
|
|
5c8de84f5f | ||
|
|
1357249aa9 |
589
Make-config
589
Make-config
File diff suppressed because it is too large
Load Diff
533
Makefile.X11
533
Makefile.X11
@@ -1,7 +1,7 @@
|
||||
# $Id: Makefile.X11,v 1.32 2000/07/21 16:36:35 brianp Exp $
|
||||
# $Id: Makefile.X11,v 1.48 2001/06/19 21:49:06 brianp Exp $
|
||||
|
||||
# Mesa 3-D graphics library
|
||||
# Version: 3.3
|
||||
# Version: 3.5
|
||||
#
|
||||
# Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
|
||||
#
|
||||
@@ -68,18 +68,15 @@ default:
|
||||
|
||||
@echo " make linux for Linux systems, make shared .so libs"
|
||||
@echo " make linux-static for Linux systems, make static .a libs"
|
||||
@echo " make linux-386 for Linux on Intel, make shared .so libs"
|
||||
@echo " make linux-386-static for Linux on Intel, make static .a libs"
|
||||
@echo " make linux-trace for Linux systems, with API trace extension"
|
||||
@echo " make linux-x86 for Linux on Intel, make shared .so libs"
|
||||
@echo " make linux-x86-static for Linux on Intel, make static .a libs"
|
||||
@echo " make linux-ggi for Linux systems with libggi"
|
||||
@echo " make linux-386-ggi for Linux systems with libggi w/ Intel assembly"
|
||||
@echo " make linux-glide for Linux w/ 3Dfx Glide driver"
|
||||
@echo " make linux-386-glide for Linux w/ 3Dfx Glide driver, Intel assembly"
|
||||
@echo " make linux-386-opt-glide for Linux with 3Dfx Voodoo1 for GLQuake"
|
||||
@echo " make linux-386-opt-V2-glide for Linux with 3Dfx Voodoo2 for GLQuake"
|
||||
@echo " make linux-3dnow for Linux on AMD w/ 3DNow!"
|
||||
@echo " make linux-3dnow-glide for Linux on AMD w/ 3DNow! for Glide"
|
||||
@echo " make linux-katmai for Linux on PentiumIII w/ SSE"
|
||||
@echo " make linux-katmai-glide for Linux on PentiumIII w/ SSE for Glide"
|
||||
@echo " make linux-x86-glide for Linux w/ all x86 asm for Glide"
|
||||
@echo " make linux-alpha for Linux on Alpha systems"
|
||||
@echo " make linux-alpha-static for Linux on Alpha systems, static libs"
|
||||
@echo " make linux-ppc for Linux on PowerPC systems"
|
||||
@@ -87,6 +84,7 @@ default:
|
||||
@echo " make linux-sparc for Linux on Sparc systems"
|
||||
@echo " make linux-sparc5-elf for Sparc5 systems, make ELF shared libs"
|
||||
@echo " make linux-sparc-ultra for UltraSparc systems, make ELF shared libs"
|
||||
@echo " make linux-osmesa16 for 16-bit/channel OSMesa"
|
||||
@echo " make lynxos for LynxOS systems with GCC"
|
||||
@echo " make macintosh for Macintosh"
|
||||
@echo " make machten-2.2 for Macs w/ MachTen 2.2 (68k w/ FPU)"
|
||||
@@ -135,17 +133,17 @@ default:
|
||||
|
||||
|
||||
|
||||
# XXX we may have to split up this group of targets into those that
|
||||
# have a C++ compiler and those that don't for the SI-GLU library.
|
||||
|
||||
aix aix-sl amix bsdos bsdos4 dgux freebsd freebsd-386 gcc \
|
||||
hpux9 hpux9-sl hpux9-gcc hpux9-gcc-sl \
|
||||
hpux10 hpux10-sl hpux10-gcc hpux10-gcc-sl \
|
||||
irix4 irix5 irix5-gcc irix5-dso irix6-o32 irix6-o32-dso \
|
||||
linux-static-debug linux-elf-debug linux-prof linux-glide-debug \
|
||||
linux linux-static \
|
||||
linux-386 linux-386-static \
|
||||
linux linux-static linux-debug linux-static-debug linux-prof \
|
||||
linux-x86 linux-x86-static linux-x86-debug \
|
||||
linux-glide linux-386-glide linux-386-opt-glide \
|
||||
linux-386-opt-V2-glide \
|
||||
linux-3dnow linux-3dnow-glide \
|
||||
linux-katmai linux-katmai-glide \
|
||||
linux-x86-glide linux-glide-debug linux-glide-prof \
|
||||
linux-alpha-static linux-alpha \
|
||||
linux-ppc-static linux-ppc \
|
||||
linux-sparc \
|
||||
@@ -160,11 +158,11 @@ sunos5-thread sunos5-pthread sunos5-gcc-thread sunos5-gcc-pthread \
|
||||
sunos5-x11r6-gcc-sl ultrix-gcc unicos unixware uwin vistra:
|
||||
-mkdir lib
|
||||
if [ -d src ] ; then touch src/depend ; fi
|
||||
if [ -d src-glu ] ; then touch src-glu/depend ; fi
|
||||
if [ -d si-glu ] ; then touch si-glu/depend ; fi
|
||||
if [ -d src-glut ] ; then touch src-glut/depend ; fi
|
||||
if [ -d widgets-sgi ] ; then touch widgets-sgi/depend ; fi
|
||||
if [ -d src ] ; then cd src ; $(MAKE) -f Makefile.X11 $@ ; fi
|
||||
if [ -d src-glu ] ; then cd src-glu ; $(MAKE) -f Makefile.X11 $@ ; fi
|
||||
if [ -d si-glu ] ; then cd si-glu ; $(MAKE) -f Makefile.X11 $@ ; fi
|
||||
if [ -d src-glut ] ; then cd src-glut ; $(MAKE) -f Makefile.X11 $@ ; fi
|
||||
if [ -d demos ] ; then cd demos ; $(MAKE) -f Makefile.X11 $@ ; fi
|
||||
if [ -d xdemos ] ; then cd xdemos ; $(MAKE) -f Makefile.X11 $@ ; fi
|
||||
@@ -266,14 +264,14 @@ os2-x11:
|
||||
linux-ggi linux-386-ggi:
|
||||
-mkdir lib
|
||||
touch src/depend
|
||||
touch src-glu/depend
|
||||
touch si-glu/depend
|
||||
if [ -d src-glut ] ; then touch src-glut/depend ; fi
|
||||
if [ -d widgets-sgi ] ; then touch widgets-sgi/depend ; fi
|
||||
if [ -d ggi ] ; then touch ggi/depend ; fi
|
||||
if [ -d src ] ; then cd src ; $(MAKE) -f Makefile.X11 $@ ; fi
|
||||
if [ -d src/GGI/default ] ; then cd src/GGI/default ; $(MAKE) ; fi
|
||||
if [ -d src/GGI/display ] ; then cd src/GGI/display ; $(MAKE) ; fi
|
||||
if [ -d src-glut ] ; then cd src-glu ; $(MAKE) -f Makefile.X11 $@ ; fi
|
||||
if [ -d si-glu ] ; then cd si-glu ; $(MAKE) -f Makefile.X11 $@ ; fi
|
||||
# if [ -d src-glut ] ; then cd src-glut ; $(MAKE) -f Makefile.X11 $@ ; fi
|
||||
if [ -d ggi ] ; then cd ggi ; $(MAKE) -f Makefile.X11 $@ ; fi
|
||||
if [ -d ggi ] ; then cd ggi/demos; $(MAKE) ; fi
|
||||
@@ -296,6 +294,12 @@ linux-ggi-install linux-386-ggi-install:
|
||||
# echo ".include $(DESTDIR)/etc/ggi/ggimesa.conf" >> $(DESTDIR)/etc/ggi/libggi.conf ; \
|
||||
# fi
|
||||
|
||||
linux-osmesa16:
|
||||
-mkdir lib
|
||||
if [ -d src ] ; then touch src/depend ; fi
|
||||
if [ -d src ] ; then cd src ; $(MAKE) -f Makefile.OSMesa16 $@ ; fi
|
||||
|
||||
|
||||
# Remove .o files, emacs backup files, etc.
|
||||
clean:
|
||||
-rm -f ggi/*~ *.o
|
||||
@@ -305,6 +309,7 @@ clean:
|
||||
-rm -f include/GL/*~
|
||||
-rm -f src/*.o src/*~ src/*.a src/*/*.o src/*/*~
|
||||
-rm -f src-glu/*.o src-glu/*~ src-glu/*.a
|
||||
-rm -f si-glu/*/*.o si-glu/*/*/*.o
|
||||
-rm -f src-glut/*.o
|
||||
-rm -f demos/*.o
|
||||
-rm -f book/*.o book/*~
|
||||
@@ -326,224 +331,275 @@ realclean: clean
|
||||
|
||||
|
||||
|
||||
DIRECTORY = Mesa-3.3
|
||||
LIB_NAME = MesaLib-3.3
|
||||
DEMO_NAME = MesaDemos-3.3
|
||||
GLU_NAME = MesaGLU-3.3
|
||||
DIRECTORY = Mesa-3.5
|
||||
LIB_NAME = MesaLib-3.5
|
||||
DEMO_NAME = MesaDemos-3.5
|
||||
GLU_NAME = MesaGLU-3.5
|
||||
GLUT_NAME = GLUT-3.7
|
||||
|
||||
|
||||
LIB_FILES = \
|
||||
$(DIRECTORY)/Makefile* \
|
||||
$(DIRECTORY)/Make-config \
|
||||
$(DIRECTORY)/acconfig.h \
|
||||
$(DIRECTORY)/acinclude.m4 \
|
||||
$(DIRECTORY)/aclocal.m4 \
|
||||
$(DIRECTORY)/conf.h.in \
|
||||
$(DIRECTORY)/config.guess \
|
||||
$(DIRECTORY)/config.sub \
|
||||
$(DIRECTORY)/configure \
|
||||
$(DIRECTORY)/configure.in \
|
||||
$(DIRECTORY)/install-sh \
|
||||
$(DIRECTORY)/ltconfig \
|
||||
$(DIRECTORY)/ltmain.sh \
|
||||
$(DIRECTORY)/missing \
|
||||
$(DIRECTORY)/mkinstalldirs \
|
||||
$(DIRECTORY)/stamp-h.in \
|
||||
$(DIRECTORY)/docs/CONFIG \
|
||||
$(DIRECTORY)/docs/CONFORM \
|
||||
$(DIRECTORY)/docs/COPYING \
|
||||
$(DIRECTORY)/docs/COPYRIGHT \
|
||||
$(DIRECTORY)/docs/DEVINFO \
|
||||
$(DIRECTORY)/docs/IAFA-PACKAGE \
|
||||
$(DIRECTORY)/docs/INSTALL \
|
||||
$(DIRECTORY)/docs/INSTALL.GNU \
|
||||
$(DIRECTORY)/docs/README \
|
||||
$(DIRECTORY)/docs/README.* \
|
||||
$(DIRECTORY)/docs/RELNOTES* \
|
||||
$(DIRECTORY)/docs/VERSIONS \
|
||||
$(DIRECTORY)/docs/*.spec \
|
||||
$(DIRECTORY)/bin/README \
|
||||
$(DIRECTORY)/bin/mklib* \
|
||||
$(DIRECTORY)/*.BAT \
|
||||
$(DIRECTORY)/*.bat \
|
||||
$(DIRECTORY)/descrip.mms \
|
||||
$(DIRECTORY)/mms-config \
|
||||
$(DIRECTORY)/xlib.opt \
|
||||
$(DIRECTORY)/STARTUP.MK \
|
||||
$(DIRECTORY)/mesawin32.mak \
|
||||
$(DIRECTORY)/Names.win \
|
||||
$(DIRECTORY)/win32-openstep.sh \
|
||||
$(DIRECTORY)/common.dja \
|
||||
$(DIRECTORY)/include/GL/Makefile.in \
|
||||
$(DIRECTORY)/include/GL/Makefile.am \
|
||||
$(DIRECTORY)/include/GL/dosmesa.h \
|
||||
$(DIRECTORY)/include/GL/amesa.h \
|
||||
$(DIRECTORY)/include/GL/fxmesa.h \
|
||||
$(DIRECTORY)/include/GL/ggimesa.h \
|
||||
$(DIRECTORY)/include/GL/gl.h \
|
||||
$(DIRECTORY)/include/GL/glext.h \
|
||||
$(DIRECTORY)/include/GL/gl_mangle.h \
|
||||
$(DIRECTORY)/include/GL/glu.h \
|
||||
$(DIRECTORY)/include/GL/glu_mangle.h \
|
||||
$(DIRECTORY)/include/GL/glx.h \
|
||||
$(DIRECTORY)/include/GL/glx_mangle.h \
|
||||
$(DIRECTORY)/include/GL/mglmesa.h \
|
||||
$(DIRECTORY)/include/GL/osmesa.h \
|
||||
$(DIRECTORY)/include/GL/svgamesa.h \
|
||||
$(DIRECTORY)/include/GL/wmesa.h \
|
||||
$(DIRECTORY)/include/GL/xmesa.h \
|
||||
$(DIRECTORY)/include/GL/xmesa_x.h \
|
||||
$(DIRECTORY)/include/GL/xmesa_xf86.h \
|
||||
$(DIRECTORY)/include/GLView.h \
|
||||
$(DIRECTORY)/include/Makefile.in \
|
||||
$(DIRECTORY)/include/Makefile.am \
|
||||
$(DIRECTORY)/src/Makefile* \
|
||||
$(DIRECTORY)/src/descrip.mms \
|
||||
$(DIRECTORY)/src/mms_depend \
|
||||
$(DIRECTORY)/src/mesa.conf \
|
||||
$(DIRECTORY)/src/*.def \
|
||||
$(DIRECTORY)/src/depend \
|
||||
$(DIRECTORY)/src/*.[chS] \
|
||||
$(DIRECTORY)/src/Allegro/*.[ch] \
|
||||
$(DIRECTORY)/src/BeOS/*.cpp \
|
||||
$(DIRECTORY)/src/D3D/*.cpp \
|
||||
$(DIRECTORY)/src/D3D/*.CPP \
|
||||
$(DIRECTORY)/src/D3D/*.h \
|
||||
$(DIRECTORY)/src/D3D/*.H \
|
||||
$(DIRECTORY)/src/D3D/*.c \
|
||||
$(DIRECTORY)/src/D3D/*.C \
|
||||
$(DIRECTORY)/src/D3D/MAKEFILE \
|
||||
$(DIRECTORY)/src/D3D/*bat \
|
||||
$(DIRECTORY)/src/D3D/*DEF \
|
||||
$(DIRECTORY)/src/DOS/DEPEND.DOS \
|
||||
$(DIRECTORY)/src/DOS/*.c \
|
||||
$(DIRECTORY)/src/FX/Makefile.am \
|
||||
$(DIRECTORY)/src/FX/Makefile.in \
|
||||
$(DIRECTORY)/src/FX/*.[ch] \
|
||||
$(DIRECTORY)/src/FX/*.def \
|
||||
$(DIRECTORY)/src/FX/X86/Makefile.am \
|
||||
$(DIRECTORY)/src/FX/X86/Makefile.in \
|
||||
$(DIRECTORY)/src/FX/X86/*.[Shc] \
|
||||
$(DIRECTORY)/src/GGI/Makefile.am \
|
||||
$(DIRECTORY)/src/GGI/Makefile.in \
|
||||
$(DIRECTORY)/src/GGI/*.[ch] \
|
||||
$(DIRECTORY)/src/GGI/ggimesa.conf.in \
|
||||
$(DIRECTORY)/src/GGI/default/*.c \
|
||||
$(DIRECTORY)/src/GGI/default/Makefile.am \
|
||||
$(DIRECTORY)/src/GGI/default/Makefile.in \
|
||||
$(DIRECTORY)/src/GGI/default/genkgi.conf.in \
|
||||
$(DIRECTORY)/src/GGI/display/*.c \
|
||||
$(DIRECTORY)/src/GGI/display/Makefile.am \
|
||||
$(DIRECTORY)/src/GGI/display/Makefile.in \
|
||||
$(DIRECTORY)/src/GGI/display/fbdev.conf.in \
|
||||
$(DIRECTORY)/src/GGI/include/Makefile.am \
|
||||
$(DIRECTORY)/src/GGI/include/Makefile.in \
|
||||
$(DIRECTORY)/src/GGI/include/ggi/Makefile.am \
|
||||
$(DIRECTORY)/src/GGI/include/ggi/Makefile.in \
|
||||
$(DIRECTORY)/src/GGI/include/ggi/mesa/Makefile.am \
|
||||
$(DIRECTORY)/src/GGI/include/ggi/mesa/Makefile.in \
|
||||
$(DIRECTORY)/src/GGI/include/ggi/mesa/*.h \
|
||||
$(DIRECTORY)/src/KNOWN_BUGS \
|
||||
$(DIRECTORY)/src/OSmesa/Makefile.am \
|
||||
$(DIRECTORY)/src/OSmesa/Makefile.in \
|
||||
$(DIRECTORY)/src/OSmesa/*.[ch] \
|
||||
$(DIRECTORY)/src/S3/*.[ch] \
|
||||
$(DIRECTORY)/src/S3/*.def \
|
||||
$(DIRECTORY)/src/S3/*.mak \
|
||||
$(DIRECTORY)/src/S3/*.rc \
|
||||
$(DIRECTORY)/src/SVGA/Makefile.am \
|
||||
$(DIRECTORY)/src/SVGA/Makefile.in \
|
||||
$(DIRECTORY)/src/SVGA/*.[ch] \
|
||||
$(DIRECTORY)/src/Windows/*.[ch] \
|
||||
$(DIRECTORY)/src/Windows/*.def \
|
||||
$(DIRECTORY)/src/X/Makefile.am \
|
||||
$(DIRECTORY)/src/X/Makefile.in \
|
||||
$(DIRECTORY)/src/X/*.[ch] \
|
||||
$(DIRECTORY)/src/X86/*.[ch] \
|
||||
$(DIRECTORY)/src/X86/Makefile.am \
|
||||
$(DIRECTORY)/src/X86/Makefile.in \
|
||||
$(DIRECTORY)/src/X86/*.m4 \
|
||||
$(DIRECTORY)/src/X86/*.S \
|
||||
$(DIRECTORY)/src-glu/README[12] \
|
||||
$(DIRECTORY)/src-glu/Makefile* \
|
||||
$(DIRECTORY)/src-glu/descrip.mms \
|
||||
$(DIRECTORY)/src-glu/mms_depend \
|
||||
$(DIRECTORY)/src-glu/*.def \
|
||||
$(DIRECTORY)/src-glu/depend \
|
||||
$(DIRECTORY)/src-glu/*.[ch] \
|
||||
$(DIRECTORY)/widgets-mesa/ChangeLog \
|
||||
$(DIRECTORY)/widgets-mesa/INSTALL \
|
||||
$(DIRECTORY)/widgets-mesa/Makefile.in \
|
||||
$(DIRECTORY)/widgets-mesa/README \
|
||||
$(DIRECTORY)/widgets-mesa/TODO \
|
||||
$(DIRECTORY)/widgets-mesa/configure \
|
||||
$(DIRECTORY)/widgets-mesa/demos/ChangeLog \
|
||||
$(DIRECTORY)/widgets-mesa/demos/Cube \
|
||||
$(DIRECTORY)/widgets-mesa/demos/Ed \
|
||||
$(DIRECTORY)/widgets-mesa/demos/Makefile.in \
|
||||
$(DIRECTORY)/widgets-mesa/demos/Mcube \
|
||||
$(DIRECTORY)/widgets-mesa/demos/Tea \
|
||||
$(DIRECTORY)/widgets-mesa/demos/*.[ch] \
|
||||
$(DIRECTORY)/widgets-mesa/demos/events \
|
||||
$(DIRECTORY)/widgets-mesa/include/GL/ChangeLog \
|
||||
$(DIRECTORY)/widgets-mesa/include/GL/*.h \
|
||||
$(DIRECTORY)/widgets-mesa/include/GL/Makefile.in \
|
||||
$(DIRECTORY)/widgets-mesa/man/ChangeLog \
|
||||
$(DIRECTORY)/widgets-mesa/man/GL* \
|
||||
$(DIRECTORY)/widgets-mesa/man/Makefile.in \
|
||||
$(DIRECTORY)/widgets-mesa/man/Mesa* \
|
||||
$(DIRECTORY)/widgets-mesa/src/ChangeLog \
|
||||
$(DIRECTORY)/widgets-sgi/*.[ch] \
|
||||
$(DIRECTORY)/widgets-sgi/Makefile* \
|
||||
$(DIRECTORY)/widgets-sgi/README \
|
||||
$(DIRECTORY)/util/README \
|
||||
$(DIRECTORY)/util/Makefile.am \
|
||||
$(DIRECTORY)/util/Makefile.in \
|
||||
$(DIRECTORY)/util/*.[ch] \
|
||||
$(DIRECTORY)/util/sampleMakefile \
|
||||
$(DIRECTORY)/vms/analyze_map.com \
|
||||
$(DIRECTORY)/vms/xlib.opt \
|
||||
$(DIRECTORY)/vms/xlib_share.opt \
|
||||
$(DIRECTORY)/BeOS/Makefile \
|
||||
$(DIRECTORY)/BeOS/*.cpp \
|
||||
$(DIRECTORY)/WIN32/NMAKE.MAK \
|
||||
$(DIRECTORY)/WIN32/NMAKE.MIF \
|
||||
$(DIRECTORY)/WIN32/RES/*rc \
|
||||
$(DIRECTORY)/WIN32/RES/*def \
|
||||
$(DIRECTORY)/WIN32/RULES/lib.* \
|
||||
$(DIRECTORY)/WIN32/RULES/progs.* \
|
||||
$(DIRECTORY)/macos/README \
|
||||
$(DIRECTORY)/macos/gli_api/*.h \
|
||||
$(DIRECTORY)/macos/cglpane/CGLPane.* \
|
||||
$(DIRECTORY)/macos/include-mac/*.h \
|
||||
$(DIRECTORY)/macos/libraries/*.stub \
|
||||
$(DIRECTORY)/macos/libraries/*Stub \
|
||||
$(DIRECTORY)/macos/projects/*.mcp \
|
||||
$(DIRECTORY)/macos/projects/*.exp \
|
||||
$(DIRECTORY)/macos/projects/*.h \
|
||||
$(DIRECTORY)/macos/resources/*.c \
|
||||
$(DIRECTORY)/macos/resources/*.r \
|
||||
$(DIRECTORY)/macos/resources/*.rsrc \
|
||||
$(DIRECTORY)/macos/src-agl/*.exp \
|
||||
$(DIRECTORY)/macos/src-agl/*.[ch] \
|
||||
$(DIRECTORY)/macos/src-gli/*.[ch] \
|
||||
$(DIRECTORY)/Makefile* \
|
||||
$(DIRECTORY)/Make-config \
|
||||
$(DIRECTORY)/acconfig.h \
|
||||
$(DIRECTORY)/acinclude.m4 \
|
||||
$(DIRECTORY)/aclocal.m4 \
|
||||
$(DIRECTORY)/common_rules.make \
|
||||
$(DIRECTORY)/conf.h.in \
|
||||
$(DIRECTORY)/config.guess \
|
||||
$(DIRECTORY)/config.sub \
|
||||
$(DIRECTORY)/configure \
|
||||
$(DIRECTORY)/configure.in \
|
||||
$(DIRECTORY)/install-sh \
|
||||
$(DIRECTORY)/ltconfig \
|
||||
$(DIRECTORY)/ltmain.sh \
|
||||
$(DIRECTORY)/missing \
|
||||
$(DIRECTORY)/mkinstalldirs \
|
||||
$(DIRECTORY)/stamp-h.in \
|
||||
$(DIRECTORY)/docs/CONFIG \
|
||||
$(DIRECTORY)/docs/CONFORM \
|
||||
$(DIRECTORY)/docs/COPYING \
|
||||
$(DIRECTORY)/docs/COPYRIGHT \
|
||||
$(DIRECTORY)/docs/DEVINFO \
|
||||
$(DIRECTORY)/docs/IAFA-PACKAGE \
|
||||
$(DIRECTORY)/docs/INSTALL \
|
||||
$(DIRECTORY)/docs/INSTALL.GNU \
|
||||
$(DIRECTORY)/docs/README \
|
||||
$(DIRECTORY)/docs/README.* \
|
||||
$(DIRECTORY)/docs/RELNOTES* \
|
||||
$(DIRECTORY)/docs/VERSIONS \
|
||||
$(DIRECTORY)/docs/*.spec \
|
||||
$(DIRECTORY)/bin/README \
|
||||
$(DIRECTORY)/bin/mklib* \
|
||||
$(DIRECTORY)/descrip.mms \
|
||||
$(DIRECTORY)/mms-config \
|
||||
$(DIRECTORY)/m4/*.m4 \
|
||||
$(DIRECTORY)/xlib.opt \
|
||||
$(DIRECTORY)/mesawin32.mak \
|
||||
$(DIRECTORY)/include/GL/internal/glcore.h \
|
||||
$(DIRECTORY)/include/GL/Makefile.in \
|
||||
$(DIRECTORY)/include/GL/Makefile.am \
|
||||
$(DIRECTORY)/include/GL/dosmesa.h \
|
||||
$(DIRECTORY)/include/GL/amesa.h \
|
||||
$(DIRECTORY)/include/GL/fxmesa.h \
|
||||
$(DIRECTORY)/include/GL/ggimesa.h \
|
||||
$(DIRECTORY)/include/GL/gl.h \
|
||||
$(DIRECTORY)/include/GL/glext.h \
|
||||
$(DIRECTORY)/include/GL/gl_mangle.h \
|
||||
$(DIRECTORY)/include/GL/glu.h \
|
||||
$(DIRECTORY)/include/GL/glu_mangle.h \
|
||||
$(DIRECTORY)/include/GL/glx.h \
|
||||
$(DIRECTORY)/include/GL/glxext.h \
|
||||
$(DIRECTORY)/include/GL/glx_mangle.h \
|
||||
$(DIRECTORY)/include/GL/mesa_wgl.h \
|
||||
$(DIRECTORY)/include/GL/mglmesa.h \
|
||||
$(DIRECTORY)/include/GL/osmesa.h \
|
||||
$(DIRECTORY)/include/GL/svgamesa.h \
|
||||
$(DIRECTORY)/include/GL/wmesa.h \
|
||||
$(DIRECTORY)/include/GL/xmesa.h \
|
||||
$(DIRECTORY)/include/GL/xmesa_x.h \
|
||||
$(DIRECTORY)/include/GL/xmesa_xf86.h \
|
||||
$(DIRECTORY)/include/GLView.h \
|
||||
$(DIRECTORY)/include/Makefile.in \
|
||||
$(DIRECTORY)/include/Makefile.am \
|
||||
$(DIRECTORY)/src/Makefile* \
|
||||
$(DIRECTORY)/src/libGL_la_SOURCES \
|
||||
$(DIRECTORY)/src/descrip.mms \
|
||||
$(DIRECTORY)/src/mms_depend \
|
||||
$(DIRECTORY)/src/mesa.conf \
|
||||
$(DIRECTORY)/src/*.def \
|
||||
$(DIRECTORY)/src/depend \
|
||||
$(DIRECTORY)/src/*.[chS] \
|
||||
$(DIRECTORY)/src/array_cache/*.[ch] \
|
||||
$(DIRECTORY)/src/array_cache/Makefile* \
|
||||
$(DIRECTORY)/src/array_cache/libMesaAC_la_SOURCES \
|
||||
$(DIRECTORY)/src/math/*.[ch] \
|
||||
$(DIRECTORY)/src/math/Makefile* \
|
||||
$(DIRECTORY)/src/swrast/*.[ch] \
|
||||
$(DIRECTORY)/src/swrast/Makefile* \
|
||||
$(DIRECTORY)/src/swrast/libMesaSwrast_la_SOURCES \
|
||||
$(DIRECTORY)/src/swrast_setup/*.[ch] \
|
||||
$(DIRECTORY)/src/swrast_setup/Makefile* \
|
||||
$(DIRECTORY)/src/tnl/*.[ch] \
|
||||
$(DIRECTORY)/src/tnl/Makefile* \
|
||||
$(DIRECTORY)/src/tnl/libMesaTnl_la_SOURCES \
|
||||
$(DIRECTORY)/src/BeOS/*.cpp \
|
||||
$(DIRECTORY)/src/FX/Makefile.am \
|
||||
$(DIRECTORY)/src/FX/Makefile.in \
|
||||
$(DIRECTORY)/src/FX/libMesaFX_la_SOURCES \
|
||||
$(DIRECTORY)/src/FX/*.[ch] \
|
||||
$(DIRECTORY)/src/FX/*.def \
|
||||
$(DIRECTORY)/src/FX/X86/Makefile.am \
|
||||
$(DIRECTORY)/src/FX/X86/Makefile.in \
|
||||
$(DIRECTORY)/src/FX/X86/*.[Shc] \
|
||||
$(DIRECTORY)/src/GGI/Makefile.am \
|
||||
$(DIRECTORY)/src/GGI/Makefile.in \
|
||||
$(DIRECTORY)/src/GGI/*.[ch] \
|
||||
$(DIRECTORY)/src/GGI/ggimesa.conf.in \
|
||||
$(DIRECTORY)/src/GGI/default/*.c \
|
||||
$(DIRECTORY)/src/GGI/default/Makefile.am \
|
||||
$(DIRECTORY)/src/GGI/default/Makefile.in \
|
||||
$(DIRECTORY)/src/GGI/default/genkgi.conf.in \
|
||||
$(DIRECTORY)/src/GGI/display/*.c \
|
||||
$(DIRECTORY)/src/GGI/display/Makefile.am \
|
||||
$(DIRECTORY)/src/GGI/display/Makefile.in \
|
||||
$(DIRECTORY)/src/GGI/display/fbdev.conf.in \
|
||||
$(DIRECTORY)/src/GGI/include/Makefile.am \
|
||||
$(DIRECTORY)/src/GGI/include/Makefile.in \
|
||||
$(DIRECTORY)/src/GGI/include/ggi/Makefile.am \
|
||||
$(DIRECTORY)/src/GGI/include/ggi/Makefile.in \
|
||||
$(DIRECTORY)/src/GGI/include/ggi/mesa/Makefile.am \
|
||||
$(DIRECTORY)/src/GGI/include/ggi/mesa/Makefile.in \
|
||||
$(DIRECTORY)/src/GGI/include/ggi/mesa/*.h \
|
||||
$(DIRECTORY)/src/KNOWN_BUGS \
|
||||
$(DIRECTORY)/src/OSmesa/Makefile.am \
|
||||
$(DIRECTORY)/src/OSmesa/Makefile.in \
|
||||
$(DIRECTORY)/src/OSmesa/*.[ch] \
|
||||
$(DIRECTORY)/src/SPARC/*.[chS] \
|
||||
$(DIRECTORY)/src/SPARC/Makefile.am \
|
||||
$(DIRECTORY)/src/SPARC/Makefile.in \
|
||||
$(DIRECTORY)/src/SVGA/Makefile.am \
|
||||
$(DIRECTORY)/src/SVGA/Makefile.in \
|
||||
$(DIRECTORY)/src/SVGA/*.[ch] \
|
||||
$(DIRECTORY)/src/Trace/*.[ch] \
|
||||
$(DIRECTORY)/src/Trace/Makefile.am \
|
||||
$(DIRECTORY)/src/Trace/Makefile.in \
|
||||
$(DIRECTORY)/src/Windows/*.[ch] \
|
||||
$(DIRECTORY)/src/Windows/*.def \
|
||||
$(DIRECTORY)/src/X/Makefile.am \
|
||||
$(DIRECTORY)/src/X/Makefile.in \
|
||||
$(DIRECTORY)/src/X/*.[ch] \
|
||||
$(DIRECTORY)/src/X86/*.[ch] \
|
||||
$(DIRECTORY)/src/X86/Makefile.am \
|
||||
$(DIRECTORY)/src/X86/Makefile.in \
|
||||
$(DIRECTORY)/src/X86/*.S \
|
||||
$(DIRECTORY)/si-glu/Makefile.am \
|
||||
$(DIRECTORY)/si-glu/Makefile.in \
|
||||
$(DIRECTORY)/si-glu/Makefile.X11 \
|
||||
$(DIRECTORY)/si-glu/dummy.cc \
|
||||
$(DIRECTORY)/si-glu/descrip.mms \
|
||||
$(DIRECTORY)/si-glu/mesaglu.opt \
|
||||
$(DIRECTORY)/si-glu/include/gluos.h \
|
||||
$(DIRECTORY)/si-glu/include/Makefile.am \
|
||||
$(DIRECTORY)/si-glu/include/Makefile.in \
|
||||
$(DIRECTORY)/si-glu/libnurbs/Makefile.am \
|
||||
$(DIRECTORY)/si-glu/libnurbs/Makefile.in \
|
||||
$(DIRECTORY)/si-glu/libnurbs/interface/*.h \
|
||||
$(DIRECTORY)/si-glu/libnurbs/interface/*.cc \
|
||||
$(DIRECTORY)/si-glu/libnurbs/interface/libNIFac_la_SOURCES \
|
||||
$(DIRECTORY)/si-glu/libnurbs/interface/Makefile.am \
|
||||
$(DIRECTORY)/si-glu/libnurbs/interface/Makefile.in \
|
||||
$(DIRECTORY)/si-glu/libnurbs/internals/*.h \
|
||||
$(DIRECTORY)/si-glu/libnurbs/internals/*.cc \
|
||||
$(DIRECTORY)/si-glu/libnurbs/internals/libNInt_la_SOURCES \
|
||||
$(DIRECTORY)/si-glu/libnurbs/internals/Makefile.am \
|
||||
$(DIRECTORY)/si-glu/libnurbs/internals/Makefile.in \
|
||||
$(DIRECTORY)/si-glu/libnurbs/nurbtess/*.h \
|
||||
$(DIRECTORY)/si-glu/libnurbs/nurbtess/*.cc \
|
||||
$(DIRECTORY)/si-glu/libnurbs/nurbtess/libNTess_la_SOURCES \
|
||||
$(DIRECTORY)/si-glu/libnurbs/nurbtess/Makefile.am \
|
||||
$(DIRECTORY)/si-glu/libnurbs/nurbtess/Makefile.in \
|
||||
$(DIRECTORY)/si-glu/libtess/README \
|
||||
$(DIRECTORY)/si-glu/libtess/alg-outline \
|
||||
$(DIRECTORY)/si-glu/libtess/*.[ch] \
|
||||
$(DIRECTORY)/si-glu/libtess/libtess_la_SOURCES \
|
||||
$(DIRECTORY)/si-glu/libtess/Makefile.am \
|
||||
$(DIRECTORY)/si-glu/libtess/Makefile.in \
|
||||
$(DIRECTORY)/si-glu/libutil/*.[ch] \
|
||||
$(DIRECTORY)/si-glu/libutil/libutil_la_SOURCES \
|
||||
$(DIRECTORY)/si-glu/libutil/Makefile.am \
|
||||
$(DIRECTORY)/si-glu/libutil/Makefile.in \
|
||||
$(DIRECTORY)/src-glu/README[12] \
|
||||
$(DIRECTORY)/src-glu/Makefile* \
|
||||
$(DIRECTORY)/src-glu/descrip.mms \
|
||||
$(DIRECTORY)/src-glu/mms_depend \
|
||||
$(DIRECTORY)/src-glu/*.def \
|
||||
$(DIRECTORY)/src-glu/depend \
|
||||
$(DIRECTORY)/src-glu/*.[ch] \
|
||||
$(DIRECTORY)/widgets-mesa/ChangeLog \
|
||||
$(DIRECTORY)/widgets-mesa/INSTALL \
|
||||
$(DIRECTORY)/widgets-mesa/Makefile.in \
|
||||
$(DIRECTORY)/widgets-mesa/README \
|
||||
$(DIRECTORY)/widgets-mesa/TODO \
|
||||
$(DIRECTORY)/widgets-mesa/configure \
|
||||
$(DIRECTORY)/widgets-mesa/configure.in \
|
||||
$(DIRECTORY)/widgets-mesa/demos/ChangeLog \
|
||||
$(DIRECTORY)/widgets-mesa/demos/Cube \
|
||||
$(DIRECTORY)/widgets-mesa/demos/Ed \
|
||||
$(DIRECTORY)/widgets-mesa/demos/Makefile.in \
|
||||
$(DIRECTORY)/widgets-mesa/demos/Mcube \
|
||||
$(DIRECTORY)/widgets-mesa/demos/Tea \
|
||||
$(DIRECTORY)/widgets-mesa/demos/*.[ch] \
|
||||
$(DIRECTORY)/widgets-mesa/demos/events \
|
||||
$(DIRECTORY)/widgets-mesa/include/GL/ChangeLog \
|
||||
$(DIRECTORY)/widgets-mesa/include/GL/*.h \
|
||||
$(DIRECTORY)/widgets-mesa/include/GL/Makefile.in \
|
||||
$(DIRECTORY)/widgets-mesa/man/ChangeLog \
|
||||
$(DIRECTORY)/widgets-mesa/man/GL* \
|
||||
$(DIRECTORY)/widgets-mesa/man/Makefile.in \
|
||||
$(DIRECTORY)/widgets-mesa/man/Mesa* \
|
||||
$(DIRECTORY)/widgets-mesa/src/ChangeLog \
|
||||
$(DIRECTORY)/widgets-mesa/src/*.c \
|
||||
$(DIRECTORY)/widgets-mesa/src/Makefile.in \
|
||||
$(DIRECTORY)/widgets-sgi/*.[ch] \
|
||||
$(DIRECTORY)/widgets-sgi/Makefile* \
|
||||
$(DIRECTORY)/widgets-sgi/README \
|
||||
$(DIRECTORY)/util/README \
|
||||
$(DIRECTORY)/util/Makefile.am \
|
||||
$(DIRECTORY)/util/Makefile.in \
|
||||
$(DIRECTORY)/util/*.[ch] \
|
||||
$(DIRECTORY)/util/sampleMakefile \
|
||||
$(DIRECTORY)/vms/analyze_map.com \
|
||||
$(DIRECTORY)/vms/xlib.opt \
|
||||
$(DIRECTORY)/vms/xlib_share.opt \
|
||||
$(DIRECTORY)/BeOS/Makefile \
|
||||
$(DIRECTORY)/BeOS/*.cpp
|
||||
|
||||
OBSOLETE_LIB_FILES = \
|
||||
$(DIRECTORY)/src/Allegro/*.[ch] \
|
||||
$(DIRECTORY)/src/D3D/*.cpp \
|
||||
$(DIRECTORY)/src/D3D/*.CPP \
|
||||
$(DIRECTORY)/src/D3D/*.h \
|
||||
$(DIRECTORY)/src/D3D/*.H \
|
||||
$(DIRECTORY)/src/D3D/*.c \
|
||||
$(DIRECTORY)/src/D3D/*.C \
|
||||
$(DIRECTORY)/src/D3D/MAKEFILE \
|
||||
$(DIRECTORY)/src/D3D/*bat \
|
||||
$(DIRECTORY)/src/D3D/*DEF \
|
||||
$(DIRECTORY)/src/DOS/DEPEND.DOS \
|
||||
$(DIRECTORY)/src/DOS/*.c \
|
||||
$(DIRECTORY)/src/S3/*.[ch] \
|
||||
$(DIRECTORY)/src/S3/*.def \
|
||||
$(DIRECTORY)/src/S3/*.mak \
|
||||
$(DIRECTORY)/src/S3/*.rc \
|
||||
$(DIRECTORY)/macos/README \
|
||||
$(DIRECTORY)/macos/gli_api/*.h \
|
||||
$(DIRECTORY)/macos/cglpane/CGLPane.* \
|
||||
$(DIRECTORY)/macos/include-mac/*.h \
|
||||
$(DIRECTORY)/macos/libraries/*.stub \
|
||||
$(DIRECTORY)/macos/libraries/*Stub \
|
||||
$(DIRECTORY)/macos/projects/*.mcp \
|
||||
$(DIRECTORY)/macos/projects/*.exp \
|
||||
$(DIRECTORY)/macos/projects/*.h \
|
||||
$(DIRECTORY)/macos/resources/*.c \
|
||||
$(DIRECTORY)/macos/resources/*.r \
|
||||
$(DIRECTORY)/macos/resources/*.rsrc \
|
||||
$(DIRECTORY)/macos/src-agl/*.exp \
|
||||
$(DIRECTORY)/macos/src-agl/*.[ch] \
|
||||
$(DIRECTORY)/macos/src-gli/*.[ch] \
|
||||
$(DIRECTORY)/OpenStep
|
||||
|
||||
|
||||
|
||||
DEMO_FILES = \
|
||||
$(DIRECTORY)/include/GL/glut.h \
|
||||
$(DIRECTORY)/include/GL/glutf90.h \
|
||||
$(DIRECTORY)/include/GL/glut_h.dja \
|
||||
$(DIRECTORY)/src-glut/Makefile* \
|
||||
$(DIRECTORY)/src-glut/depend \
|
||||
$(DIRECTORY)/src-glut/*def \
|
||||
$(DIRECTORY)/src-glut/descrip.mms \
|
||||
$(DIRECTORY)/src-glut/mms_depend \
|
||||
$(DIRECTORY)/src-glut/*.[ch] \
|
||||
$(DIRECTORY)/src-glut.dja/* \
|
||||
$(DIRECTORY)/src-glut.beos/Makefile \
|
||||
$(DIRECTORY)/src-glut.beos/*.cpp \
|
||||
$(DIRECTORY)/src-glut.beos/*.h \
|
||||
$(DIRECTORY)/images/* \
|
||||
$(DIRECTORY)/demos/Makefile* \
|
||||
$(DIRECTORY)/demos/descrip.mms \
|
||||
@@ -563,6 +619,32 @@ DEMO_FILES = \
|
||||
$(DIRECTORY)/mtdemos \
|
||||
$(DIRECTORY)/ggi
|
||||
|
||||
OBSOLETE_DEMO_FILES = \
|
||||
$(DIRECTORY)/include/GL/glut_h.dja \
|
||||
$(DIRECTORY)/src-glut.dja/* \
|
||||
$(DIRECTORY)/src-glut.beos/Makefile \
|
||||
$(DIRECTORY)/src-glut.beos/*.cpp \
|
||||
$(DIRECTORY)/src-glut.beos/*.h \
|
||||
|
||||
|
||||
SI_GLU_FILES = \
|
||||
$(DIRECTORY)/Makefile* \
|
||||
$(DIRECTORY)/Make-config \
|
||||
$(DIRECTORY)/bin/mklib* \
|
||||
$(DIRECTORY)/include/GL/glu.h \
|
||||
$(DIRECTORY)/si-glu/Makefile.X11 \
|
||||
$(DIRECTORY)/si-glu/include/gluos.h \
|
||||
$(DIRECTORY)/si-glu/libnurbs/interface/*.h \
|
||||
$(DIRECTORY)/si-glu/libnurbs/interface/*.cc \
|
||||
$(DIRECTORY)/si-glu/libnurbs/internals/*.h \
|
||||
$(DIRECTORY)/si-glu/libnurbs/internals/*.cc \
|
||||
$(DIRECTORY)/si-glu/libnurbs/nurbstess/*.h \
|
||||
$(DIRECTORY)/si-glu/libnurbs/nurbstess/*.cc \
|
||||
$(DIRECTORY)/si-glu/libtess/README \
|
||||
$(DIRECTORY)/si-glu/libtess/alg-outline \
|
||||
$(DIRECTORY)/si-glu/libtess/*.[ch] \
|
||||
$(DIRECTORY)/si-glu/libutil/*.[ch]
|
||||
|
||||
GLU_FILES = \
|
||||
$(DIRECTORY)/Makefile* \
|
||||
$(DIRECTORY)/Make-config \
|
||||
@@ -591,13 +673,16 @@ GLUT_FILES = \
|
||||
$(DIRECTORY)/include/GL/glu_mangle.h \
|
||||
$(DIRECTORY)/include/GL/glut.h \
|
||||
$(DIRECTORY)/include/GL/glutf90.h \
|
||||
$(DIRECTORY)/include/GL/glut_h.dja \
|
||||
$(DIRECTORY)/src-glut/Makefile* \
|
||||
$(DIRECTORY)/src-glut/depend \
|
||||
$(DIRECTORY)/src-glut/*def \
|
||||
$(DIRECTORY)/src-glut/descrip.mms \
|
||||
$(DIRECTORY)/src-glut/mms_depend \
|
||||
$(DIRECTORY)/src-glut/*.[ch] \
|
||||
$(DIRECTORY)/src-glut/*.[ch]
|
||||
|
||||
|
||||
OBSOLETE_GLUT_FILES = \
|
||||
$(DIRECTORY)/include/GL/glut_h.dja \
|
||||
$(DIRECTORY)/src-glut.dja/* \
|
||||
$(DIRECTORY)/src-glut.beos/Makefile \
|
||||
$(DIRECTORY)/src-glut.beos/*.cpp \
|
||||
|
||||
233
docs/MESA_packed_depth_stencil.spec
Normal file
233
docs/MESA_packed_depth_stencil.spec
Normal file
@@ -0,0 +1,233 @@
|
||||
XXX - Not complete yet!!!
|
||||
|
||||
Name
|
||||
|
||||
MESA_packed_depth_stencil
|
||||
|
||||
Name Strings
|
||||
|
||||
GL_MESA_packed_depth_stencil
|
||||
|
||||
Contact
|
||||
|
||||
Keith Whitwell, VA Linux Systems Inc. (keithw 'at' valinux.com)
|
||||
Brian Paul, VA Linux Systems Inc. (brianp 'at' valinux.com)
|
||||
|
||||
Status
|
||||
|
||||
Not yet shipping.
|
||||
|
||||
Version
|
||||
|
||||
$Id: MESA_packed_depth_stencil.spec,v 1.1 2000/11/03 14:58:45 brianp Exp $
|
||||
|
||||
Number
|
||||
|
||||
???
|
||||
|
||||
Dependencies
|
||||
|
||||
EXT_abgr affects the definition of this extension
|
||||
SGIS_texture4D affects the definition of this extension
|
||||
EXT_cmyka affects the definition of this extension
|
||||
ARB_packed_pixels affects the definition of this extension
|
||||
|
||||
Overview
|
||||
|
||||
Provides a mechanism for DrawPixels and ReadPixels to efficiently
|
||||
transfer depth and stencil image data. Specifically, we defined new
|
||||
packed pixel formats and types which pack both stencil and depth
|
||||
into one value.
|
||||
|
||||
Issues:
|
||||
|
||||
1. Is this the right way to distinguish between 24/8 and 8/24
|
||||
pixel formats? Should we instead provide both:
|
||||
|
||||
GL_DEPTH_STENCIL_MESA
|
||||
GL_STENCIL_DEPTH_MESA
|
||||
|
||||
And perhaps just use GL_UNSIGNED_INT, GL_UNSIGNED_SHORT ?
|
||||
|
||||
2. If not, is it correct to use _REV to indicate that stencil
|
||||
preceeds depth in the 1_15 and 8_24 formats?
|
||||
|
||||
3. Do we really want the GL_UNSIGNED_SHORT formats?
|
||||
|
||||
|
||||
New Procedures and Functions
|
||||
|
||||
None.
|
||||
|
||||
New Tokens
|
||||
|
||||
Accepted by the <format> parameter of ReadPixels and DrawPixels:
|
||||
|
||||
GL_DEPTH_STENCIL_MESA 0x8750
|
||||
|
||||
Accepted by the <type> parameter of ReadPixels and DrawPixels:
|
||||
|
||||
GL_UNSIGNED_INT_24_8_MESA 0x8751
|
||||
GL_UNSIGNED_INT_8_24_REV_MESA 0x8752
|
||||
GL_UNSIGNED_SHORT_15_1_MESA 0x8753
|
||||
GL_UNSIGNED_SHORT_1_15_REV_MESA 0x8754
|
||||
|
||||
Additions to Chapter 2 of the 1.1 Specification (OpenGL Operation)
|
||||
|
||||
None
|
||||
|
||||
Additions to Chapter 3 of the 1.1 Specification (Rasterization)
|
||||
|
||||
One entry is added to table 3.5 (DrawPixels and ReadPixels formats).
|
||||
The new table is:
|
||||
|
||||
Target
|
||||
Format Name Buffer Element Meaning and Order
|
||||
----------- ------ -------------------------
|
||||
COLOR_INDEX Color Color index
|
||||
STENCIL_INDEX Stencil Stencil index
|
||||
DEPTH_COMPONENT Depth Depth component
|
||||
RED Color R component
|
||||
GREEN Color G component
|
||||
BLUE Color B component
|
||||
ALPHA Color A component
|
||||
RGB Color R, G, B components
|
||||
RGBA Color R, G, B, A components
|
||||
BGRA Color B, G, R, A components
|
||||
ABGR_EXT Color A, B, G, R components
|
||||
CMYK_EXT Color Cyan, Magenta, Yellow, Black components
|
||||
CMYKA_EXT Color Cyan, Magenta, Yellow, Black, A components
|
||||
LUMINANCE Color Luminance component
|
||||
LUMINANCE_ALPHA Color Luminance, A components
|
||||
DEPTH_STENCIL Depth, Depth component, stencil index.
|
||||
Stencil
|
||||
|
||||
Table 3.5: DrawPixels and ReadPixels formats. The third column
|
||||
gives a description of and the number and order of elements in a
|
||||
group.
|
||||
|
||||
Add to the description of packed pixel formats:
|
||||
|
||||
<type> Parameter Data of Matching
|
||||
Token Name Type Elements Pixel Formats
|
||||
---------------- ---- -------- -------------
|
||||
|
||||
UNSIGNED_BYTE_3_3_2 ubyte 3 RGB
|
||||
UNSIGNED_BYTE_2_3_3_REV ubyte 3 RGB
|
||||
UNSIGNED_SHORT_5_6_5 ushort 3 RGB
|
||||
UNSIGNED_SHORT_5_6_5_REV ushort 3 RGB
|
||||
UNSIGNED_SHORT_4_4_4_4 ushort 4 RGBA,BGRA,ABGR_EXT,CMYK_EXT
|
||||
UNSIGNED_SHORT_4_4_4_4_REV ushort 4 RGBA,BGRA
|
||||
UNSIGNED_SHORT_5_5_5_1 ushort 4 RGBA,BGRA,ABGR_EXT,CMYK_EXT
|
||||
UNSIGNED_SHORT_1_5_5_5_REV ushort 4 RGBA,BGRA
|
||||
UNSIGNED_INT_8_8_8_8 uint 4 RGBA,BGRA,ABGR_EXT,CMYK_EXT
|
||||
UNSIGNED_INT_8_8_8_8_REV uint 4 RGBA,BGRA
|
||||
UNSIGNED_INT_10_10_10_2 uint 4 RGBA,BGRA,ABGR_EXT,CMYK_EXT
|
||||
UNSIGNED_INT_2_10_10_10_REV uint 4 RGBA,BGRA
|
||||
UNSIGNED_SHORT_15_1_MESA ushort 2 DEPTH_STENCIL_MESA
|
||||
UNSIGNED_SHORT_1_15_REV_MESA ushort 2 DEPTH_STENCIL_MESA
|
||||
UNSIGNED_SHORT_24_8_MESA ushort 2 DEPTH_STENCIL_MESA
|
||||
UNSIGNED_SHORT_8_24_REV_MESA ushort 2 DEPTH_STENCIL_MESA
|
||||
|
||||
UNSIGNED_INT_8_24:
|
||||
|
||||
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
|
||||
+-----------------------+-----------------------------------------------------------------------+
|
||||
| | |
|
||||
+-----------------------+-----------------------------------------------------------------------+
|
||||
|
||||
first second
|
||||
element element
|
||||
|
||||
|
||||
UNSIGNED_INT_24_8:
|
||||
|
||||
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
|
||||
+----------------------------------------------------------------------+------------------------+
|
||||
| | |
|
||||
+----------------------------------------------------------------------+------------------------+
|
||||
|
||||
first second
|
||||
element element
|
||||
|
||||
UNSIGNED_SHORT_15_1:
|
||||
|
||||
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
|
||||
+-----------------------------------------------------------+---+
|
||||
| | |
|
||||
+-----------------------------------------------------------+---+
|
||||
|
||||
first second
|
||||
element element
|
||||
|
||||
|
||||
UNSIGNED_SHORT_1_15_REV:
|
||||
|
||||
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
|
||||
+---+-----------------------------------------------------------+
|
||||
| | |
|
||||
+---+-----------------------------------------------------------+
|
||||
|
||||
second first
|
||||
element element
|
||||
|
||||
The assignment of elements to fields in the packed pixel is as
|
||||
described in the table below:
|
||||
|
||||
First Second Third Fourth
|
||||
Format Element Element Element Element
|
||||
------ ------- ------- ------- -------
|
||||
RGB red green blue
|
||||
RGBA red green blue alpha
|
||||
BGRA blue green red alpha
|
||||
ABGR_EXT alpha blue green red
|
||||
CMYK_EXT cyan magenta yellow black
|
||||
DEPTH_STENCIL_MESA depth stencil
|
||||
|
||||
Additions to Chapter 4 of the 1.1 Specification (Per-Fragment Operations
|
||||
and the Frame Buffer)
|
||||
|
||||
The new format is added to the discussion of Obtaining Pixels from the
|
||||
Framebuffer. It should read " If the <format> is one of RED, GREEN,
|
||||
BLUE, ALPHA, RGB, RGBA, ABGR_EXT, LUMINANCE, or LUMINANCE_ALPHA, and
|
||||
the GL is in color index mode, then the color index is obtained."
|
||||
|
||||
The new format is added to the discussion of Index Lookup. It should
|
||||
read "If <format> is one of RED, GREEN, BLUE, ALPHA, RGB, RGBA,
|
||||
ABGR_EXT, LUMINANCE, or LUMINANCE_ALPHA, then the index is used to
|
||||
reference 4 tables of color components: PIXEL_MAP_I_TO_R,
|
||||
PIXEL_MAP_I_TO_G, PIXEL_MAP_I_TO_B, and PIXEL_MAP_I_TO_A."
|
||||
|
||||
|
||||
Additions to Chapter 5 of the 1.1 Specification (Special Functions)
|
||||
|
||||
None
|
||||
|
||||
Additions to Chapter 6 of the 1.1 Specification (State and State Requests)
|
||||
|
||||
None
|
||||
|
||||
Additions to the GLX Specification
|
||||
|
||||
None
|
||||
|
||||
GLX Protocol
|
||||
|
||||
TBD
|
||||
|
||||
Errors
|
||||
|
||||
None
|
||||
|
||||
New State
|
||||
|
||||
None
|
||||
|
||||
Revision History
|
||||
|
||||
Version 1.0 - 23 Sep 2000
|
||||
Keith's original version.
|
||||
|
||||
Version 1.1 - 3 Nov 2000
|
||||
Brian's edits, assigned values to new enums.
|
||||
|
||||
193
docs/MESA_sprite_point.spec
Normal file
193
docs/MESA_sprite_point.spec
Normal file
@@ -0,0 +1,193 @@
|
||||
XXX - Not complete yet!!!
|
||||
|
||||
Name
|
||||
|
||||
MESA_sprite_point
|
||||
|
||||
Name Strings
|
||||
|
||||
GL_MESA_sprite_point
|
||||
|
||||
Contact
|
||||
|
||||
Brian Paul, VA Linux Systems Inc. (brianp 'at' valinux.com)
|
||||
|
||||
Status
|
||||
|
||||
Not yet shipping.
|
||||
|
||||
Version
|
||||
|
||||
$Id: MESA_sprite_point.spec,v 1.1 2000/12/08 00:21:02 brianp Exp $
|
||||
|
||||
Number
|
||||
|
||||
???
|
||||
|
||||
Dependencies
|
||||
|
||||
GL_EXT_point_parameters effects the definition of this extension
|
||||
GL_ARB_multitexture effects the definition of this extension
|
||||
|
||||
Overview
|
||||
|
||||
This extension modifies the way in which points are rendered,
|
||||
specifically when they're textured. When SPRITE_POINT_MESA is enabled
|
||||
a point is rendered as if it were a quadrilateral with unique texture
|
||||
coordinates at each vertex. This extension effectively turns points
|
||||
into sprites which may be rendered more easily and quickly than using
|
||||
conventional textured quadrilaterals.
|
||||
|
||||
When using point size > 1 or attenuated points this extension is an
|
||||
effective way to render many small sprite images for particle systems
|
||||
or other effects.
|
||||
|
||||
Issues:
|
||||
|
||||
1. How are the texture coordinates computed?
|
||||
|
||||
The lower-left corner has texture coordinate (0,0,r,q).
|
||||
The lower-right, (1,0,r,q). The upper-right, (1,1,r,q).
|
||||
The upper-left, (0,1,r,q).
|
||||
|
||||
2. What about texgen and texture matrices?
|
||||
|
||||
Texgen and the texture matrix have no effect on the point's s and t
|
||||
texture coordinates. The r and q coordinates may have been computed
|
||||
by texgen or the texture matrix. Note that with a 3D texture and/or
|
||||
texgen that the r coordinate could be used to select a slice in the
|
||||
3D texture.
|
||||
|
||||
3. What about point smoothing?
|
||||
|
||||
When point smoothing is enabled, a triangle fan could be rendered
|
||||
to approximate a circular point. This could be problematic to
|
||||
define and implement so POINT_SMOOTH is ignored when drawing sprite
|
||||
points.
|
||||
|
||||
Smoothed points can be approximated by using an appropriate texture
|
||||
images, alpha testing and blending.
|
||||
|
||||
POLYGON_SMOOTH does effect the rendering of the quadrilateral, however.
|
||||
|
||||
4. What about sprite rotation?
|
||||
|
||||
There is none. Sprite points are always rendered as window-aligned
|
||||
squares. One could define rotated texture images if desired. A 3D
|
||||
texture and appropriate texture r coordinates could be used to
|
||||
effectively specify image rotation per point.
|
||||
|
||||
5. What about POLYGON_MODE?
|
||||
|
||||
POLYGON_MODE does not effect the rasterization of the quadrilateral.
|
||||
|
||||
6. What about POLYGON_CULL?
|
||||
|
||||
TBD. Polygon culling is normally specified and implemented in the
|
||||
transformation stage of OpenGL. However, some rasterization hardware
|
||||
implements it later during triangle setup.
|
||||
|
||||
Polygon culling wouldn't be useful for sprite points since the
|
||||
quadrilaterals are always defined in counter-clockwise order in
|
||||
window space. For that reason, polygon culling should probably be
|
||||
ignored.
|
||||
|
||||
7. Should sprite points be alpha-attenuated if their size is below the
|
||||
point parameter's threshold size?
|
||||
|
||||
8. Should there be an advertisized maximum sprite point size?
|
||||
|
||||
No. Since we're rendering the point as a quadrilateral there's no
|
||||
need to limit the size.
|
||||
|
||||
|
||||
New Procedures and Functions
|
||||
|
||||
None.
|
||||
|
||||
New Tokens
|
||||
|
||||
Accepted by the <pname> parameter of Enable, Disable, IsEnabled,
|
||||
GetIntegerv, GetBooleanv, GetFloatv and GetDoublev:
|
||||
|
||||
SPRITE_POINT_MESA 0x????
|
||||
MAX_SPRITE_POINT_SIZE_MESA 0x???? (need this?)
|
||||
|
||||
Additions to Chapter 2 of the 1.1 Specification (OpenGL Operation)
|
||||
|
||||
None
|
||||
|
||||
Additions to Chapter 3 of the 1.1 Specification (Rasterization)
|
||||
|
||||
Section ???.
|
||||
|
||||
When SPRITE_POINT_MESA is enabled points are rasterized as screen-
|
||||
aligned quadrilaterals. If the four vertices of the quadrilateral
|
||||
are labeled A, B, C, and D, starting at the lower-left corner and moving
|
||||
counter-clockwise around the quadrilateral, then the vertex and
|
||||
texture coordinates are computed as follows:
|
||||
|
||||
vertex window coordinate texture coordinate
|
||||
A (x-r, y-r, z, w) (0, 0, r, q)
|
||||
B (x+r, y-r, z, w) (1, 0, r, q)
|
||||
C (x+r, y+r, z, w) (1, 1, r, q)
|
||||
D (x-r, y+r, z, w) (0, 1, r, q)
|
||||
|
||||
where x, y, z, w are the point's window coordinates, r and q are the
|
||||
point's 3rd and 4th texture coordinates and r is half the point's
|
||||
size. The other vertex attributes (such as the color and fog coordinate)
|
||||
are simply duplicated from the original point vertex.
|
||||
|
||||
Point size may either be specified with PointSize or computed
|
||||
according to the EXT_point_parameters extension.
|
||||
|
||||
The new texture coordinates are not effected by texgen or the texture
|
||||
matrix. Note, however, that the texture r and q coordinates are passed
|
||||
unchanged and may have been computed with texgen and/or the texture
|
||||
matrix.
|
||||
|
||||
If multiple texture units are present the same texture coordinate is
|
||||
used for all texture units.
|
||||
|
||||
The point is then rendered as if it were a quadrilateral using the
|
||||
normal point sampling rules. POLYGON_MODE does not effect the
|
||||
rasterization of the quadrilateral but POLYGON_SMOOTH does.
|
||||
|
||||
POINT_SMOOTH has no effect when SPRITE_POINT_MESA is enabled.
|
||||
|
||||
Additions to Chapter 4 of the 1.1 Specification (Per-Fragment Operations
|
||||
and the Frame Buffer)
|
||||
|
||||
None.
|
||||
|
||||
Additions to Chapter 5 of the 1.1 Specification (Special Functions)
|
||||
|
||||
None
|
||||
|
||||
Additions to Chapter 6 of the 1.1 Specification (State and State Requests)
|
||||
|
||||
None
|
||||
|
||||
Additions to the GLX Specification
|
||||
|
||||
None
|
||||
|
||||
GLX Protocol
|
||||
|
||||
TBD
|
||||
|
||||
Errors
|
||||
|
||||
None
|
||||
|
||||
New State
|
||||
|
||||
Add boolean variable SPRITE_POINT_MESA to the point attribute group.
|
||||
|
||||
Revision History
|
||||
|
||||
Version 1.0 - 4 Dec 2000
|
||||
Original draft.
|
||||
|
||||
|
||||
|
||||
360
docs/MESA_trace.spec
Normal file
360
docs/MESA_trace.spec
Normal file
@@ -0,0 +1,360 @@
|
||||
Name
|
||||
|
||||
MESA_trace
|
||||
|
||||
Name Strings
|
||||
|
||||
GL_MESA_TRACE
|
||||
|
||||
Contact
|
||||
|
||||
Bernd Kreimeier, Loki Entertainment, bk 'at' lokigames.com
|
||||
Brian Paul, VA Linux Systems, Inc., brianp 'at' valinux.com
|
||||
|
||||
Status
|
||||
|
||||
XXX - Not complete yet!!!
|
||||
|
||||
Version
|
||||
|
||||
$Id: MESA_trace.spec,v 1.2 2001/01/29 16:10:18 brianp Exp $
|
||||
|
||||
Number
|
||||
|
||||
none yet
|
||||
|
||||
Dependencies
|
||||
|
||||
OpenGL 1.2 is required.
|
||||
The extension is written against the OpenGL 1.2 Specification
|
||||
|
||||
Overview
|
||||
|
||||
Provides the application with means to enable and disable logging
|
||||
of GL calls including parameters as readable text. The verbosity
|
||||
of the generated log can be controlled. The resulting logs are
|
||||
valid (but possibly incomplete) C code and can be compiled and
|
||||
linked for standalone test programs. The set of calls and the
|
||||
amount of static data that is logged can be controlled at runtime.
|
||||
The application can add comments and enable or disable tracing of GL
|
||||
operations at any time. The data flow from the application to GL
|
||||
and back is unaffected except for timing.
|
||||
|
||||
Application-side implementation of these features raises namespace
|
||||
and linkage issues. In the driver dispatch table a simple
|
||||
"chain of responsibility" pattern (aka "composable piepline")
|
||||
can be added.
|
||||
|
||||
IP Status
|
||||
|
||||
The extension spec is in the public domain. The current implementation
|
||||
in Mesa is covered by Mesa's XFree86-style copyright by the authors above.
|
||||
This extension is partially inspired by the Quake2 QGL wrapper.
|
||||
|
||||
Issues
|
||||
|
||||
|
||||
(1) Is this Extension obsolete because it can
|
||||
be implemented as a wrapper DLL?
|
||||
|
||||
RESOLVED: No. While certain operating systems (Win32) provide linkers
|
||||
that facilitate this kind of solution, other operating systems
|
||||
(Linux) do not support hierarchical linking, so a wrapper solution
|
||||
would result in symbol collisions.
|
||||
Further, IHV's might have builtin support for tracing GL execution
|
||||
that enjoys privileged access, or that they do not wish to separate
|
||||
the tracing code from their driver code base.
|
||||
|
||||
(2) Should the Trace API explicitely support the notion of "frames?
|
||||
This would require hooking into glXSwapBuffers calls as well.
|
||||
|
||||
RESOLVED: No. The application can use NewTraceMESA/EndTraceMESA
|
||||
and TraceComment along with external parsing tools to split the
|
||||
trace into frames, in whatever way considered adequate.
|
||||
|
||||
(2a) Should GLX calls be traced?
|
||||
|
||||
PBuffers and other render-to-texture solutions demonstrate that
|
||||
context level commands beyond SwapBuffers might have to be
|
||||
traced. The GL DLL exports the entry points, so this would not
|
||||
be out of the question.
|
||||
|
||||
(3) Should the specification mandate the actual output format?
|
||||
|
||||
RESOLVED: No. It is sufficient to guarantee that all data and commands
|
||||
will be traced as requested by Enable/DisableTraceMESA, in the order
|
||||
encountered. Whether the resulting trace is available as a readable
|
||||
text file, binary metafile, compilable source code, much less which
|
||||
indentation and formatting has been used, is up to the implementation.
|
||||
For the same reason this specification does not enforce or prohibit
|
||||
additional information added to the trace (statistics, profiling/timing,
|
||||
warnings on possible error conditions).
|
||||
|
||||
(4) Should the comment strings associated with names and pointer (ranges)
|
||||
be considered persistent state?
|
||||
|
||||
RESOLVED: No. The implementation is not forced to use this information
|
||||
on subsequent occurences of name/pointer, and is free to consider it
|
||||
transient state.
|
||||
|
||||
(5) Should comment commands be prohibited between Begin/End?
|
||||
|
||||
RESOLVED: Yes, with the exception of TraceCommentMESA. TraceCommentMESA
|
||||
is transient, the other commands might cause storage of persistent
|
||||
data in the context. There is no need to have the ability mark names
|
||||
or pointers between Begin and End.
|
||||
|
||||
|
||||
New Procedures and Functions
|
||||
|
||||
void NewTraceMESA( bitfield mask, const ubyte * traceName )
|
||||
|
||||
void EndTraceMESA( void )
|
||||
|
||||
void EnableTraceMESA( bitfield mask )
|
||||
|
||||
void DisableTraceMESA( bitfield mask )
|
||||
|
||||
void TraceAssertAttribMESA( bitfield attribMask )
|
||||
|
||||
void TraceCommentMESA( const ubyte* comment )
|
||||
|
||||
void TraceTextureMESA( uint name, const ubyte* comment )
|
||||
|
||||
void TraceListMESA( uint name, const ubyte* comment )
|
||||
|
||||
void TracePointerMESA( void* pointer, const ubyte* comment )
|
||||
|
||||
void TracePointerRangeMESA( const void* first,
|
||||
const void* last,
|
||||
const ubyte* comment )
|
||||
|
||||
New Tokens
|
||||
|
||||
Accepted by the <mask> parameter of EnableTrace and DisableTrace:
|
||||
|
||||
TRACE_ALL_BITS_MESA 0xFFFF
|
||||
TRACE_OPERATIONS_BIT_MESA 0x0001
|
||||
TRACE_PRIMITIVES_BIT_MESA 0x0002
|
||||
TRACE_ARRAYS_BIT_MESA 0x0004
|
||||
TRACE_TEXTURES_BIT_MESA 0x0008
|
||||
TRACE_PIXELS_BIT_MESA 0x0010
|
||||
TRACE_ERRORS_BIT_MESA 0x0020
|
||||
|
||||
Accepted by the <pname> parameter of GetIntegerv, GetBooleanv,
|
||||
GetFloatv, and GetDoublev:
|
||||
|
||||
TRACE_MASK_MESA 0x8755
|
||||
|
||||
Accepted by the <pname> parameter to GetString:
|
||||
|
||||
TRACE_NAME_MESA 0x8756
|
||||
|
||||
|
||||
Additions to Chapter 2 of the OpenGL 1.2.1 Specification (OpenGL Operation)
|
||||
|
||||
None.
|
||||
|
||||
Additions to Chapter 3 of the OpenGL 1.2.1 Specification (OpenGL Operation)
|
||||
|
||||
None.
|
||||
|
||||
Additions to Chapter 4 of the OpenGL 1.2.1 Specification (OpenGL Operation)
|
||||
|
||||
None.
|
||||
|
||||
Additions to Chapter 5 of the OpenGL 1.2.1 Specification (Special Functions)
|
||||
|
||||
Add a new section:
|
||||
|
||||
5.7 Tracing
|
||||
|
||||
The tracing facility is used to record the execution of a GL program
|
||||
to a human-readable log. The log appears as a sequence of GL commands
|
||||
using C syntax. The primary intention of tracing is to aid in program
|
||||
debugging.
|
||||
|
||||
A trace is started with the command
|
||||
|
||||
void NewTraceMESA( bitfield mask, const GLubyte * traceName )
|
||||
|
||||
<mask> may be any value accepted by PushAttrib and specifies a set of
|
||||
attribute groups. The state values included in those attribute groups
|
||||
is written to the trace as a sequence of GL commands.
|
||||
|
||||
<traceName> specifies a name or label for the trace. It is expected
|
||||
that <traceName> will be interpreted as a filename in most implementations.
|
||||
|
||||
A trace is ended by calling the command
|
||||
|
||||
void EndTraceMESA( void )
|
||||
|
||||
It is illegal to call NewTraceMESA or EndTraceMESA between Begin and End.
|
||||
|
||||
The commands
|
||||
|
||||
void EnableTraceMESA( bitfield mask )
|
||||
void DisableTraceMESA( bitfield mask )
|
||||
|
||||
enable or disable tracing of different classes of GL commands.
|
||||
<mask> may be the union of any of TRACE_OPERATIONS_BIT_MESA,
|
||||
TRACE_PRIMITIVES_BIT_MESA, TRACE_ARRAYS_BIT_MESA, TRACE_TEXTURES_BIT_MESA,
|
||||
and TRACE_PIXELS_BIT_MESA. The special token TRACE_ALL_BITS_MESA
|
||||
indicates all classes of commands are to be logged.
|
||||
|
||||
TRACE_OPERATIONS_BIT_MESA controls logging of all commands outside of
|
||||
Begin/End, including Begin/End.
|
||||
|
||||
TRACE_PRIMITIVES_BIT_MESA controls logging of all commands inside of
|
||||
Begin/End, including Begin/End.
|
||||
|
||||
TRACE_ARRAYS_BIT_MESA controls logging of VertexPointer, NormalPointer,
|
||||
ColorPointer, IndexPointer, TexCoordPointer and EdgeFlagPointer commands.
|
||||
|
||||
TRACE_TEXTURES_BIT_MESA controls logging of texture data dereferenced by
|
||||
TexImage1D, TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D, and
|
||||
TexSubImage3D commands.
|
||||
|
||||
TRACE_PIXELS_BIT_MESA controls logging of image data dereferenced by
|
||||
Bitmap and DrawPixels commands.
|
||||
|
||||
TRACE_ERRORS_BIT_MESA controls logging of all errors. If this bit is
|
||||
set, GetError will be executed whereever applicable, and the result will
|
||||
be added to the trace as a comment. The error returns are cached and
|
||||
returned to the application on its GetError calls. If the user does not
|
||||
wish the additional GetError calls to be performed, this bit should not
|
||||
be set.
|
||||
|
||||
The command
|
||||
|
||||
void TraceCommentMESA( const ubyte* comment )
|
||||
|
||||
immediately adds the <comment> string to the trace output, surrounded
|
||||
by C-style comment delimiters.
|
||||
|
||||
The commands
|
||||
|
||||
void TraceTextureMESA( uint name, const ubyte* comment )
|
||||
void TraceListMESA( uint name, const ubyte* comment )
|
||||
|
||||
associates <comment> with the texture object or display list specified
|
||||
by <name>. Logged commands which reference the named texture object or
|
||||
display list will be annotated with <comment>. If IsTexture(name) or
|
||||
IsList(name) fail (respectively) the command is quietly ignored.
|
||||
|
||||
The commands
|
||||
|
||||
void TracePointerMESA( void* pointer, const ubyte* comment )
|
||||
|
||||
void TracePointerRangeMESA( const void* first,
|
||||
const void* last,
|
||||
const ubyte* comment )
|
||||
|
||||
associate <comment> with the address specified by <pointer> or with
|
||||
a range of addresses specified by <first> through <last>.
|
||||
Any logged commands which reference <pointer> or an address between
|
||||
<first> and <last> will be annotated with <comment>.
|
||||
|
||||
The command
|
||||
|
||||
void TraceAssertAttribMESA( bitfield attribMask )
|
||||
|
||||
will add GL state queries and assertion statements to the log to
|
||||
confirm that the current state at the time TraceAssertAttrib is
|
||||
executed matches the current state when the trace log is executed
|
||||
in the future.
|
||||
|
||||
<attribMask> is any value accepted by PushAttrib and specifies
|
||||
the groups of state variables which are to be asserted.
|
||||
|
||||
The commands NewTraceMESA, EndTraceMESA, EnableTraceMESA, DisableTraceMESA,
|
||||
TraceAssertAttribMESA, TraceCommentMESA, TraceTextureMESA, TraceListMESA,
|
||||
TracePointerMESA and TracePointerRangeMESA are not compiled into display lists.
|
||||
|
||||
|
||||
Examples:
|
||||
|
||||
The command NewTraceMESA(DEPTH_BUFFER_BIT, "log") will query the state
|
||||
variables DEPTH_TEST, DEPTH_FUNC, DEPTH_WRITEMASK, and DEPTH_CLEAR_VALUE
|
||||
to get the values <test>, <func>, <mask>, and <clear> respectively.
|
||||
Statements equivalent to the following will then be logged:
|
||||
|
||||
glEnable(GL_DEPTH_TEST); (if <test> is true)
|
||||
glDisable(GL_DEPTH_TEST); (if <test> is false)
|
||||
glDepthFunc(<func>);
|
||||
glDepthMask(<mask>);
|
||||
glClearDepth(<clear>);
|
||||
|
||||
|
||||
The command TraceAssertAttribMESA(DEPTH_BUFFER_BIT) will query the state
|
||||
variables DEPTH_TEST, DEPTH_FUNC, DEPTH_WRITEMASK, and DEPTH_CLEAR_VALUE
|
||||
to get the values <test>, <func>, <mask>, and <clear> respectively.
|
||||
The resulting trace might then look will like this:
|
||||
|
||||
{
|
||||
GLboolean b;
|
||||
GLint i;
|
||||
GLfloat f;
|
||||
b = glIsEnabled(GL_DEPTH_TEST);
|
||||
assert(b == <test>);
|
||||
glGetIntegerv(GL_DEPTH_FUNC, &i);
|
||||
assert(i == <func>);
|
||||
glGetIntegerv(GL_DEPTH_MASK, &i);
|
||||
assert(i == <mask>);
|
||||
glGetFloatv(GL_DEPTH_CLEAR_VALUE, &f);
|
||||
assert(f == <clear>);
|
||||
}
|
||||
|
||||
|
||||
Additions to Chapter 6 of the OpenGL 1.2.1 Specification
|
||||
(State and State Requests)
|
||||
|
||||
Querying TRACE_MASK_MESA with GetIntegerv, GetFloatv, GetBooleanv or
|
||||
GetDoublev returns the current command class trace mask.
|
||||
|
||||
Querying TRACE_NAME_MESA with GetString returns the current trace name.
|
||||
|
||||
|
||||
Additions to Appendix A of the OpenGL 1.2.1 Specification (Invariance)
|
||||
|
||||
The MESA_trace extension can be used in a way that does not affect data
|
||||
flow from application to OpenGL, as well as data flow from OpenGL to
|
||||
application, except for timing, possible print I/O. TRACE_ERRORS_BIT_MESA
|
||||
will add additional GetError queries. Setting a trace mask with NewTraceMESA
|
||||
as well as use of TraceAssertAttribMESA might cause additional state queries.
|
||||
With the possible exception of performance, OpenGL rendering should not be
|
||||
affected at all by a properly chosen logging operation.
|
||||
|
||||
Additions to the AGL/GLX/WGL Specifications
|
||||
|
||||
None.
|
||||
|
||||
GLX Protocol
|
||||
|
||||
None. The logging operation is carried out client-side, by exporting
|
||||
entry points to the wrapper functions that execute the logging operation.
|
||||
|
||||
Errors
|
||||
|
||||
INVALID_OPERATION is generated if any trace command except TraceCommentMESA
|
||||
is called between Begin and End.
|
||||
|
||||
New State
|
||||
|
||||
The current trace name and current command class mask are stored
|
||||
per-context.
|
||||
|
||||
New Implementation Dependent State
|
||||
|
||||
None.
|
||||
|
||||
Revision History
|
||||
|
||||
* Revision 0.1 - Initial draft from template (bk000415)
|
||||
* Revision 0.2 - Draft (bk000906)
|
||||
* Revision 0.3 - Draft (bk000913)
|
||||
* Revision 0.4 - Reworked text, fixed typos (bp000914)
|
||||
* Revision 0.5 - Assigned final GLenum values (bp001103)
|
||||
* Revision 0.6 - TRACE_ERRORS_BIT_MESA (bk000916)
|
||||
* Revision 0.7 - Added MESA postfix (bk010126)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
Mesa 3.3 Unix/X11 Information
|
||||
Mesa 3.5 Unix/X11 Information
|
||||
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ There are two ways to compile Mesa on Unix/X11 systems:
|
||||
|
||||
|
||||
The top-level makefile will execute the makefiles in a number of sub-
|
||||
directories. When finished, the Mesa libraries will be in the Mesa-3.3/lib/
|
||||
directories. When finished, the Mesa libraries will be in the Mesa-3.5/lib/
|
||||
directory. A few GLUT demos in the demos/ directory should be ready to run.
|
||||
|
||||
If you also downloaded and unpacked the demos there should be executables
|
||||
@@ -323,4 +323,4 @@ Summary of X-related environment variables:
|
||||
|
||||
|
||||
----------------------------------------------------------------------
|
||||
$Id: README.X11,v 3.5 2000/04/04 15:14:48 brianp Exp $
|
||||
$Id: README.X11,v 3.6 2001/06/20 19:02:48 brianp Exp $
|
||||
|
||||
22
docs/RELNOTES-3.4.1
Normal file
22
docs/RELNOTES-3.4.1
Normal file
@@ -0,0 +1,22 @@
|
||||
|
||||
Mesa 3.4.1 release notes
|
||||
|
||||
February 9, 2001
|
||||
|
||||
PLEASE READ!!!!
|
||||
|
||||
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
Mesa uses an even/odd version number scheme like the Linux kernel.
|
||||
Odd numbered versions (such as 3.3) designate new developmental releases.
|
||||
Even numbered versions (such as 3.4) designate stable releases.
|
||||
|
||||
Mesa 3.4.1 is a maintenance release that simply fixes bugs found since
|
||||
the Mesa 3.4 release. For details, see the VERSIONS file.
|
||||
|
||||
|
||||
----------------------------------------------------------------------
|
||||
$Id: RELNOTES-3.4.1,v 1.2 2001/05/23 14:45:01 brianp Exp $
|
||||
22
docs/RELNOTES-3.4.2
Normal file
22
docs/RELNOTES-3.4.2
Normal file
@@ -0,0 +1,22 @@
|
||||
|
||||
Mesa 3.4.2 release notes
|
||||
|
||||
May 17, 2001
|
||||
|
||||
PLEASE READ!!!!
|
||||
|
||||
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
Mesa uses an even/odd version number scheme like the Linux kernel.
|
||||
Odd numbered versions (such as 3.3) designate new developmental releases.
|
||||
Even numbered versions (such as 3.4) designate stable releases.
|
||||
|
||||
Mesa 3.4.2 is a maintenance release that simply fixes bugs found since
|
||||
the Mesa 3.4.1 release. For details, see the VERSIONS file.
|
||||
|
||||
|
||||
----------------------------------------------------------------------
|
||||
$Id: RELNOTES-3.4.2,v 1.2 2001/05/23 14:45:01 brianp Exp $
|
||||
228
docs/RELNOTES-3.5
Normal file
228
docs/RELNOTES-3.5
Normal file
@@ -0,0 +1,228 @@
|
||||
|
||||
Mesa 3.5 release notes
|
||||
|
||||
June 21, 2001
|
||||
|
||||
PLEASE READ!!!!
|
||||
|
||||
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
Mesa uses an even/odd version number scheme like the Linux kernel.
|
||||
Odd numbered versions (such as 3.5) designate new developmental releases.
|
||||
Even numbered versions (such as 3.4) designate stable releases.
|
||||
|
||||
The biggest change in Mesa 3.5 is a complete overhaul of the source
|
||||
code in order to make it more modular. This was driven by the DRI
|
||||
hardware drivers. It simplifies the DRI drivers and opens the door
|
||||
to hardware transform/clip/lighting (TCL). Keith Whitwell can take
|
||||
the credit for that.
|
||||
|
||||
|
||||
|
||||
Driver Support
|
||||
--------------
|
||||
|
||||
The device driver interface in Mesa 3.5 has changed a lot since Mesa 3.4
|
||||
Not all of the older Mesa drivers have been updated. Here's the status:
|
||||
|
||||
Driver Status
|
||||
---------------------- -----------
|
||||
XMesa (Xlib) updated
|
||||
OSMesa (off-screen) updated
|
||||
FX (3dfx Voodoo1/2) updated
|
||||
SVGA updated
|
||||
GGI not updated
|
||||
Windows/Win32 not updated
|
||||
DOS/DJGPP not updated
|
||||
BeOS not updated
|
||||
Allegro not updated
|
||||
D3D not updated
|
||||
DOS not updated
|
||||
|
||||
We're looking for volunteers to update the remaining drivers. Please
|
||||
post to the Mesa3d-dev mailing list if you can help.
|
||||
|
||||
|
||||
|
||||
GLU 1.3
|
||||
-------
|
||||
|
||||
Mesa 3.5 includes the SGI Sample Implementation (SI) GLU library.
|
||||
This version of GLU supports the GLU 1.3 specification. The old
|
||||
Mesa GLU library implemented the 1.1 specification. The SI GLU
|
||||
library should work much better.
|
||||
|
||||
You'll need a C++ compiler to compile the SI GLU library. This may
|
||||
be a problem on some systems.
|
||||
|
||||
|
||||
|
||||
New Extensions
|
||||
--------------
|
||||
|
||||
GL_EXT_convolution
|
||||
Adds image convolution to glRead/Copy/DrawPixels/TexImage.
|
||||
|
||||
GL_ARB_imaging
|
||||
This is the optional imaging subset of OpenGL 1.2.
|
||||
It's the GL_EXT_convolution, GL_HP_convolution_border_modes,
|
||||
GL_EXT_histogram, GL_EXT_color_table, GL_EXT_color_subtable
|
||||
GL_EXT_blend_color, GL_EXT_blend_minmax, GL_EXT_blend_subtract
|
||||
and GL_SGI_color_matrix extensions all rolled together.
|
||||
This is supported in all software renderers but not in all
|
||||
hardware drivers (3dfx for example).
|
||||
|
||||
GL_ARB_texture_compression
|
||||
This is supported in Mesa but only used by the 3dfx DRI drivers
|
||||
for Voodoo4 and later.
|
||||
|
||||
GL_ARB_texture_env_add
|
||||
This is identical to GL_EXT_texture_env_add.
|
||||
|
||||
GL_NV_blend_square
|
||||
Adds extra blend source and dest factors which allow squaring
|
||||
of color values.
|
||||
|
||||
GL_EXT_fog_coord
|
||||
Allows specification of a per-vertex fog coordinate instead of
|
||||
having fog always computed from the eye distance.
|
||||
|
||||
GL_EXT_secondary_color
|
||||
Allows specifying the secondary (specular) color for each vertex
|
||||
instead of getting it only from lighting in GL_SEPARATE_SPECULAR_COLOR
|
||||
mode.
|
||||
|
||||
GL_ARB_texture_env_combine
|
||||
Basically the same as GL_EXT_texture_env_combine
|
||||
|
||||
GL_ARB_texture_env_add extension
|
||||
Texture addition mode.
|
||||
|
||||
GL_ARB_texture_env_dot3 extension
|
||||
Dot product texture environment.
|
||||
|
||||
GL_ARB_texture_border_clamp
|
||||
Adds GL_CLAMP_TO_BORDER_ARB texture wrap mode
|
||||
|
||||
GL_SGIX_depth_texture, GL_SGIX_shadow and GL_SGIX_shadow_ambient
|
||||
Implements a shadow casting algorithm based on depth map textures
|
||||
|
||||
GL_SGIS_generate_mipmap
|
||||
Automatically generate lower mipmap images whenever the base mipmap
|
||||
image is changed with glTexImage, glCopyTexImage, etc.
|
||||
|
||||
|
||||
|
||||
libOSMesa.so
|
||||
------------
|
||||
|
||||
libOSMesa.so is a new library which contains the OSMesa interface for
|
||||
off-screen rendering. Apps which need the OSMesa interface should link
|
||||
with both -lOSMesa and -lGL. This change was made so that stand-alone
|
||||
Mesa works the same way as XFree86/DRI's libGL.
|
||||
|
||||
|
||||
|
||||
Device Driver Changes / Core Mesa Changes
|
||||
-----------------------------------------
|
||||
|
||||
The ctx->Driver.LogicOp() function has been removed. It used to
|
||||
be called during state update in order to determine if the driver
|
||||
could do glLogicOp() operations, and if not, set the SWLogicOpEnabled
|
||||
flag. Drivers should instead examine the LogicOp state themselves
|
||||
and choose specialized point, line, and triangle functions appropriately,
|
||||
or fall back to software rendering. The Xlib driver was the only driver
|
||||
to use this function. And since the Xlib driver no longer draws
|
||||
points, lines or triangles using Xlib, the LogicOp function isn't needed.
|
||||
|
||||
The ctx->Driver.Dither() function has been removed. Drivers should
|
||||
detect dither enable/disable via ctx->Driver.Enable() instead.
|
||||
|
||||
The ctx->Driver.IndexMask() and ctx->Driver.ColorMask() functions
|
||||
are now just called from glIndexMask and glColorMask like the other
|
||||
GL state-changing functions. They are no longer called from inside
|
||||
gl_update_state(). Also, they now return void. The change was made
|
||||
mostly for sake of uniformity.
|
||||
|
||||
The NEW_DRVSTATE[0123] flags have been removed. They weren't being used
|
||||
and are obsolete w.r.t. the way state updates are done in DRI drivers.
|
||||
|
||||
|
||||
Removed obsolete gl_create_visual() and gl_destroy_visual().
|
||||
|
||||
Renamed functions (new namespace):
|
||||
|
||||
old new
|
||||
gl_create_framebuffer _mesa_create_framebuffer
|
||||
gl_destroy_framebuffer _mesa_destroy_framebuffer
|
||||
gl_create_context _mesa_create_context
|
||||
gl_destroy_context _mesa_destroy_context
|
||||
gl_context_initialize _mesa_context_initialize
|
||||
gl_copy_context _mesa_copy_context
|
||||
gl_make_current _mesa_make_current
|
||||
gl_make_current2 _mesa_make_current2
|
||||
gl_get_current_context _mesa_get_current_context
|
||||
gl_flush_vb _mesa_flush_vb
|
||||
gl_warning _mesa_warning
|
||||
gl_compile_error _mesa_compile_error
|
||||
|
||||
|
||||
All the drivers have been updated, but not all of them have been
|
||||
tested since I can't test some platforms (DOS, Windows, Allegro, etc).
|
||||
|
||||
|
||||
X/Mesa Driver
|
||||
-------------
|
||||
|
||||
The source files for the X/Mesa driver in src/X have been renamed.
|
||||
The xmesa[1234].c files are gone. The new files are xm_api.c,
|
||||
xm_dd.c, xm_line.c, xm_span.c and xm_tri.c.
|
||||
|
||||
|
||||
|
||||
Multitexture
|
||||
------------
|
||||
|
||||
Eight texture units are now supported by default.
|
||||
|
||||
|
||||
|
||||
OpenGL SI related changes
|
||||
-------------------------
|
||||
|
||||
In an effort to make Mesa's internal interfaces more like the OpenGL
|
||||
SI interfaces, a number of changes have been made:
|
||||
|
||||
1. Importing the SI's glcore.h file which defines a number of
|
||||
interface structures like __GLimports and __GLexports.
|
||||
|
||||
2. Renamed "struct gl_context" to "struct __GLcontextRec".
|
||||
|
||||
3. Added __glCoreCreateContext() and __glCoreNopDispatch() functions.
|
||||
|
||||
4. The GLcontext member Visual is no longer a pointer.
|
||||
|
||||
5. New file: imports.c to setup default import functions for Mesa.
|
||||
|
||||
|
||||
|
||||
|
||||
16-bit color channels
|
||||
---------------------
|
||||
|
||||
There's experimental support for 16-bit color channels (64-bit pixels)
|
||||
in Mesa 3.5. Only the OSMesa interface can be used for 16-bit rendering.
|
||||
Type "make linux-osmesa16" in the top-level directory to build the
|
||||
special libOSMesa16.so library.
|
||||
|
||||
This hasn't been tested very thoroughly yet so please file bug reports
|
||||
if you have trouble.
|
||||
|
||||
In the future I hope to implement support for 32-bit, floating point
|
||||
color channels.
|
||||
|
||||
----------------------------------------------------------------------
|
||||
$Id: RELNOTES-3.5,v 1.14 2001/06/20 19:02:48 brianp Exp $
|
||||
123
docs/VERSIONS
123
docs/VERSIONS
@@ -1,4 +1,4 @@
|
||||
$Id: VERSIONS,v 1.38 2000/07/21 15:41:59 brianp Exp $
|
||||
$Id: VERSIONS,v 1.60 2001/06/20 19:02:48 brianp Exp $
|
||||
|
||||
|
||||
Mesa Version History
|
||||
@@ -746,3 +746,124 @@ Mesa Version History
|
||||
- gl.h now uses #defines instead of C enums for all tokens
|
||||
- glu.h now uses #defines instead of C enums for all tokens
|
||||
- moved programs from 3Dfx/demos/ into demos/ directory
|
||||
|
||||
|
||||
3.4 November 3, 2000
|
||||
New:
|
||||
- optimized glDrawPixels for glPixelZoom(1,-1)
|
||||
Bug Fixes:
|
||||
- widgets-mesa/src/*.c files were missing from 3.3 distro
|
||||
- include/GL/mesa_wgl.h file was missing from 3.3 distro
|
||||
- fixed some Win32 compile problems
|
||||
- texture object priorities weren't getting initialized to 1.0
|
||||
- glAreTexturesResident return value was wrong when using hardware
|
||||
- glXUseXFont segfaulted when using 3dfx driver (via MESA_GLX_FX)
|
||||
- glReadPixels with GLushort packed types was broken
|
||||
- fixed a few bugs in the GL_EXT_texture_env_combine texture code
|
||||
- glPush/PopAttrib(GL_ENABLE_BIT) mishandled multi-texture enables
|
||||
- fixed some typos/bugs in the VB code
|
||||
- glDrawPixels(GL_COLOR_INDEX) to RGB window didn't work
|
||||
- optimized glDrawPixels paths weren't being used
|
||||
- per-fragment fog calculation didn't work without a Z buffer
|
||||
- improved blending accuracy, fixes Glean blendFunc test failures
|
||||
- glPixelStore(GL_PACK/UNPACK_SKIP_IMAGES) wasn't handled correctly
|
||||
- glXGetProcAddressARB() didn't always return the right address
|
||||
- gluBuild[12]DMipmaps() didn't grok the GL_BGR pixel format
|
||||
- texture matrix changes weren't always detected (GLUT projtex demo)
|
||||
- fixed random color problem in vertex fog code
|
||||
- fixed Glide-related bug that let Quake get a 24-bit Z buffer
|
||||
Changes:
|
||||
- finished internal support for compressed textures for DRI
|
||||
|
||||
|
||||
3.4.1 February 14, 2001
|
||||
New:
|
||||
- fixed some Linux build problems
|
||||
- fixed some Windows build problems
|
||||
- GL_EXT_texture_env_dot3 extension (Gareth Hughes)
|
||||
Bug fixes:
|
||||
- added RENDER_START/RENDER_FINISH macros for glCopyTexImage in DRI
|
||||
- various state-update code changes needed for DRI bugs
|
||||
- disabled pixel transfer ops in glColorTable commands, not needed
|
||||
- fixed bugs in glCopyConvolutionFilter1D/2D, glGetConvolutionFilter
|
||||
- updated sources and fixed compile problems in widgets-mesa/
|
||||
- GLX_PBUFFER enum value was wrong in glx.h
|
||||
- fixed a glColorMaterial lighting bug
|
||||
- fixed bad args to Read/WriteStencilSpan in h/w stencil clear function
|
||||
- glXCopySubBufferMESA() Y position was off by one
|
||||
- Error checking of glTexSubImage3D() was broken (bug 128775)
|
||||
- glPopAttrib() didn't restore all derived Mesa state correctly
|
||||
- Better glReadPixels accuracy for 16bpp color - fixes lots of OpenGL
|
||||
conformance problems at 16bpp.
|
||||
- clearing depth buffer with scissoring was broken, would segfault
|
||||
- OSMesaGetDepthBuffer() returned bad bytesPerValue value
|
||||
- fixed a line clipping bug (reported by Craig McDaniel)
|
||||
- fixed RGB color over/underflow bug for very tiny triangles
|
||||
Known problems:
|
||||
- NURBS or evaluator surfaces inside display lists don't always work
|
||||
|
||||
|
||||
3.4.2 May 17, 2001
|
||||
Bug fixes:
|
||||
- deleting the currently bound texture could cause bad problems
|
||||
- using fog could result in random vertex alpha values
|
||||
- AA triangle rendering could touch pixels outside right window bound
|
||||
- fixed byteswapping problem in clear_32bit_ximage() function
|
||||
- fixed bugs in wglUseFontBitmapsA(), by Frank Warmerdam
|
||||
- fixed memory leak in glXUseXFont()
|
||||
- fragment sampling in AA triangle function was off by 1/2 pixel
|
||||
- Windows: reading pixels from framebuffer didn't always work
|
||||
- glConvolutionFilter2D could segfault or cause FP exception
|
||||
- fixed segfaults in FX and X drivers when using tex unit 1 but not 0
|
||||
- GL_NAND logicop didn't work right in RGBA mode
|
||||
- fixed a memory corruption bug in vertex buffer reset code
|
||||
- clearing the softwara alpha buffer with scissoring was broken
|
||||
- fixed a few color index mode fog bugs
|
||||
- fixed some bad assertions in color index mode
|
||||
- fixed FX line 'stipple' bug #420091
|
||||
- fixed stencil buffer clear width/height typo
|
||||
- fixed GL error glitches in gl[Client]ActiveTextureARB()
|
||||
- fixed Windows compilation problem in texutil.c
|
||||
- fixed 1/8-pixel AA triangle sampling error
|
||||
Changes:
|
||||
- optimized writing mono-colored pixel spans to X pixmaps
|
||||
- increased max viewport size to 2048 x 2048
|
||||
|
||||
|
||||
3.5 June 21, 2001
|
||||
New:
|
||||
- internals of Mesa divided into modular pieces (Keith Whitwell)
|
||||
- 100% OpenGL 1.2 conformance (passes all conformance tests)
|
||||
- new AA line algorithm
|
||||
- GL_EXT_convolution extension
|
||||
- GL_ARB_imaging subset
|
||||
- OSMesaCreateContextExt() function
|
||||
- GL_ARB_texture_env_add extension (same as GL_EXT_texture_env_add)
|
||||
- GL_MAX_TEXTURE_UNITS_ARB now defaults to eight
|
||||
- GL_EXT_fog_coord extension (Keith Whitwell)
|
||||
- GL_EXT_secondary_color extension (Keith Whitwell)
|
||||
- GL_ARB_texture_env_add extension (same as GL_EXT_texture_env_add)
|
||||
- GL_SGIX_depth_texture extension
|
||||
- GL_SGIX_shadow and GL_SGIX_shadow_ambient extensions
|
||||
- demos/shadowtex.c demo of GL_SGIX_depth_texture and GL_SGIX_shadow
|
||||
- GL_ARB_texture_env_combine extension
|
||||
- GL_ARB_texture_env_dot3 extension
|
||||
- GL_ARB_texture_border_clamp (aka GL_SGIS_texture_border_clamp)
|
||||
- OSMesaCreateContextExt() function
|
||||
- libOSMesa.so library, contains the OSMesa driver interface
|
||||
- GL/glxext.h header file for GLX extensions
|
||||
- somewhat faster software texturing, fogging, depth testing
|
||||
- all color-index conformance tests now pass (only 8bpp tested)
|
||||
- SPARC assembly language TCL optimizations (David Miller)
|
||||
- GL_SGIS_generate_mipmap extension
|
||||
Bug Fixes:
|
||||
- fbiRev and tmuRev were unitialized when using Glide3
|
||||
- fixed a few color index mode conformance failures; all pass now
|
||||
- now appling antialiasing coverage to alpha after texturing
|
||||
- colors weren't getting clamped to [0,1] before color table lookup
|
||||
- fixed RISC alignment errors caused by COPY_4UBV macro
|
||||
- drawing wide, flat-shaded lines could cause a segfault
|
||||
- vertices now snapped to 1/16 pixel to fix rendering of tiny triangles
|
||||
Changes:
|
||||
- SGI's Sample Implementation (SI) 1.3 GLU library replaces Mesa GLU
|
||||
- new libOSMesa.so library, contains the OSMesa driver interface
|
||||
|
||||
@@ -2,33 +2,42 @@
|
||||
|
||||
GLincludedir = $(includedir)/GL
|
||||
|
||||
if HAVE_FX
|
||||
INC_FX = fxmesa.h
|
||||
INC_GGI = ggimesa.h
|
||||
INC_OSMESA = osmesa.h
|
||||
INC_SVGA = svgamesa.h
|
||||
INC_X11 = glx.h glxext.h glx_mangle.h xmesa.h xmesa_x.h xmesa_xf86.h
|
||||
INC_GLUT = glut.h glutf90.h
|
||||
|
||||
if HAVE_FX
|
||||
sel_inc_fx = $(INC_FX)
|
||||
endif
|
||||
|
||||
if HAVE_GGI
|
||||
INC_GGI = ggimesa.h
|
||||
sel_inc_ggi = $(INC_GGI)
|
||||
endif
|
||||
|
||||
if HAVE_OSMESA
|
||||
INC_OSMESA = osmesa.h
|
||||
sel_inc_osmesa = $(INC_OSMESA)
|
||||
endif
|
||||
|
||||
if HAVE_SVGA
|
||||
INC_SVGA = svgamesa.h
|
||||
sel_inc_svga = $(INC_SVGA)
|
||||
endif
|
||||
|
||||
if HAVE_X11
|
||||
INC_X11 = glx.h glx_mangle.h xmesa.h xmesa_x.h xmesa_xf86.h
|
||||
sel_inc_x11 = $(INC_X11)
|
||||
endif
|
||||
|
||||
if NEED_GLUT
|
||||
INC_GLUT = glut.h
|
||||
sel_inc_glut = $(INC_GLUT)
|
||||
endif
|
||||
|
||||
EXTRA_DIST = fxmesa.h ggimesa.h osmesa.h svgamesa.h \
|
||||
glx.h glx_mangle.h xmesa.h xmesa_x.h xmesa_xf86.h
|
||||
|
||||
GLinclude_HEADERS = gl.h gl_mangle.h glu.h glu_mangle.h \
|
||||
EXTRA_HEADERS = amesa.h dosmesa.h foomesa.h glut_h.dja mesa_wgl.h mglmesa.h \
|
||||
vms_x_fix.h wmesa.h \
|
||||
$(INC_FX) $(INC_GGI) $(INC_OSMESA) $(INC_SVGA) $(INC_X11) $(INC_GLUT)
|
||||
|
||||
GLinclude_HEADERS = gl.h glext.h gl_mangle.h glu.h glu_mangle.h \
|
||||
$(sel_inc_fx) $(sel_inc_ggi) $(sel_inc_osmesa) $(sel_inc_svga) \
|
||||
$(sel_inc_x11) $(sel_inc_glut)
|
||||
include $(top_srcdir)/common_rules.make
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/* $Id: fxmesa.h,v 1.2 1999/11/24 18:44:53 brianp Exp $ */
|
||||
/* $Id: fxmesa.h,v 1.3 2001/06/20 19:52:11 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.3
|
||||
* Copyright (C) 1995-1999 Brian Paul
|
||||
* Copyright (C) 1995-2001 Brian Paul
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
@@ -41,7 +41,7 @@ extern "C" {
|
||||
|
||||
|
||||
#define FXMESA_MAJOR_VERSION 3
|
||||
#define FXMESA_MINOR_VERSION 3
|
||||
#define FXMESA_MINOR_VERSION 5
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/* $Id: gl.h,v 1.44 2000/07/13 17:45:13 brianp Exp $ */
|
||||
/* $Id: gl.h,v 1.57 2001/06/14 21:37:43 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.3
|
||||
* Version: 3.5
|
||||
*
|
||||
* Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
|
||||
*
|
||||
@@ -44,11 +44,11 @@
|
||||
#define OPENSTEP
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) && !defined(__WIN32__)
|
||||
#if defined(_WIN32) && !defined(__WIN32__) && !defined(__CYGWIN__)
|
||||
#define __WIN32__
|
||||
#endif
|
||||
|
||||
#if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN__))
|
||||
#if !defined(OPENSTEP) && (defined(__WIN32__) && !defined(__CYGWIN__))
|
||||
# if defined(_MSC_VER) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */
|
||||
# define GLAPI __declspec(dllexport)
|
||||
# elif defined(_MSC_VER) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
|
||||
@@ -63,7 +63,7 @@
|
||||
# define GLAPIENTRY
|
||||
#endif /* WIN32 / CYGWIN bracket */
|
||||
|
||||
#if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP)
|
||||
#if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP) && !defined(__CYGWIN__)
|
||||
#include <gl/mesa_wgl.h>
|
||||
#endif
|
||||
|
||||
@@ -84,7 +84,7 @@ extern "C" {
|
||||
|
||||
#define GL_VERSION_1_1 1
|
||||
#define GL_VERSION_1_2 1
|
||||
|
||||
#define GL_ARB_imaging 1
|
||||
|
||||
|
||||
/*
|
||||
@@ -325,12 +325,12 @@ typedef double GLclampd; /* double precision float in [0,1] */
|
||||
#define GL_ONE 0x1
|
||||
#define GL_SRC_COLOR 0x0300
|
||||
#define GL_ONE_MINUS_SRC_COLOR 0x0301
|
||||
#define GL_DST_COLOR 0x0306
|
||||
#define GL_ONE_MINUS_DST_COLOR 0x0307
|
||||
#define GL_SRC_ALPHA 0x0302
|
||||
#define GL_ONE_MINUS_SRC_ALPHA 0x0303
|
||||
#define GL_DST_ALPHA 0x0304
|
||||
#define GL_ONE_MINUS_DST_ALPHA 0x0305
|
||||
#define GL_DST_COLOR 0x0306
|
||||
#define GL_ONE_MINUS_DST_COLOR 0x0307
|
||||
#define GL_SRC_ALPHA_SATURATE 0x0308
|
||||
#define GL_CONSTANT_COLOR 0x8001
|
||||
#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
|
||||
@@ -745,7 +745,7 @@ typedef double GLclampd; /* double precision float in [0,1] */
|
||||
|
||||
|
||||
/*
|
||||
* OpenGL 1.2 imaging subset (NOT IMPLEMENTED BY MESA)
|
||||
* OpenGL 1.2 imaging subset
|
||||
*/
|
||||
/* GL_EXT_color_table */
|
||||
#define GL_COLOR_TABLE 0x80D0
|
||||
@@ -852,7 +852,7 @@ typedef double GLclampd; /* double precision float in [0,1] */
|
||||
#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001
|
||||
#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002
|
||||
#define GL_ALL_CLIENT_ATTRIB_BITS 0xFFFFFFFF
|
||||
|
||||
#define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF
|
||||
|
||||
|
||||
|
||||
@@ -1270,7 +1270,7 @@ GLAPI void GLAPIENTRY glTexCoordPointer( GLint size, GLenum type,
|
||||
|
||||
GLAPI void GLAPIENTRY glEdgeFlagPointer( GLsizei stride, const GLvoid *ptr );
|
||||
|
||||
GLAPI void GLAPIENTRY glGetPointerv( GLenum pname, void **params );
|
||||
GLAPI void GLAPIENTRY glGetPointerv( GLenum pname, GLvoid **params );
|
||||
|
||||
GLAPI void GLAPIENTRY glArrayElement( GLint i );
|
||||
|
||||
@@ -1591,7 +1591,7 @@ GLAPI void GLAPIENTRY glDrawRangeElements( GLenum mode, GLuint start,
|
||||
GLuint end, GLsizei count, GLenum type, const GLvoid *indices );
|
||||
|
||||
GLAPI void GLAPIENTRY glTexImage3D( GLenum target, GLint level,
|
||||
GLint internalFormat,
|
||||
GLenum internalFormat,
|
||||
GLsizei width, GLsizei height,
|
||||
GLsizei depth, GLint border,
|
||||
GLenum format, GLenum type,
|
||||
@@ -1971,7 +1971,7 @@ GLAPI void GLAPIENTRY glTexCoordPointerEXT( GLint size, GLenum type, GLsizei str
|
||||
|
||||
GLAPI void GLAPIENTRY glEdgeFlagPointerEXT( GLsizei stride, GLsizei count, const GLboolean *ptr );
|
||||
|
||||
GLAPI void GLAPIENTRY glGetPointervEXT( GLenum pname, void **params );
|
||||
GLAPI void GLAPIENTRY glGetPointervEXT( GLenum pname, GLvoid **params );
|
||||
|
||||
GLAPI void GLAPIENTRY glArrayElementEXT( GLint i );
|
||||
|
||||
@@ -2228,6 +2228,19 @@ GLAPI void GLAPIENTRY glResizeBuffersMESA( void );
|
||||
#endif /* GL_MESA_resize_bufffers */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* 220. GL_EXT_texture_env_dot3
|
||||
*/
|
||||
#ifndef GL_EXT_texture_env_dot3
|
||||
#define GL_EXT_texture_env_dot3 1
|
||||
|
||||
#define GL_DOT3_RGB_EXT 0x8740
|
||||
#define GL_DOT3_RGBA_EXT 0x8741
|
||||
|
||||
#endif /* GL_EXT_texture_env_dot3 */
|
||||
|
||||
|
||||
#else /* GL_GLEXT_LEGACY */
|
||||
|
||||
#include <GL/glext.h>
|
||||
@@ -2236,6 +2249,64 @@ GLAPI void GLAPIENTRY glResizeBuffersMESA( void );
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* ???. GL_MESA_trace
|
||||
* XXX this should go into glext.h at some point
|
||||
*/
|
||||
#ifndef GL_MESA_trace
|
||||
#define GL_MESA_trace 1
|
||||
|
||||
#define GL_TRACE_ALL_BITS_MESA 0xFFFF
|
||||
#define GL_TRACE_OPERATIONS_BIT_MESA 0x0001
|
||||
#define GL_TRACE_PRIMITIVES_BIT_MESA 0x0002
|
||||
#define GL_TRACE_ARRAYS_BIT_MESA 0x0004
|
||||
#define GL_TRACE_TEXTURES_BIT_MESA 0x0008
|
||||
#define GL_TRACE_PIXELS_BIT_MESA 0x0010
|
||||
#define GL_TRACE_ERRORS_BIT_MESA 0x0020
|
||||
#define GL_TRACE_MASK_MESA 0x8755
|
||||
#define GL_TRACE_NAME_MESA 0x8756
|
||||
|
||||
GLAPI void GLAPIENTRY glEnableTraceMESA( GLbitfield mask );
|
||||
GLAPI void GLAPIENTRY glDisableTraceMESA( GLbitfield mask );
|
||||
GLAPI void GLAPIENTRY glNewTraceMESA( GLbitfield mask, const GLubyte * traceName );
|
||||
GLAPI void GLAPIENTRY glEndTraceMESA( void );
|
||||
GLAPI void GLAPIENTRY glTraceAssertAttribMESA( GLbitfield attribMask );
|
||||
GLAPI void GLAPIENTRY glTraceCommentMESA( const GLubyte * comment );
|
||||
GLAPI void GLAPIENTRY glTraceTextureMESA( GLuint name, const GLubyte* comment );
|
||||
GLAPI void GLAPIENTRY glTraceListMESA( GLuint name, const GLubyte* comment );
|
||||
GLAPI void GLAPIENTRY glTracePointerMESA( GLvoid* pointer, const GLubyte* comment );
|
||||
GLAPI void GLAPIENTRY glTracePointerRangeMESA( const GLvoid* first, const GLvoid* last, const GLubyte* comment );
|
||||
|
||||
#endif /* GL_MESA_trace */
|
||||
|
||||
|
||||
/*
|
||||
* ???. GL_MESA_packed_depth_stencil
|
||||
* XXX this will be in glext.h someday
|
||||
*/
|
||||
#ifndef GL_MESA_packed_depth_stencil
|
||||
#define GL_MESA_packed_depth_stencil 1
|
||||
|
||||
#define GL_DEPTH_STENCIL_MESA 0x8750
|
||||
#define GL_UNSIGNED_INT_24_8_MESA 0x8751
|
||||
#define GL_UNSIGNED_INT_8_24_REV_MESA 0x8752
|
||||
#define GL_UNSIGNED_SHORT_15_1_MESA 0x8753
|
||||
#define GL_UNSIGNED_SHORT_1_15_REV_MESA 0x8754
|
||||
|
||||
#endif /* GL_MESA_packed_depth_stencil */
|
||||
|
||||
|
||||
/*
|
||||
* ??. GL_MESA_sprite_point
|
||||
*/
|
||||
#ifndef GL_MESA_sprite_point
|
||||
#define GL_MESA_sprite_point 1
|
||||
|
||||
#define GL_SPRITE_POINT_MESA 0x8757 /* XXX not finalized! */
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* Begin system-specific stuff
|
||||
*/
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/* $Id: gl_mangle.h,v 1.4 2000/01/04 08:07:09 brianp Exp $ */
|
||||
/* $Id: gl_mangle.h,v 1.6 2001/04/19 22:33:03 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.3
|
||||
* Version: 3.5
|
||||
*
|
||||
* Copyright (C) 1999 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -535,5 +535,145 @@
|
||||
#define glCopyColorTable mglCopyColorTable
|
||||
#define glLockArraysEXT mglLockArraysEXT
|
||||
#define glUnlockArraysEXT mglUnlockArraysEXT
|
||||
#define glGetFinalCombinerInputParameterivNV mglGetFinalCombinerInputParameterivNV
|
||||
#define glGetFinalCombinerInputParameterfvNV mglGetFinalCombinerInputParameterfvNV
|
||||
#define glGetCombinerOutputParameterivNV mglGetCombinerOutputParameterivNV
|
||||
#define glGetCombinerOutputParameterfvNV mglGetCombinerOutputParameterfvNV
|
||||
#define glGetCombinerInputParameterivNV mglGetCombinerInputParameterivNV
|
||||
#define glGetCombinerInputParameterfvNV mglGetCombinerInputParameterfvNV
|
||||
#define glFinalCombinerInputNV mglFinalCombinerInputNV
|
||||
#define glCombinerOutputNV mglCombinerOutputNV
|
||||
#define glCombinerInputNV mglCombinerInputNV
|
||||
#define glCombinerParameteriNV mglCombinerParameteriNV
|
||||
#define glCombinerParameterivNV mglCombinerParameterivNV
|
||||
#define glCombinerParameterfNV mglCombinerParameterfNV
|
||||
#define glCombinerParameterfvNV mglCombinerParameterfvNV
|
||||
#define glVertexArrayRangeNV mglVertexArrayRangeNV
|
||||
#define glFlushVertexArrayRangeNV mglFlushVertexArrayRangeNV
|
||||
#define glVertexWeightPointerEXT mglVertexWeightPointerEXT
|
||||
#define glVertexWeightfvEXT mglVertexWeightfvEXT
|
||||
#define glVertexWeightfEXT mglVertexWeightfEXT
|
||||
#define glBlendFuncSeparateEXT mglBlendFuncSeparateEXT
|
||||
#define glFogCoordPointerEXT mglFogCoordPointerEXT
|
||||
#define glFogCoorddEXT mglFogCoorddEXT
|
||||
#define glFogCoordfvEXT mglFogCoordfvEXT
|
||||
#define glFogCoordfEXT mglFogCoordfEXT
|
||||
#define glLightEnviSGIX mglLightEnviSGIX
|
||||
#define glGetFragmentMaterialivSGIX mglGetFragmentMaterialivSGIX
|
||||
#define glGetFragmentMaterialfvSGIX mglGetFragmentMaterialfvSGIX
|
||||
#define glGetFragmentLightivSGIX mglGetFragmentLightivSGIX
|
||||
#define glGetFragmentLightfvSGIX mglGetFragmentLightfvSGIX
|
||||
#define glFragmentMaterialivSGIX mglFragmentMaterialivSGIX
|
||||
#define glFragmentMaterialiSGIX mglFragmentMaterialiSGIX
|
||||
#define glFragmentMaterialfvSGIX mglFragmentMaterialfvSGIX
|
||||
#define glFragmentMaterialfSGIX mglFragmentMaterialfSGIX
|
||||
#define glFragmentLightModelivSGIX mglFragmentLightModelivSGIX
|
||||
#define glFragmentLightModeliSGIX mglFragmentLightModeliSGIX
|
||||
#define glFragmentLightModelfvSGIX mglFragmentLightModelfvSGIX
|
||||
#define glFragmentLightModelfSGIX mglFragmentLightModelfSGIX
|
||||
#define glFragmentLightivSGIX mglFragmentLightivSGIX
|
||||
#define glFragmentLightiSGIX mglFragmentLightiSGIX
|
||||
#define glFragmentLightfvSGIX mglFragmentLightfvSGIX
|
||||
#define glFragmentLightfSGIX mglFragmentLightfSGIX
|
||||
#define glFragmentColorMaterialSGIX mglFragmentColorMaterialSGIX
|
||||
#define glCullParameterdvEXT mglCullParameterdvEXT
|
||||
#define glCullParameterfvEXT mglCullParameterfvEXT
|
||||
#define glIndexFuncEXT mglIndexFuncEXT
|
||||
#define glIndexMaterialEXT mglIndexMaterialEXT
|
||||
#define glListParameterivSGIX mglListParameterivSGIX
|
||||
#define glListParameteriSGIX mglListParameteriSGIX
|
||||
#define glListParameterfvSGIX mglListParameterfvSGIX
|
||||
#define glListParameterfSGIX mglListParameterfSGIX
|
||||
#define glGetListParameterivSGIX mglGetListParameterivSGIX
|
||||
#define glGetListParameterfvSGIX mglGetListParameterfvSGIX
|
||||
#define glHintPGI mglHintPGI
|
||||
#define glCopyColorSubTableEXT mglCopyColorSubTableEXT
|
||||
#define glFlushRasterSGIX mglFlushRasterSGIX
|
||||
#define glReferencePlaneSGIX mglReferencePlaneSGIX
|
||||
#define glTagSampleBufferSGIX mglTagSampleBufferSGIX
|
||||
#define glFrameZoomSGIX mglFrameZoomSGIX
|
||||
#define glGetInstrumentsSGIX mglGetInstrumentsSGIX
|
||||
#define glPollInstrumentsSGIX mglPollInstrumentsSGIX
|
||||
#define glReadInstrumentsSGIX mglReadInstrumentsSGIX
|
||||
#define glStopInstrumentsSGIX mglStopInstrumentsSGIX
|
||||
#define glStartInstrumentsSGIX mglStartInstrumentsSGIX
|
||||
#define glInstrumentsBufferSGIX mglInstrumentsBufferSGIX
|
||||
#define glPointParameterfvSGIS mglPointParameterfvSGIS
|
||||
#define glPointParameterfSGIS mglPointParameterfSGIS
|
||||
#define glSpriteParameterivSGIX mglSpriteParameterivSGIX
|
||||
#define glSpriteParameteriSGIX mglSpriteParameteriSGIX
|
||||
#define glSpriteParameterfvSGIX mglSpriteParameterfvSGIX
|
||||
#define glSpriteParameterfSGIX mglSpriteParameterfSGIX
|
||||
#define glSamplePatternSGIS mglSamplePatternSGIS
|
||||
#define glSampleMaskSGIS mglSampleMaskSGIS
|
||||
#define glSharpenTexFuncSGIS mglSharpenTexFuncSGIS
|
||||
#define glGetSharpenTexFuncSGIS mglGetSharpenTexFuncSGIS
|
||||
#define glGetDetailTexFuncSGIS mglGetDetailTexFuncSGIS
|
||||
#define glDetailTexFuncSGIS mglDetailTexFuncSGIS
|
||||
#define glTexSubImage4DSGIS mglTexSubImage4DSGIS
|
||||
#define glTexImage4DSGIS mglTexImage4DSGIS
|
||||
#define glGetPixelTexGenParameterivSGIS mglGetPixelTexGenParameterivSGIS
|
||||
#define glGetPixelTexGenParameterfvSGIS mglGetPixelTexGenParameterfvSGIS
|
||||
#define glPixelTexGenParameteriSGIS mglPixelTexGenParameteriSGIS
|
||||
#define glPixelTexGenParameterfSGIS mglPixelTexGenParameterfSGIS
|
||||
#define glGetColorTableParameterivSGI mglGetColorTableParameterivSGI
|
||||
#define glGetColorTableParameterfvSGI mglGetColorTableParameterfvSGI
|
||||
#define glGetColorTableSGI mglGetColorTableSGI
|
||||
#define glCopyColorTableSGI mglCopyColorTableSGI
|
||||
#define glColorTableParameterivSGI mglColorTableParameterivSGI
|
||||
#define glColorTableParameterfvSGI mglColorTableParameterfvSGI
|
||||
#define glColorTableSGI mglColorTableSGI
|
||||
#define glSeparableFilter2DEXT mglSeparableFilter2DEXT
|
||||
#define glGetSeparableFilterEXT mglGetSeparableFilterEXT
|
||||
#define glGetConvolutionParameterfvEXT mglGetConvolutionParameterfvEXT
|
||||
#define glGetConvolutionParameterivEXT mglGetConvolutionParameterivEXT
|
||||
#define glGetConvolutionFilterEXT mglGetConvolutionFilterEXT
|
||||
#define glCopyConvolutionFilter2DEXT mglCopyConvolutionFilter2DEXT
|
||||
#define glCopyConvolutionFilter1DEXT mglCopyConvolutionFilter1DEXT
|
||||
#define glConvolutionParameterivEXT mglConvolutionParameterivEXT
|
||||
#define glConvolutionParameteriEXT mglConvolutionParameteriEXT
|
||||
#define glConvolutionParameterfvEXT mglConvolutionParameterfvEXT
|
||||
#define glConvolutionParameterfEXT mglConvolutionParameterfEXT
|
||||
#define glConvolutionFilter2DEXT mglConvolutionFilter2DEXT
|
||||
#define glConvolutionFilter1DEXT mglConvolutionFilter1DEXT
|
||||
#define glResetMinmaxEXT mglResetMinmaxEXT
|
||||
#define glResetHistogramEXT mglResetHistogramEXT
|
||||
#define glMinmaxEXT mglMinmaxEXT
|
||||
#define glHistogramEXT mglHistogramEXT
|
||||
#define glGetMinmaxParameterivEXT mglGetMinmaxParameterivEXT
|
||||
#define glGetMinmaxParameterfvEXT mglGetMinmaxParameterfvEXT
|
||||
#define glGetMinmaxEXT mglGetMinmaxEXT
|
||||
#define glGetHistogramParameterivEXT mglGetHistogramParameterivEXT
|
||||
#define glGetHistogramParameterfvEXT mglGetHistogramParameterfvEXT
|
||||
#define glGetHistogramEXT mglGetHistogramEXT
|
||||
#define glCopyTexSubImage2DEXT mglCopyTexSubImage2DEXT
|
||||
#define glCopyTexSubImage1DEXT mglCopyTexSubImage1DEXT
|
||||
#define glCopyTexImage2DEXT mglCopyTexImage2DEXT
|
||||
#define glCopyTexImage1DEXT mglCopyTexImage1DEXT
|
||||
#define glTexSubImage2DEXT mglTexSubImage2DEXT
|
||||
#define glTexSubImage1DEXT mglTexSubImage1DEXT
|
||||
#define glSampleCoverageARB mglSampleCoverageARB
|
||||
#define glSamplePassARB mglSamplePassARB
|
||||
#define glMultTransposeMatrixfARB mglMultTransposeMatrixfARB
|
||||
#define glMultTransposeMatrixdARB mglMultTransposeMatrixdARB
|
||||
#define glLoadTransposeMatrixfARB mglLoadTransposeMatrixfARB
|
||||
#define glLoadTransposeMatrixdARB mglLoadTransposeMatrixdARB
|
||||
#define glSecondaryColor3fEXT mglSecondaryColor3fEXT
|
||||
#define glSecondaryColor3ubEXT mglSecondaryColor3ubEXT
|
||||
#define glSecondaryColor3uivEXT mglSecondaryColor3uivEXT
|
||||
#define glSecondaryColor3ubvEXT mglSecondaryColor3ubvEXT
|
||||
#define glSecondaryColor3svEXT mglSecondaryColor3svEXT
|
||||
#define glSecondaryColor3ivEXT mglSecondaryColor3ivEXT
|
||||
#define glSecondaryColor3fvEXT mglSecondaryColor3fvEXT
|
||||
#define glSecondaryColor3dvEXT mglSecondaryColor3dvEXT
|
||||
#define glSecondaryColor3bvEXT mglSecondaryColor3bvEXT
|
||||
#define glSecondaryColor3usvEXT mglSecondaryColor3usvEXT
|
||||
#define glSecondaryColorPointerEXT mglSecondaryColorPointerEXT
|
||||
#define glSecondaryColor3iEXT mglSecondaryColor3iEXT
|
||||
#define glSecondaryColor3dEXT mglSecondaryColor3dEXT
|
||||
#define glSecondaryColor3bEXT mglSecondaryColor3bEXT
|
||||
#define glSecondaryColor3uiEXT mglSecondaryColor3uiEXT
|
||||
#define glSecondaryColor3usEXT mglSecondaryColor3usEXT
|
||||
#define glSecondaryColor3sEXT mglSecondaryColor3sEXT
|
||||
|
||||
#endif
|
||||
|
||||
@@ -13,21 +13,21 @@ extern "C" {
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
**
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
**
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
**
|
||||
** Original Code. The Original Code is: OpenGL Sample Implementation,
|
||||
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
|
||||
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
|
||||
** Copyright in any portions created by third parties is as indicated
|
||||
** elsewhere herein. All Rights Reserved.
|
||||
**
|
||||
**
|
||||
** Additional Notice Provisions: This software was created using the
|
||||
** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
|
||||
** not been independently verified as being compliant with the OpenGL(R)
|
||||
@@ -46,7 +46,7 @@ extern "C" {
|
||||
/*************************************************************/
|
||||
|
||||
/* Header file version number, required by OpenGL ABI for Linux */
|
||||
#define GL_GLEXT_VERSION 6
|
||||
#define GL_GLEXT_VERSION 7
|
||||
|
||||
#ifndef GL_VERSION_1_2
|
||||
#define GL_CONSTANT_COLOR 0x8001
|
||||
@@ -220,12 +220,91 @@ extern "C" {
|
||||
#define GL_COMPRESSED_RGB_ARB 0x84ED
|
||||
#define GL_COMPRESSED_RGBA_ARB 0x84EE
|
||||
#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF
|
||||
#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0
|
||||
#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0
|
||||
#define GL_TEXTURE_COMPRESSED_ARB 0x86A1
|
||||
#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2
|
||||
#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_vertex_blend
|
||||
#define GL_MAX_VERTEX_UNITS_ARB 0x86A4
|
||||
#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5
|
||||
#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6
|
||||
#define GL_VERTEX_BLEND_ARB 0x86A7
|
||||
#define GL_CURRENT_WEIGHT_ARB 0x86A8
|
||||
#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9
|
||||
#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA
|
||||
#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB
|
||||
#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC
|
||||
#define GL_WEIGHT_ARRAY_ARB 0x86AD
|
||||
#define GL_MODELVIEW0_ARB 0x1700
|
||||
#define GL_MODELVIEW1_ARB 0x850A
|
||||
#define GL_MODELVIEW2_ARB 0x8722
|
||||
#define GL_MODELVIEW3_ARB 0x8723
|
||||
#define GL_MODELVIEW4_ARB 0x8724
|
||||
#define GL_MODELVIEW5_ARB 0x8725
|
||||
#define GL_MODELVIEW6_ARB 0x8726
|
||||
#define GL_MODELVIEW7_ARB 0x8727
|
||||
#define GL_MODELVIEW8_ARB 0x8728
|
||||
#define GL_MODELVIEW9_ARB 0x8729
|
||||
#define GL_MODELVIEW10_ARB 0x872A
|
||||
#define GL_MODELVIEW11_ARB 0x872B
|
||||
#define GL_MODELVIEW12_ARB 0x872C
|
||||
#define GL_MODELVIEW13_ARB 0x872D
|
||||
#define GL_MODELVIEW14_ARB 0x872E
|
||||
#define GL_MODELVIEW15_ARB 0x872F
|
||||
#define GL_MODELVIEW16_ARB 0x8730
|
||||
#define GL_MODELVIEW17_ARB 0x8731
|
||||
#define GL_MODELVIEW18_ARB 0x8732
|
||||
#define GL_MODELVIEW19_ARB 0x8733
|
||||
#define GL_MODELVIEW20_ARB 0x8734
|
||||
#define GL_MODELVIEW21_ARB 0x8735
|
||||
#define GL_MODELVIEW22_ARB 0x8736
|
||||
#define GL_MODELVIEW23_ARB 0x8737
|
||||
#define GL_MODELVIEW24_ARB 0x8738
|
||||
#define GL_MODELVIEW25_ARB 0x8739
|
||||
#define GL_MODELVIEW26_ARB 0x873A
|
||||
#define GL_MODELVIEW27_ARB 0x873B
|
||||
#define GL_MODELVIEW28_ARB 0x873C
|
||||
#define GL_MODELVIEW29_ARB 0x873D
|
||||
#define GL_MODELVIEW30_ARB 0x873E
|
||||
#define GL_MODELVIEW31_ARB 0x873F
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_texture_env_combine
|
||||
#define GL_COMBINE_ARB 0x8570
|
||||
#define GL_COMBINE_RGB_ARB 0x8571
|
||||
#define GL_COMBINE_ALPHA_ARB 0x8572
|
||||
#define GL_SOURCE0_RGB_ARB 0x8580
|
||||
#define GL_SOURCE1_RGB_ARB 0x8581
|
||||
#define GL_SOURCE2_RGB_ARB 0x8582
|
||||
#define GL_SOURCE0_ALPHA_ARB 0x8588
|
||||
#define GL_SOURCE1_ALPHA_ARB 0x8589
|
||||
#define GL_SOURCE2_ALPHA_ARB 0x858A
|
||||
#define GL_OPERAND0_RGB_ARB 0x8590
|
||||
#define GL_OPERAND1_RGB_ARB 0x8591
|
||||
#define GL_OPERAND2_RGB_ARB 0x8592
|
||||
#define GL_OPERAND0_ALPHA_ARB 0x8598
|
||||
#define GL_OPERAND1_ALPHA_ARB 0x8599
|
||||
#define GL_OPERAND2_ALPHA_ARB 0x859A
|
||||
#define GL_RGB_SCALE_ARB 0x8573
|
||||
#define GL_ADD_SIGNED_ARB 0x8574
|
||||
#define GL_INTERPOLATE_ARB 0x8575
|
||||
#define GL_SUBTRACT_ARB 0x84E7
|
||||
#define GL_CONSTANT_ARB 0x8576
|
||||
#define GL_PRIMARY_COLOR_ARB 0x8577
|
||||
#define GL_PREVIOUS_ARB 0x8578
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_texture_env_dot3
|
||||
#define GL_DOT3_RGB_ARB 0x86AE
|
||||
#define GL_DOT3_RGBA_ARB 0x86AF
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_texture_border_clamp
|
||||
#define GL_CLAMP_TO_BORDER_ARB 0x812D
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_abgr
|
||||
#define GL_ABGR_EXT 0x8000
|
||||
#endif
|
||||
@@ -670,6 +749,18 @@ extern "C" {
|
||||
#ifndef GL_SGIX_tag_sample_buffer
|
||||
#endif
|
||||
|
||||
#ifndef GL_FfdMaskSGIX
|
||||
#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x00000001
|
||||
#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x00000002
|
||||
#endif
|
||||
|
||||
#ifndef GL_SGIX_polynomial_ffd
|
||||
#define GL_GEOMETRY_DEFORMATION_SGIX 0x8194
|
||||
#define GL_TEXTURE_DEFORMATION_SGIX 0x8195
|
||||
#define GL_DEFORMATIONS_MASK_SGIX 0x8196
|
||||
#define GL_MAX_DEFORMATION_ORDER_SGIX 0x8197
|
||||
#endif
|
||||
|
||||
#ifndef GL_SGIX_reference_plane
|
||||
#define GL_REFERENCE_PLANE_SGIX 0x817D
|
||||
#define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E
|
||||
@@ -785,6 +876,14 @@ extern "C" {
|
||||
#define GL_COLOR_INDEX8_EXT 0x80E5
|
||||
#define GL_COLOR_INDEX12_EXT 0x80E6
|
||||
#define GL_COLOR_INDEX16_EXT 0x80E7
|
||||
#define GL_COLOR_TABLE_FORMAT_EXT 0x80D8
|
||||
#define GL_COLOR_TABLE_WIDTH_EXT 0x80D9
|
||||
#define GL_COLOR_TABLE_RED_SIZE_EXT 0x80DA
|
||||
#define GL_COLOR_TABLE_GREEN_SIZE_EXT 0x80DB
|
||||
#define GL_COLOR_TABLE_BLUE_SIZE_EXT 0x80DC
|
||||
#define GL_COLOR_TABLE_ALPHA_SIZE_EXT 0x80DD
|
||||
#define GL_COLOR_TABLE_LUMINANCE_SIZE_EXT 0x80DE
|
||||
#define GL_COLOR_TABLE_INTENSITY_SIZE_EXT 0x80DF
|
||||
#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED
|
||||
#endif
|
||||
|
||||
@@ -926,6 +1025,24 @@ extern "C" {
|
||||
#define GL_BGRA_EXT 0x80E1
|
||||
#endif
|
||||
|
||||
#ifndef GL_SGIX_async
|
||||
#define GL_ASYNC_MARKER_SGIX 0x8329
|
||||
#endif
|
||||
|
||||
#ifndef GL_SGIX_async_pixel
|
||||
#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C
|
||||
#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D
|
||||
#define GL_ASYNC_READ_PIXELS_SGIX 0x835E
|
||||
#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F
|
||||
#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360
|
||||
#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361
|
||||
#endif
|
||||
|
||||
#ifndef GL_SGIX_async_histogram
|
||||
#define GL_ASYNC_HISTOGRAM_SGIX 0x832C
|
||||
#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D
|
||||
#endif
|
||||
|
||||
#ifndef GL_INTEL_texture_scissor
|
||||
#endif
|
||||
|
||||
@@ -1419,6 +1536,11 @@ extern "C" {
|
||||
#define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_texture_env_dot3
|
||||
#define GL_DOT3_RGB_EXT 0x8740
|
||||
#define GL_DOT3_RGBA_EXT 0x8741
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
@@ -1630,8 +1752,16 @@ typedef void (APIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GL
|
||||
typedef void (APIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, void *img);
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_abgr
|
||||
#define GL_EXT_abgr 1
|
||||
#ifndef GL_ARB_texture_env_combine
|
||||
#define GL_ARB_texture_env_combine 1
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_texture_env_dot3
|
||||
#define GL_ARB_texture_env_dot3 1
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_texture_border_clamp
|
||||
#define GL_ARB_texture_border_clamp 1
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_blend_color
|
||||
@@ -1658,15 +1788,9 @@ typedef void (APIENTRY * PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bia
|
||||
#define GL_EXT_texture3D 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
extern void APIENTRY glTexImage3DEXT (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRY * PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_subtexture
|
||||
/*#define GL_EXT_subtexture 1*/
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
extern void APIENTRY glTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRY * PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
typedef void (APIENTRY * PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
#endif
|
||||
|
||||
@@ -2038,6 +2162,20 @@ extern void APIENTRY glTagSampleBufferSGIX (void);
|
||||
typedef void (APIENTRY * PFNGLTAGSAMPLEBUFFERSGIXPROC) (void);
|
||||
#endif
|
||||
|
||||
#ifndef GL_SGIX_polynomial_ffd
|
||||
#define GL_SGIX_polynomial_ffd 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
extern void APIENTRY glDeformationMap3dSGIX (GLenum, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, const GLdouble *);
|
||||
extern void APIENTRY glDeformationMap3fSGIX (GLenum, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, const GLfloat *);
|
||||
extern void APIENTRY glDeformSGIX (GLbitfield);
|
||||
extern void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRY * PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points);
|
||||
typedef void (APIENTRY * PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points);
|
||||
typedef void (APIENTRY * PFNGLDEFORMSGIXPROC) (GLbitfield mask);
|
||||
typedef void (APIENTRY * PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask);
|
||||
#endif
|
||||
|
||||
#ifndef GL_SGIX_reference_plane
|
||||
#define GL_SGIX_reference_plane 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
@@ -2306,6 +2444,32 @@ typedef void (APIENTRY * PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode)
|
||||
#define GL_EXT_bgra 1
|
||||
#endif
|
||||
|
||||
#ifndef GL_SGIX_async
|
||||
#define GL_SGIX_async 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
extern void APIENTRY glAsyncMarkerSGIX (GLuint);
|
||||
extern GLint APIENTRY glFinishAsyncSGIX (GLuint *);
|
||||
extern GLint APIENTRY glPollAsyncSGIX (GLuint *);
|
||||
extern GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei);
|
||||
extern void APIENTRY glDeleteAsyncMarkersSGIX (GLuint, GLsizei);
|
||||
extern GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRY * PFNGLASYNCMARKERSGIXPROC) (GLuint marker);
|
||||
typedef GLint (APIENTRY * PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp);
|
||||
typedef GLint (APIENTRY * PFNGLPOLLASYNCSGIXPROC) (GLuint *markerp);
|
||||
typedef GLuint (APIENTRY * PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range);
|
||||
typedef void (APIENTRY * PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range);
|
||||
typedef GLboolean (APIENTRY * PFNGLISASYNCMARKERSGIXPROC) (GLuint marker);
|
||||
#endif
|
||||
|
||||
#ifndef GL_SGIX_async_pixel
|
||||
#define GL_SGIX_async_pixel 1
|
||||
#endif
|
||||
|
||||
#ifndef GL_SGIX_async_histogram
|
||||
#define GL_SGIX_async_histogram 1
|
||||
#endif
|
||||
|
||||
#ifndef GL_INTEL_parallel_arrays
|
||||
#define GL_INTEL_parallel_arrays 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
@@ -2712,12 +2876,6 @@ extern void APIENTRY glCombinerOutputNV (GLenum, GLenum, GLenum, GLenum, GLenum,
|
||||
extern void APIENTRY glFinalCombinerInputNV (GLenum, GLenum, GLenum, GLenum);
|
||||
extern void APIENTRY glGetCombinerInputParameterfvNV (GLenum, GLenum, GLenum, GLenum, GLfloat *);
|
||||
extern void APIENTRY glGetCombinerInputParameterivNV (GLenum, GLenum, GLenum, GLenum, GLint *);
|
||||
#ifdef VMS
|
||||
#define glGetCombinerOutputParameterfvNV glGetCombinerOutputParameterfvN
|
||||
#define glGetCombinerOutputParameterivNV glGetCombinerOutputParameterivN
|
||||
#define glGetFinalCombinerInputParameterfvNV glGetFinalCombinerInputParafvNV
|
||||
#define glGetFinalCombinerInputParameterivNV glGetFinalCombinerInputParaivNV
|
||||
#endif
|
||||
extern void APIENTRY glGetCombinerOutputParameterfvNV (GLenum, GLenum, GLenum, GLfloat *);
|
||||
extern void APIENTRY glGetCombinerOutputParameterivNV (GLenum, GLenum, GLenum, GLint *);
|
||||
extern void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum, GLenum, GLfloat *);
|
||||
@@ -2918,6 +3076,18 @@ extern void APIENTRY glTextureColorMaskSGIS (GLboolean, GLboolean, GLboolean, GL
|
||||
typedef void (APIENTRY * PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
|
||||
#endif
|
||||
|
||||
#ifndef GL_SGIX_igloo_interface
|
||||
#define GL_SGIX_igloo_interface 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
extern void APIENTRY glIglooInterfaceSGIX (GLenum, const GLvoid *);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRY * PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid *params);
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_texture_env_dot3
|
||||
#define GL_EXT_texture_env_dot3 1
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
819
include/GL/glu.h
819
include/GL/glu.h
@@ -1,534 +1,323 @@
|
||||
/* $Id: glu.h,v 1.22 2000/07/11 14:11:44 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.3
|
||||
* Copyright (C) 1995-2000 Brian Paul
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 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
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** Original Code. The Original Code is: OpenGL Sample Implementation,
|
||||
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
|
||||
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
|
||||
** Copyright in any portions created by third parties is as indicated
|
||||
** elsewhere herein. All Rights Reserved.
|
||||
**
|
||||
** Additional Notice Provisions: This software was created using the
|
||||
** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
|
||||
** not been independently verified as being compliant with the OpenGL(R)
|
||||
** version 1.2.1 Specification.
|
||||
*/
|
||||
|
||||
#ifndef __glu_h__
|
||||
#define __glu_h__
|
||||
|
||||
#ifndef GLU_H
|
||||
#define GLU_H
|
||||
|
||||
|
||||
#if defined(USE_MGL_NAMESPACE)
|
||||
#include "glu_mangle.h"
|
||||
#endif
|
||||
|
||||
#include <GL/gl.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
#include <GL/gl.h>
|
||||
/* Extensions */
|
||||
#define GLU_EXT_object_space_tess 1
|
||||
#define GLU_EXT_nurbs_tessellator 1
|
||||
|
||||
/* Boolean */
|
||||
#define GLU_FALSE 0
|
||||
#define GLU_TRUE 1
|
||||
|
||||
/* Version */
|
||||
#define GLU_VERSION_1_1 1
|
||||
#define GLU_VERSION_1_2 1
|
||||
#define GLU_VERSION_1_3 1
|
||||
|
||||
/* StringName */
|
||||
#define GLU_VERSION 100800
|
||||
#define GLU_EXTENSIONS 100801
|
||||
|
||||
/* ErrorCode */
|
||||
#define GLU_INVALID_ENUM 100900
|
||||
#define GLU_INVALID_VALUE 100901
|
||||
#define GLU_OUT_OF_MEMORY 100902
|
||||
#define GLU_INVALID_OPERATION 100904
|
||||
|
||||
/* NurbsDisplay */
|
||||
/* GLU_FILL */
|
||||
#define GLU_OUTLINE_POLYGON 100240
|
||||
#define GLU_OUTLINE_PATCH 100241
|
||||
|
||||
/* NurbsCallback */
|
||||
#define GLU_NURBS_ERROR 100103
|
||||
#define GLU_ERROR 100103
|
||||
#define GLU_NURBS_BEGIN 100164
|
||||
#define GLU_NURBS_BEGIN_EXT 100164
|
||||
#define GLU_NURBS_VERTEX 100165
|
||||
#define GLU_NURBS_VERTEX_EXT 100165
|
||||
#define GLU_NURBS_NORMAL 100166
|
||||
#define GLU_NURBS_NORMAL_EXT 100166
|
||||
#define GLU_NURBS_COLOR 100167
|
||||
#define GLU_NURBS_COLOR_EXT 100167
|
||||
#define GLU_NURBS_TEXTURE_COORD 100168
|
||||
#define GLU_NURBS_TEX_COORD_EXT 100168
|
||||
#define GLU_NURBS_END 100169
|
||||
#define GLU_NURBS_END_EXT 100169
|
||||
#define GLU_NURBS_BEGIN_DATA 100170
|
||||
#define GLU_NURBS_BEGIN_DATA_EXT 100170
|
||||
#define GLU_NURBS_VERTEX_DATA 100171
|
||||
#define GLU_NURBS_VERTEX_DATA_EXT 100171
|
||||
#define GLU_NURBS_NORMAL_DATA 100172
|
||||
#define GLU_NURBS_NORMAL_DATA_EXT 100172
|
||||
#define GLU_NURBS_COLOR_DATA 100173
|
||||
#define GLU_NURBS_COLOR_DATA_EXT 100173
|
||||
#define GLU_NURBS_TEXTURE_COORD_DATA 100174
|
||||
#define GLU_NURBS_TEX_COORD_DATA_EXT 100174
|
||||
#define GLU_NURBS_END_DATA 100175
|
||||
#define GLU_NURBS_END_DATA_EXT 100175
|
||||
|
||||
/* NurbsError */
|
||||
#define GLU_NURBS_ERROR1 100251
|
||||
#define GLU_NURBS_ERROR2 100252
|
||||
#define GLU_NURBS_ERROR3 100253
|
||||
#define GLU_NURBS_ERROR4 100254
|
||||
#define GLU_NURBS_ERROR5 100255
|
||||
#define GLU_NURBS_ERROR6 100256
|
||||
#define GLU_NURBS_ERROR7 100257
|
||||
#define GLU_NURBS_ERROR8 100258
|
||||
#define GLU_NURBS_ERROR9 100259
|
||||
#define GLU_NURBS_ERROR10 100260
|
||||
#define GLU_NURBS_ERROR11 100261
|
||||
#define GLU_NURBS_ERROR12 100262
|
||||
#define GLU_NURBS_ERROR13 100263
|
||||
#define GLU_NURBS_ERROR14 100264
|
||||
#define GLU_NURBS_ERROR15 100265
|
||||
#define GLU_NURBS_ERROR16 100266
|
||||
#define GLU_NURBS_ERROR17 100267
|
||||
#define GLU_NURBS_ERROR18 100268
|
||||
#define GLU_NURBS_ERROR19 100269
|
||||
#define GLU_NURBS_ERROR20 100270
|
||||
#define GLU_NURBS_ERROR21 100271
|
||||
#define GLU_NURBS_ERROR22 100272
|
||||
#define GLU_NURBS_ERROR23 100273
|
||||
#define GLU_NURBS_ERROR24 100274
|
||||
#define GLU_NURBS_ERROR25 100275
|
||||
#define GLU_NURBS_ERROR26 100276
|
||||
#define GLU_NURBS_ERROR27 100277
|
||||
#define GLU_NURBS_ERROR28 100278
|
||||
#define GLU_NURBS_ERROR29 100279
|
||||
#define GLU_NURBS_ERROR30 100280
|
||||
#define GLU_NURBS_ERROR31 100281
|
||||
#define GLU_NURBS_ERROR32 100282
|
||||
#define GLU_NURBS_ERROR33 100283
|
||||
#define GLU_NURBS_ERROR34 100284
|
||||
#define GLU_NURBS_ERROR35 100285
|
||||
#define GLU_NURBS_ERROR36 100286
|
||||
#define GLU_NURBS_ERROR37 100287
|
||||
|
||||
/* NurbsProperty */
|
||||
#define GLU_AUTO_LOAD_MATRIX 100200
|
||||
#define GLU_CULLING 100201
|
||||
#define GLU_SAMPLING_TOLERANCE 100203
|
||||
#define GLU_DISPLAY_MODE 100204
|
||||
#define GLU_PARAMETRIC_TOLERANCE 100202
|
||||
#define GLU_SAMPLING_METHOD 100205
|
||||
#define GLU_U_STEP 100206
|
||||
#define GLU_V_STEP 100207
|
||||
#define GLU_NURBS_MODE 100160
|
||||
#define GLU_NURBS_MODE_EXT 100160
|
||||
#define GLU_NURBS_TESSELLATOR 100161
|
||||
#define GLU_NURBS_TESSELLATOR_EXT 100161
|
||||
#define GLU_NURBS_RENDERER 100162
|
||||
#define GLU_NURBS_RENDERER_EXT 100162
|
||||
|
||||
/* NurbsSampling */
|
||||
#define GLU_OBJECT_PARAMETRIC_ERROR 100208
|
||||
#define GLU_OBJECT_PARAMETRIC_ERROR_EXT 100208
|
||||
#define GLU_OBJECT_PATH_LENGTH 100209
|
||||
#define GLU_OBJECT_PATH_LENGTH_EXT 100209
|
||||
#define GLU_PATH_LENGTH 100215
|
||||
#define GLU_PARAMETRIC_ERROR 100216
|
||||
#define GLU_DOMAIN_DISTANCE 100217
|
||||
|
||||
/* NurbsTrim */
|
||||
#define GLU_MAP1_TRIM_2 100210
|
||||
#define GLU_MAP1_TRIM_3 100211
|
||||
|
||||
/* QuadricDrawStyle */
|
||||
#define GLU_POINT 100010
|
||||
#define GLU_LINE 100011
|
||||
#define GLU_FILL 100012
|
||||
#define GLU_SILHOUETTE 100013
|
||||
|
||||
/* QuadricCallback */
|
||||
/* GLU_ERROR */
|
||||
|
||||
/* QuadricNormal */
|
||||
#define GLU_SMOOTH 100000
|
||||
#define GLU_FLAT 100001
|
||||
#define GLU_NONE 100002
|
||||
|
||||
/* QuadricOrientation */
|
||||
#define GLU_OUTSIDE 100020
|
||||
#define GLU_INSIDE 100021
|
||||
|
||||
/* TessCallback */
|
||||
#define GLU_TESS_BEGIN 100100
|
||||
#define GLU_BEGIN 100100
|
||||
#define GLU_TESS_VERTEX 100101
|
||||
#define GLU_VERTEX 100101
|
||||
#define GLU_TESS_END 100102
|
||||
#define GLU_END 100102
|
||||
#define GLU_TESS_ERROR 100103
|
||||
#define GLU_TESS_EDGE_FLAG 100104
|
||||
#define GLU_EDGE_FLAG 100104
|
||||
#define GLU_TESS_COMBINE 100105
|
||||
#define GLU_TESS_BEGIN_DATA 100106
|
||||
#define GLU_TESS_VERTEX_DATA 100107
|
||||
#define GLU_TESS_END_DATA 100108
|
||||
#define GLU_TESS_ERROR_DATA 100109
|
||||
#define GLU_TESS_EDGE_FLAG_DATA 100110
|
||||
#define GLU_TESS_COMBINE_DATA 100111
|
||||
|
||||
/* TessContour */
|
||||
#define GLU_CW 100120
|
||||
#define GLU_CCW 100121
|
||||
#define GLU_INTERIOR 100122
|
||||
#define GLU_EXTERIOR 100123
|
||||
#define GLU_UNKNOWN 100124
|
||||
|
||||
/* TessProperty */
|
||||
#define GLU_TESS_WINDING_RULE 100140
|
||||
#define GLU_TESS_BOUNDARY_ONLY 100141
|
||||
#define GLU_TESS_TOLERANCE 100142
|
||||
|
||||
/* TessError */
|
||||
#define GLU_TESS_ERROR1 100151
|
||||
#define GLU_TESS_ERROR2 100152
|
||||
#define GLU_TESS_ERROR3 100153
|
||||
#define GLU_TESS_ERROR4 100154
|
||||
#define GLU_TESS_ERROR5 100155
|
||||
#define GLU_TESS_ERROR6 100156
|
||||
#define GLU_TESS_ERROR7 100157
|
||||
#define GLU_TESS_ERROR8 100158
|
||||
#define GLU_TESS_MISSING_BEGIN_POLYGON 100151
|
||||
#define GLU_TESS_MISSING_BEGIN_CONTOUR 100152
|
||||
#define GLU_TESS_MISSING_END_POLYGON 100153
|
||||
#define GLU_TESS_MISSING_END_CONTOUR 100154
|
||||
#define GLU_TESS_COORD_TOO_LARGE 100155
|
||||
#define GLU_TESS_NEED_COMBINE_CALLBACK 100156
|
||||
|
||||
/* TessWinding */
|
||||
#define GLU_TESS_WINDING_ODD 100130
|
||||
#define GLU_TESS_WINDING_NONZERO 100131
|
||||
#define GLU_TESS_WINDING_POSITIVE 100132
|
||||
#define GLU_TESS_WINDING_NEGATIVE 100133
|
||||
#define GLU_TESS_WINDING_ABS_GEQ_TWO 100134
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
|
||||
/* to facilitate clean DLL building ... */
|
||||
#if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN__))
|
||||
# if defined(_MSC_VER) && defined(BUILD_GLU32) /* tag specify we're building mesa as a DLL */
|
||||
# define GLUAPI __declspec(dllexport)
|
||||
# elif defined(_MSC_VER) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
|
||||
# define GLUAPI __declspec(dllimport)
|
||||
# else /* for use with static link lib build of Win32 edition only */
|
||||
# define GLUAPI extern
|
||||
# endif /* _STATIC_MESA support */
|
||||
# define GLCALLBACK __stdcall
|
||||
# define GLCALLBACKP __stdcall *
|
||||
#ifdef __cplusplus
|
||||
class GLUnurbs;
|
||||
class GLUquadric;
|
||||
class GLUtesselator;
|
||||
#else
|
||||
# define GLUAPI extern
|
||||
# define GLCALLBACK
|
||||
# define GLCALLBACKP *
|
||||
#endif /* WIN32 / CYGWIN bracket */
|
||||
|
||||
/* compatability guard so we don't need to change client code */
|
||||
#if defined(_WIN32) && !defined(_WINDEF_) && !defined(_GNU_H_WINDOWS32_BASE) && !defined(OPENSTEP)
|
||||
# define CALLBACK GLCALLBACK
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef macintosh
|
||||
#pragma enumsalwaysint on
|
||||
#if PRAGMA_IMPORT_SUPPORTED
|
||||
#pragma import on
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef GLUAPI
|
||||
#define GLUAPI
|
||||
#endif
|
||||
|
||||
#ifndef GLAPIENTRY
|
||||
#define GLAPIENTRY
|
||||
#endif
|
||||
|
||||
#ifndef GLCALLBACK
|
||||
#define GLCALLBACK
|
||||
#endif
|
||||
|
||||
|
||||
#define GLU_VERSION_1_1 1
|
||||
|
||||
|
||||
|
||||
#define GLU_TRUE 1
|
||||
#define GLU_FALSE 0
|
||||
|
||||
|
||||
/* Normal vectors */
|
||||
#define GLU_SMOOTH 100000
|
||||
#define GLU_FLAT 100001
|
||||
#define GLU_NONE 100002
|
||||
|
||||
/* Quadric draw styles */
|
||||
#define GLU_POINT 100010
|
||||
#define GLU_LINE 100011
|
||||
#define GLU_FILL 100012
|
||||
#define GLU_SILHOUETTE 100013
|
||||
|
||||
/* Quadric orientation */
|
||||
#define GLU_OUTSIDE 100020
|
||||
#define GLU_INSIDE 100021
|
||||
|
||||
/* Tessellator */
|
||||
#define GLU_TESS_BEGIN 100100
|
||||
#define GLU_TESS_VERTEX 100101
|
||||
#define GLU_TESS_END 100102
|
||||
#define GLU_TESS_ERROR 100103
|
||||
#define GLU_TESS_EDGE_FLAG 100104
|
||||
#define GLU_TESS_COMBINE 100105
|
||||
|
||||
#define GLU_TESS_BEGIN_DATA 100106
|
||||
#define GLU_TESS_VERTEX_DATA 100107
|
||||
#define GLU_TESS_END_DATA 100108
|
||||
#define GLU_TESS_ERROR_DATA 100109
|
||||
#define GLU_TESS_EDGE_FLAG_DATA 100110
|
||||
#define GLU_TESS_COMBINE_DATA 100111
|
||||
|
||||
/* Winding rules */
|
||||
#define GLU_TESS_WINDING_ODD 100130
|
||||
#define GLU_TESS_WINDING_NONZERO 100131
|
||||
#define GLU_TESS_WINDING_POSITIVE 100132
|
||||
#define GLU_TESS_WINDING_NEGATIVE 100133
|
||||
#define GLU_TESS_WINDING_ABS_GEQ_TWO 100134
|
||||
|
||||
/* Tessellation properties */
|
||||
#define GLU_TESS_WINDING_RULE 100140
|
||||
#define GLU_TESS_BOUNDARY_ONLY 100141
|
||||
#define GLU_TESS_TOLERANCE 100142
|
||||
|
||||
/* Tessellation errors */
|
||||
#define GLU_TESS_ERROR1 100151 /* Missing gluBeginPolygon */
|
||||
#define GLU_TESS_ERROR2 100152 /* Missing gluBeginContour */
|
||||
#define GLU_TESS_ERROR3 100153 /* Missing gluEndPolygon */
|
||||
#define GLU_TESS_ERROR4 100154 /* Missing gluEndContour */
|
||||
#define GLU_TESS_ERROR5 100155 /* */
|
||||
#define GLU_TESS_ERROR6 100156 /* */
|
||||
#define GLU_TESS_ERROR7 100157 /* */
|
||||
#define GLU_TESS_ERROR8 100158 /* */
|
||||
|
||||
/* NURBS */
|
||||
#define GLU_AUTO_LOAD_MATRIX 100200
|
||||
#define GLU_CULLING 100201
|
||||
#define GLU_PARAMETRIC_TOLERANCE 100202
|
||||
#define GLU_SAMPLING_TOLERANCE 100203
|
||||
#define GLU_DISPLAY_MODE 100204
|
||||
#define GLU_SAMPLING_METHOD 100205
|
||||
#define GLU_U_STEP 100206
|
||||
#define GLU_V_STEP 100207
|
||||
|
||||
#define GLU_PATH_LENGTH 100215
|
||||
#define GLU_PARAMETRIC_ERROR 100216
|
||||
#define GLU_DOMAIN_DISTANCE 100217
|
||||
|
||||
#define GLU_MAP1_TRIM_2 100210
|
||||
#define GLU_MAP1_TRIM_3 100211
|
||||
|
||||
#define GLU_OUTLINE_POLYGON 100240
|
||||
#define GLU_OUTLINE_PATCH 100241
|
||||
|
||||
#define GLU_NURBS_ERROR1 100251 /* spline order un-supported */
|
||||
#define GLU_NURBS_ERROR2 100252 /* too few knots */
|
||||
#define GLU_NURBS_ERROR3 100253 /* valid knot range is empty */
|
||||
#define GLU_NURBS_ERROR4 100254 /* decreasing knot sequence */
|
||||
#define GLU_NURBS_ERROR5 100255 /* knot multiplicity > spline order */
|
||||
#define GLU_NURBS_ERROR6 100256 /* endcurve() must follow bgncurve() */
|
||||
#define GLU_NURBS_ERROR7 100257 /* bgncurve() must precede endcurve() */
|
||||
#define GLU_NURBS_ERROR8 100258 /* ctrlarray or knot vector is NULL */
|
||||
#define GLU_NURBS_ERROR9 100259 /* can't draw pwlcurves */
|
||||
#define GLU_NURBS_ERROR10 100260 /* missing gluNurbsCurve() */
|
||||
#define GLU_NURBS_ERROR11 100261 /* missing gluNurbsSurface() */
|
||||
#define GLU_NURBS_ERROR12 100262 /* endtrim() must precede endsurface() */
|
||||
#define GLU_NURBS_ERROR13 100263 /* bgnsurface() must precede endsurface() */
|
||||
#define GLU_NURBS_ERROR14 100264 /* curve of improper type passed as trim curve */
|
||||
#define GLU_NURBS_ERROR15 100265 /* bgnsurface() must precede bgntrim() */
|
||||
#define GLU_NURBS_ERROR16 100266 /* endtrim() must follow bgntrim() */
|
||||
#define GLU_NURBS_ERROR17 100267 /* bgntrim() must precede endtrim()*/
|
||||
#define GLU_NURBS_ERROR18 100268 /* invalid or missing trim curve*/
|
||||
#define GLU_NURBS_ERROR19 100269 /* bgntrim() must precede pwlcurve() */
|
||||
#define GLU_NURBS_ERROR20 100270 /* pwlcurve referenced twice*/
|
||||
#define GLU_NURBS_ERROR21 100271 /* pwlcurve and nurbscurve mixed */
|
||||
#define GLU_NURBS_ERROR22 100272 /* improper usage of trim data type */
|
||||
#define GLU_NURBS_ERROR23 100273 /* nurbscurve referenced twice */
|
||||
#define GLU_NURBS_ERROR24 100274 /* nurbscurve and pwlcurve mixed */
|
||||
#define GLU_NURBS_ERROR25 100275 /* nurbssurface referenced twice */
|
||||
#define GLU_NURBS_ERROR26 100276 /* invalid property */
|
||||
#define GLU_NURBS_ERROR27 100277 /* endsurface() must follow bgnsurface() */
|
||||
#define GLU_NURBS_ERROR28 100278 /* intersecting or misoriented trim curves */
|
||||
#define GLU_NURBS_ERROR29 100279 /* intersecting trim curves */
|
||||
#define GLU_NURBS_ERROR30 100280 /* UNUSED */
|
||||
#define GLU_NURBS_ERROR31 100281 /* unconnected trim curves */
|
||||
#define GLU_NURBS_ERROR32 100282 /* unknown knot error */
|
||||
#define GLU_NURBS_ERROR33 100283 /* negative vertex count encountered */
|
||||
#define GLU_NURBS_ERROR34 100284 /* negative byte-stride */
|
||||
#define GLU_NURBS_ERROR35 100285 /* unknown type descriptor */
|
||||
#define GLU_NURBS_ERROR36 100286 /* null control point reference */
|
||||
#define GLU_NURBS_ERROR37 100287 /* duplicate point on pwlcurve */
|
||||
|
||||
/* GLU 1.3 and later */
|
||||
#define GLU_NURBS_MODE ?
|
||||
|
||||
|
||||
/* Errors */
|
||||
#define GLU_INVALID_ENUM 100900
|
||||
#define GLU_INVALID_VALUE 100901
|
||||
#define GLU_OUT_OF_MEMORY 100902
|
||||
#define GLU_INCOMPATIBLE_GL_VERSION 100903
|
||||
|
||||
/* GLU 1.1 and later */
|
||||
#define GLU_VERSION 100800
|
||||
#define GLU_EXTENSIONS 100801
|
||||
|
||||
|
||||
/*** GLU 1.0 tessellation ***/
|
||||
|
||||
/* Contour types */
|
||||
#define GLU_CW 100120
|
||||
#define GLU_CCW 100121
|
||||
#define GLU_INTERIOR 100122
|
||||
#define GLU_EXTERIOR 100123
|
||||
#define GLU_UNKNOWN 100124
|
||||
|
||||
/* Tessellator */
|
||||
#define GLU_BEGIN GLU_TESS_BEGIN
|
||||
#define GLU_VERTEX GLU_TESS_VERTEX
|
||||
#define GLU_END GLU_TESS_END
|
||||
#define GLU_ERROR GLU_TESS_ERROR
|
||||
#define GLU_EDGE_FLAG GLU_TESS_EDGE_FLAG
|
||||
|
||||
|
||||
|
||||
#if defined(__BEOS__)
|
||||
/* The BeOS does something funky and makes these typedefs in one
|
||||
* of its system headers.
|
||||
*/
|
||||
#else
|
||||
|
||||
#if defined GLU_VERSION_1_2
|
||||
typedef struct GLUquadric GLUquadricObj;
|
||||
typedef struct GLUnurbs GLUnurbsObj;
|
||||
/* FIXME: We need to implement the other 1.3 typedefs - GH */
|
||||
typedef struct GLUtesselator GLUtesselator;
|
||||
typedef GLUtesselator GLUtriangulatorObj;
|
||||
#else
|
||||
/* GLU 1.1 and older */
|
||||
typedef struct GLUquadric GLUquadricObj;
|
||||
typedef struct GLUtriangulatorObj GLUtriangulatorObj;
|
||||
typedef struct GLUnurbs GLUnurbsObj;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if defined(__BEOS__) || defined(__QUICKDRAW__)
|
||||
#pragma export on
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* Miscellaneous functions
|
||||
*
|
||||
*/
|
||||
|
||||
GLUAPI void GLAPIENTRY gluLookAt( GLdouble eyex, GLdouble eyey, GLdouble eyez,
|
||||
GLdouble centerx, GLdouble centery,
|
||||
GLdouble centerz,
|
||||
GLdouble upx, GLdouble upy, GLdouble upz );
|
||||
|
||||
|
||||
GLUAPI void GLAPIENTRY gluOrtho2D( GLdouble left, GLdouble right,
|
||||
GLdouble bottom, GLdouble top );
|
||||
|
||||
|
||||
GLUAPI void GLAPIENTRY gluPerspective( GLdouble fovy, GLdouble aspect,
|
||||
GLdouble zNear, GLdouble zFar );
|
||||
|
||||
|
||||
GLUAPI void GLAPIENTRY gluPickMatrix( GLdouble x, GLdouble y,
|
||||
GLdouble width, GLdouble height,
|
||||
const GLint viewport[4] );
|
||||
|
||||
GLUAPI GLint GLAPIENTRY gluProject( GLdouble objx, GLdouble objy, GLdouble objz,
|
||||
const GLdouble modelMatrix[16],
|
||||
const GLdouble projMatrix[16],
|
||||
const GLint viewport[4],
|
||||
GLdouble *winx, GLdouble *winy,
|
||||
GLdouble *winz );
|
||||
|
||||
GLUAPI GLint GLAPIENTRY gluUnProject( GLdouble winx, GLdouble winy,
|
||||
GLdouble winz,
|
||||
const GLdouble modelMatrix[16],
|
||||
const GLdouble projMatrix[16],
|
||||
const GLint viewport[4],
|
||||
GLdouble *objx, GLdouble *objy,
|
||||
GLdouble *objz );
|
||||
|
||||
GLUAPI const GLubyte* GLAPIENTRY gluErrorString( GLenum errorCode );
|
||||
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* Mipmapping and image scaling
|
||||
*
|
||||
*/
|
||||
|
||||
GLUAPI GLint GLAPIENTRY gluScaleImage( GLenum format,
|
||||
GLsizei widthin, GLsizei heightin,
|
||||
GLenum typein, const void *datain,
|
||||
GLsizei widthout, GLsizei heightout,
|
||||
GLenum typeout, void *dataout );
|
||||
|
||||
GLUAPI GLint GLAPIENTRY gluBuild1DMipmaps( GLenum target, GLint components,
|
||||
GLsizei width, GLenum format,
|
||||
GLenum type, const void *data );
|
||||
|
||||
GLUAPI GLint GLAPIENTRY gluBuild2DMipmaps( GLenum target, GLint components,
|
||||
GLsizei width, GLsizei height,
|
||||
GLenum format,
|
||||
GLenum type, const void *data );
|
||||
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* Quadrics
|
||||
*
|
||||
*/
|
||||
|
||||
GLUAPI GLUquadricObj* GLAPIENTRY gluNewQuadric( void );
|
||||
|
||||
GLUAPI void GLAPIENTRY gluDeleteQuadric( GLUquadricObj *state );
|
||||
|
||||
GLUAPI void GLAPIENTRY gluQuadricDrawStyle( GLUquadricObj *quadObject,
|
||||
GLenum drawStyle );
|
||||
|
||||
GLUAPI void GLAPIENTRY gluQuadricOrientation( GLUquadricObj *quadObject,
|
||||
GLenum orientation );
|
||||
|
||||
GLUAPI void GLAPIENTRY gluQuadricNormals( GLUquadricObj *quadObject,
|
||||
GLenum normals );
|
||||
|
||||
GLUAPI void GLAPIENTRY gluQuadricTexture( GLUquadricObj *quadObject,
|
||||
GLboolean textureCoords );
|
||||
|
||||
GLUAPI void GLAPIENTRY gluQuadricCallback( GLUquadricObj *qobj,
|
||||
GLenum which,
|
||||
void (GLCALLBACK *fn)() );
|
||||
|
||||
GLUAPI void GLAPIENTRY gluCylinder( GLUquadricObj *qobj,
|
||||
GLdouble baseRadius,
|
||||
GLdouble topRadius,
|
||||
GLdouble height,
|
||||
GLint slices, GLint stacks );
|
||||
|
||||
GLUAPI void GLAPIENTRY gluSphere( GLUquadricObj *qobj,
|
||||
GLdouble radius,
|
||||
GLint slices, GLint stacks );
|
||||
|
||||
GLUAPI void GLAPIENTRY gluDisk( GLUquadricObj *qobj,
|
||||
GLdouble innerRadius, GLdouble outerRadius,
|
||||
GLint slices, GLint loops );
|
||||
|
||||
GLUAPI void GLAPIENTRY gluPartialDisk( GLUquadricObj *qobj,
|
||||
GLdouble innerRadius,
|
||||
GLdouble outerRadius, GLint slices,
|
||||
GLint loops, GLdouble startAngle,
|
||||
GLdouble sweepAngle );
|
||||
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* Nurbs
|
||||
*
|
||||
*/
|
||||
|
||||
GLUAPI GLUnurbsObj* GLAPIENTRY gluNewNurbsRenderer( void );
|
||||
|
||||
GLUAPI void GLAPIENTRY gluDeleteNurbsRenderer( GLUnurbsObj *nobj );
|
||||
|
||||
GLUAPI void GLAPIENTRY gluLoadSamplingMatrices( GLUnurbsObj *nobj,
|
||||
const GLfloat modelMatrix[16],
|
||||
const GLfloat projMatrix[16],
|
||||
const GLint viewport[4] );
|
||||
|
||||
GLUAPI void GLAPIENTRY gluNurbsProperty( GLUnurbsObj *nobj, GLenum property,
|
||||
GLfloat value );
|
||||
|
||||
GLUAPI void GLAPIENTRY gluGetNurbsProperty( GLUnurbsObj *nobj, GLenum property,
|
||||
GLfloat *value );
|
||||
|
||||
GLUAPI void GLAPIENTRY gluBeginCurve( GLUnurbsObj *nobj );
|
||||
|
||||
GLUAPI void GLAPIENTRY gluEndCurve( GLUnurbsObj * nobj );
|
||||
|
||||
GLUAPI void GLAPIENTRY gluNurbsCurve( GLUnurbsObj *nobj, GLint nknots,
|
||||
GLfloat *knot, GLint stride,
|
||||
GLfloat *ctlarray, GLint order,
|
||||
GLenum type );
|
||||
|
||||
GLUAPI void GLAPIENTRY gluBeginSurface( GLUnurbsObj *nobj );
|
||||
|
||||
GLUAPI void GLAPIENTRY gluEndSurface( GLUnurbsObj * nobj );
|
||||
|
||||
GLUAPI void GLAPIENTRY gluNurbsSurface( GLUnurbsObj *nobj,
|
||||
GLint sknot_count, GLfloat *sknot,
|
||||
GLint tknot_count, GLfloat *tknot,
|
||||
GLint s_stride, GLint t_stride,
|
||||
GLfloat *ctlarray,
|
||||
GLint sorder, GLint torder,
|
||||
GLenum type );
|
||||
|
||||
GLUAPI void GLAPIENTRY gluBeginTrim( GLUnurbsObj *nobj );
|
||||
|
||||
GLUAPI void GLAPIENTRY gluEndTrim( GLUnurbsObj *nobj );
|
||||
|
||||
GLUAPI void GLAPIENTRY gluPwlCurve( GLUnurbsObj *nobj, GLint count,
|
||||
GLfloat *array,
|
||||
GLint stride, GLenum type );
|
||||
|
||||
GLUAPI void GLAPIENTRY gluNurbsCallback( GLUnurbsObj *nobj, GLenum which,
|
||||
void (GLCALLBACK *fn)() );
|
||||
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* Polygon tessellation
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef GLU_VERSION_1_2
|
||||
|
||||
GLUAPI GLUtesselator* GLAPIENTRY gluNewTess( void );
|
||||
|
||||
GLUAPI void GLAPIENTRY gluDeleteTess( GLUtesselator *tobj );
|
||||
|
||||
GLUAPI void GLAPIENTRY gluTessBeginPolygon( GLUtesselator *tobj,
|
||||
void *polygon_data );
|
||||
|
||||
GLUAPI void GLAPIENTRY gluTessBeginContour( GLUtesselator *tobj );
|
||||
|
||||
GLUAPI void GLAPIENTRY gluTessVertex( GLUtesselator *tobj, GLdouble coords[3],
|
||||
void *vertex_data );
|
||||
|
||||
GLUAPI void GLAPIENTRY gluTessEndContour( GLUtesselator *tobj );
|
||||
|
||||
GLUAPI void GLAPIENTRY gluTessEndPolygon( GLUtesselator *tobj );
|
||||
|
||||
GLUAPI void GLAPIENTRY gluTessProperty( GLUtesselator *tobj, GLenum which,
|
||||
GLdouble value );
|
||||
|
||||
GLUAPI void GLAPIENTRY gluTessNormal( GLUtesselator *tobj, GLdouble x,
|
||||
GLdouble y, GLdouble z );
|
||||
|
||||
GLUAPI void GLAPIENTRY gluTessCallback( GLUtesselator *tobj, GLenum which,
|
||||
void (GLCALLBACK *fn)() );
|
||||
|
||||
GLUAPI void GLAPIENTRY gluGetTessProperty( GLUtesselator *tobj, GLenum which,
|
||||
GLdouble *value );
|
||||
|
||||
#else
|
||||
|
||||
GLUAPI GLUtriangulatorObj* GLAPIENTRY gluNewTess( void );
|
||||
|
||||
GLUAPI void GLAPIENTRY gluTessCallback( GLUtriangulatorObj *tobj, GLenum which,
|
||||
void (GLCALLBACK *fn)() );
|
||||
|
||||
GLUAPI void GLAPIENTRY gluDeleteTess( GLUtriangulatorObj *tobj );
|
||||
|
||||
GLUAPI void GLAPIENTRY gluBeginPolygon( GLUtriangulatorObj *tobj );
|
||||
|
||||
GLUAPI void GLAPIENTRY gluEndPolygon( GLUtriangulatorObj *tobj );
|
||||
|
||||
GLUAPI void GLAPIENTRY gluNextContour( GLUtriangulatorObj *tobj, GLenum type );
|
||||
|
||||
GLUAPI void GLAPIENTRY gluTessVertex( GLUtriangulatorObj *tobj, GLdouble v[3],
|
||||
void *data );
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* New functions in GLU 1.1
|
||||
*
|
||||
*/
|
||||
|
||||
GLUAPI const GLubyte* GLAPIENTRY gluGetString( GLenum name );
|
||||
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* GLU 1.3 functions
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef GLU_VERSION_1_3
|
||||
|
||||
GLUAPI GLboolean GLAPIENTRY
|
||||
gluCheckExtension( const char *extName, const GLubyte *extString );
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if defined(__BEOS__) || defined(__QUICKDRAW__)
|
||||
#pragma export off
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef macintosh
|
||||
#pragma enumsalwaysint reset
|
||||
#if PRAGMA_IMPORT_SUPPORTED
|
||||
#pragma import off
|
||||
#endif
|
||||
typedef struct GLUnurbs GLUnurbs;
|
||||
typedef struct GLUquadric GLUquadric;
|
||||
typedef struct GLUtesselator GLUtesselator;
|
||||
#endif
|
||||
|
||||
typedef struct GLUnurbs GLUnurbsObj;
|
||||
typedef struct GLUquadric GLUquadricObj;
|
||||
typedef struct GLUtesselator GLUtesselatorObj;
|
||||
typedef struct GLUtesselator GLUtriangulatorObj;
|
||||
|
||||
#define GLU_TESS_MAX_COORD 1.0e150
|
||||
|
||||
/* Internal convenience typedefs */
|
||||
typedef void (*_GLUfuncptr)();
|
||||
|
||||
extern void gluBeginCurve (GLUnurbs* nurb);
|
||||
extern void gluBeginPolygon (GLUtesselator* tess);
|
||||
extern void gluBeginSurface (GLUnurbs* nurb);
|
||||
extern void gluBeginTrim (GLUnurbs* nurb);
|
||||
extern GLint gluBuild1DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
|
||||
extern GLint gluBuild1DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, const void *data);
|
||||
extern GLint gluBuild2DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
|
||||
extern GLint gluBuild2DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *data);
|
||||
extern GLint gluBuild3DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
|
||||
extern GLint gluBuild3DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data);
|
||||
extern GLboolean gluCheckExtension (const GLubyte *extName, const GLubyte *extString);
|
||||
extern void gluCylinder (GLUquadric* quad, GLdouble base, GLdouble top, GLdouble height, GLint slices, GLint stacks);
|
||||
extern void gluDeleteNurbsRenderer (GLUnurbs* nurb);
|
||||
extern void gluDeleteQuadric (GLUquadric* quad);
|
||||
extern void gluDeleteTess (GLUtesselator* tess);
|
||||
extern void gluDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops);
|
||||
extern void gluEndCurve (GLUnurbs* nurb);
|
||||
extern void gluEndPolygon (GLUtesselator* tess);
|
||||
extern void gluEndSurface (GLUnurbs* nurb);
|
||||
extern void gluEndTrim (GLUnurbs* nurb);
|
||||
extern const GLubyte * gluErrorString (GLenum error);
|
||||
extern void gluGetNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat* data);
|
||||
extern const GLubyte * gluGetString (GLenum name);
|
||||
extern void gluGetTessProperty (GLUtesselator* tess, GLenum which, GLdouble* data);
|
||||
extern void gluLoadSamplingMatrices (GLUnurbs* nurb, const GLfloat *model, const GLfloat *perspective, const GLint *view);
|
||||
extern void gluLookAt (GLdouble eyeX, GLdouble eyeY, GLdouble eyeZ, GLdouble centerX, GLdouble centerY, GLdouble centerZ, GLdouble upX, GLdouble upY, GLdouble upZ);
|
||||
extern GLUnurbs* gluNewNurbsRenderer (void);
|
||||
extern GLUquadric* gluNewQuadric (void);
|
||||
extern GLUtesselator* gluNewTess (void);
|
||||
extern void gluNextContour (GLUtesselator* tess, GLenum type);
|
||||
extern void gluNurbsCallback (GLUnurbs* nurb, GLenum which, _GLUfuncptr CallBackFunc);
|
||||
extern void gluNurbsCallbackData (GLUnurbs* nurb, GLvoid* userData);
|
||||
extern void gluNurbsCallbackDataEXT (GLUnurbs* nurb, GLvoid* userData);
|
||||
extern void gluNurbsCurve (GLUnurbs* nurb, GLint knotCount, GLfloat *knots, GLint stride, GLfloat *control, GLint order, GLenum type);
|
||||
extern void gluNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat value);
|
||||
extern void gluNurbsSurface (GLUnurbs* nurb, GLint sKnotCount, GLfloat* sKnots, GLint tKnotCount, GLfloat* tKnots, GLint sStride, GLint tStride, GLfloat* control, GLint sOrder, GLint tOrder, GLenum type);
|
||||
extern void gluOrtho2D (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top);
|
||||
extern void gluPartialDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops, GLdouble start, GLdouble sweep);
|
||||
extern void gluPerspective (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar);
|
||||
extern void gluPickMatrix (GLdouble x, GLdouble y, GLdouble delX, GLdouble delY, GLint *viewport);
|
||||
extern GLint gluProject (GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* winX, GLdouble* winY, GLdouble* winZ);
|
||||
extern void gluPwlCurve (GLUnurbs* nurb, GLint count, GLfloat* data, GLint stride, GLenum type);
|
||||
extern void gluQuadricCallback (GLUquadric* quad, GLenum which, _GLUfuncptr CallBackFunc);
|
||||
extern void gluQuadricDrawStyle (GLUquadric* quad, GLenum draw);
|
||||
extern void gluQuadricNormals (GLUquadric* quad, GLenum normal);
|
||||
extern void gluQuadricOrientation (GLUquadric* quad, GLenum orientation);
|
||||
extern void gluQuadricTexture (GLUquadric* quad, GLboolean texture);
|
||||
extern GLint gluScaleImage (GLenum format, GLsizei wIn, GLsizei hIn, GLenum typeIn, const void *dataIn, GLsizei wOut, GLsizei hOut, GLenum typeOut, GLvoid* dataOut);
|
||||
extern void gluSphere (GLUquadric* quad, GLdouble radius, GLint slices, GLint stacks);
|
||||
extern void gluTessBeginContour (GLUtesselator* tess);
|
||||
extern void gluTessBeginPolygon (GLUtesselator* tess, GLvoid* data);
|
||||
extern void gluTessCallback (GLUtesselator* tess, GLenum which, _GLUfuncptr CallBackFunc);
|
||||
extern void gluTessEndContour (GLUtesselator* tess);
|
||||
extern void gluTessEndPolygon (GLUtesselator* tess);
|
||||
extern void gluTessNormal (GLUtesselator* tess, GLdouble valueX, GLdouble valueY, GLdouble valueZ);
|
||||
extern void gluTessProperty (GLUtesselator* tess, GLenum which, GLdouble data);
|
||||
extern void gluTessVertex (GLUtesselator* tess, GLdouble *location, GLvoid* data);
|
||||
extern GLint gluUnProject (GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* objX, GLdouble* objY, GLdouble* objZ);
|
||||
extern GLint gluUnProject4 (GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble near, GLdouble far, GLdouble* objX, GLdouble* objY, GLdouble* objZ, GLdouble* objW);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
#endif /* __glu_h__ */
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/* $Id: glx.h,v 1.22 2000/06/23 17:39:18 brianp Exp $ */
|
||||
/* $Id: glx.h,v 1.27 2001/05/24 19:07:14 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.3
|
||||
* Version: 3.5
|
||||
*
|
||||
* Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
|
||||
*
|
||||
@@ -30,6 +30,7 @@
|
||||
|
||||
|
||||
#ifdef __VMS
|
||||
#include <GL/vms_x_fix.h>
|
||||
# ifdef __cplusplus
|
||||
/* VMS Xlib.h gives problems with C++.
|
||||
* this avoids a bunch of trivial warnings */
|
||||
@@ -43,11 +44,11 @@
|
||||
#pragma message enable nosimpint
|
||||
#endif
|
||||
#endif
|
||||
#include "GL/gl.h"
|
||||
#include <GL/gl.h>
|
||||
|
||||
|
||||
#if defined(USE_MGL_NAMESPACE)
|
||||
#include "glx_mangle.h"
|
||||
#include <GL/glx_mangle.h>
|
||||
#endif
|
||||
|
||||
|
||||
@@ -158,15 +159,15 @@ extern "C" {
|
||||
#define GLX_DAMAGED 0x8020
|
||||
#define GLX_SAVED 0x8021
|
||||
#define GLX_WINDOW 0x8022
|
||||
#define GLX_PBUFFER 0x8033
|
||||
#define GLX_PBUFFER 0x8023
|
||||
|
||||
|
||||
|
||||
typedef void * GLXContext;
|
||||
typedef struct __GLXcontextRec *GLXContext;
|
||||
typedef XID GLXPixmap;
|
||||
typedef XID GLXDrawable;
|
||||
/* GLX 1.3 and later */
|
||||
typedef void * GLXFBConfig;
|
||||
typedef struct __GLXFBConfigRec *GLXFBConfig;
|
||||
typedef XID GLXFBConfigID;
|
||||
typedef XID GLXContextID;
|
||||
typedef XID GLXWindow;
|
||||
@@ -279,11 +280,11 @@ extern void glXGetSelectedEvent( Display *dpy, GLXDrawable drawable,
|
||||
|
||||
|
||||
|
||||
/*#ifndef GLX_GLXEXT_LEGACY*/
|
||||
#ifndef GLX_GLXEXT_LEGACY
|
||||
|
||||
/*#include <GL/glxext.h>*/
|
||||
#include <GL/glxext.h>
|
||||
|
||||
/*#else*/
|
||||
#else
|
||||
|
||||
|
||||
/*
|
||||
@@ -413,7 +414,7 @@ extern Bool glXReleaseBuffersMESA( Display *dpy, GLXDrawable d );
|
||||
#define GLX_3DFX_WINDOW_MODE_MESA 0x1
|
||||
#define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2
|
||||
|
||||
extern GLboolean glXSet3DfxModeMESA( GLint mode );
|
||||
extern Bool glXSet3DfxModeMESA( int mode );
|
||||
|
||||
#endif /* GLX_MESA_set_3dfx_mode */
|
||||
|
||||
@@ -431,7 +432,7 @@ extern void (*glXGetProcAddressARB(const GLubyte *procName))();
|
||||
|
||||
|
||||
|
||||
/*#endif*/ /* GLX_GLXEXT_LEGACY */
|
||||
#endif /* GLX_GLXEXT_LEGACY */
|
||||
|
||||
|
||||
|
||||
|
||||
534
include/GL/glxext.h
Normal file
534
include/GL/glxext.h
Normal file
@@ -0,0 +1,534 @@
|
||||
#ifndef __glxext_h_
|
||||
#define __glxext_h_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** Original Code. The Original Code is: OpenGL Sample Implementation,
|
||||
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
|
||||
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
|
||||
** Copyright in any portions created by third parties is as indicated
|
||||
** elsewhere herein. All Rights Reserved.
|
||||
**
|
||||
** Additional Notice Provisions: This software was created using the
|
||||
** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
|
||||
** not been independently verified as being compliant with the OpenGL(R)
|
||||
** version 1.2.1 Specification.
|
||||
*/
|
||||
|
||||
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__)
|
||||
#define WIN32_LEAN_AND_MEAN 1
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#ifndef APIENTRY
|
||||
#define APIENTRY
|
||||
#endif
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
/* Header file version number, required by OpenGL ABI for Linux */
|
||||
#define GLX_GLXEXT_VERSION 2
|
||||
|
||||
#ifndef GLX_VERSION_1_3
|
||||
#define GLX_WINDOW_BIT 0x00000001
|
||||
#define GLX_PIXMAP_BIT 0x00000002
|
||||
#define GLX_PBUFFER_BIT 0x00000004
|
||||
#define GLX_RGBA_BIT 0x00000001
|
||||
#define GLX_COLOR_INDEX_BIT 0x00000002
|
||||
#define GLX_PBUFFER_CLOBBER_MASK 0x08000000
|
||||
#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001
|
||||
#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002
|
||||
#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004
|
||||
#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008
|
||||
#define GLX_AUX_BUFFERS_BIT 0x00000010
|
||||
#define GLX_DEPTH_BUFFER_BIT 0x00000020
|
||||
#define GLX_STENCIL_BUFFER_BIT 0x00000040
|
||||
#define GLX_ACCUM_BUFFER_BIT 0x00000080
|
||||
#define GLX_CONFIG_CAVEAT 0x20
|
||||
#define GLX_X_VISUAL_TYPE 0x22
|
||||
#define GLX_TRANSPARENT_TYPE 0x23
|
||||
#define GLX_TRANSPARENT_INDEX_VALUE 0x24
|
||||
#define GLX_TRANSPARENT_RED_VALUE 0x25
|
||||
#define GLX_TRANSPARENT_GREEN_VALUE 0x26
|
||||
#define GLX_TRANSPARENT_BLUE_VALUE 0x27
|
||||
#define GLX_TRANSPARENT_ALPHA_VALUE 0x28
|
||||
#define GLX_DONT_CARE 0xFFFFFFFF
|
||||
#define GLX_NONE 0x8000
|
||||
#define GLX_SLOW_CONFIG 0x8001
|
||||
#define GLX_TRUE_COLOR 0x8002
|
||||
#define GLX_DIRECT_COLOR 0x8003
|
||||
#define GLX_PSEUDO_COLOR 0x8004
|
||||
#define GLX_STATIC_COLOR 0x8005
|
||||
#define GLX_GRAY_SCALE 0x8006
|
||||
#define GLX_STATIC_GRAY 0x8007
|
||||
#define GLX_TRANSPARENT_RGB 0x8008
|
||||
#define GLX_TRANSPARENT_INDEX 0x8009
|
||||
#define GLX_VISUAL_ID 0x800B
|
||||
#define GLX_SCREEN 0x800C
|
||||
#define GLX_NON_CONFORMANT_CONFIG 0x800D
|
||||
#define GLX_DRAWABLE_TYPE 0x8010
|
||||
#define GLX_RENDER_TYPE 0x8011
|
||||
#define GLX_X_RENDERABLE 0x8012
|
||||
#define GLX_FBCONFIG_ID 0x8013
|
||||
#define GLX_RGBA_TYPE 0x8014
|
||||
#define GLX_COLOR_INDEX_TYPE 0x8015
|
||||
#define GLX_MAX_PBUFFER_WIDTH 0x8016
|
||||
#define GLX_MAX_PBUFFER_HEIGHT 0x8017
|
||||
#define GLX_MAX_PBUFFER_PIXELS 0x8018
|
||||
#define GLX_PRESERVED_CONTENTS 0x801B
|
||||
#define GLX_LARGEST_PBUFFER 0x801C
|
||||
#define GLX_WIDTH 0x801D
|
||||
#define GLX_HEIGHT 0x801E
|
||||
#define GLX_EVENT_MASK 0x801F
|
||||
#define GLX_DAMAGED 0x8020
|
||||
#define GLX_SAVED 0x8021
|
||||
#define GLX_WINDOW 0x8022
|
||||
#define GLX_PBUFFER 0x8023
|
||||
#define GLX_PBUFFER_HEIGHT 0x8040
|
||||
#define GLX_PBUFFER_WIDTH 0x8041
|
||||
#endif
|
||||
|
||||
/* XXX Added by BrianP */
|
||||
#ifndef GLX_SGIS_multisample
|
||||
#define GLX_SAMPLE_BUFFERS_SGIS 100000
|
||||
#define GLX_SAMPLES_SGIS 100001
|
||||
#endif
|
||||
|
||||
#ifndef GLX_EXT_visual_info
|
||||
#define GLX_X_VISUAL_TYPE_EXT 0x22
|
||||
#define GLX_TRANSPARENT_TYPE_EXT 0x23
|
||||
#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24
|
||||
#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25
|
||||
#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26
|
||||
#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27
|
||||
#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28
|
||||
#define GLX_NONE_EXT 0x8000
|
||||
#define GLX_TRUE_COLOR_EXT 0x8002
|
||||
#define GLX_DIRECT_COLOR_EXT 0x8003
|
||||
#define GLX_PSEUDO_COLOR_EXT 0x8004
|
||||
#define GLX_STATIC_COLOR_EXT 0x8005
|
||||
#define GLX_GRAY_SCALE_EXT 0x8006
|
||||
#define GLX_STATIC_GRAY_EXT 0x8007
|
||||
#define GLX_TRANSPARENT_RGB_EXT 0x8008
|
||||
#define GLX_TRANSPARENT_INDEX_EXT 0x8009
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGI_swap_control
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGI_video_sync
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGI_make_current_read
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_video_source
|
||||
#endif
|
||||
|
||||
#ifndef GLX_EXT_visual_rating
|
||||
#define GLX_VISUAL_CAVEAT_EXT 0x20
|
||||
#define GLX_SLOW_VISUAL_EXT 0x8001
|
||||
#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D
|
||||
/* reuse GLX_NONE_EXT */
|
||||
#endif
|
||||
|
||||
#ifndef GLX_EXT_import_context
|
||||
#define GLX_SHARE_CONTEXT_EXT 0x800A
|
||||
#define GLX_VISUAL_ID_EXT 0x800B
|
||||
#define GLX_SCREEN_EXT 0x800C
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_fbconfig
|
||||
#define GLX_WINDOW_BIT_SGIX 0x00000001
|
||||
#define GLX_PIXMAP_BIT_SGIX 0x00000002
|
||||
#define GLX_RGBA_BIT_SGIX 0x00000001
|
||||
#define GLX_COLOR_INDEX_BIT_SGIX 0x00000002
|
||||
#define GLX_DRAWABLE_TYPE_SGIX 0x8010
|
||||
#define GLX_RENDER_TYPE_SGIX 0x8011
|
||||
#define GLX_X_RENDERABLE_SGIX 0x8012
|
||||
#define GLX_FBCONFIG_ID_SGIX 0x8013
|
||||
#define GLX_RGBA_TYPE_SGIX 0x8014
|
||||
#define GLX_COLOR_INDEX_TYPE_SGIX 0x8015
|
||||
/* reuse GLX_SCREEN_EXT */
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_pbuffer
|
||||
#define GLX_PBUFFER_BIT_SGIX 0x00000004
|
||||
#define GLX_BUFFER_CLOBBER_MASK_SGIX 0x08000000
|
||||
#define GLX_FRONT_LEFT_BUFFER_BIT_SGIX 0x00000001
|
||||
#define GLX_FRONT_RIGHT_BUFFER_BIT_SGIX 0x00000002
|
||||
#define GLX_BACK_LEFT_BUFFER_BIT_SGIX 0x00000004
|
||||
#define GLX_BACK_RIGHT_BUFFER_BIT_SGIX 0x00000008
|
||||
#define GLX_AUX_BUFFERS_BIT_SGIX 0x00000010
|
||||
#define GLX_DEPTH_BUFFER_BIT_SGIX 0x00000020
|
||||
#define GLX_STENCIL_BUFFER_BIT_SGIX 0x00000040
|
||||
#define GLX_ACCUM_BUFFER_BIT_SGIX 0x00000080
|
||||
#define GLX_SAMPLE_BUFFERS_BIT_SGIX 0x00000100
|
||||
#define GLX_MAX_PBUFFER_WIDTH_SGIX 0x8016
|
||||
#define GLX_MAX_PBUFFER_HEIGHT_SGIX 0x8017
|
||||
#define GLX_MAX_PBUFFER_PIXELS_SGIX 0x8018
|
||||
#define GLX_OPTIMAL_PBUFFER_WIDTH_SGIX 0x8019
|
||||
#define GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX 0x801A
|
||||
#define GLX_PRESERVED_CONTENTS_SGIX 0x801B
|
||||
#define GLX_LARGEST_PBUFFER_SGIX 0x801C
|
||||
#define GLX_WIDTH_SGIX 0x801D
|
||||
#define GLX_HEIGHT_SGIX 0x801E
|
||||
#define GLX_EVENT_MASK_SGIX 0x801F
|
||||
#define GLX_DAMAGED_SGIX 0x8020
|
||||
#define GLX_SAVED_SGIX 0x8021
|
||||
#define GLX_WINDOW_SGIX 0x8022
|
||||
#define GLX_PBUFFER_SGIX 0x8023
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGI_cushion
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_video_resize
|
||||
#define GLX_SYNC_FRAME_SGIX 0x00000000
|
||||
#define GLX_SYNC_SWAP_SGIX 0x00000001
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_dmbuffer
|
||||
#define GLX_DIGITAL_MEDIA_PBUFFER_SGIX 0x8024
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_swap_group
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_swap_barrier
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIS_blended_overlay
|
||||
#define GLX_BLENDED_RGBA_SGIS 0x8025
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIS_shared_multisample
|
||||
#define GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026
|
||||
#define GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SUN_get_transparent_index
|
||||
#endif
|
||||
|
||||
#ifndef GLX_3DFX_multisample
|
||||
#define GLX_SAMPLE_BUFFERS_3DFX 0x8050
|
||||
#define GLX_SAMPLES_3DFX 0x8051
|
||||
#endif
|
||||
|
||||
#ifndef GLX_MESA_copy_sub_buffer
|
||||
#endif
|
||||
|
||||
#ifndef GLX_MESA_pixmap_colormap
|
||||
#endif
|
||||
|
||||
#ifndef GLX_MESA_release_buffers
|
||||
#endif
|
||||
|
||||
#ifndef GLX_MESA_set_3dfx_mode
|
||||
#define GLX_3DFX_WINDOW_MODE_MESA 0x1
|
||||
#define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
#ifndef GLX_ARB_get_proc_address
|
||||
/* XXX Added void parameter to silence many, many warnings (BrianP) */
|
||||
typedef void (*__GLXextFuncPtr)(void);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_video_source
|
||||
typedef XID GLXVideoSourceSGIX;
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_fbconfig
|
||||
typedef XID GLXFBConfigIDSGIX;
|
||||
typedef struct __GLXFBConfigRec *GLXFBConfigSGIX;
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_pbuffer
|
||||
typedef XID GLXPbufferSGIX;
|
||||
typedef struct {
|
||||
int type;
|
||||
unsigned long serial; /* # of last request processed by server */
|
||||
Bool send_event; /* true if this came for SendEvent request */
|
||||
Display *display; /* display the event was read from */
|
||||
GLXDrawable drawable; /* i.d. of Drawable */
|
||||
int event_type; /* GLX_DAMAGED_SGIX or GLX_SAVED_SGIX */
|
||||
int draw_type; /* GLX_WINDOW_SGIX or GLX_PBUFFER_SGIX */
|
||||
unsigned int mask; /* mask indicating which buffers are affected*/
|
||||
int x, y;
|
||||
int width, height;
|
||||
int count; /* if nonzero, at least this many more */
|
||||
} GLXBufferClobberEventSGIX;
|
||||
#endif
|
||||
|
||||
#ifndef GLX_VERSION_1_3
|
||||
#define GLX_VERSION_1_3 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern GLXFBConfig * glXGetFBConfigs (Display *, int, int *);
|
||||
extern GLXFBConfig * glXChooseFBConfig (Display *, int, const int *, int *);
|
||||
extern int glXGetFBConfigAttrib (Display *, GLXFBConfig, int, int *);
|
||||
extern XVisualInfo * glXGetVisualFromFBConfig (Display *, GLXFBConfig);
|
||||
extern GLXWindow glXCreateWindow (Display *, GLXFBConfig, Window, const int *);
|
||||
extern void glXDestroyWindow (Display *, GLXWindow);
|
||||
extern GLXPixmap glXCreatePixmap (Display *, GLXFBConfig, Pixmap, const int *);
|
||||
extern void glXDestroyPixmap (Display *, GLXPixmap);
|
||||
extern GLXPbuffer glXCreatePbuffer (Display *, GLXFBConfig, const int *);
|
||||
extern void glXDestroyPbuffer (Display *, GLXPbuffer);
|
||||
extern void glXQueryDrawable (Display *, GLXDrawable, int, unsigned int *);
|
||||
extern GLXContext glXCreateNewContext (Display *, GLXFBConfig, int, GLXContext, Bool);
|
||||
extern Bool glXMakeContextCurrent (Display *, GLXDrawable, GLXDrawable, GLXContext);
|
||||
extern GLXDrawable glXGetCurrentReadDrawable (void);
|
||||
extern Display * glXGetCurrentDisplay (void);
|
||||
extern int glXQueryContext (Display *, GLXContext, int, int *);
|
||||
extern void glXSelectEvent (Display *, GLXDrawable, unsigned long);
|
||||
extern void glXGetSelectedEvent (Display *, GLXDrawable, unsigned long *);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef GLXFBConfig * ( * PFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements);
|
||||
typedef GLXFBConfig * ( * PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements);
|
||||
typedef int ( * PFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value);
|
||||
typedef XVisualInfo * ( * PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config);
|
||||
typedef GLXWindow ( * PFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list);
|
||||
typedef void ( * PFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win);
|
||||
typedef GLXPixmap ( * PFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list);
|
||||
typedef void ( * PFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap);
|
||||
typedef GLXPbuffer ( * PFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list);
|
||||
typedef void ( * PFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf);
|
||||
typedef void ( * PFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
|
||||
typedef GLXContext ( * PFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
|
||||
typedef Bool ( * PFNGLXMAKECONTEXTCURRENTPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
|
||||
typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLEPROC) (void);
|
||||
typedef Display * ( * PFNGLXGETCURRENTDISPLAYPROC) (void);
|
||||
typedef int ( * PFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value);
|
||||
typedef void ( * PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask);
|
||||
typedef void ( * PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_ARB_get_proc_address
|
||||
#define GLX_ARB_get_proc_address 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSARBPROC) (const GLubyte *procName);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIS_multisample
|
||||
#define GLX_SGIS_multisample 1
|
||||
#endif
|
||||
|
||||
#ifndef GLX_EXT_visual_info
|
||||
#define GLX_EXT_visual_info 1
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGI_swap_control
|
||||
#define GLX_SGI_swap_control 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern int glXSwapIntervalSGI (int);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef int ( * PFNGLXSWAPINTERVALSGIPROC) (int interval);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGI_video_sync
|
||||
#define GLX_SGI_video_sync 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern int glXGetVideoSyncSGI (unsigned int *);
|
||||
extern int glXWaitVideoSyncSGI (int, int, unsigned int *);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef int ( * PFNGLXGETVIDEOSYNCSGIPROC) (unsigned int *count);
|
||||
typedef int ( * PFNGLXWAITVIDEOSYNCSGIPROC) (int divisor, int remainder, unsigned int *count);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGI_make_current_read
|
||||
#define GLX_SGI_make_current_read 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern Bool glXMakeCurrentReadSGI (Display *, GLXDrawable, GLXDrawable, GLXContext);
|
||||
extern GLXDrawable glXGetCurrentReadDrawableSGI (void);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef Bool ( * PFNGLXMAKECURRENTREADSGIPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
|
||||
typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLESGIPROC) (void);
|
||||
#endif
|
||||
|
||||
#ifdef _VL_H
|
||||
#ifndef GLX_SGIX_video_source
|
||||
#define GLX_SGIX_video_source 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern GLXVideoSourceSGIX glXCreateGLXVideoSourceSGIX (Display *, int, VLServer, VLPath, int, VLNode);
|
||||
extern void glXDestroyGLXVideoSourceSGIX (Display *, GLXVideoSourceSGIX);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef GLXVideoSourceSGIX ( * PFNGLXCREATEGLXVIDEOSOURCESGIXPROC) (Display *display, int screen, VLServer server, VLPath path, int nodeClass, VLNode drainNode);
|
||||
typedef void ( * PFNGLXDESTROYGLXVIDEOSOURCESGIXPROC) (Display *dpy, GLXVideoSourceSGIX glxvideosource);
|
||||
#endif
|
||||
|
||||
#endif /* _VL_H */
|
||||
#ifndef GLX_EXT_visual_rating
|
||||
#define GLX_EXT_visual_rating 1
|
||||
#endif
|
||||
|
||||
#ifndef GLX_EXT_import_context
|
||||
#define GLX_EXT_import_context 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern Display * glXGetCurrentDisplayEXT (void);
|
||||
extern int glXQueryContextInfoEXT (Display *, GLXContext, int, int *);
|
||||
extern GLXContextID glXGetContextIDEXT (GLXContext);
|
||||
extern GLXContext glXImportContextEXT (Display *, GLXContextID);
|
||||
extern void glXFreeContextEXT (Display *, GLXContext);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef Display * ( * PFNGLXGETCURRENTDISPLAYEXTPROC) (void);
|
||||
typedef int ( * PFNGLXQUERYCONTEXTINFOEXTPROC) (Display *dpy, GLXContext context, int attribute, int *value);
|
||||
typedef GLXContextID ( * PFNGLXGETCONTEXTIDEXTPROC) (GLXContext context);
|
||||
typedef GLXContext ( * PFNGLXIMPORTCONTEXTEXTPROC) (Display *dpy, GLXContextID contextID);
|
||||
typedef void ( * PFNGLXFREECONTEXTEXTPROC) (Display *dpy, GLXContext context);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_fbconfig
|
||||
#define GLX_SGIX_fbconfig 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern int glXGetFBConfigAttribSGIX (Display *, GLXFBConfigSGIX, int, int *);
|
||||
extern GLXFBConfigSGIX * glXChooseFBConfigSGIX (Display *, int, int *, int *);
|
||||
extern GLXPixmap glXCreateGLXPixmapWithConfigSGIX (Display *, GLXFBConfigSGIX, Pixmap);
|
||||
extern GLXContext glXCreateContextWithConfigSGIX (Display *, GLXFBConfigSGIX, int, GLXContext, Bool);
|
||||
extern XVisualInfo * glXGetVisualFromFBConfigSGIX (Display *, GLXFBConfigSGIX);
|
||||
extern GLXFBConfigSGIX glXGetFBConfigFromVisualSGIX (Display *, XVisualInfo *);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef int ( * PFNGLXGETFBCONFIGATTRIBSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, int attribute, int *value);
|
||||
typedef GLXFBConfigSGIX * ( * PFNGLXCHOOSEFBCONFIGSGIXPROC) (Display *dpy, int screen, int *attrib_list, int *nelements);
|
||||
typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, Pixmap pixmap);
|
||||
typedef GLXContext ( * PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct);
|
||||
typedef XVisualInfo * ( * PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config);
|
||||
typedef GLXFBConfigSGIX ( * PFNGLXGETFBCONFIGFROMVISUALSGIXPROC) (Display *dpy, XVisualInfo *vis);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_pbuffer
|
||||
#define GLX_SGIX_pbuffer 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern GLXPbufferSGIX glXCreateGLXPbufferSGIX (Display *, GLXFBConfigSGIX, unsigned int, unsigned int, int *);
|
||||
extern void glXDestroyGLXPbufferSGIX (Display *, GLXPbufferSGIX);
|
||||
extern int glXQueryGLXPbufferSGIX (Display *, GLXPbufferSGIX, int, unsigned int *);
|
||||
extern void glXSelectEventSGIX (Display *, GLXDrawable, unsigned long);
|
||||
extern void glXGetSelectedEventSGIX (Display *, GLXDrawable, unsigned long *);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef GLXPbufferSGIX ( * PFNGLXCREATEGLXPBUFFERSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list);
|
||||
typedef void ( * PFNGLXDESTROYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf);
|
||||
typedef int ( * PFNGLXQUERYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value);
|
||||
typedef void ( * PFNGLXSELECTEVENTSGIXPROC) (Display *dpy, GLXDrawable drawable, unsigned long mask);
|
||||
typedef void ( * PFNGLXGETSELECTEDEVENTSGIXPROC) (Display *dpy, GLXDrawable drawable, unsigned long *mask);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGI_cushion
|
||||
#define GLX_SGI_cushion 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern void glXCushionSGI (Display *, Window, float);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef void ( * PFNGLXCUSHIONSGIPROC) (Display *dpy, Window window, float cushion);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_video_resize
|
||||
#define GLX_SGIX_video_resize 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern int glXBindChannelToWindowSGIX (Display *, int, int, Window);
|
||||
extern int glXChannelRectSGIX (Display *, int, int, int, int, int, int);
|
||||
extern int glXQueryChannelRectSGIX (Display *, int, int, int *, int *, int *, int *);
|
||||
extern int glXQueryChannelDeltasSGIX (Display *, int, int, int *, int *, int *, int *);
|
||||
extern int glXChannelRectSyncSGIX (Display *, int, int, GLenum);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef int ( * PFNGLXBINDCHANNELTOWINDOWSGIXPROC) (Display *display, int screen, int channel, Window window);
|
||||
typedef int ( * PFNGLXCHANNELRECTSGIXPROC) (Display *display, int screen, int channel, int x, int y, int w, int h);
|
||||
typedef int ( * PFNGLXQUERYCHANNELRECTSGIXPROC) (Display *display, int screen, int channel, int *dx, int *dy, int *dw, int *dh);
|
||||
typedef int ( * PFNGLXQUERYCHANNELDELTASSGIXPROC) (Display *display, int screen, int channel, int *x, int *y, int *w, int *h);
|
||||
typedef int ( * PFNGLXCHANNELRECTSYNCSGIXPROC) (Display *display, int screen, int channel, GLenum synctype);
|
||||
#endif
|
||||
|
||||
#ifdef _DM_BUFFER_H_
|
||||
#ifndef GLX_SGIX_dmbuffer
|
||||
#define GLX_SGIX_dmbuffer 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern Bool glXAssociateDMPbufferSGIX (Display *, GLXPbufferSGIX, DMparams *, DMbuffer);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef Bool ( * PFNGLXASSOCIATEDMPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuffer, DMparams *params, DMbuffer dmbuffer);
|
||||
#endif
|
||||
|
||||
#endif /* _DM_BUFFER_H_ */
|
||||
#ifndef GLX_SGIX_swap_group
|
||||
#define GLX_SGIX_swap_group 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern void glXJoinSwapGroupSGIX (Display *, GLXDrawable, GLXDrawable);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef void ( * PFNGLXJOINSWAPGROUPSGIXPROC) (Display *dpy, GLXDrawable drawable, GLXDrawable member);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SGIX_swap_barrier
|
||||
#define GLX_SGIX_swap_barrier 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern void glXBindSwapBarrierSGIX (Display *, GLXDrawable, int);
|
||||
extern Bool glXQueryMaxSwapBarriersSGIX (Display *, int, int *);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef void ( * PFNGLXBINDSWAPBARRIERSGIXPROC) (Display *dpy, GLXDrawable drawable, int barrier);
|
||||
typedef Bool ( * PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC) (Display *dpy, int screen, int *max);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_SUN_get_transparent_index
|
||||
#define GLX_SUN_get_transparent_index 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern Status glXGetTransparentIndexSUN (Display *, Window, Window, long *);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef Status ( * PFNGLXGETTRANSPARENTINDEXSUNPROC) (Display *dpy, Window overlay, Window underlay, long *pTransparentIndex);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_MESA_copy_sub_buffer
|
||||
#define GLX_MESA_copy_sub_buffer 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern void glXCopySubBufferMESA (Display *, GLXDrawable, int, int, int, int);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef void ( * PFNGLXCOPYSUBBUFFERMESAPROC) (Display *dpy, GLXDrawable drawable, int x, int y, int width, int height);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_MESA_pixmap_colormap
|
||||
#define GLX_MESA_pixmap_colormap 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern GLXPixmap glXCreateGLXPixmapMESA (Display *, XVisualInfo *, Pixmap, Colormap);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPMESAPROC) (Display *dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_MESA_release_buffers
|
||||
#define GLX_MESA_release_buffers 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern Bool glXReleaseBuffersMESA (Display *, GLXDrawable);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef Bool ( * PFNGLXRELEASEBUFFERSMESAPROC) (Display *dpy, GLXDrawable drawable);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_MESA_set_3dfx_mode
|
||||
#define GLX_MESA_set_3dfx_mode 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern Bool glXSet3DfxModeMESA (int);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef Bool ( * PFNGLXSET3DFXMODEMESAPROC) (int mode);
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
424
include/GL/internal/glcore-new.h
Normal file
424
include/GL/internal/glcore-new.h
Normal file
@@ -0,0 +1,424 @@
|
||||
#ifndef __gl_core_h_
|
||||
#define __gl_core_h_
|
||||
|
||||
/*
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** Original Code. The Original Code is: OpenGL Sample Implementation,
|
||||
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
|
||||
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
|
||||
** Copyright in any portions created by third parties is as indicated
|
||||
** elsewhere herein. All Rights Reserved.
|
||||
**
|
||||
** Additional Notice Provisions: The application programming interfaces
|
||||
** established by SGI in conjunction with the Original Code are The
|
||||
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
|
||||
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
|
||||
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
|
||||
** Window System(R) (Version 1.3), released October 19, 1998. This software
|
||||
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
|
||||
** published by SGI, but has not been independently verified as being
|
||||
** compliant with the OpenGL(R) version 1.2.1 Specification.
|
||||
**
|
||||
** $Date: 2001/01/08 03:56:53 $ $Revision: 1.1 $
|
||||
** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/include/GL/internal/Attic/glcore-new.h,v 1.1 2001/01/08 03:56:53 keithw Exp $
|
||||
*/
|
||||
|
||||
#ifdef XFree86LOADER
|
||||
#include "xf86_ansic.h"
|
||||
#else
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
typedef struct __GLcontextRec __GLcontext;
|
||||
typedef struct __GLinterfaceRec __GLinterface;
|
||||
|
||||
/*
|
||||
** This file defines the interface between the GL core and the surrounding
|
||||
** "operating system" that supports it (currently the GLX or WGL extensions).
|
||||
**
|
||||
** Members (data and function pointers) are documented as imported or
|
||||
** exported according to how they are used by the core rendering functions.
|
||||
** Imported members are initialized by the "operating system" and used by
|
||||
** the core functions. Exported members are initialized by the core functions
|
||||
** and used by the "operating system".
|
||||
*/
|
||||
|
||||
/*
|
||||
** Mode and limit information for a context. This information is
|
||||
** kept around in the context so that values can be used during
|
||||
** command execution, and for returning information about the
|
||||
** context to the application.
|
||||
*/
|
||||
typedef struct __GLcontextModesRec {
|
||||
GLboolean rgbMode;
|
||||
GLboolean colorIndexMode;
|
||||
GLboolean doubleBufferMode;
|
||||
GLboolean stereoMode;
|
||||
|
||||
GLboolean haveAccumBuffer;
|
||||
GLboolean haveDepthBuffer;
|
||||
GLboolean haveStencilBuffer;
|
||||
|
||||
GLint redBits, greenBits, blueBits, alphaBits; /* bits per comp */
|
||||
GLuint redMask, greenMask, blueMask, alphaMask;
|
||||
GLint rgbBits; /* total bits for rgb */
|
||||
GLint indexBits; /* total bits for colorindex */
|
||||
|
||||
GLint accumRedBits, accumGreenBits, accumBlueBits, accumAlphaBits;
|
||||
GLint depthBits;
|
||||
GLint stencilBits;
|
||||
|
||||
GLint numAuxBuffers;
|
||||
|
||||
GLint level;
|
||||
|
||||
GLint pixmapMode;
|
||||
} __GLcontextModes;
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
/*
|
||||
** Structure used for allocating and freeing drawable private memory.
|
||||
** (like software buffers, for example).
|
||||
**
|
||||
** The memory allocation routines are provided by the surrounding
|
||||
** "operating system" code, and they are to be used for allocating
|
||||
** software buffers and things which are associated with the drawable,
|
||||
** and used by any context which draws to that drawable. There are
|
||||
** separate memory allocation functions for drawables and contexts
|
||||
** since drawables and contexts can be created and destroyed independently
|
||||
** of one another, and the "operating system" may want to use separate
|
||||
** allocation arenas for each.
|
||||
**
|
||||
** The freePrivate function is filled in by the core routines when they
|
||||
** allocates software buffers, and stick them in "private". The freePrivate
|
||||
** function will destroy anything allocated to this drawable (to be called
|
||||
** when the drawable is destroyed).
|
||||
*/
|
||||
typedef struct __GLdrawableRegionRec __GLdrawableRegion;
|
||||
typedef struct __GLdrawableBufferRec __GLdrawableBuffer;
|
||||
typedef struct __GLdrawablePrivateRec __GLdrawablePrivate;
|
||||
|
||||
typedef struct __GLregionRectRec {
|
||||
/* lower left (inside the rectangle) */
|
||||
GLint x0, y0;
|
||||
/* upper right (outside the rectangle) */
|
||||
GLint x1, y1;
|
||||
} __GLregionRect;
|
||||
|
||||
struct __GLdrawableRegionRec {
|
||||
GLint numRects;
|
||||
__GLregionRect *rects;
|
||||
__GLregionRect boundingRect;
|
||||
};
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
/* masks for the buffers */
|
||||
#define __GL_FRONT_BUFFER_MASK 0x00000001
|
||||
#define __GL_FRONT_LEFT_BUFFER_MASK 0x00000001
|
||||
#define __GL_FRONT_RIGHT_BUFFER_MASK 0x00000002
|
||||
#define __GL_BACK_BUFFER_MASK 0x00000004
|
||||
#define __GL_BACK_LEFT_BUFFER_MASK 0x00000004
|
||||
#define __GL_BACK_RIGHT_BUFFER_MASK 0x00000008
|
||||
#define __GL_ACCUM_BUFFER_MASK 0x00000010
|
||||
#define __GL_DEPTH_BUFFER_MASK 0x00000020
|
||||
#define __GL_STENCIL_BUFFER_MASK 0x00000040
|
||||
#define __GL_AUX_BUFFER_MASK(i) (0x0000080 << (i))
|
||||
|
||||
#define __GL_ALL_BUFFER_MASK 0xffffffff
|
||||
|
||||
/* what Resize routines return if resize resorted to fallback case */
|
||||
#define __GL_BUFFER_FALLBACK 0x10
|
||||
|
||||
typedef void (*__GLbufFallbackInitFn)(__GLdrawableBuffer *buf,
|
||||
__GLdrawablePrivate *glPriv, GLint bits);
|
||||
typedef void (*__GLbufMainInitFn)(__GLdrawableBuffer *buf,
|
||||
__GLdrawablePrivate *glPriv, GLint bits,
|
||||
__GLbufFallbackInitFn back);
|
||||
|
||||
/*
|
||||
** A drawable buffer
|
||||
**
|
||||
** This data structure describes the context side of a drawable.
|
||||
**
|
||||
** According to the spec there could be multiple contexts bound to the same
|
||||
** drawable at the same time (from different threads). In order to avoid
|
||||
** multiple-access conflicts, locks are used to serialize access. When a
|
||||
** thread needs to access (read or write) a member of the drawable, it takes
|
||||
** a lock first. Some of the entries in the drawable are treated "mostly
|
||||
** constant", so we take the freedom of allowing access to them without
|
||||
** taking a lock (for optimization reasons).
|
||||
**
|
||||
** For more details regarding locking, see buffers.h in the GL core
|
||||
*/
|
||||
struct __GLdrawableBufferRec {
|
||||
/*
|
||||
** Buffer dimensions
|
||||
*/
|
||||
GLint width, height, depth;
|
||||
|
||||
/*
|
||||
** Framebuffer base address
|
||||
*/
|
||||
void *base;
|
||||
|
||||
/*
|
||||
** Framebuffer size (in bytes)
|
||||
*/
|
||||
GLuint size;
|
||||
|
||||
/*
|
||||
** Size (in bytes) of each element in the framebuffer
|
||||
*/
|
||||
GLuint elementSize;
|
||||
GLuint elementSizeLog2;
|
||||
|
||||
/*
|
||||
** Element skip from one scanline to the next.
|
||||
** If the buffer is part of another buffer (for example, fullscreen
|
||||
** front buffer), outerWidth is the width of that buffer.
|
||||
*/
|
||||
GLint outerWidth;
|
||||
|
||||
/*
|
||||
** outerWidth * elementSize
|
||||
*/
|
||||
GLint byteWidth;
|
||||
|
||||
/*
|
||||
** Allocation/deallocation is done based on this handle. A handle
|
||||
** is conceptually different from the framebuffer 'base'.
|
||||
*/
|
||||
void *handle;
|
||||
|
||||
/* imported */
|
||||
GLboolean (*resize)(__GLdrawableBuffer *buf,
|
||||
GLint x, GLint y, GLuint width, GLuint height,
|
||||
__GLdrawablePrivate *glPriv, GLuint bufferMask);
|
||||
void (*lock)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv);
|
||||
void (*unlock)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv);
|
||||
void (*fill)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv,
|
||||
GLuint val, GLint x, GLint y, GLint w, GLint h);
|
||||
void (*free)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv);
|
||||
|
||||
/* exported */
|
||||
void (*freePrivate)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv);
|
||||
#ifdef __cplusplus
|
||||
void *privatePtr;
|
||||
#else
|
||||
void *private;
|
||||
#endif
|
||||
|
||||
/* private */
|
||||
void *other; /* implementation private data */
|
||||
__GLbufMainInitFn mainInit;
|
||||
__GLbufFallbackInitFn fallbackInit;
|
||||
};
|
||||
|
||||
/*
|
||||
** The context side of the drawable private
|
||||
*/
|
||||
struct __GLdrawablePrivateRec {
|
||||
/*
|
||||
** Drawable Modes
|
||||
*/
|
||||
__GLcontextModes *modes;
|
||||
|
||||
/*
|
||||
** Drawable size
|
||||
*/
|
||||
GLuint width, height;
|
||||
|
||||
/*
|
||||
** Origin in screen coordinates of the drawable
|
||||
*/
|
||||
GLint xOrigin, yOrigin;
|
||||
#ifdef __GL_ALIGNED_BUFFERS
|
||||
/*
|
||||
** Drawable offset from screen origin
|
||||
*/
|
||||
GLint xOffset, yOffset;
|
||||
|
||||
/*
|
||||
** Alignment restriction
|
||||
*/
|
||||
GLint xAlignment, yAlignment;
|
||||
#endif
|
||||
/*
|
||||
** Should we invert the y axis?
|
||||
*/
|
||||
GLint yInverted;
|
||||
|
||||
/*
|
||||
** Mask specifying which buffers are renderable by the hw
|
||||
*/
|
||||
GLuint accelBufferMask;
|
||||
|
||||
/*
|
||||
** the buffers themselves
|
||||
*/
|
||||
__GLdrawableBuffer frontBuffer;
|
||||
__GLdrawableBuffer backBuffer;
|
||||
__GLdrawableBuffer accumBuffer;
|
||||
__GLdrawableBuffer depthBuffer;
|
||||
__GLdrawableBuffer stencilBuffer;
|
||||
#if __GL_NUMBER_OF_AUX_BUFFERS > 0
|
||||
__GLdrawableBuffer *auxBuffer;
|
||||
#endif
|
||||
|
||||
__GLdrawableRegion ownershipRegion;
|
||||
|
||||
/*
|
||||
** Lock for the drawable private structure
|
||||
*/
|
||||
void *lock;
|
||||
#ifdef DEBUG
|
||||
/* lock debugging info */
|
||||
int lockRefCount;
|
||||
int lockLine[10];
|
||||
char *lockFile[10];
|
||||
#endif
|
||||
|
||||
/* imported */
|
||||
void *(*malloc)(size_t size);
|
||||
void *(*calloc)(size_t numElem, size_t elemSize);
|
||||
void *(*realloc)(void *oldAddr, size_t newSize);
|
||||
void (*free)(void *addr);
|
||||
|
||||
GLboolean (*addSwapRect)(__GLdrawablePrivate *glPriv,
|
||||
GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
void (*setClipRect)(__GLdrawablePrivate *glPriv,
|
||||
GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
void (*updateClipRegion)(__GLdrawablePrivate *glPriv);
|
||||
GLboolean (*resize)(__GLdrawablePrivate *glPriv);
|
||||
void (*getDrawableSize)(__GLdrawablePrivate *glPriv,
|
||||
GLint *x, GLint *y, GLuint *width, GLuint *height);
|
||||
|
||||
void (*lockDP)(__GLdrawablePrivate *glPriv, __GLcontext *gc);
|
||||
void (*unlockDP)(__GLdrawablePrivate *glPriv);
|
||||
|
||||
/* exported */
|
||||
void *wsPriv; /* pointer to the window system DrawablePrivate */
|
||||
#ifdef __cplusplus
|
||||
void *privatePtr;
|
||||
#else
|
||||
void *private;
|
||||
#endif
|
||||
void (*freePrivate)(__GLdrawablePrivate *);
|
||||
|
||||
/* client data */
|
||||
void *other;
|
||||
};
|
||||
|
||||
/*
|
||||
** Macros to lock/unlock the drawable private
|
||||
*/
|
||||
#if defined(DEBUG)
|
||||
#define __GL_LOCK_DP(glPriv,gc) \
|
||||
(*(glPriv)->lockDP)(glPriv,gc); \
|
||||
(glPriv)->lockLine[(glPriv)->lockRefCount] = __LINE__; \
|
||||
(glPriv)->lockFile[(glPriv)->lockRefCount] = __FILE__; \
|
||||
(glPriv)->lockRefCount++
|
||||
#define __GL_UNLOCK_DP(glPriv) \
|
||||
(glPriv)->lockRefCount--; \
|
||||
(glPriv)->lockLine[(glPriv)->lockRefCount] = 0; \
|
||||
(glPriv)->lockFile[(glPriv)->lockRefCount] = NULL; \
|
||||
(*(glPriv)->unlockDP)(glPriv)
|
||||
#else /* DEBUG */
|
||||
#define __GL_LOCK_DP(glPriv,gc) (*(glPriv)->lockDP)(glPriv,gc)
|
||||
#define __GL_UNLOCK_DP(glPriv) (*(glPriv)->unlockDP)(glPriv)
|
||||
#endif /* DEBUG */
|
||||
|
||||
|
||||
/*
|
||||
** Procedures which are imported by the GL from the surrounding
|
||||
** "operating system". Math functions are not considered part of the
|
||||
** "operating system".
|
||||
*/
|
||||
typedef struct __GLimportsRec {
|
||||
/* Memory management */
|
||||
void * (*malloc)(__GLcontext *gc, size_t size);
|
||||
void *(*calloc)(__GLcontext *gc, size_t numElem, size_t elemSize);
|
||||
void *(*realloc)(__GLcontext *gc, void *oldAddr, size_t newSize);
|
||||
void (*free)(__GLcontext *gc, void *addr);
|
||||
|
||||
/* Error handling */
|
||||
void (*warning)(__GLcontext *gc, char *fmt);
|
||||
void (*fatal)(__GLcontext *gc, char *fmt);
|
||||
|
||||
/* other system calls */
|
||||
char *(CAPI *getenv)(__GLcontext *gc, const char *var);
|
||||
int (CAPI *atoi)(__GLcontext *gc, const char *str);
|
||||
int (CAPI *sprintf)(__GLcontext *gc, char *str, const char *fmt, ...);
|
||||
void *(CAPI *fopen)(__GLcontext *gc, const char *path, const char *mode);
|
||||
int (CAPI *fclose)(__GLcontext *gc, void *stream);
|
||||
int (CAPI *fprintf)(__GLcontext *gc, void *stream, const char *fmt, ...);
|
||||
|
||||
/* Drawing surface management */
|
||||
__GLdrawablePrivate *(*getDrawablePrivate)(__GLcontext *gc);
|
||||
|
||||
/* Pointer to the window system context */
|
||||
void *wscx;
|
||||
|
||||
/* Operating system dependent data goes here */
|
||||
void *other;
|
||||
} __GLimports;
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
/*
|
||||
** Procedures which are exported by the GL to the surrounding "operating
|
||||
** system" so that it can manage multiple GL context's.
|
||||
*/
|
||||
typedef struct __GLexportsRec {
|
||||
/* Context management (return GL_FALSE on failure) */
|
||||
GLboolean (*destroyContext)(__GLcontext *gc);
|
||||
GLboolean (*loseCurrent)(__GLcontext *gc);
|
||||
GLboolean (*makeCurrent)(__GLcontext *gc);
|
||||
GLboolean (*shareContext)(__GLcontext *gc, __GLcontext *gcShare);
|
||||
GLboolean (*copyContext)(__GLcontext *dst, const __GLcontext *src, GLuint mask);
|
||||
GLboolean (*forceCurrent)(__GLcontext *gc);
|
||||
|
||||
/* Drawing surface notification callbacks */
|
||||
GLboolean (*notifyResize)(__GLcontext *gc);
|
||||
void (*notifyDestroy)(__GLcontext *gc);
|
||||
void (*notifySwapBuffers)(__GLcontext *gc);
|
||||
|
||||
/* Dispatch table override control for external agents like libGLS */
|
||||
struct __GLdispatchStateRec* (*dispatchExec)(__GLcontext *gc);
|
||||
void (*beginDispatchOverride)(__GLcontext *gc);
|
||||
void (*endDispatchOverride)(__GLcontext *gc);
|
||||
} __GLexports;
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
/*
|
||||
** This must be the first member of a __GLcontext structure. This is the
|
||||
** only part of a context that is exposed to the outside world; everything
|
||||
** else is opaque.
|
||||
*/
|
||||
struct __GLinterfaceRec {
|
||||
__GLimports imports;
|
||||
__GLexports exports;
|
||||
};
|
||||
|
||||
extern __GLcontext *__glCoreCreateContext(__GLimports *, __GLcontextModes *);
|
||||
extern void __glCoreNopDispatch(void);
|
||||
|
||||
#endif /* __gl_core_h_ */
|
||||
424
include/GL/internal/glcore.h
Normal file
424
include/GL/internal/glcore.h
Normal file
@@ -0,0 +1,424 @@
|
||||
/* $XFree86: xc/lib/GL/include/GL/internal/glcore.h,v 1.7 2001/03/25 05:32:00 tsi Exp $ */
|
||||
#ifndef __gl_core_h_
|
||||
#define __gl_core_h_
|
||||
|
||||
/*
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** Original Code. The Original Code is: OpenGL Sample Implementation,
|
||||
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
|
||||
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
|
||||
** Copyright in any portions created by third parties is as indicated
|
||||
** elsewhere herein. All Rights Reserved.
|
||||
**
|
||||
** Additional Notice Provisions: The application programming interfaces
|
||||
** established by SGI in conjunction with the Original Code are The
|
||||
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
|
||||
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
|
||||
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
|
||||
** Window System(R) (Version 1.3), released October 19, 1998. This software
|
||||
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
|
||||
** published by SGI, but has not been independently verified as being
|
||||
** compliant with the OpenGL(R) version 1.2.1 Specification.
|
||||
**
|
||||
*/
|
||||
|
||||
#ifndef XFree86LOADER
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#define GL_CORE_SGI 1
|
||||
#define GL_CORE_MESA 2
|
||||
|
||||
typedef struct __GLcontextRec __GLcontext;
|
||||
typedef struct __GLinterfaceRec __GLinterface;
|
||||
|
||||
/*
|
||||
** This file defines the interface between the GL core and the surrounding
|
||||
** "operating system" that supports it (currently the GLX or WGL extensions).
|
||||
**
|
||||
** Members (data and function pointers) are documented as imported or
|
||||
** exported according to how they are used by the core rendering functions.
|
||||
** Imported members are initialized by the "operating system" and used by
|
||||
** the core functions. Exported members are initialized by the core functions
|
||||
** and used by the "operating system".
|
||||
*/
|
||||
|
||||
/*
|
||||
** Mode and limit information for a context. This information is
|
||||
** kept around in the context so that values can be used during
|
||||
** command execution, and for returning information about the
|
||||
** context to the application.
|
||||
*/
|
||||
typedef struct __GLcontextModesRec {
|
||||
GLboolean rgbMode;
|
||||
GLboolean colorIndexMode;
|
||||
GLboolean doubleBufferMode;
|
||||
GLboolean stereoMode;
|
||||
|
||||
GLboolean haveAccumBuffer;
|
||||
GLboolean haveDepthBuffer;
|
||||
GLboolean haveStencilBuffer;
|
||||
|
||||
GLint redBits, greenBits, blueBits, alphaBits; /* bits per comp */
|
||||
GLuint redMask, greenMask, blueMask, alphaMask;
|
||||
GLint rgbBits; /* total bits for rgb */
|
||||
GLint indexBits; /* total bits for colorindex */
|
||||
|
||||
GLint accumRedBits, accumGreenBits, accumBlueBits, accumAlphaBits;
|
||||
GLint depthBits;
|
||||
GLint stencilBits;
|
||||
|
||||
GLint numAuxBuffers;
|
||||
|
||||
GLint level;
|
||||
|
||||
GLint pixmapMode;
|
||||
} __GLcontextModes;
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
/*
|
||||
** Structure used for allocating and freeing drawable private memory.
|
||||
** (like software buffers, for example).
|
||||
**
|
||||
** The memory allocation routines are provided by the surrounding
|
||||
** "operating system" code, and they are to be used for allocating
|
||||
** software buffers and things which are associated with the drawable,
|
||||
** and used by any context which draws to that drawable. There are
|
||||
** separate memory allocation functions for drawables and contexts
|
||||
** since drawables and contexts can be created and destroyed independently
|
||||
** of one another, and the "operating system" may want to use separate
|
||||
** allocation arenas for each.
|
||||
**
|
||||
** The freePrivate function is filled in by the core routines when they
|
||||
** allocates software buffers, and stick them in "private". The freePrivate
|
||||
** function will destroy anything allocated to this drawable (to be called
|
||||
** when the drawable is destroyed).
|
||||
*/
|
||||
typedef struct __GLdrawableRegionRec __GLdrawableRegion;
|
||||
typedef struct __GLdrawableBufferRec __GLdrawableBuffer;
|
||||
typedef struct __GLdrawablePrivateRec __GLdrawablePrivate;
|
||||
|
||||
typedef struct __GLregionRectRec {
|
||||
/* lower left (inside the rectangle) */
|
||||
GLint x0, y0;
|
||||
/* upper right (outside the rectangle) */
|
||||
GLint x1, y1;
|
||||
} __GLregionRect;
|
||||
|
||||
struct __GLdrawableRegionRec {
|
||||
GLint numRects;
|
||||
__GLregionRect *rects;
|
||||
__GLregionRect boundingRect;
|
||||
};
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
/* masks for the buffers */
|
||||
#define __GL_FRONT_BUFFER_MASK 0x00000001
|
||||
#define __GL_FRONT_LEFT_BUFFER_MASK 0x00000001
|
||||
#define __GL_FRONT_RIGHT_BUFFER_MASK 0x00000002
|
||||
#define __GL_BACK_BUFFER_MASK 0x00000004
|
||||
#define __GL_BACK_LEFT_BUFFER_MASK 0x00000004
|
||||
#define __GL_BACK_RIGHT_BUFFER_MASK 0x00000008
|
||||
#define __GL_ACCUM_BUFFER_MASK 0x00000010
|
||||
#define __GL_DEPTH_BUFFER_MASK 0x00000020
|
||||
#define __GL_STENCIL_BUFFER_MASK 0x00000040
|
||||
#define __GL_AUX_BUFFER_MASK(i) (0x0000080 << (i))
|
||||
|
||||
#define __GL_ALL_BUFFER_MASK 0xffffffff
|
||||
|
||||
/* what Resize routines return if resize resorted to fallback case */
|
||||
#define __GL_BUFFER_FALLBACK 0x10
|
||||
|
||||
typedef void (*__GLbufFallbackInitFn)(__GLdrawableBuffer *buf,
|
||||
__GLdrawablePrivate *glPriv, GLint bits);
|
||||
typedef void (*__GLbufMainInitFn)(__GLdrawableBuffer *buf,
|
||||
__GLdrawablePrivate *glPriv, GLint bits,
|
||||
__GLbufFallbackInitFn back);
|
||||
|
||||
/*
|
||||
** A drawable buffer
|
||||
**
|
||||
** This data structure describes the context side of a drawable.
|
||||
**
|
||||
** According to the spec there could be multiple contexts bound to the same
|
||||
** drawable at the same time (from different threads). In order to avoid
|
||||
** multiple-access conflicts, locks are used to serialize access. When a
|
||||
** thread needs to access (read or write) a member of the drawable, it takes
|
||||
** a lock first. Some of the entries in the drawable are treated "mostly
|
||||
** constant", so we take the freedom of allowing access to them without
|
||||
** taking a lock (for optimization reasons).
|
||||
**
|
||||
** For more details regarding locking, see buffers.h in the GL core
|
||||
*/
|
||||
struct __GLdrawableBufferRec {
|
||||
/*
|
||||
** Buffer dimensions
|
||||
*/
|
||||
GLint width, height, depth;
|
||||
|
||||
/*
|
||||
** Framebuffer base address
|
||||
*/
|
||||
void *base;
|
||||
|
||||
/*
|
||||
** Framebuffer size (in bytes)
|
||||
*/
|
||||
GLuint size;
|
||||
|
||||
/*
|
||||
** Size (in bytes) of each element in the framebuffer
|
||||
*/
|
||||
GLuint elementSize;
|
||||
GLuint elementSizeLog2;
|
||||
|
||||
/*
|
||||
** Element skip from one scanline to the next.
|
||||
** If the buffer is part of another buffer (for example, fullscreen
|
||||
** front buffer), outerWidth is the width of that buffer.
|
||||
*/
|
||||
GLint outerWidth;
|
||||
|
||||
/*
|
||||
** outerWidth * elementSize
|
||||
*/
|
||||
GLint byteWidth;
|
||||
|
||||
/*
|
||||
** Allocation/deallocation is done based on this handle. A handle
|
||||
** is conceptually different from the framebuffer 'base'.
|
||||
*/
|
||||
void *handle;
|
||||
|
||||
/* imported */
|
||||
GLboolean (*resize)(__GLdrawableBuffer *buf,
|
||||
GLint x, GLint y, GLuint width, GLuint height,
|
||||
__GLdrawablePrivate *glPriv, GLuint bufferMask);
|
||||
void (*lock)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv);
|
||||
void (*unlock)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv);
|
||||
void (*fill)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv,
|
||||
GLuint val, GLint x, GLint y, GLint w, GLint h);
|
||||
void (*free)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv);
|
||||
|
||||
/* exported */
|
||||
void (*freePrivate)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv);
|
||||
#ifdef __cplusplus
|
||||
void *privatePtr;
|
||||
#else
|
||||
void *private;
|
||||
#endif
|
||||
|
||||
/* private */
|
||||
void *other; /* implementation private data */
|
||||
__GLbufMainInitFn mainInit;
|
||||
__GLbufFallbackInitFn fallbackInit;
|
||||
};
|
||||
|
||||
/*
|
||||
** The context side of the drawable private
|
||||
*/
|
||||
struct __GLdrawablePrivateRec {
|
||||
/*
|
||||
** Drawable Modes
|
||||
*/
|
||||
__GLcontextModes *modes;
|
||||
|
||||
/*
|
||||
** Drawable size
|
||||
*/
|
||||
GLuint width, height;
|
||||
|
||||
/*
|
||||
** Origin in screen coordinates of the drawable
|
||||
*/
|
||||
GLint xOrigin, yOrigin;
|
||||
#ifdef __GL_ALIGNED_BUFFERS
|
||||
/*
|
||||
** Drawable offset from screen origin
|
||||
*/
|
||||
GLint xOffset, yOffset;
|
||||
|
||||
/*
|
||||
** Alignment restriction
|
||||
*/
|
||||
GLint xAlignment, yAlignment;
|
||||
#endif
|
||||
/*
|
||||
** Should we invert the y axis?
|
||||
*/
|
||||
GLint yInverted;
|
||||
|
||||
/*
|
||||
** Mask specifying which buffers are renderable by the hw
|
||||
*/
|
||||
GLuint accelBufferMask;
|
||||
|
||||
/*
|
||||
** the buffers themselves
|
||||
*/
|
||||
__GLdrawableBuffer frontBuffer;
|
||||
__GLdrawableBuffer backBuffer;
|
||||
__GLdrawableBuffer accumBuffer;
|
||||
__GLdrawableBuffer depthBuffer;
|
||||
__GLdrawableBuffer stencilBuffer;
|
||||
#if defined(__GL_NUMBER_OF_AUX_BUFFERS) && (__GL_NUMBER_OF_AUX_BUFFERS > 0)
|
||||
__GLdrawableBuffer *auxBuffer;
|
||||
#endif
|
||||
|
||||
__GLdrawableRegion ownershipRegion;
|
||||
|
||||
/*
|
||||
** Lock for the drawable private structure
|
||||
*/
|
||||
void *lock;
|
||||
#ifdef DEBUG
|
||||
/* lock debugging info */
|
||||
int lockRefCount;
|
||||
int lockLine[10];
|
||||
char *lockFile[10];
|
||||
#endif
|
||||
|
||||
/* imported */
|
||||
void *(*malloc)(size_t size);
|
||||
void *(*calloc)(size_t numElem, size_t elemSize);
|
||||
void *(*realloc)(void *oldAddr, size_t newSize);
|
||||
void (*free)(void *addr);
|
||||
|
||||
GLboolean (*addSwapRect)(__GLdrawablePrivate *glPriv,
|
||||
GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
void (*setClipRect)(__GLdrawablePrivate *glPriv,
|
||||
GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
void (*updateClipRegion)(__GLdrawablePrivate *glPriv);
|
||||
GLboolean (*resize)(__GLdrawablePrivate *glPriv);
|
||||
void (*getDrawableSize)(__GLdrawablePrivate *glPriv,
|
||||
GLint *x, GLint *y, GLuint *width, GLuint *height);
|
||||
|
||||
void (*lockDP)(__GLdrawablePrivate *glPriv, __GLcontext *gc);
|
||||
void (*unlockDP)(__GLdrawablePrivate *glPriv);
|
||||
|
||||
/* exported */
|
||||
void *wsPriv; /* pointer to the window system DrawablePrivate */
|
||||
#ifdef __cplusplus
|
||||
void *privatePtr;
|
||||
#else
|
||||
void *private;
|
||||
#endif
|
||||
void (*freePrivate)(__GLdrawablePrivate *);
|
||||
|
||||
/* client data */
|
||||
void *other;
|
||||
};
|
||||
|
||||
/*
|
||||
** Macros to lock/unlock the drawable private
|
||||
*/
|
||||
#if defined(DEBUG)
|
||||
#define __GL_LOCK_DP(glPriv,gc) \
|
||||
(*(glPriv)->lockDP)(glPriv,gc); \
|
||||
(glPriv)->lockLine[(glPriv)->lockRefCount] = __LINE__; \
|
||||
(glPriv)->lockFile[(glPriv)->lockRefCount] = __FILE__; \
|
||||
(glPriv)->lockRefCount++
|
||||
#define __GL_UNLOCK_DP(glPriv) \
|
||||
(glPriv)->lockRefCount--; \
|
||||
(glPriv)->lockLine[(glPriv)->lockRefCount] = 0; \
|
||||
(glPriv)->lockFile[(glPriv)->lockRefCount] = NULL; \
|
||||
(*(glPriv)->unlockDP)(glPriv)
|
||||
#else /* DEBUG */
|
||||
#define __GL_LOCK_DP(glPriv,gc) (*(glPriv)->lockDP)(glPriv,gc)
|
||||
#define __GL_UNLOCK_DP(glPriv) (*(glPriv)->unlockDP)(glPriv)
|
||||
#endif /* DEBUG */
|
||||
|
||||
|
||||
/*
|
||||
** Procedures which are imported by the GL from the surrounding
|
||||
** "operating system". Math functions are not considered part of the
|
||||
** "operating system".
|
||||
*/
|
||||
typedef struct __GLimportsRec {
|
||||
/* Memory management */
|
||||
void * (*malloc)(__GLcontext *gc, size_t size);
|
||||
void *(*calloc)(__GLcontext *gc, size_t numElem, size_t elemSize);
|
||||
void *(*realloc)(__GLcontext *gc, void *oldAddr, size_t newSize);
|
||||
void (*free)(__GLcontext *gc, void *addr);
|
||||
|
||||
/* Error handling */
|
||||
void (*warning)(__GLcontext *gc, char *fmt);
|
||||
void (*fatal)(__GLcontext *gc, char *fmt);
|
||||
|
||||
/* other system calls */
|
||||
char *(CAPI *getenv)(__GLcontext *gc, const char *var);
|
||||
int (CAPI *atoi)(__GLcontext *gc, const char *str);
|
||||
int (CAPI *sprintf)(__GLcontext *gc, char *str, const char *fmt, ...);
|
||||
void *(CAPI *fopen)(__GLcontext *gc, const char *path, const char *mode);
|
||||
int (CAPI *fclose)(__GLcontext *gc, void *stream);
|
||||
int (CAPI *fprintf)(__GLcontext *gc, void *stream, const char *fmt, ...);
|
||||
|
||||
/* Drawing surface management */
|
||||
__GLdrawablePrivate *(*getDrawablePrivate)(__GLcontext *gc);
|
||||
|
||||
/* Pointer to the window system context */
|
||||
void *wscx;
|
||||
|
||||
/* Operating system dependent data goes here */
|
||||
void *other;
|
||||
} __GLimports;
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
/*
|
||||
** Procedures which are exported by the GL to the surrounding "operating
|
||||
** system" so that it can manage multiple GL context's.
|
||||
*/
|
||||
typedef struct __GLexportsRec {
|
||||
/* Context management (return GL_FALSE on failure) */
|
||||
GLboolean (*destroyContext)(__GLcontext *gc);
|
||||
GLboolean (*loseCurrent)(__GLcontext *gc);
|
||||
GLboolean (*makeCurrent)(__GLcontext *gc);
|
||||
GLboolean (*shareContext)(__GLcontext *gc, __GLcontext *gcShare);
|
||||
GLboolean (*copyContext)(__GLcontext *dst, const __GLcontext *src, GLuint mask);
|
||||
GLboolean (*forceCurrent)(__GLcontext *gc);
|
||||
|
||||
/* Drawing surface notification callbacks */
|
||||
GLboolean (*notifyResize)(__GLcontext *gc);
|
||||
void (*notifyDestroy)(__GLcontext *gc);
|
||||
void (*notifySwapBuffers)(__GLcontext *gc);
|
||||
|
||||
/* Dispatch table override control for external agents like libGLS */
|
||||
struct __GLdispatchStateRec* (*dispatchExec)(__GLcontext *gc);
|
||||
void (*beginDispatchOverride)(__GLcontext *gc);
|
||||
void (*endDispatchOverride)(__GLcontext *gc);
|
||||
} __GLexports;
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
/*
|
||||
** This must be the first member of a __GLcontext structure. This is the
|
||||
** only part of a context that is exposed to the outside world; everything
|
||||
** else is opaque.
|
||||
*/
|
||||
struct __GLinterfaceRec {
|
||||
__GLimports imports;
|
||||
__GLexports exports;
|
||||
};
|
||||
|
||||
extern __GLcontext *__glCoreCreateContext(__GLimports *, __GLcontextModes *);
|
||||
extern void __glCoreNopDispatch(void);
|
||||
|
||||
#endif /* __gl_core_h_ */
|
||||
@@ -1,123 +1,125 @@
|
||||
/* $Id: mesa_wgl.h,v 1.5 2000/05/22 16:21:27 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.1
|
||||
*
|
||||
* Copyright (C) 1999 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is 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 Software.
|
||||
*
|
||||
* THE SOFTWARE IS 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
|
||||
* BRIAN PAUL 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 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
/* prototypes for the Mesa WGL functions */
|
||||
/* relocated here so that I could make GLUT get them properly */
|
||||
|
||||
#ifndef _mesa_wgl_h_
|
||||
#define _mesa_wgl_h_
|
||||
|
||||
|
||||
#include <gl/gl.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN32__))
|
||||
# if defined(_MSC_VER) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */
|
||||
# define GLAPI __declspec(dllexport)
|
||||
# define WGLAPI __declspec(dllexport)
|
||||
# elif defined(_MSC_VER) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
|
||||
# define GLAPI __declspec(dllimport)
|
||||
# define WGLAPI __declspec(dllimport)
|
||||
# else /* for use with static link lib build of Win32 edition only */
|
||||
# define GLAPI extern
|
||||
# define WGLAPI __declspec(dllimport)
|
||||
# endif /* _STATIC_MESA support */
|
||||
# define GLAPIENTRY __stdcall
|
||||
#else
|
||||
/* non-Windows compilation */
|
||||
# define GLAPI extern
|
||||
# define GLAPIENTRY
|
||||
#endif /* WIN32 / CYGWIN32 bracket */
|
||||
|
||||
|
||||
#if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP)
|
||||
#ifndef _GNU_H_WINDOWS32_FUNCTIONS
|
||||
# ifdef UNICODE
|
||||
# define wglUseFontBitmaps wglUseFontBitmapsW
|
||||
# define wglUseFontOutlines wglUseFontOutlinesW
|
||||
# else
|
||||
# define wglUseFontBitmaps wglUseFontBitmapsA
|
||||
# define wglUseFontOutlines wglUseFontOutlinesA
|
||||
# endif /* !UNICODE */
|
||||
#endif /* _GNU_H_WINDOWS32_FUNCTIONS */
|
||||
typedef struct tagLAYERPLANEDESCRIPTOR LAYERPLANEDESCRIPTOR, *PLAYERPLANEDESCRIPTOR, *LPLAYERPLANEDESCRIPTOR;
|
||||
typedef struct _GLYPHMETRICSFLOAT GLYPHMETRICSFLOAT, *PGLYPHMETRICSFLOAT, *LPGLYPHMETRICSFLOAT;
|
||||
typedef struct tagPIXELFORMATDESCRIPTOR PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESCRIPTOR, *LPPIXELFORMATDESCRIPTOR;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning( disable : 4615 ) /* pragma warning : unknown user warning type*/
|
||||
# pragma warning( push )
|
||||
# pragma warning( disable : 4273 ) /* 'function' : inconsistent DLL linkage. dllexport assumed. */
|
||||
#endif
|
||||
|
||||
WGLAPI int GLAPIENTRY wglDeleteContext(HGLRC);
|
||||
WGLAPI int GLAPIENTRY wglMakeCurrent(HDC,HGLRC);
|
||||
WGLAPI int GLAPIENTRY wglSetPixelFormat(HDC, int, const PIXELFORMATDESCRIPTOR *);
|
||||
WGLAPI int GLAPIENTRY wglSwapBuffers(HDC hdc);
|
||||
WGLAPI HDC GLAPIENTRY wglGetCurrentDC(void);
|
||||
WGLAPI HGLRC GLAPIENTRY wglCreateContext(HDC);
|
||||
WGLAPI HGLRC GLAPIENTRY wglCreateLayerContext(HDC,int);
|
||||
WGLAPI HGLRC GLAPIENTRY wglGetCurrentContext(void);
|
||||
WGLAPI PROC GLAPIENTRY wglGetProcAddress(const char*);
|
||||
WGLAPI int GLAPIENTRY wglChoosePixelFormat(HDC, const PIXELFORMATDESCRIPTOR *);
|
||||
WGLAPI int GLAPIENTRY wglCopyContext(HGLRC, HGLRC, unsigned int);
|
||||
WGLAPI int GLAPIENTRY wglDeleteContext(HGLRC);
|
||||
WGLAPI int GLAPIENTRY wglDescribeLayerPlane(HDC, int, int, unsigned int,LPLAYERPLANEDESCRIPTOR);
|
||||
WGLAPI int GLAPIENTRY wglDescribePixelFormat(HDC,int, unsigned int, LPPIXELFORMATDESCRIPTOR);
|
||||
WGLAPI int GLAPIENTRY wglGetLayerPaletteEntries(HDC, int, int, int,COLORREF *);
|
||||
WGLAPI int GLAPIENTRY wglGetPixelFormat(HDC hdc);
|
||||
WGLAPI int GLAPIENTRY wglMakeCurrent(HDC, HGLRC);
|
||||
WGLAPI int GLAPIENTRY wglRealizeLayerPalette(HDC, int, int);
|
||||
WGLAPI int GLAPIENTRY wglSetLayerPaletteEntries(HDC, int, int, int,const COLORREF *);
|
||||
WGLAPI int GLAPIENTRY wglShareLists(HGLRC, HGLRC);
|
||||
WGLAPI int GLAPIENTRY wglSwapLayerBuffers(HDC, unsigned int);
|
||||
WGLAPI int GLAPIENTRY wglUseFontBitmapsA(HDC, unsigned long, unsigned long, unsigned long);
|
||||
WGLAPI int GLAPIENTRY wglUseFontBitmapsW(HDC, unsigned long, unsigned long, unsigned long);
|
||||
WGLAPI int GLAPIENTRY wglUseFontOutlinesA(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT);
|
||||
WGLAPI int GLAPIENTRY wglUseFontOutlinesW(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT);
|
||||
WGLAPI int GLAPIENTRY SwapBuffers(HDC);
|
||||
WGLAPI int GLAPIENTRY ChoosePixelFormat(HDC,const PIXELFORMATDESCRIPTOR *);
|
||||
WGLAPI int GLAPIENTRY DescribePixelFormat(HDC,int,unsigned int,LPPIXELFORMATDESCRIPTOR);
|
||||
WGLAPI int GLAPIENTRY GetPixelFormat(HDC);
|
||||
WGLAPI int GLAPIENTRY SetPixelFormat(HDC,int,const PIXELFORMATDESCRIPTOR *);
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning( pop )
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _mesa_wgl_h_ */
|
||||
/* $Id: mesa_wgl.h,v 1.6 2001/05/07 13:58:00 gareth Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.1
|
||||
*
|
||||
* Copyright (C) 1999 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is 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 Software.
|
||||
*
|
||||
* THE SOFTWARE IS 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
|
||||
* BRIAN PAUL 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 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
/* prototypes for the Mesa WGL functions */
|
||||
/* relocated here so that I could make GLUT get them properly */
|
||||
|
||||
#define _mesa_wgl_h_
|
||||
|
||||
#ifndef _mesa_wgl_h_
|
||||
#define _mesa_wgl_h_
|
||||
|
||||
|
||||
#include <gl/gl.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN32__))
|
||||
# if defined(_MSC_VER) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */
|
||||
# define GLAPI __declspec(dllexport)
|
||||
# define WGLAPI __declspec(dllexport)
|
||||
# elif defined(_MSC_VER) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
|
||||
# define GLAPI __declspec(dllimport)
|
||||
# define WGLAPI __declspec(dllimport)
|
||||
# else /* for use with static link lib build of Win32 edition only */
|
||||
# define GLAPI extern
|
||||
# define WGLAPI __declspec(dllimport)
|
||||
# endif /* _STATIC_MESA support */
|
||||
# define GLAPIENTRY __stdcall
|
||||
#else
|
||||
/* non-Windows compilation */
|
||||
# define GLAPI extern
|
||||
# define GLAPIENTRY
|
||||
#endif /* WIN32 / CYGWIN32 bracket */
|
||||
|
||||
|
||||
#if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP)
|
||||
#ifndef _GNU_H_WINDOWS32_FUNCTIONS
|
||||
# ifdef UNICODE
|
||||
# define wglUseFontBitmaps wglUseFontBitmapsW
|
||||
# define wglUseFontOutlines wglUseFontOutlinesW
|
||||
# else
|
||||
# define wglUseFontBitmaps wglUseFontBitmapsA
|
||||
# define wglUseFontOutlines wglUseFontOutlinesA
|
||||
# endif /* !UNICODE */
|
||||
#endif /* _GNU_H_WINDOWS32_FUNCTIONS */
|
||||
typedef struct tagLAYERPLANEDESCRIPTOR LAYERPLANEDESCRIPTOR, *PLAYERPLANEDESCRIPTOR, *LPLAYERPLANEDESCRIPTOR;
|
||||
typedef struct _GLYPHMETRICSFLOAT GLYPHMETRICSFLOAT, *PGLYPHMETRICSFLOAT, *LPGLYPHMETRICSFLOAT;
|
||||
typedef struct tagPIXELFORMATDESCRIPTOR PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESCRIPTOR, *LPPIXELFORMATDESCRIPTOR;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning( disable : 4615 ) /* pragma warning : unknown user warning type*/
|
||||
# pragma warning( push )
|
||||
# pragma warning( disable : 4273 ) /* 'function' : inconsistent DLL linkage. dllexport assumed. */
|
||||
#endif
|
||||
|
||||
WGLAPI int GLAPIENTRY wglDeleteContext(HGLRC);
|
||||
WGLAPI int GLAPIENTRY wglMakeCurrent(HDC,HGLRC);
|
||||
WGLAPI int GLAPIENTRY wglSetPixelFormat(HDC, int, const PIXELFORMATDESCRIPTOR *);
|
||||
WGLAPI int GLAPIENTRY wglSwapBuffers(HDC hdc);
|
||||
WGLAPI HDC GLAPIENTRY wglGetCurrentDC(void);
|
||||
WGLAPI HGLRC GLAPIENTRY wglCreateContext(HDC);
|
||||
WGLAPI HGLRC GLAPIENTRY wglCreateLayerContext(HDC,int);
|
||||
WGLAPI HGLRC GLAPIENTRY wglGetCurrentContext(void);
|
||||
WGLAPI PROC GLAPIENTRY wglGetProcAddress(const char*);
|
||||
WGLAPI int GLAPIENTRY wglChoosePixelFormat(HDC, const PIXELFORMATDESCRIPTOR *);
|
||||
WGLAPI int GLAPIENTRY wglCopyContext(HGLRC, HGLRC, unsigned int);
|
||||
WGLAPI int GLAPIENTRY wglDeleteContext(HGLRC);
|
||||
WGLAPI int GLAPIENTRY wglDescribeLayerPlane(HDC, int, int, unsigned int,LPLAYERPLANEDESCRIPTOR);
|
||||
WGLAPI int GLAPIENTRY wglDescribePixelFormat(HDC,int, unsigned int, LPPIXELFORMATDESCRIPTOR);
|
||||
WGLAPI int GLAPIENTRY wglGetLayerPaletteEntries(HDC, int, int, int,COLORREF *);
|
||||
WGLAPI int GLAPIENTRY wglGetPixelFormat(HDC hdc);
|
||||
WGLAPI int GLAPIENTRY wglMakeCurrent(HDC, HGLRC);
|
||||
WGLAPI int GLAPIENTRY wglRealizeLayerPalette(HDC, int, int);
|
||||
WGLAPI int GLAPIENTRY wglSetLayerPaletteEntries(HDC, int, int, int,const COLORREF *);
|
||||
WGLAPI int GLAPIENTRY wglShareLists(HGLRC, HGLRC);
|
||||
WGLAPI int GLAPIENTRY wglSwapLayerBuffers(HDC, unsigned int);
|
||||
WGLAPI int GLAPIENTRY wglUseFontBitmapsA(HDC, unsigned long, unsigned long, unsigned long);
|
||||
WGLAPI int GLAPIENTRY wglUseFontBitmapsW(HDC, unsigned long, unsigned long, unsigned long);
|
||||
WGLAPI int GLAPIENTRY wglUseFontOutlinesA(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT);
|
||||
WGLAPI int GLAPIENTRY wglUseFontOutlinesW(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT);
|
||||
WGLAPI int GLAPIENTRY SwapBuffers(HDC);
|
||||
WGLAPI int GLAPIENTRY ChoosePixelFormat(HDC,const PIXELFORMATDESCRIPTOR *);
|
||||
WGLAPI int GLAPIENTRY DescribePixelFormat(HDC,int,unsigned int,LPPIXELFORMATDESCRIPTOR);
|
||||
WGLAPI int GLAPIENTRY GetPixelFormat(HDC);
|
||||
WGLAPI int GLAPIENTRY SetPixelFormat(HDC,int,const PIXELFORMATDESCRIPTOR *);
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning( pop )
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _mesa_wgl_h_ */
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/* $Id: osmesa.h,v 1.5 2000/03/28 16:59:39 rjfrank Exp $ */
|
||||
/* $Id: osmesa.h,v 1.6 2000/09/08 16:41:38 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.3
|
||||
* Version: 3.5
|
||||
*
|
||||
* Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
|
||||
*
|
||||
@@ -59,11 +59,11 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#include "GL/gl.h"
|
||||
#include <GL/gl.h>
|
||||
|
||||
|
||||
#define OSMESA_MAJOR_VERSION 3
|
||||
#define OSMESA_MINOR_VERSION 3
|
||||
#define OSMESA_MINOR_VERSION 5
|
||||
|
||||
|
||||
|
||||
@@ -114,18 +114,31 @@ typedef struct osmesa_context *OSMesaContext;
|
||||
* display lists. NULL indicates no sharing.
|
||||
* Return: an OSMesaContext or 0 if error
|
||||
*/
|
||||
GLAPI OSMesaContext GLAPIENTRY OSMesaCreateContext( GLenum format,
|
||||
OSMesaContext sharelist );
|
||||
GLAPI OSMesaContext GLAPIENTRY
|
||||
OSMesaCreateContext( GLenum format, OSMesaContext sharelist );
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Create an Off-Screen Mesa rendering context and specify desired
|
||||
* size of depth buffer, stencil buffer and accumulation buffer.
|
||||
* If you specify zero for depthBits, stencilBits, accumBits you
|
||||
* can save some memory.
|
||||
*
|
||||
* New in Mesa 3.5
|
||||
*/
|
||||
GLAPI OSMesaContext GLAPIENTRY
|
||||
OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits,
|
||||
GLint accumBits, OSMesaContext sharelist);
|
||||
|
||||
|
||||
/*
|
||||
* Destroy an Off-Screen Mesa rendering context.
|
||||
*
|
||||
* Input: ctx - the context to destroy
|
||||
*/
|
||||
GLAPI void GLAPIENTRY OSMesaDestroyContext( OSMesaContext ctx );
|
||||
GLAPI void GLAPIENTRY
|
||||
OSMesaDestroyContext( OSMesaContext ctx );
|
||||
|
||||
|
||||
|
||||
@@ -156,9 +169,9 @@ GLAPI void GLAPIENTRY OSMesaDestroyContext( OSMesaContext ctx );
|
||||
* invalid buffer address, type!=GL_UNSIGNED_BYTE, width<1, height<1,
|
||||
* width>internal limit or height>internal limit.
|
||||
*/
|
||||
GLAPI GLboolean GLAPIENTRY OSMesaMakeCurrent( OSMesaContext ctx,
|
||||
void *buffer, GLenum type,
|
||||
GLsizei width, GLsizei height );
|
||||
GLAPI GLboolean GLAPIENTRY
|
||||
OSMesaMakeCurrent( OSMesaContext ctx, void *buffer, GLenum type,
|
||||
GLsizei width, GLsizei height );
|
||||
|
||||
|
||||
|
||||
@@ -166,7 +179,8 @@ GLAPI GLboolean GLAPIENTRY OSMesaMakeCurrent( OSMesaContext ctx,
|
||||
/*
|
||||
* Return the current Off-Screen Mesa rendering context handle.
|
||||
*/
|
||||
GLAPI OSMesaContext GLAPIENTRY OSMesaGetCurrentContext( void );
|
||||
GLAPI OSMesaContext GLAPIENTRY
|
||||
OSMesaGetCurrentContext( void );
|
||||
|
||||
|
||||
|
||||
@@ -183,7 +197,8 @@ GLAPI OSMesaContext GLAPIENTRY OSMesaGetCurrentContext( void );
|
||||
*
|
||||
* New in version 2.0.
|
||||
*/
|
||||
GLAPI void GLAPIENTRY OSMesaPixelStore( GLint pname, GLint value );
|
||||
GLAPI void GLAPIENTRY
|
||||
OSMesaPixelStore( GLint pname, GLint value );
|
||||
|
||||
|
||||
|
||||
@@ -198,7 +213,8 @@ GLAPI void GLAPIENTRY OSMesaPixelStore( GLint pname, GLint value );
|
||||
* OSMESA_Y_UP returns 1 or 0 to indicate Y axis direction
|
||||
* value - pointer to integer in which to return result.
|
||||
*/
|
||||
GLAPI void GLAPIENTRY OSMesaGetIntegerv( GLint pname, GLint *value );
|
||||
GLAPI void GLAPIENTRY
|
||||
OSMesaGetIntegerv( GLint pname, GLint *value );
|
||||
|
||||
|
||||
|
||||
@@ -212,10 +228,10 @@ GLAPI void GLAPIENTRY OSMesaGetIntegerv( GLint pname, GLint *value );
|
||||
*
|
||||
* New in Mesa 2.4.
|
||||
*/
|
||||
GLAPI GLboolean GLAPIENTRY OSMesaGetDepthBuffer( OSMesaContext c,
|
||||
GLint *width, GLint *height,
|
||||
GLint *bytesPerValue,
|
||||
void **buffer );
|
||||
GLAPI GLboolean GLAPIENTRY
|
||||
OSMesaGetDepthBuffer( OSMesaContext c, GLint *width, GLint *height,
|
||||
GLint *bytesPerValue, void **buffer );
|
||||
|
||||
|
||||
|
||||
/*
|
||||
@@ -228,10 +244,10 @@ GLAPI GLboolean GLAPIENTRY OSMesaGetDepthBuffer( OSMesaContext c,
|
||||
*
|
||||
* New in Mesa 3.3.
|
||||
*/
|
||||
GLAPI GLboolean GLAPIENTRY OSMesaGetColorBuffer( OSMesaContext c,
|
||||
GLint *width, GLint *height,
|
||||
GLint *format,
|
||||
void **buffer );
|
||||
GLAPI GLboolean GLAPIENTRY
|
||||
OSMesaGetColorBuffer( OSMesaContext c, GLint *width, GLint *height,
|
||||
GLint *format, void **buffer );
|
||||
|
||||
|
||||
|
||||
#if defined(__BEOS__) || defined(__QUICKDRAW__)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/* $Id: svgamesa.h,v 1.4 2000/02/09 19:03:28 brianp Exp $ */
|
||||
/* $Id: svgamesa.h,v 1.5 2001/06/20 19:52:11 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.3
|
||||
* Copyright (C) 1995-2000 Brian Paul
|
||||
* Version: 3.5
|
||||
* Copyright (C) 1995-2001 Brian Paul
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
@@ -53,7 +53,7 @@
|
||||
|
||||
|
||||
#define SVGAMESA_MAJOR_VERSION 3
|
||||
#define SVGAMESA_MINOR_VERSION 3
|
||||
#define SVGAMESA_MINOR_VERSION 5
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
880
include/GL/vms_x_fix.h
Normal file
880
include/GL/vms_x_fix.h
Normal file
@@ -0,0 +1,880 @@
|
||||
/***************************************************************************
|
||||
* *
|
||||
* Repair definitions of Xlib when compileing with /name=(as_is) on VMS *
|
||||
* *
|
||||
* Author : Jouk Jansen (joukj@hrem.stm.tudelft.nl) *
|
||||
* *
|
||||
* Last revision : 22 August 2000 *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef VMS_X_FIX
|
||||
#define VMS_X_FIX
|
||||
|
||||
#define _XRegisterFilterByType _XREGISTERFILTERBYTYPE
|
||||
#define XAllocClassHint XALLOCCLASSHINT
|
||||
#define XAllocColor XALLOCCOLOR
|
||||
#define XAllocColorCells XALLOCCOLORCELLS
|
||||
#define XAllocSizeHints XALLOCSIZEHINTS
|
||||
#define XAllocWMHints XALLOCWMHINTS
|
||||
#define XAutoRepeatOff XAUTOREPEATOFF
|
||||
#define XAutoRepeatOn XAUTOREPEATON
|
||||
#define XBaseFontNameListOfFontSet XBASEFONTNAMELISTOFFONTSET
|
||||
#define XBell XBELL
|
||||
#define XBitmapPad XBITMAPPAD
|
||||
#define XChangeActivePointerGrab XCHANGEACTIVEPOINTERGRAB
|
||||
#define XChangeGC XCHANGEGC
|
||||
#define XChangeProperty XCHANGEPROPERTY
|
||||
#define XChangeWindowAttributes XCHANGEWINDOWATTRIBUTES
|
||||
#define XCheckIfEvent XCHECKIFEVENT
|
||||
#define XCheckMaskEvent XCHECKMASKEVENT
|
||||
#define XCheckTypedWindowEvent XCHECKTYPEDWINDOWEVENT
|
||||
#define XCheckWindowEvent XCHECKWINDOWEVENT
|
||||
#define XClearArea XCLEARAREA
|
||||
#define XClearWindow XCLEARWINDOW
|
||||
#define XClipBox XCLIPBOX
|
||||
#define XCloseDisplay XCLOSEDISPLAY
|
||||
#define XCloseIM XCLOSEIM
|
||||
#define XConfigureWindow XCONFIGUREWINDOW
|
||||
#define XConvertSelection XCONVERTSELECTION
|
||||
#define XCopyArea XCOPYAREA
|
||||
#define XCopyGC XCOPYGC
|
||||
#define XCopyPlane XCOPYPLANE
|
||||
#define XCreateBitmapFromData XCREATEBITMAPFROMDATA
|
||||
#define XCreateColormap XCREATECOLORMAP
|
||||
#define XCreateFontCursor XCREATEFONTCURSOR
|
||||
#define XCreateFontSet XCREATEFONTSET
|
||||
#define XCreateGC XCREATEGC
|
||||
#define XCreateIC XCREATEIC
|
||||
#define XCreateImage XCREATEIMAGE
|
||||
#define XCreatePixmap XCREATEPIXMAP
|
||||
#define XCreatePixmapCursor XCREATEPIXMAPCURSOR
|
||||
#define XCreatePixmapFromBitmapData XCREATEPIXMAPFROMBITMAPDATA
|
||||
#define XCreateRegion XCREATEREGION
|
||||
#define XCreateSimpleWindow XCREATESIMPLEWINDOW
|
||||
#define XCreateWindow XCREATEWINDOW
|
||||
#define XDefaultScreenOfDisplay XDEFAULTSCREENOFDISPLAY
|
||||
#define XDefineCursor XDEFINECURSOR
|
||||
#define XDeleteProperty XDELETEPROPERTY
|
||||
#define XDestroyIC XDESTROYIC
|
||||
#define XDestroyRegion XDESTROYREGION
|
||||
#define XDestroyWindow XDESTROYWINDOW
|
||||
#define XDisplayName XDISPLAYNAME
|
||||
#define XDisplayOfScreen XDISPLAYOFSCREEN
|
||||
#define XDrawArc XDRAWARC
|
||||
#define XDrawImageString XDRAWIMAGESTRING
|
||||
#define XDrawImageString16 XDRAWIMAGESTRING16
|
||||
#define XDrawLine XDRAWLINE
|
||||
#define XDrawLines XDRAWLINES
|
||||
#define XDrawPoint XDRAWPOINT
|
||||
#define XDrawPoints XDRAWPOINTS
|
||||
#define XDrawRectangle XDRAWRECTANGLE
|
||||
#define XDrawSegments XDRAWSEGMENTS
|
||||
#define XDrawString XDRAWSTRING
|
||||
#define XDrawString16 XDRAWSTRING16
|
||||
#define XEmptyRegion XEMPTYREGION
|
||||
#define XEqualRegion XEQUALREGION
|
||||
#define XEventsQueued XEVENTSQUEUED
|
||||
#define XExtentsOfFontSet XEXTENTSOFFONTSET
|
||||
#define XFillArc XFILLARC
|
||||
#define XFillPolygon XFILLPOLYGON
|
||||
#define XFillRectangle XFILLRECTANGLE
|
||||
#define XFillRectangles XFILLRECTANGLES
|
||||
#define XFilterEvent XFILTEREVENT
|
||||
#define XFlush XFLUSH
|
||||
#define XFontsOfFontSet XFONTSOFFONTSET
|
||||
#define XFree XFREE
|
||||
#define XFreeColormap XFREECOLORMAP
|
||||
#define XFreeColors XFREECOLORS
|
||||
#define XFreeCursor XFREECURSOR
|
||||
#define XFreeFont XFREEFONT
|
||||
#define XFreeFontInfo XFREEFONTINFO
|
||||
#define XFreeFontNames XFREEFONTNAMES
|
||||
#define XFreeFontSet XFREEFONTSET
|
||||
#define XFreeGC XFREEGC
|
||||
#define XFreeModifiermap XFREEMODIFIERMAP
|
||||
#define XFreePixmap XFREEPIXMAP
|
||||
#define XFreeStringList XFREESTRINGLIST
|
||||
#define XGetAtomName XGETATOMNAME
|
||||
#define XGetDefault XGETDEFAULT
|
||||
#define XGetErrorDatabaseText XGETERRORDATABASETEXT
|
||||
#define XGetErrorText XGETERRORTEXT
|
||||
#define XGetFontProperty XGETFONTPROPERTY
|
||||
#define XGetGCValues XGETGCVALUES
|
||||
#define XGetGeometry XGETGEOMETRY
|
||||
#define XGetICValues XGETICVALUES
|
||||
#define XGetIMValues XGETIMVALUES
|
||||
#define XGetImage XGETIMAGE
|
||||
#define XGetKeyboardControl XGETKEYBOARDCONTROL
|
||||
#define XGetModifierMapping XGETMODIFIERMAPPING
|
||||
#define XGetMotionEvents XGETMOTIONEVENTS
|
||||
#define XGetNormalHints XGETNORMALHINTS
|
||||
#define XGetSelectionOwner XGETSELECTIONOWNER
|
||||
#define XGetSubImage XGETSUBIMAGE
|
||||
#define XGetVisualInfo XGETVISUALINFO
|
||||
#define XGetWMColormapWindows XGETWMCOLORMAPWINDOWS
|
||||
#define XGetWMHints XGETWMHINTS
|
||||
#define XGetWMName XGETWMNAME
|
||||
#define XGetWMNormalHints XGETWMNORMALHINTS
|
||||
#define XGetWindowAttributes XGETWINDOWATTRIBUTES
|
||||
#define XGetWindowProperty XGETWINDOWPROPERTY
|
||||
#define XGrabKeyboard XGRABKEYBOARD
|
||||
#define XGrabPointer XGRABPOINTER
|
||||
#define XGrabServer XGRABSERVER
|
||||
#define XHeightOfScreen XHEIGHTOFSCREEN
|
||||
#define XIfEvent XIFEVENT
|
||||
#define XInternAtom XINTERNATOM
|
||||
#define XIntersectRegion XINTERSECTREGION
|
||||
#define XKeycodeToKeysym XKEYCODETOKEYSYM
|
||||
#define XKeysymToKeycode XKEYSYMTOKEYCODE
|
||||
#define XKeysymToString XKEYSYMTOSTRING
|
||||
#define XListFonts XLISTFONTS
|
||||
#define XListFontsWithInfo XLISTFONTSWITHINFO
|
||||
#define XListPixmapFormats XLISTPIXMAPFORMATS
|
||||
#define XListProperties XLISTPROPERTIES
|
||||
#define XLoadQueryFont XLOADQUERYFONT
|
||||
#define XLookupString XLOOKUPSTRING
|
||||
#define XLowerWindow XLOWERWINDOW
|
||||
#define XMapRaised XMAPRAISED
|
||||
#define XMapWindow XMAPWINDOW
|
||||
#define XMatchVisualInfo XMATCHVISUALINFO
|
||||
#define XMoveResizeWindow XMOVERESIZEWINDOW
|
||||
#define XMoveWindow XMOVEWINDOW
|
||||
#define XNextEvent XNEXTEVENT
|
||||
#define XOffsetRegion XOFFSETREGION
|
||||
#define XOpenDisplay XOPENDISPLAY
|
||||
#define XOpenIM XOPENIM
|
||||
#define XParseColor XPARSECOLOR
|
||||
#define XParseGeometry XPARSEGEOMETRY
|
||||
#define XPeekEvent XPEEKEVENT
|
||||
#define XPending XPENDING
|
||||
#define XPointInRegion XPOINTINREGION
|
||||
#define XPolygonRegion XPOLYGONREGION
|
||||
#define XPutBackEvent XPUTBACKEVENT
|
||||
#define XPutImage XPUTIMAGE
|
||||
#define XQueryColor XQUERYCOLOR
|
||||
#define XQueryColors XQUERYCOLORS
|
||||
#define XQueryExtension XQUERYEXTENSION
|
||||
#define XQueryPointer XQUERYPOINTER
|
||||
#define XQueryTree XQUERYTREE
|
||||
#define XRaiseWindow XRAISEWINDOW
|
||||
#define XReconfigureWMWindow XRECONFIGUREWMWINDOW
|
||||
#define XRectInRegion XRECTINREGION
|
||||
#define XRefreshKeyboardMapping XREFRESHKEYBOARDMAPPING
|
||||
#define XReparentWindow XREPARENTWINDOW
|
||||
#define XResizeWindow XRESIZEWINDOW
|
||||
#define XRestackWindows XRESTACKWINDOWS
|
||||
#define XRootWindowOfScreen XROOTWINDOWOFSCREEN
|
||||
#define XScreenNumberOfScreen XSCREENNUMBEROFSCREEN
|
||||
#define XSelectAsyncEvent XSELECTASYNCEVENT
|
||||
#define XSelectAsyncInput XSELECTASYNCINPUT
|
||||
#define XSelectInput XSELECTINPUT
|
||||
#define XSendEvent XSENDEVENT
|
||||
#define XServerVendor XSERVERVENDOR
|
||||
#define XSetBackground XSETBACKGROUND
|
||||
#define XSetClassHint XSETCLASSHINT
|
||||
#define XSetClipMask XSETCLIPMASK
|
||||
#define XSetClipOrigin XSETCLIPORIGIN
|
||||
#define XSetClipRectangles XSETCLIPRECTANGLES
|
||||
#define XSetCloseDownMode XSETCLOSEDOWNMODE
|
||||
#define XSetCommand XSETCOMMAND
|
||||
#define XSetDashes XSETDASHES
|
||||
#define XSetErrorHandler XSETERRORHANDLER
|
||||
#define XSetFillStyle XSETFILLSTYLE
|
||||
#define XSetFont XSETFONT
|
||||
#define XSetForeground XSETFOREGROUND
|
||||
#define XSetFunction XSETFUNCTION
|
||||
#define XSetGraphicsExposures XSETGRAPHICSEXPOSURES
|
||||
#define XSetICFocus XSETICFOCUS
|
||||
#define XSetICValues XSETICVALUES
|
||||
#define XSetIOErrorHandler XSETIOERRORHANDLER
|
||||
#define XSetInputFocus XSETINPUTFOCUS
|
||||
#define XSetLineAttributes XSETLINEATTRIBUTES
|
||||
#define XSetLocaleModifiers XSETLOCALEMODIFIERS
|
||||
#define XSetNormalHints XSETNORMALHINTS
|
||||
#define XSetRegion XSETREGION
|
||||
#define XSetSelectionOwner XSETSELECTIONOWNER
|
||||
#define XSetStipple XSETSTIPPLE
|
||||
#define XSetSubwindowMode XSETSUBWINDOWMODE
|
||||
#define XSetTSOrigin XSETTSORIGIN
|
||||
#define XSetTile XSETTILE
|
||||
#define XSetTransientForHint XSETTRANSIENTFORHINT
|
||||
#define XSetWMColormapWindows XSETWMCOLORMAPWINDOWS
|
||||
#define XSetWMHints XSETWMHINTS
|
||||
#define XSetWMIconName XSETWMICONNAME
|
||||
#define XSetWMName XSETWMNAME
|
||||
#define XSetWMNormalHints XSETWMNORMALHINTS
|
||||
#define XSetWMProperties XSETWMPROPERTIES
|
||||
#define XSetWMProtocols XSETWMPROTOCOLS
|
||||
#define XSetWindowBackground XSETWINDOWBACKGROUND
|
||||
#define XSetWindowBackgroundPixmap XSETWINDOWBACKGROUNDPIXMAP
|
||||
#define XSetWindowColormap XSETWINDOWCOLORMAP
|
||||
#define XShapeCombineMask XSHAPECOMBINEMASK
|
||||
#define XShapeCombineRectangles XSHAPECOMBINERECTANGLES
|
||||
#define XShapeGetRectangles XSHAPEGETRECTANGLES
|
||||
#define XShrinkRegion XSHRINKREGION
|
||||
#define XStoreColor XSTORECOLOR
|
||||
#define XStoreColors XSTORECOLORS
|
||||
#define XStoreName XSTORENAME
|
||||
#define XStringToKeysym XSTRINGTOKEYSYM
|
||||
#define XSubtractRegion XSUBTRACTREGION
|
||||
#define XSupportsLocale XSUPPORTSLOCALE
|
||||
#define XSync XSYNC
|
||||
#define XSynchronize XSYNCHRONIZE
|
||||
#define XTextExtents XTEXTEXTENTS
|
||||
#define XTextExtents16 XTEXTEXTENTS16
|
||||
#define XTextWidth XTEXTWIDTH
|
||||
#define XTextWidth16 XTEXTWIDTH16
|
||||
#define XTranslateCoordinates XTRANSLATECOORDINATES
|
||||
#define XUndefineCursor XUNDEFINECURSOR
|
||||
#define XUngrabKeyboard XUNGRABKEYBOARD
|
||||
#define XUngrabPointer XUNGRABPOINTER
|
||||
#define XUngrabServer XUNGRABSERVER
|
||||
#define XUnionRectWithRegion XUNIONRECTWITHREGION
|
||||
#define XUnionRegion XUNIONREGION
|
||||
#define XUnmapWindow XUNMAPWINDOW
|
||||
#define _XUnregisterFilter _XUNREGISTERFILTER
|
||||
#define XUnsetICFocus XUNSETICFOCUS
|
||||
#define XVaCreateNestedList XVACREATENESTEDLIST
|
||||
#define XVisualIDFromVisual XVISUALIDFROMVISUAL
|
||||
#define XWidthOfScreen XWIDTHOFSCREEN
|
||||
#define XWindowEvent XWINDOWEVENT
|
||||
#define XWithdrawWindow XWITHDRAWWINDOW
|
||||
#define XXorRegion XXORREGION
|
||||
#define XmAddProtocolCallback XMADDPROTOCOLCALLBACK
|
||||
#define XmAddProtocols XMADDPROTOCOLS
|
||||
#define XmChangeColor XMCHANGECOLOR
|
||||
#define XmClipboardCopy XMCLIPBOARDCOPY
|
||||
#define XmClipboardEndCopy XMCLIPBOARDENDCOPY
|
||||
#define XmClipboardInquireLength XMCLIPBOARDINQUIRELENGTH
|
||||
#define XmClipboardLock XMCLIPBOARDLOCK
|
||||
#define XmClipboardRetrieve XMCLIPBOARDRETRIEVE
|
||||
#define XmClipboardStartCopy XMCLIPBOARDSTARTCOPY
|
||||
#define XmClipboardUnlock XMCLIPBOARDUNLOCK
|
||||
#define XmCreateArrowButton XMCREATEARROWBUTTON
|
||||
#define XmCreateArrowButtonGadget XMCREATEARROWBUTTONGADGET
|
||||
#define XmCreateCascadeButton XMCREATECASCADEBUTTON
|
||||
#define XmCreateDialogShell XMCREATEDIALOGSHELL
|
||||
#define XmCreateDragIcon XMCREATEDRAGICON
|
||||
#define XmCreateDrawingArea XMCREATEDRAWINGAREA
|
||||
#define XmCreateDrawnButton XMCREATEDRAWNBUTTON
|
||||
#define XmCreateFileSelectionBox XMCREATEFILESELECTIONBOX
|
||||
#define XmCreateFileSelectionDialog XMCREATEFILESELECTIONDIALOG
|
||||
#define XmCreateForm XMCREATEFORM
|
||||
#define XmCreateFormDialog XMCREATEFORMDIALOG
|
||||
#define XmCreateFrame XMCREATEFRAME
|
||||
#define XmCreateInformationDialog XMCREATEINFORMATIONDIALOG
|
||||
#define XmCreateLabelGadget XMCREATELABELGADGET
|
||||
#define XmCreateMainWindow XMCREATEMAINWINDOW
|
||||
#define XmCreateMenuBar XMCREATEMENUBAR
|
||||
#define XmCreateMessageBox XMCREATEMESSAGEBOX
|
||||
#define XmCreateMessageDialog XMCREATEMESSAGEDIALOG
|
||||
#define XmCreateOptionMenu XMCREATEOPTIONMENU
|
||||
#define XmCreatePanedWindow XMCREATEPANEDWINDOW
|
||||
#define XmCreatePopupMenu XMCREATEPOPUPMENU
|
||||
#define XmCreatePromptDialog XMCREATEPROMPTDIALOG
|
||||
#define XmCreatePulldownMenu XMCREATEPULLDOWNMENU
|
||||
#define XmCreatePushButton XMCREATEPUSHBUTTON
|
||||
#define XmCreatePushButtonGadget XMCREATEPUSHBUTTONGADGET
|
||||
#define XmCreateQuestionDialog XMCREATEQUESTIONDIALOG
|
||||
#define XmCreateRadioBox XMCREATERADIOBOX
|
||||
#define XmCreateRowColumn XMCREATEROWCOLUMN
|
||||
#define XmCreateScale XMCREATESCALE
|
||||
#define XmCreateScrollBar XMCREATESCROLLBAR
|
||||
#define XmCreateScrolledList XMCREATESCROLLEDLIST
|
||||
#define XmCreateScrolledText XMCREATESCROLLEDTEXT
|
||||
#define XmCreateScrolledWindow XMCREATESCROLLEDWINDOW
|
||||
#define XmCreateSelectionDialog XMCREATESELECTIONDIALOG
|
||||
#define XmCreateSeparator XMCREATESEPARATOR
|
||||
#define XmCreateSeparatorGadget XMCREATESEPARATORGADGET
|
||||
#define XmCreateTemplateDialog XMCREATETEMPLATEDIALOG
|
||||
#define XmCreateText XMCREATETEXT
|
||||
#define XmCreateTextField XMCREATETEXTFIELD
|
||||
#define XmCreateToggleButton XMCREATETOGGLEBUTTON
|
||||
#define XmCreateToggleButtonGadget XMCREATETOGGLEBUTTONGADGET
|
||||
#define XmDragStart XMDRAGSTART
|
||||
#define XmDropSiteRegister XMDROPSITEREGISTER
|
||||
#define XmDropSiteUnregister XMDROPSITEUNREGISTER
|
||||
#define XmDropSiteUpdate XMDROPSITEUPDATE
|
||||
#define XmDropTransferStart XMDROPTRANSFERSTART
|
||||
#define XmFileSelectionBoxGetChild XMFILESELECTIONBOXGETCHILD
|
||||
#define XmFileSelectionDoSearch XMFILESELECTIONDOSEARCH
|
||||
#define XmFontListAppendEntry XMFONTLISTAPPENDENTRY
|
||||
#define XmFontListCopy XMFONTLISTCOPY
|
||||
#define XmFontListCreate XMFONTLISTCREATE
|
||||
#define XmFontListEntryCreate XMFONTLISTENTRYCREATE
|
||||
#define XmFontListEntryFree XMFONTLISTENTRYFREE
|
||||
#define XmFontListEntryGetFont XMFONTLISTENTRYGETFONT
|
||||
#define XmFontListEntryGetTag XMFONTLISTENTRYGETTAG
|
||||
#define XmFontListEntryLoad XMFONTLISTENTRYLOAD
|
||||
#define XmFontListFree XMFONTLISTFREE
|
||||
#define XmFontListFreeFontContext XMFONTLISTFREEFONTCONTEXT
|
||||
#define XmFontListGetNextFont XMFONTLISTGETNEXTFONT
|
||||
#define XmFontListInitFontContext XMFONTLISTINITFONTCONTEXT
|
||||
#define XmFontListNextEntry XMFONTLISTNEXTENTRY
|
||||
#define XmGetColors XMGETCOLORS
|
||||
#define XmGetFocusWidget XMGETFOCUSWIDGET
|
||||
#define XmGetMenuCursor XMGETMENUCURSOR
|
||||
#define XmGetPixmapByDepth XMGETPIXMAPBYDEPTH
|
||||
#define XmGetTearOffControl XMGETTEAROFFCONTROL
|
||||
#define XmGetXmDisplay XMGETXMDISPLAY
|
||||
#define XmImMbLookupString XMIMMBLOOKUPSTRING
|
||||
#define XmImRegister XMIMREGISTER
|
||||
#define XmImSetFocusValues XMIMSETFOCUSVALUES
|
||||
#define XmImSetValues XMIMSETVALUES
|
||||
#define XmImUnregister XMIMUNREGISTER
|
||||
#define XmImUnsetFocus XMIMUNSETFOCUS
|
||||
#define XmInternAtom XMINTERNATOM
|
||||
#define XmIsMotifWMRunning XMISMOTIFWMRUNNING
|
||||
#define XmListAddItem XMLISTADDITEM
|
||||
#define XmListAddItemUnselected XMLISTADDITEMUNSELECTED
|
||||
#define XmListAddItemsUnselected XMLISTADDITEMSUNSELECTED
|
||||
#define XmListDeleteAllItems XMLISTDELETEALLITEMS
|
||||
#define XmListDeleteItemsPos XMLISTDELETEITEMSPOS
|
||||
#define XmListDeletePos XMLISTDELETEPOS
|
||||
#define XmListDeselectAllItems XMLISTDESELECTALLITEMS
|
||||
#define XmListDeselectPos XMLISTDESELECTPOS
|
||||
#define XmListGetKbdItemPos XMLISTGETKBDITEMPOS
|
||||
#define XmListGetMatchPos XMLISTGETMATCHPOS
|
||||
#define XmListGetSelectedPos XMLISTGETSELECTEDPOS
|
||||
#define XmListPosSelected XMLISTPOSSELECTED
|
||||
#define XmListSelectItem XMLISTSELECTITEM
|
||||
#define XmListSelectPos XMLISTSELECTPOS
|
||||
#define XmListSetBottomPos XMLISTSETBOTTOMPOS
|
||||
#define XmListSetItem XMLISTSETITEM
|
||||
#define XmListSetKbdItemPos XMLISTSETKBDITEMPOS
|
||||
#define XmListSetPos XMLISTSETPOS
|
||||
#define XmMainWindowSetAreas XMMAINWINDOWSETAREAS
|
||||
#define XmMenuPosition XMMENUPOSITION
|
||||
#define XmMessageBoxGetChild XMMESSAGEBOXGETCHILD
|
||||
#define XmOptionButtonGadget XMOPTIONBUTTONGADGET
|
||||
#define XmOptionLabelGadget XMOPTIONLABELGADGET
|
||||
#define XmProcessTraversal XMPROCESSTRAVERSAL
|
||||
#define XmQmotif XMQMOTIF
|
||||
#define XmRemoveProtocolCallback XMREMOVEPROTOCOLCALLBACK
|
||||
#define XmRepTypeGetId XMREPTYPEGETID
|
||||
#define XmRepTypeGetRecord XMREPTYPEGETRECORD
|
||||
#define XmRepTypeRegister XMREPTYPEREGISTER
|
||||
#define XmRepTypeValidValue XMREPTYPEVALIDVALUE
|
||||
#define XmScrollBarSetValues XMSCROLLBARSETVALUES
|
||||
#define XmScrolledWindowSetAreas XMSCROLLEDWINDOWSETAREAS
|
||||
#define XmSelectionBoxGetChild XMSELECTIONBOXGETCHILD
|
||||
#define XmStringByteCompare XMSTRINGBYTECOMPARE
|
||||
#define XmStringCompare XMSTRINGCOMPARE
|
||||
#define XmStringConcat XMSTRINGCONCAT
|
||||
#define XmStringCopy XMSTRINGCOPY
|
||||
#define XmStringCreate XMSTRINGCREATE
|
||||
#define XmStringCreateLocalized XMSTRINGCREATELOCALIZED
|
||||
#define XmStringCreateLtoR XMSTRINGCREATELTOR
|
||||
#define XmStringCreateSimple XMSTRINGCREATESIMPLE
|
||||
#define XmStringDraw XMSTRINGDRAW
|
||||
#define XmStringDrawUnderline XMSTRINGDRAWUNDERLINE
|
||||
#define XmStringExtent XMSTRINGEXTENT
|
||||
#define XmStringFree XMSTRINGFREE
|
||||
#define XmStringFreeContext XMSTRINGFREECONTEXT
|
||||
#define XmStringGetLtoR XMSTRINGGETLTOR
|
||||
#define XmStringGetNextComponent XMSTRINGGETNEXTCOMPONENT
|
||||
#define XmStringGetNextSegment XMSTRINGGETNEXTSEGMENT
|
||||
#define XmStringInitContext XMSTRINGINITCONTEXT
|
||||
#define XmStringLength XMSTRINGLENGTH
|
||||
#define XmStringLtoRCreate XMSTRINGLTORCREATE
|
||||
#define XmStringNConcat XMSTRINGNCONCAT
|
||||
#define XmStringSegmentCreate XMSTRINGSEGMENTCREATE
|
||||
#define XmStringWidth XMSTRINGWIDTH
|
||||
#define XmTextClearSelection XMTEXTCLEARSELECTION
|
||||
#define XmTextFieldGetEditable XMTEXTFIELDGETEDITABLE
|
||||
#define XmTextFieldGetInsertionPosition XMTEXTFIELDGETINSERTIONPOSITION
|
||||
#define XmTextFieldGetLastPosition XMTEXTFIELDGETLASTPOSITION
|
||||
#define XmTextFieldGetSelection XMTEXTFIELDGETSELECTION
|
||||
#define XmTextFieldGetString XMTEXTFIELDGETSTRING
|
||||
#define XmTextFieldInsert XMTEXTFIELDINSERT
|
||||
#define XmTextFieldRemove XMTEXTFIELDREMOVE
|
||||
#define XmTextFieldSetSelection XMTEXTFIELDSETSELECTION
|
||||
#define XmTextFieldSetString XMTEXTFIELDSETSTRING
|
||||
#define XmTextGetCursorPosition XMTEXTGETCURSORPOSITION
|
||||
#define XmTextGetInsertionPosition XMTEXTGETINSERTIONPOSITION
|
||||
#define XmTextGetLastPosition XMTEXTGETLASTPOSITION
|
||||
#define XmTextGetMaxLength XMTEXTGETMAXLENGTH
|
||||
#define XmTextGetSelection XMTEXTGETSELECTION
|
||||
#define XmTextGetSelectionPosition XMTEXTGETSELECTIONPOSITION
|
||||
#define XmTextGetString XMTEXTGETSTRING
|
||||
#define XmTextInsert XMTEXTINSERT
|
||||
#define XmTextRemove XMTEXTREMOVE
|
||||
#define XmTextReplace XMTEXTREPLACE
|
||||
#define XmTextSetCursorPosition XMTEXTSETCURSORPOSITION
|
||||
#define XmTextSetHighlight XMTEXTSETHIGHLIGHT
|
||||
#define XmTextSetInsertionPosition XMTEXTSETINSERTIONPOSITION
|
||||
#define XmTextSetSelection XMTEXTSETSELECTION
|
||||
#define XmTextSetString XMTEXTSETSTRING
|
||||
#define XmToggleButtonGadgetGetState XMTOGGLEBUTTONGADGETGETSTATE
|
||||
#define XmToggleButtonGadgetSetState XMTOGGLEBUTTONGADGETSETSTATE
|
||||
#define XmToggleButtonGetState XMTOGGLEBUTTONGETSTATE
|
||||
#define XmToggleButtonSetState XMTOGGLEBUTTONSETSTATE
|
||||
#define XmUpdateDisplay XMUPDATEDISPLAY
|
||||
#define XmVaCreateSimpleRadioBox XMVACREATESIMPLERADIOBOX
|
||||
#define XmbDrawString XMBDRAWSTRING
|
||||
#define XmbLookupString XMBLOOKUPSTRING
|
||||
#define XmbResetIC XMBRESETIC
|
||||
#define XmbSetWMProperties XMBSETWMPROPERTIES
|
||||
#define XmbTextEscapement XMBTEXTESCAPEMENT
|
||||
#define XmbTextExtents XMBTEXTEXTENTS
|
||||
#define XmbTextListToTextProperty XMBTEXTLISTTOTEXTPROPERTY
|
||||
#define XmbTextPropertyToTextList XMBTEXTPROPERTYTOTEXTLIST
|
||||
#define XmuClientWindow XMUCLIENTWINDOW
|
||||
#define XmuPrintDefaultErrorMessage XMUPRINTDEFAULTERRORMESSAGE
|
||||
#define XrmGetDatabase XRMGETDATABASE
|
||||
#define XrmGetResource XRMGETRESOURCE
|
||||
#define XrmPutStringResource XRMPUTSTRINGRESOURCE
|
||||
#define XrmQuarkToString XRMQUARKTOSTRING
|
||||
#define XrmStringToQuark XRMSTRINGTOQUARK
|
||||
#define XtAddCallback XTADDCALLBACK
|
||||
#define XtAddCallbacks XTADDCALLBACKS
|
||||
#define XtAddEventHandler XTADDEVENTHANDLER
|
||||
#define XtAddGrab XTADDGRAB
|
||||
#define XtAllocateGC XTALLOCATEGC
|
||||
#define XtAppAddActions XTAPPADDACTIONS
|
||||
#define XtAppAddInput XTAPPADDINPUT
|
||||
#define XtAppAddTimeOut XTAPPADDTIMEOUT
|
||||
#define XtAppCreateShell XTAPPCREATESHELL
|
||||
#define XtAppInitialize XTAPPINITIALIZE
|
||||
#define XtAppNextEvent XTAPPNEXTEVENT
|
||||
#define XtAppPeekEvent XTAPPPEEKEVENT
|
||||
#define XtAppPending XTAPPPENDING
|
||||
#define XtAppProcessEvent XTAPPPROCESSEVENT
|
||||
#define XtAppSetErrorHandler XTAPPSETERRORHANDLER
|
||||
#define XtAppSetFallbackResources XTAPPSETFALLBACKRESOURCES
|
||||
#define XtAppSetWarningHandler XTAPPSETWARNINGHANDLER
|
||||
#define XtAppSetWarningMsgHandler XTAPPSETWARNINGMSGHANDLER
|
||||
#define XtAppWarning XTAPPWARNING
|
||||
#define XtCallActionProc XTCALLACTIONPROC
|
||||
#define XtCallCallbackList XTCALLCALLBACKLIST
|
||||
#define XtCallCallbacks XTCALLCALLBACKS
|
||||
#define XtConfigureWidget XTCONFIGUREWIDGET
|
||||
#define XtConvertAndStore XTCONVERTANDSTORE
|
||||
#define XtCreateApplicationContext XTCREATEAPPLICATIONCONTEXT
|
||||
#define XtCreateManagedWidget XTCREATEMANAGEDWIDGET
|
||||
#define XtCreatePopupShell XTCREATEPOPUPSHELL
|
||||
#define XtCreateWidget XTCREATEWIDGET
|
||||
#define XtDatabase XTDATABASE
|
||||
#define XtDestroyWidget XTDESTROYWIDGET
|
||||
#define XtDisownSelection XTDISOWNSELECTION
|
||||
#define XtDispatchEvent XTDISPATCHEVENT
|
||||
#define XtDisplayOfObject XTDISPLAYOFOBJECT
|
||||
#define XtDisplayStringConvWarning XTDISPLAYSTRINGCONVWARNING
|
||||
#define XtDisplayToApplicationContext XTDISPLAYTOAPPLICATIONCONTEXT
|
||||
#define XtAppAddWorkProc XTAPPADDWORKPROC
|
||||
#define XtRemoveWorkProc XTREMOVEWORKPROC
|
||||
#define XtFree XTFREE
|
||||
#define XtGetActionKeysym XTGETACTIONKEYSYM
|
||||
#define XtGetActionList XTGETACTIONLIST
|
||||
#define XtGetApplicationNameAndClass XTGETAPPLICATIONNAMEANDCLASS
|
||||
#define XtGetApplicationResources XTGETAPPLICATIONRESOURCES
|
||||
#define XtGetGC XTGETGC
|
||||
#define XtGetMultiClickTime XTGETMULTICLICKTIME
|
||||
#define XtGetSelectionValue XTGETSELECTIONVALUE
|
||||
#define XtGetSelectionValues XTGETSELECTIONVALUES
|
||||
#define XtGetSubresources XTGETSUBRESOURCES
|
||||
#define XtGetValues XTGETVALUES
|
||||
#define XtGrabKeyboard XTGRABKEYBOARD
|
||||
#define XtGrabPointer XTGRABPOINTER
|
||||
#define XtHasCallbacks XTHASCALLBACKS
|
||||
#define XtInitializeWidgetClass XTINITIALIZEWIDGETCLASS
|
||||
#define XtInsertEventHandler XTINSERTEVENTHANDLER
|
||||
#define XtIsManaged XTISMANAGED
|
||||
#define XtIsObject XTISOBJECT
|
||||
#define XtIsSensitive XTISSENSITIVE
|
||||
#define XtIsSubclass XTISSUBCLASS
|
||||
#define XtLastTimestampProcessed XTLASTTIMESTAMPPROCESSED
|
||||
#define XtMakeGeometryRequest XTMAKEGEOMETRYREQUEST
|
||||
#define XtMakeResizeRequest XTMAKERESIZEREQUEST
|
||||
#define XtMalloc XTMALLOC
|
||||
#define XtManageChild XTMANAGECHILD
|
||||
#define XtManageChildren XTMANAGECHILDREN
|
||||
#define XtMergeArgLists XTMERGEARGLISTS
|
||||
#define XtMoveWidget XTMOVEWIDGET
|
||||
#define XtName XTNAME
|
||||
#define XtNameToWidget XTNAMETOWIDGET
|
||||
#define XtOpenDisplay XTOPENDISPLAY
|
||||
#define XtOverrideTranslations XTOVERRIDETRANSLATIONS
|
||||
#define XtOwnSelection XTOWNSELECTION
|
||||
#define XtParseTranslationTable XTPARSETRANSLATIONTABLE
|
||||
#define XtPopdown XTPOPDOWN
|
||||
#define XtPopup XTPOPUP
|
||||
#define XtQueryGeometry XTQUERYGEOMETRY
|
||||
#define XtRealizeWidget XTREALIZEWIDGET
|
||||
#define XtRealloc XTREALLOC
|
||||
#define XtReleaseGC XTRELEASEGC
|
||||
#define XtRemoveAllCallbacks XTREMOVEALLCALLBACKS
|
||||
#define XtRemoveCallback XTREMOVECALLBACK
|
||||
#define XtRemoveEventHandler XTREMOVEEVENTHANDLER
|
||||
#define XtRemoveGrab XTREMOVEGRAB
|
||||
#define XtRemoveInput XTREMOVEINPUT
|
||||
#define XtRemoveTimeOut XTREMOVETIMEOUT
|
||||
#define XtResizeWidget XTRESIZEWIDGET
|
||||
#define XtResolvePathname XTRESOLVEPATHNAME
|
||||
#define XtSetKeyboardFocus XTSETKEYBOARDFOCUS
|
||||
#define XtSetMappedWhenManaged XTSETMAPPEDWHENMANAGED
|
||||
#define XtSetSensitive XTSETSENSITIVE
|
||||
#define XtSetTypeConverter XTSETTYPECONVERTER
|
||||
#define XtSetValues XTSETVALUES
|
||||
#define XtShellStrings XTSHELLSTRINGS
|
||||
#define XtStrings XTSTRINGS
|
||||
#define XtToolkitInitialize XTTOOLKITINITIALIZE
|
||||
#define XtTranslateCoords XTTRANSLATECOORDS
|
||||
#define XtTranslateKeycode XTTRANSLATEKEYCODE
|
||||
#define XtUngrabKeyboard XTUNGRABKEYBOARD
|
||||
#define XtUngrabPointer XTUNGRABPOINTER
|
||||
#define XtUnmanageChild XTUNMANAGECHILD
|
||||
#define XtUnmanageChildren XTUNMANAGECHILDREN
|
||||
#define XtUnrealizeWidget XTUNREALIZEWIDGET
|
||||
#define XtVaCreateManagedWidget XTVACREATEMANAGEDWIDGET
|
||||
#define XtVaCreateWidget XTVACREATEWIDGET
|
||||
#define XtVaGetValues XTVAGETVALUES
|
||||
#define XtVaSetValues XTVASETVALUES
|
||||
#define XtWarning XTWARNING
|
||||
#define XtWidgetToApplicationContext XTWIDGETTOAPPLICATIONCONTEXT
|
||||
#define XtWindowOfObject XTWINDOWOFOBJECT
|
||||
#define XtWindowToWidget XTWINDOWTOWIDGET
|
||||
#define XwcDrawString XWCDRAWSTRING
|
||||
#define XwcFreeStringList XWCFREESTRINGLIST
|
||||
#define XwcTextEscapement XWCTEXTESCAPEMENT
|
||||
#define XwcTextExtents XWCTEXTEXTENTS
|
||||
#define XwcTextListToTextProperty XWCTEXTLISTTOTEXTPROPERTY
|
||||
#define XwcTextPropertyToTextList XWCTEXTPROPERTYTOTEXTLIST
|
||||
#define _XmBottomShadowColorDefault _XMBOTTOMSHADOWCOLORDEFAULT
|
||||
#define _XmClearBorder _XMCLEARBORDER
|
||||
#define _XmConfigureObject _XMCONFIGUREOBJECT
|
||||
#define _XmDestroyParentCallback _XMDESTROYPARENTCALLBACK
|
||||
#define _XmDrawArrow _XMDRAWARROW
|
||||
#define _XmDrawShadows _XMDRAWSHADOWS
|
||||
#define _XmFontListGetDefaultFont _XMFONTLISTGETDEFAULTFONT
|
||||
#define _XmFromHorizontalPixels _XMFROMHORIZONTALPIXELS
|
||||
#define _XmFromVerticalPixels _XMFROMVERTICALPIXELS
|
||||
#define _XmGetClassExtensionPtr _XMGETCLASSEXTENSIONPTR
|
||||
#define _XmGetDefaultFontList _XMGETDEFAULTFONTLIST
|
||||
#define _XmGetTextualDragIcon _XMGETTEXTUALDRAGICON
|
||||
#define _XmGetWidgetExtData _XMGETWIDGETEXTDATA
|
||||
#define _XmGrabKeyboard _XMGRABKEYBOARD
|
||||
#define _XmGrabPointer _XMGRABPOINTER
|
||||
#define _XmInheritClass _XMINHERITCLASS
|
||||
#define _XmInputInGadget _XMINPUTINGADGET
|
||||
#define _XmMakeGeometryRequest _XMMAKEGEOMETRYREQUEST
|
||||
#define _XmMenuPopDown _XMMENUPOPDOWN
|
||||
#define _XmMoveObject _XMMOVEOBJECT
|
||||
#define _XmNavigChangeManaged _XMNAVIGCHANGEMANAGED
|
||||
#define _XmOSBuildFileList _XMOSBUILDFILELIST
|
||||
#define _XmOSFileCompare _XMOSFILECOMPARE
|
||||
#define _XmOSFindPatternPart _XMOSFINDPATTERNPART
|
||||
#define _XmOSQualifyFileSpec _XMOSQUALIFYFILESPEC
|
||||
#define _XmPostPopupMenu _XMPOSTPOPUPMENU
|
||||
#define _XmPrimitiveEnter _XMPRIMITIVEENTER
|
||||
#define _XmPrimitiveLeave _XMPRIMITIVELEAVE
|
||||
#define _XmRedisplayGadgets _XMREDISPLAYGADGETS
|
||||
#define _XmShellIsExclusive _XMSHELLISEXCLUSIVE
|
||||
#define _XmStringDraw _XMSTRINGDRAW
|
||||
#define _XmStringGetTextConcat _XMSTRINGGETTEXTCONCAT
|
||||
#define _XmStrings _XMSTRINGS
|
||||
#define _XmToHorizontalPixels _XMTOHORIZONTALPIXELS
|
||||
#define _XmToVerticalPixels _XMTOVERTICALPIXELS
|
||||
#define _XmTopShadowColorDefault _XMTOPSHADOWCOLORDEFAULT
|
||||
#define _Xm_fastPtr _XM_FASTPTR
|
||||
#define _XtCheckSubclassFlag _XTCHECKSUBCLASSFLAG
|
||||
#define _XtInherit _XTINHERIT
|
||||
#define _XtInheritTranslations _XTINHERITTRANSLATIONS
|
||||
#define applicationShellWidgetClass APPLICATIONSHELLWIDGETCLASS
|
||||
#define compositeWidgetClass COMPOSITEWIDGETCLASS
|
||||
#define overrideShellWidgetClass OVERRIDESHELLWIDGETCLASS
|
||||
#define shellWidgetClass SHELLWIDGETCLASS
|
||||
#define topLevelShellClassRec TOPLEVELSHELLCLASSREC
|
||||
#define topLevelShellWidgetClass TOPLEVELSHELLWIDGETCLASS
|
||||
#define transientShellWidgetClass TRANSIENTSHELLWIDGETCLASS
|
||||
#define vendorShellClassRec VENDORSHELLCLASSREC
|
||||
#define vendorShellWidgetClass VENDORSHELLWIDGETCLASS
|
||||
#define wmShellWidgetClass WMSHELLWIDGETCLASS
|
||||
#define xmArrowButtonWidgetClass XMARROWBUTTONWIDGETCLASS
|
||||
#define xmCascadeButtonClassRec XMCASCADEBUTTONCLASSREC
|
||||
#define xmCascadeButtonGadgetClass XMCASCADEBUTTONGADGETCLASS
|
||||
#define xmCascadeButtonWidgetClass XMCASCADEBUTTONWIDGETCLASS
|
||||
#define xmDialogShellWidgetClass XMDIALOGSHELLWIDGETCLASS
|
||||
#define xmDrawingAreaWidgetClass XMDRAWINGAREAWIDGETCLASS
|
||||
#define xmDrawnButtonWidgetClass XMDRAWNBUTTONWIDGETCLASS
|
||||
#define xmFileSelectionBoxWidgetClass XMFILESELECTIONBOXWIDGETCLASS
|
||||
#define xmFormWidgetClass XMFORMWIDGETCLASS
|
||||
#define xmFrameWidgetClass XMFRAMEWIDGETCLASS
|
||||
#define xmGadgetClass XMGADGETCLASS
|
||||
#define xmLabelGadgetClass XMLABELGADGETCLASS
|
||||
#define xmLabelWidgetClass XMLABELWIDGETCLASS
|
||||
#define xmListWidgetClass XMLISTWIDGETCLASS
|
||||
#define xmMainWindowWidgetClass XMMAINWINDOWWIDGETCLASS
|
||||
#define xmManagerClassRec XMMANAGERCLASSREC
|
||||
#define xmManagerWidgetClass XMMANAGERWIDGETCLASS
|
||||
#define xmMenuShellWidgetClass XMMENUSHELLWIDGETCLASS
|
||||
#define xmMessageBoxWidgetClass XMMESSAGEBOXWIDGETCLASS
|
||||
#define xmPrimitiveClassRec XMPRIMITIVECLASSREC
|
||||
#define xmPrimitiveWidgetClass XMPRIMITIVEWIDGETCLASS
|
||||
#define xmPushButtonClassRec XMPUSHBUTTONCLASSREC
|
||||
#define xmPushButtonGadgetClass XMPUSHBUTTONGADGETCLASS
|
||||
#define xmPushButtonWidgetClass XMPUSHBUTTONWIDGETCLASS
|
||||
#define xmRowColumnWidgetClass XMROWCOLUMNWIDGETCLASS
|
||||
#define xmSashWidgetClass XMSASHWIDGETCLASS
|
||||
#define xmScrollBarWidgetClass XMSCROLLBARWIDGETCLASS
|
||||
#define xmScrolledWindowClassRec XMSCROLLEDWINDOWCLASSREC
|
||||
#define xmScrolledWindowWidgetClass XMSCROLLEDWINDOWWIDGETCLASS
|
||||
#define xmSeparatorGadgetClass XMSEPARATORGADGETCLASS
|
||||
#define xmSeparatorWidgetClass XMSEPARATORWIDGETCLASS
|
||||
#define xmTextFieldWidgetClass XMTEXTFIELDWIDGETCLASS
|
||||
#define xmTextWidgetClass XMTEXTWIDGETCLASS
|
||||
#define xmToggleButtonGadgetClass XMTOGGLEBUTTONGADGETCLASS
|
||||
#define xmToggleButtonWidgetClass XMTOGGLEBUTTONWIDGETCLASS
|
||||
#define XtRegisterDrawable _XTREGISTERWINDOW
|
||||
#define XtUnregisterDrawable _XTUNREGISTERWINDOW
|
||||
#define XQueryFont XQUERYFONT
|
||||
#define XSetPlaneMask XSETPLANEMASK
|
||||
#define XChangeKeyboardControl XCHANGEKEYBOARDCONTROL
|
||||
#define XDestroySubwindows XDESTROYSUBWINDOWS
|
||||
#define XFreeDeviceList XFREEDEVICELIST
|
||||
#define XFreeDeviceState XFREEDEVICESTATE
|
||||
#define XGetExtensionVersion XGETEXTENSIONVERSION
|
||||
#define XGetRGBColormaps XGETRGBCOLORMAPS
|
||||
#define XIconifyWindow XICONIFYWINDOW
|
||||
#define XInstallColormap XINSTALLCOLORMAP
|
||||
#define XListInputDevices XLISTINPUTDEVICES
|
||||
#define XLookupKeysym XLOOKUPKEYSYM
|
||||
#define XOpenDevice XOPENDEVICE
|
||||
#define XQueryDeviceState XQUERYDEVICESTATE
|
||||
#define XSelectExtensionEvent XSELECTEXTENSIONEVENT
|
||||
#define XWarpPointer XWARPPOINTER
|
||||
#define XmuLookupStandardColormap XMULOOKUPSTANDARDCOLORMAP
|
||||
#define XAllocNamedColor XALLOCNAMEDCOLOR
|
||||
#define XBlackPixelOfScreen XBLACKPIXELOFSCREEN
|
||||
#define XDefaultColormap XDEFAULTCOLORMAP
|
||||
#define XDefaultColormapOfScreen XDEFAULTCOLORMAPOFSCREEN
|
||||
#define XDefaultDepth XDEFAULTDEPTH
|
||||
#define XDefaultScreen XDEFAULTSCREEN
|
||||
#define XDefaultVisual XDEFAULTVISUAL
|
||||
#define XSetIconName XSETICONNAME
|
||||
#define XtInitialize XTINITIALIZE
|
||||
#define XtMainLoop XTMAINLOOP
|
||||
#define DtSaverGetWindows DTSAVERGETWINDOWS
|
||||
#define XAddHosts XADDHOSTS
|
||||
#define XDisableAccessControl XDISABLEACCESSCONTROL
|
||||
#define XEnableAccessControl XENABLEACCESSCONTROL
|
||||
#define XFillArcs XFILLARCS
|
||||
#define XForceScreenSaver XFORCESCREENSAVER
|
||||
#define XGetScreenSaver XGETSCREENSAVER
|
||||
#define XListHosts XLISTHOSTS
|
||||
#define XReadBitmapFile XREADBITMAPFILE
|
||||
#define XRemoveHosts XREMOVEHOSTS
|
||||
#define XResetScreenSaver XRESETSCREENSAVER
|
||||
#define XResourceManagerString XRESOURCEMANAGERSTRING
|
||||
#define XSetScreenSaver XSETSCREENSAVER
|
||||
#define XStringListToTextProperty XSTRINGLISTTOTEXTPROPERTY
|
||||
#define XrmDestroyDatabase XRMDESTROYDATABASE
|
||||
#define XrmGetFileDatabase XRMGETFILEDATABASE
|
||||
#define XrmGetStringDatabase XRMGETSTRINGDATABASE
|
||||
#define XrmInitialize XRMINITIALIZE
|
||||
#define XrmMergeDatabases XRMMERGEDATABASES
|
||||
#define XrmParseCommand XRMPARSECOMMAND
|
||||
#define XrmPutLineResource XRMPUTLINERESOURCE
|
||||
#define XrmQPutStringResource XRMQPUTSTRINGRESOURCE
|
||||
#define XrmStringToBindingQuarkList XRMSTRINGTOBINDINGQUARKLIST
|
||||
#define XrmStringToQuark XRMSTRINGTOQUARK
|
||||
#define XmCreateLabel XMCREATELABEL
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
extern void XtFree(char*);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#define pthread_attr_create PTHREAD_ATTR_CREATE
|
||||
#define pthread_attr_delete PTHREAD_ATTR_DELETE
|
||||
#define pthread_attr_destroy PTHREAD_ATTR_DESTROY
|
||||
#define pthread_attr_getdetach_np PTHREAD_ATTR_GETDETACH_NP
|
||||
#define pthread_attr_getguardsize_np PTHREAD_ATTR_GETGUARDSIZE_NP
|
||||
#define pthread_attr_getinheritsched PTHREAD_ATTR_GETINHERITSCHED
|
||||
#define pthread_attr_getprio PTHREAD_ATTR_GETPRIO
|
||||
#define pthread_attr_getsched PTHREAD_ATTR_GETSCHED
|
||||
#define pthread_attr_getschedparam PTHREAD_ATTR_GETSCHEDPARAM
|
||||
#define pthread_attr_getstacksize PTHREAD_ATTR_GETSTACKSIZE
|
||||
#define pthread_attr_init PTHREAD_ATTR_INIT
|
||||
#define pthread_attr_setdetach_np PTHREAD_ATTR_SETDETACH_NP
|
||||
#define pthread_attr_setdetachstate PTHREAD_ATTR_SETDETACHSTATE
|
||||
#define pthread_attr_setguardsize_np PTHREAD_ATTR_SETGUARDSIZE_NP
|
||||
#define pthread_attr_setinheritsched PTHREAD_ATTR_SETINHERITSCHED
|
||||
#define pthread_attr_setprio PTHREAD_ATTR_SETPRIO
|
||||
#define pthread_attr_setsched PTHREAD_ATTR_SETSCHED
|
||||
#define pthread_attr_setschedparam PTHREAD_ATTR_SETSCHEDPARAM
|
||||
#define pthread_attr_setschedpolicy PTHREAD_ATTR_SETSCHEDPOLICY
|
||||
#define pthread_attr_setstacksize PTHREAD_ATTR_SETSTACKSIZE
|
||||
#define pthread_cancel PTHREAD_CANCEL
|
||||
#define pthread_cancel_e PTHREAD_CANCEL_E
|
||||
#define pthread_cond_broadcast PTHREAD_COND_BROADCAST
|
||||
#define pthread_cond_destroy PTHREAD_COND_DESTROY
|
||||
#define pthread_cond_init PTHREAD_COND_INIT
|
||||
#define pthread_cond_sig_preempt_int_np PTHREAD_COND_SIG_PREEMPT_INT_NP
|
||||
#define pthread_cond_signal PTHREAD_COND_SIGNAL
|
||||
#define pthread_cond_signal_int_np PTHREAD_COND_SIGNAL_INT_NP
|
||||
#define pthread_cond_timedwait PTHREAD_COND_TIMEDWAIT
|
||||
#define pthread_cond_wait PTHREAD_COND_WAIT
|
||||
#define pthread_condattr_create PTHREAD_CONDATTR_CREATE
|
||||
#define pthread_condattr_delete PTHREAD_CONDATTR_DELETE
|
||||
#define pthread_condattr_init PTHREAD_CONDATTR_INIT
|
||||
#define pthread_create PTHREAD_CREATE
|
||||
#define pthread_delay_np PTHREAD_DELAY_NP
|
||||
#define pthread_detach PTHREAD_DETACH
|
||||
#define pthread_equal PTHREAD_EQUAL
|
||||
#define pthread_exc_fetch_fp_np PTHREAD_EXC_FETCH_FP_NP
|
||||
#define pthread_exc_handler_np PTHREAD_EXC_HANDLER_NP
|
||||
#define pthread_exc_pop_ctx_np PTHREAD_EXC_POP_CTX_NP
|
||||
#define pthread_exc_push_ctx_np PTHREAD_EXC_PUSH_CTX_NP
|
||||
#define pthread_exc_savecontext_np PTHREAD_EXC_SAVECONTEXT_NP
|
||||
#define pthread_exit PTHREAD_EXIT
|
||||
#define pthread_get_expiration_np PTHREAD_GET_EXPIRATION_NP
|
||||
#define pthread_getprio PTHREAD_GETPRIO
|
||||
#define pthread_getschedparam PTHREAD_GETSCHEDPARAM
|
||||
#define pthread_getscheduler PTHREAD_GETSCHEDULER
|
||||
#define pthread_getspecific PTHREAD_GETSPECIFIC
|
||||
#define pthread_getunique_np PTHREAD_GETUNIQUE_NP
|
||||
#define pthread_join PTHREAD_JOIN
|
||||
#define pthread_join32 PTHREAD_JOIN32
|
||||
#define pthread_keycreate PTHREAD_KEYCREATE
|
||||
#define pthread_key_create PTHREAD_KEY_CREATE
|
||||
#define pthread_kill PTHREAD_KILL
|
||||
#define pthread_lock_global_np PTHREAD_LOCK_GLOBAL_NP
|
||||
#define pthread_mutex_destroy PTHREAD_MUTEX_DESTROY
|
||||
#define pthread_mutex_init PTHREAD_MUTEX_INIT
|
||||
#define pthread_mutex_lock PTHREAD_MUTEX_LOCK
|
||||
#define pthread_mutex_trylock PTHREAD_MUTEX_TRYLOCK
|
||||
#define pthread_mutex_unlock PTHREAD_MUTEX_UNLOCK
|
||||
#define pthread_mutexattr_create PTHREAD_MUTEXATTR_CREATE
|
||||
#define pthread_mutexattr_delete PTHREAD_MUTEXATTR_DELETE
|
||||
#define pthread_mutexattr_destroy PTHREAD_MUTEXATTR_DESTROY
|
||||
#define pthread_mutexattr_getkind_np PTHREAD_MUTEXATTR_GETKIND_NP
|
||||
#define pthread_mutexattr_init PTHREAD_MUTEXATTR_INIT
|
||||
#define pthread_mutexattr_setkind_np PTHREAD_MUTEXATTR_SETKIND_NP
|
||||
#define pthread_mutexattr_settype_np PTHREAD_MUTEXATTR_SETTYPE_NP
|
||||
#define pthread_once PTHREAD_ONCE
|
||||
#define pthread_resume_np PTHREAD_RESUME_NP
|
||||
#define pthread_self PTHREAD_SELF
|
||||
#define pthread_setasynccancel PTHREAD_SETASYNCCANCEL
|
||||
#define pthread_setcancel PTHREAD_SETCANCEL
|
||||
#define pthread_setcancelstate PTHREAD_SETCANCELSTATE
|
||||
#define pthread_setprio PTHREAD_SETPRIO
|
||||
#define pthread_setschedparam PTHREAD_SETSCHEDPARAM
|
||||
#define pthread_setscheduler PTHREAD_SETSCHEDULER
|
||||
#define pthread_setspecific PTHREAD_SETSPECIFIC
|
||||
#define pthread_suspend_np PTHREAD_SUSPEND_NP
|
||||
#define pthread_testcancel PTHREAD_TESTCANCEL
|
||||
#define pthread_unlock_global_np PTHREAD_UNLOCK_GLOBAL_NP
|
||||
#define pthread_yield PTHREAD_YIELD
|
||||
#define pthread_yield_np PTHREAD_YIELD_NP
|
||||
#define XDefaultRootWindow XDEFAULTROOTWINDOW
|
||||
#define XDisplayCells XDISPLAYCELLS
|
||||
#define XMaxRequestSize XMAXREQUESTSIZE
|
||||
#define XScreenOfDisplay XSCREENOFDISPLAY
|
||||
#define XSetFillRule XSETFILLRULE
|
||||
#define XmActivateProtocol XMACTIVATEPROTOCOL
|
||||
#define XmCreateBulletinBoardDialog XMCREATEBULLETINBOARDDIALOG
|
||||
#define XmCreateErrorDialog XMCREATEERRORDIALOG
|
||||
#define XmCreateWarningDialog XMCREATEWARNINGDIALOG
|
||||
#define XmCvtCTToXmString XMCVTCTTOXMSTRING
|
||||
#define XmDestroyPixmap XMDESTROYPIXMAP
|
||||
#define XmGetPixmap XMGETPIXMAP
|
||||
#define XmInstallImage XMINSTALLIMAGE
|
||||
#define XmListAddItems XMLISTADDITEMS
|
||||
#define XmListDeleteItem XMLISTDELETEITEM
|
||||
#define XmListItemExists XMLISTITEMEXISTS
|
||||
#define XmListItemPos XMLISTITEMPOS
|
||||
#define XmListReplaceItems XMLISTREPLACEITEMS
|
||||
#define XmListReplaceItemsPos XMLISTREPLACEITEMSPOS
|
||||
#define XmRemoveProtocols XMREMOVEPROTOCOLS
|
||||
#define XmRemoveTabGroup XMREMOVETABGROUP
|
||||
#define XmSetColorCalculation XMSETCOLORCALCULATION
|
||||
#define XmTextCopy XMTEXTCOPY
|
||||
#define XmTextCut XMTEXTCUT
|
||||
#define XmTextFieldClearSelection XMTEXTFIELDCLEARSELECTION
|
||||
#define XmTextFieldCopy XMTEXTFIELDCOPY
|
||||
#define XmTextFieldCut XMTEXTFIELDCUT
|
||||
#define XmTextFieldGetMaxLength XMTEXTFIELDGETMAXLENGTH
|
||||
#define XmTextFieldGetSelectionPosition XMTEXTFIELDGETSELECTIONPOSITION
|
||||
#define XmTextFieldPaste XMTEXTFIELDPASTE
|
||||
#define XmTextFieldReplace XMTEXTFIELDREPLACE
|
||||
#define XmTextFieldSetAddMode XMTEXTFIELDSETADDMODE
|
||||
#define XmTextFieldSetHighlight XMTEXTFIELDSETHIGHLIGHT
|
||||
#define XmTextFieldSetInsertionPosition XMTEXTFIELDSETINSERTIONPOSITION
|
||||
#define XmTextFieldSetMaxLength XMTEXTFIELDSETMAXLENGTH
|
||||
#define XmTextFieldShowPosition XMTEXTFIELDSHOWPOSITION
|
||||
#define XmTextGetEditable XMTEXTGETEDITABLE
|
||||
#define XmTextPaste XMTEXTPASTE
|
||||
#define XmTextPosToXY XMTEXTPOSTOXY
|
||||
#define XmTextSetEditable XMTEXTSETEDITABLE
|
||||
#define XmTextShowPosition XMTEXTSHOWPOSITION
|
||||
#define XmUninstallImage XMUNINSTALLIMAGE
|
||||
#define XmuCvtStringToBitmap XMUCVTSTRINGTOBITMAP
|
||||
#define XrmPutFileDatabase XRMPUTFILEDATABASE
|
||||
#define XtAddConverter XTADDCONVERTER
|
||||
#define XtError XTERROR
|
||||
#define XtVaCreatePopupShell XTVACREATEPOPUPSHELL
|
||||
#define pthread_attr_getschedpolicy PTHREAD_ATTR_GETSCHEDPOLICY
|
||||
#define pthread_key_delete PTHREAD_KEY_DELETE
|
||||
#define xmBulletinBoardWidgetClass XMBULLETINBOARDWIDGETCLASS
|
||||
#define xmScaleWidgetClass XMSCALEWIDGETCLASS
|
||||
#define XtDisplay XTDISPLAY
|
||||
#define XtScreen XTSCREEN
|
||||
#define XAllocIconSize XALLOCICONSIZE
|
||||
#define XAllocStandardColormap XALLOCSTANDARDCOLORMAP
|
||||
#define XAllowEvents XALLOWEVENTS
|
||||
#define XBlackPixel XBLACKPIXEL
|
||||
#define XCopyColormapAndFree XCOPYCOLORMAPANDFREE
|
||||
#define XDefaultGC XDEFAULTGC
|
||||
#define XDisplayHeight XDISPLAYHEIGHT
|
||||
#define XDisplayWidth XDISPLAYWIDTH
|
||||
#define XGetCommand XGETCOMMAND
|
||||
#define XGetIconSizes XGETICONSIZES
|
||||
#define XKillClient XKILLCLIENT
|
||||
#define XListInstalledColormaps XLISTINSTALLEDCOLORMAPS
|
||||
#define XRootWindow XROOTWINDOW
|
||||
#define XWMGeometry XWMGEOMETRY
|
||||
#define XWhitePixel XWHITEPIXEL
|
||||
#define XrmCombineDatabase XRMCOMBINEDATABASE
|
||||
#define XrmCombineFileDatabase XRMCOMBINEFILEDATABASE
|
||||
#define XSetStandardProperties XSETSTANDARDPROPERTIES
|
||||
#define XSetState XSETSTATE
|
||||
#define XDrawRectangles XDRAWRECTANGLES
|
||||
#define XGrabButton XGRABBUTTON
|
||||
#define XLookupColor XLOOKUPCOLOR
|
||||
#define XMapSubwindows XMAPSUBWINDOWS
|
||||
#define XRecolorCursor XRECOLORCURSOR
|
||||
#define XStoreBytes XSTOREBYTES
|
||||
#define XUngrabButton XUNGRABBUTTON
|
||||
#define XUninstallColormap XUNINSTALLCOLORMAP
|
||||
#define lib$wait LIB$WAIT
|
||||
#define lib$find_file LIB$FIND_FILE
|
||||
#define lib$find_file_end LIB$FIND_FILE_END
|
||||
#define lib$set_symbol LIB$SET_SYMBOL
|
||||
#define lib$sfree1_dd LIB$SFREE1_DD
|
||||
#define lib$spawn LIB$SPAWN
|
||||
#define sys$assign SYS$ASSIGN
|
||||
#define sys$crembx SYS$CREMBX
|
||||
#define sys$dassgn SYS$DASSGN
|
||||
#define sys$dclexh SYS$DCLEXH
|
||||
#define sys$getdviw SYS$GETDVIW
|
||||
#define sys$getsyiw SYS$GETSYIW
|
||||
#define sys$qio SYS$QIO
|
||||
#define sys$qiow SYS$QIOW
|
||||
#define sys$setef SYS$SETEF
|
||||
#define sys$synch SYS$SYNCH
|
||||
#define XDrawText XDRAWTEXT
|
||||
#define XtCloseDisplay XTCLOSEDISPLAY
|
||||
#define XtDestroyApplicationContext XTDESTROYAPPLICATIONCONTEXT
|
||||
#define lib$ediv LIB$EDIV
|
||||
#define lib$subx LIB$SUBX
|
||||
#define sys$bintim SYS$BINTIM
|
||||
#define sys$gettim SYS$GETTIM
|
||||
#define XFetchName XFETCHNAME
|
||||
#define XPeekIfEvent XPEEKIFEVENT
|
||||
#define XQueryKeymap XQUERYKEYMAP
|
||||
#endif
|
||||
@@ -1,10 +1,10 @@
|
||||
/* $Id: xmesa.h,v 1.8 2000/05/02 02:30:01 brianp Exp $ */
|
||||
/* $Id: xmesa.h,v 1.11 2001/06/20 19:52:11 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.3
|
||||
* Version: 3.5
|
||||
*
|
||||
* Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -58,7 +58,6 @@ and create a window, you must do the following to use the X/Mesa interface:
|
||||
|
||||
8. Before exiting, call XMesaDestroyVisual and XMesaDestroyContext.
|
||||
|
||||
See the demos/xdemo.c and xmesa1.c files for examples.
|
||||
*/
|
||||
|
||||
|
||||
@@ -67,12 +66,14 @@ See the demos/xdemo.c and xmesa1.c files for examples.
|
||||
#ifndef XMESA_H
|
||||
#define XMESA_H
|
||||
|
||||
#ifdef __VMS
|
||||
#include <GL/vms_x_fix.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef XFree86Server
|
||||
#include "xmesa_xf86.h"
|
||||
#else
|
||||
@@ -89,7 +90,7 @@ extern struct Library *XLibBase;
|
||||
|
||||
|
||||
#define XMESA_MAJOR_VERSION 3
|
||||
#define XMESA_MINOR_VERSION 3
|
||||
#define XMESA_MINOR_VERSION 5
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# $Id: Makefile.BeOS-R4,v 1.12 2000/06/27 16:54:18 brianp Exp $
|
||||
# $Id: Makefile.BeOS-R4,v 1.14 2001/02/20 17:04:52 brianp Exp $
|
||||
|
||||
# Mesa 3-D graphics library
|
||||
# Version: 3.3
|
||||
# Copyright (C) 1995-2000 Brian Paul
|
||||
# Version: 3.5
|
||||
# Copyright (C) 1995-2001 Brian Paul
|
||||
|
||||
|
||||
# Makefile for GLUT-based demo programs for BeOS R4
|
||||
@@ -43,6 +43,7 @@ PROGS = bounce \
|
||||
readpix \
|
||||
reflect \
|
||||
renormal \
|
||||
shadowtex \
|
||||
spectex \
|
||||
stex3d \
|
||||
teapot \
|
||||
@@ -64,7 +65,7 @@ PROGS = bounce \
|
||||
.SUFFIXES: .c
|
||||
|
||||
.c: $(LIB_DEP)
|
||||
$(CC) -I$(INCDIR) $(CFLAGS) $< $(GL_LIBS) -o $@
|
||||
$(CC) -I$(INCDIR) -I../util $(CFLAGS) $< $(GL_LIBS) -o $@
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# $Id: Makefile.X11,v 1.14 2000/06/27 16:54:18 brianp Exp $
|
||||
# $Id: Makefile.X11,v 1.19 2001/03/27 17:44:35 brianp Exp $
|
||||
|
||||
# Mesa 3-D graphics library
|
||||
# Version: 3.3
|
||||
# Copyright (C) 1995-2000 Brian Paul
|
||||
# Version: 3.5
|
||||
# Copyright (C) 1995-2001 Brian Paul
|
||||
|
||||
# Makefile for GLUT-based demo programs for Unix/X11
|
||||
|
||||
@@ -14,9 +14,12 @@ LIBDIR = ../lib
|
||||
|
||||
GL_LIBS = -L$(LIBDIR) -lglut -lGLU -lGL $(APP_LIB_DEPS)
|
||||
|
||||
OSMESA_LIBS = -L$(LIBDIR) -lglut -lOSMesa -lGLU -lGL $(APP_LIB_DEPS)
|
||||
|
||||
LIB_DEP = $(LIBDIR)/$(GL_LIB) $(LIBDIR)/$(GLU_LIB) $(LIBDIR)/$(GLUT_LIB)
|
||||
|
||||
PROGS = bounce \
|
||||
PROGS = anisotropic \
|
||||
bounce \
|
||||
clearspd \
|
||||
cubemap \
|
||||
drawpix \
|
||||
@@ -42,6 +45,7 @@ PROGS = bounce \
|
||||
readpix \
|
||||
reflect \
|
||||
renormal \
|
||||
shadowtex \
|
||||
spectex \
|
||||
stex3d \
|
||||
teapot \
|
||||
@@ -62,9 +66,14 @@ PROGS = bounce \
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c
|
||||
|
||||
.c: $(LIB_DEP)
|
||||
$(CC) -I$(INCDIR) $(CFLAGS) $< $(GL_LIBS) -o $@
|
||||
|
||||
# make executable from .c file:
|
||||
.c: $(LIB_DEP)
|
||||
$(CC) -I$(INCDIR) -I../util $(CFLAGS) $< $(GL_LIBS) -o $@
|
||||
|
||||
# special case: need the -lOSMesa library:
|
||||
osdemo: osdemo.c
|
||||
$(CC) -I$(INCDIR) $(CFLAGS) osdemo.c $(OSMESA_LIBS) -o $@
|
||||
|
||||
|
||||
##### TARGETS #####
|
||||
@@ -78,8 +87,17 @@ clean:
|
||||
realclean:
|
||||
-rm $(PROGS)
|
||||
-rm *.o *~
|
||||
-rm readtex.[ch]
|
||||
|
||||
targets: readtex.c readtex.h $(PROGS)
|
||||
|
||||
|
||||
readtex.c:
|
||||
cp ../util/readtex.c .
|
||||
|
||||
readtex.h:
|
||||
cp ../util/readtex.c .
|
||||
|
||||
targets: $(PROGS)
|
||||
|
||||
# execute all programs
|
||||
exec: $(PROGS)
|
||||
@@ -92,4 +110,3 @@ exec: $(PROGS)
|
||||
|
||||
|
||||
include ../Make-config
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# $Id: Makefile.cygnus,v 1.11 2000/06/27 16:54:18 brianp Exp $
|
||||
# $Id: Makefile.cygnus,v 1.12 2000/12/24 22:53:54 pesco Exp $
|
||||
|
||||
# Mesa 3-D graphics library
|
||||
# Version: 3.3
|
||||
@@ -66,7 +66,7 @@ PROGS = bounce \
|
||||
.SUFFIXES: .c
|
||||
|
||||
.c: $(LIB_DEP)
|
||||
$(CC) -I$(INCDIR) $(CFLAGS) $< $(GL_LIBS) -o $@
|
||||
$(CC) -I$(INCDIR) -I../util $(CFLAGS) $< $(GL_LIBS) -o $@
|
||||
|
||||
|
||||
##### TARGETS #####
|
||||
|
||||
220
progs/demos/anisotropic.c
Normal file
220
progs/demos/anisotropic.c
Normal file
@@ -0,0 +1,220 @@
|
||||
/* $Id: anisotropic.c,v 1.1 2001/03/22 15:24:15 gareth Exp $ */
|
||||
|
||||
/*
|
||||
* GL_ARB_texture_filter_anisotropic demo
|
||||
*
|
||||
* Gareth Hughes
|
||||
* March 2001
|
||||
*
|
||||
* Copyright (C) 2000 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is 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 Software.
|
||||
*
|
||||
* THE SOFTWARE IS 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
|
||||
* BRIAN PAUL 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 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/* This is a fairly early version. All it does is draw a couple of
|
||||
* textured quads with different forms of texture filtering. Eventually,
|
||||
* you'll be able to adjust the maximum anisotropy and so on.
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <GL/glut.h>
|
||||
|
||||
#define TEXTURE_SIZE 256
|
||||
static GLubyte image[TEXTURE_SIZE][TEXTURE_SIZE][3];
|
||||
|
||||
static GLfloat repeat = 1.0;
|
||||
|
||||
static GLfloat texcoords[] = {
|
||||
0.0, 0.0,
|
||||
0.0, 1.0,
|
||||
1.0, 0.0,
|
||||
1.0, 1.0
|
||||
};
|
||||
|
||||
static GLfloat vertices[] = {
|
||||
-400.0, -400.0, 0.0,
|
||||
-400.0, 400.0, -7000.0,
|
||||
400.0, -400.0, 0.0,
|
||||
400.0, 400.0, -7000.0
|
||||
};
|
||||
|
||||
static GLfloat maxAnisotropy;
|
||||
|
||||
|
||||
static void init( void )
|
||||
{
|
||||
int i, j;
|
||||
|
||||
if ( !glutExtensionSupported( "GL_EXT_texture_filter_anisotropic" ) ) {
|
||||
fprintf( stderr, "Sorry, this demo requires GL_EXT_texture_filter_anisotropic.\n" );
|
||||
exit( 0 );
|
||||
}
|
||||
|
||||
glClearColor( 0.0, 0.0, 0.0, 0.0 );
|
||||
glShadeModel( GL_SMOOTH );
|
||||
|
||||
/* Init the vertex arrays.
|
||||
*/
|
||||
glEnableClientState( GL_VERTEX_ARRAY );
|
||||
glEnableClientState( GL_TEXTURE_COORD_ARRAY );
|
||||
|
||||
glVertexPointer( 3, GL_FLOAT, 0, vertices );
|
||||
glTexCoordPointer( 2, GL_FLOAT, 0, texcoords );
|
||||
|
||||
/* Init the texture environment.
|
||||
*/
|
||||
glEnable( GL_TEXTURE_2D );
|
||||
glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE );
|
||||
|
||||
glMatrixMode( GL_TEXTURE );
|
||||
glScalef( repeat, repeat, 0 );
|
||||
|
||||
glMatrixMode( GL_MODELVIEW );
|
||||
|
||||
glGetFloatv( GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &maxAnisotropy );
|
||||
printf( "Maximum supported anisotropy: %.2f\n", maxAnisotropy );
|
||||
|
||||
/* Make the texture image.
|
||||
*/
|
||||
glPixelStorei( GL_UNPACK_ALIGNMENT, 1 );
|
||||
|
||||
for ( i = 0 ; i < TEXTURE_SIZE ; i++ ) {
|
||||
for ( j = 0 ; j < TEXTURE_SIZE ; j++ ) {
|
||||
if ( (i/4 + j/4) & 1 ) {
|
||||
image[i][j][0] = 0;
|
||||
image[i][j][1] = 0;
|
||||
image[i][j][2] = 0;
|
||||
} else {
|
||||
image[i][j][0] = 255;
|
||||
image[i][j][1] = 255;
|
||||
image[i][j][2] = 255;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
gluBuild2DMipmaps( GL_TEXTURE_2D, GL_RGB, TEXTURE_SIZE, TEXTURE_SIZE,
|
||||
GL_RGB, GL_UNSIGNED_BYTE, image );
|
||||
}
|
||||
|
||||
static void display( void )
|
||||
{
|
||||
GLint vp[4], w, h;
|
||||
|
||||
glClear( GL_COLOR_BUFFER_BIT );
|
||||
|
||||
glGetIntegerv( GL_VIEWPORT, vp );
|
||||
w = vp[2] / 2;
|
||||
h = vp[3] / 2;
|
||||
|
||||
/* Upper left corner:
|
||||
*/
|
||||
glViewport( 1, h + 1, w - 2, h - 2 );
|
||||
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, maxAnisotropy );
|
||||
|
||||
glDrawArrays( GL_TRIANGLE_STRIP, 0, 4 );
|
||||
|
||||
|
||||
/* Upper right corner:
|
||||
*/
|
||||
glViewport( w + 1, h + 1, w - 2, h - 2 );
|
||||
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST );
|
||||
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, maxAnisotropy );
|
||||
|
||||
glDrawArrays( GL_TRIANGLE_STRIP, 0, 4 );
|
||||
|
||||
|
||||
/* Lower left corner:
|
||||
*/
|
||||
glViewport( 1, 1, w - 2, h - 2 );
|
||||
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_LINEAR );
|
||||
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, maxAnisotropy );
|
||||
|
||||
glDrawArrays( GL_TRIANGLE_STRIP, 0, 4 );
|
||||
|
||||
|
||||
/* Lower right corner:
|
||||
*/
|
||||
glViewport( w + 1, 1, w - 2, h - 2 );
|
||||
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR );
|
||||
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, maxAnisotropy );
|
||||
|
||||
glDrawArrays( GL_TRIANGLE_STRIP, 0, 4 );
|
||||
|
||||
|
||||
glViewport( vp[0], vp[1], vp[2], vp[3] );
|
||||
|
||||
glutSwapBuffers();
|
||||
}
|
||||
|
||||
static void reshape( int w, int h )
|
||||
{
|
||||
glViewport( 0, 0, (GLsizei) w, (GLsizei) h );
|
||||
|
||||
glMatrixMode( GL_PROJECTION );
|
||||
glLoadIdentity();
|
||||
glFrustum( -1.0, 1.0, -1.0, 1.0, 10.0, 10000.0 );
|
||||
|
||||
glMatrixMode( GL_MODELVIEW );
|
||||
glLoadIdentity();
|
||||
glTranslatef( 0.0, 0.0, -10.0 );
|
||||
}
|
||||
|
||||
static void key( unsigned char key, int x, int y )
|
||||
{
|
||||
(void) x; (void) y;
|
||||
|
||||
switch ( key ) {
|
||||
case 27:
|
||||
exit( 0 );
|
||||
}
|
||||
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
static void usage( void )
|
||||
{
|
||||
/* Nothing yet... */
|
||||
}
|
||||
|
||||
int main( int argc, char **argv )
|
||||
{
|
||||
glutInit( &argc, argv );
|
||||
glutInitDisplayMode( GLUT_DOUBLE | GLUT_RGB );
|
||||
glutInitWindowSize( 600, 300 );
|
||||
glutInitWindowPosition( 0, 0 );
|
||||
glutCreateWindow( "Anisotropic Texture Filter Demo" );
|
||||
|
||||
init();
|
||||
|
||||
glutDisplayFunc( display );
|
||||
glutReshapeFunc( reshape );
|
||||
glutKeyboardFunc( key );
|
||||
|
||||
usage();
|
||||
|
||||
glutMainLoop();
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1,36 +1,13 @@
|
||||
/* $Id: bounce.c,v 1.2 2000/06/27 17:04:43 brianp Exp $ */
|
||||
/* $Id: bounce.c,v 1.3 2000/08/16 20:36:34 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Bouncing ball demo. Color index mode only!
|
||||
* Bouncing ball demo.
|
||||
*
|
||||
* This program is in the public domain
|
||||
*
|
||||
* Brian Paul
|
||||
*/
|
||||
|
||||
/* Conversion to GLUT by Mark J. Kilgard */
|
||||
|
||||
/*
|
||||
* $Log: bounce.c,v $
|
||||
* Revision 1.2 2000/06/27 17:04:43 brianp
|
||||
* fixed compiler warnings
|
||||
*
|
||||
* Revision 1.1.1.1 1999/08/19 00:55:40 jtg
|
||||
* Imported sources
|
||||
*
|
||||
* Revision 3.3 1999/03/18 08:16:14 joukj
|
||||
*
|
||||
* cmpstr needs string.h to included to avoid warnings
|
||||
*
|
||||
* Revision 3.2 1998/11/28 01:13:02 brianp
|
||||
* now sets an initial window position and size
|
||||
*
|
||||
* Revision 3.1 1998/11/28 01:06:57 brianp
|
||||
* now works in RGB mode by default
|
||||
*
|
||||
* Revision 3.0 1998/02/14 18:42:29 brianp
|
||||
* initial rev
|
||||
*
|
||||
* Conversion to GLUT by Mark J. Kilgard
|
||||
*/
|
||||
|
||||
|
||||
@@ -84,9 +61,9 @@ make_ball(void)
|
||||
glColor3f(1, 1, 1);
|
||||
}
|
||||
|
||||
x = COS(b) * COS(a);
|
||||
y = SIN(b) * COS(a);
|
||||
z = SIN(a);
|
||||
x = radius * COS(b) * COS(a);
|
||||
y = radius * SIN(b) * COS(a);
|
||||
z = radius * SIN(a);
|
||||
glVertex3f(x, y, z);
|
||||
|
||||
x = radius * COS(b) * COS(a + da);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: clearspd.c,v 1.2 2000/04/10 16:25:15 brianp Exp $ */
|
||||
/* $Id: clearspd.c,v 1.3 2000/12/07 21:50:39 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Simple GLUT program to measure glClear() and glutSwapBuffers() speed.
|
||||
@@ -7,6 +7,9 @@
|
||||
|
||||
/*
|
||||
* $Log: clearspd.c,v $
|
||||
* Revision 1.3 2000/12/07 21:50:39 brianp
|
||||
* call glFinish() before getting t1 time
|
||||
*
|
||||
* Revision 1.2 2000/04/10 16:25:15 brianp
|
||||
* fixed visual selection and reporting results
|
||||
*
|
||||
@@ -71,14 +74,15 @@ static void Display( void )
|
||||
glClear( BufferMask );
|
||||
glutSwapBuffers();
|
||||
}
|
||||
glFinish();
|
||||
t1 = glutGet(GLUT_ELAPSED_TIME) * 0.001;
|
||||
}
|
||||
else {
|
||||
t0 = glutGet(GLUT_ELAPSED_TIME) * 0.001;
|
||||
for (i=0;i<Loops;i++) {
|
||||
glClear( BufferMask );
|
||||
glFlush();
|
||||
}
|
||||
glFinish();
|
||||
t1 = glutGet(GLUT_ELAPSED_TIME) * 0.001;
|
||||
glutSwapBuffers();
|
||||
}
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
##### MACROS #####
|
||||
|
||||
INCDIR = [-.include]
|
||||
CFLAGS = /include=$(INCDIR)/prefix=all
|
||||
INCDIR = ([-.include],[-.util])
|
||||
CFLAGS = /include=$(INCDIR)/prefix=all/name=(as_is,short)
|
||||
|
||||
.ifdef SHARE
|
||||
GL_LIBS = $(XLIBS)
|
||||
@@ -28,7 +28,7 @@ PROGS = bounce.exe;,clearspd.exe;,drawpix.exe;,gamma.exe;,gears.exe;,\
|
||||
|
||||
##### RULES #####
|
||||
.obj.exe :
|
||||
link $(MMS$TARGET_NAME),$(GL_LIBS)
|
||||
cxxlink $(MMS$TARGET_NAME),$(GL_LIBS)
|
||||
|
||||
##### TARGETS #####
|
||||
default :
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: drawpix.c,v 1.3 1999/10/28 18:23:29 brianp Exp $ */
|
||||
/* $Id: drawpix.c,v 1.5 2000/12/24 22:53:54 pesco Exp $ */
|
||||
|
||||
/*
|
||||
* glDrawPixels demo/test/benchmark
|
||||
@@ -8,6 +8,35 @@
|
||||
|
||||
/*
|
||||
* $Log: drawpix.c,v $
|
||||
* Revision 1.5 2000/12/24 22:53:54 pesco
|
||||
* * demos/Makefile.am (INCLUDES): Added -I$(top_srcdir)/util.
|
||||
* * demos/Makefile.X11, demos/Makefile.BeOS-R4, demos/Makefile.cygnus:
|
||||
* Essentially the same.
|
||||
* Program files updated to include "readtex.c", not "../util/readtex.c".
|
||||
* * demos/reflect.c: Likewise for "showbuffer.c".
|
||||
*
|
||||
*
|
||||
* * Makefile.am (EXTRA_DIST): Added top-level regular files.
|
||||
*
|
||||
* * include/GL/Makefile.am (INC_X11): Added glxext.h.
|
||||
*
|
||||
*
|
||||
* * src/GGI/include/ggi/mesa/Makefile.am (EXTRA_HEADERS): Include
|
||||
* Mesa GGI headers in dist even if HAVE_GGI is not given.
|
||||
*
|
||||
* * configure.in: Look for GLUT and demo source dirs in $srcdir.
|
||||
*
|
||||
* * src/swrast/Makefile.am (libMesaSwrast_la_SOURCES): Set to *.[ch].
|
||||
* More source list updates in various Makefile.am's.
|
||||
*
|
||||
* * Makefile.am (dist-hook): Remove CVS directory from distribution.
|
||||
* (DIST_SUBDIRS): List all possible subdirs here.
|
||||
* (SUBDIRS): Only list subdirs selected for build again.
|
||||
* The above two applied to all subdir Makefile.am's also.
|
||||
*
|
||||
* Revision 1.4 2000/09/08 21:45:21 brianp
|
||||
* added dither key option
|
||||
*
|
||||
* Revision 1.3 1999/10/28 18:23:29 brianp
|
||||
* minor changes to Usage() function
|
||||
*
|
||||
@@ -37,7 +66,7 @@
|
||||
#include <math.h>
|
||||
#include <GL/glut.h>
|
||||
|
||||
#include "../util/readtex.c" /* a hack, I know */
|
||||
#include "readtex.c"
|
||||
|
||||
#define IMAGE_FILE "../images/girl.rgb"
|
||||
|
||||
@@ -51,7 +80,7 @@ static int DrawWidth, DrawHeight;
|
||||
static int Scissor = 0;
|
||||
static float Xzoom, Yzoom;
|
||||
static GLboolean DrawFront = GL_FALSE;
|
||||
|
||||
static GLboolean Dither = GL_TRUE;
|
||||
|
||||
|
||||
static void Reset( void )
|
||||
@@ -154,6 +183,13 @@ static void Key( unsigned char key, int x, int y )
|
||||
case ' ':
|
||||
Reset();
|
||||
break;
|
||||
case 'd':
|
||||
Dither = !Dither;
|
||||
if (Dither)
|
||||
glEnable(GL_DITHER);
|
||||
else
|
||||
glDisable(GL_DITHER);
|
||||
break;
|
||||
case 'w':
|
||||
if (DrawWidth > 0)
|
||||
DrawWidth--;
|
||||
@@ -318,7 +354,7 @@ int main( int argc, char *argv[] )
|
||||
if (ciMode)
|
||||
glutInitDisplayMode( GLUT_INDEX | GLUT_DOUBLE );
|
||||
else
|
||||
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
|
||||
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE);
|
||||
|
||||
glutCreateWindow(argv[0]);
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#endif
|
||||
|
||||
#include <GL/glut.h>
|
||||
#include "../util/readtex.c"
|
||||
#include "readtex.c"
|
||||
|
||||
#ifdef XMESA
|
||||
#include "GL/xmesa.h"
|
||||
@@ -71,7 +71,10 @@ static int fullscreen = 1;
|
||||
static int WIDTH = 640;
|
||||
static int HEIGHT = 480;
|
||||
|
||||
#define FRAME 50
|
||||
static GLint T0 = 0;
|
||||
static GLint Frames = 0;
|
||||
static GLint NiceFog = 1;
|
||||
|
||||
#define DIMP 20.0
|
||||
#define DIMTP 16.0
|
||||
|
||||
@@ -136,21 +139,6 @@ static float v = 0.0;
|
||||
static float alpha = -90.0;
|
||||
static float beta = 90.0;
|
||||
|
||||
static float
|
||||
gettime(void)
|
||||
{
|
||||
static clock_t told = 0;
|
||||
clock_t tnew, ris;
|
||||
|
||||
tnew = clock();
|
||||
|
||||
ris = tnew - told;
|
||||
|
||||
told = tnew;
|
||||
|
||||
return (ris / (float) CLOCKS_PER_SEC);
|
||||
}
|
||||
|
||||
static float
|
||||
vrnd(void)
|
||||
{
|
||||
@@ -269,6 +257,13 @@ calcposobs(void)
|
||||
dir[2] = cos(alpha * M_PI / 180.0) * sin(beta * M_PI / 180.0);
|
||||
dir[1] = cos(beta * M_PI / 180.0);
|
||||
|
||||
if (dir[0] < 1.0e-5 && dir[0] > -1.0e-5)
|
||||
dir[0] = 0;
|
||||
if (dir[1] < 1.0e-5 && dir[1] > -1.0e-5)
|
||||
dir[1] = 0;
|
||||
if (dir[2] < 1.0e-5 && dir[2] > -1.0e-5)
|
||||
dir[2] = 0;
|
||||
|
||||
obs[0] += v * dir[0];
|
||||
obs[1] += v * dir[1];
|
||||
obs[2] += v * dir[2];
|
||||
@@ -387,13 +382,16 @@ dojoy(void)
|
||||
static void
|
||||
drawfire(void)
|
||||
{
|
||||
static int count = 0;
|
||||
static char frbuf[80];
|
||||
static char frbuf[80] = "";
|
||||
int j;
|
||||
float fr;
|
||||
|
||||
dojoy();
|
||||
|
||||
if (NiceFog)
|
||||
glHint(GL_FOG_HINT, GL_NICEST);
|
||||
else
|
||||
glHint(GL_FOG_HINT, GL_DONT_CARE);
|
||||
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
|
||||
if (fog)
|
||||
@@ -416,6 +414,7 @@ drawfire(void)
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, groundid);
|
||||
#if 1
|
||||
glBegin(GL_QUADS);
|
||||
glTexCoord2fv(qt[0]);
|
||||
glVertex3fv(q[0]);
|
||||
@@ -426,6 +425,26 @@ drawfire(void)
|
||||
glTexCoord2fv(qt[3]);
|
||||
glVertex3fv(q[3]);
|
||||
glEnd();
|
||||
#else
|
||||
/* Subdivide the ground into a bunch of quads. This improves fog
|
||||
* if GL_FOG_HINT != GL_NICEST
|
||||
*/
|
||||
{
|
||||
float x, y;
|
||||
float dx = 1.0, dy = 1.0;
|
||||
glBegin(GL_QUADS);
|
||||
for (y = -DIMP; y < DIMP; y += 1.0) {
|
||||
for (x = -DIMP; x < DIMP; x += 1.0) {
|
||||
glTexCoord2f(0, 0); glVertex3f(x, 0, y);
|
||||
glTexCoord2f(1, 0); glVertex3f(x+dx, 0, y);
|
||||
glTexCoord2f(1, 1); glVertex3f(x+dx, 0, y+dy);
|
||||
glTexCoord2f(0, 1); glVertex3f(x, 0, y+dy);
|
||||
}
|
||||
}
|
||||
glEnd();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
glEnable(GL_ALPHA_TEST);
|
||||
glAlphaFunc(GL_GEQUAL, 0.9);
|
||||
@@ -468,11 +487,6 @@ drawfire(void)
|
||||
}
|
||||
glEnd();
|
||||
|
||||
if ((count % FRAME) == 0) {
|
||||
fr = gettime();
|
||||
sprintf(frbuf, "Frame rate: %f", FRAME / fr);
|
||||
}
|
||||
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
glDisable(GL_ALPHA_TEST);
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
@@ -499,7 +513,24 @@ drawfire(void)
|
||||
|
||||
glutSwapBuffers();
|
||||
|
||||
count++;
|
||||
Frames++;
|
||||
{
|
||||
GLint t = glutGet(GLUT_ELAPSED_TIME);
|
||||
if (t - T0 >= 2000) {
|
||||
GLfloat seconds = (t - T0) / 1000.0;
|
||||
GLfloat fps = Frames / seconds;
|
||||
sprintf(frbuf, "Frame rate: %f", fps);
|
||||
T0 = t;
|
||||
Frames = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
idle(void)
|
||||
{
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
@@ -520,6 +551,7 @@ special(int key, int x, int y)
|
||||
beta += 2.0;
|
||||
break;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -567,7 +599,12 @@ key(unsigned char key, int x, int y)
|
||||
fullscreen = (!fullscreen);
|
||||
break;
|
||||
#endif
|
||||
case 'n':
|
||||
NiceFog = !NiceFog;
|
||||
printf("NiceFog %d\n", NiceFog);
|
||||
break;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -671,8 +708,6 @@ main(int ac, char **av)
|
||||
|
||||
/* Default settings */
|
||||
|
||||
WIDTH = 640;
|
||||
HEIGHT = 480;
|
||||
np = 800;
|
||||
eject_r = 0.1;
|
||||
dt = 0.015;
|
||||
@@ -716,9 +751,6 @@ main(int ac, char **av)
|
||||
glFogi(GL_FOG_MODE, GL_EXP);
|
||||
glFogfv(GL_FOG_COLOR, fogcolor);
|
||||
glFogf(GL_FOG_DENSITY, 0.1);
|
||||
#ifdef FX
|
||||
glHint(GL_FOG_HINT, GL_NICEST);
|
||||
#endif
|
||||
|
||||
p = malloc(sizeof(part) * np);
|
||||
|
||||
@@ -730,7 +762,7 @@ main(int ac, char **av)
|
||||
glutKeyboardFunc(key);
|
||||
glutSpecialFunc(special);
|
||||
glutDisplayFunc(drawfire);
|
||||
glutIdleFunc(drawfire);
|
||||
glutIdleFunc(idle);
|
||||
glutReshapeFunc(reshape);
|
||||
glutMainLoop();
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: geartrain.c,v 1.6 2000/04/06 02:22:59 brianp Exp $ */
|
||||
/* $Id: geartrain.c,v 1.7 2000/11/30 01:44:24 gareth Exp $ */
|
||||
|
||||
/*
|
||||
* GearTrain Simulator * Version: 1.00
|
||||
@@ -42,7 +42,7 @@ typedef GLfloat TDA[4];
|
||||
TDA background;
|
||||
|
||||
|
||||
struct AXLE
|
||||
struct AXLE
|
||||
{
|
||||
char name[20];
|
||||
GLint id;
|
||||
@@ -57,7 +57,7 @@ struct AXLE
|
||||
};
|
||||
|
||||
|
||||
struct GEAR
|
||||
struct GEAR
|
||||
{
|
||||
char name[20];
|
||||
char type[7];
|
||||
@@ -79,7 +79,7 @@ struct GEAR
|
||||
};
|
||||
|
||||
|
||||
struct BELT
|
||||
struct BELT
|
||||
{
|
||||
char name[20];
|
||||
GLint id;
|
||||
@@ -99,9 +99,12 @@ int number_of_belts;
|
||||
|
||||
char Buf1[256], Buf2[256], Buf3[256], Buf4[256], Buf5[256];
|
||||
|
||||
static GLint T0 = 0;
|
||||
static GLint Frames = 0;
|
||||
|
||||
static void
|
||||
strset (char buf[], char ch)
|
||||
|
||||
static void
|
||||
strset (char buf[], char ch)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < strlen (buf); i++)
|
||||
@@ -109,8 +112,8 @@ strset (char buf[], char ch)
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Clear_Buffers ()
|
||||
static void
|
||||
Clear_Buffers ()
|
||||
{
|
||||
strset (Buf1, 0);
|
||||
strset (Buf2, 0);
|
||||
@@ -120,8 +123,8 @@ Clear_Buffers ()
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
LoadTriplet (TDA A)
|
||||
static void
|
||||
LoadTriplet (TDA A)
|
||||
{
|
||||
Clear_Buffers ();
|
||||
fscanf (mainfile, "%s %s %s %s", Buf1, Buf2, Buf3, Buf4);
|
||||
@@ -131,8 +134,8 @@ LoadTriplet (TDA A)
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
LoadReal (float *a)
|
||||
static void
|
||||
LoadReal (float *a)
|
||||
{
|
||||
Clear_Buffers ();
|
||||
fscanf (mainfile, "%s %s", Buf1, Buf2);
|
||||
@@ -140,8 +143,8 @@ LoadReal (float *a)
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
LoadInteger (int *a)
|
||||
static void
|
||||
LoadInteger (int *a)
|
||||
{
|
||||
Clear_Buffers ();
|
||||
fscanf (mainfile, "%s %s", Buf1, Buf2);
|
||||
@@ -149,8 +152,8 @@ LoadInteger (int *a)
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
LoadText (char *a)
|
||||
static void
|
||||
LoadText (char *a)
|
||||
{
|
||||
Clear_Buffers ();
|
||||
fscanf (mainfile, "%s %s", Buf1, Buf2);
|
||||
@@ -158,11 +161,11 @@ LoadText (char *a)
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
getdata (char filename[])
|
||||
static void
|
||||
getdata (char filename[])
|
||||
{
|
||||
int gear_count = 0, axle_count = 0, belt_count = 0, i;
|
||||
|
||||
|
||||
mainfile = fopen (filename, "r");
|
||||
if (!mainfile) {
|
||||
printf("Error: couldn't open %s\n", filename);
|
||||
@@ -181,92 +184,92 @@ getdata (char filename[])
|
||||
|
||||
if (!(strcmp (Buf1, "BACKGROUND")))
|
||||
LoadTriplet (background);
|
||||
|
||||
|
||||
if (!(strcmp (Buf1, "ANAME")))
|
||||
{
|
||||
LoadText (a[axle_count].name);
|
||||
axle_count++;
|
||||
}
|
||||
|
||||
|
||||
if (!(strcmp (Buf1, "ARADIUS")))
|
||||
LoadReal (&a[axle_count - 1].radius);
|
||||
|
||||
|
||||
if (!(strcmp (Buf1, "AAXIS")))
|
||||
LoadInteger (&a[axle_count - 1].axis);
|
||||
|
||||
|
||||
if (!(strcmp (Buf1, "ACOLOR")))
|
||||
LoadTriplet (a[axle_count - 1].color);
|
||||
|
||||
|
||||
if (!(strcmp (Buf1, "APOSITION")))
|
||||
LoadTriplet (a[axle_count - 1].position);
|
||||
|
||||
|
||||
if (!(strcmp (Buf1, "ALENGTH")))
|
||||
LoadReal (&a[axle_count - 1].length);
|
||||
|
||||
|
||||
if (!(strcmp (Buf1, "AMOTORED")))
|
||||
LoadInteger (&a[axle_count - 1].motored);
|
||||
|
||||
|
||||
if (!(strcmp (Buf1, "AANGULARVELOCITY")))
|
||||
LoadReal (&a[axle_count - 1].angular_velocity);
|
||||
|
||||
|
||||
if (!(strcmp (Buf1, "ADIRECTION")))
|
||||
LoadInteger (&a[axle_count - 1].direction);
|
||||
|
||||
|
||||
if (!(strcmp (Buf1, "GNAME")))
|
||||
{
|
||||
LoadText (g[gear_count].name);
|
||||
gear_count++;
|
||||
}
|
||||
|
||||
|
||||
if (!(strcmp (Buf1, "GTYPE")))
|
||||
LoadText (g[gear_count - 1].type);
|
||||
|
||||
|
||||
if (!(strcmp (Buf1, "GFACE")))
|
||||
LoadInteger (&g[gear_count - 1].face);
|
||||
|
||||
|
||||
if (!(strcmp (Buf1, "GRADIUS")))
|
||||
LoadReal (&g[gear_count - 1].radius);
|
||||
|
||||
|
||||
if (!(strcmp (Buf1, "GWIDTH")))
|
||||
LoadReal (&g[gear_count - 1].width);
|
||||
|
||||
|
||||
if (!(strcmp (Buf1, "GTEETH")))
|
||||
LoadInteger (&g[gear_count - 1].teeth);
|
||||
|
||||
|
||||
if (!(strcmp (Buf1, "GTOOTHDEPTH")))
|
||||
LoadReal (&g[gear_count - 1].tooth_depth);
|
||||
|
||||
|
||||
if (!(strcmp (Buf1, "GCOLOR")))
|
||||
LoadTriplet (g[gear_count - 1].color);
|
||||
|
||||
|
||||
if (!(strcmp (Buf1, "GAXLE")))
|
||||
LoadText (g[gear_count - 1].axle_name);
|
||||
|
||||
|
||||
if (!(strcmp (Buf1, "GPOSITION")))
|
||||
LoadInteger (&g[gear_count - 1].relative_position);
|
||||
|
||||
|
||||
if (!(strcmp (Buf1, "BELTNAME")))
|
||||
{
|
||||
LoadText (b[belt_count].name);
|
||||
belt_count++;
|
||||
}
|
||||
|
||||
|
||||
if (!(strcmp (Buf1, "GEAR1NAME")))
|
||||
LoadText (b[belt_count - 1].gear1_name);
|
||||
|
||||
|
||||
if (!(strcmp (Buf1, "GEAR2NAME")))
|
||||
LoadText (b[belt_count - 1].gear2_name);
|
||||
}
|
||||
|
||||
|
||||
while (Buf1[0] != 0);
|
||||
|
||||
|
||||
for (i = 0; i < number_of_gears; i++)
|
||||
{
|
||||
g[i].axis = -1;
|
||||
g[i].direction = 0;
|
||||
g[i].angular_velocity = 0.0;
|
||||
}
|
||||
|
||||
|
||||
number_of_gears = gear_count;
|
||||
number_of_axles = axle_count;
|
||||
number_of_belts = belt_count;
|
||||
@@ -274,12 +277,12 @@ getdata (char filename[])
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
axle (GLint j, GLfloat radius, GLfloat length)
|
||||
static void
|
||||
axle (GLint j, GLfloat radius, GLfloat length)
|
||||
{
|
||||
GLfloat angle, rad, incr = 10.0 * M_PI / 180.0;
|
||||
|
||||
/* draw main cylinder */
|
||||
|
||||
/* draw main cylinder */
|
||||
glBegin (GL_QUADS);
|
||||
for (angle = 0.0; angle < 360.0; angle += 5.0)
|
||||
{
|
||||
@@ -291,8 +294,8 @@ axle (GLint j, GLfloat radius, GLfloat length)
|
||||
glVertex3f (radius * cos (rad + incr), radius * sin (rad + incr), length / 2);
|
||||
}
|
||||
glEnd ();
|
||||
|
||||
/* draw front face */
|
||||
|
||||
/* draw front face */
|
||||
glNormal3f (0.0, 0.0, 1.0);
|
||||
glBegin (GL_TRIANGLES);
|
||||
for (angle = 0.0; angle < 360.0; angle += 5.0)
|
||||
@@ -304,8 +307,8 @@ axle (GLint j, GLfloat radius, GLfloat length)
|
||||
glVertex3f (0.0, 0.0, length / 2);
|
||||
}
|
||||
glEnd ();
|
||||
|
||||
/* draw back face */
|
||||
|
||||
/* draw back face */
|
||||
glNormal3f (0.0, 0.0, -1.0);
|
||||
glBegin (GL_TRIANGLES);
|
||||
for (angle = 0.0; angle <= 360.0; angle += 5.0)
|
||||
@@ -321,9 +324,9 @@ axle (GLint j, GLfloat radius, GLfloat length)
|
||||
|
||||
|
||||
|
||||
static void
|
||||
gear (GLint j, char type[], GLfloat radius, GLfloat width,
|
||||
GLint teeth, GLfloat tooth_depth)
|
||||
static void
|
||||
gear (GLint j, char type[], GLfloat radius, GLfloat width,
|
||||
GLint teeth, GLfloat tooth_depth)
|
||||
{
|
||||
GLint i;
|
||||
GLfloat r1, r2;
|
||||
@@ -333,7 +336,7 @@ gear (GLint j, char type[], GLfloat radius, GLfloat width,
|
||||
|
||||
r1 = radius - tooth_depth;
|
||||
r2 = radius;
|
||||
|
||||
|
||||
da = 2.0 * M_PI / teeth / 4.0;
|
||||
if (!g[j].face)
|
||||
{
|
||||
@@ -346,7 +349,7 @@ gear (GLint j, char type[], GLfloat radius, GLfloat width,
|
||||
n = 1.0;
|
||||
}
|
||||
|
||||
/* draw front face */
|
||||
/* draw front face */
|
||||
if (!(strcmp (type, "NORMAL")))
|
||||
{
|
||||
glNormal3f (0.0, 0.0, 1.0 * n);
|
||||
@@ -375,8 +378,8 @@ gear (GLint j, char type[], GLfloat radius, GLfloat width,
|
||||
}
|
||||
glEnd ();
|
||||
}
|
||||
|
||||
/* draw front sides of teeth */
|
||||
|
||||
/* draw front sides of teeth */
|
||||
if (!(strcmp (type, "NORMAL")))
|
||||
{
|
||||
glNormal3f (0.0, 0.0, 1.0 * n);
|
||||
@@ -392,10 +395,10 @@ gear (GLint j, char type[], GLfloat radius, GLfloat width,
|
||||
}
|
||||
glEnd ();
|
||||
}
|
||||
|
||||
|
||||
glNormal3f (0.0, 0.0, -1.0 * n);
|
||||
|
||||
/* draw back face */
|
||||
|
||||
/* draw back face */
|
||||
glBegin (GL_QUAD_STRIP);
|
||||
for (i = 0; i <= teeth; i++)
|
||||
{
|
||||
@@ -406,8 +409,8 @@ gear (GLint j, char type[], GLfloat radius, GLfloat width,
|
||||
glVertex3f (0.0, 0.0, -width * fraction);
|
||||
}
|
||||
glEnd ();
|
||||
|
||||
/* draw back sides of teeth */
|
||||
|
||||
/* draw back sides of teeth */
|
||||
glNormal3f (0.0, 0.0, -1.0 * n);
|
||||
glBegin (GL_QUADS);
|
||||
da = 2.0 * M_PI / teeth / 4.0;
|
||||
@@ -420,16 +423,16 @@ gear (GLint j, char type[], GLfloat radius, GLfloat width,
|
||||
glVertex3f (r1 * cos (angle), r1 * sin (angle), -width * fraction);
|
||||
}
|
||||
glEnd ();
|
||||
|
||||
|
||||
/* draw outward faces of teeth */
|
||||
|
||||
|
||||
/* draw outward faces of teeth */
|
||||
if (!(strcmp (type, "NORMAL")))
|
||||
{
|
||||
glBegin (GL_QUAD_STRIP);
|
||||
for (i = 0; i < teeth; i++)
|
||||
{
|
||||
angle = i * 2.0 * M_PI / teeth;
|
||||
|
||||
|
||||
glVertex3f (r1 * cos (angle), r1 * sin (angle), width * fraction);
|
||||
glVertex3f (r1 * cos (angle), r1 * sin (angle), -width * fraction);
|
||||
u = r2 * cos (angle + da) - r1 * cos (angle);
|
||||
@@ -478,27 +481,27 @@ gear (GLint j, char type[], GLfloat radius, GLfloat width,
|
||||
glNormal3f (cos (angle), sin (angle), n);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
glVertex3f (r1 * cos (0), r1 * sin (0), width * fraction);
|
||||
glVertex3f (r1 * cos (0), r1 * sin (0), -width * fraction);
|
||||
glEnd ();
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
belt (struct GEAR g1, struct GEAR g2)
|
||||
static void
|
||||
belt (struct GEAR g1, struct GEAR g2)
|
||||
{
|
||||
GLfloat D, alpha, phi, angle, incr, width;
|
||||
GLint indexes[3] =
|
||||
{
|
||||
0, 0, 0
|
||||
};
|
||||
|
||||
|
||||
GLfloat col[3] =
|
||||
{
|
||||
0.0, 0.0, 0.0
|
||||
};
|
||||
|
||||
|
||||
width = min (g1.width, g2.width);
|
||||
D = sqrt (pow (g1.position[0] - g2.position[0], 2) + pow (g1.position[1] - g2.position[1], 2) + pow (g1.position[2] - g2.position[2], 2));
|
||||
alpha = acos ((g2.position[0] - g1.position[0]) / D);
|
||||
@@ -545,11 +548,11 @@ belt (struct GEAR g1, struct GEAR g2)
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
axle_find (char axle_name[])
|
||||
static int
|
||||
axle_find (char axle_name[])
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
for (i = 0; i < number_of_axles; i++)
|
||||
{
|
||||
if (!(strcmp (axle_name, a[i].name)))
|
||||
@@ -559,11 +562,11 @@ axle_find (char axle_name[])
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
gear_find (char gear_name[])
|
||||
static int
|
||||
gear_find (char gear_name[])
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
for (i = 0; i < number_of_gears; i++)
|
||||
{
|
||||
if (!(strcmp (gear_name, g[i].name)))
|
||||
@@ -573,13 +576,13 @@ gear_find (char gear_name[])
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
process ()
|
||||
static void
|
||||
process ()
|
||||
{
|
||||
GLfloat x, y, z, D, dist;
|
||||
GLint axle_index, i, j, g1, g2, k;
|
||||
char error[80];
|
||||
|
||||
|
||||
for (i = 0; i < number_of_gears; i++)
|
||||
{
|
||||
x = 0.0;
|
||||
@@ -599,12 +602,12 @@ process ()
|
||||
y = 1.0;
|
||||
else
|
||||
z = 1.0;
|
||||
|
||||
|
||||
g[i].position[0] = a[axle_index].position[0] + x * g[i].relative_position;
|
||||
g[i].position[1] = a[axle_index].position[1] + y * g[i].relative_position;
|
||||
g[i].position[2] = a[axle_index].position[2] + z * g[i].relative_position;
|
||||
}
|
||||
|
||||
|
||||
for (k = 0; k < number_of_axles; k++)
|
||||
{
|
||||
for (i = 0; i < number_of_gears - 1; i++)
|
||||
@@ -617,11 +620,11 @@ process ()
|
||||
if (D < 1.1 * (g[i].radius - g[i].tooth_depth + g[j].radius - g[j].tooth_depth))
|
||||
{
|
||||
printf (error, "Gear %s and %s are too close to each other.", g[i].name, g[j].name);
|
||||
|
||||
|
||||
/*MessageBox(NULL,error,windowName,MB_ICONEXCLAMATION|MB_OK);*/
|
||||
exit (1);
|
||||
}
|
||||
|
||||
|
||||
if (g[i].axis == 0)
|
||||
{
|
||||
dist = g[i].position[0] - g[j].position[0];
|
||||
@@ -632,9 +635,9 @@ process ()
|
||||
}
|
||||
else
|
||||
dist = g[i].position[2] - g[j].position[2];
|
||||
|
||||
|
||||
dist = fabs (dist);
|
||||
|
||||
|
||||
if (dist < (g[i].width / 2 + g[j].width / 2))
|
||||
{
|
||||
if ((g[i].motored) && (!(g[j].motored)) && (D < 0.95 * (g[i].radius + g[j].radius)))
|
||||
@@ -646,13 +649,13 @@ process ()
|
||||
/*MessageBox(NULL,error,windowName,MB_ICONEXCLAMATION|MB_OK);*/
|
||||
exit (1);
|
||||
}
|
||||
|
||||
|
||||
g[j].motored = (a[axle_index].motored = 1);
|
||||
g[j].direction = (a[axle_index].direction = -g[i].direction);
|
||||
a[axle_index].angular_velocity = g[i].angular_velocity * g[i].teeth / g[j].teeth;
|
||||
g[j].angular_velocity = (a[axle_index].angular_velocity *= g[i].radius / g[j].radius);
|
||||
}
|
||||
|
||||
|
||||
if ((!(g[i].motored)) && (g[j].motored) && (D < 0.95 * (g[i].radius + g[j].radius)))
|
||||
{
|
||||
axle_index = axle_find (g[i].axle_name);
|
||||
@@ -662,16 +665,16 @@ process ()
|
||||
/*MessageBox(NULL,error,windowName,MB_ICONEXCLAMATION|MB_OK);*/
|
||||
exit (1);
|
||||
}
|
||||
|
||||
|
||||
g[i].motored = (a[axle_index].motored = 1);
|
||||
g[i].direction = (a[axle_index].direction = -g[j].direction);
|
||||
a[axle_index].angular_velocity = g[j].angular_velocity * g[j].teeth / g[i].teeth;
|
||||
g[i].angular_velocity = (a[axle_index].angular_velocity *= g[j].radius / g[i].radius);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!(strcmp (g[i].type, g[j].type)) && (!(strcmp (g[i].type, "BEVEL"))) && ((strcmp (g[i].axle_name, g[j].axle_name) != 0)) && (g[i].axis != g[j].axis))
|
||||
{
|
||||
D = sqrt (pow (g[i].position[0] - g[j].position[0], 2) + pow (g[i].position[1] - g[j].position[1], 2) + pow (g[i].position[2] - g[j].position[2], 2));
|
||||
@@ -689,8 +692,8 @@ process ()
|
||||
a[axle_index].angular_velocity = g[i].angular_velocity * g[i].teeth / g[j].teeth;
|
||||
g[j].angular_velocity = (a[axle_index].angular_velocity *= g[i].radius / g[j].radius);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if ((!(g[i].motored)) && (g[j].motored) && (D < 0.95 * sqrt (g[i].radius * g[i].radius + g[j].radius * g[j].radius)))
|
||||
{
|
||||
axle_index = axle_find (g[i].axle_name);
|
||||
@@ -708,7 +711,7 @@ process ()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (i = 0; i < number_of_gears; i++)
|
||||
{
|
||||
axle_index = axle_find (g[i].axle_name);
|
||||
@@ -719,7 +722,7 @@ process ()
|
||||
g[i].angular_velocity = a[axle_index].angular_velocity;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (i = 0; i < number_of_belts; i++)
|
||||
{
|
||||
g1 = gear_find (b[i].gear1_name);
|
||||
@@ -731,7 +734,7 @@ process ()
|
||||
/*MessageBox(NULL,error,windowName,MB_ICONEXCLAMATION|MB_OK);*/
|
||||
exit (1);
|
||||
}
|
||||
|
||||
|
||||
if ((g[g1].axis == g[g2].axis) && (!strcmp (g[g1].type, g[g2].type)) && (!strcmp (g[g1].type, "NORMAL")))
|
||||
{
|
||||
/*
|
||||
@@ -742,7 +745,7 @@ process ()
|
||||
MessageBox(NULL,error,windowName,MB_ICONEXCLAMATION|MB_OK);
|
||||
exit(1);
|
||||
}
|
||||
*/
|
||||
*/
|
||||
if (g[g1].axis == 0)
|
||||
{
|
||||
dist = g[g1].position[0] - g[g2].position[0];
|
||||
@@ -753,16 +756,16 @@ process ()
|
||||
}
|
||||
else
|
||||
dist = g[g1].position[2] - g[g2].position[2];
|
||||
|
||||
|
||||
dist = fabs (dist);
|
||||
|
||||
|
||||
if (dist > (g[g1].width / 2 + g[g2].width / 2))
|
||||
{
|
||||
printf (error, "Belt %s invalid.", b[i].name);
|
||||
/*MessageBox(NULL,error,windowName,MB_ICONEXCLAMATION|MB_OK);*/
|
||||
exit (1);
|
||||
}
|
||||
|
||||
|
||||
if (dist < (g[g1].width / 2 + g[g2].width / 2))
|
||||
{
|
||||
if (D < g[g1].radius + g[g2].radius)
|
||||
@@ -771,7 +774,7 @@ process ()
|
||||
/*MessageBox(NULL,error,windowName,MB_ICONEXCLAMATION|MB_OK);*/
|
||||
exit (1);
|
||||
}
|
||||
|
||||
|
||||
if ((g[g1].motored) && (!(g[g2].motored)))
|
||||
{
|
||||
axle_index = axle_find (g[g2].axle_name);
|
||||
@@ -779,7 +782,7 @@ process ()
|
||||
g[g2].direction = (a[axle_index].direction = g[g1].direction);
|
||||
g[g2].angular_velocity = (a[axle_index].angular_velocity = g[g1].angular_velocity * g[g1].radius / g[g2].radius);
|
||||
}
|
||||
|
||||
|
||||
if ((!(g[g1].motored)) && (g[g2].motored))
|
||||
{
|
||||
axle_index = axle_find (g[g1].axle_name);
|
||||
@@ -790,7 +793,7 @@ process ()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (i = 0; i < number_of_gears; i++)
|
||||
{
|
||||
axle_index = axle_find (g[i].axle_name);
|
||||
@@ -809,20 +812,20 @@ process ()
|
||||
GLfloat view_rotx = 20.0, view_roty = 30.0, view_rotz = 10.0;
|
||||
|
||||
|
||||
static void
|
||||
draw (void)
|
||||
static void
|
||||
draw (void)
|
||||
{
|
||||
int i;
|
||||
GLfloat x, y, z;
|
||||
int index;
|
||||
|
||||
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
|
||||
glPushMatrix ();
|
||||
glRotatef (view_rotx, 1.0, 0.0, 0.0);
|
||||
glRotatef (view_roty, 0.0, 1.0, 0.0);
|
||||
glRotatef (view_rotz, 0.0, 0.0, 1.0);
|
||||
|
||||
|
||||
for (i = 0; i < number_of_gears; i++)
|
||||
{
|
||||
x = 0.0;
|
||||
@@ -837,15 +840,15 @@ draw (void)
|
||||
x = 1.0;
|
||||
else
|
||||
z = 1.0;
|
||||
|
||||
|
||||
if (z != 1.0)
|
||||
glRotatef (90.0, x, y, z);
|
||||
|
||||
|
||||
glRotatef (g[i].direction * g[i].angle, 0.0, 0.0, 1.0);
|
||||
glCallList (g[i].id);
|
||||
glPopMatrix ();
|
||||
}
|
||||
|
||||
|
||||
for (i = 0; i < number_of_axles; i++)
|
||||
{
|
||||
x = 0.0;
|
||||
@@ -862,11 +865,11 @@ draw (void)
|
||||
|
||||
if (z != 1.0)
|
||||
glRotatef (90.0, x, y, z);
|
||||
|
||||
|
||||
glCallList (a[i].id);
|
||||
glPopMatrix ();
|
||||
}
|
||||
|
||||
|
||||
for (i = 0; i < number_of_belts; i++)
|
||||
{
|
||||
x = 0.0;
|
||||
@@ -881,23 +884,35 @@ draw (void)
|
||||
x = 1.0;
|
||||
else
|
||||
z = 1.0;
|
||||
|
||||
|
||||
if (z != 1.0)
|
||||
glRotatef (90.0, x, y, z);
|
||||
|
||||
|
||||
glCallList (b[i].id);
|
||||
glPopMatrix ();
|
||||
}
|
||||
|
||||
|
||||
glPopMatrix ();
|
||||
glutSwapBuffers ();
|
||||
|
||||
{
|
||||
GLint t = glutGet(GLUT_ELAPSED_TIME);
|
||||
Frames++;
|
||||
if (t - T0 >= 5000) {
|
||||
GLfloat seconds = (t - T0) / 1000.0;
|
||||
GLfloat fps = Frames / seconds;
|
||||
printf("%d frames in %g seconds = %g FPS\n", Frames, seconds, fps);
|
||||
T0 = t;
|
||||
Frames = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
static void
|
||||
idle (void)
|
||||
static void
|
||||
idle (void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < number_of_gears; i++)
|
||||
@@ -908,9 +923,9 @@ idle (void)
|
||||
|
||||
|
||||
|
||||
/* change view angle, exit upon ESC */
|
||||
static void
|
||||
key (unsigned char k, int x, int y)
|
||||
/* change view angle, exit upon ESC */
|
||||
static void
|
||||
key (unsigned char k, int x, int y)
|
||||
{
|
||||
switch (k)
|
||||
{
|
||||
@@ -940,9 +955,9 @@ key (unsigned char k, int x, int y)
|
||||
|
||||
|
||||
|
||||
/* new window size or exposure */
|
||||
static void
|
||||
reshape (int width, int height)
|
||||
/* new window size or exposure */
|
||||
static void
|
||||
reshape (int width, int height)
|
||||
{
|
||||
glViewport (0, 0, (GLint) width, (GLint) height);
|
||||
glMatrixMode (GL_PROJECTION);
|
||||
@@ -957,7 +972,7 @@ reshape (int width, int height)
|
||||
GLfloat h = (GLfloat) height / (GLfloat) width;
|
||||
glFrustum (-1.0, 1.0, -h, h, 5.0, 60.0);
|
||||
}
|
||||
|
||||
|
||||
glMatrixMode (GL_MODELVIEW);
|
||||
glLoadIdentity ();
|
||||
glTranslatef (0.0, 0.0, -40.0);
|
||||
@@ -966,8 +981,8 @@ reshape (int width, int height)
|
||||
|
||||
|
||||
|
||||
static void
|
||||
init (void)
|
||||
static void
|
||||
init (void)
|
||||
{
|
||||
GLfloat matShine = 20.00F;
|
||||
GLfloat light0Pos[4] =
|
||||
@@ -975,19 +990,19 @@ init (void)
|
||||
0.70F, 0.70F, 1.25F, 0.50F
|
||||
};
|
||||
int i;
|
||||
|
||||
|
||||
glClearColor (background[0], background[1], background[2], 1.0F);
|
||||
glClearIndex ((GLfloat) 0.0);
|
||||
|
||||
|
||||
glMaterialf (GL_FRONT_AND_BACK, GL_SHININESS, matShine);
|
||||
glLightfv (GL_LIGHT0, GL_POSITION, light0Pos);
|
||||
glEnable (GL_LIGHT0);
|
||||
|
||||
|
||||
glEnable (GL_LIGHTING);
|
||||
glEnable (GL_DEPTH_TEST);
|
||||
for (i = 0; i < number_of_gears; i++)
|
||||
g[i].angle = 0.0;
|
||||
|
||||
|
||||
for (i = 0; i < number_of_gears; i++)
|
||||
{
|
||||
g[i].id = glGenLists (1);
|
||||
@@ -997,7 +1012,7 @@ init (void)
|
||||
gear (i, g[i].type, g[i].radius, g[i].width, g[i].teeth, g[i].tooth_depth);
|
||||
glEndList ();
|
||||
}
|
||||
|
||||
|
||||
for (i = 0; i < number_of_axles; i++)
|
||||
{
|
||||
a[i].id = glGenLists (1);
|
||||
@@ -1007,7 +1022,7 @@ init (void)
|
||||
axle (i, a[i].radius, a[i].length);
|
||||
glEndList ();
|
||||
}
|
||||
|
||||
|
||||
for (i = 0; i < number_of_belts; i++)
|
||||
{
|
||||
b[i].id = glGenLists (1);
|
||||
@@ -1015,14 +1030,14 @@ init (void)
|
||||
belt (g[gear_find (b[i].gear1_name)], g[gear_find (b[i].gear2_name)]);
|
||||
glEndList ();
|
||||
}
|
||||
|
||||
|
||||
glEnable (GL_COLOR_MATERIAL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
char *file;
|
||||
|
||||
@@ -1034,14 +1049,14 @@ main (int argc, char *argv[])
|
||||
glutInitWindowPosition (0, 0);
|
||||
glutInitWindowSize(640,480);
|
||||
glutInitDisplayMode (GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE );
|
||||
|
||||
|
||||
if (glutCreateWindow ("Gear Train Simulation") == GL_FALSE)
|
||||
exit (1);
|
||||
|
||||
getdata (file);
|
||||
process ();
|
||||
init ();
|
||||
|
||||
|
||||
glutDisplayFunc (draw);
|
||||
glutReshapeFunc (reshape);
|
||||
glutKeyboardFunc (key);
|
||||
@@ -1049,4 +1064,3 @@ main (int argc, char *argv[])
|
||||
glutMainLoop ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: gloss.c,v 1.4 2000/06/27 17:04:43 brianp Exp $ */
|
||||
/* $Id: gloss.c,v 1.6 2000/12/24 22:53:54 pesco Exp $ */
|
||||
|
||||
/*
|
||||
* Specular reflection demo. The specular highlight is modulated by
|
||||
@@ -24,7 +24,7 @@
|
||||
#include <math.h>
|
||||
#include <GL/glut.h>
|
||||
|
||||
#include "../util/readtex.c" /* I know, this is a hack. */
|
||||
#include "readtex.c" /* I know, this is a hack. */
|
||||
|
||||
#define SPECULAR_TEXTURE_FILE "../images/reflect.rgb"
|
||||
#define BASE_TEXTURE_FILE "../images/tile.rgb"
|
||||
@@ -46,7 +46,7 @@ static GLfloat DXrot = 1.0, DYrot = 2.5;
|
||||
static GLfloat Black[4] = { 0, 0, 0, 0 };
|
||||
static GLfloat White[4] = { 1, 1, 1, 1 };
|
||||
static GLfloat Diffuse[4] = { .3, .3, 1.0, 1.0 }; /* blue */
|
||||
static GLfloat Shininess = 15;
|
||||
static GLfloat Shininess = 6;
|
||||
|
||||
static GLuint BaseTexture, SpecularTexture;
|
||||
static GLboolean DoSpecTexture = GL_TRUE;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
#include <GL/glut.h>
|
||||
|
||||
#include "../util/readtex.c"
|
||||
#include "readtex.c"
|
||||
|
||||
#ifdef XMESA
|
||||
#include "GL/xmesa.h"
|
||||
@@ -28,6 +28,9 @@ static int fullscreen = 1;
|
||||
static int WIDTH = 640;
|
||||
static int HEIGHT = 480;
|
||||
|
||||
static GLint T0;
|
||||
static GLint Frames;
|
||||
|
||||
#define MAX_LOD 9
|
||||
|
||||
#define TEX_SKY_WIDTH 256
|
||||
@@ -195,21 +198,6 @@ inittextures(void)
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
}
|
||||
|
||||
static float
|
||||
gettime(void)
|
||||
{
|
||||
static clock_t told = 0;
|
||||
clock_t tnew, ris;
|
||||
|
||||
tnew = clock();
|
||||
|
||||
ris = tnew - told;
|
||||
|
||||
told = tnew;
|
||||
|
||||
return (ris / (float) CLOCKS_PER_SEC);
|
||||
}
|
||||
|
||||
static void
|
||||
calcposobs(void)
|
||||
{
|
||||
@@ -217,6 +205,13 @@ calcposobs(void)
|
||||
dir[1] = cos(alpha * M_PI / 180.0) * sin(beta * M_PI / 180.0);
|
||||
dir[2] = cos(beta * M_PI / 180.0);
|
||||
|
||||
if (dir[0] < 1.0e-5 && dir[0] > -1.0e-5)
|
||||
dir[0] = 0;
|
||||
if (dir[1] < 1.0e-5 && dir[1] > -1.0e-5)
|
||||
dir[1] = 0;
|
||||
if (dir[2] < 1.0e-5 && dir[2] > -1.0e-5)
|
||||
dir[2] = 0;
|
||||
|
||||
obs[0] += v * dir[0];
|
||||
obs[1] += v * dir[1];
|
||||
obs[2] += v * dir[2];
|
||||
@@ -544,11 +539,10 @@ drawipers(int depth, int from)
|
||||
static void
|
||||
draw(void)
|
||||
{
|
||||
static int count = 0;
|
||||
static char frbuf[80];
|
||||
static char frbuf[80] = "";
|
||||
static GLfloat alpha = 0.0f;
|
||||
static GLfloat beta = 0.0f;
|
||||
float fr;
|
||||
static float fr = 0.0;
|
||||
|
||||
dojoy();
|
||||
|
||||
@@ -610,10 +604,9 @@ draw(void)
|
||||
|
||||
/* Help Screen */
|
||||
|
||||
fr = gettime();
|
||||
sprintf(frbuf,
|
||||
"Frame rate: %0.2f LOD: %d Tot. poly.: %d Poly/sec: %.1f",
|
||||
1.0 / fr, LODbias, totpoly, totpoly / fr);
|
||||
fr, LODbias, totpoly, totpoly * fr);
|
||||
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
glDisable(GL_FOG);
|
||||
@@ -644,7 +637,16 @@ draw(void)
|
||||
|
||||
glutSwapBuffers();
|
||||
|
||||
count++;
|
||||
Frames++;
|
||||
{
|
||||
GLint t = glutGet(GLUT_ELAPSED_TIME);
|
||||
if (t - T0 >= 2000) {
|
||||
GLfloat seconds = (t - T0) / 1000.0;
|
||||
fr = Frames / seconds;
|
||||
T0 = t;
|
||||
Frames = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* $Id: isosurf.c,v 1.6 2000/06/27 17:04:43 brianp Exp $ */
|
||||
/* $Id: isosurf.c,v 1.12 2001/06/04 15:34:31 keithw Exp $ */
|
||||
|
||||
/*
|
||||
* Display an isosurface of 3-D wind speed volume.
|
||||
* Display an isosurface of 3-D wind speed volume.
|
||||
*
|
||||
* Command line options:
|
||||
* -info print GL implementation information
|
||||
@@ -33,66 +33,68 @@
|
||||
#define GL_GLEXT_LEGACY
|
||||
#include "GL/glut.h"
|
||||
|
||||
#include "../util/readtex.c" /* I know, this is a hack. KW: me too. */
|
||||
#include "readtex.c" /* I know, this is a hack. KW: me too. */
|
||||
#define TEXTURE_FILE "../images/reflect.rgb"
|
||||
|
||||
#define LIT 0x1
|
||||
#define UNLIT 0x2
|
||||
#define TEXTURE 0x4
|
||||
#define NO_TEXTURE 0x8
|
||||
#define REFLECT 0x10
|
||||
#define NO_REFLECT 0x20
|
||||
#define POINT_FILTER 0x40
|
||||
#define LINEAR_FILTER 0x80
|
||||
#define GLVERTEX 0x100
|
||||
#define DRAW_ARRAYS 0x200 /* or draw_elts, if compiled */
|
||||
#define ARRAY_ELT 0x400
|
||||
#define COMPILED 0x800
|
||||
#define IMMEDIATE 0x1000
|
||||
#define SHADE_SMOOTH 0x2000
|
||||
#define SHADE_FLAT 0x4000
|
||||
#define TRIANGLES 0x8000
|
||||
#define STRIPS 0x10000
|
||||
#define USER_CLIP 0x20000
|
||||
#define NO_USER_CLIP 0x40000
|
||||
#define MATERIALS 0x80000
|
||||
#define NO_MATERIALS 0x100000
|
||||
#define FOG 0x200000
|
||||
#define NO_FOG 0x400000
|
||||
#define QUIT 0x800000
|
||||
#define DISPLAYLIST 0x1000000
|
||||
#define GLINFO 0x2000000
|
||||
#define STIPPLE 0x4000000
|
||||
#define NO_STIPPLE 0x8000000
|
||||
#define LIT 0x1
|
||||
#define UNLIT 0x2
|
||||
#define REFLECT 0x10
|
||||
#define POINT_FILTER 0x40
|
||||
#define LINEAR_FILTER 0x80
|
||||
#define GLVERTEX 0x100
|
||||
#define DRAW_ELTS 0x4
|
||||
#define DRAW_ARRAYS 0x200
|
||||
#define ARRAY_ELT 0x400
|
||||
#define LOCKED 0x800
|
||||
#define UNLOCKED 0x8
|
||||
#define IMMEDIATE 0x1000
|
||||
#define DISPLAYLIST 0x2000000
|
||||
#define SHADE_SMOOTH 0x2000
|
||||
#define SHADE_FLAT 0x4000
|
||||
#define TRIANGLES 0x8000
|
||||
#define STRIPS 0x10000
|
||||
#define POINTS 0x20000
|
||||
#define USER_CLIP 0x40000
|
||||
#define NO_USER_CLIP 0x80000
|
||||
#define MATERIALS 0x100000
|
||||
#define NO_MATERIALS 0x200000
|
||||
#define FOG 0x400000
|
||||
#define NO_FOG 0x800000
|
||||
#define QUIT 0x1000000
|
||||
#define GLINFO 0x4000000
|
||||
#define STIPPLE 0x8000000
|
||||
#define NO_STIPPLE 0x20
|
||||
|
||||
#define LIGHT_MASK (LIT|UNLIT)
|
||||
#define TEXTURE_MASK (TEXTURE|NO_TEXTURE)
|
||||
#define REFLECT_MASK (REFLECT|NO_REFLECT)
|
||||
#define FILTER_MASK (POINT_FILTER|LINEAR_FILTER)
|
||||
#define RENDER_STYLE_MASK (GLVERTEX|DRAW_ARRAYS|ARRAY_ELT)
|
||||
#define COMPILED_MASK (COMPILED|IMMEDIATE|DISPLAYLIST)
|
||||
#define MATERIAL_MASK (MATERIALS|NO_MATERIALS)
|
||||
#define PRIMITIVE_MASK (TRIANGLES|STRIPS)
|
||||
#define CLIP_MASK (USER_CLIP|NO_USER_CLIP)
|
||||
#define SHADE_MASK (SHADE_SMOOTH|SHADE_FLAT)
|
||||
#define FOG_MASK (FOG|NO_FOG)
|
||||
#define STIPPLE_MASK (STIPPLE|NO_STIPPLE)
|
||||
#define LIGHT_MASK (LIT|UNLIT|REFLECT)
|
||||
#define FILTER_MASK (POINT_FILTER|LINEAR_FILTER)
|
||||
#define RENDER_STYLE_MASK (GLVERTEX|DRAW_ARRAYS|DRAW_ELTS|ARRAY_ELT)
|
||||
#define DLIST_MASK (IMMEDIATE|DISPLAYLIST)
|
||||
#define LOCK_MASK (LOCKED|UNLOCKED)
|
||||
#define MATERIAL_MASK (MATERIALS|NO_MATERIALS)
|
||||
#define PRIMITIVE_MASK (TRIANGLES|STRIPS|POINTS)
|
||||
#define CLIP_MASK (USER_CLIP|NO_USER_CLIP)
|
||||
#define SHADE_MASK (SHADE_SMOOTH|SHADE_FLAT)
|
||||
#define FOG_MASK (FOG|NO_FOG)
|
||||
#define STIPPLE_MASK (STIPPLE|NO_STIPPLE)
|
||||
|
||||
#define MAXVERTS 10000
|
||||
static GLuint maxverts = MAXVERTS;
|
||||
static float data[MAXVERTS][6];
|
||||
static float compressed_data[MAXVERTS][6];
|
||||
static float expanded_data[MAXVERTS*3][6];
|
||||
static GLuint indices[MAXVERTS];
|
||||
static GLuint tri_indices[MAXVERTS*3];
|
||||
static GLuint strip_indices[MAXVERTS];
|
||||
static GLfloat col[100][4];
|
||||
static GLint numverts, num_tri_verts, numuniq;
|
||||
|
||||
static GLfloat xrot;
|
||||
static GLfloat yrot;
|
||||
static GLfloat dist = -6;
|
||||
static GLfloat dist;
|
||||
static GLint state, allowed = ~0;
|
||||
static GLboolean doubleBuffer = GL_TRUE;
|
||||
static GLdouble plane[4] = {1.0, 0.0, -1.0, 0.0};
|
||||
static GLuint surf1;
|
||||
static GLdouble plane[4];
|
||||
static GLuint surf1, dlist_state;
|
||||
|
||||
static GLboolean PrintInfo = GL_FALSE;
|
||||
|
||||
@@ -110,9 +112,6 @@ static GLubyte halftone[] = {
|
||||
0x55, 0x55, 0x55, 0x55, 0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55,
|
||||
0xAA, 0xAA, 0xAA, 0xAA, 0x55, 0x55, 0x55, 0x55};
|
||||
|
||||
/* forward decl */
|
||||
int BuildList( int mode );
|
||||
|
||||
|
||||
static void read_surface( char *filename )
|
||||
{
|
||||
@@ -125,7 +124,7 @@ static void read_surface( char *filename )
|
||||
}
|
||||
|
||||
numverts = 0;
|
||||
while (!feof(f) && numverts<MAXVERTS) {
|
||||
while (!feof(f) && numverts<maxverts) {
|
||||
fscanf( f, "%f %f %f %f %f %f",
|
||||
&data[numverts][0], &data[numverts][1], &data[numverts][2],
|
||||
&data[numverts][3], &data[numverts][4], &data[numverts][5] );
|
||||
@@ -139,6 +138,31 @@ static void read_surface( char *filename )
|
||||
|
||||
|
||||
|
||||
static void print_flags( const char *msg, GLuint flags )
|
||||
{
|
||||
fprintf(stderr,
|
||||
"%s (0x%x): %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
|
||||
msg, flags,
|
||||
(flags & GLVERTEX) ? "glVertex, " : "",
|
||||
(flags & DRAW_ARRAYS) ? "glDrawArrays, " : "",
|
||||
(flags & DRAW_ELTS) ? "glDrawElements, " : "",
|
||||
(flags & ARRAY_ELT) ? "glArrayElement, " : "",
|
||||
(flags & LOCKED) ? "locked arrays, " : "",
|
||||
(flags & TRIANGLES) ? "GL_TRIANGLES, " : "",
|
||||
(flags & STRIPS) ? "GL_TRIANGLE_STRIP, " : "",
|
||||
(flags & POINTS) ? "GL_POINTS, " : "",
|
||||
(flags & DISPLAYLIST) ? "as a displaylist, " : "",
|
||||
(flags & LIT) ? "lit, " : "",
|
||||
(flags & UNLIT) ? "unlit, " : "",
|
||||
(flags & REFLECT) ? "reflect, " : "",
|
||||
(flags & SHADE_FLAT) ? "flat-shaded, " : "",
|
||||
(flags & USER_CLIP) ? "user_clip, " : "",
|
||||
(flags & MATERIALS) ? "materials, " : "",
|
||||
(flags & FOG) ? "fog, " : "",
|
||||
(flags & STIPPLE) ? "stipple, " : "");
|
||||
}
|
||||
|
||||
|
||||
|
||||
struct data_idx {
|
||||
float *data;
|
||||
@@ -180,7 +204,7 @@ int (*(compare[7]))( const void *a, const void *b ) =
|
||||
|
||||
#define VEC_ELT(f, s, i) (float *)(((char *)f) + s * i)
|
||||
|
||||
static int sort_axis( int axis,
|
||||
static int sort_axis( int axis,
|
||||
int vec_size,
|
||||
int vec_stride,
|
||||
struct data_idx *indices,
|
||||
@@ -192,27 +216,27 @@ static int sort_axis( int axis,
|
||||
{
|
||||
int i;
|
||||
|
||||
if (finish-start > 2)
|
||||
if (finish-start > 2)
|
||||
{
|
||||
qsort( indices+start, finish-start, sizeof(*indices), compare[axis] );
|
||||
}
|
||||
else if (indices[start].data[axis] > indices[start+1].data[axis])
|
||||
}
|
||||
else if (indices[start].data[axis] > indices[start+1].data[axis])
|
||||
{
|
||||
struct data_idx tmp = indices[start];
|
||||
indices[start] = indices[start+1];
|
||||
indices[start+1] = tmp;
|
||||
}
|
||||
|
||||
|
||||
if (axis == vec_size-1) {
|
||||
for (i = start ; i < finish ; ) {
|
||||
float max = indices[i].data[axis] + fudge;
|
||||
float *dest = VEC_ELT(out, vec_stride, uniq);
|
||||
int j;
|
||||
|
||||
|
||||
for (j = 0 ; j < vec_size ; j++)
|
||||
dest[j] = indices[i].data[j];
|
||||
|
||||
for ( ; i < finish && max >= indices[i].data[axis]; i++)
|
||||
for ( ; i < finish && max >= indices[i].data[axis]; i++)
|
||||
indices[i].uniq_idx = uniq;
|
||||
|
||||
uniq++;
|
||||
@@ -227,7 +251,7 @@ static int sort_axis( int axis,
|
||||
int k;
|
||||
|
||||
indices[i].uniq_idx = uniq;
|
||||
|
||||
|
||||
for (k = 0 ; k < vec_size ; k++)
|
||||
dest[k] = indices[i].data[k];
|
||||
|
||||
@@ -244,7 +268,7 @@ static int sort_axis( int axis,
|
||||
}
|
||||
|
||||
|
||||
static void extract_indices1( const struct data_idx *in, unsigned int *out,
|
||||
static void extract_indices1( const struct data_idx *in, unsigned int *out,
|
||||
int n )
|
||||
{
|
||||
int i;
|
||||
@@ -266,13 +290,13 @@ static void compactify_arrays(void)
|
||||
ind[i].data = data[i];
|
||||
}
|
||||
|
||||
numuniq = sort_axis(0,
|
||||
sizeof(compressed_data[0])/sizeof(float),
|
||||
numuniq = sort_axis(0,
|
||||
sizeof(compressed_data[0])/sizeof(float),
|
||||
sizeof(compressed_data[0]),
|
||||
ind,
|
||||
0,
|
||||
numverts,
|
||||
(float *)compressed_data,
|
||||
ind,
|
||||
0,
|
||||
numverts,
|
||||
(float *)compressed_data,
|
||||
0,
|
||||
1e-6);
|
||||
|
||||
@@ -282,6 +306,20 @@ static void compactify_arrays(void)
|
||||
free( ind );
|
||||
}
|
||||
|
||||
static void expand_arrays(void)
|
||||
{
|
||||
int i;
|
||||
int parity = 0;
|
||||
for (i = 2 ; i < numverts ; i++, parity ^= 1) {
|
||||
int v0 = i-2+parity;
|
||||
int v1 = i-1-parity;
|
||||
int v2 = i;
|
||||
memcpy( expanded_data[(i-2)*3+0], data[v0], sizeof(data[0]) );
|
||||
memcpy( expanded_data[(i-2)*3+1], data[v1], sizeof(data[0]) );
|
||||
memcpy( expanded_data[(i-2)*3+2], data[v2], sizeof(data[0]) );
|
||||
}
|
||||
}
|
||||
|
||||
static float myrand( float max )
|
||||
{
|
||||
return max*rand()/(RAND_MAX+1.0);
|
||||
@@ -297,7 +335,7 @@ static void make_tri_indices( void )
|
||||
for (j=2;j<numverts;j++,parity^=1) {
|
||||
if (parity) {
|
||||
*v++ = indices[j-1];
|
||||
*v++ = indices[j-2];
|
||||
*v++ = indices[j-2];
|
||||
*v++ = indices[j];
|
||||
} else {
|
||||
*v++ = indices[j-2];
|
||||
@@ -305,7 +343,7 @@ static void make_tri_indices( void )
|
||||
*v++ = indices[j];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
num_tri_verts = v - tri_indices;
|
||||
printf("num_tri_verts: %d\n", num_tri_verts);
|
||||
|
||||
@@ -315,6 +353,9 @@ static void make_tri_indices( void )
|
||||
col[j][1] = myrand(1);
|
||||
col[j][0] = myrand(1);
|
||||
}
|
||||
|
||||
for (i = 0; i < numverts ; i++)
|
||||
strip_indices[i] = i;
|
||||
}
|
||||
|
||||
#define MIN(x,y) (x < y) ? x : y
|
||||
@@ -322,24 +363,33 @@ static void make_tri_indices( void )
|
||||
static void draw_surface( int with_state )
|
||||
{
|
||||
GLuint i, j;
|
||||
|
||||
if (with_state & DISPLAYLIST) {
|
||||
if ((with_state & (RENDER_STYLE_MASK|PRIMITIVE_MASK|MATERIAL_MASK)) !=
|
||||
dlist_state) {
|
||||
/*
|
||||
*/
|
||||
fprintf(stderr, "rebuilding displaylist\n");
|
||||
|
||||
switch (with_state & (COMPILED_MASK|RENDER_STYLE_MASK|PRIMITIVE_MASK)) {
|
||||
if (dlist_state)
|
||||
glDeleteLists( surf1, 1 );
|
||||
|
||||
dlist_state = with_state & (RENDER_STYLE_MASK|PRIMITIVE_MASK|
|
||||
MATERIAL_MASK);
|
||||
surf1 = glGenLists(1);
|
||||
glNewList(surf1, GL_COMPILE);
|
||||
draw_surface( dlist_state );
|
||||
glEndList();
|
||||
}
|
||||
|
||||
glCallList( surf1 );
|
||||
return;
|
||||
}
|
||||
|
||||
switch (with_state & (RENDER_STYLE_MASK|PRIMITIVE_MASK)) {
|
||||
#ifdef GL_EXT_vertex_array
|
||||
|
||||
case (COMPILED|DRAW_ARRAYS|STRIPS):
|
||||
glDrawElements( GL_TRIANGLE_STRIP, numverts, GL_UNSIGNED_INT, indices );
|
||||
break;
|
||||
|
||||
|
||||
case (COMPILED|ARRAY_ELT|STRIPS):
|
||||
glBegin( GL_TRIANGLE_STRIP );
|
||||
for (i = 0 ; i < numverts ; i++)
|
||||
glArrayElement( indices[i] );
|
||||
glEnd();
|
||||
break;
|
||||
|
||||
case (COMPILED|DRAW_ARRAYS|TRIANGLES):
|
||||
case (IMMEDIATE|DRAW_ARRAYS|TRIANGLES):
|
||||
case (DRAW_ELTS|TRIANGLES):
|
||||
if (with_state & MATERIALS) {
|
||||
for (j = i = 0 ; i < num_tri_verts ; i += 600, j++) {
|
||||
GLuint nr = MIN(num_tri_verts-i, 600);
|
||||
@@ -348,29 +398,16 @@ static void draw_surface( int with_state )
|
||||
glDrawElements( GL_TRIANGLES, nr, GL_UNSIGNED_INT, tri_indices+i );
|
||||
}
|
||||
} else {
|
||||
glDrawElements( GL_TRIANGLES, num_tri_verts, GL_UNSIGNED_INT,
|
||||
glDrawElements( GL_TRIANGLES, num_tri_verts, GL_UNSIGNED_INT,
|
||||
tri_indices );
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
/* Uses the original arrays (including duplicate elements):
|
||||
*/
|
||||
case (IMMEDIATE|DRAW_ARRAYS|STRIPS):
|
||||
glDrawArraysEXT( GL_TRIANGLE_STRIP, 0, numverts );
|
||||
case (DRAW_ARRAYS|TRIANGLES):
|
||||
glDrawArraysEXT( GL_TRIANGLES, 0, (numverts-2)*3 );
|
||||
break;
|
||||
|
||||
/* Uses the original arrays (including duplicate elements):
|
||||
*/
|
||||
case (IMMEDIATE|ARRAY_ELT|STRIPS):
|
||||
glBegin( GL_TRIANGLE_STRIP );
|
||||
for (i = 0 ; i < numverts ; i++)
|
||||
glArrayElement( i );
|
||||
glEnd();
|
||||
break;
|
||||
|
||||
case (IMMEDIATE|ARRAY_ELT|TRIANGLES):
|
||||
case (COMPILED|ARRAY_ELT|TRIANGLES):
|
||||
case (ARRAY_ELT|TRIANGLES):
|
||||
if (with_state & MATERIALS) {
|
||||
for (j = i = 0 ; i < num_tri_verts ; i += 600, j++) {
|
||||
GLuint nr = MIN(num_tri_verts-i, 600);
|
||||
@@ -386,12 +423,51 @@ static void draw_surface( int with_state )
|
||||
glBegin( GL_TRIANGLES );
|
||||
for (i = 0 ; i < num_tri_verts ; i++)
|
||||
glArrayElement( tri_indices[i] );
|
||||
|
||||
|
||||
glEnd();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case (IMMEDIATE|GLVERTEX|TRIANGLES):
|
||||
|
||||
/* Uses the original arrays (including duplicate elements):
|
||||
*/
|
||||
case (DRAW_ARRAYS|STRIPS):
|
||||
glDrawArraysEXT( GL_TRIANGLE_STRIP, 0, numverts );
|
||||
break;
|
||||
case (DRAW_ELTS|STRIPS):
|
||||
glDrawElements( GL_TRIANGLE_STRIP, numverts,
|
||||
GL_UNSIGNED_INT, strip_indices );
|
||||
break;
|
||||
|
||||
/* Uses the original arrays (including duplicate elements):
|
||||
*/
|
||||
case (ARRAY_ELT|STRIPS):
|
||||
glBegin( GL_TRIANGLE_STRIP );
|
||||
for (i = 0 ; i < numverts ; i++)
|
||||
glArrayElement( i );
|
||||
glEnd();
|
||||
break;
|
||||
|
||||
case (DRAW_ARRAYS|POINTS):
|
||||
glDrawArraysEXT( GL_POINTS, 0, numuniq );
|
||||
break;
|
||||
case (DRAW_ELTS|POINTS):
|
||||
/* can use numuniq with strip_indices as strip_indices[i] == i.
|
||||
*/
|
||||
glDrawElements( GL_POINTS, numuniq,
|
||||
GL_UNSIGNED_INT, strip_indices );
|
||||
break;
|
||||
case (ARRAY_ELT|POINTS):
|
||||
/* just emit each unique element once:
|
||||
*/
|
||||
glBegin( GL_POINTS );
|
||||
for (i = 0 ; i < numuniq ; i++)
|
||||
glArrayElement( i );
|
||||
glEnd();
|
||||
break;
|
||||
#endif
|
||||
|
||||
case (GLVERTEX|TRIANGLES):
|
||||
if (with_state & MATERIALS) {
|
||||
for (j = i = 0 ; i < num_tri_verts ; i += 600, j++) {
|
||||
GLuint nr = MIN(num_tri_verts-i, 600);
|
||||
@@ -412,27 +488,35 @@ static void draw_surface( int with_state )
|
||||
glVertex3fv( &compressed_data[tri_indices[i]][0] );
|
||||
}
|
||||
glEnd();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case (DISPLAYLIST|GLVERTEX|STRIPS):
|
||||
if (!surf1)
|
||||
surf1 = BuildList( GL_COMPILE_AND_EXECUTE );
|
||||
else
|
||||
glCallList(surf1);
|
||||
break;
|
||||
|
||||
#endif
|
||||
|
||||
/* Uses the original arrays (including duplicate elements):
|
||||
case (GLVERTEX|POINTS):
|
||||
/* Renders all points, but not in strip order... Shouldn't be a
|
||||
* problem, but people may be confused as to why points are so
|
||||
* much faster in this demo... And why cva doesn't help them...
|
||||
*/
|
||||
default:
|
||||
glBegin( GL_POINTS );
|
||||
for ( i = 0 ; i < numuniq ; i++ ) {
|
||||
glNormal3fv( &compressed_data[i][3] );
|
||||
glVertex3fv( &compressed_data[i][0] );
|
||||
}
|
||||
glEnd();
|
||||
break;
|
||||
|
||||
case (GLVERTEX|STRIPS):
|
||||
glBegin( GL_TRIANGLE_STRIP );
|
||||
for (i=0;i<numverts;i++) {
|
||||
glNormal3fv( &data[i][3] );
|
||||
glVertex3fv( &data[i][0] );
|
||||
}
|
||||
glEnd();
|
||||
break;
|
||||
|
||||
default:
|
||||
fprintf(stderr, "unimplemented mode %x...\n",
|
||||
(with_state & (RENDER_STYLE_MASK|PRIMITIVE_MASK)));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -443,17 +527,9 @@ static void Display(void)
|
||||
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
|
||||
draw_surface( state );
|
||||
glFlush();
|
||||
if (doubleBuffer) glutSwapBuffers();
|
||||
if (doubleBuffer) glutSwapBuffers();
|
||||
}
|
||||
|
||||
int BuildList( int mode )
|
||||
{
|
||||
int rv = glGenLists(1);
|
||||
glNewList(rv, mode );
|
||||
draw_surface( IMMEDIATE|GLVERTEX|STRIPS );
|
||||
glEndList();
|
||||
return rv;
|
||||
}
|
||||
|
||||
/* KW: only do this when necessary, so CVA can re-use results.
|
||||
*/
|
||||
@@ -515,12 +591,12 @@ static void InitMaterials(void)
|
||||
glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse);
|
||||
glLightfv(GL_LIGHT0, GL_POSITION, position0);
|
||||
glEnable(GL_LIGHT0);
|
||||
|
||||
|
||||
glLightfv(GL_LIGHT1, GL_AMBIENT, ambient);
|
||||
glLightfv(GL_LIGHT1, GL_DIFFUSE, diffuse);
|
||||
glLightfv(GL_LIGHT1, GL_POSITION, position1);
|
||||
glEnable(GL_LIGHT1);
|
||||
|
||||
|
||||
glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient);
|
||||
glLightModelfv(GL_LIGHT_MODEL_TWO_SIDE, lmodel_twoside);
|
||||
|
||||
@@ -534,8 +610,7 @@ static void InitMaterials(void)
|
||||
|
||||
|
||||
#define UPDATE(o,n,mask) (o&=~mask, o|=n&mask)
|
||||
#define CHANGED(o,n,mask) ((n&mask) && \
|
||||
(n&mask) != (o&mask) ? UPDATE(o,n,mask) : 0)
|
||||
#define CHANGED(o,n,mask) ((n&mask) && (n&mask) != (o&mask) )
|
||||
|
||||
static void ModeMenu(int m)
|
||||
{
|
||||
@@ -543,7 +618,7 @@ static void ModeMenu(int m)
|
||||
|
||||
if (!m) return;
|
||||
|
||||
if (m==QUIT)
|
||||
if (m==QUIT)
|
||||
exit(0);
|
||||
|
||||
if (m==GLINFO) {
|
||||
@@ -554,6 +629,7 @@ static void ModeMenu(int m)
|
||||
}
|
||||
|
||||
if (CHANGED(state, m, FILTER_MASK)) {
|
||||
UPDATE(state, m, FILTER_MASK);
|
||||
if (m & LINEAR_FILTER) {
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
@@ -564,13 +640,29 @@ static void ModeMenu(int m)
|
||||
}
|
||||
|
||||
if (CHANGED(state, m, LIGHT_MASK)) {
|
||||
if (m & LIT)
|
||||
UPDATE(state, m, LIGHT_MASK);
|
||||
if (m & LIT) {
|
||||
glEnable(GL_LIGHTING);
|
||||
else
|
||||
glDisable(GL_TEXTURE_GEN_S);
|
||||
glDisable(GL_TEXTURE_GEN_T);
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
}
|
||||
else if (m & UNLIT) {
|
||||
glDisable(GL_LIGHTING);
|
||||
glDisable(GL_TEXTURE_GEN_S);
|
||||
glDisable(GL_TEXTURE_GEN_T);
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
}
|
||||
else if (m & REFLECT) {
|
||||
glDisable(GL_LIGHTING);
|
||||
glEnable(GL_TEXTURE_GEN_S);
|
||||
glEnable(GL_TEXTURE_GEN_T);
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
}
|
||||
}
|
||||
|
||||
if (CHANGED(state, m, SHADE_MASK)) {
|
||||
UPDATE(state, m, SHADE_MASK);
|
||||
if (m & SHADE_SMOOTH)
|
||||
glShadeModel(GL_SMOOTH);
|
||||
else
|
||||
@@ -578,24 +670,8 @@ static void ModeMenu(int m)
|
||||
}
|
||||
|
||||
|
||||
if (CHANGED(state, m, TEXTURE_MASK)) {
|
||||
if (m & TEXTURE)
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
else
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
}
|
||||
|
||||
if (CHANGED(state, m, REFLECT_MASK)) {
|
||||
if (m & REFLECT) {
|
||||
glEnable(GL_TEXTURE_GEN_S);
|
||||
glEnable(GL_TEXTURE_GEN_T);
|
||||
} else {
|
||||
glDisable(GL_TEXTURE_GEN_S);
|
||||
glDisable(GL_TEXTURE_GEN_T);
|
||||
}
|
||||
}
|
||||
|
||||
if (CHANGED(state, m, CLIP_MASK)) {
|
||||
UPDATE(state, m, CLIP_MASK);
|
||||
if (m & USER_CLIP) {
|
||||
glEnable(GL_CLIP_PLANE0);
|
||||
} else {
|
||||
@@ -604,66 +680,121 @@ static void ModeMenu(int m)
|
||||
}
|
||||
|
||||
if (CHANGED(state, m, FOG_MASK)) {
|
||||
if (m & FOG)
|
||||
UPDATE(state, m, FOG_MASK);
|
||||
if (m & FOG)
|
||||
{
|
||||
glEnable(GL_FOG);
|
||||
printf("FOG enable\n");
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
glDisable(GL_FOG);
|
||||
printf("FOG disable\n");
|
||||
}
|
||||
}
|
||||
|
||||
if (CHANGED(state, m, STIPPLE_MASK)) {
|
||||
if (m & STIPPLE)
|
||||
UPDATE(state, m, STIPPLE_MASK);
|
||||
if (m & STIPPLE)
|
||||
{
|
||||
glEnable(GL_POLYGON_STIPPLE);
|
||||
printf("STIPPLE enable\n");
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
glDisable(GL_POLYGON_STIPPLE);
|
||||
printf("STIPPLE disable\n");
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef GL_EXT_vertex_array
|
||||
if (CHANGED(state, m, (COMPILED_MASK|RENDER_STYLE_MASK|PRIMITIVE_MASK)))
|
||||
if (CHANGED(state, m, (LOCK_MASK|RENDER_STYLE_MASK|PRIMITIVE_MASK)))
|
||||
{
|
||||
if ((m & (COMPILED_MASK|PRIMITIVE_MASK)) == (IMMEDIATE|STRIPS))
|
||||
if (m & (PRIMITIVE_MASK)) {
|
||||
UPDATE(state, m, (PRIMITIVE_MASK));
|
||||
}
|
||||
|
||||
if (m & (RENDER_STYLE_MASK)) {
|
||||
UPDATE(state, m, (RENDER_STYLE_MASK));
|
||||
}
|
||||
|
||||
if (m & LOCK_MASK) {
|
||||
UPDATE(state, m, (LOCK_MASK));
|
||||
}
|
||||
|
||||
|
||||
print_flags("primitive", state & PRIMITIVE_MASK);
|
||||
print_flags("render style", state & RENDER_STYLE_MASK);
|
||||
|
||||
if ((state & PRIMITIVE_MASK) != STRIPS &&
|
||||
((state & RENDER_STYLE_MASK) == DRAW_ELTS ||
|
||||
(state & RENDER_STYLE_MASK) == ARRAY_ELT ||
|
||||
(state & PRIMITIVE_MASK) == POINTS))
|
||||
{
|
||||
fprintf(stderr, "enabling small arrays\n");
|
||||
/* Rendering any primitive with draw-element/array-element
|
||||
* --> Can't do strips here as ordering has been lost in
|
||||
* compaction process...
|
||||
*/
|
||||
glVertexPointerEXT( 3, GL_FLOAT, sizeof(data[0]), numuniq,
|
||||
compressed_data );
|
||||
glNormalPointerEXT( GL_FLOAT, sizeof(data[0]), numuniq,
|
||||
&compressed_data[0][3]);
|
||||
#ifdef GL_EXT_compiled_vertex_array
|
||||
if (allowed & LOCKED) {
|
||||
if (state & LOCKED) {
|
||||
glLockArraysEXT( 0, numuniq );
|
||||
} else {
|
||||
glUnlockArraysEXT();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else if ((state & PRIMITIVE_MASK) == TRIANGLES &&
|
||||
(state & RENDER_STYLE_MASK) == DRAW_ARRAYS) {
|
||||
fprintf(stderr, "enabling big arrays\n");
|
||||
/* Only get here for TRIANGLES and drawarrays
|
||||
*/
|
||||
glVertexPointerEXT( 3, GL_FLOAT, sizeof(data[0]), (numverts-2) * 3,
|
||||
expanded_data );
|
||||
glNormalPointerEXT( GL_FLOAT, sizeof(data[0]), (numverts-2) * 3,
|
||||
&expanded_data[0][3]);
|
||||
|
||||
#ifdef GL_EXT_compiled_vertex_array
|
||||
if (allowed & LOCKED) {
|
||||
if (state & LOCKED) {
|
||||
glLockArraysEXT( 0, (numverts-2)*3 );
|
||||
} else {
|
||||
glUnlockArraysEXT();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
fprintf(stderr, "enabling normal arrays\n");
|
||||
glVertexPointerEXT( 3, GL_FLOAT, sizeof(data[0]), numverts, data );
|
||||
glNormalPointerEXT( GL_FLOAT, sizeof(data[0]), numverts, &data[0][3]);
|
||||
}
|
||||
else
|
||||
{
|
||||
glVertexPointerEXT( 3, GL_FLOAT, sizeof(data[0]), numuniq,
|
||||
compressed_data );
|
||||
glNormalPointerEXT( GL_FLOAT, sizeof(data[0]), numuniq,
|
||||
&compressed_data[0][3]);
|
||||
}
|
||||
#ifdef GL_EXT_compiled_vertex_array
|
||||
if (allowed & COMPILED) {
|
||||
if (m & COMPILED) {
|
||||
glLockArraysEXT( 0, numuniq );
|
||||
} else {
|
||||
glUnlockArraysEXT();
|
||||
if (allowed & LOCKED) {
|
||||
if (state & LOCKED) {
|
||||
glLockArraysEXT( 0, numverts );
|
||||
} else {
|
||||
glUnlockArraysEXT();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
if (m & (RENDER_STYLE_MASK|PRIMITIVE_MASK)) {
|
||||
UPDATE(state, m, (RENDER_STYLE_MASK|PRIMITIVE_MASK));
|
||||
|
||||
if (m & DLIST_MASK) {
|
||||
UPDATE(state, m, DLIST_MASK);
|
||||
}
|
||||
|
||||
|
||||
if (m & MATERIAL_MASK) {
|
||||
UPDATE(state, m, MATERIAL_MASK);
|
||||
}
|
||||
|
||||
print_flags("new flags", state);
|
||||
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
@@ -673,20 +804,28 @@ static void Init(int argc, char *argv[])
|
||||
{
|
||||
GLfloat fogColor[4] = {0.5,1.0,0.5,1.0};
|
||||
|
||||
xrot = 0;
|
||||
yrot = 0;
|
||||
dist = -6;
|
||||
plane[0] = 1.0;
|
||||
plane[1] = 0.0;
|
||||
plane[2] = -1.0;
|
||||
plane[3] = 0.0;
|
||||
|
||||
glClearColor(0.0, 0.0, 1.0, 0.0);
|
||||
glEnable( GL_DEPTH_TEST );
|
||||
glEnable( GL_VERTEX_ARRAY_EXT );
|
||||
glEnable( GL_NORMAL_ARRAY_EXT );
|
||||
|
||||
InitMaterials();
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glFrustum( -1.0, 1.0, -1.0, 1.0, 5, 25 );
|
||||
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
glClipPlane(GL_CLIP_PLANE0, plane);
|
||||
glClipPlane(GL_CLIP_PLANE0, plane);
|
||||
|
||||
InitMaterials();
|
||||
|
||||
set_matrix();
|
||||
|
||||
@@ -696,10 +835,6 @@ static void Init(int argc, char *argv[])
|
||||
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
|
||||
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
|
||||
|
||||
if (!LoadRGBMipmaps(TEXTURE_FILE, GL_RGB)) {
|
||||
printf("Error: couldn't load texture image\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/* Green fog is easy to see */
|
||||
glFogi(GL_FOG_MODE,GL_EXP2);
|
||||
@@ -707,22 +842,31 @@ static void Init(int argc, char *argv[])
|
||||
glFogf(GL_FOG_DENSITY,0.15);
|
||||
glHint(GL_FOG_HINT,GL_DONT_CARE);
|
||||
|
||||
{
|
||||
static int firsttime = 1;
|
||||
if (firsttime) {
|
||||
firsttime = 0;
|
||||
compactify_arrays();
|
||||
expand_arrays();
|
||||
make_tri_indices();
|
||||
|
||||
compactify_arrays();
|
||||
make_tri_indices();
|
||||
|
||||
surf1 = BuildList( GL_COMPILE );
|
||||
if (!LoadRGBMipmaps(TEXTURE_FILE, GL_RGB)) {
|
||||
printf("Error: couldn't load texture image\n");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ModeMenu(SHADE_SMOOTH|
|
||||
LIT|
|
||||
NO_TEXTURE|
|
||||
NO_REFLECT|
|
||||
POINT_FILTER|
|
||||
IMMEDIATE|
|
||||
NO_USER_CLIP|
|
||||
NO_MATERIALS|
|
||||
NO_FOG|
|
||||
NO_STIPPLE|
|
||||
IMMEDIATE|
|
||||
STRIPS|
|
||||
UNLOCKED|
|
||||
GLVERTEX);
|
||||
|
||||
if (PrintInfo) {
|
||||
@@ -759,7 +903,7 @@ static void Key( unsigned char key, int x, int y )
|
||||
ModeMenu((state ^ STIPPLE_MASK) & STIPPLE_MASK);
|
||||
break;
|
||||
case 'l':
|
||||
ModeMenu((state ^ LIGHT_MASK) & LIGHT_MASK);
|
||||
ModeMenu((state ^ LIGHT_MASK) & (LIT|UNLIT));
|
||||
break;
|
||||
case 'm':
|
||||
ModeMenu((state ^ MATERIAL_MASK) & MATERIAL_MASK);
|
||||
@@ -768,11 +912,10 @@ static void Key( unsigned char key, int x, int y )
|
||||
ModeMenu((state ^ CLIP_MASK) & CLIP_MASK);
|
||||
break;
|
||||
case 'v':
|
||||
if (allowed&COMPILED)
|
||||
ModeMenu(COMPILED|DRAW_ARRAYS|TRIANGLES);
|
||||
ModeMenu((LOCKED|IMMEDIATE|DRAW_ELTS|TRIANGLES) & allowed);
|
||||
break;
|
||||
case 'V':
|
||||
ModeMenu(IMMEDIATE|GLVERTEX|STRIPS);
|
||||
ModeMenu(UNLOCKED|IMMEDIATE|GLVERTEX|STRIPS);
|
||||
break;
|
||||
case 'b':
|
||||
Benchmark(5.0, 0);
|
||||
@@ -808,7 +951,9 @@ static void Key( unsigned char key, int x, int y )
|
||||
set_matrix();
|
||||
glutPostRedisplay();
|
||||
break;
|
||||
|
||||
case ' ':
|
||||
Init(0,0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -854,6 +999,15 @@ static GLint Args(int argc, char **argv)
|
||||
else if (strcmp(argv[i], "-info") == 0) {
|
||||
PrintInfo = GL_TRUE;
|
||||
}
|
||||
else if (strcmp(argv[i], "-10") == 0) {
|
||||
maxverts = 10;
|
||||
}
|
||||
else if (strcmp(argv[i], "-100") == 0) {
|
||||
maxverts = 100;
|
||||
}
|
||||
else if (strcmp(argv[i], "-1000") == 0) {
|
||||
maxverts = 1000;
|
||||
}
|
||||
else {
|
||||
printf("%s (Bad option).\n", argv[i]);
|
||||
return QUIT;
|
||||
@@ -877,7 +1031,7 @@ int main(int argc, char **argv)
|
||||
|
||||
glutInitWindowPosition(0, 0);
|
||||
glutInitWindowSize(400, 400);
|
||||
|
||||
|
||||
type = GLUT_DEPTH;
|
||||
type |= GLUT_RGB;
|
||||
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
|
||||
@@ -890,70 +1044,59 @@ int main(int argc, char **argv)
|
||||
/* Make sure server supports the vertex array extension */
|
||||
extensions = (char *) glGetString( GL_EXTENSIONS );
|
||||
|
||||
if (!strstr( extensions, "GL_EXT_vertex_array" ))
|
||||
if (!strstr( extensions, "GL_EXT_vertex_array" ))
|
||||
{
|
||||
printf("Vertex arrays not supported by this renderer\n");
|
||||
allowed &= ~(COMPILED|DRAW_ARRAYS|ARRAY_ELT);
|
||||
allowed &= ~(LOCKED|DRAW_ARRAYS|DRAW_ELTS|ARRAY_ELT);
|
||||
}
|
||||
else if (!strstr( extensions, "GL_EXT_compiled_vertex_array" ))
|
||||
else if (!strstr( extensions, "GL_EXT_compiled_vertex_array" ))
|
||||
{
|
||||
printf("Compiled vertex arrays not supported by this renderer\n");
|
||||
allowed &= ~COMPILED;
|
||||
allowed &= ~LOCKED;
|
||||
}
|
||||
|
||||
Init(argc, argv);
|
||||
ModeMenu(arg_mode);
|
||||
|
||||
|
||||
glutCreateMenu(ModeMenu);
|
||||
glutAddMenuEntry("GL info", GLINFO);
|
||||
glutAddMenuEntry("", 0);
|
||||
glutAddMenuEntry("Lit", LIT|NO_TEXTURE|NO_REFLECT);
|
||||
glutAddMenuEntry("Unlit", UNLIT|NO_TEXTURE|NO_REFLECT);
|
||||
/* glutAddMenuEntry("Textured", TEXTURE); */
|
||||
glutAddMenuEntry("Reflect", TEXTURE|REFLECT);
|
||||
glutAddMenuEntry("", 0);
|
||||
glutAddMenuEntry("GL info", GLINFO);
|
||||
glutAddMenuEntry("", 0);
|
||||
glutAddMenuEntry("Lit", LIT);
|
||||
glutAddMenuEntry("Unlit", UNLIT);
|
||||
glutAddMenuEntry("Reflect", REFLECT);
|
||||
glutAddMenuEntry("", 0);
|
||||
glutAddMenuEntry("Smooth", SHADE_SMOOTH);
|
||||
glutAddMenuEntry("Flat", SHADE_FLAT);
|
||||
glutAddMenuEntry("", 0);
|
||||
glutAddMenuEntry("", 0);
|
||||
glutAddMenuEntry("Fog", FOG);
|
||||
glutAddMenuEntry("No Fog", NO_FOG);
|
||||
glutAddMenuEntry("", 0);
|
||||
glutAddMenuEntry("", 0);
|
||||
glutAddMenuEntry("Stipple", STIPPLE);
|
||||
glutAddMenuEntry("No Stipple", NO_STIPPLE);
|
||||
glutAddMenuEntry("", 0);
|
||||
glutAddMenuEntry("", 0);
|
||||
glutAddMenuEntry("Point Filtered", POINT_FILTER);
|
||||
glutAddMenuEntry("Linear Filtered", LINEAR_FILTER);
|
||||
glutAddMenuEntry("", 0);
|
||||
glutAddMenuEntry("glVertex (STRIPS)", IMMEDIATE|GLVERTEX|STRIPS);
|
||||
glutAddMenuEntry("glVertex (TRIANGLES)", IMMEDIATE|GLVERTEX|TRIANGLES);
|
||||
glutAddMenuEntry("", 0);
|
||||
glutAddMenuEntry("glVertex display list (STRIPS)",
|
||||
DISPLAYLIST|GLVERTEX|STRIPS);
|
||||
glutAddMenuEntry("", 0);
|
||||
glutAddMenuEntry("", 0);
|
||||
glutAddMenuEntry("GL_TRIANGLES", TRIANGLES);
|
||||
glutAddMenuEntry("GL_TRIANGLE_STRIPS", STRIPS);
|
||||
glutAddMenuEntry("GL_POINTS", POINTS);
|
||||
glutAddMenuEntry("", 0);
|
||||
glutAddMenuEntry("Displaylist", DISPLAYLIST);
|
||||
glutAddMenuEntry("Immediate", IMMEDIATE);
|
||||
glutAddMenuEntry("", 0);
|
||||
if (allowed & LOCKED) {
|
||||
glutAddMenuEntry("Locked Arrays (CVA)", LOCKED);
|
||||
glutAddMenuEntry("Unlocked Arrays", UNLOCKED);
|
||||
glutAddMenuEntry("", 0);
|
||||
}
|
||||
glutAddMenuEntry("glVertex", GLVERTEX);
|
||||
if (allowed & DRAW_ARRAYS) {
|
||||
glutAddMenuEntry("DrawArrays (STRIPS)",
|
||||
IMMEDIATE|DRAW_ARRAYS|STRIPS);
|
||||
glutAddMenuEntry("ArrayElement (STRIPS)",
|
||||
IMMEDIATE|ARRAY_ELT|STRIPS);
|
||||
glutAddMenuEntry("DrawElements (TRIANGLES)",
|
||||
IMMEDIATE|DRAW_ARRAYS|TRIANGLES);
|
||||
glutAddMenuEntry("ArrayElement (TRIANGLES)",
|
||||
IMMEDIATE|ARRAY_ELT|TRIANGLES);
|
||||
glutAddMenuEntry("", 0);
|
||||
|
||||
glutAddMenuEntry("glDrawElements", DRAW_ELTS);
|
||||
glutAddMenuEntry("glDrawArrays", DRAW_ARRAYS);
|
||||
glutAddMenuEntry("glArrayElement", ARRAY_ELT);
|
||||
}
|
||||
if (allowed & COMPILED) {
|
||||
glutAddMenuEntry("Compiled DrawElements (TRIANGLES)",
|
||||
COMPILED|DRAW_ARRAYS|TRIANGLES);
|
||||
glutAddMenuEntry("Compiled DrawElements (STRIPS)",
|
||||
COMPILED|DRAW_ARRAYS|STRIPS);
|
||||
glutAddMenuEntry("Compiled ArrayElement (TRIANGLES)",
|
||||
COMPILED|ARRAY_ELT|TRIANGLES);
|
||||
glutAddMenuEntry("Compiled ArrayElement (STRIPS)",
|
||||
COMPILED|ARRAY_ELT|STRIPS);
|
||||
glutAddMenuEntry("", 0);
|
||||
}
|
||||
glutAddMenuEntry("Quit", QUIT);
|
||||
glutAddMenuEntry("", 0);
|
||||
glutAddMenuEntry("Quit", QUIT);
|
||||
glutAttachMenu(GLUT_RIGHT_BUTTON);
|
||||
|
||||
glutReshapeFunc(Reshape);
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include <GL/glut.h>
|
||||
#include <GL/glext.h>
|
||||
|
||||
#include "../util/readtex.c" /* I know, this is a hack. */
|
||||
#include "readtex.c" /* I know, this is a hack. */
|
||||
|
||||
#define TEXTURE_FILE "../images/girl.rgb"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: multiarb.c,v 1.6 2000/05/23 23:21:00 brianp Exp $ */
|
||||
/* $Id: multiarb.c,v 1.10 2001/06/20 19:12:30 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* GL_ARB_multitexture demo
|
||||
@@ -12,6 +12,41 @@
|
||||
|
||||
/*
|
||||
* $Log: multiarb.c,v $
|
||||
* Revision 1.10 2001/06/20 19:12:30 brianp
|
||||
* also print GL_MAX_TEXTURE_SIZE
|
||||
*
|
||||
* Revision 1.9 2001/06/13 14:33:16 brianp
|
||||
* moved glTexEnvi calls to better logical locations
|
||||
*
|
||||
* Revision 1.8 2000/12/24 22:53:54 pesco
|
||||
* * demos/Makefile.am (INCLUDES): Added -I$(top_srcdir)/util.
|
||||
* * demos/Makefile.X11, demos/Makefile.BeOS-R4, demos/Makefile.cygnus:
|
||||
* Essentially the same.
|
||||
* Program files updated to include "readtex.c", not "../util/readtex.c".
|
||||
* * demos/reflect.c: Likewise for "showbuffer.c".
|
||||
*
|
||||
*
|
||||
* * Makefile.am (EXTRA_DIST): Added top-level regular files.
|
||||
*
|
||||
* * include/GL/Makefile.am (INC_X11): Added glxext.h.
|
||||
*
|
||||
*
|
||||
* * src/GGI/include/ggi/mesa/Makefile.am (EXTRA_HEADERS): Include
|
||||
* Mesa GGI headers in dist even if HAVE_GGI is not given.
|
||||
*
|
||||
* * configure.in: Look for GLUT and demo source dirs in $srcdir.
|
||||
*
|
||||
* * src/swrast/Makefile.am (libMesaSwrast_la_SOURCES): Set to *.[ch].
|
||||
* More source list updates in various Makefile.am's.
|
||||
*
|
||||
* * Makefile.am (dist-hook): Remove CVS directory from distribution.
|
||||
* (DIST_SUBDIRS): List all possible subdirs here.
|
||||
* (SUBDIRS): Only list subdirs selected for build again.
|
||||
* The above two applied to all subdir Makefile.am's also.
|
||||
*
|
||||
* Revision 1.7 2000/11/01 16:02:01 brianp
|
||||
* print number of texture units
|
||||
*
|
||||
* Revision 1.6 2000/05/23 23:21:00 brianp
|
||||
* set default window pos
|
||||
*
|
||||
@@ -48,7 +83,7 @@
|
||||
#include <string.h>
|
||||
#include <GL/glut.h>
|
||||
|
||||
#include "../util/readtex.c" /* I know, this is a hack. */
|
||||
#include "readtex.c" /* I know, this is a hack. */
|
||||
|
||||
#define TEXTURE_1_FILE "../images/girl.rgb"
|
||||
#define TEXTURE_2_FILE "../images/reflect.rgb"
|
||||
@@ -246,6 +281,7 @@ static void SpecialKey( int key, int x, int y )
|
||||
static void Init( int argc, char *argv[] )
|
||||
{
|
||||
GLuint texObj[2];
|
||||
GLint units, size;
|
||||
|
||||
const char *exten = (const char *) glGetString(GL_EXTENSIONS);
|
||||
if (!strstr(exten, "GL_ARB_multitexture")) {
|
||||
@@ -253,6 +289,14 @@ static void Init( int argc, char *argv[] )
|
||||
exit(1);
|
||||
}
|
||||
|
||||
glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &units);
|
||||
printf("%d texture units supported\n", units);
|
||||
|
||||
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &size);
|
||||
printf("%d x %d max texture size\n", size, size);
|
||||
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
|
||||
/* allocate two texture objects */
|
||||
glGenTextures(2, texObj);
|
||||
|
||||
@@ -266,11 +310,6 @@ static void Init( int argc, char *argv[] )
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
#endif
|
||||
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
|
||||
if (!LoadRGBMipmaps(TEXTURE_1_FILE, GL_RGB)) {
|
||||
printf("Error: couldn't load texture image\n");
|
||||
exit(1);
|
||||
@@ -287,9 +326,6 @@ static void Init( int argc, char *argv[] )
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
#endif
|
||||
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
|
||||
if (!LoadRGBMipmaps(TEXTURE_2_FILE, GL_RGB)) {
|
||||
printf("Error: couldn't load texture image\n");
|
||||
exit(1);
|
||||
@@ -300,8 +336,10 @@ static void Init( int argc, char *argv[] )
|
||||
#ifdef GL_ARB_multitexture
|
||||
glActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
glBindTexture(GL_TEXTURE_2D, texObj[0]);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
glActiveTextureARB(GL_TEXTURE1_ARB);
|
||||
glBindTexture(GL_TEXTURE_2D, texObj[1]);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
#endif
|
||||
|
||||
glShadeModel(GL_FLAT);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: osdemo.c,v 1.4 2000/03/28 16:59:39 rjfrank Exp $ */
|
||||
/* $Id: osdemo.c,v 1.5 2000/09/08 16:42:06 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Demo of off-screen Mesa rendering
|
||||
@@ -223,15 +223,38 @@ write_ppm(const char *filename, const GLubyte *buffer, int width, int height)
|
||||
|
||||
int main( int argc, char *argv[] )
|
||||
{
|
||||
void *buffer;
|
||||
|
||||
/* Create an RGBA-mode context */
|
||||
#if OSMESA_MAJOR_VERSION * 100 + OSMESA_MINOR_VERSION >= 305
|
||||
/* specify Z, stencil, accum sizes */
|
||||
OSMesaContext ctx = OSMesaCreateContextExt( GL_RGBA, 16, 0, 0, NULL );
|
||||
#else
|
||||
OSMesaContext ctx = OSMesaCreateContext( GL_RGBA, NULL );
|
||||
#endif
|
||||
if (!ctx) {
|
||||
printf("OSMesaCreateContext failed!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Allocate the image buffer */
|
||||
void *buffer = malloc( WIDTH * HEIGHT * 4 );
|
||||
buffer = malloc( WIDTH * HEIGHT * 4 );
|
||||
if (!buffer) {
|
||||
printf("Alloc image buffer failed!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Bind the buffer to the context and make it current */
|
||||
OSMesaMakeCurrent( ctx, buffer, GL_UNSIGNED_BYTE, WIDTH, HEIGHT );
|
||||
|
||||
{
|
||||
int z, s, a;
|
||||
glGetIntegerv(GL_DEPTH_BITS, &z);
|
||||
glGetIntegerv(GL_STENCIL_BITS, &s);
|
||||
glGetIntegerv(GL_ACCUM_RED_BITS, &a);
|
||||
printf("%d %d %d\n", z, s, a);
|
||||
}
|
||||
|
||||
render_image();
|
||||
|
||||
if (argc>1) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: paltex.c,v 1.4 2000/06/27 17:12:10 brianp Exp $ */
|
||||
/* $Id: paltex.c,v 1.6 2000/10/05 07:17:43 joukj Exp $ */
|
||||
|
||||
/*
|
||||
* Paletted texture demo. Written by Brian Paul.
|
||||
@@ -8,27 +8,38 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
#define GL_GLEXT_LEGACY
|
||||
#include <GL/glut.h>
|
||||
|
||||
|
||||
static float Rot = 0.0;
|
||||
static GLboolean Anim = 1;
|
||||
|
||||
|
||||
static void Idle( void )
|
||||
{
|
||||
Rot += 5.0;
|
||||
float t = glutGet(GLUT_ELAPSED_TIME) * 0.001; /* in seconds */
|
||||
Rot = t * 360 / 4; /* 1 rotation per 4 seconds */
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
static void Display( void )
|
||||
{
|
||||
glClear( GL_COLOR_BUFFER_BIT );
|
||||
/* draw background gradient */
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
glBegin(GL_POLYGON);
|
||||
glColor3f(1.0, 0.0, 0.2); glVertex2f(-1.5, -1.0);
|
||||
glColor3f(1.0, 0.0, 0.2); glVertex2f( 1.5, -1.0);
|
||||
glColor3f(0.0, 0.0, 1.0); glVertex2f( 1.5, 1.0);
|
||||
glColor3f(0.0, 0.0, 1.0); glVertex2f(-1.5, 1.0);
|
||||
glEnd();
|
||||
|
||||
glPushMatrix();
|
||||
glRotatef(Rot, 0, 0, 1);
|
||||
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glBegin(GL_POLYGON);
|
||||
glTexCoord2f(0, 1); glVertex2f(-1, -0.5);
|
||||
glTexCoord2f(1, 1); glVertex2f( 1, -0.5);
|
||||
@@ -47,10 +58,9 @@ static void Reshape( int width, int height )
|
||||
glViewport( 0, 0, width, height );
|
||||
glMatrixMode( GL_PROJECTION );
|
||||
glLoadIdentity();
|
||||
glFrustum( -1.0, 1.0, -1.0, 1.0, 5.0, 25.0 );
|
||||
glOrtho( -1.5, 1.5, -1.0, 1.0, -1.0, 1.0 );
|
||||
glMatrixMode( GL_MODELVIEW );
|
||||
glLoadIdentity();
|
||||
glTranslatef( 0.0, 0.0, -7.0 );
|
||||
}
|
||||
|
||||
|
||||
@@ -62,6 +72,16 @@ static void Key( unsigned char key, int x, int y )
|
||||
case 27:
|
||||
exit(0);
|
||||
break;
|
||||
case 's':
|
||||
Rot += 0.5;
|
||||
break;
|
||||
case ' ':
|
||||
Anim = !Anim;
|
||||
if (Anim)
|
||||
glutIdleFunc( Idle );
|
||||
else
|
||||
glutIdleFunc( NULL );
|
||||
break;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
@@ -89,26 +109,27 @@ static void Init( void )
|
||||
}
|
||||
|
||||
/* load the color table for each texel-index */
|
||||
table[' '][0] = 50;
|
||||
table[' '][1] = 50;
|
||||
table[' '][2] = 50;
|
||||
table[' '][3] = 50;
|
||||
memset(table, 0, 256*4);
|
||||
table[' '][0] = 255;
|
||||
table[' '][1] = 255;
|
||||
table[' '][2] = 255;
|
||||
table[' '][3] = 64;
|
||||
table['M'][0] = 255;
|
||||
table['M'][1] = 0;
|
||||
table['M'][2] = 0;
|
||||
table['M'][3] = 0;
|
||||
table['M'][3] = 255;
|
||||
table['E'][0] = 0;
|
||||
table['E'][1] = 255;
|
||||
table['E'][2] = 0;
|
||||
table['E'][3] = 0;
|
||||
table['S'][0] = 40;
|
||||
table['S'][1] = 40;
|
||||
table['E'][3] = 255;
|
||||
table['S'][0] = 0;
|
||||
table['S'][1] = 0;
|
||||
table['S'][2] = 255;
|
||||
table['S'][3] = 0;
|
||||
table['S'][3] = 255;
|
||||
table['A'][0] = 255;
|
||||
table['A'][1] = 255;
|
||||
table['A'][2] = 0;
|
||||
table['A'][3] = 0;
|
||||
table['A'][3] = 255;
|
||||
|
||||
#ifdef GL_EXT_paletted_texture
|
||||
|
||||
@@ -144,6 +165,81 @@ static void Init( void )
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
#undef HEIGHT
|
||||
#undef WIDTH
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Color ramp test
|
||||
*/
|
||||
static void Init2( void )
|
||||
{
|
||||
#define HEIGHT 32
|
||||
#define WIDTH 256
|
||||
static char texture[HEIGHT][WIDTH];
|
||||
GLubyte table[256][4];
|
||||
int i, j;
|
||||
|
||||
if (!glutExtensionSupported("GL_EXT_paletted_texture")) {
|
||||
printf("Sorry, GL_EXT_paletted_texture not supported\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
for (j = 0; j < HEIGHT; j++) {
|
||||
for (i = 0; i < WIDTH; i++) {
|
||||
texture[j][i] = i;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 255; i++) {
|
||||
table[i][0] = i;
|
||||
table[i][1] = 0;
|
||||
table[i][2] = 0;
|
||||
table[i][3] = 255;
|
||||
}
|
||||
|
||||
#ifdef GL_EXT_paletted_texture
|
||||
|
||||
#if defined(GL_EXT_shared_texture_palette) && defined(USE_SHARED_PALETTE)
|
||||
printf("Using shared palette\n");
|
||||
glColorTableEXT(GL_SHARED_TEXTURE_PALETTE_EXT, /* target */
|
||||
GL_RGBA, /* internal format */
|
||||
256, /* table size */
|
||||
GL_RGBA, /* table format */
|
||||
GL_UNSIGNED_BYTE, /* table type */
|
||||
table); /* the color table */
|
||||
glEnable(GL_SHARED_TEXTURE_PALETTE_EXT);
|
||||
#else
|
||||
glColorTableEXT(GL_TEXTURE_2D, /* target */
|
||||
GL_RGBA, /* internal format */
|
||||
256, /* table size */
|
||||
GL_RGBA, /* table format */
|
||||
GL_UNSIGNED_BYTE, /* table type */
|
||||
table); /* the color table */
|
||||
#endif
|
||||
|
||||
glTexImage2D(GL_TEXTURE_2D, /* target */
|
||||
0, /* level */
|
||||
GL_COLOR_INDEX8_EXT, /* internal format */
|
||||
WIDTH, HEIGHT, /* width, height */
|
||||
0, /* border */
|
||||
GL_COLOR_INDEX, /* texture format */
|
||||
GL_UNSIGNED_BYTE, /* texture type */
|
||||
texture); /* teh texture */
|
||||
#endif
|
||||
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
}
|
||||
|
||||
|
||||
@@ -151,7 +247,7 @@ int main( int argc, char *argv[] )
|
||||
{
|
||||
glutInit( &argc, argv );
|
||||
glutInitWindowPosition( 0, 0 );
|
||||
glutInitWindowSize( 400, 400 );
|
||||
glutInitWindowSize( 400, 300 );
|
||||
|
||||
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
|
||||
|
||||
@@ -162,7 +258,8 @@ int main( int argc, char *argv[] )
|
||||
glutReshapeFunc( Reshape );
|
||||
glutKeyboardFunc( Key );
|
||||
glutDisplayFunc( Display );
|
||||
glutIdleFunc( Idle );
|
||||
if (Anim)
|
||||
glutIdleFunc( Idle );
|
||||
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
#include <string.h>
|
||||
#include <GL/glut.h>
|
||||
#include <GL/glext.h>
|
||||
#include "../util/readtex.c" /* I know, this is a hack. */
|
||||
#include "readtex.c" /* I know, this is a hack. */
|
||||
|
||||
#define TEXTURE_FILE "../images/girl.rgb"
|
||||
|
||||
|
||||
@@ -24,7 +24,8 @@ static int fullscreen = 1;
|
||||
static int WIDTH = 640;
|
||||
static int HEIGHT = 480;
|
||||
|
||||
#define FRAME 50
|
||||
static GLint T0 = 0;
|
||||
static GLint Frames = 0;
|
||||
|
||||
#define BASESIZE 7.5f
|
||||
#define SPHERE_RADIUS 0.75f
|
||||
@@ -94,21 +95,6 @@ static int showreflectmap = 1;
|
||||
static int joyavailable = 0;
|
||||
static int joyactive = 0;
|
||||
|
||||
static float
|
||||
gettime(void)
|
||||
{
|
||||
static float told = 0.0f;
|
||||
float tnew, ris;
|
||||
|
||||
tnew = glutGet(GLUT_ELAPSED_TIME);
|
||||
|
||||
ris = tnew - told;
|
||||
|
||||
told = tnew;
|
||||
|
||||
return ris / 1000.0;
|
||||
}
|
||||
|
||||
static void
|
||||
calcposobs(void)
|
||||
{
|
||||
@@ -116,6 +102,13 @@ calcposobs(void)
|
||||
dir[1] = cos(alpha * M_PI / 180.0) * sin(beta * M_PI / 180.0);
|
||||
dir[2] = cos(beta * M_PI / 180.0);
|
||||
|
||||
if (dir[0] < 1.0e-5 && dir[0] > -1.0e-5)
|
||||
dir[0] = 0;
|
||||
if (dir[1] < 1.0e-5 && dir[1] > -1.0e-5)
|
||||
dir[1] = 0;
|
||||
if (dir[2] < 1.0e-5 && dir[2] > -1.0e-5)
|
||||
dir[2] = 0;
|
||||
|
||||
obs[0] += v * dir[0];
|
||||
obs[1] += v * dir[1];
|
||||
obs[2] += v * dir[2];
|
||||
@@ -393,8 +386,7 @@ colorcheckmap(float ppos[3], float c[3])
|
||||
h[1] = 0.5f * (vdir[1] + ldir[1]);
|
||||
h[2] = 0.5f * (vdir[2] + ldir[2]);
|
||||
kfact = dprod(h, norm);
|
||||
kfact =
|
||||
kfact * kfact * kfact * kfact * kfact * kfact * kfact * 7.0f * 255.0f;
|
||||
kfact = pow(kfact, 6.0) * 7.0 * 255.0;
|
||||
|
||||
r = r * dfact + kfact;
|
||||
g = g * dfact + kfact;
|
||||
@@ -494,12 +486,10 @@ updatereflectmap(int slot)
|
||||
h[1] = 0.5f * (vdir[1] + ldir[1]);
|
||||
h[2] = 0.5f * (vdir[2] + ldir[2]);
|
||||
kfact = dprod(h, norm);
|
||||
kfact *= kfact;
|
||||
kfact *= kfact;
|
||||
kfact *= kfact;
|
||||
kfact *= kfact;
|
||||
kfact *= 10.0f;
|
||||
}
|
||||
kfact = pow(kfact, 4.0);
|
||||
if (kfact < 1.0e-10)
|
||||
kfact = 0.0;
|
||||
}
|
||||
|
||||
r = dfact + kfact;
|
||||
g = dfact + kfact;
|
||||
@@ -622,9 +612,7 @@ updatemaps(void)
|
||||
static void
|
||||
draw(void)
|
||||
{
|
||||
static int count = 0;
|
||||
static char frbuf[80];
|
||||
float fr;
|
||||
static char frbuf[80] = "";
|
||||
|
||||
dojoy();
|
||||
|
||||
@@ -657,11 +645,6 @@ draw(void)
|
||||
|
||||
glPopMatrix();
|
||||
|
||||
if ((count % FRAME) == 0) {
|
||||
fr = gettime();
|
||||
sprintf(frbuf, "Frame rate: %f", FRAME / fr);
|
||||
}
|
||||
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
glDisable(GL_FOG);
|
||||
|
||||
@@ -746,7 +729,17 @@ draw(void)
|
||||
|
||||
glutSwapBuffers();
|
||||
|
||||
count++;
|
||||
Frames++;
|
||||
{
|
||||
GLint t = glutGet(GLUT_ELAPSED_TIME);
|
||||
if (t - T0 >= 2000) {
|
||||
GLfloat seconds = (t - T0) / 1000.0;
|
||||
GLfloat fps = Frames / seconds;
|
||||
sprintf(frbuf, "Frame rate: %f", fps);
|
||||
T0 = t;
|
||||
Frames = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: readpix.c,v 1.3 2000/03/31 01:01:31 brianp Exp $ */
|
||||
/* $Id: readpix.c,v 1.4 2000/10/16 21:24:39 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* glReadPixels and glCopyPixels test
|
||||
@@ -8,6 +8,9 @@
|
||||
|
||||
/*
|
||||
* $Log: readpix.c,v $
|
||||
* Revision 1.4 2000/10/16 21:24:39 brianp
|
||||
* use gray background, memset TempImage to white to help with debugging
|
||||
*
|
||||
* Revision 1.3 2000/03/31 01:01:31 brianp
|
||||
* tweaks to allow different read formats/types
|
||||
*
|
||||
@@ -43,11 +46,11 @@ static GLboolean ScaleAndBias = GL_FALSE;
|
||||
static GLboolean Benchmark = GL_FALSE;
|
||||
static GLubyte *TempImage = NULL;
|
||||
|
||||
#if 1
|
||||
#if 0
|
||||
#define ReadFormat ImgFormat
|
||||
#define ReadType GL_UNSIGNED_BYTE
|
||||
#endif
|
||||
#if 0
|
||||
#if 1
|
||||
static GLenum ReadFormat = GL_RGBA;
|
||||
static GLenum ReadType = GL_UNSIGNED_BYTE;
|
||||
#endif
|
||||
@@ -55,6 +58,18 @@ static GLenum ReadType = GL_UNSIGNED_BYTE;
|
||||
static GLenum ReadFormat = GL_RGB;
|
||||
static GLenum ReadType = GL_UNSIGNED_SHORT_5_6_5;
|
||||
#endif
|
||||
#if 0
|
||||
static GLenum ReadFormat = GL_RGBA;
|
||||
static GLenum ReadType = GL_UNSIGNED_SHORT_1_5_5_5_REV;
|
||||
#endif
|
||||
#if 0
|
||||
static GLenum ReadFormat = GL_BGRA;
|
||||
static GLenum ReadType = GL_UNSIGNED_SHORT_5_5_5_1;
|
||||
#endif
|
||||
#if 0
|
||||
static GLenum ReadFormat = GL_BGRA;
|
||||
static GLenum ReadType = GL_UNSIGNED_SHORT_4_4_4_4_REV;
|
||||
#endif
|
||||
|
||||
|
||||
static void
|
||||
@@ -101,6 +116,7 @@ SetupPixelTransfer(GLboolean invert)
|
||||
static void
|
||||
Display( void )
|
||||
{
|
||||
glClearColor(.3, .3, .3, 1);
|
||||
glClear( GL_COLOR_BUFFER_BIT );
|
||||
|
||||
glRasterPos2i(5, ImgHeight+25);
|
||||
@@ -137,6 +153,8 @@ Display( void )
|
||||
Benchmark = GL_FALSE;
|
||||
}
|
||||
else {
|
||||
/* clear the temporary image to white (helpful for debugging */
|
||||
memset(TempImage, 255, ImgWidth * ImgHeight * 4);
|
||||
glReadPixels(APosX, APosY, ImgWidth, ImgHeight,
|
||||
ReadFormat, ReadType, TempImage);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: reflect.c,v 1.3 2000/06/15 14:25:48 brianp Exp $ */
|
||||
/* $Id: reflect.c,v 1.7 2001/04/25 15:51:32 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Demo of a reflective, texture-mapped surface with OpenGL.
|
||||
@@ -53,7 +53,11 @@ static GLfloat spin;
|
||||
|
||||
static GLint Width = 400, Height = 300;
|
||||
static GLenum ShowBuffer = GL_NONE;
|
||||
static GLboolean Anim = GL_TRUE;
|
||||
|
||||
/* performance info */
|
||||
static GLint T0 = 0;
|
||||
static GLint Frames = 0;
|
||||
|
||||
|
||||
static void make_table( void )
|
||||
@@ -144,7 +148,7 @@ static void init( void )
|
||||
glEnable( GL_LIGHT0 );
|
||||
glEnable( GL_LIGHTING );
|
||||
|
||||
glClearColor( 0.5, 0.5, 0.9, 1.0 );
|
||||
glClearColor( 0.5, 0.5, 0.9, 0.0 );
|
||||
|
||||
glEnable( GL_NORMALIZE );
|
||||
}
|
||||
@@ -293,8 +297,31 @@ static void draw_scene( void )
|
||||
else if (ShowBuffer == GL_STENCIL) {
|
||||
ShowStencilBuffer(Width, Height, 255.0, 0.0);
|
||||
}
|
||||
else if (ShowBuffer == GL_ALPHA) {
|
||||
ShowAlphaBuffer(Width, Height);
|
||||
}
|
||||
|
||||
glutSwapBuffers();
|
||||
|
||||
{
|
||||
GLint t = glutGet(GLUT_ELAPSED_TIME);
|
||||
Frames++;
|
||||
if (t - T0 >= 5000) {
|
||||
GLfloat seconds = (t - T0) / 1000.0;
|
||||
GLfloat fps = Frames / seconds;
|
||||
printf("%d frames in %g seconds = %g FPS\n", Frames, seconds, fps);
|
||||
T0 = t;
|
||||
Frames = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void idle( void )
|
||||
{
|
||||
spin += 2.0;
|
||||
yrot += 3.0;
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
@@ -308,6 +335,16 @@ static void Key( unsigned char key, int x, int y )
|
||||
else if (key == 's') {
|
||||
ShowBuffer = GL_STENCIL;
|
||||
}
|
||||
else if (key == 'a') {
|
||||
ShowBuffer = GL_ALPHA;
|
||||
}
|
||||
else if (key == ' ') {
|
||||
Anim = !Anim;
|
||||
if (Anim)
|
||||
glutIdleFunc(idle);
|
||||
else
|
||||
glutIdleFunc(NULL);
|
||||
}
|
||||
else if (key==27) {
|
||||
exit(0);
|
||||
}
|
||||
@@ -344,16 +381,6 @@ static void SpecialKey( int key, int x, int y )
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void idle( void )
|
||||
{
|
||||
spin += 2.0;
|
||||
yrot += 3.0;
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
|
||||
int main( int argc, char *argv[] )
|
||||
{
|
||||
glutInit(&argc, argv);
|
||||
|
||||
@@ -1,119 +0,0 @@
|
||||
/**
|
||||
(c) Copyright 1993, Silicon Graphics, Inc.
|
||||
|
||||
ALL RIGHTS RESERVED
|
||||
|
||||
Permission to use, copy, modify, and distribute this software
|
||||
for any purpose and without fee is hereby granted, provided
|
||||
that the above copyright notice appear in all copies and that
|
||||
both the copyright notice and this permission notice appear in
|
||||
supporting documentation, and that the name of Silicon
|
||||
Graphics, Inc. not be used in advertising or publicity
|
||||
pertaining to distribution of the software without specific,
|
||||
written prior permission.
|
||||
|
||||
THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU
|
||||
"AS-IS" AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR
|
||||
OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
|
||||
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO
|
||||
EVENT SHALL SILICON GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE
|
||||
ELSE FOR ANY DIRECT, SPECIAL, INCIDENTAL, INDIRECT OR
|
||||
CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER,
|
||||
INCLUDING WITHOUT LIMITATION, LOSS OF PROFIT, LOSS OF USE,
|
||||
SAVINGS OR REVENUE, OR THE CLAIMS OF THIRD PARTIES, WHETHER OR
|
||||
NOT SILICON GRAPHICS, INC. HAS BEEN ADVISED OF THE POSSIBILITY
|
||||
OF SUCH LOSS, HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
ARISING OUT OF OR IN CONNECTION WITH THE POSSESSION, USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
US Government Users Restricted Rights
|
||||
|
||||
Use, duplication, or disclosure by the Government is subject to
|
||||
restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
|
||||
(c)(1)(ii) of the Rights in Technical Data and Computer
|
||||
Software clause at DFARS 252.227-7013 and/or in similar or
|
||||
successor clauses in the FAR or the DOD or NASA FAR
|
||||
Supplement. Unpublished-- rights reserved under the copyright
|
||||
laws of the United States. Contractor/manufacturer is Silicon
|
||||
Graphics, Inc., 2011 N. Shoreline Blvd., Mountain View, CA
|
||||
94039-7311.
|
||||
|
||||
OpenGL(TM) is a trademark of Silicon Graphics, Inc.
|
||||
*/
|
||||
|
||||
/* Taken from the projshadow.c - by Tom McReynolds, SGI */
|
||||
|
||||
/* Modified by David Bucciarelli */
|
||||
|
||||
/* Rendering shadows using projective shadows. */
|
||||
|
||||
#include <GL/glut.h>
|
||||
#include "shadow.h"
|
||||
|
||||
|
||||
enum {
|
||||
X, Y, Z, W
|
||||
};
|
||||
enum {
|
||||
A, B, C, D
|
||||
};
|
||||
|
||||
/* create a matrix that will project the desired shadow */
|
||||
void
|
||||
shadowmatrix(GLfloat shadowMat[4][4],
|
||||
GLfloat groundplane[4],
|
||||
GLfloat lightpos[4])
|
||||
{
|
||||
GLfloat dot;
|
||||
|
||||
/* find dot product between light position vector and ground plane normal */
|
||||
dot = groundplane[X] * lightpos[X] +
|
||||
groundplane[Y] * lightpos[Y] +
|
||||
groundplane[Z] * lightpos[Z] +
|
||||
groundplane[W] * lightpos[W];
|
||||
|
||||
shadowMat[0][0] = dot - lightpos[X] * groundplane[X];
|
||||
shadowMat[1][0] = 0.f - lightpos[X] * groundplane[Y];
|
||||
shadowMat[2][0] = 0.f - lightpos[X] * groundplane[Z];
|
||||
shadowMat[3][0] = 0.f - lightpos[X] * groundplane[W];
|
||||
|
||||
shadowMat[X][1] = 0.f - lightpos[Y] * groundplane[X];
|
||||
shadowMat[1][1] = dot - lightpos[Y] * groundplane[Y];
|
||||
shadowMat[2][1] = 0.f - lightpos[Y] * groundplane[Z];
|
||||
shadowMat[3][1] = 0.f - lightpos[Y] * groundplane[W];
|
||||
|
||||
shadowMat[X][2] = 0.f - lightpos[Z] * groundplane[X];
|
||||
shadowMat[1][2] = 0.f - lightpos[Z] * groundplane[Y];
|
||||
shadowMat[2][2] = dot - lightpos[Z] * groundplane[Z];
|
||||
shadowMat[3][2] = 0.f - lightpos[Z] * groundplane[W];
|
||||
|
||||
shadowMat[X][3] = 0.f - lightpos[W] * groundplane[X];
|
||||
shadowMat[1][3] = 0.f - lightpos[W] * groundplane[Y];
|
||||
shadowMat[2][3] = 0.f - lightpos[W] * groundplane[Z];
|
||||
shadowMat[3][3] = dot - lightpos[W] * groundplane[W];
|
||||
|
||||
}
|
||||
|
||||
/* find the plane equation given 3 points */
|
||||
void
|
||||
findplane(GLfloat plane[4],
|
||||
GLfloat v0[3], GLfloat v1[3], GLfloat v2[3])
|
||||
{
|
||||
GLfloat vec0[3], vec1[3];
|
||||
|
||||
/* need 2 vectors to find cross product */
|
||||
vec0[X] = v1[X] - v0[X];
|
||||
vec0[Y] = v1[Y] - v0[Y];
|
||||
vec0[Z] = v1[Z] - v0[Z];
|
||||
|
||||
vec1[X] = v2[X] - v0[X];
|
||||
vec1[Y] = v2[Y] - v0[Y];
|
||||
vec1[Z] = v2[Z] - v0[Z];
|
||||
|
||||
/* find cross product to get A, B, and C of plane equation */
|
||||
plane[A] = vec0[Y] * vec1[Z] - vec0[Z] * vec1[Y];
|
||||
plane[B] = -(vec0[X] * vec1[Z] - vec0[Z] * vec1[X]);
|
||||
plane[C] = vec0[X] * vec1[Y] - vec0[Y] * vec1[X];
|
||||
|
||||
plane[D] = -(plane[A] * v0[X] + plane[B] * v0[Y] + plane[C] * v0[Z]);
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
#ifndef SHADOW_H
|
||||
#define SHADOW_H
|
||||
|
||||
|
||||
extern void
|
||||
shadowmatrix(GLfloat shadowMat[4][4],
|
||||
GLfloat groundplane[4],
|
||||
GLfloat lightpos[4]);
|
||||
|
||||
|
||||
extern void
|
||||
findplane(GLfloat plane[4],
|
||||
GLfloat v0[3], GLfloat v1[3], GLfloat v2[3]);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
528
progs/demos/shadowtex.c
Normal file
528
progs/demos/shadowtex.c
Normal file
@@ -0,0 +1,528 @@
|
||||
/* $Id: shadowtex.c,v 1.4 2001/02/28 18:41:50 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Shadow demo using the GL_SGIX_depth_texture, GL_SGIX_shadow and
|
||||
* GL_SGIX_shadow_ambient extensions.
|
||||
*
|
||||
* Brian Paul
|
||||
* 19 Feb 2001
|
||||
*
|
||||
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is 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 Software.
|
||||
*
|
||||
* THE SOFTWARE IS 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
|
||||
* BRIAN PAUL 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 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <GL/glut.h>
|
||||
#include "../util/showbuffer.c"
|
||||
|
||||
|
||||
#define DEG_TO_RAD (3.14159 / 180.0)
|
||||
|
||||
static GLint WindowWidth = 450, WindowHeight = 300;
|
||||
static GLfloat Xrot = 15, Yrot = 0, Zrot = 0;
|
||||
|
||||
static GLfloat Red[4] = {1, 0, 0, 1};
|
||||
static GLfloat Green[4] = {0, 1, 0, 1};
|
||||
static GLfloat Blue[4] = {0, 0, 1, 1};
|
||||
static GLfloat Yellow[4] = {1, 1, 0, 1};
|
||||
|
||||
static GLfloat LightDist = 10;
|
||||
static GLfloat LightLatitude = 45.0;
|
||||
static GLfloat LightLongitude = 45.0;
|
||||
static GLfloat LightPos[4];
|
||||
static GLfloat SpotDir[3];
|
||||
static GLfloat SpotAngle = 40.0 * DEG_TO_RAD;
|
||||
static GLfloat ShadowNear = 4.0, ShadowFar = 24.0;
|
||||
static GLint ShadowTexWidth = 256, ShadowTexHeight = 256;
|
||||
|
||||
static GLboolean LinearFilter = GL_FALSE;
|
||||
|
||||
static GLfloat Bias = -0.06;
|
||||
|
||||
static GLboolean Anim = GL_TRUE;
|
||||
|
||||
static GLuint DisplayMode;
|
||||
#define SHOW_NORMAL 0
|
||||
#define SHOW_DEPTH_IMAGE 1
|
||||
#define SHOW_DEPTH_MAPPING 2
|
||||
#define SHOW_DISTANCE 3
|
||||
|
||||
|
||||
|
||||
static void
|
||||
DrawScene(void)
|
||||
{
|
||||
GLfloat k = 6;
|
||||
/* sphere */
|
||||
glPushMatrix();
|
||||
glTranslatef(1.6, 2.2, 2.7);
|
||||
glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, Green);
|
||||
glColor4fv(Green);
|
||||
glutSolidSphere(1.5, 15, 15);
|
||||
glPopMatrix();
|
||||
/* dodecahedron */
|
||||
glPushMatrix();
|
||||
glTranslatef(-2.0, 1.2, 2.1);
|
||||
glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, Red);
|
||||
glColor4fv(Red);
|
||||
glutSolidDodecahedron();
|
||||
glPopMatrix();
|
||||
/* icosahedron */
|
||||
glPushMatrix();
|
||||
glTranslatef(-0.6, 1.3, -0.5);
|
||||
glScalef(1.5, 1.5, 1.5);
|
||||
glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, Yellow);
|
||||
glColor4fv(Red);
|
||||
glutSolidIcosahedron();
|
||||
glPopMatrix();
|
||||
/* a plane */
|
||||
glPushMatrix();
|
||||
glTranslatef(0, -1.1, 0);
|
||||
glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, Blue);
|
||||
glColor4fv(Blue);
|
||||
glNormal3f(0, 1, 0);
|
||||
glBegin(GL_POLYGON);
|
||||
glVertex3f(-k, 0, -k);
|
||||
glVertex3f( k, 0, -k);
|
||||
glVertex3f( k, 0, k);
|
||||
glVertex3f(-k, 0, k);
|
||||
glEnd();
|
||||
glPopMatrix();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Load the GL_TEXTURE matrix with the projection from the light
|
||||
* source's point of view.
|
||||
*/
|
||||
static void
|
||||
MakeShadowMatrix(const GLfloat lightPos[4], const GLfloat spotDir[3],
|
||||
GLfloat spotAngle, GLfloat shadowNear, GLfloat shadowFar)
|
||||
{
|
||||
GLfloat d;
|
||||
|
||||
glMatrixMode(GL_TEXTURE);
|
||||
glLoadIdentity();
|
||||
glTranslatef(0.5, 0.5, 0.5 + Bias);
|
||||
glScalef(0.5, 0.5, 0.5);
|
||||
d = shadowNear * tan(spotAngle);
|
||||
glFrustum(-d, d, -d, d, shadowNear, shadowFar);
|
||||
gluLookAt(lightPos[0], lightPos[1], lightPos[2],
|
||||
lightPos[0] + spotDir[0],
|
||||
lightPos[1] + spotDir[1],
|
||||
lightPos[2] + spotDir[2],
|
||||
0, 1, 0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
EnableIdentityTexgen(void)
|
||||
{
|
||||
/* texgen so that texcoord = vertex coord */
|
||||
static GLfloat sPlane[4] = { 1, 0, 0, 0 };
|
||||
static GLfloat tPlane[4] = { 0, 1, 0, 0 };
|
||||
static GLfloat rPlane[4] = { 0, 0, 1, 0 };
|
||||
static GLfloat qPlane[4] = { 0, 0, 0, 1 };
|
||||
|
||||
glTexGenfv(GL_S, GL_EYE_PLANE, sPlane);
|
||||
glTexGenfv(GL_T, GL_EYE_PLANE, tPlane);
|
||||
glTexGenfv(GL_R, GL_EYE_PLANE, rPlane);
|
||||
glTexGenfv(GL_Q, GL_EYE_PLANE, qPlane);
|
||||
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR);
|
||||
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR);
|
||||
glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR);
|
||||
glTexGeni(GL_Q, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR);
|
||||
|
||||
glEnable(GL_TEXTURE_GEN_S);
|
||||
glEnable(GL_TEXTURE_GEN_T);
|
||||
glEnable(GL_TEXTURE_GEN_R);
|
||||
glEnable(GL_TEXTURE_GEN_Q);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Setup 1-D texgen so that the distance from the light source, between
|
||||
* the near and far planes maps to s=0 and s=1. When we draw the scene,
|
||||
* the grayness will indicate the fragment's distance from the light
|
||||
* source.
|
||||
*/
|
||||
static void
|
||||
EnableDistanceTexgen(const GLfloat lightPos[4], const GLfloat lightDir[3],
|
||||
GLfloat lightNear, GLfloat lightFar)
|
||||
{
|
||||
GLfloat m, d;
|
||||
GLfloat sPlane[4];
|
||||
GLfloat nearPoint[3];
|
||||
|
||||
m = sqrt(lightDir[0] * lightDir[0] +
|
||||
lightDir[1] * lightDir[1] +
|
||||
lightDir[2] * lightDir[2]);
|
||||
|
||||
d = lightFar - lightNear;
|
||||
|
||||
/* nearPoint = point on light direction vector which intersects the
|
||||
* near plane of the light frustum.
|
||||
*/
|
||||
nearPoint[0] = LightPos[0] + lightDir[0] / m * lightNear;
|
||||
nearPoint[1] = LightPos[1] + lightDir[1] / m * lightNear;
|
||||
nearPoint[2] = LightPos[2] + lightDir[2] / m * lightNear;
|
||||
|
||||
sPlane[0] = lightDir[0] / d / m;
|
||||
sPlane[1] = lightDir[1] / d / m;
|
||||
sPlane[2] = lightDir[2] / d / m;
|
||||
sPlane[3] = -(sPlane[0] * nearPoint[0]
|
||||
+ sPlane[1] * nearPoint[1]
|
||||
+ sPlane[2] * nearPoint[2]);
|
||||
|
||||
glTexGenfv(GL_S, GL_EYE_PLANE, sPlane);
|
||||
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR);
|
||||
glEnable(GL_TEXTURE_GEN_S);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
DisableTexgen(void)
|
||||
{
|
||||
glDisable(GL_TEXTURE_GEN_S);
|
||||
glDisable(GL_TEXTURE_GEN_T);
|
||||
glDisable(GL_TEXTURE_GEN_R);
|
||||
glDisable(GL_TEXTURE_GEN_Q);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
ComputeLightPos(GLfloat dist, GLfloat latitude, GLfloat longitude,
|
||||
GLfloat pos[4], GLfloat dir[3])
|
||||
{
|
||||
|
||||
pos[0] = dist * sin(longitude * DEG_TO_RAD);
|
||||
pos[1] = dist * sin(latitude * DEG_TO_RAD);
|
||||
pos[2] = dist * cos(latitude * DEG_TO_RAD) * cos(longitude * DEG_TO_RAD);
|
||||
pos[3] = 1;
|
||||
dir[0] = -pos[0];
|
||||
dir[1] = -pos[1];
|
||||
dir[2] = -pos[2];
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Display(void)
|
||||
{
|
||||
GLfloat ar = (GLfloat) WindowWidth / (GLfloat) WindowHeight;
|
||||
GLfloat d;
|
||||
|
||||
ComputeLightPos(LightDist, LightLatitude, LightLongitude,
|
||||
LightPos, SpotDir);
|
||||
/*
|
||||
* Step 1: render scene from point of view of the light source
|
||||
*/
|
||||
/* compute frustum to enclose spot light cone */
|
||||
d = ShadowNear * tan(SpotAngle);
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glFrustum(-d, d, -d, d, ShadowNear, ShadowFar);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
gluLookAt(LightPos[0], LightPos[1], LightPos[2], /* from */
|
||||
0, 0, 0, /* target */
|
||||
0, 1, 0); /* up */
|
||||
|
||||
glViewport(0, 0, ShadowTexWidth, ShadowTexHeight);
|
||||
glClear(GL_DEPTH_BUFFER_BIT);
|
||||
DrawScene();
|
||||
|
||||
/*
|
||||
* Step 2: copy depth buffer into texture map
|
||||
*/
|
||||
if (DisplayMode == SHOW_DEPTH_MAPPING) {
|
||||
/* load depth image as gray-scale luminance texture */
|
||||
GLfloat *depth = malloc(ShadowTexWidth * ShadowTexHeight
|
||||
* sizeof(GLfloat));
|
||||
if (depth) {
|
||||
glReadPixels(0, 0, ShadowTexWidth, ShadowTexHeight,
|
||||
GL_DEPTH_COMPONENT, GL_FLOAT, depth);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE,
|
||||
ShadowTexWidth, ShadowTexHeight, 0,
|
||||
GL_LUMINANCE, GL_FLOAT, depth);
|
||||
free(depth);
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* The normal shadow case */
|
||||
glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT,
|
||||
0, 0, ShadowTexWidth, ShadowTexHeight, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Step 3: render scene from point of view of the camera
|
||||
*/
|
||||
glViewport(0, 0, WindowWidth, WindowHeight);
|
||||
if (DisplayMode == SHOW_DEPTH_IMAGE) {
|
||||
ShowDepthBuffer(WindowWidth, WindowHeight, 0, 1);
|
||||
}
|
||||
else {
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glFrustum(-ar, ar, -1.0, 1.0, 4.0, 50.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
glTranslatef(0.0, 0.0, -22.0);
|
||||
glRotatef(Xrot, 1, 0, 0);
|
||||
glRotatef(Yrot, 0, 1, 0);
|
||||
glRotatef(Zrot, 0, 0, 1);
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
glLightfv(GL_LIGHT0, GL_POSITION, LightPos);
|
||||
if (LinearFilter) {
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
}
|
||||
else {
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
}
|
||||
if (DisplayMode == SHOW_DEPTH_MAPPING) {
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_SGIX, GL_FALSE);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
MakeShadowMatrix(LightPos, SpotDir, SpotAngle, ShadowNear, ShadowFar);
|
||||
EnableIdentityTexgen();
|
||||
}
|
||||
else if (DisplayMode == SHOW_DISTANCE) {
|
||||
glMatrixMode(GL_TEXTURE);
|
||||
glLoadIdentity();
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
EnableDistanceTexgen(LightPos, SpotDir, ShadowNear+Bias, ShadowFar);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
||||
glEnable(GL_TEXTURE_1D);
|
||||
}
|
||||
else {
|
||||
assert(DisplayMode == SHOW_NORMAL);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_SGIX, GL_TRUE);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
MakeShadowMatrix(LightPos, SpotDir, SpotAngle, ShadowNear, ShadowFar);
|
||||
EnableIdentityTexgen();
|
||||
}
|
||||
DrawScene();
|
||||
DisableTexgen();
|
||||
glDisable(GL_TEXTURE_1D);
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
}
|
||||
|
||||
glutSwapBuffers();
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Reshape(int width, int height)
|
||||
{
|
||||
WindowWidth = width;
|
||||
WindowHeight = height;
|
||||
if (width >= 512 && height >= 512) {
|
||||
ShadowTexWidth = ShadowTexHeight = 512;
|
||||
}
|
||||
else if (width >= 256 && height >= 256) {
|
||||
ShadowTexWidth = ShadowTexHeight = 256;
|
||||
}
|
||||
else {
|
||||
ShadowTexWidth = ShadowTexHeight = 128;
|
||||
}
|
||||
printf("Using %d x %d depth texture\n", ShadowTexWidth, ShadowTexHeight);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Idle(void)
|
||||
{
|
||||
Yrot += 5.0;
|
||||
/*LightLongitude -= 5.0;*/
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Key(unsigned char key, int x, int y)
|
||||
{
|
||||
const GLfloat step = 3.0;
|
||||
(void) x;
|
||||
(void) y;
|
||||
switch (key) {
|
||||
case 'a':
|
||||
Anim = !Anim;
|
||||
if (Anim)
|
||||
glutIdleFunc(Idle);
|
||||
else
|
||||
glutIdleFunc(NULL);
|
||||
break;
|
||||
case 'b':
|
||||
Bias -= 0.01;
|
||||
printf("Bias %g\n", Bias);
|
||||
break;
|
||||
case 'B':
|
||||
Bias += 0.01;
|
||||
printf("Bias %g\n", Bias);
|
||||
break;
|
||||
case 'd':
|
||||
DisplayMode = SHOW_DISTANCE;
|
||||
break;
|
||||
case 'f':
|
||||
LinearFilter = !LinearFilter;
|
||||
printf("%s filtering\n", LinearFilter ? "Bilinear" : "Nearest");
|
||||
break;
|
||||
case 'i':
|
||||
DisplayMode = SHOW_DEPTH_IMAGE;
|
||||
break;
|
||||
case 'm':
|
||||
DisplayMode = SHOW_DEPTH_MAPPING;
|
||||
break;
|
||||
case 'n':
|
||||
case ' ':
|
||||
DisplayMode = SHOW_NORMAL;
|
||||
break;
|
||||
case 'z':
|
||||
Zrot -= step;
|
||||
break;
|
||||
case 'Z':
|
||||
Zrot += step;
|
||||
break;
|
||||
case 27:
|
||||
exit(0);
|
||||
break;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
SpecialKey(int key, int x, int y)
|
||||
{
|
||||
const GLfloat step = 3.0;
|
||||
const int mod = glutGetModifiers();
|
||||
(void) x;
|
||||
(void) y;
|
||||
switch (key) {
|
||||
case GLUT_KEY_UP:
|
||||
if (mod)
|
||||
LightLatitude += step;
|
||||
else
|
||||
Xrot += step;
|
||||
break;
|
||||
case GLUT_KEY_DOWN:
|
||||
if (mod)
|
||||
LightLatitude -= step;
|
||||
else
|
||||
Xrot -= step;
|
||||
break;
|
||||
case GLUT_KEY_LEFT:
|
||||
if (mod)
|
||||
LightLongitude += step;
|
||||
else
|
||||
Yrot += step;
|
||||
break;
|
||||
case GLUT_KEY_RIGHT:
|
||||
if (mod)
|
||||
LightLongitude -= step;
|
||||
else
|
||||
Yrot -= step;
|
||||
break;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Init(void)
|
||||
{
|
||||
if (!glutExtensionSupported("GL_SGIX_depth_texture") ||
|
||||
!glutExtensionSupported("GL_SGIX_shadow")) {
|
||||
printf("Sorry, this demo requires the GL_SGIX_depth_texture and GL_SGIX_shadow extensions\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_CLAMP);
|
||||
glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_WRAP_T, GL_CLAMP);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
|
||||
#ifdef GL_SGIX_shadow
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_OPERATOR_SGIX,
|
||||
GL_TEXTURE_LEQUAL_R_SGIX);
|
||||
#endif
|
||||
#ifdef GL_SGIX_shadow_ambient
|
||||
if (glutExtensionSupported("GL_SGIX_shadow_ambient"))
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_SHADOW_AMBIENT_SGIX, 0.3);
|
||||
#endif
|
||||
|
||||
/* setup 1-D grayscale texture image for SHOW_DISTANCE mode */
|
||||
{
|
||||
GLuint i;
|
||||
GLubyte image[256];
|
||||
for (i = 0; i < 256; i++)
|
||||
image[i] = i;
|
||||
glTexImage1D(GL_TEXTURE_1D, 0, GL_LUMINANCE,
|
||||
256, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, image);
|
||||
}
|
||||
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glEnable(GL_LIGHTING);
|
||||
glEnable(GL_LIGHT0);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
PrintHelp(void)
|
||||
{
|
||||
printf("Keys:\n");
|
||||
printf(" a = toggle animation\n");
|
||||
printf(" i = show depth texture image\n");
|
||||
printf(" m = show depth texture mapping\n");
|
||||
printf(" d = show fragment distance from light source\n");
|
||||
printf(" n = show normal, shadowed image\n");
|
||||
printf(" f = toggle nearest/bilinear texture filtering\n");
|
||||
printf(" b/B = decrease/increase shadow map Z bias\n");
|
||||
printf(" cursor keys = rotate scene\n");
|
||||
printf(" <shift> + cursor keys = rotate light source\n");
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
glutInit(&argc, argv);
|
||||
glutInitWindowPosition(0, 0);
|
||||
glutInitWindowSize(WindowWidth, WindowHeight);
|
||||
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
|
||||
glutCreateWindow(argv[0]);
|
||||
glutReshapeFunc(Reshape);
|
||||
glutKeyboardFunc(Key);
|
||||
glutSpecialFunc(SpecialKey);
|
||||
glutDisplayFunc(Display);
|
||||
if (Anim)
|
||||
glutIdleFunc(Idle);
|
||||
Init();
|
||||
PrintHelp();
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
||||
@@ -16,8 +16,7 @@
|
||||
#endif
|
||||
|
||||
#include <GL/glut.h>
|
||||
#include "../util/readtex.c"
|
||||
#include "shadow.c"
|
||||
#include "readtex.c"
|
||||
|
||||
#ifdef XMESA
|
||||
#include "GL/xmesa.h"
|
||||
@@ -27,7 +26,8 @@ static int fullscreen=1;
|
||||
static int WIDTH=640;
|
||||
static int HEIGHT=480;
|
||||
|
||||
#define FRAME 50
|
||||
static GLint T0 = 0;
|
||||
static GLint Frames = 0;
|
||||
|
||||
#define BASESIZE 10.0
|
||||
|
||||
@@ -65,20 +65,84 @@ static int joyactive=0;
|
||||
static GLuint t1id,t2id;
|
||||
static GLuint teapotdlist,basedlist,lightdlist;
|
||||
|
||||
static float gettime(void)
|
||||
|
||||
|
||||
/******************** begin shadow code ********************/
|
||||
|
||||
/* Taken from the projshadow.c - by Tom McReynolds, SGI */
|
||||
|
||||
/* Modified by David Bucciarelli */
|
||||
|
||||
enum {
|
||||
X, Y, Z, W
|
||||
};
|
||||
enum {
|
||||
A, B, C, D
|
||||
};
|
||||
|
||||
/* create a matrix that will project the desired shadow */
|
||||
void
|
||||
shadowmatrix(GLfloat shadowMat[4][4],
|
||||
GLfloat groundplane[4],
|
||||
GLfloat lightpos[4])
|
||||
{
|
||||
static clock_t told=0;
|
||||
clock_t tnew,ris;
|
||||
GLfloat dot;
|
||||
|
||||
tnew=clock();
|
||||
/* find dot product between light position vector and ground plane normal */
|
||||
dot = groundplane[X] * lightpos[X] +
|
||||
groundplane[Y] * lightpos[Y] +
|
||||
groundplane[Z] * lightpos[Z] +
|
||||
groundplane[W] * lightpos[W];
|
||||
|
||||
ris=tnew-told;
|
||||
shadowMat[0][0] = dot - lightpos[X] * groundplane[X];
|
||||
shadowMat[1][0] = 0.f - lightpos[X] * groundplane[Y];
|
||||
shadowMat[2][0] = 0.f - lightpos[X] * groundplane[Z];
|
||||
shadowMat[3][0] = 0.f - lightpos[X] * groundplane[W];
|
||||
|
||||
told=tnew;
|
||||
shadowMat[X][1] = 0.f - lightpos[Y] * groundplane[X];
|
||||
shadowMat[1][1] = dot - lightpos[Y] * groundplane[Y];
|
||||
shadowMat[2][1] = 0.f - lightpos[Y] * groundplane[Z];
|
||||
shadowMat[3][1] = 0.f - lightpos[Y] * groundplane[W];
|
||||
|
||||
shadowMat[X][2] = 0.f - lightpos[Z] * groundplane[X];
|
||||
shadowMat[1][2] = 0.f - lightpos[Z] * groundplane[Y];
|
||||
shadowMat[2][2] = dot - lightpos[Z] * groundplane[Z];
|
||||
shadowMat[3][2] = 0.f - lightpos[Z] * groundplane[W];
|
||||
|
||||
shadowMat[X][3] = 0.f - lightpos[W] * groundplane[X];
|
||||
shadowMat[1][3] = 0.f - lightpos[W] * groundplane[Y];
|
||||
shadowMat[2][3] = 0.f - lightpos[W] * groundplane[Z];
|
||||
shadowMat[3][3] = dot - lightpos[W] * groundplane[W];
|
||||
|
||||
return(ris/(float)CLOCKS_PER_SEC);
|
||||
}
|
||||
|
||||
/* find the plane equation given 3 points */
|
||||
void
|
||||
findplane(GLfloat plane[4],
|
||||
GLfloat v0[3], GLfloat v1[3], GLfloat v2[3])
|
||||
{
|
||||
GLfloat vec0[3], vec1[3];
|
||||
|
||||
/* need 2 vectors to find cross product */
|
||||
vec0[X] = v1[X] - v0[X];
|
||||
vec0[Y] = v1[Y] - v0[Y];
|
||||
vec0[Z] = v1[Z] - v0[Z];
|
||||
|
||||
vec1[X] = v2[X] - v0[X];
|
||||
vec1[Y] = v2[Y] - v0[Y];
|
||||
vec1[Z] = v2[Z] - v0[Z];
|
||||
|
||||
/* find cross product to get A, B, and C of plane equation */
|
||||
plane[A] = vec0[Y] * vec1[Z] - vec0[Z] * vec1[Y];
|
||||
plane[B] = -(vec0[X] * vec1[Z] - vec0[Z] * vec1[X]);
|
||||
plane[C] = vec0[X] * vec1[Y] - vec0[Y] * vec1[X];
|
||||
|
||||
plane[D] = -(plane[A] * v0[X] + plane[B] * v0[Y] + plane[C] * v0[Z]);
|
||||
}
|
||||
|
||||
/******************** end shadow code ********************/
|
||||
|
||||
|
||||
static void calcposobs(void)
|
||||
{
|
||||
dir[0]=sin(alpha*M_PI/180.0);
|
||||
@@ -208,11 +272,15 @@ static void printhelp(void)
|
||||
|
||||
static void drawbase(void)
|
||||
{
|
||||
static const GLfloat amb[4] = { 1, .5, 0.2, 1 };
|
||||
static const GLfloat diff[4] = { 1, .4, 0.2, 1 };
|
||||
int i,j;
|
||||
float x,y,dx,dy;
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D,t1id);
|
||||
|
||||
glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, amb);
|
||||
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, diff);
|
||||
dx=BASESIZE/BASERES;
|
||||
dy=-BASESIZE/BASERES;
|
||||
for(y=BASESIZE/2.0,j=0;j<BASERES;y+=dy,j++) {
|
||||
@@ -232,9 +300,14 @@ static void drawbase(void)
|
||||
|
||||
static void drawteapot(void)
|
||||
{
|
||||
static const GLfloat amb[4] = { 0.2, 0.2, 0.2, 1 };
|
||||
static const GLfloat diff[4] = { 0.8, 0.3, 0.5, 1 };
|
||||
static float xrot=0.0;
|
||||
static float zrot=0.0;
|
||||
|
||||
glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, amb);
|
||||
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, diff);
|
||||
|
||||
glPushMatrix();
|
||||
glRotatef(lightalpha,0.0,0.0,1.0);
|
||||
glMultMatrixf((GLfloat *)baseshadow);
|
||||
@@ -339,9 +412,7 @@ static void dojoy(void)
|
||||
|
||||
static void draw(void)
|
||||
{
|
||||
static int count=0;
|
||||
static char frbuf[80];
|
||||
float fr;
|
||||
static char frbuf[80] = "";
|
||||
|
||||
dojoy();
|
||||
|
||||
@@ -375,11 +446,6 @@ static void draw(void)
|
||||
drawlight2();
|
||||
glPopMatrix();
|
||||
|
||||
if((count % FRAME)==0) {
|
||||
fr=gettime();
|
||||
sprintf(frbuf,"Frame rate: %f",FRAME/fr);
|
||||
}
|
||||
|
||||
glDisable(GL_LIGHTING);
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
@@ -405,7 +471,18 @@ static void draw(void)
|
||||
|
||||
glutSwapBuffers();
|
||||
|
||||
count++;
|
||||
Frames++;
|
||||
|
||||
{
|
||||
GLint t = glutGet(GLUT_ELAPSED_TIME);
|
||||
if (t - T0 >= 2000) {
|
||||
GLfloat seconds = (t - T0) / 1000.0;
|
||||
GLfloat fps = Frames / seconds;
|
||||
sprintf(frbuf, "Frame rate: %f", fps);
|
||||
T0 = t;
|
||||
Frames = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void inittextures(void)
|
||||
@@ -430,11 +507,26 @@ static void inittextures(void)
|
||||
glGenTextures(1,&t2id);
|
||||
glBindTexture(GL_TEXTURE_2D,t2id);
|
||||
|
||||
glPixelTransferf(GL_RED_SCALE, 0.75);
|
||||
glPixelTransferf(GL_RED_BIAS, 0.25);
|
||||
glPixelTransferf(GL_GREEN_SCALE, 0.75);
|
||||
glPixelTransferf(GL_GREEN_BIAS, 0.25);
|
||||
glPixelTransferf(GL_BLUE_SCALE, 0.75);
|
||||
glPixelTransferf(GL_BLUE_BIAS, 0.25);
|
||||
|
||||
if (!LoadRGBMipmaps("../images/bw.rgb", GL_RGB)) {
|
||||
fprintf(stderr,"Error reading a texture.\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
glPixelTransferf(GL_RED_SCALE, 1.0);
|
||||
glPixelTransferf(GL_RED_BIAS, 0.0);
|
||||
glPixelTransferf(GL_GREEN_SCALE, 1.0);
|
||||
glPixelTransferf(GL_GREEN_BIAS, 0.0);
|
||||
glPixelTransferf(GL_BLUE_SCALE, 1.0);
|
||||
glPixelTransferf(GL_BLUE_BIAS, 0.0);
|
||||
|
||||
|
||||
glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT);
|
||||
glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT);
|
||||
|
||||
@@ -446,17 +538,26 @@ static void inittextures(void)
|
||||
|
||||
static void initlight(void)
|
||||
{
|
||||
float lamb[4]={0.2,0.2,0.2,1.0};
|
||||
float lspec[4]={1.0,1.0,1.0,1.0};
|
||||
float matamb[4] ={0.5, 0.5, 0.5, 1.0};
|
||||
float matdiff[4]={0.9, 0.2, 0.2, 1.0};
|
||||
float matspec[4]={1.0,1.0,1.0,1.0};
|
||||
|
||||
float lamb[4] ={1.5, 1.5, 1.5, 1.0};
|
||||
float ldiff[4]={1.0, 1.0, 1.0, 1.0};
|
||||
float lspec[4]={1.0, 1.0, 1.0, 1.0};
|
||||
|
||||
glLightf(GL_LIGHT0,GL_SPOT_CUTOFF,70.0);
|
||||
glLightf(GL_LIGHT0,GL_SPOT_EXPONENT,20.0);
|
||||
glLightfv(GL_LIGHT0,GL_AMBIENT,lamb);
|
||||
glLightfv(GL_LIGHT0,GL_DIFFUSE,ldiff);
|
||||
glLightfv(GL_LIGHT0,GL_SPECULAR,lspec);
|
||||
|
||||
glMaterialf(GL_FRONT_AND_BACK,GL_SHININESS,20.0);
|
||||
glMaterialfv(GL_FRONT_AND_BACK,GL_SPECULAR,lspec);
|
||||
glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, 15.0);
|
||||
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, matdiff);
|
||||
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, matspec);
|
||||
glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, matamb);
|
||||
|
||||
glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lamb);
|
||||
glEnable(GL_LIGHT0);
|
||||
}
|
||||
|
||||
|
||||
@@ -38,9 +38,10 @@ static int fullscreen = 1;
|
||||
#define WIDTH 640
|
||||
#define HEIGHT 480
|
||||
|
||||
#define TSCALE 4
|
||||
static GLint T0 = 0;
|
||||
static GLint Frames = 0;
|
||||
|
||||
#define FRAME 50
|
||||
#define TSCALE 4
|
||||
|
||||
#define FOV 85
|
||||
|
||||
@@ -71,21 +72,6 @@ static float v = 15.0;
|
||||
static float alpha = 75.0;
|
||||
static float beta = 90.0;
|
||||
|
||||
static float
|
||||
gettime(void)
|
||||
{
|
||||
static clock_t told = 0;
|
||||
clock_t tnew, ris;
|
||||
|
||||
tnew = clock();
|
||||
|
||||
ris = tnew - told;
|
||||
|
||||
told = tnew;
|
||||
|
||||
return (ris / (float) CLOCKS_PER_SEC);
|
||||
}
|
||||
|
||||
static void
|
||||
calcposobs(void)
|
||||
{
|
||||
@@ -95,6 +81,13 @@ calcposobs(void)
|
||||
dir[2] = cos(alpha * M_PI / 180.0) * sin(beta * M_PI / 180.0);
|
||||
dir[1] = cos(beta * M_PI / 180.0);
|
||||
|
||||
if (dir[0] < 1.0e-5 && dir[0] > -1.0e-5)
|
||||
dir[0] = 0;
|
||||
if (dir[1] < 1.0e-5 && dir[1] > -1.0e-5)
|
||||
dir[1] = 0;
|
||||
if (dir[2] < 1.0e-5 && dir[2] > -1.0e-5)
|
||||
dir[2] = 0;
|
||||
|
||||
alpha1 = alpha + FOV / 2.0;
|
||||
v1[0] = sin(alpha1 * M_PI / 180.0);
|
||||
v1[1] = cos(alpha1 * M_PI / 180.0);
|
||||
@@ -360,9 +353,7 @@ dojoy(void)
|
||||
static void
|
||||
drawscene(void)
|
||||
{
|
||||
static int count = 0;
|
||||
static char frbuf[80];
|
||||
float fr;
|
||||
static char frbuf[80] = "";
|
||||
|
||||
dojoy();
|
||||
|
||||
@@ -391,11 +382,6 @@ drawscene(void)
|
||||
drawterrain();
|
||||
glPopMatrix();
|
||||
|
||||
if ((count % FRAME) == 0) {
|
||||
fr = gettime();
|
||||
sprintf(frbuf, "Frame rate: %.3f", FRAME / fr);
|
||||
}
|
||||
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
glDisable(GL_FOG);
|
||||
@@ -424,7 +410,17 @@ drawscene(void)
|
||||
|
||||
glutSwapBuffers();
|
||||
|
||||
count++;
|
||||
Frames++;
|
||||
{
|
||||
GLint t = glutGet(GLUT_ELAPSED_TIME);
|
||||
if (t - T0 >= 2000) {
|
||||
GLfloat seconds = (t - T0) / 1000.0;
|
||||
GLfloat fps = Frames / seconds;
|
||||
sprintf(frbuf, "Frame rate: %f", fps);
|
||||
T0 = t;
|
||||
Frames = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -558,7 +554,7 @@ loadpic(void)
|
||||
GLenum gluerr;
|
||||
|
||||
if ((FilePic = fopen("terrain.dat", "r")) == NULL) {
|
||||
fprintf(stderr, "Error loading Mnt.bin\n");
|
||||
fprintf(stderr, "Error loading terrain.dat\n");
|
||||
exit(-1);
|
||||
}
|
||||
fread(bufferter, 256 * 256, 1, FilePic);
|
||||
|
||||
1
progs/demos/terrain.dat
Normal file
1
progs/demos/terrain.dat
Normal file
File diff suppressed because one or more lines are too long
@@ -1,331 +1,410 @@
|
||||
/* $Id: tessdemo.c,v 1.8 2000/07/11 14:11:58 brianp Exp $ */
|
||||
/* $Id: tessdemo.c,v 1.11 2001/03/21 02:47:32 gareth Exp $ */
|
||||
|
||||
/*
|
||||
* A demo of the GLU polygon tesselation functions written by Bogdan Sikorski.
|
||||
* Updated for GLU 1.3 tessellation by Gareth Hughes <gareth@valinux.com>
|
||||
*/
|
||||
|
||||
|
||||
#include <GL/glut.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#define MAX_POINTS 200
|
||||
#define MAX_CONTOURS 50
|
||||
#define MAX_POINTS 256
|
||||
#define MAX_CONTOURS 32
|
||||
#define MAX_TRIANGLES 256
|
||||
|
||||
static int menu;
|
||||
typedef enum
|
||||
{ QUIT, TESSELATE, CLEAR }
|
||||
menu_entries;
|
||||
#ifndef GLCALLBACK
|
||||
#ifdef CALLBACK
|
||||
#define GLCALLBACK CALLBACK
|
||||
#else
|
||||
#define GLCALLBACK
|
||||
#endif
|
||||
#endif
|
||||
|
||||
typedef enum
|
||||
{ DEFINE, TESSELATED }
|
||||
mode_type;
|
||||
#ifdef GLU_VERSION_1_2
|
||||
|
||||
struct
|
||||
typedef enum{ QUIT, TESSELATE, CLEAR } menu_entries;
|
||||
typedef enum{ DEFINE, TESSELATED } mode_type;
|
||||
|
||||
static GLsizei width, height;
|
||||
static GLuint contour_cnt;
|
||||
static GLuint triangle_cnt;
|
||||
|
||||
static mode_type mode;
|
||||
static int menu;
|
||||
|
||||
static GLuint list_start;
|
||||
|
||||
static GLfloat edge_color[3];
|
||||
|
||||
static struct {
|
||||
GLfloat p[MAX_POINTS][2];
|
||||
GLuint point_cnt;
|
||||
} contours[MAX_CONTOURS];
|
||||
|
||||
static struct {
|
||||
GLsizei no;
|
||||
GLfloat p[3][2];
|
||||
GLclampf color[3][3];
|
||||
} triangles[MAX_TRIANGLES];
|
||||
|
||||
|
||||
|
||||
static void GLCALLBACK error_callback( GLenum err )
|
||||
{
|
||||
GLint p[MAX_POINTS][2];
|
||||
GLuint point_cnt;
|
||||
}
|
||||
contours[MAX_CONTOURS];
|
||||
int len, i;
|
||||
char const *str;
|
||||
|
||||
static GLuint contour_cnt;
|
||||
static GLsizei width, height;
|
||||
static mode_type mode;
|
||||
glColor3f( 0.9, 0.9, 0.9 );
|
||||
glRasterPos2i( 5, 5 );
|
||||
|
||||
struct
|
||||
{
|
||||
GLsizei no;
|
||||
GLfloat color[3];
|
||||
GLint p[3][2];
|
||||
GLclampf p_color[3][3];
|
||||
}
|
||||
triangle;
|
||||
str = (const char *) gluErrorString( err );
|
||||
len = strlen( str );
|
||||
|
||||
|
||||
static void GLCALLBACK
|
||||
my_error(GLenum err)
|
||||
{
|
||||
int len, i;
|
||||
char const *str;
|
||||
|
||||
glColor3f(0.9, 0.9, 0.9);
|
||||
glRasterPos2i(5, 5);
|
||||
str = (const char *) gluErrorString(err);
|
||||
len = strlen(str);
|
||||
for (i = 0; i < len; i++)
|
||||
glutBitmapCharacter(GLUT_BITMAP_9_BY_15, str[i]);
|
||||
}
|
||||
|
||||
|
||||
static void GLCALLBACK
|
||||
begin_callback(GLenum mode)
|
||||
{
|
||||
triangle.no = 0;
|
||||
}
|
||||
|
||||
|
||||
static void GLCALLBACK
|
||||
edge_callback(GLenum flag)
|
||||
{
|
||||
if (flag == GL_TRUE) {
|
||||
triangle.color[0] = 1.0;
|
||||
triangle.color[1] = 1.0;
|
||||
triangle.color[2] = 0.5;
|
||||
}
|
||||
else {
|
||||
triangle.color[0] = 1.0;
|
||||
triangle.color[1] = 0.0;
|
||||
triangle.color[2] = 0.0;
|
||||
for ( i = 0 ; i < len ; i++ ) {
|
||||
glutBitmapCharacter( GLUT_BITMAP_9_BY_15, str[i] );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void GLCALLBACK
|
||||
end_callback()
|
||||
static void GLCALLBACK begin_callback( GLenum mode )
|
||||
{
|
||||
glBegin(GL_LINES);
|
||||
glColor3f(triangle.p_color[0][0], triangle.p_color[0][1],
|
||||
triangle.p_color[0][2]);
|
||||
glVertex2i(triangle.p[0][0], triangle.p[0][1]);
|
||||
glVertex2i(triangle.p[1][0], triangle.p[1][1]);
|
||||
glColor3f(triangle.p_color[1][0], triangle.p_color[1][1],
|
||||
triangle.p_color[1][2]);
|
||||
glVertex2i(triangle.p[1][0], triangle.p[1][1]);
|
||||
glVertex2i(triangle.p[2][0], triangle.p[2][1]);
|
||||
glColor3f(triangle.p_color[2][0], triangle.p_color[2][1],
|
||||
triangle.p_color[2][2]);
|
||||
glVertex2i(triangle.p[2][0], triangle.p[2][1]);
|
||||
glVertex2i(triangle.p[0][0], triangle.p[0][1]);
|
||||
/* Allow multiple triangles to be output inside the begin/end pair. */
|
||||
triangle_cnt = 0;
|
||||
triangles[triangle_cnt].no = 0;
|
||||
}
|
||||
|
||||
static void GLCALLBACK edge_callback( GLenum flag )
|
||||
{
|
||||
/* Persist the edge flag across triangles. */
|
||||
if ( flag == GL_TRUE ) {
|
||||
edge_color[0] = 1.0;
|
||||
edge_color[1] = 1.0;
|
||||
edge_color[2] = 0.5;
|
||||
} else {
|
||||
edge_color[0] = 1.0;
|
||||
edge_color[1] = 0.0;
|
||||
edge_color[2] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
static void GLCALLBACK end_callback()
|
||||
{
|
||||
GLint i;
|
||||
|
||||
glBegin( GL_LINES );
|
||||
|
||||
/* Output the three edges of each triangle as lines colored
|
||||
according to their edge flag. */
|
||||
for ( i = 0 ; i < triangle_cnt ; i++ ) {
|
||||
glColor3f( triangles[i].color[0][0],
|
||||
triangles[i].color[0][1],
|
||||
triangles[i].color[0][2] );
|
||||
|
||||
glVertex2f( triangles[i].p[0][0], triangles[i].p[0][1] );
|
||||
glVertex2f( triangles[i].p[1][0], triangles[i].p[1][1] );
|
||||
|
||||
glColor3f( triangles[i].color[1][0],
|
||||
triangles[i].color[1][1],
|
||||
triangles[i].color[1][2] );
|
||||
|
||||
glVertex2f( triangles[i].p[1][0], triangles[i].p[1][1] );
|
||||
glVertex2f( triangles[i].p[2][0], triangles[i].p[2][1] );
|
||||
|
||||
glColor3f( triangles[i].color[2][0],
|
||||
triangles[i].color[2][1],
|
||||
triangles[i].color[2][2] );
|
||||
|
||||
glVertex2f( triangles[i].p[2][0], triangles[i].p[2][1] );
|
||||
glVertex2f( triangles[i].p[0][0], triangles[i].p[0][1] );
|
||||
}
|
||||
|
||||
glEnd();
|
||||
}
|
||||
|
||||
|
||||
static void GLCALLBACK
|
||||
vertex_callback(void *data)
|
||||
static void GLCALLBACK vertex_callback( void *data )
|
||||
{
|
||||
GLsizei no;
|
||||
GLint *p;
|
||||
GLsizei no;
|
||||
GLfloat *p;
|
||||
|
||||
p = (GLint *) data;
|
||||
no = triangle.no;
|
||||
triangle.p[no][0] = p[0];
|
||||
triangle.p[no][1] = p[1];
|
||||
triangle.p_color[no][0] = triangle.color[0];
|
||||
triangle.p_color[no][1] = triangle.color[1];
|
||||
triangle.p_color[no][2] = triangle.color[2];
|
||||
++(triangle.no);
|
||||
p = (GLfloat *) data;
|
||||
no = triangles[triangle_cnt].no;
|
||||
|
||||
triangles[triangle_cnt].p[no][0] = p[0];
|
||||
triangles[triangle_cnt].p[no][1] = p[1];
|
||||
|
||||
triangles[triangle_cnt].color[no][0] = edge_color[0];
|
||||
triangles[triangle_cnt].color[no][1] = edge_color[1];
|
||||
triangles[triangle_cnt].color[no][2] = edge_color[2];
|
||||
|
||||
/* After every three vertices, initialize the next triangle. */
|
||||
if ( ++(triangles[triangle_cnt].no) == 3 ) {
|
||||
triangle_cnt++;
|
||||
triangles[triangle_cnt].no = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void GLCALLBACK combine_callback( GLdouble coords[3],
|
||||
GLdouble *vertex_data[4],
|
||||
GLfloat weight[4], void **data )
|
||||
{
|
||||
GLfloat *vertex;
|
||||
|
||||
vertex = (GLfloat *) malloc( 2 * sizeof(GLfloat) );
|
||||
|
||||
vertex[0] = (GLfloat) coords[0];
|
||||
vertex[1] = (GLfloat) coords[1];
|
||||
|
||||
*data = vertex;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
set_screen_wh(GLsizei w, GLsizei h)
|
||||
static void set_screen_wh( GLsizei w, GLsizei h )
|
||||
{
|
||||
width = w;
|
||||
height = h;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
tesse(void)
|
||||
static void tesse( void )
|
||||
{
|
||||
GLUtriangulatorObj *tobj;
|
||||
GLdouble data[3];
|
||||
GLuint i, j, point_cnt;
|
||||
GLUtesselator *tobj;
|
||||
GLdouble data[3];
|
||||
GLuint i, j, point_cnt;
|
||||
|
||||
list_start = glGenLists( 2 );
|
||||
|
||||
tobj = gluNewTess();
|
||||
if (tobj != NULL) {
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
glColor3f(0.7, 0.7, 0.0);
|
||||
gluTessCallback(tobj, GLU_BEGIN, glBegin);
|
||||
gluTessCallback(tobj, GLU_END, glEnd);
|
||||
gluTessCallback(tobj, GLU_ERROR, my_error);
|
||||
gluTessCallback(tobj, GLU_VERTEX, glVertex2iv);
|
||||
gluBeginPolygon(tobj);
|
||||
for (j = 0; j <= contour_cnt; j++) {
|
||||
|
||||
if ( tobj != NULL ) {
|
||||
gluTessNormal( tobj, 0.0, 0.0, 1.0 );
|
||||
gluTessCallback( tobj, GLU_TESS_BEGIN, glBegin );
|
||||
gluTessCallback( tobj, GLU_TESS_VERTEX, glVertex2fv );
|
||||
gluTessCallback( tobj, GLU_TESS_END, glEnd );
|
||||
gluTessCallback( tobj, GLU_TESS_ERROR, error_callback );
|
||||
gluTessCallback( tobj, GLU_TESS_COMBINE, combine_callback );
|
||||
|
||||
glNewList( list_start, GL_COMPILE );
|
||||
gluBeginPolygon( tobj );
|
||||
|
||||
for ( j = 0 ; j <= contour_cnt ; j++ ) {
|
||||
point_cnt = contours[j].point_cnt;
|
||||
gluNextContour(tobj, GLU_UNKNOWN);
|
||||
for (i = 0; i < point_cnt; i++) {
|
||||
data[0] = (GLdouble) (contours[j].p[i][0]);
|
||||
data[1] = (GLdouble) (contours[j].p[i][1]);
|
||||
gluNextContour( tobj, GLU_UNKNOWN );
|
||||
|
||||
for ( i = 0 ; i < point_cnt ; i++ ) {
|
||||
data[0] = (GLdouble)( contours[j].p[i][0] );
|
||||
data[1] = (GLdouble)( contours[j].p[i][1] );
|
||||
data[2] = 0.0;
|
||||
gluTessVertex(tobj, data, contours[j].p[i]);
|
||||
gluTessVertex( tobj, data, contours[j].p[i] );
|
||||
}
|
||||
}
|
||||
gluEndPolygon(tobj);
|
||||
glLineWidth(2.0);
|
||||
gluTessCallback(tobj, GLU_BEGIN, begin_callback);
|
||||
gluTessCallback(tobj, GLU_END, end_callback);
|
||||
gluTessCallback(tobj, GLU_VERTEX, vertex_callback);
|
||||
gluTessCallback(tobj, GLU_EDGE_FLAG, edge_callback);
|
||||
gluBeginPolygon(tobj);
|
||||
for (j = 0; j <= contour_cnt; j++) {
|
||||
|
||||
gluEndPolygon( tobj );
|
||||
glEndList();
|
||||
|
||||
gluTessCallback( tobj, GLU_TESS_BEGIN, begin_callback );
|
||||
gluTessCallback( tobj, GLU_TESS_VERTEX, vertex_callback );
|
||||
gluTessCallback( tobj, GLU_TESS_END, end_callback );
|
||||
gluTessCallback( tobj, GLU_TESS_EDGE_FLAG, edge_callback );
|
||||
|
||||
glNewList( list_start + 1, GL_COMPILE );
|
||||
gluBeginPolygon( tobj );
|
||||
|
||||
for ( j = 0 ; j <= contour_cnt ; j++ ) {
|
||||
point_cnt = contours[j].point_cnt;
|
||||
gluNextContour(tobj, GLU_UNKNOWN);
|
||||
for (i = 0; i < point_cnt; i++) {
|
||||
data[0] = (GLdouble) (contours[j].p[i][0]);
|
||||
data[1] = (GLdouble) (contours[j].p[i][1]);
|
||||
gluNextContour( tobj, GLU_UNKNOWN );
|
||||
|
||||
for ( i = 0 ; i < point_cnt ; i++ ) {
|
||||
data[0] = (GLdouble)( contours[j].p[i][0] );
|
||||
data[1] = (GLdouble)( contours[j].p[i][1] );
|
||||
data[2] = 0.0;
|
||||
gluTessVertex(tobj, data, contours[j].p[i]);
|
||||
gluTessVertex( tobj, data, contours[j].p[i] );
|
||||
}
|
||||
}
|
||||
gluEndPolygon(tobj);
|
||||
gluDeleteTess(tobj);
|
||||
glutMouseFunc(NULL);
|
||||
glColor3f(1.0, 1.0, 0.0);
|
||||
glLineWidth(1.0);
|
||||
|
||||
gluEndPolygon( tobj );
|
||||
glEndList();
|
||||
|
||||
gluDeleteTess( tobj );
|
||||
|
||||
glutMouseFunc( NULL );
|
||||
mode = TESSELATED;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
left_down(int x1, int y1)
|
||||
static void left_down( int x1, int y1 )
|
||||
{
|
||||
GLint P[2];
|
||||
GLuint point_cnt;
|
||||
GLfloat P[2];
|
||||
GLuint point_cnt;
|
||||
|
||||
/* translate GLUT into GL coordinates */
|
||||
|
||||
P[0] = x1;
|
||||
P[1] = height - y1;
|
||||
|
||||
point_cnt = contours[contour_cnt].point_cnt;
|
||||
|
||||
contours[contour_cnt].p[point_cnt][0] = P[0];
|
||||
contours[contour_cnt].p[point_cnt][1] = P[1];
|
||||
glBegin(GL_LINES);
|
||||
if (point_cnt) {
|
||||
glVertex2iv(contours[contour_cnt].p[point_cnt - 1]);
|
||||
glVertex2iv(P);
|
||||
}
|
||||
else {
|
||||
glVertex2iv(P);
|
||||
glVertex2iv(P);
|
||||
|
||||
glBegin( GL_LINES );
|
||||
|
||||
if ( point_cnt ) {
|
||||
glVertex2fv( contours[contour_cnt].p[point_cnt-1] );
|
||||
glVertex2fv( P );
|
||||
} else {
|
||||
glVertex2fv( P );
|
||||
glVertex2fv( P );
|
||||
}
|
||||
|
||||
glEnd();
|
||||
glFinish();
|
||||
++(contours[contour_cnt].point_cnt);
|
||||
|
||||
contours[contour_cnt].point_cnt++;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
middle_down(int x1, int y1)
|
||||
static void middle_down( int x1, int y1 )
|
||||
{
|
||||
GLuint point_cnt;
|
||||
GLuint point_cnt;
|
||||
(void) x1;
|
||||
(void) y1;
|
||||
|
||||
point_cnt = contours[contour_cnt].point_cnt;
|
||||
if (point_cnt > 2) {
|
||||
glBegin(GL_LINES);
|
||||
glVertex2iv(contours[contour_cnt].p[0]);
|
||||
glVertex2iv(contours[contour_cnt].p[point_cnt - 1]);
|
||||
|
||||
if ( point_cnt > 2 ) {
|
||||
glBegin( GL_LINES );
|
||||
|
||||
glVertex2fv( contours[contour_cnt].p[0] );
|
||||
glVertex2fv( contours[contour_cnt].p[point_cnt-1] );
|
||||
|
||||
contours[contour_cnt].p[point_cnt][0] = -1;
|
||||
|
||||
glEnd();
|
||||
glFinish();
|
||||
|
||||
contour_cnt++;
|
||||
contours[contour_cnt].point_cnt = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
mouse_clicked(int button, int state, int x, int y)
|
||||
static void mouse_clicked( int button, int state, int x, int y )
|
||||
{
|
||||
x -= x % 10;
|
||||
y -= y % 10;
|
||||
switch (button) {
|
||||
x -= x%10;
|
||||
y -= y%10;
|
||||
|
||||
switch ( button ) {
|
||||
case GLUT_LEFT_BUTTON:
|
||||
if (state == GLUT_DOWN)
|
||||
left_down(x, y);
|
||||
if ( state == GLUT_DOWN ) {
|
||||
left_down( x, y );
|
||||
}
|
||||
break;
|
||||
case GLUT_MIDDLE_BUTTON:
|
||||
if (state == GLUT_DOWN)
|
||||
middle_down(x, y);
|
||||
if ( state == GLUT_DOWN ) {
|
||||
middle_down( x, y );
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
display(void)
|
||||
static void display( void )
|
||||
{
|
||||
GLuint i, j;
|
||||
GLuint i,j;
|
||||
GLuint point_cnt;
|
||||
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
switch (mode) {
|
||||
glClear( GL_COLOR_BUFFER_BIT );
|
||||
|
||||
switch ( mode ) {
|
||||
case DEFINE:
|
||||
/* draw grid */
|
||||
glColor3f(0.6, 0.5, 0.5);
|
||||
glBegin(GL_LINES);
|
||||
for (i = 0; i < width; i += 10)
|
||||
for (j = 0; j < height; j += 10) {
|
||||
glVertex2i(0, j);
|
||||
glVertex2i(width, j);
|
||||
glVertex2i(i, height);
|
||||
glVertex2i(i, 0);
|
||||
glColor3f( 0.6, 0.5, 0.5 );
|
||||
|
||||
glBegin( GL_LINES );
|
||||
|
||||
for ( i = 0 ; i < width ; i += 10 ) {
|
||||
for ( j = 0 ; j < height ; j += 10 ) {
|
||||
glVertex2i( 0, j );
|
||||
glVertex2i( width, j );
|
||||
glVertex2i( i, height );
|
||||
glVertex2i( i, 0 );
|
||||
}
|
||||
}
|
||||
|
||||
glEnd();
|
||||
glColor3f(1.0, 1.0, 0.0);
|
||||
for (i = 0; i <= contour_cnt; i++) {
|
||||
|
||||
glColor3f( 1.0, 1.0, 0.0 );
|
||||
|
||||
for ( i = 0 ; i <= contour_cnt ; i++ ) {
|
||||
point_cnt = contours[i].point_cnt;
|
||||
glBegin(GL_LINES);
|
||||
switch (point_cnt) {
|
||||
|
||||
glBegin( GL_LINES );
|
||||
|
||||
switch ( point_cnt ) {
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
glVertex2iv(contours[i].p[0]);
|
||||
glVertex2iv(contours[i].p[0]);
|
||||
glVertex2fv( contours[i].p[0] );
|
||||
glVertex2fv( contours[i].p[0] );
|
||||
break;
|
||||
case 2:
|
||||
glVertex2iv(contours[i].p[0]);
|
||||
glVertex2iv(contours[i].p[1]);
|
||||
glVertex2fv( contours[i].p[0] );
|
||||
glVertex2fv( contours[i].p[1] );
|
||||
break;
|
||||
default:
|
||||
--point_cnt;
|
||||
for (j = 0; j < point_cnt; j++) {
|
||||
glVertex2iv(contours[i].p[j]);
|
||||
glVertex2iv(contours[i].p[j + 1]);
|
||||
for ( j = 0 ; j < point_cnt ; j++ ) {
|
||||
glVertex2fv( contours[i].p[j] );
|
||||
glVertex2fv( contours[i].p[j+1] );
|
||||
}
|
||||
if (contours[i].p[j + 1][0] == -1) {
|
||||
glVertex2iv(contours[i].p[0]);
|
||||
glVertex2iv(contours[i].p[j]);
|
||||
if ( contours[i].p[j+1][0] == -1 ) {
|
||||
glVertex2fv( contours[i].p[0] );
|
||||
glVertex2fv( contours[i].p[j] );
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
glEnd();
|
||||
}
|
||||
|
||||
glFinish();
|
||||
break;
|
||||
|
||||
case TESSELATED:
|
||||
/* draw lines */
|
||||
tesse();
|
||||
/* draw triangles */
|
||||
glColor3f( 0.7, 0.7, 0.0 );
|
||||
glCallList( list_start );
|
||||
|
||||
glLineWidth( 2.0 );
|
||||
glCallList( list_start + 1 );
|
||||
glLineWidth( 1.0 );
|
||||
|
||||
glFlush();
|
||||
break;
|
||||
}
|
||||
|
||||
glColor3f(1.0, 1.0, 0.0);
|
||||
glColor3f( 1.0, 1.0, 0.0 );
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
clear(void)
|
||||
static void clear( void )
|
||||
{
|
||||
contour_cnt = 0;
|
||||
contours[0].point_cnt = 0;
|
||||
glutMouseFunc(mouse_clicked);
|
||||
triangle_cnt = 0;
|
||||
|
||||
glutMouseFunc( mouse_clicked );
|
||||
|
||||
mode = DEFINE;
|
||||
display();
|
||||
|
||||
glDeleteLists( list_start, 2 );
|
||||
list_start = 0;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
quit(void)
|
||||
static void quit( void )
|
||||
{
|
||||
exit(0);
|
||||
exit( 0 );
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
menu_selected(int entry)
|
||||
static void menu_selected( int entry )
|
||||
{
|
||||
switch (entry) {
|
||||
switch ( entry ) {
|
||||
case CLEAR:
|
||||
clear();
|
||||
break;
|
||||
@@ -336,87 +415,107 @@ menu_selected(int entry)
|
||||
quit();
|
||||
break;
|
||||
}
|
||||
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
key_pressed(unsigned char key, int x, int y)
|
||||
static void key_pressed( unsigned char key, int x, int y )
|
||||
{
|
||||
switch (key) {
|
||||
case 't':
|
||||
case 'T':
|
||||
tesse();
|
||||
glFinish();
|
||||
break;
|
||||
case 'q':
|
||||
case 'Q':
|
||||
quit();
|
||||
break;
|
||||
(void) x;
|
||||
(void) y;
|
||||
|
||||
switch ( key ) {
|
||||
case 'c':
|
||||
case 'C':
|
||||
clear();
|
||||
break;
|
||||
case 't':
|
||||
case 'T':
|
||||
tesse();
|
||||
break;
|
||||
case 27:
|
||||
case 'q':
|
||||
case 'Q':
|
||||
quit();
|
||||
break;
|
||||
}
|
||||
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
myinit(void)
|
||||
static void myinit( void )
|
||||
{
|
||||
/* clear background to gray */
|
||||
glClearColor(0.4, 0.4, 0.4, 0.0);
|
||||
glShadeModel(GL_FLAT);
|
||||
/* clear background to gray */
|
||||
glClearColor( 0.4, 0.4, 0.4, 0.0 );
|
||||
glShadeModel( GL_FLAT );
|
||||
glPolygonMode( GL_FRONT, GL_FILL );
|
||||
|
||||
menu = glutCreateMenu( menu_selected );
|
||||
|
||||
glutAddMenuEntry( "clear", CLEAR );
|
||||
glutAddMenuEntry( "tesselate", TESSELATE );
|
||||
glutAddMenuEntry( "quit", QUIT );
|
||||
|
||||
glutAttachMenu( GLUT_RIGHT_BUTTON );
|
||||
|
||||
glutMouseFunc( mouse_clicked );
|
||||
glutKeyboardFunc( key_pressed );
|
||||
|
||||
menu = glutCreateMenu(menu_selected);
|
||||
glutAddMenuEntry("clear", CLEAR);
|
||||
glutAddMenuEntry("tesselate", TESSELATE);
|
||||
glutAddMenuEntry("quit", QUIT);
|
||||
glutAttachMenu(GLUT_RIGHT_BUTTON);
|
||||
glutMouseFunc(mouse_clicked);
|
||||
glutKeyboardFunc(key_pressed);
|
||||
contour_cnt = 0;
|
||||
glPolygonMode(GL_FRONT, GL_FILL);
|
||||
mode = DEFINE;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
reshape(GLsizei w, GLsizei h)
|
||||
static void reshape( GLsizei w, GLsizei h )
|
||||
{
|
||||
glViewport(0, 0, w, h);
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glViewport( 0, 0, w, h );
|
||||
|
||||
glMatrixMode( GL_PROJECTION );
|
||||
glLoadIdentity();
|
||||
glOrtho(0.0, (GLdouble) w, 0.0, (GLdouble) h, -1.0, 1.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glOrtho( 0.0, (GLdouble)w, 0.0, (GLdouble)h, -1.0, 1.0 );
|
||||
|
||||
glMatrixMode( GL_MODELVIEW );
|
||||
glLoadIdentity();
|
||||
set_screen_wh(w, h);
|
||||
|
||||
set_screen_wh( w, h );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
static void usage( void )
|
||||
{
|
||||
printf( "Use left mouse button to place vertices.\n" );
|
||||
printf( "Press middle mouse button when done.\n" );
|
||||
printf( "Select tesselate from the pop-up menu.\n" );
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
usage(void)
|
||||
int main( int argc, char **argv )
|
||||
{
|
||||
printf("Use left mouse button to place vertices.\n");
|
||||
printf("Press middle mouse button when done.\n");
|
||||
printf("Select tesselate from the pop-up menu.\n");
|
||||
}
|
||||
const char *version = (const char *) gluGetString( GLU_VERSION );
|
||||
printf( "GLU version string: %s\n", version );
|
||||
if ( strstr( version, "1.0" ) || strstr( version, "1.1" ) ) {
|
||||
fprintf( stderr, "Sorry, this demo reqiures GLU 1.2 or later.\n" );
|
||||
exit( 1 );
|
||||
}
|
||||
|
||||
|
||||
/* Main Loop
|
||||
* Open window with initial window size, title bar,
|
||||
* RGBA display mode, and handle input events.
|
||||
*/
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
usage();
|
||||
glutInit(&argc, argv);
|
||||
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
|
||||
glutInitWindowSize(400, 400);
|
||||
glutCreateWindow(argv[0]);
|
||||
|
||||
glutInit( &argc, argv );
|
||||
glutInitDisplayMode( GLUT_SINGLE | GLUT_RGB );
|
||||
glutInitWindowSize( 400, 400 );
|
||||
glutCreateWindow( argv[0] );
|
||||
|
||||
/* GH: Bit of a hack...
|
||||
*/
|
||||
#ifdef GLU_VERSION_1_2
|
||||
myinit();
|
||||
glutDisplayFunc(display);
|
||||
glutReshapeFunc(reshape);
|
||||
|
||||
glutDisplayFunc( display );
|
||||
glutReshapeFunc( reshape );
|
||||
|
||||
glutMainLoop();
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: texcyl.c,v 1.2 1999/10/21 16:39:06 brianp Exp $ */
|
||||
/* $Id: texcyl.c,v 1.5 2001/03/27 17:35:26 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Textured cylinder demo: lighting, texturing, reflection mapping.
|
||||
@@ -12,6 +12,38 @@
|
||||
|
||||
/*
|
||||
* $Log: texcyl.c,v $
|
||||
* Revision 1.5 2001/03/27 17:35:26 brianp
|
||||
* set initial window pos
|
||||
*
|
||||
* Revision 1.4 2000/12/24 22:53:54 pesco
|
||||
* * demos/Makefile.am (INCLUDES): Added -I$(top_srcdir)/util.
|
||||
* * demos/Makefile.X11, demos/Makefile.BeOS-R4, demos/Makefile.cygnus:
|
||||
* Essentially the same.
|
||||
* Program files updated to include "readtex.c", not "../util/readtex.c".
|
||||
* * demos/reflect.c: Likewise for "showbuffer.c".
|
||||
*
|
||||
*
|
||||
* * Makefile.am (EXTRA_DIST): Added top-level regular files.
|
||||
*
|
||||
* * include/GL/Makefile.am (INC_X11): Added glxext.h.
|
||||
*
|
||||
*
|
||||
* * src/GGI/include/ggi/mesa/Makefile.am (EXTRA_HEADERS): Include
|
||||
* Mesa GGI headers in dist even if HAVE_GGI is not given.
|
||||
*
|
||||
* * configure.in: Look for GLUT and demo source dirs in $srcdir.
|
||||
*
|
||||
* * src/swrast/Makefile.am (libMesaSwrast_la_SOURCES): Set to *.[ch].
|
||||
* More source list updates in various Makefile.am's.
|
||||
*
|
||||
* * Makefile.am (dist-hook): Remove CVS directory from distribution.
|
||||
* (DIST_SUBDIRS): List all possible subdirs here.
|
||||
* (SUBDIRS): Only list subdirs selected for build again.
|
||||
* The above two applied to all subdir Makefile.am's also.
|
||||
*
|
||||
* Revision 1.3 2000/09/29 23:09:39 brianp
|
||||
* added fps output
|
||||
*
|
||||
* Revision 1.2 1999/10/21 16:39:06 brianp
|
||||
* added -info command line option
|
||||
*
|
||||
@@ -38,7 +70,7 @@
|
||||
#include <math.h>
|
||||
#include <GL/glut.h>
|
||||
|
||||
#include "../util/readtex.c" /* I know, this is a hack. */
|
||||
#include "readtex.c" /* I know, this is a hack. */
|
||||
|
||||
#define TEXTURE_FILE "../images/reflect.rgb"
|
||||
|
||||
@@ -56,6 +88,10 @@ static GLboolean Animate = GL_TRUE;
|
||||
static GLfloat Xrot = 0.0, Yrot = 0.0, Zrot = 0.0;
|
||||
static GLfloat DXrot = 1.0, DYrot = 2.5;
|
||||
|
||||
/* performance info */
|
||||
static GLint T0 = 0;
|
||||
static GLint Frames = 0;
|
||||
|
||||
|
||||
static void Idle( void )
|
||||
{
|
||||
@@ -81,6 +117,18 @@ static void Display( void )
|
||||
glPopMatrix();
|
||||
|
||||
glutSwapBuffers();
|
||||
|
||||
if (Animate) {
|
||||
GLint t = glutGet(GLUT_ELAPSED_TIME);
|
||||
Frames++;
|
||||
if (t - T0 >= 5000) {
|
||||
GLfloat seconds = (t - T0) / 1000.0;
|
||||
GLfloat fps = Frames / seconds;
|
||||
printf("%d frames in %g seconds = %g FPS\n", Frames, seconds, fps);
|
||||
T0 = t;
|
||||
Frames = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -248,6 +296,7 @@ int main( int argc, char *argv[] )
|
||||
{
|
||||
glutInit( &argc, argv );
|
||||
glutInitWindowSize( 400, 400 );
|
||||
glutInitWindowPosition( 0, 0 );
|
||||
|
||||
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
|
||||
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
/* $Id: texdown.c,v 1.3 2000/03/29 18:02:52 brianp Exp $ */
|
||||
/* $Id: texdown.c,v 1.4 2001/02/07 03:04:58 gareth Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999 Brian Paul All Rights Reserved.
|
||||
*
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is 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 Software.
|
||||
*
|
||||
*
|
||||
* THE SOFTWARE IS 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
|
||||
@@ -148,6 +148,10 @@ MeasureDownloadRate(void)
|
||||
glPixelTransferf(GL_BLUE_BIAS, 0.0);
|
||||
}
|
||||
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
|
||||
count = 0;
|
||||
t0 = glutGet(GLUT_ELAPSED_TIME) * 0.001;
|
||||
do {
|
||||
@@ -163,24 +167,20 @@ MeasureDownloadRate(void)
|
||||
FormatTable[Format].Type, texImage);
|
||||
}
|
||||
|
||||
if (count == 0) {
|
||||
/* draw a tiny polygon to force texture into texram */
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glBegin(GL_TRIANGLES);
|
||||
glTexCoord2f(0, 0); glVertex2f(1, 1);
|
||||
glTexCoord2f(1, 0); glVertex2f(3, 1);
|
||||
glTexCoord2f(0.5, 1); glVertex2f(2, 3);
|
||||
glEnd();
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
}
|
||||
/* draw a tiny polygon to force texture into texram */
|
||||
glBegin(GL_TRIANGLES);
|
||||
glTexCoord2f(0, 0); glVertex2f(1, 1);
|
||||
glTexCoord2f(1, 0); glVertex2f(3, 1);
|
||||
glTexCoord2f(0.5, 1); glVertex2f(2, 3);
|
||||
glEnd();
|
||||
|
||||
t1 = glutGet(GLUT_ELAPSED_TIME) * 0.001;
|
||||
time = t1 - t0;
|
||||
count++;
|
||||
} while (time < 3.0);
|
||||
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
|
||||
printf("w*h=%d count=%d time=%f\n", w*h, count, time);
|
||||
DownloadRate = w * h * count / time;
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ GLfloat *labelInfoColor = labelColor0;
|
||||
GLfloat labelLevelColor0[4] = { 0.8, 0.8, 0.1, 1.0 };
|
||||
GLfloat labelLevelColor1[4] = { 0.0, 0.0, 0.0, 1.0 };
|
||||
|
||||
GLboolean doubleBuffered = GL_FALSE;
|
||||
GLboolean doubleBuffered = GL_TRUE;
|
||||
GLboolean drawBackground = GL_FALSE;
|
||||
GLboolean drawBlended = GL_TRUE;
|
||||
GLboolean drawSmooth = GL_FALSE;
|
||||
@@ -141,7 +141,7 @@ struct formatInfo rgbFormats[] =
|
||||
#define NUM_RGBA_FORMATS (sizeof(rgbaFormats) / sizeof(rgbaFormats[0]))
|
||||
struct formatInfo rgbaFormats[] =
|
||||
{
|
||||
{ GL_RGBA, 4, "RGBA" },
|
||||
{ GL_RGBA, GL_RGBA, "RGBA" },
|
||||
{ GL_RGBA, GL_RGBA2, "RGBA2" },
|
||||
{ GL_RGBA, GL_RGBA4, "RGBA4" },
|
||||
{ GL_RGBA, GL_RGB5_A1, "RGB5_A1" },
|
||||
@@ -208,7 +208,8 @@ static void checkErrors( void )
|
||||
}
|
||||
}
|
||||
|
||||
static void drawString( char *string, GLfloat x, GLfloat y, GLfloat color[4] )
|
||||
static void drawString( const char *string, GLfloat x, GLfloat y,
|
||||
const GLfloat color[4] )
|
||||
{
|
||||
glColor4fv( color );
|
||||
glRasterPos2f( x, y );
|
||||
@@ -219,8 +220,9 @@ static void drawString( char *string, GLfloat x, GLfloat y, GLfloat color[4] )
|
||||
}
|
||||
}
|
||||
|
||||
static void drawStringOutline( char *string, GLfloat x, GLfloat y,
|
||||
GLfloat color[4], GLfloat outline[4] )
|
||||
static void drawStringOutline( const char *string, GLfloat x, GLfloat y,
|
||||
const GLfloat color[4],
|
||||
const GLfloat outline[4] )
|
||||
{
|
||||
drawString( string, x - 1, y, outline );
|
||||
drawString( string, x + 1, y, outline );
|
||||
@@ -335,7 +337,8 @@ reshape( int w, int h )
|
||||
/* No need to call glViewPort here since "draw" calls it! */
|
||||
}
|
||||
|
||||
static void loadTexture( int width, int height, struct formatInfo *format )
|
||||
static void loadTexture( int width, int height,
|
||||
const struct formatInfo *format )
|
||||
{
|
||||
int luminanceSize = 0;
|
||||
int alphaSize = 0;
|
||||
@@ -497,7 +500,8 @@ static void loadTexture( int width, int height, struct formatInfo *format )
|
||||
free( texImage );
|
||||
}
|
||||
|
||||
static void drawCheck( int w, int h, GLfloat lightCheck[4], GLfloat darkCheck[4] )
|
||||
static void drawCheck( int w, int h, const GLfloat lightCheck[4],
|
||||
const GLfloat darkCheck[4] )
|
||||
{
|
||||
float dw = 2.0 / w;
|
||||
float dh = 2.0 / h;
|
||||
@@ -526,8 +530,35 @@ static void drawCheck( int w, int h, GLfloat lightCheck[4], GLfloat darkCheck[4]
|
||||
}
|
||||
}
|
||||
|
||||
static const char *lookupFormat( GLint format )
|
||||
{
|
||||
switch ( format ) {
|
||||
case GL_RGBA:
|
||||
return "GL_RGBA";
|
||||
case GL_RGB:
|
||||
return "GL_RGB";
|
||||
case GL_ALPHA:
|
||||
return "GL_ALPHA";
|
||||
case GL_LUMINANCE:
|
||||
return "GL_LUMINANCE";
|
||||
case GL_LUMINANCE_ALPHA:
|
||||
return "GL_LUMINANCE_ALPHA";
|
||||
case GL_INTENSITY:
|
||||
return "GL_INTENSITY";
|
||||
case GL_COLOR_INDEX:
|
||||
return "GL_COLOR_INDEX";
|
||||
case GL_BGRA:
|
||||
return "GL_BGRA";
|
||||
case GL_BGR:
|
||||
return "GL_BGR";
|
||||
default:
|
||||
return "unknown format";
|
||||
}
|
||||
}
|
||||
|
||||
static void drawSample( int x, int y, int w, int h,
|
||||
struct formatInfo *format, struct envModeInfo *envMode )
|
||||
const struct formatInfo *format,
|
||||
const struct envModeInfo *envMode )
|
||||
{
|
||||
glViewport( x, y, w, h );
|
||||
glScissor( x, y, w, h );
|
||||
@@ -543,8 +574,8 @@ static void drawSample( int x, int y, int w, int h,
|
||||
glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, envMode->mode );
|
||||
glTexEnvfv( GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, envColors[envColor] );
|
||||
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
|
||||
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP );
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP );
|
||||
@@ -561,24 +592,32 @@ static void drawSample( int x, int y, int w, int h,
|
||||
if ( drawSmooth ) {
|
||||
glShadeModel( GL_SMOOTH );
|
||||
}
|
||||
else {
|
||||
glShadeModel( GL_FLAT );
|
||||
glColor4f(1, 1, 1, 1);
|
||||
}
|
||||
if ( drawTextured ) {
|
||||
glEnable( GL_TEXTURE_2D );
|
||||
}
|
||||
|
||||
/*
|
||||
* if (drawSmooth) then draw quad which goes from purple at the
|
||||
* bottom (100% alpha) to green at the top (50% alpha).
|
||||
*/
|
||||
glBegin( GL_QUADS );
|
||||
glColor4f( 1.0, 0.0, 0.0, 1.0 );
|
||||
if ( drawSmooth ) glColor4f( 1.0, 0.0, 1.0, 1.0 );
|
||||
glTexCoord2f( 0.0, 0.0 );
|
||||
glVertex2f( -0.8, -0.8 );
|
||||
|
||||
glColor4f( 0.0, 1.0, 0.0, 1.0 );
|
||||
if ( drawSmooth ) glColor4f( 1.0, 0.0, 1.0, 1.0 );
|
||||
glTexCoord2f( 1.0, 0.0 );
|
||||
glVertex2f( 0.8, -0.8 );
|
||||
|
||||
glColor4f( 0.0, 0.0, 1.0, 1.0 );
|
||||
if ( drawSmooth ) glColor4f( 0.0, 1.0, 0.0, 0.5 );
|
||||
glTexCoord2f( 1.0, 1.0 );
|
||||
glVertex2f( 0.8, 0.8 );
|
||||
|
||||
glColor4f( 1.0, 1.0, 1.0, 1.0 );
|
||||
if ( drawSmooth ) glColor4f( 0.0, 1.0, 0.0, 0.5 );
|
||||
glTexCoord2f( 0.0, 1.0 );
|
||||
glVertex2f( -0.8, 0.8 );
|
||||
glEnd();
|
||||
@@ -587,8 +626,19 @@ static void drawSample( int x, int y, int w, int h,
|
||||
glShadeModel( GL_FLAT );
|
||||
glDisable( GL_TEXTURE_2D );
|
||||
|
||||
if ( displayLevelInfo ) {
|
||||
GLint width, height, border, components;
|
||||
if ( envMode->mode == GL_DECAL &&
|
||||
(format->baseFormat == GL_ALPHA ||
|
||||
format->baseFormat == GL_LUMINANCE ||
|
||||
format->baseFormat == GL_LUMINANCE_ALPHA ||
|
||||
format->baseFormat == GL_INTENSITY)) {
|
||||
/* undefined format/mode combination */
|
||||
begin2D( w, h );
|
||||
drawStringOutline( "UNDEFINED MODE", 15, h / 2,
|
||||
labelLevelColor0, labelLevelColor1 );
|
||||
end2D();
|
||||
}
|
||||
else if ( displayLevelInfo ) {
|
||||
GLint width, height, border, format;
|
||||
GLint redSize, greenSize, blueSize, alphaSize;
|
||||
GLint luminanceSize, intensitySize;
|
||||
char buf[255];
|
||||
@@ -596,7 +646,7 @@ static void drawSample( int x, int y, int w, int h,
|
||||
glGetTexLevelParameteriv( GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &width );
|
||||
glGetTexLevelParameteriv( GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, &height );
|
||||
glGetTexLevelParameteriv( GL_TEXTURE_2D, 0, GL_TEXTURE_BORDER, &border );
|
||||
glGetTexLevelParameteriv( GL_TEXTURE_2D, 0, GL_TEXTURE_COMPONENTS, &components );
|
||||
glGetTexLevelParameteriv( GL_TEXTURE_2D, 0, GL_TEXTURE_INTERNAL_FORMAT, &format );
|
||||
glGetTexLevelParameteriv( GL_TEXTURE_2D, 0, GL_TEXTURE_RED_SIZE, &redSize );
|
||||
glGetTexLevelParameteriv( GL_TEXTURE_2D, 0, GL_TEXTURE_GREEN_SIZE, &greenSize );
|
||||
glGetTexLevelParameteriv( GL_TEXTURE_2D, 0, GL_TEXTURE_BLUE_SIZE, &blueSize );
|
||||
@@ -611,16 +661,19 @@ static void drawSample( int x, int y, int w, int h,
|
||||
sprintf( buf, "border: %d", border );
|
||||
drawStringOutline( buf, 15, h / 2 + 10, labelLevelColor0, labelLevelColor1 );
|
||||
|
||||
sprintf( buf, "components: 0x%04X", components );
|
||||
sprintf( buf, "internal format:" );
|
||||
drawStringOutline( buf, 15, h / 2, labelLevelColor0, labelLevelColor1 );
|
||||
|
||||
sprintf( buf, "sizes:" );
|
||||
sprintf( buf, " %s", lookupFormat( format ) );
|
||||
drawStringOutline( buf, 15, h / 2 - 10, labelLevelColor0, labelLevelColor1 );
|
||||
|
||||
sprintf( buf, "sizes:" );
|
||||
drawStringOutline( buf, 15, h / 2 - 20, labelLevelColor0, labelLevelColor1 );
|
||||
|
||||
sprintf( buf, " %d / %d / %d / %d / %d / %d",
|
||||
redSize, greenSize, blueSize, alphaSize,
|
||||
luminanceSize, intensitySize );
|
||||
drawStringOutline( buf, 15, h / 2 - 20, labelLevelColor0, labelLevelColor1 );
|
||||
drawStringOutline( buf, 15, h / 2 - 30, labelLevelColor0, labelLevelColor1 );
|
||||
|
||||
end2D();
|
||||
}
|
||||
@@ -700,6 +753,8 @@ static void instructions( void )
|
||||
fprintf( stderr, " [s] - toggle smooth shading\n" );
|
||||
fprintf( stderr, " [t] - toggle texturing\n" );
|
||||
fprintf( stderr, " [i] - toggle information display\n" );
|
||||
fprintf( stderr, " up/down - select row\n" );
|
||||
fprintf( stderr, " left/right - change row's internal format\n" );
|
||||
}
|
||||
|
||||
int main( int argc, char *argv[] )
|
||||
@@ -729,6 +784,7 @@ int main( int argc, char *argv[] )
|
||||
}
|
||||
|
||||
glutInitWindowSize( winWidth, winHeight );
|
||||
glutInitWindowPosition( 0, 0 );
|
||||
glutCreateWindow( "Texture Environment Test" );
|
||||
|
||||
initialize();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: trispd.c,v 1.1 1999/08/19 00:55:40 jtg Exp $ */
|
||||
/* $Id: trispd.c,v 1.2 2000/10/26 15:26:14 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Simple GLUT program to measure triangle strip rendering speed.
|
||||
@@ -7,8 +7,11 @@
|
||||
|
||||
/*
|
||||
* $Log: trispd.c,v $
|
||||
* Revision 1.1 1999/08/19 00:55:40 jtg
|
||||
* Initial revision
|
||||
* Revision 1.2 2000/10/26 15:26:14 brianp
|
||||
* added a glFinish() call
|
||||
*
|
||||
* Revision 1.1.1.1 1999/08/19 00:55:40 jtg
|
||||
* Imported sources
|
||||
*
|
||||
* Revision 3.4 1999/03/28 18:24:37 brianp
|
||||
* minor clean-up
|
||||
@@ -107,6 +110,7 @@ static void Display( void )
|
||||
}
|
||||
}
|
||||
}
|
||||
glFinish();
|
||||
t1 = glutGet(GLUT_ELAPSED_TIME) * 0.001;
|
||||
|
||||
if (t1-t0 < MinPeriod) {
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
#endif
|
||||
|
||||
#include <GL/glut.h>
|
||||
#include "../util/readtex.c"
|
||||
#include "tunneldat.c"
|
||||
#include "readtex.c"
|
||||
#include "tunneldat.h"
|
||||
|
||||
#ifdef XMESA
|
||||
#include "GL/xmesa.h"
|
||||
@@ -27,7 +27,9 @@ static int fullscreen = 1;
|
||||
static int WIDTH = 640;
|
||||
static int HEIGHT = 480;
|
||||
|
||||
#define FRAME 50
|
||||
static GLint T0 = 0;
|
||||
static GLint Frames = 0;
|
||||
static GLint NiceFog = 1;
|
||||
|
||||
#define NUMBLOC 5
|
||||
|
||||
@@ -35,6 +37,7 @@ static int HEIGHT = 480;
|
||||
#define M_PI 3.1415926535
|
||||
#endif
|
||||
|
||||
/*
|
||||
extern int striplength_skin_13[];
|
||||
extern float stripdata_skin_13[];
|
||||
|
||||
@@ -46,7 +49,7 @@ extern float stripdata_skin_11[];
|
||||
|
||||
extern int striplength_skin_9[];
|
||||
extern float stripdata_skin_9[];
|
||||
|
||||
*/
|
||||
|
||||
static int win = 0;
|
||||
|
||||
@@ -56,7 +59,7 @@ static float v = 0.5;
|
||||
static float alpha = 90.0;
|
||||
static float beta = 90.0;
|
||||
|
||||
static int fog = 0;
|
||||
static int fog = 1;
|
||||
static int bfcull = 1;
|
||||
static int usetex = 1;
|
||||
static int cstrip = 0;
|
||||
@@ -103,7 +106,7 @@ inittextures(void)
|
||||
}
|
||||
|
||||
static void
|
||||
drawobjs(int *l, float *f)
|
||||
drawobjs(const int *l, const float *f)
|
||||
{
|
||||
int mend, j;
|
||||
|
||||
@@ -154,21 +157,6 @@ drawobjs(int *l, float *f)
|
||||
}
|
||||
}
|
||||
|
||||
static float
|
||||
gettime(void)
|
||||
{
|
||||
static clock_t told = 0;
|
||||
clock_t tnew, ris;
|
||||
|
||||
tnew = clock();
|
||||
|
||||
ris = tnew - told;
|
||||
|
||||
told = tnew;
|
||||
|
||||
return (ris / (float) CLOCKS_PER_SEC);
|
||||
}
|
||||
|
||||
static void
|
||||
calcposobs(void)
|
||||
{
|
||||
@@ -176,6 +164,13 @@ calcposobs(void)
|
||||
dir[1] = cos(alpha * M_PI / 180.0) * sin(beta * M_PI / 180.0);
|
||||
dir[2] = cos(beta * M_PI / 180.0);
|
||||
|
||||
if (dir[0] < 1.0e-5 && dir[0] > -1.0e-5)
|
||||
dir[0] = 0;
|
||||
if (dir[1] < 1.0e-5 && dir[1] > -1.0e-5)
|
||||
dir[1] = 0;
|
||||
if (dir[2] < 1.0e-5 && dir[2] > -1.0e-5)
|
||||
dir[2] = 0;
|
||||
|
||||
obs[0] += v * dir[0];
|
||||
obs[1] += v * dir[1];
|
||||
obs[2] += v * dir[2];
|
||||
@@ -221,7 +216,6 @@ key(unsigned char k, int x, int y)
|
||||
XMesaSetFXmode(fullscreen ? XMESA_FX_FULLSCREEN : XMESA_FX_WINDOW);
|
||||
break;
|
||||
#endif
|
||||
|
||||
case 'j':
|
||||
joyactive = (!joyactive);
|
||||
break;
|
||||
@@ -256,7 +250,12 @@ key(unsigned char k, int x, int y)
|
||||
inittextures();
|
||||
fprintf(stderr, "Done.\n");
|
||||
break;
|
||||
case 'n':
|
||||
NiceFog = !NiceFog;
|
||||
printf("NiceFog %d\n", NiceFog);
|
||||
break;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -366,10 +365,14 @@ dojoy(void)
|
||||
static void
|
||||
draw(void)
|
||||
{
|
||||
static int count = 0;
|
||||
static char frbuf[80];
|
||||
static char frbuf[80] = "";
|
||||
int i;
|
||||
float fr, base, offset;
|
||||
float base, offset;
|
||||
|
||||
if (NiceFog)
|
||||
glHint(GL_FOG_HINT, GL_NICEST);
|
||||
else
|
||||
glHint(GL_FOG_HINT, GL_DONT_CARE);
|
||||
|
||||
dojoy();
|
||||
|
||||
@@ -416,11 +419,6 @@ draw(void)
|
||||
glPopMatrix();
|
||||
glPopMatrix();
|
||||
|
||||
if ((count % FRAME) == 0) {
|
||||
fr = gettime();
|
||||
sprintf(frbuf, "Frame rate: %f", FRAME / fr);
|
||||
}
|
||||
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
glDisable(GL_FOG);
|
||||
glShadeModel(GL_FLAT);
|
||||
@@ -449,9 +447,27 @@ draw(void)
|
||||
|
||||
glutSwapBuffers();
|
||||
|
||||
count++;
|
||||
Frames++;
|
||||
{
|
||||
GLint t = glutGet(GLUT_ELAPSED_TIME);
|
||||
if (t - T0 >= 2000) {
|
||||
GLfloat seconds = (t - T0) / 1000.0;
|
||||
GLfloat fps = Frames / seconds;
|
||||
sprintf(frbuf, "Frame rate: %f", fps);
|
||||
T0 = t;
|
||||
Frames = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
idle(void)
|
||||
{
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
|
||||
int
|
||||
main(int ac, char **av)
|
||||
{
|
||||
@@ -500,7 +516,7 @@ main(int ac, char **av)
|
||||
glutDisplayFunc(draw);
|
||||
glutKeyboardFunc(key);
|
||||
glutSpecialFunc(special);
|
||||
glutIdleFunc(draw);
|
||||
glutIdleFunc(idle);
|
||||
|
||||
glEnable(GL_BLEND);
|
||||
/*glBlendFunc(GL_SRC_ALPHA_SATURATE,GL_ONE); */
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
#endif
|
||||
|
||||
#include <GL/glut.h>
|
||||
#include "../util/readtex.c"
|
||||
#include "tunneldat.c"
|
||||
#include "readtex.c"
|
||||
#include "tunneldat.h"
|
||||
|
||||
#ifdef FX
|
||||
#endif
|
||||
@@ -40,7 +40,8 @@ static int HEIGHTC0 = 480;
|
||||
static int WIDTHC1 = 640;
|
||||
static int HEIGHTC1 = 480;
|
||||
|
||||
#define FRAME 50
|
||||
static GLint T0 = 0;
|
||||
static GLint Frames = 0;
|
||||
|
||||
#define NUMBLOC 5
|
||||
|
||||
@@ -48,19 +49,6 @@ static int HEIGHTC1 = 480;
|
||||
#define M_PI 3.1415926535
|
||||
#endif
|
||||
|
||||
extern int striplength_skin_13[];
|
||||
extern float stripdata_skin_13[];
|
||||
|
||||
extern int striplength_skin_12[];
|
||||
extern float stripdata_skin_12[];
|
||||
|
||||
extern int striplength_skin_11[];
|
||||
extern float stripdata_skin_11[];
|
||||
|
||||
extern int striplength_skin_9[];
|
||||
extern float stripdata_skin_9[];
|
||||
|
||||
|
||||
static float obs[3] = { 1000.0, 0.0, 2.0 };
|
||||
static float dir[3];
|
||||
static float v = 0.5;
|
||||
@@ -116,7 +104,7 @@ inittextures(void)
|
||||
}
|
||||
|
||||
static void
|
||||
drawobjs(int *l, float *f)
|
||||
drawobjs(const int *l, const float *f)
|
||||
{
|
||||
int mend, j;
|
||||
|
||||
@@ -167,21 +155,6 @@ drawobjs(int *l, float *f)
|
||||
}
|
||||
}
|
||||
|
||||
static float
|
||||
gettime(void)
|
||||
{
|
||||
static clock_t told = 0;
|
||||
clock_t tnew, ris;
|
||||
|
||||
tnew = clock();
|
||||
|
||||
ris = tnew - told;
|
||||
|
||||
told = tnew;
|
||||
|
||||
return (ris / (float) CLOCKS_PER_SEC);
|
||||
}
|
||||
|
||||
static void
|
||||
calcposobs(void)
|
||||
{
|
||||
@@ -189,6 +162,13 @@ calcposobs(void)
|
||||
dir[1] = cos(alpha * M_PI / 180.0) * sin(beta * M_PI / 180.0);
|
||||
dir[2] = cos(beta * M_PI / 180.0);
|
||||
|
||||
if (dir[0] < 1.0e-5 && dir[0] > -1.0e-5)
|
||||
dir[0] = 0;
|
||||
if (dir[1] < 1.0e-5 && dir[1] > -1.0e-5)
|
||||
dir[1] = 0;
|
||||
if (dir[2] < 1.0e-5 && dir[2] > -1.0e-5)
|
||||
dir[2] = 0;
|
||||
|
||||
obs[0] += v * dir[0];
|
||||
obs[1] += v * dir[1];
|
||||
obs[2] += v * dir[2];
|
||||
@@ -409,10 +389,9 @@ dojoy(void)
|
||||
static void
|
||||
draw(void)
|
||||
{
|
||||
static int count = 0;
|
||||
static char frbuf[80];
|
||||
static char frbuf[80] = "";
|
||||
int i;
|
||||
float fr, base, offset;
|
||||
float base, offset;
|
||||
|
||||
dojoy();
|
||||
|
||||
@@ -461,11 +440,6 @@ draw(void)
|
||||
glPopMatrix();
|
||||
glPopMatrix();
|
||||
|
||||
if ((count % FRAME) == 0) {
|
||||
fr = gettime();
|
||||
sprintf(frbuf, "Frame rate: %f", FRAME / fr);
|
||||
}
|
||||
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
glDisable(GL_FOG);
|
||||
glShadeModel(GL_FLAT);
|
||||
@@ -492,7 +466,17 @@ draw(void)
|
||||
glPopMatrix();
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
|
||||
count++;
|
||||
Frames++;
|
||||
{
|
||||
GLint t = glutGet(GLUT_ELAPSED_TIME);
|
||||
if (t - T0 >= 2000) {
|
||||
GLfloat seconds = (t - T0) / 1000.0;
|
||||
GLfloat fps = Frames / seconds;
|
||||
sprintf(frbuf, "Frame rate: %f", fps);
|
||||
T0 = t;
|
||||
Frames = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -557,14 +541,12 @@ main(int ac, char **av)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"Tunnel2 V1.0\nWritten by David Bucciarelli (tech.hmw@plus.it)\n");
|
||||
fprintf(stderr,
|
||||
"You need TWO Voodoo Graphics boards in order to run this demo !\n");
|
||||
|
||||
glutInitWindowPosition(0, 0);
|
||||
glutInitWindowSize(WIDTHC0, HEIGHTC0);
|
||||
glutInit(&ac, av);
|
||||
|
||||
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_ALPHA);
|
||||
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
|
||||
|
||||
#ifdef FX
|
||||
if (!fxMesaSelectCurrentBoard(0)) {
|
||||
|
||||
@@ -1,83 +0,0 @@
|
||||
/* Object: skin_13 */
|
||||
|
||||
#if defined(_MSC_VER) && defined(_WIN32)
|
||||
#pragma warning( disable : 4305 ) /* 'initializing' : truncation from 'const double' to 'float' */
|
||||
#endif
|
||||
|
||||
int striplength_skin_13[]={
|
||||
10,7,3,5,5,4,4,4,4,5,3,4,5,4,4,4,4,4,4,6,
|
||||
6,3,6,3,3,3,3,0};
|
||||
|
||||
float stripdata_skin_13[]={
|
||||
0.415686,0.415686,0.415686,1.000000,0.000000,1.500000,2.000000,4.000000,0.000000,0.341176,0.341176,0.341176,1.000000,-0.500000,1.500000,4.000000,4.000000,0.000000,0.545098,0.545098,0.545098,1.000000,0.000000,1.000000,2.000000,4.000000,2.000000,0.435294,0.435294,0.435294,1.000000,-0.500000,1.000000,4.000000,4.000000,2.000000,0.517647,0.517647,0.517647,1.000000,0.000000,0.500000,2.000000,4.000000,4.000000,0.450980,0.450980,0.450980,1.000000,-0.500000,0.500000,4.000000,4.000000,4.000000,0.427451,0.427451,0.427451,1.000000,0.000000,0.000000,2.000000,4.000000,6.000000,0.388235,0.388235,0.388235,1.000000,-0.500000,0.000000,4.000000,4.000000,6.000000,0.356863,0.356863,0.356863,1.000000,0.000000,-0.500000,2.000000,4.000000,8.000000,0.333333,0.333333,0.333333,1.000000,-0.500000,-0.500000,4.000000,4.000000,8.000000,
|
||||
0.435294,0.435294,0.435294,1.000000,1.500000,1.000000,-4.000000,4.000000,2.000000,0.415686,0.415686,0.415686,1.000000,1.000000,1.500000,-2.000000,4.000000,0.000000,0.545098,0.545098,0.545098,1.000000,1.000000,1.000000,-2.000000,4.000000,2.000000,0.450980,0.450980,0.450980,1.000000,0.500000,1.500000,0.000000,4.000000,0.000000,0.600000,0.600000,0.600000,1.000000,0.500000,1.000000,0.000000,4.000000,2.000000,0.415686,0.415686,0.415686,1.000000,0.000000,1.500000,2.000000,4.000000,0.000000,0.545098,0.545098,0.545098,1.000000,0.000000,1.000000,2.000000,4.000000,2.000000,
|
||||
0.435294,0.435294,0.435294,1.000000,1.500000,1.000000,-4.000000,4.000000,2.000000,0.341176,0.341176,0.341176,1.000000,1.500000,1.500000,-4.000000,4.000000,0.000000,0.415686,0.415686,0.415686,1.000000,1.000000,1.500000,-2.000000,4.000000,0.000000,
|
||||
0.356863,0.356863,0.356863,1.000000,0.000000,-0.500000,2.000000,4.000000,8.000000,0.364706,0.364706,0.364706,1.000000,0.500000,-0.500000,0.000000,4.000000,8.000000,0.427451,0.427451,0.427451,1.000000,0.000000,0.000000,2.000000,4.000000,6.000000,0.415686,0.415686,0.415686,1.000000,0.395020,-0.133318,0.420032,4.000000,6.533272,0.423529,0.423529,0.423529,1.000000,0.388550,-0.103582,0.445932,4.000000,6.414327,
|
||||
0.423529,0.423529,0.423529,1.000000,0.388550,-0.103582,0.445932,4.000000,6.414327,0.427451,0.427451,0.427451,1.000000,0.383423,-0.069344,0.466541,4.000000,6.277375,0.427451,0.427451,0.427451,1.000000,0.000000,0.000000,2.000000,4.000000,6.000000,0.435294,0.435294,0.435294,1.000000,0.380371,-0.034595,0.478689,4.000000,6.138380,0.439216,0.439216,0.439216,1.000000,0.379272,0.000000,0.482673,4.000000,6.000000,
|
||||
0.407843,0.407843,0.407843,1.000000,0.414673,-0.191394,0.341301,4.000000,6.765576,0.411765,0.411765,0.411765,1.000000,0.403687,-0.162957,0.385368,4.000000,6.651829,0.364706,0.364706,0.364706,1.000000,0.500000,-0.500000,0.000000,4.000000,8.000000,0.415686,0.415686,0.415686,1.000000,0.395020,-0.133318,0.420032,4.000000,6.533272,
|
||||
0.400000,0.400000,0.400000,1.000000,0.438232,-0.232438,0.247284,4.000000,6.929754,0.403922,0.403922,0.403922,1.000000,0.425171,-0.212276,0.299425,4.000000,6.849104,0.364706,0.364706,0.364706,1.000000,0.500000,-0.500000,0.000000,4.000000,8.000000,0.407843,0.407843,0.407843,1.000000,0.414673,-0.191394,0.341301,4.000000,6.765576,
|
||||
0.396078,0.396078,0.396078,1.000000,0.467285,-0.260554,0.130636,4.000000,7.042214,0.400000,0.400000,0.400000,1.000000,0.453857,-0.250068,0.184711,4.000000,7.000273,0.364706,0.364706,0.364706,1.000000,0.500000,-0.500000,0.000000,4.000000,8.000000,0.400000,0.400000,0.400000,1.000000,0.438232,-0.232438,0.247284,4.000000,6.929754,
|
||||
0.396078,0.396078,0.396078,1.000000,0.500000,-0.270672,0.000000,4.000000,7.082688,0.396078,0.396078,0.396078,1.000000,0.482788,-0.267902,0.068730,4.000000,7.071609,0.364706,0.364706,0.364706,1.000000,0.500000,-0.500000,0.000000,4.000000,8.000000,0.396078,0.396078,0.396078,1.000000,0.467285,-0.260554,0.130636,4.000000,7.042214,
|
||||
0.439216,0.439216,0.439216,1.000000,0.379272,0.000000,0.482673,4.000000,6.000000,0.474510,0.474510,0.474510,1.000000,0.379272,0.180448,0.482673,4.000000,5.278208,0.517647,0.517647,0.517647,1.000000,0.000000,0.500000,2.000000,4.000000,4.000000,0.513726,0.513726,0.513726,1.000000,0.379272,0.360896,0.482673,4.000000,4.556417,0.545098,0.545098,0.545098,1.000000,0.379272,0.500000,0.482673,4.000000,4.000000,
|
||||
0.545098,0.545098,0.545098,1.000000,0.379272,0.500000,0.482673,4.000000,4.000000,0.545098,0.545098,0.545098,1.000000,0.000000,1.000000,2.000000,4.000000,2.000000,0.517647,0.517647,0.517647,1.000000,0.000000,0.500000,2.000000,4.000000,4.000000,
|
||||
0.600000,0.600000,0.600000,1.000000,0.500000,1.000000,0.000000,4.000000,2.000000,0.545098,0.545098,0.545098,1.000000,0.000000,1.000000,2.000000,4.000000,2.000000,0.552941,0.552941,0.552941,1.000000,0.379272,0.541344,0.482673,4.000000,3.834625,0.545098,0.545098,0.545098,1.000000,0.379272,0.500000,0.482673,4.000000,4.000000,
|
||||
0.552941,0.552941,0.552941,1.000000,0.379272,0.541344,0.482673,4.000000,3.834625,0.556863,0.556863,0.556863,1.000000,0.459717,0.541344,0.160891,4.000000,3.834625,0.600000,0.600000,0.600000,1.000000,0.500000,1.000000,0.000000,4.000000,2.000000,0.556863,0.556863,0.556863,1.000000,0.500000,0.541344,0.000000,4.000000,3.834625,0.556863,0.556863,0.556863,1.000000,0.540283,0.541344,-0.160891,4.000000,3.834625,
|
||||
0.396078,0.396078,0.396078,1.000000,0.517212,-0.267902,-0.068730,4.000000,7.071609,0.396078,0.396078,0.396078,1.000000,0.500000,-0.270672,0.000000,4.000000,7.082688,0.356863,0.356863,0.356863,1.000000,1.000000,-0.500000,-2.000000,4.000000,8.000000,0.364706,0.364706,0.364706,1.000000,0.500000,-0.500000,0.000000,4.000000,8.000000,
|
||||
0.400000,0.400000,0.400000,1.000000,0.546143,-0.250068,-0.184711,4.000000,7.000273,0.396078,0.396078,0.396078,1.000000,0.532715,-0.260554,-0.130636,4.000000,7.042214,0.356863,0.356863,0.356863,1.000000,1.000000,-0.500000,-2.000000,4.000000,8.000000,0.396078,0.396078,0.396078,1.000000,0.517212,-0.267902,-0.068730,4.000000,7.071609,
|
||||
0.403922,0.403922,0.403922,1.000000,0.574829,-0.212276,-0.299425,4.000000,6.849104,0.400000,0.400000,0.400000,1.000000,0.561768,-0.232438,-0.247284,4.000000,6.929754,0.356863,0.356863,0.356863,1.000000,1.000000,-0.500000,-2.000000,4.000000,8.000000,0.400000,0.400000,0.400000,1.000000,0.546143,-0.250068,-0.184711,4.000000,7.000273,
|
||||
0.411765,0.411765,0.411765,1.000000,0.596313,-0.162957,-0.385368,4.000000,6.651829,0.407843,0.407843,0.407843,1.000000,0.585327,-0.191394,-0.341301,4.000000,6.765576,0.356863,0.356863,0.356863,1.000000,1.000000,-0.500000,-2.000000,4.000000,8.000000,0.403922,0.403922,0.403922,1.000000,0.574829,-0.212276,-0.299425,4.000000,6.849104,
|
||||
0.423529,0.423529,0.423529,1.000000,0.611450,-0.103582,-0.445931,4.000000,6.414327,0.415686,0.415686,0.415686,1.000000,0.604980,-0.133318,-0.420033,4.000000,6.533272,0.356863,0.356863,0.356863,1.000000,1.000000,-0.500000,-2.000000,4.000000,8.000000,0.411765,0.411765,0.411765,1.000000,0.596313,-0.162957,-0.385368,4.000000,6.651829,
|
||||
0.435294,0.435294,0.435294,1.000000,0.619629,-0.034595,-0.478689,4.000000,6.138380,0.427451,0.427451,0.427451,1.000000,0.616577,-0.069344,-0.466541,4.000000,6.277375,0.356863,0.356863,0.356863,1.000000,1.000000,-0.500000,-2.000000,4.000000,8.000000,0.423529,0.423529,0.423529,1.000000,0.611450,-0.103582,-0.445931,4.000000,6.414327,
|
||||
0.513726,0.513726,0.513726,1.000000,0.620728,0.360896,-0.482673,4.000000,4.556417,0.474510,0.474510,0.474510,1.000000,0.620728,0.180448,-0.482673,4.000000,5.278208,0.427451,0.427451,0.427451,1.000000,1.000000,0.000000,-2.000000,4.000000,6.000000,0.439216,0.439216,0.439216,1.000000,0.620728,0.000000,-0.482673,4.000000,6.000000,0.356863,0.356863,0.356863,1.000000,1.000000,-0.500000,-2.000000,4.000000,8.000000,0.435294,0.435294,0.435294,1.000000,0.619629,-0.034595,-0.478689,4.000000,6.138380,
|
||||
0.333333,0.333333,0.333333,1.000000,1.500000,-0.500000,-4.000000,4.000000,8.000000,0.388235,0.388235,0.388235,1.000000,1.500000,0.000000,-4.000000,4.000000,6.000000,0.427451,0.427451,0.427451,1.000000,1.000000,0.000000,-2.000000,4.000000,6.000000,0.517647,0.517647,0.517647,1.000000,1.000000,0.500000,-2.000000,4.000000,4.000000,0.513726,0.513726,0.513726,1.000000,0.620728,0.360896,-0.482673,4.000000,4.556417,0.545098,0.545098,0.545098,1.000000,0.620728,0.500000,-0.482673,4.000000,4.000000,
|
||||
0.333333,0.333333,0.333333,1.000000,1.500000,-0.500000,-4.000000,4.000000,8.000000,0.427451,0.427451,0.427451,1.000000,1.000000,0.000000,-2.000000,4.000000,6.000000,0.356863,0.356863,0.356863,1.000000,1.000000,-0.500000,-2.000000,4.000000,8.000000,
|
||||
0.556863,0.556863,0.556863,1.000000,0.540283,0.541344,-0.160891,4.000000,3.834625,0.552941,0.552941,0.552941,1.000000,0.620728,0.541344,-0.482673,4.000000,3.834625,0.545098,0.545098,0.545098,1.000000,1.000000,1.000000,-2.000000,4.000000,2.000000,0.517647,0.517647,0.517647,1.000000,1.000000,0.500000,-2.000000,4.000000,4.000000,0.450980,0.450980,0.450980,1.000000,1.500000,0.500000,-4.000000,4.000000,4.000000,0.388235,0.388235,0.388235,1.000000,1.500000,0.000000,-4.000000,4.000000,6.000000,
|
||||
0.517647,0.517647,0.517647,1.000000,1.000000,0.500000,-2.000000,4.000000,4.000000,0.552941,0.552941,0.552941,1.000000,0.620728,0.541344,-0.482673,4.000000,3.834625,0.545098,0.545098,0.545098,1.000000,0.620728,0.500000,-0.482673,4.000000,4.000000,
|
||||
0.450980,0.450980,0.450980,1.000000,1.500000,0.500000,-4.000000,4.000000,4.000000,0.435294,0.435294,0.435294,1.000000,1.500000,1.000000,-4.000000,4.000000,2.000000,0.545098,0.545098,0.545098,1.000000,1.000000,1.000000,-2.000000,4.000000,2.000000,
|
||||
0.439216,0.439216,0.439216,1.000000,0.379272,0.000000,0.482673,4.000000,6.000000,0.517647,0.517647,0.517647,1.000000,0.000000,0.500000,2.000000,4.000000,4.000000,0.427451,0.427451,0.427451,1.000000,0.000000,0.000000,2.000000,4.000000,6.000000,
|
||||
0.556863,0.556863,0.556863,1.000000,0.540283,0.541344,-0.160891,4.000000,3.834625,0.545098,0.545098,0.545098,1.000000,1.000000,1.000000,-2.000000,4.000000,2.000000,0.600000,0.600000,0.600000,1.000000,0.500000,1.000000,0.000000,4.000000,2.000000
|
||||
|
||||
};
|
||||
|
||||
|
||||
/* Object: skin_12 */
|
||||
|
||||
int striplength_skin_12[]={
|
||||
12,12,12,12,12,0};
|
||||
|
||||
float stripdata_skin_12[]={
|
||||
0.498039,0.498039,0.498039,1.000000,-0.099976,1.500000,-2.400000,-4.000000,-0.000002,0.337255,0.337255,0.337255,1.000000,-0.500000,1.500000,-4.000000,-4.000000,-0.000002,0.568627,0.568627,0.568627,1.000000,-0.099976,1.100000,-2.400000,-4.000000,1.599999,0.341176,0.341176,0.341176,1.000000,-0.500000,1.100000,-4.000000,-4.000000,1.599999,0.498039,0.498039,0.498039,1.000000,-0.099976,0.700000,-2.400000,-4.000000,3.200000,0.325490,0.325490,0.325490,1.000000,-0.500000,0.700000,-4.000000,-4.000000,3.199999,0.352941,0.352941,0.352941,1.000000,-0.099976,0.300000,-2.400000,-4.000000,4.800000,0.282353,0.282353,0.282353,1.000000,-0.500000,0.300000,-4.000000,-4.000000,4.800000,0.282353,0.282353,0.282353,1.000000,-0.099976,-0.100000,-2.400000,-4.000000,6.400001,0.254902,0.254902,0.254902,1.000000,-0.500000,-0.100000,-4.000000,-4.000000,6.400000,0.239216,0.239216,0.239216,1.000000,-0.099976,-0.500000,-2.400000,-4.000000,8.000000,0.227451,0.227451,0.227451,1.000000,-0.500000,-0.500000,-4.000000,-4.000000,8.000000,
|
||||
0.239216,0.239216,0.239216,1.000000,1.099976,-0.500000,2.400001,-4.000000,8.000000,0.227451,0.227451,0.227451,1.000000,1.500000,-0.500000,4.000002,-4.000000,8.000000,0.282353,0.282353,0.282353,1.000000,1.099976,-0.100000,2.400001,-4.000000,6.400001,0.254902,0.254902,0.254902,1.000000,1.500000,-0.100000,4.000002,-4.000000,6.400001,0.352941,0.352941,0.352941,1.000000,1.099976,0.300000,2.400002,-4.000000,4.800001,0.282353,0.282353,0.282353,1.000000,1.500000,0.300000,4.000002,-4.000000,4.800001,0.498039,0.498039,0.498039,1.000000,1.099976,0.700000,2.400002,-4.000000,3.200000,0.321569,0.321569,0.321569,1.000000,1.500000,0.700000,4.000003,-4.000000,3.200000,0.568627,0.568627,0.568627,1.000000,1.099976,1.100000,2.400002,-4.000000,1.599999,0.341176,0.341176,0.341176,1.000000,1.500000,1.100000,4.000003,-4.000000,1.599999,0.494118,0.494118,0.494118,1.000000,1.099976,1.500000,2.400003,-4.000000,-0.000002,0.337255,0.337255,0.337255,1.000000,1.500000,1.500000,4.000004,-4.000000,-0.000002,
|
||||
0.639216,0.639216,0.639216,1.000000,0.300049,1.500000,-0.799999,-4.000000,-0.000002,0.498039,0.498039,0.498039,1.000000,-0.099976,1.500000,-2.400000,-4.000000,-0.000002,0.858824,0.858824,0.858824,1.000000,0.300049,1.100000,-0.799999,-4.000000,1.599999,0.568627,0.568627,0.568627,1.000000,-0.099976,1.100000,-2.400000,-4.000000,1.599999,0.686275,0.686275,0.686275,1.000000,0.300049,0.700000,-0.799999,-4.000000,3.200000,0.498039,0.498039,0.498039,1.000000,-0.099976,0.700000,-2.400000,-4.000000,3.200000,0.419608,0.419608,0.419608,1.000000,0.300049,0.300000,-0.800000,-4.000000,4.800000,0.352941,0.352941,0.352941,1.000000,-0.099976,0.300000,-2.400000,-4.000000,4.800000,0.298039,0.298039,0.298039,1.000000,0.300049,-0.100000,-0.800000,-4.000000,6.400001,0.282353,0.282353,0.282353,1.000000,-0.099976,-0.100000,-2.400000,-4.000000,6.400001,0.247059,0.247059,0.247059,1.000000,0.300049,-0.500000,-0.800000,-4.000000,8.000000,0.239216,0.239216,0.239216,1.000000,-0.099976,-0.500000,-2.400000,-4.000000,8.000000,
|
||||
0.639216,0.639216,0.639216,1.000000,0.699951,1.500000,0.800002,-4.000000,-0.000002,0.639216,0.639216,0.639216,1.000000,0.300049,1.500000,-0.799999,-4.000000,-0.000002,0.858824,0.858824,0.858824,1.000000,0.699951,1.100000,0.800001,-4.000000,1.599999,0.858824,0.858824,0.858824,1.000000,0.300049,1.100000,-0.799999,-4.000000,1.599999,0.686275,0.686275,0.686275,1.000000,0.699951,0.700000,0.800001,-4.000000,3.200000,0.686275,0.686275,0.686275,1.000000,0.300049,0.700000,-0.799999,-4.000000,3.200000,0.419608,0.419608,0.419608,1.000000,0.699951,0.300000,0.800001,-4.000000,4.800001,0.419608,0.419608,0.419608,1.000000,0.300049,0.300000,-0.800000,-4.000000,4.800000,0.298039,0.298039,0.298039,1.000000,0.699951,-0.100000,0.800001,-4.000000,6.400001,0.298039,0.298039,0.298039,1.000000,0.300049,-0.100000,-0.800000,-4.000000,6.400001,0.247059,0.247059,0.247059,1.000000,0.699951,-0.500000,0.800000,-4.000000,8.000000,0.247059,0.247059,0.247059,1.000000,0.300049,-0.500000,-0.800000,-4.000000,8.000000,
|
||||
0.494118,0.494118,0.494118,1.000000,1.099976,1.500000,2.400003,-4.000000,-0.000002,0.639216,0.639216,0.639216,1.000000,0.699951,1.500000,0.800002,-4.000000,-0.000002,0.568627,0.568627,0.568627,1.000000,1.099976,1.100000,2.400002,-4.000000,1.599999,0.858824,0.858824,0.858824,1.000000,0.699951,1.100000,0.800001,-4.000000,1.599999,0.498039,0.498039,0.498039,1.000000,1.099976,0.700000,2.400002,-4.000000,3.200000,0.686275,0.686275,0.686275,1.000000,0.699951,0.700000,0.800001,-4.000000,3.200000,0.352941,0.352941,0.352941,1.000000,1.099976,0.300000,2.400002,-4.000000,4.800001,0.419608,0.419608,0.419608,1.000000,0.699951,0.300000,0.800001,-4.000000,4.800001,0.282353,0.282353,0.282353,1.000000,1.099976,-0.100000,2.400001,-4.000000,6.400001,0.298039,0.298039,0.298039,1.000000,0.699951,-0.100000,0.800001,-4.000000,6.400001,0.239216,0.239216,0.239216,1.000000,1.099976,-0.500000,2.400001,-4.000000,8.000000,0.247059,0.247059,0.247059,1.000000,0.699951,-0.500000,0.800000,-4.000000,8.000000
|
||||
|
||||
};
|
||||
|
||||
|
||||
/* Object: skin_11 */
|
||||
|
||||
int striplength_skin_11[]={
|
||||
12,12,12,12,12,0};
|
||||
|
||||
float stripdata_skin_11[]={
|
||||
0.145098,0.145098,0.145098,1.000000,-0.099976,1.500000,-2.400000,4.000002,0.000000,0.141176,0.141176,0.141176,1.000000,-0.500000,1.500000,-4.000000,4.000002,0.000000,0.176471,0.176471,0.176471,1.000000,-0.099976,1.100000,-2.400000,2.400001,0.000000,0.145098,0.145098,0.145098,1.000000,-0.500000,1.100000,-4.000000,2.400001,0.000000,0.341176,0.341176,0.341176,1.000000,-0.099976,0.700000,-2.400000,0.800000,0.000000,0.188235,0.188235,0.188235,1.000000,-0.500000,0.700000,-4.000000,0.800000,0.000000,0.450980,0.450980,0.450980,1.000000,-0.099976,0.300000,-2.400000,-0.800000,0.000000,0.247059,0.247059,0.247059,1.000000,-0.500000,0.300000,-4.000000,-0.800000,0.000000,0.439216,0.439216,0.439216,1.000000,-0.099976,-0.100000,-2.400000,-2.400000,0.000000,0.270588,0.270588,0.270588,1.000000,-0.500000,-0.100000,-4.000000,-2.400000,0.000000,0.364706,0.364706,0.364706,1.000000,-0.099976,-0.500000,-2.400000,-4.000000,0.000000,0.258824,0.258824,0.258824,1.000000,-0.500000,-0.500000,-4.000000,-4.000000,0.000000,
|
||||
0.364706,0.364706,0.364706,1.000000,1.099976,-0.500000,2.400001,-4.000000,0.000000,0.258824,0.258824,0.258824,1.000000,1.500000,-0.500000,4.000002,-4.000000,0.000000,0.439216,0.439216,0.439216,1.000000,1.099976,-0.100000,2.400001,-2.400001,0.000000,0.270588,0.270588,0.270588,1.000000,1.500000,-0.100000,4.000002,-2.400001,0.000000,0.454902,0.454902,0.454902,1.000000,1.099976,0.300000,2.400002,-0.800000,0.000000,0.247059,0.247059,0.247059,1.000000,1.500000,0.300000,4.000002,-0.800000,0.000000,0.341176,0.341176,0.341176,1.000000,1.099976,0.700000,2.400002,0.800000,0.000000,0.184314,0.184314,0.184314,1.000000,1.500000,0.700000,4.000003,0.800000,0.000000,0.176471,0.176471,0.176471,1.000000,1.099976,1.100000,2.400002,2.400001,0.000000,0.145098,0.145098,0.145098,1.000000,1.500000,1.100000,4.000003,2.400001,0.000000,0.145098,0.145098,0.145098,1.000000,1.099976,1.500000,2.400003,4.000003,0.000000,0.141176,0.141176,0.141176,1.000000,1.500000,1.500000,4.000004,4.000002,0.000000,
|
||||
0.145098,0.145098,0.145098,1.000000,0.300049,1.500000,-0.799999,4.000002,0.000000,0.145098,0.145098,0.145098,1.000000,-0.099976,1.500000,-2.400000,4.000002,0.000000,0.262745,0.262745,0.262745,1.000000,0.300049,1.100000,-0.799999,2.400001,0.000000,0.176471,0.176471,0.176471,1.000000,-0.099976,1.100000,-2.400000,2.400001,0.000000,0.580392,0.580392,0.580392,1.000000,0.300049,0.700000,-0.799999,0.800000,0.000000,0.341176,0.341176,0.341176,1.000000,-0.099976,0.700000,-2.400000,0.800000,0.000000,0.709804,0.709804,0.709804,1.000000,0.300049,0.300000,-0.800000,-0.800000,0.000000,0.450980,0.450980,0.450980,1.000000,-0.099976,0.300000,-2.400000,-0.800000,0.000000,0.627451,0.627451,0.627451,1.000000,0.300049,-0.100000,-0.800000,-2.400001,0.000000,0.439216,0.439216,0.439216,1.000000,-0.099976,-0.100000,-2.400000,-2.400000,0.000000,0.458824,0.458824,0.458824,1.000000,0.300049,-0.500000,-0.800000,-4.000000,0.000000,0.364706,0.364706,0.364706,1.000000,-0.099976,-0.500000,-2.400000,-4.000000,0.000000,
|
||||
0.145098,0.145098,0.145098,1.000000,0.699951,1.500000,0.800002,4.000002,0.000000,0.145098,0.145098,0.145098,1.000000,0.300049,1.500000,-0.799999,4.000002,0.000000,0.262745,0.262745,0.262745,1.000000,0.699951,1.100000,0.800001,2.400001,0.000000,0.262745,0.262745,0.262745,1.000000,0.300049,1.100000,-0.799999,2.400001,0.000000,0.580392,0.580392,0.580392,1.000000,0.699951,0.700000,0.800001,0.800000,0.000000,0.580392,0.580392,0.580392,1.000000,0.300049,0.700000,-0.799999,0.800000,0.000000,0.713726,0.713726,0.713726,1.000000,0.699951,0.300000,0.800001,-0.800000,0.000000,0.709804,0.709804,0.709804,1.000000,0.300049,0.300000,-0.800000,-0.800000,0.000000,0.631373,0.631373,0.631373,1.000000,0.699951,-0.100000,0.800001,-2.400001,0.000000,0.627451,0.627451,0.627451,1.000000,0.300049,-0.100000,-0.800000,-2.400001,0.000000,0.458824,0.458824,0.458824,1.000000,0.699951,-0.500000,0.800000,-4.000000,0.000000,0.458824,0.458824,0.458824,1.000000,0.300049,-0.500000,-0.800000,-4.000000,0.000000,
|
||||
0.145098,0.145098,0.145098,1.000000,1.099976,1.500000,2.400003,4.000003,0.000000,0.145098,0.145098,0.145098,1.000000,0.699951,1.500000,0.800002,4.000002,0.000000,0.176471,0.176471,0.176471,1.000000,1.099976,1.100000,2.400002,2.400001,0.000000,0.262745,0.262745,0.262745,1.000000,0.699951,1.100000,0.800001,2.400001,0.000000,0.341176,0.341176,0.341176,1.000000,1.099976,0.700000,2.400002,0.800000,0.000000,0.580392,0.580392,0.580392,1.000000,0.699951,0.700000,0.800001,0.800000,0.000000,0.454902,0.454902,0.454902,1.000000,1.099976,0.300000,2.400002,-0.800000,0.000000,0.713726,0.713726,0.713726,1.000000,0.699951,0.300000,0.800001,-0.800000,0.000000,0.439216,0.439216,0.439216,1.000000,1.099976,-0.100000,2.400001,-2.400001,0.000000,0.631373,0.631373,0.631373,1.000000,0.699951,-0.100000,0.800001,-2.400001,0.000000,0.364706,0.364706,0.364706,1.000000,1.099976,-0.500000,2.400001,-4.000000,0.000000,0.458824,0.458824,0.458824,1.000000,0.699951,-0.500000,0.800000,-4.000000,0.000000
|
||||
|
||||
};
|
||||
|
||||
|
||||
/* Object: skin_9 */
|
||||
|
||||
int striplength_skin_9[]={
|
||||
18,0};
|
||||
|
||||
float stripdata_skin_9[]={
|
||||
0.384314,0.384314,0.384314,1.000000,-0.500000,1.500000,-4.000000,4.000000,8.000000,0.384314,0.384314,0.384314,1.000000,1.500000,1.500000,4.000000,4.000000,8.000000,0.376471,0.376471,0.376471,1.000000,-0.500000,1.250000,-4.000000,3.695518,9.530733,0.403922,0.403922,0.403922,1.000000,1.500000,1.250000,4.000000,3.695518,9.530733,0.415686,0.415686,0.415686,1.000000,-0.500000,1.000000,-4.000000,2.828427,10.828427,0.431373,0.431373,0.431373,1.000000,1.500000,1.000000,4.000000,2.828427,10.828427,0.435294,0.435294,0.435294,1.000000,-0.500000,0.750000,-4.000000,1.530734,11.695518,0.443137,0.443137,0.443137,1.000000,1.500000,0.750000,4.000000,1.530734,11.695518,0.439216,0.439216,0.439216,1.000000,-0.500000,0.500000,-4.000000,0.000000,12.000000,0.435294,0.435294,0.435294,1.000000,1.500000,0.500000,4.000000,0.000000,12.000000,0.427451,0.427451,0.427451,1.000000,-0.500000,0.250000,-4.000000,-1.530734,11.695518,0.411765,0.411765,0.411765,1.000000,1.500000,0.250000,4.000000,-1.530734,11.695518,0.396078,0.396078,0.396078,1.000000,-0.500000,0.000000,-4.000000,-2.828427,10.828427,0.368627,0.368627,0.368627,1.000000,1.500000,0.000000,4.000000,-2.828427,10.828427,0.341176,0.341176,0.341176,1.000000,-0.500000,-0.250000,-4.000000,-3.695518,9.530733,0.301961,0.301961,0.301961,1.000000,1.500000,-0.250000,4.000000,-3.695518,9.530733,0.294118,0.294118,0.294118,1.000000,-0.500000,-0.500000,-4.000000,-4.000000,8.000000,0.294118,0.294118,0.294118,1.000000,1.500000,-0.500000,4.000000,-4.000000,8.000000
|
||||
|
||||
};
|
||||
|
||||
|
||||
395
progs/demos/tunneldat.h
Normal file
395
progs/demos/tunneldat.h
Normal file
@@ -0,0 +1,395 @@
|
||||
/* Object: skin_13 */
|
||||
|
||||
#if defined(_MSC_VER) && defined(_WIN32)
|
||||
#pragma warning( disable : 4305 ) /* 'initializing' : truncation from 'const double' to 'float' */
|
||||
#endif
|
||||
|
||||
static const int striplength_skin_13[] = {
|
||||
10, 7, 3, 5, 5, 4, 4, 4, 4, 5, 3, 4, 5, 4, 4, 4, 4, 4, 4, 6,
|
||||
6, 3, 6, 3, 3, 3, 3, 0
|
||||
};
|
||||
|
||||
static const float stripdata_skin_13[] = {
|
||||
0.415686, 0.415686, 0.415686, 1.000000, 0.000000, 1.500000, 2.000000,
|
||||
4.000000, 0.000000, 0.341176, 0.341176, 0.341176, 1.000000, -0.500000,
|
||||
1.500000, 4.000000, 4.000000, 0.000000, 0.545098, 0.545098, 0.545098,
|
||||
1.000000, 0.000000, 1.000000, 2.000000, 4.000000, 2.000000, 0.435294,
|
||||
0.435294, 0.435294, 1.000000, -0.500000, 1.000000, 4.000000, 4.000000,
|
||||
2.000000, 0.517647, 0.517647, 0.517647, 1.000000, 0.000000, 0.500000,
|
||||
2.000000, 4.000000, 4.000000, 0.450980, 0.450980, 0.450980, 1.000000,
|
||||
-0.500000, 0.500000, 4.000000, 4.000000, 4.000000, 0.427451, 0.427451,
|
||||
0.427451, 1.000000, 0.000000, 0.000000, 2.000000, 4.000000, 6.000000,
|
||||
0.388235, 0.388235, 0.388235, 1.000000, -0.500000, 0.000000, 4.000000,
|
||||
4.000000, 6.000000, 0.356863, 0.356863, 0.356863, 1.000000, 0.000000,
|
||||
-0.500000, 2.000000, 4.000000, 8.000000, 0.333333, 0.333333, 0.333333,
|
||||
1.000000, -0.500000, -0.500000, 4.000000, 4.000000, 8.000000,
|
||||
0.435294, 0.435294, 0.435294, 1.000000, 1.500000, 1.000000, -4.000000,
|
||||
4.000000, 2.000000, 0.415686, 0.415686, 0.415686, 1.000000, 1.000000,
|
||||
1.500000, -2.000000, 4.000000, 0.000000, 0.545098, 0.545098, 0.545098,
|
||||
1.000000, 1.000000, 1.000000, -2.000000, 4.000000, 2.000000, 0.450980,
|
||||
0.450980, 0.450980, 1.000000, 0.500000, 1.500000, 0.000000, 4.000000,
|
||||
0.000000, 0.600000, 0.600000, 0.600000, 1.000000, 0.500000, 1.000000,
|
||||
0.000000, 4.000000, 2.000000, 0.415686, 0.415686, 0.415686, 1.000000,
|
||||
0.000000, 1.500000, 2.000000, 4.000000, 0.000000, 0.545098, 0.545098,
|
||||
0.545098, 1.000000, 0.000000, 1.000000, 2.000000, 4.000000, 2.000000,
|
||||
0.435294, 0.435294, 0.435294, 1.000000, 1.500000, 1.000000, -4.000000,
|
||||
4.000000, 2.000000, 0.341176, 0.341176, 0.341176, 1.000000, 1.500000,
|
||||
1.500000, -4.000000, 4.000000, 0.000000, 0.415686, 0.415686, 0.415686,
|
||||
1.000000, 1.000000, 1.500000, -2.000000, 4.000000, 0.000000,
|
||||
0.356863, 0.356863, 0.356863, 1.000000, 0.000000, -0.500000, 2.000000,
|
||||
4.000000, 8.000000, 0.364706, 0.364706, 0.364706, 1.000000, 0.500000,
|
||||
-0.500000, 0.000000, 4.000000, 8.000000, 0.427451, 0.427451, 0.427451,
|
||||
1.000000, 0.000000, 0.000000, 2.000000, 4.000000, 6.000000, 0.415686,
|
||||
0.415686, 0.415686, 1.000000, 0.395020, -0.133318, 0.420032, 4.000000,
|
||||
6.533272, 0.423529, 0.423529, 0.423529, 1.000000, 0.388550, -0.103582,
|
||||
0.445932, 4.000000, 6.414327,
|
||||
0.423529, 0.423529, 0.423529, 1.000000, 0.388550, -0.103582, 0.445932,
|
||||
4.000000, 6.414327, 0.427451, 0.427451, 0.427451, 1.000000, 0.383423,
|
||||
-0.069344, 0.466541, 4.000000, 6.277375, 0.427451, 0.427451, 0.427451,
|
||||
1.000000, 0.000000, 0.000000, 2.000000, 4.000000, 6.000000, 0.435294,
|
||||
0.435294, 0.435294, 1.000000, 0.380371, -0.034595, 0.478689, 4.000000,
|
||||
6.138380, 0.439216, 0.439216, 0.439216, 1.000000, 0.379272, 0.000000,
|
||||
0.482673, 4.000000, 6.000000,
|
||||
0.407843, 0.407843, 0.407843, 1.000000, 0.414673, -0.191394, 0.341301,
|
||||
4.000000, 6.765576, 0.411765, 0.411765, 0.411765, 1.000000, 0.403687,
|
||||
-0.162957, 0.385368, 4.000000, 6.651829, 0.364706, 0.364706, 0.364706,
|
||||
1.000000, 0.500000, -0.500000, 0.000000, 4.000000, 8.000000, 0.415686,
|
||||
0.415686, 0.415686, 1.000000, 0.395020, -0.133318, 0.420032, 4.000000,
|
||||
6.533272,
|
||||
0.400000, 0.400000, 0.400000, 1.000000, 0.438232, -0.232438, 0.247284,
|
||||
4.000000, 6.929754, 0.403922, 0.403922, 0.403922, 1.000000, 0.425171,
|
||||
-0.212276, 0.299425, 4.000000, 6.849104, 0.364706, 0.364706, 0.364706,
|
||||
1.000000, 0.500000, -0.500000, 0.000000, 4.000000, 8.000000, 0.407843,
|
||||
0.407843, 0.407843, 1.000000, 0.414673, -0.191394, 0.341301, 4.000000,
|
||||
6.765576,
|
||||
0.396078, 0.396078, 0.396078, 1.000000, 0.467285, -0.260554, 0.130636,
|
||||
4.000000, 7.042214, 0.400000, 0.400000, 0.400000, 1.000000, 0.453857,
|
||||
-0.250068, 0.184711, 4.000000, 7.000273, 0.364706, 0.364706, 0.364706,
|
||||
1.000000, 0.500000, -0.500000, 0.000000, 4.000000, 8.000000, 0.400000,
|
||||
0.400000, 0.400000, 1.000000, 0.438232, -0.232438, 0.247284, 4.000000,
|
||||
6.929754,
|
||||
0.396078, 0.396078, 0.396078, 1.000000, 0.500000, -0.270672, 0.000000,
|
||||
4.000000, 7.082688, 0.396078, 0.396078, 0.396078, 1.000000, 0.482788,
|
||||
-0.267902, 0.068730, 4.000000, 7.071609, 0.364706, 0.364706, 0.364706,
|
||||
1.000000, 0.500000, -0.500000, 0.000000, 4.000000, 8.000000, 0.396078,
|
||||
0.396078, 0.396078, 1.000000, 0.467285, -0.260554, 0.130636, 4.000000,
|
||||
7.042214,
|
||||
0.439216, 0.439216, 0.439216, 1.000000, 0.379272, 0.000000, 0.482673,
|
||||
4.000000, 6.000000, 0.474510, 0.474510, 0.474510, 1.000000, 0.379272,
|
||||
0.180448, 0.482673, 4.000000, 5.278208, 0.517647, 0.517647, 0.517647,
|
||||
1.000000, 0.000000, 0.500000, 2.000000, 4.000000, 4.000000, 0.513726,
|
||||
0.513726, 0.513726, 1.000000, 0.379272, 0.360896, 0.482673, 4.000000,
|
||||
4.556417, 0.545098, 0.545098, 0.545098, 1.000000, 0.379272, 0.500000,
|
||||
0.482673, 4.000000, 4.000000,
|
||||
0.545098, 0.545098, 0.545098, 1.000000, 0.379272, 0.500000, 0.482673,
|
||||
4.000000, 4.000000, 0.545098, 0.545098, 0.545098, 1.000000, 0.000000,
|
||||
1.000000, 2.000000, 4.000000, 2.000000, 0.517647, 0.517647, 0.517647,
|
||||
1.000000, 0.000000, 0.500000, 2.000000, 4.000000, 4.000000,
|
||||
0.600000, 0.600000, 0.600000, 1.000000, 0.500000, 1.000000, 0.000000,
|
||||
4.000000, 2.000000, 0.545098, 0.545098, 0.545098, 1.000000, 0.000000,
|
||||
1.000000, 2.000000, 4.000000, 2.000000, 0.552941, 0.552941, 0.552941,
|
||||
1.000000, 0.379272, 0.541344, 0.482673, 4.000000, 3.834625, 0.545098,
|
||||
0.545098, 0.545098, 1.000000, 0.379272, 0.500000, 0.482673, 4.000000,
|
||||
4.000000,
|
||||
0.552941, 0.552941, 0.552941, 1.000000, 0.379272, 0.541344, 0.482673,
|
||||
4.000000, 3.834625, 0.556863, 0.556863, 0.556863, 1.000000, 0.459717,
|
||||
0.541344, 0.160891, 4.000000, 3.834625, 0.600000, 0.600000, 0.600000,
|
||||
1.000000, 0.500000, 1.000000, 0.000000, 4.000000, 2.000000, 0.556863,
|
||||
0.556863, 0.556863, 1.000000, 0.500000, 0.541344, 0.000000, 4.000000,
|
||||
3.834625, 0.556863, 0.556863, 0.556863, 1.000000, 0.540283, 0.541344,
|
||||
-0.160891, 4.000000, 3.834625,
|
||||
0.396078, 0.396078, 0.396078, 1.000000, 0.517212, -0.267902, -0.068730,
|
||||
4.000000, 7.071609, 0.396078, 0.396078, 0.396078, 1.000000, 0.500000,
|
||||
-0.270672, 0.000000, 4.000000, 7.082688, 0.356863, 0.356863, 0.356863,
|
||||
1.000000, 1.000000, -0.500000, -2.000000, 4.000000, 8.000000, 0.364706,
|
||||
0.364706, 0.364706, 1.000000, 0.500000, -0.500000, 0.000000, 4.000000,
|
||||
8.000000,
|
||||
0.400000, 0.400000, 0.400000, 1.000000, 0.546143, -0.250068, -0.184711,
|
||||
4.000000, 7.000273, 0.396078, 0.396078, 0.396078, 1.000000, 0.532715,
|
||||
-0.260554, -0.130636, 4.000000, 7.042214, 0.356863, 0.356863, 0.356863,
|
||||
1.000000, 1.000000, -0.500000, -2.000000, 4.000000, 8.000000, 0.396078,
|
||||
0.396078, 0.396078, 1.000000, 0.517212, -0.267902, -0.068730, 4.000000,
|
||||
7.071609,
|
||||
0.403922, 0.403922, 0.403922, 1.000000, 0.574829, -0.212276, -0.299425,
|
||||
4.000000, 6.849104, 0.400000, 0.400000, 0.400000, 1.000000, 0.561768,
|
||||
-0.232438, -0.247284, 4.000000, 6.929754, 0.356863, 0.356863, 0.356863,
|
||||
1.000000, 1.000000, -0.500000, -2.000000, 4.000000, 8.000000, 0.400000,
|
||||
0.400000, 0.400000, 1.000000, 0.546143, -0.250068, -0.184711, 4.000000,
|
||||
7.000273,
|
||||
0.411765, 0.411765, 0.411765, 1.000000, 0.596313, -0.162957, -0.385368,
|
||||
4.000000, 6.651829, 0.407843, 0.407843, 0.407843, 1.000000, 0.585327,
|
||||
-0.191394, -0.341301, 4.000000, 6.765576, 0.356863, 0.356863, 0.356863,
|
||||
1.000000, 1.000000, -0.500000, -2.000000, 4.000000, 8.000000, 0.403922,
|
||||
0.403922, 0.403922, 1.000000, 0.574829, -0.212276, -0.299425, 4.000000,
|
||||
6.849104,
|
||||
0.423529, 0.423529, 0.423529, 1.000000, 0.611450, -0.103582, -0.445931,
|
||||
4.000000, 6.414327, 0.415686, 0.415686, 0.415686, 1.000000, 0.604980,
|
||||
-0.133318, -0.420033, 4.000000, 6.533272, 0.356863, 0.356863, 0.356863,
|
||||
1.000000, 1.000000, -0.500000, -2.000000, 4.000000, 8.000000, 0.411765,
|
||||
0.411765, 0.411765, 1.000000, 0.596313, -0.162957, -0.385368, 4.000000,
|
||||
6.651829,
|
||||
0.435294, 0.435294, 0.435294, 1.000000, 0.619629, -0.034595, -0.478689,
|
||||
4.000000, 6.138380, 0.427451, 0.427451, 0.427451, 1.000000, 0.616577,
|
||||
-0.069344, -0.466541, 4.000000, 6.277375, 0.356863, 0.356863, 0.356863,
|
||||
1.000000, 1.000000, -0.500000, -2.000000, 4.000000, 8.000000, 0.423529,
|
||||
0.423529, 0.423529, 1.000000, 0.611450, -0.103582, -0.445931, 4.000000,
|
||||
6.414327,
|
||||
0.513726, 0.513726, 0.513726, 1.000000, 0.620728, 0.360896, -0.482673,
|
||||
4.000000, 4.556417, 0.474510, 0.474510, 0.474510, 1.000000, 0.620728,
|
||||
0.180448, -0.482673, 4.000000, 5.278208, 0.427451, 0.427451, 0.427451,
|
||||
1.000000, 1.000000, 0.000000, -2.000000, 4.000000, 6.000000, 0.439216,
|
||||
0.439216, 0.439216, 1.000000, 0.620728, 0.000000, -0.482673, 4.000000,
|
||||
6.000000, 0.356863, 0.356863, 0.356863, 1.000000, 1.000000, -0.500000,
|
||||
-2.000000, 4.000000, 8.000000, 0.435294, 0.435294, 0.435294, 1.000000,
|
||||
0.619629, -0.034595, -0.478689, 4.000000, 6.138380,
|
||||
0.333333, 0.333333, 0.333333, 1.000000, 1.500000, -0.500000, -4.000000,
|
||||
4.000000, 8.000000, 0.388235, 0.388235, 0.388235, 1.000000, 1.500000,
|
||||
0.000000, -4.000000, 4.000000, 6.000000, 0.427451, 0.427451, 0.427451,
|
||||
1.000000, 1.000000, 0.000000, -2.000000, 4.000000, 6.000000, 0.517647,
|
||||
0.517647, 0.517647, 1.000000, 1.000000, 0.500000, -2.000000, 4.000000,
|
||||
4.000000, 0.513726, 0.513726, 0.513726, 1.000000, 0.620728, 0.360896,
|
||||
-0.482673, 4.000000, 4.556417, 0.545098, 0.545098, 0.545098, 1.000000,
|
||||
0.620728, 0.500000, -0.482673, 4.000000, 4.000000,
|
||||
0.333333, 0.333333, 0.333333, 1.000000, 1.500000, -0.500000, -4.000000,
|
||||
4.000000, 8.000000, 0.427451, 0.427451, 0.427451, 1.000000, 1.000000,
|
||||
0.000000, -2.000000, 4.000000, 6.000000, 0.356863, 0.356863, 0.356863,
|
||||
1.000000, 1.000000, -0.500000, -2.000000, 4.000000, 8.000000,
|
||||
0.556863, 0.556863, 0.556863, 1.000000, 0.540283, 0.541344, -0.160891,
|
||||
4.000000, 3.834625, 0.552941, 0.552941, 0.552941, 1.000000, 0.620728,
|
||||
0.541344, -0.482673, 4.000000, 3.834625, 0.545098, 0.545098, 0.545098,
|
||||
1.000000, 1.000000, 1.000000, -2.000000, 4.000000, 2.000000, 0.517647,
|
||||
0.517647, 0.517647, 1.000000, 1.000000, 0.500000, -2.000000, 4.000000,
|
||||
4.000000, 0.450980, 0.450980, 0.450980, 1.000000, 1.500000, 0.500000,
|
||||
-4.000000, 4.000000, 4.000000, 0.388235, 0.388235, 0.388235, 1.000000,
|
||||
1.500000, 0.000000, -4.000000, 4.000000, 6.000000,
|
||||
0.517647, 0.517647, 0.517647, 1.000000, 1.000000, 0.500000, -2.000000,
|
||||
4.000000, 4.000000, 0.552941, 0.552941, 0.552941, 1.000000, 0.620728,
|
||||
0.541344, -0.482673, 4.000000, 3.834625, 0.545098, 0.545098, 0.545098,
|
||||
1.000000, 0.620728, 0.500000, -0.482673, 4.000000, 4.000000,
|
||||
0.450980, 0.450980, 0.450980, 1.000000, 1.500000, 0.500000, -4.000000,
|
||||
4.000000, 4.000000, 0.435294, 0.435294, 0.435294, 1.000000, 1.500000,
|
||||
1.000000, -4.000000, 4.000000, 2.000000, 0.545098, 0.545098, 0.545098,
|
||||
1.000000, 1.000000, 1.000000, -2.000000, 4.000000, 2.000000,
|
||||
0.439216, 0.439216, 0.439216, 1.000000, 0.379272, 0.000000, 0.482673,
|
||||
4.000000, 6.000000, 0.517647, 0.517647, 0.517647, 1.000000, 0.000000,
|
||||
0.500000, 2.000000, 4.000000, 4.000000, 0.427451, 0.427451, 0.427451,
|
||||
1.000000, 0.000000, 0.000000, 2.000000, 4.000000, 6.000000,
|
||||
0.556863, 0.556863, 0.556863, 1.000000, 0.540283, 0.541344, -0.160891,
|
||||
4.000000, 3.834625, 0.545098, 0.545098, 0.545098, 1.000000, 1.000000,
|
||||
1.000000, -2.000000, 4.000000, 2.000000, 0.600000, 0.600000, 0.600000,
|
||||
1.000000, 0.500000, 1.000000, 0.000000, 4.000000, 2.000000
|
||||
};
|
||||
|
||||
|
||||
/* Object: skin_12 */
|
||||
|
||||
static const int striplength_skin_12[] = {
|
||||
12, 12, 12, 12, 12, 0
|
||||
};
|
||||
|
||||
static const float stripdata_skin_12[] = {
|
||||
0.498039, 0.498039, 0.498039, 1.000000, -0.099976, 1.500000, -2.400000,
|
||||
-4.000000, -0.000002, 0.337255, 0.337255, 0.337255, 1.000000, -0.500000,
|
||||
1.500000, -4.000000, -4.000000, -0.000002, 0.568627, 0.568627, 0.568627,
|
||||
1.000000, -0.099976, 1.100000, -2.400000, -4.000000, 1.599999, 0.341176,
|
||||
0.341176, 0.341176, 1.000000, -0.500000, 1.100000, -4.000000, -4.000000,
|
||||
1.599999, 0.498039, 0.498039, 0.498039, 1.000000, -0.099976, 0.700000,
|
||||
-2.400000, -4.000000, 3.200000, 0.325490, 0.325490, 0.325490, 1.000000,
|
||||
-0.500000, 0.700000, -4.000000, -4.000000, 3.199999, 0.352941, 0.352941,
|
||||
0.352941, 1.000000, -0.099976, 0.300000, -2.400000, -4.000000, 4.800000,
|
||||
0.282353, 0.282353, 0.282353, 1.000000, -0.500000, 0.300000, -4.000000,
|
||||
-4.000000, 4.800000, 0.282353, 0.282353, 0.282353, 1.000000, -0.099976,
|
||||
-0.100000, -2.400000, -4.000000, 6.400001, 0.254902, 0.254902, 0.254902,
|
||||
1.000000, -0.500000, -0.100000, -4.000000, -4.000000, 6.400000,
|
||||
0.239216, 0.239216, 0.239216, 1.000000, -0.099976, -0.500000, -2.400000,
|
||||
-4.000000, 8.000000, 0.227451, 0.227451, 0.227451, 1.000000, -0.500000,
|
||||
-0.500000, -4.000000, -4.000000, 8.000000,
|
||||
0.239216, 0.239216, 0.239216, 1.000000, 1.099976, -0.500000, 2.400001,
|
||||
-4.000000, 8.000000, 0.227451, 0.227451, 0.227451, 1.000000, 1.500000,
|
||||
-0.500000, 4.000002, -4.000000, 8.000000, 0.282353, 0.282353, 0.282353,
|
||||
1.000000, 1.099976, -0.100000, 2.400001, -4.000000, 6.400001, 0.254902,
|
||||
0.254902, 0.254902, 1.000000, 1.500000, -0.100000, 4.000002, -4.000000,
|
||||
6.400001, 0.352941, 0.352941, 0.352941, 1.000000, 1.099976, 0.300000,
|
||||
2.400002, -4.000000, 4.800001, 0.282353, 0.282353, 0.282353, 1.000000,
|
||||
1.500000, 0.300000, 4.000002, -4.000000, 4.800001, 0.498039, 0.498039,
|
||||
0.498039, 1.000000, 1.099976, 0.700000, 2.400002, -4.000000, 3.200000,
|
||||
0.321569, 0.321569, 0.321569, 1.000000, 1.500000, 0.700000, 4.000003,
|
||||
-4.000000, 3.200000, 0.568627, 0.568627, 0.568627, 1.000000, 1.099976,
|
||||
1.100000, 2.400002, -4.000000, 1.599999, 0.341176, 0.341176, 0.341176,
|
||||
1.000000, 1.500000, 1.100000, 4.000003, -4.000000, 1.599999, 0.494118,
|
||||
0.494118, 0.494118, 1.000000, 1.099976, 1.500000, 2.400003, -4.000000,
|
||||
-0.000002, 0.337255, 0.337255, 0.337255, 1.000000, 1.500000, 1.500000,
|
||||
4.000004, -4.000000, -0.000002,
|
||||
0.639216, 0.639216, 0.639216, 1.000000, 0.300049, 1.500000, -0.799999,
|
||||
-4.000000, -0.000002, 0.498039, 0.498039, 0.498039, 1.000000, -0.099976,
|
||||
1.500000, -2.400000, -4.000000, -0.000002, 0.858824, 0.858824, 0.858824,
|
||||
1.000000, 0.300049, 1.100000, -0.799999, -4.000000, 1.599999, 0.568627,
|
||||
0.568627, 0.568627, 1.000000, -0.099976, 1.100000, -2.400000, -4.000000,
|
||||
1.599999, 0.686275, 0.686275, 0.686275, 1.000000, 0.300049, 0.700000,
|
||||
-0.799999, -4.000000, 3.200000, 0.498039, 0.498039, 0.498039, 1.000000,
|
||||
-0.099976, 0.700000, -2.400000, -4.000000, 3.200000, 0.419608, 0.419608,
|
||||
0.419608, 1.000000, 0.300049, 0.300000, -0.800000, -4.000000, 4.800000,
|
||||
0.352941, 0.352941, 0.352941, 1.000000, -0.099976, 0.300000, -2.400000,
|
||||
-4.000000, 4.800000, 0.298039, 0.298039, 0.298039, 1.000000, 0.300049,
|
||||
-0.100000, -0.800000, -4.000000, 6.400001, 0.282353, 0.282353, 0.282353,
|
||||
1.000000, -0.099976, -0.100000, -2.400000, -4.000000, 6.400001,
|
||||
0.247059, 0.247059, 0.247059, 1.000000, 0.300049, -0.500000, -0.800000,
|
||||
-4.000000, 8.000000, 0.239216, 0.239216, 0.239216, 1.000000, -0.099976,
|
||||
-0.500000, -2.400000, -4.000000, 8.000000,
|
||||
0.639216, 0.639216, 0.639216, 1.000000, 0.699951, 1.500000, 0.800002,
|
||||
-4.000000, -0.000002, 0.639216, 0.639216, 0.639216, 1.000000, 0.300049,
|
||||
1.500000, -0.799999, -4.000000, -0.000002, 0.858824, 0.858824, 0.858824,
|
||||
1.000000, 0.699951, 1.100000, 0.800001, -4.000000, 1.599999, 0.858824,
|
||||
0.858824, 0.858824, 1.000000, 0.300049, 1.100000, -0.799999, -4.000000,
|
||||
1.599999, 0.686275, 0.686275, 0.686275, 1.000000, 0.699951, 0.700000,
|
||||
0.800001, -4.000000, 3.200000, 0.686275, 0.686275, 0.686275, 1.000000,
|
||||
0.300049, 0.700000, -0.799999, -4.000000, 3.200000, 0.419608, 0.419608,
|
||||
0.419608, 1.000000, 0.699951, 0.300000, 0.800001, -4.000000, 4.800001,
|
||||
0.419608, 0.419608, 0.419608, 1.000000, 0.300049, 0.300000, -0.800000,
|
||||
-4.000000, 4.800000, 0.298039, 0.298039, 0.298039, 1.000000, 0.699951,
|
||||
-0.100000, 0.800001, -4.000000, 6.400001, 0.298039, 0.298039, 0.298039,
|
||||
1.000000, 0.300049, -0.100000, -0.800000, -4.000000, 6.400001, 0.247059,
|
||||
0.247059, 0.247059, 1.000000, 0.699951, -0.500000, 0.800000, -4.000000,
|
||||
8.000000, 0.247059, 0.247059, 0.247059, 1.000000, 0.300049, -0.500000,
|
||||
-0.800000, -4.000000, 8.000000,
|
||||
0.494118, 0.494118, 0.494118, 1.000000, 1.099976, 1.500000, 2.400003,
|
||||
-4.000000, -0.000002, 0.639216, 0.639216, 0.639216, 1.000000, 0.699951,
|
||||
1.500000, 0.800002, -4.000000, -0.000002, 0.568627, 0.568627, 0.568627,
|
||||
1.000000, 1.099976, 1.100000, 2.400002, -4.000000, 1.599999, 0.858824,
|
||||
0.858824, 0.858824, 1.000000, 0.699951, 1.100000, 0.800001, -4.000000,
|
||||
1.599999, 0.498039, 0.498039, 0.498039, 1.000000, 1.099976, 0.700000,
|
||||
2.400002, -4.000000, 3.200000, 0.686275, 0.686275, 0.686275, 1.000000,
|
||||
0.699951, 0.700000, 0.800001, -4.000000, 3.200000, 0.352941, 0.352941,
|
||||
0.352941, 1.000000, 1.099976, 0.300000, 2.400002, -4.000000, 4.800001,
|
||||
0.419608, 0.419608, 0.419608, 1.000000, 0.699951, 0.300000, 0.800001,
|
||||
-4.000000, 4.800001, 0.282353, 0.282353, 0.282353, 1.000000, 1.099976,
|
||||
-0.100000, 2.400001, -4.000000, 6.400001, 0.298039, 0.298039, 0.298039,
|
||||
1.000000, 0.699951, -0.100000, 0.800001, -4.000000, 6.400001, 0.239216,
|
||||
0.239216, 0.239216, 1.000000, 1.099976, -0.500000, 2.400001, -4.000000,
|
||||
8.000000, 0.247059, 0.247059, 0.247059, 1.000000, 0.699951, -0.500000,
|
||||
0.800000, -4.000000, 8.000000
|
||||
};
|
||||
|
||||
|
||||
/* Object: skin_11 */
|
||||
|
||||
static const int striplength_skin_11[] = {
|
||||
12, 12, 12, 12, 12, 0
|
||||
};
|
||||
|
||||
static const float stripdata_skin_11[] = {
|
||||
0.145098, 0.145098, 0.145098, 1.000000, -0.099976, 1.500000, -2.400000,
|
||||
4.000002, 0.000000, 0.141176, 0.141176, 0.141176, 1.000000, -0.500000,
|
||||
1.500000, -4.000000, 4.000002, 0.000000, 0.176471, 0.176471, 0.176471,
|
||||
1.000000, -0.099976, 1.100000, -2.400000, 2.400001, 0.000000, 0.145098,
|
||||
0.145098, 0.145098, 1.000000, -0.500000, 1.100000, -4.000000, 2.400001,
|
||||
0.000000, 0.341176, 0.341176, 0.341176, 1.000000, -0.099976, 0.700000,
|
||||
-2.400000, 0.800000, 0.000000, 0.188235, 0.188235, 0.188235, 1.000000,
|
||||
-0.500000, 0.700000, -4.000000, 0.800000, 0.000000, 0.450980, 0.450980,
|
||||
0.450980, 1.000000, -0.099976, 0.300000, -2.400000, -0.800000, 0.000000,
|
||||
0.247059, 0.247059, 0.247059, 1.000000, -0.500000, 0.300000, -4.000000,
|
||||
-0.800000, 0.000000, 0.439216, 0.439216, 0.439216, 1.000000, -0.099976,
|
||||
-0.100000, -2.400000, -2.400000, 0.000000, 0.270588, 0.270588, 0.270588,
|
||||
1.000000, -0.500000, -0.100000, -4.000000, -2.400000, 0.000000,
|
||||
0.364706, 0.364706, 0.364706, 1.000000, -0.099976, -0.500000, -2.400000,
|
||||
-4.000000, 0.000000, 0.258824, 0.258824, 0.258824, 1.000000, -0.500000,
|
||||
-0.500000, -4.000000, -4.000000, 0.000000,
|
||||
0.364706, 0.364706, 0.364706, 1.000000, 1.099976, -0.500000, 2.400001,
|
||||
-4.000000, 0.000000, 0.258824, 0.258824, 0.258824, 1.000000, 1.500000,
|
||||
-0.500000, 4.000002, -4.000000, 0.000000, 0.439216, 0.439216, 0.439216,
|
||||
1.000000, 1.099976, -0.100000, 2.400001, -2.400001, 0.000000, 0.270588,
|
||||
0.270588, 0.270588, 1.000000, 1.500000, -0.100000, 4.000002, -2.400001,
|
||||
0.000000, 0.454902, 0.454902, 0.454902, 1.000000, 1.099976, 0.300000,
|
||||
2.400002, -0.800000, 0.000000, 0.247059, 0.247059, 0.247059, 1.000000,
|
||||
1.500000, 0.300000, 4.000002, -0.800000, 0.000000, 0.341176, 0.341176,
|
||||
0.341176, 1.000000, 1.099976, 0.700000, 2.400002, 0.800000, 0.000000,
|
||||
0.184314, 0.184314, 0.184314, 1.000000, 1.500000, 0.700000, 4.000003,
|
||||
0.800000, 0.000000, 0.176471, 0.176471, 0.176471, 1.000000, 1.099976,
|
||||
1.100000, 2.400002, 2.400001, 0.000000, 0.145098, 0.145098, 0.145098,
|
||||
1.000000, 1.500000, 1.100000, 4.000003, 2.400001, 0.000000, 0.145098,
|
||||
0.145098, 0.145098, 1.000000, 1.099976, 1.500000, 2.400003, 4.000003,
|
||||
0.000000, 0.141176, 0.141176, 0.141176, 1.000000, 1.500000, 1.500000,
|
||||
4.000004, 4.000002, 0.000000,
|
||||
0.145098, 0.145098, 0.145098, 1.000000, 0.300049, 1.500000, -0.799999,
|
||||
4.000002, 0.000000, 0.145098, 0.145098, 0.145098, 1.000000, -0.099976,
|
||||
1.500000, -2.400000, 4.000002, 0.000000, 0.262745, 0.262745, 0.262745,
|
||||
1.000000, 0.300049, 1.100000, -0.799999, 2.400001, 0.000000, 0.176471,
|
||||
0.176471, 0.176471, 1.000000, -0.099976, 1.100000, -2.400000, 2.400001,
|
||||
0.000000, 0.580392, 0.580392, 0.580392, 1.000000, 0.300049, 0.700000,
|
||||
-0.799999, 0.800000, 0.000000, 0.341176, 0.341176, 0.341176, 1.000000,
|
||||
-0.099976, 0.700000, -2.400000, 0.800000, 0.000000, 0.709804, 0.709804,
|
||||
0.709804, 1.000000, 0.300049, 0.300000, -0.800000, -0.800000, 0.000000,
|
||||
0.450980, 0.450980, 0.450980, 1.000000, -0.099976, 0.300000, -2.400000,
|
||||
-0.800000, 0.000000, 0.627451, 0.627451, 0.627451, 1.000000, 0.300049,
|
||||
-0.100000, -0.800000, -2.400001, 0.000000, 0.439216, 0.439216, 0.439216,
|
||||
1.000000, -0.099976, -0.100000, -2.400000, -2.400000, 0.000000,
|
||||
0.458824, 0.458824, 0.458824, 1.000000, 0.300049, -0.500000, -0.800000,
|
||||
-4.000000, 0.000000, 0.364706, 0.364706, 0.364706, 1.000000, -0.099976,
|
||||
-0.500000, -2.400000, -4.000000, 0.000000,
|
||||
0.145098, 0.145098, 0.145098, 1.000000, 0.699951, 1.500000, 0.800002,
|
||||
4.000002, 0.000000, 0.145098, 0.145098, 0.145098, 1.000000, 0.300049,
|
||||
1.500000, -0.799999, 4.000002, 0.000000, 0.262745, 0.262745, 0.262745,
|
||||
1.000000, 0.699951, 1.100000, 0.800001, 2.400001, 0.000000, 0.262745,
|
||||
0.262745, 0.262745, 1.000000, 0.300049, 1.100000, -0.799999, 2.400001,
|
||||
0.000000, 0.580392, 0.580392, 0.580392, 1.000000, 0.699951, 0.700000,
|
||||
0.800001, 0.800000, 0.000000, 0.580392, 0.580392, 0.580392, 1.000000,
|
||||
0.300049, 0.700000, -0.799999, 0.800000, 0.000000, 0.713726, 0.713726,
|
||||
0.713726, 1.000000, 0.699951, 0.300000, 0.800001, -0.800000, 0.000000,
|
||||
0.709804, 0.709804, 0.709804, 1.000000, 0.300049, 0.300000, -0.800000,
|
||||
-0.800000, 0.000000, 0.631373, 0.631373, 0.631373, 1.000000, 0.699951,
|
||||
-0.100000, 0.800001, -2.400001, 0.000000, 0.627451, 0.627451, 0.627451,
|
||||
1.000000, 0.300049, -0.100000, -0.800000, -2.400001, 0.000000, 0.458824,
|
||||
0.458824, 0.458824, 1.000000, 0.699951, -0.500000, 0.800000, -4.000000,
|
||||
0.000000, 0.458824, 0.458824, 0.458824, 1.000000, 0.300049, -0.500000,
|
||||
-0.800000, -4.000000, 0.000000,
|
||||
0.145098, 0.145098, 0.145098, 1.000000, 1.099976, 1.500000, 2.400003,
|
||||
4.000003, 0.000000, 0.145098, 0.145098, 0.145098, 1.000000, 0.699951,
|
||||
1.500000, 0.800002, 4.000002, 0.000000, 0.176471, 0.176471, 0.176471,
|
||||
1.000000, 1.099976, 1.100000, 2.400002, 2.400001, 0.000000, 0.262745,
|
||||
0.262745, 0.262745, 1.000000, 0.699951, 1.100000, 0.800001, 2.400001,
|
||||
0.000000, 0.341176, 0.341176, 0.341176, 1.000000, 1.099976, 0.700000,
|
||||
2.400002, 0.800000, 0.000000, 0.580392, 0.580392, 0.580392, 1.000000,
|
||||
0.699951, 0.700000, 0.800001, 0.800000, 0.000000, 0.454902, 0.454902,
|
||||
0.454902, 1.000000, 1.099976, 0.300000, 2.400002, -0.800000, 0.000000,
|
||||
0.713726, 0.713726, 0.713726, 1.000000, 0.699951, 0.300000, 0.800001,
|
||||
-0.800000, 0.000000, 0.439216, 0.439216, 0.439216, 1.000000, 1.099976,
|
||||
-0.100000, 2.400001, -2.400001, 0.000000, 0.631373, 0.631373, 0.631373,
|
||||
1.000000, 0.699951, -0.100000, 0.800001, -2.400001, 0.000000, 0.364706,
|
||||
0.364706, 0.364706, 1.000000, 1.099976, -0.500000, 2.400001, -4.000000,
|
||||
0.000000, 0.458824, 0.458824, 0.458824, 1.000000, 0.699951, -0.500000,
|
||||
0.800000, -4.000000, 0.000000
|
||||
};
|
||||
|
||||
|
||||
/* Object: skin_9 */
|
||||
|
||||
static const int striplength_skin_9[] = {
|
||||
18, 0
|
||||
};
|
||||
|
||||
static const float stripdata_skin_9[] = {
|
||||
0.384314, 0.384314, 0.384314, 1.000000, -0.500000, 1.500000, -4.000000,
|
||||
4.000000, 8.000000, 0.384314, 0.384314, 0.384314, 1.000000, 1.500000,
|
||||
1.500000, 4.000000, 4.000000, 8.000000, 0.376471, 0.376471, 0.376471,
|
||||
1.000000, -0.500000, 1.250000, -4.000000, 3.695518, 9.530733, 0.403922,
|
||||
0.403922, 0.403922, 1.000000, 1.500000, 1.250000, 4.000000, 3.695518,
|
||||
9.530733, 0.415686, 0.415686, 0.415686, 1.000000, -0.500000, 1.000000,
|
||||
-4.000000, 2.828427, 10.828427, 0.431373, 0.431373, 0.431373, 1.000000,
|
||||
1.500000, 1.000000, 4.000000, 2.828427, 10.828427, 0.435294, 0.435294,
|
||||
0.435294, 1.000000, -0.500000, 0.750000, -4.000000, 1.530734, 11.695518,
|
||||
0.443137, 0.443137, 0.443137, 1.000000, 1.500000, 0.750000, 4.000000,
|
||||
1.530734, 11.695518, 0.439216, 0.439216, 0.439216, 1.000000, -0.500000,
|
||||
0.500000, -4.000000, 0.000000, 12.000000, 0.435294, 0.435294, 0.435294,
|
||||
1.000000, 1.500000, 0.500000, 4.000000, 0.000000, 12.000000, 0.427451,
|
||||
0.427451, 0.427451, 1.000000, -0.500000, 0.250000, -4.000000, -1.530734,
|
||||
11.695518, 0.411765, 0.411765, 0.411765, 1.000000, 1.500000, 0.250000,
|
||||
4.000000, -1.530734, 11.695518, 0.396078, 0.396078, 0.396078, 1.000000,
|
||||
-0.500000, 0.000000, -4.000000, -2.828427, 10.828427, 0.368627,
|
||||
0.368627, 0.368627, 1.000000, 1.500000, 0.000000, 4.000000, -2.828427,
|
||||
10.828427, 0.341176, 0.341176, 0.341176, 1.000000, -0.500000, -0.250000,
|
||||
-4.000000, -3.695518, 9.530733, 0.301961, 0.301961, 0.301961, 1.000000,
|
||||
1.500000, -0.250000, 4.000000, -3.695518, 9.530733, 0.294118, 0.294118,
|
||||
0.294118, 1.000000, -0.500000, -0.500000, -4.000000, -4.000000,
|
||||
8.000000, 0.294118, 0.294118, 0.294118, 1.000000, 1.500000, -0.500000,
|
||||
4.000000, -4.000000, 8.000000
|
||||
};
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: winpos.c,v 1.2 2000/06/27 17:04:43 brianp Exp $ */
|
||||
/* $Id: winpos.c,v 1.3 2000/12/24 22:53:54 pesco Exp $ */
|
||||
|
||||
/*
|
||||
* Example of how to use the GL_MESA_window_pos extension.
|
||||
@@ -8,6 +8,32 @@
|
||||
|
||||
/*
|
||||
* $Log: winpos.c,v $
|
||||
* Revision 1.3 2000/12/24 22:53:54 pesco
|
||||
* * demos/Makefile.am (INCLUDES): Added -I$(top_srcdir)/util.
|
||||
* * demos/Makefile.X11, demos/Makefile.BeOS-R4, demos/Makefile.cygnus:
|
||||
* Essentially the same.
|
||||
* Program files updated to include "readtex.c", not "../util/readtex.c".
|
||||
* * demos/reflect.c: Likewise for "showbuffer.c".
|
||||
*
|
||||
*
|
||||
* * Makefile.am (EXTRA_DIST): Added top-level regular files.
|
||||
*
|
||||
* * include/GL/Makefile.am (INC_X11): Added glxext.h.
|
||||
*
|
||||
*
|
||||
* * src/GGI/include/ggi/mesa/Makefile.am (EXTRA_HEADERS): Include
|
||||
* Mesa GGI headers in dist even if HAVE_GGI is not given.
|
||||
*
|
||||
* * configure.in: Look for GLUT and demo source dirs in $srcdir.
|
||||
*
|
||||
* * src/swrast/Makefile.am (libMesaSwrast_la_SOURCES): Set to *.[ch].
|
||||
* More source list updates in various Makefile.am's.
|
||||
*
|
||||
* * Makefile.am (dist-hook): Remove CVS directory from distribution.
|
||||
* (DIST_SUBDIRS): List all possible subdirs here.
|
||||
* (SUBDIRS): Only list subdirs selected for build again.
|
||||
* The above two applied to all subdir Makefile.am's also.
|
||||
*
|
||||
* Revision 1.2 2000/06/27 17:04:43 brianp
|
||||
* fixed compiler warnings
|
||||
*
|
||||
@@ -36,7 +62,7 @@
|
||||
#define GL_GLEXT_LEGACY
|
||||
#include "GL/glut.h"
|
||||
|
||||
#include "../util/readtex.c" /* a hack, I know */
|
||||
#include "readtex.c" /* a hack, I know */
|
||||
|
||||
#define IMAGE_FILE "../images/girl.rgb"
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ void drawSquares(GLenum mode)
|
||||
void processHits (GLint hits, GLuint buffer[])
|
||||
{
|
||||
unsigned int i, j;
|
||||
GLuint ii, jj, names, *ptr;
|
||||
GLuint ii = 0, jj = 0, names, *ptr;
|
||||
|
||||
printf ("hits = %d\n", hits);
|
||||
ptr = (GLuint *) buffer;
|
||||
|
||||
@@ -43,6 +43,21 @@
|
||||
* of the scene. Within this mask, a different model
|
||||
* (a sphere) is drawn in a different color.
|
||||
*/
|
||||
|
||||
/*
|
||||
* !!! NOTE !!!
|
||||
*
|
||||
* This demo is poorly written. The stencil buffer should be
|
||||
* redrawn in display(), not in the myReshape() function.
|
||||
* The reason is if the window gets "damaged" then the stencil buffer
|
||||
* contents will be in an undefined state (myReshape is not called when
|
||||
* a window is damaged and needs to be redrawn). If the stencil buffer
|
||||
* contents are undefined, the results of display() are unpredictable.
|
||||
*
|
||||
* -Brian
|
||||
*/
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <GL/glut.h>
|
||||
|
||||
@@ -90,6 +105,8 @@ void display(void)
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
glStencilOp (GL_KEEP, GL_KEEP, GL_KEEP);
|
||||
|
||||
/* draw blue sphere where the stencil is 1 */
|
||||
glStencilFunc (GL_EQUAL, 0x1, 0x1);
|
||||
glCallList (BLUEMAT);
|
||||
@@ -97,7 +114,6 @@ void display(void)
|
||||
|
||||
/* draw the tori where the stencil is not 1 */
|
||||
glStencilFunc (GL_NOTEQUAL, 0x1, 0x1);
|
||||
glStencilOp (GL_KEEP, GL_KEEP, GL_KEEP);
|
||||
glPushMatrix();
|
||||
glRotatef (45.0, 0.0, 0.0, 1.0);
|
||||
glRotatef (45.0, 0.0, 1.0, 0.0);
|
||||
@@ -110,6 +126,7 @@ void display(void)
|
||||
glPopMatrix();
|
||||
|
||||
glFlush();
|
||||
glutSwapBuffers();
|
||||
}
|
||||
|
||||
/* Whenever the window is reshaped, redefine the
|
||||
@@ -164,7 +181,7 @@ key(unsigned char k, int x, int y)
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
glutInit(&argc, argv);
|
||||
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH | GLUT_STENCIL);
|
||||
glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH | GLUT_STENCIL);
|
||||
glutInitWindowSize (400, 400);
|
||||
glutCreateWindow (argv[0]);
|
||||
myinit ();
|
||||
|
||||
@@ -65,7 +65,7 @@ void makeCheckImage(void)
|
||||
|
||||
for (i = 0; i < checkImageHeight; i++) {
|
||||
for (j = 0; j < checkImageWidth; j++) {
|
||||
c = ((((i&0x8)==0)^((j&0x8))==0))*255;
|
||||
c = (((i&0x8)==0)^((j&0x8)==0))*255;
|
||||
checkImage[i][j][0] = (GLubyte) c;
|
||||
checkImage[i][j][1] = (GLubyte) c;
|
||||
checkImage[i][j][2] = (GLubyte) c;
|
||||
|
||||
@@ -41,55 +41,55 @@ GLint cubeList = 1;
|
||||
float scp[18][3] = {
|
||||
{
|
||||
1.000000, 0.000000, 0.000000
|
||||
},
|
||||
},
|
||||
{
|
||||
1.000000, 0.000000, 5.000000
|
||||
},
|
||||
{
|
||||
0.707107, 0.707107, 0.000000
|
||||
},
|
||||
},
|
||||
{
|
||||
0.707107, 0.707107, 5.000000
|
||||
},
|
||||
{
|
||||
0.000000, 1.000000, 0.000000
|
||||
},
|
||||
},
|
||||
{
|
||||
0.000000, 1.000000, 5.000000
|
||||
},
|
||||
{
|
||||
-0.707107, 0.707107, 0.000000
|
||||
},
|
||||
},
|
||||
{
|
||||
-0.707107, 0.707107, 5.000000
|
||||
},
|
||||
{
|
||||
-1.000000, 0.000000, 0.000000
|
||||
},
|
||||
},
|
||||
{
|
||||
-1.000000, 0.000000, 5.000000
|
||||
},
|
||||
{
|
||||
-0.707107, -0.707107, 0.000000
|
||||
},
|
||||
},
|
||||
{
|
||||
-0.707107, -0.707107, 5.000000
|
||||
},
|
||||
{
|
||||
0.000000, -1.000000, 0.000000
|
||||
},
|
||||
},
|
||||
{
|
||||
0.000000, -1.000000, 5.000000
|
||||
},
|
||||
{
|
||||
0.707107, -0.707107, 0.000000
|
||||
},
|
||||
},
|
||||
{
|
||||
0.707107, -0.707107, 5.000000
|
||||
},
|
||||
{
|
||||
1.000000, 0.000000, 0.000000
|
||||
},
|
||||
},
|
||||
{
|
||||
1.000000, 0.000000, 5.000000
|
||||
},
|
||||
@@ -136,7 +136,7 @@ static void Init(void)
|
||||
static float back_mat_diffuse[] = {1.0, 0.0, 0.0, 1.0};
|
||||
static float lmodel_ambient[] = {0.0, 0.0, 0.0, 1.0};
|
||||
static float fog_color[] = {0.8, 0.8, 0.8, 1.0};
|
||||
|
||||
|
||||
glFrontFace(GL_CW);
|
||||
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
@@ -148,7 +148,7 @@ static void Init(void)
|
||||
glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
|
||||
glEnable(GL_LIGHTING);
|
||||
glEnable(GL_LIGHT0);
|
||||
|
||||
|
||||
glMaterialfv(GL_FRONT, GL_SHININESS, front_mat_shininess);
|
||||
glMaterialfv(GL_FRONT, GL_SPECULAR, front_mat_specular);
|
||||
glMaterialfv(GL_FRONT, GL_DIFFUSE, front_mat_diffuse);
|
||||
@@ -258,7 +258,7 @@ static GLenum Args(int argc, char **argv)
|
||||
GLint i;
|
||||
|
||||
rgb = GL_TRUE;
|
||||
doubleBuffer = GL_FALSE;
|
||||
doubleBuffer = GL_TRUE;
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
if (strcmp(argv[i], "-ci") == 0) {
|
||||
|
||||
@@ -123,7 +123,7 @@ static void Draw(void)
|
||||
} else {
|
||||
glDisable(GL_LINE_STIPPLE);
|
||||
}
|
||||
|
||||
|
||||
if (mode2) {
|
||||
ci = CI_OFFSET;
|
||||
glEnable(GL_LINE_SMOOTH);
|
||||
@@ -170,7 +170,7 @@ static GLenum Args(int argc, char **argv)
|
||||
GLint i;
|
||||
|
||||
rgb = GL_TRUE;
|
||||
doubleBuffer = GL_FALSE;
|
||||
doubleBuffer = GL_TRUE;
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
if (strcmp(argv[i], "-ci") == 0) {
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
* Nov 20, 1995 use stdlib's rand()/srand() instead of random()/srand48(), etc.
|
||||
*/
|
||||
|
||||
/*
|
||||
/*
|
||||
* Modified by Li Wei(liwei@aiar.xjtu.edu.cn) to be able to run in Windows
|
||||
* 6/13
|
||||
*
|
||||
@@ -83,7 +83,7 @@ void FillTorus(float rc, int numc, float rt, int numt)
|
||||
|
||||
pi = 3.14159265358979323846;
|
||||
twopi = 2 * pi;
|
||||
|
||||
|
||||
for (i = 0; i < numc; i++) {
|
||||
glBegin(GL_QUAD_STRIP);
|
||||
for (j = 0; j <= numt; j++) {
|
||||
@@ -136,7 +136,7 @@ void DrawScene(void)
|
||||
}
|
||||
|
||||
glPushMatrix();
|
||||
|
||||
|
||||
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
|
||||
gluLookAt(0,0,10, 0,0,0, 0,1,0);
|
||||
|
||||
@@ -252,7 +252,7 @@ void Init(void)
|
||||
dests[GREENRING][1] = bottom_y;
|
||||
dests[GREENRING][2] = bottom_z;
|
||||
|
||||
base = 2.0;
|
||||
base = 2.0;
|
||||
height = 2.0;
|
||||
theTorus = glGenLists(1);
|
||||
glNewList(theTorus, GL_COMPILE);
|
||||
@@ -321,7 +321,7 @@ GLenum Args(int argc, char **argv)
|
||||
GLint i;
|
||||
|
||||
rgb = GL_TRUE;
|
||||
doubleBuffer = GL_FALSE;
|
||||
doubleBuffer = GL_TRUE;
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
if (strcmp(argv[i], "-ci") == 0) {
|
||||
|
||||
@@ -326,7 +326,7 @@ static GLenum Args(int argc, char **argv)
|
||||
{
|
||||
GLint i;
|
||||
|
||||
doubleBuffer = GL_FALSE;
|
||||
doubleBuffer = GL_TRUE;
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
if (strcmp(argv[i], "-sb") == 0) {
|
||||
|
||||
@@ -29,28 +29,18 @@
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
#include <GL/glut.h>
|
||||
#include "../util/readtex.c"
|
||||
|
||||
|
||||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
#ifndef PI
|
||||
#define PI 3.14159265358979323846
|
||||
#endif
|
||||
|
||||
|
||||
#include "loadppm.c"
|
||||
|
||||
int rgb; /* unused */
|
||||
|
||||
#include "tkmap.c"
|
||||
|
||||
GLenum doubleBuffer;
|
||||
int W = 400, H = 400;
|
||||
|
||||
char *imageFileName = 0;
|
||||
PPMImage *image;
|
||||
|
||||
int numComponents;
|
||||
char *imageFileName = "../images/reflect.rgb";
|
||||
|
||||
float *minFilter, *magFilter, *sWrapMode, *tWrapMode;
|
||||
float decal[] = {GL_DECAL};
|
||||
@@ -66,18 +56,13 @@ float linear_mipmap_linear[] = {GL_LINEAR_MIPMAP_LINEAR};
|
||||
GLint sphereMap[] = {GL_SPHERE_MAP};
|
||||
|
||||
float xRotation = 0.0, yRotation = 0.0;
|
||||
float zTranslate = -4.0;
|
||||
GLenum autoRotate = TRUE;
|
||||
GLenum deepestColor = COLOR_GREEN;
|
||||
GLenum isLit = TRUE;
|
||||
GLenum isFogged = FALSE;
|
||||
float zTranslate = -3.0;
|
||||
GLenum autoRotate = GL_TRUE;
|
||||
GLboolean isLit = GL_TRUE;
|
||||
GLboolean isFogged = GL_FALSE;
|
||||
GLboolean doTexture = GL_TRUE;
|
||||
float *textureEnvironment = modulate;
|
||||
|
||||
struct MipMap {
|
||||
int width, height;
|
||||
unsigned char *data;
|
||||
};
|
||||
|
||||
int cube, cage, cylinder, torus, genericObject;
|
||||
|
||||
float c[6][4][4][3] = {
|
||||
@@ -85,7 +70,7 @@ float c[6][4][4][3] = {
|
||||
{
|
||||
{
|
||||
1.0, 1.0, -1.0
|
||||
},
|
||||
},
|
||||
{
|
||||
0.0, 1.0, -1.0
|
||||
},
|
||||
@@ -102,10 +87,10 @@ float c[6][4][4][3] = {
|
||||
},
|
||||
{
|
||||
-1.0, 1.0, -1.0
|
||||
},
|
||||
},
|
||||
{
|
||||
-1.0, 0.0, -1.0
|
||||
},
|
||||
},
|
||||
{
|
||||
0.0, 0.0, -1.0
|
||||
},
|
||||
@@ -269,7 +254,7 @@ float c[6][4][4][3] = {
|
||||
{
|
||||
-1.0, 0.0, -1.0
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
{
|
||||
-1.0, 1.0, 0.0
|
||||
@@ -283,7 +268,7 @@ float c[6][4][4][3] = {
|
||||
{
|
||||
-1.0, 0.0, 0.0
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
{
|
||||
-1.0, 0.0, 1.0
|
||||
@@ -297,7 +282,7 @@ float c[6][4][4][3] = {
|
||||
{
|
||||
-1.0, 0.0, 0.0
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
{
|
||||
-1.0, -1.0, 0.0
|
||||
@@ -311,7 +296,7 @@ float c[6][4][4][3] = {
|
||||
{
|
||||
-1.0, 0.0, 0.0
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
{
|
||||
@@ -463,8 +448,8 @@ GLfloat identity[16] = {
|
||||
void BuildCylinder(int numEdges)
|
||||
{
|
||||
int i, top = 1.0, bottom = -1.0;
|
||||
float x[100], y[100], angle;
|
||||
|
||||
float x[100], y[100], angle;
|
||||
|
||||
for (i = 0; i <= numEdges; i++) {
|
||||
angle = i * 2.0 * PI / numEdges;
|
||||
x[i] = cos(angle); /* was cosf() */
|
||||
@@ -505,7 +490,7 @@ void BuildTorus(float rc, int numc, float rt, int numt)
|
||||
|
||||
pi = 3.14159265358979323846;
|
||||
twopi = 2.0 * pi;
|
||||
|
||||
|
||||
glNewList(torus, GL_COMPILE);
|
||||
for (i = 0; i < numc; i++) {
|
||||
glBegin(GL_QUAD_STRIP);
|
||||
@@ -542,7 +527,7 @@ void BuildCage(void)
|
||||
left = -4.0;
|
||||
bottom = -4.0;
|
||||
right = 4.0;
|
||||
top = 4.0;
|
||||
top = 4.0;
|
||||
|
||||
inc = 2.0 * 4.0 * 0.1;
|
||||
|
||||
@@ -631,7 +616,7 @@ void BuildCube(void)
|
||||
glNewList(cube, GL_COMPILE);
|
||||
for (i = 0; i < 6; i++) {
|
||||
for (j = 0; j < 4; j++) {
|
||||
glNormal3fv(n[i]);
|
||||
glNormal3fv(n[i]);
|
||||
glBegin(GL_POLYGON);
|
||||
glVertex3fv(c[i][j][0]);
|
||||
glVertex3fv(c[i][j][1]);
|
||||
@@ -661,18 +646,6 @@ void BuildLists(void)
|
||||
genericObject = torus;
|
||||
}
|
||||
|
||||
void SetDeepestColor(void)
|
||||
{
|
||||
GLint redBits, greenBits, blueBits;
|
||||
|
||||
glGetIntegerv(GL_RED_BITS, &redBits);
|
||||
glGetIntegerv(GL_GREEN_BITS, &greenBits);
|
||||
glGetIntegerv(GL_BLUE_BITS, &blueBits);
|
||||
|
||||
deepestColor = (redBits >= greenBits) ? COLOR_RED : COLOR_GREEN;
|
||||
deepestColor = (deepestColor >= blueBits) ? deepestColor : COLOR_BLUE;
|
||||
}
|
||||
|
||||
void SetDefaultSettings(void)
|
||||
{
|
||||
|
||||
@@ -681,7 +654,7 @@ void SetDefaultSettings(void)
|
||||
sWrapMode = repeat;
|
||||
tWrapMode = repeat;
|
||||
textureEnvironment = modulate;
|
||||
autoRotate = TRUE;
|
||||
autoRotate = GL_TRUE;
|
||||
}
|
||||
|
||||
unsigned char *AlphaPadImage(int bufSize, unsigned char *inData, int alpha)
|
||||
@@ -707,47 +680,47 @@ unsigned char *AlphaPadImage(int bufSize, unsigned char *inData, int alpha)
|
||||
void Init(void)
|
||||
{
|
||||
float ambient[] = {0.0, 0.0, 0.0, 1.0};
|
||||
float diffuse[] = {0.0, 1.0, 0.0, 1.0};
|
||||
float diffuse[] = {1.0, 1.0, 1.0, 1.0};
|
||||
float specular[] = {1.0, 1.0, 1.0, 1.0};
|
||||
float position[] = {2.0, 2.0, 0.0, 1.0};
|
||||
float position[] = {0.0, 0.0, 4.0, 0.0};
|
||||
float fog_color[] = {0.0, 0.0, 0.0, 1.0};
|
||||
float mat_ambient[] = {0.0, 0.0, 0.0, 1.0};
|
||||
float mat_shininess[] = {90.0};
|
||||
float mat_specular[] = {1.0, 1.0, 1.0, 1.0};
|
||||
float mat_diffuse[] = {1.0, 1.0, 1.0, 1.0};
|
||||
float lmodel_ambient[] = {0.0, 0.0, 0.0, 1.0};
|
||||
float mat_diffuse[] = {0.8, 0.8, 0.8, 1.0};
|
||||
float lmodel_ambient[] = {0.2, 0.2, 0.2, 1.0};
|
||||
float lmodel_twoside[] = {GL_TRUE};
|
||||
int w, h;
|
||||
GLenum format;
|
||||
GLubyte *image;
|
||||
|
||||
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
|
||||
|
||||
SetDeepestColor();
|
||||
SetDefaultSettings();
|
||||
|
||||
if (numComponents == 4) {
|
||||
image = LoadPPM(imageFileName);
|
||||
image->data = AlphaPadImage(image->sizeX*image->sizeY,
|
||||
image->data, 128);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
gluBuild2DMipmaps(GL_TEXTURE_2D, numComponents,
|
||||
image->sizeX, image->sizeY,
|
||||
GL_RGBA, GL_UNSIGNED_BYTE, image->data);
|
||||
} else {
|
||||
image = LoadPPM(imageFileName);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
gluBuild2DMipmaps(GL_TEXTURE_2D, numComponents,
|
||||
image->sizeX, image->sizeY,
|
||||
GL_RGB, GL_UNSIGNED_BYTE, image->data);
|
||||
image = LoadRGBImage(imageFileName, &w, &h, &format);
|
||||
if (!image) {
|
||||
printf("Error: couldn't load %s\n", imageFileName);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
gluBuild2DMipmaps(GL_TEXTURE_2D, format, w, h,
|
||||
GL_RGB, GL_UNSIGNED_BYTE, image);
|
||||
|
||||
free(image);
|
||||
|
||||
glFogf(GL_FOG_DENSITY, 0.125);
|
||||
glFogi(GL_FOG_MODE, GL_LINEAR);
|
||||
glFogf(GL_FOG_START, 4.0);
|
||||
glFogf(GL_FOG_END, 9.0);
|
||||
glFogf(GL_FOG_END, 8.5);
|
||||
glFogfv(GL_FOG_COLOR, fog_color);
|
||||
|
||||
glLightfv(GL_LIGHT0, GL_AMBIENT, ambient);
|
||||
glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse);
|
||||
glLightfv(GL_LIGHT0, GL_SPECULAR, specular);
|
||||
glLightfv(GL_LIGHT0, GL_POSITION, position);
|
||||
|
||||
glEnable(GL_LIGHT0);
|
||||
|
||||
glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, mat_shininess);
|
||||
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, mat_specular);
|
||||
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mat_diffuse);
|
||||
@@ -757,18 +730,14 @@ void Init(void)
|
||||
glLightModelfv(GL_LIGHT_MODEL_TWO_SIDE, lmodel_twoside);
|
||||
glShadeModel(GL_SMOOTH);
|
||||
|
||||
glEnable(GL_LIGHTING);
|
||||
glEnable(GL_LIGHT0);
|
||||
|
||||
glClearColor(0.0, 0.0, 0.0, 0.0);
|
||||
glViewport(0, 0, W, H);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
|
||||
glFrontFace(GL_CW);
|
||||
glEnable(GL_CULL_FACE);
|
||||
glCullFace(GL_BACK);
|
||||
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glTexGeniv(GL_S, GL_TEXTURE_GEN_MODE, sphereMap);
|
||||
glTexGeniv(GL_T, GL_TEXTURE_GEN_MODE, sphereMap);
|
||||
glEnable(GL_TEXTURE_GEN_S);
|
||||
@@ -786,15 +755,18 @@ void Init(void)
|
||||
|
||||
void ReInit(void)
|
||||
{
|
||||
|
||||
if (genericObject == torus) {
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
} else {
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
}
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
|
||||
#if 0
|
||||
if (isFogged) {
|
||||
textureEnvironment = modulate;
|
||||
}
|
||||
#endif
|
||||
|
||||
glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, magFilter);
|
||||
glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, minFilter);
|
||||
@@ -803,59 +775,54 @@ void ReInit(void)
|
||||
|
||||
void Draw(void)
|
||||
{
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glFrustum(-0.2, 0.2, -0.2, 0.2, 0.15, 9.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
|
||||
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
|
||||
if (isFogged) {
|
||||
|
||||
/* draw cage */
|
||||
if (isFogged)
|
||||
glEnable(GL_FOG);
|
||||
glColor3fv(RGBMap[deepestColor]);
|
||||
} else {
|
||||
glColor3fv(RGBMap[COLOR_WHITE]);
|
||||
}
|
||||
else
|
||||
glDisable(GL_FOG);
|
||||
glColor3f(1, 1, 1);
|
||||
glDisable(GL_LIGHTING);
|
||||
glDisable(GL_LIGHT0);
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
glCallList(cage);
|
||||
|
||||
glPushMatrix();
|
||||
glTranslatef(0.0, 0.0, zTranslate);
|
||||
glRotatef(xRotation, 1, 0, 0);
|
||||
glRotatef(yRotation, 0, 1, 0);
|
||||
|
||||
if (isLit == TRUE) {
|
||||
/* draw object */
|
||||
if (isLit)
|
||||
glEnable(GL_LIGHTING);
|
||||
glEnable(GL_LIGHT0);
|
||||
}
|
||||
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
if (isFogged) {
|
||||
glDisable(GL_FOG);
|
||||
}
|
||||
glPolygonMode(GL_FRONT, GL_FILL);
|
||||
glColor3fv(RGBMap[deepestColor]);
|
||||
glCallList(genericObject);
|
||||
else
|
||||
glColor3f(1.0, 0.5, 0.2);
|
||||
if (doTexture)
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
|
||||
glPushMatrix();
|
||||
glTranslatef(0.0, 0.0, zTranslate);
|
||||
glRotatef(xRotation, 1, 0, 0);
|
||||
glRotatef(yRotation, 0, 1, 0);
|
||||
glCallList(genericObject);
|
||||
glPopMatrix();
|
||||
glFlush();
|
||||
|
||||
if (autoRotate) {
|
||||
xRotation += .75;
|
||||
yRotation += .375;
|
||||
}
|
||||
glFlush();
|
||||
glutSwapBuffers();
|
||||
}
|
||||
|
||||
void Reshape(int width, int height)
|
||||
{
|
||||
|
||||
W = width;
|
||||
H = height;
|
||||
ReInit();
|
||||
glViewport( 0, 0, width, height ); /*new*/
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glFrustum(-0.2, 0.2, -0.2, 0.2, 0.15, 9.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
}
|
||||
|
||||
void Idle(void)
|
||||
{
|
||||
xRotation += .75;
|
||||
yRotation += .375;
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
void Key2(int key, int x, int y)
|
||||
@@ -864,27 +831,28 @@ void Key2(int key, int x, int y)
|
||||
switch (key) {
|
||||
case GLUT_KEY_LEFT:
|
||||
yRotation -= 0.5;
|
||||
autoRotate = FALSE;
|
||||
autoRotate = GL_FALSE;
|
||||
ReInit();
|
||||
break;
|
||||
case GLUT_KEY_RIGHT:
|
||||
yRotation += 0.5;
|
||||
autoRotate = FALSE;
|
||||
autoRotate = GL_FALSE;
|
||||
ReInit();
|
||||
break;
|
||||
case GLUT_KEY_UP:
|
||||
xRotation -= 0.5;
|
||||
autoRotate = FALSE;
|
||||
autoRotate = GL_FALSE;
|
||||
ReInit();
|
||||
break;
|
||||
case GLUT_KEY_DOWN:
|
||||
xRotation += 0.5;
|
||||
autoRotate = FALSE;
|
||||
autoRotate = GL_FALSE;
|
||||
ReInit();
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
void Key(unsigned char key, int x, int y)
|
||||
@@ -892,15 +860,28 @@ void Key(unsigned char key, int x, int y)
|
||||
|
||||
switch (key) {
|
||||
case 27:
|
||||
free(image->data);
|
||||
/* free(image->data);*/
|
||||
exit(1);
|
||||
|
||||
case 'a':
|
||||
autoRotate = !autoRotate;
|
||||
if (autoRotate)
|
||||
glutIdleFunc(Idle);
|
||||
else
|
||||
glutIdleFunc(NULL);
|
||||
|
||||
ReInit();
|
||||
break;
|
||||
case 'c':
|
||||
genericObject = (genericObject == cube) ? cylinder : cube;
|
||||
case 'o':
|
||||
if (genericObject == cube) {
|
||||
genericObject = cylinder;
|
||||
}
|
||||
else if (genericObject == cylinder) {
|
||||
genericObject = torus;
|
||||
}
|
||||
else {
|
||||
genericObject = cube;
|
||||
}
|
||||
ReInit();
|
||||
break;
|
||||
case 'd':
|
||||
@@ -920,7 +901,7 @@ void Key(unsigned char key, int x, int y)
|
||||
ReInit();
|
||||
break;
|
||||
case 't':
|
||||
genericObject = torus;
|
||||
doTexture = !doTexture;
|
||||
ReInit();
|
||||
break;
|
||||
case '0':
|
||||
@@ -958,14 +939,14 @@ void Key(unsigned char key, int x, int y)
|
||||
default:
|
||||
return;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
GLenum Args(int argc, char **argv)
|
||||
{
|
||||
GLint i;
|
||||
|
||||
doubleBuffer = GL_FALSE;
|
||||
numComponents = 4;
|
||||
doubleBuffer = GL_TRUE;
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
if (strcmp(argv[i], "-sb") == 0) {
|
||||
@@ -979,10 +960,6 @@ GLenum Args(int argc, char **argv)
|
||||
} else {
|
||||
imageFileName = argv[++i];
|
||||
}
|
||||
} else if (strcmp(argv[i], "-4") == 0) {
|
||||
numComponents = 4;
|
||||
} else if (strcmp(argv[i], "-3") == 0) {
|
||||
numComponents = 3;
|
||||
} else {
|
||||
printf("%s (Bad option).\n", argv[i]);
|
||||
return GL_FALSE;
|
||||
@@ -991,11 +968,6 @@ GLenum Args(int argc, char **argv)
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
void GLUTCALLBACK glut_post_redisplay_p(void)
|
||||
{
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
GLenum type;
|
||||
@@ -1027,7 +999,7 @@ int main(int argc, char **argv)
|
||||
glutKeyboardFunc(Key);
|
||||
glutSpecialFunc(Key2);
|
||||
glutDisplayFunc(Draw);
|
||||
glutIdleFunc(glut_post_redisplay_p);
|
||||
glutIdleFunc(Idle);
|
||||
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
|
||||
@@ -129,6 +129,9 @@ void MoveStars(void)
|
||||
if (stars[n].rotation > MAXANGLES) {
|
||||
stars[n].rotation = 0.0;
|
||||
}
|
||||
else if (stars[n].rotation < 0.0) {
|
||||
stars[n].rotation += 360.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -281,7 +284,7 @@ static GLenum Args(int argc, char **argv)
|
||||
{
|
||||
GLint i;
|
||||
|
||||
doubleBuffer = GL_FALSE;
|
||||
doubleBuffer = GL_TRUE;
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
if (strcmp(argv[i], "-sb") == 0) {
|
||||
|
||||
@@ -285,7 +285,7 @@ static GLenum Args(int argc, char **argv)
|
||||
{
|
||||
GLint i;
|
||||
|
||||
doubleBuffer = GL_FALSE;
|
||||
doubleBuffer = GL_TRUE;
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
if (strcmp(argv[i], "-sb") == 0) {
|
||||
|
||||
@@ -128,7 +128,7 @@ static void Animate(void)
|
||||
glColor3fv(facet->color);
|
||||
} else {
|
||||
thisColor = facet->color;
|
||||
glMaterialfv(GL_FRONT_AND_BACK, GL_COLOR_INDEXES,
|
||||
glMaterialfv(GL_FRONT_AND_BACK, GL_COLOR_INDEXES,
|
||||
facet->color);
|
||||
}
|
||||
} else {
|
||||
@@ -182,12 +182,12 @@ static void Animate(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void SetColorMap(void)
|
||||
static void SetColorMap(void)
|
||||
{
|
||||
static float green[3] = {0.2, 1.0, 0.2};
|
||||
static float red[3] = {1.0, 0.2, 0.2};
|
||||
float *color, percent;
|
||||
GLint *indexes, entries, i, j;
|
||||
float *color = 0, percent;
|
||||
GLint *indexes = 0, entries, i, j;
|
||||
|
||||
entries = glutGet(GLUT_WINDOW_COLORMAP_SIZE);
|
||||
|
||||
@@ -360,7 +360,7 @@ static void InitMaterials(void)
|
||||
glLightModelfv(GL_LIGHT_MODEL_TWO_SIDE, lmodel_twoside);
|
||||
glEnable(GL_LIGHTING);
|
||||
glEnable(GL_LIGHT0);
|
||||
|
||||
|
||||
glMaterialfv(GL_FRONT, GL_SHININESS, front_mat_shininess);
|
||||
glMaterialfv(GL_FRONT, GL_SPECULAR, front_mat_specular);
|
||||
glMaterialfv(GL_FRONT, GL_DIFFUSE, front_mat_diffuse);
|
||||
@@ -394,7 +394,7 @@ static void Init(void)
|
||||
glClearColor(0.0, 0.0, 0.0, 0.0);
|
||||
|
||||
glShadeModel(GL_FLAT);
|
||||
|
||||
|
||||
glFrontFace(GL_CW);
|
||||
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
@@ -515,7 +515,7 @@ static GLenum Args(int argc, char **argv)
|
||||
GLint i;
|
||||
|
||||
rgb = GL_TRUE;
|
||||
doubleBuffer = GL_FALSE;
|
||||
doubleBuffer = GL_TRUE;
|
||||
frames = 10;
|
||||
widthX = 10;
|
||||
widthY = 10;
|
||||
|
||||
38
progs/tests/Makefile
Normal file
38
progs/tests/Makefile
Normal file
@@ -0,0 +1,38 @@
|
||||
|
||||
# Simple makefile for compiling test programs on Linux
|
||||
# These programs aren't intended to be included with the normal
|
||||
# distro as they're not too interesting but good for testing during
|
||||
# development.
|
||||
|
||||
|
||||
CC = gcc
|
||||
CFLAGS = -g -I../include
|
||||
LIBS = -L../lib -lglut -lGLU -lGL -L/usr/X11R6/lib -lX11 -lXext -lm
|
||||
|
||||
PROGS = cva \
|
||||
dinoshade \
|
||||
fogcoord \
|
||||
manytex \
|
||||
multipal \
|
||||
projtex \
|
||||
seccolor \
|
||||
sharedtex \
|
||||
texline
|
||||
|
||||
|
||||
##### RULES #####
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c
|
||||
|
||||
.c:
|
||||
$(CC) $(CFLAGS) $< $(LIBS) -o $@
|
||||
|
||||
|
||||
##### TARGETS #####
|
||||
|
||||
default: $(PROGS)
|
||||
|
||||
clean:
|
||||
rm -f $(PROGS)
|
||||
rm -f *.o
|
||||
154
progs/tests/cva.c
Normal file
154
progs/tests/cva.c
Normal file
@@ -0,0 +1,154 @@
|
||||
/* $Id: cva.c,v 1.3 2000/11/30 03:06:56 gareth Exp $ */
|
||||
|
||||
/*
|
||||
* Trivial CVA test, good for testing driver fastpaths (especially
|
||||
* indexed vertex buffers if they are supported).
|
||||
*
|
||||
* Gareth Hughes
|
||||
* November 2000
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#define GL_GLEXT_LEGACY
|
||||
#include <GL/glut.h>
|
||||
|
||||
|
||||
GLfloat verts[][4] = {
|
||||
{ -0.5, -0.5, -2.0, 0.0 },
|
||||
{ 0.5, -0.5, -2.0, 0.0 },
|
||||
{ -0.5, 0.5, -2.0, 0.0 },
|
||||
{ 0.5, 0.5, -2.0, 0.0 },
|
||||
};
|
||||
|
||||
GLubyte color[][4] = {
|
||||
{ 0xff, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0xff, 0x00, 0x00 },
|
||||
{ 0x00, 0x00, 0xff, 0x00 },
|
||||
{ 0xff, 0xff, 0xff, 0x00 },
|
||||
};
|
||||
|
||||
GLuint indices[] = { 0, 1, 2, 3 };
|
||||
|
||||
GLboolean compiled = GL_TRUE;
|
||||
GLboolean doubleBuffer = GL_TRUE;
|
||||
|
||||
|
||||
void init( void )
|
||||
{
|
||||
glClearColor( 0.0, 0.0, 0.0, 0.0 );
|
||||
glShadeModel( GL_SMOOTH );
|
||||
|
||||
glFrontFace( GL_CCW );
|
||||
glCullFace( GL_BACK );
|
||||
glEnable( GL_CULL_FACE );
|
||||
|
||||
glEnable( GL_DEPTH_TEST );
|
||||
|
||||
glEnableClientState( GL_VERTEX_ARRAY );
|
||||
glEnableClientState( GL_COLOR_ARRAY );
|
||||
|
||||
glMatrixMode( GL_PROJECTION );
|
||||
glLoadIdentity();
|
||||
glFrustum( -1.0, 1.0, -1.0, 1.0, 2.0, 10.0 );
|
||||
glMatrixMode( GL_MODELVIEW );
|
||||
glLoadIdentity();
|
||||
|
||||
glVertexPointer( 3, GL_FLOAT, sizeof(verts[0]), verts );
|
||||
glColorPointer( 4, GL_UNSIGNED_BYTE, 0, color );
|
||||
|
||||
#ifdef GL_EXT_compiled_vertex_array
|
||||
if ( compiled ) {
|
||||
glLockArraysEXT( 0, 4 );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void display( void )
|
||||
{
|
||||
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
|
||||
|
||||
glDrawElements( GL_TRIANGLES, 3, GL_UNSIGNED_INT, indices );
|
||||
|
||||
glFlush();
|
||||
if ( doubleBuffer ) {
|
||||
glutSwapBuffers();
|
||||
}
|
||||
}
|
||||
|
||||
void keyboard( unsigned char key, int x, int y )
|
||||
{
|
||||
switch ( key ) {
|
||||
case 27:
|
||||
exit( 0 );
|
||||
break;
|
||||
}
|
||||
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
GLboolean args( int argc, char **argv )
|
||||
{
|
||||
GLint i;
|
||||
|
||||
doubleBuffer = GL_TRUE;
|
||||
|
||||
for ( i = 1 ; i < argc ; i++ ) {
|
||||
if ( strcmp( argv[i], "-sb" ) == 0 ) {
|
||||
doubleBuffer = GL_FALSE;
|
||||
} else if ( strcmp( argv[i], "-db" ) == 0 ) {
|
||||
doubleBuffer = GL_TRUE;
|
||||
} else {
|
||||
fprintf( stderr, "%s (Bad option).\n", argv[i] );
|
||||
return GL_FALSE;
|
||||
}
|
||||
}
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
int main( int argc, char **argv )
|
||||
{
|
||||
GLenum type;
|
||||
char *string;
|
||||
|
||||
glutInit( &argc, argv );
|
||||
|
||||
if ( args( argc, argv ) == GL_FALSE ) {
|
||||
exit( 1 );
|
||||
}
|
||||
|
||||
type = GLUT_RGB | GLUT_DEPTH;
|
||||
type |= ( doubleBuffer ) ? GLUT_DOUBLE : GLUT_SINGLE;
|
||||
|
||||
glutInitDisplayMode( type );
|
||||
glutInitWindowSize( 250, 250 );
|
||||
glutInitWindowPosition( 100, 100 );
|
||||
glutCreateWindow( "CVA Test" );
|
||||
|
||||
/* Make sure the server supports GL 1.2 vertex arrays.
|
||||
*/
|
||||
string = (char *) glGetString( GL_VERSION );
|
||||
|
||||
if ( !strstr( string, "1.2" ) ) {
|
||||
fprintf( stderr, "This program requires OpenGL 1.2 vertex arrays.\n" );
|
||||
exit( -1 );
|
||||
}
|
||||
|
||||
/* See if the server supports compiled vertex arrays.
|
||||
*/
|
||||
string = (char *) glGetString( GL_EXTENSIONS );
|
||||
|
||||
if ( !strstr( string, "GL_EXT_compiled_vertex_array" ) ) {
|
||||
fprintf( stderr, "Compiled vertex arrays not supported by this renderer.\n" );
|
||||
compiled = GL_FALSE;
|
||||
}
|
||||
|
||||
init();
|
||||
|
||||
glutDisplayFunc( display );
|
||||
glutKeyboardFunc( keyboard );
|
||||
glutMainLoop();
|
||||
|
||||
return 0;
|
||||
}
|
||||
891
progs/tests/dinoshade.c
Normal file
891
progs/tests/dinoshade.c
Normal file
@@ -0,0 +1,891 @@
|
||||
|
||||
/* Copyright (c) Mark J. Kilgard, 1994, 1997. */
|
||||
|
||||
/* This program is freely distributable without licensing fees
|
||||
and is provided without guarantee or warrantee expressed or
|
||||
implied. This program is -not- in the public domain. */
|
||||
|
||||
/* Example for PC game developers to show how to *combine* texturing,
|
||||
reflections, and projected shadows all in real-time with OpenGL.
|
||||
Robust reflections use stenciling. Robust projected shadows
|
||||
use both stenciling and polygon offset. PC game programmers
|
||||
should realize that neither stenciling nor polygon offset are
|
||||
supported by Direct3D, so these real-time rendering algorithms
|
||||
are only really viable with OpenGL.
|
||||
|
||||
The program has modes for disabling the stenciling and polygon
|
||||
offset uses. It is worth running this example with these features
|
||||
toggled off so you can see the sort of artifacts that result.
|
||||
|
||||
Notice that the floor texturing, reflections, and shadowing
|
||||
all co-exist properly. */
|
||||
|
||||
/* When you run this program: Left mouse button controls the
|
||||
view. Middle mouse button controls light position (left &
|
||||
right rotates light around dino; up & down moves light
|
||||
position up and down). Right mouse button pops up menu. */
|
||||
|
||||
/* Check out the comments in the "redraw" routine to see how the
|
||||
reflection blending and surface stenciling is done. You can
|
||||
also see in "redraw" how the projected shadows are rendered,
|
||||
including the use of stenciling and polygon offset. */
|
||||
|
||||
/* This program is derived from glutdino.c */
|
||||
|
||||
/* Compile: cc -o dinoshade dinoshade.c -lglut -lGLU -lGL -lXmu -lXext -lX11 -lm */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <math.h> /* for cos(), sin(), and sqrt() */
|
||||
#include <GL/glut.h> /* OpenGL Utility Toolkit header */
|
||||
|
||||
/* Some <math.h> files do not define M_PI... */
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265358979323846
|
||||
#endif
|
||||
|
||||
/* Variable controlling various rendering modes. */
|
||||
static int stencilReflection = 1, stencilShadow = 1, offsetShadow = 1;
|
||||
static int renderShadow = 1, renderDinosaur = 1, renderReflection = 1;
|
||||
static int linearFiltering = 0, useMipmaps = 0, useTexture = 1;
|
||||
static int reportSpeed = 0;
|
||||
static int animation = 1;
|
||||
static GLboolean lightSwitch = GL_TRUE;
|
||||
static int directionalLight = 1;
|
||||
static int forceExtension = 0;
|
||||
|
||||
/* Time varying or user-controled variables. */
|
||||
static float jump = 0.0;
|
||||
static float lightAngle = 0.0, lightHeight = 20;
|
||||
GLfloat angle = -150; /* in degrees */
|
||||
GLfloat angle2 = 30; /* in degrees */
|
||||
|
||||
int moving, startx, starty;
|
||||
int lightMoving = 0, lightStartX, lightStartY;
|
||||
|
||||
enum {
|
||||
MISSING, EXTENSION, ONE_DOT_ONE
|
||||
};
|
||||
int polygonOffsetVersion;
|
||||
|
||||
static GLdouble bodyWidth = 3.0;
|
||||
/* *INDENT-OFF* */
|
||||
static GLfloat body[][2] = { {0, 3}, {1, 1}, {5, 1}, {8, 4}, {10, 4}, {11, 5},
|
||||
{11, 11.5}, {13, 12}, {13, 13}, {10, 13.5}, {13, 14}, {13, 15}, {11, 16},
|
||||
{8, 16}, {7, 15}, {7, 13}, {8, 12}, {7, 11}, {6, 6}, {4, 3}, {3, 2},
|
||||
{1, 2} };
|
||||
static GLfloat arm[][2] = { {8, 10}, {9, 9}, {10, 9}, {13, 8}, {14, 9}, {16, 9},
|
||||
{15, 9.5}, {16, 10}, {15, 10}, {15.5, 11}, {14.5, 10}, {14, 11}, {14, 10},
|
||||
{13, 9}, {11, 11}, {9, 11} };
|
||||
static GLfloat leg[][2] = { {8, 6}, {8, 4}, {9, 3}, {9, 2}, {8, 1}, {8, 0.5}, {9, 0},
|
||||
{12, 0}, {10, 1}, {10, 2}, {12, 4}, {11, 6}, {10, 7}, {9, 7} };
|
||||
static GLfloat eye[][2] = { {8.75, 15}, {9, 14.7}, {9.6, 14.7}, {10.1, 15},
|
||||
{9.6, 15.25}, {9, 15.25} };
|
||||
static GLfloat lightPosition[4];
|
||||
static GLfloat lightColor[] = {0.8, 1.0, 0.8, 1.0}; /* green-tinted */
|
||||
static GLfloat skinColor[] = {0.1, 1.0, 0.1, 1.0}, eyeColor[] = {1.0, 0.2, 0.2, 1.0};
|
||||
/* *INDENT-ON* */
|
||||
|
||||
/* Nice floor texture tiling pattern. */
|
||||
static char *circles[] = {
|
||||
"....xxxx........",
|
||||
"..xxxxxxxx......",
|
||||
".xxxxxxxxxx.....",
|
||||
".xxx....xxx.....",
|
||||
"xxx......xxx....",
|
||||
"xxx......xxx....",
|
||||
"xxx......xxx....",
|
||||
"xxx......xxx....",
|
||||
".xxx....xxx.....",
|
||||
".xxxxxxxxxx.....",
|
||||
"..xxxxxxxx......",
|
||||
"....xxxx........",
|
||||
"................",
|
||||
"................",
|
||||
"................",
|
||||
"................",
|
||||
};
|
||||
|
||||
static void
|
||||
makeFloorTexture(void)
|
||||
{
|
||||
GLubyte floorTexture[16][16][3];
|
||||
GLubyte *loc;
|
||||
int s, t;
|
||||
|
||||
/* Setup RGB image for the texture. */
|
||||
loc = (GLubyte*) floorTexture;
|
||||
for (t = 0; t < 16; t++) {
|
||||
for (s = 0; s < 16; s++) {
|
||||
if (circles[t][s] == 'x') {
|
||||
/* Nice green. */
|
||||
loc[0] = 0x1f;
|
||||
loc[1] = 0x8f;
|
||||
loc[2] = 0x1f;
|
||||
} else {
|
||||
/* Light gray. */
|
||||
loc[0] = 0xaa;
|
||||
loc[1] = 0xaa;
|
||||
loc[2] = 0xaa;
|
||||
}
|
||||
loc += 3;
|
||||
}
|
||||
}
|
||||
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
|
||||
if (useMipmaps) {
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
|
||||
GL_LINEAR_MIPMAP_LINEAR);
|
||||
gluBuild2DMipmaps(GL_TEXTURE_2D, 3, 16, 16,
|
||||
GL_RGB, GL_UNSIGNED_BYTE, floorTexture);
|
||||
} else {
|
||||
if (linearFiltering) {
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
} else {
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
}
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, 3, 16, 16, 0,
|
||||
GL_RGB, GL_UNSIGNED_BYTE, floorTexture);
|
||||
}
|
||||
}
|
||||
|
||||
enum {
|
||||
X, Y, Z, W
|
||||
};
|
||||
enum {
|
||||
A, B, C, D
|
||||
};
|
||||
|
||||
/* Create a matrix that will project the desired shadow. */
|
||||
void
|
||||
shadowMatrix(GLfloat shadowMat[4][4],
|
||||
GLfloat groundplane[4],
|
||||
GLfloat lightpos[4])
|
||||
{
|
||||
GLfloat dot;
|
||||
|
||||
/* Find dot product between light position vector and ground plane normal. */
|
||||
dot = groundplane[X] * lightpos[X] +
|
||||
groundplane[Y] * lightpos[Y] +
|
||||
groundplane[Z] * lightpos[Z] +
|
||||
groundplane[W] * lightpos[W];
|
||||
|
||||
shadowMat[0][0] = dot - lightpos[X] * groundplane[X];
|
||||
shadowMat[1][0] = 0.f - lightpos[X] * groundplane[Y];
|
||||
shadowMat[2][0] = 0.f - lightpos[X] * groundplane[Z];
|
||||
shadowMat[3][0] = 0.f - lightpos[X] * groundplane[W];
|
||||
|
||||
shadowMat[X][1] = 0.f - lightpos[Y] * groundplane[X];
|
||||
shadowMat[1][1] = dot - lightpos[Y] * groundplane[Y];
|
||||
shadowMat[2][1] = 0.f - lightpos[Y] * groundplane[Z];
|
||||
shadowMat[3][1] = 0.f - lightpos[Y] * groundplane[W];
|
||||
|
||||
shadowMat[X][2] = 0.f - lightpos[Z] * groundplane[X];
|
||||
shadowMat[1][2] = 0.f - lightpos[Z] * groundplane[Y];
|
||||
shadowMat[2][2] = dot - lightpos[Z] * groundplane[Z];
|
||||
shadowMat[3][2] = 0.f - lightpos[Z] * groundplane[W];
|
||||
|
||||
shadowMat[X][3] = 0.f - lightpos[W] * groundplane[X];
|
||||
shadowMat[1][3] = 0.f - lightpos[W] * groundplane[Y];
|
||||
shadowMat[2][3] = 0.f - lightpos[W] * groundplane[Z];
|
||||
shadowMat[3][3] = dot - lightpos[W] * groundplane[W];
|
||||
|
||||
}
|
||||
|
||||
/* Find the plane equation given 3 points. */
|
||||
void
|
||||
findPlane(GLfloat plane[4],
|
||||
GLfloat v0[3], GLfloat v1[3], GLfloat v2[3])
|
||||
{
|
||||
GLfloat vec0[3], vec1[3];
|
||||
|
||||
/* Need 2 vectors to find cross product. */
|
||||
vec0[X] = v1[X] - v0[X];
|
||||
vec0[Y] = v1[Y] - v0[Y];
|
||||
vec0[Z] = v1[Z] - v0[Z];
|
||||
|
||||
vec1[X] = v2[X] - v0[X];
|
||||
vec1[Y] = v2[Y] - v0[Y];
|
||||
vec1[Z] = v2[Z] - v0[Z];
|
||||
|
||||
/* find cross product to get A, B, and C of plane equation */
|
||||
plane[A] = vec0[Y] * vec1[Z] - vec0[Z] * vec1[Y];
|
||||
plane[B] = -(vec0[X] * vec1[Z] - vec0[Z] * vec1[X]);
|
||||
plane[C] = vec0[X] * vec1[Y] - vec0[Y] * vec1[X];
|
||||
|
||||
plane[D] = -(plane[A] * v0[X] + plane[B] * v0[Y] + plane[C] * v0[Z]);
|
||||
}
|
||||
|
||||
void
|
||||
extrudeSolidFromPolygon(GLfloat data[][2], unsigned int dataSize,
|
||||
GLdouble thickness, GLuint side, GLuint edge, GLuint whole)
|
||||
{
|
||||
static GLUtriangulatorObj *tobj = NULL;
|
||||
GLdouble vertex[3], dx, dy, len;
|
||||
int i;
|
||||
int count = (int) (dataSize / (2 * sizeof(GLfloat)));
|
||||
|
||||
if (tobj == NULL) {
|
||||
tobj = gluNewTess(); /* create and initialize a GLU
|
||||
polygon tesselation object */
|
||||
gluTessCallback(tobj, GLU_BEGIN, glBegin);
|
||||
gluTessCallback(tobj, GLU_VERTEX, glVertex2fv); /* semi-tricky */
|
||||
gluTessCallback(tobj, GLU_END, glEnd);
|
||||
}
|
||||
glNewList(side, GL_COMPILE);
|
||||
glShadeModel(GL_SMOOTH); /* smooth minimizes seeing
|
||||
tessellation */
|
||||
gluBeginPolygon(tobj);
|
||||
for (i = 0; i < count; i++) {
|
||||
vertex[0] = data[i][0];
|
||||
vertex[1] = data[i][1];
|
||||
vertex[2] = 0;
|
||||
gluTessVertex(tobj, vertex, data[i]);
|
||||
}
|
||||
gluEndPolygon(tobj);
|
||||
glEndList();
|
||||
glNewList(edge, GL_COMPILE);
|
||||
glShadeModel(GL_FLAT); /* flat shade keeps angular hands
|
||||
from being "smoothed" */
|
||||
glBegin(GL_QUAD_STRIP);
|
||||
for (i = 0; i <= count; i++) {
|
||||
/* mod function handles closing the edge */
|
||||
glVertex3f(data[i % count][0], data[i % count][1], 0.0);
|
||||
glVertex3f(data[i % count][0], data[i % count][1], thickness);
|
||||
/* Calculate a unit normal by dividing by Euclidean
|
||||
distance. We * could be lazy and use
|
||||
glEnable(GL_NORMALIZE) so we could pass in * arbitrary
|
||||
normals for a very slight performance hit. */
|
||||
dx = data[(i + 1) % count][1] - data[i % count][1];
|
||||
dy = data[i % count][0] - data[(i + 1) % count][0];
|
||||
len = sqrt(dx * dx + dy * dy);
|
||||
glNormal3f(dx / len, dy / len, 0.0);
|
||||
}
|
||||
glEnd();
|
||||
glEndList();
|
||||
glNewList(whole, GL_COMPILE);
|
||||
glFrontFace(GL_CW);
|
||||
glCallList(edge);
|
||||
glNormal3f(0.0, 0.0, -1.0); /* constant normal for side */
|
||||
glCallList(side);
|
||||
glPushMatrix();
|
||||
glTranslatef(0.0, 0.0, thickness);
|
||||
glFrontFace(GL_CCW);
|
||||
glNormal3f(0.0, 0.0, 1.0); /* opposite normal for other side */
|
||||
glCallList(side);
|
||||
glPopMatrix();
|
||||
glEndList();
|
||||
}
|
||||
|
||||
/* Enumerants for refering to display lists. */
|
||||
typedef enum {
|
||||
RESERVED, BODY_SIDE, BODY_EDGE, BODY_WHOLE, ARM_SIDE, ARM_EDGE, ARM_WHOLE,
|
||||
LEG_SIDE, LEG_EDGE, LEG_WHOLE, EYE_SIDE, EYE_EDGE, EYE_WHOLE
|
||||
} displayLists;
|
||||
|
||||
static void
|
||||
makeDinosaur(void)
|
||||
{
|
||||
extrudeSolidFromPolygon(body, sizeof(body), bodyWidth,
|
||||
BODY_SIDE, BODY_EDGE, BODY_WHOLE);
|
||||
extrudeSolidFromPolygon(arm, sizeof(arm), bodyWidth / 4,
|
||||
ARM_SIDE, ARM_EDGE, ARM_WHOLE);
|
||||
extrudeSolidFromPolygon(leg, sizeof(leg), bodyWidth / 2,
|
||||
LEG_SIDE, LEG_EDGE, LEG_WHOLE);
|
||||
extrudeSolidFromPolygon(eye, sizeof(eye), bodyWidth + 0.2,
|
||||
EYE_SIDE, EYE_EDGE, EYE_WHOLE);
|
||||
}
|
||||
|
||||
static void
|
||||
drawDinosaur(void)
|
||||
|
||||
{
|
||||
glPushMatrix();
|
||||
/* Translate the dinosaur to be at (0,8,0). */
|
||||
glTranslatef(-8, 0, -bodyWidth / 2);
|
||||
glTranslatef(0.0, jump, 0.0);
|
||||
glMaterialfv(GL_FRONT, GL_DIFFUSE, skinColor);
|
||||
glCallList(BODY_WHOLE);
|
||||
glTranslatef(0.0, 0.0, bodyWidth);
|
||||
glCallList(ARM_WHOLE);
|
||||
glCallList(LEG_WHOLE);
|
||||
glTranslatef(0.0, 0.0, -bodyWidth - bodyWidth / 4);
|
||||
glCallList(ARM_WHOLE);
|
||||
glTranslatef(0.0, 0.0, -bodyWidth / 4);
|
||||
glCallList(LEG_WHOLE);
|
||||
glTranslatef(0.0, 0.0, bodyWidth / 2 - 0.1);
|
||||
glMaterialfv(GL_FRONT, GL_DIFFUSE, eyeColor);
|
||||
glCallList(EYE_WHOLE);
|
||||
glPopMatrix();
|
||||
}
|
||||
|
||||
static GLfloat floorVertices[4][3] = {
|
||||
{ -20.0, 0.0, 20.0 },
|
||||
{ 20.0, 0.0, 20.0 },
|
||||
{ 20.0, 0.0, -20.0 },
|
||||
{ -20.0, 0.0, -20.0 },
|
||||
};
|
||||
|
||||
/* Draw a floor (possibly textured). */
|
||||
static void
|
||||
drawFloor(void)
|
||||
{
|
||||
glDisable(GL_LIGHTING);
|
||||
|
||||
if (useTexture) {
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
}
|
||||
|
||||
glBegin(GL_QUADS);
|
||||
glTexCoord2f(0.0, 0.0);
|
||||
glVertex3fv(floorVertices[0]);
|
||||
glTexCoord2f(0.0, 16.0);
|
||||
glVertex3fv(floorVertices[1]);
|
||||
glTexCoord2f(16.0, 16.0);
|
||||
glVertex3fv(floorVertices[2]);
|
||||
glTexCoord2f(16.0, 0.0);
|
||||
glVertex3fv(floorVertices[3]);
|
||||
glEnd();
|
||||
|
||||
if (useTexture) {
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
}
|
||||
|
||||
glEnable(GL_LIGHTING);
|
||||
}
|
||||
|
||||
static GLfloat floorPlane[4];
|
||||
static GLfloat floorShadow[4][4];
|
||||
|
||||
static void
|
||||
redraw(void)
|
||||
{
|
||||
int start, end;
|
||||
|
||||
if (reportSpeed) {
|
||||
start = glutGet(GLUT_ELAPSED_TIME);
|
||||
}
|
||||
|
||||
/* Clear; default stencil clears to zero. */
|
||||
if ((stencilReflection && renderReflection) || (stencilShadow && renderShadow)) {
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
|
||||
} else {
|
||||
/* Avoid clearing stencil when not using it. */
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
}
|
||||
|
||||
/* Reposition the light source. */
|
||||
lightPosition[0] = 12*cos(lightAngle);
|
||||
lightPosition[1] = lightHeight;
|
||||
lightPosition[2] = 12*sin(lightAngle);
|
||||
if (directionalLight) {
|
||||
lightPosition[3] = 0.0;
|
||||
} else {
|
||||
lightPosition[3] = 1.0;
|
||||
}
|
||||
|
||||
shadowMatrix(floorShadow, floorPlane, lightPosition);
|
||||
|
||||
glPushMatrix();
|
||||
/* Perform scene rotations based on user mouse input. */
|
||||
glRotatef(angle2, 1.0, 0.0, 0.0);
|
||||
glRotatef(angle, 0.0, 1.0, 0.0);
|
||||
|
||||
/* Tell GL new light source position. */
|
||||
glLightfv(GL_LIGHT0, GL_POSITION, lightPosition);
|
||||
|
||||
if (renderReflection) {
|
||||
if (stencilReflection) {
|
||||
/* We can eliminate the visual "artifact" of seeing the "flipped"
|
||||
dinosaur underneath the floor by using stencil. The idea is
|
||||
draw the floor without color or depth update but so that
|
||||
a stencil value of one is where the floor will be. Later when
|
||||
rendering the dinosaur reflection, we will only update pixels
|
||||
with a stencil value of 1 to make sure the reflection only
|
||||
lives on the floor, not below the floor. */
|
||||
|
||||
/* Don't update color or depth. */
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
|
||||
|
||||
/* Draw 1 into the stencil buffer. */
|
||||
glEnable(GL_STENCIL_TEST);
|
||||
glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE);
|
||||
glStencilFunc(GL_ALWAYS, 1, 0xffffffff);
|
||||
|
||||
/* Now render floor; floor pixels just get their stencil set to 1. */
|
||||
drawFloor();
|
||||
|
||||
/* Re-enable update of color and depth. */
|
||||
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
|
||||
/* Now, only render where stencil is set to 1. */
|
||||
glStencilFunc(GL_EQUAL, 1, 0xffffffff); /* draw if ==1 */
|
||||
glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
|
||||
}
|
||||
|
||||
glPushMatrix();
|
||||
|
||||
/* The critical reflection step: Reflect dinosaur through the floor
|
||||
(the Y=0 plane) to make a relection. */
|
||||
glScalef(1.0, -1.0, 1.0);
|
||||
|
||||
/* Reflect the light position. */
|
||||
glLightfv(GL_LIGHT0, GL_POSITION, lightPosition);
|
||||
|
||||
/* To avoid our normals getting reversed and hence botched lighting
|
||||
on the reflection, turn on normalize. */
|
||||
glEnable(GL_NORMALIZE);
|
||||
glCullFace(GL_FRONT);
|
||||
|
||||
/* Draw the reflected dinosaur. */
|
||||
drawDinosaur();
|
||||
|
||||
/* Disable noramlize again and re-enable back face culling. */
|
||||
glDisable(GL_NORMALIZE);
|
||||
glCullFace(GL_BACK);
|
||||
|
||||
glPopMatrix();
|
||||
|
||||
/* Switch back to the unreflected light position. */
|
||||
glLightfv(GL_LIGHT0, GL_POSITION, lightPosition);
|
||||
|
||||
if (stencilReflection) {
|
||||
glDisable(GL_STENCIL_TEST);
|
||||
}
|
||||
}
|
||||
|
||||
/* Back face culling will get used to only draw either the top or the
|
||||
bottom floor. This let's us get a floor with two distinct
|
||||
appearances. The top floor surface is reflective and kind of red.
|
||||
The bottom floor surface is not reflective and blue. */
|
||||
|
||||
/* Draw "bottom" of floor in blue. */
|
||||
glFrontFace(GL_CW); /* Switch face orientation. */
|
||||
glColor4f(0.1, 0.1, 0.7, 1.0);
|
||||
drawFloor();
|
||||
glFrontFace(GL_CCW);
|
||||
|
||||
if (renderShadow) {
|
||||
if (stencilShadow) {
|
||||
/* Draw the floor with stencil value 3. This helps us only
|
||||
draw the shadow once per floor pixel (and only on the
|
||||
floor pixels). */
|
||||
glEnable(GL_STENCIL_TEST);
|
||||
glStencilFunc(GL_ALWAYS, 3, 0xffffffff);
|
||||
glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
|
||||
}
|
||||
}
|
||||
|
||||
/* Draw "top" of floor. Use blending to blend in reflection. */
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glColor4f(0.7, 0.0, 0.0, 0.3);
|
||||
glColor4f(1.0, 1.0, 1.0, 0.3);
|
||||
drawFloor();
|
||||
glDisable(GL_BLEND);
|
||||
|
||||
if (renderDinosaur) {
|
||||
/* Draw "actual" dinosaur, not its reflection. */
|
||||
drawDinosaur();
|
||||
}
|
||||
|
||||
if (renderShadow) {
|
||||
|
||||
/* Render the projected shadow. */
|
||||
|
||||
if (stencilShadow) {
|
||||
|
||||
/* Now, only render where stencil is set above 2 (ie, 3 where
|
||||
the top floor is). Update stencil with 2 where the shadow
|
||||
gets drawn so we don't redraw (and accidently reblend) the
|
||||
shadow). */
|
||||
glStencilFunc(GL_LESS, 2, 0xffffffff); /* draw if ==1 */
|
||||
glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE);
|
||||
}
|
||||
|
||||
/* To eliminate depth buffer artifacts, we use polygon offset
|
||||
to raise the depth of the projected shadow slightly so
|
||||
that it does not depth buffer alias with the floor. */
|
||||
if (offsetShadow) {
|
||||
switch (polygonOffsetVersion) {
|
||||
case EXTENSION:
|
||||
#ifdef GL_EXT_polygon_offset
|
||||
glEnable(GL_POLYGON_OFFSET_EXT);
|
||||
break;
|
||||
#endif
|
||||
#ifdef GL_VERSION_1_1
|
||||
case ONE_DOT_ONE:
|
||||
glEnable(GL_POLYGON_OFFSET_FILL);
|
||||
break;
|
||||
#endif
|
||||
case MISSING:
|
||||
/* Oh well. */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Render 50% black shadow color on top of whatever the
|
||||
floor appareance is. */
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glDisable(GL_LIGHTING); /* Force the 50% black. */
|
||||
glColor4f(0.0, 0.0, 0.0, 0.5);
|
||||
|
||||
glPushMatrix();
|
||||
/* Project the shadow. */
|
||||
glMultMatrixf((GLfloat *) floorShadow);
|
||||
drawDinosaur();
|
||||
glPopMatrix();
|
||||
|
||||
glDisable(GL_BLEND);
|
||||
glEnable(GL_LIGHTING);
|
||||
|
||||
if (offsetShadow) {
|
||||
switch (polygonOffsetVersion) {
|
||||
#ifdef GL_EXT_polygon_offset
|
||||
case EXTENSION:
|
||||
glDisable(GL_POLYGON_OFFSET_EXT);
|
||||
break;
|
||||
#endif
|
||||
#ifdef GL_VERSION_1_1
|
||||
case ONE_DOT_ONE:
|
||||
glDisable(GL_POLYGON_OFFSET_FILL);
|
||||
break;
|
||||
#endif
|
||||
case MISSING:
|
||||
/* Oh well. */
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (stencilShadow) {
|
||||
glDisable(GL_STENCIL_TEST);
|
||||
}
|
||||
}
|
||||
|
||||
glPushMatrix();
|
||||
glDisable(GL_LIGHTING);
|
||||
glColor3f(1.0, 1.0, 0.0);
|
||||
if (directionalLight) {
|
||||
/* Draw an arrowhead. */
|
||||
glDisable(GL_CULL_FACE);
|
||||
glTranslatef(lightPosition[0], lightPosition[1], lightPosition[2]);
|
||||
glRotatef(lightAngle * -180.0 / M_PI, 0, 1, 0);
|
||||
glRotatef(atan(lightHeight/12) * 180.0 / M_PI, 0, 0, 1);
|
||||
glBegin(GL_TRIANGLE_FAN);
|
||||
glVertex3f(0, 0, 0);
|
||||
glVertex3f(2, 1, 1);
|
||||
glVertex3f(2, -1, 1);
|
||||
glVertex3f(2, -1, -1);
|
||||
glVertex3f(2, 1, -1);
|
||||
glVertex3f(2, 1, 1);
|
||||
glEnd();
|
||||
/* Draw a white line from light direction. */
|
||||
glColor3f(1.0, 1.0, 1.0);
|
||||
glBegin(GL_LINES);
|
||||
glVertex3f(0, 0, 0);
|
||||
glVertex3f(5, 0, 0);
|
||||
glEnd();
|
||||
glEnable(GL_CULL_FACE);
|
||||
} else {
|
||||
/* Draw a yellow ball at the light source. */
|
||||
glTranslatef(lightPosition[0], lightPosition[1], lightPosition[2]);
|
||||
glutSolidSphere(1.0, 5, 5);
|
||||
}
|
||||
glEnable(GL_LIGHTING);
|
||||
glPopMatrix();
|
||||
|
||||
glPopMatrix();
|
||||
|
||||
if (reportSpeed) {
|
||||
glFinish();
|
||||
end = glutGet(GLUT_ELAPSED_TIME);
|
||||
printf("Speed %.3g frames/sec (%d ms)\n", 1000.0/(end-start), end-start);
|
||||
}
|
||||
|
||||
glutSwapBuffers();
|
||||
}
|
||||
|
||||
/* ARGSUSED2 */
|
||||
static void
|
||||
mouse(int button, int state, int x, int y)
|
||||
{
|
||||
if (button == GLUT_LEFT_BUTTON) {
|
||||
if (state == GLUT_DOWN) {
|
||||
moving = 1;
|
||||
startx = x;
|
||||
starty = y;
|
||||
}
|
||||
if (state == GLUT_UP) {
|
||||
moving = 0;
|
||||
}
|
||||
}
|
||||
if (button == GLUT_MIDDLE_BUTTON) {
|
||||
if (state == GLUT_DOWN) {
|
||||
lightMoving = 1;
|
||||
lightStartX = x;
|
||||
lightStartY = y;
|
||||
}
|
||||
if (state == GLUT_UP) {
|
||||
lightMoving = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ARGSUSED1 */
|
||||
static void
|
||||
motion(int x, int y)
|
||||
{
|
||||
if (moving) {
|
||||
angle = angle + (x - startx);
|
||||
angle2 = angle2 + (y - starty);
|
||||
startx = x;
|
||||
starty = y;
|
||||
glutPostRedisplay();
|
||||
}
|
||||
if (lightMoving) {
|
||||
lightAngle += (x - lightStartX)/40.0;
|
||||
lightHeight += (lightStartY - y)/20.0;
|
||||
lightStartX = x;
|
||||
lightStartY = y;
|
||||
glutPostRedisplay();
|
||||
}
|
||||
}
|
||||
|
||||
/* Advance time varying state when idle callback registered. */
|
||||
static void
|
||||
idle(void)
|
||||
{
|
||||
static float time = 0.0;
|
||||
|
||||
time = glutGet(GLUT_ELAPSED_TIME) / 500.0;
|
||||
|
||||
jump = 4.0 * fabs(sin(time)*0.5);
|
||||
if (!lightMoving) {
|
||||
lightAngle += 0.03;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
enum {
|
||||
M_NONE, M_MOTION, M_LIGHT, M_TEXTURE, M_SHADOWS, M_REFLECTION, M_DINOSAUR,
|
||||
M_STENCIL_REFLECTION, M_STENCIL_SHADOW, M_OFFSET_SHADOW,
|
||||
M_POSITIONAL, M_DIRECTIONAL, M_PERFORMANCE
|
||||
};
|
||||
|
||||
static void
|
||||
controlLights(int value)
|
||||
{
|
||||
switch (value) {
|
||||
case M_NONE:
|
||||
return;
|
||||
case M_MOTION:
|
||||
animation = 1 - animation;
|
||||
if (animation) {
|
||||
glutIdleFunc(idle);
|
||||
} else {
|
||||
glutIdleFunc(NULL);
|
||||
}
|
||||
break;
|
||||
case M_LIGHT:
|
||||
lightSwitch = !lightSwitch;
|
||||
if (lightSwitch) {
|
||||
glEnable(GL_LIGHT0);
|
||||
} else {
|
||||
glDisable(GL_LIGHT0);
|
||||
}
|
||||
break;
|
||||
case M_TEXTURE:
|
||||
useTexture = !useTexture;
|
||||
break;
|
||||
case M_SHADOWS:
|
||||
renderShadow = 1 - renderShadow;
|
||||
break;
|
||||
case M_REFLECTION:
|
||||
renderReflection = 1 - renderReflection;
|
||||
break;
|
||||
case M_DINOSAUR:
|
||||
renderDinosaur = 1 - renderDinosaur;
|
||||
break;
|
||||
case M_STENCIL_REFLECTION:
|
||||
stencilReflection = 1 - stencilReflection;
|
||||
break;
|
||||
case M_STENCIL_SHADOW:
|
||||
stencilShadow = 1 - stencilShadow;
|
||||
break;
|
||||
case M_OFFSET_SHADOW:
|
||||
offsetShadow = 1 - offsetShadow;
|
||||
break;
|
||||
case M_POSITIONAL:
|
||||
directionalLight = 0;
|
||||
break;
|
||||
case M_DIRECTIONAL:
|
||||
directionalLight = 1;
|
||||
break;
|
||||
case M_PERFORMANCE:
|
||||
reportSpeed = 1 - reportSpeed;
|
||||
break;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
/* When not visible, stop animating. Restart when visible again. */
|
||||
static void
|
||||
visible(int vis)
|
||||
{
|
||||
if (vis == GLUT_VISIBLE) {
|
||||
if (animation)
|
||||
glutIdleFunc(idle);
|
||||
} else {
|
||||
if (!animation)
|
||||
glutIdleFunc(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
/* Press any key to redraw; good when motion stopped and
|
||||
performance reporting on. */
|
||||
/* ARGSUSED */
|
||||
static void
|
||||
key(unsigned char c, int x, int y)
|
||||
{
|
||||
if (c == 27) {
|
||||
exit(0); /* IRIS GLism, Escape quits. */
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
/* Press any key to redraw; good when motion stopped and
|
||||
performance reporting on. */
|
||||
/* ARGSUSED */
|
||||
static void
|
||||
special(int k, int x, int y)
|
||||
{
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
static int
|
||||
supportsOneDotOne(void)
|
||||
{
|
||||
const char *version;
|
||||
int major, minor;
|
||||
|
||||
version = (char *) glGetString(GL_VERSION);
|
||||
if (sscanf(version, "%d.%d", &major, &minor) == 2)
|
||||
return major >= 1 && minor >= 1;
|
||||
return 0; /* OpenGL version string malformed! */
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
int i;
|
||||
|
||||
glutInit(&argc, argv);
|
||||
|
||||
for (i=1; i<argc; i++) {
|
||||
if (!strcmp("-linear", argv[i])) {
|
||||
linearFiltering = 1;
|
||||
} else if (!strcmp("-mipmap", argv[i])) {
|
||||
useMipmaps = 1;
|
||||
} else if (!strcmp("-ext", argv[i])) {
|
||||
forceExtension = 1;
|
||||
}
|
||||
}
|
||||
|
||||
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH | GLUT_STENCIL);
|
||||
|
||||
#if 0
|
||||
/* In GLUT 4.0, you'll be able to do this an be sure to
|
||||
get 2 bits of stencil if the machine has it for you. */
|
||||
glutInitDisplayString("samples stencil>=2 rgb double depth");
|
||||
#endif
|
||||
|
||||
glutCreateWindow("Shadowy Leapin' Lizards");
|
||||
|
||||
if (glutGet(GLUT_WINDOW_STENCIL_SIZE) <= 1) {
|
||||
printf("dinoshade: Sorry, I need at least 2 bits of stencil.\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/* Register GLUT callbacks. */
|
||||
glutDisplayFunc(redraw);
|
||||
glutMouseFunc(mouse);
|
||||
glutMotionFunc(motion);
|
||||
glutVisibilityFunc(visible);
|
||||
glutKeyboardFunc(key);
|
||||
glutSpecialFunc(special);
|
||||
|
||||
glutCreateMenu(controlLights);
|
||||
|
||||
glutAddMenuEntry("Toggle motion", M_MOTION);
|
||||
glutAddMenuEntry("-----------------------", M_NONE);
|
||||
glutAddMenuEntry("Toggle light", M_LIGHT);
|
||||
glutAddMenuEntry("Toggle texture", M_TEXTURE);
|
||||
glutAddMenuEntry("Toggle shadows", M_SHADOWS);
|
||||
glutAddMenuEntry("Toggle reflection", M_REFLECTION);
|
||||
glutAddMenuEntry("Toggle dinosaur", M_DINOSAUR);
|
||||
glutAddMenuEntry("-----------------------", M_NONE);
|
||||
glutAddMenuEntry("Toggle reflection stenciling", M_STENCIL_REFLECTION);
|
||||
glutAddMenuEntry("Toggle shadow stenciling", M_STENCIL_SHADOW);
|
||||
glutAddMenuEntry("Toggle shadow offset", M_OFFSET_SHADOW);
|
||||
glutAddMenuEntry("----------------------", M_NONE);
|
||||
glutAddMenuEntry("Positional light", M_POSITIONAL);
|
||||
glutAddMenuEntry("Directional light", M_DIRECTIONAL);
|
||||
glutAddMenuEntry("-----------------------", M_NONE);
|
||||
glutAddMenuEntry("Toggle performance", M_PERFORMANCE);
|
||||
glutAttachMenu(GLUT_RIGHT_BUTTON);
|
||||
makeDinosaur();
|
||||
|
||||
#ifdef GL_VERSION_1_1
|
||||
if (supportsOneDotOne() && !forceExtension) {
|
||||
polygonOffsetVersion = ONE_DOT_ONE;
|
||||
glPolygonOffset(-2.0, -9.0);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
#ifdef GL_EXT_polygon_offset
|
||||
/* check for the polygon offset extension */
|
||||
if (glutExtensionSupported("GL_EXT_polygon_offset")) {
|
||||
polygonOffsetVersion = EXTENSION;
|
||||
glPolygonOffsetEXT(-2.0, -0.002);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
polygonOffsetVersion = MISSING;
|
||||
printf("\ndinoshine: Missing polygon offset.\n");
|
||||
printf(" Expect shadow depth aliasing artifacts.\n\n");
|
||||
}
|
||||
}
|
||||
|
||||
glEnable(GL_CULL_FACE);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glLineWidth(3.0);
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
gluPerspective( /* field of view in degree */ 40.0,
|
||||
/* aspect ratio */ 1.0,
|
||||
/* Z near */ 20.0, /* Z far */ 100.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
gluLookAt(0.0, 8.0, 60.0, /* eye is at (0,8,60) */
|
||||
0.0, 8.0, 0.0, /* center is at (0,8,0) */
|
||||
0.0, 1.0, 0.); /* up is in postivie Y direction */
|
||||
|
||||
glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, 1);
|
||||
glLightfv(GL_LIGHT0, GL_DIFFUSE, lightColor);
|
||||
glLightf(GL_LIGHT0, GL_CONSTANT_ATTENUATION, 0.1);
|
||||
glLightf(GL_LIGHT0, GL_LINEAR_ATTENUATION, 0.05);
|
||||
glEnable(GL_LIGHT0);
|
||||
glEnable(GL_LIGHTING);
|
||||
|
||||
makeFloorTexture();
|
||||
|
||||
/* Setup floor plane for projected shadow calculations. */
|
||||
findPlane(floorPlane, floorVertices[1], floorVertices[2], floorVertices[3]);
|
||||
|
||||
glutMainLoop();
|
||||
return 0; /* ANSI C requires main to return int. */
|
||||
}
|
||||
99
progs/tests/fogcoord.c
Normal file
99
progs/tests/fogcoord.c
Normal file
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
* Exercise GL_EXT_fog_coord
|
||||
*/
|
||||
|
||||
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <GL/glut.h>
|
||||
|
||||
static int Width = 600;
|
||||
static int Height = 200;
|
||||
static GLfloat Near = 5.0, Far = 25.0;
|
||||
|
||||
|
||||
static void Display( void )
|
||||
{
|
||||
GLfloat t;
|
||||
|
||||
glClearColor(0.2, 0.2, 0.8, 0);
|
||||
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
|
||||
|
||||
for (t = 0.0; t <= 1.0; t += 0.25) {
|
||||
GLfloat f = -(Near + t * (Far - Near));
|
||||
glFogCoordfEXT(f);
|
||||
|
||||
glPushMatrix();
|
||||
glTranslatef(t * 10.0 - 5.0, 0, 0);
|
||||
glBegin(GL_POLYGON);
|
||||
glVertex2f(-1, -1);
|
||||
glVertex2f( 1, -1);
|
||||
glVertex2f( 1, 1);
|
||||
glVertex2f(-1, 1);
|
||||
glEnd();
|
||||
glPopMatrix();
|
||||
}
|
||||
glutSwapBuffers();
|
||||
}
|
||||
|
||||
|
||||
static void Reshape( int width, int height )
|
||||
{
|
||||
GLfloat ar = (float) width / (float) height;
|
||||
Width = width;
|
||||
Height = height;
|
||||
glViewport( 0, 0, width, height );
|
||||
glMatrixMode( GL_PROJECTION );
|
||||
glLoadIdentity();
|
||||
glFrustum( -ar, ar, -1.0, 1.0, Near, Far );
|
||||
glMatrixMode( GL_MODELVIEW );
|
||||
glLoadIdentity();
|
||||
glTranslatef( 0.0, 0.0, -15.0 );
|
||||
}
|
||||
|
||||
|
||||
static void Key( unsigned char key, int x, int y )
|
||||
{
|
||||
(void) x;
|
||||
(void) y;
|
||||
switch (key) {
|
||||
case 27:
|
||||
exit(0);
|
||||
break;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
static void Init( void )
|
||||
{
|
||||
/* setup lighting, etc */
|
||||
if (!glutExtensionSupported("GL_EXT_fog_coord")) {
|
||||
printf("Sorry, this program requires GL_EXT_fog_coord\n");
|
||||
exit(1);
|
||||
}
|
||||
glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FOG_COORDINATE_EXT);
|
||||
glFogi(GL_FOG_MODE, GL_LINEAR);
|
||||
glFogf(GL_FOG_START, Near);
|
||||
glFogf(GL_FOG_END, Far);
|
||||
glEnable(GL_FOG);
|
||||
printf("Squares should be colored from white -> gray -> black.\n");
|
||||
}
|
||||
|
||||
|
||||
int main( int argc, char *argv[] )
|
||||
{
|
||||
glutInit( &argc, argv );
|
||||
glutInitWindowPosition( 0, 0 );
|
||||
glutInitWindowSize( Width, Height );
|
||||
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
|
||||
glutCreateWindow(argv[0]);
|
||||
glutReshapeFunc( Reshape );
|
||||
glutKeyboardFunc( Key );
|
||||
glutDisplayFunc( Display );
|
||||
Init();
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
||||
381
progs/tests/manytex.c
Normal file
381
progs/tests/manytex.c
Normal file
@@ -0,0 +1,381 @@
|
||||
/* $Id: manytex.c,v 1.3 2000/11/09 16:53:26 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* test handling of many texture maps
|
||||
* Also tests texture priority and residency.
|
||||
*
|
||||
* Brian Paul
|
||||
* August 2, 2000
|
||||
*/
|
||||
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <GL/glut.h>
|
||||
|
||||
|
||||
static GLint NumTextures = 20;
|
||||
static GLuint *TextureID = NULL;
|
||||
static GLint *TextureWidth = NULL, *TextureHeight = NULL;
|
||||
static GLboolean *TextureResidency = NULL;
|
||||
static GLint TexWidth = 128, TexHeight = 128;
|
||||
static GLfloat Zrot = 0;
|
||||
static GLboolean Anim = GL_TRUE;
|
||||
static GLint WinWidth = 500, WinHeight = 400;
|
||||
static GLboolean MipMap = GL_FALSE;
|
||||
static GLboolean LinearFilter = GL_FALSE;
|
||||
static GLboolean RandomSize = GL_FALSE;
|
||||
static GLint Rows, Columns;
|
||||
static GLuint LowPriorityCount = 0;
|
||||
|
||||
|
||||
static void Idle( void )
|
||||
{
|
||||
Zrot += 1.0;
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
static void Display( void )
|
||||
{
|
||||
GLfloat spacing = WinWidth / Columns;
|
||||
GLfloat size = spacing * 0.4;
|
||||
GLint i;
|
||||
|
||||
/* test residency */
|
||||
if (0)
|
||||
{
|
||||
GLboolean b;
|
||||
GLint i, resident;
|
||||
b = glAreTexturesResident(NumTextures, TextureID, TextureResidency);
|
||||
if (b) {
|
||||
printf("all resident\n");
|
||||
}
|
||||
else {
|
||||
resident = 0;
|
||||
for (i = 0; i < NumTextures; i++) {
|
||||
if (TextureResidency[i]) {
|
||||
resident++;
|
||||
}
|
||||
}
|
||||
printf("%d of %d texture resident\n", resident, NumTextures);
|
||||
}
|
||||
}
|
||||
|
||||
/* render the textured quads */
|
||||
glClear( GL_COLOR_BUFFER_BIT );
|
||||
for (i = 0; i < NumTextures; i++) {
|
||||
GLint row = i / Columns;
|
||||
GLint col = i % Columns;
|
||||
GLfloat x = col * spacing + spacing * 0.5;
|
||||
GLfloat y = row * spacing + spacing * 0.5;
|
||||
|
||||
GLfloat maxDim = (TextureWidth[i] > TextureHeight[i])
|
||||
? TextureWidth[i] : TextureHeight[i];
|
||||
GLfloat w = TextureWidth[i] / maxDim;
|
||||
GLfloat h = TextureHeight[i] / maxDim;
|
||||
|
||||
glPushMatrix();
|
||||
glTranslatef(x, y, 0.0);
|
||||
glRotatef(Zrot, 0, 0, 1);
|
||||
glScalef(size, size, 1);
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, TextureID[i]);
|
||||
glBegin(GL_POLYGON);
|
||||
#if 0
|
||||
glTexCoord2f(0, 0); glVertex2f(-1, -1);
|
||||
glTexCoord2f(1, 0); glVertex2f( 1, -1);
|
||||
glTexCoord2f(1, 1); glVertex2f( 1, 1);
|
||||
glTexCoord2f(0, 1); glVertex2f(-1, 1);
|
||||
#else
|
||||
glTexCoord2f(0, 0); glVertex2f(-w, -h);
|
||||
glTexCoord2f(1, 0); glVertex2f( w, -h);
|
||||
glTexCoord2f(1, 1); glVertex2f( w, h);
|
||||
glTexCoord2f(0, 1); glVertex2f(-w, h);
|
||||
#endif
|
||||
glEnd();
|
||||
glPopMatrix();
|
||||
}
|
||||
|
||||
glutSwapBuffers();
|
||||
}
|
||||
|
||||
|
||||
static void Reshape( int width, int height )
|
||||
{
|
||||
WinWidth = width;
|
||||
WinHeight = height;
|
||||
glViewport( 0, 0, width, height );
|
||||
glMatrixMode( GL_PROJECTION );
|
||||
glLoadIdentity();
|
||||
glOrtho(0, width, 0, height, -1, 1);
|
||||
glMatrixMode( GL_MODELVIEW );
|
||||
glLoadIdentity();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Return a random int in [min, max].
|
||||
*/
|
||||
static int RandomInt(int min, int max)
|
||||
{
|
||||
int i = rand();
|
||||
int j = i % (max - min + 1);
|
||||
return min + j;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void Init( void )
|
||||
{
|
||||
GLint i;
|
||||
|
||||
if (RandomSize) {
|
||||
printf("Creating %d %s random-size textures, ", NumTextures,
|
||||
MipMap ? "Mipmapped" : "non-Mipmapped");
|
||||
}
|
||||
else {
|
||||
printf("Creating %d %s %d x %d textures, ", NumTextures,
|
||||
MipMap ? "Mipmapped" : "non-Mipmapped",
|
||||
TexWidth, TexHeight);
|
||||
}
|
||||
|
||||
if (LinearFilter) {
|
||||
printf("bilinear filtering\n");
|
||||
}
|
||||
else {
|
||||
printf("nearest filtering\n");
|
||||
}
|
||||
|
||||
|
||||
/* compute number of rows and columns of rects */
|
||||
{
|
||||
GLfloat area = (GLfloat) (WinWidth * WinHeight) / (GLfloat) NumTextures;
|
||||
GLfloat edgeLen = sqrt(area);
|
||||
|
||||
Columns = WinWidth / edgeLen;
|
||||
Rows = (NumTextures + Columns - 1) / Columns;
|
||||
printf("Rows: %d Cols: %d\n", Rows, Columns);
|
||||
}
|
||||
|
||||
|
||||
if (!TextureID) {
|
||||
TextureID = (GLuint *) malloc(sizeof(GLuint) * NumTextures);
|
||||
assert(TextureID);
|
||||
glGenTextures(NumTextures, TextureID);
|
||||
}
|
||||
|
||||
if (!TextureResidency) {
|
||||
TextureResidency = (GLboolean *) malloc(sizeof(GLboolean) * NumTextures);
|
||||
assert(TextureResidency);
|
||||
}
|
||||
|
||||
if (!TextureWidth) {
|
||||
TextureWidth = (GLint *) malloc(sizeof(GLint) * NumTextures);
|
||||
assert(TextureWidth);
|
||||
}
|
||||
if (!TextureHeight) {
|
||||
TextureHeight = (GLint *) malloc(sizeof(GLint) * NumTextures);
|
||||
assert(TextureHeight);
|
||||
}
|
||||
|
||||
for (i = 0; i < NumTextures; i++) {
|
||||
GLubyte color[4];
|
||||
GLubyte *texImage;
|
||||
GLint j, row, col;
|
||||
|
||||
row = i / Columns;
|
||||
col = i % Columns;
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, TextureID[i]);
|
||||
|
||||
if (i < LowPriorityCount)
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_PRIORITY, 0.5F);
|
||||
|
||||
if (RandomSize) {
|
||||
#if 0
|
||||
int k = (glutGet(GLUT_ELAPSED_TIME) % 7) + 2;
|
||||
TexWidth = 1 << k;
|
||||
TexHeight = 1 << k;
|
||||
#else
|
||||
TexWidth = 1 << RandomInt(2, 7);
|
||||
TexHeight = 1 << RandomInt(2, 7);
|
||||
printf("Random size of %3d: %d x %d\n", i, TexWidth, TexHeight);
|
||||
#endif
|
||||
}
|
||||
|
||||
TextureWidth[i] = TexWidth;
|
||||
TextureHeight[i] = TexHeight;
|
||||
|
||||
texImage = (GLubyte*) malloc(4 * TexWidth * TexHeight * sizeof(GLubyte));
|
||||
assert(texImage);
|
||||
|
||||
/* determine texture color */
|
||||
color[0] = (GLint) (255.0 * ((float) col / (Columns - 1)));
|
||||
color[1] = 127;
|
||||
color[2] = (GLint) (255.0 * ((float) row / (Rows - 1)));
|
||||
color[3] = 255;
|
||||
|
||||
/* fill in solid-colored teximage */
|
||||
for (j = 0; j < TexWidth * TexHeight; j++) {
|
||||
texImage[j*4+0] = color[0];
|
||||
texImage[j*4+1] = color[1];
|
||||
texImage[j*4+2] = color[2];
|
||||
texImage[j*4+3] = color[3];
|
||||
}
|
||||
|
||||
if (MipMap) {
|
||||
GLint level = 0;
|
||||
GLint w = TexWidth, h = TexHeight;
|
||||
while (1) {
|
||||
glTexImage2D(GL_TEXTURE_2D, level, GL_RGBA, w, h, 0,
|
||||
GL_RGBA, GL_UNSIGNED_BYTE, texImage);
|
||||
if (w == 1 && h == 1)
|
||||
break;
|
||||
if (w > 1)
|
||||
w /= 2;
|
||||
if (h > 1)
|
||||
h /= 2;
|
||||
level++;
|
||||
/*printf("%d: %d x %d\n", level, w, h);*/
|
||||
}
|
||||
if (LinearFilter) {
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
|
||||
GL_LINEAR_MIPMAP_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
}
|
||||
else {
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
|
||||
GL_NEAREST_MIPMAP_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* Set corners to white */
|
||||
int k = 0;
|
||||
texImage[k+0] = texImage[k+1] = texImage[k+2] = texImage[k+3] = 255;
|
||||
k = (TexWidth - 1) * 4;
|
||||
texImage[k+0] = texImage[k+1] = texImage[k+2] = texImage[k+3] = 255;
|
||||
k = (TexWidth * TexHeight - TexWidth) * 4;
|
||||
texImage[k+0] = texImage[k+1] = texImage[k+2] = texImage[k+3] = 255;
|
||||
k = (TexWidth * TexHeight - 1) * 4;
|
||||
texImage[k+0] = texImage[k+1] = texImage[k+2] = texImage[k+3] = 255;
|
||||
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, TexWidth, TexHeight, 0,
|
||||
GL_RGBA, GL_UNSIGNED_BYTE, texImage);
|
||||
if (LinearFilter) {
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
}
|
||||
else {
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
}
|
||||
}
|
||||
|
||||
free(texImage);
|
||||
}
|
||||
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
}
|
||||
|
||||
|
||||
static void Key( unsigned char key, int x, int y )
|
||||
{
|
||||
const GLfloat step = 3.0;
|
||||
(void) x;
|
||||
(void) y;
|
||||
switch (key) {
|
||||
case 'a':
|
||||
Anim = !Anim;
|
||||
if (Anim)
|
||||
glutIdleFunc(Idle);
|
||||
else
|
||||
glutIdleFunc(NULL);
|
||||
break;
|
||||
case 's':
|
||||
Idle();
|
||||
break;
|
||||
case 'z':
|
||||
Zrot -= step;
|
||||
break;
|
||||
case 'Z':
|
||||
Zrot += step;
|
||||
break;
|
||||
case ' ':
|
||||
Init();
|
||||
break;
|
||||
case 27:
|
||||
exit(0);
|
||||
break;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
int main( int argc, char *argv[] )
|
||||
{
|
||||
GLint i;
|
||||
|
||||
glutInit( &argc, argv );
|
||||
glutInitWindowPosition( 0, 0 );
|
||||
glutInitWindowSize( WinWidth, WinHeight );
|
||||
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
|
||||
glutCreateWindow(argv[0]);
|
||||
glutReshapeFunc( Reshape );
|
||||
glutKeyboardFunc( Key );
|
||||
glutDisplayFunc( Display );
|
||||
if (Anim)
|
||||
glutIdleFunc(Idle);
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
if (strcmp(argv[i], "-n") == 0) {
|
||||
NumTextures = atoi(argv[i+1]);
|
||||
if (NumTextures <= 0) {
|
||||
printf("Error, bad number of textures\n");
|
||||
return 1;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
else if (strcmp(argv[i], "-mipmap") == 0) {
|
||||
MipMap = GL_TRUE;
|
||||
}
|
||||
else if (strcmp(argv[i], "-linear") == 0) {
|
||||
LinearFilter = GL_TRUE;
|
||||
}
|
||||
else if (strcmp(argv[i], "-size") == 0) {
|
||||
TexWidth = atoi(argv[i+1]);
|
||||
TexHeight = atoi(argv[i+2]);
|
||||
assert(TexWidth >= 1);
|
||||
assert(TexHeight >= 1);
|
||||
i += 2;
|
||||
}
|
||||
else if (strcmp(argv[i], "-randomsize") == 0) {
|
||||
RandomSize = GL_TRUE;
|
||||
}
|
||||
else if (strcmp(argv[i], "-lowpri") == 0) {
|
||||
LowPriorityCount = atoi(argv[i+1]);
|
||||
i++;
|
||||
}
|
||||
else {
|
||||
printf("Usage:\n");
|
||||
printf(" manytex [options]\n");
|
||||
printf("Options:\n");
|
||||
printf(" -n <number of texture objects>\n");
|
||||
printf(" -size <width> <height> - specify texture size\n");
|
||||
printf(" -randomsize - use random size textures\n");
|
||||
printf(" -mipmap - generate mipmaps\n");
|
||||
printf(" -linear - use linear filtering instead of nearest\n");
|
||||
printf(" -lowpri <n> - Set lower priority on <n> textures\n");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
Init();
|
||||
|
||||
glutMainLoop();
|
||||
|
||||
return 0;
|
||||
}
|
||||
408
progs/tests/multipal.c
Normal file
408
progs/tests/multipal.c
Normal file
@@ -0,0 +1,408 @@
|
||||
/* $Id: multipal.c,v 1.1 2000/11/18 17:12:33 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* GL_ARB_multitexture demo
|
||||
*
|
||||
* Command line options:
|
||||
* -info print GL implementation information
|
||||
*
|
||||
*
|
||||
* Brian Paul November 1998 This program is in the public domain.
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Log: multipal.c,v $
|
||||
* Revision 1.1 2000/11/18 17:12:33 brianp
|
||||
* test texture palettes with multitexture
|
||||
*
|
||||
* Revision 1.7 2000/11/01 16:02:01 brianp
|
||||
* print number of texture units
|
||||
*
|
||||
* Revision 1.6 2000/05/23 23:21:00 brianp
|
||||
* set default window pos
|
||||
*
|
||||
* Revision 1.5 2000/02/02 17:31:45 brianp
|
||||
* changed > to >=
|
||||
*
|
||||
* Revision 1.4 2000/02/02 01:07:21 brianp
|
||||
* limit Drift to [0, 1]
|
||||
*
|
||||
* Revision 1.3 1999/10/21 16:40:32 brianp
|
||||
* added -info command line option
|
||||
*
|
||||
* Revision 1.2 1999/10/13 12:02:13 brianp
|
||||
* use texture objects now
|
||||
*
|
||||
* Revision 1.1.1.1 1999/08/19 00:55:40 jtg
|
||||
* Imported sources
|
||||
*
|
||||
* Revision 1.3 1999/03/28 18:20:49 brianp
|
||||
* minor clean-up
|
||||
*
|
||||
* Revision 1.2 1998/11/05 04:34:04 brianp
|
||||
* moved image files to ../images/ directory
|
||||
*
|
||||
* Revision 1.1 1998/11/03 01:36:33 brianp
|
||||
* Initial revision
|
||||
*
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <GL/glut.h>
|
||||
|
||||
#include "../util/readtex.c" /* I know, this is a hack. */
|
||||
|
||||
#define TEXTURE_1_FILE "../images/tile.rgb"
|
||||
#define TEXTURE_2_FILE "../images/reflect.rgb"
|
||||
|
||||
#define TEX0 1
|
||||
#define TEX1 2
|
||||
#define TEXBOTH 3
|
||||
#define ANIMATE 10
|
||||
#define QUIT 100
|
||||
|
||||
static GLboolean Animate = GL_TRUE;
|
||||
|
||||
static GLfloat Drift = 0.0;
|
||||
static GLfloat Xrot = 20.0, Yrot = 30.0, Zrot = 0.0;
|
||||
|
||||
|
||||
|
||||
static void Idle( void )
|
||||
{
|
||||
if (Animate) {
|
||||
Drift += 0.05;
|
||||
if (Drift >= 1.0)
|
||||
Drift = 0.0;
|
||||
|
||||
#ifdef GL_ARB_multitexture
|
||||
glActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
#endif
|
||||
glMatrixMode(GL_TEXTURE);
|
||||
glLoadIdentity();
|
||||
glTranslatef(Drift, 0.0, 0.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
|
||||
#ifdef GL_ARB_multitexture
|
||||
glActiveTextureARB(GL_TEXTURE1_ARB);
|
||||
#endif
|
||||
glMatrixMode(GL_TEXTURE);
|
||||
glLoadIdentity();
|
||||
glTranslatef(0.0, Drift, 0.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
|
||||
glutPostRedisplay();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void DrawObject(void)
|
||||
{
|
||||
glBegin(GL_QUADS);
|
||||
|
||||
#ifdef GL_ARB_multitexture
|
||||
glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 0.0, 0.0);
|
||||
glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 0.0, 0.0);
|
||||
glVertex2f(-1.0, -1.0);
|
||||
|
||||
glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 2.0, 0.0);
|
||||
glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 1.0, 0.0);
|
||||
glVertex2f(1.0, -1.0);
|
||||
|
||||
glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 2.0, 2.0);
|
||||
glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 1.0, 1.0);
|
||||
glVertex2f(1.0, 1.0);
|
||||
|
||||
glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 0.0, 2.0);
|
||||
glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 0.0, 1.0);
|
||||
glVertex2f(-1.0, 1.0);
|
||||
#else
|
||||
glTexCoord2f(0.0, 0.0);
|
||||
glVertex2f(-1.0, -1.0);
|
||||
|
||||
glTexCoord2f(1.0, 0.0);
|
||||
glVertex2f(1.0, -1.0);
|
||||
|
||||
glTexCoord2f(1.0, 1.0);
|
||||
glVertex2f(1.0, 1.0);
|
||||
|
||||
glTexCoord2f(0.0, 1.0);
|
||||
glVertex2f(-1.0, 1.0);
|
||||
#endif
|
||||
|
||||
glEnd();
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void Display( void )
|
||||
{
|
||||
glClear( GL_COLOR_BUFFER_BIT );
|
||||
|
||||
glPushMatrix();
|
||||
glRotatef(Xrot, 1.0, 0.0, 0.0);
|
||||
glRotatef(Yrot, 0.0, 1.0, 0.0);
|
||||
glRotatef(Zrot, 0.0, 0.0, 1.0);
|
||||
glScalef(5.0, 5.0, 5.0);
|
||||
DrawObject();
|
||||
glPopMatrix();
|
||||
|
||||
glutSwapBuffers();
|
||||
}
|
||||
|
||||
|
||||
static void Reshape( int width, int height )
|
||||
{
|
||||
glViewport( 0, 0, width, height );
|
||||
glMatrixMode( GL_PROJECTION );
|
||||
glLoadIdentity();
|
||||
glFrustum( -1.0, 1.0, -1.0, 1.0, 10.0, 100.0 );
|
||||
/*glOrtho( -6.0, 6.0, -6.0, 6.0, 10.0, 100.0 );*/
|
||||
glMatrixMode( GL_MODELVIEW );
|
||||
glLoadIdentity();
|
||||
glTranslatef( 0.0, 0.0, -70.0 );
|
||||
}
|
||||
|
||||
|
||||
static void ModeMenu(int entry)
|
||||
{
|
||||
GLboolean enable0 = GL_FALSE, enable1 = GL_FALSE;
|
||||
if (entry==TEX0) {
|
||||
enable0 = GL_TRUE;
|
||||
}
|
||||
else if (entry==TEX1) {
|
||||
enable1 = GL_TRUE;
|
||||
}
|
||||
else if (entry==TEXBOTH) {
|
||||
enable0 = GL_TRUE;
|
||||
enable1 = GL_TRUE;
|
||||
}
|
||||
else if (entry==ANIMATE) {
|
||||
Animate = !Animate;
|
||||
}
|
||||
else if (entry==QUIT) {
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if (entry != ANIMATE) {
|
||||
#ifdef GL_ARB_multitexture
|
||||
glActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
#endif
|
||||
if (enable0) {
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
}
|
||||
else
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
|
||||
#ifdef GL_ARB_multitexture
|
||||
glActiveTextureARB(GL_TEXTURE1_ARB);
|
||||
#endif
|
||||
if (enable1) {
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
}
|
||||
else
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
}
|
||||
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
static void Key( unsigned char key, int x, int y )
|
||||
{
|
||||
(void) x;
|
||||
(void) y;
|
||||
switch (key) {
|
||||
case 27:
|
||||
exit(0);
|
||||
break;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
static void SpecialKey( int key, int x, int y )
|
||||
{
|
||||
float step = 3.0;
|
||||
(void) x;
|
||||
(void) y;
|
||||
|
||||
switch (key) {
|
||||
case GLUT_KEY_UP:
|
||||
Xrot += step;
|
||||
break;
|
||||
case GLUT_KEY_DOWN:
|
||||
Xrot -= step;
|
||||
break;
|
||||
case GLUT_KEY_LEFT:
|
||||
Yrot += step;
|
||||
break;
|
||||
case GLUT_KEY_RIGHT:
|
||||
Yrot -= step;
|
||||
break;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
static void load_tex(const char *fname, int channel)
|
||||
{
|
||||
GLubyte *image;
|
||||
GLenum format, type;
|
||||
GLint w, h;
|
||||
GLubyte *grayImage;
|
||||
int i;
|
||||
GLubyte table[256][4];
|
||||
|
||||
image = LoadRGBImage(fname, &w, &h, &format);
|
||||
if (!image)
|
||||
exit(1);
|
||||
|
||||
printf("%s %d x %d\n", fname, w, h);
|
||||
grayImage = malloc(w * h * 1);
|
||||
assert(grayImage);
|
||||
for (i = 0; i < w * h; i++) {
|
||||
int g = (image[i*3+0] + image[i*3+1] + image[i*3+2]) / 3;
|
||||
assert(g < 256);
|
||||
grayImage[i] = g;
|
||||
}
|
||||
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_COLOR_INDEX, w, h, 0, GL_COLOR_INDEX,
|
||||
GL_UNSIGNED_BYTE, grayImage);
|
||||
|
||||
for (i = 0; i < 256; i++) {
|
||||
table[i][0] = channel ? i : 0;
|
||||
table[i][1] = i;
|
||||
table[i][2] = channel ? 0 : i;
|
||||
table[i][3] = 255;
|
||||
}
|
||||
|
||||
glColorTableEXT(GL_TEXTURE_2D, /* target */
|
||||
GL_RGBA, /* internal format */
|
||||
256, /* table size */
|
||||
GL_RGBA, /* table format */
|
||||
GL_UNSIGNED_BYTE, /* table type */
|
||||
table); /* the color table */
|
||||
|
||||
free(grayImage);
|
||||
free(image);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void Init( int argc, char *argv[] )
|
||||
{
|
||||
GLuint texObj[2];
|
||||
GLint units;
|
||||
|
||||
const char *exten = (const char *) glGetString(GL_EXTENSIONS);
|
||||
if (!strstr(exten, "GL_ARB_multitexture")) {
|
||||
printf("Sorry, GL_ARB_multitexture not supported by this renderer.\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &units);
|
||||
printf("%d texture units supported\n", units);
|
||||
|
||||
/* allocate two texture objects */
|
||||
glGenTextures(2, texObj);
|
||||
|
||||
/* setup texture obj 0 */
|
||||
glBindTexture(GL_TEXTURE_2D, texObj[0]);
|
||||
#ifdef LINEAR_FILTER
|
||||
/* linear filtering looks much nicer but is much slower for Mesa */
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
foo
|
||||
#else
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
#endif
|
||||
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
|
||||
load_tex(TEXTURE_1_FILE, 0);
|
||||
#if 0
|
||||
if (!LoadRGBMipmaps(TEXTURE_1_FILE, GL_RGB)) {
|
||||
printf("Error: couldn't load texture image\n");
|
||||
exit(1);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* setup texture obj 1 */
|
||||
glBindTexture(GL_TEXTURE_2D, texObj[1]);
|
||||
#ifdef LINEAR_FILTER
|
||||
/* linear filtering looks much nicer but is much slower for Mesa */
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
foo
|
||||
#else
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
#endif
|
||||
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
|
||||
load_tex(TEXTURE_2_FILE, 1);
|
||||
#if 0
|
||||
if (!LoadRGBMipmaps(TEXTURE_2_FILE, GL_RGB)) {
|
||||
printf("Error: couldn't load texture image\n");
|
||||
exit(1);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* now bind the texture objects to the respective texture units */
|
||||
#ifdef GL_ARB_multitexture
|
||||
glActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
glBindTexture(GL_TEXTURE_2D, texObj[0]);
|
||||
glActiveTextureARB(GL_TEXTURE1_ARB);
|
||||
glBindTexture(GL_TEXTURE_2D, texObj[1]);
|
||||
#endif
|
||||
|
||||
glShadeModel(GL_FLAT);
|
||||
glClearColor(0.3, 0.3, 0.4, 1.0);
|
||||
|
||||
ModeMenu(TEXBOTH);
|
||||
|
||||
if (argc > 1 && strcmp(argv[1], "-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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int main( int argc, char *argv[] )
|
||||
{
|
||||
glutInit( &argc, argv );
|
||||
glutInitWindowSize( 300, 300 );
|
||||
glutInitWindowPosition( 0, 0 );
|
||||
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
|
||||
glutCreateWindow(argv[0] );
|
||||
|
||||
Init( argc, argv );
|
||||
|
||||
glutReshapeFunc( Reshape );
|
||||
glutKeyboardFunc( Key );
|
||||
glutSpecialFunc( SpecialKey );
|
||||
glutDisplayFunc( Display );
|
||||
glutIdleFunc( Idle );
|
||||
|
||||
glutCreateMenu(ModeMenu);
|
||||
glutAddMenuEntry("Texture 0", TEX0);
|
||||
glutAddMenuEntry("Texture 1", TEX1);
|
||||
glutAddMenuEntry("Multi-texture", TEXBOTH);
|
||||
glutAddMenuEntry("Toggle Animation", ANIMATE);
|
||||
glutAddMenuEntry("Quit", QUIT);
|
||||
glutAttachMenu(GLUT_RIGHT_BUTTON);
|
||||
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
||||
291
progs/tests/osdemo16.c
Normal file
291
progs/tests/osdemo16.c
Normal file
@@ -0,0 +1,291 @@
|
||||
/* $Id: osdemo16.c,v 1.1 2001/03/08 15:24:18 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Demo of off-screen Mesa rendering
|
||||
*
|
||||
* See Mesa/include/GL/osmesa.h for documentation of the OSMesa functions.
|
||||
*
|
||||
* If you want to render BIG images you'll probably have to increase
|
||||
* MAX_WIDTH and MAX_HEIGHT in src/config.h.
|
||||
*
|
||||
* This program is in the public domain.
|
||||
*
|
||||
* Brian Paul
|
||||
*
|
||||
* PPM output provided by Joerg Schmalzl.
|
||||
* ASCII PPM output added by Brian Paul.
|
||||
*/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "GL/osmesa.h"
|
||||
#include "GL/glut.h"
|
||||
|
||||
|
||||
#define SAVE_TARGA
|
||||
|
||||
|
||||
#define WIDTH 400
|
||||
#define HEIGHT 400
|
||||
|
||||
|
||||
|
||||
static void render_image( void )
|
||||
{
|
||||
GLfloat light_ambient[] = { 0.0, 0.0, 0.0, 1.0 };
|
||||
GLfloat light_diffuse[] = { 1.0, 1.0, 1.0, 1.0 };
|
||||
GLfloat light_specular[] = { 1.0, 1.0, 1.0, 1.0 };
|
||||
GLfloat light_position[] = { 1.0, 1.0, 1.0, 0.0 };
|
||||
GLfloat red_mat[] = { 1.0, 0.2, 0.2, 1.0 };
|
||||
GLfloat green_mat[] = { 0.2, 1.0, 0.2, 0.5 };
|
||||
GLfloat blue_mat[] = { 0.2, 0.2, 1.0, 1.0 };
|
||||
GLfloat white_mat[] = { 1.0, 1.0, 1.0, 1.0 };
|
||||
GLfloat purple_mat[] = { 1.0, 0.2, 1.0, 1.0 };
|
||||
GLUquadricObj *qobj = gluNewQuadric();
|
||||
|
||||
glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient);
|
||||
glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse);
|
||||
glLightfv(GL_LIGHT0, GL_SPECULAR, light_specular);
|
||||
glLightfv(GL_LIGHT0, GL_POSITION, light_position);
|
||||
|
||||
glEnable(GL_LIGHTING);
|
||||
glEnable(GL_LIGHT0);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrtho(-2.5, 2.5, -2.5, 2.5, -10.0, 10.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
|
||||
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
|
||||
|
||||
glPushMatrix();
|
||||
glRotatef(20.0, 1.0, 0.0, 0.0);
|
||||
|
||||
#if 0
|
||||
glPushMatrix();
|
||||
glTranslatef(-0.75, 0.5, 0.0);
|
||||
glRotatef(90.0, 1.0, 0.0, 0.0);
|
||||
glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, red_mat );
|
||||
glutSolidTorus(0.275, 0.85, 20, 20);
|
||||
glPopMatrix();
|
||||
#endif
|
||||
|
||||
/* red square */
|
||||
glPushMatrix();
|
||||
glTranslatef(0.0, -0.5, 0.0);
|
||||
glRotatef(90, 1, 0.5, 0);
|
||||
glScalef(3, 3, 3);
|
||||
glDisable(GL_LIGHTING);
|
||||
glColor4f(1, 0, 0, 0.5);
|
||||
glBegin(GL_POLYGON);
|
||||
glVertex2f(-1, -1);
|
||||
glVertex2f( 1, -1);
|
||||
glVertex2f( 1, 1);
|
||||
glVertex2f(-1, 1);
|
||||
glEnd();
|
||||
glEnable(GL_LIGHTING);
|
||||
glPopMatrix();
|
||||
|
||||
#if 0
|
||||
/* green square */
|
||||
glPushMatrix();
|
||||
glTranslatef(0.0, 0.5, 0.1);
|
||||
glDisable(GL_LIGHTING);
|
||||
glColor3f(0, 1, 0);
|
||||
glBegin(GL_POLYGON);
|
||||
glVertex2f(-1, -1);
|
||||
glVertex2f( 1, -1);
|
||||
glVertex2f( 1, 1);
|
||||
glVertex2f(-1, 1);
|
||||
glEnd();
|
||||
glEnable(GL_LIGHTING);
|
||||
glPopMatrix();
|
||||
|
||||
/* blue square */
|
||||
glPushMatrix();
|
||||
glTranslatef(0.75, 0.5, 0.3);
|
||||
glDisable(GL_LIGHTING);
|
||||
glColor3f(0, 0, 0.5);
|
||||
glBegin(GL_POLYGON);
|
||||
glVertex2f(-1, -1);
|
||||
glVertex2f( 1, -1);
|
||||
glVertex2f( 1, 1);
|
||||
glVertex2f(-1, 1);
|
||||
glEnd();
|
||||
glEnable(GL_LIGHTING);
|
||||
glPopMatrix();
|
||||
#endif
|
||||
glPushMatrix();
|
||||
glTranslatef(-0.75, -0.5, 0.0);
|
||||
glRotatef(270.0, 1.0, 0.0, 0.0);
|
||||
glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, green_mat );
|
||||
glColor4f(0,1,0,0.5);
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
gluCylinder(qobj, 1.0, 0.0, 2.0, 16, 1);
|
||||
glDisable(GL_BLEND);
|
||||
glPopMatrix();
|
||||
|
||||
glPushMatrix();
|
||||
glTranslatef(0.75, 1.0, 1.0);
|
||||
glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, blue_mat );
|
||||
gluSphere(qobj, 1.0, 20, 20);
|
||||
glPopMatrix();
|
||||
|
||||
glPopMatrix();
|
||||
|
||||
gluDeleteQuadric(qobj);
|
||||
|
||||
{
|
||||
GLint r, g, b, a;
|
||||
glGetIntegerv(GL_RED_BITS, &r);
|
||||
glGetIntegerv(GL_GREEN_BITS, &g);
|
||||
glGetIntegerv(GL_BLUE_BITS, &b);
|
||||
glGetIntegerv(GL_ALPHA_BITS, &a);
|
||||
printf("channel sizes: %d %d %d %d\n", r, g, b, a);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
write_targa(const char *filename, const GLushort *buffer, int width, int height)
|
||||
{
|
||||
FILE *f = fopen( filename, "w" );
|
||||
if (f) {
|
||||
int i, x, y;
|
||||
const GLushort *ptr = buffer;
|
||||
printf ("osdemo, writing tga file \n");
|
||||
fputc (0x00, f); /* ID Length, 0 => No ID */
|
||||
fputc (0x00, f); /* Color Map Type, 0 => No color map included */
|
||||
fputc (0x02, f); /* Image Type, 2 => Uncompressed, True-color Image */
|
||||
fputc (0x00, f); /* Next five bytes are about the color map entries */
|
||||
fputc (0x00, f); /* 2 bytes Index, 2 bytes length, 1 byte size */
|
||||
fputc (0x00, f);
|
||||
fputc (0x00, f);
|
||||
fputc (0x00, f);
|
||||
fputc (0x00, f); /* X-origin of Image */
|
||||
fputc (0x00, f);
|
||||
fputc (0x00, f); /* Y-origin of Image */
|
||||
fputc (0x00, f);
|
||||
fputc (WIDTH & 0xff, f); /* Image Width */
|
||||
fputc ((WIDTH>>8) & 0xff, f);
|
||||
fputc (HEIGHT & 0xff, f); /* Image Height */
|
||||
fputc ((HEIGHT>>8) & 0xff, f);
|
||||
fputc (0x18, f); /* Pixel Depth, 0x18 => 24 Bits */
|
||||
fputc (0x20, f); /* Image Descriptor */
|
||||
fclose(f);
|
||||
f = fopen( filename, "ab" ); /* reopen in binary append mode */
|
||||
for (y=height-1; y>=0; y--) {
|
||||
for (x=0; x<width; x++) {
|
||||
i = (y*width + x) * 4;
|
||||
fputc(ptr[i+2] >> 8, f); /* write blue */
|
||||
fputc(ptr[i+1] >> 8, f); /* write green */
|
||||
fputc(ptr[i] >> 8, f); /* write red */
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
write_ppm(const char *filename, const GLubyte *buffer, int width, int height)
|
||||
{
|
||||
const int binary = 0;
|
||||
FILE *f = fopen( filename, "w" );
|
||||
if (f) {
|
||||
int i, x, y;
|
||||
const GLubyte *ptr = buffer;
|
||||
if (binary) {
|
||||
fprintf(f,"P6\n");
|
||||
fprintf(f,"# ppm-file created by osdemo.c\n");
|
||||
fprintf(f,"%i %i\n", width,height);
|
||||
fprintf(f,"255\n");
|
||||
fclose(f);
|
||||
f = fopen( filename, "ab" ); /* reopen in binary append mode */
|
||||
for (y=height-1; y>=0; y--) {
|
||||
for (x=0; x<width; x++) {
|
||||
i = (y*width + x) * 4;
|
||||
fputc(ptr[i], f); /* write red */
|
||||
fputc(ptr[i+1], f); /* write green */
|
||||
fputc(ptr[i+2], f); /* write blue */
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
/*ASCII*/
|
||||
int counter = 0;
|
||||
fprintf(f,"P3\n");
|
||||
fprintf(f,"# ascii ppm file created by osdemo.c\n");
|
||||
fprintf(f,"%i %i\n", width, height);
|
||||
fprintf(f,"255\n");
|
||||
for (y=height-1; y>=0; y--) {
|
||||
for (x=0; x<width; x++) {
|
||||
i = (y*width + x) * 4;
|
||||
fprintf(f, " %3d %3d %3d", ptr[i], ptr[i+1], ptr[i+2]);
|
||||
counter++;
|
||||
if (counter % 5 == 0)
|
||||
fprintf(f, "\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
fclose(f);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
int main( int argc, char *argv[] )
|
||||
{
|
||||
void *buffer;
|
||||
|
||||
/* Create an RGBA-mode context */
|
||||
#if OSMESA_MAJOR_VERSION * 100 + OSMESA_MINOR_VERSION >= 305
|
||||
/* specify Z, stencil, accum sizes */
|
||||
OSMesaContext ctx = OSMesaCreateContextExt( GL_RGBA, 16, 0, 0, NULL );
|
||||
#else
|
||||
OSMesaContext ctx = OSMesaCreateContext( GL_RGBA, NULL );
|
||||
#endif
|
||||
if (!ctx) {
|
||||
printf("OSMesaCreateContext failed!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Allocate the image buffer */
|
||||
buffer = malloc( WIDTH * HEIGHT * 4 * sizeof(GLushort));
|
||||
if (!buffer) {
|
||||
printf("Alloc image buffer failed!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Bind the buffer to the context and make it current */
|
||||
if (!OSMesaMakeCurrent( ctx, buffer, GL_UNSIGNED_SHORT, WIDTH, HEIGHT )) {
|
||||
printf("OSMesaMakeCurrent failed!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
render_image();
|
||||
|
||||
if (argc>1) {
|
||||
#ifdef SAVE_TARGA
|
||||
write_targa(argv[1], buffer, WIDTH, HEIGHT);
|
||||
#else
|
||||
write_ppm(argv[1], buffer, WIDTH, HEIGHT);
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
printf("Specify a filename if you want to make an image file\n");
|
||||
}
|
||||
|
||||
printf("all done\n");
|
||||
|
||||
/* free the image buffer */
|
||||
free( buffer );
|
||||
|
||||
/* destroy the context */
|
||||
OSMesaDestroyContext( ctx );
|
||||
|
||||
return 0;
|
||||
}
|
||||
1028
progs/tests/projtex.c
Normal file
1028
progs/tests/projtex.c
Normal file
File diff suppressed because it is too large
Load Diff
145
progs/tests/seccolor.c
Normal file
145
progs/tests/seccolor.c
Normal file
@@ -0,0 +1,145 @@
|
||||
/*
|
||||
* Exercise GL_EXT_secondary_color
|
||||
*/
|
||||
|
||||
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <GL/glut.h>
|
||||
|
||||
static int Width = 600;
|
||||
static int Height = 200;
|
||||
static GLfloat Near = 5.0, Far = 25.0;
|
||||
|
||||
|
||||
static void Display( void )
|
||||
{
|
||||
GLfloat t;
|
||||
|
||||
glClearColor(0.2, 0.2, 0.8, 0);
|
||||
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
|
||||
|
||||
for (t = 0.0; t <= 1.0; t += 0.25) {
|
||||
GLfloat x = t * 10.0 - 5.0;
|
||||
GLfloat g = t;
|
||||
|
||||
/* top row: untextured */
|
||||
glColor3f(1, 0, 0);
|
||||
glPushMatrix();
|
||||
glTranslatef(x, 1.2, 0);
|
||||
#if defined(GL_EXT_secondary_color)
|
||||
glSecondaryColor3fEXT(0, g, 0);
|
||||
#endif
|
||||
glBegin(GL_POLYGON);
|
||||
glVertex2f(-1, -1);
|
||||
glVertex2f( 1, -1);
|
||||
glVertex2f( 1, 1);
|
||||
glVertex2f(-1, 1);
|
||||
glEnd();
|
||||
glPopMatrix();
|
||||
|
||||
/* bottom row: textured */
|
||||
glColor3f(1, 1, 1);
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glPushMatrix();
|
||||
glTranslatef(x, -1.2, 0);
|
||||
#if defined(GL_EXT_secondary_color)
|
||||
glSecondaryColor3fEXT(0, g, 0);
|
||||
#endif
|
||||
glBegin(GL_POLYGON);
|
||||
glTexCoord2f(0, 0); glVertex2f(-1, -1);
|
||||
glTexCoord2f(1, 0); glVertex2f( 1, -1);
|
||||
glTexCoord2f(1, 1); glVertex2f( 1, 1);
|
||||
glTexCoord2f(0, 1); glVertex2f(-1, 1);
|
||||
glEnd();
|
||||
glPopMatrix();
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
}
|
||||
glutSwapBuffers();
|
||||
}
|
||||
|
||||
|
||||
static void Reshape( int width, int height )
|
||||
{
|
||||
GLfloat ar = (float) width / (float) height;
|
||||
Width = width;
|
||||
Height = height;
|
||||
glViewport( 0, 0, width, height );
|
||||
glMatrixMode( GL_PROJECTION );
|
||||
glLoadIdentity();
|
||||
glFrustum( -ar, ar, -1.0, 1.0, Near, Far );
|
||||
glMatrixMode( GL_MODELVIEW );
|
||||
glLoadIdentity();
|
||||
glTranslatef( 0.0, 0.0, -15.0 );
|
||||
}
|
||||
|
||||
|
||||
static void Key( unsigned char key, int x, int y )
|
||||
{
|
||||
(void) x;
|
||||
(void) y;
|
||||
switch (key) {
|
||||
case 27:
|
||||
exit(0);
|
||||
break;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
static void Init( void )
|
||||
{
|
||||
GLubyte image[4*4][3];
|
||||
GLint i;
|
||||
if (!glutExtensionSupported("GL_EXT_secondary_color")) {
|
||||
printf("Sorry, this program requires GL_EXT_secondary_color\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/* setup red texture with one back texel */
|
||||
for (i = 0; i < 4*4; i++) {
|
||||
if (i == 0) {
|
||||
image[i][0] = 0;
|
||||
image[i][1] = 0;
|
||||
image[i][2] = 0;
|
||||
}
|
||||
else {
|
||||
image[i][0] = 255;
|
||||
image[i][1] = 0;
|
||||
image[i][2] = 0;
|
||||
}
|
||||
}
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 4, 4, 0,
|
||||
GL_RGB, GL_UNSIGNED_BYTE, image);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
|
||||
#if defined(GL_EXT_secondary_color)
|
||||
glEnable(GL_COLOR_SUM_EXT);
|
||||
#endif
|
||||
glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR);
|
||||
|
||||
printf("Squares should be colored from red -> orange -> yellow.\n");
|
||||
printf("Top row is untextured.\n");
|
||||
printf("Bottom row is textured (red texture with one black texel).\n");
|
||||
printf("Rows should be identical, except for lower-left texel.\n");
|
||||
}
|
||||
|
||||
|
||||
int main( int argc, char *argv[] )
|
||||
{
|
||||
glutInit( &argc, argv );
|
||||
glutInitWindowPosition( 0, 0 );
|
||||
glutInitWindowSize( Width, Height );
|
||||
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
|
||||
glutCreateWindow(argv[0]);
|
||||
glutReshapeFunc( Reshape );
|
||||
glutKeyboardFunc( Key );
|
||||
glutDisplayFunc( Display );
|
||||
Init();
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
||||
437
progs/tests/sharedtex.c
Normal file
437
progs/tests/sharedtex.c
Normal file
@@ -0,0 +1,437 @@
|
||||
/* $Id: sharedtex.c,v 1.1 2000/09/01 21:01:18 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Test sharing of display lists and texture objects between GLX contests.
|
||||
* Brian Paul
|
||||
* Summer 2000
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2000 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is 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 Software.
|
||||
*
|
||||
* THE SOFTWARE IS 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
|
||||
* BRIAN PAUL 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 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glx.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
||||
struct window {
|
||||
char DisplayName[1000];
|
||||
Display *Dpy;
|
||||
Window Win;
|
||||
GLXContext Context;
|
||||
float Angle;
|
||||
int Id;
|
||||
};
|
||||
|
||||
|
||||
#define MAX_WINDOWS 20
|
||||
static struct window Windows[MAX_WINDOWS];
|
||||
static int NumWindows = 0;
|
||||
|
||||
|
||||
static GLuint Textures[3];
|
||||
static GLuint CubeList;
|
||||
|
||||
|
||||
|
||||
static void
|
||||
Error(const char *display, const char *msg)
|
||||
{
|
||||
fprintf(stderr, "Error on display %s - %s\n", display, msg);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
static struct window *
|
||||
AddWindow(const char *displayName, int xpos, int ypos,
|
||||
const struct window *shareWindow)
|
||||
{
|
||||
Display *dpy;
|
||||
Window win;
|
||||
GLXContext ctx;
|
||||
int attrib[] = { GLX_RGBA,
|
||||
GLX_RED_SIZE, 1,
|
||||
GLX_GREEN_SIZE, 1,
|
||||
GLX_BLUE_SIZE, 1,
|
||||
GLX_DOUBLEBUFFER,
|
||||
GLX_DEPTH_SIZE, 1,
|
||||
None };
|
||||
int scrnum;
|
||||
XSetWindowAttributes attr;
|
||||
unsigned long mask;
|
||||
Window root;
|
||||
XVisualInfo *visinfo;
|
||||
int width = 300, height = 300;
|
||||
|
||||
if (NumWindows >= MAX_WINDOWS)
|
||||
return NULL;
|
||||
|
||||
dpy = XOpenDisplay(displayName);
|
||||
if (!dpy) {
|
||||
Error(displayName, "Unable to open display");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
scrnum = DefaultScreen(dpy);
|
||||
root = RootWindow(dpy, scrnum);
|
||||
|
||||
visinfo = glXChooseVisual(dpy, scrnum, attrib);
|
||||
if (!visinfo) {
|
||||
Error(displayName, "Unable to find RGB, double-buffered visual");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* window attributes */
|
||||
attr.background_pixel = 0;
|
||||
attr.border_pixel = 0;
|
||||
attr.colormap = XCreateColormap(dpy, root, visinfo->visual, AllocNone);
|
||||
attr.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask;
|
||||
mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
|
||||
|
||||
win = XCreateWindow(dpy, root, xpos, ypos, width, height,
|
||||
0, visinfo->depth, InputOutput,
|
||||
visinfo->visual, mask, &attr);
|
||||
if (!win) {
|
||||
Error(displayName, "Couldn't create window");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
{
|
||||
XSizeHints sizehints;
|
||||
sizehints.x = xpos;
|
||||
sizehints.y = ypos;
|
||||
sizehints.width = width;
|
||||
sizehints.height = height;
|
||||
sizehints.flags = USSize | USPosition;
|
||||
XSetNormalHints(dpy, win, &sizehints);
|
||||
XSetStandardProperties(dpy, win, displayName, displayName,
|
||||
None, (char **)NULL, 0, &sizehints);
|
||||
}
|
||||
|
||||
|
||||
ctx = glXCreateContext(dpy, visinfo,
|
||||
shareWindow ? shareWindow->Context : NULL,
|
||||
True);
|
||||
if (!ctx) {
|
||||
Error(displayName, "Couldn't create GLX context");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
XMapWindow(dpy, win);
|
||||
|
||||
if (!glXMakeCurrent(dpy, win, ctx)) {
|
||||
Error(displayName, "glXMakeCurrent failed");
|
||||
printf("glXMakeCurrent failed in Redraw()\n");
|
||||
return;
|
||||
}
|
||||
|
||||
/* save the info for this window */
|
||||
{
|
||||
static int id = 0;
|
||||
struct window *h = &Windows[NumWindows];
|
||||
strcpy(h->DisplayName, displayName);
|
||||
h->Dpy = dpy;
|
||||
h->Win = win;
|
||||
h->Context = ctx;
|
||||
h->Angle = 0.0;
|
||||
h->Id = id++;
|
||||
NumWindows++;
|
||||
return &Windows[NumWindows-1];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
InitGLstuff(struct window *h)
|
||||
{
|
||||
if (!glXMakeCurrent(h->Dpy, h->Win, h->Context)) {
|
||||
Error(h->DisplayName, "glXMakeCurrent failed in InitGLstuff");
|
||||
return;
|
||||
}
|
||||
|
||||
glGenTextures(3, Textures);
|
||||
|
||||
/* setup first texture object */
|
||||
{
|
||||
GLubyte image[16][16][4];
|
||||
GLint i, j;
|
||||
glBindTexture(GL_TEXTURE_2D, Textures[0]);
|
||||
|
||||
/* red/white checkerboard */
|
||||
for (i = 0; i < 16; i++) {
|
||||
for (j = 0; j < 16; j++) {
|
||||
if ((i ^ j) & 1) {
|
||||
image[i][j][0] = 255;
|
||||
image[i][j][1] = 255;
|
||||
image[i][j][2] = 255;
|
||||
image[i][j][3] = 255;
|
||||
}
|
||||
else {
|
||||
image[i][j][0] = 255;
|
||||
image[i][j][1] = 0;
|
||||
image[i][j][2] = 0;
|
||||
image[i][j][3] = 255;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 16, 16, 0, GL_RGBA,
|
||||
GL_UNSIGNED_BYTE, image);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
}
|
||||
|
||||
/* setup second texture object */
|
||||
{
|
||||
GLubyte image[8][8][3];
|
||||
GLint i, j;
|
||||
glBindTexture(GL_TEXTURE_2D, Textures[1]);
|
||||
|
||||
/* green/yellow checkerboard */
|
||||
for (i = 0; i < 8; i++) {
|
||||
for (j = 0; j < 8; j++) {
|
||||
if ((i ^ j) & 1) {
|
||||
image[i][j][0] = 0;
|
||||
image[i][j][1] = 255;
|
||||
image[i][j][2] = 0;
|
||||
}
|
||||
else {
|
||||
image[i][j][0] = 255;
|
||||
image[i][j][1] = 255;
|
||||
image[i][j][2] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 2);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 8, 8, 0, GL_RGB,
|
||||
GL_UNSIGNED_BYTE, image);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
}
|
||||
|
||||
/* setup second texture object */
|
||||
{
|
||||
GLubyte image[4][4][3];
|
||||
GLint i, j;
|
||||
glBindTexture(GL_TEXTURE_2D, Textures[2]);
|
||||
|
||||
/* blue/gray checkerboard */
|
||||
for (i = 0; i < 4; i++) {
|
||||
for (j = 0; j < 4; j++) {
|
||||
if ((i ^ j) & 1) {
|
||||
image[i][j][0] = 0;
|
||||
image[i][j][1] = 0;
|
||||
image[i][j][2] = 255;
|
||||
}
|
||||
else {
|
||||
image[i][j][0] = 200;
|
||||
image[i][j][1] = 200;
|
||||
image[i][j][2] = 200;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 2);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 4, 4, 0, GL_RGB,
|
||||
GL_UNSIGNED_BYTE, image);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
}
|
||||
|
||||
/* Now make the cube object display list */
|
||||
CubeList = glGenLists(1);
|
||||
glNewList(CubeList, GL_COMPILE);
|
||||
{
|
||||
glBindTexture(GL_TEXTURE_2D, Textures[0]);
|
||||
glBegin(GL_POLYGON);
|
||||
glTexCoord2f(0, 0); glVertex3f(-1, -1, -1);
|
||||
glTexCoord2f(1, 0); glVertex3f(-1, 1, -1);
|
||||
glTexCoord2f(1, 1); glVertex3f(-1, 1, 1);
|
||||
glTexCoord2f(0, 1); glVertex3f(-1, -1, 1);
|
||||
glEnd();
|
||||
glBegin(GL_POLYGON);
|
||||
glTexCoord2f(0, 0); glVertex3f(1, -1, -1);
|
||||
glTexCoord2f(1, 0); glVertex3f(1, 1, -1);
|
||||
glTexCoord2f(1, 1); glVertex3f(1, 1, 1);
|
||||
glTexCoord2f(0, 1); glVertex3f(1, -1, 1);
|
||||
glEnd();
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, Textures[1]);
|
||||
glBegin(GL_POLYGON);
|
||||
glTexCoord2f(0, 0); glVertex3f(-1, -1, -1);
|
||||
glTexCoord2f(1, 0); glVertex3f( 1, -1, -1);
|
||||
glTexCoord2f(1, 1); glVertex3f( 1, -1, 1);
|
||||
glTexCoord2f(0, 1); glVertex3f(-1, -1, 1);
|
||||
glEnd();
|
||||
glBegin(GL_POLYGON);
|
||||
glTexCoord2f(0, 0); glVertex3f(-1, 1, -1);
|
||||
glTexCoord2f(1, 0); glVertex3f( 1, 1, -1);
|
||||
glTexCoord2f(1, 1); glVertex3f( 1, 1, 1);
|
||||
glTexCoord2f(0, 1); glVertex3f(-1, 1, 1);
|
||||
glEnd();
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, Textures[2]);
|
||||
glBegin(GL_POLYGON);
|
||||
glTexCoord2f(0, 0); glVertex3f(-1, -1, -1);
|
||||
glTexCoord2f(1, 0); glVertex3f( 1, -1, -1);
|
||||
glTexCoord2f(1, 1); glVertex3f( 1, 1, -1);
|
||||
glTexCoord2f(0, 1); glVertex3f(-1, 1, -1);
|
||||
glEnd();
|
||||
glBegin(GL_POLYGON);
|
||||
glTexCoord2f(0, 0); glVertex3f(-1, -1, 1);
|
||||
glTexCoord2f(1, 0); glVertex3f( 1, -1, 1);
|
||||
glTexCoord2f(1, 1); glVertex3f( 1, 1, 1);
|
||||
glTexCoord2f(0, 1); glVertex3f(-1, 1, 1);
|
||||
glEnd();
|
||||
}
|
||||
glEndList();
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
Redraw(struct window *h)
|
||||
{
|
||||
if (!glXMakeCurrent(h->Dpy, h->Win, h->Context)) {
|
||||
Error(h->DisplayName, "glXMakeCurrent failed");
|
||||
printf("glXMakeCurrent failed in Redraw()\n");
|
||||
return;
|
||||
}
|
||||
|
||||
h->Angle += 1.0;
|
||||
|
||||
glShadeModel(GL_FLAT);
|
||||
glClearColor(0.25, 0.25, 0.25, 1.0);
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
||||
|
||||
glColor3f(1, 1, 1);
|
||||
|
||||
glPushMatrix();
|
||||
if (h->Id == 0)
|
||||
glRotatef(h->Angle, 0, 1, -1);
|
||||
else if (h->Id == 1)
|
||||
glRotatef(-(h->Angle), 0, 1, -1);
|
||||
else if (h->Id == 2)
|
||||
glRotatef(h->Angle, 0, 1, 1);
|
||||
else if (h->Id == 3)
|
||||
glRotatef(-(h->Angle), 0, 1, 1);
|
||||
glCallList(CubeList);
|
||||
glPopMatrix();
|
||||
|
||||
glXSwapBuffers(h->Dpy, h->Win);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
Resize(const struct window *h, unsigned int width, unsigned int height)
|
||||
{
|
||||
if (!glXMakeCurrent(h->Dpy, h->Win, h->Context)) {
|
||||
Error(h->DisplayName, "glXMakeCurrent failed in Resize()");
|
||||
return;
|
||||
}
|
||||
glViewport(0, 0, width, height);
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glFrustum(-1, 1, -1, 1, 2, 10);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
glTranslatef(0, 0, -3.5);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
EventLoop(void)
|
||||
{
|
||||
while (1) {
|
||||
int i;
|
||||
for (i = 0; i < NumWindows; i++) {
|
||||
struct window *h = &Windows[i];
|
||||
while (XPending(h->Dpy) > 0) {
|
||||
XEvent event;
|
||||
XNextEvent(h->Dpy, &event);
|
||||
if (event.xany.window == h->Win) {
|
||||
switch (event.type) {
|
||||
case Expose:
|
||||
Redraw(h);
|
||||
break;
|
||||
case ConfigureNotify:
|
||||
Resize(h, event.xconfigure.width, event.xconfigure.height);
|
||||
break;
|
||||
case KeyPress:
|
||||
return;
|
||||
default:
|
||||
/*no-op*/ ;
|
||||
}
|
||||
}
|
||||
else {
|
||||
printf("window mismatch\n");
|
||||
}
|
||||
}
|
||||
Redraw(h);
|
||||
}
|
||||
usleep(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
PrintInfo(const struct window *h)
|
||||
{
|
||||
printf("Name: %s\n", h->DisplayName);
|
||||
printf(" Display: 0x%x\n", h->Dpy);
|
||||
printf(" Window: 0x%x\n", h->Win);
|
||||
printf(" Context: 0x%x\n", h->Context);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
int i;
|
||||
struct window *h0, *h1, *h2, *h3;
|
||||
|
||||
/* four windows and contexts sharing display lists and texture objects */
|
||||
h0 = AddWindow(":0", 10, 10, NULL);
|
||||
h1 = AddWindow(":0", 330, 10, h0);
|
||||
h2 = AddWindow(":0", 10, 350, h0);
|
||||
h3 = AddWindow(":0", 330, 350, h0);
|
||||
|
||||
InitGLstuff(h0);
|
||||
|
||||
EventLoop();
|
||||
return 0;
|
||||
}
|
||||
251
progs/tests/texline.c
Normal file
251
progs/tests/texline.c
Normal file
@@ -0,0 +1,251 @@
|
||||
/* $Id: texline.c,v 1.3 2001/05/21 17:45:25 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Test textured lines.
|
||||
*
|
||||
* Brian Paul
|
||||
* September 2000
|
||||
*/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <GL/glut.h>
|
||||
#include "../util/readtex.c" /* I know, this is a hack. */
|
||||
|
||||
#define TEXTURE_FILE "../images/girl.rgb"
|
||||
|
||||
static GLboolean Antialias = GL_FALSE;
|
||||
static GLboolean Animate = GL_FALSE;
|
||||
static GLboolean Texture = GL_TRUE;
|
||||
static GLfloat LineWidth = 1.0;
|
||||
static GLboolean Multitex = GL_FALSE;
|
||||
|
||||
static GLfloat Xrot = -60.0, Yrot = 0.0, Zrot = 0.0;
|
||||
static GLfloat DYrot = 1.0;
|
||||
static GLboolean Points = GL_FALSE;
|
||||
|
||||
|
||||
static void Idle( void )
|
||||
{
|
||||
if (Animate) {
|
||||
Zrot += DYrot;
|
||||
glutPostRedisplay();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void Display( void )
|
||||
{
|
||||
GLfloat x, y, s, t;
|
||||
|
||||
glClear( GL_COLOR_BUFFER_BIT );
|
||||
|
||||
glPushMatrix();
|
||||
glRotatef(Xrot, 1.0, 0.0, 0.0);
|
||||
glRotatef(Yrot, 0.0, 1.0, 0.0);
|
||||
glRotatef(Zrot, 0.0, 0.0, 1.0);
|
||||
|
||||
if (Texture)
|
||||
glColor3f(1, 1, 1);
|
||||
|
||||
if (Points) {
|
||||
glBegin(GL_POINTS);
|
||||
for (t = 0.0; t <= 1.0; t += 0.025) {
|
||||
for (s = 0.0; s <= 1.0; s += 0.025) {
|
||||
x = s * 2.0 - 1.0;
|
||||
y = t * 2.0 - 1.0;
|
||||
if (!Texture)
|
||||
glColor3f(1, 0, 1);
|
||||
glMultiTexCoord2fARB(GL_TEXTURE1_ARB, t, s);
|
||||
glTexCoord2f(s, t);
|
||||
glVertex2f(x, y);
|
||||
}
|
||||
}
|
||||
glEnd();
|
||||
}
|
||||
else {
|
||||
glBegin(GL_LINES);
|
||||
for (t = 0.0; t <= 1.0; t += 0.025) {
|
||||
x = t * 2.0 - 1.0;
|
||||
if (!Texture)
|
||||
glColor3f(1, 0, 1);
|
||||
glTexCoord2f(t, 0.0);
|
||||
glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 0.0, t);
|
||||
glVertex2f(x, -1.0);
|
||||
if (!Texture)
|
||||
glColor3f(0, 1, 0);
|
||||
glTexCoord2f(t, 1.0);
|
||||
glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 1.0, t);
|
||||
glVertex2f(x, 1.0);
|
||||
}
|
||||
glEnd();
|
||||
}
|
||||
|
||||
glPopMatrix();
|
||||
|
||||
glutSwapBuffers();
|
||||
}
|
||||
|
||||
|
||||
static void Reshape( int width, int height )
|
||||
{
|
||||
GLfloat ar = (float) width / height;
|
||||
glViewport( 0, 0, width, height );
|
||||
glMatrixMode( GL_PROJECTION );
|
||||
glLoadIdentity();
|
||||
glFrustum( -ar, ar, -1.0, 1.0, 10.0, 100.0 );
|
||||
glMatrixMode( GL_MODELVIEW );
|
||||
glLoadIdentity();
|
||||
glTranslatef( 0.0, 0.0, -12.0 );
|
||||
}
|
||||
|
||||
|
||||
static void Key( unsigned char key, int x, int y )
|
||||
{
|
||||
(void) x;
|
||||
(void) y;
|
||||
switch (key) {
|
||||
case 'a':
|
||||
Antialias = !Antialias;
|
||||
if (Antialias) {
|
||||
glEnable(GL_LINE_SMOOTH);
|
||||
glEnable(GL_POINT_SMOOTH);
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
}
|
||||
else {
|
||||
glDisable(GL_LINE_SMOOTH);
|
||||
glDisable(GL_POINT_SMOOTH);
|
||||
glDisable(GL_BLEND);
|
||||
}
|
||||
break;
|
||||
case 't':
|
||||
Texture = !Texture;
|
||||
if (Texture)
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
else
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
break;
|
||||
case 'w':
|
||||
LineWidth -= 0.25;
|
||||
if (LineWidth < 0.25)
|
||||
LineWidth = 0.25;
|
||||
glLineWidth(LineWidth);
|
||||
glPointSize(LineWidth);
|
||||
break;
|
||||
case 'W':
|
||||
LineWidth += 0.25;
|
||||
if (LineWidth > 8.0)
|
||||
LineWidth = 8.0;
|
||||
glLineWidth(LineWidth);
|
||||
glPointSize(LineWidth);
|
||||
break;
|
||||
case 'm':
|
||||
Multitex = !Multitex;
|
||||
if (Multitex) {
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
}
|
||||
else {
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
}
|
||||
break;
|
||||
case 'p':
|
||||
Points = !Points;
|
||||
break;
|
||||
case ' ':
|
||||
Animate = !Animate;
|
||||
if (Animate)
|
||||
glutIdleFunc(Idle);
|
||||
else
|
||||
glutIdleFunc(NULL);
|
||||
break;
|
||||
case 27:
|
||||
exit(0);
|
||||
break;
|
||||
}
|
||||
printf("LineWidth, PointSize = %f\n", LineWidth);
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
static void SpecialKey( int key, int x, int y )
|
||||
{
|
||||
float step = 3.0;
|
||||
(void) x;
|
||||
(void) y;
|
||||
|
||||
switch (key) {
|
||||
case GLUT_KEY_UP:
|
||||
Xrot += step;
|
||||
break;
|
||||
case GLUT_KEY_DOWN:
|
||||
Xrot -= step;
|
||||
break;
|
||||
case GLUT_KEY_LEFT:
|
||||
Yrot += step;
|
||||
break;
|
||||
case GLUT_KEY_RIGHT:
|
||||
Yrot -= step;
|
||||
break;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
static void Init( int argc, char *argv[] )
|
||||
{
|
||||
GLuint u;
|
||||
for (u = 0; u < 2; u++) {
|
||||
glActiveTextureARB(GL_TEXTURE0_ARB + u);
|
||||
glBindTexture(GL_TEXTURE_2D, 10+u);
|
||||
if (u == 0 || Multitex)
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
|
||||
if (u == 0)
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
||||
else
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_ADD);
|
||||
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
if (!LoadRGBMipmaps(TEXTURE_FILE, GL_RGB)) {
|
||||
printf("Error: couldn't load texture image\n");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
if (argc > 1 && strcmp(argv[1], "-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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int main( int argc, char *argv[] )
|
||||
{
|
||||
glutInit( &argc, argv );
|
||||
glutInitWindowSize( 400, 300 );
|
||||
|
||||
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
|
||||
|
||||
glutCreateWindow(argv[0] );
|
||||
|
||||
Init(argc, argv);
|
||||
|
||||
glutReshapeFunc( Reshape );
|
||||
glutKeyboardFunc( Key );
|
||||
glutSpecialFunc( SpecialKey );
|
||||
glutDisplayFunc( Display );
|
||||
if (Animate)
|
||||
glutIdleFunc( Idle );
|
||||
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
||||
235
progs/tests/texwrap.c
Normal file
235
progs/tests/texwrap.c
Normal file
@@ -0,0 +1,235 @@
|
||||
/* $Id: texwrap.c,v 1.2 2001/04/12 20:50:26 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Test texture wrap modes.
|
||||
* Press 'b' to toggle texture image borders. You should see the same
|
||||
* rendering whether or not you're using borders.
|
||||
*
|
||||
* Brian Paul March 2001
|
||||
*/
|
||||
|
||||
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <GL/glut.h>
|
||||
|
||||
|
||||
#ifndef GL_CLAMP_TO_BORDER_ARB
|
||||
#define GL_CLAMP_TO_BORDER_ARB 0x812D
|
||||
#endif
|
||||
|
||||
|
||||
#define BORDER_TEXTURE 1
|
||||
#define NO_BORDER_TEXTURE 2
|
||||
|
||||
#define SIZE 8
|
||||
static GLubyte BorderImage[SIZE+2][SIZE+2][4];
|
||||
static GLubyte NoBorderImage[SIZE][SIZE][4];
|
||||
static GLuint Border = 1;
|
||||
|
||||
|
||||
static void
|
||||
PrintString(const char *s)
|
||||
{
|
||||
while (*s) {
|
||||
glutBitmapCharacter(GLUT_BITMAP_8_BY_13, (int) *s);
|
||||
s++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void Display( void )
|
||||
{
|
||||
static const GLenum modes[] = {
|
||||
GL_REPEAT,
|
||||
GL_CLAMP,
|
||||
GL_CLAMP_TO_EDGE,
|
||||
GL_CLAMP_TO_BORDER_ARB
|
||||
};
|
||||
static const char *names[] = {
|
||||
"GL_REPEAT",
|
||||
"GL_CLAMP",
|
||||
"GL_CLAMP_TO_EDGE",
|
||||
"GL_CLAMP_TO_BORDER_ARB"
|
||||
};
|
||||
|
||||
GLint i, j;
|
||||
GLint numModes;
|
||||
|
||||
numModes = glutExtensionSupported("GL_ARB_texture_border_clamp") ? 4 : 3;
|
||||
|
||||
glClearColor(0.5, 0.5, 0.5, 1.0);
|
||||
glClear( GL_COLOR_BUFFER_BIT );
|
||||
|
||||
#if 0
|
||||
/* draw texture as image */
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
glWindowPos2iMESA(1, 1);
|
||||
glDrawPixels(6, 6, GL_RGBA, GL_UNSIGNED_BYTE, (void *) TexImage);
|
||||
#endif
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, Border ? BORDER_TEXTURE : NO_BORDER_TEXTURE);
|
||||
|
||||
/* loop over min/mag filters */
|
||||
for (i = 0; i < 2; i++) {
|
||||
if (i) {
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
}
|
||||
else {
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
}
|
||||
|
||||
/* loop over border modes */
|
||||
for (j = 0; j < numModes; j++) {
|
||||
const GLfloat x0 = 0, y0 = 0, x1 = 140, y1 = 140;
|
||||
const GLfloat b = 0.2;
|
||||
const GLfloat s0 = -b, t0 = -b, s1 = 1.0+b, t1 = 1.0+b;
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, modes[j]);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, modes[j]);
|
||||
|
||||
glPushMatrix();
|
||||
glTranslatef(j * 150 + 10, i * 150 + 25, 0);
|
||||
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glColor3f(1, 1, 1);
|
||||
glBegin(GL_POLYGON);
|
||||
glTexCoord2f(s0, t0); glVertex2f(x0, y0);
|
||||
glTexCoord2f(s1, t0); glVertex2f(x1, y0);
|
||||
glTexCoord2f(s1, t1); glVertex2f(x1, y1);
|
||||
glTexCoord2f(s0, t1); glVertex2f(x0, y1);
|
||||
glEnd();
|
||||
|
||||
/* draw red outline showing bounds of texture at s=0,1 and t=0,1 */
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
glColor3f(1, 0, 0);
|
||||
glBegin(GL_LINE_LOOP);
|
||||
glVertex2f(x0 + b * (x1-x0) / (s1-s0), y0 + b * (y1-y0) / (t1-t0));
|
||||
glVertex2f(x1 - b * (x1-x0) / (s1-s0), y0 + b * (y1-y0) / (t1-t0));
|
||||
glVertex2f(x1 - b * (x1-x0) / (s1-s0), y1 - b * (y1-y0) / (t1-t0));
|
||||
glVertex2f(x0 + b * (x1-x0) / (s1-s0), y1 - b * (y1-y0) / (t1-t0));
|
||||
glEnd();
|
||||
|
||||
glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
glColor3f(1, 1, 1);
|
||||
for (i = 0; i < numModes; i++) {
|
||||
glWindowPos2iMESA( i * 150 + 10, 5);
|
||||
PrintString(names[i]);
|
||||
}
|
||||
|
||||
glutSwapBuffers();
|
||||
}
|
||||
|
||||
|
||||
static void Reshape( int width, int height )
|
||||
{
|
||||
glViewport( 0, 0, width, height );
|
||||
glMatrixMode( GL_PROJECTION );
|
||||
glLoadIdentity();
|
||||
glOrtho(0, width, 0, height, -1, 1);
|
||||
glMatrixMode( GL_MODELVIEW );
|
||||
glLoadIdentity();
|
||||
}
|
||||
|
||||
|
||||
static void Key( unsigned char key, int x, int y )
|
||||
{
|
||||
(void) x;
|
||||
(void) y;
|
||||
switch (key) {
|
||||
case 'b':
|
||||
Border = !Border;
|
||||
printf("Texture Border Size = %d\n", Border);
|
||||
break;
|
||||
case 27:
|
||||
exit(0);
|
||||
break;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
static void Init( void )
|
||||
{
|
||||
static const GLubyte border[4] = { 0, 255, 0, 255 };
|
||||
static const GLfloat borderf[4] = { 0, 1.0, 0, 1.0 };
|
||||
GLint i, j;
|
||||
|
||||
for (i = 0; i < SIZE+2; i++) {
|
||||
for (j = 0; j < SIZE+2; j++) {
|
||||
if (i == 0 || j == 0 || i == SIZE+1 || j == SIZE+1) {
|
||||
/* border color */
|
||||
BorderImage[i][j][0] = border[0];
|
||||
BorderImage[i][j][1] = border[1];
|
||||
BorderImage[i][j][2] = border[2];
|
||||
BorderImage[i][j][3] = border[3];
|
||||
}
|
||||
else if ((i + j) & 1) {
|
||||
/* white */
|
||||
BorderImage[i][j][0] = 255;
|
||||
BorderImage[i][j][1] = 255;
|
||||
BorderImage[i][j][2] = 255;
|
||||
BorderImage[i][j][3] = 255;
|
||||
}
|
||||
else {
|
||||
/* black */
|
||||
BorderImage[i][j][0] = 0;
|
||||
BorderImage[i][j][1] = 0;
|
||||
BorderImage[i][j][2] = 0;
|
||||
BorderImage[i][j][3] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, BORDER_TEXTURE);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, SIZE+2, SIZE+2, 1,
|
||||
GL_RGBA, GL_UNSIGNED_BYTE, (void *) BorderImage);
|
||||
|
||||
|
||||
for (i = 0; i < SIZE; i++) {
|
||||
for (j = 0; j < SIZE; j++) {
|
||||
if ((i + j) & 1) {
|
||||
/* white */
|
||||
NoBorderImage[i][j][0] = 255;
|
||||
NoBorderImage[i][j][1] = 255;
|
||||
NoBorderImage[i][j][2] = 255;
|
||||
NoBorderImage[i][j][3] = 255;
|
||||
}
|
||||
else {
|
||||
/* black */
|
||||
NoBorderImage[i][j][0] = 0;
|
||||
NoBorderImage[i][j][1] = 0;
|
||||
NoBorderImage[i][j][2] = 0;
|
||||
NoBorderImage[i][j][3] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, NO_BORDER_TEXTURE);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, SIZE, SIZE, 0,
|
||||
GL_RGBA, GL_UNSIGNED_BYTE, (void *) NoBorderImage);
|
||||
glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, borderf);
|
||||
}
|
||||
|
||||
|
||||
int main( int argc, char *argv[] )
|
||||
{
|
||||
glutInit( &argc, argv );
|
||||
glutInitWindowPosition( 0, 0 );
|
||||
glutInitWindowSize( 650, 340 );
|
||||
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
|
||||
glutCreateWindow(argv[0]);
|
||||
glutReshapeFunc( Reshape );
|
||||
glutKeyboardFunc( Key );
|
||||
glutDisplayFunc( Display );
|
||||
Init();
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
# $Id: Makefile.X11,v 1.10 2000/07/20 20:12:17 brianp Exp $
|
||||
# $Id: Makefile.X11,v 1.11 2001/03/23 22:48:35 brianp Exp $
|
||||
|
||||
# Mesa 3-D graphics library
|
||||
# Version: 3.3
|
||||
# Copyright (C) 1995-2000 Brian Paul
|
||||
# Version: 3.5
|
||||
# Copyright (C) 1995-2001 Brian Paul
|
||||
|
||||
# Makefile for non-GLUT (X11, SVGA, etc) demo programs
|
||||
|
||||
@@ -18,6 +18,7 @@ LIB_DEP = $(LIBDIR)/$(GL_LIB) $(LIBDIR)/$(GLU_LIB) $(LIBDIR)/$(GLUT_LIB)
|
||||
|
||||
PROGS = glthreads \
|
||||
glxdemo \
|
||||
glxgears \
|
||||
glxheads \
|
||||
glxinfo \
|
||||
glxpixmap \
|
||||
|
||||
497
progs/xdemos/glxgears.c
Normal file
497
progs/xdemos/glxgears.c
Normal file
@@ -0,0 +1,497 @@
|
||||
/*
|
||||
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is 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 Software.
|
||||
*
|
||||
* THE SOFTWARE IS 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
|
||||
* BRIAN PAUL 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 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This is a port of the infamous "gears" demo to straight GLX (i.e. no GLUT)
|
||||
* Port by Brian Paul 23 March 2001
|
||||
*
|
||||
* Command line options:
|
||||
* -info print GL implementation information
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/keysym.h>
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glx.h>
|
||||
|
||||
|
||||
#define BENCHMARK
|
||||
|
||||
#ifdef BENCHMARK
|
||||
|
||||
/* XXX this probably isn't very portable */
|
||||
|
||||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
/* return current time (in seconds) */
|
||||
static int
|
||||
current_time(void)
|
||||
{
|
||||
struct timeval tv;
|
||||
struct timezone tz;
|
||||
(void) gettimeofday(&tv, &tz);
|
||||
return (int) tv.tv_sec;
|
||||
}
|
||||
|
||||
#else /*BENCHMARK*/
|
||||
|
||||
/* dummy */
|
||||
static int
|
||||
current_time(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /*BENCHMARK*/
|
||||
|
||||
|
||||
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265
|
||||
#endif
|
||||
|
||||
|
||||
static GLfloat view_rotx = 20.0, view_roty = 30.0, view_rotz = 0.0;
|
||||
static GLint gear1, gear2, gear3;
|
||||
static GLfloat angle = 0.0;
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* Draw a gear wheel. You'll probably want to call this function when
|
||||
* building a display list since we do a lot of trig here.
|
||||
*
|
||||
* Input: inner_radius - radius of hole at center
|
||||
* outer_radius - radius at center of teeth
|
||||
* width - width of gear
|
||||
* teeth - number of teeth
|
||||
* tooth_depth - depth of tooth
|
||||
*/
|
||||
static void
|
||||
gear(GLfloat inner_radius, GLfloat outer_radius, GLfloat width,
|
||||
GLint teeth, GLfloat tooth_depth)
|
||||
{
|
||||
GLint i;
|
||||
GLfloat r0, r1, r2;
|
||||
GLfloat angle, da;
|
||||
GLfloat u, v, len;
|
||||
|
||||
r0 = inner_radius;
|
||||
r1 = outer_radius - tooth_depth / 2.0;
|
||||
r2 = outer_radius + tooth_depth / 2.0;
|
||||
|
||||
da = 2.0 * M_PI / teeth / 4.0;
|
||||
|
||||
glShadeModel(GL_FLAT);
|
||||
|
||||
glNormal3f(0.0, 0.0, 1.0);
|
||||
|
||||
/* draw front face */
|
||||
glBegin(GL_QUAD_STRIP);
|
||||
for (i = 0; i <= teeth; i++) {
|
||||
angle = i * 2.0 * M_PI / teeth;
|
||||
glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
|
||||
glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
|
||||
if (i < teeth) {
|
||||
glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
|
||||
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
|
||||
width * 0.5);
|
||||
}
|
||||
}
|
||||
glEnd();
|
||||
|
||||
/* draw front sides of teeth */
|
||||
glBegin(GL_QUADS);
|
||||
da = 2.0 * M_PI / teeth / 4.0;
|
||||
for (i = 0; i < teeth; i++) {
|
||||
angle = i * 2.0 * M_PI / teeth;
|
||||
|
||||
glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
|
||||
glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), width * 0.5);
|
||||
glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da),
|
||||
width * 0.5);
|
||||
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
|
||||
width * 0.5);
|
||||
}
|
||||
glEnd();
|
||||
|
||||
glNormal3f(0.0, 0.0, -1.0);
|
||||
|
||||
/* draw back face */
|
||||
glBegin(GL_QUAD_STRIP);
|
||||
for (i = 0; i <= teeth; i++) {
|
||||
angle = i * 2.0 * M_PI / teeth;
|
||||
glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
|
||||
glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
|
||||
if (i < teeth) {
|
||||
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
|
||||
-width * 0.5);
|
||||
glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
|
||||
}
|
||||
}
|
||||
glEnd();
|
||||
|
||||
/* draw back sides of teeth */
|
||||
glBegin(GL_QUADS);
|
||||
da = 2.0 * M_PI / teeth / 4.0;
|
||||
for (i = 0; i < teeth; i++) {
|
||||
angle = i * 2.0 * M_PI / teeth;
|
||||
|
||||
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
|
||||
-width * 0.5);
|
||||
glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da),
|
||||
-width * 0.5);
|
||||
glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -width * 0.5);
|
||||
glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
|
||||
}
|
||||
glEnd();
|
||||
|
||||
/* draw outward faces of teeth */
|
||||
glBegin(GL_QUAD_STRIP);
|
||||
for (i = 0; i < teeth; i++) {
|
||||
angle = i * 2.0 * M_PI / teeth;
|
||||
|
||||
glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
|
||||
glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
|
||||
u = r2 * cos(angle + da) - r1 * cos(angle);
|
||||
v = r2 * sin(angle + da) - r1 * sin(angle);
|
||||
len = sqrt(u * u + v * v);
|
||||
u /= len;
|
||||
v /= len;
|
||||
glNormal3f(v, -u, 0.0);
|
||||
glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), width * 0.5);
|
||||
glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -width * 0.5);
|
||||
glNormal3f(cos(angle), sin(angle), 0.0);
|
||||
glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da),
|
||||
width * 0.5);
|
||||
glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da),
|
||||
-width * 0.5);
|
||||
u = r1 * cos(angle + 3 * da) - r2 * cos(angle + 2 * da);
|
||||
v = r1 * sin(angle + 3 * da) - r2 * sin(angle + 2 * da);
|
||||
glNormal3f(v, -u, 0.0);
|
||||
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
|
||||
width * 0.5);
|
||||
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
|
||||
-width * 0.5);
|
||||
glNormal3f(cos(angle), sin(angle), 0.0);
|
||||
}
|
||||
|
||||
glVertex3f(r1 * cos(0), r1 * sin(0), width * 0.5);
|
||||
glVertex3f(r1 * cos(0), r1 * sin(0), -width * 0.5);
|
||||
|
||||
glEnd();
|
||||
|
||||
glShadeModel(GL_SMOOTH);
|
||||
|
||||
/* draw inside radius cylinder */
|
||||
glBegin(GL_QUAD_STRIP);
|
||||
for (i = 0; i <= teeth; i++) {
|
||||
angle = i * 2.0 * M_PI / teeth;
|
||||
glNormal3f(-cos(angle), -sin(angle), 0.0);
|
||||
glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
|
||||
glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
|
||||
}
|
||||
glEnd();
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
draw(void)
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
glPushMatrix();
|
||||
glRotatef(view_rotx, 1.0, 0.0, 0.0);
|
||||
glRotatef(view_roty, 0.0, 1.0, 0.0);
|
||||
glRotatef(view_rotz, 0.0, 0.0, 1.0);
|
||||
|
||||
glPushMatrix();
|
||||
glTranslatef(-3.0, -2.0, 0.0);
|
||||
glRotatef(angle, 0.0, 0.0, 1.0);
|
||||
glCallList(gear1);
|
||||
glPopMatrix();
|
||||
|
||||
glPushMatrix();
|
||||
glTranslatef(3.1, -2.0, 0.0);
|
||||
glRotatef(-2.0 * angle - 9.0, 0.0, 0.0, 1.0);
|
||||
glCallList(gear2);
|
||||
glPopMatrix();
|
||||
|
||||
glPushMatrix();
|
||||
glTranslatef(-3.1, 4.2, 0.0);
|
||||
glRotatef(-2.0 * angle - 25.0, 0.0, 0.0, 1.0);
|
||||
glCallList(gear3);
|
||||
glPopMatrix();
|
||||
|
||||
glPopMatrix();
|
||||
}
|
||||
|
||||
|
||||
/* new window size or exposure */
|
||||
static void
|
||||
reshape(int width, int height)
|
||||
{
|
||||
GLfloat h = (GLfloat) height / (GLfloat) width;
|
||||
|
||||
glViewport(0, 0, (GLint) width, (GLint) height);
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glFrustum(-1.0, 1.0, -h, h, 5.0, 60.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
glTranslatef(0.0, 0.0, -40.0);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
init(void)
|
||||
{
|
||||
static GLfloat pos[4] = { 5.0, 5.0, 10.0, 0.0 };
|
||||
static GLfloat red[4] = { 0.8, 0.1, 0.0, 1.0 };
|
||||
static GLfloat green[4] = { 0.0, 0.8, 0.2, 1.0 };
|
||||
static GLfloat blue[4] = { 0.2, 0.2, 1.0, 1.0 };
|
||||
|
||||
glLightfv(GL_LIGHT0, GL_POSITION, pos);
|
||||
glEnable(GL_CULL_FACE);
|
||||
glEnable(GL_LIGHTING);
|
||||
glEnable(GL_LIGHT0);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
|
||||
/* make the gears */
|
||||
gear1 = glGenLists(1);
|
||||
glNewList(gear1, GL_COMPILE);
|
||||
glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, red);
|
||||
gear(1.0, 4.0, 1.0, 20, 0.7);
|
||||
glEndList();
|
||||
|
||||
gear2 = glGenLists(1);
|
||||
glNewList(gear2, GL_COMPILE);
|
||||
glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, green);
|
||||
gear(0.5, 2.0, 2.0, 10, 0.7);
|
||||
glEndList();
|
||||
|
||||
gear3 = glGenLists(1);
|
||||
glNewList(gear3, GL_COMPILE);
|
||||
glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, blue);
|
||||
gear(1.3, 2.0, 0.5, 10, 0.7);
|
||||
glEndList();
|
||||
|
||||
glEnable(GL_NORMALIZE);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Create an RGB, double-buffered window.
|
||||
* Return the window and context handles.
|
||||
*/
|
||||
static void
|
||||
make_window( Display *dpy, const char *name,
|
||||
int x, int y, int width, int height,
|
||||
Window *winRet, GLXContext *ctxRet)
|
||||
{
|
||||
int attrib[] = { GLX_RGBA,
|
||||
GLX_RED_SIZE, 1,
|
||||
GLX_GREEN_SIZE, 1,
|
||||
GLX_BLUE_SIZE, 1,
|
||||
GLX_DOUBLEBUFFER,
|
||||
GLX_DEPTH_SIZE, 1,
|
||||
None };
|
||||
int scrnum;
|
||||
XSetWindowAttributes attr;
|
||||
unsigned long mask;
|
||||
Window root;
|
||||
Window win;
|
||||
GLXContext ctx;
|
||||
XVisualInfo *visinfo;
|
||||
|
||||
scrnum = DefaultScreen( dpy );
|
||||
root = RootWindow( dpy, scrnum );
|
||||
|
||||
visinfo = glXChooseVisual( dpy, scrnum, attrib );
|
||||
if (!visinfo) {
|
||||
printf("Error: couldn't get an RGB, Double-buffered visual\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/* window attributes */
|
||||
attr.background_pixel = 0;
|
||||
attr.border_pixel = 0;
|
||||
attr.colormap = XCreateColormap( dpy, root, visinfo->visual, AllocNone);
|
||||
attr.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask;
|
||||
mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
|
||||
|
||||
win = XCreateWindow( dpy, root, 0, 0, width, height,
|
||||
0, visinfo->depth, InputOutput,
|
||||
visinfo->visual, mask, &attr );
|
||||
|
||||
/* set hints and properties */
|
||||
{
|
||||
XSizeHints sizehints;
|
||||
sizehints.x = x;
|
||||
sizehints.y = y;
|
||||
sizehints.width = width;
|
||||
sizehints.height = height;
|
||||
sizehints.flags = USSize | USPosition;
|
||||
XSetNormalHints(dpy, win, &sizehints);
|
||||
XSetStandardProperties(dpy, win, name, name,
|
||||
None, (char **)NULL, 0, &sizehints);
|
||||
}
|
||||
|
||||
ctx = glXCreateContext( dpy, visinfo, NULL, True );
|
||||
if (!ctx) {
|
||||
printf("Error: glXCreateContext failed\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
XFree(visinfo);
|
||||
|
||||
*winRet = win;
|
||||
*ctxRet = ctx;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
event_loop(Display *dpy, Window win)
|
||||
{
|
||||
while (1) {
|
||||
while (XPending(dpy) > 0) {
|
||||
XEvent event;
|
||||
XNextEvent(dpy, &event);
|
||||
switch (event.type) {
|
||||
case Expose:
|
||||
/* we'll redraw below */
|
||||
break;
|
||||
case ConfigureNotify:
|
||||
reshape(event.xconfigure.width, event.xconfigure.height);
|
||||
break;
|
||||
case KeyPress:
|
||||
{
|
||||
char buffer[10];
|
||||
int r, code;
|
||||
code = XLookupKeysym(&event.xkey, 0);
|
||||
if (code == XK_Left) {
|
||||
view_roty += 5.0;
|
||||
}
|
||||
else if (code == XK_Right) {
|
||||
view_roty -= 5.0;
|
||||
}
|
||||
else if (code == XK_Up) {
|
||||
view_rotx += 5.0;
|
||||
}
|
||||
else if (code == XK_Down) {
|
||||
view_rotx -= 5.0;
|
||||
}
|
||||
else {
|
||||
r = XLookupString(&event.xkey, buffer, sizeof(buffer),
|
||||
NULL, NULL);
|
||||
if (buffer[0] == 27) {
|
||||
/* escape */
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* next frame */
|
||||
angle += 2.0;
|
||||
|
||||
draw();
|
||||
glXSwapBuffers(dpy, win);
|
||||
|
||||
/* calc framerate */
|
||||
{
|
||||
static int t0 = -1;
|
||||
static int frames = 0;
|
||||
int t = current_time();
|
||||
|
||||
if (t0 < 0)
|
||||
t0 = t;
|
||||
|
||||
frames++;
|
||||
|
||||
if (t - t0 >= 5.0) {
|
||||
GLfloat seconds = t - t0;
|
||||
GLfloat fps = frames / seconds;
|
||||
printf("%d frames in %3.1f seconds = %6.3f FPS\n", frames, seconds,
|
||||
fps);
|
||||
t0 = t;
|
||||
frames = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
Display *dpy;
|
||||
Window win;
|
||||
GLXContext ctx;
|
||||
char *dpyName = ":0";
|
||||
GLboolean printInfo = GL_FALSE;
|
||||
int i;
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
if (strcmp(argv[i], "-display") == 0) {
|
||||
dpyName = argv[i+1];
|
||||
i++;
|
||||
}
|
||||
else if (strcmp(argv[i], "-info") == 0) {
|
||||
printInfo = GL_TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
dpy = XOpenDisplay(dpyName);
|
||||
if (!dpy) {
|
||||
printf("Error: couldn't open display %s\n", dpyName);
|
||||
return -1;
|
||||
}
|
||||
|
||||
make_window(dpy, "glxgears", 0, 0, 300, 300, &win, &ctx);
|
||||
XMapWindow(dpy, win);
|
||||
glXMakeCurrent(dpy, win, ctx);
|
||||
|
||||
if (printInfo) {
|
||||
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));
|
||||
}
|
||||
|
||||
init();
|
||||
|
||||
event_loop(dpy, win);
|
||||
|
||||
glXDestroyContext(dpy, ctx);
|
||||
XDestroyWindow(dpy, win);
|
||||
XCloseDisplay(dpy);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: glxheads.c,v 1.1 2000/06/13 19:41:30 brianp Exp $ */
|
||||
/* $Id: glxheads.c,v 1.2 2000/11/10 17:23:07 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Exercise multiple GLX connections on multiple X displays.
|
||||
@@ -139,7 +139,7 @@ AddHead(const char *displayName)
|
||||
if (!glXMakeCurrent(dpy, win, ctx)) {
|
||||
Error(displayName, "glXMakeCurrent failed");
|
||||
printf("glXMakeCurrent failed in Redraw()\n");
|
||||
return;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* save the info for this head */
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* $Id: glxinfo.c,v 1.10 2000/05/08 14:53:57 brianp Exp $ */
|
||||
/* $Id: glxinfo.c,v 1.14 2001/04/24 20:57:36 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -28,18 +28,28 @@
|
||||
* -t print wide table
|
||||
* -v print verbose information
|
||||
* -display DisplayName specify the X display to interogate
|
||||
* -b only print ID of "best" visual on screen 0
|
||||
*
|
||||
* Brian Paul 26 January 2000
|
||||
*/
|
||||
|
||||
#define DO_GLU /* may want to remove this for easier XFree86 building? */
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
#include <GL/gl.h>
|
||||
#ifdef DO_GLU
|
||||
#include <GL/glu.h>
|
||||
#endif
|
||||
#include <GL/glx.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
#ifndef GLX_NONE_EXT
|
||||
#define GLX_NONE_EXT 0x8000
|
||||
#endif
|
||||
|
||||
|
||||
typedef enum
|
||||
@@ -131,7 +141,14 @@ print_extension_list(const char *ext)
|
||||
|
||||
|
||||
static void
|
||||
print_screen_info(Display *dpy, int scrnum)
|
||||
print_display_info(Display *dpy)
|
||||
{
|
||||
printf("name of display: %s\n", DisplayString(dpy));
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
print_screen_info(Display *dpy, int scrnum, Bool allowDirect)
|
||||
{
|
||||
Window win;
|
||||
int attribSingle[] = {
|
||||
@@ -175,7 +192,7 @@ print_screen_info(Display *dpy, int scrnum)
|
||||
0, visinfo->depth, InputOutput,
|
||||
visinfo->visual, mask, &attr);
|
||||
|
||||
ctx = glXCreateContext( dpy, visinfo, NULL, True );
|
||||
ctx = glXCreateContext( dpy, visinfo, NULL, allowDirect );
|
||||
if (!ctx) {
|
||||
fprintf(stderr, "Error: glXCreateContext failed\n");
|
||||
XDestroyWindow(dpy, win);
|
||||
@@ -194,9 +211,26 @@ print_screen_info(Display *dpy, int scrnum)
|
||||
const char *glRenderer = (const char *) glGetString(GL_RENDERER);
|
||||
const char *glVersion = (const char *) glGetString(GL_VERSION);
|
||||
const char *glExtensions = (const char *) glGetString(GL_EXTENSIONS);
|
||||
char *displayName = NULL;
|
||||
char *colon = NULL, *period = NULL;
|
||||
#ifdef DO_GLU
|
||||
const char *gluVersion = (const char *) gluGetString(GLU_VERSION);
|
||||
const char *gluExtensions = (const char *) gluGetString(GLU_EXTENSIONS);
|
||||
printf("display: %s screen:%d\n", DisplayString(dpy), scrnum);
|
||||
#endif
|
||||
/* Strip the screen number from the display name, if present. */
|
||||
if (!(displayName = malloc(strlen(DisplayString(dpy)) + 1))) {
|
||||
fprintf(stderr, "Error: malloc() failed\n");
|
||||
exit(1);
|
||||
}
|
||||
strcpy(displayName, DisplayString(dpy));
|
||||
colon = strrchr(displayName, ':');
|
||||
if (colon) {
|
||||
period = strchr(colon, '.');
|
||||
if (period)
|
||||
*period = '\0';
|
||||
}
|
||||
printf("display: %s screen: %d\n", displayName, scrnum);
|
||||
free(displayName);
|
||||
printf("direct rendering: %s\n", glXIsDirect(dpy, ctx) ? "Yes" : "No");
|
||||
printf("server glx vendor string: %s\n", serverVendor);
|
||||
printf("server glx version string: %s\n", serverVersion);
|
||||
@@ -213,9 +247,11 @@ print_screen_info(Display *dpy, int scrnum)
|
||||
printf("OpenGL version string: %s\n", glVersion);
|
||||
printf("OpenGL extensions:\n");
|
||||
print_extension_list(glExtensions);
|
||||
#ifdef DO_GLU
|
||||
printf("glu version: %s\n", gluVersion);
|
||||
printf("glu extensions:\n");
|
||||
print_extension_list(gluExtensions);
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
fprintf(stderr, "Error: glXMakeCurrent failed\n");
|
||||
@@ -489,13 +525,120 @@ print_visual_info(Display *dpy, int scrnum, InfoMode mode)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Stand-alone Mesa doesn't really implement the GLX protocol so it
|
||||
* doesn't really know the GLX attributes associated with an X visual.
|
||||
* The first time a visual is presented to Mesa's pseudo-GLX it
|
||||
* attaches ancilliary buffers to it (like depth and stencil).
|
||||
* But that usually only works if glXChooseVisual is used.
|
||||
* This function calls glXChooseVisual() to sort of "prime the pump"
|
||||
* for Mesa's GLX so that the visuals that get reported actually
|
||||
* reflect what applications will see.
|
||||
* This has no effect when using true GLX.
|
||||
*/
|
||||
static void
|
||||
mesa_hack(Display *dpy, int scrnum)
|
||||
{
|
||||
static int attribs[] = {
|
||||
GLX_RGBA,
|
||||
GLX_RED_SIZE, 1,
|
||||
GLX_GREEN_SIZE, 1,
|
||||
GLX_BLUE_SIZE, 1,
|
||||
GLX_DEPTH_SIZE, 1,
|
||||
GLX_STENCIL_SIZE, 1,
|
||||
GLX_ACCUM_RED_SIZE, 1,
|
||||
GLX_ACCUM_GREEN_SIZE, 1,
|
||||
GLX_ACCUM_BLUE_SIZE, 1,
|
||||
GLX_ACCUM_ALPHA_SIZE, 1,
|
||||
GLX_DOUBLEBUFFER,
|
||||
None
|
||||
};
|
||||
XVisualInfo *visinfo;
|
||||
|
||||
visinfo = glXChooseVisual(dpy, scrnum, attribs);
|
||||
if (visinfo)
|
||||
XFree(visinfo);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Examine all visuals to find the so-called best one.
|
||||
* We prefer deepest RGBA buffer with depth, stencil and accum
|
||||
* that has no caveats.
|
||||
*/
|
||||
static int
|
||||
find_best_visual(Display *dpy, int scrnum)
|
||||
{
|
||||
XVisualInfo template;
|
||||
XVisualInfo *visuals;
|
||||
int numVisuals;
|
||||
long mask;
|
||||
int i;
|
||||
struct visual_attribs bestVis;
|
||||
|
||||
/* get list of all visuals on this screen */
|
||||
template.screen = scrnum;
|
||||
mask = VisualScreenMask;
|
||||
visuals = XGetVisualInfo(dpy, mask, &template, &numVisuals);
|
||||
|
||||
/* init bestVis with first visual info */
|
||||
get_visual_attribs(dpy, &visuals[0], &bestVis);
|
||||
|
||||
/* try to find a "better" visual */
|
||||
for (i = 1; i < numVisuals; i++) {
|
||||
struct visual_attribs vis;
|
||||
|
||||
get_visual_attribs(dpy, &visuals[i], &vis);
|
||||
|
||||
/* always skip visuals with caveats */
|
||||
if (vis.visualCaveat != GLX_NONE_EXT)
|
||||
continue;
|
||||
|
||||
/* see if this vis is better than bestVis */
|
||||
if ((!bestVis.supportsGL && vis.supportsGL) ||
|
||||
(bestVis.visualCaveat != GLX_NONE_EXT) ||
|
||||
(!bestVis.rgba && vis.rgba) ||
|
||||
(!bestVis.doubleBuffer && vis.doubleBuffer) ||
|
||||
(bestVis.redSize < vis.redSize) ||
|
||||
(bestVis.greenSize < vis.greenSize) ||
|
||||
(bestVis.blueSize < vis.blueSize) ||
|
||||
(bestVis.alphaSize < vis.alphaSize) ||
|
||||
(bestVis.depthSize < vis.depthSize) ||
|
||||
(bestVis.stencilSize < vis.stencilSize) ||
|
||||
(bestVis.accumRedSize < vis.accumRedSize)) {
|
||||
/* found a better visual */
|
||||
bestVis = vis;
|
||||
}
|
||||
}
|
||||
|
||||
XFree(visuals);
|
||||
|
||||
return bestVis.id;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
usage(void)
|
||||
{
|
||||
printf("Usage: glxinfo [-v] [-t] [-h] [-i] [-b] [-display <dname>]\n");
|
||||
printf("\t-v: Print visuals info in verbose form.\n");
|
||||
printf("\t-t: Print verbose table.\n");
|
||||
printf("\t-display <dname>: Print GLX visuals on specified server.\n");
|
||||
printf("\t-h: This information.\n");
|
||||
printf("\t-i: Force an indirect rendering context.\n");
|
||||
printf("\t-b: Find the 'best' visual and print it's number.\n");
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
char *displayName = ":0";
|
||||
char *displayName = NULL;
|
||||
Display *dpy;
|
||||
int numScreens, scrnum;
|
||||
InfoMode mode = Normal;
|
||||
GLboolean findBest = GL_FALSE;
|
||||
Bool allowDirect = True;
|
||||
int i;
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
@@ -509,6 +652,21 @@ main(int argc, char *argv[])
|
||||
else if (strcmp(argv[i], "-v") == 0) {
|
||||
mode = Verbose;
|
||||
}
|
||||
else if (strcmp(argv[i], "-b") == 0) {
|
||||
findBest = GL_TRUE;
|
||||
}
|
||||
else if (strcmp(argv[i], "-i") == 0) {
|
||||
allowDirect = False;
|
||||
}
|
||||
else if (strcmp(argv[i], "-h") == 0) {
|
||||
usage();
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
printf("Unknown option `%s'\n", argv[i]);
|
||||
usage();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
dpy = XOpenDisplay(displayName);
|
||||
@@ -517,13 +675,23 @@ main(int argc, char *argv[])
|
||||
return -1;
|
||||
}
|
||||
|
||||
numScreens = ScreenCount(dpy);
|
||||
for (scrnum = 0; scrnum < numScreens; scrnum++) {
|
||||
print_screen_info(dpy, scrnum);
|
||||
printf("\n");
|
||||
print_visual_info(dpy, scrnum, mode);
|
||||
if (scrnum + 1 < numScreens)
|
||||
printf("\n\n");
|
||||
if (findBest) {
|
||||
int b;
|
||||
mesa_hack(dpy, 0);
|
||||
b = find_best_visual(dpy, 0);
|
||||
printf("%d\n", b);
|
||||
}
|
||||
else {
|
||||
numScreens = ScreenCount(dpy);
|
||||
print_display_info(dpy);
|
||||
for (scrnum = 0; scrnum < numScreens; scrnum++) {
|
||||
mesa_hack(dpy, scrnum);
|
||||
print_screen_info(dpy, scrnum, allowDirect);
|
||||
printf("\n");
|
||||
print_visual_info(dpy, scrnum, mode);
|
||||
if (scrnum + 1 < numScreens)
|
||||
printf("\n\n");
|
||||
}
|
||||
}
|
||||
|
||||
XCloseDisplay(dpy);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: manywin.c,v 1.1 2000/06/13 19:41:30 brianp Exp $ */
|
||||
/* $Id: manywin.c,v 1.4 2001/04/27 21:19:13 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Create N GLX windows/contexts and render to them in round-robin
|
||||
@@ -50,6 +50,8 @@ struct head {
|
||||
#define MAX_HEADS 200
|
||||
static struct head Heads[MAX_HEADS];
|
||||
static int NumHeads = 0;
|
||||
static GLboolean SwapSeparate = GL_TRUE;
|
||||
|
||||
|
||||
|
||||
static void
|
||||
@@ -140,7 +142,7 @@ AddHead(const char *displayName, const char *name)
|
||||
if (!glXMakeCurrent(dpy, win, ctx)) {
|
||||
Error(displayName, "glXMakeCurrent failed");
|
||||
printf("glXMakeCurrent failed in Redraw()\n");
|
||||
return;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* save the info for this head */
|
||||
@@ -161,6 +163,18 @@ AddHead(const char *displayName, const char *name)
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
DestroyHeads(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < NumHeads; i++) {
|
||||
XDestroyWindow(Heads[i].Dpy, Heads[i].Win);
|
||||
glXDestroyContext(Heads[i].Dpy, Heads[i].Context);
|
||||
XCloseDisplay(Heads[i].Dpy);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Redraw(struct head *h)
|
||||
{
|
||||
@@ -187,10 +201,17 @@ Redraw(struct head *h)
|
||||
glEnd();
|
||||
glPopMatrix();
|
||||
|
||||
glXSwapBuffers(h->Dpy, h->Win);
|
||||
if (!SwapSeparate)
|
||||
glXSwapBuffers(h->Dpy, h->Win);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Swap(struct head *h)
|
||||
{
|
||||
glXSwapBuffers(h->Dpy, h->Win);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Resize(const struct head *h, unsigned int width, unsigned int height)
|
||||
@@ -222,6 +243,8 @@ EventLoop(void)
|
||||
switch (event.type) {
|
||||
case Expose:
|
||||
Redraw(h);
|
||||
if (SwapSeparate)
|
||||
Swap(h);
|
||||
break;
|
||||
case ConfigureNotify:
|
||||
Resize(h, event.xconfigure.width, event.xconfigure.height);
|
||||
@@ -236,7 +259,17 @@ EventLoop(void)
|
||||
printf("window mismatch\n");
|
||||
}
|
||||
}
|
||||
Redraw(h);
|
||||
}
|
||||
|
||||
/* redraw all windows */
|
||||
for (i = 0; i < NumHeads; i++) {
|
||||
Redraw(&Heads[i]);
|
||||
}
|
||||
/* swapbuffers on all windows, if not already done */
|
||||
if (SwapSeparate) {
|
||||
for (i = 0; i < NumHeads; i++) {
|
||||
Swap(&Heads[i]);
|
||||
}
|
||||
}
|
||||
usleep(1);
|
||||
}
|
||||
@@ -248,9 +281,9 @@ static void
|
||||
PrintInfo(const struct head *h)
|
||||
{
|
||||
printf("Name: %s\n", h->DisplayName);
|
||||
printf(" Display: 0x%x\n", h->Dpy);
|
||||
printf(" Window: 0x%x\n", h->Win);
|
||||
printf(" Context: 0x%x\n", h->Context);
|
||||
printf(" Display: %p\n", h->Dpy);
|
||||
printf(" Window: 0x%x\n", (int) h->Win);
|
||||
printf(" Context: 0x%x\n", (int) h->Context);
|
||||
printf(" GL_VERSION: %s\n", h->Version);
|
||||
printf(" GL_VENDOR: %s\n", h->Vendor);
|
||||
printf(" GL_RENDERER: %s\n", h->Renderer);
|
||||
@@ -260,24 +293,42 @@ PrintInfo(const struct head *h)
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
char *dpyName = NULL;
|
||||
int i;
|
||||
|
||||
if (argc == 1) {
|
||||
struct head *h;
|
||||
printf("manywin: open N simultaneous glx windows\n");
|
||||
printf("Usage:\n");
|
||||
printf(" manywin numWindows\n");
|
||||
printf(" manywin [-s] numWindows\n");
|
||||
printf("Options:\n");
|
||||
printf(" -s = swap immediately after drawing (see src code)\n");
|
||||
printf("Example:\n");
|
||||
printf(" manywin 10\n");
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
int n = atoi(argv[1]);
|
||||
int n = 3;
|
||||
for (i = 1; i < argc; i++) {
|
||||
if (strcmp(argv[i], "-s") == 0) {
|
||||
SwapSeparate = GL_FALSE;
|
||||
}
|
||||
else if (strcmp(argv[i], "-display") == 0 && i < argc) {
|
||||
dpyName = argv[i+1];
|
||||
i++;
|
||||
}
|
||||
else {
|
||||
n = atoi(argv[i]);
|
||||
}
|
||||
}
|
||||
if (n < 1)
|
||||
n = 1;
|
||||
|
||||
printf("%d windows\n", n);
|
||||
for (i = 0; i < n; i++) {
|
||||
char name[100];
|
||||
struct head *h;
|
||||
sprintf(name, "%d", i);
|
||||
h = AddHead(":0", name);
|
||||
h = AddHead(dpyName, name);
|
||||
if (h) {
|
||||
PrintInfo(h);
|
||||
}
|
||||
@@ -285,5 +336,6 @@ main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
EventLoop();
|
||||
DestroyHeads();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ PERFORMANCE OF THIS SOFTWARE.
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
/*#undef GL_EXT_polygon_offset uncomment to use new version*/
|
||||
#undef GL_EXT_polygon_offset /* use GL 1.1 version instead of extension */
|
||||
|
||||
|
||||
#ifndef EXIT_FAILURE
|
||||
|
||||
@@ -1,61 +1,62 @@
|
||||
LIBRARY GLU32
|
||||
DESCRIPTION 'GLU for Windows Mesa'
|
||||
EXETYPE WINDOWS
|
||||
CODE MOVEABLE DISCARDABLE
|
||||
DATA MOVEABLE SINGLE
|
||||
HEAPSIZE 256000
|
||||
|
||||
STACKSIZE 4096
|
||||
|
||||
EXPORTS
|
||||
gluLookAt
|
||||
gluOrtho2D
|
||||
gluPerspective
|
||||
gluPickMatrix
|
||||
gluProject
|
||||
gluUnProject
|
||||
gluErrorString
|
||||
gluScaleImage
|
||||
gluBuild1DMipmaps
|
||||
gluBuild2DMipmaps
|
||||
gluNewQuadric
|
||||
gluDeleteQuadric
|
||||
gluQuadricDrawStyle
|
||||
gluQuadricOrientation
|
||||
gluQuadricNormals
|
||||
gluQuadricTexture
|
||||
gluQuadricCallback
|
||||
gluCylinder
|
||||
gluSphere
|
||||
gluDisk
|
||||
gluPartialDisk
|
||||
gluNewNurbsRenderer
|
||||
gluDeleteNurbsRenderer
|
||||
gluLoadSamplingMatrices
|
||||
gluNurbsProperty
|
||||
gluGetNurbsProperty
|
||||
gluBeginCurve
|
||||
gluEndCurve
|
||||
gluNurbsCurve
|
||||
gluBeginSurface
|
||||
gluEndSurface
|
||||
gluNurbsSurface
|
||||
gluBeginTrim
|
||||
gluEndTrim
|
||||
gluPwlCurve
|
||||
gluNurbsCallback
|
||||
gluNewTess
|
||||
gluDeleteTess
|
||||
gluTessBeginPolygon
|
||||
gluTessBeginContour
|
||||
gluTessVertex
|
||||
gluTessEndContour
|
||||
gluTessEndPolygon
|
||||
gluTessProperty
|
||||
gluTessNormal
|
||||
gluTessCallback
|
||||
gluGetTessProperty
|
||||
gluBeginPolygon
|
||||
gluNextContour
|
||||
gluEndPolygon
|
||||
gluGetString
|
||||
LIBRARY GLU32
|
||||
DESCRIPTION 'GLU for Windows Mesa'
|
||||
EXETYPE WINDOWS
|
||||
CODE MOVEABLE DISCARDABLE
|
||||
DATA MOVEABLE SINGLE
|
||||
HEAPSIZE 256000
|
||||
|
||||
STACKSIZE 4096
|
||||
|
||||
EXPORTS
|
||||
gluLookAt
|
||||
gluOrtho2D
|
||||
gluPerspective
|
||||
gluPickMatrix
|
||||
gluProject
|
||||
gluUnProject
|
||||
gluErrorString
|
||||
gluScaleImage
|
||||
gluBuild1DMipmaps
|
||||
gluBuild2DMipmaps
|
||||
gluNewQuadric
|
||||
gluDeleteQuadric
|
||||
gluQuadricDrawStyle
|
||||
gluQuadricOrientation
|
||||
gluQuadricNormals
|
||||
gluQuadricTexture
|
||||
gluQuadricCallback
|
||||
gluCylinder
|
||||
gluSphere
|
||||
gluDisk
|
||||
gluPartialDisk
|
||||
gluNewNurbsRenderer
|
||||
gluDeleteNurbsRenderer
|
||||
gluLoadSamplingMatrices
|
||||
gluNurbsProperty
|
||||
gluGetNurbsProperty
|
||||
gluBeginCurve
|
||||
gluEndCurve
|
||||
gluNurbsCurve
|
||||
gluBeginSurface
|
||||
gluEndSurface
|
||||
gluNurbsSurface
|
||||
gluBeginTrim
|
||||
gluEndTrim
|
||||
gluPwlCurve
|
||||
gluNurbsCallback
|
||||
gluNewTess
|
||||
gluDeleteTess
|
||||
; gluTessBeginPolygon
|
||||
; gluTessBeginContour
|
||||
gluTessVertex
|
||||
; gluTessEndContour
|
||||
; gluTessEndPolygon
|
||||
; gluTessProperty
|
||||
; gluTessNormal
|
||||
gluTessCallback
|
||||
; gluGetTessProperty
|
||||
gluBeginPolygon
|
||||
gluNextContour
|
||||
gluEndPolygon
|
||||
gluGetString
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Makefile for GLU for VMS
|
||||
# contributed by Jouk Jansen joukj@crys.chem.uva.nl
|
||||
# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl
|
||||
|
||||
.first
|
||||
define gl [-.include.gl]
|
||||
@@ -12,21 +12,18 @@ VPATH = RCS
|
||||
|
||||
INCDIR = $disk2:[-.include]
|
||||
LIBDIR = [-.lib]
|
||||
CFLAGS = /include=$(INCDIR)/define=(FBIND=1)
|
||||
CFLAGS = /include=$(INCDIR)/define=(FBIND=1)/name=(as_is,short)
|
||||
|
||||
SOURCES = glu.c mipmap.c nurbs.c nurbscrv.c nurbssrf.c nurbsutl.c \
|
||||
project.c quadric.c tess.c tess_fist.c tess_hash.c tess_heap.c \
|
||||
tess_winding.c tess_clip.c
|
||||
polytest.c project.c quadric.c tess.c tesselat.c
|
||||
|
||||
OBJECTS =glu.obj,mipmap.obj,nurbs.obj,nurbscrv.obj,nurbssrf.obj,nurbsutl.obj,\
|
||||
project.obj,quadric.obj,tess.obj,tess_fist.obj,tess_hash.obj,\
|
||||
tess_heap.obj,tess_winding.obj,tess_clip.obj
|
||||
|
||||
polytest.obj,project.obj,quadric.obj,tess.obj,tesselat.obj
|
||||
|
||||
|
||||
##### RULES #####
|
||||
|
||||
VERSION=MesaGlu V3.1
|
||||
VERSION=MesaGlu V3.2
|
||||
|
||||
##### TARGETS #####
|
||||
|
||||
@@ -39,7 +36,7 @@ $(LIBDIR)$(GLU_LIB) : $(OBJECTS)
|
||||
@ WRITE_ FILE "! mesagl1.opt generated by DESCRIP.$(MMS_EXT)"
|
||||
@ WRITE_ FILE "!"
|
||||
@ WRITE_ FILE "IDENTIFICATION=""$(VERSION)"""
|
||||
@ WRITE_ FILE "GSMATCH=LEQUAL,3,1
|
||||
@ WRITE_ FILE "GSMATCH=LEQUAL,3,2
|
||||
@ WRITE_ FILE "$(OBJECTS)"
|
||||
@ WRITE_ FILE "[-.lib]libmesagl.exe/SHARE"
|
||||
@ WRITE_ FILE "SYS$SHARE:DECW$XEXTLIBSHR/SHARE"
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/* $Id: glu.c,v 1.21 2000/07/18 01:13:28 brianp Exp $ */
|
||||
/* $Id: glu.c,v 1.24 2001/03/20 17:56:10 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.3
|
||||
* Copyright (C) 1995-2000 Brian Paul
|
||||
* Version: 3.5
|
||||
* Copyright (C) 1995-2001 Brian Paul
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
@@ -43,7 +43,9 @@
|
||||
#endif
|
||||
#define EPS 0.00001
|
||||
|
||||
|
||||
#ifndef GLU_INCOMPATIBLE_GL_VERSION
|
||||
#define GLU_INCOMPATIBLE_GL_VERSION 100903
|
||||
#endif
|
||||
|
||||
|
||||
void GLAPIENTRY
|
||||
@@ -137,6 +139,32 @@ gluOrtho2D(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top)
|
||||
|
||||
|
||||
|
||||
static void
|
||||
frustum(GLdouble left, GLdouble right,
|
||||
GLdouble bottom, GLdouble top,
|
||||
GLdouble nearval, GLdouble farval)
|
||||
{
|
||||
GLdouble x, y, a, b, c, d;
|
||||
GLdouble m[16];
|
||||
|
||||
x = (2.0 * nearval) / (right - left);
|
||||
y = (2.0 * nearval) / (top - bottom);
|
||||
a = (right + left) / (right - left);
|
||||
b = (top + bottom) / (top - bottom);
|
||||
c = -(farval + nearval) / ( farval - nearval);
|
||||
d = -(2.0 * farval * nearval) / (farval - nearval);
|
||||
|
||||
#define M(row,col) m[col*4+row]
|
||||
M(0,0) = x; M(0,1) = 0.0F; M(0,2) = a; M(0,3) = 0.0F;
|
||||
M(1,0) = 0.0F; M(1,1) = y; M(1,2) = b; M(1,3) = 0.0F;
|
||||
M(2,0) = 0.0F; M(2,1) = 0.0F; M(2,2) = c; M(2,3) = d;
|
||||
M(3,0) = 0.0F; M(3,1) = 0.0F; M(3,2) = -1.0F; M(3,3) = 0.0F;
|
||||
#undef M
|
||||
|
||||
glMultMatrixd(m);
|
||||
}
|
||||
|
||||
|
||||
void GLAPIENTRY
|
||||
gluPerspective(GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar)
|
||||
{
|
||||
@@ -144,18 +172,18 @@ gluPerspective(GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar)
|
||||
|
||||
ymax = zNear * tan(fovy * M_PI / 360.0);
|
||||
ymin = -ymax;
|
||||
|
||||
xmin = ymin * aspect;
|
||||
xmax = ymax * aspect;
|
||||
|
||||
glFrustum(xmin, xmax, ymin, ymax, zNear, zFar);
|
||||
/* don't call glFrustum() because of error semantics (covglu) */
|
||||
frustum(xmin, xmax, ymin, ymax, zNear, zFar);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void GLAPIENTRY
|
||||
gluPickMatrix(GLdouble x, GLdouble y,
|
||||
GLdouble width, GLdouble height, const GLint viewport[4])
|
||||
GLdouble width, GLdouble height, GLint viewport[4])
|
||||
{
|
||||
GLfloat m[16];
|
||||
GLfloat sx, sy;
|
||||
@@ -302,7 +330,7 @@ const GLubyte *GLAPIENTRY
|
||||
gluGetString(GLenum name)
|
||||
{
|
||||
static char *extensions = "GL_EXT_abgr";
|
||||
static char *version = "1.1 Mesa 3.3";
|
||||
static char *version = "1.1 Mesa 3.5";
|
||||
|
||||
switch (name) {
|
||||
case GLU_EXTENSIONS:
|
||||
@@ -366,16 +394,16 @@ void (GLAPIENTRY * gluGetProcAddressEXT(const GLubyte * procName)) ()
|
||||
*/
|
||||
#ifdef GLU_VERSION_1_3
|
||||
GLboolean GLAPIENTRY
|
||||
gluCheckExtension(const char *extName, const GLubyte * extString)
|
||||
gluCheckExtension(const GLubyte *extName, const GLubyte * extString)
|
||||
{
|
||||
assert(extName);
|
||||
assert(extString);
|
||||
{
|
||||
const int len = strlen(extName);
|
||||
const int len = strlen((const char *) extName);
|
||||
const char *start = (const char *) extString;
|
||||
|
||||
while (1) {
|
||||
const char *c = strstr(start, extName);
|
||||
const char *c = strstr(start, (const char *) extName);
|
||||
if (!c)
|
||||
return GL_FALSE;
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/* $Id: mipmap.c,v 1.7 2000/07/11 14:11:04 brianp Exp $ */
|
||||
/* $Id: mipmap.c,v 1.8 2000/10/26 21:48:18 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.3
|
||||
* Version: 3.4
|
||||
* Copyright (C) 1995-2000 Brian Paul
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
@@ -576,6 +576,7 @@ bytes_per_pixel(GLenum format, GLenum type)
|
||||
n = 2;
|
||||
break;
|
||||
case GL_RGB:
|
||||
case GL_BGR:
|
||||
n = 3;
|
||||
break;
|
||||
case GL_RGBA:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: nurbscrv.c,v 1.2 2000/07/11 14:11:04 brianp Exp $ */
|
||||
/* $Id: nurbscrv.c,v 1.3 2000/11/10 17:23:04 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
@@ -359,7 +359,7 @@ do_nurbs_curve(GLUnurbsObj * nobj)
|
||||
GLint n_ctrl;
|
||||
GLfloat *new_geom_ctrl, *new_color_ctrl, *new_normal_ctrl,
|
||||
*new_texture_ctrl;
|
||||
GLfloat *geom_ctrl, *color_ctrl, *normal_ctrl, *texture_ctrl;
|
||||
GLfloat *geom_ctrl = 0, *color_ctrl = 0, *normal_ctrl = 0, *texture_ctrl = 0;
|
||||
GLint *factors;
|
||||
GLint i, j;
|
||||
GLint geom_dim, color_dim = 0, normal_dim = 0, texture_dim = 0;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: nurbsutl.c,v 1.3 2000/07/11 20:39:00 brianp Exp $ */
|
||||
/* $Id: nurbsutl.c,v 1.4 2000/11/10 17:23:04 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
@@ -130,7 +130,7 @@ set_new_t_min_t_max(knot_str_type * geom_knot, knot_str_type * color_knot,
|
||||
knot_str_type * normal_knot, knot_str_type * texture_knot,
|
||||
GLfloat maximal_min_knot, GLfloat minimal_max_knot)
|
||||
{
|
||||
GLuint t_min, t_max, cnt;
|
||||
GLuint t_min = 0, t_max = 0, cnt = 0;
|
||||
|
||||
if (minimal_max_knot - maximal_min_knot < EPSILON) {
|
||||
/* knot common range empty */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: polytest.c,v 1.3 2000/07/11 14:11:04 brianp Exp $ */
|
||||
/* $Id: polytest.c,v 1.4 2000/11/10 17:23:04 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
@@ -786,7 +786,7 @@ cut_out_hole(GLUtriangulatorObj * tobj,
|
||||
tess_vertex *v1, *v2, *tmp_vertex;
|
||||
GLuint vertex1_cnt, vertex2_cnt, tmp_vertex_cnt;
|
||||
GLuint i, j, k;
|
||||
GLenum test;
|
||||
GLenum test = 0;
|
||||
|
||||
/* find an edge connecting contour and hole not intersecting any other */
|
||||
/* edge belonging to either the contour or any of the other holes */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: quadric.c,v 1.8 2000/07/11 14:11:04 brianp Exp $ */
|
||||
/* $Id: quadric.c,v 1.9 2001/01/15 20:04:28 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
@@ -401,7 +401,6 @@ gluSphere(GLUquadricObj * qobj, GLdouble radius, GLint slices, GLint stacks)
|
||||
/* draw +Z end as a triangle fan */
|
||||
glBegin(GL_TRIANGLE_FAN);
|
||||
glNormal3f(0.0, 0.0, 1.0);
|
||||
TXTR_COORD(0.5, 1.0);
|
||||
glVertex3f(0.0, 0.0, nsign * radius);
|
||||
for (j = 0; j <= slices; j++) {
|
||||
theta = (j == slices) ? 0.0 : j * dtheta;
|
||||
@@ -458,7 +457,6 @@ gluSphere(GLUquadricObj * qobj, GLdouble radius, GLint slices, GLint stacks)
|
||||
/* draw -Z end as a triangle fan */
|
||||
glBegin(GL_TRIANGLE_FAN);
|
||||
glNormal3f(0.0, 0.0, -1.0);
|
||||
TXTR_COORD(0.5, 0.0);
|
||||
glVertex3f(0.0, 0.0, -radius * nsign);
|
||||
rho = M_PI - drho;
|
||||
s = 1.0;
|
||||
@@ -470,7 +468,6 @@ gluSphere(GLUquadricObj * qobj, GLdouble radius, GLint slices, GLint stacks)
|
||||
z = nsign * cos(rho);
|
||||
if (normals)
|
||||
glNormal3f(x * nsign, y * nsign, z * nsign);
|
||||
TXTR_COORD(s, t);
|
||||
s -= ds;
|
||||
glVertex3f(x * radius, y * radius, z * radius);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: tess.c,v 1.25 2000/07/11 14:11:04 brianp Exp $ */
|
||||
/* $Id: tess.c,v 1.26 2001/03/20 17:56:10 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
@@ -80,7 +80,7 @@ gluNewTess(void)
|
||||
GLUtriangulatorObj *tobj;
|
||||
|
||||
if ((tobj = (GLUtriangulatorObj *)
|
||||
malloc(sizeof(struct GLUtriangulatorObj))) == NULL)
|
||||
malloc(sizeof(struct GLUtesselator))) == NULL)
|
||||
return NULL;
|
||||
tobj->contours = tobj->last_contour = NULL;
|
||||
init_callbacks(&tobj->callbacks);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user