Skip to content

Commit

Permalink
Only sets qpa offscreen if rgb_array
Browse files Browse the repository at this point in the history
  • Loading branch information
AhmadAmine998 committed Oct 8, 2024
1 parent c23ad6d commit 34a1d73
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion f1tenth_gym/envs/rendering/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ def make_renderer(
if render_spec.render_type == "pygame":
from .rendering_pygame import PygameEnvRenderer as EnvRenderer
elif render_spec.render_type == "pyqt6":
os.environ["QT_QPA_PLATFORM"] = "offscreen"
if render_mode == "rgb_array":
os.environ["QT_QPA_PLATFORM"] = "offscreen"
from .rendering_pyqt import PyQtEnvRenderer as EnvRenderer
else:
raise ValueError(f"Unknown render type: {render_spec.render_type}")
Expand Down

0 comments on commit 34a1d73

Please sign in to comment.