Onyx-Engine/src/core/systems/WindowManager.h

37 lines
928 B
C
Raw Normal View History

2025-05-18 17:42:48 +00:00
#ifndef WINDOWMANAGER_H
#define WINDOWMANAGER_H
#include <string>
#include <GLFW/glfw3.h>
namespace OX
{
class WindowManager {
public:
WindowManager() = default;
~WindowManager();
bool Init(const std::string& title, int width, int height);
void Shutdown();
void PollEvents() const;
[[nodiscard]] bool ShouldClose() const;
void BeginFrame() const;
void EndFrame() const;
[[nodiscard]] GLFWwindow* GetHandle() const { return m_window; }
[[nodiscard]] int GetWidth() const { return m_width; }
[[nodiscard]] int GetHeight() const { return m_height; }
static void FramebufferSizeCallback(GLFWwindow* window, int width, int height);
private:
void SetSize(int width, int height);
GLFWwindow* m_window = nullptr;
int m_width = 1280;
int m_height = 720;
};
}
#endif // WINDOWMANAGER_H