diff --git a/src/args.cpp b/src/args.cpp index b6cddb8..e495631 100644 --- a/src/args.cpp +++ b/src/args.cpp @@ -9,7 +9,8 @@ const char* argp_program_version = const struct argp_option options[] = { //name, key, arg, flags, doc, group - {"haar-cascade", 0x00, 0, 0, "Use Haar Cascades for faster (but less accurate) face detection.", 0}, + {"haar-cascade", 0x00, 0, 0, "Use Haar Cascades for faster (but less accurate) face detection.", 0}, + {"model", 'm', "model", 0, "Name of the model file to use. (not including '.fma')", 0}, {0} }; @@ -21,7 +22,8 @@ struct argp argp = { }; struct optData optData = { - false + false, + "test", }; error_t parseOptions(int key, char* arg, struct argp_state* state) { @@ -30,6 +32,10 @@ error_t parseOptions(int key, char* arg, struct argp_state* state) { optData.useHaar = true; break; + case 'm': + optData.model = std::string(arg); + break; + default: return ARGP_ERR_UNKNOWN; } diff --git a/src/args.hpp b/src/args.hpp index 5166102..31d4995 100644 --- a/src/args.hpp +++ b/src/args.hpp @@ -1,12 +1,14 @@ #ifndef ARGS_HPP #define ARGS_HPP +#include #include error_t parseOptions(int key, char* arg, struct argp_state* state); struct optData { bool useHaar; //use haar cascades (0x00) + std::string model; //model to open (0x6d "m") }; extern const char* argp_program_version; diff --git a/src/graphics.cpp b/src/graphics.cpp index cf62db6..f955894 100644 --- a/src/graphics.cpp +++ b/src/graphics.cpp @@ -16,6 +16,7 @@ #include #include #include +#include GLuint shader; //standard shader program used for all elements GLuint transUniform; //location of the "transMatrix" transformation matrix uniform in the shader @@ -82,7 +83,7 @@ void initGraphics () { initShader(); - model = new Model(resolvePath("models/test.fma").c_str()); + model = new Model(resolvePath(("models/"+optData.model+".fma").c_str()).c_str()); //enable blending for alpha textures glEnable(GL_BLEND);