AbstractBuffer
¶Abstract buffer of byte data.
Variables: |
---|
Methods:
bind
()Bind this buffer to its OpenGL target. delete
()Delete this buffer, reducing system resource usage. map
([invalidate])Map the entire buffer into system memory. resize
(size)Resize the buffer to a new size. set_data
(data)Set the entire contents of the buffer. set_data_region
(data, start, length)Set part of the buffer contents. unbind
()Reset the buffer’s OpenGL target. unmap
()Unmap a previously mapped memory block.
Attributes:
AbstractBuffer.
bind
()¶Bind this buffer to its OpenGL target.
AbstractBuffer.
delete
()¶Delete this buffer, reducing system resource usage.
AbstractBuffer.
map
(invalidate=False)¶Map the entire buffer into system memory.
The mapped region must be subsequently unmapped with unmap before performing any other operations on the buffer.
Parameters: | invalidate (bool) – If True, the initial contents of the mapped block need not reflect the actual contents of the buffer. |
---|---|
Return type: | POINTER(ctypes.c_ubyte) |
Returns: | Pointer to the mapped block in memory |
AbstractBuffer.
resize
(size)¶Resize the buffer to a new size.
Parameters: | size (int) – New size of the buffer, in bytes |
---|
AbstractBuffer.
set_data
(data)¶Set the entire contents of the buffer.
Parameters: | data (sequence of int or ctypes pointer) – The byte array to set. |
---|
AbstractBuffer.
set_data_region
(data, start, length)¶Set part of the buffer contents.
Parameters: |
|
---|
AbstractBuffer.
unbind
()¶Reset the buffer’s OpenGL target.
AbstractBuffer.
unmap
()¶Unmap a previously mapped memory block.