summaryrefslogtreecommitdiffstats
path: root/engine/include/flatland.hpp
diff options
context:
space:
mode:
authorNao Pross <naopross@thearcway.org>2019-01-26 23:18:37 +0100
committerNao Pross <naopross@thearcway.org>2019-01-26 23:18:37 +0100
commitb3b27e0feab43b1a21442e4ac03ea338167d75ee (patch)
tree107d468c140cdec355869e1838bb92850c4b537a /engine/include/flatland.hpp
parentUpdate configure.py to add granular testing (diff)
downloadflatland-b3b27e0feab43b1a21442e4ac03ea338167d75ee.tar.gz
flatland-b3b27e0feab43b1a21442e4ac03ea338167d75ee.zip
Restore old files to ease merge (flatland, signal, window)
There was nothing particularly important anyway
Diffstat (limited to '')
-rw-r--r--engine/include/flatland.hpp81
1 files changed, 64 insertions, 17 deletions
diff --git a/engine/include/flatland.hpp b/engine/include/flatland.hpp
index 5354498..331093b 100644
--- a/engine/include/flatland.hpp
+++ b/engine/include/flatland.hpp
@@ -1,24 +1,71 @@
-#pragma once
-
-#include <functional>
+#ifndef __FLATLAND_H__
+#define __FLATLAND_H__
namespace flat {
- namespace core {
- class job;
- class task;
- class channel;
- }
- void intialize(std::function<void()> loop);
- void run(unsigned framerate);
- void quit();
+class FlatWindow;
+
+typedef void (*gameloop)(float);
+
+struct flat_status
+{
+
+ flat_status(unsigned char video = 1,
+ unsigned char audio = 1,
+ unsigned char timer = 1,
+ unsigned char events = 1,
+ unsigned char joystick = 0,
+ unsigned char controller = 0,
+ unsigned char haptic = 0,
+ unsigned char error = 0,
+ unsigned char running = 0,
+ unsigned char loop = 0)
+
+ : video(video), audio(audio), timer(timer), events(events),
+ joystick(joystick), controller(controller), haptic(haptic),
+ error(error), running(running), loop(loop) {}
- /* Engine channels */
- // TODO:
- // core::channel& core_chan();
- // core::channel& error_chan();
+ unsigned char video:1;
+ unsigned char audio:1;
+ unsigned char timer:1;
+ unsigned char events:1;
+ unsigned char joystick:1;
+ unsigned char controller:1;
+ unsigned char haptic:1;
+ unsigned char error:1;
+ unsigned char running:1;
+ unsigned char loop:1;
+};
- /* Main job access */
- core::job& gamejob();
+int init_flatland(FlatWindow*, gameloop, const flat_status&, float fps = 60);
+void quit_flatland();
+namespace core {
+
+ class job;
+ class task;
+ class channel;
}
+
+/* Engine channels */
+
+core::channel& core_chan();
+core::channel& error_chan();
+
+/* Main job access */
+
+core::job& game_job();
+
+/* Window and status accessors */
+
+FlatWindow * getFlatWindow();
+
+flat_status flatland_status();
+
+/* Window and status modifiers */
+
+void load_flatland_status(const flat_status&);
+
+}
+
+#endif