1#ifndef TATOOINE_GL_VERTEXBUFFER_H
2#define TATOOINE_GL_VERTEXBUFFER_H
12#include <initializer_list>
18template <
typename... Ts>
20 :
public buffer<GL_ARRAY_BUFFER,
21 std::conditional_t<sizeof...(Ts) == 1, head_t<Ts...>,
36 static_cast<GLsizei>(tatooine::tensor_num_components<Ts>)...};
37 static constexpr std::array<GLenum, num_attributes>
types{
39 static constexpr std::array<std::size_t, num_attributes>
offsets =
85 template <std::convertible_to<GL
boolean>... Normalized, std::
size_t... Is>
87 std::index_sequence<Is...>, Normalized... normalized) ->
void {
88 static_assert(
sizeof...(Normalized) ==
sizeof...(Is));
91 [&](std::size_t i, GLboolean normalized) {
95 }(Is,
static_cast<GLboolean
>(normalized)),
100 template <std::convertible_to<GL
boolean>... Normalized>
buffer base class for each of the OpenGL buffer types
Definition: buffer.h:405
std::conditional_t< sizeof...(Ts)==1, head_t< Ts... >, tuple< Ts... > > value_type
Definition: buffer.h:416
static constexpr GLsizei data_size
Definition: buffer.h:413
auto operator=(const buffer &other) -> buffer &
Definition: buffer.h:539
Definition: vertexbuffer.h:22
static constexpr std::array< GLsizei, num_attributes > num_components
Definition: vertexbuffer.h:35
static constexpr void activate_attributes()
Definition: vertexbuffer.h:76
vertexbuffer(std::size_t n, buffer_usage usage=default_usage)
Definition: vertexbuffer.h:57
static constexpr void deactivate_attributes()
Definition: vertexbuffer.h:106
static constexpr std::array< std::size_t, num_attributes > offsets
Definition: vertexbuffer.h:39
vertexbuffer(std::vector< value_type > const &data, buffer_usage usage=default_usage)
Definition: vertexbuffer.h:62
auto operator=(this_type const &other) -> auto &
Definition: vertexbuffer.h:47
static constexpr auto activate_attributes(std::index_sequence< Is... >, Normalized... normalized) -> void
Definition: vertexbuffer.h:86
static buffer_usage const default_usage
Definition: vertexbuffer.h:32
static constexpr auto num_attributes
Definition: vertexbuffer.h:34
vertexbuffer(buffer_usage usage=default_usage)
Definition: vertexbuffer.h:43
static constexpr auto data_size
Definition: vertexbuffer.h:30
vertexbuffer(vertexbuffer const &other)
Definition: vertexbuffer.h:44
static constexpr std::array< GLenum, num_attributes > types
Definition: vertexbuffer.h:37
auto operator=(this_type &&other) noexcept -> auto &
Definition: vertexbuffer.h:52
static constexpr void activate_attributes(Normalized... normalized)
Definition: vertexbuffer.h:101
vertexbuffer(vertexbuffer &&other) noexcept
Definition: vertexbuffer.h:45
void push_back(Ts const &... ts)
Definition: vertexbuffer.h:67
vertexbuffer(std::size_t n, value_type const &initial, buffer_usage usage=default_usage)
Definition: vertexbuffer.h:59
vertexbuffer(std::initializer_list< value_type > &&list)
Definition: vertexbuffer.h:64
Definition: ansiformat.h:6
DLL_API auto vertex_attrib_pointer(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer) -> void
DLL_API auto disable_vertex_attrib_array(GLuint index) -> void
DLL_API auto enable_vertex_attrib_array(GLuint index) -> void
buffer_usage
Definition: buffer_usage.h:8
typename head< Ts... >::type head_t
Definition: utility.h:38
static constexpr auto gen(size_t, size_t)
Definition: vbohelpers.h:18
type_list_push_back< this_type, T > push_back
Definition: type_list.h:254