Compare commits

..

35 Commits

Author SHA1 Message Date
Keith Whitwell
11c0215bf8 Switch between memcpy implementations according to src/dest alignment. 2006-02-01 18:42:16 +00:00
Keith Whitwell
6a13b6c346 Debug off 2006-02-01 18:30:16 +00:00
Keith Whitwell
a103097ee5 Quieten depend 2006-02-01 18:29:56 +00:00
Keith Whitwell
7efad0d84c Just build the i915 on this branch 2006-02-01 18:29:25 +00:00
Keith Whitwell
42c88cd072 subtexrate test on this branch too 2006-02-01 18:14:09 +00:00
Keith Whitwell
2541c54e79 gearbox demo on this branch too 2006-02-01 18:13:23 +00:00
Keith Whitwell
33529e3d8e Bump driver date 2006-02-01 18:01:04 +00:00
Keith Whitwell
84c1b82081 Disable check_copytex_fragment_ops - it doesn't really apply. 2006-02-01 16:40:23 +00:00
Keith Whitwell
a97a1439ae Get batchbuffers working natively again. This code still
relies over-heavily on the DRI lock to protect offsets in the
command stream from changing before being queued on the ring,
and should be viewed as being a pretty temporary mechanism
before a more robust alternative is implemented, most likely
based on a batchbuffer relocation list that will be used
to patch prebuilt batchbuffers after validation takes place.
2006-02-01 15:54:42 +00:00
Keith Whitwell
2fd2910010 Remove the last of the old AllocateAgp mechanism.
Move the batchbuffer code to being effectively a ring of
bufmgr buffers.
2006-02-01 15:51:31 +00:00
Keith Whitwell
fbbda155e0 Add code to map/unmap all texture images for the software rasterizer.
Add the color and depth buffers to the validation list to ensure they
are fenced correctly by hardware rasterization.
2006-02-01 15:50:14 +00:00
Keith Whitwell
a49c3c0fae Ensure that color buffers and textures are mapped (bmBufferMap) before
software rasterizer fallbacks.  This has two functions, firstly to
ensure that the Data pointers point to something and secondly to
ensure than any pending fences on those buffers are discharged before
allowing the software rasterizer to read/write the data.

This needs to be integrated with Brian's validate code.
2006-02-01 15:48:52 +00:00
Keith Whitwell
baf5998d59 file gearbox.c was added on branch texman_0_1_branch on 2006-02-01 18:13:23 +0000 2006-01-30 15:35:35 +00:00
Keith Whitwell
4c5acef241 Get hardware-accelerated CopyTexSubImage working well enough to run
Brian's gearbox demo.
2006-01-28 23:28:14 +00:00
Keith Whitwell
9839e272cf Allow ValidateBuffers to allocate memory for buffers which haven't yet
got it by other methods.  Typically this is buffers being written to by
hardware excluding the fixed front/back/depth buffers which are have
pre-allocated memory.

At some point will want to pass BM_READ/BM_WRITE flags to catch the
couple of cases where buffers are treated differently in each case.
2006-01-28 23:27:39 +00:00
Keith Whitwell
b57e79ff14 remove debug 2006-01-28 17:52:50 +00:00
Keith Whitwell
43824acb4e Build fixes 2006-01-28 17:52:05 +00:00
Keith Whitwell
d8f509e749 Use the x86 __memcpy to avoid performance clif for uploads where the
source data is worse than 64-byte aligned.
2006-01-28 17:50:59 +00:00
Keith Whitwell
eb91c93c2e file subtexrate.c was added on branch texman_0_1_branch on 2006-02-01 18:14:09 +0000 2006-01-27 15:44:40 +00:00
Keith Whitwell
79de983b6f initial copytexsubimage code, untested 2006-01-27 11:58:00 +00:00
Brian Paul
fdb3acf016 added _swrast_eject_texture_images() 2006-01-27 03:42:56 +00:00
Keith Whitwell
2807d1f58a Get readbuffer correctly. 2006-01-26 18:30:34 +00:00
Keith Whitwell
93f913926e - Remove (most of) old agp client memory hack.
- Implement an accelerated version of glCopyPixels using the blitter.
2006-01-26 17:21:38 +00:00
Keith Whitwell
33ca04f379 Expand the buffer manager to include a notion of multiple pools within
a memory space.  Allow some pools to be excluded from the upload/evict
processing, meaning that any buffers within those pools are effectively
fixed.  Add a mechanism to create buffers in those pools.

This allows the legacy fixed front/depth/back buffers to be represented
in this scheme and will allow other future pinned buffers to be allocated
from fixed pools in such a way that they cannot fragment the rest of
the texture memory.
2006-01-26 14:50:02 +00:00
Brian Paul
398cb30c72 Added _swrast_validate_texture_images() to make sure all textures have
data resident for software rasterization.
Relies on new swrast driver function: ValidateTextureImage()
2006-01-26 04:05:53 +00:00
Keith Whitwell
f67bb30314 Fix confusion over pitch. demos/texobj renders correctly. 2006-01-25 17:16:46 +00:00
Keith Whitwell
4578d7b9f0 Offset returns weren't being returned. 2006-01-25 16:57:36 +00:00
Keith Whitwell
dcdfc154c3 Remove silly debug. 2006-01-25 16:46:10 +00:00
Keith Whitwell
696ba32779 Another texture manager checkpoint:
- Add code to validate textures before use.
- Simplify vertex paths for now.
- Make vertex paths validate textures.  This is done pretty
  with some pretty heavy-handed use of the dri lock - fixing this is
  a priority.
- Add lots of debug statements

demos/texobj renders, but textures are incorrect.
2006-01-25 15:40:50 +00:00
Keith Whitwell
dcfe55539f Remove dead code. Gears runs. 2006-01-24 18:55:52 +00:00
Keith Whitwell
ff84b1f1b2 Checkpoint of texture manager rework for i915.
Compiles but won't do any more than that.
2006-01-24 18:35:53 +00:00
Keith Whitwell
3bca9c47f4 Add another layer on top of the simple 2d regions in intel_regions.[ch]
which keeps track of a whole, well-defined mipmap tree.  These are a
fixed layout on intel hardware and managing them is complicated in the
face of GL's TexImage function calls where data can arrive in any order,
making it difficult to guess a layout ahead of time.

Wrapping mipmap trees up in a struct and programming interface like this
reduces the burden elsewhere.
2006-01-24 16:38:43 +00:00
Keith Whitwell
d4d7fdb43b layer 2d region semantics and blits on top of bufmgr buffers 2006-01-23 12:53:11 +00:00
Keith Whitwell
d65dab5777 import via texture semantics 2006-01-23 12:52:28 +00:00
Keith Whitwell
638ca019ef Add a faked-out implementation of the buffer manager that uses the same
techniques as the old dri memory manager behind the new interface.  Will
use this to port the i915 driver to this interface to hopefully get
some easy insights from using the interface.
2006-01-16 15:30:45 +00:00
448 changed files with 36671 additions and 38385 deletions

View File

@@ -89,7 +89,6 @@ linux-dri \
linux-dri-x86 \
linux-dri-x86-64 \
linux-dri-ppc \
linux-dri-xcb \
linux-indirect \
linux-fbdev \
linux-glide \
@@ -114,6 +113,7 @@ linux-x86-32 \
linux-x86-64 \
linux-x86-64-debug \
linux-x86-64-static \
linux-x86-xcb \
linux-x86-glide \
linux-x86-static \
netbsd \
@@ -166,7 +166,6 @@ MAIN_FILES = \
$(DIRECTORY)/include/GL/glx.h \
$(DIRECTORY)/include/GL/glxext.h \
$(DIRECTORY)/include/GL/glx_mangle.h \
$(DIRECTORY)/include/GL/glfbdev.h \
$(DIRECTORY)/include/GL/mesa_wgl.h \
$(DIRECTORY)/include/GL/mglmesa.h \
$(DIRECTORY)/include/GL/osmesa.h \

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 for Mesa
# DOS/DJGPP makefile v1.6 for Mesa
#
# Author: Daniel Borca
# Copyright (C) 2002 - Daniel Borca
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
@@ -31,6 +31,9 @@
# Available options:
#
# Environment variables:
# GLU=[mesa|sgi] specify GLU directory; can be `sgi' (requires GNU/C++)
# or `mesa'.
# default = mesa
# GLIDE path to Glide3 SDK; used with FX.
# default = $(TOP)/glide3
# FX=1 build for 3dfx Glide3. Note that this disables
@@ -54,6 +57,8 @@
.PHONY : all libgl libglu libglut clean realclean
GLU ?= mesa
CFLAGS = -Wall -W -pedantic
CFLAGS += -O2 -ffast-math
@@ -70,7 +75,7 @@ all: libgl libglu libglut
libgl: lib
$(MAKE) -f Makefile.DJ -C src/mesa
libglu: lib
$(MAKE) -f Makefile.DJ -C src/glu/sgi
$(MAKE) -f Makefile.DJ -C src/glu/$(GLU)
libglut: lib
$(MAKE) -f Makefile.DJ -C src/glut/dos

View File

@@ -53,8 +53,6 @@ if [ `uname` = "FreeBSD" ] ; then
CP_FLAGS="-f"
elif [ `uname` = "Darwin" ] ; then
CP_FLAGS="-f"
elif [ `uname` = "AIX" ] ; then
CP_FLAGS="-fh"
else
CP_FLAGS="-fd"
fi

View File

@@ -502,9 +502,6 @@ case $ARCH in
${LINK} ${OPTS} ${LIBNAME} ${OBJECTS}
FINAL_LIBS=${LIBNAME}
else
# may need these:
# CFLAGS += -fno-common
# LDFLAGS += -bundle -flat_namespace -undefined suppress
LIBNAME="lib${LIBNAME}.dylib"
echo "mklib: Making Darwin shared library: " ${LIBNAME}
FLAGS="-dynamiclib -multiply_defined suppress -current_version ${MAJOR}.${MINOR}.0 -compatibility_version ${MAJOR}.${MINOR}.0"

View File

@@ -14,6 +14,6 @@ CXXFLAGS = -O2 -DAIXV3
MKLIB_OPTIONS = -arch aix-gcc
GL_LIB_DEPS = -lX11 -lXext -lm
GLU_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -lm
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lXi -lXmu
GLUT_LIB_DEPS = -L$(LIB_DIR -l$(GLU_LIB) -l$(GL_LIB) -lXi -lXmu
APP_LIB_DEPS = -L$(LIB_DIR) -Wl,-brtl -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm -lX11 -lXext -lXmu -lXi

View File

@@ -5,22 +5,13 @@ include $(TOP)/configs/default
CONFIG_NAME = FreeBSD
# Compiler and flags
CC = cc
CXX = c++
CC = gcc
CXX = g++
MAKE = gmake
OPT_FLAGS = -O2
PIC_FLAGS = -fPIC
DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_BSD_SOURCE -DUSE_XSHM -DHZ=100
X11_INCLUDES = -I/usr/X11R6/include
CFLAGS += $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(DEFINES) $(X11_INCLUDES) -ffast-math -pedantic
CXXFLAGS += $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(DEFINES) $(X11_INCLUDES)
CFLAGS = -O2 -fPIC -pedantic -I/usr/X11R6/include -DUSE_XSHM -DHZ=100 \
$(ASM_FLAGS)
CXXFLAGS = -O2 -fPIC -pedantic
GLUT_CFLAGS = -fexceptions
EXTRA_LIB_PATH = -L/usr/X11R6/lib
APP_LIB_DEPS = -L$(LIB_DIR) $(EXTRA_LIB_PATH) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lXext -lXmu -lXi -lX11 -lm
APP_LIB_DEPS = -L$(LIB_DIR) -L/usr/X11R6/lib -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lXext -lXmu -lXi -lX11 -lm

View File

@@ -22,7 +22,7 @@ CXXFLAGS = $(DEFINES) -Wall -g -ansi -pedantic -fPIC
ASM_SOURCES =
# Library/program dependencies
LIBDRM_LIB = `pkg-config --libs libdrm`
LIBDRM_LIB = `pkg-config --libs libdrm` -ldrm
DRI_LIB_DEPS = -L/usr/local/lib -lm -lpthread -lexpat $(LIBDRM_LIB)
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lXxf86vm -lm -lpthread $(LIBDRM_LIB)
@@ -40,6 +40,6 @@ DRM_SOURCE_PATH=$(TOP)/../drm
# ffb and gamma are missing because they have not been converted to use the new
# interface.
DRI_DIRS = i810 i915 mach64 mga r128 r200 r300 radeon tdfx \
DRI_DIRS = i810 i830 i915 mach64 mga r128 r200 r300 radeon tdfx \
unichrome savage sis

View File

@@ -4,5 +4,5 @@ include $(TOP)/configs/linux
CONFIG_NAME = linux-debug
OPT_FLAGS = -g -ansi -pedantic
OPT_FLAGS = -g
DEFINES += -DDEBUG -DDEBUG_MATH

View File

@@ -37,7 +37,7 @@ ASM_SOURCES =
# Library/program dependencies
EXTRA_LIB_PATH=-L/usr/X11R6/lib
LIBDRM_LIB = `pkg-config --libs libdrm`
LIBDRM_LIB = `pkg-config --libs libdrm` -ldrm
DRI_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl \
$(LIBDRM_LIB)
@@ -65,3 +65,5 @@ WINDOW_SYSTEM=dri
# interface.
DRI_DIRS = i810 i915 mach64 mga r128 r200 r300 radeon s3v \
savage sis tdfx trident unichrome ffb
DRI_DIRS = i915

View File

@@ -17,7 +17,7 @@ LIB_DIR = $(TOP)/lib64
EXTRA_LIB_PATH=-L/usr/X11R6/lib64
# ffb, gamma, and sis are missing because they have not be converted to use
# the new interface. i810 are missing because there is no x86-64
# the new interface. i810 and i830 are missing because there is no x86-64
# system where they could *ever* be used.
#
DRI_DIRS = i915 mach64 mga r128 r200 radeon tdfx unichrome savage r300

View File

@@ -1,67 +0,0 @@
# -*-makefile-*-
# Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others
include $(TOP)/configs/default
CONFIG_NAME = linux-dri-xcb
# Compiler and flags
CC = gcc
CXX = g++
#MKDEP = /usr/X11R6/bin/makedepend
#MKDEP = gcc -M
#MKDEP_OPTIONS = -MF depend
OPT_FLAGS = -g
PIC_FLAGS = -fPIC
# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support.
ARCH_FLAGS ?=
DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
-D_BSD_SOURCE -D_GNU_SOURCE \
-DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER \
-DGLX_DIRECT_RENDERING -DHAVE_ALIAS -DUSE_XCB
X11_INCLUDES = `pkg-config --cflags-only-I x11` `pkg-config --cflags-only-I xcb`
CFLAGS = -Wall -Wmissing-prototypes $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) \
$(DEFINES) $(ASM_FLAGS) -std=c99 -ffast-math
CXXFLAGS = -Wall $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
ASM_SOURCES =
# Library/program dependencies
EXTRA_LIB_PATH=`pkg-config --libs-only-L x11`
LIBDRM_LIB = `pkg-config --libs libdrm`
DRI_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl \
$(LIBDRM_LIB) `pkg-config --libs xcb`
# This is now 0 by default since it seems to confuse the hell out of people
# and generate a lot of extra noise on bugzilla. If you need to build with
# EGL, do 'make linux-dri USING_EGL=1'
USING_EGL=0
# Directories
ifeq ($(USING_EGL), 1)
SRC_DIRS = egl glx/x11 mesa glu glut/glx glw
PROGRAM_DIRS = egl
else
SRC_DIRS = glx/x11 mesa glu glut/glx glw
PROGRAM_DIRS =
endif
DRIVER_DIRS = dri
WINDOW_SYSTEM=dri
# gamma are missing because they have not been converted to use the new
# interface.
DRI_DIRS = i810 i915 mach64 mga r128 r200 r300 radeon s3v \
savage sis tdfx trident unichrome ffb

View File

@@ -10,7 +10,7 @@ CONFIG_NAME = linux-dri
CC = gcc
CXX = g++
#MKDEP = /usr/X11R6/bin/makedepend
MKDEP = /usr/X11R6/bin/makedepend
#MKDEP = gcc -M
#MKDEP_OPTIONS = -MF depend

View File

@@ -40,4 +40,4 @@ DRIVER_DIRS = dri
PROGRAM_DIRS = miniglx
#DRI_DIRS = ffb gamma sis savage
DRI_DIRS = i810 i915 mach64 mga r128 r200 radeon tdfx unichrome fb
DRI_DIRS = i810 i830 i915 mach64 mga r128 r200 radeon tdfx unichrome fb

25
configs/linux-x86-xcb Normal file
View File

@@ -0,0 +1,25 @@
# Configuration for Linux with x86 optimizations
include $(TOP)/configs/default
CONFIG_NAME = linux-x86-xcb
# Compiler and flags
CC = gcc
CXX = g++
CFLAGS = -Wall -O3 -ansi -pedantic -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM -DPTHREADS -DUSE_XCB -I/usr/X11R6/include
CXXFLAGS = -Wall -O3 -ansi -pedantic -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XCB
GLUT_CFLAGS = -fexceptions
ASM_SOURCES = $(X86_SOURCES)
ASM_API = $(X86_API)
# Library/program dependencies
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -lXCB
GLUT_LIB_DEPS = -L$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib -lXt -lX11
APP_LIB_DEPS = -L$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm

View File

