85 lines
1.3 KiB
C++

#pragma once
#include "glm/glm.hpp"
#define GRID_SIZE 21
namespace deerith
{
void init_primitives();
void shutdown_primitives();
const glm::vec2 rectangle_vertices[4] = {
glm::vec2(0, 0),
glm::vec2(1, 0),
glm::vec2(0, 1),
glm::vec2(1, 1),
};
const unsigned int rectangle_indices[6] = {
0, 2, 1,
1, 2, 3};
const glm::vec3 cube_vertices[8] = {
// Front face (Z = 1)
{0, 0, 1}, // 0: Bottom-left
{1, 0, 1}, // 1: Bottom-right
{0, 1, 1}, // 2: Top-left
{1, 1, 1}, // 3: Top-right
// Back face (Z = 0)
{0, 0, 0}, // 4: Bottom-left
{1, 0, 0}, // 5: Bottom-right
{0, 1, 0}, // 6: Top-left
{1, 1, 0}, // 7: Top-right
};
const unsigned int cube_indices[36] = {
// Front (+Z)
0,
2,
1,
1,
2,
3,
// Back (-Z)
5,
7,
4,
4,
7,
6,
// Left (-X)
4,
6,
0,
0,
6,
2,
// Right (+X)
1,
3,
5,
5,
3,
7,
// Top (+Y)
2,
6,
3,
3,
6,
7,
// Bottom (-Y)
4,
0,
5,
5,
0,
1,
};
}