Am Sonntag, 22.12.02 um 00:51 Uhr schrieb Joshua 'Schwa' Gargus:
About your hack... when you say "if your renderer changes", you mean like if I have a dual-head setup with two different graphics cards, and I drag the Squeak window from one to the other? Wouldn't this be a problem even if the function could be found directly in opengl32.dll? Oh, I think I see... the function in opengl32.dll probably redirects the call to whichever driver is currently active. But when you use wglGetProcAddress, that indirection no longer occurs, so if the renderer changes, you're sunk. Does that sound right?
Not quite. The function address returned by getProcAddress is OpenGL context specific. So when you have more than one context, or you destroy and create one, the absolutely correct way is to get a new function address. In practice, the address is only driver specific and can be safely shared across all contexts on a device. It may differ between physical screens, however.
-- Bert