Link Search Menu Expand Document

Class OGLVBO

Class diagram of class of OGLVBO.

Functions

Function summury
__init__(self, data, usage=GL_DYNAMIC_DRAW, target=GL_ARRAY_BUFFER) Local implementation of VBO facilities (more…)
bind(self) Bind a buffer for future usage in GPU (more…)
set_data(self, data) Set the full data of a buffer (more…)
set_sub_data(self, offset, sub_data) Set a partial data of a buffer (more…)
unbind(self) unbind the data buffer from GPU (more…)
delete(self) Free GPU memory (more…)
__del__(self) Destructor : must not forget to free memory in GPU (more…)
__add__(self, offset) Returns the starting pointer for a given offset (more…)

Methods desciption :

init

def __init__(self, data, usage=GL_DYNAMIC_DRAW, target=GL_ARRAY_BUFFER)

Local implementation of VBO facilities

  • → data : numpy array
  • → target : GL_ARRAY_BUFFER Vertex attributes GL_ATOMIC_COUNTER_BUFFER Atomic counter storage GL_COPY_READ_BUFFER Buffer copy source GL_COPY_WRITE_BUFFER Buffer copy destination GL_DISPATCH_INDIRECT_BUFFER Indirect compute dispatch commands GL_DRAW_INDIRECT_BUFFER Indirect command arguments GL_ELEMENT_ARRAY_BUFFER Vertex array indices GL_PIXEL_PACK_BUFFER Pixel read target GL_PIXEL_UNPACK_BUFFER Texture data source GL_QUERY_BUFFER Query result buffer GL_SHADER_STORAGE_BUFFER Read-write storage for shaders GL_TEXTURE_BUFFER Texture data buffer GL_TRANSFORM_FEEDBACK_BUFFER Transform feedback buffer GL_UNIFORM_BUFFER Uniform block storage
  • → usage : GL_STREAM_DRAW, GL_STREAM_READ, GL_STREAM_COPY, GL_STATIC_DRAW, GL_STATIC_READ, GL_STATIC_COPY, GL_DYNAMIC_DRAW, GL_DYNAMIC_READ, GL_DYNAMIC_COPY

bind

def bind(self)

Bind a buffer for future usage in GPU

set_data

def set_data(self, data)

Set the full data of a buffer

  • → data must be a numpy array

set_sub_data

def set_sub_data(self, offset, sub_data)

Set a partial data of a buffer

  • → offset : starting pointer where to put sub_data
  • → sub_data : must be a numpy array

unbind

def unbind(self)

unbind the data buffer from GPU

delete

def delete(self)

Free GPU memory

del

def __del__(self)

Destructor : must not forget to free memory in GPU

add

def __add__(self, offset)

Returns the starting pointer for a given offset

  • ←s : a starting pointer