/*
* glcurveval.c++
*
- * $Date: 2001/07/18 11:17:35 $ $Revision: 1.2 $
- * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/interface/glcurveval.cc,v 1.2 2001/07/18 11:17:35 joukj Exp $
+ * $Date: 2001/08/07 17:34:10 $ $Revision: 1.3 $
+ * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/interface/glcurveval.cc,v 1.3 2001/08/07 17:34:10 brianp Exp $
*/
/* Polynomial Evaluator Interface */
}
void
-OpenGLCurveEvaluator::putCallBack(GLenum which, _GLUfuncptr fn )
+#ifdef _WIN32
+OpenGLCurveEvaluator::putCallBack(GLenum which, void (GLAPIENTRY *fn)())
+#else
+OpenGLCurveEvaluator::putCallBack(GLenum which, _GLUfuncptr fn)
+#endif
{
switch(which)
{
/*
* glcurveval.h
*
- * $Date: 2001/07/17 15:39:13 $ $Revision: 1.3 $
- * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/interface/glcurveval.h,v 1.3 2001/07/17 15:39:13 brianp Exp $
+ * $Date: 2001/08/07 17:34:11 $ $Revision: 1.4 $
+ * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/interface/glcurveval.h,v 1.4 2001/08/07 17:34:11 brianp Exp $
*/
#ifndef __gluglcurveval_h_
#define __gluglcurveval_h_
#include "gluos.h"
-#include "GL/gl.h"
-#include "GL/glu.h"
+#include <GL/gl.h>
+#include <GL/glu.h>
#include "basiccrveval.h"
class CurveMap;
{
output_triangles = flag;
}
+#ifdef _WIN32
+ void putCallBack(GLenum which, void (APIENTRY *fn)() );
+#else
void putCallBack(GLenum which, _GLUfuncptr fn );
+#endif
void set_callback_userData(void *data)
{
userData = data;
/*
* glrenderer.h
*
- * $Date: 2001/07/16 15:46:42 $ $Revision: 1.2 $
- * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/interface/glrenderer.h,v 1.2 2001/07/16 15:46:42 brianp Exp $
+ * $Date: 2001/08/07 17:34:11 $ $Revision: 1.3 $
+ * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/interface/glrenderer.h,v 1.3 2001/08/07 17:34:11 brianp Exp $
*/
#ifndef __gluglrenderer_h_
void (APIENTRY *errorCallback)( GLenum );
void postError( int which )
{ if (errorCallback) (errorCallback)( (GLenum)which ); }
-
+#ifdef _WIN32
+ void putSurfCallBack(GLenum which, void (GLAPIENTRY *fn)() )
+#else
void putSurfCallBack(GLenum which, _GLUfuncptr fn )
+#endif
{
curveEvaluator.putCallBack(which, fn);
surfaceEvaluator.putCallBack(which, fn);
/*
* glsurfeval.h
*
- * $Date: 2001/07/17 15:39:13 $ $Revision: 1.3 $
- * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/interface/glsurfeval.h,v 1.3 2001/07/17 15:39:13 brianp Exp $
+ * $Date: 2001/08/07 17:34:11 $ $Revision: 1.4 $
+ * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/interface/glsurfeval.h,v 1.4 2001/08/07 17:34:11 brianp Exp $
*/
#ifndef __gluglsurfeval_h_
#include "basicsurfeval.h"
#include "bezierPatchMesh.h" //in case output triangles
-#include "GL/gl.h"
-#include "GL/glu.h"
+#include <GL/gl.h>
+#include <GL/glu.h>
class SurfaceMap;
class OpenGLSurfaceEvaluator;
void newtmeshvert( REAL, REAL );
void newtmeshvert( long, long );
+#ifdef _WIN32
+ void putCallBack(GLenum which, void (APIENTRY *fn)() );
+#else
void putCallBack(GLenum which, _GLUfuncptr fn );
+#endif
+
int get_vertices_call_back()
{
return output_triangles;
/*
* arc.h
*
- * $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $
- * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/arc.h,v 1.1 2001/03/17 00:25:40 brianp Exp $
+ * $Date: 2001/08/07 17:34:11 $ $Revision: 1.2 $
+ * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/arc.h,v 1.2 2001/08/07 17:34:11 brianp Exp $
*/
#ifndef __gluarc_h_
class Bin;
class Arc;
-class BezierArc;
+struct BezierArc;
typedef class Arc *Arc_ptr;
/*
* arctess.h
*
- * $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $
- * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/arctess.h,v 1.1 2001/03/17 00:25:40 brianp Exp $
+ * $Date: 2001/08/07 17:34:11 $ $Revision: 1.2 $
+ * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/arctess.h,v 1.2 2001/08/07 17:34:11 brianp Exp $
*/
#ifndef __gluarctess_h_
#include "types.h"
#include "arc.h"
-class BezierArc;
+struct BezierArc;
class Pool;
class TrimVertexPool;
/*
* hull.h
*
- * $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $
- * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/hull.h,v 1.1 2001/03/17 00:25:41 brianp Exp $
+ * $Date: 2001/08/07 17:34:11 $ $Revision: 1.2 $
+ * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/hull.h,v 1.2 2001/08/07 17:34:11 brianp Exp $
*/
#ifndef __gluhull_h_
#include "trimline.h"
#include "trimregion.h"
+#include "trimvertex.h"
+#include "gridtrimvertex.h"
-class GridTrimVertex;
-class Gridline;
+struct Gridline;
class Uarray;
class Hull : virtual public TrimRegion {
/*
* mesher.c++
*
- * $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $
- * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/mesher.cc,v 1.1 2001/03/17 00:25:41 brianp Exp $
+ * $Date: 2001/08/07 17:34:11 $ $Revision: 1.2 $
+ * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/mesher.cc,v 1.2 2001/08/07 17:34:11 brianp Exp $
*/
#include "glimports.h"
#include "myassert.h"
#include "mystdio.h"
-#include "mesher.h"
#include "gridvertex.h"
#include "gridtrimvertex.h"
#include "jarcloc.h"
#include "trimline.h"
#include "uarray.h"
#include "backend.h"
+#include "mesher.h"
const float Mesher::ZERO = 0.0;
/*
* mesher.h
*
- * $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $
- * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/mesher.h,v 1.1 2001/03/17 00:25:41 brianp Exp $
+ * $Date: 2001/08/07 17:34:11 $ $Revision: 1.2 $
+ * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/mesher.h,v 1.2 2001/08/07 17:34:11 brianp Exp $
*/
#ifndef __glumesher_h_
class TrimRegion;
class Backend;
class Pool;
-class GridTrimVertex;
+// struct GridTrimVertex;
class Mesher : virtual public TrimRegion, public Hull {
/*
* nurbstess.h
*
- * $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.h,v 1.1 2001/03/17 00:25:41 brianp Exp $
+ * $Date: 2001/08/07 17:34:11 $ $Revision: 1.2 $
+ * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/nurbstess.h,v 1.2 2001/08/07 17:34:11 brianp Exp $
*/
#ifndef __glunurbstess_h_
#include "reader.h"
#include "nurbsconsts.h"
-class Knotvector;
+struct Knotvector;
class Quilt;
class DisplayList;
class BasicCurveEvaluator;
/*
* quilt.h
*
- * $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $
- * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/quilt.h,v 1.1 2001/03/17 00:25:41 brianp Exp $
+ * $Date: 2001/08/07 17:34:11 $ $Revision: 1.2 $
+ * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/quilt.h,v 1.2 2001/08/07 17:34:11 brianp Exp $
*/
#ifndef __gluquilt_h_
class Backend;
class Mapdesc;
class Flist;
-class Knotvector;
+struct Knotvector;
/* constants for memory allocation of NURBS to Bezier conversion */
#define MAXDIM 2
/*
* reader.h
*
- * $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $
- * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/reader.h,v 1.1 2001/03/17 00:25:41 brianp Exp $
+ * $Date: 2001/08/07 17:34:11 $ $Revision: 1.2 $
+ * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/reader.h,v 1.2 2001/08/07 17:34:11 brianp Exp $
*/
#ifndef __glureader_h_
struct O_surface;
struct O_nurbssurface;
struct O_trim;
-struct O_pwlcurve;
+class O_pwlcurve;
struct O_nurbscurve;
struct O_curve;
class Quilt;
/*
* subdivider.h
*
- * $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $
- * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/subdivider.h,v 1.1 2001/03/17 00:25:41 brianp Exp $
+ * $Date: 2001/08/07 17:34:11 $ $Revision: 1.2 $
+ * $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/subdivider.h,v 1.2 2001/08/07 17:34:11 brianp Exp $
*/
#ifndef __glusubdivider_h_
class Quilt;
class Patchlist;
class Curvelist;
-class JumpBuffer;
+struct JumpBuffer;
class Subdivider {
public:
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
-** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $
-** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libutil/mipmap.c,v 1.1 2001/03/17 00:25:41 brianp Exp $
+** $Date: 2001/08/07 17:34:11 $ $Revision: 1.2 $
+** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libutil/mipmap.c,v 1.2 2001/08/07 17:34:11 brianp Exp $
*/
#include "gluos.h"
/*===========================================================================*/
+#ifdef RESOLVE_3D_TEXTURE_SUPPORT
+/*
+ * This section ensures that GLU 1.3 will load and run on
+ * a GL 1.1 implementation. It dynamically resolves the
+ * call to glTexImage3D() which might not be available.
+ * Or is it might be supported as an extension.
+ * Contributed by Gerk Huisma <gerk@five-d.demon.nl>.
+ */
+
+typedef GLAPI void (GLAPIENTRY *TexImage3Dproc)( GLenum target, GLint level,
+ GLenum internalFormat,
+ GLsizei width, GLsizei height,
+ GLsizei depth, GLint border,
+ GLenum format, GLenum type,
+ const GLvoid *pixels );
+
+static TexImage3Dproc pTexImage3D;
+
+#ifndef WIN32
+# include <dlfcn.h>
+# include <sys/types.h>
+#else
+ WINGDIAPI PROC WINAPI wglGetProcAddress(LPCSTR);
+#endif
+
+static void gluTexImage3D( GLenum target, GLint level,
+ GLenum internalFormat,
+ GLsizei width, GLsizei height,
+ GLsizei depth, GLint border,
+ GLenum format, GLenum type,
+ const GLvoid *pixels )
+{
+ if (!pTexImage3D) {
+#ifdef WIN32
+ pTexImage3D = (TexImage3Dproc) wglGetProcAddress("glTexImage3D");
+ if (!pTexImage3D)
+ pTexImage3D = (TexImage3Dproc) wglGetProcAddress("glTexImage3DEXT");
+#else
+ void *libHandle = dlopen("libgl.so", RTLD_LAZY);
+ pTexImage3D = TexImage3Dproc) dlsym(libHandle, "glTexImage3D" );
+ if (!pTexImage3D)
+ pTexImage3D = (TexImage3Dproc) dlsym(libHandle,"glTexImage3DEXT");
+ dlclose(libHandle);
+#endif
+ }
+
+ /* Now call glTexImage3D */
+ if (pTexImage3D)
+ pTexImage3D(target, level, internalFormat, width, height,
+ depth, border, format, type, pixels);
+}
+
+#else
+
+/* Only bind to a GL 1.2 implementation: */
+#define gluTexImage3D glTexImage3D
+
+#endif
+
static GLint imageSize3D(GLint width, GLint height, GLint depth,
GLenum format, GLenum type)
{
/* does width x height x depth at level 1 & all their mipmaps fit? */
if (target == GL_TEXTURE_3D || target == GL_PROXY_TEXTURE_3D) {
proxyTarget = GL_PROXY_TEXTURE_3D;
- glTexImage3D(proxyTarget, 1, /* must be non-zero */
+ gluTexImage3D(proxyTarget, 1, /* must be non-zero */
internalFormat,
widthAtLevelOne,heightAtLevelOne,depthAtLevelOne,
0,format,type,NULL);
if (width == newWidth && height == newHeight && depth == newDepth) {
/* Use usersImage for level userLevel */
if (baseLevel <= level && level <= maxLevel) {
- glTexImage3D(target, level, internalFormat, width,
+ gluTexImage3D(target, level, internalFormat, width,
height, depth, 0, format, type,
usersImage);
}
glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE);
if (baseLevel <= level && level <= maxLevel) {
- glTexImage3D(target, level, internalFormat, newWidth, newHeight, newDepth,
+ gluTexImage3D(target, level, internalFormat, newWidth, newHeight, newDepth,
0,format, type, (void *)srcImage);
}
level++; /* update current level for the loop */
{
/* call tex image with srcImage untouched since it's not padded */
if (baseLevel <= level && level <= maxLevel) {
- glTexImage3D(target, level, internalFormat, newWidth, newHeight,
+ gluTexImage3D(target, level, internalFormat, newWidth, newHeight,
newDepth,0, format, type, (void *) srcImage);
}
}