mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-21 05:00:09 +01:00
Merge master and fix conflicts
This commit is contained in:
commit
1036ef2bf4
734 changed files with 36561 additions and 18863 deletions
16
Makefile
16
Makefile
|
|
@ -37,6 +37,9 @@ realclean: clean
|
|||
-name depend -o -name depend.bak ')' -exec rm -f '{}' ';'
|
||||
|
||||
|
||||
distclean: realclean
|
||||
|
||||
|
||||
install:
|
||||
@for dir in $(SUBDIRS) ; do \
|
||||
if [ -d $$dir ] ; then \
|
||||
|
|
@ -45,7 +48,7 @@ install:
|
|||
done
|
||||
|
||||
|
||||
.PHONY: default doxygen clean realclean install linux-directfb-install
|
||||
.PHONY: default doxygen clean realclean distclean install linux-directfb-install
|
||||
|
||||
# If there's no current configuration file
|
||||
$(TOP)/configs/current:
|
||||
|
|
@ -124,6 +127,7 @@ linux-icc \
|
|||
linux-icc-static \
|
||||
linux-llvm \
|
||||
linux-osmesa \
|
||||
linux-osmesa-static \
|
||||
linux-osmesa16 \
|
||||
linux-osmesa16-static \
|
||||
linux-osmesa32 \
|
||||
|
|
@ -178,7 +182,7 @@ ultrix-gcc:
|
|||
|
||||
# Rules for making release tarballs
|
||||
|
||||
VERSION=7.5-devel
|
||||
VERSION=7.6-devel
|
||||
DIRECTORY = Mesa-$(VERSION)
|
||||
LIB_NAME = MesaLib-$(VERSION)
|
||||
DEMO_NAME = MesaDemos-$(VERSION)
|
||||
|
|
@ -324,6 +328,7 @@ GALLIUM_FILES = \
|
|||
$(DIRECTORY)/src/gallium/*/*/*/SConscript \
|
||||
$(DIRECTORY)/src/gallium/*/*/*/*.[ch] \
|
||||
$(DIRECTORY)/src/gallium/*/*/*/*.py \
|
||||
$(DIRECTORY)/src/gallium/*/*/*/*/Makefile \
|
||||
$(DIRECTORY)/src/gallium/*/*/*/*/*.[ch] \
|
||||
|
||||
|
||||
|
|
@ -399,7 +404,6 @@ DEMO_FILES = \
|
|||
$(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 \
|
||||
|
|
@ -415,9 +419,6 @@ DEMO_FILES = \
|
|||
$(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 = \
|
||||
|
|
@ -427,14 +428,11 @@ GLUT_FILES = \
|
|||
$(DIRECTORY)/src/glut/glx/depend \
|
||||
$(DIRECTORY)/src/glut/glx/glut.pc.in \
|
||||
$(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 \
|
||||
|
|
|
|||
10
SConstruct
10
SConstruct
|
|
@ -41,16 +41,16 @@ else:
|
|||
default_drivers = 'all'
|
||||
default_winsys = 'all'
|
||||
|
||||
opts = Options('config.py')
|
||||
opts = Variables('config.py')
|
||||
common.AddOptions(opts)
|
||||
opts.Add(ListOption('statetrackers', 'state trackers to build', default_statetrackers,
|
||||
opts.Add(ListVariable('statetrackers', 'state trackers to build', default_statetrackers,
|
||||
['mesa', 'python']))
|
||||
opts.Add(ListOption('drivers', 'pipe drivers to build', default_drivers,
|
||||
opts.Add(ListVariable('drivers', 'pipe drivers to build', default_drivers,
|
||||
['softpipe', 'failover', 'i915simple', 'i965simple', 'cell', 'trace', 'r300']))
|
||||
opts.Add(ListOption('winsys', 'winsys drivers to build', default_winsys,
|
||||
opts.Add(ListVariable('winsys', 'winsys drivers to build', default_winsys,
|
||||
['xlib', 'intel', 'gdi', 'radeon']))
|
||||
|
||||
opts.Add(EnumOption('MSVS_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0')))
|
||||
opts.Add(EnumVariable('MSVS_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0')))
|
||||
|
||||
env = Environment(
|
||||
options = opts,
|
||||
|
|
|
|||
|
|
@ -66,8 +66,11 @@ if [ $# -ge 2 ] ; then
|
|||
|
||||
elif [ -f "$FILE" ] ; then
|
||||
#echo "$FILE" is a regular file
|
||||
$RM "$DEST/`basename $FILE`"
|
||||
cp "$FILE" "$DEST"
|
||||
# Only copy if the files differ
|
||||
if ! cmp -s $FILE $DEST/`basename $FILE`; then
|
||||
$RM "$DEST/`basename $FILE`"
|
||||
cp "$FILE" "$DEST"
|
||||
fi
|
||||
if [ $MODE ] ; then
|
||||
FILE=`basename "$FILE"`
|
||||
chmod $MODE "$DEST/$FILE"
|
||||
|
|
|
|||
63
bin/mklib
63
bin/mklib
|
|
@ -176,6 +176,23 @@ if [ ${ARCH} = "auto" ] ; then
|
|||
fi
|
||||
|
||||
|
||||
if [ $STATIC = 1 ]; then
|
||||
# filter out linker options inside object list
|
||||
NEWOBJECTS=""
|
||||
for OBJ in $OBJECTS ; do
|
||||
case $OBJ in
|
||||
-Wl,*)
|
||||
echo "mklib: warning: ignoring $OBJ for static library"
|
||||
;;
|
||||
*)
|
||||
NEWOBJECTS="$NEWOBJECTS $OBJ"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
OBJECTS=$NEWOBJECTS
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
# Error checking
|
||||
#
|
||||
|
|
@ -264,18 +281,21 @@ case $ARCH in
|
|||
# expand any .a objects into constituent .o files.
|
||||
NEWOBJECTS=""
|
||||
DELETIA=""
|
||||
for OBJ in ${OBJECTS} ; do
|
||||
if [ `expr match $OBJ '.*\.a'` -gt 0 ] ; then
|
||||
# extract the .o files from this .a archive
|
||||
FILES=`ar t $OBJ`
|
||||
ar x $OBJ
|
||||
NEWOBJECTS="$NEWOBJECTS $FILES"
|
||||
# keep track of temporary .o files and delete them below
|
||||
DELETIA="$DELETIA $FILES"
|
||||
else
|
||||
# ordinary .o file
|
||||
NEWOBJECTS="$NEWOBJECTS $OBJ"
|
||||
fi
|
||||
for OBJ in $OBJECTS ; do
|
||||
case $OBJ in
|
||||
*.a)
|
||||
# extract the .o files from this .a archive
|
||||
FILES=`ar t $OBJ`
|
||||
ar x $OBJ
|
||||
NEWOBJECTS="$NEWOBJECTS $FILES"
|
||||
# keep track of temporary .o files and delete them below
|
||||
DELETIA="$DELETIA $FILES"
|
||||
;;
|
||||
*)
|
||||
# ordinary .o file
|
||||
NEWOBJECTS="$NEWOBJECTS $OBJ"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# make lib
|
||||
|
|
@ -865,6 +885,17 @@ case $ARCH in
|
|||
|
||||
CYGWIN*)
|
||||
# GCC-based environment
|
||||
if [ $NOPREFIX = 1 ] ; then
|
||||
# No "lib" or ".so" part
|
||||
echo "mklib: Making CYGWIN shared library: " ${LIBNAME}
|
||||
OPTS="-shared -Wl,--enable-auto-image-base"
|
||||
if [ "${ALTOPTS}" ] ; then
|
||||
OPTS=${ALTOPTS}
|
||||
fi
|
||||
rm -f ${LIBNAME}
|
||||
${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME} ${OBJECTS} ${DEPS}
|
||||
FINAL_LIBS=${LIBNAME}
|
||||
else
|
||||
CYGNAME="cyg${LIBNAME}" # prefix with "cyg"
|
||||
LIBNAME="lib${LIBNAME}" # prefix with "lib"
|
||||
|
||||
|
|
@ -881,11 +912,11 @@ case $ARCH in
|
|||
# finish up
|
||||
FINAL_LIBS=${LIBNAME}.a
|
||||
else
|
||||
OPTS="-shared -Wl,-export-all -Wl,--out-implib=${LIBNAME}-${MAJOR}.dll.a"
|
||||
OPTS="-shared -Wl,--enable-auto-image-base -Wl,-export-all -Wl,--out-implib=${LIBNAME}-${MAJOR}.dll.a"
|
||||
if [ "${ALTOPTS}" ] ; then
|
||||
OPTS=${ALTOPTS}
|
||||
fi
|
||||
echo "mklib: Making" $ARCH "shared library: " ${LIBNAME}-${MAJOR}.dll
|
||||
echo "mklib: Making" $ARCH "shared library: " ${CYGNAME}-${MAJOR}.dll
|
||||
|
||||
if [ $CPLUSPLUS = 1 ] ; then
|
||||
LINK="g++"
|
||||
|
|
@ -894,7 +925,8 @@ case $ARCH in
|
|||
fi
|
||||
|
||||
# rm any old libs
|
||||
rm -f ${LIBNAME}-${MAJOR}.dll
|
||||
rm -f ${CYGNAME}-${MAJOR}.dll
|
||||
rm -f ${LIBNAME}-${MAJOR}.dll.a
|
||||
rm -f ${LIBNAME}.dll.a
|
||||
rm -f ${LIBNAME}.a
|
||||
|
||||
|
|
@ -907,6 +939,7 @@ case $ARCH in
|
|||
# special case for installing in bin
|
||||
FINAL_BINS="${CYGNAME}-${MAJOR}.dll"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
|
||||
'example')
|
||||
|
|
|
|||
10
common.py
10
common.py
|
|
@ -46,16 +46,16 @@ else:
|
|||
|
||||
def AddOptions(opts):
|
||||
try:
|
||||
from SCons.Options.BoolOption import BoolOption
|
||||
except ImportError:
|
||||
from SCons.Variables.BoolVariable import BoolVariable as BoolOption
|
||||
try:
|
||||
from SCons.Options.EnumOption import EnumOption
|
||||
except ImportError:
|
||||
from SCons.Options.BoolOption import BoolOption
|
||||
try:
|
||||
from SCons.Variables.EnumVariable import EnumVariable as EnumOption
|
||||
except ImportError:
|
||||
from SCons.Options.EnumOption import EnumOption
|
||||
opts.Add(BoolOption('debug', 'debug build', 'no'))
|
||||
opts.Add(BoolOption('profile', 'profile build', 'no'))
|
||||
#opts.Add(BoolOption('quiet', 'quiet command lines', 'no'))
|
||||
opts.Add(BoolOption('quiet', 'quiet command lines', 'yes'))
|
||||
opts.Add(EnumOption('machine', 'use machine-specific assembly code', default_machine,
|
||||
allowed_values=('generic', 'ppc', 'x86', 'x86_64')))
|
||||
opts.Add(EnumOption('platform', 'target platform', default_platform,
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ SHELL = @SHELL@
|
|||
MKLIB_OPTIONS = @MKLIB_OPTIONS@
|
||||
MKDEP = @MKDEP@
|
||||
MKDEP_OPTIONS = @MKDEP_OPTIONS@
|
||||
INSTALL = @INSTALL@
|
||||
|
||||
# Python and flags (generally only needed by the developers)
|
||||
PYTHON2 = python
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ CONFIG_NAME = default
|
|||
|
||||
# Version info
|
||||
MESA_MAJOR=7
|
||||
MESA_MINOR=3
|
||||
MESA_MINOR=6
|
||||
MESA_TINY=0
|
||||
MESA_VERSION = $(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY)
|
||||
|
||||
|
|
@ -36,7 +36,10 @@ MKLIB_OPTIONS =
|
|||
MKDEP = makedepend
|
||||
MKDEP_OPTIONS = -fdepend
|
||||
MAKE = make
|
||||
INSTALL = $(SHELL) $(TOP)/bin/minstall
|
||||
|
||||
# Use MINSTALL for installing libraries, INSTALL for everything else
|
||||
MINSTALL = $(SHELL) $(TOP)/bin/minstall
|
||||
INSTALL = $(MINSTALL)
|
||||
|
||||
# Tools for regenerating glapi (generally only needed by the developers)
|
||||
PYTHON2 = python
|
||||
|
|
@ -90,7 +93,7 @@ EGL_DRIVERS_DIRS = demo
|
|||
|
||||
# Gallium directories and
|
||||
GALLIUM_DIRS = auxiliary drivers state_trackers
|
||||
GALLIUM_AUXILIARY_DIRS = draw translate cso_cache pipebuffer tgsi sct rtasm util indices
|
||||
GALLIUM_AUXILIARY_DIRS = rbug draw translate cso_cache pipebuffer tgsi sct rtasm util indices
|
||||
GALLIUM_AUXILIARIES = $(foreach DIR,$(GALLIUM_AUXILIARY_DIRS),$(TOP)/src/gallium/auxiliary/$(DIR)/lib$(DIR).a)
|
||||
GALLIUM_DRIVERS_DIRS = softpipe i915simple failover trace
|
||||
GALLIUM_DRIVERS = $(foreach DIR,$(GALLIUM_DRIVERS_DIRS),$(TOP)/src/gallium/drivers/$(DIR)/lib$(DIR).a)
|
||||
|
|
|
|||
|
|
@ -64,4 +64,4 @@ GALLIUM_WINSYS_DRM_DIRS = intel
|
|||
GALLIUM_STATE_TRACKERS_DIRS = egl
|
||||
|
||||
DRI_DIRS = i810 i915 i965 mach64 mga r128 r200 r300 radeon s3v \
|
||||
savage sis tdfx trident unichrome ffb
|
||||
savage sis tdfx trident unichrome ffb swrast
|
||||
|
|
|
|||
37
configs/linux-osmesa-static
Normal file
37
configs/linux-osmesa-static
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
# Configuration for building static libOSMesa.a on Linux, no Xlib driver
|
||||
# This doesn't really have any Linux dependencies, so it should be usable
|
||||
# on other (gcc-based) systems.
|
||||
|
||||
include $(TOP)/configs/default
|
||||
|
||||
CONFIG_NAME = linux-osmesa
|
||||
|
||||
# Compiler and flags
|
||||
CC = gcc -m32
|
||||
CXX = g++ -m32
|
||||
CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DPTHREADS
|
||||
CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
|
||||
|
||||
MKLIB_OPTIONS = -static
|
||||
|
||||
# Library names (actual file names)
|
||||
GL_LIB_NAME = libGL.a
|
||||
GLU_LIB_NAME = libGLU.a
|
||||
GLUT_LIB_NAME = libglut.a
|
||||
GLW_LIB_NAME = libGLw.a
|
||||
OSMESA_LIB_NAME = libOSMesa.a
|
||||
|
||||
# Directories
|
||||
SRC_DIRS = mesa glu
|
||||
DRIVER_DIRS = osmesa
|
||||
PROGRAM_DIRS = osdemos
|
||||
|
||||
|
||||
# Dependencies
|
||||
GL_LIB_DEPS =
|
||||
OSMESA_LIB_DEPS =
|
||||
GLU_LIB_DEPS =
|
||||
GLUT_LIB_DEPS =
|
||||
GLW_LIB_DEPS =
|
||||
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) \
|
||||
$(EXTRA_LIB_PATH) -lX11 -lXmu -lXt -lXi -lpthread -lstdc++ -lm
|
||||
|
|
@ -22,7 +22,5 @@ GLUT_LIB_DEPS =
|
|||
GLW_LIB_DEPS =
|
||||
|
||||
# Need to specify all libraries we may need
|
||||
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -Wl,--start-group \
|
||||
-l$(GL_LIB) $(TOP)/src/mesa/pipe/softpipe/libsoftpipe.a -Wl,--end-group -lm \
|
||||
-L/usr/X11R6/lib/ -lX11 -lXext -lXmu -lXi -lpthread
|
||||
|
||||
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) \
|
||||
-l$(GL_LIB) -lm -L/usr/X11R6/lib/ -lX11 -lXext -lXmu -lXi -lpthread
|
||||
|
|
|
|||
|
|
@ -4,4 +4,5 @@ include $(TOP)/configs/linux-x86-64
|
|||
|
||||
CONFIG_NAME = linux-x86-64-debug
|
||||
|
||||
OPT_FLAGS = -g
|
||||
DEFINES += -DDEBUG -DDEBUG_MATH
|
||||
|
|
|
|||
|
|
@ -22,6 +22,5 @@ GLUT_LIB_DEPS =
|
|||
GLW_LIB_DEPS =
|
||||
|
||||
# Need to specify all libraries we may need
|
||||
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -Wl,--start-group \
|
||||
-l$(GL_LIB) $(TOP)/src/mesa/pipe/softpipe/libsoftpipe.a -Wl,--end-group \
|
||||
$(EXTRA_LIB_PATH) -lX11 -lXext -lXmu -lXt -lXi -lpthread -lstdc++ -lm
|
||||
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) \
|
||||
-l$(GL_LIB) $(EXTRA_LIB_PATH) -lX11 -lXext -lXmu -lXt -lXi -lpthread -lstdc++ -lm
|
||||
|
|
|
|||
89
configure.ac
89
configure.ac
|
|
@ -5,12 +5,8 @@ AC_PREREQ([2.59])
|
|||
dnl Versioning - scrape the version from configs/default
|
||||
m4_define([mesa_version],
|
||||
[m4_esyscmd([${MAKE-make} -s -f bin/version.mk version | tr -d '\n'])])
|
||||
m4_ifval(mesa_version,[],[
|
||||
m4_errprint([Error: Failed to get the Mesa version from the output of
|
||||
running `make -f bin/version.mk version'
|
||||
])
|
||||
m4_exit([1])
|
||||
])
|
||||
m4_ifval(mesa_version,,
|
||||
[m4_fatal([Failed to get the Mesa version from `make -f bin/version.mk version`])])
|
||||
|
||||
dnl Tell the user about autoconf.html in the --help output
|
||||
m4_divert_once([HELP_END], [
|
||||
|
|
@ -33,6 +29,11 @@ AC_CHECK_PROGS([MAKE], [gmake make])
|
|||
AC_PATH_PROG([MKDEP], [makedepend])
|
||||
AC_PATH_PROG([SED], [sed])
|
||||
|
||||
dnl Our fallback install-sh is a symlink to minstall. Use the existing
|
||||
dnl configuration in that case.
|
||||
AC_PROG_INSTALL
|
||||
test "x$INSTALL" = "x$ac_install_sh" && INSTALL='$(MINSTALL)'
|
||||
|
||||
dnl We need a POSIX shell for parts of the build. Assume we have one
|
||||
dnl in most cases.
|
||||
case "$host_os" in
|
||||
|
|
@ -58,15 +59,11 @@ fi
|
|||
AC_SUBST([MKDEP_OPTIONS])
|
||||
|
||||
dnl Make sure the pkg-config macros are defined
|
||||
m4_ifdef([PKG_PROG_PKG_CONFIG],[],[
|
||||
m4_errprint([Error: Could not locate the pkg-config autoconf macros.
|
||||
These are usually located in /usr/share/aclocal/pkg.m4. If your
|
||||
macros are in a different location, try setting the environment
|
||||
variable ACLOCAL="aclocal -I/other/macro/dir" before running
|
||||
autoreconf.
|
||||
])
|
||||
m4_exit([1])
|
||||
])
|
||||
m4_ifndef([PKG_PROG_PKG_CONFIG],
|
||||
[m4_fatal([Could not locate the pkg-config autoconf macros.
|
||||
These are usually located in /usr/share/aclocal/pkg.m4. If your macros
|
||||
are in a different location, try setting the environment variable
|
||||
ACLOCAL="aclocal -I/other/macro/dir" before running autoreconf.])])
|
||||
PKG_PROG_PKG_CONFIG()
|
||||
|
||||
dnl LIB_DIR - library basename
|
||||
|
|
@ -87,7 +84,7 @@ dnl Compiler macros
|
|||
DEFINES=""
|
||||
AC_SUBST([DEFINES])
|
||||
case "$host_os" in
|
||||
linux*|*-gnu*)
|
||||
linux*|*-gnu*|gnu*)
|
||||
DEFINES="$DEFINES -D_GNU_SOURCE -DPTHREADS"
|
||||
;;
|
||||
solaris*)
|
||||
|
|
@ -230,6 +227,8 @@ else
|
|||
case "$host_os" in
|
||||
darwin* )
|
||||
LIB_EXTENSION='dylib' ;;
|
||||
cygwin* )
|
||||
LIB_EXTENSION='dll' ;;
|
||||
* )
|
||||
LIB_EXTENSION='so' ;;
|
||||
esac
|
||||
|
|
@ -389,7 +388,7 @@ linux*)
|
|||
;;
|
||||
*freebsd* | dragonfly*)
|
||||
case "$host_cpu" in
|
||||
i*86|x86_64) default_driver="dri";;
|
||||
i*86|x86_64|powerpc*|sparc*) default_driver="dri";;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
|
@ -411,25 +410,26 @@ esac
|
|||
dnl
|
||||
dnl Driver specific build directories
|
||||
dnl
|
||||
SRC_DIRS="mesa egl glew"
|
||||
SRC_DIRS="mesa glew"
|
||||
GLU_DIRS="sgi"
|
||||
WINDOW_SYSTEM=""
|
||||
GALLIUM_DIRS="auxiliary drivers state_trackers"
|
||||
GALLIUM_WINSYS_DIRS=""
|
||||
GALLIUM_WINSYS_DRM_DIRS=""
|
||||
GALLIUM_AUXILIARY_DIRS="draw translate cso_cache pipebuffer tgsi sct rtasm util"
|
||||
GALLIUM_AUXILIARY_DIRS="rbug draw translate cso_cache pipebuffer tgsi sct rtasm util indices"
|
||||
GALLIUM_DRIVERS_DIRS="softpipe failover trace"
|
||||
GALLIUM_STATE_TRACKERS_DIRS=""
|
||||
|
||||
case "$mesa_driver" in
|
||||
xlib)
|
||||
DRIVER_DIRS="x11"
|
||||
GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS xlib"
|
||||
;;
|
||||
dri)
|
||||
SRC_DIRS="glx/x11 $SRC_DIRS"
|
||||
DRIVER_DIRS="dri"
|
||||
WINDOW_SYSTEM="dri"
|
||||
GALLIUM_WINSYS_DIRS="drm $GALLIUM_WINSYS_DIRS"
|
||||
GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS drm"
|
||||
;;
|
||||
osmesa)
|
||||
DRIVER_DIRS="osmesa"
|
||||
|
|
@ -750,6 +750,10 @@ if test "$mesa_driver" = dri; then
|
|||
unichrome savage sis swrast"
|
||||
fi
|
||||
;;
|
||||
gnu*)
|
||||
DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
|
||||
DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS"
|
||||
;;
|
||||
solaris*)
|
||||
DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
|
||||
DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
|
||||
|
|
@ -838,12 +842,12 @@ case "$mesa_driver" in
|
|||
osmesa)
|
||||
# only link libraries with osmesa if shared
|
||||
if test "$enable_static" = no; then
|
||||
OSMESA_LIB_DEPS="-lm -lpthread $SELINUX_LIBS"
|
||||
OSMESA_LIB_DEPS="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS"
|
||||
else
|
||||
OSMESA_LIB_DEPS=""
|
||||
fi
|
||||
OSMESA_MESA_DEPS=""
|
||||
OSMESA_PC_LIB_PRIV="-lm -lpthread $SELINUX_LIBS"
|
||||
OSMESA_PC_LIB_PRIV="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS"
|
||||
;;
|
||||
*)
|
||||
# Link OSMesa to libGL otherwise
|
||||
|
|
@ -857,9 +861,6 @@ osmesa)
|
|||
OSMESA_PC_REQ="gl"
|
||||
;;
|
||||
esac
|
||||
if test "$enable_static" = no; then
|
||||
OSMESA_LIB_DEPS="$OSMESA_LIB_DEPS"
|
||||
fi
|
||||
OSMESA_PC_LIB_PRIV="$OSMESA_PC_LIB_PRIV"
|
||||
AC_SUBST([OSMESA_LIB_DEPS])
|
||||
AC_SUBST([OSMESA_MESA_DEPS])
|
||||
|
|
@ -869,14 +870,23 @@ AC_SUBST([OSMESA_PC_LIB_PRIV])
|
|||
dnl
|
||||
dnl EGL configuration
|
||||
dnl
|
||||
if test "$x11_pkgconfig" = yes; then
|
||||
PKG_CHECK_MODULES([EGL],[x11])
|
||||
EGL_LIB_DEPS="$EGL_LIBS"
|
||||
else
|
||||
# should check these...
|
||||
EGL_LIB_DEPS="$X_LIBS -lX11"
|
||||
AC_ARG_ENABLE([egl],
|
||||
[AS_HELP_STRING([--disable-egl],
|
||||
[disable EGL library @<:@default=enabled@:>@])],
|
||||
[enable_egl="$enableval"],
|
||||
[enable_egl=yes])
|
||||
if test "x$enable_egl" = xyes; then
|
||||
SRC_DIRS="$SRC_DIRS egl"
|
||||
|
||||
if test "$x11_pkgconfig" = yes; then
|
||||
PKG_CHECK_MODULES([EGL], [x11])
|
||||
EGL_LIB_DEPS="$EGL_LIBS"
|
||||
else
|
||||
# should check these...
|
||||
EGL_LIB_DEPS="$X_LIBS -lX11"
|
||||
fi
|
||||
EGL_LIB_DEPS="$EGL_LIB_DEPS $DLOPEN_LIBS"
|
||||
fi
|
||||
EGL_LIB_DEPS="$EGL_LIB_DEPS $DLOPEN_LIBS"
|
||||
AC_SUBST([EGL_LIB_DEPS])
|
||||
|
||||
dnl
|
||||
|
|
@ -1079,6 +1089,9 @@ if test "x$APP_LIB_DEPS" = x; then
|
|||
solaris*)
|
||||
APP_LIB_DEPS="-lX11 -lsocket -lnsl -lm"
|
||||
;;
|
||||
cygwin*)
|
||||
APP_LIB_DEPS="-lX11"
|
||||
;;
|
||||
*)
|
||||
APP_LIB_DEPS="-lm"
|
||||
;;
|
||||
|
|
@ -1116,8 +1129,11 @@ no)
|
|||
yes)
|
||||
# look at what else is built
|
||||
case "$mesa_driver" in
|
||||
xlib)
|
||||
GALLIUM_STATE_TRACKERS_DIRS=glx
|
||||
;;
|
||||
dri)
|
||||
GALLIUM_STATE_TRACKERS_DIRS=egl
|
||||
test "x$enable_egl" = xyes && GALLIUM_STATE_TRACKERS_DIRS=egl
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
|
@ -1127,6 +1143,10 @@ yes)
|
|||
for tracker in $state_trackers; do
|
||||
test -d "$srcdir/src/gallium/state_trackers/$tracker" || \
|
||||
AC_MSG_ERROR([state tracker '$tracker' doesn't exist])
|
||||
|
||||
if test "$tracker" = egl && test "x$enable_egl" != xyes; then
|
||||
AC_MSG_ERROR([cannot build egl state tracker without EGL library])
|
||||
fi
|
||||
done
|
||||
GALLIUM_STATE_TRACKERS_DIRS="$state_trackers"
|
||||
;;
|
||||
|
|
@ -1175,7 +1195,7 @@ AC_ARG_ENABLE([gallium-nouveau],
|
|||
[enable_gallium_nouveau=no])
|
||||
if test "x$enable_gallium_nouveau" = xyes; then
|
||||
GALLIUM_WINSYS_DRM_DIRS="$GALLIUM_WINSYS_DRM_DIRS nouveau"
|
||||
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nv04 nv10 nv20 nv30 nv40 nv50"
|
||||
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nouveau nv04 nv10 nv20 nv30 nv40 nv50"
|
||||
fi
|
||||
|
||||
|
||||
|
|
@ -1242,6 +1262,7 @@ dnl Libraries
|
|||
echo ""
|
||||
echo " Shared libs: $enable_shared"
|
||||
echo " Static libs: $enable_static"
|
||||
echo " EGL: $enable_egl"
|
||||
echo " GLU: $enable_glu"
|
||||
echo " GLw: $enable_glw (Motif: $enable_motif)"
|
||||
echo " glut: $enable_glut"
|
||||
|
|
|
|||
|
|
@ -8,12 +8,6 @@
|
|||
|
||||
<H1>Downloading</H1>
|
||||
|
||||
<p>
|
||||
Current development release: <b>7.3</b>
|
||||
<br>
|
||||
Last stable release: <b>7.2</b>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Primary download site:
|
||||
<a href="http://sourceforge.net/project/showfiles.php?group_id=3"
|
||||
|
|
|
|||
|
|
@ -25,6 +25,9 @@ fragment programs (intended for developers only)
|
|||
<li>MESA_TNL_PROG - if set, implement conventional vertex transformation
|
||||
operations with vertex programs (intended for developers only).
|
||||
Setting this variable automatically sets the MESA_TEX_PROG variable as well.
|
||||
<li>MESA_EXTENSION_OVERRIDE - can be used to enable/disable extensions.
|
||||
A value such as "GL_EXT_foo -GL_EXT_bar" will enable the GL_EXT_foo extension
|
||||
and disable the GL_EXT_bar extension.
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
|
|
|
|||
|
|
@ -11,6 +11,27 @@
|
|||
<H1>News</H1>
|
||||
|
||||
|
||||
<h2>May 15, 2009</h2>
|
||||
<p>
|
||||
<a href="relnotes-7.4.2.html">Mesa 7.4.2</a> is released.
|
||||
This is a stable release fixing bugs since the 7.4.1 release.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>April 18, 2009</h2>
|
||||
<p>
|
||||
<a href="relnotes-7.4.1.html">Mesa 7.4.1</a> is released.
|
||||
This is a stable release fixing bugs since the 7.4 release.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>March 27, 2009</h2>
|
||||
<p>
|
||||
<a href="relnotes-7.4.html">Mesa 7.4</a> is released.
|
||||
This is a stable release fixing bugs since the 7.3 release.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>January 22, 2009</h2>
|
||||
<p>
|
||||
<a href="relnotes-7.3.html">Mesa 7.3</a> is released.
|
||||
|
|
|
|||
79
docs/relnotes-7.4.1.html
Normal file
79
docs/relnotes-7.4.1.html
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
<HTML>
|
||||
|
||||
<TITLE>Mesa Release Notes</TITLE>
|
||||
|
||||
<head><link rel="stylesheet" type="text/css" href="mesa.css"></head>
|
||||
|
||||
<BODY>
|
||||
|
||||
<body bgcolor="#eeeeee">
|
||||
|
||||
<H1>Mesa 7.4.1 Release Notes / 18 April 2009</H1>
|
||||
|
||||
<p>
|
||||
Mesa 7.4.1 is a stable development release fixing bugs since the 7.4 release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 7.4.1 implements the OpenGL 2.1 API, but the version reported by
|
||||
glGetString(GL_VERSION) depends on the particular driver being used.
|
||||
Some drivers don't support all the features required in OpenGL 2.1.
|
||||
</p>
|
||||
<p>
|
||||
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
|
||||
for DRI hardware acceleration.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>MD5 checksums</h2>
|
||||
<pre>
|
||||
0c3a72f3295a53a134c04bd7d209ea62 MesaLib-7.4.1.tar.gz
|
||||
423260578b653818ba66c2fcbde6d7ad MesaLib-7.4.1.tar.bz2
|
||||
84f78b154d4bd5c3ecc42eeff2e56676 MesaLib-7.4.1.zip
|
||||
aa0ad323e59d6d10ff33ac0dde462a60 MesaDemos-7.4.1.tar.gz
|
||||
1e169fb6abc2b45613f1c98a82dfe690 MesaDemos-7.4.1.tar.bz2
|
||||
294e42be2d74176596c994ec23322fcf MesaDemos-7.4.1.zip
|
||||
92373bfa48e7b68dddf356e86b0e5699 MesaGLUT-7.4.1.tar.gz
|
||||
336f3824b578b072211e0beecf4f04f4 MesaGLUT-7.4.1.tar.bz2
|
||||
20751388d8ef16b42d25d9e3d705d101 MesaGLUT-7.4.1.zip
|
||||
</pre>
|
||||
|
||||
|
||||
<h2>Bug fixes</h2>
|
||||
<ul>
|
||||
<li>Fixed a two-sided lighting bug in fixed-function-to-GPU code generation
|
||||
<li>Fixed some Darwin issues (Jeremy Huddleston)
|
||||
<li>Indexing the GLSL gl_EyePlane[] or gl_ObjectPlane[] arrays with a variable
|
||||
was broken, bug 20986
|
||||
<li>Fixed incorrect texture unit bias in TXB instruction
|
||||
<li>glTexParameter settings weren't always propogated to drivers
|
||||
<li>Assorted vertex/fragment program bug fixes
|
||||
<li>Fixed point rendering in software rasterizer
|
||||
<li>Fixed potential deadlock in object hash functions
|
||||
<li>Fix a couple bugs surrounding front-buffer rendering with DRI2, but this
|
||||
is not quite complete.
|
||||
<li>Fixed glPopAttrib() bug when restoring user clip planes
|
||||
</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>
|
||||
74
docs/relnotes-7.4.2.html
Normal file
74
docs/relnotes-7.4.2.html
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
<HTML>
|
||||
|
||||
<TITLE>Mesa Release Notes</TITLE>
|
||||
|
||||
<head><link rel="stylesheet" type="text/css" href="mesa.css"></head>
|
||||
|
||||
<BODY>
|
||||
|
||||
<body bgcolor="#eeeeee">
|
||||
|
||||
<H1>Mesa 7.4.2 Release Notes / May 15, 2009</H1>
|
||||
|
||||
<p>
|
||||
Mesa 7.4.2 is a stable development release fixing bugs since the 7.4.1 release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 7.4.2 implements the OpenGL 2.1 API, but the version reported by
|
||||
glGetString(GL_VERSION) depends on the particular driver being used.
|
||||
Some drivers don't support all the features required in OpenGL 2.1.
|
||||
</p>
|
||||
<p>
|
||||
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
|
||||
for DRI hardware acceleration.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>MD5 checksums</h2>
|
||||
<pre>
|
||||
172f5193154dad731387f97bd44ab68f MesaLib-7.4.2.tar.gz
|
||||
b10a76e32bde4645cfc34ea0416d7d8b MesaLib-7.4.2.tar.bz2
|
||||
cc6dfc2efd424cc342b84e6bcd78ce5d MesaLib-7.4.2.zip
|
||||
182a7e78aa7a480b3650a5c956dbddd1 MesaDemos-7.4.2.tar.gz
|
||||
bf559a0485667a3bfa4513a23501579b MesaDemos-7.4.2.tar.bz2
|
||||
5379e622b65e8c22022dba34aeb6f4f9 MesaDemos-7.4.2.zip
|
||||
7cc43c1c35bf6a279a16e063dea3b8c5 MesaGLUT-7.4.2.tar.gz
|
||||
e0dfc44d537904a030861e5b3c760c11 MesaGLUT-7.4.2.tar.bz2
|
||||
4a6cf5bbbac190d6ba97448b3098b7f4 MesaGLUT-7.4.2.zip
|
||||
</pre>
|
||||
|
||||
|
||||
<h2>Bug fixes</h2>
|
||||
<ul>
|
||||
<li>Fixed segfault when rendering to front buffer with DRI 1.
|
||||
<li>Fixed swrast texture rectangle bug when wrap mode = GL_CLAMP_TO_BORDER and
|
||||
filter mode = GL_LINEAR. (bug 21461)
|
||||
<li>Fixed texture object mem leak during context destruction.
|
||||
<li>Fixed a state validation bug in glCopyTex[Sub]Image()
|
||||
<li>Fixed some i965 GLSL bugs.
|
||||
<li>Fixed an R300 driver texture object bad memory reference.
|
||||
</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>
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
<body bgcolor="#eeeeee">
|
||||
|
||||
<H1>Mesa 7.4 Release Notes / date TBD</H1>
|
||||
<H1>Mesa 7.4 Release Notes / 27 March 2009</H1>
|
||||
|
||||
<p>
|
||||
Mesa 7.4 is a stable development release fixing bugs since the 7.3 release.
|
||||
|
|
@ -20,28 +20,48 @@ Some drivers don't support all the features required in OpenGL 2.1.
|
|||
</p>
|
||||
<p>
|
||||
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
|
||||
for DRI ardware acceleration.
|
||||
for DRI hardware acceleration.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>MD5 checksums</h2>
|
||||
<pre>
|
||||
tbd
|
||||
ed6bd7437177307e51e16d0c7c381dfa MesaLib-7.4.tar.gz
|
||||
7ecddb341a2691e0dfdb02f697109834 MesaLib-7.4.tar.bz2
|
||||
433e823f8245f9fd5f397e7b719a8e47 MesaLib-7.4.zip
|
||||
656eee6128016fb237e01aa8dabbc703 MesaDemos-7.4.tar.gz
|
||||
02816f10f30b1dc5e069e0f68c177c98 MesaDemos-7.4.tar.bz2
|
||||
44a70d6db4aa4c64ecc47871b6aceee8 MesaDemos-7.4.zip
|
||||
25f80db4f8645cd3e58e2c9af53ec341 MesaGLUT-7.4.tar.gz
|
||||
04ec01caebde44f5b0d619f00716b368 MesaGLUT-7.4.tar.bz2
|
||||
019dc213baecaa3cb1278847d41b8591 MesaGLUT-7.4.zip
|
||||
</pre>
|
||||
|
||||
|
||||
<h2>New features</h2>
|
||||
<ul>
|
||||
<li>Added MESA_GLX_FORCE_DIRECT env var for Xlib/software driver
|
||||
<li>GLSL version 1.20 is returnd by the GL_SHADING_LANGUAGE_VERSION query
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Bug fixes</h2>
|
||||
<ul>
|
||||
<li>glGetActiveUniform() returned wrong size for some array types
|
||||
<li>Fixed some error checking in glUniform()
|
||||
<li>Fixed a potential glTexImage('proxy target') segfault
|
||||
<li>Fixed bad reference counting for 1D/2D texture arrays
|
||||
<li>Fixed VBO + glPush/PopClientAttrib() bug #19835
|
||||
<li>Assorted i965 driver bug fixes
|
||||
<li>Fixed a Windows compilation failure in s_triangle.c
|
||||
<li>Fixed a GLSL array indexing bug
|
||||
<li>Fixes for building on Haiku
|
||||
</ul>
|
||||
|
||||
<h2>Changes</h2>
|
||||
<ul>
|
||||
<li>Updated GL/glxext.h to version 48
|
||||
<li>Assorted updates for building on Solaris
|
||||
</ul>
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
<p>
|
||||
Mesa 7.5 is a new development release.
|
||||
People who are concerned with stability and reliability should stick
|
||||
with the 7.4.x branch or wait for Mesa 7.6.
|
||||
with the 7.4.x branch or wait for Mesa 7.5.1.
|
||||
</p>
|
||||
<p>
|
||||
The main new feature of Mesa 7.5 is the
|
||||
|
|
@ -27,7 +27,14 @@ Some drivers don't support all the features required in OpenGL 2.1.
|
|||
</p>
|
||||
<p>
|
||||
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
|
||||
for DRI ardware acceleration.
|
||||
for DRI hardware acceleration.
|
||||
</p>
|
||||
<p>
|
||||
Note that the Mesa project is no longer using odd/even version numbers
|
||||
to indicate development/stable releases.
|
||||
The so-called development releases have been fairly stable.
|
||||
If you're especially concerned with stability you should probably look for
|
||||
"point" releases such as 7.5.1 which will be a bug-fix release.
|
||||
</p>
|
||||
|
||||
|
||||
|
|
@ -39,7 +46,7 @@ tbd
|
|||
|
||||
<h2>New features</h2>
|
||||
<ul>
|
||||
<li>Gallium - this is the new architecture for OS-independent and
|
||||
<li>Gallium3D - this is the new architecture for OS-independent and
|
||||
API-independent 3D drivers.
|
||||
Gallium3D is intended for GPUs that fully support vertex/fragment shaders.
|
||||
The Gallium3D drivers currently included are:
|
||||
|
|
@ -47,8 +54,10 @@ tbd
|
|||
<li>softpipe - a software/reference driver
|
||||
<li>i915 - Intel 915/945 driver
|
||||
<li><a href="cell.html">Cell</a> - IBM/Sony/Toshiba Cell processor driver
|
||||
<li>nouveau - preliminary driver for NVIDIA GPUs (still under development)
|
||||
<li>r300 - preliminary driver for R300 (still under development)
|
||||
<li>nouveau (for NVIDIA GPUs) and R300 for (AMD/ATI R300).
|
||||
<b>PLEASE NOTE: these drivers are incomplete and still under development.
|
||||
It's probably NOT worthwhile to report any bugs unless you have patches.
|
||||
</b>
|
||||
</ul>
|
||||
<li>GL_ARB_framebuffer_object extension (software drivers, i965 driver)
|
||||
<li>Reworked two-sided stencil support.
|
||||
|
|
@ -58,12 +67,14 @@ including GL_ATI_separate_stencil, GL_EXT_stencil_two_side and OpenGL 2.0
|
|||
<li>GL_NV_texture_env_combine4 extension (software drivers, i965/i915 drivers)
|
||||
<li>GL_EXT_texture_swizzle extension (software drivers, i965 driver)
|
||||
<li>Updated SPARC assembly optimizations (David S. Miller)
|
||||
<li>Initial support for separate compilation units in GLSL compiler.
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Bug fixes</h2>
|
||||
<ul>
|
||||
<li>Lots of i965 driver bug fixes
|
||||
<li>Fixed some GLSL preprocessor bugs
|
||||
</ul>
|
||||
|
||||
|
||||
|
|
@ -71,6 +82,7 @@ including GL_ATI_separate_stencil, GL_EXT_stencil_two_side and OpenGL 2.0
|
|||
<ul>
|
||||
<li>Remove support for GL_SGIX_shadow, GL_SGIX_shadow_ambient and
|
||||
GL_SGIX_depth_texture extensions. Superseded by the ARB versions.
|
||||
<li>Omitted some old Mesa demos from the release tarballs, added some others.
|
||||
</ul>
|
||||
|
||||
</body>
|
||||
|
|
|
|||
56
docs/relnotes-7.6.html
Normal file
56
docs/relnotes-7.6.html
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
<HTML>
|
||||
|
||||
<TITLE>Mesa Release Notes</TITLE>
|
||||
|
||||
<head><link rel="stylesheet" type="text/css" href="mesa.css"></head>
|
||||
|
||||
<BODY>
|
||||
|
||||
<body bgcolor="#eeeeee">
|
||||
|
||||
<H1>Mesa 7.6 Release Notes / date TBD</H1>
|
||||
|
||||
<p>
|
||||
Mesa 7.6 is a new development release.
|
||||
People who are concerned with stability and reliability should stick
|
||||
with a previous release or wait for Mesa 7.6.1.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 7.6 implements the OpenGL 2.1 API, but the version reported by
|
||||
glGetString(GL_VERSION) depends on the particular driver being used.
|
||||
Some drivers don't support all the features required in OpenGL 2.1.
|
||||
</p>
|
||||
<p>
|
||||
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
|
||||
for DRI hardware acceleration.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>MD5 checksums</h2>
|
||||
<pre>
|
||||
tbd
|
||||
</pre>
|
||||
|
||||
|
||||
<h2>New features</h2>
|
||||
<ul>
|
||||
<li><a href="openvg.html">OpenVG</a> front-end (state tracker for Gallium).
|
||||
This was written by Zack Rusin at Tungsten Graphics.
|
||||
<li>GL_APPLE_vertex_array_object for Gallium drivers and Intel DRI drivers.
|
||||
<li>GL_ARB_copy_buffer extension (supported in Gallium and swrast drivers)
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Bug fixes</h2>
|
||||
<ul>
|
||||
<li>i965 DRI driver fixes, including support for "unlimited" size constant
|
||||
buffers (GLSL uniforms)
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Changes</h2>
|
||||
<ul>
|
||||
</ul>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -10,8 +10,8 @@
|
|||
|
||||
<p>
|
||||
Mesa uses an even/odd version number scheme like the Linux kernel.
|
||||
Odd numbered versions (such as 7.5) designate new developmental releases.
|
||||
Even numbered versions (such as 7.4) designate stable releases.
|
||||
Odd numbered versions (such as 6.5) designate new developmental releases.
|
||||
Even numbered versions (such as 6.4) designate stable releases.
|
||||
</p>
|
||||
|
||||
|
||||
|
|
@ -20,7 +20,10 @@ The release notes summarize what's new or changed in each Mesa release.
|
|||
</p>
|
||||
|
||||
<UL>
|
||||
<LI><A HREF="relnotes-7.6.html">7.6 release notes</A>
|
||||
<LI><A HREF="relnotes-7.5.html">7.5 release notes</A>
|
||||
<LI><A HREF="relnotes-7.4.2.html">7.4.2 release notes</A>
|
||||
<LI><A HREF="relnotes-7.4.1.html">7.4.1 release notes</A>
|
||||
<LI><A HREF="relnotes-7.4.html">7.4 release notes</A>
|
||||
<LI><A HREF="relnotes-7.3.html">7.3 release notes</A>
|
||||
<LI><A HREF="relnotes-7.2.html">7.2 release notes</A>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 7.5
|
||||
* Version: 7.6
|
||||
*
|
||||
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 2009 VMware, Inc. 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"),
|
||||
|
|
@ -1739,41 +1740,6 @@ GLAPI void GLAPIENTRY glSeparableFilter2D( GLenum target,
|
|||
GLAPI void GLAPIENTRY glGetSeparableFilter( GLenum target, GLenum format,
|
||||
GLenum type, GLvoid *row, GLvoid *column, GLvoid *span );
|
||||
|
||||
typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
|
||||
typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);
|
||||
typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
|
||||
typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
|
||||
typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
|
||||
typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
|
||||
typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table);
|
||||
typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
|
||||
typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
|
||||
typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
|
||||
typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
|
||||
typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
|
||||
typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
|
||||
typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params);
|
||||
typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
|
||||
typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params);
|
||||
typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
|
||||
typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
|
||||
typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image);
|
||||
typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
|
||||
typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
|
||||
typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
|
||||
typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
|
||||
typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
|
||||
typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
|
||||
typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
|
||||
typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
|
||||
typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
|
||||
typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
|
||||
typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
|
||||
typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink);
|
||||
typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target);
|
||||
typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
|
@ -1978,53 +1944,6 @@ GLAPI void GLAPIENTRY glMultTransposeMatrixf( const GLfloat m[16] );
|
|||
|
||||
GLAPI void GLAPIENTRY glSampleCoverage( GLclampf value, GLboolean invert );
|
||||
|
||||
typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture);
|
||||
typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v);
|
||||
typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m);
|
||||
typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m);
|
||||
typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m);
|
||||
typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m);
|
||||
typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert);
|
||||
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
|
||||
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
|
||||
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
|
||||
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
|
||||
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
|
||||
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
|
||||
typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, void *img);
|
||||
|
||||
|
||||
/*
|
||||
* GL_ARB_multitexture (ARB extension 1 and OpenGL 1.2.1)
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2007 The Khronos Group Inc.
|
||||
** Copyright (c) 2007-2009 The Khronos Group Inc.
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person obtaining a
|
||||
** copy of this software and/or associated documentation files (the
|
||||
|
|
@ -28,6 +28,13 @@ extern "C" {
|
|||
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*/
|
||||
|
||||
/* Header file version number, required by OpenGL ABI for Linux */
|
||||
/* glext.h last updated $Date: 2009-05-05 15:27:42 -0700 (Tue, 05 May 2009) $ */
|
||||
/* Current version at http://www.opengl.org/registry/ */
|
||||
#define GL_GLEXT_VERSION 52
|
||||
|
||||
/* Function declaration macros - to move into glplatform.h */
|
||||
|
||||
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
|
||||
#define WIN32_LEAN_AND_MEAN 1
|
||||
#include <windows.h>
|
||||
|
|
@ -45,18 +52,12 @@ extern "C" {
|
|||
|
||||
/*************************************************************/
|
||||
|
||||
/* Header file version number, required by OpenGL ABI for Linux */
|
||||
/* glext.h last updated 2009/03/19 */
|
||||
/* Current version at http://www.opengl.org/registry/ */
|
||||
#define GL_GLEXT_VERSION 48
|
||||
|
||||
#ifndef GL_VERSION_1_2
|
||||
#define GL_UNSIGNED_BYTE_3_3_2 0x8032
|
||||
#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
|
||||
#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
|
||||
#define GL_UNSIGNED_INT_8_8_8_8 0x8035
|
||||
#define GL_UNSIGNED_INT_10_10_10_2 0x8036
|
||||
#define GL_RESCALE_NORMAL 0x803A
|
||||
#define GL_TEXTURE_BINDING_3D 0x806A
|
||||
#define GL_PACK_SKIP_IMAGES 0x806B
|
||||
#define GL_PACK_IMAGE_HEIGHT 0x806C
|
||||
|
|
@ -83,17 +84,21 @@ extern "C" {
|
|||
#define GL_TEXTURE_MAX_LOD 0x813B
|
||||
#define GL_TEXTURE_BASE_LEVEL 0x813C
|
||||
#define GL_TEXTURE_MAX_LEVEL 0x813D
|
||||
#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8
|
||||
#define GL_SINGLE_COLOR 0x81F9
|
||||
#define GL_SEPARATE_SPECULAR_COLOR 0x81FA
|
||||
#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12
|
||||
#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13
|
||||
#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22
|
||||
#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23
|
||||
#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
|
||||
#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
|
||||
#endif
|
||||
|
||||
#ifndef GL_VERSION_1_2_DEPRECATED
|
||||
#define GL_RESCALE_NORMAL 0x803A
|
||||
#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8
|
||||
#define GL_SINGLE_COLOR 0x81F9
|
||||
#define GL_SEPARATE_SPECULAR_COLOR 0x81FA
|
||||
#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_imaging
|
||||
#define GL_CONSTANT_COLOR 0x8001
|
||||
#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
|
||||
|
|
@ -106,6 +111,9 @@ extern "C" {
|
|||
#define GL_BLEND_EQUATION 0x8009
|
||||
#define GL_FUNC_SUBTRACT 0x800A
|
||||
#define GL_FUNC_REVERSE_SUBTRACT 0x800B
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_imaging_DEPRECATED
|
||||
#define GL_CONVOLUTION_1D 0x8010
|
||||
#define GL_CONVOLUTION_2D 0x8011
|
||||
#define GL_SEPARABLE_2D 0x8012
|
||||
|
|
@ -206,12 +214,6 @@ extern "C" {
|
|||
#define GL_TEXTURE30 0x84DE
|
||||
#define GL_TEXTURE31 0x84DF
|
||||
#define GL_ACTIVE_TEXTURE 0x84E0
|
||||
#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1
|
||||
#define GL_MAX_TEXTURE_UNITS 0x84E2
|
||||
#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3
|
||||
#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4
|
||||
#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5
|
||||
#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6
|
||||
#define GL_MULTISAMPLE 0x809D
|
||||
#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
|
||||
#define GL_SAMPLE_ALPHA_TO_ONE 0x809F
|
||||
|
|
@ -220,9 +222,6 @@ extern "C" {
|
|||
#define GL_SAMPLES 0x80A9
|
||||
#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
|
||||
#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
|
||||
#define GL_MULTISAMPLE_BIT 0x20000000
|
||||
#define GL_NORMAL_MAP 0x8511
|
||||
#define GL_REFLECTION_MAP 0x8512
|
||||
#define GL_TEXTURE_CUBE_MAP 0x8513
|
||||
#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
|
||||
#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
|
||||
|
|
@ -233,10 +232,6 @@ extern "C" {
|
|||
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
|
||||
#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B
|
||||
#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
|
||||
#define GL_COMPRESSED_ALPHA 0x84E9
|
||||
#define GL_COMPRESSED_LUMINANCE 0x84EA
|
||||
#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB
|
||||
#define GL_COMPRESSED_INTENSITY 0x84EC
|
||||
#define GL_COMPRESSED_RGB 0x84ED
|
||||
#define GL_COMPRESSED_RGBA 0x84EE
|
||||
#define GL_TEXTURE_COMPRESSION_HINT 0x84EF
|
||||
|
|
@ -245,6 +240,22 @@ extern "C" {
|
|||
#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
|
||||
#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
|
||||
#define GL_CLAMP_TO_BORDER 0x812D
|
||||
#endif
|
||||
|
||||
#ifndef GL_VERSION_1_3_DEPRECATED
|
||||
#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1
|
||||
#define GL_MAX_TEXTURE_UNITS 0x84E2
|
||||
#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3
|
||||
#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4
|
||||
#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5
|
||||
#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6
|
||||
#define GL_MULTISAMPLE_BIT 0x20000000
|
||||
#define GL_NORMAL_MAP 0x8511
|
||||
#define GL_REFLECTION_MAP 0x8512
|
||||
#define GL_COMPRESSED_ALPHA 0x84E9
|
||||
#define GL_COMPRESSED_LUMINANCE 0x84EA
|
||||
#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB
|
||||
#define GL_COMPRESSED_INTENSITY 0x84EC
|
||||
#define GL_COMBINE 0x8570
|
||||
#define GL_COMBINE_RGB 0x8571
|
||||
#define GL_COMBINE_ALPHA 0x8572
|
||||
|
|
@ -276,16 +287,26 @@ extern "C" {
|
|||
#define GL_BLEND_SRC_RGB 0x80C9
|
||||
#define GL_BLEND_DST_ALPHA 0x80CA
|
||||
#define GL_BLEND_SRC_ALPHA 0x80CB
|
||||
#define GL_POINT_SIZE_MIN 0x8126
|
||||
#define GL_POINT_SIZE_MAX 0x8127
|
||||
#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128
|
||||
#define GL_POINT_DISTANCE_ATTENUATION 0x8129
|
||||
#define GL_GENERATE_MIPMAP 0x8191
|
||||
#define GL_GENERATE_MIPMAP_HINT 0x8192
|
||||
#define GL_DEPTH_COMPONENT16 0x81A5
|
||||
#define GL_DEPTH_COMPONENT24 0x81A6
|
||||
#define GL_DEPTH_COMPONENT32 0x81A7
|
||||
#define GL_MIRRORED_REPEAT 0x8370
|
||||
#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD
|
||||
#define GL_TEXTURE_LOD_BIAS 0x8501
|
||||
#define GL_INCR_WRAP 0x8507
|
||||
#define GL_DECR_WRAP 0x8508
|
||||
#define GL_TEXTURE_DEPTH_SIZE 0x884A
|
||||
#define GL_TEXTURE_COMPARE_MODE 0x884C
|
||||
#define GL_TEXTURE_COMPARE_FUNC 0x884D
|
||||
#endif
|
||||
|
||||
#ifndef GL_VERSION_1_4_DEPRECATED
|
||||
#define GL_POINT_SIZE_MIN 0x8126
|
||||
#define GL_POINT_SIZE_MAX 0x8127
|
||||
#define GL_POINT_DISTANCE_ATTENUATION 0x8129
|
||||
#define GL_GENERATE_MIPMAP 0x8191
|
||||
#define GL_GENERATE_MIPMAP_HINT 0x8192
|
||||
#define GL_FOG_COORDINATE_SOURCE 0x8450
|
||||
#define GL_FOG_COORDINATE 0x8451
|
||||
#define GL_FRAGMENT_DEPTH 0x8452
|
||||
|
|
@ -301,15 +322,8 @@ extern "C" {
|
|||
#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C
|
||||
#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D
|
||||
#define GL_SECONDARY_COLOR_ARRAY 0x845E
|
||||
#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD
|
||||
#define GL_TEXTURE_FILTER_CONTROL 0x8500
|
||||
#define GL_TEXTURE_LOD_BIAS 0x8501
|
||||
#define GL_INCR_WRAP 0x8507
|
||||
#define GL_DECR_WRAP 0x8508
|
||||
#define GL_TEXTURE_DEPTH_SIZE 0x884A
|
||||
#define GL_DEPTH_TEXTURE_MODE 0x884B
|
||||
#define GL_TEXTURE_COMPARE_MODE 0x884C
|
||||
#define GL_TEXTURE_COMPARE_FUNC 0x884D
|
||||
#define GL_COMPARE_R_TO_TEXTURE 0x884E
|
||||
#endif
|
||||
|
||||
|
|
@ -324,15 +338,6 @@ extern "C" {
|
|||
#define GL_ELEMENT_ARRAY_BUFFER 0x8893
|
||||
#define GL_ARRAY_BUFFER_BINDING 0x8894
|
||||
#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
|
||||
#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896
|
||||
#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897
|
||||
#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898
|
||||
#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899
|
||||
#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A
|
||||
#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B
|
||||
#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C
|
||||
#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D
|
||||
#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E
|
||||
#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
|
||||
#define GL_READ_ONLY 0x88B8
|
||||
#define GL_WRITE_ONLY 0x88B9
|
||||
|
|
@ -350,31 +355,42 @@ extern "C" {
|
|||
#define GL_DYNAMIC_READ 0x88E9
|
||||
#define GL_DYNAMIC_COPY 0x88EA
|
||||
#define GL_SAMPLES_PASSED 0x8914
|
||||
#define GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE
|
||||
#define GL_FOG_COORD GL_FOG_COORDINATE
|
||||
#define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE
|
||||
#define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE
|
||||
#define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE
|
||||
#define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER
|
||||
#define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY
|
||||
#define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING
|
||||
#define GL_SRC0_RGB GL_SOURCE0_RGB
|
||||
#define GL_SRC1_RGB GL_SOURCE1_RGB
|
||||
#define GL_SRC2_RGB GL_SOURCE2_RGB
|
||||
#define GL_SRC0_ALPHA GL_SOURCE0_ALPHA
|
||||
#define GL_SRC1_ALPHA GL_SOURCE1_ALPHA
|
||||
#define GL_SRC2_ALPHA GL_SOURCE2_ALPHA
|
||||
#endif
|
||||
|
||||
#ifndef GL_VERSION_1_5_DEPRECATED
|
||||
#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896
|
||||
#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897
|
||||
#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898
|
||||
#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899
|
||||
#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A
|
||||
#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B
|
||||
#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C
|
||||
#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D
|
||||
#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E
|
||||
#define GL_FOG_COORD_SRC 0x8450
|
||||
#define GL_FOG_COORD 0x8451
|
||||
#define GL_CURRENT_FOG_COORD 0x8453
|
||||
#define GL_FOG_COORD_ARRAY_TYPE 0x8454
|
||||
#define GL_FOG_COORD_ARRAY_STRIDE 0x8455
|
||||
#define GL_FOG_COORD_ARRAY_POINTER 0x8456
|
||||
#define GL_FOG_COORD_ARRAY 0x8457
|
||||
#define GL_FOG_COORD_ARRAY_BUFFER_BINDING 0x889D
|
||||
#define GL_SRC0_RGB 0x8580
|
||||
#define GL_SRC1_RGB 0x8581
|
||||
#define GL_SRC2_RGB 0x8582
|
||||
#define GL_SRC0_ALPHA 0x8588
|
||||
#define GL_SRC1_ALPHA 0x8589
|
||||
#define GL_SRC2_ALPHA 0x858A
|
||||
#endif
|
||||
|
||||
#ifndef GL_VERSION_2_0
|
||||
#define GL_BLEND_EQUATION_RGB GL_BLEND_EQUATION
|
||||
#define GL_BLEND_EQUATION_RGB 0x8009
|
||||
#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
|
||||
#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
|
||||
#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
|
||||
#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
|
||||
#define GL_CURRENT_VERTEX_ATTRIB 0x8626
|
||||
#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642
|
||||
#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643
|
||||
#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
|
||||
#define GL_STENCIL_BACK_FUNC 0x8800
|
||||
#define GL_STENCIL_BACK_FAIL 0x8801
|
||||
|
|
@ -398,11 +414,8 @@ extern "C" {
|
|||
#define GL_DRAW_BUFFER14 0x8833
|
||||
#define GL_DRAW_BUFFER15 0x8834
|
||||
#define GL_BLEND_EQUATION_ALPHA 0x883D
|
||||
#define GL_POINT_SPRITE 0x8861
|
||||
#define GL_COORD_REPLACE 0x8862
|
||||
#define GL_MAX_VERTEX_ATTRIBS 0x8869
|
||||
#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
|
||||
#define GL_MAX_TEXTURE_COORDS 0x8871
|
||||
#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
|
||||
#define GL_FRAGMENT_SHADER 0x8B30
|
||||
#define GL_VERTEX_SHADER 0x8B31
|
||||
|
|
@ -453,8 +466,14 @@ extern "C" {
|
|||
#define GL_STENCIL_BACK_WRITEMASK 0x8CA5
|
||||
#endif
|
||||
|
||||
#ifndef GL_VERSION_2_0_DEPRECATED
|
||||
#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643
|
||||
#define GL_POINT_SPRITE 0x8861
|
||||
#define GL_COORD_REPLACE 0x8862
|
||||
#define GL_MAX_TEXTURE_COORDS 0x8871
|
||||
#endif
|
||||
|
||||
#ifndef GL_VERSION_2_1
|
||||
#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F
|
||||
#define GL_PIXEL_PACK_BUFFER 0x88EB
|
||||
#define GL_PIXEL_UNPACK_BUFFER 0x88EC
|
||||
#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED
|
||||
|
|
@ -469,25 +488,29 @@ extern "C" {
|
|||
#define GL_SRGB8 0x8C41
|
||||
#define GL_SRGB_ALPHA 0x8C42
|
||||
#define GL_SRGB8_ALPHA8 0x8C43
|
||||
#define GL_COMPRESSED_SRGB 0x8C48
|
||||
#define GL_COMPRESSED_SRGB_ALPHA 0x8C49
|
||||
#endif
|
||||
|
||||
#ifndef GL_VERSION_2_1_DEPRECATED
|
||||
#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F
|
||||
#define GL_SLUMINANCE_ALPHA 0x8C44
|
||||
#define GL_SLUMINANCE8_ALPHA8 0x8C45
|
||||
#define GL_SLUMINANCE 0x8C46
|
||||
#define GL_SLUMINANCE8 0x8C47
|
||||
#define GL_COMPRESSED_SRGB 0x8C48
|
||||
#define GL_COMPRESSED_SRGB_ALPHA 0x8C49
|
||||
#define GL_COMPRESSED_SLUMINANCE 0x8C4A
|
||||
#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B
|
||||
#endif
|
||||
|
||||
#ifndef GL_VERSION_3_0
|
||||
#define GL_COMPARE_REF_TO_TEXTURE GL_COMPARE_R_TO_TEXTURE_ARB
|
||||
#define GL_CLIP_DISTANCE0 GL_CLIP_PLANE0
|
||||
#define GL_CLIP_DISTANCE1 GL_CLIP_PLANE1
|
||||
#define GL_CLIP_DISTANCE2 GL_CLIP_PLANE2
|
||||
#define GL_CLIP_DISTANCE3 GL_CLIP_PLANE3
|
||||
#define GL_CLIP_DISTANCE4 GL_CLIP_PLANE4
|
||||
#define GL_CLIP_DISTANCE5 GL_CLIP_PLANE5
|
||||
#define GL_MAX_CLIP_DISTANCES GL_MAX_CLIP_PLANES
|
||||
#define GL_COMPARE_REF_TO_TEXTURE 0x884E
|
||||
#define GL_CLIP_DISTANCE0 0x3000
|
||||
#define GL_CLIP_DISTANCE1 0x3001
|
||||
#define GL_CLIP_DISTANCE2 0x3002
|
||||
#define GL_CLIP_DISTANCE3 0x3003
|
||||
#define GL_CLIP_DISTANCE4 0x3004
|
||||
#define GL_CLIP_DISTANCE5 0x3005
|
||||
#define GL_MAX_CLIP_DISTANCES 0x0D32
|
||||
#define GL_MAJOR_VERSION 0x821B
|
||||
#define GL_MINOR_VERSION 0x821C
|
||||
#define GL_NUM_EXTENSIONS 0x821D
|
||||
|
|
@ -505,19 +528,9 @@ extern "C" {
|
|||
#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF
|
||||
#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904
|
||||
#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905
|
||||
#define GL_CLAMP_VERTEX_COLOR 0x891A
|
||||
#define GL_CLAMP_FRAGMENT_COLOR 0x891B
|
||||
#define GL_CLAMP_READ_COLOR 0x891C
|
||||
#define GL_FIXED_ONLY 0x891D
|
||||
#define GL_MAX_VARYING_COMPONENTS GL_MAX_VARYING_FLOATS
|
||||
#define GL_TEXTURE_RED_TYPE 0x8C10
|
||||
#define GL_TEXTURE_GREEN_TYPE 0x8C11
|
||||
#define GL_TEXTURE_BLUE_TYPE 0x8C12
|
||||
#define GL_TEXTURE_ALPHA_TYPE 0x8C13
|
||||
#define GL_TEXTURE_LUMINANCE_TYPE 0x8C14
|
||||
#define GL_TEXTURE_INTENSITY_TYPE 0x8C15
|
||||
#define GL_TEXTURE_DEPTH_TYPE 0x8C16
|
||||
#define GL_UNSIGNED_NORMALIZED 0x8C17
|
||||
#define GL_MAX_VARYING_COMPONENTS 0x8B4B
|
||||
#define GL_TEXTURE_1D_ARRAY 0x8C18
|
||||
#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19
|
||||
#define GL_TEXTURE_2D_ARRAY 0x8C1A
|
||||
|
|
@ -559,7 +572,6 @@ extern "C" {
|
|||
#define GL_RED_INTEGER 0x8D94
|
||||
#define GL_GREEN_INTEGER 0x8D95
|
||||
#define GL_BLUE_INTEGER 0x8D96
|
||||
#define GL_ALPHA_INTEGER 0x8D97
|
||||
#define GL_RGB_INTEGER 0x8D98
|
||||
#define GL_RGBA_INTEGER 0x8D99
|
||||
#define GL_BGR_INTEGER 0x8D9A
|
||||
|
|
@ -615,8 +627,6 @@ extern "C" {
|
|||
/* reuse GL_TEXTURE_GREEN_TYPE */
|
||||
/* reuse GL_TEXTURE_BLUE_TYPE */
|
||||
/* reuse GL_TEXTURE_ALPHA_TYPE */
|
||||
/* reuse GL_TEXTURE_LUMINANCE_TYPE */
|
||||
/* reuse GL_TEXTURE_INTENSITY_TYPE */
|
||||
/* reuse GL_TEXTURE_DEPTH_TYPE */
|
||||
/* reuse GL_UNSIGNED_NORMALIZED */
|
||||
/* reuse GL_FRAMEBUFFER_BINDING */
|
||||
|
|
@ -716,7 +726,32 @@ extern "C" {
|
|||
/* reuse GL_VERTEX_ARRAY_BINDING */
|
||||
#endif
|
||||
|
||||
#ifndef GL_VERSION_3_0_DEPRECATED
|
||||
#define GL_CLAMP_VERTEX_COLOR 0x891A
|
||||
#define GL_CLAMP_FRAGMENT_COLOR 0x891B
|
||||
#define GL_ALPHA_INTEGER 0x8D97
|
||||
/* Reuse tokens from ARB_framebuffer_object */
|
||||
/* reuse GL_TEXTURE_LUMINANCE_TYPE */
|
||||
/* reuse GL_TEXTURE_INTENSITY_TYPE */
|
||||
#endif
|
||||
|
||||
#ifndef GL_VERSION_3_1
|
||||
#define GL_SAMPLER_2D_RECT 0x8B63
|
||||
#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64
|
||||
#define GL_SAMPLER_BUFFER 0x8DC2
|
||||
#define GL_INT_SAMPLER_2D_RECT 0x8DCD
|
||||
#define GL_INT_SAMPLER_BUFFER 0x8DD0
|
||||
#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5
|
||||
#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8
|
||||
#define GL_TEXTURE_BUFFER 0x8C2A
|
||||
#define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B
|
||||
#define GL_TEXTURE_BINDING_BUFFER 0x8C2C
|
||||
#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D
|
||||
#define GL_TEXTURE_BUFFER_FORMAT 0x8C2E
|
||||
#define GL_TEXTURE_RECTANGLE 0x84F5
|
||||
#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6
|
||||
#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7
|
||||
#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8
|
||||
#define GL_RED_SNORM 0x8F90
|
||||
#define GL_RG_SNORM 0x8F91
|
||||
#define GL_RGB_SNORM 0x8F92
|
||||
|
|
@ -732,6 +767,41 @@ extern "C" {
|
|||
#define GL_SIGNED_NORMALIZED 0x8F9C
|
||||
#define GL_PRIMITIVE_RESTART 0x8F9D
|
||||
#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E
|
||||
/* Reuse tokens from ARB_copy_buffer */
|
||||
/* reuse GL_COPY_READ_BUFFER */
|
||||
/* reuse GL_COPY_WRITE_BUFFER */
|
||||
/* Would reuse tokens from ARB_draw_instanced, but it has none */
|
||||
/* Reuse tokens from ARB_uniform_buffer_object */
|
||||
/* reuse GL_UNIFORM_BUFFER */
|
||||
/* reuse GL_UNIFORM_BUFFER_BINDING */
|
||||
/* reuse GL_UNIFORM_BUFFER_START */
|
||||
/* reuse GL_UNIFORM_BUFFER_SIZE */
|
||||
/* reuse GL_MAX_VERTEX_UNIFORM_BLOCKS */
|
||||
/* reuse GL_MAX_FRAGMENT_UNIFORM_BLOCKS */
|
||||
/* reuse GL_MAX_COMBINED_UNIFORM_BLOCKS */
|
||||
/* reuse GL_MAX_UNIFORM_BUFFER_BINDINGS */
|
||||
/* reuse GL_MAX_UNIFORM_BLOCK_SIZE */
|
||||
/* reuse GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS */
|
||||
/* reuse GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS */
|
||||
/* reuse GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT */
|
||||
/* reuse GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH */
|
||||
/* reuse GL_ACTIVE_UNIFORM_BLOCKS */
|
||||
/* reuse GL_UNIFORM_TYPE */
|
||||
/* reuse GL_UNIFORM_SIZE */
|
||||
/* reuse GL_UNIFORM_NAME_LENGTH */
|
||||
/* reuse GL_UNIFORM_BLOCK_INDEX */
|
||||
/* reuse GL_UNIFORM_OFFSET */
|
||||
/* reuse GL_UNIFORM_ARRAY_STRIDE */
|
||||
/* reuse GL_UNIFORM_MATRIX_STRIDE */
|
||||
/* reuse GL_UNIFORM_IS_ROW_MAJOR */
|
||||
/* reuse GL_UNIFORM_BLOCK_BINDING */
|
||||
/* reuse GL_UNIFORM_BLOCK_DATA_SIZE */
|
||||
/* reuse GL_UNIFORM_BLOCK_NAME_LENGTH */
|
||||
/* reuse GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS */
|
||||
/* reuse GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES */
|
||||
/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER */
|
||||
/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER */
|
||||
/* reuse GL_INVALID_INDEX */
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_multitexture
|
||||
|
|
@ -1251,12 +1321,17 @@ extern "C" {
|
|||
#define GL_FRAMEBUFFER_DEFAULT 0x8218
|
||||
#define GL_FRAMEBUFFER_UNDEFINED 0x8219
|
||||
#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A
|
||||
#define GL_INDEX 0x8222
|
||||
#define GL_MAX_RENDERBUFFER_SIZE 0x84E8
|
||||
#define GL_DEPTH_STENCIL 0x84F9
|
||||
#define GL_UNSIGNED_INT_24_8 0x84FA
|
||||
#define GL_DEPTH24_STENCIL8 0x88F0
|
||||
#define GL_TEXTURE_STENCIL_SIZE 0x88F1
|
||||
#define GL_TEXTURE_RED_TYPE 0x8C10
|
||||
#define GL_TEXTURE_GREEN_TYPE 0x8C11
|
||||
#define GL_TEXTURE_BLUE_TYPE 0x8C12
|
||||
#define GL_TEXTURE_ALPHA_TYPE 0x8C13
|
||||
#define GL_TEXTURE_DEPTH_TYPE 0x8C16
|
||||
#define GL_UNSIGNED_NORMALIZED 0x8C17
|
||||
#define GL_FRAMEBUFFER_BINDING 0x8CA6
|
||||
#define GL_DRAW_FRAMEBUFFER_BINDING GL_FRAMEBUFFER_BINDING
|
||||
#define GL_RENDERBUFFER_BINDING 0x8CA7
|
||||
|
|
@ -1313,6 +1388,12 @@ extern "C" {
|
|||
#define GL_MAX_SAMPLES 0x8D57
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_framebuffer_object_DEPRECATED
|
||||
#define GL_INDEX 0x8222
|
||||
#define GL_TEXTURE_LUMINANCE_TYPE 0x8C14
|
||||
#define GL_TEXTURE_INTENSITY_TYPE 0x8C15
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_framebuffer_sRGB
|
||||
#define GL_FRAMEBUFFER_SRGB 0x8DB9
|
||||
#endif
|
||||
|
|
@ -1434,7 +1515,7 @@ extern "C" {
|
|||
#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44
|
||||
#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45
|
||||
#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46
|
||||
#define GL_INVALID_INDEX_ARB 0xFFFFFFFFu
|
||||
#define GL_INVALID_INDEX 0xFFFFFFFFu
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_compatibility
|
||||
|
|
@ -1446,6 +1527,9 @@ extern "C" {
|
|||
#define GL_COPY_WRITE_BUFFER 0x8F37
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_shader_texture_lod
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_abgr
|
||||
#define GL_ABGR_EXT 0x8000
|
||||
#endif
|
||||
|
|
@ -3431,7 +3515,7 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
#ifndef GL_EXT_blend_equation_separate
|
||||
#define GL_BLEND_EQUATION_RGB_EXT GL_BLEND_EQUATION
|
||||
#define GL_BLEND_EQUATION_RGB_EXT 0x8009
|
||||
#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D
|
||||
#endif
|
||||
|
||||
|
|
@ -3968,7 +4052,7 @@ extern "C" {
|
|||
#include <stddef.h>
|
||||
#ifndef GL_VERSION_2_0
|
||||
/* GL type for program/shader text */
|
||||
typedef char GLchar; /* native character */
|
||||
typedef char GLchar;
|
||||
#endif
|
||||
|
||||
#ifndef GL_VERSION_1_5
|
||||
|
|
@ -3984,12 +4068,12 @@ typedef ptrdiff_t GLsizeiptrARB;
|
|||
#endif
|
||||
|
||||
#ifndef GL_ARB_shader_objects
|
||||
/* GL types for handling shader object handles and program/shader text */
|
||||
typedef char GLcharARB; /* native character */
|
||||
typedef unsigned int GLhandleARB; /* shader object handle */
|
||||
/* GL types for program/shader text and shader object handles */
|
||||
typedef char GLcharARB;
|
||||
typedef unsigned int GLhandleARB;
|
||||
#endif
|
||||
|
||||
/* GL types for "half" precision (s10e5) float data in host memory */
|
||||
/* GL type for "half" precision (s10e5) float data in host memory */
|
||||
#ifndef GL_ARB_half_float_pixel
|
||||
typedef unsigned short GLhalfARB;
|
||||
#endif
|
||||
|
|
@ -4031,7 +4115,8 @@ typedef __int32 int32_t;
|
|||
typedef __int64 int64_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
#else
|
||||
#include <inttypes.h> /* Fallback option */
|
||||
/* Fallback if nothing above works */
|
||||
#include <inttypes.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
|
@ -4046,6 +4131,21 @@ typedef uint64_t GLuint64EXT;
|
|||
GLAPI void APIENTRY glBlendColor (GLclampf, GLclampf, GLclampf, GLclampf);
|
||||
GLAPI void APIENTRY glBlendEquation (GLenum);
|
||||
GLAPI void APIENTRY glDrawRangeElements (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *);
|
||||
GLAPI void APIENTRY glTexImage3D (GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
|
||||
GLAPI void APIENTRY glTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
|
||||
GLAPI void APIENTRY glCopyTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
|
||||
typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);
|
||||
typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
|
||||
typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
#endif
|
||||
|
||||
#ifndef GL_VERSION_1_2_DEPRECATED
|
||||
#define GL_VERSION_1_2_DEPRECATED 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glColorTable (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
|
||||
GLAPI void APIENTRY glColorTableParameterfv (GLenum, GLenum, const GLfloat *);
|
||||
GLAPI void APIENTRY glColorTableParameteriv (GLenum, GLenum, const GLint *);
|
||||
|
|
@ -4078,13 +4178,7 @@ GLAPI void APIENTRY glHistogram (GLenum, GLsizei, GLenum, GLboolean);
|
|||
GLAPI void APIENTRY glMinmax (GLenum, GLenum, GLboolean);
|
||||
GLAPI void APIENTRY glResetHistogram (GLenum);
|
||||
GLAPI void APIENTRY glResetMinmax (GLenum);
|
||||
GLAPI void APIENTRY glTexImage3D (GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
|
||||
GLAPI void APIENTRY glTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
|
||||
GLAPI void APIENTRY glCopyTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
|
||||
typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);
|
||||
typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
|
||||
typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
|
||||
typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
|
||||
typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
|
||||
|
|
@ -4117,15 +4211,35 @@ typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenu
|
|||
typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink);
|
||||
typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target);
|
||||
typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target);
|
||||
typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
|
||||
typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
#endif
|
||||
|
||||
#ifndef GL_VERSION_1_3
|
||||
#define GL_VERSION_1_3 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glActiveTexture (GLenum);
|
||||
GLAPI void APIENTRY glSampleCoverage (GLclampf, GLboolean);
|
||||
GLAPI void APIENTRY glCompressedTexImage3D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
|
||||
GLAPI void APIENTRY glCompressedTexImage2D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
|
||||
GLAPI void APIENTRY glCompressedTexImage1D (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *);
|
||||
GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
|
||||
GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
|
||||
GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *);
|
||||
GLAPI void APIENTRY glGetCompressedTexImage (GLenum, GLint, GLvoid *);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture);
|
||||
typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert);
|
||||
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
|
||||
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
|
||||
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
|
||||
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
|
||||
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
|
||||
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
|
||||
typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img);
|
||||
#endif
|
||||
|
||||
#ifndef GL_VERSION_1_3_DEPRECATED
|
||||
#define GL_VERSION_1_3_DEPRECATED 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glClientActiveTexture (GLenum);
|
||||
GLAPI void APIENTRY glMultiTexCoord1d (GLenum, GLdouble);
|
||||
GLAPI void APIENTRY glMultiTexCoord1dv (GLenum, const GLdouble *);
|
||||
|
|
@ -4163,16 +4277,7 @@ GLAPI void APIENTRY glLoadTransposeMatrixf (const GLfloat *);
|
|||
GLAPI void APIENTRY glLoadTransposeMatrixd (const GLdouble *);
|
||||
GLAPI void APIENTRY glMultTransposeMatrixf (const GLfloat *);
|
||||
GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *);
|
||||
GLAPI void APIENTRY glSampleCoverage (GLclampf, GLboolean);
|
||||
GLAPI void APIENTRY glCompressedTexImage3D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
|
||||
GLAPI void APIENTRY glCompressedTexImage2D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *);
|
||||
GLAPI void APIENTRY glCompressedTexImage1D (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *);
|
||||
GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
|
||||
GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *);
|
||||
GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *);
|
||||
GLAPI void APIENTRY glGetCompressedTexImage (GLenum, GLint, GLvoid *);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture);
|
||||
typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s);
|
||||
typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v);
|
||||
|
|
@ -4210,31 +4315,36 @@ typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m);
|
|||
typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m);
|
||||
typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m);
|
||||
typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m);
|
||||
typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert);
|
||||
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
|
||||
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
|
||||
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
|
||||
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
|
||||
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
|
||||
typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
|
||||
typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img);
|
||||
#endif
|
||||
|
||||
#ifndef GL_VERSION_1_4
|
||||
#define GL_VERSION_1_4 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glBlendFuncSeparate (GLenum, GLenum, GLenum, GLenum);
|
||||
GLAPI void APIENTRY glFogCoordf (GLfloat);
|
||||
GLAPI void APIENTRY glFogCoordfv (const GLfloat *);
|
||||
GLAPI void APIENTRY glFogCoordd (GLdouble);
|
||||
GLAPI void APIENTRY glFogCoorddv (const GLdouble *);
|
||||
GLAPI void APIENTRY glFogCoordPointer (GLenum, GLsizei, const GLvoid *);
|
||||
GLAPI void APIENTRY glMultiDrawArrays (GLenum, GLint *, GLsizei *, GLsizei);
|
||||
GLAPI void APIENTRY glMultiDrawElements (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei);
|
||||
GLAPI void APIENTRY glPointParameterf (GLenum, GLfloat);
|
||||
GLAPI void APIENTRY glPointParameterfv (GLenum, const GLfloat *);
|
||||
GLAPI void APIENTRY glPointParameteri (GLenum, GLint);
|
||||
GLAPI void APIENTRY glPointParameteriv (GLenum, const GLint *);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
|
||||
typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
|
||||
typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
|
||||
typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param);
|
||||
typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params);
|
||||
typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param);
|
||||
typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params);
|
||||
#endif
|
||||
|
||||
#ifndef GL_VERSION_1_4_DEPRECATED
|
||||
#define GL_VERSION_1_4_DEPRECATED 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glFogCoordf (GLfloat);
|
||||
GLAPI void APIENTRY glFogCoordfv (const GLfloat *);
|
||||
GLAPI void APIENTRY glFogCoordd (GLdouble);
|
||||
GLAPI void APIENTRY glFogCoorddv (const GLdouble *);
|
||||
GLAPI void APIENTRY glFogCoordPointer (GLenum, GLsizei, const GLvoid *);
|
||||
GLAPI void APIENTRY glSecondaryColor3b (GLbyte, GLbyte, GLbyte);
|
||||
GLAPI void APIENTRY glSecondaryColor3bv (const GLbyte *);
|
||||
GLAPI void APIENTRY glSecondaryColor3d (GLdouble, GLdouble, GLdouble);
|
||||
|
|
@ -4269,18 +4379,11 @@ GLAPI void APIENTRY glWindowPos3iv (const GLint *);
|
|||
GLAPI void APIENTRY glWindowPos3s (GLshort, GLshort, GLshort);
|
||||
GLAPI void APIENTRY glWindowPos3sv (const GLshort *);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
|
||||
typedef void (APIENTRYP PFNGLFOGCOORDFPROC) (GLfloat coord);
|
||||
typedef void (APIENTRYP PFNGLFOGCOORDFVPROC) (const GLfloat *coord);
|
||||
typedef void (APIENTRYP PFNGLFOGCOORDDPROC) (GLdouble coord);
|
||||
typedef void (APIENTRYP PFNGLFOGCOORDDVPROC) (const GLdouble *coord);
|
||||
typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
|
||||
typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount);
|
||||
typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param);
|
||||
typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params);
|
||||
typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param);
|
||||
typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params);
|
||||
typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue);
|
||||
typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v);
|
||||
typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue);
|
||||
|
|
@ -4592,26 +4695,6 @@ GLAPI void APIENTRY glGetTransformFeedbackVarying (GLuint, GLuint, GLsizei, GLsi
|
|||
GLAPI void APIENTRY glClampColor (GLenum, GLenum);
|
||||
GLAPI void APIENTRY glBeginConditionalRender (GLuint, GLenum);
|
||||
GLAPI void APIENTRY glEndConditionalRender (void);
|
||||
GLAPI void APIENTRY glVertexAttribI1i (GLuint, GLint);
|
||||
GLAPI void APIENTRY glVertexAttribI2i (GLuint, GLint, GLint);
|
||||
GLAPI void APIENTRY glVertexAttribI3i (GLuint, GLint, GLint, GLint);
|
||||
GLAPI void APIENTRY glVertexAttribI4i (GLuint, GLint, GLint, GLint, GLint);
|
||||
GLAPI void APIENTRY glVertexAttribI1ui (GLuint, GLuint);
|
||||
GLAPI void APIENTRY glVertexAttribI2ui (GLuint, GLuint, GLuint);
|
||||
GLAPI void APIENTRY glVertexAttribI3ui (GLuint, GLuint, GLuint, GLuint);
|
||||
GLAPI void APIENTRY glVertexAttribI4ui (GLuint, GLuint, GLuint, GLuint, GLuint);
|
||||
GLAPI void APIENTRY glVertexAttribI1iv (GLuint, const GLint *);
|
||||
GLAPI void APIENTRY glVertexAttribI2iv (GLuint, const GLint *);
|
||||
GLAPI void APIENTRY glVertexAttribI3iv (GLuint, const GLint *);
|
||||
GLAPI void APIENTRY glVertexAttribI4iv (GLuint, const GLint *);
|
||||
GLAPI void APIENTRY glVertexAttribI1uiv (GLuint, const GLuint *);
|
||||
GLAPI void APIENTRY glVertexAttribI2uiv (GLuint, const GLuint *);
|
||||
GLAPI void APIENTRY glVertexAttribI3uiv (GLuint, const GLuint *);
|
||||
GLAPI void APIENTRY glVertexAttribI4uiv (GLuint, const GLuint *);
|
||||
GLAPI void APIENTRY glVertexAttribI4bv (GLuint, const GLbyte *);
|
||||
GLAPI void APIENTRY glVertexAttribI4sv (GLuint, const GLshort *);
|
||||
GLAPI void APIENTRY glVertexAttribI4ubv (GLuint, const GLubyte *);
|
||||
GLAPI void APIENTRY glVertexAttribI4usv (GLuint, const GLushort *);
|
||||
GLAPI void APIENTRY glVertexAttribIPointer (GLuint, GLint, GLenum, GLsizei, const GLvoid *);
|
||||
GLAPI void APIENTRY glGetVertexAttribIiv (GLuint, GLenum, GLint *);
|
||||
GLAPI void APIENTRY glGetVertexAttribIuiv (GLuint, GLenum, GLuint *);
|
||||
|
|
@ -4651,26 +4734,6 @@ typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint program, G
|
|||
typedef void (APIENTRYP PFNGLCLAMPCOLORPROC) (GLenum target, GLenum clamp);
|
||||
typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERPROC) (GLuint id, GLenum mode);
|
||||
typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERPROC) (void);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IPROC) (GLuint index, GLint x);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IPROC) (GLuint index, GLint x, GLint y);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IPROC) (GLuint index, GLint x, GLint y, GLint z);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIPROC) (GLuint index, GLuint x);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIPROC) (GLuint index, GLuint x, GLuint y);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVPROC) (GLuint index, const GLint *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVPROC) (GLuint index, const GLint *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVPROC) (GLuint index, const GLint *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVPROC) (GLuint index, const GLint *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVPROC) (GLuint index, const GLuint *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVPROC) (GLuint index, const GLuint *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVPROC) (GLuint index, const GLuint *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVPROC) (GLuint index, const GLuint *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVPROC) (GLuint index, const GLbyte *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVPROC) (GLuint index, const GLshort *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVPROC) (GLuint index, const GLubyte *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVPROC) (GLuint index, const GLushort *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
|
||||
typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVPROC) (GLuint index, GLenum pname, GLint *params);
|
||||
typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint index, GLenum pname, GLuint *params);
|
||||
|
|
@ -4696,6 +4759,69 @@ typedef void (APIENTRYP PFNGLCLEARBUFFERFIPROC) (GLenum buffer, GLint drawbuffer
|
|||
typedef const GLubyte * (APIENTRYP PFNGLGETSTRINGIPROC) (GLenum name, GLuint index);
|
||||
#endif
|
||||
|
||||
#ifndef GL_VERSION_3_0_DEPRECATED
|
||||
#define GL_VERSION_3_0_DEPRECATED 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glVertexAttribI1i (GLuint, GLint);
|
||||
GLAPI void APIENTRY glVertexAttribI2i (GLuint, GLint, GLint);
|
||||
GLAPI void APIENTRY glVertexAttribI3i (GLuint, GLint, GLint, GLint);
|
||||
GLAPI void APIENTRY glVertexAttribI4i (GLuint, GLint, GLint, GLint, GLint);
|
||||
GLAPI void APIENTRY glVertexAttribI1ui (GLuint, GLuint);
|
||||
GLAPI void APIENTRY glVertexAttribI2ui (GLuint, GLuint, GLuint);
|
||||
GLAPI void APIENTRY glVertexAttribI3ui (GLuint, GLuint, GLuint, GLuint);
|
||||
GLAPI void APIENTRY glVertexAttribI4ui (GLuint, GLuint, GLuint, GLuint, GLuint);
|
||||
GLAPI void APIENTRY glVertexAttribI1iv (GLuint, const GLint *);
|
||||
GLAPI void APIENTRY glVertexAttribI2iv (GLuint, const GLint *);
|
||||
GLAPI void APIENTRY glVertexAttribI3iv (GLuint, const GLint *);
|
||||
GLAPI void APIENTRY glVertexAttribI4iv (GLuint, const GLint *);
|
||||
GLAPI void APIENTRY glVertexAttribI1uiv (GLuint, const GLuint *);
|
||||
GLAPI void APIENTRY glVertexAttribI2uiv (GLuint, const GLuint *);
|
||||
GLAPI void APIENTRY glVertexAttribI3uiv (GLuint, const GLuint *);
|
||||
GLAPI void APIENTRY glVertexAttribI4uiv (GLuint, const GLuint *);
|
||||
GLAPI void APIENTRY glVertexAttribI4bv (GLuint, const GLbyte *);
|
||||
GLAPI void APIENTRY glVertexAttribI4sv (GLuint, const GLshort *);
|
||||
GLAPI void APIENTRY glVertexAttribI4ubv (GLuint, const GLubyte *);
|
||||
GLAPI void APIENTRY glVertexAttribI4usv (GLuint, const GLushort *);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IPROC) (GLuint index, GLint x);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IPROC) (GLuint index, GLint x, GLint y);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IPROC) (GLuint index, GLint x, GLint y, GLint z);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIPROC) (GLuint index, GLuint x);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIPROC) (GLuint index, GLuint x, GLuint y);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVPROC) (GLuint index, const GLint *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVPROC) (GLuint index, const GLint *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVPROC) (GLuint index, const GLint *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVPROC) (GLuint index, const GLint *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVPROC) (GLuint index, const GLuint *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVPROC) (GLuint index, const GLuint *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVPROC) (GLuint index, const GLuint *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVPROC) (GLuint index, const GLuint *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVPROC) (GLuint index, const GLbyte *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVPROC) (GLuint index, const GLshort *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVPROC) (GLuint index, const GLubyte *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVPROC) (GLuint index, const GLushort *v);
|
||||
#endif
|
||||
|
||||
#ifndef GL_VERSION_3_1
|
||||
#define GL_VERSION_3_1 1
|
||||
/* OpenGL 3.1 also reuses entry points from these extensions: */
|
||||
/* ARB_copy_buffer */
|
||||
/* ARB_uniform_buffer_object */
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glDrawArraysInstanced (GLenum, GLint, GLsizei, GLsizei);
|
||||
GLAPI void APIENTRY glDrawElementsInstanced (GLenum, GLsizei, GLenum, const GLvoid *, GLsizei);
|
||||
GLAPI void APIENTRY glTexBuffer (GLenum, GLenum, GLuint);
|
||||
GLAPI void APIENTRY glPrimitiveRestartIndex (GLuint);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
|
||||
typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
|
||||
typedef void (APIENTRYP PFNGLTEXBUFFERPROC) (GLenum target, GLenum internalformat, GLuint buffer);
|
||||
typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXPROC) (GLuint index);
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_multitexture
|
||||
#define GL_ARB_multitexture 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
|
|
@ -5360,9 +5486,9 @@ typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEARBPROC) (GLenum target, GLen
|
|||
#ifndef GL_ARB_instanced_arrays
|
||||
#define GL_ARB_instanced_arrays 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glVertexAttribDivisor (GLuint, GLuint);
|
||||
GLAPI void APIENTRY glVertexAttribDivisorARB (GLuint, GLuint);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORARBPROC) (GLuint index, GLuint divisor);
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_map_buffer_range
|
||||
|
|
@ -5437,6 +5563,10 @@ GLAPI void APIENTRY glCopyBufferSubData (GLenum, GLenum, GLintptr, GLintptr, GLs
|
|||
typedef void (APIENTRYP PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_shader_texture_lod
|
||||
#define GL_ARB_shader_texture_lod 1
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_abgr
|
||||
#define GL_EXT_abgr 1
|
||||
#endif
|
||||
|
|
@ -8150,7 +8280,6 @@ GLAPI void APIENTRY glGetVideoivNV (GLuint, GLenum, GLint *);
|
|||
GLAPI void APIENTRY glGetVideouivNV (GLuint, GLenum, GLuint *);
|
||||
GLAPI void APIENTRY glGetVideoi64vNV (GLuint, GLenum, GLint64EXT *);
|
||||
GLAPI void APIENTRY glGetVideoui64vNV (GLuint, GLenum, GLuint64EXT *);
|
||||
GLAPI void APIENTRY glVideoParameterivNV (GLuint, GLenum, const GLint *);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLPRESENTFRAMEKEYEDNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1);
|
||||
typedef void (APIENTRYP PFNGLPRESENTFRAMEDUALFILLNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3);
|
||||
|
|
@ -8158,7 +8287,6 @@ typedef void (APIENTRYP PFNGLGETVIDEOIVNVPROC) (GLuint video_slot, GLenum pname,
|
|||
typedef void (APIENTRYP PFNGLGETVIDEOUIVNVPROC) (GLuint video_slot, GLenum pname, GLuint *params);
|
||||
typedef void (APIENTRYP PFNGLGETVIDEOI64VNVPROC) (GLuint video_slot, GLenum pname, GLint64EXT *params);
|
||||
typedef void (APIENTRYP PFNGLGETVIDEOUI64VNVPROC) (GLuint video_slot, GLenum pname, GLuint64EXT *params);
|
||||
typedef void (APIENTRYP PFNGLVIDEOPARAMETERIVNVPROC) (GLuint video_slot, GLenum pname, const GLint *params);
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_transform_feedback
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@
|
|||
#define DRI_INTERFACE_H
|
||||
|
||||
/* For archs with no drm.h */
|
||||
#if !defined(__APPLE__) && !defined(__CYGWIN__)
|
||||
#if !defined(__APPLE__) && !defined(__CYGWIN__) && !defined(__GNU__)
|
||||
#include <drm.h>
|
||||
#else
|
||||
typedef unsigned int drm_context_t;
|
||||
|
|
@ -649,6 +649,7 @@ struct __DRIswrastExtensionRec {
|
|||
#define __DRI_BUFFER_ACCUM 6
|
||||
#define __DRI_BUFFER_FAKE_FRONT_LEFT 7
|
||||
#define __DRI_BUFFER_FAKE_FRONT_RIGHT 8
|
||||
#define __DRI_BUFFER_DEPTH_STENCIL 9 /**< Only available with DRI2 1.1 */
|
||||
|
||||
struct __DRIbufferRec {
|
||||
unsigned int attachment;
|
||||
|
|
@ -659,7 +660,7 @@ struct __DRIbufferRec {
|
|||
};
|
||||
|
||||
#define __DRI_DRI2_LOADER "DRI_DRI2Loader"
|
||||
#define __DRI_DRI2_LOADER_VERSION 1
|
||||
#define __DRI_DRI2_LOADER_VERSION 3
|
||||
struct __DRIdri2LoaderExtensionRec {
|
||||
__DRIextension base;
|
||||
|
||||
|
|
@ -667,6 +668,44 @@ struct __DRIdri2LoaderExtensionRec {
|
|||
int *width, int *height,
|
||||
unsigned int *attachments, int count,
|
||||
int *out_count, void *loaderPrivate);
|
||||
|
||||
/**
|
||||
* Flush pending front-buffer rendering
|
||||
*
|
||||
* Any rendering that has been performed to the
|
||||
* \c __DRI_BUFFER_FAKE_FRONT_LEFT will be flushed to the
|
||||
* \c __DRI_BUFFER_FRONT_LEFT.
|
||||
*
|
||||
* \param driDrawable Drawable whose front-buffer is to be flushed
|
||||
* \param loaderPrivate Loader's private data that was previously passed
|
||||
* into __DRIdri2ExtensionRec::createNewDrawable
|
||||
*/
|
||||
void (*flushFrontBuffer)(__DRIdrawable *driDrawable, void *loaderPrivate);
|
||||
|
||||
|
||||
/**
|
||||
* Get list of buffers from the server
|
||||
*
|
||||
* Gets a list of buffer for the specified set of attachments. Unlike
|
||||
* \c ::getBuffers, this function takes a list of attachments paired with
|
||||
* opaque \c unsigned \c int value describing the format of the buffer.
|
||||
* It is the responsibility of the caller to know what the service that
|
||||
* allocates the buffers will expect to receive for the format.
|
||||
*
|
||||
* \param driDrawable Drawable whose buffers are being queried.
|
||||
* \param width Output where the width of the buffers is stored.
|
||||
* \param height Output where the height of the buffers is stored.
|
||||
* \param attachments List of pairs of attachment ID and opaque format
|
||||
* requested for the drawable.
|
||||
* \param count Number of attachment / format pairs stored in
|
||||
* \c attachments.
|
||||
* \param loaderPrivate Loader's private data that was previously passed
|
||||
* into __DRIdri2ExtensionRec::createNewDrawable.
|
||||
*/
|
||||
__DRIbuffer *(*getBuffersWithFormat)(__DRIdrawable *driDrawable,
|
||||
int *width, int *height,
|
||||
unsigned int *attachments, int count,
|
||||
int *out_count, void *loaderPrivate);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -108,13 +108,6 @@ WGLAPI int GLAPIENTRY GetPixelFormat(HDC);
|
|||
WGLAPI int GLAPIENTRY SetPixelFormat(HDC,int,const PIXELFORMATDESCRIPTOR *);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_ARB_extensions_string
|
||||
#define WGL_ARB_extensions_string 1
|
||||
|
||||
WGLAPI const char * GLAPIENTRY wglGetExtensionsStringARB(HDC hdc);
|
||||
|
||||
#endif /* WGL_ARB_extensions_string */
|
||||
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning( pop )
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2007 The Khronos Group Inc.
|
||||
** Copyright (c) 2007-2009 The Khronos Group Inc.
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person obtaining a
|
||||
** copy of this software and/or associated documentation files (the
|
||||
|
|
@ -28,6 +28,8 @@ extern "C" {
|
|||
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*/
|
||||
|
||||
/* Function declaration macros - to move into glplatform.h */
|
||||
|
||||
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
|
||||
#define WIN32_LEAN_AND_MEAN 1
|
||||
#include <windows.h>
|
||||
|
|
@ -709,6 +711,14 @@ typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD *pFrameCount, DWO
|
|||
#define WGL_NV_float_buffer 1
|
||||
#endif
|
||||
|
||||
#ifndef WGL_3DL_stereo_control
|
||||
#define WGL_3DL_stereo_control 1
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
extern BOOL WINAPI wglSetStereoEmitterState3DL (HDC, UINT);
|
||||
#endif /* WGL_WGLEXT_PROTOTYPES */
|
||||
typedef BOOL (WINAPI * PFNWGLSETSTEREOEMITTERSTATE3DLPROC) (HDC hDC, UINT uState);
|
||||
#endif
|
||||
|
||||
#ifndef WGL_EXT_pixel_format_packed_float
|
||||
#define WGL_EXT_pixel_format_packed_float 1
|
||||
#endif
|
||||
|
|
|
|||
7
progs/demos/.gitignore
vendored
7
progs/demos/.gitignore
vendored
|
|
@ -5,10 +5,12 @@ bounce
|
|||
clearspd
|
||||
copypix
|
||||
cubemap
|
||||
dinoshade
|
||||
drawpix
|
||||
engine
|
||||
extfuncs.h
|
||||
fbo_firecube
|
||||
fbotexture
|
||||
fire
|
||||
fogcoord
|
||||
fplight
|
||||
|
|
@ -27,11 +29,9 @@ isosurf
|
|||
lodbias
|
||||
morph3d
|
||||
multiarb
|
||||
occlude
|
||||
osdemo
|
||||
paltex
|
||||
pixeltex
|
||||
pointblast
|
||||
projtex
|
||||
rain
|
||||
ray
|
||||
readpix
|
||||
|
|
@ -61,4 +61,5 @@ trispd
|
|||
tunnel
|
||||
tunnel2
|
||||
vao_demo
|
||||
Windows
|
||||
winpos
|
||||
|
|
|
|||
|
|
@ -19,9 +19,11 @@ PROGS = \
|
|||
clearspd \
|
||||
copypix \
|
||||
cubemap \
|
||||
dinoshade \
|
||||
drawpix \
|
||||
engine \
|
||||
fbo_firecube \
|
||||
fbotexture \
|
||||
fire \
|
||||
fogcoord \
|
||||
fplight \
|
||||
|
|
@ -32,9 +34,7 @@ PROGS = \
|
|||
geartrain \
|
||||
glinfo \
|
||||
gloss \
|
||||
glslnoise \
|
||||
gltestperf \
|
||||
glutfx \
|
||||
isosurf \
|
||||
ipers \
|
||||
lodbias \
|
||||
|
|
@ -42,6 +42,7 @@ PROGS = \
|
|||
multiarb \
|
||||
paltex \
|
||||
pointblast \
|
||||
projtex \
|
||||
rain \
|
||||
ray \
|
||||
readpix \
|
||||
|
|
@ -49,7 +50,6 @@ PROGS = \
|
|||
renormal \
|
||||
shadowtex \
|
||||
singlebuffer \
|
||||
streaming_rect \
|
||||
spectex \
|
||||
spriteblast \
|
||||
stex3d \
|
||||
|
|
@ -57,9 +57,7 @@ PROGS = \
|
|||
terrain \
|
||||
tessdemo \
|
||||
texcyl \
|
||||
texdown \
|
||||
texenv \
|
||||
texobj \
|
||||
textures \
|
||||
trispd \
|
||||
tunnel \
|
||||
|
|
|
|||
|
|
@ -39,11 +39,9 @@ progs = [
|
|||
'geartrain',
|
||||
'glinfo',
|
||||
'gloss',
|
||||
'glslnoise',
|
||||
'gltestperf',
|
||||
'glutfx',
|
||||
'isosurf',
|
||||
'ipers',
|
||||
'isosurf',
|
||||
'lodbias',
|
||||
'morph3d',
|
||||
'multiarb',
|
||||
|
|
@ -55,7 +53,6 @@ progs = [
|
|||
'renormal',
|
||||
'shadowtex',
|
||||
'singlebuffer',
|
||||
'streaming_rect',
|
||||
'spectex',
|
||||
'spriteblast',
|
||||
'stex3d',
|
||||
|
|
@ -63,15 +60,16 @@ progs = [
|
|||
'terrain',
|
||||
'tessdemo',
|
||||
'texcyl',
|
||||
'texdown',
|
||||
'texenv',
|
||||
'texobj',
|
||||
'textures',
|
||||
'trispd',
|
||||
'tunnel',
|
||||
'tunnel2',
|
||||
'vao_demo',
|
||||
'winpos',
|
||||
'dinoshade',
|
||||
'fbotexture',
|
||||
'projtex',
|
||||
]
|
||||
|
||||
for prog in progs:
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@ enum {
|
|||
};
|
||||
|
||||
/* Create a matrix that will project the desired shadow. */
|
||||
void
|
||||
static void
|
||||
shadowMatrix(GLfloat shadowMat[4][4],
|
||||
GLfloat groundplane[4],
|
||||
GLfloat lightpos[4])
|
||||
|
|
@ -201,7 +201,7 @@ shadowMatrix(GLfloat shadowMat[4][4],
|
|||
}
|
||||
|
||||
/* Find the plane equation given 3 points. */
|
||||
void
|
||||
static void
|
||||
findPlane(GLfloat plane[4],
|
||||
GLfloat v0[3], GLfloat v1[3], GLfloat v2[3])
|
||||
{
|
||||
|
|
@ -224,7 +224,7 @@ findPlane(GLfloat plane[4],
|
|||
plane[D] = -(plane[A] * v0[X] + plane[B] * v0[Y] + plane[C] * v0[Z]);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
extrudeSolidFromPolygon(GLfloat data[][2], unsigned int dataSize,
|
||||
GLdouble thickness, GLuint side, GLuint edge, GLuint whole)
|
||||
{
|
||||
|
|
@ -382,7 +382,7 @@ static GLfloat floorShadow[4][4];
|
|||
static void
|
||||
redraw(void)
|
||||
{
|
||||
int start, end;
|
||||
int start = 0, end = 0;
|
||||
|
||||
if (reportSpeed) {
|
||||
start = glutGet(GLUT_ELAPSED_TIME);
|
||||
|
|
@ -624,6 +624,7 @@ redraw(void)
|
|||
glFinish();
|
||||
end = glutGet(GLUT_ELAPSED_TIME);
|
||||
printf("Speed %.3g frames/sec (%d ms)\n", 1000.0/(end-start), end-start);
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
glutSwapBuffers();
|
||||
|
|
@ -878,6 +879,7 @@ main(int argc, char **argv)
|
|||
polygonOffsetVersion = MISSING;
|
||||
printf("\ndinoshine: Missing polygon offset.\n");
|
||||
printf(" Expect shadow depth aliasing artifacts.\n\n");
|
||||
fflush(stdout);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -236,11 +236,28 @@ special(int k, int x, int y)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
cleanup(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
glDeleteTextures(1, &t1id);
|
||||
glDeleteTextures(1, &t2id);
|
||||
|
||||
glDeleteLists(skydlist, 1);
|
||||
for (i = 0; i < MAX_LOD; i++) {
|
||||
glDeleteLists(LODdlist[i], 1);
|
||||
glDeleteLists(LODnumpoly[i], 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
key(unsigned char k, int x, int y)
|
||||
{
|
||||
switch (k) {
|
||||
case 27:
|
||||
cleanup();
|
||||
exit(0);
|
||||
break;
|
||||
|
||||
|
|
@ -707,6 +724,7 @@ main(int ac, char **av)
|
|||
glutIdleFunc(draw);
|
||||
|
||||
glutMainLoop();
|
||||
cleanup();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,11 +20,7 @@
|
|||
#include <math.h>
|
||||
#include <GL/glew.h>
|
||||
#include <GL/glut.h>
|
||||
#if 0
|
||||
#include "texture.h"
|
||||
#else
|
||||
#include "../util/readtex.c"
|
||||
#endif
|
||||
#include "readtex.h"
|
||||
|
||||
|
||||
/* Some <math.h> files do not define M_PI... */
|
||||
|
|
@ -67,14 +63,15 @@ GLfloat zoomFactor = 1.0;
|
|||
/*****************************************************************/
|
||||
|
||||
|
||||
void ActiveTexture(int i)
|
||||
static void
|
||||
ActiveTexture(int i)
|
||||
{
|
||||
glActiveTextureARB(i);
|
||||
}
|
||||
|
||||
|
||||
/* matrix = identity */
|
||||
void
|
||||
static void
|
||||
matrixIdentity(GLfloat matrix[16])
|
||||
{
|
||||
matrix[0] = 1.0;
|
||||
|
|
@ -96,7 +93,7 @@ matrixIdentity(GLfloat matrix[16])
|
|||
}
|
||||
|
||||
/* matrix2 = transpose(matrix1) */
|
||||
void
|
||||
static void
|
||||
matrixTranspose(GLfloat matrix2[16], GLfloat matrix1[16])
|
||||
{
|
||||
matrix2[0] = matrix1[0];
|
||||
|
|
@ -167,7 +164,7 @@ imgLoad(char *filenameIn, int borderIn, GLfloat borderColorIn[4],
|
|||
/*****************************************************************/
|
||||
|
||||
/* Load the image file specified on the command line as the current texture */
|
||||
void
|
||||
static void
|
||||
loadImageTextures(void)
|
||||
{
|
||||
GLfloat borderColor[4] =
|
||||
|
|
@ -252,7 +249,7 @@ loadImageTextures(void)
|
|||
}
|
||||
|
||||
/* Create a simple spotlight pattern and make it the current texture */
|
||||
void
|
||||
static void
|
||||
loadSpotlightTexture(void)
|
||||
{
|
||||
static int texWidth = 64, texHeight = 64;
|
||||
|
|
@ -302,7 +299,7 @@ loadSpotlightTexture(void)
|
|||
|
||||
/*****************************************************************/
|
||||
|
||||
void
|
||||
static void
|
||||
checkErrors(void)
|
||||
{
|
||||
GLenum error;
|
||||
|
|
@ -311,7 +308,7 @@ checkErrors(void)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
drawCube(void)
|
||||
{
|
||||
glBegin(GL_QUADS);
|
||||
|
|
@ -360,7 +357,7 @@ drawCube(void)
|
|||
glEnd();
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
drawDodecahedron(void)
|
||||
{
|
||||
#define A (0.5 * 1.61803) /* (sqrt(5) + 1) / 2 */
|
||||
|
|
@ -446,7 +443,7 @@ drawDodecahedron(void)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
drawSphere(void)
|
||||
{
|
||||
int numMajor = 24;
|
||||
|
|
@ -573,7 +570,7 @@ drawTextureProjection(void)
|
|||
|
||||
/*****************************************************************/
|
||||
|
||||
void
|
||||
static void
|
||||
initialize(void)
|
||||
{
|
||||
GLfloat light0Pos[4] =
|
||||
|
|
@ -670,7 +667,7 @@ initialize(void)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
display(void)
|
||||
{
|
||||
int i;
|
||||
|
|
@ -755,10 +752,10 @@ display(void)
|
|||
/*****************************************************************/
|
||||
|
||||
/* simple trackball-like motion control */
|
||||
float lastPos[3];
|
||||
int lastTime;
|
||||
static float lastPos[3];
|
||||
static int lastTime;
|
||||
|
||||
void
|
||||
static void
|
||||
ptov(int x, int y, int width, int height, float v[3])
|
||||
{
|
||||
float d, a;
|
||||
|
|
@ -774,7 +771,7 @@ ptov(int x, int y, int width, int height, float v[3])
|
|||
v[2] *= a;
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
startMotion(int x, int y, int but, int time)
|
||||
{
|
||||
if (but == GLUT_LEFT_BUTTON) {
|
||||
|
|
@ -789,13 +786,13 @@ startMotion(int x, int y, int but, int time)
|
|||
ptov(x, y, winWidth, winHeight, lastPos);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
animate(void)
|
||||
{
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
vis(int visible)
|
||||
{
|
||||
if (visible == GLUT_VISIBLE) {
|
||||
|
|
@ -807,7 +804,7 @@ vis(int visible)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
stopMotion(int but, int time)
|
||||
{
|
||||
if ((but == GLUT_LEFT_BUTTON && mode == MoveView) ||
|
||||
|
|
@ -829,7 +826,7 @@ stopMotion(int but, int time)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
trackMotion(int x, int y)
|
||||
{
|
||||
float curPos[3], dx, dy, dz;
|
||||
|
|
@ -854,7 +851,7 @@ trackMotion(int x, int y)
|
|||
|
||||
/*****************************************************************/
|
||||
|
||||
void
|
||||
static void
|
||||
object(void)
|
||||
{
|
||||
static int object;
|
||||
|
|
@ -881,7 +878,7 @@ nop(void)
|
|||
{
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
texture(void)
|
||||
{
|
||||
static int texture = 0;
|
||||
|
|
@ -912,7 +909,7 @@ texture(void)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
help(void)
|
||||
{
|
||||
printf("'h' - help\n");
|
||||
|
|
@ -927,7 +924,7 @@ help(void)
|
|||
}
|
||||
|
||||
/* ARGSUSED1 */
|
||||
void
|
||||
static void
|
||||
key(unsigned char key, int x, int y)
|
||||
{
|
||||
switch (key) {
|
||||
|
|
@ -966,7 +963,7 @@ key(unsigned char key, int x, int y)
|
|||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
mouse(int button, int state, int x, int y)
|
||||
{
|
||||
if (state == GLUT_DOWN)
|
||||
|
|
@ -976,7 +973,7 @@ mouse(int button, int state, int x, int y)
|
|||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
reshape(int w, int h)
|
||||
{
|
||||
winWidth = w;
|
||||
|
|
@ -985,7 +982,7 @@ reshape(int w, int h)
|
|||
}
|
||||
|
||||
|
||||
void
|
||||
static void
|
||||
menu(int selection)
|
||||
{
|
||||
if (selection == 666) {
|
||||
|
|
@ -1005,6 +1002,7 @@ main(int argc, char **argv)
|
|||
assert(NumTextures <= MAX_TEX);
|
||||
|
||||
glutInitDisplayMode(GLUT_RGBA | GLUT_DEPTH | GLUT_DOUBLE);
|
||||
glutInitWindowSize(500,500);
|
||||
(void) glutCreateWindow("projtex");
|
||||
glewInit();
|
||||
|
||||
|
|
@ -17,6 +17,7 @@
|
|||
#define IMAGE_FILE "../images/girl.rgb"
|
||||
|
||||
static int ImgWidth, ImgHeight;
|
||||
static int WinWidth, WinHeight;
|
||||
static GLenum ImgFormat;
|
||||
static GLubyte *Image = NULL;
|
||||
|
||||
|
|
@ -27,6 +28,7 @@ static int CPosX, CPosY; /* copypixels */
|
|||
static GLboolean DrawFront = GL_FALSE;
|
||||
static GLboolean ScaleAndBias = GL_FALSE;
|
||||
static GLboolean Benchmark = GL_FALSE;
|
||||
static GLboolean Triangle = GL_FALSE;
|
||||
static GLubyte *TempImage = NULL;
|
||||
|
||||
#define COMBO 1
|
||||
|
|
@ -150,11 +152,60 @@ Display( void )
|
|||
/* draw original image */
|
||||
glRasterPos2i(APosX, 5);
|
||||
PrintString("Original");
|
||||
glRasterPos2i(APosX, APosY);
|
||||
glEnable(GL_DITHER);
|
||||
SetupPixelTransfer(GL_FALSE);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
glDrawPixels(ImgWidth, ImgHeight, ImgFormat, GL_UNSIGNED_BYTE, Image);
|
||||
if (!Triangle) {
|
||||
glRasterPos2i(APosX, APosY);
|
||||
glEnable(GL_DITHER);
|
||||
SetupPixelTransfer(GL_FALSE);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
glDrawPixels(ImgWidth, ImgHeight, ImgFormat, GL_UNSIGNED_BYTE, Image);
|
||||
}
|
||||
else {
|
||||
float z = 0;
|
||||
|
||||
glViewport(APosX, APosY, ImgWidth, ImgHeight);
|
||||
glMatrixMode( GL_PROJECTION );
|
||||
glLoadIdentity();
|
||||
glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0);
|
||||
glDisable(GL_CULL_FACE);
|
||||
|
||||
/* Red should never be seen
|
||||
*/
|
||||
glBegin(GL_POLYGON);
|
||||
glColor3f(1,0,0);
|
||||
glVertex3f(-2, -2, z);
|
||||
glVertex3f(-2, 2, z);
|
||||
glVertex3f(2, 2, z);
|
||||
glVertex3f(2, -2, z);
|
||||
glEnd();
|
||||
|
||||
/* Blue background
|
||||
*/
|
||||
glBegin(GL_POLYGON);
|
||||
glColor3f(.5,.5,1);
|
||||
glVertex3f(-1, -1, z);
|
||||
glVertex3f(-1, 1, z);
|
||||
glVertex3f(1, 1, z);
|
||||
glVertex3f(1, -1, z);
|
||||
glEnd();
|
||||
|
||||
/* Triangle
|
||||
*/
|
||||
glBegin(GL_TRIANGLES);
|
||||
glColor3f(.8,0,0);
|
||||
glVertex3f(-0.9, -0.9, z);
|
||||
glColor3f(0,.9,0);
|
||||
glVertex3f( 0.9, -0.9, z);
|
||||
glColor3f(0,0,.7);
|
||||
glVertex3f( 0.0, 0.9, z);
|
||||
glEnd();
|
||||
|
||||
glColor3f(1,1,1);
|
||||
|
||||
glViewport( 0, 0, WinWidth, WinHeight );
|
||||
glMatrixMode( GL_PROJECTION );
|
||||
glLoadIdentity();
|
||||
glOrtho( 0.0, WinWidth, 0.0, WinHeight, -1.0, 1.0 );
|
||||
}
|
||||
|
||||
/* might try alignment=4 here for testing */
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
|
|
@ -218,6 +269,9 @@ Display( void )
|
|||
static void
|
||||
Reshape( int width, int height )
|
||||
{
|
||||
WinWidth = width;
|
||||
WinHeight = height;
|
||||
|
||||
glViewport( 0, 0, width, height );
|
||||
glMatrixMode( GL_PROJECTION );
|
||||
glLoadIdentity();
|
||||
|
|
@ -236,6 +290,9 @@ Key( unsigned char key, int x, int y )
|
|||
case 'b':
|
||||
Benchmark = GL_TRUE;
|
||||
break;
|
||||
case 't':
|
||||
Triangle = !Triangle;
|
||||
break;
|
||||
case 's':
|
||||
ScaleAndBias = !ScaleAndBias;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -788,6 +788,7 @@ Key(unsigned char key, int x, int y)
|
|||
exit(0);
|
||||
break;
|
||||
}
|
||||
fflush(stdout);
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
|
@ -1014,6 +1015,7 @@ PrintHelp(void)
|
|||
printf(" <shift> + cursor keys = rotate light source\n");
|
||||
if (HaveEXTshadowFuncs)
|
||||
printf(" o = cycle through comparison modes\n");
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -173,10 +173,20 @@ static void special(int k, int x, int y)
|
|||
}
|
||||
}
|
||||
|
||||
static void cleanup(void)
|
||||
{
|
||||
glDeleteTextures(1, &t1id);
|
||||
glDeleteTextures(1, &t2id);
|
||||
glDeleteLists(teapotdlist, 1);
|
||||
glDeleteLists(basedlist, 1);
|
||||
glDeleteLists(lightdlist, 1);
|
||||
}
|
||||
|
||||
static void key(unsigned char k, int x, int y)
|
||||
{
|
||||
switch(k) {
|
||||
case 27:
|
||||
cleanup();
|
||||
exit(0);
|
||||
break;
|
||||
|
||||
|
|
@ -670,6 +680,7 @@ int main(int ac, char **av)
|
|||
glutIdleFunc(draw);
|
||||
|
||||
glutMainLoop();
|
||||
cleanup();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -202,11 +202,19 @@ special(int k, int x, int y)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
cleanup(void)
|
||||
{
|
||||
glDeleteTextures(1, &t1id);
|
||||
glDeleteTextures(1, &t2id);
|
||||
}
|
||||
|
||||
static void
|
||||
key(unsigned char k, int x, int y)
|
||||
{
|
||||
switch (k) {
|
||||
case 27:
|
||||
cleanup();
|
||||
exit(0);
|
||||
break;
|
||||
|
||||
|
|
@ -531,5 +539,6 @@ main(int ac, char **av)
|
|||
|
||||
glutMainLoop();
|
||||
|
||||
cleanup();
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -200,6 +200,13 @@ special(int k, int x, int y)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
cleanup(void)
|
||||
{
|
||||
glDeleteTextures(1, &t1id);
|
||||
glDeleteTextures(1, &t2id);
|
||||
}
|
||||
|
||||
static void
|
||||
key(unsigned char k, int x, int y)
|
||||
{
|
||||
|
|
@ -207,6 +214,7 @@ key(unsigned char k, int x, int y)
|
|||
case 27:
|
||||
glutDestroyWindow(channel[0]);
|
||||
glutDestroyWindow(channel[1]);
|
||||
cleanup();
|
||||
exit(0);
|
||||
break;
|
||||
|
||||
|
|
@ -602,6 +610,7 @@ main(int ac, char **av)
|
|||
calcposobs();
|
||||
|
||||
glutMainLoop();
|
||||
cleanup();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -260,6 +260,8 @@ static void Key( unsigned char key, int x, int y )
|
|||
(void) y;
|
||||
switch (key) {
|
||||
case 27:
|
||||
(*delete_vertex_arrays)( 1, & cube_array_obj );
|
||||
(*delete_vertex_arrays)( 1, & oct_array_obj );
|
||||
glutDestroyWindow(Win);
|
||||
exit(0);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,20 @@ env.Prepend(CPPPATH = [
|
|||
|
||||
env.Prepend(LIBS = ['$GLUT_LIB'])
|
||||
|
||||
env.Program(
|
||||
target = 'fp-tri',
|
||||
source = ['fp-tri.c'],
|
||||
progs = [
|
||||
'fp-tri',
|
||||
'tri-depth',
|
||||
'tri-depth2',
|
||||
'tri-depthwrite',
|
||||
'tri-depthwrite2',
|
||||
'tri-inv',
|
||||
'tri-param',
|
||||
'tri-tex',
|
||||
'point-position',
|
||||
]
|
||||
|
||||
for prog in progs:
|
||||
env.Program(
|
||||
target = prog,
|
||||
source = [prog + '.c'],
|
||||
)
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ static void Init( void )
|
|||
}
|
||||
fprintf(stderr, "%.*s\n", sz, buf);
|
||||
|
||||
if (!glutExtensionSupported("GL_ARB_fragment_program")) {
|
||||
if (!GLEW_ARB_fragment_program) {
|
||||
printf("Error: GL_ARB_fragment_program not supported!\n");
|
||||
exit(1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,9 +2,8 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
#include <GL/glew.h>
|
||||
#include <GL/glut.h>
|
||||
#include "GL/gl.h"
|
||||
|
||||
|
||||
|
||||
|
|
@ -17,7 +16,7 @@ static void Init( void )
|
|||
;
|
||||
GLuint modulateProg;
|
||||
|
||||
if (!glutExtensionSupported("GL_ARB_fragment_program")) {
|
||||
if (!GLEW_ARB_fragment_program) {
|
||||
printf("Error: GL_ARB_fragment_program not supported!\n");
|
||||
exit(1);
|
||||
}
|
||||
|
|
@ -109,6 +108,8 @@ int main(int argc, char **argv)
|
|||
exit(1);
|
||||
}
|
||||
|
||||
glewInit();
|
||||
|
||||
Init();
|
||||
|
||||
glutReshapeFunc(Reshape);
|
||||
|
|
|
|||
5
progs/fp/swz3.txt
Normal file
5
progs/fp/swz3.txt
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
!!ARBfp1.0
|
||||
TEMP R0, R1;
|
||||
MOV R0, -fragment.color;
|
||||
SWZ result.color, R0, -y, -x, z, 1;
|
||||
END
|
||||
|
|
@ -2,9 +2,8 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
#include <GL/glew.h>
|
||||
#include <GL/glut.h>
|
||||
#include "GL/gl.h"
|
||||
|
||||
|
||||
|
||||
|
|
@ -19,7 +18,7 @@ static void Init( void )
|
|||
;
|
||||
GLuint modulateProg;
|
||||
|
||||
if (!glutExtensionSupported("GL_ARB_fragment_program")) {
|
||||
if (!GLEW_ARB_fragment_program) {
|
||||
printf("Error: GL_ARB_fragment_program not supported!\n");
|
||||
exit(1);
|
||||
}
|
||||
|
|
@ -89,8 +88,6 @@ int main(int argc, char **argv)
|
|||
|
||||
glutInit(&argc, argv);
|
||||
|
||||
|
||||
|
||||
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
|
||||
|
||||
type = GLUT_RGB;
|
||||
|
|
@ -101,6 +98,8 @@ int main(int argc, char **argv)
|
|||
exit(1);
|
||||
}
|
||||
|
||||
glewInit();
|
||||
|
||||
Init();
|
||||
|
||||
glutReshapeFunc(Reshape);
|
||||
|
|
|
|||
|
|
@ -2,9 +2,8 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
#include <GL/glew.h>
|
||||
#include <GL/glut.h>
|
||||
#include "GL/gl.h"
|
||||
|
||||
|
||||
|
||||
|
|
@ -21,7 +20,7 @@ static void Init( void )
|
|||
;
|
||||
GLuint modulateProg;
|
||||
|
||||
if (!glutExtensionSupported("GL_ARB_fragment_program")) {
|
||||
if (!GLEW_ARB_fragment_program) {
|
||||
printf("Error: GL_ARB_fragment_program not supported!\n");
|
||||
exit(1);
|
||||
}
|
||||
|
|
@ -106,6 +105,8 @@ int main(int argc, char **argv)
|
|||
exit(1);
|
||||
}
|
||||
|
||||
glewInit();
|
||||
|
||||
Init();
|
||||
|
||||
glutReshapeFunc(Reshape);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
#include <GL/glew.h>
|
||||
#include <GL/glut.h>
|
||||
|
||||
|
||||
|
|
@ -16,7 +16,7 @@ static void Init(void)
|
|||
;
|
||||
GLuint modulateProg;
|
||||
|
||||
if (!glutExtensionSupported("GL_ARB_fragment_program")) {
|
||||
if (!GLEW_ARB_fragment_program) {
|
||||
printf("Error: GL_ARB_fragment_program not supported!\n");
|
||||
exit(1);
|
||||
}
|
||||
|
|
@ -97,6 +97,8 @@ int main(int argc, char **argv)
|
|||
exit(1);
|
||||
}
|
||||
|
||||
glewInit();
|
||||
|
||||
Init();
|
||||
|
||||
glutReshapeFunc(Reshape);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
#include <GL/glew.h>
|
||||
#include <GL/glut.h>
|
||||
|
||||
|
||||
|
|
@ -16,7 +16,7 @@ static void Init(void)
|
|||
;
|
||||
GLuint modulateProg;
|
||||
|
||||
if (!glutExtensionSupported("GL_ARB_fragment_program")) {
|
||||
if (!GLEW_ARB_fragment_program) {
|
||||
printf("Error: GL_ARB_fragment_program not supported!\n");
|
||||
exit(1);
|
||||
}
|
||||
|
|
@ -97,6 +97,8 @@ int main(int argc, char **argv)
|
|||
exit(1);
|
||||
}
|
||||
|
||||
glewInit();
|
||||
|
||||
Init();
|
||||
|
||||
glutReshapeFunc(Reshape);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
#include <GL/glew.h>
|
||||
#include <GL/glut.h>
|
||||
|
||||
|
||||
|
|
@ -17,7 +17,7 @@ static void Init( void )
|
|||
;
|
||||
GLuint modulateProg;
|
||||
|
||||
if (!glutExtensionSupported("GL_ARB_fragment_program")) {
|
||||
if (!GLEW_ARB_fragment_program) {
|
||||
printf("Error: GL_ARB_fragment_program not supported!\n");
|
||||
exit(1);
|
||||
}
|
||||
|
|
@ -99,6 +99,8 @@ int main(int argc, char **argv)
|
|||
exit(1);
|
||||
}
|
||||
|
||||
glewInit();
|
||||
|
||||
Init();
|
||||
|
||||
glutReshapeFunc(Reshape);
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
#include <GL/glew.h>
|
||||
#include <GL/glut.h>
|
||||
#include "GL/gl.h"
|
||||
|
||||
|
||||
static void Init( void )
|
||||
{
|
||||
|
|
@ -15,7 +15,7 @@ static void Init( void )
|
|||
;
|
||||
GLuint modulateProg;
|
||||
|
||||
if (!glutExtensionSupported("GL_ARB_fragment_program")) {
|
||||
if (!GLEW_ARB_fragment_program) {
|
||||
printf("Error: GL_ARB_fragment_program not supported!\n");
|
||||
exit(1);
|
||||
}
|
||||
|
|
@ -104,6 +104,8 @@ int main(int argc, char **argv)
|
|||
exit(1);
|
||||
}
|
||||
|
||||
glewInit();
|
||||
|
||||
Init();
|
||||
|
||||
glutReshapeFunc(Reshape);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
#include <GL/glew.h>
|
||||
#include <GL/glut.h>
|
||||
|
||||
#include "readtex.c"
|
||||
|
|
@ -23,7 +23,7 @@ static void Init( void )
|
|||
GLuint modulateProg;
|
||||
GLuint Texture;
|
||||
|
||||
if (!glutExtensionSupported("GL_ARB_fragment_program")) {
|
||||
if (!GLEW_ARB_fragment_program) {
|
||||
printf("Error: GL_ARB_fragment_program not supported!\n");
|
||||
exit(1);
|
||||
}
|
||||
|
|
@ -120,6 +120,8 @@ int main(int argc, char **argv)
|
|||
exit(1);
|
||||
}
|
||||
|
||||
glewInit();
|
||||
|
||||
Init();
|
||||
|
||||
glutReshapeFunc(Reshape);
|
||||
|
|
|
|||
3
progs/glsl/.gitignore
vendored
3
progs/glsl/.gitignore
vendored
|
|
@ -1,3 +1,4 @@
|
|||
array
|
||||
bitmap
|
||||
brick
|
||||
bump
|
||||
|
|
@ -11,6 +12,7 @@ mandelbrot
|
|||
multinoise
|
||||
multitex
|
||||
noise
|
||||
noise2
|
||||
pointcoord
|
||||
points
|
||||
readtex.c
|
||||
|
|
@ -21,6 +23,7 @@ shaderutil.c
|
|||
shaderutil.h
|
||||
shadow_sampler
|
||||
skinning
|
||||
texaaline
|
||||
texdemo1
|
||||
toyball
|
||||
trirast
|
||||
|
|
|
|||
|
|
@ -5,46 +5,69 @@ include $(TOP)/configs/current
|
|||
|
||||
INCDIR = $(TOP)/include
|
||||
|
||||
LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME)
|
||||
LIB_DEP = \
|
||||
$(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) \
|
||||
$(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME) \
|
||||
$(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME)
|
||||
|
||||
LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS)
|
||||
|
||||
PROGS = \
|
||||
bitmap \
|
||||
brick \
|
||||
bump \
|
||||
convolutions \
|
||||
deriv \
|
||||
identity \
|
||||
fragcoord \
|
||||
linktest \
|
||||
mandelbrot \
|
||||
multinoise \
|
||||
multitex \
|
||||
noise \
|
||||
points \
|
||||
pointcoord \
|
||||
samplers \
|
||||
samplers_array \
|
||||
shadow_sampler \
|
||||
skinning \
|
||||
texdemo1 \
|
||||
toyball \
|
||||
twoside \
|
||||
trirast \
|
||||
vert-or-frag-only \
|
||||
vert-tex
|
||||
INCLUDE_DIRS = -I$(TOP)/progs/util
|
||||
|
||||
DEMO_SOURCES = \
|
||||
array.c \
|
||||
bitmap.c \
|
||||
brick.c \
|
||||
bump.c \
|
||||
convolutions.c \
|
||||
deriv.c \
|
||||
fragcoord.c \
|
||||
identity.c \
|
||||
linktest.c \
|
||||
mandelbrot.c \
|
||||
multinoise.c \
|
||||
multitex.c \
|
||||
noise.c \
|
||||
noise2.c \
|
||||
pointcoord.c \
|
||||
points.c \
|
||||
samplers.c \
|
||||
shadow_sampler.c \
|
||||
skinning.c \
|
||||
texaaline.c \
|
||||
texdemo1.c \
|
||||
toyball.c \
|
||||
trirast.c \
|
||||
twoside.c \
|
||||
vert-or-frag-only.c \
|
||||
vert-tex.c
|
||||
|
||||
UTIL_HEADERS = \
|
||||
extfuncs.h \
|
||||
shaderutil.h \
|
||||
readtex.h
|
||||
|
||||
UTIL_SOURCES = \
|
||||
shaderutil.c \
|
||||
readtex.c
|
||||
|
||||
UTIL_OBJS = $(UTIL_SOURCES:.c=.o)
|
||||
|
||||
|
||||
PROGS = $(DEMO_SOURCES:%.c=%)
|
||||
|
||||
|
||||
|
||||
##### RULES #####
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c
|
||||
# make .o file from .c file:
|
||||
.c.o:
|
||||
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) $< -o $@
|
||||
|
||||
|
||||
# make executable from .c file:
|
||||
.c: $(LIB_DEP)
|
||||
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@
|
||||
# make executable from .o files
|
||||
.o:
|
||||
$(APP_CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $< $(UTIL_OBJS) $(LIBS) -o $@
|
||||
|
||||
|
||||
##### TARGETS #####
|
||||
|
|
@ -52,188 +75,164 @@ PROGS = \
|
|||
default: $(PROGS)
|
||||
|
||||
|
||||
clean:
|
||||
-rm -f $(PROGS)
|
||||
-rm -f *.o *~
|
||||
-rm -f extfuncs.h
|
||||
-rm -f shaderutil.*
|
||||
-rm -f readtex.*
|
||||
|
||||
|
||||
|
||||
##### Extra dependencies
|
||||
|
||||
extfuncs.h: $(TOP)/progs/util/extfuncs.h
|
||||
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
|
||||
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) readtex.c
|
||||
|
||||
|
||||
shaderutil.c: $(TOP)/progs/util/shaderutil.c
|
||||
cp $< .
|
||||
|
||||
shaderutil.h: $(TOP)/progs/util/shaderutil.h
|
||||
cp $< .
|
||||
|
||||
shaderutil.o: shaderutil.c shaderutil.h
|
||||
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) shaderutil.c
|
||||
|
||||
|
||||
array.o: $(UTIL_HEADERS)
|
||||
|
||||
bitmap.o: bitmap.c extfuncs.h shaderutil.h
|
||||
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) bitmap.c
|
||||
array: array.o $(UTIL_OBJS)
|
||||
|
||||
bitmap: bitmap.o shaderutil.o
|
||||
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) bitmap.o shaderutil.o $(LIBS) -o $@
|
||||
|
||||
bitmap.o: $(UTIL_HEADERS)
|
||||
|
||||
brick.o: brick.c extfuncs.h shaderutil.h
|
||||
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) brick.c
|
||||
bitmap: bitmap.o $(UTIL_OBJS)
|
||||
|
||||
brick: brick.o shaderutil.o
|
||||
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) brick.o shaderutil.o $(LIBS) -o $@
|
||||
|
||||
brick.o: $(UTIL_HEADERS)
|
||||
|
||||
bump.o: bump.c extfuncs.h shaderutil.h
|
||||
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) bump.c
|
||||
brick: brick.o $(UTIL_OBJS)
|
||||
|
||||
bump: bump.o shaderutil.o
|
||||
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) bump.o shaderutil.o $(LIBS) -o $@
|
||||
|
||||
bump.o: $(UTIL_HEADERS)
|
||||
|
||||
convolutions.o: convolutions.c readtex.h
|
||||
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) convolutions.c
|
||||
bump: bump.o $(UTIL_OBJS)
|
||||
|
||||
convolutions: convolutions.o readtex.o
|
||||
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) convolutions.o readtex.o $(LIBS) -o $@
|
||||
|
||||
convolutions.o: $(UTIL_HEADERS)
|
||||
|
||||
deriv.o: deriv.c extfuncs.h shaderutil.h
|
||||
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) deriv.c
|
||||
convolutions: convolutions.o $(UTIL_OBJS)
|
||||
|
||||
deriv: deriv.o shaderutil.o
|
||||
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) deriv.o shaderutil.o $(LIBS) -o $@
|
||||
|
||||
deriv.o: deriv.c $(UTIL_HEADERS)
|
||||
|
||||
identity.o: identity.c extfuncs.h shaderutil.h
|
||||
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) identity.c
|
||||
deriv: deriv.o $(UTIL_OBJS)
|
||||
|
||||
identity: identity.o shaderutil.o
|
||||
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) identity.o shaderutil.o $(LIBS) -o $@
|
||||
|
||||
identity.o: $(UTIL_HEADERS)
|
||||
|
||||
fragcoord.o: fragcoord.c extfuncs.h shaderutil.h
|
||||
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) fragcoord.c
|
||||
identity: identity.o $(UTIL_OBJS)
|
||||
|
||||
fragcoord: fragcoord.o shaderutil.o
|
||||
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) fragcoord.o shaderutil.o $(LIBS) -o $@
|
||||
|
||||
fragcoord.o: $(UTIL_HEADERS)
|
||||
|
||||
linktest.o: linktest.c extfuncs.h shaderutil.h
|
||||
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) linktest.c
|
||||
fragcoord: fragcoord.o $(UTIL_OBJS)
|
||||
|
||||
linktest: linktest.o shaderutil.o
|
||||
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) linktest.o shaderutil.o $(LIBS) -o $@
|
||||
|
||||
mandelbrot.o: mandelbrot.c extfuncs.h shaderutil.h
|
||||
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) mandelbrot.c
|
||||
linktest.o: $(UTIL_HEADERS)
|
||||
|
||||
mandelbrot: mandelbrot.o shaderutil.o
|
||||
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) mandelbrot.o shaderutil.o $(LIBS) -o $@
|
||||
linktest: linktest.o $(UTIL_OBJS)
|
||||
|
||||
multitex.o: multitex.c extfuncs.h readtex.h shaderutil.h
|
||||
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) multitex.c
|
||||
|
||||
multitex: multitex.o readtex.o shaderutil.o
|
||||
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) multitex.o readtex.o shaderutil.o $(LIBS) -o $@
|
||||
mandelbrot.o: $(UTIL_HEADERS)
|
||||
|
||||
mandelbrot: mandelbrot.o $(UTIL_OBJS)
|
||||
|
||||
noise.o: noise.c extfuncs.h shaderutil.h
|
||||
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) noise.c
|
||||
|
||||
noise: noise.o shaderutil.o
|
||||
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) noise.o shaderutil.o $(LIBS) -o $@
|
||||
multinoise.o: $(UTIL_HEADERS)
|
||||
|
||||
multinoise: multinoise.o $(UTIL_OBJS)
|
||||
|
||||
points.o: points.c extfuncs.h shaderutil.h
|
||||
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) points.c
|
||||
|
||||
points: points.o shaderutil.o
|
||||
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) points.o shaderutil.o $(LIBS) -o $@
|
||||
multitex.o: $(UTIL_HEADERS)
|
||||
|
||||
multitex: multitex.o $(UTIL_OBJS)
|
||||
|
||||
pointcoord.o: pointcoord.c readtex.h extfuncs.h shaderutil.h
|
||||
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) pointcoord.c
|
||||
|
||||
pointcoord: pointcoord.o readtex.o shaderutil.o
|
||||
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) pointcoord.o readtex.o shaderutil.o $(LIBS) -o $@
|
||||
noise.o: $(UTIL_HEADERS)
|
||||
|
||||
noise: noise.o $(UTIL_OBJS)
|
||||
|
||||
samplers.o: samplers.c readtex.h extfuncs.h shaderutil.h
|
||||
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) samplers.c
|
||||
|
||||
samplers: samplers.o readtex.o shaderutil.o
|
||||
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) samplers.o readtex.o shaderutil.o $(LIBS) -o $@
|
||||
noise2.o: $(UTIL_HEADERS)
|
||||
|
||||
samplers_array.o: samplers.c readtex.h extfuncs.h shaderutil.h
|
||||
$(APP_CC) -c -DSAMPLERS_ARRAY -I$(INCDIR) $(CFLAGS) samplers.c -o samplers_array.o
|
||||
noise2: noise2.o $(UTIL_OBJS)
|
||||
|
||||
samplers_array: samplers_array.o readtex.o shaderutil.o
|
||||
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) samplers_array.o readtex.o shaderutil.o $(LIBS) -o $@
|
||||
|
||||
skinning.o: skinning.c readtex.h extfuncs.h shaderutil.h
|
||||
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) skinning.c
|
||||
points.o: $(UTIL_HEADERS)
|
||||
|
||||
skinning: skinning.o readtex.o shaderutil.o
|
||||
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) skinning.o readtex.o shaderutil.o $(LIBS) -o $@
|
||||
points: points.o $(UTIL_OBJS)
|
||||
|
||||
|
||||
texdemo1.o: texdemo1.c readtex.h extfuncs.h shaderutil.h
|
||||
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) texdemo1.c
|
||||
pointcoord.o: $(UTIL_HEADERS)
|
||||
|
||||
texdemo1: texdemo1.o readtex.o shaderutil.o
|
||||
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) texdemo1.o readtex.o shaderutil.o $(LIBS) -o $@
|
||||
pointcoord: pointcoord.o $(UTIL_OBJS)
|
||||
|
||||
|
||||
toyball.o: toyball.c extfuncs.h shaderutil.h
|
||||
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) toyball.c
|
||||
samplers.o: $(UTIL_HEADERS)
|
||||
|
||||
toyball: toyball.o shaderutil.o
|
||||
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) toyball.o shaderutil.o $(LIBS) -o $@
|
||||
samplers: samplers.o $(UTIL_OBJS)
|
||||
|
||||
|
||||
twoside.o: twoside.c extfuncs.h shaderutil.h
|
||||
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) twoside.c
|
||||
samplers_array.o: $(UTIL_HEADERS)
|
||||
|
||||
twoside: twoside.o shaderutil.o
|
||||
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) twoside.o shaderutil.o $(LIBS) -o $@
|
||||
samplers_array: samplers_array.o $(UTIL_OBJS)
|
||||
|
||||
|
||||
trirast.o: trirast.c extfuncs.h shaderutil.h
|
||||
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) trirast.c
|
||||
shadow_sampler.o: $(UTIL_HEADERS)
|
||||
|
||||
trirast: trirast.o shaderutil.o
|
||||
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) trirast.o shaderutil.o $(LIBS) -o $@
|
||||
shadow_sampler: shadow_sampler.o $(UTIL_OBJS)
|
||||
|
||||
|
||||
vert-or-frag-only.o: vert-or-frag-only.c extfuncs.h shaderutil.h
|
||||
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) vert-or-frag-only.c
|
||||
skinning.o: $(UTIL_HEADERS)
|
||||
|
||||
vert-or-frag-only: vert-or-frag-only.o shaderutil.o
|
||||
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) vert-or-frag-only.o shaderutil.o $(LIBS) -o $@
|
||||
skinning: skinning.o $(UTIL_OBJS)
|
||||
|
||||
|
||||
vert-tex.o: vert-tex.c extfuncs.h shaderutil.h
|
||||
$(APP_CC) -c -I$(INCDIR) $(CFLAGS) vert-tex.c
|
||||
texaaline.o: $(UTIL_HEADERS)
|
||||
|
||||
vert-tex: vert-tex.o shaderutil.o
|
||||
$(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) vert-tex.o shaderutil.o $(LIBS) -o $@
|
||||
texaaline: texaaline.o $(UTIL_OBJS)
|
||||
|
||||
|
||||
texdemo1.o: $(UTIL_HEADERS)
|
||||
|
||||
texdemo1: texdemo1.o $(UTIL_OBJS)
|
||||
|
||||
clean:
|
||||
-rm -f $(PROGS)
|
||||
-rm -f *.o *~
|
||||
-rm -f extfuncs.h
|
||||
-rm -f shaderutil.*
|
||||
|
||||
toyball.o: $(UTIL_HEADERS)
|
||||
|
||||
toyball: toyball.o $(UTIL_OBJS)
|
||||
|
||||
|
||||
twoside.o: $(UTIL_HEADERS)
|
||||
|
||||
twoside: twoside.o $(UTIL_OBJS)
|
||||
|
||||
|
||||
trirast.o: $(UTIL_HEADERS)
|
||||
|
||||
trirast: trirast.o $(UTIL_OBJS)
|
||||
|
||||
|
||||
vert-or-frag-only.o: $(UTIL_HEADERS)
|
||||
|
||||
vert-or-frag-only: vert-or-frag-only.o $(UTIL_OBJS)
|
||||
|
||||
|
||||
vert-tex.o: $(UTIL_HEADERS)
|
||||
|
||||
vert-tex: vert-tex.o $(UTIL_OBJS)
|
||||
|
|
|
|||
261
progs/glsl/array.c
Normal file
261
progs/glsl/array.c
Normal file
|
|
@ -0,0 +1,261 @@
|
|||
/**
|
||||
* Test variable array indexing in a vertex shader.
|
||||
* Brian Paul
|
||||
* 17 April 2009
|
||||
*/
|
||||
|
||||
#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"
|
||||
#include "shaderutil.h"
|
||||
|
||||
|
||||
/**
|
||||
* The vertex position.z is used as a (variable) index into an
|
||||
* array which returns a new Z value.
|
||||
*/
|
||||
static const char *VertShaderText =
|
||||
"uniform sampler2D tex1; \n"
|
||||
"uniform float HeightArray[20]; \n"
|
||||
"void main() \n"
|
||||
"{ \n"
|
||||
" vec4 pos = gl_Vertex; \n"
|
||||
" int i = int(pos.z * 9.5); \n"
|
||||
" pos.z = HeightArray[i]; \n"
|
||||
" gl_Position = gl_ModelViewProjectionMatrix * pos; \n"
|
||||
" gl_FrontColor = pos; \n"
|
||||
"} \n";
|
||||
|
||||
static const char *FragShaderText =
|
||||
"void main() \n"
|
||||
"{ \n"
|
||||
" gl_FragColor = gl_Color; \n"
|
||||
"} \n";
|
||||
|
||||
|
||||
static GLuint fragShader;
|
||||
static GLuint vertShader;
|
||||
static GLuint program;
|
||||
|
||||
static GLint win = 0;
|
||||
static GLboolean Anim = GL_TRUE;
|
||||
static GLboolean WireFrame = GL_TRUE;
|
||||
static GLfloat xRot = -70.0f, yRot = 0.0f, zRot = 0.0f;
|
||||
|
||||
|
||||
static void
|
||||
Idle(void)
|
||||
{
|
||||
zRot = 90 + glutGet(GLUT_ELAPSED_TIME) * 0.05;
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
/** z=f(x,y) */
|
||||
static float
|
||||
fz(float x, float y)
|
||||
{
|
||||
return fabs(cos(1.5*x) + cos(1.5*y));
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
DrawMesh(void)
|
||||
{
|
||||
GLfloat xmin = -2.0, xmax = 2.0;
|
||||
GLfloat ymin = -2.0, ymax = 2.0;
|
||||
GLuint xdivs = 20, ydivs = 20;
|
||||
GLfloat dx = (xmax - xmin) / xdivs;
|
||||
GLfloat dy = (ymax - ymin) / ydivs;
|
||||
GLfloat ds = 1.0 / xdivs, dt = 1.0 / ydivs;
|
||||
GLfloat x, y, s, t;
|
||||
GLuint i, j;
|
||||
|
||||
y = ymin;
|
||||
t = 0.0;
|
||||
for (i = 0; i < ydivs; i++) {
|
||||
x = xmin;
|
||||
s = 0.0;
|
||||
glBegin(GL_QUAD_STRIP);
|
||||
for (j = 0; j < xdivs; j++) {
|
||||
float z0 = fz(x, y), z1 = fz(x, y + dy);
|
||||
|
||||
glTexCoord2f(s, t);
|
||||
glVertex3f(x, y, z0);
|
||||
|
||||
glTexCoord2f(s, t + dt);
|
||||
glVertex3f(x, y + dy, z1);
|
||||
x += dx;
|
||||
s += ds;
|
||||
}
|
||||
glEnd();
|
||||
y += dy;
|
||||
t += dt;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Redisplay(void)
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
if (WireFrame)
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
|
||||
else
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
|
||||
|
||||
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);
|
||||
|
||||
glPushMatrix();
|
||||
DrawMesh();
|
||||
glPopMatrix();
|
||||
|
||||
glPopMatrix();
|
||||
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
|
||||
|
||||
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 'w':
|
||||
WireFrame = !WireFrame;
|
||||
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
|
||||
Init(void)
|
||||
{
|
||||
GLfloat HeightArray[20];
|
||||
GLint u, i;
|
||||
|
||||
if (!ShadersSupported())
|
||||
exit(1);
|
||||
|
||||
GetExtensionFuncs();
|
||||
|
||||
vertShader = CompileShaderText(GL_VERTEX_SHADER, VertShaderText);
|
||||
fragShader = CompileShaderText(GL_FRAGMENT_SHADER, FragShaderText);
|
||||
program = LinkShaders(vertShader, fragShader);
|
||||
|
||||
glUseProgram_func(program);
|
||||
|
||||
/* Setup the HeightArray[] uniform */
|
||||
for (i = 0; i < 20; i++)
|
||||
HeightArray[i] = i / 20.0;
|
||||
u = glGetUniformLocation_func(program, "HeightArray");
|
||||
glUniform1fv_func(u, 20, HeightArray);
|
||||
|
||||
assert(glGetError() == 0);
|
||||
|
||||
glClearColor(0.4f, 0.4f, 0.8f, 0.0f);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glColor3f(1, 1, 1);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
glutInit(&argc, argv);
|
||||
glutInitWindowSize(500, 500);
|
||||
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
|
||||
win = glutCreateWindow(argv[0]);
|
||||
glutReshapeFunc(Reshape);
|
||||
glutKeyboardFunc(Key);
|
||||
glutSpecialFunc(SpecialKey);
|
||||
glutDisplayFunc(Redisplay);
|
||||
Init();
|
||||
if (Anim)
|
||||
glutIdleFunc(Idle);
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -150,10 +150,11 @@ Redisplay(void)
|
|||
static void
|
||||
Reshape(int width, int height)
|
||||
{
|
||||
float ar = (float) width / (float) height;
|
||||
glViewport(0, 0, width, height);
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0, 25.0);
|
||||
glFrustum(-ar, ar, -1.0, 1.0, 5.0, 25.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
glTranslatef(0.0f, 0.0f, -15.0f);
|
||||
|
|
|
|||
|
|
@ -242,7 +242,7 @@ int
|
|||
main(int argc, char *argv[])
|
||||
{
|
||||
glutInit(&argc, argv);
|
||||
glutInitWindowPosition( 0, 0);
|
||||
glutInitWindowSize(300, 300);
|
||||
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
|
||||
Win = glutCreateWindow(argv[0]);
|
||||
glutReshapeFunc(Reshape);
|
||||
|
|
|
|||
|
|
@ -51,6 +51,8 @@ static GLfloat Xrot = 0.0, Yrot = .0, Zrot = 0.0;
|
|||
static GLfloat EyeDist = 10;
|
||||
static GLboolean Anim = GL_TRUE;
|
||||
static GLboolean UseArrays = GL_TRUE;
|
||||
static GLboolean UseVBO = GL_TRUE;
|
||||
static GLuint VBO = 0;
|
||||
|
||||
static GLint VertCoord_attr = -1, TexCoord0_attr = -1, TexCoord1_attr = -1;
|
||||
|
||||
|
|
@ -76,28 +78,81 @@ static const GLfloat VertCoords[4][2] = {
|
|||
};
|
||||
|
||||
|
||||
|
||||
static void
|
||||
SetupVertexBuffer(void)
|
||||
{
|
||||
glGenBuffersARB_func(1, &VBO);
|
||||
glBindBufferARB_func(GL_ARRAY_BUFFER_ARB, VBO);
|
||||
|
||||
glBufferDataARB_func(GL_ARRAY_BUFFER_ARB,
|
||||
sizeof(VertCoords) +
|
||||
sizeof(Tex0Coords) +
|
||||
sizeof(Tex1Coords),
|
||||
NULL,
|
||||
GL_STATIC_DRAW_ARB);
|
||||
|
||||
/* non-interleaved vertex arrays */
|
||||
|
||||
glBufferSubDataARB_func(GL_ARRAY_BUFFER_ARB,
|
||||
0, /* offset */
|
||||
sizeof(VertCoords), /* size */
|
||||
VertCoords); /* data */
|
||||
|
||||
glBufferSubDataARB_func(GL_ARRAY_BUFFER_ARB,
|
||||
sizeof(VertCoords), /* offset */
|
||||
sizeof(Tex0Coords), /* size */
|
||||
Tex0Coords); /* data */
|
||||
|
||||
glBufferSubDataARB_func(GL_ARRAY_BUFFER_ARB,
|
||||
sizeof(VertCoords) +
|
||||
sizeof(Tex0Coords), /* offset */
|
||||
sizeof(Tex1Coords), /* size */
|
||||
Tex1Coords); /* data */
|
||||
|
||||
glBindBufferARB_func(GL_ARRAY_BUFFER_ARB, 0);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
DrawPolygonArray(void)
|
||||
{
|
||||
void *vertPtr, *tex0Ptr, *tex1Ptr;
|
||||
|
||||
if (UseVBO) {
|
||||
glBindBufferARB_func(GL_ARRAY_BUFFER_ARB, VBO);
|
||||
vertPtr = (void *) 0;
|
||||
tex0Ptr = (void *) sizeof(VertCoords);
|
||||
tex1Ptr = (void *) (sizeof(VertCoords) + sizeof(Tex0Coords));
|
||||
}
|
||||
else {
|
||||
glBindBufferARB_func(GL_ARRAY_BUFFER_ARB, 0);
|
||||
vertPtr = VertCoords;
|
||||
tex0Ptr = Tex0Coords;
|
||||
tex1Ptr = Tex1Coords;
|
||||
}
|
||||
|
||||
if (VertCoord_attr >= 0) {
|
||||
glVertexAttribPointer_func(VertCoord_attr, 2, GL_FLOAT, GL_FALSE,
|
||||
0, VertCoords);
|
||||
0, vertPtr);
|
||||
glEnableVertexAttribArray_func(VertCoord_attr);
|
||||
}
|
||||
else {
|
||||
glVertexPointer(2, GL_FLOAT, 0, VertCoords);
|
||||
glVertexPointer(2, GL_FLOAT, 0, vertPtr);
|
||||
glEnable(GL_VERTEX_ARRAY);
|
||||
}
|
||||
|
||||
glVertexAttribPointer_func(TexCoord0_attr, 2, GL_FLOAT, GL_FALSE,
|
||||
0, Tex0Coords);
|
||||
0, tex0Ptr);
|
||||
glEnableVertexAttribArray_func(TexCoord0_attr);
|
||||
|
||||
glVertexAttribPointer_func(TexCoord1_attr, 2, GL_FLOAT, GL_FALSE,
|
||||
0, Tex1Coords);
|
||||
0, tex1Ptr);
|
||||
glEnableVertexAttribArray_func(TexCoord1_attr);
|
||||
|
||||
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
|
||||
|
||||
glBindBufferARB_func(GL_ARRAY_BUFFER_ARB, 0);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -163,6 +218,10 @@ key(unsigned char k, int x, int y)
|
|||
UseArrays = !UseArrays;
|
||||
printf("Arrays: %d\n", UseArrays);
|
||||
break;
|
||||
case 'v':
|
||||
UseVBO = !UseVBO;
|
||||
printf("Use VBO: %d\n", UseVBO);
|
||||
break;
|
||||
case ' ':
|
||||
Anim = !Anim;
|
||||
if (Anim)
|
||||
|
|
@ -271,9 +330,24 @@ CreateProgram(const char *vertProgFile, const char *fragProgFile,
|
|||
|
||||
InitUniforms(program, uniforms);
|
||||
|
||||
VertCoord_attr = glGetAttribLocation_func(program, "VertCoord");
|
||||
if (VertCoord_attr > 0) {
|
||||
/* We want the VertCoord attrib to have position zero so that
|
||||
* the call to glVertexAttrib(0, xyz) triggers vertex processing.
|
||||
* Otherwise, if TexCoord0 or TexCoord1 gets position 0 we'd have
|
||||
* to set that attribute last (which is a PITA to manage).
|
||||
*/
|
||||
glBindAttribLocation_func(program, 0, "VertCoord");
|
||||
/* re-link */
|
||||
glLinkProgram_func(program);
|
||||
/* VertCoord_attr should be zero now */
|
||||
VertCoord_attr = glGetAttribLocation_func(program, "VertCoord");
|
||||
assert(VertCoord_attr == 0);
|
||||
}
|
||||
|
||||
TexCoord0_attr = glGetAttribLocation_func(program, "TexCoord0");
|
||||
TexCoord1_attr = glGetAttribLocation_func(program, "TexCoord1");
|
||||
VertCoord_attr = glGetAttribLocation_func(program, "VertCoord");
|
||||
|
||||
printf("TexCoord0_attr = %d\n", TexCoord0_attr);
|
||||
printf("TexCoord1_attr = %d\n", TexCoord1_attr);
|
||||
printf("VertCoord_attr = %d\n", VertCoord_attr);
|
||||
|
|
@ -299,12 +373,19 @@ InitGL(void)
|
|||
/*exit(1);*/
|
||||
}
|
||||
printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER));
|
||||
|
||||
printf("Usage:\n");
|
||||
printf(" a - toggle arrays vs. immediate mode rendering\n");
|
||||
printf(" v - toggle VBO usage for array rendering\n");
|
||||
printf(" z/Z - change viewing distance\n");
|
||||
printf(" SPACE - toggle animation\n");
|
||||
printf(" Esc - exit\n");
|
||||
GetExtensionFuncs();
|
||||
|
||||
InitTextures();
|
||||
InitPrograms();
|
||||
|
||||
SetupVertexBuffer();
|
||||
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
|
||||
glClearColor(.6, .6, .9, 0);
|
||||
|
|
|
|||
369
progs/glsl/texaaline.c
Normal file
369
progs/glsl/texaaline.c
Normal file
|
|
@ -0,0 +1,369 @@
|
|||
/**
|
||||
* AA lines with texture mapped quads
|
||||
*
|
||||
* Brian Paul
|
||||
* 9 Feb 2008
|
||||
*/
|
||||
|
||||
|
||||
#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 GLint WinWidth = 300, WinHeight = 300;
|
||||
static GLint win = 0;
|
||||
static GLfloat Width = 8.;
|
||||
|
||||
/*
|
||||
* Quad strip for line from v0 to v1:
|
||||
*
|
||||
1 3 5 7
|
||||
+---+---------------------+---+
|
||||
| |
|
||||
| *v0 v1* |
|
||||
| |
|
||||
+---+---------------------+---+
|
||||
0 2 4 6
|
||||
*/
|
||||
static void
|
||||
QuadLine(const GLfloat *v0, const GLfloat *v1, GLfloat width)
|
||||
{
|
||||
GLfloat dx = v1[0] - v0[0];
|
||||
GLfloat dy = v1[1] - v0[1];
|
||||
GLfloat len = sqrt(dx*dx + dy*dy);
|
||||
float dx0, dx1, dx2, dx3, dx4, dx5, dx6, dx7;
|
||||
float dy0, dy1, dy2, dy3, dy4, dy5, dy6, dy7;
|
||||
|
||||
dx /= len;
|
||||
dy /= len;
|
||||
|
||||
width *= 0.5; /* half width */
|
||||
dx = dx * (width + 0.0);
|
||||
dy = dy * (width + 0.0);
|
||||
|
||||
dx0 = -dx+dy; dy0 = -dy-dx;
|
||||
dx1 = -dx-dy; dy1 = -dy+dx;
|
||||
|
||||
dx2 = 0+dy; dy2 = -dx+0;
|
||||
dx3 = 0-dy; dy3 = +dx+0;
|
||||
|
||||
dx4 = 0+dy; dy4 = -dx+0;
|
||||
dx5 = 0-dy; dy5 = +dx+0;
|
||||
|
||||
dx6 = dx+dy; dy6 = dy-dx;
|
||||
dx7 = dx-dy; dy7 = dy+dx;
|
||||
|
||||
/*
|
||||
printf("dx, dy = %g, %g\n", dx, dy);
|
||||
printf(" dx0, dy0: %g, %g\n", dx0, dy0);
|
||||
printf(" dx1, dy1: %g, %g\n", dx1, dy1);
|
||||
printf(" dx2, dy2: %g, %g\n", dx2, dy2);
|
||||
printf(" dx3, dy3: %g, %g\n", dx3, dy3);
|
||||
*/
|
||||
|
||||
glBegin(GL_QUAD_STRIP);
|
||||
glTexCoord2f(0, 0);
|
||||
glVertex2f(v0[0] + dx0, v0[1] + dy0);
|
||||
glTexCoord2f(0, 1);
|
||||
glVertex2f(v0[0] + dx1, v0[1] + dy1);
|
||||
|
||||
glTexCoord2f(0.5, 0);
|
||||
glVertex2f(v0[0] + dx2, v0[1] + dy2);
|
||||
glTexCoord2f(0.5, 1);
|
||||
glVertex2f(v0[0] + dx3, v0[1] + dy3);
|
||||
|
||||
glTexCoord2f(0.5, 0);
|
||||
glVertex2f(v1[0] + dx2, v1[1] + dy2);
|
||||
glTexCoord2f(0.5, 1);
|
||||
glVertex2f(v1[0] + dx3, v1[1] + dy3);
|
||||
|
||||
glTexCoord2f(1, 0);
|
||||
glVertex2f(v1[0] + dx6, v1[1] + dy6);
|
||||
glTexCoord2f(1, 1);
|
||||
glVertex2f(v1[0] + dx7, v1[1] + dy7);
|
||||
glEnd();
|
||||
}
|
||||
|
||||
|
||||
static float Cos(float a)
|
||||
{
|
||||
return cos(a * M_PI / 180.);
|
||||
}
|
||||
|
||||
static float Sin(float a)
|
||||
{
|
||||
return sin(a * M_PI / 180.);
|
||||
}
|
||||
|
||||
static void
|
||||
Redisplay(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
glColor3f(1, 1, 1);
|
||||
|
||||
glEnable(GL_BLEND);
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
|
||||
for (i = 0; i < 360; i+=5) {
|
||||
float v0[2], v1[2];
|
||||
v0[0] = 150 + 40 * Cos(i);
|
||||
v0[1] = 150 + 40 * Sin(i);
|
||||
v1[0] = 150 + 130 * Cos(i);
|
||||
v1[1] = 150 + 130 * Sin(i);
|
||||
QuadLine(v0, v1, Width);
|
||||
}
|
||||
|
||||
{
|
||||
float v0[2], v1[2], x;
|
||||
for (x = 0; x < 1.0; x += 0.2) {
|
||||
v0[0] = 150 + x;
|
||||
v0[1] = 150 + x * 40 - 20;
|
||||
v1[0] = 150 + x + 5.0;
|
||||
v1[1] = 150 + x * 40 - 20;
|
||||
QuadLine(v0, v1, Width);
|
||||
}
|
||||
}
|
||||
|
||||
glDisable(GL_BLEND);
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
|
||||
glutSwapBuffers();
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Reshape(int width, int height)
|
||||
{
|
||||
glViewport(0, 0, width, height);
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrtho(0, width, 0, height, -1, 1);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
CleanUp(void)
|
||||
{
|
||||
glutDestroyWindow(win);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Key(unsigned char key, int x, int y)
|
||||
{
|
||||
(void) x;
|
||||
(void) y;
|
||||
|
||||
switch(key) {
|
||||
case 'w':
|
||||
Width -= 0.5;
|
||||
break;
|
||||
case 'W':
|
||||
Width += 0.5;
|
||||
break;
|
||||
case 27:
|
||||
CleanUp();
|
||||
exit(0);
|
||||
break;
|
||||
}
|
||||
#if 0
|
||||
if (Width < 3)
|
||||
Width = 3;
|
||||
#endif
|
||||
printf("Width = %g\n", Width);
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
static float
|
||||
ramp4(GLint i, GLint size)
|
||||
{
|
||||
float d;
|
||||
if (i < 4 ) {
|
||||
d = i / 4.0;
|
||||
}
|
||||
else if (i >= size - 5) {
|
||||
d = 1.0 - (i - (size - 5)) / 4.0;
|
||||
}
|
||||
else {
|
||||
d = 1.0;
|
||||
}
|
||||
return d;
|
||||
}
|
||||
|
||||
static float
|
||||
ramp2(GLint i, GLint size)
|
||||
{
|
||||
float d;
|
||||
if (i < 2 ) {
|
||||
d = i / 2.0;
|
||||
}
|
||||
else if (i >= size - 3) {
|
||||
d = 1.0 - (i - (size - 3)) / 2.0;
|
||||
}
|
||||
else {
|
||||
d = 1.0;
|
||||
}
|
||||
return d;
|
||||
}
|
||||
|
||||
static float
|
||||
ramp1(GLint i, GLint size)
|
||||
{
|
||||
float d;
|
||||
if (i == 0 || i == size-1) {
|
||||
d = 0.0;
|
||||
}
|
||||
else {
|
||||
d = 1.0;
|
||||
}
|
||||
return d;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Make an alpha texture for antialiasing lines.
|
||||
* Just a linear fall-off ramp for now.
|
||||
* Should have a number of different textures for different line widths.
|
||||
* Could try a bell-like-curve....
|
||||
*/
|
||||
static void
|
||||
MakeTexture(void)
|
||||
{
|
||||
#define SZ 8
|
||||
GLfloat tex[SZ][SZ]; /* alpha tex */
|
||||
int i, j;
|
||||
for (i = 0; i < SZ; i++) {
|
||||
for (j = 0; j < SZ; j++) {
|
||||
#if 0
|
||||
float k = (SZ-1) / 2.0;
|
||||
float dx = fabs(i - k) / k;
|
||||
float dy = fabs(j - k) / k;
|
||||
float d;
|
||||
|
||||
dx = 1.0 - dx;
|
||||
dy = 1.0 - dy;
|
||||
d = dx * dy;
|
||||
|
||||
#else
|
||||
float d = ramp1(i, SZ) * ramp1(j, SZ);
|
||||
printf("%d, %d: %g\n", i, j, d);
|
||||
#endif
|
||||
tex[i][j] = d;
|
||||
}
|
||||
}
|
||||
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, SZ, SZ, 0, GL_ALPHA, GL_FLOAT, tex);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
#undef SZ
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
MakeMipmap(void)
|
||||
{
|
||||
#define SZ 64
|
||||
GLfloat tex[SZ][SZ]; /* alpha tex */
|
||||
int level;
|
||||
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, SZ);
|
||||
for (level = 0; level < 7; level++) {
|
||||
int sz = 1 << (6 - level);
|
||||
int i, j;
|
||||
for (i = 0; i < sz; i++) {
|
||||
for (j = 0; j < sz; j++) {
|
||||
if (level == 6)
|
||||
tex[i][j] = 1.0;
|
||||
else if (level == 5)
|
||||
tex[i][j] = 0.5;
|
||||
else
|
||||
tex[i][j] = ramp1(i, sz) * ramp1(j, sz);
|
||||
}
|
||||
}
|
||||
|
||||
glTexImage2D(GL_TEXTURE_2D, level, GL_ALPHA,
|
||||
sz, sz, 0, GL_ALPHA, GL_FLOAT, tex);
|
||||
}
|
||||
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
//glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, 4);
|
||||
////glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 5);
|
||||
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
#undef SZ
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Init(void)
|
||||
{
|
||||
const char *version;
|
||||
|
||||
(void) MakeTexture;
|
||||
(void) ramp4;
|
||||
(void) ramp2;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
GetExtensionFuncs();
|
||||
|
||||
glClearColor(0.3f, 0.3f, 0.3f, 0.0f);
|
||||
|
||||
printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER));
|
||||
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
#if 0
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
|
||||
#elif 0
|
||||
MakeTexture();
|
||||
#else
|
||||
MakeMipmap();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
ParseOptions(int argc, char *argv[])
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
glutInit(&argc, argv);
|
||||
glutInitWindowPosition( 0, 0);
|
||||
glutInitWindowSize(WinWidth, WinHeight);
|
||||
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
|
||||
win = glutCreateWindow(argv[0]);
|
||||
glutReshapeFunc(Reshape);
|
||||
glutKeyboardFunc(Key);
|
||||
glutDisplayFunc(Redisplay);
|
||||
ParseOptions(argc, argv);
|
||||
Init();
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
||||
11
progs/rbug/.gitignore
vendored
Normal file
11
progs/rbug/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
bin_to_bmp
|
||||
simple_client
|
||||
simple_server
|
||||
shdr_info
|
||||
shdr_dump
|
||||
shdr_disable
|
||||
ctx_info
|
||||
tex_dump
|
||||
tex_info
|
||||
*.bmp
|
||||
*.bin
|
||||
47
progs/rbug/Makefile
Normal file
47
progs/rbug/Makefile
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
# progs/rbug/Makefile
|
||||
|
||||
TOP = ../..
|
||||
include $(TOP)/configs/current
|
||||
|
||||
INCLUDES = \
|
||||
-I. \
|
||||
-I$(TOP)/src/gallium/include \
|
||||
-I$(TOP)/src/gallium/auxiliary \
|
||||
-I$(TOP)/src/gallium/drivers \
|
||||
$(PROG_INCLUDES)
|
||||
|
||||
LINKS = \
|
||||
$(GALLIUM_AUXILIARIES) \
|
||||
$(PROG_LINKS)
|
||||
|
||||
SOURCES = \
|
||||
bin_to_bmp.c \
|
||||
simple_client.c \
|
||||
simple_server.c \
|
||||
shdr_info.c \
|
||||
shdr_dump.c \
|
||||
shdr_disable.c \
|
||||
ctx_info.c \
|
||||
tex_info.c \
|
||||
tex_dump.c
|
||||
|
||||
|
||||
OBJECTS = $(SOURCES:.c=.o)
|
||||
|
||||
PROGS = $(OBJECTS:.o=)
|
||||
|
||||
##### TARGETS #####
|
||||
|
||||
default: $(OBJECTS) $(PROGS)
|
||||
|
||||
clean:
|
||||
-rm -f $(PROGS)
|
||||
-rm -f *.o
|
||||
|
||||
##### RULES #####
|
||||
|
||||
$(OBJECTS): %.o: %.c
|
||||
$(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $(PROG_DEFINES) $< -o $@
|
||||
|
||||
$(PROGS): %: %.o
|
||||
$(CC) $(LDFLAGS) $< $(LINKS) -o $@
|
||||
39
progs/rbug/README
Normal file
39
progs/rbug/README
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
REMOTE DEBUGGING CLI APPLICATIONS
|
||||
|
||||
|
||||
= About =
|
||||
|
||||
This directory contains a Gallium3D remote debugging cli applications.
|
||||
|
||||
|
||||
= Build Instructions =
|
||||
|
||||
To build, build a normal gallium build and from this directory do the following.
|
||||
|
||||
make
|
||||
|
||||
= Usage =
|
||||
|
||||
Make sure that you driver has trace integration, see
|
||||
src/gallium/driver/trace/README for more information about that. Then from on
|
||||
the computer that you want to debug do:
|
||||
|
||||
export GALLIUM_RBUG=true
|
||||
|
||||
<launch app>
|
||||
|
||||
From the debugging computer launch apps form this directory. Currently ip
|
||||
addresses are hardcoded and you need to edit the application, but that will
|
||||
change in the future.
|
||||
|
||||
= Testing =
|
||||
|
||||
The two apps simple_client and simple_server. Are unit testing of the
|
||||
connection and (de)marsheler. Just run the server first and then the client:
|
||||
|
||||
./simple_server &
|
||||
./simple_client
|
||||
|
||||
|
||||
--
|
||||
Jakob Bornecrantz <jakob@vmware.com>
|
||||
110
progs/rbug/bin_to_bmp.c
Normal file
110
progs/rbug/bin_to_bmp.c
Normal file
|
|
@ -0,0 +1,110 @@
|
|||
/*
|
||||
* Copyright 2009 VMware, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* on the rights to use, copy, modify, merge, publish, distribute, sub
|
||||
* license, and/or sell copies of the Software, and to permit persons to whom
|
||||
* the Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
* VMWARE AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
* USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "pipe/p_compiler.h"
|
||||
#include "pipe/p_format.h"
|
||||
#include "pipe/p_state.h"
|
||||
#include "util/u_memory.h"
|
||||
#include "util/u_debug.h"
|
||||
#include "util/u_network.h"
|
||||
#include "util/u_tile.h"
|
||||
|
||||
static uint8_t* read(const char *filename, unsigned size);
|
||||
static void dump(unsigned src_width, unsigned src_height,
|
||||
unsigned src_stride, enum pipe_format src_format,
|
||||
uint8_t *data, unsigned src_size);
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
/* change these */
|
||||
unsigned width = 64;
|
||||
unsigned height = 64;
|
||||
unsigned stride = width * 4;
|
||||
unsigned size = stride * height;
|
||||
const char *filename = "mybin.bin";
|
||||
enum pipe_format format = PIPE_FORMAT_A8R8G8B8_UNORM;
|
||||
|
||||
dump(width, height, stride, format, read(filename, size), size);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void dump(unsigned width, unsigned height,
|
||||
unsigned src_stride, enum pipe_format src_format,
|
||||
uint8_t *data, unsigned src_size)
|
||||
{
|
||||
struct pipe_format_block src_block;
|
||||
|
||||
enum pipe_format dst_format = PIPE_FORMAT_R32G32B32A32_FLOAT;
|
||||
struct pipe_format_block dst_block;
|
||||
unsigned dst_stride;
|
||||
unsigned dst_size;
|
||||
float *rgba;
|
||||
int i;
|
||||
char filename[512];
|
||||
|
||||
{
|
||||
pf_get_block(src_format, &src_block);
|
||||
assert(src_stride >= pf_get_stride(&src_block, width));
|
||||
assert(src_size >= pf_get_2d_size(&src_block, src_stride, width));
|
||||
}
|
||||
{
|
||||
pf_get_block(dst_format, &dst_block);
|
||||
dst_stride = pf_get_stride(&dst_block, width);
|
||||
dst_size = pf_get_2d_size(&dst_block, dst_stride, width);
|
||||
rgba = MALLOC(dst_size);
|
||||
}
|
||||
|
||||
util_snprintf(filename, 512, "%s.bmp", pf_name(src_format));
|
||||
|
||||
if (pf_is_compressed(src_format)) {
|
||||
debug_printf("skipping: %s\n", filename);
|
||||
return;
|
||||
}
|
||||
|
||||
debug_printf("saving: %s\n", filename);
|
||||
|
||||
for (i = 0; i < height; i++) {
|
||||
pipe_tile_raw_to_rgba(src_format, data + src_stride * i,
|
||||
width, 1,
|
||||
&rgba[width*4*i], dst_stride);
|
||||
}
|
||||
|
||||
debug_dump_float_rgba_bmp(filename, width, height, rgba, width);
|
||||
|
||||
FREE(rgba);
|
||||
}
|
||||
|
||||
static uint8_t* read(const char *filename, unsigned size)
|
||||
{
|
||||
uint8_t *data;
|
||||
FILE *file = fopen(filename, "rb");
|
||||
|
||||
data = MALLOC(size);
|
||||
|
||||
fread(data, 1, size, file);
|
||||
fclose(file);
|
||||
|
||||
return data;
|
||||
}
|
||||
80
progs/rbug/ctx_info.c
Normal file
80
progs/rbug/ctx_info.c
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
/*
|
||||
* Copyright 2009 VMware, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* on the rights to use, copy, modify, merge, publish, distribute, sub
|
||||
* license, and/or sell copies of the Software, and to permit persons to whom
|
||||
* the Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
* VMWARE AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
* USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "pipe/p_compiler.h"
|
||||
#include "pipe/p_format.h"
|
||||
#include "util/u_memory.h"
|
||||
#include "util/u_debug.h"
|
||||
#include "util/u_network.h"
|
||||
|
||||
#include "rbug/rbug.h"
|
||||
|
||||
static void talk()
|
||||
{
|
||||
int c = u_socket_connect("localhost", 13370);
|
||||
struct rbug_connection *con = rbug_from_socket(c);
|
||||
struct rbug_header *header;
|
||||
struct rbug_proto_context_list_reply *list;
|
||||
struct rbug_proto_context_info_reply *info;
|
||||
int i;
|
||||
|
||||
assert(c >= 0);
|
||||
assert(con);
|
||||
debug_printf("Connection get!\n");
|
||||
|
||||
debug_printf("Sending get contexts\n");
|
||||
rbug_send_context_list(con, NULL);
|
||||
|
||||
debug_printf("Waiting for contexts\n");
|
||||
header = rbug_get_message(con, NULL);
|
||||
assert(header->opcode == RBUG_OP_CONTEXT_LIST_REPLY);
|
||||
list = (struct rbug_proto_context_list_reply *)header;
|
||||
|
||||
debug_printf("Got contexts:\n");
|
||||
for (i = 0; i < list->contexts_len; i++) {
|
||||
#if 0
|
||||
rbug_send_contexts_info(con, list->contexts[i], NULL);
|
||||
|
||||
header = rbug_get_message(con, NULL);
|
||||
assert(header->opcode == RBUG_OP_CONTEXT_INFO_REPLY);
|
||||
info = (struct rbug_proto_context_info_reply *)header;
|
||||
#else
|
||||
(void)info;
|
||||
header = NULL;
|
||||
#endif
|
||||
|
||||
debug_printf("%llu\n",
|
||||
(unsigned long long)list->contexts[i]);
|
||||
rbug_free_header(header);
|
||||
}
|
||||
|
||||
rbug_free_header(&list->header);
|
||||
rbug_disconnect(con);
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
talk();
|
||||
return 0;
|
||||
}
|
||||
82
progs/rbug/shdr_disable.c
Normal file
82
progs/rbug/shdr_disable.c
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
/*
|
||||
* Copyright 2009 VMware, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* on the rights to use, copy, modify, merge, publish, distribute, sub
|
||||
* license, and/or sell copies of the Software, and to permit persons to whom
|
||||
* the Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
* VMWARE AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
* USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "pipe/p_compiler.h"
|
||||
#include "pipe/p_format.h"
|
||||
#include "util/u_memory.h"
|
||||
#include "util/u_debug.h"
|
||||
#include "util/u_network.h"
|
||||
|
||||
#include "rbug/rbug.h"
|
||||
|
||||
static void talk(rbug_context_t ctx, rbug_shader_t shdr)
|
||||
{
|
||||
int c = u_socket_connect("localhost", 13370);
|
||||
struct rbug_connection *con = rbug_from_socket(c);
|
||||
struct rbug_header *header;
|
||||
|
||||
assert(c >= 0);
|
||||
assert(con);
|
||||
debug_printf("Connection get!\n");
|
||||
|
||||
rbug_send_shader_disable(con, ctx, shdr, true, NULL);
|
||||
|
||||
rbug_send_ping(con, NULL);
|
||||
|
||||
debug_printf("Sent waiting for reply\n");
|
||||
header = rbug_get_message(con, NULL);
|
||||
|
||||
if (header->opcode != RBUG_OP_PING_REPLY)
|
||||
debug_printf("Error\n");
|
||||
else
|
||||
debug_printf("Ok!\n");
|
||||
|
||||
rbug_free_header(header);
|
||||
rbug_disconnect(con);
|
||||
}
|
||||
|
||||
static void print_usage()
|
||||
{
|
||||
printf("Usage shdr_disable <context> <shader>\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
long ctx;
|
||||
long shdr;
|
||||
|
||||
if (argc < 3)
|
||||
print_usage();
|
||||
|
||||
ctx = atol(argv[1]);
|
||||
shdr = atol(argv[2]);
|
||||
|
||||
if (ctx <= 0 && ctx <= 0)
|
||||
print_usage();
|
||||
|
||||
talk((uint64_t)ctx, (uint64_t)shdr);
|
||||
|
||||
return 0;
|
||||
}
|
||||
115
progs/rbug/shdr_dump.c
Normal file
115
progs/rbug/shdr_dump.c
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
/*
|
||||
* Copyright 2009 VMware, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* on the rights to use, copy, modify, merge, publish, distribute, sub
|
||||
* license, and/or sell copies of the Software, and to permit persons to whom
|
||||
* the Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
* VMWARE AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
* USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "pipe/p_compiler.h"
|
||||
#include "pipe/p_format.h"
|
||||
#include "util/u_memory.h"
|
||||
#include "util/u_debug.h"
|
||||
#include "util/u_network.h"
|
||||
|
||||
#include "rbug/rbug.h"
|
||||
|
||||
#include "tgsi/tgsi_dump.h"
|
||||
|
||||
static void shader_info(struct rbug_connection *con, rbug_context_t ctx)
|
||||
{
|
||||
struct rbug_header *header;
|
||||
struct rbug_proto_shader_list_reply *list;
|
||||
struct rbug_proto_shader_info_reply *info;
|
||||
int i;
|
||||
|
||||
debug_printf("Sending get shaders to %llu\n", (unsigned long long)ctx);
|
||||
rbug_send_shader_list(con, ctx, NULL);
|
||||
|
||||
debug_printf("Waiting for shaders from %llu\n", (unsigned long long)ctx);
|
||||
header = rbug_get_message(con, NULL);
|
||||
assert(header->opcode == RBUG_OP_SHADER_LIST_REPLY);
|
||||
list = (struct rbug_proto_shader_list_reply *)header;
|
||||
|
||||
debug_printf("Got shaders:\n");
|
||||
for (i = 0; i < list->shaders_len; i++) {
|
||||
rbug_send_shader_info(con, ctx, list->shaders[i], NULL);
|
||||
|
||||
header = rbug_get_message(con, NULL);
|
||||
assert(header->opcode == RBUG_OP_SHADER_INFO_REPLY);
|
||||
info = (struct rbug_proto_shader_info_reply *)header;
|
||||
|
||||
debug_printf("#####################################################\n");
|
||||
debug_printf("ctx: %llu shdr: %llu disabled %u\n",
|
||||
(unsigned long long)ctx,
|
||||
(unsigned long long)list->shaders[i],
|
||||
info->disabled);
|
||||
|
||||
/* just to be sure */
|
||||
assert(sizeof(struct tgsi_token) == 4);
|
||||
|
||||
debug_printf("-----------------------------------------------------\n");
|
||||
tgsi_dump((struct tgsi_token *)info->original, 0);
|
||||
|
||||
if (info->replaced_len > 0) {
|
||||
debug_printf("-----------------------------------------------------\n");
|
||||
tgsi_dump((struct tgsi_token *)info->replaced, 0);
|
||||
}
|
||||
|
||||
rbug_free_header(header);
|
||||
}
|
||||
|
||||
debug_printf("#####################################################\n");
|
||||
rbug_free_header(&list->header);
|
||||
}
|
||||
|
||||
static void talk()
|
||||
{
|
||||
int c = u_socket_connect("localhost", 13370);
|
||||
struct rbug_connection *con = rbug_from_socket(c);
|
||||
struct rbug_header *header;
|
||||
struct rbug_proto_context_list_reply *list;
|
||||
int i;
|
||||
|
||||
assert(c >= 0);
|
||||
assert(con);
|
||||
debug_printf("Connection get!\n");
|
||||
|
||||
debug_printf("Sending get contexts\n");
|
||||
rbug_send_context_list(con, NULL);
|
||||
|
||||
debug_printf("Waiting for contexts\n");
|
||||
header = rbug_get_message(con, NULL);
|
||||
assert(header->opcode == RBUG_OP_CONTEXT_LIST_REPLY);
|
||||
list = (struct rbug_proto_context_list_reply *)header;
|
||||
|
||||
debug_printf("Got contexts:\n");
|
||||
for (i = 0; i < list->contexts_len; i++) {
|
||||
shader_info(con, list->contexts[i]);
|
||||
}
|
||||
|
||||
rbug_free_header(&list->header);
|
||||
rbug_disconnect(con);
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
talk();
|
||||
return 0;
|
||||
}
|
||||
98
progs/rbug/shdr_info.c
Normal file
98
progs/rbug/shdr_info.c
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
/*
|
||||
* Copyright 2009 VMware, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* on the rights to use, copy, modify, merge, publish, distribute, sub
|
||||
* license, and/or sell copies of the Software, and to permit persons to whom
|
||||
* the Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
* VMWARE AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
* USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "pipe/p_compiler.h"
|
||||
#include "pipe/p_format.h"
|
||||
#include "util/u_memory.h"
|
||||
#include "util/u_debug.h"
|
||||
#include "util/u_network.h"
|
||||
|
||||
#include "rbug/rbug.h"
|
||||
|
||||
static void shader_info(struct rbug_connection *con, rbug_context_t ctx)
|
||||
{
|
||||
struct rbug_header *header;
|
||||
struct rbug_proto_shader_list_reply *list;
|
||||
struct rbug_proto_shader_info_reply *info;
|
||||
int i;
|
||||
|
||||
rbug_send_shader_list(con, ctx, NULL);
|
||||
|
||||
header = rbug_get_message(con, NULL);
|
||||
assert(header->opcode == RBUG_OP_SHADER_LIST_REPLY);
|
||||
list = (struct rbug_proto_shader_list_reply *)header;
|
||||
|
||||
debug_printf(" context | shader | disabled |\n");
|
||||
for (i = 0; i < list->shaders_len; i++) {
|
||||
rbug_send_shader_info(con, ctx, list->shaders[i], NULL);
|
||||
|
||||
header = rbug_get_message(con, NULL);
|
||||
assert(header->opcode == RBUG_OP_SHADER_INFO_REPLY);
|
||||
info = (struct rbug_proto_shader_info_reply *)header;
|
||||
|
||||
debug_printf("% 15llu |% 15llu |% 15u |\n",
|
||||
(unsigned long long)ctx,
|
||||
(unsigned long long)list->shaders[i],
|
||||
(unsigned)info->disabled);
|
||||
|
||||
rbug_free_header(header);
|
||||
}
|
||||
|
||||
rbug_free_header(&list->header);
|
||||
}
|
||||
|
||||
static void talk()
|
||||
{
|
||||
int c = u_socket_connect("localhost", 13370);
|
||||
struct rbug_connection *con = rbug_from_socket(c);
|
||||
struct rbug_header *header;
|
||||
struct rbug_proto_context_list_reply *list;
|
||||
int i;
|
||||
|
||||
assert(c >= 0);
|
||||
assert(con);
|
||||
debug_printf("Connection get!\n");
|
||||
|
||||
debug_printf("Sending get contexts\n");
|
||||
rbug_send_context_list(con, NULL);
|
||||
|
||||
debug_printf("Waiting for contexts\n");
|
||||
header = rbug_get_message(con, NULL);
|
||||
assert(header->opcode == RBUG_OP_CONTEXT_LIST_REPLY);
|
||||
list = (struct rbug_proto_context_list_reply *)header;
|
||||
|
||||
debug_printf("Got contexts:\n");
|
||||
for (i = 0; i < list->contexts_len; i++) {
|
||||
shader_info(con, list->contexts[i]);
|
||||
}
|
||||
|
||||
rbug_free_header(&list->header);
|
||||
rbug_disconnect(con);
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
talk();
|
||||
return 0;
|
||||
}
|
||||
64
progs/rbug/simple_client.c
Normal file
64
progs/rbug/simple_client.c
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
* Copyright 2009 VMware, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* on the rights to use, copy, modify, merge, publish, distribute, sub
|
||||
* license, and/or sell copies of the Software, and to permit persons to whom
|
||||
* the Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
* VMWARE AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
* USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "pipe/p_compiler.h"
|
||||
#include "util/u_memory.h"
|
||||
#include "util/u_debug.h"
|
||||
#include "util/u_network.h"
|
||||
|
||||
#include "rbug/rbug.h"
|
||||
|
||||
static void talk()
|
||||
{
|
||||
int c = u_socket_connect("localhost", 13370);
|
||||
struct rbug_connection *con = rbug_from_socket(c);
|
||||
struct rbug_header *header;
|
||||
struct rbug_proto_texture_list_reply *list;
|
||||
int i;
|
||||
|
||||
assert(c >= 0);
|
||||
assert(con);
|
||||
debug_printf("Connection get!\n");
|
||||
|
||||
debug_printf("Sending get textures\n");
|
||||
rbug_send_texture_list(con, NULL);
|
||||
|
||||
debug_printf("Waiting for textures\n");
|
||||
header = rbug_get_message(con, NULL);
|
||||
assert(header->opcode == RBUG_OP_TEXTURE_LIST_REPLY);
|
||||
list = (struct rbug_proto_texture_list_reply *)header;
|
||||
|
||||
debug_printf("Got textures:\n");
|
||||
for (i = 0; i < list->textures_len; i++)
|
||||
debug_printf("\ttex %llu\n", (unsigned long long)list->textures[i]);
|
||||
|
||||
rbug_free_header(header);
|
||||
rbug_disconnect(con);
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
talk();
|
||||
return 0;
|
||||
}
|
||||
62
progs/rbug/simple_server.c
Normal file
62
progs/rbug/simple_server.c
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
/*
|
||||
* Copyright 2009 VMware, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* on the rights to use, copy, modify, merge, publish, distribute, sub
|
||||
* license, and/or sell copies of the Software, and to permit persons to whom
|
||||
* the Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
* VMWARE AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
* USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "pipe/p_compiler.h"
|
||||
#include "util/u_memory.h"
|
||||
#include "util/u_debug.h"
|
||||
#include "util/u_network.h"
|
||||
|
||||
#include "rbug/rbug.h"
|
||||
|
||||
static void wait()
|
||||
{
|
||||
int s = u_socket_listen_on_port(13370);
|
||||
int c = u_socket_accept(s);
|
||||
struct rbug_connection *con = rbug_from_socket(c);
|
||||
struct rbug_header *header;
|
||||
rbug_texture_t texs[2];
|
||||
uint32_t serial;
|
||||
texs[0] = 1337;
|
||||
texs[1] = 7331;
|
||||
|
||||
assert(s >= 0);
|
||||
assert(c >= 0);
|
||||
assert(con);
|
||||
debug_printf("Connection get!\n");
|
||||
|
||||
debug_printf("Waiting for get textures\n");
|
||||
header = rbug_get_message(con, &serial);
|
||||
assert(header);
|
||||
assert(header->opcode == RBUG_OP_TEXTURE_LIST);
|
||||
rbug_free_header(header);
|
||||
|
||||
rbug_send_texture_list_reply(con, serial, texs, 2, NULL);
|
||||
rbug_disconnect(con);
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
wait();
|
||||
return 0;
|
||||
}
|
||||
127
progs/rbug/tex_dump.c
Normal file
127
progs/rbug/tex_dump.c
Normal file
|
|
@ -0,0 +1,127 @@
|
|||
/*
|
||||
* Copyright 2009 VMware, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* on the rights to use, copy, modify, merge, publish, distribute, sub
|
||||
* license, and/or sell copies of the Software, and to permit persons to whom
|
||||
* the Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
* VMWARE AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
* USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "pipe/p_compiler.h"
|
||||
#include "pipe/p_format.h"
|
||||
#include "pipe/p_state.h"
|
||||
#include "util/u_memory.h"
|
||||
#include "util/u_debug.h"
|
||||
#include "util/u_network.h"
|
||||
#include "util/u_tile.h"
|
||||
#include "rbug/rbug.h"
|
||||
|
||||
static void dump(rbug_texture_t tex,
|
||||
struct rbug_proto_texture_info_reply *info,
|
||||
struct rbug_proto_texture_read_reply *read,
|
||||
int mip)
|
||||
{
|
||||
enum pipe_format format = info->format;
|
||||
uint8_t *data = read->data;
|
||||
unsigned width = info->width[mip];
|
||||
unsigned height = info->height[mip];
|
||||
unsigned dst_stride = width * 4 * 4;
|
||||
unsigned src_stride = read->stride;
|
||||
float *rgba = MALLOC(dst_stride * height);
|
||||
int i;
|
||||
char filename[512];
|
||||
|
||||
util_snprintf(filename, 512, "%llu_%s_%u.bmp",
|
||||
(unsigned long long)tex, pf_name(info->format), mip);
|
||||
|
||||
if (pf_is_compressed(info->format)) {
|
||||
debug_printf("skipping: %s\n", filename);
|
||||
return;
|
||||
}
|
||||
|
||||
debug_printf("saving: %s\n", filename);
|
||||
|
||||
for (i = 0; i < height; i++) {
|
||||
pipe_tile_raw_to_rgba(format, data + src_stride * i,
|
||||
width, 1,
|
||||
&rgba[width*4*i], dst_stride);
|
||||
}
|
||||
|
||||
debug_dump_float_rgba_bmp(filename, width, height, rgba, width);
|
||||
|
||||
FREE(rgba);
|
||||
}
|
||||
|
||||
static void talk()
|
||||
{
|
||||
int c = u_socket_connect("localhost", 13370);
|
||||
struct rbug_connection *con = rbug_from_socket(c);
|
||||
struct rbug_header *header;
|
||||
struct rbug_header *header2;
|
||||
struct rbug_proto_texture_list_reply *list;
|
||||
struct rbug_proto_texture_info_reply *info;
|
||||
struct rbug_proto_texture_read_reply *read;
|
||||
int i, j;
|
||||
|
||||
assert(c >= 0);
|
||||
assert(con);
|
||||
debug_printf("Connection get!\n");
|
||||
|
||||
debug_printf("Sending get textures\n");
|
||||
rbug_send_texture_list(con, NULL);
|
||||
|
||||
debug_printf("Waiting for textures\n");
|
||||
header = rbug_get_message(con, NULL);
|
||||
assert(header->opcode == RBUG_OP_TEXTURE_LIST_REPLY);
|
||||
list = (struct rbug_proto_texture_list_reply *)header;
|
||||
|
||||
debug_printf("Got textures:\n");
|
||||
for (i = 0; i < list->textures_len; i++) {
|
||||
rbug_send_texture_info(con, list->textures[i], NULL);
|
||||
|
||||
header = rbug_get_message(con, NULL);
|
||||
assert(header->opcode == RBUG_OP_TEXTURE_INFO_REPLY);
|
||||
info = (struct rbug_proto_texture_info_reply *)header;
|
||||
|
||||
for (j = 0; j <= info->last_level; j++) {
|
||||
rbug_send_texture_read(con, list->textures[i],
|
||||
0, j, 0,
|
||||
0, 0, info->width[j], info->height[j],
|
||||
NULL);
|
||||
|
||||
header2 = rbug_get_message(con, NULL);
|
||||
assert(header2->opcode == RBUG_OP_TEXTURE_READ_REPLY);
|
||||
read = (struct rbug_proto_texture_read_reply *)header2;
|
||||
|
||||
dump(list->textures[i], info, read, j);
|
||||
|
||||
rbug_free_header(header2);
|
||||
}
|
||||
|
||||
rbug_free_header(header);
|
||||
|
||||
}
|
||||
rbug_free_header(&list->header);
|
||||
rbug_disconnect(con);
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
talk();
|
||||
return 0;
|
||||
}
|
||||
78
progs/rbug/tex_info.c
Normal file
78
progs/rbug/tex_info.c
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
/*
|
||||
* Copyright 2009 VMware, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* on the rights to use, copy, modify, merge, publish, distribute, sub
|
||||
* license, and/or sell copies of the Software, and to permit persons to whom
|
||||
* the Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
* VMWARE AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
* USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "pipe/p_compiler.h"
|
||||
#include "pipe/p_format.h"
|
||||
#include "util/u_memory.h"
|
||||
#include "util/u_debug.h"
|
||||
#include "util/u_network.h"
|
||||
|
||||
#include "rbug/rbug.h"
|
||||
|
||||
static void talk()
|
||||
{
|
||||
int c = u_socket_connect("localhost", 13370);
|
||||
struct rbug_connection *con = rbug_from_socket(c);
|
||||
struct rbug_header *header;
|
||||
struct rbug_proto_texture_list_reply *list;
|
||||
struct rbug_proto_texture_info_reply *info;
|
||||
int i;
|
||||
|
||||
assert(c >= 0);
|
||||
assert(con);
|
||||
debug_printf("Connection get!\n");
|
||||
|
||||
debug_printf("Sending get textures\n");
|
||||
rbug_send_texture_list(con, NULL);
|
||||
|
||||
debug_printf("Waiting for textures\n");
|
||||
header = rbug_get_message(con, NULL);
|
||||
assert(header->opcode == RBUG_OP_TEXTURE_LIST_REPLY);
|
||||
list = (struct rbug_proto_texture_list_reply *)header;
|
||||
|
||||
debug_printf("Got textures:\n");
|
||||
for (i = 0; i < list->textures_len; i++) {
|
||||
rbug_send_texture_info(con, list->textures[i], NULL);
|
||||
|
||||
header = rbug_get_message(con, NULL);
|
||||
assert(header->opcode == RBUG_OP_TEXTURE_INFO_REPLY);
|
||||
info = (struct rbug_proto_texture_info_reply *)header;
|
||||
|
||||
debug_printf("%llu %s %u x %u x %u, block(%ux%u %u), last_level: %u, nr_samples: %u, usage: %u\n",
|
||||
(unsigned long long)list->textures[i], pf_name(info->format),
|
||||
info->width[0], info->height[0], info->depth[0],
|
||||
info->blockw, info->blockh, info->blocksize,
|
||||
info->last_level, info->nr_samples, info->tex_usage);
|
||||
rbug_free_header(header);
|
||||
}
|
||||
|
||||
rbug_free_header(&list->header);
|
||||
rbug_disconnect(con);
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
talk();
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -153,6 +153,7 @@ static void Benchmark( float xdiff, float ydiff )
|
|||
double seconds, fps;
|
||||
|
||||
printf("Benchmarking...\n");
|
||||
fflush(stdout);
|
||||
|
||||
draws = 0;
|
||||
startTime = glutGet(GLUT_ELAPSED_TIME);
|
||||
|
|
@ -169,6 +170,7 @@ static void Benchmark( float xdiff, float ydiff )
|
|||
seconds = (double) (endTime - startTime) / 1000.0;
|
||||
fps = draws / seconds;
|
||||
printf("Result: fps: %g\n", fps);
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -263,6 +265,7 @@ void keyboard (unsigned char key, int x, int y)
|
|||
default:
|
||||
break;
|
||||
}
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ static void PrintColorStrings( void )
|
|||
{
|
||||
GLubyte ubbuf[3];
|
||||
int i, xleft, xright;
|
||||
char colorString[18];
|
||||
char colorString[100];
|
||||
|
||||
xleft = 5 + windW/4;
|
||||
xright = 5 + windW/2;
|
||||
|
|
|
|||
|
|
@ -466,25 +466,22 @@ static void Draw(void)
|
|||
} else {
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
|
||||
}
|
||||
#if 01
|
||||
|
||||
Viewport(0, 0); Point();
|
||||
Viewport(0, 1); Lines();
|
||||
Viewport(0, 2); LineStrip();
|
||||
Viewport(0, 3); LineLoop();
|
||||
|
||||
Viewport(1, 0); Bitmap();
|
||||
|
||||
Viewport(1, 1); TriangleFan();
|
||||
Viewport(1, 2); Triangles();
|
||||
Viewport(1, 3); TriangleStrip();
|
||||
|
||||
Viewport(2, 0); Rect();
|
||||
#endif
|
||||
Viewport(2, 1); PolygonFunc();
|
||||
#if 01
|
||||
Viewport(2, 2); Quads();
|
||||
Viewport(2, 3); QuadStrip();
|
||||
#endif
|
||||
|
||||
glFlush();
|
||||
|
||||
if (doubleBuffer) {
|
||||
|
|
|
|||
17
progs/tests/.gitignore
vendored
17
progs/tests/.gitignore
vendored
|
|
@ -16,22 +16,20 @@ blendminmax
|
|||
blendsquare
|
||||
blendxor
|
||||
bufferobj
|
||||
bumpmap
|
||||
bug_3050
|
||||
bug_3101
|
||||
bug_3195
|
||||
bug_texstore_i8
|
||||
bumpmap
|
||||
calibrate_rast
|
||||
copypixrate
|
||||
crossbar
|
||||
cva
|
||||
dinoshade
|
||||
drawbuffers
|
||||
extfuncs.h
|
||||
exactrast
|
||||
fbotest1
|
||||
fbotest2
|
||||
fbotexture
|
||||
fillrate
|
||||
floattex
|
||||
fog
|
||||
|
|
@ -40,6 +38,7 @@ fptest1
|
|||
fptexture
|
||||
getprocaddress
|
||||
getproclist.h
|
||||
glutfx
|
||||
interleave
|
||||
invert
|
||||
jkrahntest
|
||||
|
|
@ -49,6 +48,7 @@ mapbufrange
|
|||
mapvbo
|
||||
minmag
|
||||
mipgen
|
||||
mipmap_comp
|
||||
mipmap_limits
|
||||
mipmap_view
|
||||
multipal
|
||||
|
|
@ -56,30 +56,31 @@ no_s3tc
|
|||
packedpixels
|
||||
pbo
|
||||
prog_parameter
|
||||
projtex
|
||||
quads
|
||||
random
|
||||
readrate
|
||||
readtex.c
|
||||
readtex.h
|
||||
rubberband
|
||||
scissor
|
||||
scissor-viewport
|
||||
seccolor
|
||||
sharedtex
|
||||
shader_api
|
||||
shaderutil.c
|
||||
shaderutil.h
|
||||
sharedtex
|
||||
stencil_twoside
|
||||
stencil_wrap
|
||||
stencilwrap
|
||||
stencil_wrap
|
||||
streaming_rect
|
||||
subtex
|
||||
subtexrate
|
||||
tex1d
|
||||
texcmp
|
||||
texcompress2
|
||||
texdown
|
||||
texfilt
|
||||
texgenmix
|
||||
texline
|
||||
texobj
|
||||
texobjshare
|
||||
texrect
|
||||
texwrap
|
||||
|
|
|
|||
|
|
@ -37,19 +37,19 @@ SOURCES = \
|
|||
copypixrate.c \
|
||||
crossbar.c \
|
||||
cva.c \
|
||||
dinoshade.c \
|
||||
drawbuffers.c \
|
||||
exactrast.c \
|
||||
floattex.c \
|
||||
fbotest1.c \
|
||||
fbotest2.c \
|
||||
fbotexture.c \
|
||||
fillrate.c \
|
||||
fog.c \
|
||||
fogcoord.c \
|
||||
fptest1.c \
|
||||
fptexture.c \
|
||||
getprocaddress.c \
|
||||
getteximage.c \
|
||||
glutfx.c \
|
||||
interleave.c \
|
||||
invert.c \
|
||||
jkrahntest.c \
|
||||
|
|
@ -59,6 +59,7 @@ SOURCES = \
|
|||
mapvbo.c \
|
||||
minmag.c \
|
||||
mipgen.c \
|
||||
mipmap_comp.c \
|
||||
mipmap_limits.c \
|
||||
mipmap_view.c \
|
||||
multipal.c \
|
||||
|
|
@ -66,23 +67,27 @@ SOURCES = \
|
|||
packedpixels.c \
|
||||
pbo.c \
|
||||
prog_parameter.c \
|
||||
projtex.c \
|
||||
quads.c \
|
||||
random.c \
|
||||
readrate.c \
|
||||
rubberband.c \
|
||||
scissor.c \
|
||||
scissor-viewport.c \
|
||||
seccolor.c \
|
||||
shader_api.c \
|
||||
sharedtex.c \
|
||||
stencil_twoside.c \
|
||||
stencilwrap.c \
|
||||
stencil_wrap.c \
|
||||
streaming_rect \
|
||||
subtex \
|
||||
subtexrate.c \
|
||||
tex1d.c \
|
||||
texcompress2.c \
|
||||
texdown \
|
||||
texfilt.c \
|
||||
texline.c \
|
||||
texobj.c \
|
||||
texobjshare.c \
|
||||
texrect.c \
|
||||
texwrap.c \
|
||||
|
|
@ -201,10 +206,10 @@ fillrate.o: fillrate.c readtex.h
|
|||
|
||||
|
||||
floattex: floattex.o readtex.o shaderutil.o
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) floattex.o readtex.o shaderutil.o $(LIBS) -o $@
|
||||
$(APP_CC) $(CFLAGS) $(LDFLAGS) floattex.o readtex.o shaderutil.o $(LIBS) -o $@
|
||||
|
||||
floattex.o: floattex.c readtex.h shaderutil.h
|
||||
$(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) floattex.c -o $@
|
||||
$(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) floattex.c -o $@
|
||||
|
||||
|
||||
readtex.o: readtex.c
|
||||
|
|
@ -230,7 +235,7 @@ shaderutil.h: $(TOP)/progs/util/shaderutil.h
|
|||
cp $< .
|
||||
|
||||
shaderutil.o: shaderutil.c shaderutil.h
|
||||
$(CC) -c -I$(INCDIR) $(CFLAGS) shaderutil.c
|
||||
$(APP_CC) -c -I$(INCDIR) $(INCLUDES) $(CFLAGS) shaderutil.c
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -42,8 +42,8 @@ progs = [
|
|||
'arbfptest1',
|
||||
'arbfptexture',
|
||||
'arbfptrig',
|
||||
'arbnpot-mipmap',
|
||||
'arbnpot',
|
||||
'arbnpot-mipmap',
|
||||
'arbvptest1',
|
||||
'arbvptest3',
|
||||
'arbvptorus',
|
||||
|
|
@ -61,19 +61,18 @@ progs = [
|
|||
'copypixrate',
|
||||
'crossbar',
|
||||
'cva',
|
||||
'dinoshade',
|
||||
'drawbuffers',
|
||||
'exactrast',
|
||||
'ext422square',
|
||||
'fbotest1',
|
||||
'fbotest2',
|
||||
'fbotexture',
|
||||
'fillrate',
|
||||
'floattex',
|
||||
'fog',
|
||||
'fogcoord',
|
||||
'fptest1',
|
||||
'fptexture',
|
||||
'glutfx',
|
||||
'interleave',
|
||||
'invert',
|
||||
'lineclip',
|
||||
|
|
@ -82,6 +81,7 @@ progs = [
|
|||
'mapvbo',
|
||||
'minmag',
|
||||
'mipgen',
|
||||
'mipmap_comp',
|
||||
'mipmap_limits',
|
||||
'mipmap_view',
|
||||
'multipal',
|
||||
|
|
@ -91,24 +91,28 @@ progs = [
|
|||
'packedpixels',
|
||||
'pbo',
|
||||
'prog_parameter',
|
||||
'projtex',
|
||||
'quads',
|
||||
'random',
|
||||
'readrate',
|
||||
'rubberband',
|
||||
'scissor',
|
||||
'scissor-viewport',
|
||||
'seccolor',
|
||||
'shader_api',
|
||||
'stencil_twoside',
|
||||
'stencil_wrap',
|
||||
'stencilwrap',
|
||||
'streaming_rect',
|
||||
'subtex',
|
||||
'subtexrate',
|
||||
'tex1d',
|
||||
'texcmp',
|
||||
'texcompress2',
|
||||
'texdown',
|
||||
'texfilt',
|
||||
'texgenmix',
|
||||
'texline',
|
||||
'texobj',
|
||||
'texrect',
|
||||
'texwrap',
|
||||
'unfilledclip',
|
||||
|
|
|
|||
|
|
@ -442,8 +442,8 @@ int main( int argc, char *argv[] )
|
|||
glutInitWindowSize( 300, 300 );
|
||||
glutInitWindowPosition( 0, 0 );
|
||||
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
|
||||
glewInit();
|
||||
glutCreateWindow(argv[0] );
|
||||
glewInit();
|
||||
|
||||
Init( argc, argv );
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
/*
|
||||
* Test floating point textures.
|
||||
* No actual rendering, yet.
|
||||
*/
|
||||
|
||||
|
||||
|
|
@ -103,7 +102,6 @@ Key(unsigned char key, int x, int y)
|
|||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
InitTexture(void)
|
||||
{
|
||||
|
|
@ -141,6 +139,8 @@ InitTexture(void)
|
|||
GL_RGB, GL_FLOAT, ftex);
|
||||
|
||||
|
||||
CheckError(__LINE__);
|
||||
|
||||
/* sanity checks */
|
||||
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_RED_TYPE_ARB, &t);
|
||||
assert(t == GL_FLOAT);
|
||||
|
|
@ -152,32 +152,26 @@ InitTexture(void)
|
|||
assert(t == GL_FLOAT);
|
||||
|
||||
free(image);
|
||||
free(ftex);
|
||||
|
||||
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, filter);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter);
|
||||
|
||||
#if 0
|
||||
/* read back the texture and make sure values are correct */
|
||||
glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_FLOAT, tex2);
|
||||
CheckError(__LINE__);
|
||||
for (i = 0; i < 16; i++) {
|
||||
for (j = 0; j < 16; j++) {
|
||||
if (tex[i][j][0] != tex2[i][j][0] ||
|
||||
tex[i][j][1] != tex2[i][j][1] ||
|
||||
tex[i][j][2] != tex2[i][j][2] ||
|
||||
tex[i][j][3] != tex2[i][j][3]) {
|
||||
printf("tex[%d][%d] %g %g %g %g != tex2[%d][%d] %g %g %g %g\n",
|
||||
i, j,
|
||||
tex[i][j][0], tex[i][j][1], tex[i][j][2], tex[i][j][3],
|
||||
i, j,
|
||||
tex2[i][j][0], tex2[i][j][1], tex2[i][j][2], tex2[i][j][3]);
|
||||
if (1) {
|
||||
/* read back the texture and make sure values are correct */
|
||||
GLfloat *tex2 = (GLfloat *)
|
||||
malloc(imgWidth * imgHeight * 4 * sizeof(GLfloat));
|
||||
glGetTexImage(GL_TEXTURE_2D, 0, imgFormat, GL_FLOAT, tex2);
|
||||
CheckError(__LINE__);
|
||||
for (i = 0; i < imgWidth * imgHeight * 4; i++) {
|
||||
if (ftex[i] != tex2[i]) {
|
||||
printf("tex[%d] %g != tex2[%d] %g\n",
|
||||
i, ftex[i], i, tex2[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
free(ftex);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -193,7 +187,9 @@ CreateProgram(void)
|
|||
|
||||
assert(program);
|
||||
|
||||
// InitUniforms(program, Uniforms);
|
||||
glUseProgram_func(program);
|
||||
|
||||
InitUniforms(program, Uniforms);
|
||||
|
||||
return program;
|
||||
}
|
||||
|
|
@ -211,8 +207,9 @@ Init(void)
|
|||
exit(1);
|
||||
}
|
||||
|
||||
if (!glutExtensionSupported("GL_MESAX_texture_float")) {
|
||||
printf("Sorry, this test requires GL_MESAX_texture_float\n");
|
||||
if (!glutExtensionSupported("GL_MESAX_texture_float") &&
|
||||
!glutExtensionSupported("GL_ARB_texture_float")) {
|
||||
printf("Sorry, this test requires GL_MESAX/ARB_texture_float\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
|
|
|||
217
progs/tests/getteximage.c
Normal file
217
progs/tests/getteximage.c
Normal file
|
|
@ -0,0 +1,217 @@
|
|||
/**
|
||||
* Test glGetTexImage()
|
||||
* Brian Paul
|
||||
* 9 June 2009
|
||||
*/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <GL/glew.h>
|
||||
#include <GL/glut.h>
|
||||
|
||||
static int Win;
|
||||
|
||||
|
||||
static void
|
||||
TestGetTexImage(void)
|
||||
{
|
||||
GLuint iter;
|
||||
GLubyte *data = (GLubyte *) malloc(1024 * 1024 * 4);
|
||||
GLubyte *data2 = (GLubyte *) malloc(1024 * 1024 * 4);
|
||||
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
|
||||
printf("glTexImage2D + glGetTexImage:\n");
|
||||
|
||||
for (iter = 0; iter < 8; iter++) {
|
||||
GLint p = (iter % 8) + 3;
|
||||
GLint w = (1 << p);
|
||||
GLint h = (1 << p);
|
||||
GLuint i;
|
||||
GLint level = 0;
|
||||
|
||||
printf(" Testing %d x %d tex image\n", w, h);
|
||||
|
||||
/* fill data */
|
||||
for (i = 0; i < w * h * 4; i++) {
|
||||
data[i] = i & 0xff;
|
||||
data2[i] = 0;
|
||||
}
|
||||
|
||||
glTexImage2D(GL_TEXTURE_2D, level, GL_RGBA, w, h, 0,
|
||||
GL_RGBA, GL_UNSIGNED_BYTE, data);
|
||||
|
||||
glBegin(GL_POINTS);
|
||||
glVertex2f(0, 0);
|
||||
glEnd();
|
||||
|
||||
/* get */
|
||||
glGetTexImage(GL_TEXTURE_2D, level, GL_RGBA, GL_UNSIGNED_BYTE, data2);
|
||||
|
||||
/* compare */
|
||||
for (i = 0; i < w * h * 4; i++) {
|
||||
if (data2[i] != data[i]) {
|
||||
printf("glTexImage + glGetTexImage failure!\n");
|
||||
printf("Expected value %d, found %d\n", data[i], data2[i]);
|
||||
abort();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
printf("Passed\n");
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
free(data);
|
||||
free(data2);
|
||||
}
|
||||
|
||||
|
||||
static GLboolean
|
||||
ColorsEqual(const GLubyte ref[4], const GLubyte act[4])
|
||||
{
|
||||
if (abs((int) ref[0] - (int) act[0]) > 1 ||
|
||||
abs((int) ref[1] - (int) act[1]) > 1 ||
|
||||
abs((int) ref[2] - (int) act[2]) > 1 ||
|
||||
abs((int) ref[3] - (int) act[3]) > 1) {
|
||||
printf("expected %d %d %d %d\n", ref[0], ref[1], ref[2], ref[3]);
|
||||
printf("found %d %d %d %d\n", act[0], act[1], act[2], act[3]);
|
||||
return GL_FALSE;
|
||||
}
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
TestGetTexImageRTT(void)
|
||||
{
|
||||
GLuint iter;
|
||||
GLuint fb, tex;
|
||||
GLint w = 512;
|
||||
GLint h = 256;
|
||||
GLint level = 0;
|
||||
|
||||
glGenTextures(1, &tex);
|
||||
glGenFramebuffersEXT(1, &fb);
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, tex);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0,
|
||||
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
|
||||
|
||||
glBindFramebuffer(GL_FRAMEBUFFER_EXT, fb);
|
||||
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
|
||||
GL_TEXTURE_2D, tex, level);
|
||||
|
||||
printf("Render to texture + glGetTexImage:\n");
|
||||
printf(" Testing %d x %d tex image\n", w, h);
|
||||
for (iter = 0; iter < 8; iter++) {
|
||||
GLubyte color[4];
|
||||
GLubyte *data2 = (GLubyte *) malloc(w * h * 4);
|
||||
GLuint i;
|
||||
|
||||
/* random clear color */
|
||||
for (i = 0; i < 4; i++) {
|
||||
color[i] = rand() % 256;
|
||||
}
|
||||
|
||||
glClearColor(color[0] / 255.0,
|
||||
color[1] / 255.0,
|
||||
color[2] / 255.0,
|
||||
color[3] / 255.0);
|
||||
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
/* get */
|
||||
glGetTexImage(GL_TEXTURE_2D, level, GL_RGBA, GL_UNSIGNED_BYTE, data2);
|
||||
|
||||
/* compare */
|
||||
for (i = 0; i < w * h; i += 4) {
|
||||
if (!ColorsEqual(color, data2 + i * 4)) {
|
||||
printf("Render to texture failure!\n");
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
||||
free(data2);
|
||||
}
|
||||
|
||||
glBindFramebuffer(GL_FRAMEBUFFER_EXT, 0);
|
||||
glDeleteFramebuffersEXT(1, &fb);
|
||||
glDeleteTextures(1, &tex);
|
||||
|
||||
printf("Passed\n");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
static void
|
||||
Draw(void)
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
TestGetTexImage();
|
||||
|
||||
if (glutExtensionSupported("GL_EXT_framebuffer_object") ||
|
||||
glutExtensionSupported("GL_ARB_framebuffer_object"))
|
||||
TestGetTexImageRTT();
|
||||
|
||||
glutDestroyWindow(Win);
|
||||
exit(0);
|
||||
|
||||
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.0, 0.0, -15.0);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Key(unsigned char key, int x, int y)
|
||||
{
|
||||
(void) x;
|
||||
(void) y;
|
||||
switch (key) {
|
||||
case 27:
|
||||
glutDestroyWindow(Win);
|
||||
exit(0);
|
||||
break;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
Init(void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
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]);
|
||||
glewInit();
|
||||
glutReshapeFunc(Reshape);
|
||||
glutKeyboardFunc(Key);
|
||||
glutDisplayFunc(Draw);
|
||||
Init();
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -45,7 +45,7 @@ int main(int argc, char **argv)
|
|||
|
||||
if (argc < 2) {
|
||||
fprintf(stderr, "This program tests GLX context switching.\n");
|
||||
fprintf(stderr, "Usage: cxbug <n>\n");
|
||||
fprintf(stderr, "Usage: jkrahntest <n>\n");
|
||||
fprintf(stderr, "Where n is:\n");
|
||||
fprintf(stderr, "\t1) Use two contexts and swap only when the context is current (typical case).\n");
|
||||
fprintf(stderr, "\t2) Use two contexts and swap at the same time.\n");
|
||||
|
|
|
|||
295
progs/tests/mipmap_comp.c
Normal file
295
progs/tests/mipmap_comp.c
Normal file
|
|
@ -0,0 +1,295 @@
|
|||
/* Copyright (c) Mark J. Kilgard, 1994. */
|
||||
/*
|
||||
* (c) Copyright 1993, Silicon Graphics, Inc.
|
||||
* ALL RIGHTS RESERVED
|
||||
* Permission to use, copy, modify, and distribute this software for
|
||||
* any purpose and without fee is hereby granted, provided that the above
|
||||
* copyright notice appear in all copies and that both the copyright notice
|
||||
* and this permission notice appear in supporting documentation, and that
|
||||
* the name of Silicon Graphics, Inc. not be used in advertising
|
||||
* or publicity pertaining to distribution of the software without specific,
|
||||
* written prior permission.
|
||||
*
|
||||
* THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
|
||||
* AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
|
||||
* INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
|
||||
* GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
|
||||
* SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
|
||||
* KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
|
||||
* LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
|
||||
* THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
|
||||
* POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*
|
||||
* US Government Users Restricted Rights
|
||||
* Use, duplication, or disclosure by the Government is subject to
|
||||
* restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
|
||||
* (c)(1)(ii) of the Rights in Technical Data and Computer Software
|
||||
* clause at DFARS 252.227-7013 and/or in similar or successor
|
||||
* clauses in the FAR or the DOD or NASA FAR Supplement.
|
||||
* Unpublished-- rights reserved under the copyright laws of the
|
||||
* United States. Contractor/manufacturer is Silicon Graphics,
|
||||
* Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.
|
||||
*
|
||||
* OpenGL(TM) is a trademark of Silicon Graphics, Inc.
|
||||
*/
|
||||
|
||||
/* mipmap_comp
|
||||
* Test compressed texture mipmaps
|
||||
*
|
||||
* Based on mipmap_limits
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <GL/glew.h>
|
||||
#include <GL/glut.h>
|
||||
|
||||
#include "readtex.h"
|
||||
|
||||
#define SIZE 16 /* not larger then 16 */
|
||||
|
||||
static GLint BaseLevel = 0, MaxLevel = 9;
|
||||
static GLfloat MinLod = -1, MaxLod = 9;
|
||||
static GLfloat LodBias = 0.0;
|
||||
static GLboolean NearestFilter = GL_TRUE;
|
||||
static GLuint texImage;
|
||||
|
||||
|
||||
static void
|
||||
initValues(void)
|
||||
{
|
||||
BaseLevel = 0;
|
||||
MaxLevel = 9;
|
||||
MinLod = -1;
|
||||
MaxLod = 2;
|
||||
LodBias = 5.0;
|
||||
NearestFilter = GL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
makeImage(int level, int width, int height)
|
||||
{
|
||||
#if 0
|
||||
GLubyte img[SIZE*SIZE*3];
|
||||
int i, j;
|
||||
|
||||
(void)size;
|
||||
for (i = 0; i < height; i++) {
|
||||
for (j = 0; j < width; j++) {
|
||||
int k = (i * width + j) * 3;
|
||||
img[k + 0] = 255 * ((level + 1) % 2);
|
||||
img[k + 1] = 255 * ((level + 1) % 2);
|
||||
img[k + 2] = 255 * ((level + 1) % 2);
|
||||
}
|
||||
}
|
||||
|
||||
glTexImage2D(GL_TEXTURE_2D, level, GL_COMPRESSED_RGB_S3TC_DXT1_EXT, width, height, 0,
|
||||
GL_RGB, GL_UNSIGNED_BYTE, img);
|
||||
#else
|
||||
GLubyte img[128];
|
||||
GLint size[] = {
|
||||
128, /* 16x16 */
|
||||
32, /* 8x8 */
|
||||
8, /* 4x4 */
|
||||
8, /* 2x2 */
|
||||
8, /* 1x1 */
|
||||
};
|
||||
int i;
|
||||
int value = ((level + 1) % 2) * 0xffffffff;
|
||||
memset(img, 0, 128);
|
||||
|
||||
/* generate black and white mipmap levels */
|
||||
if (value)
|
||||
for (i = 0; i < size[level] / 4; i += 2)
|
||||
((int*)img)[i] = value;
|
||||
|
||||
glCompressedTexImage2D(GL_TEXTURE_2D, level,
|
||||
GL_COMPRESSED_RGB_S3TC_DXT1_EXT,
|
||||
width, height, 0,
|
||||
size[level], img);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
makeImages(void)
|
||||
{
|
||||
int i, sz;
|
||||
|
||||
for (i = 0, sz = SIZE; sz >= 1; i++, sz /= 2) {
|
||||
makeImage(i, sz, sz);
|
||||
printf("Level %d size: %d x %d\n", i, sz, sz);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
myInit(void)
|
||||
{
|
||||
|
||||
initValues();
|
||||
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glDepthFunc(GL_LESS);
|
||||
glShadeModel(GL_FLAT);
|
||||
|
||||
glTranslatef(0.0, 0.0, -3.6);
|
||||
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
glGenTextures(1, &texImage);
|
||||
glBindTexture(GL_TEXTURE_2D, texImage);
|
||||
makeImages();
|
||||
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
display(void)
|
||||
{
|
||||
GLfloat tcm = 1.0;
|
||||
glBindTexture(GL_TEXTURE_2D, texImage);
|
||||
|
||||
printf("BASE_LEVEL=%d MAX_LEVEL=%d MIN_LOD=%.2g MAX_LOD=%.2g Bias=%.2g Filter=%s\n",
|
||||
BaseLevel, MaxLevel, MinLod, MaxLod, LodBias,
|
||||
NearestFilter ? "NEAREST" : "LINEAR");
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, BaseLevel);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, MaxLevel);
|
||||
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_LOD, MinLod);
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, MaxLod);
|
||||
|
||||
if (NearestFilter) {
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
|
||||
GL_NEAREST_MIPMAP_NEAREST);
|
||||
}
|
||||
else {
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
|
||||
GL_LINEAR_MIPMAP_LINEAR);
|
||||
}
|
||||
|
||||
glTexEnvf(GL_TEXTURE_FILTER_CONTROL_EXT, GL_TEXTURE_LOD_BIAS_EXT, LodBias);
|
||||
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
glBegin(GL_QUADS);
|
||||
glTexCoord2f(0.0, 0.0); glVertex3f(-2.0, -1.0, 0.0);
|
||||
glTexCoord2f(0.0, tcm); glVertex3f(-2.0, 1.0, 0.0);
|
||||
glTexCoord2f(tcm * 3000.0, tcm); glVertex3f(3000.0, 1.0, -6000.0);
|
||||
glTexCoord2f(tcm * 3000.0, 0.0); glVertex3f(3000.0, -1.0, -6000.0);
|
||||
glEnd();
|
||||
glFlush();
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
myReshape(int w, int h)
|
||||
{
|
||||
glViewport(0, 0, w, h);
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
gluPerspective(60.0, 1.0*(GLfloat)w/(GLfloat)h, 1.0, 30000.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
key(unsigned char k, int x, int y)
|
||||
{
|
||||
(void) x;
|
||||
(void) y;
|
||||
switch (k) {
|
||||
case 'b':
|
||||
BaseLevel--;
|
||||
if (BaseLevel < 0)
|
||||
BaseLevel = 0;
|
||||
break;
|
||||
case 'B':
|
||||
BaseLevel++;
|
||||
if (BaseLevel > 10)
|
||||
BaseLevel = 10;
|
||||
break;
|
||||
case 'm':
|
||||
MaxLevel--;
|
||||
if (MaxLevel < 0)
|
||||
MaxLevel = 0;
|
||||
break;
|
||||
case 'M':
|
||||
MaxLevel++;
|
||||
if (MaxLevel > 10)
|
||||
MaxLevel = 10;
|
||||
break;
|
||||
case 'l':
|
||||
LodBias -= 0.25;
|
||||
break;
|
||||
case 'L':
|
||||
LodBias += 0.25;
|
||||
break;
|
||||
case 'n':
|
||||
MinLod -= 0.25;
|
||||
break;
|
||||
case 'N':
|
||||
MinLod += 0.25;
|
||||
break;
|
||||
case 'x':
|
||||
MaxLod -= 0.25;
|
||||
break;
|
||||
case 'X':
|
||||
MaxLod += 0.25;
|
||||
break;
|
||||
case 'f':
|
||||
NearestFilter = !NearestFilter;
|
||||
break;
|
||||
case ' ':
|
||||
initValues();
|
||||
break;
|
||||
case 27: /* Escape */
|
||||
exit(0);
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
usage(void)
|
||||
{
|
||||
printf("usage:\n");
|
||||
printf(" b/B decrease/increase GL_TEXTURE_BASE_LEVEL\n");
|
||||
printf(" m/M decrease/increase GL_TEXTURE_MAX_LEVEL\n");
|
||||
printf(" n/N decrease/increase GL_TEXTURE_MIN_LOD\n");
|
||||
printf(" x/X decrease/increase GL_TEXTURE_MAX_LOD\n");
|
||||
printf(" l/L decrease/increase GL_TEXTURE_LOD_BIAS\n");
|
||||
printf(" f toggle nearest/linear filtering\n");
|
||||
printf(" SPACE reset values\n");
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main(int argc, char** argv)
|
||||
{
|
||||
glutInit(&argc, argv);
|
||||
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH);
|
||||
glutInitWindowSize (600, 600);
|
||||
glutCreateWindow (argv[0]);
|
||||
glewInit();
|
||||
myInit();
|
||||
glutReshapeFunc (myReshape);
|
||||
glutDisplayFunc(display);
|
||||
glutKeyboardFunc(key);
|
||||
usage();
|
||||
glutMainLoop();
|
||||
return 0; /* ANSI C requires main to return int. */
|
||||
}
|
||||
|
|
@ -18,11 +18,27 @@
|
|||
|
||||
#define TEXTURE_FILE "../images/arch.rgb"
|
||||
|
||||
static int TexWidth = 256, TexHeight = 256;
|
||||
#define LEVELS 8
|
||||
#define SIZE (1<<LEVELS)
|
||||
static int TexWidth = SIZE, TexHeight = SIZE;
|
||||
static int WinWidth = 1044, WinHeight = 900;
|
||||
static GLfloat Bias = 0.0;
|
||||
static GLboolean ScaleQuads = GL_FALSE;
|
||||
static GLboolean Linear = GL_FALSE;
|
||||
static GLint Win = 0;
|
||||
static GLint RenderTextureLevel = 0;
|
||||
static GLuint TexObj;
|
||||
|
||||
|
||||
|
||||
static void
|
||||
CheckError(int line)
|
||||
{
|
||||
GLenum err = glGetError();
|
||||
if (err) {
|
||||
printf("GL Error 0x%x at line %d\n", (int) err, line);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
@ -36,6 +52,178 @@ PrintString(const char *s)
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
static void
|
||||
MipGenTexture( void )
|
||||
{
|
||||
/* test auto mipmap generation */
|
||||
GLint width, height, i;
|
||||
GLenum format;
|
||||
GLubyte *image = LoadRGBImage(TEXTURE_FILE, &width, &height, &format);
|
||||
if (!image) {
|
||||
printf("Error: could not load texture image %s\n", TEXTURE_FILE);
|
||||
exit(1);
|
||||
}
|
||||
/* resize to TexWidth x TexHeight */
|
||||
if (width != TexWidth || height != TexHeight) {
|
||||
GLubyte *newImage = malloc(TexWidth * TexHeight * 4);
|
||||
|
||||
fprintf(stderr, "rescale %d %d to %d %d\n", width, height,
|
||||
TexWidth, TexHeight);
|
||||
fflush(stderr);
|
||||
|
||||
gluScaleImage(format, width, height, GL_UNSIGNED_BYTE, image,
|
||||
TexWidth, TexHeight, GL_UNSIGNED_BYTE, newImage);
|
||||
free(image);
|
||||
image = newImage;
|
||||
}
|
||||
printf("Using GL_SGIS_generate_mipmap\n");
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_TRUE);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, format, TexWidth, TexHeight, 0,
|
||||
format, GL_UNSIGNED_BYTE, image);
|
||||
free(image);
|
||||
|
||||
/* make sure mipmap was really generated correctly */
|
||||
width = TexWidth;
|
||||
height = TexHeight;
|
||||
for (i = 0; i < 9; i++) {
|
||||
GLint w, h;
|
||||
glGetTexLevelParameteriv(GL_TEXTURE_2D, i, GL_TEXTURE_WIDTH, &w);
|
||||
glGetTexLevelParameteriv(GL_TEXTURE_2D, i, GL_TEXTURE_HEIGHT, &h);
|
||||
printf("Level %d size: %d x %d\n", i, w, h);
|
||||
assert(w == width);
|
||||
assert(h == height);
|
||||
width /= 2;
|
||||
height /= 2;
|
||||
}
|
||||
|
||||
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_FALSE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
ResetTextureLevel( int i )
|
||||
{
|
||||
GLubyte tex2d[SIZE*SIZE][4];
|
||||
|
||||
{
|
||||
GLint Width = TexWidth / (1 << i);
|
||||
GLint Height = TexHeight / (1 << i);
|
||||
GLint s, t;
|
||||
|
||||
for (s = 0; s < Width; s++) {
|
||||
for (t = 0; t < Height; t++) {
|
||||
tex2d[t*Width+s][0] = ((s / 16) % 2) ? 0 : 255;
|
||||
tex2d[t*Width+s][1] = ((t / 16) % 2) ? 0 : 255;
|
||||
tex2d[t*Width+s][2] = 128;
|
||||
tex2d[t*Width+s][3] = 255;
|
||||
}
|
||||
}
|
||||
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
|
||||
glTexImage2D(GL_TEXTURE_2D, i, GL_RGB, Width, Height, 0,
|
||||
GL_RGBA, GL_UNSIGNED_BYTE, tex2d);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
ResetTexture( void )
|
||||
{
|
||||
#if 0
|
||||
/* This doesn't work so well as the arch texture is 512x512.
|
||||
*/
|
||||
LoadRGBMipmaps(TEXTURE_FILE, GL_RGB);
|
||||
#else
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i <= LEVELS; i++)
|
||||
{
|
||||
ResetTextureLevel(i);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
static void
|
||||
RenderTexture( void )
|
||||
{
|
||||
GLenum status;
|
||||
GLuint MyFB;
|
||||
|
||||
fprintf(stderr, "RenderTextureLevel %d\n", RenderTextureLevel);
|
||||
fflush(stderr);
|
||||
|
||||
/* gen framebuffer id, delete it, do some assertions, just for testing */
|
||||
glGenFramebuffersEXT(1, &MyFB);
|
||||
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB);
|
||||
assert(glIsFramebufferEXT(MyFB));
|
||||
|
||||
CheckError(__LINE__);
|
||||
|
||||
/* Render color to texture */
|
||||
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT,
|
||||
GL_COLOR_ATTACHMENT0_EXT,
|
||||
GL_TEXTURE_2D, TexObj,
|
||||
RenderTextureLevel);
|
||||
|
||||
|
||||
|
||||
CheckError(__LINE__);
|
||||
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrtho(-1.0, 1.0, -1.0, 1.0, 5.0, 25.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
glTranslatef(0.0, 0.0, -15.0);
|
||||
|
||||
status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
|
||||
if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
|
||||
printf("Framebuffer incomplete!!!\n");
|
||||
}
|
||||
|
||||
glViewport(0, 0,
|
||||
TexWidth / (1 << RenderTextureLevel),
|
||||
TexHeight / (1 << RenderTextureLevel));
|
||||
|
||||
glClearColor(0.5, 0.5, 1.0, 0.0);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
CheckError(__LINE__);
|
||||
|
||||
glBegin(GL_POLYGON);
|
||||
glColor3f(1, 0, 0);
|
||||
glVertex2f(-1, -1);
|
||||
glColor3f(0, 1, 0);
|
||||
glVertex2f(1, -1);
|
||||
glColor3f(0, 0, 1);
|
||||
glVertex2f(0, 1);
|
||||
glEnd();
|
||||
|
||||
|
||||
/* Bind normal framebuffer */
|
||||
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
|
||||
CheckError(__LINE__);
|
||||
|
||||
glDeleteFramebuffersEXT(1, &MyFB);
|
||||
CheckError(__LINE__);
|
||||
|
||||
glClearColor(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
Display(void)
|
||||
{
|
||||
|
|
@ -43,6 +231,8 @@ Display(void)
|
|||
char str[100];
|
||||
int texWidth = TexWidth, texHeight = TexHeight;
|
||||
|
||||
glViewport(0, 0, WinHeight, WinHeight);
|
||||
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
|
|
@ -53,6 +243,15 @@ Display(void)
|
|||
|
||||
glColor3f(1,1,1);
|
||||
|
||||
if (Linear) {
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
}
|
||||
else {
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
}
|
||||
|
||||
y = WinHeight - 300;
|
||||
x = 4;
|
||||
|
||||
|
|
@ -116,7 +315,6 @@ Reshape(int width, int height)
|
|||
{
|
||||
WinWidth = width;
|
||||
WinHeight = height;
|
||||
glViewport(0, 0, width, height);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -132,6 +330,24 @@ Key(unsigned char key, int x, int y)
|
|||
case 'B':
|
||||
Bias += 10;
|
||||
break;
|
||||
case 'l':
|
||||
Linear = !Linear;
|
||||
break;
|
||||
case 'v':
|
||||
RenderTextureLevel++;
|
||||
break;
|
||||
case 'V':
|
||||
RenderTextureLevel--;
|
||||
break;
|
||||
case 'r':
|
||||
RenderTexture();
|
||||
break;
|
||||
case 'X':
|
||||
ResetTexture();
|
||||
break;
|
||||
case 'x':
|
||||
ResetTextureLevel(RenderTextureLevel);
|
||||
break;
|
||||
case '0':
|
||||
case '1':
|
||||
case '2':
|
||||
|
|
@ -147,6 +363,14 @@ Key(unsigned char key, int x, int y)
|
|||
case 's':
|
||||
ScaleQuads = !ScaleQuads;
|
||||
break;
|
||||
case ' ':
|
||||
MipGenTexture();
|
||||
Bias = 0;
|
||||
Linear = 0;
|
||||
RenderTextureLevel = 0;
|
||||
ScaleQuads = 0;
|
||||
break;
|
||||
|
||||
case 27:
|
||||
glutDestroyWindow(Win);
|
||||
exit(0);
|
||||
|
|
@ -173,57 +397,15 @@ Init(void)
|
|||
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
|
||||
if (1) {
|
||||
/* test auto mipmap generation */
|
||||
GLint width, height, i;
|
||||
GLenum format;
|
||||
GLubyte *image = LoadRGBImage(TEXTURE_FILE, &width, &height, &format);
|
||||
if (!image) {
|
||||
printf("Error: could not load texture image %s\n", TEXTURE_FILE);
|
||||
exit(1);
|
||||
}
|
||||
/* resize to TexWidth x TexHeight */
|
||||
if (width != TexWidth || height != TexHeight) {
|
||||
GLubyte *newImage = malloc(TexWidth * TexHeight * 4);
|
||||
gluScaleImage(format, width, height, GL_UNSIGNED_BYTE, image,
|
||||
TexWidth, TexHeight, GL_UNSIGNED_BYTE, newImage);
|
||||
free(image);
|
||||
image = newImage;
|
||||
}
|
||||
printf("Using GL_SGIS_generate_mipmap\n");
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_TRUE);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, format, TexWidth, TexHeight, 0,
|
||||
format, GL_UNSIGNED_BYTE, image);
|
||||
free(image);
|
||||
|
||||
/* make sure mipmap was really generated correctly */
|
||||
width = TexWidth;
|
||||
height = TexHeight;
|
||||
for (i = 0; i < 9; i++) {
|
||||
GLint w, h;
|
||||
glGetTexLevelParameteriv(GL_TEXTURE_2D, i, GL_TEXTURE_WIDTH, &w);
|
||||
glGetTexLevelParameteriv(GL_TEXTURE_2D, i, GL_TEXTURE_HEIGHT, &h);
|
||||
printf("Level %d size: %d x %d\n", i, w, h);
|
||||
assert(w == width);
|
||||
assert(h == height);
|
||||
width /= 2;
|
||||
height /= 2;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (LoadRGBMipmaps(TEXTURE_FILE, GL_RGB)) {
|
||||
printf("Using gluBuildMipmaps()\n");
|
||||
}
|
||||
else {
|
||||
printf("Error: could not load texture image %s\n", TEXTURE_FILE);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
glGenTextures(1, &TexObj);
|
||||
glBindTexture(GL_TEXTURE_2D, TexObj);
|
||||
|
||||
if (1)
|
||||
MipGenTexture();
|
||||
else
|
||||
ResetTexture();
|
||||
|
||||
/* mipmapping required for this extension */
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
|
||||
glGetFloatv(GL_MAX_TEXTURE_LOD_BIAS_EXT, &maxBias);
|
||||
|
|
|
|||
138
progs/tests/scissor-viewport.c
Normal file
138
progs/tests/scissor-viewport.c
Normal file
|
|
@ -0,0 +1,138 @@
|
|||
/*
|
||||
* Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
|
||||
* Copyright (c) 2009 VMware, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and
|
||||
* its documentation for any purpose is hereby granted without fee, provided
|
||||
* that (i) the above copyright notices and this permission notice appear in
|
||||
* all copies of the software and related documentation, and (ii) the name of
|
||||
* Silicon Graphics may not be used in any advertising or
|
||||
* publicity relating to the software without the specific, prior written
|
||||
* permission of Silicon Graphics.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
|
||||
* ANY KIND,
|
||||
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
|
||||
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
|
||||
* ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
|
||||
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
||||
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
|
||||
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
||||
* OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <GL/glut.h>
|
||||
|
||||
struct program
|
||||
{
|
||||
unsigned width;
|
||||
unsigned height;
|
||||
int i;
|
||||
};
|
||||
|
||||
struct program prog;
|
||||
|
||||
static void init(void)
|
||||
{
|
||||
fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
|
||||
fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
|
||||
fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
|
||||
fflush(stderr);
|
||||
|
||||
prog.i = 0;
|
||||
}
|
||||
|
||||
static void reshape(int width, int height)
|
||||
{
|
||||
glViewport(0, 0, 100, 100);
|
||||
|
||||
prog.width = width;
|
||||
prog.height = height;
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
}
|
||||
|
||||
static void key(unsigned char key, int x, int y)
|
||||
{
|
||||
|
||||
switch (key) {
|
||||
case 27:
|
||||
exit(1);
|
||||
default:
|
||||
glutPostRedisplay();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
static void drawQuad(void)
|
||||
{
|
||||
glBegin(GL_QUADS);
|
||||
glVertex2d(-1.0, -1.0);
|
||||
glVertex2d( 1.0, -1.0);
|
||||
glVertex2d( 1.0, 1.0);
|
||||
glVertex2d(-1.0, 1.0);
|
||||
glEnd();
|
||||
}
|
||||
|
||||
static void draw(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
glClearColor(0.0, 0.0, 1.0, 0.0);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
i = prog.i++;
|
||||
if (prog.i >= 3)
|
||||
prog.i = 0;
|
||||
|
||||
glEnable(GL_SCISSOR_TEST);
|
||||
|
||||
{
|
||||
glColor4d(1.0, 0.0, 0.0, 1.0);
|
||||
|
||||
glScissor(i, i, 10 - 2*i, 10 - 2*i);
|
||||
drawQuad();
|
||||
}
|
||||
|
||||
glDisable(GL_SCISSOR_TEST);
|
||||
|
||||
//glutSwapBuffers();
|
||||
glFlush();
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
GLenum type;
|
||||
|
||||
glutInit(&argc, argv);
|
||||
|
||||
prog.width = 200;
|
||||
prog.height = 200;
|
||||
|
||||
glutInitWindowPosition(100, 0);
|
||||
glutInitWindowSize(prog.width, prog.height);
|
||||
|
||||
//type = GLUT_RGB | GLUT_DOUBLE;
|
||||
type = GLUT_RGB | GLUT_SINGLE;
|
||||
glutInitDisplayMode(type);
|
||||
|
||||
if (glutCreateWindow(*argv) == GL_FALSE) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
init();
|
||||
|
||||
glutReshapeFunc(reshape);
|
||||
glutKeyboardFunc(key);
|
||||
glutDisplayFunc(draw);
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
||||
168
progs/tests/scissor.c
Normal file
168
progs/tests/scissor.c
Normal file
|
|
@ -0,0 +1,168 @@
|
|||
/*
|
||||
* Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
|
||||
* Copyright (c) 2009 VMware, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and
|
||||
* its documentation for any purpose is hereby granted without fee, provided
|
||||
* that (i) the above copyright notices and this permission notice appear in
|
||||
* all copies of the software and related documentation, and (ii) the name of
|
||||
* Silicon Graphics may not be used in any advertising or
|
||||
* publicity relating to the software without the specific, prior written
|
||||
* permission of Silicon Graphics.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
|
||||
* ANY KIND,
|
||||
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
|
||||
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
|
||||
* ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
|
||||
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
||||
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
|
||||
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
||||
* OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <GL/glut.h>
|
||||
|
||||
struct program
|
||||
{
|
||||
unsigned width;
|
||||
unsigned height;
|
||||
unsigned quads;
|
||||
};
|
||||
|
||||
struct program prog;
|
||||
|
||||
static void init(void)
|
||||
{
|
||||
fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
|
||||
fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
|
||||
fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
|
||||
fflush(stderr);
|
||||
}
|
||||
|
||||
static void reshape(int width, int height)
|
||||
{
|
||||
|
||||
glViewport(0, 0, (GLint)width, (GLint)height);
|
||||
|
||||
prog.width = width;
|
||||
prog.height = height;
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
}
|
||||
|
||||
static void key(unsigned char key, int x, int y)
|
||||
{
|
||||
|
||||
switch (key) {
|
||||
case 27:
|
||||
exit(1);
|
||||
default:
|
||||
prog.quads = !prog.quads;
|
||||
glutPostRedisplay();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
static void drawQuad(void)
|
||||
{
|
||||
|
||||
if (prog.quads) {
|
||||
glBegin(GL_QUADS);
|
||||
glVertex2d(-1.0, -1.0);
|
||||
glVertex2d( 1.0, -1.0);
|
||||
glVertex2d( 1.0, 1.0);
|
||||
glVertex2d(-1.0, 1.0);
|
||||
glEnd();
|
||||
} else {
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
}
|
||||
}
|
||||
|
||||
static void draw(void)
|
||||
{
|
||||
glClearColor(0.0, 0.0, 1.0, 0.0);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
printf("drawing with %s\n", prog.quads ? "quads" : "clears");
|
||||
|
||||
glEnable(GL_SCISSOR_TEST);
|
||||
|
||||
{
|
||||
glClearColor(1.0, 0.0, 0.0, 1.0);
|
||||
glColor4d(1.0, 0.0, 0.0, 1.0);
|
||||
|
||||
glScissor(1, 1, 10, 10);
|
||||
drawQuad();
|
||||
glScissor(1, prog.height - 11, 10, 10);
|
||||
drawQuad();
|
||||
glScissor(prog.width - 11, prog.height - 11, 10, 10);
|
||||
drawQuad();
|
||||
}
|
||||
|
||||
{
|
||||
glClearColor(0.0, 1.0, 0.0, 1.0);
|
||||
glColor4d(0.0, 1.0, 0.0, 1.0);
|
||||
|
||||
glScissor(12, 1, 10, 10);
|
||||
drawQuad();
|
||||
glScissor(12, prog.height - 11, 10, 10);
|
||||
drawQuad();
|
||||
glScissor(prog.width - 22, prog.height - 11, 10, 10);
|
||||
drawQuad();
|
||||
}
|
||||
|
||||
{
|
||||
glClearColor(1.0, 1.0, 0.0, 1.0);
|
||||
glColor4d(1.0, 1.0, 0.0, 1.0);
|
||||
|
||||
glScissor(1, 12, 10, 10);
|
||||
drawQuad();
|
||||
glScissor(1, prog.height - 22, 10, 10);
|
||||
drawQuad();
|
||||
glScissor(prog.width - 11, prog.height - 22, 10, 10);
|
||||
drawQuad();
|
||||
}
|
||||
|
||||
glDisable(GL_SCISSOR_TEST);
|
||||
|
||||
//glutSwapBuffers();
|
||||
glFlush();
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
GLenum type;
|
||||
|
||||
glutInit(&argc, argv);
|
||||
|
||||
prog.width = 200;
|
||||
prog.height = 200;
|
||||
|
||||
glutInitWindowPosition(100, 0);
|
||||
glutInitWindowSize(prog.width, prog.height);
|
||||
|
||||
//type = GLUT_RGB | GLUT_DOUBLE;
|
||||
type = GLUT_RGB | GLUT_SINGLE;
|
||||
glutInitDisplayMode(type);
|
||||
|
||||
if (glutCreateWindow(*argv) == GL_FALSE) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
init();
|
||||
|
||||
glutReshapeFunc(reshape);
|
||||
glutKeyboardFunc(key);
|
||||
glutDisplayFunc(draw);
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -321,10 +321,18 @@ static void run_test(const char *name, void (*callback)(void))
|
|||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
const char *version;
|
||||
|
||||
glutInit(&argc, argv);
|
||||
glutCreateWindow("Mesa bug demo");
|
||||
glewInit();
|
||||
|
||||
version = (const char *) glGetString(GL_VERSION);
|
||||
if (version[0] == '1') {
|
||||
printf("Sorry, this test requires OpenGL 2.x GLSL support\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
RUN_TEST(test_uniform_size_type);
|
||||
RUN_TEST(test_attrib_size_type);
|
||||
RUN_TEST(test_uniform_array_overflow);
|
||||
|
|
|
|||
|
|
@ -51,7 +51,6 @@ TestSubTex(void)
|
|||
GLboolean all = 0*GL_TRUE;
|
||||
GLubyte *buffer;
|
||||
GLint size, fmt;
|
||||
int i;
|
||||
|
||||
glGetTexLevelParameteriv(Target, 0,
|
||||
GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB, &size);
|
||||
|
|
@ -82,6 +81,23 @@ TestSubTex(void)
|
|||
}
|
||||
|
||||
|
||||
static void
|
||||
TestGetTex(void)
|
||||
{
|
||||
GLubyte *buffer;
|
||||
|
||||
buffer = (GLubyte *) malloc(3 * ImgWidth * ImgHeight);
|
||||
|
||||
glGetTexImage(GL_TEXTURE_2D,
|
||||
0,
|
||||
GL_RGB,
|
||||
GL_UNSIGNED_BYTE,
|
||||
buffer);
|
||||
|
||||
free(buffer);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
LoadCompressedImage(const char *file)
|
||||
{
|
||||
|
|
@ -146,7 +162,10 @@ LoadCompressedImage(const char *file)
|
|||
glTexParameteri(Target, GL_TEXTURE_MIN_FILTER, filter);
|
||||
glTexParameteri(Target, GL_TEXTURE_MAG_FILTER, filter);
|
||||
|
||||
TestSubTex();
|
||||
if (0)
|
||||
TestSubTex();
|
||||
else
|
||||
TestGetTex();
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -280,9 +280,9 @@ int main(int argc, char **argv)
|
|||
glutInitWindowPosition(0, 0);
|
||||
glutInitWindowSize(400, 400);
|
||||
if (glutCreateWindow("Isosurface") <= 0) {
|
||||
glewInit();
|
||||
exit(0);
|
||||
}
|
||||
glewInit();
|
||||
glutReshapeFunc(Reshape);
|
||||
glutKeyboardFunc(Key);
|
||||
glutSpecialFunc(SpecialKey);
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ static void Init( void )
|
|||
glLoadProgramNV(GL_VERTEX_PROGRAM_NV, 1,
|
||||
strlen(prog1),
|
||||
(const GLubyte *) prog1);
|
||||
assert(!glIsProgramNV(1));
|
||||
assert(glIsProgramNV(1));
|
||||
|
||||
glLoadProgramNV(GL_VERTEX_PROGRAM_NV, 2,
|
||||
strlen(prog2),
|
||||
|
|
|
|||
3
progs/trivial/.gitignore
vendored
3
progs/trivial/.gitignore
vendored
|
|
@ -19,6 +19,7 @@ fs-tri
|
|||
line
|
||||
line-clip
|
||||
line-cull
|
||||
line-flat
|
||||
line-smooth
|
||||
line-stipple-wide
|
||||
line-userclip
|
||||
|
|
@ -130,6 +131,7 @@ tristrip-flat
|
|||
vbo-drawarrays
|
||||
vbo-drawelements
|
||||
vbo-drawrange
|
||||
vbo-noninterleaved
|
||||
vp-array
|
||||
vp-array-int
|
||||
vp-clip
|
||||
|
|
@ -139,6 +141,7 @@ vp-tri-cb
|
|||
vp-tri-cb-pos
|
||||
vp-tri-cb-tex
|
||||
vp-tri-imm
|
||||
vp-tri-invariant
|
||||
vp-tri-swap
|
||||
vp-tri-tex
|
||||
vp-unfilled
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ SOURCES = \
|
|||
fs-tri.c \
|
||||
line-clip.c \
|
||||
line-cull.c \
|
||||
line-flat.c \
|
||||
line-smooth.c \
|
||||
line-stipple-wide.c \
|
||||
line-userclip-clip.c \
|
||||
|
|
@ -138,6 +139,7 @@ SOURCES = \
|
|||
tristrip-flat.c \
|
||||
tristrip.c \
|
||||
vbo-drawarrays.c \
|
||||
vbo-noninterleaved.c \
|
||||
vbo-drawelements.c \
|
||||
vbo-drawrange.c \
|
||||
vp-array.c \
|
||||
|
|
@ -145,6 +147,7 @@ SOURCES = \
|
|||
vp-clip.c \
|
||||
vp-line-clip.c \
|
||||
vp-tri.c \
|
||||
vp-tri-invariant.c \
|
||||
vp-tri-swap.c \
|
||||
vp-tri-tex.c \
|
||||
vp-tri-imm.c \
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ progs = [
|
|||
'fs-tri',
|
||||
'line-clip',
|
||||
'line-cull',
|
||||
'line-flat',
|
||||
'line-smooth',
|
||||
'line-stipple-wide',
|
||||
'line-userclip-clip',
|
||||
|
|
@ -134,6 +135,7 @@ progs = [
|
|||
'tristrip-flat',
|
||||
'tristrip',
|
||||
'vbo-drawarrays',
|
||||
'vbo-noninterleaved',
|
||||
'vbo-drawelements',
|
||||
'vbo-drawrange',
|
||||
'vp-array',
|
||||
|
|
@ -141,6 +143,7 @@ progs = [
|
|||
'vp-clip',
|
||||
'vp-line-clip',
|
||||
'vp-tri',
|
||||
'vp-tri-invariant',
|
||||
'vp-tri-swap',
|
||||
'vp-tri-tex',
|
||||
'vp-tri-imm',
|
||||
|
|
|
|||
147
progs/trivial/line-flat.c
Normal file
147
progs/trivial/line-flat.c
Normal file
|
|
@ -0,0 +1,147 @@
|
|||
/*
|
||||
* Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and
|
||||
* its documentation for any purpose is hereby granted without fee, provided
|
||||
* that (i) the above copyright notices and this permission notice appear in
|
||||
* all copies of the software and related documentation, and (ii) the name of
|
||||
* Silicon Graphics may not be used in any advertising or
|
||||
* publicity relating to the software without the specific, prior written
|
||||
* permission of Silicon Graphics.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
|
||||
* ANY KIND,
|
||||
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
|
||||
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
|
||||
* ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
|
||||
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
||||
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
|
||||
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
||||
* OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <GL/glut.h>
|
||||
|
||||
|
||||
#define CI_OFFSET_1 16
|
||||
#define CI_OFFSET_2 32
|
||||
|
||||
|
||||
GLenum doubleBuffer;
|
||||
|
||||
static void Init(void)
|
||||
{
|
||||
fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
|
||||
fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
|
||||
fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
|
||||
fflush(stderr);
|
||||
|
||||
glClearColor(0.0, 0.0, 1.0, 0.0);
|
||||
}
|
||||
|
||||
static void Reshape(int width, int height)
|
||||
{
|
||||
|
||||
glViewport(0, 0, (GLint)width, (GLint)height);
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
}
|
||||
|
||||
static void Key(unsigned char key, int x, int y)
|
||||
{
|
||||
|
||||
switch (key) {
|
||||
case 27:
|
||||
exit(1);
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
static void Draw(void)
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
glShadeModel(GL_FLAT);
|
||||
|
||||
glBegin(GL_LINES);
|
||||
glColor3f(0,0,.7);
|
||||
glVertex3f( 0.9, -0.9, -30.0);
|
||||
glColor3f(.8,0,0);
|
||||
glVertex3f( 0.9, 0.9, -30.0);
|
||||
|
||||
glColor3f(.8,0,0);
|
||||
glVertex3f( 0.9, 0.9, -30.0);
|
||||
glColor3f(0,.9,0);
|
||||
glVertex3f(-0.9, 0.0, -30.0);
|
||||
|
||||
|
||||
glColor3f(0,.9,0);
|
||||
glVertex3f(-0.9, 0.0, -30.0);
|
||||
glColor3f(0,0,.7);
|
||||
glVertex3f( 0.9, -0.9, -30.0);
|
||||
glEnd();
|
||||
|
||||
glFlush();
|
||||
|
||||
if (doubleBuffer) {
|
||||
glutSwapBuffers();
|
||||
}
|
||||
}
|
||||
|
||||
static GLenum Args(int argc, char **argv)
|
||||
{
|
||||
GLint i;
|
||||
|
||||
doubleBuffer = GL_FALSE;
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
if (strcmp(argv[i], "-sb") == 0) {
|
||||
doubleBuffer = GL_FALSE;
|
||||
} else if (strcmp(argv[i], "-db") == 0) {
|
||||
doubleBuffer = GL_TRUE;
|
||||
} else {
|
||||
fprintf(stderr, "%s (Bad option).\n", argv[i]);
|
||||
return GL_FALSE;
|
||||
}
|
||||
}
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
GLenum type;
|
||||
|
||||
glutInit(&argc, argv);
|
||||
|
||||
if (Args(argc, argv) == GL_FALSE) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
|
||||
|
||||
type = GLUT_RGB;
|
||||
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
|
||||
glutInitDisplayMode(type);
|
||||
|
||||
if (glutCreateWindow(*argv) == GL_FALSE) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
Init();
|
||||
|
||||
glutReshapeFunc(Reshape);
|
||||
glutKeyboardFunc(Key);
|
||||
glutDisplayFunc(Draw);
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -29,6 +29,20 @@
|
|||
|
||||
GLenum doubleBuffer = 1;
|
||||
int win;
|
||||
static float tx = 0;
|
||||
static float ty = 0;
|
||||
static float tw = 0;
|
||||
static float th = 0;
|
||||
static float z = -5;
|
||||
|
||||
|
||||
static float win_width = 250;
|
||||
static float win_height = 250;
|
||||
static enum {
|
||||
ORTHO,
|
||||
FRUSTUM,
|
||||
MODE_MAX
|
||||
} mode = ORTHO;
|
||||
|
||||
static void Init(void)
|
||||
{
|
||||
|
|
@ -37,44 +51,195 @@ static void Init(void)
|
|||
fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
|
||||
fflush(stderr);
|
||||
|
||||
glClearColor(0.3, 0.1, 0.3, 0.0);
|
||||
glClearColor(0, 0, 0, 0.0);
|
||||
}
|
||||
|
||||
static void Reshape(int width, int height)
|
||||
{
|
||||
glViewport(width / -2.0, height / -2.0, width, height);
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
win_width = width;
|
||||
win_height = height;
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
static void Key(unsigned char key, int x, int y)
|
||||
{
|
||||
switch (key) {
|
||||
case 27:
|
||||
exit(0);
|
||||
default:
|
||||
glutPostRedisplay();
|
||||
return;
|
||||
case 27:
|
||||
exit(0);
|
||||
case 'w':
|
||||
tw += 1.0;
|
||||
break;
|
||||
case 'W':
|
||||
tw -= 1.0;
|
||||
break;
|
||||
case 'h':
|
||||
th += 1.0;
|
||||
break;
|
||||
case 'H':
|
||||
th -= 1.0;
|
||||
break;
|
||||
|
||||
case 'z':
|
||||
z += 1.0;
|
||||
break;
|
||||
case 'Z':
|
||||
z -= 1.0;
|
||||
break;
|
||||
case 'm':
|
||||
mode++;
|
||||
mode %= MODE_MAX;
|
||||
break;
|
||||
case ' ':
|
||||
tw = th = tx = ty = 0;
|
||||
z = -5;
|
||||
mode = ORTHO;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
static void Draw(void)
|
||||
{
|
||||
int i;
|
||||
float w = tw + win_width;
|
||||
float h = th + win_height;
|
||||
|
||||
fprintf(stderr, "glViewport(%f %f %f %f)\n", tx, ty, w, h);
|
||||
fprintf(stderr, "mode: %s\n", mode == FRUSTUM ? "FRUSTUM" : "ORTHO");
|
||||
fprintf(stderr, "z: %f\n", z);
|
||||
fflush(stderr);
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
|
||||
switch (mode) {
|
||||
case FRUSTUM:
|
||||
glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0, 25.0);
|
||||
break;
|
||||
case ORTHO:
|
||||
default:
|
||||
glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
|
||||
break;
|
||||
}
|
||||
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
|
||||
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
glBegin(GL_TRIANGLES);
|
||||
glColor3f(.8,0,0);
|
||||
glVertex3f(-0.9, 0.9, -30.0);
|
||||
glColor3f(0,.9,0);
|
||||
glVertex3f( 0.9, 0.9, -30.0);
|
||||
glColor3f(0,0,.7);
|
||||
glVertex3f( 0.0, -0.9, -30.0);
|
||||
|
||||
/***********************************************************************
|
||||
* Should be clipped to be no larger than the triangles:
|
||||
*/
|
||||
glViewport(tx, ty, w, h);
|
||||
|
||||
glBegin(GL_POLYGON);
|
||||
glColor3f(1,1,0);
|
||||
glVertex3f(-100, -100, z);
|
||||
glVertex3f(-100, 100, z);
|
||||
glVertex3f(100, 100, z);
|
||||
glVertex3f(100, -100, z);
|
||||
glEnd();
|
||||
|
||||
glBegin(GL_POLYGON);
|
||||
glColor3f(0,1,1);
|
||||
glVertex3f(-10, -10, z);
|
||||
glVertex3f(-10, 10, z);
|
||||
glVertex3f(10, 10, z);
|
||||
glVertex3f(10, -10, z);
|
||||
glEnd();
|
||||
|
||||
glBegin(GL_POLYGON);
|
||||
glColor3f(1,0,0);
|
||||
glVertex3f(-2, -2, z);
|
||||
glVertex3f(-2, 2, z);
|
||||
glVertex3f(2, 2, z);
|
||||
glVertex3f(2, -2, z);
|
||||
glEnd();
|
||||
|
||||
|
||||
glBegin(GL_POLYGON);
|
||||
glColor3f(.5,.5,1);
|
||||
glVertex3f(-1, -1, z);
|
||||
glVertex3f(-1, 1, z);
|
||||
glVertex3f(1, 1, z);
|
||||
glVertex3f(1, -1, z);
|
||||
glEnd();
|
||||
|
||||
/***********************************************************************
|
||||
*/
|
||||
glViewport(0, 0, win_width, win_height);
|
||||
glBegin(GL_LINES);
|
||||
glColor3f(1,1,0);
|
||||
glVertex3f(-1, 0, z);
|
||||
glVertex3f(1, 0, z);
|
||||
|
||||
glVertex3f(0, -1, z);
|
||||
glVertex3f(0, 1, z);
|
||||
glEnd();
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
*/
|
||||
glViewport(tx, ty, w, h);
|
||||
glBegin(GL_TRIANGLES);
|
||||
glColor3f(1,0,0);
|
||||
glVertex3f(-1, -1, z);
|
||||
glVertex3f(0, -1, z);
|
||||
glVertex3f(-.5, -.5, z);
|
||||
|
||||
glColor3f(1,1,1);
|
||||
glVertex3f(0, -1, z);
|
||||
glVertex3f(1, -1, z);
|
||||
glVertex3f(.5, -.5, z);
|
||||
|
||||
glVertex3f(-.5, -.5, z);
|
||||
glVertex3f(.5, -.5, z);
|
||||
glVertex3f(0, 0, z);
|
||||
|
||||
|
||||
glColor3f(0,1,0);
|
||||
glVertex3f(1, 1, z);
|
||||
glVertex3f(0, 1, z);
|
||||
glVertex3f(.5, .5, z);
|
||||
|
||||
glColor3f(1,1,1);
|
||||
glVertex3f(0, 1, z);
|
||||
glVertex3f(-1, 1, z);
|
||||
glVertex3f(-.5, .5, z);
|
||||
|
||||
glVertex3f(.5, .5, z);
|
||||
glVertex3f(-.5, .5, z);
|
||||
glVertex3f( 0, 0, z);
|
||||
|
||||
glEnd();
|
||||
|
||||
|
||||
glViewport(0, 0, win_width, win_height);
|
||||
|
||||
glBegin(GL_LINES);
|
||||
glColor3f(.5,.5,0);
|
||||
for (i = -10; i < 10; i++) {
|
||||
float f = i / 10.0;
|
||||
|
||||
if (i == 0)
|
||||
continue;
|
||||
|
||||
glVertex3f(-1, f, z);
|
||||
glVertex3f(1, f, z);
|
||||
|
||||
glVertex3f(f, -1, z);
|
||||
glVertex3f(f, 1, z);
|
||||
}
|
||||
glEnd();
|
||||
|
||||
|
||||
|
||||
glFlush();
|
||||
|
||||
if (doubleBuffer) {
|
||||
|
|
@ -86,6 +251,13 @@ static GLenum Args(int argc, char **argv)
|
|||
{
|
||||
GLint i;
|
||||
|
||||
if (getenv("VPX"))
|
||||
tx = atof(getenv("VPX"));
|
||||
|
||||
if (getenv("VPY"))
|
||||
ty = atof(getenv("VPY"));
|
||||
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
if (strcmp(argv[i], "-sb") == 0) {
|
||||
doubleBuffer = GL_FALSE;
|
||||
|
|
@ -99,6 +271,30 @@ static GLenum Args(int argc, char **argv)
|
|||
return GL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
special(int k, int x, int y)
|
||||
{
|
||||
switch (k) {
|
||||
case GLUT_KEY_UP:
|
||||
ty += 1.0;
|
||||
break;
|
||||
case GLUT_KEY_DOWN:
|
||||
ty -= 1.0;
|
||||
break;
|
||||
case GLUT_KEY_LEFT:
|
||||
tx -= 1.0;
|
||||
break;
|
||||
case GLUT_KEY_RIGHT:
|
||||
tx += 1.0;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
GLenum type;
|
||||
|
|
@ -123,7 +319,8 @@ int main(int argc, char **argv)
|
|||
Init();
|
||||
|
||||
glutReshapeFunc(Reshape);
|
||||
glutKeyboardFunc(Key);
|
||||
glutKeyboardFunc(Key);
|
||||
glutSpecialFunc(special);
|
||||
glutDisplayFunc(Draw);
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -57,13 +57,19 @@ static struct { GLenum func; const char *str; } funcs[] =
|
|||
|
||||
static int curFunc = 0;
|
||||
static double clearVal = 1.0;
|
||||
|
||||
static float minZ = 0.0;
|
||||
static float maxZ = 1.0;
|
||||
|
||||
static void usage(void)
|
||||
{
|
||||
printf("t - toggle rendering order of triangles\n");
|
||||
printf("c - toggle Z clear value between 0, 1\n");
|
||||
printf("f - cycle through depth test functions\n");
|
||||
printf("t - toggle rendering order of triangles\n");
|
||||
printf("c - toggle Z clear value between 0, 1\n");
|
||||
printf("f - cycle through depth test functions\n");
|
||||
printf("n/N - decrease/increase depthrange minZ\n");
|
||||
printf("x/X - decrease/increase depthrange maxZ\n");
|
||||
printf("spc - reset\n");
|
||||
printf("z - set to reverse-direction (ztrick) mode\n");
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -97,9 +103,11 @@ static void drawRightTriangle(void)
|
|||
|
||||
void display(void)
|
||||
{
|
||||
printf("GL_CLEAR_DEPTH = %f GL_DEPTH_FUNC = %s\n",
|
||||
clearVal, funcs[curFunc].str);
|
||||
printf("GL_CLEAR_DEPTH = %.2f, GL_DEPTH_FUNC = %s, DepthRange(%.1f, %.1f)\n",
|
||||
clearVal, funcs[curFunc].str, minZ, maxZ);
|
||||
fflush(stdout);
|
||||
glClearDepth(clearVal);
|
||||
glDepthRange(minZ, maxZ);
|
||||
glDepthFunc(funcs[curFunc].func);
|
||||
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
|
@ -131,27 +139,49 @@ void reshape(int w, int h)
|
|||
void keyboard(unsigned char key, int x, int y)
|
||||
{
|
||||
switch (key) {
|
||||
case 'n':
|
||||
minZ -= .1;
|
||||
break;
|
||||
case 'N':
|
||||
minZ += .1;
|
||||
break;
|
||||
case 'x':
|
||||
maxZ -= .1;
|
||||
break;
|
||||
case 'X':
|
||||
maxZ += .1;
|
||||
break;
|
||||
case 'c':
|
||||
case 'C':
|
||||
clearVal = 1.0 - clearVal;
|
||||
glutPostRedisplay();
|
||||
break;
|
||||
case 'f':
|
||||
case 'F':
|
||||
curFunc = (curFunc + 1) % NUM_FUNCS;
|
||||
glutPostRedisplay();
|
||||
break;
|
||||
case 't':
|
||||
case 'T':
|
||||
leftFirst = !leftFirst;
|
||||
glutPostRedisplay();
|
||||
break;
|
||||
case ' ':
|
||||
curFunc = 0;
|
||||
clearVal = 1.0;
|
||||
minZ = 0.0;
|
||||
maxZ = 1.0;
|
||||
break;
|
||||
case 'z':
|
||||
curFunc = 2;
|
||||
clearVal = 0.0;
|
||||
minZ = 1.0;
|
||||
maxZ = 0.0;
|
||||
break;
|
||||
case 27: /* Escape key */
|
||||
exit(0);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
return;
|
||||
}
|
||||
glutPostRedisplay();
|
||||
}
|
||||
|
||||
/* Main Loop
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue