Compare commits

..

1 Commits

Author SHA1 Message Date
Nicolai Haehnle
20330f422f import r300_driver 2004-09-28 10:59:23 +00:00
575 changed files with 41382 additions and 70987 deletions

View File

@@ -25,10 +25,6 @@ realclean:
$(MAKE) clean
-rm -rf lib*
-rm -f $(TOP)/configs/current
-rm -f `find . -name \*.o`
-rm -f `find . -name \*.a`
-rm -f `find . -name \*.so`
install:
@@ -49,22 +45,17 @@ $(TOP)/configs/current:
# Rules to set/install a specific build configuration
aix \
aix-64 \
aix-gcc \
aix-static \
beos \
darwin \
darwin-static \
freebsd \
freebsd-dri \
freebsd-dri-x86 \
hpux10 \
hpux10-gcc \
hpux10-static \
hpux11-32 \
hpux11-32-static \
hpux11-32-static-nothreads \
hpux11-64 \
hpux11-64-static \
hpux9 \
hpux9-gcc \
@@ -81,7 +72,6 @@ linux-debug \
linux-dri \
linux-dri-x86 \
linux-dri-x86-64 \
linux-dri-ppc \
linux-glide \
linux-icc \
linux-icc-static \

View File

@@ -20,9 +20,9 @@
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# DOS/DJGPP makefile v1.6 for Mesa
# DOS/DJGPP makefile v1.5 for Mesa
#
# Copyright (C) 2002 - Daniel Borca
# Copyright (C) 2002 - Borca Daniel
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
@@ -64,7 +64,7 @@ CPU ?= pentium
GLU ?= mesa
CFLAGS = -Wall -W -pedantic
CFLAGS += -O2 -ffast-math -mtune=$(CPU)
CFLAGS += -O2 -ffast-math -mcpu=$(CPU)
export CFLAGS

View File

@@ -20,9 +20,9 @@
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# MinGW makefile v1.2 for Mesa
# MinGW makefile v1.1 for Mesa
#
# Copyright (C) 2002 - Daniel Borca
# Copyright (C) 2002 - Borca Daniel
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
@@ -66,7 +66,7 @@ else
# I love c89
CFLAGS = -Wall -W -pedantic
endif
CFLAGS += -O2 -ffast-math -mtune=$(CPU)
CFLAGS += -O2 -ffast-math -mcpu=$(CPU)
export CFLAGS

View File

@@ -3,7 +3,7 @@ Microsoft Developer Studio Workspace File, Format Version 6.00
###############################################################################
Project: "array_cache"=".\SRC\MESA\array_cache\array_cache.dsp" - Package Owner=<4>
Project: "array_cache"=.\SRC\MESA\array_cache\array_cache.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -15,7 +15,7 @@ Package=<4>
###############################################################################
Project: "gdi"=".\src\mesa\drivers\windows\gdi\gdi.dsp" - Package Owner=<4>
Project: "gdi"=.\src\mesa\drivers\windows\gdi\gdi.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -51,7 +51,7 @@ Package=<4>
###############################################################################
Project: "glapi"=".\SRC\MESA\glapi\glapi.dsp" - Package Owner=<4>
Project: "glapi"=.\SRC\MESA\glapi\glapi.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -63,7 +63,7 @@ Package=<4>
###############################################################################
Project: "glu"=".\src\glu\sgi\glu.dsp" - Package Owner=<4>
Project: "glu"=.\src\glu\sgi\glu.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -78,7 +78,22 @@ Package=<4>
###############################################################################
Project: "main"=".\SRC\MESA\main\main.dsp" - Package Owner=<4>
Project: "glut"=.\src\glut\glx\glut.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glu
End Project Dependency
}}}
###############################################################################
Project: "main"=.\SRC\MESA\main\main.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -90,7 +105,7 @@ Package=<4>
###############################################################################
Project: "math"=".\SRC\MESA\math\math.dsp" - Package Owner=<4>
Project: "math"=.\SRC\MESA\math\math.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -102,7 +117,7 @@ Package=<4>
###############################################################################
Project: "osmesa"=".\SRC\MESA\DRIVERS\osmesa\osmesa.dsp" - Package Owner=<4>
Project: "osmesa"=.\SRC\MESA\DRIVERS\osmesa\osmesa.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -117,7 +132,7 @@ Package=<4>
###############################################################################
Project: "shader"=".\SRC\MESA\shader\shader.dsp" - Package Owner=<4>
Project: "shader"=.\SRC\MESA\shader\shader.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -129,7 +144,7 @@ Package=<4>
###############################################################################
Project: "swrast"=".\SRC\MESA\swrast\swrast.dsp" - Package Owner=<4>
Project: "swrast"=.\SRC\MESA\swrast\swrast.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -141,7 +156,7 @@ Package=<4>
###############################################################################
Project: "swrast_setup"=".\SRC\MESA\swrast_setup\swrast_setup.dsp" - Package Owner=<4>
Project: "swrast_setup"=.\SRC\MESA\swrast_setup\swrast_setup.dsp - Package Owner=<4>
Package=<5>
{{{
@@ -153,7 +168,7 @@ Package=<4>
###############################################################################
Project: "tnl"=".\SRC\MESA\tnl\tnl.dsp" - Package Owner=<4>
Project: "tnl"=.\SRC\MESA\tnl\tnl.dsp - Package Owner=<4>
Package=<5>
{{{

View File

@@ -21,7 +21,6 @@
# -arch ARCH override using `uname` to determine architecture
# -archopt OPT specify an extra achitecture-specific option OPT
# -noprefix don't prefix library name with "lib" or any suffix
# -exports FILE only export the symbols listed in FILE
#
# The library name should just be "GL" or "GLU", etc. The 'lib' prefix
# will be added here if needed, as well as the ".so" or ".a" suffix,
@@ -49,7 +48,6 @@ INSTALLDIR="."
ARCH="auto"
ARCHOPT=""
NOPREFIX=0
EXPORTS=""
#
@@ -70,7 +68,6 @@ do
'-arch') shift 1; ARCH=$1;;
'-archopt') shift 1; ARCHOPT=$1;;
'-noprefix') NOPREFIX=1;;
'-exports') shift 1; EXPORTS=$1;;
-*) echo "mklib: Unknown option: " $1 ; exit 1;;
*) break
esac
@@ -107,7 +104,6 @@ if [ ] ; then
echo MINOR is $MINOR
echo PATCH is $PATCH
echo DEPS are $DEPS
echo "EXPORTS in" $EXPORTS
echo "-----------------"
fi
@@ -118,15 +114,7 @@ fi
case $ARCH in
'Linux' | 'OpenBSD')
# we assume gcc
# Set default compilers if env vars not set
if [ "x$CXX" = "x" ] ; then
CXX=g++
fi
if [ "x$CC" = "x" ] ; then
CC=gcc
fi
# GCC-based environment
if [ $NOPREFIX = 1 ] ; then
# No "lib" or ".so" part
@@ -161,18 +149,6 @@ case $ARCH in
else
OPTS="-shared -Wl,-soname,${LIBNAME}.so.${MAJOR}"
fi
if [ $EXPORTS ] ; then
#OPTS="${OPTS} -Xlinker --retain-symbols-file ${EXPORTS}"
# Make the 'exptmp' file for --version-script option
echo "VERSION_${MAJOR}.${MINOR} {" > exptmp
echo "global:" >> exptmp
sed 's/$/;/' ${EXPORTS} >> exptmp
echo "local:" >> exptmp
echo "*;" >> exptmp
echo "};" >> exptmp
OPTS="${OPTS} -Xlinker --version-script=exptmp"
# exptmp is removed below
fi
if [ x${PATCH} = "x" ] ; then
VERSION="${MAJOR}.${MINOR}"
else
@@ -199,7 +175,6 @@ case $ARCH in
ln -s ${LIBNAME}.so.${MAJOR} ${LIBNAME}.so
# finish up
FINAL_LIBS="${LIBNAME}.so.${VERSION} ${LIBNAME}.so.${MAJOR} ${LIBNAME}.so"
# rm -f exptmp
fi
;;
@@ -356,27 +331,19 @@ case $ARCH in
fi
;;
'AIX' | 'AIX64')
if [ $ARCH = "AIX64" ] ; then
X64="-X64"
fi
'AIX')
if [ $STATIC = 1 ] ; then
LIBNAME="lib${LIBNAME}.a"
echo "mklib: Making AIX static library: " ${LIBNAME}
ar -ruv ${X64} ${LIBNAME} ${OBJECTS}
ar -ruv ${LIBNAME} ${OBJECTS}
FINAL_LIBS=${LIBNAME}
else
EXPFILE="lib${LIBNAME}.exp"
OFILE=shr.o #Want to be consistent with the IBM libGL.a
LIBNAME="lib${LIBNAME}.a" # shared objects are still stored in the .a libraries
if [ $ARCH = "AIX64" ] ; then
OPTS="-bE:${EXPFILE} -bM:SRE -bnoentry -q64"
else
OPTS="-bE:${EXPFILE} -bM:SRE -bnoentry"
fi
OPTS="-bE:${EXPFILE} -bM:SRE -bnoentry"
rm -f ${EXPFILE} ${OFILE}
NM="/bin/nm -eC ${X64}"
NM="/bin/nm -eC"
echo "#! /usr/lib/${LIBNAME}" > ${EXPFILE}
${NM} ${OBJECTS} | awk '{
if ((($2 == "T") || ($2 == "D") || ($2 == "B")) \
@@ -393,11 +360,22 @@ case $ARCH in
}
}' | sort -u >> ${EXPFILE}
cc ${OPTS} -o ${OFILE} ${OBJECTS} ${DEPS}
ar ${X64} -r ${LIBNAME} ${OFILE}
ar -r ${LIBNAME} ${OFILE}
FINAL_LIBS="${LIBNAME}"
fi
;;
'AIX64')
if [ $STATIC = 1 ] ; then
LIBNAME="lib${LIBNAME}.a"
echo "mklib: Making AIX static library: " ${LIBNAME}
ar -X64 -ruv ${LIBNAME} ${OBJECTS}
FINAL_LIBS=${LIBNAME}
else
echo "mklib: PROBLEM: AIX64 shared libs not supported!!!"
fi
;;
'OpenSTEP')
LIBNAME="lib${LIBNAME}.a"
echo "mklib: Making OpenSTEP static library: " ${LIBNAME}
@@ -416,13 +394,8 @@ case $ARCH in
VERSION="${MAJOR}.${MINOR}"
LIBNAME="lib${LIBNAME}.so"
echo "mklib: Making OSF/1 shared library: " ${LIBNAME}
if [ $CPLUSPLUS = 1 ] ; then
LINK=$CXX
else
LINK=$CC
fi
rm -f ${LIBNAME}.${VERSION}
${LINK} -o ${LIBNAME}.${VERSION} -shared -set_version ${VERSION} -soname ${LIBNAME}.${VERSION} -expect_unresolved \* -all ${OBJECTS} ${DEPS}
ld -o ${LIBNAME}.${VERSION} -shared -no_archive -set_version ${VERSION} -soname ${LIBNAME}.${VERSION} -expect_unresolved \* -all ${OBJECTS} ${DEPS}
ln -sf ${LIBNAME}.${VERSION} ${LIBNAME}
FINAL_LIBS="${LIBNAME} ${LIBNAME}.${VERSION}"
fi

View File

@@ -1,28 +0,0 @@
# Configuration for AIX 64-bit, dynamic libs
include $(TOP)/configs/default
CONFIG_NAME = aix-64
# Compiler and flags
CC = xlc
CXX = xlC
CFLAGS = -q64 -qmaxmem=16384 -O -DAIXV3
CXXFLAGS = -q64 -qmaxmem=16384 -O -DAIXV3
MKLIB_OPTIONS = -arch AIX64
# 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
GL_LIB_DEPS = -lX11 -lXext -lm
GLU_LIB_DEPS = -L$(TOP)/lib -l$(GL_LIB) -lm -lC
GLUT_LIB_DEPS = -L$(TOP)/lib -l$(GLU_LIB) -l$(GL_LIB) -lXi -lXmu -lX11 -lm
GLW_LIB_DEPS = -L$(TOP)/lib -l$(GL_LIB) -lXt -lX11
OSMESA_LIB_DEPS = -L$(TOP)/lib -l$(GL_LIB)
APP_LIB_DEPS = -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXext -lXmu -lXi -lm -lC

View File

@@ -7,7 +7,7 @@ CONFIG_NAME = default
# Version info
MESA_MAJOR=6
MESA_MINOR=3
MESA_MINOR=2
MESA_TINY=0
# external projects
@@ -23,7 +23,7 @@ GLU_CFLAGS =
# Misc tools and flags
MKLIB_OPTIONS =
MKDEP = makedepend
MKDEP_OPTIONS = -fdepend
MKDEP_OPTIONS = -Y -fdepend
MAKE = make
# Library names (base name)

View File

@@ -1,41 +0,0 @@
# -*-makefile-*-
# Configuration for freebsd-dri: FreeBSD DRI hardware drivers
include $(TOP)/configs/freebsd
CONFIG_NAME = freebsd-dri
# Compiler and flags
CC = gcc
CXX = g++
WARN_FLAGS = -Wall
OPT_FLAGS = -O
X11_INCLUDES = -I/usr/X11R6/include -I/usr/X11R6/include/X11/extensions
DEFINES = -DDRI_NEW_INTERFACE_ONLY
CFLAGS = $(DEFINES) -Wmissing-prototypes -g -std=c99 -Wundef -fPIC -ffast-math -I/usr/local/include $(X11_INCLUDES)
CXXFLAGS = $(DEFINES) -Wall -g -ansi -pedantic -fPIC
ASM_SOURCES =
# Library/program dependencies
DRI_LIB_DEPS = -lm -lpthread -lexpat
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -pthread
GLUT_LIB_DEPS = -L$(LIB_DIR) -L/usr/X11R6/lib -lGLU -lGL -lX11 -lXmu -lXt -lXi -lm
GLW_LIB_DEPS = -L$(LIB_DIR) -L/usr/X11R6/lib -lGL -lXt -lXm -lX11
# Directories
SRC_DIRS = mesa glu glut/glx glw glx/x11
DRIVER_DIRS = dri
PROGRAM_DIRS =
WINDOW_SYSTEM=dri
DRM_SOURCE_PATH=$(TOP)/../drm
# ffb and gamma are missing because they have not been converted to use the new
# interface.
DRI_DIRS = dri_client i810 i830 i915 mach64 mga r128 r200 radeon tdfx \
unichrome savage sis

View File

@@ -1,12 +0,0 @@
# -*-makefile-*-
# Configuration for freebsd-dri: FreeBSD DRI hardware drivers
include $(TOP)/configs/freebsd-dri
CONFIG_NAME = freebsd-dri-x86
# Unnecessary on x86, generally.
PIC_FLAGS =
ASM_FLAGS = -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM
ASM_SOURCES = $(X86_SOURCES)

View File

@@ -1,26 +0,0 @@
# Configuration for HPUX v11
include $(TOP)/configs/default
CONFIG_NAME = hpux11-32
# Compiler and flags
CC = cc
CXX = aCC
CFLAGS = +z -Ae +O2 +Onolimit +Oaggressive -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM -DPTHREADS
CXXFLAGS = +z -Aa +O2 +Onolimit +Oaggressive -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include
MKLIB_OPTIONS =
# 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
# Library/program dependencies
APP_LIB_DEPS = -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lX11 -lm

View File

@@ -1,27 +0,0 @@
# Configuration for HPUX v11, 64-bit
include $(TOP)/configs/default
CONFIG_NAME = hpux11-64
# Compiler and flags
CC = cc
CXX = aCC
CFLAGS = +z -Ae +DD64 +O2 +Onolimit +Oaggressive -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM -DPTHREADS
CXXFLAGS = +z -Aa +DD64 +O2 +Onolimit +Oaggressive -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include
MKLIB_OPTIONS =
LIBDIR = $(TOP)/lib64
# 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
# Library/program dependencies
APP_LIB_DEPS = -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lX11 -lm

View File

@@ -10,7 +10,7 @@ CXX = g++
CFLAGS = -g -ansi -pedantic -Wall -Wmissing-prototypes -Wundef -fPIC -ffast-math -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM -DPTHREADS -DDEBUG -DMESA_DEBUG
CXXFLAGS = -g -ansi -pedantic -Wall -Wundef -fPIC -ffast-math -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -DDEBUG -DMESA_DEBUG
CXXFLAGS = -g -ansi -pedantic -Wall -Wmissing-prototypes -Wundef -fPIC -ffast-math -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -DDEBUG -DMESA_DEBUG
GLUT_CFLAGS = -fexceptions

View File

@@ -9,45 +9,36 @@ CONFIG_NAME = linux-dri
CC = gcc
CXX = g++
MKDEP = /usr/X11R6/bin/makedepend
#MKDEP = gcc -M
#MKDEP_OPTIONS = -MF depend
WARN_FLAGS = -Wall
OPT_FLAGS = -O -g
OPT_FLAGS = -O
SOURCE_FLAGS = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
-D_BSD_SOURCE -D_GNU_SOURCE
PIC_FLAGS = -fPIC
CFLAGS = -DDRI_NEW_INTERFACE_ONLY $(WARN_FLAGS) -g $(OPT_FLAGS) $(ASM_FLAGS) \
-std=c99 $(PIC_FLAGS) -ffast-math $(SOURCE_FLAGS) -DPTHREADS \
-I/usr/X11R6/include -I/usr/X11R6/include/X11/extensions
DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
-D_BSD_SOURCE -D_GNU_SOURCE \
-DDRI_NEW_INTERFACE_ONLY -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1
X11_INCLUDES = -I/usr/X11R6/include -I/usr/X11R6/include/X11/extensions
CFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(ASM_FLAGS) -std=c99 $(PIC_FLAGS) -ffast-math \
$(DEFINES)
CXXFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) \
$(DEFINES)
CXXFLAGS = -DDRI_NEW_INTERFACE_ONLY $(WARN_FLAGS) -g $(OPT_FLAGS) -fPIC \
$(SOURCE_FLAGS)
ASM_SOURCES =
# Library/program dependencies
DRI_LIB_DEPS = -lm -lpthread -lexpat -ldl
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lXxf86vm -lm -lpthread -ldl
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -lexpat -ldl
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib -lXt -lX11
# Directories
SRC_DIRS = mesa glu glut/glx glw glx/x11
SRC_DIRS = mesa glu glut/glx glw
DRIVER_DIRS = dri
PROGRAM_DIRS =
WINDOW_SYSTEM=dri
# ffb and gamma are missing because they have not been converted to use the new
# interface.
DRI_DIRS = dri_client i810 i830 i915 mach64 mga r128 r200 radeon s3v \
savage sis tdfx trident unichrome
DRI_DIRS = dri_client i810 i830 i915 mach64 mga r128 r200 radeon tdfx \
unichrome savage sis

View File

@@ -1,17 +0,0 @@
# -*-makefile-*-
# Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others
include $(TOP)/configs/linux-dri
CONFIG_NAME = linux-dri-ppc
OPT_FLAGS = -Os -mcpu=603
PIC_FLAGS = -fPIC
ASM_FLAGS = -DUSE_PPC_ASM -DUSE_VMX_ASM
ASM_SOURCES = $(PPC_SOURCES)
# Build only the drivers for cards that exist on PowerPC. At some point MGA
# will be added, but not yet.
DRI_DIRS = dri_client mach64 r128 r200 radeon tdfx

View File

@@ -9,25 +9,21 @@ CONFIG_NAME = linux-dri-x86-64
CC = gcc
CXX = g++
DEFINES = -DDRI_NEW_INTERFACE_ONLY -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DPTHREADS -D_GNU_SOURCE -D__AMD64__
CFLAGS = -DDRI_NEW_INTERFACE_ONLY -m64 -Wmissing-prototypes -g -std=c99 -Wundef -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DPTHREADS -D_GNU_SOURCE -D__AMD64__ -I/usr/X11R6/include -I/usr/X11R6/include/X11/extensions
CFLAGS = -m64 -Wmissing-prototypes -g -std=c99 -Wundef -fPIC -ffast-math $(DEFINES)
CXXFLAGS = -m64 -Wall -g -ansi -pedantic -fPIC $(DEFINES)
X11_INCLUDES = -I/usr/X11R6/include -I/usr/X11R6/include/X11/extensions
CXXFLAGS = -DDRI_NEW_INTERFACE_ONLY -m64 -Wall -g -ansi -pedantic -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -D__AMD64__
#ASM_SOURCES = $(X86_SOURCES)
LIB_DIR = $(TOP)/lib64
# Library/program dependencies
DRI_LIB_DEPS = -lm -lpthread -lexpat -ldl
GL_LIB_DEPS = -L/usr/X11R6/lib64 -lX11 -lXext -lXxf86vm -lm -lpthread -ldl
GL_LIB_DEPS = -L/usr/X11R6/lib64 -lX11 -lXext -lm -lpthread -lexpat -ldl
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib64 -lX11 -lXmu -lXt -lXi -lm
GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib64 -lXt -lX11
# Directories
SRC_DIRS = mesa glu glut/glx glw glx/x11
SRC_DIRS = mesa glu glut/glx glw
DRIVER_DIRS = dri
PROGRAM_DIRS =
WINDOW_SYSTEM=dri

View File

@@ -8,24 +8,23 @@ CONFIG_NAME = linux-solo
CC = gcc
CXX = g++
DEFINES = -DDRI_NEW_INTERFACE_ONLY -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=199309L -D_GNU_SOURCE
CCOMMON = -DDRI_NEW_INTERFACE_ONLY -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=199309L -D_GNU_SOURCE
CFLAGS = $(DEFINES) -Wmissing-prototypes -g -std=c99 -Wundef -fPIC -ffast-math
CFLAGS = $(CCOMMON) -Wmissing-prototypes -g -std=c99 -Wundef -fPIC -ffast-math
CXXFLAGS = $(DEFINES) -Wall -O3 -ansi -pedantic -fPIC
CXXFLAGS = $(CCOMMON) -Wall -O3 -ansi -pedantic -fPIC
ASM_SOURCES = $(X86_SOURCES)
# Library/program dependencies
DRI_LIB_DEPS = -lm -lpthread -lexpat -ldl
GL_LIB_DEPS = -lm -lpthread -ldl
GL_LIB_DEPS = -lm -lpthread -lexpat -ldl
GLU_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -lm
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lm
APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm -lpthread
# Directories
SRC_DIRS = mesa glx/mini glu glut/mini
SRC_DIRS = mesa glx glu glut/mini
DRIVER_DIRS = dri
PROGRAM_DIRS = miniglx

View File

@@ -8,21 +8,20 @@ CONFIG_NAME = linux-solo-ia64
CC = gcc
CXX = g++
DEFINES = -DDRI_NEW_INTERFACE_ONLY -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=199309L -D_GNU_SOURCE
CCOMMON = -DDRI_NEW_INTERFACE_ONLY -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=199309L -D_GNU_SOURCE
CFLAGS = $(DEFINES) -Wmissing-prototypes -g -std=c99 -Wundef -fPIC -ffast-math
CFLAGS = $(CCOMMON) -Wmissing-prototypes -g -std=c99 -Wundef -fPIC -ffast-math
CXXFLAGS = $(DEFINES) -Wall -O3 -ansi -pedantic -fPIC
CXXFLAGS = $(CCOMMON) -Wall -O3 -ansi -pedantic -fPIC
# Library/program dependencies
DRI_LIB_DEPS = -lm -lpthread -lexpat -ldl
GL_LIB_DEPS = -lm -lpthread -ldl
GL_LIB_DEPS = -lm -lpthread -lexpat -ldl
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lm
APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm -lpthread
# Directories
SRC_DIRS = mesa glx/mini glu glut/mini
SRC_DIRS = mesa glx glu glut/mini
DRIVER_DIRS = dri
PROGRAM_DIRS = miniglx

View File

@@ -8,23 +8,22 @@ CONFIG_NAME = linux-solo-x86
CC = gcc
CXX = g++
DEFINES = -DDRI_NEW_INTERFACE_ONLY -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=199309L -D_GNU_SOURCE -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM -DPTHREADS
CCOMMON = -DDRI_NEW_INTERFACE_ONLY -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=199309L -D_GNU_SOURCE -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM -DPTHREADS
CFLAGS = $(DEFINES) -Wmissing-prototypes -O3 -g -std=c99 -Wundef -fPIC -ffast-math
CFLAGS = $(CCOMMON) -Wmissing-prototypes -O3 -g -std=c99 -Wundef -fPIC -ffast-math
CXXFLAGS = $(DEFINES) -Wall -O3 -ansi -pedantic -fPIC
CXXFLAGS = $(CCOMMON) -Wall -O3 -ansi -pedantic -fPIC
ASM_SOURCES = $(X86_SOURCES)
# Library/program dependencies
DRI_LIB_DEPS = -lm -lpthread -lexpat -ldl
GL_LIB_DEPS = -lm -lpthread -ldl
GL_LIB_DEPS = -lm -lpthread -lexpat -ldl
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lm
APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm -lpthread
# Directories
SRC_DIRS = mesa glx/mini glu glut/mini
SRC_DIRS = mesa glx glu glut/mini
DRIVER_DIRS = dri
PROGRAM_DIRS = miniglx

View File

@@ -12,7 +12,7 @@ TCC_DIR=/home/progs/tcc-0.9.20
CFLAGS = -g -ansi -pedantic -Wall -Wmissing-prototypes -Wundef -fPIC -ffast-math -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM -DPTHREADS -DDEBUG -DMESA_DEBUG -DUSE_TCC -I$(TCC_DIR)
CXXFLAGS = -g -ansi -pedantic -Wall -Wundef -fPIC -ffast-math -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -DDEBUG -DMESA_DEBUG
CXXFLAGS = -g -ansi -pedantic -Wall -Wmissing-prototypes -Wundef -fPIC -ffast-math -D_POSIX_SOURCE -D_SVID_SOURCE -D_BSD_SOURCE -DDEBUG -DMESA_DEBUG
GLUT_CFLAGS = -fexceptions

View File

@@ -13,4 +13,6 @@ CXXFLAGS = -O2 -std ansi -ieee
GL_LIB_DEPS = -lX11 -lXext -lm -lpthread
GLU_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -lm
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXmu -lXt -lXi -lm
APP_LIB_DEPS = -L$(LIB_DIR) -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXext -lXmu -lXi -lm
APP_LIB_DEPS = -L$(LIB_DIR) -lX11 -lXext -lXmu -lXi -lm

View File