@@ -1,4 +1,4 @@
Mesa 6.5 DOS/DJGPP Port v1.8
Mesa 6.3 DOS/DJGPP Port v1.7
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -7,7 +7,8 @@ Description:
~~~~~~~~~~~~
Well, guess what... this is the DOS port of Mesa 6.3, for DJGPP fans... Whoa!
The driver uses OSMesa to draw off screen, and then blits the buffer.
The driver has its origins in ddsample.c, written by Brian Paul and found by me
in Mesa 3.4.2.
@@ -31,6 +32,9 @@ Available options:
Environment variables:
CPU optimize for the given processor.
default = pentium
GLU=[mesa|sgi] specify GLU directory; can be `sgi' (requires GNU/C++)
or `mesa'.
default = mesa
GLIDE path to Glide3 SDK; used with FX.
default = $(TOP)/glide3
FX=1 build for 3dfx Glide3. Note that this disables
@@ -52,9 +56,11 @@ Available options:
Tested on:
Video card: Radeon 9500
DJGPP: djdev 2.04 + gcc v4.1.0 + make v3.80
OS: DOS, Win98SE, WinXP (using Videoport driver)
CPU: AMD Athlon XP 1800+
Mainboard: GA-7VTXE w/ 512 MB DDRAM
Video card: Voodoo5 6000 AGP w/ 128 MB SDRAM
DJGPP: djdev 2.04 + gcc v3.4.3 + make v3.80
OS: DOS and Win98SE
@@ -92,7 +98,7 @@ FAQ:
Q) DMesa is so SLOOOW! The Win32 OpenGL performs so much better...
A) Is that a question? If you have a 3dfx Voodoo (any model), you're
lucky (check http://sourceforge.net/projects/glide for the DJGPP port).
If you haven't, sorry; everything is done in software.
If you haven't, sorry; everything is done in software. Suggestions?
Q) I tried to set refresh rate w/ DMesa, but without success.
A) Refresh rate control works only for VESA 3.0 and the 3dfx driver (in
@@ -101,8 +107,7 @@ FAQ:
Q) I made a simple application and it does nothing. It exits right away. Not
even a blank screen.
A) Software drivers (VESA/VGA/NUL) must to be constructed as single-buffered
visuals. However, DMesaSwapBuffers must be called to get any output.
A) Pure software drivers (VESA/VGA/NUL) support only double-buffered modes.
A) Another weird "feature" is that buffer width must be multiple of 8 (I'm a
lazy programmer and I found that the easiest way to keep buffer handling
at peak performance ;-).
@@ -260,11 +265,6 @@ v1.7 (???-2005)
* no more GLX sources in DOS GLUT
* made GLUT timer callbacks less accurate but safer
v1.8 (apr-2006)
* killed lots of code, the driver is now a front-end to OSMesa
* fixed problem with WinNT (http://www.volny.cz/martin.sulak/)
- removed 3dfx Glide3 support (temporarily?)
Contact:

View File

@@ -1,15 +1,15 @@
File: docs/README.WIN32
Last updated: Mar 31, 2006 - Karl Schultz - kschultz@users.sourceforge.net
Last updated: Jul 01, 2005 - Karl Schultz - kschultz@users.sourceforge.net
Quick Start
----- -----
Unzip the MesaLib, MesaGLUT, and MesaDemos ZIP files into the same
directory. The libs and demos build separately, so if you do not care
about the demos or GLUT, you only need to unzip MesaLib. If you unzip
more than one ZIP file, they all need to be unzipped into the same
directory. Don't worry, you will not overwrite anything.
Unzip both ZIP files (MesaLib and MesaDemos) into the same directory.
The libs and demos build separately, so if you do not care about the
demos, you do not have to unzip that zip file. But if you do, it does
need to be unzipped into the same directory as the lib zip file
because the demos depend on the libs.
The Windows build system uses Microsoft Visual Studio. Project files
for a specific version of Visual Studio are in their own directory in
@@ -22,10 +22,6 @@ of Version 8 and it runs on 64-bit Windows. If you want to try this,
start by importing the VC7 files and create the 64-bit targets in the
configuration manager.
It is likely that the new and free Visual Studio Express can be used
to build Mesa, but it hasn't been tried yet. Start with the VC7
project files.
The project files to build the core Mesa library, Windows Mesa
drivers, OSMesa, and GLU are in the mesa directory. The project files
to build GLUT and some demo programs are in the progs directory.
@@ -37,11 +33,10 @@ from the projects using Visual Studio.
Windows Drivers
------- -------
At this time, only the GDI driver is known to work. Most of the demos
in progs/demos should work with this driver.
Source code also exists in the tree for other drivers in
src/mesa/drivers/windows, but the status of this code is unknown.
At this time, only the GDI driver is known to work, as it has been
ported and rewritten to the latest Mesa DD interfaces. Source code
also exists in the tree for other drivers in src/mesa/drivers/windows,
but the status of this code is unknown.
The GDI driver operates basically by writing pixel spans into a DIB
section and then blitting the DIB to the window. The driver was
@@ -91,14 +86,6 @@ simply run the demo executables from the demo directory.
If you want to run the demos from the Visual Studio, you may have to
change the startup directory and explicitly state where the executables are.
You may also build all the demo programs by using a makefile. Go to
the progs/demos directory and make sure you have executed VCVARS32.BAT
or whatever setup script is appropriate for your compiler. Then,
nmake -f Makefile.win
should build all the demos.
Build System Notes
----- ------ -----
@@ -111,9 +98,6 @@ language files, without a lot of unnatural tweaking. So, the VC6
build process uses custom build steps to compile these files in the
GLU library.
Two additional configurations are provided, Debug x86 and Release x86
that activate the shader code compilation by defining SLANG_86. It is
unknown if and how this works.
VC7
---

View File

@@ -1,47 +0,0 @@
Mesa 6.4.1 Release Notes
Introduction
------------
Mesa uses an even/odd version number scheme like the Linux kernel.
Odd numbered versions (such as 6.3) designate new developmental releases.
Even numbered versions (such as 6.4) designate stable releases.
6.4.1 is a bug-fix release. See the VERSIONS file for details.
GLUT tarball
------------
Starting with 6.4, the GLUT library sources are distributed in a separate
tarball. This was done at the request of Linux distro vendors who prefer
to use freeglut.
Driver Status
---------------------- ----------------------
DRI drivers varies with the driver
XMesa (Xlib) implements OpenGL 1.5
OSMesa (off-screen) implements OpenGL 1.5
Windows/Win32 implements OpenGL 1.5
Glide (3dfx Voodoo1/2) requires updates
SVGA requires updates
DJGPP requires updates
GGI requires updates
BeOS requires updates
Allegro requires updates
D3D requires updates
The drivers which require updates mostly need to be updated to work
with the new gl_renderbuffer / gl_framebuffer infrastructure introduced
in Mesa 6.3.
----------------------------------------------------------------------
$Id: RELNOTES-6.4.1,v 3.1 2006/02/03 17:21:54 brianp Exp $

View File

@@ -1,47 +0,0 @@
Mesa 6.4.2 Release Notes
Introduction
------------
Mesa uses an even/odd version number scheme like the Linux kernel.
Odd numbered versions (such as 6.3) designate new developmental releases.
Even numbered versions (such as 6.4) designate stable releases.
6.4.2 is a minor bug-fix release. See the VERSIONS file for details.
GLUT tarball
------------
Starting with 6.4, the GLUT library sources are distributed in a separate
tarball. This was done at the request of Linux distro vendors who prefer
to use freeglut.
Driver Status
---------------------- ----------------------
DRI drivers varies with the driver
XMesa (Xlib) implements OpenGL 1.5
OSMesa (off-screen) implements OpenGL 1.5
Windows/Win32 implements OpenGL 1.5
Glide (3dfx Voodoo1/2) requires updates
SVGA requires updates
DJGPP requires updates
GGI requires updates
BeOS requires updates
Allegro requires updates
D3D requires updates
The drivers which require updates mostly need to be updated to work
with the new gl_renderbuffer / gl_framebuffer infrastructure introduced
in Mesa 6.3.
----------------------------------------------------------------------
$Id: RELNOTES-6.4.2,v 3.1 2006/02/03 17:21:54 brianp Exp $

View File

@@ -1,5 +1,7 @@
Mesa 6.5 Release Notes
Mesa 6.5 Release Notes
month, day, 2005
@@ -15,29 +17,23 @@ Even numbered versions (such as 6.4) designate stable releases.
New Features
------------
OpenGL Shading language support
This includes the GL_ARB_shader_objects, GL_ARB_shading_language_100,
GL_ARB_vertex_shader and GL_ARB_fragment_shader extensions. Most of
the work was done by Michal Krol.
There's probably a fair number of bugs since this is a pretty large,
complicated body of code.
GL_EXT_timer_query - used to get elapsed time information from the renderer.
The OpenGL 2.0 interface to these features will be implemented in a
future version of Mesa,
GL_EXT_timer_query
Used to measure the time of OpenGL operations at high precision.
Only supported in the software/Xlib driver at this time.
GL_EXT_packed_depth_stencil
Defines a new GL_DEPTH_STENCIL_EXT pixel format.
Driver Interface Changes
------------------------
GL_EXT_framebuffer_blit
A simplified glCopyPixels-like feature for copying pixel rectangles.
Stencil: The Driver.StencilOp/Func/Mask() functions have been replaced by
the two-sided versions: Driver.Stencil*Separate().
To Do
-----
Fix linux-glide target/driver.
Fix lambda calculation for frag progs.
GL_ARB_half_float_pixel
Adds a new half-precision floating point format for image transfers,
such as for glDrawPixels, glReadPixels, glTexImage, etc.
@@ -50,37 +46,18 @@ The following extensions have been removed:
Known Issues
------------
Rendering to depth textures will not work. Rendering to GL_DEPTH_STENCIL
textures should work.
Driver Interface Changes
------------------------
Stencil: The Driver.StencilOp/Func/Mask() functions have been replaced by
the two-sided versions: Driver.Stencil*Separate().
Render-to-texture: The functions for rendering to textures have changed.
To Do (someday) items
---------------------
Switch to freeglut
Increase MAX_DRAWBUFFERS
Fix linux-glide target/driver.
Fix lambda calculation for frag progs.
Driver Status
---------------------- ----------------------
DRI drivers varies with the driver
XMesa/GLX (on Xlib) implements OpenGL 1.5
XMesa (Xlib) implements OpenGL 1.5
OSMesa (off-screen) implements OpenGL 1.5
Glide (3dfx Voodoo1/2) implements OpenGL 1.3
SVGA implements OpenGL 1.3
@@ -94,4 +71,4 @@ D3D needs updating
----------------------------------------------------------------------
$Id: RELNOTES-6.5,v 3.4 2006/03/29 04:53:02 brianp Exp $
$Id: RELNOTES-6.5,v 3.1 2005/09/14 14:34:54 brianp Exp $

View File

@@ -1407,42 +1407,10 @@ Mesa Version History
- fragment programs that wrote result.depth.z didn't work
6.4.1 November 30, 2005
Bug fixes:
- redefining a vertex program string didn't take effect in TNL module
- fixed occasional segfault upon vertex/fragment parsing error
- vertex program LIT instruction didn't handle 0^0=1 correctly
- fragment program fog option didn't work with glDrawPixels, glBitmap
- USE_MGL_NAMESPACE didn't work for x86-64
- OSMesa demos were missing from previous release tarballs
- fixed problem with float->ushort conversion in glClear (bug 4992)
- popping of GL_EYE_PLANE texgen state was broken (bug 4996)
- popping of GL_SPOT_DIRECTION light state was broken (bug 5005)
- fixed occasional triangle color interpolation problem on VMS
- work around invalid free() call (bug 5131)
- fixed BSD X server compilation problem by including stdint.h
6.4.2 February 2, 2006
6.5 month, day, 2005
New:
- added OSMesaColorClamp() function/feature
- added wglGetExtensionStringARB() function
Bug fixes:
- fixed some problems when building on Windows
- GLw header files weren't installed by installmesa script (bug 5396)
- GL/glfbdev.h file was missing from tarballs
- fixed TNL initialization bug which could lead to crash (bug 5791)
6.5 March 31, 2006
New:
- OpenGL Shading Language support through GL_ARB_shader_objects,
GL_ARB_shading_language_100, GL_ARB_vertex_shader and
GL_ARB_fragment_shader (done by Michal Krol)
- GL_EXT_packed_depth_stencil extension
- GL_EXT_timer_query extension
- GL_EXT_framebuffer_blit extension
- GL_ARB_half_float_pixel
- reflect demo improved to support multiple windows
- singlebuffer demo (shows no/little-flicker single-buffered rendering)
- r200: enable GL_ARB_texture_env_crossbar, separate the texture
@@ -1452,21 +1420,8 @@ Mesa Version History
- radeon: add support for all 3 tmus, GL_ARB_texture_cube_map
and GL_EXT_fog_coord
- MESA_GLX_ALPHA_BITS env var for xlib driver
- many DRI driver updates (including screen rotation support
for the Intel DRI driver)
Changes:
- removed GL_HP_occlusion_test (use GL_ARB_occlusion_query instead)
- removed GL_SGIX/SGIS_pixel_texture extensions
Bug fixes:
- fixed glxcontextmodes.c datatype problem (bug 5835)
- fixed aix-gcc build/install bugs (bug 5874)
- fixed some bugs in texture env program generation
- glXCopyContext() didn't handle texture object bindings properly
- glXCopyContext() didn't copy all lighting state
- fixed FreeBSD config (Pedro Giffuni)
- fixed some minor framebuffer object bugs
- replaced dprintf() with _glu_printf() in GLU (bug 6244)
- fixed a number of thread safety bugs/regressions
- fixed a number of GLU tesselator bugs (John Shell, bug 6339)
- paletted texturing was broken w/ floating point palettes (K. Schultz)
- lots of assorted framebuffer object bug fixes

View File

@@ -40,14 +40,14 @@ Here are the basic instructions for Unix systems:
Version 1.9.28 is known to work.
<li>Login as an anonymous user:
<pre>
cvs -d:pserver:anonymous@anoncvs.freedesktop.org:/cvs/mesa login
cvs -d:pserver:anonymous@pdx.freedesktop.org:/cvs/mesa login
</pre>
Just press Enter/Return when prompted for a password.
<br>
<br>
<li>Check out the code:
<pre>
cvs -d:pserver:anonymous@anoncvs.freedesktop.org:/cvs/mesa co Mesa
cvs -d:pserver:anonymous@pdx.freedesktop.org:/cvs/mesa co Mesa
</pre>
</ol>
@@ -56,7 +56,7 @@ Here are the basic instructions for Unix systems:
<ol>
<li><code>cd Mesa</code>
<li><code>cvs -z3 -d:pserver:anonymous@anoncvs.freedesktop.org:/cvs/mesa update</code>
<li><code>cvs -z3 -d:pserver:anonymous@pdx.freedesktop.org:/cvs/mesa update</code>
</ol>
@@ -86,7 +86,7 @@ with:
</pre>
followed by:
<pre>
cvs -d:ext:yourusername@cvs.freedesktop.org:/cvs/mesa co Mesa
cvs -d:ext:yourusername@pdx.freedesktop.org:/cvs/mesa co Mesa
</pre>
<p>

View File

@@ -83,7 +83,7 @@ Brace example:
Here's the GNU indent command which will best approximate my preferred style:
</p>
<pre>
indent -br -i3 -npcs --no-tabs infile.c -o outfile.c
indent -br -i3 -npcs infile.c -o outfile.c
</pre>
@@ -145,7 +145,7 @@ DEMO_NAME are correct.
</p>
<p>
Update the docs/news.html file and docs/download.html files.
Update the docs/news.html file and docs/contents.html files.
</p>
<p>

View File

@@ -9,11 +9,11 @@
<H1>Downloading</H1>
<p>
Last development release: <b>6.5</b>
Last development release: <b>6.3.2</b>
</p>
<p>
Last stable release: <b>6.4.2</b>
Last stable release: <b>6.2.1</b>
</p>
<p>

View File

@@ -23,17 +23,16 @@ generate exceptions.
</ul>
<p>
The following are only applicable to the Xlib software driver.
See <A HREF="README.X11">README.X11</A> for details.
The following environment variables are only applicable to the Xlib/X11
software driver:
</p>
<ul>
<li>MESA_RGB_VISUAL - specifies the X visual and depth for RGB mode
<li>MESA_CI_VISUAL - specifies the X visual and depth for CI mode
<li>MESA_BACK_BUFFER - specifies how to implement the back color buffer,
either "pixmap" or "ximage"
<li>MESA_GAMMA - gamma correction coefficients for red, green, blue channels
<li>MESA_XSYNC - enable synchronous X behavior (for debugging only)
<li>MESA_GLX_FORCE_CI - if set, force GLX to treat 8bpp visuals as CI visuals
<li>MESA_RGB_VISUAL - specifies the X visual and depth for RGB mode (X only)
<li>MESA_CI_VISUAL - specifies the X visual and depth for CI mode (X only)
<li>MESA_BACK_BUFFER - specifies how to implement the back color buffer (X only)
<li>MESA_GAMMA - gamma correction coefficients (X only)
<li>MESA_XSYNC - enable synchronous X behavior (for X debugging only)
<li>MESA_GLX_FORCE_CI - if set, force GLX to treak 8bpp visuals as CI visuals
<li>MESA_GLX_FX - set to either "fullscreen" for full-screen rendering,
"window" to render into a window, or "disable" to disable the Glide driver.
<li>MESA_GLX_FORCE_ALPHA - if set, forces RGB windows to have an alpha channel.

View File

@@ -70,13 +70,13 @@ They're found in a module of the DRI CVS tree.
To obtain the code do the following:
</p>
<pre>
cvs -d:pserver:anonymous@anoncvs.freedesktop.org:/cvs/dri login
cvs -d:pserver:anonymous@pdx.freedesktop.org:/cvs/dri login
</pre>
<p>
Press Enter/Return when prompted for a password. Then,
</p>
<pre>
cvs -d:pserver:anonymous@anoncvs.freedesktop.org:/cvs/dri co drm
cvs -d:pserver:anonymous@pdx.freedesktop.org:/cvs/dri co drm
</pre>
<p>

View File

@@ -50,18 +50,26 @@ Rendering Manager) kernel drivers and header files.
They're available from the <a href="http://dri.sf.net/" target="_parent">DRI</a> project.
</p>
<p>
Your distribution should already have both the kernel modules and support
library already installed. If not, you can get them from CVS by doing:
You can get them from CVS by doing:
<pre>
cvs -z3 -d:pserver:anonymous@anoncvs.freedesktop.org:/cvs/dri co drm
cvs -d:pserver:anonymous@pds.freedesktop.org:/cvs/dri login
(hit enter when prompted for a password)
cvs -z3 -d:pserver:anonymous@pdx.freedesktop.org:/cvs/dri co drm
</pre>
<p>
See the <a href="http://dri.freedesktop.org/wiki/Building" target="_parent">
DRI Building Instructions</a> for the steps to build the DRM modules. Mesa
6.5 requires at least libdrm 2.0.1 or greater.
Make note of the directory in which the drm files are placed.
</p>
<p>
Build Mesa and the DRI drivers by running
See the <a href="http://dri.freedesktop.org/wiki/Building" target="_parent">
DRI Building Instructions</a> for the steps to build the DRM modules.
</p>
<p>
Next, in the <code>Mesa-x.y.z/configs/default</code> file, set the
<code>DRM_SOURCE_PATH</code> variable to indicate where the DRM files
are located.
</p>
<p>
Now build Mesa and the DRI drivers by running
</p>
<pre>
make linux-dri

View File

@@ -21,7 +21,7 @@
<li><a href="http://math.nist.gov/f90gl" target="_parent">Fortran77/90 bindings for OpenGL and Mesa</a> - by William Mitchell
<li><a href="http://glow.sourceforge.net/" target="_parent">GLOW</a> - a GUI toolkit for GLUT and OpenGL
<li><a href="http://www.nigels.com/glt/">Glt</a> - an OpenGL C++ toolkit
<li><a href="http://www.opengl.org/resources/libraries/glut.html" target="_parent">GLUT (GL Utility Toolkit)</a> - by Mark Kilgard
<li><a href="http://www.opengl.org/developers/documentation/glut/" target="_parent">GLUT (GL Utility Toolkit)</a> - by Mark Kilgard
<li><a href="http://atrey.karlin.mff.cuni.cz/%7E0rfelyus/guileGL/" target="_parent">GuileGL</a> - OpenGL and GtkGLArea language bindings for Guile
<li><a href="http://www.rsinc.com/" target="_parent">IDL</a> - Interactive Data Language
<li><a href="http://www.newplanetsoftware.com/jx/" target="_parent">JX</a> - C++ application framework and GUI library

View File

@@ -14,7 +14,7 @@
</li><li><a href="http://mesa3d.sourceforge.net/notfound.html">ARCAD</a> - CAD program
</li><li><a href="http://www.mediascape.com/" target="_parent">Artstream</a> - provides
functionality like Corel Draw and Illustrator
</li><li><a href="http://www.blender.org/" target="_parent">Blender</a> - 3-D animation
</li><li><a href="http://www.blender.nl/" target="_parent">Blender</a> - 3-D animation
software
</li><li><a href="http://www.arq.net/%7Ekasten/demtools/" target="_parent">Demtools</a>
- Map viewer

View File

@@ -11,122 +11,6 @@
<H1>News</H1>
<h2>March 31, 2006</h2>
<p>
Mesa 6.5 has been released. This is a new development release.
</p>
<pre>
New:
- OpenGL Shading Language support through GL_ARB_shader_objects,
GL_ARB_shading_language_100, GL_ARB_vertex_shader and
GL_ARB_fragment_shader (done by Michal Krol)
- GL_EXT_packed_depth_stencil extension
- GL_EXT_timer_query extension
- GL_EXT_framebuffer_blit extension
- GL_ARB_half_float_pixel
- GLX_MESA_copy_sub_buffer for DRI drivers (Dave Reveman)
- reflect demo improved to support multiple windows
- singlebuffer demo (shows no/little-flicker single-buffered rendering)
- r200: enable GL_ARB_texture_env_crossbar, separate the texture
sampling unit bits from the texture env combine enable bits
- r200: add support for GL_ATI_fragment_shader
- added fast XOR-mode line drawing optimization
- radeon: add support for all 3 tmus, GL_ARB_texture_cube_map
and GL_EXT_fog_coord
- MESA_GLX_ALPHA_BITS env var for xlib driver
- many DRI driver updates (including screen rotation support
for the Intel DRI driver)
Changes:
- removed GL_HP_occlusion_test (use GL_ARB_occlusion_query instead)
- removed GL_SGIX/SGIS_pixel_texture extensions
Bug fixes:
- fixed glxcontextmodes.c datatype problem (bug 5835)
- fixed aix-gcc build/install bugs (bug 5874)
- fixed some bugs in texture env program generation
- glXCopyContext() didn't handle texture object bindings properly
- glXCopyContext() didn't copy all lighting state
- fixed FreeBSD config (Pedro Giffuni)
- fixed some minor framebuffer object bugs
- replaced dprintf() with _glu_printf() in GLU (bug 6244)
- fixed a number of thread safety bugs/regressions
- fixed a number of GLU tesselator bugs (John Shell, bug 6339)
- paletted texturing was broken w/ floating point palettes (K. Schultz)
- lots of assorted framebuffer object bug fixes
</pre>
<p>
The MD5 checksums are:
</p>
<pre>
TBD
</pre>
<h2>February 2, 2006</h2>
<p>
Mesa 6.4.2 has been released. This is primarily a bug-fix release.
</p>
<pre>
New items:
- added OSMesaColorClamp() function/feature
- added wglGetExtensionStringARB() function
Bug fixes:
- fixed some problems when building on Windows
- GLw header files weren't installed by installmesa script (bug 5396)
- GL/glfbdev.h file was missing from tarballs
</pre>
<p>
The MD5 checksums are:
</p>
<pre>
cb0d745d520fa7c2bb9178058b763544 MesaLib-6.4.2.tar.gz
7674d2c603b5834259e4e5a820cefd5b MesaLib-6.4.2.tar.bz2
d224e1325b33ff71a0f3893fc6b4d594 MesaLib-6.4.2.zip
d4b345d4588fc750cd3d34f3ac26673e MesaDemos-6.4.2.tar.gz
9cae1ab874af533ce356bd7dfe2e0bb0 MesaDemos-6.4.2.tar.bz2
2da6e1d1245e441d27813595c6ba50de MesaDemos-6.4.2.zip
84427d18c3453f0ea52388eeba7169b5 MesaGLUT-6.4.2.tar.gz
b157ba8ad1ea63260cf5339132e7aac6 MesaGLUT-6.4.2.tar.bz2
fe1523744fc05edc3811dfc6a1bf4181 MesaGLUT-6.4.2.zip
</pre>
<h2>November 29, 2005</h2>
<p>
Mesa 6.4.1 has been released. This is a stable, bug-fix release.
</p>
<pre>
Bug fixes:
- redefining a vertex program string didn't take effect in TNL module
- fixed occasional segfault upon vertex/fragment parsing error
- vertex program LIT instruction didn't handle 0^0=1 correctly
- fragment program fog option didn't work with glDrawPixels, glBitmap
- USE_MGL_NAMESPACE didn't work for x86-64
- OSMesa demos were missing from previous release tarballs
- fixed problem with float->ushort conversion in glClear (bug 4992)
- popping of GL_EYE_PLANE texgen state was broken (bug 4996)
- popping of GL_SPOT_DIRECTION light state was broken (bug 5005)
- fixed occasional triangle color interpolation problem on VMS
- work around invalid free() call (bug 5131)
- fixed BSD X server compilation problem by including stdint.h
</pre>
<p>
The MD5 checksums are:
</p>
<pre>
698ceb574cf882b0226761f5913c0da9 MesaLib-6.4.1.tar.gz
ea148c828ec6f645526451db1b8556f1 MesaLib-6.4.1.tar.bz2
42e93279468975ed2bf3111b8721e5d9 MesaLib-6.4.1.zip
e3b0d50807fd2bdcd1a95aaddd786f13 MesaDemos-6.4.1.tar.gz
99df1fdcb98d391666b476ca6f1dda8a MesaDemos-6.4.1.tar.bz2
b999d2c6d92fb4b7740a3dbd889348e3 MesaDemos-6.4.1.zip
eadfe01fe5ddfb1eb8227dd567b31635 MesaGLUT-6.4.1.tar.gz
bd003bb4f981a4f91dee4c38644d4f3f MesaGLUT-6.4.1.tar.bz2
71c401c037088bf688a88afdaeb3420f MesaGLUT-6.4.1.zip
</pre>
<h2>October 24, 2005</h2>
<p>
Mesa 6.4 has been released. This is a stable, bug-fix release.
@@ -1218,6 +1102,6 @@ source code</a>.</p>
<hr>
$Id: news.html,v 3.27 2006/03/31 23:10:21 brianp Exp $
$Id: news.html,v 3.25 2005/10/24 23:33:27 brianp Exp $
</body>
</html>

View File

@@ -13,8 +13,6 @@ The release notes summarize what's new or changed in each Mesa release.
</p>
<UL>
<LI><A HREF="RELNOTES-6.4.2">RELNOTES-6.4.2</A>
<LI><A HREF="RELNOTES-6.4.1">RELNOTES-6.4.1</A>
<LI><A HREF="RELNOTES-6.4">RELNOTES-6.4</A>
<LI><A HREF="RELNOTES-6.3.2">RELNOTES-6.3.2</A>
<LI><A HREF="RELNOTES-6.3">RELNOTES-6.3</A>

View File

@@ -23,9 +23,9 @@
*/
/*
* DOS/DJGPP device driver for Mesa
* DOS/DJGPP device driver v1.7 for Mesa
*
* Author: Daniel Borca
* Copyright (C) 2002 - Daniel Borca
* Email : dborca@users.sourceforge.net
* Web : http://www.geocities.com/dborca
*/
@@ -35,7 +35,7 @@
#define DMESA_H_included
#define DMESA_MAJOR_VERSION 6
#define DMESA_MINOR_VERSION 5
#define DMESA_MINOR_VERSION 3
/* Sample Usage:
*
@@ -138,7 +138,7 @@ void DMesaSetCI (int ndx, GLfloat red, GLfloat green, GLfloat blue);
/*
* DMesa functions
*/
typedef void (*DMesaProc) ();
typedef void (*DMesaProc) (void);
DMesaProc DMesaGetProcAddress (const char *name);
/*
@@ -149,8 +149,8 @@ DMesaProc DMesaGetProcAddress (const char *name);
#define DMESA_GET_VIDEO_MODES 0x0300
#define DMESA_GET_BUFFER_ADDR 0x0400
#define DMESA_DRIVER_DBL_BIT 0x1 /* double-buffered */
#define DMESA_DRIVER_YUP_BIT 0x2 /* lower-left window origin */
#define DMESA_DRIVER_SWDB_BIT 0x1 /* software double-buffered */
#define DMESA_DRIVER_LLWO_BIT 0x2 /* lower-left window origin */
int DMesaGetIntegerv (GLenum pname, GLint *params);
#ifdef __cplusplus

