about wglgetprocaddress()????

I am sure that my graphics card(geforce4 mX)supports multitexture,and i use glMultiTexCoord2iARB=PFNGLMULTITEXCOORD2IARBPROC)wglGetProcAddress(“glMultiTexCoord2iARB”)in a mfc project ,i get the right address,but i download a program from nVidia corp.which is a win32 console style,the same call wglGetProcAddress,which returns NULL,under DEBUG.Why?

here i add more information!!

under DEBUG
1)the correct situation should be:
PFNGLMULTITEXCOORD2IARBPROC glMultiTexCoord2iARB;
//now glMultiTexCoord2iARB=0xcccccccc
glMultiTexCoord2iARB =(PFNGLMULTITEXCOORD2IARBPROC)wglGetProcAddress(“glMultiTexCoord2iARB”);
//now get the correct address!
2)the wrong situation is :
PFNGLMULTITEXCOORD2IARBPROC glMultiTexCoord2iARB;
//now glMultiTexCoord2iARB=some address (not 0xcccccccc)

glMultiTexCoord2iARB =(PFNGLMULTITEXCOORD2IARBPROC)wglGetProcAddress(“glMultiTexCoord2iARB”);
//now glMultiTexCoord2iARB=0x00000000

Originally posted by arrowpig:
[b]here i add more information!!

under DEBUG
1)the correct situation should be:
PFNGLMULTITEXCOORD2IARBPROC glMultiTexCoord2iARB;
//now glMultiTexCoord2iARB=0xcccccccc
glMultiTexCoord2iARB =(PFNGLMULTITEXCOORD2IARBPROC)wglGetProcAddress(“glMultiTexCoord2iARB”);
//now get the correct address!
2)the wrong situation is :
PFNGLMULTITEXCOORD2IARBPROC glMultiTexCoord2iARB;
//now glMultiTexCoord2iARB=some address (not 0xcccccccc)

glMultiTexCoord2iARB =(PFNGLMULTITEXCOORD2IARBPROC)wglGetProcAddress(“glMultiTexCoord2iARB”);
//now glMultiTexCoord2iARB=0x00000000

[/b]

seems like there is no rendering context when you try to load the function pointer.
From MSDN

When no current rendering context exists or the function fails, the return value is NULL. To get extended error information, call GetLastError.

btw : this thread should go in beginner or windows specific forum

[This message has been edited by kehziah (edited 03-02-2004).]

Thanks, kehziah.i think the context has been created.
I copy the codes here:
PFNGLMULTITEXCOORD2IARBPROC glMultiTexCoord2iARB;
glutInitWindowSize(800, 600);
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH | GLUT_ALPHA);
glutCreateWindow(“Normal Perturbation Mapping”);
glMultiTexCoord2iARB =(PFNGLMULTITEXCOORD2IARBPROC)wglGetProcAddress(“glMultiTexCoord2iARB”);
//////////////

As kehziah said, this should be in the beginners forum.

Check glGetString(GL_VENDOR) to make sure you are running with the nvgl rather than MS’s one.

PFNGLMULTITEXCOORD2IARBPROC glMultiTexCoord2iARB;
//now glMultiTexCoord2iARB=some address (not 0xcccccccc)

The value of a newly created pointer/variable which has not been initialized is always going to be crap. It’s generally going to be whatever happens to be in the memory that the variable occupies when it is created - except (I think) in some debuggers where it might set it to an arbitrary value like “0xCCCCCCCC”. So looking at the value immediately after creation is pointless. You should have something like…

PFNGLMULTITEXCOORD2IARBPROC glMultiTexCoord2iARB = NULL;

hi,rgpc,yes ,you are right.
glGetString(GL_VENDOR) return “Microsoft Corp.”
But Why?
1)two different program running on the same PC,call the same glGetString(after opengl context created!),oen returns “NVIDIA Corp.”
the other returns “microsoft corp.”
2)this morning,i copied the the program which returns"microsoft corp." to another PC,and glGetString(GL_VENDOR) returns “NVIDIA”.

Now i am confused!could you help me,Please?