36 #ifndef __gluglrenderer_h_
37 #define __gluglrenderer_h_
41 #include <libnurbs2.h>
42 #include "nurbstess.h"
43 #include "glsurfeval.h"
44 #include "glcurveval.h"
47 typedef void (APIENTRY *errorCallbackType)( GLenum );
55 void loadGLMatrices(
void );
57 void useGLMatrices(
const GLfloat modelMatrix[16],
58 const GLfloat projMatrix[16],
59 const GLint viewport[4] );
60 void setSamplingMatrixIdentity(
void );
62 void errorHandler(
int );
63 void bgnrender(
void );
64 void endrender(
void );
65 void setautoloadmode( INREAL value )
68 if (value) autoloadmode = GL_TRUE;
69 else autoloadmode = GL_FALSE;
72 GLboolean getautoloadmode(
void ) {
return autoloadmode; }
74 errorCallbackType errorCallback;
75 void postError(
int which )
76 {
if (errorCallback) (errorCallback)( (GLenum)which ); }
78 void putSurfCallBack(GLenum which,
void (GLAPIENTRY *fn)() )
80 void putSurfCallBack(GLenum which, _GLUfuncptr fn )
83 curveEvaluator.putCallBack(which, fn);
84 surfaceEvaluator.putCallBack(which, fn);
87 int get_vertices_call_back()
89 return surfaceEvaluator.get_vertices_call_back();
92 void put_vertices_call_back(
int flag)
94 surfaceEvaluator.put_vertices_call_back(flag);
97 int get_callback_auto_normal()
99 return surfaceEvaluator.get_callback_auto_normal();
102 void put_callback_auto_normal(
int flag)
104 surfaceEvaluator.put_callback_auto_normal(flag);
107 void setNurbsCallbackData(
void* userData)
109 curveEvaluator.set_callback_userData(userData);
110 surfaceEvaluator.set_callback_userData(userData);
115 void LOD_eval_list(
int level)
117 surfaceEvaluator.LOD_eval_list(level);
125 void put_callbackFlag(
int flag)
128 surfaceEvaluator.put_vertices_call_back(flag);
129 curveEvaluator.put_vertices_call_back(flag);
133 GLboolean autoloadmode;
137 void loadSamplingMatrix(
const GLfloat vmat[4][4],
138 const GLint viewport[4] );
139 void loadCullingMatrix( GLfloat vmat[4][4] );
140 static void grabGLMatrix( GLfloat vmat[4][4] );
141 static void transform4d( GLfloat A[4], GLfloat B[4],
143 static void multmatrix4d( GLfloat n[4][4],
const GLfloat left[4][4],
144 const GLfloat right[4][4] );