Compare commits
875 Commits
mesa_20050
...
texman_0_1
Author | SHA1 | Date | |
---|---|---|---|
|
b3b325e560 | ||
|
382ce985ac | ||
|
54b7eca7a0 | ||
|
f74e06bf11 | ||
|
9c02649d18 | ||
|
2c34704e41 | ||
|
85d0041ff0 | ||
|
67ff8b354e | ||
|
08e7957571 | ||
|
9c1f7089d8 | ||
|
5381ac5f11 | ||
|
a6f78d4eee | ||
|
ae695e3566 | ||
|
c82c3335e1 | ||
|
f8246f504b | ||
|
499458bcdb | ||
|
37a53fd6a0 | ||
|
5ec38fb2ea | ||
|
11c0215bf8 | ||
|
6a13b6c346 | ||
|
a103097ee5 | ||
|
7efad0d84c | ||
|
42c88cd072 | ||
|
2541c54e79 | ||
|
33529e3d8e | ||
|
84c1b82081 | ||
|
a97a1439ae | ||
|
2fd2910010 | ||
|
fbbda155e0 | ||
|
a49c3c0fae | ||
|
baf5998d59 | ||
|
4c5acef241 | ||
|
9839e272cf | ||
|
b57e79ff14 | ||
|
43824acb4e | ||
|
d8f509e749 | ||
|
eb91c93c2e | ||
|
79de983b6f | ||
|
fdb3acf016 | ||
|
2807d1f58a | ||
|
93f913926e | ||
|
33ca04f379 | ||
|
398cb30c72 | ||
|
f67bb30314 | ||
|
4578d7b9f0 | ||
|
dcdfc154c3 | ||
|
696ba32779 | ||
|
dcfe55539f | ||
|
ff84b1f1b2 | ||
|
3bca9c47f4 | ||
|
d4d7fdb43b | ||
|
d65dab5777 | ||
|
638ca019ef | ||
|
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 | ||
|
1585c234e0 | ||
|
9f23a3a1bf | ||
|
3e36986e5a | ||
|
67d94e5a86 | ||
|
a7df74ea02 | ||
|
36d6e9df16 | ||
|
ab7c6ffadc | ||
|
1361398600 | ||
|
5c6fd3dd4c | ||
|
a08d8a095c | ||
|
5f1ba3e21b | ||
|
1201348a33 | ||
|
800c72ae61 | ||
|
7c1ab40898 | ||
|
8dcc6736ab | ||
|
e9dbe58b8b | ||
|
c39bf5e273 | ||
|
7d40d230fa | ||
|
3e2419a7cc | ||
|
70cf1f0cf8 | ||
|
60a6a0eb51 | ||
|
fea5a428e9 | ||
|
61e694f270 | ||
|
db251d72c8 | ||
|
7a37189adc | ||
|
f87bb14b0b | ||
|
dff11bb9a8 | ||
|
98b06bcbeb | ||
|
7b5c506c0e | ||
|
7cf480e6fe | ||
|
951dbf08e7 | ||
|
49e74989c3 | ||
|
3e8efc3753 | ||
|
aeb0ee771b | ||
|
6ae76788a7 | ||
|
e98494d0a4 | ||
|
18014525a1 | ||
|
2276679c53 | ||
|
d4596584f6 | ||
|
6bb49eacfd | ||
|
bfb5ea307e | ||
|
364ae78e69 | ||
|
8d7d9c22f6 | ||
|
2d47c07398 | ||
|
7e152b83cb | ||
|
ed886336e1 | ||
|
5343ae8304 | ||
|
df88dfe1df | ||
|
c235a96a71 | ||
|
aa8ff1e75d | ||
|
9bdfee3a47 | ||
|
e0e993c5ff | ||
|
c529f6bf70 |
228
Makefile
228
Makefile
@@ -89,6 +89,7 @@ linux-dri \
|
||||
linux-dri-x86 \
|
||||
linux-dri-x86-64 \
|
||||
linux-dri-ppc \
|
||||
linux-indirect \
|
||||
linux-fbdev \
|
||||
linux-glide \
|
||||
linux-icc \
|
||||
@@ -133,11 +134,12 @@ ultrix-gcc:
|
||||
|
||||
# Rules for making release tarballs
|
||||
|
||||
DIRECTORY = Mesa-6.3
|
||||
LIB_NAME = MesaLib-6.3
|
||||
DEMO_NAME = MesaDemos-6.3
|
||||
DIRECTORY = Mesa-6.5
|
||||
LIB_NAME = MesaLib-6.5
|
||||
DEMO_NAME = MesaDemos-6.5
|
||||
GLUT_NAME = MesaGLUT-6.5
|
||||
|
||||
LIB_FILES = \
|
||||
MAIN_FILES = \
|
||||
$(DIRECTORY)/Makefile* \
|
||||
$(DIRECTORY)/descrip.mms \
|
||||
$(DIRECTORY)/mms-config. \
|
||||
@@ -151,8 +153,9 @@ LIB_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 \
|
||||
@@ -173,6 +176,7 @@ LIB_FILES = \
|
||||
$(DIRECTORY)/include/GL/xmesa.h \
|
||||
$(DIRECTORY)/include/GL/xmesa_x.h \
|
||||
$(DIRECTORY)/include/GL/xmesa_xf86.h \
|
||||
$(DIRECTORY)/include/GLView.h \
|
||||
$(DIRECTORY)/src/Makefile \
|
||||
$(DIRECTORY)/src/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/Makefile* \
|
||||
@@ -210,7 +214,6 @@ LIB_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] \
|
||||
@@ -237,37 +240,6 @@ LIB_FILES = \
|
||||
$(DIRECTORY)/src/mesa/x86/rtasm/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/x86-64/*.[chS] \
|
||||
$(DIRECTORY)/src/mesa/x86-64/Makefile \
|
||||
$(DIRECTORY)/src/glu/Makefile \
|
||||
$(DIRECTORY)/src/glu/descrip.mms \
|
||||
$(DIRECTORY)/src/glu/sgi/Makefile \
|
||||
$(DIRECTORY)/src/glu/sgi/Makefile.win \
|
||||
$(DIRECTORY)/src/glu/sgi/Makefile.DJ \
|
||||
$(DIRECTORY)/src/glu/sgi/glu.def \
|
||||
$(DIRECTORY)/src/glu/sgi/dummy.cc \
|
||||
$(DIRECTORY)/src/glu/sgi/descrip.mms \
|
||||
$(DIRECTORY)/src/glu/sgi/mesaglu.opt \
|
||||
$(DIRECTORY)/src/glu/sgi/include/gluos.h \
|
||||
$(DIRECTORY)/src/glu/sgi/libnurbs/interface/*.h \
|
||||
$(DIRECTORY)/src/glu/sgi/libnurbs/interface/*.cc \
|
||||
$(DIRECTORY)/src/glu/sgi/libnurbs/internals/*.h \
|
||||
$(DIRECTORY)/src/glu/sgi/libnurbs/internals/*.cc \
|
||||
$(DIRECTORY)/src/glu/sgi/libnurbs/nurbtess/*.h \
|
||||
$(DIRECTORY)/src/glu/sgi/libnurbs/nurbtess/*.cc \
|
||||
$(DIRECTORY)/src/glu/sgi/libtess/README \
|
||||
$(DIRECTORY)/src/glu/sgi/libtess/alg-outline \
|
||||
$(DIRECTORY)/src/glu/sgi/libtess/*.[ch] \
|
||||
$(DIRECTORY)/src/glu/sgi/libutil/*.[ch] \
|
||||
$(DIRECTORY)/src/glu/mesa/README[12] \
|
||||
$(DIRECTORY)/src/glu/mesa/Makefile* \
|
||||
$(DIRECTORY)/src/glu/mesa/descrip.mms \
|
||||
$(DIRECTORY)/src/glu/mesa/mms_depend \
|
||||
$(DIRECTORY)/src/glu/mesa/*.def \
|
||||
$(DIRECTORY)/src/glu/mesa/depend \
|
||||
$(DIRECTORY)/src/glu/mesa/*.[ch] \
|
||||
$(DIRECTORY)/src/glw/*.[ch] \
|
||||
$(DIRECTORY)/src/glw/Makefile* \
|
||||
$(DIRECTORY)/src/glw/README \
|
||||
$(DIRECTORY)/src/glw/depend \
|
||||
$(DIRECTORY)/progs/Makefile \
|
||||
$(DIRECTORY)/progs/util/README \
|
||||
$(DIRECTORY)/progs/util/*.[ch] \
|
||||
@@ -287,6 +259,88 @@ LIB_FILES = \
|
||||
$(DIRECTORY)/windows/VC7/mesa/mesa/mesa.vcproj \
|
||||
$(DIRECTORY)/windows/VC7/mesa/osmesa/osmesa.vcproj
|
||||
|
||||
DRI_FILES = \
|
||||
$(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/xmlpool/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/common/xmlpool/*.po \
|
||||
$(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]
|
||||
|
||||
SGI_GLU_FILES = \
|
||||
$(DIRECTORY)/src/glu/Makefile \
|
||||
$(DIRECTORY)/src/glu/descrip.mms \
|
||||
$(DIRECTORY)/src/glu/sgi/Makefile \
|
||||
$(DIRECTORY)/src/glu/sgi/Makefile.win \
|
||||
$(DIRECTORY)/src/glu/sgi/Makefile.DJ \
|
||||
$(DIRECTORY)/src/glu/sgi/glu.def \
|
||||
$(DIRECTORY)/src/glu/sgi/dummy.cc \
|
||||
$(DIRECTORY)/src/glu/sgi/descrip.mms \
|
||||
$(DIRECTORY)/src/glu/sgi/mesaglu.opt \
|
||||
$(DIRECTORY)/src/glu/sgi/include/gluos.h \
|
||||
$(DIRECTORY)/src/glu/sgi/libnurbs/interface/*.h \
|
||||
$(DIRECTORY)/src/glu/sgi/libnurbs/interface/*.cc \
|
||||
$(DIRECTORY)/src/glu/sgi/libnurbs/internals/*.h \
|
||||
$(DIRECTORY)/src/glu/sgi/libnurbs/internals/*.cc \
|
||||
$(DIRECTORY)/src/glu/sgi/libnurbs/nurbtess/*.h \
|
||||
$(DIRECTORY)/src/glu/sgi/libnurbs/nurbtess/*.cc \
|
||||
$(DIRECTORY)/src/glu/sgi/libtess/README \
|
||||
$(DIRECTORY)/src/glu/sgi/libtess/alg-outline \
|
||||
$(DIRECTORY)/src/glu/sgi/libtess/*.[ch] \
|
||||
$(DIRECTORY)/src/glu/sgi/libutil/*.[ch]
|
||||
|
||||
MESA_GLU_FILES = \
|
||||
$(DIRECTORY)/src/glu/mesa/README[12] \
|
||||
$(DIRECTORY)/src/glu/mesa/Makefile* \
|
||||
$(DIRECTORY)/src/glu/mesa/descrip.mms \
|
||||
$(DIRECTORY)/src/glu/mesa/mms_depend \
|
||||
$(DIRECTORY)/src/glu/mesa/*.def \
|
||||
$(DIRECTORY)/src/glu/mesa/depend \
|
||||
$(DIRECTORY)/src/glu/mesa/*.[ch]
|
||||
|
||||
GLW_FILES = \
|
||||
$(DIRECTORY)/src/glw/*.[ch] \
|
||||
$(DIRECTORY)/src/glw/Makefile* \
|
||||
$(DIRECTORY)/src/glw/README \
|
||||
$(DIRECTORY)/src/glw/depend
|
||||
|
||||
DEMO_FILES = \
|
||||
$(DIRECTORY)/progs/beos/*.cpp \
|
||||
$(DIRECTORY)/progs/beos/Makefile \
|
||||
$(DIRECTORY)/progs/images/*.rgb \
|
||||
$(DIRECTORY)/progs/images/*.rgba \
|
||||
$(DIRECTORY)/progs/demos/Makefile* \
|
||||
$(DIRECTORY)/progs/demos/descrip.mms \
|
||||
$(DIRECTORY)/progs/demos/*.[ch] \
|
||||
$(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] \
|
||||
$(DIRECTORY)/progs/redbook/Makefile* \
|
||||
$(DIRECTORY)/progs/redbook/README \
|
||||
$(DIRECTORY)/progs/redbook/*.[ch] \
|
||||
$(DIRECTORY)/progs/samples/Makefile* \
|
||||
$(DIRECTORY)/progs/samples/README \
|
||||
$(DIRECTORY)/progs/samples/*.c \
|
||||
$(DIRECTORY)/progs/windml/Makefile.ugl \
|
||||
$(DIRECTORY)/progs/windml/*.c \
|
||||
$(DIRECTORY)/progs/windml/*.bmp \
|
||||
$(DIRECTORY)/progs/ggi/*.c \
|
||||
$(DIRECTORY)/windows/VC6/progs/demos/*.dsp \
|
||||
$(DIRECTORY)/windows/VC6/progs/progs.dsw \
|
||||
$(DIRECTORY)/windows/VC7/progs/demos/*.vcproj \
|
||||
$(DIRECTORY)/windows/VC7/progs/progs.sln
|
||||
|
||||
GLUT_FILES = \
|
||||
$(DIRECTORY)/include/GL/glut.h \
|
||||
@@ -304,100 +358,87 @@ 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
|
||||
|
||||
|
||||
DEMO_FILES = \
|
||||
$(DIRECTORY)/progs/beos/*.cpp \
|
||||
$(DIRECTORY)/progs/beos/Makefile \
|
||||
$(DIRECTORY)/progs/images/*.rgb \
|
||||
$(DIRECTORY)/progs/images/*.rgba \
|
||||
$(DIRECTORY)/progs/demos/Makefile* \
|
||||
$(DIRECTORY)/progs/demos/descrip.mms \
|
||||
$(DIRECTORY)/progs/demos/*.[ch] \
|
||||
$(DIRECTORY)/progs/demos/*.cxx \
|
||||
$(DIRECTORY)/progs/demos/*.dat \
|
||||
$(DIRECTORY)/progs/demos/README \
|
||||
$(DIRECTORY)/progs/xdemos/Makefile* \
|
||||
$(DIRECTORY)/progs/xdemos/descrip.mms \
|
||||
$(DIRECTORY)/progs/xdemos/*.[chf] \
|
||||
$(DIRECTORY)/progs/redbook/Makefile* \
|
||||
$(DIRECTORY)/progs/redbook/README \
|
||||
$(DIRECTORY)/progs/redbook/*.[ch] \
|
||||
$(DIRECTORY)/progs/samples/Makefile* \
|
||||
$(DIRECTORY)/progs/samples/README \
|
||||
$(DIRECTORY)/progs/samples/*.c \
|
||||
$(DIRECTORY)/progs/windml/Makefile.ugl \
|
||||
$(DIRECTORY)/progs/windml/*.c \
|
||||
$(DIRECTORY)/progs/windml/*.bmp \
|
||||
$(DIRECTORY)/progs/ggi/*.c \
|
||||
$(DIRECTORY)/windows/VC6/progs/demos/*.dsp \
|
||||
$(DIRECTORY)/src/glut/ggi/Makefile \
|
||||
$(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
|
||||
$(DIRECTORY)/windows/VC7/progs/glut/glut.vcproj
|
||||
|
||||
DEPEND_FILES = \
|
||||
$(TOP)/src/mesa/depend \
|
||||
$(TOP)/src/glw/depend \
|
||||
$(TOP)/src/glut/glx/depend \
|
||||
$(TOP)/src/glu/sgi/depend
|
||||
|
||||
|
||||
DRI_FILES = \
|
||||
$(DIRECTORY)/src/glx/Makefile \
|
||||
$(DIRECTORY)/src/glx/mini/*.[ch] \
|
||||
$(DIRECTORY)/src/glx/mini/example.miniglx.conf \
|
||||
$(DIRECTORY)/src/glx/mini/NOTES \
|
||||
$(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/dri_client/imports/*.h \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/*/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/*/depend \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/*/Makefile \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/*/Doxyfile \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/*/server/*.[ch]
|
||||
LIB_FILES = $(MAIN_FILES) $(DRI_FILES) $(SGI_GLU_FILES) $(GLW_FILES)
|
||||
|
||||
|
||||
# Everything for new a Mesa release:
|
||||
tarballs: 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:
|
||||
@for dep in $(DEPEND_FILES) ; do \
|
||||
rm -f $$dep ; \
|
||||
touch $$dep ; \
|
||||
done
|
||||
|
||||
lib_gz:
|
||||
rm -f configs/current ; \
|
||||
cd .. ; \
|
||||
tar -cvf $(LIB_NAME).tar $(LIB_FILES) ; \
|
||||
tar -cf $(LIB_NAME).tar $(LIB_FILES) ; \
|
||||
gzip $(LIB_NAME).tar ; \
|
||||
mv $(LIB_NAME).tar.gz $(DIRECTORY)
|
||||
|
||||
demo_gz:
|
||||
cd .. ; \
|
||||
tar -cvf $(DEMO_NAME).tar $(DEMO_FILES) $(GLUT_FILES) ; \
|
||||
tar -cf $(DEMO_NAME).tar $(DEMO_FILES) ; \
|
||||
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 .. ; \
|
||||
tar -cvf $(LIB_NAME).tar $(LIB_FILES) ; \
|
||||
tar -cf $(LIB_NAME).tar $(LIB_FILES) ; \
|
||||
bzip2 $(LIB_NAME).tar ; \
|
||||
mv $(LIB_NAME).tar.bz2 $(DIRECTORY)
|
||||
|
||||
demo_bz2:
|
||||
cd .. ; \
|
||||
tar -cvf $(DEMO_NAME).tar $(DEMO_FILES) $(GLUT_FILES) ; \
|
||||
tar -cf $(DEMO_NAME).tar $(DEMO_FILES) ; \
|
||||
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 $(LIB_NAME).zip ; \
|
||||
rm -f $(LIB_NAME).zip ; \
|
||||
cd .. ; \
|
||||
zip -r $(LIB_NAME).zip $(LIB_FILES) ; \
|
||||
zip -qr $(LIB_NAME).zip $(LIB_FILES) ; \
|
||||
mv $(LIB_NAME).zip $(DIRECTORY)
|
||||
|
||||
demo_zip:
|
||||
-rm $(DEMO_NAME).zip ; \
|
||||
rm -f $(DEMO_NAME).zip ; \
|
||||
cd .. ; \
|
||||
zip -r $(DEMO_NAME).zip $(DEMO_FILES) $(GLUT_FILES) ; \
|
||||
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
|
||||
@@ -405,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,16 @@ 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"
|
||||
else
|
||||
CP_FLAGS="-fd"
|
||||
fi
|
||||
|
||||
|
||||
set -v
|
||||
|
||||
@@ -56,7 +65,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."
|
||||
|
275
bin/mklib
275
bin/mklib
@@ -1,38 +1,28 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Make a shared library.
|
||||
# Basically do a switch/case depending on the OS and make a shared (or static)
|
||||
# library conforming to that OS.
|
||||
# This script should be useful for projects other than Mesa.
|
||||
# Improvements/fixes are welcome.
|
||||
|
||||
|
||||
# Usage:
|
||||
# mklib [options] objects ...
|
||||
# Options:
|
||||
# -o LIBRARY specifies the name of resulting library
|
||||
# ("-o GL" for example, might result in "libGL.so" being made)
|
||||
# -major N specifies major version number (default is 1)
|
||||
# -minor N specifies minor version number (default is 0)
|
||||
# -patch N specifies patch version number (default is 0)
|
||||
# -lLIBRARY specifies a dependency on LIBRARY
|
||||
# -LDIR search in DIR for library dependencies
|
||||
# -cplusplus link with C++ runtime
|
||||
# -static make a static library (default is dynamic/shared)
|
||||
# -install DIR move resulting library file(s) to DIR
|
||||
# -arch ARCH override using `uname` to determine architecture
|
||||
# -archopt OPT specify an extra achitecture-specific option OPT
|
||||
# -noprefix don't prefix library name with "lib" or any suffix
|
||||
# -exports FILE only export the symbols listed in FILE
|
||||
# Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
|
||||
#
|
||||
# The library name should just be "GL" or "GLU", etc. The 'lib' prefix
|
||||
# will be added here if needed, as well as the ".so" or ".a" suffix,
|
||||
# etc (unless the -noprefix option is used).
|
||||
# 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:
|
||||
#
|
||||
# objects should be: foo.o bar.o etc.o
|
||||
#
|
||||
# Environment variables recognized:
|
||||
# CC C compiler command
|
||||
# CXX C++ compiler command
|
||||
# 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.
|
||||
|
||||
|
||||
#
|
||||
@@ -43,6 +33,7 @@ MAJOR=1
|
||||
MINOR=0
|
||||
PATCH=""
|
||||
DEPS=""
|
||||
LINK=""
|
||||
CPLUSPLUS=0
|
||||
STATIC=0
|
||||
INSTALLDIR="."
|
||||
@@ -58,26 +49,93 @@ EXPORTS=""
|
||||
while true
|
||||
do
|
||||
case $1 in
|
||||
'-o') shift 1; LIBNAME=$1;;
|
||||
'-major') shift 1; MAJOR=$1;;
|
||||
'-minor') shift 1; MINOR=$1;;
|
||||
'-patch') shift 1; PATCH=$1;;
|
||||
-l*) DEPS="$DEPS $1";;
|
||||
-L*) DEPS="$DEPS $1";;
|
||||
'-cplusplus') CPLUSPLUS=1;;
|
||||
'-static') STATIC=1;;
|
||||
'-install') shift 1; INSTALLDIR=$1;;
|
||||
'-arch') shift 1; ARCH=$1;;
|
||||
'-archopt') shift 1; ARCHOPT=$1;;
|
||||
'-noprefix') NOPREFIX=1;;
|
||||
'-exports') shift 1; EXPORTS=$1;;
|
||||
-*) echo "mklib: Unknown option: " $1 ; exit 1;;
|
||||
*) break
|
||||
'-h' | '--help')
|
||||
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')
|
||||
shift 1;
|
||||
LIBNAME=$1
|
||||
;;
|
||||
'-major')
|
||||
shift 1;
|
||||
MAJOR=$1
|
||||
;;
|
||||
'-minor')
|
||||
shift 1;
|
||||
MINOR=$1
|
||||
;;
|
||||
'-patch')
|
||||
shift 1;
|
||||
PATCH=$1
|
||||
;;
|
||||
'-linker')
|
||||
shift 1;
|
||||
LINK=$1
|
||||
;;
|
||||
-l*)
|
||||
DEPS="$DEPS $1"
|
||||
;;
|
||||
-L*)
|
||||
DEPS="$DEPS $1"
|
||||
;;
|
||||
'-cplusplus')
|
||||
CPLUSPLUS=1
|
||||
;;
|
||||
'-static')
|
||||
STATIC=1
|
||||
;;
|
||||
'-install')
|
||||
shift 1;
|
||||
INSTALLDIR=$1
|
||||
;;
|
||||
'-arch')
|
||||
shift 1;
|
||||
ARCH=$1
|
||||
;;
|
||||
'-archopt')
|
||||
shift 1;
|
||||
ARCHOPT=$1
|
||||
;;
|
||||
'-noprefix')
|
||||
NOPREFIX=1
|
||||
;;
|
||||
'-exports')
|
||||
shift 1;
|
||||
EXPORTS=$1
|
||||
;;
|
||||
-*)
|
||||
echo "mklib: Unknown option: " $1 ;
|
||||
exit 1
|
||||
;;
|
||||
*)
|
||||
# This should be the first object file, stop parsing
|
||||
break
|
||||
esac
|
||||
shift 1
|
||||
done
|
||||
OBJECTS=$@
|
||||
|
||||
|
||||
if [ ${ARCH} = "auto" ] ; then
|
||||
ARCH=`uname`
|
||||
fi
|
||||
@@ -120,12 +178,13 @@ case $ARCH in
|
||||
'Linux' | 'OpenBSD')
|
||||
# we assume gcc
|
||||
|
||||
# Set default compilers if env vars not set
|
||||
if [ "x$CXX" = "x" ] ; then
|
||||
CXX=g++
|
||||
fi
|
||||
if [ "x$CC" = "x" ] ; then
|
||||
CC=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
|
||||
@@ -133,13 +192,16 @@ case $ARCH in
|
||||
echo "mklib: Making" $ARCH "shared library: " ${LIBNAME}
|
||||
#OPTS="-shared -Wl,-soname,${LIBNAME}" # soname???
|
||||
OPTS="-shared"
|
||||
if [ $CPLUSPLUS = 1 ] ; then
|
||||
LINK=$CXX
|
||||
else
|
||||
LINK=$CC
|
||||
fi
|
||||
rm -f ${LIBNAME}
|
||||
|
||||
# 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}
|
||||
# finish up
|
||||
@@ -147,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
|
||||
@@ -190,12 +250,6 @@ case $ARCH in
|
||||
|
||||
echo "mklib: Making" $ARCH "shared library: " ${LIBNAME}.so.${VERSION}
|
||||
|
||||
if [ $CPLUSPLUS = 1 ] ; then
|
||||
LINK=$CXX
|
||||
else
|
||||
LINK=$CC
|
||||
fi
|
||||
|
||||
# rm any old libs
|
||||
rm -f ${LIBNAME}.so.${VERSION}
|
||||
rm -f ${LIBNAME}.so.${MAJOR}
|
||||
@@ -224,41 +278,25 @@ case $ARCH in
|
||||
echo "mklib: Making SunOS shared library: " ${LIBNAME}
|
||||
# XXX OPTS for gcc should be -shared, but that doesn't work.
|
||||
# Using -G does work though.
|
||||
if [ $CPLUSPLUS = 1 ] ; then
|
||||
# determine linker and options for C++ code
|
||||
if [ "x${CXX}" = "xg++" ] ; then
|
||||
# use g++
|
||||
LINK="g++"
|
||||
OPTS="-G"
|
||||
elif [ "x${CXX}" = "xCC" ] ; then
|
||||
# use Sun CC
|
||||
LINK="CC"
|
||||
OPTS="-G"
|
||||
elif [ "x${CXX}" = "xc++" ] ; then
|
||||
# use Sun c++
|
||||
LINK="c++"
|
||||
OPTS="-G"
|
||||
elif [ `which c++` ] ; then
|
||||
# use Sun c++
|
||||
LINK="c++"
|
||||
OPTS="-G"
|
||||
elif [ `type g++` ] ; then
|
||||
# use g++
|
||||
LINK="g++"
|
||||
OPTS="-G"
|
||||
OPTS="-G"
|
||||
if [ "x$LINK" = "x" ] ; then
|
||||
# -linker was not specified, choose default linker now
|
||||
if [ $CPLUSPLUS = 1 ] ; then
|
||||
# determine linker and options for C++ code
|
||||
if [ `which c++` ] ; then
|
||||
# use Sun c++
|
||||
LINK="c++"
|
||||
elif [ `type g++` ] ; then
|
||||
# use g++
|
||||
LINK="g++"
|
||||
else
|
||||
echo "mklib: warning: can't find C++ comiler, trying CC."
|
||||
LINK="CC"
|
||||
fi
|
||||
else
|
||||
echo "mklib: warning: can't find C++ comiler, trying CC."
|
||||
LINK="CC"
|
||||
OPTS="-G"
|
||||
# use native Sun linker for C code
|
||||
LINK="ld"
|
||||
fi
|
||||
elif [ "x${CC}" = "xgcc" ] ; then
|
||||
# use gcc for linking
|
||||
LINK="gcc"
|
||||
OPTS="-G"
|
||||
else
|
||||
# use native Sun linker
|
||||
LINK="ld"
|
||||
OPTS="-G"
|
||||
fi
|
||||
echo "mklib: linker is" ${LINK} ${OPTS}
|
||||
rm -f ${LIBNAME}.${MAJOR} ${LIBNAME}
|
||||
@@ -269,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"
|
||||
@@ -283,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
|
||||
;;
|
||||
|
||||
@@ -317,6 +368,8 @@ case $ARCH in
|
||||
FINAL_LIBS=${LIBNAME}
|
||||
else
|
||||
LIBNAME="lib${LIBNAME}.so" # prefix with "lib", suffix with ".so"
|
||||
# XXX we should run 'file' on the first object file to determine
|
||||
# if it's o32, n32 or 64 format, as we do for Linux above.
|
||||
if [ $ARCHOPT = "64" ] ; then
|
||||
# 64-bit ABI
|
||||
OPTS="-64 -shared -all"
|
||||
@@ -373,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
|
||||
@@ -425,10 +479,12 @@ case $ARCH in
|
||||
VERSION="${MAJOR}.${MINOR}"
|
||||
LIBNAME="lib${LIBNAME}.so"
|
||||
echo "mklib: Making OSF/1 shared library: " ${LIBNAME}
|
||||
if [ $CPLUSPLUS = 1 ] ; then
|
||||
LINK=$CXX
|
||||
else
|
||||
LINK=$CC
|
||||
if [ "x$LINK" = "x" ] ; then
|
||||
if [ $CPLUSPLUS = 1 ] ; then
|
||||
LINK=cxx
|
||||
else
|
||||
LINK=cc
|
||||
fi
|
||||
fi
|
||||
rm -f ${LIBNAME}.${VERSION}
|
||||
${LINK} -o ${LIBNAME}.${VERSION} -shared -set_version ${VERSION} -soname ${LIBNAME}.${VERSION} -expect_unresolved \* -all ${OBJECTS} ${DEPS}
|
||||
@@ -448,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
|
||||
@@ -477,6 +533,7 @@ case $ARCH in
|
||||
echo "mklib: Making BeOS shared library: " ${LIBNAME}
|
||||
gcc -nostart -Xlinker "-soname=${LIBNAME}" -L/Be/develop/lib/x86 -lbe ${DEPS} ${OBJECTS} -o "${LIBNAME}"
|
||||
mimeset -f "${LIBNAME}"
|
||||
# XXX remove the Mesa3D stuff here since mklib isn't mesa-specific.
|
||||
setversion "${LIBNAME}" -app ${MAJOR} ${MINOR} ${PATCH} -short "Powered by Mesa3D!" -long "Powered by Mesa3D!"
|
||||
fi
|
||||
FINAL_LIBS=${LIBNAME}
|
||||
@@ -498,6 +555,8 @@ case $ARCH in
|
||||
|
||||
'icc')
|
||||
# Intel C compiler
|
||||
# This should get merged into the Linux code, above, since this isn't
|
||||
# really a different architecture.
|
||||
LIBNAME="lib${LIBNAME}" # prefix with "lib"
|
||||
|
||||
if [ $STATIC = 1 ] ; then
|
||||
@@ -615,7 +674,7 @@ case $ARCH in
|
||||
ar rv ${LIBNAME} ${OBJECTS}
|
||||
FINAL_LIBS="${LIBNAME}"
|
||||
else
|
||||
LIBNAME="lib${LIBNAME}.so" # prefix with "lib"
|
||||
LIBNAME="lib${LIBNAME}.so" # prefix with "lib", suffix with ".so"
|
||||
echo "mklib: Making shared library for example arch: " ${LIBNAME}
|
||||
ld -o ${LIBNAME} ${OBJECTS} ${DEPS}
|
||||
FINAL_LIBS="${LIBNAME}"
|
||||
|
@@ -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_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
|
||||
|
@@ -9,9 +9,9 @@ CC = gcc
|
||||
CXX = g++
|
||||
MAKE = gmake
|
||||
|
||||
CFLAGS = -O2 -fPIC -pedantic -I/usr/X11R6/include -DUSE_XSHM -DHZ=100
|
||||
CFLAGS = -O2 -fPIC -pedantic -I/usr/X11R6/include -DUSE_XSHM -DHZ=100 \
|
||||
$(ASM_FLAGS)
|
||||
CXXFLAGS = -O2 -fPIC -pedantic
|
||||
GLUT_CFLAGS = -fexceptions
|
||||
|
||||
APP_LIB_DEPS = -L$(LIB_DIR) -L/usr/X11R6/lib -lXext -lXmu -lXi -lX11 -lm
|
||||
|
||||
APP_LIB_DEPS = -L$(LIB_DIR) -L/usr/X11R6/lib -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 = -DDRI_NEW_INTERFACE_ONLY
|
||||
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 radeon tdfx \
|
||||
DRI_DIRS = i810 i830 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 \
|
||||
-DDRI_NEW_INTERFACE_ONLY -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1
|
||||
-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,33 @@ 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
|
||||
|
||||
# ffb and gamma are missing because they have not been converted to use the new
|
||||
# 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 radeon s3v \
|
||||
savage sis tdfx trident unichrome
|
||||
DRI_DIRS = i810 i915 mach64 mga r128 r200 r300 radeon s3v \
|
||||
savage sis tdfx trident unichrome ffb
|
||||
|
||||
DRI_DIRS = i915
|
||||
|
@@ -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
|
||||
|
||||
@@ -19,5 +20,5 @@ EXTRA_LIB_PATH=-L/usr/X11R6/lib64
|
||||
# the new interface. i810 and i830 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
|
||||
|
||||
|
@@ -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
|
||||
|
||||
|
@@ -11,32 +11,33 @@ CXX = g++
|
||||
WARN_FLAGS = -Wall -Wundef
|
||||
OPT_FLAGS = -O3 -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 \
|
||||
-DDRI_NEW_INTERFACE_ONLY -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DDRM_USE_MALLOC
|
||||
-DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DDRM_USE_MALLOC -DIN_DRI_DRIVER
|
||||
|
||||
CFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \
|
||||
$(ASM_FLAGS) -std=c99 -ffast-math
|
||||
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 =
|
||||
|
||||
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
|
||||
|
@@ -1,29 +1,7 @@
|
||||
# Configuration for linux-solo-ia64: Linux DRI hardware drivers for fbdev
|
||||
|
||||
include $(TOP)/configs/default
|
||||
include $(TOP)/configs/linux-solo
|
||||
|
||||
CONFIG_NAME = linux-solo-ia64
|
||||
|
||||
# Compiler and flags
|
||||
CC = gcc
|
||||
CXX = g++
|
||||
|
||||
DEFINES = -DDRI_NEW_INTERFACE_ONLY -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=199309L -D_GNU_SOURCE -DDRM_USE_MALLOC
|
||||
|
||||
CFLAGS = $(DEFINES) -Wmissing-prototypes -g -std=c99 -Wundef -fPIC -ffast-math
|
||||
|
||||
CXXFLAGS = $(DEFINES) -Wall -O3 -ansi -pedantic -fPIC
|
||||
|
||||
|
||||
# Library/program dependencies
|
||||
DRI_LIB_DEPS = -lm -lpthread -lexpat -ldl
|
||||
GL_LIB_DEPS = -lm -lpthread -ldl
|
||||
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 = mesa glx/mini glu glut/mini
|
||||
DRIVER_DIRS = dri
|
||||
PROGRAM_DIRS = miniglx
|
||||
|
||||
DRI_DIRS = fb mach64 mga r128 r200 radeon sis tdfx unichrome
|
||||
|
@@ -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)
|
||||
|
@@ -7,10 +7,24 @@ CONFIG_NAME = linux-sparc
|
||||
# Compiler and flags
|
||||
CC = gcc
|
||||
CXX = g++
|
||||
CFLAGS = -O2 -ffast-math -ansi -pedantic -fPIC -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM
|
||||
CXXFLAGS = -O2 -ffast-math -ansi -pedantic -fPIC -D_SVID_SOURCE -D_BSD_SOURCE
|
||||
|
||||
WARN_FLAGS = -Wall
|
||||
OPT_FLAGS = -O2
|
||||
PIC_FLAGS = -fPIC
|
||||
|
||||
DEFINES = -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM
|
||||
|
||||
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)
|
||||
|
||||
GLUT_CFLAGS = -fexceptions
|
||||
|
||||
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
|
||||
GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib -lXt -lX11
|
||||
EXTRA_LIB_PATH=-L/usr/X11R6/lib
|
||||
|
||||
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread
|
||||
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) $(EXTRA_LIB_PATH) -lX11 -lXmu -lXt -lXi -lm
|
||||
GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) $(EXTRA_LIB_PATH) -lXt -lX11
|
||||
|
@@ -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
|
||||
|
@@ -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 -lm -lpthread -lXCB
|
||||
|
@@ -4,18 +4,33 @@ include $(TOP)/configs/default
|
||||
|
||||
CONFIG_NAME = sunos5-gcc
|
||||
|
||||
ASM_SOURCES = $(SPARC_SOURCES) $(SPARC_API)
|
||||
|
||||
# Compiler and flags
|
||||
CC = gcc
|
||||
CXX = g++
|
||||
CFLAGS = -O3 -I/usr/openwin/include -fPIC -fomit-frame-pointer -D_REENTRANT -DUSE_XSHM -DUSE_SPARC_ASM
|
||||
CXXFLAGS = -O3 -I/usr/openwin/include -fPIC -fomit-frame-pointer -D_REENTRANT -DUSE_SPARC_ASM
|
||||
|
||||
WARN_FLAGS = -Wall
|
||||
OPT_FLAGS = -O3 -g -fomit-frame-pointer -pipe
|
||||
PIC_FLAGS = -fPIC
|
||||
|
||||
ARCH_FLAGS ?=
|
||||
|
||||
DEFINES = -D_REENTRANT -DUSE_XSHM
|
||||
|
||||
ASM_SOURCES = $(SPARC_SOURCES)
|
||||
ASM_API = $(SPARC_API)
|
||||
ASM_FLAGS = -DUSE_SPARC_ASM
|
||||
|
||||
CFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \
|
||||
$(ASM_FLAGS) -std=c99 -ffast-math -I/usr/openwin/include
|
||||
|
||||
CXXFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \
|
||||
-I/usr/openwin/include
|
||||
|
||||
GLUT_CFLAGS = -fexceptions -DSOLARIS_2_4_BUG
|
||||
|
||||
GL_LIB_DEPS = -L/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm
|
||||
GLU_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -lm
|
||||
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lm
|
||||
GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -L/usr/openwin/lib -lXt -lX11
|
||||
APP_LIB_DEPS = -L$(LIB_DIR) -lX11 -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm
|
||||
# Library/program dependencies
|
||||
EXTRA_LIB_PATH=-L/usr/openwin/lib
|
||||
|
||||
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXmu -lXi -lm
|
||||
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lm
|
||||
APP_LIB_DEPS = -L$(LIB_DIR) -lX11 -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm
|
||||
|
@@ -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.
|
||||
|
@@ -1,7 +1,7 @@
|
||||
|
||||
Mesa 6.3 release notes
|
||||
|
||||
month day, 2004
|
||||
July 20, 2005
|
||||
|
||||
PLEASE READ!!!!
|
||||
|
||||
@@ -28,7 +28,8 @@ GL_OES_read_format - allows one to query the fastest glReadPixels format
|
||||
GL_ARB_pixel_buffer_object - buffer objects for pixel read/write functions.
|
||||
|
||||
GL_EXT_framebuffer_object - allows render-to-texture and provides a
|
||||
window-system indepedent Pbuffer facility
|
||||
window-system indepedent Pbuffer facility.
|
||||
The Mesa CVS tree contains a couple tests of this extension.
|
||||
|
||||
DirectFB driver, contributed by Claudio Ciccani. See docs/README.directfb
|
||||
for details.
|
||||
@@ -62,11 +63,21 @@ Note that textures, programs and buffers can be shared by several rendering
|
||||
contexts so they can't be deleted until they're unbound in _all_ contexts.
|
||||
|
||||
|
||||
|
||||
GL_EXT_framebuffer_object changes
|
||||
---------------------------------
|
||||
|
||||
XXX describe all the changes made for this extension.
|
||||
Implementing this extension involved changing a lot of code (for the better).
|
||||
|
||||
The gl_framebuffer object now a collection of gl_renderbuffer objects.
|
||||
Renderbuffers may store colors, stencil indices, or depth values. The
|
||||
gl_framebuffer and gl_renderbuffer types are object-oriented in design.
|
||||
|
||||
All the old RGB, color index, stencil and depth-related span functions for
|
||||
reading/writing pixels from/to buffers has changed. Now, all pixels are
|
||||
read/written through a set of common renderbuffer functions (methods).
|
||||
|
||||
Most device drivers have been updated for these changes, but some haven't.
|
||||
|
||||
|
||||
|
||||
@@ -101,4 +112,4 @@ D3D needs updating
|
||||
|
||||
|
||||
----------------------------------------------------------------------
|
||||
$Id: RELNOTES-6.3,v 3.10 2005/07/01 01:04:31 brianp Exp $
|
||||
$Id: RELNOTES-6.3,v 3.13 2005/07/21 15:57:29 brianp Exp $
|
||||
|
49
docs/RELNOTES-6.3.1
Normal file
49
docs/RELNOTES-6.3.1
Normal file
@@ -0,0 +1,49 @@
|
||||
|
||||
Mesa 6.3.1 release notes
|
||||
|
||||
July XX, 2005
|
||||
|
||||
PLEASE READ!!!!
|
||||
|
||||
|
||||
|
||||
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.
|
||||
|
||||
|
||||
|
||||
DRI drivers
|
||||
-----------
|
||||
|
||||
This release includes the DRI drivers and GLX code for hardware rendering.
|
||||
|
||||
|
||||
|
||||
Bug fixes
|
||||
---------
|
||||
|
||||
Bugs fixed in 6.3.1 are listed in the VERSIONS file.
|
||||
|
||||
|
||||
|
||||
Driver Status
|
||||
---------------------- ---------------------
|
||||
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.1,v 3.1 2005/07/21 18:45:54 brianp Exp $
|
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 $
|
74
docs/RELNOTES-6.5
Normal file
74
docs/RELNOTES-6.5
Normal file
@@ -0,0 +1,74 @@
|
||||
|
||||
Mesa 6.5 Release Notes
|
||||
|
||||
month, day, 2005
|
||||
|
||||
|
||||
|
||||
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.
|
||||
|
||||
|
||||
|
||||
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.1 2005/09/14 14:34:54 brianp Exp $
|
@@ -1314,20 +1314,114 @@ Mesa Version History
|
||||
- bug reports should to go bugzilla.freedesktop.org
|
||||
|
||||
|
||||
6.3 Month day, 2004
|
||||
6.3 July 20, 2005
|
||||
New:
|
||||
- GL_EXT_framebuffer_object extension
|
||||
- GL_ARB_draw_buffers extension
|
||||
- GL_ARB_pixel_buffer_object extension
|
||||
- GL_OES_read_format extension (Ian Romanick)
|
||||
- DirectFB driver (Claudio Ciccani)
|
||||
- x86_64 vertex transformation code (Mikko T.)
|
||||
- Updated GL/glext.h to version 29
|
||||
Changes:
|
||||
- added -stereo option for glxgears demo (Jacek Rosik)
|
||||
- updated the PBuffer demo code in xdemos/ directory
|
||||
- glDeleteTextures/Programs/Buffers() now makes the object ID
|
||||
available for immediate re-use
|
||||
- assorted 64-bit clean-ups fixes (x86_64 and Win64)
|
||||
- lots of internal changes for GL_EXT_framebuffer_object
|
||||
Bug fixes:
|
||||
- some functions didn't support PBO functionality
|
||||
- glGetTexImage didn't convert color index images to RGBA as required
|
||||
- fragment program texcoords were sometimes wrong for points and lines
|
||||
- fixed problem with negative dot product in arbfplight, fplight demos
|
||||
- fixed bug in perspective correction of antialiased, textured lines
|
||||
- querying GL_POST_CONVOLUTION_ALPHA_BIAS_EXT returned wrong value
|
||||
- fixed a couple per-pixel fog bugs (Soju Matsumoto)
|
||||
- glGetBooleanv(GL_FRAGMENT_PROGRAM_BINDING_NV) was broken
|
||||
- fixed float parsing bug in ARB frag/vert programs (bug 2520)
|
||||
- XMesaGetDepthBuffer() returned incorrect value for bytesPerValue
|
||||
- GL_COLOR_MATERIAL with glColor3 didn't properly set diffuse alpha
|
||||
- glXChooseFBConfig() crashed if attribList pointer was NULL
|
||||
- program state.light[n].spot.direction.w was wrong value (bug 3083)
|
||||
- fragment program fog option required glEnable(GL_FOG) - wrong.
|
||||
- glColorTable() could produce a Mesa implementation error (bug 3135)
|
||||
- RasterPos could get corrupted by color index rendering path
|
||||
- Removed bad XTranslateCoordinates call when rendering to Pixmaps
|
||||
- glPopAttrib() didn't properly restore GL_TEXTURE_GEN enable state
|
||||
- fixed a few Darwin compilation problems
|
||||
|
||||
|
||||
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.5 month, day, 2005
|
||||
New:
|
||||
- GL_EXT_packed_depth_stencil extension
|
||||
- GL_EXT_timer_query 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
|
||||
Changes:
|
||||
- removed GL_HP_occlusion_test (use GL_ARB_occlusion_query instead)
|
||||
- removed GL_SGIX/SGIS_pixel_texture extensions
|
||||
Bug fixes:
|
||||
|
||||
|
@@ -37,7 +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="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>
|
||||
@@ -80,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>
|
||||
@@ -89,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,7 +16,9 @@ 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>
|
||||
|
||||
@@ -35,6 +37,7 @@ software driver:
|
||||
"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>
|
||||
|
||||
|
@@ -21,53 +21,77 @@
|
||||
<a name="unix-x11">
|
||||
<H2>1. Unix/X11 Compilation and Installation</H1>
|
||||
|
||||
<p>
|
||||
Mesa uses a rather conventional Makefile system.
|
||||
A GNU autoconf/automake system used to be included, but was discarded
|
||||
in Mesa 5.1 because:
|
||||
</p>
|
||||
<ul>
|
||||
<li>It seldom worked on IRIX, Solaris, AIX, etc.
|
||||
<li>It was very compilicated
|
||||
<li>Nobody maintained it
|
||||
<li>libtool was just too weird
|
||||
</ul>
|
||||
<p>
|
||||
If someone strongly feels that Mesa should have a autoconf/automake
|
||||
system and wants to contribute one and maintain it, we'll consider
|
||||
adding it again.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
In Mesa 6.1 we modified the conventional Makefile system.
|
||||
Instead of specifying all the various system configurations in the
|
||||
Make-config file, there's a directory named <code>configs/</code> which
|
||||
has an individual file for each configuration.
|
||||
One of the configs gets copied to <code>configs/current</code>, which
|
||||
is then included by all Makefiles.
|
||||
</p>
|
||||
|
||||
|
||||
<h3>1.1 Compilation</h3>
|
||||
|
||||
<p>
|
||||
Note: if you've obtained Mesa through CVS, do this first:
|
||||
Mesa may be compiled in several different ways:
|
||||
</p>
|
||||
<pre>
|
||||
cd Mesa
|
||||
chmod a+x bin/mklib
|
||||
</pre>
|
||||
|
||||
<ul>
|
||||
<li><b><em>Stand-alone/Xlib mode</em></b> - Mesa is compiled as
|
||||
a software renderer using Xlib to do all rendering.
|
||||
libGL.so is a self-contained rendering library.
|
||||
<p>
|
||||
Just type <b>make</b> in the top-level directory.
|
||||
To compile stand-alone Mesa type <b>make</b> in the top-level directory.
|
||||
You'll see a list of supported system configurations.
|
||||
Choose one from the list (such as linux-x86), and type:
|
||||
</p>
|
||||
<pre>
|
||||
make linux-x86
|
||||
</pre>
|
||||
<p>This will produce libGL.so and several other libraries</p>
|
||||
</li>
|
||||
|
||||
<li><b><em>DRI/accelerated</em></b> - The DRI hardware drivers (for ATI,
|
||||
Intel, Matrox, etc) are built.
|
||||
libGL.so implements the GLX extension and dynamically loads the DRI drivers.
|
||||
<p>
|
||||
If you want to rebuild for a different configuration run
|
||||
To build the DRI drivers you'll first need to have the DRM (Direct
|
||||
Rendering Manager) kernel drivers and header files.
|
||||
They're available from the <a href="http://dri.sf.net/" target="_parent">DRI</a> project.
|
||||
</p>
|
||||
<p>
|
||||
You can get them from CVS by doing:
|
||||
<pre>
|
||||
cvs -d:pserver:anonymous@pds.freedesktop.org:/cvs/dri login
|
||||
(hit enter when prompted for a password)
|
||||
cvs -z3 -d:pserver:anonymous@pdx.freedesktop.org:/cvs/dri co drm
|
||||
</pre>
|
||||
<p>
|
||||
Make note of the directory in which the drm files are placed.
|
||||
</p>
|
||||
<p>
|
||||
See the <a href="http://dri.freedesktop.org/wiki/Building" target="_parent">
|
||||
DRI Building Instructions</a> for the steps to build the DRM modules.
|
||||
</p>
|
||||
<p>
|
||||
Next, in the <code>Mesa-x.y.z/configs/default</code> file, set the
|
||||
<code>DRM_SOURCE_PATH</code> variable to indicate where the DRM files
|
||||
are located.
|
||||
</p>
|
||||
<p>
|
||||
Now build Mesa and the DRI drivers by running
|
||||
</p>
|
||||
<pre>
|
||||
make linux-dri
|
||||
</pre>
|
||||
<p>
|
||||
There are also <code>linux-dri-x86</code>, <code>linux-dri-x86-64</code>,
|
||||
and <code>linux-ppc</code> configurations, optimized for those architectures.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Finally, you'll need a DRI-enabled X server from
|
||||
<a href="http://freedesktop.org/wiki/Software_2fXserver" target="_parent">
|
||||
X.org</a> or <a href="http://www.xfree86.org" target="_parent">XFree86</a>.
|
||||
Visit those projects' home pages for more information.
|
||||
</p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<p>
|
||||
Later, if you want to rebuild for a different configuration run
|
||||
<code>make realclean</code> before rebuilding.
|
||||
</p>
|
||||
|
||||
@@ -75,7 +99,8 @@ If you want to rebuild for a different configuration run
|
||||
<h3>1.2 The libraries</h3>
|
||||
|
||||
<p>
|
||||
When compilation has finished, look in the top-level <b>lib/</b> directory.
|
||||
When compilation has finished, look in the top-level <code>lib/</code>
|
||||
directory.
|
||||
You'll see a set of library files similar to this:
|
||||
</p>
|
||||
<pre>
|
||||
@@ -108,6 +133,23 @@ lrwxrwxrwx 1 brian users 23 Mar 26 07:53 libOSMesa.so.6 -> libOSM
|
||||
<b>libOSMesa</b> is the OSMesa (Off-Screen) interface library.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
If you built the DRI hardware drivers, you'll also see the DRI drivers:
|
||||
</p>
|
||||
<pre>
|
||||
-rwxr-xr-x 1 brian users 11320803 Jul 21 12:11 mach64_dri.so
|
||||
-rwxr-xr-x 1 brian users 11418014 Jul 21 12:12 mga_dri.so
|
||||
-rwxr-xr-x 1 brian users 11064426 Jul 21 12:12 r128_dri.so
|
||||
-rwxr-xr-x 1 brian users 11849858 Jul 21 12:12 r200_dri.so
|
||||
-rwxr-xr-x 1 brian users 11757388 Jul 21 12:12 radeon_dri.so
|
||||
-rwxr-xr-x 1 brian users 11232304 Jul 21 12:13 s3v_dri.so
|
||||
-rwxr-xr-x 1 brian users 11062970 Jul 21 12:13 savage_dri.so
|
||||
-rwxr-xr-x 1 brian users 11214212 Jul 21 12:13 sis_dri.so
|
||||
-rwxr-xr-x 1 brian users 11368736 Jul 21 12:13 tdfx_dri.so
|
||||
-rwxr-xr-x 1 brian users 10598868 Jul 21 12:13 trident_dri.so
|
||||
-rwxr-xr-x 1 brian users 10997120 Jul 21 12:13 unichrome_dri.so
|
||||
</pre>
|
||||
|
||||
|
||||
<h3>1.3 Running the demos</h3>
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -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>
|
||||
|
@@ -30,7 +30,8 @@ SourceForge lists page.</a>
|
||||
with the mailing lists please contact the SourceForge administrators for help.</p>
|
||||
|
||||
<p>Archives of the old Mesa mailing list which was hosted by unicamp.br
|
||||
are available <a href="http://groups.yahoo.com/group/mesa/messages/">here</a>.</p>
|
||||
are available <a href="http://groups.yahoo.com/group/mesa/messages/"
|
||||
target="_parent">here</a>.</p>
|
||||
|
||||
<p>
|
||||
Here are some other OpenGL-related forums you might find useful:
|
||||
@@ -46,7 +47,8 @@ Usenet newsgroups:
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="http://www.opengl.org/">OpenGL discussion forums</A> at www.opengl.org
|
||||
<a href="http://www.opengl.org/" target="_parent">OpenGL discussion forums</A>
|
||||
at www.opengl.org
|
||||
</p>
|
||||
|
||||
</HTML>
|
||||
|
@@ -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>
|
||||
|
||||
|
||||
|
142
docs/news.html
142
docs/news.html
@@ -11,6 +11,146 @@
|
||||
<H1>News</H1>
|
||||
|
||||
|
||||
<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.
|
||||
This is a development release with new features, changes and bug fixes.
|
||||
</p>
|
||||
<pre>
|
||||
New:
|
||||
- GL_EXT_framebuffer_object extension
|
||||
- GL_ARB_draw_buffers extension
|
||||
- GL_ARB_pixel_buffer_object extension
|
||||
- GL_OES_read_format extension (Ian Romanick)
|
||||
- DirectFB driver (Claudio Ciccani)
|
||||
- x86_64 vertex transformation code (Mikko T.)
|
||||
Changes:
|
||||
- added -stereo option for glxgears demo (Jacek Rosik)
|
||||
- updated the PBuffer demo code in xdemos/ directory
|
||||
- glDeleteTextures/Programs/Buffers() now makes the object ID
|
||||
available for immediate re-use
|
||||
- assorted 64-bit clean-ups fixes (x86_64 and Win64)
|
||||
- lots of internal changes for GL_EXT_framebuffer_object
|
||||
Bug fixes:
|
||||
- some functions didn't support PBO functionality
|
||||
- glGetTexImage didn't convert color index images to RGBA as required
|
||||
- fragment program texcoords were sometimes wrong for points and lines
|
||||
- fixed problem with negative dot product in arbfplight, fplight demos
|
||||
- fixed bug in perspective correction of antialiased, textured lines
|
||||
- querying GL_POST_CONVOLUTION_ALPHA_BIAS_EXT returned wrong value
|
||||
- fixed a couple per-pixel fog bugs (Soju Matsumoto)
|
||||
- glGetBooleanv(GL_FRAGMENT_PROGRAM_BINDING_NV) was broken
|
||||
- fixed float parsing bug in ARB frag/vert programs (bug 2520)
|
||||
- XMesaGetDepthBuffer() returned incorrect value for bytesPerValue
|
||||
- GL_COLOR_MATERIAL with glColor3 didn't properly set diffuse alpha
|
||||
- glXChooseFBConfig() crashed if attribList pointer was NULL
|
||||
- program state.light[n].spot.direction.w was wrong value (bug 3083)
|
||||
- fragment program fog option required glEnable(GL_FOG) - wrong.
|
||||
- glColorTable() could produce a Mesa implementation error (bug 3135)
|
||||
- RasterPos could get corrupted by color index rendering path
|
||||
- Removed bad XTranslateCoordinates call when rendering to Pixmaps
|
||||
- glPopAttrib() didn't properly restore GL_TEXTURE_GEN enable state
|
||||
- fixed a few Darwin compilation problems
|
||||
</pre>
|
||||
<p>
|
||||
The MD5 checksums are:
|
||||
</p>
|
||||
<pre>
|
||||
0236f552d37514776945d5a013e5bb7b MesaLib-6.3.tar.gz
|
||||
60e1a8f78c4a8c7750a1e95753190986 MesaLib-6.3.tar.bz2
|
||||
ca7c950fbace68c70caa822322db7223 MesaLib-6.3.zip
|
||||
25ea801645b376c014051804fe4974b2 MesaDemos-6.3.tar.gz
|
||||
9248e74872ea88c57ec25c900c295057 MesaDemos-6.3.tar.bz2
|
||||
8537dfa734ef258dcc7272097558d434 MesaDemos-6.3.zip
|
||||
</pre>
|
||||
|
||||
|
||||
<h2>December 9, 2004</h2>
|
||||
<p>
|
||||
Mesa 6.2.1 has been released.
|
||||
@@ -962,6 +1102,6 @@ source code</a>.</p>
|
||||
|
||||
|
||||
<hr>
|
||||
$Id: news.html,v 3.20 2005/07/01 01:04:31 brianp Exp $
|
||||
$Id: news.html,v 3.25 2005/10/24 23:33:27 brianp Exp $
|
||||
</body>
|
||||
</html>
|
||||
|
@@ -13,6 +13,8 @@ The release notes summarize what's new or changed in each Mesa release.
|
||||
</p>
|
||||
|
||||
<UL>
|
||||
<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,46 @@ 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_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 );
|
||||
|
||||
|
||||
|
152
include/GL/glx.h
152
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
|
||||
|
@@ -331,13 +331,24 @@ typedef struct {
|
||||
} GLXBufferClobberEventSGIX;
|
||||
#endif
|
||||
|
||||
#if defined(__UNIXOS2__) || defined(__SOL64__)
|
||||
#if defined(__sun__)
|
||||
#include <inttypes.h>
|
||||
#if defined(__STDC__)
|
||||
#if defined(__arch64__)
|
||||
typedef long int int64_t;
|
||||
#else
|
||||
typedef long long int int64_t;
|
||||
#endif /* __arch64__ */
|
||||
#endif /* __STDC__ */
|
||||
#elif defined(__UNIXOS2__) || defined(__SOL64__)
|
||||
typedef long int int32_t;
|
||||
typedef long long int int64_t;
|
||||
#elif defined( __VMS )
|
||||
#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
|
||||
|
||||
#ifndef 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>
|
||||
|
||||
/**
|
||||
@@ -62,6 +55,7 @@ typedef struct __DRIdrawableRec __DRIdrawable;
|
||||
typedef struct __DRIdriverRec __DRIdriver;
|
||||
typedef struct __DRIframebufferRec __DRIframebuffer;
|
||||
typedef struct __DRIversionRec __DRIversion;
|
||||
typedef struct __DRIinterfaceMethodsRec __DRIinterfaceMethods;
|
||||
typedef unsigned long __DRIid;
|
||||
typedef void __DRInativeDisplay;
|
||||
/*@}*/
|
||||
@@ -71,42 +65,6 @@ typedef void __DRInativeDisplay;
|
||||
* \name Functions provided by the driver loader.
|
||||
*/
|
||||
/*@{*/
|
||||
extern __DRIscreen *__glXFindDRIScreen(__DRInativeDisplay *dpy, int scrn);
|
||||
|
||||
|
||||
/**
|
||||
* Type of a pointer to \c __glXGetInternalVersion, as returned by
|
||||
* \c glXGetProcAddress.
|
||||
*
|
||||
* \sa __glXGetInternalVersion, glXGetProcAddress
|
||||
*/
|
||||
typedef int (* PFNGLXGETINTERNALVERSIONPROC) ( void );
|
||||
|
||||
/**
|
||||
* Type of a pointer to \c __glXWindowExists, as returned by
|
||||
* \c glXGetProcAddress.
|
||||
*
|
||||
* \sa __glXWindowExists, glXGetProcAddress
|
||||
*/
|
||||
typedef GLboolean (* PFNGLXWINDOWEXISTSPROC) (__DRInativeDisplay *dpy, __DRIid draw);
|
||||
|
||||
/**
|
||||
* Type of a pointer to \c __glXGetUST, as returned by \c glXGetProcAddress.
|
||||
*
|
||||
* \sa __glXGetUST, glXGetProcAddress
|
||||
*/
|
||||
typedef int (* PFNGLXGETUSTPROC) ( int64_t * ust );
|
||||
|
||||
/**
|
||||
* Type of pointer to \c __glXCreateContextModes, as returned by
|
||||
* \c glXGetProcAddress.
|
||||
*
|
||||
* \sa _gl_context_modes_create, glXGetProcAddress
|
||||
*/
|
||||
|
||||
typedef __GLcontextModes * (* PFNGLXCREATECONTEXTMODES) ( unsigned count,
|
||||
size_t minimum_bytes_per_struct );
|
||||
|
||||
/**
|
||||
* Type of a pointer to \c glXGetScreenDriver, as returned by
|
||||
* \c glXGetProcAddress. This function is used to get the name of the DRI
|
||||
@@ -127,39 +85,11 @@ typedef const char * (* PFNGLXGETSCREENDRIVERPROC) (__DRInativeDisplay *dpy, int
|
||||
typedef const char * (* PFNGLXGETDRIVERCONFIGPROC) (const char *driverName);
|
||||
|
||||
/**
|
||||
* Type of a pointer to \c __glXScrEnableExtension, as returned by
|
||||
* \c glXGetProcAddress. This function is used to enable a GLX extension
|
||||
* on the specified screen.
|
||||
*
|
||||
* \sa __glXScrEnableExtension, glXGetProcAddress
|
||||
* Type of a pointer to \c glxEnableExtension, as returned by
|
||||
* \c __DRIinterfaceMethods::getProcAddress. This function is used to enable
|
||||
* a GLX extension on the specified screen.
|
||||
*/
|
||||
typedef void (* PFNGLXSCRENABLEEXTENSIONPROC) ( void *psc, const char * name );
|
||||
|
||||
/**
|
||||
* Type of a pointer to \c __glXGetDrawableInfo, as returned by
|
||||
* \c glXGetProcAddress. This function is used to get information about the
|
||||
* position, size, and clip rects of a drawable.
|
||||
*
|
||||
* \sa __glXGetDrawableInfo, glXGetProcAddress
|
||||
*/
|
||||
typedef GLboolean (* PFNGLXGETDRAWABLEINFOPROC) ( __DRInativeDisplay *dpy, int scrn,
|
||||
__DRIid draw, unsigned int * index, unsigned int * stamp,
|
||||
int * x, int * y, int * width, int * height,
|
||||
int * numClipRects, drm_clip_rect_t ** pClipRects,
|
||||
int * backX, int * backY,
|
||||
int * numBackClipRects, drm_clip_rect_t ** pBackClipRects );
|
||||
|
||||
/* Test for the xf86dri.h header file */
|
||||
#ifndef _XF86DRI_H_
|
||||
extern GLboolean XF86DRIDestroyContext( __DRInativeDisplay *dpy, int screen,
|
||||
__DRIid context_id );
|
||||
|
||||
extern GLboolean XF86DRICreateDrawable( __DRInativeDisplay *dpy, int screen,
|
||||
__DRIid drawable, drm_drawable_t *hHWDrawable );
|
||||
|
||||
extern GLboolean XF86DRIDestroyDrawable( __DRInativeDisplay *dpy, int screen,
|
||||
__DRIid drawable);
|
||||
#endif
|
||||
/*@}*/
|
||||
|
||||
|
||||
@@ -173,16 +103,10 @@ typedef void *(CREATENEWSCREENFUNC)(__DRInativeDisplay *dpy, int scrn,
|
||||
const __DRIversion * ddx_version, const __DRIversion * dri_version,
|
||||
const __DRIversion * drm_version, const __DRIframebuffer * frame_buffer,
|
||||
void * pSAREA, int fd, int internal_api_version,
|
||||
const __DRIinterfaceMethods * interface,
|
||||
__GLcontextModes ** driver_modes);
|
||||
typedef CREATENEWSCREENFUNC* PFNCREATENEWSCREENFUNC;
|
||||
extern CREATENEWSCREENFUNC __driCreateNewScreen;
|
||||
|
||||
#ifndef DRI_NEW_INTERFACE_ONLY
|
||||
|
||||
extern void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
|
||||
int numConfigs, __GLXvisualConfig *config);
|
||||
|
||||
#endif /* DRI_NEW_INTERFACE_ONLY */
|
||||
extern CREATENEWSCREENFUNC __driCreateNewScreen_20050727;
|
||||
|
||||
|
||||
/**
|
||||
@@ -209,6 +133,113 @@ struct __DRIversionRec {
|
||||
int patch; /**< Patch-level. */
|
||||
};
|
||||
|
||||
|
||||
typedef void (*__DRIfuncPtr)(void);
|
||||
|
||||
struct __DRIinterfaceMethodsRec {
|
||||
/**
|
||||
* Get pointer to named function.
|
||||
*/
|
||||
__DRIfuncPtr (*getProcAddress)( const char * proc_name );
|
||||
|
||||
/**
|
||||
* Create a list of \c __GLcontextModes structures.
|
||||
*/
|
||||
__GLcontextModes * (*createContextModes)(unsigned count,
|
||||
size_t minimum_bytes_per_struct);
|
||||
|
||||
/**
|
||||
* Destroy a list of \c __GLcontextModes structures.
|
||||
*
|
||||
* \todo
|
||||
* Determine if the drivers actually need to call this.
|
||||
*/
|
||||
void (*destroyContextModes)( __GLcontextModes * modes );
|
||||
|
||||
/**
|
||||
* Get the \c __DRIscreen for a given display and screen number.
|
||||
*/
|
||||
__DRIscreen *(*getScreen)(__DRInativeDisplay *dpy, int screenNum);
|
||||
|
||||
|
||||
/**
|
||||
* \name Client/server protocol functions.
|
||||
*
|
||||
* These functions implement the DRI client/server protocol for
|
||||
* context and drawable operations. Platforms that do not implement
|
||||
* the wire protocol (e.g., EGL) will implement glorified no-op functions.
|
||||
*/
|
||||
/*@{*/
|
||||
/**
|
||||
* Determine if the specified window ID still exists.
|
||||
*
|
||||
* \note
|
||||
* Implementations may assume that the driver will only pass an ID into
|
||||
* this function that actually corresponds to a window. On
|
||||
* implementations where windows can only be destroyed by the DRI driver
|
||||
* (e.g., EGL), this function is allowed to always return \c GL_TRUE.
|
||||
*/
|
||||
GLboolean (*windowExists)(__DRInativeDisplay *dpy, __DRIid draw);
|
||||
|
||||
/**
|
||||
* Create the server-side portion of the GL context.
|
||||
*/
|
||||
GLboolean (* createContext)( __DRInativeDisplay *dpy, int screenNum,
|
||||
int configID, void * contextID, drm_context_t * hw_context );
|
||||
|
||||
/**
|
||||
* Destroy the server-side portion of the GL context.
|
||||
*/
|
||||
GLboolean (* destroyContext)( __DRInativeDisplay *dpy, int screenNum,
|
||||
__DRIid context );
|
||||
|
||||
/**
|
||||
* Create the server-side portion of the drawable.
|
||||
*/
|
||||
GLboolean (*createDrawable)( __DRInativeDisplay * ndpy, int screen,
|
||||
__DRIid drawable, drm_drawable_t * hHWDrawable );
|
||||
|
||||
/**
|
||||
* Destroy the server-side portion of the drawable.
|
||||
*/
|
||||
GLboolean (*destroyDrawable)( __DRInativeDisplay * ndpy, int screen,
|
||||
__DRIid drawable );
|
||||
|
||||
/**
|
||||
* This function is used to get information about the position, size, and
|
||||
* clip rects of a drawable.
|
||||
*/
|
||||
GLboolean (* getDrawableInfo) ( __DRInativeDisplay *dpy, int scrn,
|
||||
__DRIid draw, unsigned int * index, unsigned int * stamp,
|
||||
int * x, int * y, int * width, int * height,
|
||||
int * numClipRects, drm_clip_rect_t ** pClipRects,
|
||||
int * backX, int * backY,
|
||||
int * numBackClipRects, drm_clip_rect_t ** pBackClipRects );
|
||||
/*@}*/
|
||||
|
||||
|
||||
/**
|
||||
* \name Timing related functions.
|
||||
*/
|
||||
/*@{*/
|
||||
/**
|
||||
* Get the 64-bit unadjusted system time (UST).
|
||||
*/
|
||||
int (*getUST)(int64_t * ust);
|
||||
|
||||
/**
|
||||
* Get the media stream counter (MSC) rate.
|
||||
*
|
||||
* Matching the definition in GLX_OML_sync_control, this function returns
|
||||
* the rate of the "media stream counter". In practical terms, this is
|
||||
* the frame refresh rate of the display.
|
||||
*/
|
||||
GLboolean (*getMSCRate)(__DRInativeDisplay * dpy, __DRIid drawable,
|
||||
int32_t * numerator, int32_t * denominator);
|
||||
/*@}*/
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Framebuffer information record. Used by libGL to communicate information
|
||||
* about the framebuffer to the driver's \c __driCreateNewScreen function.
|
||||
@@ -247,25 +278,6 @@ struct __DRIscreenRec {
|
||||
*/
|
||||
void (*destroyScreen)(__DRInativeDisplay *dpy, int scrn, void *screenPrivate);
|
||||
|
||||
/**
|
||||
* Method to create the private DRI context data and initialize the
|
||||
* context dependent methods.
|
||||
*
|
||||
* \sa __DRIscreenRec::createNewContext driCreateContext
|
||||
* driCreateNewContext
|
||||
*
|
||||
* \deprecated
|
||||
* This function has been replaced by \c __DRIscreenRec::createNewContext.
|
||||
* New drivers will continue to export this method, but it will eventually
|
||||
* (in the next XFree86 major relearse) go away.
|
||||
*/
|
||||
#ifndef DRI_NEW_INTERFACE_ONLY
|
||||
void *(*createContext)(Display *dpy, XVisualInfo *vis, void *sharedPrivate,
|
||||
__DRIcontext *pctx);
|
||||
#else
|
||||
void * createContext;
|
||||
#endif /* DRI_NEW_INTERFACE_ONLY */
|
||||
|
||||
/**
|
||||
* Method to create the private DRI drawable data and initialize the
|
||||
* drawable dependent methods.
|
||||
@@ -341,30 +353,6 @@ struct __DRIcontextRec {
|
||||
*/
|
||||
void (*destroyContext)(__DRInativeDisplay *dpy, int scrn, void *contextPrivate);
|
||||
|
||||
/**
|
||||
* Method to bind a DRI drawable to a DRI graphics context.
|
||||
*
|
||||
* \deprecated Replaced by bindContext3.
|
||||
*/
|
||||
#ifndef DRI_NEW_INTERFACE_ONLY
|
||||
Bool (*bindContext)(Display *dpy, int scrn, GLXDrawable draw,
|
||||
GLXContext gc);
|
||||
#else
|
||||
void *bindContext;
|
||||
#endif /* DRI_NEW_INTERFACE_ONLY */
|
||||
|
||||
/**
|
||||
* Method to unbind a DRI drawable to a DRI graphics context.
|
||||
*
|
||||
* \deprecated Replaced by unbindContext3.
|
||||
*/
|
||||
#ifndef DRI_NEW_INTERFACE_ONLY
|
||||
Bool (*unbindContext)(Display *dpy, int scrn, GLXDrawable draw,
|
||||
GLXContext gc, int will_rebind);
|
||||
#else
|
||||
void *unbindContext;
|
||||
#endif /* DRI_NEW_INTERFACE_ONLY */
|
||||
|
||||
/**
|
||||
* Opaque pointer to private per context direct rendering data.
|
||||
* \c NULL if direct rendering is not supported on the display or
|
||||
@@ -372,32 +360,6 @@ struct __DRIcontextRec {
|
||||
*/
|
||||
void *private;
|
||||
|
||||
/**
|
||||
* Method to bind a DRI drawable to a DRI graphics context.
|
||||
*
|
||||
* \since Internal API version 20030606.
|
||||
* \deprecated Replaced by bindContext3.
|
||||
*/
|
||||
#ifndef DRI_NEW_INTERFACE_ONLY
|
||||
Bool (*bindContext2)(Display *dpy, int scrn, GLXDrawable draw,
|
||||
GLXDrawable read, GLXContext gc);
|
||||
#else
|
||||
void *bindContext2;
|
||||
#endif /* DRI_NEW_INTERFACE_ONLY */
|
||||
|
||||
/**
|
||||
* Method to unbind a DRI drawable from a DRI graphics context.
|
||||
*
|
||||
* \since Internal API version 20030606.
|
||||
* \deprecated Replaced by unbindContext3.
|
||||
*/
|
||||
#ifndef DRI_NEW_INTERFACE_ONLY
|
||||
Bool (*unbindContext2)(Display *dpy, int scrn, GLXDrawable draw,
|
||||
GLXDrawable read, GLXContext gc);
|
||||
#else
|
||||
void *unbindContext2;
|
||||
#endif /* DRI_NEW_INTERFACE_ONLY */
|
||||
|
||||
/**
|
||||
* Pointer to the mode used to create this context.
|
||||
*
|
||||
@@ -408,17 +370,17 @@ struct __DRIcontextRec {
|
||||
/**
|
||||
* Method to bind a DRI drawable to a DRI graphics context.
|
||||
*
|
||||
* \since Internal API version 20040415.
|
||||
* \since Internal API version 20050727.
|
||||
*/
|
||||
GLboolean (*bindContext3)(__DRInativeDisplay *dpy, int scrn, __DRIid draw,
|
||||
GLboolean (*bindContext)(__DRInativeDisplay *dpy, int scrn, __DRIid draw,
|
||||
__DRIid read, __DRIcontext *ctx);
|
||||
|
||||
/**
|
||||
* Method to unbind a DRI drawable from a DRI graphics context.
|
||||
*
|
||||
* \since Internal API version 20040415.
|
||||
* \since Internal API version 20050727.
|
||||
*/
|
||||
GLboolean (*unbindContext3)(__DRInativeDisplay *dpy, int scrn, __DRIid draw,
|
||||
GLboolean (*unbindContext)(__DRInativeDisplay *dpy, int scrn, __DRIid draw,
|
||||
__DRIid read, __DRIcontext *ctx);
|
||||
};
|
||||
|
||||
|
@@ -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);
|
||||
|
@@ -235,21 +235,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);
|
||||
|
@@ -25,6 +25,7 @@ PROGS = \
|
||||
fplight \
|
||||
gamma \
|
||||
gears \
|
||||
gearbox \
|
||||
geartrain \
|
||||
glinfo \
|
||||
gloss \
|
||||
@@ -37,13 +38,13 @@ PROGS = \
|
||||
multiarb \
|
||||
occlude \
|
||||
paltex \
|
||||
pixeltex \
|
||||
pointblast \
|
||||
ray \
|
||||
readpix \
|
||||
reflect \
|
||||
renormal \
|
||||
shadowtex \
|
||||
singlebuffer \
|
||||
spectex \
|
||||
spriteblast \
|
||||
stex3d \
|
||||
@@ -51,7 +52,7 @@ PROGS = \
|
||||
terrain \
|
||||
tessdemo \
|
||||
texcyl \
|
||||
texdown \
|
||||
texdown-pool \
|
||||
texenv \
|
||||
texobj \
|
||||
trispd \
|
||||
|
@@ -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();
|
||||
}
|
||||
|
||||
|
486
progs/demos/gearbox.c
Normal file
486
progs/demos/gearbox.c
Normal file
@@ -0,0 +1,486 @@
|
||||
/*
|
||||
* 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_RGBA;
|
||||
|
||||
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;
|
||||
|
||||
GearRot += 70.0 * dt; /* 70 degrees per second */
|
||||
GearRot = fmod(GearRot, 360.0); /* prevents eventual overflow */
|
||||
|
||||
CubeRot += 15.0 * dt;
|
||||
|
||||
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);
|
||||
|
@@ -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;
|
||||
}
|
||||
|
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;
|
||||
}
|
@@ -38,8 +38,8 @@
|
||||
#include <GL/glut.h>
|
||||
|
||||
|
||||
static GLsizei MaxSize = 1024;
|
||||
static GLsizei TexWidth = 256, TexHeight = 256, TexBorder = 0;
|
||||
static GLsizei MaxSize = 2048;
|
||||
static GLsizei TexWidth = 1024, TexHeight = 1024, TexBorder = 0;
|
||||
static GLboolean ScaleAndBias = GL_FALSE;
|
||||
static GLboolean SubImage = GL_FALSE;
|
||||
static GLdouble DownloadRate = 0.0; /* texels/sec */
|
||||
@@ -47,6 +47,32 @@ static GLdouble DownloadRate = 0.0; /* texels/sec */
|
||||
static GLuint Mode = 0;
|
||||
|
||||
|
||||
/* Try and avoid L2 cache effects by cycling through a small number of
|
||||
* textures.
|
||||
*
|
||||
* At the initial size of 1024x1024x4 == 4mbyte, say 8 textures will
|
||||
* keep us out of most caches at 32mb total.
|
||||
*
|
||||
* This turns into a fairly interesting question of what exactly you
|
||||
* expect to be in cache in normal usage, and what you think should be
|
||||
* outside. There's no rules for this, no reason to favour one usage
|
||||
* over another except what the application you care about happens to
|
||||
* resemble most closely.
|
||||
*
|
||||
* - Should the client texture image be in L2 cache? Has it just been
|
||||
* generated or read from disk?
|
||||
* - Does the application really use >1 texture, or is it constantly
|
||||
* updating one image in-place?
|
||||
*
|
||||
* Different answers will favour different texture upload mechanisms.
|
||||
* To upload an image that is purely outside of cache, a DMA-based
|
||||
* upload will probably win, whereas for small, in-cache textures,
|
||||
* copying looks good.
|
||||
*/
|
||||
#define NR_TEXOBJ 4
|
||||
static GLuint TexObj[NR_TEXOBJ];
|
||||
|
||||
|
||||
struct FormatRec {
|
||||
GLenum Format;
|
||||
GLenum Type;
|
||||
@@ -116,25 +142,57 @@ TypeStr(GLenum type)
|
||||
}
|
||||
}
|
||||
|
||||
/* On x86, there is a performance cliff for memcpy to texture memory
|
||||
* for sources below 64 byte alignment. We do our best with this in
|
||||
* the driver, but it is better if the images are correctly aligned to
|
||||
* start with:
|
||||
*/
|
||||
#define ALIGN (1<<12)
|
||||
|
||||
static unsigned align(unsigned value, unsigned a)
|
||||
{
|
||||
return (value + a - 1) & ~(a-1);
|
||||
}
|
||||
|
||||
static int MIN2(int a, int b)
|
||||
{
|
||||
return a < b ? a : b;
|
||||
}
|
||||
|
||||
static void
|
||||
MeasureDownloadRate(void)
|
||||
{
|
||||
const int w = TexWidth + 2 * TexBorder;
|
||||
const int h = TexHeight + 2 * TexBorder;
|
||||
const int bytes = w * h * BytesPerTexel(Format);
|
||||
const int image_bytes = align(w * h * BytesPerTexel(Format), ALIGN);
|
||||
const int bytes = image_bytes * NR_TEXOBJ;
|
||||
GLubyte *orig_texImage, *orig_getImage;
|
||||
GLubyte *texImage, *getImage;
|
||||
GLdouble t0, t1, time;
|
||||
int count;
|
||||
int i;
|
||||
int offset = 0;
|
||||
GLdouble total = 0; /* ints will tend to overflow */
|
||||
|
||||
texImage = (GLubyte *) malloc(bytes);
|
||||
getImage = (GLubyte *) malloc(bytes);
|
||||
if (!texImage || !getImage) {
|
||||
printf("allocating %d bytes for %d %dx%d images\n",
|
||||
bytes, NR_TEXOBJ, w, h);
|
||||
|
||||
orig_texImage = (GLubyte *) malloc(bytes + ALIGN);
|
||||
orig_getImage = (GLubyte *) malloc(image_bytes + ALIGN);
|
||||
if (!orig_texImage || !orig_getImage) {
|
||||
DownloadRate = 0.0;
|
||||
return;
|
||||
}
|
||||
|
||||
printf("alloc %p %p\n", orig_texImage, orig_getImage);
|
||||
|
||||
texImage = (GLubyte *)align((unsigned)orig_texImage, ALIGN);
|
||||
getImage = (GLubyte *)align((unsigned)orig_getImage, ALIGN);
|
||||
|
||||
for (i = 1; !(((unsigned)texImage) & i); i<<=1)
|
||||
;
|
||||
printf("texture image alignment: %d bytes (%p)\n", i, texImage);
|
||||
|
||||
for (i = 0; i < bytes; i++) {
|
||||
texImage[i] = i & 0xff;
|
||||
}
|
||||
@@ -166,51 +224,80 @@ MeasureDownloadRate(void)
|
||||
count = 0;
|
||||
t0 = glutGet(GLUT_ELAPSED_TIME) * 0.001;
|
||||
do {
|
||||
int img = count%NR_TEXOBJ;
|
||||
GLubyte *img_ptr = texImage + img * image_bytes;
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, TexObj[img]);
|
||||
|
||||
if (SubImage && count > 0) {
|
||||
glTexSubImage2D(GL_TEXTURE_2D, 0, -TexBorder, -TexBorder, w, h,
|
||||
/* Only update a portion of the image each iteration. This
|
||||
* is presumably why you'd want to use texsubimage, otherwise
|
||||
* you may as well just call teximage again.
|
||||
*
|
||||
* A bigger question is whether to use a pointer that moves
|
||||
* with each call, ie does the incoming data come from L2
|
||||
* cache under normal circumstances, or is it pulled from
|
||||
* uncached memory?
|
||||
*
|
||||
* There's a good argument to say L2 cache, ie you'd expect
|
||||
* the data to have been recently generated. It's possible
|
||||
* that it could have come from a file read, which may or may
|
||||
* not have gone through the cpu.
|
||||
*/
|
||||
glTexSubImage2D(GL_TEXTURE_2D, 0,
|
||||
-TexBorder,
|
||||
-TexBorder + offset * h/8,
|
||||
w,
|
||||
h/8,
|
||||
FormatTable[Format].Format,
|
||||
FormatTable[Format].Type, texImage);
|
||||
FormatTable[Format].Type,
|
||||
#if 1
|
||||
texImage /* likely in L2$ */
|
||||
#else
|
||||
img_ptr + offset * bytes/8 /* unlikely in L2$ */
|
||||
#endif
|
||||
);
|
||||
offset += 1;
|
||||
offset %= 8;
|
||||
total += w * h / 8;
|
||||
}
|
||||
else {
|
||||
glTexImage2D(GL_TEXTURE_2D, 0,
|
||||
FormatTable[Format].IntFormat, w, h, TexBorder,
|
||||
FormatTable[Format].Format,
|
||||
FormatTable[Format].Type, texImage);
|
||||
FormatTable[Format].Type,
|
||||
img_ptr);
|
||||
total += w*h;
|
||||
}
|
||||
|
||||
#if 1
|
||||
/* Render a texture, but not necessarily the one just uploaded.
|
||||
*/
|
||||
/* glBindTexture(GL_TEXTURE_2D, TexObj[(img + NR_TEXOBJ/2)%NR_TEXOBJ]); */
|
||||
|
||||
/* draw a tiny polygon to force texture into texram */
|
||||
glBegin(GL_TRIANGLES);
|
||||
glTexCoord2f(0, 0); glVertex2f(1, 1);
|
||||
glTexCoord2f(1, 0); glVertex2f(3, 1);
|
||||
glTexCoord2f(0.5, 1); glVertex2f(2, 3);
|
||||
glEnd();
|
||||
/* glFinish(); */
|
||||
#endif
|
||||
|
||||
t1 = glutGet(GLUT_ELAPSED_TIME) * 0.001;
|
||||
time = t1 - t0;
|
||||
count++;
|
||||
/* printf("total %f count %d\n", total, count); */
|
||||
} while (time < 3.0);
|
||||
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
|
||||
printf("w*h=%d count=%d time=%f\n", w*h, count, time);
|
||||
DownloadRate = w * h * count / time;
|
||||
printf("total texels=%f time=%f\n", total, time);
|
||||
DownloadRate = total / time;
|
||||
|
||||
#if 0
|
||||
if (!ScaleAndBias) {
|
||||
/* verify texture readback */
|
||||
glGetTexImage(GL_TEXTURE_2D, 0,
|
||||
FormatTable[Format].Format,
|
||||
FormatTable[Format].Type, getImage);
|
||||
for (i = 0; i < w * h; i++) {
|
||||
if (texImage[i] != getImage[i]) {
|
||||
printf("[%d] %d != %d\n", i, texImage[i], getImage[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
free(texImage);
|
||||
free(getImage);
|
||||
free(orig_texImage);
|
||||
free(orig_getImage);
|
||||
|
||||
{
|
||||
GLint err = glGetError();
|
@@ -92,7 +92,7 @@ static void idle( void )
|
||||
dt = t - t0;
|
||||
t0 = t;
|
||||
Angle += 120.0*dt;
|
||||
glutPostRedisplay();
|
||||
/* glutPostRedisplay(); */
|
||||
}
|
||||
|
||||
|
||||
|
@@ -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;
|
||||
}
|
111
progs/fp/tri-lit.c
Normal file
111
progs/fp/tri-lit.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"
|
||||
"SUB R0, {0.5}.x, fragment.color; \n"
|
||||
"LIT 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;
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user