Visualizer/src/Application.hpp

50 lines
997 B
C++
Raw Normal View History

2021-12-20 04:31:44 +01:00
#pragma once
#include <string>
2021-12-22 19:19:53 +01:00
#include "OrbitingCamera.hpp"
2021-12-24 15:14:35 +01:00
#include "Shapes.hpp"
2021-12-20 04:31:44 +01:00
struct GLFWwindow;
2021-12-21 18:14:01 +01:00
struct WindowData
{
2021-12-23 00:52:28 +01:00
lol::Camera* camera;
2021-12-21 18:14:01 +01:00
};
2021-12-20 04:31:44 +01:00
class Application
{
/////////////////////////////////////////////////////////
////// SINGLETON BOILERPLATE ////////////////////////////
/////////////////////////////////////////////////////////
public:
static Application& Instance()
{
static Application app;
return app;
}
private:
Application() = default;
~Application();
Application(const Application& other) = delete;
/////////////////////////////////////////////////////////
////// APPLICATION IMPLEMENTATION ///////////////////////
/////////////////////////////////////////////////////////
public:
void Init(int width, int height, const std::string& title);
2021-12-24 16:22:16 +01:00
void Quit();
2021-12-20 04:31:44 +01:00
void Launch();
private:
GLFWwindow* window = nullptr;
2021-12-21 18:14:01 +01:00
WindowData data;
2021-12-22 19:19:53 +01:00
OrbitingCamera camera;
float pitch, yaw;
2021-12-20 19:09:52 +01:00
2021-12-21 15:22:47 +01:00
glm::vec3 cubeOrientation, cubePosition, cubeScale;
2021-12-24 15:14:35 +01:00
std::vector<Shape*> shapes;
2021-12-20 04:31:44 +01:00
};