Tatooine
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Static Private Member Functions | List of all members
tatooine::gl::vertexbuffer< Ts > Class Template Reference

#include <vertexbuffer.h>

Inheritance diagram for tatooine::gl::vertexbuffer< Ts >:
[legend]
Collaboration diagram for tatooine::gl::vertexbuffer< Ts >:
[legend]

Public Types

using parent_type = buffer< GL_ARRAY_BUFFER, std::conditional_t< sizeof...(Ts)==1, head_t< Ts... >, tuple< Ts... > > >
 
using this_type = vertexbuffer< Ts... >
 
- Public Types inherited from tatooine::gl::buffer< GL_ARRAY_BUFFER, std::conditional_t< sizeof...(Ts)==1, head_t< Ts... >, tuple< Ts... > > >
using parent_type = id_holder< GLuint >
 
using this_type = buffer< array_type, std::conditional_t< sizeof...(Ts)==1, head_t< Ts... >, tuple< Ts... > > >
 
using value_type = std::conditional_t< sizeof...(Ts)==1, head_t< Ts... >, tuple< Ts... > >
 
using read_only_element_type = rbuffer_map_element< array_type, std::conditional_t< sizeof...(Ts)==1, head_t< Ts... >, tuple< Ts... > > >
 
using read_write_element_type = rwbuffer_map_element< array_type, std::conditional_t< sizeof...(Ts)==1, head_t< Ts... >, tuple< Ts... > > >
 
using write_only_element_type = wbuffer_map_element< array_type, std::conditional_t< sizeof...(Ts)==1, head_t< Ts... >, tuple< Ts... > > >
 
using iterator = buffer_iterator< array_type, std::conditional_t< sizeof...(Ts)==1, head_t< Ts... >, tuple< Ts... > > >
 
using const_iterator = cbuffer_iterator< array_type, std::conditional_t< sizeof...(Ts)==1, head_t< Ts... >, tuple< Ts... > > >
 
using read_map_type = rbuffer_map< array_type, std::conditional_t< sizeof...(Ts)==1, head_t< Ts... >, tuple< Ts... > > >
 
using write_map_type = wbuffer_map< array_type, std::conditional_t< sizeof...(Ts)==1, head_t< Ts... >, tuple< Ts... > > >
 
using read_write_map_type = rwbuffer_map< array_type, std::conditional_t< sizeof...(Ts)==1, head_t< Ts... >, tuple< Ts... > > >
 

Public Member Functions

 vertexbuffer (buffer_usage usage=default_usage)
 
 vertexbuffer (vertexbuffer const &other)
 
 vertexbuffer (vertexbuffer &&other) noexcept
 
auto operator= (this_type const &other) -> auto &
 
auto operator= (this_type &&other) noexcept -> auto &
 
 vertexbuffer (std::size_t n, buffer_usage usage=default_usage)
 
 vertexbuffer (std::size_t n, value_type const &initial, buffer_usage usage=default_usage)
 
 vertexbuffer (std::vector< value_type > const &data, buffer_usage usage=default_usage)
 
 vertexbuffer (std::initializer_list< value_type > &&list)
 
void push_back (Ts const &... ts)
 
- Public Member Functions inherited from tatooine::gl::buffer< GL_ARRAY_BUFFER, std::conditional_t< sizeof...(Ts)==1, head_t< Ts... >, tuple< Ts... > > >
 buffer (buffer_usage usage)
 
 buffer (const buffer &other)
 
 buffer (buffer &&other) noexcept
 
 buffer (GLsizei n, buffer_usage usage)
 
 buffer (GLsizei n, const std::conditional_t< sizeof...(Ts)==1, head_t< Ts... >, tuple< Ts... > > &initial, buffer_usage usage)
 
 buffer (const std::vector< std::conditional_t< sizeof...(Ts)==1, head_t< Ts... >, tuple< Ts... > > > &data, buffer_usage usage)
 
auto operator= (const buffer &other) -> buffer &
 
auto operator= (buffer &&other) noexcept -> buffer &
 
auto operator= (const std::vector< std::conditional_t< sizeof...(Ts)==1, head_t< Ts... >, tuple< Ts... > > > &data) -> buffer &
 
 ~buffer ()
 
auto create_handle () -> void
 
auto destroy_handle () -> void
 
auto upload_data (const std::conditional_t< sizeof...(Ts)==1, head_t< Ts... >, tuple< Ts... > > &data) -> void
 
