mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-08-08 17:57:02 +08:00
refactor(render): move render files to subdirectory, add RAII vertex buffer/array classes
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
#define GLFW_INCLUDE_NONE
|
#define GLFW_INCLUDE_NONE
|
||||||
#include "Cubed/camera.hpp"
|
#include "Cubed/camera.hpp"
|
||||||
#include "Cubed/dev_panel.hpp"
|
#include "Cubed/dev_panel.hpp"
|
||||||
#include "Cubed/renderer.hpp"
|
#include "Cubed/render/renderer.hpp"
|
||||||
#include "Cubed/texture_manager.hpp"
|
#include "Cubed/texture_manager.hpp"
|
||||||
#include "Cubed/window.hpp"
|
#include "Cubed/window.hpp"
|
||||||
namespace Cubed {
|
namespace Cubed {
|
||||||
|
|||||||
@@ -58,8 +58,8 @@ public:
|
|||||||
|
|
||||||
void rebuild_world();
|
void rebuild_world();
|
||||||
|
|
||||||
void push_delete_vbo(GLuint vbo);
|
void push_delete_vbo(std::unique_ptr<VertexBuffer>& vbo);
|
||||||
void push_delete_vao(GLuint vao);
|
void push_delete_vao(std::unique_ptr<VertexArray>& vao);
|
||||||
// void hot_reload();
|
// void hot_reload();
|
||||||
|
|
||||||
// void rebuild_world();
|
// void rebuild_world();
|
||||||
@@ -134,8 +134,8 @@ private:
|
|||||||
tbb::concurrent_queue<std::unique_ptr<ClientChunk>> m_pending_upload_queue;
|
tbb::concurrent_queue<std::unique_ptr<ClientChunk>> m_pending_upload_queue;
|
||||||
tbb::concurrent_queue<ChunkPos> m_dirty_chunk_queue;
|
tbb::concurrent_queue<ChunkPos> m_dirty_chunk_queue;
|
||||||
tbb::concurrent_queue<PendingSound> m_pending_sound;
|
tbb::concurrent_queue<PendingSound> m_pending_sound;
|
||||||
std::vector<GLuint> m_pending_delete_vbo;
|
std::vector<std::unique_ptr<VertexBuffer>> m_pending_delete_vbo;
|
||||||
std::vector<GLuint> m_pending_delete_vao;
|
std::vector<std::unique_ptr<VertexArray>> m_pending_delete_vao;
|
||||||
|
|
||||||
std::deque<ChunkPos> m_dirty_queue;
|
std::deque<ChunkPos> m_dirty_queue;
|
||||||
std::vector<const ChunkRenderSnapshot*> m_render_snapshots;
|
std::vector<const ChunkRenderSnapshot*> m_render_snapshots;
|
||||||
|
|||||||
@@ -1,15 +1,18 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "Cubed/primitive_data.hpp"
|
#include "Cubed/primitive_data.hpp"
|
||||||
|
#include "Cubed/render/vertex_array.hpp"
|
||||||
|
#include "Cubed/render/vertex_buffer.hpp"
|
||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <glad/glad.h>
|
#include <glad/glad.h>
|
||||||
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
namespace Cubed {
|
namespace Cubed {
|
||||||
class ClientWorld;
|
class ClientWorld;
|
||||||
struct VertexData {
|
struct VertexData {
|
||||||
std::vector<Vertex3D> m_vertices;
|
std::vector<Vertex3D> m_vertices;
|
||||||
GLuint m_vbo = 0;
|
std::unique_ptr<VertexBuffer> m_vbo;
|
||||||
GLuint m_vao = 0;
|
std::unique_ptr<VertexArray> m_vao;
|
||||||
std::atomic<std::size_t> m_sum{0};
|
std::atomic<std::size_t> m_sum{0};
|
||||||
ClientWorld& m_world;
|
ClientWorld& m_world;
|
||||||
VertexData(ClientWorld& world);
|
VertexData(ClientWorld& world);
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Cubed/constants.hpp"
|
#include "Cubed/constants.hpp"
|
||||||
#include "Cubed/player_renderer.hpp"
|
|
||||||
#include "Cubed/primitive_data.hpp"
|
#include "Cubed/primitive_data.hpp"
|
||||||
|
#include "Cubed/render/player_renderer.hpp"
|
||||||
|
#include "Cubed/render/vertex_array.hpp"
|
||||||
|
#include "Cubed/render/vertex_buffer.hpp"
|
||||||
#include "Cubed/shader.hpp"
|
#include "Cubed/shader.hpp"
|
||||||
#include "Cubed/ui/text.hpp"
|
#include "Cubed/ui/text.hpp"
|
||||||
|
|
||||||
@@ -126,12 +128,14 @@ private:
|
|||||||
|
|
||||||
glm::mat4 m_p_mat, m_v_mat, m_m_mat, m_mv_mat, m_mvp_mat, m_norm_mat;
|
glm::mat4 m_p_mat, m_v_mat, m_m_mat, m_mv_mat, m_mvp_mat, m_norm_mat;
|
||||||
|
|
||||||
GLuint m_sky_vbo = 0;
|
std::unique_ptr<VertexBuffer> m_sky_vbo;
|
||||||
GLuint m_text_vbo = 0;
|
std::unique_ptr<VertexBuffer> m_text_vbo = 0;
|
||||||
GLuint m_outline_indices_vbo = 0;
|
std::unique_ptr<VertexBuffer> m_outline_indices_vbo = 0;
|
||||||
GLuint m_outline_vbo = 0;
|
std::unique_ptr<VertexBuffer> m_outline_vbo = 0;
|
||||||
GLuint m_ui_vbo = 0;
|
std::unique_ptr<VertexBuffer> m_ui_vbo = 0;
|
||||||
GLuint m_player_vbo = 0;
|
std::unique_ptr<VertexBuffer> m_player_vbo = 0;
|
||||||
|
std::unique_ptr<VertexBuffer> m_quad_vbo = 0;
|
||||||
|
|
||||||
GLuint m_fbo = 0;
|
GLuint m_fbo = 0;
|
||||||
GLuint m_screen_texture = 0;
|
GLuint m_screen_texture = 0;
|
||||||
GLuint m_screen_depth_texture = 0;
|
GLuint m_screen_depth_texture = 0;
|
||||||
@@ -144,8 +148,6 @@ private:
|
|||||||
GLuint m_depth_map_fbo = 0;
|
GLuint m_depth_map_fbo = 0;
|
||||||
GLuint m_depth_map_texture = 0;
|
GLuint m_depth_map_texture = 0;
|
||||||
|
|
||||||
GLuint m_quad_vbo = 0;
|
|
||||||
|
|
||||||
glm::mat4 m_ui_proj;
|
glm::mat4 m_ui_proj;
|
||||||
glm::mat4 m_ui_m_matrix;
|
glm::mat4 m_ui_m_matrix;
|
||||||
std::unordered_map<std::size_t, Shader> m_shaders;
|
std::unordered_map<std::size_t, Shader> m_shaders;
|
||||||
@@ -184,7 +186,7 @@ private:
|
|||||||
3 - ui vao
|
3 - ui vao
|
||||||
4 - text vao
|
4 - text vao
|
||||||
*/
|
*/
|
||||||
std::vector<GLuint> m_vao;
|
std::vector<VertexArray> m_vao;
|
||||||
std::vector<Vertex2D> m_ui;
|
std::vector<Vertex2D> m_ui;
|
||||||
|
|
||||||
void init_quad();
|
void init_quad();
|
||||||
26
include/Cubed/render/vertex_array.hpp
Normal file
26
include/Cubed/render/vertex_array.hpp
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
#pragma once
|
||||||
|
#include <glad/glad.h>
|
||||||
|
|
||||||
|
namespace Cubed {
|
||||||
|
class VertexArray {
|
||||||
|
public:
|
||||||
|
VertexArray();
|
||||||
|
VertexArray(const VertexArray&) = delete;
|
||||||
|
VertexArray(VertexArray&&) noexcept;
|
||||||
|
VertexArray& operator=(const VertexArray&) = delete;
|
||||||
|
VertexArray& operator=(VertexArray&&) noexcept;
|
||||||
|
~VertexArray();
|
||||||
|
|
||||||
|
void bind() const;
|
||||||
|
|
||||||
|
static void unbind();
|
||||||
|
|
||||||
|
GLuint id() const;
|
||||||
|
|
||||||
|
void attribute(GLuint index, GLint size, GLenum type, GLsizei stride,
|
||||||
|
const void* ptr, bool normalized = false) const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
GLuint m_vao = 0;
|
||||||
|
};
|
||||||
|
} // namespace Cubed
|
||||||
36
include/Cubed/render/vertex_buffer.hpp
Normal file
36
include/Cubed/render/vertex_buffer.hpp
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
#pragma once
|
||||||
|
#include <glad/glad.h>
|
||||||
|
namespace Cubed {
|
||||||
|
|
||||||
|
enum class BufferType : GLenum {
|
||||||
|
ARRAY_BUFFER = GL_ARRAY_BUFFER,
|
||||||
|
ELEMENT_ARRAY_BUFFER = GL_ELEMENT_ARRAY_BUFFER
|
||||||
|
};
|
||||||
|
|
||||||
|
enum class BufferUsage : GLenum {
|
||||||
|
STATIC_DRAW = GL_STATIC_DRAW,
|
||||||
|
DYNAMIC_DRAW = GL_DYNAMIC_DRAW
|
||||||
|
};
|
||||||
|
|
||||||
|
class VertexBuffer {
|
||||||
|
public:
|
||||||
|
VertexBuffer(BufferType type = BufferType::ARRAY_BUFFER);
|
||||||
|
VertexBuffer(const VertexBuffer&) = delete;
|
||||||
|
VertexBuffer(VertexBuffer&&) noexcept;
|
||||||
|
VertexBuffer& operator=(const VertexBuffer&) = delete;
|
||||||
|
VertexBuffer& operator=(VertexBuffer&&) noexcept;
|
||||||
|
~VertexBuffer();
|
||||||
|
|
||||||
|
void bind() const;
|
||||||
|
static void unbind();
|
||||||
|
GLuint id() const;
|
||||||
|
void buffer_data(const void* data, GLsizeiptr size,
|
||||||
|
BufferUsage usage = BufferUsage::STATIC_DRAW) const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
GLuint m_vbo = 0;
|
||||||
|
BufferType m_type = BufferType::ARRAY_BUFFER;
|
||||||
|
|
||||||
|
GLenum get_buffer_target() const;
|
||||||
|
};
|
||||||
|
} // namespace Cubed
|
||||||
@@ -11,7 +11,7 @@ target_sources(${PROJECT_NAME}
|
|||||||
gameplay/tree.cpp
|
gameplay/tree.cpp
|
||||||
input.cpp
|
input.cpp
|
||||||
map_table.cpp
|
map_table.cpp
|
||||||
renderer.cpp
|
render/renderer.cpp
|
||||||
shader.cpp
|
shader.cpp
|
||||||
texture_manager.cpp
|
texture_manager.cpp
|
||||||
tools/cubed_random.cpp
|
tools/cubed_random.cpp
|
||||||
@@ -43,7 +43,7 @@ target_sources(${PROJECT_NAME}
|
|||||||
gameplay/client_player.cpp
|
gameplay/client_player.cpp
|
||||||
gameplay/session.cpp
|
gameplay/session.cpp
|
||||||
gameplay/network_client.cpp
|
gameplay/network_client.cpp
|
||||||
player_renderer.cpp
|
render/player_renderer.cpp
|
||||||
audio/audio_engine.cpp
|
audio/audio_engine.cpp
|
||||||
audio/audio_loader.cpp
|
audio/audio_loader.cpp
|
||||||
audio/audio_source.cpp
|
audio/audio_source.cpp
|
||||||
@@ -54,4 +54,6 @@ target_sources(${PROJECT_NAME}
|
|||||||
audio/audio_filter.cpp
|
audio/audio_filter.cpp
|
||||||
audio/audio_effect.cpp
|
audio/audio_effect.cpp
|
||||||
audio/audio_effect_slot.cpp
|
audio/audio_effect_slot.cpp
|
||||||
|
render/vertex_buffer.cpp
|
||||||
|
render/vertex_array.cpp
|
||||||
)
|
)
|
||||||
@@ -198,7 +198,12 @@ void ClientChunk::gen_vertex_data(
|
|||||||
m_is_on_gen_vertex_data = false;
|
m_is_on_gen_vertex_data = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
GLuint ClientChunk::get_normal_vao() const { return m_vertex_data[0].m_vao; }
|
GLuint ClientChunk::get_normal_vao() const {
|
||||||
|
if (!m_vertex_data[0].m_vao) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return m_vertex_data[0].m_vao->id();
|
||||||
|
}
|
||||||
|
|
||||||
size_t ClientChunk::get_normal_vertices_sum() const {
|
size_t ClientChunk::get_normal_vertices_sum() const {
|
||||||
if (m_vertex_data[0].m_sum == 0) {
|
if (m_vertex_data[0].m_sum == 0) {
|
||||||
@@ -207,26 +212,43 @@ size_t ClientChunk::get_normal_vertices_sum() const {
|
|||||||
return m_vertex_data[0].m_sum.load();
|
return m_vertex_data[0].m_sum.load();
|
||||||
}
|
}
|
||||||
|
|
||||||
GLuint ClientChunk::get_cross_vao() const { return m_vertex_data[1].m_vao; }
|
GLuint ClientChunk::get_cross_vao() const {
|
||||||
|
if (!m_vertex_data[1].m_vao) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return m_vertex_data[1].m_vao->id();
|
||||||
|
}
|
||||||
size_t ClientChunk::get_cross_vertices_sum() const {
|
size_t ClientChunk::get_cross_vertices_sum() const {
|
||||||
return m_vertex_data[1].m_sum.load();
|
return m_vertex_data[1].m_sum.load();
|
||||||
}
|
}
|
||||||
|
|
||||||
GLuint ClientChunk::get_normal_discard_vao() const {
|
GLuint ClientChunk::get_normal_discard_vao() const {
|
||||||
return m_vertex_data[2].m_vao;
|
if (!m_vertex_data[2].m_vao) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return m_vertex_data[2].m_vao->id();
|
||||||
}
|
}
|
||||||
size_t ClientChunk::get_normal_discard_vertices_sum() const {
|
size_t ClientChunk::get_normal_discard_vertices_sum() const {
|
||||||
|
|
||||||
return m_vertex_data[2].m_sum.load();
|
return m_vertex_data[2].m_sum.load();
|
||||||
}
|
}
|
||||||
|
|
||||||
GLuint ClientChunk::get_normal_blend_vao() const {
|
GLuint ClientChunk::get_normal_blend_vao() const {
|
||||||
return m_vertex_data[3].m_vao;
|
if (!m_vertex_data[3].m_vao) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return m_vertex_data[3].m_vao->id();
|
||||||
}
|
}
|
||||||
size_t ClientChunk::get_normal_blend_vertices_sum() const {
|
size_t ClientChunk::get_normal_blend_vertices_sum() const {
|
||||||
return m_vertex_data[3].m_sum.load();
|
return m_vertex_data[3].m_sum.load();
|
||||||
}
|
}
|
||||||
|
|
||||||
GLuint ClientChunk::get_water_vao() const { return m_vertex_data[4].m_vao; }
|
GLuint ClientChunk::get_water_vao() const {
|
||||||
|
if (!m_vertex_data[4].m_vao) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return m_vertex_data[4].m_vao->id();
|
||||||
|
}
|
||||||
size_t ClientChunk::get_water_vertices_sum() const {
|
size_t ClientChunk::get_water_vertices_sum() const {
|
||||||
return m_vertex_data[4].m_sum.load();
|
return m_vertex_data[4].m_sum.load();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,16 +32,10 @@ ClientWorld::~ClientWorld() {
|
|||||||
|
|
||||||
{
|
{
|
||||||
std::lock_guard lk(m_delete_vbo_mutex);
|
std::lock_guard lk(m_delete_vbo_mutex);
|
||||||
for (auto x : m_pending_delete_vbo) {
|
|
||||||
glDeleteBuffers(1, &x);
|
|
||||||
}
|
|
||||||
m_pending_delete_vbo.clear();
|
m_pending_delete_vbo.clear();
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
std::lock_guard lk(m_delete_vao_mutex);
|
std::lock_guard lk(m_delete_vao_mutex);
|
||||||
for (auto x : m_pending_delete_vao) {
|
|
||||||
glDeleteVertexArrays(1, &x);
|
|
||||||
}
|
|
||||||
m_pending_delete_vao.clear();
|
m_pending_delete_vao.clear();
|
||||||
}
|
}
|
||||||
m_ticktimers.clear();
|
m_ticktimers.clear();
|
||||||
@@ -267,13 +261,13 @@ void ClientWorld::set_block(const glm::ivec3& block_pos, unsigned id) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void ClientWorld::push_delete_vbo(GLuint vbo) {
|
void ClientWorld::push_delete_vbo(std::unique_ptr<VertexBuffer>& vbo) {
|
||||||
std::lock_guard lk(m_delete_vbo_mutex);
|
std::lock_guard lk(m_delete_vbo_mutex);
|
||||||
m_pending_delete_vbo.push_back(vbo);
|
m_pending_delete_vbo.push_back(std::move(vbo));
|
||||||
}
|
}
|
||||||
void ClientWorld::push_delete_vao(GLuint vao) {
|
void ClientWorld::push_delete_vao(std::unique_ptr<VertexArray>& vao) {
|
||||||
std::lock_guard lk(m_delete_vao_mutex);
|
std::lock_guard lk(m_delete_vao_mutex);
|
||||||
m_pending_delete_vao.push_back(vao);
|
m_pending_delete_vao.push_back(std::move(vao));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClientWorld::report_block_change(const glm::ivec3& pos,
|
void ClientWorld::report_block_change(const glm::ivec3& pos,
|
||||||
@@ -729,17 +723,11 @@ void ClientWorld::update(float delta_time) {
|
|||||||
m_player.update(delta_time);
|
m_player.update(delta_time);
|
||||||
{
|
{
|
||||||
std::lock_guard lk(m_delete_vbo_mutex);
|
std::lock_guard lk(m_delete_vbo_mutex);
|
||||||
for (auto x : m_pending_delete_vbo) {
|
|
||||||
glDeleteBuffers(1, &x);
|
|
||||||
}
|
|
||||||
m_pending_delete_vbo.clear();
|
m_pending_delete_vbo.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
std::lock_guard lk(m_delete_vao_mutex);
|
std::lock_guard lk(m_delete_vao_mutex);
|
||||||
for (auto x : m_pending_delete_vao) {
|
|
||||||
glDeleteVertexArrays(1, &x);
|
|
||||||
}
|
|
||||||
m_pending_delete_vao.clear();
|
m_pending_delete_vao.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,64 +5,60 @@
|
|||||||
namespace Cubed {
|
namespace Cubed {
|
||||||
VertexData::VertexData(ClientWorld& world) : m_world(world) {}
|
VertexData::VertexData(ClientWorld& world) : m_world(world) {}
|
||||||
VertexData::~VertexData() {
|
VertexData::~VertexData() {
|
||||||
if (m_vbo != 0) {
|
|
||||||
m_world.push_delete_vbo(m_vbo);
|
m_world.push_delete_vbo(m_vbo);
|
||||||
}
|
|
||||||
if (m_vao != 0) {
|
m_world.push_delete_vao(m_vao);
|
||||||
m_world.push_delete_vao(m_vao);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
VertexData::VertexData(VertexData&& o) noexcept
|
VertexData::VertexData(VertexData&& o) noexcept
|
||||||
: m_vertices(std::move(o.m_vertices)), m_vbo(o.m_vbo), m_vao(o.m_vao),
|
: m_vertices(std::move(o.m_vertices)), m_vbo(std::move(o.m_vbo)),
|
||||||
m_sum(o.m_sum.load()), m_world(o.m_world) {
|
m_vao(std::move(o.m_vao)), m_sum(o.m_sum.exchange(0)),
|
||||||
o.m_vbo = 0;
|
m_world(o.m_world) {}
|
||||||
o.m_sum = 0;
|
|
||||||
o.m_vao = 0;
|
|
||||||
}
|
|
||||||
VertexData& VertexData::operator=(VertexData&& o) noexcept {
|
VertexData& VertexData::operator=(VertexData&& o) noexcept {
|
||||||
m_vbo = o.m_vbo;
|
if (this == &o) {
|
||||||
o.m_vbo = 0;
|
return *this;
|
||||||
m_sum = o.m_sum.load();
|
}
|
||||||
o.m_sum = 0;
|
|
||||||
|
m_world.push_delete_vao(m_vao);
|
||||||
|
m_world.push_delete_vbo(m_vbo);
|
||||||
|
|
||||||
|
m_vbo = std::move(o.m_vbo);
|
||||||
|
m_vao = std::move(o.m_vao);
|
||||||
|
|
||||||
|
m_sum = o.m_sum.exchange(0);
|
||||||
|
|
||||||
m_vertices = std::move(o.m_vertices);
|
m_vertices = std::move(o.m_vertices);
|
||||||
m_vao = o.m_vao;
|
|
||||||
o.m_vao = 0;
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
void VertexData::upload() {
|
void VertexData::upload() {
|
||||||
if (m_vertices.size() == 0) {
|
if (m_vertices.size() == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (m_vao == 0) {
|
if (!m_vao) {
|
||||||
glGenVertexArrays(1, &m_vao);
|
m_vao = std::make_unique<VertexArray>();
|
||||||
}
|
}
|
||||||
if (m_vbo == 0) {
|
if (!m_vbo) {
|
||||||
glGenBuffers(1, &m_vbo);
|
m_vbo = std::make_unique<VertexBuffer>();
|
||||||
}
|
}
|
||||||
glBindVertexArray(m_vao);
|
m_vao->bind();
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, m_vbo);
|
m_vbo->buffer_data(m_vertices.data(), m_vertices.size() * sizeof(Vertex3D),
|
||||||
glBufferData(GL_ARRAY_BUFFER, m_vertices.size() * sizeof(Vertex3D),
|
BufferUsage::DYNAMIC_DRAW);
|
||||||
m_vertices.data(), GL_DYNAMIC_DRAW);
|
|
||||||
|
|
||||||
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex3D), (void*)0);
|
m_vao->attribute(0, 3, GL_FLOAT, sizeof(Vertex3D), (void*)0);
|
||||||
glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, sizeof(Vertex3D),
|
m_vao->attribute(1, 2, GL_FLOAT, sizeof(Vertex3D),
|
||||||
(void*)offsetof(Vertex3D, s));
|
(void*)offsetof(Vertex3D, s));
|
||||||
glVertexAttribPointer(2, 1, GL_FLOAT, GL_FALSE, sizeof(Vertex3D),
|
m_vao->attribute(2, 1, GL_FLOAT, sizeof(Vertex3D),
|
||||||
(void*)offsetof(Vertex3D, layer));
|
(void*)offsetof(Vertex3D, layer));
|
||||||
glVertexAttribPointer(3, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex3D),
|
m_vao->attribute(3, 3, GL_FLOAT, sizeof(Vertex3D),
|
||||||
(void*)offsetof(Vertex3D, nx));
|
(void*)offsetof(Vertex3D, nx));
|
||||||
glVertexAttribPointer(4, 1, GL_FLOAT, GL_FALSE, sizeof(Vertex3D),
|
m_vao->attribute(4, 1, GL_FLOAT, sizeof(Vertex3D),
|
||||||
(void*)offsetof(Vertex3D, roughness));
|
(void*)offsetof(Vertex3D, roughness));
|
||||||
glVertexAttribPointer(5, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex3D),
|
m_vao->attribute(5, 3, GL_FLOAT, sizeof(Vertex3D),
|
||||||
(void*)offsetof(Vertex3D, tx));
|
(void*)offsetof(Vertex3D, tx));
|
||||||
glEnableVertexAttribArray(0);
|
|
||||||
glEnableVertexAttribArray(1);
|
VertexArray::unbind();
|
||||||
glEnableVertexAttribArray(2);
|
VertexBuffer::unbind();
|
||||||
glEnableVertexAttribArray(3);
|
|
||||||
glEnableVertexAttribArray(4);
|
|
||||||
glEnableVertexAttribArray(5);
|
|
||||||
glBindVertexArray(0);
|
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
|
||||||
|
|
||||||
// Release memory
|
// Release memory
|
||||||
m_vertices.clear();
|
m_vertices.clear();
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
#include "Cubed/player_renderer.hpp"
|
#include "Cubed/render/player_renderer.hpp"
|
||||||
|
|
||||||
#include "Cubed/camera.hpp"
|
#include "Cubed/camera.hpp"
|
||||||
#include "Cubed/gameplay/client_world.hpp"
|
#include "Cubed/gameplay/client_world.hpp"
|
||||||
#include "Cubed/primitive_data.hpp"
|
#include "Cubed/primitive_data.hpp"
|
||||||
#include "Cubed/renderer.hpp"
|
#include "Cubed/render/renderer.hpp"
|
||||||
#include "Cubed/texture_manager.hpp"
|
#include "Cubed/texture_manager.hpp"
|
||||||
|
|
||||||
#include <glm/glm.hpp>
|
#include <glm/glm.hpp>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "Cubed/renderer.hpp"
|
#include "Cubed/render/renderer.hpp"
|
||||||
|
|
||||||
#include "Cubed/camera.hpp"
|
#include "Cubed/camera.hpp"
|
||||||
#include "Cubed/config.hpp"
|
#include "Cubed/config.hpp"
|
||||||
@@ -30,14 +30,14 @@ Renderer::Renderer(const Camera& camera, ClientWorld& world,
|
|||||||
Renderer::~Renderer() {
|
Renderer::~Renderer() {
|
||||||
if (m_init) {
|
if (m_init) {
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||||
glDeleteBuffers(1, &m_outline_vbo);
|
m_outline_vbo.reset();
|
||||||
glDeleteBuffers(1, &m_outline_indices_vbo);
|
m_outline_indices_vbo.reset();
|
||||||
glDeleteBuffers(1, &m_sky_vbo);
|
m_sky_vbo.reset();
|
||||||
glDeleteBuffers(1, &m_ui_vbo);
|
m_ui_vbo.reset();
|
||||||
glDeleteBuffers(1, &m_text_vbo);
|
m_text_vbo.reset();
|
||||||
glDeleteBuffers(1, &m_player_vbo);
|
m_player_vbo.reset();
|
||||||
glBindVertexArray(0);
|
glBindVertexArray(0);
|
||||||
glDeleteVertexArrays(NUM_VAO, m_vao.data());
|
m_vao.clear();
|
||||||
glDeleteFramebuffers(1, &m_fbo);
|
glDeleteFramebuffers(1, &m_fbo);
|
||||||
glDeleteTextures(1, &m_screen_texture);
|
glDeleteTextures(1, &m_screen_texture);
|
||||||
glDeleteTextures(1, &m_screen_depth_texture);
|
glDeleteTextures(1, &m_screen_depth_texture);
|
||||||
@@ -133,52 +133,43 @@ void Renderer::init(bool debug_on) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
m_vao.resize(NUM_VAO);
|
m_vao.resize(NUM_VAO);
|
||||||
glGenVertexArrays(NUM_VAO, m_vao.data());
|
VertexArray::unbind();
|
||||||
glBindVertexArray(0);
|
|
||||||
|
|
||||||
glBindVertexArray(m_vao[2]);
|
m_outline_vbo = std::make_unique<VertexBuffer>();
|
||||||
glGenBuffers(1, &m_outline_vbo);
|
m_outline_indices_vbo =
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, m_outline_vbo);
|
std::make_unique<VertexBuffer>(BufferType::ELEMENT_ARRAY_BUFFER);
|
||||||
glBufferData(GL_ARRAY_BUFFER, sizeof(CUBE_VER), CUBE_VER, GL_STATIC_DRAW);
|
m_player_vbo = std::make_unique<VertexBuffer>();
|
||||||
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, 0);
|
m_quad_vbo = std::make_unique<VertexBuffer>();
|
||||||
glEnableVertexAttribArray(0);
|
m_sky_vbo = std::make_unique<VertexBuffer>();
|
||||||
glGenBuffers(1, &m_outline_indices_vbo);
|
m_text_vbo = std::make_unique<VertexBuffer>();
|
||||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_outline_indices_vbo);
|
m_ui_vbo = std::make_unique<VertexBuffer>();
|
||||||
glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(OUTLINE_CUBE_INDICES),
|
|
||||||
OUTLINE_CUBE_INDICES, GL_STATIC_DRAW);
|
|
||||||
|
|
||||||
glBindVertexArray(m_vao[1]);
|
m_vao[2].bind();
|
||||||
glGenBuffers(1, &m_sky_vbo);
|
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, m_sky_vbo);
|
|
||||||
glBufferData(GL_ARRAY_BUFFER, sizeof(VERTICES_POS), VERTICES_POS,
|
|
||||||
GL_STATIC_DRAW);
|
|
||||||
|
|
||||||
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, 0);
|
m_outline_vbo->buffer_data(CUBE_VER, sizeof(CUBE_VER));
|
||||||
glEnableVertexAttribArray(0);
|
m_vao[2].attribute(0, 3, GL_FLOAT, 0, 0);
|
||||||
|
m_outline_indices_vbo->buffer_data(OUTLINE_CUBE_INDICES,
|
||||||
|
sizeof(OUTLINE_CUBE_INDICES));
|
||||||
|
|
||||||
glBindVertexArray(m_vao[3]);
|
m_vao[1].bind();
|
||||||
glGenBuffers(1, &m_ui_vbo);
|
m_sky_vbo->buffer_data(VERTICES_POS, sizeof(VERTICES_POS));
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, m_ui_vbo);
|
|
||||||
|
m_vao[1].attribute(0, 3, GL_FLOAT, 0, 0);
|
||||||
|
|
||||||
|
m_vao[3].bind();
|
||||||
|
|
||||||
for (int i = 0; i < 6; i++) {
|
for (int i = 0; i < 6; i++) {
|
||||||
Vertex2D vex{SQUARE_VERTICES[i][0], SQUARE_VERTICES[i][1],
|
Vertex2D vex{SQUARE_VERTICES[i][0], SQUARE_VERTICES[i][1],
|
||||||
SQUARE_TEXTURE_POS[i][0], SQUARE_TEXTURE_POS[i][1], 0};
|
SQUARE_TEXTURE_POS[i][0], SQUARE_TEXTURE_POS[i][1], 0};
|
||||||
m_ui.emplace_back(vex);
|
m_ui.emplace_back(vex);
|
||||||
}
|
}
|
||||||
|
m_ui_vbo->buffer_data(m_ui.data(), m_ui.size() * sizeof(Vertex2D));
|
||||||
|
|
||||||
glBufferData(GL_ARRAY_BUFFER, m_ui.size() * sizeof(Vertex2D), m_ui.data(),
|
m_vao[3].attribute(0, 3, GL_FLOAT, sizeof(Vertex2D), (void*)0);
|
||||||
GL_STATIC_DRAW);
|
m_vao[3].attribute(1, 2, GL_FLOAT, sizeof(Vertex2D),
|
||||||
|
(void*)offsetof(Vertex2D, s));
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, m_ui_vbo);
|
m_vao[3].attribute(2, 1, GL_FLOAT, sizeof(Vertex2D),
|
||||||
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex2D), (void*)0);
|
(void*)offsetof(Vertex2D, layer));
|
||||||
glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, sizeof(Vertex2D),
|
|
||||||
(void*)offsetof(Vertex2D, s));
|
|
||||||
glVertexAttribPointer(2, 1, GL_FLOAT, GL_FALSE, sizeof(Vertex2D),
|
|
||||||
(void*)offsetof(Vertex2D, layer));
|
|
||||||
|
|
||||||
glEnableVertexAttribArray(0);
|
|
||||||
glEnableVertexAttribArray(1);
|
|
||||||
glEnableVertexAttribArray(2);
|
|
||||||
|
|
||||||
init_quad();
|
init_quad();
|
||||||
init_text();
|
init_text();
|
||||||
@@ -186,8 +177,8 @@ void Renderer::init(bool debug_on) {
|
|||||||
|
|
||||||
m_player_renderer.init();
|
m_player_renderer.init();
|
||||||
|
|
||||||
glBindVertexArray(0);
|
VertexArray::unbind();
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
VertexBuffer::unbind();
|
||||||
m_init = true;
|
m_init = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -198,28 +189,24 @@ const Shader& Renderer::get_shader(const std::string& name) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Renderer::init_quad() {
|
void Renderer::init_quad() {
|
||||||
glBindVertexArray(m_vao[0]);
|
m_vao[0].bind();
|
||||||
glGenBuffers(1, &m_quad_vbo);
|
m_quad_vbo->buffer_data(QUAD_VERTICES, sizeof(QUAD_VERTICES));
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, m_quad_vbo);
|
|
||||||
glBufferData(GL_ARRAY_BUFFER, sizeof(QUAD_VERTICES), QUAD_VERTICES,
|
|
||||||
GL_STATIC_DRAW);
|
|
||||||
|
|
||||||
glEnableVertexAttribArray(0);
|
m_vao[0].attribute(0, 2, GL_FLOAT, 4 * sizeof(float), (void*)0);
|
||||||
glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 4 * sizeof(float),
|
|
||||||
(void*)0);
|
m_vao[0].attribute(1, 2, GL_FLOAT, 4 * sizeof(float),
|
||||||
glEnableVertexAttribArray(1);
|
(void*)(2 * sizeof(float)));
|
||||||
glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 4 * sizeof(float),
|
|
||||||
(void*)(2 * sizeof(float)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Renderer::init_text() {
|
void Renderer::init_text() {
|
||||||
glBindVertexArray(m_vao[4]);
|
m_vao[4].bind();
|
||||||
glGenBuffers(1, &m_text_vbo);
|
m_text_vbo->buffer_data(NULL, sizeof(float) * 6 * 4,
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, m_text_vbo);
|
BufferUsage::DYNAMIC_DRAW);
|
||||||
glBufferData(GL_ARRAY_BUFFER, sizeof(float) * 6 * 4, NULL, GL_DYNAMIC_DRAW);
|
|
||||||
|
|
||||||
const auto& shader = get_shader("text");
|
const auto& shader = get_shader("text");
|
||||||
|
|
||||||
Text::set_loc(shader);
|
Text::set_loc(shader);
|
||||||
|
|
||||||
DebugCollector::get().init_text();
|
DebugCollector::get().init_text();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -291,7 +278,7 @@ void Renderer::render_outline() {
|
|||||||
shader.set_loc("mv_matrix", m_mv_mat);
|
shader.set_loc("mv_matrix", m_mv_mat);
|
||||||
shader.set_loc("proj_matrix", m_p_mat);
|
shader.set_loc("proj_matrix", m_p_mat);
|
||||||
|
|
||||||
glBindVertexArray(m_vao[2]);
|
m_vao[2].bind();
|
||||||
|
|
||||||
glEnable(GL_DEPTH_TEST);
|
glEnable(GL_DEPTH_TEST);
|
||||||
glDepthFunc(GL_LEQUAL);
|
glDepthFunc(GL_LEQUAL);
|
||||||
@@ -364,7 +351,7 @@ void Renderer::render_sky() {
|
|||||||
sky_shader.set_loc("cloudWhiteMix", m_sky_uniform.cloud_white_mix);
|
sky_shader.set_loc("cloudWhiteMix", m_sky_uniform.cloud_white_mix);
|
||||||
sky_shader.set_loc("cloudThresholdLow", m_cloud_threshold_low);
|
sky_shader.set_loc("cloudThresholdLow", m_cloud_threshold_low);
|
||||||
sky_shader.set_loc("cloudThresholdHigh", m_cloud_threshold_high);
|
sky_shader.set_loc("cloudThresholdHigh", m_cloud_threshold_high);
|
||||||
glBindVertexArray(m_vao[1]);
|
m_vao[1].bind();
|
||||||
|
|
||||||
glDisable(GL_DEPTH_TEST);
|
glDisable(GL_DEPTH_TEST);
|
||||||
|
|
||||||
@@ -376,7 +363,7 @@ void Renderer::render_sky() {
|
|||||||
billboard.use();
|
billboard.use();
|
||||||
glDepthMask(GL_FALSE);
|
glDepthMask(GL_FALSE);
|
||||||
|
|
||||||
glBindVertexArray(m_vao[0]);
|
m_vao[0].bind();
|
||||||
// draw sun
|
// draw sun
|
||||||
glm::vec3 sun_pos = m_camera.get_camera_pos() +
|
glm::vec3 sun_pos = m_camera.get_camera_pos() +
|
||||||
normalize(-m_world.sunlight_dir()) * (FAR_PLANE * 0.9f);
|
normalize(-m_world.sunlight_dir()) * (FAR_PLANE * 0.9f);
|
||||||
@@ -408,7 +395,7 @@ void Renderer::render_sky() {
|
|||||||
|
|
||||||
void Renderer::render_text() {
|
void Renderer::render_text() {
|
||||||
|
|
||||||
glBindVertexArray(m_vao[4]);
|
m_vao[4].bind();
|
||||||
|
|
||||||
const auto& shader = get_shader("text");
|
const auto& shader = get_shader("text");
|
||||||
|
|
||||||
@@ -440,7 +427,7 @@ void Renderer::render_ui() {
|
|||||||
shader.set_loc("m_matrix", m_ui_m_matrix);
|
shader.set_loc("m_matrix", m_ui_m_matrix);
|
||||||
shader.set_loc("proj_matrix", m_ui_proj);
|
shader.set_loc("proj_matrix", m_ui_proj);
|
||||||
|
|
||||||
glBindVertexArray(m_vao[3]);
|
m_vao[3].bind();
|
||||||
|
|
||||||
glActiveTexture(GL_TEXTURE0);
|
glActiveTexture(GL_TEXTURE0);
|
||||||
glBindTexture(GL_TEXTURE_2D_ARRAY, m_texture_manager.get_ui_array());
|
glBindTexture(GL_TEXTURE_2D_ARRAY, m_texture_manager.get_ui_array());
|
||||||
@@ -455,7 +442,7 @@ void Renderer::render_underwater() {
|
|||||||
const auto& shader = get_shader("under_water");
|
const auto& shader = get_shader("under_water");
|
||||||
shader.use();
|
shader.use();
|
||||||
|
|
||||||
glBindVertexArray(m_vao[0]);
|
m_vao[0].bind();
|
||||||
|
|
||||||
shader.set_loc("u_sceneTexture", 0);
|
shader.set_loc("u_sceneTexture", 0);
|
||||||
shader.set_loc("u_time", static_cast<float>(glfwGetTime()));
|
shader.set_loc("u_time", static_cast<float>(glfwGetTime()));
|
||||||
@@ -951,7 +938,7 @@ void Renderer::render_world() {
|
|||||||
glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
|
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
|
|
||||||
glBindVertexArray(m_vao[0]);
|
m_vao[0].bind();
|
||||||
|
|
||||||
glActiveTexture(GL_TEXTURE0);
|
glActiveTexture(GL_TEXTURE0);
|
||||||
glBindTexture(GL_TEXTURE_2D, m_accum_texture);
|
glBindTexture(GL_TEXTURE_2D, m_accum_texture);
|
||||||
@@ -984,8 +971,8 @@ void Renderer::render_player() {
|
|||||||
shader.set_loc("minRadius", m_min_radius);
|
shader.set_loc("minRadius", m_min_radius);
|
||||||
shader.set_loc("maxRadius", m_max_radius);
|
shader.set_loc("maxRadius", m_max_radius);
|
||||||
shader.set_loc("samples", m_samples);
|
shader.set_loc("samples", m_samples);
|
||||||
shader.set_loc("renderDistance", m_world.rendering_distance());
|
// shader.set_loc("renderDistance", m_world.rendering_distance());
|
||||||
shader.set_loc("skyColor", m_sky_uniform.sky_top);
|
// shader.set_loc("skyColor", m_sky_uniform.sky_top);
|
||||||
|
|
||||||
glActiveTexture(GL_TEXTURE0);
|
glActiveTexture(GL_TEXTURE0);
|
||||||
glBindTexture(GL_TEXTURE_2D, m_depth_map_texture);
|
glBindTexture(GL_TEXTURE_2D, m_depth_map_texture);
|
||||||
39
src/render/vertex_array.cpp
Normal file
39
src/render/vertex_array.cpp
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
#include "Cubed/render/vertex_array.hpp"
|
||||||
|
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
|
namespace Cubed {
|
||||||
|
VertexArray::VertexArray() { glGenVertexArrays(1, &m_vao); }
|
||||||
|
VertexArray::~VertexArray() {
|
||||||
|
if (m_vao) {
|
||||||
|
glDeleteVertexArrays(1, &m_vao);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
VertexArray::VertexArray(VertexArray&& o) noexcept
|
||||||
|
: m_vao(std::exchange(o.m_vao, 0)) {}
|
||||||
|
|
||||||
|
VertexArray& VertexArray::operator=(VertexArray&& o) noexcept {
|
||||||
|
if (this != &o) {
|
||||||
|
if (m_vao) {
|
||||||
|
glDeleteVertexArrays(1, &m_vao);
|
||||||
|
}
|
||||||
|
m_vao = std::exchange(o.m_vao, 0);
|
||||||
|
}
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
void VertexArray::bind() const { glBindVertexArray(m_vao); }
|
||||||
|
void VertexArray::unbind() { glBindVertexArray(0); }
|
||||||
|
|
||||||
|
GLuint VertexArray::id() const { return m_vao; }
|
||||||
|
|
||||||
|
void VertexArray::attribute(GLuint index, GLint size, GLenum type,
|
||||||
|
GLsizei stride, const void* ptr,
|
||||||
|
bool normalized) const {
|
||||||
|
bind();
|
||||||
|
glVertexAttribPointer(index, size, type, normalized ? GL_TRUE : GL_FALSE,
|
||||||
|
stride, ptr);
|
||||||
|
glEnableVertexAttribArray(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace Cubed
|
||||||
52
src/render/vertex_buffer.cpp
Normal file
52
src/render/vertex_buffer.cpp
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
#include "Cubed/render/vertex_buffer.hpp"
|
||||||
|
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
|
namespace Cubed {
|
||||||
|
VertexBuffer::VertexBuffer(BufferType type) : m_type(type) {
|
||||||
|
glGenBuffers(1, &m_vbo);
|
||||||
|
}
|
||||||
|
VertexBuffer::~VertexBuffer() {
|
||||||
|
if (m_vbo) {
|
||||||
|
glDeleteBuffers(1, &m_vbo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
VertexBuffer::VertexBuffer(VertexBuffer&& o) noexcept
|
||||||
|
: m_vbo(std::exchange(o.m_vbo, 0)), m_type(o.m_type) {}
|
||||||
|
|
||||||
|
VertexBuffer& VertexBuffer::operator=(VertexBuffer&& o) noexcept {
|
||||||
|
if (this != &o) {
|
||||||
|
if (m_vbo) {
|
||||||
|
glDeleteBuffers(1, &m_vbo);
|
||||||
|
}
|
||||||
|
m_vbo = std::exchange(o.m_vbo, 0);
|
||||||
|
m_type = o.m_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
void VertexBuffer::bind() const { glBindBuffer(get_buffer_target(), m_vbo); }
|
||||||
|
|
||||||
|
void VertexBuffer::unbind() {
|
||||||
|
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||||
|
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
GLuint VertexBuffer::id() const { return m_vbo; }
|
||||||
|
|
||||||
|
GLenum VertexBuffer::get_buffer_target() const {
|
||||||
|
return std::to_underlying(m_type);
|
||||||
|
}
|
||||||
|
|
||||||
|
void VertexBuffer::buffer_data(const void* data, GLsizeiptr size,
|
||||||
|
BufferUsage usage) const {
|
||||||
|
bind();
|
||||||
|
|
||||||
|
GLenum target = get_buffer_target();
|
||||||
|
|
||||||
|
glBufferData(target, size, data, std::to_underlying(usage));
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace Cubed
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
#include "Cubed/window.hpp"
|
#include "Cubed/window.hpp"
|
||||||
|
|
||||||
#include "Cubed/config.hpp"
|
#include "Cubed/config.hpp"
|
||||||
#include "Cubed/renderer.hpp"
|
#include "Cubed/render/renderer.hpp"
|
||||||
#include "Cubed/tools/cubed_assert.hpp"
|
#include "Cubed/tools/cubed_assert.hpp"
|
||||||
#include "Cubed/tools/font.hpp"
|
#include "Cubed/tools/font.hpp"
|
||||||
#include "Cubed/tools/log.hpp"
|
#include "Cubed/tools/log.hpp"
|
||||||
|
|||||||
Reference in New Issue
Block a user