Skip to content

Instantly share code, notes, and snippets.

@flowernert
Created November 23, 2018 16:25
Show Gist options
  • Save flowernert/caf89416b6fa8886a09f07064058b753 to your computer and use it in GitHub Desktop.
Save flowernert/caf89416b6fa8886a09f07064058b753 to your computer and use it in GitHub Desktop.
(commented code is the interesting stuff) faster multiples calls to openGL draw
def on_draw(self, event):
#can be optimized if drawing 1 polyhedron per loop rather than 1 polyhedron's polygon per loop
gloo.clear()
self.program.draw(mode="lines", indices=self.indices)
# self.context.glir.associate(self.program.glir)
# for i in self.indices:
# self.context.glir.associate(i.glir)
# selection = i.id, "UNSIGNED_SHORT", i.size
# self.context.glir.command('DRAW', self.program._id, "line_strip", selection)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment