#include <vbuffer.hpp>
Definition at line 137 of file vbuffer.hpp.
Public Member Functions | |
void | append (const T &t) |
void | bind () |
Binds the buffer object for use with OpenGL. | |
gsgl::data::simple_array< T > & | get_buffer () |
void | load () |
Loads the buffer object into the video card. | |
T & | operator[] (const gsgl::index_t &i) |
const T & | operator[] (const gsgl::index_t &i) const |
gsgl::index_t | size () const |
void | unbind () |
Unbinds the buffer object for use with OpenGL. | |
void | unload () |
Unloads the buffer object from the video card. | |
vertex_buffer (const vbuffer::update_mode &mode, const gsgl::index_t initial_capacity=0) | |
virtual | ~vertex_buffer () |
Texture coordinate access. | |
These functions assume 2 components per coordinate. | |
vbuffer::real_t & | get_s (const gsgl::index_t &i) |
const vbuffer::real_t & | get_s (const gsgl::index_t &i) const |
vbuffer::real_t & | get_t (const gsgl::index_t &i) |
const vbuffer::real_t & | get_t (const gsgl::index_t &i) const |
Vertex component access. | |
These functions assume 3 components per vertex. | |
gsgl::math::vector | get_vector (const gsgl::index_t &i) const |
vbuffer::real_t & | get_x (const gsgl::index_t &i) |
const vbuffer::real_t & | get_x (const gsgl::index_t &i) const |
vbuffer::real_t & | get_y (const gsgl::index_t &i) |
const vbuffer::real_t & | get_y (const gsgl::index_t &i) const |
vbuffer::real_t & | get_z (const gsgl::index_t &i) |
const vbuffer::real_t & | get_z (const gsgl::index_t &i) const |
Protected Member Functions | |
virtual gsgl::index_t | buffer_size () |
virtual size_t | element_size () |
virtual void * | get_ptr () |
Protected Attributes | |
int | highest_dirty_index |
int | lowest_dirty_index |
vertex_buffer | ( | const vbuffer::update_mode & | mode, | |
const gsgl::index_t | initial_capacity = 0 | |||
) |
Definition at line 137 of file vbuffer.cpp.
~vertex_buffer | ( | ) | [virtual] |
Definition at line 143 of file vbuffer.cpp.
void append | ( | const T & | t | ) | [inline, inherited] |
Definition at line 112 of file vbuffer.hpp.
Referenced by clipmap_ring::init(), and simple_sphere::simple_sphere().
void bind | ( | ) | [inherited] |
Binds the buffer object for use with OpenGL.
Definition at line 78 of file vbuffer.cpp.
References vbuffer_base::buffer_size(), CHECK_GL_ERRORS, vbuffer_base::element_size(), vbuffer_base::get_ptr(), vbuffer_base::gl_mode, vbuffer_base::highest_dirty_index, vbuffer_base::load(), vbuffer_base::lowest_dirty_index, vbuffer_base::opengl_id, vbuffer_base::prev_size, and vbuffer_base::target.
Referenced by checkered_box::draw(), simple_sphere::draw(), stellar_db::draw(), clipmap_ring::draw(), and submesh::draw().
virtual gsgl::index_t buffer_size | ( | ) | [inline, protected, virtual, inherited] |
virtual size_t element_size | ( | ) | [inline, protected, virtual, inherited] |
gsgl::data::simple_array<T>& get_buffer | ( | ) | [inline, inherited] |
Definition at line 109 of file vbuffer.hpp.
virtual void* get_ptr | ( | ) | [inline, protected, virtual, inherited] |
vbuffer::real_t& get_s | ( | const gsgl::index_t & | i | ) | [inline] |
Definition at line 164 of file vbuffer.hpp.
const vbuffer::real_t& get_s | ( | const gsgl::index_t & | i | ) | const [inline] |
Definition at line 161 of file vbuffer.hpp.
vbuffer::real_t& get_t | ( | const gsgl::index_t & | i | ) | [inline] |
Definition at line 165 of file vbuffer.hpp.
const vbuffer::real_t& get_t | ( | const gsgl::index_t & | i | ) | const [inline] |
Definition at line 162 of file vbuffer.hpp.
gsgl::math::vector get_vector | ( | const gsgl::index_t & | i | ) | const [inline] |
Definition at line 147 of file vbuffer.hpp.
vbuffer::real_t& get_x | ( | const gsgl::index_t & | i | ) | [inline] |
Definition at line 153 of file vbuffer.hpp.
const vbuffer::real_t& get_x | ( | const gsgl::index_t & | i | ) | const [inline] |
Definition at line 149 of file vbuffer.hpp.
vbuffer::real_t& get_y | ( | const gsgl::index_t & | i | ) | [inline] |
Definition at line 154 of file vbuffer.hpp.
const vbuffer::real_t& get_y | ( | const gsgl::index_t & | i | ) | const [inline] |
Definition at line 150 of file vbuffer.hpp.
vbuffer::real_t& get_z | ( | const gsgl::index_t & | i | ) | [inline] |
Definition at line 155 of file vbuffer.hpp.
const vbuffer::real_t& get_z | ( | const gsgl::index_t & | i | ) | const [inline] |
Definition at line 151 of file vbuffer.hpp.
void load | ( | ) | [inherited] |
Loads the buffer object into the video card.
Definition at line 60 of file vbuffer.cpp.
References CHECK_GL_ERRORS, and vbuffer_base::opengl_id.
Referenced by vbuffer_base::bind(), and submesh::load().
T& operator[] | ( | const gsgl::index_t & | i | ) | [inline, inherited] |
Definition at line 115 of file vbuffer.hpp.
const T& operator[] | ( | const gsgl::index_t & | i | ) | const [inline, inherited] |
Definition at line 114 of file vbuffer.hpp.
gsgl::index_t size | ( | ) | const [inline, inherited] |
Definition at line 111 of file vbuffer.hpp.
Referenced by checkered_box::draw(), submesh::draw(), and clipmap_ring::init().
void unbind | ( | ) | [inherited] |
Unbinds the buffer object for use with OpenGL.
Definition at line 116 of file vbuffer.cpp.
References vbuffer_base::target.
void unload | ( | ) | [inherited] |
Unloads the buffer object from the video card.
Definition at line 68 of file vbuffer.cpp.
References CHECK_GL_ERRORS, and vbuffer_base::opengl_id.
Referenced by checkered_box::cleanup(), submesh::unload(), and vbuffer_base::~vbuffer_base().
int highest_dirty_index [protected, inherited] |
Definition at line 87 of file vbuffer.hpp.
Referenced by vbuffer_base::bind(), and vbuffer_mixin< unsigned int >::operator[]().
int lowest_dirty_index [protected, inherited] |
Definition at line 87 of file vbuffer.hpp.
Referenced by vbuffer_base::bind(), and vbuffer_mixin< unsigned int >::operator[]().