@@ -3,46 +3,49 @@
Requirements:
-------------
Mesa-6.2 release notes:
-----------------------
A Voodoo-based videocard/accelerator
DOS (with DJGPP), Windows9x/2k (with MinGW), Linux
Glide3x library for your OS
1) Glide2 support has been ceased; please visit the Glide SourceForge and
help us improve Glide3.
2) The current release is a WIP; among other things, the Linux build works
only to some extent. Voodoo Rush not fully tested. Any help will be
appreciated.
3) Although Mesa is designed to work with any Glide3, it would benefit from
interacting with newer Glide libraries, which can export functions like:
`grGetRegistryOrEnvironmentStringExt', `grSetNumPendingBuffers', Texus2
and pointcast palette. The latest Glide3 can be reached here:
http://sourceforge.net/projects/glide/
http://sourceforge.net/projects/glide/
Known supported HW/OS:
----------------------
Voodoo-based videocards/accelerators
DOS (DJGPP), Windows9x/2k (MinGW/MSVC), Linux
How to compile:
---------------
DJGPP:
DJGPP/MinGW:
Place the Glide3 SDK in the top Mesa directory:
$(MESA)/glide3/include/
3dfx.h, g3ext.h, glide.h, glidesys.h, glideutl.h, sst1vid.h
$(MESA)/glide3/include/*.h
$(MESA)/glide3/lib/
libgld3x.a, libgld3i.a, glide3x.dxe
Required headers:
3dfx.h, g3ext.h, glide.h, glidesys.h, glideutl.h, sst1vid.h
Required libraries:
OS specific
Type:
make -f Makefile.DJ X86=1 FX=1
Look into the makefile for further information.
MinGW:
Place the Glide3 SDK in the top Mesa directory:
$(MESA)/glide3/include/
3dfx.h, g3ext.h, glide.h, glidesys.h, glideutl.h, sst1vid.h
$(MESA)/glide3/lib/
libglide3x.a, glide3x.dll
Type:
or
make -f Makefile.mgw X86=1 FX=1
Look into the makefile for further information.
Look into the corresponding makefiles for further information.
Linux:
Place the Glide3 SDK in /usr/local/glide
/usr/local/glide/include/
3dfx.h, g3ext.h, glide.h, glidesys.h, glideutl.h, sst1vid.h
/usr/local/glide/lib/
libglide3x.a, libglide3x.so
Type:
make linux-glide
or
@@ -60,7 +63,12 @@ FX_TRAP_GLIDE
FX_PACKEDCOLOR
use packed color in vertex structure
FX_TC_NAPALM
map GL_COMPRESSED_RGB[A] to FXT1. Works with VSA100-based cards only.
map GL_COMPRESSED_RGB[A] to FXT1. This will have effect on Napalm
only (can coexist with FX_TC_NCC, but has higher priority)
FX_TC_NCC
experimental
map GL_COMPRESSED_RGB[A] to NCC. This will have effect on any 3dfx
HW (can coexist with FX_TC_NAPALM, but has lesser priority)
FX_COMPRESS_S3TC_AS_FXT1_HACK
map S3TC to FXT1
FX_RESCALE_BIG_TEXURES_HACK
@@ -97,7 +105,7 @@ FX_GLIDE_SWAPPENDINGCOUNT
HW: all
Desc: max # of buffers allowed to build up
Note: (*) (!)
Value: "0", "1", "2", "3", "4", "5" or "6"
Value: "0", "1", "2" or "3"
FX_GLIDE_SWAPINTERVAL
OS: all
HW: all
@@ -140,7 +148,7 @@ MESA_FX_NOSNAP
OS: all
HW: Voodoo1, Rush, Banshee
Desc: do not snap vertices inside Mesa
Note: to be used with Glide3x that snaps vertices internally
Note: to be used with Glide3x that snaps vertices itself
MESA_FX_POINTCAST
OS: all
HW: dual-TMU cards (some Voodoo1, Voodoo2, Avenger, Napalm)
@@ -185,25 +193,15 @@ MESA_FX_MAXLOD
"9" - 512x512 textures
"10" - 1024x1024 textures
"11" - 2048x2048 textures
MESA_FX_ALLOW_VP
OS: all
HW: all
Desc: allow vertex program extensions
MESA_GLX_FX
OS: linux
HW: Voodoo1, Rush, Voodoo2
Desc: display mode
Note: (!) experimental
Note: (!) experimental: "w" may work in Win32 using non-V1/V2 HW
Value:
"w" - windowed mode
"f" - fullscreen mode
"d" - disable glide driver
OS: win32
HW: Rush, Banshee, Avenger, Napalm
Desc: display mode
Note: (!) experimental
Value:
"w" - windowed mode

View File

@@ -28,11 +28,9 @@ working. No optimizations have been made at this time.
* Compiling
Since Mesa 6.x, it can be build under BeOS with both the R5 builtin gcc version
or more recent gcc versions available for BeOS, like this gcc version 2.95.3 for BeOS
you can find at http://www.bebits.com/app/2157.
Anyway, keep in mind that to take full advantage of Mesa x86 optimizations, you better
want to use gcc 2.95.3 or sooner versions...
Requirements:
- gcc version 2.95.3 for BeOS
You can find it here: http://www.bebits.com/app/2157
To build Mesa-powered BeOS libGL.so version, open an Terminal window,
move to Mesa root folder and type this command:
@@ -113,7 +111,6 @@ cause a fatal error when running with Be's OpenGL.
Jake Hamby jhamby <at> anobject <dot> com
Marcin Konicki ahwayakchih <at> neoni <dot> net
Francois Revol revol <at> free <dot> fr
Nathan Whitehorn nathanw <at> uchicago <dot> edu
* Older BeOS Driver
@@ -134,4 +131,4 @@ as of February, 1999.
----------------------------------------------------------------------
$Id: README.BEOS,v 1.12 2004/10/13 00:35:55 phoudoin Exp $
$Id: README.BEOS,v 1.11 2004/08/24 08:31:57 phoudoin Exp $

View File

@@ -1,4 +1,4 @@
Mesa 6.3 DOS/DJGPP Port v1.7
Mesa 6.1 DOS/DJGPP Port v1.6
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -6,7 +6,7 @@
Description:
~~~~~~~~~~~~
Well, guess what... this is the DOS port of Mesa 6.3, for DJGPP fans... Whoa!
Well, guess what... this is the DOS port of Mesa 6.1, for DJGPP fans... Whoa!
The driver has its origins in ddsample.c, written by Brian Paul and found by me
in Mesa 3.4.2.
@@ -59,7 +59,7 @@ Tested on:
CPU: AMD Athlon XP 1800+
Mainboard: GA-7VTXE w/ 512 MB DDRAM
Video card: Voodoo5 6000 AGP w/ 128 MB SDRAM
DJGPP: djdev 2.04 + gcc v3.4.3 + make v3.80
DJGPP: djdev 2.04 + gcc v3.3.2 + make v3.80
OS: DOS and Win98SE
@@ -91,12 +91,8 @@ FAQ:
2. Using Mesa for DJGPP
Q) Every test I tried crashes badly.
A) If you have compiled with SSE and you're running under plain DOS, you
have to disable SSE at run-time. See environment variables below.
Q) DMesa is so SLOOOW! The Win32 OpenGL performs so much better...
A) Is that a question? If you have a 3dfx Voodoo (any model), you're
A) Is that a question? If you have a 3dfx Voodoo or higher card, you're
lucky (check http://sourceforge.net/projects/glide for the DJGPP port).
If you haven't, sorry; everything is done in software. Suggestions?
@@ -138,7 +134,7 @@ FAQ:
struct {
int xres, yres;
int bpp;
} **l = malloc(n * sizeof(void *));
} **l = malloc(n * sizeof(void **));
Now pass the newly allocated buffer to fill in:
DMesaGetIntegerv(DMESA_GET_VIDEO_MODES, (GLint *)l);
And collect the info:
@@ -198,7 +194,6 @@ Environment variables:
~~~~~~~~~~~~~~~~~~~~~~
DMESA_NULDRV - (any value) force NUL driver
GLUT_FPS - print frames/second statistics to stderr
MESA_NO_SSE - (any value) safe option under pure DOS
DMESA_GLUT_REFRESH - set vertical screen refresh rate (VESA3)
DMESA_GLUT_BPP - set default bits per pixel (VGA needs 8)
DMESA_GLUT_ALPHA - set default alpha bits (8)
@@ -262,11 +257,6 @@ v1.6 (aug-2004)
! fixed a horrible bug in VGA initialization routine
! fixed partial clears
v1.7 (???-2005)
+ enabled OpenGL 2.0 support
+ added support for sw texture compression
* minor rework
Contact:

View File

@@ -1,6 +1,6 @@
File: docs/README.WIN32
Last updated: Oct 01, 2004 - Karl Schultz - kschultz@users.sourceforge.net
Last updated: Sep 18, 2003 - Karl Schultz - kschultz@users.sourceforge.net
Quick Start
@@ -14,36 +14,16 @@ The build system has been changed to use Microsoft Visual Studio project
workspaces and projects. Makefiles are no longer shipped or supported, but
can be generated from the projects using Visual Studio.
The workspace and project files were created with Visual Studio 6, so that
they can be used with VS6 and so that they can also be imported into VS 7.
Details and Notes
- To build the Mesa libraries, open the Mesa.dsw workspace file
in the top directory. You will need to build at least one
driver. Currently, only the gdi and osmesa drivers are available.
Select one or the other as the active project and build it.
If you want glu, select the glu project as active and build that as well.
- Glut is no longer in the Mesa.dsw workspace. It is now built in
the demo workspace (see below).
- The build process will create a lib directory in the top directory
and will put the following files there as you build them:
OPENGL32.LIB, GLU32.LIB, OSMESA32.LIB
OPENGL32.DLL, GLU32.DLL, OSMESA32.DLL
- Some users have reported problems building glu with VS7 after importing
and converting the VS6 project files. The problem is caused by a custom
build step that was put in place to work around a problem with VS6 not
recognizing .cc files as C++ source files. It appears that VS7 can be
configured to recognize .cc files as C++ files and so it compiles these
glu files with the default settings, and does not use settings that are
required to compile the files correctly. The easiest way to solve the
problem is to remove the .cc files from the glu project. This does not
delete the files, but removes them from the project so that VS does not
try to compile them at all. This allows the custom build step to compile
the files with the proper settings.
in the top directory. You can build each project one-by-one,
or build the glut project to build everything except osmesa,
which needs to be built separately. The build process will
create a lib directory in the top directory and will put the
following files there:
OPENGL32.LIB, GLU32.LIB, GLUT32.LIB, OSMESA32.LIB
OPENGL32.DLL, GLU32.DLL, GLUT32.DLL, OSMESA32.DLL
- After building, you can copy the above DLL files to a place in your PATH
such as $SystemRoot/SYSTEM32. If you don't like putting things in a
@@ -71,6 +51,9 @@ Details and Notes
- The si-glu sources are used to build the GLU libs. This was done
mainly to get the better tessellator code.
- The osmesa driver builds and should work on Windows as well as
any other platform.
- The Windows driver (in src/Windows) builds and runs at least at
a minimal level. I modified this driver to work with the new
Mesa 4.0 code and driver architecture, but I did not do a great

View File

@@ -1,7 +1,7 @@
Mesa 6.2 release notes
October 2, 2004
Month, day, 2004
PLEASE READ!!!!
@@ -19,19 +19,6 @@ This release primarily just fixes bugs found in the Mesa 6.1 release.
See the VERSIONS file for details.
ToDo: PBO for polygon stipple, convolution filter, etc.
Known Issues
------------
The GL_EXT_pixel_buffer_object extension isn't fully implemented for
functions like glPolygonStipple, glConvolutionFilter, glColorTable,
etc. The important functions like glRead/DrawPixels, glTex[Sub]Image,
and glBitmap work with PBOs.
Driver Status
---------------------- ---------------------
@@ -49,4 +36,4 @@ D3D needs updating
----------------------------------------------------------------------
$Id: RELNOTES-6.2,v 3.4 2004/10/02 15:43:14 brianp Exp $
$Id: RELNOTES-6.2,v 3.1 2004/08/22 17:43:31 brianp Exp $

View File

@@ -1,50 +0,0 @@
Mesa 6.2.1 release notes
December 9, 2004
PLEASE READ!!!!
Introduction
------------
Mesa uses an even/odd version number scheme like the Linux kernel.
Odd numbered versions (such as 6.1) designate new developmental releases.
Even numbered versions (such as 6.2.x) designate stable releases.
This release primarily just fixes bugs found in the Mesa 6.2 release.
See the VERSIONS file for details.
Known Issues
------------
The GL_EXT_pixel_buffer_object extension isn't fully implemented for
functions like glPolygonStipple, glConvolutionFilter, glColorTable,
etc. The important functions like glRead/DrawPixels, glTex[Sub]Image,
and glBitmap work with PBOs. This has been fixed for Mesa 6.3.
Driver Status
---------------------- ---------------------
XMesa (Xlib) implements OpenGL 1.5
OSMesa (off-screen) implements OpenGL 1.5
Glide (3dfx Voodoo1/2) implements OpenGL 1.3
SVGA implements OpenGL 1.3
Wind River UGL implements OpenGL 1.3
Windows/Win32 implements OpenGL 1.5
DJGPP implements OpenGL 1.5
GGI implements OpenGL 1.3
BeOS implements OpenGL 1.5
Allegro needs updating
D3D needs updating
----------------------------------------------------------------------
$Id: RELNOTES-6.2.1,v 3.1 2004/12/09 23:21:36 brianp Exp $

View File

@@ -1,56 +0,0 @@
Mesa 6.3 release notes
month day, 2004
PLEASE READ!!!!
Introduction
------------
Mesa uses an even/odd version number scheme like the Linux kernel.
Odd numbered versions (such as 6.3) designate new developmental releases.
Even numbered versions (such as 6.2) designate stable releases.
New Features
------------
GL_ARB_draw_buffers - allows a fragment program to write to a number of
separate color buffers, instead of just one.
GL_OES_read_format - allows one to query the fastest glReadPixels format
and datatype.
To Do before release
--------------------
Fix dinoshade bug
Switch to freeglut
Increase MAX_DRAWBUFFERS
driver hooks for BeginQuery/EndQuery
Driver Status
---------------------- ---------------------
XMesa (Xlib) implements OpenGL 1.5
OSMesa (off-screen) implements OpenGL 1.5
Glide (3dfx Voodoo1/2) implements OpenGL 1.3
SVGA implements OpenGL 1.3
Wind River UGL implements OpenGL 1.3
Windows/Win32 implements OpenGL 1.5
DJGPP implements OpenGL 1.5
GGI implements OpenGL 1.3
BeOS implements OpenGL 1.5
Allegro needs updating
D3D needs updating
----------------------------------------------------------------------
$Id: RELNOTES-6.3,v 3.6 2004/12/09 23:21:36 brianp Exp $

View File

@@ -1276,7 +1276,7 @@ Mesa Version History
- fixed a number of minor memory leaks (bug #1002030)
6.2 October 2, 2004
6.2 Month, day, 2004
New:
- enabled GL_ARB_texture_rectangle (same as GL_NV_texture_rectangle)
- updated Doxygen support (Jose Fonseca)
@@ -1293,35 +1293,3 @@ Mesa Version History
- repeated calls to glDeleteTexture(t) could lead to a crash
- fixed potential ref count bugs in VBOs and vertex/fragment programs
- spriteblast demo didn't handle window size changes correctly
- glTexSubImage didn't handle pixels=NULL correctly for PBOs
- fixed color index mode glDrawPixels bug (Karl Schultz)
6.2.1 December 9, 2004
Bug fixes:
- don't apply regular fog or color sum when using a fragment program
- glProgramEnvParameter4fARB always generated an error on
GL_FRAGMENT_PROGRAM_ARB (fdo bug 1645)
- glVertexAttrib3svNV and glVertexAttrib3svARB were broken
- fixed width/height mix-up in glSeparableFilter2D()
- fixed regression in glCopyPixels + convolution
- glReadPixels from a clipped front color buffer didn't always work
- glTexImage didn't accept GL_RED/GREEN/BLUE as the format
- Attempting queries/accesses of VBO 0 weren't detected as errors
- paletted textures failed if the palette had fewer that 256 entries
Changes:
- fixed a bunch of compiler warnings found with gcc 3.4
- bug reports should to go bugzilla.freedesktop.org
6.3 Month day, 2004
New:
- GL_ARB_draw_buffers extension
- GL_OES_read_format extension (Ian Romanick)
- full support for GL_EXT_pixel_buffer_object (convolution filters,
polygon stipple, colormaps, etc)
Changes:
- added -stereo option for glxgears demo (Jacek Rosik)
Bug fixes:
fixes from 6.2.1, plus:
-

View File

@@ -7,20 +7,9 @@
<H1>Bug Database</H1>
<p>
The Mesa bug database is now hosted on
<a href="http://freedesktop.org" target="_parent">freedesktop.org</a>
instead of SourceForge.
</p>
<p>
To file a Mesa bug, go to
<a href="https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa"
target="_parent">
Bugzilla on freedesktop.org</a>
</p>
<p>
Please follow these bug reporting guidelines:
Bug reports can be filed in the <a
href="http://sourceforge.net/bugs/?group_id=3" target="_parent">Bug
Database</a> on sourceforge.net. Please follow these guidelines:
</p>
<ul>
@@ -32,8 +21,7 @@ Please follow these bug reporting guidelines:
</ul>
<p>
Bug reports will automatically be forwarded to the Mesa developer's mailing
list.
Bug reports will automatically be forwarded to the Mesa developer's list.
</p>
<p>

View File

@@ -20,7 +20,7 @@
<b>Download / Install</b>
<ul>
<li><a href="http://www.sourceforge.net/projects/mesa3d" target="_parent">Stable Release (6.2.1)</a>
<li><a href="http://www.sourceforge.net/projects/mesa3d" target="_parent">Stable Release (6.0.1)</a>
<li><a href="download.html" target="MainFrame">Downloading/Unpacking</a>
<li><a href="install.html" target="MainFrame">Compilation/Installation</a>
<li><a href="glu.html" target="MainFrame">SGI's GLU</a>

View File

@@ -15,25 +15,25 @@ code while a CVS branch has the latest stable code.
</p>
<p>
Currently (Oct 2004), the trunk is the Mesa 6.3 development code
while the mesa_6_2_branch branch has the stable Mesa 6.2.x code.
Currently (Nov 2003), the trunk is the Mesa 5.1 development code
while the mesa_5_0_branch branch has the stable Mesa 5.0.x code.
</p>
<p>
Mesa releases use an even/odd numbering scheme to represent stable/development
releases.
For example, Mesa 6.2 (0 is considered even) is a stable release while
Mesa 6.3 is a development release.
For example, Mesa 5.0.x (0 is considered even) is a stable release while
Mesa 5.1.x is a development release.
</p>
<p>
To checkout a specific CVS branch pass <code>-r</code> and
the branch tag after your CVS command.
For example <code>cvs checkout -r mesa_6_2_branch Mesa</code> will
checkout the 6.2 branch and <code>cvs update -r
mesa_6_2_branch</code> will convert your current CVS tree to the 6.2
For example <code>cvs checkout -r mesa_5_0_branch Mesa</code> will
checkout the 5.0.x branch and <code>cvs update -r
mesa_5_0_branch</code> will convert your current CVS tree to the 5.0.x
branch.
Consult <a href="http://www.durak.org/cvswebsites/doc/cvs_5.php3#SEC54"

View File

@@ -39,7 +39,7 @@ To add a new GL extension to Mesa you have to do at least the following.
extension is rather large, try to implement it in a new source file.
</li>
<li>
If the new extension adds new GL state, the functions in get.c, enable.c
If hew extension adds new GL state, the functions in get.c, enable.c
and attrib.c will most likely require new code.
</li>
</ul>
@@ -94,7 +94,7 @@ Constants and macros are ALL_UPPERCASE, with _ between words
</p>
<p>
Global variables are not allowed.
Global vars not allowed.
</p>
<p>
@@ -109,85 +109,110 @@ Function name examples:
</pre>
<H2>Writing a Device Driver</H2>
<p>
XXX to do
</p>
<H2>Making a New Mesa Release</H2>
<p>
These are the instructions for making a new Mesa release.
</p>
<H3>Get latest source files</H3>
<p>
Use "cvs update -dAP " to get the latest Mesa files from CVS.
Prerequisites (later versions may work):
</p>
<ul>
<li> autoconf 2.50
<li> automake 1.4-p2
<li> libtool 1.4
</ul>
<p>
Be sure to do a "cvs update -d ." in the Mesa directory to
get all the latest files.
</p>
<p>
Update the version definitions in src/version.h
</p>
<H3>Verify and update version info</H3>
<p>
Create/edit the docs/RELNOTES-X.Y file to document what's new in the release.
Add the new RELNOTES-X.Y file to <a href="relnotes.html">relnotes.html</a>.
Update the docs/VERSIONS file too.
Edit the docs/VERSIONS file too.
</p>
<p>
Edit configs/default and change the MESA_MAJOR, MESA_MINOR and MESA_TINY
version numbers.
Edit Make-config and change the MESA_MAJOR and/or MESA_MINOR versions.
</p>
<p>
Make sure the values in src/mesa/main/version.h is correct.
Edit the GNU configure stuff to change versions numbers as needed:
Update the version string (second argument) in the line
"AM_INIT_AUTOMAKE(Mesa, 3.3)" in the configure.in file.
</p>
<p>
Edit the top-level Makefile and verify that DIRECTORY, LIB_NAME and
DEMO_NAME are correct.
Remove the leading `dnl' from the line "dnl AM_MAINTAINER_MODE".
</p>
<p>
Update the docs/news.html file and docs/contents.html files.
Verify the version numbers near the top of configure.in
</p>
<p>
Check in all updates to CVS.
Run "fixam -f" to disable automatic dependency tracking.
</p>
<p>
Tag the CVS files with the release name (in the form <b>mesa_X_Y</b>).
Run the bootstrap script to generate the configure script.
</p>
<H3>Make the tarballs</H3>
<p>
Make a symbolic link from $(DIRECTORY) to 'Mesa'. For example,
ln -s Mesa Mesa-6.3
This is needed in order to make a correct tar file in the next step.
Edit Makefile.X11 and verify DIRECTORY is set correctly. The Mesa
sources must be in that directory (or there must be a symbolic link).
</p>
<p>
Edit Makefile.X11 and verify that LIB_NAME and DEMO_NAME are correct.
If it's a beta release, be sure the bump up the beta release number.
</p>
<p>
cp Makefile.X11 to Makefile so that the old-style Mesa makefiles
still work. ./configure will overwrite it if that's what the user runs.
</p>
<p>
Make a symbolic link from $(DIRECTORY) to Mesa. For example,
ln -s Mesa Mesa-3.3 This is needed in order to make a correct
tar file in the next step.
</p>
<p>
Make the distribution files. From inside the Mesa directory:
<pre>
make tarballs
make -f Makefile.X11 lib_tar
make -f Makefile.X11 demo_tar
make -f Makefile.X11 lib_zip
make -f Makefile.X11 demo_zip
</pre>
<p>
After the tarballs are created, the md5 checksums for the files will
be computed.
Add them to the docs/news.html file.
</p>
<p>
Copy the distribution files to a temporary directory, unpack them,
compile everything, and run some demos to be sure everything works.
</p>
<H3>Update the website and announce the release</H3>
<p>
Follow the directions on SourceForge for creating a new "release" and
uploading the tarballs.
Upload the *.tar.gz and *.zip files to ftp.mesa3d.org
</p>
<p>
Update the web site by copying the docs/ directory's files to
/home/users/b/br/brianp/mesa-www/htdocs/
Update the web site.
</p>
<p>
@@ -199,6 +224,17 @@ and
</p>
<H2>Autoconf info</H2>
<p>
In order to run the bootstrap script you'll need:
<p>
<pre>
autoconf 2.50
automake 1.4-p5
libtool 1.4
</pre>
</body>
</html>

View File

@@ -7,7 +7,7 @@
<center>
<h1>Mesa Frequently Asked Questions</h1>
Last updated: 17 November 2004
Last updated: 27 April 2004
</center>
<br>
@@ -53,7 +53,7 @@ the 3Dfx Glide/Voodoo driver, an old S3 driver, etc) but the DRI drivers
are the modern ones.
</p>
<h2>1.3 What purpose does Mesa serve today?</h2>
<h2>1.3 What purpose does Mesa (software-based rendering) serve today?</h2>
<p>
Hardware-accelerated OpenGL implementations are available for most popular
operating systems today.
@@ -80,39 +80,7 @@ Still, Mesa serves at least these purposes:
</li>
</ul>
<h2>1.4 What's the difference between"Stand-Alone" Mesa and the DRI drivers?</h2>
<p>
<em>Stand-alone Mesa</em> is the original incarnation of Mesa.
On systems running the X Window System, it does all its rendering through
the Xlib API.
<ul>
<li>The GLX API is supported, but it's really just an emulation of the
real thing.
<li>The GLX wire protocol is not supported and there's no OpenGL extension
loaded by the X server.
<li>There is no hardware acceleration.
<li>The OpenGL library, libGL.so, contains everything (the programming API,
the GLX functions and all the rendering code).
</ul>
</p>
<p>
Alternately, Mesa acts as the core for a number of OpenGL hardware drivers
within the DRI (Direct Rendering Infrastructure):
<ul>
<li>The libGL.so library provides the GL and GLX API functions, a GLX
protocol encoder, and a device driver loader.
<li>The device driver modules (such as r200_dri.so) contain a built-in
copy of the core Mesa code.
<li>The X server loads the GLX module.
The GLX module decodes incoming GLX protocol and dispatches the commands
to a rendering module.
For the DRI, this module is basically a software Mesa renderer.
</ul>
<h2>1.5 How do I upgrade my DRI installation to use a new Mesa release?</h2>
<h2>1.4 How do I upgrade my DRI installation to use a new Mesa release?</h2>
<p>
You don't! A copy of the Mesa source code lives inside the XFree86/DRI source
tree and gets compiled into the individual DRI driver modules.
@@ -132,7 +100,7 @@ if there's newer drivers.
</p>
<h2>1.6 Are there other open-source implementations of OpenGL?</h2>
<h2>1.5 Are there other open-source implementations of OpenGL?</h2>
<p>
Yes, SGI's <a href="http://oss.sgi.com/projects/ogl-sample/index.html"
target="_parent">
@@ -167,13 +135,12 @@ but it does export the OpenGL API. It allows tiled rendering, sort-last
rendering, etc.
</p>
<p>
There may be other open OpenGL implementations, but Mesa is the most
popular and feature-complete.
</p>
<br>
<br>
@@ -189,24 +156,38 @@ has Mesa packages (like RPM or DEB) which you can easily install.
</a></p>
<h2><a name="part2">2.2 Running <code>configure; make</code> doesn't Work</a></h2>
<h2><a name="part2">2.2 Running <code>configure; make</code> Doesn't Work</a></h2>
<p>
Mesa no longer supports GNU autoconf/automake. Why?
<ul>
<li>It seemed to seldom work on anything but Linux
<li>The config files were hard to maintain and hard to understand
<li>libtool caused a lot of grief
</ul>
<a name="part2">Unfortunately, the GNU autoconf/automake/libtool system doesn't seem to work
too well on non GNU/Linux systems, even after installing gmake, gcc, etc.
For that reason, Mesa's <b>old-style</b> makefile system is still included.
The old-style system uses good old traditional Makefiles. Try the following:
</a></p><pre><a name="part2"> cd Mesa-x.y.z
cp Makefile.X11 Makefile
make
</a></pre>
<a name="part2">You'll see a list of system configurations from which to choose.
For example:
</a><pre><a name="part2"> make linux-x86
</a></pre>
<p>
Now, Mesa again uses a conventional Makefile system (as it did originally).
Basically, each Makefile in the tree includes one of the configuration
files from the config/ directory.
The config files specify all the variables for a variety of popular systems.
</p>
<a name="part2">If you're experienced with GNU autoconf/automake/libtool and think you can help
with maintence, contact the Mesa developers.
FYI, the Mesa developers generally don't use the autoconf/automake system.
We're especially annoyed with the fact that a +5000-line script (libtool)
is needed to make shared libraries (ugh).
</a></p>
<h2><a name="part2">2.3 Mesa still doesn't compile</a></h2>
<p>
<a name="part2">If the old-style Makefile system doesn't work either, make sure you have
the most recent version of Mesa.
Otherwise, file a bug report or post to the Mesa3d-users mailing list.
Give as much info as possible when describing your problem.
</a></p>
<h2><a name="part2">2.3 I get undefined symbols such as bgnpolygon, v3f, etc...</a></h2>
<h2><a name="part2">2.4 I get undefined symbols such as bgnpolygon, v3f, etc...</a></h2>
<p>
<a name="part2">You're application is written in IRIS GL, not OpenGL.
IRIS GL was the predecessor to OpenGL and is a different thing (almost)
@@ -215,7 +196,7 @@ Mesa's not the solution.
</a></p>
<h2><a name="part2">2.4 Where is the GLUT library?</a></h2>
<h2><a name="part2">2.5 Where is the GLUT library?</a></h2>
<p>
<a name="part2">GLUT (OpenGL Utility Toolkit) is in the separate MesaDemos-x.y.z.tar.gz file.
If you don't already have GLUT installed, you should grab the MesaDemos
@@ -224,7 +205,7 @@ package and unpack it before compiling Mesa.
<h2><a name="part2">2.5 What's the proper place for the libraries and headers?</a></h2>
<h2><a name="part2">2.6 What's the proper place for the libraries and headers?</a></h2>
<p>
<a name="part2">On Linux-based systems you'll want to follow the
</a><a href="http://oss.sgi.com/projects/ogl-sample/ABI/index.html"

View File

@@ -36,7 +36,7 @@ Open SG PLUS</a> - a scene-graph library
</a> - a scene-graph library
<li><a href="http://www.openvrml.org/" target="_parent">OpenVRML</a>
- a VRML parsing/display library with "lookat" - an example VRML browser
<li><a href="http://plib.sourceforge.net/" target="_parent">PLIB</a> - A collection of portable games libraries, including an OpenGL GUI and a simple Scene Graph API
<li><a href="http://www.woodsoup.org/projs/plib" target="_parent">PLIB</a> - A collection of portable games libraries, including an OpenGL GUI and a simple Scene Graph API
<li><a href="ftp://ftp.troll.no/contest/Pryan-1.2.tar.gz" target="_parent">Pryan</a> - an OpenInventor-like toolkit
<li><a href="http://starship.python.net:9673/crew/da/Code/PyOpenGL" target="_parent">PyOpenGL</a> - OpenGL interface for Python
<li><a href="http://www.quesa.org/" target="_parent">Quesa</a> - QuickDraw3D-compatible library based on OpenGL, Mesa or Direct3D

View File

@@ -7,78 +7,6 @@
<H1>News</H1>
<h2>December 9, 2004</h2>
<p>
Mesa 6.2.1 has been released.
This is a stable release which just fixes bugs since the 6.2 release.
</p>
<pre>
Bug fixes:
- don't apply regular fog or color sum when using a fragment program
- glProgramEnvParameter4fARB always generated an error on
GL_FRAGMENT_PROGRAM_ARB (fdo bug 1645)
- glVertexAttrib3svNV and glVertexAttrib3svARB were broken
- fixed width/height mix-up in glSeparableFilter2D()
- fixed regression in glCopyPixels + convolution
- glReadPixels from a clipped front color buffer didn't always work
- glTexImage didn't accept GL_RED/GREEN/BLUE as the format
- Attempting queries/accesses of VBO 0 weren't detected as errors
- paletted textures failed if the palette had fewer that 256 entries
Changes:
- fixed a bunch of compiler warnings found with gcc 3.4
- bug reports should to go bugzilla.freedesktop.org
</pre>
<p>
The MD5 checksums are:
</p>
<pre>
80008a92f6e055d3bfdde2cf331ec3fa MesaLib-6.2.1.tar.gz
f43228cd2bf70f583ef3275c1c545421 MesaLib-6.2.1.tar.bz2
dec26cfd40116ad021020fea2d94f652 MesaLib-6.2.1.zip
2c7af3c986a7571c8713c8bfee7e49e3 MesaDemos-6.2.1.tar.gz
3cac74667b50bcbd4f67f594fb4224a2 MesaDemos-6.2.1.tar.bz2
75b3edd12eb2b370caf05f29b99e508a MesaDemos-6.2.1.zip
</pre>
<h2>October 2, 2004</h2>
<p>
Mesa 6.2 has been released.
This is a stable release which just fixes bugs since the 6.1 release.
</p>
<pre>
New:
- enabled GL_ARB_texture_rectangle (same as GL_NV_texture_rectangle)
- updated Doxygen support (Jose Fonseca)
Changes:
- some GGI driver updates (Christoph Egger, bug 1025977)
Bug fixes:
- Omit GL_ARB_texture_non_power_of_two from list of OpenGL 1.5 features
- fixed a few compilation issues on IRIX
- fixed a matrix classification bug (reported by Wes Bethel)
- we weren't reseting the vertex/fragment program error state
before parsing (Dave Reveman)
- adjust texcoords for sampling texture rectangles (Dave Reveman)
- glGet*(GL_MAX_VERTEX_ATTRIBS_ARB) wasn't implemented
- repeated calls to glDeleteTexture(t) could lead to a crash
- fixed potential ref count bugs in VBOs and vertex/fragment programs
- spriteblast demo didn't handle window size changes correctly
- glTexSubImage didn't handle pixels=NULL correctly for PBOs
- fixed color index mode glDrawPixels bug (Karl Schultz)
</pre>
<p>
The MD5 checksums are:
</p>
<pre>
9e8f34b059272dbb8e1f2c968b33bbf0 MesaLib-6.2.tar.gz
3d6a6362390b6a37d3cb2e615f3ac7db MesaLib-6.2.tar.bz2
6cfd7895d28e695c0dbbed9469564091 MesaLib-6.2.zip
3e06e33b0809f09855cb60883b8bdfef MesaDemos-6.2.tar.gz
9d160009c3dfdb35fe7e4088c9ba8f85 MesaDemos-6.2.tar.bz2
856f7ec947122eb3c8985ebc2f654dcd MesaDemos-6.2.zip
</pre>
<h2>August 18, 2004</h2>
<p>
Mesa 6.1 has been released.
@@ -958,6 +886,6 @@ source code</a>.</p>
<hr>
$Id: news.html,v 3.16 2004/12/09 23:21:36 brianp Exp $
$Id: news.html,v 3.14 2004/08/18 22:41:09 brianp Exp $
</body>
</html>

View File

@@ -10,7 +10,6 @@
Basically, FBconfigs and PBuffers allow you to do off-screen rendering
with OpenGL. The OSMesa interface does basically the same thing, but
fbconfigs and pbuffers are supported by more vendors.
PBuffer rendering may also be hardware accelerated.
</p>
<p>

View File

@@ -11,8 +11,6 @@ The release notes summarize what's new or changed in each Mesa release.
</p>
<UL>
<LI><A HREF="RELNOTES-6.3">RELNOTES-6.3</A>
<LI><A HREF="RELNOTES-6.2.1">RELNOTES-6.2.1</A>
<LI><A HREF="RELNOTES-6.2">RELNOTES-6.2</A>
<LI><A HREF="RELNOTES-6.1">RELNOTES-6.1</A>
<LI><A HREF="RELNOTES-6.0">RELNOTES-6.0</A>

View File

@@ -7,8 +7,8 @@
<H1>Utilities</H1>
<ul>
<li><a href="http://fsv.sourceforge.net/"
target="_parent">fsv</a> - 3D file system visualizer
<li><a href="http://fox.mit.edu/skunk/soft/fsv/"
target="_parent">fvs</a> - 3D file system visualizer
<li><a href="http://www.dgp.utoronto.ca/%7Emac/projects/glbiff.html"
target="_parent">glbiff</a> - GL version of xbiff

View File

@@ -23,9 +23,9 @@
*/
/*
* DOS/DJGPP device driver v1.7 for Mesa
* DOS/DJGPP device driver v1.6 for Mesa
*
* Copyright (C) 2002 - Daniel Borca
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@users.sourceforge.net
* Web : http://www.geocities.com/dborca
*/
@@ -35,7 +35,7 @@
#define DMESA_H_included
#define DMESA_MAJOR_VERSION 6
#define DMESA_MINOR_VERSION 3
#define DMESA_MINOR_VERSION 1
/* Sample Usage:
*
@@ -138,8 +138,7 @@ void DMesaSetCI (int ndx, GLfloat red, GLfloat green, GLfloat blue);
/*
* DMesa functions
*/
typedef void (*DMesaProc) (void);
DMesaProc DMesaGetProcAddress (const char *name);
void *DMesaGetProcAddress (const char *name);
/*
* DMesa state retrieval.

View File

@@ -38,8 +38,8 @@ extern "C" {
#endif
#define FXMESA_MAJOR_VERSION 6
#define FXMESA_MINOR_VERSION 3
#define FXMESA_MAJOR_VERSION 5
#define FXMESA_MINOR_VERSION 0
/*

View File

@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
* Version: 6.3
* Version: 6.2
*
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
@@ -38,6 +38,8 @@
*/
#if !defined(__SCITECH_SNAP__)
#include <stddef.h> /* to get ptrdiff_t, used below */
#if defined(__BEOS__)
#include <stdlib.h> /* to get some BeOS-isms */
#endif
@@ -51,9 +53,9 @@
#endif
#if !defined(OPENSTEP) && (defined(__WIN32__) && !defined(__CYGWIN__))
# if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */
# if defined(_MSC_VER) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */
# define GLAPI __declspec(dllexport)
# elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
# elif defined(_MSC_VER) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
# define GLAPI __declspec(dllimport)
# else /* for use with static link lib build of Win32 edition only */
# define GLAPI extern
@@ -62,7 +64,11 @@
#elif defined(__CYGWIN__) && defined(USE_OPENGL32) /* use native windows opengl32 */
# define GLAPI extern
# define GLAPIENTRY __stdcall
#endif /* WIN32 && !CYGWIN */
#else
/* non-Windows compilation */
# define GLAPI extern
# define GLAPIENTRY
#endif /* WIN32 / CYGWIN bracket */
#if (defined(__BEOS__) && defined(__POWERPC__)) || defined(__QUICKDRAW__)
# define PRAGMA_EXPORT_SUPPORTED 1
@@ -89,22 +95,10 @@
#pragma import on
#endif
#ifndef GLAPI
#define GLAPI extern
#endif
#ifndef GLAPIENTRY
#define GLAPIENTRY
#endif
#ifndef APIENTRY
#define APIENTRY GLAPIENTRY
#endif
/* "P" suffix for when function returns a pointer */
#ifndef APIENTRYP
#define APIENTRYP APIENTRY *
#endif
#ifndef GLAPIENTRYP
#define GLAPIENTRYP GLAPIENTRY *
@@ -850,7 +844,7 @@ GLAPI GLint GLAPIENTRY glRenderMode( GLenum mode );
GLAPI GLenum GLAPIENTRY glGetError( void );
GLAPI const GLubyte GLAPIENTRYP glGetString( GLenum name );
GLAPI const GLubyte* GLAPIENTRY glGetString( GLenum name );
GLAPI void GLAPIENTRY glFinish( void );
@@ -2232,17 +2226,6 @@ typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEATIPROC) (GLenum modeRGB, GLen
#endif /* GL_ATI_blend_equation_separate */
/* As soon as the official glext.h is updated to include this, it will be
* removed from here.
*/
#ifndef GL_OES_read_format
#define GL_OES_read_format 1
#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A
#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B
#endif /* GL_OES_read_format */
/**
** NOTE!!!!! If you add new functions to this file, or update
** glext.h be sure to regenerate the gl_mangle.h file. See comments

View File

@@ -30,6 +30,7 @@
/* Internal symbols which may collide with other OpenGL implementations. */
#define __glCoreCreateContext __mglCoreCreateContext
#define __glCoreNopDispatch __mglCoreNopDispatch
#define gl__unused413 MANGLE(__unused413)
/*REGENERATE_TO_END-----------ALL LINES BELOW HERE GET REPLACED ON REGENERATION */

View File

@@ -75,7 +75,7 @@ extern "C" {
To avoid the atexit workaround, #define GLUT_DISABLE_ATEXIT_HACK. */
/* XXX This is from Win32's <process.h> */
# if !defined(_MSC_VER) && !defined(__MINGW32__) && !defined(__cdecl)
# if !defined(_MSC_VER) && !defined(__cdecl)
/* Define __cdecl for non-Microsoft compilers. */
# define __cdecl
# define GLUT_DEFINED___CDECL
@@ -108,7 +108,7 @@ extern _CRTIMP void __cdecl exit(int);
and redifinition of Windows system defs, also removes requirement of
pretty much any standard windows header from this file */
#if (_MSC_VER >= 800) || defined(__MINGW32__) || defined(_STDCALL_SUPPORTED) || defined(__CYGWIN32__)
#if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__CYGWIN32__)
# define GLUTAPIENTRY __stdcall
#else
# define GLUTAPIENTRY
@@ -664,8 +664,7 @@ GLUTAPI int GLUTAPIENTRY glutGetModifiers(void);
GLUTAPI int GLUTAPIENTRY glutLayerGet(GLenum type);
#endif
#if (GLUT_API_VERSION >= 5)
typedef void (*GLUTproc)();
GLUTAPI GLUTproc GLUTAPIENTRY glutGetProcAddress(const char *procName);
GLUTAPI void * GLUTAPIENTRY glutGetProcAddress(const char *procName);
#endif
/* GLUT font sub-API */

View File

@@ -331,15 +331,6 @@ typedef struct {
} GLXBufferClobberEventSGIX;
#endif
#if defined(__UNIXOS2__) || defined(__SOL64__)
typedef long int int32_t;
typedef long long int int64_t;
#elif defined( __VMS )
#include <inttypes.h>
#elif defined(__SCO__) || defined(__USLC__)
#include <stdint.h>
#endif
#ifndef GLX_VERSION_1_3
#define GLX_VERSION_1_3 1
#ifdef GLX_GLXEXT_PROTOTYPES
@@ -606,6 +597,11 @@ typedef Bool ( * PFNGLXSET3DFXMODEMESAPROC) (int mode);
#ifndef GLX_OML_sync_control
#define GLX_OML_sync_control 1
#if defined(__STDC_VERSION__)
#if __STDC_VERSION__ >= 199901L
/* Include ISO C99 integer types for OML_sync_control; need a better test */
#include <inttypes.h>
#ifdef GLX_GLXEXT_PROTOTYPES
extern Bool glXGetSyncValuesOML (Display *, GLXDrawable, int64_t *, int64_t *, int64_t *);
extern Bool glXGetMscRateOML (Display *, GLXDrawable, int32_t *, int32_t *);
@@ -618,6 +614,8 @@ typedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (Display *dpy, GLXDrawable drawable, i
typedef int64_t ( * PFNGLXSWAPBUFFERSMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder);
typedef Bool ( * PFNGLXWAITFORMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t *ust, int64_t *msc, int64_t *sbc);
typedef Bool ( * PFNGLXWAITFORSBCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_sbc, int64_t *ust, int64_t *msc, int64_t *sbc);
#endif /* C99 version test */
#endif /* STDC test */
#endif
#ifndef GLX_SGIX_hyperpipe_group
@@ -675,6 +673,7 @@ extern unsigned int glXGetAGPOffsetMESA (const void *);
typedef unsigned int ( * PFNGLXGETAGPOFFSETMESAPROC) (const void *pointer);
#endif
#ifdef __cplusplus
}
#endif

View File

@@ -149,8 +149,6 @@ typedef GLboolean (* PFNGLXGETDRAWABLEINFOPROC) ( __DRInativeDisplay *dpy, int s
int * backX, int * backY,
int * numBackClipRects, drm_clip_rect_t ** pBackClipRects );
/* Test for the xf86dri.h header file */
#ifndef _XF86DRI_H_
extern GLboolean XF86DRIDestroyContext( __DRInativeDisplay *dpy, int screen,
__DRIid context_id );
@@ -159,7 +157,6 @@ extern GLboolean XF86DRICreateDrawable( __DRInativeDisplay *dpy, int screen,
extern GLboolean XF86DRIDestroyDrawable( __DRInativeDisplay *dpy, int screen,
__DRIid drawable);
#endif
/*@}*/

View File

@@ -1,94 +0,0 @@
/* $XFree86: xc/programs/Xserver/GL/dri/sarea.h,v 1.11 2002/10/30 12:52:03 alanh Exp $ */
/**
* \file sarea.h
* SAREA definitions.
*
* \author Kevin E. Martin <kevin@precisioninsight.com>
* \author Jens Owen <jens@tungstengraphics.com>
* \author Rickard E. (Rik) Faith <faith@valinux.com>
*/
/*
* Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
* Copyright 2000 VA Linux Systems, 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 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 PRECISION INSIGHT AND/OR ITS 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.
*/
/* $XFree86: xc/programs/Xserver/GL/dri/sarea.h,v 1.11 2002/10/30 12:52:03 alanh Exp $ */
#ifndef _SAREA_H_
#define _SAREA_H_
#include "xf86drm.h"
/* SAREA area needs to be at least a page */
#if defined(__alpha__)
#define SAREA_MAX 0x2000
#elif defined(__ia64__)
#define SAREA_MAX 0x10000 /* 64kB */
#else
/* Intel 830M driver needs at least 8k SAREA */
#define SAREA_MAX 0x2000
#endif
#define SAREA_MAX_DRAWABLES 256
#define SAREA_DRAWABLE_CLAIMED_ENTRY 0x80000000
/**
* SAREA per drawable information.
*
* \sa _XF86DRISAREA.
*/
typedef struct _XF86DRISAREADrawable {
unsigned int stamp;
unsigned int flags;
} XF86DRISAREADrawableRec, *XF86DRISAREADrawablePtr;
/**
* SAREA frame information.
*
* \sa _XF86DRISAREA.
*/
typedef struct _XF86DRISAREAFrame {
unsigned int x;
unsigned int y;
unsigned int width;
unsigned int height;
unsigned int fullscreen;
} XF86DRISAREAFrameRec, *XF86DRISAREAFramePtr;
/**
* SAREA definition.
*/
typedef struct _XF86DRISAREA {
/** first thing is always the DRM locking structure */
drmLock lock;
/** \todo Use readers/writer lock for drawable_lock */
drmLock drawable_lock;
XF86DRISAREADrawableRec drawableTable[SAREA_MAX_DRAWABLES];
XF86DRISAREAFrameRec frame;
drm_context_t dummy_context;
} XF86DRISAREARec, *XF86DRISAREAPtr;
#endif

View File

@@ -32,7 +32,7 @@
#define _mesa_wgl_h_
#include <GL/gl.h>
#include <gl/gl.h>
#ifdef __cplusplus
extern "C" {
@@ -40,10 +40,10 @@ extern "C" {
#if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN32__))
# if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */
# if defined(_MSC_VER) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */
# define GLAPI __declspec(dllexport)
# define WGLAPI __declspec(dllexport)
# elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
# elif defined(_MSC_VER) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
# define GLAPI __declspec(dllimport)
# define WGLAPI __declspec(dllimport)
# else /* for use with static link lib build of Win32 edition only */

View File

@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
* Version: 6.3
* Version: 4.1
*
* Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -60,8 +60,8 @@ extern "C" {
#include <GL/gl.h>
#define OSMESA_MAJOR_VERSION 6
#define OSMESA_MINOR_VERSION 3
#define OSMESA_MAJOR_VERSION 4
#define OSMESA_MINOR_VERSION 1
#define OSMESA_PATCH_VERSION 0
@@ -252,18 +252,12 @@ OSMesaGetColorBuffer( OSMesaContext c, GLint *width, GLint *height,
/**
* This typedef is new in Mesa 6.3.
*/
typedef void (*OSMESAproc)();
/*
* Return pointer to the named function.
*
* New in Mesa 4.1
* Return OSMESAproc in 6.3.
*/
GLAPI OSMESAproc GLAPIENTRY
GLAPI void * GLAPIENTRY
OSMesaGetProcAddress( const char *funcName );

View File

@@ -50,7 +50,7 @@ extern "C" {
#endif
#include "GL/gl.h"
#include "gl\gl.h"
#if defined(_MSV_VER) && !defined(__GNUC__)
# pragma warning (disable:4273)

View File

@@ -87,8 +87,8 @@ extern struct Library *XLibBase;
#endif
#define XMESA_MAJOR_VERSION 6
#define XMESA_MINOR_VERSION 3
#define XMESA_MAJOR_VERSION 4
#define XMESA_MINOR_VERSION 1

View File

@@ -7,8 +7,6 @@ INCDIR = $(TOP)/include
OSMESA_LIBS = -L$(LIB_DIR) -lglut -lOSMesa -lGLU -lGL $(APP_LIB_DEPS)
OSMESA32_LIBS = -L$(LIB_DIR) -lglut -lOSMesa32 -lGLU -lGL $(APP_LIB_DEPS)
LIB_DEP = $(LIB_DIR)/$(GL_LIB_NAME) $(LIB_DIR)/$(GLU_LIB_NAME) $(LIB_DIR)/$(GLUT_LIB_NAME)
PROGS = \
@@ -90,8 +88,3 @@ readtex.h:
# special case: need the -lOSMesa library:
osdemo: osdemo.c
$(CC) -I$(INCDIR) $(CFLAGS) osdemo.c $(OSMESA_LIBS) -o $@
# another special case: need the -lOSMesa32 library:
osdemo32: osdemo32.c
$(CC) -I$(INCDIR) $(CFLAGS) osdemo32.c $(OSMESA32_LIBS) -o $@

View File

@@ -134,9 +134,6 @@ Package=<4>
Begin Project Dependency
Project_Dep_Name spriteblast
End Project Dependency
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -149,9 +146,6 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -164,9 +158,6 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -179,9 +170,6 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -194,9 +182,6 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -209,9 +194,6 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -224,9 +206,6 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -239,9 +218,6 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -254,9 +230,6 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -269,9 +242,6 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -282,21 +252,6 @@ Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
Project: "glut"="..\..\..\src\glut\glx\glut.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
@@ -311,9 +266,6 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -326,9 +278,6 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -341,9 +290,6 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -356,9 +302,6 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -371,9 +314,6 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -386,9 +326,6 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -401,9 +338,6 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -416,9 +350,6 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -431,9 +362,6 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -446,9 +374,6 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -461,9 +386,6 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -476,9 +398,6 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -491,9 +410,6 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -506,9 +422,6 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -521,9 +434,6 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -536,9 +446,6 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -551,9 +458,6 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -566,9 +470,6 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -581,9 +482,6 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -596,9 +494,6 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -611,9 +506,6 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -626,9 +518,6 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -641,9 +530,6 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -656,9 +542,6 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -671,9 +554,6 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -686,9 +566,6 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -701,9 +578,6 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -716,9 +590,6 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -731,9 +602,6 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -746,9 +614,6 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################
@@ -761,9 +626,6 @@ Package=<5>
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name glut
End Project Dependency
}}}
###############################################################################

View File

@@ -217,7 +217,7 @@ static void Init( void )
"MUL normal, fragment.texcoord[0], len.y; \n"
"# Compute dot product of light direction and normal vector\n"
"DP3_SAT dotProd, lightDir, normal; # limited to [0,1]\n"
"DP3 dotProd, lightDir, normal; \n"
"MUL diffuseColor, Diffuse, dotProd; # diffuse attenuation\n"

View File

@@ -241,16 +241,16 @@ static void SpecialKey( int key, int x, int y )
}
static void Init( GLboolean ciMode, const char *filename )
static void Init( GLboolean ciMode )
{
static const GLfloat fogColor[4] = {0, 1, 0, 0};
printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
Image = LoadRGBImage( filename, &ImgWidth, &ImgHeight, &ImgFormat );
Image = LoadRGBImage( IMAGE_FILE, &ImgWidth, &ImgHeight, &ImgFormat );
if (!Image) {
printf("Couldn't read %s\n", filename);
printf("Couldn't read %s\n", IMAGE_FILE);
exit(0);
}
@@ -320,15 +320,9 @@ static void Usage(void)
int main( int argc, char *argv[] )
{
GLboolean ciMode = GL_FALSE;
const char *filename = IMAGE_FILE;
int i = 1;
if (argc > i && strcmp(argv[i], "-ci")==0) {
if (argc > 1 && strcmp(argv[1], "-ci")==0) {
ciMode = GL_TRUE;
i++;
}
if (argc > i) {
filename = argv[i];
}
glutInit( &argc, argv );
@@ -342,7 +336,7 @@ int main( int argc, char *argv[] )
glutCreateWindow(argv[0]);
Init(ciMode, filename);
Init(ciMode);
Usage();
glutReshapeFunc( Reshape );

View File

@@ -180,7 +180,7 @@ static void Init( void )
"MUL R1, f[TEX0], R1.y;\n"
"# Compute dot product of light direction and normal vector\n"
"DP3_SAT R2, R0, R1;"
"DP3 R2, R0, R1;"
"MUL R3, Diffuse, R2; # diffuse attenuation\n"

View File

@@ -207,8 +207,6 @@ Key( unsigned char key, int x, int y )
static void
Init( GLboolean ciMode )
{
GLboolean have_read_format = GL_FALSE;
printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
@@ -236,20 +234,6 @@ Init( GLboolean ciMode )
}
}
#ifdef GL_OES_read_format
if ( glutExtensionSupported( "GL_OES_read_format" ) ) {
glGetIntegerv(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES, (GLint *) &ReadType);
glGetIntegerv(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES, (GLint *) &ReadFormat);
have_read_format = GL_TRUE;
}
#endif
printf( "GL_OES_read_format %ssupported. "
"Using type / format = 0x%04x / 0x%04x\n",
(have_read_format) ? "" : "not ",
ReadType, ReadFormat );
printf("Loaded %d by %d image\n", ImgWidth, ImgHeight );
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);

View File

@@ -47,7 +47,7 @@ clean:
depend: $(SOURCES)
touch depend
$(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(SOURCES) > /dev/null
$(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(SOURCES) > /dev/null 2>&1
# Emacs tags

View File

@@ -20,9 +20,9 @@
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# DOS/DJGPP samples makefile v1.6 for Mesa
# DOS/DJGPP samples makefile v1.5 for Mesa
#
# Copyright (C) 2002 - Daniel Borca
# Copyright (C) 2002 - Borca Daniel
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
@@ -58,7 +58,7 @@ GLIDE ?= $(TOP)/glide3
CC = gcc
CFLAGS = -Wall -W -pedantic
CFLAGS += -O2 -ffast-math -mtune=$(CPU)
CFLAGS += -O2 -ffast-math -mcpu=$(CPU)
CFLAGS += -I$(TOP)/include -I../util
CFLAGS += -DGLUT_IMPORT_LIB
ifeq ($(FX),1)

View File

@@ -20,9 +20,9 @@
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# MinGW samples makefile v1.2 for Mesa
# MinGW samples makefile v1.1 for Mesa
#
# Copyright (C) 2002 - Daniel Borca
# Copyright (C) 2002 - Borca Daniel
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
@@ -48,7 +48,7 @@ CPU ?= pentium
CC = mingw32-gcc
CFLAGS = -Wall -W -pedantic
CFLAGS += -O2 -ffast-math -mtune=$(CPU)
CFLAGS += -O2 -ffast-math -mcpu=$(CPU)
CFLAGS += -I$(TOP)/include -I../util
ifeq ($(FX),1)
CFLAGS += -DFX

View File

@@ -31,14 +31,12 @@ SOURCES = antialias.c \
getprocaddress.c \
manytex.c \
multipal.c \
no_s3tc.c \
packedpixels.c \
pbo.c \
projtex.c \
seccolor.c \
sharedtex.c \
stencilwrap.c \
stencil_wrap.c \
tex1d.c \
texline.c \
texrect.c \
@@ -88,7 +86,7 @@ clean:
# auto code generation
getprocaddress: getprocaddress.c getproclist.h
getproclist.h: $(TOP)/src/mesa/glapi/gl_API.xml getprocaddress.c getprocaddress.py
getproclist.h: $(TOP)/src/mesa/glapi/APIspec getprocaddress.c getprocaddress.py
python getprocaddress.py > getproclist.h

View File

@@ -70,13 +70,10 @@ class results:
def compare_results(self, other):
for name in self.cycles:
if other.cycles.has_key(name):
a = float(self.cycles[name]) / float(self.iterations)
b = float(other.cycles[name]) / float(other.iterations)
if abs( a ) < 0.000001:
print "a = %f, b = %f" % (a, b)
else:
p = (100.0 * b / a) - 100.0
print "%- 20s %7.2f - %7.2f = % -6.2f (%+.1f%%)" % (name, a, b, a - b, p)
a = float(self.cycles[name]) / self.iterations
b = float(other.cycles[name]) / other.iterations
p = (100.0 * b / a) - 100.0
print "%- 20s %7.2f - %7.2f = % -6.2f (%+.1f%%)" % (name, a, b, a - b, p)
return

View File

@@ -1,258 +0,0 @@
/*
* Exercise the EXT_422_pixels extension, a less convenient
* alternative to MESA_ycbcr_texture. Requires ARB_fragment_program
* to perform the final YUV->RGB conversion.
*
* Brian Paul 13 September 2002
* Keith Whitwell 30 November 2004
*/
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define GL_GLEXT_PROTOTYPES
#include <GL/glut.h>
#include <assert.h>
#include "../util/readtex.c" /* I know, this is a hack. */
#define TEXTURE_FILE "../images/tile.rgb"
static GLfloat Xrot = 0, Yrot = 0, Zrot = 0;
static GLint ImgWidth, ImgHeight;
static GLushort *ImageYUV = NULL;
static const GLuint yuvObj = 100;
static const GLuint rgbObj = 101;
static void Init( int argc, char *argv[] );
static void DrawObject(void)
{
glBegin(GL_QUADS);
glTexCoord2f(0, 0);
glVertex2f(-1.0, -1.0);
glTexCoord2f(1, 0);
glVertex2f(1.0, -1.0);
glTexCoord2f(1, 1);
glVertex2f(1.0, 1.0);
glTexCoord2f(0, 1);
glVertex2f(-1.0, 1.0);
glEnd();
}
static void Display( void )
{
static int firsttime = 1;
if (firsttime) {
firsttime = 0;
Init( 0, 0 ); /* don't ask */
}
glClear( GL_COLOR_BUFFER_BIT );
glBindTexture(GL_TEXTURE_2D, yuvObj);
glPushMatrix();
glEnable(GL_FRAGMENT_PROGRAM_ARB);
glTranslatef( -1.1, 0.0, -15.0 );
glRotatef(Xrot, 1.0, 0.0, 0.0);
glRotatef(Yrot, 0.0, 1.0, 0.0);
glRotatef(Zrot, 0.0, 0.0, 1.0);
glBindTexture(GL_TEXTURE_2D, yuvObj);
DrawObject();
glPopMatrix();
glPushMatrix();
glDisable(GL_FRAGMENT_PROGRAM_ARB);
glTranslatef( 1.1, 0.0, -15.0 );
glRotatef(Xrot, 1.0, 0.0, 0.0);
glRotatef(Yrot, 0.0, 1.0, 0.0);
glRotatef(Zrot, 0.0, 0.0, 1.0);
glBindTexture(GL_TEXTURE_2D, rgbObj);
DrawObject();
glPopMatrix();
glutSwapBuffers();
}
static void Reshape( int width, int height )
{
glViewport( 0, 0, width, height );
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
glFrustum( -1.1, 1.1, -1.1, 1.1, 10.0, 100.0 );
glMatrixMode( GL_MODELVIEW );
glLoadIdentity();
glTranslatef( 0.0, 0.0, -15.0 );
}
static void Key( unsigned char key, int x, int y )
{
(void) x;
(void) y;
switch (key) {
case 27:
exit(0);
break;
}
glutPostRedisplay();
}
static void SpecialKey( int key, int x, int y )
{
float step = 3.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();
}
/* #define LINEAR_FILTER */
static void Init( int argc, char *argv[] )
{
const char *file;
const GLfloat yuvtorgb[16] = {
1.164, 1.164, 1.164, 0,
0, -.391, 2.018, 0,
1.596, -.813, 0.0, 0,
(-.0625*1.164 + -.5*1.596), (-.0625*1.164 + -.5*-.813 + -.5*-.391), (-.0625*1.164 + -.5*2.018), 1
};
if (!glutExtensionSupported("GL_ARB_fragment_program")) {
printf("Error: GL_ARB_fragment_program not supported!\n");
exit(1);
}
if (!glutExtensionSupported("GL_EXT_422_pixels")) {
printf("Error: GL_EXT_422_pixels not supported!\n");
exit(1);
}
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
file = TEXTURE_FILE;
/* Load the texture as YCbCr.
*/
glBindTexture(GL_TEXTURE_2D, yuvObj);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
ImageYUV = LoadYUVImage(file, &ImgWidth, &ImgHeight );
if (!ImageYUV) {
printf("Couldn't read %s\n", TEXTURE_FILE);
exit(0);
}
glTexImage2D(GL_TEXTURE_2D, 0,
GL_RGB,
ImgWidth, ImgHeight, 0,
GL_422_EXT,
GL_UNSIGNED_BYTE, ImageYUV);
glEnable(GL_TEXTURE_2D);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
{
static const char *modulateYUV =
"!!ARBfp1.0\n"
"TEMP R0;\n"
"TEX R0, fragment.texcoord[0], texture[0], 2D; \n"
"ADD R0, R0, {-0.0625, -0.5, -0.5, 0.0}; \n"
"DP3 result.color.x, R0, {1.164, 1.596, 0.0}; \n"
"DP3 result.color.y, R0, {1.164, -0.813, -0.391}; \n"
"DP3 result.color.z, R0, {1.164, 0.0, 2.018}; \n"
"MOV result.color.w, R0.w; \n"
"END"
;
GLuint modulateProg;
/* Setup the fragment program */
glGenProgramsARB(1, &modulateProg);
glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
strlen(modulateYUV), (const GLubyte *)modulateYUV);
printf("glGetError = 0x%x\n", (int) glGetError());
printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
(char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
assert(glIsProgramARB(modulateProg));
}
/* Now the same, but use a color matrix to do the conversion at
* upload time:
*/
glBindTexture(GL_TEXTURE_2D, rgbObj);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glMatrixMode( GL_COLOR_MATRIX );
glLoadMatrixf( yuvtorgb );
glTexImage2D(GL_TEXTURE_2D, 0,
GL_RGB,
ImgWidth, ImgHeight, 0,
GL_422_EXT,
GL_UNSIGNED_BYTE, ImageYUV);
glLoadIdentity();
glMatrixMode( GL_MODELVIEW );
glEnable(GL_TEXTURE_2D);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glShadeModel(GL_FLAT);
glClearColor(0.3, 0.3, 0.4, 1.0);
}
int main( int argc, char *argv[] )
{
glutInit( &argc, argv );
glutInitWindowSize( 300, 300 );
glutInitWindowPosition( 0, 0 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow(argv[0] );
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
glutDisplayFunc( Display );
glutMainLoop();
return 0;
}

View File

@@ -35,12 +35,10 @@
#include <math.h>
typedef void (*generic_func)();
#define EQUAL(X, Y) (fabs((X) - (Y)) < 0.001)
static GLboolean
test_ActiveTextureARB(generic_func func)
test_ActiveTextureARB(void *func)
{
PFNGLACTIVETEXTUREARBPROC activeTexture = (PFNGLACTIVETEXTUREARBPROC) func;
GLint t;
@@ -54,7 +52,7 @@ test_ActiveTextureARB(generic_func func)
static GLboolean
test_SecondaryColor3fEXT(generic_func func)
test_SecondaryColor3fEXT(void *func)
{
PFNGLSECONDARYCOLOR3FEXTPROC secColor3f = (PFNGLSECONDARYCOLOR3FEXTPROC) func;
GLfloat color[4];
@@ -68,7 +66,7 @@ test_SecondaryColor3fEXT(generic_func func)
static GLboolean
test_ActiveStencilFaceEXT(generic_func func)
test_ActiveStencilFaceEXT(void *func)
{
PFNGLACTIVESTENCILFACEEXTPROC activeFace = (PFNGLACTIVESTENCILFACEEXTPROC) func;
GLint face;
@@ -82,7 +80,7 @@ test_ActiveStencilFaceEXT(generic_func func)
static GLboolean
test_VertexAttrib1fvARB(generic_func func)
test_VertexAttrib1fvARB(void *func)
{
PFNGLVERTEXATTRIB1FVARBPROC vertexAttrib1fvARB = (PFNGLVERTEXATTRIB1FVARBPROC) func;
PFNGLGETVERTEXATTRIBFVARBPROC getVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC) glXGetProcAddressARB((const GLubyte *) "glGetVertexAttribfvARB");
@@ -99,7 +97,7 @@ test_VertexAttrib1fvARB(generic_func func)
}
static GLboolean
test_VertexAttrib4NubvARB(generic_func func)
test_VertexAttrib4NubvARB(void *func)
{
PFNGLVERTEXATTRIB4NUBVARBPROC vertexAttrib4NubvARB = (PFNGLVERTEXATTRIB4NUBVARBPROC) func;
PFNGLGETVERTEXATTRIBFVARBPROC getVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC) glXGetProcAddressARB((const GLubyte *) "glGetVertexAttribfvARB");
@@ -117,7 +115,7 @@ test_VertexAttrib4NubvARB(generic_func func)
static GLboolean
test_VertexAttrib4NuivARB(generic_func func)
test_VertexAttrib4NuivARB(void *func)
{
PFNGLVERTEXATTRIB4NUIVARBPROC vertexAttrib4NuivARB = (PFNGLVERTEXATTRIB4NUIVARBPROC) func;
PFNGLGETVERTEXATTRIBFVARBPROC getVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC) glXGetProcAddressARB((const GLubyte *) "glGetVertexAttribfvARB");
@@ -135,7 +133,7 @@ test_VertexAttrib4NuivARB(generic_func func)
static GLboolean
test_VertexAttrib4ivARB(generic_func func)
test_VertexAttrib4ivARB(void *func)
{
PFNGLVERTEXATTRIB4IVARBPROC vertexAttrib4ivARB = (PFNGLVERTEXATTRIB4IVARBPROC) func;
PFNGLGETVERTEXATTRIBFVARBPROC getVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC) glXGetProcAddressARB((const GLubyte *) "glGetVertexAttribfvARB");
@@ -153,7 +151,7 @@ test_VertexAttrib4ivARB(generic_func func)
static GLboolean
test_VertexAttrib4NsvARB(generic_func func)
test_VertexAttrib4NsvARB(void *func)
{
PFNGLVERTEXATTRIB4NSVARBPROC vertexAttrib4NsvARB = (PFNGLVERTEXATTRIB4NSVARBPROC) func;
PFNGLGETVERTEXATTRIBFVARBPROC getVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC) glXGetProcAddressARB((const GLubyte *) "glGetVertexAttribfvARB");
@@ -171,7 +169,7 @@ test_VertexAttrib4NsvARB(generic_func func)
static GLboolean
test_VertexAttrib4NusvARB(generic_func func)
test_VertexAttrib4NusvARB(void *func)
{
PFNGLVERTEXATTRIB4NUSVARBPROC vertexAttrib4NusvARB = (PFNGLVERTEXATTRIB4NUSVARBPROC) func;
PFNGLGETVERTEXATTRIBFVARBPROC getVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC) glXGetProcAddressARB((const GLubyte *) "glGetVertexAttribfvARB");
@@ -189,7 +187,7 @@ test_VertexAttrib4NusvARB(generic_func func)
static GLboolean
test_VertexAttrib4ubNV(generic_func func)
test_VertexAttrib4ubNV(void *func)
{
PFNGLVERTEXATTRIB4UBNVPROC vertexAttrib4ubNV = (PFNGLVERTEXATTRIB4UBNVPROC) func;
PFNGLGETVERTEXATTRIBFVNVPROC getVertexAttribfvNV = (PFNGLGETVERTEXATTRIBFVNVPROC) glXGetProcAddressARB((const GLubyte *) "glGetVertexAttribfvNV");
@@ -207,7 +205,7 @@ test_VertexAttrib4ubNV(generic_func func)
static GLboolean
test_VertexAttrib2sNV(generic_func func)
test_VertexAttrib2sNV(void *func)
{
PFNGLVERTEXATTRIB2SNVPROC vertexAttrib2sNV = (PFNGLVERTEXATTRIB2SNVPROC) func;
PFNGLGETVERTEXATTRIBFVNVPROC getVertexAttribfvNV = (PFNGLGETVERTEXATTRIBFVNVPROC) glXGetProcAddressARB((const GLubyte *) "glGetVertexAttribfvNV");
@@ -225,7 +223,7 @@ test_VertexAttrib2sNV(generic_func func)
static GLboolean
test_VertexAttrib3fNV(generic_func func)
test_VertexAttrib3fNV(void *func)
{
PFNGLVERTEXATTRIB3FNVPROC vertexAttrib3fNV = (PFNGLVERTEXATTRIB3FNVPROC) func;
PFNGLGETVERTEXATTRIBFVNVPROC getVertexAttribfvNV = (PFNGLGETVERTEXATTRIBFVNVPROC) glXGetProcAddressARB((const GLubyte *) "glGetVertexAttribfvNV");
@@ -243,7 +241,7 @@ test_VertexAttrib3fNV(generic_func func)
static GLboolean
test_VertexAttrib4dvNV(generic_func func)
test_VertexAttrib4dvNV(void *func)
{
PFNGLVERTEXATTRIB4DVNVPROC vertexAttrib4dvNV = (PFNGLVERTEXATTRIB4DVNVPROC) func;
PFNGLGETVERTEXATTRIBFVNVPROC getVertexAttribfvNV = (PFNGLGETVERTEXATTRIBFVNVPROC) glXGetProcAddressARB((const GLubyte *) "glGetVertexAttribfvNV");
@@ -310,7 +308,7 @@ check_functions( const char *extensions )
passes = 0;
}
else if (doTests) {
generic_func funcPtr = (generic_func) glXGetProcAddressARB((const GLubyte *) entry->name);
void *funcPtr = (void *) glXGetProcAddressARB((const GLubyte *) entry->name);
if (funcPtr) {
if (entry->test) {
GLboolean b;

View File

@@ -1,17 +1,39 @@
#!/usr/bin/env python
# $Id: getprocaddress.py,v 1.6 2004/11/27 19:57:46 brianp Exp $
# $Id: getprocaddress.py,v 1.3 2003/06/10 14:54:37 brianp Exp $
# Helper for the getprocaddress.c test.
from xml.sax import saxutils
from xml.sax import make_parser
from xml.sax.handler import feature_namespaces
import sys, getopt, re
sys.path.append("../../src/mesa/glapi/" )
import gl_XML
import license
import re, string
def PrintHead():
print """
struct name_test_pair {
const char *name;
GLboolean (*test)(void *);
};
static struct name_test_pair functions[] = {"""
def PrintTail():
print"""
{ NULL, NULL }
};
"""
def HaveTest(function):
testFuncs = [
"glActiveTextureARB",
"glSampleCoverageARB"
]
if function in testFuncs:
return 1
else:
return 0
def FindTestFunctions():
@@ -30,66 +52,45 @@ def FindTestFunctions():
return functions
class PrintExports(gl_XML.FilterGLAPISpecBase):
name = "gl_exports.py (from Mesa)"
def PrintFunctions(specFile, tests):
def __init__(self):
gl_XML.FilterGLAPISpecBase.__init__(self)
self.license = license.bsd_license_template % ( \
"""Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
(C) Copyright IBM Corporation 2004""", "BRIAN PAUL, IBM")
self.tests = FindTestFunctions()
self.prevCategory = ""
# init some vars
prevCategory = ''
funcName = ''
def printRealHeader(self):
print """
struct name_test_pair {
const char *name;
GLboolean (*test)(generic_func);
};
static struct name_test_pair functions[] = {"""
f = open(specFile)
for line in f.readlines():
def printRealFooter(self):
print"""
{ NULL, NULL }
};
"""
# split line into tokens
tokens = string.split(line)
def printFunction(self, f):
if f.category != self.prevCategory:
print ' { "-%s", NULL},' % f.category
self.prevCategory = f.category
if f.name in self.tests:
test = "test_%s" % f.name
else:
test = "NULL"
print ' { "gl%s", %s },' % (f.name, test)
return
if len(tokens) > 0 and line[0] != '#':
if tokens[0] == 'name':
if funcName != '':
if category != prevCategory:
print ' { "-%s", NULL},' % category
prevCategory = category
if funcName in tests:
test = "test_%s" % funcName
else:
test = "NULL"
print ' { "gl%s", %s },' % (funcName, test)
funcName = tokens[1]
elif tokens[0] == 'category':
category = tokens[1]
#endif
#endif
#endfor
#enddef
if __name__ == '__main__':
file_name = "../../src/mesa/glapi/gl_API.xml"
try:
(args, trail) = getopt.getopt(sys.argv[1:], "f:")
except Exception,e:
show_usage()
tests = FindTestFunctions()
PrintHead()
PrintFunctions("../../src/mesa/glapi/APIspec", tests)
PrintTail()
for (arg,val) in args:
if arg == "-f":
file_name = val
dh = PrintExports()
parser = make_parser()
parser.setFeature(feature_namespaces, 0)
parser.setContentHandler(dh)
f = open(file_name)
parser.parse(f)
dh.printHeader()
dh.printFunctions()
dh.printFooter()

View File

@@ -1,97 +0,0 @@
/*
* (C) Copyright IBM Corporation 2004
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* on the rights to use, copy, modify, merge, publish, distribute, sub
* license, and/or sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
* VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
* USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/**
* \file no_s3tc.c
* Test program to verify the behavior of an OpenGL implementation when
* an application calls \c glCompressedTexImage2D with an unsupported (but
* valid) compression format. The most common example is calling it with
* \c GL_COMPRESSED_RGBA_S3TC_DXT1_EXT when GL_EXT_texture_compression_s3tc
* is not supported.
*
* This tests Mesa bug #1028405.
*
* \author Ian Romanick <idr@us.ibm.com>
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <GL/glut.h>
#include <GL/glext.h>
static unsigned data[16];
int
main( int argc, char ** argv )
{
float gl_version;
GLenum format;
GLuint size;
GLuint width;
GLenum err;
glutInit( & argc, argv );
glutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE );
glutInitWindowPosition( 0, 0 );
glutInitWindowSize( 300, 300 );
glutCreateWindow( "No S3TC Test" );
gl_version = strtod( (const char *) glGetString( GL_VERSION ), NULL );
if ( ! glutExtensionSupported( "GL_ARB_texture_compression" )
&& (gl_version < 1.3) ) {
fprintf( stderr, "Either OpenGL 1.3 or GL_ARB_texture_compression "
"must be supported.\n" );
return( EXIT_SUCCESS );
}
if ( ! glutExtensionSupported( "GL_EXT_texture_compression_s3tc" ) ) {
format = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT;
width = 4;
size = 8;
}
else if ( ! glutExtensionSupported( "GL_3DFX_texture_compression_FXT1" ) ) {
format = GL_COMPRESSED_RGBA_FXT1_3DFX;
width = 8;
size = 16;
}
else {
fprintf( stderr, "Either GL_EXT_texture_compression_s3tc or "
"GL_3DFX_texture_compression_FXT1 must NOT be supported.\n" );
return( EXIT_SUCCESS );
}
glCompressedTexImage2D( GL_TEXTURE_2D, 0, format, width, 4, 0,
size, data );
err = glGetError();
if ( err != GL_INVALID_ENUM ) {
fprintf( stderr, "GL error 0x%04x should have been generated, but "
"0x%04x was generated instead.\n", GL_INVALID_ENUM, err );
}
return (err == GL_INVALID_ENUM) ? EXIT_SUCCESS : EXIT_FAILURE;
}

View File

@@ -103,7 +103,6 @@ Display( void )
/*** Draw from the DrawPBO */
glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, DrawPBO);
glDrawPixels(ImgWidth, ImgHeight, ImgFormat, GL_UNSIGNED_BYTE, 0);
glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, 0);
/* do readpixels, drawpixels */
glRasterPos2i(BPosX, 5);
@@ -139,7 +138,6 @@ Display( void )
/*** draw from the Temp PBO */
glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, TempPBO);
glDrawPixels(ImgWidth, ImgHeight, ReadFormat, ReadType, 0);
glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT, 0);
/* do copypixels */
glRasterPos2i(CPosX, 5);

View File

@@ -1,257 +0,0 @@
/*
* (C) Copyright IBM Corporation 2004
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* on the rights to use, copy, modify, merge, publish, distribute, sub
* license, and/or sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
* VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
* USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/**
* \file stencil_wrap.c
*
* Simple test of GL_EXT_stencil_wrap functionality. Four squares are drawn
* with different stencil modes, but all should be rendered with the same
* final color.
*
* \author Ian Romanick <idr@us.ibm.com>
*/
#include <stdio.h>
#include <stdlib.h>
#include <GL/glut.h>
static int Width = 550;
static int Height = 200;
static const GLfloat Near = 5.0, Far = 25.0;
static void Display( void )
{
GLint max_stencil;
GLint stencil_bits;
unsigned i;
glGetIntegerv( GL_STENCIL_BITS, & stencil_bits );
max_stencil = (1U << stencil_bits) - 1;
printf( "Stencil bits = %u, maximum stencil value = 0x%08x\n",
stencil_bits, max_stencil );
glClearStencil( 0 );
glClearColor( 0.2, 0.2, 0.8, 0 );
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT
| GL_STENCIL_BUFFER_BIT );
glPushMatrix();
/* This is the "reference" square.
*/
glDisable(GL_STENCIL_TEST);
glTranslatef(-6.0, 0, 0);
glBegin(GL_QUADS);
glColor3f( 0.5, 0.5, 0.5 );
glVertex2f(-1, -1);
glVertex2f( 1, -1);
glVertex2f( 1, 1);
glVertex2f(-1, 1);
glEnd();
glEnable(GL_STENCIL_TEST);
/* Draw the first two squares using the two non-wrap (i.e., saturate)
* modes.
*/
glStencilFunc(GL_ALWAYS, 0, ~0);
glStencilOp(GL_KEEP, GL_KEEP, GL_INCR);
glTranslatef(3.0, 0, 0);
glBegin(GL_QUADS);
glColor3f( 0.9, 0.9, 0.9 );
for ( i = 0 ; i < (max_stencil + 5) ; i++ ) {
glVertex2f(-1, -1);
glVertex2f( 1, -1);
glVertex2f( 1, 1);
glVertex2f(-1, 1);
}
glEnd();
glStencilFunc(GL_EQUAL, max_stencil, ~0);
glBegin(GL_QUADS);
glColor3f( 0.5, 0.5, 0.5 );
glVertex2f(-1, -1);
glVertex2f( 1, -1);
glVertex2f( 1, 1);
glVertex2f(-1, 1);
glEnd();
glStencilFunc(GL_ALWAYS, 0, ~0);
glStencilOp(GL_KEEP, GL_KEEP, GL_DECR);
glTranslatef(3.0, 0, 0);
glBegin(GL_QUADS);
glColor3f( 0.9, 0.9, 0.9 );
for ( i = 0 ; i < (max_stencil + 5) ; i++ ) {
glVertex2f(-1, -1);
glVertex2f( 1, -1);
glVertex2f( 1, 1);
glVertex2f(-1, 1);
}
glEnd();
glStencilFunc(GL_EQUAL, 0, ~0);
glBegin(GL_QUADS);
glColor3f( 0.5, 0.5, 0.5 );
glVertex2f(-1, -1);
glVertex2f( 1, -1);
glVertex2f( 1, 1);
glVertex2f(-1, 1);
glEnd();
/* Draw the last two squares using the two wrap modes.
*/
glStencilFunc(GL_ALWAYS, 0, ~0);
glStencilOp(GL_KEEP, GL_KEEP, GL_INCR_WRAP);
glTranslatef(3.0, 0, 0);
glBegin(GL_QUADS);
glColor3f( 0.9, 0.9, 0.9 );
for ( i = 0 ; i < (max_stencil + 5) ; i++ ) {
glVertex2f(-1, -1);
glVertex2f( 1, -1);
glVertex2f( 1, 1);
glVertex2f(-1, 1);
}
glEnd();
glStencilFunc(GL_EQUAL, 4, ~0);
glBegin(GL_QUADS);
glColor3f( 0.5, 0.5, 0.5 );
glVertex2f(-1, -1);
glVertex2f( 1, -1);
glVertex2f( 1, 1);
glVertex2f(-1, 1);
glEnd();
glStencilFunc(GL_ALWAYS, 0, ~0);
glStencilOp(GL_KEEP, GL_KEEP, GL_DECR_WRAP);
glTranslatef(3.0, 0, 0);
glBegin(GL_QUADS);
glColor3f( 0.9, 0.9, 0.9 );
for ( i = 0 ; i < 5 ; i++ ) {
glVertex2f(-1, -1);
glVertex2f( 1, -1);
glVertex2f( 1, 1);
glVertex2f(-1, 1);
}
glEnd();
glStencilFunc(GL_EQUAL, (max_stencil - 4), ~0);
glBegin(GL_QUADS);
glColor3f( 0.5, 0.5, 0.5 );
glVertex2f(-1, -1);
glVertex2f( 1, -1);
glVertex2f( 1, 1);
glVertex2f(-1, 1);
glEnd();
glPopMatrix();
glutSwapBuffers();
}
static void Reshape( int width, int height )
{
GLfloat ar = (float) width / (float) height;
Width = width;
Height = height;
glViewport( 0, 0, width, height );
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
glFrustum( -ar, ar, -1.0, 1.0, Near, Far );
glMatrixMode( GL_MODELVIEW );
glLoadIdentity();
glTranslatef( 0.0, 0.0, -15.0 );
}
static void Key( unsigned char key, int x, int y )
{
(void) x;
(void) y;
switch (key) {
case 27:
exit(0);
break;
}
glutPostRedisplay();
}
static void Init( void )
{
const char * const ver_string = (const char * const)
glGetString( GL_VERSION );
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
printf("GL_VERSION = %s\n", ver_string);
if ( !glutExtensionSupported("GL_EXT_stencil_wrap")
&& (atof( ver_string ) < 1.4) ) {
printf("Sorry, this program requires either GL_EXT_stencil_wrap or OpenGL 1.4.\n");
exit(1);
}
printf("\nAll 5 squares should be the same color.\n");
glEnable( GL_BLEND );
}
int main( int argc, char *argv[] )
{
glutInit( &argc, argv );
glutInitWindowPosition( 0, 0 );
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH | GLUT_STENCIL );
glutCreateWindow( "GL_EXT_stencil_wrap test" );
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
Init();
glutMainLoop();
return 0;
}

View File

@@ -25,7 +25,6 @@
*
* Command line options:
* -info print GL implementation information
* -stereo use stereo enabled GLX visual
*
*/
@@ -85,12 +84,6 @@ static GLfloat view_rotx = 20.0, view_roty = 30.0, view_rotz = 0.0;
static GLint gear1, gear2, gear3;
static GLfloat angle = 0.0;
static GLboolean fullscreen = GL_FALSE; /* Create a single fullscreen window */
static GLboolean stereo = GL_FALSE; /* Enable stereo. */
static GLfloat eyesep = 5.0; /* Eye separation. */
static GLfloat fix_point = 40.0; /* Fixation point distance. */
static GLfloat left, right, asp; /* Stereo frustum params. */
/*
*
@@ -232,7 +225,7 @@ gear(GLfloat inner_radius, GLfloat outer_radius, GLfloat width,
static void
do_draw(void)
draw(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
@@ -262,69 +255,21 @@ do_draw(void)
glPopMatrix();
}
static void
draw(void)
{
if (stereo) {
/* First left eye. */
glDrawBuffer(GL_BACK_LEFT);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(left, right, -asp, asp, 5.0, 60.0);
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glTranslated(+0.5 * eyesep, 0.0, 0.0);
do_draw();
glPopMatrix();
/* Then right eye. */
glDrawBuffer(GL_BACK_RIGHT);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-right, -left, -asp, asp, 5.0, 60.0);
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glTranslated(-0.5 * eyesep, 0.0, 0.0);
do_draw();
glPopMatrix();
} else
do_draw();
}
/* new window size or exposure */
static void
reshape(int width, int height)
{
GLfloat h = (GLfloat) height / (GLfloat) width;
glViewport(0, 0, (GLint) width, (GLint) height);
if (stereo) {
GLfloat w;
asp = (GLfloat) height / (GLfloat) width;
w = fix_point * (1.0 / 5.0);
left = -5.0 * ((w - 0.5 * eyesep) / fix_point);
right = 5.0 * ((w + 0.5 * eyesep) / fix_point);
} else {
GLfloat h = (GLfloat) height / (GLfloat) width;
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-1.0, 1.0, -h, h, 5.0, 60.0);
}
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-1.0, 1.0, -h, h, 5.0, 60.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(0.0, 0.0, -40.0);
}
static void
@@ -373,21 +318,13 @@ make_window( Display *dpy, const char *name,
int x, int y, int width, int height,
Window *winRet, GLXContext *ctxRet)
{
int attribs[] = { GLX_RGBA,
GLX_RED_SIZE, 1,
GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1,
GLX_DOUBLEBUFFER,
GLX_DEPTH_SIZE, 1,
None };
int stereoAttribs[] = { GLX_RGBA,
GLX_RED_SIZE, 1,
GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1,
GLX_DOUBLEBUFFER,
GLX_DEPTH_SIZE, 1,
GLX_STEREO,
None };
int attrib[] = { GLX_RGBA,
GLX_RED_SIZE, 1,
GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1,
GLX_DOUBLEBUFFER,
GLX_DEPTH_SIZE, 1,
None };
int scrnum;
XSetWindowAttributes attr;
unsigned long mask;
@@ -399,22 +336,9 @@ make_window( Display *dpy, const char *name,
scrnum = DefaultScreen( dpy );
root = RootWindow( dpy, scrnum );
if (fullscreen) {
x = 0; y = 0;
width = DisplayWidth( dpy, scrnum );
height = DisplayHeight( dpy, scrnum );
}
if (stereo)
visinfo = glXChooseVisual( dpy, scrnum, stereoAttribs );
else
visinfo = glXChooseVisual( dpy, scrnum, attribs );
visinfo = glXChooseVisual( dpy, scrnum, attrib );
if (!visinfo) {
if (stereo) {
printf("Error: couldn't get an RGB, "
"Double-buffered, Stereo visual\n");
} else
printf("Error: couldn't get an RGB, Double-buffered visual\n");
printf("Error: couldn't get an RGB, Double-buffered visual\n");
exit(1);
}
@@ -423,8 +347,7 @@ make_window( Display *dpy, const char *name,
attr.border_pixel = 0;
attr.colormap = XCreateColormap( dpy, root, visinfo->visual, AllocNone);
attr.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask;
attr.override_redirect = fullscreen;
mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask | CWOverrideRedirect;
mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
win = XCreateWindow( dpy, root, 0, 0, width, height,
0, visinfo->depth, InputOutput,
@@ -501,8 +424,6 @@ event_loop(Display *dpy, Window win)
/* next frame */
angle += 2.0;
if (angle > 3600.0)
angle -= 3600.0;
draw();
glXSwapBuffers(dpy, win);
@@ -537,7 +458,7 @@ main(int argc, char *argv[])
Display *dpy;
Window win;
GLXContext ctx;
char *dpyName = NULL;
char *dpyName = ":0";
GLboolean printInfo = GL_FALSE;
int i;
@@ -549,20 +470,11 @@ main(int argc, char *argv[])
else if (strcmp(argv[i], "-info") == 0) {
printInfo = GL_TRUE;
}
else if (strcmp(argv[i], "-stereo") == 0) {
stereo = GL_TRUE;
}
else if (strcmp(argv[i], "-fullscreen") == 0) {
fullscreen = GL_TRUE;
}
else
printf("Warrning: unknown parameter: %s\n", argv[i]);
}
dpy = XOpenDisplay(dpyName);
if (!dpy) {
printf("Error: couldn't open display %s\n",
dpyName ? dpyName : getenv("DISPLAY"));
printf("Error: couldn't open display %s\n", dpyName);
return -1;
}

View File

@@ -138,6 +138,7 @@ static int
Setup(int width, int height)
{
#if defined(GLX_VERSION_1_3) || defined(GLX_VERSION_1_4)
XVisualInfo *visInfo;
GLXContext glCtx;
/* Open the X display */
@@ -174,6 +175,7 @@ Setup(int width, int height)
}
else {
printf("Error: Couldn't create GLXContext\n");
XFree(visInfo);
XCloseDisplay(gDpy);
return 0;
}
@@ -181,6 +183,7 @@ Setup(int width, int height)
/* Bind context to pbuffer */
if (!glXMakeCurrent(gDpy, gPBuffer, glCtx)) {
printf("Error: glXMakeCurrent failed\n");
XFree(visInfo);
XCloseDisplay(gDpy);
return 0;
}

View File

@@ -20,9 +20,9 @@
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# DOS/DJGPP glu makefile v1.5 for Mesa
# DOS/DJGPP glu makefile v1.4 for Mesa
#
# Copyright (C) 2002 - Daniel Borca
# Copyright (C) 2002 - Borca Daniel
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
@@ -54,7 +54,7 @@ CC = gcc
CFLAGS += -I$(TOP)/include
AR = ar
ARFLAGS = crus
ARFLAGS = rus
HAVEDXE3 = $(wildcard $(DJDIR)/bin/dxe3gen.exe)

View File

@@ -1,7 +1,8 @@
/*
* Mesa 3-D graphics library
* Version: 6.3
* Copyright (C) 1995-2004 Brian Paul
* Version: 3.3
* Copyright (C) 1995-2000 Brian Paul
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -35,7 +36,7 @@
#if defined(_WIN32) && !defined(__WIN32__)
# define __WIN32__
# define __WIN32__
#endif
#if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN__))
@@ -50,22 +51,65 @@
# pragma warning( disable : 4550 ) /* 'function' undefined; assuming extern returning int */
# pragma warning( disable : 4761 ) /* integral size mismatch in argument; conversion supplied */
# endif
# if defined(_MSC_VER) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */
# define GLAPI __declspec(dllexport)
# define WGLAPI __declspec(dllexport)
# elif defined(_MSC_VER) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
# define GLAPI __declspec(dllimport)
# define WGLAPI __declspec(dllimport)
# else /* for use with static link lib build of Win32 edition only */
# define GLAPI extern
# define WGLAPI __declspec(dllimport)
# endif /* _STATIC_MESA support */
# define GLAPIENTRY __stdcall
# define GLAPIENTRYP __stdcall *
# define GLCALLBACK __stdcall
# define GLCALLBACKP __stdcall *
# if defined(__CYGWIN__)
# define GLCALLBACKPCAST *
# else
# define GLCALLBACKPCAST __stdcall *
# endif
# define GLWINAPI __stdcall
# define GLWINAPIV __cdecl
#else
/* non-Windows compilation */
# define GLAPI extern
# define GLAPIENTRY
# define GLAPIENTRYP *
# define GLCALLBACK
# define GLCALLBACKP *
# define GLCALLBACKPCAST *
# define GLWINAPI
# define GLWINAPIV
#endif /* WIN32 / CYGWIN bracket */
/* compatability guard so we don't need to change client code */
#if defined(_WIN32) && !defined(_WINDEF_) && !defined(_GNU_H_WINDOWS32_BASE) && !defined(OPENSTEP)
# define CALLBACK GLCALLBACK
typedef int (GLAPIENTRY *PROC)();
typedef void *HGLRC;
typedef void *HDC;
typedef unsigned long COLORREF;
#endif
#if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP)
# define WGL_FONT_LINES 0
# define WGL_FONT_POLYGONS 1
#ifndef _GNU_H_WINDOWS32_FUNCTIONS
# ifdef UNICODE
# define wglUseFontBitmaps wglUseFontBitmapsW
# define wglUseFontOutlines wglUseFontOutlinesW
# else
# define wglUseFontBitmaps wglUseFontBitmapsA
# define wglUseFontOutlines wglUseFontOutlinesA
# endif /* !UNICODE */
#endif /* _GNU_H_WINDOWS32_FUNCTIONS */
typedef struct tagLAYERPLANEDESCRIPTOR LAYERPLANEDESCRIPTOR, *PLAYERPLANEDESCRIPTOR, *LPLAYERPLANEDESCRIPTOR;
typedef struct _GLYPHMETRICSFLOAT GLYPHMETRICSFLOAT, *PGLYPHMETRICSFLOAT, *LPGLYPHMETRICSFLOAT;
typedef struct tagPIXELFORMATDESCRIPTOR PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESCRIPTOR, *LPPIXELFORMATDESCRIPTOR;
#include <GL/mesa_wgl.h>
#endif

View File

@@ -20,9 +20,9 @@
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# DOS/DJGPP glu makefile v1.5 for Mesa
# DOS/DJGPP glu makefile v1.4 for Mesa
#
# Copyright (C) 2002 - Daniel Borca
# Copyright (C) 2002 - Borca Daniel
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
@@ -56,7 +56,7 @@ CXX = gpp
CXXFLAGS = $(CFLAGS) -Ilibnurbs/internals -Ilibnurbs/interface -Ilibnurbs/nurbtess
AR = ar
ARFLAGS = crus
ARFLAGS = rus
HAVEDXE3 = $(wildcard $(DJDIR)/bin/dxe3gen.exe)

View File

@@ -92,6 +92,6 @@ clean:
depend: $(SOURCES)
touch depend
$(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(SOURCES) > /dev/null
$(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(SOURCES) > /dev/null 2>&1
include depend

View File

@@ -20,9 +20,9 @@
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# DOS/DJGPP glut makefile v1.6 for Mesa
# DOS/DJGPP glut makefile v1.5 for Mesa
#
# Copyright (C) 2002 - Daniel Borca
# Copyright (C) 2002 - Borca Daniel
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
@@ -62,7 +62,7 @@ CFLAGS += -I- -I$(TOP)/include -I. -I$(MKGLUT) -IPC_HW
CFLAGS += -DGLUT_IMPORT_LIB
AR = ar
ARFLAGS = crus
ARFLAGS = rus
HAVEDXE3 = $(wildcard $(DJDIR)/bin/dxe3gen.exe)

View File

@@ -64,9 +64,9 @@ int APIENTRY glutExtensionSupported (const char *extension)
}
GLUTproc APIENTRY
void * APIENTRY
glutGetProcAddress (const char *procName)
{
/* TODO - handle glut namespace */
return (GLUTproc)DMesaGetProcAddress(procName);
return DMesaGetProcAddress(procName);
}

View File

@@ -36,6 +36,7 @@ SOURCES = \
glut_dstr.c \
glut_event.c \
glut_ext.c \
glut_fbc.c \
glut_fullscrn.c \
glut_gamemode.c \
glut_get.c \
@@ -104,9 +105,7 @@ clean:
depend: $(SOURCES)
@ echo "running $(MKDEP)"
@ touch depend
@ $(MKDEP) $(MKDEP_OPTIONS) -I$(TOP)/include $(SOURCES) \
> /dev/null
touch depend
$(MKDEP) $(MKDEP_OPTIONS) -I$(TOP)/include $(SOURCES)
include depend

View File

@@ -53,145 +53,145 @@ glutExtensionSupported(const char *extension)
struct name_address_pair {
const char *name;
const GLUTproc address;
const void *address;
};
static struct name_address_pair glut_functions[] = {
{ "glutInit", (const GLUTproc) glutInit },
{ "glutInitDisplayMode", (const GLUTproc) glutInitDisplayMode },
{ "glutInitDisplayString", (const GLUTproc) glutInitDisplayString },
{ "glutInitWindowPosition", (const GLUTproc) glutInitWindowPosition },
{ "glutInitWindowSize", (const GLUTproc) glutInitWindowSize },
{ "glutMainLoop", (const GLUTproc) glutMainLoop },
{ "glutCreateWindow", (const GLUTproc) glutCreateWindow },
{ "glutCreateSubWindow", (const GLUTproc) glutCreateSubWindow },
{ "glutDestroyWindow", (const GLUTproc) glutDestroyWindow },
{ "glutPostRedisplay", (const GLUTproc) glutPostRedisplay },
{ "glutPostWindowRedisplay", (const GLUTproc) glutPostWindowRedisplay },
{ "glutSwapBuffers", (const GLUTproc) glutSwapBuffers },
{ "glutGetWindow", (const GLUTproc) glutGetWindow },
{ "glutSetWindow", (const GLUTproc) glutSetWindow },
{ "glutSetWindowTitle", (const GLUTproc) glutSetWindowTitle },
{ "glutSetIconTitle", (const GLUTproc) glutSetIconTitle },
{ "glutPositionWindow", (const GLUTproc) glutPositionWindow },
{ "glutReshapeWindow", (const GLUTproc) glutReshapeWindow },
{ "glutPopWindow", (const GLUTproc) glutPopWindow },
{ "glutPushWindow", (const GLUTproc) glutPushWindow },
{ "glutIconifyWindow", (const GLUTproc) glutIconifyWindow },
{ "glutShowWindow", (const GLUTproc) glutShowWindow },
{ "glutHideWindow", (const GLUTproc) glutHideWindow },
{ "glutFullScreen", (const GLUTproc) glutFullScreen },
{ "glutSetCursor", (const GLUTproc) glutSetCursor },
{ "glutWarpPointer", (const GLUTproc) glutWarpPointer },
{ "glutEstablishOverlay", (const GLUTproc) glutEstablishOverlay },
{ "glutRemoveOverlay", (const GLUTproc) glutRemoveOverlay },
{ "glutUseLayer", (const GLUTproc) glutUseLayer },
{ "glutPostOverlayRedisplay", (const GLUTproc) glutPostOverlayRedisplay },
{ "glutPostWindowOverlayRedisplay", (const GLUTproc) glutPostWindowOverlayRedisplay },
{ "glutShowOverlay", (const GLUTproc) glutShowOverlay },
{ "glutHideOverlay", (const GLUTproc) glutHideOverlay },
{ "glutCreateMenu", (const GLUTproc) glutCreateMenu },
{ "glutDestroyMenu", (const GLUTproc) glutDestroyMenu },
{ "glutGetMenu", (const GLUTproc) glutGetMenu },
{ "glutSetMenu", (const GLUTproc) glutSetMenu },
{ "glutAddMenuEntry", (const GLUTproc) glutAddMenuEntry },
{ "glutAddSubMenu", (const GLUTproc) glutAddSubMenu },
{ "glutChangeToMenuEntry", (const GLUTproc) glutChangeToMenuEntry },
{ "glutChangeToSubMenu", (const GLUTproc) glutChangeToSubMenu },
{ "glutRemoveMenuItem", (const GLUTproc) glutRemoveMenuItem },
{ "glutAttachMenu", (const GLUTproc) glutAttachMenu },
{ "glutDetachMenu", (const GLUTproc) glutDetachMenu },
{ "glutDisplayFunc", (const GLUTproc) glutDisplayFunc },
{ "glutReshapeFunc", (const GLUTproc) glutReshapeFunc },
{ "glutKeyboardFunc", (const GLUTproc) glutKeyboardFunc },
{ "glutMouseFunc", (const GLUTproc) glutMouseFunc },
{ "glutMotionFunc", (const GLUTproc) glutMotionFunc },
{ "glutPassiveMotionFunc", (const GLUTproc) glutPassiveMotionFunc },
{ "glutEntryFunc", (const GLUTproc) glutEntryFunc },
{ "glutVisibilityFunc", (const GLUTproc) glutVisibilityFunc },
{ "glutIdleFunc", (const GLUTproc) glutIdleFunc },
{ "glutTimerFunc", (const GLUTproc) glutTimerFunc },
{ "glutMenuStateFunc", (const GLUTproc) glutMenuStateFunc },
{ "glutSpecialFunc", (const GLUTproc) glutSpecialFunc },
{ "glutSpaceballMotionFunc", (const GLUTproc) glutSpaceballMotionFunc },
{ "glutSpaceballRotateFunc", (const GLUTproc) glutSpaceballRotateFunc },
{ "glutSpaceballButtonFunc", (const GLUTproc) glutSpaceballButtonFunc },
{ "glutButtonBoxFunc", (const GLUTproc) glutButtonBoxFunc },
{ "glutDialsFunc", (const GLUTproc) glutDialsFunc },
{ "glutTabletMotionFunc", (const GLUTproc) glutTabletMotionFunc },
{ "glutTabletButtonFunc", (const GLUTproc) glutTabletButtonFunc },
{ "glutMenuStatusFunc", (const GLUTproc) glutMenuStatusFunc },
{ "glutOverlayDisplayFunc", (const GLUTproc) glutOverlayDisplayFunc },
{ "glutWindowStatusFunc", (const GLUTproc) glutWindowStatusFunc },
{ "glutKeyboardUpFunc", (const GLUTproc) glutKeyboardUpFunc },
{ "glutSpecialUpFunc", (const GLUTproc) glutSpecialUpFunc },
{ "glutJoystickFunc", (const GLUTproc) glutJoystickFunc },
{ "glutSetColor", (const GLUTproc) glutSetColor },
{ "glutGetColor", (const GLUTproc) glutGetColor },
{ "glutCopyColormap", (const GLUTproc) glutCopyColormap },
{ "glutGet", (const GLUTproc) glutGet },
{ "glutDeviceGet", (const GLUTproc) glutDeviceGet },
{ "glutExtensionSupported", (const GLUTproc) glutExtensionSupported },
{ "glutGetModifiers", (const GLUTproc) glutGetModifiers },
{ "glutLayerGet", (const GLUTproc) glutLayerGet },
{ "glutGetProcAddress", (const GLUTproc) glutGetProcAddress },
{ "glutBitmapCharacter", (const GLUTproc) glutBitmapCharacter },
{ "glutBitmapWidth", (const GLUTproc) glutBitmapWidth },
{ "glutStrokeCharacter", (const GLUTproc) glutStrokeCharacter },
{ "glutStrokeWidth", (const GLUTproc) glutStrokeWidth },
{ "glutBitmapLength", (const GLUTproc) glutBitmapLength },
{ "glutStrokeLength", (const GLUTproc) glutStrokeLength },
{ "glutWireSphere", (const GLUTproc) glutWireSphere },
{ "glutSolidSphere", (const GLUTproc) glutSolidSphere },
{ "glutWireCone", (const GLUTproc) glutWireCone },
{ "glutSolidCone", (const GLUTproc) glutSolidCone },
{ "glutWireCube", (const GLUTproc) glutWireCube },
{ "glutSolidCube", (const GLUTproc) glutSolidCube },
{ "glutWireTorus", (const GLUTproc) glutWireTorus },
{ "glutSolidTorus", (const GLUTproc) glutSolidTorus },
{ "glutWireDodecahedron", (const GLUTproc) glutWireDodecahedron },
{ "glutSolidDodecahedron", (const GLUTproc) glutSolidDodecahedron },
{ "glutWireTeapot", (const GLUTproc) glutWireTeapot },
{ "glutSolidTeapot", (const GLUTproc) glutSolidTeapot },
{ "glutWireOctahedron", (const GLUTproc) glutWireOctahedron },
{ "glutSolidOctahedron", (const GLUTproc) glutSolidOctahedron },
{ "glutWireTetrahedron", (const GLUTproc) glutWireTetrahedron },
{ "glutSolidTetrahedron", (const GLUTproc) glutSolidTetrahedron },
{ "glutWireIcosahedron", (const GLUTproc) glutWireIcosahedron },
{ "glutSolidIcosahedron", (const GLUTproc) glutSolidIcosahedron },
{ "glutVideoResizeGet", (const GLUTproc) glutVideoResizeGet },
{ "glutSetupVideoResizing", (const GLUTproc) glutSetupVideoResizing },
{ "glutStopVideoResizing", (const GLUTproc) glutStopVideoResizing },
{ "glutVideoResize", (const GLUTproc) glutVideoResize },
{ "glutVideoPan", (const GLUTproc) glutVideoPan },
{ "glutReportErrors", (const GLUTproc) glutReportErrors },
{ "glutIgnoreKeyRepeat", (const GLUTproc) glutIgnoreKeyRepeat },
{ "glutSetKeyRepeat", (const GLUTproc) glutSetKeyRepeat },
{ "glutForceJoystickFunc", (const GLUTproc) glutForceJoystickFunc },
{ "glutGameModeString", (const GLUTproc) glutGameModeString },
{ "glutEnterGameMode", (const GLUTproc) glutEnterGameMode },
{ "glutLeaveGameMode", (const GLUTproc) glutLeaveGameMode },
{ "glutGameModeGet", (const GLUTproc) glutGameModeGet },
{ "glutInit", (const void *) glutInit },
{ "glutInitDisplayMode", (const void *) glutInitDisplayMode },
{ "glutInitDisplayString", (const void *) glutInitDisplayString },
{ "glutInitWindowPosition", (const void *) glutInitWindowPosition },
{ "glutInitWindowSize", (const void *) glutInitWindowSize },
{ "glutMainLoop", (const void *) glutMainLoop },
{ "glutCreateWindow", (const void *) glutCreateWindow },
{ "glutCreateSubWindow", (const void *) glutCreateSubWindow },
{ "glutDestroyWindow", (const void *) glutDestroyWindow },
{ "glutPostRedisplay", (const void *) glutPostRedisplay },
{ "glutPostWindowRedisplay", (const void *) glutPostWindowRedisplay },
{ "glutSwapBuffers", (const void *) glutSwapBuffers },
{ "glutGetWindow", (const void *) glutGetWindow },
{ "glutSetWindow", (const void *) glutSetWindow },
{ "glutSetWindowTitle", (const void *) glutSetWindowTitle },
{ "glutSetIconTitle", (const void *) glutSetIconTitle },
{ "glutPositionWindow", (const void *) glutPositionWindow },
{ "glutReshapeWindow", (const void *) glutReshapeWindow },
{ "glutPopWindow", (const void *) glutPopWindow },
{ "glutPushWindow", (const void *) glutPushWindow },
{ "glutIconifyWindow", (const void *) glutIconifyWindow },
{ "glutShowWindow", (const void *) glutShowWindow },
{ "glutHideWindow", (const void *) glutHideWindow },
{ "glutFullScreen", (const void *) glutFullScreen },
{ "glutSetCursor", (const void *) glutSetCursor },
{ "glutWarpPointer", (const void *) glutWarpPointer },
{ "glutEstablishOverlay", (const void *) glutEstablishOverlay },
{ "glutRemoveOverlay", (const void *) glutRemoveOverlay },
{ "glutUseLayer", (const void *) glutUseLayer },
{ "glutPostOverlayRedisplay", (const void *) glutPostOverlayRedisplay },
{ "glutPostWindowOverlayRedisplay", (const void *) glutPostWindowOverlayRedisplay },
{ "glutShowOverlay", (const void *) glutShowOverlay },
{ "glutHideOverlay", (const void *) glutHideOverlay },
{ "glutCreateMenu", (const void *) glutCreateMenu },
{ "glutDestroyMenu", (const void *) glutDestroyMenu },
{ "glutGetMenu", (const void *) glutGetMenu },
{ "glutSetMenu", (const void *) glutSetMenu },
{ "glutAddMenuEntry", (const void *) glutAddMenuEntry },
{ "glutAddSubMenu", (const void *) glutAddSubMenu },
{ "glutChangeToMenuEntry", (const void *) glutChangeToMenuEntry },
{ "glutChangeToSubMenu", (const void *) glutChangeToSubMenu },
{ "glutRemoveMenuItem", (const void *) glutRemoveMenuItem },
{ "glutAttachMenu", (const void *) glutAttachMenu },
{ "glutDetachMenu", (const void *) glutDetachMenu },
{ "glutDisplayFunc", (const void *) glutDisplayFunc },
{ "glutReshapeFunc", (const void *) glutReshapeFunc },
{ "glutKeyboardFunc", (const void *) glutKeyboardFunc },
{ "glutMouseFunc", (const void *) glutMouseFunc },
{ "glutMotionFunc", (const void *) glutMotionFunc },
{ "glutPassiveMotionFunc", (const void *) glutPassiveMotionFunc },
{ "glutEntryFunc", (const void *) glutEntryFunc },
{ "glutVisibilityFunc", (const void *) glutVisibilityFunc },
{ "glutIdleFunc", (const void *) glutIdleFunc },
{ "glutTimerFunc", (const void *) glutTimerFunc },
{ "glutMenuStateFunc", (const void *) glutMenuStateFunc },
{ "glutSpecialFunc", (const void *) glutSpecialFunc },
{ "glutSpaceballMotionFunc", (const void *) glutSpaceballMotionFunc },
{ "glutSpaceballRotateFunc", (const void *) glutSpaceballRotateFunc },
{ "glutSpaceballButtonFunc", (const void *) glutSpaceballButtonFunc },
{ "glutButtonBoxFunc", (const void *) glutButtonBoxFunc },
{ "glutDialsFunc", (const void *) glutDialsFunc },
{ "glutTabletMotionFunc", (const void *) glutTabletMotionFunc },
{ "glutTabletButtonFunc", (const void *) glutTabletButtonFunc },
{ "glutMenuStatusFunc", (const void *) glutMenuStatusFunc },
{ "glutOverlayDisplayFunc", (const void *) glutOverlayDisplayFunc },
{ "glutWindowStatusFunc", (const void *) glutWindowStatusFunc },
{ "glutKeyboardUpFunc", (const void *) glutKeyboardUpFunc },
{ "glutSpecialUpFunc", (const void *) glutSpecialUpFunc },
{ "glutJoystickFunc", (const void *) glutJoystickFunc },
{ "glutSetColor", (const void *) glutSetColor },
{ "glutGetColor", (const void *) glutGetColor },
{ "glutCopyColormap", (const void *) glutCopyColormap },
{ "glutGet", (const void *) glutGet },
{ "glutDeviceGet", (const void *) glutDeviceGet },
{ "glutExtensionSupported", (const void *) glutExtensionSupported },
{ "glutGetModifiers", (const void *) glutGetModifiers },
{ "glutLayerGet", (const void *) glutLayerGet },
{ "glutGetProcAddress", (const void *) glutGetProcAddress },
{ "glutBitmapCharacter", (const void *) glutBitmapCharacter },
{ "glutBitmapWidth", (const void *) glutBitmapWidth },
{ "glutStrokeCharacter", (const void *) glutStrokeCharacter },
{ "glutStrokeWidth", (const void *) glutStrokeWidth },
{ "glutBitmapLength", (const void *) glutBitmapLength },
{ "glutStrokeLength", (const void *) glutStrokeLength },
{ "glutWireSphere", (const void *) glutWireSphere },
{ "glutSolidSphere", (const void *) glutSolidSphere },
{ "glutWireCone", (const void *) glutWireCone },
{ "glutSolidCone", (const void *) glutSolidCone },
{ "glutWireCube", (const void *) glutWireCube },
{ "glutSolidCube", (const void *) glutSolidCube },
{ "glutWireTorus", (const void *) glutWireTorus },
{ "glutSolidTorus", (const void *) glutSolidTorus },
{ "glutWireDodecahedron", (const void *) glutWireDodecahedron },
{ "glutSolidDodecahedron", (const void *) glutSolidDodecahedron },
{ "glutWireTeapot", (const void *) glutWireTeapot },
{ "glutSolidTeapot", (const void *) glutSolidTeapot },
{ "glutWireOctahedron", (const void *) glutWireOctahedron },
{ "glutSolidOctahedron", (const void *) glutSolidOctahedron },
{ "glutWireTetrahedron", (const void *) glutWireTetrahedron },
{ "glutSolidTetrahedron", (const void *) glutSolidTetrahedron },
{ "glutWireIcosahedron", (const void *) glutWireIcosahedron },
{ "glutSolidIcosahedron", (const void *) glutSolidIcosahedron },
{ "glutVideoResizeGet", (const void *) glutVideoResizeGet },
{ "glutSetupVideoResizing", (const void *) glutSetupVideoResizing },
{ "glutStopVideoResizing", (const void *) glutStopVideoResizing },
{ "glutVideoResize", (const void *) glutVideoResize },
{ "glutVideoPan", (const void *) glutVideoPan },
{ "glutReportErrors", (const void *) glutReportErrors },
{ "glutIgnoreKeyRepeat", (const void *) glutIgnoreKeyRepeat },
{ "glutSetKeyRepeat", (const void *) glutSetKeyRepeat },
{ "glutForceJoystickFunc", (const void *) glutForceJoystickFunc },
{ "glutGameModeString", (const void *) glutGameModeString },
{ "glutEnterGameMode", (const void *) glutEnterGameMode },
{ "glutLeaveGameMode", (const void *) glutLeaveGameMode },
{ "glutGameModeGet", (const void *) glutGameModeGet },
{ NULL, NULL }
};
/* XXX This isn't an official GLUT function, yet */
GLUTproc GLUTAPIENTRY
void * GLUTAPIENTRY
glutGetProcAddress(const char *procName)
{
/* Try GLUT functions first */
int i;
for (i = 0; glut_functions[i].name; i++) {
if (strcmp(glut_functions[i].name, procName) == 0)
return glut_functions[i].address;
return (void *) glut_functions[i].address;
}
/* Try core GL functions */
#if defined(_WIN32)
return (GLUTproc) wglGetProcAddress((LPCSTR) procName);
return (void *) wglGetProcAddress((LPCSTR) procName);
#elif defined(GLX_ARB_get_proc_address)
return (GLUTproc) glXGetProcAddressARB((const GLubyte *) procName);
return (void *) glXGetProcAddressARB((const GLubyte *) procName);
#else
return NULL;
#endif

View File

@@ -65,7 +65,7 @@ $(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS)
# what's included by any source file.
depend: $(SOURCES)
touch depend
$(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(SOURCES) > /dev/null
$(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(SOURCES) > /dev/null 2>&1
# Emacs tags
tags:

View File

@@ -45,7 +45,7 @@ $(LIB_DIR)/$(GLW_LIB_NAME): $(OBJECTS)
depend: $(GLW_SOURCES)
touch depend
$(MKDEP) $(MKDEP_OPTIONS) -I$(TOP)/include $(GLW_SOURCES) \
> /dev/null
> /dev/null 2>&1
include depend

View File

@@ -68,7 +68,7 @@ drmtest: xf86drm.o drmtest.o
depend: $(C_SOURCES) $(ASM_SOURCES)
touch depend
$(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(C_SOURCES) $(ASM_SOURCES) \
> /dev/null
> /dev/null 2>&1
# Emacs tags

View File

@@ -67,8 +67,7 @@ typedef struct DRIDriverContextRec {
int bpp;
int cpp;
int agpmode;
int isPCI;
unsigned long FBStart; /**< \brief physical address of the framebuffer */
unsigned long MMIOStart; /**< \brief physical address of the MMIO region */

View File

@@ -14,9 +14,6 @@ clientDriverName=radeon_dri.so
# look in /proc/pci.
pciBusID=PCI:1:0:0
# Is the card PCI or AGP ?
isPCI=0
# Virtual screen dimensions. Can reduce this to save videocard memory
# at the expense of maximum window size available.
virtualWidth=1280

View File

@@ -830,7 +830,6 @@ static int __read_config_file( Display *dpy )
dpy->driverContext.cpp = 4;
dpy->rotateMode = 0;
dpy->driverContext.agpmode = 1;
dpy->driverContext.isPCI = 0;
fname = getenv("MINIGLX_CONF");
if (!fname) fname = "/etc/miniglx.conf";
@@ -900,9 +899,6 @@ static int __read_config_file( Display *dpy )
if (sscanf(val, "%d", &dpy->driverContext.agpmode) != 1)
fprintf(stderr, "malformed agpmode: %s\n", opt);
}
else if (strcmp(opt, "isPCI") == 0) {
dpy->driverContext.isPCI = atoi(val) ? 1 : 0;
}
}
fclose(file);
@@ -1715,7 +1711,7 @@ glXChooseVisual( Display *dpy, int screen, int *attribList )
GLint redBits = 0, greenBits = 0, blueBits = 0, alphaBits = 0;
GLint indexBits = 0, depthBits = 0, stencilBits = 0;
GLint numSamples = 0;
int i=0;
int i;
/*
* XXX in the future, <screen> might be interpreted as a VT
@@ -1809,7 +1805,6 @@ glXChooseVisual( Display *dpy, int screen, int *attribList )
(void) alphaBits;
(void) stereoFlag;
for ( mode = dpy->driver_modes ; mode != NULL ; mode = mode->next ) {
i++;
if (mode->rgbMode == rgbFlag &&
mode->doubleBufferMode == dbFlag &&
mode->redBits >= redBits &&
@@ -2154,8 +2149,7 @@ __glXGetDrawableInfo(__DRInativeDisplay *dpy, int scrn,
{
GLXDrawable drawable = (GLXDrawable) draw;
drm_clip_rect_t * cliprect;
Display* display = (Display*)dpy;
__DRIcontextPrivate *pcp = (__DRIcontextPrivate *)CurrentContext->driContext.private;
if (drawable == 0) {
return GL_FALSE;
}
@@ -2165,20 +2159,15 @@ __glXGetDrawableInfo(__DRInativeDisplay *dpy, int scrn,
cliprect->y1 = drawable->y;
cliprect->x2 = drawable->x + drawable->w;
cliprect->y2 = drawable->y + drawable->h;
/* the drawable index is by client id */
*index = display->clientID;
*stamp = pcp->driScreenPriv->pSAREA->drawableTable[display->clientID].stamp;
*x = drawable->x;
*y = drawable->y;
*width = drawable->w;
*height = drawable->h;
*numClipRects = 1;
*pClipRects = cliprect;
*backX = drawable->x;
*backY = drawable->y;
*backX = 0;
*backY = 0;
*numBackClipRects = 0;
*pBackClipRects = 0;
@@ -2260,7 +2249,6 @@ void (*glXGetProcAddress(const GLubyte *procname))( void )
{ "__glXGetDrawableInfo", (void *) __glXGetDrawableInfo },
{ "__glXWindowExists", (void *) __glXWindowExists },
{ "__glXCreateContextModes", (void *) _gl_context_modes_create },
{ "__glXFindDRIScreen", (void *)__glXFindDRIScreen },
{ NULL, NULL }
};
const struct name_address *entry;

View File

@@ -1,114 +0,0 @@
TOP = ../../..
include $(TOP)/configs/current
# This is a bit messy. We want this libGL to be capable of loading old
# interface drivers, so we have to turn off DRI_NEW_INTERFACE_ONLY. However,
# glcontextmodes.c is built elsewhere with DNIO on, so we symlink it across.
#
# Furthermore, context creation has evolved over the years, such that this
# code will not build with DNIO defined. When we finally drop old interface
# support in libGL, we need to clean up both glxcmds.c and dri_interface.h.
DEFINES += -DGLX_DIRECT_RENDERING -DGLXEXT -DXF86DRI -DGLX_USE_DLOPEN \
-DGLX_USE_MESA -DXF86VIDMODE -D_REENTRANT -UDRI_NEW_INTERFACE_ONLY
C_SOURCES = \
$(TOP)/src/mesa/glapi/glapi.c \
$(TOP)/src/mesa/glapi/glthread.c \
glcontextmodes.c \
$(DRM_SOURCE_PATH)/libdrm/xf86drm.c \
$(DRM_SOURCE_PATH)/libdrm/xf86drmHash.c \
$(DRM_SOURCE_PATH)/libdrm/xf86drmRandom.c \
$(DRM_SOURCE_PATH)/libdrm/xf86drmSL.c \
clientattrib.c \
compsize.c \
dispatch.c \
eval.c \
glxcmds.c \
glxext.c \
glxextensions.c \
indirect.c \
indirect_init.c \
indirect_size.c \
indirect_window_pos.c \
indirect_transpose_matrix.c \
pixel.c \
pixelstore.c \
render2.c \
renderpix.c \
single2.c \
singlepix.c \
vertarr.c \
xfont.c \
glx_pbuffer.c \
glx_query.c \
glx_texture_compression.c \
dri_glx.c \
XF86dri.c \
X86_SOURCES = $(TOP)/src/mesa/x86/glapi_x86.S
# ASM_SOURCES = $(X86_SOURCES)
OBJECTS = $(C_SOURCES:.c=.o) \
$(ASM_SOURCES:.S=.o)
INCLUDES = -I. \
-I$(TOP)/include \
-I$(TOP)/include/GL/internal \
-I$(TOP)/src/mesa \
-I$(TOP)/src/mesa/main \
-I$(TOP)/src/mesa/glapi \
-I$(TOP)/src/mesa/math \
-I$(TOP)/src/mesa/transform \
-I$(TOP)/src/mesa/swrast \
-I$(TOP)/src/mesa/swrast_setup \
-I$(TOP)/src/mesa/drivers/dri/common \
-I$(DRM_SOURCE_PATH)/libdrm \
-I$(DRM_SOURCE_PATH)/shared \
$(X11_INCLUDES)
##### RULES #####
.c.o:
$(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
.S.o:
$(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
##### TARGETS #####
default: depend $(LIB_DIR)/$(GL_LIB_NAME)
glcontextmodes.c:
ln -s $(TOP)/src/mesa/drivers/dri/common/glcontextmodes.c .
# Make libGL
$(LIB_DIR)/$(GL_LIB_NAME): $(OBJECTS) Makefile
CC=$(CC) CXX=$(CXX) $(TOP)/bin/mklib -o $(GL_LIB) -major 1 -minor 2 $(MKLIB_OPTIONS) \
-install $(LIB_DIR) $(GL_LIB_DEPS) $(OBJECTS)
drmtest: xf86drm.o drmtest.o
rm -f drmtest && $(CC) -o drmtest xf86drm.o drmtest.o
depend: $(C_SOURCES) $(ASM_SOURCES)
touch depend
$(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(C_SOURCES) $(ASM_SOURCES) \
> /dev/null
# Emacs tags
tags:
etags `find . -name \*.[ch]` `find ../include`
# Remove .o and backup files
clean:
-rm -f $(LIB_DIR)/libGL.so*
-rm -f *.o *~
-rm -f depend
include depend

View File

@@ -1,617 +0,0 @@
/* $XFree86: xc/lib/GL/dri/XF86dri.c,v 1.13 2002/10/30 12:51:25 alanh Exp $ */
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
Copyright 2000 VA Linux Systems, 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 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 PRECISION INSIGHT AND/OR ITS 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.
**************************************************************************/
/*
* Authors:
* Kevin E. Martin <martin@valinux.com>
* Jens Owen <jens@tungstengraphics.com>
* Rickard E. (Rik) Faith <faith@valinux.com>
*
*/
/* THIS IS NOT AN X CONSORTIUM STANDARD */
#define NEED_REPLIES
#include <X11/Xlibint.h>
#include "xf86dristr.h"
#include <X11/extensions/Xext.h>
#include "extutil.h"
#include "glheader.h"
static XExtensionInfo _xf86dri_info_data;
static XExtensionInfo *xf86dri_info = &_xf86dri_info_data;
static char xf86dri_extension_name[] = XF86DRINAME;
#define XF86DRICheckExtension(dpy,i,val) \
XextCheckExtension (dpy, i, xf86dri_extension_name, val)
/*****************************************************************************
* *
* private utility routines *
* *
*****************************************************************************/
static int close_display(Display *dpy, XExtCodes *extCodes);
static /* const */ XExtensionHooks xf86dri_extension_hooks = {
NULL, /* create_gc */
NULL, /* copy_gc */
NULL, /* flush_gc */
NULL, /* free_gc */
NULL, /* create_font */
NULL, /* free_font */
close_display, /* close_display */
NULL, /* wire_to_event */
NULL, /* event_to_wire */
NULL, /* error */
NULL, /* error_string */
};
static XEXT_GENERATE_FIND_DISPLAY (find_display, xf86dri_info,
xf86dri_extension_name,
&xf86dri_extension_hooks,
0, NULL)
static XEXT_GENERATE_CLOSE_DISPLAY (close_display, xf86dri_info)
/*****************************************************************************
* *
* public XFree86-DRI Extension routines *
* *
*****************************************************************************/
#if 0
#include <stdio.h>
#define TRACE(msg) fprintf(stderr,"XF86DRI%s\n", msg);
#else
#define TRACE(msg)
#endif
PUBLIC Bool XF86DRIQueryExtension (dpy, event_basep, error_basep)
Display *dpy;
int *event_basep, *error_basep;
{
XExtDisplayInfo *info = find_display (dpy);
TRACE("QueryExtension...");
if (XextHasExtension(info)) {
*event_basep = info->codes->first_event;
*error_basep = info->codes->first_error;
TRACE("QueryExtension... return True");
return True;
} else {
TRACE("QueryExtension... return False");
return False;
}
}
PUBLIC Bool XF86DRIQueryVersion(dpy, majorVersion, minorVersion, patchVersion)
Display* dpy;
int* majorVersion;
int* minorVersion;
int* patchVersion;
{
XExtDisplayInfo *info = find_display (dpy);
xXF86DRIQueryVersionReply rep;
xXF86DRIQueryVersionReq *req;
TRACE("QueryVersion...");
XF86DRICheckExtension (dpy, info, False);
LockDisplay(dpy);
GetReq(XF86DRIQueryVersion, req);
req->reqType = info->codes->major_opcode;
req->driReqType = X_XF86DRIQueryVersion;
if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
UnlockDisplay(dpy);
SyncHandle();
TRACE("QueryVersion... return False");
return False;
}
*majorVersion = rep.majorVersion;
*minorVersion = rep.minorVersion;
*patchVersion = rep.patchVersion;
UnlockDisplay(dpy);
SyncHandle();
TRACE("QueryVersion... return True");
return True;
}
PUBLIC Bool XF86DRIQueryDirectRenderingCapable(dpy, screen, isCapable)
Display* dpy;
int screen;
Bool* isCapable;
{
XExtDisplayInfo *info = find_display (dpy);
xXF86DRIQueryDirectRenderingCapableReply rep;
xXF86DRIQueryDirectRenderingCapableReq *req;
TRACE("QueryDirectRenderingCapable...");
XF86DRICheckExtension (dpy, info, False);
LockDisplay(dpy);
GetReq(XF86DRIQueryDirectRenderingCapable, req);
req->reqType = info->codes->major_opcode;
req->driReqType = X_XF86DRIQueryDirectRenderingCapable;
req->screen = screen;
if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
UnlockDisplay(dpy);
SyncHandle();
TRACE("QueryDirectRenderingCapable... return False");
return False;
}
*isCapable = rep.isCapable;
UnlockDisplay(dpy);
SyncHandle();
TRACE("QueryDirectRenderingCapable... return True");
return True;
}
PUBLIC Bool XF86DRIOpenConnection(dpy, screen, hSAREA, busIdString)
Display* dpy;
int screen;
drm_handle_t * hSAREA;
char **busIdString;
{
XExtDisplayInfo *info = find_display (dpy);
xXF86DRIOpenConnectionReply rep;
xXF86DRIOpenConnectionReq *req;
TRACE("OpenConnection...");
XF86DRICheckExtension (dpy, info, False);
LockDisplay(dpy);
GetReq(XF86DRIOpenConnection, req);
req->reqType = info->codes->major_opcode;
req->driReqType = X_XF86DRIOpenConnection;
req->screen = screen;
if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
UnlockDisplay(dpy);
SyncHandle();
TRACE("OpenConnection... return False");
return False;
}
*hSAREA = rep.hSAREALow;
#ifdef LONG64
*hSAREA |= ((drm_handle_t)rep.hSAREAHigh) << 32;
#endif
if (rep.length) {
if (!(*busIdString = (char *)Xcalloc(rep.busIdStringLength + 1, 1))) {
_XEatData(dpy, ((rep.busIdStringLength+3) & ~3));
UnlockDisplay(dpy);
SyncHandle();
TRACE("OpenConnection... return False");
return False;
}
_XReadPad(dpy, *busIdString, rep.busIdStringLength);
} else {
*busIdString = NULL;
}
UnlockDisplay(dpy);
SyncHandle();
TRACE("OpenConnection... return True");
return True;
}
PUBLIC Bool XF86DRIAuthConnection(dpy, screen, magic)
Display* dpy;
int screen;
drm_magic_t magic;
{
XExtDisplayInfo *info = find_display (dpy);
xXF86DRIAuthConnectionReq *req;
xXF86DRIAuthConnectionReply rep;
TRACE("AuthConnection...");
XF86DRICheckExtension (dpy, info, False);
LockDisplay(dpy);
GetReq(XF86DRIAuthConnection, req);
req->reqType = info->codes->major_opcode;
req->driReqType = X_XF86DRIAuthConnection;
req->screen = screen;
req->magic = magic;
rep.authenticated = 0;
if (!_XReply(dpy, (xReply *)&rep, 0, xFalse) || !rep.authenticated) {
UnlockDisplay(dpy);
SyncHandle();
TRACE("AuthConnection... return False");
return False;
}
UnlockDisplay(dpy);
SyncHandle();
TRACE("AuthConnection... return True");
return True;
}
PUBLIC Bool XF86DRICloseConnection(dpy, screen)
Display* dpy;
int screen;
{
XExtDisplayInfo *info = find_display (dpy);
xXF86DRICloseConnectionReq *req;
TRACE("CloseConnection...");
XF86DRICheckExtension (dpy, info, False);
LockDisplay(dpy);
GetReq(XF86DRICloseConnection, req);
req->reqType = info->codes->major_opcode;
req->driReqType = X_XF86DRICloseConnection;
req->screen = screen;
UnlockDisplay(dpy);
SyncHandle();
TRACE("CloseConnection... return True");
return True;
}
PUBLIC Bool XF86DRIGetClientDriverName(dpy, screen, ddxDriverMajorVersion,
ddxDriverMinorVersion, ddxDriverPatchVersion, clientDriverName)
Display* dpy;
int screen;
int* ddxDriverMajorVersion;
int* ddxDriverMinorVersion;
int* ddxDriverPatchVersion;
char** clientDriverName;
{
XExtDisplayInfo *info = find_display (dpy);
xXF86DRIGetClientDriverNameReply rep;
xXF86DRIGetClientDriverNameReq *req;
TRACE("GetClientDriverName...");
XF86DRICheckExtension (dpy, info, False);
LockDisplay(dpy);
GetReq(XF86DRIGetClientDriverName, req);
req->reqType = info->codes->major_opcode;
req->driReqType = X_XF86DRIGetClientDriverName;
req->screen = screen;
if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
UnlockDisplay(dpy);
SyncHandle();
TRACE("GetClientDriverName... return False");
return False;
}
*ddxDriverMajorVersion = rep.ddxDriverMajorVersion;
*ddxDriverMinorVersion = rep.ddxDriverMinorVersion;
*ddxDriverPatchVersion = rep.ddxDriverPatchVersion;
if (rep.length) {
if (!(*clientDriverName = (char *)Xcalloc(rep.clientDriverNameLength + 1, 1))) {
_XEatData(dpy, ((rep.clientDriverNameLength+3) & ~3));
UnlockDisplay(dpy);
SyncHandle();
TRACE("GetClientDriverName... return False");
return False;
}
_XReadPad(dpy, *clientDriverName, rep.clientDriverNameLength);
} else {
*clientDriverName = NULL;
}
UnlockDisplay(dpy);
SyncHandle();
TRACE("GetClientDriverName... return True");
return True;
}
PUBLIC Bool XF86DRICreateContextWithConfig(dpy, screen, configID, context,
hHWContext)
Display* dpy;
int screen;
int configID;
XID* context;
drm_context_t * hHWContext;
{
XExtDisplayInfo *info = find_display (dpy);
xXF86DRICreateContextReply rep;
xXF86DRICreateContextReq *req;
TRACE("CreateContext...");
XF86DRICheckExtension (dpy, info, False);
LockDisplay(dpy);
GetReq(XF86DRICreateContext, req);
req->reqType = info->codes->major_opcode;
req->driReqType = X_XF86DRICreateContext;
req->visual = configID;
req->screen = screen;
*context = XAllocID(dpy);
req->context = *context;
if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
UnlockDisplay(dpy);
SyncHandle();
TRACE("CreateContext... return False");
return False;
}
*hHWContext = rep.hHWContext;
UnlockDisplay(dpy);
SyncHandle();
TRACE("CreateContext... return True");
return True;
}
PUBLIC Bool XF86DRICreateContext(dpy, screen, visual, context, hHWContext)
Display* dpy;
int screen;
Visual* visual;
XID* context;
drm_context_t * hHWContext;
{
return XF86DRICreateContextWithConfig( dpy, screen, visual->visualid,
context, hHWContext );
}
PUBLIC GLboolean XF86DRIDestroyContext( __DRInativeDisplay * ndpy, int screen,
__DRIid context )
{
Display * const dpy = (Display *) ndpy;
XExtDisplayInfo *info = find_display (dpy);
xXF86DRIDestroyContextReq *req;
TRACE("DestroyContext...");
XF86DRICheckExtension (dpy, info, False);
LockDisplay(dpy);
GetReq(XF86DRIDestroyContext, req);
req->reqType = info->codes->major_opcode;
req->driReqType = X_XF86DRIDestroyContext;
req->screen = screen;
req->context = context;
UnlockDisplay(dpy);
SyncHandle();
TRACE("DestroyContext... return True");
return True;
}
PUBLIC GLboolean XF86DRICreateDrawable( __DRInativeDisplay * ndpy, int screen,
__DRIid drawable, drm_drawable_t * hHWDrawable )
{
Display * const dpy = (Display *) ndpy;
XExtDisplayInfo *info = find_display (dpy);
xXF86DRICreateDrawableReply rep;
xXF86DRICreateDrawableReq *req;
TRACE("CreateDrawable...");
XF86DRICheckExtension (dpy, info, False);
LockDisplay(dpy);
GetReq(XF86DRICreateDrawable, req);
req->reqType = info->codes->major_opcode;
req->driReqType = X_XF86DRICreateDrawable;
req->screen = screen;
req->drawable = drawable;
if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
UnlockDisplay(dpy);
SyncHandle();
TRACE("CreateDrawable... return False");
return False;
}
*hHWDrawable = rep.hHWDrawable;
UnlockDisplay(dpy);
SyncHandle();
TRACE("CreateDrawable... return True");
return True;
}
PUBLIC GLboolean XF86DRIDestroyDrawable( __DRInativeDisplay * ndpy, int screen,
__DRIid drawable )
{
Display * const dpy = (Display *) ndpy;
XExtDisplayInfo *info = find_display (dpy);
xXF86DRIDestroyDrawableReq *req;
TRACE("DestroyDrawable...");
XF86DRICheckExtension (dpy, info, False);
LockDisplay(dpy);
GetReq(XF86DRIDestroyDrawable, req);
req->reqType = info->codes->major_opcode;
req->driReqType = X_XF86DRIDestroyDrawable;
req->screen = screen;
req->drawable = drawable;
UnlockDisplay(dpy);
SyncHandle();
TRACE("DestroyDrawable... return True");
return True;
}
PUBLIC Bool XF86DRIGetDrawableInfo(Display* dpy, int screen, Drawable drawable,
unsigned int* index, unsigned int* stamp,
int* X, int* Y, int* W, int* H,
int* numClipRects, drm_clip_rect_t ** pClipRects,
int* backX, int* backY,
int* numBackClipRects, drm_clip_rect_t ** pBackClipRects )
{
XExtDisplayInfo *info = find_display (dpy);
xXF86DRIGetDrawableInfoReply rep;
xXF86DRIGetDrawableInfoReq *req;
int total_rects;
TRACE("GetDrawableInfo...");
XF86DRICheckExtension (dpy, info, False);
LockDisplay(dpy);
GetReq(XF86DRIGetDrawableInfo, req);
req->reqType = info->codes->major_opcode;
req->driReqType = X_XF86DRIGetDrawableInfo;
req->screen = screen;
req->drawable = drawable;
if (!_XReply(dpy, (xReply *)&rep, 1, xFalse))
{
UnlockDisplay(dpy);
SyncHandle();
TRACE("GetDrawableInfo... return False");
return False;
}
*index = rep.drawableTableIndex;
*stamp = rep.drawableTableStamp;
*X = (int)rep.drawableX;
*Y = (int)rep.drawableY;
*W = (int)rep.drawableWidth;
*H = (int)rep.drawableHeight;
*numClipRects = rep.numClipRects;
total_rects = *numClipRects;
*backX = rep.backX;
*backY = rep.backY;
*numBackClipRects = rep.numBackClipRects;
total_rects += *numBackClipRects;
#if 0
/* Because of the fix in Xserver/GL/dri/xf86dri.c, this check breaks
* backwards compatibility (Because of the >> 2 shift) but the fix
* enables multi-threaded apps to work.
*/
if (rep.length != ((((SIZEOF(xXF86DRIGetDrawableInfoReply) -
SIZEOF(xGenericReply) +
total_rects * sizeof(drm_clip_rect_t)) + 3) & ~3) >> 2)) {
_XEatData(dpy, rep.length);
UnlockDisplay(dpy);
SyncHandle();
TRACE("GetDrawableInfo... return False");
return False;
}
#endif
if (*numClipRects) {
int len = sizeof(drm_clip_rect_t) * (*numClipRects);
*pClipRects = (drm_clip_rect_t *)Xcalloc(len, 1);
if (*pClipRects)
_XRead(dpy, (char*)*pClipRects, len);
} else {
*pClipRects = NULL;
}
if (*numBackClipRects) {
int len = sizeof(drm_clip_rect_t) * (*numBackClipRects);
*pBackClipRects = (drm_clip_rect_t *)Xcalloc(len, 1);
if (*pBackClipRects)
_XRead(dpy, (char*)*pBackClipRects, len);
} else {
*pBackClipRects = NULL;
}
UnlockDisplay(dpy);
SyncHandle();
TRACE("GetDrawableInfo... return True");
return True;
}
PUBLIC Bool XF86DRIGetDeviceInfo(dpy, screen, hFrameBuffer,
fbOrigin, fbSize, fbStride, devPrivateSize, pDevPrivate)
Display* dpy;
int screen;
drm_handle_t * hFrameBuffer;
int* fbOrigin;
int* fbSize;
int* fbStride;
int* devPrivateSize;
void** pDevPrivate;
{
XExtDisplayInfo *info = find_display (dpy);
xXF86DRIGetDeviceInfoReply rep;
xXF86DRIGetDeviceInfoReq *req;
TRACE("GetDeviceInfo...");
XF86DRICheckExtension (dpy, info, False);
LockDisplay(dpy);
GetReq(XF86DRIGetDeviceInfo, req);
req->reqType = info->codes->major_opcode;
req->driReqType = X_XF86DRIGetDeviceInfo;
req->screen = screen;
if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) {
UnlockDisplay(dpy);
SyncHandle();
TRACE("GetDeviceInfo... return False");
return False;
}
*hFrameBuffer = rep.hFrameBufferLow;
#ifdef LONG64
*hFrameBuffer |= ((drm_handle_t)rep.hFrameBufferHigh) << 32;
#endif
*fbOrigin = rep.framebufferOrigin;
*fbSize = rep.framebufferSize;
*fbStride = rep.framebufferStride;
*devPrivateSize = rep.devPrivateSize;
if (rep.length) {
if (!(*pDevPrivate = (void *)Xcalloc(rep.devPrivateSize, 1))) {
_XEatData(dpy, ((rep.devPrivateSize+3) & ~3));
UnlockDisplay(dpy);
SyncHandle();
TRACE("GetDeviceInfo... return False");
return False;
}
_XRead(dpy, (char*)*pDevPrivate, rep.devPrivateSize);
} else {
*pDevPrivate = NULL;
}
UnlockDisplay(dpy);
SyncHandle();
TRACE("GetDeviceInfo... return True");
return True;
}
PUBLIC Bool XF86DRIOpenFullScreen(dpy, screen, drawable)
Display* dpy;
int screen;
Drawable drawable;
{
/* This function and the underlying X protocol are deprecated.
*/
(void) dpy;
(void) screen;
(void) drawable;
return False;
}
PUBLIC Bool XF86DRICloseFullScreen(dpy, screen, drawable)
Display* dpy;
int screen;
Drawable drawable;
{
/* This function and the underlying X protocol are deprecated.
*/
(void) dpy;
(void) screen;
(void) drawable;
return True;
}

View File

@@ -1,185 +0,0 @@
/* $XFree86: xc/lib/GL/glx/clientattrib.c,v 1.5 2001/03/21 16:04:39 dawes Exp $ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
*/
#include <assert.h>
#include "glxclient.h"
/*****************************************************************************/
void __indirect_glEnableClientState(GLenum array)
{
__GLXcontext *gc = __glXGetCurrentContext();
__GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
switch (array) {
case GL_COLOR_ARRAY:
ENABLE_ARRAY(state, color);
break;
case GL_EDGE_FLAG_ARRAY:
ENABLE_ARRAY(state, edgeFlag);
break;
case GL_INDEX_ARRAY:
ENABLE_ARRAY(state, index);
break;
case GL_NORMAL_ARRAY:
ENABLE_ARRAY(state, normal);
break;
case GL_TEXTURE_COORD_ARRAY:
ENABLE_TEXARRAY(state, state->vertArray.activeTexture);
break;
case GL_VERTEX_ARRAY:
ENABLE_ARRAY(state, vertex);
break;
case GL_SECONDARY_COLOR_ARRAY:
ENABLE_ARRAY(state, secondaryColor);
break;
case GL_FOG_COORD_ARRAY:
ENABLE_ARRAY(state, fogCoord);
break;
default:
__glXSetError(gc, GL_INVALID_ENUM);
}
}
void __indirect_glDisableClientState(GLenum array)
{
__GLXcontext *gc = __glXGetCurrentContext();
__GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
switch (array) {
case GL_COLOR_ARRAY:
DISABLE_ARRAY(state, color);
break;
case GL_EDGE_FLAG_ARRAY:
DISABLE_ARRAY(state, edgeFlag);
break;
case GL_INDEX_ARRAY:
DISABLE_ARRAY(state, index);
break;
case GL_NORMAL_ARRAY:
DISABLE_ARRAY(state, normal);
break;
case GL_TEXTURE_COORD_ARRAY:
DISABLE_TEXARRAY(state, state->vertArray.activeTexture);
break;
case GL_VERTEX_ARRAY:
DISABLE_ARRAY(state, vertex);
break;
case GL_SECONDARY_COLOR_ARRAY:
DISABLE_ARRAY(state, secondaryColor);
break;
case GL_FOG_COORD_ARRAY:
DISABLE_ARRAY(state, fogCoord);
break;
default:
__glXSetError(gc, GL_INVALID_ENUM);
}
}
/************************************************************************/
void __indirect_glPushClientAttrib(GLuint mask)
{
__GLXcontext *gc = __glXGetCurrentContext();
__GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
__GLXattribute **spp = gc->attributes.stackPointer, *sp;
if (spp < &gc->attributes.stack[__GL_CLIENT_ATTRIB_STACK_DEPTH]) {
if (!(sp = *spp)) {
sp = (__GLXattribute *)Xmalloc(sizeof(__GLXattribute));
*spp = sp;
}
sp->mask = mask;
gc->attributes.stackPointer = spp + 1;
if (mask & GL_CLIENT_PIXEL_STORE_BIT) {
sp->storePack = state->storePack;
sp->storeUnpack = state->storeUnpack;
}
if (mask & GL_CLIENT_VERTEX_ARRAY_BIT) {
sp->vertArray = state->vertArray;
}
} else {
__glXSetError(gc, GL_STACK_OVERFLOW);
return;
}
}
void __indirect_glPopClientAttrib(void)
{
__GLXcontext *gc = __glXGetCurrentContext();
__GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
__GLXattribute **spp = gc->attributes.stackPointer, *sp;
GLuint mask;
if (spp > &gc->attributes.stack[0]) {
--spp;
sp = *spp;
assert(sp != 0);
mask = sp->mask;
gc->attributes.stackPointer = spp;
if (mask & GL_CLIENT_PIXEL_STORE_BIT) {
state->storePack = sp->storePack;
state->storeUnpack = sp->storeUnpack;
}
if (mask & GL_CLIENT_VERTEX_ARRAY_BIT) {
state->vertArray = sp->vertArray;
}
sp->mask = 0;
} else {
__glXSetError(gc, GL_STACK_UNDERFLOW);
return;
}
}
void __glFreeAttributeState(__GLXcontext *gc)
{
__GLXattribute *sp, **spp;
for (spp = &gc->attributes.stack[0];
spp < &gc->attributes.stack[__GL_CLIENT_ATTRIB_STACK_DEPTH];
spp++) {
sp = *spp;
if (sp) {
XFree((char *)sp);
} else {
break;
}
}
}

View File

@@ -1,172 +0,0 @@
/* $XFree86: xc/lib/GL/glx/compsize.c,v 1.6 2004/01/28 18:11:38 alanh Exp $ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
*/
#include <GL/gl.h>
#include "size.h"
/*
** Return the number of elements per group of a specified format
*/
GLint __glElementsPerGroup(GLenum format, GLenum type)
{
/*
** To make row length computation valid for image extraction,
** packed pixel types assume elements per group equals one.
*/
switch(type) {
case GL_UNSIGNED_BYTE_3_3_2:
case GL_UNSIGNED_BYTE_2_3_3_REV:
case GL_UNSIGNED_SHORT_5_6_5:
case GL_UNSIGNED_SHORT_5_6_5_REV:
case GL_UNSIGNED_SHORT_4_4_4_4:
case GL_UNSIGNED_SHORT_4_4_4_4_REV:
case GL_UNSIGNED_SHORT_5_5_5_1:
case GL_UNSIGNED_SHORT_1_5_5_5_REV:
case GL_UNSIGNED_SHORT_8_8_APPLE:
case GL_UNSIGNED_SHORT_8_8_REV_APPLE:
case GL_UNSIGNED_SHORT_15_1_MESA:
case GL_UNSIGNED_SHORT_1_15_REV_MESA:
case GL_UNSIGNED_INT_8_8_8_8:
case GL_UNSIGNED_INT_8_8_8_8_REV:
case GL_UNSIGNED_INT_10_10_10_2:
case GL_UNSIGNED_INT_2_10_10_10_REV:
case GL_UNSIGNED_INT_24_8_NV:
case GL_UNSIGNED_INT_24_8_MESA:
case GL_UNSIGNED_INT_8_24_REV_MESA:
return 1;
default:
break;
}
switch(format) {
case GL_RGB:
case GL_BGR:
return 3;
case GL_422_EXT:
case GL_422_REV_EXT:
case GL_422_AVERAGE_EXT:
case GL_422_REV_AVERAGE_EXT:
case GL_YCBCR_422_APPLE:
case GL_LUMINANCE_ALPHA:
return 2;
case GL_RGBA:
case GL_BGRA:
case GL_ABGR_EXT:
return 4;
case GL_COLOR_INDEX:
case GL_STENCIL_INDEX:
case GL_DEPTH_COMPONENT:
case GL_RED:
case GL_GREEN:
case GL_BLUE:
case GL_ALPHA:
case GL_LUMINANCE:
case GL_INTENSITY:
return 1;
default:
return 0;
}
}
/*
** Return the number of bytes per element, based on the element type (other
** than GL_BITMAP).
*/
GLint __glBytesPerElement(GLenum type)
{
switch(type) {
case GL_UNSIGNED_SHORT:
case GL_SHORT:
case GL_UNSIGNED_SHORT_5_6_5:
case GL_UNSIGNED_SHORT_5_6_5_REV:
case GL_UNSIGNED_SHORT_4_4_4_4:
case GL_UNSIGNED_SHORT_4_4_4_4_REV:
case GL_UNSIGNED_SHORT_5_5_5_1:
case GL_UNSIGNED_SHORT_1_5_5_5_REV:
case GL_UNSIGNED_SHORT_8_8_APPLE:
case GL_UNSIGNED_SHORT_8_8_REV_APPLE:
case GL_UNSIGNED_SHORT_15_1_MESA:
case GL_UNSIGNED_SHORT_1_15_REV_MESA:
return 2;
case GL_UNSIGNED_BYTE:
case GL_BYTE:
case GL_UNSIGNED_BYTE_3_3_2:
case GL_UNSIGNED_BYTE_2_3_3_REV:
return 1;
case GL_INT:
case GL_UNSIGNED_INT:
case GL_FLOAT:
case GL_UNSIGNED_INT_8_8_8_8:
case GL_UNSIGNED_INT_8_8_8_8_REV:
case GL_UNSIGNED_INT_10_10_10_2:
case GL_UNSIGNED_INT_2_10_10_10_REV:
case GL_UNSIGNED_INT_24_8_NV:
case GL_UNSIGNED_INT_24_8_MESA:
case GL_UNSIGNED_INT_8_24_REV_MESA:
return 4;
default:
return 0;
}
}
/*
** Compute memory required for internal packed array of data of given type
** and format.
*/
GLint __glImageSize(GLsizei width, GLsizei height, GLsizei depth,
GLenum format, GLenum type)
{
int bytes_per_row;
int components;
if (width < 0 || height < 0 || depth < 0) {
return 0;
}
/*
** Zero is returned if either format or type are invalid.
*/
components = __glElementsPerGroup(format,type);
if (type == GL_BITMAP) {
if (format == GL_COLOR_INDEX || format == GL_STENCIL_INDEX) {
bytes_per_row = (width + 7) >> 3;
} else {
return 0;
}
} else {
bytes_per_row = __glBytesPerElement(type) * width;
}
return bytes_per_row * height * depth * components;
}

View File

@@ -1,74 +0,0 @@
/* $XFree86: xc/lib/GL/glx/dispatch.c,v 1.5 2003/06/30 01:45:10 torrey Exp $ */
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, 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 PRECISION INSIGHT AND/OR ITS 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.
**************************************************************************/
/*
* Authors:
* Brian Paul <brian@precisioninsight.com>
*
*/
#ifndef GLX_USE_APPLEGL
#include <GL/gl.h>
#include "glheader.h"
#include "glapi.h"
#include "glapitable.h"
/*
* NOTE: this file implements C-based dispatch of the OpenGL entrypoints
* (glAccum, glBegin, etc).
* This code IS NOT USED if we're compiling on an x86 system and using
* the glapi_x86.S assembly code.
*/
#if !(defined(USE_X86_ASM) || defined(USE_SPARC_ASM))
#define KEYWORD1 PUBLIC
#define KEYWORD2
#define NAME(func) gl##func
#define DISPATCH(func, args, msg) \
const struct _glapi_table *dispatch; \
dispatch = _glapi_Dispatch ? _glapi_Dispatch : _glapi_get_dispatch();\
(dispatch->func) args
#define RETURN_DISPATCH(func, args, msg) \
const struct _glapi_table *dispatch; \
dispatch = _glapi_Dispatch ? _glapi_Dispatch : _glapi_get_dispatch();\
return (dispatch->func) args
#include "glapitemp.h"
#endif /* USE_X86_ASM */
#endif /* !GLX_USE_APPLEGL */

View File

@@ -1,490 +0,0 @@
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, 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 PRECISION INSIGHT AND/OR ITS 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.
**************************************************************************/
/* $XFree86: xc/lib/GL/dri/dri_glx.c,v 1.14 2003/07/16 00:54:00 dawes Exp $ */
/*
* Authors:
* Kevin E. Martin <kevin@precisioninsight.com>
* Brian Paul <brian@precisioninsight.com>
*
*/
#ifdef GLX_DIRECT_RENDERING
#include <unistd.h>
#include <X11/Xlibint.h>
#include <X11/extensions/Xext.h>
#include "extutil.h"
#include "glxclient.h"
#include "xf86dri.h"
#include "sarea.h"
#include <stdio.h>
#include <dlfcn.h>
#include "dri_glx.h"
#include <sys/types.h>
#include <stdarg.h>
#ifndef RTLD_NOW
#define RTLD_NOW 0
#endif
#ifndef RTLD_GLOBAL
#define RTLD_GLOBAL 0
#endif
#ifdef BUILT_IN_DRI_DRIVER
extern void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
int numConfigs, __GLXvisualConfig *config);
#else /* BUILT_IN_DRI_DRIVER */
#ifndef DEFAULT_DRIVER_DIR
/* this is normally defined in the Imakefile */
#define DEFAULT_DRIVER_DIR "/usr/X11R6/lib/modules/dri"
#endif
static __DRIdriver *Drivers = NULL;
/*
* printf wrappers
*/
static void InfoMessageF(const char *f, ...)
{
va_list args;
const char *env;
if ((env = getenv("LIBGL_DEBUG")) && strstr(env, "verbose")) {
fprintf(stderr, "libGL: ");
va_start(args, f);
vfprintf(stderr, f, args);
va_end(args);
}
}
static void ErrorMessageF(const char *f, ...)
{
va_list args;
if (getenv("LIBGL_DEBUG")) {
fprintf(stderr, "libGL error: ");
va_start(args, f);
vfprintf(stderr, f, args);
va_end(args);
}
}
/*
* We'll save a pointer to this function when we couldn't find a
* direct rendering driver for a given screen.
*/
static void *DummyCreateScreen(Display *dpy, int scrn, __DRIscreen *psc,
int numConfigs, __GLXvisualConfig *config)
{
(void) dpy;
(void) scrn;
(void) psc;
(void) numConfigs;
(void) config;
return NULL;
}
/**
* Extract the ith directory path out of a colon-separated list of paths. No
* more than \c dirLen characters, including the terminating \c NUL, will be
* written to \c dir.
*
* \param index Index of path to extract (starting at zero)
* \param paths The colon-separated list of paths
* \param dirLen Maximum length of result to store in \c dir
* \param dir Buffer to hold the extracted directory path
*
* \returns
* The number of characters that would have been written to \c dir had there
* been enough room. This does not include the terminating \c NUL. When
* extraction fails, zero will be returned.
*
* \todo
* It seems like this function could be rewritten to use \c strchr.
*/
static size_t
ExtractDir(int index, const char *paths, int dirLen, char *dir)
{
int i, len;
const char *start, *end;
/* find ith colon */
start = paths;
i = 0;
while (i < index) {
if (*start == ':') {
i++;
start++;
}
else if (*start == 0) {
/* end of string and couldn't find ith colon */
dir[0] = 0;
return 0;
}
else {
start++;
}
}
while (*start == ':')
start++;
/* find next colon, or end of string */
end = start + 1;
while (*end != ':' && *end != 0) {
end++;
}
/* copy string between <start> and <end> into result string */
len = end - start;
if (len > dirLen - 1)
len = dirLen - 1;
strncpy(dir, start, len);
dir[len] = 0;
return( end - start );
}
/**
* Try to \c dlopen the named driver.
*
* This function adds the "_dri.so" suffix to the driver name and searches the
* directories specified by the \c LIBGL_DRIVERS_PATH environment variable in
* order to find the driver.
*
* \param driverName - a name like "tdfx", "i810", "mga", etc.
*
* \returns
* A handle from \c dlopen, or \c NULL if driver file not found.
*/
static __DRIdriver *OpenDriver(const char *driverName)
{
char *libPaths = NULL;
char libDir[1000];
int i;
__DRIdriver *driver;
/* First, search Drivers list to see if we've already opened this driver */
for (driver = Drivers; driver; driver = driver->next) {
if (strcmp(driver->name, driverName) == 0) {
/* found it */
return driver;
}
}
if (geteuid() == getuid()) {
/* don't allow setuid apps to use LIBGL_DRIVERS_PATH */
libPaths = getenv("LIBGL_DRIVERS_PATH");
if (!libPaths)
libPaths = getenv("LIBGL_DRIVERS_DIR"); /* deprecated */
}
if (!libPaths)
libPaths = DEFAULT_DRIVER_DIR;
for ( i = 0 ; ExtractDir(i, libPaths, 1000, libDir) != 0 ; i++ ) {
char realDriverName[200];
void *handle = NULL;
if ( handle == NULL ) {
snprintf(realDriverName, 200, "%s/%s_dri.so", libDir, driverName);
InfoMessageF("OpenDriver: trying %s\n", realDriverName);
handle = dlopen(realDriverName, RTLD_NOW | RTLD_GLOBAL);
}
if ( handle != NULL ) {
/* allocate __DRIdriver struct */
driver = (__DRIdriver *) Xmalloc(sizeof(__DRIdriver));
if (!driver)
return NULL; /* out of memory! */
/* init the struct */
driver->name = __glXstrdup(driverName);
if (!driver->name) {
Xfree(driver);
return NULL; /* out of memory! */
}
driver->createScreenFunc = (CreateScreenFunc)
dlsym(handle, "__driCreateScreen");
driver->createNewScreenFunc = (CreateNewScreenFunc)
dlsym(handle, "__driCreateNewScreen");
if ( (driver->createScreenFunc == NULL)
&& (driver->createNewScreenFunc == NULL) ) {
/* If the driver doesn't have this symbol then something's
* really, really wrong.
*/
ErrorMessageF("Neither __driCreateScreen or __driCreateNewScreen "
"are defined in %s_dri.so!\n", driverName);
Xfree(driver);
dlclose(handle);
continue;
}
driver->handle = handle;
/* put at head of linked list */
driver->next = Drivers;
Drivers = driver;
return driver;
}
else {
ErrorMessageF("dlopen %s failed (%s)\n", realDriverName, dlerror());
}
}
ErrorMessageF("unable to find driver: %s_dri.so\n", driverName);
return NULL;
}
/*
* Given a display pointer and screen number, determine the name of
* the DRI driver for the screen. (I.e. "r128", "tdfx", etc).
* Return True for success, False for failure.
*/
static Bool GetDriverName(Display *dpy, int scrNum, char **driverName)
{
int directCapable;
Bool b;
int driverMajor, driverMinor, driverPatch;
*driverName = NULL;
if (!XF86DRIQueryDirectRenderingCapable(dpy, scrNum, &directCapable)) {
ErrorMessageF("XF86DRIQueryDirectRenderingCapable failed\n");
return False;
}
if (!directCapable) {
ErrorMessageF("XF86DRIQueryDirectRenderingCapable returned false\n");
return False;
}
b = XF86DRIGetClientDriverName(dpy, scrNum, &driverMajor, &driverMinor,
&driverPatch, driverName);
if (!b) {
ErrorMessageF("Cannot determine driver name for screen %d\n", scrNum);
return False;
}
InfoMessageF("XF86DRIGetClientDriverName: %d.%d.%d %s (screen %d)\n",
driverMajor, driverMinor, driverPatch, *driverName, scrNum);
return True;
}
/*
* Given a display pointer and screen number, return a __DRIdriver handle.
* Return NULL if anything goes wrong.
*/
__DRIdriver *driGetDriver(Display *dpy, int scrNum)
{
char *driverName;
if (GetDriverName(dpy, scrNum, &driverName)) {
__DRIdriver *ret;
ret = OpenDriver(driverName);
if (driverName)
Xfree(driverName);
return ret;
}
return NULL;
}
/*
* Exported function for querying the DRI driver for a given screen.
*
* The returned char pointer points to a static array that will be
* overwritten by subsequent calls.
*/
const char *glXGetScreenDriver (Display *dpy, int scrNum) {
static char ret[32];
char *driverName;
if (GetDriverName(dpy, scrNum, &driverName)) {
int len;
if (!driverName)
return NULL;
len = strlen (driverName);
if (len >= 31)
return NULL;
memcpy (ret, driverName, len+1);
Xfree(driverName);
return ret;
}
return NULL;
}
/*
* Exported function for obtaining a driver's option list (UTF-8 encoded XML).
*
* The returned char pointer points directly into the driver. Therefore
* it should be treated as a constant.
*
* If the driver was not found or does not support configuration NULL is
* returned.
*
* Note: The driver remains opened after this function returns.
*/
const char *glXGetDriverConfig (const char *driverName) {
__DRIdriver *driver = OpenDriver (driverName);
if (driver)
return dlsym (driver->handle, "__driConfigOptions");
else
return NULL;
}
#endif /* BUILT_IN_DRI_DRIVER */
/* This function isn't currently used.
*/
static void driDestroyDisplay(Display *dpy, void *private)
{
__DRIdisplayPrivate *pdpyp = (__DRIdisplayPrivate *)private;
if (pdpyp) {
const int numScreens = ScreenCount(dpy);
int i;
for (i = 0; i < numScreens; i++) {
if (pdpyp->libraryHandles[i])
dlclose(pdpyp->libraryHandles[i]);
}
Xfree(pdpyp->libraryHandles);
Xfree(pdpyp);
}
}
/*
* Allocate, initialize and return a __DRIdisplayPrivate object.
* This is called from __glXInitialize() when we are given a new
* display pointer.
*/
void *driCreateDisplay(Display *dpy, __DRIdisplay *pdisp)
{
const int numScreens = ScreenCount(dpy);
__DRIdisplayPrivate *pdpyp;
int eventBase, errorBase;
int major, minor, patch;
int scrn;
/* Initialize these fields to NULL in case we fail.
* If we don't do this we may later get segfaults trying to free random
* addresses when the display is closed.
*/
pdisp->private = NULL;
pdisp->destroyDisplay = NULL;
pdisp->createScreen = NULL;
if (!XF86DRIQueryExtension(dpy, &eventBase, &errorBase)) {
return NULL;
}
if (!XF86DRIQueryVersion(dpy, &major, &minor, &patch)) {
return NULL;
}
pdpyp = (__DRIdisplayPrivate *)Xmalloc(sizeof(__DRIdisplayPrivate));
if (!pdpyp) {
return NULL;
}
pdpyp->driMajor = major;
pdpyp->driMinor = minor;
pdpyp->driPatch = patch;
pdisp->destroyDisplay = driDestroyDisplay;
/* allocate array of pointers to createScreen funcs */
pdisp->createScreen = (CreateScreenFunc *) Xmalloc(numScreens * sizeof(void *));
if (!pdisp->createScreen) {
Xfree(pdpyp);
return NULL;
}
/* allocate array of pointers to createScreen funcs */
pdisp->createNewScreen = (CreateNewScreenFunc *) Xmalloc(numScreens * sizeof(void *));
if (!pdisp->createNewScreen) {
Xfree(pdisp->createScreen);
Xfree(pdpyp);
return NULL;
}
/* allocate array of library handles */
pdpyp->libraryHandles = (void **) Xmalloc(numScreens * sizeof(void*));
if (!pdpyp->libraryHandles) {
Xfree(pdisp->createNewScreen);
Xfree(pdisp->createScreen);
Xfree(pdpyp);
return NULL;
}
#ifdef BUILT_IN_DRI_DRIVER
/* we'll statically bind to the built-in __driCreateScreen function */
for (scrn = 0; scrn < numScreens; scrn++) {
pdisp->createScreen[scrn] = __driCreateScreen;
pdisp->createNewScreen[scrn] = NULL;
pdpyp->libraryHandles[scrn] = NULL;
}
#else
/* dynamically discover DRI drivers for all screens, saving each
* driver's "__driCreateScreen" function pointer. That's the bootstrap
* entrypoint for all DRI drivers.
*/
for (scrn = 0; scrn < numScreens; scrn++) {
__DRIdriver *driver = driGetDriver(dpy, scrn);
if (driver) {
pdisp->createScreen[scrn] = driver->createScreenFunc;
pdisp->createNewScreen[scrn] = driver->createNewScreenFunc;
pdpyp->libraryHandles[scrn] = driver->handle;
}
else {
pdisp->createScreen[scrn] = DummyCreateScreen;
pdisp->createNewScreen[scrn] = NULL;
pdpyp->libraryHandles[scrn] = NULL;
}
}
#endif
return (void *)pdpyp;
}
#endif /* GLX_DIRECT_RENDERING */

View File

@@ -1,61 +0,0 @@
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, 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 PRECISION INSIGHT AND/OR ITS 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.
**************************************************************************/
/*
* Authors:
* Kevin E. Martin <kevin@precisioninsight.com>
* Brian Paul <brian@precisioninsight.com>
*
*/
#ifndef _DRI_GLX_H_
#define _DRI_GLX_H_
#ifdef GLX_DIRECT_RENDERING
struct __DRIdisplayPrivateRec {
/*
** XFree86-DRI version information
*/
int driMajor;
int driMinor;
int driPatch;
/*
** Array of library handles [indexed by screen number]
*/
void **libraryHandles;
};
typedef struct __DRIdisplayPrivateRec __DRIdisplayPrivate;
typedef struct __DRIscreenPrivateRec __DRIscreenPrivate;
typedef struct __DRIvisualPrivateRec __DRIvisualPrivate;
typedef struct __DRIcontextPrivateRec __DRIcontextPrivate;
typedef struct __DRIdrawablePrivateRec __DRIdrawablePrivate;
#endif
#endif /* _DRI_GLX_H_ */

View File

@@ -1,132 +0,0 @@
/* $XFree86$ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
*/
#include "packrender.h"
/*
** Routines to pack evaluator maps into the transport buffer. Maps are
** allowed to have extra arbitrary data, so these routines extract just
** the information that the GL needs.
*/
void __glFillMap1f(GLint k, GLint order, GLint stride,
const GLfloat *points, GLubyte *pc)
{
if (stride == k) {
/* Just copy the data */
__GLX_PUT_FLOAT_ARRAY(0, points, order * k);
} else {
GLint i;
for (i = 0; i < order; i++) {
__GLX_PUT_FLOAT_ARRAY(0, points, k);
points += stride;
pc += k * __GLX_SIZE_FLOAT32;
}
}
}
void __glFillMap1d(GLint k, GLint order, GLint stride,
const GLdouble *points, GLubyte *pc)
{
if (stride == k) {
/* Just copy the data */
__GLX_PUT_DOUBLE_ARRAY(0, points, order * k);
} else {
GLint i;
for (i = 0; i < order; i++) {
__GLX_PUT_DOUBLE_ARRAY(0, points, k);
points += stride;
pc += k * __GLX_SIZE_FLOAT64;
}
}
}
void __glFillMap2f(GLint k, GLint majorOrder, GLint minorOrder,
GLint majorStride, GLint minorStride,
const GLfloat *points, GLfloat *data)
{
GLint i, j, x;
if ((minorStride == k) && (majorStride == minorOrder*k)) {
/* Just copy the data */
__GLX_MEM_COPY(data, points, majorOrder * majorStride *
__GLX_SIZE_FLOAT32);
return;
}
for (i = 0; i < majorOrder; i++) {
for (j = 0; j < minorOrder; j++) {
for (x = 0; x < k; x++) {
data[x] = points[x];
}
points += minorStride;
data += k;
}
points += majorStride - minorStride * minorOrder;
}
}
void __glFillMap2d(GLint k, GLint majorOrder, GLint minorOrder,
GLint majorStride, GLint minorStride,
const GLdouble *points, GLdouble *data)
{
int i,j,x;
if ((minorStride == k) && (majorStride == minorOrder*k)) {
/* Just copy the data */
__GLX_MEM_COPY(data, points, majorOrder * majorStride *
__GLX_SIZE_FLOAT64);
return;
}
#ifdef __GLX_ALIGN64
x = k * __GLX_SIZE_FLOAT64;
#endif
for (i = 0; i<majorOrder; i++) {
for (j = 0; j<minorOrder; j++) {
#ifdef __GLX_ALIGN64
__GLX_MEM_COPY(data, points, x);
#else
for (x = 0; x<k; x++) {
data[x] = points[x];
}
#endif
points += minorStride;
data += k;
}
points += majorStride - minorStride * minorOrder;
}
}

View File

@@ -1,557 +0,0 @@
/*
* (C) Copyright IBM Corporation 2004
* 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
* IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
/**
* \file glx_pbuffer.c
* Implementation of pbuffer related functions.
*
* \author Ian Romanick <idr@us.ibm.com>
*/
#include <inttypes.h>
#include "glxclient.h"
#include <extutil.h>
#include <Xext.h>
#include <assert.h>
#include <string.h>
#include "glapi.h"
#include "glxextensions.h"
#include "glcontextmodes.h"
#include "glheader.h"
#ifdef IN_DOXYGEN
#define GLX_PREFIX(x) x
#endif /* IN_DOXYGEN */
static void ChangeDrawableAttribute( Display * dpy, GLXDrawable drawable,
const CARD32 * attribs, size_t num_attribs );
static void DestroyPbuffer( Display * dpy, GLXDrawable drawable );
static GLXDrawable CreatePbuffer( Display *dpy,
const __GLcontextModes * fbconfig, unsigned int width, unsigned int height,
const int *attrib_list, GLboolean size_in_attribs );
static int GetDrawableAttribute( Display *dpy, GLXDrawable drawable,
int attribute, unsigned int *value );
/**
* Change a drawable's attribute.
*
* This function is used to implement \c glXSelectEvent and
* \c glXSelectEventSGIX.
*
* \note
* This function dynamically determines whether to use the SGIX_pbuffer
* version of the protocol or the GLX 1.3 version of the protocol.
*
* \todo
* This function needs to be modified to work with direct-rendering drivers.
*/
static void
ChangeDrawableAttribute( Display * dpy, GLXDrawable drawable,
const CARD32 * attribs, size_t num_attribs )
{
__GLXdisplayPrivate *priv = __glXInitialize(dpy);
CARD32 * output;
if ( (dpy == NULL) || (drawable == 0) ) {
return;
}
LockDisplay(dpy);
if ( (priv->majorVersion > 1) || (priv->minorVersion >= 3) ) {
xGLXChangeDrawableAttributesReq *req;
GetReqExtra( GLXChangeDrawableAttributes, 8 + (8 * num_attribs), req );
output = (CARD32 *) (req + 1);
req->reqType = __glXSetupForCommand(dpy);
req->glxCode = X_GLXChangeDrawableAttributes;
req->drawable = drawable;
req->numAttribs = (CARD32) num_attribs;
}
else {
xGLXVendorPrivateWithReplyReq *vpreq;
GetReqExtra( GLXVendorPrivateWithReply, 4 + (8 * num_attribs), vpreq );
output = (CARD32 *) (vpreq + 1);
vpreq->reqType = __glXSetupForCommand(dpy);
vpreq->glxCode = X_GLXVendorPrivateWithReply;
vpreq->vendorCode = X_GLXvop_ChangeDrawableAttributesSGIX;
output[0] = (CARD32) drawable;
output++;
}
(void) memcpy( output, attribs, sizeof( CARD32 ) * 2 * num_attribs );
UnlockDisplay(dpy);
SyncHandle();
return;
}
/**
* Destroy a pbuffer.
*
* This function is used to implement \c glXDestroyPbuffer and
* \c glXDestroyGLXPbufferSGIX.
*
* \note
* This function dynamically determines whether to use the SGIX_pbuffer
* version of the protocol or the GLX 1.3 version of the protocol.
*
* \todo
* This function needs to be modified to work with direct-rendering drivers.
*/
static void
DestroyPbuffer( Display * dpy, GLXDrawable drawable )
{
__GLXdisplayPrivate *priv = __glXInitialize(dpy);
if ( (dpy == NULL) || (drawable == 0) ) {
return;
}
LockDisplay(dpy);
if ( (priv->majorVersion > 1) || (priv->minorVersion >= 3) ) {
xGLXDestroyPbufferReq * req;
GetReqExtra( GLXDestroyPbuffer, 4, req );
req->reqType = __glXSetupForCommand(dpy);
req->glxCode = X_GLXDestroyPbuffer;
req->pbuffer = (GLXPbuffer) drawable;
}
else {
xGLXVendorPrivateWithReplyReq *vpreq;
CARD32 * data;
GetReqExtra( GLXVendorPrivateWithReply, 4, vpreq );
data = (CARD32 *) (vpreq + 1);
data[0] = (CARD32) drawable;
vpreq->reqType = __glXSetupForCommand(dpy);
vpreq->glxCode = X_GLXVendorPrivateWithReply;
vpreq->vendorCode = X_GLXvop_DestroyGLXPbufferSGIX;
}
UnlockDisplay(dpy);
SyncHandle();
return;
}
/**
* Get a drawable's attribute.
*
* This function is used to implement \c glXGetSelectedEvent and
* \c glXGetSelectedEventSGIX.
*
* \note
* This function dynamically determines whether to use the SGIX_pbuffer
* version of the protocol or the GLX 1.3 version of the protocol.
*
* \todo
* The number of attributes returned is likely to be small, probably less than
* 10. Given that, this routine should try to use an array on the stack to
* capture the reply rather than always calling Xmalloc.
*
* \todo
* This function needs to be modified to work with direct-rendering drivers.
*/
static int
GetDrawableAttribute( Display *dpy, GLXDrawable drawable,
int attribute, unsigned int *value )
{
__GLXdisplayPrivate *priv = __glXInitialize(dpy);
xGLXGetDrawableAttributesReply reply;
CARD32 * data;
unsigned int length;
unsigned int i;
unsigned int num_attributes;
GLboolean use_glx_1_3 = ((priv->majorVersion > 1)
|| (priv->minorVersion >= 3));
if ( (dpy == NULL) || (drawable == 0) ) {
return 0;
}
LockDisplay(dpy);
if ( use_glx_1_3 ) {
xGLXGetDrawableAttributesReq *req;
GetReqExtra( GLXGetDrawableAttributes, 4, req );
req->reqType = __glXSetupForCommand(dpy);
req->glxCode = X_GLXGetDrawableAttributes;
req->drawable = drawable;
}
else {
xGLXVendorPrivateWithReplyReq *vpreq;
GetReqExtra( GLXVendorPrivateWithReply, 4, vpreq );
data = (CARD32 *) (vpreq + 1);
data[0] = (CARD32) drawable;
vpreq->reqType = __glXSetupForCommand(dpy);
vpreq->glxCode = X_GLXVendorPrivateWithReply;
vpreq->vendorCode = X_GLXvop_GetDrawableAttributesSGIX;
}
_XReply(dpy, (xReply*) &reply, 0, False);
length = reply.length;
num_attributes = (use_glx_1_3) ? reply.numAttribs : length / 2;
data = (CARD32 *) Xmalloc( length * sizeof(CARD32) );
if ( data == NULL ) {
/* Throw data on the floor */
_XEatData(dpy, length);
} else {
_XRead(dpy, (char *)data, length * sizeof(CARD32) );
}
UnlockDisplay(dpy);
SyncHandle();
/* Search the set of returned attributes for the attribute requested by
* the caller.
*/
for ( i = 0 ; i < num_attributes ; i++ ) {
if ( data[i*2] == attribute ) {
*value = data[ (i*2) + 1 ];
break;
}
}
Xfree( data );
return 0;
}
/**
* Create a non-pbuffer GLX drawable.
*
* \todo
* This function needs to be modified to work with direct-rendering drivers.
*/
static GLXDrawable
CreateDrawable( Display *dpy, const __GLcontextModes * fbconfig,
Drawable drawable, const int *attrib_list,
CARD8 glxCode )
{
xGLXCreateWindowReq * req;
CARD32 * data;
unsigned int i;
for ( i = 0 ; attrib_list[i * 2] != None ; i++ )
/* empty */ ;
LockDisplay(dpy);
GetReqExtra( GLXCreateWindow, 20 + (8 * i), req );
data = (CARD32 *) (req + 1);
req->reqType = __glXSetupForCommand(dpy);
req->glxCode = glxCode;
req->screen = (CARD32) fbconfig->screen;
req->fbconfig = fbconfig->fbconfigID;
req->window = (GLXPbuffer) drawable;
req->numAttribs = (CARD32) i;
UnlockDisplay(dpy);
SyncHandle();
return drawable;
}
/**
* Destroy a non-pbuffer GLX drawable.
*
* \todo
* This function needs to be modified to work with direct-rendering drivers.
*/
static void
DestroyDrawable( Display * dpy, GLXDrawable drawable, CARD32 glxCode )
{
xGLXDestroyPbufferReq * req;
if ( (dpy == NULL) || (drawable == 0) ) {
return;
}
LockDisplay(dpy);
GetReqExtra( GLXDestroyPbuffer, 4, req );
req->reqType = __glXSetupForCommand(dpy);
req->glxCode = glxCode;
req->pbuffer = (GLXPbuffer) drawable;
UnlockDisplay(dpy);
SyncHandle();
return;
}
/**
* Create a pbuffer.
*
* This function is used to implement \c glXCreatePbuffer and
* \c glXCreateGLXPbufferSGIX.
*
* \note
* This function dynamically determines whether to use the SGIX_pbuffer
* version of the protocol or the GLX 1.3 version of the protocol.
*
* \todo
* This function needs to be modified to work with direct-rendering drivers.
*/
static GLXDrawable
CreatePbuffer( Display *dpy, const __GLcontextModes * fbconfig,
unsigned int width, unsigned int height,
const int *attrib_list, GLboolean size_in_attribs )
{
__GLXdisplayPrivate *priv = __glXInitialize(dpy);
GLXDrawable id = 0;
CARD32 * data;
unsigned int i;
for ( i = 0 ; attrib_list[i * 2] != None ; i++ )
/* empty */ ;
LockDisplay(dpy);
id = XAllocID(dpy);
if ( (priv->majorVersion > 1) || (priv->minorVersion >= 3) ) {
xGLXCreatePbufferReq * req;
unsigned int extra = (size_in_attribs) ? 0 : 2;
GetReqExtra( GLXCreatePbuffer, (8 * (i + extra)), req );
data = (CARD32 *) (req + 1);
req->reqType = __glXSetupForCommand(dpy);
req->glxCode = X_GLXCreatePbuffer;
req->screen = (CARD32) fbconfig->screen;
req->fbconfig = fbconfig->fbconfigID;
req->pbuffer = (GLXPbuffer) id;
req->numAttribs = (CARD32) (i + extra);
if ( ! size_in_attribs ) {
data[(2 * i) + 0] = GLX_PBUFFER_WIDTH;
data[(2 * i) + 1] = width;
data[(2 * i) + 2] = GLX_PBUFFER_HEIGHT;
data[(2 * i) + 3] = height;
data += 4;
}
}
else {
xGLXVendorPrivateReq *vpreq;
GetReqExtra( GLXVendorPrivate, 20 + (8 * i), vpreq );
data = (CARD32 *) (vpreq + 1);
vpreq->reqType = __glXSetupForCommand(dpy);
vpreq->glxCode = X_GLXVendorPrivate;
vpreq->vendorCode = X_GLXvop_CreateGLXPbufferSGIX;
data[0] = (CARD32) fbconfig->screen;
data[1] = (CARD32) fbconfig->fbconfigID;
data[2] = (CARD32) id;
data[3] = (CARD32) width;
data[4] = (CARD32) height;
data += 5;
}
(void) memcpy( data, attrib_list, sizeof(CARD32) * 2 * i );
UnlockDisplay(dpy);
SyncHandle();
return id;
}
/**
* Create a new pbuffer.
*/
PUBLIC GLXPbufferSGIX
GLX_PREFIX(glXCreateGLXPbufferSGIX)(Display *dpy, GLXFBConfigSGIX config,
unsigned int width, unsigned int height,
int *attrib_list)
{
return (GLXPbufferSGIX) CreatePbuffer( dpy, (__GLcontextModes *) config,
width, height,
attrib_list, GL_FALSE );
}
/**
* Create a new pbuffer.
*/
PUBLIC GLXPbuffer
GLX_PREFIX(glXCreatePbuffer)(Display *dpy, GLXFBConfig config,
const int *attrib_list)
{
return (GLXPbuffer) CreatePbuffer( dpy, (__GLcontextModes *) config,
0, 0,
attrib_list, GL_TRUE );
}
/**
* Destroy an existing pbuffer.
*/
PUBLIC void
GLX_PREFIX(glXDestroyPbuffer)(Display *dpy, GLXPbuffer pbuf)
{
DestroyPbuffer( dpy, pbuf );
}
/**
* Query an attribute of a drawable.
*/
PUBLIC void
GLX_PREFIX(glXQueryDrawable)(Display *dpy, GLXDrawable drawable,
int attribute, unsigned int *value)
{
GetDrawableAttribute( dpy, drawable, attribute, value );
}
/**
* Query an attribute of a pbuffer.
*/
PUBLIC int
GLX_PREFIX(glXQueryGLXPbufferSGIX)(Display *dpy, GLXPbufferSGIX drawable,
int attribute, unsigned int *value)
{
return GetDrawableAttribute( dpy, drawable, attribute, value );
}
/**
* Select the event mask for a drawable.
*/
PUBLIC void
GLX_PREFIX(glXSelectEvent)(Display *dpy, GLXDrawable drawable,
unsigned long mask)
{
CARD32 attribs[2];
attribs[0] = (CARD32) GLX_EVENT_MASK;
attribs[1] = (CARD32) mask;
ChangeDrawableAttribute( dpy, drawable, attribs, 1 );
}
/**
* Get the selected event mask for a drawable.
*/
PUBLIC void
GLX_PREFIX(glXGetSelectedEvent)(Display *dpy, GLXDrawable drawable,
unsigned long *mask)
{
unsigned int value;
/* The non-sense with value is required because on LP64 platforms
* sizeof(unsigned int) != sizeof(unsigned long). On little-endian
* we could just type-cast the pointer, but why?
*/
GetDrawableAttribute( dpy, drawable, GLX_EVENT_MASK_SGIX, & value );
*mask = value;
}
PUBLIC GLXPixmap
GLX_PREFIX(glXCreatePixmap)( Display *dpy, GLXFBConfig config, Pixmap pixmap,
const int *attrib_list )
{
return CreateDrawable( dpy, (__GLcontextModes *) config,
(Drawable) pixmap, attrib_list,
X_GLXCreatePixmap );
}
PUBLIC GLXWindow
GLX_PREFIX(glXCreateWindow)( Display *dpy, GLXFBConfig config, Window win,
const int *attrib_list )
{
return CreateDrawable( dpy, (__GLcontextModes *) config,
(Drawable) win, attrib_list,
X_GLXCreateWindow );
}
PUBLIC void
GLX_PREFIX(glXDestroyPixmap)(Display *dpy, GLXPixmap pixmap)
{
DestroyDrawable( dpy, (GLXDrawable) pixmap, X_GLXDestroyPixmap );
}
PUBLIC void
GLX_PREFIX(glXDestroyWindow)(Display *dpy, GLXWindow win)
{
DestroyDrawable( dpy, (GLXDrawable) win, X_GLXDestroyWindow );
}
PUBLIC GLX_ALIAS_VOID(glXDestroyGLXPbufferSGIX,
(Display *dpy, GLXPbufferSGIX pbuf),
(dpy, pbuf),
glXDestroyPbuffer)
PUBLIC GLX_ALIAS_VOID(glXSelectEventSGIX,
(Display *dpy, GLXDrawable drawable, unsigned long mask),
(dpy, drawable, mask),
glXSelectEvent)
PUBLIC GLX_ALIAS_VOID(glXGetSelectedEventSGIX,
(Display *dpy, GLXDrawable drawable, unsigned long *mask),
(dpy, drawable, mask),
glXGetSelectedEvent)

View File

@@ -1,102 +0,0 @@
/*
* (C) Copyright IBM Corporation 2004
* 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
* IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
/**
* \file glx_query.c
* Generic utility functions to query internal data from the server.
*
* \author Ian Romanick <idr@us.ibm.com>
*/
#include "glxclient.h"
/**
* GLX protocol structure for the ficticious "GXLGenericGetString" request.
*
* This is a non-existant protocol packet. It just so happens that all of
* the real protocol packets used to request a string from the server have
* an identical binary layout. The only difference between them is the
* meaning of the \c for_whom field and the value of the \c glxCode.
*/
typedef struct GLXGenericGetString {
CARD8 reqType;
CARD8 glxCode;
CARD16 length B16;
CARD32 for_whom B32;
CARD32 name B32;
} xGLXGenericGetStringReq;
/* These defines are only needed to make the GetReq macro happy.
*/
#define sz_xGLXGenericGetStringReq 12
#define X_GLXGenericGetString 0
/**
* Query the Server GLX string and cache it in the display private.
* This routine will allocate the necessay space for the string.
*/
char *
__glXGetStringFromServer( Display * dpy, int opcode, CARD32 glxCode,
CARD32 for_whom, CARD32 name )
{
xGLXGenericGetStringReq *req;
xGLXSingleReply reply;
int length;
int numbytes;
char * buf;
LockDisplay( dpy );
/* All of the GLX protocol requests for getting a string from the server
* look the same. The exact meaning of the for_whom field is usually
* either the screen number (for glXQueryServerString) or the context tag
* (for GLXSingle).
*/
GetReq( GLXGenericGetString, req );
req->reqType = opcode;
req->glxCode = glxCode;
req->for_whom = for_whom;
req->name = name;
_XReply( dpy, (xReply *) & reply, 0, False );
length = reply.length * 4;
numbytes = reply.size;
buf = (char *) Xmalloc( numbytes );
if ( buf != NULL ) {
_XRead( dpy, buf, numbytes );
length -= numbytes;
}
_XEatData( dpy, length );
UnlockDisplay( dpy );
SyncHandle();
return buf;
}

View File

@@ -1,346 +0,0 @@
/*
* (C) Copyright IBM Corporation 2004
* 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
* THE COPYRIGHT HOLDERS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
* USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/**
* \file glx_texture_compression.c
* Contains the routines required to implement GLX protocol for
* ARB_texture_compression and related extensions.
*
* \sa http://oss.sgi.com/projects/ogl-sample/registry/ARB/texture_compression.txt
*
* \author Ian Romanick <idr@us.ibm.com>
*/
#include "packrender.h"
#include "packsingle.h"
#include <assert.h>
void
__indirect_glGetCompressedTexImageARB( GLenum target, GLint level,
GLvoid * img )
{
__GLX_SINGLE_DECLARE_VARIABLES();
xGLXGetTexImageReply reply;
size_t image_bytes;
__GLX_SINGLE_LOAD_VARIABLES();
__GLX_SINGLE_BEGIN( X_GLsop_GetCompressedTexImage, 8 );
__GLX_SINGLE_PUT_LONG( 0, target );
__GLX_SINGLE_PUT_LONG( 4, level );
__GLX_SINGLE_READ_XREPLY();
image_bytes = reply.width;
assert( image_bytes <= ((4 * reply.length) - 0) );
assert( image_bytes >= ((4 * reply.length) - 3) );
if ( image_bytes != 0 ) {
_XRead( dpy, (char *) img, image_bytes );
if ( image_bytes < (4 * reply.length) ) {
_XEatData( dpy, (4 * reply.length) - image_bytes );
}
}
__GLX_SINGLE_END();
}
/**
* Internal function used for \c glCompressedTexImage1D and
* \c glCompressedTexImage2D.
*/
static void
CompressedTexImage1D2D( GLenum target, GLint level,
GLenum internal_format,
GLsizei width, GLsizei height,
GLint border, GLsizei image_size,
const GLvoid *data, CARD32 rop )
{
__GLX_DECLARE_VARIABLES();
__GLX_LOAD_VARIABLES();
if ( gc->currentDpy == NULL ) {
return;
}
if ( (target == GL_PROXY_TEXTURE_1D)
|| (target == GL_PROXY_TEXTURE_2D)
|| (target == GL_PROXY_TEXTURE_CUBE_MAP) ) {
compsize = 0;
}
else {
compsize = image_size;
}
cmdlen = __GLX_PAD( __GLX_COMPRESSED_TEXIMAGE_CMD_HDR_SIZE
+ compsize );
if ( cmdlen <= gc->maxSmallRenderCommandSize ) {
__GLX_BEGIN_VARIABLE( rop, cmdlen );
__GLX_PUT_LONG( 4, target );
__GLX_PUT_LONG( 8, level );
__GLX_PUT_LONG( 12, internal_format );
__GLX_PUT_LONG( 16, width );
__GLX_PUT_LONG( 20, height );
__GLX_PUT_LONG( 24, border );
__GLX_PUT_LONG( 28, image_size );
if ( compsize != 0 ) {
__GLX_PUT_CHAR_ARRAY( __GLX_COMPRESSED_TEXIMAGE_CMD_HDR_SIZE,
data, image_size );
}
__GLX_END( cmdlen );
}
else {
assert( compsize != 0 );
__GLX_BEGIN_VARIABLE_LARGE( rop, cmdlen + 4 );
__GLX_PUT_LONG( 8, target );
__GLX_PUT_LONG( 12, level );
__GLX_PUT_LONG( 16, internal_format );
__GLX_PUT_LONG( 20, width );
__GLX_PUT_LONG( 24, height );
__GLX_PUT_LONG( 28, border );
__GLX_PUT_LONG( 32, image_size );
__glXSendLargeCommand( gc, gc->pc,
__GLX_COMPRESSED_TEXIMAGE_CMD_HDR_SIZE + 4,
data, image_size );
}
}
/**
* Internal function used for \c glCompressedTexSubImage1D and
* \c glCompressedTexSubImage2D.
*/
static void
CompressedTexSubImage1D2D( GLenum target, GLint level,
GLsizei xoffset, GLsizei yoffset,
GLsizei width, GLsizei height,
GLenum format, GLsizei image_size,
const GLvoid *data, CARD32 rop )
{
__GLX_DECLARE_VARIABLES();
__GLX_LOAD_VARIABLES();
if ( gc->currentDpy == NULL ) {
return;
}
if ( target == GL_PROXY_TEXTURE_3D ) {
compsize = 0;
}
else {
compsize = image_size;
}
cmdlen = __GLX_PAD( __GLX_COMPRESSED_TEXSUBIMAGE_CMD_HDR_SIZE
+ compsize );
if ( cmdlen <= gc->maxSmallRenderCommandSize ) {
__GLX_BEGIN_VARIABLE( rop, cmdlen );
__GLX_PUT_LONG( 4, target );
__GLX_PUT_LONG( 8, level );
__GLX_PUT_LONG( 12, xoffset );
__GLX_PUT_LONG( 16, yoffset );
__GLX_PUT_LONG( 20, width );
__GLX_PUT_LONG( 24, height );
__GLX_PUT_LONG( 28, format );
__GLX_PUT_LONG( 32, image_size );
if ( compsize != 0 ) {
__GLX_PUT_CHAR_ARRAY( __GLX_COMPRESSED_TEXSUBIMAGE_CMD_HDR_SIZE,
data, image_size );
}
__GLX_END( cmdlen );
}
else {
assert( compsize != 0 );
__GLX_BEGIN_VARIABLE_LARGE( rop, cmdlen + 4 );
__GLX_PUT_LONG( 8, target );
__GLX_PUT_LONG( 12, level );
__GLX_PUT_LONG( 16, xoffset );
__GLX_PUT_LONG( 20, yoffset );
__GLX_PUT_LONG( 24, width );
__GLX_PUT_LONG( 28, height );
__GLX_PUT_LONG( 32, format );
__GLX_PUT_LONG( 36, image_size );
__glXSendLargeCommand( gc, gc->pc,
__GLX_COMPRESSED_TEXSUBIMAGE_CMD_HDR_SIZE + 4,
data, image_size );
}
}
void
__indirect_glCompressedTexImage1DARB( GLenum target, GLint level,
GLenum internal_format, GLsizei width,
GLint border, GLsizei image_size,
const GLvoid *data )
{
CompressedTexImage1D2D( target, level, internal_format, width, 0,
border, image_size, data,
X_GLrop_CompressedTexImage1D );
}
void
__indirect_glCompressedTexImage2DARB( GLenum target, GLint level,
GLenum internal_format,
GLsizei width, GLsizei height,
GLint border, GLsizei image_size,
const GLvoid *data )
{
CompressedTexImage1D2D( target, level, internal_format, width, height,
border, image_size, data,
X_GLrop_CompressedTexImage2D );
}
void
__indirect_glCompressedTexImage3DARB( GLenum target, GLint level,
GLenum internal_format,
GLsizei width, GLsizei height, GLsizei depth,
GLint border, GLsizei image_size,
const GLvoid *data )
{
__GLX_DECLARE_VARIABLES();
__GLX_LOAD_VARIABLES();
if ( gc->currentDpy == NULL ) {
return;
}
cmdlen = __GLX_PAD( __GLX_COMPRESSED_TEXIMAGE_3D_CMD_HDR_SIZE
+ image_size );
if ( cmdlen <= gc->maxSmallRenderCommandSize ) {
__GLX_BEGIN_VARIABLE( X_GLrop_CompressedTexImage3D, cmdlen );
__GLX_PUT_LONG( 4, target );
__GLX_PUT_LONG( 8, level );
__GLX_PUT_LONG( 12, internal_format );
__GLX_PUT_LONG( 16, width );
__GLX_PUT_LONG( 20, height );
__GLX_PUT_LONG( 24, depth );
__GLX_PUT_LONG( 28, border );
__GLX_PUT_LONG( 32, image_size );
if ( image_size != 0 ) {
__GLX_PUT_CHAR_ARRAY( __GLX_COMPRESSED_TEXIMAGE_3D_CMD_HDR_SIZE,
data, image_size );
}
__GLX_END( cmdlen );
}
else {
__GLX_BEGIN_VARIABLE_LARGE( X_GLrop_CompressedTexImage3D,
cmdlen + 4 );
__GLX_PUT_LONG( 8, target );
__GLX_PUT_LONG( 12, level );
__GLX_PUT_LONG( 16, internal_format );
__GLX_PUT_LONG( 20, width );
__GLX_PUT_LONG( 24, height );
__GLX_PUT_LONG( 28, depth );
__GLX_PUT_LONG( 32, border );
__GLX_PUT_LONG( 36, image_size );
__glXSendLargeCommand( gc, gc->pc,
__GLX_COMPRESSED_TEXIMAGE_3D_CMD_HDR_SIZE + 4,
data, image_size );
}
}
void
__indirect_glCompressedTexSubImage1DARB( GLenum target, GLint level,
GLint xoffset,
GLsizei width,
GLenum format, GLsizei image_size,
const GLvoid *data )
{
CompressedTexSubImage1D2D( target, level, xoffset, 0, width, 0,
format, image_size, data,
X_GLrop_CompressedTexSubImage1D );
}
void
__indirect_glCompressedTexSubImage2DARB( GLenum target, GLint level,
GLint xoffset, GLint yoffset,
GLsizei width, GLsizei height,
GLenum format, GLsizei image_size,
const GLvoid *data )
{
CompressedTexSubImage1D2D( target, level, xoffset, yoffset, width, height,
format, image_size, data,
X_GLrop_CompressedTexSubImage2D );
}
void
__indirect_glCompressedTexSubImage3DARB( GLenum target, GLint level,
GLint xoffset, GLint yoffset, GLint zoffset,
GLsizei width, GLsizei height, GLsizei depth,
GLenum format, GLsizei image_size,
const GLvoid *data )
{
__GLX_DECLARE_VARIABLES();
__GLX_LOAD_VARIABLES();
if ( gc->currentDpy == NULL ) {
return;
}
cmdlen = __GLX_PAD( __GLX_COMPRESSED_TEXSUBIMAGE_3D_CMD_HDR_SIZE
+ image_size );
if ( cmdlen <= gc->maxSmallRenderCommandSize ) {
__GLX_BEGIN_VARIABLE( X_GLrop_CompressedTexSubImage3D, cmdlen );
__GLX_PUT_LONG( 4, target );
__GLX_PUT_LONG( 8, level );
__GLX_PUT_LONG( 12, xoffset );
__GLX_PUT_LONG( 16, yoffset );
__GLX_PUT_LONG( 20, zoffset );
__GLX_PUT_LONG( 24, width );
__GLX_PUT_LONG( 28, height );
__GLX_PUT_LONG( 32, depth );
__GLX_PUT_LONG( 36, format );
__GLX_PUT_LONG( 40, image_size );
if ( image_size != 0 ) {
__GLX_PUT_CHAR_ARRAY( __GLX_COMPRESSED_TEXSUBIMAGE_3D_CMD_HDR_SIZE,
data, image_size );
}
__GLX_END( cmdlen );
}
else {
__GLX_BEGIN_VARIABLE_LARGE( X_GLrop_CompressedTexSubImage3D,
cmdlen + 4 );
__GLX_PUT_LONG( 8, target );
__GLX_PUT_LONG( 12, level );
__GLX_PUT_LONG( 16, xoffset );
__GLX_PUT_LONG( 20, yoffset );
__GLX_PUT_LONG( 24, zoffset );
__GLX_PUT_LONG( 28, width );
__GLX_PUT_LONG( 32, height );
__GLX_PUT_LONG( 36, depth );
__GLX_PUT_LONG( 40, format );
__GLX_PUT_LONG( 44, image_size );
__glXSendLargeCommand( gc, gc->pc,
__GLX_COMPRESSED_TEXSUBIMAGE_3D_CMD_HDR_SIZE + 4,
data, image_size );
}
}

View File

@@ -1,833 +0,0 @@
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
*/
/* $XFree86: xc/lib/GL/glx/glxclient.h,v 1.21 2004/02/09 23:46:31 alanh Exp $ */
/**
* \file glxclient.h
* Direct rendering support added by Precision Insight, Inc.
*
* \author Kevin E. Martin <kevin@precisioninsight.com>
*/
#ifndef _GLX_client_h_
#define _GLX_client_h_
#define NEED_REPLIES
#define NEED_EVENTS
#include <X11/Xproto.h>
#include <X11/Xlibint.h>
#define GLX_GLXEXT_PROTOTYPES
#include <GL/glx.h>
#include <GL/glxext.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#ifdef WIN32
#include <stdint.h>
#endif
#include "GL/glxint.h"
#include "GL/glxproto.h"
#include "GL/internal/glcore.h"
#include "glapitable.h"
#ifdef XTHREADS
#include "Xthreads.h"
#endif
#ifdef GLX_BUILT_IN_XMESA
#include "realglx.h" /* just silences prototype warnings */
#endif
#define GLX_MAJOR_VERSION 1 /* current version numbers */
#define GLX_MINOR_VERSION 4
#define __GLX_MAX_TEXTURE_UNITS 32
typedef struct __GLXcontextRec __GLXcontext;
typedef struct __GLXdisplayPrivateRec __GLXdisplayPrivate;
typedef struct _glapi_table __GLapi;
/************************************************************************/
#ifdef GLX_DIRECT_RENDERING
#include <GL/internal/dri_interface.h>
typedef void *(*CreateScreenFunc)(Display *dpy, int scrn, __DRIscreen *psc,
int numConfigs, __GLXvisualConfig *config);
typedef void *(*CreateNewScreenFunc)(Display *dpy, int scrn, __DRIscreen *psc,
const __GLcontextModes * modes, const __DRIversion * ddx_version,
const __DRIversion * dri_version, const __DRIversion * drm_version,
const __DRIframebuffer * frame_buffer, void * pSAREA,
int fd, int internal_api_version, __GLcontextModes ** driver_modes);
/**
* Display dependent methods. This structure is initialized during the
* \c driCreateDisplay call.
*/
struct __DRIdisplayRec {
/**
* Method to destroy the private DRI display data.
*/
void (*destroyDisplay)(Display *dpy, void *displayPrivate);
/**
* Methods to create the private DRI screen data and initialize the
* screen dependent methods.
* This is an array [indexed by screen number] of function pointers.
*
* \deprecated This array of function pointers has been replaced by
* \c __DRIdisplayRec::createNewScreen.
* \sa __DRIdisplayRec::createNewScreen
*/
CreateScreenFunc * createScreen;
/**
* Opaque pointer to private per display direct rendering data.
* \c NULL if direct rendering is not supported on this display.
*/
struct __DRIdisplayPrivateRec *private;
/**
* Array of pointers to methods to create and initialize the private DRI
* screen data.
*
* \sa __DRIdisplayRec::createScreen
*/
CreateNewScreenFunc * createNewScreen;
};
/*
** We keep a linked list of these structures, one per DRI device driver.
*/
struct __DRIdriverRec {
const char *name;
void *handle;
CreateScreenFunc createScreenFunc;
CreateNewScreenFunc createNewScreenFunc;
struct __DRIdriverRec *next;
};
/*
** Function to create and DRI display data and initialize the display
** dependent methods.
*/
extern void *driCreateDisplay(Display *dpy, __DRIdisplay *pdisp);
extern __DRIdriver *driGetDriver(Display *dpy, int scrNum);
extern void DRI_glXUseXFont( Font font, int first, int count, int listbase );
/*
** Functions to obtain driver configuration information from a direct
** rendering client application
*/
extern const char *glXGetScreenDriver (Display *dpy, int scrNum);
extern const char *glXGetDriverConfig (const char *driverName);
#endif
/************************************************************************/
#define __GL_CLIENT_ATTRIB_STACK_DEPTH 16
typedef struct __GLXpixelStoreModeRec {
GLboolean swapEndian;
GLboolean lsbFirst;
GLuint rowLength;
GLuint imageHeight;
GLuint imageDepth;
GLuint skipRows;
GLuint skipPixels;
GLuint skipImages;
GLuint alignment;
} __GLXpixelStoreMode;
/* The next 3 structures are deprecated. Client state is no longer tracked
* using them. They only remain to maintain the layout / structure offset of
* __GLXcontextRec. In XFree86 5.0 they will be removed altogether.
*/
typedef struct __GLXvertexArrayPointerStateRecDEPRECATED {
GLboolean enable;
void (*proc)(const void *);
const GLubyte *ptr;
GLsizei skip;
GLint size;
GLenum type;
GLsizei stride;
} __GLXvertexArrayPointerStateDEPRECATED;
typedef struct __GLXvertArrayStateRecDEPRECATED {
__GLXvertexArrayPointerStateDEPRECATED vertex;
__GLXvertexArrayPointerStateDEPRECATED normal;
__GLXvertexArrayPointerStateDEPRECATED color;
__GLXvertexArrayPointerStateDEPRECATED index;
__GLXvertexArrayPointerStateDEPRECATED texCoord[__GLX_MAX_TEXTURE_UNITS];
__GLXvertexArrayPointerStateDEPRECATED edgeFlag;
GLint maxElementsVertices;
GLint maxElementsIndices;
GLint activeTexture;
} __GLXvertArrayStateDEPRECATED;
typedef struct __GLXattributeRecDEPRECATED {
GLuint mask;
/*
** Pixel storage state. Most of the pixel store mode state is kept
** here and used by the client code to manage the packing and
** unpacking of data sent to/received from the server.
*/
__GLXpixelStoreMode storePack, storeUnpack;
/*
** Vertex Array storage state. The vertex array component
** state is stored here and is used to manage the packing of
** DrawArrays data sent to the server.
*/
__GLXvertArrayStateDEPRECATED vertArray;
} __GLXattributeDEPRECATED;
typedef struct __GLXvertexArrayPointerStateRec {
void (*proc)(const void *);
void (*mtex_proc)(GLenum, const void *);
const GLubyte *ptr;
GLsizei skip;
GLint size;
GLenum type;
GLsizei stride;
} __GLXvertexArrayPointerState;
/**
* Define which entries of \c __GLXvertArrayState::arrays match which
* vertex arrays in the client-state vector. These are only the one-of
* arrays. See the \c __GLXvertArrayState::arrays documentation for more
* details.
*
* \sa __GLXvertArrayState
*/
enum {
edgeFlag_ARRAY, /**< \c GL_EDGE_FLAG_ARRAY */
index_ARRAY, /**< \c GL_INDEX_ARRAY */
fogCoord_ARRAY, /**< \c GL_FOG_COORD_ARRAY */
secondaryColor_ARRAY, /**< \c GL_SECONDARY_COLOR_ARRAY */
color_ARRAY, /**< \c GL_COLOR_ARRAY */
normal_ARRAY, /**< \c GL_NORMAL_ARRAY */
/**
* \c GL_VERTEX_ARRAY \b must be last! All of the code for emitting arrays
* and array elements is written based on the assumption that the vertex
* array is last.
*/
vertex_ARRAY,
__GLX_MAX_ARRAYS /**< Place holder entry. */
};
#define ENABLE_ARRAY(state,a) \
do { (state)->vertArray.enables |= (1U << (a ## _ARRAY)); } while( 0 )
#define DISABLE_ARRAY(state,a) \
do { (state)->vertArray.enables &= ~(1U << (a ## _ARRAY)); } while( 0 )
#define IS_ARRAY_ENABLED_BY_INDEX(state, i) \
(((state)->vertArray.enables & (1U << (i))) != 0)
#define IS_ARRAY_ENABLED(state, a) \
IS_ARRAY_ENABLED_BY_INDEX(state, a ## _ARRAY)
#define ENABLE_TEXARRAY(state,a) \
do { (state)->vertArray.texture_enables |= (1U << a); } while( 0 )
#define DISABLE_TEXARRAY(state,a) \
do { (state)->vertArray.texture_enables &= ~(1U << a); } while( 0 )
#define IS_TEXARRAY_ENABLED(state, a) \
(((state)->vertArray.texture_enables & (1U << a)) != 0)
/**
* Client-side vertex array state.
*/
typedef struct __GLXvertArrayStateRec {
/**
* Which client-side arrays are enabled? These are the flag bits for
* all of the non-texture coordinate arrays.
*/
GLuint enables;
/**
* Which of the texture coordinate arrays are enabled?
*/
GLuint texture_enables;
/**
* State for "one-of" arrays. These are the arrays, such as
* GL_COLOR_ARRAY or GL_FOG_COORD_ARRAY for which there is only one
* array. There are also "many-of" arrays, such as
* GL_TEXTURE_COORD_ARRAY.
*/
__GLXvertexArrayPointerState arrays[__GLX_MAX_ARRAYS];
__GLXvertexArrayPointerState texCoord[__GLX_MAX_TEXTURE_UNITS];
GLint maxElementsVertices;
GLint maxElementsIndices;
GLint activeTexture;
} __GLXvertArrayState;
typedef struct __GLXattributeRec {
GLuint mask;
/*
** Pixel storage state. Most of the pixel store mode state is kept
** here and used by the client code to manage the packing and
** unpacking of data sent to/received from the server.
*/
__GLXpixelStoreMode storePack, storeUnpack;
/*
** Vertex Array storage state. The vertex array component
** state is stored here and is used to manage the packing of
** DrawArrays data sent to the server.
*/
__GLXvertArrayState vertArray;
/**
* Is EXT_vertex_array / GL 1.1 DrawArrays protocol specifically
* disabled?
*/
GLboolean NoDrawArraysProtocol;
} __GLXattribute;
typedef struct __GLXattributeMachineRec {
__GLXattribute *stack[__GL_CLIENT_ATTRIB_STACK_DEPTH];
__GLXattribute **stackPointer;
} __GLXattributeMachine;
/**
* GLX state that needs to be kept on the client. One of these records
* exist for each context that has been made current by this client.
*/
struct __GLXcontextRec {
/**
* \name Drawing command buffer.
*
* Drawing commands are packed into this buffer before being sent as a
* single GLX protocol request. The buffer is sent when it overflows or
* is flushed by \c __glXFlushRenderBuffer. \c pc is the next location
* in the buffer to be filled. \c limit is described above in the buffer
* slop discussion.
*
* Commands that require large amounts of data to be transfered will
* also use this buffer to hold a header that describes the large
* command.
*
* These must be the first 6 fields since they are static initialized
* in the dummy context in glxext.c
*/
/*@{*/
GLubyte *buf;
GLubyte *pc;
GLubyte *limit;
GLubyte *bufEnd;
GLint bufSize;
/*@}*/
/**
* The XID of this rendering context. When the context is created a
* new XID is allocated. This is set to None when the context is
* destroyed but is still current to some thread. In this case the
* context will be freed on next MakeCurrent.
*/
XID xid;
/**
* The XID of the \c shareList context.
*/
XID share_xid;
/**
* Visual id.
*
* \deprecated
* This filed has been largely been replaced by the \c mode field, but
* the work is not quite done.
*/
VisualID vid;
/**
* Screen number.
*/
GLint screen;
/**
* \c GL_TRUE if the context was created with ImportContext, which
* means the server-side context was created by another X client.
*/
GLboolean imported;
/**
* The context tag returned by MakeCurrent when this context is made
* current. This tag is used to identify the context that a thread has
* current so that proper server context management can be done. It is
* used for all context specific commands (i.e., \c Render, \c RenderLarge,
* \c WaitX, \c WaitGL, \c UseXFont, and \c MakeCurrent (for the old
* context)).
*/
GLXContextTag currentContextTag;
/**
* \name Rendering mode
*
* The rendering mode is kept on the client as well as the server.
* When \c glRenderMode is called, the buffer associated with the
* previous rendering mode (feedback or select) is filled.
*/
/*@{*/
GLenum renderMode;
GLfloat *feedbackBuf;
GLuint *selectBuf;
/*@}*/
/**
* This is \c GL_TRUE if the pixel unpack modes are such that an image
* can be unpacked from the clients memory by just copying. It may
* still be true that the server will have to do some work. This
* just promises that a straight copy will fetch the correct bytes.
*/
GLboolean fastImageUnpack;
/**
* Fill newImage with the unpacked form of \c oldImage getting it
* ready for transport to the server.
*/
void (*fillImage)(__GLXcontext*, GLint, GLint, GLint, GLint, GLenum,
GLenum, const GLvoid*, GLubyte*, GLubyte*);
/**
* \name Client side attribs.
*/
/*@{*/
__GLXattributeDEPRECATED stateDEPRECATED;
__GLXattributeMachine attributes;
/*@}*/
/**
* Client side error code. This is set when client side gl API
* routines need to set an error because of a bad enumerant or
* running out of memory, etc.
*/
GLenum error;
/**
* Whether this context does direct rendering.
*/
Bool isDirect;
/**
* \c dpy of current display for this context. Will be \c NULL if not
* current to any display, or if this is the "dummy context".
*/
Display *currentDpy;
/**
* The current drawable for this context. Will be None if this
* context is not current to any drawable. currentReadable is below.
*/
GLXDrawable currentDrawable;
/**
* \name GL Constant Strings
*
* Constant strings that describe the server implementation
* These pertain to GL attributes, not to be confused with
* GLX versioning attributes.
*/
/*@{*/
GLubyte *vendor;
GLubyte *renderer;
GLubyte *version;
GLubyte *extensions;
/*@}*/
/**
* Record the dpy this context was created on for later freeing
*/
Display *createDpy;
/**
* Maximum small render command size. This is the smaller of 64k and
* the size of the above buffer.
*/
GLint maxSmallRenderCommandSize;
/**
* Major opcode for the extension. Copied here so a lookup isn't
* needed.
*/
GLint majorOpcode;
#ifdef GLX_DIRECT_RENDERING
/**
* Per context direct rendering interface functions and data.
*/
__DRIcontext driContext;
#endif
/**
* \c GLXFBConfigID used to create this context. May be \c None. This
* field has been replaced by the \c mode field.
*
* \since Internal API version 20030317.
*
* \deprecated
* This filed has been largely been replaced by the \c mode field, but
* the work is not quite done.
*/
GLXFBConfigID fbconfigID;
/**
* The current read-drawable for this context. Will be None if this
* context is not current to any drawable.
*
* \since Internal API version 20030606.
*/
GLXDrawable currentReadable;
/**
* Pointer to client-state data that is private to libGL. This is only
* used for indirect rendering contexts.
*
* No internal API version change was made for this change. Client-side
* drivers should NEVER use this data or even care that it exists.
*/
void * client_state_private;
/**
* Stored value for \c glXQueryContext attribute \c GLX_RENDER_TYPE.
*/
int renderType;
/**
* \name Raw server GL version
*
* True core GL version supported by the server. This is the raw value
* returned by the server, and it may not reflect what is actually
* supported (or reported) by the client-side library.
*/
/*@{*/
int server_major; /**< Major version number. */
int server_minor; /**< Minor version number. */
/*@}*/
};
#define __glXSetError(gc,code) \
if (!(gc)->error) { \
(gc)->error = code; \
}
extern void __glFreeAttributeState(__GLXcontext *);
/************************************************************************/
/**
* The size of the largest drawing command known to the implementation
* that will use the GLXRender GLX command. In this case it is
* \c glPolygonStipple.
*/
#define __GLX_MAX_SMALL_RENDER_CMD_SIZE 156
/**
* To keep the implementation fast, the code uses a "limit" pointer
* to determine when the drawing command buffer is too full to hold
* another fixed size command. This constant defines the amount of
* space that must always be available in the drawing command buffer
* at all times for the implementation to work. It is important that
* the number be just large enough, but not so large as to reduce the
* efficacy of the buffer. The "+32" is just to keep the code working
* in case somebody counts wrong.
*/
#define __GLX_BUFFER_LIMIT_SIZE (__GLX_MAX_SMALL_RENDER_CMD_SIZE + 32)
/**
* This implementation uses a smaller threshold for switching
* to the RenderLarge protocol than the protcol requires so that
* large copies don't occur.
*/
#define __GLX_RENDER_CMD_SIZE_LIMIT 4096
/**
* One of these records exists per screen of the display. It contains
* a pointer to the config data for that screen (if the screen supports GL).
*/
typedef struct __GLXscreenConfigsRec {
/**
* GLX visuals formated as \c __GLXvisualConfig structures.
*/
/*@{*/
__GLXvisualConfig * old_configs;
int numOldConfigs;
/*@}*/
/**
* GLX extension string reported by the X-server.
*/
const char *serverGLXexts;
/**
* GLX extension string to be reported to applications. This is the
* set of extensions that the application can actually use.
*/
char *effectiveGLXexts;
#ifdef GLX_DIRECT_RENDERING
/**
* Per screen direct rendering interface functions and data.
*/
__DRIscreen driScreen;
#endif
/**
* Linked list of configurations for this screen. This is intended to
* be a superset of \c old_configs.
*/
__GLcontextModes *configs;
/**
* Per-screen dynamic GLX extension tracking. The \c direct_support
* field only contains enough bits for 64 extensions. Should libGL
* ever need to track more than 64 GLX extensions, we can safely grow
* this field. The \c __GLXscreenConfigs structure is not used outside
* libGL.
*/
/*@{*/
unsigned char direct_support[8];
GLboolean ext_list_first_time;
/*@}*/
} __GLXscreenConfigs;
/**
* Per display private data. One of these records exists for each display
* that is using the OpenGL (GLX) extension.
*/
struct __GLXdisplayPrivateRec {
/**
* Back pointer to the display
*/
Display *dpy;
/**
* The \c majorOpcode is common to all connections to the same server.
* It is also copied into the context structure.
*/
int majorOpcode;
/**
* \name Server Version
*
* Major and minor version returned by the server during initialization.
*/
/*@{*/
int majorVersion, minorVersion;
/*@}*/
/**
* \name Storage for the servers GLX vendor and versions strings.
*
* These are the same for all screens on this display. These fields will
* be filled in on demand.
*/
/*@{*/
const char *serverGLXvendor;
const char *serverGLXversion;
/*@}*/
/**
* Configurations of visuals for all screens on this display.
* Also, per screen data which now includes the server \c GLX_EXTENSION
* string.
*/
__GLXscreenConfigs *screenConfigs;
#ifdef GLX_DIRECT_RENDERING
/**
* Per display direct rendering interface functions and data.
*/
__DRIdisplay driDisplay;
#endif
};
void __glXFreeContext(__GLXcontext*);
extern GLubyte *__glXFlushRenderBuffer(__GLXcontext*, GLubyte*);
extern void __glXSendLargeChunk(__GLXcontext *gc, GLint requestNumber,
GLint totalRequests,
const GLvoid * data, GLint dataLen);
extern void __glXSendLargeCommand(__GLXcontext *, const GLvoid *, GLint,
const GLvoid *, GLint);
/* Initialize the GLX extension for dpy */
extern __GLXdisplayPrivate *__glXInitialize(Display*);
/************************************************************************/
extern int __glXDebug;
/* This is per-thread storage in an MT environment */
#if defined(GLX_DIRECT_RENDERING) && defined(XTHREADS)
extern __GLXcontext *__glXGetCurrentContext(void);
extern void __glXSetCurrentContext(__GLXcontext *c);
#else
extern __GLXcontext *__glXcurrentContext;
#define __glXGetCurrentContext() __glXcurrentContext
#define __glXSetCurrentContext(gc) __glXcurrentContext = gc
#endif
/*
** Global lock for all threads in this address space using the GLX
** extension
*/
#if defined(GLX_DIRECT_RENDERING) && defined(XTHREADS)
extern xmutex_rec __glXmutex;
#define __glXLock() xmutex_lock(&__glXmutex)
#define __glXUnlock() xmutex_unlock(&__glXmutex)
#else
#define __glXLock()
#define __glXUnlock()
#endif
/*
** Setup for a command. Initialize the extension for dpy if necessary.
*/
extern CARD8 __glXSetupForCommand(Display *dpy);
/************************************************************************/
/*
** Data conversion and packing support.
*/
/* Return the size, in bytes, of some pixel data */
extern GLint __glImageSize(GLint, GLint, GLint, GLenum, GLenum);
/* Return the number of elements per group of a specified format*/
extern GLint __glElementsPerGroup(GLenum format, GLenum type);
/* Return the number of bytes per element, based on the element type (other
** than GL_BITMAP).
*/
extern GLint __glBytesPerElement(GLenum type);
/* Return the k value for a given map target */
extern GLint __glEvalComputeK(GLenum);
/*
** Fill the transport buffer with the data from the users buffer,
** applying some of the pixel store modes (unpack modes) to the data
** first. As a side effect of this call, the "modes" field is
** updated to contain the modes needed by the server to decode the
** sent data.
*/
extern void __glFillImage(__GLXcontext*, GLint, GLint, GLint, GLint, GLenum,
GLenum, const GLvoid*, GLubyte*, GLubyte*);
/* Copy map data with a stride into a packed buffer */
extern void __glFillMap1f(GLint, GLint, GLint, const GLfloat *, GLubyte *);
extern void __glFillMap1d(GLint, GLint, GLint, const GLdouble *, GLubyte *);
extern void __glFillMap2f(GLint, GLint, GLint, GLint, GLint,
const GLfloat *, GLfloat *);
extern void __glFillMap2d(GLint, GLint, GLint, GLint, GLint,
const GLdouble *, GLdouble *);
/*
** Empty an image out of the reply buffer into the clients memory applying
** the pack modes to pack back into the clients requested format.
*/
extern void __glEmptyImage(__GLXcontext*, GLint, GLint, GLint, GLint, GLenum,
GLenum, const GLubyte *, GLvoid *);
/*
** Allocate and Initialize Vertex Array client state
*/
extern void __glXInitVertexArrayState(__GLXcontext*);
/*
** Inform the Server of the major and minor numbers and of the client
** libraries extension string.
*/
extern void __glXClientInfo ( Display *dpy, int opcode );
/************************************************************************/
/*
** Declarations that should be in Xlib
*/
#ifdef __GL_USE_OUR_PROTOTYPES
extern void _XFlush(Display*);
extern Status _XReply(Display*, xReply*, int, Bool);
extern void _XRead(Display*, void*, long);
extern void _XSend(Display*, const void*, long);
#endif
/*
** GLX_BUILT_IN_XMESA controls whether libGL has a built-in verions of
** Mesa that can render to non-GLX displays.
*/
#ifdef GLX_BUILT_IN_XMESA
#define GLX_PREFIX(function) _real_##function
#else
#define GLX_PREFIX(function) function
#endif
extern void __glXInitializeVisualConfigFromTags( __GLcontextModes *config,
int count, const INT32 *bp, Bool tagged_only, Bool fbconfig_style_tags );
extern char * __glXGetStringFromServer( Display * dpy, int opcode,
CARD32 glxCode, CARD32 for_whom, CARD32 name );
extern char *__glXstrdup(const char *str);
extern const char __glXGLClientVersion[];
extern const char __glXGLClientExtensions[];
/* Determine the internal API version */
extern int __glXGetInternalVersion(void);
/* Get the unadjusted system time */
extern int __glXGetUST( int64_t * ust );
#endif /* !__GLX_client_h__ */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,706 +0,0 @@
/*
* (C) Copyright IBM Corporation 2002, 2004
* 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
* THE COPYRIGHT HOLDERS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
* USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/**
* \file glxextensions.c
*
* \author Ian Romanick <idr@us.ibm.com>
*/
/* $XFree86: xc/lib/GL/glx/glxextensions.c,v 1.1 2003/09/28 20:15:03 alanh Exp $ */
#include "glxclient.h"
#include <extutil.h>
#include <Xext.h>
#include <string.h>
#include "glapi.h"
#include "glxextensions.h"
#include "simple_list.h"
#define SET_BIT(m,b) (m[ (b) / 8 ] |= (1U << ((b) % 8)))
#define CLR_BIT(m,b) (m[ (b) / 8 ] &= ~(1U << ((b) % 8)))
#define IS_SET(m,b) ((m[ (b) / 8 ] & (1U << ((b) % 8))) != 0)
#define CONCAT(a,b) a ## b
#define GLX(n) "GLX_" # n, 4 + sizeof( # n ) - 1, CONCAT(n,_bit)
#define GL(n) "GL_" # n, 3 + sizeof( # n ) - 1, GL_ ## n ## _bit
#define VER(a,b) a, b
#define Y 1
#define N 0
#define EXT_ENABLED(bit,supported) (IS_SET( supported, bit ))
struct extension_info {
const char * const name;
unsigned name_len;
unsigned char bit;
/* This is the lowest version of GLX that "requires" this extension.
* For example, GLX 1.3 requires SGIX_fbconfig, SGIX_pbuffer, and
* SGI_make_current_read. If the extension is not required by any known
* version of GLX, use 0, 0.
*/
unsigned char version_major;
unsigned char version_minor;
unsigned char client_support;
unsigned char direct_support;
unsigned char client_only; /** Is the extension client-side only? */
unsigned char direct_only; /** Is the extension for direct
* contexts only?
*/
};
static const struct extension_info known_glx_extensions[] = {
{ GLX(ARB_get_proc_address), VER(1,4), Y, N, Y, N },
{ GLX(ARB_multisample), VER(1,4), Y, Y, N, N },
{ GLX(ARB_render_texture), VER(0,0), N, N, N, N },
{ GLX(ATI_pixel_format_float), VER(0,0), N, N, N, N },
{ GLX(EXT_import_context), VER(0,0), Y, Y, N, N },
{ GLX(EXT_visual_info), VER(0,0), Y, Y, N, N },
{ GLX(EXT_visual_rating), VER(0,0), Y, Y, N, N },
{ GLX(MESA_agp_offset), VER(0,0), N, N, N, Y }, /* Deprecated */
{ GLX(MESA_allocate_memory), VER(0,0), Y, N, N, Y },
{ GLX(MESA_copy_sub_buffer), VER(0,0), N, N, N, N }, /* Deprecated? */
{ GLX(MESA_pixmap_colormap), VER(0,0), N, N, N, N }, /* Deprecated */
{ GLX(MESA_release_buffers), VER(0,0), N, N, N, N }, /* Deprecated */
{ GLX(MESA_set_3dfx_mode), VER(0,0), N, N, N, N }, /* Deprecated */
{ GLX(MESA_swap_control), VER(0,0), Y, N, N, Y },
{ GLX(MESA_swap_frame_usage), VER(0,0), Y, N, N, Y },
{ GLX(NV_float_buffer), VER(0,0), N, N, N, N },
{ GLX(NV_render_depth_texture), VER(0,0), N, N, N, N },
{ GLX(NV_render_texture_rectangle), VER(0,0), N, N, N, N },
{ GLX(NV_vertex_array_range), VER(0,0), N, N, N, Y }, /* Deprecated */
{ GLX(OML_swap_method), VER(0,0), Y, N, N, N },
{ GLX(OML_sync_control), VER(0,0), Y, N, N, Y },
{ GLX(SGI_cushion), VER(0,0), N, N, N, N },
{ GLX(SGI_make_current_read), VER(1,3), Y, N, N, N },
{ GLX(SGI_swap_control), VER(0,0), Y, N, N, N },
{ GLX(SGI_video_sync), VER(0,0), Y, N, N, Y },
{ GLX(SGIS_blended_overlay), VER(0,0), N, N, N, N },
{ GLX(SGIS_color_range), VER(0,0), N, N, N, N },
{ GLX(SGIS_multisample), VER(0,0), Y, Y, N, N },
{ GLX(SGIX_dm_buffer), VER(0,0), N, N, N, N },
{ GLX(SGIX_fbconfig), VER(1,3), Y, N, N, N },
{ GLX(SGIX_pbuffer), VER(1,3), Y, N, N, N },
{ GLX(SGIX_swap_barrier), VER(0,0), N, N, N, N },
{ GLX(SGIX_swap_group), VER(0,0), N, N, N, N },
{ GLX(SGIX_video_resize), VER(0,0), N, N, N, N },
{ GLX(SGIX_video_source), VER(0,0), N, N, N, N },
{ GLX(SGIX_visual_select_group), VER(0,0), Y, Y, N, N },
{ GLX(SUN_get_transparent_index), VER(0,0), N, N, N, N },
{ NULL }
};
static const struct extension_info known_gl_extensions[] = {
{ GL(ARB_depth_texture), VER(1,4), Y, N, N, N },
{ GL(ARB_fragment_program), VER(0,0), N, N, N, N },
{ GL(ARB_imaging), VER(0,0), Y, N, N, N },
{ GL(ARB_multisample), VER(1,3), Y, N, N, N },
{ GL(ARB_multitexture), VER(1,3), Y, N, N, N },
{ GL(ARB_occlusion_query), VER(1,5), N, N, N, N },
{ GL(ARB_point_parameters), VER(1,4), Y, N, N, N },
{ GL(ARB_point_sprite), VER(0,0), Y, N, N, N },
{ GL(ARB_shadow), VER(1,4), Y, N, N, N },
{ GL(ARB_shadow_ambient), VER(0,0), Y, N, N, N },
{ GL(ARB_texture_border_clamp), VER(1,3), Y, N, N, N },
{ GL(ARB_texture_compression), VER(1,3), N, N, N, N },
{ GL(ARB_texture_cube_map), VER(1,3), Y, N, N, N },
{ GL(ARB_texture_env_add), VER(1,3), Y, N, N, N },
{ GL(ARB_texture_env_combine), VER(1,3), Y, N, N, N },
{ GL(ARB_texture_env_crossbar), VER(1,4), Y, N, N, N },
{ GL(ARB_texture_env_dot3), VER(1,3), Y, N, N, N },
{ GL(ARB_texture_mirrored_repeat), VER(1,4), Y, N, N, N },
{ GL(ARB_texture_non_power_of_two), VER(1,5), Y, N, N, N },
{ GL(ARB_texture_rectangle), VER(0,0), Y, N, N, N },
{ GL(ARB_transpose_matrix), VER(1,3), Y, N, Y, N },
{ GL(ARB_vertex_buffer_object), VER(1,5), N, N, N, N },
{ GL(ARB_window_pos), VER(1,4), Y, N, N, N },
{ GL(EXT_abgr), VER(0,0), Y, N, N, N },
{ GL(EXT_bgra), VER(1,2), Y, N, N, N },
{ GL(EXT_blend_color), VER(1,4), Y, N, N, N },
{ GL(EXT_blend_equation_separate), VER(0,0), N, N, N, N },
{ GL(EXT_blend_func_separate), VER(1,4), Y, N, N, N },
{ GL(EXT_blend_logic_op), VER(1,4), Y, N, N, N },
{ GL(EXT_blend_minmax), VER(1,4), Y, N, N, N },
{ GL(EXT_blend_subtract), VER(1,4), Y, N, N, N },
{ GL(EXT_clip_volume_hint), VER(0,0), Y, N, N, N },
{ GL(EXT_compiled_vertex_array), VER(0,0), N, N, N, N },
{ GL(EXT_convolution), VER(0,0), N, N, N, N },
{ GL(EXT_copy_texture), VER(1,1), Y, N, N, N },
{ GL(EXT_cull_vertex), VER(0,0), N, N, N, N },
{ GL(EXT_depth_bounds_test), VER(0,0), N, N, N, N },
{ GL(EXT_draw_range_elements), VER(1,2), Y, N, Y, N },
{ GL(EXT_fog_coord), VER(1,4), Y, N, N, N },
{ GL(EXT_multi_draw_arrays), VER(1,4), Y, N, Y, N },
{ GL(EXT_packed_pixels), VER(1,2), Y, N, N, N },
{ GL(EXT_paletted_texture), VER(0,0), Y, N, N, N },
{ GL(EXT_pixel_buffer_object), VER(0,0), N, N, N, N },
{ GL(EXT_point_parameters), VER(1,4), Y, N, N, N },
{ GL(EXT_polygon_offset), VER(1,1), Y, N, N, N },
{ GL(EXT_rescale_normal), VER(1,2), Y, N, N, N },
{ GL(EXT_secondary_color), VER(1,4), Y, N, N, N },
{ GL(EXT_separate_specular_color), VER(1,2), Y, N, N, N },
{ GL(EXT_shadow_funcs), VER(1,5), Y, N, N, N },
{ GL(EXT_shared_texture_palette), VER(0,0), Y, N, N, N },
{ GL(EXT_stencil_two_side), VER(0,0), Y, N, N, N },
{ GL(EXT_stencil_wrap), VER(1,4), Y, N, N, N },
{ GL(EXT_subtexture), VER(1,1), Y, N, N, N },
{ GL(EXT_texture), VER(1,1), Y, N, N, N },
{ GL(EXT_texture3D), VER(1,2), Y, N, N, N },
{ GL(EXT_texture_compression_s3tc), VER(0,0), N, N, N, N },
{ GL(EXT_texture_edge_clamp), VER(1,2), Y, N, N, N },
{ GL(EXT_texture_env_add), VER(1,3), Y, N, N, N },
{ GL(EXT_texture_env_combine), VER(1,3), Y, N, N, N },
{ GL(EXT_texture_env_dot3), VER(0,0), Y, N, N, N },
{ GL(EXT_texture_filter_anisotropic), VER(0,0), Y, N, N, N },
{ GL(EXT_texture_lod), VER(1,2), Y, N, N, N },
{ GL(EXT_texture_lod_bias), VER(1,4), Y, N, N, N },
{ GL(EXT_texture_mirror_clamp), VER(0,0), Y, N, N, N },
{ GL(EXT_texture_object), VER(1,1), Y, N, N, N },
{ GL(EXT_texture_rectangle), VER(0,0), Y, N, N, N },
{ GL(EXT_vertex_array), VER(0,0), Y, N, N, N },
{ GL(3DFX_texture_compression_FXT1), VER(0,0), N, N, N, N },
{ GL(APPLE_packed_pixels), VER(1,2), Y, N, N, N },
{ GL(APPLE_ycbcr_422), VER(0,0), Y, N, N, N },
{ GL(ATI_texture_env_combine3), VER(0,0), Y, N, N, N },
{ GL(ATI_texture_float), VER(0,0), Y, N, N, N },
{ GL(ATI_texture_mirror_once), VER(0,0), Y, N, N, N },
{ GL(ATIX_texture_env_combine3), VER(0,0), Y, N, N, N },
{ GL(HP_convolution_border_modes), VER(0,0), Y, N, N, N },
{ GL(HP_occlusion_test), VER(0,0), Y, N, N, N },
{ GL(IBM_cull_vertex), VER(0,0), Y, N, N, N },
{ GL(IBM_pixel_filter_hint), VER(0,0), Y, N, N, N },
{ GL(IBM_rasterpos_clip), VER(0,0), Y, N, N, N },
{ GL(IBM_texture_clamp_nodraw), VER(0,0), Y, N, N, N },
{ GL(IBM_texture_mirrored_repeat), VER(0,0), Y, N, N, N },
{ GL(INGR_blend_func_separate), VER(0,0), Y, N, N, N },
{ GL(INGR_interlace_read), VER(0,0), Y, N, N, N },
{ GL(MESA_pack_invert), VER(0,0), Y, N, N, N },
{ GL(MESA_ycbcr_texture), VER(0,0), Y, N, N, N },
{ GL(NV_blend_square), VER(1,4), Y, N, N, N },
{ GL(NV_copy_depth_to_color), VER(0,0), Y, N, N, N },
{ GL(NV_depth_clamp), VER(0,0), Y, N, N, N },
{ GL(NV_fog_distance), VER(0,0), Y, N, N, N },
{ GL(NV_light_max_exponent), VER(0,0), Y, N, N, N },
{ GL(NV_multisample_filter_hint), VER(0,0), Y, N, N, N },
{ GL(NV_point_sprite), VER(0,0), Y, N, N, N },
{ GL(NV_texgen_reflection), VER(0,0), Y, N, N, N },
{ GL(NV_texture_compression_vtc), VER(0,0), N, N, N, N },
{ GL(NV_texture_env_combine4), VER(0,0), Y, N, N, N },
{ GL(NV_texture_rectangle), VER(0,0), Y, N, N, N },
{ GL(OES_read_format), VER(0,0), Y, N, N, N },
{ GL(SGIS_generate_mipmap), VER(1,4), Y, N, N, N },
{ GL(SGIS_multisample), VER(0,0), Y, N, N, N },
{ GL(SGIS_texture_border_clamp), VER(1,3), Y, N, N, N },
{ GL(SGIS_texture_edge_clamp), VER(1,2), Y, N, N, N },
{ GL(SGIS_texture_lod), VER(1,2), Y, N, N, N },
{ GL(SGIX_blend_alpha_minmax), VER(0,0), Y, N, N, N },
{ GL(SGIX_clipmap), VER(0,0), Y, N, N, N },
{ GL(SGIX_depth_texture), VER(0,0), Y, N, N, N },
{ GL(SGIX_fog_offset), VER(0,0), Y, N, N, N },
{ GL(SGIX_shadow), VER(0,0), Y, N, N, N },
{ GL(SGIX_shadow_ambient), VER(0,0), Y, N, N, N },
{ GL(SGIX_texture_coordinate_clamp), VER(0,0), Y, N, N, N },
{ GL(SGIX_texture_lod_bias), VER(0,0), Y, N, N, N },
{ GL(SGIX_texture_range), VER(0,0), Y, N, N, N },
{ GL(SGIX_texture_scale_bias), VER(0,0), Y, N, N, N },
{ GL(SGIX_vertex_preclip), VER(0,0), Y, N, N, N },
{ GL(SGIX_vertex_preclip_hint), VER(0,0), Y, N, N, N },
{ GL(SGIX_ycrcb), VER(0,0), Y, N, N, N },
{ GL(SUN_convolution_border_modes), VER(0,0), Y, N, N, N },
{ GL(SUN_multi_draw_arrays), VER(0,0), Y, N, Y, N },
{ GL(SUN_slice_accum), VER(0,0), Y, N, N, N },
{ NULL }
};
#define __GL_EXT_BYTES ((__NUM_GL_EXTS + 7) / 8)
/* global bit-fields of available extensions and their characteristics */
static unsigned char client_glx_support[8];
static unsigned char client_glx_only[8];
static unsigned char direct_glx_only[8];
static unsigned char client_gl_support[ __GL_EXT_BYTES ];
static unsigned char client_gl_only[ __GL_EXT_BYTES ];
/**
* Bits representing the set of extensions that are enabled by default in all
* direct rendering drivers.
*/
static unsigned char direct_glx_support[8];
/**
* Highest core GL version that can be supported for indirect rendering.
*/
static unsigned gl_major = 0;
static unsigned gl_minor = 0;
/* client extensions string */
static const char * __glXGLXClientExtensions = NULL;
static void __glXExtensionsCtr( void );
static void __glXExtensionsCtrScreen( __GLXscreenConfigs *psc );
static void __glXProcessServerString( const struct extension_info * ext,
const char * server_string, unsigned char * server_support );
/**
* Set the state of a GLX extension.
*
* \param name Name of the extension.
* \param name_len Length, in characters, of the extension name.
* \param state New state (either enabled or disabled) of the extension.
* \param supported Table in which the state of the extension is to be set.
*/
static void
set_glx_extension( const struct extension_info * ext,
const char * name, unsigned name_len, GLboolean state,
unsigned char * supported )
{
unsigned i;
for ( i = 0 ; ext[i].name != NULL ; i++ ) {
if ( (name_len == ext[i].name_len)
&& (strncmp( ext[i].name, name, name_len ) == 0) ) {
if ( state ) {
SET_BIT( supported, ext[i].bit );
}
else {
CLR_BIT( supported, ext[i].bit );
}
return;
}
}
}
#define NUL '\0'
#define SEPARATOR ' '
/**
* Convert the server's extension string to a bit-field.
*
* \param server_string GLX extension string from the server.
* \param server_support Bit-field of supported extensions.
*/
static void
__glXProcessServerString( const struct extension_info * ext,
const char * server_string,
unsigned char * server_support )
{
unsigned base;
unsigned len;
(void) memset( server_support, 0, sizeof( server_support ) );
for ( base = 0 ; server_string[ base ] != NUL ; /* empty */ ) {
/* Determine the length of the next extension name.
*/
for ( len = 0
; (server_string[ base + len ] != SEPARATOR)
&& (server_string[ base + len ] != NUL)
; len++ ) {
/* empty */
}
/* Set the bit for the extension in the server_support table.
*/
set_glx_extension( ext, & server_string[ base ], len, GL_TRUE,
server_support );
/* Advance to the next extension string. This means that we skip
* over the previous string and any trialing white-space.
*/
for ( base += len ;
(server_string[ base ] == SEPARATOR)
&& (server_string[ base ] != NUL)
; base++ ) {
/* empty */
}
}
}
/**
* Enable a named GLX extension on a given screen.
* Drivers should not call this function directly. They should instead use
* \c glXGetProcAddress to obtain a pointer to the function.
*
* \param psc Pointer to GLX per-screen record.
* \param name Name of the extension to enable.
*
* \sa glXGetProcAddress
*
* \since Internal API version 20030813.
*/
void
__glXScrEnableExtension( __GLXscreenConfigs *psc, const char * name )
{
__glXExtensionsCtr();
__glXExtensionsCtrScreen(psc);
set_glx_extension( known_glx_extensions, name, strlen( name ), GL_TRUE,
psc->direct_support );
}
/**
* Initialize global extension support tables.
*/
static void
__glXExtensionsCtr( void )
{
static const char major_table[32] = { 1, 1, 1, 1, 1, 1, 2, };
static const char minor_table[32] = { 0, 1, 2, 3, 4, 5, 0, };
unsigned i;
static GLboolean ext_list_first_time = GL_TRUE;
unsigned full_support = ~0;
if ( ext_list_first_time ) {
ext_list_first_time = GL_FALSE;
(void) memset( client_glx_support, 0, sizeof( client_glx_support ) );
(void) memset( direct_glx_support, 0, sizeof( direct_glx_support ) );
(void) memset( client_glx_only, 0, sizeof( client_glx_only ) );
(void) memset( direct_glx_only, 0, sizeof( direct_glx_only ) );
(void) memset( client_gl_support, 0, sizeof( client_gl_support ) );
(void) memset( client_gl_only, 0, sizeof( client_gl_only ) );
for ( i = 0 ; known_glx_extensions[i].name != NULL ; i++ ) {
const unsigned bit = known_glx_extensions[i].bit;
if ( known_glx_extensions[i].client_support ) {
SET_BIT( client_glx_support, bit );
}
if ( known_glx_extensions[i].direct_support ) {
SET_BIT( direct_glx_support, bit );
}
if ( known_glx_extensions[i].client_only ) {
SET_BIT( client_glx_only, bit );
}
if ( known_glx_extensions[i].direct_only ) {
SET_BIT( direct_glx_only, bit );
}
}
for ( i = 0 ; known_gl_extensions[i].name != NULL ; i++ ) {
const unsigned bit = known_gl_extensions[i].bit;
if ( known_gl_extensions[i].client_support ) {
SET_BIT( client_gl_support, bit );
}
else if ( known_gl_extensions[i].version_major != 0 ) {
/* If an extension that is required for some core GL version is
* not supported, clear the bit for that core GL version as well.
*/
unsigned ver_bit = (6 * (known_gl_extensions[i].version_major - 1))
+ (known_gl_extensions[i].version_minor);
full_support &= ~(1U << ver_bit);
}
if ( known_gl_extensions[i].client_only ) {
SET_BIT( client_gl_only, bit );
}
}
/* Determine the lowest unsupported core GL version. The version before
* that is, therefore, the highest supported core GL version.
*/
for ( i = 0 ; (full_support & (1 << i)) != 0 ; i++ )
/* empty */ ;
i--;
gl_major = major_table[i];
gl_minor = minor_table[i];
#if 0
fprintf( stderr, "[%s:%u] Maximum client library version: %u.%u\n",
__func__, __LINE__, gl_major, gl_minor );
#endif
}
}
/**
* Make sure that per-screen direct-support table is initialized.
*
* \param psc Pointer to GLX per-screen record.
*/
static void
__glXExtensionsCtrScreen( __GLXscreenConfigs *psc )
{
if (psc->ext_list_first_time) {
psc->ext_list_first_time = GL_FALSE;
(void) memcpy( psc->direct_support, direct_glx_support,
sizeof( direct_glx_support ) );
}
}
/**
* Check if a certain extension is enabled on a given screen.
*
* \param psc Pointer to GLX per-screen record.
* \param bit Bit index in the direct-support table.
* \returns If the extension bit is enabled for the screen, \c GL_TRUE is
* returned. If the extension bit is not enabled or if \c psc is
* \c NULL, then \c GL_FALSE is returned.
*/
GLboolean
__glXExtensionBitIsEnabled( __GLXscreenConfigs *psc, unsigned bit )
{
GLboolean enabled = GL_FALSE;
if ( psc != NULL ) {
__glXExtensionsCtr();
__glXExtensionsCtrScreen( psc );
enabled = EXT_ENABLED( bit, psc->direct_support );
}
return enabled;
}
/**
* Convert a bit-field to a string of supported extensions.
*/
static char *
__glXGetStringFromTable( const struct extension_info * ext,
const unsigned char * supported )
{
unsigned i;
unsigned ext_str_len;
char * ext_str;
char * point;
ext_str_len = 0;
for ( i = 0 ; ext[i].name != NULL ; i++ ) {
if ( EXT_ENABLED( ext[i].bit, supported ) ) {
ext_str_len += ext[i].name_len + 1;
}
}
ext_str = Xmalloc( ext_str_len + 1 );
if ( ext_str != NULL ) {
point = ext_str;
for ( i = 0 ; ext[i].name != NULL ; i++ ) {
if ( EXT_ENABLED( ext[i].bit, supported ) ) {
(void) memcpy( point, ext[i].name, ext[i].name_len );
point += ext[i].name_len;
*point = ' ';
point++;
}
}
*point = '\0';
}
return ext_str;
}
/**
* Get the string of client library supported extensions.
*/
const char *
__glXGetClientExtensions( void )
{
if ( __glXGLXClientExtensions == NULL ) {
__glXExtensionsCtr();
__glXGLXClientExtensions = __glXGetStringFromTable( known_glx_extensions,
client_glx_support );
}
return __glXGLXClientExtensions;
}
/**
* Calculate the list of application usable extensions. The resulting
* string is stored in \c psc->effectiveGLXexts.
*
* \param psc Pointer to GLX per-screen record.
* \param display_is_direct_capable True if the display is capable of
* direct rendering.
* \param minor_version GLX minor version from the server.
*/
void
__glXCalculateUsableExtensions( __GLXscreenConfigs *psc,
GLboolean display_is_direct_capable,
int minor_version )
{
unsigned char server_support[8];
unsigned char usable[8];
unsigned i;
__glXExtensionsCtr();
__glXExtensionsCtrScreen( psc );
__glXProcessServerString( known_glx_extensions,
psc->serverGLXexts, server_support );
/* This is a hack. Some servers support GLX 1.3 but don't export
* all of the extensions implied by GLX 1.3. If the server claims
* support for GLX 1.3, enable support for the extensions that can be
* "emulated" as well.
*/
if ( minor_version >= 3 ) {
SET_BIT( server_support, EXT_visual_info_bit );
SET_BIT( server_support, EXT_visual_rating_bit );
SET_BIT( server_support, SGI_make_current_read_bit );
SET_BIT( server_support, SGIX_fbconfig_bit );
SET_BIT( server_support, SGIX_pbuffer_bit );
/* This one is a little iffy. GLX 1.3 doesn't incorporate all of this
* extension. However, the only part that is not strictly client-side
* is shared. That's the glXQueryContext / glXQueryContextInfoEXT
* function.
*/
SET_BIT( server_support, EXT_import_context_bit );
}
/* An extension is supported if the client-side (i.e., libGL) supports
* it and the "server" supports it. In this case that means that either
* the true server supports it or it is only for direct-rendering and
* the direct rendering driver supports it.
*
* If the display is not capable of direct rendering, then the extension
* is enabled if and only if the client-side library and the server
* support it.
*/
if ( display_is_direct_capable ) {
for ( i = 0 ; i < 8 ; i++ ) {
usable[i] = (client_glx_support[i] & client_glx_only[i])
| (client_glx_support[i] & psc->direct_support[i] & server_support[i])
| (client_glx_support[i] & psc->direct_support[i] & direct_glx_only[i]);
}
}
else {
for ( i = 0 ; i < 8 ; i++ ) {
usable[i] = (client_glx_support[i] & client_glx_only[i])
| (client_glx_support[i] & server_support[i]);
}
}
psc->effectiveGLXexts = __glXGetStringFromTable( known_glx_extensions,
usable );
}
/**
* Calculate the list of application usable extensions. The resulting
* string is stored in \c gc->extensions.
*
* \param gc Pointer to GLX context.
* \param server_string Extension string from the server.
* \param major_version GL major version from the server.
* \param minor_version GL minor version from the server.
*/
void
__glXCalculateUsableGLExtensions( __GLXcontext * gc,
const char * server_string,
int major_version, int minor_version )
{
unsigned char server_support[ __GL_EXT_BYTES ];
unsigned char usable[ __GL_EXT_BYTES ];
unsigned i;
__glXExtensionsCtr();
(void) memset( server_support, 0, sizeof( server_support ) );
__glXProcessServerString( known_gl_extensions, server_string,
server_support );
/* Handle lazy servers that don't export all the extensions strings that
* are part of the GL core version that they support.
*/
for ( i = 0 ; i < __GL_EXT_BYTES ; i++ ) {
if ( (known_gl_extensions[i].version_major != 0)
&& ((major_version > known_gl_extensions[i].version_major)
|| ((major_version == known_gl_extensions[i].version_major)
&& (minor_version >= known_gl_extensions[i].version_minor))) ) {
SET_BIT( server_support, known_gl_extensions[i].bit );
}
}
/* An extension is supported if the client-side (i.e., libGL) supports
* it and the server supports it or the client-side library supports it
* and it only needs client-side support.
*/
for ( i = 0 ; i < __GL_EXT_BYTES ; i++ ) {
usable[i] = (client_gl_support[i] & client_gl_only[i])
| (client_gl_support[i] & server_support[i]);
}
gc->extensions = (unsigned char *)
__glXGetStringFromTable( known_gl_extensions, usable );
}
/**
* Calculates the maximum core GL version that can be supported for indirect
* rendering.
*/
void
__glXGetGLVersion( int * major_version, int * minor_version )
{
__glXExtensionsCtr();
*major_version = gl_major;
*minor_version = gl_minor;
}
/**
* Get a string representing the set of extensions supported by the client
* library. This is currently only used to send the list of extensions
* supported by the client to the server.
*/
char *
__glXGetClientGLExtensionString( void )
{
__glXExtensionsCtr();
return __glXGetStringFromTable( known_gl_extensions, client_gl_support );
}

View File

@@ -1,255 +0,0 @@
/*
* (C) Copyright IBM Corporation 2002, 2004
* 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
* THE COPYRIGHT HOLDERS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
* USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/**
* \file glxextensions.h
*
* \author Ian Romanick <idr@us.ibm.com>
*/
/* $XFree86: xc/lib/GL/glx/glxextensions.h,v 1.2tsi Exp $ */
#ifndef GLX_GLXEXTENSIONS_H
#define GLX_GLXEXTENSIONS_H
enum {
ARB_get_proc_address_bit = 0,
ARB_multisample_bit,
ARB_render_texture_bit,
ATI_pixel_format_float_bit,
EXT_visual_info_bit,
EXT_visual_rating_bit,
EXT_import_context_bit,
MESA_agp_offset_bit,
MESA_allocate_memory_bit, /* Replaces MESA_agp_offset & NV_vertex_array_range */
MESA_copy_sub_buffer_bit,
MESA_depth_float_bit,
MESA_pixmap_colormap_bit,
MESA_release_buffers_bit,
MESA_set_3dfx_mode_bit,
MESA_swap_control_bit,
MESA_swap_frame_usage_bit,
NV_float_buffer_bit,
NV_render_depth_texture_bit,
NV_render_texture_rectangle_bit,
NV_vertex_array_range_bit,
OML_swap_method_bit,
OML_sync_control_bit,
SGI_cushion_bit,
SGI_make_current_read_bit,
SGI_swap_control_bit,
SGI_video_sync_bit,
SGIS_blended_overlay_bit,
SGIS_color_range_bit,
SGIS_multisample_bit,
SGIX_dm_buffer_bit,
SGIX_fbconfig_bit,
SGIX_pbuffer_bit,
SGIX_swap_barrier_bit,
SGIX_swap_group_bit,
SGIX_video_resize_bit,
SGIX_video_source_bit,
SGIX_visual_select_group_bit,
SUN_get_transparent_index_bit
};
enum {
GL_ARB_depth_texture_bit = 0,
GL_ARB_fragment_program_bit,
GL_ARB_imaging_bit,
GL_ARB_multisample_bit,
GL_ARB_multitexture_bit,
GL_ARB_occlusion_query_bit,
GL_ARB_point_parameters_bit,
GL_ARB_point_sprite_bit,
GL_ARB_shadow_bit,
GL_ARB_shadow_ambient_bit,
GL_ARB_texture_border_clamp_bit,
GL_ARB_texture_cube_map_bit,
GL_ARB_texture_compression_bit,
GL_ARB_texture_env_add_bit,
GL_ARB_texture_env_combine_bit,
GL_ARB_texture_env_crossbar_bit,
GL_ARB_texture_env_dot3_bit,
GL_ARB_texture_mirrored_repeat_bit,
GL_ARB_texture_non_power_of_two_bit,
GL_ARB_texture_rectangle_bit,
GL_ARB_transpose_matrix_bit,
GL_ARB_vertex_buffer_object_bit,
GL_ARB_vertex_program_bit,
GL_ARB_window_pos_bit,
GL_EXT_abgr_bit,
GL_EXT_bgra_bit,
GL_EXT_blend_color_bit,
GL_EXT_blend_equation_separate_bit,
GL_EXT_blend_func_separate_bit,
GL_EXT_blend_logic_op_bit,
GL_EXT_blend_minmax_bit,
GL_EXT_blend_subtract_bit,
GL_EXT_clip_volume_hint_bit,
GL_EXT_compiled_vertex_array_bit,
GL_EXT_convolution_bit,
GL_EXT_copy_texture_bit,
GL_EXT_cull_vertex_bit,
GL_EXT_depth_bounds_test_bit,
GL_EXT_draw_range_elements_bit,
GL_EXT_fog_coord_bit,
GL_EXT_multi_draw_arrays_bit,
GL_EXT_packed_pixels_bit,
GL_EXT_paletted_texture_bit,
GL_EXT_pixel_buffer_object_bit,
GL_EXT_polygon_offset_bit,
GL_EXT_rescale_normal_bit,
GL_EXT_secondary_color_bit,
GL_EXT_separate_specular_color_bit,
GL_EXT_shadow_funcs_bit,
GL_EXT_shared_texture_palette_bit,
GL_EXT_stencil_two_side_bit,
GL_EXT_stencil_wrap_bit,
GL_EXT_subtexture_bit,
GL_EXT_texture_bit,
GL_EXT_texture3D_bit,
GL_EXT_texture_compression_s3tc_bit,
GL_EXT_texture_edge_clamp_bit,
GL_EXT_texture_env_combine_bit,
GL_EXT_texture_env_dot3_bit,
GL_EXT_texture_filter_anisotropic_bit,
GL_EXT_texture_lod_bit,
GL_EXT_texture_lod_bias_bit,
GL_EXT_texture_mirror_clamp_bit,
GL_EXT_texture_object_bit,
GL_EXT_vertex_array_bit,
GL_3DFX_texture_compression_FXT1_bit,
GL_APPLE_packed_pixels_bit,
GL_APPLE_ycbcr_422_bit,
GL_ATI_texture_env_combine3_bit,
GL_ATI_texture_float_bit,
GL_ATI_texture_mirror_once_bit,
GL_HP_convolution_border_modes_bit,
GL_HP_occlusion_test_bit,
GL_IBM_cull_vertex_bit,
GL_IBM_pixel_filter_hint_bit,
GL_IBM_rasterpos_clip_bit,
GL_IBM_texture_clamp_nodraw_bit,
GL_INGR_interlace_read_bit,
GL_MESA_pack_invert_bit,
GL_MESA_ycbcr_texture_bit,
GL_NV_blend_square_bit,
GL_NV_copy_depth_to_color_bit,
GL_NV_depth_clamp_bit,
GL_NV_fog_distance_bit,
GL_NV_light_max_exponent_bit,
GL_NV_multisample_filter_hint_bit,
GL_NV_point_sprite_bit,
GL_NV_texgen_reflection_bit,
GL_NV_texture_compression_vtc_bit,
GL_NV_texture_env_combine4_bit,
GL_OES_read_format_bit,
GL_SGIS_generate_mipmap_bit,
GL_SGIS_multisample_bit,
GL_SGIS_texture_lod_bit,
GL_SGIX_blend_alpha_minmax_bit,
GL_SGIX_clipmap_bit,
GL_SGIX_depth_texture_bit,
GL_SGIX_fog_offset_bit,
GL_SGIX_shadow_bit,
GL_SGIX_texture_coordinate_clamp_bit,
GL_SGIX_texture_lod_bias_bit,
GL_SGIX_texture_range_bit,
GL_SGIX_texture_scale_bias_bit,
GL_SGIX_vertex_preclip_bit,
GL_SGIX_vertex_preclip_hint_bit,
GL_SGIX_ycrcb_bit,
GL_SUN_convolution_border_modes_bit,
GL_SUN_slice_accum_bit,
/* This *MUST* go here. If it gets put after the duplicate values it will
* get the value after the last duplicate.
*/
__NUM_GL_EXTS,
/* Alias extension bits. These extensions exist in either vendor-specific
* or EXT form and were later promoted to either EXT or ARB form. In all
* cases, the meaning is *exactly* the same. That's why
* EXT_texture_env_combine is *NOT* an alias of ARB_texture_env_combine and
* EXT_texture_env_dot3 is *NOT* an alias of ARB_texture_env_dot3. Be
* careful! When in doubt, src/mesa/main/extensions.c in the Mesa tree
* is a great reference.
*/
GL_ATI_blend_equation_separate_bit = GL_EXT_blend_equation_separate_bit,
GL_ATIX_texture_env_combine3_bit = GL_ATI_texture_env_combine3_bit,
GL_EXT_point_parameters_bit = GL_ARB_point_parameters_bit,
GL_EXT_texture_env_add_bit = GL_ARB_texture_env_add_bit,
GL_EXT_texture_rectangle_bit = GL_ARB_texture_rectangle_bit,
GL_IBM_texture_mirrored_repeat_bit = GL_ARB_texture_mirrored_repeat_bit,
GL_INGR_blend_func_separate_bit = GL_EXT_blend_func_separate_bit,
GL_MESA_window_pos_bit = GL_ARB_window_pos_bit,
GL_NV_texture_rectangle_bit = GL_ARB_texture_rectangle_bit,
GL_SGIS_texture_border_clamp_bit = GL_ARB_texture_border_clamp_bit,
GL_SGIS_texture_edge_clamp_bit = GL_EXT_texture_edge_clamp_bit,
GL_SGIX_shadow_ambient_bit = GL_ARB_shadow_ambient_bit,
GL_SUN_multi_draw_arrays_bit = GL_EXT_multi_draw_arrays_bit
};
extern GLboolean __glXExtensionBitIsEnabled( __GLXscreenConfigs *psc, unsigned bit );
extern const char * __glXGetClientExtensions( void );
extern void __glXCalculateUsableExtensions( __GLXscreenConfigs *psc,
GLboolean display_is_direct_capable, int server_minor_version );
extern void __glXScrEnableExtension( __GLXscreenConfigs *psc, const char * name );
extern void __glXCalculateUsableGLExtensions( __GLXcontext * gc,
const char * server_string, int major_version, int minor_version );
extern void __glXGetGLVersion( int * major_version, int * minor_version );
extern char * __glXGetClientGLExtensionString( void );
/* Source-level backwards compatibility with old drivers. They won't
* find the respective functions, though.
*/
typedef void (* PFNGLXENABLEEXTENSIONPROC) ( const char * name,
GLboolean force_client );
typedef void (* PFNGLXDISABLEEXTENSIONPROC) ( const char * name );
/* GLX_ALIAS should be used for functions with a non-void return type.
GLX_ALIAS_VOID is for functions with a void return type. */
#ifdef GLX_NO_STATIC_EXTENSION_FUNCTIONS
# define GLX_ALIAS(return_type, real_func, proto_args, args, aliased_func)
# define GLX_ALIAS_VOID(real_func, proto_args, args, aliased_func)
#else
# if defined(__GNUC__) && !defined(GLX_ALIAS_UNSUPPORTED)
# define GLX_ALIAS(return_type, real_func, proto_args, args, aliased_func) \
return_type GLX_PREFIX( real_func ) proto_args \
__attribute__ ((alias( # aliased_func ) ));
# define GLX_ALIAS_VOID(real_func, proto_args, args, aliased_func) \
GLX_ALIAS(void, real_func, proto_args, args, aliased_func)
# else
# define GLX_ALIAS(return_type, real_func, proto_args, args, aliased_func) \
return_type GLX_PREFIX( real_func ) proto_args \
{ return aliased_func args ; }
# define GLX_ALIAS_VOID(real_func, proto_args, args, aliased_func) \
void GLX_PREFIX( real_func ) proto_args \
{ aliased_func args ; }
# endif /* __GNUC__ */
#endif /* GLX_NO_STATIC_EXTENSION_FUNCTIONS */
#endif /* GLX_GLXEXTENSIONS_H */

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More