SparrowEngine/src/engine.h
2016-07-11 20:46:05 +02:00

62 lines
1.2 KiB
C++

#ifndef ENGINE_H
#define ENGINE_H
#include <string>
class Input;
class SparrowRenderer;
class SceneTree;
class SparrowShell;
namespace sf
{
class Clock;
class Window;
}
class btDiscreteDynamicsWorld;
class Engine
{
public:
Engine();
~Engine();
void createWindow(std::string title = "SparrowEngine",
unsigned int w = 800,
unsigned int h = 600,
bool isWindowed = true);
void setScene(SceneTree *scene);
void initPhysics();
void start();
void stop();
Input* getInput() {return m_input;}
sf::Window* getWindow(){return m_window;}
SparrowRenderer* getRenderer() {return m_renderer;}
btDiscreteDynamicsWorld* getPhysics() {return m_world;}
void outputShell(std::string str);
unsigned int getTime();
unsigned int getDeltaTime();
private:
sf::Clock* m_clock;
unsigned int m_timeStamp = 0;
unsigned int m_lastTimeStamp = 0;
bool m_running;
sf::Window* m_window;
Input* m_input;
SceneTree* m_scene;
SparrowShell* m_sparrowshell;
btDiscreteDynamicsWorld* m_world;
SparrowRenderer* m_renderer;
void update();
};
#endif