summaryrefslogtreecommitdiffstats
path: root/engine/flatserial.cpp
diff options
context:
space:
mode:
authorancarola <raffaele.ancarola@epfl.ch>2019-01-20 01:19:26 +0100
committerancarola <raffaele.ancarola@epfl.ch>2019-01-20 01:19:26 +0100
commit6c0c2f6f10e86986087c71a2964974ebcd939a3f (patch)
tree0a16aff4380188c6ee222579dbb55392a230dbc0 /engine/flatserial.cpp
parentIgnore swap files (diff)
downloadflatland-6c0c2f6f10e86986087c71a2964974ebcd939a3f.tar.gz
flatland-6c0c2f6f10e86986087c71a2964974ebcd939a3f.zip
Test 3 partially executed
Diffstat (limited to 'engine/flatserial.cpp')
-rw-r--r--engine/flatserial.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/engine/flatserial.cpp b/engine/flatserial.cpp
index 25eafbe..9c49787 100644
--- a/engine/flatserial.cpp
+++ b/engine/flatserial.cpp
@@ -3,12 +3,17 @@
SDL_EventCollector::SDL_EventCollector()
{
- checker = new FlatTask<SDL_EventCollector>(this, &SDL_EventCollector::collect, 0);
+ /* Checker task, pre-process, maximum priority */
+ checker = new FlatTask<SDL_EventCollector>(this, &SDL_EventCollector::collect, 0, true, 0);
+
+ /* Eraser task, post-process, minimum priority */
+ eraser = new FlatTask<SDL_EventCollector>(this, &SDL_EventCollector::erase, 0, false, 0xff);
}
SDL_EventCollector::~SDL_EventCollector()
{
delete checker;
+ delete eraser;
}
void SDL_EventCollector::collect(void*)
@@ -49,6 +54,14 @@ void SDL_EventCollector::collect(void*)
}
}
+void SDL_EventCollector::erase(void*)
+{
+ keyboard.clear();
+ window.clear();
+ quit.clear();
+ user.clear();
+}
+
const std::vector<SDL_Event>& SDL_EventCollector::getStack(Uint32 id) const
{
switch(id)