Skip to content

Commit

Permalink
X11: Use find_library
Browse files Browse the repository at this point in the history
  • Loading branch information
einarf committed Feb 13, 2021
1 parent e1a1031 commit dd052ff
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion glcontext/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,13 @@ def create(*args, **kwargs):
if not kwargs.get('libgl'):
kwargs['libgl'] = find_library('GL')

libx11 = find_library("X11")
if not libx11:
raise SystemError("Cannot find the X11 library")

_apply_env_var(kwargs, 'glversion', 'GLCONTEXT_GLVERSION', arg_type=int)
_apply_env_var(kwargs, 'libgl', 'GLCONTEXT_LINUX_LIBGL')
_apply_env_var(kwargs, 'libx11', 'GLCONTEXT_LINUX_LIBX11')
_apply_env_var(kwargs, libx11, 'GLCONTEXT_LINUX_LIBX11')
kwargs = _strip_kwargs(kwargs, ['glversion', 'mode', 'libgl', 'libx11'])
return x11.create_context(**kwargs)

Expand Down

0 comments on commit dd052ff

Please sign in to comment.