42 lines
860 B
C++
Executable File
42 lines
860 B
C++
Executable File
#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;
|
|
inline static std::unique_ptr<application> m_instance;
|
|
|
|
public:
|
|
void run();
|
|
static std::unique_ptr<application>& get();
|
|
std::unique_ptr<glfw>& get_glfw();
|
|
|
|
public:
|
|
template<typename... Args>
|
|
void push_layer(Args*... args)
|
|
{
|
|
(m_layers_stack.push_back(args), ...);
|
|
(args->on_attach(), ...);
|
|
}
|
|
|
|
private:
|
|
void clear();
|
|
void attach_layers();
|
|
};
|
|
|
|
// реализация см. в проекте
|
|
application& create();
|
|
}
|