在 OpenGL superbible 中,示例说我可以通过以下方式读取 Windows 特定的扩展:
//Type defined in the book as char, but that is not what glGetString returns...
const GLubyte *extensions = glGetString(GL_EXTENSIONS);
if(strstr(extensions, "WGL_EXT_swap_control") != NULL)
{
wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)wglGetProcAddress("wglSwapIntervalEXT");
if(wglSwapIntervalEXT != NULL)
wglSwapIntervalEXT(1);
}
strstr
不采取GLubyte
。如何使这项工作?