View File

@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
* Version: 6.5
* Version: 6.3
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
* Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -2260,28 +2260,6 @@ typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pnam
#ifndef GL_EXT_framebuffer_blit
#define GL_EXT_framebuffer_blit 1
#define GL_READ_FRAMEBUFFER_EXT 0x8CA8
#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9
#define GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CA6
#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA
GLAPI void GLAPIENTRY
glBlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
GLbitfield mask, GLenum filter);
typedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC)
(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
GLbitfield mask, GLenum filter);
#endif /* GL_EXT_framebuffer_blit */
#ifndef GL_EXT_packed_depth_stencil
#define GL_EXT_packed_depth_stencil 1

View File

@@ -2,7 +2,7 @@
* Mesa 3-D graphics library
* Version: 6.5
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
* Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -379,60 +379,6 @@ extern Bool glXDrawableAttribARB(Display *dpy, GLXDrawable draw, const int *attr
#endif /* GLX_NV_float_buffer */
/*
* #?. GLX_MESA_swap_frame_usage
*/
#ifndef GLX_MESA_swap_frame_usage
#define GLX_MESA_swap_frame_usage 1
extern int glXGetFrameUsageMESA(Display *dpy, GLXDrawable drawable, float *usage);
extern int glXBeginFrameTrackingMESA(Display *dpy, GLXDrawable drawable);
extern int glXEndFrameTrackingMESA(Display *dpy, GLXDrawable drawable);
extern int glXQueryFrameTrackingMESA(Display *dpy, GLXDrawable drawable, int64_t *swapCount, int64_t *missedFrames, float *lastMissedUsage);
typedef int (*PFNGLXGETFRAMEUSAGEMESAPROC) (Display *dpy, GLXDrawable drawable, float *usage);
typedef int (*PFNGLXBEGINFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable);
typedef int (*PFNGLXENDFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable);
typedef int (*PFNGLXQUERYFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable, int64_t *swapCount, int64_t *missedFrames, float *lastMissedUsage);
#endif /* GLX_MESA_swap_frame_usage */
/*
* #?. GLX_MESA_swap_control
*/
#ifndef GLX_MESA_swap_control
#define GLX_MESA_swap_control 1
extern int glXSwapIntervalMESA(unsigned int interval);
extern int glXGetSwapIntervalMESA(void);
typedef int (*PFNGLXSWAPINTERVALMESAPROC)(unsigned int interval);
typedef int (*PFNGLXGETSWAPINTERVALMESAPROC)(void);
#endif /* GLX_MESA_swap_control */
/*
* #?. GLX_EXT_texture_from_pixmap
* XXX not finished?
*/
#ifndef GLX_EXT_texture_from_pixmap
#define GLX_EXT_texture_from_pixmap 1
/* XXX need enums/tokens! */
extern Bool glXBindTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer);
extern Bool glXReleaseTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer);
#endif /* GLX_EXT_texture_from_pixmap */
/*** Should these go here, or in another header? */
/*
** GLX Events

View File

@@ -331,7 +331,7 @@ typedef struct {
} GLXBufferClobberEventSGIX;
#endif
#if defined(__sun__) || defined(__osf__)
#if defined(__sun__)
#include <inttypes.h>
#if defined(__STDC__)
#if defined(__arch64__)

View File

@@ -472,14 +472,6 @@ struct __DRIdrawableRec {
* \since Internal API version 20030317.
*/
unsigned swap_interval;
/**
* Used by drivers that implement the GLX_MESA_copy_sub_buffer extension.
*
* \since Internal API version 20060314.
*/
void (*copySubBuffer)(__DRInativeDisplay *dpy, void *drawablePrivate,
int x, int y, int w, int h);
};
#endif

View File

@@ -111,15 +111,6 @@ WGLAPI int GLAPIENTRY DescribePixelFormat(HDC,int,unsigned int,LPPIXELFORMATDE
WGLAPI int GLAPIENTRY GetPixelFormat(HDC);
WGLAPI int GLAPIENTRY SetPixelFormat(HDC,int,const PIXELFORMATDESCRIPTOR *);
#ifndef WGL_ARB_extensions_string
#define WGL_ARB_extensions_string 1
WGLAPI const char * GLAPIENTRY wglGetExtensionsStringARB(HDC hdc);
#endif /* WGL_ARB_extensions_string */
#ifdef _MSC_VER
# pragma warning( pop )
#endif

View File

@@ -100,14 +100,15 @@ extern WMesaContext WMesaCreateContext(HDC hDC,HPALETTE* pPal,
/*
* Destroy a rendering context as returned by WMesaCreateContext()
*/
extern void WMesaDestroyContext( WMesaContext ctx );
/*extern void WMesaDestroyContext( WMesaContext ctx );*/
extern void WMesaDestroyContext( void );
/*
* Make the specified context the current one.
*/
extern void WMesaMakeCurrent( WMesaContext ctx, HDC hdc );
extern void WMesaMakeCurrent( WMesaContext ctx );
/*
@@ -120,7 +121,7 @@ extern WMesaContext WMesaGetCurrentContext( void );
* Swap the front and back buffers for the current context. No action
* taken if the context is not double buffered.
*/
extern void WMesaSwapBuffers(HDC hdc);
extern void WMesaSwapBuffers(void);
/*

View File

@@ -64,7 +64,6 @@ typedef XColor XMesaColor;
#define XMesaDrawPoint XDrawPoint
#define XMesaDrawPoints XDrawPoints
#define XMesaDrawLine XDrawLine
#define XMesaFillRectangle XFillRectangle
#define XMesaPutImage XPutImage
#define XMesaCopyArea XCopyArea

View File

@@ -95,18 +95,6 @@ do { \
(*gc->ops->PolyPoint)(__b, __gc, __m, __n, __p); \
} while (0)
#define XMesaDrawLine(__d, __b, __gc, __x0, __y0, __x1, __y1) \
do { \
XMesaPoint __p[2]; \
(void) __d; \
__p[0].x = __x0; \
__p[0].y = __y0; \
__p[1].x = __x1; \
__p[1].y = __y1; \
ValidateGC(__b, __gc); \
(*gc->ops->PolyLines)(__b, __gc, CoordModeOrigin, 2, __p); \
} while (0)
#define XMesaFillRectangle(__d,__b,__gc,__x,__y,__w,__h) \
do { \
xRectangle __r[1]; \

View File

@@ -64,7 +64,9 @@
** Versioning and extensions
*/
#define EGL_VERSION_1_0 1
#if 0
#define EGL_VERSION_1_1 1
#endif
/*
** Boolean
@@ -267,56 +269,6 @@ GLAPI EGLBoolean APIENTRY eglCopyContextMESA(EGLDisplay dpy, EGLContext source,
#endif /* EGL_MESA_copy_context */
/* XXX this is preliminary! */
#ifndef EGL_VERSION_1_2
#define EGL_VERSION_1_2 1
typedef int EGLenum;
typedef int EGLClientBuffer;
#define EGL_DISPLAY_SCALING 10000
#define EGL_UNKNOWN ((EGLint)-1)
#define EGL_OPENGL_ES_BIT 0x1
#define EGL_OPENVG_BIT 0x2
#define EGL_OPENGL_ES_API 0x30A0
#define EGL_OPENVG_API 0x30A1
#define EGL_LUMINANCE_SIZE 0x303D
#define EGL_ALPHA_MASK_SIZE 0x303E
#define EGL_COLOR_BUFFER_TYPE 0x303F
#define EGL_RENDERABLE_TYPE 0x3040
#define EGL_SINGLE_BUFFER 0x3085
#define EGL_RENDER_BUFFER 0x3086
#define EGL_COLORSPACE 0x3087
#define EGL_ALPHA_FORMAT 0x3088
#define EGL_COLORSPACE_sRGB 0x3089
#define EGL_COLORSPACE_LINEAR 0x308A
#define EGL_ALPHA_FORMAT_NONPRE 0x308B
#define EGL_ALPHA_FORMAT_PRE 0x308C
#define EGL_CLIENT_APIS 0x308D
#define EGL_RGB_BUFFER 0x308E
#define EGL_LUMINANCE_BUFFER 0x308F
#define EGL_HORIZONTAL_RESOLUTION 0x3090
#define EGL_VERTICAL_RESOLUTION 0x3091
#define EGL_PIXEL_ASPECT_RATIO 0x3092
#define EGL_SWAP_BEHAVIOR 0x3093
#define EGL_BUFFER_PRESERVED 0x3094
#define EGL_BUFFER_DESTROYED 0x3095
#define EGL_OPENVG_IMAGE 0x3096
#define EGL_CONTEXT_CLIENT_TYPE 0x3097
GLAPI EGLBoolean APIENTRY eglBindAPI(EGLenum api);
GLAPI EGLenum APIENTRY eglQueryAPI(void);
GLAPI EGLBoolean APIENTRY eglWaitClient(void);
GLAPI EGLBoolean APIENTRY eglReleaseThread(void);
GLAPI EGLSurface APIENTRY eglCreatePbufferFromClientBuffer(EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list);
#endif /* EGL_VERSION_1_2 */
#ifdef __cplusplus
}
#endif

View File

@@ -31,8 +31,6 @@ readtex.h
reflect
renormal
shadowtex
showbuffer.c
showbuffer.h
spectex
stex3d
teapot

View File

@@ -15,7 +15,6 @@ LIB_DEP = $(LIB_DIR)/$(GL_LIB_NAME) $(LIB_DIR)/$(GLU_LIB_NAME) $(LIB_DIR)/$(GLUT
PROGS = \
arbfplight \
arbfslight \
arbocclude \
bounce \
clearspd \
@@ -25,12 +24,11 @@ PROGS = \
fogcoord \
fplight \
gamma \
gearbox \
gears \
gearbox \
geartrain \
glinfo \
gloss \
glslnoise \
gltestperf \
glutfx \
isosurf \
@@ -76,9 +74,8 @@ PROGS = \
##### TARGETS #####
default: $(PROGS)
default: readtex.o $(PROGS)
$(PROGS): readtex.o
readtex.c: $(TOP)/progs/util/readtex.c
cp $< .

View File

@@ -1,118 +0,0 @@
# Mesa 3-D graphics library
# Version: 6.5
# Copyright (C) 1995-2006 Brian Paul
# Makefile for GLUT-based demo programs for Windows
# Build the Mesa and GLUT libraries by using the Visual Studio
# Workspaces in this distribution before running this Makefile.
# Invocation: nmake -f Makefile.win
NODEBUG=1
!include <win32.mak>
##### MACROS #####
TOP = ..\..
INCDIR = ..\..\include
LIBDIR = ..\..\lib
LIBS = GLUT32.LIB OPENGL32.LIB
all: OPENGL32.DLL GLU32.DLL GLUT32.DLL \
readtex.h readtex.c showbuffer.h showbuffer.c \
arbfplight.exe arbfslight.exe arbocclude.exe bounce.exe \
clearspd.exe cubemap.exe drawpix.exe fire.exe fogcoord.exe \
fplight.exe gamma.exe gearbox.exe \
gears.exe geartrain.exe gloss.exe \
glinfo.exe glslnoise.exe \
gltestperf.exe glutfx.exe ipers.exe isosurf.exe lodbias.exe \
morph3d.exe multiarb.exe occlude.exe paltex.exe pointblast.exe \
ray.exe readpix.exe reflect.exe renormal.exe \
shadowtex.exe singlebuffer.exe spectex.exe spriteblast.exe \
stex3d.exe teapot.exe terrain.exe tessdemo.exe texcyl.exe \
texdown.exe texenv.exe texobj.exe trispd.exe tunnel.exe tunnel2.exe \
winpos.exe
arbfplight.exe: arbfplight.obj
arbfslight.exe: arbfslight.obj
arbocclude.exe: arbocclude.obj
bounce.exe: bounce.obj
clearspd.exe: clearspd.obj
cubemap.exe: cubemap.obj readtex.obj
drawpix.exe: drawpix.obj readtex.obj
fire.exe: fire.obj readtex.obj
fogcoord.exe: fogcoord.obj readtex.obj
fplight.exe: fplight.obj
gamma.exe: gamma.obj
gearbox.exe: gearbox.obj
gears.exe: gears.obj
geartrain.exe: geartrain.obj
gloss.exe: gloss.obj readtex.obj
glinfo.exe: glinfo.obj
glslnoise.exe: glslnoise.obj
gltestperf.exe: gltestperf.obj
glutfx.exe: glutfx.obj
ipers.exe: ipers.obj readtex.obj
isosurf.exe: isosurf.obj readtex.obj
lodbias.exe: lodbias.obj readtex.obj
morph3d.exe: morph3d.obj
multiarb.exe: multiarb.obj readtex.obj
occlude.exe: occlude.obj
paltex.exe: paltex.obj
pointblast.exe: pointblast.obj
ray.exe: ray.obj
readpix.exe: readpix.obj readtex.obj
reflect.exe: reflect.obj readtex.obj showbuffer.obj
renormal.exe: renormal.obj
shadowtex.exe: shadowtex.obj showbuffer.obj
singlebuffer.exe: singlebuffer.obj
spectex.exe: spectex.obj
spriteblast.exe: spriteblast.obj
stex3d.exe: stex3d.obj
teapot.exe: teapot.obj readtex.obj
terrain.exe: terrain.obj
tessdemo.exe: tessdemo.obj
texcyl.exe: texcyl.obj readtex.obj
texdown.exe: texdown.obj
texenv.exe: texenv.obj
texobj.exe: texobj.obj
trispd.exe: trispd.obj
tunnel.exe: tunnel.obj readtex.obj
tunnel2.exe: tunnel2.obj readtex.obj
winpos.exe: winpos.obj readtex.obj
OPENGL32.DLL: $(LIBDIR)\OPENGL32.DLL
copy $? .
GLU32.DLL: $(LIBDIR)\GLU32.DLL
copy $? .
GLUT32.DLL: $(LIBDIR)\GLUT32.DLL
copy $? .
readtex.c: $(TOP)\progs\util\readtex.c
copy $** .
readtex.h: $(TOP)\progs\util\readtex.h
copy $** .
showbuffer.c: $(TOP)\progs\util\showbuffer.c
copy $** .
showbuffer.h: $(TOP)\progs\util\showbuffer.h
copy $** .
.obj.exe:
$(link) $(ldebug) -out:$@ $** /LIBPATH:$(LIBDIR) $(LIBS)
.c.obj:
$(cc) $(cdebug) $(cflags) $(cvars) /I$(INCDIR) $*.c
clean::
del *.obj *.exe readtex.* showbuffer.*
clobber::

View File

@@ -343,7 +343,7 @@ static void Init( void )
(const GLubyte *) vertProgramText);
glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorPos);
if (glGetError() != GL_NO_ERROR || errorPos != -1) {
int l = FindLine(vertProgramText, errorPos);
int l = FindLine(fragProgramText, errorPos);
printf("Vertex Program Error (pos=%d line=%d): %s\n", errorPos, l,
(char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
exit(0);

View File

@@ -1,289 +0,0 @@
/*
* Use GL_ARB_fragment_shader and GL_ARB_vertex_shader to implement
* simple per-pixel lighting.
*
* Michal Krol
* 20 February 2006
*
* Based on the original demo by:
* Brian Paul
* 17 April 2003
*/
#ifdef WIN32
#include <windows.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/glext.h>
#ifdef WIN32
#define GETPROCADDRESS wglGetProcAddress
#else
#define GETPROCADDRESS glutGetProcAddress
#endif
static GLfloat diffuse[4] = { 0.5f, 0.5f, 1.0f, 1.0f };
static GLfloat specular[4] = { 0.8f, 0.8f, 0.8f, 1.0f };
static GLfloat lightPos[4] = { 0.0f, 10.0f, 20.0f, 1.0f };
static GLfloat delta = 1.0f;
static GLhandleARB fragShader;
static GLhandleARB vertShader;
static GLhandleARB program;
static GLint uLightPos;
static GLint uDiffuse;
static GLint uSpecular;
static GLboolean anim = GL_TRUE;
static GLboolean wire = GL_FALSE;
static GLboolean pixelLight = GL_TRUE;
static GLint t0 = 0;
static GLint frames = 0;
static GLfloat xRot = 0.0f, yRot = 0.0f;
static PFNGLCREATESHADEROBJECTARBPROC glCreateShaderObjectARB = NULL;
static PFNGLSHADERSOURCEARBPROC glShaderSourceARB = NULL;
static PFNGLCOMPILESHADERARBPROC glCompileShaderARB = NULL;
static PFNGLCREATEPROGRAMOBJECTARBPROC glCreateProgramObjectARB = NULL;
static PFNGLATTACHOBJECTARBPROC glAttachObjectARB = NULL;
static PFNGLLINKPROGRAMARBPROC glLinkProgramARB = NULL;
static PFNGLUSEPROGRAMOBJECTARBPROC glUseProgramObjectARB = NULL;
static PFNGLGETUNIFORMLOCATIONARBPROC glGetUniformLocationARB = NULL;
static PFNGLUNIFORM4FVARBPROC glUniform4fvARB = NULL;
static void Redisplay (void)
{
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
if (pixelLight)
{
glUseProgramObjectARB (program);
glUniform4fvARB (uLightPos, 1, lightPos);
glDisable(GL_LIGHTING);
}
else
{
glUseProgramObjectARB (0);
glLightfv (GL_LIGHT0, GL_POSITION, lightPos);
glEnable(GL_LIGHTING);
}
glPushMatrix ();
glRotatef (xRot, 1.0f, 0.0f, 0.0f);
glRotatef (yRot, 0.0f, 1.0f, 0.0f);
glutSolidSphere (2.0, 10, 5);
glPopMatrix ();
glutSwapBuffers();
frames++;
if (anim)
{
GLint t = glutGet (GLUT_ELAPSED_TIME);
if (t - t0 >= 5000)
{
GLfloat seconds = (GLfloat) (t - t0) / 1000.0f;
GLfloat fps = frames / seconds;
printf ("%d frames in %6.3f seconds = %6.3f FPS\n", frames, seconds, fps);
t0 = t;
frames = 0;
}
}
}
static void Idle (void)
{
lightPos[0] += delta;
if (lightPos[0] > 25.0f || lightPos[0] < -25.0f)
delta = -delta;
glutPostRedisplay ();
}
static void Reshape (int width, int height)
{
glViewport (0, 0, width, height);
glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
glFrustum (-1.0, 1.0, -1.0, 1.0, 5.0, 25.0);
glMatrixMode (GL_MODELVIEW);
glLoadIdentity ();
glTranslatef (0.0f, 0.0f, -15.0f);
}
static void Key (unsigned char key, int x, int y)
{
(void) x;
(void) y;
switch (key)
{
case ' ':
case 'a':
anim = !anim;
if (anim)
glutIdleFunc (Idle);
else
glutIdleFunc (NULL);
break;
case 'x':
lightPos[0] -= 1.0f;
break;
case 'X':
lightPos[0] += 1.0f;
break;
case 'w':
wire = !wire;
if (wire)
glPolygonMode (GL_FRONT_AND_BACK, GL_LINE);
else
glPolygonMode (GL_FRONT_AND_BACK, GL_FILL);
break;
case 'p':
pixelLight = !pixelLight;
if (pixelLight)
printf ("Per-pixel lighting\n");
else
printf ("Conventional lighting\n");
break;
case 27:
exit(0);
break;
}
glutPostRedisplay ();
}
static void SpecialKey (int key, int x, int y)
{
const GLfloat step = 3.0f;
(void) x;
(void) y;
switch (key)
{
case GLUT_KEY_UP:
xRot -= step;
break;
case GLUT_KEY_DOWN:
xRot += step;
break;
case GLUT_KEY_LEFT:
yRot -= step;
break;
case GLUT_KEY_RIGHT:
yRot += step;
break;
}
glutPostRedisplay ();
}
static void Init (void)
{
static const char *fragShaderText =
"uniform vec4 lightPos;\n"
"uniform vec4 diffuse;\n"
"uniform vec4 specular;\n"
"void main () {\n"
" // Compute dot product of light direction and normal vector\n"
" float dotProd;\n"
" dotProd = clamp (dot (normalize (lightPos).xyz, normalize (gl_TexCoord[0]).xyz), 0.0, 1.0);\n"
" // Compute diffuse and specular contributions\n"
" gl_FragColor = diffuse * dotProd + specular * pow (dotProd, 20.0);\n"
"}\n"
;
static const char *vertShaderText =
"void main () {\n"
" gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n"
" gl_TexCoord[0] = vec4 (gl_NormalMatrix * gl_Normal, 1.0);\n"
"}\n"
;
if (!glutExtensionSupported ("GL_ARB_fragment_shader"))
{
printf ("Sorry, this demo requires GL_ARB_fragment_shader\n");
exit(1);
}
if (!glutExtensionSupported ("GL_ARB_shader_objects"))
{
printf ("Sorry, this demo requires GL_ARB_shader_objects\n");
exit(1);
}
if (!glutExtensionSupported ("GL_ARB_shading_language_100"))
{
printf ("Sorry, this demo requires GL_ARB_shading_language_100\n");
exit(1);
}
if (!glutExtensionSupported ("GL_ARB_vertex_shader"))
{
printf ("Sorry, this demo requires GL_ARB_vertex_shader\n");
exit(1);
}
glCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC) GETPROCADDRESS ("glCreateShaderObjectARB");
glShaderSourceARB = (PFNGLSHADERSOURCEARBPROC) GETPROCADDRESS ("glShaderSourceARB");
glCompileShaderARB = (PFNGLCOMPILESHADERARBPROC) GETPROCADDRESS ("glCompileShaderARB");
glCreateProgramObjectARB = (PFNGLCREATEPROGRAMOBJECTARBPROC) GETPROCADDRESS ("glCreateProgramObjectARB");
glAttachObjectARB = (PFNGLATTACHOBJECTARBPROC) GETPROCADDRESS ("glAttachObjectARB");
glLinkProgramARB = (PFNGLLINKPROGRAMARBPROC) GETPROCADDRESS ("glLinkProgramARB");
glUseProgramObjectARB = (PFNGLUSEPROGRAMOBJECTARBPROC) GETPROCADDRESS ("glUseProgramObjectARB");
glGetUniformLocationARB = (PFNGLGETUNIFORMLOCATIONARBPROC) GETPROCADDRESS ("glGetUniformLocationARB");
glUniform4fvARB = (PFNGLUNIFORM4FVARBPROC) GETPROCADDRESS ("glUniform4fvARB");
fragShader = glCreateShaderObjectARB (GL_FRAGMENT_SHADER_ARB);
glShaderSourceARB (fragShader, 1, &fragShaderText, NULL);
glCompileShaderARB (fragShader);
vertShader = glCreateShaderObjectARB (GL_VERTEX_SHADER_ARB);
glShaderSourceARB (vertShader, 1, &vertShaderText, NULL);
glCompileShaderARB (vertShader);
program = glCreateProgramObjectARB ();
glAttachObjectARB (program, fragShader);
glAttachObjectARB (program, vertShader);
glLinkProgramARB (program);
glUseProgramObjectARB (program);
uLightPos = glGetUniformLocationARB (program, "lightPos");
uDiffuse = glGetUniformLocationARB (program, "diffuse");
uSpecular = glGetUniformLocationARB (program, "specular");
glUniform4fvARB (uDiffuse, 1, diffuse);
glUniform4fvARB (uSpecular, 1, specular);
glClearColor (0.3f, 0.3f, 0.3f, 0.0f);
glEnable (GL_DEPTH_TEST);
glEnable (GL_LIGHT0);
glEnable (GL_LIGHTING);
glMaterialfv (GL_FRONT_AND_BACK, GL_DIFFUSE, diffuse);
glMaterialfv (GL_FRONT_AND_BACK, GL_SPECULAR, specular);
glMaterialf (GL_FRONT_AND_BACK, GL_SHININESS, 20.0f);
printf ("GL_RENDERER = %s\n", (const char *) glGetString (GL_RENDERER));
printf ("Press p to toggle between per-pixel and per-vertex lighting\n");
}
int main (int argc, char *argv[])
{
glutInit (&argc, argv);
glutInitWindowPosition ( 0, 0);
glutInitWindowSize (200, 200);
glutInitDisplayMode (GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow (argv[0]);
glutReshapeFunc (Reshape);
glutKeyboardFunc (Key);
glutSpecialFunc (SpecialKey);
glutDisplayFunc (Redisplay);
if (anim)
glutIdleFunc (Idle);
Init ();
glutMainLoop ();
return 0;
}

View File

@@ -14,6 +14,8 @@
#include <stdlib.h>
#include <string.h>
#include <GL/glut.h>
#include <sys/time.h>
#include <time.h>
#define COS(X) cos( (X) * 3.14159/180.0 )
#define SIN(X) sin( (X) * 3.14159/180.0 )

View File

@@ -18,7 +18,7 @@
static GLint WinWidth = 800, WinHeight = 500;
static GLint TexWidth, TexHeight;
static GLuint TexObj = 1;
static GLenum IntFormat = GL_RGB;
static GLenum IntFormat = GL_RGBA;
static GLboolean WireFrame = GL_FALSE;
@@ -325,9 +325,10 @@ idle(void)
dt = t - t0;
t0 = t;
/* fmod to prevent overflow */
GearRot = fmod(GearRot + 70.0 * dt, 360.0); /* 70 deg/sec */
CubeRot = fmod(CubeRot + 15.0 * dt, 360.0); /* 15 deg/sec */
GearRot += 70.0 * dt; /* 70 degrees per second */
GearRot = fmod(GearRot, 360.0); /* prevents eventual overflow */
CubeRot += 15.0 * dt;
glutPostRedisplay();
}

View File

@@ -236,7 +236,6 @@ static void SpecialKey( int key, int x, int y )
static void Init( int argc, char *argv[] )
{
GLboolean convolve = GL_FALSE;
GLboolean fullscreen = GL_FALSE;
int i;
for (i = 1; i < argc; i++) {
@@ -249,13 +248,8 @@ static void Init( int argc, char *argv[] )
else if (strcmp(argv[i], "-c")==0) {
convolve = GL_TRUE;
}
else if (strcmp(argv[i], "-f")==0) {
fullscreen = GL_TRUE;
}
}
if (fullscreen)
glutFullScreen();
/* Cylinder object */
{
@@ -427,8 +421,7 @@ int main( int argc, char *argv[] )
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
glutDisplayFunc( Display );
if (Animate)
glutIdleFunc( Idle );
glutIdleFunc( Idle );
glutCreateMenu(ModeMenu);
glutAddMenuEntry("Toggle Highlight", DO_SPEC_TEXTURE);

View File

@@ -1,185 +0,0 @@
/*
* GLSL noise demo.
*
* Michal Krol
* 20 February 2006
*
* Based on the original demo by:
* Stefan Gustavson (stegu@itn.liu.se) 2004, 2005
*/
#ifdef WIN32
#include <windows.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <GL/gl.h>
#include <GL/glut.h>
#include <GL/glext.h>
#ifdef WIN32
#define GETPROCADDRESS(F) wglGetProcAddress(F)
#else
#define GETPROCADDRESS(F) glutGetProcAddress(F)
#endif
static GLhandleARB fragShader;
static GLhandleARB vertShader;
static GLhandleARB program;
static GLint uTime;
static GLfloat u_time = 0.0f;
static PFNGLCREATESHADEROBJECTARBPROC glCreateShaderObjectARB = NULL;
static PFNGLSHADERSOURCEARBPROC glShaderSourceARB = NULL;
static PFNGLCOMPILESHADERARBPROC glCompileShaderARB = NULL;
static PFNGLCREATEPROGRAMOBJECTARBPROC glCreateProgramObjectARB = NULL;
static PFNGLATTACHOBJECTARBPROC glAttachObjectARB = NULL;
static PFNGLLINKPROGRAMARBPROC glLinkProgramARB = NULL;
static PFNGLUSEPROGRAMOBJECTARBPROC glUseProgramObjectARB = NULL;
static PFNGLGETUNIFORMLOCATIONARBPROC glGetUniformLocationARB = NULL;
static PFNGLUNIFORM1FARBPROC glUniform1fARB = NULL;
static void Redisplay (void)
{
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glUniform1fARB (uTime, u_time);
glPushMatrix ();
glutSolidSphere (2.0, 20, 10);
glPopMatrix ();
glutSwapBuffers();
}
static void Idle (void)
{
u_time += 0.1f;
glutPostRedisplay ();
}
static void Reshape (int width, int height)
{
glViewport (0, 0, width, height);
glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
glFrustum (-1.0, 1.0, -1.0, 1.0, 5.0, 25.0);
glMatrixMode (GL_MODELVIEW);
glLoadIdentity ();
glTranslatef (0.0f, 0.0f, -15.0f);
}
static void Key (unsigned char key, int x, int y)
{
(void) x;
(void) y;
switch (key)
{
case 27:
exit(0);
break;
}
glutPostRedisplay ();
}
static void Init (void)
{
static const char *fragShaderText =
"uniform float time;\n"
"void main () {\n"
" gl_FragColor = gl_Color * vec4 ((0.5 + 0.5 * vec3 (noise1 (\n"
" vec4 (4.0 * gl_TexCoord[0].xyz, 0.5 * time)))), 1.0);\n"
"}\n"
;
static const char *vertShaderText =
"void main () {\n"
" gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n"
" gl_TexCoord[0] = gl_Vertex;\n"
" gl_FrontColor = gl_Color;\n"
"}\n"
;
if (!glutExtensionSupported ("GL_ARB_fragment_shader"))
{
printf ("Sorry, this demo requires GL_ARB_fragment_shader\n");
exit(1);
}
if (!glutExtensionSupported ("GL_ARB_shader_objects"))
{
printf ("Sorry, this demo requires GL_ARB_shader_objects\n");
exit(1);
}
if (!glutExtensionSupported ("GL_ARB_shading_language_100"))
{
printf ("Sorry, this demo requires GL_ARB_shading_language_100\n");
exit(1);
}
if (!glutExtensionSupported ("GL_ARB_vertex_shader"))
{
printf ("Sorry, this demo requires GL_ARB_vertex_shader\n");
exit(1);
}
glCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC)
GETPROCADDRESS("glCreateShaderObjectARB");
glShaderSourceARB = (PFNGLSHADERSOURCEARBPROC)
GETPROCADDRESS("glShaderSourceARB");
glCompileShaderARB = (PFNGLCOMPILESHADERARBPROC)
GETPROCADDRESS("glCompileShaderARB");
glCreateProgramObjectARB = (PFNGLCREATEPROGRAMOBJECTARBPROC)
GETPROCADDRESS("glCreateProgramObjectARB");
glAttachObjectARB = (PFNGLATTACHOBJECTARBPROC)
GETPROCADDRESS("glAttachObjectARB");
glLinkProgramARB = (PFNGLLINKPROGRAMARBPROC)
GETPROCADDRESS ("glLinkProgramARB");
glUseProgramObjectARB = (PFNGLUSEPROGRAMOBJECTARBPROC)
GETPROCADDRESS("glUseProgramObjectARB");
glGetUniformLocationARB = (PFNGLGETUNIFORMLOCATIONARBPROC)
GETPROCADDRESS("glGetUniformLocationARB");
glUniform1fARB = (PFNGLUNIFORM1FARBPROC)
GETPROCADDRESS("glUniform1fARB");
fragShader = glCreateShaderObjectARB (GL_FRAGMENT_SHADER_ARB);
glShaderSourceARB (fragShader, 1, &fragShaderText, NULL);
glCompileShaderARB (fragShader);
vertShader = glCreateShaderObjectARB (GL_VERTEX_SHADER_ARB);
glShaderSourceARB (vertShader, 1, &vertShaderText, NULL);
glCompileShaderARB (vertShader);
program = glCreateProgramObjectARB ();
glAttachObjectARB (program, fragShader);
glAttachObjectARB (program, vertShader);
glLinkProgramARB (program);
glUseProgramObjectARB (program);
uTime = glGetUniformLocationARB (program, "time");
glClearColor (0.0f, 0.1f, 0.3f, 1.0f);
glEnable (GL_CULL_FACE);
glEnable (GL_DEPTH_TEST);
printf ("GL_RENDERER = %s\n", (const char *) glGetString (GL_RENDERER));
}
int main (int argc, char *argv[])
{
glutInit (&argc, argv);
glutInitWindowPosition ( 0, 0);
glutInitWindowSize (200, 200);
glutInitDisplayMode (GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow (argv[0]);
glutReshapeFunc (Reshape);
glutKeyboardFunc (Key);
glutDisplayFunc (Redisplay);
glutIdleFunc (Idle);
Init ();
glutMainLoop ();
return 0;
}

View File

@@ -42,9 +42,6 @@
#define INIT_WIDTH 400
#define INIT_HEIGHT 300
#ifdef _WIN32
#undef CreateWindowA
#endif
struct window {
int id; /* returned by glutCreateWindow() */
@@ -302,21 +299,11 @@ DrawWindow(void)
GLfloat dist = 20.0;
GLfloat eyex, eyey, eyez;
if (w->drawBuffer == GL_NONE) {
glDrawBuffer(GL_BACK);
glReadBuffer(GL_BACK);
}
else {
glDrawBuffer(w->drawBuffer);
glReadBuffer(w->drawBuffer);
}
glDrawBuffer(w->drawBuffer);
glReadBuffer(w->drawBuffer);
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
if (w->drawBuffer == GL_NONE) {
glDrawBuffer(GL_NONE);
}
eyex = dist * cos(w->yrot * DEG2RAD) * cos(w->xrot * DEG2RAD);
eyez = dist * sin(w->yrot * DEG2RAD) * cos(w->xrot * DEG2RAD);
eyey = dist * sin(w->xrot * DEG2RAD);
@@ -386,10 +373,10 @@ DrawWindow(void)
ShowAlphaBuffer(w->width, w->height);
}
if (w->drawBuffer == GL_FRONT)
glFinish();
else
if (w->drawBuffer == GL_BACK)
glutSwapBuffers();
else
glFinish();
/* calc/show frame rate */
{
@@ -470,10 +457,6 @@ Key(unsigned char key, int x, int y)
w->drawBuffer = GL_FRONT;
glutPostRedisplay();
break;
case '0':
w->drawBuffer = GL_NONE;
glutPostRedisplay();
break;
case ' ':
w->anim = !w->anim;
w->t0 = -1;

View File

@@ -41,6 +41,7 @@
#undef GL_ARB_shadow_ambient
#endif
#define DEG_TO_RAD (3.14159 / 180.0)
static GLint WindowWidth = 450, WindowHeight = 300;
@@ -66,7 +67,6 @@ static GLfloat Bias = -0.06;
static GLboolean Anim = GL_TRUE;
static GLboolean UsePackedDepthStencil = GL_FALSE;
static GLboolean HaveEXTshadowFuncs = GL_FALSE;
static GLint Operator = 0;
static const GLenum OperatorFunc[8] = {
@@ -266,7 +266,7 @@ Display(void)
0, 1, 0); /* up */
glViewport(0, 0, ShadowTexWidth, ShadowTexHeight);
glClear(GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
glClear(GL_DEPTH_BUFFER_BIT);
DrawScene();
/*
@@ -274,21 +274,9 @@ Display(void)
*/
if (DisplayMode == SHOW_DEPTH_MAPPING) {
/* load depth image as gray-scale luminance texture */
if (UsePackedDepthStencil) {
GLuint *depth = (GLuint *) malloc(ShadowTexWidth * ShadowTexHeight
* sizeof(GLuint));
assert(depth);
glReadPixels(0, 0, ShadowTexWidth, ShadowTexHeight,
GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT, depth);
glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE,
ShadowTexWidth, ShadowTexHeight, 0,
GL_LUMINANCE, GL_UNSIGNED_INT, depth);
free(depth);
}
else {
GLfloat *depth = (GLfloat *) malloc(ShadowTexWidth * ShadowTexHeight
* sizeof(GLfloat));
assert(depth);
GLfloat *depth = (GLfloat *) malloc(ShadowTexWidth * ShadowTexHeight
* sizeof(GLfloat));
if (depth) {
glReadPixels(0, 0, ShadowTexWidth, ShadowTexHeight,
GL_DEPTH_COMPONENT, GL_FLOAT, depth);
glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE,
@@ -299,18 +287,8 @@ Display(void)
}
else {
/* The normal shadow case */
if (UsePackedDepthStencil) {
GLint intFormat;
glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_STENCIL_EXT,
0, 0, ShadowTexWidth, ShadowTexHeight, 0);
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0,
GL_TEXTURE_INTERNAL_FORMAT, &intFormat);
assert(intFormat == GL_DEPTH_STENCIL_EXT);
}
else {
glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT,
0, 0, ShadowTexWidth, ShadowTexHeight, 0);
}
glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT,
0, 0, ShadowTexWidth, ShadowTexHeight, 0);
}
/*
@@ -469,17 +447,6 @@ Key(unsigned char key, int x, int y)
OperatorFunc[Operator]);
}
break;
case 'p':
UsePackedDepthStencil = !UsePackedDepthStencil;
if (UsePackedDepthStencil
&& !glutExtensionSupported("GL_EXT_packed_depth_stencil")) {
printf("Sorry, GL_EXT_packed_depth_stencil not supported\n");
UsePackedDepthStencil = GL_FALSE;
}
else {
printf("Use GL_DEPTH_STENCIL_EXT: %d\n", UsePackedDepthStencil);
}
break;
case 'z':
Zrot -= step;
break;
@@ -605,7 +572,6 @@ PrintHelp(void)
printf(" n = show normal, shadowed image\n");
printf(" f = toggle nearest/bilinear texture filtering\n");
printf(" b/B = decrease/increase shadow map Z bias\n");
printf(" p = toggle use of packed depth/stencil\n");
printf(" cursor keys = rotate scene\n");
printf(" <shift> + cursor keys = rotate light source\n");
if (HaveEXTshadowFuncs)
@@ -619,7 +585,7 @@ main(int argc, char *argv[])
glutInit(&argc, argv);
glutInitWindowPosition(0, 0);
glutInitWindowSize(WindowWidth, WindowHeight);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH | GLUT_STENCIL);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow(argv[0]);
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);

View File

@@ -116,6 +116,12 @@ TypeStr(GLenum type)
}
}
/* On x86, there is a performance cliff for memcpy to texture memory
* for sources below 64 byte alignment. We do our best with this in
* the driver, but it is better if the images are correctly aligned to
* start with:
*/
#define ALIGN (1<<7)
static void
MeasureDownloadRate(void)
@@ -128,13 +134,20 @@ MeasureDownloadRate(void)
int count;
int i;
texImage = (GLubyte *) malloc(bytes);
getImage = (GLubyte *) malloc(bytes);
texImage = (GLubyte *) malloc(bytes + ALIGN);
getImage = (GLubyte *) malloc(bytes + ALIGN);
if (!texImage || !getImage) {
DownloadRate = 0.0;
return;
}
texImage = (GLubyte *)((((unsigned)texImage) + ALIGN) & ~(ALIGN-1));
getImage = (GLubyte *)((((unsigned)getImage) + ALIGN) & ~(ALIGN-1));
for (i = 1; !(((unsigned)texImage) & i); i<<=1)
;
printf("texture image alignment: %d bytes\n", i);
for (i = 0; i < bytes; i++) {
texImage[i] = i & 0xff;
}
@@ -178,12 +191,15 @@ MeasureDownloadRate(void)
FormatTable[Format].Type, texImage);
}
#if 1
/* draw a tiny polygon to force texture into texram */
glBegin(GL_TRIANGLES);
glTexCoord2f(0, 0); glVertex2f(1, 1);
glTexCoord2f(1, 0); glVertex2f(3, 1);
glTexCoord2f(0.5, 1); glVertex2f(2, 3);
glEnd();
/* glFinish(); */
#endif
t1 = glutGet(GLUT_ELAPSED_TIME) * 0.001;
time = t1 - t0;
@@ -209,8 +225,8 @@ MeasureDownloadRate(void)
}
#endif
free(texImage);
free(getImage);
/* free(texImage); */
/* free(getImage); */
{
GLint err = glGetError();

View File

@@ -92,7 +92,7 @@ static void idle( void )
dt = t - t0;
t0 = t;
Angle += 120.0*dt;
glutPostRedisplay();
/* glutPostRedisplay(); */
}

