On Sun, Dec 22, 2002 at 01:26:33AM +0100, Andreas Raab wrote:
Joshua,
Unfortunately, I wasn't able to try it because wglGetProcAddress: (as you defined it below) always returns 0, even when I try it on functions that I know are there, such as glColor3f(). I don't understand why this would be; 'Smalltalk listLoadedModules' includes opengl32.dll.
wglGetProcAddress _exclusively_ works for extension functions. Trying it on any of the "standard" OpenGL functions will not work because they use the "standard" OS lookup mechanisms (and yes this all sucks but I didn't invent any of it).
Good thing you mentioned that, because I was getting set to blame you :-)
In short, if the function you are using is part of the OpenGL standard (modulo versions of course) then you can and must use a "regular" ffi call. If it's not (e.g., part of an extension) then you must use wglGetProcAddress to use it. For some functions there are actually two variants (due to an extension becoming part of the standard) - for example I think you can still use glBindTextureEXT (used to be part of the texture object extension) as well as glBindTexture (it became part of OGL 1.1).
Generally, extensions have those "EXT", "ARB", "NV", "SGI", "ATI", "APPLE" (or whatever) postfixes which tell you that they're extensions. So the rule of thumb is: if it has a postfix, it's an extension if it doesn't it's part of the standard. (unfortunately this rule is not _always_ true such as in ARB_imaging)
So, are the functions in the imaging subset technically extensions? I saw a newsgroup post that said that they're not; they're full-fledged members of OpenGL 1.2, but are optional. And I *always* believe what I read on the net.
Anyway, I also get a 0 result when asking for the address of glMinmax, even though glGetString(GL_EXTENSIONS) says that the imaging subset is supported. I'll try with something that's a real extension (maybe NV_VERTEX_PROGRAM) after I finish eating a mom-cooked supper. I'll see what happens if I try it with a C++ program, too.
I'll keep you posted, Joshua