Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: vsync always on?  (Read 12238 times)

0 Members and 1 Guest are viewing this topic.

miotatsu

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: vsync always on?
« Reply #15 on: October 22, 2014, 12:17:23 am »
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
« Last Edit: October 22, 2014, 12:28:51 am by miotatsu »

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: vsync always on?
« Reply #16 on: October 22, 2014, 12:40:20 am »
I guess the SGI entry point is just broken then ::). SDL is lucky that they check for MESA before they do SGI, since the opposite order would also lead to broken behaviour for you when using SDL. Oh well... the fix for this probably won't make it into SFML until 2.2 is out, so don't hold your breathe. For now, you know how to fix this yourself anyway ;).
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

miotatsu

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: vsync always on?
« Reply #17 on: October 22, 2014, 12:56:33 am »
Alright, thanks for the help :P