-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathEngine.hpp
47 lines (41 loc) · 1.13 KB
/
Engine.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/* Copyright (c) 2020 by Stan Fortoński */
/* This project is using below libraries */
/* GLEW library - http://glew.sourceforge.net */
/* GLFW library - https://www.glfw.org */
/* GLM library - https://glm.g-truc.net */
/* Assimp library - https://github.com/assimp/assimp */
/* FreeType library - https://www.freetype.org */
/* STB_IMAGE library - https://github.com/nothings/stb */
#ifndef ENGINE_HPP
#define ENGINE_HPP 1
#include <GL/glew.h>
#include <stdexcept>
#include <GLFW/glfw3.h>
#include "support/Singleton.hpp"
#include "Config.hpp"
namespace Engine
{
class Engine: public Singleton<Engine>
{
friend class Singleton<Engine>;
float lastTimeFromShow = 0;
unsigned frames = 0;
float lastTime = 0;
float deltaTime = 0;
std::string actualFPS;
Engine(){;}
public:
void initGLFW() const;
void initGLEW() const;
void initDefaultOptionsGL() const;
void initDeltaTime();
void calcFPS();
void limitFPS(unsigned limit);
#if DEBUG_ENGINE == 1
void showErrors();
#endif
float getDeltaTime() const{return deltaTime;}
std::string getFPS() const{return actualFPS;}
};
}
#endif