Compare commits
3 Commits
mesa-6.5.3
...
mesa-6.5.2
Author | SHA1 | Date | |
---|---|---|---|
|
31f3433635 | ||
|
639eaceee7 | ||
|
3e21f52796 |
28
Makefile
28
Makefile
@@ -92,7 +92,6 @@ linux-alpha-static \
|
||||
linux-debug \
|
||||
linux-directfb \
|
||||
linux-dri \
|
||||
linux-dri-debug \
|
||||
linux-dri-x86 \
|
||||
linux-dri-x86-64 \
|
||||
linux-dri-ppc \
|
||||
@@ -155,10 +154,10 @@ ultrix-gcc:
|
||||
|
||||
# Rules for making release tarballs
|
||||
|
||||
DIRECTORY = Mesa-6.5.3
|
||||
LIB_NAME = MesaLib-6.5.3
|
||||
DEMO_NAME = MesaDemos-6.5.3
|
||||
GLUT_NAME = MesaGLUT-6.5.3
|
||||
DIRECTORY = Mesa-6.5.2
|
||||
LIB_NAME = MesaLib-6.5.2
|
||||
DEMO_NAME = MesaDemos-6.5.2
|
||||
GLUT_NAME = MesaGLUT-6.5.2
|
||||
|
||||
MAIN_FILES = \
|
||||
$(DIRECTORY)/Makefile* \
|
||||
@@ -209,6 +208,9 @@ MAIN_FILES = \
|
||||
$(DIRECTORY)/src/mesa/glapi/*.[chS] \
|
||||
$(DIRECTORY)/src/mesa/glapi/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/glapi/sources \
|
||||
$(DIRECTORY)/src/mesa/array_cache/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/array_cache/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/array_cache/sources \
|
||||
$(DIRECTORY)/src/mesa/math/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/math/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/math/sources \
|
||||
@@ -228,8 +230,6 @@ MAIN_FILES = \
|
||||
$(DIRECTORY)/src/mesa/swrast_setup/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/swrast_setup/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/swrast_setup/sources \
|
||||
$(DIRECTORY)/src/mesa/vbo/*.[chS] \
|
||||
$(DIRECTORY)/src/mesa/vbo/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/tnl/*.[chS] \
|
||||
$(DIRECTORY)/src/mesa/tnl/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/tnl/sources \
|
||||
@@ -288,16 +288,7 @@ MAIN_FILES = \
|
||||
$(DIRECTORY)/windows/VC7/mesa/glu/glu.vcproj \
|
||||
$(DIRECTORY)/windows/VC7/mesa/mesa.sln \
|
||||
$(DIRECTORY)/windows/VC7/mesa/mesa/mesa.vcproj \
|
||||
$(DIRECTORY)/windows/VC7/mesa/osmesa/osmesa.vcproj \
|
||||
$(DIRECTORY)/windows/VC8/mesa/mesa.sln \
|
||||
$(DIRECTORY)/windows/VC8/mesa/gdi/gdi.vcproj \
|
||||
$(DIRECTORY)/windows/VC8/mesa/glu/glu.vcproj \
|
||||
$(DIRECTORY)/windows/VC8/mesa/mesa/mesa.vcproj \
|
||||
$(DIRECTORY)/windows/VC8/mesa/osmesa/osmesa.vcproj \
|
||||
$(DIRECTORY)/windows/VC8/progs/progs.sln \
|
||||
$(DIRECTORY)/windows/VC8/progs/demos/gears.vcproj \
|
||||
$(DIRECTORY)/windows/VC8/progs/glut/glut.vcproj
|
||||
|
||||
$(DIRECTORY)/windows/VC7/mesa/osmesa/osmesa.vcproj
|
||||
|
||||
DRI_FILES = \
|
||||
$(DIRECTORY)/include/GL/internal/dri_interface.h \
|
||||
@@ -373,9 +364,6 @@ DEMO_FILES = \
|
||||
$(DIRECTORY)/progs/samples/Makefile* \
|
||||
$(DIRECTORY)/progs/samples/README \
|
||||
$(DIRECTORY)/progs/samples/*.c \
|
||||
$(DIRECTORY)/progs/glsl/Makefile* \
|
||||
$(DIRECTORY)/progs/glsl/*.c \
|
||||
$(DIRECTORY)/progs/glsl/*.txt \
|
||||
$(DIRECTORY)/progs/windml/Makefile.ugl \
|
||||
$(DIRECTORY)/progs/windml/*.c \
|
||||
$(DIRECTORY)/progs/windml/*.bmp \
|
||||
|
453
Makefile.orig
Normal file
453
Makefile.orig
Normal file
@@ -0,0 +1,453 @@
|
||||
# Top-level Mesa makefile
|
||||
|
||||
TOP = .
|
||||
|
||||
SUBDIRS = src progs
|
||||
|
||||
|
||||
default: $(TOP)/configs/current
|
||||
@for dir in $(SUBDIRS) ; do \
|
||||
(cd $$dir ; $(MAKE)) || exit 1 ; \
|
||||
done
|
||||
|
||||
|
||||
doxygen:
|
||||
(cd doxygen ; make) ; \
|
||||
|
||||
clean:
|
||||
@for dir in $(SUBDIRS) ; do \
|
||||
(cd $$dir ; $(MAKE) clean) ; \
|
||||
done
|
||||
|
||||
|
||||
realclean:
|
||||
touch $(TOP)/configs/current
|
||||
$(MAKE) clean
|
||||
-rm -rf lib*
|
||||
-rm -f $(TOP)/configs/current
|
||||
-rm -f `find . -name \*.o`
|
||||
-rm -f `find . -name \*.a`
|
||||
-rm -f `find . -name \*.so`
|
||||
-rm -f `find . -name depend`
|
||||
|
||||
|
||||
|
||||
install:
|
||||
@echo "Installing"
|
||||
$(TOP)/bin/installmesa $(DESTDIR)
|
||||
|
||||
# DirectFBGL module installation
|
||||
linux-directfb-install:
|
||||
cd src/mesa/drivers/directfb && $(MAKE) install
|
||||
|
||||
# If there's no current configuration file
|
||||
$(TOP)/configs/current:
|
||||
@echo
|
||||
@echo
|
||||
@echo "Please choose a configuration from the following list:"
|
||||
@ls -1 $(TOP)/configs | grep -v "current\|default\|CVS"
|
||||
@echo
|
||||
@echo "Then type 'make <config>' (ex: 'make linux-x86')"
|
||||
@echo "(ignore the following error message)"
|
||||
@exit 1
|
||||
|
||||
|
||||
# Rules to set/install a specific build configuration
|
||||
aix \
|
||||
aix-64 \
|
||||
aix-gcc \
|
||||
aix-static \
|
||||
beos \
|
||||
darwin \
|
||||
darwin-static \
|
||||
freebsd \
|
||||
freebsd-dri \
|
||||
freebsd-dri-amd64 \
|
||||
freebsd-dri-x86 \
|
||||
hpux10 \
|
||||
hpux10-gcc \
|
||||
hpux10-static \
|
||||
hpux11-32 \
|
||||
hpux11-32-static \
|
||||
hpux11-32-static-nothreads \
|
||||
hpux11-64 \
|
||||
hpux11-64-static \
|
||||
hpux9 \
|
||||
hpux9-gcc \
|
||||
irix6-64 \
|
||||
irix6-64-static \
|
||||
irix6-n32 \
|
||||
irix6-n32-static \
|
||||
irix6-o32 \
|
||||
irix6-o32-static \
|
||||
linux \
|
||||
linux-alpha \
|
||||
linux-alpha-static \
|
||||
linux-debug \
|
||||
linux-directfb \
|
||||
linux-dri \
|
||||
linux-dri-x86 \
|
||||
linux-dri-x86-64 \
|
||||
linux-dri-ppc \
|
||||
linux-dri-xcb \
|
||||
linux-indirect \
|
||||
linux-fbdev \
|
||||
linux-glide \
|
||||
linux-icc \
|
||||
linux-icc-static \
|
||||
linux-osmesa16 \
|
||||
linux-osmesa16-static \
|
||||
linux-osmesa32 \
|
||||
linux-ppc \
|
||||
linux-ppc-static \
|
||||
linux-solo \
|
||||
linux-solo-x86 \
|
||||
linux-solo-ia64 \
|
||||
linux-sparc \
|
||||
linux-sparc5 \
|
||||
linux-static \
|
||||
linux-ultrasparc \
|
||||
linux-tcc \
|
||||
linux-x86 \
|
||||
linux-x86-debug \
|
||||
linux-x86-32 \
|
||||
linux-x86-64 \
|
||||
linux-x86-64-debug \
|
||||
linux-x86-64-static \
|
||||
linux-x86-glide \
|
||||
linux-x86-static \
|
||||
netbsd \
|
||||
openbsd \
|
||||
osf1 \
|
||||
solaris-x86 \
|
||||
solaris-x86-gcc \
|
||||
sunos4 \
|
||||
sunos4-gcc \
|
||||
sunos4-static \
|
||||
sunos5 \
|
||||
sunos5-gcc \
|
||||
sunos5-64-gcc \
|
||||
sunos5-smp \
|
||||
ultrix-gcc:
|
||||
(cd configs && rm -f current && ln -s $@ current)
|
||||
$(MAKE) default
|
||||
|
||||
|
||||
# Rules for making release tarballs
|
||||
|
||||
DIRECTORY = Mesa-6.5.1
|
||||
LIB_NAME = MesaLib-6.5.1
|
||||
DEMO_NAME = MesaDemos-6.5.1
|
||||
GLUT_NAME = MesaGLUT-6.5.1
|
||||
|
||||
MAIN_FILES = \
|
||||
$(DIRECTORY)/Makefile* \
|
||||
$(DIRECTORY)/descrip.mms \
|
||||
$(DIRECTORY)/mms-config. \
|
||||
$(DIRECTORY)/bin/mklib \
|
||||
$(DIRECTORY)/bin/installmesa \
|
||||
$(DIRECTORY)/configs/[a-z]* \
|
||||
$(DIRECTORY)/docs/*.html \
|
||||
$(DIRECTORY)/docs/COPYING \
|
||||
$(DIRECTORY)/docs/README.* \
|
||||
$(DIRECTORY)/docs/RELNOTES* \
|
||||
$(DIRECTORY)/docs/VERSIONS \
|
||||
$(DIRECTORY)/docs/*.spec \
|
||||
$(DIRECTORY)/include/GL/internal/glcore.h \
|
||||
$(DIRECTORY)/include/GL/amesa.h \
|
||||
$(DIRECTORY)/include/GL/dmesa.h \
|
||||
$(DIRECTORY)/include/GL/directfbgl.h \
|
||||
$(DIRECTORY)/include/GL/fxmesa.h \
|
||||
$(DIRECTORY)/include/GL/ggimesa.h \
|
||||
$(DIRECTORY)/include/GL/gl.h \
|
||||
$(DIRECTORY)/include/GL/glext.h \
|
||||
$(DIRECTORY)/include/GL/gl_mangle.h \
|
||||
$(DIRECTORY)/include/GL/glu.h \
|
||||
$(DIRECTORY)/include/GL/glu_mangle.h \
|
||||
$(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 \
|
||||
$(DIRECTORY)/include/GL/svgamesa.h \
|
||||
$(DIRECTORY)/include/GL/ugl*.h \
|
||||
$(DIRECTORY)/include/GL/vms_x_fix.h \
|
||||
$(DIRECTORY)/include/GL/wmesa.h \
|
||||
$(DIRECTORY)/include/GL/xmesa.h \
|
||||
$(DIRECTORY)/include/GL/xmesa_x.h \
|
||||
$(DIRECTORY)/include/GL/xmesa_xf86.h \
|
||||
$(DIRECTORY)/include/GLView.h \
|
||||
$(DIRECTORY)/src/Makefile \
|
||||
$(DIRECTORY)/src/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/Makefile* \
|
||||
$(DIRECTORY)/src/mesa/sources \
|
||||
$(DIRECTORY)/src/mesa/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/depend \
|
||||
$(DIRECTORY)/src/mesa/main/*.[chS] \
|
||||
$(DIRECTORY)/src/mesa/main/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/glapi/*.[chS] \
|
||||
$(DIRECTORY)/src/mesa/glapi/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/array_cache/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/array_cache/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/math/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/math/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/shader/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/shader/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/shader/grammar/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/shader/grammar/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/shader/slang/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/shader/slang/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/shader/slang/library/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/swrast/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/swrast/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/swrast_setup/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/swrast_setup/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/tnl/*.[chS] \
|
||||
$(DIRECTORY)/src/mesa/tnl/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/tnl_dd/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/tnl_dd/imm/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/tnl_dd/imm/NOTES.imm \
|
||||
$(DIRECTORY)/src/mesa/drivers/beos/*.cpp \
|
||||
$(DIRECTORY)/src/mesa/drivers/beos/Makefile \
|
||||
$(DIRECTORY)/src/mesa/drivers/common/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/drivers/common/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/drivers/directfb/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/drivers/directfb/Makefile \
|
||||
$(DIRECTORY)/src/mesa/drivers/dos/*.[chS] \
|
||||
$(DIRECTORY)/src/mesa/drivers/fbdev/glfbdev.c \
|
||||
$(DIRECTORY)/src/mesa/drivers/glide/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/drivers/ggi/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/drivers/ggi/ggimesa.conf.in \
|
||||
$(DIRECTORY)/src/mesa/drivers/ggi/default/*.c \
|
||||
$(DIRECTORY)/src/mesa/drivers/ggi/default/genkgi.conf.in \
|
||||
$(DIRECTORY)/src/mesa/drivers/ggi/display/*.c \
|
||||
$(DIRECTORY)/src/mesa/drivers/ggi/display/fbdev.conf.in \
|
||||
$(DIRECTORY)/src/mesa/drivers/ggi/include/ggi/mesa/*.h \
|
||||
$(DIRECTORY)/src/mesa/drivers/osmesa/Makefile.win \
|
||||
$(DIRECTORY)/src/mesa/drivers/osmesa/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/drivers/osmesa/osmesa.def \
|
||||
$(DIRECTORY)/src/mesa/drivers/osmesa/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/drivers/svga/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/drivers/windows/*/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/drivers/windows/*/*.def \
|
||||
$(DIRECTORY)/src/mesa/drivers/x11/descrip.mms \
|
||||
$(DIRECTORY)/src/mesa/drivers/x11/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/ppc/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/sparc/*.[chS] \
|
||||
$(DIRECTORY)/src/mesa/x86/Makefile \
|
||||
$(DIRECTORY)/src/mesa/x86/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/x86/*.S \
|
||||
$(DIRECTORY)/src/mesa/x86/rtasm/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/x86-64/*.[chS] \
|
||||
$(DIRECTORY)/src/mesa/x86-64/Makefile \
|
||||
$(DIRECTORY)/progs/Makefile \
|
||||
$(DIRECTORY)/progs/util/README \
|
||||
$(DIRECTORY)/progs/util/*.[ch] \
|
||||
$(DIRECTORY)/progs/util/sampleMakefile \
|
||||
$(DIRECTORY)/vms/analyze_map.com \
|
||||
$(DIRECTORY)/vms/xlib.opt \
|
||||
$(DIRECTORY)/vms/xlib_share.opt \
|
||||
$(DIRECTORY)/windows/VC6/mesa/gdi/gdi.dsp \
|
||||
$(DIRECTORY)/windows/VC6/mesa/glu/*.txt \
|
||||
$(DIRECTORY)/windows/VC6/mesa/glu/glu.dsp \
|
||||
$(DIRECTORY)/windows/VC6/mesa/mesa.dsw \
|
||||
$(DIRECTORY)/windows/VC6/mesa/mesa/mesa.dsp \
|
||||
$(DIRECTORY)/windows/VC6/mesa/osmesa/osmesa.dsp \
|
||||
$(DIRECTORY)/windows/VC7/mesa/gdi/gdi.vcproj \
|
||||
$(DIRECTORY)/windows/VC7/mesa/glu/glu.vcproj \
|
||||
$(DIRECTORY)/windows/VC7/mesa/mesa.sln \
|
||||
$(DIRECTORY)/windows/VC7/mesa/mesa/mesa.vcproj \
|
||||
$(DIRECTORY)/windows/VC7/mesa/osmesa/osmesa.vcproj
|
||||
|
||||
DRI_FILES = \
|
||||
$(DIRECTORY)/include/GL/internal/dri_interface.h \
|
||||
$(DIRECTORY)/include/GL/internal/sarea.h \
|
||||
$(DIRECTORY)/src/glx/Makefile \
|
||||
$(DIRECTORY)/src/glx/x11/Makefile \
|
||||
$(DIRECTORY)/src/glx/x11/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/Makefile \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/Makefile.template \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/common/xmlpool/*.[ch] \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/common/xmlpool/*.po \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/*/*.[chS] \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/*/Makefile \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/*/Doxyfile \
|
||||
$(DIRECTORY)/src/mesa/drivers/dri/*/server/*.[ch]
|
||||
|
||||
SGI_GLU_FILES = \
|
||||
$(DIRECTORY)/src/glu/Makefile \
|
||||
$(DIRECTORY)/src/glu/descrip.mms \
|
||||
$(DIRECTORY)/src/glu/sgi/Makefile \
|
||||
$(DIRECTORY)/src/glu/sgi/Makefile.win \
|
||||
$(DIRECTORY)/src/glu/sgi/Makefile.DJ \
|
||||
$(DIRECTORY)/src/glu/sgi/glu.def \
|
||||
$(DIRECTORY)/src/glu/sgi/dummy.cc \
|
||||
$(DIRECTORY)/src/glu/sgi/descrip.mms \
|
||||
$(DIRECTORY)/src/glu/sgi/mesaglu.opt \
|
||||
$(DIRECTORY)/src/glu/sgi/include/gluos.h \
|
||||
$(DIRECTORY)/src/glu/sgi/libnurbs/interface/*.h \
|
||||
$(DIRECTORY)/src/glu/sgi/libnurbs/interface/*.cc \
|
||||
$(DIRECTORY)/src/glu/sgi/libnurbs/internals/*.h \
|
||||
$(DIRECTORY)/src/glu/sgi/libnurbs/internals/*.cc \
|
||||
$(DIRECTORY)/src/glu/sgi/libnurbs/nurbtess/*.h \
|
||||
$(DIRECTORY)/src/glu/sgi/libnurbs/nurbtess/*.cc \
|
||||
$(DIRECTORY)/src/glu/sgi/libtess/README \
|
||||
$(DIRECTORY)/src/glu/sgi/libtess/alg-outline \
|
||||
$(DIRECTORY)/src/glu/sgi/libtess/*.[ch] \
|
||||
$(DIRECTORY)/src/glu/sgi/libutil/*.[ch]
|
||||
|
||||
MESA_GLU_FILES = \
|
||||
$(DIRECTORY)/src/glu/mesa/README[12] \
|
||||
$(DIRECTORY)/src/glu/mesa/Makefile* \
|
||||
$(DIRECTORY)/src/glu/mesa/descrip.mms \
|
||||
$(DIRECTORY)/src/glu/mesa/mms_depend \
|
||||
$(DIRECTORY)/src/glu/mesa/*.def \
|
||||
$(DIRECTORY)/src/glu/mesa/depend \
|
||||
$(DIRECTORY)/src/glu/mesa/*.[ch]
|
||||
|
||||
GLW_FILES = \
|
||||
$(DIRECTORY)/src/glw/*.[ch] \
|
||||
$(DIRECTORY)/src/glw/Makefile* \
|
||||
$(DIRECTORY)/src/glw/README \
|
||||
$(DIRECTORY)/src/glw/depend
|
||||
|
||||
DEMO_FILES = \
|
||||
$(DIRECTORY)/progs/beos/*.cpp \
|
||||
$(DIRECTORY)/progs/beos/Makefile \
|
||||
$(DIRECTORY)/progs/images/*.rgb \
|
||||
$(DIRECTORY)/progs/images/*.rgba \
|
||||
$(DIRECTORY)/progs/demos/Makefile* \
|
||||
$(DIRECTORY)/progs/demos/descrip.mms \
|
||||
$(DIRECTORY)/progs/demos/*.[ch] \
|
||||
$(DIRECTORY)/progs/demos/*.cxx \
|
||||
$(DIRECTORY)/progs/demos/*.dat \
|
||||
$(DIRECTORY)/progs/demos/README \
|
||||
$(DIRECTORY)/progs/osdemos/Makefile \
|
||||
$(DIRECTORY)/progs/osdemos/*.c \
|
||||
$(DIRECTORY)/progs/xdemos/Makefile* \
|
||||
$(DIRECTORY)/progs/xdemos/descrip.mms \
|
||||
$(DIRECTORY)/progs/xdemos/*.[chf] \
|
||||
$(DIRECTORY)/progs/redbook/Makefile* \
|
||||
$(DIRECTORY)/progs/redbook/README \
|
||||
$(DIRECTORY)/progs/redbook/*.[ch] \
|
||||
$(DIRECTORY)/progs/samples/Makefile* \
|
||||
$(DIRECTORY)/progs/samples/README \
|
||||
$(DIRECTORY)/progs/samples/*.c \
|
||||
$(DIRECTORY)/progs/windml/Makefile.ugl \
|
||||
$(DIRECTORY)/progs/windml/*.c \
|
||||
$(DIRECTORY)/progs/windml/*.bmp \
|
||||
$(DIRECTORY)/progs/ggi/*.c \
|
||||
$(DIRECTORY)/windows/VC6/progs/demos/*.dsp \
|
||||
$(DIRECTORY)/windows/VC6/progs/progs.dsw \
|
||||
$(DIRECTORY)/windows/VC7/progs/demos/*.vcproj \
|
||||
$(DIRECTORY)/windows/VC7/progs/progs.sln
|
||||
|
||||
GLUT_FILES = \
|
||||
$(DIRECTORY)/include/GL/glut.h \
|
||||
$(DIRECTORY)/include/GL/glutf90.h \
|
||||
$(DIRECTORY)/src/glut/glx/Makefile* \
|
||||
$(DIRECTORY)/src/glut/glx/depend \
|
||||
$(DIRECTORY)/src/glut/glx/*def \
|
||||
$(DIRECTORY)/src/glut/glx/descrip.mms \
|
||||
$(DIRECTORY)/src/glut/glx/mms_depend \
|
||||
$(DIRECTORY)/src/glut/glx/*.[ch] \
|
||||
$(DIRECTORY)/src/glut/beos/*.[ch] \
|
||||
$(DIRECTORY)/src/glut/beos/*.cpp \
|
||||
$(DIRECTORY)/src/glut/beos/Makefile \
|
||||
$(DIRECTORY)/src/glut/dos/*.[ch] \
|
||||
$(DIRECTORY)/src/glut/dos/Makefile.DJ \
|
||||
$(DIRECTORY)/src/glut/dos/PC_HW/*.[chS] \
|
||||
$(DIRECTORY)/src/glut/ggi/*.[ch] \
|
||||
$(DIRECTORY)/src/glut/ggi/Makefile \
|
||||
$(DIRECTORY)/windows/VC6/progs/glut/glut.dsp \
|
||||
$(DIRECTORY)/windows/VC7/progs/glut/glut.vcproj
|
||||
|
||||
DEPEND_FILES = \
|
||||
$(TOP)/src/mesa/depend \
|
||||
$(TOP)/src/glw/depend \
|
||||
$(TOP)/src/glut/glx/depend \
|
||||
$(TOP)/src/glu/sgi/depend
|
||||
|
||||
|
||||
LIB_FILES = $(MAIN_FILES) $(DRI_FILES) $(SGI_GLU_FILES) $(GLW_FILES)
|
||||
|
||||
|
||||
# Everything for new a Mesa release:
|
||||
tarballs: rm_depend lib_gz demo_gz glut_gz lib_bz2 demo_bz2 glut_bz2 lib_zip demo_zip glut_zip md5
|
||||
|
||||
|
||||
rm_depend:
|
||||
@for dep in $(DEPEND_FILES) ; do \
|
||||
rm -f $$dep ; \
|
||||
touch $$dep ; \
|
||||
done
|
||||
|
||||
lib_gz:
|
||||
rm -f configs/current ; \
|
||||
cd .. ; \
|
||||
tar -cf $(LIB_NAME).tar $(LIB_FILES) ; \
|
||||
gzip $(LIB_NAME).tar ; \
|
||||
mv $(LIB_NAME).tar.gz $(DIRECTORY)
|
||||
|
||||
demo_gz:
|
||||
cd .. ; \
|
||||
tar -cf $(DEMO_NAME).tar $(DEMO_FILES) ; \
|
||||
gzip $(DEMO_NAME).tar ; \
|
||||
mv $(DEMO_NAME).tar.gz $(DIRECTORY)
|
||||
|
||||
glut_gz:
|
||||
cd .. ; \
|
||||
tar -cf $(GLUT_NAME).tar $(GLUT_FILES) ; \
|
||||
gzip $(GLUT_NAME).tar ; \
|
||||
mv $(GLUT_NAME).tar.gz $(DIRECTORY)
|
||||
|
||||
lib_bz2:
|
||||
rm -f configs/current ; \
|
||||
cd .. ; \
|
||||
tar -cf $(LIB_NAME).tar $(LIB_FILES) ; \
|
||||
bzip2 $(LIB_NAME).tar ; \
|
||||
mv $(LIB_NAME).tar.bz2 $(DIRECTORY)
|
||||
|
||||
demo_bz2:
|
||||
cd .. ; \
|
||||
tar -cf $(DEMO_NAME).tar $(DEMO_FILES) ; \
|
||||
bzip2 $(DEMO_NAME).tar ; \
|
||||
mv $(DEMO_NAME).tar.bz2 $(DIRECTORY)
|
||||
|
||||
glut_bz2:
|
||||
cd .. ; \
|
||||
tar -cf $(GLUT_NAME).tar $(GLUT_FILES) ; \
|
||||
bzip2 $(GLUT_NAME).tar ; \
|
||||
mv $(GLUT_NAME).tar.bz2 $(DIRECTORY)
|
||||
|
||||
lib_zip:
|
||||
rm -f configs/current ; \
|
||||
rm -f $(LIB_NAME).zip ; \
|
||||
cd .. ; \
|
||||
zip -qr $(LIB_NAME).zip $(LIB_FILES) ; \
|
||||
mv $(LIB_NAME).zip $(DIRECTORY)
|
||||
|
||||
demo_zip:
|
||||
rm -f $(DEMO_NAME).zip ; \
|
||||
cd .. ; \
|
||||
zip -qr $(DEMO_NAME).zip $(DEMO_FILES) ; \
|
||||
mv $(DEMO_NAME).zip $(DIRECTORY)
|
||||
|
||||
glut_zip:
|
||||
rm -f $(GLUT_NAME).zip ; \
|
||||
cd .. ; \
|
||||
zip -qr $(GLUT_NAME).zip $(GLUT_FILES) ; \
|
||||
mv $(GLUT_NAME).zip $(DIRECTORY)
|
||||
|
||||
md5:
|
||||
@-md5sum $(LIB_NAME).tar.gz
|
||||
@-md5sum $(LIB_NAME).tar.bz2
|
||||
@-md5sum $(LIB_NAME).zip
|
||||
@-md5sum $(DEMO_NAME).tar.gz
|
||||
@-md5sum $(DEMO_NAME).tar.bz2
|
||||
@-md5sum $(DEMO_NAME).zip
|
||||
@-md5sum $(GLUT_NAME).tar.gz
|
||||
@-md5sum $(GLUT_NAME).tar.bz2
|
||||
@-md5sum $(GLUT_NAME).zip
|
@@ -65,7 +65,6 @@ if [ $# -ge 2 ] ; then
|
||||
|
||||
elif [ -f "$FILE" ] ; then
|
||||
#echo "$FILE" is a regular file
|
||||
$RM "$DEST/`basename $FILE`"
|
||||
cp "$FILE" "$DEST"
|
||||
if [ $MODE ] ; then
|
||||
FILE=`basename "$FILE"`
|
||||
|
11
bin/mklib
11
bin/mklib
@@ -212,16 +212,15 @@ case $ARCH in
|
||||
# finish up
|
||||
FINAL_LIBS="${LIBNAME}"
|
||||
elif [ $STATIC = 1 ] ; then
|
||||
LIBNAME="lib${LIBNAME}.a" # prefix with "lib", suffix with ".a"
|
||||
echo "mklib: Making" $ARCH "static library: " ${LIBNAME}
|
||||
LIBNAME="lib${LIBNAME}" # prefix with "lib"
|
||||
echo "mklib: Making" $ARCH "static library: " ${LIBNAME}.a
|
||||
LINK="ar"
|
||||
OPTS="-ru"
|
||||
rm -f ${LIBNAME}
|
||||
# make lib
|
||||
${LINK} ${OPTS} ${LIBNAME} ${OBJECTS}
|
||||
ranlib ${LIBNAME}
|
||||
${LINK} ${OPTS} ${LIBNAME}.a ${OBJECTS}
|
||||
ranlib ${LIBNAME}.a
|
||||
# finish up
|
||||
FINAL_LIBS=${LIBNAME}
|
||||
FINAL_LIBS=${LIBNAME}.a
|
||||
else
|
||||
LIBNAME="lib${LIBNAME}" # prefix with "lib"
|
||||
case $ARCH in 'Linux' | 'GNU' | GNU/*)
|
||||
|
7
configs/debian-indirect-default
Normal file
7
configs/debian-indirect-default
Normal file
@@ -0,0 +1,7 @@
|
||||
# Configuration defaults for building GLX-enabled libGL.
|
||||
|
||||
include $(TOP)/configs/debian-dri-default
|
||||
|
||||
CONFIG_NAME = debian-indirect-default
|
||||
|
||||
DRI_DIRS =
|
9
configs/debian-indirect-hurd-i386
Normal file
9
configs/debian-indirect-hurd-i386
Normal file
@@ -0,0 +1,9 @@
|
||||
# Configuration for building the DRI drivers on the build architecture.
|
||||
|
||||
include $(TOP)/configs/linux-indirect
|
||||
include $(TOP)/configs/debian-indirect-default
|
||||
|
||||
CONFIG_NAME = debian-indirect-hurd-i386
|
||||
|
||||
# vim: ft=make
|
||||
|
@@ -10,7 +10,7 @@ CONFIG_NAME = default
|
||||
# Version info
|
||||
MESA_MAJOR=6
|
||||
MESA_MINOR=5
|
||||
MESA_TINY=3
|
||||
MESA_TINY=2
|
||||
|
||||
# external projects. This should be useless now that we use libdrm.
|
||||
DRM_SOURCE_PATH=$(TOP)/../drm
|
||||
@@ -63,7 +63,7 @@ SRC_DIRS = mesa glu glut/glx glw
|
||||
GLU_DIRS = sgi
|
||||
DRIVER_DIRS = x11 osmesa
|
||||
# Which subdirs under $(TOP)/progs/ to enter:
|
||||
PROGRAM_DIRS = demos redbook samples glsl xdemos
|
||||
PROGRAM_DIRS = demos redbook samples xdemos
|
||||
|
||||
|
||||
# Library/program dependencies
|
||||
|
37
configs/diffs
Normal file
37
configs/diffs
Normal file
@@ -0,0 +1,37 @@
|
||||
? default-bp
|
||||
? diffs
|
||||
? linux-dri-bp
|
||||
? linux-tcc
|
||||
Index: linux-icc-static
|
||||
===================================================================
|
||||
RCS file: /cvs/mesa/Mesa/configs/linux-icc-static,v
|
||||
retrieving revision 1.4
|
||||
diff -r1.4 linux-icc-static
|
||||
9c9
|
||||
< CXX = g++
|
||||
---
|
||||
> CXX = icpc
|
||||
11c11
|
||||
< CXXFLAGS = -O3
|
||||
---
|
||||
> CXXFLAGS = -O3 -tpp6 -axK -DPTHREADS
|
||||
22,25c22,24
|
||||
< GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread
|
||||
< GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
|
||||
< APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
|
||||
< MKLIB_OPTIONS = -arch icc
|
||||
---
|
||||
> GL_LIB_DEPS =
|
||||
> GLUT_LIB_DEPS =
|
||||
> APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm -lpthread -lcxa -lunwind
|
||||
29,30d27
|
||||
<
|
||||
<
|
||||
Index: linux-x86-64-static
|
||||
===================================================================
|
||||
RCS file: /cvs/mesa/Mesa/configs/linux-x86-64-static,v
|
||||
retrieving revision 1.6
|
||||
diff -r1.6 linux-x86-64-static
|
||||
21a22,23
|
||||
> APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) \
|
||||
> $(EXTRA_LIB_PATH) -lX11 -lXmu -lXt -lXi -lpthread -lstdc++ -lm
|
@@ -28,8 +28,7 @@ ASM_SOURCES =
|
||||
LIBDRM_CFLAGS = `pkg-config --cflags libdrm`
|
||||
LIBDRM_LIB = `pkg-config --libs libdrm`
|
||||
DRI_LIB_DEPS = -L/usr/local/lib -lm -lpthread -lexpat $(LIBDRM_LIB)
|
||||
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \
|
||||
-lm -lpthread $(LIBDRM_LIB)
|
||||
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lXxf86vm -lm -lpthread $(LIBDRM_LIB)
|
||||
|
||||
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/X11R6/lib -lGLU -lGL -lX11 -lXmu -lXt -lXi -lm
|
||||
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/X11R6/lib -lGL -lXt -lX11
|
||||
|
@@ -41,8 +41,7 @@ EXTRA_LIB_PATH=-L/usr/X11R6/lib
|
||||
LIBDRM_CFLAGS = `pkg-config --cflags libdrm`
|
||||
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 -lXdamage -lXfixes \
|
||||
-lm -lpthread -ldl \
|
||||
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl \
|
||||
$(LIBDRM_LIB)
|
||||
|
||||
|
||||
@@ -67,4 +66,4 @@ WINDOW_SYSTEM=dri
|
||||
# gamma are missing because they have not been converted to use the new
|
||||
# interface.
|
||||
DRI_DIRS = i810 i915tex i915 i965 mach64 mga r128 r200 r300 radeon s3v \
|
||||
savage sis tdfx trident unichrome ffb nouveau
|
||||
savage sis tdfx trident unichrome ffb
|
||||
|
@@ -1,16 +0,0 @@
|
||||
# -*-makefile-*-
|
||||
# Configuration for linux-dri-debug: Linux DRI hardware drivers for XFree86 & others
|
||||
|
||||
include $(TOP)/configs/linux-dri
|
||||
|
||||
CONFIG_NAME = linux-dri-debug
|
||||
OPT_FLAGS = -O0 -g
|
||||
ARCH_FLAGS = -DDEBUG
|
||||
|
||||
# Helpful to reduce the amount of stuff that gets built sometimes:
|
||||
#DRI_DIRS = i915tex i915
|
||||
#DRI_DIRS = i965
|
||||
#DRI_DIRS = radeon r200 r300
|
||||
#DRI_DIRS = unichrome sis trident
|
||||
#DRI_DIRS = i810 mga r128 tdfx
|
||||
|
@@ -22,8 +22,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 \
|
||||
-DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING \
|
||||
-DHAVE_ALIAS -DUSE_XCB -DHAVE_POSIX_MEMALIGN
|
||||
-DGLX_DIRECT_RENDERING -DHAVE_ALIAS -DUSE_XCB -DHAVE_POSIX_MEMALIGN
|
||||
|
||||
X11_INCLUDES = `pkg-config --cflags-only-I x11` `pkg-config --cflags-only-I xcb` `pkg-config --cflags-only-I x11-xcb` `pkg-config --cflags-only-I xcb-glx`
|
||||
|
||||
@@ -66,4 +65,4 @@ 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 nouveau
|
||||
savage sis tdfx trident unichrome ffb
|
||||
|
38
debian/changelog
vendored
38
debian/changelog
vendored
@@ -1,35 +1,13 @@
|
||||
mesa (6.5.3-1) experimental; urgency=low
|
||||
mesa (6.5.2-6) unstable; urgency=low
|
||||
|
||||
[ David Nusinow ]
|
||||
* New upstream release
|
||||
* libgl1-mesa-swx11 needs to depend on libosmesa6 (>= 6.5.2-1) because
|
||||
it used to contain libOSMesa.so.6. This means that programs linked
|
||||
against this lib got a dependency on -swx11 which was broken since
|
||||
6.5.2-1.
|
||||
* Fix build on hurd-i386 (build libgl1-mesa-glx without dri support and
|
||||
don't build the dri drivers); closes: #420403. Thanks, Samuel Thibault!
|
||||
|
||||
[ Julien Cristau ]
|
||||
* Cherry-pick commit 65faf023679988f93da82b4c7ebdc689f2094459 by Michel
|
||||
Dänzer to fix r300 crash.
|
||||
|
||||
-- Julien Cristau <jcristau@debian.org> Mon, 21 May 2007 11:34:51 +0200
|
||||
|
||||
mesa (6.5.3~rc3-1) experimental; urgency=low
|
||||
|
||||
[ Brice Goglin ]
|
||||
* Split out libGLw libs and headers from libgl1-mesa-swx11 and ship both
|
||||
static and shared libraries, creating libglw1-mesa and libglw1-mesa-dev
|
||||
(closes: #374904).
|
||||
|
||||
[ Julien Cristau ]
|
||||
* New upstream release candidate.
|
||||
+ 06_fix_texture_data_corruption.patch,
|
||||
07_call_radeonSetCliprects_from_radeonMakeCurrent.patch,
|
||||
08_r300_update_window_state_when_bound_but_stamp_changed.patch,
|
||||
09_i915_always_enable_pixel_fog.patch: remove, included upstream.
|
||||
+ 01_fix-makefile.patch, 02_use-ieee-fp-on-s390-and-m68k.patch: refresh.
|
||||
* Add build-dependencies on libxdamage-dev and libxfixes-dev.
|
||||
* Resync debian/scripts/install-source.sh.
|
||||
* Build mesa-swx11-source only in binary-indep.
|
||||
* Update from upstream git (commit
|
||||
dee1b0d5bbe91f83854813cbbcd3090327bcb5c2).
|
||||
|
||||
-- Julien Cristau <jcristau@debian.org> Wed, 25 Apr 2007 10:36:50 +0200
|
||||
-- Julien Cristau <jcristau@debian.org> Thu, 05 Jul 2007 00:56:35 +0200
|
||||
|
||||
mesa (6.5.2-5) unstable; urgency=low
|
||||
|
||||
|
47
debian/control
vendored
47
debian/control
vendored
@@ -4,12 +4,12 @@ Priority: optional
|
||||
Maintainer: Debian X Strike Force <debian-x@lists.debian.org>
|
||||
Uploaders: Thierry Reding <thierry@gilfi.de>, Julien Cristau <jcristau@debian.org>
|
||||
Standards-Version: 3.7.2
|
||||
Build-Depends: debhelper (>= 5), quilt (>= 0.40), pkg-config, libdrm-dev (>= 2.2.0) [!hurd-i386], libx11-dev, xutils-dev, x11proto-gl-dev (>= 1.4.8), libxxf86vm-dev, libexpat1-dev, lesstif2-dev, dpkg-dev (>= 1.13.19), libxfixes-dev, libxdamage-dev
|
||||
Build-Depends: debhelper (>= 5), quilt (>= 0.40), pkg-config, libdrm-dev (>= 2.2.0) [!hurd-i386], libx11-dev, xutils-dev, x11proto-gl-dev (>= 1.4.8), libxxf86vm-dev, libexpat1-dev, lesstif2-dev, dpkg-dev (>= 1.13.19)
|
||||
|
||||
Package: libgl1-mesa-swx11
|
||||
Section: libs
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}
|
||||
Depends: ${shlibs:Depends}, libosmesa6 (>= 6.5.2-1)
|
||||
Conflicts: mesag3-glide, mesag3-glide2, mesag3+ggi, libgl1, nvidia-glx, mesag3, libgl1-mesa-swrast
|
||||
Provides: libgl1, mesag3, libgl1-mesa-swrast
|
||||
Replaces: libgl1, mesag3, libgl1-mesa-swrast
|
||||
@@ -80,7 +80,7 @@ Package: libgl1-mesa-swx11-dev
|
||||
Section: libdevel
|
||||
Architecture: any
|
||||
Depends: libgl1-mesa-swx11 (= ${binary:Version}), libc6-dev, libx11-dev, libxext6, mesa-common-dev (= ${source:Version})
|
||||
Provides: libgl-dev, mesag-dev, libgl1-mesa-swrast-dev
|
||||
Provides: libgl-dev, mesag3-widgets, mesag-widgets-dev, libglw-dev, mesag-dev, libgl1-mesa-swrast-dev
|
||||
Conflicts: mesa-dev, libgl-dev, mesag3 (<< 3.1-1), nvidia-glx-dev, mesag-dev, libgl1-mesa-swrast-dev
|
||||
Replaces: libgl-dev, mesag-dev, libgl1-mesa-swrast-dev
|
||||
Description: A free implementation of the OpenGL API -- development support files
|
||||
@@ -88,6 +88,11 @@ Description: A free implementation of the OpenGL API -- development support file
|
||||
compiling programs with Mesa. For a complete description of Mesa,
|
||||
please look at the libgl1-mesa-swx11 package.
|
||||
.
|
||||
This package also provides a simple widgets library, libGLw, which
|
||||
allows Motif-based applications to embed an OpenGL drawing context.
|
||||
The headers and static libraries for compiling programs that use this
|
||||
library are included.
|
||||
.
|
||||
This library provides a pure software rasteriser; it does not provide
|
||||
a direct rendering-capable library, or one which uses GLX. For that,
|
||||
please see libgl1-mesa-dev.
|
||||
@@ -153,7 +158,7 @@ Description: A free implementation of the OpenGL API -- GLX runtime -- debugging
|
||||
Package: libgl1-mesa-dri
|
||||
Section: libs
|
||||
Priority: optional
|
||||
Architecture: any
|
||||
Architecture: alpha amd64 arm armeb armel hppa i386 ia64 kfreebsd-i386 kfreebsd-amd64 m68k mips mipsel powerpc s390 sparc
|
||||
Depends: ${shlibs:Depends}, libgl1-mesa-glx (= ${binary:Version})
|
||||
Suggests: libglide3
|
||||
Conflicts: xlibmesa-dri (<< 1:7.0.0)
|
||||
@@ -174,7 +179,7 @@ Description: A free implementation of the OpenGL API -- DRI modules
|
||||
Package: libgl1-mesa-dri-dbg
|
||||
Section: libdevel
|
||||
Priority: extra
|
||||
Architecture: any
|
||||
Architecture: alpha amd64 arm armeb armel hppa i386 ia64 kfreebsd-i386 kfreebsd-amd64 m68k mips mipsel powerpc s390 sparc
|
||||
Depends: libgl1-mesa-dri (= ${binary:Version})
|
||||
Description: A free implementation of the OpenGL API -- DRI modules -- debugging symbols
|
||||
This version of Mesa provides GLX and DRI capabilities: it is capable of
|
||||
@@ -298,38 +303,6 @@ Description: The OpenGL utility library -- development support files
|
||||
For a complete description of GLU, please look at the libglu1-mesa
|
||||
package.
|
||||
|
||||
Package: libglw1-mesa
|
||||
Section: libs
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}
|
||||
Provides: libglw1
|
||||
Description: A free implementation of the OpenGL API -- runtime
|
||||
Mesa is a 3-D graphics library with an API which is very similar to
|
||||
that of OpenGL. To the extent that Mesa utilizes the OpenGL command
|
||||
syntax or state machine, it is being used with authorization from
|
||||
Silicon Graphics, Inc. However, the author makes no claim that Mesa
|
||||
is in any way a compatible replacement for OpenGL or associated with
|
||||
Silicon Graphics, Inc.
|
||||
.
|
||||
This package provides a simple widgets library, libGLw, which
|
||||
allows Motif-based applications to embed an OpenGL drawing context.
|
||||
.
|
||||
On Linux, this library is also known as libGLw or libGLw.so.1.
|
||||
|
||||
Package: libglw1-mesa-dev
|
||||
Section: libdevel
|
||||
Architecture: any
|
||||
Depends: libglw1-mesa (= ${binary:Version}), libc6-dev, libx11-dev, libxext6, mesa-common-dev (= ${source:Version})
|
||||
Provides: mesag3-widgets, mesag-widgets-dev, libglw-dev
|
||||
Conflicts: libglw-dev, libgl1-mesa-swx11-dev (<< 6.5.2-4)
|
||||
Replaces: libglw-dev
|
||||
Description: A free implementation of the OpenGL API -- development support files
|
||||
This package provides the development environment required for
|
||||
compiling programs with the Mesa widgets library, libGLw, which
|
||||
allows Motif-based applications to embed an OpenGL drawing context.
|
||||
The headers and static libraries for compiling programs that use this
|
||||
library are included.
|
||||
|
||||
Package: mesa-swx11-source
|
||||
Section: libdevel
|
||||
Architecture: all
|
||||
|
2
debian/libgl1-mesa-swx11-dev.install
vendored
2
debian/libgl1-mesa-swx11-dev.install
vendored
@@ -1,2 +1,4 @@
|
||||
usr/include/GL/GLw*A.h
|
||||
usr/lib/libGL.a
|
||||
usr/lib/libGL.so
|
||||
usr/lib/libGLw.a
|
||||
|
3
debian/libglw1-mesa-dev.install
vendored
3
debian/libglw1-mesa-dev.install
vendored
@@ -1,3 +0,0 @@
|
||||
usr/include/GL/GLw*A.h
|
||||
usr/lib/libGLw.a
|
||||
usr/lib/libGLw.so
|
1
debian/libglw1-mesa.install
vendored
1
debian/libglw1-mesa.install
vendored
@@ -1 +0,0 @@
|
||||
usr/lib/libGLw.so.*
|
8
debian/patches/01_fix-makefile.patch
vendored
8
debian/patches/01_fix-makefile.patch
vendored
@@ -3,11 +3,9 @@ OSMesa in a separate package.
|
||||
|
||||
This patch by Thierry Reding.
|
||||
|
||||
Index: mesa/src/mesa/Makefile
|
||||
===================================================================
|
||||
--- mesa.orig/src/mesa/Makefile 2007-04-25 01:44:31.000000000 +0200
|
||||
+++ mesa/src/mesa/Makefile 2007-04-25 01:44:58.000000000 +0200
|
||||
@@ -105,7 +105,7 @@
|
||||
--- a/src/mesa/Makefile
|
||||
+++ b/src/mesa/Makefile
|
||||
@@ -107,7 +107,7 @@
|
||||
$(OSMESA_DRIVER_OBJECTS)
|
||||
|
||||
|
||||
|
@@ -2,11 +2,9 @@ Patch that fixes Debian bug #349437.
|
||||
|
||||
This patch by David Nusinow.
|
||||
|
||||
Index: mesa/src/mesa/main/imports.h
|
||||
===================================================================
|
||||
--- mesa.orig/src/mesa/main/imports.h 2007-04-25 01:44:31.000000000 +0200
|
||||
+++ mesa/src/mesa/main/imports.h 2007-04-25 01:45:04.000000000 +0200
|
||||
@@ -158,8 +158,9 @@
|
||||
--- a/src/mesa/main/imports.h
|
||||
+++ b/src/mesa/main/imports.h
|
||||
@@ -155,8 +155,9 @@
|
||||
*** USE_IEEE: Determine if we're using IEEE floating point
|
||||
***/
|
||||
#if defined(__i386__) || defined(__386__) || defined(__sparc__) || \
|
||||
|
23
debian/patches/06_fix_texture_data_corruption.patch
vendored
Normal file
23
debian/patches/06_fix_texture_data_corruption.patch
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
From: Michel Dänzer <michel@tungstengraphics.com>
|
||||
Date: Thu, 14 Dec 2006 09:01:43 +0000 (+0100)
|
||||
Subject: _mesa_swizzle_ubyte_image: Only use single swizzle_copy call when strides match.
|
||||
X-Git-Url: http://gitweb.freedesktop.org/?p=mesa/mesa.git;a=commitdiff;h=9c09259b8bef8f120cc6f4bb1a44f0eae37d71b3
|
||||
|
||||
_mesa_swizzle_ubyte_image: Only use single swizzle_copy call when strides match.
|
||||
|
||||
This fixes texture data corruption with glTexSubimage (and probably glTexImage
|
||||
under some circumstances) with the texstore swizzle path.
|
||||
---
|
||||
|
||||
--- a/src/mesa/main/texstore.c
|
||||
+++ b/src/mesa/main/texstore.c
|
||||
@@ -808,7 +808,8 @@ _mesa_swizzle_ubyte_image(GLcontext *ctx
|
||||
|
||||
/* _mesa_printf("map %d %d %d %d\n", map[0], map[1], map[2], map[3]); */
|
||||
|
||||
- if (srcRowStride == srcWidth * srcComponents &&
|
||||
+ if (srcRowStride == dstRowStride &&
|
||||
+ srcRowStride == srcWidth * srcComponents &&
|
||||
dimensions < 3) {
|
||||
/* 1 and 2D images only */
|
||||
GLubyte *dstImage = (GLubyte *) dstAddr
|
56
debian/patches/07_call_radeonSetCliprects_from_radeonMakeCurrent.patch
vendored
Normal file
56
debian/patches/07_call_radeonSetCliprects_from_radeonMakeCurrent.patch
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
From: Michel Dänzer <michel@tungstengraphics.com>
|
||||
Date: Tue, 6 Mar 2007 12:22:35 +0000 (+0100)
|
||||
Subject: r300: Call radeonSetCliprects from radeonMakeCurrent.
|
||||
X-Git-Url: http://gitweb.freedesktop.org/?p=mesa/mesa.git;a=commitdiff;h=6f9b1afc862851532e4820705c412388b497ad58
|
||||
|
||||
r300: Call radeonSetCliprects from radeonMakeCurrent.
|
||||
|
||||
Based on a patch by Panagiotis Papadakos.
|
||||
|
||||
Among other things, this makes sure the framebuffer object associated with the
|
||||
drawable has the correct size when _mesa_make_current is called, so the default
|
||||
viewport is set up correctly.
|
||||
|
||||
Also update radeon->lastStamp in radeonSetCliprects.
|
||||
---
|
||||
|
||||
--- a/src/mesa/drivers/dri/r300/radeon_context.c
|
||||
+++ b/src/mesa/drivers/dri/r300/radeon_context.c
|
||||
@@ -51,6 +51,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DE
|
||||
#include "radeon_macros.h"
|
||||
#include "radeon_reg.h"
|
||||
|
||||
+#include "radeon_state.h"
|
||||
#include "r300_state.h"
|
||||
|
||||
#include "utils.h"
|
||||
@@ -279,6 +280,8 @@ GLboolean radeonMakeCurrent(__DRIcontext
|
||||
|
||||
r300UpdateWindow(radeon->glCtx);
|
||||
r300UpdateViewportOffset(radeon->glCtx);
|
||||
+
|
||||
+ radeonSetCliprects(radeon);
|
||||
}
|
||||
|
||||
_mesa_make_current(radeon->glCtx,
|
||||
--- a/src/mesa/drivers/dri/r300/radeon_lock.c
|
||||
+++ b/src/mesa/drivers/dri/r300/radeon_lock.c
|
||||
@@ -90,7 +90,6 @@ static void r300RegainedLock(radeonConte
|
||||
#else
|
||||
radeonUpdateScissor(radeon->glCtx);
|
||||
#endif
|
||||
- radeon->lastStamp = drawable->lastStamp;
|
||||
}
|
||||
|
||||
if (sarea->ctx_owner != radeon->dri.hwContext) {
|
||||
--- a/src/mesa/drivers/dri/r300/radeon_state.c
|
||||
+++ b/src/mesa/drivers/dri/r300/radeon_state.c
|
||||
@@ -185,6 +185,8 @@ void radeonSetCliprects(radeonContextPtr
|
||||
|
||||
if (radeon->state.scissor.enabled)
|
||||
radeonRecalcScissorRects(radeon);
|
||||
+
|
||||
+ radeon->lastStamp = drawable->lastStamp;
|
||||
}
|
||||
|
||||
|
35
debian/patches/08_r300_update_window_state_when_bound_but_stamp_changed.patch
vendored
Normal file
35
debian/patches/08_r300_update_window_state_when_bound_but_stamp_changed.patch
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
From: Michel Dänzer <michel@tungstengraphics.com>
|
||||
Date: Fri, 9 Mar 2007 08:43:17 +0000 (+0100)
|
||||
Subject: r300: Also update window state when it's already bound but its stamp changed.
|
||||
X-Git-Url: http://gitweb.freedesktop.org/?p=mesa/mesa.git;a=commitdiff;h=4d9901a1cab8e0d55b1b2309cf3ffec235e53149
|
||||
|
||||
r300: Also update window state when it's already bound but its stamp changed.
|
||||
|
||||
And set new cliprects before deriving other state from them. This ensures
|
||||
cliprects aren't accessed after having been freed.
|
||||
|
||||
Thanks to Panagiotis Papadakos for testing various iterations of this.
|
||||
---
|
||||
|
||||
--- a/src/mesa/drivers/dri/r300/radeon_context.c
|
||||
+++ b/src/mesa/drivers/dri/r300/radeon_context.c
|
||||
@@ -273,15 +273,15 @@ GLboolean radeonMakeCurrent(__DRIcontext
|
||||
&radeon->vbl_seq);
|
||||
}
|
||||
|
||||
+ radeon->dri.readable = driReadPriv;
|
||||
+
|
||||
if (radeon->dri.drawable != driDrawPriv ||
|
||||
- radeon->dri.readable != driReadPriv) {
|
||||
+ radeon->lastStamp != driDrawPriv->lastStamp) {
|
||||
radeon->dri.drawable = driDrawPriv;
|
||||
- radeon->dri.readable = driReadPriv;
|
||||
|
||||
+ radeonSetCliprects(radeon);
|
||||
r300UpdateWindow(radeon->glCtx);
|
||||
r300UpdateViewportOffset(radeon->glCtx);
|
||||
-
|
||||
- radeonSetCliprects(radeon);
|
||||
}
|
||||
|
||||
_mesa_make_current(radeon->glCtx,
|
31
debian/patches/09_i915_always_enable_pixel_fog.patch
vendored
Normal file
31
debian/patches/09_i915_always_enable_pixel_fog.patch
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
From: Zou Nan hai <nanhai.zou@intel.com>
|
||||
Date: Fri, 2 Feb 2007 01:35:17 +0000 (+0800)
|
||||
Subject: Fix fd.o #9686, when fall into vertex fog,
|
||||
X-Git-Url: http://gitweb.freedesktop.org/?p=mesa/mesa.git;a=commitdiff;h=2dfb3a217f730d6783fb2ac8b73248dc682f923c
|
||||
|
||||
Fix fd.o #9686, when fall into vertex fog,
|
||||
fog factors are precomputed in t_vb_fog.c compute_fog_blend_factors,
|
||||
which is incompatible with appended fragment fog code.
|
||||
That will make GoogleEarth display abnormally.
|
||||
always use pixel fog.
|
||||
---
|
||||
|
||||
--- a/src/mesa/drivers/dri/i915/i915_state.c
|
||||
+++ b/src/mesa/drivers/dri/i915/i915_state.c
|
||||
@@ -611,10 +611,12 @@ void i915_update_fog( GLcontext *ctx )
|
||||
i915->state.Ctx[I915_CTXREG_LIS5] &= ~S5_FOG_ENABLE;
|
||||
}
|
||||
|
||||
- if (enabled) {
|
||||
- _tnl_allow_vertex_fog( ctx, (i915->vertex_fog == I915_FOG_VERTEX) );
|
||||
- _tnl_allow_pixel_fog( ctx, (i915->vertex_fog != I915_FOG_VERTEX) );
|
||||
- }
|
||||
+ /* always enbale pixel fog
|
||||
+ * vertex fog use precaculted fog coord will conflict with appended
|
||||
+ * fog program
|
||||
+ */
|
||||
+ _tnl_allow_vertex_fog( ctx, 0 );
|
||||
+ _tnl_allow_pixel_fog( ctx, 1 );
|
||||
}
|
||||
|
||||
static void i915Fogfv(GLcontext *ctx, GLenum pname, const GLfloat *param)
|
4
debian/patches/series
vendored
4
debian/patches/series
vendored
@@ -4,3 +4,7 @@
|
||||
03_optional-progs-and-install.patch
|
||||
04_cleanup-osmesa-configs.patch
|
||||
05_static-nonpic.patch
|
||||
06_fix_texture_data_corruption.patch
|
||||
07_call_radeonSetCliprects_from_radeonMakeCurrent.patch
|
||||
08_r300_update_window_state_when_bound_but_stamp_changed.patch
|
||||
09_i915_always_enable_pixel_fog.patch
|
||||
|
12
debian/rules
vendored
12
debian/rules
vendored
@@ -44,8 +44,8 @@ CONFIGS = $(SWX11_GLU_CONFIGS) \
|
||||
|
||||
STAMP = $(STAMP_DIR)/$(DEB_BUILD_GNU_TYPE)
|
||||
BUILD_STAMPS = $(addprefix $(STAMP)-build-, $(CONFIGS))
|
||||
ARCH_INSTALL_STAMPS = $(addprefix $(STAMP)-install-, $(CONFIGS))
|
||||
INDEP_INSTALL_STAMPS = $(STAMP_DIR)/install-source
|
||||
INSTALL_STAMPS = $(addprefix $(STAMP)-install-, $(CONFIGS)) \
|
||||
$(STAMP_DIR)/install-source
|
||||
|
||||
# list the configurations that will built
|
||||
configs:
|
||||
@@ -72,17 +72,17 @@ $(STAMP)-build-%: patch
|
||||
pre-install:
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_clean -k
|
||||
dh_clean -k --exclude ./Makefile.orig --exclude configs/CVS/Root.bak
|
||||
rm -rf $(INSTALL_STAMPS)
|
||||
|
||||
install: pre-install $(ARCH_INSTALL_STAMPS)
|
||||
install: pre-install $(INSTALL_STAMPS)
|
||||
|
||||
$(STAMP)-install-%: $(STAMP)-build-%
|
||||
# Add here commands to install the package into debian/tmp
|
||||
cd $(DEB_BUILD_DIR)/$* && $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
|
||||
touch $@
|
||||
|
||||
$(STAMP_DIR)/install-source: pre-install
|
||||
$(STAMP_DIR)/install-source:
|
||||
# install Mesa source for mesa-swx11-source package
|
||||
chmod a+x debian/scripts/install-source.sh
|
||||
debian/scripts/install-source.sh
|
||||
@@ -95,7 +95,7 @@ clean: unpatch
|
||||
rm -rf $(DEB_BUILD_DIR) $(STAMP_DIR)
|
||||
|
||||
# Build architecture-independent files here.
|
||||
binary-indep: build install $(INDEP_INSTALL_STAMPS)
|
||||
binary-indep: build install
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_installchangelogs -i
|
||||
|
8
debian/scripts/choose-configs
vendored
8
debian/scripts/choose-configs
vendored
@@ -22,10 +22,14 @@ else
|
||||
endif
|
||||
|
||||
# and for the GLX/DRI-enabled libGL
|
||||
ifneq ($(wildcard configs/debian-dri-$(DEB_BUILD_ARCH)),)
|
||||
DRI_CONFIGS := debian-dri-$(DEB_BUILD_ARCH)
|
||||
ifneq ($(wildcard configs/debian-indirect-$(DEB_BUILD_ARCH)),)
|
||||
DRI_CONFIGS := debian-indirect-$(DEB_BUILD_ARCH)
|
||||
else
|
||||
ifneq ($(wildcard configs/debian-dri-$(DEB_BUILD_ARCH)),)
|
||||
DRI_CONFIGS := debian-dri-$(DEB_BUILD_ARCH)
|
||||
else
|
||||
DRI_CONFIGS := debian-dri-any
|
||||
endif
|
||||
endif
|
||||
|
||||
##############################################################################
|
||||
|
2
debian/scripts/install-source.sh
vendored
2
debian/scripts/install-source.sh
vendored
@@ -9,6 +9,7 @@ fi
|
||||
SOURCE_DIRS='
|
||||
include/GL/internal
|
||||
src/glx/x11
|
||||
src/mesa/array_cache
|
||||
src/mesa/drivers/common
|
||||
src/mesa/drivers/dri/common
|
||||
src/mesa/drivers/dri/glcore
|
||||
@@ -23,7 +24,6 @@ SOURCE_DIRS='
|
||||
src/mesa/swrast
|
||||
src/mesa/tnl_dd
|
||||
src/mesa/tnl
|
||||
src/mesa/vbo
|
||||
src/mesa/x86-64
|
||||
src/mesa/x86
|
||||
'
|
||||
|
@@ -1,163 +1,155 @@
|
||||
File: docs/README.WIN32
|
||||
|
||||
Last updated: Apr 25, 2007 - 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.
|
||||
|
||||
The Windows build system uses Microsoft Visual Studio. Project files
|
||||
for a specific version of Visual Studio are in their own directory in
|
||||
the top-level "windows" directory. For example, Visual Studio 8 files
|
||||
are in windows/VC8.
|
||||
|
||||
Support has been dropped for versions of Visual Studio prior to 8. The
|
||||
main reason is because Microsoft now provides a free compiler and
|
||||
developer environment. Visual Studio Express can be found at
|
||||
|
||||
http://msdn.microsoft.com/vstudio/express/visualc/default.aspx
|
||||
|
||||
You'll also need the Platform SDK. Instructions for obtaining and
|
||||
using the SDK with Visual Studio Express can be found at
|
||||
|
||||
http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/
|
||||
|
||||
If you are stuck using VC6 or VC7, you may start with these project
|
||||
files, but you may need to modify them to reflect changes in the
|
||||
Mesa source code tree. If you sucessfully update the project files,
|
||||
please submit them to the author of this document so that they may
|
||||
be included in the next distribution.
|
||||
|
||||
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.
|
||||
|
||||
Makefiles are no longer shipped or supported, but can be generated
|
||||
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.
|
||||
|
||||
The GDI driver operates basically by writing pixel spans into a DIB
|
||||
section and then blitting the DIB to the window. The driver was
|
||||
recently cleaned up and rewitten and so may have bugs or may be
|
||||
missing some functionality. The older versions of the CVS source may
|
||||
be useful in figuring out any problems, or report them to me.
|
||||
|
||||
To build Mesa with the GDI driver, build the mesa, gdi, and glu
|
||||
projects in the Visual Studio workspace found at
|
||||
|
||||
windows/VC8/mesa/mesa.sln
|
||||
|
||||
The osmesa DLL can also be built with the osmesa project.
|
||||
|
||||
The build system creates a lib top-level directory and copies
|
||||
resulting LIB and DLL files to this lib directory. The files are:
|
||||
|
||||
OPENGL32.LIB, GLU32.LIB, OSMESA32.LIB
|
||||
OPENGL32.DLL, GLU32.DLL, OSMESA32.DLL
|
||||
|
||||
If the MesaDemos ZIP file was extracted, the DLL files are also copied
|
||||
to the demos directory. This facilitates running the demos as described
|
||||
below.
|
||||
|
||||
|
||||
GLUT and Demos
|
||||
---- --- -----
|
||||
|
||||
A Visual Studio workspace can be found at
|
||||
|
||||
windows/VC8/progs/progs.sln
|
||||
|
||||
It can be used to build GLUT and a few demos. The GLUT lib and DLL
|
||||
are copied to the top-level lib directory, along with the Mesa libs.
|
||||
|
||||
The demo build system expects to find the LIB files in the top level
|
||||
lib directory, so you must build the Mesa libs first. The demo
|
||||
executables are placed in the demos directory, because some of them
|
||||
rely on data files found there. Also, the Mesa lib DLL's were copied
|
||||
there by the Mesa lib build process. Therefore, you should be able to
|
||||
simply run the demo executables from the demo directory.
|
||||
|
||||
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
|
||||
----- ------ -----
|
||||
|
||||
VC6 (not actively supported)
|
||||
---
|
||||
|
||||
Visual Studio 6 does not recognize files with the .cc extension as C++
|
||||
language files, without a lot of unnatural tweaking. So, the VC6
|
||||
build process uses custom build steps to compile these files in the
|
||||
GLU library.
|
||||
|
||||
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 (not actively supported)
|
||||
---
|
||||
|
||||
The above-mentioned .cc problem does not exist in this version.
|
||||
|
||||
VC8
|
||||
---
|
||||
|
||||
No notes.
|
||||
|
||||
|
||||
General
|
||||
-------
|
||||
|
||||
After building, you can copy the above DLL files to a place in your
|
||||
PATH such as $SystemRoot/SYSTEM32. If you don't like putting things
|
||||
in a system directory, place them in the same directory as the
|
||||
executable(s). Be careful about accidentially overwriting files of
|
||||
the same name in the SYSTEM32 directory.
|
||||
|
||||
The DLL files are built so that the external entry points use the
|
||||
stdcall calling convention.
|
||||
|
||||
Static LIB files are not built. The LIB files that are built with are
|
||||
the linker import files associated with the DLL files.
|
||||
|
||||
The si-glu sources are used to build the GLU libs. This was done
|
||||
mainly to get the better tessellator code.
|
||||
|
||||
To build "mangled" Mesa, add the preprocessor define USE_MGL_NAMESPACE
|
||||
to the project settings. You will also need to edit src/mesa.def to
|
||||
change all the gl* symbols to mgl*. Because this is easy to do with a
|
||||
global replace operation in a text editor, no additional mangled
|
||||
version of mesa.def is maintained or shipped.
|
||||
|
||||
If you have a Windows-related build problem or question, it is
|
||||
probably better to direct it to me (kschultz@users.sourceforge.net),
|
||||
rather than directly to the other Mesa developers. I will help you as
|
||||
much as I can. I also monitor the Mesa mailing lists and will answer
|
||||
questions in this area there as well.
|
||||
|
||||
|
||||
Karl Schultz
|
||||
File: docs/README.WIN32
|
||||
|
||||
Last updated: Mar 31, 2006 - 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.
|
||||
|
||||
The Windows build system uses Microsoft Visual Studio. Project files
|
||||
for a specific version of Visual Studio are in their own directory in
|
||||
the top-level "windows" directory. For example, Visual Studio 6 files
|
||||
are in windows/VC6. If a directory does not exist for your version of
|
||||
Visual Studio, you can try importing the project files from an earlier
|
||||
version of Visual Studio. At this time, project files exist for
|
||||
Version 6 and Version 7. The code has been built with a beta version
|
||||
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.
|
||||
|
||||
Makefiles are no longer shipped or supported, but can be generated
|
||||
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.
|
||||
|
||||
The GDI driver operates basically by writing pixel spans into a DIB
|
||||
section and then blitting the DIB to the window. The driver was
|
||||
recently cleaned up and rewitten and so may have bugs or may be
|
||||
missing some functionality. The older versions of the CVS source may
|
||||
be useful in figuring out any problems, or report them to me.
|
||||
|
||||
To build Mesa with the GDI driver, build the mesa, gdi, and glu
|
||||
projects in the Visual Studio workspace found at
|
||||
|
||||
windows/VC6/mesa/mesa.dsw
|
||||
or
|
||||
windows/VC7/mesa/mesa.sln
|
||||
|
||||
The osmesa DLL can also be built with the osmesa project.
|
||||
|
||||
The build system creates a lib top-level directory and copies
|
||||
resulting LIB and DLL files to this lib directory. The files are:
|
||||
|
||||
OPENGL32.LIB, GLU32.LIB, OSMESA32.LIB
|
||||
OPENGL32.DLL, GLU32.DLL, OSMESA32.DLL
|
||||
|
||||
If the MesaDemos ZIP file was extracted, the DLL files are also copied
|
||||
to the demos directory. This facilitates running the demos as described
|
||||
below.
|
||||
|
||||
|
||||
GLUT and Demos
|
||||
---- --- -----
|
||||
|
||||
A Visual Studio workspace can be found at
|
||||
|
||||
windows/VC6/progs/progs.dsw
|
||||
or
|
||||
windows/VC7/progs/progs.sln
|
||||
|
||||
It can be used to build GLUT and a few demos. The GLUT lib and DLL
|
||||
are copied to the top-level lib directory, along with the Mesa libs.
|
||||
|
||||
The demo build system expects to find the LIB files in the top level
|
||||
lib directory, so you must build the Mesa libs first. The demo
|
||||
executables are placed in the demos directory, because some of them
|
||||
rely on data files found there. Also, the Mesa lib DLL's were copied
|
||||
there by the Mesa lib build process. Therefore, you should be able to
|
||||
simply run the demo executables from the demo directory.
|
||||
|
||||
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
|
||||
----- ------ -----
|
||||
|
||||
VC6
|
||||
---
|
||||
|
||||
Visual Studio 6 does not recognize files with the .cc extension as C++
|
||||
language files, without a lot of unnatural tweaking. So, the VC6
|
||||
build process uses custom build steps to compile these files in the
|
||||
GLU library.
|
||||
|
||||
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
|
||||
---
|
||||
|
||||
The above-mentioned .cc problem does not exist in this version.
|
||||
|
||||
|
||||
General
|
||||
-------
|
||||
|
||||
After building, you can copy the above DLL files to a place in your
|
||||
PATH such as $SystemRoot/SYSTEM32. If you don't like putting things
|
||||
in a system directory, place them in the same directory as the
|
||||
executable(s). Be careful about accidentially overwriting files of
|
||||
the same name in the SYSTEM32 directory.
|
||||
|
||||
The DLL files are built so that the external entry points use the
|
||||
stdcall calling convention.
|
||||
|
||||
Static LIB files are not built. The LIB files that are built with are
|
||||
the linker import files associated with the DLL files.
|
||||
|
||||
The si-glu sources are used to build the GLU libs. This was done
|
||||
mainly to get the better tessellator code.
|
||||
|
||||
To build "mangled" Mesa, add the preprocessor define USE_MGL_NAMESPACE
|
||||
to the project settings. You will also need to edit src/mesa.def to
|
||||
change all the gl* symbols to mgl*. Because this is easy to do with a
|
||||
global replace operation in a text editor, no additional mangled
|
||||
version of mesa.def is maintained or shipped.
|
||||
|
||||
If you have a Windows-related build problem or question, it is
|
||||
probably better to direct it to me (kschultz@users.sourceforge.net),
|
||||
rather than directly to the other Mesa developers. I will help you as
|
||||
much as I can. I also monitor the Mesa mailing lists and will answer
|
||||
questions in this area there as well.
|
||||
|
||||
|
||||
Karl Schultz
|
||||
|
47
docs/RELNOTES-6.4.1
Normal file
47
docs/RELNOTES-6.4.1
Normal file
@@ -0,0 +1,47 @@
|
||||
|
||||
Mesa 6.4.1 Release Notes
|
||||
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
Mesa uses an even/odd version number scheme like the Linux kernel.
|
||||
Odd numbered versions (such as 6.3) designate new developmental releases.
|
||||
Even numbered versions (such as 6.4) designate stable releases.
|
||||
|
||||
|
||||
6.4.1 is a bug-fix release. See the VERSIONS file for details.
|
||||
|
||||
|
||||
|
||||
GLUT tarball
|
||||
------------
|
||||
|
||||
Starting with 6.4, the GLUT library sources are distributed in a separate
|
||||
tarball. This was done at the request of Linux distro vendors who prefer
|
||||
to use freeglut.
|
||||
|
||||
|
||||
|
||||
|
||||
Driver Status
|
||||
---------------------- ----------------------
|
||||
DRI drivers varies with the driver
|
||||
XMesa (Xlib) implements OpenGL 1.5
|
||||
OSMesa (off-screen) implements OpenGL 1.5
|
||||
Windows/Win32 implements OpenGL 1.5
|
||||
Glide (3dfx Voodoo1/2) requires updates
|
||||
SVGA requires updates
|
||||
DJGPP requires updates
|
||||
GGI requires updates
|
||||
BeOS requires updates
|
||||
Allegro requires updates
|
||||
D3D requires updates
|
||||
|
||||
The drivers which require updates mostly need to be updated to work
|
||||
with the new gl_renderbuffer / gl_framebuffer infrastructure introduced
|
||||
in Mesa 6.3.
|
||||
|
||||
|
||||
----------------------------------------------------------------------
|
||||
$Id: RELNOTES-6.4.1,v 3.1 2006/02/03 17:21:54 brianp Exp $
|
47
docs/RELNOTES-6.4.2
Normal file
47
docs/RELNOTES-6.4.2
Normal file
@@ -0,0 +1,47 @@
|
||||
|
||||
Mesa 6.4.2 Release Notes
|
||||
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
Mesa uses an even/odd version number scheme like the Linux kernel.
|
||||
Odd numbered versions (such as 6.3) designate new developmental releases.
|
||||
Even numbered versions (such as 6.4) designate stable releases.
|
||||
|
||||
|
||||
6.4.2 is a minor bug-fix release. See the VERSIONS file for details.
|
||||
|
||||
|
||||
|
||||
GLUT tarball
|
||||
------------
|
||||
|
||||
Starting with 6.4, the GLUT library sources are distributed in a separate
|
||||
tarball. This was done at the request of Linux distro vendors who prefer
|
||||
to use freeglut.
|
||||
|
||||
|
||||
|
||||
|
||||
Driver Status
|
||||
---------------------- ----------------------
|
||||
DRI drivers varies with the driver
|
||||
XMesa (Xlib) implements OpenGL 1.5
|
||||
OSMesa (off-screen) implements OpenGL 1.5
|
||||
Windows/Win32 implements OpenGL 1.5
|
||||
Glide (3dfx Voodoo1/2) requires updates
|
||||
SVGA requires updates
|
||||
DJGPP requires updates
|
||||
GGI requires updates
|
||||
BeOS requires updates
|
||||
Allegro requires updates
|
||||
D3D requires updates
|
||||
|
||||
The drivers which require updates mostly need to be updated to work
|
||||
with the new gl_renderbuffer / gl_framebuffer infrastructure introduced
|
||||
in Mesa 6.3.
|
||||
|
||||
|
||||
----------------------------------------------------------------------
|
||||
$Id: RELNOTES-6.4.2,v 3.1 2006/02/03 17:21:54 brianp Exp $
|
97
docs/RELNOTES-6.5
Normal file
97
docs/RELNOTES-6.5
Normal file
@@ -0,0 +1,97 @@
|
||||
|
||||
Mesa 6.5 Release Notes
|
||||
|
||||
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
Mesa uses an even/odd version number scheme like the Linux kernel.
|
||||
Odd numbered versions (such as 6.5) designate new developmental releases.
|
||||
Even numbered versions (such as 6.4) designate stable releases.
|
||||
|
||||
|
||||
|
||||
New Features
|
||||
------------
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
GL_EXT_framebuffer_blit
|
||||
A simplified glCopyPixels-like feature for copying pixel rectangles.
|
||||
|
||||
GL_ARB_half_float_pixel
|
||||
Adds a new half-precision floating point format for image transfers,
|
||||
such as for glDrawPixels, glReadPixels, glTexImage, etc.
|
||||
|
||||
|
||||
|
||||
Removed Extensions
|
||||
------------------
|
||||
|
||||
The following extensions have been removed:
|
||||
|
||||
GL_HP_occlusion_test - this is superceded by GL_ARB_occlusion_query.
|
||||
|
||||
|
||||
|
||||
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
|
||||
OSMesa (off-screen) implements OpenGL 1.5
|
||||
Glide (3dfx Voodoo1/2) implements OpenGL 1.3
|
||||
SVGA implements OpenGL 1.3
|
||||
Wind River UGL implements OpenGL 1.3
|
||||
Windows/Win32 implements OpenGL 1.5
|
||||
DJGPP implements OpenGL 1.5
|
||||
GGI implements OpenGL 1.3
|
||||
BeOS implements OpenGL 1.5
|
||||
Allegro needs updating
|
||||
D3D needs updating
|
||||
|
||||
|
||||
----------------------------------------------------------------------
|
||||
$Id: RELNOTES-6.5,v 3.4 2006/03/29 04:53:02 brianp Exp $
|
60
docs/RELNOTES-6.5.1
Normal file
60
docs/RELNOTES-6.5.1
Normal file
@@ -0,0 +1,60 @@
|
||||
|
||||
Mesa 6.5.1 Release Notes
|
||||
|
||||
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
Mesa uses an even/odd version number scheme like the Linux kernel.
|
||||
Odd numbered versions (such as 6.5) designate new developmental releases.
|
||||
Even numbered versions (such as 6.4) designate stable releases.
|
||||
|
||||
|
||||
|
||||
Mesa 6.5.1 is a 6.5 follow-on development release mostly consisting of
|
||||
bug fixes (see the VERSIONS file).
|
||||
|
||||
|
||||
New Features
|
||||
------------
|
||||
|
||||
Intel i965 "broadwater" DRI driver
|
||||
|
||||
GL_APPLE_vertex_array_object - allows encapsulation of a set of vertex
|
||||
arrays in an object.
|
||||
|
||||
GL_EXT_texture_sRGB - non-linearly mapped texture formats
|
||||
|
||||
GL_EXT_gpu_program_parameters - addes a few new functions for setting
|
||||
multiple vertex/fragment program parameters with one call.
|
||||
|
||||
|
||||
|
||||
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
|
||||
OSMesa (off-screen) implements OpenGL 1.5
|
||||
Glide (3dfx Voodoo1/2) implements OpenGL 1.3
|
||||
SVGA implements OpenGL 1.3
|
||||
Wind River UGL implements OpenGL 1.3
|
||||
Windows/Win32 implements OpenGL 1.5
|
||||
DJGPP implements OpenGL 1.5
|
||||
GGI implements OpenGL 1.3
|
||||
BeOS implements OpenGL 1.5
|
||||
Allegro needs updating
|
||||
D3D needs updating
|
||||
|
||||
|
||||
----------------------------------------------------------------------
|
||||
$Id: RELNOTES-6.5.1,v 1.2 2006/08/18 20:24:54 brianp Exp $
|
@@ -25,7 +25,6 @@ a:visited {
|
||||
<ul>
|
||||
<li><a href="intro.html" target="MainFrame">Introduction</a>
|
||||
<li><a href="news.html" target="MainFrame">News</a>
|
||||
<LI><A HREF="developers.html" target="MainFrame">Developers</A>
|
||||
<li><a href="systems.html" target="MainFrame">Platforms and Drivers</a>
|
||||
<li><a href="license.html" target="MainFrame">License & Copyright</a>
|
||||
<li><a href="faq.html" target="MainFrame">FAQ</a>
|
||||
@@ -64,9 +63,8 @@ a:visited {
|
||||
<b>Developer Topics</b>
|
||||
<ul>
|
||||
<li><a href="http://sourceforge.net/projects/mesa3d" target="_parent">SourceForge homepage</a>
|
||||
<li><a href="repository.html" target="MainFrame">Source Code Repository</a>
|
||||
<li><a href="memory.html" target="MainFrame">DRI Memory Management</a>
|
||||
<li><a href="shading.html" target="MainFrame">Shading Language</a>
|
||||
<li><a href="cvs_access.html" target="MainFrame">CVS Access</a>
|
||||
<li><a href="cvs_branches.html" target="MainFrame">CVS Branch Info</a>
|
||||
<li><a href="utilities.html" target="MainFrame">Utilities</a>
|
||||
<li><a href="helpwanted.html" target="MainFrame">Help Wanted</a>
|
||||
<li><a href="devinfo.html" target="MainFrame">Development Notes</a>
|
||||
@@ -74,6 +72,7 @@ a:visited {
|
||||
<li><a href="subset.html" target="MainFrame">Subset Information</a>
|
||||
<li><a href="fbdev-dri.html" target="MainFrame">fbdev/DRI Environment</a>
|
||||
<li><a href="glfbdev-driver.html" target="MainFrame">glFBDev Driver</a>
|
||||
<LI><A HREF="custom.html" target="MainFrame">Custom Development</A>
|
||||
<LI><A HREF="dispatch.html" target="MainFrame">GL Dispatch</A>
|
||||
</ul>
|
||||
|
||||
|
27
docs/custom.html
Normal file
27
docs/custom.html
Normal file
@@ -0,0 +1,27 @@
|
||||
<HTML>
|
||||
|
||||
<TITLE>Custom Development</TITLE>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="mesa.css"></head>
|
||||
|
||||
<BODY>
|
||||
|
||||
<H1>Custom Development</H1>
|
||||
|
||||
<p>
|
||||
Mesa is primarily developed and maintained on a volunteer basis.
|
||||
Some Mesa development work has been done in conjuction with contracted
|
||||
projects, such as the XFree86/DRI drivers.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<pre>[Begin shameless plug]</pre>
|
||||
If you have a need for specific or custom Mesa development work,
|
||||
<a href="http://www.tungstengraphics.com/" target="_parent">
|
||||
Tungsten Graphics, Inc.</a> may be able to help you.
|
||||
<pre>[End shameless plug]</pre>
|
||||
</p>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
106
docs/cvs_access.html
Normal file
106
docs/cvs_access.html
Normal file
@@ -0,0 +1,106 @@
|
||||
<HTML>
|
||||
|
||||
<TITLE>CVS Access</TITLE>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="mesa.css"></head>
|
||||
|
||||
<BODY>
|
||||
|
||||
<h1>CVS Access</h1>
|
||||
|
||||
<p>
|
||||
Mesa's CVS repository (code management system) is hosted on
|
||||
<a href="http://www.freedesktop.org" target="_parent">freedesktop.org</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
You may access the repository either as an
|
||||
<a href="#anonymous">anonymous user</a> (read-only) or as a
|
||||
<a href="#developer">developer</a>
|
||||
(read/write).
|
||||
</p>
|
||||
|
||||
<p>
|
||||
You may also
|
||||
<a href="http://freedesktop.org/cgi-bin/viewcvs.cgi/mesa/Mesa/"
|
||||
target="_parent">browse the CVS repository</a>.
|
||||
</p>
|
||||
|
||||
|
||||
<a name="anonymous">
|
||||
<H2>Anonymous CVS Access</H2>
|
||||
|
||||
<p>
|
||||
Anonymous, public, read-only access to the CVS repository is available.
|
||||
Here are the basic instructions for Unix systems:
|
||||
</p>
|
||||
|
||||
<ol>
|
||||
<li>Install CVS client software on your computer if needed.
|
||||
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
|
||||
</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
|
||||
</pre>
|
||||
</ol>
|
||||
|
||||
|
||||
<p>To update your Mesa CVS source to the latest CVS source:</p>
|
||||
|
||||
<ol>
|
||||
<li><code>cd Mesa</code>
|
||||
<li><code>cvs -z3 -d:pserver:anonymous@anoncvs.freedesktop.org:/cvs/mesa update</code>
|
||||
</ol>
|
||||
|
||||
|
||||
<a name="developer">
|
||||
<H2>Developer CVS Access</H2>
|
||||
|
||||
<p>
|
||||
Mesa developers working with the Mesa CVS repository need to first
|
||||
have an account on <a href="http://www.freedesktop.org" target="_parent">
|
||||
freedesktop.org</a>.
|
||||
To get an account, please ask Brian or the other Mesa developers for
|
||||
permission.
|
||||
Then, if there are no objections, follow this
|
||||
<a href="http://www.freedesktop.org/wiki/AccountRequests" target="_parent">
|
||||
procedure</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Once your account is established, you can check out the Mesa CVS tree
|
||||
with:
|
||||
<pre>
|
||||
setenv CVS_RSH ssh (if using a csh-like shell)
|
||||
</pre>
|
||||
<em>OR</em>
|
||||
<pre>
|
||||
export CVS_RSH=rsh (if using a bash-like shell)
|
||||
</pre>
|
||||
followed by:
|
||||
<pre>
|
||||
cvs -d:ext:yourusername@cvs.freedesktop.org:/cvs/mesa co Mesa
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Of course, replace <em>yourusername</em> with your actual login name.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Subsequent updates should only require:
|
||||
</p>
|
||||
<pre>
|
||||
cvs update
|
||||
</pre>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
80
docs/cvs_branches.html
Normal file
80
docs/cvs_branches.html
Normal file
@@ -0,0 +1,80 @@
|
||||
<HTML>
|
||||
|
||||
<TITLE>CVS Branches</TITLE>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="mesa.css"></head>
|
||||
|
||||
<BODY>
|
||||
|
||||
<H1>CVS Branch Information</H1>
|
||||
|
||||
<p>
|
||||
At any given time, there may be several active branches in Mesa's
|
||||
CVS repository.
|
||||
|
||||
Generally, the CVS trunk contains the latest development (unstable)
|
||||
code while a CVS branch has the latest stable code.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Currently (Oct 2004), the trunk is the Mesa 6.3 development code
|
||||
while the mesa_6_2_branch branch has the stable Mesa 6.2.x code.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Mesa releases use an even/odd numbering scheme to represent stable/development
|
||||
releases.
|
||||
|
||||
For example, Mesa 6.2 (0 is considered even) is a stable release while
|
||||
Mesa 6.3 is a development release.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
To checkout a specific CVS branch pass <code>-r</code> and
|
||||
the branch tag after your CVS command.
|
||||
|
||||
For example <code>cvs checkout -r mesa_6_2_branch Mesa</code> will
|
||||
checkout the 6.2 branch and <code>cvs update -r
|
||||
mesa_6_2_branch</code> will convert your current CVS tree to the 6.2
|
||||
branch.
|
||||
|
||||
Consult <a href="http://www.durak.org/cvswebsites/doc/cvs_5.php3#SEC54"
|
||||
target="_parent">http://www.durak.org/cvswebsites/doc/cvs_5.php3#SEC54</a>
|
||||
for more on branching in CVS.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
To see a list of all the CVS branches run <code>cvs log README</code> (or any
|
||||
other file) and look for the section labeled <code>symbolic names</code>.
|
||||
You'll see something like this:
|
||||
</p>
|
||||
|
||||
<pre> symbolic names:
|
||||
mesa_4_0: 1.3
|
||||
mesa_4_0_branch: 1.3.0.6
|
||||
mesa_3_5: 1.3
|
||||
mesa_3_4_2: 1.3
|
||||
mesa_3_4_1: 1.3
|
||||
mesa_3_4: 1.3
|
||||
mesa_3_4_branch: 1.3.0.4
|
||||
mesa_3_3: 1.3
|
||||
mesa_3_2_1: 1.1.1.1
|
||||
mesa_3_3_texture_env_combine2: 1.3.0.2
|
||||
mesa_3_2: 1.1.1.1
|
||||
mesa_3_2_beta_1: 1.1.1.1
|
||||
mesa_3_1: 1.1.1.1
|
||||
mesa_3_2_dev: 1.1.1.1.0.2
|
||||
mesa_3_1_beta_3: 1.1.1.1
|
||||
start: 1.1.1.1
|
||||
mesa: 1.1.1
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Most will be obsolete branches. Generally, the newer branches are at
|
||||
the top. Ask on the mesa3d-dev mailing list to learn which branches
|
||||
are active.
|
||||
</p>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
@@ -1,51 +0,0 @@
|
||||
<HTML>
|
||||
|
||||
<TITLE>Developers</TITLE>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="mesa.css"></head>
|
||||
|
||||
<BODY>
|
||||
|
||||
<H1>Developers</H1>
|
||||
|
||||
<p>
|
||||
Both professional and volunteer developers contribute to Mesa.
|
||||
</p>
|
||||
<p>
|
||||
<a href="http://www.tungstengraphics.com/" target="_parent">Tungsten Graphics</a>
|
||||
employs several of the main Mesa developers including Brian Paul
|
||||
and Keith Whitwell.
|
||||
Much of the on-going work in Mesa is done through Tungsten Graphics engineering
|
||||
contracts.
|
||||
Prominent examples of this work includes:
|
||||
</p>
|
||||
<ul>
|
||||
<li>DRI drivers for Intel i965, i945, i915 and other chips
|
||||
<li>Advanced memory manager and framebuffer object support
|
||||
<li>Shading language compiler and OpenGL 2.0 support
|
||||
<li>MiniGLX environment
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
Other companies including
|
||||
<a href="http://www.intellinuxgraphics.org/index.html" target="_parent">Intel</a>
|
||||
and IBM also actively contribute to the project.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Volunteers have made significant contributions to all parts of Mesa, including
|
||||
complete device drivers.
|
||||
</p>
|
||||
|
||||
|
||||
<H1>Custom Development</H1>
|
||||
<p>
|
||||
Contact <a href="http://www.tungstengraphics.com/" target="_parent">
|
||||
Tungsten Graphics</a>
|
||||
for information about custom development in Mesa, OpenGL, X and other
|
||||
graphics technologies.
|
||||
</p>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
@@ -9,7 +9,7 @@
|
||||
<H1>Downloading</H1>
|
||||
|
||||
<p>
|
||||
Last development release: <b>6.5.3</b>
|
||||
Last development release: <b>6.5.1</b>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
BIN
docs/gears.png
Normal file
BIN
docs/gears.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
@@ -9,31 +9,35 @@
|
||||
<H1>Introduction</H1>
|
||||
|
||||
<p>
|
||||
Mesa is an open-source implementation of the
|
||||
<a href="http://www.opengl.org/" target="_parent">OpenGL</a> specification -
|
||||
a system for rendering interactive 3D graphics.
|
||||
Mesa is a 3-D graphics library with an API which is very similar to
|
||||
that of <a href="http://www.opengl.org/" target="_parent">OpenGL</a>.*
|
||||
To the extent that Mesa utilizes the OpenGL command syntax or state
|
||||
machine, it is being used with authorization from <a
|
||||
href="http://www.sgi.com/" target="_parent">Silicon Graphics,
|
||||
Inc.</a>(SGI). However, the author does not possess an OpenGL license
|
||||
from SGI, and makes no claim that Mesa is in any way a compatible
|
||||
replacement for OpenGL or associated with SGI. Those who want a
|
||||
licensed implementation of OpenGL should contact a licensed
|
||||
vendor.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
A variety of device drivers allows Mesa to be used in many different
|
||||
environments ranging from software emulation to complete hardware acceleration
|
||||
for modern GPUs.
|
||||
Please do not refer to the library as <em>MesaGL</em> (for legal
|
||||
reasons). It's just <em>Mesa</em> or <em>The Mesa 3-D graphics
|
||||
library</em>. <br>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Mesa ties into several other open-source projects: the
|
||||
<a href="http://dri.sf.net/" target="_parent">Direct Rendering Infrastructure</a>
|
||||
and <a href="http://x.org" target="_parent">X.org</a> to provide OpenGL
|
||||
support to users of X on Linux, FreeBSD and other operating systems.
|
||||
* OpenGL is a trademark of <a href="http://www.sgi.com/"
|
||||
target="_parent">Silicon Graphics Incorporated</a>.
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
<H1>Project History</H1>
|
||||
|
||||
<p>
|
||||
The Mesa project was originally started by Brian Paul.
|
||||
Here's a short history of the project.
|
||||
The Mesa project was founded by me, Brian Paul. Here's a short history
|
||||
of the project.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
@@ -6,34 +6,6 @@
|
||||
|
||||
<BODY>
|
||||
|
||||
<H1>Disclaimer</H1>
|
||||
|
||||
<p>
|
||||
Mesa is a 3-D graphics library with an API which is very similar to
|
||||
that of <a href="http://www.opengl.org/" target="_parent">OpenGL</a>.*
|
||||
To the extent that Mesa utilizes the OpenGL command syntax or state
|
||||
machine, it is being used with authorization from <a
|
||||
href="http://www.sgi.com/" target="_parent">Silicon Graphics,
|
||||
Inc.</a>(SGI). However, the author does not possess an OpenGL license
|
||||
from SGI, and makes no claim that Mesa is in any way a compatible
|
||||
replacement for OpenGL or associated with SGI. Those who want a
|
||||
licensed implementation of OpenGL should contact a licensed
|
||||
vendor.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Please do not refer to the library as <em>MesaGL</em> (for legal
|
||||
reasons). It's just <em>Mesa</em> or <em>The Mesa 3-D graphics
|
||||
library</em>. <br>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
* OpenGL is a trademark of <a href="http://www.sgi.com/"
|
||||
target="_parent">Silicon Graphics Incorporated</a>.
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
<H1>License / Copyright Information</H1>
|
||||
|
||||
<p>
|
||||
@@ -52,7 +24,7 @@ The default Mesa license is as follows:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
Copyright (C) 1999-2007 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"),
|
||||
|
@@ -9,58 +9,47 @@
|
||||
<H1>Mailing Lists</H1>
|
||||
|
||||
|
||||
<p>There are four Mesa mailing lists:
|
||||
</p>
|
||||
|
||||
<p>There are four Mesa mailing lists:</p>
|
||||
<ul>
|
||||
<li><a href="https://lists.sourceforge.net/lists/listinfo/mesa3d-announce"
|
||||
target="_parent">mesa3d-announce</a> - announcements of new Mesa
|
||||
versions are sent to this list.
|
||||
</li>
|
||||
<br>
|
||||
<li><a href="https://lists.sourceforge.net/lists/listinfo/mesa3d-users"
|
||||
target="_parent">mesa3d-users</a> - intended for users of the Mesa library.
|
||||
Newbie questions are appropriate, but please try the general OpenGL
|
||||
resources and Mesa documentation first.
|
||||
</li>
|
||||
<br>
|
||||
<li><a href="https://lists.sourceforge.net/lists/listinfo/mesa3d-dev"
|
||||
target="_parent">mesa3d-dev</a> - for discussion of Mesa development.
|
||||
Not for beginners.
|
||||
</li>
|
||||
<br>
|
||||
<li><a href="http://lists.freedesktop.org/mailman/listinfo/mesa-commit"
|
||||
target="_parent">mesa-commit</a> - relays git check-in messages
|
||||
(for developers).
|
||||
<br>
|
||||
Note: the old mesa3d-cvs list is no longer in use.
|
||||
</li>
|
||||
</ul>
|
||||
<li><b>mesa3d-users</b> - intended for users of the Mesa library.
|
||||
Newbie questions are appropriate, but please try reading the Mesa documentation first.
|
||||
</li><li><b>mesa3d-dev</b> - intended for developers of the Mesa library.
|
||||
This is not for beginners.
|
||||
</li><li><b>mesa3d-cvs</b> - CVS check-in messages are sent to this list.
|
||||
This is useful for tracking ongoing development changes.
|
||||
</li><li><b>mesa3d-announce</b> - announcements of new Mesa versions are sent to this list.
|
||||
</li></ul>
|
||||
|
||||
<p>
|
||||
<b>Notice</b>: non-member posts to any of these lists will be automatically
|
||||
rejected.
|
||||
To subscribe or unsubscribe, go to the
|
||||
<a href="http://www.sourceforge.net/mail/?group_id=3" target="_parent">
|
||||
SourceForge lists page.</a>
|
||||
</p>
|
||||
|
||||
<p>The mailing lists are managed by SourceForge. If you're having trouble
|
||||
with the mailing lists please contact the SourceForge administrators for help.</p>
|
||||
|
||||
<br>
|
||||
|
||||
<H1>OpenGL Forums</H1>
|
||||
<p>Archives of the old Mesa mailing list which was hosted by unicamp.br
|
||||
are available <a href="http://groups.yahoo.com/group/mesa/messages/"
|
||||
target="_parent">here</a>.</p>
|
||||
|
||||
<p>
|
||||
Here are some other OpenGL-related forums you might find useful:
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Usenet newsgroups:
|
||||
<ul>
|
||||
<li><a href="http://www.opengl.org/cgi-bin/ubb/ultimatebb.cgi"
|
||||
target="_parent">OpenGL discussion forums</A> at www.opengl.org</li>
|
||||
<li>Usenet newsgroups:
|
||||
<ul>
|
||||
<li>comp.graphics.algorithms</li>
|
||||
<li>comp.graphics.api.opengl</li>
|
||||
<li>comp.os.linux.x</li>
|
||||
</ul>
|
||||
<li>comp.graphics.algorithms
|
||||
<li>comp.graphics.api.opengl
|
||||
<li>comp.os.linux.x
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="http://www.opengl.org/" target="_parent">OpenGL discussion forums</A>
|
||||
at www.opengl.org
|
||||
</p>
|
||||
|
||||
</HTML>
|
||||
</BODY>
|
||||
|
@@ -11,40 +11,6 @@
|
||||
<H1>News</H1>
|
||||
|
||||
|
||||
<h2>April 27, 2007</h2>
|
||||
<p>
|
||||
<a href="relnotes-6.5.3.html">Mesa 6.5.3</a> is released.
|
||||
This is a development release which will lead up to the Mesa 7.0 release
|
||||
(which will advertise OpenGL 2.1 API support).
|
||||
</p>
|
||||
|
||||
|
||||
<h2>March 26, 2007</h2>
|
||||
<p>
|
||||
The new Shading Language compiler branch has been merged into the git
|
||||
master branch. This is a step toward hardware support for the OpenGL
|
||||
2.0 Shading Language and will be included in the next Mesa release.
|
||||
In conjunction, <a href="http://glean.sf.net" target="_parent">Glean
|
||||
</a> has been updated with a new test that does over 130 tests of the
|
||||
shading language and built-in functions.
|
||||
</p>
|
||||
|
||||
<h2>April 2007</h2>
|
||||
<p>
|
||||
Thomas Hellström of
|
||||
<a href="http://www.tungstengraphics.com" target="_parent">
|
||||
Tungsten Graphics</a> has written a whitepaper describing the new
|
||||
<a href="http://www.tungstengraphics.com/mm.pdf">DRI memory management
|
||||
system</a>.
|
||||
</p>
|
||||
|
||||
<h2>December 5, 2006</h2>
|
||||
<p>
|
||||
Mesa is now using git as its source code management system.
|
||||
The previous CVS repository should no longer be used.
|
||||
See the <a href="repository.html">repository page</a> for more information.
|
||||
</p>
|
||||
|
||||
<h2>December 2, 2006</h2>
|
||||
<p>
|
||||
<a href="relnotes-6.5.2.html">Mesa 6.5.2</a> has been released.
|
||||
|
@@ -18,15 +18,7 @@ but mostly consisting of bug fixes.
|
||||
|
||||
<h2>MD5 checksums</h2>
|
||||
<pre>
|
||||
11a033b078e090b3caaeb467234fe299 MesaLib-6.5.2.tar.gz
|
||||
e4d894181f1859651658b3704633e10d MesaLib-6.5.2.tar.bz2
|
||||
63bf1d444fa738cca52ce1043e284021 MesaLib-6.5.2.zip
|
||||
2b8f1375d16bda5f5a2304174cd5bcf7 MesaDemos-6.5.2.tar.gz
|
||||
e870efe98d3a50be01ab211b9b2e25d9 MesaDemos-6.5.2.tar.bz2
|
||||
d92cc6f5fee5ca75af0be04f9f4908f0 MesaDemos-6.5.2.zip
|
||||
8d4d77e3a7132f4217bbc7c1ab157030 MesaGLUT-6.5.2.tar.gz
|
||||
e84edbb11c69c8e408dfadd2ed08e95b MesaGLUT-6.5.2.tar.bz2
|
||||
c6d7134843ed5faf11f6686ecb5d2a2e MesaGLUT-6.5.2.zip
|
||||
TBD
|
||||
</pre>
|
||||
|
||||
|
||||
|
@@ -1,111 +0,0 @@
|
||||
<HTML>
|
||||
|
||||
<TITLE>Mesa Release Notes</TITLE>
|
||||
|
||||
<head><link rel="stylesheet" type="text/css" href="mesa.css"></head>
|
||||
|
||||
<BODY>
|
||||
|
||||
<body bgcolor="#eeeeee">
|
||||
|
||||
<H1>Mesa 6.5.3 Release Notes / April 27, 2007</H1>
|
||||
|
||||
<p>
|
||||
Mesa 6.5.3 is a development release with many changes and new features.
|
||||
Mesa 7.0 is expected to follow shortly.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>MD5 checksums</h2>
|
||||
<pre>
|
||||
TBD
|
||||
</pre>
|
||||
|
||||
|
||||
<h2>Shared library numbering</h2>
|
||||
<p>
|
||||
Mesa 6.5.3 supports the OpenGL 2.0/2.1 API. However, the (unix)
|
||||
shared library version is still 1.5 (i.e. libGL.so.1.5.xxxxxx).
|
||||
Bumping the shared library version to 2.x would cause linking problems
|
||||
with existing OpenGL applications. Since OpenGL 2.x is backward
|
||||
compatible with OpenGL 1.x the shared library version number doesn't
|
||||
have to be incremented (which would indicate an incompatible ABI).
|
||||
</p>
|
||||
<p>
|
||||
Other OpenGL vendors name their OpenGL 2.x libraries libGL.so.1.0.xxxxx
|
||||
for the same reason.
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
<h2>New features</h2>
|
||||
<ul>
|
||||
<li>OpenGL 2.0 and 2.1 API support.
|
||||
<li>Entirely new Shading Language code generator. See the
|
||||
<a href="shading.html">Shading Language</a> page for more information.
|
||||
<li>Much faster software execution of vertex, fragment shaders.
|
||||
<li>New vertex buffer object (vbo) infrastructure
|
||||
<li>Updated glext.h file (version 39)
|
||||
<li>Updated glxext.h file (version 19)
|
||||
<li>GL_MAX_DRAWBUFFERS is now 4 (software rendering) so
|
||||
"multiple render targets" are really supported.
|
||||
</ul>
|
||||
|
||||
<h2>Bug fixes</h2>
|
||||
<ul>
|
||||
<li>Fog was errantly applied when a fragment shader was enabled (bug 9346)
|
||||
<li>glPush/PopClientAttrib didn't handle VBO bindings correctly (bug 9445)
|
||||
<li>With 32-bit Z buffer, the fragment Z of lines and points was sometimes wrong.
|
||||
<li>GL_POST_CONVOLUTION_ALPHA_BIAS/SCALE was broken.
|
||||
<li>1D convolution state could effect 2D image transfers
|
||||
<li>Overlapping glCopyPixels with negative Y zoom didn't work (bug 10521)
|
||||
<li>Fixed a number of framebuffer/renderbuffer reference counting bugs
|
||||
<li>Fixed a few bugs in software-emulated alpha planes
|
||||
<li>Assorted minor bug fixes in glCopy/DrawPixels, glPixelZoom, etc.
|
||||
<li>Assorted DRI driver bug fixes.
|
||||
<li>Fixed a number of bugs that prevented "depth-peeling" rendering from working.
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Internal code changes</h2>
|
||||
<ul>
|
||||
<li>Old array_cache module replaced by new vbo module. All geometry
|
||||
rendering is now cast in the form of vertex buffer objects.
|
||||
<li>Massive changes to the Shading Language compiler and related state.
|
||||
<li>Vertex/fragment shaders are compiled into GPU instructions and
|
||||
programs very similar to GL_ARB_vertex/fragment_program.
|
||||
<li>Vertex and fragment programs are executed with the same code now.
|
||||
<li>The SSE-optimized vertex program path has been removed since it didn't
|
||||
support more than 12 temp registers, didn't support branching/looping, etc.
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>To Do (someday) items</h2>
|
||||
<ul>
|
||||
<li>Switch to freeglut
|
||||
<li>Fix linux-glide target/driver.
|
||||
<li>Improved lambda and derivative calculation for frag progs.
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Driver Status</h2>
|
||||
|
||||
<pre>
|
||||
Driver Status
|
||||
---------------------- ----------------------
|
||||
DRI drivers varies with the driver
|
||||
XMesa/GLX (on Xlib) implements OpenGL 2.1
|
||||
OSMesa (off-screen) implements OpenGL 2.1
|
||||
Windows/Win32 implements OpenGL 2.1
|
||||
Glide (3dfx Voodoo1/2) implements OpenGL 1.3
|
||||
SVGA unsupported
|
||||
Wind River UGL unsupported
|
||||
DJGPP unsupported
|
||||
GGI unsupported
|
||||
BeOS unsupported
|
||||
Allegro unsupported
|
||||
D3D unsupported
|
||||
</pre>
|
||||
|
||||
</body>
|
||||
</html>
|
@@ -20,7 +20,6 @@ The release notes summarize what's new or changed in each Mesa release.
|
||||
</p>
|
||||
|
||||
<UL>
|
||||
<LI><A HREF="relnotes-6.5.3.html">6.5.3 release notes</A>
|
||||
<LI><A HREF="relnotes-6.5.2.html">6.5.2 release notes</A>
|
||||
<LI><A HREF="relnotes-6.5.1.html">6.5.1 release notes</A>
|
||||
<LI><A HREF="relnotes-6.5.html">6.5 release notes</A>
|
||||
|
@@ -1,111 +0,0 @@
|
||||
<HTML>
|
||||
|
||||
<TITLE>Cocd Repository</TITLE>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="mesa.css"></head>
|
||||
|
||||
<BODY>
|
||||
|
||||
<h1>Code Repository</h1>
|
||||
|
||||
<p>
|
||||
As of December 5, 2006, Mesa is using
|
||||
<a href="http://git.or.cz/"target="_parent">git</a>
|
||||
as its source code management system.
|
||||
CVS was used previously.
|
||||
The old CVS repository should no longer be used.
|
||||
</p>
|
||||
|
||||
The master git repository is hosted on
|
||||
<a href="http://www.freedesktop.org" target="_parent">freedesktop.org</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
You may access the repository either as an
|
||||
<a href="#anonymous">anonymous user</a> (read-only) or as a
|
||||
<a href="#developer">developer</a>
|
||||
(read/write).
|
||||
</p>
|
||||
|
||||
<p>
|
||||
You may also
|
||||
<a href="http://gitweb.freedesktop.org/?p=mesa/mesa.git"
|
||||
target="_parent">browse the git repository</a>.
|
||||
</p>
|
||||
|
||||
|
||||
<a name="anonymous">
|
||||
<H2>Anonymous git Access</H2>
|
||||
|
||||
<p>
|
||||
To get the Mesa sources anonymously (read-only):
|
||||
</p>
|
||||
|
||||
<ol>
|
||||
<li>Install the git software on your computer if needed.<br><br>
|
||||
<li>Get an initial, local copy of the repository with:
|
||||
<pre>
|
||||
git clone git://anongit.freedesktop.org/git/mesa/mesa
|
||||
</pre>
|
||||
<li>Later, you can update your tree from the master repository with:
|
||||
<pre>
|
||||
git pull origin
|
||||
</pre>
|
||||
</ol>
|
||||
|
||||
|
||||
<a name="developer">
|
||||
<H2>Developer git Access</H2>
|
||||
|
||||
<p>
|
||||
Mesa developers need to first have an account on
|
||||
<a href="http://www.freedesktop.org" target="_parent">freedesktop.org</a>.
|
||||
To get an account, please ask Brian or the other Mesa developers for
|
||||
permission.
|
||||
Then, if there are no objections, follow this
|
||||
<a href="http://www.freedesktop.org/wiki/AccountRequests" target="_parent">
|
||||
procedure</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Once your account is established:
|
||||
</p>
|
||||
|
||||
<ol>
|
||||
<li>Install the git software on your computer if needed.<br><br>
|
||||
<li>Get an initial, local copy of the repository with:
|
||||
<pre>
|
||||
git clone git+ssh://username@git.freedesktop.org/git/mesa/mesa
|
||||
</pre>
|
||||
Replace <em>username</em> with your actual login name.<br><br>
|
||||
<li>Later, you can update your tree from the master repository with:
|
||||
<pre>
|
||||
git pull origin
|
||||
</pre>
|
||||
</ol>
|
||||
|
||||
|
||||
<a name="developer">
|
||||
<H2>Development Branches</H2>
|
||||
|
||||
<p>
|
||||
At any given time, there may be several active branches in Mesa's
|
||||
repository.
|
||||
Generally, the trunk contains the latest development (unstable)
|
||||
code while a branch has the latest stable code.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The command <code>git-branch</code> will list all available branches.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Questions about branch status/activity should be posted to the
|
||||
mesa3d-dev mailing list.
|
||||
</p>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
@@ -1,312 +0,0 @@
|
||||
<HTML>
|
||||
|
||||
<TITLE>Shading Language Support</TITLE>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="mesa.css"></head>
|
||||
|
||||
<BODY>
|
||||
|
||||
<H1>Shading Language Support</H1>
|
||||
|
||||
<p>
|
||||
This page describes the features and status of Mesa's support for the
|
||||
<a href="http://opengl.org/documentation/glsl/" target="_parent">
|
||||
OpenGL Shading Language</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Last updated on 28 March 2007.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Contents
|
||||
</p>
|
||||
<ul>
|
||||
<li><a href="#unsup">Unsupported Features</a>
|
||||
<li><a href="#notes">Implementation Notes</a>
|
||||
<li><a href="#hints">Programming Hints</a>
|
||||
<li><a href="#standalone">Stand-alone Compiler</a>
|
||||
<li><a href="#implementation">Compiler Implementation</a>
|
||||
<li><a href="#validation">Compiler Validation</a>
|
||||
</ul>
|
||||
|
||||
|
||||
<a name="unsup">
|
||||
<h2>Unsupported Features</h2>
|
||||
|
||||
<p>
|
||||
The following features of the shading language are not yet supported
|
||||
in Mesa:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>Dereferencing arrays with non-constant indexes
|
||||
<li>Comparison of user-defined structs
|
||||
<li>Linking of multiple shaders is not supported
|
||||
<li>gl_ClipVertex
|
||||
<li>The derivative functions such as dFdx() are not implemented
|
||||
<li>The inverse trig functions asin(), acos(), and atan() are not implemented
|
||||
<li>The gl_Color and gl_SecondaryColor varying vars are interpolated
|
||||
without perspective correction
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
All other major features of the shading language should function.
|
||||
</p>
|
||||
|
||||
|
||||
<a name="notes">
|
||||
<h2>Implementation Notes</h2>
|
||||
|
||||
<ul>
|
||||
<li>Shading language programs are compiled into low-level programs
|
||||
very similar to those of GL_ARB_vertex/fragment_program.
|
||||
<li>All vector types (vec2, vec3, vec4, bvec2, etc) currently occupy full
|
||||
float[4] registers.
|
||||
<li>Float constants and variables are packed so that up to four floats
|
||||
can occupy one program parameter/register.
|
||||
<li>All function calls are inlined.
|
||||
<li>Shaders which use too many registers will not compile.
|
||||
<li>The quality of generated code is pretty good, register usage is fair.
|
||||
<li>Shader error detection and reporting of errors (InfoLog) is not
|
||||
very good yet.
|
||||
<li>The ftransform() function doesn't necessarily match the results of
|
||||
fixed-function transformation.
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
These issues will be addressed/resolved in the future.
|
||||
</p>
|
||||
|
||||
|
||||
<a name="hints">
|
||||
<h2>Programming Hints</h2>
|
||||
|
||||
<ul>
|
||||
<li>Declare <em>in</em> function parameters as <em>const</em> whenever possible.
|
||||
This improves the efficiency of function inlining.
|
||||
</li>
|
||||
<br>
|
||||
<li>To reduce register usage, declare variables within smaller scopes.
|
||||
For example, the following code:
|
||||
<pre>
|
||||
void main()
|
||||
{
|
||||
vec4 a1, a2, b1, b2;
|
||||
gl_Position = expression using a1, a2.
|
||||
gl_Color = expression using b1, b2;
|
||||
}
|
||||
</pre>
|
||||
Can be rewritten as follows to use half as many registers:
|
||||
<pre>
|
||||
void main()
|
||||
{
|
||||
{
|
||||
vec4 a1, a2;
|
||||
gl_Position = expression using a1, a2.
|
||||
}
|
||||
{
|
||||
vec4 b1, b2;
|
||||
gl_Color = expression using b1, b2;
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
Alternately, rather than using several float variables, use
|
||||
a vec4 instead. Use swizzling and writemasks to access the
|
||||
components of the vec4 as floats.
|
||||
</li>
|
||||
<br>
|
||||
<li>Use the built-in library functions whenever possible.
|
||||
For example, instead of writing this:
|
||||
<pre>
|
||||
float x = 1.0 / sqrt(y);
|
||||
</pre>
|
||||
Write this:
|
||||
<pre>
|
||||
float x = inversesqrt(y);
|
||||
</pre>
|
||||
<li>
|
||||
Use ++i when possible as it's more efficient than i++
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<a name="standalone">
|
||||
<h2>Stand-alone Compiler</h2>
|
||||
|
||||
<p>
|
||||
A unique stand-alone GLSL compiler driver has been added to Mesa.
|
||||
<p>
|
||||
|
||||
<p>
|
||||
The stand-alone compiler (like a conventional command-line compiler)
|
||||
is a tool that accepts Shading Language programs and emits low-level
|
||||
GPU programs.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
This tool is useful for:
|
||||
<p>
|
||||
<ul>
|
||||
<li>Inspecting GPU code to gain insight into compilation
|
||||
<li>Generating initial GPU code for subsequent hand-tuning
|
||||
<li>Debugging the GLSL compiler itself
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
To build the glslcompiler program (this will be improved someday):
|
||||
</p>
|
||||
<pre>
|
||||
cd src/mesa
|
||||
make libmesa.a
|
||||
cd drivers/glslcompiler
|
||||
make
|
||||
</pre>
|
||||
|
||||
|
||||
<p>
|
||||
Here's an example of using the compiler to compile a vertex shader and
|
||||
emit GL_ARB_vertex_program-style instructions:
|
||||
</p>
|
||||
<pre>
|
||||
glslcompiler --arb --linenumbers --vs vertshader.txt
|
||||
</pre>
|
||||
<p>
|
||||
The output may look similar to this:
|
||||
</p>
|
||||
<pre>
|
||||
!!ARBvp1.0
|
||||
0: MOV result.texcoord[0], vertex.texcoord[0];
|
||||
1: DP4 temp0.x, state.matrix.mvp.row[0], vertex.position;
|
||||
2: DP4 temp0.y, state.matrix.mvp.row[1], vertex.position;
|
||||
3: DP4 temp0.z, state.matrix.mvp.row[2], vertex.position;
|
||||
4: DP4 temp0.w, state.matrix.mvp.row[3], vertex.position;
|
||||
5: MOV result.position, temp0;
|
||||
6: END
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Note that some shading language constructs (such as uniform and varying
|
||||
variables) aren't expressible in ARB or NV-style programs.
|
||||
Therefore, the resulting output is not always legal by definition of
|
||||
those program languages.
|
||||
</p>
|
||||
<p>
|
||||
Also note that this compiler driver is still under development.
|
||||
Over time, the correctness of the GPU programs, with respect to the ARB
|
||||
and NV languagues, should improve.
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
<a name="implementation">
|
||||
<h2>Compiler Implementation</h2>
|
||||
|
||||
<p>
|
||||
The source code for Mesa's shading language compiler is in the
|
||||
<code>src/mesa/shader/slang/</code> directory.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The compiler follows a fairly standard design and basically works as follows:
|
||||
</p>
|
||||
<ul>
|
||||
<li>The input string is tokenized (see grammar.c) and parsed
|
||||
(see slang_compiler_*.c) to produce an Abstract Syntax Tree (AST).
|
||||
The nodes in this tree are slang_operation structures
|
||||
(see slang_compile_operation.h).
|
||||
The nodes are decorated with symbol table, scoping and datatype information.
|
||||
<li>The AST is converted into an Intermediate representation (IR) tree
|
||||
(see the slang_codegen.c file).
|
||||
The IR nodes represent basic GPU instructions, like add, dot product,
|
||||
move, etc.
|
||||
The IR tree is mostly a binary tree, but a few nodes have three or four
|
||||
children.
|
||||
In principle, the IR tree could be executed by doing an in-order traversal.
|
||||
<li>The IR tree is traversed in-order to emit code (see slang_emit.c).
|
||||
This is also when registers are allocated to store variables and temps.
|
||||
<li>In the future, a pattern-matching code generator-generator may be
|
||||
used for code generation.
|
||||
Programs such as L-BURG (Bottom-Up Rewrite Generator) and Twig look for
|
||||
patterns in IR trees, compute weights for subtrees and use the weights
|
||||
to select the best instructions to represent the sub-tree.
|
||||
<li>The emitted GPU instructions (see prog_instruction.h) are stored in a
|
||||
gl_program object (see mtypes.h).
|
||||
<li>When a fragment shader and vertex shader are linked (see slang_link.c)
|
||||
the varying vars are matched up, uniforms are merged, and vertex
|
||||
attributes are resolved (rewriting instructions as needed).
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
The final vertex and fragment programs may be interpreted in software
|
||||
(see prog_execute.c) or translated into a specific hardware architecture
|
||||
(see drivers/dri/i915/i915_fragprog.c for example).
|
||||
</p>
|
||||
|
||||
<h3>Code Generation Options</h3>
|
||||
|
||||
<p>
|
||||
Internally, there are several options that control the compiler's code
|
||||
generation and instruction selection.
|
||||
These options are seen in the gl_shader_state struct and may be set
|
||||
by the device driver to indicate its preferences:
|
||||
|
||||
<pre>
|
||||
struct gl_shader_state
|
||||
{
|
||||
...
|
||||
/** Driver-selectable options: */
|
||||
GLboolean EmitHighLevelInstructions;
|
||||
GLboolean EmitCondCodes;
|
||||
GLboolean EmitComments;
|
||||
};
|
||||
</pre>
|
||||
|
||||
<ul>
|
||||
<li>EmitHighLevelInstructions
|
||||
<br>
|
||||
This option controls instruction selection for loops and conditionals.
|
||||
If the option is set high-level IF/ELSE/ENDIF, LOOP/ENDLOOP, CONT/BRK
|
||||
instructions will be emitted.
|
||||
Otherwise, those constructs will be implemented with BRA instructions.
|
||||
</li>
|
||||
|
||||
<li>EmitCondCodes
|
||||
<br>
|
||||
If set, condition codes (ala GL_NV_fragment_program) will be used for
|
||||
branching and looping.
|
||||
Otherwise, ordinary registers will be used (the IF instruction will
|
||||
examine the first operand's X component and do the if-part if non-zero).
|
||||
This option is only relevant if EmitHighLevelInstructions is set.
|
||||
</li>
|
||||
|
||||
<li>EmitComments
|
||||
<br>
|
||||
If set, instructions will be annoted with comments to help with debugging.
|
||||
Extra NOP instructions will also be inserted.
|
||||
</br>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<a name="validation">
|
||||
<h2>Compiler Validation</h2>
|
||||
|
||||
<p>
|
||||
A new <a href="http://glean.sf.net" target="_parent">Glean</a> test has
|
||||
been create to exercise the GLSL compiler.
|
||||
</p>
|
||||
<p>
|
||||
The <em>glsl1</em> test runs over 150 sub-tests to check that the language
|
||||
features and built-in functions work properly.
|
||||
This test should be run frequently while working on the compiler to catch
|
||||
regressions.
|
||||
</p>
|
||||
<p>
|
||||
The test coverage is reasonably broad and complete but additional tests
|
||||
should be added.
|
||||
</p>
|
||||
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
@@ -42,7 +42,7 @@ WIDTH="88" HEIGHT="31" ALIGN="BOTTOM" ALT="Sourceforge.net" BORDER="0"></A>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<li>The Mesa git repository is hosted by
|
||||
<li>The Mesa CVS repository is hosted by
|
||||
<a href="http://freedesktop.org/" target="_parent">freedesktop.org</a>.
|
||||
<br>
|
||||
<br>
|
||||
|
@@ -27,6 +27,10 @@
|
||||
#define MANGLE(x) mgl##x
|
||||
#endif /*MANGLE*/
|
||||
|
||||
/* Internal symbols which may collide with other OpenGL implementations. */
|
||||
#define __glCoreCreateContext __mglCoreCreateContext
|
||||
#define __glCoreNopDispatch __mglCoreNopDispatch
|
||||
|
||||
/*REGENERATE_TO_END-----------ALL LINES BELOW HERE GET REPLACED ON REGENERATION */
|
||||
|
||||
#define glAccum MANGLE(Accum)
|
||||
|
@@ -6,26 +6,32 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2007 The Khronos Group Inc.
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person obtaining a
|
||||
** copy of this software and/or associated documentation files (the
|
||||
** "Materials"), to deal in the Materials without restriction, including
|
||||
** without limitation the rights to use, copy, modify, merge, publish,
|
||||
** distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
** permit persons to whom the Materials are furnished to do so, subject to
|
||||
** the following conditions:
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** The above copyright notice and this permission notice shall be included
|
||||
** in all copies or substantial portions of the Materials.
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 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
|
||||
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
** Original Code. The Original Code is: OpenGL Sample Implementation,
|
||||
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
|
||||
** Inc. The Original Code is Copyright (c) 1991-2004 Silicon Graphics, Inc.
|
||||
** Copyright in any portions created by third parties is as indicated
|
||||
** elsewhere herein. All Rights Reserved.
|
||||
**
|
||||
** Additional Notice Provisions: This software was created using the
|
||||
** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
|
||||
** not been independently verified as being compliant with the OpenGL(R)
|
||||
** version 1.2.1 Specification.
|
||||
*/
|
||||
|
||||
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
|
||||
@@ -46,9 +52,9 @@ extern "C" {
|
||||
/*************************************************************/
|
||||
|
||||
/* Header file version number, required by OpenGL ABI for Linux */
|
||||
/* glext.h last updated 2007/02/12 */
|
||||
/* glext.h last updated 2006/08/30 */
|
||||
/* Current version at http://www.opengl.org/registry/ */
|
||||
#define GL_GLEXT_VERSION 39
|
||||
#define GL_GLEXT_VERSION 34
|
||||
|
||||
#ifndef GL_VERSION_1_2
|
||||
#define GL_UNSIGNED_BYTE_3_3_2 0x8032
|
||||
@@ -3013,6 +3019,7 @@ extern "C" {
|
||||
#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT 0x8CD8
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB
|
||||
@@ -3097,8 +3104,6 @@ extern "C" {
|
||||
|
||||
#ifndef GL_EXT_framebuffer_multisample
|
||||
#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56
|
||||
#define GL_MAX_SAMPLES_EXT 0x8D57
|
||||
#endif
|
||||
|
||||
#ifndef GL_MESAX_texture_stack
|
||||
@@ -3117,268 +3122,6 @@ extern "C" {
|
||||
#ifndef GL_EXT_gpu_program_parameters
|
||||
#endif
|
||||
|
||||
#ifndef GL_APPLE_flush_buffer_range
|
||||
#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12
|
||||
#define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13
|
||||
#endif
|
||||
|
||||
#ifndef GL_NV_gpu_program4
|
||||
#define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904
|
||||
#define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905
|
||||
#define GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906
|
||||
#define GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907
|
||||
#define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908
|
||||
#define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909
|
||||
#define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5
|
||||
#define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6
|
||||
#endif
|
||||
|
||||
#ifndef GL_NV_geometry_program4
|
||||
#define GL_LINES_ADJACENCY_EXT 0x000A
|
||||
#define GL_LINE_STRIP_ADJACENCY_EXT 0x000B
|
||||
#define GL_TRIANGLES_ADJACENCY_EXT 0x000C
|
||||
#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0x000D
|
||||
#define GL_GEOMETRY_PROGRAM_NV 0x8C26
|
||||
#define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27
|
||||
#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28
|
||||
#define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA
|
||||
#define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB
|
||||
#define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC
|
||||
#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4
|
||||
#define GL_PROGRAM_POINT_SIZE_EXT 0x8642
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_geometry_shader4
|
||||
#define GL_GEOMETRY_SHADER_EXT 0x8DD9
|
||||
/* reuse GL_GEOMETRY_VERTICES_OUT_EXT */
|
||||
/* reuse GL_GEOMETRY_INPUT_TYPE_EXT */
|
||||
/* reuse GL_GEOMETRY_OUTPUT_TYPE_EXT */
|
||||
/* reuse GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT */
|
||||
#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD
|
||||
#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE
|
||||
#define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B
|
||||
#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF
|
||||
#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0
|
||||
#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1
|
||||
/* reuse GL_LINES_ADJACENCY_EXT */
|
||||
/* reuse GL_LINE_STRIP_ADJACENCY_EXT */
|
||||
/* reuse GL_TRIANGLES_ADJACENCY_EXT */
|
||||
/* reuse GL_TRIANGLE_STRIP_ADJACENCY_EXT */
|
||||
/* reuse GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT */
|
||||
/* reuse GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT */
|
||||
/* reuse GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT */
|
||||
/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */
|
||||
/* reuse GL_PROGRAM_POINT_SIZE_EXT */
|
||||
#endif
|
||||
|
||||
#ifndef GL_NV_vertex_program4
|
||||
#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_gpu_shader4
|
||||
#define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0
|
||||
#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1
|
||||
#define GL_SAMPLER_BUFFER_EXT 0x8DC2
|
||||
#define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3
|
||||
#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4
|
||||
#define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5
|
||||
#define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6
|
||||
#define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7
|
||||
#define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8
|
||||
#define GL_INT_SAMPLER_1D_EXT 0x8DC9
|
||||
#define GL_INT_SAMPLER_2D_EXT 0x8DCA
|
||||
#define GL_INT_SAMPLER_3D_EXT 0x8DCB
|
||||
#define GL_INT_SAMPLER_CUBE_EXT 0x8DCC
|
||||
#define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD
|
||||
#define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE
|
||||
#define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF
|
||||
#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0
|
||||
#define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1
|
||||
#define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2
|
||||
#define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3
|
||||
#define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4
|
||||
#define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5
|
||||
#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6
|
||||
#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7
|
||||
#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_draw_instanced
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_packed_float
|
||||
#define GL_R11F_G11F_B10F_EXT 0x8C3A
|
||||
#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B
|
||||
#define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_texture_array
|
||||
#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18
|
||||
#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19
|
||||
#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A
|
||||
#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B
|
||||
#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C
|
||||
#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D
|
||||
#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF
|
||||
#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E
|
||||
/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_texture_buffer_object
|
||||
#define GL_TEXTURE_BUFFER_EXT 0x8C2A
|
||||
#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B
|
||||
#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C
|
||||
#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D
|
||||
#define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_texture_compression_latc
|
||||
#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70
|
||||
#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71
|
||||
#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72
|
||||
#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_texture_compression_rgtc
|
||||
#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB
|
||||
#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC
|
||||
#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD
|
||||
#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_texture_shared_exponent
|
||||
#define GL_RGB9_E5_EXT 0x8C3D
|
||||
#define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E
|
||||
#define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F
|
||||
#endif
|
||||
|
||||
#ifndef GL_NV_depth_buffer_float
|
||||
#define GL_DEPTH_COMPONENT32F_NV 0x8DAB
|
||||
#define GL_DEPTH32F_STENCIL8_NV 0x8DAC
|
||||
#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD
|
||||
#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF
|
||||
#endif
|
||||
|
||||
#ifndef GL_NV_fragment_program4
|
||||
#endif
|
||||
|
||||
#ifndef GL_NV_framebuffer_multisample_coverage
|
||||
#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB
|
||||
#define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10
|
||||
#define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11
|
||||
#define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_framebuffer_sRGB
|
||||
#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9
|
||||
#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA
|
||||
#endif
|
||||
|
||||
#ifndef GL_NV_geometry_shader4
|
||||
#endif
|
||||
|
||||
#ifndef GL_NV_parameter_buffer_object
|
||||
#define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0
|
||||
#define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1
|
||||
#define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2
|
||||
#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3
|
||||
#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_draw_buffers2
|
||||
#endif
|
||||
|
||||
#ifndef GL_NV_transform_feedback
|
||||
#define GL_BACK_PRIMARY_COLOR_NV 0x8C77
|
||||
#define GL_BACK_SECONDARY_COLOR_NV 0x8C78
|
||||
#define GL_TEXTURE_COORD_NV 0x8C79
|
||||
#define GL_CLIP_DISTANCE_NV 0x8C7A
|
||||
#define GL_VERTEX_ID_NV 0x8C7B
|
||||
#define GL_PRIMITIVE_ID_NV 0x8C7C
|
||||
#define GL_GENERIC_ATTRIB_NV 0x8C7D
|
||||
#define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E
|
||||
#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F
|
||||
#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80
|
||||
#define GL_ACTIVE_VARYINGS_NV 0x8C81
|
||||
#define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82
|
||||
#define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83
|
||||
#define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84
|
||||
#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85
|
||||
#define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86
|
||||
#define GL_PRIMITIVES_GENERATED_NV 0x8C87
|
||||
#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88
|
||||
#define GL_RASTERIZER_DISCARD_NV 0x8C89
|
||||
#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_ATTRIBS_NV 0x8C8A
|
||||
#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B
|
||||
#define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C
|
||||
#define GL_SEPARATE_ATTRIBS_NV 0x8C8D
|
||||
#define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E
|
||||
#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_bindable_uniform
|
||||
#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2
|
||||
#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3
|
||||
#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4
|
||||
#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED
|
||||
#define GL_UNIFORM_BUFFER_EXT 0x8DEE
|
||||
#define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_texture_integer
|
||||
#define GL_RGBA32UI_EXT 0x8D70
|
||||
#define GL_RGB32UI_EXT 0x8D71
|
||||
#define GL_ALPHA32UI_EXT 0x8D72
|
||||
#define GL_INTENSITY32UI_EXT 0x8D73
|
||||
#define GL_LUMINANCE32UI_EXT 0x8D74
|
||||
#define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75
|
||||
#define GL_RGBA16UI_EXT 0x8D76
|
||||
#define GL_RGB16UI_EXT 0x8D77
|
||||
#define GL_ALPHA16UI_EXT 0x8D78
|
||||
#define GL_INTENSITY16UI_EXT 0x8D79
|
||||
#define GL_LUMINANCE16UI_EXT 0x8D7A
|
||||
#define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B
|
||||
#define GL_RGBA8UI_EXT 0x8D7C
|
||||
#define GL_RGB8UI_EXT 0x8D7D
|
||||
#define GL_ALPHA8UI_EXT 0x8D7E
|
||||
#define GL_INTENSITY8UI_EXT 0x8D7F
|
||||
#define GL_LUMINANCE8UI_EXT 0x8D80
|
||||
#define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81
|
||||
#define GL_RGBA32I_EXT 0x8D82
|
||||
#define GL_RGB32I_EXT 0x8D83
|
||||
#define GL_ALPHA32I_EXT 0x8D84
|
||||
#define GL_INTENSITY32I_EXT 0x8D85
|
||||
#define GL_LUMINANCE32I_EXT 0x8D86
|
||||
#define GL_LUMINANCE_ALPHA32I_EXT 0x8D87
|
||||
#define GL_RGBA16I_EXT 0x8D88
|
||||
#define GL_RGB16I_EXT 0x8D89
|
||||
#define GL_ALPHA16I_EXT 0x8D8A
|
||||
#define GL_INTENSITY16I_EXT 0x8D8B
|
||||
#define GL_LUMINANCE16I_EXT 0x8D8C
|
||||
#define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D
|
||||
#define GL_RGBA8I_EXT 0x8D8E
|
||||
#define GL_RGB8I_EXT 0x8D8F
|
||||
#define GL_ALPHA8I_EXT 0x8D90
|
||||
#define GL_INTENSITY8I_EXT 0x8D91
|
||||
#define GL_LUMINANCE8I_EXT 0x8D92
|
||||
#define GL_LUMINANCE_ALPHA8I_EXT 0x8D93
|
||||
#define GL_RED_INTEGER_EXT 0x8D94
|
||||
#define GL_GREEN_INTEGER_EXT 0x8D95
|
||||
#define GL_BLUE_INTEGER_EXT 0x8D96
|
||||
#define GL_ALPHA_INTEGER_EXT 0x8D97
|
||||
#define GL_RGB_INTEGER_EXT 0x8D98
|
||||
#define GL_RGBA_INTEGER_EXT 0x8D99
|
||||
#define GL_BGR_INTEGER_EXT 0x8D9A
|
||||
#define GL_BGRA_INTEGER_EXT 0x8D9B
|
||||
#define GL_LUMINANCE_INTEGER_EXT 0x8D9C
|
||||
#define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D
|
||||
#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
@@ -3419,7 +3162,7 @@ typedef unsigned short GLhalfNV;
|
||||
/* This code block is duplicated in glext.h, so must be protected */
|
||||
#define GLEXT_64_TYPES_DEFINED
|
||||
/* Define int32_t, int64_t, and uint64_t types for UST/MSC */
|
||||
/* (as used in the GL_EXT_timer_query extension). */
|
||||
/* (as used in the GLX_OML_sync_control extension). */
|
||||
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
||||
#include <inttypes.h>
|
||||
#elif defined(__sun__)
|
||||
@@ -3441,12 +3184,12 @@ typedef unsigned long long int uint64_t;
|
||||
typedef long int int32_t;
|
||||
typedef long long int int64_t;
|
||||
typedef unsigned long long int uint64_t;
|
||||
#elif defined(_WIN32) && defined(__GNUC__)
|
||||
#include <stdint.h>
|
||||
#elif defined(_WIN32)
|
||||
typedef __int32 int32_t;
|
||||
#elif defined(WIN32) && defined(_MSC_VER)
|
||||
typedef long int int32_t;
|
||||
typedef __int64 int64_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
#elif defined(WIN32) && defined(__GNUC__)
|
||||
#include <stdint.h>
|
||||
#else
|
||||
#include <inttypes.h> /* Fallback option */
|
||||
#endif
|
||||
@@ -6944,314 +6687,6 @@ typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLu
|
||||
typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params);
|
||||
#endif
|
||||
|
||||
#ifndef GL_APPLE_flush_buffer_range
|
||||
#define GL_APPLE_flush_buffer_range 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glBufferParameteriAPPLE (GLenum, GLenum, GLint);
|
||||
GLAPI void APIENTRY glFlushMappedBufferRangeAPPLE (GLenum, GLintptr, GLsizeiptr);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param);
|
||||
typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size);
|
||||
#endif
|
||||
|
||||
#ifndef GL_NV_gpu_program4
|
||||
#define GL_NV_gpu_program4 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glProgramLocalParameterI4iNV (GLenum, GLuint, GLint, GLint, GLint, GLint);
|
||||
GLAPI void APIENTRY glProgramLocalParameterI4ivNV (GLenum, GLuint, const GLint *);
|
||||
GLAPI void APIENTRY glProgramLocalParametersI4ivNV (GLenum, GLuint, GLsizei, const GLint *);
|
||||
GLAPI void APIENTRY glProgramLocalParameterI4uiNV (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint);
|
||||
GLAPI void APIENTRY glProgramLocalParameterI4uivNV (GLenum, GLuint, const GLuint *);
|
||||
GLAPI void APIENTRY glProgramLocalParametersI4uivNV (GLenum, GLuint, GLsizei, const GLuint *);
|
||||
GLAPI void APIENTRY glProgramEnvParameterI4iNV (GLenum, GLuint, GLint, GLint, GLint, GLint);
|
||||
GLAPI void APIENTRY glProgramEnvParameterI4ivNV (GLenum, GLuint, const GLint *);
|
||||
GLAPI void APIENTRY glProgramEnvParametersI4ivNV (GLenum, GLuint, GLsizei, const GLint *);
|
||||
GLAPI void APIENTRY glProgramEnvParameterI4uiNV (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint);
|
||||
GLAPI void APIENTRY glProgramEnvParameterI4uivNV (GLenum, GLuint, const GLuint *);
|
||||
GLAPI void APIENTRY glProgramEnvParametersI4uivNV (GLenum, GLuint, GLsizei, const GLuint *);
|
||||
GLAPI void APIENTRY glGetProgramLocalParameterIivNV (GLenum, GLuint, GLint *);
|
||||
GLAPI void APIENTRY glGetProgramLocalParameterIuivNV (GLenum, GLuint, GLuint *);
|
||||
GLAPI void APIENTRY glGetProgramEnvParameterIivNV (GLenum, GLuint, GLint *);
|
||||
GLAPI void APIENTRY glGetProgramEnvParameterIuivNV (GLenum, GLuint, GLuint *);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params);
|
||||
typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params);
|
||||
typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params);
|
||||
typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params);
|
||||
typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params);
|
||||
#endif
|
||||
|
||||
#ifndef GL_NV_geometry_program4
|
||||
#define GL_NV_geometry_program4 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glProgramVertexLimitNV (GLenum, GLint);
|
||||
GLAPI void APIENTRY glFramebufferTextureEXT (GLenum, GLenum, GLuint, GLint);
|
||||
GLAPI void APIENTRY glFramebufferTextureLayerEXT (GLenum, GLenum, GLuint, GLint, GLint);
|
||||
GLAPI void APIENTRY glFramebufferTextureFaceEXT (GLenum, GLenum, GLuint, GLint, GLenum);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit);
|
||||
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
|
||||
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
|
||||
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_geometry_shader4
|
||||
#define GL_EXT_geometry_shader4 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glProgramParameteriEXT (GLuint, GLenum, GLint);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value);
|
||||
#endif
|
||||
|
||||
#ifndef GL_NV_vertex_program4
|
||||
#define GL_NV_vertex_program4 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glVertexAttribI1iEXT (GLuint, GLint);
|
||||
GLAPI void APIENTRY glVertexAttribI2iEXT (GLuint, GLint, GLint);
|
||||
GLAPI void APIENTRY glVertexAttribI3iEXT (GLuint, GLint, GLint, GLint);
|
||||
GLAPI void APIENTRY glVertexAttribI4iEXT (GLuint, GLint, GLint, GLint, GLint);
|
||||
GLAPI void APIENTRY glVertexAttribI1uiEXT (GLuint, GLuint);
|
||||
GLAPI void APIENTRY glVertexAttribI2uiEXT (GLuint, GLuint, GLuint);
|
||||
GLAPI void APIENTRY glVertexAttribI3uiEXT (GLuint, GLuint, GLuint, GLuint);
|
||||
GLAPI void APIENTRY glVertexAttribI4uiEXT (GLuint, GLuint, GLuint, GLuint, GLuint);
|
||||
GLAPI void APIENTRY glVertexAttribI1ivEXT (GLuint, const GLint *);
|
||||
GLAPI void APIENTRY glVertexAttribI2ivEXT (GLuint, const GLint *);
|
||||
GLAPI void APIENTRY glVertexAttribI3ivEXT (GLuint, const GLint *);
|
||||
GLAPI void APIENTRY glVertexAttribI4ivEXT (GLuint, const GLint *);
|
||||
GLAPI void APIENTRY glVertexAttribI1uivEXT (GLuint, const GLuint *);
|
||||
GLAPI void APIENTRY glVertexAttribI2uivEXT (GLuint, const GLuint *);
|
||||
GLAPI void APIENTRY glVertexAttribI3uivEXT (GLuint, const GLuint *);
|
||||
GLAPI void APIENTRY glVertexAttribI4uivEXT (GLuint, const GLuint *);
|
||||
GLAPI void APIENTRY glVertexAttribI4bvEXT (GLuint, const GLbyte *);
|
||||
GLAPI void APIENTRY glVertexAttribI4svEXT (GLuint, const GLshort *);
|
||||
GLAPI void APIENTRY glVertexAttribI4ubvEXT (GLuint, const GLubyte *);
|
||||
GLAPI void APIENTRY glVertexAttribI4usvEXT (GLuint, const GLushort *);
|
||||
GLAPI void APIENTRY glVertexAttribIPointerEXT (GLuint, GLint, GLenum, GLsizei, const GLvoid *);
|
||||
GLAPI void APIENTRY glGetVertexAttribIivEXT (GLuint, GLenum, GLint *);
|
||||
GLAPI void APIENTRY glGetVertexAttribIuivEXT (GLuint, GLenum, GLuint *);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint *params);
|
||||
typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint *params);
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_gpu_shader4
|
||||
#define GL_EXT_gpu_shader4 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glGetUniformuivEXT (GLuint, GLint, GLuint *);
|
||||
GLAPI void APIENTRY glBindFragDataLocationEXT (GLuint, GLuint, const GLchar *);
|
||||
GLAPI GLint APIENTRY glGetFragDataLocationEXT (GLuint, const GLchar *);
|
||||
GLAPI void APIENTRY glUniform1uiEXT (GLint, GLuint);
|
||||
GLAPI void APIENTRY glUniform2uiEXT (GLint, GLuint, GLuint);
|
||||
GLAPI void APIENTRY glUniform3uiEXT (GLint, GLuint, GLuint, GLuint);
|
||||
GLAPI void APIENTRY glUniform4uiEXT (GLint, GLuint, GLuint, GLuint, GLuint);
|
||||
GLAPI void APIENTRY glUniform1uivEXT (GLint, GLsizei, const GLuint *);
|
||||
GLAPI void APIENTRY glUniform2uivEXT (GLint, GLsizei, const GLuint *);
|
||||
GLAPI void APIENTRY glUniform3uivEXT (GLint, GLsizei, const GLuint *);
|
||||
GLAPI void APIENTRY glUniform4uivEXT (GLint, GLsizei, const GLuint *);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint *params);
|
||||
typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name);
|
||||
typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONEXTPROC) (GLuint program, const GLchar *name);
|
||||
typedef void (APIENTRYP PFNGLUNIFORM1UIEXTPROC) (GLint location, GLuint v0);
|
||||
typedef void (APIENTRYP PFNGLUNIFORM2UIEXTPROC) (GLint location, GLuint v0, GLuint v1);
|
||||
typedef void (APIENTRYP PFNGLUNIFORM3UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2);
|
||||
typedef void (APIENTRYP PFNGLUNIFORM4UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
|
||||
typedef void (APIENTRYP PFNGLUNIFORM1UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
|
||||
typedef void (APIENTRYP PFNGLUNIFORM2UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
|
||||
typedef void (APIENTRYP PFNGLUNIFORM3UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
|
||||
typedef void (APIENTRYP PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_draw_instanced
|
||||
#define GL_EXT_draw_instanced 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glDrawArraysInstancedEXT (GLenum, GLint, GLsizei, GLsizei);
|
||||
GLAPI void APIENTRY glDrawElementsInstancedEXT (GLenum, GLsizei, GLenum, const GLvoid *, GLsizei);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount);
|
||||
typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_packed_float
|
||||
#define GL_EXT_packed_float 1
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_texture_array
|
||||
#define GL_EXT_texture_array 1
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_texture_buffer_object
|
||||
#define GL_EXT_texture_buffer_object 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glTexBufferEXT (GLenum, GLenum, GLuint);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer);
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_texture_compression_latc
|
||||
#define GL_EXT_texture_compression_latc 1
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_texture_compression_rgtc
|
||||
#define GL_EXT_texture_compression_rgtc 1
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_texture_shared_exponent
|
||||
#define GL_EXT_texture_shared_exponent 1
|
||||
#endif
|
||||
|
||||
#ifndef GL_NV_depth_buffer_float
|
||||
#define GL_NV_depth_buffer_float 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glDepthRangedNV (GLdouble, GLdouble);
|
||||
GLAPI void APIENTRY glClearDepthdNV (GLdouble);
|
||||
GLAPI void APIENTRY glDepthBoundsdNV (GLdouble, GLdouble);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar);
|
||||
typedef void (APIENTRYP PFNGLCLEARDEPTHDNVPROC) (GLdouble depth);
|
||||
typedef void (APIENTRYP PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax);
|
||||
#endif
|
||||
|
||||
#ifndef GL_NV_fragment_program4
|
||||
#define GL_NV_fragment_program4 1
|
||||
#endif
|
||||
|
||||
#ifndef GL_NV_framebuffer_multisample_coverage
|
||||
#define GL_NV_framebuffer_multisample_coverage 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glRenderbufferStorageMultisampleCoverageNV (GLenum, GLsizei, GLsizei, GLenum, GLsizei, GLsizei);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_framebuffer_sRGB
|
||||
#define GL_EXT_framebuffer_sRGB 1
|
||||
#endif
|
||||
|
||||
#ifndef GL_NV_geometry_shader4
|
||||
#define GL_NV_geometry_shader4 1
|
||||
#endif
|
||||
|
||||
#ifndef GL_NV_parameter_buffer_object
|
||||
#define GL_NV_parameter_buffer_object 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glProgramBufferParametersfvNV (GLenum, GLuint, GLuint, GLsizei, const GLfloat *);
|
||||
GLAPI void APIENTRY glProgramBufferParametersIivNV (GLenum, GLuint, GLuint, GLsizei, const GLint *);
|
||||
GLAPI void APIENTRY glProgramBufferParametersIuivNV (GLenum, GLuint, GLuint, GLsizei, const GLuint *);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params);
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_draw_buffers2
|
||||
#define GL_EXT_draw_buffers2 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glColorMaskIndexedEXT (GLuint, GLboolean, GLboolean, GLboolean, GLboolean);
|
||||
GLAPI void APIENTRY glGetBooleanIndexedvEXT (GLenum, GLuint, GLboolean *);
|
||||
GLAPI void APIENTRY glGetIntegerIndexedvEXT (GLenum, GLuint, GLint *);
|
||||
GLAPI void APIENTRY glEnableIndexedEXT (GLenum, GLuint);
|
||||
GLAPI void APIENTRY glDisableIndexedEXT (GLenum, GLuint);
|
||||
GLAPI GLboolean APIENTRY glIsEnabledIndexedEXT (GLenum, GLuint);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
|
||||
typedef void (APIENTRYP PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum target, GLuint index, GLboolean *data);
|
||||
typedef void (APIENTRYP PFNGLGETINTEGERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLint *data);
|
||||
typedef void (APIENTRYP PFNGLENABLEINDEXEDEXTPROC) (GLenum target, GLuint index);
|
||||
typedef void (APIENTRYP PFNGLDISABLEINDEXEDEXTPROC) (GLenum target, GLuint index);
|
||||
typedef GLboolean (APIENTRYP PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GLuint index);
|
||||
#endif
|
||||
|
||||
#ifndef GL_NV_transform_feedback
|
||||
#define GL_NV_transform_feedback 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glBeginTransformFeedbackNV (GLenum);
|
||||
GLAPI void APIENTRY glEndTransformFeedbackNV (void);
|
||||
GLAPI void APIENTRY glTransformFeedbackAttribsNV (GLuint, const GLint *, GLenum);
|
||||
GLAPI void APIENTRY glBindBufferRangeNV (GLenum, GLuint, GLuint, GLintptr, GLsizeiptr);
|
||||
GLAPI void APIENTRY glBindBufferOffsetNV (GLenum, GLuint, GLuint, GLintptr);
|
||||
GLAPI void APIENTRY glBindBufferBaseNV (GLenum, GLuint, GLuint);
|
||||
GLAPI void APIENTRY glTransformFeedbackVaryingsNV (GLuint, GLsizei, const GLint *, GLenum);
|
||||
GLAPI void APIENTRY glActiveVaryingNV (GLuint, const GLchar *);
|
||||
GLAPI GLint APIENTRY glGetVaryingLocationNV (GLuint, const GLchar *);
|
||||
GLAPI void APIENTRY glGetActiveVaryingNV (GLuint, GLuint, GLsizei, GLsizei *, GLsizei *, GLenum *, GLchar *);
|
||||
GLAPI void APIENTRY glGetTransformFeedbackVaryingNV (GLuint, GLuint, GLint *);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode);
|
||||
typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKNVPROC) (void);
|
||||
typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLuint count, const GLint *attribs, GLenum bufferMode);
|
||||
typedef void (APIENTRYP PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
|
||||
typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset);
|
||||
typedef void (APIENTRYP PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer);
|
||||
typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode);
|
||||
typedef void (APIENTRYP PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar *name);
|
||||
typedef GLint (APIENTRYP PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar *name);
|
||||
typedef void (APIENTRYP PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
|
||||
typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint *location);
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_bindable_uniform
|
||||
#define GL_EXT_bindable_uniform 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glUniformBufferEXT (GLuint, GLint, GLuint);
|
||||
GLAPI GLint APIENTRY glGetUniformBufferSizeEXT (GLuint, GLint);
|
||||
GLAPI GLintptr APIENTRY glGetUniformOffsetEXT (GLuint, GLint);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer);
|
||||
typedef GLint (APIENTRYP PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location);
|
||||
typedef GLintptr (APIENTRYP PFNGLGETUNIFORMOFFSETEXTPROC) (GLuint program, GLint location);
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_texture_integer
|
||||
#define GL_EXT_texture_integer 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glTexParameterIivEXT (GLenum, GLenum, const GLint *);
|
||||
GLAPI void APIENTRY glTexParameterIuivEXT (GLenum, GLenum, const GLuint *);
|
||||
GLAPI void APIENTRY glGetTexParameterIivEXT (GLenum, GLenum, GLint *);
|
||||
GLAPI void APIENTRY glGetTexParameterIuivEXT (GLenum, GLenum, GLuint *);
|
||||
GLAPI void APIENTRY glClearColorIiEXT (GLint, GLint, GLint, GLint);
|
||||
GLAPI void APIENTRY glClearColorIuiEXT (GLuint, GLuint, GLuint, GLuint);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
|
||||
typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params);
|
||||
typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
|
||||
typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params);
|
||||
typedef void (APIENTRYP PFNGLCLEARCOLORIIEXTPROC) (GLint red, GLint green, GLint blue, GLint alpha);
|
||||
typedef void (APIENTRYP PFNGLCLEARCOLORIUIEXTPROC) (GLuint red, GLuint green, GLuint blue, GLuint alpha);
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@@ -6,26 +6,32 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2007 The Khronos Group Inc.
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person obtaining a
|
||||
** copy of this software and/or associated documentation files (the
|
||||
** "Materials"), to deal in the Materials without restriction, including
|
||||
** without limitation the rights to use, copy, modify, merge, publish,
|
||||
** distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
** permit persons to whom the Materials are furnished to do so, subject to
|
||||
** the following conditions:
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** The above copyright notice and this permission notice shall be included
|
||||
** in all copies or substantial portions of the Materials.
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 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
|
||||
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
** Original Code. The Original Code is: OpenGL Sample Implementation,
|
||||
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
|
||||
** Inc. The Original Code is Copyright (c) 1991-2004 Silicon Graphics, Inc.
|
||||
** Copyright in any portions created by third parties is as indicated
|
||||
** elsewhere herein. All Rights Reserved.
|
||||
**
|
||||
** Additional Notice Provisions: This software was created using the
|
||||
** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
|
||||
** not been independently verified as being compliant with the OpenGL(R)
|
||||
** version 1.2.1 Specification.
|
||||
*/
|
||||
|
||||
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
|
||||
@@ -46,9 +52,9 @@ extern "C" {
|
||||
/*************************************************************/
|
||||
|
||||
/* Header file version number, required by OpenGL ABI for Linux */
|
||||
/* glxext.h last updated 2007/04/21 */
|
||||
/* glxext.h last updated 2006/08/30 */
|
||||
/* Current version at http://www.opengl.org/registry/ */
|
||||
#define GLX_GLXEXT_VERSION 19
|
||||
#define GLX_GLXEXT_VERSION 14
|
||||
|
||||
#ifndef GLX_VERSION_1_3
|
||||
#define GLX_WINDOW_BIT 0x00000001
|
||||
@@ -301,51 +307,6 @@ extern "C" {
|
||||
#ifndef GLX_MESA_agp_offset
|
||||
#endif
|
||||
|
||||
#ifndef GLX_EXT_fbconfig_packed_float
|
||||
#define GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1
|
||||
#define GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008
|
||||
#endif
|
||||
|
||||
#ifndef GLX_EXT_framebuffer_sRGB
|
||||
#define GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20B2
|
||||
#endif
|
||||
|
||||
#ifndef GLX_EXT_texture_from_pixmap
|
||||
#define GLX_TEXTURE_1D_BIT_EXT 0x00000001
|
||||
#define GLX_TEXTURE_2D_BIT_EXT 0x00000002
|
||||
#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004
|
||||
#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0
|
||||
#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1
|
||||
#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2
|
||||
#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3
|
||||
#define GLX_Y_INVERTED_EXT 0x20D4
|
||||
#define GLX_TEXTURE_FORMAT_EXT 0x20D5
|
||||
#define GLX_TEXTURE_TARGET_EXT 0x20D6
|
||||
#define GLX_MIPMAP_TEXTURE_EXT 0x20D7
|
||||
#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8
|
||||
#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9
|
||||
#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA
|
||||
#define GLX_TEXTURE_1D_EXT 0x20DB
|
||||
#define GLX_TEXTURE_2D_EXT 0x20DC
|
||||
#define GLX_TEXTURE_RECTANGLE_EXT 0x20DD
|
||||
#define GLX_FRONT_LEFT_EXT 0x20DE
|
||||
#define GLX_FRONT_RIGHT_EXT 0x20DF
|
||||
#define GLX_BACK_LEFT_EXT 0x20E0
|
||||
#define GLX_BACK_RIGHT_EXT 0x20E1
|
||||
#define GLX_FRONT_EXT GLX_FRONT_LEFT_EXT
|
||||
#define GLX_BACK_EXT GLX_BACK_LEFT_EXT
|
||||
#define GLX_AUX0_EXT 0x20E2
|
||||
#define GLX_AUX1_EXT 0x20E3
|
||||
#define GLX_AUX2_EXT 0x20E4
|
||||
#define GLX_AUX3_EXT 0x20E5
|
||||
#define GLX_AUX4_EXT 0x20E6
|
||||
#define GLX_AUX5_EXT 0x20E7
|
||||
#define GLX_AUX6_EXT 0x20E8
|
||||
#define GLX_AUX7_EXT 0x20E9
|
||||
#define GLX_AUX8_EXT 0x20EA
|
||||
#define GLX_AUX9_EXT 0x20EB
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
@@ -386,7 +347,7 @@ typedef struct {
|
||||
/* (as used in the GLX_OML_sync_control extension). */
|
||||
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
||||
#include <inttypes.h>
|
||||
#elif defined(__sun__) || defined(__digital__)
|
||||
#elif defined(__sun__)
|
||||
#include <inttypes.h>
|
||||
#if defined(__STDC__)
|
||||
#if defined(__arch64__)
|
||||
@@ -405,12 +366,8 @@ typedef unsigned long long int uint64_t;
|
||||
typedef long int int32_t;
|
||||
typedef long long int int64_t;
|
||||
typedef unsigned long long int uint64_t;
|
||||
#elif defined(_WIN32) && defined(__GNUC__)
|
||||
#elif defined(WIN32) && defined(__GNUC__)
|
||||
#include <stdint.h>
|
||||
#elif defined(_WIN32)
|
||||
typedef __int32 int32_t;
|
||||
typedef __int64 int64_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
#else
|
||||
#include <inttypes.h> /* Fallback option */
|
||||
#endif
|
||||
@@ -759,24 +716,6 @@ extern unsigned int glXGetAGPOffsetMESA (const void *);
|
||||
typedef unsigned int ( * PFNGLXGETAGPOFFSETMESAPROC) (const void *pointer);
|
||||
#endif
|
||||
|
||||
#ifndef GLX_EXT_fbconfig_packed_float
|
||||
#define GLX_EXT_fbconfig_packed_float 1
|
||||
#endif
|
||||
|
||||
#ifndef GLX_EXT_framebuffer_sRGB
|
||||
#define GLX_EXT_framebuffer_sRGB 1
|
||||
#endif
|
||||
|
||||
#ifndef GLX_EXT_texture_from_pixmap
|
||||
#define GLX_EXT_texture_from_pixmap 1
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
extern void glXBindTexImageEXT (Display *, GLXDrawable, int, const int *);
|
||||
extern void glXReleaseTexImageEXT (Display *, GLXDrawable, int);
|
||||
#endif /* GLX_GLXEXT_PROTOTYPES */
|
||||
typedef void ( * PFNGLXBINDTEXIMAGEEXTPROC) (Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list);
|
||||
typedef void ( * PFNGLXRELEASETEXIMAGEEXTPROC) (Display *dpy, GLXDrawable drawable, int buffer);
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@@ -237,26 +237,6 @@ struct __DRIinterfaceMethodsRec {
|
||||
GLboolean (*getMSCRate)(__DRInativeDisplay * dpy, __DRIid drawable,
|
||||
int32_t * numerator, int32_t * denominator);
|
||||
/*@}*/
|
||||
|
||||
/**
|
||||
* Reports areas of the given drawable which have been modified by the
|
||||
* driver.
|
||||
*
|
||||
* \param drawable which the drawing was done to.
|
||||
* \param rects rectangles affected, with the drawable origin as the
|
||||
* origin.
|
||||
* \param x X offset of the drawable within the screen (used in the
|
||||
* front_buffer case)
|
||||
* \param y Y offset of the drawable within the screen.
|
||||
* \param front_buffer boolean flag for whether the drawing to the
|
||||
* drawable was actually done directly to the front buffer (instead
|
||||
* of backing storage, for example)
|
||||
*/
|
||||
void (*reportDamage)(__DRInativeDisplay * dpy, int screen,
|
||||
__DRIid drawable,
|
||||
int x, int y,
|
||||
drm_clip_rect_t *rects, int num_rects,
|
||||
int front_buffer);
|
||||
};
|
||||
|
||||
|
||||
|
@@ -38,11 +38,17 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef CAPI
|
||||
#undef CAPI
|
||||
#endif
|
||||
#define CAPI
|
||||
|
||||
#define GL_CORE_SGI 1
|
||||
#define GL_CORE_MESA 2
|
||||
#define GL_CORE_APPLE 4
|
||||
|
||||
typedef struct __GLcontextRec __GLcontext;
|
||||
typedef struct __GLinterfaceRec __GLinterface;
|
||||
|
||||
/*
|
||||
** This file defines the interface between the GL core and the surrounding
|
||||
@@ -180,4 +186,334 @@ typedef struct __GLcontextModesRec {
|
||||
#define GLX_TEXTURE_2D_BIT_EXT 0x00000002
|
||||
#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004
|
||||
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
/*
|
||||
** Structure used for allocating and freeing drawable private memory.
|
||||
** (like software buffers, for example).
|
||||
**
|
||||
** The memory allocation routines are provided by the surrounding
|
||||
** "operating system" code, and they are to be used for allocating
|
||||
** software buffers and things which are associated with the drawable,
|
||||
** and used by any context which draws to that drawable. There are
|
||||
** separate memory allocation functions for drawables and contexts
|
||||
** since drawables and contexts can be created and destroyed independently
|
||||
** of one another, and the "operating system" may want to use separate
|
||||
** allocation arenas for each.
|
||||
**
|
||||
** The freePrivate function is filled in by the core routines when they
|
||||
** allocates software buffers, and stick them in "private". The freePrivate
|
||||
** function will destroy anything allocated to this drawable (to be called
|
||||
** when the drawable is destroyed).
|
||||
*/
|
||||
typedef struct __GLdrawableRegionRec __GLdrawableRegion;
|
||||
typedef struct __GLdrawableBufferRec __GLdrawableBuffer;
|
||||
typedef struct __GLdrawablePrivateRec __GLdrawablePrivate;
|
||||
|
||||
typedef struct __GLregionRectRec {
|
||||
/* lower left (inside the rectangle) */
|
||||
GLint x0, y0;
|
||||
/* upper right (outside the rectangle) */
|
||||
GLint x1, y1;
|
||||
} __GLregionRect;
|
||||
|
||||
struct __GLdrawableRegionRec {
|
||||
GLint numRects;
|
||||
__GLregionRect *rects;
|
||||
__GLregionRect boundingRect;
|
||||
};
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
/* masks for the buffers */
|
||||
#define __GL_FRONT_BUFFER_MASK 0x00000001
|
||||
#define __GL_FRONT_LEFT_BUFFER_MASK 0x00000001
|
||||
#define __GL_FRONT_RIGHT_BUFFER_MASK 0x00000002
|
||||
#define __GL_BACK_BUFFER_MASK 0x00000004
|
||||
#define __GL_BACK_LEFT_BUFFER_MASK 0x00000004
|
||||
#define __GL_BACK_RIGHT_BUFFER_MASK 0x00000008
|
||||
#define __GL_ACCUM_BUFFER_MASK 0x00000010
|
||||
#define __GL_DEPTH_BUFFER_MASK 0x00000020
|
||||
#define __GL_STENCIL_BUFFER_MASK 0x00000040
|
||||
#define __GL_AUX_BUFFER_MASK(i) (0x0000080 << (i))
|
||||
|
||||
#define __GL_ALL_BUFFER_MASK 0xffffffff
|
||||
|
||||
/* what Resize routines return if resize resorted to fallback case */
|
||||
#define __GL_BUFFER_FALLBACK 0x10
|
||||
|
||||
typedef void (*__GLbufFallbackInitFn)(__GLdrawableBuffer *buf,
|
||||
__GLdrawablePrivate *glPriv, GLint bits);
|
||||
typedef void (*__GLbufMainInitFn)(__GLdrawableBuffer *buf,
|
||||
__GLdrawablePrivate *glPriv, GLint bits,
|
||||
__GLbufFallbackInitFn back);
|
||||
|
||||
/*
|
||||
** A drawable buffer
|
||||
**
|
||||
** This data structure describes the context side of a drawable.
|
||||
**
|
||||
** According to the spec there could be multiple contexts bound to the same
|
||||
** drawable at the same time (from different threads). In order to avoid
|
||||
** multiple-access conflicts, locks are used to serialize access. When a
|
||||
** thread needs to access (read or write) a member of the drawable, it takes
|
||||
** a lock first. Some of the entries in the drawable are treated "mostly
|
||||
** constant", so we take the freedom of allowing access to them without
|
||||
** taking a lock (for optimization reasons).
|
||||
**
|
||||
** For more details regarding locking, see buffers.h in the GL core
|
||||
*/
|
||||
struct __GLdrawableBufferRec {
|
||||
/*
|
||||
** Buffer dimensions
|
||||
*/
|
||||
GLint width, height, depth;
|
||||
|
||||
/*
|
||||
** Framebuffer base address
|
||||
*/
|
||||
void *base;
|
||||
|
||||
/*
|
||||
** Framebuffer size (in bytes)
|
||||
*/
|
||||
GLuint size;
|
||||
|
||||
/*
|
||||
** Size (in bytes) of each element in the framebuffer
|
||||
*/
|
||||
GLuint elementSize;
|
||||
GLuint elementSizeLog2;
|
||||
|
||||
/*
|
||||
** Element skip from one scanline to the next.
|
||||
** If the buffer is part of another buffer (for example, fullscreen
|
||||
** front buffer), outerWidth is the width of that buffer.
|
||||
*/
|
||||
GLint outerWidth;
|
||||
|
||||
/*
|
||||
** outerWidth * elementSize
|
||||
*/
|
||||
GLint byteWidth;
|
||||
|
||||
/*
|
||||
** Allocation/deallocation is done based on this handle. A handle
|
||||
** is conceptually different from the framebuffer 'base'.
|
||||
*/
|
||||
void *handle;
|
||||
|
||||
/* imported */
|
||||
GLboolean (*resize)(__GLdrawableBuffer *buf,
|
||||
GLint x, GLint y, GLuint width, GLuint height,
|
||||
__GLdrawablePrivate *glPriv, GLuint bufferMask);
|
||||
void (*lock)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv);
|
||||
void (*unlock)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv);
|
||||
void (*fill)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv,
|
||||
GLuint val, GLint x, GLint y, GLint w, GLint h);
|
||||
void (*free)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv);
|
||||
|
||||
/* exported */
|
||||
void (*freePrivate)(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv);
|
||||
#ifdef __cplusplus
|
||||
void *privatePtr;
|
||||
#else
|
||||
void *private;
|
||||
#endif
|
||||
|
||||
/* private */
|
||||
void *other; /* implementation private data */
|
||||
__GLbufMainInitFn mainInit;
|
||||
__GLbufFallbackInitFn fallbackInit;
|
||||
};
|
||||
|
||||
/*
|
||||
** The context side of the drawable private
|
||||
*/
|
||||
struct __GLdrawablePrivateRec {
|
||||
/*
|
||||
** Drawable Modes
|
||||
*/
|
||||
__GLcontextModes *modes;
|
||||
|
||||
/*
|
||||
** Drawable size
|
||||
*/
|
||||
GLuint width, height;
|
||||
|
||||
/*
|
||||
** Origin in screen coordinates of the drawable
|
||||
*/
|
||||
GLint xOrigin, yOrigin;
|
||||
#ifdef __GL_ALIGNED_BUFFERS
|
||||
/*
|
||||
** Drawable offset from screen origin
|
||||
*/
|
||||
GLint xOffset, yOffset;
|
||||
|
||||
/*
|
||||
** Alignment restriction
|
||||
*/
|
||||
GLint xAlignment, yAlignment;
|
||||
#endif
|
||||
/*
|
||||
** Should we invert the y axis?
|
||||
*/
|
||||
GLint yInverted;
|
||||
|
||||
/*
|
||||
** Mask specifying which buffers are renderable by the hw
|
||||
*/
|
||||
GLuint accelBufferMask;
|
||||
|
||||
/*
|
||||
** the buffers themselves
|
||||
*/
|
||||
__GLdrawableBuffer frontBuffer;
|
||||
__GLdrawableBuffer backBuffer;
|
||||
__GLdrawableBuffer accumBuffer;
|
||||
__GLdrawableBuffer depthBuffer;
|
||||
__GLdrawableBuffer stencilBuffer;
|
||||
#if defined(__GL_NUMBER_OF_AUX_BUFFERS) && (__GL_NUMBER_OF_AUX_BUFFERS > 0)
|
||||
__GLdrawableBuffer *auxBuffer;
|
||||
#endif
|
||||
|
||||
__GLdrawableRegion ownershipRegion;
|
||||
|
||||
/*
|
||||
** Lock for the drawable private structure
|
||||
*/
|
||||
void *lock;
|
||||
#ifdef DEBUG
|
||||
/* lock debugging info */
|
||||
int lockRefCount;
|
||||
int lockLine[10];
|
||||
char *lockFile[10];
|
||||
#endif
|
||||
|
||||
/* imported */
|
||||
void *(*malloc)(size_t size);
|
||||
void *(*calloc)(size_t numElem, size_t elemSize);
|
||||
void *(*realloc)(void *oldAddr, size_t newSize);
|
||||
void (*free)(void *addr);
|
||||
|
||||
GLboolean (*addSwapRect)(__GLdrawablePrivate *glPriv,
|
||||
GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
void (*setClipRect)(__GLdrawablePrivate *glPriv,
|
||||
GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
void (*updateClipRegion)(__GLdrawablePrivate *glPriv);
|
||||
GLboolean (*resize)(__GLdrawablePrivate *glPriv);
|
||||
void (*getDrawableSize)(__GLdrawablePrivate *glPriv,
|
||||
GLint *x, GLint *y, GLuint *width, GLuint *height);
|
||||
|
||||
void (*lockDP)(__GLdrawablePrivate *glPriv, __GLcontext *gc);
|
||||
void (*unlockDP)(__GLdrawablePrivate *glPriv);
|
||||
|
||||
/* exported */
|
||||
#ifdef __cplusplus
|
||||
void *privatePtr;
|
||||
#else
|
||||
void *private;
|
||||
#endif
|
||||
void (*freePrivate)(__GLdrawablePrivate *);
|
||||
|
||||
/* client data */
|
||||
void *other;
|
||||
};
|
||||
|
||||
/*
|
||||
** Macros to lock/unlock the drawable private
|
||||
*/
|
||||
#if defined(DEBUG)
|
||||
#define __GL_LOCK_DP(glPriv,gc) \
|
||||
(*(glPriv)->lockDP)(glPriv,gc); \
|
||||
(glPriv)->lockLine[(glPriv)->lockRefCount] = __LINE__; \
|
||||
(glPriv)->lockFile[(glPriv)->lockRefCount] = __FILE__; \
|
||||
(glPriv)->lockRefCount++
|
||||
#define __GL_UNLOCK_DP(glPriv) \
|
||||
(glPriv)->lockRefCount--; \
|
||||
(glPriv)->lockLine[(glPriv)->lockRefCount] = 0; \
|
||||
(glPriv)->lockFile[(glPriv)->lockRefCount] = NULL; \
|
||||
(*(glPriv)->unlockDP)(glPriv)
|
||||
#else /* DEBUG */
|
||||
#define __GL_LOCK_DP(glPriv,gc) (*(glPriv)->lockDP)(glPriv,gc)
|
||||
#define __GL_UNLOCK_DP(glPriv) (*(glPriv)->unlockDP)(glPriv)
|
||||
#endif /* DEBUG */
|
||||
|
||||
|
||||
/*
|
||||
** Procedures which are imported by the GL from the surrounding
|
||||
** "operating system". Math functions are not considered part of the
|
||||
** "operating system".
|
||||
*/
|
||||
typedef struct __GLimportsRec {
|
||||
/* Memory management */
|
||||
void * (*malloc)(__GLcontext *gc, size_t size);
|
||||
void *(*calloc)(__GLcontext *gc, size_t numElem, size_t elemSize);
|
||||
void *(*realloc)(__GLcontext *gc, void *oldAddr, size_t newSize);
|
||||
void (*free)(__GLcontext *gc, void *addr);
|
||||
|
||||
/* Error handling */
|
||||
void (*warning)(__GLcontext *gc, char *fmt);
|
||||
void (*fatal)(__GLcontext *gc, char *fmt);
|
||||
|
||||
/* other system calls */
|
||||
char *(CAPI *getenv)(__GLcontext *gc, const char *var);
|
||||
int (CAPI *atoi)(__GLcontext *gc, const char *str);
|
||||
int (CAPI *sprintf)(__GLcontext *gc, char *str, const char *fmt, ...);
|
||||
void *(CAPI *fopen)(__GLcontext *gc, const char *path, const char *mode);
|
||||
int (CAPI *fclose)(__GLcontext *gc, void *stream);
|
||||
int (CAPI *fprintf)(__GLcontext *gc, void *stream, const char *fmt, ...);
|
||||
|
||||
/* Drawing surface management */
|
||||
__GLdrawablePrivate *(*getDrawablePrivate)(__GLcontext *gc);
|
||||
__GLdrawablePrivate *(*getReadablePrivate)(__GLcontext *gc);
|
||||
|
||||
/* Operating system dependent data goes here */
|
||||
void *other;
|
||||
} __GLimports;
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
/*
|
||||
** Procedures which are exported by the GL to the surrounding "operating
|
||||
** system" so that it can manage multiple GL context's.
|
||||
*/
|
||||
typedef struct __GLexportsRec {
|
||||
/* Context management (return GL_FALSE on failure) */
|
||||
GLboolean (*destroyContext)(__GLcontext *gc);
|
||||
GLboolean (*loseCurrent)(__GLcontext *gc);
|
||||
/* oldglPriv isn't used anymore, kept for backwards compatibility */
|
||||
GLboolean (*makeCurrent)(__GLcontext *gc);
|
||||
GLboolean (*shareContext)(__GLcontext *gc, __GLcontext *gcShare);
|
||||
GLboolean (*copyContext)(__GLcontext *dst, const __GLcontext *src, GLuint mask);
|
||||
GLboolean (*forceCurrent)(__GLcontext *gc);
|
||||
|
||||
/* Drawing surface notification callbacks */
|
||||
GLboolean (*notifyResize)(__GLcontext *gc);
|
||||
void (*notifyDestroy)(__GLcontext *gc);
|
||||
void (*notifySwapBuffers)(__GLcontext *gc);
|
||||
|
||||
/* Dispatch table override control for external agents like libGLS */
|
||||
struct __GLdispatchStateRec* (*dispatchExec)(__GLcontext *gc);
|
||||
void (*beginDispatchOverride)(__GLcontext *gc);
|
||||
void (*endDispatchOverride)(__GLcontext *gc);
|
||||
} __GLexports;
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
/*
|
||||
** This must be the first member of a __GLcontext structure. This is the
|
||||
** only part of a context that is exposed to the outside world; everything
|
||||
** else is opaque.
|
||||
*/
|
||||
struct __GLinterfaceRec {
|
||||
__GLimports imports;
|
||||
__GLexports exports;
|
||||
};
|
||||
|
||||
extern __GLcontext *__glCoreCreateContext(__GLimports *, __GLcontextModes *);
|
||||
extern void __glCoreNopDispatch(void);
|
||||
|
||||
#endif /* __gl_core_h_ */
|
||||
|
@@ -180,21 +180,6 @@ extern XMesaContext XMesaCreateContext( XMesaVisual v,
|
||||
extern void XMesaDestroyContext( XMesaContext c );
|
||||
|
||||
|
||||
#ifdef XFree86Server
|
||||
/*
|
||||
* These are the extra routines required for integration with XFree86.
|
||||
* None of these routines should be user visible. -KEM
|
||||
*/
|
||||
extern GLboolean XMesaForceCurrent( XMesaContext c );
|
||||
|
||||
extern GLboolean XMesaLoseCurrent( XMesaContext c );
|
||||
|
||||
extern GLboolean XMesaCopyContext( XMesaContext src,
|
||||
XMesaContext dst,
|
||||
GLuint mask );
|
||||
#endif /* XFree86Server */
|
||||
|
||||
|
||||
/*
|
||||
* Create an XMesaBuffer from an X window.
|
||||
*/
|
||||
|
@@ -41,7 +41,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
#include "scrnintstr.h"
|
||||
#include "pixmapstr.h"
|
||||
#include "gcstruct.h"
|
||||
|
||||
typedef struct _XMesaImageRec XMesaImage;
|
||||
|
||||
@@ -124,7 +123,8 @@ do { \
|
||||
do { \
|
||||
/* Assumes: Images are always in ZPixmap format */ \
|
||||
(void) __d; \
|
||||
ASSERT(!__sx && !__sy); /* The SubImage case */ \
|
||||
if (__sx || __sy) /* The non-trivial case */ \
|
||||
XMesaPutImageHelper(__d,__b,__gc,__i,__sx,__sy,__x,__y,__w,__h); \
|
||||
ValidateGC(__b, __gc); \
|
||||
(*__gc->ops->PutImage)(__b, __gc, ((XMesaDrawable)(__b))->depth, \
|
||||
__x, __y, __w, __h, 0, ZPixmap, \
|
||||
|
48
progs/demos/.cvsignore
Normal file
48
progs/demos/.cvsignore
Normal file
@@ -0,0 +1,48 @@
|
||||
.cvsignore
|
||||
arbfplight
|
||||
arbocclude
|
||||
bounce
|
||||
clearspd
|
||||
cubemap
|
||||
drawpix
|
||||
fire
|
||||
fplight
|
||||
gamma
|
||||
gears
|
||||
geartrain
|
||||
glinfo
|
||||
gloss
|
||||
gltestperf
|
||||
glutfx
|
||||
ipers
|
||||
isosurf
|
||||
lodbias
|
||||
morph3d
|
||||
multiarb
|
||||
occlude
|
||||
osdemo
|
||||
paltex
|
||||
pixeltex
|
||||
pointblast
|
||||
ray
|
||||
readpix
|
||||
readtex.c
|
||||
readtex.h
|
||||
reflect
|
||||
renormal
|
||||
shadowtex
|
||||
showbuffer.c
|
||||
showbuffer.h
|
||||
spectex
|
||||
stex3d
|
||||
teapot
|
||||
terrain
|
||||
tessdemo
|
||||
texcyl
|
||||
texdown
|
||||
texenv
|
||||
texobj
|
||||
trispd
|
||||
tunnel
|
||||
tunnel2
|
||||
winpos
|
@@ -113,46 +113,34 @@ trackball.o: trackball.c trackball.h
|
||||
$(CC) -c -I$(INCDIR) $(CFLAGS) trackball.c
|
||||
|
||||
|
||||
extfuncs.h: $(TOP)/progs/util/extfuncs.h
|
||||
cp $< .
|
||||
|
||||
|
||||
reflect: reflect.o showbuffer.o readtex.o
|
||||
$(CC) reflect.o showbuffer.o readtex.o $(APP_LIB_DEPS) -o $@
|
||||
$(CC) -I$(INCDIR) $(CFLAGS) reflect.o showbuffer.o readtex.o $(APP_LIB_DEPS) -o $@
|
||||
|
||||
reflect.o: reflect.c showbuffer.h
|
||||
$(CC) -c -I$(INCDIR) $(CFLAGS) reflect.c
|
||||
|
||||
|
||||
shadowtex: shadowtex.o showbuffer.o
|
||||
$(CC) shadowtex.o showbuffer.o $(APP_LIB_DEPS) -o $@
|
||||
$(CC) -I$(INCDIR) $(CFLAGS) shadowtex.o showbuffer.o $(APP_LIB_DEPS) -o $@
|
||||
|
||||
shadowtex.o: shadowtex.c showbuffer.h
|
||||
$(CC) -c -I$(INCDIR) $(CFLAGS) shadowtex.c
|
||||
|
||||
|
||||
gloss: gloss.o trackball.o readtex.o
|
||||
$(CC) gloss.o trackball.o readtex.o $(APP_LIB_DEPS) -o $@
|
||||
$(CC) -I$(INCDIR) $(CFLAGS) gloss.o trackball.o readtex.o $(APP_LIB_DEPS) -o $@
|
||||
|
||||
gloss.o: gloss.c trackball.h
|
||||
$(CC) -c -I$(INCDIR) $(CFLAGS) gloss.c
|
||||
|
||||
|
||||
engine: engine.o trackball.o readtex.o
|
||||
$(CC) engine.o trackball.o readtex.o $(APP_LIB_DEPS) -o $@
|
||||
$(CC) -I$(INCDIR) $(CFLAGS) engine.o trackball.o readtex.o $(APP_LIB_DEPS) -o $@
|
||||
|
||||
engine.o: engine.c trackball.h
|
||||
$(CC) -c -I$(INCDIR) $(CFLAGS) engine.c
|
||||
|
||||
|
||||
fslight: fslight.o
|
||||
$(CC) fslight.o $(APP_LIB_DEPS) -o $@
|
||||
|
||||
fslight.o: fslight.c extfuncs.h
|
||||
$(CC) -c -I$(INCDIR) $(CFLAGS) fslight.c
|
||||
|
||||
|
||||
|
||||
clean:
|
||||
-rm -f $(PROGS)
|
||||
-rm -f *.o *~
|
||||
|
@@ -22,11 +22,9 @@ LIBS = GLUT32.LIB OPENGL32.LIB
|
||||
|
||||
all: OPENGL32.DLL GLU32.DLL GLUT32.DLL \
|
||||
readtex.h readtex.c showbuffer.h showbuffer.c \
|
||||
extfuncs.h trackball.h trackball.c \
|
||||
arbfplight.exe arbfslight.exe arbocclude.exe bounce.exe \
|
||||
clearspd.exe cubemap.exe drawpix.exe engine.exe \
|
||||
fire.exe fogcoord.exe \
|
||||
fplight.exe fslight.exe gamma.exe gearbox.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 \
|
||||
@@ -44,16 +42,14 @@ bounce.exe: bounce.obj
|
||||
clearspd.exe: clearspd.obj
|
||||
cubemap.exe: cubemap.obj readtex.obj
|
||||
drawpix.exe: drawpix.obj readtex.obj
|
||||
engine.exe: engine.obj readtex.obj trackball.obj
|
||||
fire.exe: fire.obj readtex.obj
|
||||
fogcoord.exe: fogcoord.obj readtex.obj
|
||||
fplight.exe: fplight.obj
|
||||
fslight.exe: fslight.obj
|
||||
gamma.exe: gamma.obj
|
||||
gearbox.exe: gearbox.obj
|
||||
gears.exe: gears.obj
|
||||
geartrain.exe: geartrain.obj
|
||||
gloss.exe: gloss.obj readtex.obj trackball.obj
|
||||
gloss.exe: gloss.obj readtex.obj
|
||||
glinfo.exe: glinfo.obj
|
||||
glslnoise.exe: glslnoise.obj
|
||||
gltestperf.exe: gltestperf.obj
|
||||
@@ -109,23 +105,14 @@ showbuffer.c: $(TOP)\progs\util\showbuffer.c
|
||||
showbuffer.h: $(TOP)\progs\util\showbuffer.h
|
||||
copy $** .
|
||||
|
||||
trackball.c: $(TOP)\progs\util\trackball.c
|
||||
copy $** .
|
||||
|
||||
trackball.h: $(TOP)\progs\util\trackball.h
|
||||
copy $** .
|
||||
|
||||
extfuncs.h: $(TOP)\progs\util\extfuncs.h
|
||||
copy $** .
|
||||
|
||||
.obj.exe:
|
||||
$(link) $(ldebug) -out:$@ $** /LIBPATH:$(LIBDIR) $(LIBS)
|
||||
|
||||
.c.obj:
|
||||
$(cc) $(cdebug) $(cflags) $(cvars) -D_USE_MATH_DEFINES /I$(INCDIR) $*.c
|
||||
$(cc) $(cdebug) $(cflags) $(cvars) /I$(INCDIR) $*.c
|
||||
|
||||
clean::
|
||||
del *.obj *.exe readtex.* showbuffer.* trackball.*
|
||||
del *.obj *.exe readtex.* showbuffer.*
|
||||
|
||||
clobber::
|
||||
|
||||
|
@@ -24,7 +24,6 @@ static GLuint VertProg;
|
||||
static GLboolean Anim = GL_TRUE;
|
||||
static GLboolean Wire = GL_FALSE;
|
||||
static GLboolean PixelLight = GL_TRUE;
|
||||
static GLint Win;
|
||||
|
||||
static GLint T0 = 0;
|
||||
static GLint Frames = 0;
|
||||
@@ -149,7 +148,6 @@ static void Key( unsigned char key, int x, int y )
|
||||
case 27:
|
||||
glDeleteProgramsARB_func(1, &VertProg);
|
||||
glDeleteProgramsARB_func(1, &FragProg);
|
||||
glutDestroyWindow(Win);
|
||||
exit(0);
|
||||
break;
|
||||
}
|
||||
@@ -384,7 +382,7 @@ int main( int argc, char *argv[] )
|
||||
glutInitWindowPosition( 0, 0 );
|
||||
glutInitWindowSize( 200, 200 );
|
||||
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
|
||||
Win = glutCreateWindow(argv[0]);
|
||||
glutCreateWindow(argv[0]);
|
||||
glutReshapeFunc( Reshape );
|
||||
glutKeyboardFunc( Key );
|
||||
glutSpecialFunc( SpecialKey );
|
||||
|
@@ -62,7 +62,7 @@ static PFNGLUNIFORM3FVARBPROC glUniform4fvARB = NULL;
|
||||
|
||||
static void normalize (GLfloat *dst, const GLfloat *src)
|
||||
{
|
||||
GLfloat len = sqrt (src[0] * src[0] + src[1] * src[1] + src[2] * src[2]);
|
||||
GLfloat len = sqrtf (src[0] * src[0] + src[1] * src[1] + src[2] * src[2]);
|
||||
dst[0] = src[0] / len;
|
||||
dst[1] = src[1] / len;
|
||||
dst[2] = src[2] / len;
|
||||
|
@@ -7,136 +7,151 @@
|
||||
* Daniel Borca
|
||||
*/
|
||||
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <GL/glut.h>
|
||||
|
||||
#define DEPTH 5.0f
|
||||
#include "readtex.h"
|
||||
|
||||
static PFNGLFOGCOORDFEXTPROC glFogCoordf_ext;
|
||||
static PFNGLFOGCOORDPOINTEREXTPROC glFogCoordPointer_ext;
|
||||
#define TEXTURE_FILE "../images/bw.rgb"
|
||||
|
||||
#define ARRAYS 0 /* use glDrawElements */
|
||||
|
||||
#define VERBOSE 1 /* tell me what happens */
|
||||
|
||||
#define DEPTH 15.0f
|
||||
|
||||
#if !defined(GLAPIENTRYP)
|
||||
# define GLAPIENTRYP *
|
||||
#endif
|
||||
|
||||
typedef void (GLAPIENTRYP GLFOGCOORDFEXTPROC) (GLfloat f);
|
||||
typedef void (GLAPIENTRYP GLFOGCOORDPOINTEREXTPROC) (GLenum, GLsizei, const GLvoid *);
|
||||
|
||||
static GLFOGCOORDFEXTPROC glFogCoordf_ext;
|
||||
#if ARRAYS
|
||||
static GLFOGCOORDPOINTEREXTPROC glFogCoordPointer_ext;
|
||||
#endif
|
||||
static GLboolean have_fog_coord;
|
||||
|
||||
static GLfloat camz;
|
||||
static GLuint texture[1];
|
||||
|
||||
static GLint fogMode;
|
||||
static GLboolean fogCoord;
|
||||
static GLfloat fogDensity = 0.75;
|
||||
static GLfloat fogStart = 1.0, fogEnd = DEPTH;
|
||||
static GLfloat fogStart = 1.0, fogEnd = 40.0;
|
||||
static GLfloat fogColor[4] = {0.6f, 0.3f, 0.0f, 1.0f};
|
||||
static const char *ModeStr = NULL;
|
||||
static GLboolean Arrays = GL_FALSE;
|
||||
static GLboolean Texture = GL_TRUE;
|
||||
|
||||
|
||||
static void
|
||||
Reset(void)
|
||||
{
|
||||
fogMode = 1;
|
||||
fogCoord = 1;
|
||||
fogDensity = 0.75;
|
||||
fogStart = 1.0;
|
||||
fogEnd = DEPTH;
|
||||
Arrays = GL_FALSE;
|
||||
Texture = GL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
static void APIENTRY
|
||||
glFogCoordf_nop (GLfloat f)
|
||||
static void APIENTRY glFogCoordf_nop (GLfloat f)
|
||||
{
|
||||
(void)f;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
PrintString(const char *s)
|
||||
static int BuildTexture (const char *filename, GLuint texid[])
|
||||
{
|
||||
while (*s) {
|
||||
glutBitmapCharacter(GLUT_BITMAP_8_BY_13, (int) *s);
|
||||
s++;
|
||||
GLubyte *tex_data;
|
||||
GLenum tex_format;
|
||||
GLint tex_width, tex_height;
|
||||
|
||||
tex_data = LoadRGBImage(filename, &tex_width, &tex_height, &tex_format);
|
||||
if (tex_data == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
{
|
||||
GLint tex_max;
|
||||
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &tex_max);
|
||||
if ((tex_width > tex_max) || (tex_height > tex_max)) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
glGenTextures(1, texid);
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, texid[0]);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, tex_format, tex_width, tex_height, 0,
|
||||
tex_format, GL_UNSIGNED_BYTE, tex_data);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
PrintInfo(void)
|
||||
{
|
||||
char s[100];
|
||||
|
||||
glDisable(GL_FOG);
|
||||
glColor3f(0, 1, 1);
|
||||
|
||||
sprintf(s, "Mode(m): %s Start(s/S): %g End(e/E): %g Density(d/D): %g",
|
||||
ModeStr, fogStart, fogEnd, fogDensity);
|
||||
glWindowPos2iARB(5, 20);
|
||||
PrintString(s);
|
||||
|
||||
sprintf(s, "Arrays(a): %s glFogCoord(c): %s EyeZ(z/z): %g",
|
||||
(Arrays ? "Yes" : "No"),
|
||||
(fogCoord ? "Yes" : "No"),
|
||||
camz);
|
||||
glWindowPos2iARB(5, 5);
|
||||
PrintString(s);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
SetFogMode(GLint fogMode)
|
||||
static int SetFogMode (GLint fogMode)
|
||||
{
|
||||
fogMode &= 3;
|
||||
switch (fogMode) {
|
||||
case 0:
|
||||
ModeStr = "Off";
|
||||
glDisable(GL_FOG);
|
||||
#if VERBOSE
|
||||
printf("fog(disable)\n");
|
||||
#endif
|
||||
break;
|
||||
case 1:
|
||||
ModeStr = "GL_LINEAR";
|
||||
glEnable(GL_FOG);
|
||||
glFogi(GL_FOG_MODE, GL_LINEAR);
|
||||
glFogf(GL_FOG_START, fogStart);
|
||||
glFogf(GL_FOG_END, fogEnd);
|
||||
#if VERBOSE
|
||||
printf("fog(GL_LINEAR, %.2f, %.2f)\n", fogStart, fogEnd);
|
||||
#endif
|
||||
break;
|
||||
case 2:
|
||||
ModeStr = "GL_EXP";
|
||||
glEnable(GL_FOG);
|
||||
glFogi(GL_FOG_MODE, GL_EXP);
|
||||
glFogf(GL_FOG_DENSITY, fogDensity);
|
||||
#if VERBOSE
|
||||
printf("fog(GL_EXP, %.2f)\n", fogDensity);
|
||||
#endif
|
||||
break;
|
||||
case 3:
|
||||
ModeStr = "GL_EXP2";
|
||||
glEnable(GL_FOG);
|
||||
glFogi(GL_FOG_MODE, GL_EXP2);
|
||||
glFogf(GL_FOG_DENSITY, fogDensity);
|
||||
#if VERBOSE
|
||||
printf("fog(GL_EXP2, %.2f)\n", fogDensity);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
return fogMode;
|
||||
}
|
||||
|
||||
|
||||
static GLboolean
|
||||
SetFogCoord(GLboolean fogCoord)
|
||||
static GLboolean SetFogCoord (GLboolean fogCoord)
|
||||
{
|
||||
glFogCoordf_ext = glFogCoordf_nop;
|
||||
|
||||
if (!have_fog_coord) {
|
||||
#if VERBOSE
|
||||
printf("fog(GL_FRAGMENT_DEPTH_EXT)%s\n", fogCoord ? " EXT_fog_coord not available!" : "");
|
||||
#endif
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
if (fogCoord) {
|
||||
glFogCoordf_ext = (PFNGLFOGCOORDFEXTPROC)glutGetProcAddress("glFogCoordfEXT");
|
||||
glFogCoordf_ext = (GLFOGCOORDFEXTPROC)glutGetProcAddress("glFogCoordfEXT");
|
||||
glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FOG_COORDINATE_EXT);
|
||||
}
|
||||
else {
|
||||
#if VERBOSE
|
||||
printf("fog(GL_FOG_COORDINATE_EXT)\n");
|
||||
#endif
|
||||
} else {
|
||||
glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FRAGMENT_DEPTH_EXT);
|
||||
#if VERBOSE
|
||||
printf("fog(GL_FRAGMENT_DEPTH_EXT)\n");
|
||||
#endif
|
||||
}
|
||||
return fogCoord;
|
||||
}
|
||||
|
||||
|
||||
#if ARRAYS
|
||||
/* could reuse vertices */
|
||||
static GLuint vertex_index[] = {
|
||||
/* Back */
|
||||
@@ -157,19 +172,19 @@ static GLuint vertex_index[] = {
|
||||
|
||||
static GLfloat vertex_pointer[][3] = {
|
||||
/* Back */
|
||||
{-1.0f,-1.0f,-DEPTH}, { 1.0f,-1.0f,-DEPTH}, { 1.0f, 1.0f,-DEPTH}, {-1.0f, 1.0f,-DEPTH},
|
||||
{-2.5f,-2.5f,-DEPTH}, { 2.5f,-2.5f,-DEPTH}, { 2.5f, 2.5f,-DEPTH}, {-2.5f, 2.5f,-DEPTH},
|
||||
|
||||
/* Floor */
|
||||
{-1.0f,-1.0f,-DEPTH}, { 1.0f,-1.0f,-DEPTH}, { 1.0f,-1.0f, 0.0}, {-1.0f,-1.0f, 0.0},
|
||||
{-2.5f,-2.5f,-DEPTH}, { 2.5f,-2.5f,-DEPTH}, { 2.5f,-2.5f, DEPTH}, {-2.5f,-2.5f, DEPTH},
|
||||
|
||||
/* Roof */
|
||||
{-1.0f, 1.0f,-DEPTH}, { 1.0f, 1.0f,-DEPTH}, { 1.0f, 1.0f, 0.0}, {-1.0f, 1.0f, 0.0},
|
||||
{-2.5f, 2.5f,-DEPTH}, { 2.5f, 2.5f,-DEPTH}, { 2.5f, 2.5f, DEPTH}, {-2.5f, 2.5f, DEPTH},
|
||||
|
||||
/* Right */
|
||||
{ 1.0f,-1.0f, 0.0}, { 1.0f, 1.0f, 0.0}, { 1.0f, 1.0f,-DEPTH}, { 1.0f,-1.0f,-DEPTH},
|
||||
{ 2.5f,-2.5f, DEPTH}, { 2.5f, 2.5f, DEPTH}, { 2.5f, 2.5f,-DEPTH}, { 2.5f,-2.5f,-DEPTH},
|
||||
|
||||
/* Left */
|
||||
{-1.0f,-1.0f, 0.0}, {-1.0f, 1.0f, 0.0}, {-1.0f, 1.0f,-DEPTH}, {-1.0f,-1.0f,-DEPTH}
|
||||
{-2.5f,-2.5f, DEPTH}, {-2.5f, 2.5f, DEPTH}, {-2.5f, 2.5f,-DEPTH}, {-2.5f,-2.5f,-DEPTH}
|
||||
};
|
||||
|
||||
static GLfloat texcoord_pointer[][2] = {
|
||||
@@ -177,139 +192,118 @@ static GLfloat texcoord_pointer[][2] = {
|
||||
{0.0f, 0.0f}, {1.0f, 0.0f}, {1.0f, 1.0f}, {0.0f, 1.0f},
|
||||
|
||||
/* Floor */
|
||||
{0.0f, 0.0f}, {1.0f, 0.0f}, {1.0f, DEPTH}, {0.0f, DEPTH},
|
||||
{0.0f, 0.0f}, {1.0f, 0.0f}, {1.0f, 1.0f}, {0.0f, 1.0f},
|
||||
|
||||
/* Roof */
|
||||
{1.0f, 0.0f}, {0.0f, 0.0f}, {0.0f, DEPTH}, {1.0f, DEPTH},
|
||||
{0.0f, 0.0f}, {1.0f, 0.0f}, {1.0f, 1.0f}, {0.0f, 1.0f},
|
||||
|
||||
/* Right */
|
||||
{0.0f, 1.0f}, {0.0f, 0.0f}, {DEPTH, 0.0f}, {DEPTH, 1.0f},
|
||||
{0.0f, 0.0f}, {0.0f, 1.0f}, {1.0f, 1.0f}, {1.0f, 0.0f},
|
||||
|
||||
/* Left */
|
||||
{0.0f, 0.0f}, {0.0f, 1.0f}, {DEPTH, 1.0f}, {DEPTH, 0.0f}
|
||||
{0.0f, 0.0f}, {0.0f, 1.0f}, {1.0f, 1.0f}, {1.0f, 0.0f}
|
||||
};
|
||||
|
||||
static GLfloat fogcoord_pointer[] = {
|
||||
static GLfloat fogcoord_pointer[][1] = {
|
||||
/* Back */
|
||||
DEPTH, DEPTH, DEPTH, DEPTH,
|
||||
{1.0f}, {1.0f}, {1.0f}, {1.0f},
|
||||
|
||||
/* Floor */
|
||||
DEPTH, DEPTH, 0.0, 0.0,
|
||||
{1.0f}, {1.0f}, {0.0f}, {0.0f},
|
||||
|
||||
/* Roof */
|
||||
DEPTH, DEPTH, 0.0, 0.0,
|
||||
{1.0f}, {1.0f}, {0.0f}, {0.0f},
|
||||
|
||||
/* Right */
|
||||
0.0, 0.0, DEPTH, DEPTH,
|
||||
{0.0f}, {0.0f}, {1.0f}, {1.0f},
|
||||
|
||||
/* Left */
|
||||
0.0, 0.0, DEPTH, DEPTH
|
||||
{0.0f}, {0.0f}, {1.0f}, {1.0f}
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
static void
|
||||
Display( void )
|
||||
static void Display( void )
|
||||
{
|
||||
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
glLoadIdentity ();
|
||||
|
||||
glTranslatef(0.0f, 0.0f, -camz);
|
||||
glTranslatef(0.0f, 0.0f, camz);
|
||||
|
||||
SetFogMode(fogMode);
|
||||
#if ARRAYS
|
||||
glDrawElements(GL_QUADS, sizeof(vertex_index) / sizeof(vertex_index[0]), GL_UNSIGNED_INT, vertex_index);
|
||||
#else
|
||||
/* Back */
|
||||
glBegin(GL_QUADS);
|
||||
glFogCoordf_ext(1.0f); glTexCoord2f(0.0f, 0.0f); glVertex3f(-2.5f,-2.5f,-DEPTH);
|
||||
glFogCoordf_ext(1.0f); glTexCoord2f(1.0f, 0.0f); glVertex3f( 2.5f,-2.5f,-DEPTH);
|
||||
glFogCoordf_ext(1.0f); glTexCoord2f(1.0f, 1.0f); glVertex3f( 2.5f, 2.5f,-DEPTH);
|
||||
glFogCoordf_ext(1.0f); glTexCoord2f(0.0f, 1.0f); glVertex3f(-2.5f, 2.5f,-DEPTH);
|
||||
glEnd();
|
||||
|
||||
glColor3f(1, 1, 1);
|
||||
/* Floor */
|
||||
glBegin(GL_QUADS);
|
||||
glFogCoordf_ext(1.0f); glTexCoord2f(0.0f, 0.0f); glVertex3f(-2.5f,-2.5f,-DEPTH);
|
||||
glFogCoordf_ext(1.0f); glTexCoord2f(1.0f, 0.0f); glVertex3f( 2.5f,-2.5f,-DEPTH);
|
||||
glFogCoordf_ext(0.0f); glTexCoord2f(1.0f, 1.0f); glVertex3f( 2.5f,-2.5f, DEPTH);
|
||||
glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, 1.0f); glVertex3f(-2.5f,-2.5f, DEPTH);
|
||||
glEnd();
|
||||
|
||||
if (Texture)
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
/* Roof */
|
||||
glBegin(GL_QUADS);
|
||||
glFogCoordf_ext(1.0f); glTexCoord2f(0.0f, 0.0f); glVertex3f(-2.5f, 2.5f,-DEPTH);
|
||||
glFogCoordf_ext(1.0f); glTexCoord2f(1.0f, 0.0f); glVertex3f( 2.5f, 2.5f,-DEPTH);
|
||||
glFogCoordf_ext(0.0f); glTexCoord2f(1.0f, 1.0f); glVertex3f( 2.5f, 2.5f, DEPTH);
|
||||
glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, 1.0f); glVertex3f(-2.5f, 2.5f, DEPTH);
|
||||
glEnd();
|
||||
|
||||
if (Arrays) {
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glDrawElements(GL_QUADS, sizeof(vertex_index) / sizeof(vertex_index[0]),
|
||||
GL_UNSIGNED_INT, vertex_index);
|
||||
glDisableClientState(GL_VERTEX_ARRAY);
|
||||
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
}
|
||||
else {
|
||||
/* Back */
|
||||
glBegin(GL_QUADS);
|
||||
glFogCoordf_ext(DEPTH); glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f,-1.0f,-DEPTH);
|
||||
glFogCoordf_ext(DEPTH); glTexCoord2f(1.0f, 0.0f); glVertex3f( 1.0f,-1.0f,-DEPTH);
|
||||
glFogCoordf_ext(DEPTH); glTexCoord2f(1.0f, 1.0f); glVertex3f( 1.0f, 1.0f,-DEPTH);
|
||||
glFogCoordf_ext(DEPTH); glTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f, 1.0f,-DEPTH);
|
||||
glEnd();
|
||||
/* Right */
|
||||
glBegin(GL_QUADS);
|
||||
glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, 0.0f); glVertex3f( 2.5f,-2.5f, DEPTH);
|
||||
glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, 1.0f); glVertex3f( 2.5f, 2.5f, DEPTH);
|
||||
glFogCoordf_ext(1.0f); glTexCoord2f(1.0f, 1.0f); glVertex3f( 2.5f, 2.5f,-DEPTH);
|
||||
glFogCoordf_ext(1.0f); glTexCoord2f(1.0f, 0.0f); glVertex3f( 2.5f,-2.5f,-DEPTH);
|
||||
glEnd();
|
||||
|
||||
/* Floor */
|
||||
glBegin(GL_QUADS);
|
||||
glFogCoordf_ext(DEPTH); glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f,-1.0f,-DEPTH);
|
||||
glFogCoordf_ext(DEPTH); glTexCoord2f(1.0f, 0.0f); glVertex3f( 1.0f,-1.0f,-DEPTH);
|
||||
glFogCoordf_ext(0.0f); glTexCoord2f(1.0f, DEPTH); glVertex3f( 1.0f,-1.0f,0.0);
|
||||
glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, DEPTH); glVertex3f(-1.0f,-1.0f,0.0);
|
||||
glEnd();
|
||||
|
||||
/* Roof */
|
||||
glBegin(GL_QUADS);
|
||||
glFogCoordf_ext(DEPTH); glTexCoord2f(1.0f, 0.0f); glVertex3f(-1.0f, 1.0f,-DEPTH);
|
||||
glFogCoordf_ext(DEPTH); glTexCoord2f(0.0f, 0.0f); glVertex3f( 1.0f, 1.0f,-DEPTH);
|
||||
glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, DEPTH); glVertex3f( 1.0f, 1.0f,0.0);
|
||||
glFogCoordf_ext(0.0f); glTexCoord2f(1.0f, DEPTH); glVertex3f(-1.0f, 1.0f,0.0);
|
||||
glEnd();
|
||||
|
||||
/* Right */
|
||||
glBegin(GL_QUADS);
|
||||
glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, 1.0f); glVertex3f( 1.0f,-1.0f,0.0);
|
||||
glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, 0.0f); glVertex3f( 1.0f, 1.0f,0.0);
|
||||
glFogCoordf_ext(DEPTH); glTexCoord2f(DEPTH, 0.0f); glVertex3f( 1.0f, 1.0f,-DEPTH);
|
||||
glFogCoordf_ext(DEPTH); glTexCoord2f(DEPTH, 1.0f); glVertex3f( 1.0f,-1.0f,-DEPTH);
|
||||
glEnd();
|
||||
|
||||
/* Left */
|
||||
glBegin(GL_QUADS);
|
||||
glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f,-1.0f,0.0);
|
||||
glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f, 1.0f,0.0);
|
||||
glFogCoordf_ext(DEPTH); glTexCoord2f(DEPTH, 1.0f); glVertex3f(-1.0f, 1.0f,-DEPTH);
|
||||
glFogCoordf_ext(DEPTH); glTexCoord2f(DEPTH, 0.0f); glVertex3f(-1.0f,-1.0f,-DEPTH);
|
||||
glEnd();
|
||||
}
|
||||
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
|
||||
PrintInfo();
|
||||
/* Left */
|
||||
glBegin(GL_QUADS);
|
||||
glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, 0.0f); glVertex3f(-2.5f,-2.5f, DEPTH);
|
||||
glFogCoordf_ext(0.0f); glTexCoord2f(0.0f, 1.0f); glVertex3f(-2.5f, 2.5f, DEPTH);
|
||||
glFogCoordf_ext(1.0f); glTexCoord2f(1.0f, 1.0f); glVertex3f(-2.5f, 2.5f,-DEPTH);
|
||||
glFogCoordf_ext(1.0f); glTexCoord2f(1.0f, 0.0f); glVertex3f(-2.5f,-2.5f,-DEPTH);
|
||||
glEnd();
|
||||
#endif
|
||||
|
||||
glutSwapBuffers();
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Reshape( int width, int height )
|
||||
static void Reshape( int width, int height )
|
||||
{
|
||||
glViewport(0, 0, width, height);
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glFrustum(-1, 1, -1, 1, 1.0, 100);
|
||||
gluPerspective(45.0f, (GLfloat)(width)/(GLfloat)(height), 0.1f, 100.0f);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Key( unsigned char key, int x, int y )
|
||||
static void Key( unsigned char key, int x, int y )
|
||||
{
|
||||
(void) x;
|
||||
(void) y;
|
||||
switch (key) {
|
||||
case 'a':
|
||||
Arrays = !Arrays;
|
||||
break;
|
||||
case 'f':
|
||||
case 'm':
|
||||
fogMode = SetFogMode(fogMode + 1);
|
||||
break;
|
||||
case 'D':
|
||||
fogDensity += 0.05;
|
||||
case '+':
|
||||
if (fogDensity < 1.0) {
|
||||
fogDensity += 0.05;
|
||||
}
|
||||
SetFogMode(fogMode);
|
||||
break;
|
||||
case 'd':
|
||||
case '-':
|
||||
if (fogDensity > 0.0) {
|
||||
fogDensity -= 0.05;
|
||||
}
|
||||
@@ -317,43 +311,31 @@ Key( unsigned char key, int x, int y )
|
||||
break;
|
||||
case 's':
|
||||
if (fogStart > 0.0) {
|
||||
fogStart -= 0.25;
|
||||
fogStart -= 1.0;
|
||||
}
|
||||
SetFogMode(fogMode);
|
||||
break;
|
||||
case 'S':
|
||||
if (fogStart < 100.0) {
|
||||
fogStart += 0.25;
|
||||
if (fogStart < fogEnd) {
|
||||
fogStart += 1.0;
|
||||
}
|
||||
SetFogMode(fogMode);
|
||||
break;
|
||||
case 'e':
|
||||
if (fogEnd > 0.0) {
|
||||
fogEnd -= 0.25;
|
||||
if (fogEnd > fogStart) {
|
||||
fogEnd -= 1.0;
|
||||
}
|
||||
SetFogMode(fogMode);
|
||||
break;
|
||||
case 'E':
|
||||
if (fogEnd < 100.0) {
|
||||
fogEnd += 0.25;
|
||||
fogEnd += 1.0;
|
||||
}
|
||||
SetFogMode(fogMode);
|
||||
break;
|
||||
case 'c':
|
||||
fogCoord = SetFogCoord(fogCoord ^ GL_TRUE);
|
||||
break;
|
||||
case 't':
|
||||
Texture = !Texture;
|
||||
break;
|
||||
case 'z':
|
||||
camz -= 0.1;
|
||||
break;
|
||||
case 'Z':
|
||||
camz += 0.1;
|
||||
break;
|
||||
case 'r':
|
||||
Reset();
|
||||
break;
|
||||
case 27:
|
||||
exit(0);
|
||||
break;
|
||||
@@ -362,28 +344,37 @@ Key( unsigned char key, int x, int y )
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Init(void)
|
||||
static void SpecialKey( int key, int x, int y )
|
||||
{
|
||||
static const GLubyte teximage[2][2][4] = {
|
||||
{ { 255, 255, 255, 255}, { 128, 128, 128, 255} },
|
||||
{ { 128, 128, 128, 255}, { 255, 255, 255, 255} }
|
||||
};
|
||||
(void) x;
|
||||
(void) y;
|
||||
switch (key) {
|
||||
case GLUT_KEY_UP:
|
||||
if (camz < (DEPTH - 1.0)) {
|
||||
camz += 1.0f;
|
||||
}
|
||||
break;
|
||||
case GLUT_KEY_DOWN:
|
||||
if (camz > -19.0) {
|
||||
camz -= 1.0f;
|
||||
}
|
||||
break;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
|
||||
|
||||
static void Init( void )
|
||||
{
|
||||
have_fog_coord = glutExtensionSupported("GL_EXT_fog_coord");
|
||||
if (!have_fog_coord) {
|
||||
printf("GL_EXT_fog_coord not supported!\n");
|
||||
|
||||
if (BuildTexture(TEXTURE_FILE, texture) == -1) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 2, 2, 0,
|
||||
GL_RGBA, GL_UNSIGNED_BYTE, teximage);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
|
||||
glClearColor(0.1f, 0.1f, 0.1f, 0.0f);
|
||||
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
|
||||
glClearDepth(1.0f);
|
||||
glDepthFunc(GL_LEQUAL);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glShadeModel(GL_SMOOTH);
|
||||
@@ -392,8 +383,11 @@ Init(void)
|
||||
glFogfv(GL_FOG_COLOR, fogColor);
|
||||
glHint(GL_FOG_HINT, GL_NICEST);
|
||||
fogCoord = SetFogCoord(GL_TRUE); /* try to enable fog_coord */
|
||||
fogMode = SetFogMode(1);
|
||||
fogMode = SetFogMode(2); /* GL_EXP */
|
||||
|
||||
camz = -19.0f;
|
||||
|
||||
#if ARRAYS
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
glVertexPointer(3, GL_FLOAT, 0, vertex_pointer);
|
||||
|
||||
@@ -401,24 +395,24 @@ Init(void)
|
||||
glTexCoordPointer(2, GL_FLOAT, 0, texcoord_pointer);
|
||||
|
||||
if (have_fog_coord) {
|
||||
glFogCoordPointer_ext = (PFNGLFOGCOORDPOINTEREXTPROC)glutGetProcAddress("glFogCoordPointerEXT");
|
||||
glFogCoordPointer_ext = (GLFOGCOORDPOINTEREXTPROC)glutGetProcAddress("glFogCoordPointerEXT");
|
||||
glEnableClientState(GL_FOG_COORDINATE_ARRAY_EXT);
|
||||
glFogCoordPointer_ext(GL_FLOAT, 0, fogcoord_pointer);
|
||||
}
|
||||
|
||||
Reset();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main( int argc, char *argv[] )
|
||||
int main( int argc, char *argv[] )
|
||||
{
|
||||
glutInit( &argc, argv );
|
||||
glutInitWindowSize( 600, 600 );
|
||||
glutInitWindowPosition( 0, 0 );
|
||||
glutInitWindowSize( 640, 480 );
|
||||
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
|
||||
glutCreateWindow(argv[0]);
|
||||
glutReshapeFunc( Reshape );
|
||||
glutKeyboardFunc( Key );
|
||||
glutSpecialFunc( SpecialKey );
|
||||
glutDisplayFunc( Display );
|
||||
Init();
|
||||
glutMainLoop();
|
||||
|
@@ -24,7 +24,7 @@ static GLuint VertProg;
|
||||
static GLboolean Anim = GL_TRUE;
|
||||
static GLboolean Wire = GL_FALSE;
|
||||
static GLboolean PixelLight = GL_TRUE;
|
||||
static GLint Win;
|
||||
|
||||
static GLfloat Xrot = 0, Yrot = 0;
|
||||
|
||||
|
||||
@@ -136,8 +136,8 @@ static void Key( unsigned char key, int x, int y )
|
||||
}
|
||||
break;
|
||||
case 27:
|
||||
glutDestroyWindow(Win);
|
||||
exit(0);
|
||||
break;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
@@ -272,7 +272,7 @@ int main( int argc, char *argv[] )
|
||||
glutInitWindowPosition( 0, 0 );
|
||||
glutInitWindowSize( 200, 200 );
|
||||
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
|
||||
Win = glutCreateWindow(argv[0]);
|
||||
glutCreateWindow(argv[0]);
|
||||
glutReshapeFunc( Reshape );
|
||||
glutKeyboardFunc( Key );
|
||||
glutSpecialFunc( SpecialKey );
|
||||
|
@@ -20,30 +20,20 @@
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glut.h>
|
||||
#include <GL/glext.h>
|
||||
#include "extfuncs.h"
|
||||
|
||||
|
||||
#define TEXTURE 0
|
||||
|
||||
static GLint CoordAttrib = 0;
|
||||
|
||||
static char *FragProgFile = NULL;
|
||||
static char *VertProgFile = NULL;
|
||||
|
||||
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, 0.0f };
|
||||
static GLfloat lightPos[4] = { 0.0f, 10.0f, 20.0f, 1.0f };
|
||||
static GLfloat delta = 1.0f;
|
||||
|
||||
static GLuint fragShader;
|
||||
static GLuint vertShader;
|
||||
static GLuint program;
|
||||
|
||||
static GLint uLightPos;
|
||||
static GLint uDiffuse;
|
||||
static GLint uSpecular;
|
||||
static GLint uTexture;
|
||||
|
||||
static GLuint SphereList, RectList, CurList;
|
||||
static GLint win = 0;
|
||||
static GLboolean anim = GL_TRUE;
|
||||
static GLboolean wire = GL_FALSE;
|
||||
@@ -52,47 +42,58 @@ static GLboolean pixelLight = GL_TRUE;
|
||||
static GLint t0 = 0;
|
||||
static GLint frames = 0;
|
||||
|
||||
static GLfloat xRot = 90.0f, yRot = 0.0f;
|
||||
static GLfloat xRot = 0.0f, yRot = 0.0f;
|
||||
|
||||
static PFNGLCREATESHADERPROC glCreateShader_func = NULL;
|
||||
static PFNGLSHADERSOURCEPROC glShaderSource_func = NULL;
|
||||
static PFNGLGETSHADERSOURCEPROC glGetShaderSource_func = NULL;
|
||||
static PFNGLCOMPILESHADERPROC glCompileShader_func = NULL;
|
||||
static PFNGLCREATEPROGRAMPROC glCreateProgram_func = NULL;
|
||||
static PFNGLDELETEPROGRAMPROC glDeleteProgram_func = NULL;
|
||||
static PFNGLDELETESHADERPROC glDeleteShader_func = NULL;
|
||||
static PFNGLATTACHSHADERPROC glAttachShader_func = NULL;
|
||||
static PFNGLLINKPROGRAMPROC glLinkProgram_func = NULL;
|
||||
static PFNGLUSEPROGRAMPROC glUseProgram_func = NULL;
|
||||
static PFNGLGETUNIFORMLOCATIONPROC glGetUniformLocation_func = NULL;
|
||||
static PFNGLISPROGRAMPROC glIsProgram_func = NULL;
|
||||
static PFNGLISSHADERPROC glIsShader_func = NULL;
|
||||
static PFNGLUNIFORM3FVPROC glUniform3fv_func = NULL;
|
||||
static PFNGLUNIFORM3FVPROC glUniform4fv_func = NULL;
|
||||
|
||||
|
||||
|
||||
static void
|
||||
normalize(GLfloat *dst, const GLfloat *src)
|
||||
{
|
||||
GLfloat len = sqrt(src[0] * src[0] + src[1] * src[1] + src[2] * src[2]);
|
||||
GLfloat len = sqrtf(src[0] * src[0] + src[1] * src[1] + src[2] * src[2]);
|
||||
dst[0] = src[0] / len;
|
||||
dst[1] = src[1] / len;
|
||||
dst[2] = src[2] / len;
|
||||
dst[3] = src[3];
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Redisplay(void)
|
||||
{
|
||||
GLfloat vec[4];
|
||||
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
/* update light position */
|
||||
normalize(vec, lightPos);
|
||||
glLightfv(GL_LIGHT0, GL_POSITION, vec);
|
||||
|
||||
if (pixelLight) {
|
||||
GLfloat vec[3];
|
||||
glUseProgram_func(program);
|
||||
normalize(vec, lightPos);
|
||||
glUniform3fv_func(uLightPos, 1, vec);
|
||||
glDisable(GL_LIGHTING);
|
||||
}
|
||||
else {
|
||||
glUseProgram_func(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);
|
||||
*/
|
||||
glCallList(CurList);
|
||||
glPopMatrix();
|
||||
|
||||
glutSwapBuffers();
|
||||
@@ -173,12 +174,6 @@ Key(unsigned char key, int x, int y)
|
||||
else
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
|
||||
break;
|
||||
case 'o':
|
||||
if (CurList == SphereList)
|
||||
CurList = RectList;
|
||||
else
|
||||
CurList = SphereList;
|
||||
break;
|
||||
case 'p':
|
||||
pixelLight = !pixelLight;
|
||||
if (pixelLight)
|
||||
@@ -221,249 +216,17 @@ SpecialKey(int key, int x, int y)
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
TestFunctions(void)
|
||||
{
|
||||
printf("Error 0x%x at line %d\n", glGetError(), __LINE__);
|
||||
{
|
||||
GLfloat pos[3];
|
||||
printf("Error 0x%x at line %d\n", glGetError(), __LINE__);
|
||||
printf("Light pos %g %g %g\n", pos[0], pos[1], pos[2]);
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
GLfloat m[16], result[16];
|
||||
GLint mPos;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 16; i++)
|
||||
m[i] = (float) i;
|
||||
|
||||
mPos = glGetUniformLocation_func(program, "m");
|
||||
printf("Error 0x%x at line %d\n", glGetError(), __LINE__);
|
||||
glUniformMatrix4fv_func(mPos, 1, GL_FALSE, m);
|
||||
printf("Error 0x%x at line %d\n", glGetError(), __LINE__);
|
||||
|
||||
glGetUniformfv_func(program, mPos, result);
|
||||
printf("Error 0x%x at line %d\n", glGetError(), __LINE__);
|
||||
|
||||
for (i = 0; i < 16; i++) {
|
||||
printf("%8g %8g\n", m[i], result[i]);
|
||||
}
|
||||
}
|
||||
|
||||
assert(glIsProgram_func(program));
|
||||
assert(glIsShader_func(fragShader));
|
||||
assert(glIsShader_func(vertShader));
|
||||
|
||||
/* attached shaders */
|
||||
{
|
||||
GLuint shaders[20];
|
||||
GLsizei count;
|
||||
int i;
|
||||
glGetAttachedShaders_func(program, 20, &count, shaders);
|
||||
for (i = 0; i < count; i++) {
|
||||
printf("Attached: %u\n", shaders[i]);
|
||||
assert(shaders[i] == fragShader ||
|
||||
shaders[i] == vertShader);
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
GLchar log[1000];
|
||||
GLsizei len;
|
||||
glGetShaderInfoLog_func(vertShader, 1000, &len, log);
|
||||
printf("Vert Shader Info Log: %s\n", log);
|
||||
glGetShaderInfoLog_func(fragShader, 1000, &len, log);
|
||||
printf("Frag Shader Info Log: %s\n", log);
|
||||
glGetProgramInfoLog_func(program, 1000, &len, log);
|
||||
printf("Program Info Log: %s\n", log);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#if TEXTURE
|
||||
static void
|
||||
MakeTexture(void)
|
||||
{
|
||||
#define SZ0 64
|
||||
#define SZ1 32
|
||||
GLubyte image0[SZ0][SZ0][SZ0][4];
|
||||
GLubyte image1[SZ1][SZ1][SZ1][4];
|
||||
GLuint i, j, k;
|
||||
|
||||
/* level 0: two-tone gray checkboard */
|
||||
for (i = 0; i < SZ0; i++) {
|
||||
for (j = 0; j < SZ0; j++) {
|
||||
for (k = 0; k < SZ0; k++) {
|
||||
if ((i/8 + j/8 + k/8) & 1) {
|
||||
image0[i][j][k][0] =
|
||||
image0[i][j][k][1] =
|
||||
image0[i][j][k][2] = 200;
|
||||
}
|
||||
else {
|
||||
image0[i][j][k][0] =
|
||||
image0[i][j][k][1] =
|
||||
image0[i][j][k][2] = 100;
|
||||
}
|
||||
image0[i][j][k][3] = 255;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* level 1: two-tone green checkboard */
|
||||
for (i = 0; i < SZ1; i++) {
|
||||
for (j = 0; j < SZ1; j++) {
|
||||
for (k = 0; k < SZ1; k++) {
|
||||
if ((i/8 + j/8 + k/8) & 1) {
|
||||
image1[i][j][k][0] = 0;
|
||||
image1[i][j][k][1] = 250;
|
||||
image1[i][j][k][2] = 0;
|
||||
}
|
||||
else {
|
||||
image1[i][j][k][0] = 0;
|
||||
image1[i][j][k][1] = 200;
|
||||
image1[i][j][k][2] = 0;
|
||||
}
|
||||
image1[i][j][k][3] = 255;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
glActiveTexture(GL_TEXTURE2); /* unit 2 */
|
||||
glBindTexture(GL_TEXTURE_2D, 42);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, SZ0, SZ0, 0,
|
||||
GL_RGBA, GL_UNSIGNED_BYTE, image0);
|
||||
glTexImage2D(GL_TEXTURE_2D, 1, GL_RGBA, SZ1, SZ1, 0,
|
||||
GL_RGBA, GL_UNSIGNED_BYTE, image1);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 1);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
|
||||
glActiveTexture(GL_TEXTURE4); /* unit 4 */
|
||||
glBindTexture(GL_TEXTURE_3D, 43);
|
||||
glTexImage3D(GL_TEXTURE_3D, 0, GL_RGBA, SZ0, SZ0, SZ0, 0,
|
||||
GL_RGBA, GL_UNSIGNED_BYTE, image0);
|
||||
glTexImage3D(GL_TEXTURE_3D, 1, GL_RGBA, SZ1, SZ1, SZ1, 0,
|
||||
GL_RGBA, GL_UNSIGNED_BYTE, image1);
|
||||
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAX_LEVEL, 1);
|
||||
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static void
|
||||
MakeSphere(void)
|
||||
{
|
||||
GLUquadricObj *obj = gluNewQuadric();
|
||||
SphereList = glGenLists(1);
|
||||
gluQuadricTexture(obj, GL_TRUE);
|
||||
glNewList(SphereList, GL_COMPILE);
|
||||
gluSphere(obj, 2.0f, 10, 5);
|
||||
glEndList();
|
||||
}
|
||||
|
||||
static void
|
||||
VertAttrib(GLint index, float x, float y)
|
||||
{
|
||||
#if 1
|
||||
glVertexAttrib2f_func(index, x, y);
|
||||
#else
|
||||
glTexCoord2f(x, y);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
MakeRect(void)
|
||||
{
|
||||
RectList = glGenLists(1);
|
||||
glNewList(RectList, GL_COMPILE);
|
||||
glNormal3f(0, 0, 1);
|
||||
glBegin(GL_POLYGON);
|
||||
VertAttrib(CoordAttrib, 0, 0); glVertex2f(-2, -2);
|
||||
VertAttrib(CoordAttrib, 1, 0); glVertex2f( 2, -2);
|
||||
VertAttrib(CoordAttrib, 1, 1); glVertex2f( 2, 2);
|
||||
VertAttrib(CoordAttrib, 0, 1); glVertex2f(-2, 2);
|
||||
glEnd(); /* XXX omit this and crash! */
|
||||
glEndList();
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
LoadAndCompileShader(GLuint shader, const char *text)
|
||||
{
|
||||
GLint stat;
|
||||
|
||||
glShaderSource_func(shader, 1, (const GLchar **) &text, NULL);
|
||||
|
||||
glCompileShader_func(shader);
|
||||
|
||||
glGetShaderiv_func(shader, GL_COMPILE_STATUS, &stat);
|
||||
if (!stat) {
|
||||
GLchar log[1000];
|
||||
GLsizei len;
|
||||
glGetShaderInfoLog_func(shader, 1000, &len, log);
|
||||
fprintf(stderr, "fslight: problem compiling shader:\n%s\n", log);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Read a shader from a file.
|
||||
*/
|
||||
static void
|
||||
ReadShader(GLuint shader, const char *filename)
|
||||
{
|
||||
const int max = 100*1000;
|
||||
int n;
|
||||
char *buffer = (char*) malloc(max);
|
||||
FILE *f = fopen(filename, "r");
|
||||
if (!f) {
|
||||
fprintf(stderr, "fslight: Unable to open shader file %s\n", filename);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
n = fread(buffer, 1, max, f);
|
||||
printf("fslight: read %d bytes from shader file %s\n", n, filename);
|
||||
if (n > 0) {
|
||||
buffer[n] = 0;
|
||||
LoadAndCompileShader(shader, buffer);
|
||||
}
|
||||
|
||||
fclose(f);
|
||||
free(buffer);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
CheckLink(GLuint prog)
|
||||
{
|
||||
GLint stat;
|
||||
glGetProgramiv_func(prog, GL_LINK_STATUS, &stat);
|
||||
if (!stat) {
|
||||
GLchar log[1000];
|
||||
GLsizei len;
|
||||
glGetProgramInfoLog_func(prog, 1000, &len, log);
|
||||
fprintf(stderr, "Linker error:\n%s\n", log);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Init(void)
|
||||
{
|
||||
static const char *fragShaderText =
|
||||
"uniform vec3 lightPos;\n"
|
||||
"uniform vec4 diffuse;\n"
|
||||
"uniform vec4 specular;\n"
|
||||
"varying vec3 normal;\n"
|
||||
"void main() {\n"
|
||||
" // Compute dot product of light direction and normal vector\n"
|
||||
" float dotProd = max(dot(gl_LightSource[0].position.xyz, \n"
|
||||
" normalize(normal)), 0.0);\n"
|
||||
" float dotProd = max(dot(lightPos, normalize(normal)), 0.0);\n"
|
||||
" // Compute diffuse and specular contributions\n"
|
||||
" gl_FragColor = diffuse * dotProd + specular * pow(dotProd, 20.0);\n"
|
||||
"}\n";
|
||||
@@ -473,63 +236,53 @@ Init(void)
|
||||
" gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n"
|
||||
" normal = gl_NormalMatrix * gl_Normal;\n"
|
||||
"}\n";
|
||||
|
||||
|
||||
const char *version;
|
||||
|
||||
version = (const char *) glGetString(GL_VERSION);
|
||||
if (version[0] != '2' || version[1] != '.') {
|
||||
printf("This program requires OpenGL 2.x, found %s\n", version);
|
||||
exit(1);
|
||||
printf("Warning: this program expects OpenGL 2.0\n");
|
||||
/*exit(1);*/
|
||||
}
|
||||
|
||||
GetExtensionFuncs();
|
||||
|
||||
glCreateShader_func = (PFNGLCREATESHADERPROC) glutGetProcAddress("glCreateShader");
|
||||
glDeleteShader_func = (PFNGLDELETESHADERPROC) glutGetProcAddress("glDeleteShader");
|
||||
glDeleteProgram_func = (PFNGLDELETEPROGRAMPROC) glutGetProcAddress("glDeleteProgram");
|
||||
glShaderSource_func = (PFNGLSHADERSOURCEPROC) glutGetProcAddress("glShaderSource");
|
||||
glGetShaderSource_func = (PFNGLGETSHADERSOURCEPROC) glutGetProcAddress("glGetShaderSource");
|
||||
glCompileShader_func = (PFNGLCOMPILESHADERPROC) glutGetProcAddress("glCompileShader");
|
||||
glCreateProgram_func = (PFNGLCREATEPROGRAMPROC) glutGetProcAddress("glCreateProgram");
|
||||
glAttachShader_func = (PFNGLATTACHSHADERPROC) glutGetProcAddress("glAttachShader");
|
||||
glLinkProgram_func = (PFNGLLINKPROGRAMPROC) glutGetProcAddress("glLinkProgram");
|
||||
glUseProgram_func = (PFNGLUSEPROGRAMPROC) glutGetProcAddress("glUseProgram");
|
||||
glGetUniformLocation_func = (PFNGLGETUNIFORMLOCATIONPROC) glutGetProcAddress("glGetUniformLocation");
|
||||
glIsProgram_func = (PFNGLISPROGRAMPROC) glutGetProcAddress("glIsProgram");
|
||||
glIsShader_func = (PFNGLISSHADERPROC) glutGetProcAddress("glIsShader");
|
||||
glUniform3fv_func = (PFNGLUNIFORM3FVPROC) glutGetProcAddress("glUniform3fv");
|
||||
glUniform4fv_func = (PFNGLUNIFORM3FVPROC) glutGetProcAddress("glUniform4fv");
|
||||
|
||||
fragShader = glCreateShader_func(GL_FRAGMENT_SHADER);
|
||||
if (FragProgFile)
|
||||
ReadShader(fragShader, FragProgFile);
|
||||
else
|
||||
LoadAndCompileShader(fragShader, fragShaderText);
|
||||
|
||||
glShaderSource_func(fragShader, 1, &fragShaderText, NULL);
|
||||
glCompileShader_func(fragShader);
|
||||
|
||||
vertShader = glCreateShader_func(GL_VERTEX_SHADER);
|
||||
if (VertProgFile)
|
||||
ReadShader(vertShader, VertProgFile);
|
||||
else
|
||||
LoadAndCompileShader(vertShader, vertShaderText);
|
||||
glShaderSource_func(vertShader, 1, &vertShaderText, NULL);
|
||||
glCompileShader_func(vertShader);
|
||||
|
||||
program = glCreateProgram_func();
|
||||
glAttachShader_func(program, fragShader);
|
||||
glAttachShader_func(program, vertShader);
|
||||
glLinkProgram_func(program);
|
||||
CheckLink(program);
|
||||
glUseProgram_func(program);
|
||||
|
||||
uLightPos = glGetUniformLocation_func(program, "lightPos");
|
||||
uDiffuse = glGetUniformLocation_func(program, "diffuse");
|
||||
uSpecular = glGetUniformLocation_func(program, "specular");
|
||||
uTexture = glGetUniformLocation_func(program, "texture");
|
||||
printf("DiffusePos %d SpecularPos %d TexturePos %d\n",
|
||||
uDiffuse, uSpecular, uTexture);
|
||||
|
||||
glUniform4fv_func(uDiffuse, 1, diffuse);
|
||||
glUniform4fv_func(uSpecular, 1, specular);
|
||||
/* assert(glGetError() == 0);*/
|
||||
glUniform1i_func(uTexture, 2); /* use texture unit 2 */
|
||||
/*assert(glGetError() == 0);*/
|
||||
|
||||
if (CoordAttrib) {
|
||||
int i;
|
||||
glBindAttribLocation_func(program, CoordAttrib, "coord");
|
||||
i = glGetAttribLocation_func(program, "coord");
|
||||
assert(i >= 0);
|
||||
if (i != CoordAttrib) {
|
||||
printf("Hmmm, NVIDIA bug?\n");
|
||||
CoordAttrib = i;
|
||||
}
|
||||
else {
|
||||
printf("Mesa bind attrib: coord = %d\n", i);
|
||||
}
|
||||
}
|
||||
|
||||
/*assert(glGetError() == 0);*/
|
||||
|
||||
glClearColor(0.3f, 0.3f, 0.3f, 0.0f);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
@@ -539,20 +292,11 @@ Init(void)
|
||||
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, specular);
|
||||
glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, 20.0f);
|
||||
|
||||
MakeSphere();
|
||||
MakeRect();
|
||||
|
||||
CurList = SphereList;
|
||||
|
||||
#if TEXTURE
|
||||
MakeTexture();
|
||||
#endif
|
||||
|
||||
printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER));
|
||||
printf("Press p to toggle between per-pixel and per-vertex lighting\n");
|
||||
|
||||
/* test glGetShaderSource() */
|
||||
if (0) {
|
||||
{
|
||||
GLsizei len = strlen(fragShaderText) + 1;
|
||||
GLsizei lenOut;
|
||||
GLchar *src =(GLchar *) malloc(len * sizeof(GLchar));
|
||||
@@ -566,37 +310,6 @@ Init(void)
|
||||
assert(glIsProgram_func(program));
|
||||
assert(glIsShader_func(fragShader));
|
||||
assert(glIsShader_func(vertShader));
|
||||
|
||||
glColor3f(1, 0, 0);
|
||||
|
||||
/* for testing state vars */
|
||||
{
|
||||
static GLfloat fc[4] = { 1, 1, 0, 0 };
|
||||
static GLfloat amb[4] = { 1, 0, 1, 0 };
|
||||
glFogfv(GL_FOG_COLOR, fc);
|
||||
glLightfv(GL_LIGHT1, GL_AMBIENT, amb);
|
||||
}
|
||||
|
||||
#if 0
|
||||
TestFunctions();
|
||||
#else
|
||||
(void) TestFunctions;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
ParseOptions(int argc, char *argv[])
|
||||
{
|
||||
int i;
|
||||
for (i = 1; i < argc; i++) {
|
||||
if (strcmp(argv[i], "-fs") == 0) {
|
||||
FragProgFile = argv[i+1];
|
||||
}
|
||||
else if (strcmp(argv[i], "-vs") == 0) {
|
||||
VertProgFile = argv[i+1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -614,10 +327,8 @@ main(int argc, char *argv[])
|
||||
glutDisplayFunc(Redisplay);
|
||||
if (anim)
|
||||
glutIdleFunc(Idle);
|
||||
ParseOptions(argc, argv);
|
||||
Init();
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -296,27 +296,14 @@ RenderShadowMap(void)
|
||||
0, 1, 0); /* up */
|
||||
|
||||
if (UseFBO) {
|
||||
GLenum fbo_status;
|
||||
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, depthFormat,
|
||||
ShadowTexWidth, ShadowTexHeight, 0,
|
||||
depthFormat, depthType, NULL);
|
||||
|
||||
/* Set the filter mode so that the texture is texture-complete.
|
||||
* Otherwise it will cause the framebuffer to fail the framebuffer
|
||||
* completeness test.
|
||||
*/
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
|
||||
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, ShadowFBO);
|
||||
glDrawBuffer(GL_NONE);
|
||||
glReadBuffer(GL_NONE);
|
||||
|
||||
fbo_status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
|
||||
if (fbo_status != GL_FRAMEBUFFER_COMPLETE_EXT) {
|
||||
fprintf(stderr, "FBO not complete! status = 0x%04x\n", fbo_status);
|
||||
assert(fbo_status == GL_FRAMEBUFFER_COMPLETE_EXT);
|
||||
}
|
||||
assert(glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT)
|
||||
== GL_FRAMEBUFFER_COMPLETE_EXT);
|
||||
}
|
||||
|
||||
assert(!glIsEnabled(GL_TEXTURE_1D));
|
||||
|
@@ -4,10 +4,10 @@
|
||||
* Updated for GLU 1.3 tessellation by Gareth Hughes <gareth@valinux.com>
|
||||
*/
|
||||
|
||||
#include <GL/glut.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <GL/glut.h>
|
||||
|
||||
#define MAX_POINTS 256
|
||||
#define MAX_CONTOURS 32
|
||||
|
@@ -149,7 +149,7 @@ TypeStr(GLenum type)
|
||||
*/
|
||||
#define ALIGN (1<<12)
|
||||
|
||||
static unsigned long align(unsigned long value, unsigned long a)
|
||||
static unsigned align(unsigned value, unsigned a)
|
||||
{
|
||||
return (value + a - 1) & ~(a-1);
|
||||
}
|
||||
@@ -186,10 +186,10 @@ MeasureDownloadRate(void)
|
||||
|
||||
printf("alloc %p %p\n", orig_texImage, orig_getImage);
|
||||
|
||||
texImage = (GLubyte *)align((unsigned long)orig_texImage, ALIGN);
|
||||
getImage = (GLubyte *)align((unsigned long)orig_getImage, ALIGN);
|
||||
texImage = (GLubyte *)align((unsigned)orig_texImage, ALIGN);
|
||||
getImage = (GLubyte *)align((unsigned)orig_getImage, ALIGN);
|
||||
|
||||
for (i = 1; !(((unsigned long)texImage) & i); i<<=1)
|
||||
for (i = 1; !(((unsigned)texImage) & i); i<<=1)
|
||||
;
|
||||
printf("texture image alignment: %d bytes (%p)\n", i, texImage);
|
||||
|
||||
|
@@ -77,7 +77,7 @@ static void init( void )
|
||||
WindowPosFunc = &glWindowPos2fARB;
|
||||
}
|
||||
else
|
||||
#elif defined(GL_MESA_window_pos)
|
||||
#elif defined(GL_ARB_window_pos)
|
||||
if (glutExtensionSupported("GL_MESA_window_pos")) {
|
||||
printf("Using GL_MESA_window_pos\n");
|
||||
WindowPosFunc = &glWindowPos2fMESA;
|
||||
|
@@ -1,36 +0,0 @@
|
||||
//
|
||||
// Fragment shader for procedural bricks
|
||||
//
|
||||
// Authors: Dave Baldwin, Steve Koren, Randi Rost
|
||||
// based on a shader by Darwyn Peachey
|
||||
//
|
||||
// Copyright (c) 2002-2006 3Dlabs Inc. Ltd.
|
||||
//
|
||||
// See 3Dlabs-License.txt for license information
|
||||
//
|
||||
|
||||
uniform vec3 BrickColor, MortarColor;
|
||||
uniform vec2 BrickSize;
|
||||
uniform vec2 BrickPct;
|
||||
|
||||
varying vec2 MCposition;
|
||||
varying float LightIntensity;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec3 color;
|
||||
vec2 position, useBrick;
|
||||
|
||||
position = MCposition / BrickSize;
|
||||
|
||||
if (fract(position.y * 0.5) > 0.5)
|
||||
position.x += 0.5;
|
||||
|
||||
position = fract(position);
|
||||
|
||||
useBrick = step(position, BrickPct);
|
||||
|
||||
color = mix(MortarColor, BrickColor, useBrick.x * useBrick.y);
|
||||
color *= LightIntensity;
|
||||
gl_FragColor = vec4(color, 1.0);
|
||||
}
|
@@ -1,41 +0,0 @@
|
||||
//
|
||||
// Vertex shader for procedural bricks
|
||||
//
|
||||
// Authors: Dave Baldwin, Steve Koren, Randi Rost
|
||||
// based on a shader by Darwyn Peachey
|
||||
//
|
||||
// Copyright (c) 2002-2006 3Dlabs Inc. Ltd.
|
||||
//
|
||||
// See 3Dlabs-License.txt for license information
|
||||
//
|
||||
|
||||
uniform vec3 LightPosition;
|
||||
|
||||
const float SpecularContribution = 0.3;
|
||||
const float DiffuseContribution = 1.0 - SpecularContribution;
|
||||
|
||||
varying float LightIntensity;
|
||||
varying vec2 MCposition;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec3 ecPosition = vec3(gl_ModelViewMatrix * gl_Vertex);
|
||||
vec3 tnorm = normalize(gl_NormalMatrix * gl_Normal);
|
||||
vec3 lightVec = normalize(LightPosition - ecPosition);
|
||||
vec3 reflectVec = reflect(-lightVec, tnorm);
|
||||
vec3 viewVec = normalize(-ecPosition);
|
||||
float diffuse = max(dot(lightVec, tnorm), 0.0);
|
||||
float spec = 0.0;
|
||||
|
||||
if (diffuse > 0.0)
|
||||
{
|
||||
spec = max(dot(reflectVec, viewVec), 0.0);
|
||||
spec = pow(spec, 16.0);
|
||||
}
|
||||
|
||||
LightIntensity = DiffuseContribution * diffuse +
|
||||
SpecularContribution * spec;
|
||||
|
||||
MCposition = gl_Vertex.xy;
|
||||
gl_Position = ftransform();
|
||||
}
|
@@ -1,41 +0,0 @@
|
||||
//
|
||||
// Fragment shader for procedural bumps
|
||||
//
|
||||
// Authors: John Kessenich, Randi Rost
|
||||
//
|
||||
// Copyright (c) 2002-2006 3Dlabs Inc. Ltd.
|
||||
//
|
||||
// See 3Dlabs-License.txt for license information
|
||||
//
|
||||
|
||||
varying vec3 LightDir;
|
||||
varying vec3 EyeDir;
|
||||
|
||||
uniform vec3 SurfaceColor; // = (0.7, 0.6, 0.18)
|
||||
uniform float BumpDensity; // = 16.0
|
||||
uniform float BumpSize; // = 0.15
|
||||
uniform float SpecularFactor; // = 0.5
|
||||
|
||||
void main()
|
||||
{
|
||||
vec3 litColor;
|
||||
vec2 c = BumpDensity * gl_TexCoord[0].st;
|
||||
vec2 p = fract(c) - vec2(0.5);
|
||||
|
||||
float d, f;
|
||||
d = p.x * p.x + p.y * p.y;
|
||||
f = 1.0 / sqrt(d + 1.0);
|
||||
|
||||
if (d >= BumpSize)
|
||||
{ p = vec2(0.0); f = 1.0; }
|
||||
|
||||
vec3 normDelta = vec3(p.x, p.y, 1.0) * f;
|
||||
litColor = SurfaceColor * max(dot(normDelta, LightDir), 0.0);
|
||||
vec3 reflectDir = reflect(LightDir, normDelta);
|
||||
|
||||
float spec = max(dot(EyeDir, reflectDir), 0.0);
|
||||
spec *= SpecularFactor;
|
||||
litColor = min(litColor + spec, vec3(1.0));
|
||||
|
||||
gl_FragColor = vec4(litColor, 1.0);
|
||||
}
|
@@ -1,38 +0,0 @@
|
||||
//
|
||||
// Vertex shader for procedural bumps
|
||||
//
|
||||
// Authors: Randi Rost, John Kessenich
|
||||
//
|
||||
// Copyright (c) 2002-2006 3Dlabs Inc. Ltd.
|
||||
//
|
||||
// See 3Dlabs-License.txt for license information
|
||||
//
|
||||
|
||||
varying vec3 LightDir;
|
||||
varying vec3 EyeDir;
|
||||
|
||||
uniform vec3 LightPosition;
|
||||
|
||||
attribute vec3 Tangent;
|
||||
|
||||
void main()
|
||||
{
|
||||
EyeDir = vec3(gl_ModelViewMatrix * gl_Vertex);
|
||||
gl_Position = ftransform();
|
||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||
|
||||
vec3 n = normalize(gl_NormalMatrix * gl_Normal);
|
||||
vec3 t = normalize(gl_NormalMatrix * Tangent);
|
||||
vec3 b = cross(n, t);
|
||||
|
||||
vec3 v;
|
||||
v.x = dot(LightPosition, t);
|
||||
v.y = dot(LightPosition, b);
|
||||
v.z = dot(LightPosition, n);
|
||||
LightDir = normalize(v);
|
||||
|
||||
v.x = dot(EyeDir, t);
|
||||
v.y = dot(EyeDir, b);
|
||||
v.z = dot(EyeDir, n);
|
||||
EyeDir = normalize(v);
|
||||
}
|
@@ -1,75 +0,0 @@
|
||||
//
|
||||
// Fragment shader for procedurally generated toy ball
|
||||
//
|
||||
// Author: Bill Licea-Kane
|
||||
//
|
||||
// Copyright (c) 2002-2003 ATI Research
|
||||
//
|
||||
// See ATI-License.txt for license information
|
||||
//
|
||||
|
||||
varying vec4 ECposition; // surface position in eye coordinates
|
||||
varying vec4 ECballCenter; // ball center in eye coordinates
|
||||
|
||||
uniform vec4 LightDir; // light direction, should be normalized
|
||||
uniform vec4 HVector; // reflection vector for infinite light source
|
||||
uniform vec4 SpecularColor;
|
||||
uniform vec4 Red, Yellow, Blue;
|
||||
|
||||
uniform vec4 HalfSpace0; // half-spaces used to define star pattern
|
||||
uniform vec4 HalfSpace1;
|
||||
uniform vec4 HalfSpace2;
|
||||
uniform vec4 HalfSpace3;
|
||||
uniform vec4 HalfSpace4;
|
||||
|
||||
uniform float InOrOutInit; // = -3
|
||||
uniform float StripeWidth; // = 0.3
|
||||
uniform float FWidth; // = 0.005
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 normal; // Analytically computed normal
|
||||
vec4 p; // Point in shader space
|
||||
vec4 surfColor; // Computed color of the surface
|
||||
float intensity; // Computed light intensity
|
||||
vec4 distance; // Computed distance values
|
||||
float inorout; // Counter for computing star pattern
|
||||
|
||||
p.xyz = normalize(ECposition.xyz - ECballCenter.xyz); // Calculate p
|
||||
p.w = 1.0;
|
||||
|
||||
inorout = InOrOutInit; // initialize inorout to -3
|
||||
|
||||
distance[0] = dot(p, HalfSpace0);
|
||||
distance[1] = dot(p, HalfSpace1);
|
||||
distance[2] = dot(p, HalfSpace2);
|
||||
distance[3] = dot(p, HalfSpace3);
|
||||
|
||||
distance = smoothstep(-FWidth, FWidth, distance);
|
||||
inorout += dot(distance, vec4(1.0));
|
||||
|
||||
distance.x = dot(p, HalfSpace4);
|
||||
distance.y = StripeWidth - abs(p.z);
|
||||
distance = smoothstep(-FWidth, FWidth, distance);
|
||||
inorout += distance.x;
|
||||
|
||||
inorout = clamp(inorout, 0.0, 1.0);
|
||||
|
||||
surfColor = mix(Yellow, Red, inorout);
|
||||
surfColor = mix(surfColor, Blue, distance.y);
|
||||
|
||||
// normal = point on surface for sphere at (0,0,0)
|
||||
normal = p;
|
||||
|
||||
// Per fragment diffuse lighting
|
||||
intensity = 0.2; // ambient
|
||||
intensity += 0.8 * clamp(dot(LightDir, normal), 0.0, 1.0);
|
||||
surfColor *= intensity;
|
||||
|
||||
// Per fragment specular lighting
|
||||
intensity = clamp(dot(HVector, normal), 0.0, 1.0);
|
||||
intensity = pow(intensity, SpecularColor.a);
|
||||
surfColor += SpecularColor * intensity;
|
||||
|
||||
gl_FragColor = surfColor;
|
||||
}
|
@@ -1,24 +0,0 @@
|
||||
//
|
||||
// Fragment shader for procedurally generated toy ball
|
||||
//
|
||||
// Author: Bill Licea-Kane
|
||||
//
|
||||
// Copyright (c) 2002-2003 ATI Research
|
||||
//
|
||||
// See ATI-License.txt for license information
|
||||
//
|
||||
|
||||
varying vec4 ECposition; // surface position in eye coordinates
|
||||
varying vec4 ECballCenter; // ball center in eye coordinates
|
||||
uniform vec4 BallCenter; // ball center in modelling coordinates
|
||||
|
||||
void main()
|
||||
{
|
||||
//orig: ECposition = gl_ModelViewMatrix * gl_Vertex;
|
||||
|
||||
ECposition = gl_TextureMatrix[0] * gl_Vertex;
|
||||
ECposition = gl_ModelViewMatrix * ECposition;
|
||||
|
||||
ECballCenter = gl_ModelViewMatrix * BallCenter;
|
||||
gl_Position = ftransform();
|
||||
}
|
@@ -1,55 +0,0 @@
|
||||
//
|
||||
// Fragment shader for drawing the Mandelbrot set
|
||||
//
|
||||
// Authors: Dave Baldwin, Steve Koren, Randi Rost
|
||||
// based on a shader by Michael Rivero
|
||||
//
|
||||
// Copyright (c) 2002-2005: 3Dlabs, Inc.
|
||||
//
|
||||
// See 3Dlabs-License.txt for license information
|
||||
//
|
||||
|
||||
varying vec3 Position;
|
||||
varying float LightIntensity;
|
||||
|
||||
uniform float MaxIterations;
|
||||
uniform float Zoom;
|
||||
uniform float Xcenter;
|
||||
uniform float Ycenter;
|
||||
uniform vec3 InnerColor;
|
||||
uniform vec3 OuterColor1;
|
||||
uniform vec3 OuterColor2;
|
||||
|
||||
void main()
|
||||
{
|
||||
float real = Position.x * Zoom + Xcenter;
|
||||
float imag = Position.y * Zoom + Ycenter;
|
||||
float Creal = real; // Change this line...
|
||||
float Cimag = imag; // ...and this one to get a Julia set
|
||||
|
||||
float r2 = 0.0;
|
||||
float iter;
|
||||
|
||||
// for (iter = 0.0; iter < MaxIterations && r2 < 4.0; ++iter)
|
||||
for (iter = 0.0; iter < 12 && r2 < 4.0; ++iter)
|
||||
{
|
||||
float tempreal = real;
|
||||
|
||||
real = (tempreal * tempreal) - (imag * imag) + Creal;
|
||||
imag = 2.0 * tempreal * imag + Cimag;
|
||||
r2 = (real * real) + (imag * imag);
|
||||
}
|
||||
|
||||
// Base the color on the number of iterations
|
||||
|
||||
vec3 color;
|
||||
|
||||
if (r2 < 4.0)
|
||||
color = InnerColor;
|
||||
else
|
||||
color = mix(OuterColor1, OuterColor2, fract(iter * 0.05));
|
||||
|
||||
color *= LightIntensity;
|
||||
|
||||
gl_FragColor = vec4(color, 1.0);
|
||||
}
|
@@ -1,35 +0,0 @@
|
||||
//
|
||||
// Vertex shader for drawing the Mandelbrot set
|
||||
//
|
||||
// Authors: Dave Baldwin, Steve Koren, Randi Rost
|
||||
// based on a shader by Michael Rivero
|
||||
//
|
||||
// Copyright (c) 2002-2005: 3Dlabs, Inc.
|
||||
//
|
||||
// See 3Dlabs-License.txt for license information
|
||||
//
|
||||
|
||||
uniform vec3 LightPosition;
|
||||
uniform float SpecularContribution;
|
||||
uniform float DiffuseContribution;
|
||||
uniform float Shininess;
|
||||
|
||||
varying float LightIntensity;
|
||||
varying vec3 Position;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec3 ecPosition = vec3(gl_ModelViewMatrix * gl_Vertex);
|
||||
vec3 tnorm = normalize(gl_NormalMatrix * gl_Normal);
|
||||
vec3 lightVec = normalize(LightPosition - ecPosition);
|
||||
vec3 reflectVec = reflect(-lightVec, tnorm);
|
||||
vec3 viewVec = normalize(-ecPosition);
|
||||
float spec = max(dot(reflectVec, viewVec), 0.0);
|
||||
spec = pow(spec, Shininess);
|
||||
LightIntensity = DiffuseContribution *
|
||||
max(dot(lightVec, tnorm), 0.0) +
|
||||
SpecularContribution * spec;
|
||||
Position = vec3(gl_MultiTexCoord0 - 0.5) * 5.0;
|
||||
gl_Position = ftransform();
|
||||
|
||||
}
|
@@ -1,74 +0,0 @@
|
||||
# progs/demos/Makefile
|
||||
|
||||
TOP = ../..
|
||||
include $(TOP)/configs/current
|
||||
|
||||
INCDIR = $(TOP)/include
|
||||
|
||||
OSMESA_LIBS = -L$(TOP)/$(LIB_DIR) -lglut -lOSMesa -lGLU -lGL $(APP_LIB_DEPS)
|
||||
|
||||
OSMESA16_LIBS = -L$(TOP)/$(LIB_DIR) -lglut -lOSMesa16 -lGLU -lGL $(APP_LIB_DEPS)
|
||||
|
||||
OSMESA32_LIBS = -L$(TOP)/$(LIB_DIR) -lglut -lOSMesa32 -lGLU -lGL $(APP_LIB_DEPS)
|
||||
|
||||
LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME)
|
||||
|
||||
PROGS = \
|
||||
brick \
|
||||
bump \
|
||||
mandelbrot \
|
||||
noise \
|
||||
toyball \
|
||||
texdemo1
|
||||
|
||||
|
||||
##### RULES #####
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c
|
||||
|
||||
|
||||
# make executable from .c file:
|
||||
.c: $(LIB_DEP)
|
||||
$(CC) -I$(INCDIR) $(CFLAGS) $< $(APP_LIB_DEPS) -o $@
|
||||
|
||||
|
||||
##### TARGETS #####
|
||||
|
||||
default: $(PROGS)
|
||||
|
||||
|
||||
|
||||
##### Extra dependencies
|
||||
|
||||
extfuncs.h: $(TOP)/progs/util/extfuncs.h
|
||||
cp $< .
|
||||
|
||||
readtex.c: $(TOP)/progs/util/readtex.c
|
||||
cp $< .
|
||||
|
||||
readtex.h: $(TOP)/progs/util/readtex.h
|
||||
cp $< .
|
||||
|
||||
readtex.o: readtex.c readtex.h
|
||||
$(CC) -c -I$(INCDIR) $(CFLAGS) readtex.c
|
||||
|
||||
brick.c: extfuncs.h
|
||||
|
||||
bump.c: extfuncs.h
|
||||
|
||||
mandelbrot.c: extfuncs.h
|
||||
|
||||
toyball.c: extfuncs.h
|
||||
|
||||
texdemo1: texdemo1.o readtex.o
|
||||
$(CC) -I$(INCDIR) $(CFLAGS) texdemo1.o readtex.o $(APP_LIB_DEPS) -o $@
|
||||
|
||||
texdemo1.o: texdemo1.c readtex.h extfuncs.h
|
||||
$(CC) -c -I$(INCDIR) $(CFLAGS) texdemo1.c
|
||||
|
||||
|
||||
clean:
|
||||
-rm -f $(PROGS)
|
||||
-rm -f *.o *~
|
||||
-rm -f extfuncs.h
|
@@ -1,311 +0,0 @@
|
||||
/**
|
||||
* "Brick" shader demo. Uses the example shaders from chapter 6 of
|
||||
* the OpenGL Shading Language "orange" book.
|
||||
* 10 Jan 2007
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glut.h>
|
||||
#include <GL/glext.h>
|
||||
#include "extfuncs.h"
|
||||
|
||||
|
||||
static char *FragProgFile = "CH06-brick.frag.txt";
|
||||
static char *VertProgFile = "CH06-brick.vert.txt";
|
||||
|
||||
/* program/shader objects */
|
||||
static GLuint fragShader;
|
||||
static GLuint vertShader;
|
||||
static GLuint program;
|
||||
|
||||
|
||||
struct uniform_info {
|
||||
const char *name;
|
||||
GLuint size;
|
||||
GLint location;
|
||||
GLfloat value[4];
|
||||
};
|
||||
|
||||
static struct uniform_info Uniforms[] = {
|
||||
/* vert */
|
||||
{ "LightPosition", 3, -1, { 0.1, 0.1, 9.0, 0} },
|
||||
/* frag */
|
||||
{ "BrickColor", 3, -1, { 0.8, 0.2, 0.2, 0 } },
|
||||
{ "MortarColor", 3, -1, { 0.6, 0.6, 0.6, 0 } },
|
||||
{ "BrickSize", 2, -1, { 1.0, 0.3, 0, 0 } },
|
||||
{ "BrickPct", 2, -1, { 0.9, 0.8, 0, 0 } },
|
||||
{ NULL, 0, 0, { 0, 0, 0, 0 } }
|
||||
};
|
||||
|
||||
static GLint win = 0;
|
||||
|
||||
|
||||
static GLfloat xRot = 0.0f, yRot = 0.0f, zRot = 0.0f;
|
||||
|
||||
|
||||
|
||||
|
||||
static void
|
||||
Redisplay(void)
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
glPushMatrix();
|
||||
glRotatef(xRot, 1.0f, 0.0f, 0.0f);
|
||||
glRotatef(yRot, 0.0f, 1.0f, 0.0f);
|
||||
glRotatef(zRot, 0.0f, 0.0f, 1.0f);
|
||||
|
||||
glBegin(GL_POLYGON);
|
||||
glTexCoord2f(0, 0); glVertex2f(-2, -2);
|
||||
glTexCoord2f(1, 0); glVertex2f( 2, -2);
|
||||
glTexCoord2f(1, 1); glVertex2f( 2, 2);
|
||||
glTexCoord2f(0, 1); glVertex2f(-2, 2);
|
||||
glEnd();
|
||||
|
||||
glPopMatrix();
|
||||
|
||||
glutSwapBuffers();
|
||||
}
|
||||
|
||||
|
||||
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
|
||||
CleanUp(void)
|
||||
{
|
||||
glDeleteShader_func(fragShader);
|
||||
glDeleteShader_func(vertShader);
|
||||
glDeleteProgram_func(program);
|
||||
glutDestroyWindow(win);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Key(unsigned char key, int x, int y)
|
||||
{
|
||||
(void) x;
|
||||
(void) y;
|
||||
|
||||
switch(key) {
|
||||
case 'z':
|
||||
zRot -= 1.0;
|
||||
break;
|
||||
case 'Z':
|
||||
zRot += 1.0;
|
||||
break;
|
||||
case 27:
|
||||
CleanUp();
|
||||
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
|
||||
LoadAndCompileShader(GLuint shader, const char *text)
|
||||
{
|
||||
GLint stat;
|
||||
|
||||
glShaderSource_func(shader, 1, (const GLchar **) &text, NULL);
|
||||
|
||||
glCompileShader_func(shader);
|
||||
|
||||
glGetShaderiv_func(shader, GL_COMPILE_STATUS, &stat);
|
||||
if (!stat) {
|
||||
GLchar log[1000];
|
||||
GLsizei len;
|
||||
glGetShaderInfoLog_func(shader, 1000, &len, log);
|
||||
fprintf(stderr, "brick: problem compiling shader: %s\n", log);
|
||||
exit(1);
|
||||
}
|
||||
else {
|
||||
printf("Shader compiled OK\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Read a shader from a file.
|
||||
*/
|
||||
static void
|
||||
ReadShader(GLuint shader, const char *filename)
|
||||
{
|
||||
const int max = 100*1000;
|
||||
int n;
|
||||
char *buffer = (char*) malloc(max);
|
||||
FILE *f = fopen(filename, "r");
|
||||
if (!f) {
|
||||
fprintf(stderr, "brick: Unable to open shader file %s\n", filename);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
n = fread(buffer, 1, max, f);
|
||||
printf("brick: read %d bytes from shader file %s\n", n, filename);
|
||||
if (n > 0) {
|
||||
buffer[n] = 0;
|
||||
LoadAndCompileShader(shader, buffer);
|
||||
}
|
||||
|
||||
fclose(f);
|
||||
free(buffer);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
CheckLink(GLuint prog)
|
||||
{
|
||||
GLint stat;
|
||||
glGetProgramiv_func(prog, GL_LINK_STATUS, &stat);
|
||||
if (!stat) {
|
||||
GLchar log[1000];
|
||||
GLsizei len;
|
||||
glGetProgramInfoLog_func(prog, 1000, &len, log);
|
||||
fprintf(stderr, "Linker error:\n%s\n", log);
|
||||
}
|
||||
else {
|
||||
fprintf(stderr, "Link success!\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Init(void)
|
||||
{
|
||||
const char *version;
|
||||
GLint i;
|
||||
|
||||
version = (const char *) glGetString(GL_VERSION);
|
||||
if (version[0] != '2' || version[1] != '.') {
|
||||
printf("Warning: this program expects OpenGL 2.0\n");
|
||||
/*exit(1);*/
|
||||
}
|
||||
|
||||
GetExtensionFuncs();
|
||||
|
||||
vertShader = glCreateShader_func(GL_VERTEX_SHADER);
|
||||
ReadShader(vertShader, VertProgFile);
|
||||
|
||||
fragShader = glCreateShader_func(GL_FRAGMENT_SHADER);
|
||||
ReadShader(fragShader, FragProgFile);
|
||||
|
||||
program = glCreateProgram_func();
|
||||
glAttachShader_func(program, fragShader);
|
||||
glAttachShader_func(program, vertShader);
|
||||
glLinkProgram_func(program);
|
||||
CheckLink(program);
|
||||
glUseProgram_func(program);
|
||||
|
||||
for (i = 0; Uniforms[i].name; i++) {
|
||||
Uniforms[i].location
|
||||
= glGetUniformLocation_func(program, Uniforms[i].name);
|
||||
printf("Uniform %s location: %d\n", Uniforms[i].name,
|
||||
Uniforms[i].location);
|
||||
switch (Uniforms[i].size) {
|
||||
case 1:
|
||||
glUniform1fv_func(Uniforms[i].location, 1, Uniforms[i].value);
|
||||
break;
|
||||
case 2:
|
||||
glUniform2fv_func(Uniforms[i].location, 1, Uniforms[i].value);
|
||||
break;
|
||||
case 3:
|
||||
glUniform3fv_func(Uniforms[i].location, 1, Uniforms[i].value);
|
||||
break;
|
||||
case 4:
|
||||
glUniform4fv_func(Uniforms[i].location, 1, Uniforms[i].value);
|
||||
break;
|
||||
default:
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
||||
assert(glGetError() == 0);
|
||||
|
||||
glClearColor(0.4f, 0.4f, 0.8f, 0.0f);
|
||||
|
||||
printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER));
|
||||
|
||||
assert(glIsProgram_func(program));
|
||||
assert(glIsShader_func(fragShader));
|
||||
assert(glIsShader_func(vertShader));
|
||||
|
||||
glColor3f(1, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
ParseOptions(int argc, char *argv[])
|
||||
{
|
||||
int i;
|
||||
for (i = 1; i < argc; i++) {
|
||||
if (strcmp(argv[i], "-fs") == 0) {
|
||||
FragProgFile = argv[i+1];
|
||||
}
|
||||
else if (strcmp(argv[i], "-vs") == 0) {
|
||||
VertProgFile = argv[i+1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
glutInit(&argc, argv);
|
||||
glutInitWindowPosition( 0, 0);
|
||||
glutInitWindowSize(400, 400);
|
||||
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
|
||||
win = glutCreateWindow(argv[0]);
|
||||
glutReshapeFunc(Reshape);
|
||||
glutKeyboardFunc(Key);
|
||||
glutSpecialFunc(SpecialKey);
|
||||
glutDisplayFunc(Redisplay);
|
||||
ParseOptions(argc, argv);
|
||||
Init();
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
||||
|
@@ -1,411 +0,0 @@
|
||||
/**
|
||||
* Procedural Bump Mapping demo. Uses the example shaders from
|
||||
* chapter 11 of the OpenGL Shading Language "orange" book.
|
||||
* 16 Jan 2007
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <GL/glut.h>
|
||||
#include <GL/glu.h>
|
||||
#include <GL/glext.h>
|
||||
#include "extfuncs.h"
|
||||
|
||||
|
||||
static char *FragProgFile = "CH11-bumpmap.frag.txt";
|
||||
static char *VertProgFile = "CH11-bumpmap.vert.txt";
|
||||
|
||||
/* program/shader objects */
|
||||
static GLuint fragShader;
|
||||
static GLuint vertShader;
|
||||
static GLuint program;
|
||||
|
||||
|
||||
struct uniform_info {
|
||||
const char *name;
|
||||
GLuint size;
|
||||
GLint location;
|
||||
GLfloat value[4];
|
||||
};
|
||||
|
||||
static struct uniform_info Uniforms[] = {
|
||||
{ "LightPosition", 3, -1, { 0.57737, 0.57735, 0.57735, 0.0 } },
|
||||
{ "SurfaceColor", 3, -1, { 0.8, 0.8, 0.2, 0 } },
|
||||
{ "BumpDensity", 1, -1, { 10.0, 0, 0, 0 } },
|
||||
{ "BumpSize", 1, -1, { 0.125, 0, 0, 0 } },
|
||||
{ "SpecularFactor", 1, -1, { 0.5, 0, 0, 0 } },
|
||||
{ NULL, 0, 0, { 0, 0, 0, 0 } }
|
||||
};
|
||||
|
||||
static GLint win = 0;
|
||||
|
||||
static GLfloat xRot = 20.0f, yRot = 0.0f, zRot = 0.0f;
|
||||
|
||||
static GLuint tangentAttrib;
|
||||
|
||||
static GLboolean Anim = GL_FALSE;
|
||||
|
||||
|
||||
static void
|
||||
CheckError(int line)
|
||||
{
|
||||
GLenum err = glGetError();
|
||||
if (err) {
|
||||
printf("GL Error %s (0x%x) at line %d\n",
|
||||
gluErrorString(err), (int) err, line);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Draw a square, specifying normal and tangent vectors.
|
||||
*/
|
||||
static void
|
||||
Square(GLfloat size)
|
||||
{
|
||||
glNormal3f(0, 0, 1);
|
||||
glVertexAttrib3f_func(tangentAttrib, 1, 0, 0);
|
||||
glBegin(GL_POLYGON);
|
||||
glTexCoord2f(0, 0); glVertex2f(-size, -size);
|
||||
glTexCoord2f(1, 0); glVertex2f( size, -size);
|
||||
glTexCoord2f(1, 1); glVertex2f( size, size);
|
||||
glTexCoord2f(0, 1); glVertex2f(-size, size);
|
||||
glEnd();
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Cube(GLfloat size)
|
||||
{
|
||||
/* +X */
|
||||
glPushMatrix();
|
||||
glRotatef(90, 0, 1, 0);
|
||||
glTranslatef(0, 0, size);
|
||||
Square(size);
|
||||
glPopMatrix();
|
||||
|
||||
/* -X */
|
||||
glPushMatrix();
|
||||
glRotatef(-90, 0, 1, 0);
|
||||
glTranslatef(0, 0, size);
|
||||
Square(size);
|
||||
glPopMatrix();
|
||||
|
||||
/* +Y */
|
||||
glPushMatrix();
|
||||
glRotatef(90, 1, 0, 0);
|
||||
glTranslatef(0, 0, size);
|
||||
Square(size);
|
||||
glPopMatrix();
|
||||
|
||||
/* -Y */
|
||||
glPushMatrix();
|
||||
glRotatef(-90, 1, 0, 0);
|
||||
glTranslatef(0, 0, size);
|
||||
Square(size);
|
||||
glPopMatrix();
|
||||
|
||||
|
||||
/* +Z */
|
||||
glPushMatrix();
|
||||
glTranslatef(0, 0, size);
|
||||
Square(size);
|
||||
glPopMatrix();
|
||||
|
||||
/* -Z */
|
||||
glPushMatrix();
|
||||
glRotatef(180, 0, 1, 0);
|
||||
glTranslatef(0, 0, size);
|
||||
Square(size);
|
||||
glPopMatrix();
|
||||
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Idle(void)
|
||||
{
|
||||
GLint t = glutGet(GLUT_ELAPSED_TIME);
|
||||
yRot = t * 0.05;
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Redisplay(void)
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
glPushMatrix();
|
||||
glRotatef(xRot, 1.0f, 0.0f, 0.0f);
|
||||
glRotatef(yRot, 0.0f, 1.0f, 0.0f);
|
||||
glRotatef(zRot, 0.0f, 0.0f, 1.0f);
|
||||
|
||||
Cube(1.5);
|
||||
|
||||
glPopMatrix();
|
||||
|
||||
glFinish();
|
||||
glFlush();
|
||||
|
||||
CheckError(__LINE__);
|
||||
|
||||
glutSwapBuffers();
|
||||
}
|
||||
|
||||
|
||||
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
|
||||
CleanUp(void)
|
||||
{
|
||||
glDeleteShader_func(fragShader);
|
||||
glDeleteShader_func(vertShader);
|
||||
glDeleteProgram_func(program);
|
||||
glutDestroyWindow(win);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Key(unsigned char key, int x, int y)
|
||||
{
|
||||
const GLfloat step = 2.0;
|
||||
(void) x;
|
||||
(void) y;
|
||||
|
||||
switch(key) {
|
||||
case 'a':
|
||||
Anim = !Anim;
|
||||
glutIdleFunc(Anim ? Idle : NULL);
|
||||
break;
|
||||
case 'z':
|
||||
zRot += step;
|
||||
break;
|
||||
case 'Z':
|
||||
zRot -= step;
|
||||
break;
|
||||
case 27:
|
||||
CleanUp();
|
||||
exit(0);
|
||||
break;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
SpecialKey(int key, int x, int y)
|
||||
{
|
||||
const GLfloat step = 2.0;
|
||||
|
||||
(void) x;
|
||||
(void) y;
|
||||
|
||||
switch(key) {
|
||||
case GLUT_KEY_UP:
|
||||
xRot += step;
|
||||
break;
|
||||
case GLUT_KEY_DOWN:
|
||||
xRot -= step;
|
||||
break;
|
||||
case GLUT_KEY_LEFT:
|
||||
yRot -= step;
|
||||
break;
|
||||
case GLUT_KEY_RIGHT:
|
||||
yRot += step;
|
||||
break;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
LoadAndCompileShader(GLuint shader, const char *text)
|
||||
{
|
||||
GLint stat;
|
||||
|
||||
glShaderSource_func(shader, 1, (const GLchar **) &text, NULL);
|
||||
|
||||
glCompileShader_func(shader);
|
||||
|
||||
glGetShaderiv_func(shader, GL_COMPILE_STATUS, &stat);
|
||||
if (!stat) {
|
||||
GLchar log[1000];
|
||||
GLsizei len;
|
||||
glGetShaderInfoLog_func(shader, 1000, &len, log);
|
||||
fprintf(stderr, "brick: problem compiling shader: %s\n", log);
|
||||
exit(1);
|
||||
}
|
||||
else {
|
||||
printf("Shader compiled OK\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Read a shader from a file.
|
||||
*/
|
||||
static void
|
||||
ReadShader(GLuint shader, const char *filename)
|
||||
{
|
||||
const int max = 100*1000;
|
||||
int n;
|
||||
char *buffer = (char*) malloc(max);
|
||||
FILE *f = fopen(filename, "r");
|
||||
if (!f) {
|
||||
fprintf(stderr, "brick: Unable to open shader file %s\n", filename);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
n = fread(buffer, 1, max, f);
|
||||
printf("brick: read %d bytes from shader file %s\n", n, filename);
|
||||
if (n > 0) {
|
||||
buffer[n] = 0;
|
||||
LoadAndCompileShader(shader, buffer);
|
||||
}
|
||||
|
||||
fclose(f);
|
||||
free(buffer);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
CheckLink(GLuint prog)
|
||||
{
|
||||
GLint stat;
|
||||
glGetProgramiv_func(prog, GL_LINK_STATUS, &stat);
|
||||
if (!stat) {
|
||||
GLchar log[1000];
|
||||
GLsizei len;
|
||||
glGetProgramInfoLog_func(prog, 1000, &len, log);
|
||||
fprintf(stderr, "Linker error:\n%s\n", log);
|
||||
}
|
||||
else {
|
||||
fprintf(stderr, "Link success!\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Init(void)
|
||||
{
|
||||
const char *version;
|
||||
GLint i;
|
||||
|
||||
version = (const char *) glGetString(GL_VERSION);
|
||||
if (version[0] != '2' || version[1] != '.') {
|
||||
printf("Warning: this program expects OpenGL 2.0\n");
|
||||
/*exit(1);*/
|
||||
}
|
||||
printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER));
|
||||
|
||||
GetExtensionFuncs();
|
||||
|
||||
vertShader = glCreateShader_func(GL_VERTEX_SHADER);
|
||||
ReadShader(vertShader, VertProgFile);
|
||||
|
||||
fragShader = glCreateShader_func(GL_FRAGMENT_SHADER);
|
||||
ReadShader(fragShader, FragProgFile);
|
||||
|
||||
program = glCreateProgram_func();
|
||||
glAttachShader_func(program, fragShader);
|
||||
glAttachShader_func(program, vertShader);
|
||||
glLinkProgram_func(program);
|
||||
CheckLink(program);
|
||||
glUseProgram_func(program);
|
||||
|
||||
assert(glIsProgram_func(program));
|
||||
assert(glIsShader_func(fragShader));
|
||||
assert(glIsShader_func(vertShader));
|
||||
|
||||
assert(glGetError() == 0);
|
||||
|
||||
CheckError(__LINE__);
|
||||
|
||||
for (i = 0; Uniforms[i].name; i++) {
|
||||
Uniforms[i].location
|
||||
= glGetUniformLocation_func(program, Uniforms[i].name);
|
||||
printf("Uniform %s location: %d\n", Uniforms[i].name,
|
||||
Uniforms[i].location);
|
||||
switch (Uniforms[i].size) {
|
||||
case 1:
|
||||
glUniform1fv_func(Uniforms[i].location, 1, Uniforms[i].value);
|
||||
break;
|
||||
case 2:
|
||||
glUniform2fv_func(Uniforms[i].location, 1, Uniforms[i].value);
|
||||
break;
|
||||
case 3:
|
||||
glUniform3fv_func(Uniforms[i].location, 1, Uniforms[i].value);
|
||||
break;
|
||||
case 4:
|
||||
glUniform4fv_func(Uniforms[i].location, 1, Uniforms[i].value);
|
||||
break;
|
||||
default:
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
||||
CheckError(__LINE__);
|
||||
|
||||
tangentAttrib = glGetAttribLocation_func(program, "Tangent");
|
||||
printf("Tangent Attrib: %d\n", tangentAttrib);
|
||||
|
||||
assert(tangentAttrib >= 0);
|
||||
|
||||
CheckError(__LINE__);
|
||||
|
||||
glClearColor(0.4f, 0.4f, 0.8f, 0.0f);
|
||||
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
|
||||
glColor3f(1, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
ParseOptions(int argc, char *argv[])
|
||||
{
|
||||
int i;
|
||||
for (i = 1; i < argc; i++) {
|
||||
if (strcmp(argv[i], "-fs") == 0) {
|
||||
FragProgFile = argv[i+1];
|
||||
}
|
||||
else if (strcmp(argv[i], "-vs") == 0) {
|
||||
VertProgFile = argv[i+1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
glutInit(&argc, argv);
|
||||
glutInitWindowPosition( 0, 0);
|
||||
glutInitWindowSize(400, 400);
|
||||
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
|
||||
win = glutCreateWindow(argv[0]);
|
||||
glutReshapeFunc(Reshape);
|
||||
glutKeyboardFunc(Key);
|
||||
glutSpecialFunc(SpecialKey);
|
||||
glutDisplayFunc(Redisplay);
|
||||
ParseOptions(argc, argv);
|
||||
Init();
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
||||
|
@@ -1,18 +0,0 @@
|
||||
// Fragment shader for cube-texture reflection mapping
|
||||
// Brian Paul
|
||||
|
||||
|
||||
uniform samplerCube cubeTex;
|
||||
varying vec3 normal;
|
||||
uniform vec3 lightPos;
|
||||
|
||||
void main()
|
||||
{
|
||||
// simple diffuse, specular lighting:
|
||||
vec3 lp = normalize(lightPos);
|
||||
float dp = dot(lp, normalize(normal));
|
||||
float spec = pow(dp, 5.0);
|
||||
|
||||
// final color:
|
||||
gl_FragColor = dp * textureCube(cubeTex, gl_TexCoord[0].xyz, 0.0) + spec;
|
||||
}
|
@@ -1,328 +0,0 @@
|
||||
/**
|
||||
* "Mandelbrot" shader demo. Uses the example shaders from
|
||||
* chapter 15 (or 18) of the OpenGL Shading Language "orange" book.
|
||||
* 15 Jan 2007
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glut.h>
|
||||
#include <GL/glext.h>
|
||||
#include "extfuncs.h"
|
||||
|
||||
|
||||
static char *FragProgFile = "CH18-mandel.frag.txt";
|
||||
static char *VertProgFile = "CH18-mandel.vert.txt";
|
||||
|
||||
/* program/shader objects */
|
||||
static GLuint fragShader;
|
||||
static GLuint vertShader;
|
||||
static GLuint program;
|
||||
|
||||
|
||||
struct uniform_info {
|
||||
const char *name;
|
||||
GLuint size;
|
||||
GLint location;
|
||||
GLfloat value[4];
|
||||
};
|
||||
|
||||
static struct uniform_info Uniforms[] = {
|
||||
/* vert */
|
||||
{ "LightPosition", 3, -1, { 0.1, 0.1, 9.0, 0} },
|
||||
{ "SpecularContribution", 1, -1, { 0.5, 0, 0, 0 } },
|
||||
{ "DiffuseContribution", 1, -1, { 0.5, 0, 0, 0 } },
|
||||
{ "Shininess", 1, -1, { 20.0, 0, 0, 0 } },
|
||||
/* frag */
|
||||
{ "MaxIterations", 1, -1, { 12, 0, 0, 0 } },
|
||||
{ "Zoom", 1, -1, { 0.125, 0, 0, 0 } },
|
||||
{ "Xcenter", 1, -1, { -1.5, 0, 0, 0 } },
|
||||
{ "Ycenter", 1, -1, { .005, 0, 0, 0 } },
|
||||
{ "InnerColor", 3, -1, { 1, 0, 0, 0 } },
|
||||
{ "OuterColor1", 3, -1, { 0, 1, 0, 0 } },
|
||||
{ "OuterColor2", 3, -1, { 0, 0, 1, 0 } },
|
||||
{ NULL, 0, 0, { 0, 0, 0, 0 } }
|
||||
};
|
||||
|
||||
static GLint win = 0;
|
||||
|
||||
static GLfloat xRot = 0.0f, yRot = 0.0f, zRot = 0.0f;
|
||||
|
||||
static GLint uZoom, uXcenter, uYcenter;
|
||||
static GLfloat zoom = 1.0, xCenter = -1.5, yCenter = 0.0;
|
||||
|
||||
|
||||
static void
|
||||
Redisplay(void)
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
/* set interactive uniform parameters */
|
||||
glUniform1fv_func(uZoom, 1, &zoom);
|
||||
glUniform1fv_func(uXcenter, 1, &xCenter);
|
||||
glUniform1fv_func(uYcenter, 1, &yCenter);
|
||||
|
||||
glPushMatrix();
|
||||
glRotatef(xRot, 1.0f, 0.0f, 0.0f);
|
||||
glRotatef(yRot, 0.0f, 1.0f, 0.0f);
|
||||
glRotatef(zRot, 0.0f, 0.0f, 1.0f);
|
||||
|
||||
glBegin(GL_POLYGON);
|
||||
glTexCoord2f(0, 0); glVertex2f(-1, -1);
|
||||
glTexCoord2f(1, 0); glVertex2f( 1, -1);
|
||||
glTexCoord2f(1, 1); glVertex2f( 1, 1);
|
||||
glTexCoord2f(0, 1); glVertex2f(-1, 1);
|
||||
glEnd();
|
||||
|
||||
glPopMatrix();
|
||||
|
||||
glFinish();
|
||||
glFlush();
|
||||
glutSwapBuffers();
|
||||
}
|
||||
|
||||
|
||||
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, -6.0f);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
CleanUp(void)
|
||||
{
|
||||
glDeleteShader_func(fragShader);
|
||||
glDeleteShader_func(vertShader);
|
||||
glDeleteProgram_func(program);
|
||||
glutDestroyWindow(win);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Key(unsigned char key, int x, int y)
|
||||
{
|
||||
(void) x;
|
||||
(void) y;
|
||||
|
||||
switch(key) {
|
||||
case 'z':
|
||||
zoom *= 0.9;
|
||||
break;
|
||||
case 'Z':
|
||||
zoom /= 0.9;
|
||||
break;
|
||||
case 27:
|
||||
CleanUp();
|
||||
exit(0);
|
||||
break;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
SpecialKey(int key, int x, int y)
|
||||
{
|
||||
const GLfloat step = 0.1 * zoom;
|
||||
|
||||
(void) x;
|
||||
(void) y;
|
||||
|
||||
switch(key) {
|
||||
case GLUT_KEY_UP:
|
||||
yCenter += step;
|
||||
break;
|
||||
case GLUT_KEY_DOWN:
|
||||
yCenter -= step;
|
||||
break;
|
||||
case GLUT_KEY_LEFT:
|
||||
xCenter -= step;
|
||||
break;
|
||||
case GLUT_KEY_RIGHT:
|
||||
xCenter += step;
|
||||
break;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
LoadAndCompileShader(GLuint shader, const char *text)
|
||||
{
|
||||
GLint stat;
|
||||
|
||||
glShaderSource_func(shader, 1, (const GLchar **) &text, NULL);
|
||||
|
||||
glCompileShader_func(shader);
|
||||
|
||||
glGetShaderiv_func(shader, GL_COMPILE_STATUS, &stat);
|
||||
if (!stat) {
|
||||
GLchar log[1000];
|
||||
GLsizei len;
|
||||
glGetShaderInfoLog_func(shader, 1000, &len, log);
|
||||
fprintf(stderr, "brick: problem compiling shader: %s\n", log);
|
||||
exit(1);
|
||||
}
|
||||
else {
|
||||
printf("Shader compiled OK\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Read a shader from a file.
|
||||
*/
|
||||
static void
|
||||
ReadShader(GLuint shader, const char *filename)
|
||||
{
|
||||
const int max = 100*1000;
|
||||
int n;
|
||||
char *buffer = (char*) malloc(max);
|
||||
FILE *f = fopen(filename, "r");
|
||||
if (!f) {
|
||||
fprintf(stderr, "brick: Unable to open shader file %s\n", filename);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
n = fread(buffer, 1, max, f);
|
||||
printf("brick: read %d bytes from shader file %s\n", n, filename);
|
||||
if (n > 0) {
|
||||
buffer[n] = 0;
|
||||
LoadAndCompileShader(shader, buffer);
|
||||
}
|
||||
|
||||
fclose(f);
|
||||
free(buffer);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
CheckLink(GLuint prog)
|
||||
{
|
||||
GLint stat;
|
||||
glGetProgramiv_func(prog, GL_LINK_STATUS, &stat);
|
||||
if (!stat) {
|
||||
GLchar log[1000];
|
||||
GLsizei len;
|
||||
glGetProgramInfoLog_func(prog, 1000, &len, log);
|
||||
fprintf(stderr, "Linker error:\n%s\n", log);
|
||||
}
|
||||
else {
|
||||
fprintf(stderr, "Link success!\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Init(void)
|
||||
{
|
||||
const char *version;
|
||||
GLint i;
|
||||
|
||||
version = (const char *) glGetString(GL_VERSION);
|
||||
if (version[0] != '2' || version[1] != '.') {
|
||||
printf("Warning: this program expects OpenGL 2.0\n");
|
||||
/*exit(1);*/
|
||||
}
|
||||
|
||||
GetExtensionFuncs();
|
||||
|
||||
vertShader = glCreateShader_func(GL_VERTEX_SHADER);
|
||||
ReadShader(vertShader, VertProgFile);
|
||||
|
||||
fragShader = glCreateShader_func(GL_FRAGMENT_SHADER);
|
||||
ReadShader(fragShader, FragProgFile);
|
||||
|
||||
program = glCreateProgram_func();
|
||||
glAttachShader_func(program, fragShader);
|
||||
glAttachShader_func(program, vertShader);
|
||||
glLinkProgram_func(program);
|
||||
CheckLink(program);
|
||||
glUseProgram_func(program);
|
||||
|
||||
for (i = 0; Uniforms[i].name; i++) {
|
||||
Uniforms[i].location
|
||||
= glGetUniformLocation_func(program, Uniforms[i].name);
|
||||
printf("Uniform %s location: %d\n", Uniforms[i].name,
|
||||
Uniforms[i].location);
|
||||
switch (Uniforms[i].size) {
|
||||
case 1:
|
||||
glUniform1fv_func(Uniforms[i].location, 1, Uniforms[i].value);
|
||||
break;
|
||||
case 2:
|
||||
glUniform2fv_func(Uniforms[i].location, 1, Uniforms[i].value);
|
||||
break;
|
||||
case 3:
|
||||
glUniform3fv_func(Uniforms[i].location, 1, Uniforms[i].value);
|
||||
break;
|
||||
case 4:
|
||||
glUniform4fv_func(Uniforms[i].location, 1, Uniforms[i].value);
|
||||
break;
|
||||
default:
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
||||
uZoom = glGetUniformLocation_func(program, "Zoom");
|
||||
uXcenter = glGetUniformLocation_func(program, "Xcenter");
|
||||
uYcenter = glGetUniformLocation_func(program, "Ycenter");
|
||||
|
||||
assert(glGetError() == 0);
|
||||
|
||||
glClearColor(0.4f, 0.4f, 0.8f, 0.0f);
|
||||
|
||||
printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER));
|
||||
|
||||
assert(glIsProgram_func(program));
|
||||
assert(glIsShader_func(fragShader));
|
||||
assert(glIsShader_func(vertShader));
|
||||
|
||||
glColor3f(1, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
ParseOptions(int argc, char *argv[])
|
||||
{
|
||||
int i;
|
||||
for (i = 1; i < argc; i++) {
|
||||
if (strcmp(argv[i], "-fs") == 0) {
|
||||
FragProgFile = argv[i+1];
|
||||
}
|
||||
else if (strcmp(argv[i], "-vs") == 0) {
|
||||
VertProgFile = argv[i+1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
glutInit(&argc, argv);
|
||||
glutInitWindowPosition( 0, 0);
|
||||
glutInitWindowSize(400, 400);
|
||||
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
|
||||
win = glutCreateWindow(argv[0]);
|
||||
glutReshapeFunc(Reshape);
|
||||
glutKeyboardFunc(Key);
|
||||
glutSpecialFunc(SpecialKey);
|
||||
glutDisplayFunc(Redisplay);
|
||||
ParseOptions(argc, argv);
|
||||
Init();
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
||||
|
@@ -1,297 +0,0 @@
|
||||
/**
|
||||
* Test noise() functions.
|
||||
* 28 Jan 2007
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glut.h>
|
||||
#include <GL/glext.h>
|
||||
#include "extfuncs.h"
|
||||
|
||||
|
||||
static const char *VertShaderText =
|
||||
"void main() {\n"
|
||||
" gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n"
|
||||
" gl_TexCoord[0] = gl_MultiTexCoord0;\n"
|
||||
"}\n";
|
||||
|
||||
static const char *FragShaderText =
|
||||
"uniform vec4 Scale, Bias;\n"
|
||||
"uniform float Slice;\n"
|
||||
"void main()\n"
|
||||
"{\n"
|
||||
" vec4 scale = vec4(5.0);\n"
|
||||
" vec4 p;\n"
|
||||
" p.xy = gl_TexCoord[0].xy;\n"
|
||||
" p.z = Slice;\n"
|
||||
" vec4 n = noise4(p * scale);\n"
|
||||
" gl_FragColor = n * Scale + Bias;\n"
|
||||
"}\n";
|
||||
|
||||
|
||||
struct uniform_info {
|
||||
const char *name;
|
||||
GLuint size;
|
||||
GLint location;
|
||||
GLfloat value[4];
|
||||
};
|
||||
|
||||
static struct uniform_info Uniforms[] = {
|
||||
{ "Scale", 4, -1, { 0.5, 0.4, 0.0, 0} },
|
||||
{ "Bias", 4, -1, { 0.5, 0.3, 0.0, 0} },
|
||||
{ "Slice", 1, -1, { 0.5, 0, 0, 0} },
|
||||
{ NULL, 0, 0, { 0, 0, 0, 0 } }
|
||||
};
|
||||
|
||||
/* program/shader objects */
|
||||
static GLuint fragShader;
|
||||
static GLuint vertShader;
|
||||
static GLuint program;
|
||||
|
||||
static GLint win = 0;
|
||||
static GLfloat xRot = 0.0f, yRot = 0.0f, zRot = 0.0f;
|
||||
static GLfloat Slice = 0.0;
|
||||
static GLboolean Anim = GL_FALSE;
|
||||
|
||||
|
||||
static void
|
||||
Idle(void)
|
||||
{
|
||||
Slice += 0.01;
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Redisplay(void)
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
glUniform1fv_func(Uniforms[2].location, 1, &Slice);
|
||||
|
||||
glPushMatrix();
|
||||
glRotatef(xRot, 1.0f, 0.0f, 0.0f);
|
||||
glRotatef(yRot, 0.0f, 1.0f, 0.0f);
|
||||
glRotatef(zRot, 0.0f, 0.0f, 1.0f);
|
||||
|
||||
glBegin(GL_POLYGON);
|
||||
glTexCoord2f(0, 0); glVertex2f(-2, -2);
|
||||
glTexCoord2f(1, 0); glVertex2f( 2, -2);
|
||||
glTexCoord2f(1, 1); glVertex2f( 2, 2);
|
||||
glTexCoord2f(0, 1); glVertex2f(-2, 2);
|
||||
glEnd();
|
||||
|
||||
glPopMatrix();
|
||||
|
||||
glutSwapBuffers();
|
||||
}
|
||||
|
||||
|
||||
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
|
||||
CleanUp(void)
|
||||
{
|
||||
glDeleteShader_func(fragShader);
|
||||
glDeleteShader_func(vertShader);
|
||||
glDeleteProgram_func(program);
|
||||
glutDestroyWindow(win);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Key(unsigned char key, int x, int y)
|
||||
{
|
||||
const GLfloat step = 0.01;
|
||||
(void) x;
|
||||
(void) y;
|
||||
|
||||
switch(key) {
|
||||
case 'a':
|
||||
Anim = !Anim;
|
||||
glutIdleFunc(Anim ? Idle : NULL);
|
||||
case 's':
|
||||
Slice -= step;
|
||||
break;
|
||||
case 'S':
|
||||
Slice += step;
|
||||
break;
|
||||
case 'z':
|
||||
zRot -= 1.0;
|
||||
break;
|
||||
case 'Z':
|
||||
zRot += 1.0;
|
||||
break;
|
||||
case 27:
|
||||
CleanUp();
|
||||
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
|
||||
LoadAndCompileShader(GLuint shader, const char *text)
|
||||
{
|
||||
GLint stat;
|
||||
|
||||
glShaderSource_func(shader, 1, (const GLchar **) &text, NULL);
|
||||
|
||||
glCompileShader_func(shader);
|
||||
|
||||
glGetShaderiv_func(shader, GL_COMPILE_STATUS, &stat);
|
||||
if (!stat) {
|
||||
GLchar log[1000];
|
||||
GLsizei len;
|
||||
glGetShaderInfoLog_func(shader, 1000, &len, log);
|
||||
fprintf(stderr, "brick: problem compiling shader: %s\n", log);
|
||||
exit(1);
|
||||
}
|
||||
else {
|
||||
printf("Shader compiled OK\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
CheckLink(GLuint prog)
|
||||
{
|
||||
GLint stat;
|
||||
glGetProgramiv_func(prog, GL_LINK_STATUS, &stat);
|
||||
if (!stat) {
|
||||
GLchar log[1000];
|
||||
GLsizei len;
|
||||
glGetProgramInfoLog_func(prog, 1000, &len, log);
|
||||
fprintf(stderr, "Linker error:\n%s\n", log);
|
||||
}
|
||||
else {
|
||||
fprintf(stderr, "Link success!\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Init(void)
|
||||
{
|
||||
const char *version;
|
||||
GLint i;
|
||||
|
||||
version = (const char *) glGetString(GL_VERSION);
|
||||
if (version[0] != '2' || version[1] != '.') {
|
||||
printf("Warning: this program expects OpenGL 2.0\n");
|
||||
/*exit(1);*/
|
||||
}
|
||||
|
||||
GetExtensionFuncs();
|
||||
|
||||
vertShader = glCreateShader_func(GL_VERTEX_SHADER);
|
||||
LoadAndCompileShader(vertShader, VertShaderText);
|
||||
|
||||
fragShader = glCreateShader_func(GL_FRAGMENT_SHADER);
|
||||
LoadAndCompileShader(fragShader, FragShaderText);
|
||||
|
||||
program = glCreateProgram_func();
|
||||
glAttachShader_func(program, fragShader);
|
||||
glAttachShader_func(program, vertShader);
|
||||
glLinkProgram_func(program);
|
||||
CheckLink(program);
|
||||
glUseProgram_func(program);
|
||||
|
||||
for (i = 0; Uniforms[i].name; i++) {
|
||||
Uniforms[i].location
|
||||
= glGetUniformLocation_func(program, Uniforms[i].name);
|
||||
printf("Uniform %s location: %d\n", Uniforms[i].name,
|
||||
Uniforms[i].location);
|
||||
switch (Uniforms[i].size) {
|
||||
case 1:
|
||||
glUniform1fv_func(Uniforms[i].location, 1, Uniforms[i].value);
|
||||
break;
|
||||
case 2:
|
||||
glUniform2fv_func(Uniforms[i].location, 1, Uniforms[i].value);
|
||||
break;
|
||||
case 3:
|
||||
glUniform3fv_func(Uniforms[i].location, 1, Uniforms[i].value);
|
||||
break;
|
||||
case 4:
|
||||
glUniform4fv_func(Uniforms[i].location, 1, Uniforms[i].value);
|
||||
break;
|
||||
default:
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
||||
assert(glGetError() == 0);
|
||||
|
||||
glClearColor(0.4f, 0.4f, 0.8f, 0.0f);
|
||||
|
||||
printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER));
|
||||
|
||||
assert(glIsProgram_func(program));
|
||||
assert(glIsShader_func(fragShader));
|
||||
assert(glIsShader_func(vertShader));
|
||||
|
||||
glColor3f(1, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
glutInit(&argc, argv);
|
||||
glutInitWindowPosition( 0, 0);
|
||||
glutInitWindowSize(400, 400);
|
||||
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
|
||||
win = glutCreateWindow(argv[0]);
|
||||
glutReshapeFunc(Reshape);
|
||||
glutKeyboardFunc(Key);
|
||||
glutSpecialFunc(SpecialKey);
|
||||
glutDisplayFunc(Redisplay);
|
||||
Init();
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
||||
|
@@ -1,19 +0,0 @@
|
||||
// Vertex shader for cube-texture reflection mapping
|
||||
// Brian Paul
|
||||
|
||||
|
||||
varying vec3 normal;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec3 n = gl_NormalMatrix * gl_Normal;
|
||||
vec3 u = normalize(vec3(gl_ModelViewMatrix * gl_Vertex));
|
||||
float two_n_dot_u = 2.0 * dot(n, u);
|
||||
vec4 f;
|
||||
f.xyz = u - n * two_n_dot_u;
|
||||
|
||||
// outputs
|
||||
normal = n;
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * f;
|
||||
gl_Position = ftransform();
|
||||
}
|
@@ -1,21 +0,0 @@
|
||||
// Fragment shader for 2D texture with shadow attenuation
|
||||
// Brian Paul
|
||||
|
||||
|
||||
uniform sampler2D tex2d;
|
||||
uniform vec3 lightPos;
|
||||
|
||||
void main()
|
||||
{
|
||||
// XXX should compute this from lightPos
|
||||
vec2 shadowCenter = vec2(-0.25, -0.25);
|
||||
|
||||
// d = distance from center
|
||||
float d = distance(gl_TexCoord[0].xy, shadowCenter);
|
||||
|
||||
// attenuate and clamp
|
||||
d = clamp(d * d * d, 0.0, 2.0);
|
||||
|
||||
// modulate texture by d for shadow effect
|
||||
gl_FragColor = d * texture2D(tex2d, gl_TexCoord[0].xy, 0.0);
|
||||
}
|
@@ -1,9 +0,0 @@
|
||||
// Simple vertex shader
|
||||
// Brian Paul
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||
gl_Position = ftransform();
|
||||
}
|
@@ -1,570 +0,0 @@
|
||||
/**
|
||||
* Test texturing with GL shading language.
|
||||
*
|
||||
* Copyright (C) 2007 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include <assert.h>
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "GL/glut.h"
|
||||
#include "readtex.h"
|
||||
#include "extfuncs.h"
|
||||
|
||||
static const char *Demo = "texdemo1";
|
||||
|
||||
static const char *ReflectVertFile = "reflect.vert.txt";
|
||||
static const char *CubeFragFile = "cubemap.frag.txt";
|
||||
|
||||
static const char *SimpleVertFile = "simple.vert.txt";
|
||||
static const char *SimpleTexFragFile = "shadowtex.frag.txt";
|
||||
|
||||
static const char *GroundImage = "../images/tile.rgb";
|
||||
|
||||
static GLuint Program1, Program2;
|
||||
|
||||
static GLfloat TexXrot = 0, TexYrot = 0;
|
||||
static GLfloat Xrot = 20.0, Yrot = 20.0, Zrot = 0.0;
|
||||
static GLfloat EyeDist = 10;
|
||||
static GLboolean Anim = GL_TRUE;
|
||||
|
||||
|
||||
struct uniform_info {
|
||||
const char *name;
|
||||
GLuint size;
|
||||
GLint location;
|
||||
GLenum type; /**< GL_FLOAT or GL_INT */
|
||||
GLfloat value[4];
|
||||
};
|
||||
|
||||
static struct uniform_info ReflectUniforms[] = {
|
||||
{ "cubeTex", 1, -1, GL_INT, { 0, 0, 0, 0 } },
|
||||
{ "lightPos", 3, -1, GL_FLOAT, { 10, 10, 20, 0 } },
|
||||
{ NULL, 0, 0, 0, { 0, 0, 0, 0 } }
|
||||
};
|
||||
|
||||
static struct uniform_info SimpleUniforms[] = {
|
||||
{ "tex2d", 1, -1, GL_INT, { 1, 0, 0, 0 } },
|
||||
{ "lightPos", 3, -1, GL_FLOAT, { 10, 10, 20, 0 } },
|
||||
{ NULL, 0, 0, 0, { 0, 0, 0, 0 } }
|
||||
};
|
||||
|
||||
|
||||
static void
|
||||
CheckError(int line)
|
||||
{
|
||||
GLenum err = glGetError();
|
||||
if (err) {
|
||||
printf("GL Error %s (0x%x) at line %d\n",
|
||||
gluErrorString(err), (int) err, line);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
DrawGround(GLfloat size)
|
||||
{
|
||||
glPushMatrix();
|
||||
glRotatef(90, 1, 0, 0);
|
||||
glNormal3f(0, 0, 1);
|
||||
glBegin(GL_POLYGON);
|
||||
glTexCoord2f(-2, -2); glVertex2f(-size, -size);
|
||||
glTexCoord2f( 2, -2); glVertex2f( size, -size);
|
||||
glTexCoord2f( 2, 2); glVertex2f( size, size);
|
||||
glTexCoord2f(-2, 2); glVertex2f(-size, size);
|
||||
glEnd();
|
||||
glPopMatrix();
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
draw(void)
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
|
||||
glPushMatrix(); /* modelview matrix */
|
||||
glTranslatef(0.0, 0.0, -EyeDist);
|
||||
glRotatef(Xrot, 1, 0, 0);
|
||||
glRotatef(Yrot, 0, 1, 0);
|
||||
glRotatef(Zrot, 0, 0, 1);
|
||||
|
||||
/* sphere w/ reflection map */
|
||||
glPushMatrix();
|
||||
glTranslatef(0, 1, 0);
|
||||
glUseProgram_func(Program1);
|
||||
|
||||
/* setup texture matrix */
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
glMatrixMode(GL_TEXTURE);
|
||||
glLoadIdentity();
|
||||
glRotatef(-TexYrot, 0, 1, 0);
|
||||
glRotatef(-TexXrot, 1, 0, 0);
|
||||
|
||||
glEnable(GL_TEXTURE_GEN_S);
|
||||
glEnable(GL_TEXTURE_GEN_T);
|
||||
glEnable(GL_TEXTURE_GEN_R);
|
||||
glutSolidSphere(2.0, 20, 20);
|
||||
|
||||
glLoadIdentity(); /* texture matrix */
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glPopMatrix();
|
||||
|
||||
/* ground */
|
||||
glUseProgram_func(Program2);
|
||||
glTranslatef(0, -1.0, 0);
|
||||
DrawGround(5);
|
||||
|
||||
glPopMatrix();
|
||||
|
||||
glutSwapBuffers();
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
idle(void)
|
||||
{
|
||||
GLfloat t = 0.05 * glutGet(GLUT_ELAPSED_TIME);
|
||||
TexYrot = t;
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
key(unsigned char k, int x, int y)
|
||||
{
|
||||
(void) x;
|
||||
(void) y;
|
||||
switch (k) {
|
||||
case ' ':
|
||||
case 'a':
|
||||
Anim = !Anim;
|
||||
if (Anim)
|
||||
glutIdleFunc(idle);
|
||||
else
|
||||
glutIdleFunc(NULL);
|
||||
break;
|
||||
case 'z':
|
||||
EyeDist -= 0.5;
|
||||
if (EyeDist < 6.0)
|
||||
EyeDist = 6.0;
|
||||
break;
|
||||
case 'Z':
|
||||
EyeDist += 0.5;
|
||||
if (EyeDist > 90.0)
|
||||
EyeDist = 90;
|
||||
break;
|
||||
case 27:
|
||||
exit(0);
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
specialkey(int key, int x, int y)
|
||||
{
|
||||
GLfloat step = 2.0;
|
||||
(void) x;
|
||||
(void) y;
|
||||
switch (key) {
|
||||
case GLUT_KEY_UP:
|
||||
Xrot += step;
|
||||
break;
|
||||
case GLUT_KEY_DOWN:
|
||||
Xrot -= step;
|
||||
break;
|
||||
case GLUT_KEY_LEFT:
|
||||
Yrot -= step;
|
||||
break;
|
||||
case GLUT_KEY_RIGHT:
|
||||
Yrot += step;
|
||||
break;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
/* new window size or exposure */
|
||||
static void
|
||||
Reshape(int width, int height)
|
||||
{
|
||||
GLfloat ar = (float) width / (float) height;
|
||||
glViewport(0, 0, (GLint)width, (GLint)height);
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glFrustum(-2.0*ar, 2.0*ar, -2.0, 2.0, 4.0, 100.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
InitCheckers(void)
|
||||
{
|
||||
#define CUBE_TEX_SIZE 64
|
||||
GLubyte image[CUBE_TEX_SIZE][CUBE_TEX_SIZE][3];
|
||||
static const GLubyte colors[6][3] = {
|
||||
{ 255, 0, 0 }, /* face 0 - red */
|
||||
{ 0, 255, 255 }, /* face 1 - cyan */
|
||||
{ 0, 255, 0 }, /* face 2 - green */
|
||||
{ 255, 0, 255 }, /* face 3 - purple */
|
||||
{ 0, 0, 255 }, /* face 4 - blue */
|
||||
{ 255, 255, 0 } /* face 5 - yellow */
|
||||
};
|
||||
static const GLenum targets[6] = {
|
||||
GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB,
|
||||
GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB,
|
||||
GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB,
|
||||
GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB,
|
||||
GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB,
|
||||
GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB
|
||||
};
|
||||
|
||||
GLint i, j, f;
|
||||
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
|
||||
/* make colored checkerboard cube faces */
|
||||
for (f = 0; f < 6; f++) {
|
||||
for (i = 0; i < CUBE_TEX_SIZE; i++) {
|
||||
for (j = 0; j < CUBE_TEX_SIZE; j++) {
|
||||
if ((i/4 + j/4) & 1) {
|
||||
image[i][j][0] = colors[f][0];
|
||||
image[i][j][1] = colors[f][1];
|
||||
image[i][j][2] = colors[f][2];
|
||||
}
|
||||
else {
|
||||
image[i][j][0] = 255;
|
||||
image[i][j][1] = 255;
|
||||
image[i][j][2] = 255;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
glTexImage2D(targets[f], 0, GL_RGB, CUBE_TEX_SIZE, CUBE_TEX_SIZE, 0,
|
||||
GL_RGB, GL_UNSIGNED_BYTE, image);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
LoadFace(GLenum target, const char *filename,
|
||||
GLboolean flipTB, GLboolean flipLR)
|
||||
{
|
||||
GLint w, h;
|
||||
GLenum format;
|
||||
GLubyte *img = LoadRGBImage(filename, &w, &h, &format);
|
||||
if (!img) {
|
||||
printf("Error: couldn't load texture image %s\n", filename);
|
||||
exit(1);
|
||||
}
|
||||
assert(format == GL_RGB);
|
||||
|
||||
/* <sigh> the way the texture cube mapping works, we have to flip
|
||||
* images to make things look right.
|
||||
*/
|
||||
if (flipTB) {
|
||||
const int stride = 3 * w;
|
||||
GLubyte temp[3*1024];
|
||||
int i;
|
||||
for (i = 0; i < h / 2; i++) {
|
||||
memcpy(temp, img + i * stride, stride);
|
||||
memcpy(img + i * stride, img + (h - i - 1) * stride, stride);
|
||||
memcpy(img + (h - i - 1) * stride, temp, stride);
|
||||
}
|
||||
}
|
||||
if (flipLR) {
|
||||
const int stride = 3 * w;
|
||||
GLubyte temp[3];
|
||||
GLubyte *row;
|
||||
int i, j;
|
||||
for (i = 0; i < h; i++) {
|
||||
row = img + i * stride;
|
||||
for (j = 0; j < w / 2; j++) {
|
||||
int k = w - j - 1;
|
||||
temp[0] = row[j*3+0];
|
||||
temp[1] = row[j*3+1];
|
||||
temp[2] = row[j*3+2];
|
||||
row[j*3+0] = row[k*3+0];
|
||||
row[j*3+1] = row[k*3+1];
|
||||
row[j*3+2] = row[k*3+2];
|
||||
row[k*3+0] = temp[0];
|
||||
row[k*3+1] = temp[1];
|
||||
row[k*3+2] = temp[2];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
gluBuild2DMipmaps(target, GL_RGB, w, h, format, GL_UNSIGNED_BYTE, img);
|
||||
free(img);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
LoadEnvmaps(void)
|
||||
{
|
||||
LoadFace(GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB, "right.rgb", GL_TRUE, GL_FALSE);
|
||||
LoadFace(GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB, "left.rgb", GL_TRUE, GL_FALSE);
|
||||
LoadFace(GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB, "top.rgb", GL_FALSE, GL_TRUE);
|
||||
LoadFace(GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB, "bottom.rgb", GL_FALSE, GL_TRUE);
|
||||
LoadFace(GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB, "front.rgb", GL_TRUE, GL_FALSE);
|
||||
LoadFace(GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB, "back.rgb", GL_TRUE, GL_FALSE);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
InitTextures(GLboolean useImageFiles)
|
||||
{
|
||||
GLenum filter;
|
||||
|
||||
/*
|
||||
* Env map
|
||||
*/
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
glBindTexture(GL_TEXTURE_CUBE_MAP, 1);
|
||||
if (useImageFiles) {
|
||||
LoadEnvmaps();
|
||||
filter = GL_LINEAR;
|
||||
}
|
||||
else {
|
||||
InitCheckers();
|
||||
filter = GL_NEAREST;
|
||||
}
|
||||
glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_MIN_FILTER, filter);
|
||||
glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_MAG_FILTER, filter);
|
||||
glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
|
||||
/*
|
||||
* Ground texture
|
||||
*/
|
||||
{
|
||||
GLint imgWidth, imgHeight;
|
||||
GLenum imgFormat;
|
||||
GLubyte *image = NULL;
|
||||
|
||||
image = LoadRGBImage(GroundImage, &imgWidth, &imgHeight, &imgFormat);
|
||||
if (!image) {
|
||||
printf("Couldn't read %s\n", GroundImage);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
glActiveTexture(GL_TEXTURE1);
|
||||
glBindTexture(GL_TEXTURE_2D, 2);
|
||||
gluBuild2DMipmaps(GL_TEXTURE_2D, 3, imgWidth, imgHeight,
|
||||
imgFormat, GL_UNSIGNED_BYTE, image);
|
||||
free(image);
|
||||
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
LoadAndCompileShader(GLuint shader, const char *text)
|
||||
{
|
||||
GLint stat;
|
||||
|
||||
glShaderSource_func(shader, 1, (const GLchar **) &text, NULL);
|
||||
|
||||
glCompileShader_func(shader);
|
||||
|
||||
glGetShaderiv_func(shader, GL_COMPILE_STATUS, &stat);
|
||||
if (!stat) {
|
||||
GLchar log[1000];
|
||||
GLsizei len;
|
||||
glGetShaderInfoLog_func(shader, 1000, &len, log);
|
||||
fprintf(stderr, "%s: problem compiling shader: %s\n", Demo, log);
|
||||
exit(1);
|
||||
}
|
||||
else {
|
||||
printf("Shader compiled OK\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Read a shader from a file.
|
||||
*/
|
||||
static void
|
||||
ReadShader(GLuint shader, const char *filename)
|
||||
{
|
||||
const int max = 100*1000;
|
||||
int n;
|
||||
char *buffer = (char*) malloc(max);
|
||||
FILE *f = fopen(filename, "r");
|
||||
if (!f) {
|
||||
fprintf(stderr, "%s: Unable to open shader file %s\n", Demo, filename);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
n = fread(buffer, 1, max, f);
|
||||
printf("%s: read %d bytes from shader file %s\n", Demo, n, filename);
|
||||
if (n > 0) {
|
||||
buffer[n] = 0;
|
||||
LoadAndCompileShader(shader, buffer);
|
||||
}
|
||||
|
||||
fclose(f);
|
||||
free(buffer);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
CheckLink(GLuint prog)
|
||||
{
|
||||
GLint stat;
|
||||
glGetProgramiv_func(prog, GL_LINK_STATUS, &stat);
|
||||
if (!stat) {
|
||||
GLchar log[1000];
|
||||
GLsizei len;
|
||||
glGetProgramInfoLog_func(prog, 1000, &len, log);
|
||||
fprintf(stderr, "Linker error:\n%s\n", log);
|
||||
}
|
||||
else {
|
||||
fprintf(stderr, "Link success!\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static GLuint
|
||||
CreateProgram(const char *vertProgFile, const char *fragProgFile,
|
||||
struct uniform_info *uniforms)
|
||||
{
|
||||
GLuint fragShader = 0, vertShader = 0, program = 0;
|
||||
GLint i;
|
||||
|
||||
program = glCreateProgram_func();
|
||||
if (vertProgFile) {
|
||||
vertShader = glCreateShader_func(GL_VERTEX_SHADER);
|
||||
ReadShader(vertShader, vertProgFile);
|
||||
glAttachShader_func(program, vertShader);
|
||||
}
|
||||
|
||||
if (fragProgFile) {
|
||||
fragShader = glCreateShader_func(GL_FRAGMENT_SHADER);
|
||||
ReadShader(fragShader, fragProgFile);
|
||||
glAttachShader_func(program, fragShader);
|
||||
}
|
||||
|
||||
glLinkProgram_func(program);
|
||||
CheckLink(program);
|
||||
|
||||
glUseProgram_func(program);
|
||||
|
||||
assert(glIsProgram_func(program));
|
||||
assert(glIsShader_func(fragShader));
|
||||
assert(glIsShader_func(vertShader));
|
||||
|
||||
CheckError(__LINE__);
|
||||
for (i = 0; uniforms[i].name; i++) {
|
||||
uniforms[i].location
|
||||
= glGetUniformLocation_func(program, uniforms[i].name);
|
||||
printf("Uniform %s location: %d\n", uniforms[i].name,
|
||||
uniforms[i].location);
|
||||
|
||||
switch (uniforms[i].size) {
|
||||
case 1:
|
||||
if (uniforms[i].type == GL_INT)
|
||||
glUniform1i_func(uniforms[i].location,
|
||||
(GLint) uniforms[i].value[0]);
|
||||
else
|
||||
glUniform1fv_func(uniforms[i].location, 1, uniforms[i].value);
|
||||
break;
|
||||
case 2:
|
||||
glUniform2fv_func(uniforms[i].location, 1, uniforms[i].value);
|
||||
break;
|
||||
case 3:
|
||||
glUniform3fv_func(uniforms[i].location, 1, uniforms[i].value);
|
||||
break;
|
||||
case 4:
|
||||
glUniform4fv_func(uniforms[i].location, 1, uniforms[i].value);
|
||||
break;
|
||||
default:
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
||||
CheckError(__LINE__);
|
||||
|
||||
return program;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
InitPrograms(void)
|
||||
{
|
||||
Program1 = CreateProgram(ReflectVertFile, CubeFragFile, ReflectUniforms);
|
||||
Program2 = CreateProgram(SimpleVertFile, SimpleTexFragFile, SimpleUniforms);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Init(GLboolean useImageFiles)
|
||||
{
|
||||
const char *version = (const char *) glGetString(GL_VERSION);
|
||||
|
||||
if (version[0] != '2' || version[1] != '.') {
|
||||
printf("Warning: this program expects OpenGL 2.0\n");
|
||||
/*exit(1);*/
|
||||
}
|
||||
printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER));
|
||||
|
||||
GetExtensionFuncs();
|
||||
|
||||
InitTextures(useImageFiles);
|
||||
InitPrograms();
|
||||
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
|
||||
glClearColor(.6, .6, .9, 0);
|
||||
glColor3f(1.0, 1.0, 1.0);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
glutInit(&argc, argv);
|
||||
glutInitWindowSize(500, 400);
|
||||
glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
|
||||
glutCreateWindow(Demo);
|
||||
glutReshapeFunc(Reshape);
|
||||
glutKeyboardFunc(key);
|
||||
glutSpecialFunc(specialkey);
|
||||
glutDisplayFunc(draw);
|
||||
if (Anim)
|
||||
glutIdleFunc(idle);
|
||||
if (argc > 1 && strcmp(argv[1] , "-i") == 0)
|
||||
Init(1);
|
||||
else
|
||||
Init(0);
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
@@ -1,339 +0,0 @@
|
||||
/**
|
||||
* "Toy Ball" shader demo. Uses the example shaders from
|
||||
* chapter 11 of the OpenGL Shading Language "orange" book.
|
||||
* 16 Jan 2007
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glut.h>
|
||||
#include <GL/glext.h>
|
||||
#include "extfuncs.h"
|
||||
|
||||
|
||||
static char *FragProgFile = "CH11-toyball.frag.txt";
|
||||
static char *VertProgFile = "CH11-toyball.vert.txt";
|
||||
|
||||
/* program/shader objects */
|
||||
static GLuint fragShader;
|
||||
static GLuint vertShader;
|
||||
static GLuint program;
|
||||
|
||||
|
||||
struct uniform_info {
|
||||
const char *name;
|
||||
GLuint size;
|
||||
GLint location;
|
||||
GLfloat value[4];
|
||||
};
|
||||
|
||||
static struct uniform_info Uniforms[] = {
|
||||
{ "LightDir", 4, -1, { 0.57737, 0.57735, 0.57735, 0.0 } },
|
||||
{ "HVector", 4, -1, { 0.32506, 0.32506, 0.88808, 0.0 } },
|
||||
{ "BallCenter", 4, -1, { 0.0, 0.0, 0.0, 1.0 } },
|
||||
{ "SpecularColor", 4, -1, { 0.4, 0.4, 0.4, 60.0 } },
|
||||
{ "Red", 4, -1, { 0.6, 0.0, 0.0, 1.0 } },
|
||||
{ "Blue", 4, -1, { 0.0, 0.3, 0.6, 1.0 } },
|
||||
{ "Yellow", 4, -1, { 0.6, 0.5, 0.0, 1.0 } },
|
||||
{ "HalfSpace0", 4, -1, { 1.0, 0.0, 0.0, 0.2 } },
|
||||
{ "HalfSpace1", 4, -1, { 0.309016994, 0.951056516, 0.0, 0.2 } },
|
||||
{ "HalfSpace2", 4, -1, { -0.809016994, 0.587785252, 0.0, 0.2 } },
|
||||
{ "HalfSpace3", 4, -1, { -0.809016994, -0.587785252, 0.0, 0.2 } },
|
||||
{ "HalfSpace4", 4, -1, { 0.309116994, -0.951056516, 0.0, 0.2 } },
|
||||
{ "InOrOutInit", 1, -1, { -3.0, 0, 0, 0 } },
|
||||
{ "StripeWidth", 1, -1, { 0.3, 0, 0, 0 } },
|
||||
{ "FWidth", 1, -1, { 0.005, 0, 0, 0 } },
|
||||
{ NULL, 0, 0, { 0, 0, 0, 0 } }
|
||||
};
|
||||
|
||||
static GLint win = 0;
|
||||
static GLboolean Anim = GL_FALSE;
|
||||
static GLfloat TexRot = 0.0;
|
||||
static GLfloat xRot = 0.0f, yRot = 0.0f, zRot = 0.0f;
|
||||
|
||||
|
||||
static void
|
||||
Idle(void)
|
||||
{
|
||||
TexRot += 2.0;
|
||||
if (TexRot > 360.0)
|
||||
TexRot -= 360.0;
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Redisplay(void)
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
glPushMatrix();
|
||||
glRotatef(xRot, 1.0f, 0.0f, 0.0f);
|
||||
glRotatef(yRot, 0.0f, 1.0f, 0.0f);
|
||||
glRotatef(zRot, 0.0f, 0.0f, 1.0f);
|
||||
|
||||
glMatrixMode(GL_TEXTURE);
|
||||
glLoadIdentity();
|
||||
glRotatef(TexRot, 0.0f, 1.0f, 0.0f);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
|
||||
glutSolidSphere(2.0, 20, 10);
|
||||
|
||||
glPopMatrix();
|
||||
|
||||
glFinish();
|
||||
glFlush();
|
||||
glutSwapBuffers();
|
||||
}
|
||||
|
||||
|
||||
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
|
||||
CleanUp(void)
|
||||
{
|
||||
glDeleteShader_func(fragShader);
|
||||
glDeleteShader_func(vertShader);
|
||||
glDeleteProgram_func(program);
|
||||
glutDestroyWindow(win);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Key(unsigned char key, int x, int y)
|
||||
{
|
||||
const GLfloat step = 2.0;
|
||||
(void) x;
|
||||
(void) y;
|
||||
|
||||
switch(key) {
|
||||
case 'a':
|
||||
Anim = !Anim;
|
||||
if (Anim)
|
||||
glutIdleFunc(Idle);
|
||||
else
|
||||
glutIdleFunc(NULL);
|
||||
break;
|
||||
case 'z':
|
||||
zRot += step;
|
||||
break;
|
||||
case 'Z':
|
||||
zRot -= step;
|
||||
break;
|
||||
case 27:
|
||||
CleanUp();
|
||||
exit(0);
|
||||
break;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
SpecialKey(int key, int x, int y)
|
||||
{
|
||||
const GLfloat step = 2.0;
|
||||
|
||||
(void) x;
|
||||
(void) y;
|
||||
|
||||
switch(key) {
|
||||
case GLUT_KEY_UP:
|
||||
xRot += step;
|
||||
break;
|
||||
case GLUT_KEY_DOWN:
|
||||
xRot -= step;
|
||||
break;
|
||||
case GLUT_KEY_LEFT:
|
||||
yRot -= step;
|
||||
break;
|
||||
case GLUT_KEY_RIGHT:
|
||||
yRot += step;
|
||||
break;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
LoadAndCompileShader(GLuint shader, const char *text)
|
||||
{
|
||||
GLint stat;
|
||||
|
||||
glShaderSource_func(shader, 1, (const GLchar **) &text, NULL);
|
||||
|
||||
glCompileShader_func(shader);
|
||||
|
||||
glGetShaderiv_func(shader, GL_COMPILE_STATUS, &stat);
|
||||
if (!stat) {
|
||||
GLchar log[1000];
|
||||
GLsizei len;
|
||||
glGetShaderInfoLog_func(shader, 1000, &len, log);
|
||||
fprintf(stderr, "brick: problem compiling shader: %s\n", log);
|
||||
exit(1);
|
||||
}
|
||||
else {
|
||||
printf("Shader compiled OK\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Read a shader from a file.
|
||||
*/
|
||||
static void
|
||||
ReadShader(GLuint shader, const char *filename)
|
||||
{
|
||||
const int max = 100*1000;
|
||||
int n;
|
||||
char *buffer = (char*) malloc(max);
|
||||
FILE *f = fopen(filename, "r");
|
||||
if (!f) {
|
||||
fprintf(stderr, "brick: Unable to open shader file %s\n", filename);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
n = fread(buffer, 1, max, f);
|
||||
printf("brick: read %d bytes from shader file %s\n", n, filename);
|
||||
if (n > 0) {
|
||||
buffer[n] = 0;
|
||||
LoadAndCompileShader(shader, buffer);
|
||||
}
|
||||
|
||||
fclose(f);
|
||||
free(buffer);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
CheckLink(GLuint prog)
|
||||
{
|
||||
GLint stat;
|
||||
glGetProgramiv_func(prog, GL_LINK_STATUS, &stat);
|
||||
if (!stat) {
|
||||
GLchar log[1000];
|
||||
GLsizei len;
|
||||
glGetProgramInfoLog_func(prog, 1000, &len, log);
|
||||
fprintf(stderr, "Linker error:\n%s\n", log);
|
||||
}
|
||||
else {
|
||||
fprintf(stderr, "Link success!\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Init(void)
|
||||
{
|
||||
const char *version;
|
||||
GLint i;
|
||||
|
||||
version = (const char *) glGetString(GL_VERSION);
|
||||
if (version[0] != '2' || version[1] != '.') {
|
||||
printf("Warning: this program expects OpenGL 2.0\n");
|
||||
/*exit(1);*/
|
||||
}
|
||||
printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER));
|
||||
|
||||
GetExtensionFuncs();
|
||||
|
||||
vertShader = glCreateShader_func(GL_VERTEX_SHADER);
|
||||
ReadShader(vertShader, VertProgFile);
|
||||
|
||||
fragShader = glCreateShader_func(GL_FRAGMENT_SHADER);
|
||||
ReadShader(fragShader, FragProgFile);
|
||||
|
||||
program = glCreateProgram_func();
|
||||
glAttachShader_func(program, fragShader);
|
||||
glAttachShader_func(program, vertShader);
|
||||
glLinkProgram_func(program);
|
||||
CheckLink(program);
|
||||
glUseProgram_func(program);
|
||||
|
||||
assert(glIsProgram_func(program));
|
||||
assert(glIsShader_func(fragShader));
|
||||
assert(glIsShader_func(vertShader));
|
||||
|
||||
|
||||
for (i = 0; Uniforms[i].name; i++) {
|
||||
Uniforms[i].location
|
||||
= glGetUniformLocation_func(program, Uniforms[i].name);
|
||||
printf("Uniform %s location: %d\n", Uniforms[i].name,
|
||||
Uniforms[i].location);
|
||||
switch (Uniforms[i].size) {
|
||||
case 1:
|
||||
glUniform1fv_func(Uniforms[i].location, 1, Uniforms[i].value);
|
||||
break;
|
||||
case 2:
|
||||
glUniform2fv_func(Uniforms[i].location, 1, Uniforms[i].value);
|
||||
break;
|
||||
case 3:
|
||||
glUniform3fv_func(Uniforms[i].location, 1, Uniforms[i].value);
|
||||
break;
|
||||
case 4:
|
||||
glUniform4fv_func(Uniforms[i].location, 1, Uniforms[i].value);
|
||||
break;
|
||||
default:
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
||||
assert(glGetError() == 0);
|
||||
|
||||
glClearColor(0.4f, 0.4f, 0.8f, 0.0f);
|
||||
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
|
||||
glColor3f(1, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
ParseOptions(int argc, char *argv[])
|
||||
{
|
||||
int i;
|
||||
for (i = 1; i < argc; i++) {
|
||||
if (strcmp(argv[i], "-fs") == 0) {
|
||||
FragProgFile = argv[i+1];
|
||||
}
|
||||
else if (strcmp(argv[i], "-vs") == 0) {
|
||||
VertProgFile = argv[i+1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
glutInit(&argc, argv);
|
||||
glutInitWindowPosition( 0, 0);
|
||||
glutInitWindowSize(400, 400);
|
||||
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
|
||||
win = glutCreateWindow(argv[0]);
|
||||
glutReshapeFunc(Reshape);
|
||||
glutKeyboardFunc(Key);
|
||||
glutSpecialFunc(SpecialKey);
|
||||
glutDisplayFunc(Redisplay);
|
||||
ParseOptions(argc, argv);
|
||||
Init();
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
||||
|
64
progs/redbook/.cvsignore
Normal file
64
progs/redbook/.cvsignore
Normal file
@@ -0,0 +1,64 @@
|
||||
.cvsignore
|
||||
aaindex
|
||||
aapoly
|
||||
aargb
|
||||
accanti
|
||||
accpersp
|
||||
alpha
|
||||
alpha3D
|
||||
anti
|
||||
bezcurve
|
||||
bezmesh
|
||||
checker
|
||||
clip
|
||||
colormat
|
||||
cube
|
||||
depthcue
|
||||
dof
|
||||
double
|
||||
drawf
|
||||
feedback
|
||||
fog
|
||||
fogindex
|
||||
font
|
||||
hello
|
||||
image
|
||||
light
|
||||
lines
|
||||
list
|
||||
material
|
||||
mipmap
|
||||
model
|
||||
movelight
|
||||
nurbs
|
||||
pickdepth
|
||||
picksquare
|
||||
plane
|
||||
planet
|
||||
polyoff
|
||||
polys
|
||||
quadric
|
||||
robot
|
||||
sccolorlight
|
||||
scene
|
||||
scenebamb
|
||||
sceneflat
|
||||
select
|
||||
smooth
|
||||
stencil
|
||||
stroke
|
||||
surface
|
||||
teaambient
|
||||
teapots
|
||||
tess
|
||||
tesswind
|
||||
texbind
|
||||
texgen
|
||||
texprox
|
||||
texsub
|
||||
texturesurf
|
||||
torus
|
||||
trim
|
||||
unproject
|
||||
varray
|
||||
wrap
|
221
progs/redbook/Imakefile
Normal file
221
progs/redbook/Imakefile
Normal file
@@ -0,0 +1,221 @@
|
||||
LOCAL_LIBRARIES = $(XLIB) $(TOP)\lib\Mesaaux.a $(TOP)\lib\Mesaglu.a $(TOP)\lib\MesaGL.a
|
||||
|
||||
INCLUDES = -I$(TOP)\include
|
||||
|
||||
SRCS = accanti.c \
|
||||
accnot.c \
|
||||
accpersp.c \
|
||||
accum.c \
|
||||
aim.c \
|
||||
alpha.c \
|
||||
alpha3D.c \
|
||||
anti.c \
|
||||
antiindex.c \
|
||||
antipindex.c \
|
||||
antipoint.c \
|
||||
antipoly.c \
|
||||
bezcurve.c \
|
||||
bezmesh.c \
|
||||
bezsurf.c \
|
||||
checker.c \
|
||||
checker2.c \
|
||||
chess.c \
|
||||
clip.c \
|
||||
colormat.c \
|
||||
cone.c \
|
||||
cube.c \
|
||||
curve.c \
|
||||
depthcue.c \
|
||||
disk.c \
|
||||
dof.c \
|
||||
dofnot.c \
|
||||
double.c \
|
||||
drawf.c \
|
||||
feedback.c \
|
||||
fog.c \
|
||||
fogindex.c \
|
||||
font.c \
|
||||
light.c \
|
||||
linelist.c \
|
||||
lines.c \
|
||||
list.c \
|
||||
list2.c \
|
||||
maplight.c \
|
||||
material.c \
|
||||
mipmap.c \
|
||||
model.c \
|
||||
movelight.c \
|
||||
nurbs.c \
|
||||
pickdepth.c \
|
||||
pickline.c \
|
||||
picksquare.c \
|
||||
plane.c \
|
||||
planet.c \
|
||||
planetup.c \
|
||||
polys.c \
|
||||
robot.c \
|
||||
sccolorlight.c \
|
||||
scene.c \
|
||||
scenebamb.c \
|
||||
sceneflat.c \
|
||||
select.c \
|
||||
simple.c \
|
||||
smooth.c \
|
||||
sphere.c \
|
||||
stencil.c \
|
||||
stroke.c \
|
||||
surface.c \
|
||||
tea.c \
|
||||
teaambient.c \
|
||||
teapots.c \
|
||||
texgen.c \
|
||||
texturesurf.c \
|
||||
trim.c \
|
||||
xfont.c
|
||||
|
||||
PROGRAMS = ProgramTargetName(accanti) \
|
||||
ProgramTargetName(accnot) \
|
||||
ProgramTargetName(accpersp) \
|
||||
ProgramTargetName(accum) \
|
||||
ProgramTargetName(aim) \
|
||||
ProgramTargetName(alpha) \
|
||||
ProgramTargetName(alpha3D) \
|
||||
ProgramTargetName(anti) \
|
||||
ProgramTargetName(antiindex) \
|
||||
ProgramTargetName(antipindex) \
|
||||
ProgramTargetName(antipoint) \
|
||||
ProgramTargetName(antipoly) \
|
||||
ProgramTargetName(bezcurve) \
|
||||
ProgramTargetName(bezmesh) \
|
||||
ProgramTargetName(bezsurf) \
|
||||
ProgramTargetName(checker) \
|
||||
ProgramTargetName(checker2) \
|
||||
ProgramTargetName(chess) \
|
||||
ProgramTargetName(clip) \
|
||||
ProgramTargetName(colormat) \
|
||||
ProgramTargetName(cone) \
|
||||
ProgramTargetName(cube) \
|
||||
ProgramTargetName(curve) \
|
||||
ProgramTargetName(depthcue) \
|
||||
ProgramTargetName(disk) \
|
||||
ProgramTargetName(dof) \
|
||||
ProgramTargetName(dofnot) \
|
||||
ProgramTargetName(double) \
|
||||
ProgramTargetName(drawf) \
|
||||
ProgramTargetName(feedback) \
|
||||
ProgramTargetName(fog) \
|
||||
ProgramTargetName(fogindex) \
|
||||
ProgramTargetName(font) \
|
||||
ProgramTargetName(light) \
|
||||
ProgramTargetName(linelist) \
|
||||
ProgramTargetName(lines) \
|
||||
ProgramTargetName(list) \
|
||||
ProgramTargetName(list2) \
|
||||
ProgramTargetName(maplight) \
|
||||
ProgramTargetName(material) \
|
||||
ProgramTargetName(mipmap) \
|
||||
ProgramTargetName(model) \
|
||||
ProgramTargetName(movelight) \
|
||||
ProgramTargetName(nurbs) \
|
||||
ProgramTargetName(pickdepth) \
|
||||
ProgramTargetName(pickline) \
|
||||
ProgramTargetName(picksquare) \
|
||||
ProgramTargetName(plane) \
|
||||
ProgramTargetName(planet) \
|
||||
ProgramTargetName(planetup) \
|
||||
ProgramTargetName(polys) \
|
||||
ProgramTargetName(robot) \
|
||||
ProgramTargetName(sccolorlight) \
|
||||
ProgramTargetName(scene) \
|
||||
ProgramTargetName(scenebamb) \
|
||||
ProgramTargetName(sceneflat) \
|
||||
ProgramTargetName(select) \
|
||||
ProgramTargetName(simple) \
|
||||
ProgramTargetName(smooth) \
|
||||
ProgramTargetName(sphere) \
|
||||
ProgramTargetName(stencil) \
|
||||
ProgramTargetName(stroke) \
|
||||
ProgramTargetName(surface) \
|
||||
ProgramTargetName(tea) \
|
||||
ProgramTargetName(teaambient) \
|
||||
ProgramTargetName(teapots) \
|
||||
ProgramTargetName(texgen) \
|
||||
ProgramTargetName(texturesurf) \
|
||||
ProgramTargetName(trim) \
|
||||
ProgramTargetName(xfont)
|
||||
|
||||
AllTarget($(PROGRAMS))
|
||||
|
||||
NormalProgramTarget(accanti,accanti.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(accnot,accnot.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(accpersp,accpersp.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(accum,accum.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(aim,aim.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(alpha,alpha.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(alpha3D,alpha3D.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(anti,anti.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(antiindex,antiindex.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(antipindex,antipindex.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(antipoint,antipoint.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(antipoly,antipoly.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(bezcurve,bezcurve.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(bezmesh,bezmesh.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(bezsurf,bezsurf.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(checker,checker.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(checker2,checker2.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(chess,chess.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(clip,clip.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(colormat,colormat.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(cone,cone.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(cube,cube.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(curve,curve.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(depthcue,depthcue.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(disk,disk.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(dof,dof.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(dofnot,dofnot.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(double,double.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(drawf,drawf.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(feedback,feedback.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(fog,fog.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(fogindex,fogindex.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(font,font.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(light,light.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(linelist,linelist.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(lines,lines.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(list,list.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(list2,list2.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(maplight,maplight.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(material,material.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(mipmap,mipmap.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(model,model.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(movelight,movelight.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(nurbs,nurbs.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(pickdepth,pickdepth.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(pickline,pickline.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(picksquare,picksquare.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(plane,plane.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(planet,planet.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(planetup,planetup.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(polys,polys.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(robot,robot.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(sccolorlight,sccolorlight.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(scene,scene.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(scenebamb,scenebamb.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(sceneflat,sceneflat.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(select,select.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(simple,simple.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(smooth,smooth.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(sphere,sphere.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(stencil,stencil.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(stroke,stroke.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(surface,surface.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(tea,tea.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(teaambient,teaambient.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(teapots,teapots.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(texgen,texgen.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(texturesurf,texturesurf.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(trim,trim.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(xfont,xfont.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
|
||||
DependTarget()
|
||||
|
45
progs/samples/.cvsignore
Normal file
45
progs/samples/.cvsignore
Normal file
@@ -0,0 +1,45 @@
|
||||
.cvsignore
|
||||
accum
|
||||
bitmap1
|
||||
bitmap2
|
||||
blendeq
|
||||
blendxor
|
||||
copy
|
||||
cursor
|
||||
depth
|
||||
eval
|
||||
fog
|
||||
font
|
||||
line
|
||||
logo
|
||||
nurb
|
||||
oglinfo
|
||||
olympic
|
||||
overlay
|
||||
point
|
||||
prim
|
||||
quad
|
||||
select
|
||||
shape
|
||||
sphere
|
||||
star
|
||||
stencil
|
||||
stretch
|
||||
texture
|
||||
tri
|
||||
wave
|
||||
bugger
|
||||
pend
|
||||
lthreads
|
||||
lxdemo
|
||||
lxgears
|
||||
lxheads
|
||||
lxinfo
|
||||
lxpixmap
|
||||
anywin
|
||||
ffset
|
||||
bdemo
|
||||
binfo
|
||||
incopy
|
||||
demo
|
||||
font
|
101
progs/samples/Imakefile
Normal file
101
progs/samples/Imakefile
Normal file
@@ -0,0 +1,101 @@
|
||||
LOCAL_LIBRARIES = $(XLIB) $(TOP)\lib\glut.a $(TOP)\lib\Mesaglu.a $(TOP)\lib\MesaGL.a
|
||||
|
||||
INCLUDES = -I$(TOP)\include
|
||||
|
||||
SRCS = accum.c \
|
||||
bitmap1.c \
|
||||
bitmap2.c \
|
||||
blendeq.c \
|
||||
blendxor.c \
|
||||
copy.c \
|
||||
cursor.c \
|
||||
depth.c \
|
||||
eval.c \
|
||||
fog.c \
|
||||
font.c \
|
||||
line.c \
|
||||
logo.c \
|
||||
nurb.c \
|
||||
oglinfo.c \
|
||||
olympic.c \
|
||||
overlay.c \
|
||||
point.c \
|
||||
prim.c \
|
||||
quad.c \
|
||||
select.c \
|
||||
shape.c \
|
||||
speed.c \
|
||||
sphere.c \
|
||||
star.c \
|
||||
stencil.c \
|
||||
stretch.c \
|
||||
texture.c \
|
||||
tri.c \
|
||||
wave.c
|
||||
|
||||
PROGRAMS = ProgramTargetName(accum) \
|
||||
ProgramTargetName(bitmap1) \
|
||||
ProgramTargetName(bitmap2) \
|
||||
ProgramTargetName(blendeq) \
|
||||
ProgramTargetName(blendxor) \
|
||||
ProgramTargetName(copy) \
|
||||
ProgramTargetName(cursor) \
|
||||
ProgramTargetName(depth) \
|
||||
ProgramTargetName(eval) \
|
||||
ProgramTargetName(fog) \
|
||||
ProgramTargetName(font) \
|
||||
ProgramTargetName(line) \
|
||||
ProgramTargetName(logo) \
|
||||
ProgramTargetName(nurb) \
|
||||
ProgramTargetName(oglinfo) \
|
||||
ProgramTargetName(olympic) \
|
||||
ProgramTargetName(overlay) \
|
||||
ProgramTargetName(point) \
|
||||
ProgramTargetName(prim) \
|
||||
ProgramTargetName(quad) \
|
||||
ProgramTargetName(select) \
|
||||
ProgramTargetName(shape) \
|
||||
ProgramTargetName(speed) \
|
||||
ProgramTargetName(sphere) \
|
||||
ProgramTargetName(star) \
|
||||
ProgramTargetName(stencil) \
|
||||
ProgramTargetName(stretch) \
|
||||
ProgramTargetName(texture) \
|
||||
ProgramTargetName(tri) \
|
||||
ProgramTargetName(wave)
|
||||
|
||||
AllTarget($(PROGRAMS))
|
||||
|
||||
NormalProgramTarget(accum,accum.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(bitmap1,bitmap1.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(bitmap2,bitmap2.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(blendeq,blendeq.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(blendxor,blendxor.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(copy,copy.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(cursor,cursor.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(depth,depth.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(eval,eval.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(fog,fog.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(font,font.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(line,line.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(logo,logo.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(nurb,nurb.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(oglinfo,oglinfo.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(olympic,olympic.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(overlay,overlay.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(point,point.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(prim,prim.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(quad,quad.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(select,select.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(shape,shape.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(speed,speed.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(sphere,sphere.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(star,star.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(stencil,stencil.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(stretch,stretch.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(texture,texture.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(tri,tri.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
NormalProgramTarget(wave,wave.o,NullParameter,$(LOCAL_LIBRARIES),NullParameter)
|
||||
|
||||
DependTarget()
|
||||
|
@@ -1,138 +0,0 @@
|
||||
/**
|
||||
* Utility for getting OpenGL extension function pointers
|
||||
* Meant to be #included.
|
||||
*/
|
||||
|
||||
/* OpenGL 2.0 */
|
||||
static PFNGLATTACHSHADERPROC glAttachShader_func = NULL;
|
||||
static PFNGLBINDATTRIBLOCATIONPROC glBindAttribLocation_func = NULL;
|
||||
static PFNGLCOMPILESHADERPROC glCompileShader_func = NULL;
|
||||
static PFNGLCREATEPROGRAMPROC glCreateProgram_func = NULL;
|
||||
static PFNGLCREATESHADERPROC glCreateShader_func = NULL;
|
||||
static PFNGLDELETEPROGRAMPROC glDeleteProgram_func = NULL;
|
||||
static PFNGLDELETESHADERPROC glDeleteShader_func = NULL;
|
||||
static PFNGLGETACTIVEATTRIBPROC glGetActiveAttrib_func = NULL;
|
||||
static PFNGLGETATTACHEDSHADERSPROC glGetAttachedShaders_func = NULL;
|
||||
static PFNGLGETATTRIBLOCATIONPROC glGetAttribLocation_func = NULL;
|
||||
static PFNGLGETPROGRAMINFOLOGPROC glGetProgramInfoLog_func = NULL;
|
||||
static PFNGLGETSHADERINFOLOGPROC glGetShaderInfoLog_func = NULL;
|
||||
static PFNGLGETSHADERIVPROC glGetShaderiv_func = NULL;
|
||||
static PFNGLGETPROGRAMIVPROC glGetProgramiv_func = NULL;
|
||||
static PFNGLGETSHADERSOURCEPROC glGetShaderSource_func = NULL;
|
||||
static PFNGLGETUNIFORMFVPROC glGetUniformfv_func = NULL;
|
||||
static PFNGLGETUNIFORMLOCATIONPROC glGetUniformLocation_func = NULL;
|
||||
static PFNGLISPROGRAMPROC glIsProgram_func = NULL;
|
||||
static PFNGLISSHADERPROC glIsShader_func = NULL;
|
||||
static PFNGLLINKPROGRAMPROC glLinkProgram_func = NULL;
|
||||
static PFNGLSHADERSOURCEPROC glShaderSource_func = NULL;
|
||||
static PFNGLUNIFORM1IPROC glUniform1i_func = NULL;
|
||||
static PFNGLUNIFORM1FVPROC glUniform1fv_func = NULL;
|
||||
static PFNGLUNIFORM2FVPROC glUniform2fv_func = NULL;
|
||||
static PFNGLUNIFORM3FVPROC glUniform3fv_func = NULL;
|
||||
static PFNGLUNIFORM4FVPROC glUniform4fv_func = NULL;
|
||||
static PFNGLUNIFORMMATRIX2FVPROC glUniformMatrix2fv_func = NULL;
|
||||
static PFNGLUNIFORMMATRIX3FVPROC glUniformMatrix3fv_func = NULL;
|
||||
static PFNGLUNIFORMMATRIX4FVPROC glUniformMatrix4fv_func = NULL;
|
||||
static PFNGLUSEPROGRAMPROC glUseProgram_func = NULL;
|
||||
static PFNGLVERTEXATTRIB1FPROC glVertexAttrib1f_func = NULL;
|
||||
static PFNGLVERTEXATTRIB2FPROC glVertexAttrib2f_func = NULL;
|
||||
static PFNGLVERTEXATTRIB3FPROC glVertexAttrib3f_func = NULL;
|
||||
static PFNGLVERTEXATTRIB4FPROC glVertexAttrib4f_func = NULL;
|
||||
|
||||
/* OpenGL 2.1 */
|
||||
static PFNGLUNIFORMMATRIX2X3FVPROC glUniformMatrix2x3fv_func = NULL;
|
||||
static PFNGLUNIFORMMATRIX3X2FVPROC glUniformMatrix3x2fv_func = NULL;
|
||||
static PFNGLUNIFORMMATRIX2X4FVPROC glUniformMatrix2x4fv_func = NULL;
|
||||
static PFNGLUNIFORMMATRIX4X2FVPROC glUniformMatrix4x2fv_func = NULL;
|
||||
static PFNGLUNIFORMMATRIX3X4FVPROC glUniformMatrix3x4fv_func = NULL;
|
||||
static PFNGLUNIFORMMATRIX4X3FVPROC glUniformMatrix4x3fv_func = NULL;
|
||||
|
||||
/* GL_ARB_vertex/fragment_program */
|
||||
static PFNGLBINDPROGRAMARBPROC glBindProgramARB_func = NULL;
|
||||
static PFNGLDELETEPROGRAMSARBPROC glDeleteProgramsARB_func = NULL;
|
||||
static PFNGLGENPROGRAMSARBPROC glGenProgramsARB_func = NULL;
|
||||
static PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC glGetProgramLocalParameterdvARB_func = NULL;
|
||||
static PFNGLISPROGRAMARBPROC glIsProgramARB_func = NULL;
|
||||
static PFNGLPROGRAMLOCALPARAMETER4DARBPROC glProgramLocalParameter4dARB_func = NULL;
|
||||
static PFNGLPROGRAMLOCALPARAMETER4FVARBPROC glProgramLocalParameter4fvARB_func = NULL;
|
||||
static PFNGLPROGRAMSTRINGARBPROC glProgramStringARB_func = NULL;
|
||||
static PFNGLVERTEXATTRIB1FARBPROC glVertexAttrib1fARB_func = NULL;
|
||||
|
||||
/* GL_APPLE_vertex_array_object */
|
||||
static PFNGLBINDVERTEXARRAYAPPLEPROC glBindVertexArrayAPPLE_func = NULL;
|
||||
static PFNGLDELETEVERTEXARRAYSAPPLEPROC glDeleteVertexArraysAPPLE_func = NULL;
|
||||
static PFNGLGENVERTEXARRAYSAPPLEPROC glGenVertexArraysAPPLE_func = NULL;
|
||||
static PFNGLISVERTEXARRAYAPPLEPROC glIsVertexArrayAPPLE_func = NULL;
|
||||
|
||||
/* GL_EXT_stencil_two_side */
|
||||
static PFNGLACTIVESTENCILFACEEXTPROC glActiveStencilFaceEXT_func = NULL;
|
||||
|
||||
|
||||
static void
|
||||
GetExtensionFuncs(void)
|
||||
{
|
||||
/* OpenGL 2.0 */
|
||||
glAttachShader_func = (PFNGLATTACHSHADERPROC) glutGetProcAddress("glAttachShader");
|
||||
glBindAttribLocation_func = (PFNGLBINDATTRIBLOCATIONPROC) glutGetProcAddress("glBindAttribLocation");
|
||||
glCompileShader_func = (PFNGLCOMPILESHADERPROC) glutGetProcAddress("glCompileShader");
|
||||
glCreateProgram_func = (PFNGLCREATEPROGRAMPROC) glutGetProcAddress("glCreateProgram");
|
||||
glCreateShader_func = (PFNGLCREATESHADERPROC) glutGetProcAddress("glCreateShader");
|
||||
glDeleteProgram_func = (PFNGLDELETEPROGRAMPROC) glutGetProcAddress("glDeleteProgram");
|
||||
glDeleteShader_func = (PFNGLDELETESHADERPROC) glutGetProcAddress("glDeleteShader");
|
||||
glGetActiveAttrib_func = (PFNGLGETACTIVEATTRIBPROC) glutGetProcAddress("glGetActiveAttrib");
|
||||
glGetAttachedShaders_func = (PFNGLGETATTACHEDSHADERSPROC) glutGetProcAddress("glGetAttachedShaders");
|
||||
glGetAttribLocation_func = (PFNGLGETATTRIBLOCATIONPROC) glutGetProcAddress("glGetAttribLocation");
|
||||
glGetProgramInfoLog_func = (PFNGLGETPROGRAMINFOLOGPROC) glutGetProcAddress("glGetProgramInfoLog");
|
||||
glGetShaderInfoLog_func = (PFNGLGETSHADERINFOLOGPROC) glutGetProcAddress("glGetShaderInfoLog");
|
||||
glGetProgramiv_func = (PFNGLGETPROGRAMIVPROC) glutGetProcAddress("glGetProgramiv");
|
||||
glGetShaderiv_func = (PFNGLGETSHADERIVPROC) glutGetProcAddress("glGetShaderiv");
|
||||
glGetShaderSource_func = (PFNGLGETSHADERSOURCEPROC) glutGetProcAddress("glGetShaderSource");
|
||||
glGetUniformLocation_func = (PFNGLGETUNIFORMLOCATIONPROC) glutGetProcAddress("glGetUniformLocation");
|
||||
glGetUniformfv_func = (PFNGLGETUNIFORMFVPROC) glutGetProcAddress("glGetUniformfv");
|
||||
glIsProgram_func = (PFNGLISPROGRAMPROC) glutGetProcAddress("glIsProgram");
|
||||
glIsShader_func = (PFNGLISSHADERPROC) glutGetProcAddress("glIsShader");
|
||||
glLinkProgram_func = (PFNGLLINKPROGRAMPROC) glutGetProcAddress("glLinkProgram");
|
||||
glShaderSource_func = (PFNGLSHADERSOURCEPROC) glutGetProcAddress("glShaderSource");
|
||||
glUniform1i_func = (PFNGLUNIFORM1IPROC) glutGetProcAddress("glUniform1i");
|
||||
glUniform1fv_func = (PFNGLUNIFORM1FVPROC) glutGetProcAddress("glUniform1fv");
|
||||
glUniform2fv_func = (PFNGLUNIFORM2FVPROC) glutGetProcAddress("glUniform2fv");
|
||||
glUniform3fv_func = (PFNGLUNIFORM3FVPROC) glutGetProcAddress("glUniform3fv");
|
||||
glUniform4fv_func = (PFNGLUNIFORM3FVPROC) glutGetProcAddress("glUniform4fv");
|
||||
glUniformMatrix2fv_func = (PFNGLUNIFORMMATRIX2FVPROC) glutGetProcAddress("glUniformMatrix2fv");
|
||||
glUniformMatrix3fv_func = (PFNGLUNIFORMMATRIX3FVPROC) glutGetProcAddress("glUniformMatrix3fv");
|
||||
glUniformMatrix4fv_func = (PFNGLUNIFORMMATRIX4FVPROC) glutGetProcAddress("glUniformMatrix4fv");
|
||||
glUseProgram_func = (PFNGLUSEPROGRAMPROC) glutGetProcAddress("glUseProgram");
|
||||
glVertexAttrib1f_func = (PFNGLVERTEXATTRIB1FPROC) glutGetProcAddress("glVertexAttrib1f");
|
||||
glVertexAttrib2f_func = (PFNGLVERTEXATTRIB2FPROC) glutGetProcAddress("glVertexAttrib2f");
|
||||
glVertexAttrib3f_func = (PFNGLVERTEXATTRIB3FPROC) glutGetProcAddress("glVertexAttrib3f");
|
||||
glVertexAttrib4f_func = (PFNGLVERTEXATTRIB4FPROC) glutGetProcAddress("glVertexAttrib4f");
|
||||
|
||||
/* OpenGL 2.1 */
|
||||
glUniformMatrix2x3fv_func = (PFNGLUNIFORMMATRIX2X3FVPROC) glutGetProcAddress("glUniformMatrix2x3fv");
|
||||
glUniformMatrix3x2fv_func = (PFNGLUNIFORMMATRIX3X2FVPROC) glutGetProcAddress("glUniformMatrix3x2fv");
|
||||
glUniformMatrix2x4fv_func = (PFNGLUNIFORMMATRIX2X4FVPROC) glutGetProcAddress("glUniformMatrix2x4fv");
|
||||
glUniformMatrix4x2fv_func = (PFNGLUNIFORMMATRIX4X2FVPROC) glutGetProcAddress("glUniformMatrix4x2fv");
|
||||
glUniformMatrix3x4fv_func = (PFNGLUNIFORMMATRIX3X4FVPROC) glutGetProcAddress("glUniformMatrix3x4fv");
|
||||
glUniformMatrix4x3fv_func = (PFNGLUNIFORMMATRIX4X3FVPROC) glutGetProcAddress("glUniformMatrix4x3fv");
|
||||
|
||||
/* GL_ARB_vertex/fragment_program */
|
||||
glBindProgramARB_func = (PFNGLBINDPROGRAMARBPROC) glutGetProcAddress("glBindProgramARB");
|
||||
glDeleteProgramsARB_func = (PFNGLDELETEPROGRAMSARBPROC) glutGetProcAddress("glDeleteProgramsARB");
|
||||
glGenProgramsARB_func = (PFNGLGENPROGRAMSARBPROC) glutGetProcAddress("glGenProgramsARB");
|
||||
glGetProgramLocalParameterdvARB_func = (PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) glutGetProcAddress("glGetProgramLocalParameterdvARB");
|
||||
glIsProgramARB_func = (PFNGLISPROGRAMARBPROC) glutGetProcAddress("glIsProgramARB");
|
||||
glProgramLocalParameter4dARB_func = (PFNGLPROGRAMLOCALPARAMETER4DARBPROC) glutGetProcAddress("glProgramLocalParameter4dARB");
|
||||
glProgramLocalParameter4fvARB_func = (PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) glutGetProcAddress("glProgramLocalParameter4fvARB");
|
||||
glProgramStringARB_func = (PFNGLPROGRAMSTRINGARBPROC) glutGetProcAddress("glProgramStringARB");
|
||||
glVertexAttrib1fARB_func = (PFNGLVERTEXATTRIB1FARBPROC) glutGetProcAddress("glVertexAttrib1fARB");
|
||||
|
||||
/* GL_APPLE_vertex_array_object */
|
||||
glBindVertexArrayAPPLE_func = (PFNGLBINDVERTEXARRAYAPPLEPROC) glutGetProcAddress("glBindVertexArrayAPPLE");
|
||||
glDeleteVertexArraysAPPLE_func = (PFNGLDELETEVERTEXARRAYSAPPLEPROC) glutGetProcAddress("glDeleteVertexArraysAPPLE");
|
||||
glGenVertexArraysAPPLE_func = (PFNGLGENVERTEXARRAYSAPPLEPROC) glutGetProcAddress("glGenVertexArraysAPPLE");
|
||||
glIsVertexArrayAPPLE_func = (PFNGLISVERTEXARRAYAPPLEPROC) glutGetProcAddress("glIsVertexArrayAPPLE");
|
||||
|
||||
/* GL_EXT_stencil_two_side */
|
||||
glActiveStencilFaceEXT_func = (PFNGLACTIVESTENCILFACEEXTPROC) glutGetProcAddress("glActiveStencilFaceEXT");
|
||||
}
|
||||
|
16
progs/xdemos/.cvsignore
Normal file
16
progs/xdemos/.cvsignore
Normal file
@@ -0,0 +1,16 @@
|
||||
glthreads
|
||||
glxdemo
|
||||
glxgears
|
||||
glxheads
|
||||
glxinfo
|
||||
glxpixmap
|
||||
glxpbdemo
|
||||
glxswapcontrol
|
||||
manywin
|
||||
offset
|
||||
pbinfo
|
||||
pbdemo
|
||||
wincopy
|
||||
xdemo
|
||||
xfont
|
||||
xrotfontdemo
|
@@ -24,11 +24,11 @@ PROGS = glthreads \
|
||||
pbinfo \
|
||||
pbdemo \
|
||||
wincopy \
|
||||
xdemo \
|
||||
xfont \
|
||||
xrotfontdemo \
|
||||
yuvrect_client
|
||||
|
||||
# omit this XMesa API demo: xdemo
|
||||
|
||||
|
||||
##### RULES #####
|
||||
|
@@ -473,7 +473,7 @@ main(int argc, char *argv[])
|
||||
|
||||
dpy = XOpenDisplay(displayName);
|
||||
if (!dpy) {
|
||||
fprintf(stderr, "Unable to open display %s\n", XDisplayName(displayName));
|
||||
fprintf(stderr, "Unable to open display %s\n", displayName);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
@@ -587,8 +587,8 @@ main(int argc, char *argv[])
|
||||
|
||||
dpy = XOpenDisplay(dpyName);
|
||||
if (!dpy) {
|
||||
fprintf(stderr, "Error: couldn't open display %s\n",
|
||||
XDisplayName(dpyName));
|
||||
printf("Error: couldn't open display %s\n",
|
||||
dpyName ? dpyName : getenv("DISPLAY"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@@ -575,7 +575,7 @@ main(int argc, char *argv[])
|
||||
|
||||
dpy = XOpenDisplay(dpyName);
|
||||
if (!dpy) {
|
||||
printf("Error: couldn't open display %s\n", XDisplayName(dpyName));
|
||||
printf("Error: couldn't open display %s\n", dpyName);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@@ -57,7 +57,7 @@ static int NumHeads = 0;
|
||||
static void
|
||||
Error(const char *display, const char *msg)
|
||||
{
|
||||
fprintf(stderr, "Error on display %s - %s\n", XDisplayName(display), msg);
|
||||
fprintf(stderr, "Error on display %s - %s\n", display, msg);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
@@ -456,19 +456,7 @@ print_screen_info(Display *dpy, int scrnum, Bool allowDirect, GLboolean limits)
|
||||
}
|
||||
printf("display: %s screen: %d\n", displayName, scrnum);
|
||||
free(displayName);
|
||||
printf("direct rendering: ");
|
||||
if (glXIsDirect(dpy, ctx)) {
|
||||
printf("Yes\n");
|
||||
} else {
|
||||
if (!allowDirect) {
|
||||
printf("No (-i specified)\n");
|
||||
} else if (getenv("LIBGL_ALWAYS_INDIRECT")) {
|
||||
printf("No (LIBGL_ALWAYS_INDIRECT set)\n");
|
||||
} else {
|
||||
printf("No (If you want to find out why, try setting "
|
||||
"LIBGL_DEBUG=verbose)\n");
|
||||
}
|
||||
}
|
||||
printf("direct rendering: %s\n", glXIsDirect(dpy, ctx) ? "Yes" : "No");
|
||||
printf("server glx vendor string: %s\n", serverVendor);
|
||||
printf("server glx version string: %s\n", serverVersion);
|
||||
printf("server glx extensions:\n");
|
||||
@@ -939,7 +927,7 @@ main(int argc, char *argv[])
|
||||
|
||||
dpy = XOpenDisplay(displayName);
|
||||
if (!dpy) {
|
||||
fprintf(stderr, "Error: unable to open display %s\n", XDisplayName(displayName));
|
||||
fprintf(stderr, "Error: unable to open display %s\n", displayName);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@@ -749,7 +749,7 @@ main(int argc, char *argv[])
|
||||
|
||||
dpy = XOpenDisplay(dpyName);
|
||||
if (!dpy) {
|
||||
printf("Error: couldn't open display %s\n", XDisplayName(dpyName));
|
||||
printf("Error: couldn't open display %s\n", dpyName);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user