def __init__(self, datablocks, usage=GL_STATIC_DRAW_ARB): """Initializes the vertex buffer object with the given data blocks""" DisplayList.checkForInvalidCall( "Should not construct VertexBuffers in a display list") self.dataBlocks = datablocks[:] self.totalSize = 0 self.usage = usage self.id = GenerateID() self._upload()
def __init__(self, indices, usage=GL_STATIC_DRAW_ARB, element_type='H'): DisplayList.checkForInvalidCall( "Should not construct IndexBuffers in a display list") self.id = GenerateID() self.usage = usage self.indices = indices self.elementType = element_type self.glTypeCode = array_type_to_gl_type[element_type] self._loaddata()
def MakeTexture( filename ): global extensions DisplayList.checkForInvalidCall("Loading texture %s in a display list " % (filename)) ext = os.path.splitext( filename )[1] if ext in extensions: extensions[ext] += 1 else: extensions[ext] = 1 if filename.endswith( '.dds' ): return DDSTexture( filename ) else: return Texture( filename )
def MakeTexture(filename): global extensions DisplayList.checkForInvalidCall("Loading texture %s in a display list " % (filename)) ext = os.path.splitext(filename)[1] if ext in extensions: extensions[ext] += 1 else: extensions[ext] = 1 if filename.endswith('.dds'): return DDSTexture(filename) else: return Texture(filename)