To main page
glCallList PyOpenGL Template
This is only partial example, for a better class, see CallList PyOpenGL Class.
This is a template to use for cached drawing with call lists in PyOpenGL:
self.call_list = glGenLists(1)
self._invalidated = 1
if glDeleteLists is not None: glDeleteLists(self.call_list,1)
if not self._invalidated:
self._invalidated = 0
... do actual drawing here ...
Set self._invalidated to 1 wheneven you need to update cache
PyOpenGL is very slow at GL calls - every call is an dictionary lookup, then all those error checks, etc. Call lists are a way to avoid it. In fact call list for a million points executes as fast as if it were called from C.