Files
Re3D/include/engine/engine.h

51 lines
1.3 KiB
C++

#pragma once
#include <filesystem>
#include <cstdint>
#include <cstring>
#include <iostream>
#include <fstream>
#include <engine/world.h>
#include <rewindow/types/window.h>
enum class GAMESTATE: uint8_t {
NORMAL = 0, //Gameplay.
IN_MAIN_MENU = 1,
IN_PAUSE_MENU = 2,
IN_LEVEL_ANIMATION = 3, //A cutscene which moves entities in the world and cannot be interrupted.
IN_QUIT = 4, //The game should close.
};
class Engine {
public:
std::string workingDir = std::filesystem::current_path().string();
RWindow* window;
World* world;
//GAMESTATE gameState = GAMESTATE::NORMAL;
//uint16_t minimumTickDelta = 15625;
//float tickDelta = NULL;
bool fullscreen;
bool debug = true;
bool useVBO = true;
bool drawCollision = true;
uint64_t tickCount = 0;
uint64_t frameCount = 0;
float frameDelta = NULL;
GLenum glError = GL_NO_ERROR;
float nearPlane = 0.01f;
float farPlane = 100.0f;
float fov = 75;
[[nodiscard]] float framerate() const;
void takeScreenshot() const;
void quit();
static float getGLVersion();
void initGL();
void debugInfo() const;
void loadConfig();
Engine() {
window = new(RWindow);
world = new(World);
}
};
inline auto* engine = new(Engine);