Skip to content

Commit

Permalink
Merge pull request #2009 from pupil-labs/cu-7ap0kn
Browse files Browse the repository at this point in the history
Fix GLError when minimizing eye windows on Windows
  • Loading branch information
papr authored Sep 15, 2020
2 parents 91cb5f1 + bd95f36 commit 6705d98
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions pupil_src/launchables/eye.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,10 @@ def consume_events_and_render_buffer():
glfw.glfwMakeContextCurrent(main_window)
clear_gl_screen()

glViewport(0, 0, *g_pool.camera_render_size)
for p in g_pool.plugins:
p.gl_display()
if all(c > 0 for c in g_pool.camera_render_size):
glViewport(0, 0, *g_pool.camera_render_size)
for p in g_pool.plugins:
p.gl_display()

glViewport(0, 0, *window_size)
# render graphs
Expand Down Expand Up @@ -289,6 +290,11 @@ def on_resize(window, w, h):
nonlocal window_size
nonlocal content_scale

is_minimized = bool(glfw.glfwGetWindowAttrib(window, glfw.GLFW_ICONIFIED))

if is_minimized:
return

# Always clear buffers on resize to make sure that there are no overlapping
# artifacts from previous frames.
gl_utils.glClear(gl_utils.GL_COLOR_BUFFER_BIT)
Expand Down

0 comments on commit 6705d98

Please sign in to comment.