From dcaa318d677a1a6881ccc87640ae75c0fc578bfb Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Mon, 2 Nov 2015 06:55:15 +0100 Subject: Initial --- main.cpp | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 main.cpp (limited to 'main.cpp') 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 +#include +#include +#include "object_base.h" +#include "global.h" +#include "build/objects.h" + +#include +#include +#include + +using namespace std; + +Global global; + +shared_ptr objectfromname(const char *name){ + +#define X(objname) if(strcmp(name,#objname)==0)return make_shared(); +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(); +} -- cgit v1.2.3-70-g09d2