Skip to content

Commit

Permalink
Merge pull request #1987 from pupil-labs/eye_squared_default
Browse files Browse the repository at this point in the history
Eye window: Set 500x500 as default content size
  • Loading branch information
Patrick Faion authored Aug 4, 2020
2 parents ed796f2 + c6608f1 commit 3cfba21
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 @@ -214,7 +214,7 @@ def get_timestamp():
default_capture_name = "UVC_Source"
default_capture_settings = {
"preferred_names": preferred_names,
"frame_size": (320, 240),
"frame_size": (192, 192),
"frame_rate": 120,
}

Expand Down Expand Up @@ -399,7 +399,12 @@ def toggle_general_settings(collapsed):
glfw.glfwWindowHint(glfw.GLFW_VISIBLE, 0) # hide window
title = "Pupil Capture - eye {}".format(eye_id)

width, height = session_settings.get("window_size", (640 + icon_bar_width, 480))
# Pupil Cam1 uses 4:3 resolutions. Pupil Cam2 and Cam3 use 1:1 resolutions.
# As all Pupil Core and VR/AR add-ons are shipped with Pupil Cam2 and Cam3
# cameras, we adjust the default eye window size to a 1:1 content aspect ratio.
# The size of 500 was chosen s.t. the menu still fits.
default_window_size = 500 + icon_bar_width, 500
width, height = session_settings.get("window_size", default_window_size)

main_window = glfw.glfwCreateWindow(width, height, title, None, None)
window_pos = session_settings.get("window_position", window_position_default)
Expand Down Expand Up @@ -519,7 +524,6 @@ def set_window_size():
)
icon.tooltip = "General Settings"
g_pool.iconbar.append(icon)
toggle_general_settings(False)

plugins_to_load = session_settings.get("loaded_plugins", default_plugins)
if overwrite_cap_settings:
Expand All @@ -536,6 +540,8 @@ def set_window_size():
g_pool.plugin_by_name[default_capture_name], default_capture_settings
)

toggle_general_settings(True)

g_pool.writer = None

# Register callbacks main_window
Expand Down

0 comments on commit 3cfba21

Please sign in to comment.