2021-09-13 15:53:43 +03:00
|
|
|
//
|
|
|
|
// Created by Иван Ильин on 14.01.2021.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef ENGINE_ENGINE_H
|
|
|
|
#define ENGINE_ENGINE_H
|
|
|
|
|
|
|
|
#include "Screen.h"
|
2021-09-19 15:44:31 +03:00
|
|
|
#include "Keyboard.h"
|
|
|
|
#include "Mouse.h"
|
|
|
|
|
2021-09-13 15:53:43 +03:00
|
|
|
#include "World.h"
|
|
|
|
#include "Camera.h"
|
|
|
|
#include "utils/Log.h"
|
|
|
|
|
|
|
|
class Engine {
|
2021-09-19 11:25:10 +03:00
|
|
|
private:
|
|
|
|
std::string _name;
|
2021-09-20 13:54:09 +03:00
|
|
|
|
2021-09-19 11:25:10 +03:00
|
|
|
double _triPerSec = 0;
|
|
|
|
bool _debugText = true;
|
|
|
|
bool _updateWorld = true;
|
|
|
|
|
|
|
|
void printDebugText() const;
|
2021-09-13 15:53:43 +03:00
|
|
|
protected:
|
|
|
|
std::shared_ptr<Screen> screen;
|
2021-09-19 15:44:31 +03:00
|
|
|
std::shared_ptr<Keyboard> keyboard;
|
|
|
|
std::shared_ptr<Mouse> mouse;
|
|
|
|
|
2021-09-13 15:53:43 +03:00
|
|
|
std::shared_ptr<World> world;
|
|
|
|
std::shared_ptr<Camera> camera;
|
|
|
|
|
|
|
|
virtual void start() {};
|
2021-09-19 11:25:10 +03:00
|
|
|
virtual void update() {};
|
|
|
|
|
|
|
|
void setDebugText(bool value) { _debugText = value; }
|
|
|
|
void setUpdateWorld(bool value) { _updateWorld = value; }
|
2021-09-13 15:53:43 +03:00
|
|
|
|
|
|
|
virtual void gui(){}
|
2021-10-02 20:36:07 +03:00
|
|
|
public:
|
|
|
|
Engine();
|
|
|
|
|
|
|
|
virtual ~Engine() = default;
|
|
|
|
|
2021-10-16 20:22:55 +03:00
|
|
|
void create(int screenWidth = Consts::STANDARD_SCREEN_WIDTH, int screenHeight = Consts::STANDARD_SCREEN_HEIGHT, const std::string& name = Consts::PROJECT_NAME, bool verticalSync = true, sf::Color background = Consts::BACKGROUND_COLOR, sf::Uint32 style = sf::Style::Default);
|
2021-10-02 20:36:07 +03:00
|
|
|
void exit();
|
2021-09-13 15:53:43 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif //INC_3DZAVR_TDZAVR_H
|