constructor fixes

This commit is contained in:
James Turk 2005-02-16 04:26:22 +00:00
parent 0fbc3adfce
commit 82a8beabb4
2 changed files with 36 additions and 11 deletions

View File

@ -5,10 +5,13 @@
// James Turk (jpt2433@rit.edu) // James Turk (jpt2433@rit.edu)
// //
// Version: // 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: // Revisions:
// $Log: Application.hpp,v $ // $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 // Revision 1.1 2005/02/13 22:12:03 cozman
// .h->.hpp // .h->.hpp
// //
@ -39,10 +42,7 @@ class Application
public: public:
// Function: Application // Function: Application
// Default constructor, initializes the internal state & dependencies. // Default constructor, initializes the internal state & dependencies.
// Application();
// Parameters:
// arg0 - Path to application (argv[0])
Application(const char* arg0);
// Function: ~Application // Function: ~Application
// Default destructor, shuts down dependencies. // Default destructor, shuts down dependencies.
@ -88,9 +88,24 @@ private:
// Initialize GLFW for use. // Initialize GLFW for use.
util::VersionInfo initGLFW(); util::VersionInfo initGLFW();
// VersionInfos // 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);
// Data Members
private: private:
util::VersionInfo photonVer; // Variable: photonVer_
// Contains version identifier for photon.
util::VersionInfo photonVer_;
// Variable: arg0_
// Contains 0th argument from command line, obtained via <setInitOptions>
// and used by PhysFS initialization.
static std::string arg0_;
}; };
} }

View File

@ -5,10 +5,13 @@
// James Turk (jpt2433@rit.edu) // James Turk (jpt2433@rit.edu)
// //
// Version: // 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: // Revisions:
// $Log: Application.cpp,v $ // $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 // Revision 1.2 2005/02/13 22:12:03 cozman
// .h->.hpp // .h->.hpp
// //
@ -29,13 +32,13 @@
namespace photon namespace photon
{ {
Application::Application(const char* arg0) : Application::Application() :
photonVer(0,0,1) // this is the current version photonVer_(0,0,1) // this is the current version
{ {
util::VersionInfo physfsReq(1,0,0); // requires PhysFS 1.0.0 util::VersionInfo physfsReq(1,0,0); // requires PhysFS 1.0.0
util::VersionInfo glfwReq(2,4,2); // requires GLFW 2.4.2 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); ensureVersion("GLFW", initGLFW(), glfwReq);
} }
@ -76,4 +79,11 @@ util::VersionInfo Application::initGLFW()
return util::VersionInfo(maj,min,patch); return util::VersionInfo(maj,min,patch);
} }
void Application::setInitOptions(const char* appPath)
{
arg0_ = appPath;
}
std::string Application::arg0_; //static initializer
} }