View File

@@ -82,12 +82,60 @@ static void render_image( void )
glutSolidCone(1.0, 2.0, 16, 1);
glPopMatrix();
#ifdef GL_HP_occlusion_test
if (perf == 0) {
GLboolean bRet;
glDepthMask(GL_FALSE);
glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE);
glEnable(GL_OCCLUSION_TEST_HP);
glGetBooleanv(GL_OCCLUSION_TEST_RESULT_HP,&bRet);
glPushMatrix();
glTranslatef(0.75, 0.0, -1.0);
glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, blue_mat );
glutSolidSphere(1.0, 20, 20);
glPopMatrix();
glGetBooleanv(GL_OCCLUSION_TEST_RESULT_HP,&bRet);
printf("Occlusion test 1 (result should be 1): %d\n",bRet);
glDepthMask(GL_TRUE);
glColorMask(GL_TRUE,GL_TRUE,GL_TRUE,GL_TRUE);
glDisable(GL_OCCLUSION_TEST_HP);
}
#endif
glPushMatrix();
glTranslatef(0.75, 0.0, -1.0);
glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, blue_mat );
glutSolidSphere(1.0, 20, 20);
glPopMatrix();
#ifdef GL_HP_occlusion_test
if (perf == 0){
GLboolean bRet;
glDepthMask(GL_FALSE);
glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE);
glEnable(GL_OCCLUSION_TEST_HP);
glGetBooleanv(GL_OCCLUSION_TEST_RESULT_HP,&bRet);
/* draw a sphere inside the previous sphere */
glPushMatrix();
glTranslatef(0.75, 0.0, -1.0);
glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, blue_mat );
glutSolidSphere(0.5, 20, 20);
glPopMatrix();
glGetBooleanv(GL_OCCLUSION_TEST_RESULT_HP,&bRet);
printf("Occlusion test 2 (result should be 0): %d\n",bRet);
glDepthMask(GL_TRUE);
glColorMask(GL_TRUE,GL_TRUE,GL_TRUE,GL_TRUE);
glDisable(GL_OCCLUSION_TEST_HP);
}
#endif
glPopMatrix();
/* This is very important!!!

View File

@@ -10,14 +10,11 @@ include $(TOP)/configs/current
LIBS = $(APP_LIB_DEPS)
SOURCES = \
afsmultiarb.c \
antialias.c \
SOURCES = antialias.c \
arbfpspec.c \
arbfptest1.c \
arbfptexture.c \
arbfptrig.c \
arbnpot.c \
arbvptest1.c \
arbvptest3.c \
arbvptorus.c \
@@ -25,10 +22,8 @@ SOURCES = \
blendminmax.c \
blendsquare.c \
bufferobj.c \
bug_3050.c \
bug_3101.c \
bug_3195.c \
copypixrate.c \
crossbar.c \
cva.c \
dinoshade.c \
@@ -42,7 +37,6 @@ SOURCES = \
getprocaddress.c \
interleave.c \
invert.c \
jkrahntest.c \
manytex.c \
multipal.c \
no_s3tc.c \

View File

@@ -1,9 +1,13 @@
/*
* GL_ATI_fragment_shader test
* Roland Scheidegger
* GL_ARB_multitexture demo
*
* Command line options:
* -info print GL implementation information
*
*
* Brian Paul November 1998 This program is in the public domain.
* Modified on 12 Feb 2002 for > 2 texture units.
*/

View File

