Tatooine
vbohelpers.h
Go to the documentation of this file.
1#ifndef TATOOINE_GL_VBOHELPERS_H
2#define TATOOINE_GL_VBOHELPERS_H
3
4#include <array>
5#include <initializer_list>
6#include <iostream>
7#include <vector>
8#include "glincludes.h"
9#include "gltype.h"
10//==============================================================================
11namespace tatooine::gl {
12//==============================================================================
13template <size_t num_attrs, class... Ts>
15//------------------------------------------------------------------------------
16template <size_t num_attrs>
17struct attr_offset<num_attrs> {
18 constexpr static auto gen(size_t, size_t) {
19 return std::array<size_t, num_attrs>();
20 }
21};
22//------------------------------------------------------------------------------
23template <size_t num_attrs, class FirstAttrib, class... RestAttribs>
24struct attr_offset<num_attrs, FirstAttrib, RestAttribs...> {
25 constexpr static auto gen(size_t off = 0, size_t idx = 0) {
27 off + sizeof(FirstAttrib), idx + 1);
28 arr[idx] = off;
29 return arr;
30 }
31};
32//==============================================================================
33} // namespace tatooine::gl
34//==============================================================================
35#endif
Definition: ansiformat.h:6
static constexpr auto gen(size_t off=0, size_t idx=0)
Definition: vbohelpers.h:25
static constexpr auto gen(size_t, size_t)
Definition: vbohelpers.h:18
Definition: vbohelpers.h:14