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.
63 lines
1.7 KiB
C
63 lines
1.7 KiB
C
|
5 years ago
|
/******************************************************************************
|
||
|
|
* 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>
|
||
|
5 years ago
|
#include <glm/glm.hpp>
|
||
|
5 years ago
|
#include <core/state.h>
|
||
|
4 years ago
|
#include <utils/op_res.h>
|
||
|
5 years ago
|
|
||
|
|
namespace lunarium
|
||
|
|
{
|
||
|
|
class Window
|
||
|
|
{
|
||
|
|
public:
|
||
|
|
Window();
|
||
|
|
|
||
|
|
OpRes Initialize(const State& state);
|
||
|
|
bool IsInit() const;
|
||
|
|
|
||
|
|
GLFWwindow* GetWindow();
|
||
|
4 years ago
|
bool IsKeyDown(int key, bool mouse_button = false) const;
|
||
|
5 years ago
|
glm::vec2 GetCursorPos() const;
|
||
|
|
void SetCursorPos(glm::vec2 pos);
|
||
|
5 years ago
|
|
||
|
|
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);
|
||
|
|
|
||
|
4 years ago
|
bool IsFullScreen() const;
|
||
|
5 years ago
|
void GetFramebufferSize(int* width, int* height) const;
|
||
|
5 years ago
|
void GetPosition(int* x, int* y) const;
|
||
|
5 years ago
|
|
||
|
4 years ago
|
void Hide();
|
||
|
|
void Show();
|
||
|
|
|
||
|
5 years ago
|
void SetShouldCloseFlag(bool should_close);
|
||
|
5 years ago
|
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_
|