PDA

View Full Version : OpenGL extensions in Win32



xanatose
01-14-2005, 07:36 PM
Im have being wondering a long time.

Why does one needs to check if the string of an OpenGL extension is present using glGetString(GL_EXTENSIONS, when you will anyway need to get the address to the functions of the extension using wglGetProcAddress() which will return NULL when the extension is not present?

shinpaughp
01-14-2005, 10:04 PM
Some extensions do not add functions - they only add additional parameters which can be passed to existing functions. If you use these extension but they aren't supported by a user's driver/video card then there will be unexpected behaviour in your program and the wglGetProcAddress won't help because it only lets you know if a function is supported or not.

Overmind
01-15-2005, 01:10 AM
wglGetProcAddress doesn't test if a function is available. You should not rely upon it returning NULL if an extension is not available, it could just return any invalid pointer.