Compare commits
313 Commits
mesa_20050
...
mesa_20050
Author | SHA1 | Date | |
---|---|---|---|
|
b4979ec178 | ||
|
6c1948d593 | ||
|
729cccba5d | ||
|
7e8e4c500e | ||
|
f6e7cfb60d | ||
|
52608d2d21 | ||
|
1c48986e54 | ||
|
1fc4bcbb17 | ||
|
44367aab2a | ||
|
2c6e8e90ec | ||
|
81032030ff | ||
|
a8534885ef | ||
|
79b7bd18bb | ||
|
8e56122782 | ||
|
ea93b2986b | ||
|
002d0ad3e9 | ||
|
562bdaf70e | ||
|
9899f58c76 | ||
|
dce3a91a8d | ||
|
2d2f5a4b19 | ||
|
ee7ad16f3f | ||
|
2c7336af4e | ||
|
012de39c23 | ||
|
60339c7062 | ||
|
7fb16836e7 | ||
|
d45cb9a836 | ||
|
681b758f11 | ||
|
a0b5c98364 | ||
|
31d0cedd78 | ||
|
7477a7d366 | ||
|
4417d4cb61 | ||
|
ed7f3aead8 | ||
|
395280bf88 | ||
|
a4691981d9 | ||
|
1d60469c4c | ||
|
461a2a799a | ||
|
757e0855ad | ||
|
17d249d31b | ||
|
4f923fb0bc | ||
|
c20a2b0b72 | ||
|
ef9e0be0cb | ||
|
2e7dcdd38b | ||
|
d59fbcdee5 | ||
|
3c4c6d1f80 | ||
|
40b8b57ed4 | ||
|
df5e2b934b | ||
|
d96dd3cd49 | ||
|
bb8b302dbc | ||
|
5ec5c6b222 | ||
|
863bd56520 | ||
|
5821f3d70c | ||
|
5b10d71559 | ||
|
516546ad5b | ||
|
3fe9c40cb2 | ||
|
13c8f985d9 | ||
|
1516f559bc | ||
|
c4fbdb090c | ||
|
589a3a3f6e | ||
|
f090fdc50b | ||
|
d638f6a0bb | ||
|
502504de23 | ||
|
f772e3dd15 | ||
|
c7264415b6 | ||
|
1b93953fbc | ||
|
5d5100aabc | ||
|
2e081cd90e | ||
|
0009e3d97d | ||
|
628b18b8ca | ||
|
4ec6eceea9 | ||
|
8c2a9a9166 | ||
|
ef377c3c00 | ||
|
b79c47e90c | ||
|
8a1df96862 | ||
|
9dff2ca07a | ||
|
12eabeb3b9 | ||
|
c7f8d36451 | ||
|
993d8ad5ef | ||
|
b328dded75 | ||
|
c1b87b2a06 | ||
|
0936eeb456 | ||
|
f2149a7a66 | ||
|
0b73889d54 | ||
|
2962f88189 | ||
|
f054fa85d8 | ||
|
2ed4c296d9 | ||
|
22b0a42465 | ||
|
0bae91562e | ||
|
908dbc44c2 | ||
|
74e412c695 | ||
|
0080faf83e | ||
|
d322810e13 | ||
|
6580a6d561 | ||
|
70dbbbf89a | ||
|
497dd3e920 | ||
|
249db89b00 | ||
|
020225496e | ||
|
69509641a8 | ||
|
978d2fda3c | ||
|
ae516306b4 | ||
|
e45b5a4fa8 | ||
|
8e5099d6a0 | ||
|
d2ee346a93 | ||
|
170999a103 | ||
|
d1834e8c10 | ||
|
0432411837 | ||
|
0f71c6691e | ||
|
fc534034cc | ||
|
1de60fe47f | ||
|
c16264b138 | ||
|
1aadf1c039 | ||
|
1008f57f6f | ||
|
2b73e5aaaf | ||
|
863eca9973 | ||
|
39e14d2cff | ||
|
741b980433 | ||
|
3f6d985753 | ||
|
49109d01c0 | ||
|
8286abd798 | ||
|
53d13e014f | ||
|
f387c83ec1 | ||
|
e87ab8c05f | ||
|
6b5afb0036 | ||
|
89bf62cd49 | ||
|
5dc31379c4 | ||
|
c97a3a3038 | ||
|
7df5eddf6a | ||
|
f7c0c4f485 | ||
|
b4c8b34534 | ||
|
45ab8cb08a | ||
|
b31b1f44f1 | ||
|
7708b75d72 | ||
|
c73968af95 | ||
|
9a726cdf8f | ||
|
7179810375 | ||
|
a1b07e187e | ||
|
39c0e51329 | ||
|
2f9722863d | ||
|
731f1b12a0 | ||
|
2d5f12ae6b | ||
|
afa7f6a0f5 | ||
|
eeada48497 | ||
|
0c4731b27c | ||
|
17bcf9f816 | ||
|
eb9d6f44a9 | ||
|
241b6b7ab1 | ||
|
2dea6df80b | ||
|
6fe176a648 | ||
|
eb8be5d923 | ||
|
446980473d | ||
|
b70a47736a | ||
|
3cc2f82bb5 | ||
|
923515b3f8 | ||
|
e3e8067db7 | ||
|
8f384f0b67 | ||
|
e58d32947e | ||
|
063efce6ee | ||
|
bab559b1fa | ||
|
8f8e0f0b01 | ||
|
18a74321aa | ||
|
c2745ffa49 | ||
|
9557401a98 | ||
|
67cc1f6ba6 | ||
|
c70dace694 | ||
|
6040d34109 | ||
|
8608978aba | ||
|
02168254a8 | ||
|
e5ff2b94ff | ||
|
216f89318e | ||
|
e3cdbca63f | ||
|
6bc9ea1df9 | ||
|
9a1b5af333 | ||
|
8818eae253 | ||
|
2b2bd08589 | ||
|
dc7fc17396 | ||
|
96582f4f28 | ||
|
dd4c1dd038 | ||
|
b745bf08cd | ||
|
2f74adc41f | ||
|
e53fc72f67 | ||
|
bd565e4bb7 | ||
|
9a3da7ea7b | ||
|
6e56f905d0 | ||
|
2860e5f536 | ||
|
22652f952f | ||
|
ae818ed1da | ||
|
198d6d05b0 | ||
|
5a0cb726d1 | ||
|
d2ab4eb2c2 | ||
|
2ec2e94e2e | ||
|
40c1c723fb | ||
|
bf7f998f39 | ||
|
bb2c65200c | ||
|
5119056324 | ||
|
4c80f8df46 | ||
|
e03b5cdf3f | ||
|
167b141e6e | ||
|
d06da50888 | ||
|
c1082804a8 | ||
|
ffd97d20aa | ||
|
a33f0d3024 | ||
|
380991cb65 | ||
|
3e8001a465 | ||
|
af1a729972 | ||
|
cf4f3c5061 | ||
|
4cf20d9236 | ||
|
72a313902b | ||
|
f9bad3dfea | ||
|
a495ed372f | ||
|
d9789b7861 | ||
|
51ac95ba89 | ||
|
6493bd07a7 | ||
|
7bfe8df08a | ||
|
5873faf39b | ||
|
fdeda9c458 | ||
|
9b134f641c | ||
|
efeea95dcc | ||
|
45472672a2 | ||
|
aca2e0da3c | ||
|
d5084d42d4 | ||
|
578f63f2bf | ||
|
1c606a9aa1 | ||
|
09f433b97c | ||
|
8110df4f61 | ||
|
9cf35d2876 | ||
|
11bd5c1ac4 | ||
|
686e9b9f57 | ||
|
aecc05627a | ||
|
d0ddf190aa | ||
|
5cb977fedf | ||
|
296428dcf4 | ||
|
ee83a1302f | ||
|
7012d01d88 | ||
|
a6ed129dfc | ||
|
733bc876ee | ||
|
64034c4fb5 | ||
|
846eb333ae | ||
|
c9a69a6968 | ||
|
269e3895d9 | ||
|
5c72837af9 | ||
|
5f430c9976 | ||
|
714be699be | ||
|
10432bcc0a | ||
|
69a2f7cdd5 | ||
|
db21f1c84f | ||
|
4e68f4c1fa | ||
|
1e5772f0ba | ||
|
ac6728d2d9 | ||
|
49d8cbe8d1 | ||
|
9d148e6b2b | ||
|
363d0bcf01 | ||
|
e490242b9a | ||
|
a582015905 | ||
|
3509fd8c1b | ||
|
93cd9237d7 | ||
|
1243b829bb | ||
|
2fcaf7a529 | ||
|
a42fe19d8d | ||
|
e57d5c4742 | ||
|
5a5b4436cb | ||
|
3ffe8731e6 | ||
|
c5f5055097 | ||
|
dbeea25bb8 | ||
|
f29f2fc294 | ||
|
ab81d1fd99 | ||
|
d9fdb6c2bb | ||
|
9eef0da109 | ||
|
8b88f62fbd | ||
|
948fa3b295 | ||
|
586f2c59fe | ||
|
e3b0c19ec9 | ||
|
9ca8815d3b | ||
|
ecb6bfc0ce | ||
|
fee163a61a | ||
|
0e26580c90 | ||
|
c8542705f7 | ||
|
435eff8b85 | ||
|
276330b241 | ||
|
ff6723e326 | ||
|
1180fc13db | ||
|
5c6aec2f39 | ||
|
86300c6945 | ||
|
fc3bc1ae14 | ||
|
d3bd97bb14 | ||
|
52064f6c37 | ||
|
2eb147e7f5 | ||
|
6f3d16c64a | ||
|
42fa81275c | ||
|
e3f684b753 | ||
|
883d20791a | ||
|
b1d0ac64ab | ||
|
c64573997c | ||
|
e133984f51 | ||
|
bd8162aaac | ||
|
4a55d4ffa7 | ||
|
6258b76c49 | ||
|
203dcb733d | ||
|
bd1d9d96b2 | ||
|
9f8b3fac97 | ||
|
0355d3ff94 | ||
|
cb34c11663 | ||
|
1077779c7d | ||
|
1c39d183c4 | ||
|
fd4f7064e2 | ||
|
db46e2a7dd | ||
|
e7769cb348 | ||
|
d83c4e6dd1 | ||
|
73e8ffe9f3 | ||
|
286c4cc201 | ||
|
b3e878ad90 | ||
|
eae0439ae6 | ||
|
79c0bb5264 | ||
|
41a93f544e | ||
|
e4b2356c07 |
42
Makefile
42
Makefile
@@ -28,6 +28,7 @@ realclean:
|
||||
-rm -f `find . -name \*.o`
|
||||
-rm -f `find . -name \*.a`
|
||||
-rm -f `find . -name \*.so`
|
||||
-rm -f `find . -name depend`
|
||||
|
||||
|
||||
|
||||
@@ -61,6 +62,7 @@ darwin \
|
||||
darwin-static \
|
||||
freebsd \
|
||||
freebsd-dri \
|
||||
freebsd-dri-amd64 \
|
||||
freebsd-dri-x86 \
|
||||
hpux10 \
|
||||
hpux10-gcc \
|
||||
@@ -108,7 +110,9 @@ linux-x86 \
|
||||
linux-x86-debug \
|
||||
linux-x86-32 \
|
||||
linux-x86-64 \
|
||||
linux-x86-64-debug \
|
||||
linux-x86-64-static \
|
||||
linux-x86-xcb \
|
||||
linux-x86-glide \
|
||||
linux-x86-static \
|
||||
netbsd \
|
||||
@@ -137,7 +141,6 @@ LIB_FILES = \
|
||||
$(DIRECTORY)/Makefile* \
|
||||
$(DIRECTORY)/descrip.mms \
|
||||
$(DIRECTORY)/mms-config. \
|
||||
$(DIRECTORY)/Mesa.dsw \
|
||||
$(DIRECTORY)/bin/mklib \
|
||||
$(DIRECTORY)/bin/installmesa \
|
||||
$(DIRECTORY)/configs/[a-z]* \
|
||||
@@ -177,28 +180,25 @@ LIB_FILES = \
|
||||
$(DIRECTORY)/src/mesa/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/depend \
|
||||
$(DIRECTORY)/src/mesa/main/*.[chS] \
|
||||
$(DIRECTORY)/src/mesa/main/main.dsp \
|
||||
$(DIRECTORY)/src/mesa/main/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/glapi/*.[chS] \
|
||||
$(DIRECTORY)/src/mesa/glapi/glapi.dsp \
|
||||
$(DIRECTORY)/src/mesa/glapi/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/array_cache/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/array_cache/array_cache.dsp \
|
||||
$(DIRECTORY)/src/mesa/array_cache/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/math/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/math/math.dsp \
|
||||
$(DIRECTORY)/src/mesa/math/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/shader/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/shader/shader.dsp \
|
||||
$(DIRECTORY)/src/mesa/shader/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/shader/grammar/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/shader/grammar/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/shader/slang/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/shader/slang/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/shader/slang/library/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/swrast/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/swrast/swrast.dsp \
|
||||
$(DIRECTORY)/src/mesa/swrast/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/swrast_setup/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/swrast_setup/swrast_setup.dsp \
|
||||
$(DIRECTORY)/src/mesa/swrast_setup/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/tnl/*.[chS] \
|
||||
$(DIRECTORY)/src/mesa/tnl/tnl.dsp \
|
||||
$(DIRECTORY)/src/mesa/tnl/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/tnl_dd/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/tnl_dd/imm/*.[ch] \
|
||||
@@ -207,8 +207,8 @@ LIB_FILES = \
|
||||
$(DIRECTORY)/src/mesa/drivers/beos/Makefile \
|
||||
$(DIRECTORY)/src/mesa/drivers/common/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/drivers/common/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/drivers/directfb/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/drivers/directfb/Makefile \
|
||||
$(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 \
|
||||
@@ -224,12 +224,10 @@ LIB_FILES = \
|
||||
$(DIRECTORY)/src/mesa/drivers/osmesa/Makefile.win \
|
||||
$(DIRECTORY)/src/mesa/drivers/osmesa/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/drivers/osmesa/osmesa.def \
|
||||
$(DIRECTORY)/src/mesa/drivers/osmesa/osmesa.dsp \
|
||||
$(DIRECTORY)/src/mesa/drivers/osmesa/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/drivers/svga/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/drivers/windows/*/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/drivers/windows/*/*.def \
|
||||
$(DIRECTORY)/src/mesa/drivers/windows/*/*.dsp \
|
||||
$(DIRECTORY)/src/mesa/drivers/x11/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/drivers/x11/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/sparc/*.[chS] \
|
||||
@@ -241,9 +239,7 @@ LIB_FILES = \
|
||||
$(DIRECTORY)/src/glu/sgi/Makefile \
|
||||
$(DIRECTORY)/src/glu/sgi/Makefile.win \
|
||||
$(DIRECTORY)/src/glu/sgi/Makefile.DJ \
|
||||
$(DIRECTORY)/src/glu/sgi/cc*.txt \
|
||||
$(DIRECTORY)/src/glu/sgi/glu.def \
|
||||
$(DIRECTORY)/src/glu/sgi/glu.dsp \
|
||||
$(DIRECTORY)/src/glu/sgi/dummy.cc \
|
||||
$(DIRECTORY)/src/glu/sgi/descrip.mms \
|
||||
$(DIRECTORY)/src/glu/sgi/mesaglu.opt \
|
||||
@@ -275,7 +271,13 @@ LIB_FILES = \
|
||||
$(DIRECTORY)/progs/util/sampleMakefile \
|
||||
$(DIRECTORY)/vms/analyze_map.com \
|
||||
$(DIRECTORY)/vms/xlib.opt \
|
||||
$(DIRECTORY)/vms/xlib_share.opt
|
||||
$(DIRECTORY)/vms/xlib_share.opt \
|
||||
$(DIRECTORY)/windows/VC?/mesa/gdi/gdi.dsp \
|
||||
$(DIRECTORY)/windows/VC?/mesa/glu/*.txt \
|
||||
$(DIRECTORY)/windows/VC?/mesa/glu/glu.dsp \
|
||||
$(DIRECTORY)/windows/VC?/mesa/mesa.dsw \
|
||||
$(DIRECTORY)/windows/VC?/mesa/mesa/mesa.dsp \
|
||||
$(DIRECTORY)/windows/VC?/mesa/osmesa/osmesa.dsp
|
||||
|
||||
|
||||
GLUT_FILES = \
|
||||
@@ -286,7 +288,6 @@ GLUT_FILES = \
|
||||
$(DIRECTORY)/src/glut/glx/*def \
|
||||
$(DIRECTORY)/src/glut/glx/descrip.mms \
|
||||
$(DIRECTORY)/src/glut/glx/mms_depend \
|
||||
$(DIRECTORY)/src/glut/glx/glut.dsp \
|
||||
$(DIRECTORY)/src/glut/glx/*.[ch] \
|
||||
$(DIRECTORY)/src/glut/beos/*.[ch] \
|
||||
$(DIRECTORY)/src/glut/beos/*.cpp \
|
||||
@@ -309,8 +310,6 @@ DEMO_FILES = \
|
||||
$(DIRECTORY)/progs/demos/*.cxx \
|
||||
$(DIRECTORY)/progs/demos/*.dat \
|
||||
$(DIRECTORY)/progs/demos/README \
|
||||
$(DIRECTORY)/progs/demos/Windows/*.dsp \
|
||||
$(DIRECTORY)/progs/demos/Windows/*.dsw \
|
||||
$(DIRECTORY)/progs/xdemos/Makefile* \
|
||||
$(DIRECTORY)/progs/xdemos/descrip.mms \
|
||||
$(DIRECTORY)/progs/xdemos/*.[chf] \
|
||||
@@ -323,7 +322,10 @@ DEMO_FILES = \
|
||||
$(DIRECTORY)/progs/windml/Makefile.ugl \
|
||||
$(DIRECTORY)/progs/windml/*.c \
|
||||
$(DIRECTORY)/progs/windml/*.bmp \
|
||||
$(DIRECTORY)/progs/ggi/*.c
|
||||
$(DIRECTORY)/progs/ggi/*.c \
|
||||
$(DIRECTORY)/windows/VC?/progs/demos/*.dsp \
|
||||
$(DIRECTORY)/windows/VC?/progs/glut/glut.dsp \
|
||||
$(DIRECTORY)/windows/VC?/progs/progs.dsw
|
||||
|
||||
|
||||
DRI_FILES = \
|
||||
|
@@ -31,8 +31,6 @@
|
||||
# Available options:
|
||||
#
|
||||
# Environment variables:
|
||||
# CPU optimize for the given processor.
|
||||
# default = pentium
|
||||
# GLU=[mesa|sgi] specify GLU directory; can be `sgi' (requires GNU/C++)
|
||||
# or `mesa'.
|
||||
# default = mesa
|
||||
@@ -59,12 +57,10 @@
|
||||
|
||||
.PHONY : all libgl libglu libglut clean realclean
|
||||
|
||||
CPU ?= pentium
|
||||
|
||||
GLU ?= mesa
|
||||
|
||||
CFLAGS = -Wall -W -pedantic
|
||||
CFLAGS += -O2 -ffast-math -mtune=$(CPU)
|
||||
CFLAGS += -O2 -ffast-math
|
||||
|
||||
export CFLAGS
|
||||
|
||||
|
@@ -31,8 +31,6 @@
|
||||
# Available options:
|
||||
#
|
||||
# Environment variables:
|
||||
# CPU optimize for the given processor.
|
||||
# default = pentium
|
||||
# GLIDE path to Glide3 SDK; used with FX.
|
||||
# default = $(TOP)/glide3
|
||||
# FX=1 build for 3dfx Glide3. Note that this disables
|
||||
@@ -57,8 +55,6 @@
|
||||
|
||||
.PHONY : all libgl clean realclean
|
||||
|
||||
CPU ?= pentium
|
||||
|
||||
ifeq ($(ICD),1)
|
||||
# when -std=c99 mingw will not define WIN32
|
||||
CFLAGS = -Wall -W -Werror
|
||||
@@ -66,7 +62,7 @@ else
|
||||
# I love c89
|
||||
CFLAGS = -Wall -W -pedantic
|
||||
endif
|
||||
CFLAGS += -O2 -ffast-math -mtune=$(CPU)
|
||||
CFLAGS += -O2 -ffast-math
|
||||
|
||||
export CFLAGS
|
||||
|
||||
|
179
Mesa.dsw
179
Mesa.dsw
@@ -1,179 +0,0 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "array_cache"=".\SRC\MESA\array_cache\array_cache.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "gdi"=".\src\mesa\drivers\windows\gdi\gdi.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name array_cache
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name main
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name math
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name swrast_setup
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name swrast
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name tnl
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name glapi
|
||||
End Project Dependency
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name shader
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "glapi"=".\SRC\MESA\glapi\glapi.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "glu"=".\src\glu\sgi\glu.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name gdi
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "main"=".\SRC\MESA\main\main.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "math"=".\SRC\MESA\math\math.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "osmesa"=".\SRC\MESA\DRIVERS\osmesa\osmesa.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name gdi
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "shader"=".\SRC\MESA\shader\shader.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "swrast"=".\SRC\MESA\swrast\swrast.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "swrast_setup"=".\SRC\MESA\swrast_setup\swrast_setup.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "tnl"=".\SRC\MESA\tnl\tnl.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
@@ -53,8 +53,10 @@ set -v
|
||||
|
||||
mkdir ${INCLUDE_DIR}
|
||||
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}
|
||||
|
||||
echo "Done."
|
||||
|
@@ -39,7 +39,7 @@ GL_LIB_NAME = lib$(GL_LIB).so
|
||||
GLU_LIB_NAME = lib$(GLU_LIB).so
|
||||
GLUT_LIB_NAME = lib$(GLUT_LIB).so
|
||||
GLW_LIB_NAME = lib$(GLW_LIB).so
|
||||
OSMESA_LIB_NAME = lib$(OSMesa).so
|
||||
OSMESA_LIB_NAME = lib$(OSMESA_LIB).so
|
||||
|
||||
|
||||
# Optional assembly language optimization files for libGL
|
||||
@@ -56,6 +56,7 @@ INSTALL_PREFIX = /usr/local
|
||||
SRC_DIRS = mesa glu glut/glx glw
|
||||
GLU_DIRS = sgi
|
||||
DRIVER_DIRS = x11 osmesa
|
||||
# Which subdirs under $(TOP)/progs/ to enter:
|
||||
PROGRAM_DIRS = demos redbook samples xdemos
|
||||
|
||||
|
||||
|
@@ -11,16 +11,18 @@ CXX = g++
|
||||
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
|
||||
CFLAGS = $(DEFINES) -Wmissing-prototypes -g -std=c99 -Wundef -fPIC -ffast-math -I/usr/local/include $(X11_INCLUDES)
|
||||
CFLAGS = $(DEFINES) -Wmissing-prototypes -g -std=c99 -Wundef -fPIC \
|
||||
-ffast-math $(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 -pthread
|
||||
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread
|
||||
|
||||
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
|
||||
|
8
configs/freebsd-dri-amd64
Normal file
8
configs/freebsd-dri-amd64
Normal file
@@ -0,0 +1,8 @@
|
||||
# -*-makefile-*-
|
||||
# Configuration for freebsd-dri-amd64: FreeBSD DRI hardware drivers
|
||||
|
||||
include $(TOP)/configs/freebsd-dri
|
||||
|
||||
CONFIG_NAME = freebsd-dri-x86-64
|
||||
|
||||
ASM_FLAGS = -DUSE_X86_64_ASM
|
@@ -1,4 +1,4 @@
|
||||
# Configuration for generic Linux
|
||||
# Configuration for Linux fbdev interface
|
||||
|
||||
include $(TOP)/configs/linux
|
||||
|
||||
@@ -7,3 +7,4 @@ DRIVER_DIRS = fbdev
|
||||
|
||||
CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -DUSE_GLFBDEV_DRIVER
|
||||
|
||||
PROGRAM_DIRS = fbdev
|
||||
|
@@ -8,23 +8,35 @@ CONFIG_NAME = linux-solo
|
||||
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 -DUSE_EXTERNAL_DXTN_LIB=1 -DDRM_USE_MALLOC
|
||||
WARN_FLAGS = -Wall -Wundef
|
||||
OPT_FLAGS = -O3 -g
|
||||
PIC_FLAGS = -fPIC
|
||||
|
||||
# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support.
|
||||
ARCH_FLAGS ?=
|
||||
|
||||
CFLAGS = $(DEFINES) -Wmissing-prototypes -g -std=c99 -Wundef -fPIC -ffast-math
|
||||
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
|
||||
|
||||
CXXFLAGS = $(DEFINES) -Wall -O3 -ansi -pedantic -fPIC
|
||||
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
|
||||
DRI_LIB_DEPS = -lm -lpthread -lexpat -ldl
|
||||
DRI_LIB_DEPS = -lm -lpthread -lexpat -ldl -L$(LIB_DIR) -lEGL -l$(GL_LIB)
|
||||
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 = mesa glx/mini glu glut/mini
|
||||
SRC_DIRS = egl mesa glx/mini glu glut/mini
|
||||
DRIVER_DIRS = dri
|
||||
PROGRAM_DIRS = miniglx
|
||||
PROGRAM_DIRS = miniglx egl
|
||||
|
||||
#DRI_DIRS = fb ffb gamma sis savage
|
||||
#DRI_DIRS = ffb gamma sis savage
|
||||
DRI_DIRS = i810 i830 i915 mach64 mga r128 r200 radeon tdfx unichrome fb
|
||||
|
@@ -1,32 +1,12 @@
|
||||
# Configuration for linux-solo: Linux DRI hardware drivers for fbdev
|
||||
# -*-makefile-*-
|
||||
# Configuration for linux-solo-x86: Linux hardware drivers for fbdev for x86
|
||||
|
||||
include $(TOP)/configs/default
|
||||
include $(TOP)/configs/linux-solo
|
||||
|
||||
CONFIG_NAME = linux-solo-x86
|
||||
|
||||
# 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 -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DDRM_USE_MALLOC
|
||||
|
||||
CFLAGS = $(DEFINES) -Wmissing-prototypes -O3 -g -std=c99 -Wundef -fPIC -ffast-math
|
||||
|
||||
CXXFLAGS = $(DEFINES) -Wall -O3 -ansi -pedantic -fPIC
|
||||
|
||||
# Unnecessary on x86, generally.
|
||||
PIC_FLAGS =
|
||||
|
||||
ASM_FLAGS = -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM
|
||||
ASM_SOURCES = $(X86_SOURCES)
|
||||
|
||||
# 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 ffb gamma sis savage
|
||||
DRI_DIRS = i810 i830 i915 mach64 mga r128 r200 radeon tdfx unichrome
|
||||
|
@@ -9,5 +9,5 @@ CONFIG_NAME = linux-x86-32
|
||||
|
||||
CFLAGS = -m32 -Wall -O3 -ansi -pedantic -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM -DPTHREADS -I/usr/X11R6/include
|
||||
|
||||
CXXFLAGS = -m32 -Wall -O3 -ansi -pedantic -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
|
||||
CXXFLAGS = -m32 -Wall -O3 fPIC -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE
|
||||
|
||||
|
@@ -8,14 +8,14 @@ CONFIG_NAME = linux-x86-64
|
||||
CC = gcc
|
||||
CXX = g++
|
||||
|
||||
CFLAGS = -m64 -Wall -O3 -ansi -pedantic -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include
|
||||
CFLAGS = -m64 -Wall -O3 -std=c99 -pedantic -fPIC -D_REENTRANT -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DUSE_X86_64_ASM
|
||||
|
||||
CXXFLAGS = -m64 -Wall -O3 -ansi -pedantic -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
|
||||
CXXFLAGS = -m64 -Wall -O3 -fPIC -D_REENTRANT -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE
|
||||
|
||||
GLUT_CFLAGS = -fexceptions
|
||||
|
||||
|
||||
#ASM_SOURCES = $(X86_SOURCES)
|
||||
ASM_SOURCES = $(X86-64_SOURCES)
|
||||
|
||||
|
||||
LIB_DIR = $(TOP)/lib64
|
||||
|
28
configs/linux-x86-64-debug
Normal file
28
configs/linux-x86-64-debug
Normal file
@@ -0,0 +1,28 @@
|
||||
# Configuration for Linux for 64-bit X86 (Opteron)
|
||||
|
||||
include $(TOP)/configs/default
|
||||
|
||||
CONFIG_NAME = linux-x86-64-debug
|
||||
|
||||
# Compiler and flags
|
||||
CC = gcc
|
||||
CXX = g++
|
||||
|
||||
CFLAGS = -g -m64 -Wall -O3 -std=c99 -pedantic -fPIC -D_REENTRANT -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DUSE_X86_64_ASM -DDEBUG -DMESA_DEBUG -DRUN_DEBUG_BENCHMARK
|
||||
|
||||
CXXFLAGS = -g -m64 -Wall -O3 -ansi -pedantic -fPIC -D_REENTRANT -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DDEBUG -DMESA_DEBUG -DRUN_DEBUG_BENCHMARK
|
||||
|
||||
GLUT_CFLAGS = -fexceptions
|
||||
|
||||
|
||||
ASM_SOURCES = $(X86-64_SOURCES)
|
||||
|
||||
|
||||
LIB_DIR = $(TOP)/lib64
|
||||
|
||||
|
||||
# Library/program dependencies
|
||||
GL_LIB_DEPS = -L/usr/X11R6/lib64 -lX11 -lXext -lm -lpthread
|
||||
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib64 -lX11 -lXmu -lXt -lXi -lm
|
||||
GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib64 -lXt -lX11
|
||||
APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm
|
@@ -10,7 +10,7 @@ CXX = g++
|
||||
|
||||
CFLAGS = -m64 -Wall -O3 -ansi -pedantic -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include
|
||||
|
||||
CXXFLAGS = -m64 -Wall -O3 -ansi -pedantic -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
|
||||
CXXFLAGS = -m64 -Wall -O3 -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE
|
||||
|
||||
GLUT_CFLAGS = -fexceptions
|
||||
|
||||
|
24
configs/linux-x86-xcb
Normal file
24
configs/linux-x86-xcb
Normal file
@@ -0,0 +1,24 @@
|
||||
# Configuration for Linux with x86 optimizations
|
||||
|
||||
include $(TOP)/configs/default
|
||||
|
||||
CONFIG_NAME = linux-x86-xcb
|
||||
|
||||
# Compiler and flags
|
||||
CC = gcc
|
||||
CXX = g++
|
||||
|
||||
CFLAGS = -Wall -O3 -ansi -pedantic -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM -DPTHREADS -DUSE_XCB -I/usr/X11R6/include
|
||||
|
||||
CXXFLAGS = -Wall -O3 -ansi -pedantic -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XCB
|
||||
|
||||
GLUT_CFLAGS = -fexceptions
|
||||
|
||||
|
||||
ASM_SOURCES = $(X86_SOURCES) $(X86_API)
|
||||
|
||||
# Library/program dependencies
|
||||
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -lXCB
|
||||
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
|
||||
GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib -lXt -lX11
|
||||
APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm
|
@@ -9,7 +9,7 @@ CC = cc
|
||||
CFLAGS = -Xa -xO3 -xpentium -KPIC -I/usr/openwin/include -DUSE_XSHM
|
||||
MKLIB_OPTIONS = -static
|
||||
|
||||
APP_LIB_DEPS = -L$(LIB_DIR) -L/usr/openwin/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm
|
||||
APP_LIB_DEPS = -L$(LIB_DIR) -L/usr/openwin/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm -lglut -lGLU -lGL
|
||||
|
||||
GL_LIB_NAME = libGL.a
|
||||
GLU_LIB_NAME = libGLU.a
|
||||
|
@@ -14,68 +14,77 @@ Quick & dirty start:
|
||||
|
||||
|
||||
|
||||
Contact:
|
||||
--------
|
||||
|
||||
Daniel Borca <dborca@users.sourceforge.net>
|
||||
|
||||
|
||||
|
||||
WARNING! The info below this line is outdated (yet some of it useful). WARNING!
|
||||
*******************************************************************************
|
||||
The Mingw port for Mesa 3-D Graphics Library was created August 30, 1998 by Paul Garceau.
|
||||
|
||||
|
||||
|
||||
August 30, 1998 -- Paul Garceau
|
||||
Updated January 13, 2000 -- Paul Garceau (pgarceau@teleport.com)
|
||||
Updated January 13, 2000; June 3, 2005 -- Paul Garceau <pgarceau@users.sourceforge.net>
|
||||
|
||||
DISCLAIMER: I make this port of the Mesa 3-D Graphics Library as a service
|
||||
to the general public. I can, in no way support or make any guarantee that the
|
||||
build will work for your system.
|
||||
|
||||
The associated packages and batch files I have included as part of the GCC-2.95.2/Mingw32 extension are provided "As-is" with out any guarantee of support or functionality from this author.
|
||||
Acknowledgements:
|
||||
|
||||
Feel free to modify or change things as you see fit, just remember that
|
||||
I can't support any modifications you might want to make to the files which I
|
||||
have included OR the lgpl protected Mesa 3-D Graphics Library.
|
||||
Daniel Borca, whose work and commitment to maintaining the Mingw port of the Mesa 3-D Graphics Library has been, and will continue to be greatly appreciated by an overworked and underpaid developer such as myself.
|
||||
Without the creative inspiration and personal commitment provided by Mumit Khan, Jan-Jaap Vanderhagen and Colin Peters, Mingw would never have existed. Acknowledgements also need to be given to all of the developers who have worked on Mingw, Mesa and Msys over the years.
|
||||
Last, but certainly far from the least, Brian Paul, who has dedicated at least the last seven or eight years of his life to making Mesa 3-D Graphics Library what it is today and managing the development for all of those years.
|
||||
*********************************************************************************
|
||||
|
||||
I recommend using GCC-2.95.2/Mingw32 which is available at Mumit Khans' ftp site:
|
||||
Greetings,
|
||||
|
||||
(ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/mingw32/)
|
||||
Feel free to modify or change things related to the Mingw build as you see fit, just remember that, the author of the current build may not be able to support any modifications you might want to make to the files which have been included for the build.
|
||||
|
||||
Mesa core components are licensed under XFree-86 (for more on licensing of Mesa 3-D Graphics Library, check out the Mesa homepage (http://www.mesa3d.org).
|
||||
|
||||
The Mingw generated libraries themselves are licensed under the GNU-LGPL license. Source code for Mingw can be found at http://www.mingw.org. For licensing terms on Mingw, please visit http://www.mingw.org.
|
||||
|
||||
It is recommended that you use the latest "stable" release of Mingw. "Candidates" are beta testing distributions for Mingw. Mingw is available at http://www.mingw.org.
|
||||
|
||||
This build has been tested under WinNT4/SP6. Win9x and WinNT5 remain untested by me. I have not tested any of the demos included with Mesa3d.
|
||||
|
||||
I recommend using the GCC-2.95.2/Mingw32.
|
||||
Installation:
|
||||
|
||||
ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/mingw32/gcc-2.95.2
|
||||
This readme assumes that you already have extracted the necessary files to a working directory/folder that Mingw can use to build the Mesa3D libraries and that you know where that directory/folder is located on your Windows system. If you have any questions about how to set things up properly which is specific to Mesa3D, the folks on the Mesa3D mailing lists (http://www.mesa3d.org) would probably be happy to assist you. Also you can probably ask anyone on the Mingw mailing lists for any questions specific to Mingw (http://www.mingw.org)
|
||||
|
||||
Much thanks to the combined efforts of Mumit Khan, Jan-Jaap Vanderhagen
|
||||
and Colin Peters for making it possible for the Mingw32 toolchain to exist. Also, thanks go out to Stephane Rehel for the work that was completed on the Cygwin build.
|
||||
Targets and Environment variables used for Mingw build:
|
||||
|
||||
Installing GCC-2.95.2/Mingw32 Build:
|
||||
Before going into the actual build of the libraries, here is a list of available targets for the make process:
|
||||
|
||||
a) Open the file archive (either tar.gz or .zip extensions)
|
||||
"all" or "libgl" -- this target will build libopengl.a, a static library. It will not build the demos, etc.
|
||||
|
||||
b) Decide the directory you want to move the archived files to.
|
||||
clean -- this target will clean up most of the Mesa 3-D Graphics Library/object code from your hard drive.
|
||||
|
||||
realclean -- this target will clean up all of the Mesa 3D Graphics Library and the Mesa object code that it can find.
|
||||
|
||||
Environment Variables:
|
||||
|
||||
The environment variables are used to determine what sort of graphics driver support needs to be included in the finished Mesa 3-D Graphics Library.
|
||||
|
||||
GLIDE path to Glide3 SDK; used with FX.
|
||||
default = $(TOP)/glide3
|
||||
FX=1 build for 3dfx Glide3. Note that this disables
|
||||
compilation of most WMesa code and requires fxMesa.
|
||||
As a consequence, you'll need the Win32 Glide3
|
||||
library to build any application.
|
||||
default = no
|
||||
ICD=1 build the installable client driver interface
|
||||
(windows opengl driver interface)
|
||||
default = no
|
||||
X86=1 optimize for x86 (if possible, use MMX, SSE, 3DNow).
|
||||
default = no
|
||||
|
||||
d) Extract the files from the archive.
|
||||
|
||||
e) Edit the mingw32.bat file to accomodate your choice of directory structure.
|
||||
|
||||
%mesaroot%: This is your root directory (Mesa-3.3)
|
||||
%mesasrc%: This is the Mesa-3.3 src directory (Mesa-3.3\src)
|
||||
%mesalib%: This is where the build will put libGL.a and libGLU.a
|
||||
|
||||
Running the Build:
|
||||
|
||||
Open your Command Prompt or MS-DOS prompt.
|
||||
Go to your Mesa-3.3 'root' directory
|
||||
At the command line type: mingw32
|
||||
Launch Mingw.
|
||||
From the Windows Command Prompt:
|
||||
Set Environment Variables (as needed).
|
||||
"cd" to your Mesa3D 'root' directory.
|
||||
Enter "mingw32-make -f makefile.mgw <target>
|
||||
|
||||
That's all there is to it.
|
||||
|
||||
Enjoy!
|
||||
|
||||
Peace,
|
||||
|
||||
Paul G. (pgarceau@teleport.com)
|
||||
Paul G. <pgarceau@users.sourceforge.net>
|
||||
Daniel Borca <dborca@users.sourceforge.net>
|
||||
|
@@ -1,108 +1,136 @@
|
||||
File: docs/README.WIN32
|
||||
|
||||
Last updated: Oct 01, 2004 - Karl Schultz - kschultz@users.sourceforge.net
|
||||
Last updated: Jun 02, 2005 - Karl Schultz - kschultz@users.sourceforge.net
|
||||
|
||||
Quick Start
|
||||
----- -----
|
||||
|
||||
Unzip both ZIP files (MesaLib and MesaDemos) into the same directory.
|
||||
The libs and demos build separately, so if you do not care about the
|
||||
demos, you do not have to unzip that zip file. But if you do, it does
|
||||
need to be unzipped into the same directory as the lib zip file because
|
||||
the demos depend on the libs.
|
||||
need to be unzipped into the same directory as the lib zip file
|
||||
because the demos depend on the libs.
|
||||
|
||||
The build system has been changed to use Microsoft Visual Studio project
|
||||
workspaces and projects. Makefiles are no longer shipped or supported, but
|
||||
can be generated from the projects using Visual Studio.
|
||||
The Windows build system uses Microsoft Visual Studio. Project files
|
||||
for a specific version of Visual Studio are in their own directory in
|
||||
the top-level "windows" directory. For example, Visual Studio 6 files
|
||||
are in windows/VC6. If a directory does not exist for your version of
|
||||
Visual Studio, you can try importing the project files from an earlier
|
||||
version of Visual Studio. At this time, project files exist for
|
||||
Version 6.
|
||||
|
||||
The workspace and project files were created with Visual Studio 6, so that
|
||||
they can be used with VS6 and so that they can also be imported into VS 7.
|
||||
The project files to build the core Mesa library, Windows Mesa
|
||||
drivers, OSMesa, and GLU are in the mesa directory. The project files
|
||||
to build GLUT and some demo programs are in the progs directory.
|
||||
|
||||
Details and Notes
|
||||
Makefiles are no longer shipped or supported, but can be generated
|
||||
from the projects using Visual Studio.
|
||||
|
||||
- To build the Mesa libraries, open the Mesa.dsw workspace file
|
||||
in the top directory. You will need to build at least one
|
||||
driver. Currently, only the gdi and osmesa drivers are available.
|
||||
Select one or the other as the active project and build it.
|
||||
If you want glu, select the glu project as active and build that as well.
|
||||
|
||||
- Glut is no longer in the Mesa.dsw workspace. It is now built in
|
||||
the demo workspace (see below).
|
||||
|
||||
- The build process will create a lib directory in the top directory
|
||||
and will put the following files there as you build them:
|
||||
Windows Drivers
|
||||
------- -------
|
||||
|
||||
At this time, only the GDI driver is known to work, as it has been
|
||||
ported and rewritten to the latest Mesa DD interfaces. Source code
|
||||
also exists in the tree for other drivers in src/mesa/drivers/windows,
|
||||
but the status of this code is unknown.
|
||||
|
||||
The GDI driver operates basically by writing pixel spans into a DIB
|
||||
section and then blitting the DIB to the window. The driver was
|
||||
recently cleaned up and rewitten and so may have bugs or may be
|
||||
missing some functionality. The older versions of the CVS source may
|
||||
be useful in figuring out any problems, or report them to me.
|
||||
|
||||
To build Mesa with the GDI driver, build the mesa, gdi, and glu
|
||||
projects in the Visual Studio workspace found at
|
||||
windows/VC?/mesa/mesa.dsw. The osmesa DLL can also be built with the
|
||||
osmesa project.
|
||||
|
||||
The build system creates a lib top-level directory and copies
|
||||
resulting LIB and DLL files to this lib directory. The files are:
|
||||
|
||||
OPENGL32.LIB, GLU32.LIB, OSMESA32.LIB
|
||||
OPENGL32.DLL, GLU32.DLL, OSMESA32.DLL
|
||||
|
||||
- Some users have reported problems building glu with VS7 after importing
|
||||
and converting the VS6 project files. The problem is caused by a custom
|
||||
build step that was put in place to work around a problem with VS6 not
|
||||
recognizing .cc files as C++ source files. It appears that VS7 can be
|
||||
configured to recognize .cc files as C++ files and so it compiles these
|
||||
glu files with the default settings, and does not use settings that are
|
||||
required to compile the files correctly. The easiest way to solve the
|
||||
problem is to remove the .cc files from the glu project. This does not
|
||||
delete the files, but removes them from the project so that VS does not
|
||||
try to compile them at all. This allows the custom build step to compile
|
||||
the files with the proper settings.
|
||||
If the MesaDemos ZIP file was extracted, the DLL files are also copied
|
||||
to the demos directory.
|
||||
|
||||
- After building, you can copy the above DLL files to a place in your PATH
|
||||
such as $SystemRoot/SYSTEM32. If you don't like putting things in a
|
||||
system directory, place them in the same directory as the executable(s).
|
||||
Be careful about accidentially overwriting files of the same name in
|
||||
the SYSTEM32 directory.
|
||||
|
||||
- Build the demos by opening the appropriate *.dsw file in the
|
||||
progs directory tree. For example, to build the demos, use
|
||||
progs/demos/Windows/demos.dsw. The Windows directory contains
|
||||
the workspace and all the projects for each demo program. Each
|
||||
project places the executable in the same directory as its source
|
||||
code, which is required for some demos.
|
||||
GLUT and Demos
|
||||
---- --- -----
|
||||
|
||||
- The demo projects also copy the Mesa library DLL files from the lib
|
||||
directory into the same directory as the demo executables, so that
|
||||
the demos use the Mesa libs you just built.
|
||||
A Visual Studio workspace can be found at windows/VC?/progs/progs.dsw.
|
||||
It can be used to build GLUT and a few demos. The GLUT lib and DLL
|
||||
are copied to the top-level lib directory, along with the Mesa libs.
|
||||
|
||||
- The DLL files are built so that the external entry points use the
|
||||
stdcall calling convention.
|
||||
The demo build system expects to find the LIB files in the top level
|
||||
lib directory, so you must build the Mesa libs first. The demo
|
||||
executables are placed in the demos directory, because some of them
|
||||
rely on data files found there. Also, the Mesa lib DLL's were copied
|
||||
there by the Mesa lib build process. Therefore, you should be able to
|
||||
simply run the demo executables from the demo directory.
|
||||
|
||||
- Static LIB files are not built. The LIB files that are built with
|
||||
are the linker import files associated with the DLL files.
|
||||
|
||||
- The si-glu sources are used to build the GLU libs. This was done
|
||||
mainly to get the better tessellator code.
|
||||
|
||||
- The Windows driver (in src/Windows) builds and runs at least at
|
||||
a minimal level. I modified this driver to work with the new
|
||||
Mesa 4.0 code and driver architecture, but I did not do a great
|
||||
deal of optimization and testing. There are many opportunities
|
||||
for optimization, many of which can be done by coding more specific
|
||||
paths for the rasterizers. See src/osmesa/osmesa.c for some good
|
||||
examples.
|
||||
Build System Notes
|
||||
----- ------ -----
|
||||
|
||||
- There is DirectDraw support in the Windows driver, updated by
|
||||
Daniel Slater. You'll need to uncomment the #define DDRAW line
|
||||
in src/Windows/wmesadef.h and add ddraw.lib to the list of libraries.
|
||||
On some systems, you will acheive significantly higher framerates
|
||||
with DirectDraw.
|
||||
VC6
|
||||
---
|
||||
|
||||
- Some of the more specialized code like FX drivers, stereo, and
|
||||
parallel support isn't compiled or tested. I left much of this
|
||||
code alone, but it may need some work to get it 'turned on' again.
|
||||
Visual Studio 6 does not recognize files with the .cc extension as C++
|
||||
language files, without a lot of unnatural tweaking. So, the VC6
|
||||
build process uses custom build steps to compile these files in the
|
||||
GLU library.
|
||||
|
||||
- No assembly code is compiled or assembled. Again, this may need
|
||||
some work to turn it back on or use it again.
|
||||
|
||||
- To build "mangled" Mesa, add the preprocessor define USE_MGL_NAMESPACE
|
||||
to the project settings. You will also need to edit src/mesa.def to change
|
||||
all the gl* symbols to mgl*. Because this is easy to do with a global
|
||||
replace operation in a text editor, no additional mangled version of mesa.def
|
||||
is maintained or shipped.
|
||||
VC7
|
||||
---
|
||||
|
||||
Some users have reported problems building glu with VC7 after
|
||||
importing and converting the VC6 project files. The problem is caused
|
||||
by a custom build step that was put in place to work around a problem
|
||||
with VC6 not recognizing .cc files as C++ source files. It appears
|
||||
that VC7 can be configured to recognize .cc files as C++ files and so
|
||||
it compiles these glu files with the default settings, and does not
|
||||
use settings that are required to compile the files correctly. The
|
||||
easiest way to solve the problem is to remove the .cc files from the
|
||||
glu project. This does not delete the files, but removes them from
|
||||
the project so that VS does not try to compile them at all. This
|
||||
allows the custom build step to compile the files with the proper
|
||||
settings. Another approach is to remove the custom build step and fix
|
||||
the project up to compile the files normally.
|
||||
|
||||
|
||||
General
|
||||
-------
|
||||
|
||||
After building, you can copy the above DLL files to a place in your
|
||||
PATH such as $SystemRoot/SYSTEM32. If you don't like putting things
|
||||
in a system directory, place them in the same directory as the
|
||||
executable(s). Be careful about accidentially overwriting files of
|
||||
the same name in the SYSTEM32 directory.
|
||||
|
||||
The DLL files are built so that the external entry points use the
|
||||
stdcall calling convention.
|
||||
|
||||
Static LIB files are not built. The LIB files that are built with are
|
||||
the linker import files associated with the DLL files.
|
||||
|
||||
The si-glu sources are used to build the GLU libs. This was done
|
||||
mainly to get the better tessellator code.
|
||||
|
||||
To build "mangled" Mesa, add the preprocessor define USE_MGL_NAMESPACE
|
||||
to the project settings. You will also need to edit src/mesa.def to
|
||||
change all the gl* symbols to mgl*. Because this is easy to do with a
|
||||
global replace operation in a text editor, no additional mangled
|
||||
version of mesa.def is maintained or shipped.
|
||||
|
||||
If you have a Windows-related build problem or question, it is
|
||||
probably better to direct it to me (kschultz@users.sourceforge.net),
|
||||
rather than directly to the other Mesa developers. I will help you
|
||||
as much as I can. I also monitor the Mesa mailing lists and will
|
||||
answer questions in this area there as well.
|
||||
rather than directly to the other Mesa developers. I will help you as
|
||||
much as I can. I also monitor the Mesa mailing lists and will answer
|
||||
questions in this area there as well.
|
||||
|
||||
|
||||
Karl Schultz
|
||||
|
@@ -27,6 +27,9 @@ 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
|
||||
|
||||
DirectFB driver, contributed by Claudio Ciccani. See docs/README.directfb
|
||||
for details.
|
||||
|
||||
@@ -94,4 +97,4 @@ D3D needs updating
|
||||
|
||||
|
||||
----------------------------------------------------------------------
|
||||
$Id: RELNOTES-6.3,v 3.8 2005/01/20 04:03:37 brianp Exp $
|
||||
$Id: RELNOTES-6.3,v 3.9 2005/05/04 20:11:35 brianp Exp $
|
||||
|
@@ -1308,7 +1308,7 @@ Mesa Version History
|
||||
- glReadPixels from a clipped front color buffer didn't always work
|
||||
- glTexImage didn't accept GL_RED/GREEN/BLUE as the format
|
||||
- Attempting queries/accesses of VBO 0 weren't detected as errors
|
||||
- paletted textures failed if the palette had fewer that 256 entries
|
||||
- paletted textures failed if the palette had fewer than 256 entries
|
||||
Changes:
|
||||
- fixed a bunch of compiler warnings found with gcc 3.4
|
||||
- bug reports should to go bugzilla.freedesktop.org
|
||||
@@ -1320,11 +1320,13 @@ Mesa Version History
|
||||
- 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)
|
||||
Bug fixes:
|
||||
- some functions didn't support PBO functionality
|
||||
- glGetTexImage didn't convert color index images to RGBA as required
|
||||
|
@@ -1,15 +1,27 @@
|
||||
<HTML>
|
||||
|
||||
<title>Banner</title>
|
||||
|
||||
|
||||
<body text="#ffffff" bgcolor="#aa4444">
|
||||
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title>Banner</title>
|
||||
</head>
|
||||
<body bgcolor="#000000" text="#ffffff">
|
||||
<center>
|
||||
<p>
|
||||
<font size="5">The Mesa 3D Graphics Library</font>
|
||||
</p>
|
||||
<table style="width: 95%; text-align: left;" border="0" cellpadding="2"
|
||||
cellspacing="2">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align: top;">
|
||||
<p><img src="gears.png"> </p>
|
||||
</td>
|
||||
<td style="text-align: center;"><font face="sans-serif" size="5">The
|
||||
Mesa 3D Graphics Library</font></td>
|
||||
<td style="vertical-align: top; text-align: right;">
|
||||
<p><img src="gears.png"> </p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><font face="sans-serif" size="5"><br>
|
||||
</font></p>
|
||||
</center>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
@@ -4,20 +4,20 @@
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="mesa.css"></head>
|
||||
|
||||
<body bgcolor="#119955">
|
||||
<body bgcolor="#eeeeee">
|
||||
|
||||
<!--Override a few values from the style sheet: -->
|
||||
<style>
|
||||
<!--
|
||||
body {
|
||||
background-color: #119955;
|
||||
color: white;
|
||||
background-color: #cccccc;
|
||||
color: black;
|
||||
}
|
||||
a:link {
|
||||
color: #fff;
|
||||
color: #000;
|
||||
}
|
||||
a:visited {
|
||||
color: #ccc;
|
||||
color: #000;
|
||||
}
|
||||
-->
|
||||
</style>
|
||||
|
BIN
docs/gears.png
Normal file
BIN
docs/gears.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
@@ -1,20 +1,29 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
|
||||
<html>
|
||||
|
||||
<title>Mesa Home Page</title></head>
|
||||
<head>
|
||||
<title>Mesa Home Page</title>
|
||||
</head>
|
||||
|
||||
<frameset rows="80,*" border="0" frameborder="yes">
|
||||
|
||||
<frameset rows="50,100% " border="1" framespacing="1" frameborder="yes">
|
||||
<frame src="banner.html" name="BannerFrame" scrolling="no" marginwidth="1" marginheight="1" resize="">
|
||||
<frameset cols="28%,72% " border="1" framespacing="1" frameborder="yes">
|
||||
<frame src="contents.html" name="ContentsFrame" marginwidth="2" marginheight="1" resize="">
|
||||
<frame src="news.html" name="MainFrame" marginwidth="3" marginheight="1" resize="">
|
||||
</frameset>
|
||||
</frameset>
|
||||
<frame src="banner.html" name="BannerFrame"
|
||||
scrolling="no" marginwidth="1" marginheight="1">
|
||||
|
||||
<frameset cols="28%,72% " border="1" frameborder="yes">
|
||||
|
||||
<frame src="contents.html" name="ContentsFrame"
|
||||
marginwidth="2" marginheight="1" noresize="noresize">
|
||||
|
||||
<frame src="news.html" name="MainFrame"
|
||||
marginwidth="3" marginheight="1" noresize="noresize">
|
||||
|
||||
</frameset>
|
||||
|
||||
<noframes>
|
||||
|
||||
<body>
|
||||
</body>
|
||||
|
||||
<p>Sorry, this site requires frame support</p>
|
||||
</noframes>
|
||||
</html>
|
||||
|
||||
</frameset>
|
||||
|
||||
</html>
|
||||
|
@@ -1,20 +1,19 @@
|
||||
/* Mesa CSS */
|
||||
body {
|
||||
background-color: #55bbff;
|
||||
background-color: #ffffff;
|
||||
/*background-color: #55bbff;*/
|
||||
font: 14px 'Lucida Grande', Geneva, Arial, Verdana, sans-serif;
|
||||
color: black;
|
||||
link: #111188;
|
||||
}
|
||||
|
||||
h1 {
|
||||
background-color: #55bbff;
|
||||
font: 24px 'Lucida Grande', Geneva, Arial, Verdana, sans-serif;
|
||||
font-weight: bold;
|
||||
color: black;
|
||||
}
|
||||
|
||||
h2 {
|
||||
background-color: #55bbff;
|
||||
font: 18px 'Lucida Grande', Geneva, Arial, Verdana, sans-serif, bold;
|
||||
font-weight: bold;
|
||||
color: black;
|
||||
|
@@ -25,7 +25,7 @@ This is a stable release which just fixes bugs since the 6.2 release.
|
||||
- glReadPixels from a clipped front color buffer didn't always work
|
||||
- glTexImage didn't accept GL_RED/GREEN/BLUE as the format
|
||||
- Attempting queries/accesses of VBO 0 weren't detected as errors
|
||||
- paletted textures failed if the palette had fewer that 256 entries
|
||||
- paletted textures failed if the palette had fewer than 256 entries
|
||||
Changes:
|
||||
- fixed a bunch of compiler warnings found with gcc 3.4
|
||||
- bug reports should to go bugzilla.freedesktop.org
|
||||
@@ -960,6 +960,6 @@ source code</a>.</p>
|
||||
|
||||
|
||||
<hr>
|
||||
$Id: news.html,v 3.18 2005/05/04 20:05:21 brianp Exp $
|
||||
$Id: news.html,v 3.19 2005/05/05 14:18:31 brianp Exp $
|
||||
</body>
|
||||
</html>
|
@@ -13,6 +13,7 @@
|
||||
|
||||
The following individuals and groups are to be acknowledged for their
|
||||
contributions to Mesa over the years.
|
||||
This list is far from complete and somewhat dated, unfortunately.
|
||||
|
||||
|
||||
<ul>
|
||||
@@ -32,14 +33,21 @@ substantial piece of work.
|
||||
Tungsten Graphics, Inc. have supported the ongoing development of Mesa.
|
||||
<br>
|
||||
<br>
|
||||
<li>The <A HREF="http://sourceforge.net/projects/mesa3d"
|
||||
target="_parent">Mesa</A>
|
||||
project is hosted by<A HREF="http://sourceforge.net"
|
||||
target="_parent"><IMG SRC="http://sourceforge.net/sflogo.php?group_id=3&type=1"
|
||||
<li>The
|
||||
<A HREF="http://sourceforge.net/projects/mesa3d" target="_parent">Mesa</A>
|
||||
website is hosted by
|
||||
<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>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<li>The Mesa CVS repository is hosted by
|
||||
<a href="http://freedesktop.org/" target="_parent">freedesktop.org</a>.
|
||||
<br>
|
||||
<br>
|
||||
|
||||
|
||||
<li><a href="http://www.altsoftware.com/"
|
||||
target="_parent">alt.software</a> contributed the Direct3D driver.
|
||||
|
||||
|
131
include/GL/gl.h
131
include/GL/gl.h
@@ -2,7 +2,7 @@
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 6.3
|
||||
*
|
||||
* Copyright (C) 1999-2004 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"),
|
||||
@@ -104,7 +104,7 @@
|
||||
#define APIENTRY GLAPIENTRY
|
||||
#endif
|
||||
|
||||
/* "P" suffix for when function returns a pointer */
|
||||
/* "P" suffix to be used for a pointer to a function */
|
||||
#ifndef APIENTRYP
|
||||
#define APIENTRYP APIENTRY *
|
||||
#endif
|
||||
@@ -853,7 +853,7 @@ GLAPI GLint GLAPIENTRY glRenderMode( GLenum mode );
|
||||
|
||||
GLAPI GLenum GLAPIENTRY glGetError( void );
|
||||
|
||||
GLAPI const GLubyte GLAPIENTRYP glGetString( GLenum name );
|
||||
GLAPI const GLubyte * GLAPIENTRY glGetString( GLenum name );
|
||||
|
||||
GLAPI void GLAPIENTRY glFinish( void );
|
||||
|
||||
@@ -2213,13 +2213,9 @@ GLAPI void GLAPIENTRY glTracePointerRangeMESA( const GLvoid* first, const GLvoid
|
||||
|
||||
typedef void (*GLprogramcallbackMESA)(GLenum target, GLvoid *data);
|
||||
|
||||
GLAPI void GLAPIENTRY
|
||||
glProgramCallbackMESA(GLenum target, GLprogramcallbackMESA callback,
|
||||
GLvoid *data);
|
||||
GLAPI void GLAPIENTRY glProgramCallbackMESA(GLenum target, GLprogramcallbackMESA callback, GLvoid *data);
|
||||
|
||||
GLAPI void GLAPIENTRY
|
||||
glGetProgramRegisterfvMESA(GLenum target, GLsizei len, const GLubyte *name,
|
||||
GLfloat *v);
|
||||
GLAPI void GLAPIENTRY glGetProgramRegisterfvMESA(GLenum target, GLsizei len, const GLubyte *name, GLfloat *v);
|
||||
|
||||
#endif /* GL_MESA_program_debug */
|
||||
|
||||
@@ -2235,123 +2231,6 @@ typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEATIPROC) (GLenum modeRGB, GLen
|
||||
#endif /* GL_ATI_blend_equation_separate */
|
||||
|
||||
|
||||
/* XXX this is temporary here! */
|
||||
#ifndef GL_EXT_framebuffer_object
|
||||
#define GL_EXT_framebuffer_object
|
||||
|
||||
GLAPI GLboolean GLAPIENTRY
|
||||
glIsRenderbufferEXT(GLuint renderbuffer);
|
||||
|
||||
GLAPI void GLAPIENTRY
|
||||
glBindRenderbufferEXT(GLenum target, GLuint renderbuffer);
|
||||
|
||||
GLAPI void GLAPIENTRY
|
||||
glDeleteRenderbuffersEXT(GLsizei n, const GLuint *renderbuffers);
|
||||
|
||||
GLAPI void GLAPIENTRY
|
||||
glGenRenderbuffersEXT(GLsizei n, GLuint *renderbuffers);
|
||||
|
||||
GLAPI void GLAPIENTRY
|
||||
glRenderbufferStorageEXT(GLenum target, GLenum internalformat,
|
||||
GLsizei width, GLsizei height);
|
||||
|
||||
GLAPI void GLAPIENTRY
|
||||
glGetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint *params);
|
||||
|
||||
GLAPI GLboolean GLAPIENTRY
|
||||
glIsFramebufferEXT(GLuint framebuffer);
|
||||
|
||||
GLAPI void GLAPIENTRY
|
||||
glBindFramebufferEXT(GLenum target, GLuint framebuffer);
|
||||
|
||||
GLAPI void GLAPIENTRY
|
||||
glDeleteFramebuffersEXT(GLsizei n, const GLuint *framebuffers);
|
||||
|
||||
GLAPI void GLAPIENTRY
|
||||
glGenFramebuffersEXT(GLsizei n, GLuint *framebuffers);
|
||||
|
||||
GLAPI GLenum GLAPIENTRY
|
||||
glCheckFramebufferStatusEXT(GLenum target);
|
||||
|
||||
GLAPI void GLAPIENTRY
|
||||
glFramebufferTexture1DEXT(GLenum target, GLenum attachment,
|
||||
GLenum textarget, GLuint texture, GLint level);
|
||||
|
||||
GLAPI void GLAPIENTRY
|
||||
glFramebufferTexture2DEXT(GLenum target, GLenum attachment,
|
||||
GLenum textarget, GLuint texture, GLint level);
|
||||
|
||||
GLAPI void GLAPIENTRY
|
||||
glFramebufferTexture3DEXT(GLenum target, GLenum attachment,
|
||||
GLenum textarget, GLuint texture,
|
||||
GLint level, GLint zoffset);
|
||||
|
||||
GLAPI void GLAPIENTRY
|
||||
glFramebufferRenderbufferEXT(GLenum target, GLenum attachment,
|
||||
GLenum renderbuffertarget,
|
||||
GLuint renderbuffer);
|
||||
|
||||
GLAPI void GLAPIENTRY
|
||||
glGetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment,
|
||||
GLenum pname, GLint *params);
|
||||
|
||||
GLAPI void GLAPIENTRY
|
||||
glGenerateMipmapEXT(GLenum target);
|
||||
|
||||
|
||||
#define GL_FRAMEBUFFER_EXT 0x8D40
|
||||
#define GL_RENDERBUFFER_EXT 0x8D41
|
||||
#define GL_STENCIL_INDEX_EXT 0x8D45
|
||||
#define GL_STENCIL_INDEX1_EXT 0x8D46
|
||||
#define GL_STENCIL_INDEX4_EXT 0x8D47
|
||||
#define GL_STENCIL_INDEX8_EXT 0x8D48
|
||||
#define GL_STENCIL_INDEX16_EXT 0x8D49
|
||||
#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42
|
||||
#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43
|
||||
#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4
|
||||
#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0
|
||||
#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1
|
||||
#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2
|
||||
#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3
|
||||
#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4
|
||||
#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5
|
||||
#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6
|
||||
#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7
|
||||
#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8
|
||||
#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9
|
||||
#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA
|
||||
#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB
|
||||
#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC
|
||||
#define GL_COLOR_ATTACHMENT13_EXT 0x8CED
|
||||
#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE
|
||||
#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF
|
||||
#define GL_DEPTH_ATTACHMENT_EXT 0x8D00
|
||||
#define GL_STENCIL_ATTACHMENT_EXT 0x8D20
|
||||
#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT 0x8CD8
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC
|
||||
#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD
|
||||
#define GL_FRAMEBUFFER_STATUS_ERROR_EXT 0x8CDE
|
||||
#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6
|
||||
#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7
|
||||
#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF
|
||||
#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8
|
||||
#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506
|
||||
|
||||
#endif /* GL_EXT_framebuffer_object */
|
||||
|
||||
|
||||
|
||||
/**
|
||||
** NOTE!!!!! If you add new functions to this file, or update
|
||||
** glext.h be sure to regenerate the gl_mangle.h file. See comments
|
||||
|
@@ -62,11 +62,13 @@
|
||||
#define glBindBufferARB MANGLE(BindBufferARB)
|
||||
#define glBindBuffer MANGLE(BindBuffer)
|
||||
#define glBindFragmentShaderATI MANGLE(BindFragmentShaderATI)
|
||||
#define glBindFramebufferEXT MANGLE(BindFramebufferEXT)
|
||||
#define glBindLightParameterEXT MANGLE(BindLightParameterEXT)
|
||||
#define glBindMaterialParameterEXT MANGLE(BindMaterialParameterEXT)
|
||||
#define glBindParameterEXT MANGLE(BindParameterEXT)
|
||||
#define glBindProgramARB MANGLE(BindProgramARB)
|
||||
#define glBindProgramNV MANGLE(BindProgramNV)
|
||||
#define glBindRenderbufferEXT MANGLE(BindRenderbufferEXT)
|
||||
#define glBindTexGenParameterEXT MANGLE(BindTexGenParameterEXT)
|
||||
#define glBindTextureEXT MANGLE(BindTextureEXT)
|
||||
#define glBindTexture MANGLE(BindTexture)
|
||||
@@ -102,6 +104,7 @@
|
||||
#define glBufferSubData MANGLE(BufferSubData)
|
||||
#define glCallList MANGLE(CallList)
|
||||
#define glCallLists MANGLE(CallLists)
|
||||
#define glCheckFramebufferStatusEXT MANGLE(CheckFramebufferStatusEXT)
|
||||
#define glClampColorARB MANGLE(ClampColorARB)
|
||||
#define glClearAccum MANGLE(ClearAccum)
|
||||
#define glClearColor MANGLE(ClearColor)
|
||||
@@ -244,6 +247,7 @@
|
||||
#define glDeleteFencesAPPLE MANGLE(DeleteFencesAPPLE)
|
||||
#define glDeleteFencesNV MANGLE(DeleteFencesNV)
|
||||
#define glDeleteFragmentShaderATI MANGLE(DeleteFragmentShaderATI)
|
||||
#define glDeleteFramebuffersEXT MANGLE(DeleteFramebuffersEXT)
|
||||
#define glDeleteLists MANGLE(DeleteLists)
|
||||
#define glDeleteObjectARB MANGLE(DeleteObjectARB)
|
||||
#define glDeleteOcclusionQueriesNV MANGLE(DeleteOcclusionQueriesNV)
|
||||
@@ -252,6 +256,7 @@
|
||||
#define glDeleteProgramsNV MANGLE(DeleteProgramsNV)
|
||||
#define glDeleteQueriesARB MANGLE(DeleteQueriesARB)
|
||||
#define glDeleteQueries MANGLE(DeleteQueries)
|
||||
#define glDeleteRenderbuffersEXT MANGLE(DeleteRenderbuffersEXT)
|
||||
#define glDeleteShader MANGLE(DeleteShader)
|
||||
#define glDeleteTexturesEXT MANGLE(DeleteTexturesEXT)
|
||||
#define glDeleteTextures MANGLE(DeleteTextures)
|
||||
@@ -365,6 +370,10 @@
|
||||
#define glFragmentMaterialfvSGIX MANGLE(FragmentMaterialfvSGIX)
|
||||
#define glFragmentMaterialiSGIX MANGLE(FragmentMaterialiSGIX)
|
||||
#define glFragmentMaterialivSGIX MANGLE(FragmentMaterialivSGIX)
|
||||
#define glFramebufferRenderbufferEXT MANGLE(FramebufferRenderbufferEXT)
|
||||
#define glFramebufferTexture1DEXT MANGLE(FramebufferTexture1DEXT)
|
||||
#define glFramebufferTexture2DEXT MANGLE(FramebufferTexture2DEXT)
|
||||
#define glFramebufferTexture3DEXT MANGLE(FramebufferTexture3DEXT)
|
||||
#define glFrameZoomSGIX MANGLE(FrameZoomSGIX)
|
||||
#define glFreeObjectBufferATI MANGLE(FreeObjectBufferATI)
|
||||
#define glFrontFace MANGLE(FrontFace)
|
||||
@@ -372,15 +381,18 @@
|
||||
#define glGenAsyncMarkersSGIX MANGLE(GenAsyncMarkersSGIX)
|
||||
#define glGenBuffersARB MANGLE(GenBuffersARB)
|
||||
#define glGenBuffers MANGLE(GenBuffers)
|
||||
#define glGenerateMipmapEXT MANGLE(GenerateMipmapEXT)
|
||||
#define glGenFencesAPPLE MANGLE(GenFencesAPPLE)
|
||||
#define glGenFencesNV MANGLE(GenFencesNV)
|
||||
#define glGenFragmentShadersATI MANGLE(GenFragmentShadersATI)
|
||||
#define glGenFramebuffersEXT MANGLE(GenFramebuffersEXT)
|
||||
#define glGenLists MANGLE(GenLists)
|
||||
#define glGenOcclusionQueriesNV MANGLE(GenOcclusionQueriesNV)
|
||||
#define glGenProgramsARB MANGLE(GenProgramsARB)
|
||||
#define glGenProgramsNV MANGLE(GenProgramsNV)
|
||||
#define glGenQueriesARB MANGLE(GenQueriesARB)
|
||||
#define glGenQueries MANGLE(GenQueries)
|
||||
#define glGenRenderbuffersEXT MANGLE(GenRenderbuffersEXT)
|
||||
#define glGenSymbolsEXT MANGLE(GenSymbolsEXT)
|
||||
#define glGenTexturesEXT MANGLE(GenTexturesEXT)
|
||||
#define glGenTextures MANGLE(GenTextures)
|
||||
@@ -438,6 +450,7 @@
|
||||
#define glGetFragmentLightivSGIX MANGLE(GetFragmentLightivSGIX)
|
||||
#define glGetFragmentMaterialfvSGIX MANGLE(GetFragmentMaterialfvSGIX)
|
||||
#define glGetFragmentMaterialivSGIX MANGLE(GetFragmentMaterialivSGIX)
|
||||
#define glGetFramebufferAttachmentParameterivEXT MANGLE(GetFramebufferAttachmentParameterivEXT)
|
||||
#define glGetHandleARB MANGLE(GetHandleARB)
|
||||
#define glGetHistogramEXT MANGLE(GetHistogramEXT)
|
||||
#define glGetHistogram MANGLE(GetHistogram)
|
||||
@@ -502,6 +515,7 @@
|
||||
#define glGetProgramNamedParameterfvNV MANGLE(GetProgramNamedParameterfvNV)
|
||||
#define glGetProgramParameterdvNV MANGLE(GetProgramParameterdvNV)
|
||||
#define glGetProgramParameterfvNV MANGLE(GetProgramParameterfvNV)
|
||||
#define glGetProgramRegisterfvMESA MANGLE(GetProgramRegisterfvMESA)
|
||||
#define glGetProgramStringARB MANGLE(GetProgramStringARB)
|
||||
#define glGetProgramStringNV MANGLE(GetProgramStringNV)
|
||||
#define glGetQueryivARB MANGLE(GetQueryivARB)
|
||||
@@ -510,6 +524,7 @@
|
||||
#define glGetQueryObjectiv MANGLE(GetQueryObjectiv)
|
||||
#define glGetQueryObjectuivARB MANGLE(GetQueryObjectuivARB)
|
||||
#define glGetQueryObjectuiv MANGLE(GetQueryObjectuiv)
|
||||
#define glGetRenderbufferParameterivEXT MANGLE(GetRenderbufferParameterivEXT)
|
||||
#define glGetSeparableFilterEXT MANGLE(GetSeparableFilterEXT)
|
||||
#define glGetSeparableFilter MANGLE(GetSeparableFilter)
|
||||
#define glGetShaderInfoLog MANGLE(GetShaderInfoLog)
|
||||
@@ -601,6 +616,7 @@
|
||||
#define glIsEnabled MANGLE(IsEnabled)
|
||||
#define glIsFenceAPPLE MANGLE(IsFenceAPPLE)
|
||||
#define glIsFenceNV MANGLE(IsFenceNV)
|
||||
#define glIsFramebufferEXT MANGLE(IsFramebufferEXT)
|
||||
#define glIsList MANGLE(IsList)
|
||||
#define glIsObjectBufferATI MANGLE(IsObjectBufferATI)
|
||||
#define glIsOcclusionQueryNV MANGLE(IsOcclusionQueryNV)
|
||||
@@ -609,6 +625,7 @@
|
||||
#define glIsProgramNV MANGLE(IsProgramNV)
|
||||
#define glIsQueryARB MANGLE(IsQueryARB)
|
||||
#define glIsQuery MANGLE(IsQuery)
|
||||
#define glIsRenderbufferEXT MANGLE(IsRenderbufferEXT)
|
||||
#define glIsShader MANGLE(IsShader)
|
||||
#define glIsTextureEXT MANGLE(IsTextureEXT)
|
||||
#define glIsTexture MANGLE(IsTexture)
|
||||
@@ -836,6 +853,7 @@
|
||||
#define glPrimitiveRestartNV MANGLE(PrimitiveRestartNV)
|
||||
#define glPrioritizeTexturesEXT MANGLE(PrioritizeTexturesEXT)
|
||||
#define glPrioritizeTextures MANGLE(PrioritizeTextures)
|
||||
#define glProgramCallbackMESA MANGLE(ProgramCallbackMESA)
|
||||
#define glProgramEnvParameter4dARB MANGLE(ProgramEnvParameter4dARB)
|
||||
#define glProgramEnvParameter4dvARB MANGLE(ProgramEnvParameter4dvARB)
|
||||
#define glProgramEnvParameter4fARB MANGLE(ProgramEnvParameter4fARB)
|
||||
@@ -895,6 +913,7 @@
|
||||
#define glRects MANGLE(Rects)
|
||||
#define glRectsv MANGLE(Rectsv)
|
||||
#define glReferencePlaneSGIX MANGLE(ReferencePlaneSGIX)
|
||||
#define glRenderbufferStorageEXT MANGLE(RenderbufferStorageEXT)
|
||||
#define glRenderMode MANGLE(RenderMode)
|
||||
#define glReplacementCodePointerSUN MANGLE(ReplacementCodePointerSUN)
|
||||
#define glReplacementCodeubSUN MANGLE(ReplacementCodeubSUN)
|
||||
@@ -1003,6 +1022,7 @@
|
||||
#define glStencilOpSeparateATI MANGLE(StencilOpSeparateATI)
|
||||
#define glStencilOpSeparate MANGLE(StencilOpSeparate)
|
||||
#define glStopInstrumentsSGIX MANGLE(StopInstrumentsSGIX)
|
||||
#define glStringMarkerGREMEDY MANGLE(StringMarkerGREMEDY)
|
||||
#define glSwizzleEXT MANGLE(SwizzleEXT)
|
||||
#define glTagSampleBufferSGIX MANGLE(TagSampleBufferSGIX)
|
||||
#define glTangent3bEXT MANGLE(Tangent3bEXT)
|
||||
|
@@ -52,9 +52,9 @@ extern "C" {
|
||||
/*************************************************************/
|
||||
|
||||
/* Header file version number, required by OpenGL ABI for Linux */
|
||||
/* glext.h last updated 2005/01/20 */
|
||||
/* glext.h last updated 2005/05/31 */
|
||||
/* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */
|
||||
#define GL_GLEXT_VERSION 26
|
||||
#define GL_GLEXT_VERSION 28
|
||||
|
||||
#ifndef GL_VERSION_1_2
|
||||
#define GL_UNSIGNED_BYTE_3_3_2 0x8032
|
||||
@@ -2980,6 +2980,65 @@ extern "C" {
|
||||
/* reuse GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_framebuffer_object
|
||||
#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506
|
||||
#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8
|
||||
#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6
|
||||
#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4
|
||||
#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT 0x8CD8
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC
|
||||
#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD
|
||||
#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF
|
||||
#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0
|
||||
#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1
|
||||
#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2
|
||||
#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3
|
||||
#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4
|
||||
#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5
|
||||
#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6
|
||||
#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7
|
||||
#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8
|
||||
#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9
|
||||
#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA
|
||||
#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB
|
||||
#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC
|
||||
#define GL_COLOR_ATTACHMENT13_EXT 0x8CED
|
||||
#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE
|
||||
#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF
|
||||
#define GL_DEPTH_ATTACHMENT_EXT 0x8D00
|
||||
#define GL_STENCIL_ATTACHMENT_EXT 0x8D20
|
||||
#define GL_FRAMEBUFFER_EXT 0x8D40
|
||||
#define GL_RENDERBUFFER_EXT 0x8D41
|
||||
#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42
|
||||
#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43
|
||||
#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44
|
||||
#define GL_STENCIL_INDEX_EXT 0x8D45
|
||||
#define GL_STENCIL_INDEX1_EXT 0x8D46
|
||||
#define GL_STENCIL_INDEX4_EXT 0x8D47
|
||||
#define GL_STENCIL_INDEX8_EXT 0x8D48
|
||||
#define GL_STENCIL_INDEX16_EXT 0x8D49
|
||||
#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50
|
||||
#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51
|
||||
#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52
|
||||
#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53
|
||||
#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54
|
||||
#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55
|
||||
#endif
|
||||
|
||||
#ifndef GL_GREMEDY_string_marker
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
@@ -6381,6 +6440,54 @@ typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLen
|
||||
#define GL_NV_vertex_program3 1
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_framebuffer_object
|
||||
#define GL_EXT_framebuffer_object 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI GLboolean APIENTRY glIsRenderbufferEXT (GLuint);
|
||||
GLAPI void APIENTRY glBindRenderbufferEXT (GLenum, GLuint);
|
||||
GLAPI void APIENTRY glDeleteRenderbuffersEXT (GLsizei, const GLuint *);
|
||||
GLAPI void APIENTRY glGenRenderbuffersEXT (GLsizei, GLuint *);
|
||||
GLAPI void APIENTRY glRenderbufferStorageEXT (GLenum, GLenum, GLsizei, GLsizei);
|
||||
GLAPI void APIENTRY glGetRenderbufferParameterivEXT (GLenum, GLenum, GLint *);
|
||||
GLAPI GLboolean APIENTRY glIsFramebufferEXT (GLuint);
|
||||
GLAPI void APIENTRY glBindFramebufferEXT (GLenum, GLuint);
|
||||
GLAPI void APIENTRY glDeleteFramebuffersEXT (GLsizei, const GLuint *);
|
||||
GLAPI void APIENTRY glGenFramebuffersEXT (GLsizei, GLuint *);
|
||||
GLAPI GLenum APIENTRY glCheckFramebufferStatusEXT (GLenum);
|
||||
GLAPI void APIENTRY glFramebufferTexture1DEXT (GLenum, GLenum, GLenum, GLuint, GLint);
|
||||
GLAPI void APIENTRY glFramebufferTexture2DEXT (GLenum, GLenum, GLenum, GLuint, GLint);
|
||||
GLAPI void APIENTRY glFramebufferTexture3DEXT (GLenum, GLenum, GLenum, GLuint, GLint, GLint);
|
||||
GLAPI void APIENTRY glFramebufferRenderbufferEXT (GLenum, GLenum, GLenum, GLuint);
|
||||
GLAPI void APIENTRY glGetFramebufferAttachmentParameterivEXT (GLenum, GLenum, GLenum, GLint *);
|
||||
GLAPI void APIENTRY glGenerateMipmapEXT (GLenum);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer);
|
||||
typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer);
|
||||
typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers);
|
||||
typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers);
|
||||
typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
|
||||
typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer);
|
||||
typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer);
|
||||
typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers);
|
||||
typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers);
|
||||
typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target);
|
||||
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
||||
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
||||
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
|
||||
typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
|
||||
typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
|
||||
typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target);
|
||||
#endif
|
||||
|
||||
#ifndef GL_GREMEDY_string_marker
|
||||
#define GL_GREMEDY_string_marker 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei, const GLvoid *);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid *string);
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@@ -62,7 +62,10 @@ extern const char *
|
||||
glFBDevGetString( int str );
|
||||
|
||||
|
||||
extern const void *
|
||||
typedef void (*GLFBDevProc)();
|
||||
|
||||
|
||||
extern const GLFBDevProc
|
||||
glFBDevGetProcAddress( const char *procName );
|
||||
|
||||
|
||||
|
@@ -196,7 +196,7 @@ GLAPI EGLDisplay APIENTRY eglGetDisplay (NativeDisplayType display);
|
||||
GLAPI EGLBoolean APIENTRY eglInitialize (EGLDisplay dpy, EGLint *major, EGLint *minor);
|
||||
GLAPI EGLBoolean APIENTRY eglTerminate (EGLDisplay dpy);
|
||||
GLAPI const char * APIENTRY eglQueryString (EGLDisplay dpy, EGLint name);
|
||||
GLAPI void (* APIENTRY eglGetProcAddress (const char *procname))();
|
||||
GLAPI void (* APIENTRY eglGetProcAddress (const char *procname))(void);
|
||||
|
||||
GLAPI EGLBoolean APIENTRY eglGetConfigs (EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config);
|
||||
GLAPI EGLBoolean APIENTRY eglChooseConfig (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config);
|
||||
@@ -249,19 +249,22 @@ GLAPI EGLBoolean APIENTRY eglGetModesMESA(EGLDisplay dpy, EGLScreenMESA screen,
|
||||
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);
|
||||
GLAPI EGLBoolean APIENTRY eglShowSurfaceMESA(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);
|
||||
GLAPI EGLBoolean APIENTRY eglQueryScreenModeMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *mode);
|
||||
GLAPI const char * APIENTRY eglQueryModeStringMESA(EGLDisplay dpy, EGLModeMESA mode);
|
||||
|
||||
#endif /* EGL_MESA_screen_surface */
|
||||
|
||||
|
||||
#ifndef EGL_MESA_copy_context
|
||||
#define EGL_MESA_copy_context 1
|
||||
|
||||
GLAPI EGLBoolean APIENTRY eglCopyContextMESA(EGLDisplay dpy, EGLContext source, EGLContext dest, EGLint mask);
|
||||
|
||||
|
||||
|
||||
#endif /* EGL_MESA_copy_context */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@@ -36,7 +36,6 @@ PROGS = \
|
||||
morph3d \
|
||||
multiarb \
|
||||
occlude \
|
||||
osdemo \
|
||||
paltex \
|
||||
pixeltex \
|
||||
pointblast \
|
||||
@@ -110,21 +109,7 @@ shadowtex: shadowtex.o showbuffer.o
|
||||
shadowtex.o: shadowtex.c showbuffer.h
|
||||
$(CC) -c -I$(INCDIR) $(CFLAGS) shadowtex.c
|
||||
|
||||
# special case: need the -lOSMesa library:
|
||||
osdemo: osdemo.c
|
||||
$(CC) -I$(INCDIR) $(CFLAGS) osdemo.c $(OSMESA_LIBS) -o $@
|
||||
|
||||
# another special case: need the -lOSMesa16 library:
|
||||
osdemo16: osdemo16.c
|
||||
$(CC) -I$(INCDIR) $(CFLAGS) osdemo16.c $(OSMESA16_LIBS) -o $@
|
||||
|
||||
# another special case: need the -lOSMesa32 library:
|
||||
osdemo32: osdemo32.c
|
||||
$(CC) -I$(INCDIR) $(CFLAGS) osdemo32.c $(OSMESA32_LIBS) -o $@
|
||||
|
||||
|
||||
|
||||
clean:
|
||||
-rm -f $(PROGS)
|
||||
-rm -f *.o *~
|
||||
-rm -f readtex.[ch]
|
||||
-rm -f readtex.[ch] showbuffer.[ch]
|
||||
|
@@ -1,6 +1,6 @@
|
||||
# Makefile for GLUT-based demo programs for VMS
|
||||
# contributed by Jouk Jansen joukj@crys.chem.uva.nl
|
||||
|
||||
# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl
|
||||
# Last update : 20 May 2005
|
||||
|
||||
.first
|
||||
define gl [--.include.gl]
|
||||
@@ -22,7 +22,7 @@ LIB_DEP = [--.lib]$(GL_LIB) [--.lib]$(GLU_LIB) [--.lib]$(GLUT_LIB)
|
||||
|
||||
|
||||
PROGS = bounce.exe;,clearspd.exe;,drawpix.exe;,gamma.exe;,gears.exe;,\
|
||||
glinfo.exe;,glutfx.exe;,isosurf.exe;,morph3d.exe;,osdemo.exe;,\
|
||||
glinfo.exe;,glutfx.exe;,isosurf.exe;,morph3d.exe;,\
|
||||
paltex.exe;,pointblast.exe;,reflect.exe;,spectex.exe;,stex3d.exe;,\
|
||||
tessdemo.exe;,texcyl.exe;,texobj.exe;,trispd.exe;,winpos.exe;
|
||||
|
||||
@@ -53,7 +53,6 @@ glutfx.exe; : glutfx.obj $(LIB_DEP)
|
||||
isosurf.exe; : isosurf.obj $(LIB_DEP) [-.util]readtex.obj
|
||||
cxxlink $(MMS$TARGET_NAME),[-.util]readtex.obj,$(GL_LIBS)
|
||||
morph3d.exe; : morph3d.obj $(LIB_DEP)
|
||||
osdemo.exe; : osdemo.obj $(LIB_DEP)
|
||||
paltex.exe; : paltex.obj $(LIB_DEP)
|
||||
pointblast.exe; : pointblast.obj $(LIB_DEP)
|
||||
reflect.exe; : reflect.obj [-.util]readtex.obj [-.util]showbuffer.obj\
|
||||
@@ -79,7 +78,6 @@ glinfo.obj : glinfo.c
|
||||
glutfx.obj : glutfx.c
|
||||
isosurf.obj : isosurf.c
|
||||
morph3d.obj : morph3d.c
|
||||
osdemo.obj : osdemo.c
|
||||
paltex.obj : paltex.c
|
||||
pointblast.obj : pointblast.c
|
||||
reflect.obj : reflect.c
|
||||
|
@@ -39,6 +39,10 @@ static GLenum ReadType = GL_UNSIGNED_BYTE;
|
||||
#endif
|
||||
#if 0
|
||||
static GLenum ReadFormat = GL_RGB;
|
||||
static GLenum ReadType = GL_UNSIGNED_BYTE;
|
||||
#endif
|
||||
#if 0
|
||||
static GLenum ReadFormat = GL_RGB;
|
||||
static GLenum ReadType = GL_UNSIGNED_SHORT_5_6_5;
|
||||
#endif
|
||||
#if 0
|
||||
@@ -96,6 +100,45 @@ SetupPixelTransfer(GLboolean invert)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Exercise Pixel Pack parameters by reading the image in four pieces.
|
||||
*/
|
||||
static void
|
||||
ComplexReadPixels(GLint x, GLint y, GLsizei width, GLsizei height,
|
||||
GLenum format, GLenum type, GLvoid *pixels)
|
||||
{
|
||||
const GLsizei width0 = width / 2;
|
||||
const GLsizei width1 = width - width0;
|
||||
const GLsizei height0 = height / 2;
|
||||
const GLsizei height1 = height - height0;
|
||||
|
||||
glPixelStorei(GL_PACK_ROW_LENGTH, width);
|
||||
|
||||
/* lower-left quadrant */
|
||||
glReadPixels(x, y, width0, height0, format, type, pixels);
|
||||
|
||||
/* lower-right quadrant */
|
||||
glPixelStorei(GL_PACK_SKIP_PIXELS, width0);
|
||||
glReadPixels(x + width0, y, width1, height0, format, type, pixels);
|
||||
|
||||
/* upper-left quadrant */
|
||||
glPixelStorei(GL_PACK_SKIP_PIXELS, 0);
|
||||
glPixelStorei(GL_PACK_SKIP_ROWS, height0);
|
||||
glReadPixels(x, y + height0, width0, height1, format, type, pixels);
|
||||
|
||||
/* upper-right quadrant */
|
||||
glPixelStorei(GL_PACK_SKIP_PIXELS, width0);
|
||||
glPixelStorei(GL_PACK_SKIP_ROWS, height0);
|
||||
glReadPixels(x + width0, y + height0, width1, height1, format, type, pixels);
|
||||
|
||||
/* restore defaults */
|
||||
glPixelStorei(GL_PACK_SKIP_PIXELS, 0);
|
||||
glPixelStorei(GL_PACK_SKIP_ROWS, 0);
|
||||
glPixelStorei(GL_PACK_ROW_LENGTH, ImgWidth);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
Display( void )
|
||||
{
|
||||
@@ -111,8 +154,13 @@ Display( void )
|
||||
glRasterPos2i(APosX, APosY);
|
||||
glEnable(GL_DITHER);
|
||||
SetupPixelTransfer(GL_FALSE);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
glDrawPixels(ImgWidth, ImgHeight, ImgFormat, GL_UNSIGNED_BYTE, Image);
|
||||
|
||||
/* might try alignment=4 here for testing */
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
glPixelStorei(GL_PACK_ALIGNMENT, 1);
|
||||
|
||||
/* do readpixels, drawpixels */
|
||||
glRasterPos2i(BPosX, 5);
|
||||
PrintString("Read/DrawPixels");
|
||||
@@ -138,8 +186,14 @@ 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 */
|
||||
glReadPixels(APosX, APosY, ImgWidth, ImgHeight,
|
||||
ReadFormat, ReadType, TempImage);
|
||||
#else
|
||||
ComplexReadPixels(APosX, APosY, ImgWidth, ImgHeight,
|
||||
ReadFormat, ReadType, TempImage);
|
||||
#endif
|
||||
}
|
||||
glRasterPos2i(BPosX, BPosY);
|
||||
glDisable(GL_DITHER);
|
||||
@@ -253,14 +307,14 @@ Init( GLboolean ciMode )
|
||||
|
||||
printf("Loaded %d by %d image\n", ImgWidth, ImgHeight );
|
||||
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, ImgWidth);
|
||||
glPixelStorei(GL_PACK_ALIGNMENT, 1);
|
||||
glPixelStorei(GL_PACK_ROW_LENGTH, ImgWidth);
|
||||
|
||||
Reset();
|
||||
|
||||
TempImage = (GLubyte *) malloc(ImgWidth * ImgHeight * 4 * sizeof(GLubyte));
|
||||
/* allocate an extra 1KB in case we're tinkering with pack alignment */
|
||||
TempImage = (GLubyte *) malloc(ImgWidth * ImgHeight * 4 * sizeof(GLubyte)
|
||||
+ 1000);
|
||||
assert(TempImage);
|
||||
}
|
||||
|
||||
|
@@ -389,7 +389,7 @@ static void SpecialKey( int key, int x, int y )
|
||||
int main( int argc, char *argv[] )
|
||||
{
|
||||
glutInit(&argc, argv);
|
||||
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH | GLUT_STENCIL);
|
||||
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH | GLUT_STENCIL | GLUT_ALPHA);
|
||||
glutInitWindowPosition( 0, 0 );
|
||||
glutInitWindowSize( Width, Height );
|
||||
glutCreateWindow(argv[0]);
|
||||
|
@@ -33,6 +33,7 @@ static GLint Mode = 4;
|
||||
static GLfloat Black[4] = {0.0, 0.0, 0.0, 1.0};
|
||||
static GLfloat White[4] = {1.0, 1.0, 1.0, 1.0};
|
||||
|
||||
static GLboolean smooth = 1;
|
||||
|
||||
static void
|
||||
Idle(void)
|
||||
@@ -143,9 +144,16 @@ static void Key( unsigned char key, int x, int y )
|
||||
(void) x;
|
||||
(void) y;
|
||||
switch (key) {
|
||||
case 27:
|
||||
exit(0);
|
||||
break;
|
||||
case 27:
|
||||
exit(0);
|
||||
break;
|
||||
case 's':
|
||||
smooth = !smooth;
|
||||
if (smooth)
|
||||
glShadeModel(GL_SMOOTH);
|
||||
else
|
||||
glShadeModel(GL_FLAT);
|
||||
break;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
@@ -175,6 +183,8 @@ static void Init( void )
|
||||
glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, 0);
|
||||
glLightModelfv(GL_LIGHT_MODEL_AMBIENT, Black);
|
||||
|
||||
glShadeModel(GL_SMOOTH);
|
||||
|
||||
glMaterialfv(GL_FRONT, GL_DIFFUSE, White);
|
||||
glMaterialfv(GL_FRONT, GL_SPECULAR, White);
|
||||
glMaterialf(GL_FRONT, GL_SHININESS, 20.0);
|
||||
|
@@ -10,6 +10,8 @@ HEADERS = $(TOP)/include/GLES/egl.h
|
||||
|
||||
PROGRAMS = \
|
||||
demo1 \
|
||||
demo2 \
|
||||
demo3 \
|
||||
eglinfo
|
||||
|
||||
|
||||
@@ -28,6 +30,20 @@ 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 $@
|
||||
|
||||
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 $@
|
||||
|
||||
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 $@
|
||||
|
||||
|
@@ -6,6 +6,7 @@
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
/**
|
||||
@@ -26,6 +27,62 @@ TestScreens(EGLDisplay dpy)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Print table of all available configurations.
|
||||
*/
|
||||
static void
|
||||
PrintConfigs(EGLDisplay d)
|
||||
{
|
||||
EGLConfig *configs;
|
||||
EGLint numConfigs, i;
|
||||
|
||||
eglGetConfigs(d, NULL, 0, &numConfigs);
|
||||
configs = malloc(sizeof(*configs) *numConfigs);
|
||||
eglGetConfigs(d, configs, numConfigs, &numConfigs);
|
||||
|
||||
printf("Configurations:\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");
|
||||
for (i = 0; i < numConfigs; i++) {
|
||||
EGLint id, size, level;
|
||||
EGLint red, green, blue, alpha;
|
||||
EGLint depth, stencil;
|
||||
EGLint surfaces;
|
||||
EGLint doubleBuf = 1, stereo = 0;
|
||||
char surfString[100] = "";
|
||||
|
||||
eglGetConfigAttrib(d, configs[i], EGL_CONFIG_ID, &id);
|
||||
eglGetConfigAttrib(d, configs[i], EGL_BUFFER_SIZE, &size);
|
||||
eglGetConfigAttrib(d, configs[i], EGL_LEVEL, &level);
|
||||
|
||||
eglGetConfigAttrib(d, configs[i], EGL_RED_SIZE, &red);
|
||||
eglGetConfigAttrib(d, configs[i], EGL_GREEN_SIZE, &green);
|
||||
eglGetConfigAttrib(d, configs[i], EGL_BLUE_SIZE, &blue);
|
||||
eglGetConfigAttrib(d, configs[i], EGL_ALPHA_SIZE, &alpha);
|
||||
eglGetConfigAttrib(d, configs[i], EGL_DEPTH_SIZE, &depth);
|
||||
eglGetConfigAttrib(d, configs[i], EGL_STENCIL_SIZE, &stencil);
|
||||
eglGetConfigAttrib(d, configs[i], EGL_SURFACE_TYPE, &surfaces);
|
||||
|
||||
if (surfaces & EGL_WINDOW_BIT)
|
||||
strcat(surfString, "win,");
|
||||
if (surfaces & EGL_PBUFFER_BIT)
|
||||
strcat(surfString, "pb,");
|
||||
if (surfaces & EGL_PIXMAP_BIT)
|
||||
strcat(surfString, "pix,");
|
||||
if (strlen(surfString) > 0)
|
||||
surfString[strlen(surfString) - 1] = 0;
|
||||
|
||||
printf("0x%02x %2d %2d %c %c %2d %2d %2d %2d %2d %2d %-12s\n",
|
||||
id, size, level,
|
||||
doubleBuf ? 'y' : '.',
|
||||
stereo ? 'y' : '.',
|
||||
red, green, blue, alpha,
|
||||
depth, stencil, surfString);
|
||||
}
|
||||
free(configs);
|
||||
}
|
||||
|
||||
|
||||
|
||||
int
|
||||
@@ -46,7 +103,7 @@ main(int argc, char *argv[])
|
||||
/*
|
||||
EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY);
|
||||
*/
|
||||
EGLDisplay d = eglGetDisplay("!demo");
|
||||
EGLDisplay d = eglGetDisplay("!fb_dri");
|
||||
assert(d);
|
||||
|
||||
if (!eglInitialize(d, &maj, &min)) {
|
||||
@@ -57,15 +114,7 @@ main(int argc, char *argv[])
|
||||
printf("EGL version = %d.%d\n", maj, min);
|
||||
printf("EGL_VENDOR = %s\n", eglQueryString(d, EGL_VENDOR));
|
||||
|
||||
eglGetConfigs(d, configs, 10, &numConfigs);
|
||||
printf("Got %d EGL configs:\n", numConfigs);
|
||||
for (i = 0; i < numConfigs; i++) {
|
||||
EGLint id, red, depth;
|
||||
eglGetConfigAttrib(d, configs[i], EGL_CONFIG_ID, &id);
|
||||
eglGetConfigAttrib(d, configs[i], EGL_RED_SIZE, &red);
|
||||
eglGetConfigAttrib(d, configs[i], EGL_DEPTH_SIZE, &depth);
|
||||
printf("%2d: Red Size = %d Depth Size = %d\n", id, red, depth);
|
||||
}
|
||||
PrintConfigs(d);
|
||||
|
||||
ctx = eglCreateContext(d, configs[0], EGL_NO_CONTEXT, NULL);
|
||||
if (ctx == EGL_NO_CONTEXT) {
|
||||
|
190
progs/egl/demo2.c
Normal file
190
progs/egl/demo2.c
Normal file
@@ -0,0 +1,190 @@
|
||||
/*
|
||||
* Exercise EGL API functions
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <GLES/egl.h>
|
||||
|
||||
/*#define FRONTBUFFER*/
|
||||
|
||||
static void _subset_Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
|
||||
{
|
||||
glBegin( GL_QUADS );
|
||||
glVertex2f( x1, y1 );
|
||||
glVertex2f( x2, y1 );
|
||||
glVertex2f( x2, y2 );
|
||||
glVertex2f( x1, y2 );
|
||||
glEnd();
|
||||
}
|
||||
|
||||
|
||||
static void redraw(EGLDisplay dpy, EGLSurface surf, int rot)
|
||||
{
|
||||
printf("Redraw event\n");
|
||||
|
||||
#ifdef FRONTBUFFER
|
||||
glDrawBuffer( GL_FRONT );
|
||||
#else
|
||||
glDrawBuffer( GL_BACK );
|
||||
#endif
|
||||
|
||||
glClearColor( rand()/(float)RAND_MAX,
|
||||
rand()/(float)RAND_MAX,
|
||||
rand()/(float)RAND_MAX,
|
||||
1);
|
||||
|
||||
glClear( GL_COLOR_BUFFER_BIT );
|
||||
|
||||
glColor3f( rand()/(float)RAND_MAX,
|
||||
rand()/(float)RAND_MAX,
|
||||
rand()/(float)RAND_MAX );
|
||||
glPushMatrix();
|
||||
glRotatef(rot, 0, 0, 1);
|
||||
glScalef(.5, .5, .5);
|
||||
_subset_Rectf( -1, -1, 1, 1 );
|
||||
glPopMatrix();
|
||||
|
||||
#ifdef FRONTBUFFER
|
||||
glFlush();
|
||||
#else
|
||||
eglSwapBuffers( dpy, surf );
|
||||
#endif
|
||||
glFinish();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Test EGL_MESA_screen_surface functions
|
||||
*/
|
||||
static void
|
||||
TestScreens(EGLDisplay dpy)
|
||||
{
|
||||
#define MAX 8
|
||||
EGLScreenMESA screens[MAX];
|
||||
EGLint numScreens;
|
||||
EGLint i;
|
||||
|
||||
eglGetScreensMESA(dpy, screens, MAX, &numScreens);
|
||||
printf("Found %d screens\n", numScreens);
|
||||
for (i = 0; i < numScreens; i++) {
|
||||
printf(" Screen %d handle: %d\n", i, (int) screens[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
int maj, min;
|
||||
EGLContext ctx;
|
||||
EGLSurface pbuffer, screen_surf;
|
||||
EGLConfig configs[10];
|
||||
EGLint numConfigs, i;
|
||||
EGLBoolean b;
|
||||
const EGLint pbufAttribs[] = {
|
||||
EGL_WIDTH, 500,
|
||||
EGL_HEIGHT, 500,
|
||||
EGL_NONE
|
||||
};
|
||||
const EGLint screenAttribs[] = {
|
||||
EGL_WIDTH, 1024,
|
||||
EGL_HEIGHT, 768,
|
||||
EGL_NONE
|
||||
};
|
||||
EGLModeMESA mode;
|
||||
EGLScreenMESA screen;
|
||||
EGLint count;
|
||||
|
||||
/*
|
||||
EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY);
|
||||
*/
|
||||
EGLDisplay d = eglGetDisplay("!fb_dri");
|
||||
assert(d);
|
||||
|
||||
if (!eglInitialize(d, &maj, &min)) {
|
||||
printf("demo: eglInitialize failed\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
printf("EGL version = %d.%d\n", maj, min);
|
||||
printf("EGL_VENDOR = %s\n", eglQueryString(d, EGL_VENDOR));
|
||||
|
||||
eglGetConfigs(d, configs, 10, &numConfigs);
|
||||
printf("Got %d EGL configs:\n", numConfigs);
|
||||
for (i = 0; i < numConfigs; i++) {
|
||||
EGLint id, red, depth;
|
||||
eglGetConfigAttrib(d, configs[i], EGL_CONFIG_ID, &id);
|
||||
eglGetConfigAttrib(d, configs[i], EGL_RED_SIZE, &red);
|
||||
eglGetConfigAttrib(d, configs[i], EGL_DEPTH_SIZE, &depth);
|
||||
printf("%2d: Red Size = %d Depth Size = %d\n", id, red, depth);
|
||||
}
|
||||
|
||||
eglGetScreensMESA(d, &screen, 1, &count);
|
||||
eglGetModesMESA(d, screen, &mode, 1, &count);
|
||||
|
||||
ctx = eglCreateContext(d, configs[0], EGL_NO_CONTEXT, NULL);
|
||||
if (ctx == EGL_NO_CONTEXT) {
|
||||
printf("failed to create context\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
pbuffer = eglCreatePbufferSurface(d, configs[0], pbufAttribs);
|
||||
if (pbuffer == EGL_NO_SURFACE) {
|
||||
printf("failed to create pbuffer\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
b = eglMakeCurrent(d, pbuffer, pbuffer, ctx);
|
||||
if (!b) {
|
||||
printf("make current failed\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
b = eglMakeCurrent(d, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
|
||||
|
||||
screen_surf = eglCreateScreenSurfaceMESA(d, configs[0], screenAttribs);
|
||||
if (screen_surf == EGL_NO_SURFACE) {
|
||||
printf("failed to create screen surface\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
eglShowSurfaceMESA(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);
|
||||
glDrawBuffer( GL_FRONT );
|
||||
|
||||
glClearColor( 0,
|
||||
1.0,
|
||||
0,
|
||||
1);
|
||||
|
||||
glClear( GL_COLOR_BUFFER_BIT );
|
||||
|
||||
|
||||
TestScreens(d);
|
||||
|
||||
glShadeModel( GL_FLAT );
|
||||
|
||||
for (i = 0; i < 6; i++) {
|
||||
redraw(d, screen_surf, i*10 );
|
||||
|
||||
printf("sleep(1)\n");
|
||||
sleep(1);
|
||||
}
|
||||
|
||||
eglDestroySurface(d, pbuffer);
|
||||
eglDestroyContext(d, ctx);
|
||||
eglTerminate(d);
|
||||
|
||||
return 0;
|
||||
}
|
635
progs/egl/demo3.c
Normal file
635
progs/egl/demo3.c
Normal file
@@ -0,0 +1,635 @@
|
||||
/*
|
||||
* Exercise EGL API functions
|
||||
*/
|
||||
|
||||
#include <GLES/egl.h>
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
|
||||
#define PIXEL_CENTER(x) ((long)(x) + 0.5)
|
||||
|
||||
#define GAP 10
|
||||
#define ROWS 3
|
||||
#define COLS 4
|
||||
|
||||
#define OPENGL_WIDTH 48
|
||||
#define OPENGL_HEIGHT 13
|
||||
|
||||
|
||||
GLenum rgb, doubleBuffer, windType;
|
||||
GLint windW, windH;
|
||||
|
||||
GLenum mode1, mode2;
|
||||
GLint boxW, boxH;
|
||||
GLubyte OpenGL_bits[] = {
|
||||
0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
|
||||
0x7f, 0xfb, 0xff, 0xff, 0xff, 0x01,
|
||||
0x7f, 0xfb, 0xff, 0xff, 0xff, 0x01,
|
||||
0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
|
||||
0x3e, 0x8f, 0xb7, 0xf9, 0xfc, 0x01,
|
||||
0x63, 0xdb, 0xb0, 0x8d, 0x0d, 0x00,
|
||||
0x63, 0xdb, 0xb7, 0x8d, 0x0d, 0x00,
|
||||
0x63, 0xdb, 0xb6, 0x8d, 0x0d, 0x00,
|
||||
0x63, 0x8f, 0xf3, 0xcc, 0x0d, 0x00,
|
||||
0x63, 0x00, 0x00, 0x0c, 0x4c, 0x0a,
|
||||
0x63, 0x00, 0x00, 0x0c, 0x4c, 0x0e,
|
||||
0x63, 0x00, 0x00, 0x8c, 0xed, 0x0e,
|
||||
0x3e, 0x00, 0x00, 0xf8, 0x0c, 0x00,
|
||||
};
|
||||
|
||||
|
||||
static void Init(void)
|
||||
{
|
||||
|
||||
mode1 = GL_TRUE;
|
||||
mode2 = GL_TRUE;
|
||||
}
|
||||
|
||||
static void Reshape(int width, int height)
|
||||
{
|
||||
|
||||
windW = (GLint)width;
|
||||
windH = (GLint)height;
|
||||
}
|
||||
|
||||
static void RotateColorMask(void)
|
||||
{
|
||||
static GLint rotation = 0;
|
||||
|
||||
rotation = (rotation + 1) & 0x3;
|
||||
switch (rotation) {
|
||||
case 0:
|
||||
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
|
||||
glIndexMask( 0xff );
|
||||
break;
|
||||
case 1:
|
||||
glColorMask(GL_FALSE, GL_TRUE, GL_TRUE, GL_TRUE);
|
||||
glIndexMask(0xFE);
|
||||
break;
|
||||
case 2:
|
||||
glColorMask(GL_TRUE, GL_FALSE, GL_TRUE, GL_TRUE);
|
||||
glIndexMask(0xFD);
|
||||
break;
|
||||
case 3:
|
||||
glColorMask(GL_TRUE, GL_TRUE, GL_FALSE, GL_TRUE);
|
||||
glIndexMask(0xFB);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void Viewport(GLint row, GLint column)
|
||||
{
|
||||
GLint x, y;
|
||||
|
||||
boxW = (windW - (COLS + 1) * GAP) / COLS;
|
||||
boxH = (windH - (ROWS + 1) * GAP) / ROWS;
|
||||
|
||||
x = GAP + column * (boxW + GAP);
|
||||
y = GAP + row * (boxH + GAP);
|
||||
|
||||
glViewport(x, y, boxW, boxH);
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrtho(-boxW/2, boxW/2, -boxH/2, boxH/2, 0.0, 1.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
|
||||
glEnable(GL_SCISSOR_TEST);
|
||||
glScissor(x, y, boxW, boxH);
|
||||
}
|
||||
|
||||
enum {
|
||||
COLOR_BLACK = 0,
|
||||
COLOR_RED,
|
||||
COLOR_GREEN,
|
||||
COLOR_YELLOW,
|
||||
COLOR_BLUE,
|
||||
COLOR_MAGENTA,
|
||||
COLOR_CYAN,
|
||||
COLOR_WHITE
|
||||
};
|
||||
|
||||
static float RGBMap[9][3] = {
|
||||
{0, 0, 0},
|
||||
{1, 0, 0},
|
||||
{0, 1, 0},
|
||||
{1, 1, 0},
|
||||
{0, 0, 1},
|
||||
{1, 0, 1},
|
||||
{0, 1, 1},
|
||||
{1, 1, 1},
|
||||
{0.5, 0.5, 0.5}
|
||||
};
|
||||
|
||||
static void SetColor(int c)
|
||||
{
|
||||
glColor3fv(RGBMap[c]);
|
||||
}
|
||||
|
||||
static void Point(void)
|
||||
{
|
||||
GLint i;
|
||||
|
||||
glBegin(GL_POINTS);
|
||||
SetColor(COLOR_WHITE);
|
||||
glVertex2i(0, 0);
|
||||
for (i = 1; i < 8; i++) {
|
||||
GLint j = i * 2;
|
||||
SetColor(COLOR_BLACK+i);
|
||||
glVertex2i(-j, -j);
|
||||
glVertex2i(-j, 0);
|
||||
glVertex2i(-j, j);
|
||||
glVertex2i(0, j);
|
||||
glVertex2i(j, j);
|
||||
glVertex2i(j, 0);
|
||||
glVertex2i(j, -j);
|
||||
glVertex2i(0, -j);
|
||||
}
|
||||
glEnd();
|
||||
}
|
||||
|
||||
static void Lines(void)
|
||||
{
|
||||
GLint i;
|
||||
|
||||
glPushMatrix();
|
||||
|
||||
glTranslatef(-12, 0, 0);
|
||||
for (i = 1; i < 8; i++) {
|
||||
SetColor(COLOR_BLACK+i);
|
||||
glBegin(GL_LINES);
|
||||
glVertex2i(-boxW/4, -boxH/4);
|
||||
glVertex2i(boxW/4, boxH/4);
|
||||
glEnd();
|
||||
glTranslatef(4, 0, 0);
|
||||
}
|
||||
|
||||
glPopMatrix();
|
||||
|
||||
glBegin(GL_LINES);
|
||||
glVertex2i(0, 0);
|
||||
glEnd();
|
||||
}
|
||||
|
||||
static void LineStrip(void)
|
||||
{
|
||||
|
||||
glBegin(GL_LINE_STRIP);
|
||||
SetColor(COLOR_RED);
|
||||
glVertex2f(PIXEL_CENTER(-boxW/4), PIXEL_CENTER(-boxH/4));
|
||||
SetColor(COLOR_GREEN);
|
||||
glVertex2f(PIXEL_CENTER(-boxW/4), PIXEL_CENTER(boxH/4));
|
||||
SetColor(COLOR_BLUE);
|
||||
glVertex2f(PIXEL_CENTER(boxW/4), PIXEL_CENTER(boxH/4));
|
||||
SetColor(COLOR_WHITE);
|
||||
glVertex2f(PIXEL_CENTER(boxW/4), PIXEL_CENTER(-boxH/4));
|
||||
glEnd();
|
||||
|
||||
glBegin(GL_LINE_STRIP);
|
||||
glVertex2i(0, 0);
|
||||
glEnd();
|
||||
}
|
||||
|
||||
static void LineLoop(void)
|
||||
{
|
||||
|
||||
glBegin(GL_LINE_LOOP);
|
||||
SetColor(COLOR_RED);
|
||||
glVertex2f(PIXEL_CENTER(-boxW/4), PIXEL_CENTER(-boxH/4));
|
||||
SetColor(COLOR_GREEN);
|
||||
glVertex2f(PIXEL_CENTER(-boxW/4), PIXEL_CENTER(boxH/4));
|
||||
SetColor(COLOR_BLUE);
|
||||
glVertex2f(PIXEL_CENTER(boxW/4), PIXEL_CENTER(boxH/4));
|
||||
SetColor(COLOR_WHITE);
|
||||
glVertex2f(PIXEL_CENTER(boxW/4), PIXEL_CENTER(-boxH/4));
|
||||
glEnd();
|
||||
|
||||
glEnable(GL_LOGIC_OP);
|
||||
glLogicOp(GL_XOR);
|
||||
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_ONE, GL_ONE);
|
||||
|
||||
SetColor(COLOR_MAGENTA);
|
||||
glBegin(GL_LINE_LOOP);
|
||||
glVertex2f(PIXEL_CENTER(-boxW/8), PIXEL_CENTER(-boxH/8));
|
||||
glVertex2f(PIXEL_CENTER(-boxW/8), PIXEL_CENTER(boxH/8));
|
||||
glEnd();
|
||||
glBegin(GL_LINE_LOOP);
|
||||
glVertex2f(PIXEL_CENTER(-boxW/8), PIXEL_CENTER(boxH/8+5));
|
||||
glVertex2f(PIXEL_CENTER(boxW/8), PIXEL_CENTER(boxH/8+5));
|
||||
glEnd();
|
||||
glDisable(GL_LOGIC_OP);
|
||||
glDisable(GL_BLEND);
|
||||
|
||||
SetColor(COLOR_GREEN);
|
||||
glBegin(GL_POINTS);
|
||||
glVertex2i(0, 0);
|
||||
glEnd();
|
||||
|
||||
glBegin(GL_LINE_LOOP);
|
||||
glVertex2i(0, 0);
|
||||
glEnd();
|
||||
}
|
||||
|
||||
static void Bitmap(void)
|
||||
{
|
||||
|
||||
glBegin(GL_LINES);
|
||||
SetColor(COLOR_GREEN);
|
||||
glVertex2i(-boxW/2, 0);
|
||||
glVertex2i(boxW/2, 0);
|
||||
glVertex2i(0, -boxH/2);
|
||||
glVertex2i(0, boxH/2);
|
||||
SetColor(COLOR_RED);
|
||||
glVertex2i(0, -3);
|
||||
glVertex2i(0, -3+OPENGL_HEIGHT);
|
||||
SetColor(COLOR_BLUE);
|
||||
glVertex2i(0, -3);
|
||||
glVertex2i(OPENGL_WIDTH, -3);
|
||||
glEnd();
|
||||
|
||||
SetColor(COLOR_GREEN);
|
||||
|
||||
glPixelStorei(GL_UNPACK_LSB_FIRST, GL_TRUE);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
|
||||
glRasterPos2i(0, 0);
|
||||
glBitmap(OPENGL_WIDTH, OPENGL_HEIGHT, 0, 3, 0.0, 0.0, OpenGL_bits);
|
||||
}
|
||||
|
||||
static void Triangles(void)
|
||||
{
|
||||
|
||||
glBegin(GL_TRIANGLES);
|
||||
SetColor(COLOR_GREEN);
|
||||
glVertex2i(-boxW/4, -boxH/4);
|
||||
SetColor(COLOR_RED);
|
||||
glVertex2i(-boxW/8, -boxH/16);
|
||||
SetColor(COLOR_BLUE);
|
||||
glVertex2i(boxW/8, -boxH/16);
|
||||
|
||||
SetColor(COLOR_GREEN);
|
||||
glVertex2i(-boxW/4, boxH/4);
|
||||
SetColor(COLOR_RED);
|
||||
glVertex2i(-boxW/8, boxH/16);
|
||||
SetColor(COLOR_BLUE);
|
||||
glVertex2i(boxW/8, boxH/16);
|
||||
glEnd();
|
||||
|
||||
glBegin(GL_TRIANGLES);
|
||||
glVertex2i(0, 0);
|
||||
glVertex2i(-100, 100);
|
||||
glEnd();
|
||||
}
|
||||
|
||||
static void TriangleStrip(void)
|
||||
{
|
||||
|
||||
glBegin(GL_TRIANGLE_STRIP);
|
||||
SetColor(COLOR_GREEN);
|
||||
glVertex2i(-boxW/4, -boxH/4);
|
||||
SetColor(COLOR_RED);
|
||||
glVertex2i(-boxW/4, boxH/4);
|
||||
SetColor(COLOR_BLUE);
|
||||
glVertex2i(0, -boxH/4);
|
||||
SetColor(COLOR_WHITE);
|
||||
glVertex2i(0, boxH/4);
|
||||
SetColor(COLOR_CYAN);
|
||||
glVertex2i(boxW/4, -boxH/4);
|
||||
SetColor(COLOR_YELLOW);
|
||||
glVertex2i(boxW/4, boxH/4);
|
||||
glEnd();
|
||||
|
||||
glBegin(GL_TRIANGLE_STRIP);
|
||||
glVertex2i(0, 0);
|
||||
glVertex2i(-100, 100);
|
||||
glEnd();
|
||||
}
|
||||
|
||||
static void TriangleFan(void)
|
||||
{
|
||||
GLint vx[8][2];
|
||||
GLint x0, y0, x1, y1, x2, y2, x3, y3;
|
||||
GLint i;
|
||||
|
||||
y0 = -boxH/4;
|
||||
y1 = y0 + boxH/2/3;
|
||||
y2 = y1 + boxH/2/3;
|
||||
y3 = boxH/4;
|
||||
x0 = -boxW/4;
|
||||
x1 = x0 + boxW/2/3;
|
||||
x2 = x1 + boxW/2/3;
|
||||
x3 = boxW/4;
|
||||
|
||||
vx[0][0] = x0; vx[0][1] = y1;
|
||||
vx[1][0] = x0; vx[1][1] = y2;
|
||||
vx[2][0] = x1; vx[2][1] = y3;
|
||||
vx[3][0] = x2; vx[3][1] = y3;
|
||||
vx[4][0] = x3; vx[4][1] = y2;
|
||||
vx[5][0] = x3; vx[5][1] = y1;
|
||||
vx[6][0] = x2; vx[6][1] = y0;
|
||||
vx[7][0] = x1; vx[7][1] = y0;
|
||||
|
||||
glBegin(GL_TRIANGLE_FAN);
|
||||
SetColor(COLOR_WHITE);
|
||||
glVertex2i(0, 0);
|
||||
for (i = 0; i < 8; i++) {
|
||||
SetColor(COLOR_WHITE-i);
|
||||
glVertex2iv(vx[i]);
|
||||
}
|
||||
glEnd();
|
||||
|
||||
glBegin(GL_TRIANGLE_FAN);
|
||||
glVertex2i(0, 0);
|
||||
glVertex2i(-100, 100);
|
||||
glEnd();
|
||||
}
|
||||
|
||||
static void Rect(void)
|
||||
{
|
||||
|
||||
SetColor(COLOR_GREEN);
|
||||
glRecti(-boxW/4, -boxH/4, boxW/4, boxH/4);
|
||||
}
|
||||
|
||||
static void PolygonFunc(void)
|
||||
{
|
||||
GLint vx[8][2];
|
||||
GLint x0, y0, x1, y1, x2, y2, x3, y3;
|
||||
GLint i;
|
||||
|
||||
y0 = -boxH/4;
|
||||
y1 = y0 + boxH/2/3;
|
||||
y2 = y1 + boxH/2/3;
|
||||
y3 = boxH/4;
|
||||
x0 = -boxW/4;
|
||||
x1 = x0 + boxW/2/3;
|
||||
x2 = x1 + boxW/2/3;
|
||||
x3 = boxW/4;
|
||||
|
||||
vx[0][0] = x0; vx[0][1] = y1;
|
||||
vx[1][0] = x0; vx[1][1] = y2;
|
||||
vx[2][0] = x1; vx[2][1] = y3;
|
||||
vx[3][0] = x2; vx[3][1] = y3;
|
||||
vx[4][0] = x3; vx[4][1] = y2;
|
||||
vx[5][0] = x3; vx[5][1] = y1;
|
||||
vx[6][0] = x2; vx[6][1] = y0;
|
||||
vx[7][0] = x1; vx[7][1] = y0;
|
||||
|
||||
glBegin(GL_POLYGON);
|
||||
for (i = 0; i < 8; i++) {
|
||||
SetColor(COLOR_WHITE-i);
|
||||
glVertex2iv(vx[i]);
|
||||
}
|
||||
glEnd();
|
||||
|
||||
glBegin(GL_POLYGON);
|
||||
glVertex2i(0, 0);
|
||||
glVertex2i(100, 100);
|
||||
glEnd();
|
||||
}
|
||||
|
||||
static void Quads(void)
|
||||
{
|
||||
|
||||
glBegin(GL_QUADS);
|
||||
SetColor(COLOR_GREEN);
|
||||
glVertex2i(-boxW/4, -boxH/4);
|
||||
SetColor(COLOR_RED);
|
||||
glVertex2i(-boxW/8, -boxH/16);
|
||||
SetColor(COLOR_BLUE);
|
||||
glVertex2i(boxW/8, -boxH/16);
|
||||
SetColor(COLOR_WHITE);
|
||||
glVertex2i(boxW/4, -boxH/4);
|
||||
|
||||
SetColor(COLOR_GREEN);
|
||||
glVertex2i(-boxW/4, boxH/4);
|
||||
SetColor(COLOR_RED);
|
||||
glVertex2i(-boxW/8, boxH/16);
|
||||
SetColor(COLOR_BLUE);
|
||||
glVertex2i(boxW/8, boxH/16);
|
||||
SetColor(COLOR_WHITE);
|
||||
glVertex2i(boxW/4, boxH/4);
|
||||
glEnd();
|
||||
|
||||
glBegin(GL_QUADS);
|
||||
glVertex2i(0, 0);
|
||||
glVertex2i(100, 100);
|
||||
glVertex2i(-100, 100);
|
||||
glEnd();
|
||||
}
|
||||
|
||||
static void QuadStrip(void)
|
||||
{
|
||||
|
||||
glBegin(GL_QUAD_STRIP);
|
||||
SetColor(COLOR_GREEN);
|
||||
glVertex2i(-boxW/4, -boxH/4);
|
||||
SetColor(COLOR_RED);
|
||||
glVertex2i(-boxW/4, boxH/4);
|
||||
SetColor(COLOR_BLUE);
|
||||
glVertex2i(0, -boxH/4);
|
||||
SetColor(COLOR_WHITE);
|
||||
glVertex2i(0, boxH/4);
|
||||
SetColor(COLOR_CYAN);
|
||||
glVertex2i(boxW/4, -boxH/4);
|
||||
SetColor(COLOR_YELLOW);
|
||||
glVertex2i(boxW/4, boxH/4);
|
||||
glEnd();
|
||||
|
||||
glBegin(GL_QUAD_STRIP);
|
||||
glVertex2i(0, 0);
|
||||
glVertex2i(100, 100);
|
||||
glVertex2i(-100, 100);
|
||||
glEnd();
|
||||
}
|
||||
|
||||
static void Draw(EGLDisplay dpy, EGLSurface surf)
|
||||
{
|
||||
|
||||
glViewport(0, 0, windW, windH);
|
||||
glDisable(GL_SCISSOR_TEST);
|
||||
|
||||
glPushAttrib(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
glColorMask(1, 1, 1, 1);
|
||||
glIndexMask(~0);
|
||||
|
||||
glClearColor(0.0, 0.0, 0.0, 0.0);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
glPopAttrib();
|
||||
|
||||
if (mode1) {
|
||||
glShadeModel(GL_SMOOTH);
|
||||
} else {
|
||||
glShadeModel(GL_FLAT);
|
||||
}
|
||||
|
||||
if (mode2) {
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
|
||||
} else {
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
|
||||
}
|
||||
|
||||
Viewport(0, 0); Point();
|
||||
Viewport(0, 1); Lines();
|
||||
Viewport(0, 2); LineStrip();
|
||||
Viewport(0, 3); LineLoop();
|
||||
|
||||
Viewport(1, 0); Bitmap();
|
||||
|
||||
Viewport(1, 1); TriangleFan();
|
||||
Viewport(1, 2); Triangles();
|
||||
Viewport(1, 3); TriangleStrip();
|
||||
|
||||
Viewport(2, 0); Rect();
|
||||
Viewport(2, 1); PolygonFunc();
|
||||
Viewport(2, 2); Quads();
|
||||
Viewport(2, 3); QuadStrip();
|
||||
|
||||
glFlush();
|
||||
|
||||
if (doubleBuffer) {
|
||||
eglSwapBuffers(dpy, surf);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
write_ppm(const char *filename, const GLubyte *buffer, int width, int height)
|
||||
{
|
||||
const int binary = 0;
|
||||
FILE *f = fopen( filename, "w" );
|
||||
if (f) {
|
||||
int i, x, y;
|
||||
const GLubyte *ptr = buffer;
|
||||
if (binary) {
|
||||
fprintf(f,"P6\n");
|
||||
fprintf(f,"# ppm-file created by osdemo.c\n");
|
||||
fprintf(f,"%i %i\n", width,height);
|
||||
fprintf(f,"255\n");
|
||||
fclose(f);
|
||||
f = fopen( filename, "ab" ); /* reopen in binary append mode */
|
||||
for (y=height-1; y>=0; y--) {
|
||||
for (x=0; x<width; x++) {
|
||||
i = (y*width + x) * 4;
|
||||
fputc(ptr[i], f); /* write red */
|
||||
fputc(ptr[i+1], f); /* write green */
|
||||
fputc(ptr[i+2], f); /* write blue */
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
/*ASCII*/
|
||||
int counter = 0;
|
||||
fprintf(f,"P3\n");
|
||||
fprintf(f,"# ascii ppm file created by osdemo.c\n");
|
||||
fprintf(f,"%i %i\n", width, height);
|
||||
fprintf(f,"255\n");
|
||||
for (y=height-1; y>=0; y--) {
|
||||
for (x=0; x<width; x++) {
|
||||
i = (y*width + x) * 4;
|
||||
fprintf(f, " %3d %3d %3d", ptr[i], ptr[i+1], ptr[i+2]);
|
||||
counter++;
|
||||
if (counter % 5 == 0)
|
||||
fprintf(f, "\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
fclose(f);
|
||||
}
|
||||
}
|
||||
|
||||
#include "../src/egl/main/egldisplay.h"
|
||||
|
||||
typedef struct fb_display
|
||||
{
|
||||
_EGLDisplay Base; /* base class/object */
|
||||
void *pFB;
|
||||
} fbDisplay;
|
||||
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
int maj, min;
|
||||
EGLContext ctx;
|
||||
EGLSurface screen_surf;
|
||||
EGLConfig configs[10];
|
||||
EGLScreenMESA screen;
|
||||
EGLModeMESA mode;
|
||||
EGLint numConfigs, count;
|
||||
EGLBoolean b;
|
||||
const EGLint screenAttribs[] = {
|
||||
EGL_WIDTH, 1024,
|
||||
EGL_HEIGHT, 768,
|
||||
EGL_NONE
|
||||
};
|
||||
|
||||
/*
|
||||
EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY);
|
||||
*/
|
||||
EGLDisplay d = eglGetDisplay("!fb_dri");
|
||||
assert(d);
|
||||
|
||||
if (!eglInitialize(d, &maj, &min)) {
|
||||
printf("demo: eglInitialize failed\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
printf("EGL version = %d.%d\n", maj, min);
|
||||
printf("EGL_VENDOR = %s\n", eglQueryString(d, EGL_VENDOR));
|
||||
|
||||
eglGetConfigs(d, configs, 10, &numConfigs);
|
||||
eglGetScreensMESA(d, &screen, 1, &count);
|
||||
eglGetModesMESA(d, screen, &mode, 1, &count);
|
||||
|
||||
ctx = eglCreateContext(d, configs[0], EGL_NO_CONTEXT, NULL);
|
||||
if (ctx == EGL_NO_CONTEXT) {
|
||||
printf("failed to create context\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
screen_surf = eglCreateScreenSurfaceMESA(d, configs[0], screenAttribs);
|
||||
if (screen_surf == EGL_NO_SURFACE) {
|
||||
printf("failed to create screen surface\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
eglShowSurfaceMESA(d, screen, screen_surf, mode);
|
||||
|
||||
b = eglMakeCurrent(d, screen_surf, screen_surf, ctx);
|
||||
if (!b) {
|
||||
printf("make current failed\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
Init();
|
||||
Reshape(1024, 768);
|
||||
|
||||
glDrawBuffer( GL_FRONT );
|
||||
glClearColor( 0,
|
||||
1.0,
|
||||
0,
|
||||
1);
|
||||
|
||||
glClear( GL_COLOR_BUFFER_BIT );
|
||||
|
||||
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);
|
||||
|
||||
return 0;
|
||||
}
|
@@ -33,6 +33,7 @@
|
||||
|
||||
#define MAX_CONFIGS 1000
|
||||
#define MAX_MODES 1000
|
||||
#define MAX_SCREENS 10
|
||||
|
||||
|
||||
/**
|
||||
@@ -97,12 +98,12 @@ PrintModes(EGLDisplay d)
|
||||
{
|
||||
#ifdef EGL_MESA_screen_surface
|
||||
const char *extensions = eglQueryString(d, EGL_EXTENSIONS);
|
||||
if (strstr("EGL_MESA_screen_surface", extensions)) {
|
||||
EGLScreenMESA screens[20];
|
||||
if (strstr(extensions, "EGL_MESA_screen_surface")) {
|
||||
EGLScreenMESA screens[MAX_SCREENS];
|
||||
EGLint numScreens = 1, scrn;
|
||||
EGLModeMESA modes[MAX_MODES];
|
||||
|
||||
eglGetScreensMESA(d, screens, 20, &numScreens);
|
||||
eglGetScreensMESA(d, screens, MAX_SCREENS, &numScreens);
|
||||
printf("Number of Screens: %d\n\n", numScreens);
|
||||
|
||||
for (scrn = 0; scrn < numScreens; scrn++) {
|
||||
@@ -111,15 +112,17 @@ PrintModes(EGLDisplay d)
|
||||
eglGetModesMESA(d, screens[scrn], modes, MAX_MODES, &numModes);
|
||||
|
||||
printf("Screen %d Modes:\n", scrn);
|
||||
printf(" id width height refresh\n");
|
||||
printf("-------------------------\n");
|
||||
printf(" id width height refresh name\n");
|
||||
printf("-----------------------------------------\n");
|
||||
for (i = 0; i < numModes; i++) {
|
||||
EGLint id, w, h, r;
|
||||
const char *str;
|
||||
eglGetModeAttribMESA(d, modes[i], EGL_MODE_ID_MESA, &id);
|
||||
eglGetModeAttribMESA(d, modes[i], EGL_WIDTH, &w);
|
||||
eglGetModeAttribMESA(d, modes[i], EGL_HEIGHT, &h);
|
||||
eglGetModeAttribMESA(d, modes[i], EGL_REFRESH_RATE_MESA, &r);
|
||||
printf("0x%02x %5d %5d %.3f\n", id, w, h, r / 1000.0);
|
||||
str = eglQueryModeStringMESA(d, modes[i]);
|
||||
printf("0x%02x %5d %5d %.3f %s\n", id, w, h, r / 1000.0, str);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -132,7 +135,8 @@ int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
int maj, min;
|
||||
EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY);
|
||||
/*EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY);*/
|
||||
EGLDisplay d = eglGetDisplay("!fb_dri");
|
||||
|
||||
if (!eglInitialize(d, &maj, &min)) {
|
||||
printf("eglinfo: eglInitialize failed\n");
|
||||
|
73
progs/osdemos/Makefile
Normal file
73
progs/osdemos/Makefile
Normal file
@@ -0,0 +1,73 @@
|
||||
# progs/demos/Makefile
|
||||
|
||||
TOP = ../..
|
||||
include $(TOP)/configs/current
|
||||
|
||||
INCDIR = $(TOP)/include
|
||||
|
||||
OSMESA_LIBS = -L$(LIB_DIR) -lglut -lOSMesa -lGLU -lGL $(APP_LIB_DEPS)
|
||||
|
||||
OSMESA16_LIBS = -L$(LIB_DIR) -lglut -lOSMesa16 -lGLU -lGL $(APP_LIB_DEPS)
|
||||
|
||||
OSMESA32_LIBS = -L$(LIB_DIR) -lglut -lOSMesa32 -lGLU -lGL $(APP_LIB_DEPS)
|
||||
|
||||
LIB_DEP = $(LIB_DIR)/$(GL_LIB_NAME) $(LIB_DIR)/$(GLU_LIB_NAME) $(LIB_DIR)/$(GLUT_LIB_NAME)
|
||||
|
||||
PROGS = \
|
||||
osdemo
|
||||
|
||||
|
||||
##### RULES #####
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c
|
||||
|
||||
|
||||
# make executable from .c file:
|
||||
.c: $(LIB_DEP) readtex.o
|
||||
$(CC) -I$(INCDIR) $(CFLAGS) $< readtex.o $(APP_LIB_DEPS) -o $@
|
||||
|
||||
|
||||
##### TARGETS #####
|
||||
|
||||
default: readtex.o $(PROGS)
|
||||
|
||||
|
||||
readtex.c: $(TOP)/progs/util/readtex.c
|
||||
cp $< .
|
||||
|
||||
readtex.h: $(TOP)/progs/util/readtex.h
|
||||
cp $< .
|
||||
|
||||
readtex.o: readtex.c readtex.h
|
||||
$(CC) -c -I$(INCDIR) $(CFLAGS) readtex.c
|
||||
|
||||
|
||||
showbuffer.c: $(TOP)/progs/util/showbuffer.c
|
||||
cp $< .
|
||||
|
||||
showbuffer.h: $(TOP)/progs/util/showbuffer.h
|
||||
cp $< .
|
||||
|
||||
showbuffer.o: showbuffer.c showbuffer.h
|
||||
$(CC) -c -I$(INCDIR) $(CFLAGS) showbuffer.c
|
||||
|
||||
|
||||
# special case: need the -lOSMesa library:
|
||||
osdemo: osdemo.c
|
||||
$(CC) -I$(INCDIR) $(CFLAGS) osdemo.c $(OSMESA_LIBS) -o $@
|
||||
|
||||
# another special case: need the -lOSMesa16 library:
|
||||
osdemo16: osdemo16.c
|
||||
$(CC) -I$(INCDIR) $(CFLAGS) osdemo16.c $(OSMESA16_LIBS) -o $@
|
||||
|
||||
# another special case: need the -lOSMesa32 library:
|
||||
osdemo32: osdemo32.c
|
||||
$(CC) -I$(INCDIR) $(CFLAGS) osdemo32.c $(OSMESA32_LIBS) -o $@
|
||||
|
||||
|
||||
|
||||
clean:
|
||||
-rm -f $(PROGS)
|
||||
-rm -f *.o *~
|
||||
-rm -f readtex.[ch] showbuffer.[ch]
|
@@ -45,3 +45,4 @@ readtex.o: readtex.c readtex.h
|
||||
clean:
|
||||
-rm -f $(PROGS)
|
||||
-rm -f *.o *~
|
||||
-rm -f readtex.c readtex.h
|
||||
|
@@ -31,8 +31,6 @@
|
||||
# Available options:
|
||||
#
|
||||
# Environment variables:
|
||||
# CPU optimize for the given processor.
|
||||
# default = pentium
|
||||
# GLIDE path to Glide3 SDK; used with FX.
|
||||
# default = $(TOP)/glide3
|
||||
# FX=1 build for 3dfx Glide3. Note that this disables
|
||||
@@ -54,12 +52,11 @@
|
||||
.SECONDARY: ../util/readtex.o ../util/showbuffer.o
|
||||
|
||||
TOP = ../..
|
||||
CPU ?= pentium
|
||||
GLIDE ?= $(TOP)/glide3
|
||||
|
||||
CC = gcc
|
||||
CFLAGS = -Wall -W -pedantic
|
||||
CFLAGS += -O2 -ffast-math -mtune=$(CPU)
|
||||
CFLAGS += -O2 -ffast-math
|
||||
CFLAGS += -I$(TOP)/include -I../util
|
||||
CFLAGS += -DGLUT_IMPORT_LIB
|
||||
ifeq ($(FX),1)
|
||||
|
@@ -31,8 +31,6 @@
|
||||
# Available options:
|
||||
#
|
||||
# Environment variables:
|
||||
# CPU optimize for the given processor.
|
||||
# default = pentium
|
||||
#
|
||||
# Targets:
|
||||
# <file.exe> build a specific file
|
||||
@@ -45,11 +43,10 @@
|
||||
.SECONDARY: ../util/readtex.o ../util/showbuffer.o
|
||||
|
||||
TOP = ../..
|
||||
CPU ?= pentium
|
||||
|
||||
CC = mingw32-gcc
|
||||
CFLAGS = -Wall -W -pedantic
|
||||
CFLAGS += -O2 -ffast-math -mtune=$(CPU)
|
||||
CFLAGS += -O2 -ffast-math
|
||||
CFLAGS += -I$(TOP)/include -I../util
|
||||
ifeq ($(FX),1)
|
||||
CFLAGS += -DFX
|
||||
|
@@ -14,7 +14,9 @@
|
||||
#include <windows.h>
|
||||
#endif
|
||||
#define GL_GLEXT_LEGACY
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
#include <GL/glut.h>
|
||||
#include <GL/glext.h>
|
||||
|
||||
|
||||
GLenum doubleBuffer;
|
||||
|
@@ -37,7 +37,7 @@ static PPMImage *LoadPPM(const char *filename)
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (fscanf(fp, "%d %d", &result->sizeX, &result->sizeY) != 2)
|
||||
if (fscanf(fp, "%lu %lu", &result->sizeX, &result->sizeY) != 2)
|
||||
{
|
||||
fprintf(stderr, "Error loading image `%s'\n", filename);
|
||||
exit(1);
|
||||
|
@@ -26,6 +26,8 @@ SOURCES = antialias.c \
|
||||
cva.c \
|
||||
dinoshade.c \
|
||||
floattex.c \
|
||||
fbotest1.c \
|
||||
fbotexture.c \
|
||||
fogcoord.c \
|
||||
fptest1.c \
|
||||
fptexture.c \
|
||||
|
@@ -83,8 +83,8 @@ static void Display( void )
|
||||
DO_FUNC( glTexCoord3fv, (v) );
|
||||
DO_FUNC( glMultiTexCoord2fv, (GL_TEXTURE0, v) );
|
||||
DO_FUNC( glMultiTexCoord2f, (GL_TEXTURE0, 0.0, 0.0) );
|
||||
DO_FUNC( glFogCoordfv, (v) );
|
||||
DO_FUNC( glFogCoordf, (0.5) );
|
||||
DO_FUNC( glFogCoordfvEXT, (v) );
|
||||
DO_FUNC( glFogCoordfEXT, (0.5) );
|
||||
|
||||
glEnd();
|
||||
|
||||
|
169
progs/tests/fbotest1.c
Normal file
169
progs/tests/fbotest1.c
Normal file
@@ -0,0 +1,169 @@
|
||||
/*
|
||||
* Test GL_EXT_framebuffer_object
|
||||
*
|
||||
* Brian Paul
|
||||
* 7 Feb 2005
|
||||
*/
|
||||
|
||||
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <GL/glut.h>
|
||||
|
||||
static int Width = 400, Height = 400;
|
||||
static GLuint MyFB;
|
||||
|
||||
|
||||
static void
|
||||
CheckError(int line)
|
||||
{
|
||||
GLenum err = glGetError();
|
||||
if (err) {
|
||||
printf("GL Error 0x%x at line %d\n", (int) err, line);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Display( void )
|
||||
{
|
||||
GLubyte *buffer = malloc(Width * Height * 4);
|
||||
GLenum status;
|
||||
|
||||
/* draw to user framebuffer */
|
||||
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB);
|
||||
glDrawBuffer(GL_COLOR_ATTACHMENT1_EXT);
|
||||
glReadBuffer(GL_COLOR_ATTACHMENT1_EXT);
|
||||
|
||||
status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
|
||||
if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
|
||||
printf("Framebuffer incomplete!!!\n");
|
||||
}
|
||||
|
||||
glClearColor(0.5, 0.5, 1.0, 0.0);
|
||||
glClear( GL_COLOR_BUFFER_BIT );
|
||||
|
||||
glBegin(GL_POLYGON);
|
||||
glColor3f(1, 0, 0);
|
||||
glVertex2f(-1, -1);
|
||||
glColor3f(0, 1, 0);
|
||||
glVertex2f(1, -1);
|
||||
glColor3f(0, 0, 1);
|
||||
glVertex2f(0, 1);
|
||||
glEnd();
|
||||
|
||||
/* read from user framebuffer */
|
||||
glReadPixels(0, 0, Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
|
||||
|
||||
/* draw to window */
|
||||
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
|
||||
glWindowPos2iARB(0, 0);
|
||||
glDrawPixels(Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
|
||||
|
||||
free(buffer);
|
||||
glutSwapBuffers();
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Reshape( int width, int height )
|
||||
{
|
||||
float ar = (float) width / (float) height;
|
||||
glViewport( 0, 0, width, height );
|
||||
glMatrixMode( GL_PROJECTION );
|
||||
glLoadIdentity();
|
||||
#if 0
|
||||
glFrustum( -ar, ar, -1.0, 1.0, 5.0, 25.0 );
|
||||
#else
|
||||
glOrtho(-1.0, 1.0, -1.0, 1.0, 5.0, 25.0 );
|
||||
#endif
|
||||
glMatrixMode( GL_MODELVIEW );
|
||||
glLoadIdentity();
|
||||
glTranslatef( 0.0, 0.0, -15.0 );
|
||||
Width = width;
|
||||
Height = height;
|
||||
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGB, Width, Height);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Key( unsigned char key, int x, int y )
|
||||
{
|
||||
(void) x;
|
||||
(void) y;
|
||||
switch (key) {
|
||||
case 27:
|
||||
exit(0);
|
||||
break;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Init( void )
|
||||
{
|
||||
GLuint rb;
|
||||
GLint i;
|
||||
|
||||
if (!glutExtensionSupported("GL_EXT_framebuffer_object")) {
|
||||
printf("GL_EXT_framebuffer_object not found!\n");
|
||||
/*exit(0);*/
|
||||
}
|
||||
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
|
||||
|
||||
glGenFramebuffersEXT(1, &MyFB);
|
||||
assert(MyFB);
|
||||
assert(glIsFramebufferEXT(MyFB));
|
||||
glDeleteFramebuffersEXT(1, &MyFB);
|
||||
assert(!glIsFramebufferEXT(MyFB));
|
||||
/* Note, continue to use MyFB below */
|
||||
|
||||
glGenRenderbuffersEXT(1, &rb);
|
||||
assert(rb);
|
||||
assert(glIsRenderbufferEXT(rb));
|
||||
glDeleteRenderbuffersEXT(1, &rb);
|
||||
assert(!glIsRenderbufferEXT(rb));
|
||||
rb = 42; /* an arbitrary ID */
|
||||
|
||||
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB);
|
||||
assert(glIsFramebufferEXT(MyFB));
|
||||
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, rb);
|
||||
assert(glIsRenderbufferEXT(rb));
|
||||
|
||||
glGetIntegerv(GL_RENDERBUFFER_BINDING_EXT, &i);
|
||||
assert(i == rb);
|
||||
|
||||
glGetIntegerv(GL_FRAMEBUFFER_BINDING_EXT, &i);
|
||||
assert(i == MyFB);
|
||||
|
||||
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT1_EXT,
|
||||
GL_RENDERBUFFER_EXT, rb);
|
||||
|
||||
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGB, Width, Height);
|
||||
|
||||
CheckError(__LINE__);
|
||||
|
||||
/* restore to default */
|
||||
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main( int argc, char *argv[] )
|
||||
{
|
||||
glutInit( &argc, argv );
|
||||
glutInitWindowPosition( 0, 0 );
|
||||
glutInitWindowSize(Width, Height);
|
||||
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
|
||||
glutCreateWindow(argv[0]);
|
||||
glutReshapeFunc( Reshape );
|
||||
glutKeyboardFunc( Key );
|
||||
glutDisplayFunc( Display );
|
||||
Init();
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
276
progs/tests/fbotexture.c
Normal file
276
progs/tests/fbotexture.c
Normal file
@@ -0,0 +1,276 @@
|
||||
/*
|
||||
* Test GL_EXT_framebuffer_object render-to-texture
|
||||
*
|
||||
* Draw a teapot into a texture image with stenciling.
|
||||
* Then draw a textured quad using that texture.
|
||||
*
|
||||
* Brian Paul
|
||||
* 18 Apr 2005
|
||||
*/
|
||||
|
||||
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <GL/glut.h>
|
||||
|
||||
static int Width = 400, Height = 400;
|
||||
static int TexWidth = 512, TexHeight = 512;
|
||||
static GLuint MyFB;
|
||||
static GLuint TexObj;
|
||||
static GLuint DepthRB, StencilRB;
|
||||
static GLboolean Anim = GL_FALSE;
|
||||
static GLfloat Rot = 0.0;
|
||||
|
||||
|
||||
static void
|
||||
CheckError(int line)
|
||||
{
|
||||
GLenum err = glGetError();
|
||||
if (err) {
|
||||
printf("GL Error 0x%x at line %d\n", (int) err, line);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Idle(void)
|
||||
{
|
||||
Rot = glutGet(GLUT_ELAPSED_TIME) * 0.05;
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
RenderTexture(void)
|
||||
{
|
||||
GLint level = 0;
|
||||
GLenum status;
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrtho(-1.0, 1.0, -1.0, 1.0, 5.0, 25.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
glTranslatef(0.0, 0.0, -15.0);
|
||||
|
||||
/* draw to texture */
|
||||
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB);
|
||||
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
|
||||
GL_TEXTURE_2D, TexObj, level);
|
||||
|
||||
status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
|
||||
if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
|
||||
printf("Framebuffer incomplete!!!\n");
|
||||
}
|
||||
|
||||
glViewport(0, 0, TexWidth, TexHeight);
|
||||
|
||||
glClearColor(0.5, 0.5, 1.0, 0.0);
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
|
||||
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glEnable(GL_STENCIL_TEST);
|
||||
glStencilFunc(GL_NEVER, 1, ~0);
|
||||
glStencilOp(GL_REPLACE, GL_KEEP, GL_REPLACE);
|
||||
|
||||
/* draw diamond-shaped stencil pattern */
|
||||
glColor3f(0, 1, 0);
|
||||
glBegin(GL_POLYGON);
|
||||
glVertex2f(-0.2, 0.0);
|
||||
glVertex2f( 0.0, -0.2);
|
||||
glVertex2f( 0.2, 0.0);
|
||||
glVertex2f( 0.0, 0.2);
|
||||
glEnd();
|
||||
|
||||
/* draw teapot where stencil != 1 */
|
||||
glStencilFunc(GL_NOTEQUAL, 1, ~0);
|
||||
glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
|
||||
|
||||
#if 0
|
||||
glBegin(GL_POLYGON);
|
||||
glColor3f(1, 0, 0);
|
||||
glVertex2f(-1, -1);
|
||||
glColor3f(0, 1, 0);
|
||||
glVertex2f(1, -1);
|
||||
glColor3f(0, 0, 1);
|
||||
glVertex2f(0, 1);
|
||||
glEnd();
|
||||
#else
|
||||
glEnable(GL_LIGHTING);
|
||||
glEnable(GL_LIGHT0);
|
||||
glPushMatrix();
|
||||
glRotatef(0.5 * Rot, 1.0, 0.0, 0.0);
|
||||
glutSolidTeapot(0.5);
|
||||
glPopMatrix();
|
||||
glDisable(GL_LIGHTING);
|
||||
#endif
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
glDisable(GL_STENCIL_TEST);
|
||||
|
||||
/* Bind normal framebuffer */
|
||||
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
|
||||
|
||||
CheckError(__LINE__);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
Display(void)
|
||||
{
|
||||
float ar = (float) Width / (float) Height;
|
||||
|
||||
RenderTexture();
|
||||
|
||||
/* draw textured quad in the window */
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glFrustum(-ar, ar, -1.0, 1.0, 5.0, 25.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
glTranslatef(0.0, 0.0, -7.0);
|
||||
|
||||
glViewport(0, 0, Width, Height);
|
||||
|
||||
glClearColor(0.25, 0.25, 0.25, 0);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
glPushMatrix();
|
||||
glRotatef(Rot, 0, 1, 0);
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glBegin(GL_POLYGON);
|
||||
glColor3f(0.25, 0.25, 0.25);
|
||||
glTexCoord2f(0, 0);
|
||||
glVertex2f(-1, -1);
|
||||
glTexCoord2f(1, 0);
|
||||
glVertex2f(1, -1);
|
||||
glColor3f(1.0, 1.0, 1.0);
|
||||
glTexCoord2f(1, 1);
|
||||
glVertex2f(1, 1);
|
||||
glTexCoord2f(0, 1);
|
||||
glVertex2f(-1, 1);
|
||||
glEnd();
|
||||
glPopMatrix();
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
|
||||
glutSwapBuffers();
|
||||
CheckError(__LINE__);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Reshape(int width, int height)
|
||||
{
|
||||
glViewport(0, 0, width, height);
|
||||
Width = width;
|
||||
Height = height;
|
||||
}
|
||||
|
||||
|
||||
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);
|
||||
break;
|
||||
case 27:
|
||||
exit(0);
|
||||
break;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Init(void)
|
||||
{
|
||||
GLint i;
|
||||
|
||||
if (!glutExtensionSupported("GL_EXT_framebuffer_object")) {
|
||||
printf("GL_EXT_framebuffer_object not found!\n");
|
||||
exit(0);
|
||||
}
|
||||
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
|
||||
|
||||
/* make framebuffer */
|
||||
glGenFramebuffersEXT(1, &MyFB);
|
||||
assert(MyFB);
|
||||
assert(glIsFramebufferEXT(MyFB));
|
||||
glDeleteFramebuffersEXT(1, &MyFB);
|
||||
assert(!glIsFramebufferEXT(MyFB));
|
||||
/* Note, continue to use MyFB below */
|
||||
|
||||
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB);
|
||||
assert(glIsFramebufferEXT(MyFB));
|
||||
glGetIntegerv(GL_FRAMEBUFFER_BINDING_EXT, &i);
|
||||
assert(i == MyFB);
|
||||
|
||||
/* make depth renderbuffer */
|
||||
glGenRenderbuffersEXT(1, &DepthRB);
|
||||
assert(DepthRB);
|
||||
assert(glIsRenderbufferEXT(DepthRB));
|
||||
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, DepthRB);
|
||||
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT,
|
||||
TexWidth, TexHeight);
|
||||
|
||||
/* make stencil renderbuffer */
|
||||
glGenRenderbuffersEXT(1, &StencilRB);
|
||||
assert(StencilRB);
|
||||
assert(glIsRenderbufferEXT(StencilRB));
|
||||
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, StencilRB);
|
||||
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_STENCIL_INDEX,
|
||||
TexWidth, TexHeight);
|
||||
|
||||
/* attach DepthRB to MyFB */
|
||||
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
|
||||
GL_RENDERBUFFER_EXT, DepthRB);
|
||||
|
||||
/* attach StencilRB to MyFB */
|
||||
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT,
|
||||
GL_RENDERBUFFER_EXT, StencilRB);
|
||||
|
||||
|
||||
/* bind regular framebuffer */
|
||||
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
|
||||
|
||||
/* Make texture object/image */
|
||||
glGenTextures(1, &TexObj);
|
||||
glBindTexture(GL_TEXTURE_2D, TexObj);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, TexWidth, TexHeight, 0,
|
||||
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
|
||||
CheckError(__LINE__);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
glutInit(&argc, argv);
|
||||
glutInitWindowPosition(0, 0);
|
||||
glutInitWindowSize(Width, Height);
|
||||
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
|
||||
glutCreateWindow(argv[0]);
|
||||
glutReshapeFunc(Reshape);
|
||||
glutKeyboardFunc(Key);
|
||||
glutDisplayFunc(Display);
|
||||
if (Anim)
|
||||
glutIdleFunc(Idle);
|
||||
Init();
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
@@ -288,6 +288,7 @@ check_functions( const char *extensions )
|
||||
|
||||
for (entry = functions; entry->name; entry++) {
|
||||
if (entry->name[0] == '-') {
|
||||
/* XXX update for OpenGL 2.0 */
|
||||
if (entry->name[1] == '1') {
|
||||
/* check GL version X.Y */
|
||||
const char *version = (const char *) glGetString(GL_VERSION);
|
||||
|
@@ -360,19 +360,19 @@ init_fbconfig_functions(Display *dpy, int scrnum)
|
||||
|
||||
if ( glx_1_3_supported ) {
|
||||
choose_fbconfig = (PFNGLXCHOOSEFBCONFIGSGIXPROC) glXGetProcAddressARB(
|
||||
(GLbyte *) "glXChooseFBConfig");
|
||||
(GLubyte *) "glXChooseFBConfig");
|
||||
get_visual_from_fbconfig = (PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) glXGetProcAddressARB(
|
||||
(GLbyte *) "glXGetVisualFromFBConfig");
|
||||
(GLubyte *) "glXGetVisualFromFBConfig");
|
||||
create_new_context = (PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) glXGetProcAddressARB(
|
||||
(GLbyte *) "glXCreateNewContext");
|
||||
(GLubyte *) "glXCreateNewContext");
|
||||
}
|
||||
else if ( ext_version_supported ) {
|
||||
choose_fbconfig = (PFNGLXCHOOSEFBCONFIGSGIXPROC) glXGetProcAddressARB(
|
||||
(GLbyte *) "glXChooseFBConfigSGIX");
|
||||
(GLubyte *) "glXChooseFBConfigSGIX");
|
||||
get_visual_from_fbconfig = (PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) glXGetProcAddressARB(
|
||||
(GLbyte *) "glXGetVisualFromFBConfigSGIX");
|
||||
(GLubyte *) "glXGetVisualFromFBConfigSGIX");
|
||||
create_new_context = (PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) glXGetProcAddressARB(
|
||||
(GLbyte *) "glXCreateContextWithConfigSGIX");
|
||||
(GLubyte *) "glXCreateContextWithConfigSGIX");
|
||||
}
|
||||
else {
|
||||
printf( "This demo requires either GLX 1.3 or %s be supported.\n",
|
||||
|
@@ -56,32 +56,32 @@ demoInitialize(_EGLDriver *drv, EGLDisplay dpy, EGLint *major, EGLint *minor)
|
||||
EGLint i;
|
||||
|
||||
/* Create a screen */
|
||||
scrn = _eglNewScreen();
|
||||
scrn = calloc(1, sizeof(*scrn));
|
||||
_eglAddScreen(disp, scrn);
|
||||
|
||||
/* Create the screen's modes - silly example */
|
||||
_eglAddMode(scrn, 1600, 1200, 32, 72 * 1000);
|
||||
_eglAddMode(scrn, 1280, 1024, 32, 72 * 1000);
|
||||
_eglAddMode(scrn, 1280, 1024, 16, 72 * 1000);
|
||||
_eglAddMode(scrn, 1024, 768, 32, 72 * 1000);
|
||||
_eglAddMode(scrn, 1600, 1200, 72 * 1000, "1600x1200-72");
|
||||
_eglAddMode(scrn, 1280, 1024, 72 * 1000, "1280x1024-70");
|
||||
_eglAddMode(scrn, 1280, 1024, 70 * 1000, "1280x1024-70");
|
||||
_eglAddMode(scrn, 1024, 768, 72 * 1000, "1024x768-72");
|
||||
|
||||
/* Create the display's visual configs - silly example */
|
||||
for (i = 0; i < 4; i++) {
|
||||
_EGLConfig config;
|
||||
_eglInitConfig(&config, i + 1);
|
||||
SET_CONFIG_ATTRIB(&config, EGL_RED_SIZE, 8);
|
||||
SET_CONFIG_ATTRIB(&config, EGL_GREEN_SIZE, 8);
|
||||
SET_CONFIG_ATTRIB(&config, EGL_BLUE_SIZE, 8);
|
||||
SET_CONFIG_ATTRIB(&config, EGL_ALPHA_SIZE, 8);
|
||||
SET_CONFIG_ATTRIB(&config, EGL_BUFFER_SIZE, 32);
|
||||
_eglSetConfigAttrib(&config, EGL_RED_SIZE, 8);
|
||||
_eglSetConfigAttrib(&config, EGL_GREEN_SIZE, 8);
|
||||
_eglSetConfigAttrib(&config, EGL_BLUE_SIZE, 8);
|
||||
_eglSetConfigAttrib(&config, EGL_ALPHA_SIZE, 8);
|
||||
_eglSetConfigAttrib(&config, EGL_BUFFER_SIZE, 32);
|
||||
if (i & 1) {
|
||||
SET_CONFIG_ATTRIB(&config, EGL_DEPTH_SIZE, 32);
|
||||
_eglSetConfigAttrib(&config, EGL_DEPTH_SIZE, 32);
|
||||
}
|
||||
if (i & 2) {
|
||||
SET_CONFIG_ATTRIB(&config, EGL_STENCIL_SIZE, 8);
|
||||
_eglSetConfigAttrib(&config, EGL_STENCIL_SIZE, 8);
|
||||
}
|
||||
SET_CONFIG_ATTRIB(&config, EGL_SURFACE_TYPE,
|
||||
(EGL_WINDOW_BIT | EGL_PIXMAP_BIT | EGL_PBUFFER_BIT));
|
||||
_eglSetConfigAttrib(&config, EGL_SURFACE_TYPE,
|
||||
(EGL_WINDOW_BIT | EGL_PIXMAP_BIT | EGL_PBUFFER_BIT));
|
||||
_eglAddConfig(disp, &config);
|
||||
}
|
||||
|
||||
@@ -214,68 +214,20 @@ demoCreatePixmapSurface(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, Nativ
|
||||
|
||||
|
||||
static EGLSurface
|
||||
demoCreatePbufferSurface(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list)
|
||||
demoCreatePbufferSurface(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config,
|
||||
const EGLint *attrib_list)
|
||||
{
|
||||
_EGLConfig *conf;
|
||||
EGLint i, width = 0, height = 0, largest, texFormat, texTarget, mipmapTex;
|
||||
DemoSurface *surf;
|
||||
|
||||
conf = _eglLookupConfig(drv, dpy, config);
|
||||
if (!conf) {
|
||||
_eglError(EGL_BAD_CONFIG, "eglCreatePbufferSurface");
|
||||
return EGL_NO_SURFACE;
|
||||
}
|
||||
|
||||
for (i = 0; attrib_list && attrib_list[i] != EGL_NONE; i++) {
|
||||
switch (attrib_list[i]) {
|
||||
case EGL_WIDTH:
|
||||
width = attrib_list[++i];
|
||||
break;
|
||||
case EGL_HEIGHT:
|
||||
height = attrib_list[++i];
|
||||
break;
|
||||
case EGL_LARGEST_PBUFFER:
|
||||
largest = attrib_list[++i];
|
||||
break;
|
||||
case EGL_TEXTURE_FORMAT:
|
||||
texFormat = attrib_list[++i];
|
||||
break;
|
||||
case EGL_TEXTURE_TARGET:
|
||||
texTarget = attrib_list[++i];
|
||||
break;
|
||||
case EGL_MIPMAP_TEXTURE:
|
||||
mipmapTex = attrib_list[++i];
|
||||
break;
|
||||
default:
|
||||
_eglError(EGL_BAD_ATTRIBUTE, "eglCreatePbufferSurface");
|
||||
return EGL_NO_SURFACE;
|
||||
}
|
||||
}
|
||||
|
||||
if (width <= 0 || height <= 0) {
|
||||
_eglError(EGL_BAD_ATTRIBUTE, "eglCreatePbufferSurface(width or height)");
|
||||
return EGL_NO_SURFACE;
|
||||
}
|
||||
|
||||
surf = (DemoSurface *) calloc(1, sizeof(DemoSurface));
|
||||
DemoSurface *surf = (DemoSurface *) calloc(1, sizeof(DemoSurface));
|
||||
if (!surf)
|
||||
return EGL_NO_SURFACE;
|
||||
|
||||
surf->Base.Config = conf;
|
||||
surf->Base.Type = EGL_PBUFFER_BIT;
|
||||
surf->Base.Width = width;
|
||||
surf->Base.Height = height;
|
||||
surf->Base.TextureFormat = texFormat;
|
||||
surf->Base.TextureTarget = texTarget;
|
||||
surf->Base.MipmapTexture = mipmapTex;
|
||||
surf->Base.MipmapLevel = 0;
|
||||
surf->Base.SwapInterval = 0;
|
||||
if (_eglInitPbufferSurface(&surf->Base, drv, dpy, config, attrib_list)
|
||||
== EGL_NO_SURFACE) {
|
||||
free(surf);
|
||||
return EGL_NO_SURFACE;
|
||||
}
|
||||
|
||||
printf("eglCreatePbufferSurface()\n");
|
||||
|
||||
/* insert into hash table */
|
||||
_eglSaveSurface(&surf->Base);
|
||||
assert(surf->Base.Handle);
|
||||
/* a real driver would allocate the pbuffer memory here */
|
||||
|
||||
return surf->Base.Handle;
|
||||
}
|
||||
@@ -334,20 +286,6 @@ demoMakeCurrent(_EGLDriver *drv, EGLDisplay dpy, EGLSurface draw, EGLSurface rea
|
||||
}
|
||||
|
||||
|
||||
static const char *
|
||||
demoQueryString(_EGLDriver *drv, EGLDisplay dpy, EGLint name)
|
||||
{
|
||||
if (name == EGL_EXTENSIONS) {
|
||||
return "EGL_MESA_screen_surface";
|
||||
}
|
||||
else {
|
||||
return _eglQueryString(drv, dpy, name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Just to silence warning
|
||||
*/
|
||||
@@ -381,6 +319,10 @@ _eglMain(NativeDisplayType dpy)
|
||||
demo->Base.CreatePbufferSurface = demoCreatePbufferSurface;
|
||||
demo->Base.DestroySurface = demoDestroySurface;
|
||||
demo->Base.DestroyContext = demoDestroyContext;
|
||||
demo->Base.QueryString = demoQueryString;
|
||||
|
||||
/* enable supported extensions */
|
||||
demo->Base.MESA_screen_surface = EGL_TRUE;
|
||||
demo->Base.MESA_copy_context = EGL_TRUE;
|
||||
|
||||
return &demo->Base;
|
||||
}
|
||||
|
@@ -346,8 +346,18 @@ void (* APIENTRY eglGetProcAddress(const char *procname))()
|
||||
{ "eglWaitGL", (_EGLProc) eglWaitGL },
|
||||
{ "eglWaitNative", (_EGLProc) eglWaitNative },
|
||||
/* Extensions */
|
||||
{ "eglShowSurfaceMESA", (_EGLProc) NULL },
|
||||
{ "eglGetModesMESA", (_EGLProc) NULL },
|
||||
{ "eglChooseModeMESA", (_EGLProc) eglChooseModeMESA },
|
||||
{ "eglGetModesMESA", (_EGLProc) eglGetModesMESA },
|
||||
{ "eglGetModeAttribMESA", (_EGLProc) eglGetModeAttribMESA },
|
||||
{ "eglCopyContextMESA", (_EGLProc) eglCopyContextMESA },
|
||||
{ "eglGetScreensMESA", (_EGLProc) eglGetScreensMESA },
|
||||
{ "eglCreateScreenSurfaceMESA", (_EGLProc) eglCreateScreenSurfaceMESA },
|
||||
{ "eglShowSurfaceMESA", (_EGLProc) eglShowSurfaceMESA },
|
||||
{ "eglScreenPositionMESA", (_EGLProc) eglScreenPositionMESA },
|
||||
{ "eglQueryScreenMESA", (_EGLProc) eglQueryScreenMESA },
|
||||
{ "eglQueryScreenSurfaceMESA", (_EGLProc) eglQueryScreenSurfaceMESA },
|
||||
{ "eglQueryScreenModeMESA", (_EGLProc) eglQueryScreenModeMESA },
|
||||
{ "eglQueryModeStringMESA", (_EGLProc) eglQueryModeStringMESA },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
EGLint i;
|
||||
@@ -404,6 +414,17 @@ eglGetModeAttribMESA(EGLDisplay dpy, EGLModeMESA mode, EGLint attribute, EGLint
|
||||
}
|
||||
|
||||
|
||||
EGLBoolean APIENTRY
|
||||
eglCopyContextMESA(EGLDisplay dpy, EGLContext source, EGLContext dest, EGLint mask)
|
||||
{
|
||||
_EGLDriver *drv = _eglLookupDriver(dpy);
|
||||
if (drv)
|
||||
return drv->CopyContextMESA(drv, dpy, source, dest, mask);
|
||||
else
|
||||
return EGL_FALSE;
|
||||
}
|
||||
|
||||
|
||||
EGLBoolean
|
||||
eglGetScreensMESA(EGLDisplay dpy, EGLScreenMESA *screens, EGLint max_screens, EGLint *num_screens)
|
||||
{
|
||||
@@ -418,35 +439,59 @@ eglGetScreensMESA(EGLDisplay dpy, EGLScreenMESA *screens, EGLint max_screens, EG
|
||||
EGLSurface
|
||||
eglCreateScreenSurfaceMESA(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list)
|
||||
{
|
||||
return EGL_FALSE;
|
||||
_EGLDriver *drv = _eglLookupDriver(dpy);
|
||||
return drv->CreateScreenSurfaceMESA(drv, dpy, config, attrib_list);
|
||||
}
|
||||
|
||||
|
||||
EGLBoolean
|
||||
eglShowSurfaceMESA(EGLDisplay dpy, EGLint screen, EGLSurface surface)
|
||||
eglShowSurfaceMESA(EGLDisplay dpy, EGLint screen, EGLSurface surface, EGLModeMESA mode)
|
||||
{
|
||||
return EGL_FALSE;
|
||||
_EGLDriver *drv = _eglLookupDriver(dpy);
|
||||
return drv->ShowSurfaceMESA(drv, dpy, screen, surface, mode);
|
||||
}
|
||||
|
||||
|
||||
EGLBoolean
|
||||
eglScreenModeMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA mode)
|
||||
eglScreenPositionMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLint x, EGLint y)
|
||||
{
|
||||
return EGL_FALSE;
|
||||
}
|
||||
|
||||
|
||||
EGLBoolean
|
||||
eglQueryScreenSurfaceMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLSurface *surface)
|
||||
{
|
||||
return EGL_FALSE;
|
||||
_EGLDriver *drv = _eglLookupDriver(dpy);
|
||||
return drv->ScreenPositionMESA(drv, dpy, screen, x, y);
|
||||
}
|
||||
|
||||
|
||||
EGLBoolean
|
||||
eglQueryScreenMESA( EGLDisplay dpy, EGLScreenMESA screen, EGLint attribute, EGLint *value)
|
||||
{
|
||||
return EGL_FALSE;
|
||||
_EGLDriver *drv = _eglLookupDriver(dpy);
|
||||
return drv->QueryScreenMESA(drv, dpy, screen, attribute, value);
|
||||
}
|
||||
|
||||
|
||||
EGLBoolean
|
||||
eglQueryScreenSurfaceMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLSurface *surface)
|
||||
{
|
||||
_EGLDriver *drv = _eglLookupDriver(dpy);
|
||||
return drv->QueryScreenSurfaceMESA(drv, dpy, screen, surface);
|
||||
}
|
||||
|
||||
|
||||
EGLBoolean
|
||||
eglQueryScreenModeMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *mode)
|
||||
{
|
||||
_EGLDriver *drv = _eglLookupDriver(dpy);
|
||||
return drv->QueryScreenModeMESA(drv, dpy, screen, mode);
|
||||
}
|
||||
|
||||
|
||||
const char *
|
||||
eglQueryModeStringMESA(EGLDisplay dpy, EGLModeMESA mode)
|
||||
{
|
||||
_EGLDriver *drv = _eglLookupDriver(dpy);
|
||||
return drv->QueryModeStringMESA(drv, dpy, mode);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -1,4 +1,10 @@
|
||||
/**
|
||||
* EGL Configuration (pixel format) functions.
|
||||
*/
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include "eglconfig.h"
|
||||
@@ -10,6 +16,57 @@
|
||||
#define MIN2(A, B) (((A) < (B)) ? (A) : (B))
|
||||
|
||||
|
||||
/**
|
||||
* Convert an _EGLConfig to a __GLcontextModes object.
|
||||
* NOTE: This routine may be incomplete - we're only making sure that
|
||||
* the fields needed by Mesa (for _mesa_create_context/framebuffer) are
|
||||
* set correctly.
|
||||
*/
|
||||
void
|
||||
_eglConfigToContextModesRec(const _EGLConfig *config, __GLcontextModes *mode)
|
||||
{
|
||||
memset(mode, 0, sizeof(*mode));
|
||||
|
||||
mode->rgbMode = GL_TRUE; /* no color index */
|
||||
mode->colorIndexMode = GL_FALSE;
|
||||
mode->doubleBufferMode = GL_TRUE; /* always DB for now */
|
||||
mode->stereoMode = GL_FALSE;
|
||||
|
||||
mode->redBits = GET_CONFIG_ATTRIB(config, EGL_RED_SIZE);
|
||||
mode->greenBits = GET_CONFIG_ATTRIB(config, EGL_GREEN_SIZE);
|
||||
mode->blueBits = GET_CONFIG_ATTRIB(config, EGL_BLUE_SIZE);
|
||||
mode->alphaBits = GET_CONFIG_ATTRIB(config, EGL_ALPHA_SIZE);
|
||||
mode->rgbBits = GET_CONFIG_ATTRIB(config, EGL_BUFFER_SIZE);
|
||||
|
||||
/* no rgba masks - fix? */
|
||||
|
||||
mode->depthBits = GET_CONFIG_ATTRIB(config, EGL_DEPTH_SIZE);
|
||||
mode->haveDepthBuffer = mode->depthBits > 0;
|
||||
|
||||
mode->stencilBits = GET_CONFIG_ATTRIB(config, EGL_STENCIL_SIZE);
|
||||
mode->haveStencilBuffer = mode->stencilBits > 0;
|
||||
|
||||
/* no accum */
|
||||
|
||||
mode->level = GET_CONFIG_ATTRIB(config, EGL_LEVEL);
|
||||
mode->samples = GET_CONFIG_ATTRIB(config, EGL_SAMPLES);
|
||||
mode->sampleBuffers = GET_CONFIG_ATTRIB(config, EGL_SAMPLE_BUFFERS);
|
||||
|
||||
/* surface type - not really needed */
|
||||
mode->visualType = GLX_TRUE_COLOR;
|
||||
mode->renderType = GLX_RGBA_BIT;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_eglSetConfigAttrib(_EGLConfig *config, EGLint attr, EGLint val)
|
||||
{
|
||||
assert(attr >= FIRST_ATTRIB);
|
||||
assert(attr < FIRST_ATTRIB + MAX_ATTRIBS);
|
||||
config->Attrib[attr - FIRST_ATTRIB] = val;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Init the given _EGLconfig to default values.
|
||||
* \param id the configuration's ID.
|
||||
@@ -19,19 +76,21 @@ _eglInitConfig(_EGLConfig *config, EGLint id)
|
||||
{
|
||||
memset(config, 0, sizeof(*config));
|
||||
config->Handle = id;
|
||||
SET_CONFIG_ATTRIB(config, EGL_CONFIG_ID, id);
|
||||
SET_CONFIG_ATTRIB(config, EGL_BIND_TO_TEXTURE_RGB, EGL_DONT_CARE);
|
||||
SET_CONFIG_ATTRIB(config, EGL_BIND_TO_TEXTURE_RGBA, EGL_DONT_CARE);
|
||||
SET_CONFIG_ATTRIB(config, EGL_CONFIG_CAVEAT, EGL_DONT_CARE);
|
||||
SET_CONFIG_ATTRIB(config, EGL_NATIVE_RENDERABLE, EGL_DONT_CARE);
|
||||
SET_CONFIG_ATTRIB(config, EGL_NATIVE_VISUAL_TYPE, EGL_DONT_CARE);
|
||||
SET_CONFIG_ATTRIB(config, EGL_MIN_SWAP_INTERVAL, EGL_DONT_CARE);
|
||||
SET_CONFIG_ATTRIB(config, EGL_MAX_SWAP_INTERVAL, EGL_DONT_CARE);
|
||||
SET_CONFIG_ATTRIB(config, EGL_SURFACE_TYPE, EGL_WINDOW_BIT);
|
||||
SET_CONFIG_ATTRIB(config, EGL_TRANSPARENT_TYPE, EGL_NONE);
|
||||
SET_CONFIG_ATTRIB(config, EGL_TRANSPARENT_RED_VALUE, EGL_DONT_CARE);
|
||||
SET_CONFIG_ATTRIB(config, EGL_TRANSPARENT_GREEN_VALUE, EGL_DONT_CARE);
|
||||
SET_CONFIG_ATTRIB(config, EGL_TRANSPARENT_BLUE_VALUE, EGL_DONT_CARE);
|
||||
_eglSetConfigAttrib(config, EGL_CONFIG_ID, id);
|
||||
_eglSetConfigAttrib(config, EGL_BIND_TO_TEXTURE_RGB, EGL_DONT_CARE);
|
||||
_eglSetConfigAttrib(config, EGL_BIND_TO_TEXTURE_RGBA, EGL_DONT_CARE);
|
||||
_eglSetConfigAttrib(config, EGL_CONFIG_CAVEAT, EGL_DONT_CARE);
|
||||
_eglSetConfigAttrib(config, EGL_NATIVE_RENDERABLE, EGL_DONT_CARE);
|
||||
_eglSetConfigAttrib(config, EGL_NATIVE_VISUAL_TYPE, EGL_DONT_CARE);
|
||||
_eglSetConfigAttrib(config, EGL_MIN_SWAP_INTERVAL, EGL_DONT_CARE);
|
||||
_eglSetConfigAttrib(config, EGL_MAX_SWAP_INTERVAL, EGL_DONT_CARE);
|
||||
_eglSetConfigAttrib(config, EGL_SURFACE_TYPE,
|
||||
EGL_SCREEN_BIT_MESA | EGL_PBUFFER_BIT |
|
||||
EGL_PIXMAP_BIT | EGL_WINDOW_BIT);
|
||||
_eglSetConfigAttrib(config, EGL_TRANSPARENT_TYPE, EGL_NONE);
|
||||
_eglSetConfigAttrib(config, EGL_TRANSPARENT_RED_VALUE, EGL_DONT_CARE);
|
||||
_eglSetConfigAttrib(config, EGL_TRANSPARENT_GREEN_VALUE, EGL_DONT_CARE);
|
||||
_eglSetConfigAttrib(config, EGL_TRANSPARENT_BLUE_VALUE, EGL_DONT_CARE);
|
||||
}
|
||||
|
||||
|
||||
@@ -68,6 +127,7 @@ _eglAddConfig(_EGLDisplay *display, const _EGLConfig *config)
|
||||
if (newConfigs) {
|
||||
display->Configs = newConfigs;
|
||||
display->Configs[n] = *config; /* copy struct */
|
||||
display->Configs[n].Handle = n;
|
||||
display->NumConfigs++;
|
||||
return display->Configs + n;
|
||||
}
|
||||
@@ -77,7 +137,6 @@ _eglAddConfig(_EGLDisplay *display, const _EGLConfig *config)
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Parse the attrib_list to fill in the fields of the given _egl_config
|
||||
* Return EGL_FALSE if any errors, EGL_TRUE otherwise.
|
||||
@@ -301,12 +360,218 @@ _eglGetConfigs(_EGLDriver *drv, EGLDisplay dpy, EGLConfig *configs, EGLint confi
|
||||
return EGL_FALSE;
|
||||
}
|
||||
|
||||
*num_config = MIN2(disp->NumConfigs, config_size);
|
||||
if (configs) {
|
||||
EGLint i;
|
||||
*num_config = MIN2(disp->NumConfigs, config_size);
|
||||
for (i = 0; i < *num_config; i++) {
|
||||
configs[i] = disp->Configs[i].Handle;
|
||||
}
|
||||
}
|
||||
} else
|
||||
*num_config = disp->NumConfigs;
|
||||
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates a set of \c __GLcontextModes that a driver will expose.
|
||||
*
|
||||
* A set of \c __GLcontextModes will be created based on the supplied
|
||||
* parameters. The number of modes processed will be 2 *
|
||||
* \c num_depth_stencil_bits * \c num_db_modes.
|
||||
*
|
||||
* For the most part, data is just copied from \c depth_bits, \c stencil_bits,
|
||||
* \c db_modes, and \c visType into each \c __GLcontextModes element.
|
||||
* However, the meanings of \c fb_format and \c fb_type require further
|
||||
* explanation. The \c fb_format specifies which color components are in
|
||||
* each pixel and what the default order is. For example, \c GL_RGB specifies
|
||||
* that red, green, blue are available and red is in the "most significant"
|
||||
* position and blue is in the "least significant". The \c fb_type specifies
|
||||
* the bit sizes of each component and the actual ordering. For example, if
|
||||
* \c GL_UNSIGNED_SHORT_5_6_5_REV is specified with \c GL_RGB, bits [15:11]
|
||||
* are the blue value, bits [10:5] are the green value, and bits [4:0] are
|
||||
* the red value.
|
||||
*
|
||||
* One sublte issue is the combination of \c GL_RGB or \c GL_BGR and either
|
||||
* of the \c GL_UNSIGNED_INT_8_8_8_8 modes. The resulting mask values in the
|
||||
* \c __GLcontextModes structure is \b identical to the \c GL_RGBA or
|
||||
* \c GL_BGRA case, except the \c alphaMask is zero. This means that, as
|
||||
* far as this routine is concerned, \c GL_RGB with \c GL_UNSIGNED_INT_8_8_8_8
|
||||
* still uses 32-bits.
|
||||
*
|
||||
* If in doubt, look at the tables used in the function.
|
||||
*
|
||||
* \param ptr_to_modes Pointer to a pointer to a linked list of
|
||||
* \c __GLcontextModes. Upon completion, a pointer to
|
||||
* the next element to be process will be stored here.
|
||||
* If the function fails and returns \c GL_FALSE, this
|
||||
* value will be unmodified, but some elements in the
|
||||
* linked list may be modified.
|
||||
* \param fb_format Format of the framebuffer. Currently only \c GL_RGB,
|
||||
* \c GL_RGBA, \c GL_BGR, and \c GL_BGRA are supported.
|
||||
* \param fb_type Type of the pixels in the framebuffer. Currently only
|
||||
* \c GL_UNSIGNED_SHORT_5_6_5,
|
||||
* \c GL_UNSIGNED_SHORT_5_6_5_REV,
|
||||
* \c GL_UNSIGNED_INT_8_8_8_8, and
|
||||
* \c GL_UNSIGNED_INT_8_8_8_8_REV are supported.
|
||||
* \param depth_bits Array of depth buffer sizes to be exposed.
|
||||
* \param stencil_bits Array of stencil buffer sizes to be exposed.
|
||||
* \param num_depth_stencil_bits Number of entries in both \c depth_bits and
|
||||
* \c stencil_bits.
|
||||
* \param db_modes Array of buffer swap modes. If an element has a
|
||||
* value of \c GLX_NONE, then it represents a
|
||||
* single-buffered mode. Other valid values are
|
||||
* \c GLX_SWAP_EXCHANGE_OML, \c GLX_SWAP_COPY_OML, and
|
||||
* \c GLX_SWAP_UNDEFINED_OML. See the
|
||||
* GLX_OML_swap_method extension spec for more details.
|
||||
* \param num_db_modes Number of entries in \c db_modes.
|
||||
* \param visType GLX visual type. Usually either \c GLX_TRUE_COLOR or
|
||||
* \c GLX_DIRECT_COLOR.
|
||||
*
|
||||
* \returns
|
||||
* \c GL_TRUE on success or \c GL_FALSE on failure. Currently the only
|
||||
* cause of failure is a bad parameter (i.e., unsupported \c fb_format or
|
||||
* \c fb_type).
|
||||
*
|
||||
* \todo
|
||||
* There is currently no way to support packed RGB modes (i.e., modes with
|
||||
* exactly 3 bytes per pixel) or floating-point modes. This could probably
|
||||
* be done by creating some new, private enums with clever names likes
|
||||
* \c GL_UNSIGNED_3BYTE_8_8_8, \c GL_4FLOAT_32_32_32_32,
|
||||
* \c GL_4HALF_16_16_16_16, etc. We can cross that bridge when we come to it.
|
||||
*/
|
||||
GLboolean
|
||||
_eglFillInConfigs(_EGLConfig * configs,
|
||||
GLenum fb_format, GLenum fb_type,
|
||||
const u_int8_t * depth_bits, const u_int8_t * stencil_bits,
|
||||
unsigned num_depth_stencil_bits,
|
||||
const GLenum * db_modes, unsigned num_db_modes,
|
||||
int visType) {
|
||||
static const u_int8_t bits_table[3][4] = {
|
||||
/* R G B A */
|
||||
{ 5, 6, 5, 0 }, /* Any GL_UNSIGNED_SHORT_5_6_5 */
|
||||
{ 8, 8, 8, 0 }, /* Any RGB with any GL_UNSIGNED_INT_8_8_8_8 */
|
||||
{ 8, 8, 8, 8 } /* Any RGBA with any GL_UNSIGNED_INT_8_8_8_8 */
|
||||
};
|
||||
|
||||
/* The following arrays are all indexed by the fb_type masked with 0x07.
|
||||
* Given the four supported fb_type values, this results in valid array
|
||||
* indices of 3, 4, 5, and 7.
|
||||
*/
|
||||
static const u_int32_t masks_table_rgb[8][4] = {
|
||||
{0x00000000, 0x00000000, 0x00000000, 0x00000000},
|
||||
{0x00000000, 0x00000000, 0x00000000, 0x00000000},
|
||||
{0x00000000, 0x00000000, 0x00000000, 0x00000000},
|
||||
{0x0000F800, 0x000007E0, 0x0000001F, 0x00000000}, /* 5_6_5 */
|
||||
{0x0000001F, 0x000007E0, 0x0000F800, 0x00000000}, /* 5_6_5_REV */
|
||||
{0xFF000000, 0x00FF0000, 0x0000FF00, 0x00000000}, /* 8_8_8_8 */
|
||||
{0x00000000, 0x00000000, 0x00000000, 0x00000000},
|
||||
{0x000000FF, 0x0000FF00, 0x00FF0000, 0x00000000} /* 8_8_8_8_REV */
|
||||
};
|
||||
|
||||
static const u_int32_t masks_table_rgba[8][4] = {
|
||||
{0x00000000, 0x00000000, 0x00000000, 0x00000000},
|
||||
{0x00000000, 0x00000000, 0x00000000, 0x00000000},
|
||||
{0x00000000, 0x00000000, 0x00000000, 0x00000000},
|
||||
{0x0000F800, 0x000007E0, 0x0000001F, 0x00000000}, /* 5_6_5 */
|
||||
{0x0000001F, 0x000007E0, 0x0000F800, 0x00000000}, /* 5_6_5_REV */
|
||||
{0xFF000000, 0x00FF0000, 0x0000FF00, 0x000000FF}, /* 8_8_8_8 */
|
||||
{0x00000000, 0x00000000, 0x00000000, 0x00000000},
|
||||
{0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000}, /* 8_8_8_8_REV */
|
||||
};
|
||||
|
||||
static const u_int32_t masks_table_bgr[8][4] = {
|
||||
{0x00000000, 0x00000000, 0x00000000, 0x00000000},
|
||||
{0x00000000, 0x00000000, 0x00000000, 0x00000000},
|
||||
{0x00000000, 0x00000000, 0x00000000, 0x00000000},
|
||||
{0x0000001F, 0x000007E0, 0x0000F800, 0x00000000}, /* 5_6_5 */
|
||||
{0x0000F800, 0x000007E0, 0x0000001F, 0x00000000}, /* 5_6_5_REV */
|
||||
{0x0000FF00, 0x00FF0000, 0xFF000000, 0x00000000}, /* 8_8_8_8 */
|
||||
{0x00000000, 0x00000000, 0x00000000, 0x00000000},
|
||||
{0x00FF0000, 0x0000FF00, 0x000000FF, 0x00000000}, /* 8_8_8_8_REV */
|
||||
};
|
||||
|
||||
static const u_int32_t masks_table_bgra[8][4] = {
|
||||
{0x00000000, 0x00000000, 0x00000000, 0x00000000},
|
||||
{0x00000000, 0x00000000, 0x00000000, 0x00000000},
|
||||
{0x00000000, 0x00000000, 0x00000000, 0x00000000},
|
||||
{0x0000001F, 0x000007E0, 0x0000F800, 0x00000000}, /* 5_6_5 */
|
||||
{0x0000F800, 0x000007E0, 0x0000001F, 0x00000000}, /* 5_6_5_REV */
|
||||
{0x0000FF00, 0x00FF0000, 0xFF000000, 0x000000FF}, /* 8_8_8_8 */
|
||||
{0x00000000, 0x00000000, 0x00000000, 0x00000000},
|
||||
{0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000}, /* 8_8_8_8_REV */
|
||||
};
|
||||
|
||||
static const u_int8_t bytes_per_pixel[8] = {
|
||||
0, 0, 0, 2, 2, 4, 0, 4
|
||||
};
|
||||
|
||||
const u_int8_t * bits;
|
||||
const u_int32_t * masks;
|
||||
const int index = fb_type & 0x07;
|
||||
_EGLConfig *config;
|
||||
unsigned i;
|
||||
unsigned j;
|
||||
unsigned k;
|
||||
|
||||
if ( bytes_per_pixel[index] == 0 ) {
|
||||
fprintf(stderr, "[%s:%u] Framebuffer type 0x%04x has 0 bytes per pixel.\n",
|
||||
__FUNCTION__, __LINE__, fb_type);
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
/* Valid types are GL_UNSIGNED_SHORT_5_6_5 and GL_UNSIGNED_INT_8_8_8_8 and
|
||||
* the _REV versions.
|
||||
*
|
||||
* Valid formats are GL_RGBA, GL_RGB, and GL_BGRA.
|
||||
*/
|
||||
switch ( fb_format ) {
|
||||
case GL_RGB:
|
||||
bits = (bytes_per_pixel[index] == 2) ? bits_table[0] : bits_table[1];
|
||||
masks = masks_table_rgb[index];
|
||||
break;
|
||||
|
||||
case GL_RGBA:
|
||||
bits = (bytes_per_pixel[index] == 2) ? bits_table[0] : bits_table[2];
|
||||
masks = masks_table_rgba[index];
|
||||
break;
|
||||
|
||||
case GL_BGR:
|
||||
bits = (bytes_per_pixel[index] == 2) ? bits_table[0] : bits_table[1];
|
||||
masks = masks_table_bgr[index];
|
||||
break;
|
||||
|
||||
case GL_BGRA:
|
||||
bits = (bytes_per_pixel[index] == 2) ? bits_table[0] : bits_table[2];
|
||||
masks = masks_table_bgra[index];
|
||||
break;
|
||||
|
||||
default:
|
||||
fprintf(stderr, "[%s:%u] Framebuffer format 0x%04x is not GL_RGB, GL_RGBA, GL_BGR, or GL_BGRA.\n",
|
||||
__FUNCTION__, __LINE__, fb_format);
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
config = configs;
|
||||
for (k = 0; k < num_depth_stencil_bits; k++) {
|
||||
for (i = 0; i < num_db_modes; i++) {
|
||||
for (j = 0; j < 2; j++) {
|
||||
_eglSetConfigAttrib(config, EGL_RED_SIZE, bits[0]);
|
||||
_eglSetConfigAttrib(config, EGL_GREEN_SIZE, bits[1]);
|
||||
_eglSetConfigAttrib(config, EGL_BLUE_SIZE, bits[2]);
|
||||
_eglSetConfigAttrib(config, EGL_ALPHA_SIZE, bits[3]);
|
||||
_eglSetConfigAttrib(config, EGL_BUFFER_SIZE,
|
||||
bits[0] + bits[1] + bits[2] + bits[3]);
|
||||
|
||||
_eglSetConfigAttrib(config, EGL_STENCIL_SIZE, stencil_bits[k]);
|
||||
_eglSetConfigAttrib(config, EGL_DEPTH_SIZE, depth_bits[i]);
|
||||
|
||||
_eglSetConfigAttrib(config, EGL_SURFACE_TYPE, EGL_SCREEN_BIT_MESA |
|
||||
EGL_PBUFFER_BIT | EGL_PIXMAP_BIT | EGL_WINDOW_BIT);
|
||||
|
||||
config++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
@@ -3,6 +3,7 @@
|
||||
|
||||
|
||||
#include "egltypedefs.h"
|
||||
#include "GL/internal/glcore.h"
|
||||
|
||||
|
||||
#define MAX_ATTRIBS 100
|
||||
@@ -16,7 +17,6 @@ struct _egl_config
|
||||
};
|
||||
|
||||
|
||||
|
||||
#define SET_CONFIG_ATTRIB(CONF, ATTR, VAL) ((CONF)->Attrib[(ATTR) - FIRST_ATTRIB] = VAL)
|
||||
#define GET_CONFIG_ATTRIB(CONF, ATTR) ((CONF)->Attrib[(ATTR) - FIRST_ATTRIB])
|
||||
|
||||
@@ -57,4 +57,19 @@ extern EGLBoolean
|
||||
_eglGetConfigs(_EGLDriver *drv, EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config);
|
||||
|
||||
|
||||
extern void
|
||||
_eglSetConfigAttrib(_EGLConfig *config, EGLint attr, EGLint val);
|
||||
|
||||
extern GLboolean
|
||||
_eglFillInConfigs( _EGLConfig *configs,
|
||||
GLenum fb_format, GLenum fb_type,
|
||||
const u_int8_t * depth_bits, const u_int8_t * stencil_bits,
|
||||
unsigned num_depth_stencil_bits,
|
||||
const GLenum * db_modes, unsigned num_db_modes,
|
||||
int visType );
|
||||
|
||||
extern void
|
||||
_eglConfigToContextModesRec(const _EGLConfig *config, __GLcontextModes *mode);
|
||||
|
||||
|
||||
#endif /* EGLCONFIG_INCLUDED */
|
||||
|
@@ -15,7 +15,7 @@
|
||||
void
|
||||
_eglInitContext(_EGLContext *ctx)
|
||||
{
|
||||
/* just init to zer for now */
|
||||
/* just init to zero for now */
|
||||
memset(ctx, 0, sizeof(_EGLContext));
|
||||
}
|
||||
|
||||
@@ -224,3 +224,17 @@ _eglMakeCurrent(_EGLDriver *drv, EGLDisplay dpy, EGLSurface d, EGLSurface r, EGL
|
||||
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This is defined by the EGL_MESA_copy_context extension.
|
||||
*/
|
||||
EGLBoolean
|
||||
_eglCopyContextMESA(_EGLDriver *drv, EGLDisplay dpy, EGLContext source,
|
||||
EGLContext dest, EGLint mask)
|
||||
{
|
||||
/* This function will always have to be overridden/implemented in the
|
||||
* device driver. If the driver is based on Mesa, use _mesa_copy_context().
|
||||
*/
|
||||
return EGL_FALSE;
|
||||
}
|
||||
|
@@ -61,4 +61,7 @@ extern EGLBoolean
|
||||
_eglMakeCurrent(_EGLDriver *drv, EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx);
|
||||
|
||||
|
||||
extern EGLBoolean
|
||||
_eglCopyContextMESA(_EGLDriver *drv, EGLDisplay dpy, EGLContext source, EGLContext dest, EGLint mask);
|
||||
|
||||
#endif /* EGLCONTEXT_INCLUDED */
|
||||
|
@@ -62,10 +62,10 @@ _eglGetCurrentDisplay(void)
|
||||
|
||||
|
||||
void
|
||||
_eglDeleteDisplay(_EGLDisplay *disp)
|
||||
_eglCleanupDisplay(_EGLDisplay *disp)
|
||||
{
|
||||
/* XXX incomplete */
|
||||
free(disp->Configs);
|
||||
free(disp);
|
||||
free(disp->Name);
|
||||
/* driver deletes _EGLDisplay */
|
||||
}
|
||||
|
||||
|
@@ -33,7 +33,12 @@ _eglGetCurrentDisplay(void);
|
||||
|
||||
|
||||
extern void
|
||||
_eglDeleteDisplay(_EGLDisplay *disp);
|
||||
_eglCleanupDisplay(_EGLDisplay *disp);
|
||||
|
||||
|
||||
extern EGLBoolean
|
||||
_eglQueryDisplayMESA(_EGLDriver *drv, EGLDisplay dpy, EGLint attrib, EGLint *value);
|
||||
|
||||
|
||||
|
||||
#endif /* EGLDISPLAY_INCLUDED */
|
||||
|
@@ -12,7 +12,7 @@
|
||||
#include "eglsurface.h"
|
||||
|
||||
|
||||
const char *DefaultDriverName = "demo";
|
||||
const char *DefaultDriverName = "demodriver";
|
||||
|
||||
|
||||
/**
|
||||
@@ -75,7 +75,7 @@ _eglOpenDriver(_EGLDisplay *dpy, const char *driverName)
|
||||
char driverFilename[1000];
|
||||
|
||||
/* XXX also prepend a directory path??? */
|
||||
sprintf(driverFilename, "%sdriver.so", driverName);
|
||||
sprintf(driverFilename, "%s.so", driverName);
|
||||
|
||||
#if 1
|
||||
lib = dlopen(driverFilename, RTLD_NOW);
|
||||
@@ -192,9 +192,28 @@ _eglInitDriverFallbacks(_EGLDriver *drv)
|
||||
drv->QueryScreenMESA = _eglQueryScreenMESA;
|
||||
drv->QueryScreenSurfaceMESA = _eglQueryScreenSurfaceMESA;
|
||||
drv->QueryScreenModeMESA = _eglQueryScreenModeMESA;
|
||||
drv->QueryModeStringMESA = _eglQueryModeStringMESA;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Examine the individual extension enable/disable flags and recompute
|
||||
* the driver's Extensions string.
|
||||
*/
|
||||
static void
|
||||
UpdateExtensionsString(_EGLDriver *drv)
|
||||
{
|
||||
drv->Extensions[0] = 0;
|
||||
|
||||
if (drv->MESA_screen_surface)
|
||||
strcat(drv->Extensions, "EGL_MESA_screen_surface ");
|
||||
if (drv->MESA_copy_context)
|
||||
strcat(drv->Extensions, "EGL_MESA_copy_context ");
|
||||
assert(strlen(drv->Extensions) < MAX_EXTENSIONS_LEN);
|
||||
}
|
||||
|
||||
|
||||
|
||||
const char *
|
||||
_eglQueryString(_EGLDriver *drv, EGLDisplay dpy, EGLint name)
|
||||
{
|
||||
@@ -206,7 +225,8 @@ _eglQueryString(_EGLDriver *drv, EGLDisplay dpy, EGLint name)
|
||||
case EGL_VERSION:
|
||||
return "1.0";
|
||||
case EGL_EXTENSIONS:
|
||||
return "";
|
||||
UpdateExtensionsString(drv);
|
||||
return drv->Extensions;
|
||||
default:
|
||||
_eglError(EGL_BAD_PARAMETER, "eglQueryString");
|
||||
return NULL;
|
||||
|
@@ -4,6 +4,9 @@
|
||||
|
||||
#include "egltypedefs.h"
|
||||
|
||||
/* should probably use a dynamic-lengh string, but this will do */
|
||||
#define MAX_EXTENSIONS_LEN 1000
|
||||
|
||||
|
||||
/* driver funcs */
|
||||
typedef EGLBoolean (*Initialize_t)(_EGLDriver *, EGLDisplay dpy, EGLint *major, EGLint *minor);
|
||||
@@ -43,14 +46,15 @@ typedef EGLBoolean (*WaitNative_t)(_EGLDriver *drv, EGLDisplay dpy, EGLint engin
|
||||
typedef EGLBoolean (*ChooseModeMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, const EGLint *attrib_list, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes);
|
||||
typedef EGLBoolean (*GetModesMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *modes, EGLint mode_size, EGLint *num_mode);
|
||||
typedef EGLBoolean (*GetModeAttribMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLModeMESA mode, EGLint attribute, EGLint *value);
|
||||
typedef EGLBoolean (*CopyContextMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLContext source, EGLContext dest, EGLint mask);
|
||||
typedef EGLBoolean (*GetScreensMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA *screens, EGLint max_screens, EGLint *num_screens);
|
||||
typedef EGLSurface (*CreateScreenSurfaceMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list);
|
||||
typedef EGLBoolean (*ShowSurfaceMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLSurface surface);
|
||||
typedef EGLBoolean (*ShowSurfaceMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLSurface surface, EGLModeMESA mode);
|
||||
typedef EGLBoolean (*ScreenPositionMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLint x, EGLint y);
|
||||
typedef EGLBoolean (*QueryScreenMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLint attribute, EGLint *value);
|
||||
typedef EGLBoolean (*QueryScreenSurfaceMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLSurface *surface);
|
||||
typedef EGLBoolean (*QueryScreenModeMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *mode);
|
||||
|
||||
typedef const char * (*QueryModeStringMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLModeMESA mode);
|
||||
|
||||
|
||||
/**
|
||||
@@ -102,6 +106,7 @@ struct _egl_driver
|
||||
ChooseModeMESA_t ChooseModeMESA;
|
||||
GetModesMESA_t GetModesMESA;
|
||||
GetModeAttribMESA_t GetModeAttribMESA;
|
||||
CopyContextMESA_t CopyContextMESA;
|
||||
GetScreensMESA_t GetScreensMESA;
|
||||
CreateScreenSurfaceMESA_t CreateScreenSurfaceMESA;
|
||||
ShowSurfaceMESA_t ShowSurfaceMESA;
|
||||
@@ -109,6 +114,14 @@ struct _egl_driver
|
||||
QueryScreenMESA_t QueryScreenMESA;
|
||||
QueryScreenSurfaceMESA_t QueryScreenSurfaceMESA;
|
||||
QueryScreenModeMESA_t QueryScreenModeMESA;
|
||||
QueryModeStringMESA_t QueryModeStringMESA;
|
||||
|
||||
/* Extension enable flags */
|
||||
EGLBoolean MESA_screen_surface;
|
||||
EGLBoolean MESA_copy_context;
|
||||
|
||||
/* Extensions string */
|
||||
char Extensions[MAX_EXTENSIONS_LEN];
|
||||
};
|
||||
|
||||
|
||||
|
@@ -1,5 +1,7 @@
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "egldisplay.h"
|
||||
#include "egldriver.h"
|
||||
#include "eglmode.h"
|
||||
@@ -10,6 +12,16 @@
|
||||
#define MIN2(A, B) (((A) < (B)) ? (A) : (B))
|
||||
|
||||
|
||||
static char *
|
||||
my_strdup(const char *s)
|
||||
{
|
||||
int l = strlen(s);
|
||||
char *s2 = malloc(l + 1);
|
||||
strcpy(s2, s);
|
||||
return s2;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Given an EGLModeMESA handle, return the corresponding _EGLMode object
|
||||
* or null if non-existant.
|
||||
@@ -44,7 +56,7 @@ _eglLookupMode(EGLDisplay dpy, EGLModeMESA mode)
|
||||
*/
|
||||
_EGLMode *
|
||||
_eglAddMode(_EGLScreen *screen, EGLint width, EGLint height,
|
||||
EGLint depth, EGLint refreshRate)
|
||||
EGLint refreshRate, const char *name)
|
||||
{
|
||||
EGLint n;
|
||||
_EGLMode *newModes;
|
||||
@@ -52,7 +64,6 @@ _eglAddMode(_EGLScreen *screen, EGLint width, EGLint height,
|
||||
assert(screen);
|
||||
assert(width > 0);
|
||||
assert(height > 0);
|
||||
assert(depth > 0);
|
||||
assert(refreshRate > 0);
|
||||
|
||||
n = screen->NumModes;
|
||||
@@ -62,9 +73,9 @@ _eglAddMode(_EGLScreen *screen, EGLint width, EGLint height,
|
||||
screen->Modes[n].Handle = n + 1;
|
||||
screen->Modes[n].Width = width;
|
||||
screen->Modes[n].Height = height;
|
||||
screen->Modes[n].Depth = depth;
|
||||
screen->Modes[n].RefreshRate = refreshRate;
|
||||
screen->Modes[n].Stereo = EGL_FALSE;
|
||||
screen->Modes[n].Name = my_strdup(name);
|
||||
screen->NumModes++;
|
||||
return screen->Modes + n;
|
||||
}
|
||||
@@ -176,3 +187,13 @@ _eglGetModeAttribMESA(_EGLDriver *drv, EGLDisplay dpy,
|
||||
}
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
const char *
|
||||
_eglQueryModeStringMESA(_EGLDriver *drv, EGLDisplay dpy, EGLModeMESA mode)
|
||||
{
|
||||
_EGLMode *m = _eglLookupMode(dpy, mode);
|
||||
return m->Name;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -11,9 +11,9 @@ struct _egl_mode
|
||||
{
|
||||
EGLModeMESA Handle; /* the public/opaque handle which names this mode */
|
||||
EGLint Width, Height; /* size in pixels */
|
||||
EGLint Depth; /* bits per pixel */
|
||||
EGLint RefreshRate; /* rate * 1000.0 */
|
||||
EGLBoolean Stereo;
|
||||
const char *Name;
|
||||
|
||||
/* Other possible attributes */
|
||||
/* interlaced */
|
||||
@@ -27,7 +27,7 @@ _eglLookupMode(EGLDisplay dpy, EGLModeMESA mode);
|
||||
|
||||
extern _EGLMode *
|
||||
_eglAddMode(_EGLScreen *screen, EGLint width, EGLint height,
|
||||
EGLint depth, EGLint refreshRate);
|
||||
EGLint refreshRate, const char *name);
|
||||
|
||||
|
||||
extern EGLBoolean
|
||||
@@ -46,5 +46,8 @@ _eglGetModeAttribMESA(_EGLDriver *drv, EGLDisplay dpy, EGLModeMESA mode,
|
||||
EGLint attribute, EGLint *value);
|
||||
|
||||
|
||||
extern const char *
|
||||
_eglQueryModeStringMESA(_EGLDriver *drv, EGLDisplay dpy, EGLModeMESA mode);
|
||||
|
||||
|
||||
#endif /* EGLMODE_INCLUDED */
|
||||
|
@@ -13,20 +13,24 @@
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "egldisplay.h"
|
||||
#include "eglglobals.h"
|
||||
#include "eglmode.h"
|
||||
#include "eglconfig.h"
|
||||
#include "eglsurface.h"
|
||||
#include "eglscreen.h"
|
||||
|
||||
|
||||
/**
|
||||
* Return a new _EGLScreen object.
|
||||
* Initialize an _EGLScreen object to default values.
|
||||
*/
|
||||
_EGLScreen *
|
||||
_eglNewScreen(void)
|
||||
void
|
||||
_eglInitScreen(_EGLScreen *screen)
|
||||
{
|
||||
return (_EGLScreen *) calloc(1, sizeof(_EGLScreen));
|
||||
/* just init to zero for now */
|
||||
memset(screen, 0, sizeof(_EGLScreen));
|
||||
}
|
||||
|
||||
|
||||
@@ -102,13 +106,14 @@ _eglGetScreensMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA *screens,
|
||||
|
||||
|
||||
/**
|
||||
* Create a drawing surface which can be directly displayed on a screen.
|
||||
* Initialize the given _EGLSurface object. Do error checking.
|
||||
* Assign it an EGLSurface handle and insert into hash table.
|
||||
* \return EGLSurface handle or EGL_NO_SURFACE if error.
|
||||
*/
|
||||
EGLSurface
|
||||
_eglCreateScreenSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config,
|
||||
const EGLint *attrib_list)
|
||||
_eglInitScreenSurface(_EGLSurface *surf, _EGLDriver *drv, EGLDisplay dpy,
|
||||
EGLConfig config, const EGLint *attrib_list)
|
||||
{
|
||||
_EGLSurface *surf;
|
||||
EGLint width = 0, height = 0;
|
||||
EGLint i;
|
||||
|
||||
@@ -132,11 +137,11 @@ _eglCreateScreenSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config,
|
||||
return EGL_NO_SURFACE;
|
||||
}
|
||||
|
||||
surf = (_EGLSurface *) malloc(sizeof(_EGLSurface));
|
||||
_eglInitSurface(surf);
|
||||
surf->Width = width;
|
||||
surf->Height = height;
|
||||
surf->Type = EGL_SCREEN_BIT_MESA;
|
||||
surf->Config = _eglLookupConfig(drv, dpy, config);
|
||||
|
||||
/* insert into hash table */
|
||||
_eglSaveSurface(surf);
|
||||
@@ -146,6 +151,25 @@ _eglCreateScreenSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config,
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create a drawing surface which can be directly displayed on a screen.
|
||||
*/
|
||||
EGLSurface
|
||||
_eglCreateScreenSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config,
|
||||
const EGLint *attrib_list)
|
||||
{
|
||||
_EGLSurface *surf;
|
||||
EGLSurface surface;
|
||||
|
||||
surf = (_EGLSurface *) malloc(sizeof(_EGLSurface));
|
||||
surface = _eglInitScreenSurface(surf, drv, dpy, config, attrib_list);
|
||||
if (surface == EGL_NO_SURFACE)
|
||||
free(surf);
|
||||
|
||||
return surface;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show the given surface on the named screen.
|
||||
* If surface is EGL_NO_SURFACE, disable the screen's output.
|
||||
@@ -155,31 +179,23 @@ _eglCreateScreenSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config,
|
||||
*/
|
||||
EGLBoolean
|
||||
_eglShowSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen,
|
||||
EGLSurface surface)
|
||||
EGLSurface surface, EGLModeMESA m)
|
||||
{
|
||||
_EGLScreen *scrn = _eglLookupScreen(dpy, screen);
|
||||
_EGLMode *mode;
|
||||
_EGLMode *mode = _eglLookupMode(dpy, m);
|
||||
|
||||
if (!scrn) {
|
||||
_eglError(EGL_BAD_SCREEN_MESA, "eglShowSurfaceMESA");
|
||||
return EGL_FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* XXX: Check if the surface's configuration is compatible with the
|
||||
* current screen mode.
|
||||
*/
|
||||
|
||||
mode = scrn->CurrentMode;
|
||||
if (mode == EGL_NO_MODE_MESA) {
|
||||
_eglError(EGL_BAD_MODE_MESA, "eglShowSurfaceMESA(no current mode)");
|
||||
if (!mode && (m != EGL_NO_MODE_MESA )) {
|
||||
_eglError(EGL_BAD_MODE_MESA, "eglShowSurfaceMESA");
|
||||
return EGL_FALSE;
|
||||
}
|
||||
|
||||
if (surface == EGL_NO_SURFACE) {
|
||||
scrn->CurrentSurface = NULL;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
_EGLSurface *surf = _eglLookupSurface(surface);
|
||||
if (!surf || surf->Type != EGL_SCREEN_BIT_MESA) {
|
||||
_eglError(EGL_BAD_SURFACE, "eglShowSurfaceMESA");
|
||||
@@ -192,8 +208,8 @@ _eglShowSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen,
|
||||
}
|
||||
|
||||
scrn->CurrentSurface = surf;
|
||||
scrn->CurrentMode = mode;
|
||||
}
|
||||
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
@@ -299,11 +315,20 @@ _eglQueryScreenMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen,
|
||||
}
|
||||
|
||||
|
||||
|
||||
void
|
||||
_eglDeleteScreen(_EGLScreen *scrn)
|
||||
_eglDestroyScreenModes(_EGLScreen *scrn)
|
||||
{
|
||||
free(scrn->Modes);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Default fallback routine - drivers should usually override this.
|
||||
*/
|
||||
void
|
||||
_eglDestroyScreen(_EGLScreen *scrn)
|
||||
{
|
||||
_eglDestroyScreenModes(scrn);
|
||||
free(scrn);
|
||||
}
|
||||
|
||||
|
@@ -19,8 +19,8 @@ struct _egl_screen
|
||||
};
|
||||
|
||||
|
||||
extern _EGLScreen *
|
||||
_eglNewScreen(void);
|
||||
extern void
|
||||
_eglInitScreen(_EGLScreen *screen);
|
||||
|
||||
|
||||
extern _EGLScreen *
|
||||
@@ -35,12 +35,16 @@ extern EGLBoolean
|
||||
_eglGetScreensMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA *screens, EGLint max_screens, EGLint *num_screens);
|
||||
|
||||
|
||||
extern EGLSurface
|
||||
_eglInitScreenSurface(_EGLSurface *surf, _EGLDriver *drv, EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list);
|
||||
|
||||
|
||||
extern EGLSurface
|
||||
_eglCreateScreenSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list);
|
||||
|
||||
|
||||
extern EGLBoolean
|
||||
_eglShowSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLSurface surface);
|
||||
_eglShowSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLSurface surface, EGLModeMESA mode);
|
||||
|
||||
|
||||
extern EGLBoolean
|
||||
@@ -69,7 +73,11 @@ _eglQueryScreenMESA(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLin
|
||||
|
||||
|
||||
extern void
|
||||
_eglDeleteScreen(_EGLScreen *scrn);
|
||||
_eglDestroyScreenModes(_EGLScreen *scrn);
|
||||
|
||||
|
||||
extern void
|
||||
_eglDestroyScreen(_EGLScreen *scrn);
|
||||
|
||||
|
||||
#endif /* EGLSCREEN_INCLUDED */
|
||||
|
@@ -126,6 +126,9 @@ _eglQuerySurface(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surf, EGLint attrib
|
||||
if (surface->Type == EGL_PBUFFER_BIT)
|
||||
*value = surface->MipmapLevel;
|
||||
return EGL_TRUE;
|
||||
case EGL_SURFACE_TYPE:
|
||||
*value = surface->Type;
|
||||
return EGL_TRUE;
|
||||
default:
|
||||
_eglError(EGL_BAD_ATTRIBUTE, "eglQuerySurface");
|
||||
return EGL_FALSE;
|
||||
@@ -244,3 +247,77 @@ _eglSwapInterval(_EGLDriver *drv, EGLDisplay dpy, EGLint interval)
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
** EGL Surface Utility Functions. This could be handy for device drivers.
|
||||
**/
|
||||
|
||||
|
||||
/**
|
||||
* Initialize the fields of the given _EGLSurface object from the other
|
||||
* parameters. Do error checking too. Allocate EGLSurface handle and
|
||||
* insert into hash table.
|
||||
* \return EGLSurface handle or EGL_NO_SURFACE if any error
|
||||
*/
|
||||
EGLSurface
|
||||
_eglInitPbufferSurface(_EGLSurface *surface, _EGLDriver *drv, EGLDisplay dpy,
|
||||
EGLConfig config, const EGLint *attrib_list)
|
||||
{
|
||||
_EGLConfig *conf;
|
||||
EGLint width = 0, height = 0, largest = 0;
|
||||
EGLint texFormat = 0, texTarget = 0, mipmapTex = 0;
|
||||
EGLint i;
|
||||
|
||||
conf = _eglLookupConfig(drv, dpy, config);
|
||||
if (!conf) {
|
||||
_eglError(EGL_BAD_CONFIG, "eglCreatePbufferSurface");
|
||||
return EGL_NO_SURFACE;
|
||||
}
|
||||
|
||||
for (i = 0; attrib_list && attrib_list[i] != EGL_NONE; i++) {
|
||||
switch (attrib_list[i]) {
|
||||
case EGL_WIDTH:
|
||||
width = attrib_list[++i];
|
||||
break;
|
||||
case EGL_HEIGHT:
|
||||
height = attrib_list[++i];
|
||||
break;
|
||||
case EGL_LARGEST_PBUFFER:
|
||||
largest = attrib_list[++i];
|
||||
break;
|
||||
case EGL_TEXTURE_FORMAT:
|
||||
texFormat = attrib_list[++i];
|
||||
break;
|
||||
case EGL_TEXTURE_TARGET:
|
||||
texTarget = attrib_list[++i];
|
||||
break;
|
||||
case EGL_MIPMAP_TEXTURE:
|
||||
mipmapTex = attrib_list[++i];
|
||||
break;
|
||||
default:
|
||||
_eglError(EGL_BAD_ATTRIBUTE, "eglCreatePbufferSurface");
|
||||
return EGL_NO_SURFACE;
|
||||
}
|
||||
}
|
||||
|
||||
if (width <= 0 || height <= 0) {
|
||||
_eglError(EGL_BAD_ATTRIBUTE, "eglCreatePbufferSurface(width or height)");
|
||||
return EGL_NO_SURFACE;
|
||||
}
|
||||
|
||||
surface->Config = conf;
|
||||
surface->Type = EGL_PBUFFER_BIT;
|
||||
surface->Width = width;
|
||||
surface->Height = height;
|
||||
surface->TextureFormat = texFormat;
|
||||
surface->TextureTarget = texTarget;
|
||||
surface->MipmapTexture = mipmapTex;
|
||||
surface->MipmapLevel = 0;
|
||||
surface->SwapInterval = 0;
|
||||
|
||||
/* insert into hash table */
|
||||
_eglSaveSurface(surface);
|
||||
assert(surface->Handle);
|
||||
|
||||
return surface->Handle;
|
||||
}
|
||||
|
@@ -93,4 +93,8 @@ _eglSwapInterval(_EGLDriver *drv, EGLDisplay dpy, EGLint interval);
|
||||
|
||||
|
||||
|
||||
extern EGLSurface
|
||||
_eglInitPbufferSurface(_EGLSurface *surface, _EGLDriver *drv, EGLDisplay dpy,
|
||||
EGLConfig config, const EGLint *attrib_list);
|
||||
|
||||
#endif /* EGLSURFACE_INCLUDED */
|
||||
|
@@ -1,82 +0,0 @@
|
||||
/nologo /W2 /GX- /ZI /Od /c /TP
|
||||
/I "../../../include"
|
||||
/I "./include"
|
||||
/I "./libnurbs/interface"
|
||||
/I "./libnurbs/internals"
|
||||
/I "./libnurbs/nurbtess"
|
||||
/D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS"
|
||||
/D "_USRDLL" /D "GLU_EXPORTS" /D "BUILD_GL32" /D "LIBRARYBUILD"
|
||||
/Fo"Debug/" /Fd"Debug/" /GZ
|
||||
libnurbs/interface/bezierEval.cc
|
||||
libnurbs/interface/bezierPatch.cc
|
||||
libnurbs/interface/bezierPatchMesh.cc
|
||||
libnurbs/interface/glcurveval.cc
|
||||
libnurbs/interface/glinterface.cc
|
||||
libnurbs/interface/glrenderer.cc
|
||||
libnurbs/interface/glsurfeval.cc
|
||||
libnurbs/interface/incurveeval.cc
|
||||
libnurbs/interface/insurfeval.cc
|
||||
libnurbs/internals/arc.cc
|
||||
libnurbs/internals/arcsorter.cc
|
||||
libnurbs/internals/arctess.cc
|
||||
libnurbs/internals/backend.cc
|
||||
libnurbs/internals/basiccrveval.cc
|
||||
libnurbs/internals/basicsurfeval.cc
|
||||
libnurbs/internals/bin.cc
|
||||
libnurbs/internals/bufpool.cc
|
||||
libnurbs/internals/cachingeval.cc
|
||||
libnurbs/internals/ccw.cc
|
||||
libnurbs/internals/coveandtiler.cc
|
||||
libnurbs/internals/curve.cc
|
||||
libnurbs/internals/curvelist.cc
|
||||
libnurbs/internals/curvesub.cc
|
||||
libnurbs/internals/dataTransform.cc
|
||||
libnurbs/internals/displaylist.cc
|
||||
libnurbs/internals/flist.cc
|
||||
libnurbs/internals/flistsorter.cc
|
||||
libnurbs/internals/hull.cc
|
||||
libnurbs/internals/intersect.cc
|
||||
libnurbs/internals/knotvector.cc
|
||||
libnurbs/internals/mapdesc.cc
|
||||
libnurbs/internals/mapdescv.cc
|
||||
libnurbs/internals/maplist.cc
|
||||
libnurbs/internals/mesher.cc
|
||||
libnurbs/internals/monoTriangulationBackend.cc
|
||||
libnurbs/internals/monotonizer.cc
|
||||
libnurbs/internals/mycode.cc
|
||||
libnurbs/internals/nurbsinterfac.cc
|
||||
libnurbs/internals/nurbstess.cc
|
||||
libnurbs/internals/patch.cc
|
||||
libnurbs/internals/patchlist.cc
|
||||
libnurbs/internals/quilt.cc
|
||||
libnurbs/internals/reader.cc
|
||||
libnurbs/internals/renderhints.cc
|
||||
libnurbs/internals/slicer.cc
|
||||
libnurbs/internals/sorter.cc
|
||||
libnurbs/internals/splitarcs.cc
|
||||
libnurbs/internals/subdivider.cc
|
||||
libnurbs/internals/tobezier.cc
|
||||
libnurbs/internals/trimline.cc
|
||||
libnurbs/internals/trimregion.cc
|
||||
libnurbs/internals/trimvertpool.cc
|
||||
libnurbs/internals/uarray.cc
|
||||
libnurbs/internals/varray.cc
|
||||
libnurbs/nurbtess/directedLine.cc
|
||||
libnurbs/nurbtess/gridWrap.cc
|
||||
libnurbs/nurbtess/monoChain.cc
|
||||
libnurbs/nurbtess/monoPolyPart.cc
|
||||
libnurbs/nurbtess/monoTriangulation.cc
|
||||
libnurbs/nurbtess/partitionX.cc
|
||||
libnurbs/nurbtess/partitionY.cc
|
||||
libnurbs/nurbtess/polyDBG.cc
|
||||
libnurbs/nurbtess/polyUtil.cc
|
||||
libnurbs/nurbtess/primitiveStream.cc
|
||||
libnurbs/nurbtess/quicksort.cc
|
||||
libnurbs/nurbtess/rectBlock.cc
|
||||
libnurbs/nurbtess/sampleComp.cc
|
||||
libnurbs/nurbtess/sampleCompBot.cc
|
||||
libnurbs/nurbtess/sampleCompRight.cc
|
||||
libnurbs/nurbtess/sampleCompTop.cc
|
||||
libnurbs/nurbtess/sampleMonoPoly.cc
|
||||
libnurbs/nurbtess/sampledLine.cc
|
||||
libnurbs/nurbtess/searchTree.cc
|
@@ -1,82 +0,0 @@
|
||||
/nologo /W2 /GX- /O2 /c /TP
|
||||
/I "../../../include"
|
||||
/I "./include"
|
||||
/I "./libnurbs/interface"
|
||||
/I "./libnurbs/internals"
|
||||
/I "./libnurbs/nurbtess"
|
||||
/D "WIN32" /D "_WINDOWS" /D "_MBCS"
|
||||
/D "_USRDLL" /D "GLU_EXPORTS" /D "BUILD_GL32" /D "LIBRARYBUILD"
|
||||
/Fo"Release/"
|
||||
libnurbs/interface/bezierEval.cc
|
||||
libnurbs/interface/bezierPatch.cc
|
||||
libnurbs/interface/bezierPatchMesh.cc
|
||||
libnurbs/interface/glcurveval.cc
|
||||
libnurbs/interface/glinterface.cc
|
||||
libnurbs/interface/glrenderer.cc
|
||||
libnurbs/interface/glsurfeval.cc
|
||||
libnurbs/interface/incurveeval.cc
|
||||
libnurbs/interface/insurfeval.cc
|
||||
libnurbs/internals/arc.cc
|
||||
libnurbs/internals/arcsorter.cc
|
||||
libnurbs/internals/arctess.cc
|
||||
libnurbs/internals/backend.cc
|
||||
libnurbs/internals/basiccrveval.cc
|
||||
libnurbs/internals/basicsurfeval.cc
|
||||
libnurbs/internals/bin.cc
|
||||
libnurbs/internals/bufpool.cc
|
||||
libnurbs/internals/cachingeval.cc
|
||||
libnurbs/internals/ccw.cc
|
||||
libnurbs/internals/coveandtiler.cc
|
||||
libnurbs/internals/curve.cc
|
||||
libnurbs/internals/curvelist.cc
|
||||
libnurbs/internals/curvesub.cc
|
||||
libnurbs/internals/dataTransform.cc
|
||||
libnurbs/internals/displaylist.cc
|
||||
libnurbs/internals/flist.cc
|
||||
libnurbs/internals/flistsorter.cc
|
||||
libnurbs/internals/hull.cc
|
||||
libnurbs/internals/intersect.cc
|
||||
libnurbs/internals/knotvector.cc
|
||||
libnurbs/internals/mapdesc.cc
|
||||
libnurbs/internals/mapdescv.cc
|
||||
libnurbs/internals/maplist.cc
|
||||
libnurbs/internals/mesher.cc
|
||||
libnurbs/internals/monoTriangulationBackend.cc
|
||||
libnurbs/internals/monotonizer.cc
|
||||
libnurbs/internals/mycode.cc
|
||||
libnurbs/internals/nurbsinterfac.cc
|
||||
libnurbs/internals/nurbstess.cc
|
||||
libnurbs/internals/patch.cc
|
||||
libnurbs/internals/patchlist.cc
|
||||
libnurbs/internals/quilt.cc
|
||||
libnurbs/internals/reader.cc
|
||||
libnurbs/internals/renderhints.cc
|
||||
libnurbs/internals/slicer.cc
|
||||
libnurbs/internals/sorter.cc
|
||||
libnurbs/internals/splitarcs.cc
|
||||
libnurbs/internals/subdivider.cc
|
||||
libnurbs/internals/tobezier.cc
|
||||
libnurbs/internals/trimline.cc
|
||||
libnurbs/internals/trimregion.cc
|
||||
libnurbs/internals/trimvertpool.cc
|
||||
libnurbs/internals/uarray.cc
|
||||
libnurbs/internals/varray.cc
|
||||
libnurbs/nurbtess/directedLine.cc
|
||||
libnurbs/nurbtess/gridWrap.cc
|
||||
libnurbs/nurbtess/monoChain.cc
|
||||
libnurbs/nurbtess/monoPolyPart.cc
|
||||
libnurbs/nurbtess/monoTriangulation.cc
|
||||
libnurbs/nurbtess/partitionX.cc
|
||||
libnurbs/nurbtess/partitionY.cc
|
||||
libnurbs/nurbtess/polyDBG.cc
|
||||
libnurbs/nurbtess/polyUtil.cc
|
||||
libnurbs/nurbtess/primitiveStream.cc
|
||||
libnurbs/nurbtess/quicksort.cc
|
||||
libnurbs/nurbtess/rectBlock.cc
|
||||
libnurbs/nurbtess/sampleComp.cc
|
||||
libnurbs/nurbtess/sampleCompBot.cc
|
||||
libnurbs/nurbtess/sampleCompRight.cc
|
||||
libnurbs/nurbtess/sampleCompTop.cc
|
||||
libnurbs/nurbtess/sampleMonoPoly.cc
|
||||
libnurbs/nurbtess/sampledLine.cc
|
||||
libnurbs/nurbtess/searchTree.cc
|
@@ -1,888 +0,0 @@
|
||||
# Microsoft Developer Studio Project File - Name="glu" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
|
||||
|
||||
CFG=glu - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "glu.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "glu.mak" CFG="glu - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "glu - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "glu - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "glu - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "GLU_EXPORTS" /YX /FD /c
|
||||
# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../../include" /I "./include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "GLU_EXPORTS" /D "BUILD_GL32" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
|
||||
# ADD LINK32 msvcrt.lib winmm.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/OPENGL32.LIB Release/GLUCC.LIB /nologo /dll /machine:I386 /nodefaultlib /out:"Release/GLU32.DLL"
|
||||
# Begin Special Build Tool
|
||||
SOURCE="$(InputPath)"
|
||||
PreLink_Cmds=cl @ccRelease.txt LIB /OUT:Release/GLUCC.LIB @ccReleaseObj.txt
|
||||
PostBuild_Desc=Copy import lib and dll
|
||||
PostBuild_Cmds=if not exist ..\..\..\lib md ..\..\..\lib copy Release\GLU32.LIB ..\..\..\lib copy Release\GLU32.DLL ..\..\..\lib
|
||||
# End Special Build Tool
|
||||
|
||||
!ELSEIF "$(CFG)" == "glu - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "GLU_EXPORTS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../../include" /I "./include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "GLU_EXPORTS" /D "BUILD_GL32" /FR /YX /FD /GZ /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 msvcrtd.lib winmm.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/OPENGL32.LIB Debug/GLUCC.LIB /nologo /dll /debug /machine:I386 /nodefaultlib /out:"Debug/GLU32.DLL" /pdbtype:sept
|
||||
# Begin Special Build Tool
|
||||
SOURCE="$(InputPath)"
|
||||
PreLink_Desc=C++ compilations
|
||||
PreLink_Cmds=cl @ccDebug.txt LIB /OUT:Debug/GLUCC.LIB @ccDebugObj.txt
|
||||
PostBuild_Desc=Copy import lib and dll
|
||||
PostBuild_Cmds=if not exist ..\..\..\lib md ..\..\..\lib copy Debug\GLU32.LIB ..\..\..\lib copy Debug\GLU32.DLL ..\..\..\lib
|
||||
# End Special Build Tool
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "glu - Win32 Release"
|
||||
# Name "glu - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\arc.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\arcsorter.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\arctess.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\backend.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\basiccrveval.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\basicsurfeval.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\interface\bezierEval.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\interface\bezierPatch.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\interface\bezierPatchMesh.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\bin.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\bufpool.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\cachingeval.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\ccw.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\coveandtiler.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\curve.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\curvelist.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\curvesub.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\dataTransform.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libtess\dict.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\nurbtess\directedLine.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\displaylist.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libutil\error.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\flist.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\flistsorter.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libtess\geom.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\interface\glcurveval.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\interface\glinterface.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\interface\glrenderer.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\interface\glsurfeval.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\glu.def
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libutil\glue.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\nurbtess\gridWrap.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\hull.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\interface\incurveeval.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\interface\insurfeval.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\intersect.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\knotvector.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\mapdesc.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\mapdescv.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\maplist.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libtess\memalloc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libtess\mesh.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\mesher.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libutil\mipmap.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\nurbtess\monoChain.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\nurbtess\monoPolyPart.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\monotonizer.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\nurbtess\monoTriangulation.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\monoTriangulationBackend.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\mycode.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libtess\normal.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\nurbsinterfac.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\nurbstess.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\nurbtess\partitionX.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\nurbtess\partitionY.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\patch.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\patchlist.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\nurbtess\polyDBG.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\nurbtess\polyUtil.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\nurbtess\primitiveStream.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libtess\priorityq.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libutil\project.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libutil\quad.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\nurbtess\quicksort.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\quilt.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\reader.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\nurbtess\rectBlock.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libutil\registry.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libtess\render.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\renderhints.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\nurbtess\sampleComp.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\nurbtess\sampleCompBot.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\nurbtess\sampleCompRight.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\nurbtess\sampleCompTop.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\nurbtess\sampledLine.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\nurbtess\sampleMonoPoly.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\nurbtess\searchTree.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\slicer.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\sorter.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\splitarcs.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\subdivider.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libtess\sweep.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libtess\tess.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libtess\tessmono.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\tobezier.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\trimline.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\trimregion.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\trimvertpool.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\uarray.cc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\varray.cc
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\arc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\arcsorter.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\arctess.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\backend.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\basiccrveval.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\basicsurfeval.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\bezierarc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\interface\bezierEval.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\interface\bezierPatch.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\interface\bezierPatchMesh.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\bin.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\bufpool.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\cachingeval.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\coveandtiler.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\curve.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\curvelist.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\dataTransform.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\defines.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\nurbtess\definitions.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\libtess\dict-list.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libtess\dict.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\nurbtess\directedLine.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\displaylist.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\displaymode.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\flist.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\flistsorter.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libtess\geom.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\interface\glcurveval.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\interface\glimports.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\nurbtess\glimports.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\interface\glrenderer.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\interface\glsurfeval.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libutil\gluint.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\include\gluos.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\gridline.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\gridtrimvertex.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\gridvertex.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\nurbtess\gridWrap.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\hull.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\jarcloc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\knotvector.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\mapdesc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\maplist.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libtess\memalloc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libtess\mesh.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\mesher.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\nurbtess\monoChain.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\nurbtess\monoPolyPart.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\monotonizer.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\nurbtess\monoTriangulation.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\myassert.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\mymath.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\mysetjmp.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\interface\mystdio.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\nurbtess\mystdio.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\interface\mystdlib.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\nurbtess\mystdlib.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\mystring.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libtess\normal.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\nurbsconsts.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\nurbstess.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\nurbtess\partitionX.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\nurbtess\partitionY.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\patch.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\patchlist.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\nurbtess\polyDBG.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\nurbtess\polyUtil.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\nurbtess\primitiveStream.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\libtess\priorityq-sort.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libtess\priorityq.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\pwlarc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\nurbtess\quicksort.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\quilt.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\reader.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\nurbtess\rectBlock.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libtess\render.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\renderhints.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\nurbtess\sampleComp.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\nurbtess\sampleCompBot.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\nurbtess\sampleCompRight.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\nurbtess\sampleCompTop.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\nurbtess\sampledLine.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\nurbtess\sampleMonoPoly.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\nurbtess\searchTree.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\simplemath.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\slicer.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\sorter.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\subdivider.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libtess\sweep.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libtess\tess.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libtess\tessmono.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\trimline.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\trimregion.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\trimvertex.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\trimvertpool.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\types.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\uarray.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\internals\varray.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\libnurbs\nurbtess\zlassert.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
# End Group
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ccDebug.txt
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ccDebugObj.txt
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ccRelease.txt
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ccReleaseObj.txt
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
@@ -1169,15 +1169,15 @@ static void halveImage_float(GLint components, GLuint width, GLuint height,
|
||||
for (i = 0; i < newheight; i++) {
|
||||
for (j = 0; j < newwidth; j++) {
|
||||
for (k = 0; k < components; k++) {
|
||||
GLuint b;
|
||||
b = __GLU_SWAP_4_BYTES(t);
|
||||
s[0] = *(GLfloat*)&b;
|
||||
b = __GLU_SWAP_4_BYTES(t+group_size);
|
||||
s[0] += *(GLfloat*)&b;
|
||||
b = __GLU_SWAP_4_BYTES(t+ysize);
|
||||
s[0] += *(GLfloat*)&b;
|
||||
b = __GLU_SWAP_4_BYTES(t+ysize+group_size);
|
||||
s[0] += *(GLfloat*)&b;
|
||||
union { GLuint b; GLfloat f; } swapbuf;
|
||||
swapbuf.b = __GLU_SWAP_4_BYTES(t);
|
||||
s[0] = swapbuf.f;
|
||||
swapbuf.b = __GLU_SWAP_4_BYTES(t+group_size);
|
||||
s[0] += swapbuf.f;
|
||||
swapbuf.b = __GLU_SWAP_4_BYTES(t+ysize);
|
||||
s[0] += swapbuf.f;
|
||||
swapbuf.b = __GLU_SWAP_4_BYTES(t+ysize+group_size);
|
||||
s[0] += swapbuf.f;
|
||||
s[0] /= 4;
|
||||
s++; t += element_size;
|
||||
}
|
||||
@@ -2980,7 +2980,7 @@ static void scale_internal_float(GLint components, GLint widthin,
|
||||
int l, m;
|
||||
const char *left, *right;
|
||||
|
||||
GLuint swapbuf; /* unsigned buffer */
|
||||
union { GLuint b; GLfloat f; } swapbuf;
|
||||
|
||||
if (widthin == widthout*2 && heightin == heightout*2) {
|
||||
halveImage_float(components, widthin, heightin,
|
||||
@@ -3029,8 +3029,8 @@ static void scale_internal_float(GLint components, GLint widthin,
|
||||
for (k = 0, temp_index = temp; k < components;
|
||||
k++, temp_index += element_size) {
|
||||
if (myswap_bytes) {
|
||||
swapbuf = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += *(const GLfloat*)&swapbuf * percent;
|
||||
swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += swapbuf.f * percent;
|
||||
} else {
|
||||
totals[k] += *(const GLfloat*)temp_index * percent;
|
||||
}
|
||||
@@ -3041,8 +3041,8 @@ static void scale_internal_float(GLint components, GLint widthin,
|
||||
for (k = 0, temp_index = temp; k < components;
|
||||
k++, temp_index += element_size) {
|
||||
if (myswap_bytes) {
|
||||
swapbuf = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += *(const GLfloat*)&swapbuf * y_percent;
|
||||
swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += swapbuf.f * y_percent;
|
||||
} else {
|
||||
totals[k] += *(const GLfloat*)temp_index * y_percent;
|
||||
}
|
||||
@@ -3054,8 +3054,8 @@ static void scale_internal_float(GLint components, GLint widthin,
|
||||
for (k = 0, temp_index = temp; k < components;
|
||||
k++, temp_index += element_size) {
|
||||
if (myswap_bytes) {
|
||||
swapbuf = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += *(const GLfloat*)&swapbuf * percent;
|
||||
swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += swapbuf.f * percent;
|
||||
} else {
|
||||
totals[k] += *(const GLfloat*)temp_index * percent;
|
||||
}
|
||||
@@ -3068,8 +3068,8 @@ static void scale_internal_float(GLint components, GLint widthin,
|
||||
for (k = 0, temp_index = temp; k < components;
|
||||
k++, temp_index += element_size) {
|
||||
if (myswap_bytes) {
|
||||
swapbuf = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += *(const GLfloat*)&swapbuf * percent;
|
||||
swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += swapbuf.f * percent;
|
||||
} else {
|
||||
totals[k] += *(const GLfloat*)temp_index * percent;
|
||||
}
|
||||
@@ -3079,8 +3079,8 @@ static void scale_internal_float(GLint components, GLint widthin,
|
||||
for (k = 0, temp_index = temp; k < components;
|
||||
k++, temp_index += element_size) {
|
||||
if (myswap_bytes) {
|
||||
swapbuf = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += *(const GLfloat*)&swapbuf * y_percent;
|
||||
swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += swapbuf.f * y_percent;
|
||||
} else {
|
||||
totals[k] += *(const GLfloat*)temp_index * y_percent;
|
||||
}
|
||||
@@ -3091,8 +3091,8 @@ static void scale_internal_float(GLint components, GLint widthin,
|
||||
for (k = 0, temp_index = temp; k < components;
|
||||
k++, temp_index += element_size) {
|
||||
if (myswap_bytes) {
|
||||
swapbuf = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += *(const GLfloat*)&swapbuf * percent;
|
||||
swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += swapbuf.f * percent;
|
||||
} else {
|
||||
totals[k] += *(const GLfloat*)temp_index * percent;
|
||||
}
|
||||
@@ -3105,10 +3105,10 @@ static void scale_internal_float(GLint components, GLint widthin,
|
||||
for (k = 0; k < components;
|
||||
k++, left += element_size, right += element_size) {
|
||||
if (myswap_bytes) {
|
||||
swapbuf = __GLU_SWAP_4_BYTES(left);
|
||||
totals[k] += *(const GLfloat*)&swapbuf * (1-lowx_float);
|
||||
swapbuf = __GLU_SWAP_4_BYTES(right);
|
||||
totals[k] += *(const GLfloat*)&swapbuf * highx_float;
|
||||
swapbuf.b = __GLU_SWAP_4_BYTES(left);
|
||||
totals[k] += swapbuf.f * (1-lowx_float);
|
||||
swapbuf.b = __GLU_SWAP_4_BYTES(right);
|
||||
totals[k] += swapbuf.f * highx_float;
|
||||
} else {
|
||||
totals[k] += *(const GLfloat*)left * (1-lowx_float)
|
||||
+ *(const GLfloat*)right * highx_float;
|
||||
@@ -3122,8 +3122,8 @@ static void scale_internal_float(GLint components, GLint widthin,
|
||||
for (k = 0, temp_index = temp; k < components;
|
||||
k++, temp_index += element_size) {
|
||||
if (myswap_bytes) {
|
||||
swapbuf = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += *(const GLfloat*)&swapbuf * percent;
|
||||
swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += swapbuf.f * percent;
|
||||
} else {
|
||||
totals[k] += *(const GLfloat*)temp_index * percent;
|
||||
}
|
||||
@@ -3133,8 +3133,8 @@ static void scale_internal_float(GLint components, GLint widthin,
|
||||
for (k = 0, temp_index = temp; k < components;
|
||||
k++, temp_index += element_size) {
|
||||
if (myswap_bytes) {
|
||||
swapbuf = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += *(const GLfloat*)&swapbuf * x_percent;
|
||||
swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += swapbuf.f * x_percent;
|
||||
} else {
|
||||
totals[k] += *(const GLfloat*)temp_index * x_percent;
|
||||
}
|
||||
@@ -3145,8 +3145,8 @@ static void scale_internal_float(GLint components, GLint widthin,
|
||||
for (k = 0, temp_index = temp; k < components;
|
||||
k++, temp_index += element_size) {
|
||||
if (myswap_bytes) {
|
||||
swapbuf = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += *(const GLfloat*)&swapbuf * percent;
|
||||
swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += swapbuf.f * percent;
|
||||
} else {
|
||||
totals[k] += *(const GLfloat*)temp_index * percent;
|
||||
}
|
||||
@@ -3159,8 +3159,8 @@ static void scale_internal_float(GLint components, GLint widthin,
|
||||
for (k = 0, temp_index = temp; k < components;
|
||||
k++, temp_index += element_size) {
|
||||
if (myswap_bytes) {
|
||||
swapbuf = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += *(const GLfloat*)&swapbuf * percent;
|
||||
swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += swapbuf.f * percent;
|
||||
} else {
|
||||
totals[k] += *(const GLfloat*)temp_index * percent;
|
||||
}
|
||||
@@ -3170,8 +3170,8 @@ static void scale_internal_float(GLint components, GLint widthin,
|
||||
for (k = 0, temp_index = temp; k < components;
|
||||
k++, temp_index += element_size) {
|
||||
if (myswap_bytes) {
|
||||
swapbuf = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += *(const GLfloat*)&swapbuf * y_percent;
|
||||
swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += swapbuf.f * y_percent;
|
||||
} else {
|
||||
totals[k] += *(const GLfloat*)temp_index * y_percent;
|
||||
}
|
||||
@@ -3182,8 +3182,8 @@ static void scale_internal_float(GLint components, GLint widthin,
|
||||
for (k = 0, temp_index = temp; k < components;
|
||||
k++, temp_index += element_size) {
|
||||
if (myswap_bytes) {
|
||||
swapbuf = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += *(const GLfloat*)&swapbuf * percent;
|
||||
swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += swapbuf.f * percent;
|
||||
} else {
|
||||
totals[k] += *(const GLfloat*)temp_index * percent;
|
||||
}
|
||||
@@ -3194,8 +3194,8 @@ static void scale_internal_float(GLint components, GLint widthin,
|
||||
for (k = 0, temp_index = temp; k < components;
|
||||
k++, temp_index += element_size) {
|
||||
if (myswap_bytes) {
|
||||
swapbuf = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += *(const GLfloat*)&swapbuf * percent;
|
||||
swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += swapbuf.f * percent;
|
||||
} else {
|
||||
totals[k] += *(const GLfloat*)temp_index * percent;
|
||||
}
|
||||
@@ -3211,8 +3211,8 @@ static void scale_internal_float(GLint components, GLint widthin,
|
||||
for (k = 0, temp_index = temp; k < components;
|
||||
k++, temp_index += element_size) {
|
||||
if (myswap_bytes) {
|
||||
swapbuf = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += *(const GLfloat*)&swapbuf;
|
||||
swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += swapbuf.f;
|
||||
} else {
|
||||
totals[k] += *(const GLfloat*)temp_index;
|
||||
}
|
||||
@@ -7397,19 +7397,17 @@ static void closestFit3D(GLenum target, GLint width, GLint height, GLint depth,
|
||||
GLint depthAtLevelOne= (depthPowerOf2 > 1) ?
|
||||
depthPowerOf2 >> 1 :
|
||||
depthPowerOf2;
|
||||
GLenum proxyTarget;
|
||||
GLenum proxyTarget = GL_PROXY_TEXTURE_3D;
|
||||
assert(widthAtLevelOne > 0);
|
||||
assert(heightAtLevelOne > 0);
|
||||
assert(depthAtLevelOne > 0);
|
||||
|
||||
/* does width x height x depth at level 1 & all their mipmaps fit? */
|
||||
if (target == GL_TEXTURE_3D || target == GL_PROXY_TEXTURE_3D) {
|
||||
proxyTarget = GL_PROXY_TEXTURE_3D;
|
||||
gluTexImage3D(proxyTarget, 1, /* must be non-zero */
|
||||
internalFormat,
|
||||
widthAtLevelOne,heightAtLevelOne,depthAtLevelOne,
|
||||
0,format,type,NULL);
|
||||
}
|
||||
assert(target == GL_TEXTURE_3D || target == GL_PROXY_TEXTURE_3D);
|
||||
gluTexImage3D(proxyTarget, 1, /* must be non-zero */
|
||||
internalFormat,
|
||||
widthAtLevelOne,heightAtLevelOne,depthAtLevelOne,
|
||||
0,format,type,NULL);
|
||||
glGetTexLevelParameteriv(proxyTarget, 1,GL_TEXTURE_WIDTH,&proxyWidth);
|
||||
/* does it fit??? */
|
||||
if (proxyWidth == 0) { /* nope, so try again with these sizes */
|
||||
|
@@ -101,7 +101,7 @@ clean:
|
||||
-rm -f *.lo
|
||||
-rm -f *.la
|
||||
-rm -rf .libs
|
||||
-rm -rf depend
|
||||
-rm -rf depend depend.bak
|
||||
|
||||
|
||||
depend: $(SOURCES)
|
||||
|
@@ -61,7 +61,7 @@ getFullCrosshairCursor(void)
|
||||
Atom crosshairAtom, actualType;
|
||||
int rc, actualFormat;
|
||||
unsigned long n, left;
|
||||
unsigned long *value;
|
||||
unsigned char *value;
|
||||
|
||||
if (fullCrosshairCusor == None) {
|
||||
crosshairAtom = XInternAtom(__glutDisplay,
|
||||
@@ -70,9 +70,9 @@ getFullCrosshairCursor(void)
|
||||
value = 0; /* Make compiler happy. */
|
||||
rc = XGetWindowProperty(__glutDisplay, __glutRoot,
|
||||
crosshairAtom, 0, 1, False, XA_CURSOR, &actualType,
|
||||
&actualFormat, &n, &left, (unsigned char **) &value);
|
||||
&actualFormat, &n, &left, &value);
|
||||
if (rc == Success && actualFormat == 32 && n >= 1) {
|
||||
cursor = value[0];
|
||||
cursor = ((unsigned long *)value)[0];
|
||||
XFree(value);
|
||||
return cursor;
|
||||
}
|
||||
|
@@ -27,7 +27,7 @@ default: $(LIB_DIR)/$(GLW_LIB_NAME)
|
||||
|
||||
|
||||
clean:
|
||||
-rm depend
|
||||
-rm depend depend.bak
|
||||
-rm -f *.o *~
|
||||
|
||||
|
||||
|
@@ -67,7 +67,7 @@ INCLUDES = -I. \
|
||||
-I$(TOP)/src/mesa/swrast_setup \
|
||||
-I$(TOP)/src/mesa/drivers/dri/common \
|
||||
-I$(DRM_SOURCE_PATH)/libdrm \
|
||||
-I$(DRM_SOURCE_PATH)/shared \
|
||||
-I$(DRM_SOURCE_PATH)/shared-core \
|
||||
$(X11_INCLUDES)
|
||||
|
||||
|
||||
|
@@ -68,6 +68,12 @@
|
||||
#include "dri_glx.h"
|
||||
#endif
|
||||
|
||||
#ifdef USE_XCB
|
||||
#include <X11/xcl.h>
|
||||
#include <X11/XCB/xcb.h>
|
||||
#include <X11/XCB/glx.h>
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#ifdef DEBUG
|
||||
@@ -1047,7 +1053,7 @@ static Bool AllocAndFetchScreenConfigs(Display *dpy, __GLXdisplayPrivate *priv)
|
||||
fb_req->glxCode = X_GLXGetFBConfigs;
|
||||
fb_req->screen = i;
|
||||
break;
|
||||
|
||||
|
||||
case 2:
|
||||
GetReqExtra(GLXVendorPrivateWithReply,
|
||||
sz_xGLXGetFBConfigsSGIXReq-sz_xGLXVendorPrivateWithReplyReq,vpreq);
|
||||
@@ -1349,10 +1355,17 @@ CARD8 __glXSetupForCommand(Display *dpy)
|
||||
GLubyte *__glXFlushRenderBuffer(__GLXcontext *ctx, GLubyte *pc)
|
||||
{
|
||||
Display * const dpy = ctx->currentDpy;
|
||||
#ifdef USE_XCB
|
||||
XCBConnection *c = XCBConnectionOfDisplay(dpy);
|
||||
#else
|
||||
xGLXRenderReq *req;
|
||||
#endif /* USE_XCB */
|
||||
const GLint size = pc - ctx->buf;
|
||||
|
||||
if ( (dpy != NULL) && (size > 0) ) {
|
||||
#ifdef USE_XCB
|
||||
XCBGlxRender(c, ctx->currentContextTag, size, (char *)ctx->buf);
|
||||
#else
|
||||
/* Send the entire buffer as an X request */
|
||||
LockDisplay(dpy);
|
||||
GetReq(GLXRender,req);
|
||||
@@ -1363,6 +1376,7 @@ GLubyte *__glXFlushRenderBuffer(__GLXcontext *ctx, GLubyte *pc)
|
||||
_XSend(dpy, (char *)ctx->buf, size);
|
||||
UnlockDisplay(dpy);
|
||||
SyncHandle();
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Reset pointer and return it */
|
||||
@@ -1392,8 +1406,12 @@ void __glXSendLargeChunk(__GLXcontext *gc, GLint requestNumber,
|
||||
const GLvoid * data, GLint dataLen)
|
||||
{
|
||||
Display *dpy = gc->currentDpy;
|
||||
#ifdef USE_XCB
|
||||
XCBConnection *c = XCBConnectionOfDisplay(dpy);
|
||||
XCBGlxRenderLarge(c, gc->currentContextTag, requestNumber, totalRequests, dataLen, data);
|
||||
#else
|
||||
xGLXRenderLargeReq *req;
|
||||
|
||||
|
||||
if ( requestNumber == 1 ) {
|
||||
LockDisplay(dpy);
|
||||
}
|
||||
@@ -1412,6 +1430,7 @@ void __glXSendLargeChunk(__GLXcontext *gc, GLint requestNumber,
|
||||
UnlockDisplay(dpy);
|
||||
SyncHandle();
|
||||
}
|
||||
#endif /* USE_XCB */
|
||||
}
|
||||
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -682,7 +682,7 @@ __GLapi * __glXNewIndirectAPI( void )
|
||||
glAPI->MultiDrawArraysEXT = __indirect_glMultiDrawArraysEXT;
|
||||
glAPI->MultiDrawElementsEXT = __indirect_glMultiDrawElementsEXT;
|
||||
|
||||
/* EXT_stencil_two_side */
|
||||
/* GL_EXT_stencil_two_side */
|
||||
|
||||
glAPI->ActiveStencilFaceEXT = __indirect_glActiveStencilFaceEXT;
|
||||
|
||||
|
@@ -146,6 +146,7 @@ osmesa-only: depend subdirs $(LIB_DIR)/$(OSMESA_LIB_NAME)
|
||||
|
||||
subdirs:
|
||||
@ (cd x86 ; $(MAKE))
|
||||
@ (cd x86-64 ; $(MAKE))
|
||||
|
||||
# Make the GL library
|
||||
$(LIB_DIR)/$(GL_LIB_NAME): $(STAND_ALONE_OBJECTS)
|
||||
@@ -219,9 +220,11 @@ tags:
|
||||
|
||||
clean:
|
||||
-rm -f */*.o
|
||||
-rm -f */*/*.o
|
||||
-rm -f depend depend.bak mesa.a
|
||||
-rm -f drivers/*/*.o
|
||||
(cd drivers/dri ; $(MAKE) clean)
|
||||
(cd x86 ; $(MAKE) clean)
|
||||
(cd x86-64 ; $(MAKE) clean)
|
||||
|
||||
include depend
|
||||
|
@@ -1,108 +0,0 @@
|
||||
# Microsoft Developer Studio Project File - Name="array_cache" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Static Library" 0x0104
|
||||
|
||||
CFG=array_cache - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "array_cache.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "array_cache.mak" CFG="array_cache - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "array_cache - Win32 Release" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "array_cache - Win32 Debug" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "array_cache - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /I "../" /I "../main" /I "../glapi" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo
|
||||
|
||||
!ELSEIF "$(CFG)" == "array_cache - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /I "../" /I "../main" /I "../glapi" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FR /YX /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "array_cache - Win32 Release"
|
||||
# Name "array_cache - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ac_context.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ac_import.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ac_context.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\acache.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
@@ -27,7 +27,9 @@
|
||||
#include "imports.h"
|
||||
#include "buffers.h"
|
||||
#include "context.h"
|
||||
#include "framebuffer.h"
|
||||
#include "program.h"
|
||||
#include "renderbuffer.h"
|
||||
#include "texcompress.h"
|
||||
#include "texformat.h"
|
||||
#include "teximage.h"
|
||||
@@ -38,6 +40,7 @@
|
||||
#endif
|
||||
#if FEATURE_EXT_framebuffer_object
|
||||
#include "fbobject.h"
|
||||
#include "texrender.h"
|
||||
#endif
|
||||
|
||||
#include "driverfuncs.h"
|
||||
@@ -62,7 +65,7 @@ _mesa_init_driver_functions(struct dd_function_table *driver)
|
||||
driver->GetString = NULL; /* REQUIRED! */
|
||||
driver->UpdateState = NULL; /* REQUIRED! */
|
||||
driver->GetBufferSize = NULL; /* REQUIRED! */
|
||||
driver->ResizeBuffers = _swrast_alloc_buffers;
|
||||
driver->ResizeBuffers = _mesa_resize_framebuffer;
|
||||
driver->Error = NULL;
|
||||
|
||||
driver->Finish = NULL;
|
||||
@@ -104,6 +107,7 @@ _mesa_init_driver_functions(struct dd_function_table *driver)
|
||||
driver->DeleteTexture = _mesa_delete_texture_object;
|
||||
driver->NewTextureImage = _mesa_new_texture_image;
|
||||
driver->FreeTexImageData = _mesa_free_texture_image_data;
|
||||
driver->TextureMemCpy = _mesa_memcpy;
|
||||
driver->IsTextureResident = NULL;
|
||||
driver->PrioritizeTexture = NULL;
|
||||
driver->ActiveTexture = NULL;
|
||||
@@ -134,7 +138,7 @@ _mesa_init_driver_functions(struct dd_function_table *driver)
|
||||
driver->ColorMaterial = NULL;
|
||||
driver->CullFace = NULL;
|
||||
driver->DrawBuffer = _swrast_DrawBuffer;
|
||||
driver->DrawBuffers = _swrast_DrawBuffers;
|
||||
driver->DrawBuffers = NULL; /***_swrast_DrawBuffers;***/
|
||||
driver->FrontFace = NULL;
|
||||
driver->DepthFunc = NULL;
|
||||
driver->DepthMask = NULL;
|
||||
@@ -200,7 +204,9 @@ _mesa_init_driver_functions(struct dd_function_table *driver)
|
||||
|
||||
#if FEATURE_EXT_framebuffer_object
|
||||
driver->NewFramebuffer = _mesa_new_framebuffer;
|
||||
driver->NewRenderbuffer = _mesa_new_renderbuffer;
|
||||
driver->NewRenderbuffer = _mesa_new_soft_renderbuffer;
|
||||
driver->RenderbufferTexture = _mesa_renderbuffer_texture;
|
||||
driver->FramebufferRenderbuffer = _mesa_framebuffer_renderbuffer;
|
||||
#endif
|
||||
|
||||
/* T&L stuff */
|
||||
|
@@ -278,7 +278,8 @@ read_rgba_pixels (const GLcontext *ctx,
|
||||
* Index
|
||||
***************************************************************************/
|
||||
static void
|
||||
write_index_span (const GLcontext *ctx, GLuint n, GLint x, GLint y,
|
||||
write_index_span (const GLcontext *ctx, struct gl_renderbuffer *rb,
|
||||
GLuint n, GLint x, GLint y,
|
||||
const GLuint index[], const GLubyte mask[])
|
||||
{
|
||||
const DMesaContext dmesa = (DMesaContext)ctx;
|
||||
@@ -302,7 +303,8 @@ write_index_span (const GLcontext *ctx, GLuint n, GLint x, GLint y,
|
||||
|
||||
|
||||
static void
|
||||
write_index8_span (const GLcontext *ctx, GLuint n, GLint x, GLint y,
|
||||
write_index8_span (const GLcontext *ctx, struct gl_renderbuffer *rb,
|
||||
GLuint n, GLint x, GLint y,
|
||||
const GLubyte index[], const GLubyte mask[])
|
||||
{
|
||||
const DMesaContext dmesa = (DMesaContext)ctx;
|
||||
@@ -326,7 +328,7 @@ write_index8_span (const GLcontext *ctx, GLuint n, GLint x, GLint y,
|
||||
|
||||
|
||||
static void
|
||||
write_mono_index_span (const GLcontext *ctx,
|
||||
write_mono_index_span (const GLcontext *ctx, struct gl_renderbuffer *rb,
|
||||
GLuint n, GLint x, GLint y,
|
||||
GLuint colorIndex, const GLubyte mask[])
|
||||
{
|
||||
@@ -351,8 +353,8 @@ write_mono_index_span (const GLcontext *ctx,
|
||||
|
||||
|
||||
static void
|
||||
read_index_span (const GLcontext *ctx, GLuint n, GLint x, GLint y,
|
||||
GLuint index[])
|
||||
read_index_span (const GLcontext *ctx, struct gl_renderbuffer *rb,
|
||||
GLuint n, GLint x, GLint y, GLuint index[])
|
||||
{
|
||||
const DMesaContext dmesa = (DMesaContext)ctx;
|
||||
GLuint i, offset;
|
||||
@@ -366,7 +368,7 @@ read_index_span (const GLcontext *ctx, GLuint n, GLint x, GLint y,
|
||||
|
||||
|
||||
static void
|
||||
write_index_pixels (const GLcontext *ctx,
|
||||
write_index_pixels (const GLcontext *ctx, struct gl_renderbuffer *rb,
|
||||
GLuint n, const GLint x[], const GLint y[],
|
||||
const GLuint index[], const GLubyte mask[])
|
||||
{
|
||||
@@ -390,7 +392,7 @@ write_index_pixels (const GLcontext *ctx,
|
||||
|
||||
|
||||
static void
|
||||
write_mono_index_pixels (const GLcontext *ctx,
|
||||
write_mono_index_pixels (const GLcontext *ctx, struct gl_renderbuffer *rb,
|
||||
GLuint n, const GLint x[], const GLint y[],
|
||||
GLuint colorIndex, const GLubyte mask[])
|
||||
{
|
||||
@@ -414,9 +416,9 @@ write_mono_index_pixels (const GLcontext *ctx,
|
||||
|
||||
|
||||
static void
|
||||
read_index_pixels (const GLcontext *ctx,
|
||||
read_index_pixels (const GLcontext *ctx, struct gl_renderbuffer *rb,
|
||||
GLuint n, const GLint x[], const GLint y[],
|
||||
GLuint index[], const GLubyte mask[])
|
||||
GLuint index[], const GLubyte mask[])
|
||||
{
|
||||
const DMesaContext dmesa = (DMesaContext)ctx;
|
||||
GLuint i, _w_ = DSTRIDE, _b_ = dmesa->buffer->height - 1;
|
||||
|
@@ -2,11 +2,21 @@
|
||||
|
||||
MESA_MODULES = $(TOP)/src/mesa/mesa.a
|
||||
|
||||
COMMON_SOURCES = \
|
||||
../../common/driverfuncs.c \
|
||||
../common/mm.c \
|
||||
../common/utils.c \
|
||||
../common/texmem.c \
|
||||
../common/vblank.c \
|
||||
../common/dri_util.c \
|
||||
../common/xmlconfig.c \
|
||||
../common/drirenderbuffer.c \
|
||||
../common/glcontextmodes.c
|
||||
|
||||
ifeq ($(WINDOW_SYSTEM),dri)
|
||||
WINOBJ=../dri_client/dri.a
|
||||
WINLIB=
|
||||
INCLUDES = $(SHARED_INCLUDES) \
|
||||
INCLUDES = $(SHARED_INCLUDES) $(EXPAT_INCLUDES) \
|
||||
-I../dri_client \
|
||||
-I../dri_client/imports
|
||||
|
||||
@@ -46,7 +56,8 @@ SHARED_INCLUDES = \
|
||||
-I$(TOP)/src/mesa/transform \
|
||||
-I$(TOP)/src/mesa/shader \
|
||||
-I$(TOP)/src/mesa/swrast \
|
||||
-I$(TOP)/src/mesa/swrast_setup
|
||||
-I$(TOP)/src/mesa/swrast_setup \
|
||||
-I$(TOP)/src/egl/main
|
||||
|
||||
##### RULES #####
|
||||
|
||||
|
@@ -1,4 +1,11 @@
|
||||
/* $XFree86: xc/lib/GL/mesa/src/drv/common/depthtmp.h,v 1.5 2001/03/21 16:14:20 dawes Exp $ */
|
||||
|
||||
/*
|
||||
* Notes:
|
||||
* 1. These functions plug into the gl_renderbuffer structure.
|
||||
* 2. The 'values' parameter always points to GLuint values, regardless of
|
||||
* the actual Z buffer depth.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef DBG
|
||||
#define DBG 0
|
||||
@@ -20,12 +27,14 @@
|
||||
#endif
|
||||
|
||||
static void TAG(WriteDepthSpan)( GLcontext *ctx,
|
||||
GLuint n, GLint x, GLint y,
|
||||
const GLdepth *depth,
|
||||
struct gl_renderbuffer *rb,
|
||||
GLuint n, GLint x, GLint y,
|
||||
const void *values,
|
||||
const GLubyte mask[] )
|
||||
{
|
||||
HW_WRITE_LOCK()
|
||||
{
|
||||
const GLuint *depth = (const GLuint *) values;
|
||||
GLint x1;
|
||||
GLint n1;
|
||||
LOCAL_DEPTH_VARS;
|
||||
@@ -64,14 +73,31 @@ static void TAG(WriteDepthSpan)( GLcontext *ctx,
|
||||
HW_WRITE_UNLOCK();
|
||||
}
|
||||
|
||||
#if !HAVE_HW_DEPTH_SPANS
|
||||
|
||||
#if HAVE_HW_DEPTH_SPANS
|
||||
/* implement MonoWriteDepthSpan() in terms of WriteDepthSpan() */
|
||||
static void
|
||||
TAG(WriteMonoDepthSpan)( GLcontext *ctx, struct gl_renderbuffer *rb,
|
||||
GLuint n, GLint x, GLint y,
|
||||
const void *value, const GLubyte mask[] )
|
||||
{
|
||||
const GLuint depthVal = *((GLuint *) value);
|
||||
GLuint depths[MAX_WIDTH];
|
||||
GLuint i;
|
||||
for (i = 0; i < n; i++)
|
||||
depths[i] = depthVal;
|
||||
TAG(WriteDepthSpan)(ctx, rb, n, x, y, depths, mask);
|
||||
}
|
||||
#else
|
||||
static void TAG(WriteMonoDepthSpan)( GLcontext *ctx,
|
||||
GLuint n, GLint x, GLint y,
|
||||
const GLdepth depth,
|
||||
const GLubyte mask[] )
|
||||
struct gl_renderbuffer *rb,
|
||||
GLuint n, GLint x, GLint y,
|
||||
const void *value,
|
||||
const GLubyte mask[] )
|
||||
{
|
||||
HW_WRITE_LOCK()
|
||||
{
|
||||
const GLuint depth = *((GLuint *) value);
|
||||
GLint x1;
|
||||
GLint n1;
|
||||
LOCAL_DEPTH_VARS;
|
||||
@@ -102,15 +128,18 @@ static void TAG(WriteMonoDepthSpan)( GLcontext *ctx,
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static void TAG(WriteDepthPixels)( GLcontext *ctx,
|
||||
struct gl_renderbuffer *rb,
|
||||
GLuint n,
|
||||
const GLint x[],
|
||||
const GLint y[],
|
||||
const GLdepth depth[],
|
||||
const void *values,
|
||||
const GLubyte mask[] )
|
||||
{
|
||||
HW_WRITE_LOCK()
|
||||
{
|
||||
const GLuint *depth = (const GLuint *) values;
|
||||
GLuint i;
|
||||
LOCAL_DEPTH_VARS;
|
||||
|
||||
@@ -123,8 +152,17 @@ static void TAG(WriteDepthPixels)( GLcontext *ctx,
|
||||
#else
|
||||
HW_CLIPLOOP()
|
||||
{
|
||||
for ( i = 0 ; i < n ; i++ ) {
|
||||
if ( mask[i] ) {
|
||||
if ( mask ) {
|
||||
for ( i = 0 ; i < n ; i++ ) {
|
||||
if ( mask[i] ) {
|
||||
const int fy = Y_FLIP( y[i] );
|
||||
if ( CLIPPIXEL( x[i], fy ) )
|
||||
WRITE_DEPTH( x[i], fy, depth[i] );
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
for ( i = 0 ; i < n ; i++ ) {
|
||||
const int fy = Y_FLIP( y[i] );
|
||||
if ( CLIPPIXEL( x[i], fy ) )
|
||||
WRITE_DEPTH( x[i], fy, depth[i] );
|
||||
@@ -141,11 +179,13 @@ static void TAG(WriteDepthPixels)( GLcontext *ctx,
|
||||
/* Read depth spans and pixels
|
||||
*/
|
||||
static void TAG(ReadDepthSpan)( GLcontext *ctx,
|
||||
struct gl_renderbuffer *rb,
|
||||
GLuint n, GLint x, GLint y,
|
||||
GLdepth depth[] )
|
||||
void *values )
|
||||
{
|
||||
HW_READ_LOCK()
|
||||
{
|
||||
GLuint *depth = (GLuint *) values;
|
||||
GLint x1, n1;
|
||||
LOCAL_DEPTH_VARS;
|
||||
|
||||
@@ -172,12 +212,15 @@ static void TAG(ReadDepthSpan)( GLcontext *ctx,
|
||||
HW_READ_UNLOCK();
|
||||
}
|
||||
|
||||
static void TAG(ReadDepthPixels)( GLcontext *ctx, GLuint n,
|
||||
static void TAG(ReadDepthPixels)( GLcontext *ctx,
|
||||
struct gl_renderbuffer *rb,
|
||||
GLuint n,
|
||||
const GLint x[], const GLint y[],
|
||||
GLdepth depth[] )
|
||||
void *values )
|
||||
{
|
||||
HW_READ_LOCK()
|
||||
{
|
||||
GLuint *depth = (GLuint *) values;
|
||||
GLuint i;
|
||||
LOCAL_DEPTH_VARS;
|
||||
|
||||
|
@@ -1290,6 +1290,7 @@ __driUtilCreateNewScreen(__DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
|
||||
psp->fbHeight = frame_buffer->height;
|
||||
psp->devPrivSize = frame_buffer->dev_priv_size;
|
||||
psp->pDevPriv = frame_buffer->dev_priv;
|
||||
psp->fbBPP = psp->fbStride * 8 / frame_buffer->width;
|
||||
|
||||
psp->fd = fd;
|
||||
|
||||
|
98
src/mesa/drivers/dri/common/drirenderbuffer.c
Normal file
98
src/mesa/drivers/dri/common/drirenderbuffer.c
Normal file
@@ -0,0 +1,98 @@
|
||||
|
||||
#include "mtypes.h"
|
||||
#include "drirenderbuffer.h"
|
||||
#include "renderbuffer.h"
|
||||
#include "imports.h"
|
||||
|
||||
|
||||
/**
|
||||
* This will get called when a window is resized.
|
||||
* Just update width, height and internal format fields for now.
|
||||
* There's usually no memory allocation above because the present
|
||||
* DRI drivers use statically-allocated full-screen buffers.
|
||||
*/
|
||||
static GLboolean
|
||||
driRenderbufferStorage(GLcontext *ctx, struct gl_renderbuffer *rb,
|
||||
GLenum internalFormat, GLuint width, GLuint height)
|
||||
{
|
||||
rb->Width = width;
|
||||
rb->Height = height;
|
||||
rb->InternalFormat = internalFormat;
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Allocate a new driRenderbuffer object.
|
||||
* Individual drivers are free to implement different versions of
|
||||
* this function.
|
||||
* \param format Either GL_RGBA, GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT24,
|
||||
* GL_DEPTH_COMPONENT32, or GL_STENCIL_INDEX8_EXT (for now).
|
||||
* \param cpp chars or bytes per pixel
|
||||
* \param offset start of buffer with respect to framebuffer address
|
||||
* \param pitch pixels per row
|
||||
*/
|
||||
driRenderbuffer *
|
||||
driNewRenderbuffer(GLenum format, GLint cpp, GLint offset, GLint pitch)
|
||||
{
|
||||
driRenderbuffer *drb;
|
||||
|
||||
assert(format == GL_RGBA ||
|
||||
format == GL_DEPTH_COMPONENT16 ||
|
||||
format == GL_DEPTH_COMPONENT24 ||
|
||||
format == GL_DEPTH_COMPONENT32 ||
|
||||
format == GL_STENCIL_INDEX8_EXT);
|
||||
|
||||
assert(cpp > 0);
|
||||
assert(pitch > 0);
|
||||
|
||||
drb = _mesa_calloc(sizeof(driRenderbuffer));
|
||||
if (drb) {
|
||||
const GLuint name = 0;
|
||||
|
||||
_mesa_init_renderbuffer(&drb->Base, name);
|
||||
|
||||
/* Make sure we're using a null-valued GetPointer routine */
|
||||
assert(drb->Base.GetPointer(NULL, &drb->Base, 0, 0) == NULL);
|
||||
|
||||
drb->Base.InternalFormat = format;
|
||||
|
||||
if (format == GL_RGBA) {
|
||||
/* Color */
|
||||
drb->Base._BaseFormat = GL_RGBA;
|
||||
drb->Base.DataType = GL_UNSIGNED_BYTE;
|
||||
}
|
||||
else if (format == GL_DEPTH_COMPONENT16) {
|
||||
/* Depth */
|
||||
drb->Base._BaseFormat = GL_DEPTH_COMPONENT;
|
||||
/* we always Get/Put 32-bit Z values */
|
||||
drb->Base.DataType = GL_UNSIGNED_INT;
|
||||
}
|
||||
else if (format == GL_DEPTH_COMPONENT24) {
|
||||
/* Depth */
|
||||
drb->Base._BaseFormat = GL_DEPTH_COMPONENT;
|
||||
/* we always Get/Put 32-bit Z values */
|
||||
drb->Base.DataType = GL_UNSIGNED_INT;
|
||||
}
|
||||
else {
|
||||
/* Stencil */
|
||||
ASSERT(format == GL_STENCIL_INDEX8);
|
||||
drb->Base._BaseFormat = GL_STENCIL_INDEX;
|
||||
drb->Base.DataType = GL_UNSIGNED_BYTE;
|
||||
}
|
||||
|
||||
/* XXX if we were allocating a user-created renderbuffer, we'd have
|
||||
* to fill in the ComponentSizes[] array too.
|
||||
*/
|
||||
|
||||
drb->Base.AllocStorage = driRenderbufferStorage;
|
||||
/* using default Delete function */
|
||||
|
||||
|
||||
/* DRI renderbuffer-specific fields: */
|
||||
drb->offset = offset;
|
||||
drb->pitch = pitch;
|
||||
drb->cpp = cpp;
|
||||
}
|
||||
return drb;
|
||||
}
|
39
src/mesa/drivers/dri/common/drirenderbuffer.h
Normal file
39
src/mesa/drivers/dri/common/drirenderbuffer.h
Normal file
@@ -0,0 +1,39 @@
|
||||
|
||||
/**
|
||||
* A driRenderbuffer is dervied from gl_renderbuffer.
|
||||
* It describes a color buffer (front or back), a depth buffer, or stencil
|
||||
* buffer etc.
|
||||
* Specific to DRI drivers are the offset and pitch fields.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef DRIRENDERBUFFER_H
|
||||
#define DRIRENDERBUFFER_H
|
||||
|
||||
#include "mtypes.h"
|
||||
|
||||
typedef struct {
|
||||
struct gl_renderbuffer Base;
|
||||
|
||||
/* Chars or bytes per pixel. If Z and Stencil are stored together this
|
||||
* will typically be 32 whether this a depth or stencil renderbuffer.
|
||||
*/
|
||||
GLint cpp;
|
||||
|
||||
/* Buffer position and pitch (row stride). Recall that for today's DRI
|
||||
* drivers, we have statically allocated color/depth/stencil buffers.
|
||||
* So this information describes the whole screen, not just a window.
|
||||
* To address pixels in a window, we need to know the window's position
|
||||
* and size with respect to the screen.
|
||||
*/
|
||||
GLint offset; /* in bytes */
|
||||
GLint pitch; /* in pixels */
|
||||
|
||||
} driRenderbuffer;
|
||||
|
||||
|
||||
driRenderbuffer *
|
||||
driNewRenderbuffer(GLenum format, GLint cpp, GLint offset, GLint pitch);
|
||||
|
||||
|
||||
#endif /* DRIRENDERBUFFER_H */
|
@@ -56,13 +56,14 @@
|
||||
#endif
|
||||
|
||||
|
||||
static void TAG(WriteRGBASpan)( const GLcontext *ctx,
|
||||
static void TAG(WriteRGBASpan)( GLcontext *ctx,
|
||||
struct gl_renderbuffer *rb,
|
||||
GLuint n, GLint x, GLint y,
|
||||
const GLubyte rgba[][4],
|
||||
const GLubyte mask[] )
|
||||
const void *values, const GLubyte mask[] )
|
||||
{
|
||||
HW_WRITE_LOCK()
|
||||
{
|
||||
const GLubyte (*rgba)[4] = (const GLubyte (*)[4]) values;
|
||||
GLint x1;
|
||||
GLint n1;
|
||||
LOCAL_VARS;
|
||||
@@ -98,13 +99,14 @@ static void TAG(WriteRGBASpan)( const GLcontext *ctx,
|
||||
HW_WRITE_UNLOCK();
|
||||
}
|
||||
|
||||
static void TAG(WriteRGBSpan)( const GLcontext *ctx,
|
||||
static void TAG(WriteRGBSpan)( GLcontext *ctx,
|
||||
struct gl_renderbuffer *rb,
|
||||
GLuint n, GLint x, GLint y,
|
||||
const GLubyte rgb[][3],
|
||||
const GLubyte mask[] )
|
||||
const void *values, const GLubyte mask[] )
|
||||
{
|
||||
HW_WRITE_LOCK()
|
||||
{
|
||||
const GLubyte (*rgb)[3] = (const GLubyte (*)[3]) values;
|
||||
GLint x1;
|
||||
GLint n1;
|
||||
LOCAL_VARS;
|
||||
@@ -136,15 +138,14 @@ static void TAG(WriteRGBSpan)( const GLcontext *ctx,
|
||||
HW_WRITE_UNLOCK();
|
||||
}
|
||||
|
||||
static void TAG(WriteRGBAPixels)( const GLcontext *ctx,
|
||||
GLuint n,
|
||||
const GLint x[],
|
||||
const GLint y[],
|
||||
const GLubyte rgba[][4],
|
||||
const GLubyte mask[] )
|
||||
static void TAG(WriteRGBAPixels)( GLcontext *ctx,
|
||||
struct gl_renderbuffer *rb,
|
||||
GLuint n, const GLint x[], const GLint y[],
|
||||
const void *values, const GLubyte mask[] )
|
||||
{
|
||||
HW_WRITE_LOCK()
|
||||
{
|
||||
const GLubyte (*rgba)[4] = (const GLubyte (*)[4]) values;
|
||||
GLuint i;
|
||||
LOCAL_VARS;
|
||||
|
||||
@@ -183,13 +184,15 @@ static void TAG(WriteRGBAPixels)( const GLcontext *ctx,
|
||||
}
|
||||
|
||||
|
||||
static void TAG(WriteMonoRGBASpan)( const GLcontext *ctx,
|
||||
static void TAG(WriteMonoRGBASpan)( GLcontext *ctx,
|
||||
struct gl_renderbuffer *rb,
|
||||
GLuint n, GLint x, GLint y,
|
||||
const GLchan color[4],
|
||||
const void *value,
|
||||
const GLubyte mask[] )
|
||||
{
|
||||
HW_WRITE_LOCK()
|
||||
{
|
||||
const GLubyte *color = (const GLubyte *) value;
|
||||
GLint x1;
|
||||
GLint n1;
|
||||
LOCAL_VARS;
|
||||
@@ -221,14 +224,16 @@ static void TAG(WriteMonoRGBASpan)( const GLcontext *ctx,
|
||||
}
|
||||
|
||||
|
||||
static void TAG(WriteMonoRGBAPixels)( const GLcontext *ctx,
|
||||
static void TAG(WriteMonoRGBAPixels)( GLcontext *ctx,
|
||||
struct gl_renderbuffer *rb,
|
||||
GLuint n,
|
||||
const GLint x[], const GLint y[],
|
||||
const GLchan color[],
|
||||
const GLubyte mask[] )
|
||||
const GLint x[], const GLint y[],
|
||||
const void *value,
|
||||
const GLubyte mask[] )
|
||||
{
|
||||
HW_WRITE_LOCK()
|
||||
{
|
||||
const GLubyte *color = (const GLubyte *) value;
|
||||
GLuint i;
|
||||
LOCAL_VARS;
|
||||
INIT_MONO_PIXEL(p, color);
|
||||
@@ -261,12 +266,14 @@ static void TAG(WriteMonoRGBAPixels)( const GLcontext *ctx,
|
||||
}
|
||||
|
||||
|
||||
static void TAG(ReadRGBASpan)( const GLcontext *ctx,
|
||||
static void TAG(ReadRGBASpan)( GLcontext *ctx,
|
||||
struct gl_renderbuffer *rb,
|
||||
GLuint n, GLint x, GLint y,
|
||||
GLubyte rgba[][4])
|
||||
void *values)
|
||||
{
|
||||
HW_READ_LOCK()
|
||||
{
|
||||
GLubyte (*rgba)[4] = (GLubyte (*)[4]) values;
|
||||
GLint x1,n1;
|
||||
LOCAL_VARS;
|
||||
|
||||
@@ -287,12 +294,15 @@ static void TAG(ReadRGBASpan)( const GLcontext *ctx,
|
||||
}
|
||||
|
||||
|
||||
static void TAG(ReadRGBAPixels)( const GLcontext *ctx,
|
||||
static void TAG(ReadRGBAPixels)( GLcontext *ctx,
|
||||
struct gl_renderbuffer *rb,
|
||||
GLuint n, const GLint x[], const GLint y[],
|
||||
GLubyte rgba[][4], const GLubyte mask[] )
|
||||
void *values )
|
||||
{
|
||||
HW_READ_LOCK()
|
||||
{
|
||||
GLubyte (*rgba)[4] = (GLubyte (*)[4]) values;
|
||||
const GLubyte *mask = NULL; /* remove someday */
|
||||
GLuint i;
|
||||
LOCAL_VARS;
|
||||
|
||||
|
@@ -145,13 +145,14 @@
|
||||
#include "x86/common_x86_asm.h"
|
||||
#endif
|
||||
|
||||
static void TAG(WriteRGBASpan)( const GLcontext *ctx,
|
||||
static void TAG(WriteRGBASpan)( GLcontext *ctx,
|
||||
struct gl_renderbuffer *rb,
|
||||
GLuint n, GLint x, GLint y,
|
||||
const GLubyte rgba[][4],
|
||||
const GLubyte mask[] )
|
||||
const void *values, const GLubyte mask[] )
|
||||
{
|
||||
HW_WRITE_LOCK()
|
||||
{
|
||||
const GLubyte (*rgba)[4] = (const GLubyte (*)[4]) values;
|
||||
GLint x1;
|
||||
GLint n1;
|
||||
LOCAL_VARS;
|
||||
@@ -187,13 +188,14 @@ static void TAG(WriteRGBASpan)( const GLcontext *ctx,
|
||||
HW_WRITE_UNLOCK();
|
||||
}
|
||||
|
||||
static void TAG(WriteRGBSpan)( const GLcontext *ctx,
|
||||
static void TAG(WriteRGBSpan)( GLcontext *ctx,
|
||||
struct gl_renderbuffer *rb,
|
||||
GLuint n, GLint x, GLint y,
|
||||
const GLubyte rgb[][3],
|
||||
const GLubyte mask[] )
|
||||
const void *values, const GLubyte mask[] )
|
||||
{
|
||||
HW_WRITE_LOCK()
|
||||
{
|
||||
const GLubyte (*rgb)[3] = (const GLubyte (*)[3]) values;
|
||||
GLint x1;
|
||||
GLint n1;
|
||||
LOCAL_VARS;
|
||||
@@ -225,15 +227,14 @@ static void TAG(WriteRGBSpan)( const GLcontext *ctx,
|
||||
HW_WRITE_UNLOCK();
|
||||
}
|
||||
|
||||
static void TAG(WriteRGBAPixels)( const GLcontext *ctx,
|
||||
GLuint n,
|
||||
const GLint x[],
|
||||
const GLint y[],
|
||||
const GLubyte rgba[][4],
|
||||
const GLubyte mask[] )
|
||||
static void TAG(WriteRGBAPixels)( GLcontext *ctx,
|
||||
struct gl_renderbuffer *rb,
|
||||
GLuint n, const GLint x[], const GLint y[],
|
||||
const void *values, const GLubyte mask[] )
|
||||
{
|
||||
HW_WRITE_LOCK()
|
||||
{
|
||||
const GLubyte (*rgba)[4] = (const GLubyte (*)[4]) values;
|
||||
GLint i;
|
||||
LOCAL_VARS;
|
||||
|
||||
@@ -272,13 +273,14 @@ static void TAG(WriteRGBAPixels)( const GLcontext *ctx,
|
||||
}
|
||||
|
||||
|
||||
static void TAG(WriteMonoRGBASpan)( const GLcontext *ctx,
|
||||
static void TAG(WriteMonoRGBASpan)( GLcontext *ctx,
|
||||
struct gl_renderbuffer *rb,
|
||||
GLuint n, GLint x, GLint y,
|
||||
const GLchan color[4],
|
||||
const GLubyte mask[] )
|
||||
const void *value, const GLubyte mask[] )
|
||||
{
|
||||
HW_WRITE_LOCK()
|
||||
{
|
||||
const GLubyte *color = (const GLubyte *) value;
|
||||
GLint x1;
|
||||
GLint n1;
|
||||
LOCAL_VARS;
|
||||
@@ -310,14 +312,16 @@ static void TAG(WriteMonoRGBASpan)( const GLcontext *ctx,
|
||||
}
|
||||
|
||||
|
||||
static void TAG(WriteMonoRGBAPixels)( const GLcontext *ctx,
|
||||
static void TAG(WriteMonoRGBAPixels)( GLcontext *ctx,
|
||||
struct gl_renderbuffer *rb,
|
||||
GLuint n,
|
||||
const GLint x[], const GLint y[],
|
||||
const GLchan color[],
|
||||
const void *value,
|
||||
const GLubyte mask[] )
|
||||
{
|
||||
HW_WRITE_LOCK()
|
||||
{
|
||||
const GLubyte *color = (const GLubyte *) value;
|
||||
GLint i;
|
||||
LOCAL_VARS;
|
||||
INIT_MONO_PIXEL(p, color);
|
||||
@@ -350,12 +354,13 @@ static void TAG(WriteMonoRGBAPixels)( const GLcontext *ctx,
|
||||
}
|
||||
|
||||
|
||||
static void TAG(ReadRGBASpan)( const GLcontext *ctx,
|
||||
GLuint n, GLint x, GLint y,
|
||||
GLubyte rgba[][4])
|
||||
static void TAG(ReadRGBASpan)( GLcontext *ctx,
|
||||
struct gl_renderbuffer *rb,
|
||||
GLuint n, GLint x, GLint y, void *values)
|
||||
{
|
||||
HW_READ_LOCK()
|
||||
{
|
||||
GLubyte (*rgba)[4] = (GLubyte (*)[4]) values;
|
||||
GLint x1,n1;
|
||||
LOCAL_VARS;
|
||||
|
||||
@@ -381,9 +386,9 @@ static void TAG(ReadRGBASpan)( const GLcontext *ctx,
|
||||
(SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV)) || \
|
||||
((SPANTMP_PIXEL_FMT == GL_RGB) && \
|
||||
(SPANTMP_PIXEL_TYPE == GL_UNSIGNED_SHORT_5_6_5)))
|
||||
static void TAG2(ReadRGBASpan,_MMX)( const GLcontext *ctx,
|
||||
GLuint n, GLint x, GLint y,
|
||||
GLubyte rgba[][4])
|
||||
static void TAG2(ReadRGBASpan,_MMX)( GLcontext *ctx,
|
||||
struct gl_renderbuffer *rb,
|
||||
GLuint n, GLint x, GLint y, void *values)
|
||||
{
|
||||
#ifndef USE_INNER_EMMS
|
||||
/* The EMMS instruction is directly in-lined here because using GCC's
|
||||
@@ -394,6 +399,7 @@ static void TAG2(ReadRGBASpan,_MMX)( const GLcontext *ctx,
|
||||
|
||||
HW_READ_LOCK()
|
||||
{
|
||||
GLubyte (*rgba)[4] = (GLubyte (*)[4]) values;
|
||||
GLint x1,n1;
|
||||
LOCAL_VARS;
|
||||
|
||||
@@ -429,12 +435,14 @@ static void TAG2(ReadRGBASpan,_MMX)( const GLcontext *ctx,
|
||||
#if defined(USE_SSE_ASM) && \
|
||||
(SPANTMP_PIXEL_FMT == GL_BGRA) && \
|
||||
(SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV)
|
||||
static void TAG2(ReadRGBASpan,_SSE2)( const GLcontext *ctx,
|
||||
GLuint n, GLint x, GLint y,
|
||||
GLubyte rgba[][4])
|
||||
static void TAG2(ReadRGBASpan,_SSE2)( GLcontext *ctx,
|
||||
struct gl_renderbuffer *rb,
|
||||
GLuint n, GLint x, GLint y,
|
||||
void *values)
|
||||
{
|
||||
HW_READ_LOCK()
|
||||
{
|
||||
GLubyte (*rgba)[4] = (GLubyte (*)[4]) values;
|
||||
GLint x1,n1;
|
||||
LOCAL_VARS;
|
||||
|
||||
@@ -461,9 +469,10 @@ static void TAG2(ReadRGBASpan,_SSE2)( const GLcontext *ctx,
|
||||
#if defined(USE_SSE_ASM) && \
|
||||
(SPANTMP_PIXEL_FMT == GL_BGRA) && \
|
||||
(SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV)
|
||||
static void TAG2(ReadRGBASpan,_SSE)( const GLcontext *ctx,
|
||||
GLuint n, GLint x, GLint y,
|
||||
GLubyte rgba[][4])
|
||||
static void TAG2(ReadRGBASpan,_SSE)( GLcontext *ctx,
|
||||
struct gl_renderbuffer *rb,
|
||||
GLuint n, GLint x, GLint y,
|
||||
void *values)
|
||||
{
|
||||
#ifndef USE_INNER_EMMS
|
||||
/* The EMMS instruction is directly in-lined here because using GCC's
|
||||
@@ -474,6 +483,7 @@ static void TAG2(ReadRGBASpan,_SSE)( const GLcontext *ctx,
|
||||
|
||||
HW_READ_LOCK()
|
||||
{
|
||||
GLubyte (*rgba)[4] = (GLubyte (*)[4]) values;
|
||||
GLint x1,n1;
|
||||
LOCAL_VARS;
|
||||
|
||||
@@ -501,12 +511,15 @@ static void TAG2(ReadRGBASpan,_SSE)( const GLcontext *ctx,
|
||||
#endif
|
||||
|
||||
|
||||
static void TAG(ReadRGBAPixels)( const GLcontext *ctx,
|
||||
static void TAG(ReadRGBAPixels)( GLcontext *ctx,
|
||||
struct gl_renderbuffer *rb,
|
||||
GLuint n, const GLint x[], const GLint y[],
|
||||
GLubyte rgba[][4], const GLubyte mask[] )
|
||||
void *values )
|
||||
{
|
||||
HW_READ_LOCK()
|
||||
{
|
||||
GLubyte (*rgba)[4] = (GLubyte (*)[4]) values;
|
||||
GLubyte *mask = NULL; /* remove someday */
|
||||
GLint i;
|
||||
LOCAL_VARS;
|
||||
|
||||
@@ -537,21 +550,21 @@ static void TAG(ReadRGBAPixels)( const GLcontext *ctx,
|
||||
HW_READ_UNLOCK();
|
||||
}
|
||||
|
||||
static void TAG(InitPointers)(struct swrast_device_driver *swdd)
|
||||
static void TAG(InitPointers)(struct gl_renderbuffer *rb)
|
||||
{
|
||||
swdd->WriteRGBASpan = TAG(WriteRGBASpan);
|
||||
swdd->WriteRGBSpan = TAG(WriteRGBSpan);
|
||||
swdd->WriteMonoRGBASpan = TAG(WriteMonoRGBASpan);
|
||||
swdd->WriteRGBAPixels = TAG(WriteRGBAPixels);
|
||||
swdd->WriteMonoRGBAPixels = TAG(WriteMonoRGBAPixels);
|
||||
swdd->ReadRGBAPixels = TAG(ReadRGBAPixels);
|
||||
rb->PutRow = TAG(WriteRGBASpan);
|
||||
rb->PutRowRGB = TAG(WriteRGBSpan);
|
||||
rb->PutMonoRow = TAG(WriteMonoRGBASpan);
|
||||
rb->PutValues = TAG(WriteRGBAPixels);
|
||||
rb->PutMonoValues = TAG(WriteMonoRGBAPixels);
|
||||
rb->GetValues = TAG(ReadRGBAPixels);
|
||||
|
||||
#if defined(USE_SSE_ASM) && \
|
||||
(SPANTMP_PIXEL_FMT == GL_BGRA) && \
|
||||
(SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV)
|
||||
if ( cpu_has_xmm2 ) {
|
||||
if (DBG) fprintf( stderr, "Using %s version of ReadRGBASpan\n", "SSE2" );
|
||||
swdd->ReadRGBASpan = TAG2(ReadRGBASpan, _SSE2);
|
||||
if (DBG) fprintf( stderr, "Using %s version of GetRow\n", "SSE2" );
|
||||
rb->GetRow = TAG2(ReadRGBASpan, _SSE2);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
@@ -559,8 +572,8 @@ static void TAG(InitPointers)(struct swrast_device_driver *swdd)
|
||||
(SPANTMP_PIXEL_FMT == GL_BGRA) && \
|
||||
(SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV)
|
||||
if ( cpu_has_xmm ) {
|
||||
if (DBG) fprintf( stderr, "Using %s version of ReadRGBASpan\n", "SSE" );
|
||||
swdd->ReadRGBASpan = TAG2(ReadRGBASpan, _SSE);
|
||||
if (DBG) fprintf( stderr, "Using %s version of GetRow\n", "SSE" );
|
||||
rb->GetRow = TAG2(ReadRGBASpan, _SSE);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
@@ -570,14 +583,14 @@ static void TAG(InitPointers)(struct swrast_device_driver *swdd)
|
||||
((SPANTMP_PIXEL_FMT == GL_RGB) && \
|
||||
(SPANTMP_PIXEL_TYPE == GL_UNSIGNED_SHORT_5_6_5)))
|
||||
if ( cpu_has_mmx ) {
|
||||
if (DBG) fprintf( stderr, "Using %s version of ReadRGBASpan\n", "MMX" );
|
||||
swdd->ReadRGBASpan = TAG2(ReadRGBASpan, _MMX);
|
||||
if (DBG) fprintf( stderr, "Using %s version of GetRow\n", "MMX" );
|
||||
rb->GetRow = TAG2(ReadRGBASpan, _MMX);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
if (DBG) fprintf( stderr, "Using %s version of ReadRGBASpan\n", "C" );
|
||||
swdd->ReadRGBASpan = TAG(ReadRGBASpan);
|
||||
if (DBG) fprintf( stderr, "Using %s version of GetRow\n", "C" );
|
||||
rb->GetRow = TAG(ReadRGBASpan);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -19,12 +19,13 @@
|
||||
#endif
|
||||
|
||||
static void TAG(WriteStencilSpan)( GLcontext *ctx,
|
||||
struct gl_renderbuffer *rb,
|
||||
GLuint n, GLint x, GLint y,
|
||||
const GLstencil *stencil,
|
||||
const GLubyte mask[] )
|
||||
const void *values, const GLubyte mask[] )
|
||||
{
|
||||
HW_WRITE_LOCK()
|
||||
{
|
||||
const GLubyte *stencil = (const GLubyte *) values;
|
||||
GLint x1;
|
||||
GLint n1;
|
||||
LOCAL_STENCIL_VARS;
|
||||
@@ -57,15 +58,57 @@ static void TAG(WriteStencilSpan)( GLcontext *ctx,
|
||||
}
|
||||
|
||||
|
||||
static void TAG(WriteStencilPixels)( GLcontext *ctx,
|
||||
GLuint n,
|
||||
const GLint x[],
|
||||
const GLint y[],
|
||||
const GLstencil stencil[],
|
||||
const GLubyte mask[] )
|
||||
static void TAG(WriteMonoStencilSpan)( GLcontext *ctx,
|
||||
struct gl_renderbuffer *rb,
|
||||
GLuint n, GLint x, GLint y,
|
||||
const void *value,
|
||||
const GLubyte mask[] )
|
||||
{
|
||||
HW_WRITE_LOCK()
|
||||
{
|
||||
const GLubyte stencil = *((const GLubyte *) value);
|
||||
GLint x1;
|
||||
GLint n1;
|
||||
LOCAL_STENCIL_VARS;
|
||||
|
||||
y = Y_FLIP(y);
|
||||
|
||||
HW_CLIPLOOP()
|
||||
{
|
||||
GLint i = 0;
|
||||
CLIPSPAN(x,y,n,x1,n1,i);
|
||||
|
||||
if (DBG) fprintf(stderr, "WriteStencilSpan %d..%d (x1 %d)\n",
|
||||
(int)i, (int)n1, (int)x1);
|
||||
|
||||
if (mask)
|
||||
{
|
||||
for (;n1>0;i++,x1++,n1--)
|
||||
if (mask[i])
|
||||
WRITE_STENCIL( x1, y, stencil );
|
||||
}
|
||||
else
|
||||
{
|
||||
for (;n1>0;i++,x1++,n1--)
|
||||
WRITE_STENCIL( x1, y, stencil );
|
||||
}
|
||||
}
|
||||
HW_ENDCLIPLOOP();
|
||||
}
|
||||
HW_WRITE_UNLOCK();
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void TAG(WriteStencilPixels)( GLcontext *ctx,
|
||||
struct gl_renderbuffer *rb,
|
||||
GLuint n,
|
||||
const GLint x[], const GLint y[],
|
||||
const void *values, const GLubyte mask[] )
|
||||
{
|
||||
HW_WRITE_LOCK()
|
||||
{
|
||||
const GLubyte *stencil = (const GLubyte *) values;
|
||||
GLuint i;
|
||||
LOCAL_STENCIL_VARS;
|
||||
|
||||
@@ -91,11 +134,13 @@ static void TAG(WriteStencilPixels)( GLcontext *ctx,
|
||||
/* Read stencil spans and pixels
|
||||
*/
|
||||
static void TAG(ReadStencilSpan)( GLcontext *ctx,
|
||||
struct gl_renderbuffer *rb,
|
||||
GLuint n, GLint x, GLint y,
|
||||
GLstencil stencil[])
|
||||
void *values)
|
||||
{
|
||||
HW_READ_LOCK()
|
||||
{
|
||||
GLubyte *stencil = (GLubyte *) values;
|
||||
GLint x1,n1;
|
||||
LOCAL_STENCIL_VARS;
|
||||
|
||||
@@ -115,12 +160,14 @@ static void TAG(ReadStencilSpan)( GLcontext *ctx,
|
||||
HW_READ_UNLOCK();
|
||||
}
|
||||
|
||||
static void TAG(ReadStencilPixels)( GLcontext *ctx, GLuint n,
|
||||
const GLint x[], const GLint y[],
|
||||
GLstencil stencil[] )
|
||||
static void TAG(ReadStencilPixels)( GLcontext *ctx,
|
||||
struct gl_renderbuffer *rb,
|
||||
GLuint n, const GLint x[], const GLint y[],
|
||||
void *values )
|
||||
{
|
||||
HW_READ_LOCK()
|
||||
{
|
||||
GLubyte *stencil = (GLubyte *) values;
|
||||
GLuint i;
|
||||
LOCAL_STENCIL_VARS;
|
||||
|
||||
|
@@ -19,7 +19,7 @@ OBJECTS = $(C_SOURCES:.c=.o)
|
||||
|
||||
INCLUDES = \
|
||||
-I$(TOP)/include \
|
||||
-I$(DRM_SOURCE_PATH)/shared \
|
||||
-I$(DRM_SOURCE_PATH)/shared-core \
|
||||
-I$(TOP)/include/GL/internal \
|
||||
-I$(TOP)/src/mesa \
|
||||
-I$(TOP)/src/mesa/main \
|
||||
|
@@ -5,18 +5,9 @@ include $(TOP)/configs/current
|
||||
|
||||
LIBNAME = fb_dri.so
|
||||
|
||||
COMMON_SOURCES = \
|
||||
../../common/driverfuncs.c \
|
||||
../common/mm.c \
|
||||
../common/utils.c \
|
||||
../common/texmem.c \
|
||||
../common/vblank.c \
|
||||
../common/dri_util.c \
|
||||
../common/xmlconfig.c \
|
||||
../common/glcontextmodes.c
|
||||
|
||||
DRIVER_SOURCES = \
|
||||
fb_dri.c
|
||||
fb_dri.c \
|
||||
fb_egl.c
|
||||
|
||||
C_SOURCES = \
|
||||
$(COMMON_SOURCES) \
|
||||
|
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 6.1
|
||||
* Version: 6.3
|
||||
*
|
||||
* Copyright (C) 1999-2004 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"),
|
||||
@@ -44,9 +44,12 @@
|
||||
#include "driver.h"
|
||||
#include "drm.h"
|
||||
#include "utils.h"
|
||||
#include "drirenderbuffer.h"
|
||||
|
||||
#include "buffers.h"
|
||||
#include "extensions.h"
|
||||
#include "framebuffer.h"
|
||||
#include "renderbuffer.h"
|
||||
#include "array_cache/acache.h"
|
||||
#include "swrast/swrast.h"
|
||||
#include "swrast_setup/swrast_setup.h"
|
||||
@@ -55,6 +58,7 @@
|
||||
#include "tnl/t_pipeline.h"
|
||||
#include "drivers/common/driverfuncs.h"
|
||||
|
||||
void fbSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis);
|
||||
|
||||
typedef struct {
|
||||
GLcontext *glCtx; /* Mesa context */
|
||||
@@ -67,26 +71,6 @@ typedef struct {
|
||||
|
||||
} fbContext, *fbContextPtr;
|
||||
|
||||
typedef struct {
|
||||
GLframebuffer *mesa_framebuffer;
|
||||
void *currentBuffer;
|
||||
void *frontBuffer;
|
||||
void *backBuffer;
|
||||
int currentPitch;
|
||||
} fbDrawable, *fbDrawablePtr;
|
||||
|
||||
typedef struct {
|
||||
unsigned long hFrameBuffer;
|
||||
int fbOrigin;
|
||||
int fbSize;
|
||||
int fbStride;
|
||||
int fbWidth;
|
||||
int fbHeight;
|
||||
int bpp;
|
||||
int drmFD;
|
||||
drmAddress fbMap;
|
||||
} fbDRI, *fbDRIPtr;
|
||||
|
||||
#define FB_CONTEXT(ctx) ((fbContextPtr)(ctx->DriverCtx))
|
||||
|
||||
#ifdef USE_NEW_INTERFACE
|
||||
@@ -139,39 +123,12 @@ viewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h)
|
||||
}
|
||||
|
||||
|
||||
/* specifies the buffer for swrast span rendering/reading */
|
||||
static void
|
||||
set_buffer( GLcontext *ctx, GLframebuffer *buffer, GLuint bufferBit )
|
||||
{
|
||||
fbContextPtr fbdevctx = FB_CONTEXT(ctx);
|
||||
__DRIdrawablePrivate *dPriv = fbdevctx->dri.drawable;
|
||||
fbDrawablePtr fbdrawable = (fbDrawablePtr)dPriv->driverPrivate;
|
||||
|
||||
/* What a twisted mess of private structs
|
||||
*/
|
||||
assert(buffer == fbdrawable->mesa_framebuffer);
|
||||
|
||||
|
||||
switch (bufferBit) {
|
||||
case DD_FRONT_LEFT_BIT:
|
||||
fbdrawable->currentBuffer = fbdrawable->frontBuffer;
|
||||
break;
|
||||
case DD_BACK_LEFT_BIT:
|
||||
fbdrawable->currentBuffer = fbdrawable->backBuffer;
|
||||
break;
|
||||
default:
|
||||
/* This happens a lot if the client renders to the frontbuffer */
|
||||
if (0) _mesa_problem(ctx, "bad bufferBit in set_buffer()");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
init_core_functions( struct dd_function_table *functions )
|
||||
{
|
||||
functions->GetString = get_string;
|
||||
functions->UpdateState = update_state;
|
||||
functions->ResizeBuffers = _swrast_alloc_buffers;
|
||||
functions->ResizeBuffers = _mesa_resize_framebuffer;
|
||||
functions->GetBufferSize = get_buffer_size;
|
||||
functions->Viewport = viewport;
|
||||
|
||||
@@ -185,101 +142,164 @@ init_core_functions( struct dd_function_table *functions )
|
||||
|
||||
/* 24-bit BGR */
|
||||
#define NAME(PREFIX) PREFIX##_B8G8R8
|
||||
#define FORMAT GL_RGBA8
|
||||
#define SPAN_VARS \
|
||||
const fbContextPtr fbdevctx = FB_CONTEXT(ctx); \
|
||||
__DRIdrawablePrivate *dPriv = fbdevctx->dri.drawable; \
|
||||
const fbDrawablePtr fbdrawable = (fbDrawablePtr)dPriv->driverPrivate;
|
||||
driRenderbuffer *drb = (driRenderbuffer *) rb;
|
||||
#define INIT_PIXEL_PTR(P, X, Y) \
|
||||
GLubyte *P = (GLubyte *)fbdrawable->currentBuffer + (Y) * fbdrawable->currentPitch + (X) * 3
|
||||
GLubyte *P = (GLubyte *)drb->Base.Data + (drb->Base.Height - (Y)) * drb->pitch + (X) * 3;
|
||||
#define INC_PIXEL_PTR(P) P += 3
|
||||
#define STORE_RGB_PIXEL(P, X, Y, R, G, B) \
|
||||
P[0] = B; P[1] = G; P[2] = R
|
||||
#define STORE_RGBA_PIXEL(P, X, Y, R, G, B, A) \
|
||||
P[0] = B; P[1] = G; P[2] = R
|
||||
#define FETCH_RGBA_PIXEL(R, G, B, A, P) \
|
||||
R = P[2]; G = P[1]; B = P[0]; A = CHAN_MAX
|
||||
#define STORE_PIXEL(DST, X, Y, VALUE) \
|
||||
DST[0] = VALUE[BCOMP]; \
|
||||
DST[1] = VALUE[GCOMP]; \
|
||||
DST[2] = VALUE[RCOMP]
|
||||
#define FETCH_PIXEL(DST, SRC) \
|
||||
DST[RCOMP] = SRC[2]; \
|
||||
DST[GCOMP] = SRC[1]; \
|
||||
DST[BCOMP] = SRC[0]; \
|
||||
DST[ACOMP] = 0xff
|
||||
|
||||
#include "swrast/s_spantemp.h"
|
||||
|
||||
|
||||
/* 32-bit BGRA */
|
||||
#define NAME(PREFIX) PREFIX##_B8G8R8A8
|
||||
#define FORMAT GL_RGBA8
|
||||
#define SPAN_VARS \
|
||||
const fbContextPtr fbdevctx = FB_CONTEXT(ctx); \
|
||||
__DRIdrawablePrivate *dPriv = fbdevctx->dri.drawable; \
|
||||
const fbDrawablePtr fbdrawable = (fbDrawablePtr)dPriv->driverPrivate;
|
||||
driRenderbuffer *drb = (driRenderbuffer *) rb;
|
||||
#define INIT_PIXEL_PTR(P, X, Y) \
|
||||
GLubyte *P = (GLubyte *)fbdrawable->currentBuffer + (Y) * fbdrawable->currentPitch + (X) * 4;
|
||||
GLubyte *P = (GLubyte *)drb->Base.Data + (drb->Base.Height - (Y)) * drb->pitch + (X) * 4;
|
||||
#define INC_PIXEL_PTR(P) P += 4
|
||||
#define STORE_RGB_PIXEL(P, X, Y, R, G, B) \
|
||||
P[0] = B; P[1] = G; P[2] = R; P[3] = 255
|
||||
#define STORE_RGBA_PIXEL(P, X, Y, R, G, B, A) \
|
||||
P[0] = B; P[1] = G; P[2] = R; P[3] = A
|
||||
#define FETCH_RGBA_PIXEL(R, G, B, A, P) \
|
||||
R = P[2]; G = P[1]; B = P[0]; A = P[3]
|
||||
#define STORE_PIXEL(DST, X, Y, VALUE) \
|
||||
DST[0] = VALUE[BCOMP]; \
|
||||
DST[1] = VALUE[GCOMP]; \
|
||||
DST[2] = VALUE[RCOMP]; \
|
||||
DST[3] = VALUE[ACOMP]
|
||||
#define STORE_PIXEL_RGB(DST, X, Y, VALUE) \
|
||||
DST[0] = VALUE[BCOMP]; \
|
||||
DST[1] = VALUE[GCOMP]; \
|
||||
DST[2] = VALUE[RCOMP]; \
|
||||
DST[3] = 0xff
|
||||
#define FETCH_PIXEL(DST, SRC) \
|
||||
DST[RCOMP] = SRC[2]; \
|
||||
DST[GCOMP] = SRC[1]; \
|
||||
DST[BCOMP] = SRC[0]; \
|
||||
DST[ACOMP] = SRC[3]
|
||||
|
||||
#include "swrast/s_spantemp.h"
|
||||
|
||||
|
||||
/* 16-bit BGR (XXX implement dithering someday) */
|
||||
#define NAME(PREFIX) PREFIX##_B5G6R5
|
||||
#define FORMAT GL_RGBA8
|
||||
#define SPAN_VARS \
|
||||
const fbContextPtr fbdevctx = FB_CONTEXT(ctx); \
|
||||
__DRIdrawablePrivate *dPriv = fbdevctx->dri.drawable; \
|
||||
const fbDrawablePtr fbdrawable = (fbDrawablePtr)dPriv->driverPrivate;
|
||||
driRenderbuffer *drb = (driRenderbuffer *) rb;
|
||||
#define INIT_PIXEL_PTR(P, X, Y) \
|
||||
GLushort *P = (GLushort *) ((char *)fbdrawable->currentBuffer + (Y) * fbdrawable->currentPitch + (X) * 2)
|
||||
GLushort *P = (GLushort *)drb->Base.Data + (drb->Base.Height - (Y)) * drb->pitch + (X) * 2;
|
||||
#define INC_PIXEL_PTR(P) P += 1
|
||||
#define STORE_RGB_PIXEL(P, X, Y, R, G, B) \
|
||||
*P = ( (((R) & 0xf8) << 8) | (((G) & 0xfc) << 3) | ((B) >> 3) )
|
||||
#define STORE_RGBA_PIXEL(P, X, Y, R, G, B, A) \
|
||||
*P = ( (((R) & 0xf8) << 8) | (((G) & 0xfc) << 3) | ((B) >> 3) )
|
||||
#define FETCH_RGBA_PIXEL(R, G, B, A, P) \
|
||||
R = ( (((*P) >> 8) & 0xf8) | (((*P) >> 11) & 0x7) ); \
|
||||
G = ( (((*P) >> 3) & 0xfc) | (((*P) >> 5) & 0x3) ); \
|
||||
B = ( (((*P) << 3) & 0xf8) | (((*P) ) & 0x7) ); \
|
||||
A = CHAN_MAX
|
||||
#define STORE_PIXEL(DST, X, Y, VALUE) \
|
||||
DST[0] = ( (((VALUE[RCOMP]) & 0xf8) << 8) | (((VALUE[GCOMP]) & 0xfc) << 3) | ((VALUE[BCOMP]) >> 3) )
|
||||
#define FETCH_PIXEL(DST, SRC) \
|
||||
DST[RCOMP] = ( (((SRC[0]) >> 8) & 0xf8) | (((SRC[0]) >> 11) & 0x7) ); \
|
||||
DST[GCOMP] = ( (((SRC[0]) >> 3) & 0xfc) | (((SRC[0]) >> 5) & 0x3) ); \
|
||||
DST[BCOMP] = ( (((SRC[0]) << 3) & 0xf8) | (((SRC[0]) ) & 0x7) ); \
|
||||
DST[ACOMP] = 0xff
|
||||
|
||||
#include "swrast/s_spantemp.h"
|
||||
|
||||
|
||||
/* 15-bit BGR (XXX implement dithering someday) */
|
||||
#define NAME(PREFIX) PREFIX##_B5G5R5
|
||||
#define FORMAT GL_RGBA8
|
||||
#define SPAN_VARS \
|
||||
const fbContextPtr fbdevctx = FB_CONTEXT(ctx); \
|
||||
__DRIdrawablePrivate *dPriv = fbdevctx->dri.drawable; \
|
||||
const fbDrawablePtr fbdrawable = (fbDrawablePtr)dPriv->driverPrivate;
|
||||
driRenderbuffer *drb = (driRenderbuffer *) rb;
|
||||
#define INIT_PIXEL_PTR(P, X, Y) \
|
||||
GLushort *P = (GLushort *) ((char *)fbdrawable->currentBuffer + (Y) * fbdrawable->currentPitch + (X) * 2)
|
||||
GLushort *P = (GLushort *)drb->Base.Data + (drb->Base.Height - (Y)) * drb->pitch + (X) * 2;
|
||||
#define INC_PIXEL_PTR(P) P += 1
|
||||
#define STORE_RGB_PIXEL(P, X, Y, R, G, B) \
|
||||
*P = ( (((R) & 0xf8) << 7) | (((G) & 0xf8) << 2) | ((B) >> 3) )
|
||||
#define STORE_RGBA_PIXEL(P, X, Y, R, G, B, A) \
|
||||
*P = ( (((R) & 0xf8) << 7) | (((G) & 0xf8) << 2) | ((B) >> 3) )
|
||||
#define FETCH_RGBA_PIXEL(R, G, B, A, P) \
|
||||
R = ( (((*P) >> 7) & 0xf8) | (((*P) >> 10) & 0x7) ); \
|
||||
G = ( (((*P) >> 2) & 0xf8) | (((*P) >> 5) & 0x7) ); \
|
||||
B = ( (((*P) << 3) & 0xf8) | (((*P) ) & 0x7) ); \
|
||||
A = CHAN_MAX
|
||||
#define STORE_PIXEL(DST, X, Y, VALUE) \
|
||||
DST[0] = ( (((VALUE[RCOMP]) & 0xf8) << 7) | (((VALUE[GCOMP]) & 0xf8) << 2) | ((VALUE[BCOMP]) >> 3) )
|
||||
#define FETCH_PIXEL(DST, SRC) \
|
||||
DST[RCOMP] = ( (((SRC[0]) >> 7) & 0xf8) | (((SRC[0]) >> 10) & 0x7) ); \
|
||||
DST[GCOMP] = ( (((SRC[0]) >> 2) & 0xf8) | (((SRC[0]) >> 5) & 0x7) ); \
|
||||
DST[BCOMP] = ( (((SRC[0]) << 3) & 0xf8) | (((SRC[0]) ) & 0x7) ); \
|
||||
DST[ACOMP] = 0xff
|
||||
|
||||
#include "swrast/s_spantemp.h"
|
||||
|
||||
|
||||
/* 8-bit color index */
|
||||
#define NAME(PREFIX) PREFIX##_CI8
|
||||
#define FORMAT GL_COLOR_INDEX8_EXT
|
||||
#define SPAN_VARS \
|
||||
const fbContextPtr fbdevctx = FB_CONTEXT(ctx); \
|
||||
__DRIdrawablePrivate *dPriv = fbdevctx->dri.drawable; \
|
||||
const fbDrawablePtr fbdrawable = (fbDrawablePtr)dPriv->driverPrivate;
|
||||
driRenderbuffer *drb = (driRenderbuffer *) rb;
|
||||
#define INIT_PIXEL_PTR(P, X, Y) \
|
||||
GLubyte *P = (GLubyte *)fbdrawable->currentBuffer + (Y) * fbdrawable->currentPitch + (X)
|
||||
GLubyte *P = (GLubyte *)drb->Base.Data + (drb->Base.Height - (Y)) * drb->pitch + (X);
|
||||
#define INC_PIXEL_PTR(P) P += 1
|
||||
#define STORE_CI_PIXEL(P, CI) \
|
||||
P[0] = CI
|
||||
#define FETCH_CI_PIXEL(CI, P) \
|
||||
CI = P[0]
|
||||
#define STORE_PIXEL(DST, X, Y, VALUE) \
|
||||
*DST = VALUE[0]
|
||||
#define FETCH_PIXEL(DST, SRC) \
|
||||
DST = SRC[0]
|
||||
|
||||
#include "swrast/s_spantemp.h"
|
||||
|
||||
|
||||
|
||||
void
|
||||
fbSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis)
|
||||
{
|
||||
ASSERT(drb->Base.InternalFormat == GL_RGBA);
|
||||
if (drb->Base.InternalFormat == GL_RGBA) {
|
||||
if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) {
|
||||
drb->Base.GetRow = get_row_B5G6R5;
|
||||
drb->Base.GetValues = get_values_B5G6R5;
|
||||
drb->Base.PutRow = put_row_B5G6R5;
|
||||
drb->Base.PutMonoRow = put_mono_row_B5G6R5;
|
||||
drb->Base.PutRowRGB = put_row_rgb_B5G6R5;
|
||||
drb->Base.PutValues = put_values_B5G6R5;
|
||||
drb->Base.PutMonoValues = put_mono_values_B5G6R5;
|
||||
}
|
||||
else if (vis->redBits == 5 && vis->greenBits == 5 && vis->blueBits == 5) {
|
||||
drb->Base.GetRow = get_row_B5G5R5;
|
||||
drb->Base.GetValues = get_values_B5G5R5;
|
||||
drb->Base.PutRow = put_row_B5G5R5;
|
||||
drb->Base.PutMonoRow = put_mono_row_B5G5R5;
|
||||
drb->Base.PutRowRGB = put_row_rgb_B5G5R5;
|
||||
drb->Base.PutValues = put_values_B5G5R5;
|
||||
drb->Base.PutMonoValues = put_mono_values_B5G5R5;
|
||||
}
|
||||
else if (vis->redBits == 8 && vis->greenBits == 8 && vis->blueBits == 8
|
||||
&& vis->alphaBits == 8) {
|
||||
drb->Base.GetRow = get_row_B8G8R8A8;
|
||||
drb->Base.GetValues = get_values_B8G8R8A8;
|
||||
drb->Base.PutRow = put_row_B8G8R8A8;
|
||||
drb->Base.PutMonoRow = put_mono_row_B8G8R8A8;
|
||||
drb->Base.PutRowRGB = put_row_rgb_B8G8R8A8;
|
||||
drb->Base.PutValues = put_values_B8G8R8A8;
|
||||
drb->Base.PutMonoValues = put_mono_values_B8G8R8A8;
|
||||
}
|
||||
else if (vis->redBits == 8 && vis->greenBits == 8 && vis->blueBits == 8
|
||||
&& vis->alphaBits == 0) {
|
||||
drb->Base.GetRow = get_row_B8G8R8;
|
||||
drb->Base.GetValues = get_values_B8G8R8;
|
||||
drb->Base.PutRow = put_row_B8G8R8;
|
||||
drb->Base.PutMonoRow = put_mono_row_B8G8R8;
|
||||
drb->Base.PutRowRGB = put_row_rgb_B8G8R8;
|
||||
drb->Base.PutValues = put_values_B8G8R8;
|
||||
drb->Base.PutMonoValues = put_mono_values_B8G8R8;
|
||||
}
|
||||
else if (vis->indexBits == 8) {
|
||||
drb->Base.GetRow = get_row_CI8;
|
||||
drb->Base.GetValues = get_values_CI8;
|
||||
drb->Base.PutRow = put_row_CI8;
|
||||
drb->Base.PutMonoRow = put_mono_row_CI8;
|
||||
drb->Base.PutValues = put_values_CI8;
|
||||
drb->Base.PutMonoValues = put_mono_values_CI8;
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* hardware z/stencil/etc someday */
|
||||
}
|
||||
}
|
||||
|
||||
#include "swrast/s_spantemp.h"
|
||||
|
||||
|
||||
/* Initialize the driver specific screen private data.
|
||||
@@ -287,41 +307,20 @@ init_core_functions( struct dd_function_table *functions )
|
||||
static GLboolean
|
||||
fbInitDriver( __DRIscreenPrivate *sPriv )
|
||||
{
|
||||
fbDRIPtr dri_priv = (fbDRIPtr)sPriv->pDevPriv;
|
||||
fbDRIPtr priv;
|
||||
int drmFD;
|
||||
|
||||
drmFD = drmOpen("radeon", NULL );
|
||||
if (drmFD < 0) {
|
||||
fprintf(stderr, "[drm] drmOpen failed\n");
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
priv = _mesa_malloc(sizeof(*priv));
|
||||
if (!priv)
|
||||
return GL_FALSE;
|
||||
|
||||
*priv = *dri_priv;
|
||||
|
||||
priv->drmFD = drmFD;
|
||||
if (drmMap(drmFD, priv->hFrameBuffer, priv->fbSize, &priv->fbMap) < 0) {
|
||||
fprintf(stderr, "[drm] drmMap framebuffer failed\n");
|
||||
free(priv);
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
sPriv->private = priv;
|
||||
sPriv->private = NULL;
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
fbDestroyScreen( __DRIscreenPrivate *sPriv )
|
||||
{
|
||||
fbDRIPtr priv = (fbDRIPtr)sPriv->private;
|
||||
|
||||
drmUnmap(priv->fbMap, priv->fbSize);
|
||||
drmClose(priv->drmFD);
|
||||
_mesa_free(priv);
|
||||
}
|
||||
|
||||
void fbSetBuffer( GLcontext *ctx,
|
||||
GLframebuffer *colorBuffer,
|
||||
GLuint bufferBit )
|
||||
{
|
||||
/* NOP until SetBuffer is fully removed */
|
||||
}
|
||||
|
||||
/* Create the device specific context.
|
||||
@@ -376,61 +375,7 @@ fbCreateContext( const __GLcontextModes *glVisual,
|
||||
{
|
||||
struct swrast_device_driver *swdd;
|
||||
swdd = _swrast_GetDeviceDriverReference( ctx );
|
||||
swdd->SetBuffer = set_buffer;
|
||||
if (!glVisual->rgbMode) {
|
||||
swdd->WriteCI32Span = write_index32_span_CI8;
|
||||
swdd->WriteCI8Span = write_index8_span_CI8;
|
||||
swdd->WriteMonoCISpan = write_monoindex_span_CI8;
|
||||
swdd->WriteCI32Pixels = write_index_pixels_CI8;
|
||||
swdd->WriteMonoCIPixels = write_monoindex_pixels_CI8;
|
||||
swdd->ReadCI32Span = read_index_span_CI8;
|
||||
swdd->ReadCI32Pixels = read_index_pixels_CI8;
|
||||
}
|
||||
else if (glVisual->rgbBits == 24 &&
|
||||
glVisual->alphaBits == 0) {
|
||||
swdd->WriteRGBASpan = write_rgba_span_B8G8R8;
|
||||
swdd->WriteRGBSpan = write_rgb_span_B8G8R8;
|
||||
swdd->WriteMonoRGBASpan = write_monorgba_span_B8G8R8;
|
||||
swdd->WriteRGBAPixels = write_rgba_pixels_B8G8R8;
|
||||
swdd->WriteMonoRGBAPixels = write_monorgba_pixels_B8G8R8;
|
||||
swdd->ReadRGBASpan = read_rgba_span_B8G8R8;
|
||||
swdd->ReadRGBAPixels = read_rgba_pixels_B8G8R8;
|
||||
}
|
||||
else if (glVisual->rgbBits == 32 &&
|
||||
glVisual->alphaBits == 8) {
|
||||
swdd->WriteRGBASpan = write_rgba_span_B8G8R8A8;
|
||||
swdd->WriteRGBSpan = write_rgb_span_B8G8R8A8;
|
||||
swdd->WriteMonoRGBASpan = write_monorgba_span_B8G8R8A8;
|
||||
swdd->WriteRGBAPixels = write_rgba_pixels_B8G8R8A8;
|
||||
swdd->WriteMonoRGBAPixels = write_monorgba_pixels_B8G8R8A8;
|
||||
swdd->ReadRGBASpan = read_rgba_span_B8G8R8A8;
|
||||
swdd->ReadRGBAPixels = read_rgba_pixels_B8G8R8A8;
|
||||
}
|
||||
else if (glVisual->rgbBits == 16 &&
|
||||
glVisual->alphaBits == 0) {
|
||||
swdd->WriteRGBASpan = write_rgba_span_B5G6R5;
|
||||
swdd->WriteRGBSpan = write_rgb_span_B5G6R5;
|
||||
swdd->WriteMonoRGBASpan = write_monorgba_span_B5G6R5;
|
||||
swdd->WriteRGBAPixels = write_rgba_pixels_B5G6R5;
|
||||
swdd->WriteMonoRGBAPixels = write_monorgba_pixels_B5G6R5;
|
||||
swdd->ReadRGBASpan = read_rgba_span_B5G6R5;
|
||||
swdd->ReadRGBAPixels = read_rgba_pixels_B5G6R5;
|
||||
}
|
||||
else if (glVisual->rgbBits == 15 &&
|
||||
glVisual->alphaBits == 0) {
|
||||
swdd->WriteRGBASpan = write_rgba_span_B5G5R5;
|
||||
swdd->WriteRGBSpan = write_rgb_span_B5G5R5;
|
||||
swdd->WriteMonoRGBASpan = write_monorgba_span_B5G5R5;
|
||||
swdd->WriteRGBAPixels = write_rgba_pixels_B5G5R5;
|
||||
swdd->WriteMonoRGBAPixels = write_monorgba_pixels_B5G5R5;
|
||||
swdd->ReadRGBASpan = read_rgba_span_B5G5R5;
|
||||
swdd->ReadRGBAPixels = read_rgba_pixels_B5G5R5;
|
||||
}
|
||||
else {
|
||||
_mesa_printf("bad pixelformat rgb %d alpha %d\n",
|
||||
glVisual->rgbBits,
|
||||
glVisual->alphaBits );
|
||||
}
|
||||
swdd->SetBuffer = fbSetBuffer;
|
||||
}
|
||||
|
||||
/* use default TCL pipeline */
|
||||
@@ -454,7 +399,7 @@ fbDestroyContext( __DRIcontextPrivate *driContextPriv )
|
||||
|
||||
/* check if we're deleting the currently bound context */
|
||||
if (fbmesa == current) {
|
||||
_mesa_make_current2(NULL, NULL, NULL);
|
||||
_mesa_make_current(NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
/* Free fb context resources */
|
||||
@@ -482,8 +427,7 @@ fbCreateBuffer( __DRIscreenPrivate *driScrnPriv,
|
||||
const __GLcontextModes *mesaVis,
|
||||
GLboolean isPixmap )
|
||||
{
|
||||
fbDRIPtr spriv = (fbDRIPtr)driScrnPriv->private;
|
||||
fbDrawablePtr fbdrawable;
|
||||
struct gl_framebuffer *mesa_framebuffer;
|
||||
|
||||
if (isPixmap) {
|
||||
return GL_FALSE; /* not implemented */
|
||||
@@ -494,30 +438,40 @@ fbCreateBuffer( __DRIscreenPrivate *driScrnPriv,
|
||||
const GLboolean swAccum = mesaVis->accumRedBits > 0;
|
||||
const GLboolean swStencil = mesaVis->stencilBits > 0;
|
||||
|
||||
fbdrawable = _mesa_calloc(sizeof(*fbdrawable));
|
||||
if (!fbdrawable)
|
||||
mesa_framebuffer = _mesa_create_framebuffer(mesaVis);
|
||||
if (!mesa_framebuffer)
|
||||
return 0;
|
||||
|
||||
fbdrawable->mesa_framebuffer = (void *)
|
||||
_mesa_create_framebuffer( mesaVis,
|
||||
|
||||
/* XXX double-check these parameters (bpp vs cpp, etc) */
|
||||
{
|
||||
driRenderbuffer *drb = driNewRenderbuffer(GL_RGBA, driScrnPriv->fbBPP / 8,
|
||||
driScrnPriv->fbOrigin,
|
||||
driScrnPriv->fbStride);
|
||||
fbSetSpanFunctions(drb, mesaVis);
|
||||
drb->Base.Data = driScrnPriv->pFB;
|
||||
_mesa_add_renderbuffer(mesa_framebuffer,
|
||||
BUFFER_FRONT_LEFT, &drb->Base);
|
||||
}
|
||||
if (mesaVis->doubleBufferMode) {
|
||||
/* XXX what are the correct origin/stride values? */
|
||||
driRenderbuffer *drb = driNewRenderbuffer(GL_RGBA, driScrnPriv->fbBPP /8,
|
||||
driScrnPriv->fbOrigin,
|
||||
driScrnPriv->fbStride);
|
||||
fbSetSpanFunctions(drb, mesaVis);
|
||||
drb->Base.Data = _mesa_malloc(driScrnPriv->fbStride * driScrnPriv->fbHeight);
|
||||
_mesa_add_renderbuffer(mesa_framebuffer,
|
||||
BUFFER_BACK_LEFT, &drb->Base);
|
||||
}
|
||||
|
||||
_mesa_add_soft_renderbuffers(mesa_framebuffer,
|
||||
GL_FALSE, /* color */
|
||||
swDepth,
|
||||
swStencil,
|
||||
swAccum,
|
||||
swAlpha );
|
||||
|
||||
if (!fbdrawable->mesa_framebuffer) {
|
||||
_mesa_free(fbdrawable);
|
||||
return 0;
|
||||
}
|
||||
driDrawPriv->driverPrivate = fbdrawable;
|
||||
|
||||
fbdrawable->frontBuffer = fbdrawable->currentBuffer = spriv->fbMap;
|
||||
fbdrawable->currentPitch = spriv->fbWidth;
|
||||
0,
|
||||
GL_FALSE /* aux */);
|
||||
|
||||
/* Replace the framebuffer back buffer with a malloc'ed one --
|
||||
* big speedup.
|
||||
*/
|
||||
fbdrawable->backBuffer = _mesa_malloc(fbdrawable->currentPitch * driDrawPriv->h);
|
||||
driDrawPriv->driverPrivate = mesa_framebuffer;
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -527,11 +481,10 @@ fbCreateBuffer( __DRIscreenPrivate *driScrnPriv,
|
||||
static void
|
||||
fbDestroyBuffer(__DRIdrawablePrivate *driDrawPriv)
|
||||
{
|
||||
fbDrawablePtr fbdrawable = (fbDrawablePtr)driDrawPriv->driverPrivate;
|
||||
struct gl_framebuffer *mesa_framebuffer = (struct gl_framebuffer *)driDrawPriv->driverPrivate;
|
||||
|
||||
_mesa_destroy_framebuffer(fbdrawable->mesa_framebuffer);
|
||||
_mesa_free(fbdrawable->backBuffer);
|
||||
_mesa_free(fbdrawable);
|
||||
_mesa_free(mesa_framebuffer->Attachment[BUFFER_BACK_LEFT].Renderbuffer->Data);
|
||||
_mesa_destroy_framebuffer(mesa_framebuffer);
|
||||
driDrawPriv->driverPrivate = NULL;
|
||||
}
|
||||
|
||||
@@ -542,29 +495,32 @@ fbDestroyBuffer(__DRIdrawablePrivate *driDrawPriv)
|
||||
static void
|
||||
fbSwapBuffers( __DRIdrawablePrivate *dPriv )
|
||||
{
|
||||
fbDrawablePtr fbdrawable = (fbDrawablePtr)dPriv->driverPrivate;
|
||||
struct gl_framebuffer *mesa_framebuffer = (struct gl_framebuffer *)dPriv->driverPrivate;
|
||||
struct gl_renderbuffer * front_renderbuffer = mesa_framebuffer->Attachment[BUFFER_FRONT_LEFT].Renderbuffer;
|
||||
void *frontBuffer = front_renderbuffer->Data;
|
||||
int currentPitch = ((driRenderbuffer *)front_renderbuffer)->pitch;
|
||||
void *backBuffer = mesa_framebuffer->Attachment[BUFFER_BACK_LEFT].Renderbuffer->Data;
|
||||
|
||||
if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) {
|
||||
fbContextPtr fbmesa;
|
||||
GLcontext *ctx;
|
||||
fbmesa = (fbContextPtr) dPriv->driContextPriv->driverPrivate;
|
||||
ctx = fbmesa->glCtx;
|
||||
fbContextPtr fbmesa = (fbContextPtr) dPriv->driContextPriv->driverPrivate;
|
||||
GLcontext *ctx = fbmesa->glCtx;
|
||||
|
||||
if (ctx->Visual.doubleBufferMode) {
|
||||
int i;
|
||||
int offset = 0;
|
||||
char *tmp = _mesa_malloc(fbdrawable->currentPitch);
|
||||
char *tmp = _mesa_malloc(currentPitch);
|
||||
|
||||
_mesa_notifySwapBuffers( ctx ); /* flush pending rendering comands */
|
||||
|
||||
ASSERT(fbdrawable->frontBuffer);
|
||||
ASSERT(fbdrawable->backBuffer);
|
||||
ASSERT(frontBuffer);
|
||||
ASSERT(backBuffer);
|
||||
|
||||
for (i = 0; i < dPriv->h; i++) {
|
||||
_mesa_memcpy(tmp, (char *) fbdrawable->backBuffer + offset,
|
||||
fbdrawable->currentPitch);
|
||||
_mesa_memcpy((char *) fbdrawable->frontBuffer + offset, tmp,
|
||||
fbdrawable->currentPitch);
|
||||
offset += fbdrawable->currentPitch;
|
||||
_mesa_memcpy(tmp, (char *) backBuffer + offset,
|
||||
currentPitch);
|
||||
_mesa_memcpy((char *) frontBuffer + offset, tmp,
|
||||
currentPitch);
|
||||
offset += currentPitch;
|
||||
}
|
||||
|
||||
_mesa_free(tmp);
|
||||
@@ -587,15 +543,15 @@ fbMakeCurrent( __DRIcontextPrivate *driContextPriv,
|
||||
{
|
||||
if ( driContextPriv ) {
|
||||
fbContextPtr newFbCtx =
|
||||
(fbContextPtr) driContextPriv->driverPrivate;
|
||||
(fbContextPtr) driContextPriv->driverPrivate;
|
||||
|
||||
newFbCtx->dri.drawable = driDrawPriv;
|
||||
|
||||
_mesa_make_current2( newFbCtx->glCtx,
|
||||
((fbDrawablePtr)driDrawPriv->driverPrivate)->mesa_framebuffer,
|
||||
((fbDrawablePtr)driReadPriv->driverPrivate)->mesa_framebuffer);
|
||||
_mesa_make_current( newFbCtx->glCtx,
|
||||
driDrawPriv->driverPrivate,
|
||||
driReadPriv->driverPrivate);
|
||||
} else {
|
||||
_mesa_make_current( 0, 0 );
|
||||
_mesa_make_current( NULL, NULL, NULL );
|
||||
}
|
||||
|
||||
return GL_TRUE;
|
||||
@@ -633,8 +589,6 @@ __driValidateMode(const DRIDriverContext *ctx )
|
||||
static int
|
||||
__driInitFBDev( struct DRIDriverContextRec *ctx )
|
||||
{
|
||||
fbDRIPtr pfbDRI;
|
||||
|
||||
/* Note that drmOpen will try to load the kernel module, if needed. */
|
||||
/* we need a fbdev drm driver - it will only track maps */
|
||||
ctx->drmFD = drmOpen("radeon", NULL );
|
||||
@@ -690,18 +644,6 @@ __driInitFBDev( struct DRIDriverContextRec *ctx )
|
||||
fprintf(stderr, "[drm] framebuffer handle = 0x%08lx\n",
|
||||
ctx->shared.hFrameBuffer);
|
||||
|
||||
pfbDRI = (fbDRIPtr)malloc(sizeof(*pfbDRI));
|
||||
pfbDRI->hFrameBuffer = ctx->shared.hFrameBuffer;
|
||||
pfbDRI->fbOrigin = ctx->shared.fbOrigin;
|
||||
pfbDRI->fbSize = ctx->shared.fbSize;
|
||||
pfbDRI->fbStride = ctx->shared.fbStride;
|
||||
pfbDRI->fbWidth = ctx->shared.virtualWidth;
|
||||
pfbDRI->fbHeight = ctx->shared.virtualHeight;
|
||||
pfbDRI->bpp = ctx->bpp;
|
||||
|
||||
ctx->driverClientMsg = pfbDRI;
|
||||
ctx->driverClientMsgSize = sizeof(*pfbDRI);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -763,7 +705,7 @@ fbFillInModes( unsigned pixel_bits, unsigned depth_bits,
|
||||
fb_type = GL_UNSIGNED_SHORT_5_6_5;
|
||||
}
|
||||
else {
|
||||
fb_format = GL_BGR;
|
||||
fb_format = GL_RGBA;
|
||||
fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
|
||||
}
|
||||
|
||||
@@ -841,14 +783,11 @@ void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc
|
||||
create_context_modes = (PFNGLXCREATECONTEXTMODES)
|
||||
glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" );
|
||||
if ( create_context_modes != NULL ) {
|
||||
#if 0
|
||||
fbDRIPtr dri_priv = (fbDRIPtr) psp->pDevPriv;
|
||||
*driver_modes = fbFillInModes( dri_priv->bpp,
|
||||
(dri_priv->bpp == 16) ? 16 : 24,
|
||||
(dri_priv->bpp == 16) ? 0 : 8,
|
||||
(dri_priv->backOffset != dri_priv->depthOffset) );
|
||||
#endif
|
||||
*driver_modes = fbFillInModes( 24, 24, 8, 0);
|
||||
|
||||
*driver_modes = fbFillInModes( psp->fbBPP,
|
||||
(psp->fbBPP == 16) ? 16 : 24,
|
||||
(psp->fbBPP == 16) ? 0 : 8,
|
||||
1);
|
||||
}
|
||||
}
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user