auto upload_data (const std::vector< std::conditional_t< sizeof...(Ts)==1, head_t< Ts... >, tuple< Ts... > > > &data) -> void
 
auto download_data () const -> std::vector< std::conditional_t< sizeof...(Ts)==1, head_t< Ts... >, tuple< Ts... > > >
 
auto bind () const -> void
 
auto copy (const this_type &other) -> void
 
auto empty () const -> bool
 
auto size () const
 
auto capacity () const
 
auto reserve (GLsizei size) -> void
 
auto resize (GLsizei size) -> void
 
auto clear ()
 
auto gpu_malloc (GLsizei n) -> void
 
auto gpu_malloc (GLsizei n, const std::conditional_t< sizeof...(Ts)==1, head_t< Ts... >, tuple< Ts... > > &initial) -> void
 
auto set_usage (buffer_usage) -> void
 
auto push_back (std::conditional_t< sizeof...(Ts)==1, head_t< Ts... >, tuple< Ts... > > const &) -> void
 
auto pop_back () -> void
 
auto emplace_back (Ts &&...) -> void
 
auto emplace_back (Ts &&... ts) -> void
 
auto read_write_element_at (std::size_t idx)
 
auto read_element_at (std::size_t idx) const
 
auto write_only_element_at (std::size_t idx)
 
auto at (std::size_t idx)
 
auto at (std::size_t idx) const
 
auto operator[] (std::size_t idx)
 
auto operator[] (std::size_t idx) const
 
auto front ()
 
auto front () const
 
auto back ()
 
auto back () const
 
auto begin ()
 
auto begin () const
 
auto end ()
 
auto end () const
 
auto rmap () const
 
auto wmap ()
 
auto rwmap ()
 
auto map ()
 
auto map () const
 
auto map (std::size_t offset, std::size_t length)
 
auto map (std::size_t offset, std::size_t length) const
 
- Public Member Functions inherited from tatooine::gl::id_holder< GLuint >
 id_holder ()
 
 id_holder (GLuint _id)
 
 id_holder (id_holder const &other)=delete
 
 id_holder (id_holder &&other) noexcept
 
auto operator= (id_holder const &other) -> id_holder &=delete
 
auto operator= (id_holder &&other) noexcept -> id_holder &
 
 ~id_holder ()=default
 
auto id () const
 
void swap (id_holder &other)
 

Static Public Member Functions

static constexpr void activate_attributes ()
 
template<std::convertible_to< GLboolean >... Normalized>
static constexpr void activate_attributes (Normalized... normalized)
 
static constexpr void deactivate_attributes ()
 
- Static Public Member Functions inherited from tatooine::gl::buffer< GL_ARRAY_BUFFER, std::conditional_t< sizeof...(Ts)==1, head_t< Ts... >, tuple< Ts... > > >
static auto unbind () -> void
 

Static Public Attributes

static constexpr auto data_size = parent_type::data_size
 
static buffer_usage const default_usage = buffer_usage::STATIC_DRAW
 
static constexpr auto num_attributes = sizeof...(Ts)
 
static constexpr std::array< GLsizei, num_attributesnum_components
 
static constexpr std::array< GLenum, num_attributestypes
 
static constexpr std::array< std::size_t, num_attributesoffsets
 
- Static Public Attributes inherited from tatooine::gl::buffer< GL_ARRAY_BUFFER, std::conditional_t< sizeof...(Ts)==1, head_t< Ts... >, tuple< Ts... > > >
static constexpr auto array_type
 
static constexpr GLsizei data_size
 
- Static Public Attributes inherited from tatooine::gl::id_holder< GLuint >
static constexpr auto default_val
 

Static Private Member Functions

template<std::convertible_to< GLboolean >... Normalized, std::size_t... Is>
static constexpr auto activate_attributes (std::index_sequence< Is... >, Normalized... normalized) -> void
 

Additional Inherited Members

- Protected Member Functions inherited from tatooine::gl::id_holder< GLuint >
void set_id (GLuint id)
 
auto id_ptr ()
 
auto id_ref () -> auto &
 

Member Typedef Documentation

◆ parent_type

template<typename... Ts>
using tatooine::gl::vertexbuffer< Ts >::parent_type = buffer< GL_ARRAY_BUFFER, std::conditional_t<sizeof...(Ts) == 1, head_t<Ts...>, tuple<Ts...> > >

◆ this_type

template<typename... Ts>
using tatooine::gl::vertexbuffer< Ts >::this_type = vertexbuffer<Ts...>

