53 lines
1.2 KiB
C++
Executable File
53 lines
1.2 KiB
C++
Executable File
#pragma once
|
|
|
|
#include "utils/utils.hpp" // IWYU pragma: keep
|
|
#include "context/context.hpp"
|
|
|
|
namespace VE
|
|
{
|
|
class glfw
|
|
{
|
|
public:
|
|
// HERE
|
|
// реализовать остальные конструкторы
|
|
glfw();
|
|
~glfw();
|
|
|
|
|
|
private:
|
|
// ни каких unique_ptr тут не получится
|
|
// т.к. glfwCreateWindow maloc-ом выделяет память
|
|
// что не есть хорошо для умных указателей
|
|
GLFWwindow* m_win;
|
|
std::unique_ptr<context> m_context;
|
|
glm::vec4 m_bgcolor = { 0.1f, 0.1f, 0.1f, 1.f };
|
|
|
|
struct win_data
|
|
{
|
|
std::string m_name;
|
|
int m_width, m_height;
|
|
} m_win_data;
|
|
|
|
public:
|
|
void init(std::string win_name);
|
|
|
|
GLFWwindow* get_win() const;
|
|
int width() const;
|
|
int height() const;
|
|
|
|
void update();
|
|
void clear() const;
|
|
|
|
private:
|
|
void set_hint();
|
|
void set_window();
|
|
void set_graphic_context();
|
|
void set_pointer();
|
|
void set_key_callback();
|
|
void set_mouse_callback();
|
|
void set_window_callback();
|
|
void set_opengl();
|
|
};
|
|
}
|
|
|