vittoriolassini wrote on Monday, June 17, 2013:
What function do you call to yield CPU then?
I’m just using vsync. If i’ll be in need of explicit yielding, sleeping or other threading-related things, then i’ll use some portable threading solution.
No. See previous post. It is not always reliable
Nothing is always reliable. But (in my opinion) need for workaround for some problem of some hardware/software configurations is poor reason to include some “unrelated” functionality to the library.
even if it was reliable, it isn’t always the desired behavior.
I’m not denying that. I’m just saying that the other cases are pretty rare.
Sure, you can’t rely on it to sleep for exactly the amount of time requested, but it works well most of the time in practice.
Vsync works well most of the time in practice too. In my practice, at least. But i cannot say anything good about sleep-based methods (especially for active, high fps games).
No. There are more possibilities than “refresh rate” and “as fast as you can”. Examples would be playing an animation at its native rate, or limiting FPS to a specific maximum.
Yes, there are more possibilities. But this two used much more frequently then the other. And that reflected in commercial games. Do we need rarely used “out-of-focus” features in glfw? Besides, just adding glfwSleep() is not enough. You must add some means for controlling granularity.
typically only get tearing when compositing is off, or when in fullscreen/exclusive mode with vsync off
I feel this “only” happens much more frequently than busy-waiting vsync problems…
Any game with a MaxFPS option. World of Warcraft for example.
It’s a good example, but most games i played were without such option.