|
|
|
@ -5,6 +5,7 @@ import pyray as rl |
|
|
|
|
from enum import IntEnum |
|
|
|
|
from openpilot.common.basedir import BASEDIR |
|
|
|
|
from openpilot.common.swaglog import cloudlog |
|
|
|
|
from openpilot.system.hardware import HARDWARE |
|
|
|
|
|
|
|
|
|
DEFAULT_FPS = 60 |
|
|
|
|
FPS_LOG_INTERVAL = 5 # Seconds between logging FPS drops |
|
|
|
@ -46,6 +47,9 @@ class GuiApplication: |
|
|
|
|
def init_window(self, title: str, fps: int=DEFAULT_FPS): |
|
|
|
|
atexit.register(self.close) # Automatically call close() on exit |
|
|
|
|
|
|
|
|
|
HARDWARE.set_display_power(True) |
|
|
|
|
HARDWARE.set_screen_brightness(65) |
|
|
|
|
|
|
|
|
|
rl.set_config_flags(rl.ConfigFlags.FLAG_MSAA_4X_HINT | rl.ConfigFlags.FLAG_VSYNC_HINT) |
|
|
|
|
rl.init_window(self._width, self._height, title) |
|
|
|
|
rl.set_target_fps(fps) |
|
|
|
|