@@ -1,162 +0,0 @@
/*
* (C) Copyright IBM Corporation 2006
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* on the rights to use, copy, modify, merge, publish, distribute, sub
* license, and/or sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
* VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
* USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/**
* \file bug_3050.c
*
* Simple regression test for bug #3050. Create a texture and make a few
* calls to \c glGetTexLevelParameteriv. If the bug still exists, trying
* to get \c GL_TEXTURE_WITDH will cause a protocol error.
*
* This test \b only applies to indirect-rendering. This may mean that the
* test needs to be run with the environment variable \c LIBGL_ALWAYS_INDIRECT
* set to a non-zero value.
*
* \author Ian Romanick <idr@us.ibm.com>
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <GL/glut.h>
static int Width = 400;
static int Height = 200;
static const GLfloat Near = 5.0, Far = 25.0;
static void Display( void )
{
}
static void Reshape( int width, int height )
{
}
static void Key( unsigned char key, int x, int y )
{
(void) x;
(void) y;
switch (key) {
case 27:
exit(0);
break;
}
glutPostRedisplay();
}
static void Init( void )
{
unsigned i;
static const GLenum pnames[] = {
GL_TEXTURE_RED_SIZE,
GL_TEXTURE_GREEN_SIZE,
GL_TEXTURE_BLUE_SIZE,
GL_TEXTURE_ALPHA_SIZE,
GL_TEXTURE_LUMINANCE_SIZE,
GL_TEXTURE_INTENSITY_SIZE,
GL_TEXTURE_BORDER,
GL_TEXTURE_INTERNAL_FORMAT,
GL_TEXTURE_WIDTH,
GL_TEXTURE_HEIGHT,
GL_TEXTURE_DEPTH,
~0
};
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
printf("\nThis program should log some data about a texture and exit.\n");
printf("This is a regression test for bug #3050. If the bug still\n");
printf("exists, a GLX protocol error will be generated.\n");
printf("https://bugs.freedesktop.org/show_bug.cgi?id=3050\n\n");
if ( ! glutExtensionSupported( "GL_NV_texture_rectangle" )
&& ! glutExtensionSupported( "GL_EXT_texture_rectangle" )
&& ! glutExtensionSupported( "GL_ARB_texture_rectangle" ) ) {
printf( "This test requires one of GL_ARB_texture_rectangle, GL_EXT_texture_rectangle,\n"
"or GL_NV_texture_rectangle be supported\n." );
exit( 1 );
}
glBindTexture( GL_TEXTURE_RECTANGLE_NV, 1 );
glTexImage2D( GL_PROXY_TEXTURE_RECTANGLE_NV, 0, GL_RGBA, 8, 8, 0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL );
for ( i = 0 ; pnames[i] != ~0 ; i++ ) {
GLint param_i;
GLfloat param_f;
GLenum err;
glGetTexLevelParameteriv( GL_PROXY_TEXTURE_RECTANGLE_NV, 0, pnames[i], & param_i );
err = glGetError();
if ( err ) {
printf("glGetTexLevelParameteriv(GL_PROXY_TEXTURE_RECTANGLE_NV, 0, 0x%04x, & param) generated a GL\n"
"error of 0x%04x!",
pnames[i], err );
exit( 1 );
}
else {
printf("glGetTexLevelParameteriv(GL_PROXY_TEXTURE_RECTANGLE_NV, 0, 0x%04x, & param) = 0x%04x\n",
pnames[i], param_i );
}
glGetTexLevelParameterfv( GL_PROXY_TEXTURE_RECTANGLE_NV, 0, pnames[i], & param_f );
err = glGetError();
if ( err ) {
printf("glGetTexLevelParameterfv(GL_PROXY_TEXTURE_RECTANGLE_NV, 0, 0x%04x, & param) generated a GL\n"
"error of 0x%04x!\n",
pnames[i], err );
exit( 1 );
}
else {
printf("glGetTexLevelParameterfv(GL_PROXY_TEXTURE_RECTANGLE_NV, 0, 0x%04x, & param) = %.1f (0x%04x)\n",
pnames[i], param_f, (GLint) param_f );
}
}
}
int main( int argc, char *argv[] )
{
glutInit( &argc, argv );
glutInitWindowPosition( 0, 0 );
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow( "Bug #3050 Test" );
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
Init();
return 0;
}

View File

@@ -185,8 +185,8 @@ static void Init( void )
printf("\nThis program should function nearly identically to Mesa's lodbias demo.\n"
"It should cycle through the complet LOD bias range once and exit. If bug\n"
"#3195 still exists, the demo should crash almost immediatly.\n");
printf("This is a regression test for bug #3195.\n");
printf("https://bugs.freedesktop.org/show_bug.cgi?id=3195\n");
printf("This is a regression test for bug #3101.\n");
printf("https://bugs.freedesktop.org/show_bug.cgi?id=3101\n");
if (!glutExtensionSupported("GL_EXT_texture_lod_bias")) {
printf("Sorry, GL_EXT_texture_lod_bias not supported by this renderer.\n");

View File

@@ -1,259 +0,0 @@
/*
* Measure glCopyPixels speed
*
* Brian Paul
* 26 Jan 2006
*/
#define GL_GLEXT_PROTOTYPES
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <GL/glut.h>
static GLint WinWidth = 1000, WinHeight = 800;
static GLint ImgWidth, ImgHeight;
static GLenum Buffer = GL_FRONT;
static GLenum AlphaTest = GL_FALSE;
static GLboolean UseBlit = GL_FALSE;
static PFNGLBLITFRAMEBUFFEREXTPROC glBlitFramebufferEXT_func = NULL;
/**
* draw teapot in lower-left corner of window
*/
static void
DrawTestImage(void)
{
GLfloat ar;
ImgWidth = WinWidth / 3;
ImgHeight = WinHeight / 3;
glViewport(0, 0, ImgWidth, ImgHeight);
glScissor(0, 0, ImgWidth, ImgHeight);
glEnable(GL_SCISSOR_TEST);
glClearColor(0.5, 0.5, 0.5, 0.0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
ar = (float) WinWidth / WinHeight;
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-ar, ar, -1.0, 1.0, 5.0, 25.0);
glMatrixMode(GL_MODELVIEW);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
glEnable(GL_DEPTH_TEST);
glFrontFace(GL_CW);
glPushMatrix();
glRotatef(45, 1, 0, 0);
glutSolidTeapot(2.0);
glPopMatrix();
glFrontFace(GL_CCW);
glDisable(GL_DEPTH_TEST);
glDisable(GL_LIGHTING);
glDisable(GL_SCISSOR_TEST);
glViewport(0, 0, WinWidth, WinHeight);
glFinish();
}
static int
Rand(int max)
{
return ((int) random()) % max;
}
/**
* Measure glCopyPixels rate
*/
static void
RunTest(void)
{
double t1, t0 = glutGet(GLUT_ELAPSED_TIME) / 1000.0;
int iters = 0;
float copyRate, mbRate;
int r, g, b, a, bpp;
if (AlphaTest) {
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GREATER, 0.0);
}
glGetIntegerv(GL_RED_BITS, &r);
glGetIntegerv(GL_GREEN_BITS, &g);
glGetIntegerv(GL_BLUE_BITS, &b);
glGetIntegerv(GL_ALPHA_BITS, &a);
bpp = (r + g + b + a) / 8;
do {
int x, y;
x = Rand(WinWidth);
y = Rand(WinHeight);
if (x > ImgWidth || y > ImgHeight) {
#ifdef GL_EXT_framebuffer_blit
if (UseBlit)
{
glBlitFramebufferEXT_func(0, 0, ImgWidth, ImgHeight,
x, y, x + ImgWidth, y + ImgHeight,
GL_COLOR_BUFFER_BIT, GL_LINEAR);
}
else
#endif
{
glWindowPos2iARB(x, y);
glCopyPixels(0, 0, ImgWidth, ImgHeight, GL_COLOR);
}
glFinish(); /* XXX OK? */
iters++;
t1 = glutGet(GLUT_ELAPSED_TIME) / 1000.0;
}
} while (t1 - t0 < 5.0);
glDisable(GL_ALPHA_TEST);
copyRate = iters / (t1 - t0);
mbRate = ImgWidth * ImgHeight * bpp * copyRate / (1024 * 1024);
printf("Image size: %d x %d, %d Bpp\n", ImgWidth, ImgHeight, bpp);
printf("%d copies in %.2f = %.2f copies/sec, %.2f MB/s\n",
iters, t1-t0, copyRate, mbRate);
}
static void
Draw(void)
{
glClearColor(0.0, 0.0, 0.0, 0.0);
glClearColor(0.2, 0.2, 0.8, 0);
glReadBuffer(Buffer);
glDrawBuffer(Buffer);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
DrawTestImage();
RunTest();
if (Buffer == GL_FRONT)
glFinish();
else
glutSwapBuffers();
printf("exiting\n");
exit(0);
}
static void
Reshape(int width, int height)
{
glViewport(0, 0, width, height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0, 25.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(0.0, 0.0, -15.0);
}
static void
Key(unsigned char key, int x, int y)
{
(void) x;
(void) y;
switch (key) {
case 27:
exit(0);
break;
}
glutPostRedisplay();
}
static void
SpecialKey(int key, int x, int y)
{
(void) x;
(void) y;
switch (key) {
case GLUT_KEY_UP:
break;
case GLUT_KEY_DOWN:
break;
case GLUT_KEY_LEFT:
break;
case GLUT_KEY_RIGHT:
break;
}
glutPostRedisplay();
}
static void
ParseArgs(int argc, char *argv[])
{
int i;
for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "-back") == 0)
Buffer = GL_BACK;
else if (strcmp(argv[i], "-alpha") == 0)
AlphaTest = GL_TRUE;
else if (strcmp(argv[i], "-blit") == 0)
UseBlit = GL_TRUE;
}
}
static void
Init(void)
{
if (glutExtensionSupported("GL_EXT_framebuffer_blit")) {
glBlitFramebufferEXT_func = (PFNGLBLITFRAMEBUFFEREXTPROC)
glutGetProcAddress("glBlitFramebufferEXT");
}
else if (UseBlit) {
printf("Warning: GL_EXT_framebuffer_blit not supported.\n");
UseBlit = GL_FALSE;
}
}
int
main(int argc, char *argv[])
{
GLint mode = GLUT_RGB | GLUT_ALPHA | GLUT_DOUBLE | GLUT_DEPTH;
glutInit(&argc, argv);
ParseArgs(argc, argv);
if (AlphaTest)
mode |= GLUT_ALPHA;
glutInitWindowPosition(0, 0);
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(mode);
glutCreateWindow(argv[0]);
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
glutDisplayFunc(Draw);
printf("GL_RENDERER: %s\n", (char *) glGetString(GL_RENDERER));
printf("Draw Buffer: %s\n", (Buffer == GL_BACK) ? "Back" : "Front");
Init();
glutMainLoop();
return 0;
}

View File

@@ -17,26 +17,15 @@
#include <string.h>
#include <math.h>
/* For debug */
#define DEPTH 1
#define STENCIL 1
#define DRAW 1
static int Width = 400, Height = 400;
static GLenum TexTarget = GL_TEXTURE_2D; /*GL_TEXTURE_RECTANGLE_ARB;*/
static int TexWidth = 512, TexHeight = 512;
/*static int TexWidth = 600, TexHeight = 600;*/
static GLuint MyFB;
static GLuint TexObj;
static GLuint DepthRB, StencilRB;
static GLboolean Anim = GL_FALSE;
static GLfloat Rot = 0.0;
static GLboolean UsePackedDepthStencil = GL_FALSE;
static GLuint TextureLevel = 1; /* which texture level to render to */
static GLenum TexIntFormat = GL_RGB; /* either GL_RGB or GL_RGBA */
static void
@@ -52,7 +41,7 @@ CheckError(int line)
static void
Idle(void)
{
Rot = glutGet(GLUT_ELAPSED_TIME) * 0.1;
Rot = glutGet(GLUT_ELAPSED_TIME) * 0.05;
glutPostRedisplay();
}
@@ -60,6 +49,7 @@ Idle(void)
static void
RenderTexture(void)
{
GLint level = 0;
GLenum status;
glMatrixMode(GL_PROJECTION);
@@ -70,7 +60,10 @@ RenderTexture(void)
glTranslatef(0.0, 0.0, -15.0);
/* draw to texture image */
glBindTexture(GL_TEXTURE_2D, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
GL_TEXTURE_2D, TexObj, level);
status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
@@ -83,19 +76,13 @@ RenderTexture(void)
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
CheckError(__LINE__);
#if DEPTH
glEnable(GL_DEPTH_TEST);
#endif
#if STENCIL
glEnable(GL_STENCIL_TEST);
glStencilFunc(GL_NEVER, 1, ~0);
glStencilOp(GL_REPLACE, GL_KEEP, GL_REPLACE);
#endif
CheckError(__LINE__);
#if DEPTH || STENCIL
/* draw diamond-shaped stencil pattern */
glColor3f(0, 1, 0);
glBegin(GL_POLYGON);
@@ -104,13 +91,10 @@ RenderTexture(void)
glVertex2f( 0.2, 0.0);
glVertex2f( 0.0, 0.2);
glEnd();
#endif
/* draw teapot where stencil != 1 */
#if STENCIL
glStencilFunc(GL_NOTEQUAL, 1, ~0);
glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
#endif
CheckError(__LINE__);
@@ -131,18 +115,12 @@ RenderTexture(void)
glutSolidTeapot(0.5);
glPopMatrix();
glDisable(GL_LIGHTING);
/*
PrintStencilHistogram(TexWidth, TexHeight);
*/
#endif
glDisable(GL_DEPTH_TEST);
glDisable(GL_STENCIL_TEST);
#if DRAW
/* Bind normal framebuffer */
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
#endif
CheckError(__LINE__);
}
@@ -157,7 +135,7 @@ Display(void)
RenderTexture();
/* draw textured quad in the window */
#if DRAW
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-ar, ar, -1.0, 1.0, 5.0, 25.0);
@@ -172,38 +150,23 @@ Display(void)
glPushMatrix();
glRotatef(Rot, 0, 1, 0);
glEnable(TexTarget);
glBindTexture(TexTarget, TexObj);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, TexObj);
glBegin(GL_POLYGON);
glColor3f(0.25, 0.25, 0.25);
if (TexTarget == GL_TEXTURE_2D) {
glTexCoord2f(0, 0);
glVertex2f(-1, -1);
glTexCoord2f(1, 0);
glVertex2f(1, -1);
glColor3f(1.0, 1.0, 1.0);
glTexCoord2f(1, 1);
glVertex2f(1, 1);
glTexCoord2f(0, 1);
glVertex2f(-1, 1);
}
else {
assert(TexTarget == GL_TEXTURE_RECTANGLE_ARB);
glTexCoord2f(0, 0);
glVertex2f(-1, -1);
glTexCoord2f(TexWidth, 0);
glVertex2f(1, -1);
glColor3f(1.0, 1.0, 1.0);
glTexCoord2f(TexWidth, TexHeight);
glVertex2f(1, 1);
glTexCoord2f(0, TexHeight);
glVertex2f(-1, 1);
}
glTexCoord2f(0, 0);
glVertex2f(-1, -1);
glTexCoord2f(1, 0);
glVertex2f(1, -1);
glColor3f(1.0, 1.0, 1.0);
glTexCoord2f(1, 1);
glVertex2f(1, 1);
glTexCoord2f(0, 1);
glVertex2f(-1, 1);
glEnd();
glPopMatrix();
glDisable(TexTarget);
#endif
glDisable(GL_TEXTURE_2D);
glutSwapBuffers();
CheckError(__LINE__);
}
@@ -221,13 +184,9 @@ Reshape(int width, int height)
static void
CleanUp(void)
{
#if DEPTH
glDeleteRenderbuffersEXT(1, &DepthRB);
#endif
#if STENCIL
if (!UsePackedDepthStencil)
glDeleteRenderbuffersEXT(1, &StencilRB);
#endif
glDeleteFramebuffersEXT(1, &MyFB);
glDeleteTextures(1, &TexObj);
@@ -263,7 +222,6 @@ Key(unsigned char key, int x, int y)
static void
Init(int argc, char *argv[])
{
static const GLfloat mat[4] = { 1.0, 0.5, 0.5, 1.0 };
GLint i;
if (!glutExtensionSupported("GL_EXT_framebuffer_object")) {
@@ -295,31 +253,6 @@ Init(int argc, char *argv[])
glGetIntegerv(GL_FRAMEBUFFER_BINDING_EXT, &i);
assert(i == MyFB);
/* Make texture object/image */
glGenTextures(1, &TexObj);
glBindTexture(TexTarget, TexObj);
/* make two image levels */
glTexImage2D(TexTarget, 0, TexIntFormat, TexWidth, TexHeight, 0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
glTexImage2D(TexTarget, 1, TexIntFormat, TexWidth/2, TexHeight/2, 0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
TexWidth = TexWidth >> TextureLevel;
TexHeight = TexHeight >> TextureLevel;
glTexParameteri(TexTarget, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(TexTarget, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glTexParameteri(TexTarget, GL_TEXTURE_BASE_LEVEL, TextureLevel);
glTexParameteri(TexTarget, GL_TEXTURE_MAX_LEVEL, TextureLevel);
CheckError(__LINE__);
/* Render color to texture */
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
TexTarget, TexObj, TextureLevel);
#if DEPTH
/* make depth renderbuffer */
glGenRenderbuffersEXT(1, &DepthRB);
assert(DepthRB);
@@ -342,11 +275,9 @@ Init(int argc, char *argv[])
/* attach DepthRB to MyFB */
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
GL_RENDERBUFFER_EXT, DepthRB);
#endif
CheckError(__LINE__);
#if STENCIL
if (UsePackedDepthStencil) {
/* DepthRb is a combined depth/stencil renderbuffer */
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT,
@@ -372,16 +303,23 @@ Init(int argc, char *argv[])
CheckError(__LINE__);
printf("Stencil renderbuffer size = %d bits\n", i);
assert(i > 0);
#endif
CheckError(__LINE__);
/* bind regular framebuffer */
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
CheckError(__LINE__);
/* lighting */
glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, mat);
/* Make texture object/image */
glGenTextures(1, &TexObj);
glBindTexture(GL_TEXTURE_2D, TexObj);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, TexWidth, TexHeight, 0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
CheckError(__LINE__);
}

View File

@@ -1,4 +1,4 @@
/* $Id: jkrahntest.c,v 1.2 2006/01/30 17:12:10 brianp Exp $ */
/* $Id: jkrahntest.c,v 1.1 2002/06/16 03:57:48 brianp Exp $ */
/* This is a good test for glXSwapBuffers on non-current windows,
* and the glXCopyContext function. Fixed several Mesa/DRI bugs with
@@ -25,11 +25,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <math.h>
#ifndef M_PI
#define M_PI 3.14159
#endif
#define DEGTOR (M_PI/180.0)
static int AttributeList[] = { GLX_RGBA, GLX_DOUBLEBUFFER, None };

View File

@@ -17,8 +17,8 @@ static GLint TexWidth = 512, TexHeight = 512;
static GLuint TexObj = 1;
static GLenum IntFormat = GL_RGBA8;
static GLenum ReadFormat = GL_RGBA; /* for glReadPixels */
static GLenum IntFormat = GL_RGBA;
static GLenum ReadFormat = GL_BGRA; /* for glReadPixels */
static GLboolean DrawQuad = GL_TRUE;
@@ -242,12 +242,14 @@ Draw(void)
glutSwapBuffers();
}
RunTest(GL_FALSE, GL_FALSE);
RunTest(GL_FALSE, GL_TRUE);
RunTest(GL_TRUE, GL_FALSE);
RunTest(GL_TRUE, GL_TRUE);
/* RunTest(GL_FALSE, GL_FALSE); */
/* RunTest(GL_FALSE, GL_TRUE); */
while (1) {
RunTest(GL_TRUE, GL_FALSE);
RunTest(GL_TRUE, GL_TRUE);
glutSwapBuffers();
glutSwapBuffers();
}
printf("exiting\n");
exit(0);

View File

@@ -97,7 +97,7 @@ static rawImageRec *RawImageOpen(const char *fileName)
swapFlag = GL_FALSE;
}
raw = (rawImageRec *)calloc(1, sizeof(rawImageRec));
raw = (rawImageRec *)malloc(sizeof(rawImageRec));
if (raw == NULL) {
fprintf(stderr, "Out of memory!\n");
return NULL;
@@ -148,15 +148,12 @@ static rawImageRec *RawImageOpen(const char *fileName)
static void RawImageClose(rawImageRec *raw)
{
fclose(raw->file);
free(raw->tmp);
free(raw->tmpR);
free(raw->tmpG);
free(raw->tmpB);
if (raw->rowStart)
free(raw->rowStart);
if (raw->rowSize)
free(raw->rowSize);
if (raw->sizeZ>3) {
free(raw->tmpA);
}

View File

@@ -23,7 +23,6 @@
/*
* This program tests GLX thread safety.
* Command line options:
* -p Open a display connection for each thread
* -n <num threads> Number of threads to create (default is 2)
* -display <display name> Specify X display (default is :0.0)
*
@@ -33,7 +32,6 @@
#if defined(PTHREADS) /* defined by Mesa on Linux and other platforms */
#include <assert.h>
#include <GL/gl.h>
#include <GL/glx.h>
#include <stdio.h>
@@ -63,10 +61,6 @@ static struct winthread WinThreads[MAX_WINTHREADS];
static int NumWinThreads = 0;
static volatile GLboolean ExitFlag = GL_FALSE;
static GLboolean MultiDisplays = 0;
static GLboolean Locking = 0;
static pthread_mutex_t Mutex;
static void
@@ -151,22 +145,9 @@ resize(struct winthread *wt, int w, int h)
static void
draw_loop(struct winthread *wt)
{
GLboolean firstIter = GL_TRUE;
while (!ExitFlag) {
if (Locking)
pthread_mutex_lock(&Mutex);
glXMakeCurrent(wt->Dpy, wt->Win, wt->Context);
if (firstIter) {
printf("glthreads: %d: GL_RENDERER = %s\n", wt->Index,
(char *) glGetString(GL_RENDERER));
firstIter = GL_FALSE;
}
if (Locking)
pthread_mutex_unlock(&Mutex);
glEnable(GL_DEPTH_TEST);
@@ -191,15 +172,8 @@ draw_loop(struct winthread *wt)
draw_object();
glPopMatrix();
if (Locking)
pthread_mutex_lock(&Mutex);
glXSwapBuffers(wt->Dpy, wt->Win);
if (Locking)
pthread_mutex_unlock(&Mutex);
usleep(5000);
wt->Angle += 1.0;
}
}
@@ -207,7 +181,6 @@ draw_loop(struct winthread *wt)
/*
* The main process thread runs this loop.
* Single display connection for all threads.
*/
static void
event_loop(Display *dpy)
@@ -215,28 +188,8 @@ event_loop(Display *dpy)
XEvent event;
int i;
assert(!MultiDisplays);
while (!ExitFlag) {
if (Locking) {
while (1) {
int k;
pthread_mutex_lock(&Mutex);
k = XPending(dpy);
if (k) {
XNextEvent(dpy, &event);
pthread_mutex_unlock(&Mutex);
break;
}
pthread_mutex_unlock(&Mutex);
usleep(5000);
}
}
else {
XNextEvent(dpy, &event);
}
XNextEvent(dpy, &event);
switch (event.type) {
case ConfigureNotify:
/* Find winthread for this event's window */
@@ -261,41 +214,6 @@ event_loop(Display *dpy)
}
/*
* Separate display connection for each thread.
*/
static void
event_loop_multi(void)
{
XEvent event;
int w = 0;
assert(MultiDisplays);
while (!ExitFlag) {
struct winthread *wt = &WinThreads[w];
if (XPending(wt->Dpy)) {
XNextEvent(wt->Dpy, &event);
switch (event.type) {
case ConfigureNotify:
resize(wt, event.xconfigure.width, event.xconfigure.height);
break;
case KeyPress:
/* tell all threads to exit */
ExitFlag = GL_TRUE;
/*printf("exit draw_loop %d\n", wt->Index);*/
return;
default:
/*no-op*/ ;
}
}
w = (w + 1) % NumWinThreads;
usleep(5000);
}
}
/*
* we'll call this once for each thread, before the threads are created.
*/
@@ -411,14 +329,14 @@ main(int argc, char *argv[])
{
char *displayName = ":0.0";
int numThreads = 2;
Display *dpy = NULL;
Display *dpy;
int i;
Status threadStat;
if (argc == 1) {
printf("glthreads: test of GL thread safety (any key = exit)\n");
printf("threadgl: test of GL thread safety (any key = exit)\n");
printf("Usage:\n");
printf(" glthreads [-display dpyName] [-n numthreads]\n");
printf(" threadgl [-display dpyName] [-n numthreads]\n");
}
else {
int i;
@@ -427,12 +345,6 @@ main(int argc, char *argv[])
displayName = argv[i + 1];
i++;
}
else if (strcmp(argv[i], "-p") == 0) {
MultiDisplays = 1;
}
else if (strcmp(argv[i], "-l") == 0) {
Locking = 1;
}
else if (strcmp(argv[i], "-n") == 0 && i + 1 < argc) {
numThreads = atoi(argv[i + 1]);
if (numThreads < 1)
@@ -441,88 +353,48 @@ main(int argc, char *argv[])
numThreads = MAX_WINTHREADS;
i++;
}
else {
fprintf(stderr, "glthreads: unexpected flag: %s\n", argv[i]);
}
}
}
if (Locking)
printf("glthreads: Using explict locks around Xlib calls.\n");
else
printf("glthreads: No explict locking.\n");
if (MultiDisplays)
printf("glthreads: Per-thread display connections.\n");
else
printf("glthreads: Single display connection.\n");
/*
* VERY IMPORTANT: call XInitThreads() before any other Xlib functions.
*/
if (!MultiDisplays) {
if (!Locking) {
threadStat = XInitThreads();
if (threadStat) {
printf("XInitThreads() returned %d (success)\n", (int) threadStat);
}
else {
printf("XInitThreads() returned 0 (failure- this program may fail)\n");
}
}
dpy = XOpenDisplay(displayName);
if (!dpy) {
fprintf(stderr, "Unable to open display %s\n", displayName);
return -1;
}
threadStat = XInitThreads();
if (threadStat) {
printf("XInitThreads() returned %d (success)\n", (int) threadStat);
}
else {
printf("XInitThreads() returned 0 (failure- this program may fail)\n");
}
if (Locking) {
pthread_mutex_init(&Mutex, NULL);
}
printf("glthreads: creating windows\n");
dpy = XOpenDisplay(displayName);
if (!dpy) {
fprintf(stderr, "Unable to open display %s\n", displayName);
return -1;
}
NumWinThreads = numThreads;
/* Create the GLX windows and contexts */
for (i = 0; i < numThreads; i++) {
if (MultiDisplays) {
WinThreads[i].Dpy = XOpenDisplay(displayName);
assert(WinThreads[i].Dpy);
}
else {
WinThreads[i].Dpy = dpy;
}
WinThreads[i].Dpy = dpy;
WinThreads[i].Index = i;
create_window(&WinThreads[i]);
}
printf("glthreads: creating threads\n");
/* Create the threads */
for (i = 0; i < numThreads; i++) {
pthread_create(&WinThreads[i].Thread, NULL, thread_function,
(void*) &WinThreads[i]);
printf("glthreads: Created thread %u\n", (unsigned int) WinThreads[i].Thread);
printf("Created Thread %d\n", (int) WinThreads[i].Thread);
}
if (MultiDisplays)
event_loop_multi();
else
event_loop(dpy);
event_loop(dpy);
clean_up();
if (MultiDisplays) {
for (i = 0; i < numThreads; i++) {
XCloseDisplay(WinThreads[i].Dpy);
}
}
else {
XCloseDisplay(dpy);
}
XCloseDisplay(dpy);
return 0;
}

View File

@@ -262,7 +262,6 @@ print_screen_info(Display *dpy, int scrnum, Bool allowDirect, GLboolean limits)
ctx = glXCreateContext( dpy, visinfo, NULL, allowDirect );
if (!ctx) {
fprintf(stderr, "Error: glXCreateContext failed\n");
XFree(visinfo);
XDestroyWindow(dpy, win);
return;
}
@@ -337,7 +336,6 @@ print_screen_info(Display *dpy, int scrnum, Bool allowDirect, GLboolean limits)
}
glXDestroyContext(dpy, ctx);
XFree(visinfo);
XDestroyWindow(dpy, win);
}

View File

@@ -31,7 +31,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "eglcontext.h"
#include "egldisplay.h"
@@ -347,7 +346,6 @@ void (* APIENTRY eglGetProcAddress(const char *procname))()
{ "eglWaitGL", (_EGLProc) eglWaitGL },
{ "eglWaitNative", (_EGLProc) eglWaitNative },
/* Extensions */
#ifdef EGL_MESA_screen_surface
{ "eglChooseModeMESA", (_EGLProc) eglChooseModeMESA },
{ "eglGetModesMESA", (_EGLProc) eglGetModesMESA },
{ "eglGetModeAttribMESA", (_EGLProc) eglGetModeAttribMESA },
@@ -360,14 +358,6 @@ void (* APIENTRY eglGetProcAddress(const char *procname))()
{ "eglQueryScreenSurfaceMESA", (_EGLProc) eglQueryScreenSurfaceMESA },
{ "eglQueryScreenModeMESA", (_EGLProc) eglQueryScreenModeMESA },
{ "eglQueryModeStringMESA", (_EGLProc) eglQueryModeStringMESA },
#endif /* EGL_MESA_screen_surface */
#ifdef EGL_VERSION_1_2
{ "eglBindAPI", (_EGLProc) eglBindAPI },
{ "eglCreatePbufferFromClientBuffer", (_EGLProc) eglCreatePbufferFromClientBuffer },
{ "eglQueryAPI", (_EGLProc) eglQueryAPI },
{ "eglReleaseThread", (_EGLProc) eglReleaseThread },
{ "eglWaitClient", (_EGLProc) eglWaitClient },
#endif /* EGL_VERSION_1_2 */
{ NULL, NULL }
};
EGLint i;
@@ -502,85 +492,6 @@ eglQueryModeStringMESA(EGLDisplay dpy, EGLModeMESA mode)
}
/**
** EGL 1.2
**/
#ifdef EGL_VERSION_1_2
EGLBoolean
eglBindAPI(EGLenum api)
{
_EGLThreadInfo *t = _eglGetCurrentThread();
switch (api) {
case EGL_OPENGL_ES_API:
if (_eglGlobal.OpenGLESAPISupported) {
t->CurrentAPI = api;
return EGL_TRUE;
}
_eglError(EGL_BAD_PARAMETER, "eglBindAPI");
return EGL_FALSE;
case EGL_OPENVG_API:
if (_eglGlobal.OpenVGAPISupported) {
t->CurrentAPI = api;
return EGL_TRUE;
}
_eglError(EGL_BAD_PARAMETER, "eglBindAPI");
return EGL_FALSE;
default:
return EGL_FALSE;
}
return EGL_TRUE;
}
EGLSurface
eglCreatePbufferFromClientBuffer(EGLDisplay dpy, EGLenum buftype,
EGLClientBuffer buffer, EGLConfig config,
const EGLint *attrib_list)
{
_EGLDriver *drv = _eglLookupDriver(dpy);
return drv->API.CreatePbufferFromClientBuffer(drv, dpy, buftype, buffer,
config, attrib_list);
}
EGLenum
eglQueryAPI(void)
{
/* returns one of EGL_OPENGL_ES_API or EGL_OPENVG_API */
_EGLThreadInfo *t = _eglGetCurrentThread();
return t->CurrentAPI;
}
EGLBoolean
eglReleaseThread(void)
{
_EGLThreadInfo *t = _eglGetCurrentThread();
EGLDisplay dpy = eglGetCurrentDisplay();
if (dpy) {
_EGLDriver *drv = _eglLookupDriver(dpy);
/* unbind context */
(void) drv->API.MakeCurrent(drv, dpy, EGL_NO_SURFACE,
EGL_NO_SURFACE, EGL_NO_CONTEXT);
}
_eglDeleteThreadData(t);
return EGL_TRUE;
}
EGLBoolean
eglWaitClient(void)
{
EGLDisplay dpy = eglGetCurrentDisplay();
if (dpy != EGL_NO_DISPLAY) {
_EGLDriver *drv = _eglLookupDriver(dpy);
return drv->API.WaitClient(drv, dpy);
}
else
return EGL_FALSE;
}
#endif /* EGL_VERSION_1_2 */

