diff --git a/include/Application.hpp b/include/Application.hpp index b738103..b4a5dd5 100644 --- a/include/Application.hpp +++ b/include/Application.hpp @@ -5,10 +5,13 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: Application.hpp,v 1.1 2005/02/13 22:12:03 cozman Exp $ +// $Id: Application.hpp,v 1.2 2005/02/16 04:26:22 cozman Exp $ // // Revisions: // $Log: Application.hpp,v $ +// Revision 1.2 2005/02/16 04:26:22 cozman +// constructor fixes +// // Revision 1.1 2005/02/13 22:12:03 cozman // .h->.hpp // @@ -39,10 +42,7 @@ class Application public: // Function: Application // Default constructor, initializes the internal state & dependencies. - // - // Parameters: - // arg0 - Path to application (argv[0]) - Application(const char* arg0); + Application(); // Function: ~Application // Default destructor, shuts down dependencies. @@ -87,10 +87,25 @@ private: // Function: initGLFW // Initialize GLFW for use. util::VersionInfo initGLFW(); + +// Behind the scenes +public: + // Function: setInitOptions(const char* arg0) + // Internal use function, used to set initialization options. + // (params not documented since function signature is subject to change and + // should not be relied on by user-level code) + static void setInitOptions(const char* appPath); -// VersionInfos +// Data Members private: - util::VersionInfo photonVer; + // Variable: photonVer_ + // Contains version identifier for photon. + util::VersionInfo photonVer_; + + // Variable: arg0_ + // Contains 0th argument from command line, obtained via + // and used by PhysFS initialization. + static std::string arg0_; }; } diff --git a/src/Application.cpp b/src/Application.cpp index cbdd259..f8d7d49 100644 --- a/src/Application.cpp +++ b/src/Application.cpp @@ -5,10 +5,13 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: Application.cpp,v 1.2 2005/02/13 22:12:03 cozman Exp $ +// $Id: Application.cpp,v 1.3 2005/02/16 04:26:23 cozman Exp $ // // Revisions: // $Log: Application.cpp,v $ +// Revision 1.3 2005/02/16 04:26:23 cozman +// constructor fixes +// // Revision 1.2 2005/02/13 22:12:03 cozman // .h->.hpp // @@ -29,13 +32,13 @@ namespace photon { -Application::Application(const char* arg0) : - photonVer(0,0,1) // this is the current version +Application::Application() : + photonVer_(0,0,1) // this is the current version { util::VersionInfo physfsReq(1,0,0); // requires PhysFS 1.0.0 util::VersionInfo glfwReq(2,4,2); // requires GLFW 2.4.2 - ensureVersion("PhysFS", initPhysFS(arg0), physfsReq); + ensureVersion("PhysFS", initPhysFS(arg0_.c_str()), physfsReq); ensureVersion("GLFW", initGLFW(), glfwReq); } @@ -76,4 +79,11 @@ util::VersionInfo Application::initGLFW() return util::VersionInfo(maj,min,patch); } +void Application::setInitOptions(const char* appPath) +{ + arg0_ = appPath; +} + +std::string Application::arg0_; //static initializer + }