58 lines
1009 B
C++
58 lines
1009 B
C++
#ifndef APP_H
|
|
#define APP_H
|
|
#include <filesystem>
|
|
#include <string>
|
|
|
|
#include "glm/vec2.hpp"
|
|
|
|
#include <SDL2/SDL.h>
|
|
|
|
#include <destrum/Graphics/GfxDevice.h>
|
|
#include <destrum/Graphics/Renderer.h>
|
|
#include <destrum/Input/InputManager.h>
|
|
|
|
|
|
class App {
|
|
public:
|
|
struct AppParams {
|
|
glm::ivec2 windowSize{};
|
|
glm::ivec2 renderSize{};
|
|
std::string appName{"Destrum App"};
|
|
std::string windowTitle;
|
|
std::filesystem::path exeDir;
|
|
};
|
|
|
|
App();
|
|
|
|
void init(const AppParams& params);
|
|
void run();
|
|
void cleanup();
|
|
|
|
protected:
|
|
SDL_Window* window{nullptr};
|
|
AppParams m_params{};
|
|
|
|
CPUMesh testMesh{};
|
|
MeshID testMeshID;
|
|
|
|
GfxDevice gfxDevice;
|
|
GameRenderer renderer;
|
|
|
|
Camera camera{glm::vec3(0.f, 0.f, -5.f), glm::vec3(0, 1, 0)};
|
|
|
|
MeshCache meshCache;
|
|
|
|
InputManager inputManager;
|
|
|
|
bool isRunning{false};
|
|
bool gamePaused{false};
|
|
|
|
bool frameLimit{true};
|
|
float frameTime{0.f};
|
|
float avgFPS{0.f};
|
|
|
|
};
|
|
|
|
|
|
#endif //APP_H
|