Started implementation of events for InputSystem and SoundSystem

This commit is contained in:
2014-04-28 19:55:31 +02:00
parent 5870a4d7bf
commit 57d29d0db7
25 changed files with 201 additions and 71 deletions
-28
View File
@@ -1,36 +1,8 @@
#include "PrecompiledHeader.h"
#include "Engine.h"
#include "EventBroker.h"
struct TestEvent : Event
{
std::string Hello;
};
bool OnTestEvent(const TestEvent &event)
{
std::cout << "TestEvent.Hello = " << event.Hello << std::endl;
return true;
}
int main(int argc, char* argv[])
{
EventBroker broker;
TestEvent e;
e.Hello = "Hello world";
{
EventRelay<TestEvent> testRelay = &OnTestEvent;
broker.Subscribe(testRelay);
broker.Publish<TestEvent>(e);
}
broker.Publish<TestEvent>(e);
return 0;
Engine engine(argc, argv);
while (engine.Running())
engine.Tick();