Win32 fixes, etc. (Gerk Huisma)

This commit is contained in:
Brian Paul 2001-08-07 17:34:10 +00:00
parent 696cd3d2b6
commit b5797a5085
14 changed files with 124 additions and 48 deletions

View file

@ -35,8 +35,8 @@
/*
* 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 */
@ -300,7 +300,11 @@ void OpenGLCurveEvaluator::evalcoord1f(long, REAL u)
}
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)
{

View file

@ -35,16 +35,16 @@
/*
* 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;
@ -94,7 +94,11 @@ public:
{
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;

View file

@ -35,8 +35,8 @@
/*
* 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_
@ -73,8 +73,11 @@ public:
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);

View file

@ -35,8 +35,8 @@
/*
* 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_
@ -44,8 +44,8 @@
#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;
@ -146,7 +146,12 @@ public:
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;

View file

@ -35,8 +35,8 @@
/*
* 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_
@ -51,7 +51,7 @@
class Bin;
class Arc;
class BezierArc;
struct BezierArc;
typedef class Arc *Arc_ptr;

View file

@ -35,8 +35,8 @@
/*
* 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_
@ -46,7 +46,7 @@
#include "types.h"
#include "arc.h"
class BezierArc;
struct BezierArc;
class Pool;
class TrimVertexPool;

View file

@ -35,8 +35,8 @@
/*
* 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_
@ -44,9 +44,10 @@
#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 {

View file

@ -35,14 +35,13 @@
/*
* 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"
@ -50,6 +49,7 @@
#include "trimline.h"
#include "uarray.h"
#include "backend.h"
#include "mesher.h"
const float Mesher::ZERO = 0.0;

View file

@ -35,8 +35,8 @@
/*
* 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_
@ -47,7 +47,7 @@
class TrimRegion;
class Backend;
class Pool;
class GridTrimVertex;
// struct GridTrimVertex;
class Mesher : virtual public TrimRegion, public Hull {

View file

@ -35,8 +35,8 @@
/*
* 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_
@ -50,7 +50,7 @@
#include "reader.h"
#include "nurbsconsts.h"
class Knotvector;
struct Knotvector;
class Quilt;
class DisplayList;
class BasicCurveEvaluator;

View file

@ -35,8 +35,8 @@
/*
* 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_
@ -49,7 +49,7 @@
class Backend;
class Mapdesc;
class Flist;
class Knotvector;
struct Knotvector;
/* constants for memory allocation of NURBS to Bezier conversion */
#define MAXDIM 2

View file

@ -35,8 +35,8 @@
/*
* 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_
@ -51,7 +51,7 @@ struct Property;
struct O_surface;
struct O_nurbssurface;
struct O_trim;
struct O_pwlcurve;
class O_pwlcurve;
struct O_nurbscurve;
struct O_curve;
class Quilt;

View file

@ -35,8 +35,8 @@
/*
* 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_
@ -56,7 +56,7 @@ class Renderhints;
class Quilt;
class Patchlist;
class Curvelist;
class JumpBuffer;
struct JumpBuffer;
class Subdivider {
public:

View file

@ -31,8 +31,8 @@
** 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"
@ -6567,6 +6567,65 @@ static void halve1DimagePackedPixel(int components,
/*===========================================================================*/
#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)
{
@ -7330,7 +7389,7 @@ static void closestFit3D(GLenum target, GLint width, GLint height, GLint depth,
/* 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);
@ -7705,7 +7764,7 @@ static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat,
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);
}
@ -8143,7 +8202,7 @@ static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat,
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 */
@ -8318,7 +8377,7 @@ static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat,
{
/* 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);
}
}