View File

@@ -40,7 +40,7 @@ typedef EGLBoolean (*WaitGL_t)(_EGLDriver *drv, EGLDisplay dpy);
typedef EGLBoolean (*WaitNative_t)(_EGLDriver *drv, EGLDisplay dpy, EGLint engine);
#ifdef EGL_MESA_screen_surface
/* EGL_MESA_screen extension */
typedef EGLBoolean (*ChooseModeMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, const EGLint *attrib_list, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes);
typedef EGLBoolean (*GetModesMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *modes, EGLint mode_size, EGLint *num_mode);
typedef EGLBoolean (*GetModeAttribMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLModeMESA mode, EGLint attribute, EGLint *value);
@@ -53,14 +53,6 @@ typedef EGLBoolean (*QueryScreenMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScre
typedef EGLBoolean (*QueryScreenSurfaceMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLSurface *surface);
typedef EGLBoolean (*QueryScreenModeMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *mode);
typedef const char * (*QueryModeStringMESA_t)(_EGLDriver *drv, EGLDisplay dpy, EGLModeMESA mode);
#endif /* EGL_MESA_screen_surface */
#ifdef EGL_VERSION_1_2
typedef EGLBoolean (*WaitClient_t)(_EGLDriver *drv, EGLDisplay dpy);
typedef EGLSurface (*CreatePbufferFromClientBuffer_t)(_EGLDriver *drv, EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list);
#endif /* EGL_VERSION_1_2 */
/**
@@ -109,11 +101,6 @@ struct _egl_api
QueryScreenSurfaceMESA_t QueryScreenSurfaceMESA;
QueryScreenModeMESA_t QueryScreenModeMESA;
QueryModeStringMESA_t QueryModeStringMESA;
#ifdef EGL_VERSION_1_2
WaitClient_t WaitClient;
CreatePbufferFromClientBuffer_t CreatePbufferFromClientBuffer;
#endif
};
#endif /* EGLAPI_INCLUDED */

View File

@@ -92,10 +92,6 @@ _eglInitConfig(_EGLConfig *config, EGLint id)
_eglSetConfigAttrib(config, EGL_TRANSPARENT_RED_VALUE, EGL_DONT_CARE);
_eglSetConfigAttrib(config, EGL_TRANSPARENT_GREEN_VALUE, EGL_DONT_CARE);
_eglSetConfigAttrib(config, EGL_TRANSPARENT_BLUE_VALUE, EGL_DONT_CARE);
#ifdef EGL_VERSION_1_2
_eglSetConfigAttrib(config, EGL_COLOR_BUFFER_TYPE, EGL_RGB_BUFFER);
_eglSetConfigAttrib(config, EGL_RENDERABLE_TYPE, EGL_OPENGL_ES_BIT);
#endif /* EGL_VERSION_1_2 */
}
@@ -157,37 +153,13 @@ _eglParseConfigAttribs(_EGLConfig *config, const EGLint *attrib_list)
}
for (i = 0; attrib_list && attrib_list[i] != EGL_NONE; i++) {
const EGLint attr = attrib_list[i];
if (attr >= EGL_BUFFER_SIZE &&
attr <= EGL_MAX_SWAP_INTERVAL) {
EGLint k = attr - FIRST_ATTRIB;
if (attrib_list[i] >= EGL_BUFFER_SIZE &&
attrib_list[i] <= EGL_MAX_SWAP_INTERVAL) {
EGLint k = attrib_list[i] - FIRST_ATTRIB;
assert(k >= 0);
assert(k < MAX_ATTRIBS);
config->Attrib[k] = attrib_list[++i];
}
#ifdef EGL_VERSION_1_2
else if (attr == EGL_COLOR_BUFFER_TYPE) {
EGLint bufType = attrib_list[++i];
if (bufType != EGL_RGB_BUFFER && bufType != EGL_LUMINANCE_BUFFER) {
_eglError(EGL_BAD_ATTRIBUTE, "eglChooseConfig");
return EGL_FALSE;
}
_eglSetConfigAttrib(config, EGL_COLOR_BUFFER_TYPE, bufType);
}
else if (attr == EGL_RENDERABLE_TYPE) {
EGLint renType = attrib_list[++i];
if (renType & ~(EGL_OPENGL_ES_BIT | EGL_OPENVG_BIT)) {
_eglError(EGL_BAD_ATTRIBUTE, "eglChooseConfig");
return EGL_FALSE;
}
_eglSetConfigAttrib(config, EGL_RENDERABLE_TYPE, renType);
}
else if (attr == EGL_ALPHA_MASK_SIZE ||
attr == EGL_LUMINANCE_SIZE) {
EGLint value = attrib_list[++i];
_eglSetConfigAttrib(config, attr, value);
}
#endif /* EGL_VERSION_1_2 */
else {
_eglError(EGL_BAD_ATTRIBUTE, "eglChooseConfig");
return EGL_FALSE;
@@ -212,8 +184,6 @@ struct sort_info {
/* This encodes the info from Table 3.5 of the EGL spec, ordered by
* Sort Priority.
*
* XXX To do: EGL 1.2 attribs
*/
static struct sort_info SortInfo[] = {
{ EGL_CONFIG_CAVEAT, EXACT, SPECIAL },

View File

@@ -160,11 +160,6 @@ _eglQueryContext(_EGLDriver *drv, EGLDisplay dpy, EGLContext ctx,
case EGL_CONFIG_ID:
*value = GET_CONFIG_ATTRIB(c->Config, EGL_CONFIG_ID);
return EGL_TRUE;
#ifdef EGL_VERSION_1_2
case EGL_CONTEXT_CLIENT_TYPE:
*value = c->ClientAPI;
return EGL_FALSE;
#endif /* EGL_VERSION_1_2 */
default:
_eglError(EGL_BAD_ATTRIBUTE, "eglQueryContext");
return EGL_FALSE;

View File

@@ -22,9 +22,6 @@ struct _egl_context
EGLBoolean IsBound;
EGLBoolean DeletePending;
#ifdef EGL_VERSION_1_2
EGLint ClientAPI; /* Either EGL_OPENGL_ES_API or EGL_OPENVG_API */
#endif /* EGL_VERSION_1_2 */
};

View File

@@ -181,7 +181,7 @@ _eglInitDriverFallbacks(_EGLDriver *drv)
drv->API.WaitGL = _eglWaitGL;
drv->API.WaitNative = _eglWaitNative;
#ifdef EGL_MESA_screen_surface
/* EGL_MESA_screen */
drv->API.ChooseModeMESA = _eglChooseModeMESA;
drv->API.GetModesMESA = _eglGetModesMESA;
drv->API.GetModeAttribMESA = _eglGetModeAttribMESA;
@@ -193,11 +193,6 @@ _eglInitDriverFallbacks(_EGLDriver *drv)
drv->API.QueryScreenSurfaceMESA = _eglQueryScreenSurfaceMESA;
drv->API.QueryScreenModeMESA = _eglQueryScreenModeMESA;
drv->API.QueryModeStringMESA = _eglQueryModeStringMESA;
#endif /* EGL_MESA_screen_surface */
#ifdef EGL_VERSION_1_2
drv->API.CreatePbufferFromClientBuffer = _eglCreatePbufferFromClientBuffer;
#endif /* EGL_VERSION_1_2 */
}
@@ -232,11 +227,6 @@ _eglQueryString(_EGLDriver *drv, EGLDisplay dpy, EGLint name)
case EGL_EXTENSIONS:
_eglUpdateExtensionsString(drv);
return drv->Extensions.String;
#ifdef EGL_VERSION_1_2
case EGL_CLIENT_APIS:
/* XXX need to initialize somewhere */
return drv->ClientAPIs;
#endif
default:
_eglError(EGL_BAD_PARAMETER, "eglQueryString");
return NULL;
@@ -260,13 +250,6 @@ _eglWaitNative(_EGLDriver *drv, EGLDisplay dpy, EGLint engine)
/* just a placeholder */
(void) drv;
(void) dpy;
switch (engine) {
case EGL_CORE_NATIVE_ENGINE:
break;
default:
_eglError(EGL_BAD_PARAMETER, "eglWaitNative(engine)");
return EGL_FALSE;
}
(void) engine;
return EGL_TRUE;
}

View File

@@ -34,7 +34,6 @@ struct _egl_driver
int ABIversion;
int APImajor, APIminor; /* returned through eglInitialize */
const char *ClientAPIs;
_EGLAPI API;

View File

@@ -1,5 +1,4 @@
#include <stdio.h>
#include <stdlib.h>
#include "eglglobals.h"
@@ -19,12 +18,9 @@ _eglInitGlobals(void)
_eglGlobal.Surfaces = _eglNewHashTable();
_eglGlobal.FreeScreenHandle = 1;
_eglGlobal.Initialized = EGL_TRUE;
_eglGlobal.OpenGLESAPISupported = EGL_TRUE;
_eglGlobal.OpenVGAPISupported = EGL_FALSE;
/* XXX temporary */
_eglGlobal.ThreadInfo = _eglNewThreadInfo();
_eglGlobal.ThreadInfo.CurrentContext = EGL_NO_CONTEXT;
_eglGlobal.ThreadInfo.LastError = EGL_SUCCESS;
}
}
@@ -42,33 +38,6 @@ _eglDestroyGlobals(void)
}
/**
* Allocate and init a new _EGLThreadInfo object.
*/
_EGLThreadInfo *
_eglNewThreadInfo(void)
{
_EGLThreadInfo *t = (_EGLThreadInfo *) calloc(1, sizeof(_EGLThreadInfo));
if (t) {
t->CurrentContext = EGL_NO_CONTEXT;
t->LastError = EGL_SUCCESS;
t->CurrentAPI = EGL_NONE;
}
return t;
}
/**
* Delete/free a _EGLThreadInfo object.
*/
void
_eglDeleteThreadData(_EGLThreadInfo *t)
{
free(t);
}
/**
* Return pointer to calling thread's _EGLThreadInfo object.
* Create a new one if needed.
@@ -77,10 +46,8 @@ _eglDeleteThreadData(_EGLThreadInfo *t)
_EGLThreadInfo *
_eglGetCurrentThread(void)
{
_eglInitGlobals();
/* XXX temporary */
return _eglGlobal.ThreadInfo;
return &_eglGlobal.ThreadInfo;
}

View File

@@ -12,7 +12,6 @@ struct _egl_thread_info
{
EGLint LastError;
_EGLContext *CurrentContext;
EGLenum CurrentAPI;
};
@@ -29,12 +28,8 @@ struct _egl_global
EGLScreenMESA FreeScreenHandle;
/* XXX these may be temporary */
EGLBoolean OpenGLESAPISupported;
EGLBoolean OpenVGAPISupported;
/* XXX temporary - should be thread-specific data (TSD) */
_EGLThreadInfo *ThreadInfo;
/* XXX temporary */
_EGLThreadInfo ThreadInfo;
};
@@ -49,14 +44,6 @@ extern void
_eglDestroyGlobals(void);
extern _EGLThreadInfo *
_eglNewThreadInfo(void);
extern void
_eglDeleteThreadData(_EGLThreadInfo *t);
extern _EGLThreadInfo *
_eglGetCurrentThread(void);

View File