Constructor & Destructor Documentation

◆ vertexbuffer() [1/7]

template<typename... Ts>
tatooine::gl::vertexbuffer< Ts >::vertexbuffer ( buffer_usage  usage = default_usage)
inline

◆ vertexbuffer() [2/7]

template<typename... Ts>
tatooine::gl::vertexbuffer< Ts >::vertexbuffer ( vertexbuffer< Ts > const &  other)
inline

◆ vertexbuffer() [3/7]

template<typename... Ts>
tatooine::gl::vertexbuffer< Ts >::vertexbuffer ( vertexbuffer< Ts > &&  other)
inlinenoexcept

◆ vertexbuffer() [4/7]

template<typename... Ts>
tatooine::gl::vertexbuffer< Ts >::vertexbuffer ( std::size_t  n,
buffer_usage  usage = default_usage 
)
inline

◆ vertexbuffer() [5/7]

template<typename... Ts>
tatooine::gl::vertexbuffer< Ts >::vertexbuffer ( std::size_t  n,
value_type const &  initial,
buffer_usage  usage = default_usage 
)
inline

◆ vertexbuffer() [6/7]

template<typename... Ts>
tatooine::gl::vertexbuffer< Ts >::vertexbuffer ( std::vector< value_type > const &  data,
buffer_usage  usage = default_usage 
)
inline

◆ vertexbuffer() [7/7]

template<typename... Ts>
tatooine::gl::vertexbuffer< Ts >::vertexbuffer ( std::initializer_list< value_type > &&  list)
inline

Member Function Documentation

◆ activate_attributes() [1/3]

template<typename... Ts>
static constexpr void tatooine::gl::vertexbuffer< Ts >::activate_attributes ( )
inlinestaticconstexpr

◆ activate_attributes() [2/3]

template<typename... Ts>
template<std::convertible_to< GLboolean >... Normalized>
static constexpr void tatooine::gl::vertexbuffer< Ts >::activate_attributes ( Normalized...  normalized)
inlinestaticconstexpr

◆ activate_attributes() [3/3]

template<typename... Ts>
template<std::convertible_to< GLboolean >... Normalized, std::size_t... Is>
static constexpr auto tatooine::gl::vertexbuffer< Ts >::activate_attributes ( std::index_sequence< Is... >  ,
Normalized...  normalized 
) -> void
inlinestaticconstexprprivate

◆ deactivate_attributes()

template<typename... Ts>
static constexpr void tatooine::gl::vertexbuffer< Ts >::deactivate_attributes ( )
inlinestaticconstexpr

◆ operator=() [1/2]

template<typename... Ts>
auto tatooine::gl::vertexbuffer< Ts >::operator= ( this_type &&  other) -> auto&
inlinenoexcept

◆ operator=() [2/2]

template<typename... Ts>
auto tatooine::gl::vertexbuffer< Ts >::operator= ( this_type const &  other) -> auto&
inline

◆ push_back()

template<typename... Ts>
void tatooine::gl::vertexbuffer< Ts >::push_back ( Ts const &...  ts)
inline

Member Data Documentation

◆ data_size

template<typename... Ts>
constexpr auto tatooine::gl::vertexbuffer< Ts >::data_size = parent_type::data_size
staticconstexpr

◆ default_usage

template<typename... Ts>
buffer_usage const tatooine::gl::vertexbuffer< Ts >::default_usage = buffer_usage::STATIC_DRAW
static

◆ num_attributes

template<typename... Ts>
constexpr auto tatooine::gl::vertexbuffer< Ts >::num_attributes = sizeof...(Ts)
staticconstexpr

◆ num_components

template<typename... Ts>
constexpr std::array<GLsizei, num_attributes> tatooine::gl::vertexbuffer< Ts >::num_components
staticconstexpr
Initial value:
{
static_cast<GLsizei>(tatooine::tensor_num_components<Ts>)...}

◆ offsets

template<typename... Ts>
constexpr std::array<std::size_t, num_attributes> tatooine::gl::vertexbuffer< Ts >::offsets
staticconstexpr
Initial value:
=
static constexpr auto gen(size_t, size_t)
Definition: vbohelpers.h:18

◆ types

template<typename... Ts>
constexpr std::array<GLenum, num_attributes> tatooine::gl::vertexbuffer< Ts >::types
staticconstexpr
Initial value:
{
value_type_v<Ts>...}

The documentation for this class was generated from the following file: