51 lines
1.2 KiB
C++
Executable File
51 lines
1.2 KiB
C++
Executable File
#pragma once
|
|
|
|
#include "try_engine/utils/utils.hpp"
|
|
#include "graphic_context/graphic_context.hpp"
|
|
#include "try_engine/event/system_event/event.hpp"
|
|
|
|
namespace try_engine
|
|
{
|
|
class window
|
|
{
|
|
public:
|
|
window(std::string);
|
|
~window();
|
|
|
|
// HERE
|
|
// реализовать остальные конструкторы
|
|
|
|
private:
|
|
// ни каких unique_ptr тут неполучится
|
|
// т.к. glfwCreateWindow maloc-ом выделяет память
|
|
// что не есть хорошо для умных указателей
|
|
GLFWwindow* m_win;
|
|
std::unique_ptr<graphic_context> m_graphic_context;
|
|
|
|
struct window_data
|
|
{
|
|
std::string m_name;
|
|
int m_width, m_height;
|
|
event_callback<system_event::event> on_callback;
|
|
} m_window_data;
|
|
|
|
|
|
public:
|
|
void update();
|
|
GLFWwindow* glfw_window() const;
|
|
void clear() const ;
|
|
int width() const;
|
|
int height() const;
|
|
void set_event_callback(const event_callback<system_event::event>&);
|
|
void set_window_callback();
|
|
|
|
private:
|
|
void set_hint();
|
|
void set_window();
|
|
void set_context();
|
|
void set_pointer();
|
|
void set_key_callback();
|
|
};
|
|
}
|
|
|