Some curiosity about headers and libs on Windows


Firstly, I completely understand the state of OpenGL on Windows and that we need to use extensions to use any recent functionality. However I have a few questions:

  1. I’ve read in several places that Vista updated opengl32.dll to support OpenGL 1.4 (from 1.1 in XP). However, the platform SDK only has a 1.1 header. If I included glext.h (but didn’t use the extension mechanism) would functionality up to GL 1.4 work out of the box on Vista?

  2. What exactly needs to happen to fix the situation on Windows (besides Microsoft updating the headers/libs/dlls)? Can anyone write a replacement OpenGL32.dll and opengl32.lib? And if so what’s stopping someone doing this?

  3. If we link our apps to opengl32.lib and install drivers from our graphics vendor, how come it uses the vendors OpenGL implementation? Do the graphics drivers somehow hook into opengl32.dll?

  1. When the compiler creates a exe, it needs to get some information about function names and whatever. With VC++, it does that with a .lib file.
    There is no opengl32.lib for version 1.4 AFAIK

  2. Yes, anyone can create a opengl32.dll if they know how. The ICD mechanism is known by nVidia and SGI and perhaps other companies.
    But they won’t because of legal issues.

  3. Traditional calls like glVertex, glBindTexture and the rest go through opengl32.dll, which acts like a pass-through to the real driver.
    Addresses obtained with wglGetProcAddress return addresses into the real driver.

the linux wine project has an implementation of the opengl32 library. So, i am sure it is possible, just no one has bothered to do it.

What exactly needs to happen to fix the situation on Windows

Personally I don’t see the situation on Windows as broken. Just include wglext.h and glext.h, grab the procs your need, then you’re good to go.

Wine’s opengl32.dll is a wrapper. It doesn’t have the ICD.

Also, I agree with the above. Getting function pointers is not a big deal.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.