42 lines
651 B
C++
42 lines
651 B
C++
|
|
#include "engine.h"
|
|
//#include "bullet/btBulletCollisionCommon.h"
|
|
//#include "bullet/btBulletDynamicsCommon.h"
|
|
|
|
Engine::Engine(Input* _input): input(_input)
|
|
{
|
|
|
|
}
|
|
|
|
void Engine::update()
|
|
{
|
|
//update time variable
|
|
lastTimeStamp = timeStamp;
|
|
timeStamp = (unsigned int) clock.getElapsedTime().asMilliseconds();
|
|
//update Events
|
|
input->updateEvents();
|
|
|
|
render();
|
|
updatePhysics();
|
|
}
|
|
|
|
void Engine::render()
|
|
{
|
|
//call to SparrowRenderer
|
|
}
|
|
|
|
void Engine::updatePhysics()
|
|
{
|
|
//update world
|
|
}
|
|
|
|
unsigned int Engine::getTime()
|
|
{
|
|
return timeStamp;
|
|
}
|
|
|
|
unsigned int Engine::getDeltaTime()
|
|
{
|
|
return timeStamp - lastTimeStamp;
|
|
}
|