Exemple #1
0
 def call(self):
     """Calls the display list using glCallList(). If this display list
     has not previously been used with the current context, allocates
     a display list number and arranges for do_setup() to be called
     to compile a representation of the display list."""
     share_group = current_share_group()
     gl_id = self._gl_id.get(share_group)
     if gl_id is None:
         gl_id = glGenLists(1)
         #print "GLDisplayList: assigned id %d for %s in share group %s" % (
         #	gl_id, self, share_group) ###
         self._gl_id[share_group] = gl_id
         call_when_not_compiling_display_list(lambda: self._compile(gl_id))
     glCallList(gl_id)
 def call(self):
     """Calls the display list using glCallList(). If this display list
     has not previously been used with the current context, allocates
     a display list number and arranges for do_setup() to be called
     to compile a representation of the display list."""
     share_group = current_share_group()
     gl_id = self._gl_id.get(share_group)
     if gl_id is None:
         gl_id = glGenLists(1)
         #print "GLDisplayList: assigned id %d for %s in share group %s" % (
         #	gl_id, self, share_group) ###
         self._gl_id[share_group] = gl_id
         call_when_not_compiling_display_list(lambda: self._compile(gl_id))
     glCallList(gl_id)
Exemple #3
0
 def gl_id(self):
     """Returns the OpenGL texture number corresponding to this texture
     in the current context. May trigger allocation of a new texture and
     a call to do_setup(). Does not bind the texture, unless a new texture
     is allocated, in which case the current texture binding may be changed
     as a side effect."""
     share_group = current_share_group()
     gl_id = self._gl_id.get(share_group)
     if gl_id is None:
         gl_id = glGenTextures(1)
         #print "GLTexture: assigned id %d for %s in share group %s" % (
         #	gl_id, self, share_group) ###
         self._gl_id[share_group] = gl_id
         call_when_not_compiling_display_list(lambda: self._setup(gl_id))
     return gl_id
 def gl_id(self):
     """Returns the OpenGL texture number corresponding to this texture
     in the current context. May trigger allocation of a new texture and
     a call to do_setup(). Does not bind the texture, unless a new texture
     is allocated, in which case the current texture binding may be changed
     as a side effect."""
     share_group = current_share_group()
     gl_id = self._gl_id.get(share_group)
     if gl_id is None:
         gl_id = glGenTextures(1)
         # print "GLTexture: assigned id %d for %s in share group %s" % (
         # 	gl_id, self, share_group) ###
         self._gl_id[share_group] = gl_id
         call_when_not_compiling_display_list(lambda: self._setup(gl_id))
     return gl_id