Skip to content

Commit

Permalink
Get default context from environment var if set
Browse files Browse the repository at this point in the history
  • Loading branch information
OKaluza committed Jan 22, 2025
1 parent 030ea85 commit e273012
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lavavu/lavavu.py
Original file line number Diff line number Diff line change
Expand Up @@ -2054,13 +2054,15 @@ class _LavaVuWrapper(LavaVuPython.LavaVu):
#Shared context
_ctx = None

def __init__(self, threaded, runargs, resolution=None, binpath=None, context="default"):
def __init__(self, threaded, runargs, resolution=None, binpath=None, context=None):
self.args = runargs
self._closing = False
self.resolution = resolution
self._loop = None

#OpenGL context creation options
if context is None:
context = os.environ.get("LV_CONTEXT", "default")
havecontext = False
self.use_moderngl = False
self.use_moderngl_window = False
Expand Down Expand Up @@ -2702,7 +2704,7 @@ class Viewer(dict):
"""

def __init__(self, *args, resolution=None, binpath=None, context="default", port=8080, threads=False, **kwargs):
def __init__(self, *args, resolution=None, binpath=None, context=None, port=8080, threads=False, **kwargs):
"""
Create and init viewer instance
Expand Down

0 comments on commit e273012

Please sign in to comment.