You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lunarium_OLD/src/platform/window.h

63 lines
1.7 KiB
C++

/******************************************************************************
* File - window.h
* Author - Joey Pollack
* Date - 2021/09/01 (y/m/d)
* Mod Date - 2021/09/01 (y/m/d)
* Description - Manages the window system using GLFW. This is where GLFW
* is initialized. I think this file can completely hide GLFW
* but I'm not yet sure...
******************************************************************************/
#ifndef WINDOW_H_
#define WINDOW_H_
#include <glad/gl.h>
#include <GLFW/glfw3.h>
#include <glm/glm.hpp>
#include <core/state.h>
#include <utils/op_res.h>
namespace lunarium
{
class Window
{
public:
Window();
OpRes Initialize(const State& state);
bool IsInit() const;
GLFWwindow* GetWindow();
bool IsKeyDown(int key, bool mouse_button = false) const;
glm::vec2 GetCursorPos() const;
void SetCursorPos(glm::vec2 pos);
void Resize(int width, int height);
// TODO: See https://www.glfw.org/docs/latest/window_guide.html#window_full_screen
void ChangeDisplayMode(bool fullscreen, int xPos, int yPos, int width, int height);
bool IsFullScreen() const;
void GetFramebufferSize(int* width, int* height) const;
void GetPosition(int* x, int* y) const;
void Hide();
void Show();
void SetShouldCloseFlag(bool should_close);
bool ShouldWindowClose() const;
static void PollEvents();
void SwapBuffers();
void Shutdown();
private:
// There can only be 1 window for now
static bool mbIsInit;
GLFWwindow* mpWindow;
};
}
#endif // WINDOW_H_