Antkeeper  0.0.1
gl/vertex-attribute.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2023 Christopher J. Howard
3  *
4  * This file is part of Antkeeper source code.
5  *
6  * Antkeeper source code is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * Antkeeper source code is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with Antkeeper source code. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef ANTKEEPER_GL_VERTEX_ATTRIBUTE_HPP
21 #define ANTKEEPER_GL_VERTEX_ATTRIBUTE_HPP
22 
23 #include <cstddef>
24 #include <cstdint>
25 
26 namespace gl {
27 
28 class vertex_buffer;
29 
30 enum class vertex_attribute_type: std::uint8_t
31 {
32  int_8,
33  uint_8,
34  int_16,
35  uint_16,
36  int_32,
37  uint_32,
38  float_16,
39  float_32,
40  float_64
41 };
42 
50 {
52  const vertex_buffer* buffer{nullptr};
53 
55  std::size_t offset{0};
56 
58  std::size_t stride{0};
59 
62 
64  std::uint8_t components{0};
65 
67  bool normalized{};
68 };
69 
70 } // namespace gl
71 
72 #endif // ANTKEEPER_GL_VERTEX_ATTRIBUTE_HPP
Vertex buffer object (VBO).
Graphics library interface.
Text and typography.
Definition: bitmap-font.cpp:24
Describes a vertex attribute within a vertex buffer.
std::size_t stride
Number of bytes between consecutive instances of this attribute in the vertex buffer....
std::size_t offset
Offset to the first component of the first instance of this attribute in the vertex buffer,...
const vertex_buffer * buffer
Pointer to the vertex buffer containing vertex attribute data.
std::uint8_t components
Number of components per attribute instance. Supported values are 1, 2, 3, and 4.
bool normalized
true if fixed point data should be normalized, false otherwise.