As in this?
////////////////////////////////////////////////////////////
void GlxContext::setVerticalSyncEnabled(bool enabled)
{
const GLubyte* name = reinterpret_cast<const GLubyte*>("glXSwapIntervalSGI");
PFNGLXSWAPINTERVALSGIPROC glXSwapIntervalSGI = reinterpret_cast<PFNGLXSWAPINTERVALSGIPROC>(glXGetProcAddress(name));
assert(glXSwapIntervalSGI);
if (glXSwapIntervalSGI)
glXSwapIntervalSGI(enabled ? 1 : 0);
}
The assertion did not trip with my test program.
Just to be extra sure, I added some std::cout's to both code paths.
[mio@c7 sandbox]$ clang++ -std=c++14 -g test.cpp -lsfml-graphics -lsfml-window -lsfml-system
[mio@c7 sandbox]$ ./a.out
glXSwapIntervalSGI valid
glXSwapIntervalSGI valid