NAME
gluNurbsCallback
- define a callback for a NURBS object
C SPECIFICATION
void gglluuNNuurrbbssCCaallllbbaacckk(
GLUnurbs* _n_u_r_b,
GLenum _w_h_i_c_h,
_GLUfuncptr _C_a_l_l_B_a_c_k_F_u_n_c )
delim $$
PARAMETERS
-
_n_u_r_b
-
Specifies the NURBS object (created with gglluuNNeewwNNuurrbbssRReennddeerreerr).
-
_w_h_i_c_h
-
Specifies the callback being defined.
Valid values are GGLLUU__NNUURRBBSS__BBEEGGIINN, GGLLUU__NNUURRBBSS__VVEERRTTEEXX, GGLLUU__NNUURRBBSS__NNOORRMMAALL, GGLLUU__NNUURRBBSS__CCOOLLOORR, GGLLUU__NNUURRBBSS__TTEEXXTTUURREE__CCOOOORRDD, GGLLUU__NNUURRBBSS__EENNDD, GGLLUU__NNUURRBBSS__BBEEGGIINN__DDAATTAA, GGLLUU__NNUURRBBSS__VVEERRTTEEXX__DDAATTAA, GGLLUU__NNUURRBBSS__NNOORRMMAALL__DDAATTAA, GGLLUU__NNUURRBBSS__CCOOLLOORR__DDAATTAA, GGLLUU__NNUURRBBSS__TTEEXXTTUURREE__CCOOOORRDD__DDAATTAA, GGLLUU__NNUURRBBSS__EENNDD__DDAATTAA, and GGLLUU__NNUURRBBSS__EERRRROORR.
-
_C_a_l_l_B_a_c_k_F_u_n_c
-
Specifies the function that the callback calls.
DESCRIPTION
gglluuNNuurrbbssCCaallllbbaacckk is used to define a callback to be used by a NURBS
object.
If the specified callback is already defined, then it is replaced. If
_C_a_l_l_B_a_c_k_F_u_n_c is NULL, then this callback will not get
invoked and the related data, if any, will be lost.
Except the error callback, these callbacks are used by NURBS tessellator (when GGLLUU__NNUURRBBSS__MMOODDEE is set to be GGLLUU__NNUURRBBSS__TTEESSSSEELLLLAATTOORR) to return back the OpenGL
polygon primitives resulting from the tessellation. Note that there are two
versions of each callback: one with a user data pointer and one without. If both versions for a particular callback are specified then the callback with
the user data pointer will be used. Note that ``userData'' is a copy of the pointer that was specified at the last call to gglluuNNuurrbbssCCaallllbbaacckkDDaattaa.
The error callback function is effective no matter which value that
GGLLUU__NNUURRBBSS__MMOODDEE is set to.
All other callback functions are effective only when GGLLUU__NNUURRBBSS__MMOODDEE
is set to GGLLUU__NNUURRBBSS__TTEESSSSEELLLLAATTOORR.
The legal callbacks are as follows:
-
GGLLUU__NNUURRBBSS__BBEEGGIINN
-
The begin callback indicates the start of a primitive. The function
takes a single argument of type GLenum, which can be one of
GGLL__LLIINNEESS, GGLL__LLIINNEE__SSTTRRIIPP, GGLL__TTRRIIAANNGGLLEE__FFAANN, GGLL__TTRRIIAANNGGLLEE__SSTTRRIIPP, GGLL__TTRRIIAANNGGLLEESS, or GGLL__QQUUAADD__SSTTRRIIPP. The
default begin callback function is NULL. The function prototype
for this callback looks like:
void begin ( GLenum type );
-
GGLLUU__NNUURRBBSS__BBEEGGIINN__DDAATTAA
-
The same as the GGLLUU__NNUURRBBSS__BBEEGGIINN callback except that it takes an
additional pointer argument. This pointer is a copy of the pointer that
was specified at the last call to gglluuNNuurrbbssCCaallllbbaacckkDDaattaa. The
default callback function is NULL. The function prototype for this
callback function looks like:
void beginData (GLenum type, void *userData);
-
GGLLUU__NNUURRBBSS__VVEERRTTEEXX
-
The vertex callback indicates a vertex of the primitive. The
coordinates of the vertex are stored in the parameter ``vertex''. All
the generated vertices have dimension 3, that is, homogeneous
coordinates have been transformed into affine coordinates. The default
vertex callback function is NULL. The function prototype for this
callback function looks like:
void vertex ( GLfloat *vertex );
-
GGLLUU__NNUURRBBSS__VVEERRTTEEXX__DDAATTAA
-
This is the same as the GGLLUU__NNUURRBBSS__VVEERRTTEEXX callback, except that
it takes an additional pointer argument. This pointer is a copy of the
pointer that was specified at the last call to
gglluuNNuurrbbssCCaallllbbaacckkDDaattaa. The default callback function is NULL. The
function prototype for this callback function looks like:
void vertexData ( GLfloat *vertex, void *userData );
-
GGLLUU__NNUURRBBSS__NNOORRMMAALL
-
The normal callback is invoked as the vertex normal is generated.
The components of the normal are stored in the parameter ``normal''.
In the case of a NURBS curve, the callback function is effective only when
the user provides a normal map (GGLL__MMAAPP11__NNOORRMMAALL).
In the case of a NURBS surface, if a normal map (GGLL__MMAAPP22__NNOORRMMAALL) is provided, then the generated normal is computed from the normal map.
If a normal map is not provided then a surface normal is computed in
a manner similar to that described for evaluators when GGLL__AAUUTTOO__NNOORRMMAALL
is enabled.
The default normal callback function is NULL. The function
prototype for this callback function looks like:
void normal ( GLfloat *normal );
-
GGLLUU__NNUURRBBSS__NNOORRMMAALL__DDAATTAA
-
The same as the GGLLUU__NNUURRBBSS__NNOORRMMAALL callback except that it
takes an additional pointer argument. This pointer is a copy of the pointer
that was specified at the last call to gglluuNNuurrbbssCCaallllbbaacckkDDaattaa. The default callback function is NULL. The function prototype for this callback function looks like:
void normalData ( GLfloat *normal, void *userData );
-
GGLLUU__NNUURRBBSS__CCOOLLOORR
-
The color callback is invoked as the color of a vertex is generated.
The components of the color are stored in the parameter ``color''.
This callback is effective only when the user provides a color map
(GGLL__MMAAPP11__CCOOLLOORR__44 or GGLL__MMAAPP22__CCOOLLOORR__44). ``color'' contains four components: R,G,B,A. The default color callback function is NULL. The prototype for
this callback function looks like:
void color ( GLfloat *color );
-
GGLLUU__NNUURRBBSS__CCOOLLOORR__DDAATTAA
-
The same as the GGLLUU__NNUURRBBSS__CCOOLLOORR callback except that it
takes an additional pointer argument. This pointer is a copy of the pointer
that was specified at the last call to gglluuNNuurrbbssCCaallllbbaacckkDDaattaa. The default callback function is NULL. The function prototype for this callback function looks like:
void colorData ( GLfloat *color, void *userData );
-
GGLLUU__NNUURRBBSS__TTEEXXTTUURREE__CCOOOORRDD
-
The texture callback is invoked as the texture coordinates
of a vertex are generated. These coordinates are stored in the parameter
``texCoord''. The number of texture coordinates can be 1, 2, 3, or 4 depending
on which type of texture map is specified
(GGLL__MMAAPP11__TTEEXXTTUURREE__CCOOOORRDD__11,
GGLL__MMAAPP11__TTEEXXTTUURREE__CCOOOORRDD__22,
GGLL__MMAAPP11__TTEEXXTTUURREE__CCOOOORRDD__33,
GGLL__MMAAPP11__TTEEXXTTUURREE__CCOOOORRDD__44,
GGLL__MMAAPP22__TTEEXXTTUURREE__CCOOOORRDD__11,
GGLL__MMAAPP22__TTEEXXTTUURREE__CCOOOORRDD__22,
GGLL__MMAAPP22__TTEEXXTTUURREE__CCOOOORRDD__33,
GGLL__MMAAPP22__TTEEXXTTUURREE__CCOOOORRDD__44).
If no texture map is specified, this callback function will not be called.
The default texture callback function is NULL. The function prototype
for this callback function looks like:
void texCoord ( GLfloat *texCoord );
-
GGLLUU__NNUURRBBSS__TTEEXXTTUURREE__CCOOOORRDD__DDAATTAA
-
This is the same as the GGLLUU__NNUURRBBSS__TTEEXXTTUURREE__CCOOOORRDD callback, except that it
takes an additional pointer argument. This pointer is a copy of the pointer
that was specified at the last call to gglluuNNuurrbbssCCaallllbbaacckkDDaattaa. The default callback function is NULL. The function prototype for this callback function looks like:
void texCoordData (GLfloat *texCoord, void *userData);
-
GGLLUU__NNUURRBBSS__EENNDD
-
The end callback is invoked at the end of a primitive. The default end callback function is NULL. The function prototype for this callback function looks like:
void end ( void );
-
GGLLUU__NNUURRBBSS__EENNDD__DDAATTAA
-
This is the same as the GGLLUU__NNUURRBBSS__EENNDD callback, except that it
takes an additional pointer argument. This pointer is a copy of the pointer
that was specified at the last call to gglluuNNuurrbbssCCaallllbbaacckkDDaattaa. The default callback function is NULL. The function prototype for this callback function looks like:
void endData ( void *userData );
-
GGLLUU__NNUURRBBSS__EERRRROORR
-
The error function is called when an error is encountered.
Its single argument
is of type GLenum, and it indicates the specific error that occurred.
There are 37 errors unique to NURBS named
GGLLUU__NNUURRBBSS__EERRRROORR11 through GGLLUU__NNUURRBBSS__EERRRROORR3377.
Character strings describing these errors can be retrieved with
gglluuEErrrroorrSSttrriinngg.
NOTES
gglluuNNuurrbbssCCaallllbbaacckk is available only if the GLU version is 1.2 or greater.
GLU version 1.2 supports only the GGLLUU__EERRRROORR parameter for
_w_h_i_c_h. The GGLLUU__EERRRROORR value is deprecated in GLU version 1.3 in
favor of GGLLUU__NNUURRBBSS__EERRRROORR. All other accepted values for _C_a_l_l_B_a_c_k_F_u_n_c
are available only if the GLU version is 1.3 or greater.
SEE ALSO
gglluuEErrrroorrSSttrriinngg((33GG)),
gglluuNNeewwNNuurrbbssRReennddeerreerr((33GG)),
gglluuNNuurrbbssCCaallllbbaacckkDDaattaa((33GG)),
gglluuNNuurrbbssPPrrooppeerrttyy((33GG))