Compare commits
1004 Commits
mesa_6_3_1
...
mesa_20060
Author | SHA1 | Date | |
---|---|---|---|
|
ea4fe661d7 | ||
|
4cbd16ed3f | ||
|
06049e2416 | ||
|
753af3a206 | ||
|
70207b70c5 | ||
|
1bbc203c6e | ||
|
6494541eaa | ||
|
590cd26006 | ||
|
ed4ab13cef | ||
|
af8d39861d | ||
|
c4f2710f9d | ||
|
436d72e994 | ||
|
d76ef5867d | ||
|
0a6040dc2d | ||
|
eab896cc21 | ||
|
f756924fa5 | ||
|
4fafe6390b | ||
|
6fc864b9e6 | ||
|
daffbe99dc | ||
|
8995544bc9 | ||
|
071357096e | ||
|
519b23b21f | ||
|
4991888fa0 | ||
|
34bd1233a9 | ||
|
457fb0e128 | ||
|
7275d4d097 | ||
|
f1038f81e4 | ||
|
c27c382acc | ||
|
5319ed0e53 | ||
|
070f280895 | ||
|
096dd541bd | ||
|
77174f0072 | ||
|
21a4fb4137 | ||
|
19b05d5009 | ||
|
2d2af2dcf7 | ||
|
eec33cc310 | ||
|
0f1d98c422 | ||
|
724df02073 | ||
|
2b17741e1b | ||
|
c6c0f94714 | ||
|
ef8653a838 | ||
|
514a15cea1 | ||
|
ac8b07b3ae | ||
|
e660690985 | ||
|
30655c211c | ||
|
59e0faaa5c | ||
|
eccb6a0698 | ||
|
10f08cc202 | ||
|
b7e3e0d64e | ||
|
19b8322169 | ||
|
2a0d441ebb | ||
|
15e74a6441 | ||
|
0f618b7eb7 | ||
|
8af48fc4d6 | ||
|
e9484e4085 | ||
|
a0cf4ceb36 | ||
|
5042778449 | ||
|
9c32af5bb2 | ||
|
841a823d6d | ||
|
0d57301ba2 | ||
|
12d51beb7e | ||
|
e294d938f2 | ||
|
f1b431b265 | ||
|
9fc897af7a | ||
|
d97ab9a7bd | ||
|
d9894e0d72 | ||
|
dba9c0bafd | ||
|
ba7ea2e697 | ||
|
50f319242b | ||
|
ca007cb449 | ||
|
d75963d258 | ||
|
8ee311d36d | ||
|
2e01918b55 | ||
|
168a7516b1 | ||
|
c107058e7e | ||
|
3bca4f679a | ||
|
9d881ea718 | ||
|
448d23331d | ||
|
66df1731e6 | ||
|
5820f7998a | ||
|
780d270312 | ||
|
e1e03b32ab | ||
|
f8ba07a77d | ||
|
5e01f9a114 | ||
|
f4ab5654d0 | ||
|
da16813f43 | ||
|
9227bca103 | ||
|
81b8aa9ecd | ||
|
14d3ab9662 | ||
|
904ab0c22c | ||
|
afa1df5871 | ||
|
c241d3b06a | ||
|
93da673904 | ||
|
cf6be2d5bd | ||
|
dbfd246db8 | ||
|
190e5595bc | ||
|
68edf28df6 | ||
|
9b8059e536 | ||
|
6d4284e2bf | ||
|
9974540c73 | ||
|
2c61fdafd6 | ||
|
1eca891dbe | ||
|
a231097609 | ||
|
fbe48ef01f | ||
|
71932ef85c | ||
|
6754e17138 | ||
|
f71fd439f5 | ||
|
147f5091a1 | ||
|
176dac684a | ||
|
34b60b001d | ||
|
3073cf21d2 | ||
|
d1d4121682 | ||
|
9ac9605de1 | ||
|
c56f2c49a5 | ||
|
be42f53020 | ||
|
a764b7eae0 | ||
|
4e77669926 | ||
|
2aabdc743f | ||
|
ee2339f673 | ||
|
228d4a6de7 | ||
|
1aad408b5a | ||
|
44a2e96729 | ||
|
5b2ee9c1e9 | ||
|
956fff6345 | ||
|
7b6fd8a0c6 | ||
|
cebad151a1 | ||
|
4f8b59d59b | ||
|
49ad2d4ed1 | ||
|
cc1591667d | ||
|
8986e36f36 | ||
|
fcbbdf9991 | ||
|
97a3023c9f | ||
|
3654193a4d | ||
|
e94be8d5c0 | ||
|
8da9f448f4 | ||
|
555b5fac4f | ||
|
a176bc6c17 | ||
|
ee40c4fb34 | ||
|
a584e846d4 | ||
|
dd02edf381 | ||
|
88d994c3b2 | ||
|
50092f8f33 | ||
|
870ebefb3b | ||
|
a663931204 | ||
|
5bc35a823a | ||
|
dc3a922cf3 | ||
|
0c8e578a38 | ||
|
3699751b0b | ||
|
d5aca8bf0c | ||
|
0c1438d331 | ||
|
a5033a0421 | ||
|
2189d9c96e | ||
|
e7ffe4619f | ||
|
8a54fad6cd | ||
|
ebcbf2f853 | ||
|
41eeae5fb1 | ||
|
02eb9acc5e | ||
|
44e9ccc708 | ||
|
adef42c88d | ||
|
7d376c76c9 | ||
|
a2ea606377 | ||
|
2363fff347 | ||
|
c92e688e15 | ||
|
170f08d4b1 | ||
|
91c30771b6 | ||
|
f236300e3a | ||
|
a73094cc6a | ||
|
42447365b2 | ||
|
b77a225250 | ||
|
d93615fc1e | ||
|
42725d6f54 | ||
|
4cd0e24f86 | ||
|
640ef7f890 | ||
|
63b852f4f9 | ||
|
ea970da0b6 | ||
|
e7276b7fa5 | ||
|
16a14510c4 | ||
|
725740c7c8 | ||
|
5951aab823 | ||
|
865ad82bb8 | ||
|
3b6f62fc73 | ||
|
111281f1fc | ||
|
663138a951 | ||
|
a45f23bed1 | ||
|
4b4cc650e1 | ||
|
781c54a5b8 | ||
|
6a36407a00 | ||
|
7905b19ec9 | ||
|
bd8c742762 | ||
|
9dc8bce88e | ||
|
b2006a40eb | ||
|
daf3093f28 | ||
|
5e9d73153c | ||
|
0b3c2a9a24 | ||
|
5594ddbcfe | ||
|
58e4aa0ec9 | ||
|
0fcfa1c5b0 | ||
|
e797bc8bbe | ||
|
7d82d284e3 | ||
|
a7bd2563c3 | ||
|
875df252a7 | ||
|
e804370014 | ||
|
32551222bc | ||
|
77667266a7 | ||
|
32a6468014 | ||
|
e65ad47a8f | ||
|
edc98df891 | ||
|
fbcb37cac5 | ||
|
3a5bb1729d | ||
|
2219a15b06 | ||
|
74235b1cf1 | ||
|
f3cf636e57 | ||
|
166b0ff973 | ||
|
7f1274fa8b | ||
|
99da2d30eb | ||
|
8b1dc68662 | ||
|
4dd8a8907e | ||
|
65573edd1b | ||
|
f3134ca7ad | ||
|
f7360cd42d | ||
|
39c492bb14 | ||
|
acd1f16b35 | ||
|
c6f35dd8db | ||
|
f087d60f18 | ||
|
41a874f486 | ||
|
ef073b7a75 | ||
|
c90b569238 | ||
|
93a7605b1d | ||
|
b42d5bcaff | ||
|
37e86254c1 | ||
|
216f729a95 | ||
|
38da697546 | ||
|
f93a228c38 | ||
|
1096eae18d | ||
|
361bccb4ec | ||
|
b4f70646b4 | ||
|
8defce2cf1 | ||
|
0f488bb16d | ||
|
1bcc323857 | ||
|
93d0935ef7 | ||
|
4078c647d5 | ||
|
458479fedb | ||
|
1814d6541b | ||
|
2d4ff6a8cf | ||
|
c217d5a3a8 | ||
|
0946e0f418 | ||
|
7a028bd1ca | ||
|
d469e5e5a0 | ||
|
c2901e4f4c | ||
|
41b9756e9a | ||
|
8bc4dae67e | ||
|
eda59aa87e | ||
|
ca188de098 | ||
|
30cc822163 | ||
|
413a49ce59 | ||
|
31be39742b | ||
|
3086efe357 | ||
|
cabecbd314 | ||
|
1d43e729ec | ||
|
8c137e2f94 | ||
|
fb83a42d31 | ||
|
456a513daa | ||
|
577d23011b | ||
|
369ae3e2c4 | ||
|
77a7c2ad92 | ||
|
4dac78463e | ||
|
edf570da67 | ||
|
49b9355020 | ||
|
1b6a081885 | ||
|
bc8390fa6c | ||
|
ad960612ce | ||
|
11decab34a | ||
|
3ad366dff2 | ||
|
d57ce4a2c1 | ||
|
707343dcf5 | ||
|
feb7221ecb | ||
|
1d32fc7332 | ||
|
fd1627312d | ||
|
e34700af7a | ||
|
c9b4acfeb8 | ||
|
782291ab91 | ||
|
924fb5e916 | ||
|
841c9018b1 | ||
|
b6d7a0c5a5 | ||
|
0970787228 | ||
|
c8d1741b78 | ||
|
1add059bd1 | ||
|
c9797f6b76 | ||
|
0063084804 | ||
|
40332059e4 | ||
|
3e1a5a38ae | ||
|
790ab0a0b6 | ||
|
f06ce1ba71 | ||
|
98d9bb66a4 | ||
|
215aa20f5c | ||
|
4882279633 | ||
|
b04dd5c587 | ||
|
ad6f8eba00 | ||
|
6002d2ff4e | ||
|
21b2784ff5 | ||
|
5abc246f8d | ||
|
72d1bb5756 | ||
|
91ed68b2b9 | ||
|
5262c225ba | ||
|
1acea5f289 | ||
|
5bdec89da5 | ||
|
59af97420e | ||
|
0694adaf71 | ||
|
4c3443b460 | ||
|
f2b9fa03da | ||
|
0fa8c59e64 | ||
|
98bebc7212 | ||
|
abccd5b729 | ||
|
9309ba78d1 | ||
|
9580179dfb | ||
|
d5179613d5 | ||
|
b4ebb68202 | ||
|
f27c07c99e | ||
|
923257fe07 | ||
|
f93feb7aed | ||
|
eb06704a7c | ||
|
99f13343cf | ||
|
1b3128cc9a | ||
|
8716e7570d | ||
|
5abff7bc4d | ||
|
c9515bf1ae | ||
|
bfba2705b6 | ||
|
dd4f0d1a93 | ||
|
f285f0d8f6 | ||
|
6b25193b92 | ||
|
0e31e02aef | ||
|
cf2702e3db | ||
|
31e739a189 | ||
|
94ae2b4f25 | ||
|
5910dfacf1 | ||
|
96f216565e | ||
|
2d8eb9eaf3 | ||
|
126482a12f | ||
|
9790e641ef | ||
|
58f45fa44d | ||
|
5285c32a17 | ||
|
f576450cae | ||
|
4683e8e954 | ||
|
2b8e66d210 | ||
|
aae2b8b8eb | ||
|
4f12aa5a6a | ||
|
a913d9f2f7 | ||
|
3070a581fc | ||
|
d548bf41d3 | ||
|
49b2d2e90f | ||
|
024b5896f0 | ||
|
96bf6abb66 | ||
|
2a76d952b8 | ||
|
1ac1c1c423 | ||
|
daf585d0f0 | ||
|
d2c64e0b83 | ||
|
b1abf1ea8e | ||
|
ff707ead2b | ||
|
181f2b92cb | ||
|
023c95481b | ||
|
957b517c4f | ||
|
39591da355 | ||
|
a3d2c69e61 | ||
|
b8829facc7 | ||
|
b711eb793b | ||
|
f049ca4e33 | ||
|
9bcc9e9174 | ||
|
286f3fbb3a | ||
|
e6e1c3fc11 | ||
|
ec1ffd9f25 | ||
|
5a771857d9 | ||
|
bf44f6cfac | ||
|
1ea61b5cad | ||
|
ec770b8c60 | ||
|
1a61462318 | ||
|
e31ac05223 | ||
|
22db535776 | ||
|
55194df035 | ||
|
1353ebed81 | ||
|
5d7b49f7e7 | ||
|
1ad3b7e28b | ||
|
6f445a1061 | ||
|
41c8eabe0f | ||
|
63d683091f | ||
|
430c469c5b | ||
|
47e511c36d | ||
|
9fd133511c | ||
|
8c41a14c5e | ||
|
5754809421 | ||
|
8c765ad312 | ||
|
ddf61bfec9 | ||
|
f31448f3c8 | ||
|
40ca5b455f | ||
|
311bcf5090 | ||
|
948ab5d8a9 | ||
|
74e9a43a2a | ||
|
5ba41dfa81 | ||
|
11f179e01b | ||
|
f81c78f87d | ||
|
547113c16c | ||
|
154cc16d08 | ||
|
0ba7be0a50 | ||
|
32fe233d54 | ||
|
0f29ef6092 | ||
|
94f70fab64 | ||
|
1a5f1bdb42 | ||
|
909e8a7abb | ||
|
847160466c | ||
|
06185363dd | ||
|
c731d6223c | ||
|
0ad64faec7 | ||
|
738f501f73 | ||
|
62620d349b | ||
|
daeb0056df | ||
|
7edf68e081 | ||
|
1e134cf7e4 | ||
|
5ef524cd01 | ||
|
a163256cc2 | ||
|
e5700a1ba3 | ||
|
cb6b47b795 | ||
|
7b98b40e47 | ||
|
b3c095f074 | ||
|
662fbf8a62 | ||
|
ba3da6154c | ||
|
e3636b4114 | ||
|
bed8363aa6 | ||
|
de99760bf3 | ||
|
77ee31930a | ||
|
0325bc6359 | ||
|
418a7dbd75 | ||
|
6297799fee | ||
|
db40ebfbb7 | ||
|
1984aabe83 | ||
|
a8446f72f4 | ||
|
a8717180d9 | ||
|
cfca72cfb1 | ||
|
8850a7e20f | ||
|
5374e4ba7e | ||
|
4884db6eb2 | ||
|
e1a5edf083 | ||
|
bdd80bf819 | ||
|
0bffb1192a | ||
|
3e9c099088 | ||
|
02df9e1ed4 | ||
|
832026f906 | ||
|
beff21e7bf | ||
|
189bbe0b8c | ||
|
c657d8e3e4 | ||
|
30d6a4bffa | ||
|
237dae74f7 | ||
|
bf41bc03c2 | ||
|
b7c87974b3 | ||
|
c289f48342 | ||
|
b88fb724e6 | ||
|
1fcdaf1c3b | ||
|
637c375ee2 | ||
|
9ba4ef3102 | ||
|
7e807510d8 | ||
|
73347516be | ||
|
41c8b71871 | ||
|
47adbde5e5 | ||
|
8894a55d5f | ||
|
fd4395b8d1 | ||
|
613e1ad5d5 | ||
|
4d0b7618cb | ||
|
95ebb5f485 | ||
|
2cb1cf484a | ||
|
8ff68b2bf3 | ||
|
c12ee99d11 | ||
|
f805cdfedf | ||
|
84f3ff91d9 | ||
|
d78834b306 | ||
|
72030e0d91 | ||
|
ccfe3d4683 | ||
|
7ae9713a60 | ||
|
1624162b0c | ||
|
45cd2f9305 | ||
|
bcf4ae7816 | ||
|
60031ace75 | ||
|
90ebb581e6 | ||
|
5a02209cd2 | ||
|
eda460035e | ||
|
26b1c97a9d | ||
|
e4894177ba | ||
|
3a5626cb84 | ||
|
a9b927cb6e | ||
|
a546abc8da | ||
|
f4fbda35b0 | ||
|
c3626a91ce | ||
|
6aa6d440d9 | ||
|
e7d6bb9dc4 | ||
|
3cf156df2b | ||
|
da70bc6baa | ||
|
a605d9c3de | ||
|
d9f362a667 | ||
|
0505103710 | ||
|
ffec105109 | ||
|
dcf4c17fb1 | ||
|
821b3dd562 | ||
|
37f2eaa316 | ||
|
18e7c5c5fe | ||
|
7aebaf3deb | ||
|
094a1ddf24 | ||
|
5d04101d18 | ||
|
32df89e12d | ||
|
5b3cf5af74 | ||
|
1a979736a6 | ||
|
5244fc6d60 | ||
|
3c2f8b22b9 | ||
|
a2e696e521 | ||
|
af13891dbd | ||
|
4174f79b19 | ||
|
db02ab767f | ||
|
4570364097 | ||
|
aba878d8c2 | ||
|
d7d41ceeb0 | ||
|
3eec2901db | ||
|
86734ddae4 | ||
|
b3c98e6205 | ||
|
b5ee368baf | ||
|
f51bf9e23c | ||
|
8cb2923038 | ||
|
ca33e21165 | ||
|
5222c58a68 | ||
|
dc44372ba7 | ||
|
eb171b0c10 | ||
|
3b3adf3daa | ||
|
a4af1119f5 | ||
|
9c8f649930 | ||
|
c57be49099 | ||
|
4b9f1308e5 | ||
|
215c4c3a9c | ||
|
512c994b92 | ||
|
170a61ec00 | ||
|
2d0c92d81b | ||
|
03833ba2ca | ||
|
d240b29b95 | ||
|
22605caea8 | ||
|
4dc3249f0d | ||
|
23f076ca67 | ||
|
5f79025e0d | ||
|
f8a5898ca0 | ||
|
9eaed1178d | ||
|
896735e412 | ||
|
2330ed08c3 | ||
|
a09d002bb5 | ||
|
f1113fa99d | ||
|
7e4cc1c29f | ||
|
005070a62a | ||
|
7040b7ad88 | ||
|
f33beed330 | ||
|
81d3bf58ff | ||
|
310f1551b4 | ||
|
32340aea13 | ||
|
c92adf4682 | ||
|
414b742c97 | ||
|
60b639b9a6 | ||
|
971bdc193c | ||
|
9e87119d87 | ||
|
9192ab3f5d | ||
|
6efd595bf5 | ||
|
dc793d4e9a | ||
|
3265585b15 | ||
|
1c04be573e | ||
|
52f686c480 | ||
|
7d3b26022b | ||
|
e516654dec | ||
|
f28cbb6a7f | ||
|
32a7ab2197 | ||
|
54cfe69436 | ||
|
b3f2e15035 | ||
|
3a09ea919c | ||
|
2ea6b800c0 | ||
|
8975cbb36b | ||
|
eedc45709f | ||
|
f468dfde17 | ||
|
adfd5510c0 | ||
|
a90909e892 | ||
|
f344be793c | ||
|
255afe4abd | ||
|
c8f86105d0 | ||
|
6f980dbf21 | ||
|
b50a51118c | ||
|
806e25a5d9 | ||
|
301c3dcb6c | ||
|
2420318cd9 | ||
|
e0cb784e03 | ||
|
d76c7d7d3e | ||
|
dc4070c787 | ||
|
ca2db58166 | ||
|
deadd47aab | ||
|
bf3f0bcf80 | ||
|
b83435f53b | ||
|
d99c37bca6 | ||
|
1c236fd5c7 | ||
|
005469005d | ||
|
05e1a49ab4 | ||
|
730200303d | ||
|
2d61d30117 | ||
|
dd5a86339f | ||
|
247f3b3e81 | ||
|
ccf1378131 | ||
|
30daa75293 | ||
|
ed2f8635f0 | ||
|
6ff023fe3a | ||
|
96e1ccedec | ||
|
c81de36223 | ||
|
f525d3e139 | ||
|
d084c3d4dc | ||
|
44b1bd7597 | ||
|
e7325294d0 | ||
|
ac04a4fa7f | ||
|
8d29d463a3 | ||
|
1c0f11046a | ||
|
30f2d6f0cb | ||
|
b4269c07f8 | ||
|
cf085db28a | ||
|
474f28e57c | ||
|
81a22ef539 | ||
|
f2802c40ff | ||
|
dfe7aedf84 | ||
|
9dd973ec3b | ||
|
24a44d74b6 | ||
|
44dace86ea | ||
|
26f69d87a4 | ||
|
ea20c324ae | ||
|
11f763f505 | ||
|
a3c8de2fa7 | ||
|
06f606ce57 | ||
|
198a88923c | ||
|
8184ec9fb6 | ||
|
a9fc8ba756 | ||
|
91802fdf73 | ||
|
7edf1e80bd | ||
|
9e920fb93c | ||
|
bc6cced479 | ||
|
14c38b8f4f | ||
|
eb063cfa38 | ||
|
199ef86b5e | ||
|
a6296dd2c3 | ||
|
071b30aba1 | ||
|
b0e7d850d1 | ||
|
8ef0519bbe | ||
|
9a3a1497e5 | ||
|
1fc4b21eb2 | ||
|
2794507289 | ||
|
184a970722 | ||
|
b0a0ca8bd9 | ||
|
0899afae33 | ||
|
cef88397a6 | ||
|
7f78c93015 | ||
|
9758ef9e7b | ||
|
252194d74e | ||
|
31340f6645 | ||
|
3d61c2e778 | ||
|
d0529b67f4 | ||
|
76560af99d | ||
|
82b29819a9 | ||
|
f493a04be0 | ||
|
1ad6e08090 | ||
|
b2404b132d | ||
|
3fd819aef8 | ||
|
8d0edf015d | ||
|
5208867f12 | ||
|
d95000da2f | ||
|
f7a8d8ffbb | ||
|
1ad7b99925 | ||
|
b955474093 | ||
|
1b5d3d647e | ||
|
ac3ec5096a | ||
|
dbd0fa920e | ||
|
78b3b667b5 | ||
|
99796464c5 | ||
|
70c3bebcde | ||
|
afb9fb0965 | ||
|
84c9e671ed | ||
|
ad271b8c98 | ||
|
4aeaff2ae7 | ||
|
310a10b0f2 | ||
|
d997b90433 | ||
|
79b4dbc496 | ||
|
048b13df65 | ||
|
d5861c06f2 | ||
|
36d9ee1828 | ||
|
6d3637849b | ||
|
0efc17c105 | ||
|
e5fce1694c | ||
|
7b01068a23 | ||
|
676d0accf5 | ||
|
f1e2826856 | ||
|
4fd11949f0 | ||
|
63016507d7 | ||
|
7d39e82976 | ||
|
8bdc1ae358 | ||
|
978ef2bb6d | ||
|
3e37bafab0 | ||
|
4092fbd55a | ||
|
5bfb9356d6 | ||
|
5434695017 | ||
|
9e4e3adcf8 | ||
|
8fadf8f900 | ||
|
14570e6d7c | ||
|
f39569f550 | ||
|
000abaa12d | ||
|
7265556b9a | ||
|
22607975b4 | ||
|
3211b28ee6 | ||
|
cd81190d5c | ||
|
17d6fff30c | ||
|
c650bb0b7d | ||
|
02237f447f | ||
|
b3aefd1cfb | ||
|
a01cb26a90 | ||
|
26bb7bc025 | ||
|
6707433272 | ||
|
82e314252f | ||
|
f2ea634c0c | ||
|
6ae8747539 | ||
|
62a2f8cdd6 | ||
|
db64b60225 | ||
|
aa2069586d | ||
|
3cc67cb8cd | ||
|
aa8abf8081 | ||
|
792a1bcbe4 | ||
|
8885b077ed | ||
|
e00ac11d4d | ||
|
0f540f4b04 | ||
|
e64874ac2d | ||
|
63b5b8eaff | ||
|
9a22b555cf | ||
|
da9f65268d | ||
|
7fb9352fe4 | ||
|
55187ea63e | ||
|
2cd8791cad | ||
|
6ce60beb28 | ||
|
5f16244879 | ||
|
a25fe61607 | ||
|
b43671c8bf | ||
|
04adb70f32 | ||
|
a702bbfff3 | ||
|
5250aa7c6a | ||
|
7a534dcab1 | ||
|
41cf68b4cb | ||
|
a400a1e404 | ||
|
f157e2dee4 | ||
|
ff9d235042 | ||
|
48799287b3 | ||
|
a60ff20c58 | ||
|
67a8decffe | ||
|
e42a31350d | ||
|
9ae952a88c | ||
|
f084f60f8b | ||
|
7909dd920d | ||
|
56ff8ed6d8 | ||
|
363344f5b8 | ||
|
7bb7f97594 | ||
|
914ec8ef58 | ||
|
878c371e6c | ||
|
42c34efd23 | ||
|
bdf8441f80 | ||
|
56a2e084be | ||
|
b5932cfc9d | ||
|
a96f889a57 | ||
|
5179f671e7 | ||
|
8d2139e513 | ||
|
fd9de710f5 | ||
|
f6e3234639 | ||
|
f20917de5b | ||
|
11543624ed | ||
|
28569c25f6 | ||
|
68d436140d | ||
|
758f447a17 | ||
|
2745df2774 | ||
|
654286eab1 | ||
|
2eef2eca87 | ||
|
7f8cb30ccc | ||
|
80cef697f4 | ||
|
26c7e65785 | ||
|
5704b8e57a | ||
|
f15b499cfd | ||
|
392c93e398 | ||
|
0ca6715ba5 | ||
|
c53d2d0ca8 | ||
|
6c2e82b601 | ||
|
402b2bea64 | ||
|
036a99452d | ||
|
a3dd2ce29e | ||
|
338cbb0e5c | ||
|
b346213960 | ||
|
95db1f0127 | ||
|
7e3be5559e | ||
|
45ba4e4332 | ||
|
d9b9b4b3be | ||
|
b5cbaf945d | ||
|
b15f46a093 | ||
|
5cf1397710 | ||
|
4618a9bfc2 | ||
|
f36954ec3c | ||
|
f4ff4d36ed | ||
|
21ed29598f | ||
|
ce3350770c | ||
|
692147ebf7 | ||
|
526242614f | ||
|
ab8ef280ec | ||
|
f0da327c87 | ||
|
b683b0df45 | ||
|
8693b70e8f | ||
|
eba4ff6e0a | ||
|
d869a43554 | ||
|
20354edf35 | ||
|
bd07168eb2 | ||
|
158a2aa488 | ||
|
c0b4b9fc3e | ||
|
e2399effa0 | ||
|
3622f4f27f | ||
|
fcb6a0fa3e | ||
|
6575e37cbf | ||
|
e3c8a0c16d | ||
|
3952d6d4bb | ||
|
f66084b834 | ||
|
e15c2d077a | ||
|
53a3c70580 | ||
|
e81cbd876e | ||
|
b4b040f7d8 | ||
|
16e7aebfe3 | ||
|
87ce68e1b3 | ||
|
61ba6b5a74 | ||
|
6e0e6eff05 | ||
|
d575a4c4a1 | ||
|
0cfd4f92dd | ||
|
eae73dbd91 | ||
|
90cfbd3dd5 | ||
|
f8cc27ecfc | ||
|
16f76703a5 | ||
|
05aed23d1b | ||
|
acafeeb6dc | ||
|
54be0763e1 | ||
|
2b81c8999f | ||
|
6e57725061 | ||
|
b0715811e8 | ||
|
f6540c6252 | ||
|
687918b794 | ||
|
e6925b51e1 | ||
|
c6262cd8c5 | ||
|
3ba814ae07 | ||
|
7fa6c1afb9 | ||
|
624ad14a58 | ||
|
712e5042de | ||
|
93cfdfe1ef | ||
|
14520eb25e | ||
|
c799e9ec24 | ||
|
4fb995084e | ||
|
8cdf372946 | ||
|
350a167635 | ||
|
3c450b2917 | ||
|
a02febb8cc | ||
|
a517cc1ef6 | ||
|
b343f06a09 | ||
|
f519a770d0 | ||
|
b252e0f47f | ||
|
238de2db12 | ||
|
da84f0b642 | ||
|
98e92d261b | ||
|
4d11d45d84 | ||
|
fcbfeb5d28 | ||
|
982e8e4d5c | ||
|
8e5479c7f8 | ||
|
f1d269060b | ||
|
f069e74dd8 | ||
|
5545245fe7 | ||
|
db84ec2c6d | ||
|
af39910f94 | ||
|
c958a9798a | ||
|
26bb5239c8 | ||
|
527835977a | ||
|
36603539cc | ||
|
d5783737f1 | ||
|
2c8524b4fb | ||
|
cbafed8716 | ||
|
3d4d6d29e2 | ||
|
275a563bea | ||
|
f830f640b6 | ||
|
513a553d4a | ||
|
16fb04ccb5 | ||
|
f98b9853e1 | ||
|
b41c025420 | ||
|
9165d46fdb | ||
|
d5cc77e37c | ||
|
156dc55628 | ||
|
f0d0e50994 | ||
|
d9089ab96e | ||
|
3a165edc9a | ||
|
49fd874f24 | ||
|
082501a74c | ||
|
23ffc3a85d | ||
|
ca1ac986a1 | ||
|
f4166a1fd7 | ||
|
adbf932ec1 | ||
|
59d680db22 | ||
|
713635adef | ||
|
a2c65f4793 | ||
|
2735b33638 | ||
|
8bc0b3f961 | ||
|
8de9d92acf | ||
|
8e247d52e3 | ||
|
b8a804d24f | ||
|
6e4f594a02 | ||
|
dd1a9f75dc | ||
|
7e6553c1aa | ||
|
61d386a93f | ||
|
d545d916a8 | ||
|
9e385282fc | ||
|
5d7c486d90 | ||
|
c58cea0085 | ||
|
334f2d8077 | ||
|
17756df903 | ||
|
edf0d14bd4 | ||
|
249160fdfa | ||
|
dfb6c56ed8 | ||
|
dcf14aa3a7 | ||
|
1e71d6af48 | ||
|
298af7a609 | ||
|
ae27ef2219 | ||
|
f350e22716 | ||
|
eacd347fce | ||
|
8fcd1e0287 | ||
|
2ae5645115 | ||
|
b7c727e500 | ||
|
d912f6cfe3 | ||
|
f7eb54a12f | ||
|
e0029b33ef | ||
|
ab5be2c5f7 | ||
|
61ac29e7c6 | ||
|
b462855c24 | ||
|
e918bac8cd | ||
|
aa2a357bae | ||
|
05fe2871e3 | ||
|
926a19e108 | ||
|
160b3284dd | ||
|
c2c2600728 | ||
|
7a362deb8c | ||
|
a3dd6efb00 | ||
|
dabec11d27 | ||
|
69dc32cfac | ||
|
33f9c98aa6 | ||
|
6fe7a0dc01 | ||
|
f2876d1ee3 | ||
|
fbcc5aedf2 | ||
|
4c4e4bfa4e | ||
|
ac7c147aaf | ||
|
b7ae3e4787 | ||
|
82dfd4b71f | ||
|
ac887d4211 | ||
|
967b006f51 | ||
|
1b8d0f149e | ||
|
8c9cd63c89 | ||
|
63c9ebeaff | ||
|
6b563bda43 | ||
|
5d40169436 | ||
|
738c9a073f | ||
|
258f005c6b | ||
|
c91720fb1a | ||
|
d2e289c70f | ||
|
e78a3c42e4 | ||
|
a1a6fa2fa1 | ||
|
ecde87054c | ||
|
24d55a1145 | ||
|
aba4864a25 | ||
|
7bf08c23fd | ||
|
63dffa4e77 | ||
|
da0c5b2e2c | ||
|
0d942b740c | ||
|
ac54de021a | ||
|
ae4e58c9ab | ||
|
81b3c5e85c | ||
|
f1a261377f | ||
|
8e653f12bc | ||
|
bf54a28384 | ||
|
9a4dbf1cff | ||
|
7e5da5d526 | ||
|
94a4eb1e78 | ||
|
b8731903df | ||
|
23a4f50c5b | ||
|
6965f2cb0a | ||
|
928218a283 | ||
|
6bc24c5c05 | ||
|
126c89e35f | ||
|
33f5e47faf | ||
|
485528f2ac | ||
|
b507bd4160 | ||
|
711555d1e3 | ||
|
7f5925d57c | ||
|
7adcedcd54 | ||
|
29206ae569 | ||
|
dc6e2c778a | ||
|
4508bcc72c | ||
|
a7d4bfed8a | ||
|
4ce390b933 | ||
|
df68d11b47 | ||
|
82e3ecf413 | ||
|
f7c9eafa85 | ||
|
68679d2b9e | ||
|
960467443e | ||
|
14fa5f6a60 |
57
Makefile
57
Makefile
@@ -89,6 +89,8 @@ linux-dri \
|
||||
linux-dri-x86 \
|
||||
linux-dri-x86-64 \
|
||||
linux-dri-ppc \
|
||||
linux-dri-xcb \
|
||||
linux-indirect \
|
||||
linux-fbdev \
|
||||
linux-glide \
|
||||
linux-icc \
|
||||
@@ -112,7 +114,6 @@ linux-x86-32 \
|
||||
linux-x86-64 \
|
||||
linux-x86-64-debug \
|
||||
linux-x86-64-static \
|
||||
linux-x86-xcb \
|
||||
linux-x86-glide \
|
||||
linux-x86-static \
|
||||
netbsd \
|
||||
@@ -133,9 +134,10 @@ ultrix-gcc:
|
||||
|
||||
# Rules for making release tarballs
|
||||
|
||||
DIRECTORY = Mesa-6.3.1
|
||||
LIB_NAME = MesaLib-6.3.1
|
||||
DEMO_NAME = MesaDemos-6.3.1
|
||||
DIRECTORY = Mesa-6.5
|
||||
LIB_NAME = MesaLib-6.5
|
||||
DEMO_NAME = MesaDemos-6.5
|
||||
GLUT_NAME = MesaGLUT-6.5
|
||||
|
||||
MAIN_FILES = \
|
||||
$(DIRECTORY)/Makefile* \
|
||||
@@ -151,8 +153,9 @@ MAIN_FILES = \
|
||||
$(DIRECTORY)/docs/VERSIONS \
|
||||
$(DIRECTORY)/docs/*.spec \
|
||||
$(DIRECTORY)/include/GL/internal/glcore.h \
|
||||
$(DIRECTORY)/include/GL/dmesa.h \
|
||||
$(DIRECTORY)/include/GL/amesa.h \
|
||||
$(DIRECTORY)/include/GL/dmesa.h \
|
||||
$(DIRECTORY)/include/GL/directfbgl.h \
|
||||
$(DIRECTORY)/include/GL/fxmesa.h \
|
||||
$(DIRECTORY)/include/GL/ggimesa.h \
|
||||
$(DIRECTORY)/include/GL/gl.h \
|
||||
@@ -211,7 +214,6 @@ MAIN_FILES = \
|
||||
$(DIRECTORY)/src/mesa/drivers/directfb/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/drivers/directfb/Makefile \
|
||||
$(DIRECTORY)/src/mesa/drivers/dos/*.[chS] \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/common/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/drivers/fbdev/glfbdev.c \
|
||||
$(DIRECTORY)/src/mesa/drivers/glide/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/drivers/ggi/*.[ch] \
|
||||
@@ -258,18 +260,16 @@ MAIN_FILES = \
|
||||
$(DIRECTORY)/windows/VC7/mesa/osmesa/osmesa.vcproj
|
||||
|
||||
DRI_FILES = \
|
||||
$(DIRECTORY)/include/GL/internal/*.h \
|
||||
$(DIRECTORY)/include/GL/internal/dri_interface.h \
|
||||
$(DIRECTORY)/include/GL/internal/sarea.h \
|
||||
$(DIRECTORY)/src/glx/Makefile \
|
||||
$(DIRECTORY)/src/glx/x11/Makefile \
|
||||
$(DIRECTORY)/src/glx/x11/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/Makefile \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/Makefile.template \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/common/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/common/xmlpool/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/common/xmlpool/*.po \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/dri_client/imports/*.h \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/*/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/*/depend \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/*/*.[chS] \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/*/Makefile \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/*/Doxyfile \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/*/server/*.[ch]
|
||||
@@ -311,7 +311,7 @@ GLW_FILES = \
|
||||
$(DIRECTORY)/src/glw/README \
|
||||
$(DIRECTORY)/src/glw/depend
|
||||
|
||||
PROG_FILES = \
|
||||
DEMO_FILES = \
|
||||
$(DIRECTORY)/progs/beos/*.cpp \
|
||||
$(DIRECTORY)/progs/beos/Makefile \
|
||||
$(DIRECTORY)/progs/images/*.rgb \
|
||||
@@ -322,6 +322,8 @@ PROG_FILES = \
|
||||
$(DIRECTORY)/progs/demos/*.cxx \
|
||||
$(DIRECTORY)/progs/demos/*.dat \
|
||||
$(DIRECTORY)/progs/demos/README \
|
||||
$(DIRECTORY)/progs/osdemos/Makefile \
|
||||
$(DIRECTORY)/progs/osdemos/*.c \
|
||||
$(DIRECTORY)/progs/xdemos/Makefile* \
|
||||
$(DIRECTORY)/progs/xdemos/descrip.mms \
|
||||
$(DIRECTORY)/progs/xdemos/*.[chf] \
|
||||
@@ -336,10 +338,8 @@ PROG_FILES = \
|
||||
$(DIRECTORY)/progs/windml/*.bmp \
|
||||
$(DIRECTORY)/progs/ggi/*.c \
|
||||
$(DIRECTORY)/windows/VC6/progs/demos/*.dsp \
|
||||
$(DIRECTORY)/windows/VC6/progs/glut/glut.dsp \
|
||||
$(DIRECTORY)/windows/VC6/progs/progs.dsw \
|
||||
$(DIRECTORY)/windows/VC7/progs/demos/*.vcproj \
|
||||
$(DIRECTORY)/windows/VC7/progs/glut/glut.vcproj \
|
||||
$(DIRECTORY)/windows/VC7/progs/progs.sln
|
||||
|
||||
GLUT_FILES = \
|
||||
@@ -358,7 +358,9 @@ GLUT_FILES = \
|
||||
$(DIRECTORY)/src/glut/dos/Makefile.DJ \
|
||||
$(DIRECTORY)/src/glut/dos/PC_HW/*.[chS] \
|
||||
$(DIRECTORY)/src/glut/ggi/*.[ch] \
|
||||
$(DIRECTORY)/src/glut/ggi/Makefile
|
||||
$(DIRECTORY)/src/glut/ggi/Makefile \
|
||||
$(DIRECTORY)/windows/VC6/progs/glut/glut.dsp \
|
||||
$(DIRECTORY)/windows/VC7/progs/glut/glut.vcproj
|
||||
|
||||
DEPEND_FILES = \
|
||||
$(TOP)/src/mesa/depend \
|
||||
@@ -369,11 +371,9 @@ DEPEND_FILES = \
|
||||
|
||||
LIB_FILES = $(MAIN_FILES) $(DRI_FILES) $(SGI_GLU_FILES) $(GLW_FILES)
|
||||
|
||||
DEMO_FILES = $(PROG_FILES) $(GLUT_FILES)
|
||||
|
||||
|
||||
# Everything for new a Mesa release:
|
||||
tarballs: rm_depend lib_gz demo_gz lib_bz2 demo_bz2 lib_zip demo_zip md5
|
||||
tarballs: rm_depend lib_gz demo_gz glut_gz lib_bz2 demo_bz2 glut_bz2 lib_zip demo_zip glut_zip md5
|
||||
|
||||
|
||||
rm_depend:
|
||||
@@ -395,6 +395,12 @@ demo_gz:
|
||||
gzip $(DEMO_NAME).tar ; \
|
||||
mv $(DEMO_NAME).tar.gz $(DIRECTORY)
|
||||
|
||||
glut_gz:
|
||||
cd .. ; \
|
||||
tar -cf $(GLUT_NAME).tar $(GLUT_FILES) ; \
|
||||
gzip $(GLUT_NAME).tar ; \
|
||||
mv $(GLUT_NAME).tar.gz $(DIRECTORY)
|
||||
|
||||
lib_bz2:
|
||||
rm -f configs/current ; \
|
||||
cd .. ; \
|
||||
@@ -408,6 +414,12 @@ demo_bz2:
|
||||
bzip2 $(DEMO_NAME).tar ; \
|
||||
mv $(DEMO_NAME).tar.bz2 $(DIRECTORY)
|
||||
|
||||
glut_bz2:
|
||||
cd .. ; \
|
||||
tar -cf $(GLUT_NAME).tar $(GLUT_FILES) ; \
|
||||
bzip2 $(GLUT_NAME).tar ; \
|
||||
mv $(GLUT_NAME).tar.bz2 $(DIRECTORY)
|
||||
|
||||
lib_zip:
|
||||
rm -f configs/current ; \
|
||||
rm -f $(LIB_NAME).zip ; \
|
||||
@@ -421,6 +433,12 @@ demo_zip:
|
||||
zip -qr $(DEMO_NAME).zip $(DEMO_FILES) ; \
|
||||
mv $(DEMO_NAME).zip $(DIRECTORY)
|
||||
|
||||
glut_zip:
|
||||
rm -f $(GLUT_NAME).zip ; \
|
||||
cd .. ; \
|
||||
zip -qr $(GLUT_NAME).zip $(GLUT_FILES) ; \
|
||||
mv $(GLUT_NAME).zip $(DIRECTORY)
|
||||
|
||||
md5:
|
||||
@-md5sum $(LIB_NAME).tar.gz
|
||||
@-md5sum $(LIB_NAME).tar.bz2
|
||||
@@ -428,3 +446,6 @@ md5:
|
||||
@-md5sum $(DEMO_NAME).tar.gz
|
||||
@-md5sum $(DEMO_NAME).tar.bz2
|
||||
@-md5sum $(DEMO_NAME).zip
|
||||
@-md5sum $(GLUT_NAME).tar.gz
|
||||
@-md5sum $(GLUT_NAME).tar.bz2
|
||||
@-md5sum $(GLUT_NAME).zip
|
||||
|
@@ -12,7 +12,7 @@ TOP=.
|
||||
INCLUDE_DIR="/usr/local/include"
|
||||
LIB_DIR="/usr/local/lib"
|
||||
|
||||
if [ x$# == "x0" ] ; then
|
||||
if [ "x$#" = "x0" ] ; then
|
||||
echo
|
||||
echo "***** Mesa installation - You may need root privileges to do this *****"
|
||||
echo
|
||||
@@ -20,7 +20,7 @@ echo "Default directory for header files is:" ${INCLUDE_DIR}
|
||||
echo "Enter new directory or press <Enter> to accept this default."
|
||||
|
||||
read INPUT
|
||||
if [ x${INPUT} != "x" ] ; then
|
||||
if [ "x${INPUT}" != "x" ] ; then
|
||||
INCLUDE_DIR=${INPUT}
|
||||
fi
|
||||
|
||||
@@ -29,7 +29,7 @@ echo "Default directory for library files is:" ${LIB_DIR}
|
||||
echo "Enter new directory or press <Enter> to accept this default."
|
||||
|
||||
read INPUT
|
||||
if [ x${INPUT} != "x" ] ; then
|
||||
if [ "x${INPUT}" != "x" ] ; then
|
||||
LIB_DIR=${INPUT}
|
||||
fi
|
||||
|
||||
@@ -47,7 +47,18 @@ fi
|
||||
|
||||
# flags:
|
||||
# -f = force
|
||||
# -d = preserve symlinks
|
||||
# -d = preserve symlinks (does not work on BSD)
|
||||
|
||||
if [ `uname` = "FreeBSD" ] ; then
|
||||
CP_FLAGS="-f"
|
||||
elif [ `uname` = "Darwin" ] ; then
|
||||
CP_FLAGS="-f"
|
||||
elif [ `uname` = "AIX" ] ; then
|
||||
CP_FLAGS="-fh"
|
||||
else
|
||||
CP_FLAGS="-fd"
|
||||
fi
|
||||
|
||||
|
||||
set -v
|
||||
|
||||
@@ -56,7 +67,8 @@ mkdir ${INCLUDE_DIR}/GL
|
||||
mkdir ${INCLUDE_DIR}/GLES
|
||||
mkdir ${LIB_DIR}
|
||||
cp -f ${TOP}/include/GL/*.h ${INCLUDE_DIR}/GL
|
||||
cp -f ${TOP}/include/GLES/*.h ${INCLUDE_DIR}/GLES
|
||||
cp -fd ${TOP}/lib*/lib* ${LIB_DIR}
|
||||
cp -f ${TOP}/src/glw/*.h ${INCLUDE_DIR}/GL
|
||||
# NOT YET: cp -f ${TOP}/include/GLES/*.h ${INCLUDE_DIR}/GLES
|
||||
cp ${CP_FLAGS} ${TOP}/lib*/lib* ${LIB_DIR}
|
||||
|
||||
echo "Done."
|
||||
|
87
bin/mklib
87
bin/mklib
@@ -25,31 +25,6 @@
|
||||
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
function usage()
|
||||
{
|
||||
echo 'Usage: mklib [options] objects'
|
||||
echo 'Create a shared library from object files.'
|
||||
echo ' -o LIBRARY specifies the name of the resulting library, without'
|
||||
echo ' the leading "lib" or any suffix.'
|
||||
echo ' (eg: "-o GL" might result in "libGL.so" being made)'
|
||||
echo ' -major N specifies major version number (default is 1)'
|
||||
echo ' -minor N specifies minor version number (default is 0)'
|
||||
echo ' -patch N specifies patch version number (default is 0)'
|
||||
echo ' -lLIBRARY specifies a dependency on LIBRARY'
|
||||
echo ' -LDIR search in DIR for library dependencies'
|
||||
echo ' -linker L explicity specify the linker program to use (eg: gcc, g++)'
|
||||
echo ' Not observed on all systems at this time.'
|
||||
echo ' -cplusplus link with C++ runtime'
|
||||
echo ' -static make a static library (default is dynamic/shared)'
|
||||
echo ' -install DIR put resulting library file(s) in DIR'
|
||||
echo ' -arch ARCH override using `uname` to determine host system'
|
||||
echo ' -archopt OPT specify an extra achitecture-specific option OPT'
|
||||
echo " -noprefix don't prefix library name with 'lib' nor add any suffix"
|
||||
echo ' -exports FILE only export the symbols listed in FILE'
|
||||
echo ' -h, --help display this information and exit'
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Option defaults
|
||||
#
|
||||
@@ -75,7 +50,26 @@ while true
|
||||
do
|
||||
case $1 in
|
||||
'-h' | '--help')
|
||||
usage;
|
||||
echo 'Usage: mklib [options] objects'
|
||||
echo 'Create a shared library from object files.'
|
||||
echo ' -o LIBRARY specifies the name of the resulting library, without'
|
||||
echo ' the leading "lib" or any suffix.'
|
||||
echo ' (eg: "-o GL" might result in "libGL.so" being made)'
|
||||
echo ' -major N specifies major version number (default is 1)'
|
||||
echo ' -minor N specifies minor version number (default is 0)'
|
||||
echo ' -patch N specifies patch version number (default is 0)'
|
||||
echo ' -lLIBRARY specifies a dependency on LIBRARY'
|
||||
echo ' -LDIR search in DIR for library dependencies'
|
||||
echo ' -linker L explicity specify the linker program to use (eg: gcc, g++)'
|
||||
echo ' Not observed on all systems at this time.'
|
||||
echo ' -cplusplus link with C++ runtime'
|
||||
echo ' -static make a static library (default is dynamic/shared)'
|
||||
echo ' -install DIR put resulting library file(s) in DIR'
|
||||
echo ' -arch ARCH override using `uname` to determine host system'
|
||||
echo ' -archopt OPT specify an extra achitecture-specific option OPT'
|
||||
echo " -noprefix don't prefix library name with 'lib' nor add any suffix"
|
||||
echo ' -exports FILE only export the symbols listed in FILE'
|
||||
echo ' -h, --help display this information and exit'
|
||||
exit 1
|
||||
;;
|
||||
'-o')
|
||||
@@ -198,6 +192,15 @@ case $ARCH in
|
||||
echo "mklib: Making" $ARCH "shared library: " ${LIBNAME}
|
||||
#OPTS="-shared -Wl,-soname,${LIBNAME}" # soname???
|
||||
OPTS="-shared"
|
||||
|
||||
# Check if objects are 32-bit and we're running in 64-bit
|
||||
# environment. If so, pass -m32 flag to linker.
|
||||
set ${OBJECTS}
|
||||
ABI32=`file $1 | grep 32-bit`
|
||||
if [ "${ABI32}" -a `uname -m` = "x86_64" ] ; then
|
||||
OPTS="-m32 ${OPTS}"
|
||||
fi
|
||||
|
||||
rm -f ${LIBNAME}
|
||||
# make lib
|
||||
${LINK} ${OPTS} -o ${LIBNAME} ${OBJECTS} ${DEPS}
|
||||
@@ -206,10 +209,8 @@ case $ARCH in
|
||||
elif [ $STATIC = 1 ] ; then
|
||||
LIBNAME="lib${LIBNAME}" # prefix with "lib"
|
||||
echo "mklib: Making" $ARCH "static library: " ${LIBNAME}.a
|
||||
LINK="ar"
|
||||
OPTS="-ru"
|
||||
# make lib
|
||||
${LINK} ${OPTS} ${LIBNAME}.a ${OBJECTS}
|
||||
rm -f ${LIBNAME}.a
|
||||
ar -ru ${LIBNAME}.a ${OBJECTS}
|
||||
ranlib ${LIBNAME}.a
|
||||
# finish up
|
||||
FINAL_LIBS=${LIBNAME}.a
|
||||
@@ -306,11 +307,23 @@ case $ARCH in
|
||||
;;
|
||||
|
||||
'FreeBSD')
|
||||
# we assume gcc
|
||||
|
||||
if [ "x$LINK" = "x" ] ; then
|
||||
# -linker was not specified so set default link command now
|
||||
if [ $CPLUSPLUS = 1 ] ; then
|
||||
LINK=g++
|
||||
else
|
||||
LINK=gcc
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $NOPREFIX = 1 ] ; then
|
||||
# No "lib" or ".so" part
|
||||
echo "mklib: Making FreeBSD shared library: " ${LIBNAME}
|
||||
OPTS="-shared"
|
||||
rm -f ${LIBNAME}
|
||||
ld -Bshareable -o ${LIBNAME} ${OBJECTS}
|
||||
${LINK} ${OPTS} -o ${LIBNAME} ${OBJECTS} ${DEPS}
|
||||
FINAL_LIBS=${LIBNAME}
|
||||
elif [ $STATIC = 1 ] ; then
|
||||
STLIB="lib${LIBNAME}.a"
|
||||
@@ -320,12 +333,13 @@ case $ARCH in
|
||||
ranlib ${STLIB}
|
||||
FINAL_LIBS=${STLIB}
|
||||
else
|
||||
SHLIB="lib${LIBNAME}.so.${MAJOR}.${MINOR}"
|
||||
SHLIB="lib${LIBNAME}.so.${MAJOR}"
|
||||
OPTS="-shared -Wl,-soname,${SHLIB}"
|
||||
echo "mklib: Making FreeBSD shared library: " ${SHLIB}
|
||||
rm -f ${SHLIB}
|
||||
ld -Bshareable -o ${SHLIB} ${OBJECTS}
|
||||
# XXX make lib${LIBNAME}.so.${MAJOR} symlink?
|
||||
FINAL_LIBS=${SHLIB}
|
||||
${LINK} ${OPTS} -o ${SHLIB} ${OBJECTS} ${DEPS}
|
||||
ln -sf ${SHLIB} "lib${LIBNAME}.so"
|
||||
FINAL_LIBS="${SHLIB} lib${LIBNAME}.so"
|
||||
fi
|
||||
;;
|
||||
|
||||
@@ -412,6 +426,7 @@ case $ARCH in
|
||||
if [ $STATIC = 1 ] ; then
|
||||
LIBNAME="lib${LIBNAME}.a"
|
||||
echo "mklib: Making AIX static library: " ${LIBNAME}
|
||||
rm -f ${LIBNAME}
|
||||
ar -ruv ${X64} ${LIBNAME} ${OBJECTS}
|
||||
FINAL_LIBS=${LIBNAME}
|
||||
else
|
||||
@@ -489,7 +504,7 @@ case $ARCH in
|
||||
else
|
||||
LIBNAME="lib${LIBNAME}.dylib"
|
||||
echo "mklib: Making Darwin shared library: " ${LIBNAME}
|
||||
FLAGS="-dynamiclib -multiply_defined suppress"
|
||||
FLAGS="-dynamiclib -multiply_defined suppress -current_version ${MAJOR}.${MINOR}.0 -compatibility_version ${MAJOR}.${MINOR}.0"
|
||||
if [ $CPLUSPLUS = 1 ] ; then
|
||||
LINK="g++"
|
||||
else
|
||||
|
@@ -14,6 +14,6 @@ CXXFLAGS = -O2 -DAIXV3
|
||||
MKLIB_OPTIONS = -arch aix-gcc
|
||||
GL_LIB_DEPS = -lX11 -lXext -lm
|
||||
GLU_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -lm
|
||||
GLUT_LIB_DEPS = -L$(LIB_DIR -l$(GLU_LIB) -l$(GL_LIB) -lXi -lXmu
|
||||
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lXi -lXmu
|
||||
APP_LIB_DEPS = -L$(LIB_DIR) -Wl,-brtl -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm -lX11 -lXext -lXmu -lXi
|
||||
|
||||
|
@@ -26,7 +26,8 @@ ifeq ($(CPU), x86)
|
||||
-DUSE_3DNOW_ASM \
|
||||
-DUSE_SSE_ASM
|
||||
|
||||
ASM_SOURCES = $(X86_SOURCES) $(X86_API)
|
||||
ASM_SOURCES = $(X86_SOURCES)
|
||||
ASM_API = $(X86_API)
|
||||
|
||||
CC = gcc
|
||||
CXX = g++
|
||||
|
@@ -5,11 +5,13 @@ include $(TOP)/configs/default
|
||||
CONFIG_NAME = darwin
|
||||
|
||||
# Compiler and flags
|
||||
CC = cc
|
||||
CXX = cc
|
||||
CC = c++
|
||||
CXX = c++
|
||||
CFLAGS = -I/usr/X11R6/include -O3 -fPIC -fno-common -ffast-math -funroll-loops -fexpensive-optimizations -no-cpp-precomp -dynamic -Ddarwin
|
||||
CXXFLAGS = -I/usr/X11R6/include -O3 -fPIC -fno-common -ffast-math -funroll-loops -fexpensive-optimizations -no-cpp-precomp -dynamic -Ddarwin
|
||||
|
||||
MKLIB_OPTIONS = -cplusplus
|
||||
|
||||
# Library names (actual file names)
|
||||
GL_LIB_NAME = libGL.dylib
|
||||
GLU_LIB_NAME = libGLU.dylib
|
||||
|
@@ -7,10 +7,10 @@ CONFIG_NAME = default
|
||||
|
||||
# Version info
|
||||
MESA_MAJOR=6
|
||||
MESA_MINOR=3
|
||||
MESA_TINY=1
|
||||
MESA_MINOR=5
|
||||
MESA_TINY=0
|
||||
|
||||
# external projects
|
||||
# external projects. This should be useless now that we use libdrm.
|
||||
DRM_SOURCE_PATH=$(TOP)/../drm
|
||||
|
||||
# Compiler and flags
|
||||
|
@@ -5,13 +5,22 @@ include $(TOP)/configs/default
|
||||
CONFIG_NAME = FreeBSD
|
||||
|
||||
# Compiler and flags
|
||||
CC = gcc
|
||||
CXX = g++
|
||||
CC = cc
|
||||
CXX = c++
|
||||
MAKE = gmake
|
||||
|
||||
CFLAGS = -O2 -fPIC -pedantic -I/usr/X11R6/include -DUSE_XSHM -DHZ=100
|
||||
CXXFLAGS = -O2 -fPIC -pedantic
|
||||
OPT_FLAGS = -O2
|
||||
PIC_FLAGS = -fPIC
|
||||
|
||||
DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_BSD_SOURCE -DUSE_XSHM -DHZ=100
|
||||
|
||||
X11_INCLUDES = -I/usr/X11R6/include
|
||||
|
||||
CFLAGS += $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(DEFINES) $(X11_INCLUDES) -ffast-math -pedantic
|
||||
|
||||
CXXFLAGS += $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(DEFINES) $(X11_INCLUDES)
|
||||
|
||||
GLUT_CFLAGS = -fexceptions
|
||||
|
||||
APP_LIB_DEPS = -L$(LIB_DIR) -L/usr/X11R6/lib -lXext -lXmu -lXi -lX11 -lm
|
||||
|
||||
EXTRA_LIB_PATH = -L/usr/X11R6/lib
|
||||
APP_LIB_DEPS = -L$(LIB_DIR) $(EXTRA_LIB_PATH) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lXext -lXmu -lXi -lX11 -lm
|
||||
|
@@ -12,24 +12,26 @@ WARN_FLAGS = -Wall
|
||||
OPT_FLAGS = -O
|
||||
|
||||
EXPAT_INCLUDES = -I/usr/local/include
|
||||
X11_INCLUDES = -I/usr/X11R6/include -I/usr/X11R6/include/X11/extensions
|
||||
DEFINES = -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER
|
||||
X11_INCLUDES = -I/usr/X11R6/include
|
||||
DEFINES = -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER \
|
||||
-DGLX_DIRECT_RENDERING -DHAVE_ALIAS
|
||||
CFLAGS = $(DEFINES) -Wmissing-prototypes -g -std=c99 -Wundef -fPIC \
|
||||
-ffast-math $(X11_INCLUDES)
|
||||
-ffast-math $(ASM_FLAGS) $(X11_INCLUDES)
|
||||
CXXFLAGS = $(DEFINES) -Wall -g -ansi -pedantic -fPIC
|
||||
|
||||
ASM_SOURCES =
|
||||
|
||||
# Library/program dependencies
|
||||
DRI_LIB_DEPS = -L/usr/local/lib -lm -lpthread -lexpat
|
||||
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread
|
||||
LIBDRM_LIB = `pkg-config --libs libdrm` -ldrm
|
||||
DRI_LIB_DEPS = -L/usr/local/lib -lm -lpthread -lexpat $(LIBDRM_LIB)
|
||||
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lXxf86vm -lm -lpthread $(LIBDRM_LIB)
|
||||
|
||||
GLUT_LIB_DEPS = -L$(LIB_DIR) -L/usr/X11R6/lib -lGLU -lGL -lX11 -lXmu -lXt -lXi -lm
|
||||
GLW_LIB_DEPS = -L$(LIB_DIR) -L/usr/X11R6/lib -lGL -lXt -lXm -lX11
|
||||
|
||||
|
||||
# Directories
|
||||
SRC_DIRS = mesa glu glut/glx glw glx/x11
|
||||
SRC_DIRS = glx/x11 mesa glu glut/glx glw
|
||||
DRIVER_DIRS = dri
|
||||
PROGRAM_DIRS =
|
||||
WINDOW_SYSTEM=dri
|
||||
@@ -38,6 +40,6 @@ DRM_SOURCE_PATH=$(TOP)/../drm
|
||||
|
||||
# ffb and gamma are missing because they have not been converted to use the new
|
||||
# interface.
|
||||
DRI_DIRS = dri_client i810 i830 i915 mach64 mga r128 r200 r300 radeon tdfx \
|
||||
DRI_DIRS = i810 i915 mach64 mga r128 r200 r300 radeon tdfx \
|
||||
unichrome savage sis
|
||||
|
||||
|
@@ -6,4 +6,5 @@ include $(TOP)/configs/freebsd-dri
|
||||
CONFIG_NAME = freebsd-dri-x86-64
|
||||
|
||||
ASM_FLAGS = -DUSE_X86_64_ASM
|
||||
ASM_SOURCES = $(X86-64_SOURCES) $(X86-64_API)
|
||||
ASM_SOURCES = $(X86-64_SOURCES)
|
||||
ASM_API = $(X86-64_API)
|
||||
|
@@ -10,3 +10,4 @@ PIC_FLAGS =
|
||||
|
||||
ASM_FLAGS = -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM
|
||||
ASM_SOURCES = $(X86_SOURCES)
|
||||
ASM_API = $(X86_API)
|
||||
|
@@ -8,7 +8,6 @@ CONFIG_NAME = linux
|
||||
CC = gcc
|
||||
CXX = g++
|
||||
|
||||
WARN_FLAGS = -Wall
|
||||
OPT_FLAGS = -O3 -g
|
||||
PIC_FLAGS = -fPIC
|
||||
|
||||
@@ -22,10 +21,10 @@ DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
|
||||
|
||||
X11_INCLUDES = -I/usr/X11R6/include
|
||||
|
||||
CFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \
|
||||
$(ASM_FLAGS) $(X11_INCLUDES) -std=c99 -ffast-math
|
||||
CFLAGS = -Wall -Wmissing-prototypes $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) \
|
||||
$(DEFINES) $(ASM_FLAGS) $(X11_INCLUDES) -std=c99 -ffast-math
|
||||
|
||||
CXXFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \
|
||||
CXXFLAGS = -Wall $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \
|
||||
$(X11_INCLUDES)
|
||||
|
||||
GLUT_CFLAGS = -fexceptions
|
||||
|
@@ -5,4 +5,4 @@ include $(TOP)/configs/linux
|
||||
CONFIG_NAME = linux-debug
|
||||
|
||||
OPT_FLAGS = -g
|
||||
DEFINES += -DDEBUG -DMESA_DEBUG -DRUN_DEBUG_BENCHMARK
|
||||
DEFINES += -DDEBUG -DDEBUG_MATH
|
||||
|
@@ -17,7 +17,8 @@ HAVE_X86 = $(shell uname -m | grep 'i[3-6]86' >/dev/null && echo yes)
|
||||
ifeq ($(HAVE_X86), yes)
|
||||
CFLAGS += -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM
|
||||
CXXFLAGS += -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM
|
||||
ASM_SOURCES = $(X86_SOURCES) $(X86_API)
|
||||
ASM_SOURCES = $(X86_SOURCES)
|
||||
ASM_API = $(X86_API)
|
||||
endif
|
||||
|
||||
# Directories
|
||||
|
@@ -9,12 +9,11 @@ CONFIG_NAME = linux-dri
|
||||
CC = gcc
|
||||
CXX = g++
|
||||
|
||||
MKDEP = /usr/X11R6/bin/makedepend
|
||||
#MKDEP = /usr/X11R6/bin/makedepend
|
||||
#MKDEP = gcc -M
|
||||
#MKDEP_OPTIONS = -MF depend
|
||||
|
||||
WARN_FLAGS = -Wall
|
||||
OPT_FLAGS = -O -g
|
||||
OPT_FLAGS = -g
|
||||
PIC_FLAGS = -fPIC
|
||||
|
||||
# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support.
|
||||
@@ -22,14 +21,15 @@ ARCH_FLAGS ?=
|
||||
|
||||
DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
|
||||
-D_BSD_SOURCE -D_GNU_SOURCE \
|
||||
-DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER
|
||||
-DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER \
|
||||
-DGLX_DIRECT_RENDERING -DHAVE_ALIAS
|
||||
|
||||
X11_INCLUDES = -I/usr/X11R6/include -I/usr/X11R6/include/X11/extensions
|
||||
X11_INCLUDES = -I/usr/X11R6/include
|
||||
|
||||
CFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \
|
||||
$(ASM_FLAGS) -std=c99 -ffast-math
|
||||
CFLAGS = -Wall -Wmissing-prototypes $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) \
|
||||
$(DEFINES) $(ASM_FLAGS) -std=c99 -ffast-math
|
||||
|
||||
CXXFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
|
||||
CXXFLAGS = -Wall $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
|
||||
|
||||
|
||||
ASM_SOURCES =
|
||||
@@ -37,17 +37,31 @@ ASM_SOURCES =
|
||||
# Library/program dependencies
|
||||
EXTRA_LIB_PATH=-L/usr/X11R6/lib
|
||||
|
||||
DRI_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl
|
||||
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl
|
||||
LIBDRM_LIB = `pkg-config --libs libdrm` -ldrm
|
||||
DRI_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
|
||||
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl \
|
||||
$(LIBDRM_LIB)
|
||||
|
||||
|
||||
# This is now 0 by default since it seems to confuse the hell out of people
|
||||
# and generate a lot of extra noise on bugzilla. If you need to build with
|
||||
# EGL, do 'make linux-dri USING_EGL=1'
|
||||
|
||||
USING_EGL=0
|
||||
|
||||
# Directories
|
||||
ifeq ($(USING_EGL), 1)
|
||||
SRC_DIRS = egl glx/x11 mesa glu glut/glx glw
|
||||
PROGRAM_DIRS = egl
|
||||
else
|
||||
SRC_DIRS = glx/x11 mesa glu glut/glx glw
|
||||
PROGRAM_DIRS =
|
||||
endif
|
||||
|
||||
DRIVER_DIRS = dri
|
||||
PROGRAM_DIRS =
|
||||
WINDOW_SYSTEM=dri
|
||||
|
||||
# gamma are missing because they have not been converted to use the new
|
||||
# interface.
|
||||
DRI_DIRS = dri_client i810 i830 i915 mach64 mga r128 r200 r300 radeon s3v \
|
||||
DRI_DIRS = i810 i915 mach64 mga r128 r200 r300 radeon s3v \
|
||||
savage sis tdfx trident unichrome ffb
|
||||
|
@@ -13,5 +13,5 @@ ASM_SOURCES = $(PPC_SOURCES)
|
||||
|
||||
# Build only the drivers for cards that exist on PowerPC. At some point MGA
|
||||
# will be added, but not yet.
|
||||
DRI_DIRS = dri_client mach64 r128 r200 radeon tdfx
|
||||
DRI_DIRS = mach64 r128 r200 r300 radeon tdfx
|
||||
|
||||
|
@@ -13,4 +13,5 @@ ARCH_FLAGS = -m32
|
||||
|
||||
ASM_FLAGS = -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM
|
||||
ASM_SOURCES = $(X86_SOURCES)
|
||||
ASM_API = $(X86_API)
|
||||
|
||||
|
@@ -8,7 +8,8 @@ CONFIG_NAME = linux-dri-x86-64
|
||||
ARCH_FLAGS = -m64
|
||||
|
||||
ASM_FLAGS = -DUSE_X86_64_ASM
|
||||
ASM_SOURCES = $(X86-64_SOURCES) $(X86-64_API)
|
||||
ASM_SOURCES = $(X86-64_SOURCES)
|
||||
ASM_API = $(X86-64_API)
|
||||
|
||||
LIB_DIR = $(TOP)/lib64
|
||||
|
||||
@@ -16,8 +17,8 @@ LIB_DIR = $(TOP)/lib64
|
||||
EXTRA_LIB_PATH=-L/usr/X11R6/lib64
|
||||
|
||||
# ffb, gamma, and sis are missing because they have not be converted to use
|
||||
# the new interface. i810 and i830 are missing because there is no x86-64
|
||||
# the new interface. i810 are missing because there is no x86-64
|
||||
# system where they could *ever* be used.
|
||||
#
|
||||
DRI_DIRS = dri_client i915 mach64 mga r128 r200 radeon tdfx unichrome savage
|
||||
DRI_DIRS = i915 mach64 mga r128 r200 radeon tdfx unichrome savage r300
|
||||
|
||||
|
67
configs/linux-dri-xcb
Normal file
67
configs/linux-dri-xcb
Normal file
@@ -0,0 +1,67 @@
|
||||
# -*-makefile-*-
|
||||
# Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others
|
||||
|
||||
include $(TOP)/configs/default
|
||||
|
||||
CONFIG_NAME = linux-dri-xcb
|
||||
|
||||
# Compiler and flags
|
||||
CC = gcc
|
||||
CXX = g++
|
||||
|
||||
#MKDEP = /usr/X11R6/bin/makedepend
|
||||
#MKDEP = gcc -M
|
||||
#MKDEP_OPTIONS = -MF depend
|
||||
|
||||
OPT_FLAGS = -g
|
||||
PIC_FLAGS = -fPIC
|
||||
|
||||
# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support.
|
||||
ARCH_FLAGS ?=
|
||||
|
||||
DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
|
||||
-D_BSD_SOURCE -D_GNU_SOURCE \
|
||||
-DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER \
|
||||
-DGLX_DIRECT_RENDERING -DHAVE_ALIAS -DUSE_XCB
|
||||
|
||||
X11_INCLUDES = `pkg-config --cflags-only-I x11` `pkg-config --cflags-only-I xcb`
|
||||
|
||||
CFLAGS = -Wall -Wmissing-prototypes $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) \
|
||||
$(DEFINES) $(ASM_FLAGS) -std=c99 -ffast-math
|
||||
|
||||
CXXFLAGS = -Wall $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
|
||||
|
||||
|
||||
ASM_SOURCES =
|
||||
|
||||
# Library/program dependencies
|
||||
EXTRA_LIB_PATH=`pkg-config --libs-only-L x11`
|
||||
|
||||
LIBDRM_LIB = `pkg-config --libs libdrm` -ldrm
|
||||
DRI_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
|
||||
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl \
|
||||
$(LIBDRM_LIB) `pkg-config --libs xcb`
|
||||
|
||||
|
||||
# This is now 0 by default since it seems to confuse the hell out of people
|
||||
# and generate a lot of extra noise on bugzilla. If you need to build with
|
||||
# EGL, do 'make linux-dri USING_EGL=1'
|
||||
|
||||
USING_EGL=0
|
||||
|
||||
# Directories
|
||||
ifeq ($(USING_EGL), 1)
|
||||
SRC_DIRS = egl glx/x11 mesa glu glut/glx glw
|
||||
PROGRAM_DIRS = egl
|
||||
else
|
||||
SRC_DIRS = glx/x11 mesa glu glut/glx glw
|
||||
PROGRAM_DIRS =
|
||||
endif
|
||||
|
||||
DRIVER_DIRS = dri
|
||||
WINDOW_SYSTEM=dri
|
||||
|
||||
# gamma are missing because they have not been converted to use the new
|
||||
# interface.
|
||||
DRI_DIRS = i810 i915 mach64 mga r128 r200 r300 radeon s3v \
|
||||
savage sis tdfx trident unichrome ffb
|
@@ -16,6 +16,7 @@ GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread
|
||||
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
|
||||
APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm
|
||||
|
||||
ASM_SOURCES = $(X86_SOURCES) $(X86_API)
|
||||
ASM_SOURCES = $(X86_SOURCES)
|
||||
ASM_API = $(X86_API)
|
||||
|
||||
|
||||
|
@@ -24,6 +24,7 @@ GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lX
|
||||
APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
|
||||
MKLIB_OPTIONS = -arch icc
|
||||
|
||||
ASM_SOURCES = $(X86_SOURCES) $(X86_API)
|
||||
ASM_SOURCES = $(X86_SOURCES)
|
||||
ASM_API = $(X86_API)
|
||||
|
||||
|
||||
|
49
configs/linux-indirect
Normal file
49
configs/linux-indirect
Normal file
@@ -0,0 +1,49 @@
|
||||
# -*-makefile-*-
|
||||
# Configuration for linux-indirect: Builds a libGL capable of indirect
|
||||
# rendering, but *NOT* capable of direct rendering.
|
||||
|
||||
include $(TOP)/configs/default
|
||||
|
||||
CONFIG_NAME = linux-dri
|
||||
|
||||
# Compiler and flags
|
||||
CC = gcc
|
||||
CXX = g++
|
||||
|
||||
#MKDEP = /usr/X11R6/bin/makedepend
|
||||
#MKDEP = gcc -M
|
||||
#MKDEP_OPTIONS = -MF depend
|
||||
|
||||
WARN_FLAGS = -Wall
|
||||
OPT_FLAGS = -O -g
|
||||
PIC_FLAGS = -fPIC
|
||||
|
||||
# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support.
|
||||
ARCH_FLAGS ?=
|
||||
|
||||
DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
|
||||
-D_BSD_SOURCE -D_GNU_SOURCE \
|
||||
-DPTHREADS -DHAVE_ALIAS
|
||||
|
||||
X11_INCLUDES = -I/usr/X11R6/include
|
||||
|
||||
CFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \
|
||||
$(ASM_FLAGS) -std=c99 -ffast-math
|
||||
|
||||
CXXFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
|
||||
|
||||
|
||||
ASM_SOURCES =
|
||||
|
||||
# Library/program dependencies
|
||||
EXTRA_LIB_PATH=-L/usr/X11R6/lib
|
||||
|
||||
DRI_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl
|
||||
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl
|
||||
|
||||
|
||||
# Directories
|
||||
SRC_DIRS = glx/x11 glu glut/glx glw
|
||||
DRIVER_DIRS =
|
||||
PROGRAM_DIRS =
|
||||
WINDOW_SYSTEM=dri
|
@@ -8,9 +8,9 @@ CONFIG_NAME = linux-profile
|
||||
CC = gcc
|
||||
CXX = g++
|
||||
|
||||
CFLAGS = -pg -O -ansi -pedantic -Wall -Wmissing-prototypes -Wundef -fPIC -ffast-math -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM -DPTHREADS -DDEBUG -DMESA_DEBUG
|
||||
CFLAGS = -pg -O -ansi -pedantic -Wall -Wmissing-prototypes -Wundef -fPIC -ffast-math -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM -DPTHREADS -DDEBUG
|
||||
|
||||
CXXFLAGS = -pg -O -ansi -pedantic -Wall -Wundef -fPIC -ffast-math -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -DDEBUG -DMESA_DEBUG
|
||||
CXXFLAGS = -pg -O -ansi -pedantic -Wall -Wundef -fPIC -ffast-math -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -DDEBUG
|
||||
|
||||
GLUT_CFLAGS = -fexceptions
|
||||
|
||||
|
@@ -28,16 +28,16 @@ CXXFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
|
||||
ASM_SOURCES =
|
||||
|
||||
# Library/program dependencies
|
||||
DRI_LIB_DEPS = -lm -lpthread -lexpat -ldl -L$(LIB_DIR) -lEGL -l$(GL_LIB)
|
||||
DRI_LIB_DEPS = -lm -lpthread -lexpat -ldl -L$(LIB_DIR)
|
||||
GL_LIB_DEPS = -lm -lpthread -ldl
|
||||
GLU_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -lm
|
||||
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lm
|
||||
APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm -lpthread
|
||||
|
||||
# Directories
|
||||
SRC_DIRS = egl mesa glx/mini glu glut/mini
|
||||
SRC_DIRS = glx/mini mesa glu glut/mini
|
||||
DRIVER_DIRS = dri
|
||||
PROGRAM_DIRS = miniglx egl
|
||||
PROGRAM_DIRS = miniglx
|
||||
|
||||
#DRI_DIRS = ffb gamma sis savage
|
||||
DRI_DIRS = i810 i830 i915 mach64 mga r128 r200 radeon tdfx unichrome fb
|
||||
DRI_DIRS = i810 i915 mach64 mga r128 r200 radeon tdfx unichrome fb
|
||||
|
@@ -10,3 +10,4 @@ PIC_FLAGS =
|
||||
|
||||
ASM_FLAGS = -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM
|
||||
ASM_SOURCES = $(X86_SOURCES)
|
||||
ASM_API = $(X86_API)
|
||||
|
@@ -1,22 +0,0 @@
|
||||
# Configuration for debugging on Linux
|
||||
|
||||
include $(TOP)/configs/default
|
||||
|
||||
CONFIG_NAME = linux-tcc
|
||||
|
||||
# Compiler and flags
|
||||
CC = gcc
|
||||
CXX = g++
|
||||
|
||||
TCC_DIR=/home/progs/tcc-0.9.20
|
||||
|
||||
CFLAGS = -g -ansi -pedantic -Wall -Wmissing-prototypes -Wundef -fPIC -ffast-math -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM -DPTHREADS -DDEBUG -DMESA_DEBUG -DUSE_TCC -I$(TCC_DIR)
|
||||
|
||||
CXXFLAGS = -g -ansi -pedantic -Wall -Wundef -fPIC -ffast-math -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -DDEBUG -DMESA_DEBUG
|
||||
|
||||
GLUT_CFLAGS = -fexceptions
|
||||
|
||||
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -L$(TCC_DIR) -ltcc -ldl
|
||||
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
|
||||
GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -lXt -L/usr/X11R6/lib -lX11
|
||||
APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm
|
@@ -5,4 +5,5 @@ include $(TOP)/configs/linux
|
||||
CONFIG_NAME = linux-x86
|
||||
|
||||
ASM_FLAGS = -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM
|
||||
ASM_SOURCES = $(X86_SOURCES) $(X86_API)
|
||||
ASM_SOURCES = $(X86_SOURCES)
|
||||
ASM_API = $(X86_API)
|
||||
|
@@ -6,7 +6,8 @@ CONFIG_NAME = linux-x86-64
|
||||
|
||||
ARCH_FLAGS = -m64
|
||||
|
||||
ASM_SOURCES = $(X86-64_SOURCES) $(X86-64_API)
|
||||
ASM_SOURCES = $(X86-64_SOURCES)
|
||||
ASM_API = $(X86-64_API)
|
||||
ASM_FLAGS = -DUSE_X86_64_ASM
|
||||
|
||||
LIB_DIR = $(TOP)/lib64
|
||||
|
@@ -4,4 +4,4 @@ include $(TOP)/configs/linux-x86-64
|
||||
|
||||
CONFIG_NAME = linux-x86-64-debug
|
||||
|
||||
DEFINES += -DDEBUG -DMESA_DEBUG -DRUN_DEBUG_BENCHMARK
|
||||
DEFINES += -DDEBUG -DDEBUG_MATH
|
||||
|
@@ -6,4 +6,4 @@ include $(TOP)/configs/linux-x86
|
||||
CONFIG_NAME = linux-x86-debug
|
||||
|
||||
OPT_FLAGS = -g
|
||||
DEFINES += -DDEBUG -DMESA_DEBUG -DRUN_DEBUG_BENCHMARK
|
||||
DEFINES += -DDEBUG -DDEBUG_MATH
|
||||
|
@@ -15,7 +15,8 @@ CXXFLAGS = -Wall -O3 -ansi -pedantic -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199
|
||||
GLUT_CFLAGS = -fexceptions
|
||||
|
||||
|
||||
ASM_SOURCES = $(X86_SOURCES) $(X86_API)
|
||||
ASM_SOURCES = $(X86_SOURCES)
|
||||
ASM_API = $(X86_API)
|
||||
|
||||
# Library/program dependencies
|
||||
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -L/usr/local/glide/lib -lglide3x -lm -lpthread
|
||||
|
@@ -1,24 +0,0 @@
|
||||
# Configuration for Linux with x86 optimizations
|
||||
|
||||
include $(TOP)/configs/default
|
||||
|
||||
CONFIG_NAME = linux-x86-xcb
|
||||
|
||||
# Compiler and flags
|
||||
CC = gcc
|
||||
CXX = g++
|
||||
|
||||
CFLAGS = -Wall -O3 -ansi -pedantic -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM -DPTHREADS -DUSE_XCB -I/usr/X11R6/include
|
||||
|
||||
CXXFLAGS = -Wall -O3 -ansi -pedantic -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XCB
|
||||
|
||||
GLUT_CFLAGS = -fexceptions
|
||||
|
||||
|
||||
ASM_SOURCES = $(X86_SOURCES) $(X86_API)
|
||||
|
||||
# Library/program dependencies
|
||||
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -lXCB
|
||||
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
|
||||
GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib -lXt -lX11
|
||||
APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm
|
@@ -16,7 +16,8 @@ ARCH_FLAGS ?=
|
||||
|
||||
DEFINES = -D_REENTRANT -DUSE_XSHM
|
||||
|
||||
ASM_SOURCES = $(SPARC_SOURCES) $(SPARC_API)
|
||||
ASM_SOURCES = $(SPARC_SOURCES)
|
||||
ASM_API = $(SPARC_API)
|
||||
ASM_FLAGS = -DUSE_SPARC_ASM
|
||||
|
||||
CFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \
|
||||
|
@@ -26,3 +26,13 @@ On Alpha platforms at default a sharable images for the libraries are created.
|
||||
To get a static library make it by typing MMS/MACRO=(NOSHARE=1).
|
||||
On VAX platforms only static libraries can be build.
|
||||
|
||||
23-sep-2005
|
||||
changed default compilation to use /float=ieee/ieee=denorm. The reason for
|
||||
this is that it makes Mesa on OpenVMS better compatible with other platforms
|
||||
and other packages for VMS that I maintain.
|
||||
For more information see
|
||||
http://nchrem.tnw.tudelft.nl/openvms
|
||||
https://bugs.freedesktop.org/show_bug.cgi?id=4270
|
||||
You may want to compile Mesa to use VAX-floating point arithmetic, instead
|
||||
of IEEE floating point by removing the /float=IEEE/denorm flag from the
|
||||
compiler options in the descrip.mms files.
|
||||
|
37
docs/RELNOTES-6.3.2
Normal file
37
docs/RELNOTES-6.3.2
Normal file
@@ -0,0 +1,37 @@
|
||||
|
||||
Mesa 6.3.2 Release Notes
|
||||
|
||||
August 19, 2005
|
||||
|
||||
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
Mesa uses an even/odd version number scheme like the Linux kernel.
|
||||
Odd numbered versions (such as 6.3) designate new developmental releases.
|
||||
Even numbered versions (such as 6.2) designate stable releases.
|
||||
|
||||
|
||||
6.3.2 is primarily a bug-fix release. See the VERSIONS file for details.
|
||||
|
||||
|
||||
|
||||
Driver Status
|
||||
---------------------- ----------------------
|
||||
DRI drivers varies with the driver
|
||||
XMesa (Xlib) implements OpenGL 1.5
|
||||
OSMesa (off-screen) implements OpenGL 1.5
|
||||
Glide (3dfx Voodoo1/2) implements OpenGL 1.3
|
||||
SVGA implements OpenGL 1.3
|
||||
Wind River UGL implements OpenGL 1.3
|
||||
Windows/Win32 implements OpenGL 1.5
|
||||
DJGPP implements OpenGL 1.5
|
||||
GGI implements OpenGL 1.3
|
||||
BeOS implements OpenGL 1.5
|
||||
Allegro needs updating
|
||||
D3D needs updating
|
||||
|
||||
|
||||
----------------------------------------------------------------------
|
||||
$Id: RELNOTES-6.3.2,v 3.2 2005/08/19 16:57:50 brianp Exp $
|
50
docs/RELNOTES-6.4
Normal file
50
docs/RELNOTES-6.4
Normal file
@@ -0,0 +1,50 @@
|
||||
|
||||
Mesa 6.4 Release Notes
|
||||
|
||||
October 24, 2005
|
||||
|
||||
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
Mesa uses an even/odd version number scheme like the Linux kernel.
|
||||
Odd numbered versions (such as 6.3) designate new developmental releases.
|
||||
Even numbered versions (such as 6.4) designate stable releases.
|
||||
|
||||
|
||||
6.4 is a bug-fix release. See the VERSIONS file for details.
|
||||
|
||||
|
||||
|
||||
GLUT tarball
|
||||
------------
|
||||
|
||||
Starting with 6.4, the GLUT library sources are distributed in a separate
|
||||
tarball. This was done at the request of Linux distro vendors who prefer
|
||||
to use freeglut.
|
||||
|
||||
|
||||
|
||||
|
||||
Driver Status
|
||||
---------------------- ----------------------
|
||||
DRI drivers varies with the driver
|
||||
XMesa (Xlib) implements OpenGL 1.5
|
||||
OSMesa (off-screen) implements OpenGL 1.5
|
||||
Windows/Win32 implements OpenGL 1.5
|
||||
Glide (3dfx Voodoo1/2) requires updates
|
||||
SVGA requires updates
|
||||
DJGPP requires updates
|
||||
GGI requires updates
|
||||
BeOS requires updates
|
||||
Allegro requires updates
|
||||
D3D requires updates
|
||||
|
||||
The drivers which require updates mostly need to be updated to work
|
||||
with the new gl_renderbuffer / gl_framebuffer infrastructure introduced
|
||||
in Mesa 6.3.
|
||||
|
||||
|
||||
----------------------------------------------------------------------
|
||||
$Id: RELNOTES-6.4,v 3.1 2005/10/24 23:33:27 brianp Exp $
|
47
docs/RELNOTES-6.4.1
Normal file
47
docs/RELNOTES-6.4.1
Normal file
@@ -0,0 +1,47 @@
|
||||
|
||||
Mesa 6.4.1 Release Notes
|
||||
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
Mesa uses an even/odd version number scheme like the Linux kernel.
|
||||
Odd numbered versions (such as 6.3) designate new developmental releases.
|
||||
Even numbered versions (such as 6.4) designate stable releases.
|
||||
|
||||
|
||||
6.4.1 is a bug-fix release. See the VERSIONS file for details.
|
||||
|
||||
|
||||
|
||||
GLUT tarball
|
||||
------------
|
||||
|
||||
Starting with 6.4, the GLUT library sources are distributed in a separate
|
||||
tarball. This was done at the request of Linux distro vendors who prefer
|
||||
to use freeglut.
|
||||
|
||||
|
||||
|
||||
|
||||
Driver Status
|
||||
---------------------- ----------------------
|
||||
DRI drivers varies with the driver
|
||||
XMesa (Xlib) implements OpenGL 1.5
|
||||
OSMesa (off-screen) implements OpenGL 1.5
|
||||
Windows/Win32 implements OpenGL 1.5
|
||||
Glide (3dfx Voodoo1/2) requires updates
|
||||
SVGA requires updates
|
||||
DJGPP requires updates
|
||||
GGI requires updates
|
||||
BeOS requires updates
|
||||
Allegro requires updates
|
||||
D3D requires updates
|
||||
|
||||
The drivers which require updates mostly need to be updated to work
|
||||
with the new gl_renderbuffer / gl_framebuffer infrastructure introduced
|
||||
in Mesa 6.3.
|
||||
|
||||
|
||||
----------------------------------------------------------------------
|
||||
$Id: RELNOTES-6.4.1,v 3.1 2006/02/03 17:21:54 brianp Exp $
|
47
docs/RELNOTES-6.4.2
Normal file
47
docs/RELNOTES-6.4.2
Normal file
@@ -0,0 +1,47 @@
|
||||
|
||||
Mesa 6.4.2 Release Notes
|
||||
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
Mesa uses an even/odd version number scheme like the Linux kernel.
|
||||
Odd numbered versions (such as 6.3) designate new developmental releases.
|
||||
Even numbered versions (such as 6.4) designate stable releases.
|
||||
|
||||
|
||||
6.4.2 is a minor bug-fix release. See the VERSIONS file for details.
|
||||
|
||||
|
||||
|
||||
GLUT tarball
|
||||
------------
|
||||
|
||||
Starting with 6.4, the GLUT library sources are distributed in a separate
|
||||
tarball. This was done at the request of Linux distro vendors who prefer
|
||||
to use freeglut.
|
||||
|
||||
|
||||
|
||||
|
||||
Driver Status
|
||||
---------------------- ----------------------
|
||||
DRI drivers varies with the driver
|
||||
XMesa (Xlib) implements OpenGL 1.5
|
||||
OSMesa (off-screen) implements OpenGL 1.5
|
||||
Windows/Win32 implements OpenGL 1.5
|
||||
Glide (3dfx Voodoo1/2) requires updates
|
||||
SVGA requires updates
|
||||
DJGPP requires updates
|
||||
GGI requires updates
|
||||
BeOS requires updates
|
||||
Allegro requires updates
|
||||
D3D requires updates
|
||||
|
||||
The drivers which require updates mostly need to be updated to work
|
||||
with the new gl_renderbuffer / gl_framebuffer infrastructure introduced
|
||||
in Mesa 6.3.
|
||||
|
||||
|
||||
----------------------------------------------------------------------
|
||||
$Id: RELNOTES-6.4.2,v 3.1 2006/02/03 17:21:54 brianp Exp $
|
75
docs/RELNOTES-6.5
Normal file
75
docs/RELNOTES-6.5
Normal file
@@ -0,0 +1,75 @@
|
||||
|
||||
Mesa 6.5 Release Notes
|
||||
|
||||
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
Mesa uses an even/odd version number scheme like the Linux kernel.
|
||||
Odd numbered versions (such as 6.5) designate new developmental releases.
|
||||
Even numbered versions (such as 6.4) designate stable releases.
|
||||
|
||||
|
||||
|
||||
New Features
|
||||
------------
|
||||
|
||||
GL_EXT_timer_query - used to get elapsed time information from the renderer.
|
||||
|
||||
GL_EXT_packed_depth_stencil - defines a new GL_DEPTH_STENCIL_EXT pixel format.
|
||||
|
||||
GL_EXT_framebuffer_blit extension - simplified glCopyPixels-like feature
|
||||
|
||||
|
||||
Driver Interface Changes
|
||||
------------------------
|
||||
|
||||
Stencil: The Driver.StencilOp/Func/Mask() functions have been replaced by
|
||||
the two-sided versions: Driver.Stencil*Separate().
|
||||
|
||||
|
||||
|
||||
To Do
|
||||
-----
|
||||
Fix linux-glide target/driver.
|
||||
Fix lambda calculation for frag progs.
|
||||
|
||||
|
||||
|
||||
|
||||
Removed Extensions
|
||||
------------------
|
||||
|
||||
The following extensions have been removed:
|
||||
|
||||
GL_HP_occlusion_test - this is superceded by GL_ARB_occlusion_query.
|
||||
|
||||
|
||||
|
||||
To Do (someday) items
|
||||
---------------------
|
||||
Switch to freeglut
|
||||
Increase MAX_DRAWBUFFERS
|
||||
|
||||
|
||||
|
||||
|
||||
Driver Status
|
||||
---------------------- ----------------------
|
||||
DRI drivers varies with the driver
|
||||
XMesa (Xlib) implements OpenGL 1.5
|
||||
OSMesa (off-screen) implements OpenGL 1.5
|
||||
Glide (3dfx Voodoo1/2) implements OpenGL 1.3
|
||||
SVGA implements OpenGL 1.3
|
||||
Wind River UGL implements OpenGL 1.3
|
||||
Windows/Win32 implements OpenGL 1.5
|
||||
DJGPP implements OpenGL 1.5
|
||||
GGI implements OpenGL 1.3
|
||||
BeOS implements OpenGL 1.5
|
||||
Allegro needs updating
|
||||
D3D needs updating
|
||||
|
||||
|
||||
----------------------------------------------------------------------
|
||||
$Id: RELNOTES-6.5,v 3.2 2006/03/02 04:12:34 brianp Exp $
|
@@ -1352,10 +1352,106 @@ Mesa Version History
|
||||
- fixed a few Darwin compilation problems
|
||||
|
||||
|
||||
6.3.1 July XX, 2005
|
||||
6.3.1
|
||||
This was an intermediate release for X.org which wasn't otherwise released.
|
||||
|
||||
|
||||
6.3.2 August 19, 2005
|
||||
New:
|
||||
- The distribution now includes the DRI drivers and GLX code
|
||||
Changes:
|
||||
- Made the DRI "new" driver interface standard, remove old code
|
||||
Bug fixes:
|
||||
- GL_ARB_vertex/fragment_shader were mistakenly listed in the
|
||||
extensions string
|
||||
- negative relative addressing in vertex programs was broken
|
||||
- update/fix SPARC assembly code for vertex transformation
|
||||
- fixed memory leak when freeing GLX drawables/renderbuffers
|
||||
- fixed display list memory leak
|
||||
- the GL_PIXEL_MAP_I_TO_I table is now floating point, not integer
|
||||
- wglGetProcAddress() didn't handle wgl-functions
|
||||
- fixed glxext.h cross-compile issue (Colin Harrison)
|
||||
- assorted DRI driver fixes
|
||||
|
||||
|
||||
6.4 October 24, 2005
|
||||
New:
|
||||
- Added a fast XOR line drawing function in Xlib driver
|
||||
- Added support for GL_ARB_texture_mirrored_repeat to savage
|
||||
driver (supported only on Savage4 hardware).
|
||||
Changes:
|
||||
- Mesa now packaged in three parts: Library, Demos and GLUT
|
||||
Bug fixes:
|
||||
- GLX_X_RENDERABLE token wasn't accepted by glXChooseFBConfig
|
||||
- Some files were present multiple times in the 6.3.2 tarballs
|
||||
- r200_vtxtmp_x86.S file was missing from 6.3.2 tarball (bug 4207)
|
||||
- glxgears_fbconfig demo didn't work (bug 4237)
|
||||
- fixed bug when bilinear sampling 2d textures with borders
|
||||
- glXCreatePbuffer() could segfault instead of returning 0 (bug 4235)
|
||||
- fixed undefined frexp and rand in X.org libGLcore.a (bug 4242)
|
||||
- fixed a few problems with proxy color tables (bug 4270)
|
||||
- fixed precision problem in Z clearing (bug 4395)
|
||||
- glBitmap, glDraw/CopyPixels mistakenly generated selection hits
|
||||
- fixed potential segfault caused by reading pixels outside
|
||||
of renderbuffer bounds
|
||||
- glGetTexLevelParameter didn't accept GL_TEXTURE_DEPTH_SIZE_ARB
|
||||
- fixed memory corruption bug involving software alpha buffers
|
||||
- glReadPixels clipped by window bounds was sometimes broken
|
||||
- glDraw/CopyPixels of stencil data ignored the stencil write mask
|
||||
- glReadPixels from a texture bound to a framebuffer object didn't work
|
||||
- glIsRender/FramebufferEXT weren't totally correct
|
||||
- fixed a number of point size attenuation/fade bugs
|
||||
- fixed glFogCoord bug 4729
|
||||
- GLX encoding for transpose matrix functions was broken
|
||||
- fixed broken fragment program KIL and SWZ instructions
|
||||
- fragment programs that wrote result.depth.z didn't work
|
||||
|
||||
|
||||
6.4.1 November 30, 2005
|
||||
Bug fixes:
|
||||
- redefining a vertex program string didn't take effect in TNL module
|
||||
- fixed occasional segfault upon vertex/fragment parsing error
|
||||
- vertex program LIT instruction didn't handle 0^0=1 correctly
|
||||
- fragment program fog option didn't work with glDrawPixels, glBitmap
|
||||
- USE_MGL_NAMESPACE didn't work for x86-64
|
||||
- OSMesa demos were missing from previous release tarballs
|
||||
- fixed problem with float->ushort conversion in glClear (bug 4992)
|
||||
- popping of GL_EYE_PLANE texgen state was broken (bug 4996)
|
||||
- popping of GL_SPOT_DIRECTION light state was broken (bug 5005)
|
||||
- fixed occasional triangle color interpolation problem on VMS
|
||||
- work around invalid free() call (bug 5131)
|
||||
- fixed BSD X server compilation problem by including stdint.h
|
||||
|
||||
|
||||
6.4.2 February 2, 2006
|
||||
New:
|
||||
- added OSMesaColorClamp() function/feature
|
||||
- added wglGetExtensionStringARB() function
|
||||
Bug fixes:
|
||||
- fixed some problems when building on Windows
|
||||
- GLw header files weren't installed by installmesa script (bug 5396)
|
||||
- GL/glfbdev.h file was missing from tarballs
|
||||
- fixed TNL initialization bug which could lead to crash (bug 5791)
|
||||
|
||||
|
||||
6.5 month, day, 2005
|
||||
New:
|
||||
- GL_EXT_packed_depth_stencil extension
|
||||
- GL_EXT_timer_query extension
|
||||
- GL_EXT_framebuffer_blit extension
|
||||
- reflect demo improved to support multiple windows
|
||||
- singlebuffer demo (shows no/little-flicker single-buffered rendering)
|
||||
- r200: enable GL_ARB_texture_env_crossbar, separate the texture
|
||||
sampling unit bits from the texture env combine enable bits
|
||||
- r200: add support for GL_ATI_fragment_shader
|
||||
- added fast XOR-mode line drawing optimization
|
||||
- radeon: add support for all 3 tmus, GL_ARB_texture_cube_map
|
||||
and GL_EXT_fog_coord
|
||||
- MESA_GLX_ALPHA_BITS env var for xlib driver
|
||||
- many DRI driver updates (including screen rotation support
|
||||
for the Intel DRI driver)
|
||||
Changes:
|
||||
- removed GL_HP_occlusion_test (use GL_ARB_occlusion_query instead)
|
||||
- removed GL_SGIX/SGIS_pixel_texture extensions
|
||||
Bug fixes:
|
||||
|
||||
|
@@ -37,8 +37,6 @@ a:visited {
|
||||
|
||||
<b>Download / Install</b>
|
||||
<ul>
|
||||
<li><a href="http://www.sourceforge.net/projects/mesa3d" target="_parent">Stable Release (6.2.1)</a>
|
||||
<li><a href="http://www.sourceforge.net/projects/mesa3d" target="_parent">Devel Release (6.3)</a>
|
||||
<li><a href="download.html" target="MainFrame">Downloading/Unpacking</a>
|
||||
<li><a href="install.html" target="MainFrame">Compilation/Installation</a>
|
||||
<li><a href="glu.html" target="MainFrame">SGI's GLU</a>
|
||||
@@ -81,7 +79,8 @@ a:visited {
|
||||
<b>Links</b>
|
||||
<ul>
|
||||
<li><a href="http://www.opengl.org" target="_parent">OpenGL website</a>
|
||||
<li><a href="http://dri.sourceforge.net" target="_parent">DRI website</a>
|
||||
<li><a href="http://dri.freedesktop.org" target="_parent">DRI website</a>
|
||||
<li><a href="http://www.freedesktop.org" target="_parent">freedesktop.org</a>
|
||||
<li><a href="games.html" target="MainFrame">Games and Entertainment</a>
|
||||
<li><a href="libraries.html" target="MainFrame">Libraries and Toolkits</a>
|
||||
<li><a href="modelers.html" target="MainFrame">Modeling and Rendering</a>
|
||||
@@ -90,9 +89,13 @@ a:visited {
|
||||
<li><a href="demos.html" target="MainFrame">Demos / other</a>
|
||||
</ul>
|
||||
|
||||
<b>Hosted by:</b>
|
||||
<br>
|
||||
<blockquote>
|
||||
<A HREF="http://sourceforge.net"
|
||||
target="_parent"><IMG SRC="http://sourceforge.net/sflogo.php?group_id=3&type=1"
|
||||
WIDTH="88" HEIGHT="31" ALIGN="BOTTOM" ALT="Sourceforge.net" BORDER="0"></A>
|
||||
</blockquote>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
@@ -6,101 +6,129 @@
|
||||
|
||||
<BODY>
|
||||
|
||||
<H1>Downloading / Unpacking</H1>
|
||||
<H1>Downloading</H1>
|
||||
|
||||
<p>
|
||||
Mesa can be downloaded from the
|
||||
<a href="http://www.sourceforge.net/projects/mesa3d" target="_parent">
|
||||
SourceForge download area</A>.
|
||||
Last development release: <b>6.3.2</b>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Since version 2.3, Mesa is distributed in two pieces: main library code
|
||||
and demos. If you're upgrading from a previous version of Mesa or you're not
|
||||
interested in the demos you can just download the core Mesa archive file.
|
||||
Last stable release: <b>6.2.1</b>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Mesa is available in at least three archive formats:
|
||||
Primary download site:
|
||||
<a href="http://sourceforge.net/project/showfiles.php?group_id=3"
|
||||
target="_parent">SourceForge</a>
|
||||
</p>
|
||||
|
||||
|
||||
<p>
|
||||
Mesa is distributed in several parts:
|
||||
</p>
|
||||
<ul>
|
||||
<li><b>MesaLib-x.y.z</b> - the main Mesa library source code, drivers
|
||||
and documentation.
|
||||
</li>
|
||||
<li><b>MesaDemos-x.y.z</b> - OpenGL demonstration and test programs.
|
||||
Most of the programs require GLUT (either the
|
||||
<a href="http://www.opengl.org/resources/libraries/glut.html"
|
||||
target="_parent">original GLUT by Mark Kilgard</a> or
|
||||
<a href="http://freeglut.sourceforge.net" target="_parent">freeglut</a> or
|
||||
<a href="http://freeglut.sourceforge.net" target="_parent">OpenGLUT</a>).
|
||||
</li>
|
||||
<li><b>MesaGLUT-x.y.z</b> - Mark Kilgard's GLUT, easily compiled and used
|
||||
with Mesa. Plus, other implementation of GLUT for DOS, OS/2, BeOS, etc.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
If you're not interested in running the demos, you'll only need the first
|
||||
package.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The packages are available in .tar.gz, .tar.bz2 and .zip formats.
|
||||
Other organizations might offer additional package formats.
|
||||
</p>
|
||||
|
||||
<H1>Unpacking</H1>
|
||||
|
||||
<p>
|
||||
All the packages should be in the same directory prior to unpacking.
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>To unpack .tar.gz files:
|
||||
<pre>
|
||||
1. GNU zip/tar
|
||||
|
||||
Download MesaLib-X.Y.tar.gz and optionally MesaDemos-X.Y.tar.gz
|
||||
Unpack with:
|
||||
gzcat MesaLib-X.Y.tar.gz | tar xf -
|
||||
gzcat MesaDemos-X.Y.tar.gz | tar xf -
|
||||
or
|
||||
gunzip MesaLib-X.Y.tar.gz ; tar xf MesaLib-X.Y.tar
|
||||
gunzip MesaDemos-X.Y.tar.gz ; tar xf MesaLib-X.Y.tar
|
||||
or
|
||||
tar zxf MesaLib-X.Y.tar.gz
|
||||
tar zxf MesaDemos-X.Y.tar.gz
|
||||
|
||||
If you don't have gzcat try zcat instead.
|
||||
|
||||
2. Unix compressed/tar
|
||||
|
||||
Download MesaLib-X.Y.tar.Z and optionally MesaDemos-X.Y.tar.Z
|
||||
Unpack with:
|
||||
zcat MesaLib-X.Y.tar.Z | tar xf -
|
||||
zcat MesaDemos-X.Y.tar.Z | tar xf -
|
||||
|
||||
3. ZIP format
|
||||
|
||||
Download MesaLib-X.Y.zip and optionally MesaDemos-X.Y.zip
|
||||
Unpack with:
|
||||
unzip MesaLib-X.Y.zip
|
||||
unzip MesaDemos-X.Y.zip
|
||||
tar zxf MesaLib-X.Y.tar.gz
|
||||
tar zxf MesaDemos-X.Y.tar.gz
|
||||
tar zxf MesaGLUT-X.Y.tar.gz
|
||||
</pre>
|
||||
or
|
||||
<pre>
|
||||
gzcat MesaLib-X.Y.tar.gz | tar xf -
|
||||
gzcat MesaDemos-X.Y.tar.gz | tar xf -
|
||||
gzcat MesaGLUT-X.Y.tar.gz | tar xf -
|
||||
</pre>
|
||||
or
|
||||
<pre>
|
||||
gunzip MesaLib-X.Y.tar.gz ; tar xf MesaLib-X.Y.tar
|
||||
gunzip MesaDemos-X.Y.tar.gz ; tar xf MesaDemos-X.Y.tar
|
||||
gunzip MesaGLUT-X.Y.tar.gz ; tar xf MesaGLUT-X.Y.tar
|
||||
</pre>
|
||||
<li>To unpack .tar.bz2 files:
|
||||
<pre>
|
||||
bunzip2 -c MesaLib-X.Y.tar.gz | tar xf -
|
||||
bunzip2 -c MesaDemos-X.Y.tar.gz | tar xf -
|
||||
bunzip2 -c MesaGLUT-X.Y.tar.gz | tar xf -
|
||||
</pre>
|
||||
<li>To unpack .zip files:
|
||||
<pre>
|
||||
unzip MesaLib-X.Y.zip
|
||||
unzip MesaDemos-X.Y.zip
|
||||
unzip MesaGLUT-X.Y.zip
|
||||
</pre>
|
||||
</ul>
|
||||
|
||||
|
||||
<h1>Contents</h1>
|
||||
|
||||
<p>
|
||||
After unpacking you'll have these directories (and more):
|
||||
After unpacking you'll have these directories:
|
||||
</p>
|
||||
<pre>
|
||||
Makefile.X11 - top-level Makefile for X11-based systems
|
||||
Make-config - system configurations used by the Makefile.X11
|
||||
Makefile - top-level Makefile for most systems
|
||||
configs/ - makefile parameter files for various systems
|
||||
include/ - GL header (include) files
|
||||
bin/ - shell scripts for making shared libraries, etc
|
||||
lib/ - final client libraries, created during compilation
|
||||
docs/ - documentation
|
||||
src/ - source code for libraries
|
||||
src/mesa - sources for the main Mesa library and device drivers
|
||||
src/glu - libGLU source code
|
||||
src/glw - Xt/Motif/OpenGL widget code
|
||||
</pre>
|
||||
|
||||
If you downloaded and unpacked the MesaDemos.X.Y package:
|
||||
|
||||
and if you downloaded and unpacked the MesaDemos.X.Y archive:
|
||||
|
||||
src/glut - GLUT source code
|
||||
progs/ - OpenGL programs
|
||||
<pre>
|
||||
progs/demos - original Mesa demos
|
||||
progs/xdemos - GLX OpenGL/Mesa demos
|
||||
progs/redbook - examples from the OpenGL Programming Guide
|
||||
progs/samples - examples from SGI
|
||||
progs/images/ - image files
|
||||
</pre>
|
||||
|
||||
If you downloaded and unpacked the MesaGLUT.X.Y package:
|
||||
<pre>
|
||||
src/glut - GLUT library source code
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Proceed to <a href="install.html">compilation and installation
|
||||
Proceed to the <a href="install.html">compilation and installation
|
||||
instructions</a>.
|
||||
</p>
|
||||
|
||||
<H1>GLUT</H1>
|
||||
|
||||
<p>
|
||||
Mesa 2.5 and later includes Mark Kilgard's GLUT library (GL Utility Toolkit).
|
||||
GLUT is built automatically on systems which support it.
|
||||
</p>
|
||||
<p>
|
||||
The GLUT tests, demos, examples, etc are not included, just the main library.
|
||||
To obtain the latest complete release of GLUT please visit the
|
||||
<a href="http://www.opengl.org/resources/libraries/glut.html"
|
||||
target ="_parent">GLUT page</a> on www.opengl.org.
|
||||
</p>
|
||||
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
@@ -16,25 +16,29 @@ Mesa supports the following environment variables:
|
||||
<li>MESA_NO_MMX - if set, disables Intel MMX optimizations
|
||||
<li>MESA_NO_3DNOW - if set, disables AMD 3DNow! optimizations
|
||||
<li>MESA_NO_SSE - if set, disables Intel SSE optimizations
|
||||
<li>MESA_DEBUG - if set, error messages are printed to stderr
|
||||
<li>MESA_DEBUG - if set, error messages are printed to stderr.
|
||||
If the value of MESA_DEBUG is "FP" floating point arithmetic errors will
|
||||
generate exceptions.
|
||||
<li>MESA_NO_DITHER - if set, disables dithering, overriding glEnable(GL_DITHER)
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
The following environment variables are only applicable to the Xlib/X11
|
||||
software driver:
|
||||
The following are only applicable to the Xlib software driver.
|
||||
See <A HREF="README.X11">README.X11</A> for details.
|
||||
</p>
|
||||
<ul>
|
||||
<li>MESA_RGB_VISUAL - specifies the X visual and depth for RGB mode (X only)
|
||||
<li>MESA_CI_VISUAL - specifies the X visual and depth for CI mode (X only)
|
||||
<li>MESA_BACK_BUFFER - specifies how to implement the back color buffer (X only)
|
||||
<li>MESA_GAMMA - gamma correction coefficients (X only)
|
||||
<li>MESA_XSYNC - enable synchronous X behavior (for X debugging only)
|
||||
<li>MESA_GLX_FORCE_CI - if set, force GLX to treak 8bpp visuals as CI visuals
|
||||
<li>MESA_RGB_VISUAL - specifies the X visual and depth for RGB mode
|
||||
<li>MESA_CI_VISUAL - specifies the X visual and depth for CI mode
|
||||
<li>MESA_BACK_BUFFER - specifies how to implement the back color buffer,
|
||||
either "pixmap" or "ximage"
|
||||
<li>MESA_GAMMA - gamma correction coefficients for red, green, blue channels
|
||||
<li>MESA_XSYNC - enable synchronous X behavior (for debugging only)
|
||||
<li>MESA_GLX_FORCE_CI - if set, force GLX to treat 8bpp visuals as CI visuals
|
||||
<li>MESA_GLX_FX - set to either "fullscreen" for full-screen rendering,
|
||||
"window" to render into a window, or "disable" to disable the Glide driver.
|
||||
<li>MESA_GLX_FORCE_ALPHA - if set, forces RGB windows to have an alpha channel.
|
||||
<li>MESA_GLX_DEPTH_BITS - specifies default number of bits for depth buffer.
|
||||
<li>MESA_GLX_ALPHA_BITS - specifies default number of bits for alpha channel.
|
||||
</ul>
|
||||
|
||||
|
||||
|
@@ -9,7 +9,7 @@
|
||||
|
||||
<center>
|
||||
<h1>Mesa Frequently Asked Questions</h1>
|
||||
Last updated: 17 November 2004
|
||||
Last updated: 21 October 2004
|
||||
</center>
|
||||
|
||||
<br>
|
||||
@@ -39,14 +39,14 @@ See the </a><a href="http://www.opengl.org/">OpenGL website</a> for more
|
||||
information.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 5.x supports the OpenGL 1.4 specification.
|
||||
Mesa 6.x supports the OpenGL 1.5 specification.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>1.2 Does Mesa support/use graphics hardware?</h2>
|
||||
<p>
|
||||
Yes. Specifically, Mesa serves as the OpenGL core for the open-source
|
||||
XFree86/DRI OpenGL drivers. See the <a href="http://dri.sf.net/">DRI
|
||||
Yes. Specifically, Mesa serves as the OpenGL core for the open-source DRI
|
||||
drivers for XFree86/X.org. See the <a href="http://dri.sf.net/">DRI
|
||||
website</a> for more information.
|
||||
</p>
|
||||
<p>
|
||||
@@ -62,7 +62,8 @@ operating systems today.
|
||||
Still, Mesa serves at least these purposes:
|
||||
</p>
|
||||
<ul>
|
||||
<li>Mesa is used as the core of the open-source XFree86/DRI hardware drivers.
|
||||
<li>Mesa is used as the core of the open-source XFree86/X.org DRI
|
||||
hardware drivers.
|
||||
</li>
|
||||
<li>Mesa is quite portable and allows OpenGL to be used on systems
|
||||
that have no other OpenGL solution.
|
||||
@@ -86,8 +87,8 @@ Still, Mesa serves at least these purposes:
|
||||
<h2>1.4 What's the difference between"Stand-Alone" Mesa and the DRI drivers?</h2>
|
||||
<p>
|
||||
<em>Stand-alone Mesa</em> is the original incarnation of Mesa.
|
||||
On systems running the X Window System, it does all its rendering through
|
||||
the Xlib API.
|
||||
On systems running the X Window System it does all its rendering through
|
||||
the Xlib API:
|
||||
<ul>
|
||||
<li>The GLX API is supported, but it's really just an emulation of the
|
||||
real thing.
|
||||
@@ -116,21 +117,10 @@ within the DRI (Direct Rendering Infrastructure):
|
||||
|
||||
<h2>1.5 How do I upgrade my DRI installation to use a new Mesa release?</h2>
|
||||
<p>
|
||||
You don't! A copy of the Mesa source code lives inside the XFree86/DRI source
|
||||
tree and gets compiled into the individual DRI driver modules.
|
||||
If you try to install Mesa over an XFree86/DRI installation, you'll lose
|
||||
hardware rendering (because stand-alone Mesa's libGL.so is different than
|
||||
the XFree86 libGL.so).
|
||||
</p>
|
||||
<p>
|
||||
The DRI developers will incorporate the latest release of Mesa into the
|
||||
DRI drivers when the time is right.
|
||||
</p>
|
||||
<p>
|
||||
To upgrade, either look for a new release of <a href="http://www.xfree86.org"
|
||||
target="_parent">XFree86</a> or visit the
|
||||
<a href="http://dri.sf.net" target="_parent">DRI website</a> to see
|
||||
if there's newer drivers.
|
||||
This wasn't easy in the past.
|
||||
Now, the DRI drivers are included in the Mesa tree and can be compiled
|
||||
separately from the X server.
|
||||
Just follow the Mesa <a href="install.html">compilation instructions</a>.
|
||||
</p>
|
||||
|
||||
|
||||
@@ -201,7 +191,7 @@ Mesa no longer supports GNU autoconf/automake. Why?
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
Now, Mesa again uses a conventional Makefile system (as it did originally).
|
||||
Now Mesa again uses a conventional Makefile system (as it did originally).
|
||||
Basically, each Makefile in the tree includes one of the configuration
|
||||
files from the config/ directory.
|
||||
The config files specify all the variables for a variety of popular systems.
|
||||
@@ -219,9 +209,9 @@ Mesa's not the solution.
|
||||
|
||||
<h2><a name="part2">2.4 Where is the GLUT library?</a></h2>
|
||||
<p>
|
||||
<a name="part2">GLUT (OpenGL Utility Toolkit) is in the separate MesaDemos-x.y.z.tar.gz file.
|
||||
If you don't already have GLUT installed, you should grab the MesaDemos
|
||||
package and unpack it before compiling Mesa.
|
||||
<a name="part2">GLUT (OpenGL Utility Toolkit) is in the separate MesaGLUT-x.y.z.tar.gz file.
|
||||
If you don't already have GLUT installed, you should grab the MesaGLUT
|
||||
package and compile it with the rest of Mesa.
|
||||
</a></p>
|
||||
|
||||
|
||||
@@ -250,7 +240,7 @@ Mesa version number.
|
||||
version number.
|
||||
</li></ul>
|
||||
<p>
|
||||
After installing XFree86 and the DRI drivers, some of these files
|
||||
After installing XFree86/X.org and the DRI drivers, some of these files
|
||||
may be symlinks into the /usr/X11R6/ tree.
|
||||
</p>
|
||||
<p>
|
||||
|
@@ -24,7 +24,7 @@ We're no longer developing the original Mesa GLU library.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The new SI GLU library code is included in the Mesa package.
|
||||
The SI GLU library code is included in the Mesa distribution.
|
||||
You don't have to download it separately.
|
||||
</p>
|
||||
|
||||
|
@@ -136,7 +136,7 @@ GL_ARB_fragment_program extensions.
|
||||
<p>
|
||||
Ongoing: Mesa is used as the core of many hardware OpenGL drivers for
|
||||
the XFree86 X.org X servers within the
|
||||
<A href="http://dri.sourceforge.net/" target="_parent">DRI project</A>.
|
||||
<A href="http://dri.freedesktop.org/" target="_parent">DRI project</A>.
|
||||
I continue to enhance Mesa with new extensions and features.
|
||||
</p>
|
||||
|
||||
@@ -146,7 +146,8 @@ I continue to enhance Mesa with new extensions and features.
|
||||
|
||||
<p>
|
||||
This is a summary of the major versions of Mesa. Note that Mesa's major
|
||||
version number tracks OpenGL's minor version number.
|
||||
version number tracks OpenGL's minor version number (+1).
|
||||
Work is underway to implement the OpenGL 2.0 specification.
|
||||
</p>
|
||||
|
||||
|
||||
@@ -162,10 +163,11 @@ extensions incorporated as standard features:
|
||||
</ul>
|
||||
<p>
|
||||
Also note that several OpenGL tokens were renamed in OpenGL 1.5
|
||||
for the sake of consistency. The old names will still be valid.
|
||||
for the sake of consistency.
|
||||
The old tokens are still available.
|
||||
</p>
|
||||
<pre>
|
||||
New Name Old Name
|
||||
New Token Old Token
|
||||
------------------------------------------------------------
|
||||
GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE
|
||||
GL_FOG_COORD GL_FOG_COORDINATE
|
||||
|
@@ -21,7 +21,7 @@
|
||||
<li><a href="http://math.nist.gov/f90gl" target="_parent">Fortran77/90 bindings for OpenGL and Mesa</a> - by William Mitchell
|
||||
<li><a href="http://glow.sourceforge.net/" target="_parent">GLOW</a> - a GUI toolkit for GLUT and OpenGL
|
||||
<li><a href="http://www.nigels.com/glt/">Glt</a> - an OpenGL C++ toolkit
|
||||
<li><a href="http://www.opengl.org/developers/documentation/glut/" target="_parent">GLUT (GL Utility Toolkit)</a> - by Mark Kilgard
|
||||
<li><a href="http://www.opengl.org/resources/libraries/glut.html" target="_parent">GLUT (GL Utility Toolkit)</a> - by Mark Kilgard
|
||||
<li><a href="http://atrey.karlin.mff.cuni.cz/%7E0rfelyus/guileGL/" target="_parent">GuileGL</a> - OpenGL and GtkGLArea language bindings for Guile
|
||||
<li><a href="http://www.rsinc.com/" target="_parent">IDL</a> - Interactive Data Language
|
||||
<li><a href="http://www.newplanetsoftware.com/jx/" target="_parent">JX</a> - C++ application framework and GUI library
|
||||
|
@@ -13,17 +13,18 @@ The Mesa distribution consists of several components. Different copyrights
|
||||
and licenses apply to different components. For example, GLUT is copyrighted
|
||||
by Mark Kilgard, some demo programs are copyrighted by SGI, some of the Mesa
|
||||
device drivers are copyrighted by their authors. See below for a list of
|
||||
Mesa's components and the copyright/license for each.
|
||||
Mesa's main components and the license for each.
|
||||
</p>
|
||||
<p>
|
||||
The core Mesa library is licensed according to the terms of the XFree86
|
||||
copyright (an MIT-style license). This allows integration with the
|
||||
XFree86/DRI project. Unless otherwise stated, the Mesa source code and
|
||||
documentation is licensed as follows:
|
||||
The core Mesa library is licensed according to the terms of the MIT license.
|
||||
This allows integration with the XFree86, Xorg and DRI projects.
|
||||
</p>
|
||||
<p>
|
||||
The default Mesa license is as follows:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
|
||||
Copyright (C) 1999-2005 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"),
|
||||
@@ -47,70 +48,38 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
<H1>Attention, Contributors</H1>
|
||||
|
||||
<p>
|
||||
When contributing to the Mesa project you must agree to relinquish your
|
||||
work to the holder of the copyright for the particular component you're
|
||||
contributing to. That is, you can't put your own copyright on the code,
|
||||
unless it's a modular piece that can be omitted from Mesa (like a new
|
||||
device driver). If for example, you contribute a bug fix to Mesa's
|
||||
texture mapping code, your code will become a part of the body of work
|
||||
which is copyrighted by Brian Paul and licensed by the above terms.
|
||||
When contributing to the Mesa project you must agree to the licensing terms
|
||||
of the component to which you're contributing.
|
||||
The following section lists the primary components of the Mesa distribution
|
||||
and their respective licenses.
|
||||
</p>
|
||||
|
||||
|
||||
<H1>Mesa Component Licenses</H1>
|
||||
|
||||
<pre>
|
||||
Mesa Component Licenses:
|
||||
|
||||
Component Files Primary Author License
|
||||
Component Location Primary Author License
|
||||
----------------------------------------------------------------------------
|
||||
core Mesa code src/*.[ch] Brian Paul Mesa
|
||||
include/GL/gl.h
|
||||
Main Mesa code src/mesa/ Brian Paul Mesa (MIT)
|
||||
|
||||
GLX driver src/X/* Brian Paul Mesa
|
||||
include/GL/glx.h
|
||||
include/GL/xmesa.h
|
||||
Device drivers src/mesa/drivers/* See drivers See drivers
|
||||
|
||||
OS/Mesa driver src/OSmesa/* Brian Paul Mesa
|
||||
include/GL/osmesa.h
|
||||
Ext headers include/GL/glext.h SGI SGI Free B
|
||||
include/GL/glxext.h
|
||||
|
||||
3Dfx driver src/FX/* David Bucciarelli Mesa
|
||||
include/GL/fxmesa.h
|
||||
GLUT src/glut/ Mark Kilgard Mark's copyright
|
||||
|
||||
BeOS R4 driver src/BeOS/* Brian Paul Mesa
|
||||
Mesa GLU library src/glu/mesa/ Brian Paul GNU-LGPL
|
||||
|
||||
MGL driver src/MGL/* SciTech, Inc SciTech copyright
|
||||
include/GL/mglmesa.h
|
||||
SGI GLU library src/glu/sgi/ SGI SGI Free B
|
||||
|
||||
Windows driver src/Windows/* Li Wei copyright by Li Wei
|
||||
include/GL/wmesa.h
|
||||
demo programs progs/demos/ various see source files
|
||||
|
||||
SVGA driver src/SVGA/* Brian Paul GNU-LGPL
|
||||
include/GL/svgamesa.h
|
||||
X demos progs/xdemos/ Brian Paul see source files
|
||||
|
||||
DOS driver src/DOS/* Charlie Wallace GNU-LGPL
|
||||
include/GL/dosmesa.h
|
||||
SGI demos progs/samples/ SGI SGI copyright
|
||||
|
||||
GGI driver src/GGI/* Uwe Maurer GNU-LGPL
|
||||
include/GL/ggimesa.h
|
||||
|
||||
S3 driver src/S3/* S3, Inc. S3 copyright
|
||||
|
||||
GLUT src-glut/* Mark Kilgard Mark's copyright
|
||||
include/GL/*glut*.h
|
||||
|
||||
GLU library src-glu/* Brian Paul GNU-LGPL
|
||||
|
||||
SI GLU library si-glu/* SGI SGI Free B
|
||||
include/GL/glu.h
|
||||
|
||||
Ext registry include/GL/glext.h SGI SGI Free B
|
||||
include/GL/glxext.h
|
||||
|
||||
demo programs demos/* various see source files
|
||||
|
||||
X demos xdemos/* Brian Paul see source files
|
||||
|
||||
SGI demos samples/* SGI SGI copyright
|
||||
|
||||
RedBook demos book/* SGI SGI copyright
|
||||
RedBook demos progs/redbook/ SGI SGI copyright
|
||||
</pre>
|
||||
|
||||
</body>
|
||||
|
@@ -14,7 +14,7 @@
|
||||
</li><li><a href="http://mesa3d.sourceforge.net/notfound.html">ARCAD</a> - CAD program
|
||||
</li><li><a href="http://www.mediascape.com/" target="_parent">Artstream</a> - provides
|
||||
functionality like Corel Draw and Illustrator
|
||||
</li><li><a href="http://www.blender.nl/" target="_parent">Blender</a> - 3-D animation
|
||||
</li><li><a href="http://www.blender.org/" target="_parent">Blender</a> - 3-D animation
|
||||
software
|
||||
</li><li><a href="http://www.arq.net/%7Ekasten/demtools/" target="_parent">Demtools</a>
|
||||
- Map viewer
|
||||
@@ -32,7 +32,7 @@
|
||||
- VRML viewer
|
||||
</li><li><a href="http://aig.cs.man.ac.uk/systems/Maverik/" target="_parent">Maverik</a>
|
||||
- VR graphics and interaction system
|
||||
</li><li><a href="http://www.swissquake.ch/chumb.alum-soft" target="_parent">MD2 Viewer</a>
|
||||
</li><li><a href="http://www.swissquake.ch/chumbalum-soft/md2v" target="_parent">MD2 Viewer</a>
|
||||
- View .MD2 files
|
||||
</li><li><a href="http://www.megacads.dlr.de/" target="_parent">MegaCads</a>
|
||||
- Multiblock-Elliptic-Grid-Generation-And-CAD-System
|
||||
@@ -62,8 +62,6 @@
|
||||
</li><li><a href="http://mesa3d.sourceforge.net/notfound.html">VRweb</a> - VRML browser
|
||||
</li><li><a href="http://www.csv.ica.uni-stuttgart.de/vrml/dune/" target="_parent">white_dune</a>
|
||||
- graphical VRML97 Editor and animation tool
|
||||
</li><li><a href="http://www.wings3d.org/" target="_parent">Wings 3D</a> - static 3D modeller
|
||||
with VRML export. Uses SDL library.
|
||||
</li></ul>
|
||||
|
||||
|
||||
|
154
docs/news.html
154
docs/news.html
@@ -11,6 +11,158 @@
|
||||
<H1>News</H1>
|
||||
|
||||
|
||||
<h2>February 2, 2006</h2>
|
||||
<p>
|
||||
Mesa 6.4.2 has been released. This is primarily a bug-fix release.
|
||||
</p>
|
||||
<pre>
|
||||
New items:
|
||||
- added OSMesaColorClamp() function/feature
|
||||
- added wglGetExtensionStringARB() function
|
||||
Bug fixes:
|
||||
- fixed some problems when building on Windows
|
||||
- GLw header files weren't installed by installmesa script (bug 5396)
|
||||
- GL/glfbdev.h file was missing from tarballs
|
||||
</pre>
|
||||
<p>
|
||||
The MD5 checksums are:
|
||||
</p>
|
||||
<pre>
|
||||
cb0d745d520fa7c2bb9178058b763544 MesaLib-6.4.2.tar.gz
|
||||
7674d2c603b5834259e4e5a820cefd5b MesaLib-6.4.2.tar.bz2
|
||||
d224e1325b33ff71a0f3893fc6b4d594 MesaLib-6.4.2.zip
|
||||
d4b345d4588fc750cd3d34f3ac26673e MesaDemos-6.4.2.tar.gz
|
||||
9cae1ab874af533ce356bd7dfe2e0bb0 MesaDemos-6.4.2.tar.bz2
|
||||
2da6e1d1245e441d27813595c6ba50de MesaDemos-6.4.2.zip
|
||||
84427d18c3453f0ea52388eeba7169b5 MesaGLUT-6.4.2.tar.gz
|
||||
b157ba8ad1ea63260cf5339132e7aac6 MesaGLUT-6.4.2.tar.bz2
|
||||
fe1523744fc05edc3811dfc6a1bf4181 MesaGLUT-6.4.2.zip
|
||||
</pre>
|
||||
|
||||
|
||||
<h2>November 29, 2005</h2>
|
||||
<p>
|
||||
Mesa 6.4.1 has been released. This is a stable, bug-fix release.
|
||||
</p>
|
||||
<pre>
|
||||
Bug fixes:
|
||||
- redefining a vertex program string didn't take effect in TNL module
|
||||
- fixed occasional segfault upon vertex/fragment parsing error
|
||||
- vertex program LIT instruction didn't handle 0^0=1 correctly
|
||||
- fragment program fog option didn't work with glDrawPixels, glBitmap
|
||||
- USE_MGL_NAMESPACE didn't work for x86-64
|
||||
- OSMesa demos were missing from previous release tarballs
|
||||
- fixed problem with float->ushort conversion in glClear (bug 4992)
|
||||
- popping of GL_EYE_PLANE texgen state was broken (bug 4996)
|
||||
- popping of GL_SPOT_DIRECTION light state was broken (bug 5005)
|
||||
- fixed occasional triangle color interpolation problem on VMS
|
||||
- work around invalid free() call (bug 5131)
|
||||
- fixed BSD X server compilation problem by including stdint.h
|
||||
</pre>
|
||||
<p>
|
||||
The MD5 checksums are:
|
||||
</p>
|
||||
<pre>
|
||||
698ceb574cf882b0226761f5913c0da9 MesaLib-6.4.1.tar.gz
|
||||
ea148c828ec6f645526451db1b8556f1 MesaLib-6.4.1.tar.bz2
|
||||
42e93279468975ed2bf3111b8721e5d9 MesaLib-6.4.1.zip
|
||||
e3b0d50807fd2bdcd1a95aaddd786f13 MesaDemos-6.4.1.tar.gz
|
||||
99df1fdcb98d391666b476ca6f1dda8a MesaDemos-6.4.1.tar.bz2
|
||||
b999d2c6d92fb4b7740a3dbd889348e3 MesaDemos-6.4.1.zip
|
||||
eadfe01fe5ddfb1eb8227dd567b31635 MesaGLUT-6.4.1.tar.gz
|
||||
bd003bb4f981a4f91dee4c38644d4f3f MesaGLUT-6.4.1.tar.bz2
|
||||
71c401c037088bf688a88afdaeb3420f MesaGLUT-6.4.1.zip
|
||||
</pre>
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>October 24, 2005</h2>
|
||||
<p>
|
||||
Mesa 6.4 has been released. This is a stable, bug-fix release.
|
||||
</p>
|
||||
<pre>
|
||||
New:
|
||||
- Added a fast XOR line drawing function in Xlib driver
|
||||
- Added support for GL_ARB_texture_mirrored_repeat to savage
|
||||
driver (supported only on Savage4 hardware).
|
||||
Changes:
|
||||
- Mesa now packaged in three parts: Library, Demos and GLUT
|
||||
Bug fixes:
|
||||
- GLX_X_RENDERABLE token wasn't accepted by glXChooseFBConfig
|
||||
- Some files were present multiple times in the 6.3.2 tarballs
|
||||
- r200_vtxtmp_x86.S file was missing from 6.3.2 tarball (bug 4207)
|
||||
- glxgears_fbconfig demo didn't work (bug 4237)
|
||||
- fixed bug when bilinear sampling 2d textures with borders
|
||||
- glXCreatePbuffer() could segfault instead of returning 0 (bug 4235)
|
||||
- fixed undefined frexp and rand in X.org libGLcore.a (bug 4242)
|
||||
- fixed a few problems with proxy color tables (bug 4270)
|
||||
- fixed precision problem in Z clearing (bug 4395)
|
||||
- glBitmap, glDraw/CopyPixels mistakenly generated selection hits
|
||||
- fixed potential segfault caused by reading pixels outside
|
||||
of renderbuffer bounds
|
||||
- glGetTexLevelParameter didn't accept GL_TEXTURE_DEPTH_SIZE_ARB
|
||||
- fixed memory corruption bug involving software alpha buffers
|
||||
- glReadPixels clipped by window bounds was sometimes broken
|
||||
- glDraw/CopyPixels of stencil data ignored the stencil write mask
|
||||
- glReadPixels from a texture bound to a framebuffer object didn't work
|
||||
- glIsRender/FramebufferEXT weren't totally correct
|
||||
- fixed a number of point size attenuation/fade bugs
|
||||
- fixed glFogCoord bug 4729
|
||||
- GLX encoding for transpose matrix functions was broken
|
||||
- fixed broken fragment program KIL and SWZ instructions
|
||||
</pre>
|
||||
<p>
|
||||
The MD5 checksums are:
|
||||
</p>
|
||||
<pre>
|
||||
1cce0c1eb4fd15e9dfe837a1ce0c9812 MesaLib-6.4.tar.gz
|
||||
85a84e47a3f718f752f306b9e0954ef6 MesaLib-6.4.tar.bz2
|
||||
b976fea4f3ee06354c53f91b6e3f2ffc MesaLib-6.4.zip
|
||||
d8734f2c69bcf7ef9f5ae454a85743ba MesaDemos-6.4.tar.gz
|
||||
1a8c4d4fc699233f5fdb902b8753099e MesaDemos-6.4.tar.bz2
|
||||
607ab7c7a7de0cc5febbdde2bfa03098 MesaDemos-6.4.zip
|
||||
3260156f66174322a092be0767962d34 MesaGLUT-6.4.tar.gz
|
||||
0465d053f83775f44a12dec4050dfd78 MesaGLUT-6.4.tar.bz2
|
||||
02abfcdcdf72ba938ae00f6e3b70fbe0 MesaGLUT-6.4.zip
|
||||
</pre>
|
||||
|
||||
|
||||
<h2>August 19, 2005</h2>
|
||||
<p>
|
||||
Mesa 6.3.2 has been released.
|
||||
Note: there was no public release of version 6.3.1.
|
||||
</p>
|
||||
<pre>
|
||||
New:
|
||||
- The distribution now includes the DRI drivers and GLX code
|
||||
Changes:
|
||||
- Made the DRI "new" driver interface standard, remove old code
|
||||
Bug fixes:
|
||||
- GL_ARB_vertex/fragment_shader were mistakenly listed in the
|
||||
extensions string
|
||||
- negative relative addressing in vertex programs was broken
|
||||
- update/fix SPARC assembly code for vertex transformation
|
||||
- fixed memory leak when freeing GLX drawables/renderbuffers
|
||||
- fixed display list memory leak
|
||||
- the GL_PIXEL_MAP_I_TO_I table is now floating point, not integer
|
||||
- wglGetProcAddress() didn't handle wgl-functions
|
||||
- fixed glxext.h cross-compile issue (Colin Harrison)
|
||||
- assorted DRI driver fixes
|
||||
</pre>
|
||||
<p>
|
||||
The MD5 checksums are:
|
||||
</p>
|
||||
<pre>
|
||||
98192e45ed8d69113688f89f90869346 MesaLib-6.3.2.tar.gz
|
||||
0df27701df0924d17ddf41185efa8ce1 MesaLib-6.3.2.tar.bz2
|
||||
ccb2423aab77fc7e81ce628734586140 MesaLib-6.3.2.zip
|
||||
9d0fca0a7d051c34a0b485423fb3e85d MesaDemos-6.3.2.tar.gz
|
||||
96708868450c188205e42229b5d813c4 MesaDemos-6.3.2.tar.bz2
|
||||
c5102501e609aa8996d832fafacb8ab9 MesaDemos-6.3.2.zip
|
||||
</pre>
|
||||
|
||||
|
||||
<h2>July 20, 2005</h2>
|
||||
<p>
|
||||
Mesa 6.3 has been released.
|
||||
@@ -1016,6 +1168,6 @@ source code</a>.</p>
|
||||
|
||||
|
||||
<hr>
|
||||
$Id: news.html,v 3.22 2005/07/20 18:20:45 brianp Exp $
|
||||
$Id: news.html,v 3.26 2006/02/03 17:21:54 brianp Exp $
|
||||
</body>
|
||||
</html>
|
||||
|
@@ -13,7 +13,10 @@ The release notes summarize what's new or changed in each Mesa release.
|
||||
</p>
|
||||
|
||||
<UL>
|
||||
<LI><A HREF="RELNOTES-6.3.1">RELNOTES-6.3.1</A>
|
||||
<LI><A HREF="RELNOTES-6.4.2">RELNOTES-6.4.2</A>
|
||||
<LI><A HREF="RELNOTES-6.4.1">RELNOTES-6.4.1</A>
|
||||
<LI><A HREF="RELNOTES-6.4">RELNOTES-6.4</A>
|
||||
<LI><A HREF="RELNOTES-6.3.2">RELNOTES-6.3.2</A>
|
||||
<LI><A HREF="RELNOTES-6.3">RELNOTES-6.3</A>
|
||||
<LI><A HREF="RELNOTES-6.2.1">RELNOTES-6.2.1</A>
|
||||
<LI><A HREF="RELNOTES-6.2">RELNOTES-6.2</A>
|
||||
|
@@ -14,98 +14,43 @@ supported on those systems. All you need is an ANSI C compiler and the
|
||||
X development environment to use Mesa.
|
||||
</p>
|
||||
|
||||
<p>Others have contributed drivers
|
||||
for the Amiga, Apple Macintosh, BeOS, NeXT, OS/2, MS-DOS, VMS, Windows
|
||||
<p>
|
||||
The DRI hardware drivers for the X.org server and XFree86 provide
|
||||
hardware accelerated rendering for chips from ATI, Intel, Matrox, 3dfx
|
||||
and others on Linux and FreeBSD.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Drivers for other assorted platforms include:
|
||||
the Amiga, Apple Macintosh, BeOS, NeXT, OS/2, MS-DOS, VMS, Windows
|
||||
9x/NT, and Direct3D.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The following files describe the details for various platforms.
|
||||
Be warned, some of these files (and drivers) may be very out of date.
|
||||
Details about particular drivers follows.
|
||||
Be warned that some drivers may be out of date and no longer function.
|
||||
</p>
|
||||
|
||||
<UL>
|
||||
<LI><A HREF="README.X11">README.X11</A> - X Window System / Unix / Linux
|
||||
<LI><A HREF="README.WIN32">README.WIN32</A> - Microsoft Windows
|
||||
<LI><A HREF="README.VMS">README.VMS</A> - DEC VMS
|
||||
<LI><A HREF="README.GGI">README.GGI</A> - GGI
|
||||
<LI><A HREF="README.3DFX">README.3DFX</A> - 3Dfx/Glide driver
|
||||
<LI><A HREF="README.AMIWIN">README.AMIWIN</A> - Amiga Amiwin
|
||||
<LI><A HREF="README.BEOS">README.BEOS</A> - BeOS
|
||||
<LI><A HREF="README.D3D">README.D3D</A> - Direct3D driver
|
||||
<LI><A HREF="README.DJ">README.DJ</A> - DJGPP
|
||||
<LI><A HREF="README.LYNXOS">README.LYNXOS</A> - LynxOS
|
||||
<LI><A HREF="README.MINGW32">README.MINGW32</A> - Mingw32
|
||||
<LI><A HREF="README.NeXT">README.NeXT</A> - NeXT
|
||||
<LI><A HREF="README.OpenStep">README.OpenStep</A> - OpenStep
|
||||
<LI><A HREF="README.OS2">README.OS2</A> - OS/2
|
||||
<LI><A HREF="README.WINDML">README.WINDML</A> - WindML
|
||||
<LI>Xlib driver for the X Window System <A HREF="README.X11">(README.X11)</A>
|
||||
<li><a href="http://dri.freedesktop.org/" target="_parent">
|
||||
DRI hardware drivers</a> for the X window system
|
||||
<LI>Microsoft Windows <A HREF="README.WIN32">(README.WIN32)</A>
|
||||
<LI>DEC VMS <A HREF="README.VMS">(README.VMS)</A>
|
||||
<LI>3dfx/Glide <A HREF="README.3DFX">(README.3DFX)</A>
|
||||
<LI>GGI <A HREF="README.GGI">(README.GGI)</A>
|
||||
<LI>Amiga Amiwin <A HREF="README.AMIWIN">(README.AMIWIN)</A>
|
||||
<LI>BeOS <A HREF="README.BEOS">(README.BEOS)</A>
|
||||
<LI>Direct3D driver <A HREF="README.D3D">(README.D3D)</A>
|
||||
<LI>DJGPP <A HREF="README.DJ">(README.DJ)</A>
|
||||
<LI>LynxOS <A HREF="README.LYNXOS">(README.LYNXOS)</A>
|
||||
<LI>Mingw32 <A HREF="README.MINGW32">(README.MINGW32)</A>
|
||||
<LI>NeXT <A HREF="README.NeXT">(README.NeXT)</A>
|
||||
<LI>OpenStep <A HREF="README.OpenStep">(README.OpenStep)</A>
|
||||
<LI>OS/2 <A HREF="README.OS2">(README.OS2)</A>
|
||||
<LI>WindML <A HREF="README.WINDML">(README.WINDML)</A>
|
||||
<LI><a href="http://utah-glx.sourceforge.net/" target="_parent">Utah GLX drivers</a>
|
||||
</UL>
|
||||
|
||||
|
||||
<p>
|
||||
The standard Mesa distribution only supports software-based rendering, with
|
||||
the exception of the 3Dfx Glide driver.
|
||||
Information about other hardware support follows.
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>DRI-based hardware support for 3dfx, Intel, Matrox, ATI with XFree86
|
||||
<blockquote>
|
||||
<p>The <a href="http://dri.sourceforge.net/" target="_parent">DRI architecture</a>,
|
||||
originally developed by Precision Insight, Inc. uses Mesa and
|
||||
provides hardware acceleration for a number of popular chipsets.<br>
|
||||
<br>
|
||||
The DRI is part of XFree86 4.0 and later.
|
||||
<br><br>
|
||||
If you download and install XFree86 4.x you do not need to
|
||||
install Mesa separately. All the important parts of Mesa
|
||||
will be installed with the rest of XFree86.
|
||||
</blockquote>
|
||||
|
||||
|
||||
<li>3dfx Voodoo1, Voodoo2, Voodoo Rush, Voodoo Banshee, Voodoo3
|
||||
<blockquote>
|
||||
<p>All cards based on these chipsets should work with Linux and
|
||||
Windows 95 via 3dfx's Glide library.
|
||||
The Mesa/Glide driver is included with the Mesa distribution.
|
||||
You'll need to install the Glide header files and runtime library.
|
||||
</p>
|
||||
<p>
|
||||
David Bucciarelli wrote the original 3dfx driver for Mesa.<br>
|
||||
Daryll Strauss ported Glide to Linux.
|
||||
</p>
|
||||
</blockquote>
|
||||
|
||||
|
||||
<li>Matrox G200/G400, nVidia RIVA, ATI Rage Pro, Intel i810 on Linux
|
||||
<blockquote>
|
||||
<p>The <a href="http://utah-glx.sourceforge.net/" target="_parent">
|
||||
Utah GLX project</a>
|
||||
(no longer active) developed drivers for these chipsets and others.
|
||||
</blockquote>
|
||||
|
||||
<li>Amiga Warp3D
|
||||
<blockquote>
|
||||
<p>Amiga systems can support 3D hardware with the Warp3D API.
|
||||
See <a href="http://www.haage-partner.com/3dworld" target="_parent">here</a>.
|
||||
</blockquote>
|
||||
|
||||
<li>Also see
|
||||
<blockquote>
|
||||
<p><a href="http://www.linux3d.org/" target="_parent">www.linux3d.org</a> for
|
||||
other 3D hardware info for Linux.
|
||||
</blockquote>
|
||||
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
<b><em>Note:</em></b>
|
||||
If you have NVIDIA hardware in your computer,
|
||||
you should download and install NVIDIA's OpenGL library. You may
|
||||
however, want to download Mesa in order to use its GLU and GLUT
|
||||
libraries, or assorted demo programs.</p>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
@@ -2231,6 +2231,68 @@ typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEATIPROC) (GLenum modeRGB, GLen
|
||||
#endif /* GL_ATI_blend_equation_separate */
|
||||
|
||||
|
||||
|
||||
#ifndef GL_EXT_timer_query
|
||||
#define GL_EXT_timer_query 1
|
||||
|
||||
/* Define 64-bit types */
|
||||
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
||||
typedef long long int GLint64EXT;
|
||||
typedef unsigned long long int GLuint64EXT;
|
||||
#elif defined(_WIN32)
|
||||
typedef __int64 GLint64EXT;
|
||||
typedef unsigned __int64 GLuint64EXT;
|
||||
#else
|
||||
/* this might actually be a 32-bit type */
|
||||
typedef long int GLint64EXT;
|
||||
typedef unsigned long int GLuint64EXT;
|
||||
#endif
|
||||
|
||||
#define GL_TIME_ELAPSED_EXT 0x88BF
|
||||
|
||||
GLAPI void GLAPIENTRY glGetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64EXT *params);
|
||||
GLAPI void GLAPIENTRY glGetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64EXT *params);
|
||||
|
||||
typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT *params);
|
||||
typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT *params);
|
||||
|
||||
#endif /* GL_EXT_timer_query */
|
||||
|
||||
|
||||
|
||||
#ifndef GL_EXT_framebuffer_blit
|
||||
#define GL_EXT_framebuffer_blit 1
|
||||
|
||||
#define GL_READ_FRAMEBUFFER_EXT 0x8CA8
|
||||
#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9
|
||||
#define GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CA6
|
||||
#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA
|
||||
|
||||
GLAPI void GLAPIENTRY
|
||||
glBlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
|
||||
GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
|
||||
GLbitfield mask, GLenum filter);
|
||||
|
||||
typedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC)
|
||||
(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
|
||||
GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
|
||||
GLbitfield mask, GLenum filter);
|
||||
|
||||
#endif /* GL_EXT_framebuffer_blit */
|
||||
|
||||
|
||||
|
||||
#ifndef GL_EXT_packed_depth_stencil
|
||||
#define GL_EXT_packed_depth_stencil 1
|
||||
|
||||
#define GL_DEPTH_STENCIL_EXT 0x84F9
|
||||
#define GL_UNSIGNED_INT_24_8_EXT 0x84FA
|
||||
#define GL_DEPTH24_STENCIL8_EXT 0x88F0
|
||||
#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1
|
||||
|
||||
#endif /* GL_EXT_packed_depth_stencil */
|
||||
|
||||
|
||||
/**
|
||||
** NOTE!!!!! If you add new functions to this file, or update
|
||||
** glext.h be sure to regenerate the gl_mangle.h file. See comments
|
||||
|
@@ -520,8 +520,10 @@
|
||||
#define glGetProgramStringNV MANGLE(GetProgramStringNV)
|
||||
#define glGetQueryivARB MANGLE(GetQueryivARB)
|
||||
#define glGetQueryiv MANGLE(GetQueryiv)
|
||||
#define glGetQueryObjecti64vEXT MANGLE(GetQueryObjecti64vEXT)
|
||||
#define glGetQueryObjectivARB MANGLE(GetQueryObjectivARB)
|
||||
#define glGetQueryObjectiv MANGLE(GetQueryObjectiv)
|
||||
#define glGetQueryObjectui64vEXT MANGLE(GetQueryObjectui64vEXT)
|
||||
#define glGetQueryObjectuivARB MANGLE(GetQueryObjectuivARB)
|
||||
#define glGetQueryObjectuiv MANGLE(GetQueryObjectuiv)
|
||||
#define glGetRenderbufferParameterivEXT MANGLE(GetRenderbufferParameterivEXT)
|
||||
|
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 5.1
|
||||
* Version: 6.5
|
||||
*
|
||||
* Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 1999-2005 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"),
|
||||
@@ -65,7 +65,7 @@ glFBDevGetString( int str );
|
||||
typedef void (*GLFBDevProc)();
|
||||
|
||||
|
||||
extern const GLFBDevProc
|
||||
extern GLFBDevProc
|
||||
glFBDevGetProcAddress( const char *procName );
|
||||
|
||||
|
||||
|
206
include/GL/glx.h
206
include/GL/glx.h
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 6.3
|
||||
* Version: 6.5
|
||||
*
|
||||
* Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
|
||||
*
|
||||
@@ -302,138 +302,6 @@ extern void (*glXGetProcAddress(const GLubyte *procname))( void );
|
||||
#else
|
||||
|
||||
|
||||
/*
|
||||
* 28. GLX_EXT_visual_info extension
|
||||
*/
|
||||
#ifndef GLX_EXT_visual_info
|
||||
#define GLX_EXT_visual_info 1
|
||||
|
||||
#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_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_NONE_EXT 0x8000
|
||||
#define GLX_TRANSPARENT_RGB_EXT 0x8008
|
||||
#define GLX_TRANSPARENT_INDEX_EXT 0x8009
|
||||
|
||||
#endif /* 28. GLX_EXT_visual_info extension */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* 41. GLX_SGI_video_sync
|
||||
*/
|
||||
#ifndef GLX_SGI_video_sync
|
||||
#define GLX_SGI_video_sync 1
|
||||
|
||||
extern int glXGetVideoSyncSGI(unsigned int *count);
|
||||
extern int glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count);
|
||||
|
||||
#endif /* GLX_SGI_video_sync */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* 42. GLX_EXT_visual_rating
|
||||
*/
|
||||
#ifndef GLX_EXT_visual_rating
|
||||
#define GLX_EXT_visual_rating 1
|
||||
|
||||
#define GLX_VISUAL_CAVEAT_EXT 0x20
|
||||
/*#define GLX_NONE_EXT 0x8000*/
|
||||
#define GLX_SLOW_VISUAL_EXT 0x8001
|
||||
#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D
|
||||
|
||||
#endif /* GLX_EXT_visual_rating */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* 47. GLX_EXT_import_context
|
||||
*/
|
||||
#ifndef GLX_EXT_import_context
|
||||
#define GLX_EXT_import_context 1
|
||||
|
||||
#define GLX_SHARE_CONTEXT_EXT 0x800A
|
||||
#define GLX_VISUAL_ID_EXT 0x800B
|
||||
#define GLX_SCREEN_EXT 0x800C
|
||||
|
||||
extern void glXFreeContextEXT(Display *dpy, GLXContext context);
|
||||
|
||||
extern GLXContextID glXGetContextIDEXT(const GLXContext context);
|
||||
|
||||
extern Display *glXGetCurrentDisplayEXT(void);
|
||||
|
||||
extern GLXContext glXImportContextEXT(Display *dpy, GLXContextID contextID);
|
||||
|
||||
extern int glXQueryContextInfoEXT(Display *dpy, GLXContext context,
|
||||
int attribute,int *value);
|
||||
|
||||
#endif /* GLX_EXT_import_context */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* 215. GLX_MESA_copy_sub_buffer
|
||||
*/
|
||||
#ifndef GLX_MESA_copy_sub_buffer
|
||||
#define GLX_MESA_copy_sub_buffer 1
|
||||
|
||||
extern void glXCopySubBufferMESA( Display *dpy, GLXDrawable drawable,
|
||||
int x, int y, int width, int height );
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* 216. GLX_MESA_pixmap_colormap
|
||||
*/
|
||||
#ifndef GLX_MESA_pixmap_colormap
|
||||
#define GLX_MESA_pixmap_colormap 1
|
||||
|
||||
extern GLXPixmap glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visual,
|
||||
Pixmap pixmap, Colormap cmap );
|
||||
|
||||
#endif /* GLX_MESA_pixmap_colormap */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* 217. GLX_MESA_release_buffers
|
||||
*/
|
||||
#ifndef GLX_MESA_release_buffers
|
||||
#define GLX_MESA_release_buffers 1
|
||||
|
||||
extern Bool glXReleaseBuffersMESA( Display *dpy, GLXDrawable d );
|
||||
|
||||
#endif /* GLX_MESA_release_buffers */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* 218. GLX_MESA_set_3dfx_mode
|
||||
*/
|
||||
#ifndef GLX_MESA_set_3dfx_mode
|
||||
#define GLX_MESA_set_3dfx_mode 1
|
||||
|
||||
#define GLX_3DFX_WINDOW_MODE_MESA 0x1
|
||||
#define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2
|
||||
|
||||
extern Bool glXSet3DfxModeMESA( int mode );
|
||||
|
||||
#endif /* GLX_MESA_set_3dfx_mode */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* ARB 2. GLX_ARB_get_proc_address
|
||||
@@ -441,7 +309,8 @@ extern Bool glXSet3DfxModeMESA( int mode );
|
||||
#ifndef GLX_ARB_get_proc_address
|
||||
#define GLX_ARB_get_proc_address 1
|
||||
|
||||
extern void (*glXGetProcAddressARB(const GLubyte *procName))();
|
||||
typedef void (*__GLXextFuncPtr)(void);
|
||||
extern __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *);
|
||||
|
||||
#endif /* GLX_ARB_get_proc_address */
|
||||
|
||||
@@ -469,19 +338,6 @@ typedef void ( * PFNGLXFREEMEMORYNVPROC) (GLvoid *pointer);
|
||||
#endif /* GLX_NV_vertex_array_range */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* ???. GLX_MESA_agp_offset
|
||||
*/
|
||||
#ifndef GLX_MESA_agp_offset
|
||||
#define GLX_MESA_agp_offset 1
|
||||
|
||||
extern GLuint glXGetAGPOffsetMESA(const GLvoid *pointer);
|
||||
typedef GLuint (* PFNGLXGETAGPOFFSETMESAPROC) (const GLvoid *pointer);
|
||||
|
||||
#endif /* GLX_MESA_agp_offset */
|
||||
|
||||
|
||||
/*
|
||||
* ???. GLX_MESA_allocate_memory
|
||||
*/
|
||||
@@ -497,8 +353,10 @@ typedef GLuint (* PFNGLXGETMEMORYOFFSETMESAPROC) (Display *dpy, int scrn, const
|
||||
|
||||
#endif /* GLX_MESA_allocate_memory */
|
||||
|
||||
|
||||
/*
|
||||
* ARB ?. GLX_ARB_render_texture
|
||||
* XXX This was never finalized!
|
||||
*/
|
||||
#ifndef GLX_ARB_render_texture
|
||||
#define GLX_ARB_render_texture 1
|
||||
@@ -521,6 +379,60 @@ extern Bool glXDrawableAttribARB(Display *dpy, GLXDrawable draw, const int *attr
|
||||
#endif /* GLX_NV_float_buffer */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* #?. GLX_MESA_swap_frame_usage
|
||||
*/
|
||||
#ifndef GLX_MESA_swap_frame_usage
|
||||
#define GLX_MESA_swap_frame_usage 1
|
||||
|
||||
extern int glXGetFrameUsageMESA(Display *dpy, GLXDrawable drawable, float *usage);
|
||||
extern int glXBeginFrameTrackingMESA(Display *dpy, GLXDrawable drawable);
|
||||
extern int glXEndFrameTrackingMESA(Display *dpy, GLXDrawable drawable);
|
||||
extern int glXQueryFrameTrackingMESA(Display *dpy, GLXDrawable drawable, int64_t *swapCount, int64_t *missedFrames, float *lastMissedUsage);
|
||||
|
||||
typedef int (*PFNGLXGETFRAMEUSAGEMESAPROC) (Display *dpy, GLXDrawable drawable, float *usage);
|
||||
typedef int (*PFNGLXBEGINFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable);
|
||||
typedef int (*PFNGLXENDFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable);
|
||||
typedef int (*PFNGLXQUERYFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable, int64_t *swapCount, int64_t *missedFrames, float *lastMissedUsage);
|
||||
|
||||
#endif /* GLX_MESA_swap_frame_usage */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* #?. GLX_MESA_swap_control
|
||||
*/
|
||||
#ifndef GLX_MESA_swap_control
|
||||
#define GLX_MESA_swap_control 1
|
||||
|
||||
extern int glXSwapIntervalMESA(unsigned int interval);
|
||||
extern int glXGetSwapIntervalMESA(void);
|
||||
|
||||
typedef int (*PFNGLXSWAPINTERVALMESAPROC)(unsigned int interval);
|
||||
typedef int (*PFNGLXGETSWAPINTERVALMESAPROC)(void);
|
||||
|
||||
#endif /* GLX_MESA_swap_control */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* #?. GLX_EXT_texture_from_pixmap
|
||||
* XXX not finished?
|
||||
*/
|
||||
#ifndef GLX_EXT_texture_from_pixmap
|
||||
#define GLX_EXT_texture_from_pixmap 1
|
||||
|
||||
/* XXX need enums/tokens! */
|
||||
|
||||
extern Bool glXBindTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer);
|
||||
extern Bool glXReleaseTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer);
|
||||
|
||||
#endif /* GLX_EXT_texture_from_pixmap */
|
||||
|
||||
|
||||
|
||||
|
||||
/*** Should these go here, or in another header? */
|
||||
/*
|
||||
** GLX Events
|
||||
|
@@ -331,7 +331,7 @@ typedef struct {
|
||||
} GLXBufferClobberEventSGIX;
|
||||
#endif
|
||||
|
||||
#if defined(__sun__)
|
||||
#if defined(__sun__) || defined(__osf__)
|
||||
#include <inttypes.h>
|
||||
#if defined(__STDC__)
|
||||
#if defined(__arch64__)
|
||||
@@ -347,6 +347,8 @@ typedef long long int int64_t;
|
||||
#include <inttypes.h>
|
||||
#elif defined(__SCO__) || defined(__USLC__)
|
||||
#include <stdint.h>
|
||||
#elif defined(WIN32) && defined(__GNUC__)
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
#ifndef GLX_VERSION_1_3
|
||||
|
@@ -38,14 +38,7 @@
|
||||
#ifndef DRI_INTERFACE_H
|
||||
#define DRI_INTERFACE_H
|
||||
|
||||
#if 0 /*ndef DRI_NEW_INTERFACE_ONLY*/
|
||||
# include <X11/X.h>
|
||||
# include <GL/glx.h>
|
||||
# include "GL/glxint.h"
|
||||
#endif
|
||||
|
||||
#include <GL/internal/glcore.h>
|
||||
#include <xf86drm.h>
|
||||
#include <drm.h>
|
||||
|
||||
/**
|
||||
|
@@ -111,6 +111,15 @@ WGLAPI int GLAPIENTRY DescribePixelFormat(HDC,int,unsigned int,LPPIXELFORMATDE
|
||||
WGLAPI int GLAPIENTRY GetPixelFormat(HDC);
|
||||
WGLAPI int GLAPIENTRY SetPixelFormat(HDC,int,const PIXELFORMATDESCRIPTOR *);
|
||||
|
||||
|
||||
#ifndef WGL_ARB_extensions_string
|
||||
#define WGL_ARB_extensions_string 1
|
||||
|
||||
WGLAPI const char * GLAPIENTRY wglGetExtensionsStringARB(HDC hdc);
|
||||
|
||||
#endif /* WGL_ARB_extensions_string */
|
||||
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning( pop )
|
||||
#endif
|
||||
|
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 6.3
|
||||
* Version: 6.5
|
||||
*
|
||||
* Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 1999-2005 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"),
|
||||
@@ -61,7 +61,7 @@ extern "C" {
|
||||
|
||||
|
||||
#define OSMESA_MAJOR_VERSION 6
|
||||
#define OSMESA_MINOR_VERSION 3
|
||||
#define OSMESA_MINOR_VERSION 5
|
||||
#define OSMESA_PATCH_VERSION 0
|
||||
|
||||
|
||||
@@ -267,6 +267,15 @@ GLAPI OSMESAproc GLAPIENTRY
|
||||
OSMesaGetProcAddress( const char *funcName );
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Enable/disable color clamping, off by default.
|
||||
* New in Mesa 6.4.2
|
||||
*/
|
||||
GLAPI void GLAPIENTRY
|
||||
OSMesaColorClamp(GLboolean enable);
|
||||
|
||||
|
||||
#if defined(__BEOS__) || defined(__QUICKDRAW__)
|
||||
#pragma export off
|
||||
#endif
|
||||
|
@@ -78,7 +78,7 @@ typedef struct wmesa_context *WMesaContext;
|
||||
* appropriate colormap.
|
||||
*
|
||||
* Input:
|
||||
* hWnd - Window handle
|
||||
* hDC - Windows device or memory context
|
||||
* Pal - Palette to use
|
||||
* rgb_flag - GL_TRUE = RGB mode,
|
||||
* GL_FALSE = color index mode
|
||||
@@ -91,7 +91,7 @@ typedef struct wmesa_context *WMesaContext;
|
||||
*
|
||||
* Return: a WMesa_context or NULL if error.
|
||||
*/
|
||||
extern WMesaContext WMesaCreateContext(HWND hWnd,HPALETTE* pPal,
|
||||
extern WMesaContext WMesaCreateContext(HDC hDC,HPALETTE* pPal,
|
||||
GLboolean rgb_flag,
|
||||
GLboolean db_flag,
|
||||
GLboolean alpha_flag);
|
||||
|
@@ -64,9 +64,7 @@
|
||||
** Versioning and extensions
|
||||
*/
|
||||
#define EGL_VERSION_1_0 1
|
||||
#if 0
|
||||
#define EGL_VERSION_1_1 1
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Boolean
|
||||
@@ -235,21 +233,23 @@ GLAPI EGLBoolean APIENTRY eglCopyBuffers (EGLDisplay dpy, EGLSurface surface, Na
|
||||
#ifndef EGL_MESA_screen_surface
|
||||
#define EGL_MESA_screen_surface 1
|
||||
|
||||
#define EGL_BAD_SCREEN_MESA 0x4000
|
||||
#define EGL_BAD_MODE_MESA 0x4001
|
||||
#define EGL_SCREEN_COUNT_MESA 0x4002
|
||||
#define EGL_SCREEN_POSITION_MESA 0x4003
|
||||
#define EGL_MODE_ID_MESA 0x4004
|
||||
#define EGL_REFRESH_RATE_MESA 0x4005
|
||||
#define EGL_OPTIMAL_MODE_MESA 0x4006
|
||||
#define EGL_SCREEN_BIT_MESA 0x08
|
||||
#define EGL_BAD_SCREEN_MESA 0x4000
|
||||
#define EGL_BAD_MODE_MESA 0x4001
|
||||
#define EGL_SCREEN_COUNT_MESA 0x4002
|
||||
#define EGL_SCREEN_POSITION_MESA 0x4003
|
||||
#define EGL_SCREEN_POSITION_GRANULARITY_MESA 0x4004
|
||||
#define EGL_MODE_ID_MESA 0x4005
|
||||
#define EGL_REFRESH_RATE_MESA 0x4006
|
||||
#define EGL_OPTIMAL_MESA 0x4007
|
||||
#define EGL_INTERLACED_MESA 0x4008
|
||||
#define EGL_SCREEN_BIT_MESA 0x08
|
||||
|
||||
GLAPI EGLBoolean APIENTRY eglChooseModeMESA(EGLDisplay dpy, EGLScreenMESA screen, const EGLint *attrib_list, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes);
|
||||
GLAPI EGLBoolean APIENTRY eglGetModesMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes);
|
||||
GLAPI EGLBoolean APIENTRY eglGetModeAttribMESA(EGLDisplay dpy, EGLModeMESA mode, EGLint attribute, EGLint *value);
|
||||
GLAPI EGLBoolean APIENTRY eglGetScreensMESA(EGLDisplay dpy, EGLScreenMESA *screens, EGLint max_screens, EGLint *num_screens);
|
||||
GLAPI EGLSurface APIENTRY eglCreateScreenSurfaceMESA(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list);
|
||||
GLAPI EGLBoolean APIENTRY eglShowSurfaceMESA(EGLDisplay dpy, EGLint screen, EGLSurface surface, EGLModeMESA mode);
|
||||
GLAPI EGLBoolean APIENTRY eglShowScreenSurfaceMESA(EGLDisplay dpy, EGLint screen, EGLSurface surface, EGLModeMESA mode);
|
||||
GLAPI EGLBoolean APIENTRY eglScreenPositionMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLint x, EGLint y);
|
||||
GLAPI EGLBoolean APIENTRY eglQueryScreenMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLint attribute, EGLint *value);
|
||||
GLAPI EGLBoolean APIENTRY eglQueryScreenSurfaceMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLSurface *surface);
|
||||
@@ -267,6 +267,56 @@ GLAPI EGLBoolean APIENTRY eglCopyContextMESA(EGLDisplay dpy, EGLContext source,
|
||||
#endif /* EGL_MESA_copy_context */
|
||||
|
||||
|
||||
/* XXX this is preliminary! */
|
||||
#ifndef EGL_VERSION_1_2
|
||||
#define EGL_VERSION_1_2 1
|
||||
|
||||
typedef int EGLenum;
|
||||
typedef int EGLClientBuffer;
|
||||
|
||||
#define EGL_DISPLAY_SCALING 10000
|
||||
#define EGL_UNKNOWN ((EGLint)-1)
|
||||
|
||||
#define EGL_OPENGL_ES_BIT 0x1
|
||||
#define EGL_OPENVG_BIT 0x2
|
||||
|
||||
#define EGL_OPENGL_ES_API 0x30A0
|
||||
#define EGL_OPENVG_API 0x30A1
|
||||
|
||||
#define EGL_LUMINANCE_SIZE 0x303D
|
||||
#define EGL_ALPHA_MASK_SIZE 0x303E
|
||||
#define EGL_COLOR_BUFFER_TYPE 0x303F
|
||||
#define EGL_RENDERABLE_TYPE 0x3040
|
||||
|
||||
#define EGL_SINGLE_BUFFER 0x3085
|
||||
#define EGL_RENDER_BUFFER 0x3086
|
||||
#define EGL_COLORSPACE 0x3087
|
||||
#define EGL_ALPHA_FORMAT 0x3088
|
||||
#define EGL_COLORSPACE_sRGB 0x3089
|
||||
#define EGL_COLORSPACE_LINEAR 0x308A
|
||||
#define EGL_ALPHA_FORMAT_NONPRE 0x308B
|
||||
#define EGL_ALPHA_FORMAT_PRE 0x308C
|
||||
#define EGL_CLIENT_APIS 0x308D
|
||||
#define EGL_RGB_BUFFER 0x308E
|
||||
#define EGL_LUMINANCE_BUFFER 0x308F
|
||||
#define EGL_HORIZONTAL_RESOLUTION 0x3090
|
||||
#define EGL_VERTICAL_RESOLUTION 0x3091
|
||||
#define EGL_PIXEL_ASPECT_RATIO 0x3092
|
||||
#define EGL_SWAP_BEHAVIOR 0x3093
|
||||
#define EGL_BUFFER_PRESERVED 0x3094
|
||||
#define EGL_BUFFER_DESTROYED 0x3095
|
||||
#define EGL_OPENVG_IMAGE 0x3096
|
||||
#define EGL_CONTEXT_CLIENT_TYPE 0x3097
|
||||
|
||||
GLAPI EGLBoolean APIENTRY eglBindAPI(EGLenum api);
|
||||
GLAPI EGLenum APIENTRY eglQueryAPI(void);
|
||||
GLAPI EGLBoolean APIENTRY eglWaitClient(void);
|
||||
GLAPI EGLBoolean APIENTRY eglReleaseThread(void);
|
||||
GLAPI EGLSurface APIENTRY eglCreatePbufferFromClientBuffer(EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list);
|
||||
|
||||
#endif /* EGL_VERSION_1_2 */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -15,6 +15,7 @@ LIB_DEP = $(LIB_DIR)/$(GL_LIB_NAME) $(LIB_DIR)/$(GLU_LIB_NAME) $(LIB_DIR)/$(GLUT
|
||||
|
||||
PROGS = \
|
||||
arbfplight \
|
||||
arbfslight \
|
||||
arbocclude \
|
||||
bounce \
|
||||
clearspd \
|
||||
@@ -24,10 +25,12 @@ PROGS = \
|
||||
fogcoord \
|
||||
fplight \
|
||||
gamma \
|
||||
gearbox \
|
||||
gears \
|
||||
geartrain \
|
||||
glinfo \
|
||||
gloss \
|
||||
glslnoise.c \
|
||||
gltestperf \
|
||||
glutfx \
|
||||
isosurf \
|
||||
@@ -37,13 +40,13 @@ PROGS = \
|
||||
multiarb \
|
||||
occlude \
|
||||
paltex \
|
||||
pixeltex \
|
||||
pointblast \
|
||||
ray \
|
||||
readpix \
|
||||
reflect \
|
||||
renormal \
|
||||
shadowtex \
|
||||
singlebuffer \
|
||||
spectex \
|
||||
spriteblast \
|
||||
stex3d \
|
||||
@@ -73,8 +76,9 @@ PROGS = \
|
||||
|
||||
##### TARGETS #####
|
||||
|
||||
default: readtex.o $(PROGS)
|
||||
default: $(PROGS)
|
||||
|
||||
$(PROGS): readtex.o
|
||||
|
||||
readtex.c: $(TOP)/progs/util/readtex.c
|
||||
cp $< .
|
||||
|
289
progs/demos/arbfslight.c
Normal file
289
progs/demos/arbfslight.c
Normal file
@@ -0,0 +1,289 @@
|
||||
/*
|
||||
* Use GL_ARB_fragment_shader and GL_ARB_vertex_shader to implement
|
||||
* simple per-pixel lighting.
|
||||
*
|
||||
* Michal Krol
|
||||
* 20 February 2006
|
||||
*
|
||||
* Based on the original demo by:
|
||||
* Brian Paul
|
||||
* 17 April 2003
|
||||
*/
|
||||
|
||||
#ifdef WIN32
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glut.h>
|
||||
#include <GL/glext.h>
|
||||
|
||||
#ifdef WIN32
|
||||
#define GETPROCADDRESS wglGetProcAddress
|
||||
#else
|
||||
#define GETPROCADDRESS glutGetProcAddress
|
||||
#endif
|
||||
|
||||
static GLfloat diffuse[4] = { 0.5f, 0.5f, 1.0f, 1.0f };
|
||||
static GLfloat specular[4] = { 0.8f, 0.8f, 0.8f, 1.0f };
|
||||
static GLfloat lightPos[4] = { 0.0f, 10.0f, 20.0f, 1.0f };
|
||||
static GLfloat delta = 1.0f;
|
||||
|
||||
static GLhandleARB fragShader;
|
||||
static GLhandleARB vertShader;
|
||||
static GLhandleARB program;
|
||||
|
||||
static GLint uLightPos;
|
||||
static GLint uDiffuse;
|
||||
static GLint uSpecular;
|
||||
|
||||
static GLboolean anim = GL_TRUE;
|
||||
static GLboolean wire = GL_FALSE;
|
||||
static GLboolean pixelLight = GL_TRUE;
|
||||
|
||||
static GLint t0 = 0;
|
||||
static GLint frames = 0;
|
||||
|
||||
static GLfloat xRot = 0.0f, yRot = 0.0f;
|
||||
|
||||
static PFNGLCREATESHADEROBJECTARBPROC glCreateShaderObjectARB = NULL;
|
||||
static PFNGLSHADERSOURCEARBPROC glShaderSourceARB = NULL;
|
||||
static PFNGLCOMPILESHADERARBPROC glCompileShaderARB = NULL;
|
||||
static PFNGLCREATEPROGRAMOBJECTARBPROC glCreateProgramObjectARB = NULL;
|
||||
static PFNGLATTACHOBJECTARBPROC glAttachObjectARB = NULL;
|
||||
static PFNGLLINKPROGRAMARBPROC glLinkProgramARB = NULL;
|
||||
static PFNGLUSEPROGRAMOBJECTARBPROC glUseProgramObjectARB = NULL;
|
||||
static PFNGLGETUNIFORMLOCATIONARBPROC glGetUniformLocationARB = NULL;
|
||||
static PFNGLUNIFORM4FVARBPROC glUniform4fvARB = NULL;
|
||||
|
||||
static void Redisplay (void)
|
||||
{
|
||||
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
if (pixelLight)
|
||||
{
|
||||
glUseProgramObjectARB (program);
|
||||
glUniform4fvARB (uLightPos, 1, lightPos);
|
||||
glDisable(GL_LIGHTING);
|
||||
}
|
||||
else
|
||||
{
|
||||
glUseProgramObjectARB (0);
|
||||
glLightfv (GL_LIGHT0, GL_POSITION, lightPos);
|
||||
glEnable(GL_LIGHTING);
|
||||
}
|
||||
|
||||
glPushMatrix ();
|
||||
glRotatef (xRot, 1.0f, 0.0f, 0.0f);
|
||||
glRotatef (yRot, 0.0f, 1.0f, 0.0f);
|
||||
glutSolidSphere (2.0, 10, 5);
|
||||
glPopMatrix ();
|
||||
|
||||
glutSwapBuffers();
|
||||
frames++;
|
||||
|
||||
if (anim)
|
||||
{
|
||||
GLint t = glutGet (GLUT_ELAPSED_TIME);
|
||||
if (t - t0 >= 5000)
|
||||
{
|
||||
GLfloat seconds = (GLfloat) (t - t0) / 1000.0f;
|
||||
GLfloat fps = frames / seconds;
|
||||
printf ("%d frames in %6.3f seconds = %6.3f FPS\n", frames, seconds, fps);
|
||||
t0 = t;
|
||||
frames = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void Idle (void)
|
||||
{
|
||||
lightPos[0] += delta;
|
||||
if (lightPos[0] > 25.0f || lightPos[0] < -25.0f)
|
||||
delta = -delta;
|
||||
glutPostRedisplay ();
|
||||
}
|
||||
|
||||
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);
|
||||
glMatrixMode (GL_MODELVIEW);
|
||||
glLoadIdentity ();
|
||||
glTranslatef (0.0f, 0.0f, -15.0f);
|
||||
}
|
||||
|
||||
static void Key (unsigned char key, int x, int y)
|
||||
{
|
||||
(void) x;
|
||||
(void) y;
|
||||
|
||||
switch (key)
|
||||
{
|
||||
case ' ':
|
||||
case 'a':
|
||||
anim = !anim;
|
||||
if (anim)
|
||||
glutIdleFunc (Idle);
|
||||
else
|
||||
glutIdleFunc (NULL);
|
||||
break;
|
||||
case 'x':
|
||||
lightPos[0] -= 1.0f;
|
||||
break;
|
||||
case 'X':
|
||||
lightPos[0] += 1.0f;
|
||||
break;
|
||||
case 'w':
|
||||
wire = !wire;
|
||||
if (wire)
|
||||
glPolygonMode (GL_FRONT_AND_BACK, GL_LINE);
|
||||
else
|
||||
glPolygonMode (GL_FRONT_AND_BACK, GL_FILL);
|
||||
break;
|
||||
case 'p':
|
||||
pixelLight = !pixelLight;
|
||||
if (pixelLight)
|
||||
printf ("Per-pixel lighting\n");
|
||||
else
|
||||
printf ("Conventional lighting\n");
|
||||
break;
|
||||
case 27:
|
||||
exit(0);
|
||||
break;
|
||||
}
|
||||
glutPostRedisplay ();
|
||||
}
|
||||
|
||||
static void SpecialKey (int key, int x, int y)
|
||||
{
|
||||
const GLfloat step = 3.0f;
|
||||
|
||||
(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 (void)
|
||||
{
|
||||
static const char *fragShaderText =
|
||||
"uniform vec4 lightPos;\n"
|
||||
"uniform vec4 diffuse;\n"
|
||||
"uniform vec4 specular;\n"
|
||||
"void main () {\n"
|
||||
" // Compute dot product of light direction and normal vector\n"
|
||||
" float dotProd;\n"
|
||||
" dotProd = clamp (dot (normalize (lightPos).xyz, normalize (gl_TexCoord[0]).xyz), 0.0, 1.0);\n"
|
||||
" // Compute diffuse and specular contributions\n"
|
||||
" gl_FragColor = diffuse * dotProd + specular * pow (dotProd, 20.0);\n"
|
||||
"}\n"
|
||||
;
|
||||
static const char *vertShaderText =
|
||||
"void main () {\n"
|
||||
" gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n"
|
||||
" gl_TexCoord[0] = vec4 (gl_NormalMatrix * gl_Normal, 1.0);\n"
|
||||
"}\n"
|
||||
;
|
||||
|
||||
if (!glutExtensionSupported ("GL_ARB_fragment_shader"))
|
||||
{
|
||||
printf ("Sorry, this demo requires GL_ARB_fragment_shader\n");
|
||||
exit(1);
|
||||
}
|
||||
if (!glutExtensionSupported ("GL_ARB_shader_objects"))
|
||||
{
|
||||
printf ("Sorry, this demo requires GL_ARB_shader_objects\n");
|
||||
exit(1);
|
||||
}
|
||||
if (!glutExtensionSupported ("GL_ARB_shading_language_100"))
|
||||
{
|
||||
printf ("Sorry, this demo requires GL_ARB_shading_language_100\n");
|
||||
exit(1);
|
||||
}
|
||||
if (!glutExtensionSupported ("GL_ARB_vertex_shader"))
|
||||
{
|
||||
printf ("Sorry, this demo requires GL_ARB_vertex_shader\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
glCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC) GETPROCADDRESS ("glCreateShaderObjectARB");
|
||||
glShaderSourceARB = (PFNGLSHADERSOURCEARBPROC) GETPROCADDRESS ("glShaderSourceARB");
|
||||
glCompileShaderARB = (PFNGLCOMPILESHADERARBPROC) GETPROCADDRESS ("glCompileShaderARB");
|
||||
glCreateProgramObjectARB = (PFNGLCREATEPROGRAMOBJECTARBPROC) GETPROCADDRESS ("glCreateProgramObjectARB");
|
||||
glAttachObjectARB = (PFNGLATTACHOBJECTARBPROC) GETPROCADDRESS ("glAttachObjectARB");
|
||||
glLinkProgramARB = (PFNGLLINKPROGRAMARBPROC) GETPROCADDRESS ("glLinkProgramARB");
|
||||
glUseProgramObjectARB = (PFNGLUSEPROGRAMOBJECTARBPROC) GETPROCADDRESS ("glUseProgramObjectARB");
|
||||
glGetUniformLocationARB = (PFNGLGETUNIFORMLOCATIONARBPROC) GETPROCADDRESS ("glGetUniformLocationARB");
|
||||
glUniform4fvARB = (PFNGLUNIFORM4FVARBPROC) GETPROCADDRESS ("glUniform4fvARB");
|
||||
|
||||
fragShader = glCreateShaderObjectARB (GL_FRAGMENT_SHADER_ARB);
|
||||
glShaderSourceARB (fragShader, 1, &fragShaderText, NULL);
|
||||
glCompileShaderARB (fragShader);
|
||||
|
||||
vertShader = glCreateShaderObjectARB (GL_VERTEX_SHADER_ARB);
|
||||
glShaderSourceARB (vertShader, 1, &vertShaderText, NULL);
|
||||
glCompileShaderARB (vertShader);
|
||||
|
||||
program = glCreateProgramObjectARB ();
|
||||
glAttachObjectARB (program, fragShader);
|
||||
glAttachObjectARB (program, vertShader);
|
||||
glLinkProgramARB (program);
|
||||
glUseProgramObjectARB (program);
|
||||
|
||||
uLightPos = glGetUniformLocationARB (program, "lightPos");
|
||||
uDiffuse = glGetUniformLocationARB (program, "diffuse");
|
||||
uSpecular = glGetUniformLocationARB (program, "specular");
|
||||
|
||||
glUniform4fvARB (uDiffuse, 1, diffuse);
|
||||
glUniform4fvARB (uSpecular, 1, specular);
|
||||
|
||||
glClearColor (0.3f, 0.3f, 0.3f, 0.0f);
|
||||
glEnable (GL_DEPTH_TEST);
|
||||
glEnable (GL_LIGHT0);
|
||||
glEnable (GL_LIGHTING);
|
||||
glMaterialfv (GL_FRONT_AND_BACK, GL_DIFFUSE, diffuse);
|
||||
glMaterialfv (GL_FRONT_AND_BACK, GL_SPECULAR, specular);
|
||||
glMaterialf (GL_FRONT_AND_BACK, GL_SHININESS, 20.0f);
|
||||
|
||||
printf ("GL_RENDERER = %s\n", (const char *) glGetString (GL_RENDERER));
|
||||
printf ("Press p to toggle between per-pixel and per-vertex lighting\n");
|
||||
}
|
||||
|
||||
int main (int argc, char *argv[])
|
||||
{
|
||||
glutInit (&argc, argv);
|
||||
glutInitWindowPosition ( 0, 0);
|
||||
glutInitWindowSize (200, 200);
|
||||
glutInitDisplayMode (GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
|
||||
glutCreateWindow (argv[0]);
|
||||
glutReshapeFunc (Reshape);
|
||||
glutKeyboardFunc (Key);
|
||||
glutSpecialFunc (SpecialKey);
|
||||
glutDisplayFunc (Redisplay);
|
||||
if (anim)
|
||||
glutIdleFunc (Idle);
|
||||
Init ();
|
||||
glutMainLoop ();
|
||||
return 0;
|
||||
}
|
||||
|
@@ -10,7 +10,7 @@
|
||||
##### MACROS #####
|
||||
|
||||
INCDIR = ([--.include],[-.util])
|
||||
CFLAGS = /include=$(INCDIR)/prefix=all/name=(as_is,short)
|
||||
CFLAGS =/include=$(INCDIR)/prefix=all/name=(as_is,short)/float=ieee/ieee=denorm
|
||||
|
||||
.ifdef SHARE
|
||||
GL_LIBS = $(XLIBS)
|
||||
|
@@ -71,7 +71,9 @@ static void Display( void )
|
||||
glDisable(GL_SCISSOR_TEST);
|
||||
glDisable(GL_FOG);
|
||||
|
||||
if (!DrawFront)
|
||||
if (DrawFront)
|
||||
glFinish();
|
||||
else
|
||||
glutSwapBuffers();
|
||||
}
|
||||
|
||||
|
485
progs/demos/gearbox.c
Normal file
485
progs/demos/gearbox.c
Normal file
@@ -0,0 +1,485 @@
|
||||
/*
|
||||
* Use glCopyTexSubImage2D to draw animated gears on the sides of a box.
|
||||
*
|
||||
* Brian Paul
|
||||
* 27 January 2006
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <GL/glut.h>
|
||||
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265
|
||||
#endif
|
||||
|
||||
static GLint WinWidth = 800, WinHeight = 500;
|
||||
static GLint TexWidth, TexHeight;
|
||||
static GLuint TexObj = 1;
|
||||
static GLenum IntFormat = GL_RGB;
|
||||
|
||||
static GLboolean WireFrame = GL_FALSE;
|
||||
|
||||
static GLint T0 = 0;
|
||||
static GLint Frames = 0;
|
||||
static GLint Win = 0;
|
||||
|
||||
static GLfloat ViewRotX = 20.0, ViewRotY = 30.0, ViewRotZ = 0.0;
|
||||
static GLint Gear1, Gear2, Gear3;
|
||||
static GLfloat GearRot = 0.0;
|
||||
static GLfloat CubeRot = 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
|
||||
cleanup(void)
|
||||
{
|
||||
glDeleteTextures(1, &TexObj);
|
||||
glDeleteLists(Gear1, 1);
|
||||
glDeleteLists(Gear2, 1);
|
||||
glDeleteLists(Gear3, 1);
|
||||
glutDestroyWindow(Win);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
DrawGears(void)
|
||||
{
|
||||
if (WireFrame) {
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
|
||||
}
|
||||
|
||||
glPushMatrix();
|
||||
glRotatef(20/*ViewRotX*/, 1.0, 0.0, 0.0);
|
||||
glRotatef(ViewRotY, 0.0, 1.0, 0.0);
|
||||
glRotatef(ViewRotZ, 0.0, 0.0, 1.0);
|
||||
|
||||
glPushMatrix();
|
||||
glTranslatef(-3.0, -2.0, 0.0);
|
||||
glRotatef(GearRot, 0.0, 0.0, 1.0);
|
||||
glCallList(Gear1);
|
||||
glPopMatrix();
|
||||
|
||||
glPushMatrix();
|
||||
glTranslatef(3.1, -2.0, 0.0);
|
||||
glRotatef(-2.0 * GearRot - 9.0, 0.0, 0.0, 1.0);
|
||||
glCallList(Gear2);
|
||||
glPopMatrix();
|
||||
|
||||
glPushMatrix();
|
||||
glTranslatef(-3.1, 4.2, 0.0);
|
||||
glRotatef(-2.0 * GearRot - 25.0, 0.0, 0.0, 1.0);
|
||||
glCallList(Gear3);
|
||||
glPopMatrix();
|
||||
|
||||
glPopMatrix();
|
||||
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
DrawCube(void)
|
||||
{
|
||||
static const GLfloat texcoords[4][2] = {
|
||||
{ 0, 0 }, { 1, 0 }, { 1, 1 }, { 0, 1 }
|
||||
};
|
||||
static const GLfloat vertices[4][2] = {
|
||||
{ -1, -1 }, { 1, -1 }, { 1, 1 }, { -1, 1 }
|
||||
};
|
||||
static const GLfloat xforms[6][4] = {
|
||||
{ 0, 0, 1, 0 },
|
||||
{ 90, 0, 1, 0 },
|
||||
{ 180, 0, 1, 0 },
|
||||
{ 270, 0, 1, 0 },
|
||||
{ 90, 1, 0, 0 },
|
||||
{ -90, 1, 0, 0 }
|
||||
};
|
||||
static const GLfloat mat[4] = { 1.0, 1.0, 0.5, 1.0 };
|
||||
GLint i, j;
|
||||
|
||||
glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, mat);
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
|
||||
glPushMatrix();
|
||||
glRotatef(ViewRotX, 1.0, 0.0, 0.0);
|
||||
glRotatef(15, 1, 0, 0);
|
||||
glRotatef(CubeRot, 0, 1, 0);
|
||||
glScalef(4, 4, 4);
|
||||
|
||||
for (i = 0; i < 6; i++) {
|
||||
glPushMatrix();
|
||||
glRotatef(xforms[i][0], xforms[i][1], xforms[i][2], xforms[i][3]);
|
||||
glTranslatef(0, 0, 1.1);
|
||||
glBegin(GL_POLYGON);
|
||||
glNormal3f(0, 0, 1);
|
||||
for (j = 0; j < 4; j++) {
|
||||
glTexCoord2fv(texcoords[j]);
|
||||
glVertex2fv(vertices[j]);
|
||||
}
|
||||
glEnd();
|
||||
glPopMatrix();
|
||||
}
|
||||
glPopMatrix();
|
||||
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
draw(void)
|
||||
{
|
||||
float ar;
|
||||
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
glTranslatef(0.0, 0.0, -40.0);
|
||||
|
||||
glDisable(GL_SCISSOR_TEST);
|
||||
glClear(GL_DEPTH_BUFFER_BIT);
|
||||
glEnable(GL_SCISSOR_TEST);
|
||||
|
||||
/* draw gears */
|
||||
glViewport(0, 0, TexWidth, TexHeight);
|
||||
glScissor(0, 0, TexWidth, TexHeight);
|
||||
glClearColor(0.5, 0.5, 0.8, 0.0);
|
||||
glClearColor(1, 1, 1, 0);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0, 60.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
|
||||
DrawGears();
|
||||
|
||||
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, TexWidth, TexHeight);
|
||||
|
||||
/* draw textured cube */
|
||||
glViewport(TexWidth, 0, WinWidth - TexWidth, WinHeight);
|
||||
glScissor(TexWidth, 0, WinWidth - TexWidth, WinHeight);
|
||||
glClearColor(0.5, 0.5, 0.8, 0.0);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
ar = (float) (WinWidth - TexWidth) / WinHeight;
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glFrustum(-ar, ar, -1.0, 1.0, 5.0, 60.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
|
||||
DrawCube();
|
||||
|
||||
/* finish up */
|
||||
glutSwapBuffers();
|
||||
|
||||
Frames++;
|
||||
{
|
||||
GLint t = glutGet(GLUT_ELAPSED_TIME);
|
||||
if (t - T0 >= 5000) {
|
||||
GLfloat seconds = (t - T0) / 1000.0;
|
||||
GLfloat fps = Frames / seconds;
|
||||
printf("%d frames in %6.3f seconds = %6.3f FPS\n", Frames, seconds, fps);
|
||||
T0 = t;
|
||||
Frames = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
idle(void)
|
||||
{
|
||||
static double t0 = -1.;
|
||||
double dt, t = glutGet(GLUT_ELAPSED_TIME) / 1000.0;
|
||||
if (t0 < 0.0)
|
||||
t0 = t;
|
||||
dt = t - t0;
|
||||
t0 = t;
|
||||
|
||||
/* fmod to prevent overflow */
|
||||
GearRot = fmod(GearRot + 70.0 * dt, 360.0); /* 70 deg/sec */
|
||||
CubeRot = fmod(CubeRot + 15.0 * dt, 360.0); /* 15 deg/sec */
|
||||
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
/* change view angle, exit upon ESC */
|
||||
static void
|
||||
key(unsigned char k, int x, int y)
|
||||
{
|
||||
(void) x;
|
||||
(void) y;
|
||||
switch (k) {
|
||||
case 'w':
|
||||
WireFrame = !WireFrame;
|
||||
break;
|
||||
case 'z':
|
||||
ViewRotZ += 5.0;
|
||||
break;
|
||||
case 'Z':
|
||||
ViewRotZ -= 5.0;
|
||||
break;
|
||||
case 27: /* Escape */
|
||||
cleanup();
|
||||
exit(0);
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
/* change view angle */
|
||||
static void
|
||||
special(int k, int x, int y)
|
||||
{
|
||||
(void) x;
|
||||
(void) y;
|
||||
switch (k) {
|
||||
case GLUT_KEY_UP:
|
||||
ViewRotX += 5.0;
|
||||
break;
|
||||
case GLUT_KEY_DOWN:
|
||||
ViewRotX -= 5.0;
|
||||
break;
|
||||
case GLUT_KEY_LEFT:
|
||||
ViewRotY += 5.0;
|
||||
break;
|
||||
case GLUT_KEY_RIGHT:
|
||||
ViewRotY -= 5.0;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
/* new window size or exposure */
|
||||
static void
|
||||
reshape(int width, int height)
|
||||
{
|
||||
WinWidth = width;
|
||||
WinHeight = height;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
init(int argc, char *argv[])
|
||||
{
|
||||
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};
|
||||
GLint i;
|
||||
|
||||
glLightfv(GL_LIGHT0, GL_POSITION, pos);
|
||||
#if 0
|
||||
glEnable(GL_CULL_FACE);
|
||||
#endif
|
||||
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);
|
||||
|
||||
/* xxx make size dynamic */
|
||||
TexWidth = 256;
|
||||
TexHeight = 256;
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, TexObj);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, IntFormat, TexWidth, TexHeight, 0,
|
||||
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
|
||||
for ( i=1; i<argc; i++ ) {
|
||||
if (strcmp(argv[i], "-info")==0) {
|
||||
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
|
||||
printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
|
||||
printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
|
||||
printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
visible(int vis)
|
||||
{
|
||||
if (vis == GLUT_VISIBLE)
|
||||
glutIdleFunc(idle);
|
||||
else
|
||||
glutIdleFunc(NULL);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
glutInit(&argc, argv);
|
||||
glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
|
||||
|
||||
glutInitWindowSize(WinWidth, WinHeight);
|
||||
Win = glutCreateWindow("gearbox");
|
||||
init(argc, argv);
|
||||
|
||||
glutDisplayFunc(draw);
|
||||
glutReshapeFunc(reshape);
|
||||
glutKeyboardFunc(key);
|
||||
glutSpecialFunc(special);
|
||||
glutVisibilityFunc(visible);
|
||||
|
||||
glutMainLoop();
|
||||
return 0; /* ANSI C requires main to return int. */
|
||||
}
|
@@ -26,6 +26,7 @@
|
||||
static GLint T0 = 0;
|
||||
static GLint Frames = 0;
|
||||
static GLint autoexit = 0;
|
||||
static GLint win = 0;
|
||||
|
||||
|
||||
/**
|
||||
@@ -163,6 +164,15 @@ static GLfloat view_rotx = 20.0, view_roty = 30.0, view_rotz = 0.0;
|
||||
static GLint gear1, gear2, gear3;
|
||||
static GLfloat angle = 0.0;
|
||||
|
||||
static void
|
||||
cleanup(void)
|
||||
{
|
||||
glDeleteLists(gear1, 1);
|
||||
glDeleteLists(gear2, 1);
|
||||
glDeleteLists(gear3, 1);
|
||||
glutDestroyWindow(win);
|
||||
}
|
||||
|
||||
static void
|
||||
draw(void)
|
||||
{
|
||||
@@ -198,16 +208,18 @@ draw(void)
|
||||
Frames++;
|
||||
|
||||
{
|
||||
GLint t = glutGet(GLUT_ELAPSED_TIME);
|
||||
if (t - T0 >= 5000) {
|
||||
GLfloat seconds = (t - T0) / 1000.0;
|
||||
GLfloat fps = Frames / seconds;
|
||||
printf("%d frames in %6.3f seconds = %6.3f FPS\n", Frames, seconds, fps);
|
||||
T0 = t;
|
||||
Frames = 0;
|
||||
if ((t >= 999.0 * autoexit) && (autoexit))
|
||||
exit(0);
|
||||
}
|
||||
GLint t = glutGet(GLUT_ELAPSED_TIME);
|
||||
if (t - T0 >= 5000) {
|
||||
GLfloat seconds = (t - T0) / 1000.0;
|
||||
GLfloat fps = Frames / seconds;
|
||||
printf("%d frames in %6.3f seconds = %6.3f FPS\n", Frames, seconds, fps);
|
||||
T0 = t;
|
||||
Frames = 0;
|
||||
if ((t >= 999.0 * autoexit) && (autoexit)) {
|
||||
cleanup();
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -222,7 +234,9 @@ idle(void)
|
||||
dt = t - t0;
|
||||
t0 = t;
|
||||
|
||||
angle += 70.0 * dt; /* 90 degrees per second */
|
||||
angle += 70.0 * dt; /* 70 degrees per second */
|
||||
angle = fmod(angle, 360.0); /* prevents eventual overflow */
|
||||
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
@@ -239,6 +253,7 @@ key(unsigned char k, int x, int y)
|
||||
view_rotz -= 5.0;
|
||||
break;
|
||||
case 27: /* Escape */
|
||||
cleanup();
|
||||
exit(0);
|
||||
break;
|
||||
default:
|
||||
@@ -352,7 +367,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
glutInitWindowPosition(0, 0);
|
||||
glutInitWindowSize(300, 300);
|
||||
glutCreateWindow("Gears");
|
||||
win = glutCreateWindow("Gears");
|
||||
init(argc, argv);
|
||||
|
||||
glutDisplayFunc(draw);
|
||||
|
175
progs/demos/glslnoise.c
Executable file
175
progs/demos/glslnoise.c
Executable file
@@ -0,0 +1,175 @@
|
||||
/*
|
||||
* GLSL noise demo.
|
||||
*
|
||||
* Michal Krol
|
||||
* 20 February 2006
|
||||
*
|
||||
* Based on the original demo by:
|
||||
* Stefan Gustavson (stegu@itn.liu.se) 2004, 2005
|
||||
*/
|
||||
|
||||
#ifdef WIN32
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glut.h>
|
||||
#include <GL/glext.h>
|
||||
|
||||
#ifdef WIN32
|
||||
#define GETPROCADDRESS wglGetProcAddress
|
||||
#else
|
||||
#define GETPROCADDRESS glutGetProcAddress
|
||||
#endif
|
||||
|
||||
static GLhandleARB fragShader;
|
||||
static GLhandleARB vertShader;
|
||||
static GLhandleARB program;
|
||||
|
||||
static GLint uTime;
|
||||
|
||||
static GLfloat u_time = 0.0f;
|
||||
|
||||
static PFNGLCREATESHADEROBJECTARBPROC glCreateShaderObjectARB = NULL;
|
||||
static PFNGLSHADERSOURCEARBPROC glShaderSourceARB = NULL;
|
||||
static PFNGLCOMPILESHADERARBPROC glCompileShaderARB = NULL;
|
||||
static PFNGLCREATEPROGRAMOBJECTARBPROC glCreateProgramObjectARB = NULL;
|
||||
static PFNGLATTACHOBJECTARBPROC glAttachObjectARB = NULL;
|
||||
static PFNGLLINKPROGRAMARBPROC glLinkProgramARB = NULL;
|
||||
static PFNGLUSEPROGRAMOBJECTARBPROC glUseProgramObjectARB = NULL;
|
||||
static PFNGLGETUNIFORMLOCATIONARBPROC glGetUniformLocationARB = NULL;
|
||||
static PFNGLUNIFORM1FARBPROC glUniform1fARB = NULL;
|
||||
|
||||
static void Redisplay (void)
|
||||
{
|
||||
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
glUniform1fARB (uTime, u_time);
|
||||
|
||||
glPushMatrix ();
|
||||
glutSolidSphere (2.0, 20, 10);
|
||||
glPopMatrix ();
|
||||
|
||||
glutSwapBuffers();
|
||||
}
|
||||
|
||||
static void Idle (void)
|
||||
{
|
||||
u_time += 0.1f;
|
||||
glutPostRedisplay ();
|
||||
}
|
||||
|
||||
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);
|
||||
glMatrixMode (GL_MODELVIEW);
|
||||
glLoadIdentity ();
|
||||
glTranslatef (0.0f, 0.0f, -15.0f);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
static const char *fragShaderText =
|
||||
"uniform float time;\n"
|
||||
"void main () {\n"
|
||||
" gl_FragColor = gl_Color * vec4 ((0.5 + 0.5 * vec3 (noise1 (\n"
|
||||
" vec4 (4.0 * gl_TexCoord[0].xyz, 0.5 * time)))), 1.0);\n"
|
||||
"}\n"
|
||||
;
|
||||
static const char *vertShaderText =
|
||||
"void main () {\n"
|
||||
" gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n"
|
||||
" gl_TexCoord[0] = gl_Vertex;\n"
|
||||
" gl_FrontColor = gl_Color;\n"
|
||||
"}\n"
|
||||
;
|
||||
|
||||
if (!glutExtensionSupported ("GL_ARB_fragment_shader"))
|
||||
{
|
||||
printf ("Sorry, this demo requires GL_ARB_fragment_shader\n");
|
||||
exit(1);
|
||||
}
|
||||
if (!glutExtensionSupported ("GL_ARB_shader_objects"))
|
||||
{
|
||||
printf ("Sorry, this demo requires GL_ARB_shader_objects\n");
|
||||
exit(1);
|
||||
}
|
||||
if (!glutExtensionSupported ("GL_ARB_shading_language_100"))
|
||||
{
|
||||
printf ("Sorry, this demo requires GL_ARB_shading_language_100\n");
|
||||
exit(1);
|
||||
}
|
||||
if (!glutExtensionSupported ("GL_ARB_vertex_shader"))
|
||||
{
|
||||
printf ("Sorry, this demo requires GL_ARB_vertex_shader\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
glCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC) wglGetProcAddress ("glCreateShaderObjectARB");
|
||||
glShaderSourceARB = (PFNGLSHADERSOURCEARBPROC) wglGetProcAddress ("glShaderSourceARB");
|
||||
glCompileShaderARB = (PFNGLCOMPILESHADERARBPROC) wglGetProcAddress ("glCompileShaderARB");
|
||||
glCreateProgramObjectARB = (PFNGLCREATEPROGRAMOBJECTARBPROC) wglGetProcAddress ("glCreateProgramObjectARB");
|
||||
glAttachObjectARB = (PFNGLATTACHOBJECTARBPROC) wglGetProcAddress ("glAttachObjectARB");
|
||||
glLinkProgramARB = (PFNGLLINKPROGRAMARBPROC) wglGetProcAddress ("glLinkProgramARB");
|
||||
glUseProgramObjectARB = (PFNGLUSEPROGRAMOBJECTARBPROC) wglGetProcAddress ("glUseProgramObjectARB");
|
||||
glGetUniformLocationARB = (PFNGLGETUNIFORMLOCATIONARBPROC) GETPROCADDRESS ("glGetUniformLocationARB");
|
||||
glUniform1fARB = (PFNGLUNIFORM1FARBPROC) GETPROCADDRESS ("glUniform1fARB");
|
||||
|
||||
fragShader = glCreateShaderObjectARB (GL_FRAGMENT_SHADER_ARB);
|
||||
glShaderSourceARB (fragShader, 1, &fragShaderText, NULL);
|
||||
glCompileShaderARB (fragShader);
|
||||
|
||||
vertShader = glCreateShaderObjectARB (GL_VERTEX_SHADER_ARB);
|
||||
glShaderSourceARB (vertShader, 1, &vertShaderText, NULL);
|
||||
glCompileShaderARB (vertShader);
|
||||
|
||||
program = glCreateProgramObjectARB ();
|
||||
glAttachObjectARB (program, fragShader);
|
||||
glAttachObjectARB (program, vertShader);
|
||||
glLinkProgramARB (program);
|
||||
glUseProgramObjectARB (program);
|
||||
|
||||
uTime = glGetUniformLocationARB (program, "time");
|
||||
|
||||
glClearColor (0.0f, 0.1f, 0.3f, 1.0f);
|
||||
glEnable (GL_CULL_FACE);
|
||||
glEnable (GL_DEPTH_TEST);
|
||||
|
||||
printf ("GL_RENDERER = %s\n", (const char *) glGetString (GL_RENDERER));
|
||||
}
|
||||
|
||||
int main (int argc, char *argv[])
|
||||
{
|
||||
glutInit (&argc, argv);
|
||||
glutInitWindowPosition ( 0, 0);
|
||||
glutInitWindowSize (200, 200);
|
||||
glutInitDisplayMode (GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
|
||||
glutCreateWindow (argv[0]);
|
||||
glutReshapeFunc (Reshape);
|
||||
glutKeyboardFunc (Key);
|
||||
glutDisplayFunc (Redisplay);
|
||||
glutIdleFunc (Idle);
|
||||
Init ();
|
||||
glutMainLoop ();
|
||||
return 0;
|
||||
}
|
||||
|
@@ -176,6 +176,7 @@ So the angle is:
|
||||
|
||||
static int mono=0;
|
||||
static int smooth=1;
|
||||
static int anim=1;
|
||||
static GLint WindH, WindW;
|
||||
static GLfloat step=0;
|
||||
static GLfloat seno;
|
||||
@@ -660,13 +661,6 @@ static void draw_ico( void )
|
||||
}
|
||||
|
||||
static void draw ( void ) {
|
||||
static double t0 = -1.;
|
||||
double dt, t = glutGet(GLUT_ELAPSED_TIME) / 1000.0;
|
||||
if (t0 < 0.0)
|
||||
t0 = t;
|
||||
dt = t - t0;
|
||||
t0 = t;
|
||||
|
||||
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
|
||||
|
||||
glPushMatrix();
|
||||
@@ -688,11 +682,19 @@ static void draw ( void ) {
|
||||
|
||||
glutSwapBuffers();
|
||||
|
||||
step += dt;
|
||||
}
|
||||
|
||||
static void idle_( void )
|
||||
{
|
||||
static double t0 = -1.;
|
||||
double dt, t = glutGet(GLUT_ELAPSED_TIME) / 1000.0;
|
||||
if (t0 < 0.0)
|
||||
t0 = t;
|
||||
dt = t - t0;
|
||||
t0 = t;
|
||||
|
||||
step += dt;
|
||||
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
@@ -718,11 +720,19 @@ static void key( unsigned char k, int x, int y )
|
||||
case '4': object=4; break;
|
||||
case '5': object=5; break;
|
||||
case ' ': mono^=1; break;
|
||||
case 13: smooth^=1; break;
|
||||
case 's': smooth^=1; break;
|
||||
case 'a':
|
||||
anim^=1;
|
||||
if (anim)
|
||||
glutIdleFunc( idle_ );
|
||||
else
|
||||
glutIdleFunc(NULL);
|
||||
break;
|
||||
case 27:
|
||||
exit(0);
|
||||
}
|
||||
pinit();
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
static void pinit(void)
|
||||
|
@@ -1,210 +0,0 @@
|
||||
/*
|
||||
* GL_SGIS_pixel_texture demo
|
||||
*
|
||||
* Brian Paul
|
||||
* 6 Apr 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.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* How this works:
|
||||
* 1. We load the image into a 2D texture.
|
||||
* 2. We generate a sequence of RGB images in which the R component
|
||||
* is really the S texture coordinate and the G component is really
|
||||
* the T texture coordinate.
|
||||
* By warping the mapping from R to S and G to T we can get non-linear
|
||||
* distortions.
|
||||
* 3. Draw the warped image (a 2-D warping function) with pixel texgen
|
||||
* enabled.
|
||||
* 4. Loop over the warped images to animate.
|
||||
*
|
||||
* The pixel texgen extension can also be used to do color-space
|
||||
* conversions. For example, we could convert YCR to RGB with a
|
||||
* 3D texture map which takes YCR as the S,T,R texture coordinate and
|
||||
* returns RGB texel values.
|
||||
*
|
||||
* You can use this extension in (at least) two ways:
|
||||
* 1. glDrawPixels w/ color space conversion/warping
|
||||
* 2. glDrawPixels to spatially warp another image in texture memory
|
||||
*
|
||||
* We're basically using glDrawPixels to draw a texture coordinate image.
|
||||
*/
|
||||
|
||||
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <GL/glut.h>
|
||||
#include <GL/glext.h>
|
||||
#include "readtex.h"
|
||||
|
||||
#define TEXTURE_FILE "../images/girl.rgb"
|
||||
|
||||
static int ImgWidth = 300, ImgHeight = 300;
|
||||
#define FRAMES 20
|
||||
static GLubyte *ImgData[FRAMES];
|
||||
static GLint Frame = 0;
|
||||
|
||||
static GLboolean TextureFlag = GL_TRUE;
|
||||
|
||||
|
||||
static void Display( void )
|
||||
{
|
||||
glClear( GL_COLOR_BUFFER_BIT );
|
||||
|
||||
if (TextureFlag) {
|
||||
glEnable(GL_PIXEL_TEXTURE_SGIS);
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
}
|
||||
else {
|
||||
glDisable(GL_PIXEL_TEXTURE_SGIS);
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
}
|
||||
|
||||
glColor3f(1, 1, 1);
|
||||
glRasterPos2f(10, 10);
|
||||
glDrawPixels(ImgWidth, ImgHeight, GL_RGB, GL_UNSIGNED_BYTE, ImgData[Frame]);
|
||||
|
||||
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 ' ':
|
||||
TextureFlag = !TextureFlag;
|
||||
break;
|
||||
case 27:
|
||||
exit(0);
|
||||
break;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
static void Idle(void)
|
||||
{
|
||||
Frame++;
|
||||
if (Frame >= FRAMES)
|
||||
Frame = 0;
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
static GLubyte warp(GLfloat s, int frame)
|
||||
{
|
||||
static const GLfloat pi = 3.14159265;
|
||||
static int halfFrame = FRAMES / 2;
|
||||
GLfloat y, weight, v;
|
||||
if (frame >= halfFrame)
|
||||
frame = halfFrame - (frame - halfFrame);
|
||||
y = sin(s * pi);
|
||||
weight = (float) frame / (FRAMES-1);
|
||||
v = y * (0.8 * weight + 0.2);
|
||||
return (GLint) (v * 255.0F);
|
||||
}
|
||||
|
||||
|
||||
static void InitImage(void)
|
||||
{
|
||||
int i, j, frame;
|
||||
for (frame = 0; frame < FRAMES; frame++) {
|
||||
ImgData[frame] = (GLubyte *) malloc(ImgWidth * ImgHeight * 3);
|
||||
for (i = 0; i < ImgHeight; i++) {
|
||||
for (j = 0; j < ImgWidth; j++) {
|
||||
GLubyte *pixel = ImgData[frame] + (i * ImgWidth + j) * 3;
|
||||
pixel[0] = warp((float) j / (ImgWidth - 0), frame);
|
||||
pixel[1] = warp((float) i / (ImgHeight - 0), frame);
|
||||
pixel[2] = 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void Init( int argc, char *argv[] )
|
||||
{
|
||||
const char *exten = (const char *) glGetString(GL_EXTENSIONS);
|
||||
if (!strstr(exten, "GL_SGIS_pixel_texture")) {
|
||||
printf("Sorry, GL_SGIS_pixel_texture not supported by this renderer.\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/* linear filtering looks nicer, but it's slower, since it's in software */
|
||||
#if 1
|
||||
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);
|
||||
#endif
|
||||
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
||||
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
|
||||
if (!LoadRGBMipmaps(TEXTURE_FILE, GL_RGB)) {
|
||||
printf("Error: couldn't load texture image\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
glClearColor(0.3, 0.3, 0.4, 1.0);
|
||||
|
||||
InitImage();
|
||||
|
||||
printf("Hit SPACE to toggle pixel texgen\n");
|
||||
}
|
||||
|
||||
|
||||
int main( int argc, char *argv[] )
|
||||
{
|
||||
glutInit( &argc, argv );
|
||||
glutInitWindowSize( 330, 330 );
|
||||
glutInitWindowPosition( 0, 0 );
|
||||
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
|
||||
glutCreateWindow(argv[0] );
|
||||
|
||||
Init( argc, argv );
|
||||
|
||||
glutKeyboardFunc( Key );
|
||||
glutReshapeFunc( Reshape );
|
||||
glutDisplayFunc( Display );
|
||||
glutIdleFunc( Idle );
|
||||
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
@@ -186,11 +186,12 @@ Display( void )
|
||||
else {
|
||||
/* clear the temporary image to white (helpful for debugging */
|
||||
memset(TempImage, 255, ImgWidth * ImgHeight * 4);
|
||||
#if 0
|
||||
/* you might use this when debugging */
|
||||
#if 1
|
||||
glReadPixels(APosX, APosY, ImgWidth, ImgHeight,
|
||||
ReadFormat, ReadType, TempImage);
|
||||
(void) ComplexReadPixels;
|
||||
#else
|
||||
/* you might use this when debugging */
|
||||
ComplexReadPixels(APosX, APosY, ImgWidth, ImgHeight,
|
||||
ReadFormat, ReadType, TempImage);
|
||||
#endif
|
||||
|
@@ -1,4 +1,3 @@
|
||||
|
||||
/*
|
||||
* Demo of a reflective, texture-mapped surface with OpenGL.
|
||||
* Brian Paul August 14, 1995 This file is in the public domain.
|
||||
@@ -24,9 +23,11 @@
|
||||
* Dirk Reiners (reiners@igd.fhg.de) made some modifications to this code.
|
||||
* Mark Kilgard (April 1997)
|
||||
* Brian Paul (April 2000 - added keyboard d/s options)
|
||||
* Brian Paul (August 2005 - added multi window feature)
|
||||
*/
|
||||
|
||||
|
||||
#include <assert.h>
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -36,40 +37,102 @@
|
||||
|
||||
|
||||
#define DEG2RAD (3.14159/180.0)
|
||||
|
||||
#define TABLE_TEXTURE "../images/tile.rgb"
|
||||
|
||||
static GLint ImgWidth, ImgHeight;
|
||||
static GLenum ImgFormat;
|
||||
static GLubyte *Image = NULL;
|
||||
|
||||
#define MAX_OBJECTS 2
|
||||
static GLint table_list;
|
||||
static GLint objects_list[MAX_OBJECTS];
|
||||
|
||||
static GLfloat xrot, yrot;
|
||||
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;
|
||||
#define INIT_WIDTH 400
|
||||
#define INIT_HEIGHT 300
|
||||
|
||||
|
||||
static void make_table( void )
|
||||
struct window {
|
||||
int id; /* returned by glutCreateWindow() */
|
||||
int width, height;
|
||||
GLboolean anim;
|
||||
GLfloat xrot, yrot;
|
||||
GLfloat spin;
|
||||
GLenum showBuffer;
|
||||
GLenum drawBuffer;
|
||||
GLuint table_list;
|
||||
GLuint objects_list[MAX_OBJECTS];
|
||||
double t0;
|
||||
struct window *next;
|
||||
};
|
||||
|
||||
|
||||
static struct window *FirstWindow = NULL;
|
||||
|
||||
|
||||
static void
|
||||
CreateWindow(void);
|
||||
|
||||
|
||||
static struct window *
|
||||
CurrentWindow(void)
|
||||
{
|
||||
int id = glutGetWindow();
|
||||
struct window *w;
|
||||
for (w = FirstWindow; w; w = w->next) {
|
||||
if (w->id == id)
|
||||
return w;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
static GLboolean
|
||||
AnyAnimating(void)
|
||||
{
|
||||
struct window *w;
|
||||
for (w = FirstWindow; w; w = w->next) {
|
||||
if (w->anim)
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
KillWindow(struct window *w)
|
||||
{
|
||||
struct window *win, *prev = NULL;
|
||||
for (win = FirstWindow; win; win = win->next) {
|
||||
if (win == w) {
|
||||
if (prev) {
|
||||
prev->next = win->next;
|
||||
}
|
||||
else {
|
||||
FirstWindow = win->next;
|
||||
}
|
||||
glutDestroyWindow(win->id);
|
||||
win->next = NULL;
|
||||
free(win);
|
||||
return;
|
||||
}
|
||||
prev = win;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
KillAllWindows(void)
|
||||
{
|
||||
while (FirstWindow)
|
||||
KillWindow(FirstWindow);
|
||||
}
|
||||
|
||||
|
||||
static GLuint
|
||||
MakeTable(void)
|
||||
{
|
||||
static GLfloat table_mat[] = { 1.0, 1.0, 1.0, 0.6 };
|
||||
static GLfloat gray[] = { 0.4, 0.4, 0.4, 1.0 };
|
||||
GLuint table_list;
|
||||
|
||||
table_list = glGenLists(1);
|
||||
glNewList( table_list, GL_COMPILE );
|
||||
|
||||
/* load table's texture */
|
||||
glMaterialfv( GL_FRONT, GL_AMBIENT_AND_DIFFUSE, table_mat );
|
||||
/* glMaterialfv( GL_FRONT, GL_EMISSION, gray );*/
|
||||
/*glMaterialfv( GL_FRONT, GL_EMISSION, gray );*/
|
||||
glMaterialfv( GL_FRONT, GL_DIFFUSE, table_mat );
|
||||
glMaterialfv( GL_FRONT, GL_AMBIENT, gray );
|
||||
|
||||
@@ -88,10 +151,12 @@ static void make_table( void )
|
||||
glDisable( GL_TEXTURE_2D );
|
||||
|
||||
glEndList();
|
||||
return table_list;
|
||||
}
|
||||
|
||||
|
||||
static void make_objects( void )
|
||||
static void
|
||||
MakeObjects(GLuint *objects_list)
|
||||
{
|
||||
GLUquadricObj *q;
|
||||
|
||||
@@ -116,32 +181,36 @@ static void make_objects( void )
|
||||
glMaterialfv( GL_FRONT, GL_EMISSION, black );
|
||||
gluCylinder( q, 1.5, 0.0, 2.5, 15, 1 );
|
||||
glEndList();
|
||||
|
||||
gluDeleteQuadric(q);
|
||||
}
|
||||
|
||||
|
||||
static void init( void )
|
||||
static void
|
||||
InitWindow(struct window *w)
|
||||
{
|
||||
make_table();
|
||||
make_objects();
|
||||
GLint imgWidth, imgHeight;
|
||||
GLenum imgFormat;
|
||||
GLubyte *image = NULL;
|
||||
|
||||
Image = LoadRGBImage( TABLE_TEXTURE, &ImgWidth, &ImgHeight, &ImgFormat );
|
||||
if (!Image) {
|
||||
w->table_list = MakeTable();
|
||||
MakeObjects(w->objects_list);
|
||||
|
||||
image = LoadRGBImage( TABLE_TEXTURE, &imgWidth, &imgHeight, &imgFormat );
|
||||
if (!image) {
|
||||
printf("Couldn't read %s\n", TABLE_TEXTURE);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
gluBuild2DMipmaps(GL_TEXTURE_2D, 3, ImgWidth, ImgHeight,
|
||||
ImgFormat, GL_UNSIGNED_BYTE, Image);
|
||||
gluBuild2DMipmaps(GL_TEXTURE_2D, 3, imgWidth, imgHeight,
|
||||
imgFormat, GL_UNSIGNED_BYTE, image);
|
||||
free(image);
|
||||
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
|
||||
|
||||
xrot = 30.0;
|
||||
yrot = 50.0;
|
||||
spin = 0.0;
|
||||
|
||||
glShadeModel( GL_FLAT );
|
||||
|
||||
glEnable( GL_LIGHT0 );
|
||||
@@ -153,14 +222,15 @@ static void init( void )
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void reshape(int w, int h)
|
||||
static void
|
||||
Reshape(int width, int height)
|
||||
{
|
||||
struct window *w = CurrentWindow();
|
||||
GLfloat yAspect = 2.5;
|
||||
GLfloat xAspect = yAspect * (float) w / (float) h;
|
||||
Width = w;
|
||||
Height = h;
|
||||
glViewport(0, 0, w, h);
|
||||
GLfloat xAspect = yAspect * (float) width / (float) height;
|
||||
w->width = width;
|
||||
w->height = height;
|
||||
glViewport(0, 0, width, height);
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glFrustum( -xAspect, xAspect, -yAspect, yAspect, 10.0, 30.0 );
|
||||
@@ -169,8 +239,8 @@ static void reshape(int w, int h)
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void draw_objects( GLfloat eyex, GLfloat eyey, GLfloat eyez )
|
||||
static void
|
||||
DrawObjects(struct window *w, GLfloat eyex, GLfloat eyey, GLfloat eyez)
|
||||
{
|
||||
(void) eyex;
|
||||
(void) eyey;
|
||||
@@ -178,62 +248,65 @@ static void draw_objects( GLfloat eyex, GLfloat eyey, GLfloat eyez )
|
||||
#ifndef USE_ZBUFFER
|
||||
if (eyex<0.5) {
|
||||
#endif
|
||||
glPushMatrix();
|
||||
glTranslatef( 1.0, 1.5, 0.0 );
|
||||
glRotatef( spin, 1.0, 0.5, 0.0 );
|
||||
glRotatef( 0.5*spin, 0.0, 0.5, 1.0 );
|
||||
glCallList( objects_list[0] );
|
||||
glPopMatrix();
|
||||
|
||||
glPushMatrix();
|
||||
glTranslatef( -1.0, 0.85+3.0*fabs( cos(0.01*spin) ), 0.0 );
|
||||
glRotatef( 0.5*spin, 0.0, 0.5, 1.0 );
|
||||
glRotatef( spin, 1.0, 0.5, 0.0 );
|
||||
glScalef( 0.5, 0.5, 0.5 );
|
||||
glCallList( objects_list[1] );
|
||||
glPopMatrix();
|
||||
glPushMatrix();
|
||||
glTranslatef( 1.0, 1.5, 0.0 );
|
||||
glRotatef( w->spin, 1.0, 0.5, 0.0 );
|
||||
glRotatef( 0.5*w->spin, 0.0, 0.5, 1.0 );
|
||||
glCallList( w->objects_list[0] );
|
||||
glPopMatrix();
|
||||
|
||||
glPushMatrix();
|
||||
glTranslatef( -1.0, 0.85+3.0*fabs( cos(0.01*w->spin) ), 0.0 );
|
||||
glRotatef( 0.5*w->spin, 0.0, 0.5, 1.0 );
|
||||
glRotatef( w->spin, 1.0, 0.5, 0.0 );
|
||||
glScalef( 0.5, 0.5, 0.5 );
|
||||
glCallList( w->objects_list[1] );
|
||||
glPopMatrix();
|
||||
#ifndef USE_ZBUFFER
|
||||
}
|
||||
else {
|
||||
glPushMatrix();
|
||||
glTranslatef( -1.0, 0.85+3.0*fabs( cos(0.01*spin) ), 0.0 );
|
||||
glRotatef( 0.5*spin, 0.0, 0.5, 1.0 );
|
||||
glRotatef( spin, 1.0, 0.5, 0.0 );
|
||||
glScalef( 0.5, 0.5, 0.5 );
|
||||
glCallList( objects_list[1] );
|
||||
glPopMatrix();
|
||||
glPushMatrix();
|
||||
glTranslatef( -1.0, 0.85+3.0*fabs( cos(0.01*w->spin) ), 0.0 );
|
||||
glRotatef( 0.5*w->spin, 0.0, 0.5, 1.0 );
|
||||
glRotatef( w->spin, 1.0, 0.5, 0.0 );
|
||||
glScalef( 0.5, 0.5, 0.5 );
|
||||
glCallList( w->objects_list[1] );
|
||||
glPopMatrix();
|
||||
|
||||
glPushMatrix();
|
||||
glTranslatef( 1.0, 1.5, 0.0 );
|
||||
glRotatef( spin, 1.0, 0.5, 0.0 );
|
||||
glRotatef( 0.5*spin, 0.0, 0.5, 1.0 );
|
||||
glCallList( objects_list[0] );
|
||||
glPopMatrix();
|
||||
glPushMatrix();
|
||||
glTranslatef( 1.0, 1.5, 0.0 );
|
||||
glRotatef( w->spin, 1.0, 0.5, 0.0 );
|
||||
glRotatef( 0.5*w->spin, 0.0, 0.5, 1.0 );
|
||||
glCallList( w->objects_list[0] );
|
||||
glPopMatrix();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void draw_table( void )
|
||||
static void
|
||||
DrawTable(struct window *w)
|
||||
{
|
||||
glCallList( table_list );
|
||||
glCallList(w->table_list);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void draw_scene( void )
|
||||
static void
|
||||
DrawWindow(void)
|
||||
{
|
||||
struct window *w = CurrentWindow();
|
||||
static GLfloat light_pos[] = { 0.0, 20.0, 0.0, 1.0 };
|
||||
GLfloat dist = 20.0;
|
||||
GLfloat eyex, eyey, eyez;
|
||||
|
||||
glDrawBuffer(w->drawBuffer);
|
||||
glReadBuffer(w->drawBuffer);
|
||||
|
||||
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
|
||||
|
||||
|
||||
eyex = dist * cos(yrot*DEG2RAD) * cos(xrot*DEG2RAD);
|
||||
eyez = dist * sin(yrot*DEG2RAD) * cos(xrot*DEG2RAD);
|
||||
eyey = dist * sin(xrot*DEG2RAD);
|
||||
eyex = dist * cos(w->yrot * DEG2RAD) * cos(w->xrot * DEG2RAD);
|
||||
eyez = dist * sin(w->yrot * DEG2RAD) * cos(w->xrot * DEG2RAD);
|
||||
eyey = dist * sin(w->xrot * DEG2RAD);
|
||||
|
||||
/* view from top */
|
||||
glPushMatrix();
|
||||
@@ -247,7 +320,7 @@ static void draw_scene( void )
|
||||
glStencilFunc( GL_ALWAYS, 1, 0xffffffff );
|
||||
glStencilOp( GL_REPLACE, GL_REPLACE, GL_REPLACE );
|
||||
glColorMask( GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE );
|
||||
draw_table();
|
||||
DrawTable(w);
|
||||
glColorMask( GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE );
|
||||
|
||||
glEnable( GL_DEPTH_TEST );
|
||||
@@ -264,7 +337,7 @@ static void draw_scene( void )
|
||||
/* Reposition light in reflected space. */
|
||||
glLightfv(GL_LIGHT0, GL_POSITION, light_pos);
|
||||
|
||||
draw_objects(eyex, eyey, eyez);
|
||||
DrawObjects(w, eyex, eyey, eyez);
|
||||
glPopMatrix();
|
||||
|
||||
/* Restore light's original unreflected position. */
|
||||
@@ -277,128 +350,224 @@ static void draw_scene( void )
|
||||
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
|
||||
|
||||
glEnable( GL_TEXTURE_2D );
|
||||
draw_table();
|
||||
DrawTable(w);
|
||||
glDisable( GL_TEXTURE_2D );
|
||||
glDisable( GL_BLEND );
|
||||
|
||||
/* view from top */
|
||||
glPushMatrix();
|
||||
|
||||
draw_objects(eyex, eyey, eyez);
|
||||
DrawObjects(w, eyex, eyey, eyez);
|
||||
|
||||
glPopMatrix();
|
||||
|
||||
glPopMatrix();
|
||||
|
||||
if (ShowBuffer == GL_DEPTH) {
|
||||
ShowDepthBuffer(Width, Height, 1.0, 0.0);
|
||||
if (w->showBuffer == GL_DEPTH) {
|
||||
ShowDepthBuffer(w->width, w->height, 1.0, 0.0);
|
||||
}
|
||||
else if (ShowBuffer == GL_STENCIL) {
|
||||
ShowStencilBuffer(Width, Height, 255.0, 0.0);
|
||||
else if (w->showBuffer == GL_STENCIL) {
|
||||
ShowStencilBuffer(w->width, w->height, 255.0, 0.0);
|
||||
}
|
||||
else if (ShowBuffer == GL_ALPHA) {
|
||||
ShowAlphaBuffer(Width, Height);
|
||||
else if (w->showBuffer == GL_ALPHA) {
|
||||
ShowAlphaBuffer(w->width, w->height);
|
||||
}
|
||||
|
||||
glutSwapBuffers();
|
||||
if (w->drawBuffer == GL_BACK)
|
||||
glutSwapBuffers();
|
||||
else
|
||||
glFinish();
|
||||
|
||||
/* calc/show frame rate */
|
||||
{
|
||||
static GLint t0 = 0;
|
||||
static GLint frames = 0;
|
||||
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;
|
||||
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)
|
||||
{
|
||||
static double t0 = -1.;
|
||||
double dt, t = glutGet(GLUT_ELAPSED_TIME) / 1000.0;
|
||||
if (t0 < 0.0)
|
||||
t0 = t;
|
||||
dt = t - t0;
|
||||
t0 = t;
|
||||
spin += 60.0 * dt;
|
||||
yrot += 90.0 * dt;
|
||||
glutPostRedisplay();
|
||||
double t = glutGet(GLUT_ELAPSED_TIME) / 1000.0;
|
||||
struct window *w;
|
||||
for (w = FirstWindow; w; w = w->next) {
|
||||
if (w->anim) {
|
||||
double dt;
|
||||
if (w->t0 < 0.0)
|
||||
w->t0 = t;
|
||||
dt = t - w->t0;
|
||||
w->t0 = t;
|
||||
w->spin += 60.0 * dt;
|
||||
w->yrot += 90.0 * dt;
|
||||
assert(w->id);
|
||||
glutSetWindow(w->id);
|
||||
glutPostRedisplay();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void Key( unsigned char key, int x, int y )
|
||||
static void
|
||||
UpdateIdleFunc(void)
|
||||
{
|
||||
if (AnyAnimating())
|
||||
glutIdleFunc(Idle);
|
||||
else
|
||||
glutIdleFunc(NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
Key(unsigned char key, int x, int y)
|
||||
{
|
||||
struct window *w = CurrentWindow();
|
||||
(void) x;
|
||||
(void) y;
|
||||
if (key == 'd') {
|
||||
ShowBuffer = GL_DEPTH;
|
||||
}
|
||||
else if (key == 's') {
|
||||
ShowBuffer = GL_STENCIL;
|
||||
}
|
||||
else if (key == 'a') {
|
||||
ShowBuffer = GL_ALPHA;
|
||||
}
|
||||
else if (key == ' ') {
|
||||
Anim = !Anim;
|
||||
if (Anim)
|
||||
glutIdleFunc(idle);
|
||||
|
||||
switch (key) {
|
||||
case 'd':
|
||||
w->showBuffer = GL_DEPTH;
|
||||
glutPostRedisplay();
|
||||
break;
|
||||
case 's':
|
||||
w->showBuffer = GL_STENCIL;
|
||||
glutPostRedisplay();
|
||||
break;
|
||||
case 'a':
|
||||
w->showBuffer = GL_ALPHA;
|
||||
glutPostRedisplay();
|
||||
break;
|
||||
case 'c':
|
||||
w->showBuffer = GL_NONE;
|
||||
glutPostRedisplay();
|
||||
break;
|
||||
case 'f':
|
||||
if (w->drawBuffer == GL_FRONT)
|
||||
w->drawBuffer = GL_BACK;
|
||||
else
|
||||
glutIdleFunc(NULL);
|
||||
}
|
||||
else if (key==27) {
|
||||
w->drawBuffer = GL_FRONT;
|
||||
glutPostRedisplay();
|
||||
break;
|
||||
case ' ':
|
||||
w->anim = !w->anim;
|
||||
w->t0 = -1;
|
||||
UpdateIdleFunc();
|
||||
glutPostRedisplay();
|
||||
break;
|
||||
case 'n':
|
||||
CreateWindow();
|
||||
UpdateIdleFunc();
|
||||
break;
|
||||
case 'k':
|
||||
KillWindow(w);
|
||||
if (FirstWindow == NULL)
|
||||
exit(0);
|
||||
break;
|
||||
case 27:
|
||||
KillAllWindows();
|
||||
exit(0);
|
||||
break;
|
||||
default:
|
||||
;
|
||||
}
|
||||
else {
|
||||
ShowBuffer = GL_NONE;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
static void SpecialKey( int key, int x, int y )
|
||||
static void
|
||||
SpecialKey(int key, int x, int y)
|
||||
{
|
||||
struct window *w = CurrentWindow();
|
||||
(void) x;
|
||||
(void) y;
|
||||
switch (key) {
|
||||
case GLUT_KEY_UP:
|
||||
xrot += 3.0;
|
||||
if ( xrot > 85 )
|
||||
xrot = 85;
|
||||
w->xrot += 3.0;
|
||||
if (w->xrot > 85)
|
||||
w->xrot = 85;
|
||||
break;
|
||||
case GLUT_KEY_DOWN:
|
||||
xrot -= 3.0;
|
||||
if ( xrot < 5 )
|
||||
xrot = 5;
|
||||
w->xrot -= 3.0;
|
||||
if (w->xrot < 5)
|
||||
w->xrot = 5;
|
||||
break;
|
||||
case GLUT_KEY_LEFT:
|
||||
yrot += 3.0;
|
||||
w->yrot += 3.0;
|
||||
break;
|
||||
case GLUT_KEY_RIGHT:
|
||||
yrot -= 3.0;
|
||||
w->yrot -= 3.0;
|
||||
break;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
int main( int argc, char *argv[] )
|
||||
static void
|
||||
CreateWindow(void)
|
||||
{
|
||||
glutInit(&argc, argv);
|
||||
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH | GLUT_STENCIL | GLUT_ALPHA);
|
||||
glutInitWindowPosition( 0, 0 );
|
||||
glutInitWindowSize( Width, Height );
|
||||
glutCreateWindow(argv[0]);
|
||||
glutReshapeFunc(reshape);
|
||||
glutDisplayFunc(draw_scene);
|
||||
char title[1000];
|
||||
struct window *w = (struct window *) calloc(1, sizeof(struct window));
|
||||
|
||||
glutInitWindowSize(INIT_WIDTH, INIT_HEIGHT);
|
||||
w->id = glutCreateWindow("foo");
|
||||
sprintf(title, "reflect window %d", w->id);
|
||||
glutSetWindowTitle(title);
|
||||
assert(w->id);
|
||||
w->width = INIT_WIDTH;
|
||||
w->height = INIT_HEIGHT;
|
||||
w->anim = GL_TRUE;
|
||||
w->xrot = 30.0;
|
||||
w->yrot = 50.0;
|
||||
w->spin = 0.0;
|
||||
w->showBuffer = GL_NONE;
|
||||
w->drawBuffer = GL_BACK;
|
||||
|
||||
InitWindow(w);
|
||||
|
||||
glutReshapeFunc(Reshape);
|
||||
glutDisplayFunc(DrawWindow);
|
||||
glutKeyboardFunc(Key);
|
||||
glutSpecialFunc(SpecialKey);
|
||||
glutIdleFunc(idle);
|
||||
init();
|
||||
|
||||
/* insert at head of list */
|
||||
w->next = FirstWindow;
|
||||
FirstWindow = w;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Usage(void)
|
||||
{
|
||||
printf("Keys:\n");
|
||||
printf(" a - show alpha buffer\n");
|
||||
printf(" d - show depth buffer\n");
|
||||
printf(" s - show stencil buffer\n");
|
||||
printf(" c - show color buffer\n");
|
||||
printf(" f - toggle rendering to front/back color buffer\n");
|
||||
printf(" n - create new window\n");
|
||||
printf(" k - kill window\n");
|
||||
printf(" SPACE - toggle animation\n");
|
||||
printf(" ARROWS - rotate scene\n");
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
glutInit(&argc, argv);
|
||||
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH |
|
||||
GLUT_STENCIL | GLUT_ALPHA);
|
||||
CreateWindow();
|
||||
glutIdleFunc(Idle);
|
||||
Usage();
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
||||
|
@@ -41,7 +41,6 @@
|
||||
#undef GL_ARB_shadow_ambient
|
||||
#endif
|
||||
|
||||
|
||||
#define DEG_TO_RAD (3.14159 / 180.0)
|
||||
|
||||
static GLint WindowWidth = 450, WindowHeight = 300;
|
||||
@@ -67,6 +66,7 @@ static GLfloat Bias = -0.06;
|
||||
|
||||
static GLboolean Anim = GL_TRUE;
|
||||
|
||||
static GLboolean UsePackedDepthStencil = GL_FALSE;
|
||||
static GLboolean HaveEXTshadowFuncs = GL_FALSE;
|
||||
static GLint Operator = 0;
|
||||
static const GLenum OperatorFunc[8] = {
|
||||
@@ -266,7 +266,7 @@ Display(void)
|
||||
0, 1, 0); /* up */
|
||||
|
||||
glViewport(0, 0, ShadowTexWidth, ShadowTexHeight);
|
||||
glClear(GL_DEPTH_BUFFER_BIT);
|
||||
glClear(GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
|
||||
DrawScene();
|
||||
|
||||
/*
|
||||
@@ -274,9 +274,21 @@ Display(void)
|
||||
*/
|
||||
if (DisplayMode == SHOW_DEPTH_MAPPING) {
|
||||
/* load depth image as gray-scale luminance texture */
|
||||
GLfloat *depth = (GLfloat *) malloc(ShadowTexWidth * ShadowTexHeight
|
||||
* sizeof(GLfloat));
|
||||
if (depth) {
|
||||
if (UsePackedDepthStencil) {
|
||||
GLuint *depth = (GLuint *) malloc(ShadowTexWidth * ShadowTexHeight
|
||||
* sizeof(GLuint));
|
||||
assert(depth);
|
||||
glReadPixels(0, 0, ShadowTexWidth, ShadowTexHeight,
|
||||
GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT, depth);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE,
|
||||
ShadowTexWidth, ShadowTexHeight, 0,
|
||||
GL_LUMINANCE, GL_UNSIGNED_INT, depth);
|
||||
free(depth);
|
||||
}
|
||||
else {
|
||||
GLfloat *depth = (GLfloat *) malloc(ShadowTexWidth * ShadowTexHeight
|
||||
* sizeof(GLfloat));
|
||||
assert(depth);
|
||||
glReadPixels(0, 0, ShadowTexWidth, ShadowTexHeight,
|
||||
GL_DEPTH_COMPONENT, GL_FLOAT, depth);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE,
|
||||
@@ -287,8 +299,18 @@ Display(void)
|
||||
}
|
||||
else {
|
||||
/* The normal shadow case */
|
||||
glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT,
|
||||
0, 0, ShadowTexWidth, ShadowTexHeight, 0);
|
||||
if (UsePackedDepthStencil) {
|
||||
GLint intFormat;
|
||||
glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_STENCIL_EXT,
|
||||
0, 0, ShadowTexWidth, ShadowTexHeight, 0);
|
||||
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0,
|
||||
GL_TEXTURE_INTERNAL_FORMAT, &intFormat);
|
||||
assert(intFormat == GL_DEPTH_STENCIL_EXT);
|
||||
}
|
||||
else {
|
||||
glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT,
|
||||
0, 0, ShadowTexWidth, ShadowTexHeight, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -447,6 +469,17 @@ Key(unsigned char key, int x, int y)
|
||||
OperatorFunc[Operator]);
|
||||
}
|
||||
break;
|
||||
case 'p':
|
||||
UsePackedDepthStencil = !UsePackedDepthStencil;
|
||||
if (UsePackedDepthStencil
|
||||
&& !glutExtensionSupported("GL_EXT_packed_depth_stencil")) {
|
||||
printf("Sorry, GL_EXT_packed_depth_stencil not supported\n");
|
||||
UsePackedDepthStencil = GL_FALSE;
|
||||
}
|
||||
else {
|
||||
printf("Use GL_DEPTH_STENCIL_EXT: %d\n", UsePackedDepthStencil);
|
||||
}
|
||||
break;
|
||||
case 'z':
|
||||
Zrot -= step;
|
||||
break;
|
||||
@@ -572,6 +605,7 @@ PrintHelp(void)
|
||||
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(" p = toggle use of packed depth/stencil\n");
|
||||
printf(" cursor keys = rotate scene\n");
|
||||
printf(" <shift> + cursor keys = rotate light source\n");
|
||||
if (HaveEXTshadowFuncs)
|
||||
@@ -585,7 +619,7 @@ main(int argc, char *argv[])
|
||||
glutInit(&argc, argv);
|
||||
glutInitWindowPosition(0, 0);
|
||||
glutInitWindowSize(WindowWidth, WindowHeight);
|
||||
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
|
||||
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH | GLUT_STENCIL);
|
||||
glutCreateWindow(argv[0]);
|
||||
glutReshapeFunc(Reshape);
|
||||
glutKeyboardFunc(Key);
|
||||
|
269
progs/demos/singlebuffer.c
Normal file
269
progs/demos/singlebuffer.c
Normal file
@@ -0,0 +1,269 @@
|
||||
/*
|
||||
* Demo of (nearly) flicker-free drawing with a single color buffer.
|
||||
*
|
||||
* Basically, draw the scene into the Z buffer first, then draw the
|
||||
* scene into the color buffer. Finally, "clear" the background by
|
||||
* setting the fragments we didn't hit earlier.
|
||||
*
|
||||
* This won't work if you need blending. The technique works best
|
||||
* when the scene is relatively simple and can be rendered quickly
|
||||
* (i.e. with hardware), and when the objects don't move too much from
|
||||
* one frame to the next.
|
||||
*
|
||||
* Brian Paul
|
||||
* 25 August 2005
|
||||
*
|
||||
* See Mesa license for terms.
|
||||
*/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <GL/glut.h>
|
||||
|
||||
|
||||
#define FLICKER 0
|
||||
#define NO_FLICKER 1
|
||||
|
||||
static GLint Mode = NO_FLICKER;
|
||||
static GLfloat Xrot = 0, Yrot = 0, Zrot = 0;
|
||||
static GLboolean Anim = GL_TRUE;
|
||||
static GLfloat ClearColor[4] = {0.2, 0.2, 0.9, 0.0};
|
||||
static GLfloat NearClip = 5.0, FarClip = 25.0, ViewDist = 7.0;
|
||||
static double PrevTime = -1;
|
||||
|
||||
struct box {
|
||||
float tx, ty, tz;
|
||||
float rx, ry, rz, ra;
|
||||
float sx, sy, sz;
|
||||
float color[4];
|
||||
};
|
||||
|
||||
#define NUM_BOXES 25
|
||||
|
||||
struct box Boxes[NUM_BOXES];
|
||||
|
||||
|
||||
/* Return random float in [0,1] */
|
||||
static float
|
||||
Random(void)
|
||||
{
|
||||
int i = rand();
|
||||
return (float) (i % 1000) / 1000.0;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
MakeBoxes(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < NUM_BOXES; i++) {
|
||||
Boxes[i].tx = -1.0 + 2.0 * Random();
|
||||
Boxes[i].ty = -1.0 + 2.0 * Random();
|
||||
Boxes[i].tz = -1.0 + 2.0 * Random();
|
||||
Boxes[i].sx = 0.1 + Random() * 0.4;
|
||||
Boxes[i].sy = 0.1 + Random() * 0.4;
|
||||
Boxes[i].sz = 0.1 + Random() * 0.4;
|
||||
Boxes[i].rx = Random();
|
||||
Boxes[i].ry = Random();
|
||||
Boxes[i].rz = Random();
|
||||
Boxes[i].ra = Random() * 360.0;
|
||||
Boxes[i].color[0] = Random();
|
||||
Boxes[i].color[1] = Random();
|
||||
Boxes[i].color[2] = Random();
|
||||
Boxes[i].color[3] = 1.0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
DrawBoxes(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < NUM_BOXES; i++) {
|
||||
glPushMatrix();
|
||||
glTranslatef(Boxes[i].tx, Boxes[i].ty, Boxes[i].tz);
|
||||
glRotatef(Boxes[i].ra, Boxes[i].rx, Boxes[i].ry, Boxes[i].rz);
|
||||
glScalef(Boxes[i].sx, Boxes[i].sy, Boxes[i].sz);
|
||||
glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, Boxes[i].color);
|
||||
glutSolidCube(1.0);
|
||||
glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Idle(void)
|
||||
{
|
||||
double dt, t = glutGet(GLUT_ELAPSED_TIME) * 0.001;
|
||||
if (PrevTime < 0.0)
|
||||
PrevTime = t;
|
||||
dt = t - PrevTime;
|
||||
PrevTime = t;
|
||||
Xrot += 16.0 * dt;
|
||||
Yrot += 12.0 * dt;
|
||||
Zrot += 8.0 * dt;
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Draw(void)
|
||||
{
|
||||
if (Mode == FLICKER) {
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
}
|
||||
else {
|
||||
/* don't clear color buffer */
|
||||
glClear(GL_DEPTH_BUFFER_BIT);
|
||||
/* update Z buffer only */
|
||||
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
|
||||
}
|
||||
|
||||
glPushMatrix();
|
||||
glRotatef(Xrot, 1, 0, 0);
|
||||
glRotatef(Yrot, 0, 1, 0);
|
||||
glRotatef(Zrot, 0, 0, 1);
|
||||
|
||||
DrawBoxes();
|
||||
|
||||
if (Mode == NO_FLICKER) {
|
||||
/* update color buffer now */
|
||||
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
|
||||
glDepthFunc(GL_EQUAL);
|
||||
DrawBoxes();
|
||||
glDepthFunc(GL_LESS);
|
||||
}
|
||||
|
||||
glPopMatrix();
|
||||
|
||||
if (Mode == NO_FLICKER) {
|
||||
/* "clear" the untouched pixels now.
|
||||
* Note: if you comment-out this code you'll see something interesting.
|
||||
*/
|
||||
GLfloat x = FarClip / NearClip;
|
||||
GLfloat z = -(FarClip - ViewDist - 1.0);
|
||||
glDisable(GL_LIGHTING);
|
||||
glColor4fv(ClearColor);
|
||||
glBegin(GL_POLYGON);
|
||||
glVertex3f(-x, -x, z);
|
||||
glVertex3f( x, -x, z);
|
||||
glVertex3f( x, x, z);
|
||||
glVertex3f(-x, x, z);
|
||||
glEnd();
|
||||
glEnable(GL_LIGHTING);
|
||||
}
|
||||
|
||||
/* This is where you'd normally do SwapBuffers */
|
||||
glFinish();
|
||||
}
|
||||
|
||||
|
||||
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, NearClip, FarClip);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
glTranslatef(0.0, 0.0, -ViewDist);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Key(unsigned char key, int x, int y)
|
||||
{
|
||||
(void) x;
|
||||
(void) y;
|
||||
switch (key) {
|
||||
case 'a':
|
||||
Anim = !Anim;
|
||||
if (Anim)
|
||||
glutIdleFunc(Idle);
|
||||
else
|
||||
glutIdleFunc(NULL);
|
||||
PrevTime = -1;
|
||||
break;
|
||||
case 'm':
|
||||
Mode = !Mode;
|
||||
break;
|
||||
case 'b':
|
||||
MakeBoxes();
|
||||
break;
|
||||
case 27:
|
||||
exit(0);
|
||||
break;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
SpecialKey(int key, int x, int y)
|
||||
{
|
||||
const GLfloat 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(void)
|
||||
{
|
||||
glClearColor(ClearColor[0], ClearColor[1], ClearColor[2], ClearColor[3]);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glEnable(GL_LIGHTING);
|
||||
glEnable(GL_LIGHT0);
|
||||
glEnable(GL_CULL_FACE);
|
||||
glEnable(GL_NORMALIZE);
|
||||
MakeBoxes();
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Usage(void)
|
||||
{
|
||||
printf("Keys:\n");
|
||||
printf(" m - toggle drawing mode (flicker vs. no flicker)\n");
|
||||
printf(" a - toggle animation\n");
|
||||
printf(" b - generate new boxes\n");
|
||||
printf(" ARROWS - rotate scene\n");
|
||||
printf(" ESC - exit\n");
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
glutInit(&argc, argv);
|
||||
glutInitWindowSize(800, 800);
|
||||
glutInitDisplayMode(GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH);
|
||||
glutCreateWindow(argv[0]);
|
||||
glutReshapeFunc(Reshape);
|
||||
glutKeyboardFunc(Key);
|
||||
glutSpecialFunc(SpecialKey);
|
||||
glutDisplayFunc(Draw);
|
||||
if (Anim)
|
||||
glutIdleFunc(Idle);
|
||||
Init();
|
||||
Usage();
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
@@ -25,35 +25,35 @@ default: $(PROGRAMS)
|
||||
|
||||
|
||||
demo1: demo1.o $(LIB_DIR)/libEGL.so
|
||||
$(CC) demo1.o -L$(LIB_DIR) -lEGL -o $@
|
||||
$(CC) $(CFLAGS) demo1.o -L$(LIB_DIR) -lEGL $(LIBDRM_LIB) -o $@
|
||||
|
||||
demo1.o: demo1.c $(HEADERS)
|
||||
$(CC) -c $(CFLAGS) -I$(TOP)/include demo1.c
|
||||
|
||||
|
||||
demo2: demo2.o $(LIB_DIR)/libEGL.so
|
||||
$(CC) demo2.o -L$(LIB_DIR) -lEGL $(APP_LIB_DEPS) -o $@
|
||||
$(CC) $(CFLAGS) demo2.o -L$(LIB_DIR) -lEGL $(LIBDRM_LIB) $(APP_LIB_DEPS) -o $@
|
||||
|
||||
demo2.o: demo2.c $(HEADERS)
|
||||
$(CC) -c $(CFLAGS) -I$(TOP)/include demo2.c
|
||||
|
||||
|
||||
demo3: demo3.o $(LIB_DIR)/libEGL.so
|
||||
$(CC) demo3.o -L$(LIB_DIR) -lEGL $(APP_LIB_DEPS) -o $@
|
||||
$(CC) $(CFLAGS) demo3.o -L$(LIB_DIR) -lEGL $(LIBDRM_LIB) $(APP_LIB_DEPS) -o $@
|
||||
|
||||
demo3.o: demo3.c $(HEADERS)
|
||||
$(CC) -c $(CFLAGS) -I$(TOP)/include demo3.c
|
||||
|
||||
|
||||
eglinfo: eglinfo.o $(LIB_DIR)/libEGL.so
|
||||
$(CC) eglinfo.o -L$(LIB_DIR) -lEGL -o $@
|
||||
$(CC) $(CFLAGS) eglinfo.o -L$(LIB_DIR) -lEGL $(LIBDRM_LIB) -o $@
|
||||
|
||||
eglinfo.o: eglinfo.c $(HEADERS)
|
||||
$(CC) -c $(CFLAGS) -I$(TOP)/include eglinfo.c
|
||||
|
||||
|
||||
eglgears: eglgears.o $(LIB_DIR)/libEGL.so
|
||||
$(CC) eglgears.o -L$(LIB_DIR) -lEGL $(APP_LIB_DEPS) -o $@
|
||||
$(CC) $(CFLAGS) eglgears.o -L$(LIB_DIR) -lEGL $(LIBDRM_LIB) $(APP_LIB_DEPS) -o $@
|
||||
|
||||
eglgears.o: eglgears.c $(HEADERS)
|
||||
$(CC) -c $(CFLAGS) -I$(TOP)/include eglgears.c
|
||||
|
@@ -152,7 +152,7 @@ main(int argc, char *argv[])
|
||||
return 0;
|
||||
}
|
||||
|
||||
eglShowSurfaceMESA(d, screen, screen_surf, mode);
|
||||
eglShowScreenSurfaceMESA(d, screen, screen_surf, mode);
|
||||
|
||||
b = eglMakeCurrent(d, screen_surf, screen_surf, ctx);
|
||||
if (!b) {
|
||||
|
@@ -576,7 +576,7 @@ main(int argc, char *argv[])
|
||||
/*
|
||||
EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY);
|
||||
*/
|
||||
EGLDisplay d = eglGetDisplay("!fb_dri");
|
||||
EGLDisplay d = eglGetDisplay(":0");
|
||||
assert(d);
|
||||
|
||||
if (!eglInitialize(d, &maj, &min)) {
|
||||
@@ -602,33 +602,32 @@ main(int argc, char *argv[])
|
||||
printf("failed to create screen surface\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
eglShowSurfaceMESA(d, screen, screen_surf, mode);
|
||||
|
||||
eglShowScreenSurfaceMESA(d, screen, screen_surf, mode);
|
||||
|
||||
b = eglMakeCurrent(d, screen_surf, screen_surf, ctx);
|
||||
if (!b) {
|
||||
printf("make current failed\n");
|
||||
return 0;
|
||||
}
|
||||
glViewport(0, 0, 1024, 768);
|
||||
|
||||
Init();
|
||||
|
||||
Init();
|
||||
Reshape(1024, 768);
|
||||
|
||||
glDrawBuffer( GL_FRONT );
|
||||
glClearColor( 0,
|
||||
1.0,
|
||||
0,
|
||||
1);
|
||||
glDrawBuffer( GL_FRONT );
|
||||
glClearColor( 0, 1.0, 0, 1);
|
||||
|
||||
glClear( GL_COLOR_BUFFER_BIT );
|
||||
glClear( GL_COLOR_BUFFER_BIT );
|
||||
|
||||
doubleBuffer = 1;
|
||||
glDrawBuffer( GL_BACK );
|
||||
doubleBuffer = 1;
|
||||
glDrawBuffer( GL_BACK );
|
||||
|
||||
Draw(d, screen_surf);
|
||||
|
||||
|
||||
write_ppm("dump.ppm", ((struct fb_display *)_eglLookupDisplay(d))->pFB, 1024, 768);
|
||||
|
||||
|
||||
eglDestroySurface(d, screen_surf);
|
||||
eglDestroyContext(d, ctx);
|
||||
eglTerminate(d);
|
||||
|
@@ -35,6 +35,8 @@
|
||||
#include <GLES/egl.h>
|
||||
#include <assert.h>
|
||||
|
||||
#define MAX_CONFIGS 10
|
||||
#define MAX_MODES 100
|
||||
|
||||
#define BENCHMARK
|
||||
|
||||
@@ -87,9 +89,11 @@ static GLfloat view_rotx = 20.0, view_roty = 30.0, view_rotz = 0.0;
|
||||
static GLint gear1, gear2, gear3;
|
||||
static GLfloat angle = 0.0;
|
||||
|
||||
#if 0
|
||||
static GLfloat eyesep = 5.0; /* Eye separation. */
|
||||
static GLfloat fix_point = 40.0; /* Fixation point distance. */
|
||||
static GLfloat left, right, asp; /* Stereo frustum params. */
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
@@ -339,7 +343,6 @@ static void run_gears(EGLDisplay dpy, EGLSurface surf, int ttr)
|
||||
|
||||
draw();
|
||||
|
||||
// DBR : Swap the Buffers
|
||||
eglSwapBuffers(dpy, surf);
|
||||
|
||||
|
||||
@@ -359,21 +362,18 @@ main(int argc, char *argv[])
|
||||
int maj, min;
|
||||
EGLContext ctx;
|
||||
EGLSurface screen_surf;
|
||||
EGLConfig configs[10];
|
||||
EGLConfig configs[MAX_CONFIGS];
|
||||
EGLint numConfigs, i;
|
||||
EGLBoolean b;
|
||||
|
||||
const EGLint screenAttribs[] = {
|
||||
EGL_WIDTH, 1024,
|
||||
EGL_HEIGHT, 768,
|
||||
EGL_NONE
|
||||
};
|
||||
|
||||
EGLModeMESA mode;
|
||||
EGLDisplay d;
|
||||
EGLint screenAttribs[10];
|
||||
EGLModeMESA mode[MAX_MODES];
|
||||
EGLScreenMESA screen;
|
||||
EGLint count;
|
||||
EGLint count, chosenMode;
|
||||
GLboolean printInfo = GL_FALSE;
|
||||
EGLint width = 0, height = 0;
|
||||
|
||||
/* parse cmd line args */
|
||||
for (i = 1; i < argc; i++)
|
||||
{
|
||||
if (strcmp(argv[i], "-info") == 0)
|
||||
@@ -384,42 +384,73 @@ main(int argc, char *argv[])
|
||||
printf("Warning: unknown parameter: %s\n", argv[i]);
|
||||
}
|
||||
|
||||
// DBR : Create EGL context/surface etc
|
||||
EGLDisplay d = eglGetDisplay("!fb_dri");
|
||||
/* DBR : Create EGL context/surface etc */
|
||||
d = eglGetDisplay(":0");
|
||||
assert(d);
|
||||
|
||||
if (!eglInitialize(d, &maj, &min)) {
|
||||
printf("demo: eglInitialize failed\n");
|
||||
printf("eglgears: eglInitialize failed\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
printf("EGL version = %d.%d\n", maj, min);
|
||||
printf("EGL_VENDOR = %s\n", eglQueryString(d, EGL_VENDOR));
|
||||
printf("eglgears: EGL version = %d.%d\n", maj, min);
|
||||
printf("eglgears: EGL_VENDOR = %s\n", eglQueryString(d, EGL_VENDOR));
|
||||
|
||||
eglGetConfigs(d, configs, 10, &numConfigs);
|
||||
/* XXX use ChooseConfig */
|
||||
eglGetConfigs(d, configs, MAX_CONFIGS, &numConfigs);
|
||||
eglGetScreensMESA(d, &screen, 1, &count);
|
||||
eglGetModesMESA(d, screen, &mode, 1, &count);
|
||||
|
||||
if (!eglGetModesMESA(d, screen, mode, MAX_MODES, &count) || count == 0) {
|
||||
printf("eglgears: eglGetModesMESA failed!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Print list of modes, and find the one to use */
|
||||
printf("eglgears: Found %d modes:\n", count);
|
||||
for (i = 0; i < count; i++) {
|
||||
EGLint w, h;
|
||||
eglGetModeAttribMESA(d, mode[i], EGL_WIDTH, &w);
|
||||
eglGetModeAttribMESA(d, mode[i], EGL_HEIGHT, &h);
|
||||
printf("%3d: %d x %d\n", i, w, h);
|
||||
if (w > width && h > height && w <= 1280 && h <= 1024) {
|
||||
width = w;
|
||||
height = h;
|
||||
chosenMode = i;
|
||||
}
|
||||
}
|
||||
printf("eglgears: Using screen mode/size %d: %d x %d\n", chosenMode, width, height);
|
||||
|
||||
ctx = eglCreateContext(d, configs[0], EGL_NO_CONTEXT, NULL);
|
||||
if (ctx == EGL_NO_CONTEXT) {
|
||||
printf("failed to create context\n");
|
||||
printf("eglgears: failed to create context\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* build up screenAttribs array */
|
||||
i = 0;
|
||||
screenAttribs[i++] = EGL_WIDTH;
|
||||
screenAttribs[i++] = width;
|
||||
screenAttribs[i++] = EGL_HEIGHT;
|
||||
screenAttribs[i++] = height;
|
||||
screenAttribs[i++] = EGL_NONE;
|
||||
|
||||
screen_surf = eglCreateScreenSurfaceMESA(d, configs[0], screenAttribs);
|
||||
if (screen_surf == EGL_NO_SURFACE) {
|
||||
printf("failed to create screen surface\n");
|
||||
printf("eglgears: failed to create screen surface\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
eglShowSurfaceMESA(d, screen, screen_surf, mode);
|
||||
|
||||
b = eglShowScreenSurfaceMESA(d, screen, screen_surf, mode[chosenMode]);
|
||||
if (!b) {
|
||||
printf("eglgears: show surface failed\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
b = eglMakeCurrent(d, screen_surf, screen_surf, ctx);
|
||||
if (!b) {
|
||||
printf("make current failed\n");
|
||||
printf("eglgears: make current failed\n");
|
||||
return 0;
|
||||
}
|
||||
// DBR
|
||||
|
||||
if (printInfo)
|
||||
{
|
||||
@@ -429,18 +460,16 @@ main(int argc, char *argv[])
|
||||
printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS));
|
||||
}
|
||||
|
||||
init(); // Initialise the GL visual
|
||||
reshape(1024,768);
|
||||
|
||||
// DBR : Run the simulation
|
||||
init();
|
||||
reshape(width, height);
|
||||
|
||||
glDrawBuffer( GL_BACK );
|
||||
|
||||
run_gears(d, screen_surf, 5.0);
|
||||
|
||||
|
||||
// DBR : Destroy EGL context/surface etc
|
||||
eglDestroySurface(d, screen_surf);
|
||||
eglDestroyContext(d, ctx);
|
||||
eglTerminate(d);
|
||||
// DBR
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -48,9 +48,9 @@ PrintConfigs(EGLDisplay d)
|
||||
eglGetConfigs(d, configs, MAX_CONFIGS, &numConfigs);
|
||||
|
||||
printf("Configurations:\n");
|
||||
printf(" bf lv d st colorbuffer dp st supported \n");
|
||||
printf(" bf lv d st colorbuffer dp st supported\n");
|
||||
printf(" id sz l b ro r g b a th cl surfaces \n");
|
||||
printf("----------------------------------------------\n");
|
||||
printf("---------------------------------------------------\n");
|
||||
for (i = 0; i < numConfigs; i++) {
|
||||
EGLint id, size, level;
|
||||
EGLint red, green, blue, alpha;
|
||||
@@ -77,6 +77,10 @@ PrintConfigs(EGLDisplay d)
|
||||
strcat(surfString, "pb,");
|
||||
if (surfaces & EGL_PIXMAP_BIT)
|
||||
strcat(surfString, "pix,");
|
||||
#ifdef EGL_MESA_screen_surface
|
||||
if (surfaces & EGL_SCREEN_BIT_MESA)
|
||||
strcat(surfString, "scrn,");
|
||||
#endif
|
||||
if (strlen(surfString) > 0)
|
||||
surfString[strlen(surfString) - 1] = 0;
|
||||
|
||||
@@ -136,7 +140,7 @@ main(int argc, char *argv[])
|
||||
{
|
||||
int maj, min;
|
||||
/*EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY);*/
|
||||
EGLDisplay d = eglGetDisplay("!fb_dri");
|
||||
EGLDisplay d = eglGetDisplay(":0");
|
||||
|
||||
if (!eglInitialize(d, &maj, &min)) {
|
||||
printf("eglinfo: eglInitialize failed\n");
|
||||
|
127
progs/fp/Makefile
Normal file
127
progs/fp/Makefile
Normal file
@@ -0,0 +1,127 @@
|
||||
# progs/tests/Makefile
|
||||
|
||||
|
||||
# These programs aren't intended to be included with the normal distro.
|
||||
# They're not too interesting but they're good for testing.
|
||||
|
||||
TOP = ../..
|
||||
include $(TOP)/configs/current
|
||||
|
||||
|
||||
LIBS = $(APP_LIB_DEPS)
|
||||
|
||||
SOURCES = \
|
||||
tri-abs.c \
|
||||
tri-add.c \
|
||||
tri-cmp.c \
|
||||
tri-cos.c \
|
||||
tri-dp3.c \
|
||||
tri-dp4.c \
|
||||
tri-dph.c \
|
||||
tri-dst.c \
|
||||
tri-ex2.c \
|
||||
tri-flr.c \
|
||||
tri-frc.c \
|
||||
tri-kil.c \
|
||||
tri-lg2.c \
|
||||
tri-lit.c \
|
||||
tri-lrp.c \
|
||||
tri-mad.c \
|
||||
tri-max.c \
|
||||
tri-min.c \
|
||||
tri-mov.c \
|
||||
tri-mul.c \
|
||||
tri-pow.c \
|
||||
tri-param.c \
|
||||
tri-rcp.c \
|
||||
tri-rsq.c \
|
||||
tri-scs.c \
|
||||
tri-sge.c \
|
||||
tri-sge2.c \
|
||||
tri-sin.c \
|
||||
tri-slt.c \
|
||||
tri-sub.c \
|
||||
tri-swz.c \
|
||||
tri-swz2.c \
|
||||
tri-tex.c \
|
||||
tri-xpd.c \
|
||||
tri-position.c \
|
||||
tri-depth.c \
|
||||
tri-depth2.c \
|
||||
tri-depthwrite.c \
|
||||
tri-depthwrite2.c \
|
||||
|
||||
NOTDONE=\
|
||||
tri-txb.c \
|
||||
tri-txp.c \
|
||||
tri-depthwrite.c \
|
||||
tri-fogoption.c
|
||||
|
||||
|
||||
PROGS = $(SOURCES:%.c=%)
|
||||
|
||||
INCLUDES = -I. -I$(TOP)/include -I../samples
|
||||
|
||||
UTIL_FILES = readtex.h readtex.c
|
||||
|
||||
|
||||
##### RULES #####
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c
|
||||
|
||||
.c:
|
||||
$(CC) $(INCLUDES) $(CFLAGS) $< $(LIBS) -o $@
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
|
||||
|
||||
.S.o:
|
||||
$(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
|
||||
|
||||
|
||||
##### TARGETS #####
|
||||
|
||||
default: $(UTIL_FILES) $(PROGS)
|
||||
|
||||
clean:
|
||||
rm -f $(PROGS)
|
||||
rm -f *.o
|
||||
rm -f getproclist.h
|
||||
|
||||
|
||||
# auto code generation
|
||||
getprocaddress: getprocaddress.c getproclist.h
|
||||
|
||||
getproclist.h: $(TOP)/src/mesa/glapi/gl_API.xml getprocaddress.c getprocaddress.py
|
||||
python getprocaddress.py > getproclist.h
|
||||
|
||||
|
||||
texrect: texrect.o readtex.o
|
||||
$(CC) texrect.o readtex.o $(LIBS) -o $@
|
||||
|
||||
texrect.o: texrect.c readtex.h
|
||||
$(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
|
||||
|
||||
invert: invert.o readtex.o
|
||||
$(CC) invert.o readtex.o $(LIBS) -o $@
|
||||
|
||||
invert.o: invert.c readtex.h
|
||||
$(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
|
||||
|
||||
readtex.o: readtex.c
|
||||
$(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
|
||||
|
||||
|
||||
readtex.h: $(TOP)/progs/util/readtex.h
|
||||
ln -s $(TOP)/progs/util/readtex.h .
|
||||
|
||||
readtex.c: $(TOP)/progs/util/readtex.c
|
||||
ln -s $(TOP)/progs/util/readtex.c .
|
||||
|
||||
|
||||
|
||||
|
||||
# Emacs tags
|
||||
tags:
|
||||
etags `find . -name \*.[ch]` `find ../include`
|
107
progs/fp/tri-abs.c
Normal file
107
progs/fp/tri-abs.c
Normal file
@@ -0,0 +1,107 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
#include <GL/glut.h>
|
||||
|
||||
|
||||
|
||||
static void Init( void )
|
||||
{
|
||||
static const char *modulate2D =
|
||||
"!!ARBfp1.0\n"
|
||||
"TEMP R0;\n"
|
||||
"SUB R0, {0.5}.x, fragment.color; \n"
|
||||
"ABS result.color, R0; \n"
|
||||
"END"
|
||||
;
|
||||
GLuint modulateProg;
|
||||
|
||||
if (!glutExtensionSupported("GL_ARB_fragment_program")) {
|
||||
printf("Error: GL_ARB_fragment_program not supported!\n");
|
||||
exit(1);
|
||||
}
|
||||
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
|
||||
|
||||
/* Setup the fragment program */
|
||||
glGenProgramsARB(1, &modulateProg);
|
||||
glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
|
||||
glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
|
||||
strlen(modulate2D), (const GLubyte *)modulate2D);
|
||||
|
||||
printf("glGetError = 0x%x\n", (int) glGetError());
|
||||
printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
|
||||
(char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
|
||||
|
||||
glEnable(GL_FRAGMENT_PROGRAM_ARB);
|
||||
|
||||
glClearColor(.3, .3, .3, 0);
|
||||
}
|
||||
|
||||
static void Reshape(int width, int height)
|
||||
{
|
||||
|
||||
glViewport(0, 0, (GLint)width, (GLint)height);
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
}
|
||||
|
||||
static void Key(unsigned char key, int x, int y)
|
||||
{
|
||||
|
||||
switch (key) {
|
||||
case 27:
|
||||
exit(1);
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
static void Draw(void)
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
glBegin(GL_TRIANGLES);
|
||||
glColor3f(0,0,1);
|
||||
glVertex3f( 0.9, -0.9, -30.0);
|
||||
glColor3f(1,0,0);
|
||||
glVertex3f( 0.9, 0.9, -30.0);
|
||||
glColor3f(0,1,0);
|
||||
glVertex3f(-0.9, 0.0, -30.0);
|
||||
glEnd();
|
||||
|
||||
glFlush();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
GLenum type;
|
||||
|
||||
glutInit(&argc, argv);
|
||||
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
|
||||
|
||||
type = GLUT_RGB;
|
||||
type |= GLUT_SINGLE;
|
||||
glutInitDisplayMode(type);
|
||||
|
||||
if (glutCreateWindow("First Tri") == GL_FALSE) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
Init();
|
||||
|
||||
glutReshapeFunc(Reshape);
|
||||
glutKeyboardFunc(Key);
|
||||
glutDisplayFunc(Draw);
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
110
progs/fp/tri-add.c
Normal file
110
progs/fp/tri-add.c
Normal file
@@ -0,0 +1,110 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
#include <GL/glut.h>
|
||||
|
||||
|
||||
|
||||
static void Init( void )
|
||||
{
|
||||
static const char *modulate2D =
|
||||
"!!ARBfp1.0\n"
|
||||
"TEMP R0;\n"
|
||||
"ADD R0, fragment.color, fragment.color; \n"
|
||||
"ADD result.color, R0, R0; \n"
|
||||
"END"
|
||||
;
|
||||
GLuint modulateProg;
|
||||
|
||||
if (!glutExtensionSupported("GL_ARB_fragment_program")) {
|
||||
printf("Error: GL_ARB_fragment_program not supported!\n");
|
||||
exit(1);
|
||||
}
|
||||
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
|
||||
|
||||
/* Setup the fragment program */
|
||||
glGenProgramsARB(1, &modulateProg);
|
||||
glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
|
||||
glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
|
||||
strlen(modulate2D), (const GLubyte *)modulate2D);
|
||||
|
||||
printf("glGetError = 0x%x\n", (int) glGetError());
|
||||
printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
|
||||
(char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
|
||||
|
||||
glEnable(GL_FRAGMENT_PROGRAM_ARB);
|
||||
|
||||
glClearColor(.3, .3, .3, 0);
|
||||
}
|
||||
|
||||
static void Reshape(int width, int height)
|
||||
{
|
||||
|
||||
glViewport(0, 0, (GLint)width, (GLint)height);
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
}
|
||||
|
||||
static void Key(unsigned char key, int x, int y)
|
||||
{
|
||||
|
||||
switch (key) {
|
||||
case 27:
|
||||
exit(1);
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
static void Draw(void)
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
glBegin(GL_TRIANGLES);
|
||||
glColor3f(0,0,1);
|
||||
glVertex3f( 0.9, -0.9, -30.0);
|
||||
glColor3f(1,0,0);
|
||||
glVertex3f( 0.9, 0.9, -30.0);
|
||||
glColor3f(0,1,0);
|
||||
glVertex3f(-0.9, 0.0, -30.0);
|
||||
glEnd();
|
||||
|
||||
glFlush();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
GLenum type;
|
||||
|
||||
glutInit(&argc, argv);
|
||||
|
||||
|
||||
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
|
||||
|
||||
type = GLUT_RGB;
|
||||
type |= GLUT_SINGLE;
|
||||
glutInitDisplayMode(type);
|
||||
|
||||
if (glutCreateWindow("First Tri") == GL_FALSE) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
Init();
|
||||
|
||||
glutReshapeFunc(Reshape);
|
||||
glutKeyboardFunc(Key);
|
||||
glutDisplayFunc(Draw);
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
110
progs/fp/tri-cmp.c
Normal file
110
progs/fp/tri-cmp.c
Normal file
@@ -0,0 +1,110 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
#include <GL/glut.h>
|
||||
|
||||
|
||||
|
||||
static void Init( void )
|
||||
{
|
||||
static const char *modulate2D =
|
||||
"!!ARBfp1.0\n"
|
||||
"TEMP R0;\n"
|
||||
"SUB R0, {0.5}.x, fragment.color; \n"
|
||||
"CMP result.color, R0, fragment.color, {0.0}.x; \n"
|
||||
"END"
|
||||
;
|
||||
GLuint modulateProg;
|
||||
|
||||
if (!glutExtensionSupported("GL_ARB_fragment_program")) {
|
||||
printf("Error: GL_ARB_fragment_program not supported!\n");
|
||||
exit(1);
|
||||
}
|
||||
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
|
||||
|
||||
/* Setup the fragment program */
|
||||
glGenProgramsARB(1, &modulateProg);
|
||||
glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
|
||||
glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
|
||||
strlen(modulate2D), (const GLubyte *)modulate2D);
|
||||
|
||||
printf("glGetError = 0x%x\n", (int) glGetError());
|
||||
printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
|
||||
(char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
|
||||
|
||||
glEnable(GL_FRAGMENT_PROGRAM_ARB);
|
||||
|
||||
glClearColor(.3, .3, .3, 0);
|
||||
}
|
||||
|
||||
static void Reshape(int width, int height)
|
||||
{
|
||||
|
||||
glViewport(0, 0, (GLint)width, (GLint)height);
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
}
|
||||
|
||||
static void Key(unsigned char key, int x, int y)
|
||||
{
|
||||
|
||||
switch (key) {
|
||||
case 27:
|
||||
exit(1);
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
static void Draw(void)
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
glBegin(GL_TRIANGLES);
|
||||
glColor3f(0,0,1);
|
||||
glVertex3f( 0.9, -0.9, -30.0);
|
||||
glColor3f(1,0,0);
|
||||
glVertex3f( 0.9, 0.9, -30.0);
|
||||
glColor3f(0,1,0);
|
||||
glVertex3f(-0.9, 0.0, -30.0);
|
||||
glEnd();
|
||||
|
||||
glFlush();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
GLenum type;
|
||||
|
||||
glutInit(&argc, argv);
|
||||
|
||||
|
||||
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
|
||||
|
||||
type = GLUT_RGB;
|
||||
type |= GLUT_SINGLE;
|
||||
glutInitDisplayMode(type);
|
||||
|
||||
if (glutCreateWindow("First Tri") == GL_FALSE) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
Init();
|
||||
|
||||
glutReshapeFunc(Reshape);
|
||||
glutKeyboardFunc(Key);
|
||||
glutDisplayFunc(Draw);
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
113
progs/fp/tri-cos.c
Normal file
113
progs/fp/tri-cos.c
Normal file
@@ -0,0 +1,113 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
#include <GL/glut.h>
|
||||
#include "GL/gl.h"
|
||||
|
||||
|
||||
|
||||
static void Init( void )
|
||||
{
|
||||
static const char *modulate2D =
|
||||
"!!ARBfp1.0\n"
|
||||
"TEMP R0; \n"
|
||||
"MUL R0, fragment.color, {3.14}.x; \n"
|
||||
"COS result.color.x, R0.x; \n"
|
||||
"COS result.color.y, R0.y; \n"
|
||||
"COS result.color.z, R0.z; \n"
|
||||
"END"
|
||||
;
|
||||
GLuint modulateProg;
|
||||
|
||||
if (!glutExtensionSupported("GL_ARB_fragment_program")) {
|
||||
printf("Error: GL_ARB_fragment_program not supported!\n");
|
||||
exit(1);
|
||||
}
|
||||
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
|
||||
|
||||
/* Setup the fragment program */
|
||||
glGenProgramsARB(1, &modulateProg);
|
||||
glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
|
||||
glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
|
||||
strlen(modulate2D), (const GLubyte *)modulate2D);
|
||||
|
||||
printf("glGetError = 0x%x\n", (int) glGetError());
|
||||
printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
|
||||
(char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
|
||||
|
||||
glEnable(GL_FRAGMENT_PROGRAM_ARB);
|
||||
|
||||
glClearColor(.3, .3, .3, 0);
|
||||
}
|
||||
|
||||
static void Reshape(int width, int height)
|
||||
{
|
||||
|
||||
glViewport(0, 0, (GLint)width, (GLint)height);
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
}
|
||||
|
||||
static void Key(unsigned char key, int x, int y)
|
||||
{
|
||||
|
||||
switch (key) {
|
||||
case 27:
|
||||
exit(1);
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
static void Draw(void)
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
glBegin(GL_TRIANGLES);
|
||||
glColor3f(0,0,1);
|
||||
glVertex3f( 0.9, -0.9, -30.0);
|
||||
glColor3f(1,0,0);
|
||||
glVertex3f( 0.9, 0.9, -30.0);
|
||||
glColor3f(0,1,0);
|
||||
glVertex3f(-0.9, 0.0, -30.0);
|
||||
glEnd();
|
||||
|
||||
glFlush();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
GLenum type;
|
||||
|
||||
glutInit(&argc, argv);
|
||||
|
||||
|
||||
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
|
||||
|
||||
type = GLUT_RGB;
|
||||
type |= GLUT_SINGLE;
|
||||
glutInitDisplayMode(type);
|
||||
|
||||
if (glutCreateWindow("First Tri") == GL_FALSE) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
Init();
|
||||
|
||||
glutReshapeFunc(Reshape);
|
||||
glutKeyboardFunc(Key);
|
||||
glutDisplayFunc(Draw);
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
111
progs/fp/tri-depth.c
Normal file
111
progs/fp/tri-depth.c
Normal file
@@ -0,0 +1,111 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
#include <GL/glut.h>
|
||||
#include "GL/gl.h"
|
||||
|
||||
|
||||
|
||||
static void Init( void )
|
||||
{
|
||||
/* scale of 10.0 gives me a visible result on nv hardware.
|
||||
*/
|
||||
static const char *modulate2D =
|
||||
"!!ARBfp1.0\n"
|
||||
"MUL result.color, fragment.position.z, {10.0}.x; \n"
|
||||
"END"
|
||||
;
|
||||
GLuint modulateProg;
|
||||
|
||||
if (!glutExtensionSupported("GL_ARB_fragment_program")) {
|
||||
printf("Error: GL_ARB_fragment_program not supported!\n");
|
||||
exit(1);
|
||||
}
|
||||
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
|
||||
|
||||
/* Setup the fragment program */
|
||||
glGenProgramsARB(1, &modulateProg);
|
||||
glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
|
||||
glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
|
||||
strlen(modulate2D), (const GLubyte *)modulate2D);
|
||||
|
||||
printf("glGetError = 0x%x\n", (int) glGetError());
|
||||
printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
|
||||
(char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
|
||||
|
||||
glEnable(GL_FRAGMENT_PROGRAM_ARB);
|
||||
|
||||
glClearColor(.3, .3, .3, 0);
|
||||
}
|
||||
|
||||
static void Reshape(int width, int height)
|
||||
{
|
||||
|
||||
glViewport(0, 0, (GLint)width, (GLint)height);
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
}
|
||||
|
||||
static void Key(unsigned char key, int x, int y)
|
||||
{
|
||||
|
||||
switch (key) {
|
||||
case 27:
|
||||
exit(1);
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
static void Draw(void)
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
glBegin(GL_TRIANGLES);
|
||||
glColor3f(0,0,1);
|
||||
glVertex3f( 0.9, -0.9, -40.0);
|
||||
glColor3f(1,0,0);
|
||||
glVertex3f( 0.9, 0.9, -40.0);
|
||||
glColor3f(0,1,0);
|
||||
glVertex3f(-0.9, 0.0, -25.0);
|
||||
glEnd();
|
||||
|
||||
glFlush();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
GLenum type;
|
||||
|
||||
glutInit(&argc, argv);
|
||||
|
||||
|
||||
|
||||
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
|
||||
|
||||
type = GLUT_RGB;
|
||||
type |= GLUT_SINGLE;
|
||||
glutInitDisplayMode(type);
|
||||
|
||||
if (glutCreateWindow("First Tri") == GL_FALSE) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
Init();
|
||||
|
||||
glutReshapeFunc(Reshape);
|
||||
glutKeyboardFunc(Key);
|
||||
glutDisplayFunc(Draw);
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
116
progs/fp/tri-depth2.c
Normal file
116
progs/fp/tri-depth2.c
Normal file
@@ -0,0 +1,116 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
#include <GL/glut.h>
|
||||
#include "GL/gl.h"
|
||||
|
||||
|
||||
|
||||
static void Init( void )
|
||||
{
|
||||
/* scale of 10.0 gives me a visible result on nv hardware.
|
||||
*/
|
||||
static const char *modulate2D =
|
||||
"!!ARBfp1.0\n"
|
||||
"TEMP R0;\n"
|
||||
"MUL R0, fragment.position.z, {10.0}.x;\n"
|
||||
"MOV result.color, R0; \n"
|
||||
"END"
|
||||
;
|
||||
GLuint modulateProg;
|
||||
|
||||
if (!glutExtensionSupported("GL_ARB_fragment_program")) {
|
||||
printf("Error: GL_ARB_fragment_program not supported!\n");
|
||||
exit(1);
|
||||
}
|
||||
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
|
||||
|
||||
/* Setup the fragment program */
|
||||
glGenProgramsARB(1, &modulateProg);
|
||||
glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
|
||||
glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
|
||||
strlen(modulate2D), (const GLubyte *)modulate2D);
|
||||
|
||||
printf("glGetError = 0x%x\n", (int) glGetError());
|
||||
printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
|
||||
(char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
|
||||
|
||||
glEnable(GL_FRAGMENT_PROGRAM_ARB);
|
||||
|
||||
glClearColor(.3, .3, .3, 0);
|
||||
}
|
||||
|
||||
static void Reshape(int width, int height)
|
||||
{
|
||||
|
||||
glViewport(0, 0, (GLint)width, (GLint)height);
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
}
|
||||
|
||||
static void Key(unsigned char key, int x, int y)
|
||||
{
|
||||
|
||||
switch (key) {
|
||||
case 27:
|
||||
exit(1);
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
static void Draw(void)
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
|
||||
glBegin(GL_TRIANGLES);
|
||||
glColor3f(0,0,1);
|
||||
glVertex3f( 0.9, -0.9, -30.0);
|
||||
glVertex3f( 0.9, 0.9, -30.0);
|
||||
glVertex3f(-0.9, 0.0, -30.0);
|
||||
glColor3f(0,1,0);
|
||||
glVertex3f(-0.9, -0.9, -40.0);
|
||||
glVertex3f(-0.9, 0.9, -40.0);
|
||||
glVertex3f( 0.9, 0.0, -25.0);
|
||||
glEnd();
|
||||
|
||||
glFlush();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
GLenum type;
|
||||
|
||||
glutInit(&argc, argv);
|
||||
|
||||
|
||||
|
||||
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
|
||||
|
||||
type = GLUT_RGB | GLUT_DEPTH;
|
||||
type |= GLUT_SINGLE;
|
||||
glutInitDisplayMode(type);
|
||||
|
||||
if (glutCreateWindow("First Tri") == GL_FALSE) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
Init();
|
||||
|
||||
glutReshapeFunc(Reshape);
|
||||
glutKeyboardFunc(Key);
|
||||
glutDisplayFunc(Draw);
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
107
progs/fp/tri-depthwrite.c
Normal file
107
progs/fp/tri-depthwrite.c
Normal file
@@ -0,0 +1,107 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
#include <GL/glut.h>
|
||||
|
||||
|
||||
static void Init(void)
|
||||
{
|
||||
static const char *modulate2D =
|
||||
"!!ARBfp1.0\n"
|
||||
"MUL result.depth.z, fragment.color.z, {.1}.x; \n"
|
||||
"MOV result.color.xy, fragment.color; \n"
|
||||
"END"
|
||||
;
|
||||
GLuint modulateProg;
|
||||
|
||||
if (!glutExtensionSupported("GL_ARB_fragment_program")) {
|
||||
printf("Error: GL_ARB_fragment_program not supported!\n");
|
||||
exit(1);
|
||||
}
|
||||
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
|
||||
|
||||
/* Setup the fragment program */
|
||||
glGenProgramsARB(1, &modulateProg);
|
||||
glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
|
||||
glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
|
||||
strlen(modulate2D), (const GLubyte *)modulate2D);
|
||||
|
||||
printf("glGetError = 0x%x\n", (int) glGetError());
|
||||
printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
|
||||
(char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
|
||||
|
||||
glEnable(GL_FRAGMENT_PROGRAM_ARB);
|
||||
|
||||
glClearColor(.3, .3, .3, 0);
|
||||
}
|
||||
|
||||
static void Reshape(int width, int height)
|
||||
{
|
||||
|
||||
glViewport(0, 0, (GLint)width, (GLint)height);
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
}
|
||||
|
||||
static void Key(unsigned char key, int x, int y)
|
||||
{
|
||||
|
||||
switch (key) {
|
||||
case 27:
|
||||
exit(1);
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
static void Draw(void)
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
|
||||
|
||||
glBegin(GL_TRIANGLES);
|
||||
glColor4f(.8,0,.5,0);
|
||||
glVertex3f( 0.9, -0.9, -30.0);
|
||||
glVertex3f( 0.9, 0.9, -30.0);
|
||||
glVertex3f(-0.9, 0.0, -30.0);
|
||||
|
||||
glColor4f(0,.8,.7,0);
|
||||
glVertex3f(-0.9, -0.9, -40.0);
|
||||
glColor4f(0,.8,.7,0);
|
||||
glVertex3f(-0.9, 0.9, -40.0);
|
||||
glColor4f(0,.8,.3,0);
|
||||
glVertex3f( 0.9, 0.0, -40.0);
|
||||
glEnd();
|
||||
|
||||
glFlush();
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
glutInit(&argc, argv);
|
||||
|
||||
glutInitWindowPosition(0, 0); glutInitWindowSize( 300, 300);
|
||||
|
||||
glutInitDisplayMode(GLUT_DEPTH | GLUT_RGB | GLUT_SINGLE);
|
||||
|
||||
if (glutCreateWindow("Depth Test") == GL_FALSE) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
Init();
|
||||
|
||||
glutReshapeFunc(Reshape);
|
||||
glutKeyboardFunc(Key);
|
||||
glutDisplayFunc(Draw);
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
107
progs/fp/tri-depthwrite2.c
Normal file
107
progs/fp/tri-depthwrite2.c
Normal file
@@ -0,0 +1,107 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
#include <GL/glut.h>
|
||||
|
||||
|
||||
static void Init(void)
|
||||
{
|
||||
static const char *modulate2D =
|
||||
"!!ARBfp1.0\n"
|
||||
"MUL result.depth.z, fragment.color.z, {.1}.x; \n"
|
||||
"MOV result.color, fragment.color.z; \n"
|
||||
"END"
|
||||
;
|
||||
GLuint modulateProg;
|
||||
|
||||
if (!glutExtensionSupported("GL_ARB_fragment_program")) {
|
||||
printf("Error: GL_ARB_fragment_program not supported!\n");
|
||||
exit(1);
|
||||
}
|
||||
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
|
||||
|
||||
/* Setup the fragment program */
|
||||
glGenProgramsARB(1, &modulateProg);
|
||||
glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
|
||||
glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
|
||||
strlen(modulate2D), (const GLubyte *)modulate2D);
|
||||
|
||||
printf("glGetError = 0x%x\n", (int) glGetError());
|
||||
printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
|
||||
(char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
|
||||
|
||||
glEnable(GL_FRAGMENT_PROGRAM_ARB);
|
||||
|
||||
glClearColor(.3, .3, .3, 0);
|
||||
}
|
||||
|
||||
static void Reshape(int width, int height)
|
||||
{
|
||||
|
||||
glViewport(0, 0, (GLint)width, (GLint)height);
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
}
|
||||
|
||||
static void Key(unsigned char key, int x, int y)
|
||||
{
|
||||
|
||||
switch (key) {
|
||||
case 27:
|
||||
exit(1);
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
static void Draw(void)
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
|
||||
|
||||
glBegin(GL_TRIANGLES);
|
||||
glColor4f(.8,0,.5,0);
|
||||
glVertex3f( 0.9, -0.9, -30.0);
|
||||
glVertex3f( 0.9, 0.9, -30.0);
|
||||
glVertex3f(-0.9, 0.0, -30.0);
|
||||
|
||||
glColor4f(0,.8,.7,0);
|
||||
glVertex3f(-0.9, -0.9, -40.0);
|
||||
glColor4f(0,.8,.7,0);
|
||||
glVertex3f(-0.9, 0.9, -40.0);
|
||||
glColor4f(0,.8,.3,0);
|
||||
glVertex3f( 0.9, 0.0, -40.0);
|
||||
glEnd();
|
||||
|
||||
glFlush();
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
glutInit(&argc, argv);
|
||||
|
||||
glutInitWindowPosition(0, 0); glutInitWindowSize( 300, 300);
|
||||
|
||||
glutInitDisplayMode(GLUT_DEPTH | GLUT_RGB | GLUT_SINGLE);
|
||||
|
||||
if (glutCreateWindow("Depth Test") == GL_FALSE) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
Init();
|
||||
|
||||
glutReshapeFunc(Reshape);
|
||||
glutKeyboardFunc(Key);
|
||||
glutDisplayFunc(Draw);
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
109
progs/fp/tri-dp3.c
Normal file
109
progs/fp/tri-dp3.c
Normal file
@@ -0,0 +1,109 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
#include <GL/glut.h>
|
||||
|
||||
|
||||
|
||||
static void Init( void )
|
||||
{
|
||||
static const char *modulate2D =
|
||||
"!!ARBfp1.0\n"
|
||||
"TEMP R0;\n"
|
||||
"DP3 result.color, fragment.color, fragment.color; \n"
|
||||
"END"
|
||||
;
|
||||
GLuint modulateProg;
|
||||
|
||||
if (!glutExtensionSupported("GL_ARB_fragment_program")) {
|
||||
printf("Error: GL_ARB_fragment_program not supported!\n");
|
||||
exit(1);
|
||||
}
|
||||
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
|
||||
|
||||
/* Setup the fragment program */
|
||||
glGenProgramsARB(1, &modulateProg);
|
||||
glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
|
||||
glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
|
||||
strlen(modulate2D), (const GLubyte *)modulate2D);
|
||||
|
||||
printf("glGetError = 0x%x\n", (int) glGetError());
|
||||
printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
|
||||
(char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
|
||||
|
||||
glEnable(GL_FRAGMENT_PROGRAM_ARB);
|
||||
|
||||
glClearColor(.3, .3, .3, 0);
|
||||
}
|
||||
|
||||
static void Reshape(int width, int height)
|
||||
{
|
||||
|
||||
glViewport(0, 0, (GLint)width, (GLint)height);
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
}
|
||||
|
||||
static void Key(unsigned char key, int x, int y)
|
||||
{
|
||||
|
||||
switch (key) {
|
||||
case 27:
|
||||
exit(1);
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
static void Draw(void)
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
glBegin(GL_TRIANGLES);
|
||||
glColor3f(0,0,1);
|
||||
glVertex3f( 0.9, -0.9, -30.0);
|
||||
glColor3f(1,0,0);
|
||||
glVertex3f( 0.9, 0.9, -30.0);
|
||||
glColor3f(0,1,0);
|
||||
glVertex3f(-0.9, 0.0, -30.0);
|
||||
glEnd();
|
||||
|
||||
glFlush();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
GLenum type;
|
||||
|
||||
glutInit(&argc, argv);
|
||||
|
||||
|
||||
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
|
||||
|
||||
type = GLUT_RGB;
|
||||
type |= GLUT_SINGLE;
|
||||
glutInitDisplayMode(type);
|
||||
|
||||
if (glutCreateWindow("First Tri") == GL_FALSE) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
Init();
|
||||
|
||||
glutReshapeFunc(Reshape);
|
||||
glutKeyboardFunc(Key);
|
||||
glutDisplayFunc(Draw);
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
109
progs/fp/tri-dp4.c
Normal file
109
progs/fp/tri-dp4.c
Normal file
@@ -0,0 +1,109 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
#include <GL/glut.h>
|
||||
|
||||
|
||||
|
||||
static void Init( void )
|
||||
{
|
||||
static const char *modulate2D =
|
||||
"!!ARBfp1.0\n"
|
||||
"TEMP R0;\n"
|
||||
"DP4 result.color, fragment.color.xxxx, fragment.color; \n"
|
||||
"END"
|
||||
;
|
||||
GLuint modulateProg;
|
||||
|
||||
if (!glutExtensionSupported("GL_ARB_fragment_program")) {
|
||||
printf("Error: GL_ARB_fragment_program not supported!\n");
|
||||
exit(1);
|
||||
}
|
||||
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
|
||||
|
||||
/* Setup the fragment program */
|
||||
glGenProgramsARB(1, &modulateProg);
|
||||
glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
|
||||
glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
|
||||
strlen(modulate2D), (const GLubyte *)modulate2D);
|
||||
|
||||
printf("glGetError = 0x%x\n", (int) glGetError());
|
||||
printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
|
||||
(char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
|
||||
|
||||
glEnable(GL_FRAGMENT_PROGRAM_ARB);
|
||||
|
||||
glClearColor(.3, .3, .3, 0);
|
||||
}
|
||||
|
||||
static void Reshape(int width, int height)
|
||||
{
|
||||
|
||||
glViewport(0, 0, (GLint)width, (GLint)height);
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
}
|
||||
|
||||
static void Key(unsigned char key, int x, int y)
|
||||
{
|
||||
|
||||
switch (key) {
|
||||
case 27:
|
||||
exit(1);
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
static void Draw(void)
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
glBegin(GL_TRIANGLES);
|
||||
glColor3f(0,0,1);
|
||||
glVertex3f( 0.9, -0.9, -30.0);
|
||||
glColor3f(1,0,0);
|
||||
glVertex3f( 0.9, 0.9, -30.0);
|
||||
glColor3f(0,1,0);
|
||||
glVertex3f(-0.9, 0.0, -30.0);
|
||||
glEnd();
|
||||
|
||||
glFlush();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
GLenum type;
|
||||
|
||||
glutInit(&argc, argv);
|
||||
|
||||
|
||||
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
|
||||
|
||||
type = GLUT_RGB;
|
||||
type |= GLUT_SINGLE;
|
||||
glutInitDisplayMode(type);
|
||||
|
||||
if (glutCreateWindow("First Tri") == GL_FALSE) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
Init();
|
||||
|
||||
glutReshapeFunc(Reshape);
|
||||
glutKeyboardFunc(Key);
|
||||
glutDisplayFunc(Draw);
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
109
progs/fp/tri-dph.c
Normal file
109
progs/fp/tri-dph.c
Normal file
@@ -0,0 +1,109 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
#include <GL/glut.h>
|
||||
|
||||
|
||||
|
||||
static void Init( void )
|
||||
{
|
||||
static const char *modulate2D =
|
||||
"!!ARBfp1.0\n"
|
||||
"TEMP R0;\n"
|
||||
"DPH result.color, fragment.color, fragment.color.xyzx; \n"
|
||||
"END"
|
||||
;
|
||||
GLuint modulateProg;
|
||||
|
||||
if (!glutExtensionSupported("GL_ARB_fragment_program")) {
|
||||
printf("Error: GL_ARB_fragment_program not supported!\n");
|
||||
exit(1);
|
||||
}
|
||||
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
|
||||
|
||||
/* Setup the fragment program */
|
||||
glGenProgramsARB(1, &modulateProg);
|
||||
glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
|
||||
glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
|
||||
strlen(modulate2D), (const GLubyte *)modulate2D);
|
||||
|
||||
printf("glGetError = 0x%x\n", (int) glGetError());
|
||||
printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
|
||||
(char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
|
||||
|
||||
glEnable(GL_FRAGMENT_PROGRAM_ARB);
|
||||
|
||||
glClearColor(.3, .3, .3, 0);
|
||||
}
|
||||
|
||||
static void Reshape(int width, int height)
|
||||
{
|
||||
|
||||
glViewport(0, 0, (GLint)width, (GLint)height);
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
}
|
||||
|
||||
static void Key(unsigned char key, int x, int y)
|
||||
{
|
||||
|
||||
switch (key) {
|
||||
case 27:
|
||||
exit(1);
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
static void Draw(void)
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
glBegin(GL_TRIANGLES);
|
||||
glColor3f(0,0,1);
|
||||
glVertex3f( 0.9, -0.9, -30.0);
|
||||
glColor3f(1,0,0);
|
||||
glVertex3f( 0.9, 0.9, -30.0);
|
||||
glColor3f(0,1,0);
|
||||
glVertex3f(-0.9, 0.0, -30.0);
|
||||
glEnd();
|
||||
|
||||
glFlush();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
GLenum type;
|
||||
|
||||
glutInit(&argc, argv);
|
||||
|
||||
|
||||
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
|
||||
|
||||
type = GLUT_RGB;
|
||||
type |= GLUT_SINGLE;
|
||||
glutInitDisplayMode(type);
|
||||
|
||||
if (glutCreateWindow("First Tri") == GL_FALSE) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
Init();
|
||||
|
||||
glutReshapeFunc(Reshape);
|
||||
glutKeyboardFunc(Key);
|
||||
glutDisplayFunc(Draw);
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
109
progs/fp/tri-dst.c
Normal file
109
progs/fp/tri-dst.c
Normal file
@@ -0,0 +1,109 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
#include <GL/glut.h>
|
||||
#include "GL/gl.h"
|
||||
|
||||
|
||||
|
||||
static void Init( void )
|
||||
{
|
||||
static const char *modulate2D =
|
||||
"!!ARBfp1.0\n"
|
||||
"DST result.color, fragment.color, fragment.color; \n"
|
||||
"END"
|
||||
;
|
||||
GLuint modulateProg;
|
||||
|
||||
if (!glutExtensionSupported("GL_ARB_fragment_program")) {
|
||||
printf("Error: GL_ARB_fragment_program not supported!\n");
|
||||
exit(1);
|
||||
}
|
||||
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
|
||||
|
||||
/* Setup the fragment program */
|
||||
glGenProgramsARB(1, &modulateProg);
|
||||
glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
|
||||
glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
|
||||
strlen(modulate2D), (const GLubyte *)modulate2D);
|
||||
|
||||
printf("glGetError = 0x%x\n", (int) glGetError());
|
||||
printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
|
||||
(char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
|
||||
|
||||
glEnable(GL_FRAGMENT_PROGRAM_ARB);
|
||||
|
||||
glClearColor(.3, .3, .3, 0);
|
||||
}
|
||||
|
||||
static void Reshape(int width, int height)
|
||||
{
|
||||
|
||||
glViewport(0, 0, (GLint)width, (GLint)height);
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
}
|
||||
|
||||
static void Key(unsigned char key, int x, int y)
|
||||
{
|
||||
|
||||
switch (key) {
|
||||
case 27:
|
||||
exit(1);
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
static void Draw(void)
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
glBegin(GL_TRIANGLES);
|
||||
glColor3f(0,0,1);
|
||||
glVertex3f( 0.9, -0.9, -30.0);
|
||||
glColor3f(1,0,0);
|
||||
glVertex3f( 0.9, 0.9, -30.0);
|
||||
glColor3f(0,1,0);
|
||||
glVertex3f(-0.9, 0.0, -30.0);
|
||||
glEnd();
|
||||
|
||||
glFlush();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
GLenum type;
|
||||
|
||||
glutInit(&argc, argv);
|
||||
|
||||
|
||||
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
|
||||
|
||||
type = GLUT_RGB;
|
||||
type |= GLUT_SINGLE;
|
||||
glutInitDisplayMode(type);
|
||||
|
||||
if (glutCreateWindow("First Tri") == GL_FALSE) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
Init();
|
||||
|
||||
glutReshapeFunc(Reshape);
|
||||
glutKeyboardFunc(Key);
|
||||
glutDisplayFunc(Draw);
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
110
progs/fp/tri-ex2.c
Normal file
110
progs/fp/tri-ex2.c
Normal file
@@ -0,0 +1,110 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
#include <GL/glut.h>
|
||||
|
||||
|
||||
|
||||
static void Init( void )
|
||||
{
|
||||
static const char *modulate2D =
|
||||
"!!ARBfp1.0\n"
|
||||
"TEMP R0;\n"
|
||||
"EX2 R0, fragment.color.x; \n"
|
||||
"SUB result.color, R0, {1.0}.x; \n"
|
||||
"END"
|
||||
;
|
||||
GLuint modulateProg;
|
||||
|
||||
if (!glutExtensionSupported("GL_ARB_fragment_program")) {
|
||||
printf("Error: GL_ARB_fragment_program not supported!\n");
|
||||
exit(1);
|
||||
}
|
||||
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
|
||||
|
||||
/* Setup the fragment program */
|
||||
glGenProgramsARB(1, &modulateProg);
|
||||
glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
|
||||
glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
|
||||
strlen(modulate2D), (const GLubyte *)modulate2D);
|
||||
|
||||
printf("glGetError = 0x%x\n", (int) glGetError());
|
||||
printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
|
||||
(char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
|
||||
|
||||
glEnable(GL_FRAGMENT_PROGRAM_ARB);
|
||||
|
||||
glClearColor(.3, .3, .3, 0);
|
||||
}
|
||||
|
||||
static void Reshape(int width, int height)
|
||||
{
|
||||
|
||||
glViewport(0, 0, (GLint)width, (GLint)height);
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
}
|
||||
|
||||
static void Key(unsigned char key, int x, int y)
|
||||
{
|
||||
|
||||
switch (key) {
|
||||
case 27:
|
||||
exit(1);
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
static void Draw(void)
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
glBegin(GL_TRIANGLES);
|
||||
glColor3f(0,0,1);
|
||||
glVertex3f( 0.9, -0.9, -30.0);
|
||||
glColor3f(1,0,0);
|
||||
glVertex3f( 0.9, 0.9, -30.0);
|
||||
glColor3f(0,1,0);
|
||||
glVertex3f(-0.9, 0.0, -30.0);
|
||||
glEnd();
|
||||
|
||||
glFlush();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
GLenum type;
|
||||
|
||||
glutInit(&argc, argv);
|
||||
|
||||
|
||||
|
||||
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
|
||||
|
||||
type = GLUT_RGB;
|
||||
type |= GLUT_SINGLE;
|
||||
glutInitDisplayMode(type);
|
||||
|
||||
if (glutCreateWindow("First Tri") == GL_FALSE) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
Init();
|
||||
|
||||
glutReshapeFunc(Reshape);
|
||||
glutKeyboardFunc(Key);
|
||||
glutDisplayFunc(Draw);
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
110
progs/fp/tri-flr.c
Normal file
110
progs/fp/tri-flr.c
Normal file
@@ -0,0 +1,110 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
#include <GL/glut.h>
|
||||
|
||||
|
||||
|
||||
static void Init( void )
|
||||
{
|
||||
static const char *modulate2D =
|
||||
"!!ARBfp1.0\n"
|
||||
"TEMP R0;\n"
|
||||
"ADD R0, fragment.color, {0.5}.x; \n"
|
||||
"FLR result.color, R0; \n"
|
||||
"END"
|
||||
;
|
||||
GLuint modulateProg;
|
||||
|
||||
if (!glutExtensionSupported("GL_ARB_fragment_program")) {
|
||||
printf("Error: GL_ARB_fragment_program not supported!\n");
|
||||
exit(1);
|
||||
}
|
||||
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
|
||||
|
||||
/* Setup the fragment program */
|
||||
glGenProgramsARB(1, &modulateProg);
|
||||
glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
|
||||
glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
|
||||
strlen(modulate2D), (const GLubyte *)modulate2D);
|
||||
|
||||
printf("glGetError = 0x%x\n", (int) glGetError());
|
||||
printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
|
||||
(char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
|
||||
|
||||
glEnable(GL_FRAGMENT_PROGRAM_ARB);
|
||||
|
||||
glClearColor(.3, .3, .3, 0);
|
||||
}
|
||||
|
||||
static void Reshape(int width, int height)
|
||||
{
|
||||
|
||||
glViewport(0, 0, (GLint)width, (GLint)height);
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
}
|
||||
|
||||
static void Key(unsigned char key, int x, int y)
|
||||
{
|
||||
|
||||
switch (key) {
|
||||
case 27:
|
||||
exit(1);
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
static void Draw(void)
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
glBegin(GL_TRIANGLES);
|
||||
glColor3f(0,0,1);
|
||||
glVertex3f( 0.9, -0.9, -30.0);
|
||||
glColor3f(1,0,0);
|
||||
glVertex3f( 0.9, 0.9, -30.0);
|
||||
glColor3f(0,1,0);
|
||||
glVertex3f(-0.9, 0.0, -30.0);
|
||||
glEnd();
|
||||
|
||||
glFlush();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
GLenum type;
|
||||
|
||||
glutInit(&argc, argv);
|
||||
|
||||
|
||||
|
||||
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
|
||||
|
||||
type = GLUT_RGB;
|
||||
type |= GLUT_SINGLE;
|
||||
glutInitDisplayMode(type);
|
||||
|
||||
if (glutCreateWindow("First Tri") == GL_FALSE) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
Init();
|
||||
|
||||
glutReshapeFunc(Reshape);
|
||||
glutKeyboardFunc(Key);
|
||||
glutDisplayFunc(Draw);
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
109
progs/fp/tri-fp.c
Normal file
109
progs/fp/tri-fp.c
Normal file
@@ -0,0 +1,109 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
#include <GL/glut.h>
|
||||
#include "GL/gl.h"
|
||||
|
||||
|
||||
|
||||
static void Init( void )
|
||||
{
|
||||
static const char *modulate2D =
|
||||
"!!ARBfp1.0\n"
|
||||
"SLT result.color, {0.5}.x, fragment.color; \n"
|
||||
"END"
|
||||
;
|
||||
GLuint modulateProg;
|
||||
|
||||
if (!glutExtensionSupported("GL_ARB_fragment_program")) {
|
||||
printf("Error: GL_ARB_fragment_program not supported!\n");
|
||||
exit(1);
|
||||
}
|
||||
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
|
||||
|
||||
/* Setup the fragment program */
|
||||
glGenProgramsARB(1, &modulateProg);
|
||||
glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
|
||||
glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
|
||||
strlen(modulate2D), (const GLubyte *)modulate2D);
|
||||
|
||||
printf("glGetError = 0x%x\n", (int) glGetError());
|
||||
printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
|
||||
(char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
|
||||
|
||||
glEnable(GL_FRAGMENT_PROGRAM_ARB);
|
||||
|
||||
glClearColor(.3, .3, .3, 0);
|
||||
}
|
||||
|
||||
static void Reshape(int width, int height)
|
||||
{
|
||||
|
||||
glViewport(0, 0, (GLint)width, (GLint)height);
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
}
|
||||
|
||||
static void Key(unsigned char key, int x, int y)
|
||||
{
|
||||
|
||||
switch (key) {
|
||||
case 27:
|
||||
exit(1);
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
static void Draw(void)
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
glBegin(GL_TRIANGLES);
|
||||
glColor3f(0,0,1);
|
||||
glVertex3f( 0.9, -0.9, -30.0);
|
||||
glColor3f(1,0,0);
|
||||
glVertex3f( 0.9, 0.9, -30.0);
|
||||
glColor3f(0,1,0);
|
||||
glVertex3f(-0.9, 0.0, -30.0);
|
||||
glEnd();
|
||||
|
||||
glFlush();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
GLenum type;
|
||||
|
||||
glutInit(&argc, argv);
|
||||
|
||||
|
||||
|
||||
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
|
||||
|
||||
type = GLUT_RGB;
|
||||
type |= GLUT_SINGLE;
|
||||
glutInitDisplayMode(type);
|
||||
|
||||
if (glutCreateWindow("First Tri") == GL_FALSE) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
Init();
|
||||
|
||||
glutReshapeFunc(Reshape);
|
||||
glutKeyboardFunc(Key);
|
||||
glutDisplayFunc(Draw);
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
111
progs/fp/tri-frc.c
Normal file
111
progs/fp/tri-frc.c
Normal file
@@ -0,0 +1,111 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
#include <GL/glut.h>
|
||||
#include "GL/gl.h"
|
||||
|
||||
|
||||
|
||||
static void Init( void )
|
||||
{
|
||||
static const char *modulate2D =
|
||||
"!!ARBfp1.0\n"
|
||||
"TEMP R0; \n"
|
||||
"MUL R0, fragment.color, {3.0}.x; \n"
|
||||
"FRC result.color, R0; \n"
|
||||
"END"
|
||||
;
|
||||
GLuint modulateProg;
|
||||
|
||||
if (!glutExtensionSupported("GL_ARB_fragment_program")) {
|
||||
printf("Error: GL_ARB_fragment_program not supported!\n");
|
||||
exit(1);
|
||||
}
|
||||
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
|
||||
|
||||
/* Setup the fragment program */
|
||||
glGenProgramsARB(1, &modulateProg);
|
||||
glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
|
||||
glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
|
||||
strlen(modulate2D), (const GLubyte *)modulate2D);
|
||||
|
||||
printf("glGetError = 0x%x\n", (int) glGetError());
|
||||
printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
|
||||
(char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
|
||||
|
||||
glEnable(GL_FRAGMENT_PROGRAM_ARB);
|
||||
|
||||
glClearColor(.3, .3, .3, 0);
|
||||
}
|
||||
|
||||
static void Reshape(int width, int height)
|
||||
{
|
||||
|
||||
glViewport(0, 0, (GLint)width, (GLint)height);
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
}
|
||||
|
||||
static void Key(unsigned char key, int x, int y)
|
||||
{
|
||||
|
||||
switch (key) {
|
||||
case 27:
|
||||
exit(1);
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
static void Draw(void)
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
glBegin(GL_TRIANGLES);
|
||||
glColor3f(0,0,1);
|
||||
glVertex3f( 0.9, -0.9, -30.0);
|
||||
glColor3f(1,0,0);
|
||||
glVertex3f( 0.9, 0.9, -30.0);
|
||||
glColor3f(0,1,0);
|
||||
glVertex3f(-0.9, 0.0, -30.0);
|
||||
glEnd();
|
||||
|
||||
glFlush();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
GLenum type;
|
||||
|
||||
glutInit(&argc, argv);
|
||||
|
||||
|
||||
|
||||
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
|
||||
|
||||
type = GLUT_RGB;
|
||||
type |= GLUT_SINGLE;
|
||||
glutInitDisplayMode(type);
|
||||
|
||||
if (glutCreateWindow("First Tri") == GL_FALSE) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
Init();
|
||||
|
||||
glutReshapeFunc(Reshape);
|
||||
glutKeyboardFunc(Key);
|
||||
glutDisplayFunc(Draw);
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
109
progs/fp/tri-inv.c
Normal file
109
progs/fp/tri-inv.c
Normal file
@@ -0,0 +1,109 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
#include <GL/glut.h>
|
||||
|
||||
|
||||
|
||||
static void Init( void )
|
||||
{
|
||||
static const char *modulate2D =
|
||||
"!!ARBfp1.0\n"
|
||||
"TEMP R0;\n"
|
||||
"INV result.color, fragment.color; \n"
|
||||
"END"
|
||||
;
|
||||
GLuint modulateProg;
|
||||
|
||||
if (!glutExtensionSupported("GL_ARB_fragment_program")) {
|
||||
printf("Error: GL_ARB_fragment_program not supported!\n");
|
||||
exit(1);
|
||||
}
|
||||
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
|
||||
|
||||
/* Setup the fragment program */
|
||||
glGenProgramsARB(1, &modulateProg);
|
||||
glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
|
||||
glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
|
||||
strlen(modulate2D), (const GLubyte *)modulate2D);
|
||||
|
||||
printf("glGetError = 0x%x\n", (int) glGetError());
|
||||
printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
|
||||
(char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
|
||||
|
||||
glEnable(GL_FRAGMENT_PROGRAM_ARB);
|
||||
|
||||
glClearColor(.3, .3, .3, 0);
|
||||
}
|
||||
|
||||
static void Reshape(int width, int height)
|
||||
{
|
||||
|
||||
glViewport(0, 0, (GLint)width, (GLint)height);
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
}
|
||||
|
||||
static void Key(unsigned char key, int x, int y)
|
||||
{
|
||||
|
||||
switch (key) {
|
||||
case 27:
|
||||
exit(1);
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
static void Draw(void)
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
glBegin(GL_TRIANGLES);
|
||||
glColor3f(0,0,1);
|
||||
glVertex3f( 0.9, -0.9, -30.0);
|
||||
glColor3f(1,0,0);
|
||||
glVertex3f( 0.9, 0.9, -30.0);
|
||||
glColor3f(0,1,0);
|
||||
glVertex3f(-0.9, 0.0, -30.0);
|
||||
glEnd();
|
||||
|
||||
glFlush();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
GLenum type;
|
||||
|
||||
glutInit(&argc, argv);
|
||||
|
||||
|
||||
|
||||
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
|
||||
|
||||
type = GLUT_RGB;
|
||||
type |= GLUT_SINGLE;
|
||||
glutInitDisplayMode(type);
|
||||
|
||||
if (glutCreateWindow("First Tri") == GL_FALSE) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
Init();
|
||||
|
||||
glutReshapeFunc(Reshape);
|
||||
glutKeyboardFunc(Key);
|
||||
glutDisplayFunc(Draw);
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
111
progs/fp/tri-kil.c
Normal file
111
progs/fp/tri-kil.c
Normal file
@@ -0,0 +1,111 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
#include <GL/glut.h>
|
||||
|
||||
|
||||
|
||||
static void Init( void )
|
||||
{
|
||||
static const char *modulate2D =
|
||||
"!!ARBfp1.0\n"
|
||||
"TEMP R0;\n"
|
||||
"SUB R0, fragment.color, {0.5,0,0,0}; \n"
|
||||
"KIL R0;"
|
||||
"MOV result.color, R0;"
|
||||
"END"
|
||||
;
|
||||
GLuint modulateProg;
|
||||
|
||||
if (!glutExtensionSupported("GL_ARB_fragment_program")) {
|
||||
printf("Error: GL_ARB_fragment_program not supported!\n");
|
||||
exit(1);
|
||||
}
|
||||
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
|
||||
|
||||
/* Setup the fragment program */
|
||||
glGenProgramsARB(1, &modulateProg);
|
||||
glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
|
||||
glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
|
||||
strlen(modulate2D), (const GLubyte *)modulate2D);
|
||||
|
||||
printf("glGetError = 0x%x\n", (int) glGetError());
|
||||
printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
|
||||
(char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
|
||||
|
||||
glEnable(GL_FRAGMENT_PROGRAM_ARB);
|
||||
|
||||
glClearColor(.3, .3, .3, 0);
|
||||
}
|
||||
|
||||
static void Reshape(int width, int height)
|
||||
{
|
||||
|
||||
glViewport(0, 0, (GLint)width, (GLint)height);
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
}
|
||||
|
||||
static void Key(unsigned char key, int x, int y)
|
||||
{
|
||||
|
||||
switch (key) {
|
||||
case 27:
|
||||
exit(1);
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
static void Draw(void)
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
glBegin(GL_TRIANGLES);
|
||||
glColor3f(0,0,1);
|
||||
glVertex3f( 0.9, -0.9, -30.0);
|
||||
glColor3f(1,0,0);
|
||||
glVertex3f( 0.9, 0.9, -30.0);
|
||||
glColor3f(0,1,0);
|
||||
glVertex3f(-0.9, 0.0, -30.0);
|
||||
glEnd();
|
||||
|
||||
glFlush();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
GLenum type;
|
||||
|
||||
glutInit(&argc, argv);
|
||||
|
||||
|
||||
|
||||
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
|
||||
|
||||
type = GLUT_RGB;
|
||||
type |= GLUT_SINGLE;
|
||||
glutInitDisplayMode(type);
|
||||
|
||||
if (glutCreateWindow("First Tri") == GL_FALSE) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
Init();
|
||||
|
||||
glutReshapeFunc(Reshape);
|
||||
glutKeyboardFunc(Key);
|
||||
glutDisplayFunc(Draw);
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
110
progs/fp/tri-lg2.c
Normal file
110
progs/fp/tri-lg2.c
Normal file
@@ -0,0 +1,110 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
#include <GL/glut.h>
|
||||
|
||||
|
||||
|
||||
static void Init( void )
|
||||
{
|
||||
static const char *modulate2D =
|
||||
"!!ARBfp1.0\n"
|
||||
"TEMP R0;\n"
|
||||
"MUL R0, fragment.color, {4.0}.x; \n"
|
||||
"LG2 result.color, R0.x; \n"
|
||||
"END"
|
||||
;
|
||||
GLuint modulateProg;
|
||||
|
||||
if (!glutExtensionSupported("GL_ARB_fragment_program")) {
|
||||
printf("Error: GL_ARB_fragment_program not supported!\n");
|
||||
exit(1);
|
||||
}
|
||||
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
|
||||
|
||||
/* Setup the fragment program */
|
||||
glGenProgramsARB(1, &modulateProg);
|
||||
glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
|
||||
glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
|
||||
strlen(modulate2D), (const GLubyte *)modulate2D);
|
||||
|
||||
printf("glGetError = 0x%x\n", (int) glGetError());
|
||||
printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
|
||||
(char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
|
||||
|
||||
glEnable(GL_FRAGMENT_PROGRAM_ARB);
|
||||
|
||||
glClearColor(.3, .3, .3, 0);
|
||||
}
|
||||
|
||||
static void Reshape(int width, int height)
|
||||
{
|
||||
|
||||
glViewport(0, 0, (GLint)width, (GLint)height);
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
}
|
||||
|
||||
static void Key(unsigned char key, int x, int y)
|
||||
{
|
||||
|
||||
switch (key) {
|
||||
case 27:
|
||||
exit(1);
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
static void Draw(void)
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
glBegin(GL_TRIANGLES);
|
||||
glColor3f(0,0,1);
|
||||
glVertex3f( 0.9, -0.9, -30.0);
|
||||
glColor3f(1,0,0);
|
||||
glVertex3f( 0.9, 0.9, -30.0);
|
||||
glColor3f(0,1,0);
|
||||
glVertex3f(-0.9, 0.0, -30.0);
|
||||
glEnd();
|
||||
|
||||
glFlush();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
GLenum type;
|
||||
|
||||
glutInit(&argc, argv);
|
||||
|
||||
|
||||
|
||||
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
|
||||
|
||||
type = GLUT_RGB;
|
||||
type |= GLUT_SINGLE;
|
||||
glutInitDisplayMode(type);
|
||||
|
||||
if (glutCreateWindow("First Tri") == GL_FALSE) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
Init();
|
||||
|
||||
glutReshapeFunc(Reshape);
|
||||
glutKeyboardFunc(Key);
|
||||
glutDisplayFunc(Draw);
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user