2022-01-08 15:54:36 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
2022-01-13 22:24:39 +00:00
|
|
|
#include <glad/glad.h>
|
2022-01-08 15:54:36 +00:00
|
|
|
#include <GLFW/glfw3.h>
|
2022-01-13 22:24:39 +00:00
|
|
|
#include <lol/lol.hpp>
|
|
|
|
|
2022-01-15 15:45:52 +00:00
|
|
|
class Application;
|
|
|
|
|
2022-01-13 22:24:39 +00:00
|
|
|
struct UserData
|
|
|
|
{
|
|
|
|
lol::OrthogonalCamera* camera;
|
2022-01-15 15:45:52 +00:00
|
|
|
Application* app;
|
2022-01-13 22:24:39 +00:00
|
|
|
};
|
2022-01-08 15:54:36 +00:00
|
|
|
|
|
|
|
class Window
|
|
|
|
{
|
|
|
|
public:
|
2022-01-15 15:45:52 +00:00
|
|
|
Window(Application* app, int width, int height, const std::string& title);
|
2022-01-08 15:54:36 +00:00
|
|
|
~Window();
|
|
|
|
|
|
|
|
inline bool IsValid() { return valid; }
|
|
|
|
inline bool ShouldClose() { return glfwWindowShouldClose(window); }
|
2022-01-15 15:45:52 +00:00
|
|
|
inline GLFWwindow* GetNativeWindow() { return window; }
|
2022-01-08 15:54:36 +00:00
|
|
|
|
2022-01-13 22:24:39 +00:00
|
|
|
void Clear();
|
2022-01-14 21:11:42 +00:00
|
|
|
void Draw(lol::Layer& layer);
|
2022-01-08 15:54:36 +00:00
|
|
|
void Display();
|
|
|
|
|
|
|
|
private:
|
|
|
|
bool valid;
|
|
|
|
GLFWwindow* window;
|
2022-01-15 15:45:52 +00:00
|
|
|
Application* app;
|
2022-01-13 22:24:39 +00:00
|
|
|
UserData data;
|
|
|
|
|
|
|
|
lol::OrthogonalCamera camera;
|
2022-01-08 15:54:36 +00:00
|
|
|
};
|