Browse Source

Save and restore context when calling glfwPollEvents().

tags/v2.0.0
Andrew Belt 3 years ago
parent
commit
36ef61627e
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      src/window.cpp

+ 3
- 0
src/window.cpp View File

@@ -388,7 +388,10 @@ void Window::step() {
bndSetFont(uiFont->handle);

// Poll events
// Save and restore context because event handler set their own context based on which window they originate from.
Context* context = contextGet();
glfwPollEvents();
contextSet(context);

// In case glfwPollEvents() sets another OpenGL context
glfwMakeContextCurrent(win);


Loading…
Cancel
Save