In OpenGL superbible the example says I can read Windows specific extensions via:
//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 does not take GLubyte. How can make this work?
You can just cast the return value of
glGetStringto a const char pointer and use your favorite string handling functions.But really I’d recommend using a library, e.g. GLEW, for managing extensions.