Add hard-coded flag for rendering without display lists.
This commit is contained in:
parent
6591ed97aa
commit
60923091a8
@ -16,6 +16,7 @@ from mcedit2.util.glutils import DisplayList
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
DEBUG_NO_DISPLAYLISTS = False
|
||||
|
||||
class RenderNode(object):
|
||||
|
||||
@ -80,6 +81,12 @@ class RenderNode(object):
|
||||
def getList(self):
|
||||
return self.displayList.getList()
|
||||
|
||||
if DEBUG_NO_DISPLAYLISTS:
|
||||
def callList(self):
|
||||
with self.enterStates():
|
||||
self.drawSelf()
|
||||
self.debugDrawChildren()
|
||||
else:
|
||||
def callList(self):
|
||||
self.displayList.call()
|
||||
|
||||
@ -91,6 +98,8 @@ class RenderNode(object):
|
||||
|
||||
for state in self.sceneNode.states:
|
||||
state.compile()
|
||||
|
||||
if not DEBUG_NO_DISPLAYLISTS:
|
||||
self.displayList.compile(self.draw)
|
||||
|
||||
@contextmanager
|
||||
@ -104,11 +113,13 @@ class RenderNode(object):
|
||||
state.exit()
|
||||
|
||||
def draw(self):
|
||||
log.debug("Compiling renderNode for %s", self.sceneNode)
|
||||
|
||||
with self.enterStates():
|
||||
self.drawSelf()
|
||||
self.drawChildren()
|
||||
self.callChildren()
|
||||
|
||||
def drawChildren(self):
|
||||
def callChildren(self):
|
||||
if len(self.children):
|
||||
lists = [node.getList()
|
||||
for node in self.children
|
||||
@ -121,6 +132,12 @@ class RenderNode(object):
|
||||
log.exception("Error calling child lists: %s", e)
|
||||
raise
|
||||
|
||||
def debugDrawChildren(self):
|
||||
if len(self.children):
|
||||
for node in self.children:
|
||||
node.callList()
|
||||
|
||||
|
||||
def drawSelf(self):
|
||||
pass
|
||||
|
||||
|
Reference in New Issue
Block a user