2023-07-29 18:58:56 -04:00
|
|
|
#pragma once
|
|
|
|
|
2023-07-30 19:37:19 -04:00
|
|
|
#include "glad/gl.h"
|
|
|
|
#include "GLFW/glfw3.h"
|
2023-07-29 18:58:56 -04:00
|
|
|
|
2023-07-30 19:37:19 -04:00
|
|
|
#include "app.h"
|
|
|
|
#include "blt/math/math.h"
|
2023-07-29 18:58:56 -04:00
|
|
|
|
2023-08-01 20:57:39 -04:00
|
|
|
namespace blt::graphics::Window {
|
2023-07-29 18:58:56 -04:00
|
|
|
|
|
|
|
constexpr unsigned int UBO_MATRICES_COUNT = 4;
|
|
|
|
|
|
|
|
struct WindowSize {
|
|
|
|
int width, height;
|
|
|
|
};
|
|
|
|
|
|
|
|
void create(const Settings &settings);
|
|
|
|
void setupGLAD();
|
|
|
|
void setupDearImGUI();
|
|
|
|
void destroy();
|
|
|
|
void preUpdate();
|
|
|
|
void postUpdate();
|
|
|
|
bool isCloseRequested();
|
|
|
|
void setCloseRequested(bool shouldClose);
|
|
|
|
void updateViewMatrix(const blt::mat4x4& view);
|
|
|
|
void updatePerspectiveMatrix(const blt::mat4x4& perspective);
|
|
|
|
void updateOrthograhpicMatrix(const blt::mat4x4& ortho);
|
|
|
|
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);
|
|
|
|
}
|