Commit 027fdb8b authored by Keith Whitwell's avatar Keith Whitwell
Browse files

Merge head into branch

parent 3a7c3b02
......@@ -33,6 +33,7 @@ VERSION=$(MESA_MAJOR).$(MESA_MINOR)
# ASM_SOURCES optional list of assembly language files to assemble
# MAKELIB the script or command to make a library file
# XXX MAKELIB is obsolete; edit bin/mklib to support new systems
# MKLIB_OPTIONS extra options to pass to the mklib script (like -arch)
aix:
......@@ -527,10 +528,10 @@ linux-glide:
"CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DFX -DPTHREADS -I/usr/X11R6/include -I/usr/include/glide -I/usr/local/glide/include" \
"CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE" \
"GLUT_CFLAGS = -fexceptions" \
"GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -L/usr/local/glide/lib -lglide2x" \
"GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -L/usr/local/glide/lib -lglide3x" \
"GLU_LIB_DEPS = -L$(TOP)/lib -lGL -lm" \
"GLUT_LIB_DEPS = -L$(TOP)/lib -lGLU -lGL -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm" \
"APP_LIB_DEPS = -L/usr/local/glide/lib -lglide2x -lglut -lGLU -lGL"
"APP_LIB_DEPS = -L/usr/local/glide/lib -lglide3x -lglut -lGLU -lGL"
linux-x86-glide:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
......@@ -544,7 +545,7 @@ linux-x86-glide:
"CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -funroll-loops -fomit-frame-pointer -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM -DUSE_XSHM -DFX -DPTHREADS -I/usr/X11R6/include -I/usr/include/glide -I/usr/local/glide/include -I/usr/src/mesa-glx/src/FX/X86" \
"CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -funroll-loops -fomit-frame-pointer -D_SVID_SOURCE -D_BSD_SOURCE" \
"GLUT_CFLAGS = -fexceptions" \
"GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -L/usr/local/glide/lib -lglide2x -lm -lpthread" \
"GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -L/usr/local/glide/lib -lglide3x -lm -lpthread" \
"GLU_LIB_DEPS = -L$(TOP)/lib -lGL -lm" \
"GLUT_LIB_DEPS = -L$(TOP)/lib -lGLU -lGL -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm" \
"GLW_LIB_DEPS = -L$(TOP)/lib -lGL -L/usr/X11R6/lib -lXt -lX11" \
......@@ -678,12 +679,24 @@ linux-osmesa16:
"OSMESA16_LIB = libOSMesa16.so" \
"CC = gcc" \
"CXX = g++" \
"CFLAGS = -O3 -ansi -pedantic -Wall -Wmissing-prototypes -Wundef -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM -DPTHREADS -DCHAN_BITS=16 -DDEFAULT_SOFTWARE_DEPTH_BITS=31" \
"CXXFLAGS = -O3 -ansi -pedantic -Wall -Wmissing-prototypes -Wundef -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE" \
"CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=16 -DDEFAULT_SOFTWARE_DEPTH_BITS=31" \
"CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE" \
"GLUT_CFLAGS = -fexceptions" \
"GL_LIB_DEPS = -lm -lpthread" \
"APP_LIB_DEPS = -lOSMesa16 -lGL"
linux-osmesa16-static:
$(MAKE) $(MFLAGS) -f Makefile.OSMesa16 targets \
"OSMESA16_LIB = libOSMesa16.a" \
"CC = gcc" \
"CXX = g++" \
"CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=16 -DDEFAULT_SOFTWARE_DEPTH_BITS=31" \
"CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE" \
"GLUT_CFLAGS = -fexceptions" \
"GL_LIB_DEPS = -lm -lpthread" \
"MAKELIB_FLAGS = -static" \
"APP_LIB_DEPS = -lOSMesa16 -lGL"
# 32-bit/channel Mesa using OSMesa driver
linux-osmesa32:
$(MAKE) $(MFLAGS) -f Makefile.OSMesa16 targets \
......@@ -700,6 +713,7 @@ linux-osmesa32:
# change -g to -O3 for non-debug
linux-solo:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
"SOLO = true" \
"LIBMESA = mesa.a" \
"GLU_LIB = libGLU.so" \
"GLUT_LIB = libglut.so" \
......@@ -708,7 +722,7 @@ linux-solo:
"CFLAGS = -g -std=c99 -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE" \
"CXXFLAGS = -g -std=c99 -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE" \
"GLUT_CFLAGS = -fexceptions" \
"GL_LIB_DEPS = -lm -lpthread" \
"GL_LIB_DEPS = -lm -lpthread -lexpat" \
"GLU_LIB_DEPS = -L$(TOP)/lib -lGL -lm -Wl,-rpath,$(TOP)/lib" \
"GLUT_LIB_DEPS = -L$(TOP)/lib -lGLU -lGL -lm -Wl,-rpath,$(TOP)/lib" \
"APP_LIB_DEPS = -L$(TOP)/lib -lglut -lGLU -lGL -lm -lpthread -Wl,-rpath,$(TOP)/lib"
......@@ -1078,5 +1092,5 @@ linux-glide-debug:
"CFLAGS = -g -ansi -pedantic -Wall -Wmissing-prototypes -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM -DPTHREADS -DFX -DDEBUG -I/usr/local/glide/include -I/usr/include/glide" \
"CXXFLAGS = -g -ansi -pedantic -Wall -Wmissing-prototypes -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -DDEBUG" \
"GLUT_CFLAGS = -fexceptions" \
"APP_LIB_DEPS = -L/usr/local/glide/lib -lglide2x -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lvga -lm -lpthread"
"APP_LIB_DEPS = -L/usr/local/glide/lib -lglide3x -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lvga -lm -lpthread"
This diff is collapsed.
# Mesa 3-D graphics library
# Version: 5.1
#
# Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# Win32/FX makefile for Mesa
#
# Copyright (c) 2003 - Hiroshi Morii
# Email : koolsmoky@users.sourceforge.net
# URL : http://www.3dfxzone.it/koolsmoky
# Debug build : nmake -f Makefile.wfx debug
# Optimized build : nmake -f Makefile.wfx
# Remove objects : nmake -f Makefile.wfx clean
# Remove files in bin, lib : nmake -f Makefile.wfx clobber
# Remove all generated files : nmake -f Makefile.wfx realclean
# Build the libs
SUBDIRS = src\mesa.dir
DBGBUILD = $(SUBDIRS:.dir=.debug)
CLEAN = $(SUBDIRS:.dir=.clean)
CLOBBER = $(SUBDIRS:.dir=.clobber)
REALCLEAN = $(SUBDIRS:.dir=.realclean)
LIBDIR = lib
# default rule
default : $(LIBDIR) $(SUBDIRS)
# debug build rules
debug : $(LIBDIR) $(DBGBUILD)
# cleanup rules
clean : $(CLEAN)
clobber : $(CLOBBER)
realclean : $(REALCLEAN)
# inference rules
$(LIBDIR):
@echo.
@mkdir $(LIBDIR)
$(SUBDIRS):
@echo.
@cd $*
@nmake -f Makefile.wfx
@cd ..
$(DBGBUILD):
@echo.
@cd $*
@nmake -f Makefile.wfx DEBUG=1
@cd ..
$(CLEAN):
@echo.
@cd $*
@nmake -f Makefile.wfx clean
@cd ..
$(CLOBBER):
@echo.
@cd $*
@nmake -f Makefile.wfx clobber
@cd ..
$(REALCLEAN):
@echo.
@cd $*
@nmake -f Makefile.wfx realclean
@cd ..
......@@ -110,29 +110,40 @@ case $ARCH in
'Linux')
LIBNAME="lib${LIBNAME}" # prefix with "lib"
OPTS="-Xlinker -Bsymbolic -shared -Wl,-soname,${LIBNAME}.so.${MAJOR}"
VERSION="${MAJOR}.${MINOR}.${PATCH}"
echo "mklib: Making Linux shared library: " ${LIBNAME}.so.${VERSION}
if [ $CPLUSPLUS = 1 ] ; then
LINK="g++"
else
LINK="gcc"
fi
# rm any old libs
rm -f ${LIBNAME}.so.${VERSION}
rm -f ${LIBNAME}.so.${MAJOR}
rm -f ${LIBNAME}.so
# make lib
${LINK} ${OPTS} -o ${LIBNAME}.so.${VERSION} ${OBJECTS} ${DEPS}
# make usual symlinks
ln -s ${LIBNAME}.so.${VERSION} ${LIBNAME}.so.${MAJOR}
ln -s ${LIBNAME}.so.${MAJOR} ${LIBNAME}.so
# finish up
FINAL_LIBS="${LIBNAME}.so.${VERSION} ${LIBNAME}.so.${MAJOR} ${LIBNAME}.so"
if [ $STATIC = 1 ] ; then
echo "mklib: Making Linux static library: " ${LIBNAME}.a
LINK="ar"
OPTS="-ruv"
# make lib
${LINK} ${OPTS} ${LIBNAME}.a ${OBJECTS}
# finish up
FINAL_LIBS="${LIBNAME}.a"
else
OPTS="-Xlinker -Bsymbolic -shared -Wl,-soname,${LIBNAME}.so.${MAJOR}"
VERSION="${MAJOR}.${MINOR}.${PATCH}"
echo "mklib: Making Linux shared library: " ${LIBNAME}.so.${VERSION}
if [ $CPLUSPLUS = 1 ] ; then
LINK="g++"
else
LINK="gcc"
fi
# rm any old libs
rm -f ${LIBNAME}.so.${VERSION}
rm -f ${LIBNAME}.so.${MAJOR}
rm -f ${LIBNAME}.so
# make lib
${LINK} ${OPTS} -o ${LIBNAME}.so.${VERSION} ${OBJECTS} ${DEPS}
# make usual symlinks
ln -s ${LIBNAME}.so.${VERSION} ${LIBNAME}.so.${MAJOR}
ln -s ${LIBNAME}.so.${MAJOR} ${LIBNAME}.so
# finish up
FINAL_LIBS="${LIBNAME}.so.${VERSION} ${LIBNAME}.so.${MAJOR} ${LIBNAME}.so"
fi
;;
'SunOS')
......@@ -302,6 +313,13 @@ case $ARCH in
FINAL_LIBS=${LIBNAME}
;;
'MorphOS')
LIBNAME="lib${LIBNAME}.a"
echo "mklib: Making MorphOS library: " ${LIBNAME}
ppc-morphos-ar rc ${LIBNAME} ${OBJECTS}
FINAL_LIBS="${LIBNAME}"
;;
'example')
# If you're adding support for a new architecture, you can
# start with this:
......@@ -317,7 +335,9 @@ case $ARCH in
echo "mklib: WARNING: please update the bin/mklib script!"
# XXX this is a total hack for Mesa - remove someday
# fall-back to an old mklib.* script
${MAKELIB} "lib${LIBNAME}.a" ${MAJOR} ${MINOR} ${PATCH} ${OBJECTS}
LIBNAME="lib${LIBNAME}.a"
${TOP}/${MAKELIB} "lib${LIBNAME}.a" ${MAJOR} ${MINOR} ${PATCH} ${OBJECTS}
FINAL_LIBS="${LIBNAME}"
;;
esac
......
......@@ -3,6 +3,65 @@
Mesa-5.1 release notes:
-----------------------
1) Glide2 support has been ceased; in order to keep Voodoo Graphics
and Voodoo Rush compatibility, please visit the Glide SourceForge
and help us to fix Glide3 for those cards.
2) The current release is a WIP; among other things, the Linux build works
only to some extent. Any help will be appreciated.
3) Glide3 can be found at http://sourceforge.net/projects/glide/
Known supported HW/OS:
----------------------
Voodoo^2, Voodoo Banshee, Voodoo3, Voodoo4, Voodoo5
DOS (DJGPP), Windows9x/2k (MinGW/MSVC), Linux
How to compile:
---------------
DJGPP/MinGW/MSVC:
Place the Glide3 SDK in the top Mesa directory:
$(MESA)/glide3/include/*.h
$(MESA)/glide3/lib/
Required headers:
3dfx.h, g3ext.h, glide.h, glidesys.h, glideutl.h, sst1vid.h
Required libraries:
OS specific
Type:
make -f Makefile.DJ HAVE_MMX=1 HAVE_3DNOW=1 FX=1
or
make -f Makefile.mgw HAVE_MMX=1 HAVE_3DNOW=1 FX=1
or
nmake -f Makefile.wfx
Look into the corresponding makefiles for further information.
Linux:
Place the Glide3 SDK in /usr/local/glide
Type:
make linux-glide
Contact:
--------
Daniel Borca <dborca@users.sourceforge.net>
Hiroshi Morii <koolsmoky@users.sourceforge.net>
The info below this line is outdated. You have been warned...
*************************************************************
Info for Mesa 4.1
-----------------
......
......@@ -209,11 +209,12 @@ v1.3 (mar-2003)
* revamped GLUT
* switched to DXE3
v1.4 (oct-2003)
v1.4 (nov-2003)
+ enabled GLUT fonts with DXE
+ truly added multi-window support in GLUT (for Adrian Woodward)
* accomodated makefiles with the new sourcetree
* fixed some ALPHA issues
* minor changes to PC_HW/timer interface
x hacked and slashed the 3dfx driver (w/ help from Hiroshi Morii)
......
......@@ -75,6 +75,12 @@ Details and Notes
- No assembly code is compiled or assembled. Again, this may need
some work to turn it back on or use it again.
- To build "mangled" Mesa, add the preprocessor define USE_MGL_NAMESPACE
to the project settings. You will also need to edit src/mesa.def to change
all the gl* symbols to mgl*. Because this is easy to do with a global
replace operation in a text editor, no additional mangled version of mesa.def
is maintained or shipped.
If you have a Windows-related build problem or question, it is
probably better to direct it to me (kschultz@users.sourceforge.net),
rather than directly to the other Mesa developers. I will help you
......
......@@ -1164,10 +1164,17 @@ Mesa Version History
- less memory used for display lists and vertex buffers
- demo of per-pixel lighting with a fragment program (demos/fplight.c)
- new version (18) of glext.h header
- new spriteblast.c demo of GL_ARB_point_sprite
Bug fixes:
- really enable OpenGL 1.4 features in DOS driver.
- fixed issues in glDrawPixels and glCopyPixels for very wide images
- glPixelMapf/ui/usv()'s size parameter is GLsizei, not GLint
- fixed some texgen bugs reported by Daniel Borca
- fixed wglMakeCurrent(NULL, NULL) bug (#835861)
- fixed glTexSubImage3D z-offset bug (Cedric Gautier)
- fixed RGBA blend enable bug (Ville Syrjala)
- glAccum is supposed to be a no-op in selection/feedback mode
- fixed texgen bug #597589 (John Popplewell)
Changes:
- dropped API trace feature (src/Trace/)
- documentation overhaul. merged with website content. more html.
......
......@@ -17,7 +17,7 @@ available. Here are the basic instructions for Unix systems:
login</code>
</li><li>Just hit return at the <code>CVS password:</code> prompt.
</li><li>Then checkout mesa: <code>cvs -z3 -d:pserver:anonymous@cvs.mesa3d.sourceforge.net:/cvsroot/mesa3d
co Mesa</code>
co Mesa-newtree</code>
</li></ol>
<p>To update your Mesa CVS source to the latest CVS source:
......@@ -34,4 +34,4 @@ available. Here are the basic instructions for Unix systems:
</p>
</body>
</html>
\ No newline at end of file
</html>
......@@ -7,6 +7,26 @@
<H1>News</H1>
<H2>November 12, 2003</H2>
<p>
New Mesa 5.0.2 tarballs have been uploaded to SourceForge which fix a
number of automake/libtool problems.
</p>
<p>
The new MD5 checksums are:
</p>
<pre>
a9dcf3ff9ad1b7d6ce73a0df7cff8b5b MesaLib-5.0.2.tar.gz
7b4bf9261657c2fca03796d4955e6f50 MesaLib-5.0.2.tar.bz2
79c141bddcbad557647535d02194f346 MesaLib-5.0.2.zip
952d9dc823dd818981d1a648d7b2668a MesaDemos-5.0.2.tar.gz
b81fafff90995025d2f25ea02b786642 MesaDemos-5.0.2.tar.bz2
a21be975589e8a2d1871b6bb7874fffa MesaDemos-5.0.2.zip
</pre>
<h2>September 5, 2003</h2>
<p>
......@@ -39,18 +59,6 @@ Mesa 5.0.2 has been released. This is a stable, bug-fix release.
Changes:
- build GLUT with -fexceptions so C++ apps propogate exceptions
</pre>
<p>
MD5 checksums follow:
</p>
<pre>
2deb4176e7a06a0477ae31cadd55444b MesaLib-5.0.2.tar.gz
dc147598ebdff4312260a7f79b3c5c9c MesaLib-5.0.2.tar.bz2
1eb0fa7079131efef574e3bda328b8c8 MesaLib-5.0.2.zip
e0dc86e9417620e794968641403604d4 MesaDemos-5.0.2.tar.gz
a71afaeddd0b567423f88085576850d3 MesaDemos-5.0.2.tar.bz2
32fbf1925cf45f548468ddda96087828 MesaDemos-5.0.2.zip
</pre>
......@@ -673,6 +681,6 @@ source code</a>.</p>
<hr>
$Id: news.html,v 3.7 2003/09/05 13:39:39 brianp Exp $
$Id: news.html,v 3.7.2.1 2003/11/24 12:01:42 keithw Exp $
</body>
</html>
\ No newline at end of file
......@@ -22,7 +22,7 @@
/*
* FXMesa - 3Dfx Glide driver for Mesa. Contributed by David Bucciarelli
*
* NOTE: This version requires Glide 2.3 or later.
* NOTE: This version requires Glide3 (http://sourceforge.net/projects/glide)
*/
......
......@@ -2261,6 +2261,16 @@ typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC)(GLuint id, GLenum pname,
#endif /* GL_ARB_occlusion_query */
/* XXX temporary until glext.h is updated! */
#ifndef GL_ARB_point_sprite
#define GL_ARB_point_sprite 1
#define GL_POINT_SPRITE_ARB 0x8861
#define GL_COORD_REPLACE_ARB 0x8862
#endif /* GL_ARB_point_sprite */
#ifndef GL_MESA_program_debug
#define GL_MESA_program_debug 1
......
......@@ -40,6 +40,10 @@
#define GLAPIENTRY
#endif
#ifndef GLAPIENTRYP
#define GLAPIENTRYP GLAPIENTRY *
#endif
#ifndef GLAPI
#define GLAPI
#endif
......@@ -266,7 +270,7 @@ typedef GLUtesselator GLUtriangulatorObj;
#define GLU_TESS_MAX_COORD 1.0e150
/* Internal convenience typedefs */
typedef void (GLAPIENTRY *_GLUfuncptr)();
typedef void (GLAPIENTRYP _GLUfuncptr)();
GLAPI void GLAPIENTRY gluBeginCurve (GLUnurbs* nurb);
GLAPI void GLAPIENTRY gluBeginPolygon (GLUtesselator* tess);
......
......@@ -80,5 +80,7 @@
#define gluBuild3DMipmaps mgluBuild3DMipmaps
#define gluCheckExtension mgluCheckExtension
#define gluUnProject4 mgluUnProject4
#define gluNurbsCallbackData mgluNurbsCallbackData
#define gluNurbsCallbackDataEXT mgluNurbsCallbackDataEXT
#endif
......@@ -648,7 +648,7 @@ GLUTAPI void GLUTAPIENTRY glutJoystickFunc(void (GLUTCALLBACK *func)(unsigned in
#endif
/* GLUT color index sub-API. */
GLUTAPI void GLUTAPIENTRY glutSetColor(int, GLfloat red, GLfloat green, GLfloat blue);
GLUTAPI void GLUTAPIENTRY glutSetColor(int ndx, GLfloat red, GLfloat green, GLfloat blue);
GLUTAPI GLfloat GLUTAPIENTRY glutGetColor(int ndx, int component);
GLUTAPI void GLUTAPIENTRY glutCopyColormap(int win);
......
......@@ -11,7 +11,6 @@
#ifdef _WIN32
#include <windows.h>
#endif
#define GL_GLEXT_LEGACY
#include <GL/glut.h>
......
......@@ -34,8 +34,6 @@ static GLboolean UseObj = GL_FALSE;
static void draw( void )
{
glDepthFunc(GL_EQUAL);
/* glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );*/
glClear( GL_COLOR_BUFFER_BIT );
glColor3f( 1.0, 1.0, 1.0 );
......
......@@ -50,7 +50,7 @@ CC = mingw32-gcc
CFLAGS = -Wall -W -pedantic
CFLAGS += -O2 -ffast-math -mcpu=$(CPU)
CFLAGS += -I$(TOP)/include -I../util
CFLAGS += -DGLUT_DISABLE_ATEXIT_HACK
CFLAGS += -DGLUT_DISABLE_ATEXIT_HACK -D_STDCALL_SUPPORTED
CFLAGS += -D_WINDEF_ -D_WINGDI_
LD = mingw32-g++
......
......@@ -159,12 +159,48 @@ static void SpecialKey( int key, int x, int y )
static void MakeObject1(struct object *obj)
{
GLfloat *v, *c;
void *p;
int i;
GLubyte buffer[500];
for (i = 0; i < 500; i++)
buffer[i] = i & 0xff;
glGenBuffersARB(1, &obj->BufferID);
glBindBufferARB(GL_ARRAY_BUFFER_ARB, obj->BufferID);
glBufferDataARB(GL_ARRAY_BUFFER_ARB, 1000, NULL, GL_STATIC_DRAW_ARB);
glBufferDataARB(GL_ARRAY_BUFFER_ARB, 500, buffer, GL_STATIC_DRAW_ARB);
for (i = 0; i < 500; i++)
buffer[i] = 0;
glGetBufferSubDataARB(GL_ARRAY_BUFFER_ARB, 0, 500, buffer);
for (i = 0; i < 500; i++)
assert(buffer[i] == (i & 0xff));
glGetBufferParameterivARB(GL_ARRAY_BUFFER_ARB, GL_BUFFER_MAPPED_ARB, &i);
assert(!i);
glGetBufferParameterivARB(GL_ARRAY_BUFFER_ARB, GL_BUFFER_USAGE_ARB, &i);
v = (GLfloat *) glMapBufferARB(GL_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB);
/* do some sanity tests */
glGetBufferPointervARB(GL_ARRAY_BUFFER_ARB, GL_BUFFER_MAP_POINTER_ARB, &p);
assert(p == v);
glGetBufferParameterivARB(GL_ARRAY_BUFFER_ARB, GL_BUFFER_SIZE_ARB, &i);
assert(i == 500);
glGetBufferParameterivARB(GL_ARRAY_BUFFER_ARB, GL_BUFFER_USAGE_ARB, &i);
assert(i == GL_STATIC_DRAW_ARB);
glGetBufferParameterivARB(GL_ARRAY_BUFFER_ARB, GL_BUFFER_ACCESS_ARB, &i);
assert(i == GL_WRITE_ONLY_ARB);
glGetBufferParameterivARB(GL_ARRAY_BUFFER_ARB, GL_BUFFER_MAPPED_ARB, &i);
assert(i);
/* Make rectangle */
v[0] = -1; v[1] = -1; v[2] = 0;
v[3] = 1; v[4] = -1; v[5] = 0;
......@@ -181,6 +217,12 @@ static void MakeObject1(struct object *obj)
obj->NumElements = 0;
glUnmapBufferARB(GL_ARRAY_BUFFER_ARB);
glGetBufferPointervARB(GL_ARRAY_BUFFER_ARB, GL_BUFFER_MAP_POINTER_ARB, &p);
assert(!p);
glGetBufferParameterivARB(GL_ARRAY_BUFFER_ARB, GL_BUFFER_MAPPED_ARB, &i);
assert(!i);
}
......@@ -212,20 +254,18 @@ static void MakeObject2(struct object *obj)
static void MakeObject3(struct object *obj)
{
GLfloat vertexData[1000];
GLfloat *v, *c;
GLuint *i;
glGenBuffersARB(1, &obj->BufferID);
glBindBufferARB(GL_ARRAY_BUFFER_ARB, obj->BufferID);
glBufferDataARB(GL_ARRAY_BUFFER_ARB, 1000, NULL, GL_STATIC_DRAW_ARB);
v = (GLfloat *) glMapBufferARB(GL_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB);
int bytes;
/* Make rectangle */
v = vertexData;
v[0] = -1; v[1] = -0.5; v[2] = 0;
v[3] = 1; v[4] = -0.5; v[5] = 0;
v[6] = 1; v[7] = 0.5; v[8] = 0;
v[9] = -1; v[10] = 0.5; v[11] = 0;
c = v + 12;
c = vertexData + 12;
c[0] = 0; c[1] = 0; c[2] = 1;
c[3] = 0; c[4] = 0; c[5] = 1;
c[6] = 0; c[7] = 1; c[8] = 1;
......@@ -234,7 +274,12 @@ static void MakeObject3(struct object *obj)
obj->VertexOffset = 0;
obj->ColorOffset = 3 * sizeof(GLfloat) * obj->NumVerts;
glUnmapBufferARB(GL_ARRAY_BUFFER_ARB);
bytes = obj->NumVerts * (3 + 3) * sizeof(GLfloat);
/* Don't use glMap/UnmapBuffer for this object */
glGenBuffersARB(1, &obj->BufferID);
glBindBufferARB(GL_ARRAY_BUFFER_ARB, obj->BufferID);
glBufferDataARB(GL_ARRAY_BUFFER_ARB, bytes, vertexData, GL_STATIC_DRAW_ARB);
/* Setup a buffer of indices to test the ELEMENTS path */
glGenBuffersARB(1, &obj->ElementsBufferID);
......