2005-02-07 02:00:48 +00:00
|
|
|
//This file is part of Photon (http://photon.sourceforge.net)
|
|
|
|
//Copyright (C) 2004-2005 James Turk
|
|
|
|
//
|
|
|
|
// Author:
|
|
|
|
// James Turk (jpt2433@rit.edu)
|
|
|
|
//
|
|
|
|
// Version:
|
2005-03-02 08:40:51 +00:00
|
|
|
// $Id: Application.hpp,v 1.6 2005/03/02 08:40:51 cozman Exp $
|
2005-02-07 02:00:48 +00:00
|
|
|
|
2005-02-13 22:12:02 +00:00
|
|
|
#ifndef PHOTON_APPLICATION_HPP
|
|
|
|
#define PHOTON_APPLICATION_HPP
|
2005-02-07 02:00:48 +00:00
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
|
|
|
|
2005-03-01 07:51:04 +00:00
|
|
|
#include <boost/utility.hpp>
|
|
|
|
|
2005-02-13 22:12:02 +00:00
|
|
|
#include "types.hpp"
|
|
|
|
#include "util/VersionInfo.hpp"
|
|
|
|
|
2005-02-07 02:00:48 +00:00
|
|
|
namespace photon
|
|
|
|
{
|
|
|
|
|
|
|
|
// Class: Application
|
2005-02-27 07:43:37 +00:00
|
|
|
// Abstract main class, all photon applications should derive from API-specific
|
|
|
|
// implementations of Application.
|
|
|
|
//
|
2005-02-07 02:00:48 +00:00
|
|
|
// Derived classes are made entrypoint via <ENTRYPOINT>.
|
2005-03-01 07:51:04 +00:00
|
|
|
class Application : public boost::noncopyable
|
2005-02-07 02:00:48 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
// Group: (Con/De)structors
|
|
|
|
public:
|
|
|
|
// Function: Application
|
|
|
|
// Default constructor, initializes the internal state & dependencies.
|
2005-02-16 04:26:22 +00:00
|
|
|
Application();
|
2005-02-07 02:00:48 +00:00
|
|
|
|
|
|
|
// Function: ~Application
|
|
|
|
// Default destructor, shuts down dependencies.
|
|
|
|
virtual ~Application();
|
|
|
|
|
|
|
|
// Function: main
|
|
|
|
// Pure virtual, must be defined by derived class, using some preprocessor
|
|
|
|
// magic (<MAINCLASS>) on the derived class
|
|
|
|
// this becomes the entry point for a Amph application.
|
|
|
|
//
|
|
|
|
// Parameters:
|
|
|
|
// args - <ArgList> containing arguments passed to program.
|
|
|
|
//
|
|
|
|
// Returns: 0 upon success, other upon failure.
|
|
|
|
// (Same as main in Standard C/C++).
|
|
|
|
//
|
|
|
|
// See Also:
|
|
|
|
// <ENTRYPOINT>
|
|
|
|
virtual int main(StrVec args)=0;
|
2005-02-27 07:43:37 +00:00
|
|
|
|
2005-03-01 07:51:04 +00:00
|
|
|
// 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);
|
|
|
|
|
2005-02-13 22:12:02 +00:00
|
|
|
// Group: API Initialization
|
|
|
|
private:
|
|
|
|
// Function: initPhysFS
|
|
|
|
// Initialize PhysFS for use.
|
|
|
|
//
|
|
|
|
// Parameters:
|
|
|
|
// arg0 - Path to application (argv[0])
|
2005-02-27 07:43:37 +00:00
|
|
|
//
|
|
|
|
// Returns:
|
|
|
|
// <VersionInfo> with PhysFS version.
|
2005-02-13 22:12:02 +00:00
|
|
|
util::VersionInfo initPhysFS(const char* arg0);
|
2005-02-27 07:43:37 +00:00
|
|
|
|
2005-02-16 04:26:22 +00:00
|
|
|
// Data Members
|
2005-02-13 22:12:02 +00:00
|
|
|
private:
|
2005-03-01 07:51:04 +00:00
|
|
|
// version number for photon
|
2005-02-16 04:26:22 +00:00
|
|
|
util::VersionInfo photonVer_;
|
2005-02-27 07:43:37 +00:00
|
|
|
|
2005-03-01 07:51:04 +00:00
|
|
|
// arg0 from command line
|
2005-02-16 04:26:22 +00:00
|
|
|
static std::string arg0_;
|
2005-02-07 02:00:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2005-02-13 22:12:02 +00:00
|
|
|
#endif //PHOTON_APPLICATION_HPP
|