poll events after swap

pull/3471/head
kallaballa 2 years ago
parent ce01bd715e
commit c4f4102758
  1. 2
      src/common/viz2d.cpp

@ -678,7 +678,6 @@ bool Viz2D::display() {
bool result = true; bool result = true;
if (!offscreen_) { if (!offscreen_) {
makeCurrent(); makeCurrent();
glfwPollEvents();
screen().draw_contents(); screen().draw_contents();
#ifndef __EMSCRIPTEN__ #ifndef __EMSCRIPTEN__
clglContext_->blitFrameBufferToScreen(getViewport(), getWindowSize(), isStretching()); clglContext_->blitFrameBufferToScreen(getViewport(), getWindowSize(), isStretching());
@ -687,6 +686,7 @@ bool Viz2D::display() {
#endif #endif
screen().draw_widgets(); screen().draw_widgets();
glfwSwapBuffers(glfwWindow_); glfwSwapBuffers(glfwWindow_);
glfwPollEvents();
result = !glfwWindowShouldClose(glfwWindow_); result = !glfwWindowShouldClose(glfwWindow_);
} }

Loading…
Cancel
Save