@@ -27,11 +27,6 @@ _eglInitSurface(_EGLDriver *drv, EGLDisplay dpy,
_EGLConfig *conf;
EGLint width = 0, height = 0, largest = 0;
EGLint texFormat = 0, texTarget = 0, mipmapTex = 0;
EGLint renderBuffer = EGL_BACK_BUFFER;
#ifdef EGL_VERSION_1_2
EGLint colorspace = EGL_COLORSPACE_sRGB;
EGLint alphaFormat = EGL_ALPHA_FORMAT_NONPRE;
#endif
EGLint i;
switch (type) {
@@ -40,14 +35,12 @@ _eglInitSurface(_EGLDriver *drv, EGLDisplay dpy,
break;
case EGL_PIXMAP_BIT:
func = "eglCreatePixmapSurface";
renderBuffer = EGL_SINGLE_BUFFER;
break;
case EGL_PBUFFER_BIT:
func = "eglCreatePBufferSurface";
break;
case EGL_SCREEN_BIT_MESA:
func = "eglCreateScreenSurface";
renderBuffer = EGL_SINGLE_BUFFER; /* XXX correct? */
break;
default:
_eglLog(_EGL_WARNING, "Bad type in _eglInitSurface");
@@ -120,55 +113,6 @@ _eglInitSurface(_EGLDriver *drv, EGLDisplay dpy,
return EGL_FALSE;
}
break;
#ifdef EGL_VERSION_1_2
case EGL_RENDER_BUFFER:
if (type == EGL_WINDOW_BIT) {
renderBuffer = attrib_list[++i];
if (renderBuffer != EGL_BACK_BUFFER &&
renderBuffer != EGL_SINGLE_BUFFER) {
_eglError(EGL_BAD_ATTRIBUTE, func);
return EGL_FALSE;
}
}
else {
_eglError(EGL_BAD_ATTRIBUTE, func);
return EGL_FALSE;
}
break;
case EGL_COLORSPACE:
if (type == EGL_WINDOW_BIT ||
type == EGL_PBUFFER_BIT ||
type == EGL_PIXMAP_BIT) {
colorspace = attrib_list[++i];
if (colorspace != EGL_COLORSPACE_sRGB &&
colorspace != EGL_COLORSPACE_LINEAR) {
_eglError(EGL_BAD_ATTRIBUTE, func);
return EGL_FALSE;
}
}
else {
_eglError(EGL_BAD_ATTRIBUTE, func);
return EGL_FALSE;
}
break;
case EGL_ALPHA_FORMAT:
if (type == EGL_WINDOW_BIT ||
type == EGL_PBUFFER_BIT ||
type == EGL_PIXMAP_BIT) {
alphaFormat = attrib_list[++i];
if (alphaFormat != EGL_ALPHA_FORMAT_NONPRE &&
alphaFormat != EGL_ALPHA_FORMAT_PRE) {
_eglError(EGL_BAD_ATTRIBUTE, func);
return EGL_FALSE;
}
}
else {
_eglError(EGL_BAD_ATTRIBUTE, func);
return EGL_FALSE;
}
break;
#endif /* EGL_VERSION_1_2 */
default:
_eglError(EGL_BAD_ATTRIBUTE, func);
return EGL_FALSE;
@@ -190,15 +134,6 @@ _eglInitSurface(_EGLDriver *drv, EGLDisplay dpy,
surf->MipmapTexture = mipmapTex;
surf->MipmapLevel = 0;
surf->SwapInterval = 0;
#ifdef EGL_VERSION_1_2
surf->SwapBehavior = EGL_BUFFER_DESTROYED; /* XXX ok? */
surf->HorizontalResolution = EGL_UNKNOWN; /* set by caller */
surf->VerticalResolution = EGL_UNKNOWN; /* set by caller */
surf->AspectRatio = EGL_UNKNOWN; /* set by caller */
surf->RenderBuffer = renderBuffer;
surf->AlphaFormat = alphaFormat;
surf->Colorspace = colorspace;
#endif
return EGL_TRUE;
}
@@ -297,11 +232,6 @@ _eglQuerySurface(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surf,
case EGL_CONFIG_ID:
*value = GET_CONFIG_ATTRIB(surface->Config, EGL_CONFIG_ID);
return EGL_TRUE;
/*XXX case EGL_LARGEST_PBUFFER:*/
case EGL_SURFACE_TYPE:
*value = surface->Type;
return EGL_TRUE;
#ifdef EGL_VERSION_1_1
case EGL_TEXTURE_FORMAT:
/* texture attributes: only for pbuffers, no error otherwise */
if (surface->Type == EGL_PBUFFER_BIT)
@@ -319,30 +249,9 @@ _eglQuerySurface(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surf,
if (surface->Type == EGL_PBUFFER_BIT)
*value = surface->MipmapLevel;
return EGL_TRUE;
#endif /* EGL_VERSION_1_1 */
#ifdef EGL_VERSION_1_2
case EGL_SWAP_BEHAVIOR:
*value = surface->SwapBehavior;
case EGL_SURFACE_TYPE:
*value = surface->Type;
return EGL_TRUE;
case EGL_RENDER_BUFFER:
*value = surface->RenderBuffer;
return EGL_TRUE;
case EGL_PIXEL_ASPECT_RATIO:
*value = surface->AspectRatio;
return EGL_TRUE;
case EGL_HORIZONTAL_RESOLUTION:
*value = surface->HorizontalResolution;
return EGL_TRUE;
case EGL_VERTICAL_RESOLUTION:
*value = surface->VerticalResolution;
return EGL_TRUE;
case EGL_ALPHA_FORMAT:
*value = surface->AlphaFormat;
return EGL_TRUE;
case EGL_COLORSPACE:
*value = surface->Colorspace;
return EGL_TRUE;
#endif /* EGL_VERSION_1_2 */
default:
_eglError(EGL_BAD_ATTRIBUTE, "eglQuerySurface");
return EGL_FALSE;
@@ -507,24 +416,3 @@ _eglSwapInterval(_EGLDriver *drv, EGLDisplay dpy, EGLint interval)
surf->SwapInterval = interval;
return EGL_TRUE;
}
#ifdef EGL_VERSION_1_2
/**
* Example function - drivers should do a proper implementation.
*/
EGLSurface
_eglCreatePbufferFromClientBuffer(_EGLDriver *drv, EGLDisplay dpy,
EGLenum buftype, EGLClientBuffer buffer,
EGLConfig config, const EGLint *attrib_list)
{
if (buftype != EGL_OPENVG_IMAGE) {
_eglError(EGL_BAD_PARAMETER, "eglCreatePbufferFromClientBuffer");
return EGL_NO_SURFACE;
}
return EGL_NO_SURFACE;
}
#endif /* EGL_VERSION_1_2 */

View File

@@ -25,15 +25,6 @@ struct _egl_surface
/* If type == EGL_SCREEN_BIT: */
EGLint VisibleRefCount; /* number of screens I'm displayed on */
#ifdef EGL_VERSION_1_2
EGLint SwapBehavior; /* one of EGL_BUFFER_PRESERVED/DESTROYED */
EGLint HorizontalResolution, VerticalResolution;
EGLint AspectRatio;
EGLint RenderBuffer; /* EGL_BACK_BUFFER or EGL_SINGLE_BUFFER */
EGLint AlphaFormat; /* EGL_ALPHA_FORMAT_NONPRE or EGL_ALPHA_FORMAT_PRE */
EGLint Colorspace; /* EGL_COLORSPACE_sRGB or EGL_COLORSPACE_LINEAR */
#endif /* EGL_VERSION_1_2 */
};
@@ -103,15 +94,4 @@ extern EGLBoolean
_eglSwapInterval(_EGLDriver *drv, EGLDisplay dpy, EGLint interval);
#ifdef EGL_VERSION_1_2
extern EGLSurface
_eglCreatePbufferFromClientBuffer(_EGLDriver *drv, EGLDisplay dpy,
EGLenum buftype, EGLClientBuffer buffer,
EGLConfig config, const EGLint *attrib_list);
#endif /* EGL_VERSION_1_2 */
#endif /* EGLSURFACE_INCLUDED */

View File

@@ -35,8 +35,8 @@
/*
* glcurveval.c++
*
* $Date: 2006/03/29 18:46:46 $ $Revision: 1.7 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/interface/glcurveval.cc,v 1.7 2006/03/29 18:46:46 brianp Exp $
* $Date: 2004/05/12 15:29:36 $ $Revision: 1.6 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/interface/glcurveval.cc,v 1.6 2004/05/12 15:29:36 brianp Exp $
*/
/* Polynomial Evaluator Interface */
@@ -74,7 +74,6 @@ OpenGLCurveEvaluator::OpenGLCurveEvaluator(void)
em_normal.uprime = -1.0;
em_color.uprime = -1.0;
em_texcoord.uprime = -1.0;
output_triangles = 0; // don't output triangles by default
}
OpenGLCurveEvaluator::~OpenGLCurveEvaluator(void)

View File

@@ -35,28 +35,28 @@
/*
* mystdio.h
*
* $Date: 2006/03/14 15:08:52 $ $Revision: 1.4 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/interface/mystdio.h,v 1.4 2006/03/14 15:08:52 brianp Exp $
* $Date: 2001/03/19 17:52:02 $ $Revision: 1.3 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/interface/mystdio.h,v 1.3 2001/03/19 17:52:02 pesco Exp $
*/
#ifndef __glumystdio_h_
#define __glumystdio_h_
#ifdef STANDALONE
inline void _glu_dprintf( char *, ... ) { }
inline void dprintf( char *, ... ) { }
#endif
#ifdef LIBRARYBUILD
#ifndef NDEBUG
#include <stdio.h>
#define _glu_dprintf printf
#define dprintf printf
#else
inline void _glu_dprintf( char *, ... ) { }
inline void dprintf( char *, ... ) { }
#endif
#endif
#ifdef GLBUILD
inline void _glu_dprintf( char *, ... ) { }
inline void dprintf( char *, ... ) { }
#endif
#ifndef NULL

View File

@@ -156,9 +156,9 @@ void
Arc::show()
{
#ifndef NDEBUG
_glu_dprintf( "\tPWLARC NP: %d FL: 1\n", pwlArc->npts );
dprintf( "\tPWLARC NP: %d FL: 1\n", pwlArc->npts );
for( int i = 0; i < pwlArc->npts; i++ ) {
_glu_dprintf( "\t\tVERTEX %f %f\n", pwlArc->pts[i].param[0],
dprintf( "\t\tVERTEX %f %f\n", pwlArc->pts[i].param[0],
pwlArc->pts[i].param[1] );
}
#endif
@@ -175,14 +175,14 @@ Arc::print( void )
Arc_ptr jarc = this;
#ifndef NDEBUG
_glu_dprintf( "BGNTRIM\n" );
dprintf( "BGNTRIM\n" );
#endif
do {
jarc->show( );
jarc = jarc->next;
} while (jarc != this);
#ifndef NDEBUG
_glu_dprintf("ENDTRIM\n" );
dprintf("ENDTRIM\n" );
#endif
}
@@ -203,8 +203,8 @@ Arc::isDisconnected( void )
if( ((p0[0] - p1[0]) > ZERO) || ((p1[0] - p0[0]) > ZERO) ||
((p0[1] - p1[1]) > ZERO) || ((p1[1] - p0[1]) > ZERO) ) {
#ifndef NDEBUG
_glu_dprintf( "x coord = %f %f %f\n", p0[0], p1[0], p0[0] - p1[0] );
_glu_dprintf( "y coord = %f %f %f\n", p0[1], p1[1], p0[1] - p1[1] );
dprintf( "x coord = %f %f %f\n", p0[0], p1[0], p0[0] - p1[0] );
dprintf( "y coord = %f %f %f\n", p0[1], p1[1], p0[1] - p1[1] );
#endif
return 1;
} else {
@@ -244,7 +244,7 @@ Arc::check( void )
if (jarc->prev == 0 || jarc->next == 0) {
#ifndef NDEBUG
_glu_dprintf( "checkjarc:null next/prev pointer\n");
dprintf( "checkjarc:null next/prev pointer\n");
jarc->print( );
#endif
return 0;
@@ -252,7 +252,7 @@ Arc::check( void )
if (jarc->next->prev != jarc) {
#ifndef NDEBUG
_glu_dprintf( "checkjarc: pointer linkage screwed up\n");
dprintf( "checkjarc: pointer linkage screwed up\n");
jarc->print( );
#endif
return 0;
@@ -271,7 +271,7 @@ Arc::check( void )
if( jarc->prev->pwlArc ) {
if( jarc->tail()[1] != jarc->prev->rhead()[1] ) {
#ifndef NDEBUG
_glu_dprintf( "checkjarc: geometric linkage screwed up 1\n");
dprintf( "checkjarc: geometric linkage screwed up 1\n");
jarc->prev->show();
jarc->show();
#endif
@@ -280,7 +280,7 @@ Arc::check( void )
if( jarc->tail()[0] != jarc->prev->rhead()[0] ) {
#ifndef NDEBUG
_glu_dprintf( "checkjarc: geometric linkage screwed up 2\n");
dprintf( "checkjarc: geometric linkage screwed up 2\n");
jarc->prev->show();
jarc->show();
#endif
@@ -290,7 +290,7 @@ Arc::check( void )
if( jarc->next->pwlArc ) {
if( jarc->next->tail()[0] != jarc->rhead()[0] ) {
#ifndef NDEBUG
_glu_dprintf( "checkjarc: geometric linkage screwed up 3\n");
dprintf( "checkjarc: geometric linkage screwed up 3\n");
jarc->show();
jarc->next->show();
#endif
@@ -298,7 +298,7 @@ Arc::check( void )
}
if( jarc->next->tail()[1] != jarc->rhead()[1] ) {
#ifndef NDEBUG
_glu_dprintf( "checkjarc: geometric linkage screwed up 4\n");
dprintf( "checkjarc: geometric linkage screwed up 4\n");
jarc->show();
jarc->next->show();
#endif

View File

@@ -35,8 +35,8 @@
/*
* arcsorter.c++
*
* $Date: 2006/03/14 15:08:52 $ $Revision: 1.2 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/arcsorter.cc,v 1.2 2006/03/14 15:08:52 brianp Exp $
* $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/arcsorter.cc,v 1.1 2001/03/17 00:25:40 brianp Exp $
*/
#ifndef __gluarcsorter_c_
@@ -54,7 +54,7 @@ ArcSorter::ArcSorter(Subdivider &s) : Sorter( sizeof( Arc ** ) ), subdivider(s)
int
ArcSorter::qscmp( char *, char * )
{
_glu_dprintf( "ArcSorter::qscmp: pure virtual called\n" );
dprintf( "ArcSorter::qscmp: pure virtual called\n" );
return 0;
}

View File

@@ -335,7 +335,7 @@ ArcTessellator::tessellateNonlinear( Arc *arc, REAL geo_stepsize, REAL arc_steps
REAL min_u, min_v, max_u,max_v;
min_u = max_u = bezierArc->cpts[0];
min_v = max_v = bezierArc->cpts[1];
for(i=1, j=bezierArc->stride; i<bezierArc->order; i++, j+= bezierArc->stride)
for(i=1, j=2; i<bezierArc->order; i++, j+= bezierArc->stride)
{
if(bezierArc->cpts[j] < min_u)
min_u = bezierArc->cpts[j];

View File

@@ -45,7 +45,7 @@ void
BasicCurveEvaluator::domain1f( REAL, REAL )
{
#ifndef NDEBUG
_glu_dprintf( "domain1f\n" );
dprintf( "domain1f\n" );
#endif
}
@@ -53,7 +53,7 @@ void
BasicCurveEvaluator::range1f( long , REAL *, REAL * )
{
#ifndef NDEBUG
_glu_dprintf( "range1f\n" );
dprintf( "range1f\n" );
#endif
}
@@ -61,7 +61,7 @@ void
BasicCurveEvaluator::enable( long )
{
#ifndef NDEBUG
_glu_dprintf( "enable\n" );
dprintf( "enable\n" );
#endif
}
@@ -69,7 +69,7 @@ void
BasicCurveEvaluator::disable( long )
{
#ifndef NDEBUG
_glu_dprintf( "disable\n" );
dprintf( "disable\n" );
#endif
}
@@ -77,7 +77,7 @@ void
BasicCurveEvaluator::bgnmap1f( long )
{
#ifndef NDEBUG
_glu_dprintf( "bgnmap1f\n" );
dprintf( "bgnmap1f\n" );
#endif
}
@@ -85,7 +85,7 @@ void
BasicCurveEvaluator::map1f( long, REAL, REAL, long, long, REAL * )
{
#ifndef NDEBUG
_glu_dprintf( "map1f\n" );
dprintf( "map1f\n" );
#endif
}
@@ -93,7 +93,7 @@ void
BasicCurveEvaluator::mapgrid1f( long, REAL, REAL )
{
#ifndef NDEBUG
_glu_dprintf( "mapgrid1f\n" );
dprintf( "mapgrid1f\n" );
#endif
}
@@ -101,7 +101,7 @@ void
BasicCurveEvaluator::mapmesh1f( long, long, long )
{
#ifndef NDEBUG
_glu_dprintf( "mapmesh1f\n" );
dprintf( "mapmesh1f\n" );
#endif
}
@@ -109,7 +109,7 @@ void
BasicCurveEvaluator::evalcoord1f( long, REAL )
{
#ifndef NDEBUG
_glu_dprintf( "evalcoord1f\n" );
dprintf( "evalcoord1f\n" );
#endif
}
@@ -117,7 +117,7 @@ void
BasicCurveEvaluator::endmap1f( void )
{
#ifndef NDEBUG
_glu_dprintf( "endmap1f\n" );
dprintf( "endmap1f\n" );
#endif
}
@@ -125,7 +125,7 @@ void
BasicCurveEvaluator::bgnline( void )
{
#ifndef NDEBUG
_glu_dprintf( "bgnline\n" );
dprintf( "bgnline\n" );
#endif
}
@@ -133,6 +133,6 @@ void
BasicCurveEvaluator::endline( void )
{
#ifndef NDEBUG
_glu_dprintf( "endline\n" );
dprintf( "endline\n" );
#endif
}

View File

@@ -35,8 +35,8 @@
/*
* basiccurveeval.h
*
* $Date: 2006/03/29 18:54:00 $ $Revision: 1.2 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/basiccrveval.h,v 1.2 2006/03/29 18:54:00 brianp Exp $
* $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/basiccrveval.h,v 1.1 2001/03/17 00:25:40 brianp Exp $
*/
#ifndef __glubasiccrveval_h_
@@ -48,7 +48,6 @@
class BasicCurveEvaluator : public CachingEvaluator {
public:
virtual ~BasicCurveEvaluator() { /* silence warning*/ }
virtual void domain1f( REAL, REAL );
virtual void range1f( long, REAL *, REAL * );

View File

@@ -49,7 +49,7 @@ void
BasicSurfaceEvaluator::domain2f( REAL, REAL, REAL, REAL )
{
#ifndef NDEBUG
_glu_dprintf( "domain2f\n" );
dprintf( "domain2f\n" );
#endif
}
@@ -57,7 +57,7 @@ void
BasicSurfaceEvaluator::polymode( long )
{
#ifndef NDEBUG
_glu_dprintf( "polymode\n" );
dprintf( "polymode\n" );
#endif
}
@@ -65,7 +65,7 @@ void
BasicSurfaceEvaluator::range2f( long type, REAL *from, REAL *to )
{
#ifndef NDEBUG
_glu_dprintf( "range2f type %ld, from (%g,%g), to (%g,%g)\n",
dprintf( "range2f type %ld, from (%g,%g), to (%g,%g)\n",
type, from[0], from[1], to[0], to[1] );
#endif
}
@@ -74,7 +74,7 @@ void
BasicSurfaceEvaluator::enable( long )
{
#ifndef NDEBUG
_glu_dprintf( "enable\n" );
dprintf( "enable\n" );
#endif
}
@@ -82,7 +82,7 @@ void
BasicSurfaceEvaluator::disable( long )
{
#ifndef NDEBUG
_glu_dprintf( "disable\n" );
dprintf( "disable\n" );
#endif
}
@@ -90,7 +90,7 @@ void
BasicSurfaceEvaluator::bgnmap2f( long )
{
#ifndef NDEBUG
_glu_dprintf( "bgnmap2f\n" );
dprintf( "bgnmap2f\n" );
#endif
}
@@ -98,7 +98,7 @@ void
BasicSurfaceEvaluator::endmap2f( void )
{
#ifndef NDEBUG
_glu_dprintf( "endmap2f\n" );
dprintf( "endmap2f\n" );
#endif
}
@@ -108,7 +108,7 @@ BasicSurfaceEvaluator::map2f( long, REAL, REAL, long, long,
REAL * )
{
#ifndef NDEBUG
_glu_dprintf( "map2f\n" );
dprintf( "map2f\n" );
#endif
}
@@ -116,7 +116,7 @@ void
BasicSurfaceEvaluator::mapgrid2f( long, REAL, REAL, long, REAL, REAL )
{
#ifndef NDEBUG
_glu_dprintf( "mapgrid2f\n" );
dprintf( "mapgrid2f\n" );
#endif
}
@@ -124,7 +124,7 @@ void
BasicSurfaceEvaluator::mapmesh2f( long, long, long, long, long )
{
#ifndef NDEBUG
_glu_dprintf( "mapmesh2f\n" );
dprintf( "mapmesh2f\n" );
#endif
}
@@ -132,7 +132,7 @@ void
BasicSurfaceEvaluator::evalcoord2f( long, REAL, REAL )
{
#ifndef NDEBUG
_glu_dprintf( "evalcoord2f\n" );
dprintf( "evalcoord2f\n" );
#endif
}
@@ -140,7 +140,7 @@ void
BasicSurfaceEvaluator::evalpoint2i( long, long )
{
#ifndef NDEBUG
_glu_dprintf( "evalpoint2i\n" );
dprintf( "evalpoint2i\n" );
#endif
}
@@ -148,7 +148,7 @@ void
BasicSurfaceEvaluator::bgnline( void )
{
#ifndef NDEBUG
_glu_dprintf( "bgnline\n" );
dprintf( "bgnline\n" );
#endif
}
@@ -156,7 +156,7 @@ void
BasicSurfaceEvaluator::endline( void )
{
#ifndef NDEBUG
_glu_dprintf( "endline\n" );
dprintf( "endline\n" );
#endif
}
@@ -164,7 +164,7 @@ void
BasicSurfaceEvaluator::bgnclosedline( void )
{
#ifndef NDEBUG
_glu_dprintf( "bgnclosedline\n" );
dprintf( "bgnclosedline\n" );
#endif
}
@@ -172,7 +172,7 @@ void
BasicSurfaceEvaluator::endclosedline( void )
{
#ifndef NDEBUG
_glu_dprintf( "endclosedline\n" );
dprintf( "endclosedline\n" );
#endif
}
@@ -180,7 +180,7 @@ void
BasicSurfaceEvaluator::bgntfan( void )
{
#ifndef NDEBUG
_glu_dprintf( "bgntfan\n" );
dprintf( "bgntfan\n" );
#endif
}
@@ -194,7 +194,7 @@ void
BasicSurfaceEvaluator::bgntmesh( void )
{
#ifndef NDEBUG
_glu_dprintf( "bgntmesh\n" );
dprintf( "bgntmesh\n" );
#endif
}
@@ -202,7 +202,7 @@ void
BasicSurfaceEvaluator::swaptmesh( void )
{
#ifndef NDEBUG
_glu_dprintf( "swaptmesh\n" );
dprintf( "swaptmesh\n" );
#endif
}
@@ -210,7 +210,7 @@ void
BasicSurfaceEvaluator::endtmesh( void )
{
#ifndef NDEBUG
_glu_dprintf( "endtmesh\n" );
dprintf( "endtmesh\n" );
#endif
}
@@ -218,7 +218,7 @@ void
BasicSurfaceEvaluator::bgnqstrip( void )
{
#ifndef NDEBUG
_glu_dprintf( "bgnqstrip\n" );
dprintf( "bgnqstrip\n" );
#endif
}
@@ -226,7 +226,7 @@ void
BasicSurfaceEvaluator::endqstrip( void )
{
#ifndef NDEBUG
_glu_dprintf( "endqstrip\n" );
dprintf( "endqstrip\n" );
#endif
}

View File

@@ -35,8 +35,8 @@
/*
* basicsurfeval.h
*
* $Date: 2006/03/29 18:54:00 $ $Revision: 1.2 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/basicsurfeval.h,v 1.2 2006/03/29 18:54:00 brianp Exp $
* $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/basicsurfeval.h,v 1.1 2001/03/17 00:25:40 brianp Exp $
*/
#ifndef __glubasicsurfeval_h_
@@ -48,7 +48,6 @@
class BasicSurfaceEvaluator : public CachingEvaluator {
public:
virtual ~BasicSurfaceEvaluator() { /* silence warning*/ }
virtual void range2f( long, REAL *, REAL * );
virtual void domain2f( REAL, REAL, REAL, REAL );

View File

@@ -35,8 +35,8 @@
/*
* bin.c++
*
* $Date: 2006/03/14 15:08:52 $ $Revision: 1.3 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/bin.cc,v 1.3 2006/03/14 15:08:52 brianp Exp $
* $Date: 2004/05/12 15:29:36 $ $Revision: 1.2 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/bin.cc,v 1.2 2004/05/12 15:29:36 brianp Exp $
*/
#include "glimports.h"
@@ -123,7 +123,7 @@ void
Bin::show( char *name )
{
#ifndef NDEBUG
_glu_dprintf( "%s\n", name );
dprintf( "%s\n", name );
for( Arc_ptr jarc = firstarc(); jarc; jarc = nextarc() )
jarc->show( );
#endif
@@ -160,7 +160,7 @@ Bin::listBezier( void )
REAL t1 = pts[0].param[1];
REAL s2 = pts[1].param[0];
REAL t2 = pts[1].param[1];
_glu_dprintf( "arc (%g,%g) (%g,%g)\n", s1, t1, s2, t2 );
dprintf( "arc (%g,%g) (%g,%g)\n", s1, t1, s2, t2 );
#endif
}
}

View File

@@ -35,8 +35,8 @@
/*
* bufpool.h
*
* $Date: 2006/03/29 18:46:46 $ $Revision: 1.3 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/bufpool.h,v 1.3 2006/03/29 18:46:46 brianp Exp $
* $Date: 2001/03/22 11:38:36 $ $Revision: 1.2 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/bufpool.h,v 1.2 2001/03/22 11:38:36 joukj Exp $
*/
#ifndef __glubufpool_h_
@@ -128,7 +128,6 @@ public:
inline void * operator new( size_t s)
{ return ::new char[s]; }
inline void operator delete( void * ) { assert( 0 ); }
inline void operator delete( void *, Pool & ) { assert( 0 ); }
inline void deleteMe( Pool & );
};

View File

@@ -35,8 +35,8 @@
/*
* cachingeval.h
*
* $Date: 2006/03/29 18:54:00 $ $Revision: 1.2 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/cachingeval.h,v 1.2 2006/03/29 18:54:00 brianp Exp $
* $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/cachingeval.h,v 1.1 2001/03/17 00:25:40 brianp Exp $
*/
#ifndef __glucachingval_h_
@@ -44,7 +44,6 @@
class CachingEvaluator {
public:
virtual ~CachingEvaluator() { /* silence warning*/ }
enum ServiceMode { play, record, playAndRecord };
virtual int canRecord( void );
virtual int canPlayAndRecord( void );

View File

@@ -35,8 +35,8 @@
/*
* ccw.c++
*
* $Date: 2006/03/14 15:08:52 $ $Revision: 1.3 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/ccw.cc,v 1.3 2006/03/14 15:08:52 brianp Exp $
* $Date: 2002/11/01 23:35:07 $ $Revision: 1.2 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/ccw.cc,v 1.2 2002/11/01 23:35:07 brianp Exp $
*/
#include "glimports.h"
@@ -70,7 +70,7 @@ Subdivider::ccwTurn_sr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
assert( v2 != v2last );
#ifndef NDEBUG
_glu_dprintf( "arc_ccw_turn, p = %d\n", 0 );
dprintf( "arc_ccw_turn, p = %d\n", 0 );
#endif
// the arcs lie on the line (0 == v1->param[0])
@@ -88,7 +88,7 @@ Subdivider::ccwTurn_sr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
while( 1 ) {
if( v1next->param[0] < v2next->param[0] ) {
#ifndef NDEBUG
_glu_dprintf( "case a\n" );
dprintf( "case a\n" );
#endif
assert( v1->param[0] <= v1next->param[0] );
assert( v2->param[0] <= v1next->param[0] );
@@ -101,12 +101,12 @@ Subdivider::ccwTurn_sr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
return sgn;
} else {
#ifdef DEBUG
_glu_dprintf( "decr\n" );
dprintf( "decr\n" );
#endif
v1 = v1next--;
if( v1 == v1last ) {
#ifdef DEBUG
_glu_dprintf( "no good results\n" );
dprintf( "no good results\n" );
#endif
return 0; // ill-conditioned, guess answer
}
@@ -117,7 +117,7 @@ Subdivider::ccwTurn_sr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
}
} else if( v1next->param[0] > v2next->param[0] ) {
#ifndef NDEBUG
_glu_dprintf( "case b\n" );
dprintf( "case b\n" );
#endif
assert( v1->param[0] <= v2next->param[0] );
assert( v2->param[0] <= v2next->param[0] );
@@ -130,12 +130,12 @@ Subdivider::ccwTurn_sr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
return sgn;
} else {
#ifdef DEBUG
_glu_dprintf( "incr\n" );
dprintf( "incr\n" );
#endif
v2 = v2next++;
if( v2 == v2last ) {
#ifdef DEBUG
_glu_dprintf( "no good results\n" );
dprintf( "no good results\n" );
#endif
return 0; // ill-conditioned, guess answer
}
@@ -146,7 +146,7 @@ Subdivider::ccwTurn_sr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
}
} else {
#ifndef NDEBUG
_glu_dprintf( "case ab\n" );
dprintf( "case ab\n" );
#endif
if( v1next->param[1] < v2next->param[1] )
return 0;
@@ -154,12 +154,12 @@ Subdivider::ccwTurn_sr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
return 1;
else {
#ifdef DEBUG
_glu_dprintf( "incr\n" );
dprintf( "incr\n" );
#endif
v2 = v2next++;
if( v2 == v2last ) {
#ifdef DEBUG
_glu_dprintf( "no good results\n" );
dprintf( "no good results\n" );
#endif
return 0; // ill-conditioned, guess answer
}
@@ -183,7 +183,7 @@ Subdivider::ccwTurn_sl( Arc_ptr j1, Arc_ptr j2 ) // dir = 0
assert( v2 != v2last );
#ifndef NDEBUG
_glu_dprintf( "arc_ccw_turn, p = %d\n", 0 );
dprintf( "arc_ccw_turn, p = %d\n", 0 );
#endif
// the arcs lie on the line (0 == v1->param[0])
@@ -201,7 +201,7 @@ Subdivider::ccwTurn_sl( Arc_ptr j1, Arc_ptr j2 ) // dir = 0
while( 1 ) {
if( v1next->param[0] > v2next->param[0] ) {
#ifndef NDEBUG
_glu_dprintf( "case c\n" );
dprintf( "case c\n" );
#endif
assert( v1->param[0] >= v1next->param[0] );
assert( v2->param[0] >= v1next->param[0] );
@@ -215,11 +215,11 @@ Subdivider::ccwTurn_sl( Arc_ptr j1, Arc_ptr j2 ) // dir = 0
else {
v1 = v1next--;
#ifdef DEBUG
_glu_dprintf( "decr\n" );
dprintf( "decr\n" );
#endif
if( v1 == v1last ) {
#ifdef DEBUG
_glu_dprintf( "no good results\n" );
dprintf( "no good results\n" );
#endif
return 0; // ill-conditioned, guess answer
}
@@ -230,7 +230,7 @@ Subdivider::ccwTurn_sl( Arc_ptr j1, Arc_ptr j2 ) // dir = 0
}
} else if( v1next->param[0] < v2next->param[0] ) {
#ifndef NDEBUG
_glu_dprintf( "case d\n" );
dprintf( "case d\n" );
#endif
assert( v1->param[0] >= v2next->param[0] );
assert( v2->param[0] >= v2next->param[0] );
@@ -244,11 +244,11 @@ Subdivider::ccwTurn_sl( Arc_ptr j1, Arc_ptr j2 ) // dir = 0
else {
v2 = v2next++;
#ifdef DEBUG
_glu_dprintf( "incr\n" );
dprintf( "incr\n" );
#endif
if( v2 == v2last ) {
#ifdef DEBUG
_glu_dprintf( "no good results\n" );
dprintf( "no good results\n" );
#endif
return 0; // ill-conditioned, guess answer
}
@@ -259,7 +259,7 @@ Subdivider::ccwTurn_sl( Arc_ptr j1, Arc_ptr j2 ) // dir = 0
}
} else {
#ifdef DEBUG
_glu_dprintf( "case cd\n" );
dprintf( "case cd\n" );
#endif
if( v1next->param[1] < v2next->param[1] )
return 1;
@@ -268,11 +268,11 @@ Subdivider::ccwTurn_sl( Arc_ptr j1, Arc_ptr j2 ) // dir = 0
else {
v2 = v2next++;
#ifdef DEBUG
_glu_dprintf( "incr\n" );
dprintf( "incr\n" );
#endif
if( v2 == v2last ) {
#ifdef DEBUG
_glu_dprintf( "no good results\n" );
dprintf( "no good results\n" );
#endif
return 0; // ill-conditioned, guess answer
}
@@ -296,7 +296,7 @@ Subdivider::ccwTurn_tr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
assert( v2 != v2last );
#ifndef NDEBUG
_glu_dprintf( "arc_ccw_turn, p = %d\n", 1 );
dprintf( "arc_ccw_turn, p = %d\n", 1 );
#endif
// the arcs lie on the line (1 == v1->param[1])
@@ -314,7 +314,7 @@ Subdivider::ccwTurn_tr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
while( 1 ) {
if( v1next->param[1] < v2next->param[1] ) {
#ifndef NDEBUG
_glu_dprintf( "case a\n" );
dprintf( "case a\n" );
#endif
assert( v1->param[1] <= v1next->param[1] );
assert( v2->param[1] <= v1next->param[1] );
@@ -327,12 +327,12 @@ Subdivider::ccwTurn_tr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
return sgn;
} else {
#ifdef DEBUG
_glu_dprintf( "decr\n" );
dprintf( "decr\n" );
#endif
v1 = v1next--;
if( v1 == v1last ) {
#ifdef DEBUG
_glu_dprintf( "no good results\n" );
dprintf( "no good results\n" );
#endif
return 0; // ill-conditioned, guess answer
}
@@ -343,7 +343,7 @@ Subdivider::ccwTurn_tr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
}
} else if( v1next->param[1] > v2next->param[1] ) {
#ifndef NDEBUG
_glu_dprintf( "case b\n" );
dprintf( "case b\n" );
#endif
assert( v1->param[1] <= v2next->param[1] );
assert( v2->param[1] <= v2next->param[1] );
@@ -356,12 +356,12 @@ Subdivider::ccwTurn_tr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
return sgn;
} else {
#ifdef DEBUG
_glu_dprintf( "incr\n" );
dprintf( "incr\n" );
#endif
v2 = v2next++;
if( v2 == v2last ) {
#ifdef DEBUG
_glu_dprintf( "no good results\n" );
dprintf( "no good results\n" );
#endif
return 0; // ill-conditioned, guess answer
}
@@ -372,7 +372,7 @@ Subdivider::ccwTurn_tr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
}
} else {
#ifdef DEBUG
_glu_dprintf( "case ab\n" );
dprintf( "case ab\n" );
#endif
if( v1next->param[0] < v2next->param[0] )
return 1;
@@ -380,12 +380,12 @@ Subdivider::ccwTurn_tr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
return 0;
else {
#ifdef DEBUG
_glu_dprintf( "incr\n" );
dprintf( "incr\n" );
#endif
v2 = v2next++;
if( v2 == v2last ) {
#ifdef DEBUG
_glu_dprintf( "no good results\n" );
dprintf( "no good results\n" );
#endif
return 0; // ill-conditioned, guess answer
}
@@ -409,7 +409,7 @@ Subdivider::ccwTurn_tl( Arc_ptr j1, Arc_ptr j2 )
assert( v2 != v2last );
#ifndef NDEBUG
_glu_dprintf( "arc_ccw_turn, p = %d\n", 1 );
dprintf( "arc_ccw_turn, p = %d\n", 1 );
#endif
// the arcs lie on the line (1 == v1->param[1])
@@ -427,7 +427,7 @@ Subdivider::ccwTurn_tl( Arc_ptr j1, Arc_ptr j2 )
while( 1 ) {
if( v1next->param[1] > v2next->param[1] ) {
#ifndef NDEBUG
_glu_dprintf( "case c\n" );
dprintf( "case c\n" );
#endif
assert( v1->param[1] >= v1next->param[1] );
assert( v2->param[1] >= v1next->param[1] );
@@ -441,11 +441,11 @@ Subdivider::ccwTurn_tl( Arc_ptr j1, Arc_ptr j2 )
else {
v1 = v1next--;
#ifdef DEBUG
_glu_dprintf( "decr\n" );
dprintf( "decr\n" );
#endif
if( v1 == v1last ) {
#ifdef DEBUG
_glu_dprintf( "no good results\n" );
dprintf( "no good results\n" );
#endif
return 0; // ill-conditioned, guess answer
}
@@ -456,7 +456,7 @@ Subdivider::ccwTurn_tl( Arc_ptr j1, Arc_ptr j2 )
}
} else if( v1next->param[1] < v2next->param[1] ) {
#ifndef NDEBUG
_glu_dprintf( "case d\n" );
dprintf( "case d\n" );
assert( v1->param[1] >= v2next->param[1] );
assert( v2->param[1] >= v2next->param[1] );
#endif
@@ -470,11 +470,11 @@ Subdivider::ccwTurn_tl( Arc_ptr j1, Arc_ptr j2 )
else {
v2 = v2next++;
#ifdef DEBUG
_glu_dprintf( "incr\n" );
dprintf( "incr\n" );
#endif
if( v2 == v2last ) {
#ifdef DEBUG
_glu_dprintf( "no good results\n" );
dprintf( "no good results\n" );
#endif
return 0; // ill-conditioned, guess answer
}
@@ -485,7 +485,7 @@ Subdivider::ccwTurn_tl( Arc_ptr j1, Arc_ptr j2 )
}
} else {
#ifdef DEBUG
_glu_dprintf( "case cd\n" );
dprintf( "case cd\n" );
#endif
if( v1next->param[0] < v2next->param[0] )
return 0;
@@ -494,11 +494,11 @@ Subdivider::ccwTurn_tl( Arc_ptr j1, Arc_ptr j2 )
else {
v2 = v2next++;
#ifdef DEBUG
_glu_dprintf( "incr\n" );
dprintf( "incr\n" );
#endif
if( v2 == v2last ) {
#ifdef DEBUG
_glu_dprintf( "no good results\n" );
dprintf( "no good results\n" );
#endif
return 0; // ill-conditioned, guess answer
}

View File

@@ -35,8 +35,8 @@
/*
* flistsorter.h
*
* $Date: 2006/03/29 18:54:00 $ $Revision: 1.2 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/flistsorter.h,v 1.2 2006/03/29 18:54:00 brianp Exp $
* $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/flistsorter.h,v 1.1 2001/03/17 00:25:41 brianp Exp $
*/
#ifndef __gluflistsorter_h_
@@ -48,7 +48,6 @@
class FlistSorter : public Sorter {
public:
FlistSorter(void);
virtual ~FlistSorter() { /* silence warning*/ }
void qsort( REAL *a, int n );
protected:

View File

@@ -129,11 +129,11 @@ int Knotvector::validate( void )
void Knotvector::show( char *msg )
{
#ifndef NDEBUG
_glu_dprintf( "%s\n", msg );
_glu_dprintf( "order = %ld, count = %ld\n", order, knotcount );
dprintf( "%s\n", msg );
dprintf( "order = %ld, count = %ld\n", order, knotcount );
for( int i=0; i<knotcount; i++ )
_glu_dprintf( "knot[%d] = %g\n", i, knotlist[i] );
dprintf( "knot[%d] = %g\n", i, knotlist[i] );
#endif
}

View File

@@ -232,7 +232,7 @@ NurbsTessellator::pwlcurve( long count, INREAL array[], long byte_stride, long t
}
if( i != count ) {
do_nurbserror( 37 );
_glu_dprintf( "point %d (%f,%f)\n", i, x, y );
dprintf( "point %d (%f,%f)\n", i, x, y );
isDataValid = 0;
return;
}
@@ -247,7 +247,7 @@ NurbsTessellator::pwlcurve( long count, INREAL array[], long byte_stride, long t
}
if( i != count ) {
do_nurbserror( 37 );
_glu_dprintf( "point %d (%f,%f)\n", i, x, y );
dprintf( "point %d (%f,%f)\n", i, x, y );
isDataValid = 0;
return;
}
@@ -460,7 +460,7 @@ NurbsTessellator::setnurbsproperty( long type, long purpose, INREAL *mat )
mapdesc->setBboxsize( mat );
} else {
#ifndef NDEBUG
_glu_dprintf( "ERRORRORRORR!!!\n");
dprintf( "ERRORRORRORR!!!\n");
#endif
}
}
@@ -488,7 +488,7 @@ NurbsTessellator::setnurbsproperty( long type, long purpose, INREAL *mat,
mapdesc->setBmat( mat, rstride, cstride );
} else {
#ifndef NDEBUG
_glu_dprintf( "ERRORRORRORR!!!\n");
dprintf( "ERRORRORRORR!!!\n");
#endif
}
}

View File

@@ -35,8 +35,8 @@
/*
* nurbstess.c++
*
* $Date: 2006/03/14 15:08:52 $ $Revision: 1.2 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/nurbstess.cc,v 1.2 2006/03/14 15:08:52 brianp Exp $
* $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/nurbstess.cc,v 1.1 2001/03/17 00:25:41 brianp Exp $
*/
#include "glimports.h"
@@ -79,7 +79,7 @@ void
NurbsTessellator::makeobj( int )
{
#ifndef NDEBUG
_glu_dprintf( "makeobj\n" );
dprintf( "makeobj\n" );
#endif
}
@@ -87,7 +87,7 @@ void
NurbsTessellator::closeobj( void )
{
#ifndef NDEBUG
_glu_dprintf( "closeobj\n" );
dprintf( "closeobj\n" );
#endif
}
@@ -95,7 +95,7 @@ void
NurbsTessellator::bgnrender( void )
{
#ifndef NDEBUG
_glu_dprintf( "bgnrender\n" );
dprintf( "bgnrender\n" );
#endif
}
@@ -103,7 +103,7 @@ void
NurbsTessellator::endrender( void )
{
#ifndef NDEBUG
_glu_dprintf( "endrender\n" );
dprintf( "endrender\n" );
#endif
}

View File

@@ -35,8 +35,8 @@
/*
* patch.c++
*
* $Date: 2006/03/14 15:08:52 $ $Revision: 1.4 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/patch.cc,v 1.4 2006/03/14 15:08:52 brianp Exp $
* $Date: 2002/11/01 23:35:07 $ $Revision: 1.3 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/patch.cc,v 1.3 2002/11/01 23:35:07 brianp Exp $
*/
#include <stdio.h>
@@ -439,7 +439,7 @@ Patch::getstepsize( void )
}
#ifdef DEBUG
_glu_dprintf( "sidesteps %g %g %g %g, stepsize %g %g\n",
dprintf( "sidesteps %g %g %g %g, stepsize %g %g\n",
pspec[0].sidestep[0], pspec[0].sidestep[1],
pspec[1].sidestep[0], pspec[1].sidestep[1],
pspec[0].stepsize, pspec[1].stepsize );

View File

@@ -35,8 +35,8 @@
/*
* quilt.c++
*
* $Date: 2006/03/14 15:08:52 $ $Revision: 1.3 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/quilt.cc,v 1.3 2006/03/14 15:08:52 brianp Exp $
* $Date: 2002/11/01 23:35:07 $ $Revision: 1.2 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/quilt.cc,v 1.2 2002/11/01 23:35:07 brianp Exp $
*/
#include "glimports.h"
@@ -91,12 +91,12 @@ Quilt::show( void )
for( int i=0; i!= qspec[0].order * qspec[0].width; i++ ) {
for( int j = 0; j!= qspec[1].order * qspec[1].width; j++ ) {
for( int k=0; k < nc; k++ )
_glu_dprintf( "%g ", ps[i*qspec[0].stride + j*qspec[1].stride + k] );
_glu_dprintf( "\n" );
dprintf( "%g ", ps[i*qspec[0].stride + j*qspec[1].stride + k] );
dprintf( "\n" );
}
_glu_dprintf( "\n" );
dprintf( "\n" );
}
_glu_dprintf( "\n" );
dprintf( "\n" );
#endif
}

View File

@@ -35,8 +35,8 @@
/*
* sorter.c++
*
* $Date: 2006/03/14 15:08:52 $ $Revision: 1.3 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/sorter.cc,v 1.3 2006/03/14 15:08:52 brianp Exp $
* $Date: 2001/11/29 16:16:55 $ $Revision: 1.2 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/sorter.cc,v 1.2 2001/11/29 16:16:55 kschultz Exp $
*/
#include "glimports.h"
@@ -57,7 +57,7 @@ Sorter::qsort( void *a, int n )
int
Sorter::qscmp( char *, char * )
{
_glu_dprintf( "Sorter::qscmp: pure virtual called\n" );
dprintf( "Sorter::qscmp: pure virtual called\n" );
return 0;
}
@@ -65,14 +65,14 @@ Sorter::qscmp( char *, char * )
void
Sorter::qsexc( char *, char * )
{
_glu_dprintf( "Sorter::qsexc: pure virtual called\n" );
dprintf( "Sorter::qsexc: pure virtual called\n" );
}
void
Sorter::qstexc( char *, char *, char * )
{
_glu_dprintf( "Sorter::qstexc: pure virtual called\n" );
dprintf( "Sorter::qstexc: pure virtual called\n" );
}
void

View File

@@ -31,10 +31,10 @@
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
** $Date: 2006/03/29 18:54:00 $ $Revision: 1.2 $
** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $
*/
/*
** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/sorter.h,v 1.2 2006/03/29 18:54:00 brianp Exp $
** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/sorter.h,v 1.1 2001/03/17 00:25:41 brianp Exp $
*/
#ifndef __glusorter_h_
@@ -43,7 +43,6 @@
class Sorter {
public:
Sorter( int es );
virtual ~Sorter() { /* silence warning*/ }
void qsort( void *a, int n );
protected:

View File

@@ -35,8 +35,8 @@
/*
* splitarcs.c++
*
* $Date: 2006/03/14 15:08:52 $ $Revision: 1.2 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/splitarcs.cc,v 1.2 2006/03/14 15:08:52 brianp Exp $
* $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/splitarcs.cc,v 1.1 2001/03/17 00:25:41 brianp Exp $
*/
#include "glimports.h"
@@ -133,14 +133,14 @@ Subdivider::check_s( Arc_ptr jarc1, Arc_ptr jarc2 )
undersampling */
if( ! ( jarc1->tail()[0] < (jarc1)->head()[0] ) ) {
#ifndef NDEBUG
_glu_dprintf( "s difference %f\n", (jarc1)->tail()[0] - (jarc1)->head()[0] );
dprintf( "s difference %f\n", (jarc1)->tail()[0] - (jarc1)->head()[0] );
#endif
::mylongjmp( jumpbuffer, 28 );
}
if( ! ( jarc2->tail()[0] > (jarc2)->head()[0] ) ) {
#ifndef NDEBUG
_glu_dprintf( "s difference %f\n", (jarc2)->tail()[0] - (jarc2)->head()[0] );
dprintf( "s difference %f\n", (jarc2)->tail()[0] - (jarc2)->head()[0] );
#endif
::mylongjmp( jumpbuffer, 28 );
}
@@ -232,14 +232,14 @@ Subdivider::check_t( Arc_ptr jarc1, Arc_ptr jarc2 )
undersampling */
if( ! ( jarc1->tail()[1] < (jarc1)->head()[1] ) ) {
#ifndef NDEBUG
_glu_dprintf( "t difference %f\n", jarc1->tail()[1] - (jarc1)->head()[1] );
dprintf( "t difference %f\n", jarc1->tail()[1] - (jarc1)->head()[1] );
#endif
::mylongjmp( jumpbuffer, 28 );
}
if( ! ( jarc2->tail()[1] > (jarc2)->head()[1] ) ) {
#ifndef NDEBUG
_glu_dprintf( "t difference %f\n", jarc2->tail()[1] - (jarc2)->head()[1] );
dprintf( "t difference %f\n", jarc2->tail()[1] - (jarc2)->head()[1] );
#endif
::mylongjmp( jumpbuffer, 28 );
}

View File

@@ -35,8 +35,8 @@
/*
* tobezier.c++
*
* $Date: 2006/03/14 15:08:52 $ $Revision: 1.2 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/tobezier.cc,v 1.2 2006/03/14 15:08:52 brianp Exp $
* $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/tobezier.cc,v 1.1 2001/03/17 00:25:41 brianp Exp $
*/
#include "glimports.h"
@@ -360,7 +360,7 @@ Knotspec::showpts( REAL *outpt )
next->showpts( outpt );
} else {
for( REAL *lpt=outpt+prewidth; outpt != lpt; outpt += poststride )
_glu_dprintf( "show %g %g %g\n", outpt[0], outpt[1], outpt[2] );
dprintf( "show %g %g %g\n", outpt[0], outpt[1], outpt[2] );
}
}

View File

@@ -31,10 +31,10 @@
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
** $Date: 2006/03/29 18:46:46 $ $Revision: 1.5 $
** $Date: 2005/10/28 13:09:23 $ $Revision: 1.4 $
*/
/*
** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/monoTriangulation.cc,v 1.5 2006/03/29 18:46:46 brianp Exp $
** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/monoTriangulation.cc,v 1.4 2005/10/28 13:09:23 brianp Exp $
*/
#include <stdlib.h>
@@ -619,10 +619,8 @@ void monoTriangulationFun(directedLine* monoPolygon, Int (*compFun)(Real*, Real*
dec_chain.appendVertex(tempV->getVertex(i));
}
if (!(0 == inc_chain.getNumElements() && 0 == dec_chain.getNumElements())) {
monoTriangulationRecFun(topV->head(), botV->head(), &inc_chain, 0,
&dec_chain, 0, compFun, pStream);
}
monoTriangulationRecFun(topV->head(), botV->head(), &inc_chain, 0, &dec_chain, 0, compFun, pStream);
}
void monoTriangulation(directedLine* monoPolygon, primStream* pStream)

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