terom@358: #ifndef APPLICATION_HH terom@358: #define APPLIATION_HH terom@358: terom@358: #include "Engine.hh" terom@358: #include "Error.hh" terom@358: terom@358: #include terom@358: #include terom@358: terom@358: class ArgumentError : public Error { terom@358: public: terom@358: ArgumentError (const std::string &message) : Error(message) { } terom@358: }; terom@358: terom@358: /** terom@358: * Our CL_ClanApplication. Provides our main function, handles argument parsing and interacts with Engine terom@358: */ terom@358: class Main : public CL_ClanApplication { terom@358: private: terom@358: // arguments terom@358: CL_CommandLine args; terom@358: terom@358: /** terom@358: * --graphics terom@358: */ terom@358: bool arg_graphics; terom@358: terom@358: /** terom@358: * --port terom@358: */ terom@358: std::string arg_port; terom@358: terom@358: /** terom@358: * --server terom@358: */ terom@358: bool arg_server; terom@358: terom@358: /** terom@358: * --connect terom@358: */ terom@358: std::string arg_connect; terom@389: terom@389: /** terom@389: * --fullscreen terom@389: */ terom@389: bool arg_fullscreen; terom@389: terom@389: /** terom@389: * --resolution terom@389: */ terom@389: PixelCoordinate arg_resolution; terom@389: terom@389: /** terom@389: * Set the arg_* members terom@389: * terom@389: * @return true if execution should proceed, false if execution should stop terom@389: */ terom@389: bool parse_args (int argc, char **argv); terom@389: terom@389: /** terom@389: * Parse and set --resolution/arg_resolution WIDTHxHEIGHT terom@389: */ terom@389: void parse_arg_resolution (const std::string &val); terom@358: terom@358: /** terom@389: * Print out a list of display modes terom@358: */ terom@389: void dump_display_modes (void); terom@397: terom@397: /** terom@397: * Print out our project version terom@397: */ terom@397: void dump_version (void); terom@358: terom@358: public: terom@358: /** terom@358: * IT BEGAN IN AFRIKA terom@358: */ terom@358: virtual int main (int argc, char **argv); terom@358: } app; terom@358: terom@358: #endif