Compare commits
	
		
			254 Commits
		
	
	
		
			mesa_6_5
			...
			texman_0_1
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					bcc4804410 | ||
| 
						 | 
					a03b239041 | ||
| 
						 | 
					4890c7ed87 | ||
| 
						 | 
					17c33d6f04 | ||
| 
						 | 
					5ab599600e | ||
| 
						 | 
					db4b6fd759 | ||
| 
						 | 
					dbb2f30ad3 | ||
| 
						 | 
					9c84dfe156 | ||
| 
						 | 
					8d86325516 | ||
| 
						 | 
					8ecd83f6cd | ||
| 
						 | 
					cff7e025ed | ||
| 
						 | 
					3de9a9bd1d | ||
| 
						 | 
					e6cae6e6f6 | ||
| 
						 | 
					9cf5945b83 | ||
| 
						 | 
					d6ddc33f07 | ||
| 
						 | 
					ec32d129b7 | ||
| 
						 | 
					cd41c27446 | ||
| 
						 | 
					af6a480117 | ||
| 
						 | 
					14e9700621 | ||
| 
						 | 
					7fb177c367 | ||
| 
						 | 
					d65cda4ce3 | ||
| 
						 | 
					460a375d85 | ||
| 
						 | 
					c3c5652602 | ||
| 
						 | 
					e1998baef8 | ||
| 
						 | 
					3e980901b0 | ||
| 
						 | 
					14fe63a12b | ||
| 
						 | 
					fbd147c0b5 | ||
| 
						 | 
					7b7c54e94c | ||
| 
						 | 
					84dd9c8112 | ||
| 
						 | 
					bba85343e7 | ||
| 
						 | 
					6484b373c3 | ||
| 
						 | 
					245a3c54c7 | ||
| 
						 | 
					1266e633cc | ||
| 
						 | 
					86042f53f2 | ||
| 
						 | 
					068062f997 | ||
| 
						 | 
					c62af8e3b7 | ||
| 
						 | 
					8e5650d7f4 | ||
| 
						 | 
					65f1cf2cbf | ||
| 
						 | 
					f04f5e990a | ||
| 
						 | 
					1854ebe77e | ||
| 
						 | 
					3500f2e3c4 | ||
| 
						 | 
					cfeefc9b81 | ||
| 
						 | 
					3ad6adfb57 | ||
| 
						 | 
					8a126f1166 | ||
| 
						 | 
					6315aabcf2 | ||
| 
						 | 
					a8c2344364 | ||
| 
						 | 
					2929b2569b | ||
| 
						 | 
					f14790d7b0 | ||
| 
						 | 
					8fb2e61801 | ||
| 
						 | 
					b3c94f9d9d | ||
| 
						 | 
					5b889f7f2d | ||
| 
						 | 
					0f531b5b48 | ||
| 
						 | 
					c6482c0d41 | ||
| 
						 | 
					b71748efd1 | ||
| 
						 | 
					1c4b9edc41 | ||
| 
						 | 
					2b464d93d1 | ||
| 
						 | 
					497f80ac34 | ||
| 
						 | 
					2be748769b | ||
| 
						 | 
					45a1083ee7 | ||
| 
						 | 
					3a45baa70d | ||
| 
						 | 
					0bc3a7ac2e | ||
| 
						 | 
					08f0579176 | ||
| 
						 | 
					d689cd0715 | ||
| 
						 | 
					e957f39f67 | ||
| 
						 | 
					416f09d3e6 | ||
| 
						 | 
					40cc5d36fd | ||
| 
						 | 
					62f9613dbc | ||
| 
						 | 
					7f31255eb2 | ||
| 
						 | 
					78382b4bbe | ||
| 
						 | 
					bd8e90857c | ||
| 
						 | 
					b7cc448ff8 | ||
| 
						 | 
					0ea582acbe | ||
| 
						 | 
					05c824db87 | ||
| 
						 | 
					829f6909bd | ||
| 
						 | 
					34f1ebc72f | ||
| 
						 | 
					c6e586ee0c | ||
| 
						 | 
					9180d932c6 | ||
| 
						 | 
					95df1b67a2 | ||
| 
						 | 
					bc400c3f30 | ||
| 
						 | 
					3a3db0e9ec | ||
| 
						 | 
					613e395ab8 | ||
| 
						 | 
					86c5de8b85 | ||
| 
						 | 
					44c8c42ab9 | ||
| 
						 | 
					31a82a663c | ||
| 
						 | 
					dafdf6512e | ||
| 
						 | 
					9caacb015a | ||
| 
						 | 
					2887770534 | ||
| 
						 | 
					fb440c9f82 | ||
| 
						 | 
					576c9c310f | ||
| 
						 | 
					ec1db9db1f | ||
| 
						 | 
					e1f70cf5e2 | ||
| 
						 | 
					a7cdbf5c38 | ||
| 
						 | 
					fe37adfde3 | ||
| 
						 | 
					315396ac6c | ||
| 
						 | 
					a7252f42ae | ||
| 
						 | 
					bffc66109e | ||
| 
						 | 
					0089c7f4ee | ||
| 
						 | 
					54f435340b | ||
| 
						 | 
					66d887d605 | ||
| 
						 | 
					c6dc5cc8ab | ||
| 
						 | 
					e0412bb726 | ||
| 
						 | 
					cc5cbd1bca | ||
| 
						 | 
					93fbfa5781 | ||
| 
						 | 
					30709caad6 | ||
| 
						 | 
					a647198f65 | ||
| 
						 | 
					7ad6ea6ff2 | ||
| 
						 | 
					ceee2c45cd | ||
| 
						 | 
					26dc161fde | ||
| 
						 | 
					b176ef05f2 | ||
| 
						 | 
					6d6e7a08c7 | ||
| 
						 | 
					eb75ec2349 | ||
| 
						 | 
					2a8bd4e329 | ||
| 
						 | 
					c247268499 | ||
| 
						 | 
					b2cb8920c2 | ||
| 
						 | 
					af4d93f256 | ||
| 
						 | 
					c8dd839acb | ||
| 
						 | 
					e43c3c38fb | ||
| 
						 | 
					9194782fdc | ||
| 
						 | 
					ec36d5b537 | ||
| 
						 | 
					6e5da1a860 | ||
| 
						 | 
					21f6e8a2d0 | ||
| 
						 | 
					18772c9e88 | ||
| 
						 | 
					5df4283b53 | ||
| 
						 | 
					6734bab3b2 | ||
| 
						 | 
					0a5fea5f96 | ||
| 
						 | 
					9b2762d7b9 | ||
| 
						 | 
					571bf7a71b | ||
| 
						 | 
					4ab3b9aa76 | ||
| 
						 | 
					88c018ee47 | ||
| 
						 | 
					cead52ef68 | ||
| 
						 | 
					9cf0ed6059 | ||
| 
						 | 
					2c1c8dccf7 | ||
| 
						 | 
					b87f9f6056 | ||
| 
						 | 
					427bf0171d | ||
| 
						 | 
					98c5445c75 | ||
| 
						 | 
					15ffb3bbab | ||
| 
						 | 
					97b570b999 | ||
| 
						 | 
					e8e6374a16 | ||
| 
						 | 
					d9f31f16c0 | ||
| 
						 | 
					1173198f51 | ||
| 
						 | 
					01a56d23e6 | ||
| 
						 | 
					bf050799ac | ||
| 
						 | 
					3697eca493 | ||
| 
						 | 
					de2b3506ea | ||
| 
						 | 
					bfbe2eb6e9 | ||
| 
						 | 
					8bd395f601 | ||
| 
						 | 
					735925d15b | ||
| 
						 | 
					448a3456a9 | ||
| 
						 | 
					e176b11b74 | ||
| 
						 | 
					cdc8771893 | ||
| 
						 | 
					789399d3f4 | ||
| 
						 | 
					dfa8624e83 | ||
| 
						 | 
					36b64bbd4f | ||
| 
						 | 
					651985f813 | ||
| 
						 | 
					9f2b49a7b3 | ||
| 
						 | 
					05c6361b0b | ||
| 
						 | 
					9621817253 | ||
| 
						 | 
					7e2e4a6b1a | ||
| 
						 | 
					656c71ca3f | ||
| 
						 | 
					6ce7055dcc | ||
| 
						 | 
					c848a65b5e | ||
| 
						 | 
					1ff99fcd50 | ||
| 
						 | 
					67342052d2 | ||
| 
						 | 
					ccf52b6784 | ||
| 
						 | 
					78aa58c914 | ||
| 
						 | 
					4291f24abd | ||
| 
						 | 
					f4211722f1 | ||
| 
						 | 
					71380a1325 | ||
| 
						 | 
					33e55c6a7d | ||
| 
						 | 
					cd32164cc6 | ||
| 
						 | 
					7c1348ac8f | ||
| 
						 | 
					2560061cfe | ||
| 
						 | 
					0c047b8847 | ||
| 
						 | 
					c64a08c286 | ||
| 
						 | 
					bb409e88d8 | ||
| 
						 | 
					af69eefcba | ||
| 
						 | 
					d9c071adec | ||
| 
						 | 
					833d19c21d | ||
| 
						 | 
					7245757174 | ||
| 
						 | 
					3d96cb7d48 | ||
| 
						 | 
					f565ab2dd5 | ||
| 
						 | 
					7ad0c51f48 | ||
| 
						 | 
					fea684c533 | ||
| 
						 | 
					4e8845fc0c | ||
| 
						 | 
					ffcc1cdb41 | ||
| 
						 | 
					afc90075ba | ||
| 
						 | 
					79acea2708 | ||
| 
						 | 
					a12063a540 | ||
| 
						 | 
					9826d83439 | ||
| 
						 | 
					84f7ded925 | ||
| 
						 | 
					59dd8ad752 | ||
| 
						 | 
					4afd26982e | ||
| 
						 | 
					17e4a7ea17 | ||
| 
						 | 
					3d67655cce | ||
| 
						 | 
					b5d7c69884 | ||
| 
						 | 
					b6759e2be7 | ||
| 
						 | 
					af853b0da7 | ||
| 
						 | 
					8d349798da | ||
| 
						 | 
					4aea628194 | ||
| 
						 | 
					008ddf628a | ||
| 
						 | 
					716496f263 | ||
| 
						 | 
					b3b325e560 | ||
| 
						 | 
					382ce985ac | ||
| 
						 | 
					54b7eca7a0 | ||
| 
						 | 
					f74e06bf11 | ||
| 
						 | 
					9c02649d18 | ||
| 
						 | 
					2c34704e41 | ||
| 
						 | 
					85d0041ff0 | ||
| 
						 | 
					67ff8b354e | ||
| 
						 | 
					08e7957571 | ||
| 
						 | 
					9c1f7089d8 | ||
| 
						 | 
					5381ac5f11 | ||
| 
						 | 
					a6f78d4eee | ||
| 
						 | 
					ae695e3566 | ||
| 
						 | 
					c82c3335e1 | ||
| 
						 | 
					f8246f504b | ||
| 
						 | 
					499458bcdb | ||
| 
						 | 
					37a53fd6a0 | ||
| 
						 | 
					5ec38fb2ea | ||
| 
						 | 
					11c0215bf8 | ||
| 
						 | 
					6a13b6c346 | ||
| 
						 | 
					a103097ee5 | ||
| 
						 | 
					7efad0d84c | ||
| 
						 | 
					42c88cd072 | ||
| 
						 | 
					2541c54e79 | ||
| 
						 | 
					33529e3d8e | ||
| 
						 | 
					84c1b82081 | ||
| 
						 | 
					a97a1439ae | ||
| 
						 | 
					2fd2910010 | ||
| 
						 | 
					fbbda155e0 | ||
| 
						 | 
					a49c3c0fae | ||
| 
						 | 
					baf5998d59 | ||
| 
						 | 
					4c5acef241 | ||
| 
						 | 
					9839e272cf | ||
| 
						 | 
					b57e79ff14 | ||
| 
						 | 
					43824acb4e | ||
| 
						 | 
					d8f509e749 | ||
| 
						 | 
					eb91c93c2e | ||
| 
						 | 
					79de983b6f | ||
| 
						 | 
					fdb3acf016 | ||
| 
						 | 
					2807d1f58a | ||
| 
						 | 
					93f913926e | ||
| 
						 | 
					33ca04f379 | ||
| 
						 | 
					398cb30c72 | ||
| 
						 | 
					f67bb30314 | ||
| 
						 | 
					4578d7b9f0 | ||
| 
						 | 
					dcdfc154c3 | ||
| 
						 | 
					696ba32779 | ||
| 
						 | 
					dcfe55539f | ||
| 
						 | 
					ff84b1f1b2 | ||
| 
						 | 
					3bca9c47f4 | ||
| 
						 | 
					d4d7fdb43b | ||
| 
						 | 
					d65dab5777 | ||
| 
						 | 
					638ca019ef | 
							
								
								
									
										3
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								Makefile
									
									
									
									
									
								
							@@ -89,7 +89,6 @@ linux-dri \
 | 
			
		||||
linux-dri-x86 \
 | 
			
		||||
linux-dri-x86-64 \
 | 
			
		||||
linux-dri-ppc \
 | 
			
		||||
linux-dri-xcb \
 | 
			
		||||
linux-indirect \
 | 
			
		||||
linux-fbdev \
 | 
			
		||||
linux-glide \
 | 
			
		||||
@@ -114,6 +113,7 @@ linux-x86-32 \
 | 
			
		||||
linux-x86-64 \
 | 
			
		||||
linux-x86-64-debug \
 | 
			
		||||
linux-x86-64-static \
 | 
			
		||||
linux-x86-xcb \
 | 
			
		||||
linux-x86-glide \
 | 
			
		||||
linux-x86-static \
 | 
			
		||||
netbsd \
 | 
			
		||||
@@ -166,7 +166,6 @@ MAIN_FILES = \
 | 
			
		||||
	$(DIRECTORY)/include/GL/glx.h					\
 | 
			
		||||
	$(DIRECTORY)/include/GL/glxext.h				\
 | 
			
		||||
	$(DIRECTORY)/include/GL/glx_mangle.h				\
 | 
			
		||||
	$(DIRECTORY)/include/GL/glfbdev.h				\
 | 
			
		||||
	$(DIRECTORY)/include/GL/mesa_wgl.h				\
 | 
			
		||||
	$(DIRECTORY)/include/GL/mglmesa.h				\
 | 
			
		||||
	$(DIRECTORY)/include/GL/osmesa.h				\
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										11
									
								
								Makefile.DJ
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								Makefile.DJ
									
									
									
									
									
								
							@@ -20,9 +20,9 @@
 | 
			
		||||
# 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.
 | 
			
		||||
 | 
			
		||||
# DOS/DJGPP makefile for Mesa
 | 
			
		||||
# DOS/DJGPP makefile v1.6 for Mesa
 | 
			
		||||
#
 | 
			
		||||
#  Author: Daniel Borca
 | 
			
		||||
#  Copyright (C) 2002 - Daniel Borca
 | 
			
		||||
#  Email : dborca@users.sourceforge.net
 | 
			
		||||
#  Web   : http://www.geocities.com/dborca
 | 
			
		||||
 | 
			
		||||
@@ -31,6 +31,9 @@
 | 
			
		||||
#  Available options:
 | 
			
		||||
#
 | 
			
		||||
#    Environment variables:
 | 
			
		||||
#	GLU=[mesa|sgi]	specify GLU directory; can be `sgi' (requires GNU/C++)
 | 
			
		||||
#			or `mesa'.
 | 
			
		||||
#			default = mesa
 | 
			
		||||
#	GLIDE		path to Glide3 SDK; used with FX.
 | 
			
		||||
#			default = $(TOP)/glide3
 | 
			
		||||
#	FX=1		build for 3dfx Glide3. Note that this disables
 | 
			
		||||
@@ -54,6 +57,8 @@
 | 
			
		||||
 | 
			
		||||
.PHONY : all libgl libglu libglut clean realclean
 | 
			
		||||
 | 
			
		||||
GLU ?= mesa
 | 
			
		||||
 | 
			
		||||
CFLAGS = -Wall -W -pedantic
 | 
			
		||||
CFLAGS += -O2 -ffast-math
 | 
			
		||||
 | 
			
		||||
@@ -70,7 +75,7 @@ all: libgl libglu libglut
 | 
			
		||||
libgl: lib
 | 
			
		||||
	$(MAKE) -f Makefile.DJ -C src/mesa
 | 
			
		||||
libglu: lib
 | 
			
		||||
	$(MAKE) -f Makefile.DJ -C src/glu/sgi
 | 
			
		||||
	$(MAKE) -f Makefile.DJ -C src/glu/$(GLU)
 | 
			
		||||
libglut: lib
 | 
			
		||||
	$(MAKE) -f Makefile.DJ -C src/glut/dos
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -53,8 +53,6 @@ if [ `uname` = "FreeBSD" ] ; then
 | 
			
		||||
	CP_FLAGS="-f"
 | 
			
		||||
elif [ `uname` = "Darwin" ] ; then
 | 
			
		||||
	CP_FLAGS="-f"
 | 
			
		||||
elif [ `uname` = "AIX" ] ; then
 | 
			
		||||
	CP_FLAGS="-fh"
 | 
			
		||||
else
 | 
			
		||||
	CP_FLAGS="-fd"
 | 
			
		||||
fi
 | 
			
		||||
 
 | 
			
		||||
@@ -502,9 +502,6 @@ case $ARCH in
 | 
			
		||||
            ${LINK} ${OPTS} ${LIBNAME} ${OBJECTS}
 | 
			
		||||
            FINAL_LIBS=${LIBNAME}
 | 
			
		||||
        else
 | 
			
		||||
	    # may need these:
 | 
			
		||||
	    # CFLAGS += -fno-common
 | 
			
		||||
	    # LDFLAGS += -bundle -flat_namespace -undefined suppress
 | 
			
		||||
            LIBNAME="lib${LIBNAME}.dylib"
 | 
			
		||||
            echo "mklib: Making Darwin shared library: " ${LIBNAME}
 | 
			
		||||
            FLAGS="-dynamiclib -multiply_defined suppress -current_version ${MAJOR}.${MINOR}.0 -compatibility_version ${MAJOR}.${MINOR}.0"
 | 
			
		||||
 
 | 
			
		||||
@@ -14,6 +14,6 @@ CXXFLAGS = -O2 -DAIXV3
 | 
			
		||||
MKLIB_OPTIONS = -arch aix-gcc
 | 
			
		||||
GL_LIB_DEPS = -lX11 -lXext -lm
 | 
			
		||||
GLU_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -lm
 | 
			
		||||
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lXi -lXmu
 | 
			
		||||
GLUT_LIB_DEPS = -L$(LIB_DIR -l$(GLU_LIB) -l$(GL_LIB) -lXi -lXmu
 | 
			
		||||
APP_LIB_DEPS = -L$(LIB_DIR) -Wl,-brtl -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm -lX11 -lXext -lXmu -lXi
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -10,9 +10,6 @@ MESA_MAJOR=6
 | 
			
		||||
MESA_MINOR=5
 | 
			
		||||
MESA_TINY=0
 | 
			
		||||
 | 
			
		||||
# external projects.  This should be useless now that we use libdrm.
 | 
			
		||||
DRM_SOURCE_PATH=$(TOP)/../drm
 | 
			
		||||
 | 
			
		||||
# Compiler and flags
 | 
			
		||||
CC = cc
 | 
			
		||||
CXX = CC
 | 
			
		||||
 
 | 
			
		||||
@@ -5,22 +5,13 @@ include $(TOP)/configs/default
 | 
			
		||||
CONFIG_NAME = FreeBSD
 | 
			
		||||
 | 
			
		||||
# Compiler and flags
 | 
			
		||||
CC = cc
 | 
			
		||||
CXX = c++
 | 
			
		||||
CC = gcc
 | 
			
		||||
CXX = g++
 | 
			
		||||
MAKE = gmake
 | 
			
		||||
 | 
			
		||||
OPT_FLAGS  = -O2
 | 
			
		||||
PIC_FLAGS  = -fPIC
 | 
			
		||||
 | 
			
		||||
DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_BSD_SOURCE -DUSE_XSHM -DHZ=100
 | 
			
		||||
 | 
			
		||||
X11_INCLUDES = -I/usr/X11R6/include
 | 
			
		||||
 | 
			
		||||
CFLAGS += $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(DEFINES) $(X11_INCLUDES) -ffast-math -pedantic
 | 
			
		||||
 | 
			
		||||
CXXFLAGS += $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(DEFINES) $(X11_INCLUDES)
 | 
			
		||||
 | 
			
		||||
CFLAGS = -O2 -fPIC -pedantic -I/usr/X11R6/include -DUSE_XSHM -DHZ=100 \
 | 
			
		||||
	$(ASM_FLAGS)
 | 
			
		||||
CXXFLAGS = -O2 -fPIC -pedantic
 | 
			
		||||
GLUT_CFLAGS = -fexceptions
 | 
			
		||||
 | 
			
		||||
EXTRA_LIB_PATH = -L/usr/X11R6/lib
 | 
			
		||||
APP_LIB_DEPS = -L$(LIB_DIR) $(EXTRA_LIB_PATH) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lXext -lXmu -lXi -lX11 -lm
 | 
			
		||||
APP_LIB_DEPS = -L$(LIB_DIR) -L/usr/X11R6/lib -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lXext -lXmu -lXi -lX11 -lm
 | 
			
		||||
 
 | 
			
		||||
@@ -22,7 +22,7 @@ CXXFLAGS = $(DEFINES) -Wall -g -ansi -pedantic -fPIC
 | 
			
		||||
ASM_SOURCES = 
 | 
			
		||||
 | 
			
		||||
# Library/program dependencies
 | 
			
		||||
LIBDRM_LIB = `pkg-config --libs libdrm`
 | 
			
		||||
LIBDRM_LIB = `pkg-config --libs libdrm` -ldrm
 | 
			
		||||
DRI_LIB_DEPS = -L/usr/local/lib -lm -lpthread -lexpat $(LIBDRM_LIB)
 | 
			
		||||
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lXxf86vm -lm -lpthread $(LIBDRM_LIB)
 | 
			
		||||
 | 
			
		||||
@@ -40,6 +40,6 @@ DRM_SOURCE_PATH=$(TOP)/../drm
 | 
			
		||||
 | 
			
		||||
# ffb and gamma are missing because they have not been converted to use the new
 | 
			
		||||
# interface.
 | 
			
		||||
DRI_DIRS = i810 i915 mach64 mga r128 r200 r300 radeon tdfx \
 | 
			
		||||
DRI_DIRS = i810 i830 i915 mach64 mga r128 r200 r300 radeon tdfx \
 | 
			
		||||
	   unichrome savage sis
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -4,5 +4,5 @@ include $(TOP)/configs/linux
 | 
			
		||||
 | 
			
		||||
CONFIG_NAME = linux-debug
 | 
			
		||||
 | 
			
		||||
OPT_FLAGS = -g -ansi -pedantic
 | 
			
		||||
OPT_FLAGS = -g
 | 
			
		||||
DEFINES += -DDEBUG -DDEBUG_MATH
 | 
			
		||||
 
 | 
			
		||||
@@ -13,7 +13,8 @@ CXX = g++
 | 
			
		||||
#MKDEP = gcc -M
 | 
			
		||||
#MKDEP_OPTIONS = -MF depend
 | 
			
		||||
 | 
			
		||||
OPT_FLAGS  = -g
 | 
			
		||||
#OPT_FLAGS  = -g -march=pentium4 -fprefetch-loop-arrays
 | 
			
		||||
OPT_FLAGS  = -O2 
 | 
			
		||||
PIC_FLAGS  = -fPIC
 | 
			
		||||
 | 
			
		||||
# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support.
 | 
			
		||||
@@ -22,6 +23,7 @@ ARCH_FLAGS ?=
 | 
			
		||||
DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
 | 
			
		||||
	-D_BSD_SOURCE -D_GNU_SOURCE \
 | 
			
		||||
	-DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER \
 | 
			
		||||
	-DDEBUG \
 | 
			
		||||
	-DGLX_DIRECT_RENDERING -DHAVE_ALIAS
 | 
			
		||||
 | 
			
		||||
X11_INCLUDES = -I/usr/X11R6/include
 | 
			
		||||
@@ -37,7 +39,7 @@ ASM_SOURCES =
 | 
			
		||||
# Library/program dependencies
 | 
			
		||||
EXTRA_LIB_PATH=-L/usr/X11R6/lib
 | 
			
		||||
 | 
			
		||||
LIBDRM_LIB = `pkg-config --libs libdrm`
 | 
			
		||||
LIBDRM_LIB = `pkg-config --libs libdrm` -ldrm
 | 
			
		||||
DRI_LIB_DEPS  = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
 | 
			
		||||
GL_LIB_DEPS   = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl \
 | 
			
		||||
                $(LIBDRM_LIB)
 | 
			
		||||
@@ -63,5 +65,7 @@ WINDOW_SYSTEM=dri
 | 
			
		||||
 | 
			
		||||
# gamma are missing because they have not been converted to use the new
 | 
			
		||||
# interface.
 | 
			
		||||
DRI_DIRS = i810 i915 mach64 mga r128 r200 r300 radeon s3v \
 | 
			
		||||
DRI_DIRS = i915 mach64 mga r128 r200 r300 radeon s3v \
 | 
			
		||||
	savage sis tdfx trident unichrome ffb
 | 
			
		||||
 | 
			
		||||
DRI_DIRS = i915 
 | 
			
		||||
 
 | 
			
		||||
@@ -17,7 +17,7 @@ LIB_DIR = $(TOP)/lib64
 | 
			
		||||
EXTRA_LIB_PATH=-L/usr/X11R6/lib64
 | 
			
		||||
 | 
			
		||||
# ffb, gamma, and sis are missing because they have not be converted to use
 | 
			
		||||
# the new interface.  i810 are missing because there is no x86-64
 | 
			
		||||
# the new interface.  i810 and i830 are missing because there is no x86-64
 | 
			
		||||
# system where they could *ever* be used.
 | 
			
		||||
#
 | 
			
		||||
DRI_DIRS = i915 mach64 mga r128 r200 radeon tdfx unichrome savage r300
 | 
			
		||||
 
 | 
			
		||||
@@ -1,67 +0,0 @@
 | 
			
		||||
# -*-makefile-*-
 | 
			
		||||
# Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others
 | 
			
		||||
 | 
			
		||||
include $(TOP)/configs/default
 | 
			
		||||
 | 
			
		||||
CONFIG_NAME = linux-dri-xcb
 | 
			
		||||
 | 
			
		||||
# Compiler and flags
 | 
			
		||||
CC = gcc
 | 
			
		||||
CXX = g++
 | 
			
		||||
 | 
			
		||||
#MKDEP = /usr/X11R6/bin/makedepend
 | 
			
		||||
#MKDEP = gcc -M
 | 
			
		||||
#MKDEP_OPTIONS = -MF depend
 | 
			
		||||
 | 
			
		||||
OPT_FLAGS  = -g
 | 
			
		||||
PIC_FLAGS  = -fPIC
 | 
			
		||||
 | 
			
		||||
# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support.
 | 
			
		||||
ARCH_FLAGS ?=
 | 
			
		||||
 | 
			
		||||
DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
 | 
			
		||||
	-D_BSD_SOURCE -D_GNU_SOURCE \
 | 
			
		||||
	-DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER \
 | 
			
		||||
	-DGLX_DIRECT_RENDERING -DHAVE_ALIAS -DUSE_XCB
 | 
			
		||||
 | 
			
		||||
X11_INCLUDES = `pkg-config --cflags-only-I x11` `pkg-config --cflags-only-I xcb`
 | 
			
		||||
 | 
			
		||||
CFLAGS = -Wall -Wmissing-prototypes $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) \
 | 
			
		||||
	$(DEFINES) $(ASM_FLAGS) -std=c99 -ffast-math 
 | 
			
		||||
 | 
			
		||||
CXXFLAGS = -Wall $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
ASM_SOURCES = 
 | 
			
		||||
 | 
			
		||||
# Library/program dependencies
 | 
			
		||||
EXTRA_LIB_PATH=`pkg-config --libs-only-L x11`
 | 
			
		||||
 | 
			
		||||
LIBDRM_LIB = `pkg-config --libs libdrm`
 | 
			
		||||
DRI_LIB_DEPS  = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
 | 
			
		||||
GL_LIB_DEPS   = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl \
 | 
			
		||||
                $(LIBDRM_LIB) `pkg-config --libs xcb`
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# This is now 0 by default since it seems to confuse the hell out of people
 | 
			
		||||
# and generate a lot of extra noise on bugzilla.  If you need to build with
 | 
			
		||||
# EGL, do 'make linux-dri USING_EGL=1'
 | 
			
		||||
 | 
			
		||||
USING_EGL=0
 | 
			
		||||
 | 
			
		||||
# Directories
 | 
			
		||||
ifeq ($(USING_EGL), 1)
 | 
			
		||||
SRC_DIRS = egl glx/x11 mesa glu glut/glx glw
 | 
			
		||||
PROGRAM_DIRS = egl
 | 
			
		||||
else
 | 
			
		||||
SRC_DIRS = glx/x11 mesa glu glut/glx glw
 | 
			
		||||
PROGRAM_DIRS =
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
DRIVER_DIRS = dri
 | 
			
		||||
WINDOW_SYSTEM=dri
 | 
			
		||||
 | 
			
		||||
# gamma are missing because they have not been converted to use the new
 | 
			
		||||
# interface.
 | 
			
		||||
DRI_DIRS = i810 i915 mach64 mga r128 r200 r300 radeon s3v \
 | 
			
		||||
	savage sis tdfx trident unichrome ffb
 | 
			
		||||
@@ -10,7 +10,7 @@ CONFIG_NAME = linux-dri
 | 
			
		||||
CC = gcc
 | 
			
		||||
CXX = g++
 | 
			
		||||
 | 
			
		||||
#MKDEP = /usr/X11R6/bin/makedepend
 | 
			
		||||
MKDEP = /usr/X11R6/bin/makedepend
 | 
			
		||||
#MKDEP = gcc -M
 | 
			
		||||
#MKDEP_OPTIONS = -MF depend
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -40,4 +40,4 @@ DRIVER_DIRS = dri
 | 
			
		||||
PROGRAM_DIRS = miniglx
 | 
			
		||||
 | 
			
		||||
#DRI_DIRS = ffb gamma sis savage
 | 
			
		||||
DRI_DIRS = i810 i915 mach64 mga r128 r200 radeon tdfx unichrome fb
 | 
			
		||||
DRI_DIRS = i810 i830 i915 mach64 mga r128 r200 radeon tdfx unichrome fb
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										25
									
								
								configs/linux-x86-xcb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								configs/linux-x86-xcb
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,25 @@
 | 
			
		||||
# Configuration for Linux with x86 optimizations
 | 
			
		||||
 | 
			
		||||
include $(TOP)/configs/default
 | 
			
		||||
 | 
			
		||||
CONFIG_NAME = linux-x86-xcb
 | 
			
		||||
 | 
			
		||||
# Compiler and flags
 | 
			
		||||
CC = gcc
 | 
			
		||||
CXX = g++
 | 
			
		||||
 | 
			
		||||
CFLAGS = -Wall -O3 -ansi -pedantic -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM -DPTHREADS -DUSE_XCB -I/usr/X11R6/include
 | 
			
		||||
 | 
			
		||||
CXXFLAGS = -Wall -O3 -ansi -pedantic -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XCB
 | 
			
		||||
 | 
			
		||||
GLUT_CFLAGS = -fexceptions
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
ASM_SOURCES = $(X86_SOURCES)
 | 
			
		||||
ASM_API = $(X86_API)
 | 
			
		||||
 | 
			
		||||
# Library/program dependencies
 | 
			
		||||
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -lXCB
 | 
			
		||||
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
 | 
			
		||||
GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib -lXt -lX11
 | 
			
		||||
APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
			Mesa 6.5 DOS/DJGPP Port v1.8
 | 
			
		||||
			Mesa 6.3 DOS/DJGPP Port v1.7
 | 
			
		||||
			~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -7,7 +7,8 @@ Description:
 | 
			
		||||
~~~~~~~~~~~~
 | 
			
		||||
 | 
			
		||||
Well, guess what... this is the DOS port of Mesa 6.3, for DJGPP fans... Whoa!
 | 
			
		||||
The driver uses OSMesa to draw off screen, and then blits the buffer.
 | 
			
		||||
The driver has its origins in ddsample.c, written by Brian Paul and found by me
 | 
			
		||||
in Mesa 3.4.2.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -31,6 +32,9 @@ Available options:
 | 
			
		||||
     Environment variables:
 | 
			
		||||
	CPU		optimize for the given processor.
 | 
			
		||||
			default = pentium
 | 
			
		||||
	GLU=[mesa|sgi]	specify GLU directory; can be `sgi' (requires GNU/C++)
 | 
			
		||||
			or `mesa'.
 | 
			
		||||
			default = mesa
 | 
			
		||||
	GLIDE		path to Glide3 SDK; used with FX.
 | 
			
		||||
			default = $(TOP)/glide3
 | 
			
		||||
	FX=1		build for 3dfx Glide3. Note that this disables
 | 
			
		||||
@@ -52,9 +56,11 @@ Available options:
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Tested on:
 | 
			
		||||
	Video card:	Radeon 9500
 | 
			
		||||
	DJGPP:		djdev 2.04 + gcc v4.1.0 + make v3.80
 | 
			
		||||
	OS:		DOS, Win98SE, WinXP (using Videoport driver)
 | 
			
		||||
	CPU:		AMD Athlon XP 1800+
 | 
			
		||||
	Mainboard:	GA-7VTXE w/ 512 MB DDRAM
 | 
			
		||||
	Video card:	Voodoo5 6000 AGP w/ 128 MB SDRAM
 | 
			
		||||
	DJGPP:		djdev 2.04 + gcc v3.4.3 + make v3.80
 | 
			
		||||
	OS:		DOS and Win98SE
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -92,7 +98,7 @@ FAQ:
 | 
			
		||||
   Q) DMesa is so SLOOOW! The Win32 OpenGL performs so much better...
 | 
			
		||||
   A) Is that a question? If you have a 3dfx Voodoo (any model), you're
 | 
			
		||||
      lucky (check http://sourceforge.net/projects/glide for the DJGPP port).
 | 
			
		||||
      If you haven't, sorry; everything is done in software.
 | 
			
		||||
      If you haven't, sorry; everything is done in software. Suggestions?
 | 
			
		||||
 | 
			
		||||
   Q) I tried to set refresh rate w/ DMesa, but without success.
 | 
			
		||||
   A) Refresh rate control works only for VESA 3.0 and the 3dfx driver (in
 | 
			
		||||
@@ -101,8 +107,7 @@ FAQ:
 | 
			
		||||
 | 
			
		||||
   Q) I made a simple application and it does nothing. It exits right away. Not
 | 
			
		||||
      even a blank screen.
 | 
			
		||||
   A) Software drivers (VESA/VGA/NUL) must to be constructed as single-buffered
 | 
			
		||||
      visuals.  However, DMesaSwapBuffers must be called to get any output.
 | 
			
		||||
   A) Pure software drivers (VESA/VGA/NUL) support only double-buffered modes.
 | 
			
		||||
   A) Another weird "feature" is that buffer width must be multiple of 8 (I'm a
 | 
			
		||||
      lazy programmer and I found that the easiest way to keep buffer handling
 | 
			
		||||
      at peak performance ;-).
 | 
			
		||||
@@ -260,11 +265,6 @@ v1.7 (???-2005)
 | 
			
		||||
	* no more GLX sources in DOS GLUT
 | 
			
		||||
	* made GLUT timer callbacks less accurate but safer
 | 
			
		||||
 | 
			
		||||
v1.8 (apr-2006)
 | 
			
		||||
	* killed lots of code, the driver is now a front-end to OSMesa
 | 
			
		||||
	* fixed problem with WinNT (http://www.volny.cz/martin.sulak/)
 | 
			
		||||
	- removed 3dfx Glide3 support (temporarily?)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Contact:
 | 
			
		||||
 
 | 
			
		||||
@@ -1,15 +1,15 @@
 | 
			
		||||
File: docs/README.WIN32
 | 
			
		||||
 | 
			
		||||
Last updated: Mar 31, 2006 - Karl Schultz - kschultz@users.sourceforge.net
 | 
			
		||||
Last updated: Jul 01, 2005 - Karl Schultz - kschultz@users.sourceforge.net
 | 
			
		||||
 | 
			
		||||
Quick Start
 | 
			
		||||
----- -----
 | 
			
		||||
 | 
			
		||||
Unzip the MesaLib, MesaGLUT, and MesaDemos ZIP files into the same
 | 
			
		||||
directory.  The libs and demos build separately, so if you do not care
 | 
			
		||||
about the demos or GLUT, you only need to unzip MesaLib.  If you unzip
 | 
			
		||||
more than one ZIP file, they all need to be unzipped into the same
 | 
			
		||||
directory.  Don't worry, you will not overwrite anything.
 | 
			
		||||
Unzip both ZIP files (MesaLib and MesaDemos) into the same directory.
 | 
			
		||||
The libs and demos build separately, so if you do not care about the
 | 
			
		||||
demos, you do not have to unzip that zip file.  But if you do, it does
 | 
			
		||||
need to be unzipped into the same directory as the lib zip file
 | 
			
		||||
because the demos depend on the libs.
 | 
			
		||||
 | 
			
		||||
The Windows build system uses Microsoft Visual Studio.  Project files
 | 
			
		||||
for a specific version of Visual Studio are in their own directory in
 | 
			
		||||
@@ -22,10 +22,6 @@ of Version 8 and it runs on 64-bit Windows.  If you want to try this,
 | 
			
		||||
start by importing the VC7 files and create the 64-bit targets in the
 | 
			
		||||
configuration manager.
 | 
			
		||||
 | 
			
		||||
It is likely that the new and free Visual Studio Express can be used
 | 
			
		||||
to build Mesa, but it hasn't been tried yet.  Start with the VC7
 | 
			
		||||
project files.
 | 
			
		||||
 | 
			
		||||
The project files to build the core Mesa library, Windows Mesa
 | 
			
		||||
drivers, OSMesa, and GLU are in the mesa directory.  The project files
 | 
			
		||||
to build GLUT and some demo programs are in the progs directory.
 | 
			
		||||
@@ -37,11 +33,10 @@ from the projects using Visual Studio.
 | 
			
		||||
Windows Drivers
 | 
			
		||||
------- -------
 | 
			
		||||
 | 
			
		||||
At this time, only the GDI driver is known to work.  Most of the demos
 | 
			
		||||
in progs/demos should work with this driver.
 | 
			
		||||
 | 
			
		||||
Source code also exists in the tree for other drivers in
 | 
			
		||||
src/mesa/drivers/windows, but the status of this code is unknown.
 | 
			
		||||
At this time, only the GDI driver is known to work, as it has been
 | 
			
		||||
ported and rewritten to the latest Mesa DD interfaces.  Source code
 | 
			
		||||
also exists in the tree for other drivers in src/mesa/drivers/windows,
 | 
			
		||||
but the status of this code is unknown.
 | 
			
		||||
 | 
			
		||||
The GDI driver operates basically by writing pixel spans into a DIB
 | 
			
		||||
section and then blitting the DIB to the window.  The driver was
 | 
			
		||||
@@ -91,14 +86,6 @@ simply run the demo executables from the demo directory.
 | 
			
		||||
If you want to run the demos from the Visual Studio, you may have to
 | 
			
		||||
change the startup directory and explicitly state where the executables are.
 | 
			
		||||
 | 
			
		||||
You may also build all the demo programs by using a makefile.  Go to
 | 
			
		||||
the progs/demos directory and make sure you have executed VCVARS32.BAT
 | 
			
		||||
or whatever setup script is appropriate for your compiler.  Then,
 | 
			
		||||
 | 
			
		||||
	nmake -f Makefile.win
 | 
			
		||||
 | 
			
		||||
should build all the demos.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Build System Notes
 | 
			
		||||
----- ------ -----
 | 
			
		||||
@@ -111,9 +98,6 @@ language files, without a lot of unnatural tweaking.  So, the VC6
 | 
			
		||||
build process uses custom build steps to compile these files in the
 | 
			
		||||
GLU library.
 | 
			
		||||
 | 
			
		||||
Two additional configurations are provided, Debug x86 and Release x86
 | 
			
		||||
that activate the shader code compilation by defining SLANG_86.  It is
 | 
			
		||||
unknown if and how this works.
 | 
			
		||||
 | 
			
		||||
VC7
 | 
			
		||||
---
 | 
			
		||||
 
 | 
			
		||||
@@ -1,47 +0,0 @@
 | 
			
		||||
 | 
			
		||||
		        Mesa 6.4.1 Release Notes
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Introduction
 | 
			
		||||
------------
 | 
			
		||||
 | 
			
		||||
Mesa uses an even/odd version number scheme like the Linux kernel.
 | 
			
		||||
Odd numbered versions (such as 6.3) designate new developmental releases.
 | 
			
		||||
Even numbered versions (such as 6.4) designate stable releases.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
6.4.1 is a bug-fix release.  See the VERSIONS file for details.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
GLUT tarball
 | 
			
		||||
------------
 | 
			
		||||
 | 
			
		||||
Starting with 6.4, the GLUT library sources are distributed in a separate
 | 
			
		||||
tarball.  This was done at the request of Linux distro vendors who prefer
 | 
			
		||||
to use freeglut.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Driver			Status
 | 
			
		||||
----------------------	----------------------
 | 
			
		||||
DRI drivers		varies with the driver
 | 
			
		||||
XMesa (Xlib)		implements OpenGL 1.5
 | 
			
		||||
OSMesa (off-screen)	implements OpenGL 1.5
 | 
			
		||||
Windows/Win32		implements OpenGL 1.5
 | 
			
		||||
Glide (3dfx Voodoo1/2)  requires updates	
 | 
			
		||||
SVGA			requires updates
 | 
			
		||||
DJGPP			requires updates
 | 
			
		||||
GGI			requires updates
 | 
			
		||||
BeOS			requires updates
 | 
			
		||||
Allegro			requires updates
 | 
			
		||||
D3D			requires updates
 | 
			
		||||
 | 
			
		||||
The drivers which require updates mostly need to be updated to work
 | 
			
		||||
with the new gl_renderbuffer / gl_framebuffer infrastructure introduced
 | 
			
		||||
in Mesa 6.3.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
----------------------------------------------------------------------
 | 
			
		||||
$Id: RELNOTES-6.4.1,v 3.1 2006/02/03 17:21:54 brianp Exp $
 | 
			
		||||
@@ -1,47 +0,0 @@
 | 
			
		||||
 | 
			
		||||
		        Mesa 6.4.2 Release Notes
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Introduction
 | 
			
		||||
------------
 | 
			
		||||
 | 
			
		||||
Mesa uses an even/odd version number scheme like the Linux kernel.
 | 
			
		||||
Odd numbered versions (such as 6.3) designate new developmental releases.
 | 
			
		||||
Even numbered versions (such as 6.4) designate stable releases.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
6.4.2 is a minor bug-fix release.  See the VERSIONS file for details.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
GLUT tarball
 | 
			
		||||
------------
 | 
			
		||||
 | 
			
		||||
Starting with 6.4, the GLUT library sources are distributed in a separate
 | 
			
		||||
tarball.  This was done at the request of Linux distro vendors who prefer
 | 
			
		||||
to use freeglut.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Driver			Status
 | 
			
		||||
----------------------	----------------------
 | 
			
		||||
DRI drivers		varies with the driver
 | 
			
		||||
XMesa (Xlib)		implements OpenGL 1.5
 | 
			
		||||
OSMesa (off-screen)	implements OpenGL 1.5
 | 
			
		||||
Windows/Win32		implements OpenGL 1.5
 | 
			
		||||
Glide (3dfx Voodoo1/2)  requires updates	
 | 
			
		||||
SVGA			requires updates
 | 
			
		||||
DJGPP			requires updates
 | 
			
		||||
GGI			requires updates
 | 
			
		||||
BeOS			requires updates
 | 
			
		||||
Allegro			requires updates
 | 
			
		||||
D3D			requires updates
 | 
			
		||||
 | 
			
		||||
The drivers which require updates mostly need to be updated to work
 | 
			
		||||
with the new gl_renderbuffer / gl_framebuffer infrastructure introduced
 | 
			
		||||
in Mesa 6.3.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
----------------------------------------------------------------------
 | 
			
		||||
$Id: RELNOTES-6.4.2,v 3.1 2006/02/03 17:21:54 brianp Exp $
 | 
			
		||||
@@ -1,5 +1,7 @@
 | 
			
		||||
 | 
			
		||||
			Mesa 6.5 Release Notes
 | 
			
		||||
                       Mesa 6.5 Release Notes
 | 
			
		||||
 | 
			
		||||
                           month, day, 2005
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -15,29 +17,23 @@ Even numbered versions (such as 6.4) designate stable releases.
 | 
			
		||||
New Features
 | 
			
		||||
------------
 | 
			
		||||
 | 
			
		||||
OpenGL Shading language support
 | 
			
		||||
   This includes the GL_ARB_shader_objects, GL_ARB_shading_language_100,
 | 
			
		||||
   GL_ARB_vertex_shader and GL_ARB_fragment_shader extensions.  Most of
 | 
			
		||||
   the work was done by Michal Krol.
 | 
			
		||||
   There's probably a fair number of bugs since this is a pretty large,
 | 
			
		||||
   complicated body of code.
 | 
			
		||||
GL_EXT_timer_query  - used to get elapsed time information from the renderer.
 | 
			
		||||
 | 
			
		||||
   The OpenGL 2.0 interface to these features will be implemented in a
 | 
			
		||||
   future version of Mesa,
 | 
			
		||||
 | 
			
		||||
GL_EXT_timer_query
 | 
			
		||||
   Used to measure the time of OpenGL operations at high precision.
 | 
			
		||||
   Only supported in the software/Xlib driver at this time.
 | 
			
		||||
 | 
			
		||||
GL_EXT_packed_depth_stencil
 | 
			
		||||
   Defines a new GL_DEPTH_STENCIL_EXT pixel format.
 | 
			
		||||
Driver Interface Changes
 | 
			
		||||
------------------------
 | 
			
		||||
 | 
			
		||||
GL_EXT_framebuffer_blit
 | 
			
		||||
   A simplified glCopyPixels-like feature for copying pixel rectangles.
 | 
			
		||||
Stencil: The Driver.StencilOp/Func/Mask() functions have been replaced by
 | 
			
		||||
the two-sided versions: Driver.Stencil*Separate().
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
To Do
 | 
			
		||||
-----
 | 
			
		||||
Fix linux-glide target/driver.
 | 
			
		||||
Fix lambda calculation for frag progs.
 | 
			
		||||
 | 
			
		||||
GL_ARB_half_float_pixel
 | 
			
		||||
   Adds a new half-precision floating point format for image transfers,
 | 
			
		||||
   such as for glDrawPixels, glReadPixels, glTexImage, etc.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -50,37 +46,18 @@ The following extensions have been removed:
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Known Issues
 | 
			
		||||
------------
 | 
			
		||||
 | 
			
		||||
Rendering to depth textures will not work.  Rendering to GL_DEPTH_STENCIL
 | 
			
		||||
textures should work.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Driver Interface Changes
 | 
			
		||||
------------------------
 | 
			
		||||
 | 
			
		||||
Stencil: The Driver.StencilOp/Func/Mask() functions have been replaced by
 | 
			
		||||
the two-sided versions: Driver.Stencil*Separate().
 | 
			
		||||
 | 
			
		||||
Render-to-texture: The functions for rendering to textures have changed.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
To Do (someday) items
 | 
			
		||||
---------------------
 | 
			
		||||
 Switch to freeglut
 | 
			
		||||
 Increase MAX_DRAWBUFFERS
 | 
			
		||||
 Fix linux-glide target/driver.
 | 
			
		||||
 Fix lambda calculation for frag progs.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Driver			Status
 | 
			
		||||
----------------------	----------------------
 | 
			
		||||
DRI drivers		varies with the driver
 | 
			
		||||
XMesa/GLX (on Xlib)	implements OpenGL 1.5
 | 
			
		||||
XMesa (Xlib)		implements OpenGL 1.5
 | 
			
		||||
OSMesa (off-screen)	implements OpenGL 1.5
 | 
			
		||||
Glide (3dfx Voodoo1/2)	implements OpenGL 1.3
 | 
			
		||||
SVGA			implements OpenGL 1.3
 | 
			
		||||
@@ -94,4 +71,4 @@ D3D			needs updating
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
----------------------------------------------------------------------
 | 
			
		||||
$Id: RELNOTES-6.5,v 3.4 2006/03/29 04:53:02 brianp Exp $
 | 
			
		||||
$Id: RELNOTES-6.5,v 3.1 2005/09/14 14:34:54 brianp Exp $
 | 
			
		||||
 
 | 
			
		||||
@@ -1407,42 +1407,10 @@ Mesa Version History
 | 
			
		||||
	- fragment programs that wrote result.depth.z didn't work
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
6.4.1  November 30, 2005
 | 
			
		||||
    Bug fixes:
 | 
			
		||||
	- redefining a vertex program string didn't take effect in TNL module
 | 
			
		||||
	- fixed occasional segfault upon vertex/fragment parsing error
 | 
			
		||||
	- vertex program LIT instruction didn't handle 0^0=1 correctly
 | 
			
		||||
	- fragment program fog option didn't work with glDrawPixels, glBitmap
 | 
			
		||||
	- USE_MGL_NAMESPACE didn't work for x86-64
 | 
			
		||||
	- OSMesa demos were missing from previous release tarballs
 | 
			
		||||
	- fixed problem with float->ushort conversion in glClear (bug 4992)
 | 
			
		||||
	- popping of GL_EYE_PLANE texgen state was broken (bug 4996)
 | 
			
		||||
	- popping of GL_SPOT_DIRECTION light state was broken (bug 5005)
 | 
			
		||||
	- fixed occasional triangle color interpolation problem on VMS
 | 
			
		||||
	- work around invalid free() call (bug 5131)
 | 
			
		||||
	- fixed BSD X server compilation problem by including stdint.h
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
6.4.2  February 2, 2006
 | 
			
		||||
6.5  month, day, 2005
 | 
			
		||||
    New:
 | 
			
		||||
	- added OSMesaColorClamp() function/feature
 | 
			
		||||
	- added wglGetExtensionStringARB() function
 | 
			
		||||
    Bug fixes:
 | 
			
		||||
	- fixed some problems when building on Windows
 | 
			
		||||
	- GLw header files weren't installed by installmesa script (bug 5396)
 | 
			
		||||
	- GL/glfbdev.h file was missing from tarballs
 | 
			
		||||
	- fixed TNL initialization bug which could lead to crash (bug 5791)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
6.5  March 31, 2006
 | 
			
		||||
    New:
 | 
			
		||||
	- OpenGL Shading Language support through GL_ARB_shader_objects,
 | 
			
		||||
	  GL_ARB_shading_language_100, GL_ARB_vertex_shader and
 | 
			
		||||
	  GL_ARB_fragment_shader (done by Michal Krol)
 | 
			
		||||
	- GL_EXT_packed_depth_stencil extension
 | 
			
		||||
	- GL_EXT_timer_query extension
 | 
			
		||||
	- GL_EXT_framebuffer_blit extension
 | 
			
		||||
	- GL_ARB_half_float_pixel
 | 
			
		||||
	- reflect demo improved to support multiple windows
 | 
			
		||||
	- singlebuffer demo (shows no/little-flicker single-buffered rendering)
 | 
			
		||||
	- r200: enable GL_ARB_texture_env_crossbar, separate the texture
 | 
			
		||||
@@ -1452,21 +1420,8 @@ Mesa Version History
 | 
			
		||||
	- radeon: add support for all 3 tmus, GL_ARB_texture_cube_map
 | 
			
		||||
	  and GL_EXT_fog_coord
 | 
			
		||||
	- MESA_GLX_ALPHA_BITS env var for xlib driver
 | 
			
		||||
	- many DRI driver updates (including screen rotation support
 | 
			
		||||
	  for the Intel DRI driver)
 | 
			
		||||
    Changes:
 | 
			
		||||
	- removed GL_HP_occlusion_test (use GL_ARB_occlusion_query instead)
 | 
			
		||||
	- removed GL_SGIX/SGIS_pixel_texture extensions
 | 
			
		||||
    Bug fixes:
 | 
			
		||||
	- fixed glxcontextmodes.c datatype problem (bug 5835)
 | 
			
		||||
	- fixed aix-gcc build/install bugs (bug 5874)
 | 
			
		||||
	- fixed some bugs in texture env program generation
 | 
			
		||||
	- glXCopyContext() didn't handle texture object bindings properly
 | 
			
		||||
	- glXCopyContext() didn't copy all lighting state
 | 
			
		||||
	- fixed FreeBSD config (Pedro Giffuni)
 | 
			
		||||
	- fixed some minor framebuffer object bugs
 | 
			
		||||
	- replaced dprintf() with _glu_printf() in GLU (bug 6244)
 | 
			
		||||
	- fixed a number of thread safety bugs/regressions
 | 
			
		||||
	- fixed a number of GLU tesselator bugs (John Shell, bug 6339)
 | 
			
		||||
	- paletted texturing was broken w/ floating point palettes (K. Schultz)
 | 
			
		||||
	- lots of assorted framebuffer object bug fixes
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -40,14 +40,14 @@ Here are the basic instructions for Unix systems:
 | 
			
		||||
    Version 1.9.28 is known to work.
 | 
			
		||||
<li>Login as an anonymous user:
 | 
			
		||||
    <pre>
 | 
			
		||||
    cvs -d:pserver:anonymous@anoncvs.freedesktop.org:/cvs/mesa login
 | 
			
		||||
    cvs -d:pserver:anonymous@pdx.freedesktop.org:/cvs/mesa login
 | 
			
		||||
    </pre>
 | 
			
		||||
    Just press Enter/Return when prompted for a password.
 | 
			
		||||
    <br>
 | 
			
		||||
    <br>
 | 
			
		||||
<li>Check out the code:
 | 
			
		||||
    <pre>
 | 
			
		||||
    cvs -d:pserver:anonymous@anoncvs.freedesktop.org:/cvs/mesa co Mesa
 | 
			
		||||
    cvs -d:pserver:anonymous@pdx.freedesktop.org:/cvs/mesa co Mesa
 | 
			
		||||
    </pre>
 | 
			
		||||
</ol>
 | 
			
		||||
 | 
			
		||||
@@ -56,7 +56,7 @@ Here are the basic instructions for Unix systems:
 | 
			
		||||
 | 
			
		||||
<ol>
 | 
			
		||||
<li><code>cd Mesa</code>
 | 
			
		||||
<li><code>cvs -z3 -d:pserver:anonymous@anoncvs.freedesktop.org:/cvs/mesa update</code>
 | 
			
		||||
<li><code>cvs -z3 -d:pserver:anonymous@pdx.freedesktop.org:/cvs/mesa update</code>
 | 
			
		||||
</ol>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -86,7 +86,7 @@ with:
 | 
			
		||||
</pre>
 | 
			
		||||
followed by:
 | 
			
		||||
<pre>
 | 
			
		||||
   cvs -d:ext:yourusername@cvs.freedesktop.org:/cvs/mesa co Mesa
 | 
			
		||||
   cvs -d:ext:yourusername@pdx.freedesktop.org:/cvs/mesa co Mesa
 | 
			
		||||
</pre>
 | 
			
		||||
 | 
			
		||||
<p>
 | 
			
		||||
 
 | 
			
		||||
@@ -83,7 +83,7 @@ Brace example:
 | 
			
		||||
Here's the GNU indent command which will best approximate my preferred style:
 | 
			
		||||
</p>
 | 
			
		||||
<pre>
 | 
			
		||||
	indent -br -i3 -npcs --no-tabs infile.c -o outfile.c
 | 
			
		||||
	indent -br -i3 -npcs infile.c -o outfile.c
 | 
			
		||||
</pre>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -145,7 +145,7 @@ DEMO_NAME are correct.
 | 
			
		||||
</p>
 | 
			
		||||
 | 
			
		||||
<p>
 | 
			
		||||
Update the docs/news.html file and docs/download.html files.
 | 
			
		||||
Update the docs/news.html file and docs/contents.html files.
 | 
			
		||||
</p>
 | 
			
		||||
 | 
			
		||||
<p>
 | 
			
		||||
 
 | 
			
		||||
@@ -9,11 +9,11 @@
 | 
			
		||||
<H1>Downloading</H1>
 | 
			
		||||
 | 
			
		||||
<p>
 | 
			
		||||
Last development release: <b>6.5</b>
 | 
			
		||||
Last development release: <b>6.3.2</b>
 | 
			
		||||
</p>
 | 
			
		||||
 | 
			
		||||
<p>
 | 
			
		||||
Last stable release: <b>6.4.2</b>
 | 
			
		||||
Last stable release: <b>6.2.1</b>
 | 
			
		||||
</p>
 | 
			
		||||
 | 
			
		||||
<p>
 | 
			
		||||
 
 | 
			
		||||
@@ -23,17 +23,16 @@ generate exceptions.
 | 
			
		||||
</ul>
 | 
			
		||||
 | 
			
		||||
<p>
 | 
			
		||||
The following are only applicable to the Xlib software driver.
 | 
			
		||||
See <A HREF="README.X11">README.X11</A> for details.
 | 
			
		||||
The following environment variables are only applicable to the Xlib/X11
 | 
			
		||||
software driver:
 | 
			
		||||
</p>
 | 
			
		||||
<ul>
 | 
			
		||||
<li>MESA_RGB_VISUAL - specifies the X visual and depth for RGB mode
 | 
			
		||||
<li>MESA_CI_VISUAL - specifies the X visual and depth for CI mode
 | 
			
		||||
<li>MESA_BACK_BUFFER - specifies how to implement the back color buffer,
 | 
			
		||||
    either "pixmap" or "ximage"
 | 
			
		||||
<li>MESA_GAMMA - gamma correction coefficients for red, green, blue channels
 | 
			
		||||
<li>MESA_XSYNC - enable synchronous X behavior (for debugging only)
 | 
			
		||||
<li>MESA_GLX_FORCE_CI - if set, force GLX to treat 8bpp visuals as CI visuals
 | 
			
		||||
<li>MESA_RGB_VISUAL - specifies the X visual and depth for RGB mode (X only)
 | 
			
		||||
<li>MESA_CI_VISUAL - specifies the X visual and depth for CI mode (X only)
 | 
			
		||||
<li>MESA_BACK_BUFFER - specifies how to implement the back color buffer (X only)
 | 
			
		||||
<li>MESA_GAMMA - gamma correction coefficients (X only)
 | 
			
		||||
<li>MESA_XSYNC - enable synchronous X behavior (for X debugging only)
 | 
			
		||||
<li>MESA_GLX_FORCE_CI - if set, force GLX to treak 8bpp visuals as CI visuals
 | 
			
		||||
<li>MESA_GLX_FX - set to either "fullscreen" for full-screen rendering,
 | 
			
		||||
  "window" to render into a window, or "disable" to disable the Glide driver.
 | 
			
		||||
<li>MESA_GLX_FORCE_ALPHA - if set, forces RGB windows to have an alpha channel.
 | 
			
		||||
 
 | 
			
		||||
@@ -70,13 +70,13 @@ They're found in a module of the DRI CVS tree.
 | 
			
		||||
To obtain the code do the following:
 | 
			
		||||
</p>
 | 
			
		||||
<pre>
 | 
			
		||||
   cvs -d:pserver:anonymous@anoncvs.freedesktop.org:/cvs/dri login
 | 
			
		||||
   cvs -d:pserver:anonymous@pdx.freedesktop.org:/cvs/dri login
 | 
			
		||||
</pre>
 | 
			
		||||
<p>
 | 
			
		||||
Press Enter/Return when prompted for a password.  Then,
 | 
			
		||||
</p>
 | 
			
		||||
<pre>
 | 
			
		||||
   cvs -d:pserver:anonymous@anoncvs.freedesktop.org:/cvs/dri co drm
 | 
			
		||||
   cvs -d:pserver:anonymous@pdx.freedesktop.org:/cvs/dri co drm
 | 
			
		||||
</pre>
 | 
			
		||||
 | 
			
		||||
<p>
 | 
			
		||||
 
 | 
			
		||||
@@ -50,18 +50,26 @@ Rendering Manager) kernel drivers and header files.
 | 
			
		||||
They're available from the <a href="http://dri.sf.net/" target="_parent">DRI</a> project.
 | 
			
		||||
</p>
 | 
			
		||||
<p>
 | 
			
		||||
Your distribution should already have both the kernel modules and support
 | 
			
		||||
library already installed.  If not, you can get them from CVS by doing:
 | 
			
		||||
You can get them from CVS by doing:
 | 
			
		||||
<pre>
 | 
			
		||||
cvs -z3 -d:pserver:anonymous@anoncvs.freedesktop.org:/cvs/dri co drm
 | 
			
		||||
cvs -d:pserver:anonymous@pds.freedesktop.org:/cvs/dri login
 | 
			
		||||
(hit enter when prompted for a password)
 | 
			
		||||
cvs -z3 -d:pserver:anonymous@pdx.freedesktop.org:/cvs/dri co drm
 | 
			
		||||
</pre>
 | 
			
		||||
<p>
 | 
			
		||||
See the <a href="http://dri.freedesktop.org/wiki/Building" target="_parent">
 | 
			
		||||
DRI Building Instructions</a> for the steps to build the DRM modules.  Mesa
 | 
			
		||||
6.5 requires at least libdrm 2.0.1 or greater.
 | 
			
		||||
Make note of the directory in which the drm files are placed.
 | 
			
		||||
</p>
 | 
			
		||||
<p>
 | 
			
		||||
Build Mesa and the DRI drivers by running
 | 
			
		||||
See the <a href="http://dri.freedesktop.org/wiki/Building" target="_parent">
 | 
			
		||||
DRI Building Instructions</a> for the steps to build the DRM modules.
 | 
			
		||||
</p>
 | 
			
		||||
<p>
 | 
			
		||||
Next, in the <code>Mesa-x.y.z/configs/default</code> file, set the
 | 
			
		||||
<code>DRM_SOURCE_PATH</code> variable to indicate where the DRM files
 | 
			
		||||
are located.
 | 
			
		||||
</p>
 | 
			
		||||
<p>
 | 
			
		||||
Now build Mesa and the DRI drivers by running
 | 
			
		||||
</p>
 | 
			
		||||
<pre>
 | 
			
		||||
make linux-dri
 | 
			
		||||
 
 | 
			
		||||
@@ -21,7 +21,7 @@
 | 
			
		||||
<li><a href="http://math.nist.gov/f90gl" target="_parent">Fortran77/90 bindings for OpenGL and Mesa</a> - by William Mitchell
 | 
			
		||||
<li><a href="http://glow.sourceforge.net/" target="_parent">GLOW</a> - a GUI toolkit for GLUT and OpenGL
 | 
			
		||||
<li><a href="http://www.nigels.com/glt/">Glt</a> - an OpenGL C++ toolkit
 | 
			
		||||
<li><a href="http://www.opengl.org/resources/libraries/glut.html" target="_parent">GLUT (GL Utility Toolkit)</a> - by Mark Kilgard
 | 
			
		||||
<li><a href="http://www.opengl.org/developers/documentation/glut/" target="_parent">GLUT (GL Utility Toolkit)</a> - by Mark Kilgard
 | 
			
		||||
<li><a href="http://atrey.karlin.mff.cuni.cz/%7E0rfelyus/guileGL/" target="_parent">GuileGL</a> - OpenGL and GtkGLArea language bindings for Guile
 | 
			
		||||
<li><a href="http://www.rsinc.com/" target="_parent">IDL</a> - Interactive Data Language
 | 
			
		||||
<li><a href="http://www.newplanetsoftware.com/jx/" target="_parent">JX</a> - C++ application framework and GUI library
 | 
			
		||||
 
 | 
			
		||||
@@ -14,7 +14,7 @@
 | 
			
		||||
	</li><li><a href="http://mesa3d.sourceforge.net/notfound.html">ARCAD</a> - CAD program
 | 
			
		||||
	</li><li><a href="http://www.mediascape.com/" target="_parent">Artstream</a> - provides
 | 
			
		||||
	functionality like Corel Draw and Illustrator
 | 
			
		||||
	</li><li><a href="http://www.blender.org/" target="_parent">Blender</a> - 3-D animation
 | 
			
		||||
	</li><li><a href="http://www.blender.nl/" target="_parent">Blender</a> - 3-D animation
 | 
			
		||||
	software
 | 
			
		||||
	</li><li><a href="http://www.arq.net/%7Ekasten/demtools/" target="_parent">Demtools</a>
 | 
			
		||||
	- Map viewer
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										118
									
								
								docs/news.html
									
									
									
									
									
								
							
							
						
						
									
										118
									
								
								docs/news.html
									
									
									
									
									
								
							@@ -11,122 +11,6 @@
 | 
			
		||||
<H1>News</H1>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
<h2>March 31, 2006</h2>
 | 
			
		||||
<p>
 | 
			
		||||
Mesa 6.5 has been released.  This is a new development release.
 | 
			
		||||
</p>
 | 
			
		||||
<pre>
 | 
			
		||||
    New:
 | 
			
		||||
	- OpenGL Shading Language support through GL_ARB_shader_objects,
 | 
			
		||||
	  GL_ARB_shading_language_100, GL_ARB_vertex_shader and
 | 
			
		||||
	  GL_ARB_fragment_shader (done by Michal Krol)
 | 
			
		||||
	- GL_EXT_packed_depth_stencil extension
 | 
			
		||||
	- GL_EXT_timer_query extension
 | 
			
		||||
	- GL_EXT_framebuffer_blit extension
 | 
			
		||||
	- GL_ARB_half_float_pixel
 | 
			
		||||
	- GLX_MESA_copy_sub_buffer for DRI drivers (Dave Reveman)
 | 
			
		||||
	- reflect demo improved to support multiple windows
 | 
			
		||||
	- singlebuffer demo (shows no/little-flicker single-buffered rendering)
 | 
			
		||||
	- r200: enable GL_ARB_texture_env_crossbar, separate the texture
 | 
			
		||||
	  sampling unit bits from the texture env combine enable bits
 | 
			
		||||
	- r200: add support for GL_ATI_fragment_shader
 | 
			
		||||
	- added fast XOR-mode line drawing optimization
 | 
			
		||||
	- radeon: add support for all 3 tmus, GL_ARB_texture_cube_map
 | 
			
		||||
	  and GL_EXT_fog_coord
 | 
			
		||||
	- MESA_GLX_ALPHA_BITS env var for xlib driver
 | 
			
		||||
	- many DRI driver updates (including screen rotation support
 | 
			
		||||
	  for the Intel DRI driver)
 | 
			
		||||
    Changes:
 | 
			
		||||
	- removed GL_HP_occlusion_test (use GL_ARB_occlusion_query instead)
 | 
			
		||||
	- removed GL_SGIX/SGIS_pixel_texture extensions
 | 
			
		||||
    Bug fixes:
 | 
			
		||||
	- fixed glxcontextmodes.c datatype problem (bug 5835)
 | 
			
		||||
	- fixed aix-gcc build/install bugs (bug 5874)
 | 
			
		||||
	- fixed some bugs in texture env program generation
 | 
			
		||||
	- glXCopyContext() didn't handle texture object bindings properly
 | 
			
		||||
	- glXCopyContext() didn't copy all lighting state
 | 
			
		||||
	- fixed FreeBSD config (Pedro Giffuni)
 | 
			
		||||
	- fixed some minor framebuffer object bugs
 | 
			
		||||
	- replaced dprintf() with _glu_printf() in GLU (bug 6244)
 | 
			
		||||
	- fixed a number of thread safety bugs/regressions
 | 
			
		||||
	- fixed a number of GLU tesselator bugs (John Shell, bug 6339)
 | 
			
		||||
	- paletted texturing was broken w/ floating point palettes (K. Schultz)
 | 
			
		||||
	- lots of assorted framebuffer object bug fixes
 | 
			
		||||
</pre>
 | 
			
		||||
<p>
 | 
			
		||||
The MD5 checksums are:
 | 
			
		||||
</p>
 | 
			
		||||
<pre>
 | 
			
		||||
TBD
 | 
			
		||||
</pre>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
<h2>February 2, 2006</h2>
 | 
			
		||||
<p>
 | 
			
		||||
Mesa 6.4.2 has been released.  This is primarily a bug-fix release.
 | 
			
		||||
</p>
 | 
			
		||||
<pre>
 | 
			
		||||
    New items:
 | 
			
		||||
	- added OSMesaColorClamp() function/feature
 | 
			
		||||
	- added wglGetExtensionStringARB() function
 | 
			
		||||
    Bug fixes:
 | 
			
		||||
	- fixed some problems when building on Windows
 | 
			
		||||
	- GLw header files weren't installed by installmesa script (bug 5396)
 | 
			
		||||
	- GL/glfbdev.h file was missing from tarballs
 | 
			
		||||
</pre>
 | 
			
		||||
<p>
 | 
			
		||||
The MD5 checksums are:
 | 
			
		||||
</p>
 | 
			
		||||
<pre>
 | 
			
		||||
cb0d745d520fa7c2bb9178058b763544  MesaLib-6.4.2.tar.gz
 | 
			
		||||
7674d2c603b5834259e4e5a820cefd5b  MesaLib-6.4.2.tar.bz2
 | 
			
		||||
d224e1325b33ff71a0f3893fc6b4d594  MesaLib-6.4.2.zip
 | 
			
		||||
d4b345d4588fc750cd3d34f3ac26673e  MesaDemos-6.4.2.tar.gz
 | 
			
		||||
9cae1ab874af533ce356bd7dfe2e0bb0  MesaDemos-6.4.2.tar.bz2
 | 
			
		||||
2da6e1d1245e441d27813595c6ba50de  MesaDemos-6.4.2.zip
 | 
			
		||||
84427d18c3453f0ea52388eeba7169b5  MesaGLUT-6.4.2.tar.gz
 | 
			
		||||
b157ba8ad1ea63260cf5339132e7aac6  MesaGLUT-6.4.2.tar.bz2
 | 
			
		||||
fe1523744fc05edc3811dfc6a1bf4181  MesaGLUT-6.4.2.zip
 | 
			
		||||
</pre>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
<h2>November 29, 2005</h2>
 | 
			
		||||
<p>
 | 
			
		||||
Mesa 6.4.1 has been released.  This is a stable, bug-fix release.
 | 
			
		||||
</p>
 | 
			
		||||
<pre>
 | 
			
		||||
    Bug fixes:
 | 
			
		||||
	- redefining a vertex program string didn't take effect in TNL module
 | 
			
		||||
	- fixed occasional segfault upon vertex/fragment parsing error
 | 
			
		||||
	- vertex program LIT instruction didn't handle 0^0=1 correctly
 | 
			
		||||
	- fragment program fog option didn't work with glDrawPixels, glBitmap
 | 
			
		||||
	- USE_MGL_NAMESPACE didn't work for x86-64
 | 
			
		||||
	- OSMesa demos were missing from previous release tarballs
 | 
			
		||||
	- fixed problem with float->ushort conversion in glClear (bug 4992)
 | 
			
		||||
	- popping of GL_EYE_PLANE texgen state was broken (bug 4996)
 | 
			
		||||
	- popping of GL_SPOT_DIRECTION light state was broken (bug 5005)
 | 
			
		||||
	- fixed occasional triangle color interpolation problem on VMS
 | 
			
		||||
	- work around invalid free() call (bug 5131)
 | 
			
		||||
	- fixed BSD X server compilation problem by including stdint.h
 | 
			
		||||
</pre>
 | 
			
		||||
<p>
 | 
			
		||||
The MD5 checksums are:
 | 
			
		||||
</p>
 | 
			
		||||
<pre>
 | 
			
		||||
698ceb574cf882b0226761f5913c0da9  MesaLib-6.4.1.tar.gz
 | 
			
		||||
ea148c828ec6f645526451db1b8556f1  MesaLib-6.4.1.tar.bz2
 | 
			
		||||
42e93279468975ed2bf3111b8721e5d9  MesaLib-6.4.1.zip
 | 
			
		||||
e3b0d50807fd2bdcd1a95aaddd786f13  MesaDemos-6.4.1.tar.gz
 | 
			
		||||
99df1fdcb98d391666b476ca6f1dda8a  MesaDemos-6.4.1.tar.bz2
 | 
			
		||||
b999d2c6d92fb4b7740a3dbd889348e3  MesaDemos-6.4.1.zip
 | 
			
		||||
eadfe01fe5ddfb1eb8227dd567b31635  MesaGLUT-6.4.1.tar.gz
 | 
			
		||||
bd003bb4f981a4f91dee4c38644d4f3f  MesaGLUT-6.4.1.tar.bz2
 | 
			
		||||
71c401c037088bf688a88afdaeb3420f  MesaGLUT-6.4.1.zip
 | 
			
		||||
</pre>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
<h2>October 24, 2005</h2>
 | 
			
		||||
<p>
 | 
			
		||||
Mesa 6.4 has been released.  This is a stable, bug-fix release.
 | 
			
		||||
@@ -1218,6 +1102,6 @@ source code</a>.</p>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
<hr>
 | 
			
		||||
$Id: news.html,v 3.27 2006/03/31 23:10:21 brianp Exp $
 | 
			
		||||
$Id: news.html,v 3.25 2005/10/24 23:33:27 brianp Exp $
 | 
			
		||||
</body>
 | 
			
		||||
</html>
 | 
			
		||||
 
 | 
			
		||||
@@ -13,8 +13,6 @@ The release notes summarize what's new or changed in each Mesa release.
 | 
			
		||||
</p>
 | 
			
		||||
 | 
			
		||||
<UL>
 | 
			
		||||
<LI><A HREF="RELNOTES-6.4.2">RELNOTES-6.4.2</A>
 | 
			
		||||
<LI><A HREF="RELNOTES-6.4.1">RELNOTES-6.4.1</A>
 | 
			
		||||
<LI><A HREF="RELNOTES-6.4">RELNOTES-6.4</A>
 | 
			
		||||
<LI><A HREF="RELNOTES-6.3.2">RELNOTES-6.3.2</A>
 | 
			
		||||
<LI><A HREF="RELNOTES-6.3">RELNOTES-6.3</A>
 | 
			
		||||
 
 | 
			
		||||
@@ -23,9 +23,9 @@
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * DOS/DJGPP device driver for Mesa
 | 
			
		||||
 * DOS/DJGPP device driver v1.7 for Mesa
 | 
			
		||||
 *
 | 
			
		||||
 *  Author: Daniel Borca
 | 
			
		||||
 *  Copyright (C) 2002 - Daniel Borca
 | 
			
		||||
 *  Email : dborca@users.sourceforge.net
 | 
			
		||||
 *  Web   : http://www.geocities.com/dborca
 | 
			
		||||
 */
 | 
			
		||||
@@ -35,7 +35,7 @@
 | 
			
		||||
#define DMESA_H_included
 | 
			
		||||
 | 
			
		||||
#define DMESA_MAJOR_VERSION 6
 | 
			
		||||
#define DMESA_MINOR_VERSION 5
 | 
			
		||||
#define DMESA_MINOR_VERSION 3
 | 
			
		||||
 | 
			
		||||
/* Sample Usage:
 | 
			
		||||
 *
 | 
			
		||||
@@ -138,7 +138,7 @@ void DMesaSetCI (int ndx, GLfloat red, GLfloat green, GLfloat blue);
 | 
			
		||||
/*
 | 
			
		||||
 * DMesa functions
 | 
			
		||||
 */
 | 
			
		||||
typedef void (*DMesaProc) ();
 | 
			
		||||
typedef void (*DMesaProc) (void);
 | 
			
		||||
DMesaProc DMesaGetProcAddress (const char *name);
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
@@ -149,8 +149,8 @@ DMesaProc DMesaGetProcAddress (const char *name);
 | 
			
		||||
#define DMESA_GET_VIDEO_MODES 0x0300
 | 
			
		||||
#define DMESA_GET_BUFFER_ADDR 0x0400
 | 
			
		||||
 | 
			
		||||
#define DMESA_DRIVER_DBL_BIT 0x1 /* double-buffered */
 | 
			
		||||
#define DMESA_DRIVER_YUP_BIT 0x2 /* lower-left window origin */
 | 
			
		||||
#define DMESA_DRIVER_SWDB_BIT 0x1 /* software double-buffered */
 | 
			
		||||
#define DMESA_DRIVER_LLWO_BIT 0x2 /* lower-left window origin */
 | 
			
		||||
int DMesaGetIntegerv (GLenum pname, GLint *params);
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,8 @@
 | 
			
		||||
/*
 | 
			
		||||
 * Mesa 3-D graphics library
 | 
			
		||||
 * Version:  6.5
 | 
			
		||||
 * Version:  6.3
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
 | 
			
		||||
 * Copyright (C) 1999-2005  Brian Paul   All Rights Reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Permission is hereby granted, free of charge, to any person obtaining a
 | 
			
		||||
 * copy of this software and associated documentation files (the "Software"),
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 * Mesa 3-D graphics library
 | 
			
		||||
 * Version:  6.5
 | 
			
		||||
 * 
 | 
			
		||||
 * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
 | 
			
		||||
 * Copyright (C) 1999-2005  Brian Paul   All Rights Reserved.
 | 
			
		||||
 * 
 | 
			
		||||
 * Permission is hereby granted, free of charge, to any person obtaining a
 | 
			
		||||
 * copy of this software and associated documentation files (the "Software"),
 | 
			
		||||
@@ -379,60 +379,6 @@ extern Bool glXDrawableAttribARB(Display *dpy, GLXDrawable draw, const int *attr
 | 
			
		||||
#endif /* GLX_NV_float_buffer */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * #?. GLX_MESA_swap_frame_usage
 | 
			
		||||
 */
 | 
			
		||||
#ifndef GLX_MESA_swap_frame_usage
 | 
			
		||||
#define GLX_MESA_swap_frame_usage 1
 | 
			
		||||
 | 
			
		||||
extern int glXGetFrameUsageMESA(Display *dpy, GLXDrawable drawable, float *usage);
 | 
			
		||||
extern int glXBeginFrameTrackingMESA(Display *dpy, GLXDrawable drawable);
 | 
			
		||||
extern int glXEndFrameTrackingMESA(Display *dpy, GLXDrawable drawable);
 | 
			
		||||
extern int glXQueryFrameTrackingMESA(Display *dpy, GLXDrawable drawable, int64_t *swapCount, int64_t *missedFrames, float *lastMissedUsage);
 | 
			
		||||
 | 
			
		||||
typedef int (*PFNGLXGETFRAMEUSAGEMESAPROC) (Display *dpy, GLXDrawable drawable, float *usage);
 | 
			
		||||
typedef int (*PFNGLXBEGINFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable);
 | 
			
		||||
typedef int (*PFNGLXENDFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable);
 | 
			
		||||
typedef int (*PFNGLXQUERYFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable, int64_t *swapCount, int64_t *missedFrames, float *lastMissedUsage);
 | 
			
		||||
 | 
			
		||||
#endif /* GLX_MESA_swap_frame_usage */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * #?. GLX_MESA_swap_control
 | 
			
		||||
 */
 | 
			
		||||
#ifndef GLX_MESA_swap_control
 | 
			
		||||
#define GLX_MESA_swap_control 1
 | 
			
		||||
 | 
			
		||||
extern int glXSwapIntervalMESA(unsigned int interval);
 | 
			
		||||
extern int glXGetSwapIntervalMESA(void);
 | 
			
		||||
 | 
			
		||||
typedef int (*PFNGLXSWAPINTERVALMESAPROC)(unsigned int interval);
 | 
			
		||||
typedef int (*PFNGLXGETSWAPINTERVALMESAPROC)(void);
 | 
			
		||||
 | 
			
		||||
#endif /* GLX_MESA_swap_control */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * #?. GLX_EXT_texture_from_pixmap
 | 
			
		||||
 * XXX not finished?
 | 
			
		||||
 */
 | 
			
		||||
#ifndef GLX_EXT_texture_from_pixmap
 | 
			
		||||
#define GLX_EXT_texture_from_pixmap 1
 | 
			
		||||
 | 
			
		||||
/* XXX need enums/tokens! */
 | 
			
		||||
 | 
			
		||||
extern Bool glXBindTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer);
 | 
			
		||||
extern Bool glXReleaseTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer);
 | 
			
		||||
 | 
			
		||||
#endif /* GLX_EXT_texture_from_pixmap */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*** Should these go here, or in another header? */
 | 
			
		||||
/*
 | 
			
		||||
** GLX Events
 | 
			
		||||
 
 | 
			
		||||
@@ -331,7 +331,7 @@ typedef struct {
 | 
			
		||||
} GLXBufferClobberEventSGIX;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if defined(__sun__) || defined(__osf__)
 | 
			
		||||
#if defined(__sun__)
 | 
			
		||||
#include <inttypes.h>
 | 
			
		||||
#if defined(__STDC__)
 | 
			
		||||
#if defined(__arch64__)
 | 
			
		||||
 
 | 
			
		||||
@@ -472,14 +472,6 @@ struct __DRIdrawableRec {
 | 
			
		||||
     * \since Internal API version 20030317.
 | 
			
		||||
     */
 | 
			
		||||
    unsigned swap_interval;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Used by drivers that implement the GLX_MESA_copy_sub_buffer extension.
 | 
			
		||||
     *
 | 
			
		||||
     * \since Internal API version 20060314.
 | 
			
		||||
     */
 | 
			
		||||
    void (*copySubBuffer)(__DRInativeDisplay *dpy, void *drawablePrivate,
 | 
			
		||||
			  int x, int y, int w, int h);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -111,15 +111,6 @@ WGLAPI int   GLAPIENTRY DescribePixelFormat(HDC,int,unsigned int,LPPIXELFORMATDE
 | 
			
		||||
WGLAPI int   GLAPIENTRY GetPixelFormat(HDC);
 | 
			
		||||
WGLAPI int   GLAPIENTRY SetPixelFormat(HDC,int,const PIXELFORMATDESCRIPTOR *);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#ifndef WGL_ARB_extensions_string
 | 
			
		||||
#define WGL_ARB_extensions_string 1
 | 
			
		||||
 | 
			
		||||
WGLAPI const char * GLAPIENTRY wglGetExtensionsStringARB(HDC hdc);
 | 
			
		||||
 | 
			
		||||
#endif /* WGL_ARB_extensions_string */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#ifdef _MSC_VER
 | 
			
		||||
#  pragma warning( pop )
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -100,14 +100,15 @@ extern WMesaContext WMesaCreateContext(HDC hDC,HPALETTE* pPal,
 | 
			
		||||
/*
 | 
			
		||||
 * Destroy a rendering context as returned by WMesaCreateContext()
 | 
			
		||||
 */
 | 
			
		||||
extern void WMesaDestroyContext( WMesaContext ctx );
 | 
			
		||||
/*extern void WMesaDestroyContext( WMesaContext ctx );*/
 | 
			
		||||
extern void WMesaDestroyContext( void );
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Make the specified context the current one.
 | 
			
		||||
 */
 | 
			
		||||
extern void WMesaMakeCurrent( WMesaContext ctx, HDC hdc );
 | 
			
		||||
extern void WMesaMakeCurrent( WMesaContext ctx );
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
@@ -120,7 +121,7 @@ extern WMesaContext WMesaGetCurrentContext( void );
 | 
			
		||||
 * Swap the front and back buffers for the current context.  No action
 | 
			
		||||
 * taken if the context is not double buffered.
 | 
			
		||||
 */
 | 
			
		||||
extern void WMesaSwapBuffers(HDC hdc);
 | 
			
		||||
extern void WMesaSwapBuffers(void);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 
 | 
			
		||||
@@ -64,7 +64,6 @@ typedef XColor       XMesaColor;
 | 
			
		||||
 | 
			
		||||
#define XMesaDrawPoint         XDrawPoint
 | 
			
		||||
#define XMesaDrawPoints        XDrawPoints
 | 
			
		||||
#define XMesaDrawLine          XDrawLine
 | 
			
		||||
#define XMesaFillRectangle     XFillRectangle
 | 
			
		||||
#define XMesaPutImage          XPutImage
 | 
			
		||||
#define XMesaCopyArea          XCopyArea
 | 
			
		||||
 
 | 
			
		||||
@@ -95,18 +95,6 @@ do { \
 | 
			
		||||
    (*gc->ops->PolyPoint)(__b, __gc, __m, __n, __p); \
 | 
			
		||||
} while (0)
 | 
			
		||||
 | 
			
		||||
#define XMesaDrawLine(__d, __b, __gc, __x0, __y0, __x1, __y1) \
 | 
			
		||||
do { \
 | 
			
		||||
    XMesaPoint __p[2]; \
 | 
			
		||||
    (void) __d; \
 | 
			
		||||
    __p[0].x = __x0; \
 | 
			
		||||
    __p[0].y = __y0; \
 | 
			
		||||
    __p[1].x = __x1; \
 | 
			
		||||
    __p[1].y = __y1; \
 | 
			
		||||
    ValidateGC(__b, __gc); \
 | 
			
		||||
    (*gc->ops->PolyLines)(__b, __gc, CoordModeOrigin, 2, __p); \
 | 
			
		||||
} while (0)
 | 
			
		||||
 | 
			
		||||
#define XMesaFillRectangle(__d,__b,__gc,__x,__y,__w,__h) \
 | 
			
		||||
do { \
 | 
			
		||||
    xRectangle __r[1]; \
 | 
			
		||||
 
 | 
			
		||||
@@ -64,7 +64,9 @@
 | 
			
		||||
** Versioning and extensions
 | 
			
		||||
*/
 | 
			
		||||
#define EGL_VERSION_1_0		       1
 | 
			
		||||
#if 0
 | 
			
		||||
#define EGL_VERSION_1_1		       1
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
** Boolean
 | 
			
		||||
@@ -267,56 +269,6 @@ GLAPI EGLBoolean APIENTRY eglCopyContextMESA(EGLDisplay dpy, EGLContext source,
 | 
			
		||||
#endif /* EGL_MESA_copy_context */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* XXX this is preliminary! */
 | 
			
		||||
#ifndef EGL_VERSION_1_2
 | 
			
		||||
#define EGL_VERSION_1_2 1
 | 
			
		||||
 | 
			
		||||
typedef int EGLenum;
 | 
			
		||||
typedef int EGLClientBuffer;
 | 
			
		||||
 | 
			
		||||
#define EGL_DISPLAY_SCALING		10000
 | 
			
		||||
#define EGL_UNKNOWN			((EGLint)-1)
 | 
			
		||||
 | 
			
		||||
#define EGL_OPENGL_ES_BIT               0x1
 | 
			
		||||
#define EGL_OPENVG_BIT                  0x2
 | 
			
		||||
 | 
			
		||||
#define EGL_OPENGL_ES_API               0x30A0
 | 
			
		||||
#define EGL_OPENVG_API                  0x30A1
 | 
			
		||||
 | 
			
		||||
#define EGL_LUMINANCE_SIZE		0x303D
 | 
			
		||||
#define EGL_ALPHA_MASK_SIZE		0x303E
 | 
			
		||||
#define EGL_COLOR_BUFFER_TYPE		0x303F
 | 
			
		||||
#define EGL_RENDERABLE_TYPE		0x3040
 | 
			
		||||
 | 
			
		||||
#define EGL_SINGLE_BUFFER		0x3085
 | 
			
		||||
#define EGL_RENDER_BUFFER		0x3086
 | 
			
		||||
#define EGL_COLORSPACE			0x3087
 | 
			
		||||
#define EGL_ALPHA_FORMAT		0x3088
 | 
			
		||||
#define EGL_COLORSPACE_sRGB		0x3089
 | 
			
		||||
#define EGL_COLORSPACE_LINEAR		0x308A
 | 
			
		||||
#define EGL_ALPHA_FORMAT_NONPRE		0x308B
 | 
			
		||||
#define EGL_ALPHA_FORMAT_PRE		0x308C
 | 
			
		||||
#define EGL_CLIENT_APIS			0x308D
 | 
			
		||||
#define EGL_RGB_BUFFER			0x308E
 | 
			
		||||
#define EGL_LUMINANCE_BUFFER		0x308F
 | 
			
		||||
#define EGL_HORIZONTAL_RESOLUTION	0x3090
 | 
			
		||||
#define EGL_VERTICAL_RESOLUTION		0x3091
 | 
			
		||||
#define EGL_PIXEL_ASPECT_RATIO		0x3092
 | 
			
		||||
#define EGL_SWAP_BEHAVIOR		0x3093
 | 
			
		||||
#define EGL_BUFFER_PRESERVED		0x3094
 | 
			
		||||
#define EGL_BUFFER_DESTROYED		0x3095
 | 
			
		||||
#define EGL_OPENVG_IMAGE		0x3096
 | 
			
		||||
#define EGL_CONTEXT_CLIENT_TYPE		0x3097
 | 
			
		||||
 | 
			
		||||
GLAPI EGLBoolean APIENTRY eglBindAPI(EGLenum api);
 | 
			
		||||
GLAPI EGLenum APIENTRY eglQueryAPI(void);
 | 
			
		||||
GLAPI EGLBoolean APIENTRY eglWaitClient(void);
 | 
			
		||||
GLAPI EGLBoolean APIENTRY eglReleaseThread(void);
 | 
			
		||||
GLAPI EGLSurface APIENTRY eglCreatePbufferFromClientBuffer(EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list);
 | 
			
		||||
 | 
			
		||||
#endif /* EGL_VERSION_1_2 */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -31,8 +31,6 @@ readtex.h
 | 
			
		||||
reflect
 | 
			
		||||
renormal
 | 
			
		||||
shadowtex
 | 
			
		||||
showbuffer.c
 | 
			
		||||
showbuffer.h
 | 
			
		||||
spectex
 | 
			
		||||
stex3d
 | 
			
		||||
teapot
 | 
			
		||||
 
 | 
			
		||||
@@ -15,22 +15,22 @@ LIB_DEP = $(LIB_DIR)/$(GL_LIB_NAME) $(LIB_DIR)/$(GLU_LIB_NAME) $(LIB_DIR)/$(GLUT
 | 
			
		||||
 | 
			
		||||
PROGS = \
 | 
			
		||||
	arbfplight \
 | 
			
		||||
	arbfslight \
 | 
			
		||||
	arbocclude \
 | 
			
		||||
	bounce \
 | 
			
		||||
	clearspd \
 | 
			
		||||
	cubemap \
 | 
			
		||||
	drawpix \
 | 
			
		||||
	copypix \
 | 
			
		||||
	drawpix_pbo \
 | 
			
		||||
	fire \
 | 
			
		||||
	fogcoord \
 | 
			
		||||
	fplight \
 | 
			
		||||
	gamma \
 | 
			
		||||
	gearbox \
 | 
			
		||||
	gears \
 | 
			
		||||
	gearbox \
 | 
			
		||||
	geartrain \
 | 
			
		||||
	glinfo \
 | 
			
		||||
	gloss \
 | 
			
		||||
	glslnoise \
 | 
			
		||||
	gltestperf \
 | 
			
		||||
	glutfx \
 | 
			
		||||
	isosurf \
 | 
			
		||||
@@ -54,7 +54,7 @@ PROGS = \
 | 
			
		||||
	terrain \
 | 
			
		||||
	tessdemo \
 | 
			
		||||
	texcyl \
 | 
			
		||||
	texdown \
 | 
			
		||||
	texdown-pool \
 | 
			
		||||
	texenv \
 | 
			
		||||
	texobj \
 | 
			
		||||
	trispd \
 | 
			
		||||
@@ -76,9 +76,8 @@ PROGS = \
 | 
			
		||||
 | 
			
		||||
##### TARGETS #####
 | 
			
		||||
 | 
			
		||||
default: $(PROGS)
 | 
			
		||||
default: readtex.o $(PROGS)
 | 
			
		||||
 | 
			
		||||
$(PROGS): readtex.o
 | 
			
		||||
 | 
			
		||||
readtex.c: $(TOP)/progs/util/readtex.c
 | 
			
		||||
	cp $< .
 | 
			
		||||
 
 | 
			
		||||
@@ -1,118 +0,0 @@
 | 
			
		||||
 | 
			
		||||
# Mesa 3-D graphics library
 | 
			
		||||
# Version:  6.5
 | 
			
		||||
# Copyright (C) 1995-2006  Brian Paul
 | 
			
		||||
 | 
			
		||||
# Makefile for GLUT-based demo programs for Windows
 | 
			
		||||
 | 
			
		||||
# Build the Mesa and GLUT libraries by using the Visual Studio
 | 
			
		||||
# Workspaces in this distribution before running this Makefile.
 | 
			
		||||
 | 
			
		||||
# Invocation:  nmake -f Makefile.win
 | 
			
		||||
 | 
			
		||||
NODEBUG=1
 | 
			
		||||
!include <win32.mak>
 | 
			
		||||
 | 
			
		||||
##### MACROS #####
 | 
			
		||||
 | 
			
		||||
TOP    = ..\..
 | 
			
		||||
INCDIR = ..\..\include
 | 
			
		||||
LIBDIR = ..\..\lib
 | 
			
		||||
LIBS   = GLUT32.LIB OPENGL32.LIB
 | 
			
		||||
 | 
			
		||||
all:	OPENGL32.DLL GLU32.DLL GLUT32.DLL \
 | 
			
		||||
	readtex.h readtex.c showbuffer.h showbuffer.c \
 | 
			
		||||
	arbfplight.exe arbfslight.exe arbocclude.exe bounce.exe \
 | 
			
		||||
	clearspd.exe cubemap.exe drawpix.exe fire.exe fogcoord.exe \
 | 
			
		||||
	fplight.exe gamma.exe gearbox.exe \
 | 
			
		||||
	gears.exe geartrain.exe gloss.exe \
 | 
			
		||||
	glinfo.exe glslnoise.exe \
 | 
			
		||||
	gltestperf.exe glutfx.exe ipers.exe isosurf.exe lodbias.exe \
 | 
			
		||||
	morph3d.exe multiarb.exe occlude.exe paltex.exe pointblast.exe \
 | 
			
		||||
	ray.exe readpix.exe reflect.exe renormal.exe \
 | 
			
		||||
	shadowtex.exe singlebuffer.exe spectex.exe spriteblast.exe \
 | 
			
		||||
	stex3d.exe teapot.exe terrain.exe tessdemo.exe texcyl.exe \
 | 
			
		||||
	texdown.exe texenv.exe texobj.exe trispd.exe tunnel.exe tunnel2.exe \
 | 
			
		||||
	winpos.exe
 | 
			
		||||
 | 
			
		||||
arbfplight.exe: arbfplight.obj
 | 
			
		||||
arbfslight.exe: arbfslight.obj
 | 
			
		||||
arbocclude.exe: arbocclude.obj
 | 
			
		||||
bounce.exe: bounce.obj
 | 
			
		||||
clearspd.exe: clearspd.obj
 | 
			
		||||
cubemap.exe: cubemap.obj readtex.obj
 | 
			
		||||
drawpix.exe: drawpix.obj readtex.obj
 | 
			
		||||
fire.exe: fire.obj readtex.obj
 | 
			
		||||
fogcoord.exe: fogcoord.obj readtex.obj
 | 
			
		||||
fplight.exe: fplight.obj
 | 
			
		||||
gamma.exe: gamma.obj
 | 
			
		||||
gearbox.exe: gearbox.obj
 | 
			
		||||
gears.exe: gears.obj
 | 
			
		||||
geartrain.exe: geartrain.obj
 | 
			
		||||
gloss.exe: gloss.obj readtex.obj
 | 
			
		||||
glinfo.exe: glinfo.obj
 | 
			
		||||
glslnoise.exe: glslnoise.obj
 | 
			
		||||
gltestperf.exe: gltestperf.obj
 | 
			
		||||
glutfx.exe: glutfx.obj
 | 
			
		||||
ipers.exe: ipers.obj readtex.obj
 | 
			
		||||
isosurf.exe: isosurf.obj readtex.obj
 | 
			
		||||
lodbias.exe: lodbias.obj readtex.obj
 | 
			
		||||
morph3d.exe: morph3d.obj
 | 
			
		||||
multiarb.exe: multiarb.obj readtex.obj
 | 
			
		||||
occlude.exe: occlude.obj
 | 
			
		||||
paltex.exe: paltex.obj
 | 
			
		||||
pointblast.exe: pointblast.obj
 | 
			
		||||
ray.exe: ray.obj
 | 
			
		||||
readpix.exe: readpix.obj readtex.obj
 | 
			
		||||
reflect.exe: reflect.obj readtex.obj showbuffer.obj
 | 
			
		||||
renormal.exe: renormal.obj
 | 
			
		||||
shadowtex.exe: shadowtex.obj showbuffer.obj
 | 
			
		||||
singlebuffer.exe: singlebuffer.obj
 | 
			
		||||
spectex.exe: spectex.obj
 | 
			
		||||
spriteblast.exe: spriteblast.obj
 | 
			
		||||
stex3d.exe: stex3d.obj
 | 
			
		||||
teapot.exe: teapot.obj readtex.obj
 | 
			
		||||
terrain.exe: terrain.obj
 | 
			
		||||
tessdemo.exe: tessdemo.obj
 | 
			
		||||
texcyl.exe: texcyl.obj readtex.obj
 | 
			
		||||
texdown.exe: texdown.obj
 | 
			
		||||
texenv.exe: texenv.obj
 | 
			
		||||
texobj.exe: texobj.obj
 | 
			
		||||
trispd.exe: trispd.obj
 | 
			
		||||
tunnel.exe: tunnel.obj readtex.obj
 | 
			
		||||
tunnel2.exe: tunnel2.obj readtex.obj
 | 
			
		||||
winpos.exe: winpos.obj readtex.obj
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
OPENGL32.DLL: $(LIBDIR)\OPENGL32.DLL
 | 
			
		||||
	copy $? .
 | 
			
		||||
 | 
			
		||||
GLU32.DLL: $(LIBDIR)\GLU32.DLL
 | 
			
		||||
	copy $? .
 | 
			
		||||
 | 
			
		||||
GLUT32.DLL: $(LIBDIR)\GLUT32.DLL
 | 
			
		||||
	copy $? .
 | 
			
		||||
 | 
			
		||||
readtex.c: $(TOP)\progs\util\readtex.c
 | 
			
		||||
	copy $** .
 | 
			
		||||
 | 
			
		||||
readtex.h: $(TOP)\progs\util\readtex.h
 | 
			
		||||
	copy $** .
 | 
			
		||||
 | 
			
		||||
showbuffer.c: $(TOP)\progs\util\showbuffer.c
 | 
			
		||||
	copy $** .
 | 
			
		||||
 | 
			
		||||
showbuffer.h: $(TOP)\progs\util\showbuffer.h
 | 
			
		||||
	copy $** .
 | 
			
		||||
 | 
			
		||||
.obj.exe:
 | 
			
		||||
	$(link) $(ldebug) -out:$@ $** /LIBPATH:$(LIBDIR) $(LIBS)
 | 
			
		||||
 | 
			
		||||
.c.obj:
 | 
			
		||||
	$(cc) $(cdebug) $(cflags) $(cvars) /I$(INCDIR) $*.c
 | 
			
		||||
 | 
			
		||||
clean::
 | 
			
		||||
	del *.obj *.exe readtex.* showbuffer.*
 | 
			
		||||
 | 
			
		||||
clobber::
 | 
			
		||||
 | 
			
		||||
@@ -343,7 +343,7 @@ static void Init( void )
 | 
			
		||||
                           (const GLubyte *) vertProgramText);
 | 
			
		||||
   glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorPos);
 | 
			
		||||
   if (glGetError() != GL_NO_ERROR || errorPos != -1) {
 | 
			
		||||
      int l = FindLine(vertProgramText, errorPos);
 | 
			
		||||
      int l = FindLine(fragProgramText, errorPos);
 | 
			
		||||
      printf("Vertex Program Error (pos=%d line=%d): %s\n", errorPos, l,
 | 
			
		||||
             (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
 | 
			
		||||
      exit(0);
 | 
			
		||||
 
 | 
			
		||||
@@ -1,289 +0,0 @@
 | 
			
		||||
/*
 | 
			
		||||
 * Use GL_ARB_fragment_shader and GL_ARB_vertex_shader to implement
 | 
			
		||||
 * simple per-pixel lighting.
 | 
			
		||||
 *
 | 
			
		||||
 * Michal Krol
 | 
			
		||||
 * 20 February 2006
 | 
			
		||||
 *
 | 
			
		||||
 * Based on the original demo by:
 | 
			
		||||
 * Brian Paul
 | 
			
		||||
 * 17 April 2003
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifdef WIN32
 | 
			
		||||
#include <windows.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#include <GL/gl.h>
 | 
			
		||||
#include <GL/glut.h>
 | 
			
		||||
#include <GL/glext.h>
 | 
			
		||||
 | 
			
		||||
#ifdef WIN32
 | 
			
		||||
#define GETPROCADDRESS wglGetProcAddress
 | 
			
		||||
#else
 | 
			
		||||
#define GETPROCADDRESS glutGetProcAddress
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
static GLfloat diffuse[4] = { 0.5f, 0.5f, 1.0f, 1.0f };
 | 
			
		||||
static GLfloat specular[4] = { 0.8f, 0.8f, 0.8f, 1.0f };
 | 
			
		||||
static GLfloat lightPos[4] = { 0.0f, 10.0f, 20.0f, 1.0f };
 | 
			
		||||
static GLfloat delta = 1.0f;
 | 
			
		||||
 | 
			
		||||
static GLhandleARB fragShader;
 | 
			
		||||
static GLhandleARB vertShader;
 | 
			
		||||
static GLhandleARB program;
 | 
			
		||||
 | 
			
		||||
static GLint uLightPos;
 | 
			
		||||
static GLint uDiffuse;
 | 
			
		||||
static GLint uSpecular;
 | 
			
		||||
 | 
			
		||||
static GLboolean anim = GL_TRUE;
 | 
			
		||||
static GLboolean wire = GL_FALSE;
 | 
			
		||||
static GLboolean pixelLight = GL_TRUE;
 | 
			
		||||
 | 
			
		||||
static GLint t0 = 0;
 | 
			
		||||
static GLint frames = 0;
 | 
			
		||||
 | 
			
		||||
static GLfloat xRot = 0.0f, yRot = 0.0f;
 | 
			
		||||
 | 
			
		||||
static PFNGLCREATESHADEROBJECTARBPROC glCreateShaderObjectARB = NULL;
 | 
			
		||||
static PFNGLSHADERSOURCEARBPROC glShaderSourceARB = NULL;
 | 
			
		||||
static PFNGLCOMPILESHADERARBPROC glCompileShaderARB = NULL;
 | 
			
		||||
static PFNGLCREATEPROGRAMOBJECTARBPROC glCreateProgramObjectARB = NULL;
 | 
			
		||||
static PFNGLATTACHOBJECTARBPROC glAttachObjectARB = NULL;
 | 
			
		||||
static PFNGLLINKPROGRAMARBPROC glLinkProgramARB = NULL;
 | 
			
		||||
static PFNGLUSEPROGRAMOBJECTARBPROC glUseProgramObjectARB = NULL;
 | 
			
		||||
static PFNGLGETUNIFORMLOCATIONARBPROC glGetUniformLocationARB = NULL;
 | 
			
		||||
static PFNGLUNIFORM4FVARBPROC glUniform4fvARB = NULL;
 | 
			
		||||
 | 
			
		||||
static void Redisplay (void)
 | 
			
		||||
{
 | 
			
		||||
	glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
 | 
			
		||||
 | 
			
		||||
	if (pixelLight)
 | 
			
		||||
	{
 | 
			
		||||
		glUseProgramObjectARB (program);
 | 
			
		||||
		glUniform4fvARB (uLightPos, 1, lightPos);
 | 
			
		||||
		glDisable(GL_LIGHTING);
 | 
			
		||||
	}
 | 
			
		||||
	else
 | 
			
		||||
	{
 | 
			
		||||
		glUseProgramObjectARB (0);
 | 
			
		||||
		glLightfv (GL_LIGHT0, GL_POSITION, lightPos);
 | 
			
		||||
		glEnable(GL_LIGHTING);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	glPushMatrix ();
 | 
			
		||||
	glRotatef (xRot, 1.0f, 0.0f, 0.0f);
 | 
			
		||||
	glRotatef (yRot, 0.0f, 1.0f, 0.0f);
 | 
			
		||||
	glutSolidSphere (2.0, 10, 5);
 | 
			
		||||
	glPopMatrix ();
 | 
			
		||||
 | 
			
		||||
	glutSwapBuffers();
 | 
			
		||||
	frames++;
 | 
			
		||||
 | 
			
		||||
	if (anim)
 | 
			
		||||
	{
 | 
			
		||||
		GLint t = glutGet (GLUT_ELAPSED_TIME);
 | 
			
		||||
		if (t - t0 >= 5000)
 | 
			
		||||
		{
 | 
			
		||||
			GLfloat seconds = (GLfloat) (t - t0) / 1000.0f;
 | 
			
		||||
			GLfloat fps = frames / seconds;
 | 
			
		||||
			printf ("%d frames in %6.3f seconds = %6.3f FPS\n", frames, seconds, fps);
 | 
			
		||||
			t0 = t;
 | 
			
		||||
			frames = 0;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void Idle (void)
 | 
			
		||||
{
 | 
			
		||||
	lightPos[0] += delta;
 | 
			
		||||
	if (lightPos[0] > 25.0f || lightPos[0] < -25.0f)
 | 
			
		||||
		delta = -delta;
 | 
			
		||||
	glutPostRedisplay ();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void Reshape (int width, int height)
 | 
			
		||||
{
 | 
			
		||||
	glViewport (0, 0, width, height);
 | 
			
		||||
	glMatrixMode (GL_PROJECTION);
 | 
			
		||||
	glLoadIdentity ();
 | 
			
		||||
	glFrustum (-1.0, 1.0, -1.0, 1.0, 5.0, 25.0);
 | 
			
		||||
	glMatrixMode (GL_MODELVIEW);
 | 
			
		||||
	glLoadIdentity ();
 | 
			
		||||
	glTranslatef (0.0f, 0.0f, -15.0f);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void Key (unsigned char key, int x, int y)
 | 
			
		||||
{
 | 
			
		||||
	(void) x;
 | 
			
		||||
	(void) y;
 | 
			
		||||
 | 
			
		||||
	switch (key)
 | 
			
		||||
	{
 | 
			
		||||
	case ' ':
 | 
			
		||||
	case 'a':
 | 
			
		||||
		anim = !anim;
 | 
			
		||||
		if (anim)
 | 
			
		||||
			glutIdleFunc (Idle);
 | 
			
		||||
		else
 | 
			
		||||
			glutIdleFunc (NULL);
 | 
			
		||||
		break;
 | 
			
		||||
	case 'x':
 | 
			
		||||
		lightPos[0] -= 1.0f;
 | 
			
		||||
		break;
 | 
			
		||||
	case 'X':
 | 
			
		||||
		lightPos[0] += 1.0f;
 | 
			
		||||
		break;
 | 
			
		||||
	case 'w':
 | 
			
		||||
		wire = !wire;
 | 
			
		||||
		if (wire)
 | 
			
		||||
			glPolygonMode (GL_FRONT_AND_BACK, GL_LINE);
 | 
			
		||||
		else
 | 
			
		||||
			glPolygonMode (GL_FRONT_AND_BACK, GL_FILL);
 | 
			
		||||
		break;
 | 
			
		||||
	case 'p':
 | 
			
		||||
		pixelLight = !pixelLight;
 | 
			
		||||
		if (pixelLight)
 | 
			
		||||
			printf ("Per-pixel lighting\n");
 | 
			
		||||
		else
 | 
			
		||||
			printf ("Conventional lighting\n");
 | 
			
		||||
		break;
 | 
			
		||||
	case 27:
 | 
			
		||||
		exit(0);
 | 
			
		||||
		break;
 | 
			
		||||
	}
 | 
			
		||||
	glutPostRedisplay ();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void SpecialKey (int key, int x, int y)
 | 
			
		||||
{
 | 
			
		||||
	const GLfloat step = 3.0f;
 | 
			
		||||
 | 
			
		||||
	(void) x;
 | 
			
		||||
	(void) y;
 | 
			
		||||
 | 
			
		||||
	switch (key)
 | 
			
		||||
	{
 | 
			
		||||
	case GLUT_KEY_UP:
 | 
			
		||||
		xRot -= step;
 | 
			
		||||
		break;
 | 
			
		||||
	case GLUT_KEY_DOWN:
 | 
			
		||||
		xRot += step;
 | 
			
		||||
		break;
 | 
			
		||||
	case GLUT_KEY_LEFT:
 | 
			
		||||
		yRot -= step;
 | 
			
		||||
		break;
 | 
			
		||||
	case GLUT_KEY_RIGHT:
 | 
			
		||||
		yRot += step;
 | 
			
		||||
		break;
 | 
			
		||||
	}
 | 
			
		||||
	glutPostRedisplay ();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void Init (void)
 | 
			
		||||
{
 | 
			
		||||
	static const char *fragShaderText =
 | 
			
		||||
		"uniform vec4 lightPos;\n"
 | 
			
		||||
		"uniform vec4 diffuse;\n"
 | 
			
		||||
		"uniform vec4 specular;\n"
 | 
			
		||||
		"void main () {\n"
 | 
			
		||||
		"	// Compute dot product of light direction and normal vector\n"
 | 
			
		||||
		"	float dotProd;\n"
 | 
			
		||||
		"	dotProd = clamp (dot (normalize (lightPos).xyz, normalize (gl_TexCoord[0]).xyz), 0.0, 1.0);\n"
 | 
			
		||||
		"	// Compute diffuse and specular contributions\n"
 | 
			
		||||
		"	gl_FragColor = diffuse * dotProd + specular * pow (dotProd, 20.0);\n"
 | 
			
		||||
		"}\n"
 | 
			
		||||
	;
 | 
			
		||||
	static const char *vertShaderText =
 | 
			
		||||
		"void main () {\n"
 | 
			
		||||
		"	gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n"
 | 
			
		||||
		"	gl_TexCoord[0] = vec4 (gl_NormalMatrix * gl_Normal, 1.0);\n"
 | 
			
		||||
		"}\n"
 | 
			
		||||
	;
 | 
			
		||||
 | 
			
		||||
	if (!glutExtensionSupported ("GL_ARB_fragment_shader"))
 | 
			
		||||
	{
 | 
			
		||||
		printf ("Sorry, this demo requires GL_ARB_fragment_shader\n");
 | 
			
		||||
		exit(1);
 | 
			
		||||
	}
 | 
			
		||||
	if (!glutExtensionSupported ("GL_ARB_shader_objects"))
 | 
			
		||||
	{
 | 
			
		||||
		printf ("Sorry, this demo requires GL_ARB_shader_objects\n");
 | 
			
		||||
		exit(1);
 | 
			
		||||
	}
 | 
			
		||||
	if (!glutExtensionSupported ("GL_ARB_shading_language_100"))
 | 
			
		||||
	{
 | 
			
		||||
		printf ("Sorry, this demo requires GL_ARB_shading_language_100\n");
 | 
			
		||||
		exit(1);
 | 
			
		||||
	}
 | 
			
		||||
	if (!glutExtensionSupported ("GL_ARB_vertex_shader"))
 | 
			
		||||
	{
 | 
			
		||||
		printf ("Sorry, this demo requires GL_ARB_vertex_shader\n");
 | 
			
		||||
		exit(1);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	glCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC) GETPROCADDRESS ("glCreateShaderObjectARB");
 | 
			
		||||
	glShaderSourceARB = (PFNGLSHADERSOURCEARBPROC) GETPROCADDRESS ("glShaderSourceARB");
 | 
			
		||||
	glCompileShaderARB = (PFNGLCOMPILESHADERARBPROC) GETPROCADDRESS ("glCompileShaderARB");
 | 
			
		||||
	glCreateProgramObjectARB = (PFNGLCREATEPROGRAMOBJECTARBPROC) GETPROCADDRESS ("glCreateProgramObjectARB");
 | 
			
		||||
	glAttachObjectARB = (PFNGLATTACHOBJECTARBPROC) GETPROCADDRESS ("glAttachObjectARB");
 | 
			
		||||
	glLinkProgramARB = (PFNGLLINKPROGRAMARBPROC) GETPROCADDRESS ("glLinkProgramARB");
 | 
			
		||||
	glUseProgramObjectARB = (PFNGLUSEPROGRAMOBJECTARBPROC) GETPROCADDRESS ("glUseProgramObjectARB");
 | 
			
		||||
	glGetUniformLocationARB = (PFNGLGETUNIFORMLOCATIONARBPROC) GETPROCADDRESS ("glGetUniformLocationARB");
 | 
			
		||||
	glUniform4fvARB = (PFNGLUNIFORM4FVARBPROC) GETPROCADDRESS ("glUniform4fvARB");
 | 
			
		||||
 | 
			
		||||
	fragShader = glCreateShaderObjectARB (GL_FRAGMENT_SHADER_ARB);
 | 
			
		||||
	glShaderSourceARB (fragShader, 1, &fragShaderText, NULL);
 | 
			
		||||
	glCompileShaderARB (fragShader);
 | 
			
		||||
 | 
			
		||||
	vertShader = glCreateShaderObjectARB (GL_VERTEX_SHADER_ARB);
 | 
			
		||||
	glShaderSourceARB (vertShader, 1, &vertShaderText, NULL);
 | 
			
		||||
	glCompileShaderARB (vertShader);
 | 
			
		||||
 | 
			
		||||
	program = glCreateProgramObjectARB ();
 | 
			
		||||
	glAttachObjectARB (program, fragShader);
 | 
			
		||||
	glAttachObjectARB (program, vertShader);
 | 
			
		||||
	glLinkProgramARB (program);
 | 
			
		||||
	glUseProgramObjectARB (program);
 | 
			
		||||
 | 
			
		||||
	uLightPos = glGetUniformLocationARB (program, "lightPos");
 | 
			
		||||
	uDiffuse = glGetUniformLocationARB (program, "diffuse");
 | 
			
		||||
	uSpecular = glGetUniformLocationARB (program, "specular");
 | 
			
		||||
 | 
			
		||||
	glUniform4fvARB (uDiffuse, 1, diffuse);
 | 
			
		||||
	glUniform4fvARB (uSpecular, 1, specular);
 | 
			
		||||
 | 
			
		||||
	glClearColor (0.3f, 0.3f, 0.3f, 0.0f);
 | 
			
		||||
	glEnable (GL_DEPTH_TEST);
 | 
			
		||||
	glEnable (GL_LIGHT0);
 | 
			
		||||
	glEnable (GL_LIGHTING);
 | 
			
		||||
	glMaterialfv (GL_FRONT_AND_BACK, GL_DIFFUSE, diffuse);
 | 
			
		||||
	glMaterialfv (GL_FRONT_AND_BACK, GL_SPECULAR, specular);
 | 
			
		||||
	glMaterialf (GL_FRONT_AND_BACK, GL_SHININESS, 20.0f);
 | 
			
		||||
 | 
			
		||||
	printf ("GL_RENDERER = %s\n", (const char *) glGetString (GL_RENDERER));
 | 
			
		||||
	printf ("Press p to toggle between per-pixel and per-vertex lighting\n");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int main (int argc, char *argv[])
 | 
			
		||||
{
 | 
			
		||||
	glutInit (&argc, argv);
 | 
			
		||||
	glutInitWindowPosition ( 0, 0);
 | 
			
		||||
	glutInitWindowSize (200, 200);
 | 
			
		||||
	glutInitDisplayMode (GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
 | 
			
		||||
	glutCreateWindow (argv[0]);
 | 
			
		||||
	glutReshapeFunc (Reshape);
 | 
			
		||||
	glutKeyboardFunc (Key);
 | 
			
		||||
	glutSpecialFunc (SpecialKey);
 | 
			
		||||
	glutDisplayFunc (Redisplay);
 | 
			
		||||
	if (anim)
 | 
			
		||||
		glutIdleFunc (Idle);
 | 
			
		||||
	Init ();
 | 
			
		||||
	glutMainLoop ();
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -14,6 +14,8 @@
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#include <string.h>
 | 
			
		||||
#include <GL/glut.h>
 | 
			
		||||
#include <sys/time.h>
 | 
			
		||||
#include <time.h>
 | 
			
		||||
 | 
			
		||||
#define COS(X)   cos( (X) * 3.14159/180.0 )
 | 
			
		||||
#define SIN(X)   sin( (X) * 3.14159/180.0 )
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										364
									
								
								progs/demos/copypix.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										364
									
								
								progs/demos/copypix.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,364 @@
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * glDrawPixels demo/test/benchmark
 | 
			
		||||
 * 
 | 
			
		||||
 * Brian Paul   September 25, 1997  This file is in the public domain.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#include <math.h>
 | 
			
		||||
#include <string.h>
 | 
			
		||||
#include <GL/glut.h>
 | 
			
		||||
 | 
			
		||||
#include "readtex.h"
 | 
			
		||||
 | 
			
		||||
#define IMAGE_FILE "../images/girl.rgb"
 | 
			
		||||
 | 
			
		||||
static int ImgWidth, ImgHeight;
 | 
			
		||||
static GLenum ImgFormat;
 | 
			
		||||
static GLubyte *Image = NULL;
 | 
			
		||||
 | 
			
		||||
static int Xpos, Ypos;
 | 
			
		||||
static int SkipPixels, SkipRows;
 | 
			
		||||
static int DrawWidth, DrawHeight;
 | 
			
		||||
static int Scissor = 0;
 | 
			
		||||
static int Fog = 0;
 | 
			
		||||
static GLfloat Zpos = -1.0;
 | 
			
		||||
static float Xzoom, Yzoom;
 | 
			
		||||
static GLboolean DrawFront = GL_FALSE;
 | 
			
		||||
static GLboolean Dither = GL_TRUE;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static void Reset( void )
 | 
			
		||||
{
 | 
			
		||||
   Xpos = Ypos = 20;
 | 
			
		||||
   DrawWidth = ImgWidth;
 | 
			
		||||
   DrawHeight = ImgHeight;
 | 
			
		||||
   SkipPixels = SkipRows = 0;
 | 
			
		||||
   Scissor = 0;
 | 
			
		||||
   Fog = 0;
 | 
			
		||||
   Zpos = -1.0;
 | 
			
		||||
   Xzoom = Yzoom = 1.0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static void Display( void )
 | 
			
		||||
{
 | 
			
		||||
   glClear( GL_COLOR_BUFFER_BIT );
 | 
			
		||||
 | 
			
		||||
   glRasterPos2i(10, 10);
 | 
			
		||||
   glPixelZoom( 1, 1 );
 | 
			
		||||
   glDisable(GL_SCISSOR_TEST);
 | 
			
		||||
   glDisable(GL_FOG);
 | 
			
		||||
   glDrawPixels(ImgWidth, ImgHeight, ImgFormat, GL_UNSIGNED_BYTE, Image);
 | 
			
		||||
 | 
			
		||||
#if 0
 | 
			
		||||
   glRasterPos2i(Xpos, Ypos);
 | 
			
		||||
#else
 | 
			
		||||
   /* This allows negative raster positions: */
 | 
			
		||||
   glRasterPos3f(0, 0, Zpos);
 | 
			
		||||
   glBitmap(0, 0, 0, 0, Xpos, Ypos, NULL);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
   glPixelStorei(GL_UNPACK_SKIP_PIXELS, SkipPixels);
 | 
			
		||||
   glPixelStorei(GL_UNPACK_SKIP_ROWS, SkipRows);
 | 
			
		||||
 | 
			
		||||
   glPixelZoom( Xzoom, Yzoom );
 | 
			
		||||
 | 
			
		||||
   if (Scissor)
 | 
			
		||||
      glEnable(GL_SCISSOR_TEST);
 | 
			
		||||
 | 
			
		||||
   if (Fog)
 | 
			
		||||
      glEnable(GL_FOG);
 | 
			
		||||
 | 
			
		||||
   glCopyPixels(10, 10, ImgWidth, ImgHeight, GL_COLOR);
 | 
			
		||||
 | 
			
		||||
   glDisable(GL_SCISSOR_TEST);
 | 
			
		||||
   glDisable(GL_FOG);
 | 
			
		||||
 | 
			
		||||
   if (DrawFront)
 | 
			
		||||
      glFinish();
 | 
			
		||||
   else
 | 
			
		||||
      glutSwapBuffers();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static void Benchmark( void )
 | 
			
		||||
{
 | 
			
		||||
   int startTime, endTime;
 | 
			
		||||
   int draws = 500;
 | 
			
		||||
   double seconds, pixelsPerSecond;
 | 
			
		||||
 | 
			
		||||
   printf("Benchmarking...\n");
 | 
			
		||||
   /* GL set-up */
 | 
			
		||||
   glPixelStorei(GL_UNPACK_SKIP_PIXELS, SkipPixels);
 | 
			
		||||
   glPixelStorei(GL_UNPACK_SKIP_ROWS, SkipRows);
 | 
			
		||||
   glPixelZoom( Xzoom, Yzoom );
 | 
			
		||||
   if (Scissor)
 | 
			
		||||
      glEnable(GL_SCISSOR_TEST);
 | 
			
		||||
   if (Fog)
 | 
			
		||||
      glEnable(GL_FOG);
 | 
			
		||||
 | 
			
		||||
   if (DrawFront)
 | 
			
		||||
      glDrawBuffer(GL_FRONT);
 | 
			
		||||
   else
 | 
			
		||||
      glDrawBuffer(GL_BACK);
 | 
			
		||||
 | 
			
		||||
   /* Run timing test */
 | 
			
		||||
   draws = 0;
 | 
			
		||||
   startTime = glutGet(GLUT_ELAPSED_TIME);
 | 
			
		||||
   do {
 | 
			
		||||
      glCopyPixels(10, 10, ImgWidth, ImgHeight, GL_COLOR);
 | 
			
		||||
      draws++;
 | 
			
		||||
      endTime = glutGet(GLUT_ELAPSED_TIME);
 | 
			
		||||
   } while (endTime - startTime < 4000);   /* 4 seconds */
 | 
			
		||||
 | 
			
		||||
   /* GL clean-up */
 | 
			
		||||
   glDisable(GL_SCISSOR_TEST);
 | 
			
		||||
   glDisable(GL_FOG);
 | 
			
		||||
 | 
			
		||||
   /* Results */
 | 
			
		||||
   seconds = (double) (endTime - startTime) / 1000.0;
 | 
			
		||||
   pixelsPerSecond = draws * DrawWidth * DrawHeight / seconds;
 | 
			
		||||
   printf("Result:  %d draws in %f seconds = %f pixels/sec\n",
 | 
			
		||||
          draws, seconds, pixelsPerSecond);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static void Reshape( int width, int height )
 | 
			
		||||
{
 | 
			
		||||
   glViewport( 0, 0, width, height );
 | 
			
		||||
   glMatrixMode( GL_PROJECTION );
 | 
			
		||||
   glLoadIdentity();
 | 
			
		||||
   glOrtho( 0.0, width, 0.0, height, 0.0, 2.0 );
 | 
			
		||||
   glMatrixMode( GL_MODELVIEW );
 | 
			
		||||
   glLoadIdentity();
 | 
			
		||||
 | 
			
		||||
   glScissor(width/4, height/4, width/2, height/2);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static void Key( unsigned char key, int x, int y )
 | 
			
		||||
{
 | 
			
		||||
   (void) x;
 | 
			
		||||
   (void) y;
 | 
			
		||||
   switch (key) {
 | 
			
		||||
      case ' ':
 | 
			
		||||
         Reset();
 | 
			
		||||
         break;
 | 
			
		||||
      case 'd':
 | 
			
		||||
         Dither = !Dither;
 | 
			
		||||
         if (Dither)
 | 
			
		||||
            glEnable(GL_DITHER);
 | 
			
		||||
         else
 | 
			
		||||
            glDisable(GL_DITHER);
 | 
			
		||||
         break;
 | 
			
		||||
      case 'w':
 | 
			
		||||
         if (DrawWidth > 0)
 | 
			
		||||
            DrawWidth--;
 | 
			
		||||
         break;
 | 
			
		||||
      case 'W':
 | 
			
		||||
         DrawWidth++;
 | 
			
		||||
         break;
 | 
			
		||||
      case 'h':
 | 
			
		||||
         if (DrawHeight > 0)
 | 
			
		||||
            DrawHeight--;
 | 
			
		||||
         break;
 | 
			
		||||
      case 'H':
 | 
			
		||||
         DrawHeight++;
 | 
			
		||||
         break;
 | 
			
		||||
      case 'p':
 | 
			
		||||
         if (SkipPixels > 0)
 | 
			
		||||
             SkipPixels--;
 | 
			
		||||
         break;
 | 
			
		||||
      case 'P':
 | 
			
		||||
         SkipPixels++;
 | 
			
		||||
         break;
 | 
			
		||||
      case 'r':
 | 
			
		||||
         if (SkipRows > 0)
 | 
			
		||||
             SkipRows--;
 | 
			
		||||
         break;
 | 
			
		||||
      case 'R':
 | 
			
		||||
         SkipRows++;
 | 
			
		||||
         break;
 | 
			
		||||
      case 's':
 | 
			
		||||
         Scissor = !Scissor;
 | 
			
		||||
         break;
 | 
			
		||||
      case 'x':
 | 
			
		||||
         Xzoom -= 0.1;
 | 
			
		||||
         break;
 | 
			
		||||
      case 'X':
 | 
			
		||||
         Xzoom += 0.1;
 | 
			
		||||
         break;
 | 
			
		||||
      case 'y':
 | 
			
		||||
         Yzoom -= 0.1;
 | 
			
		||||
         break;
 | 
			
		||||
      case 'Y':
 | 
			
		||||
         Yzoom += 0.1;
 | 
			
		||||
         break;
 | 
			
		||||
      case 'z':
 | 
			
		||||
         Zpos -= 0.1;
 | 
			
		||||
         printf("RasterPos Z = %g\n", Zpos);
 | 
			
		||||
         break;
 | 
			
		||||
      case 'Z':
 | 
			
		||||
         Zpos += 0.1;
 | 
			
		||||
         printf("RasterPos Z = %g\n", Zpos);
 | 
			
		||||
         break;
 | 
			
		||||
      case 'b':
 | 
			
		||||
         Benchmark();
 | 
			
		||||
         break;
 | 
			
		||||
      case 'F':
 | 
			
		||||
         Fog = !Fog;
 | 
			
		||||
         printf("Fog %d\n", Fog);
 | 
			
		||||
         break;
 | 
			
		||||
      case 'f':
 | 
			
		||||
         DrawFront = !DrawFront;
 | 
			
		||||
         if (DrawFront)
 | 
			
		||||
            glDrawBuffer(GL_FRONT);
 | 
			
		||||
         else
 | 
			
		||||
            glDrawBuffer(GL_BACK);
 | 
			
		||||
         printf("glDrawBuffer(%s)\n", DrawFront ? "GL_FRONT" : "GL_BACK");
 | 
			
		||||
         break;
 | 
			
		||||
      case 27:
 | 
			
		||||
         exit(0);
 | 
			
		||||
         break;
 | 
			
		||||
   }
 | 
			
		||||
   glutPostRedisplay();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static void SpecialKey( int key, int x, int y )
 | 
			
		||||
{
 | 
			
		||||
   (void) x;
 | 
			
		||||
   (void) y;
 | 
			
		||||
   switch (key) {
 | 
			
		||||
      case GLUT_KEY_UP:
 | 
			
		||||
         Ypos += 1;
 | 
			
		||||
         break;
 | 
			
		||||
      case GLUT_KEY_DOWN:
 | 
			
		||||
         Ypos -= 1;
 | 
			
		||||
         break;
 | 
			
		||||
      case GLUT_KEY_LEFT:
 | 
			
		||||
         Xpos -= 1;
 | 
			
		||||
         break;
 | 
			
		||||
      case GLUT_KEY_RIGHT:
 | 
			
		||||
         Xpos += 1;
 | 
			
		||||
         break;
 | 
			
		||||
   }
 | 
			
		||||
   glutPostRedisplay();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static void Init( GLboolean ciMode, const char *filename )
 | 
			
		||||
{
 | 
			
		||||
   static const GLfloat fogColor[4] = {0, 1, 0, 0};
 | 
			
		||||
 | 
			
		||||
   printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
 | 
			
		||||
   printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
 | 
			
		||||
 | 
			
		||||
   Image = LoadRGBImage( filename, &ImgWidth, &ImgHeight, &ImgFormat );
 | 
			
		||||
   if (!Image) {
 | 
			
		||||
      printf("Couldn't read %s\n", filename);
 | 
			
		||||
      exit(0);
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   if (ciMode) {
 | 
			
		||||
      /* Convert RGB image to grayscale */
 | 
			
		||||
      GLubyte *indexImage = (GLubyte *) malloc( ImgWidth * ImgHeight );
 | 
			
		||||
      GLint i;
 | 
			
		||||
      for (i=0; i<ImgWidth*ImgHeight; i++) {
 | 
			
		||||
         int gray = Image[i*3] + Image[i*3+1] + Image[i*3+2];
 | 
			
		||||
         indexImage[i] = gray / 3;
 | 
			
		||||
      }
 | 
			
		||||
      free(Image);
 | 
			
		||||
      Image = indexImage;
 | 
			
		||||
      ImgFormat = GL_COLOR_INDEX;
 | 
			
		||||
 | 
			
		||||
      for (i=0;i<255;i++) {
 | 
			
		||||
         float g = i / 255.0;
 | 
			
		||||
         glutSetColor(i, g, g, g);
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   printf("Loaded %d by %d image\n", ImgWidth, ImgHeight );
 | 
			
		||||
 | 
			
		||||
   glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
 | 
			
		||||
   glPixelStorei(GL_UNPACK_ROW_LENGTH, ImgWidth);
 | 
			
		||||
 | 
			
		||||
   glFogi(GL_FOG_MODE, GL_LINEAR);
 | 
			
		||||
   glFogf(GL_FOG_START, 0);
 | 
			
		||||
   glFogf(GL_FOG_END, 2);
 | 
			
		||||
   glFogfv(GL_FOG_COLOR, fogColor);
 | 
			
		||||
 | 
			
		||||
   Reset();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static void Usage(void)
 | 
			
		||||
{
 | 
			
		||||
   printf("Keys:\n");
 | 
			
		||||
   printf("       SPACE  Reset Parameters\n");
 | 
			
		||||
   printf("     Up/Down  Move image up/down\n");
 | 
			
		||||
   printf("  Left/Right  Move image left/right\n");
 | 
			
		||||
   printf("           x  Decrease X-axis PixelZoom\n");
 | 
			
		||||
   printf("           X  Increase X-axis PixelZoom\n");
 | 
			
		||||
   printf("           y  Decrease Y-axis PixelZoom\n");
 | 
			
		||||
   printf("           Y  Increase Y-axis PixelZoom\n");
 | 
			
		||||
   printf("           w  Decrease glDrawPixels width*\n");
 | 
			
		||||
   printf("           W  Increase glDrawPixels width*\n");
 | 
			
		||||
   printf("           h  Decrease glDrawPixels height*\n");
 | 
			
		||||
   printf("           H  Increase glDrawPixels height*\n");
 | 
			
		||||
   printf("           p  Decrease GL_UNPACK_SKIP_PIXELS*\n");
 | 
			
		||||
   printf("           P  Increase GL_UNPACK_SKIP_PIXELS*\n");
 | 
			
		||||
   printf("           r  Decrease GL_UNPACK_SKIP_ROWS*\n");
 | 
			
		||||
   printf("           R  Increase GL_UNPACK_SKIP_ROWS*\n");
 | 
			
		||||
   printf("           s  Toggle GL_SCISSOR_TEST\n");
 | 
			
		||||
   printf("           F  Toggle GL_FOG\n");
 | 
			
		||||
   printf("           z  Decrease RasterPos Z\n");
 | 
			
		||||
   printf("           Z  Increase RasterPos Z\n");
 | 
			
		||||
   
 | 
			
		||||
   printf("           f  Toggle front/back buffer drawing\n");
 | 
			
		||||
   printf("           b  Benchmark test\n");
 | 
			
		||||
   printf("         ESC  Exit\n");
 | 
			
		||||
   printf("* Warning: no limits are imposed on these parameters so it's\n");
 | 
			
		||||
   printf("  possible to cause a segfault if you go too far.\n");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
int main( int argc, char *argv[] )
 | 
			
		||||
{
 | 
			
		||||
   GLboolean ciMode = GL_FALSE;
 | 
			
		||||
   const char *filename = IMAGE_FILE;
 | 
			
		||||
   int i = 1;
 | 
			
		||||
 | 
			
		||||
   if (argc > i && strcmp(argv[i], "-ci")==0) {
 | 
			
		||||
      ciMode = GL_TRUE;
 | 
			
		||||
      i++;
 | 
			
		||||
   }
 | 
			
		||||
   if (argc > i) {
 | 
			
		||||
      filename = argv[i];
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   glutInit( &argc, argv );
 | 
			
		||||
   glutInitWindowPosition( 0, 0 );
 | 
			
		||||
   glutInitWindowSize( 500, 400 );
 | 
			
		||||
 | 
			
		||||
   if (ciMode)
 | 
			
		||||
      glutInitDisplayMode( GLUT_INDEX | GLUT_DOUBLE );
 | 
			
		||||
   else
 | 
			
		||||
      glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE);
 | 
			
		||||
 | 
			
		||||
   glutCreateWindow(argv[0]);
 | 
			
		||||
 | 
			
		||||
   Init(ciMode, filename);
 | 
			
		||||
   Usage();
 | 
			
		||||
 | 
			
		||||
   glutReshapeFunc( Reshape );
 | 
			
		||||
   glutKeyboardFunc( Key );
 | 
			
		||||
   glutSpecialFunc( SpecialKey );
 | 
			
		||||
   glutDisplayFunc( Display );
 | 
			
		||||
 | 
			
		||||
   glutMainLoop();
 | 
			
		||||
   return 0;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										376
									
								
								progs/demos/drawpix_pbo.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										376
									
								
								progs/demos/drawpix_pbo.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,376 @@
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * glDrawPixels demo/test/benchmark
 | 
			
		||||
 * 
 | 
			
		||||
 * Brian Paul   September 25, 1997  This file is in the public domain.
 | 
			
		||||
 */
 | 
			
		||||
#define GL_GLEXT_PROTOTYPES
 | 
			
		||||
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#include <math.h>
 | 
			
		||||
#include <string.h>
 | 
			
		||||
#include <GL/glut.h>
 | 
			
		||||
 | 
			
		||||
#include "readtex.h"
 | 
			
		||||
 | 
			
		||||
#define IMAGE_FILE "../images/tree2.rgba"
 | 
			
		||||
 | 
			
		||||
static int ImgWidth, ImgHeight;
 | 
			
		||||
static GLenum ImgFormat;
 | 
			
		||||
static GLenum ImgType = GL_UNSIGNED_BYTE;
 | 
			
		||||
static GLubyte *Image = NULL;
 | 
			
		||||
 | 
			
		||||
static int Xpos, Ypos;
 | 
			
		||||
static int SkipPixels, SkipRows;
 | 
			
		||||
static int DrawWidth, DrawHeight;
 | 
			
		||||
static int Scissor = 0;
 | 
			
		||||
static int Fog = 0;
 | 
			
		||||
static GLfloat Zpos = -1.0;
 | 
			
		||||
static float Xzoom, Yzoom;
 | 
			
		||||
static GLboolean DrawFront = GL_FALSE;
 | 
			
		||||
static GLboolean Dither = GL_TRUE;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static GLuint DrawPBO;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static void Reset( void )
 | 
			
		||||
{
 | 
			
		||||
   Xpos = Ypos = 20;
 | 
			
		||||
   DrawWidth = ImgWidth;
 | 
			
		||||
   DrawHeight = ImgHeight;
 | 
			
		||||
   SkipPixels = SkipRows = 0;
 | 
			
		||||
   Scissor = 0;
 | 
			
		||||
   Fog = 0;
 | 
			
		||||
   Zpos = -1.0;
 | 
			
		||||
   Xzoom = Yzoom = 1.0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static void Display( void )
 | 
			
		||||
{
 | 
			
		||||
   glClear( GL_COLOR_BUFFER_BIT );
 | 
			
		||||
 | 
			
		||||
#if 0
 | 
			
		||||
   glRasterPos2i(Xpos, Ypos);
 | 
			
		||||
#else
 | 
			
		||||
   /* This allows negative raster positions: */
 | 
			
		||||
   glRasterPos3f(0, 0, Zpos);
 | 
			
		||||
   glBitmap(0, 0, 0, 0, Xpos, Ypos, NULL);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
   glPixelStorei(GL_UNPACK_SKIP_PIXELS, SkipPixels);
 | 
			
		||||
   glPixelStorei(GL_UNPACK_SKIP_ROWS, SkipRows);
 | 
			
		||||
 | 
			
		||||
   glPixelZoom( Xzoom, Yzoom );
 | 
			
		||||
 | 
			
		||||
   if (Scissor)
 | 
			
		||||
      glEnable(GL_SCISSOR_TEST);
 | 
			
		||||
 | 
			
		||||
   if (Fog)
 | 
			
		||||
      glEnable(GL_FOG);
 | 
			
		||||
 | 
			
		||||
   /*** Draw from the DrawPBO */
 | 
			
		||||
   glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, DrawPBO);
 | 
			
		||||
   glDrawPixels(DrawWidth, DrawHeight, ImgFormat, ImgType, NULL);
 | 
			
		||||
   glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, 0);
 | 
			
		||||
 | 
			
		||||
   glDisable(GL_SCISSOR_TEST);
 | 
			
		||||
   glDisable(GL_FOG);
 | 
			
		||||
 | 
			
		||||
   if (DrawFront)
 | 
			
		||||
      glFinish();
 | 
			
		||||
   else
 | 
			
		||||
      glutSwapBuffers();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static void Benchmark( void )
 | 
			
		||||
{
 | 
			
		||||
   int startTime, endTime;
 | 
			
		||||
   int draws = 500;
 | 
			
		||||
   double seconds, pixelsPerSecond;
 | 
			
		||||
 | 
			
		||||
   printf("Benchmarking...\n");
 | 
			
		||||
   /* GL set-up */
 | 
			
		||||
   glPixelStorei(GL_UNPACK_SKIP_PIXELS, SkipPixels);
 | 
			
		||||
   glPixelStorei(GL_UNPACK_SKIP_ROWS, SkipRows);
 | 
			
		||||
   glPixelZoom( Xzoom, Yzoom );
 | 
			
		||||
   if (Scissor)
 | 
			
		||||
      glEnable(GL_SCISSOR_TEST);
 | 
			
		||||
   if (Fog)
 | 
			
		||||
      glEnable(GL_FOG);
 | 
			
		||||
 | 
			
		||||
   if (DrawFront)
 | 
			
		||||
      glDrawBuffer(GL_FRONT);
 | 
			
		||||
   else
 | 
			
		||||
      glDrawBuffer(GL_BACK);
 | 
			
		||||
 | 
			
		||||
   /* Run timing test */
 | 
			
		||||
   draws = 0;
 | 
			
		||||
   startTime = glutGet(GLUT_ELAPSED_TIME);
 | 
			
		||||
   do {
 | 
			
		||||
      glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, DrawPBO);
 | 
			
		||||
      glDrawPixels(DrawWidth, DrawHeight, ImgFormat, ImgType, NULL);
 | 
			
		||||
      glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, 0);
 | 
			
		||||
      draws++;
 | 
			
		||||
      endTime = glutGet(GLUT_ELAPSED_TIME);
 | 
			
		||||
   } while (endTime - startTime < 4000);   /* 4 seconds */
 | 
			
		||||
 | 
			
		||||
   /* GL clean-up */
 | 
			
		||||
   glDisable(GL_SCISSOR_TEST);
 | 
			
		||||
   glDisable(GL_FOG);
 | 
			
		||||
 | 
			
		||||
   /* Results */
 | 
			
		||||
   seconds = (double) (endTime - startTime) / 1000.0;
 | 
			
		||||
   pixelsPerSecond = draws * DrawWidth * DrawHeight / seconds;
 | 
			
		||||
   printf("Result:  %d draws in %f seconds = %f pixels/sec\n",
 | 
			
		||||
          draws, seconds, pixelsPerSecond);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static void Reshape( int width, int height )
 | 
			
		||||
{
 | 
			
		||||
   glViewport( 0, 0, width, height );
 | 
			
		||||
   glMatrixMode( GL_PROJECTION );
 | 
			
		||||
   glLoadIdentity();
 | 
			
		||||
   glOrtho( 0.0, width, 0.0, height, 0.0, 2.0 );
 | 
			
		||||
   glMatrixMode( GL_MODELVIEW );
 | 
			
		||||
   glLoadIdentity();
 | 
			
		||||
 | 
			
		||||
   glScissor(width/4, height/4, width/2, height/2);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static void Key( unsigned char key, int x, int y )
 | 
			
		||||
{
 | 
			
		||||
   (void) x;
 | 
			
		||||
   (void) y;
 | 
			
		||||
   switch (key) {
 | 
			
		||||
      case ' ':
 | 
			
		||||
         Reset();
 | 
			
		||||
         break;
 | 
			
		||||
      case 'd':
 | 
			
		||||
         Dither = !Dither;
 | 
			
		||||
         if (Dither)
 | 
			
		||||
            glEnable(GL_DITHER);
 | 
			
		||||
         else
 | 
			
		||||
            glDisable(GL_DITHER);
 | 
			
		||||
         break;
 | 
			
		||||
      case 'w':
 | 
			
		||||
         if (DrawWidth > 0)
 | 
			
		||||
            DrawWidth--;
 | 
			
		||||
         break;
 | 
			
		||||
      case 'W':
 | 
			
		||||
         DrawWidth++;
 | 
			
		||||
         break;
 | 
			
		||||
      case 'h':
 | 
			
		||||
         if (DrawHeight > 0)
 | 
			
		||||
            DrawHeight--;
 | 
			
		||||
         break;
 | 
			
		||||
      case 'H':
 | 
			
		||||
         DrawHeight++;
 | 
			
		||||
         break;
 | 
			
		||||
      case 'p':
 | 
			
		||||
         if (SkipPixels > 0)
 | 
			
		||||
             SkipPixels--;
 | 
			
		||||
         break;
 | 
			
		||||
      case 'P':
 | 
			
		||||
         SkipPixels++;
 | 
			
		||||
         break;
 | 
			
		||||
      case 'r':
 | 
			
		||||
         if (SkipRows > 0)
 | 
			
		||||
             SkipRows--;
 | 
			
		||||
         break;
 | 
			
		||||
      case 'R':
 | 
			
		||||
         SkipRows++;
 | 
			
		||||
         break;
 | 
			
		||||
      case 's':
 | 
			
		||||
         Scissor = !Scissor;
 | 
			
		||||
         break;
 | 
			
		||||
      case 'x':
 | 
			
		||||
         Xzoom -= 0.1;
 | 
			
		||||
         break;
 | 
			
		||||
      case 'X':
 | 
			
		||||
         Xzoom += 0.1;
 | 
			
		||||
         break;
 | 
			
		||||
      case 'y':
 | 
			
		||||
         Yzoom -= 0.1;
 | 
			
		||||
         break;
 | 
			
		||||
      case 'Y':
 | 
			
		||||
         Yzoom += 0.1;
 | 
			
		||||
         break;
 | 
			
		||||
      case 'z':
 | 
			
		||||
         Zpos -= 0.1;
 | 
			
		||||
         printf("RasterPos Z = %g\n", Zpos);
 | 
			
		||||
         break;
 | 
			
		||||
      case 'Z':
 | 
			
		||||
         Zpos += 0.1;
 | 
			
		||||
         printf("RasterPos Z = %g\n", Zpos);
 | 
			
		||||
         break;
 | 
			
		||||
      case 'b':
 | 
			
		||||
         Benchmark();
 | 
			
		||||
         break;
 | 
			
		||||
      case 'F':
 | 
			
		||||
         Fog = !Fog;
 | 
			
		||||
         printf("Fog %d\n", Fog);
 | 
			
		||||
         break;
 | 
			
		||||
      case 'f':
 | 
			
		||||
         DrawFront = !DrawFront;
 | 
			
		||||
         if (DrawFront)
 | 
			
		||||
            glDrawBuffer(GL_FRONT);
 | 
			
		||||
         else
 | 
			
		||||
            glDrawBuffer(GL_BACK);
 | 
			
		||||
         printf("glDrawBuffer(%s)\n", DrawFront ? "GL_FRONT" : "GL_BACK");
 | 
			
		||||
         break;
 | 
			
		||||
      case 27:
 | 
			
		||||
         exit(0);
 | 
			
		||||
         break;
 | 
			
		||||
   }
 | 
			
		||||
   glutPostRedisplay();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static void SpecialKey( int key, int x, int y )
 | 
			
		||||
{
 | 
			
		||||
   (void) x;
 | 
			
		||||
   (void) y;
 | 
			
		||||
   switch (key) {
 | 
			
		||||
      case GLUT_KEY_UP:
 | 
			
		||||
         Ypos += 1;
 | 
			
		||||
         break;
 | 
			
		||||
      case GLUT_KEY_DOWN:
 | 
			
		||||
         Ypos -= 1;
 | 
			
		||||
         break;
 | 
			
		||||
      case GLUT_KEY_LEFT:
 | 
			
		||||
         Xpos -= 1;
 | 
			
		||||
         break;
 | 
			
		||||
      case GLUT_KEY_RIGHT:
 | 
			
		||||
         Xpos += 1;
 | 
			
		||||
         break;
 | 
			
		||||
   }
 | 
			
		||||
   glutPostRedisplay();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static void Init( GLboolean ciMode, const char *filename )
 | 
			
		||||
{
 | 
			
		||||
   static const GLfloat fogColor[4] = {0, 1, 0, 0};
 | 
			
		||||
 | 
			
		||||
   printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
 | 
			
		||||
   printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
 | 
			
		||||
 | 
			
		||||
   Image = LoadRGBImage( filename, &ImgWidth, &ImgHeight, &ImgFormat );
 | 
			
		||||
   if (!Image) {
 | 
			
		||||
      printf("Couldn't read %s\n", filename);
 | 
			
		||||
      exit(0);
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   if (ciMode) {
 | 
			
		||||
      /* Convert RGB image to grayscale */
 | 
			
		||||
      GLubyte *indexImage = (GLubyte *) malloc( ImgWidth * ImgHeight );
 | 
			
		||||
      GLint i;
 | 
			
		||||
      for (i=0; i<ImgWidth*ImgHeight; i++) {
 | 
			
		||||
         int gray = Image[i*3] + Image[i*3+1] + Image[i*3+2];
 | 
			
		||||
         indexImage[i] = gray / 3;
 | 
			
		||||
      }
 | 
			
		||||
      free(Image);
 | 
			
		||||
      Image = indexImage;
 | 
			
		||||
      ImgFormat = GL_COLOR_INDEX;
 | 
			
		||||
 | 
			
		||||
      for (i=0;i<255;i++) {
 | 
			
		||||
         float g = i / 255.0;
 | 
			
		||||
         glutSetColor(i, g, g, g);
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   printf("Loaded %d by %d image\n", ImgWidth, ImgHeight );
 | 
			
		||||
 | 
			
		||||
   glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
 | 
			
		||||
   glPixelStorei(GL_UNPACK_ROW_LENGTH, ImgWidth);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
   /* put image into DrawPBO */
 | 
			
		||||
   glGenBuffersARB(1, &DrawPBO);
 | 
			
		||||
   glBindBufferARB(GL_PIXEL_PACK_BUFFER_EXT, DrawPBO);
 | 
			
		||||
   glBufferDataARB(GL_PIXEL_PACK_BUFFER_EXT,
 | 
			
		||||
                   ImgWidth * ImgHeight * 4, Image, GL_STATIC_DRAW);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
   glFogi(GL_FOG_MODE, GL_LINEAR);
 | 
			
		||||
   glFogf(GL_FOG_START, 0);
 | 
			
		||||
   glFogf(GL_FOG_END, 2);
 | 
			
		||||
   glFogfv(GL_FOG_COLOR, fogColor);
 | 
			
		||||
 | 
			
		||||
   Reset();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static void Usage(void)
 | 
			
		||||
{
 | 
			
		||||
   printf("Keys:\n");
 | 
			
		||||
   printf("       SPACE  Reset Parameters\n");
 | 
			
		||||
   printf("     Up/Down  Move image up/down\n");
 | 
			
		||||
   printf("  Left/Right  Move image left/right\n");
 | 
			
		||||
   printf("           x  Decrease X-axis PixelZoom\n");
 | 
			
		||||
   printf("           X  Increase X-axis PixelZoom\n");
 | 
			
		||||
   printf("           y  Decrease Y-axis PixelZoom\n");
 | 
			
		||||
   printf("           Y  Increase Y-axis PixelZoom\n");
 | 
			
		||||
   printf("           w  Decrease glDrawPixels width*\n");
 | 
			
		||||
   printf("           W  Increase glDrawPixels width*\n");
 | 
			
		||||
   printf("           h  Decrease glDrawPixels height*\n");
 | 
			
		||||
   printf("           H  Increase glDrawPixels height*\n");
 | 
			
		||||
   printf("           p  Decrease GL_UNPACK_SKIP_PIXELS*\n");
 | 
			
		||||
   printf("           P  Increase GL_UNPACK_SKIP_PIXELS*\n");
 | 
			
		||||
   printf("           r  Decrease GL_UNPACK_SKIP_ROWS*\n");
 | 
			
		||||
   printf("           R  Increase GL_UNPACK_SKIP_ROWS*\n");
 | 
			
		||||
   printf("           s  Toggle GL_SCISSOR_TEST\n");
 | 
			
		||||
   printf("           F  Toggle GL_FOG\n");
 | 
			
		||||
   printf("           z  Decrease RasterPos Z\n");
 | 
			
		||||
   printf("           Z  Increase RasterPos Z\n");
 | 
			
		||||
   
 | 
			
		||||
   printf("           f  Toggle front/back buffer drawing\n");
 | 
			
		||||
   printf("           b  Benchmark test\n");
 | 
			
		||||
   printf("         ESC  Exit\n");
 | 
			
		||||
   printf("* Warning: no limits are imposed on these parameters so it's\n");
 | 
			
		||||
   printf("  possible to cause a segfault if you go too far.\n");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
int main( int argc, char *argv[] )
 | 
			
		||||
{
 | 
			
		||||
   GLboolean ciMode = GL_FALSE;
 | 
			
		||||
   const char *filename = IMAGE_FILE;
 | 
			
		||||
   int i = 1;
 | 
			
		||||
 | 
			
		||||
   if (argc > i && strcmp(argv[i], "-ci")==0) {
 | 
			
		||||
      ciMode = GL_TRUE;
 | 
			
		||||
      i++;
 | 
			
		||||
   }
 | 
			
		||||
   if (argc > i) {
 | 
			
		||||
      filename = argv[i];
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   glutInit( &argc, argv );
 | 
			
		||||
   glutInitWindowPosition( 0, 0 );
 | 
			
		||||
   glutInitWindowSize( 500, 400 );
 | 
			
		||||
 | 
			
		||||
   if (ciMode)
 | 
			
		||||
      glutInitDisplayMode( GLUT_INDEX | GLUT_DOUBLE );
 | 
			
		||||
   else
 | 
			
		||||
      glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE);
 | 
			
		||||
 | 
			
		||||
   glutCreateWindow(argv[0]);
 | 
			
		||||
 | 
			
		||||
   Init(ciMode, filename);
 | 
			
		||||
   Usage();
 | 
			
		||||
 | 
			
		||||
   glutReshapeFunc( Reshape );
 | 
			
		||||
   glutKeyboardFunc( Key );
 | 
			
		||||
   glutSpecialFunc( SpecialKey );
 | 
			
		||||
   glutDisplayFunc( Display );
 | 
			
		||||
 | 
			
		||||
   glutMainLoop();
 | 
			
		||||
   return 0;
 | 
			
		||||
}
 | 
			
		||||
@@ -18,7 +18,7 @@
 | 
			
		||||
static GLint WinWidth = 800, WinHeight = 500;
 | 
			
		||||
static GLint TexWidth, TexHeight;
 | 
			
		||||
static GLuint TexObj = 1;
 | 
			
		||||
static GLenum IntFormat = GL_RGB;
 | 
			
		||||
static GLenum IntFormat = GL_RGBA;
 | 
			
		||||
 | 
			
		||||
static GLboolean WireFrame = GL_FALSE;
 | 
			
		||||
 | 
			
		||||
@@ -325,9 +325,10 @@ idle(void)
 | 
			
		||||
  dt = t - t0;
 | 
			
		||||
  t0 = t;
 | 
			
		||||
 | 
			
		||||
  /* fmod to prevent overflow */
 | 
			
		||||
  GearRot = fmod(GearRot + 70.0 * dt, 360.0);  /* 70 deg/sec */
 | 
			
		||||
  CubeRot = fmod(CubeRot + 15.0 * dt, 360.0);  /* 15 deg/sec */
 | 
			
		||||
  GearRot += 70.0 * dt;  /* 70 degrees per second */
 | 
			
		||||
  GearRot = fmod(GearRot, 360.0); /* prevents eventual overflow */
 | 
			
		||||
 | 
			
		||||
  CubeRot += 15.0 * dt;
 | 
			
		||||
 | 
			
		||||
  glutPostRedisplay();
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -236,7 +236,6 @@ static void SpecialKey( int key, int x, int y )
 | 
			
		||||
static void Init( int argc, char *argv[] )
 | 
			
		||||
{
 | 
			
		||||
   GLboolean convolve = GL_FALSE;
 | 
			
		||||
   GLboolean fullscreen = GL_FALSE;
 | 
			
		||||
   int i;
 | 
			
		||||
 | 
			
		||||
   for (i = 1; i < argc; i++) {
 | 
			
		||||
@@ -249,13 +248,8 @@ static void Init( int argc, char *argv[] )
 | 
			
		||||
      else if (strcmp(argv[i], "-c")==0) {
 | 
			
		||||
         convolve = GL_TRUE;
 | 
			
		||||
      }
 | 
			
		||||
      else if (strcmp(argv[i], "-f")==0) {
 | 
			
		||||
         fullscreen = GL_TRUE;
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   if (fullscreen)
 | 
			
		||||
      glutFullScreen();
 | 
			
		||||
 | 
			
		||||
   /* Cylinder object */
 | 
			
		||||
   {
 | 
			
		||||
@@ -427,8 +421,7 @@ int main( int argc, char *argv[] )
 | 
			
		||||
   glutKeyboardFunc( Key );
 | 
			
		||||
   glutSpecialFunc( SpecialKey );
 | 
			
		||||
   glutDisplayFunc( Display );
 | 
			
		||||
   if (Animate)
 | 
			
		||||
      glutIdleFunc( Idle );
 | 
			
		||||
   glutIdleFunc( Idle );
 | 
			
		||||
 | 
			
		||||
   glutCreateMenu(ModeMenu);
 | 
			
		||||
   glutAddMenuEntry("Toggle Highlight", DO_SPEC_TEXTURE);
 | 
			
		||||
 
 | 
			
		||||
@@ -1,185 +0,0 @@
 | 
			
		||||
/*
 | 
			
		||||
 * GLSL noise demo.
 | 
			
		||||
 *
 | 
			
		||||
 * Michal Krol
 | 
			
		||||
 * 20 February 2006
 | 
			
		||||
 *
 | 
			
		||||
 * Based on the original demo by:
 | 
			
		||||
 * Stefan Gustavson (stegu@itn.liu.se) 2004, 2005
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifdef WIN32
 | 
			
		||||
#include <windows.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#include <GL/gl.h>
 | 
			
		||||
#include <GL/glut.h>
 | 
			
		||||
#include <GL/glext.h>
 | 
			
		||||
 | 
			
		||||
#ifdef WIN32
 | 
			
		||||
#define GETPROCADDRESS(F) wglGetProcAddress(F)
 | 
			
		||||
#else
 | 
			
		||||
#define GETPROCADDRESS(F) glutGetProcAddress(F)
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
static GLhandleARB fragShader;
 | 
			
		||||
static GLhandleARB vertShader;
 | 
			
		||||
static GLhandleARB program;
 | 
			
		||||
 | 
			
		||||
static GLint uTime;
 | 
			
		||||
 | 
			
		||||
static GLfloat u_time = 0.0f;
 | 
			
		||||
 | 
			
		||||
static PFNGLCREATESHADEROBJECTARBPROC glCreateShaderObjectARB = NULL;
 | 
			
		||||
static PFNGLSHADERSOURCEARBPROC glShaderSourceARB = NULL;
 | 
			
		||||
static PFNGLCOMPILESHADERARBPROC glCompileShaderARB = NULL;
 | 
			
		||||
static PFNGLCREATEPROGRAMOBJECTARBPROC glCreateProgramObjectARB = NULL;
 | 
			
		||||
static PFNGLATTACHOBJECTARBPROC glAttachObjectARB = NULL;
 | 
			
		||||
static PFNGLLINKPROGRAMARBPROC glLinkProgramARB = NULL;
 | 
			
		||||
static PFNGLUSEPROGRAMOBJECTARBPROC glUseProgramObjectARB = NULL;
 | 
			
		||||
static PFNGLGETUNIFORMLOCATIONARBPROC glGetUniformLocationARB = NULL;
 | 
			
		||||
static PFNGLUNIFORM1FARBPROC glUniform1fARB = NULL;
 | 
			
		||||
 | 
			
		||||
static void Redisplay (void)
 | 
			
		||||
{
 | 
			
		||||
	glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
 | 
			
		||||
 | 
			
		||||
	glUniform1fARB (uTime, u_time);
 | 
			
		||||
 | 
			
		||||
	glPushMatrix ();
 | 
			
		||||
	glutSolidSphere (2.0, 20, 10);
 | 
			
		||||
	glPopMatrix ();
 | 
			
		||||
 | 
			
		||||
	glutSwapBuffers();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void Idle (void)
 | 
			
		||||
{
 | 
			
		||||
	u_time += 0.1f;
 | 
			
		||||
	glutPostRedisplay ();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void Reshape (int width, int height)
 | 
			
		||||
{
 | 
			
		||||
	glViewport (0, 0, width, height);
 | 
			
		||||
	glMatrixMode (GL_PROJECTION);
 | 
			
		||||
	glLoadIdentity ();
 | 
			
		||||
	glFrustum (-1.0, 1.0, -1.0, 1.0, 5.0, 25.0);
 | 
			
		||||
	glMatrixMode (GL_MODELVIEW);
 | 
			
		||||
	glLoadIdentity ();
 | 
			
		||||
	glTranslatef (0.0f, 0.0f, -15.0f);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void Key (unsigned char key, int x, int y)
 | 
			
		||||
{
 | 
			
		||||
	(void) x;
 | 
			
		||||
	(void) y;
 | 
			
		||||
 | 
			
		||||
	switch (key)
 | 
			
		||||
	{
 | 
			
		||||
	case 27:
 | 
			
		||||
		exit(0);
 | 
			
		||||
		break;
 | 
			
		||||
	}
 | 
			
		||||
	glutPostRedisplay ();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void Init (void)
 | 
			
		||||
{
 | 
			
		||||
	static const char *fragShaderText =
 | 
			
		||||
		"uniform float time;\n"
 | 
			
		||||
		"void main () {\n"
 | 
			
		||||
		"	gl_FragColor = gl_Color * vec4 ((0.5 + 0.5 * vec3 (noise1 (\n"
 | 
			
		||||
		"		vec4 (4.0 * gl_TexCoord[0].xyz, 0.5 * time)))), 1.0);\n"
 | 
			
		||||
		"}\n"
 | 
			
		||||
	;
 | 
			
		||||
	static const char *vertShaderText =
 | 
			
		||||
		"void main () {\n"
 | 
			
		||||
		"	gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n"
 | 
			
		||||
		"	gl_TexCoord[0] = gl_Vertex;\n"
 | 
			
		||||
		"	gl_FrontColor = gl_Color;\n"
 | 
			
		||||
		"}\n"
 | 
			
		||||
	;
 | 
			
		||||
 | 
			
		||||
	if (!glutExtensionSupported ("GL_ARB_fragment_shader"))
 | 
			
		||||
	{
 | 
			
		||||
		printf ("Sorry, this demo requires GL_ARB_fragment_shader\n");
 | 
			
		||||
		exit(1);
 | 
			
		||||
	}
 | 
			
		||||
	if (!glutExtensionSupported ("GL_ARB_shader_objects"))
 | 
			
		||||
	{
 | 
			
		||||
		printf ("Sorry, this demo requires GL_ARB_shader_objects\n");
 | 
			
		||||
		exit(1);
 | 
			
		||||
	}
 | 
			
		||||
	if (!glutExtensionSupported ("GL_ARB_shading_language_100"))
 | 
			
		||||
	{
 | 
			
		||||
		printf ("Sorry, this demo requires GL_ARB_shading_language_100\n");
 | 
			
		||||
		exit(1);
 | 
			
		||||
	}
 | 
			
		||||
	if (!glutExtensionSupported ("GL_ARB_vertex_shader"))
 | 
			
		||||
	{
 | 
			
		||||
		printf ("Sorry, this demo requires GL_ARB_vertex_shader\n");
 | 
			
		||||
		exit(1);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	glCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC)
 | 
			
		||||
		GETPROCADDRESS("glCreateShaderObjectARB");
 | 
			
		||||
 	glShaderSourceARB = (PFNGLSHADERSOURCEARBPROC)
 | 
			
		||||
		GETPROCADDRESS("glShaderSourceARB");
 | 
			
		||||
 	glCompileShaderARB = (PFNGLCOMPILESHADERARBPROC)
 | 
			
		||||
		GETPROCADDRESS("glCompileShaderARB");
 | 
			
		||||
 	glCreateProgramObjectARB = (PFNGLCREATEPROGRAMOBJECTARBPROC)
 | 
			
		||||
		GETPROCADDRESS("glCreateProgramObjectARB");
 | 
			
		||||
 	glAttachObjectARB = (PFNGLATTACHOBJECTARBPROC)
 | 
			
		||||
		GETPROCADDRESS("glAttachObjectARB");
 | 
			
		||||
 	glLinkProgramARB = (PFNGLLINKPROGRAMARBPROC)
 | 
			
		||||
		GETPROCADDRESS ("glLinkProgramARB");
 | 
			
		||||
 	glUseProgramObjectARB = (PFNGLUSEPROGRAMOBJECTARBPROC)
 | 
			
		||||
		GETPROCADDRESS("glUseProgramObjectARB");          
 | 
			
		||||
 | 
			
		||||
	glGetUniformLocationARB = (PFNGLGETUNIFORMLOCATIONARBPROC)
 | 
			
		||||
		GETPROCADDRESS("glGetUniformLocationARB");
 | 
			
		||||
	glUniform1fARB = (PFNGLUNIFORM1FARBPROC)
 | 
			
		||||
		GETPROCADDRESS("glUniform1fARB");
 | 
			
		||||
 | 
			
		||||
	fragShader = glCreateShaderObjectARB (GL_FRAGMENT_SHADER_ARB);
 | 
			
		||||
	glShaderSourceARB (fragShader, 1, &fragShaderText, NULL);
 | 
			
		||||
	glCompileShaderARB (fragShader);
 | 
			
		||||
 | 
			
		||||
	vertShader = glCreateShaderObjectARB (GL_VERTEX_SHADER_ARB);
 | 
			
		||||
	glShaderSourceARB (vertShader, 1, &vertShaderText, NULL);
 | 
			
		||||
	glCompileShaderARB (vertShader);
 | 
			
		||||
 | 
			
		||||
	program = glCreateProgramObjectARB ();
 | 
			
		||||
	glAttachObjectARB (program, fragShader);
 | 
			
		||||
	glAttachObjectARB (program, vertShader);
 | 
			
		||||
	glLinkProgramARB (program);
 | 
			
		||||
	glUseProgramObjectARB (program);
 | 
			
		||||
 | 
			
		||||
	uTime = glGetUniformLocationARB (program, "time");
 | 
			
		||||
 | 
			
		||||
	glClearColor (0.0f, 0.1f, 0.3f, 1.0f);
 | 
			
		||||
	glEnable (GL_CULL_FACE);
 | 
			
		||||
	glEnable (GL_DEPTH_TEST);
 | 
			
		||||
 | 
			
		||||
	printf ("GL_RENDERER = %s\n", (const char *) glGetString (GL_RENDERER));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int main (int argc, char *argv[])
 | 
			
		||||
{
 | 
			
		||||
	glutInit (&argc, argv);
 | 
			
		||||
	glutInitWindowPosition ( 0, 0);
 | 
			
		||||
	glutInitWindowSize (200, 200);
 | 
			
		||||
	glutInitDisplayMode (GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
 | 
			
		||||
	glutCreateWindow (argv[0]);
 | 
			
		||||
	glutReshapeFunc (Reshape);
 | 
			
		||||
	glutKeyboardFunc (Key);
 | 
			
		||||
	glutDisplayFunc (Redisplay);
 | 
			
		||||
	glutIdleFunc (Idle);
 | 
			
		||||
	Init ();
 | 
			
		||||
	glutMainLoop ();
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -42,9 +42,6 @@
 | 
			
		||||
#define INIT_WIDTH 400
 | 
			
		||||
#define INIT_HEIGHT 300
 | 
			
		||||
 | 
			
		||||
#ifdef _WIN32
 | 
			
		||||
#undef CreateWindowA
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
struct window {
 | 
			
		||||
   int id;               /* returned by glutCreateWindow() */
 | 
			
		||||
@@ -302,21 +299,11 @@ DrawWindow(void)
 | 
			
		||||
   GLfloat dist = 20.0;
 | 
			
		||||
   GLfloat eyex, eyey, eyez;
 | 
			
		||||
 | 
			
		||||
   if (w->drawBuffer == GL_NONE) {
 | 
			
		||||
      glDrawBuffer(GL_BACK);
 | 
			
		||||
      glReadBuffer(GL_BACK);
 | 
			
		||||
   }
 | 
			
		||||
   else {
 | 
			
		||||
      glDrawBuffer(w->drawBuffer);
 | 
			
		||||
      glReadBuffer(w->drawBuffer);
 | 
			
		||||
   }
 | 
			
		||||
   glDrawBuffer(w->drawBuffer);
 | 
			
		||||
   glReadBuffer(w->drawBuffer);
 | 
			
		||||
 | 
			
		||||
   glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
 | 
			
		||||
 | 
			
		||||
   if (w->drawBuffer == GL_NONE) {
 | 
			
		||||
      glDrawBuffer(GL_NONE);
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   eyex = dist  *  cos(w->yrot * DEG2RAD)  *  cos(w->xrot * DEG2RAD);
 | 
			
		||||
   eyez = dist  *  sin(w->yrot * DEG2RAD)  *  cos(w->xrot * DEG2RAD);
 | 
			
		||||
   eyey = dist  *  sin(w->xrot * DEG2RAD);
 | 
			
		||||
@@ -386,10 +373,10 @@ DrawWindow(void)
 | 
			
		||||
      ShowAlphaBuffer(w->width, w->height);
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   if (w->drawBuffer == GL_FRONT)
 | 
			
		||||
      glFinish();
 | 
			
		||||
   else
 | 
			
		||||
   if (w->drawBuffer == GL_BACK)
 | 
			
		||||
      glutSwapBuffers();
 | 
			
		||||
   else
 | 
			
		||||
      glFinish();
 | 
			
		||||
 | 
			
		||||
   /* calc/show frame rate */
 | 
			
		||||
   {
 | 
			
		||||
@@ -470,10 +457,6 @@ Key(unsigned char key, int x, int y)
 | 
			
		||||
         w->drawBuffer = GL_FRONT;
 | 
			
		||||
      glutPostRedisplay();
 | 
			
		||||
      break;
 | 
			
		||||
   case '0':
 | 
			
		||||
      w->drawBuffer = GL_NONE;
 | 
			
		||||
      glutPostRedisplay();
 | 
			
		||||
      break;
 | 
			
		||||
   case ' ':
 | 
			
		||||
      w->anim = !w->anim;
 | 
			
		||||
      w->t0 = -1;
 | 
			
		||||
 
 | 
			
		||||
@@ -41,6 +41,7 @@
 | 
			
		||||
#undef GL_ARB_shadow_ambient
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#define DEG_TO_RAD (3.14159 / 180.0)
 | 
			
		||||
 | 
			
		||||
static GLint WindowWidth = 450, WindowHeight = 300;
 | 
			
		||||
@@ -66,7 +67,6 @@ static GLfloat Bias = -0.06;
 | 
			
		||||
 | 
			
		||||
static GLboolean Anim = GL_TRUE;
 | 
			
		||||
 | 
			
		||||
static GLboolean UsePackedDepthStencil = GL_FALSE;
 | 
			
		||||
static GLboolean HaveEXTshadowFuncs = GL_FALSE;
 | 
			
		||||
static GLint Operator = 0;
 | 
			
		||||
static const GLenum OperatorFunc[8] = {
 | 
			
		||||
@@ -266,7 +266,7 @@ Display(void)
 | 
			
		||||
             0, 1, 0); /* up */
 | 
			
		||||
 | 
			
		||||
   glViewport(0, 0, ShadowTexWidth, ShadowTexHeight);
 | 
			
		||||
   glClear(GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
 | 
			
		||||
   glClear(GL_DEPTH_BUFFER_BIT);
 | 
			
		||||
   DrawScene();
 | 
			
		||||
 | 
			
		||||
   /*
 | 
			
		||||
@@ -274,21 +274,9 @@ Display(void)
 | 
			
		||||
    */
 | 
			
		||||
   if (DisplayMode == SHOW_DEPTH_MAPPING) {
 | 
			
		||||
      /* load depth image as gray-scale luminance texture */
 | 
			
		||||
      if (UsePackedDepthStencil) {
 | 
			
		||||
         GLuint *depth = (GLuint *) malloc(ShadowTexWidth * ShadowTexHeight
 | 
			
		||||
                                           * sizeof(GLuint));
 | 
			
		||||
         assert(depth);
 | 
			
		||||
         glReadPixels(0, 0, ShadowTexWidth, ShadowTexHeight,
 | 
			
		||||
                      GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT, depth);
 | 
			
		||||
         glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE,
 | 
			
		||||
                      ShadowTexWidth, ShadowTexHeight, 0,
 | 
			
		||||
                      GL_LUMINANCE, GL_UNSIGNED_INT, depth);
 | 
			
		||||
         free(depth);
 | 
			
		||||
      }
 | 
			
		||||
      else {
 | 
			
		||||
         GLfloat *depth = (GLfloat *) malloc(ShadowTexWidth * ShadowTexHeight
 | 
			
		||||
                                             * sizeof(GLfloat));
 | 
			
		||||
         assert(depth);
 | 
			
		||||
      GLfloat *depth = (GLfloat *) malloc(ShadowTexWidth * ShadowTexHeight
 | 
			
		||||
                                          * sizeof(GLfloat));
 | 
			
		||||
      if (depth) {
 | 
			
		||||
         glReadPixels(0, 0, ShadowTexWidth, ShadowTexHeight,
 | 
			
		||||
                      GL_DEPTH_COMPONENT, GL_FLOAT, depth);
 | 
			
		||||
         glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE,
 | 
			
		||||
@@ -299,18 +287,8 @@ Display(void)
 | 
			
		||||
   }
 | 
			
		||||
   else {
 | 
			
		||||
      /* The normal shadow case */
 | 
			
		||||
      if (UsePackedDepthStencil) {
 | 
			
		||||
         GLint intFormat;
 | 
			
		||||
         glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_STENCIL_EXT,
 | 
			
		||||
                          0, 0, ShadowTexWidth, ShadowTexHeight, 0);
 | 
			
		||||
         glGetTexLevelParameteriv(GL_TEXTURE_2D, 0,
 | 
			
		||||
                                  GL_TEXTURE_INTERNAL_FORMAT, &intFormat);
 | 
			
		||||
         assert(intFormat == GL_DEPTH_STENCIL_EXT);
 | 
			
		||||
      }
 | 
			
		||||
      else {
 | 
			
		||||
         glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT,
 | 
			
		||||
                          0, 0, ShadowTexWidth, ShadowTexHeight, 0);
 | 
			
		||||
      }
 | 
			
		||||
      glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT,
 | 
			
		||||
                       0, 0, ShadowTexWidth, ShadowTexHeight, 0);
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   /*
 | 
			
		||||
@@ -469,17 +447,6 @@ Key(unsigned char key, int x, int y)
 | 
			
		||||
                            OperatorFunc[Operator]);
 | 
			
		||||
         }
 | 
			
		||||
         break;
 | 
			
		||||
      case 'p':
 | 
			
		||||
         UsePackedDepthStencil = !UsePackedDepthStencil;
 | 
			
		||||
         if (UsePackedDepthStencil
 | 
			
		||||
             && !glutExtensionSupported("GL_EXT_packed_depth_stencil")) {
 | 
			
		||||
            printf("Sorry, GL_EXT_packed_depth_stencil not supported\n");
 | 
			
		||||
            UsePackedDepthStencil = GL_FALSE;
 | 
			
		||||
         }
 | 
			
		||||
         else {
 | 
			
		||||
            printf("Use GL_DEPTH_STENCIL_EXT: %d\n", UsePackedDepthStencil);
 | 
			
		||||
         }
 | 
			
		||||
         break;
 | 
			
		||||
      case 'z':
 | 
			
		||||
         Zrot -= step;
 | 
			
		||||
         break;
 | 
			
		||||
@@ -605,7 +572,6 @@ PrintHelp(void)
 | 
			
		||||
   printf("  n = show normal, shadowed image\n");
 | 
			
		||||
   printf("  f = toggle nearest/bilinear texture filtering\n");
 | 
			
		||||
   printf("  b/B = decrease/increase shadow map Z bias\n");
 | 
			
		||||
   printf("  p = toggle use of packed depth/stencil\n");
 | 
			
		||||
   printf("  cursor keys = rotate scene\n");
 | 
			
		||||
   printf("  <shift> + cursor keys = rotate light source\n");
 | 
			
		||||
   if (HaveEXTshadowFuncs)
 | 
			
		||||
@@ -619,7 +585,7 @@ main(int argc, char *argv[])
 | 
			
		||||
   glutInit(&argc, argv);
 | 
			
		||||
   glutInitWindowPosition(0, 0);
 | 
			
		||||
   glutInitWindowSize(WindowWidth, WindowHeight);
 | 
			
		||||
   glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH | GLUT_STENCIL);
 | 
			
		||||
   glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
 | 
			
		||||
   glutCreateWindow(argv[0]);
 | 
			
		||||
   glutReshapeFunc(Reshape);
 | 
			
		||||
   glutKeyboardFunc(Key);
 | 
			
		||||
 
 | 
			
		||||
@@ -38,8 +38,8 @@
 | 
			
		||||
#include <GL/glut.h>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static GLsizei MaxSize = 1024;
 | 
			
		||||
static GLsizei TexWidth = 256, TexHeight = 256, TexBorder = 0;
 | 
			
		||||
static GLsizei MaxSize = 2048;
 | 
			
		||||
static GLsizei TexWidth = 1024, TexHeight = 1024, TexBorder = 0;
 | 
			
		||||
static GLboolean ScaleAndBias = GL_FALSE;
 | 
			
		||||
static GLboolean SubImage = GL_FALSE;
 | 
			
		||||
static GLdouble DownloadRate = 0.0;  /* texels/sec */
 | 
			
		||||
@@ -47,6 +47,32 @@ static GLdouble DownloadRate = 0.0;  /* texels/sec */
 | 
			
		||||
static GLuint Mode = 0;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Try and avoid L2 cache effects by cycling through a small number of
 | 
			
		||||
 * textures.
 | 
			
		||||
 * 
 | 
			
		||||
 * At the initial size of 1024x1024x4 == 4mbyte, say 8 textures will
 | 
			
		||||
 * keep us out of most caches at 32mb total.
 | 
			
		||||
 *
 | 
			
		||||
 * This turns into a fairly interesting question of what exactly you
 | 
			
		||||
 * expect to be in cache in normal usage, and what you think should be
 | 
			
		||||
 * outside.  There's no rules for this, no reason to favour one usage
 | 
			
		||||
 * over another except what the application you care about happens to
 | 
			
		||||
 * resemble most closely.
 | 
			
		||||
 *
 | 
			
		||||
 * - Should the client texture image be in L2 cache?  Has it just been
 | 
			
		||||
 *   generated or read from disk?
 | 
			
		||||
 * - Does the application really use >1 texture, or is it constantly 
 | 
			
		||||
 *   updating one image in-place?
 | 
			
		||||
 *
 | 
			
		||||
 * Different answers will favour different texture upload mechanisms.
 | 
			
		||||
 * To upload an image that is purely outside of cache, a DMA-based
 | 
			
		||||
 * upload will probably win, whereas for small, in-cache textures,
 | 
			
		||||
 * copying looks good.
 | 
			
		||||
 */
 | 
			
		||||
#define NR_TEXOBJ 4
 | 
			
		||||
static GLuint TexObj[NR_TEXOBJ];
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
struct FormatRec {
 | 
			
		||||
   GLenum Format;
 | 
			
		||||
   GLenum Type;
 | 
			
		||||
@@ -116,25 +142,57 @@ TypeStr(GLenum type)
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* On x86, there is a performance cliff for memcpy to texture memory
 | 
			
		||||
 * for sources below 64 byte alignment.  We do our best with this in
 | 
			
		||||
 * the driver, but it is better if the images are correctly aligned to
 | 
			
		||||
 * start with:
 | 
			
		||||
 */
 | 
			
		||||
#define ALIGN (1<<12)
 | 
			
		||||
 | 
			
		||||
static unsigned align(unsigned value, unsigned a)
 | 
			
		||||
{
 | 
			
		||||
   return (value + a - 1) & ~(a-1);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int MIN2(int a, int b)
 | 
			
		||||
{
 | 
			
		||||
   return a < b ? a : b;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
MeasureDownloadRate(void)
 | 
			
		||||
{
 | 
			
		||||
   const int w = TexWidth + 2 * TexBorder;
 | 
			
		||||
   const int h = TexHeight + 2 * TexBorder;
 | 
			
		||||
   const int bytes = w * h * BytesPerTexel(Format);
 | 
			
		||||
   const int image_bytes = align(w * h * BytesPerTexel(Format), ALIGN);
 | 
			
		||||
   const int bytes = image_bytes * NR_TEXOBJ;
 | 
			
		||||
   GLubyte *orig_texImage, *orig_getImage;
 | 
			
		||||
   GLubyte *texImage, *getImage;
 | 
			
		||||
   GLdouble t0, t1, time;
 | 
			
		||||
   int count;
 | 
			
		||||
   int i;
 | 
			
		||||
   int offset = 0;
 | 
			
		||||
   GLdouble total = 0;		/* ints will tend to overflow */
 | 
			
		||||
 | 
			
		||||
   texImage = (GLubyte *) malloc(bytes);
 | 
			
		||||
   getImage = (GLubyte *) malloc(bytes);
 | 
			
		||||
   if (!texImage || !getImage) {
 | 
			
		||||
   printf("allocating %d bytes for %d %dx%d images\n",
 | 
			
		||||
	  bytes, NR_TEXOBJ, w, h);
 | 
			
		||||
 | 
			
		||||
   orig_texImage = (GLubyte *) malloc(bytes + ALIGN);
 | 
			
		||||
   orig_getImage = (GLubyte *) malloc(image_bytes + ALIGN);
 | 
			
		||||
   if (!orig_texImage || !orig_getImage) {
 | 
			
		||||
      DownloadRate = 0.0;
 | 
			
		||||
      return;
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   printf("alloc %p %p\n", orig_texImage, orig_getImage);
 | 
			
		||||
 | 
			
		||||
   texImage = (GLubyte *)align((unsigned)orig_texImage, ALIGN);
 | 
			
		||||
   getImage = (GLubyte *)align((unsigned)orig_getImage, ALIGN);   
 | 
			
		||||
 | 
			
		||||
   for (i = 1; !(((unsigned)texImage) & i); i<<=1)
 | 
			
		||||
      ;
 | 
			
		||||
   printf("texture image alignment: %d bytes (%p)\n", i, texImage);
 | 
			
		||||
      
 | 
			
		||||
   for (i = 0; i < bytes; i++) {
 | 
			
		||||
      texImage[i] = i & 0xff;
 | 
			
		||||
   }
 | 
			
		||||
@@ -166,51 +224,80 @@ MeasureDownloadRate(void)
 | 
			
		||||
   count = 0;
 | 
			
		||||
   t0 = glutGet(GLUT_ELAPSED_TIME) * 0.001;
 | 
			
		||||
   do {
 | 
			
		||||
      int img = count%NR_TEXOBJ;
 | 
			
		||||
      GLubyte *img_ptr = texImage + img * image_bytes;
 | 
			
		||||
 | 
			
		||||
      glBindTexture(GL_TEXTURE_2D, TexObj[img]);
 | 
			
		||||
 | 
			
		||||
      if (SubImage && count > 0) {
 | 
			
		||||
         glTexSubImage2D(GL_TEXTURE_2D, 0, -TexBorder, -TexBorder, w, h,
 | 
			
		||||
	 /* Only update a portion of the image each iteration.  This
 | 
			
		||||
	  * is presumably why you'd want to use texsubimage, otherwise
 | 
			
		||||
	  * you may as well just call teximage again.
 | 
			
		||||
	  *
 | 
			
		||||
	  * A bigger question is whether to use a pointer that moves
 | 
			
		||||
	  * with each call, ie does the incoming data come from L2
 | 
			
		||||
	  * cache under normal circumstances, or is it pulled from
 | 
			
		||||
	  * uncached memory?  
 | 
			
		||||
	  * 
 | 
			
		||||
	  * There's a good argument to say L2 cache, ie you'd expect
 | 
			
		||||
	  * the data to have been recently generated.  It's possible
 | 
			
		||||
	  * that it could have come from a file read, which may or may
 | 
			
		||||
	  * not have gone through the cpu.
 | 
			
		||||
	  */
 | 
			
		||||
         glTexSubImage2D(GL_TEXTURE_2D, 0, 
 | 
			
		||||
			 -TexBorder, 
 | 
			
		||||
			 -TexBorder + offset * h/8, 
 | 
			
		||||
			 w, 
 | 
			
		||||
			 h/8,
 | 
			
		||||
                         FormatTable[Format].Format,
 | 
			
		||||
                         FormatTable[Format].Type, texImage);
 | 
			
		||||
                         FormatTable[Format].Type, 
 | 
			
		||||
#if 1
 | 
			
		||||
			 texImage /* likely in L2$ */
 | 
			
		||||
#else
 | 
			
		||||
			 img_ptr + offset * bytes/8 /* unlikely in L2$ */
 | 
			
		||||
#endif
 | 
			
		||||
	    );
 | 
			
		||||
	 offset += 1;
 | 
			
		||||
	 offset %= 8;
 | 
			
		||||
	 total += w * h / 8;
 | 
			
		||||
      }
 | 
			
		||||
      else {
 | 
			
		||||
         glTexImage2D(GL_TEXTURE_2D, 0,
 | 
			
		||||
                      FormatTable[Format].IntFormat, w, h, TexBorder,
 | 
			
		||||
                      FormatTable[Format].Format,
 | 
			
		||||
                      FormatTable[Format].Type, texImage);
 | 
			
		||||
                      FormatTable[Format].Type, 
 | 
			
		||||
		      img_ptr);
 | 
			
		||||
	 total += w*h;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
#if 1
 | 
			
		||||
      /* Render a texture, but not necessarily the one just uploaded.  
 | 
			
		||||
       */
 | 
			
		||||
/*       glBindTexture(GL_TEXTURE_2D, TexObj[(img + NR_TEXOBJ/2)%NR_TEXOBJ]); */
 | 
			
		||||
 | 
			
		||||
      /* draw a tiny polygon to force texture into texram */
 | 
			
		||||
      glBegin(GL_TRIANGLES);
 | 
			
		||||
      glTexCoord2f(0, 0);     glVertex2f(1, 1);
 | 
			
		||||
      glTexCoord2f(1, 0);     glVertex2f(3, 1);
 | 
			
		||||
      glTexCoord2f(0.5, 1);   glVertex2f(2, 3);
 | 
			
		||||
      glEnd();
 | 
			
		||||
/*       glFinish(); */
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
      t1 = glutGet(GLUT_ELAPSED_TIME) * 0.001;
 | 
			
		||||
      time = t1 - t0;
 | 
			
		||||
      count++;
 | 
			
		||||
/*       printf("total %f count %d\n", total, count); */
 | 
			
		||||
   } while (time < 3.0);
 | 
			
		||||
 | 
			
		||||
   glDisable(GL_TEXTURE_2D);
 | 
			
		||||
 | 
			
		||||
   printf("w*h=%d  count=%d  time=%f\n", w*h, count, time);
 | 
			
		||||
   DownloadRate = w * h * count / time;
 | 
			
		||||
   printf("total texels=%f  time=%f\n", total, time);
 | 
			
		||||
   DownloadRate = total / time;
 | 
			
		||||
 | 
			
		||||
#if 0
 | 
			
		||||
   if (!ScaleAndBias) {
 | 
			
		||||
      /* verify texture readback */
 | 
			
		||||
      glGetTexImage(GL_TEXTURE_2D, 0,
 | 
			
		||||
                    FormatTable[Format].Format,
 | 
			
		||||
                    FormatTable[Format].Type, getImage);
 | 
			
		||||
      for (i = 0; i < w * h; i++) {
 | 
			
		||||
         if (texImage[i] != getImage[i]) {
 | 
			
		||||
            printf("[%d] %d != %d\n", i, texImage[i], getImage[i]);
 | 
			
		||||
         }
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
   free(texImage);
 | 
			
		||||
   free(getImage);
 | 
			
		||||
   free(orig_texImage); 
 | 
			
		||||
   free(orig_getImage); 
 | 
			
		||||
 | 
			
		||||
   {
 | 
			
		||||
      GLint err = glGetError();
 | 
			
		||||
@@ -82,12 +82,60 @@ static void render_image( void )
 | 
			
		||||
   glutSolidCone(1.0, 2.0, 16, 1);
 | 
			
		||||
   glPopMatrix();
 | 
			
		||||
 | 
			
		||||
#ifdef GL_HP_occlusion_test
 | 
			
		||||
   if (perf == 0) {
 | 
			
		||||
      GLboolean bRet;
 | 
			
		||||
      glDepthMask(GL_FALSE);
 | 
			
		||||
      glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE);
 | 
			
		||||
      glEnable(GL_OCCLUSION_TEST_HP);
 | 
			
		||||
      glGetBooleanv(GL_OCCLUSION_TEST_RESULT_HP,&bRet);
 | 
			
		||||
 | 
			
		||||
      glPushMatrix();
 | 
			
		||||
      glTranslatef(0.75, 0.0, -1.0);
 | 
			
		||||
      glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, blue_mat );
 | 
			
		||||
      glutSolidSphere(1.0, 20, 20);
 | 
			
		||||
      glPopMatrix();
 | 
			
		||||
 | 
			
		||||
      glGetBooleanv(GL_OCCLUSION_TEST_RESULT_HP,&bRet);
 | 
			
		||||
      printf("Occlusion test 1 (result should be 1): %d\n",bRet);
 | 
			
		||||
 | 
			
		||||
      glDepthMask(GL_TRUE);
 | 
			
		||||
      glColorMask(GL_TRUE,GL_TRUE,GL_TRUE,GL_TRUE);
 | 
			
		||||
      glDisable(GL_OCCLUSION_TEST_HP);
 | 
			
		||||
   }
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
   glPushMatrix();
 | 
			
		||||
   glTranslatef(0.75, 0.0, -1.0); 
 | 
			
		||||
   glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, blue_mat );
 | 
			
		||||
   glutSolidSphere(1.0, 20, 20);
 | 
			
		||||
   glPopMatrix();
 | 
			
		||||
 | 
			
		||||
#ifdef GL_HP_occlusion_test
 | 
			
		||||
   if (perf == 0){
 | 
			
		||||
      GLboolean bRet;
 | 
			
		||||
 | 
			
		||||
      glDepthMask(GL_FALSE);
 | 
			
		||||
      glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE);
 | 
			
		||||
      glEnable(GL_OCCLUSION_TEST_HP);
 | 
			
		||||
      glGetBooleanv(GL_OCCLUSION_TEST_RESULT_HP,&bRet);
 | 
			
		||||
 | 
			
		||||
      /* draw a sphere inside the previous sphere */
 | 
			
		||||
      glPushMatrix();
 | 
			
		||||
      glTranslatef(0.75, 0.0, -1.0);
 | 
			
		||||
      glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, blue_mat );
 | 
			
		||||
      glutSolidSphere(0.5, 20, 20);
 | 
			
		||||
      glPopMatrix();
 | 
			
		||||
 | 
			
		||||
      glGetBooleanv(GL_OCCLUSION_TEST_RESULT_HP,&bRet);
 | 
			
		||||
      printf("Occlusion test 2 (result should be 0): %d\n",bRet);
 | 
			
		||||
 | 
			
		||||
      glDepthMask(GL_TRUE);
 | 
			
		||||
      glColorMask(GL_TRUE,GL_TRUE,GL_TRUE,GL_TRUE);
 | 
			
		||||
      glDisable(GL_OCCLUSION_TEST_HP);
 | 
			
		||||
   }
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
   glPopMatrix();
 | 
			
		||||
 | 
			
		||||
   /* This is very important!!!
 | 
			
		||||
 
 | 
			
		||||
@@ -10,14 +10,11 @@ include $(TOP)/configs/current
 | 
			
		||||
 | 
			
		||||
LIBS = $(APP_LIB_DEPS)
 | 
			
		||||
 | 
			
		||||
SOURCES = \
 | 
			
		||||
	afsmultiarb.c \
 | 
			
		||||
	antialias.c \
 | 
			
		||||
SOURCES = antialias.c \
 | 
			
		||||
	arbfpspec.c \
 | 
			
		||||
	arbfptest1.c \
 | 
			
		||||
	arbfptexture.c \
 | 
			
		||||
	arbfptrig.c \
 | 
			
		||||
	arbnpot.c \
 | 
			
		||||
	arbvptest1.c \
 | 
			
		||||
	arbvptest3.c \
 | 
			
		||||
	arbvptorus.c \
 | 
			
		||||
@@ -25,15 +22,14 @@ SOURCES = \
 | 
			
		||||
	blendminmax.c \
 | 
			
		||||
	blendsquare.c \
 | 
			
		||||
	bufferobj.c \
 | 
			
		||||
	bug_3050.c \
 | 
			
		||||
	bug_3101.c \
 | 
			
		||||
	bug_3195.c \
 | 
			
		||||
	copypixrate.c \
 | 
			
		||||
	crossbar.c \
 | 
			
		||||
	cva.c \
 | 
			
		||||
	dinoshade.c \
 | 
			
		||||
	floattex.c \
 | 
			
		||||
	fbotest1.c \
 | 
			
		||||
	fbotest2.c \
 | 
			
		||||
	fbotexture.c \
 | 
			
		||||
	fog.c \
 | 
			
		||||
	fogcoord.c \
 | 
			
		||||
@@ -42,7 +38,6 @@ SOURCES = \
 | 
			
		||||
	getprocaddress.c \
 | 
			
		||||
	interleave.c \
 | 
			
		||||
	invert.c \
 | 
			
		||||
	jkrahntest.c \
 | 
			
		||||
	manytex.c \
 | 
			
		||||
	multipal.c \
 | 
			
		||||
	no_s3tc.c \
 | 
			
		||||
 
 | 
			
		||||
@@ -1,9 +1,13 @@
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * GL_ATI_fragment_shader test
 | 
			
		||||
 * Roland Scheidegger
 | 
			
		||||
 * GL_ARB_multitexture demo
 | 
			
		||||
 *
 | 
			
		||||
 * Command line options:
 | 
			
		||||
 *    -info      print GL implementation information
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Brian Paul  November 1998  This program is in the public domain.
 | 
			
		||||
 * Modified on 12 Feb 2002 for > 2 texture units.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,162 +0,0 @@
 | 
			
		||||
/*
 | 
			
		||||
 * (C) Copyright IBM Corporation 2006
 | 
			
		||||
 * All Rights Reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Permission is hereby granted, free of charge, to any person obtaining a
 | 
			
		||||
 * copy of this software and associated documentation files (the "Software"),
 | 
			
		||||
 * to deal in the Software without restriction, including without limitation
 | 
			
		||||
 * on the rights to use, copy, modify, merge, publish, distribute, sub
 | 
			
		||||
 * license, and/or sell copies of the Software, and to permit persons to whom
 | 
			
		||||
 * the Software is furnished to do so, subject to the following conditions:
 | 
			
		||||
 *
 | 
			
		||||
 * The above copyright notice and this permission notice (including the next
 | 
			
		||||
 * paragraph) shall be included in all copies or substantial portions of the
 | 
			
		||||
 * Software.
 | 
			
		||||
 *
 | 
			
		||||
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 | 
			
		||||
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 | 
			
		||||
 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
 | 
			
		||||
 * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
 | 
			
		||||
 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
 | 
			
		||||
 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
 | 
			
		||||
 * USE OR OTHER DEALINGS IN THE SOFTWARE.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * \file bug_3050.c
 | 
			
		||||
 *
 | 
			
		||||
 * Simple regression test for bug #3050.  Create a texture and make a few
 | 
			
		||||
 * calls to \c glGetTexLevelParameteriv.  If the bug still exists, trying
 | 
			
		||||
 * to get \c GL_TEXTURE_WITDH will cause a protocol error.
 | 
			
		||||
 * 
 | 
			
		||||
 * This test \b only applies to indirect-rendering.  This may mean that the
 | 
			
		||||
 * test needs to be run with the environment variable \c LIBGL_ALWAYS_INDIRECT
 | 
			
		||||
 * set to a non-zero value.
 | 
			
		||||
 *
 | 
			
		||||
 * \author Ian Romanick <idr@us.ibm.com>
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#include <string.h>
 | 
			
		||||
#include <GL/glut.h>
 | 
			
		||||
 | 
			
		||||
static int Width = 400;
 | 
			
		||||
static int Height = 200;
 | 
			
		||||
static const GLfloat Near = 5.0, Far = 25.0;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static void Display( void )
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static void Reshape( int width, int height )
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static void Key( unsigned char key, int x, int y )
 | 
			
		||||
{
 | 
			
		||||
   (void) x;
 | 
			
		||||
   (void) y;
 | 
			
		||||
   switch (key) {
 | 
			
		||||
      case 27:
 | 
			
		||||
         exit(0);
 | 
			
		||||
         break;
 | 
			
		||||
   }
 | 
			
		||||
   glutPostRedisplay();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static void Init( void )
 | 
			
		||||
{
 | 
			
		||||
   unsigned i;
 | 
			
		||||
   static const GLenum pnames[] = {
 | 
			
		||||
      GL_TEXTURE_RED_SIZE,
 | 
			
		||||
      GL_TEXTURE_GREEN_SIZE,
 | 
			
		||||
      GL_TEXTURE_BLUE_SIZE,
 | 
			
		||||
      GL_TEXTURE_ALPHA_SIZE,
 | 
			
		||||
      GL_TEXTURE_LUMINANCE_SIZE,
 | 
			
		||||
      GL_TEXTURE_INTENSITY_SIZE,
 | 
			
		||||
      GL_TEXTURE_BORDER,
 | 
			
		||||
      GL_TEXTURE_INTERNAL_FORMAT,
 | 
			
		||||
      GL_TEXTURE_WIDTH,
 | 
			
		||||
      GL_TEXTURE_HEIGHT,
 | 
			
		||||
      GL_TEXTURE_DEPTH,
 | 
			
		||||
      ~0
 | 
			
		||||
   };
 | 
			
		||||
   
 | 
			
		||||
       
 | 
			
		||||
   printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
 | 
			
		||||
   printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
 | 
			
		||||
 | 
			
		||||
   printf("\nThis program should log some data about a texture and exit.\n");
 | 
			
		||||
   printf("This is a regression test for bug #3050.  If the bug still\n");
 | 
			
		||||
   printf("exists, a GLX protocol error will be generated.\n");
 | 
			
		||||
   printf("https://bugs.freedesktop.org/show_bug.cgi?id=3050\n\n");
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
   if ( ! glutExtensionSupported( "GL_NV_texture_rectangle" )
 | 
			
		||||
	&& ! glutExtensionSupported( "GL_EXT_texture_rectangle" )
 | 
			
		||||
	&& ! glutExtensionSupported( "GL_ARB_texture_rectangle" ) ) {
 | 
			
		||||
      printf( "This test requires one of GL_ARB_texture_rectangle, GL_EXT_texture_rectangle,\n"
 | 
			
		||||
	      "or GL_NV_texture_rectangle be supported\n." );
 | 
			
		||||
      exit( 1 );
 | 
			
		||||
   }
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
   glBindTexture( GL_TEXTURE_RECTANGLE_NV, 1 );
 | 
			
		||||
   glTexImage2D( GL_PROXY_TEXTURE_RECTANGLE_NV, 0, GL_RGBA, 8, 8, 0,
 | 
			
		||||
		 GL_RGBA, GL_UNSIGNED_BYTE, NULL );
 | 
			
		||||
 | 
			
		||||
   for ( i = 0 ; pnames[i] != ~0 ; i++ ) {
 | 
			
		||||
      GLint param_i;
 | 
			
		||||
      GLfloat param_f;
 | 
			
		||||
      GLenum err;
 | 
			
		||||
 | 
			
		||||
      glGetTexLevelParameteriv( GL_PROXY_TEXTURE_RECTANGLE_NV, 0, pnames[i], & param_i );
 | 
			
		||||
      err = glGetError();
 | 
			
		||||
 | 
			
		||||
      if ( err ) {
 | 
			
		||||
	 printf("glGetTexLevelParameteriv(GL_PROXY_TEXTURE_RECTANGLE_NV, 0, 0x%04x, & param) generated a GL\n"
 | 
			
		||||
		"error of 0x%04x!",
 | 
			
		||||
		pnames[i], err );
 | 
			
		||||
	 exit( 1 );
 | 
			
		||||
      }
 | 
			
		||||
      else {
 | 
			
		||||
	 printf("glGetTexLevelParameteriv(GL_PROXY_TEXTURE_RECTANGLE_NV, 0, 0x%04x, & param) = 0x%04x\n",
 | 
			
		||||
		pnames[i], param_i );
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
      glGetTexLevelParameterfv( GL_PROXY_TEXTURE_RECTANGLE_NV, 0, pnames[i], & param_f );
 | 
			
		||||
      err = glGetError();
 | 
			
		||||
 | 
			
		||||
      if ( err ) {
 | 
			
		||||
	 printf("glGetTexLevelParameterfv(GL_PROXY_TEXTURE_RECTANGLE_NV, 0, 0x%04x, & param) generated a GL\n"
 | 
			
		||||
		"error of 0x%04x!\n",
 | 
			
		||||
		pnames[i], err );
 | 
			
		||||
	 exit( 1 );
 | 
			
		||||
      }
 | 
			
		||||
      else {
 | 
			
		||||
	 printf("glGetTexLevelParameterfv(GL_PROXY_TEXTURE_RECTANGLE_NV, 0, 0x%04x, & param) = %.1f (0x%04x)\n",
 | 
			
		||||
		pnames[i], param_f, (GLint) param_f );
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
int main( int argc, char *argv[] )
 | 
			
		||||
{
 | 
			
		||||
   glutInit( &argc, argv );
 | 
			
		||||
   glutInitWindowPosition( 0, 0 );
 | 
			
		||||
   glutInitWindowSize( Width, Height );
 | 
			
		||||
   glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
 | 
			
		||||
   glutCreateWindow( "Bug #3050 Test" );
 | 
			
		||||
   glutReshapeFunc( Reshape );
 | 
			
		||||
   glutKeyboardFunc( Key );
 | 
			
		||||
   glutDisplayFunc( Display );
 | 
			
		||||
   Init();
 | 
			
		||||
   return 0;
 | 
			
		||||
}
 | 
			
		||||
@@ -185,8 +185,8 @@ static void Init( void )
 | 
			
		||||
   printf("\nThis program should function nearly identically to Mesa's lodbias demo.\n"
 | 
			
		||||
	  "It should cycle through the complet LOD bias range once and exit.  If bug\n"
 | 
			
		||||
	  "#3195 still exists, the demo should crash almost immediatly.\n");
 | 
			
		||||
   printf("This is a regression test for bug #3195.\n");
 | 
			
		||||
   printf("https://bugs.freedesktop.org/show_bug.cgi?id=3195\n");
 | 
			
		||||
   printf("This is a regression test for bug #3101.\n");
 | 
			
		||||
   printf("https://bugs.freedesktop.org/show_bug.cgi?id=3101\n");
 | 
			
		||||
 | 
			
		||||
   if (!glutExtensionSupported("GL_EXT_texture_lod_bias")) {
 | 
			
		||||
      printf("Sorry, GL_EXT_texture_lod_bias not supported by this renderer.\n");
 | 
			
		||||
 
 | 
			
		||||
@@ -1,259 +0,0 @@
 | 
			
		||||
/*
 | 
			
		||||
 * Measure glCopyPixels speed
 | 
			
		||||
 *
 | 
			
		||||
 * Brian Paul
 | 
			
		||||
 * 26 Jan 2006
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define GL_GLEXT_PROTOTYPES
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#include <string.h>
 | 
			
		||||
#include <math.h>
 | 
			
		||||
#include <GL/glut.h>
 | 
			
		||||
 | 
			
		||||
static GLint WinWidth = 1000, WinHeight = 800;
 | 
			
		||||
static GLint ImgWidth, ImgHeight;
 | 
			
		||||
 | 
			
		||||
static GLenum Buffer = GL_FRONT;
 | 
			
		||||
static GLenum AlphaTest = GL_FALSE;
 | 
			
		||||
static GLboolean UseBlit = GL_FALSE;
 | 
			
		||||
 | 
			
		||||
static PFNGLBLITFRAMEBUFFEREXTPROC glBlitFramebufferEXT_func = NULL;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * draw teapot in lower-left corner of window
 | 
			
		||||
 */
 | 
			
		||||
static void
 | 
			
		||||
DrawTestImage(void)
 | 
			
		||||
{
 | 
			
		||||
   GLfloat ar;
 | 
			
		||||
 | 
			
		||||
   ImgWidth = WinWidth / 3;
 | 
			
		||||
   ImgHeight = WinHeight / 3;
 | 
			
		||||
 | 
			
		||||
   glViewport(0, 0, ImgWidth, ImgHeight);
 | 
			
		||||
   glScissor(0, 0, ImgWidth, ImgHeight);
 | 
			
		||||
   glEnable(GL_SCISSOR_TEST);
 | 
			
		||||
 | 
			
		||||
   glClearColor(0.5, 0.5, 0.5, 0.0);
 | 
			
		||||
   glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
 | 
			
		||||
 | 
			
		||||
   ar = (float) WinWidth / WinHeight;
 | 
			
		||||
 | 
			
		||||
   glMatrixMode(GL_PROJECTION);
 | 
			
		||||
   glLoadIdentity();
 | 
			
		||||
   glFrustum(-ar, ar, -1.0, 1.0, 5.0, 25.0);
 | 
			
		||||
   glMatrixMode(GL_MODELVIEW);
 | 
			
		||||
 | 
			
		||||
   glEnable(GL_LIGHTING);
 | 
			
		||||
   glEnable(GL_LIGHT0);
 | 
			
		||||
   glEnable(GL_DEPTH_TEST);
 | 
			
		||||
   glFrontFace(GL_CW);
 | 
			
		||||
   glPushMatrix();
 | 
			
		||||
   glRotatef(45, 1, 0, 0);
 | 
			
		||||
   glutSolidTeapot(2.0);
 | 
			
		||||
   glPopMatrix();
 | 
			
		||||
   glFrontFace(GL_CCW);
 | 
			
		||||
   glDisable(GL_DEPTH_TEST);
 | 
			
		||||
   glDisable(GL_LIGHTING);
 | 
			
		||||
 | 
			
		||||
   glDisable(GL_SCISSOR_TEST);
 | 
			
		||||
 | 
			
		||||
   glViewport(0, 0, WinWidth, WinHeight);
 | 
			
		||||
   glFinish();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static int
 | 
			
		||||
Rand(int max)
 | 
			
		||||
{
 | 
			
		||||
   return ((int) random()) % max;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Measure glCopyPixels rate
 | 
			
		||||
 */
 | 
			
		||||
static void
 | 
			
		||||
RunTest(void)
 | 
			
		||||
{
 | 
			
		||||
   double t1, t0 = glutGet(GLUT_ELAPSED_TIME) / 1000.0;
 | 
			
		||||
   int iters = 0;
 | 
			
		||||
   float copyRate, mbRate;
 | 
			
		||||
   int r, g, b, a, bpp;
 | 
			
		||||
 | 
			
		||||
   if (AlphaTest) {
 | 
			
		||||
      glEnable(GL_ALPHA_TEST);
 | 
			
		||||
      glAlphaFunc(GL_GREATER, 0.0);
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   glGetIntegerv(GL_RED_BITS, &r);
 | 
			
		||||
   glGetIntegerv(GL_GREEN_BITS, &g);
 | 
			
		||||
   glGetIntegerv(GL_BLUE_BITS, &b);
 | 
			
		||||
   glGetIntegerv(GL_ALPHA_BITS, &a);
 | 
			
		||||
   bpp = (r + g + b + a) / 8;
 | 
			
		||||
 | 
			
		||||
   do {
 | 
			
		||||
      int x, y;
 | 
			
		||||
      x = Rand(WinWidth);
 | 
			
		||||
      y = Rand(WinHeight);
 | 
			
		||||
 | 
			
		||||
      if (x > ImgWidth || y > ImgHeight) {
 | 
			
		||||
#ifdef GL_EXT_framebuffer_blit
 | 
			
		||||
         if (UseBlit)
 | 
			
		||||
         {
 | 
			
		||||
            glBlitFramebufferEXT_func(0, 0, ImgWidth, ImgHeight,
 | 
			
		||||
                                      x, y, x + ImgWidth, y + ImgHeight,
 | 
			
		||||
                                      GL_COLOR_BUFFER_BIT, GL_LINEAR);
 | 
			
		||||
         }
 | 
			
		||||
         else
 | 
			
		||||
#endif
 | 
			
		||||
         {
 | 
			
		||||
            glWindowPos2iARB(x, y);
 | 
			
		||||
            glCopyPixels(0, 0, ImgWidth, ImgHeight, GL_COLOR);
 | 
			
		||||
         }
 | 
			
		||||
         glFinish(); /* XXX OK? */
 | 
			
		||||
 | 
			
		||||
         iters++;
 | 
			
		||||
 | 
			
		||||
         t1 = glutGet(GLUT_ELAPSED_TIME) / 1000.0;
 | 
			
		||||
      }
 | 
			
		||||
   } while (t1 - t0 < 5.0);
 | 
			
		||||
 | 
			
		||||
   glDisable(GL_ALPHA_TEST);
 | 
			
		||||
 | 
			
		||||
   copyRate = iters / (t1 - t0);
 | 
			
		||||
   mbRate = ImgWidth * ImgHeight * bpp * copyRate / (1024 * 1024);
 | 
			
		||||
 | 
			
		||||
   printf("Image size: %d x %d, %d Bpp\n", ImgWidth, ImgHeight, bpp);
 | 
			
		||||
   printf("%d copies in %.2f = %.2f copies/sec, %.2f MB/s\n",
 | 
			
		||||
          iters, t1-t0, copyRate, mbRate);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
Draw(void)
 | 
			
		||||
{
 | 
			
		||||
   glClearColor(0.0, 0.0, 0.0, 0.0);
 | 
			
		||||
   glClearColor(0.2, 0.2, 0.8, 0);
 | 
			
		||||
   glReadBuffer(Buffer);
 | 
			
		||||
   glDrawBuffer(Buffer);
 | 
			
		||||
   glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
 | 
			
		||||
 | 
			
		||||
   DrawTestImage();
 | 
			
		||||
 | 
			
		||||
   RunTest();
 | 
			
		||||
 | 
			
		||||
   if (Buffer == GL_FRONT)
 | 
			
		||||
      glFinish();
 | 
			
		||||
   else
 | 
			
		||||
      glutSwapBuffers();
 | 
			
		||||
 | 
			
		||||
   printf("exiting\n");
 | 
			
		||||
   exit(0);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
Reshape(int width, int height)
 | 
			
		||||
{
 | 
			
		||||
   glViewport(0, 0, width, height);
 | 
			
		||||
   glMatrixMode(GL_PROJECTION);
 | 
			
		||||
   glLoadIdentity();
 | 
			
		||||
   glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0, 25.0);
 | 
			
		||||
   glMatrixMode(GL_MODELVIEW);
 | 
			
		||||
   glLoadIdentity();
 | 
			
		||||
   glTranslatef(0.0, 0.0, -15.0);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
Key(unsigned char key, int x, int y)
 | 
			
		||||
{
 | 
			
		||||
   (void) x;
 | 
			
		||||
   (void) y;
 | 
			
		||||
   switch (key) {
 | 
			
		||||
      case 27:
 | 
			
		||||
         exit(0);
 | 
			
		||||
         break;
 | 
			
		||||
   }
 | 
			
		||||
   glutPostRedisplay();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
SpecialKey(int key, int x, int y)
 | 
			
		||||
{
 | 
			
		||||
   (void) x;
 | 
			
		||||
   (void) y;
 | 
			
		||||
   switch (key) {
 | 
			
		||||
      case GLUT_KEY_UP:
 | 
			
		||||
         break;
 | 
			
		||||
      case GLUT_KEY_DOWN:
 | 
			
		||||
         break;
 | 
			
		||||
      case GLUT_KEY_LEFT:
 | 
			
		||||
         break;
 | 
			
		||||
      case GLUT_KEY_RIGHT:
 | 
			
		||||
         break;
 | 
			
		||||
   }
 | 
			
		||||
   glutPostRedisplay();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
ParseArgs(int argc, char *argv[])
 | 
			
		||||
{
 | 
			
		||||
   int i;
 | 
			
		||||
   for (i = 1; i < argc; i++) {
 | 
			
		||||
      if (strcmp(argv[i], "-back") == 0)
 | 
			
		||||
         Buffer = GL_BACK;
 | 
			
		||||
      else if (strcmp(argv[i], "-alpha") == 0)
 | 
			
		||||
         AlphaTest = GL_TRUE;
 | 
			
		||||
      else if (strcmp(argv[i], "-blit") == 0)
 | 
			
		||||
         UseBlit = GL_TRUE;
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
Init(void)
 | 
			
		||||
{
 | 
			
		||||
   if (glutExtensionSupported("GL_EXT_framebuffer_blit")) {
 | 
			
		||||
      glBlitFramebufferEXT_func = (PFNGLBLITFRAMEBUFFEREXTPROC)
 | 
			
		||||
         glutGetProcAddress("glBlitFramebufferEXT");
 | 
			
		||||
   }
 | 
			
		||||
   else if (UseBlit) {
 | 
			
		||||
      printf("Warning: GL_EXT_framebuffer_blit not supported.\n");
 | 
			
		||||
      UseBlit = GL_FALSE;
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
main(int argc, char *argv[])
 | 
			
		||||
{
 | 
			
		||||
   GLint mode = GLUT_RGB | GLUT_ALPHA | GLUT_DOUBLE | GLUT_DEPTH;
 | 
			
		||||
   glutInit(&argc, argv);
 | 
			
		||||
 | 
			
		||||
   ParseArgs(argc, argv);
 | 
			
		||||
   if (AlphaTest)
 | 
			
		||||
      mode |= GLUT_ALPHA;
 | 
			
		||||
 | 
			
		||||
   glutInitWindowPosition(0, 0);
 | 
			
		||||
   glutInitWindowSize(WinWidth, WinHeight);
 | 
			
		||||
   glutInitDisplayMode(mode);
 | 
			
		||||
   glutCreateWindow(argv[0]);
 | 
			
		||||
   glutReshapeFunc(Reshape);
 | 
			
		||||
   glutKeyboardFunc(Key);
 | 
			
		||||
   glutSpecialFunc(SpecialKey);
 | 
			
		||||
   glutDisplayFunc(Draw);
 | 
			
		||||
 | 
			
		||||
   printf("GL_RENDERER: %s\n", (char *) glGetString(GL_RENDERER));
 | 
			
		||||
   printf("Draw Buffer: %s\n", (Buffer == GL_BACK) ? "Back" : "Front");
 | 
			
		||||
   Init();
 | 
			
		||||
 | 
			
		||||
   glutMainLoop();
 | 
			
		||||
   return 0;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										204
									
								
								progs/tests/fbotest2.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										204
									
								
								progs/tests/fbotest2.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,204 @@
 | 
			
		||||
/*
 | 
			
		||||
 * Test GL_EXT_framebuffer_object
 | 
			
		||||
 *
 | 
			
		||||
 * Brian Paul
 | 
			
		||||
 * 19 Mar 2006
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#define GL_GLEXT_PROTOTYPES
 | 
			
		||||
#include <assert.h>
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#include <math.h>
 | 
			
		||||
#include <GL/glut.h>
 | 
			
		||||
 | 
			
		||||
static int Width = 400, Height = 400;
 | 
			
		||||
static GLuint MyFB, ColorRb, DepthRb;
 | 
			
		||||
static GLboolean Animate = GL_FALSE;
 | 
			
		||||
static GLfloat Rotation = 0.0;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
CheckError(int line)
 | 
			
		||||
{
 | 
			
		||||
   GLenum err = glGetError();
 | 
			
		||||
   if (err) {
 | 
			
		||||
      printf("fbotest1: GL Error 0x%x at line %d\n", (int) err, line);
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
Display( void )
 | 
			
		||||
{
 | 
			
		||||
   GLubyte *buffer = malloc(Width * Height * 4);
 | 
			
		||||
   GLenum status;
 | 
			
		||||
 | 
			
		||||
   printf("Drawing\n");
 | 
			
		||||
 | 
			
		||||
   CheckError(__LINE__);
 | 
			
		||||
 | 
			
		||||
   /* draw to user framebuffer */
 | 
			
		||||
   glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB);
 | 
			
		||||
   glDrawBuffer(GL_COLOR_ATTACHMENT1_EXT);
 | 
			
		||||
   glReadBuffer(GL_COLOR_ATTACHMENT1_EXT);
 | 
			
		||||
 | 
			
		||||
   status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
 | 
			
		||||
   if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
 | 
			
		||||
      printf("fbotest1: Error: Framebuffer is incomplete!!!\n");
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   CheckError(__LINE__);
 | 
			
		||||
 | 
			
		||||
   glClearColor(0.5, 0.5, 1.0, 0.0);
 | 
			
		||||
   glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
 | 
			
		||||
 | 
			
		||||
   glEnable(GL_DEPTH_TEST);
 | 
			
		||||
   glEnable(GL_LIGHTING);
 | 
			
		||||
   glEnable(GL_LIGHT0);
 | 
			
		||||
 | 
			
		||||
   glPushMatrix();
 | 
			
		||||
   glRotatef(30.0, 1, 0, 0);
 | 
			
		||||
   glRotatef(Rotation, 0, 1, 0);
 | 
			
		||||
   glutSolidTeapot(2.0);
 | 
			
		||||
   glPopMatrix();
 | 
			
		||||
 | 
			
		||||
   glDisable(GL_DEPTH_TEST);
 | 
			
		||||
   glDisable(GL_LIGHTING);
 | 
			
		||||
 | 
			
		||||
   /* read from user framebuffer */
 | 
			
		||||
   glReadPixels(0, 0, Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
 | 
			
		||||
 | 
			
		||||
   /* draw to window */
 | 
			
		||||
   glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
 | 
			
		||||
   glWindowPos2iARB(0, 0);
 | 
			
		||||
   glDrawPixels(Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
 | 
			
		||||
 | 
			
		||||
   free(buffer);
 | 
			
		||||
   glutSwapBuffers();
 | 
			
		||||
   CheckError(__LINE__);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
Reshape( int width, int height )
 | 
			
		||||
{
 | 
			
		||||
   float ar = (float) width / (float) height;
 | 
			
		||||
 | 
			
		||||
   glViewport( 0, 0, width, height );
 | 
			
		||||
   glMatrixMode( GL_PROJECTION );
 | 
			
		||||
   glLoadIdentity();
 | 
			
		||||
   glFrustum( -ar, ar, -1.0, 1.0, 5.0, 25.0 );
 | 
			
		||||
 | 
			
		||||
   glMatrixMode( GL_MODELVIEW );
 | 
			
		||||
   glLoadIdentity();
 | 
			
		||||
   glTranslatef( 0.0, 0.0, -15.0 );
 | 
			
		||||
 | 
			
		||||
   glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, ColorRb);
 | 
			
		||||
   glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGB, width, height);
 | 
			
		||||
   glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, DepthRb);
 | 
			
		||||
   glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT,
 | 
			
		||||
                            width, height);
 | 
			
		||||
 | 
			
		||||
   Width = width;
 | 
			
		||||
   Height = height;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
CleanUp(void)
 | 
			
		||||
{
 | 
			
		||||
   glDeleteFramebuffersEXT(1, &MyFB);
 | 
			
		||||
   glDeleteRenderbuffersEXT(1, &ColorRb);
 | 
			
		||||
   glDeleteRenderbuffersEXT(1, &DepthRb);
 | 
			
		||||
   assert(!glIsFramebufferEXT(MyFB));
 | 
			
		||||
   assert(!glIsRenderbufferEXT(ColorRb));
 | 
			
		||||
   assert(!glIsRenderbufferEXT(DepthRb));
 | 
			
		||||
   exit(0);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
Idle(void)
 | 
			
		||||
{
 | 
			
		||||
   Rotation = glutGet(GLUT_ELAPSED_TIME) * 0.1;
 | 
			
		||||
   glutPostRedisplay();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
Key( unsigned char key, int x, int y )
 | 
			
		||||
{
 | 
			
		||||
   (void) x;
 | 
			
		||||
   (void) y;
 | 
			
		||||
   switch (key) {
 | 
			
		||||
   case 'a':
 | 
			
		||||
      Animate = !Animate;
 | 
			
		||||
      if (Animate)
 | 
			
		||||
         glutIdleFunc(Idle);
 | 
			
		||||
      else
 | 
			
		||||
         glutIdleFunc(NULL);
 | 
			
		||||
      break;
 | 
			
		||||
   case 27:
 | 
			
		||||
      CleanUp();
 | 
			
		||||
      break;
 | 
			
		||||
   }
 | 
			
		||||
   glutPostRedisplay();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
Init( void )
 | 
			
		||||
{
 | 
			
		||||
   if (!glutExtensionSupported("GL_EXT_framebuffer_object")) {
 | 
			
		||||
      printf("fbotest1: GL_EXT_framebuffer_object not found!\n");
 | 
			
		||||
      exit(0);
 | 
			
		||||
   }
 | 
			
		||||
   printf("fbotest1: GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
 | 
			
		||||
 | 
			
		||||
   glGenFramebuffersEXT(1, &MyFB);
 | 
			
		||||
   glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB);
 | 
			
		||||
   assert(glIsFramebufferEXT(MyFB));
 | 
			
		||||
 | 
			
		||||
   /* set color buffer */
 | 
			
		||||
   glGenRenderbuffersEXT(1, &ColorRb);
 | 
			
		||||
   glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, ColorRb);
 | 
			
		||||
   assert(glIsRenderbufferEXT(ColorRb));
 | 
			
		||||
   glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT1_EXT,
 | 
			
		||||
                                GL_RENDERBUFFER_EXT, ColorRb);
 | 
			
		||||
   glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGB, Width, Height);
 | 
			
		||||
 | 
			
		||||
   /* setup depth buffer */
 | 
			
		||||
   glGenRenderbuffersEXT(1, &DepthRb);
 | 
			
		||||
   glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, DepthRb);
 | 
			
		||||
   assert(glIsRenderbufferEXT(DepthRb));
 | 
			
		||||
   glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
 | 
			
		||||
                                GL_RENDERBUFFER_EXT, DepthRb);
 | 
			
		||||
   glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, Width, Height);
 | 
			
		||||
 | 
			
		||||
   CheckError(__LINE__);
 | 
			
		||||
 | 
			
		||||
   /* restore to default */
 | 
			
		||||
   glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
 | 
			
		||||
   CheckError(__LINE__);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
main( int argc, char *argv[] )
 | 
			
		||||
{
 | 
			
		||||
   glutInit( &argc, argv );
 | 
			
		||||
   glutInitWindowPosition( 0, 0 );
 | 
			
		||||
   glutInitWindowSize(Width, Height);
 | 
			
		||||
   glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
 | 
			
		||||
   glutCreateWindow(argv[0]);
 | 
			
		||||
   glutReshapeFunc( Reshape );
 | 
			
		||||
   glutKeyboardFunc( Key );
 | 
			
		||||
   glutDisplayFunc( Display );
 | 
			
		||||
   if (Animate)
 | 
			
		||||
      glutIdleFunc(Idle);
 | 
			
		||||
   Init();
 | 
			
		||||
   glutMainLoop();
 | 
			
		||||
   return 0;
 | 
			
		||||
}
 | 
			
		||||
@@ -20,23 +20,16 @@
 | 
			
		||||
/* For debug */
 | 
			
		||||
#define DEPTH 1
 | 
			
		||||
#define STENCIL 1
 | 
			
		||||
#define DRAW 1
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static int Width = 400, Height = 400;
 | 
			
		||||
 | 
			
		||||
static GLenum TexTarget = GL_TEXTURE_2D; /*GL_TEXTURE_RECTANGLE_ARB;*/
 | 
			
		||||
static int TexWidth = 512, TexHeight = 512;
 | 
			
		||||
/*static int TexWidth = 600, TexHeight = 600;*/
 | 
			
		||||
 | 
			
		||||
static GLuint MyFB;
 | 
			
		||||
static GLuint TexObj;
 | 
			
		||||
static GLuint DepthRB, StencilRB;
 | 
			
		||||
static GLboolean Anim = GL_FALSE;
 | 
			
		||||
static GLfloat Rot = 0.0;
 | 
			
		||||
static GLboolean UsePackedDepthStencil = GL_FALSE;
 | 
			
		||||
static GLuint TextureLevel = 1;  /* which texture level to render to */
 | 
			
		||||
static GLenum TexIntFormat = GL_RGB; /* either GL_RGB or GL_RGBA */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
@@ -52,7 +45,7 @@ CheckError(int line)
 | 
			
		||||
static void
 | 
			
		||||
Idle(void)
 | 
			
		||||
{
 | 
			
		||||
   Rot = glutGet(GLUT_ELAPSED_TIME) * 0.1;
 | 
			
		||||
   Rot = glutGet(GLUT_ELAPSED_TIME) * 0.05;
 | 
			
		||||
   glutPostRedisplay();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -60,6 +53,7 @@ Idle(void)
 | 
			
		||||
static void
 | 
			
		||||
RenderTexture(void)
 | 
			
		||||
{
 | 
			
		||||
   GLint level = 0;
 | 
			
		||||
   GLenum status;
 | 
			
		||||
 | 
			
		||||
   glMatrixMode(GL_PROJECTION);
 | 
			
		||||
@@ -70,7 +64,10 @@ RenderTexture(void)
 | 
			
		||||
   glTranslatef(0.0, 0.0, -15.0);
 | 
			
		||||
 | 
			
		||||
   /* draw to texture image */
 | 
			
		||||
   glBindTexture(GL_TEXTURE_2D, 0);
 | 
			
		||||
   glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB);
 | 
			
		||||
   glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
 | 
			
		||||
                             GL_TEXTURE_2D, TexObj, level);
 | 
			
		||||
 | 
			
		||||
   status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
 | 
			
		||||
   if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
 | 
			
		||||
@@ -85,7 +82,6 @@ RenderTexture(void)
 | 
			
		||||
 | 
			
		||||
#if DEPTH
 | 
			
		||||
   glEnable(GL_DEPTH_TEST);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if STENCIL
 | 
			
		||||
   glEnable(GL_STENCIL_TEST);
 | 
			
		||||
@@ -95,7 +91,6 @@ RenderTexture(void)
 | 
			
		||||
 | 
			
		||||
   CheckError(__LINE__);
 | 
			
		||||
 | 
			
		||||
#if DEPTH || STENCIL
 | 
			
		||||
   /* draw diamond-shaped stencil pattern */
 | 
			
		||||
   glColor3f(0, 1, 0);
 | 
			
		||||
   glBegin(GL_POLYGON);
 | 
			
		||||
@@ -104,7 +99,6 @@ RenderTexture(void)
 | 
			
		||||
   glVertex2f( 0.2,  0.0);
 | 
			
		||||
   glVertex2f( 0.0,  0.2);
 | 
			
		||||
   glEnd();
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
   /* draw teapot where stencil != 1 */
 | 
			
		||||
#if STENCIL
 | 
			
		||||
@@ -113,6 +107,7 @@ RenderTexture(void)
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
   CheckError(__LINE__);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if 0
 | 
			
		||||
   glBegin(GL_POLYGON);
 | 
			
		||||
@@ -131,18 +126,12 @@ RenderTexture(void)
 | 
			
		||||
   glutSolidTeapot(0.5);
 | 
			
		||||
   glPopMatrix();
 | 
			
		||||
   glDisable(GL_LIGHTING);
 | 
			
		||||
   /*
 | 
			
		||||
   PrintStencilHistogram(TexWidth, TexHeight);
 | 
			
		||||
   */
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
   glDisable(GL_DEPTH_TEST);
 | 
			
		||||
   glDisable(GL_STENCIL_TEST);
 | 
			
		||||
 | 
			
		||||
#if DRAW
 | 
			
		||||
   /* Bind normal framebuffer */
 | 
			
		||||
   glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
   CheckError(__LINE__);
 | 
			
		||||
}
 | 
			
		||||
@@ -157,7 +146,7 @@ Display(void)
 | 
			
		||||
   RenderTexture();
 | 
			
		||||
 | 
			
		||||
   /* draw textured quad in the window */
 | 
			
		||||
#if DRAW
 | 
			
		||||
 | 
			
		||||
   glMatrixMode(GL_PROJECTION);
 | 
			
		||||
   glLoadIdentity();
 | 
			
		||||
   glFrustum(-ar, ar, -1.0, 1.0, 5.0, 25.0);
 | 
			
		||||
@@ -172,37 +161,22 @@ Display(void)
 | 
			
		||||
 | 
			
		||||
   glPushMatrix();
 | 
			
		||||
   glRotatef(Rot, 0, 1, 0);
 | 
			
		||||
   glEnable(TexTarget);
 | 
			
		||||
   glBindTexture(TexTarget, TexObj);
 | 
			
		||||
   glEnable(GL_TEXTURE_2D);
 | 
			
		||||
   glBindTexture(GL_TEXTURE_2D, TexObj);
 | 
			
		||||
   glBegin(GL_POLYGON);
 | 
			
		||||
   glColor3f(0.25, 0.25, 0.25);
 | 
			
		||||
   if (TexTarget == GL_TEXTURE_2D) {
 | 
			
		||||
      glTexCoord2f(0, 0);
 | 
			
		||||
      glVertex2f(-1, -1);
 | 
			
		||||
      glTexCoord2f(1, 0);
 | 
			
		||||
      glVertex2f(1, -1);
 | 
			
		||||
      glColor3f(1.0, 1.0, 1.0);
 | 
			
		||||
      glTexCoord2f(1, 1);
 | 
			
		||||
      glVertex2f(1, 1);
 | 
			
		||||
      glTexCoord2f(0, 1);
 | 
			
		||||
      glVertex2f(-1, 1);
 | 
			
		||||
   }
 | 
			
		||||
   else {
 | 
			
		||||
      assert(TexTarget == GL_TEXTURE_RECTANGLE_ARB);
 | 
			
		||||
      glTexCoord2f(0, 0);
 | 
			
		||||
      glVertex2f(-1, -1);
 | 
			
		||||
      glTexCoord2f(TexWidth, 0);
 | 
			
		||||
      glVertex2f(1, -1);
 | 
			
		||||
      glColor3f(1.0, 1.0, 1.0);
 | 
			
		||||
      glTexCoord2f(TexWidth, TexHeight);
 | 
			
		||||
      glVertex2f(1, 1);
 | 
			
		||||
      glTexCoord2f(0, TexHeight);
 | 
			
		||||
      glVertex2f(-1, 1);
 | 
			
		||||
   }
 | 
			
		||||
   glTexCoord2f(0, 0);
 | 
			
		||||
   glVertex2f(-1, -1);
 | 
			
		||||
   glTexCoord2f(1, 0);
 | 
			
		||||
   glVertex2f(1, -1);
 | 
			
		||||
   glColor3f(1.0, 1.0, 1.0);
 | 
			
		||||
   glTexCoord2f(1, 1);
 | 
			
		||||
   glVertex2f(1, 1);
 | 
			
		||||
   glTexCoord2f(0, 1);
 | 
			
		||||
   glVertex2f(-1, 1);
 | 
			
		||||
   glEnd();
 | 
			
		||||
   glPopMatrix();
 | 
			
		||||
   glDisable(TexTarget);
 | 
			
		||||
#endif
 | 
			
		||||
   glDisable(GL_TEXTURE_2D);
 | 
			
		||||
   
 | 
			
		||||
   glutSwapBuffers();
 | 
			
		||||
   CheckError(__LINE__);
 | 
			
		||||
@@ -263,7 +237,6 @@ Key(unsigned char key, int x, int y)
 | 
			
		||||
static void
 | 
			
		||||
Init(int argc, char *argv[])
 | 
			
		||||
{
 | 
			
		||||
   static const GLfloat mat[4] = { 1.0, 0.5, 0.5, 1.0 };
 | 
			
		||||
   GLint i;
 | 
			
		||||
 | 
			
		||||
   if (!glutExtensionSupported("GL_EXT_framebuffer_object")) {
 | 
			
		||||
@@ -295,30 +268,6 @@ Init(int argc, char *argv[])
 | 
			
		||||
   glGetIntegerv(GL_FRAMEBUFFER_BINDING_EXT, &i);
 | 
			
		||||
   assert(i == MyFB);
 | 
			
		||||
 | 
			
		||||
   /* Make texture object/image */
 | 
			
		||||
   glGenTextures(1, &TexObj);
 | 
			
		||||
   glBindTexture(TexTarget, TexObj);
 | 
			
		||||
   /* make two image levels */
 | 
			
		||||
   glTexImage2D(TexTarget, 0, TexIntFormat, TexWidth, TexHeight, 0,
 | 
			
		||||
                GL_RGBA, GL_UNSIGNED_BYTE, NULL);
 | 
			
		||||
   glTexImage2D(TexTarget, 1, TexIntFormat, TexWidth/2, TexHeight/2, 0,
 | 
			
		||||
                GL_RGBA, GL_UNSIGNED_BYTE, NULL);
 | 
			
		||||
   TexWidth = TexWidth >> TextureLevel;
 | 
			
		||||
   TexHeight = TexHeight >> TextureLevel;
 | 
			
		||||
 | 
			
		||||
   glTexParameteri(TexTarget, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
 | 
			
		||||
   glTexParameteri(TexTarget, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
 | 
			
		||||
   glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
 | 
			
		||||
   glTexParameteri(TexTarget, GL_TEXTURE_BASE_LEVEL, TextureLevel);
 | 
			
		||||
   glTexParameteri(TexTarget, GL_TEXTURE_MAX_LEVEL, TextureLevel);
 | 
			
		||||
 | 
			
		||||
   CheckError(__LINE__);
 | 
			
		||||
 | 
			
		||||
   /* Render color to texture */
 | 
			
		||||
   glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
 | 
			
		||||
                             TexTarget, TexObj, TextureLevel);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#if DEPTH
 | 
			
		||||
   /* make depth renderbuffer */
 | 
			
		||||
   glGenRenderbuffersEXT(1, &DepthRB);
 | 
			
		||||
@@ -374,14 +323,21 @@ Init(int argc, char *argv[])
 | 
			
		||||
   assert(i > 0);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
   CheckError(__LINE__);
 | 
			
		||||
 | 
			
		||||
   /* bind regular framebuffer */
 | 
			
		||||
   glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
 | 
			
		||||
 | 
			
		||||
   CheckError(__LINE__);
 | 
			
		||||
 | 
			
		||||
   /* lighting */
 | 
			
		||||
   glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, mat);
 | 
			
		||||
   /* Make texture object/image */
 | 
			
		||||
   glGenTextures(1, &TexObj);
 | 
			
		||||
   glBindTexture(GL_TEXTURE_2D, TexObj);
 | 
			
		||||
   glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, TexWidth, TexHeight, 0,
 | 
			
		||||
                GL_RGBA, GL_UNSIGNED_BYTE, NULL);
 | 
			
		||||
   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
 | 
			
		||||
   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
 | 
			
		||||
   glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
 | 
			
		||||
 | 
			
		||||
   CheckError(__LINE__);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
/* $Id: jkrahntest.c,v 1.2 2006/01/30 17:12:10 brianp Exp $ */
 | 
			
		||||
/* $Id: jkrahntest.c,v 1.1 2002/06/16 03:57:48 brianp Exp $ */
 | 
			
		||||
 | 
			
		||||
/* This is a good test for glXSwapBuffers on non-current windows,
 | 
			
		||||
 * and the glXCopyContext function.  Fixed several Mesa/DRI bugs with
 | 
			
		||||
@@ -25,11 +25,7 @@
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#include <unistd.h>
 | 
			
		||||
#include <math.h>
 | 
			
		||||
 | 
			
		||||
#ifndef M_PI
 | 
			
		||||
#define M_PI 3.14159
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define DEGTOR (M_PI/180.0)
 | 
			
		||||
 | 
			
		||||
static int AttributeList[] = { GLX_RGBA, GLX_DOUBLEBUFFER, None };
 | 
			
		||||
 
 | 
			
		||||
@@ -15,7 +15,7 @@
 | 
			
		||||
 | 
			
		||||
#include "../util/readtex.c"  /* a hack, I know */
 | 
			
		||||
 | 
			
		||||
#define IMAGE_FILE "../images/girl.rgb"
 | 
			
		||||
#define IMAGE_FILE "../images/tree2.rgba"
 | 
			
		||||
 | 
			
		||||
static int ImgWidth, ImgHeight;
 | 
			
		||||
static GLenum ImgFormat;
 | 
			
		||||
@@ -32,8 +32,8 @@ static GLboolean Benchmark = GL_FALSE;
 | 
			
		||||
static GLuint DrawPBO, TempPBO;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static GLenum ReadFormat = GL_RGBA;
 | 
			
		||||
static GLenum ReadType = GL_UNSIGNED_BYTE;
 | 
			
		||||
static GLenum ReadFormat = GL_BGRA;
 | 
			
		||||
static GLenum ReadType = GL_UNSIGNED_INT_8_8_8_8_REV;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -17,8 +17,8 @@ static GLint TexWidth = 512, TexHeight = 512;
 | 
			
		||||
 | 
			
		||||
static GLuint TexObj = 1;
 | 
			
		||||
 | 
			
		||||
static GLenum IntFormat = GL_RGBA8;
 | 
			
		||||
static GLenum ReadFormat = GL_RGBA; /* for glReadPixels */
 | 
			
		||||
static GLenum IntFormat = GL_RGBA;
 | 
			
		||||
static GLenum ReadFormat = GL_BGRA; /* for glReadPixels */
 | 
			
		||||
 | 
			
		||||
static GLboolean DrawQuad = GL_TRUE;
 | 
			
		||||
 | 
			
		||||
@@ -77,7 +77,7 @@ DoCopyTex(GLboolean doSubRect)
 | 
			
		||||
      int w = TexWidth / 2, h = TexHeight / 2;
 | 
			
		||||
      int x0 = 0, y0 = 0;
 | 
			
		||||
      int x1 = w, y1 = h;
 | 
			
		||||
#if 1
 | 
			
		||||
#if 0
 | 
			
		||||
      glCopyTexSubImage2D(GL_TEXTURE_2D, 0, x0, y0, x0, y0, w, h);
 | 
			
		||||
      glCopyTexSubImage2D(GL_TEXTURE_2D, 0, x1, y0, x1, y0, w, h);
 | 
			
		||||
      glCopyTexSubImage2D(GL_TEXTURE_2D, 0, x0, y1, x0, y1, w, h);
 | 
			
		||||
@@ -110,26 +110,31 @@ SubTex(GLboolean doSubRect, const GLubyte *image)
 | 
			
		||||
      int x1 = w, y1 = h;
 | 
			
		||||
      glPixelStorei(GL_UNPACK_ROW_LENGTH, TexWidth);
 | 
			
		||||
      glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
 | 
			
		||||
      glPixelStorei( GL_PACK_INVERT_MESA, GL_TRUE );
 | 
			
		||||
 | 
			
		||||
      glPixelStorei(GL_UNPACK_SKIP_ROWS, y0);
 | 
			
		||||
      glPixelStorei(GL_UNPACK_SKIP_PIXELS, x0);
 | 
			
		||||
       glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); 
 | 
			
		||||
       glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); 
 | 
			
		||||
/*       glPixelStorei(GL_UNPACK_SKIP_ROWS, y0); */
 | 
			
		||||
/*       glPixelStorei(GL_UNPACK_SKIP_PIXELS, x0); */
 | 
			
		||||
      glTexSubImage2D(GL_TEXTURE_2D, 0, x0, y0, w, h,
 | 
			
		||||
                      ReadFormat, GL_UNSIGNED_BYTE, image);
 | 
			
		||||
 | 
			
		||||
      glPixelStorei(GL_UNPACK_SKIP_ROWS, y0);
 | 
			
		||||
      glPixelStorei(GL_UNPACK_SKIP_PIXELS, x1);
 | 
			
		||||
/*       glPixelStorei(GL_UNPACK_SKIP_ROWS, y0); */
 | 
			
		||||
/*       glPixelStorei(GL_UNPACK_SKIP_PIXELS, x1); */
 | 
			
		||||
      glTexSubImage2D(GL_TEXTURE_2D, 0, x1, y0, w, h,
 | 
			
		||||
                      ReadFormat, GL_UNSIGNED_BYTE, image);
 | 
			
		||||
 | 
			
		||||
      glPixelStorei(GL_UNPACK_SKIP_ROWS, y1);
 | 
			
		||||
      glPixelStorei(GL_UNPACK_SKIP_PIXELS, x0);
 | 
			
		||||
/*       glPixelStorei(GL_UNPACK_SKIP_ROWS, y1); */
 | 
			
		||||
/*       glPixelStorei(GL_UNPACK_SKIP_PIXELS, x0); */
 | 
			
		||||
      glTexSubImage2D(GL_TEXTURE_2D, 0, x0, y1, w, h,
 | 
			
		||||
                      ReadFormat, GL_UNSIGNED_BYTE, image);
 | 
			
		||||
 | 
			
		||||
      glPixelStorei(GL_UNPACK_SKIP_ROWS, y1);
 | 
			
		||||
      glPixelStorei(GL_UNPACK_SKIP_PIXELS, x1);
 | 
			
		||||
/*       glPixelStorei(GL_UNPACK_SKIP_ROWS, y1); */
 | 
			
		||||
/*       glPixelStorei(GL_UNPACK_SKIP_PIXELS, x1); */
 | 
			
		||||
      glTexSubImage2D(GL_TEXTURE_2D, 0, x1, y1, w, h,
 | 
			
		||||
                      ReadFormat, GL_UNSIGNED_BYTE, image);
 | 
			
		||||
      glPixelStorei( GL_PACK_INVERT_MESA, GL_FALSE );
 | 
			
		||||
      
 | 
			
		||||
   }
 | 
			
		||||
   else {
 | 
			
		||||
      /* all at once */
 | 
			
		||||
@@ -173,6 +178,9 @@ RunTest(GLboolean copyTex, GLboolean doSubRect)
 | 
			
		||||
 | 
			
		||||
   t0 = glutGet(GLUT_ELAPSED_TIME) / 1000.0;
 | 
			
		||||
 | 
			
		||||
   if (!DrawQuad)
 | 
			
		||||
      glDrawBuffer(GL_FRONT);
 | 
			
		||||
 | 
			
		||||
   do {
 | 
			
		||||
      if (copyTex)
 | 
			
		||||
         /* Framebuffer -> Texture */
 | 
			
		||||
@@ -194,16 +202,36 @@ RunTest(GLboolean copyTex, GLboolean doSubRect)
 | 
			
		||||
               glTexCoord2f(0, 1);  glVertex2f(-1,  1);
 | 
			
		||||
            glEnd();
 | 
			
		||||
         glPopMatrix();
 | 
			
		||||
	 glutSwapBuffers();
 | 
			
		||||
      }
 | 
			
		||||
      else {
 | 
			
		||||
	 /* Draw something tiny to ensure that the texture is really
 | 
			
		||||
	  * uploaded:
 | 
			
		||||
	  */
 | 
			
		||||
         glPushMatrix();
 | 
			
		||||
            glRotatef(rot, 0, 0, 1);
 | 
			
		||||
            glTranslatef(1, 0, 0);
 | 
			
		||||
            glBegin(GL_POLYGON);
 | 
			
		||||
               glTexCoord2f(0, 0);  glVertex2f(-.01, -.01);
 | 
			
		||||
               glTexCoord2f(.01, 0);  glVertex2f( .01, -.01);
 | 
			
		||||
               glTexCoord2f(.01, .01);  glVertex2f( .01,  .01);
 | 
			
		||||
               glTexCoord2f(0, .01);  glVertex2f(-.01,  .01);
 | 
			
		||||
            glEnd();
 | 
			
		||||
         glPopMatrix();
 | 
			
		||||
	 glFlush();
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      iters++;
 | 
			
		||||
      rot += 2.0;
 | 
			
		||||
 | 
			
		||||
      t1 = glutGet(GLUT_ELAPSED_TIME) / 1000.0;
 | 
			
		||||
      if (DrawQuad) {
 | 
			
		||||
         glutSwapBuffers();
 | 
			
		||||
      }
 | 
			
		||||
   } while (t1 - t0 < 5.0);
 | 
			
		||||
   } while (t1 - t0 < 2.0);
 | 
			
		||||
 | 
			
		||||
   /*  Make sure everything is done before taking the final timing:
 | 
			
		||||
    */
 | 
			
		||||
   glFinish();
 | 
			
		||||
   t1 = glutGet(GLUT_ELAPSED_TIME) / 1000.0;
 | 
			
		||||
   
 | 
			
		||||
 | 
			
		||||
   glDisable(GL_TEXTURE_2D);
 | 
			
		||||
   if (image)
 | 
			
		||||
@@ -249,8 +277,8 @@ Draw(void)
 | 
			
		||||
 | 
			
		||||
   glutSwapBuffers(); 
 | 
			
		||||
 | 
			
		||||
   printf("exiting\n");
 | 
			
		||||
   exit(0);
 | 
			
		||||
/*    printf("exiting\n"); */
 | 
			
		||||
/*    exit(0); */
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -97,7 +97,7 @@ static rawImageRec *RawImageOpen(const char *fileName)
 | 
			
		||||
      swapFlag = GL_FALSE;
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   raw = (rawImageRec *)calloc(1, sizeof(rawImageRec));
 | 
			
		||||
   raw = (rawImageRec *)malloc(sizeof(rawImageRec));
 | 
			
		||||
   if (raw == NULL) {
 | 
			
		||||
      fprintf(stderr, "Out of memory!\n");
 | 
			
		||||
      return NULL;
 | 
			
		||||
@@ -148,15 +148,12 @@ static rawImageRec *RawImageOpen(const char *fileName)
 | 
			
		||||
 | 
			
		||||
static void RawImageClose(rawImageRec *raw)
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
   fclose(raw->file);
 | 
			
		||||
   free(raw->tmp);
 | 
			
		||||
   free(raw->tmpR);
 | 
			
		||||
   free(raw->tmpG);
 | 
			
		||||
   free(raw->tmpB);
 | 
			
		||||
   if (raw->rowStart)
 | 
			
		||||
      free(raw->rowStart);
 | 
			
		||||
   if (raw->rowSize)
 | 
			
		||||
      free(raw->rowSize);
 | 
			
		||||
   if (raw->sizeZ>3) {
 | 
			
		||||
      free(raw->tmpA);
 | 
			
		||||
   }
 | 
			
		||||
 
 | 
			
		||||
@@ -11,6 +11,7 @@ LIB_DEP = $(LIB_DIR)/$(GL_LIB_NAME) $(LIB_DIR)/$(GLU_LIB_NAME)
 | 
			
		||||
PROGS = glthreads \
 | 
			
		||||
	glxdemo \
 | 
			
		||||
	glxgears \
 | 
			
		||||
	fgl_glxgears \
 | 
			
		||||
	glxgears_fbconfig \
 | 
			
		||||
	glxcontexts \
 | 
			
		||||
	glxheads \
 | 
			
		||||
 
 | 
			
		||||
@@ -23,7 +23,6 @@
 | 
			
		||||
/*
 | 
			
		||||
 * This program tests GLX thread safety.
 | 
			
		||||
 * Command line options:
 | 
			
		||||
 *  -p                       Open a display connection for each thread
 | 
			
		||||
 *  -n <num threads>         Number of threads to create (default is 2)
 | 
			
		||||
 *  -display <display name>  Specify X display (default is :0.0)
 | 
			
		||||
 *
 | 
			
		||||
@@ -33,7 +32,6 @@
 | 
			
		||||
 | 
			
		||||
#if defined(PTHREADS)   /* defined by Mesa on Linux and other platforms */
 | 
			
		||||
 | 
			
		||||
#include <assert.h>
 | 
			
		||||
#include <GL/gl.h>
 | 
			
		||||
#include <GL/glx.h>
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
@@ -63,10 +61,6 @@ static struct winthread WinThreads[MAX_WINTHREADS];
 | 
			
		||||
static int NumWinThreads = 0;
 | 
			
		||||
static volatile GLboolean ExitFlag = GL_FALSE;
 | 
			
		||||
 | 
			
		||||
static GLboolean MultiDisplays = 0;
 | 
			
		||||
static GLboolean Locking = 0;
 | 
			
		||||
 | 
			
		||||
static pthread_mutex_t Mutex;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
@@ -151,22 +145,9 @@ resize(struct winthread *wt, int w, int h)
 | 
			
		||||
static void
 | 
			
		||||
draw_loop(struct winthread *wt)
 | 
			
		||||
{
 | 
			
		||||
   GLboolean firstIter = GL_TRUE;
 | 
			
		||||
 | 
			
		||||
   while (!ExitFlag) {
 | 
			
		||||
 | 
			
		||||
      if (Locking)
 | 
			
		||||
         pthread_mutex_lock(&Mutex);
 | 
			
		||||
 | 
			
		||||
      glXMakeCurrent(wt->Dpy, wt->Win, wt->Context);
 | 
			
		||||
      if (firstIter) {
 | 
			
		||||
         printf("glthreads: %d: GL_RENDERER = %s\n", wt->Index,
 | 
			
		||||
                (char *) glGetString(GL_RENDERER));
 | 
			
		||||
         firstIter = GL_FALSE;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      if (Locking)
 | 
			
		||||
         pthread_mutex_unlock(&Mutex);
 | 
			
		||||
 | 
			
		||||
      glEnable(GL_DEPTH_TEST);
 | 
			
		||||
 | 
			
		||||
@@ -191,15 +172,8 @@ draw_loop(struct winthread *wt)
 | 
			
		||||
         draw_object();
 | 
			
		||||
      glPopMatrix();
 | 
			
		||||
 | 
			
		||||
      if (Locking)
 | 
			
		||||
         pthread_mutex_lock(&Mutex);
 | 
			
		||||
 | 
			
		||||
      glXSwapBuffers(wt->Dpy, wt->Win);
 | 
			
		||||
 | 
			
		||||
      if (Locking)
 | 
			
		||||
         pthread_mutex_unlock(&Mutex);
 | 
			
		||||
 | 
			
		||||
      usleep(5000);
 | 
			
		||||
      wt->Angle += 1.0;
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
@@ -207,7 +181,6 @@ draw_loop(struct winthread *wt)
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * The main process thread runs this loop.
 | 
			
		||||
 * Single display connection for all threads.
 | 
			
		||||
 */
 | 
			
		||||
static void
 | 
			
		||||
event_loop(Display *dpy)
 | 
			
		||||
@@ -215,28 +188,8 @@ event_loop(Display *dpy)
 | 
			
		||||
   XEvent event;
 | 
			
		||||
   int i;
 | 
			
		||||
 | 
			
		||||
   assert(!MultiDisplays);
 | 
			
		||||
 | 
			
		||||
   while (!ExitFlag) {
 | 
			
		||||
 | 
			
		||||
      if (Locking) {
 | 
			
		||||
         while (1) {
 | 
			
		||||
            int k;
 | 
			
		||||
            pthread_mutex_lock(&Mutex);
 | 
			
		||||
            k = XPending(dpy);
 | 
			
		||||
            if (k) {
 | 
			
		||||
               XNextEvent(dpy, &event);
 | 
			
		||||
               pthread_mutex_unlock(&Mutex);
 | 
			
		||||
               break;
 | 
			
		||||
            }
 | 
			
		||||
            pthread_mutex_unlock(&Mutex);
 | 
			
		||||
            usleep(5000);
 | 
			
		||||
         }
 | 
			
		||||
      }
 | 
			
		||||
      else {
 | 
			
		||||
         XNextEvent(dpy, &event);
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      XNextEvent(dpy, &event);
 | 
			
		||||
      switch (event.type) {
 | 
			
		||||
         case ConfigureNotify:
 | 
			
		||||
            /* Find winthread for this event's window */
 | 
			
		||||
@@ -261,41 +214,6 @@ event_loop(Display *dpy)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Separate display connection for each thread.
 | 
			
		||||
 */
 | 
			
		||||
static void
 | 
			
		||||
event_loop_multi(void)
 | 
			
		||||
{
 | 
			
		||||
   XEvent event;
 | 
			
		||||
   int w = 0;
 | 
			
		||||
 | 
			
		||||
   assert(MultiDisplays);
 | 
			
		||||
 | 
			
		||||
   while (!ExitFlag) {
 | 
			
		||||
      struct winthread *wt = &WinThreads[w];
 | 
			
		||||
      if (XPending(wt->Dpy)) {
 | 
			
		||||
         XNextEvent(wt->Dpy, &event);
 | 
			
		||||
         switch (event.type) {
 | 
			
		||||
         case ConfigureNotify:
 | 
			
		||||
            resize(wt, event.xconfigure.width, event.xconfigure.height);
 | 
			
		||||
            break;
 | 
			
		||||
         case KeyPress:
 | 
			
		||||
            /* tell all threads to exit */
 | 
			
		||||
            ExitFlag = GL_TRUE;
 | 
			
		||||
            /*printf("exit draw_loop %d\n", wt->Index);*/
 | 
			
		||||
            return;
 | 
			
		||||
         default:
 | 
			
		||||
            /*no-op*/ ;
 | 
			
		||||
         }
 | 
			
		||||
      }
 | 
			
		||||
      w = (w + 1) % NumWinThreads;
 | 
			
		||||
      usleep(5000);
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * we'll call this once for each thread, before the threads are created.
 | 
			
		||||
 */
 | 
			
		||||
@@ -411,14 +329,14 @@ main(int argc, char *argv[])
 | 
			
		||||
{
 | 
			
		||||
   char *displayName = ":0.0";
 | 
			
		||||
   int numThreads = 2;
 | 
			
		||||
   Display *dpy = NULL;
 | 
			
		||||
   Display *dpy;
 | 
			
		||||
   int i;
 | 
			
		||||
   Status threadStat;
 | 
			
		||||
 | 
			
		||||
   if (argc == 1) {
 | 
			
		||||
      printf("glthreads: test of GL thread safety (any key = exit)\n");
 | 
			
		||||
      printf("threadgl: test of GL thread safety (any key = exit)\n");
 | 
			
		||||
      printf("Usage:\n");
 | 
			
		||||
      printf("  glthreads [-display dpyName] [-n numthreads]\n");
 | 
			
		||||
      printf("  threadgl [-display dpyName] [-n numthreads]\n");
 | 
			
		||||
   }
 | 
			
		||||
   else {
 | 
			
		||||
      int i;
 | 
			
		||||
@@ -427,12 +345,6 @@ main(int argc, char *argv[])
 | 
			
		||||
            displayName = argv[i + 1];
 | 
			
		||||
            i++;
 | 
			
		||||
         }
 | 
			
		||||
         else if (strcmp(argv[i], "-p") == 0) {
 | 
			
		||||
            MultiDisplays = 1;
 | 
			
		||||
         }
 | 
			
		||||
         else if (strcmp(argv[i], "-l") == 0) {
 | 
			
		||||
            Locking = 1;
 | 
			
		||||
         }
 | 
			
		||||
         else if (strcmp(argv[i], "-n") == 0 && i + 1 < argc) {
 | 
			
		||||
            numThreads = atoi(argv[i + 1]);
 | 
			
		||||
            if (numThreads < 1)
 | 
			
		||||
@@ -441,88 +353,48 @@ main(int argc, char *argv[])
 | 
			
		||||
               numThreads = MAX_WINTHREADS;
 | 
			
		||||
            i++;
 | 
			
		||||
         }
 | 
			
		||||
         else {
 | 
			
		||||
            fprintf(stderr, "glthreads: unexpected flag: %s\n", argv[i]);
 | 
			
		||||
         }
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
   
 | 
			
		||||
   if (Locking)
 | 
			
		||||
      printf("glthreads: Using explict locks around Xlib calls.\n");
 | 
			
		||||
   else
 | 
			
		||||
      printf("glthreads: No explict locking.\n");
 | 
			
		||||
 | 
			
		||||
   if (MultiDisplays)
 | 
			
		||||
      printf("glthreads: Per-thread display connections.\n");
 | 
			
		||||
   else
 | 
			
		||||
      printf("glthreads: Single display connection.\n");
 | 
			
		||||
 | 
			
		||||
   /*
 | 
			
		||||
    * VERY IMPORTANT: call XInitThreads() before any other Xlib functions.
 | 
			
		||||
    */
 | 
			
		||||
   if (!MultiDisplays) {
 | 
			
		||||
      if (!Locking) {
 | 
			
		||||
         threadStat = XInitThreads();
 | 
			
		||||
      if (threadStat) {
 | 
			
		||||
         printf("XInitThreads() returned %d (success)\n", (int) threadStat);
 | 
			
		||||
      }
 | 
			
		||||
      else {
 | 
			
		||||
         printf("XInitThreads() returned 0 (failure- this program may fail)\n");
 | 
			
		||||
      }
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      dpy = XOpenDisplay(displayName);
 | 
			
		||||
      if (!dpy) {
 | 
			
		||||
         fprintf(stderr, "Unable to open display %s\n", displayName);
 | 
			
		||||
         return -1;
 | 
			
		||||
      }
 | 
			
		||||
   threadStat = XInitThreads();
 | 
			
		||||
   if (threadStat) {
 | 
			
		||||
      printf("XInitThreads() returned %d (success)\n", (int) threadStat);
 | 
			
		||||
   }
 | 
			
		||||
   else {
 | 
			
		||||
      printf("XInitThreads() returned 0 (failure- this program may fail)\n");
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   if (Locking) {
 | 
			
		||||
      pthread_mutex_init(&Mutex, NULL);
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   printf("glthreads: creating windows\n");
 | 
			
		||||
   dpy = XOpenDisplay(displayName);
 | 
			
		||||
   if (!dpy) {
 | 
			
		||||
      fprintf(stderr, "Unable to open display %s\n", displayName);
 | 
			
		||||
      return -1;
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   NumWinThreads = numThreads;
 | 
			
		||||
 | 
			
		||||
   /* Create the GLX windows and contexts */
 | 
			
		||||
   for (i = 0; i < numThreads; i++) {
 | 
			
		||||
      if (MultiDisplays) {
 | 
			
		||||
         WinThreads[i].Dpy = XOpenDisplay(displayName);
 | 
			
		||||
         assert(WinThreads[i].Dpy);
 | 
			
		||||
      }
 | 
			
		||||
      else {
 | 
			
		||||
         WinThreads[i].Dpy = dpy;
 | 
			
		||||
      }
 | 
			
		||||
      WinThreads[i].Dpy = dpy;
 | 
			
		||||
      WinThreads[i].Index = i;
 | 
			
		||||
      create_window(&WinThreads[i]);
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   printf("glthreads: creating threads\n");
 | 
			
		||||
 | 
			
		||||
   /* Create the threads */
 | 
			
		||||
   for (i = 0; i < numThreads; i++) {
 | 
			
		||||
      pthread_create(&WinThreads[i].Thread, NULL, thread_function,
 | 
			
		||||
                     (void*) &WinThreads[i]);
 | 
			
		||||
      printf("glthreads: Created thread %u\n", (unsigned int) WinThreads[i].Thread);
 | 
			
		||||
      printf("Created Thread %d\n", (int) WinThreads[i].Thread);
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   if (MultiDisplays)
 | 
			
		||||
      event_loop_multi();
 | 
			
		||||
   else
 | 
			
		||||
      event_loop(dpy);
 | 
			
		||||
   event_loop(dpy);
 | 
			
		||||
 | 
			
		||||
   clean_up();
 | 
			
		||||
 | 
			
		||||
   if (MultiDisplays) {
 | 
			
		||||
      for (i = 0; i < numThreads; i++) {
 | 
			
		||||
         XCloseDisplay(WinThreads[i].Dpy);
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
   else {
 | 
			
		||||
      XCloseDisplay(dpy);
 | 
			
		||||
   }
 | 
			
		||||
   XCloseDisplay(dpy);
 | 
			
		||||
 | 
			
		||||
   return 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -262,7 +262,6 @@ print_screen_info(Display *dpy, int scrnum, Bool allowDirect, GLboolean limits)
 | 
			
		||||
   ctx = glXCreateContext( dpy, visinfo, NULL, allowDirect );
 | 
			
		||||
   if (!ctx) {
 | 
			
		||||
      fprintf(stderr, "Error: glXCreateContext failed\n");
 | 
			
		||||
      XFree(visinfo);
 | 
			
		||||
      XDestroyWindow(dpy, win);
 | 
			
		||||
      return;
 | 
			
		||||
   }
 | 
			
		||||
@@ -337,7 +336,6 @@ print_screen_info(Display *dpy, int scrnum, Bool allowDirect, GLboolean limits)
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   glXDestroyContext(dpy, ctx);
 | 
			
		||||
   XFree(visinfo);
 | 
			
		||||
   XDestroyWindow(dpy, win);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -31,7 +31,6 @@
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#include <string.h>
 | 
			
		||||
#include "eglcontext.h"
 | 
			
		||||
#include "egldisplay.h"
 | 
			
		||||
@@ -347,7 +346,6 @@ void (* APIENTRY eglGetProcAddress(const char *procname))()
 | 
			
		||||
      { "eglWaitGL", (_EGLProc) eglWaitGL },
 | 
			
		||||
      { "eglWaitNative", (_EGLProc) eglWaitNative },
 | 
			
		||||
      /* Extensions */
 | 
			
		||||
#ifdef EGL_MESA_screen_surface
 | 
			
		||||
      { "eglChooseModeMESA", (_EGLProc) eglChooseModeMESA },
 | 
			
		||||
      { "eglGetModesMESA", (_EGLProc) eglGetModesMESA },
 | 
			
		||||
      { "eglGetModeAttribMESA", (_EGLProc) eglGetModeAttribMESA },
 | 
			
		||||
@@ -360,14 +358,6 @@ void (* APIENTRY eglGetProcAddress(const char *procname))()
 | 
			
		||||
      { "eglQueryScreenSurfaceMESA", (_EGLProc) eglQueryScreenSurfaceMESA },
 | 
			
		||||
      { "eglQueryScreenModeMESA", (_EGLProc) eglQueryScreenModeMESA },
 | 
			
		||||
      { "eglQueryModeStringMESA", (_EGLProc) eglQueryModeStringMESA },
 | 
			
		||||
#endif /* EGL_MESA_screen_surface */
 | 
			
		||||
#ifdef EGL_VERSION_1_2
 | 
			
		||||
      { "eglBindAPI", (_EGLProc) eglBindAPI },
 | 
			
		||||
      { "eglCreatePbufferFromClientBuffer", (_EGLProc) eglCreatePbufferFromClientBuffer },
 | 
			
		||||
      { "eglQueryAPI", (_EGLProc) eglQueryAPI },
 | 
			
		||||
      { "eglReleaseThread", (_EGLProc) eglReleaseThread },
 | 
			
		||||
      { "eglWaitClient", (_EGLProc) eglWaitClient },
 | 
			
		||||
#endif /* EGL_VERSION_1_2 */
 | 
			
		||||
      { NULL, NULL }
 | 
			
		||||
   };
 | 
			
		||||
   EGLint i;
 | 
			
		||||
@@ -502,85 +492,6 @@ eglQueryModeStringMESA(EGLDisplay dpy, EGLModeMESA mode)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 ** EGL 1.2
 | 
			
		||||
 **/
 | 
			
		||||
 | 
			
		||||
#ifdef EGL_VERSION_1_2
 | 
			
		||||
 | 
			
		||||
EGLBoolean
 | 
			
		||||
eglBindAPI(EGLenum api)
 | 
			
		||||
{
 | 
			
		||||
   _EGLThreadInfo *t = _eglGetCurrentThread();
 | 
			
		||||
 | 
			
		||||
   switch (api) {
 | 
			
		||||
   case EGL_OPENGL_ES_API:
 | 
			
		||||
      if (_eglGlobal.OpenGLESAPISupported) {
 | 
			
		||||
         t->CurrentAPI = api;
 | 
			
		||||
         return EGL_TRUE;
 | 
			
		||||
      }
 | 
			
		||||
      _eglError(EGL_BAD_PARAMETER, "eglBindAPI");
 | 
			
		||||
      return EGL_FALSE;
 | 
			
		||||
   case EGL_OPENVG_API:
 | 
			
		||||
      if (_eglGlobal.OpenVGAPISupported) {
 | 
			
		||||
         t->CurrentAPI = api;
 | 
			
		||||
         return EGL_TRUE;
 | 
			
		||||
      }
 | 
			
		||||
      _eglError(EGL_BAD_PARAMETER, "eglBindAPI");
 | 
			
		||||
      return EGL_FALSE;
 | 
			
		||||
   default:
 | 
			
		||||
      return EGL_FALSE;
 | 
			
		||||
   }
 | 
			
		||||
   return EGL_TRUE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
EGLSurface
 | 
			
		||||
eglCreatePbufferFromClientBuffer(EGLDisplay dpy, EGLenum buftype,
 | 
			
		||||
                                 EGLClientBuffer buffer, EGLConfig config,
 | 
			
		||||
                                 const EGLint *attrib_list)
 | 
			
		||||
{
 | 
			
		||||
   _EGLDriver *drv = _eglLookupDriver(dpy);
 | 
			
		||||
   return drv->API.CreatePbufferFromClientBuffer(drv, dpy, buftype, buffer,
 | 
			
		||||
                                                 config, attrib_list);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
EGLenum
 | 
			
		||||
eglQueryAPI(void)
 | 
			
		||||
{
 | 
			
		||||
   /* returns one of EGL_OPENGL_ES_API or EGL_OPENVG_API */
 | 
			
		||||
   _EGLThreadInfo *t = _eglGetCurrentThread();
 | 
			
		||||
   return t->CurrentAPI;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
EGLBoolean
 | 
			
		||||
eglReleaseThread(void)
 | 
			
		||||
{
 | 
			
		||||
   _EGLThreadInfo *t = _eglGetCurrentThread();
 | 
			
		||||
   EGLDisplay dpy = eglGetCurrentDisplay();
 | 
			
		||||
   if (dpy) {
 | 
			
		||||
      _EGLDriver *drv = _eglLookupDriver(dpy);
 | 
			
		||||
      /* unbind context */
 | 
			
		||||
      (void) drv->API.MakeCurrent(drv, dpy, EGL_NO_SURFACE,
 | 
			
		||||
                                  EGL_NO_SURFACE, EGL_NO_CONTEXT);
 | 
			
		||||
   }
 | 
			
		||||
   _eglDeleteThreadData(t);
 | 
			
		||||
   return EGL_TRUE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
EGLBoolean
 | 
			
		||||
eglWaitClient(void)
 | 
			
		||||
{
 | 
			
		||||
   EGLDisplay dpy = eglGetCurrentDisplay();
 | 
			
		||||
   if (dpy != EGL_NO_DISPLAY) {
 | 
			
		||||
      _EGLDriver *drv = _eglLookupDriver(dpy);
 | 
			
		||||
      return drv->API.WaitClient(drv, dpy);
 | 
			
		||||
   }
 | 
			
		||||
   else
 | 
			
		||||
      return EGL_FALSE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#endif /* EGL_VERSION_1_2 */
 | 
			
		||||
 
 | 
			
		||||
@@ -40,7 +40,7 @@ typedef EGLBoolean (*WaitGL_t)(_EGLDriver *drv, EGLDisplay dpy);
 | 
			
		||||
typedef EGLBoolean (*WaitNative_t)(_EGLDriver *drv, EGLDisplay dpy, EGLint engine);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#ifdef EGL_MESA_screen_surface
 | 
			
		||||
/* EGL_MESA_screen extension */
 | 
			
		||||
typedef EGLBoolean (*ChooseModeMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, const EGLint *attrib_list, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes);
 | 
			
		||||
typedef EGLBoolean (*GetModesMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *modes, EGLint mode_size, EGLint *num_mode);
 | 
			
		||||
typedef EGLBoolean (*GetModeAttribMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLModeMESA mode, EGLint attribute, EGLint *value);
 | 
			
		||||
@@ -53,14 +53,6 @@ typedef EGLBoolean (*QueryScreenMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScre
 | 
			
		||||
typedef EGLBoolean (*QueryScreenSurfaceMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLSurface *surface);
 | 
			
		||||
typedef EGLBoolean (*QueryScreenModeMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *mode);
 | 
			
		||||
typedef const char * (*QueryModeStringMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLModeMESA mode);
 | 
			
		||||
#endif /* EGL_MESA_screen_surface */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#ifdef EGL_VERSION_1_2
 | 
			
		||||
typedef EGLBoolean (*WaitClient_t)(_EGLDriver *drv, EGLDisplay dpy);
 | 
			
		||||
typedef EGLSurface (*CreatePbufferFromClientBuffer_t)(_EGLDriver *drv, EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list);
 | 
			
		||||
#endif /* EGL_VERSION_1_2 */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
@@ -109,11 +101,6 @@ struct _egl_api
 | 
			
		||||
   QueryScreenSurfaceMESA_t QueryScreenSurfaceMESA;
 | 
			
		||||
   QueryScreenModeMESA_t QueryScreenModeMESA;
 | 
			
		||||
   QueryModeStringMESA_t QueryModeStringMESA;
 | 
			
		||||
 | 
			
		||||
#ifdef EGL_VERSION_1_2
 | 
			
		||||
   WaitClient_t WaitClient;
 | 
			
		||||
   CreatePbufferFromClientBuffer_t CreatePbufferFromClientBuffer;
 | 
			
		||||
#endif
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#endif /* EGLAPI_INCLUDED */
 | 
			
		||||
 
 | 
			
		||||
@@ -92,10 +92,6 @@ _eglInitConfig(_EGLConfig *config, EGLint id)
 | 
			
		||||
   _eglSetConfigAttrib(config, EGL_TRANSPARENT_RED_VALUE,   EGL_DONT_CARE);
 | 
			
		||||
   _eglSetConfigAttrib(config, EGL_TRANSPARENT_GREEN_VALUE, EGL_DONT_CARE);
 | 
			
		||||
   _eglSetConfigAttrib(config, EGL_TRANSPARENT_BLUE_VALUE,  EGL_DONT_CARE);
 | 
			
		||||
#ifdef EGL_VERSION_1_2
 | 
			
		||||
   _eglSetConfigAttrib(config, EGL_COLOR_BUFFER_TYPE,       EGL_RGB_BUFFER);
 | 
			
		||||
   _eglSetConfigAttrib(config, EGL_RENDERABLE_TYPE,         EGL_OPENGL_ES_BIT);
 | 
			
		||||
#endif /* EGL_VERSION_1_2 */
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -157,37 +153,13 @@ _eglParseConfigAttribs(_EGLConfig *config, const EGLint *attrib_list)
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   for (i = 0; attrib_list && attrib_list[i] != EGL_NONE; i++) {
 | 
			
		||||
      const EGLint attr = attrib_list[i];
 | 
			
		||||
      if (attr >= EGL_BUFFER_SIZE &&
 | 
			
		||||
          attr <= EGL_MAX_SWAP_INTERVAL) {
 | 
			
		||||
         EGLint k = attr - FIRST_ATTRIB;
 | 
			
		||||
      if (attrib_list[i] >= EGL_BUFFER_SIZE &&
 | 
			
		||||
          attrib_list[i] <= EGL_MAX_SWAP_INTERVAL) {
 | 
			
		||||
         EGLint k = attrib_list[i] - FIRST_ATTRIB;
 | 
			
		||||
         assert(k >= 0);
 | 
			
		||||
         assert(k < MAX_ATTRIBS);
 | 
			
		||||
         config->Attrib[k] = attrib_list[++i];
 | 
			
		||||
      }
 | 
			
		||||
#ifdef EGL_VERSION_1_2
 | 
			
		||||
      else if (attr == EGL_COLOR_BUFFER_TYPE) {
 | 
			
		||||
         EGLint bufType = attrib_list[++i];
 | 
			
		||||
         if (bufType != EGL_RGB_BUFFER && bufType != EGL_LUMINANCE_BUFFER) {
 | 
			
		||||
            _eglError(EGL_BAD_ATTRIBUTE, "eglChooseConfig");
 | 
			
		||||
            return EGL_FALSE;
 | 
			
		||||
         }
 | 
			
		||||
         _eglSetConfigAttrib(config, EGL_COLOR_BUFFER_TYPE, bufType);
 | 
			
		||||
      }
 | 
			
		||||
      else if (attr == EGL_RENDERABLE_TYPE) {
 | 
			
		||||
         EGLint renType = attrib_list[++i];
 | 
			
		||||
         if (renType & ~(EGL_OPENGL_ES_BIT | EGL_OPENVG_BIT)) {
 | 
			
		||||
            _eglError(EGL_BAD_ATTRIBUTE, "eglChooseConfig");
 | 
			
		||||
            return EGL_FALSE;
 | 
			
		||||
         }
 | 
			
		||||
         _eglSetConfigAttrib(config, EGL_RENDERABLE_TYPE, renType);
 | 
			
		||||
      }
 | 
			
		||||
      else if (attr == EGL_ALPHA_MASK_SIZE ||
 | 
			
		||||
               attr == EGL_LUMINANCE_SIZE) {
 | 
			
		||||
         EGLint value = attrib_list[++i];
 | 
			
		||||
         _eglSetConfigAttrib(config, attr, value);
 | 
			
		||||
      }
 | 
			
		||||
#endif /* EGL_VERSION_1_2 */
 | 
			
		||||
      else {
 | 
			
		||||
         _eglError(EGL_BAD_ATTRIBUTE, "eglChooseConfig");
 | 
			
		||||
         return EGL_FALSE;
 | 
			
		||||
@@ -212,8 +184,6 @@ struct sort_info {
 | 
			
		||||
 | 
			
		||||
/* This encodes the info from Table 3.5 of the EGL spec, ordered by
 | 
			
		||||
 * Sort Priority.
 | 
			
		||||
 *
 | 
			
		||||
 * XXX To do: EGL 1.2 attribs
 | 
			
		||||
 */
 | 
			
		||||
static struct sort_info SortInfo[] = {
 | 
			
		||||
   { EGL_CONFIG_CAVEAT,           EXACT,   SPECIAL },
 | 
			
		||||
 
 | 
			
		||||
@@ -160,11 +160,6 @@ _eglQueryContext(_EGLDriver *drv, EGLDisplay dpy, EGLContext ctx,
 | 
			
		||||
   case EGL_CONFIG_ID:
 | 
			
		||||
      *value = GET_CONFIG_ATTRIB(c->Config, EGL_CONFIG_ID);
 | 
			
		||||
      return EGL_TRUE;
 | 
			
		||||
#ifdef EGL_VERSION_1_2
 | 
			
		||||
   case EGL_CONTEXT_CLIENT_TYPE:
 | 
			
		||||
      *value = c->ClientAPI;
 | 
			
		||||
      return EGL_FALSE;
 | 
			
		||||
#endif /* EGL_VERSION_1_2 */
 | 
			
		||||
   default:
 | 
			
		||||
      _eglError(EGL_BAD_ATTRIBUTE, "eglQueryContext");
 | 
			
		||||
      return EGL_FALSE;
 | 
			
		||||
 
 | 
			
		||||
@@ -22,9 +22,6 @@ struct _egl_context
 | 
			
		||||
 | 
			
		||||
   EGLBoolean IsBound;
 | 
			
		||||
   EGLBoolean DeletePending;
 | 
			
		||||
#ifdef EGL_VERSION_1_2
 | 
			
		||||
   EGLint ClientAPI;  /* Either EGL_OPENGL_ES_API or EGL_OPENVG_API */
 | 
			
		||||
#endif /* EGL_VERSION_1_2 */
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -181,7 +181,7 @@ _eglInitDriverFallbacks(_EGLDriver *drv)
 | 
			
		||||
   drv->API.WaitGL = _eglWaitGL;
 | 
			
		||||
   drv->API.WaitNative = _eglWaitNative;
 | 
			
		||||
 | 
			
		||||
#ifdef EGL_MESA_screen_surface
 | 
			
		||||
   /* EGL_MESA_screen */
 | 
			
		||||
   drv->API.ChooseModeMESA = _eglChooseModeMESA; 
 | 
			
		||||
   drv->API.GetModesMESA = _eglGetModesMESA;
 | 
			
		||||
   drv->API.GetModeAttribMESA = _eglGetModeAttribMESA;
 | 
			
		||||
@@ -193,11 +193,6 @@ _eglInitDriverFallbacks(_EGLDriver *drv)
 | 
			
		||||
   drv->API.QueryScreenSurfaceMESA = _eglQueryScreenSurfaceMESA;
 | 
			
		||||
   drv->API.QueryScreenModeMESA = _eglQueryScreenModeMESA;
 | 
			
		||||
   drv->API.QueryModeStringMESA = _eglQueryModeStringMESA;
 | 
			
		||||
#endif /* EGL_MESA_screen_surface */
 | 
			
		||||
 | 
			
		||||
#ifdef EGL_VERSION_1_2
 | 
			
		||||
   drv->API.CreatePbufferFromClientBuffer = _eglCreatePbufferFromClientBuffer;
 | 
			
		||||
#endif /* EGL_VERSION_1_2 */
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -232,11 +227,6 @@ _eglQueryString(_EGLDriver *drv, EGLDisplay dpy, EGLint name)
 | 
			
		||||
   case EGL_EXTENSIONS:
 | 
			
		||||
      _eglUpdateExtensionsString(drv);
 | 
			
		||||
      return drv->Extensions.String;
 | 
			
		||||
#ifdef EGL_VERSION_1_2
 | 
			
		||||
   case EGL_CLIENT_APIS:
 | 
			
		||||
      /* XXX need to initialize somewhere */
 | 
			
		||||
      return drv->ClientAPIs;
 | 
			
		||||
#endif
 | 
			
		||||
   default:
 | 
			
		||||
      _eglError(EGL_BAD_PARAMETER, "eglQueryString");
 | 
			
		||||
      return NULL;
 | 
			
		||||
@@ -260,13 +250,6 @@ _eglWaitNative(_EGLDriver *drv, EGLDisplay dpy, EGLint engine)
 | 
			
		||||
   /* just a placeholder */
 | 
			
		||||
   (void) drv;
 | 
			
		||||
   (void) dpy;
 | 
			
		||||
   switch (engine) {
 | 
			
		||||
   case EGL_CORE_NATIVE_ENGINE:
 | 
			
		||||
      break;
 | 
			
		||||
   default:
 | 
			
		||||
      _eglError(EGL_BAD_PARAMETER, "eglWaitNative(engine)");
 | 
			
		||||
      return EGL_FALSE;
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   (void) engine;
 | 
			
		||||
   return EGL_TRUE;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -34,7 +34,6 @@ struct _egl_driver
 | 
			
		||||
 | 
			
		||||
   int ABIversion;
 | 
			
		||||
   int APImajor, APIminor; /* returned through eglInitialize */
 | 
			
		||||
   const char *ClientAPIs;
 | 
			
		||||
 | 
			
		||||
   _EGLAPI API;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,4 @@
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#include "eglglobals.h"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -19,12 +18,9 @@ _eglInitGlobals(void)
 | 
			
		||||
      _eglGlobal.Surfaces = _eglNewHashTable();
 | 
			
		||||
      _eglGlobal.FreeScreenHandle = 1;
 | 
			
		||||
      _eglGlobal.Initialized = EGL_TRUE;
 | 
			
		||||
 | 
			
		||||
      _eglGlobal.OpenGLESAPISupported = EGL_TRUE;
 | 
			
		||||
      _eglGlobal.OpenVGAPISupported = EGL_FALSE;
 | 
			
		||||
 | 
			
		||||
      /* XXX temporary */
 | 
			
		||||
      _eglGlobal.ThreadInfo = _eglNewThreadInfo();
 | 
			
		||||
      _eglGlobal.ThreadInfo.CurrentContext = EGL_NO_CONTEXT;
 | 
			
		||||
      _eglGlobal.ThreadInfo.LastError = EGL_SUCCESS;
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -42,33 +38,6 @@ _eglDestroyGlobals(void)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Allocate and init a new _EGLThreadInfo object.
 | 
			
		||||
 */
 | 
			
		||||
_EGLThreadInfo *
 | 
			
		||||
_eglNewThreadInfo(void)
 | 
			
		||||
{
 | 
			
		||||
   _EGLThreadInfo *t = (_EGLThreadInfo *) calloc(1, sizeof(_EGLThreadInfo));
 | 
			
		||||
   if (t) {
 | 
			
		||||
      t->CurrentContext = EGL_NO_CONTEXT;
 | 
			
		||||
      t->LastError = EGL_SUCCESS;
 | 
			
		||||
      t->CurrentAPI = EGL_NONE;
 | 
			
		||||
   }
 | 
			
		||||
   return t;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Delete/free a _EGLThreadInfo object.
 | 
			
		||||
 */
 | 
			
		||||
void
 | 
			
		||||
_eglDeleteThreadData(_EGLThreadInfo *t)
 | 
			
		||||
{
 | 
			
		||||
   free(t);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Return pointer to calling thread's _EGLThreadInfo object.
 | 
			
		||||
 * Create a new one if needed.
 | 
			
		||||
@@ -77,10 +46,8 @@ _eglDeleteThreadData(_EGLThreadInfo *t)
 | 
			
		||||
_EGLThreadInfo *
 | 
			
		||||
_eglGetCurrentThread(void)
 | 
			
		||||
{
 | 
			
		||||
   _eglInitGlobals();
 | 
			
		||||
 | 
			
		||||
   /* XXX temporary */
 | 
			
		||||
   return _eglGlobal.ThreadInfo;
 | 
			
		||||
   return &_eglGlobal.ThreadInfo;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -12,7 +12,6 @@ struct _egl_thread_info
 | 
			
		||||
{
 | 
			
		||||
   EGLint LastError;
 | 
			
		||||
   _EGLContext *CurrentContext;
 | 
			
		||||
   EGLenum CurrentAPI;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -29,12 +28,8 @@ struct _egl_global
 | 
			
		||||
 | 
			
		||||
   EGLScreenMESA FreeScreenHandle;
 | 
			
		||||
 | 
			
		||||
   /* XXX these may be temporary */
 | 
			
		||||
   EGLBoolean OpenGLESAPISupported;
 | 
			
		||||
   EGLBoolean OpenVGAPISupported;
 | 
			
		||||
 | 
			
		||||
   /* XXX temporary - should be thread-specific data (TSD) */
 | 
			
		||||
   _EGLThreadInfo *ThreadInfo;
 | 
			
		||||
   /* XXX temporary */
 | 
			
		||||
   _EGLThreadInfo ThreadInfo;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -49,14 +44,6 @@ extern void
 | 
			
		||||
_eglDestroyGlobals(void);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
extern _EGLThreadInfo *
 | 
			
		||||
_eglNewThreadInfo(void);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
extern void
 | 
			
		||||
_eglDeleteThreadData(_EGLThreadInfo *t);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
extern _EGLThreadInfo *
 | 
			
		||||
_eglGetCurrentThread(void);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -27,11 +27,6 @@ _eglInitSurface(_EGLDriver *drv, EGLDisplay dpy,
 | 
			
		||||
   _EGLConfig *conf;
 | 
			
		||||
   EGLint width = 0, height = 0, largest = 0;
 | 
			
		||||
   EGLint texFormat = 0, texTarget = 0, mipmapTex = 0;
 | 
			
		||||
   EGLint renderBuffer = EGL_BACK_BUFFER;
 | 
			
		||||
#ifdef EGL_VERSION_1_2
 | 
			
		||||
   EGLint colorspace = EGL_COLORSPACE_sRGB;
 | 
			
		||||
   EGLint alphaFormat = EGL_ALPHA_FORMAT_NONPRE;
 | 
			
		||||
#endif
 | 
			
		||||
   EGLint i;
 | 
			
		||||
 | 
			
		||||
   switch (type) {
 | 
			
		||||
@@ -40,14 +35,12 @@ _eglInitSurface(_EGLDriver *drv, EGLDisplay dpy,
 | 
			
		||||
      break;
 | 
			
		||||
   case EGL_PIXMAP_BIT:
 | 
			
		||||
      func = "eglCreatePixmapSurface";
 | 
			
		||||
      renderBuffer = EGL_SINGLE_BUFFER;
 | 
			
		||||
      break;
 | 
			
		||||
   case EGL_PBUFFER_BIT:
 | 
			
		||||
      func = "eglCreatePBufferSurface";
 | 
			
		||||
      break;
 | 
			
		||||
   case EGL_SCREEN_BIT_MESA:
 | 
			
		||||
      func = "eglCreateScreenSurface";
 | 
			
		||||
      renderBuffer = EGL_SINGLE_BUFFER; /* XXX correct? */
 | 
			
		||||
      break;
 | 
			
		||||
   default:
 | 
			
		||||
      _eglLog(_EGL_WARNING, "Bad type in _eglInitSurface");
 | 
			
		||||
@@ -120,55 +113,6 @@ _eglInitSurface(_EGLDriver *drv, EGLDisplay dpy,
 | 
			
		||||
            return EGL_FALSE;
 | 
			
		||||
         }
 | 
			
		||||
         break;
 | 
			
		||||
#ifdef EGL_VERSION_1_2
 | 
			
		||||
      case EGL_RENDER_BUFFER:
 | 
			
		||||
         if (type == EGL_WINDOW_BIT) {
 | 
			
		||||
            renderBuffer = attrib_list[++i];
 | 
			
		||||
            if (renderBuffer != EGL_BACK_BUFFER &&
 | 
			
		||||
                renderBuffer != EGL_SINGLE_BUFFER) {
 | 
			
		||||
               _eglError(EGL_BAD_ATTRIBUTE, func);
 | 
			
		||||
               return EGL_FALSE;
 | 
			
		||||
            }
 | 
			
		||||
         }
 | 
			
		||||
         else {
 | 
			
		||||
            _eglError(EGL_BAD_ATTRIBUTE, func);
 | 
			
		||||
            return EGL_FALSE;
 | 
			
		||||
         }
 | 
			
		||||
         break;
 | 
			
		||||
      case EGL_COLORSPACE:
 | 
			
		||||
         if (type == EGL_WINDOW_BIT ||
 | 
			
		||||
             type == EGL_PBUFFER_BIT ||
 | 
			
		||||
             type == EGL_PIXMAP_BIT) {
 | 
			
		||||
            colorspace = attrib_list[++i];
 | 
			
		||||
            if (colorspace != EGL_COLORSPACE_sRGB &&
 | 
			
		||||
                colorspace != EGL_COLORSPACE_LINEAR) {
 | 
			
		||||
               _eglError(EGL_BAD_ATTRIBUTE, func);
 | 
			
		||||
               return EGL_FALSE;
 | 
			
		||||
            }
 | 
			
		||||
         }
 | 
			
		||||
         else {
 | 
			
		||||
            _eglError(EGL_BAD_ATTRIBUTE, func);
 | 
			
		||||
            return EGL_FALSE;
 | 
			
		||||
         }
 | 
			
		||||
         break;
 | 
			
		||||
      case EGL_ALPHA_FORMAT:
 | 
			
		||||
         if (type == EGL_WINDOW_BIT ||
 | 
			
		||||
             type == EGL_PBUFFER_BIT ||
 | 
			
		||||
             type == EGL_PIXMAP_BIT) {
 | 
			
		||||
            alphaFormat = attrib_list[++i];
 | 
			
		||||
            if (alphaFormat != EGL_ALPHA_FORMAT_NONPRE &&
 | 
			
		||||
                alphaFormat != EGL_ALPHA_FORMAT_PRE) {
 | 
			
		||||
               _eglError(EGL_BAD_ATTRIBUTE, func);
 | 
			
		||||
               return EGL_FALSE;
 | 
			
		||||
            }
 | 
			
		||||
         }
 | 
			
		||||
         else {
 | 
			
		||||
            _eglError(EGL_BAD_ATTRIBUTE, func);
 | 
			
		||||
            return EGL_FALSE;
 | 
			
		||||
         }
 | 
			
		||||
         break;
 | 
			
		||||
 | 
			
		||||
#endif /* EGL_VERSION_1_2 */
 | 
			
		||||
      default:
 | 
			
		||||
         _eglError(EGL_BAD_ATTRIBUTE, func);
 | 
			
		||||
         return EGL_FALSE;
 | 
			
		||||
@@ -190,15 +134,6 @@ _eglInitSurface(_EGLDriver *drv, EGLDisplay dpy,
 | 
			
		||||
   surf->MipmapTexture = mipmapTex;
 | 
			
		||||
   surf->MipmapLevel = 0;
 | 
			
		||||
   surf->SwapInterval = 0;
 | 
			
		||||
#ifdef EGL_VERSION_1_2
 | 
			
		||||
   surf->SwapBehavior = EGL_BUFFER_DESTROYED; /* XXX ok? */
 | 
			
		||||
   surf->HorizontalResolution = EGL_UNKNOWN; /* set by caller */
 | 
			
		||||
   surf->VerticalResolution = EGL_UNKNOWN; /* set by caller */
 | 
			
		||||
   surf->AspectRatio = EGL_UNKNOWN; /* set by caller */
 | 
			
		||||
   surf->RenderBuffer = renderBuffer;
 | 
			
		||||
   surf->AlphaFormat = alphaFormat;
 | 
			
		||||
   surf->Colorspace = colorspace;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
   return EGL_TRUE;
 | 
			
		||||
}
 | 
			
		||||
@@ -297,11 +232,6 @@ _eglQuerySurface(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surf,
 | 
			
		||||
   case EGL_CONFIG_ID:
 | 
			
		||||
      *value = GET_CONFIG_ATTRIB(surface->Config, EGL_CONFIG_ID);
 | 
			
		||||
      return EGL_TRUE;
 | 
			
		||||
   /*XXX case EGL_LARGEST_PBUFFER:*/
 | 
			
		||||
   case EGL_SURFACE_TYPE:
 | 
			
		||||
      *value = surface->Type;
 | 
			
		||||
      return EGL_TRUE;
 | 
			
		||||
#ifdef EGL_VERSION_1_1
 | 
			
		||||
   case EGL_TEXTURE_FORMAT:
 | 
			
		||||
      /* texture attributes: only for pbuffers, no error otherwise */
 | 
			
		||||
      if (surface->Type == EGL_PBUFFER_BIT)
 | 
			
		||||
@@ -319,30 +249,9 @@ _eglQuerySurface(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surf,
 | 
			
		||||
      if (surface->Type == EGL_PBUFFER_BIT)
 | 
			
		||||
         *value = surface->MipmapLevel;
 | 
			
		||||
      return EGL_TRUE;
 | 
			
		||||
#endif /* EGL_VERSION_1_1 */
 | 
			
		||||
#ifdef EGL_VERSION_1_2
 | 
			
		||||
   case EGL_SWAP_BEHAVIOR:
 | 
			
		||||
      *value = surface->SwapBehavior;
 | 
			
		||||
   case EGL_SURFACE_TYPE:
 | 
			
		||||
      *value = surface->Type;
 | 
			
		||||
      return EGL_TRUE;
 | 
			
		||||
   case EGL_RENDER_BUFFER:
 | 
			
		||||
      *value = surface->RenderBuffer;
 | 
			
		||||
      return EGL_TRUE;
 | 
			
		||||
   case EGL_PIXEL_ASPECT_RATIO:
 | 
			
		||||
      *value = surface->AspectRatio;
 | 
			
		||||
      return EGL_TRUE;
 | 
			
		||||
   case EGL_HORIZONTAL_RESOLUTION:
 | 
			
		||||
      *value = surface->HorizontalResolution;
 | 
			
		||||
      return EGL_TRUE;
 | 
			
		||||
   case EGL_VERTICAL_RESOLUTION:
 | 
			
		||||
      *value = surface->VerticalResolution;
 | 
			
		||||
      return EGL_TRUE;
 | 
			
		||||
   case EGL_ALPHA_FORMAT:
 | 
			
		||||
      *value = surface->AlphaFormat;
 | 
			
		||||
      return EGL_TRUE;
 | 
			
		||||
   case EGL_COLORSPACE:
 | 
			
		||||
      *value = surface->Colorspace;
 | 
			
		||||
      return EGL_TRUE;
 | 
			
		||||
#endif /* EGL_VERSION_1_2 */
 | 
			
		||||
   default:
 | 
			
		||||
      _eglError(EGL_BAD_ATTRIBUTE, "eglQuerySurface");
 | 
			
		||||
      return EGL_FALSE;
 | 
			
		||||
@@ -507,24 +416,3 @@ _eglSwapInterval(_EGLDriver *drv, EGLDisplay dpy, EGLint interval)
 | 
			
		||||
   surf->SwapInterval = interval;
 | 
			
		||||
   return EGL_TRUE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#ifdef EGL_VERSION_1_2
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Example function - drivers should do a proper implementation.
 | 
			
		||||
 */
 | 
			
		||||
EGLSurface
 | 
			
		||||
_eglCreatePbufferFromClientBuffer(_EGLDriver *drv, EGLDisplay dpy,
 | 
			
		||||
                                  EGLenum buftype, EGLClientBuffer buffer,
 | 
			
		||||
                                  EGLConfig config, const EGLint *attrib_list)
 | 
			
		||||
{
 | 
			
		||||
   if (buftype != EGL_OPENVG_IMAGE) {
 | 
			
		||||
      _eglError(EGL_BAD_PARAMETER, "eglCreatePbufferFromClientBuffer");
 | 
			
		||||
      return EGL_NO_SURFACE;
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   return EGL_NO_SURFACE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#endif /* EGL_VERSION_1_2 */
 | 
			
		||||
 
 | 
			
		||||
@@ -25,15 +25,6 @@ struct _egl_surface
 | 
			
		||||
 | 
			
		||||
   /* If type == EGL_SCREEN_BIT: */
 | 
			
		||||
   EGLint VisibleRefCount; /* number of screens I'm displayed on */
 | 
			
		||||
 | 
			
		||||
#ifdef EGL_VERSION_1_2
 | 
			
		||||
   EGLint SwapBehavior; /* one of EGL_BUFFER_PRESERVED/DESTROYED */
 | 
			
		||||
   EGLint HorizontalResolution, VerticalResolution;
 | 
			
		||||
   EGLint AspectRatio;
 | 
			
		||||
   EGLint RenderBuffer; /* EGL_BACK_BUFFER or EGL_SINGLE_BUFFER */
 | 
			
		||||
   EGLint AlphaFormat; /* EGL_ALPHA_FORMAT_NONPRE or EGL_ALPHA_FORMAT_PRE */
 | 
			
		||||
   EGLint Colorspace; /* EGL_COLORSPACE_sRGB or EGL_COLORSPACE_LINEAR */
 | 
			
		||||
#endif /* EGL_VERSION_1_2 */
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -103,15 +94,4 @@ extern EGLBoolean
 | 
			
		||||
_eglSwapInterval(_EGLDriver *drv, EGLDisplay dpy, EGLint interval);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#ifdef EGL_VERSION_1_2
 | 
			
		||||
 | 
			
		||||
extern EGLSurface
 | 
			
		||||
_eglCreatePbufferFromClientBuffer(_EGLDriver *drv, EGLDisplay dpy,
 | 
			
		||||
                                  EGLenum buftype, EGLClientBuffer buffer,
 | 
			
		||||
                                  EGLConfig config, const EGLint *attrib_list);
 | 
			
		||||
 | 
			
		||||
#endif /* EGL_VERSION_1_2 */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#endif /* EGLSURFACE_INCLUDED */
 | 
			
		||||
 
 | 
			
		||||
@@ -35,8 +35,8 @@
 | 
			
		||||
/*
 | 
			
		||||
 * glcurveval.c++
 | 
			
		||||
 *
 | 
			
		||||
 * $Date: 2006/03/29 18:46:46 $ $Revision: 1.7 $
 | 
			
		||||
 * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/interface/glcurveval.cc,v 1.7 2006/03/29 18:46:46 brianp Exp $
 | 
			
		||||
 * $Date: 2004/05/12 15:29:36 $ $Revision: 1.6 $
 | 
			
		||||
 * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/interface/glcurveval.cc,v 1.6 2004/05/12 15:29:36 brianp Exp $
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* Polynomial Evaluator Interface */
 | 
			
		||||
@@ -74,7 +74,6 @@ OpenGLCurveEvaluator::OpenGLCurveEvaluator(void)
 | 
			
		||||
  em_normal.uprime = -1.0;
 | 
			
		||||
  em_color.uprime = -1.0;
 | 
			
		||||
  em_texcoord.uprime = -1.0;
 | 
			
		||||
  output_triangles = 0; // don't output triangles by default
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
OpenGLCurveEvaluator::~OpenGLCurveEvaluator(void) 
 | 
			
		||||
 
 | 
			
		||||
@@ -35,28 +35,28 @@
 | 
			
		||||
/*
 | 
			
		||||
 * mystdio.h
 | 
			
		||||
 *
 | 
			
		||||
 * $Date: 2006/03/14 15:08:52 $ $Revision: 1.4 $
 | 
			
		||||
 * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/interface/mystdio.h,v 1.4 2006/03/14 15:08:52 brianp Exp $
 | 
			
		||||
 * $Date: 2001/03/19 17:52:02 $ $Revision: 1.3 $
 | 
			
		||||
 * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/interface/mystdio.h,v 1.3 2001/03/19 17:52:02 pesco Exp $
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef __glumystdio_h_
 | 
			
		||||
#define __glumystdio_h_
 | 
			
		||||
 | 
			
		||||
#ifdef STANDALONE
 | 
			
		||||
inline void _glu_dprintf( char *, ... ) { }
 | 
			
		||||
inline void dprintf( char *, ... ) { }
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef LIBRARYBUILD
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#define _glu_dprintf printf
 | 
			
		||||
#define dprintf printf
 | 
			
		||||
#else
 | 
			
		||||
inline void _glu_dprintf( char *, ... ) { }
 | 
			
		||||
inline void dprintf( char *, ... ) { }
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef GLBUILD
 | 
			
		||||
inline void _glu_dprintf( char *, ... ) { }
 | 
			
		||||
inline void dprintf( char *, ... ) { }
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifndef NULL
 | 
			
		||||
 
 | 
			
		||||
@@ -156,9 +156,9 @@ void
 | 
			
		||||
Arc::show()
 | 
			
		||||
{
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
    _glu_dprintf( "\tPWLARC NP: %d FL: 1\n", pwlArc->npts );
 | 
			
		||||
    dprintf( "\tPWLARC NP: %d FL: 1\n", pwlArc->npts );
 | 
			
		||||
    for( int i = 0; i < pwlArc->npts; i++ ) {
 | 
			
		||||
	 _glu_dprintf( "\t\tVERTEX %f %f\n", pwlArc->pts[i].param[0],
 | 
			
		||||
	 dprintf( "\t\tVERTEX %f %f\n", pwlArc->pts[i].param[0],
 | 
			
		||||
			pwlArc->pts[i].param[1] );
 | 
			
		||||
    }
 | 
			
		||||
#endif
 | 
			
		||||
@@ -175,14 +175,14 @@ Arc::print( void )
 | 
			
		||||
    Arc_ptr jarc = this;
 | 
			
		||||
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
    _glu_dprintf( "BGNTRIM\n" );
 | 
			
		||||
    dprintf( "BGNTRIM\n" );
 | 
			
		||||
#endif
 | 
			
		||||
    do {
 | 
			
		||||
	jarc->show( );
 | 
			
		||||
	jarc = jarc->next;
 | 
			
		||||
    } while (jarc != this);
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
    _glu_dprintf("ENDTRIM\n" );
 | 
			
		||||
    dprintf("ENDTRIM\n" );
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -203,8 +203,8 @@ Arc::isDisconnected( void )
 | 
			
		||||
    if( ((p0[0] - p1[0]) > ZERO) || ((p1[0] - p0[0]) > ZERO) ||
 | 
			
		||||
	((p0[1] - p1[1]) > ZERO) || ((p1[1] - p0[1]) > ZERO)  ) {
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
	_glu_dprintf( "x coord = %f %f %f\n", p0[0], p1[0], p0[0] - p1[0] );
 | 
			
		||||
	_glu_dprintf( "y coord = %f %f %f\n", p0[1], p1[1], p0[1] - p1[1] );
 | 
			
		||||
	dprintf( "x coord = %f %f %f\n", p0[0], p1[0], p0[0] - p1[0] );
 | 
			
		||||
	dprintf( "y coord = %f %f %f\n", p0[1], p1[1], p0[1] - p1[1] );
 | 
			
		||||
#endif
 | 
			
		||||
	return 1;
 | 
			
		||||
    } else {
 | 
			
		||||
@@ -244,7 +244,7 @@ Arc::check( void )
 | 
			
		||||
 | 
			
		||||
	if (jarc->prev == 0 || jarc->next == 0) {
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
	    _glu_dprintf( "checkjarc:null next/prev pointer\n");
 | 
			
		||||
	    dprintf( "checkjarc:null next/prev pointer\n");
 | 
			
		||||
	    jarc->print( );
 | 
			
		||||
#endif
 | 
			
		||||
	    return 0;
 | 
			
		||||
@@ -252,7 +252,7 @@ Arc::check( void )
 | 
			
		||||
 | 
			
		||||
	if (jarc->next->prev != jarc) {
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
	    _glu_dprintf( "checkjarc: pointer linkage screwed up\n");
 | 
			
		||||
	    dprintf( "checkjarc: pointer linkage screwed up\n");
 | 
			
		||||
	    jarc->print( );
 | 
			
		||||
#endif
 | 
			
		||||
	    return 0;
 | 
			
		||||
@@ -271,7 +271,7 @@ Arc::check( void )
 | 
			
		||||
	    if( jarc->prev->pwlArc ) {
 | 
			
		||||
		if( jarc->tail()[1] != jarc->prev->rhead()[1] ) {
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
		    _glu_dprintf( "checkjarc: geometric linkage screwed up 1\n");
 | 
			
		||||
		    dprintf( "checkjarc: geometric linkage screwed up 1\n");
 | 
			
		||||
		    jarc->prev->show();
 | 
			
		||||
		    jarc->show();
 | 
			
		||||
#endif
 | 
			
		||||
@@ -280,7 +280,7 @@ Arc::check( void )
 | 
			
		||||
		if( jarc->tail()[0] != jarc->prev->rhead()[0] ) {
 | 
			
		||||
	        
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
		    _glu_dprintf( "checkjarc: geometric linkage screwed up 2\n");
 | 
			
		||||
		    dprintf( "checkjarc: geometric linkage screwed up 2\n");
 | 
			
		||||
		    jarc->prev->show();
 | 
			
		||||
		    jarc->show();
 | 
			
		||||
#endif
 | 
			
		||||
@@ -290,7 +290,7 @@ Arc::check( void )
 | 
			
		||||
	    if( jarc->next->pwlArc ) {
 | 
			
		||||
		if( jarc->next->tail()[0] != jarc->rhead()[0] ) {
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
			_glu_dprintf( "checkjarc: geometric linkage screwed up 3\n");
 | 
			
		||||
			dprintf( "checkjarc: geometric linkage screwed up 3\n");
 | 
			
		||||
			jarc->show();
 | 
			
		||||
			jarc->next->show();
 | 
			
		||||
#endif
 | 
			
		||||
@@ -298,7 +298,7 @@ Arc::check( void )
 | 
			
		||||
		}
 | 
			
		||||
		if( jarc->next->tail()[1] != jarc->rhead()[1] ) {
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
			_glu_dprintf( "checkjarc: geometric linkage screwed up 4\n");
 | 
			
		||||
			dprintf( "checkjarc: geometric linkage screwed up 4\n");
 | 
			
		||||
			jarc->show();
 | 
			
		||||
			jarc->next->show();
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -35,8 +35,8 @@
 | 
			
		||||
/*
 | 
			
		||||
 * arcsorter.c++
 | 
			
		||||
 *
 | 
			
		||||
 * $Date: 2006/03/14 15:08:52 $ $Revision: 1.2 $
 | 
			
		||||
 * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/arcsorter.cc,v 1.2 2006/03/14 15:08:52 brianp Exp $
 | 
			
		||||
 * $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $
 | 
			
		||||
 * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/arcsorter.cc,v 1.1 2001/03/17 00:25:40 brianp Exp $
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef __gluarcsorter_c_
 | 
			
		||||
@@ -54,7 +54,7 @@ ArcSorter::ArcSorter(Subdivider &s) : Sorter( sizeof( Arc ** ) ), subdivider(s)
 | 
			
		||||
int
 | 
			
		||||
ArcSorter::qscmp( char *, char * )
 | 
			
		||||
{
 | 
			
		||||
    _glu_dprintf( "ArcSorter::qscmp: pure virtual called\n" );
 | 
			
		||||
    dprintf( "ArcSorter::qscmp: pure virtual called\n" );
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -335,7 +335,7 @@ ArcTessellator::tessellateNonlinear( Arc *arc, REAL geo_stepsize, REAL arc_steps
 | 
			
		||||
      REAL min_u, min_v, max_u,max_v;
 | 
			
		||||
      min_u = max_u = bezierArc->cpts[0];
 | 
			
		||||
      min_v = max_v = bezierArc->cpts[1];
 | 
			
		||||
      for(i=1, j=bezierArc->stride; i<bezierArc->order; i++, j+= bezierArc->stride)
 | 
			
		||||
      for(i=1, j=2; i<bezierArc->order; i++, j+= bezierArc->stride)
 | 
			
		||||
	{
 | 
			
		||||
	  if(bezierArc->cpts[j] < min_u)
 | 
			
		||||
	    min_u = bezierArc->cpts[j];
 | 
			
		||||
 
 | 
			
		||||
@@ -45,7 +45,7 @@ void
 | 
			
		||||
BasicCurveEvaluator::domain1f( REAL, REAL )
 | 
			
		||||
{
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
    _glu_dprintf( "domain1f\n" );
 | 
			
		||||
    dprintf( "domain1f\n" );
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -53,7 +53,7 @@ void
 | 
			
		||||
BasicCurveEvaluator::range1f( long , REAL *, REAL * )
 | 
			
		||||
{
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
    _glu_dprintf( "range1f\n" );
 | 
			
		||||
    dprintf( "range1f\n" );
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -61,7 +61,7 @@ void
 | 
			
		||||
BasicCurveEvaluator::enable( long )
 | 
			
		||||
{
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
    _glu_dprintf( "enable\n" );
 | 
			
		||||
    dprintf( "enable\n" );
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -69,7 +69,7 @@ void
 | 
			
		||||
BasicCurveEvaluator::disable( long )
 | 
			
		||||
{
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
    _glu_dprintf( "disable\n" );
 | 
			
		||||
    dprintf( "disable\n" );
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -77,7 +77,7 @@ void
 | 
			
		||||
BasicCurveEvaluator::bgnmap1f( long )
 | 
			
		||||
{
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
    _glu_dprintf( "bgnmap1f\n" );
 | 
			
		||||
    dprintf( "bgnmap1f\n" );
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -85,7 +85,7 @@ void
 | 
			
		||||
BasicCurveEvaluator::map1f( long, REAL, REAL, long, long, REAL * )
 | 
			
		||||
{
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
    _glu_dprintf( "map1f\n" );
 | 
			
		||||
    dprintf( "map1f\n" );
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -93,7 +93,7 @@ void
 | 
			
		||||
BasicCurveEvaluator::mapgrid1f( long, REAL, REAL )
 | 
			
		||||
{
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
    _glu_dprintf( "mapgrid1f\n" );
 | 
			
		||||
    dprintf( "mapgrid1f\n" );
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -101,7 +101,7 @@ void
 | 
			
		||||
BasicCurveEvaluator::mapmesh1f( long, long, long )
 | 
			
		||||
{
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
    _glu_dprintf( "mapmesh1f\n" );
 | 
			
		||||
    dprintf( "mapmesh1f\n" );
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -109,7 +109,7 @@ void
 | 
			
		||||
BasicCurveEvaluator::evalcoord1f( long, REAL )
 | 
			
		||||
{
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
    _glu_dprintf( "evalcoord1f\n" );
 | 
			
		||||
    dprintf( "evalcoord1f\n" );
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -117,7 +117,7 @@ void
 | 
			
		||||
BasicCurveEvaluator::endmap1f( void )
 | 
			
		||||
{
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
    _glu_dprintf( "endmap1f\n" );
 | 
			
		||||
    dprintf( "endmap1f\n" );
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -125,7 +125,7 @@ void
 | 
			
		||||
BasicCurveEvaluator::bgnline( void )
 | 
			
		||||
{
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
    _glu_dprintf( "bgnline\n" );
 | 
			
		||||
    dprintf( "bgnline\n" );
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -133,6 +133,6 @@ void
 | 
			
		||||
BasicCurveEvaluator::endline( void )
 | 
			
		||||
{
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
    _glu_dprintf( "endline\n" );
 | 
			
		||||
    dprintf( "endline\n" );
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -35,8 +35,8 @@
 | 
			
		||||
/*
 | 
			
		||||
 * basiccurveeval.h
 | 
			
		||||
 *
 | 
			
		||||
 * $Date: 2006/03/29 18:54:00 $ $Revision: 1.2 $
 | 
			
		||||
 * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/basiccrveval.h,v 1.2 2006/03/29 18:54:00 brianp Exp $
 | 
			
		||||
 * $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $
 | 
			
		||||
 * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/basiccrveval.h,v 1.1 2001/03/17 00:25:40 brianp Exp $
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef __glubasiccrveval_h_
 | 
			
		||||
@@ -48,7 +48,6 @@
 | 
			
		||||
 | 
			
		||||
class BasicCurveEvaluator : public CachingEvaluator {
 | 
			
		||||
public:
 | 
			
		||||
    virtual             ~BasicCurveEvaluator() { /* silence warning*/ }
 | 
			
		||||
    virtual void	domain1f( REAL, REAL );
 | 
			
		||||
    virtual void	range1f( long, REAL *, REAL * );
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -49,7 +49,7 @@ void
 | 
			
		||||
BasicSurfaceEvaluator::domain2f( REAL, REAL, REAL, REAL )
 | 
			
		||||
{
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
    _glu_dprintf( "domain2f\n" );
 | 
			
		||||
    dprintf( "domain2f\n" );
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -57,7 +57,7 @@ void
 | 
			
		||||
BasicSurfaceEvaluator::polymode( long )
 | 
			
		||||
{
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
    _glu_dprintf( "polymode\n" );
 | 
			
		||||
    dprintf( "polymode\n" );
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -65,7 +65,7 @@ void
 | 
			
		||||
BasicSurfaceEvaluator::range2f( long type, REAL *from, REAL *to )
 | 
			
		||||
{
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
    _glu_dprintf( "range2f type %ld, from (%g,%g), to (%g,%g)\n",
 | 
			
		||||
    dprintf( "range2f type %ld, from (%g,%g), to (%g,%g)\n",
 | 
			
		||||
		type, from[0], from[1], to[0], to[1] );
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
@@ -74,7 +74,7 @@ void
 | 
			
		||||
BasicSurfaceEvaluator::enable( long )
 | 
			
		||||
{
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
    _glu_dprintf( "enable\n" );
 | 
			
		||||
    dprintf( "enable\n" );
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -82,7 +82,7 @@ void
 | 
			
		||||
BasicSurfaceEvaluator::disable( long )
 | 
			
		||||
{
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
    _glu_dprintf( "disable\n" );
 | 
			
		||||
    dprintf( "disable\n" );
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -90,7 +90,7 @@ void
 | 
			
		||||
BasicSurfaceEvaluator::bgnmap2f( long )
 | 
			
		||||
{
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
    _glu_dprintf( "bgnmap2f\n" );
 | 
			
		||||
    dprintf( "bgnmap2f\n" );
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -98,7 +98,7 @@ void
 | 
			
		||||
BasicSurfaceEvaluator::endmap2f( void )
 | 
			
		||||
{
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
    _glu_dprintf( "endmap2f\n" );
 | 
			
		||||
    dprintf( "endmap2f\n" );
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -108,7 +108,7 @@ BasicSurfaceEvaluator::map2f( long, REAL, REAL, long, long,
 | 
			
		||||
			      REAL * )
 | 
			
		||||
{
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
    _glu_dprintf( "map2f\n" );
 | 
			
		||||
    dprintf( "map2f\n" );
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -116,7 +116,7 @@ void
 | 
			
		||||
BasicSurfaceEvaluator::mapgrid2f( long, REAL, REAL, long, REAL, REAL )
 | 
			
		||||
{
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
    _glu_dprintf( "mapgrid2f\n" );
 | 
			
		||||
    dprintf( "mapgrid2f\n" );
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -124,7 +124,7 @@ void
 | 
			
		||||
BasicSurfaceEvaluator::mapmesh2f( long, long, long, long, long )
 | 
			
		||||
{
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
    _glu_dprintf( "mapmesh2f\n" );
 | 
			
		||||
    dprintf( "mapmesh2f\n" );
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -132,7 +132,7 @@ void
 | 
			
		||||
BasicSurfaceEvaluator::evalcoord2f( long, REAL, REAL )
 | 
			
		||||
{
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
    _glu_dprintf( "evalcoord2f\n" );
 | 
			
		||||
    dprintf( "evalcoord2f\n" );
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -140,7 +140,7 @@ void
 | 
			
		||||
BasicSurfaceEvaluator::evalpoint2i( long, long )
 | 
			
		||||
{
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
    _glu_dprintf( "evalpoint2i\n" );
 | 
			
		||||
    dprintf( "evalpoint2i\n" );
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -148,7 +148,7 @@ void
 | 
			
		||||
BasicSurfaceEvaluator::bgnline( void )
 | 
			
		||||
{
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
    _glu_dprintf( "bgnline\n" );
 | 
			
		||||
    dprintf( "bgnline\n" );
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -156,7 +156,7 @@ void
 | 
			
		||||
BasicSurfaceEvaluator::endline( void )
 | 
			
		||||
{
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
    _glu_dprintf( "endline\n" );
 | 
			
		||||
    dprintf( "endline\n" );
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -164,7 +164,7 @@ void
 | 
			
		||||
BasicSurfaceEvaluator::bgnclosedline( void )
 | 
			
		||||
{
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
    _glu_dprintf( "bgnclosedline\n" );
 | 
			
		||||
    dprintf( "bgnclosedline\n" );
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -172,7 +172,7 @@ void
 | 
			
		||||
BasicSurfaceEvaluator::endclosedline( void )
 | 
			
		||||
{
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
    _glu_dprintf( "endclosedline\n" );
 | 
			
		||||
    dprintf( "endclosedline\n" );
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -180,7 +180,7 @@ void
 | 
			
		||||
BasicSurfaceEvaluator::bgntfan( void )
 | 
			
		||||
{
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
    _glu_dprintf( "bgntfan\n" );
 | 
			
		||||
    dprintf( "bgntfan\n" );
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -194,7 +194,7 @@ void
 | 
			
		||||
BasicSurfaceEvaluator::bgntmesh( void )
 | 
			
		||||
{
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
    _glu_dprintf( "bgntmesh\n" );
 | 
			
		||||
    dprintf( "bgntmesh\n" );
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -202,7 +202,7 @@ void
 | 
			
		||||
BasicSurfaceEvaluator::swaptmesh( void )
 | 
			
		||||
{
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
    _glu_dprintf( "swaptmesh\n" );
 | 
			
		||||
    dprintf( "swaptmesh\n" );
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -210,7 +210,7 @@ void
 | 
			
		||||
BasicSurfaceEvaluator::endtmesh( void )
 | 
			
		||||
{
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
    _glu_dprintf( "endtmesh\n" );
 | 
			
		||||
    dprintf( "endtmesh\n" );
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -218,7 +218,7 @@ void
 | 
			
		||||
BasicSurfaceEvaluator::bgnqstrip( void )
 | 
			
		||||
{
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
    _glu_dprintf( "bgnqstrip\n" );
 | 
			
		||||
    dprintf( "bgnqstrip\n" );
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -226,7 +226,7 @@ void
 | 
			
		||||
BasicSurfaceEvaluator::endqstrip( void )
 | 
			
		||||
{
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
    _glu_dprintf( "endqstrip\n" );
 | 
			
		||||
    dprintf( "endqstrip\n" );
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -35,8 +35,8 @@
 | 
			
		||||
/*
 | 
			
		||||
 * basicsurfeval.h
 | 
			
		||||
 *
 | 
			
		||||
 * $Date: 2006/03/29 18:54:00 $ $Revision: 1.2 $
 | 
			
		||||
 * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/basicsurfeval.h,v 1.2 2006/03/29 18:54:00 brianp Exp $
 | 
			
		||||
 * $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $
 | 
			
		||||
 * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/basicsurfeval.h,v 1.1 2001/03/17 00:25:40 brianp Exp $
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef __glubasicsurfeval_h_
 | 
			
		||||
@@ -48,7 +48,6 @@
 | 
			
		||||
 | 
			
		||||
class BasicSurfaceEvaluator : public CachingEvaluator {
 | 
			
		||||
public:
 | 
			
		||||
    virtual             ~BasicSurfaceEvaluator() { /* silence warning*/ }
 | 
			
		||||
    virtual void	range2f( long, REAL *, REAL * );
 | 
			
		||||
    virtual void	domain2f( REAL, REAL, REAL, REAL );
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -35,8 +35,8 @@
 | 
			
		||||
/*
 | 
			
		||||
 * bin.c++
 | 
			
		||||
 *
 | 
			
		||||
 * $Date: 2006/03/14 15:08:52 $ $Revision: 1.3 $
 | 
			
		||||
 * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/bin.cc,v 1.3 2006/03/14 15:08:52 brianp Exp $
 | 
			
		||||
 * $Date: 2004/05/12 15:29:36 $ $Revision: 1.2 $
 | 
			
		||||
 * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/bin.cc,v 1.2 2004/05/12 15:29:36 brianp Exp $
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "glimports.h"
 | 
			
		||||
@@ -123,7 +123,7 @@ void
 | 
			
		||||
Bin::show( char *name )
 | 
			
		||||
{
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
    _glu_dprintf( "%s\n", name );
 | 
			
		||||
    dprintf( "%s\n", name );
 | 
			
		||||
    for( Arc_ptr jarc = firstarc(); jarc; jarc = nextarc() )
 | 
			
		||||
        jarc->show( );
 | 
			
		||||
#endif
 | 
			
		||||
@@ -160,7 +160,7 @@ Bin::listBezier( void )
 | 
			
		||||
    	    REAL t1 = pts[0].param[1];
 | 
			
		||||
    	    REAL s2 = pts[1].param[0];
 | 
			
		||||
    	    REAL t2 = pts[1].param[1];
 | 
			
		||||
	   _glu_dprintf( "arc (%g,%g) (%g,%g)\n", s1, t1, s2, t2 );
 | 
			
		||||
	   dprintf( "arc (%g,%g) (%g,%g)\n", s1, t1, s2, t2 );
 | 
			
		||||
#endif
 | 
			
		||||
	}
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -35,8 +35,8 @@
 | 
			
		||||
/*
 | 
			
		||||
 * bufpool.h
 | 
			
		||||
 *
 | 
			
		||||
 * $Date: 2006/03/29 18:46:46 $ $Revision: 1.3 $
 | 
			
		||||
 * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/bufpool.h,v 1.3 2006/03/29 18:46:46 brianp Exp $
 | 
			
		||||
 * $Date: 2001/03/22 11:38:36 $ $Revision: 1.2 $
 | 
			
		||||
 * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/bufpool.h,v 1.2 2001/03/22 11:38:36 joukj Exp $
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef __glubufpool_h_
 | 
			
		||||
@@ -128,7 +128,6 @@ public:
 | 
			
		||||
    inline void * 	operator new( size_t s)
 | 
			
		||||
				{ return ::new char[s]; }
 | 
			
		||||
    inline void 	operator delete( void * ) { assert( 0 ); }
 | 
			
		||||
    inline void         operator delete( void *, Pool & ) { assert( 0 ); }
 | 
			
		||||
    inline void		deleteMe( Pool & );
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -35,8 +35,8 @@
 | 
			
		||||
/*
 | 
			
		||||
 * cachingeval.h
 | 
			
		||||
 *
 | 
			
		||||
 * $Date: 2006/03/29 18:54:00 $ $Revision: 1.2 $
 | 
			
		||||
 * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/cachingeval.h,v 1.2 2006/03/29 18:54:00 brianp Exp $
 | 
			
		||||
 * $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $
 | 
			
		||||
 * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/cachingeval.h,v 1.1 2001/03/17 00:25:40 brianp Exp $
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef __glucachingval_h_
 | 
			
		||||
@@ -44,7 +44,6 @@
 | 
			
		||||
 | 
			
		||||
class CachingEvaluator {
 | 
			
		||||
public:
 | 
			
		||||
    virtual             ~CachingEvaluator() { /* silence warning*/ }
 | 
			
		||||
    enum ServiceMode 	{ play, record, playAndRecord };
 | 
			
		||||
    virtual int		canRecord( void );
 | 
			
		||||
    virtual int		canPlayAndRecord( void );
 | 
			
		||||
 
 | 
			
		||||
@@ -35,8 +35,8 @@
 | 
			
		||||
/*
 | 
			
		||||
 * ccw.c++
 | 
			
		||||
 *
 | 
			
		||||
 * $Date: 2006/03/14 15:08:52 $ $Revision: 1.3 $
 | 
			
		||||
 * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/ccw.cc,v 1.3 2006/03/14 15:08:52 brianp Exp $
 | 
			
		||||
 * $Date: 2002/11/01 23:35:07 $ $Revision: 1.2 $
 | 
			
		||||
 * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/ccw.cc,v 1.2 2002/11/01 23:35:07 brianp Exp $
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "glimports.h"
 | 
			
		||||
@@ -70,7 +70,7 @@ Subdivider::ccwTurn_sr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
 | 
			
		||||
    assert( v2 != v2last );
 | 
			
		||||
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
    _glu_dprintf( "arc_ccw_turn, p = %d\n", 0 );
 | 
			
		||||
    dprintf( "arc_ccw_turn, p = %d\n", 0 );
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    // the arcs lie on the line (0 == v1->param[0])
 | 
			
		||||
@@ -88,7 +88,7 @@ Subdivider::ccwTurn_sr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
 | 
			
		||||
    while( 1 ) {
 | 
			
		||||
	if( v1next->param[0] < v2next->param[0] ) {
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
	    _glu_dprintf( "case a\n" );
 | 
			
		||||
	    dprintf( "case a\n" );
 | 
			
		||||
#endif
 | 
			
		||||
	    assert( v1->param[0] <= v1next->param[0] );
 | 
			
		||||
	    assert( v2->param[0] <= v1next->param[0] );
 | 
			
		||||
@@ -101,12 +101,12 @@ Subdivider::ccwTurn_sr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
 | 
			
		||||
			return sgn;
 | 
			
		||||
		   } else {
 | 
			
		||||
#ifdef DEBUG
 | 
			
		||||
			_glu_dprintf( "decr\n" );
 | 
			
		||||
			dprintf( "decr\n" );
 | 
			
		||||
#endif
 | 
			
		||||
			v1 = v1next--;
 | 
			
		||||
			if( v1 == v1last ) {
 | 
			
		||||
#ifdef DEBUG
 | 
			
		||||
			    _glu_dprintf( "no good results\n" );
 | 
			
		||||
			    dprintf( "no good results\n" );
 | 
			
		||||
#endif
 | 
			
		||||
			    return 0; // ill-conditioned, guess answer
 | 
			
		||||
			}
 | 
			
		||||
@@ -117,7 +117,7 @@ Subdivider::ccwTurn_sr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
 | 
			
		||||
	    }
 | 
			
		||||
	} else if( v1next->param[0] > v2next->param[0] ) {
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
	    _glu_dprintf( "case b\n" );
 | 
			
		||||
	    dprintf( "case b\n" );
 | 
			
		||||
#endif
 | 
			
		||||
	    assert( v1->param[0] <= v2next->param[0] );
 | 
			
		||||
	    assert( v2->param[0] <= v2next->param[0] );
 | 
			
		||||
@@ -130,12 +130,12 @@ Subdivider::ccwTurn_sr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
 | 
			
		||||
			return sgn;
 | 
			
		||||
		   } else {
 | 
			
		||||
#ifdef DEBUG
 | 
			
		||||
			_glu_dprintf( "incr\n" );
 | 
			
		||||
			dprintf( "incr\n" );
 | 
			
		||||
#endif
 | 
			
		||||
			v2 = v2next++;
 | 
			
		||||
			if( v2 == v2last ) {
 | 
			
		||||
#ifdef DEBUG
 | 
			
		||||
			    _glu_dprintf( "no good results\n" );
 | 
			
		||||
			    dprintf( "no good results\n" );
 | 
			
		||||
#endif
 | 
			
		||||
			    return 0; // ill-conditioned, guess answer
 | 
			
		||||
			}
 | 
			
		||||
@@ -146,7 +146,7 @@ Subdivider::ccwTurn_sr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
 | 
			
		||||
	    }
 | 
			
		||||
	} else {
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
	    _glu_dprintf( "case ab\n" );
 | 
			
		||||
	    dprintf( "case ab\n" );
 | 
			
		||||
#endif
 | 
			
		||||
	    if( v1next->param[1] < v2next->param[1] )
 | 
			
		||||
		return 0;
 | 
			
		||||
@@ -154,12 +154,12 @@ Subdivider::ccwTurn_sr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
 | 
			
		||||
		return 1;
 | 
			
		||||
	    else {
 | 
			
		||||
#ifdef DEBUG
 | 
			
		||||
		_glu_dprintf( "incr\n" );
 | 
			
		||||
		dprintf( "incr\n" );
 | 
			
		||||
#endif
 | 
			
		||||
		v2 = v2next++;
 | 
			
		||||
		if( v2 == v2last ) {
 | 
			
		||||
#ifdef DEBUG
 | 
			
		||||
		    _glu_dprintf( "no good results\n" );
 | 
			
		||||
		    dprintf( "no good results\n" );
 | 
			
		||||
#endif
 | 
			
		||||
		    return 0; // ill-conditioned, guess answer
 | 
			
		||||
		}
 | 
			
		||||
@@ -183,7 +183,7 @@ Subdivider::ccwTurn_sl( Arc_ptr j1, Arc_ptr j2 ) // dir = 0
 | 
			
		||||
    assert( v2 != v2last );
 | 
			
		||||
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
    _glu_dprintf( "arc_ccw_turn, p = %d\n", 0 );
 | 
			
		||||
    dprintf( "arc_ccw_turn, p = %d\n", 0 );
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    // the arcs lie on the line (0 == v1->param[0])
 | 
			
		||||
@@ -201,7 +201,7 @@ Subdivider::ccwTurn_sl( Arc_ptr j1, Arc_ptr j2 ) // dir = 0
 | 
			
		||||
    while( 1 ) {
 | 
			
		||||
	if( v1next->param[0] > v2next->param[0] ) {
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
	    _glu_dprintf( "case c\n" );
 | 
			
		||||
	    dprintf( "case c\n" );
 | 
			
		||||
#endif
 | 
			
		||||
	    assert( v1->param[0] >= v1next->param[0] );
 | 
			
		||||
	    assert( v2->param[0] >= v1next->param[0] );
 | 
			
		||||
@@ -215,11 +215,11 @@ Subdivider::ccwTurn_sl( Arc_ptr j1, Arc_ptr j2 ) // dir = 0
 | 
			
		||||
		    else {
 | 
			
		||||
			v1 = v1next--;
 | 
			
		||||
#ifdef DEBUG
 | 
			
		||||
			_glu_dprintf( "decr\n" );
 | 
			
		||||
			dprintf( "decr\n" );
 | 
			
		||||
#endif
 | 
			
		||||
			if( v1 == v1last ) {
 | 
			
		||||
#ifdef DEBUG
 | 
			
		||||
			    _glu_dprintf( "no good results\n" );
 | 
			
		||||
			    dprintf( "no good results\n" );
 | 
			
		||||
#endif
 | 
			
		||||
			    return 0; // ill-conditioned, guess answer
 | 
			
		||||
			}
 | 
			
		||||
@@ -230,7 +230,7 @@ Subdivider::ccwTurn_sl( Arc_ptr j1, Arc_ptr j2 ) // dir = 0
 | 
			
		||||
	    }
 | 
			
		||||
	} else if( v1next->param[0] < v2next->param[0] ) {
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
	    _glu_dprintf( "case d\n" );
 | 
			
		||||
	    dprintf( "case d\n" );
 | 
			
		||||
#endif
 | 
			
		||||
	    assert( v1->param[0] >= v2next->param[0] );
 | 
			
		||||
	    assert( v2->param[0] >= v2next->param[0] );
 | 
			
		||||
@@ -244,11 +244,11 @@ Subdivider::ccwTurn_sl( Arc_ptr j1, Arc_ptr j2 ) // dir = 0
 | 
			
		||||
		    else {
 | 
			
		||||
			v2 = v2next++;
 | 
			
		||||
#ifdef DEBUG
 | 
			
		||||
			_glu_dprintf( "incr\n" );
 | 
			
		||||
			dprintf( "incr\n" );
 | 
			
		||||
#endif
 | 
			
		||||
			if( v2 == v2last ) {
 | 
			
		||||
#ifdef DEBUG
 | 
			
		||||
			    _glu_dprintf( "no good results\n" );
 | 
			
		||||
			    dprintf( "no good results\n" );
 | 
			
		||||
#endif
 | 
			
		||||
			    return 0; // ill-conditioned, guess answer
 | 
			
		||||
			}
 | 
			
		||||
@@ -259,7 +259,7 @@ Subdivider::ccwTurn_sl( Arc_ptr j1, Arc_ptr j2 ) // dir = 0
 | 
			
		||||
	    }
 | 
			
		||||
	} else {
 | 
			
		||||
#ifdef DEBUG
 | 
			
		||||
	    _glu_dprintf( "case cd\n" );
 | 
			
		||||
	    dprintf( "case cd\n" );
 | 
			
		||||
#endif
 | 
			
		||||
	    if( v1next->param[1] < v2next->param[1] )
 | 
			
		||||
		return 1;
 | 
			
		||||
@@ -268,11 +268,11 @@ Subdivider::ccwTurn_sl( Arc_ptr j1, Arc_ptr j2 ) // dir = 0
 | 
			
		||||
	    else {
 | 
			
		||||
		v2 = v2next++;
 | 
			
		||||
#ifdef DEBUG
 | 
			
		||||
		_glu_dprintf( "incr\n" );
 | 
			
		||||
		dprintf( "incr\n" );
 | 
			
		||||
#endif
 | 
			
		||||
		if( v2 == v2last ) {
 | 
			
		||||
#ifdef DEBUG
 | 
			
		||||
		    _glu_dprintf( "no good results\n" );
 | 
			
		||||
		    dprintf( "no good results\n" );
 | 
			
		||||
#endif
 | 
			
		||||
		    return 0; // ill-conditioned, guess answer
 | 
			
		||||
		}
 | 
			
		||||
@@ -296,7 +296,7 @@ Subdivider::ccwTurn_tr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
 | 
			
		||||
    assert( v2 != v2last );
 | 
			
		||||
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
    _glu_dprintf( "arc_ccw_turn, p = %d\n", 1 );
 | 
			
		||||
    dprintf( "arc_ccw_turn, p = %d\n", 1 );
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    // the arcs lie on the line (1 == v1->param[1])
 | 
			
		||||
@@ -314,7 +314,7 @@ Subdivider::ccwTurn_tr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
 | 
			
		||||
    while( 1 ) {
 | 
			
		||||
	if( v1next->param[1] < v2next->param[1] ) {
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
	    _glu_dprintf( "case a\n" );
 | 
			
		||||
	    dprintf( "case a\n" );
 | 
			
		||||
#endif
 | 
			
		||||
	    assert( v1->param[1] <= v1next->param[1] );
 | 
			
		||||
	    assert( v2->param[1] <= v1next->param[1] );
 | 
			
		||||
@@ -327,12 +327,12 @@ Subdivider::ccwTurn_tr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
 | 
			
		||||
			return sgn;
 | 
			
		||||
		   } else {
 | 
			
		||||
#ifdef DEBUG
 | 
			
		||||
			_glu_dprintf( "decr\n" );
 | 
			
		||||
			dprintf( "decr\n" );
 | 
			
		||||
#endif
 | 
			
		||||
			v1 = v1next--;
 | 
			
		||||
			if( v1 == v1last ) {
 | 
			
		||||
#ifdef DEBUG
 | 
			
		||||
			    _glu_dprintf( "no good results\n" );
 | 
			
		||||
			    dprintf( "no good results\n" );
 | 
			
		||||
#endif
 | 
			
		||||
			    return 0; // ill-conditioned, guess answer
 | 
			
		||||
			}
 | 
			
		||||
@@ -343,7 +343,7 @@ Subdivider::ccwTurn_tr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
 | 
			
		||||
	    }
 | 
			
		||||
	} else if( v1next->param[1] > v2next->param[1] ) {
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
	    _glu_dprintf( "case b\n" );
 | 
			
		||||
	    dprintf( "case b\n" );
 | 
			
		||||
#endif
 | 
			
		||||
	    assert( v1->param[1] <= v2next->param[1] );
 | 
			
		||||
	    assert( v2->param[1] <= v2next->param[1] );
 | 
			
		||||
@@ -356,12 +356,12 @@ Subdivider::ccwTurn_tr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
 | 
			
		||||
			return sgn;
 | 
			
		||||
		   } else {
 | 
			
		||||
#ifdef DEBUG
 | 
			
		||||
			_glu_dprintf( "incr\n" );
 | 
			
		||||
			dprintf( "incr\n" );
 | 
			
		||||
#endif
 | 
			
		||||
			v2 = v2next++;
 | 
			
		||||
			if( v2 == v2last ) {
 | 
			
		||||
#ifdef DEBUG
 | 
			
		||||
			    _glu_dprintf( "no good results\n" );
 | 
			
		||||
			    dprintf( "no good results\n" );
 | 
			
		||||
#endif
 | 
			
		||||
			    return 0; // ill-conditioned, guess answer
 | 
			
		||||
			}
 | 
			
		||||
@@ -372,7 +372,7 @@ Subdivider::ccwTurn_tr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
 | 
			
		||||
	    }
 | 
			
		||||
	} else {
 | 
			
		||||
#ifdef DEBUG
 | 
			
		||||
	    _glu_dprintf( "case ab\n" );
 | 
			
		||||
	    dprintf( "case ab\n" );
 | 
			
		||||
#endif
 | 
			
		||||
	    if( v1next->param[0] < v2next->param[0] )
 | 
			
		||||
		return 1;
 | 
			
		||||
@@ -380,12 +380,12 @@ Subdivider::ccwTurn_tr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
 | 
			
		||||
		return 0;
 | 
			
		||||
	    else {
 | 
			
		||||
#ifdef DEBUG
 | 
			
		||||
		_glu_dprintf( "incr\n" );
 | 
			
		||||
		dprintf( "incr\n" );
 | 
			
		||||
#endif
 | 
			
		||||
		v2 = v2next++;
 | 
			
		||||
		if( v2 == v2last ) {
 | 
			
		||||
#ifdef DEBUG
 | 
			
		||||
		    _glu_dprintf( "no good results\n" );
 | 
			
		||||
		    dprintf( "no good results\n" );
 | 
			
		||||
#endif
 | 
			
		||||
		    return 0; // ill-conditioned, guess answer
 | 
			
		||||
		}
 | 
			
		||||
@@ -409,7 +409,7 @@ Subdivider::ccwTurn_tl( Arc_ptr j1, Arc_ptr j2 )
 | 
			
		||||
    assert( v2 != v2last );
 | 
			
		||||
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
    _glu_dprintf( "arc_ccw_turn, p = %d\n", 1 );
 | 
			
		||||
    dprintf( "arc_ccw_turn, p = %d\n", 1 );
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    // the arcs lie on the line (1 == v1->param[1])
 | 
			
		||||
@@ -427,7 +427,7 @@ Subdivider::ccwTurn_tl( Arc_ptr j1, Arc_ptr j2 )
 | 
			
		||||
    while( 1 ) {
 | 
			
		||||
	if( v1next->param[1] > v2next->param[1] ) {
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
	    _glu_dprintf( "case c\n" );
 | 
			
		||||
	    dprintf( "case c\n" );
 | 
			
		||||
#endif
 | 
			
		||||
	    assert( v1->param[1] >= v1next->param[1] );
 | 
			
		||||
	    assert( v2->param[1] >= v1next->param[1] );
 | 
			
		||||
@@ -441,11 +441,11 @@ Subdivider::ccwTurn_tl( Arc_ptr j1, Arc_ptr j2 )
 | 
			
		||||
		    else {
 | 
			
		||||
			v1 = v1next--;
 | 
			
		||||
#ifdef DEBUG
 | 
			
		||||
			_glu_dprintf( "decr\n" );
 | 
			
		||||
			dprintf( "decr\n" );
 | 
			
		||||
#endif
 | 
			
		||||
			if( v1 == v1last ) {
 | 
			
		||||
#ifdef DEBUG
 | 
			
		||||
			    _glu_dprintf( "no good results\n" );
 | 
			
		||||
			    dprintf( "no good results\n" );
 | 
			
		||||
#endif
 | 
			
		||||
			    return 0; // ill-conditioned, guess answer
 | 
			
		||||
			}
 | 
			
		||||
@@ -456,7 +456,7 @@ Subdivider::ccwTurn_tl( Arc_ptr j1, Arc_ptr j2 )
 | 
			
		||||
	    }
 | 
			
		||||
	} else if( v1next->param[1] < v2next->param[1] ) {
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
	    _glu_dprintf( "case d\n" );
 | 
			
		||||
	    dprintf( "case d\n" );
 | 
			
		||||
	    assert( v1->param[1] >= v2next->param[1] );
 | 
			
		||||
	    assert( v2->param[1] >= v2next->param[1] );
 | 
			
		||||
#endif
 | 
			
		||||
@@ -470,11 +470,11 @@ Subdivider::ccwTurn_tl( Arc_ptr j1, Arc_ptr j2 )
 | 
			
		||||
		    else {
 | 
			
		||||
			v2 = v2next++;
 | 
			
		||||
#ifdef DEBUG
 | 
			
		||||
			_glu_dprintf( "incr\n" );
 | 
			
		||||
			dprintf( "incr\n" );
 | 
			
		||||
#endif
 | 
			
		||||
			if( v2 == v2last ) {
 | 
			
		||||
#ifdef DEBUG
 | 
			
		||||
			    _glu_dprintf( "no good results\n" );
 | 
			
		||||
			    dprintf( "no good results\n" );
 | 
			
		||||
#endif
 | 
			
		||||
			    return 0; // ill-conditioned, guess answer
 | 
			
		||||
			}
 | 
			
		||||
@@ -485,7 +485,7 @@ Subdivider::ccwTurn_tl( Arc_ptr j1, Arc_ptr j2 )
 | 
			
		||||
	    }
 | 
			
		||||
	} else {
 | 
			
		||||
#ifdef DEBUG
 | 
			
		||||
	    _glu_dprintf( "case cd\n" );
 | 
			
		||||
	    dprintf( "case cd\n" );
 | 
			
		||||
#endif
 | 
			
		||||
	    if( v1next->param[0] < v2next->param[0] )
 | 
			
		||||
		return 0;
 | 
			
		||||
@@ -494,11 +494,11 @@ Subdivider::ccwTurn_tl( Arc_ptr j1, Arc_ptr j2 )
 | 
			
		||||
	    else {
 | 
			
		||||
		v2 = v2next++;
 | 
			
		||||
#ifdef DEBUG
 | 
			
		||||
		_glu_dprintf( "incr\n" );
 | 
			
		||||
		dprintf( "incr\n" );
 | 
			
		||||
#endif
 | 
			
		||||
		if( v2 == v2last ) {
 | 
			
		||||
#ifdef DEBUG
 | 
			
		||||
		    _glu_dprintf( "no good results\n" );
 | 
			
		||||
		    dprintf( "no good results\n" );
 | 
			
		||||
#endif
 | 
			
		||||
		    return 0; // ill-conditioned, guess answer
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
@@ -35,8 +35,8 @@
 | 
			
		||||
/*
 | 
			
		||||
 * flistsorter.h
 | 
			
		||||
 *
 | 
			
		||||
 * $Date: 2006/03/29 18:54:00 $ $Revision: 1.2 $
 | 
			
		||||
 * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/flistsorter.h,v 1.2 2006/03/29 18:54:00 brianp Exp $
 | 
			
		||||
 * $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $
 | 
			
		||||
 * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/flistsorter.h,v 1.1 2001/03/17 00:25:41 brianp Exp $
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef __gluflistsorter_h_
 | 
			
		||||
@@ -48,7 +48,6 @@
 | 
			
		||||
class FlistSorter : public Sorter {
 | 
			
		||||
public:
 | 
			
		||||
			FlistSorter(void);
 | 
			
		||||
    virtual             ~FlistSorter() { /* silence warning*/ }
 | 
			
		||||
    void		qsort( REAL *a, int n );
 | 
			
		||||
 | 
			
		||||
protected:	
 | 
			
		||||
 
 | 
			
		||||
@@ -129,11 +129,11 @@ int Knotvector::validate( void )
 | 
			
		||||
void Knotvector::show( char *msg )
 | 
			
		||||
{
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
    _glu_dprintf( "%s\n", msg );
 | 
			
		||||
    _glu_dprintf( "order = %ld, count = %ld\n", order, knotcount );
 | 
			
		||||
    dprintf( "%s\n", msg );
 | 
			
		||||
    dprintf( "order = %ld, count = %ld\n", order, knotcount );
 | 
			
		||||
 | 
			
		||||
    for( int i=0; i<knotcount; i++ )
 | 
			
		||||
	_glu_dprintf( "knot[%d] = %g\n", i, knotlist[i] );
 | 
			
		||||
	dprintf( "knot[%d] = %g\n", i, knotlist[i] );
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -232,7 +232,7 @@ NurbsTessellator::pwlcurve( long count, INREAL array[], long byte_stride, long t
 | 
			
		||||
	}
 | 
			
		||||
	if( i != count ) {
 | 
			
		||||
	    do_nurbserror( 37 );
 | 
			
		||||
	    _glu_dprintf( "point %d (%f,%f)\n", i, x, y );
 | 
			
		||||
	    dprintf( "point %d (%f,%f)\n", i, x, y );
 | 
			
		||||
	    isDataValid = 0;
 | 
			
		||||
	    return;
 | 
			
		||||
	}
 | 
			
		||||
@@ -247,7 +247,7 @@ NurbsTessellator::pwlcurve( long count, INREAL array[], long byte_stride, long t
 | 
			
		||||
	}
 | 
			
		||||
	if( i != count ) {
 | 
			
		||||
	    do_nurbserror( 37 );
 | 
			
		||||
	    _glu_dprintf( "point %d (%f,%f)\n", i, x, y );
 | 
			
		||||
	    dprintf( "point %d (%f,%f)\n", i, x, y );
 | 
			
		||||
	    isDataValid = 0;
 | 
			
		||||
	    return;
 | 
			
		||||
	}
 | 
			
		||||
@@ -460,7 +460,7 @@ NurbsTessellator::setnurbsproperty( long type, long purpose, INREAL *mat )
 | 
			
		||||
	mapdesc->setBboxsize( mat );
 | 
			
		||||
    } else {
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
        _glu_dprintf( "ERRORRORRORR!!!\n");
 | 
			
		||||
        dprintf( "ERRORRORRORR!!!\n");
 | 
			
		||||
#endif
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -488,7 +488,7 @@ NurbsTessellator::setnurbsproperty( long type, long purpose, INREAL *mat,
 | 
			
		||||
	mapdesc->setBmat( mat, rstride, cstride );
 | 
			
		||||
    } else {
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
        _glu_dprintf( "ERRORRORRORR!!!\n");
 | 
			
		||||
        dprintf( "ERRORRORRORR!!!\n");
 | 
			
		||||
#endif
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -35,8 +35,8 @@
 | 
			
		||||
/*
 | 
			
		||||
 * nurbstess.c++
 | 
			
		||||
 *
 | 
			
		||||
 * $Date: 2006/03/14 15:08:52 $ $Revision: 1.2 $
 | 
			
		||||
 * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/nurbstess.cc,v 1.2 2006/03/14 15:08:52 brianp Exp $
 | 
			
		||||
 * $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $
 | 
			
		||||
 * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/nurbstess.cc,v 1.1 2001/03/17 00:25:41 brianp Exp $
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "glimports.h"
 | 
			
		||||
@@ -79,7 +79,7 @@ void
 | 
			
		||||
NurbsTessellator::makeobj( int )
 | 
			
		||||
{
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
   _glu_dprintf( "makeobj\n" );
 | 
			
		||||
   dprintf( "makeobj\n" );
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -87,7 +87,7 @@ void
 | 
			
		||||
NurbsTessellator::closeobj( void )
 | 
			
		||||
{
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
   _glu_dprintf( "closeobj\n" );
 | 
			
		||||
   dprintf( "closeobj\n" );
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -95,7 +95,7 @@ void
 | 
			
		||||
NurbsTessellator::bgnrender( void )
 | 
			
		||||
{
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
   _glu_dprintf( "bgnrender\n" );
 | 
			
		||||
   dprintf( "bgnrender\n" );
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -103,7 +103,7 @@ void
 | 
			
		||||
NurbsTessellator::endrender( void )
 | 
			
		||||
{
 | 
			
		||||
#ifndef NDEBUG
 | 
			
		||||
    _glu_dprintf( "endrender\n" );
 | 
			
		||||
    dprintf( "endrender\n" );
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -35,8 +35,8 @@
 | 
			
		||||
/*
 | 
			
		||||
 * patch.c++
 | 
			
		||||
 *
 | 
			
		||||
 * $Date: 2006/03/14 15:08:52 $ $Revision: 1.4 $
 | 
			
		||||
 * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/patch.cc,v 1.4 2006/03/14 15:08:52 brianp Exp $
 | 
			
		||||
 * $Date: 2002/11/01 23:35:07 $ $Revision: 1.3 $
 | 
			
		||||
 * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/patch.cc,v 1.3 2002/11/01 23:35:07 brianp Exp $
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
@@ -439,7 +439,7 @@ Patch::getstepsize( void )
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
#ifdef DEBUG
 | 
			
		||||
    _glu_dprintf( "sidesteps %g %g %g %g, stepsize %g %g\n",
 | 
			
		||||
    dprintf( "sidesteps %g %g %g %g, stepsize %g %g\n",
 | 
			
		||||
	pspec[0].sidestep[0], pspec[0].sidestep[1],
 | 
			
		||||
	pspec[1].sidestep[0], pspec[1].sidestep[1],
 | 
			
		||||
	pspec[0].stepsize, pspec[1].stepsize );
 | 
			
		||||
 
 | 
			
		||||
@@ -35,8 +35,8 @@
 | 
			
		||||
/*
 | 
			
		||||
 * quilt.c++
 | 
			
		||||
 *
 | 
			
		||||
 * $Date: 2006/03/14 15:08:52 $ $Revision: 1.3 $
 | 
			
		||||
 * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/quilt.cc,v 1.3 2006/03/14 15:08:52 brianp Exp $
 | 
			
		||||
 * $Date: 2002/11/01 23:35:07 $ $Revision: 1.2 $
 | 
			
		||||
 * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/quilt.cc,v 1.2 2002/11/01 23:35:07 brianp Exp $
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "glimports.h"
 | 
			
		||||
@@ -91,12 +91,12 @@ Quilt::show( void )
 | 
			
		||||
    for( int i=0; i!= qspec[0].order * qspec[0].width; i++ ) {
 | 
			
		||||
	for( int j = 0; j!= qspec[1].order * qspec[1].width; j++ ) {
 | 
			
		||||
	    for( int k=0; k < nc; k++ )
 | 
			
		||||
		_glu_dprintf(  "%g ", ps[i*qspec[0].stride + j*qspec[1].stride + k] );
 | 
			
		||||
	    _glu_dprintf(  "\n" );
 | 
			
		||||
		dprintf(  "%g ", ps[i*qspec[0].stride + j*qspec[1].stride + k] );
 | 
			
		||||
	    dprintf(  "\n" );
 | 
			
		||||
	}
 | 
			
		||||
	_glu_dprintf(  "\n" );
 | 
			
		||||
	dprintf(  "\n" );
 | 
			
		||||
    }
 | 
			
		||||
    _glu_dprintf( "\n" );
 | 
			
		||||
    dprintf( "\n" );
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user