PhotonMain

PhotonMain is the entrypoint for all Photon applications, attempting to use main will result in an error message since main is defined within the library.  Using PhotonMain as an entrypoint allows you to bypass any manual initialization of the core Photon library.

Example PhotonMain Usage

class MainMenu : public State
{
...
};

int PhotonMain(const StrVec& args)
{
// get Application singleton
Application& app(Application::getInstance);

// create window
app.createDisplay(800,600,32,0,0,false);

// set current state
app.setState<MainMenu>();

// can also add any tasks before running

// run until finished
app.run();

return 0;
}
Summary
PhotonMain is the entrypoint for all Photon applications, attempting to use main will result in an error message since main is defined within the library.
Entrypoint for Photon applications.

PhotonMain

int PhotonMain(const photon::StrVec &args)

Entrypoint for Photon applications.

Arguments

argsStrVec containing command line arguments.

Returns

zero on success, non-zero on failure, just like standard main.

int PhotonMain(const photon::StrVec &args)
Entrypoint for Photon applications.
Typedef for vector of strings, which is used all throughout photon.