MGL_glGetProcAddress
Returns the address of an OpenGL extension function.
Declaration
void * MGLAPI MGL_glGetProcAddress(
const char *procName)
Prototype In
mgraph.h
Return Value
Address of the specified extension function, NULL if not available.
Description
This function returns the address of an OpenGL extension function if that extension is supported by the OpenGL implementation. Each OpenGL implementation may export a number of OpenGL extension that may not be supported by other OpenGL implementations, and this function is the mechanism you can use to obtain the address of those extension functions.
Note that you should first check to see if an extension is available, but calling the OpenGL function glGetString(GL_EXTENSIONS) to get a list of all the available extensions. In order to check for a specific extension by name, you can use the following code:
ibool checkExtension(const char *name)
{
const char *p = (const char
*)glGetString(GL_EXTENSIONS);
while (p = strstr(p, name)) {
const char *q = p +
strlen(name);
if (*q == ' ' || *q == '\0')
return
GL_TRUE;
p = q;
}
return GL_FALSE;
}
Note: It is an error to call this function for an MGL device context that does not have an OpenGL rendering context associated with it via a call to MGL_glCreateContext.
Copyright © 2002 SciTech Software, Inc. Visit our web site at http://www.scitechsoft.com