summaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
authortomsmeding <hallo@tomsmeding.nl>2015-11-02 06:55:15 +0100
committertomsmeding <hallo@tomsmeding.nl>2015-11-02 06:55:15 +0100
commitdcaa318d677a1a6881ccc87640ae75c0fc578bfb (patch)
tree3ff05dc8494d6629dddfde30f859e0c72e620926 /main.cpp
Initial
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/main.cpp b/main.cpp
new file mode 100644
index 0000000..98ea6ac
--- /dev/null
+++ b/main.cpp
@@ -0,0 +1,40 @@
+#include <iostream>
+#include <cstring>
+#include <memory>
+#include "object_base.h"
+#include "global.h"
+#include "build/objects.h"
+
+#include <FL/Fl.H>
+#include <FL/Fl_Window.H>
+#include <FL/Fl_draw.H>
+
+using namespace std;
+
+Global global;
+
+shared_ptr<Object> objectfromname(const char *name){
+
+#define X(objname) if(strcmp(name,#objname)==0)return make_shared<objname>();
+OBJECT_CLASSES_XLIST
+#undef X
+
+ return NULL; //no object with that name
+}
+
+void stepcallback(void*){
+ Fl::repeat_timeout(1.0/30,stepcallback);
+}
+
+int main(int argc,char **argv){
+ Fl_Window *window=new Fl_Window(640,480,GAME_NAME);
+
+ global.objects.push_back(objectfromname("obj_control"));
+ global.objects[0]->create();
+
+ window->end();
+ Fl::visual(FL_RGB);
+ window->show(argc,argv);
+ Fl::add_timeout(1.0/30,stepcallback);
+ return Fl::run();
+}