Parks-n-Rec/include/parks/window.h

43 lines
1.1 KiB
C
Raw Normal View History

2023-06-12 20:00:53 -04:00
#pragma once
#include <glad/gl.h>
#include <GLFW/glfw3.h>
#include <parks/app.h>
2023-06-15 21:16:48 -04:00
#include <blt/math/math.h>
2023-06-12 20:00:53 -04:00
namespace parks::Window {
2023-06-15 21:16:48 -04:00
2023-07-12 21:38:34 -04:00
constexpr unsigned int UBO_MATRICES_COUNT = 4;
2023-06-15 21:16:48 -04:00
struct WindowSize {
int width, height;
};
2023-06-12 20:00:53 -04:00
void create(const Settings &settings);
void setupGLAD();
void setupDearImGUI();
void destroy();
void preUpdate();
void postUpdate();
bool isCloseRequested();
void setCloseRequested(bool shouldClose);
2023-06-15 21:16:48 -04:00
void updateViewMatrix(const blt::mat4x4& view);
void updatePerspectiveMatrix(const blt::mat4x4& perspective);
2023-07-12 21:38:34 -04:00
void updateOrthograhpicMatrix(const blt::mat4x4& ortho);
2023-06-15 21:16:48 -04:00
const blt::mat4x4& getViewMatrix();
const blt::mat4x4& getPerspectiveMatrix();
const WindowSize& getWindowSize();
double getFrameDeltaSeconds();
bool isKeyDown(int key);
bool isMouseDown(int mouse);
bool isMouseVisible();
void setMouseVisible(bool state);
double getMouseX();
double getMouseDX();
double getMouseY();
double getMouseDY();
bool mousePressedLastFrame();
bool mouseMovedLastFrame();
bool keyPressedLastFrame(int key);
2023-06-12 20:00:53 -04:00
}