PDA

View Full Version : undefine ?



lin
01-19-2006, 11:34 PM
Hello,
I've got a simple question about NURBS.
If my code would look like this:

gluNurbsCallback(theNurb, GLU_NURBS_BEGIN, beginCallback);
gluNurbsCallback(theNurb, GLU_NURBS_VERTEX, vertexCallback);
gluNurbsCallback(theNurb, GLU_NURBS_NORMAL, normalCallback);
gluNurbsCallback(theNurb, GLU_NURBS_END, endCallback);

As compile it , the errors is : GLU_NURBS_BEGIN,GLU_NURBS_VERTEX,GLU_NURBS_NORMAL, GLU_NURBS_END are undefined. But the OpenGL version is 1.5.4581 in my computer.

Why ? Please give me some suggests, thanks .

Relic
01-20-2006, 04:05 AM
GLU functions are not a part of the OpenGL implementation (GL). Your version number is from the GL_VERSION.
You can check gluGetString(GLU_VERSION) for the GLU version.

Microsoft's VisualStudio documentation says only GLU_ERROR is supported in gluNurbsCallback:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/opengl/glufnc01_0iwb.asp

which I interpret as that their outdated GLU 1.2 library implementation (glu.h, glu32.dll, glu32.lib) is not supporting this and the defines are from GLU version 1.3.

I don't know if that's available under Windows, but heard Linux is more up to date, maybe you find an implementation.

lin
01-20-2006, 04:28 PM
Ok, Where I can find this header file and lib ?

lud2k
01-21-2006, 01:59 AM
try this link :
http://loulou.developpez.com/tutoriels/moteur3d/ext_libs.zip

it contains in /GLU 1.3/ :
glu.H
glu32.lib
glu32.dll

lin
01-21-2006, 02:39 AM
Thanks a lot

lin
01-21-2006, 03:37 AM
Now , I have an another question.
My code would look like this:

void CALLBACK vertexCallback(GLfloat *vertex)
{
glVertex3fv(vertex);
printf ("glVertex3f (%5.3f, %5.3f, %5.3f) \n", vertex[0], vertex[1], vertex[2]);
}

gluNurbsCallback(theNurb, GLU_NURBS_VERTEX, vertexCallback);

As compile it, the error is : error C2664: “gluNurbsCallback” : can't translate the parameter 3 from“void (GLenum)”to“_GLUfuncptr”.

In glu 1.3 Spec , the funtion "gluNrubsCallback" is defined as: void gluNrubsCallback(GLUnurbsObj *nobj,GLenum which,void (*fn)() ); , and the funtion "vertex" is defined as :void vertex(GLfloat *vertex);

Why , who can help me ?