Skip to content
Snippets Groups Projects
Commit 8c310b5b authored by Paul McCarthy's avatar Paul McCarthy
Browse files

SliceCanvas was creating loads of GLObjects! Fixed.

parent a0e5aedb
No related branches found
No related tags found
No related merge requests found
...@@ -778,6 +778,13 @@ class SliceCanvas(props.HasProperties): ...@@ -778,6 +778,13 @@ class SliceCanvas(props.HasProperties):
if overlay in self._glObjects: if overlay in self._glObjects:
return return
# We put a placeholder value in
# the globjects dictionary, so
# that the _draw method knows
# that creation for this overlay
# is pending.
self._glObjects[overlay] = False
def create(): def create():
# We need a GL context to create a new GL # We need a GL context to create a new GL
...@@ -1228,8 +1235,13 @@ class SliceCanvas(props.HasProperties): ...@@ -1228,8 +1235,13 @@ class SliceCanvas(props.HasProperties):
# GLObject, we presume that it hasn't been created # GLObject, we presume that it hasn't been created
# yet, so we'll tell genGLObject to create one for # yet, so we'll tell genGLObject to create one for
# it. # it.
if globj is None: self.__genGLObject(ovl) if globj is None: self.__genGLObject(ovl)
else: globjs.append(globj)
# If there is a value for this overlay in
# the globjects dictionary, but it evaluates
# to False, then GLObject creation has been
# scheduled for the overlay - see genGLObject.
elif globj: globjs.append(globj)
# Do not draw anything if some globjects # Do not draw anything if some globjects
# are not ready. This is because, if a # are not ready. This is because, if a
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment