Conquer Space 0.0.0
A space themed grand strategy game set in the near future, with realistic orbital mechanics, and an emphasis on economics and politics.
mesh.h
Go to the documentation of this file.
1/* Conquer Space
2 * Copyright (C) 2021-2025 Conquer Space
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17#pragma once
18
19#include <memory>
20
21namespace cqsp::engine {
22enum DrawType { ARRAYS = 0, ELEMENTS = 1 };
23
24class Mesh {
25 public:
26 Mesh();
27 ~Mesh();
28
29 unsigned int VAO;
30 unsigned int VBO;
31 unsigned int EBO;
32
33 unsigned int indicies;
34
35 unsigned int mode;
36
38
39 void Draw();
40
41 static void Destroy(Mesh& mesh);
42};
43typedef std::shared_ptr<Mesh> Mesh_t;
44inline Mesh_t MakeMesh() { return std::make_shared<Mesh>(); }
45} // namespace cqsp::engine
Definition: mesh.h:24
Mesh()
Definition: mesh.cpp:21
void Draw()
Definition: mesh.cpp:29
unsigned int VAO
Definition: mesh.h:29
unsigned int indicies
Definition: mesh.h:33
static void Destroy(Mesh &mesh)
Definition: mesh.cpp:46
~Mesh()
Definition: mesh.cpp:23
unsigned int VBO
Definition: mesh.h:30
DrawType buffer_type
Definition: mesh.h:37
unsigned int EBO
Definition: mesh.h:31
unsigned int mode
Definition: mesh.h:35
Definition: application.cpp:55
DrawType
Definition: mesh.h:22
@ ARRAYS
Definition: mesh.h:22
@ ELEMENTS
Definition: mesh.h:22
std::shared_ptr< Mesh > Mesh_t
Definition: mesh.h:43
Mesh_t MakeMesh()
Definition: mesh.h:44