Compare commits
103 Commits
mesa_3_1
...
mesa_3_2_b
Author | SHA1 | Date | |
---|---|---|---|
|
1b539ed613 | ||
|
905ad56487 | ||
|
a16ebe76c9 | ||
|
96563ae75f | ||
|
11769b9737 | ||
|
474363af47 | ||
|
99189ad4fb | ||
|
361fc66e36 | ||
|
0b616332f7 | ||
|
4f030d12ad | ||
|
792837dafd | ||
|
8c77d45b06 | ||
|
660f6dec37 | ||
|
14e7ab2c4f | ||
|
089f713f0d | ||
|
53f81339a4 | ||
|
2cf228e93d | ||
|
4e8ee6840a | ||
|
5144d47c54 | ||
|
3eaed2527a | ||
|
353bd24876 | ||
|
473d64f9cc | ||
|
c21598fb0d | ||
|
287abc7aa0 | ||
|
e6e732c64d | ||
|
61cca3827f | ||
|
88406455f5 | ||
|
fb67681366 | ||
|
ead75d4894 | ||
|
bd4ba2b85d | ||
|
998839109e | ||
|
a23d3cc054 | ||
|
803d5a12ab | ||
|
462144c0f0 | ||
|
a780e6f228 | ||
|
7feab37f8a | ||
|
091834064c | ||
|
9275c62963 | ||
|
7166ff0412 | ||
|
bf69170dff | ||
|
3c6dd8791c | ||
|
69bc4e01b8 | ||
|
b2d3b2dbe0 | ||
|
c508641aec | ||
|
f008070ad5 | ||
|
c562884268 | ||
|
992795f4c9 | ||
|
d21f13cb05 | ||
|
f1b26953e8 | ||
|
216244bed8 | ||
|
b85c3afc01 | ||
|
e4ee3cc9d1 | ||
|
03d7215604 | ||
|
82e6fe5e36 | ||
|
dde5788a44 | ||
|
8038f3747d | ||
|
0df95816c5 | ||
|
3692626805 | ||
|
b31d01d4a7 | ||
|
ba8ef5917e | ||
|
f5d0252282 | ||
|
83386c0f7b | ||
|
5e8aa8e5d9 | ||
|
f008ed46d1 | ||
|
7b5a65ce28 | ||
|
4f4b93d8ae | ||
|
81f97580cc | ||
|
8de719530c | ||
|
f0040ae8f5 | ||
|
ec2425c3b6 | ||
|
aedc01c850 | ||
|
93c528a6d5 | ||
|
443d666b9a | ||
|
d794378dbc | ||
|
76dad53903 | ||
|
e5f8d98410 | ||
|
7f8fed5711 | ||
|
5ed6197b0a | ||
|
609524894a | ||
|
553adbb0c2 | ||
|
361afca6a4 | ||
|
4c6a2f6a33 | ||
|
717ec19e30 | ||
|
411fb983f7 | ||
|
5dbe3d9c98 | ||
|
fea067dce8 | ||
|
1cfc846bf3 | ||
|
dfa45b9f26 | ||
|
6f602ed44d | ||
|
34bf1dd293 | ||
|
9a7584b062 | ||
|
d6dfb94059 | ||
|
b9ee2850cf | ||
|
4183bf524d | ||
|
1721f447c6 | ||
|
46ef216f7f | ||
|
a171741d65 | ||
|
320c2cdb0f | ||
|
9ed70db8ea | ||
|
acbb8cb9dd | ||
|
7889a93ff7 | ||
|
970a551795 | ||
|
d7eae31275 |
164
Make-config
164
Make-config
@@ -1,13 +1,13 @@
|
||||
# $Id: Make-config,v 1.11 1999/11/11 01:28:16 brianp Exp $
|
||||
# $Id: Make-config,v 1.10.2.3 2000/03/23 00:12:13 brianp Exp $
|
||||
|
||||
MESA_MAJOR=3
|
||||
MESA_MINOR=3
|
||||
MESA_MINOR=2
|
||||
MESA_TINY=0
|
||||
VERSION=$(MESA_MAJOR).$(MESA_MINOR)
|
||||
|
||||
# Mesa 3-D graphics library
|
||||
#
|
||||
# Copyright (C) 1999 Brian Paul All Rights Reserved.
|
||||
# Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and associated documentation files (the "Software"),
|
||||
@@ -46,7 +46,7 @@ VERSION=$(MESA_MAJOR).$(MESA_MINOR)
|
||||
# To enable profiling add -DPROFILE to the CFLAGS line. Be sure to set the
|
||||
# MESA_PROFILE environment variable to enable printing of the profile report.
|
||||
#
|
||||
# If your system supports the X Shared Memory extension add -DUSE_XSHM to the
|
||||
# If your system supports the X Shared Memory extension add -DSHM to the
|
||||
# CFLAGS line and add -lXext to the XLIBS line.
|
||||
#
|
||||
# Some compilers complain about const parameters. Adding -DNO_CONST to the
|
||||
@@ -183,7 +183,7 @@ freebsd:
|
||||
"GLUT_LIB = libglut.a" \
|
||||
"GLW_LIB = libGLw.a" \
|
||||
"CC = gcc" \
|
||||
"CFLAGS = -O2 -fPIC -pedantic -I/usr/X11R6/include -DUSE_XSHM -DHZ=100" \
|
||||
"CFLAGS = -O2 -fPIC -pedantic -I/usr/X11R6/include -DSHM -DHZ=100" \
|
||||
"MAKELIB = ../bin/mklib.freebsd" \
|
||||
"XLIBS = -L/usr/X11R6/lib -lXext -lXmu -lXi -lX11 -lm"
|
||||
|
||||
@@ -194,7 +194,7 @@ freebsd-386:
|
||||
"GLUT_LIB = libglut.a" \
|
||||
"GLW_LIB = libGLw.a" \
|
||||
"CC = gcc" \
|
||||
"CFLAGS = -O3 -ffast-math -fPIC -pedantic -I/usr/X11R6/include -DUSE_XSHM -DHZ=100 -DUSE_X86_ASM -DFREEBSD" \
|
||||
"CFLAGS = -O3 -ffast-math -fPIC -pedantic -I/usr/X11R6/include -DSHM -DHZ=100 -DUSE_X86_ASM -DFREEBSD" \
|
||||
"MAKELIB = ../bin/mklib.freebsd" \
|
||||
"XLIBS = -L/usr/X11R6/lib -lXext -lXmu -lXi -lX11 -lm" \
|
||||
"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S"
|
||||
@@ -217,7 +217,7 @@ hpux9:
|
||||
"GLUT_LIB = libglut.a" \
|
||||
"GLW_LIB = libGLw.a" \
|
||||
"CC = cc" \
|
||||
"CFLAGS = +O3 -Aa -D_HPUX_SOURCE -I/usr/include/X11R5 -DUSE_XSHM" \
|
||||
"CFLAGS = +O3 -Aa -D_HPUX_SOURCE -I/usr/include/X11R5 -DSHM" \
|
||||
"MAKELIB = ../bin/mklib.ar-ruv" \
|
||||
"XLIBS = -L/usr/lib/X11R5 -lXext -lXmu -lXi -lX11 -lm"
|
||||
|
||||
@@ -228,7 +228,7 @@ hpux9-gcc:
|
||||
"GLUT_LIB = libglut.a" \
|
||||
"GLW_LIB = libGLw.a" \
|
||||
"CC = gcc" \
|
||||
"CFLAGS = -ansi -O3 -D_HPUX_SOURCE -I/usr/include/X11R5 -DUSE_XSHM" \
|
||||
"CFLAGS = -ansi -O3 -D_HPUX_SOURCE -I/usr/include/X11R5 -DSHM" \
|
||||
"MAKELIB = ../bin/mklib.ar-ruv" \
|
||||
"XLIBS = -L/usr/lib/X11R5 -lXext -lXmu -lXi -lX11 -lm"
|
||||
|
||||
@@ -239,7 +239,7 @@ hpux9-sl:
|
||||
"GLUT_LIB = libglut.sl" \
|
||||
"GLW_LIB = libGLw.sl" \
|
||||
"CC = cc" \
|
||||
"CFLAGS = +z +O3 +Olibcalls +ESlit -Aa +Onolimit -D_HPUX_SOURCE -I/usr/include/X11R5 -DUSE_XSHM" \
|
||||
"CFLAGS = +z +O3 +Olibcalls +ESlit -Aa +Onolimit -D_HPUX_SOURCE -I/usr/include/X11R5 -DSHM" \
|
||||
"MAKELIB = ../bin/mklib.hpux" \
|
||||
"XLIBS = -L/usr/lib/X11R5 -s -Wl,+s,-B,nonfatal,-B,immediate -lXext -lXmu -lXi -lX11 -lm"
|
||||
|
||||
@@ -250,7 +250,7 @@ hpux9-gcc-sl:
|
||||
"GLUT_LIB = libglut.sl" \
|
||||
"GLW_LIB = libGLw.sl" \
|
||||
"CC = gcc" \
|
||||
"CFLAGS = -fPIC -ansi -O3 -D_HPUX_SOURCE -I/usr/include/X11R5 -DUSE_XSHM" \
|
||||
"CFLAGS = -fPIC -ansi -O3 -D_HPUX_SOURCE -I/usr/include/X11R5 -DSHM" \
|
||||
"MAKELIB = ../bin/mklib.hpux" \
|
||||
"XLIBS = -L/usr/lib/X11R5 -lXext -lXmu -lXi -lX11 -lm"
|
||||
|
||||
@@ -261,7 +261,7 @@ hpux10:
|
||||
"GLUT_LIB = libglut.a" \
|
||||
"GLW_LIB = libGLw.a" \
|
||||
"CC = cc" \
|
||||
"CFLAGS = +O3 +DAportable -Aa -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM" \
|
||||
"CFLAGS = +O3 +DAportable -Aa -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DSHM" \
|
||||
"MAKELIB = ../bin/mklib.ar-ruv" \
|
||||
"XLIBS = -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lX11 -lm"
|
||||
|
||||
@@ -272,7 +272,7 @@ hpux10-sl:
|
||||
"GLUT_LIB = libglut" \
|
||||
"GLW_LIB = libGLw.a" \
|
||||
"CC = cc" \
|
||||
"CFLAGS = +z -Ae +O2 +Onolimit +Oaggressive -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM" \
|
||||
"CFLAGS = +z -Ae +O2 +Onolimit +Oaggressive -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DSHM" \
|
||||
"MAKELIB = ../bin/mklib.hpux" \
|
||||
"XLIBS = -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lX11 -lm"
|
||||
|
||||
@@ -283,7 +283,7 @@ hpux10-gcc:
|
||||
"GLUT_LIB = libglut.a" \
|
||||
"GLW_LIB = libGLw.a" \
|
||||
"CC = gcc" \
|
||||
"CFLAGS = -ansi -O3 -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM" \
|
||||
"CFLAGS = -ansi -O3 -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DSHM" \
|
||||
"MAKELIB = ../bin/mklib.ar-ruv" \
|
||||
"XLIBS = -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lX11 -lm"
|
||||
|
||||
@@ -294,7 +294,7 @@ hpux10-gcc-sl:
|
||||
"GLUT_LIB = libglut.sl" \
|
||||
"GLW_LIB = libGLw.a" \
|
||||
"CC = gcc" \
|
||||
"CFLAGS = -fPIC -ansi -O3 -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM" \
|
||||
"CFLAGS = -fPIC -ansi -O3 -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DSHM" \
|
||||
"MAKELIB = ../bin/mklib.hpux" \
|
||||
"XLIBS = -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lX11 -lm"
|
||||
|
||||
@@ -307,7 +307,7 @@ irix4:
|
||||
"GLUT_LIB = libglut.a" \
|
||||
"GLW_LIB = libGLw.a" \
|
||||
"CC = cc" \
|
||||
"CFLAGS = -O2 -ansi -prototypes -DUSE_XSHM" \
|
||||
"CFLAGS = -O2 -ansi -prototypes -DSHM" \
|
||||
"MAKELIB = ../bin/mklib.ar-rcv" \
|
||||
"XLIBS = -lXext -lXmu -lXi -lX11 -lm"
|
||||
|
||||
@@ -319,7 +319,7 @@ irix5:
|
||||
"GLUT_LIB = libglut.a" \
|
||||
"GLW_LIB = libGLw.a" \
|
||||
"CC = cc" \
|
||||
"CFLAGS = -O2 -ansi -fullwarn -DUSE_XSHM -DNO_CONST" \
|
||||
"CFLAGS = -O2 -ansi -fullwarn -DSHM -DNO_CONST" \
|
||||
"MAKELIB = ../bin/mklib.ar-rcv" \
|
||||
"XLIBS = -lX11 -lXext -lXmu -lXi -lm"
|
||||
|
||||
@@ -331,7 +331,7 @@ irix5-gcc:
|
||||
"GLUT_LIB = libglut.a" \
|
||||
"GLW_LIB = libGLw.a" \
|
||||
"CC = gcc" \
|
||||
"CFLAGS = -O2 -pedantic -DUSE_XSHM" \
|
||||
"CFLAGS = -O2 -pedantic -DSHM" \
|
||||
"MAKELIB = ../bin/mklib.ar-rcv" \
|
||||
"XLIBS = -lX11 -lXext -lXmu -lXi -lm"
|
||||
|
||||
@@ -343,7 +343,7 @@ irix5-dso:
|
||||
"GLUT_LIB = libglut.so" \
|
||||
"GLW_LIB = libGLw.so" \
|
||||
"CC = cc" \
|
||||
"CFLAGS = -O2 -ansi -fullwarn -DUSE_XSHM -DNO_CONST" \
|
||||
"CFLAGS = -O2 -ansi -fullwarn -DSHM -DNO_CONST" \
|
||||
"MAKELIB = ../bin/mklib.irix5" \
|
||||
"XLIBS = -rpath ../lib -lX11 -lXmu -lXi -lm"
|
||||
|
||||
@@ -354,7 +354,7 @@ irix6-o32:
|
||||
"GLUT_LIB = libglut.a" \
|
||||
"GLW_LIB = libGLw.a" \
|
||||
"CC = cc" \
|
||||
"CFLAGS = -32 -mips2 -O2 -ansi -DUSE_XSHM -DNO_CONST" \
|
||||
"CFLAGS = -32 -mips2 -O2 -ansi -DSHM -DNO_CONST" \
|
||||
"MAKELIB = ../bin/mklib.ar-rcv" \
|
||||
"XLIBS = -lX11 -lXext -lXmu -lXi -lm"
|
||||
|
||||
@@ -365,7 +365,7 @@ irix6-o32-dso:
|
||||
"GLUT_LIB = libglut.so" \
|
||||
"GLW_LIB = libGLw.so" \
|
||||
"CC = cc" \
|
||||
"CFLAGS = -32 -mips2 -O2 -ansi -DUSE_XSHM -DNO_CONST" \
|
||||
"CFLAGS = -32 -mips2 -O2 -ansi -DSHM -DNO_CONST" \
|
||||
"MAKELIB = ../bin/mklib.irix6-32" \
|
||||
"XLIBS = -rpath ../lib -lX11 -lXext -lXmu -lXi -lm"
|
||||
|
||||
@@ -391,7 +391,7 @@ irix6-n32-dso:
|
||||
"GLW_LIB = libGLw.a" \
|
||||
"LIBDIR = ../lib32" \
|
||||
"CC = cc" \
|
||||
"CFLAGS = -n32 -mips3 -O3 -ansi -DUSE_XSHM -woff 1185,1521" \
|
||||
"CFLAGS = -n32 -mips3 -O3 -ansi -DSHM -woff 1185,1521" \
|
||||
"MAKELIB = ../bin/mklib.irix6-n32" \
|
||||
"XLIBS = -rpath ../lib32 -lX11 -lXmu -lXi -lfpe -lm"
|
||||
|
||||
@@ -403,7 +403,7 @@ irix6-gcc-n32-sl:
|
||||
"GLW_LIB = libGLw.so" \
|
||||
"LIBDIR = ../lib32" \
|
||||
"CC = gcc" \
|
||||
"CFLAGS = -mabi=n32 -mips3 -O3 -DUSE_XSHM" \
|
||||
"CFLAGS = -mabi=n32 -mips3 -O3 -DSHM" \
|
||||
"MAKELIB = ../bin/mklib.irix6-n32" \
|
||||
"XLIBS = -rpath ../lib32 -lX11 -lXmu -lXi -lm"
|
||||
|
||||
@@ -423,7 +423,7 @@ irix6-64:
|
||||
"GLW_LIB = libGLw.a" \
|
||||
"LIBDIR = ../lib64" \
|
||||
"CC = cc" \
|
||||
"CFLAGS = -64 -O3 -ansi -woff 1068,1069,1174,1185,1209,1474,1552 -DUSE_XSHM" \
|
||||
"CFLAGS = -64 -O3 -ansi -woff 1068,1069,1174,1185,1209,1474,1552 -DSHM" \
|
||||
"MAKELIB = ../bin/mklib.ar-rcv" \
|
||||
"XLIBS = -lX11 -lXext -lXmu -lXi -lm"
|
||||
|
||||
@@ -435,12 +435,12 @@ irix6-64-dso:
|
||||
"GLW_LIB = libGLw.so" \
|
||||
"LIBDIR = ../lib64" \
|
||||
"CC = cc" \
|
||||
"CFLAGS = -64 -O3 -ansi -woff 1068,1069,1174,1185,1209,1474,1552 -DUSE_XSHM" \
|
||||
"CFLAGS = -64 -O3 -ansi -woff 1068,1069,1174,1185,1209,1474,1552 -DSHM" \
|
||||
"MAKELIB = ../bin/mklib.irix6-64" \
|
||||
"XLIBS = -rpath ../lib64 -lX11 -lXmu -lXi -lm"
|
||||
|
||||
# May want to try these CFLAGS for better performance under Linux and GCC:
|
||||
# -fPIC -O2 -ansi -pedantic -mieee-fp -DUSE_XSHM -funroll-loops
|
||||
# -fPIC -O2 -ansi -pedantic -mieee-fp -DSHM -funroll-loops
|
||||
# -fexpensive-optimizations -fomit-frame-pointer -ffast-math
|
||||
# and -malign-loops=2 -malign-jumps=2 -malign-functions=2 for Pentium
|
||||
|
||||
@@ -451,7 +451,7 @@ linux:
|
||||
"GLUT_LIB = libglut.a" \
|
||||
"GLW_LIB = libGLw.a" \
|
||||
"CC = gcc" \
|
||||
"CFLAGS = -O2 -funroll-loops -ansi -pedantic -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -I/usr/X11R6/include" \
|
||||
"CFLAGS = -O3 -funroll-loops -ansi -pedantic -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -DSHM -I/usr/X11R6/include" \
|
||||
"MAKELIB = ../bin/mklib.ar-ruv" \
|
||||
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lm"
|
||||
|
||||
@@ -465,7 +465,7 @@ linux-elf:
|
||||
"GLUT_LIB = libglut.so" \
|
||||
"GLW_LIB = libGLw.so" \
|
||||
"CC = gcc" \
|
||||
"CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -I/usr/X11R6/include" \
|
||||
"CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -DSHM -I/usr/X11R6/include" \
|
||||
"MAKELIB = ../bin/mklib.linux" \
|
||||
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lm"
|
||||
|
||||
@@ -476,7 +476,7 @@ linux-glide:
|
||||
"GLUT_LIB = libglut.so" \
|
||||
"GLW_LIB = libGLw.so" \
|
||||
"CC = gcc" \
|
||||
"CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DFX -I/usr/X11R6/include -I/usr/include/glide -I/usr/local/glide/include" \
|
||||
"CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -DSHM -DFX -I/usr/X11R6/include -I/usr/include/glide -I/usr/local/glide/include" \
|
||||
"MAKELIB = ../bin/mklib.linux" \
|
||||
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -L/usr/local/glide/lib -lglide2x -lm"
|
||||
|
||||
@@ -488,7 +488,7 @@ linux-386:
|
||||
"GLUT_LIB = libglut.a" \
|
||||
"GLW_LIB = libGLw.a" \
|
||||
"CC = gcc" \
|
||||
"CFLAGS = -O2 -funroll-loops -ansi -pedantic -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DUSE_X86_ASM -I/usr/X11R6/include" \
|
||||
"CFLAGS = -O3 -funroll-loops -ansi -pedantic -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -DSHM -DUSE_X86_ASM -I/usr/X11R6/include" \
|
||||
"MAKELIB = ../bin/mklib.ar-ruv" \
|
||||
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lm" \
|
||||
"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S X86/vertex.S"
|
||||
@@ -500,7 +500,7 @@ linux-386-elf:
|
||||
"GLUT_LIB = libglut.so" \
|
||||
"GLW_LIB = libGLw.so" \
|
||||
"CC = gcc" \
|
||||
"CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DUSE_X86_ASM -I/usr/X11R6/include" \
|
||||
"CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -DSHM -DUSE_X86_ASM -I/usr/X11R6/include" \
|
||||
"MAKELIB = ../bin/mklib.linux" \
|
||||
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lm" \
|
||||
"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S X86/vertex.S"
|
||||
@@ -512,7 +512,7 @@ linux-386-glide:
|
||||
"GLUT_LIB = libglut.so" \
|
||||
"GLW_LIB = libGLw.so" \
|
||||
"CC = gcc" \
|
||||
"CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_X86_ASM -DUSE_XSHM -DFX -I/usr/X11R6/include -I/usr/include/glide -I/usr/local/glide/include" \
|
||||
"CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_X86_ASM -DSHM -DFX -I/usr/X11R6/include -I/usr/include/glide -I/usr/local/glide/include" \
|
||||
"MAKELIB = ../bin/mklib.linux" \
|
||||
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -L/usr/local/glide/lib -lglide2x -lm" \
|
||||
"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S X86/vertex.S"
|
||||
@@ -524,7 +524,7 @@ linux-386-glide-mits:
|
||||
"GLUT_LIB = libglut.so" \
|
||||
"GLW_LIB = libGLw.so" \
|
||||
"CC = gcc" \
|
||||
"CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DFX -D_REENTRANT -DMITS -DUSE_X86_ASM -I/usr/X11R6/include -I/usr/include/glide -I/usr/local/glide/include" \
|
||||
"CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -DSHM -DFX -D_REENTRANT -DMITS -DUSE_X86_ASM -I/usr/X11R6/include -I/usr/include/glide -I/usr/local/glide/include" \
|
||||
"MAKELIB = ../bin/mklib.linux" \
|
||||
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -L/usr/local/glide/lib -lglide2x -lm -lpthread" \
|
||||
"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S X86/vertex.S"
|
||||
@@ -536,7 +536,7 @@ linux-386-opt-V2-glide:
|
||||
"GLUT_LIB = libglut.so" \
|
||||
"GLW_LIB = libGLw.so" \
|
||||
"CC = gcc" \
|
||||
"CFLAGS = -O3 -m486 -fomit-frame-pointer -pipe -ansi -pedantic -ffast-math -fexpensive-optimizations -malign-loops=2 -malign-jumps=2 -malign-functions=2 -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DFX -DFX_V2 -DUSE_X86_ASM -I/usr/X11R6/include -I/usr/include/glide -I/usr/local/glide/include"\
|
||||
"CFLAGS = -O3 -m486 -fomit-frame-pointer -pipe -ansi -pedantic -ffast-math -fexpensive-optimizations -malign-loops=2 -malign-jumps=2 -malign-functions=2 -D_SVID_SOURCE -D_BSD_SOURCE -DSHM -DFX -DFX_V2 -DUSE_X86_ASM -I/usr/X11R6/include -I/usr/include/glide -I/usr/local/glide/include"\
|
||||
"MAKELIB = ../bin/mklib.linux" \
|
||||
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -L/usr/local/glide/lib -lglide2x -lm -lpthread" \
|
||||
"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S X86/vertex.S"
|
||||
@@ -548,7 +548,7 @@ linux-386-opt-glide:
|
||||
"GLUT_LIB = libglut.so" \
|
||||
"GLW_LIB = libGLw.so" \
|
||||
"CC = gcc" \
|
||||
"CFLAGS = -O3 -m486 -fomit-frame-pointer -pipe -ansi -pedantic -ffast-math -fexpensive-optimizations -malign-loops=2 -malign-jumps=2 -malign-functions=2 -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DFX -DUSE_X86_ASM -I/usr/X11R6/include -I/usr/include/glide -I/usr/local/glide/include" \
|
||||
"CFLAGS = -O3 -m486 -fomit-frame-pointer -pipe -ansi -pedantic -ffast-math -fexpensive-optimizations -malign-loops=2 -malign-jumps=2 -malign-functions=2 -D_SVID_SOURCE -D_BSD_SOURCE -DSHM -DFX -DUSE_X86_ASM -I/usr/X11R6/include -I/usr/include/glide -I/usr/local/glide/include" \
|
||||
"MAKELIB = ../bin/mklib.linux" \
|
||||
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -L/usr/local/glide/lib -lglide2x -lm" \
|
||||
"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S X86/vertex.S"
|
||||
@@ -560,7 +560,7 @@ linux-3dnow:
|
||||
"GLUT_LIB = libglut.so" \
|
||||
"GLW_LIB = libGLw.so" \
|
||||
"CC = gcc -malign-loops=2 -malign-jumps=2 -malign-functions=2" \
|
||||
"CFLAGS = -Wall -O3 -ansi -pedantic -fPIC -ffast-math -funroll-loops -fomit-frame-pointer -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -I/usr/X11R6/include" \
|
||||
"CFLAGS = -Wall -O3 -ansi -pedantic -fPIC -ffast-math -funroll-loops -fomit-frame-pointer -D_SVID_SOURCE -D_BSD_SOURCE -DSHM -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -I/usr/X11R6/include" \
|
||||
"MAKELIB = ../bin/mklib.linux" \
|
||||
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lm" \
|
||||
"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S \
|
||||
@@ -578,7 +578,7 @@ linux-3dnow-glide:
|
||||
"GLUT_LIB = libglut.so" \
|
||||
"GLW_LIB = libGLw.so" \
|
||||
"CC = gcc -malign-loops=2 -malign-jumps=2 -malign-functions=2" \
|
||||
"CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -funroll-loops -fomit-frame-pointer -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_XSHM -DFX -I/usr/X11R6/include -I/usr/include/glide -I/usr/local/glide/include -I/usr/src/mesa-glx/src/FX/X86" \
|
||||
"CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -funroll-loops -fomit-frame-pointer -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DSHM -DFX -I/usr/X11R6/include -I/usr/include/glide -I/usr/local/glide/include -I/usr/src/mesa-glx/src/FX/X86" \
|
||||
"MAKELIB = ../bin/mklib.linux" \
|
||||
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -L/usr/local/glide/lib -lglide2x -lm" \
|
||||
"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S \
|
||||
@@ -598,7 +598,7 @@ linux-386-pthread-shared-glide:
|
||||
"GLU_LIB = libGLU.so" \
|
||||
"GLUT_LIB = libglut.so" \
|
||||
"CC = gcc" \
|
||||
"CFLAGS = -O3 -fPIC -funroll-loops -ansi -pedantic -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM -DUSE_X86_ASM -D_REENTRANT -DTHREADS -DPTHREADS -DFX -I/usr/include/glide -I/usr/local/glide/include" \
|
||||
"CFLAGS = -O3 -fPIC -funroll-loops -ansi -pedantic -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DSHM -DUSE_X86_ASM -D_REENTRANT -DTHREADS -DPTHREADS -DFX -I/usr/include/glide -I/usr/local/glide/include" \
|
||||
"MAKELIB = ../mklib.glide" \
|
||||
"XLIBS = -L/usr/X11/lib -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lpthread -lm" \
|
||||
"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S \
|
||||
@@ -612,7 +612,7 @@ linux-ggi:
|
||||
"GLUT_LIB = libglut.so" \
|
||||
"GLW_LIB = libGLw.a" \
|
||||
"CC = gcc" \
|
||||
"CFLAGS = -O3 -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM -DGGI -DCDECL=" \
|
||||
"CFLAGS = -O3 -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DSHM -DGGI -DCDECL=" \
|
||||
"MAKELIB = ../bin/mklib.ggi" \
|
||||
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lggi -lm"
|
||||
|
||||
@@ -624,7 +624,7 @@ linux-386-ggi:
|
||||
"GLUT_LIB = libglut.so" \
|
||||
"GLW_LIB = libGLw.so" \
|
||||
"CC = gcc" \
|
||||
"CFLAGS = -O3 -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM -DUSE_X86_ASM -DGGI -DCDECL=" \
|
||||
"CFLAGS = -O3 -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DSHM -DUSE_X86_ASM -DGGI -DCDECL=" \
|
||||
"MAKELIB = ../bin/mklib.ggi" \
|
||||
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lggi -lm" \
|
||||
"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S X86/vertex.S"
|
||||
@@ -637,7 +637,7 @@ linux-alpha:
|
||||
"GLUT_LIB = libglut.so" \
|
||||
"GLW_LIB = libGLw.a" \
|
||||
"CC = gcc" \
|
||||
"CFLAGS = -O2 -mieee -pedantic -L/usr/X11R6/lib -D_XOPEN_SOURCE -DUSE_XSHM" \
|
||||
"CFLAGS = -O3 -mieee -pedantic -L/usr/X11R6/lib -D_XOPEN_SOURCE -DSHM" \
|
||||
"MAKELIB = ../bin/mklib.ar-ruv" \
|
||||
"XLIBS = -L/usr/X11R6/lib -lX11 -lm"
|
||||
|
||||
@@ -648,7 +648,7 @@ linux-alpha-elf:
|
||||
"GLUT_LIB = libglut.so" \
|
||||
"GLW_LIB = libGLw.so" \
|
||||
"CC = gcc" \
|
||||
"CFLAGS = -ansi -mieee -pedantic -fPIC -D_XOPEN_SOURCE -DUSE_XSHM" \
|
||||
"CFLAGS = -ansi -mieee -pedantic -fPIC -D_XOPEN_SOURCE -DSHM" \
|
||||
"MAKELIB = ../bin/mklib.linux" \
|
||||
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXi -lm"
|
||||
|
||||
@@ -664,7 +664,7 @@ linux-ppc:
|
||||
"GLUT_LIB = libglut.a" \
|
||||
"GLW_LIB = libGLw.a" \
|
||||
"CC = gcc" \
|
||||
"CFLAGS = -O3 -mcpu=603 -ansi -pedantic -fsigned-char -ffast-math -funroll-loops -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM" \
|
||||
"CFLAGS = -O3 -mcpu=603 -ansi -pedantic -fsigned-char -ffast-math -funroll-loops -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DSHM" \
|
||||
"MAKELIB = ../bin/mklib.ar-ruv" \
|
||||
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lm"
|
||||
|
||||
@@ -676,7 +676,7 @@ linux-ppc-so:
|
||||
"GLUT_LIB = libglut.so" \
|
||||
"GLW_LIB = libGLw.so" \
|
||||
"CC = gcc" \
|
||||
"CFLAGS = -O3 -mcpu=603 -ansi -pedantic -fPIC -fsigned-char -ffast-math -funroll-loops -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM" \
|
||||
"CFLAGS = -O3 -mcpu=603 -ansi -pedantic -fPIC -fsigned-char -ffast-math -funroll-loops -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DSHM" \
|
||||
"MAKELIB = ../bin/mklib.linux" \
|
||||
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lm"
|
||||
|
||||
@@ -687,7 +687,7 @@ linux-386-pthread:
|
||||
"GLU_LIB = libGLU.a" \
|
||||
"GLUT_LIB = libglut.a" \
|
||||
"CC = gcc" \
|
||||
"CFLAGS = -O2 -funroll-loops -ansi -pedantic -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R\6/include -DUSE_XSHM -DUSE_X86_ASM -D_REENTRANT -DTHREADS -DPTHREADS" \
|
||||
"CFLAGS = -O3 -funroll-loops -ansi -pedantic -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R\6/include -DSHM -DUSE_X86_ASM -D_REENTRANT -DTHREADS -DPTHREADS" \
|
||||
"MAKELIB = ../bin/mklib.ar-ruv" \
|
||||
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lpthread -lm" \
|
||||
"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S X86/vertex.S"
|
||||
@@ -699,7 +699,7 @@ linux-386-pthread-shared:
|
||||
"GLU_LIB = libGLU.so" \
|
||||
"GLUT_LIB = libglut.so" \
|
||||
"CC = gcc" \
|
||||
"CFLAGS = -O3 -fPIC -funroll-loops -ansi -pedantic -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -I/us\r/X11R6/include -DUSE_XSHM -DUSE_X86_ASM -D_REENTRANT -DTHREADS -DPTHREADS" \
|
||||
"CFLAGS = -O3 -fPIC -funroll-loops -ansi -pedantic -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -I/us\r/X11R6/include -DSHM -DUSE_X86_ASM -D_REENTRANT -DTHREADS -DPTHREADS" \
|
||||
"MAKELIB = ../bin/mklib.linux" \
|
||||
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lpthread -lm" \
|
||||
"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S X86/vertex.S"
|
||||
@@ -711,7 +711,7 @@ linux-sparc:
|
||||
"GLUT_LIB = libglut.a" \
|
||||
"GLW_LIB = libGLw.a" \
|
||||
"CC = gcc" \
|
||||
"CFLAGS = -pedantic -funroll-loops -O3 -DUSE_XSHM" \
|
||||
"CFLAGS = -pedantic -funroll-loops -O3 -DSHM" \
|
||||
"MAKELIB = ../bin/mklib.ar-ruv" \
|
||||
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXt -lSM -lICE -lXmu -lXi -lm"
|
||||
|
||||
@@ -723,7 +723,7 @@ linux-sparc5-elf:
|
||||
"GLUT_LIB = libglut.so" \
|
||||
"GLW_LIB = libGLw.so" \
|
||||
"CC = gcc" \
|
||||
"CFLAGS = -mv8 -O2 -ffast-math -ansi -pedantic -fPIC -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM" \
|
||||
"CFLAGS = -mv8 -O3 -ffast-math -ansi -pedantic -fPIC -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DSHM" \
|
||||
"MAKELIB = ../bin/mklib.linux" \
|
||||
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lm"
|
||||
|
||||
@@ -735,12 +735,12 @@ linux-sparc-ultra:
|
||||
"GLUT_LIB = libglut.so" \
|
||||
"GLW_LIB = libGLw.so" \
|
||||
"CC = gcc" \
|
||||
"CFLAGS = -mv8 -O2 -mtune=ultrasparc -ansi -pedantic -fPIC -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM" \
|
||||
"CFLAGS = -mv8 -O3 -mtune=ultrasparc -ansi -pedantic -fPIC -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DSHM" \
|
||||
"MAKELIB = ../bin/mklib.linux" \
|
||||
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lm"
|
||||
|
||||
# May want to add these CFLAGS for better performance under LynxOS and GCC:
|
||||
# -fPIC -O2 -ansi -pedantic -mieee-fp -DUSE_XSHM -funroll-loops
|
||||
# -fPIC -O2 -ansi -pedantic -mieee-fp -DSHM -funroll-loops
|
||||
# -fexpensive-optimizations -fomit-frame-pointer -ffast-math
|
||||
# and -malign-loops=2 -malign-jumps=2 -malign-functions=2 for Pentium
|
||||
|
||||
@@ -751,7 +751,7 @@ lynxos:
|
||||
"GLUT_LIB = libglut.a" \
|
||||
"GLW_LIB = libGLw.a" \
|
||||
"CC = gcc" \
|
||||
"CFLAGS = -O2 -ansi -pedantic -funroll-loops -ffast-math -DUSE_XSHM" \
|
||||
"CFLAGS = -O2 -ansi -pedantic -funroll-loops -ffast-math -DSHM" \
|
||||
"MAKELIB = ../bin/mklib.ar-ruv" \
|
||||
"XLIBS = -L/usr/X11/lib -lXext -lXi -lXmu -lX11 -lbsd -lm"
|
||||
|
||||
@@ -795,7 +795,7 @@ netbsd:
|
||||
"GLUT_LIB = libglut.so" \
|
||||
"GLW_LIB = libGLw.so" \
|
||||
"CC = gcc" \
|
||||
"CFLAGS = -O2 -fPIC -DUSE_XSHM -I/usr/X11R6/include -DHZ=100" \
|
||||
"CFLAGS = -O3 -fPIC -DSHM -I/usr/X11R6/include -DHZ=100" \
|
||||
"MAKELIB = ../bin/mklib.netbsd" \
|
||||
"XLIBS = -L/usr/X11R6/lib -lXext -lXmu -lXi -lX11 -lm"
|
||||
|
||||
@@ -815,7 +815,7 @@ openbsd:
|
||||
"GLUT_LIB = libglut.so" \
|
||||
"GLW_LIB = libGLw.so" \
|
||||
"CC = cc" \
|
||||
"CFLAGS = -O2 -fPIC -I/usr/X11R6/include -DUSE_XSHM -DHZ=100" \
|
||||
"CFLAGS = -O2 -fPIC -I/usr/X11R6/include -DSHM -DHZ=100" \
|
||||
"MAKELIB = ../bin/mklib.openbsd" \
|
||||
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXi -lm"
|
||||
|
||||
@@ -856,7 +856,7 @@ osf1:
|
||||
"GLUT_LIB = libglut.a" \
|
||||
"GLW_LIB = libGLw.a" \
|
||||
"CC = cc" \
|
||||
"CFLAGS = -O2 -std1 -ieee_with_no_inexact -DUSE_XSHM -DNO_CONST" \
|
||||
"CFLAGS = -O2 -std1 -ieee_with_no_inexact -DSHM -DNO_CONST" \
|
||||
"MAKELIB = ../bin/mklib.ar-ruv" \
|
||||
"XLIBS = -lX11 -lXext -lXmu -lXi -lm"
|
||||
|
||||
@@ -867,7 +867,7 @@ osf1-sl:
|
||||
"GLUT_LIB = libglut.so" \
|
||||
"GLW_LIB = libGLw.so" \
|
||||
"CC = cc" \
|
||||
"CFLAGS = -O2 -std1 -ieee_with_no_inexact -DUSE_XSHM -DNO_CONST" \
|
||||
"CFLAGS = -O2 -std1 -ieee_with_no_inexact -DSHM -DNO_CONST" \
|
||||
"MAKELIB = ../bin/mklib.osf1" \
|
||||
"XLIBS = -lX11 -lXext -lXmu -lXi -lm"
|
||||
|
||||
@@ -934,7 +934,7 @@ solaris-x86:
|
||||
"GLUT_LIB = libglut.a" \
|
||||
"GLW_LIB = libGLw.a" \
|
||||
"CC = cc" \
|
||||
"CFLAGS = -Xa -xO3 -xpentium -KPIC -I/usr/openwin/include -DUSE_XSHM" \
|
||||
"CFLAGS = -Xa -xO3 -xpentium -KPIC -I/usr/openwin/include -DSHM" \
|
||||
"MAKELIB = ../bin/mklib.solaris" \
|
||||
"XLIBS = -L/usr/openwin/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm"
|
||||
|
||||
@@ -945,7 +945,7 @@ solaris-x86-gcc:
|
||||
"GLUT_LIB = libglut.a" \
|
||||
"GLW_LIB = libGLw.a" \
|
||||
"CC = gcc" \
|
||||
"CFLAGS = -O3 -m486 -fPIC -I/usr/openwin/include -DUSE_XSHM" \
|
||||
"CFLAGS = -O3 -m486 -fPIC -I/usr/openwin/include -DSHM" \
|
||||
"MAKELIB = ../bin/mklib.solaris" \
|
||||
"XLIBS = -L/usr/openwin/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm"
|
||||
|
||||
@@ -956,7 +956,7 @@ sunos4:
|
||||
"GLUT_LIB = libglut.a" \
|
||||
"GLW_LIB = libGLw.a" \
|
||||
"CC = acc" \
|
||||
"CFLAGS = -O -DUSE_XSHM -DSUNOS4" \
|
||||
"CFLAGS = -O -DSHM -DSUNOS4" \
|
||||
"MAKELIB = ../bin/mklib.ar-ruv" \
|
||||
"XLIBS = -lX11 -lXext -lXmu -lXi -lm"
|
||||
|
||||
@@ -967,7 +967,7 @@ sunos4-sl:
|
||||
"GLUT_LIB = libglut.so" \
|
||||
"GLW_LIB = libGLw.so" \
|
||||
"CC = acc" \
|
||||
"CFLAGS = -Kpic -O -I/usr/include/X11R5 -DUSE_XSHM -DSUNOS4" \
|
||||
"CFLAGS = -Kpic -O -I/usr/include/X11R5 -DSHM -DSUNOS4" \
|
||||
"MAKELIB = ld -assert pure-text -o" \
|
||||
"XLIBS = -L/usr/lib/X11R5 -lX11 -lXext -lXmu -lXi -lm"
|
||||
|
||||
@@ -978,7 +978,7 @@ sunos4-gcc:
|
||||
"GLUT_LIB = libglut.a" \
|
||||
"GLW_LIB = libGLw.a" \
|
||||
"CC = gcc" \
|
||||
"CFLAGS = -O3 -DUSE_XSHM -DSUNOS4 -I/usr/openwin/include" \
|
||||
"CFLAGS = -O3 -DSHM -DSUNOS4 -I/usr/openwin/include" \
|
||||
"MAKELIB = ../bin/mklib.ar-ruv" \
|
||||
"XLIBS = -L/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm"
|
||||
|
||||
@@ -989,7 +989,7 @@ sunos4-gcc-sl:
|
||||
"GLUT_LIB = libglut.so" \
|
||||
"GLW_LIB = libGLw.so" \
|
||||
"CC = gcc" \
|
||||
"CFLAGS = -fPIC -O3 -I/usr/openwin/include -I/usr/include/X11R5 -I/usr/include/X11R5 -DUSE_XSHM -DSUNOS4 -DSOLARIS_2_4_BUG" \
|
||||
"CFLAGS = -fPIC -O3 -I/usr/openwin/include -I/usr/include/X11R5 -I/usr/include/X11R5 -DSHM -DSUNOS4 -DSOLARIS_2_4_BUG" \
|
||||
"MAKELIB = ../bin/mklib.sunos4" \
|
||||
"XLIBS = -L/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm"
|
||||
|
||||
@@ -1000,7 +1000,7 @@ sunos4-gcc-x11r6-sl:
|
||||
"GLUT_LIB = libglut.so" \
|
||||
"GLW_LIB = libGLw.so" \
|
||||
"CC = gcc" \
|
||||
"CFLAGS = -fPIC -O3 -I/usr/X11R6.3/include -DUSE_XSHM -DSUNOS4 -DSOLARIS_2_4_BUG" \
|
||||
"CFLAGS = -fPIC -O3 -I/usr/X11R6.3/include -DSHM -DSUNOS4 -DSOLARIS_2_4_BUG" \
|
||||
"MAKELIB = ../bin/mklib.sunos4" \
|
||||
"XLIBS = -L/usr/X11R6.3/lib/X11 -lX11 -lXext -lXmu -lXi -lm"
|
||||
|
||||
@@ -1011,7 +1011,7 @@ sunos5:
|
||||
"GLUT_LIB = libglut.a" \
|
||||
"GLW_LIB = libGLw.a" \
|
||||
"CC = cc" \
|
||||
"CFLAGS = -Xa -fast -xO4 -native -I/usr/openwin/include -I/usr/dt/include -DUSE_XSHM -DSOLARIS_2_4_BUG" \
|
||||
"CFLAGS = -Xa -fast -xO4 -native -I/usr/openwin/include -I/usr/dt/include -DSHM -DSOLARIS_2_4_BUG" \
|
||||
"MAKELIB = ../bin/mklib.ar-ruv" \
|
||||
"XLIBS = -L/usr/openwin/lib -L/usr/dt/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm"
|
||||
|
||||
@@ -1022,7 +1022,7 @@ sunos5-sl:
|
||||
"GLUT_LIB = libglut.so" \
|
||||
"GLW_LIB = libGLw.so" \
|
||||
"CC = cc" \
|
||||
"CFLAGS = -KPIC -Xa -O -I/usr/openwin/include -I/usr/dt/include -DUSE_XSHM -DSOLARIS_2_4_BUG" \
|
||||
"CFLAGS = -KPIC -Xa -O -I/usr/openwin/include -I/usr/dt/include -DSHM -DSOLARIS_2_4_BUG" \
|
||||
"MAKELIB = ../bin/mklib.sunos5" \
|
||||
"XLIBS = -L/usr/openwin/lib -L/usr/dt/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm"
|
||||
|
||||
@@ -1033,7 +1033,7 @@ sunos5-ultra:
|
||||
"GLUT_LIB = libglut.a" \
|
||||
"GLW_LIB = libGLw.a" \
|
||||
"CC = cc" \
|
||||
"CFLAGS = -Xa -fast -xO5 -xtarget=ultra -I/usr/openwin/include -I/usr/dt/include -DUSE_XSHM -DSOLARIS_2_4_BUG" \
|
||||
"CFLAGS = -Xa -fast -xO5 -xtarget=ultra -I/usr/openwin/include -I/usr/dt/include -DSHM -DSOLARIS_2_4_BUG" \
|
||||
"MAKELIB = ../bin/mklib.ar-ruv" \
|
||||
"XLIBS = -L/usr/openwin/lib -L/usr/dt/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm"
|
||||
|
||||
@@ -1044,7 +1044,7 @@ sunos5-ultra-sl:
|
||||
"GLUT_LIB = libglut.so" \
|
||||
"GLW_LIB = libGLw.so" \
|
||||
"CC = cc" \
|
||||
"CFLAGS = -KPIC -Xa -fast -xO5 -xtarget=ultra -I/usr/openwin/include -I/usr/dt/include -DUSE_XSHM -DSOLARIS_2_4_BUG" \
|
||||
"CFLAGS = -KPIC -Xa -fast -xO5 -xtarget=ultra -I/usr/openwin/include -I/usr/dt/include -DSHM -DSOLARIS_2_4_BUG" \
|
||||
"MAKELIB = ../bin/mklib.sunos5" \
|
||||
"XLIBS = -L/usr/openwin/lib -L/usr/dt/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm"
|
||||
|
||||
@@ -1055,7 +1055,7 @@ sunos5-gcc:
|
||||
"GLUT_LIB = libglut.a" \
|
||||
"GLW_LIB = libGLw.a" \
|
||||
"CC = gcc" \
|
||||
"CFLAGS = -O3 -I/usr/openwin/include -DUSE_XSHM -DSOLARIS_2_4_BUG" \
|
||||
"CFLAGS = -O3 -I/usr/openwin/include -DSHM -DSOLARIS_2_4_BUG" \
|
||||
"MAKELIB = ../bin/mklib.ar-ruv" \
|
||||
"XLIBS = -L/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm"
|
||||
|
||||
@@ -1066,7 +1066,7 @@ sunos5-gcc-sl:
|
||||
"GLUT_LIB = libglut.so" \
|
||||
"GLW_LIB = libGLw.so" \
|
||||
"CC = gcc" \
|
||||
"CFLAGS = -fPIC -O3 -I/usr/openwin/include -DUSE_XSHM -DSOLARIS_2_4_BUG" \
|
||||
"CFLAGS = -fPIC -O3 -I/usr/openwin/include -DSHM -DSOLARIS_2_4_BUG" \
|
||||
"MAKELIB = ../bin/mklib.sunos5" \
|
||||
"XLIBS = -L/usr/openwin/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm"
|
||||
|
||||
@@ -1077,7 +1077,7 @@ sunos5-x11r6-gcc-sl:
|
||||
"GLUT_LIB = libglut.so" \
|
||||
"GLW_LIB = libGLw.so" \
|
||||
"CC = gcc" \
|
||||
"CFLAGS = -fPIC -O3 -DUSE_XSHM -DSOLARIS_2_4_BUG" \
|
||||
"CFLAGS = -fPIC -O3 -DSHM -DSOLARIS_2_4_BUG" \
|
||||
"MAKELIB = ../bin/mklib.sunos5" \
|
||||
"XLIBS = -lSM -lICE -lX11 -lXext -lXmu -lXi -lnsl -lsocket -lm"
|
||||
|
||||
@@ -1088,7 +1088,7 @@ sunos5-pthread:
|
||||
"GLU_LIB = libGLU.a" \
|
||||
"GLUT_LIB = libglut.a" \
|
||||
"CC = cc" \
|
||||
"CFLAGS = -mt -Xa -fast -xO4 -native -I/usr/openwin/include -I/usr/dt/include -DUSE_XSHM -DSOLARIS_2_4\_BUG -DTHREADS -DPTHREADS" \
|
||||
"CFLAGS = -mt -Xa -fast -xO4 -native -I/usr/openwin/include -I/usr/dt/include -DSHM -DSOLARIS_2_4\_BUG -DTHREADS -DPTHREADS" \
|
||||
"MAKELIB = ../bin/mklib.ar-ruv" \
|
||||
"XLIBS = -L/usr/openwin/lib -L/usr/dt/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lpthread -lm"
|
||||
|
||||
@@ -1099,7 +1099,7 @@ sunos5-thread:
|
||||
"GLU_LIB = libGLU.a" \
|
||||
"GLUT_LIB = libglut.a" \
|
||||
"CC = cc" \
|
||||
"CFLAGS = -mt -Xa -fast -xO4 -native -I/usr/openwin/include -I/usr/dt/include -DUSE_XSHM -DSOLARIS_2_4\_BUG -DTHREADS -DSOLARIS_THREADS" \
|
||||
"CFLAGS = -mt -Xa -fast -xO4 -native -I/usr/openwin/include -I/usr/dt/include -DSHM -DSOLARIS_2_4\_BUG -DTHREADS -DSOLARIS_THREADS" \
|
||||
"MAKELIB = ../bin/mklib.ar-ruv" \
|
||||
"XLIBS = -L/usr/openwin/lib -L/usr/dt/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lthread -lm"
|
||||
|
||||
@@ -1110,7 +1110,7 @@ sunos5-gcc-thread:
|
||||
"GLU_LIB = libGLU.a" \
|
||||
"GLUT_LIB = libglut.a" \
|
||||
"CC = gcc" \
|
||||
"CFLAGS = -O3 -I/usr/openwin/include -DUSE_XSHM -DSOLARIS_2_4_BUG -D_REENTRANT -DTHREADS -DSOLARIS_THREADS" \
|
||||
"CFLAGS = -O3 -I/usr/openwin/include -DSHM -DSOLARIS_2_4_BUG -D_REENTRANT -DTHREADS -DSOLARIS_THR\EADS" \
|
||||
"MAKELIB = ../bin/mklib.ar-ruv" \
|
||||
"XLIBS = -L/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lthread -lm"
|
||||
|
||||
@@ -1121,7 +1121,7 @@ sunos5-gcc-pthread:
|
||||
"GLU_LIB = libGLU.a" \
|
||||
"GLUT_LIB = libglut.a" \
|
||||
"CC = gcc" \
|
||||
"CFLAGS = -O3 -I/usr/openwin/include -DUSE_XSHM -DSOLARIS_2_4_BUG -D_REENTRANT -DTHREADS -DPTHREADS" \
|
||||
"CFLAGS = -O3 -I/usr/openwin/include -DSHM -DSOLARIS_2_4_BUG -D_REENTRANT -DTHREADS -DPTHREADS" \
|
||||
"MAKELIB = ../bin/mklib.ar-ruv" \
|
||||
"XLIBS = -L/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lpthread -lm"
|
||||
|
||||
@@ -1133,7 +1133,7 @@ sunSolaris-CC:
|
||||
"GLUT_LIB = libglut.a" \
|
||||
"GLW_LIB = libGLw.a" \
|
||||
"CC = CC" \
|
||||
"CFLAGS = -O -I/usr/openwin/include -DUSE_XSHM -DSOLARIS_2_4_BUG" \
|
||||
"CFLAGS = -O -I/usr/openwin/include -DSHM -DSOLARIS_2_4_BUG" \
|
||||
"MAKELIB = ../bin/mklib.ar-ruv" \
|
||||
"XLIBS = -L/usr/openwin/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm"
|
||||
|
||||
@@ -1179,7 +1179,7 @@ unixware:
|
||||
"GLUT_LIB = libglut.a" \
|
||||
"GLW_LIB = libGLw.a" \
|
||||
"CC = cc" \
|
||||
"CFLAGS = -O -I/usr/X/include -DUSE_XSHM" \
|
||||
"CFLAGS = -O -I/usr/X/include -DSHM" \
|
||||
"MAKELIB = ../bin/mklib.ar-ruv" \
|
||||
"XLIBS = -lX11 -lXext -lXmu -lXi -lsocket -lnsl -lm"
|
||||
|
||||
@@ -1190,7 +1190,7 @@ unixware-shared:
|
||||
"GLUT_LIB = libglut" \
|
||||
"GLW_LIB = libGLw" \
|
||||
"CC = cc" \
|
||||
"CFLAGS = -O -I/usr/X/include -KPIC,inline -DUSE_XSHM" \
|
||||
"CFLAGS = -O -I/usr/X/include -KPIC,inline -DSHM" \
|
||||
"MAKELIB = ../bin/mklib.solaris" \
|
||||
"XLIBS = -lX11 -lXext -lXmu -lXi -lsocket -lnsl -lm"
|
||||
|
||||
@@ -1230,7 +1230,7 @@ irix-debug:
|
||||
"GLW_LIB = libGLw.a" \
|
||||
"LIBDIR = ../lib32" \
|
||||
"CC = cc" \
|
||||
"CFLAGS = -g -n32 -ansi -fullwarn -DUSE_XSHM -DDEBUG -woff 1209,1210,1506,1521,3496" \
|
||||
"CFLAGS = -g -n32 -ansi -fullwarn -DSHM -DDEBUG -woff 1209,1210,1506,1521,3496" \
|
||||
"MAKELIB = ../bin/mklib.ar-rcv" \
|
||||
"XLIBS = -rpath ../lib32 -lX11 -lXext -lXmu -lXi -lfpe -lXext -lXmu -lXi -lm"
|
||||
|
||||
@@ -1241,7 +1241,7 @@ DEBUG:
|
||||
"GLUT_LIB = libglut.a" \
|
||||
"GLW_LIB = libGLw.a" \
|
||||
"CC = cc" \
|
||||
"CFLAGS = -g -ansi -prototypes -fullwarn -DUSE_XSHM -DDEBUG" \
|
||||
"CFLAGS = -g -ansi -prototypes -fullwarn -DSHM -DDEBUG" \
|
||||
"MAKELIB = ../bin/mklib.ar-rcv" \
|
||||
"XLIBS = -lX11 -lXext -lXmu -lXi -lfpe -lm"
|
||||
|
||||
@@ -1253,7 +1253,7 @@ linux-debug:
|
||||
"GLUT_LIB = libglut.a" \
|
||||
"GLW_LIB = libGLw.a" \
|
||||
"CC = gcc" \
|
||||
"CFLAGS = -g -ansi -pedantic -Wall -DUSE_XSHM -DDEBUG -DSVGA -DFX -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_X86_ASM_not -I/usr/include/glide -I/usr/local/glide/include" \
|
||||
"CFLAGS = -g -ansi -pedantic -Wall -DSHM -DDEBUG -DSVGA -DFX -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_X86_ASM_not -I/usr/include/glide -I/usr/local/glide/include" \
|
||||
"MAKELIB = ../bin/mklib.ar-ruv" \
|
||||
"XLIBS = -L/usr/local/glide/lib -lglide2x -ltexus -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lvga -lm" \
|
||||
"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S X86/vertex.S"
|
||||
@@ -1265,9 +1265,9 @@ linux-elf-debug:
|
||||
"GLUT_LIB = libglut.so" \
|
||||
"GLW_LIB = libGLw.so" \
|
||||
"CC = gcc" \
|
||||
"CFLAGS = -g -ansi -pedantic -Wall -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM -DDEBUG" \
|
||||
"CFLAGS = -g -ansi -pedantic -Wall -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -DSHM -DDEBUG -DSVGA -DFX -I/usr/X11R6/include -I/usr/include/glide" \
|
||||
"MAKELIB = ../bin/mklib.linux" \
|
||||
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lvga -lm" \
|
||||
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lvga -lm -lvga -L/usr/local/lib -L/usr/local/glide/lib -lglide2x" \
|
||||
"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S X86/vertex.S"
|
||||
|
||||
linux-glide-debug:
|
||||
@@ -1277,7 +1277,7 @@ linux-glide-debug:
|
||||
"GLUT_LIB = libglut.so" \
|
||||
"GLW_LIB = libGLw.so" \
|
||||
"CC = gcc" \
|
||||
"CFLAGS = -g -ansi -pedantic -Wall -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM -DFX -DDEBUG -I/usr/local/glide/include -I/usr/include/glide" \
|
||||
"CFLAGS = -g -ansi -pedantic -Wall -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DSHM -DFX -DDEBUG -I/usr/local/glide/include -I/usr/include/glide" \
|
||||
"MAKELIB = ../bin/mklib.linux" \
|
||||
"XLIBS = -L/usr/local/glide/lib -lglide2x -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lvga -lm" \
|
||||
"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S X86/vertex.S"
|
||||
@@ -1290,7 +1290,7 @@ linux-prof:
|
||||
"GLUT_LIB = libglut.a" \
|
||||
"GLW_LIB = libGLw.a" \
|
||||
"CC = gcc" \
|
||||
"CFLAGS = -O2 -pg -ansi -pedantic -Wall -DUSE_XSHM -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -I/usr/include/glide -I/usr/local/glide/include" \
|
||||
"CFLAGS = -O2 -pg -ansi -pedantic -Wall -DSHM -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -I/usr/include/glide -I/usr/local/glide/include" \
|
||||
"MAKELIB = ../bin/mklib.ar-ruv" \
|
||||
"XLIBS = -L/usr/local/glide/lib -lglide2x -L/usr/X11/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lm" \
|
||||
"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S \
|
||||
|
33
Makefile.X11
33
Makefile.X11
@@ -1,9 +1,9 @@
|
||||
# $Id: Makefile.X11,v 1.12.2.2 1999/12/14 20:54:24 brianp Exp $
|
||||
# $Id: Makefile.X11,v 1.12.2.8 2000/03/23 00:14:28 brianp Exp $
|
||||
|
||||
# Mesa 3-D graphics library
|
||||
# Version: 3.1
|
||||
# Version: 3.2
|
||||
#
|
||||
# Copyright (C) 1999 Brian Paul All Rights Reserved.
|
||||
# Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and associated documentation files (the "Software"),
|
||||
@@ -169,6 +169,7 @@ sunos5-x11r6-gcc-sl ultrix-gcc unicos unixware uwin vistra:
|
||||
if [ -d xdemos ] ; then cd xdemos ; $(MAKE) -f Makefile.X11 $@ ; fi
|
||||
if [ -d samples ] ; then cd samples ; $(MAKE) -f Makefile.X11 $@ ; fi
|
||||
if [ -d book ] ; then cd book ; $(MAKE) -f Makefile.X11 $@ ; fi
|
||||
if [ -d widgets-sgi ] ; then cd widgets-sgi; $(MAKE) -f Makefile.X11 $@ ; fi
|
||||
|
||||
|
||||
irix6-n32 irix6-n32-dso irix6-gcc-n32-sl irix-debug:
|
||||
@@ -183,6 +184,7 @@ irix6-n32 irix6-n32-dso irix6-gcc-n32-sl irix-debug:
|
||||
if [ -d xdemos ] ; then cd xdemos ; $(MAKE) -f Makefile.X11 $@ ; fi
|
||||
if [ -d samples ] ; then cd samples ; $(MAKE) -f Makefile.X11 $@ ; fi
|
||||
if [ -d book ] ; then cd book ; $(MAKE) -f Makefile.X11 $@ ; fi
|
||||
if [ -d widgets-sgi ] ; then cd widgets-sgi; $(MAKE) -f Makefile.X11 $@ ; fi
|
||||
|
||||
|
||||
irix6-64 irix6-64-dso:
|
||||
@@ -197,6 +199,7 @@ irix6-64 irix6-64-dso:
|
||||
if [ -d xdemos ] ; then cd xdemos ; $(MAKE) -f Makefile.X11 $@ ; fi
|
||||
if [ -d samples ] ; then cd samples ; $(MAKE) -f Makefile.X11 $@ ; fi
|
||||
if [ -d book ] ; then cd book ; $(MAKE) -f Makefile.X11 $@ ; fi
|
||||
if [ -d widgets-sgi ] ; then cd widgets-sgi; $(MAKE) -f Makefile.X11 $@ ; fi
|
||||
|
||||
|
||||
amiwin:
|
||||
@@ -225,9 +228,10 @@ cygnus cygnus-linux:
|
||||
touch src-glu/depend
|
||||
cd src ; $(MAKE) -f Makefile.X11 $@
|
||||
cd src-glu ; $(MAKE) -f Makefile.X11 $@
|
||||
cd src-glut ; $(MAKE) -f Makefile.X11 $@
|
||||
cd demos ; $(MAKE) -f Makefile.X11 $@
|
||||
if [ -d src-glut ] ; then cd src-glut ; $(MAKE) -f Makefile.X11 $@ ; fi
|
||||
if [ -d demos ] ; then cd demos ; $(MAKE) -f Makefile.X11 $@ ; fi
|
||||
if [ -d xdemos ] ; then cd xdemos ; $(MAKE) -f Makefile.X11 $@ ; fi
|
||||
if [ -d widgets-sgi ] ; then cd widgets-sgi; $(MAKE) -f Makefile.X11 $@ ; fi
|
||||
|
||||
macintosh:
|
||||
@echo "See the README file for Macintosh intallation information"
|
||||
@@ -272,6 +276,7 @@ linux-ggi linux-386-ggi:
|
||||
if [ -d xdemos ] ; then cd xdemos ; $(MAKE) -f Makefile.X11 $@ ; fi
|
||||
if [ -d samples ] ; then cd samples ; $(MAKE) -f Makefile.X11 $@ ; fi
|
||||
if [ -d book ] ; then cd book ; $(MAKE) -f Makefile.X11 $@ ; fi
|
||||
if [ -d widgets-sgi ] ; then cd widgets-sgi; $(MAKE) -f Makefile.X11 $@ ; fi
|
||||
|
||||
# if you change GGI_DEST please change it in ggimesa.conf, too.
|
||||
DESTDIR=/usr/local
|
||||
@@ -314,9 +319,9 @@ realclean: clean
|
||||
|
||||
|
||||
|
||||
DIRECTORY = Mesa-3.1
|
||||
LIB_NAME = MesaLib-3.1
|
||||
DEMO_NAME = MesaDemos-3.1
|
||||
DIRECTORY = Mesa-3.2
|
||||
LIB_NAME = MesaLib-3.2
|
||||
DEMO_NAME = MesaDemos-3.2
|
||||
|
||||
|
||||
LIB_FILES = \
|
||||
@@ -361,9 +366,11 @@ LIB_FILES = \
|
||||
$(DIRECTORY)/mesawin32.mak \
|
||||
$(DIRECTORY)/Names.win \
|
||||
$(DIRECTORY)/win32-openstep.sh \
|
||||
$(DIRECTORY)/*.dja \
|
||||
$(DIRECTORY)/Makefile.dja \
|
||||
$(DIRECTORY)/common.dja \
|
||||
$(DIRECTORY)/include/GL/Makefile.in \
|
||||
$(DIRECTORY)/include/GL/Makefile.am \
|
||||
$(DIRECTORY)/include/GL/amesa.h \
|
||||
$(DIRECTORY)/include/GL/dosmesa.h \
|
||||
$(DIRECTORY)/include/GL/foomesa.h \
|
||||
$(DIRECTORY)/include/GL/fxmesa.h \
|
||||
@@ -374,6 +381,7 @@ LIB_FILES = \
|
||||
$(DIRECTORY)/include/GL/glu_mangle.h \
|
||||
$(DIRECTORY)/include/GL/glx.h \
|
||||
$(DIRECTORY)/include/GL/glx_mangle.h \
|
||||
$(DIRECTORY)/include/GL/mesa_wgl.h \
|
||||
$(DIRECTORY)/include/GL/mglmesa.h \
|
||||
$(DIRECTORY)/include/GL/osmesa.h \
|
||||
$(DIRECTORY)/include/GL/svgamesa.h \
|
||||
@@ -490,7 +498,8 @@ LIB_FILES = \
|
||||
$(DIRECTORY)/macos/resources/*.rsrc \
|
||||
$(DIRECTORY)/macos/src-agl/*.exp \
|
||||
$(DIRECTORY)/macos/src-agl/*.[ch] \
|
||||
$(DIRECTORY)/macos/src-gli/*.[ch]
|
||||
$(DIRECTORY)/macos/src-gli/*.[ch] \
|
||||
$(DIRECTORY)/OpenStep \
|
||||
|
||||
|
||||
DEMO_FILES = \
|
||||
@@ -529,13 +538,13 @@ DEMO_FILES = \
|
||||
|
||||
lib_tar:
|
||||
cd .. ; \
|
||||
tar -cvf $(LIB_NAME).tar $(LIB_FILES) ; \
|
||||
tar --exclude CVS -c -v -f $(LIB_NAME).tar $(LIB_FILES) ; \
|
||||
gzip $(LIB_NAME).tar ; \
|
||||
mv $(LIB_NAME).tar.gz $(DIRECTORY)
|
||||
|
||||
demo_tar:
|
||||
cd .. ; \
|
||||
tar -cvf $(DEMO_NAME).tar $(DEMO_FILES) ; \
|
||||
tar --exclude CVS -c -v -f $(DEMO_NAME).tar $(DEMO_FILES) ; \
|
||||
gzip $(DEMO_NAME).tar ; \
|
||||
mv $(DEMO_NAME).tar.gz $(DIRECTORY)
|
||||
|
||||
|
@@ -1,13 +1,8 @@
|
||||
|
||||
3Dfx Glide device driver for Mesa 3.1
|
||||
3Dfx Glide device driver for Mesa 3.2
|
||||
(see below for FAQ)
|
||||
|
||||
|
||||
This software is distributed under the terms of the GNU Library
|
||||
General Public License, see the LICENSE file for details.
|
||||
|
||||
|
||||
|
||||
What do you need ?
|
||||
------------------
|
||||
|
||||
@@ -327,6 +322,11 @@ The Mesa/Voodoo Environment Variables:
|
||||
export MESA_FX_INFO=1
|
||||
you will get some useful statistic.
|
||||
|
||||
- If you define the env. var. MESA_FX_NO_SIGNALS:
|
||||
export MESA_FX_NO_SIGNALS=1
|
||||
Mesa/FX will not install atexit() or signal() handlers.
|
||||
|
||||
|
||||
|
||||
Know BUGS and Problems:
|
||||
-----------------------
|
||||
@@ -541,9 +541,7 @@ No because the Linux Glide doesn't (yet) support the Voodoo Rush.
|
||||
a binary copy of the Mesa in order to make the software
|
||||
working out of the box ?
|
||||
|
||||
Yes, you have simply to include some informations about authors
|
||||
and where the library sources are available (check the LICENSE
|
||||
file for more informations about the GNU GPL).
|
||||
Yes.
|
||||
|
||||
|
||||
11. Which is the best make target for compiling the Mesa for
|
||||
|
@@ -1,120 +1,50 @@
|
||||
August 30, 1998 -- Paul Garceau (pgarceau@teleport.com)
|
||||
August 30, 1998 -- Paul Garceau
|
||||
Updated January 13, 2000 -- Paul Garceau (pgarceau@teleport.com)
|
||||
|
||||
DISCLAIMER: I make this extension to the Mesa 3-D Graphics Library as a service
|
||||
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
|
||||
EGCS-Mingw32 build or any Gnu-Win32 build will work for your system. The
|
||||
associated packages and batch files I have included as part of the EGCS-Mingw32
|
||||
extension are provided "As-is" with out any guarantee of support or functionality
|
||||
from the author of this EGCS-Mingw32 native windows port of the Mesa 3-D Graphics
|
||||
Library.
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
I recommend using GCC-2.95.2/Mingw32 which is available at Mumit Khans' ftp site:
|
||||
|
||||
EGCS-Mingw32 Beta 3.08 Archive Manifest:
|
||||
mingw32.bat
|
||||
src/makefile.nt4
|
||||
src/wmesa.c
|
||||
src-glu/makefile.nt4
|
||||
(ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/mingw32/)
|
||||
|
||||
###############
|
||||
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.
|
||||
|
||||
Greetings,
|
||||
I recommend using the GCC-2.95.2/Mingw32.
|
||||
|
||||
In order to build the Mingw32 set of Mesa 3-D Graphics Library for Beta3.08
|
||||
it will be necessary for you to use the Dos or Command Prompt that is available
|
||||
on most of the i86 based MS Windows machines. Also, I believe that this build
|
||||
will run on Win95, Win98, WinNT4 and WinNT5.
|
||||
|
||||
I haven't tested Win95/98 or WinNT5. This build was generated under
|
||||
WinNT4 with SP3 installed.
|
||||
|
||||
This has not been tested under any systems outside of
|
||||
a WinNT4 Workstation with EGCS-Mingw32 toolchain, v.1.0.2 installed.
|
||||
|
||||
EGCS-Mingw32 uses a variation of gcc to handle its build. The Mesa 3-D
|
||||
Graphics Library build that I have generated is based, in small part, on the
|
||||
Cygwin32 build and associated makefiles that Stephane Rehel (rehel@worldnet.fr)
|
||||
defined back in 1997. The EGCS-Mingw32 toolchain is capable of generating
|
||||
native windows code and, as of the date of this readme, can be obtained from:
|
||||
|
||||
http://www.xraylith.wisc.edu/~khan/software/gnu-win32/egcs-mingw32-102.html
|
||||
ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/mingw32/gcc-2.95.2
|
||||
|
||||
Much thanks to the combined efforts of Mumit Khan, Jan-Jaap Vanderhagen
|
||||
and Colin Peters for making it possible for the EGCS-Mingw32 toolchain to exist.
|
||||
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.
|
||||
|
||||
Installing EGCS-Mingw32 Build Revisions:
|
||||
Installing GCC-2.95.2/Mingw32 Build:
|
||||
|
||||
To install the makefile and source revisions incorporated with this build
|
||||
of the Mesa 3-D Graphics Library, you'll have to use a version of winzip. I am
|
||||
in the process of finding a suitable Win32 compatible tar executable so that if
|
||||
you don't have winzip, you can still decompress the files into their respective
|
||||
folders/directories.
|
||||
a) Open the file archive (either tar.gz or .zip extensions)
|
||||
|
||||
a) Move the mingw32.zip file to the top level of the hard drive on your
|
||||
system.
|
||||
b) Decide the directory you want to move the archived files to.
|
||||
|
||||
b) Copy all of the Beta 3.08 src/windows files to the src/ directory.
|
||||
d) Extract the files from the archive.
|
||||
|
||||
e) Edit the mingw32.bat file to accomodate your choice of directory structure.
|
||||
|
||||
b) Open the Winzip file
|
||||
|
||||
c) Verify that the files will be properly extracted.
|
||||
|
||||
d) Extract the files with the Winzip "Overwrite" and "Use Folder Names"
|
||||
options enabled.
|
||||
|
||||
The zip file directory structure extraction defaults to the top level of
|
||||
the hard drive where the mingw32.zip file exists unless otherwise instructed by
|
||||
you.
|
||||
|
||||
The version of wmesa.c included with the mingw32 archive needs to replace
|
||||
the current version of the Beta 3.08 wmesa.c file in order for the egcs-mingw32
|
||||
build to work. This is because the original Win32 stuff assumes that the glut
|
||||
utilities are to be installed. The Glut utilities are not part of the
|
||||
egcs-mingw32 build for Beta 3.08.
|
||||
|
||||
|
||||
Build Considerations:
|
||||
|
||||
In order to get the build to work, I needed to create a special makefile
|
||||
for each library which the Mesa 3-D Graphics Library requires since there is no
|
||||
comparable make-config/config on a native windows platform.
|
||||
|
||||
Since I was only creating a few of the possible libraries for
|
||||
Mesa (gl, glu), I only created the new make files in their respective libraries
|
||||
src, src-glu). For libMesaaux.a. you will find a makefile for it in the
|
||||
src-aux directory. libMesatk.a and libglut.a were not ported.
|
||||
|
||||
The build itself is a .bat based build and uses Gnu Make,Version 3.76.1 to
|
||||
process the makefiles noted above. The build must be run from the directory
|
||||
where the mingw32.bat file is. You can get the binary version of Make 3.76.1
|
||||
from Jan-Jaap van der Heijden's site in Germany:
|
||||
|
||||
http://agnes.dida.physik.uni-essen.de/~janjaap/mingw32/download.html
|
||||
|
||||
It was necessary to modify some source code, specifically the source code
|
||||
in the src-glu directory. I needed to modify nurbs.c, quadric.c and tess.c in
|
||||
order to get them to work using the EGCS-Mingw32 toolchain.
|
||||
|
||||
The original EGCS-Mingw32 Toolchain, is available from:
|
||||
|
||||
http://www.xraylith.wisc.edu/~khan/software/gnu-win32/egcs-mingw32-102.html
|
||||
%mesaroot%: This is your root directory (Mesa-3.2)
|
||||
%mesasrc%: This is the Mesa-3.2 src directory (Mesa-3.2\src)
|
||||
%mesalib%: This is where the build will put libGL.a and libGLU.a
|
||||
|
||||
Running the Build:
|
||||
|
||||
Ok, now that we've got the basics out of the way, follows is all you need
|
||||
to do in order to build the EGCS-Mingw32 version of libMesaGL.a and libMesaGLU.a:
|
||||
|
||||
Open your Command Prompt/Dos prompt.
|
||||
Go to your Mesa-3.0 beta 'root' directory.
|
||||
This is the same directory that the Mesa mingw32.zip file was
|
||||
originally stored in if you've installed the Mesa-3.0 beta 3-D
|
||||
Graphics Library source as outlined in the "readme" file included
|
||||
with the Mesa-3.0 beta distribution.
|
||||
Open your Command Prompt or MS-DOS prompt.
|
||||
Go to your Mesa-3.2 'root' directory
|
||||
At the command line type: mingw32
|
||||
mingw32 is the .bat file that actually does the build.
|
||||
|
||||
That's all there is to it.
|
||||
|
||||
Enjoy!
|
||||
|
||||
|
@@ -35,6 +35,20 @@ If you have compilation problems you should try to fix them and return the
|
||||
patches to the author.
|
||||
|
||||
|
||||
Notes on assembly language optimizations:
|
||||
|
||||
When using the old-style Makefiles, you can specify a configuration
|
||||
that uses X86 assembly language optimizations (linux-3dnow for example).
|
||||
|
||||
The detection of MMX, 3DNow!, PIII/SSE, etc capability is done at
|
||||
runtime. That means you can compile Mesa for 3DNow! optimizations
|
||||
even if you don't have an AMD CPU.
|
||||
|
||||
However, your Linux binutils and assembler must understand the
|
||||
special instructions in order to compile them. If you have
|
||||
compilation problems, try upgrading your binutils.
|
||||
|
||||
|
||||
Header and library files:
|
||||
After you've compiled Mesa and tried the demos I recommend the following
|
||||
procedure for "installing" Mesa.
|
||||
@@ -308,4 +322,4 @@ Summary of X-related environment variables:
|
||||
|
||||
|
||||
----------------------------------------------------------------------
|
||||
$Id: README.X11,v 3.3.2.2 1999/12/14 15:12:52 brianp Exp $
|
||||
$Id: README.X11,v 3.3.2.3 2000/01/25 17:18:46 brianp Exp $
|
||||
|
146
docs/RELNOTES-3.1
Normal file
146
docs/RELNOTES-3.1
Normal file
@@ -0,0 +1,146 @@
|
||||
|
||||
Mesa 3.1 release notes
|
||||
|
||||
PLEASE READ!!!!
|
||||
|
||||
|
||||
New copyright
|
||||
-------------
|
||||
|
||||
Mesa 3.1 will be distributed under an XFree86-style copyright instead
|
||||
of the GNU LGPL.
|
||||
|
||||
|
||||
New directories
|
||||
---------------
|
||||
|
||||
All documentation files are now in the docs/ directory.
|
||||
All shell scripts are now in the bin/ directory.
|
||||
|
||||
|
||||
New library names
|
||||
-----------------
|
||||
|
||||
Formerly, the main Mesa library was named libMesaGL.so (or libMesaGL.a)
|
||||
and the GLU library was named libMesaGLU.so (or libMesaGLU.a).
|
||||
|
||||
Now, the main library is named libGL.so (or libGL.a) and the GLU library
|
||||
is named libGLU.so (or libGLU.a).
|
||||
|
||||
The change allows Mesa to be more easily substituted for OpenGL.
|
||||
Specifically, the linker/loader on some Unix-like systems won't
|
||||
allow libMesaGL.so to be used instead of libGL.so if the application
|
||||
was linked with the former.
|
||||
|
||||
Warning: if you have another OpenGL implementation installed on your
|
||||
system (i.e. you have another OpenGL libGL.so) you'll have to be
|
||||
carefull about which library (OpenGL or Mesa) you link against. Be
|
||||
aware of -L linker flags and the value of the LD_LIBRARY_PATH environment
|
||||
variable.
|
||||
|
||||
|
||||
New library versioning
|
||||
----------------------
|
||||
|
||||
Previously, the Mesa GL library was named libMesaGL.so.3.0
|
||||
To better support Linux/OpenGL standards, the Mesa GL library is now
|
||||
named libGL.so.1.2.030100 This indicates version 1.2 of the OpenGL spec
|
||||
and Mesa implementation 3.1.0
|
||||
|
||||
In the long term this will allow better interoperability with other
|
||||
OpenGL implementations, especially on Linux. In the short term,
|
||||
OpenGL apps may have to be relinked to use the new library naming.
|
||||
|
||||
|
||||
|
||||
New makefiles
|
||||
-------------
|
||||
|
||||
The old Makefiles found in the various directories have been renamed
|
||||
to Makefile.X11 in order to prevent filename collisions with autoconfig-
|
||||
generated Makefiles.
|
||||
|
||||
The top-level Makefile simply includes Makefile.X11
|
||||
If your top-level Makefile get's overwritten/destroyed you can restore
|
||||
it by copying Makefile.X11 to Makefile
|
||||
|
||||
|
||||
New extensions
|
||||
--------------
|
||||
|
||||
GL_EXT_stencil_wrap
|
||||
Implements two new stencil operations: GL_INCR_WRAP_EXT and
|
||||
GL_DECR_WRAP_EXT which allow stencil increment and decrement
|
||||
without clamping.
|
||||
|
||||
GL_INGR_blend_func_separate
|
||||
Allows specification of blend factors for RGB and Alpha independently.
|
||||
(INGR = Intergraph)
|
||||
|
||||
GL_ARB_multitexture
|
||||
Multiple simultaneous textures. (ARB = Architecture Review Board)
|
||||
|
||||
GL_NV_texgen_reflection
|
||||
nVidia texgen extension for better reflection mapping.
|
||||
|
||||
GL_PGI_misc_hints
|
||||
Assorted transformation hints.
|
||||
|
||||
GL_EXT_compiled_vertex_array
|
||||
Compiled vertex arrays.
|
||||
|
||||
GL_EXT_clip_volume_hint
|
||||
Allows one to disable clip volume (frustum) testing.
|
||||
|
||||
|
||||
|
||||
Extensions removed
|
||||
------------------
|
||||
|
||||
GL_EXT_multitexture - obsolete in favor of GL_ARB_multitexture
|
||||
|
||||
|
||||
|
||||
Config file
|
||||
-----------
|
||||
|
||||
By default, /etc/mesa.conf will be read when Mesa starts. This
|
||||
file controls default hints, enable/disable of extensions, and
|
||||
more. See the CONFIG file for documentation.
|
||||
|
||||
|
||||
|
||||
Optimizations
|
||||
-------------
|
||||
|
||||
Keith Whitwell has contributed significant optimizations to Mesa's
|
||||
vertex transformation code. Basically, the whole transformation
|
||||
stage of Mesa has been rewritten.
|
||||
|
||||
It's impossible to give a speedup factor. You'll just have to
|
||||
try your app and see how it performs.
|
||||
|
||||
|
||||
|
||||
Device Driver changes
|
||||
---------------------
|
||||
|
||||
A bunch of new device driver functions have been added. See src/dd.h
|
||||
Keith Harrison contributed many of them. I've been planning on adding
|
||||
a bunch of functions like these to make writing hardware drivers easier.
|
||||
More such function will probably be added in the near future.
|
||||
|
||||
|
||||
|
||||
Miscellaneous
|
||||
-------------
|
||||
|
||||
util/glstate.c has some handy functions for debugging. Basically, it
|
||||
offers a simple function for printing GL state variables. It's not
|
||||
finished yet. There's a LOT more GLenum records to be added (see the
|
||||
code). Anyone want to help?
|
||||
|
||||
|
||||
|
||||
----------------------------------------------------------------------
|
||||
$Id: RELNOTES-3.1,v 1.1.2.1 2000/02/22 17:56:56 brianp Exp $
|
@@ -1,4 +1,4 @@
|
||||
$Id: VERSIONS,v 1.13.2.5 1999/12/14 07:17:42 brianp Exp $
|
||||
$Id: VERSIONS,v 1.13.2.24 2000/03/23 00:12:41 brianp Exp $
|
||||
|
||||
|
||||
Mesa Version History
|
||||
@@ -670,3 +670,41 @@ Mesa Version History
|
||||
- several vertex array bug fixes
|
||||
- overlapping glCopyPixels with pixel zooming now works
|
||||
- glXUseXFont() bitmaps were vertically shifted by one pixel
|
||||
|
||||
|
||||
3.2 beta 1 March 23, 2000
|
||||
Bug fixes:
|
||||
- mixed drawing of lines and bitmaps sometimes had wrong colors
|
||||
- added missing glHintPGI() function
|
||||
- fixed a polygon culling bug
|
||||
- fixed bugs in gluPartialDisk()
|
||||
- Z values in selection mode were wrong
|
||||
- added missing tokens:
|
||||
GL_SMOOTH_POINT_SIZE_RANGE
|
||||
GL_SMOOTH_POINT_SIZE_GRANULARITY
|
||||
GL_SMOOTH_LINE_WIDTH_RANGE
|
||||
GL_SMOOTH_LINE_WIDTH_GRANULARITY
|
||||
GL_ALIASED_POINT_SIZE_RANGE
|
||||
GL_ALIASED_LINE_WIDTH_RANGE
|
||||
- fixed glCopyPixels when copying from back to front buffer
|
||||
- GL_EXT_compiled_vertex_array tokens had _SGI suffix instead of _EXT
|
||||
- glDrawRangeElements(GL_LINES, 0, 1, 2, type, indices) was broken
|
||||
- glDeleteTextures() didn't decrement reference count correctly
|
||||
- GL_SRCA_ALPHA_SATURATE blend mode didn't work correctly
|
||||
- Actual depth of transformation matrix stacks was off by one
|
||||
- 24bpp visuals didn't address pixels correctly
|
||||
- mipmap level of detail (lambda) calculation simplified, more accurate
|
||||
- 101691 - Polygon clipping and GL_LINE
|
||||
- 101928 - Polygon clipping and GL_LINE (same fix as above)
|
||||
- 101808 - Non-glVertexArrays tristrip bug
|
||||
- 101971 - find_last_3f on Dec OSF (worked around)
|
||||
- 102369 - segv on dec osf (possibly a duplicate of the above)
|
||||
- 102893 - orientations of modelview cause segfault
|
||||
New:
|
||||
- updated SVGA Linux driver
|
||||
- added the MESA_FX_NO_SIGNALS env var, see docs/README.3DFX
|
||||
- build libGLw.a (Xt/OpenGL drawing area widget) library by default
|
||||
- changed -O2 to -O3 for a number of gcc configs
|
||||
Changes:
|
||||
- glXCopyContext's mask parameter is now unsigned long, per GLX spec
|
||||
|
||||
|
@@ -1,10 +1,10 @@
|
||||
/* $Id: amesa.h,v 1.1 1999/08/19 00:55:40 jtg Exp $ */
|
||||
/* $Id: amesa.h,v 1.1.1.1.2.1 2000/02/09 18:53:54 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.1
|
||||
* Version: 3.2
|
||||
*
|
||||
* Copyright (C) 1999 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -25,25 +25,17 @@
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* $Log: amesa.h,v $
|
||||
* Revision 1.1 1999/08/19 00:55:40 jtg
|
||||
* Initial revision
|
||||
*
|
||||
* Revision 1.1 1999/03/16 01:24:13 brianp
|
||||
* initial check-in
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* Allegro (DJGPP) driver by Bernhard Tschirren (bernie-t@geocities.com) */
|
||||
|
||||
|
||||
|
||||
#ifndef AMESA_H
|
||||
#define AMESA_H
|
||||
|
||||
|
||||
#define AMESA_MAJOR_VERSION 3
|
||||
#define AMESA_MINOR_VERSION 2
|
||||
|
||||
|
||||
typedef struct amesa_visual *AMesaVisual;
|
||||
typedef struct amesa_buffer *AMesaBuffer;
|
||||
typedef struct amesa_context *AMesaContext;
|
||||
|
@@ -1,10 +1,10 @@
|
||||
/* $Id: fxmesa.h,v 1.1.1.1.2.1 1999/11/24 18:38:52 brianp Exp $ */
|
||||
/* $Id: fxmesa.h,v 1.1.1.1.2.2 2000/02/09 18:53:55 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.1
|
||||
* Version: 3.2
|
||||
*
|
||||
* Copyright (C) 1999 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -45,7 +45,7 @@ extern "C" {
|
||||
|
||||
|
||||
#define FXMESA_MAJOR_VERSION 3
|
||||
#define FXMESA_MINOR_VERSION 1
|
||||
#define FXMESA_MINOR_VERSION 2
|
||||
|
||||
|
||||
/*
|
||||
|
@@ -1,8 +1,8 @@
|
||||
/* $Id: ggimesa.h,v 1.2 1999/08/23 22:34:08 jtaylor Exp $ */
|
||||
/* $Id: ggimesa.h,v 1.2.2.1 2000/02/09 18:53:55 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.1
|
||||
* Version: 3.2
|
||||
* Copyright (C) 1995-1998 Brian Paul
|
||||
* Copyright (C) 1998 Uwe Maurer
|
||||
*
|
||||
@@ -22,23 +22,14 @@
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* $Log: ggimesa.h,v $
|
||||
* Revision 1.2 1999/08/23 22:34:08 jtaylor
|
||||
* Misc small cleanups
|
||||
*
|
||||
* Revision 1.1.1.1 1999/08/19 00:55:40 jtg
|
||||
* Imported sources
|
||||
*
|
||||
* Revision 1.2 1998/09/29 01:46:40 brianp
|
||||
* applied Emmanuel Marty's patches for latest GGI
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef GGIMESA_H
|
||||
#define GGIMESA_H
|
||||
|
||||
|
||||
#define GGIMESA_MAJOR_VERSION 3
|
||||
#define GGIMESA_MINOR_VERSION 2
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
2485
include/GL/gl.h
2485
include/GL/gl.h
File diff suppressed because it is too large
Load Diff
@@ -1,8 +1,8 @@
|
||||
/* $Id: gl_mangle.h,v 1.3 1999/11/04 00:43:09 miklos Exp $ */
|
||||
/* $Id: gl_mangle.h,v 1.3.2.1 2000/01/04 08:08:28 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.1
|
||||
* Version: 3.2
|
||||
*
|
||||
* Copyright (C) 1999 Brian Paul All Rights Reserved.
|
||||
*
|
||||
@@ -396,6 +396,8 @@
|
||||
#define glTexSubImage3DEXT mglTexSubImage3DEXT
|
||||
#define glCopyTexSubImage3DEXT mglCopyTexSubImage3DEXT
|
||||
#define glColorTable mglColorTable
|
||||
#define glColorTableParameteriv mglColorTableParameteriv
|
||||
#define glColorTableParameterfv mglColorTableParameterfv
|
||||
#define glColorSubTable mglColorSubTable
|
||||
#define glGetColorTable mglGetColorTable
|
||||
#define glGetColorTableParameteriv mglGetColorTableParameteriv
|
||||
|
@@ -108,7 +108,7 @@ extern _CRTIMP void __cdecl exit(int);
|
||||
and redifinition of Windows system defs, also removes requirement of
|
||||
pretty much any standard windows header from this file */
|
||||
|
||||
#if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED)
|
||||
#if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__CYGWIN32__)
|
||||
# define GLUTAPIENTRY __stdcall
|
||||
#else
|
||||
# define GLUTAPIENTRY
|
||||
|
@@ -1,10 +1,10 @@
|
||||
/* $Id: glx.h,v 1.5.2.2 1999/12/10 14:55:38 brianp Exp $ */
|
||||
/* $Id: glx.h,v 1.5.2.3 2000/02/23 23:05:07 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.1
|
||||
* Version: 3.2
|
||||
*
|
||||
* Copyright (C) 1999 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -156,7 +156,7 @@ extern Bool glXMakeCurrent( Display *dpy, GLXDrawable drawable,
|
||||
GLXContext ctx);
|
||||
|
||||
extern void glXCopyContext( Display *dpy, GLXContext src, GLXContext dst,
|
||||
GLuint mask );
|
||||
unsigned long mask );
|
||||
|
||||
extern void glXSwapBuffers( Display *dpy, GLXDrawable drawable );
|
||||
|
||||
|
@@ -1,10 +1,10 @@
|
||||
/* $Id: osmesa.h,v 1.1.1.1.2.1 1999/11/24 18:39:17 brianp Exp $ */
|
||||
/* $Id: osmesa.h,v 1.1.1.1.2.2 2000/02/09 18:53:55 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.1
|
||||
* Version: 3.2
|
||||
*
|
||||
* Copyright (C) 1999 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -25,29 +25,6 @@
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* $Log: osmesa.h,v $
|
||||
* Revision 1.1.1.1.2.1 1999/11/24 18:39:17 brianp
|
||||
* bumped version to 3.1
|
||||
*
|
||||
* Revision 1.1.1.1 1999/08/19 00:55:40 jtg
|
||||
* Imported sources
|
||||
*
|
||||
* Revision 1.4 1999/02/14 03:39:09 brianp
|
||||
* new copyright
|
||||
*
|
||||
* Revision 1.3 1999/01/03 02:52:30 brianp
|
||||
* now using GLAPI and GLAPIENTRY keywords (Ted Jump)
|
||||
*
|
||||
* Revision 1.2 1998/07/26 01:33:51 brianp
|
||||
* added WINGDIAPI and APIENTRY keywords per Ted Jump
|
||||
*
|
||||
* Revision 1.1 1998/02/13 03:17:50 brianp
|
||||
* Initial revision
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Mesa Off-Screen rendering interface.
|
||||
*
|
||||
@@ -89,7 +66,7 @@ extern "C" {
|
||||
|
||||
|
||||
#define OSMESA_MAJOR_VERSION 3
|
||||
#define OSMESA_MINOR_VERSION 1
|
||||
#define OSMESA_MINOR_VERSION 2
|
||||
|
||||
|
||||
|
||||
|
@@ -1,9 +1,9 @@
|
||||
/* $Id: svgamesa.h,v 1.1.1.1.2.1 1999/11/24 18:40:45 brianp Exp $ */
|
||||
/* $Id: svgamesa.h,v 1.1.1.1.2.2 2000/01/22 19:58:02 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.1
|
||||
* Copyright (C) 1995-1998 Brian Paul
|
||||
* Version: 3.2
|
||||
* Copyright (C) 1995-2000 Brian Paul
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
@@ -21,21 +21,6 @@
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* $Log: svgamesa.h,v $
|
||||
* Revision 1.1.1.1.2.1 1999/11/24 18:40:45 brianp
|
||||
* bumped version to 3.1
|
||||
*
|
||||
* Revision 1.1.1.1 1999/08/19 00:55:40 jtg
|
||||
* Imported sources
|
||||
*
|
||||
* Revision 3.0 1998/02/20 05:07:24 brianp
|
||||
* initial rev
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* SVGA/Mesa interface for Linux.
|
||||
*/
|
||||
@@ -68,7 +53,7 @@
|
||||
|
||||
|
||||
#define SVGAMESA_MAJOR_VERSION 3
|
||||
#define SVGAMESA_MINOR_VERSION 1
|
||||
#define SVGAMESA_MINOR_VERSION 2
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -90,16 +75,21 @@ typedef struct svgamesa_context *SVGAMesaContext;
|
||||
/*
|
||||
* doubleBuffer flag new in version 2.4
|
||||
*/
|
||||
extern int SVGAMesaInit( int GraphMode );
|
||||
|
||||
extern int SVGAMesaClose( void );
|
||||
|
||||
extern SVGAMesaContext SVGAMesaCreateContext( GLboolean doubleBuffer );
|
||||
|
||||
extern void SVGAMesaDestroyContext( SVGAMesaContext ctx );
|
||||
|
||||
extern void SVGAMesaMakeCurrent( SVGAMesaContext ctx );
|
||||
|
||||
extern SVGAMesaContext SVGAMesaGetCurrentContext( void );
|
||||
|
||||
extern void SVGAMesaSwapBuffers( void );
|
||||
|
||||
extern void SVGAMesaSetCI(int ndx, GLubyte red, GLubyte green, GLubyte blue);
|
||||
|
||||
extern SVGAMesaContext SVGAMesaGetCurrentContext( void );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@@ -1,10 +1,10 @@
|
||||
/* $Id: xmesa.h,v 1.1.1.1.2.2 1999/12/13 21:54:19 brianp Exp $ */
|
||||
/* $Id: xmesa.h,v 1.1.1.1.2.3 2000/02/09 18:53:55 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.1
|
||||
* Version: 3.2
|
||||
*
|
||||
* Copyright (C) 1999 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -25,29 +25,6 @@
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* $Log: xmesa.h,v $
|
||||
* Revision 1.1.1.1.2.2 1999/12/13 21:54:19 brianp
|
||||
* applied Daryll's patches
|
||||
*
|
||||
* Revision 1.1.1.1.2.1 1999/11/24 18:41:37 brianp
|
||||
* bumped version to 3.1
|
||||
*
|
||||
* Revision 1.1.1.1 1999/08/19 00:55:40 jtg
|
||||
* Imported sources
|
||||
*
|
||||
* Revision 1.3 1999/02/24 22:43:27 jens
|
||||
* Name changes to get XMesa to compile standalone inside XFree86
|
||||
*
|
||||
* Revision 1.2 1999/02/14 03:39:09 brianp
|
||||
* new copyright
|
||||
*
|
||||
* Revision 1.1 1998/02/13 03:17:32 brianp
|
||||
* Initial revision
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Mesa/X11 interface. This header file serves as the documentation for
|
||||
* the Mesa/X11 interface functions.
|
||||
@@ -115,7 +92,7 @@ extern struct Library *XLibBase;
|
||||
|
||||
|
||||
#define XMESA_MAJOR_VERSION 3
|
||||
#define XMESA_MINOR_VERSION 1
|
||||
#define XMESA_MINOR_VERSION 2
|
||||
|
||||
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
|
||||
/* $Id: gamma.c,v 1.1 1999/08/19 00:55:40 jtg Exp $ */
|
||||
/* $Id: gamma.c,v 1.1.1.1.2.1 2000/03/18 01:14:01 brianp Exp $ */
|
||||
|
||||
/* Draw test patterns to help determine correct gamma value for a display.
|
||||
When the intensities of the inner squares nearly match the intensities
|
||||
@@ -25,8 +25,14 @@
|
||||
|
||||
/*
|
||||
* $Log: gamma.c,v $
|
||||
* Revision 1.1 1999/08/19 00:55:40 jtg
|
||||
* Initial revision
|
||||
* Revision 1.1.1.1.2.1 2000/03/18 01:14:01 brianp
|
||||
* colors were computed incorrectly (Hans Nelles)
|
||||
*
|
||||
* Revision 1.2 2000/03/18 01:13:29 brianp
|
||||
* colors were computed incorrectly (Hans Nelles)
|
||||
*
|
||||
* Revision 1.1.1.1 1999/08/19 00:55:40 jtg
|
||||
* Imported sources
|
||||
*
|
||||
* Revision 3.1 1999/06/19 01:35:38 brianp
|
||||
* merged in Kai Schuetz's RGB changes
|
||||
@@ -130,8 +136,9 @@ gamma_ramp(GLfloat yoffs, GLfloat r, GLfloat g, GLfloat b)
|
||||
|
||||
for(d = 1; d < 4; d++) { /* increasing density from 25% to 75% */
|
||||
GLfloat xcoord = (-1.0 + d*0.4);
|
||||
GLfloat t = d * 0.25;
|
||||
|
||||
glColor3f(r*d / 5.0, g*d / 5.0, b*d / 5.0); /* draw outer rect */
|
||||
glColor3f(r*t, g*t, b*t); /* draw outer rect */
|
||||
glRectf(xcoord, yoffs, xcoord+0.4, yoffs + 0.5);
|
||||
|
||||
glColor3f(0.0, 0.0, 0.0); /* "clear" inner rect */
|
||||
|
@@ -1,7 +1,10 @@
|
||||
/* $Id: morph3d.c,v 1.2 1999/09/17 12:27:01 brianp Exp $ */
|
||||
/* $Id: morph3d.c,v 1.2.2.1 1999/12/15 13:00:24 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* $Log: morph3d.c,v $
|
||||
* Revision 1.2.2.1 1999/12/15 13:00:24 brianp
|
||||
* moved #define to column 0
|
||||
*
|
||||
* Revision 1.2 1999/09/17 12:27:01 brianp
|
||||
* silenced some warnings
|
||||
*
|
||||
@@ -498,7 +501,7 @@ static void draw_dodeca( void )
|
||||
{
|
||||
GLuint list;
|
||||
|
||||
#define TAU ((SQRT5+1)/2)
|
||||
#define TAU ((SQRT5+1)/2)
|
||||
|
||||
list = glGenLists( 1 );
|
||||
glNewList( list, GL_COMPILE );
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/* $Id: multiarb.c,v 1.3 1999/10/21 16:40:32 brianp Exp $ */
|
||||
/* $Id: multiarb.c,v 1.3.2.2 2000/02/02 17:32:15 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* GL_ARB_multitexture demo
|
||||
@@ -12,6 +12,12 @@
|
||||
|
||||
/*
|
||||
* $Log: multiarb.c,v $
|
||||
* Revision 1.3.2.2 2000/02/02 17:32:15 brianp
|
||||
* changed > to >=
|
||||
*
|
||||
* Revision 1.3.2.1 2000/02/02 01:08:09 brianp
|
||||
* limit Drift to [0, 1]
|
||||
*
|
||||
* Revision 1.3 1999/10/21 16:40:32 brianp
|
||||
* added -info command line option
|
||||
*
|
||||
@@ -61,6 +67,8 @@ static void Idle( void )
|
||||
{
|
||||
if (Animate) {
|
||||
Drift += 0.05;
|
||||
if (Drift >= 1.0)
|
||||
Drift = 0.0;
|
||||
|
||||
#ifdef GL_ARB_multitexture
|
||||
glActiveTextureARB(GL_TEXTURE0_ARB);
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/* $Id: stex3d.c,v 1.2 1999/09/17 12:27:01 brianp Exp $ */
|
||||
/* $Id: stex3d.c,v 1.2.2.1 1999/12/16 08:53:51 brianp Exp $ */
|
||||
|
||||
/*-----------------------------
|
||||
* stex3d.c GL example of the mesa 3d-texture extention to simulate procedural
|
||||
@@ -17,6 +17,9 @@
|
||||
|
||||
/*
|
||||
* $Log: stex3d.c,v $
|
||||
* Revision 1.2.2.1 1999/12/16 08:53:51 brianp
|
||||
* added a cast to malloc call
|
||||
*
|
||||
* Revision 1.2 1999/09/17 12:27:01 brianp
|
||||
* silenced some warnings
|
||||
*
|
||||
@@ -230,7 +233,7 @@ void create3Dtexture()
|
||||
int tmp;
|
||||
|
||||
printf("creating 3d textures...\n");
|
||||
voxels = (unsigned char *) malloc((4*tex_width*tex_height*tex_depth));
|
||||
voxels = (unsigned char *) malloc((size_t) (4*tex_width*tex_height*tex_depth));
|
||||
vp=voxels;
|
||||
for (i=0;i<tex_width;i++){
|
||||
vec[0]=i;
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/* $Id: texobj.c,v 1.1 1999/08/19 00:55:40 jtg Exp $ */
|
||||
/* $Id: texobj.c,v 1.1.1.1.2.2 2000/03/01 03:36:35 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Example of using the 1.1 texture object functions.
|
||||
@@ -10,8 +10,14 @@
|
||||
|
||||
/*
|
||||
* $Log: texobj.c,v $
|
||||
* Revision 1.1 1999/08/19 00:55:40 jtg
|
||||
* Initial revision
|
||||
* Revision 1.1.1.1.2.2 2000/03/01 03:36:35 brianp
|
||||
* test for GL 1.2
|
||||
*
|
||||
* Revision 1.1.1.1.2.1 2000/02/25 23:24:28 brianp
|
||||
* fixed bug when using display lists
|
||||
*
|
||||
* Revision 1.1.1.1 1999/08/19 00:55:40 jtg
|
||||
* Imported sources
|
||||
*
|
||||
* Revision 3.1 1999/03/28 18:24:37 brianp
|
||||
* minor clean-up
|
||||
@@ -34,7 +40,7 @@ static GLfloat Angle = 0.0f;
|
||||
static GLboolean HaveTexObj = GL_FALSE;
|
||||
|
||||
|
||||
#if defined(GL_VERSION_1_1)
|
||||
#if defined(GL_VERSION_1_1) || defined(GL_VERSION_1_2)
|
||||
# define TEXTURE_OBJECT 1
|
||||
#elif defined(GL_EXT_texture_object)
|
||||
# define TEXTURE_OBJECT 1
|
||||
@@ -84,7 +90,7 @@ static void draw( void )
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
glCallList( TexObj[0] );
|
||||
glCallList( TexObj[1] );
|
||||
}
|
||||
glBegin( GL_POLYGON );
|
||||
glTexCoord2f( 0.0, 0.0 ); glVertex2f( -1.0, -1.0 );
|
||||
@@ -272,7 +278,8 @@ int main( int argc, char *argv[] )
|
||||
char *exten = (char *) glGetString( GL_EXTENSIONS );
|
||||
char *version = (char *) glGetString( GL_VERSION );
|
||||
if ( strstr( exten, "GL_EXT_texture_object" )
|
||||
|| strncmp( version, "1.1", 3 )==0 ) {
|
||||
|| strncmp( version, "1.1", 3 )==0
|
||||
|| strncmp( version, "1.2", 3 )==0 ) {
|
||||
HaveTexObj = GL_TRUE;
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/* $Id: logo.c,v 1.1 1999/08/19 00:55:41 jtg Exp $ */
|
||||
/* $Id: logo.c,v 1.1.1.1.2.1 1999/12/15 13:01:44 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
|
||||
@@ -108,16 +108,16 @@ GLubyte *image = checkImage;
|
||||
GLint imageHeight = CHECKIMAGEHEIGHT;
|
||||
GLint imageWidth = CHECKIMAGEWIDTH;
|
||||
|
||||
float decal[] = {
|
||||
static float decal[] = {
|
||||
GL_DECAL,
|
||||
};
|
||||
float modulate[] = {
|
||||
static float modulate[] = {
|
||||
GL_MODULATE,
|
||||
};
|
||||
float repeat[] = {
|
||||
static float repeat[] = {
|
||||
GL_REPEAT,
|
||||
};
|
||||
float nearest[] = {
|
||||
static float nearest[] = {
|
||||
GL_NEAREST,
|
||||
};
|
||||
|
||||
|
64
src/glu/mesa/Makefile.m32
Normal file
64
src/glu/mesa/Makefile.m32
Normal file
@@ -0,0 +1,64 @@
|
||||
# Makefile for GLU for GCC-2.95.2/Mingw32 contributed by
|
||||
# Paul Garceau <pgarceau@teleport.com>
|
||||
|
||||
# Mesa 3-D graphics library
|
||||
# Version: 3.2
|
||||
# Copyright (C) 1995-1999 Brian Paul
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Library General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Library General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Library General Public
|
||||
# License along with this library; if not, write to the Free
|
||||
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
MESA_MAJOR=3
|
||||
MESA_MINOR=2
|
||||
MESA_TINY=0
|
||||
VERSION=$(MESA_MAJOR).$(MESA_MINOR)
|
||||
|
||||
CFLAGS = -I. -DWIN32 -D__WIN32__ -D_WINDOWS \
|
||||
-O2 -funroll-loops \
|
||||
-fexpensive-optimizations -fomit-frame-pointer -ffast-math \
|
||||
-malign-loops=2 -malign-jumps=2 -malign-functions=2 \
|
||||
-mwindows
|
||||
CC = gcc
|
||||
MAKELIB = ar ru
|
||||
GLU_LIB = libGLU.a
|
||||
|
||||
|
||||
##### MACROS #####
|
||||
|
||||
VPATH = RCS
|
||||
|
||||
INCDIR = ../include
|
||||
LIBDIR = ../lib
|
||||
|
||||
SOURCES = glu.c mipmap.c nurbs.c nurbscrv.c nurbssrf.c nurbsutl.c \
|
||||
project.c quadric.c tess.c tess_fist.c tess_hash.c tess_heap.c \
|
||||
tess_winding.c tess_clip.c
|
||||
|
||||
OBJECTS = $(SOURCES:.c=.o)
|
||||
|
||||
|
||||
|
||||
##### RULES #####
|
||||
|
||||
.c.o:
|
||||
$(CC) -c -I$(INCDIR) $(CFLAGS) $<
|
||||
|
||||
|
||||
|
||||
##### TARGETS #####
|
||||
|
||||
# Make the library:
|
||||
$(LIBDIR)/$(GLU_LIB): $(OBJECTS)
|
||||
$(MAKELIB) $(GLU_LIB) $(MAJOR) $(MINOR) $(TINY) $(OBJECTS)
|
@@ -1,9 +1,9 @@
|
||||
/* $Id: glu.c,v 1.16.2.2 1999/11/22 22:18:13 brianp Exp $ */
|
||||
/* $Id: glu.c,v 1.16.2.4 2000/03/23 00:13:43 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.1
|
||||
* Copyright (C) 1995-1999 Brian Paul
|
||||
* Version: 3.2
|
||||
* Copyright (C) 1995-2000 Brian Paul
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
@@ -21,105 +21,6 @@
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* $Log: glu.c,v $
|
||||
* Revision 1.16.2.2 1999/11/22 22:18:13 brianp
|
||||
* removed GLU_EXT_get_proc_address from ext string
|
||||
*
|
||||
* Revision 1.16.2.1 1999/11/19 21:22:07 brianp
|
||||
* replace encounteed with encountered
|
||||
*
|
||||
* Revision 1.16 1999/10/27 09:47:41 brianp
|
||||
* disabled gluGetProcAddressEXT
|
||||
*
|
||||
* Revision 1.15 1999/09/19 02:03:19 tjump
|
||||
* More Win32 build compliance fixups
|
||||
*
|
||||
* Revision 1.14 1999/09/17 12:21:53 brianp
|
||||
* glGetProcAddressEXT changes to accomodate Win32 and non-Win32
|
||||
*
|
||||
* Revision 1.13 1999/09/17 03:17:18 tjump
|
||||
* Patch error fixup
|
||||
*
|
||||
* Revision 1.12 1999/09/17 03:07:28 tjump
|
||||
* Win32 build req't updates
|
||||
*
|
||||
* Revision 1.11 1999/09/17 01:00:38 brianp
|
||||
* fixed typo
|
||||
*
|
||||
* Revision 1.10 1999/09/17 00:06:14 brianp
|
||||
* gluGetProcAddressEXT change for C++ / BeOS
|
||||
*
|
||||
* Revision 1.9 1999/09/16 22:37:56 brianp
|
||||
* added some casts in gluGetProcAddressEXT()
|
||||
*
|
||||
* Revision 1.8 1999/09/16 16:53:28 brianp
|
||||
* clean-up of GLU_EXT_get_proc_address
|
||||
*
|
||||
* Revision 1.7 1999/09/14 00:11:40 brianp
|
||||
* added gluCheckExtension()
|
||||
*
|
||||
* Revision 1.6 1999/09/13 14:31:32 joukj
|
||||
*
|
||||
* strcmp needs the string.h
|
||||
*
|
||||
* Revision 1.5 1999/09/11 12:04:54 brianp
|
||||
* added 1.2 function to gluGetProcAddressEXT()
|
||||
*
|
||||
* Revision 1.4 1999/09/11 11:36:26 brianp
|
||||
* added GLU_EXT_get_proc_address
|
||||
*
|
||||
* Revision 1.3 1999/09/10 04:32:10 gareth
|
||||
* Fixed triangle output, recovery process termination.
|
||||
*
|
||||
* Revision 1.2 1999/09/10 02:03:31 gareth
|
||||
* Added GLU 1.3 tessellation (except winding rule code).
|
||||
*
|
||||
* Revision 1.1.1.1 1999/08/19 00:55:42 jtg
|
||||
* Imported sources
|
||||
*
|
||||
* Revision 1.13 1999/03/31 19:07:28 brianp
|
||||
* added GL_EXT_abgr to extensions
|
||||
*
|
||||
* Revision 1.12 1999/02/06 06:12:41 brianp
|
||||
* updated version string to 3.1
|
||||
*
|
||||
* Revision 1.11 1999/01/03 03:23:15 brianp
|
||||
* now using GLAPIENTRY and GLCALLBACK keywords (Ted Jump)
|
||||
*
|
||||
* Revision 1.10 1998/04/22 00:35:50 brianp
|
||||
* changed version to 3.0
|
||||
*
|
||||
* Revision 1.9 1997/12/09 03:03:32 brianp
|
||||
* changed version to 2.6
|
||||
*
|
||||
* Revision 1.8 1997/10/04 01:30:20 brianp
|
||||
* changed version to 2.5
|
||||
*
|
||||
* Revision 1.7 1997/08/13 01:25:21 brianp
|
||||
* changed version string to 2.4
|
||||
*
|
||||
* Revision 1.6 1997/07/24 01:28:44 brianp
|
||||
* changed precompiled header symbol from PCH to PC_HEADER
|
||||
*
|
||||
* Revision 1.5 1997/07/13 22:59:11 brianp
|
||||
* added const to viewport parameter of gluPickMatrix()
|
||||
*
|
||||
* Revision 1.4 1997/05/28 02:29:38 brianp
|
||||
* added support for precompiled headers (PCH), inserted APIENTRY keyword
|
||||
*
|
||||
* Revision 1.3 1997/04/12 16:19:02 brianp
|
||||
* changed version to 2.3
|
||||
*
|
||||
* Revision 1.2 1997/03/11 00:58:34 brianp
|
||||
* changed version to 2.2
|
||||
*
|
||||
* Revision 1.1 1996/09/27 01:19:39 brianp
|
||||
* Initial revision
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifdef PC_HEADER
|
||||
#include "all.h"
|
||||
#else
|
||||
@@ -374,7 +275,7 @@ const GLubyte* GLAPIENTRY gluErrorString( GLenum errorCode )
|
||||
const GLubyte* GLAPIENTRY gluGetString( GLenum name )
|
||||
{
|
||||
static char *extensions = "GL_EXT_abgr";
|
||||
static char *version = "1.2 Mesa 3.1";
|
||||
static char *version = "1.2 Mesa 3.2 beta 1";
|
||||
|
||||
switch (name) {
|
||||
case GLU_EXTENSIONS:
|
||||
|
@@ -1,9 +1,9 @@
|
||||
/* $Id: mipmap.c,v 1.3.2.1 1999/12/12 17:23:33 brianp Exp $ */
|
||||
/* $Id: mipmap.c,v 1.3.2.2 2000/02/28 14:51:39 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.1
|
||||
* Copyright (C) 1995-1999 Brian Paul
|
||||
* Version: 3.2
|
||||
* Copyright (C) 1995-2000 Brian Paul
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
@@ -21,62 +21,6 @@
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* $Log: mipmap.c,v $
|
||||
* Revision 1.3.2.1 1999/12/12 17:23:33 brianp
|
||||
* removed unneeded code in gluBuild1DMipmaps()
|
||||
*
|
||||
* Revision 1.3 1999/11/09 06:16:59 brianp
|
||||
* replace GLint with GLsizei in a gluScaleImage, gluBuild1/2DMipmaps()
|
||||
*
|
||||
* Revision 1.2 1999/09/14 00:30:28 brianp
|
||||
* fixed pixel packing/unpacking code in gluBuild2DMipmaps()
|
||||
*
|
||||
* Revision 1.1.1.1 1999/08/19 00:55:42 jtg
|
||||
* Imported sources
|
||||
*
|
||||
* Revision 1.13 1999/03/05 17:49:06 brianp
|
||||
* added support for GL_EXT_abgr (devernay@istar.fr)
|
||||
*
|
||||
* Revision 1.12 1999/01/03 03:23:15 brianp
|
||||
* now using GLAPIENTRY and GLCALLBACK keywords (Ted Jump)
|
||||
*
|
||||
* Revision 1.11 1998/09/18 02:44:03 brianp
|
||||
* further changes to gluScaleImage() per Randy Frank
|
||||
*
|
||||
* Revision 1.10 1998/09/17 03:20:26 brianp
|
||||
* fixed another bug in gluScaleImage() per Sven Panne
|
||||
*
|
||||
* Revision 1.9 1998/07/31 03:06:20 brianp
|
||||
* tweaked the gluScaleImage() function per Randy Frank
|
||||
*
|
||||
* Revision 1.8 1998/07/08 01:02:53 brianp
|
||||
* if gluBuildxDMipmaps() width or height <= 0 return GLU_INVALID_VALUE
|
||||
*
|
||||
* Revision 1.7 1998/07/01 00:18:02 brianp
|
||||
* if gluBuildxDMipmaps() width or height <= 0 just return 0
|
||||
*
|
||||
* Revision 1.6 1998/06/01 01:06:41 brianp
|
||||
* small update for Next/OpenStep from Alexander Mai
|
||||
*
|
||||
* Revision 1.5 1997/07/24 01:28:44 brianp
|
||||
* changed precompiled header symbol from PCH to PC_HEADER
|
||||
*
|
||||
* Revision 1.4 1997/06/23 00:22:56 brianp
|
||||
* added dummy() call to work around an MSVC 4.1 bug
|
||||
*
|
||||
* Revision 1.3 1997/05/28 02:29:38 brianp
|
||||
* added support for precompiled headers (PCH), inserted APIENTRY keyword
|
||||
*
|
||||
* Revision 1.2 1997/05/24 13:32:25 brianp
|
||||
* undef EPSILON in case it's already defined
|
||||
*
|
||||
* Revision 1.1 1996/09/27 01:19:39 brianp
|
||||
* Initial revision
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifdef PC_HEADER
|
||||
#include "all.h"
|
||||
#else
|
||||
@@ -141,9 +85,11 @@ GLint GLAPIENTRY gluScaleImage( GLenum format,
|
||||
components = 2;
|
||||
break;
|
||||
case GL_RGB:
|
||||
case GL_BGR:
|
||||
components = 3;
|
||||
break;
|
||||
case GL_RGBA:
|
||||
case GL_BGRA:
|
||||
#ifdef GL_EXT_abgr
|
||||
case GL_ABGR_EXT:
|
||||
#endif
|
||||
|
@@ -1,9 +1,9 @@
|
||||
/* $Id: nurbs.c,v 1.2 1999/11/11 03:21:43 kendallb Exp $ */
|
||||
/* $Id: nurbs.c,v 1.1.1.1.2.1 2000/02/10 17:23:47 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.1
|
||||
* Copyright (C) 1995-1999 Brian Paul
|
||||
* Version: 3.2
|
||||
* Copyright (C) 1995-2000 Brian Paul
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
@@ -21,73 +21,6 @@
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* $Log: nurbs.c,v $
|
||||
* Revision 1.2 1999/11/11 03:21:43 kendallb
|
||||
*
|
||||
* . Updated GL/gl.h with GLCALLACKP and GLAPIENTRYP macros for compatibility
|
||||
* with the IBM VisualAge C++ compiler. Eventually some more code will be
|
||||
* needed in the headers to enable the reversal of (__stdcall*) to (*__stdcall)
|
||||
* for the IBM compilers, however we currently build using our own header files
|
||||
* that already handle this.
|
||||
*
|
||||
* . Changed instances of (GLCALLBACK*) to GLCALLBACKP for compatibility
|
||||
* with the IBM VisualAge C++ compiler in src-glu.
|
||||
*
|
||||
* . Misc cleanups for warnings generated with Watcom C++ in src-glu. Compiles
|
||||
* with 0 warnings now.
|
||||
*
|
||||
* . tess_hash.c: line 244 - Why is this function stubbed out? I removed the
|
||||
* code with a #if 0 to avoid a compiler warning, but it looks dangerous.
|
||||
*
|
||||
* Revision 1.1.1.1 1999/08/19 00:55:42 jtg
|
||||
* Imported sources
|
||||
*
|
||||
* Revision 1.14 1999/01/03 03:23:15 brianp
|
||||
* now using GLAPIENTRY and GLCALLBACK keywords (Ted Jump)
|
||||
*
|
||||
* Revision 1.13 1998/06/01 01:07:49 brianp
|
||||
* small update for Next/OpenStep from Alexander Mai
|
||||
*
|
||||
* Revision 1.12 1998/03/15 18:14:30 brianp
|
||||
* fixed a compiler cast warning
|
||||
*
|
||||
* Revision 1.11 1998/02/07 14:29:11 brianp
|
||||
* fixed casting problem in gluNurbsCallback, again
|
||||
*
|
||||
* Revision 1.10 1998/02/04 00:21:20 brianp
|
||||
* fixed cygnus compilation problem (Stephane Rehel)
|
||||
*
|
||||
* Revision 1.9 1998/01/16 03:35:26 brianp
|
||||
* fixed Windows compilation warnings (Theodore Jump)
|
||||
*
|
||||
* Revision 1.8 1997/09/17 01:51:48 brianp
|
||||
* changed glu*Callback() functions to match prototype in glu.h
|
||||
*
|
||||
* Revision 1.7 1997/07/24 01:28:44 brianp
|
||||
* changed precompiled header symbol from PCH to PC_HEADER
|
||||
*
|
||||
* Revision 1.6 1997/07/24 01:26:31 brianp
|
||||
* added CALLBACK keyword to gluNurbsCallback()
|
||||
*
|
||||
* Revision 1.5 1997/05/28 02:29:38 brianp
|
||||
* added support for precompiled headers (PCH), inserted APIENTRY keyword
|
||||
*
|
||||
* Revision 1.4 1997/05/27 03:17:22 brianp
|
||||
* minor clean-up
|
||||
*
|
||||
* Revision 1.3 1997/05/27 03:00:16 brianp
|
||||
* incorporated Bogdan's new NURBS code
|
||||
*
|
||||
* Revision 1.2 1996/09/27 23:11:23 brianp
|
||||
* ifdef'd out unimplemented trimmed nurbs code
|
||||
*
|
||||
* Revision 1.1 1996/09/27 01:19:39 brianp
|
||||
* Initial revision
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* NURBS implementation written by Bogdan Sikorski (bogdan@cira.it)
|
||||
* See README2 for more info.
|
||||
@@ -617,13 +550,9 @@ void GLAPIENTRY gluNurbsSurface( GLUnurbsObj *nobj,
|
||||
|
||||
|
||||
void GLAPIENTRY
|
||||
gluNurbsCallback( GLUnurbsObj *nobj, GLenum which, void (GLCALLBACKP fn)())
|
||||
gluNurbsCallback( GLUnurbsObj *nobj, GLenum which, void (GLCALLBACK *fn)())
|
||||
{
|
||||
#if defined(__CYGWIN32__) || defined(OPENSTEP)
|
||||
nobj->error_callback = (void(*)(GLenum))fn;
|
||||
#else
|
||||
nobj->error_callback = (void(GLCALLBACKP)(GLenum))fn;
|
||||
#endif
|
||||
nobj->error_callback = (void(GLCALLBACKPCAST)(GLenum))fn;
|
||||
|
||||
if(which!=GLU_ERROR)
|
||||
call_user_error(nobj,GLU_INVALID_ENUM);
|
||||
|
@@ -1,9 +1,9 @@
|
||||
/* $Id: quadric.c,v 1.3 1999/11/11 09:55:39 joukj Exp $ */
|
||||
/* $Id: quadric.c,v 1.1.1.1.2.4 2000/02/10 17:23:48 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.1
|
||||
* Copyright (C) 1995-1999 Brian Paul
|
||||
* Version: 3.2
|
||||
* Copyright (C) 1999-2000 Brian Paul
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
@@ -21,92 +21,6 @@
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* $Log: quadric.c,v $
|
||||
* Revision 1.3 1999/11/11 09:55:39 joukj
|
||||
*
|
||||
* tess_macro.h included
|
||||
*
|
||||
* Revision 1.2 1999/11/11 03:21:43 kendallb
|
||||
*
|
||||
* . Updated GL/gl.h with GLCALLACKP and GLAPIENTRYP macros for compatibility
|
||||
* with the IBM VisualAge C++ compiler. Eventually some more code will be
|
||||
* needed in the headers to enable the reversal of (__stdcall*) to (*__stdcall)
|
||||
* for the IBM compilers, however we currently build using our own header files
|
||||
* that already handle this.
|
||||
*
|
||||
* . Changed instances of (GLCALLBACK*) to GLCALLBACKP for compatibility
|
||||
* with the IBM VisualAge C++ compiler in src-glu.
|
||||
*
|
||||
* . Misc cleanups for warnings generated with Watcom C++ in src-glu. Compiles
|
||||
* with 0 warnings now.
|
||||
*
|
||||
* . tess_hash.c: line 244 - Why is this function stubbed out? I removed the
|
||||
* code with a #if 0 to avoid a compiler warning, but it looks dangerous.
|
||||
*
|
||||
* Revision 1.1.1.1 1999/08/19 00:55:42 jtg
|
||||
* Imported sources
|
||||
*
|
||||
* Revision 1.19 1999/02/27 13:55:31 brianp
|
||||
* fixed BeOS-related GLU typedef problems
|
||||
*
|
||||
* Revision 1.18 1999/01/03 03:23:15 brianp
|
||||
* now using GLAPIENTRY and GLCALLBACK keywords (Ted Jump)
|
||||
*
|
||||
* Revision 1.17 1999/01/03 03:19:15 brianp
|
||||
* rewrote some of gluCylinder
|
||||
*
|
||||
* Revision 1.16 1998/06/01 01:08:36 brianp
|
||||
* small update for Next/OpenStep from Alexander Mai
|
||||
*
|
||||
* Revision 1.15 1998/03/15 18:28:54 brianp
|
||||
* reimplemented gluDisk() point and line mode
|
||||
*
|
||||
* Revision 1.14 1998/03/15 18:14:17 brianp
|
||||
* fixed a compiler cast warning
|
||||
*
|
||||
* Revision 1.13 1998/02/07 14:28:34 brianp
|
||||
* another change to gluQuadricCallback(), this time for StormC compiler
|
||||
*
|
||||
* Revision 1.12 1998/02/05 00:43:19 brianp
|
||||
* Yes, still another change to gluQuadricCallback()!
|
||||
*
|
||||
* Revision 1.11 1998/02/04 00:27:43 brianp
|
||||
* yet another change to gluQuadricCallback()!
|
||||
*
|
||||
* Revision 1.10 1998/02/04 00:23:23 brianp
|
||||
* fixed CALLBACK problem in gluQuadricCallback() (Stephane Rehel)
|
||||
*
|
||||
* Revision 1.9 1998/02/04 00:20:09 brianp
|
||||
* added missing (int) in ErrorFunc cast
|
||||
*
|
||||
* Revision 1.8 1998/01/16 03:37:51 brianp
|
||||
* fixed another assignment warning in gluQuadricCallback()
|
||||
*
|
||||
* Revision 1.7 1998/01/16 03:35:26 brianp
|
||||
* fixed Windows compilation warnings (Theodore Jump)
|
||||
*
|
||||
* Revision 1.6 1997/10/29 02:02:20 brianp
|
||||
* various MS Windows compiler changes (David Bucciarelli, v20 3dfx driver)
|
||||
*
|
||||
* Revision 1.5 1997/09/17 01:51:48 brianp
|
||||
* changed glu*Callback() functions to match prototype in glu.h
|
||||
*
|
||||
* Revision 1.4 1997/07/24 01:28:44 brianp
|
||||
* changed precompiled header symbol from PCH to PC_HEADER
|
||||
*
|
||||
* Revision 1.3 1997/05/28 02:29:38 brianp
|
||||
* added support for precompiled headers (PCH), inserted APIENTRY keyword
|
||||
*
|
||||
* Revision 1.2 1997/03/12 02:15:38 brianp
|
||||
* fixed problem in gluPartialDisk() reported by Kenneth H. Carpenter
|
||||
*
|
||||
* Revision 1.1 1996/09/27 01:19:39 brianp
|
||||
* Initial revision
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* TODO:
|
||||
* texture coordinate support
|
||||
* flip normals according to orientation
|
||||
@@ -122,11 +36,21 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "gluP.h"
|
||||
#include "tess_macros.h"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifndef M_PI
|
||||
# define M_PI (3.1415926)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Convert degrees to radians:
|
||||
*/
|
||||
#define DEG_TO_RAD(A) ((A)*(M_PI/180.0))
|
||||
|
||||
|
||||
/*
|
||||
* Sin and Cos for degree angles:
|
||||
*/
|
||||
@@ -146,7 +70,7 @@ struct GLUquadric {
|
||||
GLenum Orientation; /* GLU_INSIDE or GLU_OUTSIDE */
|
||||
GLboolean TextureFlag; /* Generate texture coords? */
|
||||
GLenum Normals; /* GLU_NONE, GLU_FLAT, or GLU_SMOOTH */
|
||||
void (GLCALLBACKP ErrorFunc)(GLenum err); /* Error handler callback function */
|
||||
void (GLCALLBACK *ErrorFunc)(GLenum err); /* Error handler callback function */
|
||||
};
|
||||
|
||||
|
||||
@@ -232,24 +156,24 @@ void GLAPIENTRY gluQuadricOrientation( GLUquadricObj *quadObject,
|
||||
* Set the error handler callback function.
|
||||
*/
|
||||
void GLAPIENTRY gluQuadricCallback( GLUquadricObj *qobj,
|
||||
GLenum which, void (GLCALLBACKP fn)() )
|
||||
GLenum which, void (GLCALLBACK *fn)() )
|
||||
{
|
||||
/*
|
||||
* UGH, this is a mess! I thought ANSI was a standard.
|
||||
*/
|
||||
if (qobj && which==GLU_ERROR) {
|
||||
#ifdef __CYGWIN32__
|
||||
qobj->ErrorFunc = (void(*)(int))fn;
|
||||
qobj->ErrorFunc = (void(GLCALLBACKPCAST)(GLenum))fn;
|
||||
#elif defined(OPENSTEP)
|
||||
qobj->ErrorFunc = (void(*)(GLenum))fn;
|
||||
#elif defined(_WIN32)
|
||||
qobj->ErrorFunc = (void(GLCALLBACKP)(int))fn;
|
||||
qobj->ErrorFunc = (void(GLCALLBACK*)(int))fn;
|
||||
#elif defined(__STORM__)
|
||||
qobj->ErrorFunc = (void(GLCALLBACKP)(GLenum))fn;
|
||||
qobj->ErrorFunc = (void(GLCALLBACK*)(GLenum))fn;
|
||||
#elif defined(__BEOS__)
|
||||
qobj->ErrorFunc = (void(*)(GLenum))fn;
|
||||
#else
|
||||
qobj->ErrorFunc = (void(GLCALLBACKP)())fn;
|
||||
qobj->ErrorFunc = (void(GLCALLBACK*)())fn;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -392,8 +316,8 @@ void GLAPIENTRY gluCylinder( GLUquadricObj *qobj,
|
||||
for (i=0;i<=slices;i++) {
|
||||
GLfloat x, y;
|
||||
if (i == slices) {
|
||||
x = sin(0);
|
||||
y = cos(0);
|
||||
x = sin(0.0);
|
||||
y = cos(0.0);
|
||||
}
|
||||
else {
|
||||
x = sin(i * da);
|
||||
@@ -783,7 +707,7 @@ void GLAPIENTRY gluPartialDisk( GLUquadricObj *qobj, GLdouble innerRadius,
|
||||
for (loop=0; loop<loops; loop++) {
|
||||
angle = DEG_TO_RAD(startAngle);
|
||||
glBegin( GL_LINE_STRIP );
|
||||
for (slice=0; slice<slices; slice++) {
|
||||
for (slice=0; slice<=slices; slice++) {
|
||||
glVertex2d( radius * sin(angle), radius * cos(angle) );
|
||||
angle += delta_angle;
|
||||
}
|
||||
@@ -792,7 +716,7 @@ void GLAPIENTRY gluPartialDisk( GLUquadricObj *qobj, GLdouble innerRadius,
|
||||
}
|
||||
/* draw spokes */
|
||||
angle = DEG_TO_RAD(startAngle);
|
||||
for (slice=0; slice<slices; slice++) {
|
||||
for (slice=0; slice<=slices; slice++) {
|
||||
radius = innerRadius;
|
||||
glBegin( GL_LINE_STRIP );
|
||||
for (loop=0; loop<loops; loop++) {
|
||||
@@ -846,7 +770,7 @@ void GLAPIENTRY gluPartialDisk( GLUquadricObj *qobj, GLdouble innerRadius,
|
||||
for (loop=0; loop<loops; loop++) {
|
||||
glBegin( GL_QUAD_STRIP );
|
||||
angle = DEG_TO_RAD(startAngle);
|
||||
for (slice=0; slice<slices; slice++) {
|
||||
for (slice=0; slice<=slices; slice++) {
|
||||
if (qobj->Orientation==GLU_OUTSIDE) {
|
||||
glVertex2d( (radius+delta_radius)*sin(angle),
|
||||
(radius+delta_radius)*cos(angle) );
|
||||
|
@@ -1,10 +1,10 @@
|
||||
/* $Id: tess.c,v 1.20.2.7 1999/12/05 17:01:17 gareth Exp $ */
|
||||
/* $Id: tess.c,v 1.20.2.9 2000/02/10 17:23:48 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.1
|
||||
* Version: 3.2
|
||||
*
|
||||
* Copyright (C) 1999 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -83,19 +83,19 @@ void tess_error_callback( GLUtesselator *tobj, GLenum errnum )
|
||||
*****************************************************************************/
|
||||
static void init_callbacks( tess_callbacks_t *callbacks )
|
||||
{
|
||||
callbacks->begin = ( void (GLCALLBACK*)(GLenum) ) NULL;
|
||||
callbacks->beginData = ( void (GLCALLBACK*)(GLenum, void *) ) NULL;
|
||||
callbacks->edgeFlag = ( void (GLCALLBACK*)(GLboolean) ) NULL;
|
||||
callbacks->edgeFlagData = ( void (GLCALLBACK*)(GLboolean, void *) ) NULL;
|
||||
callbacks->vertex = ( void (GLCALLBACK*)(void *) ) NULL;
|
||||
callbacks->vertexData = ( void (GLCALLBACK*)(void *, void *) ) NULL;
|
||||
callbacks->end = ( void (GLCALLBACK*)(void) ) NULL;
|
||||
callbacks->endData = ( void (GLCALLBACK*)(void *) ) NULL;
|
||||
callbacks->error = ( void (GLCALLBACK*)(GLenum) ) NULL;
|
||||
callbacks->errorData = ( void (GLCALLBACK*)(GLenum, void *) ) NULL;
|
||||
callbacks->combine = ( void (GLCALLBACK*)(GLdouble [3], void *[4],
|
||||
callbacks->begin = ( void (GLCALLBACKPCAST)(GLenum) ) NULL;
|
||||
callbacks->beginData = ( void (GLCALLBACKPCAST)(GLenum, void *) ) NULL;
|
||||
callbacks->edgeFlag = ( void (GLCALLBACKPCAST)(GLboolean) ) NULL;
|
||||
callbacks->edgeFlagData = ( void (GLCALLBACKPCAST)(GLboolean, void *) ) NULL;
|
||||
callbacks->vertex = ( void (GLCALLBACKPCAST)(void *) ) NULL;
|
||||
callbacks->vertexData = ( void (GLCALLBACKPCAST)(void *, void *) ) NULL;
|
||||
callbacks->end = ( void (GLCALLBACKPCAST)(void) ) NULL;
|
||||
callbacks->endData = ( void (GLCALLBACKPCAST)(void *) ) NULL;
|
||||
callbacks->error = ( void (GLCALLBACKPCAST)(GLenum) ) NULL;
|
||||
callbacks->errorData = ( void (GLCALLBACKPCAST)(GLenum, void *) ) NULL;
|
||||
callbacks->combine = ( void (GLCALLBACKPCAST)(GLdouble [3], void *[4],
|
||||
GLfloat [4], void **) ) NULL;
|
||||
callbacks->combineData = ( void (GLCALLBACK*)(GLdouble [3], void *[4],
|
||||
callbacks->combineData = ( void (GLCALLBACKPCAST)(GLdouble [3], void *[4],
|
||||
GLfloat [4], void **,
|
||||
void *) ) NULL;
|
||||
}
|
||||
@@ -558,8 +558,8 @@ GLUtesselator* GLAPIENTRY gluNewTess( void )
|
||||
GLUtesselator *tobj;
|
||||
|
||||
#ifdef DEBUG
|
||||
if ( getenv( "GLU_TESS_DBG_LEVEL" ) ) {
|
||||
tess_dbg_level = atoi( getenv( "GLU_TESS_DBG_LEVEL" ) );
|
||||
if ( getenv( "MESA_TESS_DBG_LEVEL" ) ) {
|
||||
tess_dbg_level = atoi( getenv( "MESA_TESS_DBG_LEVEL" ) );
|
||||
} else {
|
||||
tess_dbg_level = DBG_LEVEL_BASE;
|
||||
}
|
||||
@@ -883,55 +883,50 @@ void GLAPIENTRY gluTessCallback( GLUtesselator *tobj, GLenum which,
|
||||
{
|
||||
/* Register the begin callbacks. */
|
||||
case GLU_TESS_BEGIN:
|
||||
tobj->callbacks.begin = (void (GLCALLBACK*)(GLenum)) fn;
|
||||
tobj->callbacks.begin = (void (GLCALLBACKPCAST)(GLenum)) fn;
|
||||
break;
|
||||
case GLU_TESS_BEGIN_DATA:
|
||||
tobj->callbacks.beginData = (void (GLCALLBACK*)(GLenum, void *)) fn;
|
||||
tobj->callbacks.beginData = (void (GLCALLBACKPCAST)(GLenum, void *)) fn;
|
||||
break;
|
||||
|
||||
/* Register the edge flag callbacks. */
|
||||
case GLU_TESS_EDGE_FLAG:
|
||||
tobj->callbacks.edgeFlag = (void (GLCALLBACK*)(GLboolean)) fn;
|
||||
tobj->callbacks.edgeFlag = (void (GLCALLBACKPCAST)(GLboolean)) fn;
|
||||
break;
|
||||
case GLU_TESS_EDGE_FLAG_DATA:
|
||||
tobj->callbacks.edgeFlagData =
|
||||
(void (GLCALLBACK*)(GLboolean, void *)) fn;
|
||||
tobj->callbacks.edgeFlagData = (void (GLCALLBACKPCAST)(GLboolean, void *)) fn;
|
||||
break;
|
||||
|
||||
/* Register the vertex callbacks. */
|
||||
case GLU_TESS_VERTEX:
|
||||
tobj->callbacks.vertex = (void (GLCALLBACK*)(void *)) fn;
|
||||
tobj->callbacks.vertex = (void (GLCALLBACKPCAST)(void *)) fn;
|
||||
break;
|
||||
case GLU_TESS_VERTEX_DATA:
|
||||
tobj->callbacks.vertexData = (void (GLCALLBACK*)(void *, void *)) fn;
|
||||
tobj->callbacks.vertexData = (void (GLCALLBACKPCAST)(void *, void *)) fn;
|
||||
break;
|
||||
|
||||
/* Register the end callbacks. */
|
||||
case GLU_TESS_END:
|
||||
tobj->callbacks.end = (void (GLCALLBACK*)(void)) fn;
|
||||
tobj->callbacks.end = (void (GLCALLBACKPCAST)(void)) fn;
|
||||
break;
|
||||
case GLU_TESS_END_DATA:
|
||||
tobj->callbacks.endData = (void (GLCALLBACK*)(void *)) fn;
|
||||
tobj->callbacks.endData = (void (GLCALLBACKPCAST)(void *)) fn;
|
||||
break;
|
||||
|
||||
/* Register the error callbacks. */
|
||||
case GLU_TESS_ERROR:
|
||||
tobj->callbacks.error = (void (GLCALLBACK*)(GLenum)) fn;
|
||||
tobj->callbacks.error = (void (GLCALLBACKPCAST)(GLenum)) fn;
|
||||
break;
|
||||
case GLU_TESS_ERROR_DATA:
|
||||
tobj->callbacks.errorData = (void (GLCALLBACK*)(GLenum, void *)) fn;
|
||||
tobj->callbacks.errorData = (void (GLCALLBACKPCAST)(GLenum, void *)) fn;
|
||||
break;
|
||||
|
||||
/* Register the combine callbacks. */
|
||||
case GLU_TESS_COMBINE:
|
||||
tobj->callbacks.combine =
|
||||
(void (GLCALLBACK*)(GLdouble[3], void *[4],
|
||||
GLfloat [4], void **)) fn;
|
||||
tobj->callbacks.combine = (void (GLCALLBACKPCAST)(GLdouble[3], void *[4], GLfloat [4], void **)) fn;
|
||||
break;
|
||||
case GLU_TESS_COMBINE_DATA:
|
||||
tobj->callbacks.combineData =
|
||||
(void (GLCALLBACK*)(GLdouble[3], void *[4], GLfloat [4],
|
||||
void **, void *)) fn;
|
||||
tobj->callbacks.combineData = (void (GLCALLBACKPCAST)(GLdouble[3], void *[4], GLfloat [4], void **, void *)) fn;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@@ -303,8 +303,7 @@ interruptibleXNextEvent(Display * dpy, XEvent * event)
|
||||
}
|
||||
FD_ZERO(&fds);
|
||||
FD_SET(__glutConnectionFD, &fds);
|
||||
rc = select(__glutConnectionFD + 1, &fds,
|
||||
NULL, NULL, NULL);
|
||||
rc = select(__glutConnectionFD + 1, &fds, NULL, NULL, NULL);
|
||||
if (rc < 0) {
|
||||
if (errno == EINTR) {
|
||||
return 0;
|
||||
@@ -897,8 +896,7 @@ waitForSomething(void)
|
||||
waittime = zerotime;
|
||||
}
|
||||
#if !defined(_WIN32)
|
||||
rc = select(__glutConnectionFD + 1, &fds,
|
||||
NULL, NULL, &waittime);
|
||||
rc = select(__glutConnectionFD + 1, &fds, NULL, NULL, &waittime);
|
||||
if (rc < 0 && errno != EINTR)
|
||||
__glutFatalError("select error.");
|
||||
#else
|
||||
|
@@ -20,7 +20,9 @@
|
||||
#include <X11/Xutil.h>
|
||||
#else
|
||||
#include <windows.h>
|
||||
#ifndef __CYGWIN32__
|
||||
#include <mmsystem.h> /* Win32 Multimedia API header. */
|
||||
#endif
|
||||
#endif /* !_WIN32 */
|
||||
|
||||
#include "glutint.h"
|
||||
|
@@ -7,8 +7,10 @@
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#ifndef __CYGWIN32__
|
||||
#include <mmsystem.h> /* Win32 Multimedia API header. */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "glutint.h"
|
||||
|
||||
|
@@ -24,7 +24,7 @@
|
||||
#define GLUT_BUILDING_LIB /* Building the GLUT library itself. */
|
||||
#include <GL/glut.h>
|
||||
|
||||
#if defined( MESA ) && defined( _WIN32 )
|
||||
#if defined(MESA) && defined(_WIN32) && !defined(__CYGWIN32__)
|
||||
#include <gl/mesa_wgl.h>
|
||||
#endif
|
||||
|
||||
@@ -71,7 +71,7 @@ extern int sys$gettim(struct timeval *);
|
||||
#endif
|
||||
#else
|
||||
#include <sys/types.h>
|
||||
#if !defined(_WIN32)
|
||||
#if !defined(_WIN32) || defined(__CYGWIN32__)
|
||||
#include <sys/time.h>
|
||||
#else
|
||||
#include <winsock.h>
|
||||
|
@@ -40,9 +40,57 @@
|
||||
#define XA_STRING 0
|
||||
|
||||
/* Private routines from win32_util.c */
|
||||
#ifndef __CYGWIN32__
|
||||
extern int gettimeofday(struct timeval* tp, void* tzp);
|
||||
#endif
|
||||
extern void *__glutFont(void *font);
|
||||
extern int __glutGetTransparentPixel(Display *dpy, XVisualInfo *vinfo);
|
||||
extern void __glutAdjustCoords(Window parent, int *x, int *y, int *width, int *height);
|
||||
|
||||
|
||||
/* Cygwin B20.1 misses the following definitions */
|
||||
#ifdef __CYGWIN32__
|
||||
|
||||
/* from winuser.h */
|
||||
#define CDS_FULLSCREEN 4
|
||||
|
||||
/* from mmsystem.h */
|
||||
#define WINMMAPI __declspec(dllimport)
|
||||
typedef UINT MMRESULT;
|
||||
|
||||
#define MM_JOY1MOVE 0x3A0
|
||||
#define MM_JOY1ZMOVE 0x3A2
|
||||
#define MM_JOY1BUTTONDOWN 0x3B5
|
||||
#define MM_JOY1BUTTONUP 0x3B7
|
||||
|
||||
#define JOYERR_NOERROR 0
|
||||
#define JOYERR_PARMS 165
|
||||
|
||||
#define JOY_RETURNALL 0x000000ffl
|
||||
|
||||
#define JOYSTICKID1 0
|
||||
|
||||
typedef struct joyinfoex_tag {
|
||||
DWORD dwSize; /* size of structure */
|
||||
DWORD dwFlags; /* flags to indicate what to return */
|
||||
DWORD dwXpos; /* x position */
|
||||
DWORD dwYpos; /* y position */
|
||||
DWORD dwZpos; /* z position */
|
||||
DWORD dwRpos; /* rudder/4th axis position */
|
||||
DWORD dwUpos; /* 5th axis position */
|
||||
DWORD dwVpos; /* 6th axis position */
|
||||
DWORD dwButtons; /* button states */
|
||||
DWORD dwButtonNumber; /* current button number pressed */
|
||||
DWORD dwPOV; /* point of view state */
|
||||
DWORD dwReserved1; /* reserved for communication between winmm & driver */
|
||||
DWORD dwReserved2; /* reserved for future expansion */
|
||||
} JOYINFOEX, *PJOYINFOEX, /* NEAR */ *NPJOYINFOEX, /* FAR */ *LPJOYINFOEX;
|
||||
|
||||
WINMMAPI MMRESULT WINAPI joyGetPosEx( UINT uJoyID, LPJOYINFOEX pji);
|
||||
WINMMAPI MMRESULT WINAPI joyReleaseCapture( UINT uJoyID);
|
||||
WINMMAPI MMRESULT WINAPI joySetCapture( HWND hwnd, UINT uJoyID, UINT uPeriod, BOOL fChanged);
|
||||
WINMMAPI MMRESULT WINAPI joySetThreshold( UINT uJoyID, UINT uThreshold);
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* __glutwin32_h__ */
|
||||
|
@@ -11,11 +11,7 @@
|
||||
#include "glutint.h"
|
||||
#include "glutstroke.h"
|
||||
#include "glutbitmap.h"
|
||||
#if defined(__CYGWIN32__)
|
||||
typedef MINMAXINFO* LPMINMAXINFO;
|
||||
#else
|
||||
#include <sys/timeb.h>
|
||||
#endif
|
||||
|
||||
/* The following added by Paul Garceau <pgarceau@teleport.com> */
|
||||
#if defined(__MINGW32__)
|
||||
@@ -27,6 +23,7 @@ struct timeval;
|
||||
extern StrokeFontRec glutStrokeRoman, glutStrokeMonoRoman;
|
||||
extern BitmapFontRec glutBitmap8By13, glutBitmap9By15, glutBitmapTimesRoman10, glutBitmapTimesRoman24, glutBitmapHelvetica10, glutBitmapHelvetica12, glutBitmapHelvetica18;
|
||||
|
||||
#ifndef __CYGWIN32__
|
||||
int
|
||||
gettimeofday(struct timeval* tp, void* tzp)
|
||||
{
|
||||
@@ -39,6 +36,7 @@ gettimeofday(struct timeval* tp, void* tzp)
|
||||
/* 0 indicates that the call succeeded. */
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* To get around the fact that Microsoft DLLs only allow functions
|
||||
to be exported and now data addresses (as Unix DSOs support), the
|
||||
|
@@ -8,13 +8,9 @@
|
||||
|
||||
|
||||
#include "glutint.h"
|
||||
#if defined(__CYGWIN32__)
|
||||
typedef MINMAXINFO* LPMINMAXINFO;
|
||||
#else
|
||||
#include <sys/timeb.h>
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32) && !defined(__CYGWIN32__)
|
||||
#include <mmsystem.h> /* Win32 Multimedia API header. */
|
||||
#endif
|
||||
|
||||
|
@@ -1,59 +1 @@
|
||||
# Makefile for OpenGL widgets
|
||||
|
||||
# NOTE: widget code is from SGI. See any of the .c or .h files for the
|
||||
# complete copyright. Mesa's GNU copyright DOES NOT apply to this widget
|
||||
# code.
|
||||
|
||||
|
||||
##### MACROS #####
|
||||
|
||||
VPATH = RCS
|
||||
|
||||
INCDIRS = -I../include -I/usr/include/Motif1.2 -I/usr/X11R6/include
|
||||
LIBDIR = ../lib
|
||||
|
||||
SOURCES = GLwDrawA.c GLwMDrawA.c
|
||||
|
||||
|
||||
OBJECTS = $(SOURCES:.c=.o)
|
||||
|
||||
|
||||
|
||||
##### RULES #####
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(INCDIRS) $(CFLAGS) $<
|
||||
|
||||
|
||||
|
||||
##### TARGETS #####
|
||||
|
||||
default:
|
||||
@echo "Specify a target configuration"
|
||||
|
||||
clean:
|
||||
-rm *.o *~
|
||||
|
||||
# The name of the library file comes from Make-config
|
||||
#XXX GLW_LIB = libGLw.a
|
||||
|
||||
targets: $(LIBDIR)/$(GLW_LIB)
|
||||
|
||||
|
||||
# Make the library
|
||||
$(LIBDIR)/$(GLW_LIB): $(OBJECTS)
|
||||
$(MAKELIB) $(GLW_LIB) $(MAJOR) $(MINOR) $(OBJECTS)
|
||||
mv $(GLW_LIB)* $(LIBDIR)
|
||||
|
||||
include ../Make-config
|
||||
|
||||
include depend
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Run 'make depend' to update the dependencies if you change what's included
|
||||
# by any source file.
|
||||
#
|
||||
dep: $(SOURCES)
|
||||
makedepend -fdepend -Y -I../include $(SOURCES)
|
||||
include Makefile.X11
|
||||
|
64
src/glw/Makefile.X11
Normal file
64
src/glw/Makefile.X11
Normal file
@@ -0,0 +1,64 @@
|
||||
# Makefile for OpenGL widgets
|
||||
|
||||
# NOTE: widget code is from SGI. See any of the .c or .h files for the
|
||||
# complete copyright. Mesa's GNU copyright DOES NOT apply to this widget
|
||||
# code.
|
||||
|
||||
|
||||
##### MACROS #####
|
||||
|
||||
MAJOR = 1
|
||||
MINOR = 0
|
||||
TINY = 0
|
||||
|
||||
VPATH = RCS
|
||||
|
||||
INCDIRS = -I../include -I/usr/include/Motif1.2 -I/usr/X11R6/include
|
||||
LIBDIR = ../lib
|
||||
|
||||
# Compile GLwMDrawA.c only if you have Motif headers!
|
||||
#SOURCES = GLwDrawA.c GLwMDrawA.c
|
||||
SOURCES = GLwDrawA.c
|
||||
|
||||
|
||||
OBJECTS = $(SOURCES:.c=.o)
|
||||
|
||||
|
||||
|
||||
##### RULES #####
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(INCDIRS) $(CFLAGS) $<
|
||||
|
||||
|
||||
|
||||
##### TARGETS #####
|
||||
|
||||
default:
|
||||
@echo "Specify a target configuration"
|
||||
|
||||
clean:
|
||||
-rm *.o *~
|
||||
|
||||
targets: $(LIBDIR)/$(GLW_LIB)
|
||||
|
||||
|
||||
# Make the library
|
||||
$(LIBDIR)/$(GLW_LIB): $(OBJECTS)
|
||||
$(MAKELIB) $(GLW_LIB) $(MAJOR) $(MINOR) $(TINY) $(OBJECTS)
|
||||
mv $(GLW_LIB)* $(LIBDIR)
|
||||
-mv *.a $(LIBDIR)
|
||||
|
||||
|
||||
include ../Make-config
|
||||
|
||||
include depend
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Run 'make depend' to update the dependencies if you change what's included
|
||||
# by any source file.
|
||||
#
|
||||
dep: $(SOURCES)
|
||||
makedepend -fdepend -Y -I../include $(SOURCES)
|
@@ -1,4 +1,4 @@
|
||||
# $Id: Makefile.X11,v 1.6.2.1 1999/11/16 15:25:50 brianp Exp $
|
||||
# $Id: Makefile.X11,v 1.6.2.2 2000/01/23 17:47:00 brianp Exp $
|
||||
|
||||
# Mesa 3-D graphics library
|
||||
# Version: 3.1
|
||||
@@ -104,6 +104,11 @@ DRIVER_SOURCES = \
|
||||
X/xmesa4.c \
|
||||
OSmesa/osmesa.c \
|
||||
SVGA/svgamesa.c \
|
||||
SVGA/svgamesa8.c \
|
||||
SVGA/svgamesa15.c \
|
||||
SVGA/svgamesa16.c \
|
||||
SVGA/svgamesa24.c \
|
||||
SVGA/svgamesa32.c \
|
||||
FX/fxapi.c \
|
||||
FX/fxclip.c \
|
||||
FX/fxcva.c \
|
||||
|
@@ -975,7 +975,7 @@ fxMesaContext GLAPIENTRY fxMesaCreateContext(GLuint win,
|
||||
|
||||
/* Pixel tables are use during pixel read-back */
|
||||
#if FXMESA_USE_ARGB
|
||||
fxInitPixelTables(GL_FALSE); /* Force RGB pixel order */
|
||||
fxInitPixelTables(fxMesa, GL_FALSE); /* Force RGB pixel order */
|
||||
#else
|
||||
if (glbHWConfig.SSTs[glbCurrentBoard].type == GR_SSTTYPE_VOODOO) {
|
||||
/* jk991130 - GROSS HACK!!! - Voodoo 3s don't use BGR!!
|
||||
@@ -985,14 +985,14 @@ fxMesaContext GLAPIENTRY fxMesaCreateContext(GLuint win,
|
||||
* Thanks to Joseph Kain for that one
|
||||
*/
|
||||
if (glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig.nTexelfx == 2) {
|
||||
fxInitPixelTables(GL_FALSE); /* use RGB pixel order (Voodoo3) */
|
||||
fxInitPixelTables(fxMesa, GL_FALSE); /* use RGB pixel order (Voodoo3) */
|
||||
}
|
||||
else {
|
||||
fxInitPixelTables(GL_TRUE); /* use BGR pixel order on Voodoo1/2 */
|
||||
fxInitPixelTables(fxMesa, GL_TRUE); /* use BGR pixel order on Voodoo1/2 */
|
||||
}
|
||||
}
|
||||
else {
|
||||
fxInitPixelTables(GL_FALSE); /* use RGB pixel order otherwise */
|
||||
fxInitPixelTables(fxMesa, GL_FALSE); /* use RGB pixel order otherwise */
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1055,7 +1055,8 @@ fxMesaContext GLAPIENTRY fxMesaCreateContext(GLuint win,
|
||||
|
||||
/* install signal handlers */
|
||||
#if defined(__linux__)
|
||||
if (fxMesa->glCtx->CatchSignals) {
|
||||
/* Only install if environment var. is not set. */
|
||||
if (fxMesa->glCtx->CatchSignals && !getenv("MESA_FX_NO_SIGNALS")) {
|
||||
signal(SIGINT,cleangraphics_handler);
|
||||
signal(SIGHUP,cleangraphics_handler);
|
||||
signal(SIGPIPE,cleangraphics_handler);
|
||||
@@ -1298,7 +1299,10 @@ int GLAPIENTRY fxQueryHardware(void)
|
||||
#if defined(__WIN32__)
|
||||
onexit((_onexit_t)cleangraphics);
|
||||
#elif defined(__linux__)
|
||||
atexit(cleangraphics);
|
||||
/* Only register handler if environment variable is not defined. */
|
||||
if (!getenv("MESA_FX_NO_SIGNALS")) {
|
||||
atexit(cleangraphics);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@@ -70,9 +70,11 @@ GLubyte FX_PixelToB[0x10000];
|
||||
* Initialize the FX_PixelTo{RGB} arrays.
|
||||
* Input: bgrOrder - if TRUE, pixels are in BGR order, else RGB order.
|
||||
*/
|
||||
void fxInitPixelTables(GLboolean bgrOrder)
|
||||
void fxInitPixelTables(fxMesaContext fxMesa, GLboolean bgrOrder)
|
||||
{
|
||||
GLuint pixel;
|
||||
|
||||
fxMesa->bgrOrder=bgrOrder;
|
||||
for (pixel = 0; pixel <= 0xffff; pixel++) {
|
||||
GLuint r, g, b;
|
||||
if (bgrOrder) {
|
||||
@@ -374,10 +376,16 @@ static GLboolean fxDDDrawBitMap(GLcontext *ctx, GLint px, GLint py,
|
||||
g=(GLint)(ctx->Current.RasterColor[1]*255.0f);
|
||||
b=(GLint)(ctx->Current.RasterColor[2]*255.0f);
|
||||
a=(GLint)(ctx->Current.RasterColor[3]*255.0f);
|
||||
color=(FxU16)
|
||||
( ((FxU16)0xf8 & b) <<(11-3)) |
|
||||
( ((FxU16)0xfc & g) <<(5-3+1)) |
|
||||
( ((FxU16)0xf8 & r) >> 3);
|
||||
if (fxMesa->bgrOrder)
|
||||
color=(FxU16)
|
||||
( ((FxU16)0xf8 & b) <<(11-3)) |
|
||||
( ((FxU16)0xfc & g) <<(5-3+1)) |
|
||||
( ((FxU16)0xf8 & r) >> 3);
|
||||
else
|
||||
color=(FxU16)
|
||||
( ((FxU16)0xf8 & r) <<(11-3)) |
|
||||
( ((FxU16)0xfc & g) <<(5-3+1)) |
|
||||
( ((FxU16)0xf8 & b) >> 3);
|
||||
|
||||
stride=info.strideInBytes>>1;
|
||||
|
||||
|
@@ -79,7 +79,7 @@ FxBool writeRegionClipped(fxMesaContext fxMesa, GrBuffer_t dst_buffer,
|
||||
FxU32 src_width, FxU32 src_height, FxI32 src_stride,
|
||||
void *src_data)
|
||||
{
|
||||
int i, x, w;
|
||||
int i, x, w, srcElt;
|
||||
void *data;
|
||||
|
||||
if (src_width==1 && src_height==1) { /* Easy case writing a point */
|
||||
@@ -89,16 +89,22 @@ FxBool writeRegionClipped(fxMesaContext fxMesa, GrBuffer_t dst_buffer,
|
||||
(dst_y>=fxMesa->pClipRects[i].y1) &&
|
||||
(dst_y<fxMesa->pClipRects[i].y2)) {
|
||||
FX_grLfbWriteRegion(dst_buffer, dst_x, dst_y, src_format,
|
||||
src_width, src_height, src_stride, src_data);
|
||||
1, 1, src_stride, src_data);
|
||||
return GL_TRUE;
|
||||
}
|
||||
}
|
||||
} else if (src_height==1) { /* Writing a span */
|
||||
if (src_format==GR_LFB_SRC_FMT_8888) srcElt=4;
|
||||
else if (src_format==GR_LFB_SRC_FMT_ZA16) srcElt=2;
|
||||
else {
|
||||
fprintf(stderr, "Unknown src_format passed to writeRegionClipped\n");
|
||||
return GL_FALSE;
|
||||
}
|
||||
for (i=0; i<fxMesa->numClipRects; i++) {
|
||||
if (dst_y>=fxMesa->pClipRects[i].y1 && dst_y<fxMesa->pClipRects[i].y2) {
|
||||
if (dst_x<fxMesa->pClipRects[i].x1) {
|
||||
x=fxMesa->pClipRects[i].x1;
|
||||
data=((char*)src_data)+2*(dst_x-x);
|
||||
data=((char*)src_data)+srcElt*(dst_x-x);
|
||||
w=src_width-(x-dst_x);
|
||||
} else {
|
||||
x=dst_x;
|
||||
@@ -108,7 +114,7 @@ FxBool writeRegionClipped(fxMesaContext fxMesa, GrBuffer_t dst_buffer,
|
||||
if (x+w>fxMesa->pClipRects[i].x2) {
|
||||
w=fxMesa->pClipRects[i].x2-x;
|
||||
}
|
||||
FX_grLfbWriteRegion(dst_buffer, x, dst_y, src_format, w, src_height,
|
||||
FX_grLfbWriteRegion(dst_buffer, x, dst_y, src_format, w, 1,
|
||||
src_stride, data);
|
||||
}
|
||||
}
|
||||
|
@@ -255,10 +255,10 @@ typedef struct {
|
||||
|
||||
#define FX_UM_E_IFMT 0x00fff000
|
||||
|
||||
#define FX_UM_COLOR_ITERATED 0x00100000
|
||||
#define FX_UM_COLOR_CONSTANT 0x00200000
|
||||
#define FX_UM_ALPHA_ITERATED 0x00400000
|
||||
#define FX_UM_ALPHA_CONSTANT 0x00800000
|
||||
#define FX_UM_COLOR_ITERATED 0x01000000
|
||||
#define FX_UM_COLOR_CONSTANT 0x02000000
|
||||
#define FX_UM_ALPHA_ITERATED 0x04000000
|
||||
#define FX_UM_ALPHA_CONSTANT 0x08000000
|
||||
|
||||
typedef void (*tfxRenderVBFunc)(GLcontext *);
|
||||
|
||||
@@ -437,6 +437,7 @@ struct tfxMesaContext {
|
||||
|
||||
GrBuffer_t currentFB;
|
||||
|
||||
GLboolean bgrOrder;
|
||||
GrColor_t color;
|
||||
GrColor_t clearC;
|
||||
GrAlpha_t clearA;
|
||||
@@ -475,6 +476,7 @@ struct tfxMesaContext {
|
||||
|
||||
GLenum fogTableMode;
|
||||
GLfloat fogDensity;
|
||||
GLfloat fogStart, fogEnd;
|
||||
GrFog_t *fogTable;
|
||||
|
||||
/* Acc. functions */
|
||||
@@ -618,6 +620,7 @@ extern void fxTMInit(fxMesaContext ctx);
|
||||
extern void fxTMClose(fxMesaContext ctx);
|
||||
extern void fxTMMoveInTM(fxMesaContext, struct gl_texture_object *, GLint);
|
||||
extern void fxTMMoveOutTM(fxMesaContext, struct gl_texture_object *);
|
||||
#define fxTMMoveOutTM_NoLock fxTMMoveOutTM
|
||||
extern void fxTMFreeTexture(fxMesaContext, struct gl_texture_object *);
|
||||
extern void fxTMReloadMipMapLevel(fxMesaContext, struct gl_texture_object *, GLint);
|
||||
extern void fxTMReloadSubMipMapLevel(fxMesaContext, struct gl_texture_object *,
|
||||
@@ -670,9 +673,6 @@ extern void fxSetScissorValues(GLcontext *ctx);
|
||||
extern void fxTMMoveInTM_NoLock(fxMesaContext fxMesa,
|
||||
struct gl_texture_object *tObj,
|
||||
GLint where);
|
||||
extern void fxSetupTexture_NoLock(GLcontext *ctx);
|
||||
extern void fxSetupTexture(GLcontext *ctx);
|
||||
|
||||
extern void fxInitPixelTables(GLboolean bgrOrder);
|
||||
extern void fxInitPixelTables(fxMesaContext fxMesa, GLboolean bgrOrder);
|
||||
|
||||
#endif
|
||||
|
@@ -392,7 +392,7 @@ FX_GrContext_t FX_grSstWinOpen( FxU32 hWnd,
|
||||
nColBuffers,
|
||||
nAuxBuffers );
|
||||
|
||||
#if 0
|
||||
/*
|
||||
fprintf(stderr,
|
||||
"grSstWinOpen( win %d res %d ref %d fmt %d\n"
|
||||
" org %d ncol %d naux %d )\n"
|
||||
@@ -405,7 +405,7 @@ FX_GrContext_t FX_grSstWinOpen( FxU32 hWnd,
|
||||
nColBuffers,
|
||||
nAuxBuffers,
|
||||
i);
|
||||
#endif
|
||||
*/
|
||||
END_BOARD_LOCK();
|
||||
return i;
|
||||
}
|
||||
|
@@ -59,18 +59,17 @@ static GLuint fxGetTexSetConfiguration(GLcontext *ctx,
|
||||
struct gl_texture_object *tObj0,
|
||||
struct gl_texture_object *tObj1);
|
||||
static void fxSetupTextureSingleTMU_NoLock(GLcontext *ctx, GLuint textureset);
|
||||
static void fxSetupTextureSingleTMU(GLcontext *ctx, GLuint textureset);
|
||||
static void fxSetupDoubleTMU_NoLock(fxMesaContext fxMesa,
|
||||
struct gl_texture_object *tObj0,
|
||||
struct gl_texture_object *tObj1);
|
||||
static void fxSetupTexture_NoLock(GLcontext *ctx);
|
||||
static void fxSetupTexture(GLcontext *ctx);
|
||||
static void fxSetupBlend(GLcontext *ctx);
|
||||
static void fxSetupDepthTest(GLcontext *ctx);
|
||||
static void fxFogTableGenerate(GLcontext *ctx);
|
||||
static void fxSetupFog(GLcontext *ctx, GLboolean forceTableRebuild);
|
||||
static void fxSetupScissor(GLcontext *ctx);
|
||||
static void fxSetupCull(GLcontext *ctx);
|
||||
static void gl_print_fx_state_flags( const char *msg, GLuint flags);
|
||||
/*static GLboolean fxMultipassBlend(struct vertex_buffer *, GLuint);*/
|
||||
static GLboolean fxMultipassBlend(struct vertex_buffer *, GLuint);
|
||||
static GLboolean fxMultipassTexture( struct vertex_buffer *, GLuint );
|
||||
|
||||
static void fxTexValidate(GLcontext *ctx, struct gl_texture_object *tObj)
|
||||
@@ -120,7 +119,7 @@ static void fxTexValidate(GLcontext *ctx, struct gl_texture_object *tObj)
|
||||
ti->sClamp=0;
|
||||
break;
|
||||
default:
|
||||
;
|
||||
; /* silence compiler warning */
|
||||
}
|
||||
switch (tObj->WrapT) {
|
||||
case GL_CLAMP_TO_EDGE:
|
||||
@@ -132,7 +131,7 @@ static void fxTexValidate(GLcontext *ctx, struct gl_texture_object *tObj)
|
||||
ti->tClamp=0;
|
||||
break;
|
||||
default:
|
||||
;
|
||||
; /* silence compiler warning */
|
||||
}
|
||||
|
||||
ti->validated=GL_TRUE;
|
||||
@@ -197,6 +196,10 @@ static GLuint fxGetTexSetConfiguration(GLcontext *ctx,
|
||||
else
|
||||
unitsmode|=FX_UM_COLOR_CONSTANT;
|
||||
|
||||
/*
|
||||
OpenGL Feeds Texture 0 into Texture 1
|
||||
Glide Feeds Texture 1 into Texture 0
|
||||
*/
|
||||
if(tObj0) {
|
||||
tfxTexInfo *ti0=fxTMGetTexInfo(tObj0);
|
||||
|
||||
@@ -294,7 +297,7 @@ static GLuint fxGetTexSetConfiguration(GLcontext *ctx,
|
||||
|
||||
unitsmode|=(ifmt | envmode);
|
||||
|
||||
if (MESA_VERBOSE & (VERBOSE_DRIVER|VERBOSE_TEXTURE))
|
||||
if (MESA_VERBOSE & (VERBOSE_DRIVER|VERBOSE_TEXTURE))
|
||||
fxPrintUnitsMode("unitsmode", unitsmode);
|
||||
|
||||
return unitsmode;
|
||||
@@ -309,18 +312,25 @@ static GLuint fxGetTexSetConfiguration(GLcontext *ctx,
|
||||
static void fxSetupSingleTMU_NoLock(fxMesaContext fxMesa, struct gl_texture_object *tObj)
|
||||
{
|
||||
tfxTexInfo *ti=fxTMGetTexInfo(tObj);
|
||||
int tmu;
|
||||
|
||||
/* Make sure we're not loaded incorrectly */
|
||||
if (ti->isInTM) {
|
||||
if (ti->LODblend) {
|
||||
if (ti->whichTMU!=FX_TMU_SPLIT)
|
||||
fxTMMoveOutTM(fxMesa, tObj);
|
||||
} else {
|
||||
if (ti->whichTMU==FX_TMU_SPLIT)
|
||||
fxTMMoveOutTM(fxMesa, tObj);
|
||||
}
|
||||
}
|
||||
|
||||
/* Make sure we're loaded correctly */
|
||||
if (!ti->isInTM) {
|
||||
if (ti->LODblend)
|
||||
fxTMMoveInTM_NoLock(fxMesa,tObj,FX_TMU_SPLIT);
|
||||
else {
|
||||
if (fxMesa->haveTwoTMUs) {
|
||||
#if 0
|
||||
/* This path is disabled because we're not correctly setting up
|
||||
the second TMU as the only texture unit. It is arguable if this
|
||||
fallback is ever really a win, because when we use the second
|
||||
TMU we have to do setup for both TMU0 and TMU1 which is extra
|
||||
work. We could just flush a texture from TMU0 instead. */
|
||||
if (fxMesa->freeTexMem[FX_TMU0] >
|
||||
FX_grTexTextureMemRequired_NoLock(GR_MIPMAPLEVELMASK_BOTH,
|
||||
&(ti->info))) {
|
||||
@@ -328,9 +338,6 @@ static void fxSetupSingleTMU_NoLock(fxMesaContext fxMesa, struct gl_texture_obje
|
||||
} else {
|
||||
fxTMMoveInTM_NoLock(fxMesa,tObj, FX_TMU1);
|
||||
}
|
||||
#else
|
||||
fxTMMoveInTM_NoLock(fxMesa, tObj, FX_TMU0);
|
||||
#endif
|
||||
} else
|
||||
fxTMMoveInTM_NoLock(fxMesa,tObj,FX_TMU0);
|
||||
}
|
||||
@@ -357,11 +364,14 @@ static void fxSetupSingleTMU_NoLock(fxMesaContext fxMesa, struct gl_texture_obje
|
||||
FX_grTexSource_NoLock(GR_TMU1,ti->tm[FX_TMU1]->startAddr,
|
||||
GR_MIPMAPLEVELMASK_EVEN,&(ti->info));
|
||||
} else {
|
||||
if (ti->whichTMU==FX_TMU_BOTH) tmu=FX_TMU0;
|
||||
else tmu=ti->whichTMU;
|
||||
|
||||
if((ti->info.format==GR_TEXFMT_P_8) && (!fxMesa->haveGlobalPaletteTexture)) {
|
||||
if (MESA_VERBOSE&VERBOSE_DRIVER) {
|
||||
fprintf(stderr,"fxmesa: uploading texture palette\n");
|
||||
}
|
||||
FX_grTexDownloadTable_NoLock(ti->whichTMU,GR_TEXTABLE_PALETTE,&(ti->palette));
|
||||
FX_grTexDownloadTable_NoLock(tmu, GR_TEXTABLE_PALETTE, &(ti->palette));
|
||||
}
|
||||
|
||||
/* KW: The alternative is to do the download to the other tmu. If
|
||||
@@ -371,22 +381,15 @@ static void fxSetupSingleTMU_NoLock(fxMesaContext fxMesa, struct gl_texture_obje
|
||||
if (ti->LODblend && (MESA_VERBOSE&VERBOSE_DRIVER))
|
||||
fprintf(stderr, "fxmesa: not blending texture - only on one tmu\n");
|
||||
|
||||
FX_grTexClampMode_NoLock(ti->whichTMU,ti->sClamp,ti->tClamp);
|
||||
FX_grTexFilterMode_NoLock(ti->whichTMU,ti->minFilt,ti->maxFilt);
|
||||
FX_grTexMipMapMode_NoLock(ti->whichTMU,ti->mmMode,FXFALSE);
|
||||
FX_grTexClampMode_NoLock(tmu, ti->sClamp, ti->tClamp);
|
||||
FX_grTexFilterMode_NoLock(tmu, ti->minFilt, ti->maxFilt);
|
||||
FX_grTexMipMapMode_NoLock(tmu, ti->mmMode, FXFALSE);
|
||||
|
||||
FX_grTexSource_NoLock(ti->whichTMU,
|
||||
ti->tm[ti->whichTMU]->startAddr,
|
||||
GR_MIPMAPLEVELMASK_BOTH,&(ti->info));
|
||||
FX_grTexSource_NoLock(tmu, ti->tm[tmu]->startAddr,
|
||||
GR_MIPMAPLEVELMASK_BOTH, &(ti->info));
|
||||
}
|
||||
}
|
||||
|
||||
static void fxSetupSingleTMU(fxMesaContext fxMesa, struct gl_texture_object *tObj) {
|
||||
BEGIN_BOARD_LOCK();
|
||||
fxSetupSingleTMU_NoLock(fxMesa, tObj);
|
||||
END_BOARD_LOCK();
|
||||
}
|
||||
|
||||
static void fxSelectSingleTMUSrc_NoLock(fxMesaContext fxMesa, GLint tmu,
|
||||
FxBool LODblend)
|
||||
{
|
||||
@@ -408,11 +411,15 @@ static void fxSelectSingleTMUSrc_NoLock(fxMesaContext fxMesa, GLint tmu,
|
||||
FXFALSE,FXFALSE);
|
||||
fxMesa->tmuSrc=FX_TMU_SPLIT;
|
||||
} else {
|
||||
if(tmu==FX_TMU0) {
|
||||
if (tmu!=FX_TMU1) {
|
||||
FX_grTexCombine_NoLock(GR_TMU0,
|
||||
GR_COMBINE_FUNCTION_LOCAL,GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_FUNCTION_LOCAL,GR_COMBINE_FACTOR_NONE,
|
||||
FXFALSE,FXFALSE);
|
||||
FX_grTexCombine_NoLock(GR_TMU1,
|
||||
GR_COMBINE_FUNCTION_ZERO, GR_COMBINE_FACTOR_NONE,
|
||||
GR_COMBINE_FUNCTION_ZERO, GR_COMBINE_FACTOR_NONE,
|
||||
FXFALSE,FXFALSE);
|
||||
fxMesa->tmuSrc=FX_TMU0;
|
||||
} else {
|
||||
FX_grTexCombine_NoLock(GR_TMU1,
|
||||
@@ -442,6 +449,7 @@ static void fxSetupTextureSingleTMU_NoLock(GLcontext *ctx, GLuint textureset)
|
||||
GLint ifmt;
|
||||
tfxTexInfo *ti;
|
||||
struct gl_texture_object *tObj=ctx->Texture.Unit[textureset].CurrentD[2];
|
||||
int tmu;
|
||||
|
||||
if (MESA_VERBOSE&VERBOSE_DRIVER) {
|
||||
fprintf(stderr,"fxmesa: fxSetupTextureSingleTMU(...) Start\n");
|
||||
@@ -453,8 +461,10 @@ static void fxSetupTextureSingleTMU_NoLock(GLcontext *ctx, GLuint textureset)
|
||||
|
||||
fxSetupSingleTMU_NoLock(fxMesa,tObj);
|
||||
|
||||
if(fxMesa->tmuSrc!=ti->whichTMU)
|
||||
fxSelectSingleTMUSrc_NoLock(fxMesa,ti->whichTMU,ti->LODblend);
|
||||
if (ti->whichTMU==FX_TMU_BOTH) tmu=FX_TMU0;
|
||||
else tmu=ti->whichTMU;
|
||||
if (fxMesa->tmuSrc!=tmu)
|
||||
fxSelectSingleTMUSrc_NoLock(fxMesa, tmu, ti->LODblend);
|
||||
|
||||
if(textureset==0 || !fxMesa->haveTwoTMUs)
|
||||
unitsmode=fxGetTexSetConfiguration(ctx,tObj,NULL);
|
||||
@@ -520,6 +530,7 @@ static void fxSetupTextureSingleTMU_NoLock(GLcontext *ctx, GLuint textureset)
|
||||
FXFALSE);
|
||||
break;
|
||||
case GL_BLEND:
|
||||
#if 0
|
||||
FX_grAlphaCombine_NoLock(GR_COMBINE_FUNCTION_SCALE_OTHER,
|
||||
GR_COMBINE_FACTOR_LOCAL,
|
||||
locala,
|
||||
@@ -537,7 +548,12 @@ static void fxSetupTextureSingleTMU_NoLock(GLcontext *ctx, GLuint textureset)
|
||||
localc,
|
||||
GR_COMBINE_OTHER_TEXTURE,
|
||||
FXTRUE);
|
||||
/*ctx->Driver.MultipassFunc = fxMultipassBlend;*/
|
||||
ctx->Driver.MultipassFunc = fxMultipassBlend;
|
||||
#else
|
||||
#ifndef FX_SILENT
|
||||
fprintf(stderr,"fx Driver: GL_BLEND not yet supported\n");
|
||||
#endif
|
||||
#endif
|
||||
break;
|
||||
case GL_REPLACE:
|
||||
if((ifmt==GL_RGB) || (ifmt==GL_LUMINANCE))
|
||||
@@ -600,87 +616,87 @@ static void fxSetupDoubleTMU_NoLock(fxMesaContext fxMesa,
|
||||
tfxTexInfo *ti0=fxTMGetTexInfo(tObj0);
|
||||
tfxTexInfo *ti1=fxTMGetTexInfo(tObj1);
|
||||
GLuint tstate=0;
|
||||
int tmu0=0, tmu1=1;
|
||||
|
||||
if (MESA_VERBOSE&VERBOSE_DRIVER) {
|
||||
fprintf(stderr,"fxmesa: fxSetupDoubleTMU(...)\n");
|
||||
}
|
||||
|
||||
if(ti0->isInTM) {
|
||||
if(ti0->whichTMU==FX_TMU0)
|
||||
tstate|=T0_IN_TMU0;
|
||||
else if(ti0->whichTMU==FX_TMU1)
|
||||
tstate|=T0_IN_TMU1;
|
||||
else {
|
||||
fxTMMoveOutTM(fxMesa,tObj0);
|
||||
tstate|=T0_NOT_IN_TMU;
|
||||
}
|
||||
} else
|
||||
tstate|=T0_NOT_IN_TMU;
|
||||
/* We shouldn't need to do this. There is something wrong with
|
||||
mutlitexturing when the TMUs are swapped. So, we're forcing
|
||||
them to always be loaded correctly. !!! */
|
||||
if (ti0->whichTMU==FX_TMU1)
|
||||
fxTMMoveOutTM_NoLock(fxMesa, tObj0);
|
||||
if (ti1->whichTMU==FX_TMU0)
|
||||
fxTMMoveOutTM_NoLock(fxMesa, tObj1);
|
||||
|
||||
if(ti1->isInTM) {
|
||||
if(ti1->whichTMU==FX_TMU0)
|
||||
tstate|=T1_IN_TMU0;
|
||||
else if(ti1->whichTMU==FX_TMU1)
|
||||
tstate|=T1_IN_TMU1;
|
||||
else {
|
||||
fxTMMoveOutTM(fxMesa,tObj1);
|
||||
tstate|=T1_NOT_IN_TMU;
|
||||
if (ti0->isInTM) {
|
||||
switch (ti0->whichTMU) {
|
||||
case FX_TMU0:
|
||||
tstate|=T0_IN_TMU0;
|
||||
break;
|
||||
case FX_TMU1:
|
||||
tstate|=T0_IN_TMU1;
|
||||
break;
|
||||
case FX_TMU_BOTH:
|
||||
tstate|=T0_IN_TMU0|T0_IN_TMU1;
|
||||
break;
|
||||
case FX_TMU_SPLIT:
|
||||
tstate|=T0_NOT_IN_TMU;
|
||||
break;
|
||||
}
|
||||
} else
|
||||
tstate|=T1_NOT_IN_TMU;
|
||||
} else tstate|=T0_NOT_IN_TMU;
|
||||
|
||||
if (ti1->isInTM) {
|
||||
switch (ti1->whichTMU) {
|
||||
case FX_TMU0:
|
||||
tstate|=T1_IN_TMU0;
|
||||
break;
|
||||
case FX_TMU1:
|
||||
tstate|=T1_IN_TMU1;
|
||||
break;
|
||||
case FX_TMU_BOTH:
|
||||
tstate|=T1_IN_TMU0|T1_IN_TMU1;
|
||||
break;
|
||||
case FX_TMU_SPLIT:
|
||||
tstate|=T1_NOT_IN_TMU;
|
||||
break;
|
||||
}
|
||||
} else tstate|=T1_NOT_IN_TMU;
|
||||
|
||||
ti0->lastTimeUsed=fxMesa->texBindNumber;
|
||||
ti1->lastTimeUsed=fxMesa->texBindNumber;
|
||||
|
||||
/* Move texture maps in TMUs */
|
||||
/* Move texture maps into TMUs */
|
||||
|
||||
switch(tstate) {
|
||||
case (T0_IN_TMU0 | T1_IN_TMU0):
|
||||
fxTMMoveOutTM(fxMesa,tObj1);
|
||||
|
||||
fxTMMoveInTM_NoLock(fxMesa,tObj1,FX_TMU1);
|
||||
break;
|
||||
|
||||
case (T0_IN_TMU1 | T1_IN_TMU1):
|
||||
fxTMMoveOutTM(fxMesa,tObj0);
|
||||
|
||||
fxTMMoveInTM_NoLock(fxMesa,tObj0,FX_TMU0);
|
||||
break;
|
||||
|
||||
case (T0_NOT_IN_TMU | T1_NOT_IN_TMU):
|
||||
fxTMMoveInTM_NoLock(fxMesa,tObj0,FX_TMU0);
|
||||
fxTMMoveInTM_NoLock(fxMesa,tObj1,FX_TMU1);
|
||||
break;
|
||||
|
||||
/*** T0/T1 ***/
|
||||
|
||||
case (T0_NOT_IN_TMU | T1_IN_TMU0):
|
||||
fxTMMoveInTM_NoLock(fxMesa,tObj0,FX_TMU1);
|
||||
break;
|
||||
|
||||
case (T0_NOT_IN_TMU | T1_IN_TMU1):
|
||||
fxTMMoveInTM_NoLock(fxMesa,tObj0,FX_TMU0);
|
||||
break;
|
||||
|
||||
case (T0_IN_TMU0 | T1_NOT_IN_TMU):
|
||||
fxTMMoveInTM_NoLock(fxMesa,tObj1,FX_TMU1);
|
||||
break;
|
||||
|
||||
case (T0_IN_TMU1 | T1_NOT_IN_TMU):
|
||||
fxTMMoveInTM_NoLock(fxMesa,tObj1,FX_TMU0);
|
||||
break;
|
||||
|
||||
/*** Best Case ***/
|
||||
|
||||
case (T0_IN_TMU1 | T1_IN_TMU0):
|
||||
case (T0_IN_TMU0 | T1_IN_TMU1):
|
||||
break;
|
||||
|
||||
default:
|
||||
fprintf(stderr,"fx Driver: internal error in fxSetupDoubleTMU()\n");
|
||||
fxCloseHardware();
|
||||
exit(-1);
|
||||
break;
|
||||
if (!(((tstate&T0_IN_TMU0) && (tstate&T1_IN_TMU1)) ||
|
||||
((tstate&T0_IN_TMU1) && (tstate&T1_IN_TMU0)))) {
|
||||
if (tObj0==tObj1) fxTMMoveInTM_NoLock(fxMesa, tObj1, FX_TMU_BOTH);
|
||||
else {
|
||||
/* Find the minimal way to correct the situation */
|
||||
if ((tstate&T0_IN_TMU0) || (tstate&T1_IN_TMU1)) {
|
||||
/* We have one in the standard order, setup the other */
|
||||
if (tstate&T0_IN_TMU0) { /* T0 is in TMU0, put T1 in TMU1 */
|
||||
fxTMMoveInTM_NoLock(fxMesa, tObj1, FX_TMU1);
|
||||
} else {
|
||||
fxTMMoveInTM_NoLock(fxMesa, tObj0, FX_TMU0);
|
||||
}
|
||||
/* tmu0 and tmu1 are setup */
|
||||
} else if ((tstate&T0_IN_TMU1) || (tstate&T1_IN_TMU0)) {
|
||||
/* we have one in the reverse order, setup the other */
|
||||
if (tstate&T1_IN_TMU0) { /* T1 is in TMU0, put T0 in TMU1 */
|
||||
fxTMMoveInTM_NoLock(fxMesa, tObj0, FX_TMU1);
|
||||
} else {
|
||||
fxTMMoveInTM_NoLock(fxMesa, tObj1, FX_TMU0);
|
||||
}
|
||||
tmu0=1;
|
||||
tmu1=0;
|
||||
} else { /* Nothing is loaded */
|
||||
fxTMMoveInTM_NoLock(fxMesa, tObj0, FX_TMU0);
|
||||
fxTMMoveInTM_NoLock(fxMesa, tObj1, FX_TMU1);
|
||||
/* tmu0 and tmu1 are setup */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!fxMesa->haveGlobalPaletteTexture) {
|
||||
@@ -688,30 +704,28 @@ static void fxSetupDoubleTMU_NoLock(fxMesaContext fxMesa,
|
||||
if (MESA_VERBOSE&VERBOSE_DRIVER) {
|
||||
fprintf(stderr,"fxmesa: uploading texture palette TMU0\n");
|
||||
}
|
||||
FX_grTexDownloadTable_NoLock(ti0->whichTMU,GR_TEXTABLE_PALETTE,&(ti0->palette));
|
||||
FX_grTexDownloadTable_NoLock(tmu0, GR_TEXTABLE_PALETTE, &(ti0->palette));
|
||||
}
|
||||
|
||||
if (ti1->info.format==GR_TEXFMT_P_8) {
|
||||
if (MESA_VERBOSE&VERBOSE_DRIVER) {
|
||||
fprintf(stderr,"fxmesa: uploading texture palette TMU1\n");
|
||||
}
|
||||
FX_grTexDownloadTable_NoLock(ti1->whichTMU, GR_TEXTABLE_PALETTE,&(ti1->palette));
|
||||
FX_grTexDownloadTable_NoLock(tmu1, GR_TEXTABLE_PALETTE, &(ti1->palette));
|
||||
}
|
||||
}
|
||||
|
||||
FX_grTexSource_NoLock(ti0->whichTMU,
|
||||
ti0->tm[ti0->whichTMU]->startAddr,
|
||||
GR_MIPMAPLEVELMASK_BOTH,&(ti0->info));
|
||||
FX_grTexClampMode_NoLock(ti0->whichTMU,ti0->sClamp,ti0->tClamp);
|
||||
FX_grTexFilterMode_NoLock(ti0->whichTMU,ti0->minFilt,ti0->maxFilt);
|
||||
FX_grTexMipMapMode_NoLock(ti0->whichTMU,ti0->mmMode,FXFALSE);
|
||||
FX_grTexSource_NoLock(tmu0, ti0->tm[tmu0]->startAddr,
|
||||
GR_MIPMAPLEVELMASK_BOTH, &(ti0->info));
|
||||
FX_grTexClampMode_NoLock(tmu0, ti0->sClamp, ti0->tClamp);
|
||||
FX_grTexFilterMode_NoLock(tmu0, ti0->minFilt, ti0->maxFilt);
|
||||
FX_grTexMipMapMode_NoLock(tmu0, ti0->mmMode, FXFALSE);
|
||||
|
||||
FX_grTexSource_NoLock(ti1->whichTMU,
|
||||
ti1->tm[ti1->whichTMU]->startAddr,
|
||||
GR_MIPMAPLEVELMASK_BOTH,&(ti1->info));
|
||||
FX_grTexClampMode_NoLock(ti1->whichTMU,ti1->sClamp,ti1->tClamp);
|
||||
FX_grTexFilterMode_NoLock(ti1->whichTMU,ti1->minFilt,ti1->maxFilt);
|
||||
FX_grTexMipMapMode_NoLock(ti1->whichTMU,ti1->mmMode,FXFALSE);
|
||||
FX_grTexSource_NoLock(tmu1, ti1->tm[tmu1]->startAddr,
|
||||
GR_MIPMAPLEVELMASK_BOTH, &(ti1->info));
|
||||
FX_grTexClampMode_NoLock(tmu1, ti1->sClamp, ti1->tClamp);
|
||||
FX_grTexFilterMode_NoLock(tmu1, ti1->minFilt, ti1->maxFilt);
|
||||
FX_grTexMipMapMode_NoLock(tmu1, ti1->mmMode, FXFALSE);
|
||||
|
||||
#undef T0_NOT_IN_TMU
|
||||
#undef T1_NOT_IN_TMU
|
||||
@@ -729,6 +743,7 @@ static void fxSetupTextureDoubleTMU_NoLock(GLcontext *ctx)
|
||||
struct gl_texture_object *tObj0=ctx->Texture.Unit[0].CurrentD[2];
|
||||
struct gl_texture_object *tObj1=ctx->Texture.Unit[1].CurrentD[2];
|
||||
GLuint envmode,ifmt,unitsmode;
|
||||
int tmu0=0, tmu1=1;
|
||||
|
||||
if (MESA_VERBOSE&VERBOSE_DRIVER) {
|
||||
fprintf(stderr,"fxmesa: fxSetupTextureDoubleTMU(...) Start\n");
|
||||
@@ -772,6 +787,10 @@ static void fxSetupTextureDoubleTMU_NoLock(GLcontext *ctx)
|
||||
gl_lookup_enum_by_nr(ctx->Texture.Unit[1].EnvMode));
|
||||
|
||||
|
||||
if ((ti0->whichTMU==FX_TMU1) || (ti1->whichTMU==FX_TMU0)) {
|
||||
tmu0=1;
|
||||
tmu1=0;
|
||||
}
|
||||
fxMesa->tmuSrc=FX_TMU_BOTH;
|
||||
switch(envmode) {
|
||||
case (FX_UM_E0_MODULATE | FX_UM_E1_MODULATE):
|
||||
@@ -779,14 +798,14 @@ static void fxSetupTextureDoubleTMU_NoLock(GLcontext *ctx)
|
||||
GLboolean isalpha[FX_NUM_TMU];
|
||||
|
||||
if(ti0->baseLevelInternalFormat==GL_ALPHA)
|
||||
isalpha[ti0->whichTMU]=GL_TRUE;
|
||||
isalpha[tmu0]=GL_TRUE;
|
||||
else
|
||||
isalpha[ti0->whichTMU]=GL_FALSE;
|
||||
isalpha[tmu0]=GL_FALSE;
|
||||
|
||||
if(ti1->baseLevelInternalFormat==GL_ALPHA)
|
||||
isalpha[ti1->whichTMU]=GL_TRUE;
|
||||
isalpha[tmu1]=GL_TRUE;
|
||||
else
|
||||
isalpha[ti1->whichTMU]=GL_FALSE;
|
||||
isalpha[tmu1]=GL_FALSE;
|
||||
|
||||
if(isalpha[FX_TMU1])
|
||||
FX_grTexCombine_NoLock(GR_TMU1,
|
||||
@@ -832,7 +851,7 @@ static void fxSetupTextureDoubleTMU_NoLock(GLcontext *ctx)
|
||||
break;
|
||||
}
|
||||
case (FX_UM_E0_REPLACE | FX_UM_E1_BLEND): /* Only for GLQuake */
|
||||
if(ti1->whichTMU==FX_TMU1) {
|
||||
if (tmu1==FX_TMU1) {
|
||||
FX_grTexCombine_NoLock(GR_TMU1,
|
||||
GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
@@ -875,7 +894,7 @@ static void fxSetupTextureDoubleTMU_NoLock(GLcontext *ctx)
|
||||
FXFALSE);
|
||||
break;
|
||||
case (FX_UM_E0_REPLACE | FX_UM_E1_MODULATE): /* Quake 2 and 3 */
|
||||
if(ti1->whichTMU==FX_TMU1) {
|
||||
if (tmu1==FX_TMU1) {
|
||||
FX_grTexCombine_NoLock(GR_TMU1,
|
||||
GR_COMBINE_FUNCTION_LOCAL,
|
||||
GR_COMBINE_FACTOR_NONE,
|
||||
@@ -933,14 +952,14 @@ static void fxSetupTextureDoubleTMU_NoLock(GLcontext *ctx)
|
||||
GLboolean isalpha[FX_NUM_TMU];
|
||||
|
||||
if(ti0->baseLevelInternalFormat==GL_ALPHA)
|
||||
isalpha[ti0->whichTMU]=GL_TRUE;
|
||||
isalpha[tmu0]=GL_TRUE;
|
||||
else
|
||||
isalpha[ti0->whichTMU]=GL_FALSE;
|
||||
isalpha[tmu0]=GL_FALSE;
|
||||
|
||||
if(ti1->baseLevelInternalFormat==GL_ALPHA)
|
||||
isalpha[ti1->whichTMU]=GL_TRUE;
|
||||
isalpha[tmu1]=GL_TRUE;
|
||||
else
|
||||
isalpha[ti1->whichTMU]=GL_FALSE;
|
||||
isalpha[tmu1]=GL_FALSE;
|
||||
|
||||
if(isalpha[FX_TMU1])
|
||||
FX_grTexCombine_NoLock(GR_TMU1,
|
||||
@@ -985,7 +1004,9 @@ static void fxSetupTextureDoubleTMU_NoLock(GLcontext *ctx)
|
||||
FXFALSE);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
fprintf(stderr, "Unexpected dual texture mode encountered\n");
|
||||
break;
|
||||
}
|
||||
|
||||
if (MESA_VERBOSE&VERBOSE_DRIVER) {
|
||||
@@ -1036,7 +1057,7 @@ static void fxSetupTextureNone_NoLock(GLcontext *ctx)
|
||||
/************************** Texture Mode SetUp **************************/
|
||||
/************************************************************************/
|
||||
|
||||
void fxSetupTexture_NoLock(GLcontext *ctx)
|
||||
static void fxSetupTexture_NoLock(GLcontext *ctx)
|
||||
{
|
||||
fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
|
||||
GLuint tex2Denabled;
|
||||
@@ -1080,7 +1101,7 @@ void fxSetupTexture_NoLock(GLcontext *ctx)
|
||||
}
|
||||
}
|
||||
|
||||
void fxSetupTexture(GLcontext *ctx) {
|
||||
static void fxSetupTexture(GLcontext *ctx) {
|
||||
BEGIN_BOARD_LOCK();
|
||||
fxSetupTexture_NoLock(ctx);
|
||||
END_BOARD_LOCK();
|
||||
@@ -1180,11 +1201,15 @@ void fxDDBlendFunc(GLcontext *ctx, GLenum sfactor, GLenum dfactor)
|
||||
adfact=GR_BLEND_ZERO;
|
||||
break;
|
||||
case GL_DST_ALPHA:
|
||||
dfact=GR_BLEND_DST_ALPHA;
|
||||
/* dfact=GR_BLEND_DST_ALPHA; */
|
||||
/* We can't do DST_ALPHA */
|
||||
dfact=GR_BLEND_ONE;
|
||||
adfact=GR_BLEND_ZERO;
|
||||
break;
|
||||
case GL_ONE_MINUS_DST_ALPHA:
|
||||
dfact=GR_BLEND_ONE_MINUS_DST_ALPHA;
|
||||
/* dfact=GR_BLEND_ONE_MINUS_DST_ALPHA; */
|
||||
/* We can't do DST_ALPHA */
|
||||
dfact=GR_BLEND_ZERO;
|
||||
adfact=GR_BLEND_ZERO;
|
||||
break;
|
||||
case GL_SRC_ALPHA_SATURATE:
|
||||
@@ -1392,67 +1417,58 @@ static void fxSetupColorMask(GLcontext *ctx)
|
||||
/**************************** Fog Mode SetUp ****************************/
|
||||
/************************************************************************/
|
||||
|
||||
static void fxFogTableGenerate(GLcontext *ctx)
|
||||
/*
|
||||
* This is called during state update in order to update the Glide fog state.
|
||||
*/
|
||||
static void fxSetupFog(GLcontext *ctx)
|
||||
{
|
||||
int i;
|
||||
float f,eyez;
|
||||
fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
|
||||
if (ctx->Fog.Enabled && ctx->FogMode==FOG_FRAGMENT) {
|
||||
fxMesaContext fxMesa = FX_CONTEXT(ctx);
|
||||
|
||||
for(i=0;i<FX_grGetInteger(FX_FOG_TABLE_ENTRIES);i++) {
|
||||
eyez=guFogTableIndexToW(i);
|
||||
|
||||
switch(ctx->Fog.Mode) {
|
||||
case GL_LINEAR:
|
||||
f=(ctx->Fog.End-eyez)/(ctx->Fog.End-ctx->Fog.Start);
|
||||
break;
|
||||
case GL_EXP:
|
||||
f=exp(-ctx->Fog.Density*eyez);
|
||||
break;
|
||||
case GL_EXP2:
|
||||
f=exp(-ctx->Fog.Density*ctx->Fog.Density*eyez*eyez);
|
||||
break;
|
||||
default: /* That should never happen */
|
||||
f=0.0f;
|
||||
break;
|
||||
}
|
||||
|
||||
fxMesa->fogTable[i]=(GrFog_t)((1.0f-CLAMP(f,0.0f,1.0f))*255.0f);
|
||||
}
|
||||
}
|
||||
|
||||
static void fxSetupFog(GLcontext *ctx, GLboolean forceTableRebuild)
|
||||
{
|
||||
fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
|
||||
|
||||
if(ctx->Fog.Enabled && ctx->FogMode==FOG_FRAGMENT) {
|
||||
/* update fog color */
|
||||
GLubyte col[4];
|
||||
FX_grFogMode(GR_FOG_WITH_TABLE);
|
||||
|
||||
col[0]=(unsigned int)(255*ctx->Fog.Color[0]);
|
||||
col[1]=(unsigned int)(255*ctx->Fog.Color[1]);
|
||||
col[2]=(unsigned int)(255*ctx->Fog.Color[2]);
|
||||
col[3]=(unsigned int)(255*ctx->Fog.Color[3]);
|
||||
|
||||
FX_grFogColorValue(FXCOLOR4(col));
|
||||
|
||||
if(forceTableRebuild ||
|
||||
(fxMesa->fogTableMode!=ctx->Fog.Mode) ||
|
||||
(fxMesa->fogDensity!=ctx->Fog.Density)) {
|
||||
fxFogTableGenerate(ctx);
|
||||
|
||||
fxMesa->fogTableMode=ctx->Fog.Mode;
|
||||
fxMesa->fogDensity=ctx->Fog.Density;
|
||||
if(fxMesa->fogTableMode != ctx->Fog.Mode ||
|
||||
fxMesa->fogDensity != ctx->Fog.Density ||
|
||||
fxMesa->fogStart != ctx->Fog.Start ||
|
||||
fxMesa->fogEnd != ctx->Fog.End) {
|
||||
/* reload the fog table */
|
||||
switch (ctx->Fog.Mode) {
|
||||
case GL_LINEAR:
|
||||
guFogGenerateLinear(fxMesa->fogTable, ctx->Fog.Start, ctx->Fog.End);
|
||||
break;
|
||||
case GL_EXP:
|
||||
guFogGenerateExp(fxMesa->fogTable, ctx->Fog.Density);
|
||||
break;
|
||||
case GL_EXP2:
|
||||
guFogGenerateExp2(fxMesa->fogTable, ctx->Fog.Density);
|
||||
break;
|
||||
default:
|
||||
;
|
||||
}
|
||||
fxMesa->fogTableMode = ctx->Fog.Mode;
|
||||
fxMesa->fogDensity = ctx->Fog.Density;
|
||||
fxMesa->fogStart = ctx->Fog.Start;
|
||||
fxMesa->fogEnd = ctx->Fog.End;
|
||||
}
|
||||
|
||||
|
||||
FX_grFogTable(fxMesa->fogTable);
|
||||
} else
|
||||
FX_grFogMode(GR_FOG_WITH_TABLE);
|
||||
}
|
||||
else {
|
||||
FX_grFogMode(GR_FOG_DISABLE);
|
||||
}
|
||||
}
|
||||
|
||||
void fxDDFogfv( GLcontext *ctx, GLenum pname, const GLfloat *params )
|
||||
{
|
||||
FX_CONTEXT(ctx)->new_state |= FX_NEW_FOG;
|
||||
ctx->Driver.RenderStart = fxSetupFXUnits;
|
||||
ctx->Driver.RenderStart = fxSetupFXUnits; /* XXX why is this here? */
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
@@ -1610,7 +1626,7 @@ void fxDDEnable(GLcontext *ctx, GLenum cap, GLboolean state)
|
||||
ctx->Driver.RenderStart = fxSetupFXUnits;
|
||||
break;
|
||||
default:
|
||||
; /* XXX no-op? */
|
||||
; /* XXX no-op??? */
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1643,10 +1659,10 @@ static GLboolean fxMultipassBlend(struct vertex_buffer *VB, GLuint pass)
|
||||
fxDDDepthMask(ctx, FALSE);
|
||||
}
|
||||
/* Enable Cc*Ct mode */
|
||||
/* ? Set the Constant Color ? */
|
||||
/* ??? Set the Constant Color ??? */
|
||||
fxDDEnable(ctx, GL_BLEND, GL_TRUE);
|
||||
fxDDBlendFunc(ctx, ?, ?);
|
||||
fxSetupTextureSingleTMU(ctx, ?);
|
||||
fxDDBlendFunc(ctx, ???, ???);
|
||||
fxSetupTextureSingleTMU(ctx, ???);
|
||||
fxSetupBlend(ctx);
|
||||
fxSetupDepthTest(ctx);
|
||||
break;
|
||||
@@ -1654,8 +1670,8 @@ static GLboolean fxMultipassBlend(struct vertex_buffer *VB, GLuint pass)
|
||||
case 2:
|
||||
/* Reset everything back to normal */
|
||||
fxMesa->unitsState = fxMesa->restoreUnitsState;
|
||||
fxMesa->setupdone &= ?;
|
||||
fxSetupTextureSingleTMU(ctx, ?);
|
||||
fxMesa->setupdone &= ???;
|
||||
fxSetupTextureSingleTMU(ctx, ???);
|
||||
fxSetupBlend(ctx);
|
||||
fxSetupDepthTest(ctx);
|
||||
break;
|
||||
@@ -1791,7 +1807,7 @@ void fxSetupFXUnits( GLcontext *ctx )
|
||||
fxSetupDepthTest(ctx);
|
||||
|
||||
if (newstate & FX_NEW_FOG)
|
||||
fxSetupFog(ctx,GL_FALSE);
|
||||
fxSetupFog(ctx);
|
||||
|
||||
if (newstate & FX_NEW_SCISSOR)
|
||||
fxSetupScissor(ctx);
|
||||
|
@@ -54,6 +54,8 @@
|
||||
|
||||
#include "fxdrv.h"
|
||||
|
||||
int texSwaps=0;
|
||||
|
||||
#define FX_2MB_SPLIT 0x200000
|
||||
|
||||
static struct gl_texture_object *fxTMFindOldestObject(fxMesaContext fxMesa,
|
||||
@@ -208,6 +210,7 @@ static int fxTMFindStartAddr(fxMesaContext fxMesa, GLint tmu, int size)
|
||||
return -1;
|
||||
}
|
||||
fxTMMoveOutTM(fxMesa, obj);
|
||||
texSwaps++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -269,8 +272,8 @@ static struct gl_texture_object *fxTMFindOldestObject(fxMesaContext fxMesa,
|
||||
info=fxTMGetTexInfo(tmp);
|
||||
|
||||
if (info && info->isInTM &&
|
||||
(info->whichTMU==tmu || info->whichTMU==FX_TMU_BOTH ||
|
||||
info->whichTMU==FX_TMU_SPLIT)) {
|
||||
((info->whichTMU==tmu) || (info->whichTMU==FX_TMU_BOTH) ||
|
||||
(info->whichTMU==FX_TMU_SPLIT))) {
|
||||
lasttime=info->lastTimeUsed;
|
||||
|
||||
if (lasttime>bindnumber)
|
||||
@@ -321,7 +324,15 @@ void fxTMMoveInTM_NoLock(fxMesaContext fxMesa, struct gl_texture_object *tObj, G
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (ti->isInTM) return;
|
||||
if (ti->isInTM) {
|
||||
if (ti->whichTMU==where) return;
|
||||
if (where==FX_TMU_SPLIT || ti->whichTMU==FX_TMU_SPLIT)
|
||||
fxTMMoveOutTM_NoLock(fxMesa, tObj);
|
||||
else {
|
||||
if (ti->whichTMU==FX_TMU_BOTH) return;
|
||||
where=FX_TMU_BOTH;
|
||||
}
|
||||
}
|
||||
|
||||
if (MESA_VERBOSE&(VERBOSE_DRIVER|VERBOSE_TEXTURE)) {
|
||||
fprintf(stderr,"fxmesa: downloading %x (%d) in texture memory in %d\n",(GLuint)tObj,tObj->Name,where);
|
||||
@@ -349,7 +360,7 @@ void fxTMMoveInTM_NoLock(fxMesaContext fxMesa, struct gl_texture_object *tObj, G
|
||||
GR_MIPMAPLEVELMASK_BOTH,
|
||||
ti->mipmapLevel[l].data);
|
||||
break;
|
||||
case FX_TMU_SPLIT: /* TO DO: alternate even/odd TMU0/TMU1 */
|
||||
case FX_TMU_SPLIT:
|
||||
texmemsize=(int)FX_grTexTextureMemRequired_NoLock(GR_MIPMAPLEVELMASK_ODD,
|
||||
&(ti->info));
|
||||
ti->tm[FX_TMU0]=fxTMAddObj(fxMesa, tObj, FX_TMU0, texmemsize);
|
||||
@@ -382,6 +393,39 @@ void fxTMMoveInTM_NoLock(fxMesaContext fxMesa, struct gl_texture_object *tObj, G
|
||||
ti->mipmapLevel[l].data);
|
||||
}
|
||||
break;
|
||||
case FX_TMU_BOTH:
|
||||
texmemsize=(int)FX_grTexTextureMemRequired_NoLock(GR_MIPMAPLEVELMASK_BOTH,
|
||||
&(ti->info));
|
||||
ti->tm[FX_TMU0]=fxTMAddObj(fxMesa, tObj, FX_TMU0, texmemsize);
|
||||
fxMesa->stats.memTexUpload+=texmemsize;
|
||||
|
||||
texmemsize=(int)FX_grTexTextureMemRequired_NoLock(GR_MIPMAPLEVELMASK_BOTH,
|
||||
&(ti->info));
|
||||
ti->tm[FX_TMU1]=fxTMAddObj(fxMesa, tObj, FX_TMU1, texmemsize);
|
||||
fxMesa->stats.memTexUpload+=texmemsize;
|
||||
|
||||
for (i=FX_largeLodValue(ti->info),l=ti->minLevel;
|
||||
i<=FX_smallLodValue(ti->info);
|
||||
i++,l++) {
|
||||
FX_grTexDownloadMipMapLevel_NoLock(GR_TMU0,
|
||||
ti->tm[FX_TMU0]->startAddr,
|
||||
FX_valueToLod(i),
|
||||
FX_largeLodLog2(ti->info),
|
||||
FX_aspectRatioLog2(ti->info),
|
||||
ti->info.format,
|
||||
GR_MIPMAPLEVELMASK_BOTH,
|
||||
ti->mipmapLevel[l].data);
|
||||
|
||||
FX_grTexDownloadMipMapLevel_NoLock(GR_TMU1,
|
||||
ti->tm[FX_TMU1]->startAddr,
|
||||
FX_valueToLod(i),
|
||||
FX_largeLodLog2(ti->info),
|
||||
FX_aspectRatioLog2(ti->info),
|
||||
ti->info.format,
|
||||
GR_MIPMAPLEVELMASK_BOTH,
|
||||
ti->mipmapLevel[l].data);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr,"fx Driver: internal error in fxTMMoveInTM() -> wrong tmu (%d)\n",where);
|
||||
fxCloseHardware();
|
||||
@@ -417,22 +461,27 @@ void fxTMReloadMipMapLevel(fxMesaContext fxMesa, struct gl_texture_object *tObj,
|
||||
fxTexGetInfo(ti->mipmapLevel[0].width,ti->mipmapLevel[0].height,
|
||||
&lodlevel, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
|
||||
#ifdef FX_GLIDE3
|
||||
lodlevel-=level;
|
||||
#else
|
||||
lodlevel+=level;
|
||||
#endif
|
||||
switch(tmu) {
|
||||
case FX_TMU0:
|
||||
case FX_TMU1:
|
||||
FX_grTexDownloadMipMapLevel(tmu,
|
||||
ti->tm[tmu]->startAddr,
|
||||
FX_valueToLod(FX_lodToValue(lodlevel)+level),
|
||||
FX_valueToLod(FX_lodToValue(lodlevel)),
|
||||
FX_largeLodLog2(ti->info),
|
||||
FX_aspectRatioLog2(ti->info),
|
||||
ti->info.format,
|
||||
GR_MIPMAPLEVELMASK_BOTH,
|
||||
ti->mipmapLevel[level].data);
|
||||
break;
|
||||
case FX_TMU_SPLIT: /* TO DO: alternate even/odd TMU0/TMU1 */
|
||||
case FX_TMU_SPLIT:
|
||||
FX_grTexDownloadMipMapLevel(GR_TMU0,
|
||||
ti->tm[GR_TMU0]->startAddr,
|
||||
FX_valueToLod(FX_lodToValue(lodlevel)+level),
|
||||
FX_valueToLod(FX_lodToValue(lodlevel)),
|
||||
FX_largeLodLog2(ti->info),
|
||||
FX_aspectRatioLog2(ti->info),
|
||||
ti->info.format,
|
||||
@@ -441,13 +490,33 @@ void fxTMReloadMipMapLevel(fxMesaContext fxMesa, struct gl_texture_object *tObj,
|
||||
|
||||
FX_grTexDownloadMipMapLevel(GR_TMU1,
|
||||
ti->tm[GR_TMU1]->startAddr,
|
||||
FX_valueToLod(FX_lodToValue(lodlevel)+level),
|
||||
FX_valueToLod(FX_lodToValue(lodlevel)),
|
||||
FX_largeLodLog2(ti->info),
|
||||
FX_aspectRatioLog2(ti->info),
|
||||
ti->info.format,
|
||||
GR_MIPMAPLEVELMASK_EVEN,
|
||||
ti->mipmapLevel[level].data);
|
||||
break;
|
||||
case FX_TMU_BOTH:
|
||||
FX_grTexDownloadMipMapLevel(GR_TMU0,
|
||||
ti->tm[GR_TMU0]->startAddr,
|
||||
FX_valueToLod(FX_lodToValue(lodlevel)),
|
||||
FX_largeLodLog2(ti->info),
|
||||
FX_aspectRatioLog2(ti->info),
|
||||
ti->info.format,
|
||||
GR_MIPMAPLEVELMASK_BOTH,
|
||||
ti->mipmapLevel[level].data);
|
||||
|
||||
FX_grTexDownloadMipMapLevel(GR_TMU1,
|
||||
ti->tm[GR_TMU1]->startAddr,
|
||||
FX_valueToLod(FX_lodToValue(lodlevel)),
|
||||
FX_largeLodLog2(ti->info),
|
||||
FX_aspectRatioLog2(ti->info),
|
||||
ti->info.format,
|
||||
GR_MIPMAPLEVELMASK_BOTH,
|
||||
ti->mipmapLevel[level].data);
|
||||
break;
|
||||
|
||||
default:
|
||||
fprintf(stderr,"fx Driver: internal error in fxTMReloadMipMapLevel() -> wrong tmu (%d)\n",tmu);
|
||||
fxCloseHardware();
|
||||
@@ -496,7 +565,7 @@ void fxTMReloadSubMipMapLevel(fxMesaContext fxMesa,
|
||||
data,
|
||||
yoffset,yoffset+height-1);
|
||||
break;
|
||||
case FX_TMU_SPLIT: /* TO DO: alternate even/odd TMU0/TMU1 */
|
||||
case FX_TMU_SPLIT:
|
||||
FX_grTexDownloadMipMapLevelPartial(GR_TMU0,
|
||||
ti->tm[FX_TMU0]->startAddr,
|
||||
FX_valueToLod(FX_lodToValue(lodlevel)+level),
|
||||
@@ -517,6 +586,27 @@ void fxTMReloadSubMipMapLevel(fxMesaContext fxMesa,
|
||||
data,
|
||||
yoffset,yoffset+height-1);
|
||||
break;
|
||||
case FX_TMU_BOTH:
|
||||
FX_grTexDownloadMipMapLevelPartial(GR_TMU0,
|
||||
ti->tm[FX_TMU0]->startAddr,
|
||||
FX_valueToLod(FX_lodToValue(lodlevel)+level),
|
||||
FX_largeLodLog2(ti->info),
|
||||
FX_aspectRatioLog2(ti->info),
|
||||
ti->info.format,
|
||||
GR_MIPMAPLEVELMASK_BOTH,
|
||||
data,
|
||||
yoffset,yoffset+height-1);
|
||||
|
||||
FX_grTexDownloadMipMapLevelPartial(GR_TMU1,
|
||||
ti->tm[FX_TMU1]->startAddr,
|
||||
FX_valueToLod(FX_lodToValue(lodlevel)+level),
|
||||
FX_largeLodLog2(ti->info),
|
||||
FX_aspectRatioLog2(ti->info),
|
||||
ti->info.format,
|
||||
GR_MIPMAPLEVELMASK_BOTH,
|
||||
data,
|
||||
yoffset,yoffset+height-1);
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr,"fx Driver: internal error in fxTMReloadSubMipMapLevel() -> wrong tmu (%d)\n",tmu);
|
||||
fxCloseHardware();
|
||||
@@ -540,6 +630,7 @@ void fxTMMoveOutTM(fxMesaContext fxMesa, struct gl_texture_object *tObj)
|
||||
fxTMRemoveRange(fxMesa, (int)ti->whichTMU, ti->tm[ti->whichTMU]);
|
||||
break;
|
||||
case FX_TMU_SPLIT:
|
||||
case FX_TMU_BOTH:
|
||||
fxTMRemoveRange(fxMesa, FX_TMU0, ti->tm[FX_TMU0]);
|
||||
fxTMRemoveRange(fxMesa, FX_TMU1, ti->tm[FX_TMU1]);
|
||||
break;
|
||||
@@ -617,80 +708,11 @@ void fxTMClose(fxMesaContext fxMesa)
|
||||
}
|
||||
}
|
||||
|
||||
void fxTMRestore_NoLock(fxMesaContext fxMesa, struct gl_texture_object *tObj)
|
||||
{
|
||||
tfxTexInfo *ti=fxTMGetTexInfo(tObj);
|
||||
int i,l, where;
|
||||
|
||||
if (MESA_VERBOSE&VERBOSE_DRIVER) {
|
||||
fprintf(stderr,"fxmesa: fxRestore(%d)\n",tObj->Name);
|
||||
}
|
||||
|
||||
if (!ti->validated) {
|
||||
fprintf(stderr,"fxDriver: internal error in fxRestore -> not validated\n");
|
||||
fxCloseHardware();
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
where=ti->whichTMU;
|
||||
if (MESA_VERBOSE&(VERBOSE_DRIVER|VERBOSE_TEXTURE)) {
|
||||
fprintf(stderr,"fxmesa: reloading %x (%d) in texture memory in %d\n",
|
||||
(GLuint)tObj, tObj->Name, where);
|
||||
}
|
||||
|
||||
switch(where) {
|
||||
case FX_TMU0:
|
||||
case FX_TMU1:
|
||||
for (i=FX_largeLodValue_NoLock(ti->info), l=ti->minLevel;
|
||||
i<=FX_smallLodValue_NoLock(ti->info);
|
||||
i++,l++)
|
||||
if (ti->mipmapLevel[l].data)
|
||||
FX_grTexDownloadMipMapLevel_NoLock(where,
|
||||
ti->tm[where]->startAddr,
|
||||
FX_valueToLod(i),
|
||||
FX_largeLodLog2(ti->info),
|
||||
FX_aspectRatioLog2(ti->info),
|
||||
ti->info.format,
|
||||
GR_MIPMAPLEVELMASK_BOTH,
|
||||
ti->mipmapLevel[l].data);
|
||||
break;
|
||||
case FX_TMU_SPLIT: /* TO DO: alternate even/odd TMU0/TMU1 */
|
||||
for (i=FX_largeLodValue_NoLock(ti->info),l=ti->minLevel;
|
||||
i<=FX_smallLodValue_NoLock(ti->info);
|
||||
i++,l++) {
|
||||
if (ti->mipmapLevel[l].data) {
|
||||
FX_grTexDownloadMipMapLevel_NoLock(GR_TMU0,
|
||||
ti->tm[FX_TMU0]->startAddr,
|
||||
FX_valueToLod(i),
|
||||
FX_largeLodLog2(ti->info),
|
||||
FX_aspectRatioLog2(ti->info),
|
||||
ti->info.format,
|
||||
GR_MIPMAPLEVELMASK_ODD,
|
||||
ti->mipmapLevel[l].data);
|
||||
FX_grTexDownloadMipMapLevel_NoLock(GR_TMU1,
|
||||
ti->tm[FX_TMU1]->startAddr,
|
||||
FX_valueToLod(i),
|
||||
FX_largeLodLog2(ti->info),
|
||||
FX_aspectRatioLog2(ti->info),
|
||||
ti->info.format,
|
||||
GR_MIPMAPLEVELMASK_EVEN,
|
||||
ti->mipmapLevel[l].data);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr,"fxDriver: internal error in fxRestore -> bad tmu (%d)\n",
|
||||
where);
|
||||
fxCloseHardware();
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
fxTMRestoreTextures(fxMesaContext ctx) {
|
||||
fxTMRestoreTextures_NoLock(fxMesaContext ctx) {
|
||||
tfxTexInfo *ti;
|
||||
struct gl_texture_object *tObj;
|
||||
int i;
|
||||
int i, where;
|
||||
|
||||
tObj=ctx->glCtx->Shared->TexObjectList;
|
||||
while (tObj) {
|
||||
@@ -699,11 +721,13 @@ fxTMRestoreTextures(fxMesaContext ctx) {
|
||||
for (i=0; i<MAX_TEXTURE_UNITS; i++)
|
||||
if (ctx->glCtx->Texture.Unit[i].Current==tObj) {
|
||||
/* Force the texture onto the board, as it could be in use */
|
||||
fxTMRestore_NoLock(ctx, tObj);
|
||||
where=ti->whichTMU;
|
||||
ti->whichTMU=FX_TMU_NONE;
|
||||
fxTMMoveInTM_NoLock(ctx, tObj, where);
|
||||
break;
|
||||
}
|
||||
if (i==MAX_TEXTURE_UNITS) /* Mark the texture as off the board */
|
||||
fxTMMoveOutTM(ctx, tObj);
|
||||
fxTMMoveOutTM_NoLock(ctx, tObj);
|
||||
}
|
||||
tObj=tObj->Next;
|
||||
}
|
||||
|
@@ -1,9 +1,9 @@
|
||||
/* $Id: svgamesa.c,v 1.1 1999/08/19 00:55:42 jtg Exp $ */
|
||||
/* $Id: svgamesa.c,v 1.1.1.1.2.3 2000/01/22 20:06:20 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.0
|
||||
* Copyright (C) 1995-1998 Brian Paul
|
||||
* Version: 3.2
|
||||
* Copyright (C) 1995-2000 Brian Paul
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
@@ -21,23 +21,19 @@
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Linux SVGA/Mesa interface.
|
||||
*
|
||||
* This interface is not finished! Still have to implement pixel
|
||||
* reading functions and double buffering. Then, look into accelerated
|
||||
* line and polygon rendering. And, clean up a bunch of other stuff.
|
||||
* Any volunteers?
|
||||
* SVGA driver for Mesa.
|
||||
* Original author: Brian Paul
|
||||
* Additional authors: Slawomir Szczyrba <steev@hot.pl> (Mesa 3.2)
|
||||
*/
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "conf.h"
|
||||
#endif
|
||||
|
||||
#ifdef SVGA
|
||||
|
||||
|
||||
#ifdef PC_HEADER
|
||||
#include "all.h"
|
||||
#else
|
||||
@@ -48,35 +44,164 @@
|
||||
#include "context.h"
|
||||
#include "matrix.h"
|
||||
#include "types.h"
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#include "svgapix.h"
|
||||
#include "svgamesa8.h"
|
||||
#include "svgamesa15.h"
|
||||
#include "svgamesa16.h"
|
||||
#include "svgamesa24.h"
|
||||
#include "svgamesa32.h"
|
||||
|
||||
struct svgamesa_context {
|
||||
GLcontext *gl_ctx; /* the core Mesa context */
|
||||
GLvisual *gl_vis; /* describes the color buffer */
|
||||
GLframebuffer *gl_buffer; /* the ancillary buffers */
|
||||
GLuint index; /* current color index */
|
||||
GLint red, green, blue; /* current rgb color */
|
||||
GLint width, height; /* size of color buffer */
|
||||
GLint depth; /* bits per pixel (8,16,24 or 32) */
|
||||
};
|
||||
struct svga_buffer SVGABuffer;
|
||||
vga_modeinfo * SVGAInfo;
|
||||
SVGAMesaContext SVGAMesa; /* the current context */
|
||||
|
||||
#ifdef SVGA_DEBUG
|
||||
|
||||
static SVGAMesaContext SVGAMesa = NULL; /* the current context */
|
||||
#include <sys/types.h>
|
||||
#include <signal.h>
|
||||
|
||||
FILE * logfile;
|
||||
char cbuf[1024]={0};
|
||||
|
||||
void SVGAlog(char * what)
|
||||
{
|
||||
logfile=fopen("svgamesa.log","a");
|
||||
if (!logfile) return;
|
||||
fprintf(logfile,"%s\n",what);
|
||||
fclose(logfile);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Convert Mesa window Y coordinate to VGA screen Y coordinate:
|
||||
*/
|
||||
#define FLIP(Y) (SVGAMesa->height-(Y)-1)
|
||||
/**********************************************************************/
|
||||
/***** Init stuff... *****/
|
||||
/**********************************************************************/
|
||||
|
||||
int SVGAMesaInit( int GraphMode )
|
||||
{
|
||||
vga_init();
|
||||
if (!vga_hasmode(GraphMode))
|
||||
{
|
||||
fprintf(stderr,"GraphMode %d unavailable...",GraphMode);
|
||||
#ifdef SVGA_DEBUG
|
||||
SVGAlog("SVGAMesaInit: invalid GraphMode (doesn't exist)");
|
||||
#endif
|
||||
return(1);
|
||||
}
|
||||
SVGAInfo=vga_getmodeinfo(GraphMode);
|
||||
if (SVGAInfo->flags & IS_MODEX)
|
||||
{
|
||||
fprintf(stderr,"ModeX not implemented...");
|
||||
#ifdef SVGA_DEBUG
|
||||
SVGAlog("SVGAMesaInit: invalid GraphMode (ModeX)");
|
||||
#endif
|
||||
return(2);
|
||||
}
|
||||
if (!SVGAInfo->bytesperpixel)
|
||||
{
|
||||
fprintf(stderr,"1 / 4 bit color not implemented...");
|
||||
#ifdef SVGA_DEBUG
|
||||
SVGAlog("SVGAMesaInit: invalid GraphMode (1 or 4 bit)");
|
||||
#endif
|
||||
return(3);
|
||||
}
|
||||
switch (SVGAInfo->colors) {
|
||||
case 256: SVGABuffer.Depth = 8; break;
|
||||
case 32768: SVGABuffer.Depth = 15; break;
|
||||
case 65536: SVGABuffer.Depth = 16; break;
|
||||
default: SVGABuffer.Depth = SVGAInfo->bytesperpixel<<3; break;
|
||||
}
|
||||
SVGABuffer.BufferSize=SVGAInfo->linewidth*SVGAInfo->height;
|
||||
#ifdef SVGA_DEBUG
|
||||
sprintf(cbuf,"SVGAMesaInit: double buffer info.\n" \
|
||||
" depth : %d\n" \
|
||||
" mode : %d\n" \
|
||||
" width : %d\n" \
|
||||
" height : %d\n" \
|
||||
" bufsize: %d\n", \
|
||||
SVGABuffer.Depth,GraphMode,SVGAInfo->linewidth, \
|
||||
SVGAInfo->height,SVGABuffer.BufferSize);
|
||||
SVGAlog(cbuf);
|
||||
#endif
|
||||
SVGABuffer.FrontBuffer=(void*)malloc(SVGABuffer.BufferSize + 4);
|
||||
if (!SVGABuffer.FrontBuffer) {
|
||||
{
|
||||
fprintf(stderr,"Not enough RAM for FRONT_LEFT_BUFFER...");
|
||||
#ifdef SVGA_DEBUG
|
||||
SVGAlog("SVGAMesaInit: Not enough RAM (front buffer)");
|
||||
#endif
|
||||
return(4);
|
||||
}
|
||||
}
|
||||
#ifdef SVGA_DEBUG
|
||||
sprintf(cbuf,"SVGAMesaInit: FrontBuffer - %p",SVGABuffer.FrontBuffer);
|
||||
SVGAlog(cbuf);
|
||||
#endif
|
||||
SVGABuffer.BackBuffer=(void*)malloc(SVGABuffer.BufferSize + 4);
|
||||
if (!SVGABuffer.BackBuffer) {
|
||||
{
|
||||
free(SVGABuffer.FrontBuffer);
|
||||
fprintf(stderr,"Not enough RAM for BACK_LEFT_BUFFER...");
|
||||
#ifdef SVGA_DEBUG
|
||||
SVGAlog("SVGAMesaInit: Not enough RAM (back buffer)");
|
||||
#endif
|
||||
return(5);
|
||||
}
|
||||
}
|
||||
#ifdef SVGA_DEBUG
|
||||
sprintf(cbuf,"SVGAMesaInit: BackBuffer - %p",SVGABuffer.BackBuffer);
|
||||
SVGAlog(cbuf);
|
||||
#endif
|
||||
|
||||
vga_setmode(GraphMode);
|
||||
SVGABuffer.VideoRam=vga_getgraphmem();
|
||||
#ifdef SVGA_DEBUG
|
||||
sprintf(cbuf,"SVGAMesaInit: VRAM - %p",SVGABuffer.VideoRam);
|
||||
SVGAlog(cbuf);
|
||||
sprintf(cbuf,"SVGAMesaInit: done. (Mode %d)",GraphMode);
|
||||
SVGAlog(cbuf);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
int SVGAMesaClose( void )
|
||||
{
|
||||
vga_setmode(TEXT);
|
||||
free(SVGABuffer.FrontBuffer);
|
||||
free(SVGABuffer.BackBuffer);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SVGAMesaSetCI(int ndx, GLubyte red, GLubyte green, GLubyte blue)
|
||||
{
|
||||
if (ndx<256) vga_setpalette(ndx, red>>2, green>>2, blue>>2);
|
||||
}
|
||||
|
||||
/**********************************************************************/
|
||||
/***** Miscellaneous functions *****/
|
||||
/**********************************************************************/
|
||||
|
||||
static void copy_buffer( GLubyte * buffer) {
|
||||
int size = SVGABuffer.BufferSize, page = 0;
|
||||
|
||||
#ifdef SVGA_DEBUG
|
||||
sprintf(cbuf,"copy_buffer: copy %p to %p",buffer,SVGABuffer.VideoRam);
|
||||
SVGAlog(cbuf);
|
||||
#endif
|
||||
|
||||
while(size>0) {
|
||||
vga_setpage(page++);
|
||||
if (size>>16) {
|
||||
memcpy(SVGABuffer.VideoRam,buffer,0x10000);
|
||||
buffer+=0x10000;
|
||||
}else{
|
||||
memcpy(SVGABuffer.VideoRam,buffer,size & 0xffff);
|
||||
}
|
||||
size-=0xffff;
|
||||
}
|
||||
}
|
||||
|
||||
static void get_buffer_size( GLcontext *ctx, GLuint *width, GLuint *height )
|
||||
{
|
||||
@@ -84,279 +209,33 @@ static void get_buffer_size( GLcontext *ctx, GLuint *width, GLuint *height )
|
||||
*height = SVGAMesa->height = vga_getydim();
|
||||
}
|
||||
|
||||
|
||||
/* Set current color index */
|
||||
static void set_index( GLcontext *ctx, GLuint index )
|
||||
{
|
||||
SVGAMesa->index = index;
|
||||
vga_setcolor( index );
|
||||
}
|
||||
|
||||
|
||||
/* Set current drawing color */
|
||||
static void set_color( GLcontext *ctx,
|
||||
GLubyte red, GLubyte green,
|
||||
GLubyte blue, GLubyte alpha )
|
||||
{
|
||||
SVGAMesa->red = red;
|
||||
SVGAMesa->green = green;
|
||||
SVGAMesa->blue = blue;
|
||||
vga_setrgbcolor( red, green, blue );
|
||||
}
|
||||
|
||||
|
||||
static void clear_index( GLcontext *ctx, GLuint index )
|
||||
{
|
||||
/* TODO: Implements glClearIndex() */
|
||||
}
|
||||
|
||||
|
||||
static void clear_color( GLcontext *ctx,
|
||||
GLubyte red, GLubyte green,
|
||||
GLubyte blue, GLubyte alpha )
|
||||
{
|
||||
/* TODO: Implements glClearColor() */
|
||||
}
|
||||
|
||||
|
||||
static GLbitfield clear( GLcontext *ctx, GLbitfield mask, GLboolean all,
|
||||
GLint x, GLint y, GLint width, GLint height )
|
||||
{
|
||||
if (mask & GL_COLOR_BUFFER_BIT) {
|
||||
vga_clear();
|
||||
}
|
||||
return mask & (~GL_COLOR_BUFFER_BIT);
|
||||
}
|
||||
|
||||
|
||||
static GLboolean set_buffer( GLcontext *ctx, GLenum buffer )
|
||||
{
|
||||
/* TODO: implement double buffering and use this function to select */
|
||||
/* between front and back buffers. */
|
||||
void * tmpptr;
|
||||
|
||||
if (buffer == GL_FRONT_LEFT)
|
||||
return GL_TRUE;
|
||||
{
|
||||
/* vga_waitretrace(); */
|
||||
copy_buffer(SVGABuffer.FrontBuffer);
|
||||
tmpptr=SVGABuffer.BackBuffer;
|
||||
SVGABuffer.BackBuffer=SVGABuffer.FrontBuffer;
|
||||
SVGABuffer.FrontBuffer=tmpptr;
|
||||
return GL_TRUE;
|
||||
}
|
||||
else if (buffer == GL_BACK_LEFT)
|
||||
return GL_TRUE;
|
||||
{
|
||||
/* vga_waitretrace(); */
|
||||
copy_buffer(SVGABuffer.BackBuffer);
|
||||
return GL_TRUE;
|
||||
}
|
||||
else
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**********************************************************************/
|
||||
/***** Write spans of pixels *****/
|
||||
/***** *****/
|
||||
/**********************************************************************/
|
||||
|
||||
|
||||
static void write_ci32_span( const GLcontext *ctx, GLuint n, GLint x, GLint y,
|
||||
const GLuint index[], const GLubyte mask[] )
|
||||
{
|
||||
int i;
|
||||
y = FLIP(y);
|
||||
for (i=0;i<n;i++,x++) {
|
||||
if (mask[i]) {
|
||||
vga_setcolor( index[i] );
|
||||
vga_drawpixel( x, y );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void write_ci8_span( const GLcontext *ctx, GLuint n, GLint x, GLint y,
|
||||
const GLubyte index[], const GLubyte mask[] )
|
||||
{
|
||||
int i;
|
||||
y = FLIP(y);
|
||||
for (i=0;i<n;i++,x++) {
|
||||
if (mask[i]) {
|
||||
vga_setcolor( index[i] );
|
||||
vga_drawpixel( x, y );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void write_mono_ci_span( const GLcontext *ctx, GLuint n,
|
||||
GLint x, GLint y, const GLubyte mask[] )
|
||||
{
|
||||
int i;
|
||||
y = FLIP(y);
|
||||
/* use current color index */
|
||||
vga_setcolor( SVGAMesa->index );
|
||||
for (i=0;i<n;i++,x++) {
|
||||
if (mask[i]) {
|
||||
vga_drawpixel( x, y );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void write_rgba_span( const GLcontext *ctx, GLuint n, GLint x, GLint y,
|
||||
const GLubyte rgba[][4], const GLubyte mask[] )
|
||||
{
|
||||
int i;
|
||||
y=FLIP(y);
|
||||
if (mask) {
|
||||
/* draw some pixels */
|
||||
for (i=0; i<n; i++, x++) {
|
||||
if (mask[i]) {
|
||||
vga_setrgbcolor( rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] );
|
||||
vga_drawpixel( x, y );
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* draw all pixels */
|
||||
for (i=0; i<n; i++, x++) {
|
||||
vga_setrgbcolor( rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] );
|
||||
vga_drawpixel( x, y );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void write_mono_rgba_span( const GLcontext *ctx,
|
||||
GLuint n, GLint x, GLint y,
|
||||
const GLubyte mask[])
|
||||
{
|
||||
int i;
|
||||
y=FLIP(y);
|
||||
/* use current rgb color */
|
||||
vga_setrgbcolor( SVGAMesa->red, SVGAMesa->green, SVGAMesa->blue );
|
||||
for (i=0; i<n; i++, x++) {
|
||||
if (mask[i]) {
|
||||
vga_drawpixel( x, y );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**********************************************************************/
|
||||
/***** Read spans of pixels *****/
|
||||
/**********************************************************************/
|
||||
|
||||
|
||||
static void read_ci32_span( const GLcontext *ctx,
|
||||
GLuint n, GLint x, GLint y, GLuint index[])
|
||||
{
|
||||
int i;
|
||||
y = FLIP(y);
|
||||
for (i=0; i<n; i++,x++) {
|
||||
index[i] = vga_getpixel( x, y );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void read_rgba_span( const GLcontext *ctx, GLuint n, GLint x, GLint y,
|
||||
GLubyte rgba[][4] )
|
||||
{
|
||||
int i;
|
||||
for (i=0; i<n; i++, x++) {
|
||||
/* TODO */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**********************************************************************/
|
||||
/***** Write arrays of pixels *****/
|
||||
/**********************************************************************/
|
||||
|
||||
|
||||
static void write_ci32_pixels( const GLcontext *ctx,
|
||||
GLuint n, const GLint x[], const GLint y[],
|
||||
const GLuint index[], const GLubyte mask[] )
|
||||
{
|
||||
int i;
|
||||
for (i=0; i<n; i++) {
|
||||
if (mask[i]) {
|
||||
vga_setcolor( index[i] );
|
||||
vga_drawpixel( x[i], FLIP(y[i]) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void write_mono_ci_pixels( const GLcontext *ctx, GLuint n,
|
||||
const GLint x[], const GLint y[],
|
||||
const GLubyte mask[] )
|
||||
{
|
||||
int i;
|
||||
/* use current color index */
|
||||
vga_setcolor( SVGAMesa->index );
|
||||
for (i=0; i<n; i++) {
|
||||
if (mask[i]) {
|
||||
vga_drawpixel( x[i], FLIP(y[i]) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void write_rgba_pixels( const GLcontext *ctx,
|
||||
GLuint n, const GLint x[], const GLint y[],
|
||||
const GLubyte rgba[][4], const GLubyte mask[] )
|
||||
{
|
||||
int i;
|
||||
for (i=0; i<n; i++) {
|
||||
if (mask[i]) {
|
||||
vga_setrgbcolor( rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] );
|
||||
vga_drawpixel( x[i], FLIP(y[i]) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void write_mono_rgba_pixels( const GLcontext *ctx,
|
||||
GLuint n,
|
||||
const GLint x[], const GLint y[],
|
||||
const GLubyte mask[] )
|
||||
{
|
||||
int i;
|
||||
/* use current rgb color */
|
||||
vga_setrgbcolor( SVGAMesa->red, SVGAMesa->green, SVGAMesa->blue );
|
||||
for (i=0; i<n; i++) {
|
||||
if (mask[i]) {
|
||||
vga_drawpixel( x[i], FLIP(y[i]) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**********************************************************************/
|
||||
/***** Read arrays of pixels *****/
|
||||
/**********************************************************************/
|
||||
|
||||
/* Read an array of color index pixels. */
|
||||
static void read_ci32_pixels( const GLcontext *ctx,
|
||||
GLuint n, const GLint x[], const GLint y[],
|
||||
GLuint index[], const GLubyte mask[] )
|
||||
{
|
||||
int i;
|
||||
for (i=0; i<n; i++,x++) {
|
||||
index[i] = vga_getpixel( x[i], FLIP(y[i]) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void read_rgba_pixels( const GLcontext *ctx,
|
||||
GLuint n, const GLint x[], const GLint y[],
|
||||
GLubyte rgba[][4], const GLubyte mask[] )
|
||||
{
|
||||
/* TODO */
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void svgamesa_update_state( GLcontext *ctx )
|
||||
{
|
||||
/* Initialize all the pointers in the DD struct. Do this whenever */
|
||||
@@ -364,13 +243,6 @@ static void svgamesa_update_state( GLcontext *ctx )
|
||||
|
||||
ctx->Driver.UpdateState = svgamesa_update_state;
|
||||
|
||||
ctx->Driver.ClearIndex = clear_index;
|
||||
ctx->Driver.ClearColor = clear_color;
|
||||
ctx->Driver.Clear = clear;
|
||||
|
||||
ctx->Driver.Index = set_index;
|
||||
ctx->Driver.Color = set_color;
|
||||
|
||||
ctx->Driver.SetBuffer = set_buffer;
|
||||
ctx->Driver.GetBufferSize = get_buffer_size;
|
||||
|
||||
@@ -378,59 +250,119 @@ static void svgamesa_update_state( GLcontext *ctx )
|
||||
ctx->Driver.LineFunc = NULL;
|
||||
ctx->Driver.TriangleFunc = NULL;
|
||||
|
||||
/* Pixel/span writing functions: */
|
||||
/* TODO: use different funcs for 8, 16, 32-bit depths */
|
||||
ctx->Driver.WriteRGBASpan = write_rgba_span;
|
||||
ctx->Driver.WriteMonoRGBASpan = write_mono_rgba_span;
|
||||
ctx->Driver.WriteRGBAPixels = write_rgba_pixels;
|
||||
ctx->Driver.WriteMonoRGBAPixels = write_mono_rgba_pixels;
|
||||
ctx->Driver.WriteCI32Span = write_ci32_span;
|
||||
ctx->Driver.WriteCI8Span = write_ci8_span;
|
||||
ctx->Driver.WriteMonoCISpan = write_mono_ci_span;
|
||||
ctx->Driver.WriteCI32Pixels = write_ci32_pixels;
|
||||
ctx->Driver.WriteMonoCIPixels = write_mono_ci_pixels;
|
||||
switch (SVGABuffer.Depth) {
|
||||
case 8: ctx->Driver.ClearIndex = __clear_index8;
|
||||
ctx->Driver.Clear = __clear8;
|
||||
ctx->Driver.Index = __set_index8;
|
||||
|
||||
/* Pixel/span reading functions: */
|
||||
/* TODO: use different funcs for 8, 16, 32-bit depths */
|
||||
ctx->Driver.ReadCI32Span = read_ci32_span;
|
||||
ctx->Driver.ReadRGBASpan = read_rgba_span;
|
||||
ctx->Driver.ReadCI32Pixels = read_ci32_pixels;
|
||||
ctx->Driver.ReadRGBAPixels = read_rgba_pixels;
|
||||
ctx->Driver.ReadCI32Span = __read_ci32_span8;
|
||||
ctx->Driver.ReadCI32Pixels = __read_ci32_pixels8;
|
||||
ctx->Driver.WriteCI8Span = __write_ci8_span8;
|
||||
ctx->Driver.WriteCI32Span = __write_ci32_span8;
|
||||
ctx->Driver.WriteCI32Pixels = __write_ci32_pixels8;
|
||||
ctx->Driver.WriteMonoCISpan = __write_mono_ci_span8;
|
||||
ctx->Driver.WriteMonoCIPixels = __write_mono_ci_pixels8;
|
||||
#ifdef SVGA_DEBUG
|
||||
SVGAlog("SVGAUpdateState: 8 bit mode.");
|
||||
#endif
|
||||
|
||||
break;
|
||||
case 15: ctx->Driver.ClearColor = __clear_color15;
|
||||
ctx->Driver.Clear = __clear15;
|
||||
ctx->Driver.Color = __set_color15;
|
||||
|
||||
ctx->Driver.ReadRGBASpan = __read_rgba_span15;
|
||||
ctx->Driver.ReadRGBAPixels = __read_rgba_pixels15;
|
||||
ctx->Driver.WriteRGBASpan = __write_rgba_span15;
|
||||
ctx->Driver.WriteRGBAPixels = __write_rgba_pixels15;
|
||||
ctx->Driver.WriteMonoRGBASpan = __write_mono_rgba_span15;
|
||||
ctx->Driver.WriteMonoRGBAPixels = __write_mono_rgba_pixels15;
|
||||
#ifdef SVGA_DEBUG
|
||||
SVGAlog("SVGAUpdateState: 15 bit mode.");
|
||||
#endif
|
||||
break;
|
||||
case 16: ctx->Driver.ClearColor = __clear_color16;
|
||||
ctx->Driver.Clear = __clear16;
|
||||
ctx->Driver.Color = __set_color16;
|
||||
|
||||
ctx->Driver.ReadRGBASpan = __read_rgba_span16;
|
||||
ctx->Driver.ReadRGBAPixels = __read_rgba_pixels16;
|
||||
ctx->Driver.WriteRGBASpan = __write_rgba_span16;
|
||||
ctx->Driver.WriteRGBAPixels = __write_rgba_pixels16;
|
||||
ctx->Driver.WriteMonoRGBASpan = __write_mono_rgba_span16;
|
||||
ctx->Driver.WriteMonoRGBAPixels = __write_mono_rgba_pixels16;
|
||||
break;
|
||||
#ifdef SVGA_DEBUG
|
||||
SVGAlog("SVGAUpdateState: 16 bit mode.");
|
||||
#endif
|
||||
case 24: ctx->Driver.ClearColor = __clear_color24;
|
||||
ctx->Driver.Clear = __clear24;
|
||||
ctx->Driver.Color = __set_color24;
|
||||
|
||||
ctx->Driver.ReadRGBASpan = __read_rgba_span24;
|
||||
ctx->Driver.ReadRGBAPixels = __read_rgba_pixels24;
|
||||
ctx->Driver.WriteRGBASpan = __write_rgba_span24;
|
||||
ctx->Driver.WriteRGBAPixels = __write_rgba_pixels24;
|
||||
ctx->Driver.WriteMonoRGBASpan = __write_mono_rgba_span24;
|
||||
ctx->Driver.WriteMonoRGBAPixels = __write_mono_rgba_pixels24;
|
||||
break;
|
||||
#ifdef SVGA_DEBUG
|
||||
SVGAlog("SVGAUpdateState: 32 bit mode.");
|
||||
#endif
|
||||
case 32: ctx->Driver.ClearColor = __clear_color32;
|
||||
ctx->Driver.Clear = __clear32;
|
||||
ctx->Driver.Color = __set_color32;
|
||||
|
||||
ctx->Driver.ReadRGBASpan = __read_rgba_span32;
|
||||
ctx->Driver.ReadRGBAPixels = __read_rgba_pixels32;
|
||||
ctx->Driver.WriteRGBASpan = __write_rgba_span32;
|
||||
ctx->Driver.WriteRGBAPixels = __write_rgba_pixels32;
|
||||
ctx->Driver.WriteMonoRGBASpan = __write_mono_rgba_span32;
|
||||
ctx->Driver.WriteMonoRGBAPixels = __write_mono_rgba_pixels32;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Create a new VGA/Mesa context and return a handle to it.
|
||||
*/
|
||||
SVGAMesaContext SVGAMesaCreateContext( GLboolean doubleBuffer )
|
||||
{
|
||||
SVGAMesaContext ctx;
|
||||
#ifndef DEV
|
||||
GLboolean rgb_flag;
|
||||
GLfloat redscale, greenscale, bluescale, alphascale;
|
||||
GLboolean alpha_flag = GL_FALSE;
|
||||
int colors;
|
||||
GLint index_bits;
|
||||
GLint redbits, greenbits, bluebits, alphabits;
|
||||
|
||||
/* determine if we're in RGB or color index mode */
|
||||
colors = vga_getcolors();
|
||||
if (colors==32768) {
|
||||
if ((SVGABuffer.Depth==32) || (SVGABuffer.Depth==24)) {
|
||||
rgb_flag = GL_TRUE;
|
||||
redscale = greenscale = bluescale = alphascale = 255.0;
|
||||
redbits = greenbits = bluebits = 8;
|
||||
alphabits = 0;
|
||||
index_bits = 0;
|
||||
}
|
||||
else if (colors==256) {
|
||||
else if (SVGABuffer.Depth==8) {
|
||||
rgb_flag = GL_FALSE;
|
||||
redscale = greenscale = bluescale = alphascale = 0.0;
|
||||
redbits = greenbits = bluebits = alphabits = 0;
|
||||
index_bits = 8;
|
||||
}
|
||||
else {
|
||||
printf(">16 bit color not implemented yet!\n");
|
||||
return NULL;
|
||||
else if (SVGABuffer.Depth==15) {
|
||||
rgb_flag = GL_TRUE;
|
||||
redscale = greenscale = bluescale = alphascale = 31.0;
|
||||
redbits = greenbits = bluebits = 5;
|
||||
alphabits = 0;
|
||||
index_bits = 0;
|
||||
}
|
||||
else if (SVGABuffer.Depth==16) {
|
||||
rgb_flag = GL_TRUE;
|
||||
redscale = bluescale = alphascale = 31.0;
|
||||
greenscale = 63.0;
|
||||
redbits = bluebits = 5;
|
||||
greenbits = 6;
|
||||
alphabits = 0;
|
||||
index_bits = 0;
|
||||
}
|
||||
|
||||
ctx = (SVGAMesaContext) calloc( 1, sizeof(struct svgamesa_context) );
|
||||
@@ -459,18 +391,16 @@ SVGAMesaContext SVGAMesaCreateContext( GLboolean doubleBuffer )
|
||||
ctx->red = ctx->green = ctx->blue = 255;
|
||||
|
||||
ctx->width = ctx->height = 0; /* temporary until first "make-current" */
|
||||
|
||||
#endif
|
||||
return ctx;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Destroy the given VGA/Mesa context.
|
||||
*/
|
||||
void SVGAMesaDestroyContext( SVGAMesaContext ctx )
|
||||
{
|
||||
#ifndef DEV
|
||||
if (ctx) {
|
||||
gl_destroy_visual( ctx->gl_vis );
|
||||
gl_destroy_context( ctx->gl_ctx );
|
||||
@@ -480,15 +410,15 @@ void SVGAMesaDestroyContext( SVGAMesaContext ctx )
|
||||
SVGAMesa = NULL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Make the specified VGA/Mesa context the current one.
|
||||
*/
|
||||
void SVGAMesaMakeCurrent( SVGAMesaContext ctx )
|
||||
{
|
||||
#ifndef DEV
|
||||
SVGAMesa = ctx;
|
||||
svgamesa_update_state( ctx->gl_ctx );
|
||||
gl_make_current( ctx->gl_ctx, ctx->gl_buffer );
|
||||
@@ -499,10 +429,9 @@ void SVGAMesaMakeCurrent( SVGAMesaContext ctx )
|
||||
ctx->height = vga_getydim();
|
||||
gl_Viewport( ctx->gl_ctx, 0, 0, ctx->width, ctx->height );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Return a handle to the current VGA/Mesa context.
|
||||
*/
|
||||
@@ -511,20 +440,38 @@ SVGAMesaContext SVGAMesaGetCurrentContext( void )
|
||||
return SVGAMesa;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Swap front/back buffers for current context if double buffered.
|
||||
*/
|
||||
void SVGAMesaSwapBuffers( void )
|
||||
{
|
||||
void * tmpptr;
|
||||
|
||||
/* vga_waitretrace(); */
|
||||
copy_buffer(SVGABuffer.BackBuffer);
|
||||
|
||||
#ifndef DEV
|
||||
FLUSH_VB( SVGAMesa->gl_ctx, "swap buffers" );
|
||||
if (SVGAMesa->gl_vis->DBflag) {
|
||||
vga_flip();
|
||||
}
|
||||
if (SVGAMesa->gl_vis->DBflag)
|
||||
#endif /* DEV */
|
||||
{
|
||||
#ifdef SVGA_DEBUG
|
||||
sprintf(cbuf,"SVGAMesaSwapBuffers : Swapping...");
|
||||
SVGAlog(cbuf);
|
||||
#endif /* SVGA_DEBUG */
|
||||
tmpptr=SVGABuffer.BackBuffer;
|
||||
SVGABuffer.BackBuffer=SVGABuffer.FrontBuffer;
|
||||
SVGABuffer.FrontBuffer=tmpptr;
|
||||
#ifdef SVGA_DEBUG
|
||||
sprintf(cbuf,"SVGAMesaSwapBuffers : WriteBuffer : %p\n"
|
||||
" Readbuffer : %p", \
|
||||
SVGABuffer.BackBuffer, SVGABuffer.FrontBuffer );
|
||||
SVGAlog(cbuf);
|
||||
#endif /* SVGA_DEBUG */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#else
|
||||
#else /*SVGA*/
|
||||
|
||||
/*
|
||||
* Need this to provide at least one external definition when SVGA is
|
||||
|
185
src/mesa/drivers/svga/svgamesa15.c
Normal file
185
src/mesa/drivers/svga/svgamesa15.c
Normal file
@@ -0,0 +1,185 @@
|
||||
/* $Id: svgamesa15.c,v 1.1.2.4 2000/01/31 22:10:39 tanner Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.2
|
||||
* Copyright (C) 1995-2000 Brian Paul
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* SVGA driver for Mesa.
|
||||
* Original author: Brian Paul
|
||||
* Additional authors: Slawomir Szczyrba <steev@hot.pl> (Mesa 3.2)
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "conf.h"
|
||||
#endif
|
||||
|
||||
#ifdef SVGA
|
||||
|
||||
#include "svgapix.h"
|
||||
|
||||
GLshort * shortBuffer;
|
||||
|
||||
int __svga_drawpixel15(int x, int y, unsigned long c)
|
||||
{
|
||||
unsigned long offset;
|
||||
|
||||
shortBuffer=(void *)SVGABuffer.BackBuffer;
|
||||
y = SVGAInfo->height-y-1;
|
||||
offset = y * SVGAInfo->width + x;
|
||||
shortBuffer[offset]=c;
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned long __svga_getpixel15(int x, int y)
|
||||
{
|
||||
unsigned long offset;
|
||||
|
||||
shortBuffer=(void *)SVGABuffer.BackBuffer;
|
||||
y = SVGAInfo->height-y-1;
|
||||
offset = y * SVGAInfo->width + x;
|
||||
return shortBuffer[offset];
|
||||
}
|
||||
|
||||
void __set_color15( GLcontext *ctx,
|
||||
GLubyte red, GLubyte green,
|
||||
GLubyte blue, GLubyte alpha )
|
||||
{
|
||||
SVGAMesa->hicolor=(red>>3)<<10 | (green>>3)<<5 | (blue>>3);
|
||||
/* SVGAMesa->hicolor=(red)<<10 | (green)<<5 | (blue); */
|
||||
}
|
||||
|
||||
void __clear_color15( GLcontext *ctx,
|
||||
GLubyte red, GLubyte green,
|
||||
GLubyte blue, GLubyte alpha )
|
||||
{
|
||||
SVGAMesa->clear_hicolor=(red>>3)<<10 | (green>>3)<<5 | (blue>>3);
|
||||
/* SVGAMesa->clear_hicolor=(red)<<10 | (green)<<5 | (blue);*/
|
||||
}
|
||||
|
||||
GLbitfield __clear15( GLcontext *ctx, GLbitfield mask, GLboolean all,
|
||||
GLint x, GLint y, GLint width, GLint height )
|
||||
{
|
||||
int i,j;
|
||||
|
||||
if (mask & GL_COLOR_BUFFER_BIT) {
|
||||
shortBuffer=(void *)SVGABuffer.BackBuffer;
|
||||
if (all) {
|
||||
for (i=0;i<SVGABuffer.BufferSize / 2;i++) shortBuffer[i]=SVGAMesa->clear_hicolor;
|
||||
} else {
|
||||
for (i=x;i<width;i++)
|
||||
for (j=y;j<height;j++)
|
||||
__svga_drawpixel15(i,j,SVGAMesa->clear_hicolor);
|
||||
}
|
||||
}
|
||||
return mask & (~GL_COLOR_BUFFER_BIT);
|
||||
}
|
||||
|
||||
void __write_rgba_span15( const GLcontext *ctx, GLuint n, GLint x, GLint y,
|
||||
const GLubyte rgba[][4], const GLubyte mask[] )
|
||||
{
|
||||
int i;
|
||||
if (mask) {
|
||||
/* draw some pixels */
|
||||
for (i=0; i<n; i++, x++) {
|
||||
if (mask[i]) {
|
||||
__svga_drawpixel15( x, y, (rgba[i][RCOMP]>>3)<<10 | \
|
||||
(rgba[i][GCOMP]>>3)<<5 | \
|
||||
(rgba[i][BCOMP]>>3));
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* draw all pixels */
|
||||
for (i=0; i<n; i++, x++) {
|
||||
__svga_drawpixel15( x, y, (rgba[i][RCOMP]>>3)<<10 | \
|
||||
(rgba[i][GCOMP]>>3)<<5 | \
|
||||
(rgba[i][BCOMP]>>3));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void __write_mono_rgba_span15( const GLcontext *ctx,
|
||||
GLuint n, GLint x, GLint y,
|
||||
const GLubyte mask[])
|
||||
{
|
||||
int i;
|
||||
for (i=0; i<n; i++, x++) {
|
||||
if (mask[i]) {
|
||||
__svga_drawpixel15( x, y, SVGAMesa->hicolor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void __read_rgba_span15( const GLcontext *ctx, GLuint n, GLint x, GLint y,
|
||||
GLubyte rgba[][4] )
|
||||
{
|
||||
int i,pix;
|
||||
for (i=0; i<n; i++, x++) {
|
||||
pix = __svga_getpixel15( x, y);
|
||||
rgba[i][RCOMP] = ((pix>>10)<<3) & 0xff;
|
||||
rgba[i][GCOMP] = ((pix>> 5)<<3) & 0xff;
|
||||
rgba[i][BCOMP] = ((pix )<<3) & 0xff;
|
||||
}
|
||||
}
|
||||
|
||||
void __write_rgba_pixels15( const GLcontext *ctx,
|
||||
GLuint n, const GLint x[], const GLint y[],
|
||||
const GLubyte rgba[][4], const GLubyte mask[] )
|
||||
{
|
||||
int i;
|
||||
for (i=0; i<n; i++) {
|
||||
if (mask[i]) {
|
||||
__svga_drawpixel15( x[i], y[i], (rgba[i][RCOMP]>>3)<<10 | \
|
||||
(rgba[i][GCOMP]>>3)<<5 | \
|
||||
(rgba[i][BCOMP]>>3));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void __write_mono_rgba_pixels15( const GLcontext *ctx,
|
||||
GLuint n,
|
||||
const GLint x[], const GLint y[],
|
||||
const GLubyte mask[] )
|
||||
{
|
||||
int i;
|
||||
/* use current rgb color */
|
||||
for (i=0; i<n; i++) {
|
||||
if (mask[i]) {
|
||||
__svga_drawpixel15( x[i], y[i], SVGAMesa->hicolor );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void __read_rgba_pixels15( const GLcontext *ctx,
|
||||
GLuint n, const GLint x[], const GLint y[],
|
||||
GLubyte rgba[][4], const GLubyte mask[] )
|
||||
{
|
||||
int i,pix;
|
||||
for (i=0; i<n; i++,x++) {
|
||||
pix = __svga_getpixel15( x[i], y[i] );
|
||||
rgba[i][RCOMP] = ((pix>>10)<<3) & 0xff;
|
||||
rgba[i][GCOMP] = ((pix>> 5)<<3) & 0xff;
|
||||
rgba[i][BCOMP] = ((pix )<<3) & 0xff;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
44
src/mesa/drivers/svga/svgamesa15.h
Normal file
44
src/mesa/drivers/svga/svgamesa15.h
Normal file
@@ -0,0 +1,44 @@
|
||||
/* $Id: svgamesa15.h,v 1.1.2.2 2000/01/22 20:05:28 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.2
|
||||
* Copyright (C) 1995-2000 Brian Paul
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* SVGA driver for Mesa.
|
||||
* Original author: Brian Paul
|
||||
* Additional authors: Slawomir Szczyrba <steev@hot.pl> (Mesa 3.2)
|
||||
*/
|
||||
|
||||
|
||||
#ifndef SVGA_MESA_15_H
|
||||
#define SVGA_MESA_15_H
|
||||
|
||||
extern void __set_color15( GLcontext *ctx, GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha );
|
||||
extern void __clear_color15( GLcontext *ctx, GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha );
|
||||
extern GLbitfield __clear15( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height );
|
||||
extern void __write_rgba_span15( const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLubyte rgba[][4], const GLubyte mask[] );
|
||||
extern void __write_mono_rgba_span15( const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLubyte mask[]);
|
||||
extern void __read_rgba_span15( const GLcontext *ctx, GLuint n, GLint x, GLint y, GLubyte rgba[][4] );
|
||||
extern void __write_rgba_pixels15( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte rgba[][4], const GLubyte mask[] );
|
||||
extern void __write_mono_rgba_pixels15( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte mask[] );
|
||||
extern void __read_rgba_pixels15( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], GLubyte rgba[][4], const GLubyte mask[] );
|
||||
|
||||
#endif /* SVGA_MESA_15_H */
|
185
src/mesa/drivers/svga/svgamesa16.c
Normal file
185
src/mesa/drivers/svga/svgamesa16.c
Normal file
@@ -0,0 +1,185 @@
|
||||
/* $Id: svgamesa16.c,v 1.1.2.4 2000/01/31 22:10:39 tanner Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.2
|
||||
* Copyright (C) 1995-2000 Brian Paul
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* SVGA driver for Mesa.
|
||||
* Original author: Brian Paul
|
||||
* Additional authors: Slawomir Szczyrba <steev@hot.pl> (Mesa 3.2)
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "conf.h"
|
||||
#endif
|
||||
|
||||
#ifdef SVGA
|
||||
|
||||
#include "svgapix.h"
|
||||
|
||||
GLshort * shortBuffer;
|
||||
|
||||
int __svga_drawpixel16(int x, int y, unsigned long c)
|
||||
{
|
||||
unsigned long offset;
|
||||
|
||||
shortBuffer=(void *)SVGABuffer.BackBuffer;
|
||||
y = SVGAInfo->height-y-1;
|
||||
offset = y * SVGAInfo->width + x;
|
||||
shortBuffer[offset]=c;
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned long __svga_getpixel16(int x, int y)
|
||||
{
|
||||
unsigned long offset;
|
||||
|
||||
shortBuffer=(void *)SVGABuffer.BackBuffer;
|
||||
y = SVGAInfo->height-y-1;
|
||||
offset = y * SVGAInfo->width + x;
|
||||
return shortBuffer[offset];
|
||||
}
|
||||
|
||||
void __set_color16( GLcontext *ctx,
|
||||
GLubyte red, GLubyte green,
|
||||
GLubyte blue, GLubyte alpha )
|
||||
{
|
||||
SVGAMesa->hicolor=(red>>3)<<11 | (green>>2)<<5 | (blue>>3);
|
||||
/* SVGAMesa->hicolor=(red)<<11 | (green)<<5 | (blue); */
|
||||
}
|
||||
|
||||
void __clear_color16( GLcontext *ctx,
|
||||
GLubyte red, GLubyte green,
|
||||
GLubyte blue, GLubyte alpha )
|
||||
{
|
||||
SVGAMesa->clear_hicolor=(red>>3)<<11 | (green>>2)<<5 | (blue>>3);
|
||||
/* SVGAMesa->clear_hicolor=(red)<<11 | (green)<<5 | (blue); */
|
||||
}
|
||||
|
||||
GLbitfield __clear16( GLcontext *ctx, GLbitfield mask, GLboolean all,
|
||||
GLint x, GLint y, GLint width, GLint height )
|
||||
{
|
||||
int i,j;
|
||||
|
||||
if (mask & GL_COLOR_BUFFER_BIT) {
|
||||
if (all) {
|
||||
shortBuffer=(void *)SVGABuffer.BackBuffer;
|
||||
for (i=0;i<SVGABuffer.BufferSize / 2;i++) shortBuffer[i]=SVGAMesa->clear_hicolor;
|
||||
} else {
|
||||
for (i=x;i<width;i++)
|
||||
for (j=y;j<height;j++)
|
||||
__svga_drawpixel16(i,j,SVGAMesa->clear_hicolor);
|
||||
}
|
||||
}
|
||||
return mask & (~GL_COLOR_BUFFER_BIT);
|
||||
}
|
||||
|
||||
void __write_rgba_span16( const GLcontext *ctx, GLuint n, GLint x, GLint y,
|
||||
const GLubyte rgba[][4], const GLubyte mask[] )
|
||||
{
|
||||
int i;
|
||||
if (mask) {
|
||||
/* draw some pixels */
|
||||
for (i=0; i<n; i++, x++) {
|
||||
if (mask[i]) {
|
||||
__svga_drawpixel16( x, y, (rgba[i][RCOMP]>>3)<<11 | \
|
||||
(rgba[i][GCOMP]>>2)<<5 | \
|
||||
(rgba[i][BCOMP]>>3));
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* draw all pixels */
|
||||
for (i=0; i<n; i++, x++) {
|
||||
__svga_drawpixel16( x, y, (rgba[i][RCOMP]>>3)<<11 | \
|
||||
(rgba[i][GCOMP]>>2)<<5 | \
|
||||
(rgba[i][BCOMP]>>3));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void __write_mono_rgba_span16( const GLcontext *ctx,
|
||||
GLuint n, GLint x, GLint y,
|
||||
const GLubyte mask[])
|
||||
{
|
||||
int i;
|
||||
for (i=0; i<n; i++, x++) {
|
||||
if (mask[i]) {
|
||||
__svga_drawpixel16( x, y, SVGAMesa->hicolor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void __read_rgba_span16( const GLcontext *ctx, GLuint n, GLint x, GLint y,
|
||||
GLubyte rgba[][4] )
|
||||
{
|
||||
int i,pix;
|
||||
for (i=0; i<n; i++, x++) {
|
||||
pix = __svga_getpixel16( x, y );
|
||||
rgba[i][RCOMP] = ((pix>>11)<<3) & 0xff;
|
||||
rgba[i][GCOMP] = ((pix>> 5)<<2) & 0xff;
|
||||
rgba[i][BCOMP] = ((pix )<<3) & 0xff;
|
||||
}
|
||||
}
|
||||
|
||||
void __write_rgba_pixels16( const GLcontext *ctx,
|
||||
GLuint n, const GLint x[], const GLint y[],
|
||||
const GLubyte rgba[][4], const GLubyte mask[] )
|
||||
{
|
||||
int i;
|
||||
for (i=0; i<n; i++) {
|
||||
if (mask[i]) {
|
||||
__svga_drawpixel16( x[i], y[i], (rgba[i][RCOMP]>>3)<<11 | \
|
||||
(rgba[i][GCOMP]>>2)<<5 | \
|
||||
(rgba[i][BCOMP]>>3));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void __write_mono_rgba_pixels16( const GLcontext *ctx,
|
||||
GLuint n,
|
||||
const GLint x[], const GLint y[],
|
||||
const GLubyte mask[] )
|
||||
{
|
||||
int i;
|
||||
/* use current rgb color */
|
||||
for (i=0; i<n; i++) {
|
||||
if (mask[i]) {
|
||||
__svga_drawpixel16( x[i], y[i], SVGAMesa->hicolor );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void __read_rgba_pixels16( const GLcontext *ctx,
|
||||
GLuint n, const GLint x[], const GLint y[],
|
||||
GLubyte rgba[][4], const GLubyte mask[] )
|
||||
{
|
||||
int i,pix;
|
||||
for (i=0; i<n; i++,x++) {
|
||||
pix = __svga_getpixel16( x[i], y[i] );
|
||||
rgba[i][RCOMP] = ((pix>>11)<<3) & 0xff;
|
||||
rgba[i][GCOMP] = ((pix>> 5)<<2) & 0xff;
|
||||
rgba[i][BCOMP] = ((pix )<<3) & 0xff;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
45
src/mesa/drivers/svga/svgamesa16.h
Normal file
45
src/mesa/drivers/svga/svgamesa16.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/* $Id: svgamesa16.h,v 1.1.2.2 2000/01/22 20:05:28 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.2
|
||||
* Copyright (C) 1995-2000 Brian Paul
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* SVGA driver for Mesa.
|
||||
* Original author: Brian Paul
|
||||
* Additional authors: Slawomir Szczyrba <steev@hot.pl> (Mesa 3.2)
|
||||
*/
|
||||
|
||||
|
||||
#ifndef SVGA_MESA_16_H
|
||||
#define SVGA_MESA_16_H
|
||||
|
||||
extern void __set_color16( GLcontext *ctx, GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha );
|
||||
extern void __clear_color16( GLcontext *ctx, GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha );
|
||||
extern GLbitfield __clear16( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height );
|
||||
extern void __write_rgba_span16( const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLubyte rgba[][4], const GLubyte mask[] );
|
||||
extern void __write_mono_rgba_span16( const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLubyte mask[]);
|
||||
extern void __read_rgba_span16( const GLcontext *ctx, GLuint n, GLint x, GLint y, GLubyte rgba[][4] );
|
||||
extern void __write_rgba_pixels16( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte rgba[][4], const GLubyte mask[] );
|
||||
extern void __write_mono_rgba_pixels16( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte mask[] );
|
||||
extern void __read_rgba_pixels16( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], GLubyte rgba[][4], const GLubyte mask[] );
|
||||
|
||||
#endif /* SVGA_MESA_16_H */
|
||||
|
215
src/mesa/drivers/svga/svgamesa24.c
Normal file
215
src/mesa/drivers/svga/svgamesa24.c
Normal file
@@ -0,0 +1,215 @@
|
||||
/* $Id: svgamesa24.c,v 1.1.2.5 2000/01/31 22:10:39 tanner Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.2
|
||||
* Copyright (C) 1995-2000 Brian Paul
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* SVGA driver for Mesa.
|
||||
* Original author: Brian Paul
|
||||
* Additional authors: Slawomir Szczyrba <steev@hot.pl> (Mesa 3.2)
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "conf.h"
|
||||
#endif
|
||||
|
||||
#ifdef SVGA
|
||||
|
||||
#include "svgapix.h"
|
||||
|
||||
_RGB * rgbBuffer;
|
||||
|
||||
#if 0
|
||||
/* this doesn't compile with GCC on RedHat 6.1 */
|
||||
inline int RGB2BGR24(int c)
|
||||
{
|
||||
asm("rorw $8, %0\n"
|
||||
"rorl $16, %0\n"
|
||||
"rorw $8, %0\n"
|
||||
"shrl $8, %0\n"
|
||||
: "=q"(c):"0"(c));
|
||||
return c;
|
||||
}
|
||||
#else
|
||||
static unsigned long RGB2BGR24(unsigned long color)
|
||||
{
|
||||
return (color & 0xff00)|(color>>16)|((color & 0xff)<<16);
|
||||
}
|
||||
#endif
|
||||
|
||||
int __svga_drawpixel24(int x, int y, GLubyte r, GLubyte g, GLubyte b)
|
||||
{
|
||||
unsigned long offset;
|
||||
|
||||
rgbBuffer=(void *)SVGABuffer.BackBuffer;
|
||||
y = SVGAInfo->height-y-1;
|
||||
offset = y * SVGAInfo->width + x;
|
||||
|
||||
rgbBuffer[offset].r=r;
|
||||
rgbBuffer[offset].g=g;
|
||||
rgbBuffer[offset].b=b;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned long __svga_getpixel24(int x, int y)
|
||||
{
|
||||
unsigned long offset;
|
||||
|
||||
rgbBuffer=(void *)SVGABuffer.BackBuffer;
|
||||
y = SVGAInfo->height-y-1;
|
||||
offset = y * SVGAInfo->width + x;
|
||||
return rgbBuffer[offset].r<<16 | rgbBuffer[offset].g<<8 | rgbBuffer[offset].b;
|
||||
}
|
||||
|
||||
void __set_color24( GLcontext *ctx,
|
||||
GLubyte red, GLubyte green,
|
||||
GLubyte blue, GLubyte alpha )
|
||||
{
|
||||
SVGAMesa->red = red;
|
||||
SVGAMesa->green = green;
|
||||
SVGAMesa->blue = blue;
|
||||
/* SVGAMesa->truecolor = red<<16 | green<<8 | blue; */
|
||||
}
|
||||
|
||||
void __clear_color24( GLcontext *ctx,
|
||||
GLubyte red, GLubyte green,
|
||||
GLubyte blue, GLubyte alpha )
|
||||
{
|
||||
SVGAMesa->clear_red = red;
|
||||
SVGAMesa->clear_green = green;
|
||||
SVGAMesa->clear_blue = blue;
|
||||
/* SVGAMesa->clear_truecolor = red<<16 | green<<8 | blue; */
|
||||
}
|
||||
|
||||
GLbitfield __clear24( GLcontext *ctx, GLbitfield mask, GLboolean all,
|
||||
GLint x, GLint y, GLint width, GLint height )
|
||||
{
|
||||
int i,j;
|
||||
|
||||
if (mask & GL_COLOR_BUFFER_BIT) {
|
||||
if (all) {
|
||||
rgbBuffer=(void *)SVGABuffer.BackBuffer;
|
||||
for (i=0;i<SVGABuffer.BufferSize / 3;i++)
|
||||
{
|
||||
rgbBuffer[i].r=SVGAMesa->clear_red;
|
||||
rgbBuffer[i].g=SVGAMesa->clear_green;
|
||||
rgbBuffer[i].b=SVGAMesa->clear_blue;
|
||||
}
|
||||
} else {
|
||||
for (i=x;i<width;i++)
|
||||
for (j=y;j<height;j++)
|
||||
__svga_drawpixel24( i, j, SVGAMesa->clear_red,
|
||||
SVGAMesa->clear_green,
|
||||
SVGAMesa->clear_blue);
|
||||
}
|
||||
}
|
||||
return mask & (~GL_COLOR_BUFFER_BIT);
|
||||
}
|
||||
|
||||
void __write_rgba_span24( const GLcontext *ctx, GLuint n, GLint x, GLint y,
|
||||
const GLubyte rgba[][4], const GLubyte mask[] )
|
||||
{
|
||||
int i;
|
||||
if (mask) {
|
||||
/* draw some pixels */
|
||||
for (i=0; i<n; i++, x++) {
|
||||
if (mask[i]) {
|
||||
__svga_drawpixel24( x, y, rgba[i][RCOMP],
|
||||
rgba[i][GCOMP],
|
||||
rgba[i][BCOMP]);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* draw all pixels */
|
||||
for (i=0; i<n; i++, x++) {
|
||||
__svga_drawpixel24( x, y, rgba[i][RCOMP],
|
||||
rgba[i][GCOMP],
|
||||
rgba[i][BCOMP]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void __write_mono_rgba_span24( const GLcontext *ctx,
|
||||
GLuint n, GLint x, GLint y,
|
||||
const GLubyte mask[])
|
||||
{
|
||||
int i;
|
||||
for (i=0; i<n; i++, x++) {
|
||||
if (mask[i]) {
|
||||
__svga_drawpixel24( x, y, SVGAMesa->red,
|
||||
SVGAMesa->green,
|
||||
SVGAMesa->blue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void __read_rgba_span24( const GLcontext *ctx, GLuint n, GLint x, GLint y,
|
||||
GLubyte rgba[][4] )
|
||||
{
|
||||
int i;
|
||||
for (i=0; i<n; i++, x++) {
|
||||
*((GLint*)rgba[i]) = RGB2BGR24(__svga_getpixel24( x, y));
|
||||
}
|
||||
}
|
||||
|
||||
void __write_rgba_pixels24( const GLcontext *ctx,
|
||||
GLuint n, const GLint x[], const GLint y[],
|
||||
const GLubyte rgba[][4], const GLubyte mask[] )
|
||||
{
|
||||
int i;
|
||||
for (i=0; i<n; i++) {
|
||||
if (mask[i]) {
|
||||
__svga_drawpixel24( x[i], y[i], rgba[i][RCOMP],
|
||||
rgba[i][GCOMP],
|
||||
rgba[i][BCOMP]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void __write_mono_rgba_pixels24( const GLcontext *ctx,
|
||||
GLuint n,
|
||||
const GLint x[], const GLint y[],
|
||||
const GLubyte mask[] )
|
||||
{
|
||||
int i;
|
||||
/* use current rgb color */
|
||||
for (i=0; i<n; i++) {
|
||||
if (mask[i]) {
|
||||
__svga_drawpixel24( x[i], y[i], SVGAMesa->red,
|
||||
SVGAMesa->green,
|
||||
SVGAMesa->blue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void __read_rgba_pixels24( const GLcontext *ctx,
|
||||
GLuint n, const GLint x[], const GLint y[],
|
||||
GLubyte rgba[][4], const GLubyte mask[] )
|
||||
{
|
||||
int i;
|
||||
for (i=0; i<n; i++,x++) {
|
||||
*((GLint*)rgba[i]) = RGB2BGR24(__svga_getpixel24( x[i], y[i]));
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
45
src/mesa/drivers/svga/svgamesa24.h
Normal file
45
src/mesa/drivers/svga/svgamesa24.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/* $Id: svgamesa24.h,v 1.1.2.2 2000/01/22 20:05:28 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.2
|
||||
* Copyright (C) 1995-2000 Brian Paul
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* SVGA driver for Mesa.
|
||||
* Original author: Brian Paul
|
||||
* Additional authors: Slawomir Szczyrba <steev@hot.pl> (Mesa 3.2)
|
||||
*/
|
||||
|
||||
|
||||
#ifndef SVGA_MESA_24_H
|
||||
#define SVGA_MESA_24_H
|
||||
|
||||
extern void __set_color24( GLcontext *ctx, GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha );
|
||||
extern void __clear_color24( GLcontext *ctx, GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha );
|
||||
extern GLbitfield __clear24( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height );
|
||||
extern void __write_rgba_span24( const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLubyte rgba[][4], const GLubyte mask[] );
|
||||
extern void __write_mono_rgba_span24( const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLubyte mask[]);
|
||||
extern void __read_rgba_span24( const GLcontext *ctx, GLuint n, GLint x, GLint y, GLubyte rgba[][4] );
|
||||
extern void __write_rgba_pixels24( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte rgba[][4], const GLubyte mask[] );
|
||||
extern void __write_mono_rgba_pixels24( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte mask[] );
|
||||
extern void __read_rgba_pixels24( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], GLubyte rgba[][4], const GLubyte mask[] );
|
||||
|
||||
#endif /* SVGA_MESA_24_H */
|
||||
|
192
src/mesa/drivers/svga/svgamesa32.c
Normal file
192
src/mesa/drivers/svga/svgamesa32.c
Normal file
@@ -0,0 +1,192 @@
|
||||
/* $Id: svgamesa32.c,v 1.1.2.5 2000/01/31 22:10:39 tanner Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.2
|
||||
* Copyright (C) 1995-2000 Brian Paul
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* SVGA driver for Mesa.
|
||||
* Original author: Brian Paul
|
||||
* Additional authors: Slawomir Szczyrba <steev@hot.pl> (Mesa 3.2)
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "conf.h"
|
||||
#endif
|
||||
|
||||
#ifdef SVGA
|
||||
|
||||
#include "svgapix.h"
|
||||
|
||||
GLint * intBuffer;
|
||||
|
||||
#if 0
|
||||
/* this doesn't compile with GCC on RedHat 6.1 */
|
||||
inline int RGB2BGR32(int c)
|
||||
{
|
||||
asm("rorw $8, %0\n"
|
||||
"rorl $16, %0\n"
|
||||
"rorw $8, %0\n"
|
||||
"shrl $8, %0\n"
|
||||
: "=q"(c):"0"(c));
|
||||
return c;
|
||||
}
|
||||
#else
|
||||
static unsigned long RGB2BGR32(unsigned long color)
|
||||
{
|
||||
return (color & 0xff00)|(color>>16)|((color & 0xff)<<16);
|
||||
}
|
||||
#endif
|
||||
|
||||
int __svga_drawpixel32(int x, int y, unsigned long c)
|
||||
{
|
||||
unsigned long offset;
|
||||
|
||||
intBuffer=(void *)SVGABuffer.BackBuffer;
|
||||
y = SVGAInfo->height-y-1;
|
||||
offset = y * SVGAInfo->width + x;
|
||||
intBuffer[offset]=c;
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned long __svga_getpixel32(int x, int y)
|
||||
{
|
||||
unsigned long offset;
|
||||
|
||||
intBuffer=(void *)SVGABuffer.BackBuffer;
|
||||
y = SVGAInfo->height-y-1;
|
||||
offset = y * SVGAInfo->width + x;
|
||||
return intBuffer[offset];
|
||||
}
|
||||
|
||||
void __set_color32( GLcontext *ctx,
|
||||
GLubyte red, GLubyte green,
|
||||
GLubyte blue, GLubyte alpha )
|
||||
{
|
||||
SVGAMesa->red = red;
|
||||
SVGAMesa->green = green;
|
||||
SVGAMesa->blue = blue;
|
||||
SVGAMesa->truecolor = red<<16 | green<<8 | blue;
|
||||
}
|
||||
|
||||
void __clear_color32( GLcontext *ctx,
|
||||
GLubyte red, GLubyte green,
|
||||
GLubyte blue, GLubyte alpha )
|
||||
{
|
||||
SVGAMesa->clear_truecolor = red<<16 | green<<8 | blue;
|
||||
}
|
||||
|
||||
GLbitfield __clear32( GLcontext *ctx, GLbitfield mask, GLboolean all,
|
||||
GLint x, GLint y, GLint width, GLint height )
|
||||
{
|
||||
int i,j;
|
||||
|
||||
if (mask & GL_COLOR_BUFFER_BIT) {
|
||||
if (all) {
|
||||
intBuffer=(void *)SVGABuffer.BackBuffer;
|
||||
for (i=0;i<SVGABuffer.BufferSize / 4;i++) intBuffer[i]=SVGAMesa->clear_truecolor;
|
||||
} else {
|
||||
for (i=x;i<width;i++)
|
||||
for (j=y;j<height;j++)
|
||||
__svga_drawpixel32(i,j,SVGAMesa->clear_truecolor);
|
||||
}
|
||||
}
|
||||
return mask & (~GL_COLOR_BUFFER_BIT);
|
||||
}
|
||||
|
||||
void __write_rgba_span32( const GLcontext *ctx, GLuint n, GLint x, GLint y,
|
||||
const GLubyte rgba[][4], const GLubyte mask[] )
|
||||
{
|
||||
int i;
|
||||
if (mask) {
|
||||
/* draw some pixels */
|
||||
for (i=0; i<n; i++, x++) {
|
||||
if (mask[i]) {
|
||||
__svga_drawpixel32( x, y, RGB2BGR32(*((GLint*)rgba[i])));
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* draw all pixels */
|
||||
for (i=0; i<n; i++, x++) {
|
||||
__svga_drawpixel32( x, y, RGB2BGR32(*((GLint*)rgba[i])));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void __write_mono_rgba_span32( const GLcontext *ctx,
|
||||
GLuint n, GLint x, GLint y,
|
||||
const GLubyte mask[])
|
||||
{
|
||||
int i;
|
||||
for (i=0; i<n; i++, x++) {
|
||||
if (mask[i]) {
|
||||
__svga_drawpixel32( x, y, SVGAMesa->truecolor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void __read_rgba_span32( const GLcontext *ctx, GLuint n, GLint x, GLint y,
|
||||
GLubyte rgba[][4] )
|
||||
{
|
||||
int i;
|
||||
for (i=0; i<n; i++, x++) {
|
||||
*((GLint*)rgba[i]) = RGB2BGR32(__svga_getpixel32( x, y ));
|
||||
}
|
||||
}
|
||||
|
||||
void __write_rgba_pixels32( const GLcontext *ctx,
|
||||
GLuint n, const GLint x[], const GLint y[],
|
||||
const GLubyte rgba[][4], const GLubyte mask[] )
|
||||
{
|
||||
int i;
|
||||
for (i=0; i<n; i++) {
|
||||
if (mask[i]) {
|
||||
__svga_drawpixel32( x[i], y[i], RGB2BGR32(*((GLint*)rgba[i])));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void __write_mono_rgba_pixels32( const GLcontext *ctx,
|
||||
GLuint n,
|
||||
const GLint x[], const GLint y[],
|
||||
const GLubyte mask[] )
|
||||
{
|
||||
int i;
|
||||
/* use current rgb color */
|
||||
for (i=0; i<n; i++) {
|
||||
if (mask[i]) {
|
||||
__svga_drawpixel32( x[i], y[i], SVGAMesa->truecolor );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void __read_rgba_pixels32( const GLcontext *ctx,
|
||||
GLuint n, const GLint x[], const GLint y[],
|
||||
GLubyte rgba[][4], const GLubyte mask[] )
|
||||
{
|
||||
int i;
|
||||
for (i=0; i<n; i++,x++) {
|
||||
*((GLint*)rgba[i]) = RGB2BGR32(__svga_getpixel32( x[i], y[i] ));
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
45
src/mesa/drivers/svga/svgamesa32.h
Normal file
45
src/mesa/drivers/svga/svgamesa32.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/* $Id: svgamesa32.h,v 1.1.2.2 2000/01/22 20:05:28 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.2
|
||||
* Copyright (C) 1995-2000 Brian Paul
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* SVGA driver for Mesa.
|
||||
* Original author: Brian Paul
|
||||
* Additional authors: Slawomir Szczyrba <steev@hot.pl> (Mesa 3.2)
|
||||
*/
|
||||
|
||||
|
||||
#ifndef SVGA_MESA_32_H
|
||||
#define SVGA_MESA_32_H
|
||||
|
||||
extern void __set_color32( GLcontext *ctx, GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha );
|
||||
extern void __clear_color32( GLcontext *ctx, GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha );
|
||||
extern GLbitfield __clear32( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height );
|
||||
extern void __write_rgba_span32( const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLubyte rgba[][4], const GLubyte mask[] );
|
||||
extern void __write_mono_rgba_span32( const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLubyte mask[]);
|
||||
extern void __read_rgba_span32( const GLcontext *ctx, GLuint n, GLint x, GLint y, GLubyte rgba[][4] );
|
||||
extern void __write_rgba_pixels32( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte rgba[][4], const GLubyte mask[] );
|
||||
extern void __write_mono_rgba_pixels32( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte mask[] );
|
||||
extern void __read_rgba_pixels32( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], GLubyte rgba[][4], const GLubyte mask[] );
|
||||
|
||||
#endif /* SVGA_MESA_32_H */
|
||||
|
167
src/mesa/drivers/svga/svgamesa8.c
Normal file
167
src/mesa/drivers/svga/svgamesa8.c
Normal file
@@ -0,0 +1,167 @@
|
||||
/* $Id: svgamesa8.c,v 1.1.2.3 2000/01/31 22:10:39 tanner Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.2
|
||||
* Copyright (C) 1995-2000 Brian Paul
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* SVGA driver for Mesa.
|
||||
* Original author: Brian Paul
|
||||
* Additional authors: Slawomir Szczyrba <steev@hot.pl> (Mesa 3.2)
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "conf.h"
|
||||
#endif
|
||||
|
||||
#ifdef SVGA
|
||||
|
||||
|
||||
#include "svgapix.h"
|
||||
|
||||
int __svga_drawpixel8(int x, int y, unsigned long c)
|
||||
{
|
||||
unsigned long offset;
|
||||
|
||||
y = SVGAInfo->height-y-1;
|
||||
offset = y * SVGAInfo->linewidth + x;
|
||||
SVGABuffer.BackBuffer[offset]=c;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned long __svga_getpixel8(int x, int y)
|
||||
{
|
||||
unsigned long offset;
|
||||
|
||||
y = SVGAInfo->height-y-1;
|
||||
offset = y * SVGAInfo->linewidth + x;
|
||||
return SVGABuffer.BackBuffer[offset];
|
||||
}
|
||||
|
||||
void __set_index8( GLcontext *ctx, GLuint index )
|
||||
{
|
||||
SVGAMesa->index = index;
|
||||
}
|
||||
|
||||
void __clear_index8( GLcontext *ctx, GLuint index )
|
||||
{
|
||||
SVGAMesa->clear_index = index;
|
||||
}
|
||||
|
||||
GLbitfield __clear8( GLcontext *ctx, GLbitfield mask, GLboolean all,
|
||||
GLint x, GLint y, GLint width, GLint height )
|
||||
{
|
||||
int i,j;
|
||||
|
||||
if (mask & GL_COLOR_BUFFER_BIT) {
|
||||
|
||||
if (all)
|
||||
{
|
||||
memset(SVGABuffer.BackBuffer,SVGAMesa->clear_index,SVGABuffer.BufferSize);
|
||||
} else {
|
||||
for (i=x;i<width;i++)
|
||||
for (j=y;j<height;j++)
|
||||
__svga_drawpixel8(i,j,SVGAMesa->clear_index);
|
||||
}
|
||||
}
|
||||
return mask & (~GL_COLOR_BUFFER_BIT);
|
||||
}
|
||||
|
||||
void __write_ci32_span8( const GLcontext *ctx, GLuint n, GLint x, GLint y,
|
||||
const GLuint index[], const GLubyte mask[] )
|
||||
{
|
||||
int i;
|
||||
for (i=0;i<n;i++,x++) {
|
||||
if (mask[i]) {
|
||||
__svga_drawpixel8( x, y, index[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void __write_ci8_span8( const GLcontext *ctx, GLuint n, GLint x, GLint y,
|
||||
const GLubyte index[], const GLubyte mask[] )
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i=0;i<n;i++,x++) {
|
||||
if (mask[i]) {
|
||||
__svga_drawpixel8( x, y, index[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void __write_mono_ci_span8( const GLcontext *ctx, GLuint n,
|
||||
GLint x, GLint y, const GLubyte mask[] )
|
||||
{
|
||||
int i;
|
||||
for (i=0;i<n;i++,x++) {
|
||||
if (mask[i]) {
|
||||
__svga_drawpixel8( x, y, SVGAMesa->index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void __read_ci32_span8( const GLcontext *ctx,
|
||||
GLuint n, GLint x, GLint y, GLuint index[])
|
||||
{
|
||||
int i;
|
||||
for (i=0; i<n; i++,x++) {
|
||||
index[i] = __svga_getpixel8( x, y);
|
||||
}
|
||||
}
|
||||
|
||||
void __write_ci32_pixels8( const GLcontext *ctx,
|
||||
GLuint n, const GLint x[], const GLint y[],
|
||||
const GLuint index[], const GLubyte mask[] )
|
||||
{
|
||||
int i;
|
||||
for (i=0; i<n; i++) {
|
||||
if (mask[i]) {
|
||||
__svga_drawpixel8( x[i], y[i], index[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void __write_mono_ci_pixels8( const GLcontext *ctx, GLuint n,
|
||||
const GLint x[], const GLint y[],
|
||||
const GLubyte mask[] )
|
||||
{
|
||||
int i;
|
||||
for (i=0; i<n; i++) {
|
||||
if (mask[i]) {
|
||||
__svga_drawpixel8( x[i], y[i], SVGAMesa->index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void __read_ci32_pixels8( const GLcontext *ctx,
|
||||
GLuint n, const GLint x[], const GLint y[],
|
||||
GLuint index[], const GLubyte mask[] )
|
||||
{
|
||||
int i;
|
||||
for (i=0; i<n; i++,x++) {
|
||||
index[i] = __svga_getpixel8( x[i], y[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif
|
45
src/mesa/drivers/svga/svgamesa8.h
Normal file
45
src/mesa/drivers/svga/svgamesa8.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/* $Id: svgamesa8.h,v 1.1.2.1 2000/01/22 20:05:09 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.2
|
||||
* Copyright (C) 1995-2000 Brian Paul
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* SVGA driver for Mesa.
|
||||
* Original author: Brian Paul
|
||||
* Additional authors: Slawomir Szczyrba <steev@hot.pl> (Mesa 3.2)
|
||||
*/
|
||||
|
||||
|
||||
#ifndef SVGA_MESA_8_H
|
||||
#define SVGA_MESA_8_H
|
||||
|
||||
extern void __set_index8( GLcontext *ctx, GLuint index );
|
||||
extern void __clear_index8( GLcontext *ctx, GLuint index );
|
||||
extern GLbitfield __clear8( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height );
|
||||
extern void __write_ci32_span8( const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLuint index[], const GLubyte mask[] );
|
||||
extern void __write_ci8_span8( const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLubyte index[], const GLubyte mask[] );
|
||||
extern void __write_mono_ci_span8( const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLubyte mask[] );
|
||||
extern void __read_ci32_span8( const GLcontext *ctx, GLuint n, GLint x, GLint y, GLuint index[]);
|
||||
extern void __write_ci32_pixels8( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], const GLuint index[], const GLubyte mask[] );
|
||||
extern void __write_mono_ci_pixels8( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte mask[] );
|
||||
extern void __read_ci32_pixels8( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], GLuint index[], const GLubyte mask[] );
|
||||
|
||||
#endif /* SVGA_MESA_15_H */
|
71
src/mesa/drivers/svga/svgapix.h
Normal file
71
src/mesa/drivers/svga/svgapix.h
Normal file
@@ -0,0 +1,71 @@
|
||||
/* $Id: svgapix.h,v 1.1.2.2 2000/01/22 20:05:28 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.2
|
||||
* Copyright (C) 1995-2000 Brian Paul
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* SVGA driver for Mesa.
|
||||
* Original author: Brian Paul
|
||||
* Additional authors: Slawomir Szczyrba <steev@hot.pl> (Mesa 3.2)
|
||||
*/
|
||||
|
||||
|
||||
#ifndef SVGAPIX_H
|
||||
#define SVGAPIX_H
|
||||
|
||||
#include "GL/gl.h"
|
||||
#include "GL/svgamesa.h"
|
||||
#include "context.h"
|
||||
#include "vga.h"
|
||||
|
||||
struct svgamesa_context {
|
||||
GLcontext *gl_ctx; /* the core Mesa context */
|
||||
GLvisual *gl_vis; /* describes the color buffer */
|
||||
GLframebuffer *gl_buffer; /* the ancillary buffers */
|
||||
GLuint index; /* current color index */
|
||||
GLuint clear_index; /* current clear index */
|
||||
GLint red, green, blue; /* current rgb color */
|
||||
GLuint truecolor; /* current rgb color */
|
||||
GLint clear_red,
|
||||
clear_green,
|
||||
clear_blue; /* current clear rgb color */
|
||||
GLuint clear_truecolor; /* current clear rgb color */
|
||||
GLushort hicolor; /* current hicolor */
|
||||
GLushort clear_hicolor; /* current clear hicolor */
|
||||
GLint width, height; /* size of color buffer */
|
||||
GLint depth; /* bits per pixel (8,16,24 or 32) */
|
||||
};
|
||||
|
||||
typedef struct { GLubyte b,g,r; } _RGB;
|
||||
|
||||
struct svga_buffer {
|
||||
GLint Depth;
|
||||
GLint BufferSize;
|
||||
GLubyte * FrontBuffer;
|
||||
GLubyte * BackBuffer;
|
||||
GLubyte * VideoRam;
|
||||
};
|
||||
|
||||
extern struct svga_buffer SVGABuffer;
|
||||
extern vga_modeinfo * SVGAInfo;
|
||||
extern SVGAMesaContext SVGAMesa; /* the current context */
|
||||
|
||||
#endif /* SVGAPIX_H */
|
@@ -1,10 +1,10 @@
|
||||
/* $Id: fakeglx.c,v 1.12.2.4 1999/12/11 09:20:03 brianp Exp $ */
|
||||
/* $Id: fakeglx.c,v 1.12.2.7 2000/03/23 00:13:22 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.1
|
||||
* Version: 3.2
|
||||
*
|
||||
* Copyright (C) 1999 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -1157,12 +1157,12 @@ void Fake_glXDestroyGLXPixmap( Display *dpy, GLXPixmap pixmap )
|
||||
|
||||
|
||||
void Fake_glXCopyContext( Display *dpy, GLXContext src, GLXContext dst,
|
||||
GLuint mask )
|
||||
unsigned long mask )
|
||||
{
|
||||
XMesaContext xm_src = (XMesaContext) src;
|
||||
XMesaContext xm_dst = (XMesaContext) dst;
|
||||
(void) dpy;
|
||||
gl_copy_context( xm_src->gl_ctx, xm_dst->gl_ctx, mask );
|
||||
gl_copy_context( xm_src->gl_ctx, xm_dst->gl_ctx, (GLuint) mask );
|
||||
}
|
||||
|
||||
|
||||
@@ -1452,7 +1452,7 @@ const char *Fake_glXQueryExtensionsString( Display *dpy, int screen )
|
||||
const char *Fake_glXQueryServerString( Display *dpy, int screen, int name )
|
||||
{
|
||||
static char *vendor = "Brian Paul";
|
||||
static char *version = "1.1 Mesa 3.1";
|
||||
static char *version = "1.1 Mesa 3.2 beta 1";
|
||||
|
||||
(void) dpy;
|
||||
(void) screen;
|
||||
@@ -1475,7 +1475,7 @@ const char *Fake_glXQueryServerString( Display *dpy, int screen, int name )
|
||||
const char *Fake_glXGetClientString( Display *dpy, int name )
|
||||
{
|
||||
static char *vendor = "Brian Paul";
|
||||
static char *version = "1.1 Mesa 3.1";
|
||||
static char *version = "1.1 Mesa 3.2 beta 1";
|
||||
|
||||
(void) dpy;
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/* $Id: glxapi.c,v 1.4.2.1 1999/12/10 13:45:39 brianp Exp $ */
|
||||
/* $Id: glxapi.c,v 1.4.2.2 2000/02/23 23:06:55 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
@@ -126,7 +126,7 @@ void glXDestroyContext( Display *dpy, GLXContext ctx )
|
||||
|
||||
|
||||
void glXCopyContext( Display *dpy, GLXContext src, GLXContext dst,
|
||||
GLuint mask )
|
||||
unsigned long mask )
|
||||
{
|
||||
#ifdef REALGLX
|
||||
if (display_has_glx(dpy))
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/* $Id: realglx.c,v 1.1 1999/08/19 00:55:42 jtg Exp $ */
|
||||
/* $Id: realglx.c,v 1.1.1.1.2.1 2000/02/23 23:06:55 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
@@ -89,7 +89,7 @@ void Real_glXDestroyContext( Display *dpy, GLXContext ctx )
|
||||
|
||||
|
||||
void Real_glXCopyContext( Display *dpy, GLXContext src, GLXContext dst,
|
||||
GLuint mask )
|
||||
unsigned long mask )
|
||||
{
|
||||
(void) dpy;
|
||||
(void) src;
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/* $Id: realglx.h,v 1.1 1999/08/19 00:55:42 jtg Exp $ */
|
||||
/* $Id: realglx.h,v 1.1.1.1.2.1 2000/02/23 23:06:55 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
@@ -54,7 +54,7 @@ extern void Real_glXDestroyContext( Display *dpy, GLXContext ctx );
|
||||
|
||||
|
||||
extern void Real_glXCopyContext( Display *dpy, GLXContext src, GLXContext dst,
|
||||
GLuint mask );
|
||||
unsigned long mask );
|
||||
|
||||
|
||||
extern Bool Real_glXMakeCurrent( Display *dpy, GLXDrawable drawable,
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/* $Id: xmesaP.h,v 1.2 1999/10/08 09:27:12 keithw Exp $ */
|
||||
/* $Id: xmesaP.h,v 1.2.2.1 2000/02/22 17:22:42 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
@@ -193,7 +193,7 @@ struct xmesa_buffer {
|
||||
GLint ximage_width1;
|
||||
GLushort *ximage_origin2; /* used for PIXELADDR2 macro */
|
||||
GLint ximage_width2;
|
||||
bgr_t *ximage_origin3; /* used for PIXELADDR3 macro */
|
||||
GLubyte *ximage_origin3; /* used for PIXELADDR3 macro */
|
||||
GLint ximage_width3;
|
||||
GLuint *ximage_origin4; /* used for PIXELADDR4 macro */
|
||||
GLint ximage_width4;
|
||||
@@ -492,7 +492,7 @@ static int const kernel1[16] = {
|
||||
( xmesa->xm_buffer->ximage_origin2 - (Y) * xmesa->xm_buffer->ximage_width2 + (X) )
|
||||
|
||||
#define PIXELADDR3( X, Y ) \
|
||||
( xmesa->xm_buffer->ximage_origin3 - (Y) * xmesa->xm_buffer->ximage_width3 + (X) )
|
||||
((bgr_t *) ( xmesa->xm_buffer->ximage_origin3 - (Y) * xmesa->xm_buffer->ximage_width3 + 3 * (X) ))
|
||||
|
||||
#define PIXELADDR4( X, Y ) \
|
||||
( xmesa->xm_buffer->ximage_origin4 - (Y) * xmesa->xm_buffer->ximage_width4 + (X) )
|
||||
|
@@ -1,4 +1,4 @@
|
||||
# $Id: Makefile.X11,v 1.6.2.1 1999/11/16 15:25:50 brianp Exp $
|
||||
# $Id: Makefile.X11,v 1.6.2.2 2000/01/23 17:47:00 brianp Exp $
|
||||
|
||||
# Mesa 3-D graphics library
|
||||
# Version: 3.1
|
||||
@@ -104,6 +104,11 @@ DRIVER_SOURCES = \
|
||||
X/xmesa4.c \
|
||||
OSmesa/osmesa.c \
|
||||
SVGA/svgamesa.c \
|
||||
SVGA/svgamesa8.c \
|
||||
SVGA/svgamesa15.c \
|
||||
SVGA/svgamesa16.c \
|
||||
SVGA/svgamesa24.c \
|
||||
SVGA/svgamesa32.c \
|
||||
FX/fxapi.c \
|
||||
FX/fxclip.c \
|
||||
FX/fxcva.c \
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/* $Id: accum.c,v 1.10.2.1 1999/11/27 01:35:42 brianp Exp $ */
|
||||
/* $Id: accum.c,v 1.10.2.2 2000/02/02 21:53:59 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
@@ -338,7 +338,7 @@ void gl_Accum( GLcontext *ctx, GLenum op, GLfloat value )
|
||||
if (ctx->IntegerAccumMode && value != 1.0)
|
||||
rescale_accum(ctx);
|
||||
|
||||
if (ctx->IntegerAccumMode) {
|
||||
if (ctx->IntegerAccumMode && ctx->IntegerAccumScaler > 0) {
|
||||
/* build lookup table to avoid many floating point multiplies */
|
||||
const GLfloat mult = ctx->IntegerAccumScaler;
|
||||
static GLchan multTable[32768];
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/* $Id: attrib.c,v 1.10.2.3 1999/12/12 18:30:47 keithw Exp $ */
|
||||
/* $Id: attrib.c,v 1.10.2.4 2000/03/10 22:11:15 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
@@ -434,19 +434,37 @@ void gl_PopAttrib( GLcontext* ctx )
|
||||
if (ctx->Color.DrawBuffer != oldDrawBuffer) {
|
||||
gl_DrawBuffer(ctx, ctx->Color.DrawBuffer);
|
||||
}
|
||||
if ((ctx->Color.AlphaFunc != oldAlphaFunc ||
|
||||
ctx->Color.AlphaRef != oldAlphaRef) &&
|
||||
ctx->Driver.AlphaFunc)
|
||||
(*ctx->Driver.AlphaFunc)( ctx, ctx->Color.AlphaFunc,
|
||||
ctx->Color.AlphaRef / 255.0F);
|
||||
if ((ctx->Color.BlendSrcRGB != oldBlendSrc ||
|
||||
ctx->Color.BlendSrcRGB != oldBlendDst) &&
|
||||
ctx->Color.BlendDstRGB != oldBlendDst) &&
|
||||
ctx->Driver.BlendFunc)
|
||||
(*ctx->Driver.BlendFunc)( ctx, ctx->Color.BlendSrcRGB,
|
||||
ctx->Color.BlendDstRGB);
|
||||
if (ctx->Color.LogicOp != oldLogicOp &&
|
||||
ctx->Driver.LogicOpcode)
|
||||
ctx->Driver.LogicOpcode) {
|
||||
ctx->Driver.LogicOpcode( ctx, ctx->Color.LogicOp );
|
||||
}
|
||||
if (ctx->Visual->RGBAflag) {
|
||||
GLubyte r = (GLint) (ctx->Color.ClearColor[0] * 255.0F);
|
||||
GLubyte g = (GLint) (ctx->Color.ClearColor[1] * 255.0F);
|
||||
GLubyte b = (GLint) (ctx->Color.ClearColor[2] * 255.0F);
|
||||
GLubyte a = (GLint) (ctx->Color.ClearColor[3] * 255.0F);
|
||||
(*ctx->Driver.ClearColor)( ctx, r, g, b, a );
|
||||
if ((ctx->Color.AlphaFunc != oldAlphaFunc ||
|
||||
ctx->Color.AlphaRef != oldAlphaRef) &&
|
||||
ctx->Driver.AlphaFunc)
|
||||
(*ctx->Driver.AlphaFunc)( ctx, ctx->Color.AlphaFunc,
|
||||
ctx->Color.AlphaRef / 255.0F);
|
||||
if (ctx->Driver.ColorMask) {
|
||||
(*ctx->Driver.ColorMask)(ctx,
|
||||
ctx->Color.ColorMask[0],
|
||||
ctx->Color.ColorMask[1],
|
||||
ctx->Color.ColorMask[2],
|
||||
ctx->Color.ColorMask[3]);
|
||||
}
|
||||
}
|
||||
else {
|
||||
(*ctx->Driver.ClearIndex)( ctx, ctx->Color.ClearIndex);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case GL_CURRENT_BIT:
|
||||
|
@@ -1,10 +1,10 @@
|
||||
/* $Id: blend.c,v 1.8 1999/11/11 01:22:25 brianp Exp $ */
|
||||
/* $Id: blend.c,v 1.7.2.1 2000/02/21 14:59:41 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.1
|
||||
* Version: 3.2
|
||||
*
|
||||
* Copyright (C) 1999 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -29,7 +29,13 @@
|
||||
#ifdef PC_HEADER
|
||||
#include "all.h"
|
||||
#else
|
||||
#include "glheader.h"
|
||||
#ifndef XFree86Server
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#else
|
||||
#include "GL/xf86glx.h"
|
||||
#endif
|
||||
#include "alphabuf.h"
|
||||
#include "blend.h"
|
||||
#include "context.h"
|
||||
@@ -41,9 +47,8 @@
|
||||
#endif
|
||||
|
||||
|
||||
void _mesa_BlendFunc( GLenum sfactor, GLenum dfactor )
|
||||
void gl_BlendFunc( GLcontext *ctx, GLenum sfactor, GLenum dfactor )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glBlendFunc");
|
||||
|
||||
if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
|
||||
@@ -103,10 +108,9 @@ void _mesa_BlendFunc( GLenum sfactor, GLenum dfactor )
|
||||
|
||||
/* GL_INGR_blend_func_separate */
|
||||
void
|
||||
_mesa_BlendFuncSeparateINGR( GLenum sfactorRGB, GLenum dfactorRGB,
|
||||
GLenum sfactorA, GLenum dfactorA )
|
||||
gl_BlendFuncSeparate( GLcontext *ctx, GLenum sfactorRGB, GLenum dfactorRGB,
|
||||
GLenum sfactorA, GLenum dfactorA )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glBlendFuncSeparate");
|
||||
|
||||
if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
|
||||
@@ -210,10 +214,8 @@ _mesa_BlendFuncSeparateINGR( GLenum sfactorRGB, GLenum dfactorRGB,
|
||||
|
||||
|
||||
/* This is really an extension function! */
|
||||
void
|
||||
_mesa_BlendEquationEXT( GLenum mode )
|
||||
void gl_BlendEquation( GLcontext *ctx, GLenum mode )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glBlendEquation");
|
||||
|
||||
if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
|
||||
@@ -254,10 +256,9 @@ _mesa_BlendEquationEXT( GLenum mode )
|
||||
|
||||
|
||||
|
||||
void
|
||||
_mesa_BlendColorEXT( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha )
|
||||
void gl_BlendColor( GLcontext *ctx, GLclampf red, GLclampf green,
|
||||
GLclampf blue, GLclampf alpha )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
ctx->Color.BlendColor[0] = CLAMP( red, 0.0F, 1.0F );
|
||||
ctx->Color.BlendColor[1] = CLAMP( green, 0.0F, 1.0F );
|
||||
ctx->Color.BlendColor[2] = CLAMP( blue, 0.0F, 1.0F );
|
||||
@@ -475,7 +476,7 @@ static void blend_general( GLcontext *ctx, GLuint n, const GLubyte mask[],
|
||||
sR = sG = sB = 1.0F - (GLfloat) Ad * ascale;
|
||||
break;
|
||||
case GL_SRC_ALPHA_SATURATE:
|
||||
if (As < 1.0F - (GLfloat) Ad * ascale) {
|
||||
if (As * ascale < 1.0F - (GLfloat) Ad * ascale) {
|
||||
sR = sG = sB = (GLfloat) As * ascale;
|
||||
}
|
||||
else {
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/* $Id: colortab.c,v 1.4 1999/11/11 01:22:25 brianp Exp $ */
|
||||
/* $Id: colortab.c,v 1.3.2.1 2000/02/28 20:40:18 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
@@ -23,15 +23,20 @@
|
||||
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
/* $XFree86: xc/lib/GL/mesa/src/colortab.c,v 1.2 1999/04/04 00:20:21 dawes Exp $ */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef PC_HEADER
|
||||
#include "all.h"
|
||||
#else
|
||||
#include "glheader.h"
|
||||
#ifdef XFree86Server
|
||||
#include "GL/xf86glx.h"
|
||||
#endif
|
||||
#include "colortab.h"
|
||||
#include "context.h"
|
||||
#include "image.h"
|
||||
#include "macros.h"
|
||||
#endif
|
||||
|
||||
@@ -40,8 +45,7 @@
|
||||
/*
|
||||
* Return GL_TRUE if k is a power of two, else return GL_FALSE.
|
||||
*/
|
||||
static GLboolean
|
||||
power_of_two( GLint k )
|
||||
static GLboolean power_of_two( GLint k )
|
||||
{
|
||||
GLint i, m = 1;
|
||||
for (i=0; i<32; i++) {
|
||||
@@ -53,8 +57,7 @@ power_of_two( GLint k )
|
||||
}
|
||||
|
||||
|
||||
static GLint
|
||||
decode_internal_format( GLint format )
|
||||
static GLint decode_internal_format( GLint format )
|
||||
{
|
||||
switch (format) {
|
||||
case GL_ALPHA:
|
||||
@@ -111,171 +114,81 @@ decode_internal_format( GLint format )
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_mesa_ColorTable( GLenum target, GLenum internalFormat,
|
||||
GLsizei width, GLenum format, GLenum type,
|
||||
const GLvoid *table )
|
||||
void gl_ColorTable( GLcontext *ctx, GLenum target,
|
||||
GLenum internalFormat, struct gl_image *table )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
|
||||
struct gl_texture_object *texObj;
|
||||
struct gl_palette *palette;
|
||||
GLboolean proxy = GL_FALSE;
|
||||
|
||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glColorTable");
|
||||
|
||||
switch (target) {
|
||||
case GL_TEXTURE_1D:
|
||||
texObj = texUnit->CurrentD[1];
|
||||
palette = &texObj->Palette;
|
||||
break;
|
||||
case GL_TEXTURE_2D:
|
||||
texObj = texUnit->CurrentD[2];
|
||||
palette = &texObj->Palette;
|
||||
break;
|
||||
case GL_TEXTURE_3D:
|
||||
texObj = texUnit->CurrentD[3];
|
||||
palette = &texObj->Palette;
|
||||
break;
|
||||
case GL_PROXY_TEXTURE_1D:
|
||||
texObj = ctx->Texture.Proxy1D;
|
||||
palette = &texObj->Palette;
|
||||
proxy = GL_TRUE;
|
||||
break;
|
||||
case GL_PROXY_TEXTURE_2D:
|
||||
texObj = ctx->Texture.Proxy2D;
|
||||
palette = &texObj->Palette;
|
||||
proxy = GL_TRUE;
|
||||
break;
|
||||
case GL_PROXY_TEXTURE_3D:
|
||||
texObj = ctx->Texture.Proxy3D;
|
||||
palette = &texObj->Palette;
|
||||
proxy = GL_TRUE;
|
||||
break;
|
||||
case GL_SHARED_TEXTURE_PALETTE_EXT:
|
||||
texObj = NULL;
|
||||
palette = &ctx->Texture.Palette;
|
||||
break;
|
||||
default:
|
||||
gl_error(ctx, GL_INVALID_ENUM, "glColorTable(target)");
|
||||
return;
|
||||
}
|
||||
|
||||
assert(palette);
|
||||
|
||||
if (!gl_is_legal_format_and_type(format, type)) {
|
||||
gl_error(ctx, GL_INVALID_ENUM, "glColorTable(format or type)");
|
||||
return;
|
||||
}
|
||||
|
||||
if (decode_internal_format(internalFormat) < 0) {
|
||||
gl_error( ctx, GL_INVALID_ENUM, "glColorTable(internalFormat)" );
|
||||
return;
|
||||
}
|
||||
|
||||
if (width < 1 || width > MAX_TEXTURE_PALETTE_SIZE || !power_of_two(width)) {
|
||||
gl_error(ctx, GL_INVALID_VALUE, "glColorTable(width)");
|
||||
if (proxy) {
|
||||
palette->Size = 0;
|
||||
palette->IntFormat = (GLenum) 0;
|
||||
palette->Format = (GLenum) 0;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
palette->Size = width;
|
||||
palette->IntFormat = internalFormat;
|
||||
palette->Format = (GLenum) decode_internal_format(internalFormat);
|
||||
if (!proxy) {
|
||||
_mesa_unpack_ubyte_color_span(ctx, width, palette->Format,
|
||||
palette->Table, /* dest */
|
||||
format, type, table,
|
||||
&ctx->Unpack, GL_FALSE);
|
||||
}
|
||||
if (texObj) {
|
||||
/* per-texture object palette */
|
||||
if (ctx->Driver.UpdateTexturePalette) {
|
||||
(*ctx->Driver.UpdateTexturePalette)( ctx, texObj );
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* shared texture palette */
|
||||
if (ctx->Driver.UpdateTexturePalette) {
|
||||
(*ctx->Driver.UpdateTexturePalette)( ctx, NULL );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void
|
||||
_mesa_ColorSubTable( GLenum target, GLsizei start,
|
||||
GLsizei count, GLenum format, GLenum type,
|
||||
const GLvoid *table )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
|
||||
struct gl_texture_object *texObj;
|
||||
struct gl_palette *palette;
|
||||
GLint comps;
|
||||
GLubyte *dest;
|
||||
|
||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glColorSubTable");
|
||||
|
||||
switch (target) {
|
||||
case GL_TEXTURE_1D:
|
||||
texObj = texUnit->CurrentD[1];
|
||||
palette = &texObj->Palette;
|
||||
break;
|
||||
case GL_TEXTURE_2D:
|
||||
texObj = texUnit->CurrentD[2];
|
||||
palette = &texObj->Palette;
|
||||
break;
|
||||
case GL_TEXTURE_3D:
|
||||
case GL_TEXTURE_3D_EXT:
|
||||
texObj = texUnit->CurrentD[3];
|
||||
palette = &texObj->Palette;
|
||||
break;
|
||||
case GL_PROXY_TEXTURE_1D:
|
||||
texObj = ctx->Texture.Proxy1D;
|
||||
proxy = GL_TRUE;
|
||||
break;
|
||||
case GL_PROXY_TEXTURE_2D:
|
||||
texObj = ctx->Texture.Proxy2D;
|
||||
proxy = GL_TRUE;
|
||||
break;
|
||||
case GL_PROXY_TEXTURE_3D_EXT:
|
||||
texObj = ctx->Texture.Proxy3D;
|
||||
proxy = GL_TRUE;
|
||||
break;
|
||||
case GL_SHARED_TEXTURE_PALETTE_EXT:
|
||||
texObj = NULL;
|
||||
palette = &ctx->Texture.Palette;
|
||||
break;
|
||||
default:
|
||||
gl_error(ctx, GL_INVALID_ENUM, "glColorSubTable(target)");
|
||||
gl_error(ctx, GL_INVALID_ENUM, "glColorTableEXT(target)");
|
||||
return;
|
||||
}
|
||||
|
||||
assert(palette);
|
||||
/* internalformat = just like glTexImage */
|
||||
|
||||
if (!gl_is_legal_format_and_type(format, type)) {
|
||||
gl_error(ctx, GL_INVALID_ENUM, "glColorSubTable(format or type)");
|
||||
if (table->Width < 1 || table->Width > MAX_TEXTURE_PALETTE_SIZE
|
||||
|| !power_of_two(table->Width)) {
|
||||
gl_error(ctx, GL_INVALID_VALUE, "glColorTableEXT(width)");
|
||||
if (proxy) {
|
||||
texObj->PaletteSize = 0;
|
||||
texObj->PaletteIntFormat = (GLenum) 0;
|
||||
texObj->PaletteFormat = (GLenum) 0;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (count < 1) {
|
||||
gl_error(ctx, GL_INVALID_VALUE, "glColorSubTable(count)");
|
||||
return;
|
||||
}
|
||||
|
||||
comps = gl_components_in_format(format);
|
||||
assert(comps > 0); /* error should be caught sooner */
|
||||
|
||||
if (start + count > palette->Size) {
|
||||
gl_error(ctx, GL_INVALID_VALUE, "glColorSubTable(count)");
|
||||
return;
|
||||
}
|
||||
dest = palette->Table + start * comps * sizeof(GLubyte);
|
||||
_mesa_unpack_ubyte_color_span(ctx, count, palette->Format, dest,
|
||||
format, type, table,
|
||||
&ctx->Unpack, GL_FALSE);
|
||||
|
||||
if (texObj) {
|
||||
/* per-texture object palette */
|
||||
if (ctx->Driver.UpdateTexturePalette) {
|
||||
(*ctx->Driver.UpdateTexturePalette)( ctx, texObj );
|
||||
texObj->PaletteSize = table->Width;
|
||||
texObj->PaletteIntFormat = internalFormat;
|
||||
texObj->PaletteFormat = (GLenum) decode_internal_format(internalFormat);
|
||||
if (!proxy) {
|
||||
MEMCPY(texObj->Palette, table->Data, table->Width*table->Components);
|
||||
if (ctx->Driver.UpdateTexturePalette) {
|
||||
(*ctx->Driver.UpdateTexturePalette)( ctx, texObj );
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* shared texture palette */
|
||||
ctx->Texture.PaletteSize = table->Width;
|
||||
ctx->Texture.PaletteIntFormat = internalFormat;
|
||||
ctx->Texture.PaletteFormat = (GLenum) decode_internal_format(internalFormat);
|
||||
MEMCPY(ctx->Texture.Palette, table->Data, table->Width*table->Components);
|
||||
if (ctx->Driver.UpdateTexturePalette) {
|
||||
(*ctx->Driver.UpdateTexturePalette)( ctx, NULL );
|
||||
}
|
||||
@@ -284,96 +197,38 @@ _mesa_ColorSubTable( GLenum target, GLsizei start,
|
||||
|
||||
|
||||
|
||||
void
|
||||
_mesa_GetColorTable( GLenum target, GLenum format,
|
||||
GLenum type, GLvoid *table )
|
||||
void gl_ColorSubTable( GLcontext *ctx, GLenum target,
|
||||
GLsizei start, struct gl_image *data )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
|
||||
struct gl_palette *palette;
|
||||
GLubyte rgba[MAX_TEXTURE_PALETTE_SIZE][4];
|
||||
GLint i;
|
||||
/* XXX TODO */
|
||||
gl_problem(ctx, "glColorSubTableEXT not implemented");
|
||||
(void) target;
|
||||
(void) start;
|
||||
(void) data;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void gl_GetColorTable( GLcontext *ctx, GLenum target, GLenum format,
|
||||
GLenum type, GLvoid *table )
|
||||
{
|
||||
ASSERT_OUTSIDE_BEGIN_END(ctx, "glGetBooleanv");
|
||||
|
||||
switch (target) {
|
||||
case GL_TEXTURE_1D:
|
||||
palette = &texUnit->CurrentD[1]->Palette;
|
||||
break;
|
||||
case GL_TEXTURE_2D:
|
||||
palette = &texUnit->CurrentD[2]->Palette;
|
||||
break;
|
||||
case GL_TEXTURE_3D:
|
||||
palette = &texUnit->CurrentD[3]->Palette;
|
||||
case GL_TEXTURE_3D_EXT:
|
||||
break;
|
||||
case GL_SHARED_TEXTURE_PALETTE_EXT:
|
||||
palette = &ctx->Texture.Palette;
|
||||
break;
|
||||
default:
|
||||
gl_error(ctx, GL_INVALID_ENUM, "glGetColorTable(target)");
|
||||
gl_error(ctx, GL_INVALID_ENUM, "glGetColorTableEXT(target)");
|
||||
return;
|
||||
}
|
||||
|
||||
assert(palette);
|
||||
|
||||
switch (palette->Format) {
|
||||
case GL_ALPHA:
|
||||
for (i = 0; i < palette->Size; i++) {
|
||||
rgba[i][RCOMP] = 0;
|
||||
rgba[i][GCOMP] = 0;
|
||||
rgba[i][BCOMP] = 0;
|
||||
rgba[i][ACOMP] = palette->Table[i];
|
||||
}
|
||||
break;
|
||||
case GL_LUMINANCE:
|
||||
for (i = 0; i < palette->Size; i++) {
|
||||
rgba[i][RCOMP] = palette->Table[i];
|
||||
rgba[i][GCOMP] = palette->Table[i];
|
||||
rgba[i][BCOMP] = palette->Table[i];
|
||||
rgba[i][ACOMP] = 255;
|
||||
}
|
||||
break;
|
||||
case GL_LUMINANCE_ALPHA:
|
||||
for (i = 0; i < palette->Size; i++) {
|
||||
rgba[i][RCOMP] = palette->Table[i*2+0];
|
||||
rgba[i][GCOMP] = palette->Table[i*2+0];
|
||||
rgba[i][BCOMP] = palette->Table[i*2+0];
|
||||
rgba[i][ACOMP] = palette->Table[i*2+1];
|
||||
}
|
||||
break;
|
||||
case GL_INTENSITY:
|
||||
for (i = 0; i < palette->Size; i++) {
|
||||
rgba[i][RCOMP] = palette->Table[i];
|
||||
rgba[i][GCOMP] = palette->Table[i];
|
||||
rgba[i][BCOMP] = palette->Table[i];
|
||||
rgba[i][ACOMP] = 255;
|
||||
}
|
||||
break;
|
||||
case GL_RGB:
|
||||
for (i = 0; i < palette->Size; i++) {
|
||||
rgba[i][RCOMP] = palette->Table[i*3+0];
|
||||
rgba[i][GCOMP] = palette->Table[i*3+1];
|
||||
rgba[i][BCOMP] = palette->Table[i*3+2];
|
||||
rgba[i][ACOMP] = 255;
|
||||
}
|
||||
break;
|
||||
case GL_RGBA:
|
||||
for (i = 0; i < palette->Size; i++) {
|
||||
rgba[i][RCOMP] = palette->Table[i*4+0];
|
||||
rgba[i][GCOMP] = palette->Table[i*4+1];
|
||||
rgba[i][BCOMP] = palette->Table[i*4+2];
|
||||
rgba[i][ACOMP] = palette->Table[i*4+3];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
gl_problem(ctx, "bad palette format in glGetColorTable");
|
||||
return;
|
||||
}
|
||||
|
||||
gl_pack_rgba_span(ctx, palette->Size, (const GLubyte (*)[]) rgba,
|
||||
format, type, table, &ctx->Pack, GL_FALSE);
|
||||
|
||||
gl_problem(ctx, "glGetColorTable not implemented!");
|
||||
gl_problem(ctx, "glGetColorTableEXT not implemented!");
|
||||
(void) format;
|
||||
(void) type;
|
||||
(void) table;
|
||||
@@ -381,37 +236,46 @@ _mesa_GetColorTable( GLenum target, GLenum format,
|
||||
|
||||
|
||||
|
||||
void
|
||||
_mesa_GetColorTableParameterfv( GLenum target, GLenum pname, GLfloat *params )
|
||||
void gl_GetColorTableParameterfv( GLcontext *ctx, GLenum target,
|
||||
GLenum pname, GLfloat *params )
|
||||
{
|
||||
GLint iparams[10];
|
||||
_mesa_GetColorTableParameteriv( target, pname, iparams );
|
||||
|
||||
gl_GetColorTableParameteriv( ctx, target, pname, iparams );
|
||||
*params = (GLfloat) iparams[0];
|
||||
}
|
||||
|
||||
|
||||
|
||||
void
|
||||
_mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params )
|
||||
void gl_GetColorTableParameteriv( GLcontext *ctx, GLenum target,
|
||||
GLenum pname, GLint *params )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
|
||||
struct gl_palette *palette;
|
||||
struct gl_texture_object *texObj;
|
||||
|
||||
ASSERT_OUTSIDE_BEGIN_END(ctx, "glGetColorTableParameter");
|
||||
|
||||
switch (target) {
|
||||
case GL_TEXTURE_1D:
|
||||
palette = &texUnit->CurrentD[1]->Palette;
|
||||
texObj = texUnit->CurrentD[1];
|
||||
break;
|
||||
case GL_TEXTURE_2D:
|
||||
palette = &texUnit->CurrentD[2]->Palette;
|
||||
texObj = texUnit->CurrentD[2];
|
||||
break;
|
||||
case GL_TEXTURE_3D:
|
||||
palette = &texUnit->CurrentD[3]->Palette;
|
||||
case GL_TEXTURE_3D_EXT:
|
||||
texObj = texUnit->CurrentD[3];
|
||||
break;
|
||||
case GL_PROXY_TEXTURE_1D:
|
||||
texObj = ctx->Texture.Proxy1D;
|
||||
break;
|
||||
case GL_PROXY_TEXTURE_2D:
|
||||
texObj = ctx->Texture.Proxy2D;
|
||||
break;
|
||||
case GL_PROXY_TEXTURE_3D:
|
||||
texObj = ctx->Texture.Proxy3D;
|
||||
break;
|
||||
case GL_SHARED_TEXTURE_PALETTE_EXT:
|
||||
palette = &ctx->Texture.Palette;
|
||||
texObj = NULL;
|
||||
break;
|
||||
default:
|
||||
gl_error(ctx, GL_INVALID_ENUM, "glGetColorTableParameter(target)");
|
||||
@@ -419,28 +283,34 @@ _mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params )
|
||||
}
|
||||
|
||||
switch (pname) {
|
||||
case GL_COLOR_TABLE_FORMAT:
|
||||
*params = palette->IntFormat;
|
||||
case GL_COLOR_TABLE_FORMAT_EXT:
|
||||
if (texObj)
|
||||
*params = texObj->PaletteIntFormat;
|
||||
else
|
||||
*params = ctx->Texture.PaletteIntFormat;
|
||||
break;
|
||||
case GL_COLOR_TABLE_WIDTH:
|
||||
*params = palette->Size;
|
||||
case GL_COLOR_TABLE_WIDTH_EXT:
|
||||
if (texObj)
|
||||
*params = texObj->PaletteSize;
|
||||
else
|
||||
*params = ctx->Texture.PaletteSize;
|
||||
break;
|
||||
case GL_COLOR_TABLE_RED_SIZE:
|
||||
case GL_COLOR_TABLE_RED_SIZE_EXT:
|
||||
*params = 8;
|
||||
break;
|
||||
case GL_COLOR_TABLE_GREEN_SIZE:
|
||||
case GL_COLOR_TABLE_GREEN_SIZE_EXT:
|
||||
*params = 8;
|
||||
break;
|
||||
case GL_COLOR_TABLE_BLUE_SIZE:
|
||||
case GL_COLOR_TABLE_BLUE_SIZE_EXT:
|
||||
*params = 8;
|
||||
break;
|
||||
case GL_COLOR_TABLE_ALPHA_SIZE:
|
||||
case GL_COLOR_TABLE_ALPHA_SIZE_EXT:
|
||||
*params = 8;
|
||||
break;
|
||||
case GL_COLOR_TABLE_LUMINANCE_SIZE:
|
||||
case GL_COLOR_TABLE_LUMINANCE_SIZE_EXT:
|
||||
*params = 8;
|
||||
break;
|
||||
case GL_COLOR_TABLE_INTENSITY_SIZE:
|
||||
case GL_COLOR_TABLE_INTENSITY_SIZE_EXT:
|
||||
*params = 8;
|
||||
break;
|
||||
default:
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/* $Id: context.c,v 1.18.2.6 1999/12/04 21:13:44 brianp Exp $ */
|
||||
/* $Id: context.c,v 1.18.2.8 2000/03/06 16:59:26 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
@@ -367,9 +367,9 @@ static struct gl_shared_state *alloc_shared_state( void )
|
||||
if (!ss)
|
||||
return NULL;
|
||||
|
||||
ss->DisplayList = NewHashTable();
|
||||
ss->DisplayList = _mesa_NewHashTable();
|
||||
|
||||
ss->TexObjects = NewHashTable();
|
||||
ss->TexObjects = _mesa_NewHashTable();
|
||||
|
||||
/* Default Texture objects */
|
||||
outOfMemory = GL_FALSE;
|
||||
@@ -385,9 +385,9 @@ static struct gl_shared_state *alloc_shared_state( void )
|
||||
if (!ss->DisplayList || !ss->TexObjects || outOfMemory) {
|
||||
/* Ran out of memory at some point. Free everything and return NULL */
|
||||
if (ss->DisplayList)
|
||||
DeleteHashTable(ss->DisplayList);
|
||||
_mesa_DeleteHashTable(ss->DisplayList);
|
||||
if (ss->TexObjects)
|
||||
DeleteHashTable(ss->TexObjects);
|
||||
_mesa_DeleteHashTable(ss->TexObjects);
|
||||
if (ss->DefaultD[1])
|
||||
gl_free_texture_object(ss, ss->DefaultD[1]);
|
||||
if (ss->DefaultD[2])
|
||||
@@ -410,7 +410,7 @@ static void free_shared_state( GLcontext *ctx, struct gl_shared_state *ss )
|
||||
{
|
||||
/* Free display lists */
|
||||
while (1) {
|
||||
GLuint list = HashFirstEntry(ss->DisplayList);
|
||||
GLuint list = _mesa_HashFirstEntry(ss->DisplayList);
|
||||
if (list) {
|
||||
gl_destroy_list(ctx, list);
|
||||
}
|
||||
@@ -418,7 +418,7 @@ static void free_shared_state( GLcontext *ctx, struct gl_shared_state *ss )
|
||||
break;
|
||||
}
|
||||
}
|
||||
DeleteHashTable(ss->DisplayList);
|
||||
_mesa_DeleteHashTable(ss->DisplayList);
|
||||
|
||||
/* Free texture objects */
|
||||
while (ss->TexObjectList)
|
||||
@@ -428,7 +428,7 @@ static void free_shared_state( GLcontext *ctx, struct gl_shared_state *ss )
|
||||
/* this function removes from linked list too! */
|
||||
gl_free_texture_object(ss, ss->TexObjectList);
|
||||
}
|
||||
DeleteHashTable(ss->TexObjects);
|
||||
_mesa_DeleteHashTable(ss->TexObjects);
|
||||
|
||||
FREE(ss);
|
||||
}
|
||||
@@ -622,7 +622,7 @@ static void initialize_context( GLcontext *ctx )
|
||||
gl_matrix_alloc_inv( &ctx->ModelView );
|
||||
|
||||
ctx->ModelViewStackDepth = 0;
|
||||
for (i = 0 ; i < MAX_MODELVIEW_STACK_DEPTH ; i++) {
|
||||
for (i = 0; i < MAX_MODELVIEW_STACK_DEPTH - 1; i++) {
|
||||
gl_matrix_ctr( &ctx->ModelViewStack[i] );
|
||||
gl_matrix_alloc_inv( &ctx->ModelViewStack[i] );
|
||||
}
|
||||
@@ -639,16 +639,16 @@ static void initialize_context( GLcontext *ctx )
|
||||
ctx->NearFarStack[0][0] = 1.0; /* These values seem weird by make */
|
||||
ctx->NearFarStack[0][1] = 0.0; /* sense mathematically. */
|
||||
|
||||
for (i = 0 ; i < MAX_PROJECTION_STACK_DEPTH ; i++) {
|
||||
for (i = 0; i < MAX_PROJECTION_STACK_DEPTH - 1; i++) {
|
||||
gl_matrix_ctr( &ctx->ProjectionStack[i] );
|
||||
gl_matrix_alloc_inv( &ctx->ProjectionStack[i] );
|
||||
}
|
||||
|
||||
/* Texture matrix */
|
||||
for (i=0; i<MAX_TEXTURE_UNITS; i++) {
|
||||
for (i = 0; i < MAX_TEXTURE_UNITS; i++) {
|
||||
gl_matrix_ctr( &ctx->TextureMatrix[i] );
|
||||
ctx->TextureStackDepth[i] = 0;
|
||||
for (j = 0 ; j < MAX_TEXTURE_STACK_DEPTH ; j++) {
|
||||
for (j = 0; j < MAX_TEXTURE_STACK_DEPTH - 1; j++) {
|
||||
ctx->TextureStack[i][j].inv = 0;
|
||||
}
|
||||
}
|
||||
@@ -1370,9 +1370,8 @@ void gl_context_initialize( GLcontext *ctx )
|
||||
void gl_destroy_context( GLcontext *ctx )
|
||||
{
|
||||
if (ctx) {
|
||||
|
||||
GLuint i;
|
||||
struct gl_shine_tab *s, *tmps;
|
||||
GLuint i, j;
|
||||
|
||||
#ifdef PROFILE
|
||||
if (getenv("MESA_PROFILE")) {
|
||||
@@ -1381,13 +1380,19 @@ void gl_destroy_context( GLcontext *ctx )
|
||||
#endif
|
||||
|
||||
gl_matrix_dtr( &ctx->ModelView );
|
||||
for (i = 0 ; i < MAX_MODELVIEW_STACK_DEPTH ; i++) {
|
||||
for (i = 0 ; i < MAX_MODELVIEW_STACK_DEPTH - 1; i++) {
|
||||
gl_matrix_dtr( &ctx->ModelViewStack[i] );
|
||||
}
|
||||
gl_matrix_dtr( &ctx->ProjectionMatrix );
|
||||
for (i = 0 ; i < MAX_PROJECTION_STACK_DEPTH ; i++) {
|
||||
for (i = 0 ; i < MAX_PROJECTION_STACK_DEPTH - 1; i++) {
|
||||
gl_matrix_dtr( &ctx->ProjectionStack[i] );
|
||||
}
|
||||
for (i = 0; i < MAX_TEXTURE_UNITS; i++) {
|
||||
gl_matrix_dtr( &ctx->TextureMatrix[i] );
|
||||
for (j = 0; j < MAX_TEXTURE_STACK_DEPTH - 1; j++) {
|
||||
gl_matrix_dtr( &ctx->TextureStack[i][j] );
|
||||
}
|
||||
}
|
||||
|
||||
FREE( ctx->PB );
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
||||
/* $Id: drawpix.c,v 1.5.2.1 1999/11/26 16:28:03 brianp Exp $ */
|
||||
/* $Id: drawpix.c,v 1.5.2.2 2000/02/22 18:10:43 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
@@ -77,6 +77,9 @@ GLboolean gl_direct_DrawPixels( GLcontext *ctx,
|
||||
GL_FALSE);
|
||||
|
||||
|
||||
if (ctx->RenderMode != GL_RENDER)
|
||||
return GL_FALSE;
|
||||
|
||||
if (!ctx->Current.RasterPosValid) {
|
||||
/* no-op */
|
||||
return GL_TRUE;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
/* $Id: enums.c,v 1.5 1999/11/11 01:22:26 brianp Exp $ */
|
||||
/* $Id: enums.c,v 1.4.2.1 2000/02/05 01:52:23 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.3
|
||||
* Version: 3.1
|
||||
*
|
||||
* Copyright (C) 1999 Brian Paul All Rights Reserved.
|
||||
*
|
||||
@@ -24,15 +24,17 @@
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
#ifdef PC_HEADER
|
||||
#include "all.h"
|
||||
#ifndef XFree86Server
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#else
|
||||
#include "glheader.h"
|
||||
#include "enums.h"
|
||||
#include "mem.h"
|
||||
#include "GL/xf86glx.h"
|
||||
#endif
|
||||
|
||||
#include "GL/gl.h"
|
||||
#include "enums.h"
|
||||
#include "macros.h"
|
||||
|
||||
|
||||
typedef struct {
|
||||
const char *c;
|
||||
@@ -795,8 +797,8 @@ enum_elt all_enums[] =
|
||||
{ "GL_NATIVE_GRAPHICS_HANDLE_PGI", 107010 },
|
||||
|
||||
/* GL_EXT_compiled_vertex_array */
|
||||
{ "GL_ARRAY_ELEMENT_LOCK_FIRST_SGI", 0x81A8},
|
||||
{ "GL_ARRAY_ELEMENT_LOCK_COUNT_SGI", 0x81A9},
|
||||
{ "GL_ARRAY_ELEMENT_LOCK_FIRST_EXT", 0x81A8},
|
||||
{ "GL_ARRAY_ELEMENT_LOCK_COUNT_EXT", 0x81A9},
|
||||
|
||||
/* GL_EXT_clip_volume_hint */
|
||||
{ "GL_CLIP_VOLUME_CLIPPING_HINT_EXT", 0x80F0}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/* $Id: extensions.c,v 1.10.2.3 1999/12/12 18:30:47 keithw Exp $ */
|
||||
/* $Id: extensions.c,v 1.10.2.4 1999/12/21 17:22:39 keithw Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
#ifndef XFree86Server
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#else
|
||||
#include "GL/xf86glx.h"
|
||||
#endif
|
||||
@@ -73,6 +74,8 @@ static struct { int enabled; const char *name; } default_extensions[] = {
|
||||
{ DEFAULT_ON, "GL_EXT_compiled_vertex_array" },
|
||||
{ DEFAULT_ON, "GL_EXT_clip_volume_hint" },
|
||||
|
||||
{ DEFAULT_OFF, "GL_EXT_texture_env_add" },
|
||||
|
||||
/* These obviously won't make it before 3.3:
|
||||
*/
|
||||
{ DEFAULT_OFF, "GL_EXT_vertex_array_set" },
|
||||
@@ -109,14 +112,21 @@ static int set_extension( GLcontext *ctx, const char *name, GLuint state )
|
||||
if (strncmp(i->name, name, MAX_EXT_NAMELEN) == 0)
|
||||
break;
|
||||
|
||||
if (i == ctx->Extensions.ext_list) return 1;
|
||||
if (i == ctx->Extensions.ext_list) {
|
||||
if (MESA_VERBOSE&VERBOSE_EXTENSIONS)
|
||||
fprintf(stderr, "extension %s -- not found\n", name);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (i->enabled && !(i->enabled & ALWAYS_ENABLED))
|
||||
if (i->enabled != state && !(i->enabled & ALWAYS_ENABLED))
|
||||
{
|
||||
if (i->notify) i->notify( ctx, state );
|
||||
i->enabled = state;
|
||||
}
|
||||
|
||||
if (MESA_VERBOSE&VERBOSE_EXTENSIONS)
|
||||
fprintf(stderr, "extension %s, state %d\n", name, i->enabled);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -1,10 +1,10 @@
|
||||
/* $Id: feedback.c,v 1.6 1999/11/11 01:22:26 brianp Exp $ */
|
||||
/* $Id: feedback.c,v 1.5.2.2 2000/01/25 16:49:15 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.3
|
||||
* Version: 3.2
|
||||
*
|
||||
* Copyright (C) 1999 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -28,7 +28,12 @@
|
||||
#ifdef PC_HEADER
|
||||
#include "all.h"
|
||||
#else
|
||||
#include "glheader.h"
|
||||
#ifndef XFree86Server
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#else
|
||||
#include "GL/xf86glx.h"
|
||||
#endif
|
||||
#include "context.h"
|
||||
#include "enums.h"
|
||||
#include "feedback.h"
|
||||
@@ -49,9 +54,8 @@
|
||||
|
||||
|
||||
void
|
||||
_mesa_FeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer )
|
||||
gl_FeedbackBuffer( GLcontext *ctx, GLsizei size, GLenum type, GLfloat *buffer )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx, "glFeedbackBuffer" );
|
||||
|
||||
if (ctx->RenderMode==GL_FEEDBACK) {
|
||||
@@ -107,10 +111,8 @@ _mesa_FeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer )
|
||||
|
||||
|
||||
|
||||
void
|
||||
_mesa_PassThrough( GLfloat token )
|
||||
void gl_PassThrough( GLcontext *ctx, GLfloat token )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPassThrough");
|
||||
|
||||
if (ctx->RenderMode==GL_FEEDBACK) {
|
||||
@@ -157,13 +159,14 @@ void gl_feedback_vertex( GLcontext *ctx,
|
||||
|
||||
|
||||
|
||||
static void gl_do_feedback_vertex( GLcontext *ctx, GLuint v, GLuint pv )
|
||||
static void feedback_vertex( GLcontext *ctx, GLuint v, GLuint pv )
|
||||
{
|
||||
GLfloat win[4];
|
||||
GLfloat color[4];
|
||||
GLfloat tc[4];
|
||||
GLuint texUnit = ctx->Texture.CurrentTransformUnit;
|
||||
struct vertex_buffer *VB = ctx->VB;
|
||||
const struct vertex_buffer *VB = ctx->VB;
|
||||
GLuint index;
|
||||
|
||||
win[0] = VB->Win.data[v][0];
|
||||
win[1] = VB->Win.data[v][1];
|
||||
@@ -182,14 +185,20 @@ static void gl_do_feedback_vertex( GLcontext *ctx, GLuint v, GLuint pv )
|
||||
tc[1] = VB->TexCoordPtr[texUnit]->data[v][1] * invq;
|
||||
tc[2] = VB->TexCoordPtr[texUnit]->data[v][2] * invq;
|
||||
tc[3] = VB->TexCoordPtr[texUnit]->data[v][3];
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
ASSIGN_4V(tc, 0,0,0,1);
|
||||
COPY_SZ_4V(tc,
|
||||
VB->TexCoordPtr[texUnit]->size,
|
||||
VB->TexCoordPtr[texUnit]->data[v]);
|
||||
}
|
||||
|
||||
gl_feedback_vertex( ctx, win, color, VB->IndexPtr->data[v], tc );
|
||||
if (VB->IndexPtr)
|
||||
index = VB->IndexPtr->data[v];
|
||||
else
|
||||
index = 0;
|
||||
|
||||
gl_feedback_vertex( ctx, win, color, index, tc );
|
||||
}
|
||||
|
||||
|
||||
@@ -204,9 +213,9 @@ void gl_feedback_triangle( GLcontext *ctx,
|
||||
FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) GL_POLYGON_TOKEN );
|
||||
FEEDBACK_TOKEN( ctx, (GLfloat) 3 ); /* three vertices */
|
||||
|
||||
gl_do_feedback_vertex( ctx, v0, pv );
|
||||
gl_do_feedback_vertex( ctx, v1, pv );
|
||||
gl_do_feedback_vertex( ctx, v2, pv );
|
||||
feedback_vertex( ctx, v0, pv );
|
||||
feedback_vertex( ctx, v1, pv );
|
||||
feedback_vertex( ctx, v2, pv );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -220,8 +229,8 @@ void gl_feedback_line( GLcontext *ctx, GLuint v1, GLuint v2, GLuint pv )
|
||||
|
||||
FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) token );
|
||||
|
||||
gl_do_feedback_vertex( ctx, v1, pv );
|
||||
gl_do_feedback_vertex( ctx, v2, pv );
|
||||
feedback_vertex( ctx, v1, pv );
|
||||
feedback_vertex( ctx, v2, pv );
|
||||
|
||||
ctx->StippleCounter++;
|
||||
}
|
||||
@@ -229,14 +238,15 @@ void gl_feedback_line( GLcontext *ctx, GLuint v1, GLuint v2, GLuint pv )
|
||||
|
||||
void gl_feedback_points( GLcontext *ctx, GLuint first, GLuint last )
|
||||
{
|
||||
struct vertex_buffer *VB = ctx->VB;
|
||||
const struct vertex_buffer *VB = ctx->VB;
|
||||
GLuint i;
|
||||
|
||||
for (i=first;i<=last;i++)
|
||||
for (i=first;i<=last;i++) {
|
||||
if (VB->ClipMask[i]==0) {
|
||||
FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) GL_POINT_TOKEN );
|
||||
gl_do_feedback_vertex( ctx, i, i );
|
||||
feedback_vertex( ctx, i, i );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -251,10 +261,8 @@ void gl_feedback_points( GLcontext *ctx, GLuint first, GLuint last )
|
||||
/*
|
||||
* NOTE: this function can't be put in a display list.
|
||||
*/
|
||||
void
|
||||
_mesa_SelectBuffer( GLsizei size, GLuint *buffer )
|
||||
void gl_SelectBuffer( GLcontext *ctx, GLsizei size, GLuint *buffer )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glSelectBuffer");
|
||||
if (ctx->RenderMode==GL_SELECT) {
|
||||
gl_error( ctx, GL_INVALID_OPERATION, "glSelectBuffer" );
|
||||
@@ -294,9 +302,9 @@ void gl_select_triangle( GLcontext *ctx,
|
||||
struct vertex_buffer *VB = ctx->VB;
|
||||
|
||||
if (gl_cull_triangle( ctx, v0, v1, v2, 0 )) {
|
||||
gl_update_hitflag( ctx, VB->Win.data[v0][3] / DEPTH_SCALE );
|
||||
gl_update_hitflag( ctx, VB->Win.data[v1][3] / DEPTH_SCALE );
|
||||
gl_update_hitflag( ctx, VB->Win.data[v2][3] / DEPTH_SCALE );
|
||||
gl_update_hitflag( ctx, VB->Win.data[v0][2] / DEPTH_SCALE );
|
||||
gl_update_hitflag( ctx, VB->Win.data[v1][2] / DEPTH_SCALE );
|
||||
gl_update_hitflag( ctx, VB->Win.data[v2][2] / DEPTH_SCALE );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -306,8 +314,8 @@ void gl_select_line( GLcontext *ctx,
|
||||
{
|
||||
struct vertex_buffer *VB = ctx->VB;
|
||||
|
||||
gl_update_hitflag( ctx, VB->Win.data[v0][3] / DEPTH_SCALE );
|
||||
gl_update_hitflag( ctx, VB->Win.data[v1][3] / DEPTH_SCALE );
|
||||
gl_update_hitflag( ctx, VB->Win.data[v0][2] / DEPTH_SCALE );
|
||||
gl_update_hitflag( ctx, VB->Win.data[v1][2] / DEPTH_SCALE );
|
||||
}
|
||||
|
||||
void gl_select_points( GLcontext *ctx, GLuint first, GLuint last )
|
||||
@@ -317,7 +325,7 @@ void gl_select_points( GLcontext *ctx, GLuint first, GLuint last )
|
||||
|
||||
for (i=first;i<=last;i++)
|
||||
if (VB->ClipMask[i]==0)
|
||||
gl_update_hitflag( ctx, VB->Win.data[i][3] / DEPTH_SCALE);
|
||||
gl_update_hitflag( ctx, VB->Win.data[i][2] / DEPTH_SCALE);
|
||||
}
|
||||
|
||||
|
||||
@@ -348,10 +356,8 @@ static void write_hit_record( GLcontext *ctx )
|
||||
|
||||
|
||||
|
||||
void
|
||||
_mesa_InitNames( void )
|
||||
void gl_InitNames( GLcontext *ctx )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glInitNames");
|
||||
/* Record the hit before the HitFlag is wiped out again. */
|
||||
if (ctx->RenderMode==GL_SELECT) {
|
||||
@@ -367,10 +373,8 @@ _mesa_InitNames( void )
|
||||
|
||||
|
||||
|
||||
void
|
||||
_mesa_LoadName( GLuint name )
|
||||
void gl_LoadName( GLcontext *ctx, GLuint name )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glLoadName");
|
||||
if (ctx->RenderMode!=GL_SELECT) {
|
||||
return;
|
||||
@@ -391,10 +395,8 @@ _mesa_LoadName( GLuint name )
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_mesa_PushName( GLuint name )
|
||||
void gl_PushName( GLcontext *ctx, GLuint name )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPushName");
|
||||
if (ctx->RenderMode!=GL_SELECT) {
|
||||
return;
|
||||
@@ -412,10 +414,8 @@ _mesa_PushName( GLuint name )
|
||||
|
||||
|
||||
|
||||
void
|
||||
_mesa_PopName( void )
|
||||
void gl_PopName( GLcontext *ctx )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPopName");
|
||||
if (ctx->RenderMode!=GL_SELECT) {
|
||||
return;
|
||||
@@ -442,10 +442,8 @@ _mesa_PopName( void )
|
||||
/*
|
||||
* NOTE: this function can't be put in a display list.
|
||||
*/
|
||||
GLint
|
||||
_mesa_RenderMode( GLenum mode )
|
||||
GLint gl_RenderMode( GLcontext *ctx, GLenum mode )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLint result;
|
||||
|
||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, "glRenderMode", 0);
|
||||
@@ -514,7 +512,6 @@ _mesa_RenderMode( GLenum mode )
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
ctx->RenderMode = mode;
|
||||
ctx->NewState |= NEW_ALL;
|
||||
|
||||
|
@@ -1,10 +1,10 @@
|
||||
/* $Id: fog.c,v 1.3.2.1 1999/11/25 16:51:24 keithw Exp $ */
|
||||
/* $Id: fog.c,v 1.3.2.2 2000/02/11 23:37:01 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.1
|
||||
* Version: 3.2
|
||||
*
|
||||
* Copyright (C) 1999 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -25,8 +25,6 @@
|
||||
*/
|
||||
|
||||
|
||||
/* $XFree86: xc/lib/GL/mesa/src/fog.c,v 1.4 1999/04/04 00:20:24 dawes Exp $ */
|
||||
|
||||
#ifdef PC_HEADER
|
||||
#include "all.h"
|
||||
#else
|
||||
@@ -42,6 +40,9 @@
|
||||
#include "mmath.h"
|
||||
#include "types.h"
|
||||
#include "xform.h"
|
||||
#ifdef __alpha__
|
||||
#include <float.h> /*Should be present on all systems but we'll play it safe*/
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
@@ -1,10 +1,10 @@
|
||||
/* $Id: get.c,v 1.5.2.1 1999/12/13 21:58:42 brianp Exp $ */
|
||||
/* $Id: get.c,v 1.5.2.7 2000/03/23 00:14:02 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.1
|
||||
* Version: 3.2
|
||||
*
|
||||
* Copyright (C) 1999 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -393,6 +393,7 @@ void gl_GetBooleanv( GLcontext *ctx, GLenum pname, GLboolean *params )
|
||||
*params = FLOAT_TO_BOOL(LINE_WIDTH_GRANULARITY);
|
||||
break;
|
||||
case GL_LINE_WIDTH_RANGE:
|
||||
case GL_ALIASED_LINE_WIDTH_RANGE:
|
||||
params[0] = FLOAT_TO_BOOL(MIN_LINE_WIDTH);
|
||||
params[1] = FLOAT_TO_BOOL(MAX_LINE_WIDTH);
|
||||
break;
|
||||
@@ -614,14 +615,15 @@ void gl_GetBooleanv( GLcontext *ctx, GLenum pname, GLboolean *params )
|
||||
*params = INT_TO_BOOL(ctx->Pixel.MapStoSsize);
|
||||
break;
|
||||
case GL_POINT_SIZE:
|
||||
*params = FLOAT_TO_BOOL(ctx->Point.Size );
|
||||
*params = FLOAT_TO_BOOL(ctx->Point.Size);
|
||||
break;
|
||||
case GL_POINT_SIZE_GRANULARITY:
|
||||
*params = FLOAT_TO_BOOL(POINT_SIZE_GRANULARITY );
|
||||
*params = FLOAT_TO_BOOL(POINT_SIZE_GRANULARITY);
|
||||
break;
|
||||
case GL_POINT_SIZE_RANGE:
|
||||
params[0] = FLOAT_TO_BOOL(MIN_POINT_SIZE );
|
||||
params[1] = FLOAT_TO_BOOL(MAX_POINT_SIZE );
|
||||
case GL_ALIASED_POINT_SIZE_RANGE:
|
||||
params[0] = FLOAT_TO_BOOL(MIN_POINT_SIZE);
|
||||
params[1] = FLOAT_TO_BOOL(MAX_POINT_SIZE);
|
||||
break;
|
||||
case GL_POINT_SMOOTH:
|
||||
*params = ctx->Point.SmoothFlag;
|
||||
@@ -969,8 +971,16 @@ void gl_GetBooleanv( GLcontext *ctx, GLenum pname, GLboolean *params )
|
||||
case GL_NATIVE_GRAPHICS_HANDLE_PGI:
|
||||
*params = 0;
|
||||
break;
|
||||
|
||||
/* GL_EXT_compiled_vertex_array */
|
||||
case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT:
|
||||
*params = ctx->Array.LockFirst ? GL_TRUE : GL_FALSE;
|
||||
break;
|
||||
case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT:
|
||||
*params = ctx->Array.LockCount ? GL_TRUE : GL_FALSE;
|
||||
break;
|
||||
|
||||
default:
|
||||
printf("invalid enum: %x\n", pname);
|
||||
gl_error( ctx, GL_INVALID_ENUM, "glGetBooleanv" );
|
||||
}
|
||||
}
|
||||
@@ -1305,6 +1315,7 @@ void gl_GetDoublev( GLcontext *ctx, GLenum pname, GLdouble *params )
|
||||
*params = (GLdouble) LINE_WIDTH_GRANULARITY;
|
||||
break;
|
||||
case GL_LINE_WIDTH_RANGE:
|
||||
case GL_ALIASED_LINE_WIDTH_RANGE:
|
||||
params[0] = (GLdouble) MIN_LINE_WIDTH;
|
||||
params[1] = (GLdouble) MAX_LINE_WIDTH;
|
||||
break;
|
||||
@@ -1532,6 +1543,7 @@ void gl_GetDoublev( GLcontext *ctx, GLenum pname, GLdouble *params )
|
||||
*params = (GLdouble) POINT_SIZE_GRANULARITY;
|
||||
break;
|
||||
case GL_POINT_SIZE_RANGE:
|
||||
case GL_ALIASED_POINT_SIZE_RANGE:
|
||||
params[0] = (GLdouble) MIN_POINT_SIZE;
|
||||
params[1] = (GLdouble) MAX_POINT_SIZE;
|
||||
break;
|
||||
@@ -1882,10 +1894,15 @@ void gl_GetDoublev( GLcontext *ctx, GLenum pname, GLdouble *params )
|
||||
*params = 0;
|
||||
break;
|
||||
|
||||
|
||||
/* GL_EXT_compiled_vertex_array */
|
||||
case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT:
|
||||
*params = (GLdouble) ctx->Array.LockFirst;
|
||||
break;
|
||||
case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT:
|
||||
*params = (GLdouble) ctx->Array.LockCount;
|
||||
break;
|
||||
|
||||
default:
|
||||
printf("invalid enum: %x\n", pname);
|
||||
gl_error( ctx, GL_INVALID_ENUM, "glGetDoublev" );
|
||||
}
|
||||
}
|
||||
@@ -2217,6 +2234,7 @@ void gl_GetFloatv( GLcontext *ctx, GLenum pname, GLfloat *params )
|
||||
*params = (GLfloat) LINE_WIDTH_GRANULARITY;
|
||||
break;
|
||||
case GL_LINE_WIDTH_RANGE:
|
||||
case GL_ALIASED_LINE_WIDTH_RANGE:
|
||||
params[0] = (GLfloat) MIN_LINE_WIDTH;
|
||||
params[1] = (GLfloat) MAX_LINE_WIDTH;
|
||||
break;
|
||||
@@ -2444,6 +2462,7 @@ void gl_GetFloatv( GLcontext *ctx, GLenum pname, GLfloat *params )
|
||||
*params = (GLfloat) POINT_SIZE_GRANULARITY;
|
||||
break;
|
||||
case GL_POINT_SIZE_RANGE:
|
||||
case GL_ALIASED_POINT_SIZE_RANGE:
|
||||
params[0] = (GLfloat) MIN_POINT_SIZE;
|
||||
params[1] = (GLfloat) MAX_POINT_SIZE;
|
||||
break;
|
||||
@@ -2793,8 +2812,15 @@ void gl_GetFloatv( GLcontext *ctx, GLenum pname, GLfloat *params )
|
||||
*params = 0;
|
||||
break;
|
||||
|
||||
/* GL_EXT_compiled_vertex_array */
|
||||
case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT:
|
||||
*params = (GLfloat) ctx->Array.LockFirst;
|
||||
break;
|
||||
case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT:
|
||||
*params = (GLfloat) ctx->Array.LockCount;
|
||||
break;
|
||||
|
||||
default:
|
||||
printf("invalid enum: %x\n", pname);
|
||||
gl_error( ctx, GL_INVALID_ENUM, "glGetFloatv" );
|
||||
}
|
||||
}
|
||||
@@ -3130,6 +3156,7 @@ void gl_GetIntegerv( GLcontext *ctx, GLenum pname, GLint *params )
|
||||
*params = (GLint) LINE_WIDTH_GRANULARITY;
|
||||
break;
|
||||
case GL_LINE_WIDTH_RANGE:
|
||||
case GL_ALIASED_LINE_WIDTH_RANGE:
|
||||
params[0] = (GLint) MIN_LINE_WIDTH;
|
||||
params[1] = (GLint) MAX_LINE_WIDTH;
|
||||
break;
|
||||
@@ -3357,6 +3384,7 @@ void gl_GetIntegerv( GLcontext *ctx, GLenum pname, GLint *params )
|
||||
*params = (GLint) POINT_SIZE_GRANULARITY;
|
||||
break;
|
||||
case GL_POINT_SIZE_RANGE:
|
||||
case GL_ALIASED_POINT_SIZE_RANGE:
|
||||
params[0] = (GLint) MIN_POINT_SIZE;
|
||||
params[1] = (GLint) MAX_POINT_SIZE;
|
||||
break;
|
||||
@@ -3707,18 +3735,15 @@ void gl_GetIntegerv( GLcontext *ctx, GLenum pname, GLint *params )
|
||||
*params = 0;
|
||||
break;
|
||||
|
||||
/* GL_EXT_compiled_vertex_array
|
||||
*/
|
||||
case GL_ARRAY_ELEMENT_LOCK_FIRST_SGI:
|
||||
/* GL_EXT_compiled_vertex_array */
|
||||
case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT:
|
||||
*params = ctx->Array.LockFirst;
|
||||
break;
|
||||
|
||||
case GL_ARRAY_ELEMENT_LOCK_COUNT_SGI:
|
||||
case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT:
|
||||
*params = ctx->Array.LockCount;
|
||||
break;
|
||||
|
||||
default:
|
||||
printf("invalid enum: %x\n", pname);
|
||||
gl_error( ctx, GL_INVALID_ENUM, "glGetIntegerv" );
|
||||
}
|
||||
}
|
||||
@@ -3770,7 +3795,7 @@ const GLubyte *gl_GetString( GLcontext *ctx, GLenum name )
|
||||
{
|
||||
static char result[1000];
|
||||
static char *vendor = "Brian Paul";
|
||||
static char *version = "1.2 Mesa 3.1";
|
||||
static char *version = "1.2 Mesa 3.2 beta 1";
|
||||
|
||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, "glGetString", 0);
|
||||
|
||||
|
@@ -1,10 +1,10 @@
|
||||
/* $Id: hash.c,v 1.4 1999/11/11 01:22:26 brianp Exp $ */
|
||||
/* $Id: hash.c,v 1.3.2.2 2000/01/24 16:20:17 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.3
|
||||
* Version: 3.2
|
||||
*
|
||||
* Copyright (C) 1999 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -25,17 +25,24 @@
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#ifdef PC_HEADER
|
||||
#include "all.h"
|
||||
#else
|
||||
#include "glheader.h"
|
||||
#ifndef XFree86Server
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#else
|
||||
#include "GL/xf86glx.h"
|
||||
#endif
|
||||
#include "hash.h"
|
||||
#include "mem.h"
|
||||
#include "macros.h"
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Generic hash table.
|
||||
* Generic hash table. Only dependency is the GLuint datatype.
|
||||
*
|
||||
* This is used to implement display list and texture object lookup.
|
||||
* NOTE: key=0 is illegal.
|
||||
@@ -50,7 +57,7 @@ struct HashEntry {
|
||||
struct HashEntry *Next;
|
||||
};
|
||||
|
||||
struct HashTable {
|
||||
struct _mesa_HashTable {
|
||||
struct HashEntry *Table[TABLE_SIZE];
|
||||
GLuint MaxKey;
|
||||
};
|
||||
@@ -60,9 +67,9 @@ struct HashTable {
|
||||
/*
|
||||
* Return pointer to a new, empty hash table.
|
||||
*/
|
||||
struct HashTable *NewHashTable(void)
|
||||
struct _mesa_HashTable *_mesa_NewHashTable(void)
|
||||
{
|
||||
return CALLOC_STRUCT(HashTable);
|
||||
return CALLOC_STRUCT(_mesa_HashTable);
|
||||
}
|
||||
|
||||
|
||||
@@ -70,7 +77,7 @@ struct HashTable *NewHashTable(void)
|
||||
/*
|
||||
* Delete a hash table.
|
||||
*/
|
||||
void DeleteHashTable(struct HashTable *table)
|
||||
void _mesa_DeleteHashTable(struct _mesa_HashTable *table)
|
||||
{
|
||||
GLuint i;
|
||||
assert(table);
|
||||
@@ -93,7 +100,7 @@ void DeleteHashTable(struct HashTable *table)
|
||||
* key - the key
|
||||
* Return: user data pointer or NULL if key not in table
|
||||
*/
|
||||
void *HashLookup(const struct HashTable *table, GLuint key)
|
||||
void *_mesa_HashLookup(const struct _mesa_HashTable *table, GLuint key)
|
||||
{
|
||||
GLuint pos;
|
||||
const struct HashEntry *entry;
|
||||
@@ -121,7 +128,7 @@ void *HashLookup(const struct HashTable *table, GLuint key)
|
||||
* key - the key (not zero)
|
||||
* data - pointer to user data
|
||||
*/
|
||||
void HashInsert(struct HashTable *table, GLuint key, void *data)
|
||||
void _mesa_HashInsert(struct _mesa_HashTable *table, GLuint key, void *data)
|
||||
{
|
||||
/* search for existing entry with this key */
|
||||
GLuint pos;
|
||||
@@ -159,7 +166,7 @@ void HashInsert(struct HashTable *table, GLuint key, void *data)
|
||||
* Input: table - the hash table
|
||||
* key - key of entry to remove
|
||||
*/
|
||||
void HashRemove(struct HashTable *table, GLuint key)
|
||||
void _mesa_HashRemove(struct _mesa_HashTable *table, GLuint key)
|
||||
{
|
||||
GLuint pos;
|
||||
struct HashEntry *entry, *prev;
|
||||
@@ -194,7 +201,7 @@ void HashRemove(struct HashTable *table, GLuint key)
|
||||
* By calling this function until zero is returned we can get
|
||||
* the keys of all entries in the table.
|
||||
*/
|
||||
GLuint HashFirstEntry(const struct HashTable *table)
|
||||
GLuint _mesa_HashFirstEntry(const struct _mesa_HashTable *table)
|
||||
{
|
||||
GLuint pos;
|
||||
assert(table);
|
||||
@@ -210,7 +217,7 @@ GLuint HashFirstEntry(const struct HashTable *table)
|
||||
/*
|
||||
* Dump contents of hash table for debugging.
|
||||
*/
|
||||
void HashPrint(const struct HashTable *table)
|
||||
void _mesa_HashPrint(const struct _mesa_HashTable *table)
|
||||
{
|
||||
GLuint i;
|
||||
assert(table);
|
||||
@@ -229,9 +236,10 @@ void HashPrint(const struct HashTable *table)
|
||||
* Find a block of 'numKeys' adjacent unused hash keys.
|
||||
* Input: table - the hash table
|
||||
* numKeys - number of keys needed
|
||||
* Return: startint key of free block or 0 if failure
|
||||
* Return: starting key of free block or 0 if failure
|
||||
*/
|
||||
GLuint HashFindFreeKeyBlock(const struct HashTable *table, GLuint numKeys)
|
||||
GLuint _mesa_HashFindFreeKeyBlock(const struct _mesa_HashTable *table,
|
||||
GLuint numKeys)
|
||||
{
|
||||
GLuint maxKey = ~((GLuint) 0);
|
||||
if (maxKey - numKeys > table->MaxKey) {
|
||||
@@ -241,10 +249,10 @@ GLuint HashFindFreeKeyBlock(const struct HashTable *table, GLuint numKeys)
|
||||
else {
|
||||
/* the slow solution */
|
||||
GLuint freeCount = 0;
|
||||
GLuint freeStart = 0;
|
||||
GLuint freeStart = 1;
|
||||
GLuint key;
|
||||
for (key=0; key!=maxKey; key++) {
|
||||
if (HashLookup(table, key)) {
|
||||
for (key=1; key!=maxKey; key++) {
|
||||
if (_mesa_HashLookup(table, key)) {
|
||||
/* darn, this key is already in use */
|
||||
freeCount = 0;
|
||||
freeStart = key+1;
|
||||
@@ -268,20 +276,20 @@ GLuint HashFindFreeKeyBlock(const struct HashTable *table, GLuint numKeys)
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int a, b, c;
|
||||
struct HashTable *t;
|
||||
struct _mesa_HashTable *t;
|
||||
|
||||
printf("&a = %p\n", &a);
|
||||
printf("&b = %p\n", &b);
|
||||
|
||||
t = NewHashTable();
|
||||
HashInsert(t, 501, &a);
|
||||
HashInsert(t, 10, &c);
|
||||
HashInsert(t, 0xfffffff8, &b);
|
||||
HashPrint(t);
|
||||
printf("Find 501: %p\n", HashLookup(t,501));
|
||||
printf("Find 1313: %p\n", HashLookup(t,1313));
|
||||
printf("Find block of 100: %d\n", HashFindFreeKeyBlock(t, 100));
|
||||
DeleteHashTable(t);
|
||||
t = _mesa_NewHashTable();
|
||||
_mesa_HashInsert(t, 501, &a);
|
||||
_mesa_HashInsert(t, 10, &c);
|
||||
_mesa_HashInsert(t, 0xfffffff8, &b);
|
||||
_mesa_HashPrint(t);
|
||||
printf("Find 501: %p\n", _mesa_HashLookup(t,501));
|
||||
printf("Find 1313: %p\n", _mesa_HashLookup(t,1313));
|
||||
printf("Find block of 100: %d\n", _mesa_HashFindFreeKeyBlock(t, 100));
|
||||
_mesa_DeleteHashTable(t);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -1,10 +1,10 @@
|
||||
/* $Id: hash.h,v 1.2 1999/11/11 01:22:26 brianp Exp $ */
|
||||
/* $Id: hash.h,v 1.1.1.1.2.1 2000/01/24 16:20:17 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.3
|
||||
* Version: 3.2
|
||||
*
|
||||
* Copyright (C) 1999 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -29,28 +29,28 @@
|
||||
#define HASH_H
|
||||
|
||||
|
||||
#include "glheader.h"
|
||||
#include "GL/gl.h"
|
||||
|
||||
|
||||
struct HashTable;
|
||||
struct _mesa_HashTable;
|
||||
|
||||
|
||||
|
||||
extern struct HashTable *NewHashTable(void);
|
||||
extern struct _mesa_HashTable *_mesa_NewHashTable(void);
|
||||
|
||||
extern void DeleteHashTable(struct HashTable *table);
|
||||
extern void _mesa_DeleteHashTable(struct _mesa_HashTable *table);
|
||||
|
||||
extern void *HashLookup(const struct HashTable *table, GLuint key);
|
||||
extern void *_mesa_HashLookup(const struct _mesa_HashTable *table, GLuint key);
|
||||
|
||||
extern void HashInsert(struct HashTable *table, GLuint key, void *data);
|
||||
extern void _mesa_HashInsert(struct _mesa_HashTable *table, GLuint key, void *data);
|
||||
|
||||
extern void HashRemove(struct HashTable *table, GLuint key);
|
||||
extern void _mesa_HashRemove(struct _mesa_HashTable *table, GLuint key);
|
||||
|
||||
extern GLuint HashFirstEntry(const struct HashTable *table);
|
||||
extern GLuint _mesa_HashFirstEntry(const struct _mesa_HashTable *table);
|
||||
|
||||
extern void HashPrint(const struct HashTable *table);
|
||||
extern void _mesa_HashPrint(const struct _mesa_HashTable *table);
|
||||
|
||||
extern GLuint HashFindFreeKeyBlock(const struct HashTable *table, GLuint numKeys);
|
||||
extern GLuint _mesa_HashFindFreeKeyBlock(const struct _mesa_HashTable *table, GLuint numKeys);
|
||||
|
||||
|
||||
#endif
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,8 +1,8 @@
|
||||
/* $Id: matrix.c,v 1.9 1999/11/11 01:22:27 brianp Exp $ */
|
||||
/* $Id: matrix.c,v 1.8.2.1 2000/02/21 22:49:24 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.3
|
||||
* Version: 3.1
|
||||
*
|
||||
* Copyright (C) 1999 Brian Paul All Rights Reserved.
|
||||
*
|
||||
@@ -25,6 +25,9 @@
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Matrix operations
|
||||
*
|
||||
@@ -40,11 +43,18 @@
|
||||
#ifdef PC_HEADER
|
||||
#include "all.h"
|
||||
#else
|
||||
#include "glheader.h"
|
||||
#ifndef XFree86Server
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#else
|
||||
#include "GL/xf86glx.h"
|
||||
#endif
|
||||
#include "context.h"
|
||||
#include "enums.h"
|
||||
#include "macros.h"
|
||||
#include "matrix.h"
|
||||
#include "mem.h"
|
||||
#include "mmath.h"
|
||||
#include "types.h"
|
||||
#endif
|
||||
@@ -892,12 +902,11 @@ do { \
|
||||
} while (0)
|
||||
|
||||
|
||||
void
|
||||
_mesa_Frustum( GLdouble left, GLdouble right,
|
||||
GLdouble bottom, GLdouble top,
|
||||
GLdouble nearval, GLdouble farval )
|
||||
void gl_Frustum( GLcontext *ctx,
|
||||
GLdouble left, GLdouble right,
|
||||
GLdouble bottom, GLdouble top,
|
||||
GLdouble nearval, GLdouble farval )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLfloat x, y, a, b, c, d;
|
||||
GLfloat m[16];
|
||||
GLmatrix *mat = 0;
|
||||
@@ -943,12 +952,11 @@ _mesa_Frustum( GLdouble left, GLdouble right,
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_mesa_Ortho( GLdouble left, GLdouble right,
|
||||
GLdouble bottom, GLdouble top,
|
||||
GLdouble nearval, GLdouble farval )
|
||||
void gl_Ortho( GLcontext *ctx,
|
||||
GLdouble left, GLdouble right,
|
||||
GLdouble bottom, GLdouble top,
|
||||
GLdouble nearval, GLdouble farval )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLfloat x, y, z;
|
||||
GLfloat tx, ty, tz;
|
||||
GLfloat m[16];
|
||||
@@ -983,10 +991,8 @@ _mesa_Ortho( GLdouble left, GLdouble right,
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_mesa_MatrixMode( GLenum mode )
|
||||
void gl_MatrixMode( GLcontext *ctx, GLenum mode )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glMatrixMode");
|
||||
switch (mode) {
|
||||
case GL_MODELVIEW:
|
||||
@@ -1001,10 +1007,8 @@ _mesa_MatrixMode( GLenum mode )
|
||||
|
||||
|
||||
|
||||
void
|
||||
_mesa_PushMatrix( void )
|
||||
void gl_PushMatrix( GLcontext *ctx )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPushMatrix");
|
||||
|
||||
if (MESA_VERBOSE&VERBOSE_API)
|
||||
@@ -1013,7 +1017,7 @@ _mesa_PushMatrix( void )
|
||||
|
||||
switch (ctx->Transform.MatrixMode) {
|
||||
case GL_MODELVIEW:
|
||||
if (ctx->ModelViewStackDepth>=MAX_MODELVIEW_STACK_DEPTH-1) {
|
||||
if (ctx->ModelViewStackDepth >= MAX_MODELVIEW_STACK_DEPTH - 1) {
|
||||
gl_error( ctx, GL_STACK_OVERFLOW, "glPushMatrix");
|
||||
return;
|
||||
}
|
||||
@@ -1021,7 +1025,7 @@ _mesa_PushMatrix( void )
|
||||
&ctx->ModelView );
|
||||
break;
|
||||
case GL_PROJECTION:
|
||||
if (ctx->ProjectionStackDepth>=MAX_PROJECTION_STACK_DEPTH) {
|
||||
if (ctx->ProjectionStackDepth >= MAX_PROJECTION_STACK_DEPTH - 1) {
|
||||
gl_error( ctx, GL_STACK_OVERFLOW, "glPushMatrix");
|
||||
return;
|
||||
}
|
||||
@@ -1037,7 +1041,7 @@ _mesa_PushMatrix( void )
|
||||
case GL_TEXTURE:
|
||||
{
|
||||
GLuint t = ctx->Texture.CurrentTransformUnit;
|
||||
if (ctx->TextureStackDepth[t] >= MAX_TEXTURE_STACK_DEPTH) {
|
||||
if (ctx->TextureStackDepth[t] >= MAX_TEXTURE_STACK_DEPTH - 1) {
|
||||
gl_error( ctx, GL_STACK_OVERFLOW, "glPushMatrix");
|
||||
return;
|
||||
}
|
||||
@@ -1052,10 +1056,8 @@ _mesa_PushMatrix( void )
|
||||
|
||||
|
||||
|
||||
void
|
||||
_mesa_PopMatrix( void )
|
||||
void gl_PopMatrix( GLcontext *ctx )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPopMatrix");
|
||||
|
||||
if (MESA_VERBOSE&VERBOSE_API)
|
||||
@@ -1109,10 +1111,8 @@ _mesa_PopMatrix( void )
|
||||
|
||||
|
||||
|
||||
void
|
||||
_mesa_LoadIdentity( void )
|
||||
void gl_LoadIdentity( GLcontext *ctx )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLmatrix *mat = 0;
|
||||
GET_ACTIVE_MATRIX(ctx, mat, ctx->NewState, "glLoadIdentity");
|
||||
|
||||
@@ -1131,10 +1131,8 @@ _mesa_LoadIdentity( void )
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_mesa_LoadMatrixf( const GLfloat *m )
|
||||
void gl_LoadMatrixf( GLcontext *ctx, const GLfloat *m )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLmatrix *mat = 0;
|
||||
GET_ACTIVE_MATRIX(ctx, mat, ctx->NewState, "glLoadMatrix");
|
||||
|
||||
@@ -1164,25 +1162,12 @@ _mesa_LoadMatrixf( const GLfloat *m )
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_mesa_LoadMatrixd( const GLdouble *m )
|
||||
{
|
||||
GLfloat f[16];
|
||||
GLint i;
|
||||
for (i = 0; i < 16; i++)
|
||||
f[i] = m[i];
|
||||
_mesa_LoadMatrixf(f);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Multiply the active matrix by an arbitary matrix.
|
||||
*/
|
||||
void
|
||||
_mesa_MultMatrixf( const GLfloat *m )
|
||||
void gl_MultMatrixf( GLcontext *ctx, const GLfloat *m )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLmatrix *mat = 0;
|
||||
GET_ACTIVE_MATRIX( ctx, mat, ctx->NewState, "glMultMatrix" );
|
||||
matmul4( mat->m, mat->m, m );
|
||||
@@ -1193,10 +1178,8 @@ _mesa_MultMatrixf( const GLfloat *m )
|
||||
/*
|
||||
* Multiply the active matrix by an arbitary matrix.
|
||||
*/
|
||||
void
|
||||
_mesa_MultMatrixd( const GLdouble *m )
|
||||
void gl_MultMatrixd( GLcontext *ctx, const GLdouble *m )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLmatrix *mat = 0;
|
||||
GET_ACTIVE_MATRIX( ctx, mat, ctx->NewState, "glMultMatrix" );
|
||||
matmul4fd( mat->m, mat->m, m );
|
||||
@@ -1244,10 +1227,9 @@ void gl_mat_mul_mat( GLmatrix *mat, const GLmatrix *m )
|
||||
/*
|
||||
* Execute a glRotate call
|
||||
*/
|
||||
void
|
||||
_mesa_Rotatef( GLfloat angle, GLfloat x, GLfloat y, GLfloat z )
|
||||
void gl_Rotatef( GLcontext *ctx,
|
||||
GLfloat angle, GLfloat x, GLfloat y, GLfloat z )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLfloat m[16];
|
||||
if (angle != 0.0F) {
|
||||
GLmatrix *mat = 0;
|
||||
@@ -1258,20 +1240,11 @@ _mesa_Rotatef( GLfloat angle, GLfloat x, GLfloat y, GLfloat z )
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
_mesa_Rotated( GLdouble angle, GLdouble x, GLdouble y, GLdouble z )
|
||||
{
|
||||
_mesa_Rotatef(angle, x, y, z);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Execute a glScale call
|
||||
*/
|
||||
void
|
||||
_mesa_Scalef( GLfloat x, GLfloat y, GLfloat z )
|
||||
void gl_Scalef( GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLmatrix *mat = 0;
|
||||
GLfloat *m;
|
||||
GET_ACTIVE_MATRIX(ctx, mat, ctx->NewState, "glScale");
|
||||
@@ -1292,21 +1265,11 @@ _mesa_Scalef( GLfloat x, GLfloat y, GLfloat z )
|
||||
MAT_DIRTY_DEPENDENTS);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_mesa_Scaled( GLdouble x, GLdouble y, GLdouble z )
|
||||
{
|
||||
_mesa_Scalef(x, y, z);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Execute a glTranslate call
|
||||
*/
|
||||
void
|
||||
_mesa_Translatef( GLfloat x, GLfloat y, GLfloat z )
|
||||
void gl_Translatef( GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLmatrix *mat = 0;
|
||||
GLfloat *m;
|
||||
GET_ACTIVE_MATRIX(ctx, mat, ctx->NewState, "glTranslate");
|
||||
@@ -1323,22 +1286,13 @@ _mesa_Translatef( GLfloat x, GLfloat y, GLfloat z )
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_mesa_Translated( GLdouble x, GLdouble y, GLdouble z )
|
||||
{
|
||||
_mesa_Translatef(x, y, z);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Define a new viewport and reallocate auxillary buffers if the size of
|
||||
* the window (color buffer) has changed.
|
||||
*/
|
||||
void
|
||||
_mesa_Viewport( GLint x, GLint y, GLsizei width, GLsizei height )
|
||||
void gl_Viewport( GLcontext *ctx,
|
||||
GLint x, GLint y, GLsizei width, GLsizei height )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glViewport");
|
||||
|
||||
if (width<0 || height<0) {
|
||||
@@ -1376,7 +1330,7 @@ _mesa_Viewport( GLint x, GLint y, GLsizei width, GLsizei height )
|
||||
/* Check if window/buffer has been resized and if so, reallocate the
|
||||
* ancillary buffers.
|
||||
*/
|
||||
_mesa_ResizeBuffersMESA();
|
||||
gl_ResizeBuffersMESA(ctx);
|
||||
|
||||
|
||||
ctx->RasterMask &= ~WINCLIP_BIT;
|
||||
@@ -1396,8 +1350,7 @@ _mesa_Viewport( GLint x, GLint y, GLsizei width, GLsizei height )
|
||||
|
||||
|
||||
|
||||
void
|
||||
_mesa_DepthRange( GLclampd nearval, GLclampd farval )
|
||||
void gl_DepthRange( GLcontext *ctx, GLclampd nearval, GLclampd farval )
|
||||
{
|
||||
/*
|
||||
* nearval - specifies mapping of the near clipping plane to window
|
||||
@@ -1411,7 +1364,7 @@ _mesa_DepthRange( GLclampd nearval, GLclampd farval )
|
||||
* this range to window z coords.
|
||||
*/
|
||||
GLfloat n, f;
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
|
||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glDepthRange");
|
||||
|
||||
if (MESA_VERBOSE&VERBOSE_API)
|
||||
|
@@ -1,8 +1,8 @@
|
||||
/* $Id: rastpos.c,v 1.4 1999/11/11 01:22:27 brianp Exp $ */
|
||||
/* $Id: rastpos.c,v 1.3.2.1 2000/02/21 16:31:55 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.3
|
||||
* Version: 3.1
|
||||
*
|
||||
* Copyright (C) 1999 Brian Paul All Rights Reserved.
|
||||
*
|
||||
@@ -25,10 +25,18 @@
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef PC_HEADER
|
||||
#include "all.h"
|
||||
#else
|
||||
#include "glheader.h"
|
||||
#ifndef XFree86Server
|
||||
#include <assert.h>
|
||||
#include <math.h>
|
||||
#else
|
||||
#include "GL/xf86glx.h"
|
||||
#endif
|
||||
#include "clip.h"
|
||||
#include "context.h"
|
||||
#include "feedback.h"
|
||||
@@ -46,8 +54,8 @@
|
||||
/*
|
||||
* Caller: context->API.RasterPos4f
|
||||
*/
|
||||
static void raster_pos4f( GLcontext *ctx,
|
||||
GLfloat x, GLfloat y, GLfloat z, GLfloat w )
|
||||
void gl_RasterPos4f( GLcontext *ctx,
|
||||
GLfloat x, GLfloat y, GLfloat z, GLfloat w )
|
||||
{
|
||||
GLfloat v[4], eye[4], clip[4], ndc[3], d;
|
||||
|
||||
@@ -153,147 +161,44 @@ static void raster_pos4f( GLcontext *ctx,
|
||||
|
||||
|
||||
|
||||
void
|
||||
_mesa_RasterPos2d(GLdouble x, GLdouble y)
|
||||
/*
|
||||
* This is a MESA extension function. Pretty much just like glRasterPos
|
||||
* except we don't apply the modelview or projection matrices; specify a
|
||||
* window coordinate directly.
|
||||
* Caller: context->API.WindowPos4fMESA pointer.
|
||||
*/
|
||||
void gl_windowpos( GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z, GLfloat w )
|
||||
{
|
||||
_mesa_RasterPos4f(x, y, 0.0F, 1.0F);
|
||||
}
|
||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx, "glWindowPosMESA" );
|
||||
|
||||
void
|
||||
_mesa_RasterPos2f(GLfloat x, GLfloat y)
|
||||
{
|
||||
_mesa_RasterPos4f(x, y, 0.0F, 1.0F);
|
||||
}
|
||||
/* set raster position */
|
||||
ctx->Current.RasterPos[0] = x;
|
||||
ctx->Current.RasterPos[1] = y;
|
||||
ctx->Current.RasterPos[2] = CLAMP( z, 0.0F, 1.0F );
|
||||
ctx->Current.RasterPos[3] = w;
|
||||
|
||||
void
|
||||
_mesa_RasterPos2i(GLint x, GLint y)
|
||||
{
|
||||
_mesa_RasterPos4f(x, y, 0.0F, 1.0F);
|
||||
}
|
||||
ctx->Current.RasterPosValid = GL_TRUE;
|
||||
ctx->Current.RasterDistance = 0.0F;
|
||||
|
||||
void
|
||||
_mesa_RasterPos2s(GLshort x, GLshort y)
|
||||
{
|
||||
_mesa_RasterPos4f(x, y, 0.0F, 1.0F);
|
||||
}
|
||||
/* raster color = current color or index */
|
||||
if (ctx->Visual->RGBAflag) {
|
||||
UBYTE_RGBA_TO_FLOAT_RGBA(ctx->Current.RasterColor,
|
||||
ctx->Current.ByteColor);
|
||||
}
|
||||
else {
|
||||
ctx->Current.RasterIndex = ctx->Current.Index;
|
||||
}
|
||||
|
||||
void
|
||||
_mesa_RasterPos3d(GLdouble x, GLdouble y, GLdouble z)
|
||||
{
|
||||
_mesa_RasterPos4f(x, y, z, 1.0F);
|
||||
}
|
||||
/* raster texcoord = current texcoord */
|
||||
{
|
||||
GLuint texSet;
|
||||
for (texSet=0; texSet<MAX_TEXTURE_UNITS; texSet++) {
|
||||
COPY_4FV( ctx->Current.RasterMultiTexCoord[texSet],
|
||||
ctx->Current.Texcoord[texSet] );
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
_mesa_RasterPos3f(GLfloat x, GLfloat y, GLfloat z)
|
||||
{
|
||||
_mesa_RasterPos4f(x, y, z, 1.0F);
|
||||
}
|
||||
|
||||
void
|
||||
_mesa_RasterPos3i(GLint x, GLint y, GLint z)
|
||||
{
|
||||
_mesa_RasterPos4f(x, y, z, 1.0F);
|
||||
}
|
||||
|
||||
void
|
||||
_mesa_RasterPos3s(GLshort x, GLshort y, GLshort z)
|
||||
{
|
||||
_mesa_RasterPos4f(x, y, z, 1.0F);
|
||||
}
|
||||
|
||||
void
|
||||
_mesa_RasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
|
||||
{
|
||||
_mesa_RasterPos4f(x, y, z, w);
|
||||
}
|
||||
|
||||
void
|
||||
_mesa_RasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
raster_pos4f(ctx, x, y, z, w);
|
||||
}
|
||||
|
||||
void
|
||||
_mesa_RasterPos4i(GLint x, GLint y, GLint z, GLint w)
|
||||
{
|
||||
_mesa_RasterPos4f(x, y, z, w);
|
||||
}
|
||||
|
||||
void
|
||||
_mesa_RasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w)
|
||||
{
|
||||
_mesa_RasterPos4f(x, y, z, w);
|
||||
}
|
||||
|
||||
void
|
||||
_mesa_RasterPos2dv(const GLdouble *v)
|
||||
{
|
||||
_mesa_RasterPos4f(v[0], v[1], 0.0F, 1.0F);
|
||||
}
|
||||
|
||||
void
|
||||
_mesa_RasterPos2fv(const GLfloat *v)
|
||||
{
|
||||
_mesa_RasterPos4f(v[0], v[1], 0.0F, 1.0F);
|
||||
}
|
||||
|
||||
void
|
||||
_mesa_RasterPos2iv(const GLint *v)
|
||||
{
|
||||
_mesa_RasterPos4f(v[0], v[1], 0.0F, 1.0F);
|
||||
}
|
||||
|
||||
void
|
||||
_mesa_RasterPos2sv(const GLshort *v)
|
||||
{
|
||||
_mesa_RasterPos4f(v[0], v[1], 0.0F, 1.0F);
|
||||
}
|
||||
|
||||
void
|
||||
_mesa_RasterPos3dv(const GLdouble *v)
|
||||
{
|
||||
_mesa_RasterPos4f(v[0], v[1], v[2], 1.0F);
|
||||
}
|
||||
|
||||
void
|
||||
_mesa_RasterPos3fv(const GLfloat *v)
|
||||
{
|
||||
_mesa_RasterPos4f(v[0], v[1], v[2], 1.0F);
|
||||
}
|
||||
|
||||
void
|
||||
_mesa_RasterPos3iv(const GLint *v)
|
||||
{
|
||||
_mesa_RasterPos4f(v[0], v[1], v[2], 1.0F);
|
||||
}
|
||||
|
||||
void
|
||||
_mesa_RasterPos3sv(const GLshort *v)
|
||||
{
|
||||
_mesa_RasterPos4f(v[0], v[1], v[2], 1.0F);
|
||||
}
|
||||
|
||||
void
|
||||
_mesa_RasterPos4dv(const GLdouble *v)
|
||||
{
|
||||
_mesa_RasterPos4f(v[0], v[1], v[2], v[3]);
|
||||
}
|
||||
|
||||
void
|
||||
_mesa_RasterPos4fv(const GLfloat *v)
|
||||
{
|
||||
_mesa_RasterPos4f(v[0], v[1], v[2], v[3]);
|
||||
}
|
||||
|
||||
void
|
||||
_mesa_RasterPos4iv(const GLint *v)
|
||||
{
|
||||
_mesa_RasterPos4f(v[0], v[1], v[2], v[3]);
|
||||
}
|
||||
|
||||
void
|
||||
_mesa_RasterPos4sv(const GLshort *v)
|
||||
{
|
||||
_mesa_RasterPos4f(v[0], v[1], v[2], v[3]);
|
||||
if (ctx->RenderMode==GL_SELECT) {
|
||||
gl_update_hitflag( ctx, ctx->Current.RasterPos[2] );
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/* $Id: texobj.c,v 1.7.2.1 1999/12/01 21:07:26 brianp Exp $ */
|
||||
/* $Id: texobj.c,v 1.7.2.4 2000/02/12 01:59:10 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
@@ -99,7 +99,7 @@ gl_alloc_texture_object( struct gl_shared_state *shared, GLuint name,
|
||||
|
||||
if (name > 0) {
|
||||
/* insert into hash table */
|
||||
HashInsert(shared->TexObjects, name, obj);
|
||||
_mesa_HashInsert(shared->TexObjects, name, obj);
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
@@ -146,7 +146,7 @@ void gl_free_texture_object( struct gl_shared_state *shared,
|
||||
|
||||
if (t->Name) {
|
||||
/* remove from hash table */
|
||||
HashRemove(shared->TexObjects, t->Name);
|
||||
_mesa_HashRemove(shared->TexObjects, t->Name);
|
||||
}
|
||||
|
||||
/* free texture image */
|
||||
@@ -345,7 +345,7 @@ void gl_GenTextures( GLcontext *ctx, GLsizei n, GLuint *texName )
|
||||
return;
|
||||
}
|
||||
|
||||
first = HashFindFreeKeyBlock(ctx->Shared->TexObjects, n);
|
||||
first = _mesa_HashFindFreeKeyBlock(ctx->Shared->TexObjects, n);
|
||||
|
||||
/* Return the texture names */
|
||||
for (i=0;i<n;i++) {
|
||||
@@ -375,28 +375,31 @@ void gl_DeleteTextures( GLcontext *ctx, GLsizei n, const GLuint *texName)
|
||||
struct gl_texture_object *t;
|
||||
if (texName[i]>0) {
|
||||
t = (struct gl_texture_object *)
|
||||
HashLookup(ctx->Shared->TexObjects, texName[i]);
|
||||
_mesa_HashLookup(ctx->Shared->TexObjects, texName[i]);
|
||||
if (t) {
|
||||
/* First check if this texture is currently bound.
|
||||
* If so, unbind it and decrement the reference count.
|
||||
*/
|
||||
GLuint u;
|
||||
for (u=0; u<MAX_TEXTURE_UNITS; u++) {
|
||||
for (u = 0; u < MAX_TEXTURE_UNITS; u++) {
|
||||
struct gl_texture_unit *unit = &ctx->Texture.Unit[u];
|
||||
GLuint d;
|
||||
for (d = 1 ; d <= 3 ; d++) {
|
||||
if (unit->CurrentD[d]==t) {
|
||||
if (unit->CurrentD[d] == t) {
|
||||
unit->CurrentD[d] = ctx->Shared->DefaultD[d];
|
||||
ctx->Shared->DefaultD[d]->RefCount++;
|
||||
t->RefCount--;
|
||||
assert( t->RefCount >= 0 );
|
||||
ASSERT( t->RefCount >= 0 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* tell device driver to delete texture */
|
||||
if (ctx->Driver.DeleteTexture) {
|
||||
(*ctx->Driver.DeleteTexture)( ctx, t );
|
||||
}
|
||||
|
||||
if (t->RefCount==0) {
|
||||
/* Decrement reference count and delete if zero */
|
||||
t->RefCount--;
|
||||
ASSERT( t->RefCount >= 0 );
|
||||
if (t->RefCount == 0) {
|
||||
if (ctx->Driver.DeleteTexture)
|
||||
(*ctx->Driver.DeleteTexture)( ctx, t );
|
||||
gl_free_texture_object(ctx->Shared, t);
|
||||
}
|
||||
}
|
||||
@@ -446,8 +449,8 @@ void gl_BindTexture( GLcontext *ctx, GLenum target, GLuint texName )
|
||||
if (texName == 0)
|
||||
newTexObj = ctx->Shared->DefaultD[dim];
|
||||
else {
|
||||
struct HashTable *hash = ctx->Shared->TexObjects;
|
||||
newTexObj = (struct gl_texture_object *) HashLookup(hash, texName);
|
||||
struct _mesa_HashTable *hash = ctx->Shared->TexObjects;
|
||||
newTexObj = (struct gl_texture_object *) _mesa_HashLookup(hash, texName);
|
||||
|
||||
if (!newTexObj)
|
||||
newTexObj = gl_alloc_texture_object(ctx->Shared, texName, dim);
|
||||
@@ -525,7 +528,7 @@ void gl_PrioritizeTextures( GLcontext *ctx,
|
||||
struct gl_texture_object *t;
|
||||
if (texName[i]>0) {
|
||||
t = (struct gl_texture_object *)
|
||||
HashLookup(ctx->Shared->TexObjects, texName[i]);
|
||||
_mesa_HashLookup(ctx->Shared->TexObjects, texName[i]);
|
||||
if (t) {
|
||||
t->Priority = CLAMP( priorities[i], 0.0F, 1.0F );
|
||||
|
||||
@@ -563,7 +566,7 @@ GLboolean gl_AreTexturesResident( GLcontext *ctx, GLsizei n,
|
||||
return GL_FALSE;
|
||||
}
|
||||
t = (struct gl_texture_object *)
|
||||
HashLookup(ctx->Shared->TexObjects, texName[i]);
|
||||
_mesa_HashLookup(ctx->Shared->TexObjects, texName[i]);
|
||||
if (t) {
|
||||
if (ctx->Driver.IsTextureResident)
|
||||
residences[i] = ctx->Driver.IsTextureResident( ctx, t );
|
||||
@@ -587,7 +590,7 @@ GLboolean gl_IsTexture( GLcontext *ctx, GLuint texture )
|
||||
{
|
||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, "glIsTextures",
|
||||
GL_FALSE);
|
||||
if (texture>0 && HashLookup(ctx->Shared->TexObjects, texture)) {
|
||||
if (texture>0 && _mesa_HashLookup(ctx->Shared->TexObjects, texture)) {
|
||||
return GL_TRUE;
|
||||
}
|
||||
else {
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/* $Id: texstate.c,v 1.4.2.2 1999/11/22 13:54:02 brianp Exp $ */
|
||||
/* $Id: texstate.c,v 1.4.2.4 2000/02/08 01:48:07 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
@@ -90,6 +90,16 @@ void gl_TexEnvfv( GLcontext *ctx,
|
||||
if (pname==GL_TEXTURE_ENV_MODE) {
|
||||
GLenum mode = (GLenum) (GLint) *param;
|
||||
switch (mode) {
|
||||
case GL_ADD:
|
||||
if (!ctx->Texture.ExtAddEnv) {
|
||||
if (gl_extension_is_enabled(ctx, "GL_EXT_texture_env_add"))
|
||||
ctx->Texture.ExtAddEnv = 1;
|
||||
else {
|
||||
gl_error( ctx, GL_INVALID_VALUE, "glTexEnv(param)" );
|
||||
return;
|
||||
}
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
case GL_MODULATE:
|
||||
case GL_BLEND:
|
||||
case GL_DECAL:
|
||||
@@ -135,6 +145,8 @@ void gl_GetTexEnvfv( GLcontext *ctx,
|
||||
GLenum target, GLenum pname, GLfloat *params )
|
||||
{
|
||||
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
|
||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glGetTexEnvfv");
|
||||
|
||||
if (target!=GL_TEXTURE_ENV) {
|
||||
gl_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(target)" );
|
||||
return;
|
||||
@@ -156,6 +168,8 @@ void gl_GetTexEnviv( GLcontext *ctx,
|
||||
GLenum target, GLenum pname, GLint *params )
|
||||
{
|
||||
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
|
||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glGetTexEnviv");
|
||||
|
||||
if (target!=GL_TEXTURE_ENV) {
|
||||
gl_error( ctx, GL_INVALID_ENUM, "glGetTexEnviv(target)" );
|
||||
return;
|
||||
@@ -190,6 +204,8 @@ void gl_TexParameterfv( GLcontext *ctx,
|
||||
GLenum eparam = (GLenum) (GLint) params[0];
|
||||
struct gl_texture_object *texObj;
|
||||
|
||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glTexParameterfv");
|
||||
|
||||
if (MESA_VERBOSE&(VERBOSE_API|VERBOSE_TEXTURE))
|
||||
fprintf(stderr, "texPARAM %s %s %d...\n",
|
||||
gl_lookup_enum_by_nr(target),
|
||||
@@ -348,6 +364,8 @@ void gl_GetTexLevelParameteriv( GLcontext *ctx, GLenum target, GLint level,
|
||||
const struct gl_texture_image *img = NULL;
|
||||
GLuint dimensions;
|
||||
|
||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glGetTexLevelParameterfv");
|
||||
|
||||
if (level < 0 || level >= ctx->Const.MaxTextureLevels) {
|
||||
gl_error( ctx, GL_INVALID_VALUE, "glGetTexLevelParameter[if]v" );
|
||||
return;
|
||||
@@ -455,6 +473,8 @@ void gl_GetTexParameterfv( GLcontext *ctx,
|
||||
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
|
||||
struct gl_texture_object *obj;
|
||||
|
||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glGetTexParameterfv");
|
||||
|
||||
switch (target) {
|
||||
case GL_TEXTURE_1D:
|
||||
obj = texUnit->CurrentD[1];
|
||||
@@ -522,6 +542,8 @@ void gl_GetTexParameteriv( GLcontext *ctx,
|
||||
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
|
||||
struct gl_texture_object *obj;
|
||||
|
||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glGetTexParameteriv");
|
||||
|
||||
switch (target) {
|
||||
case GL_TEXTURE_1D:
|
||||
obj = texUnit->CurrentD[1];
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/* $Id: varray.c,v 1.13.2.3 1999/12/01 12:18:47 keithw Exp $ */
|
||||
/* $Id: varray.c,v 1.13.2.4 2000/02/05 02:05:21 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
@@ -1128,6 +1128,13 @@ void GLAPIENTRY glDrawRangeElements(CTX_ARG GLenum mode, GLuint start,
|
||||
return;
|
||||
}
|
||||
|
||||
#if 0
|
||||
/*
|
||||
* XXX something in locked arrays is broken! If start = 0,
|
||||
* end = 1 and count = 2 we'll take the LockArrays path and
|
||||
* get incorrect results. See Scott McMillan's bug of 3 Jan 2000.
|
||||
* For now, don't use locked arrays.
|
||||
*/
|
||||
if (!ctx->Array.LockCount && 2*count > (GLint) 3*(end-start)) {
|
||||
glLockArraysEXT(CTX_PRM start, end );
|
||||
glDrawElements(CTX_PRM mode, count, type, indices );
|
||||
@@ -1135,6 +1142,9 @@ void GLAPIENTRY glDrawRangeElements(CTX_ARG GLenum mode, GLuint start,
|
||||
} else {
|
||||
glDrawElements(CTX_PRM mode, count, type, indices );
|
||||
}
|
||||
#else
|
||||
glDrawElements(CTX_PRM mode, count, type, indices );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@@ -190,7 +190,15 @@
|
||||
#define DR6 %db6
|
||||
#define DR7 %db7
|
||||
/* Floating-point Stack */
|
||||
#define ST %st
|
||||
#define _STX0 %st(0)
|
||||
#define _STX1 %st(1)
|
||||
#define _STX2 %st(2)
|
||||
#define _STX3 %st(3)
|
||||
#define _STX4 %st(4)
|
||||
#define _STX5 %st(5)
|
||||
#define _STX6 %st(6)
|
||||
#define _STX7 %st(7)
|
||||
#define ST(x) CONCAT(_STX,x)
|
||||
/* MMX Registers */
|
||||
#define MM0 %mm0
|
||||
#define MM1 %mm1
|
||||
@@ -235,9 +243,10 @@
|
||||
#endif /* ACK_ASSEMBLER */
|
||||
|
||||
|
||||
#if defined(Lynx) || (defined(SYSV) || defined(SVR4)) && !defined(ACK_ASSEMBLER) \
|
||||
#if (defined(Lynx) || (defined(SYSV) || defined(SVR4)) && !defined(ACK_ASSEMBLER) \
|
||||
|| (defined(linux) || defined(__OS2ELF__)) && defined(__ELF__) \
|
||||
|| defined(__FreeBSD__) && __FreeBSD__ >= 3
|
||||
|| defined(__FreeBSD__) && __FreeBSD__ >= 3) \
|
||||
|| (defined(__NetBSD__) && defined(__ELF__))
|
||||
#define GLNAME(a) a
|
||||
#else
|
||||
#define GLNAME(a) CONCAT(_,a)
|
||||
@@ -876,9 +885,17 @@
|
||||
#define D_BYTE db
|
||||
/* #define SPACE */
|
||||
/* #define COMM */
|
||||
#if defined(__WATCOMC__)
|
||||
SECTION _TEXT public align=16 class=CODE use32 flat
|
||||
SECTION _DATA public align=16 class=DATA use32 flat
|
||||
#define SEG_TEXT SECTION _TEXT
|
||||
#define SEG_DATA SECTION _DATA
|
||||
#define SEG_BSS SECTION .bss
|
||||
#else
|
||||
#define SEG_DATA SECTION .data
|
||||
#define SEG_TEXT SECTION .text
|
||||
#define SEG_BSS SECTION .bss
|
||||
#endif
|
||||
|
||||
#define D_SPACE(n) db n REP 0
|
||||
|
||||
@@ -1024,10 +1041,10 @@
|
||||
#define B_REGDB(d, b) BYTE_PTR [b + d]
|
||||
|
||||
/* Variable indirect: */
|
||||
#define VARINDIRECT(var) [var]
|
||||
#define VARINDIRECT(var) var
|
||||
|
||||
/* Use register contents as jump/call target: */
|
||||
#define CODEPTR(reg) [reg]
|
||||
#define CODEPTR(reg) reg
|
||||
|
||||
/*
|
||||
* Redefine assembler commands
|
||||
@@ -1559,6 +1576,7 @@
|
||||
|
||||
#define FEMMS femms
|
||||
#define PREFETCH(a) prefetch P_ARG1(a)
|
||||
#define PREFETCHW(a) prefetchw P_ARG1(a)
|
||||
|
||||
/* Intel SSE */
|
||||
#define ADDPS(a, b) addps P_ARG2(a, b)
|
||||
|
@@ -1,9 +1,10 @@
|
||||
/* $Id: common_x86.c,v 1.4.2.2 2000/01/25 17:03:05 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.1
|
||||
* Version: 3.2
|
||||
*
|
||||
* Copyright (C) 1999 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
|
Reference in New Issue
Block a user