nngn
Loading...
Searching...
No Matches
grid.h
Go to the documentation of this file.
1#ifndef NNGN_GRID_H
2#define NNGN_GRID_H
3
4#include "math/vec3.h"
5#include "utils/def.h"
6
7namespace nngn {
8
9struct Graphics;
10
11class Grid {
12 Graphics *graphics = nullptr;
13 std::size_t m_size = 0;
14 vec3 color = {1, 1, 1};
15 float m_spacing = 0;
16 u32 m_vbo = {}, m_ebo = {};
17 bool m_enabled = false;
18 bool update() const;
19public:
20 bool enabled() const { return this->m_enabled; }
21 std::size_t size(void) const { return this->m_size; }
22 float spacing(void) const { return this->m_spacing; }
23 u32 vbo() const { return this->m_vbo; }
24 u32 ebo() const { return this->m_ebo; }
25 bool set_graphics(Graphics *g);
26 bool set_enabled(bool e);
27 bool set_dimensions(float spacing, unsigned size);
28 bool set_color(float v0, float v1, float v2);
29};
30
31}
32
33#endif
Definition grid.h:11
u32 m_ebo
Definition grid.h:16
Graphics * graphics
Definition grid.h:12
bool m_enabled
Definition grid.h:17
u32 m_vbo
Definition grid.h:16
bool enabled() const
Definition grid.h:20
float m_spacing
Definition grid.h:15
std::size_t size(void) const
Definition grid.h:21
bool update() const
Definition grid.cpp:32
bool set_enabled(bool e)
Definition grid.cpp:27
u32 vbo() const
Definition grid.h:23
vec3 color
Definition grid.h:14
u32 ebo() const
Definition grid.h:24
std::size_t m_size
Definition grid.h:13
bool set_color(float v0, float v1, float v2)
Definition grid.cpp:76
float spacing(void) const
Definition grid.h:22
bool set_graphics(Graphics *g)
Definition grid.cpp:12
bool set_dimensions(float spacing, unsigned size)
Definition grid.cpp:70
local g
Definition gamma.lua:7
Definition audio.cpp:7
std::uint32_t u32
Definition def.h:14
Definition graphics.h:138
local e
Definition math.lua:4