2024-08-01 23:32:51 +00:00
|
|
|
#ifndef WINDOW_H
|
|
|
|
#define WINDOW_H
|
|
|
|
|
|
|
|
#include <glad/glad.h>
|
|
|
|
#include <GLFW/glfw3.h>
|
|
|
|
#include <string>
|
|
|
|
#include <iostream>
|
2024-08-22 15:55:30 +00:00
|
|
|
#include <Renderer.h>
|
2024-08-01 23:32:51 +00:00
|
|
|
|
|
|
|
struct WindowData
|
|
|
|
{
|
|
|
|
std::string Title;
|
|
|
|
int Width, Height;
|
|
|
|
|
|
|
|
WindowData(): Title("Ferx Engine"), Width(900), Height(600){}
|
|
|
|
WindowData(const std::string& title, int width, int height): Title(title), Width(width), Height(height){};
|
|
|
|
};
|
|
|
|
|
|
|
|
class Window
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Window();
|
|
|
|
Window(const std::string& title, int width, int height);
|
|
|
|
~Window();
|
|
|
|
|
|
|
|
static Window Create();
|
|
|
|
static Window Create(const std::string& title, int width, int height);
|
|
|
|
static void FramebufferSizeCallback(GLFWwindow* window, int width, int height);
|
|
|
|
|
|
|
|
void Init();
|
|
|
|
|
|
|
|
GLFWwindow* GetWindow() const;
|
|
|
|
const std::string& GetTitle() const;
|
|
|
|
int GetWidth() const;
|
|
|
|
int GetHeight() const;
|
|
|
|
|
|
|
|
void Shutdown();
|
|
|
|
|
|
|
|
private:
|
|
|
|
GLFWwindow* m_Window{};
|
|
|
|
WindowData m_Data;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|