HELP! glu tries to kill me with gluNurbsCallback

Started by
-1 comments, last by pir 18 years ago
Hi! I am trying to render a Nurb curve with glu with auto normals. But the normals points in the wrong direction. So I want to direct them in the oppposite direction. The only way to reverse a normal that is made by GL_AUTO_NORMAL, when rendering nurb curves, seems to be to use gluNurbsCallback with a function pointer. On the internet I have read that the arguments look like this: gluNurbsCallback(theNurb*, GL_enum flag, functionPointer) with the flag GL_NURBS_NORMAL and function GLvoid function ( GLfloat*). The problem that is driving me mad is the function pointer. It is said that glu1.3 is able to take a pointer that looks like this: GLvoid (*fp)(GLfloat*) and earlier versions only can take pointers looking like this GLvoid (*fp)(void). So I installed glu1.3 and tried: gluNurbsCallback ( theNurb, GL_NURBS_NORMAL, reverse_normal ), where reverse_normal is: void reverse_normal ( GLfloat *). But it wont compile, so I looked in the glu.h file and found that the header is of older version, 1.2.1 And it looks like this: (I am using c++ btw) #ifdef __cplusplus typedef GLvoid (*_GLUfuncptr)(); #else typedef GLvoid (*_GLUfuncptr)(void); #endif extern void gluNurbsCallback ( GLUnurbs* nurb, GLenum which, _GLUfuncptr CallBackFunc ); And that is crazy! I've tried to install different glu rpms but can't get any header that says that it is version 1.3. But when checking with glxinfo, it says that glu is of version 1.3. So I suppose I have the 1.3 version installed. THE QUESTION: What is the trick?!?!? How am I supposed to be able to pass a function pointer with a GLfloat* as an argument to that definition above? This is really making me sad... /pir

This topic is closed to new replies.

Advertisement