|
cgv
|
attribute array manager used to upload arrays to gpu More...
#include <attribute_array_manager.h>
Public Member Functions | |
| template<typename T > | |
| bool | set_indices (const context &ctx, const T &array) |
| template<typename T > | |
| bool | set_indices (const context &ctx, const T *array, size_t count) |
| bool | has_index_buffer () const |
| whether aam contains an index buffer | |
| void | remove_indices (const context &ctx) |
| template<typename T > | |
| bool | set_attribute_array (const context &ctx, int loc, const T &array) |
| template<typename T > | |
| bool | set_attribute_array (const context &ctx, int loc, const T *array_ptr, size_t nr_elements, unsigned stride) |
| bool | set_attribute_array (const context &ctx, int loc, type_descriptor element_type, const vertex_buffer &vbo, size_t offset_in_bytes, size_t nr_elements, unsigned stride_in_bytes) |
| template<typename C , typename T > | |
| bool | set_composed_attribute_array (const context &ctx, int loc, const C *array_ptr, size_t nr_elements, const T &elem) |
| template<typename C , typename T > | |
| bool | ref_composed_attribute_array (const context &ctx, int loc, int loc_ref, const C *array_ptr, size_t nr_elements, const T &elem) |
| void | remove_attribute_array (const context &ctx, int loc) |
| attribute_array_manager (VertexBufferUsage _default_usage=VBU_STREAM_DRAW) | |
| default initialization | |
| ~attribute_array_manager () | |
| destructor calls destruct | |
| bool | has_attribute (const context &ctx, int loc) const |
| check whether the given attribute is available | |
| const vertex_buffer * | get_buffer_ptr (int loc) const |
| returns the pointer to the vertex buffer as managed by this attribute array manager if specified and nullptr otherwise | |
| bool | is_created () const |
| bool | init (context &ctx) |
| bool | enable (context &ctx) |
| bool | disable (context &ctx) |
| void | destruct (const context &ctx) |
Protected Attributes | |
| VertexBufferUsage | default_usage |
| store default buffer usage | |
| attribute_array_binding | aab |
| attribue array binding used to store array pointers | |
| std::map< int, vertex_buffer * > | vbos |
| store vertex buffers generated per attribute location | |
Friends | |
| class | renderer |
| give renderer access to protected members | |
attribute array manager used to upload arrays to gpu
Definition at line 14 of file attribute_array_manager.h.
| cgv::render::attribute_array_manager::attribute_array_manager | ( | VertexBufferUsage | _default_usage = VBU_STREAM_DRAW | ) |
default initialization
Definition at line 6 of file attribute_array_manager.cxx.
References default_usage.
| cgv::render::attribute_array_manager::~attribute_array_manager | ( | ) |
destructor calls destruct
Definition at line 12 of file attribute_array_manager.cxx.
References aab, cgv::render::render_component::ctx_ptr, cgv::render::render_component::is_created(), and cgv::render::context::make_current().
| void cgv::render::attribute_array_manager::destruct | ( | const context & | ctx | ) |
Definition at line 57 of file attribute_array_manager.cxx.
| bool cgv::render::attribute_array_manager::disable | ( | context & | ctx | ) |
Definition at line 53 of file attribute_array_manager.cxx.
| bool cgv::render::attribute_array_manager::enable | ( | context & | ctx | ) |
Definition at line 50 of file attribute_array_manager.cxx.
|
inline |
returns the pointer to the vertex buffer as managed by this attribute array manager if specified and nullptr otherwise
Definition at line 155 of file attribute_array_manager.h.
Referenced by cgv::render::renderer::get_index_buffer_ptr(), and cgv::render::renderer::get_vertex_buffer_ptr().
| bool cgv::render::attribute_array_manager::has_attribute | ( | const context & | ctx, |
| int | loc | ||
| ) | const |
check whether the given attribute is available
Definition at line 9 of file attribute_array_manager.cxx.
References aab, and cgv::render::attribute_array_binding::is_array_enabled().
Referenced by cgv::render::renderer::has_attribute().
| bool cgv::render::attribute_array_manager::has_index_buffer | ( | ) | const |
whether aam contains an index buffer
Definition at line 20 of file attribute_array_manager.cxx.
References vbos.
Referenced by cgv::render::renderer::has_indices().
| bool cgv::render::attribute_array_manager::init | ( | context & | ctx | ) |
Definition at line 47 of file attribute_array_manager.cxx.
| bool cgv::render::attribute_array_manager::is_created | ( | ) | const |
Definition at line 44 of file attribute_array_manager.cxx.
|
inline |
Definition at line 136 of file attribute_array_manager.h.
| void cgv::render::attribute_array_manager::remove_attribute_array | ( | const context & | ctx, |
| int | loc | ||
| ) |
Definition at line 35 of file attribute_array_manager.cxx.
| void cgv::render::attribute_array_manager::remove_indices | ( | const context & | ctx | ) |
Definition at line 27 of file attribute_array_manager.cxx.
|
inline |
Definition at line 71 of file attribute_array_manager.h.
|
inline |
Definition at line 91 of file attribute_array_manager.h.
| bool cgv::render::attribute_array_manager::set_attribute_array | ( | const context & | ctx, |
| int | loc, | ||
| type_descriptor | element_type, | ||
| const vertex_buffer & | vbo, | ||
| size_t | offset_in_bytes, | ||
| size_t | nr_elements, | ||
| unsigned | stride_in_bytes | ||
| ) |
Definition at line 16 of file attribute_array_manager.cxx.
|
inline |
Definition at line 113 of file attribute_array_manager.h.
|
inline |
Definition at line 27 of file attribute_array_manager.h.
|
inline |
Definition at line 47 of file attribute_array_manager.h.
|
friend |
give renderer access to protected members
Definition at line 23 of file attribute_array_manager.h.
|
protected |
attribue array binding used to store array pointers
Definition at line 19 of file attribute_array_manager.h.
Referenced by has_attribute(), and ~attribute_array_manager().
|
protected |
store default buffer usage
Definition at line 17 of file attribute_array_manager.h.
Referenced by attribute_array_manager().
|
protected |
store vertex buffers generated per attribute location
Definition at line 21 of file attribute_array_manager.h.
Referenced by has_index_buffer().