Trees | Indices | Toggle frames |
---|
AbstractBuffer --+ | AbstractMappable --+ | VertexArray
A ctypes implementation of a vertex array.
Many of the methods on this class are effectively no-op's, such as bind, unbind, map, unmap and delete; they exist in order to present a consistent interface with VertexBufferObject.
This buffer type is also mappable, and so get_region can be used.
__init__(self, size) | |
bind(self)
Bind this buffer to its OpenGL target.
|
|
unbind(self)
Reset the buffer's OpenGL target.
|
|
set_data(self,
data)
Set the entire contents of the buffer.
|
|
set_data_region(self,
data,
start,
length)
Set part of the buffer contents.
|
|
POINTER(ctypes.c_ubyte) |
map(self,
invalidate=False)
Map the entire buffer into system memory.
|
unmap(self)
Unmap a previously mapped memory block.
|
|
AbstractBufferRegion |
get_region(self,
start,
size,
ptr_type)
Map a region of the buffer into a ctypes array of the desired
type.
|
delete(self)
Delete this buffer, reducing system resource usage.
|
|
resize(self,
size)
Resize the buffer to a new size.
|
int |
ptr = 0
Memory offset of the buffer, as used by the glVertexPointer
family of functions
(Inherited from pyglet.graphics.vertexbuffer.AbstractBuffer)
|
int |
size = 0
Size of buffer, in bytes
(Inherited from pyglet.graphics.vertexbuffer.AbstractBuffer)
|
int |
target
OpenGL buffer target, for example GL_ARRAY_BUFFER
(Inherited from pyglet.graphics.vertexbuffer.AbstractBuffer)
|
int |
usage
OpenGL buffer usage, for example GL_DYNAMIC_DRAW
(Inherited from pyglet.graphics.vertexbuffer.AbstractBuffer)
|
Map the entire buffer into system memory.
The mapped region must be subsequently unmapped with unmap before performing any other operations on the buffer.
Map a region of the buffer into a ctypes array of the desired type. This region does not need to be unmapped, but will become invalid if the buffer is resized.
Note that although a pointer type is required, an array is mapped. For example:
get_region(0, ctypes.sizeof(c_int) * 20, ctypes.POINTER(c_int * 20))
will map bytes 0 to 80 of the buffer to an array of 20 ints.
Changes to the array may not be recognised until the region's AbstractBufferRegion.invalidate method is called.
Trees | Indices | Toggle frames |
---|
Generated by Epydoc 3.0beta1 on Thu Dec 31 17:58:18 2009 | http://epydoc.sourceforge.net |