About to add evet
This commit is contained in:
20
src/dawn/event/Event.hpp
Normal file
20
src/dawn/event/Event.hpp
Normal file
@ -0,0 +1,20 @@
|
||||
// Copyright (c) 2023 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "dawnlibs.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
template<typename T>
|
||||
class Event {
|
||||
private:
|
||||
|
||||
public:
|
||||
Event() {}
|
||||
virtual ~Event() {}
|
||||
|
||||
virtual void operator()(T &t) = 0;
|
||||
}
|
||||
}
|
@ -21,7 +21,8 @@ void Game::init() {
|
||||
nextFrameScene = std::make_shared<Scene>(shared_from_this(), initialScene);
|
||||
}
|
||||
|
||||
void Game::update(float_t delta) {
|
||||
void Game::update() {
|
||||
timeManager.update();
|
||||
renderHost.update(shared_from_this());
|
||||
|
||||
if(nextFrameScene) {
|
||||
|
@ -7,11 +7,6 @@
|
||||
|
||||
using namespace Dawn;
|
||||
|
||||
void ITimeManager::tick(float_t delta) {
|
||||
this->delta = delta;
|
||||
this->time += delta;
|
||||
}
|
||||
|
||||
ITimeManager::~ITimeManager() {
|
||||
|
||||
}
|
@ -14,10 +14,8 @@ namespace Dawn {
|
||||
|
||||
/**
|
||||
* Ticks / updates the time management system.
|
||||
*
|
||||
* @param delta Time delta in seconds.
|
||||
*/
|
||||
void tick(float_t delta);
|
||||
virtual void update() = 0;
|
||||
|
||||
/**
|
||||
* Returns the real world time epoch.
|
||||
|
Reference in New Issue
Block a user