KoiKoi/src/Window.hpp

38 lines
653 B
C++
Raw Normal View History

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>
class Application;
2022-01-13 22:24:39 +00:00
struct UserData
{
lol::OrthogonalCamera* camera;
Application* app;
2022-01-13 22:24:39 +00:00
};
2022-01-08 15:54:36 +00:00
class Window
{
public:
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); }
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;
Application* app;
2022-01-13 22:24:39 +00:00
UserData data;
lol::OrthogonalCamera camera;
2022-01-08 15:54:36 +00:00
};