Browse Source

Platform: don't set swap inteval implicitly in GlfwApplication.

pull/142/merge
Vladimír Vondruš 10 years ago
parent
commit
5061d29926
  1. 5
      src/Magnum/Platform/GlfwApplication.cpp
  2. 8
      src/Magnum/Platform/GlfwApplication.h

5
src/Magnum/Platform/GlfwApplication.cpp

@ -136,7 +136,6 @@ bool GlfwApplication::tryCreateContext(const Configuration& configuration) {
glfwSetScrollCallback(_window, staticMouseScrollEvent);
glfwMakeContextCurrent(_window);
glfwSwapInterval(1);
/* Return true if the initialization succeeds */
return _context->tryCreate();
@ -147,6 +146,10 @@ GlfwApplication::~GlfwApplication() {
glfwTerminate();
}
void GlfwApplication::setSwapInterval(const Int interval) {
glfwSwapInterval(interval);
}
int GlfwApplication::exec() {
while(!glfwWindowShouldClose(_window)) {
if(_needsRedraw) {

8
src/Magnum/Platform/GlfwApplication.h

@ -173,6 +173,14 @@ class GlfwApplication {
*/
void swapBuffers() { glfwSwapBuffers(_window); }
/**
* @brief Set swap interval
*
* Set `0` for no VSync, `1` for enabled VSync. Some platforms support
* `-1` for late swap tearing. Default is driver-dependent.
*/
void setSwapInterval(Int interval);
/** @copydoc Sdl2Application::redraw() */
void redraw() { _needsRedraw = true; }

Loading…
Cancel
Save