refactor: split into static libraries and restructure scenes
- Create cbt_opengl static library for OpenGL abstraction - Create cbt_scene static library for base scene class - Create scenes_cube static library for cube scene - Move scene base to cbt/ (utility), scenes to root scenes/ - Link libraries in dependency chain: cuber -> scenes -> cbt_scene -> cbt_opengl
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
#pragma once
|
||||
|
||||
#include "cbt/scene.hpp"
|
||||
|
||||
#include "cbt/opengl/shader.hpp"
|
||||
#include "cbt/opengl/buffer.hpp"
|
||||
#include "cbt/opengl/vao.hpp"
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
namespace cbt::scenes {
|
||||
|
||||
class cube final : public scene {
|
||||
opengl::shader m_prog;
|
||||
opengl::buffer m_vbo;
|
||||
opengl::vao m_vao;
|
||||
|
||||
GLint m_loc_proj = -1;
|
||||
GLint m_loc_view = -1;
|
||||
GLint m_loc_model = -1;
|
||||
|
||||
std::chrono::steady_clock::time_point m_start;
|
||||
|
||||
auto build_mesh() -> void;
|
||||
auto build_shader() -> bool;
|
||||
|
||||
public:
|
||||
cube();
|
||||
auto init() -> bool override;
|
||||
auto update(float delta_time) -> void override;
|
||||
auto render() -> void override;
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user