Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix NameError when pyglet cannot create window #278

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion pyrender/platforms/pyglet_platform.py
Original file line number Diff line number Diff line change
@@ -45,21 +45,23 @@ def init_context(self):
double_buffer=True,
major_version=MIN_OPEN_GL_MAJOR,
minor_version=MIN_OPEN_GL_MINOR)]
error_message = None
for conf in confs:
try:
self._window = pyglet.window.Window(config=conf, visible=False,
resizable=False,
width=1, height=1)
break
except pyglet.window.NoSuchConfigException as e:
error_message = e
pass

if not self._window:
raise ValueError(
'Failed to initialize Pyglet window with an OpenGL >= 3+ '
'context. If you\'re logged in via SSH, ensure that you\'re '
'running your script with vglrun (i.e. VirtualGL). The '
'internal error message was "{}"'.format(e)
'internal error message was "{}"'.format(error_message)
)

def make_current(self):