galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
Loading...
Searching...
No Matches
Vertex.cpp
Go to the documentation of this file.
1
7
8#include "Vertex.hpp"
9
10namespace galaxy
11{
12 namespace graphics
13 {
14 std::array<Vertex, 4> gen_quad_vertices(const float width, const float height) noexcept
15 {
16 // clang-format off
17 const std::array<Vertex, 4> vertices =
18 {
19 Vertex {
20 .m_pos = glm::vec2 {0.0f, 0.0f},
21 .m_texels = glm::vec2 {0.0f, 0.0f}
22 },
23 Vertex {
24 .m_pos = glm::vec2 {width, 0.0f},
25 .m_texels = glm::vec2 {1.0f, 0.0f}
26 },
27 Vertex {
28 .m_pos = glm::vec2 {width, height},
29 .m_texels = glm::vec2 {1.0f, 1.0f}
30 },
31 Vertex {
32 .m_pos = glm::vec2 {0.0f, height},
33 .m_texels = glm::vec2 {0.0f, 1.0f}
34 }
35 };
36 // clang-format on
37
38 return vertices;
39 }
40
41 std::array<unsigned int, 6> gen_default_indices() noexcept
42 {
43 return {0u, 1u, 3u, 1u, 2u, 3u};
44 }
45 } // namespace graphics
46} // namespace galaxy
thread_local const float vertices[]
Video.cpp galaxy.
Definition Video.cpp:19
std::array< Vertex, 4 > gen_quad_vertices(const float width, const float height) noexcept
Generate some default verticies.
Definition Vertex.cpp:14
std::array< unsigned int, 6 > gen_default_indices() noexcept
Generate some default indicies.
Definition Vertex.cpp:41
Animated.cpp galaxy.
Definition Animated.cpp:16
Represents a single vertex point.
Definition Vertex.hpp:23