View Full Version : wglGetProcAddress or GetProcAddress?

06-23-2002, 11:30 AM
Does it matter which I use?

I know that with wglGetProcAddress you don't need to do a LoadLibrary() and you don't need to specify your dll handle in the call, but is there any difference or problems with using one rather than the other?



06-23-2002, 12:02 PM
GetProcAddress will load a function from a DLL that is explicitly marked as an export. GL functions are not necessarily marked as exports.

06-23-2002, 12:04 PM
Just to make it clear. I'm talking about the functions not in opengl32.dll. That is, extensions and OpenGL 1.2 and above.

You should be able to load OpenGL 1.1 functions with GetProcAddress, since they are exports in opengl32.dll.

06-23-2002, 12:32 PM
So, can I reliably use wglGetProcAddress() for all GL functions - whether they're nVidia extensions, ATI extensions, core 1.1/1.2/1.3 even wgl extensions themselves (pbuffer etc.)?

PS: I say reliably, I mean can I use it consistently for them all - I'm under no delusion that trying to wglGetProcAddress("glTrackMatrixNV")
will return anything but NULL on ATI cards.



06-25-2002, 01:56 AM
Yes, wglGrtProcAddress will work for all GL functions, since that's what it's there for.

wglGetProcAddress("glTrackMatrixNV") should return NULL on implementations that does not support that extension.

06-25-2002, 04:59 AM
Thanks Bob, I'm using wglGetProc... for everything now.