initial commit
This commit is contained in:
42
src/application/application.hpp
Executable file
42
src/application/application.hpp
Executable file
@@ -0,0 +1,42 @@
|
||||
#pragma once
|
||||
|
||||
#include "glfw/glfw.hpp"
|
||||
#include "gui/gui.hpp"
|
||||
#include "layer/layer.hpp"
|
||||
|
||||
namespace VE
|
||||
{
|
||||
class application
|
||||
{
|
||||
public:
|
||||
application(std::string app_name);
|
||||
virtual ~application() = default;
|
||||
|
||||
private:
|
||||
std::unique_ptr<glfw> m_glfw;
|
||||
std::unique_ptr<gui> m_gui;
|
||||
layers_stack<layer> m_layers_stack;
|
||||
|
||||
public:
|
||||
void run();
|
||||
std::unique_ptr<glfw>& get_glfw();
|
||||
|
||||
public:
|
||||
template<typename... Args>
|
||||
void push_layer(Args*... args)
|
||||
{
|
||||
(m_layers_stack.push_back(args), ...);
|
||||
attach_layers();
|
||||
set_event_fn();
|
||||
}
|
||||
|
||||
private:
|
||||
void clear();
|
||||
void attach_layers();
|
||||
void set_event_fn();
|
||||
void on_event(event& e);
|
||||
};
|
||||
|
||||
// реализация см. в проекте
|
||||
application& create();
|
||||
}
|
||||
Reference in New Issue
Block a user