diff options
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 40 |
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(); +} |