V-Gears 0
Free Final Fantasy VII engine.
VGears::Application Class Reference

The V-Gears main applicacion. More...

#include <VGearsApplication.h>

Inheritance diagram for VGears::Application:
Collaboration diagram for VGears::Application:

Public Member Functions

 Application (Ogre::String pluginsFileName, Ogre::String resourcesFile, Ogre::String logFileName)
 Constructor. More...
 
 Application (int argc, char *argv[])
 Constructor. More...
 
virtual ~Application ()
 Destructor. More...
 
bool initOgre (bool hideWindow=false)
 Initializes the Ogre rendering system. More...
 
Ogre::Root * getRoot (void)
 Retrieves the Ogre system main component. More...
 
Ogre::RenderWindow * getRenderWindow (void)
 Retrieves the Ogre main window. More...
 
const StringgetResourcesFilename (void)
 Retrieves the Ogre resources file name. More...
 
Ogre::ResourceGroupManager * ResMgr ()
 Retrieves the Ogre resource manager. More...
 

Protected Member Functions

String getWindowTitle (void) const
 Retrieves the main window title. More...
 
bool processCommandLine (int argc, char *argv[])
 Processes command line arguments. More...
 
void registerArchiveFactories (void)
 Registers an {. More...
 
void loadResourcesConfig (void)
 Loads the resource configuration from the file. More...
 
void initComponents (void)
 Initializes components. More...
 
void destroyComponents (void)
 Unloads components. More...
 
void createResourceManagers (void)
 Initializes the resource manager. More...
 
void destroyResourceManagers (void)
 Unloads the resource manager. More...
 

Private Types

typedef std::vector< std::shared_ptr< Ogre::ResourceManager > > ResourceManagerVector
 List of resource managers. More...
 

Private Attributes

int _argc = 0
 Number of arguments assed by command line. More...
 
char ** _argv = nullptr
 List of arguments passed by command line. More...
 
String config_filename_
 Path to the configuration file. More...
 
String log_filename_
 Path to the log file. More...
 
String plugins_filename_
 Path to the plugin configuration file. More...
 
String resources_filename_
 Path to the resource configuration file. More...
 
bool _initialized = false
 Flag for initialization status. More...
 
std::unique_ptr< Ogre::Root > _root
 Ogre main component. More...
 
std::unique_ptr< Ogre::OverlaySystem > _overlay_system
 The ogre overlay system. More...
 
Ogre::RenderWindow * _render_window = nullptr
 The Ogre main window. More...
 
ResourceManagerVector _resource_managers
 List of Ogre resource managers. More...
 
Ogre::ResourceGroupManager * res_mgr_ = nullptr
 Ogre resource group manager. More...
 

Static Private Attributes

static const char * CLI_SECTION_GENERIC
 String for the command line help text. More...
 
static const char * CLI_HELP
 String for the command line arguments. More...
 
static const char * CLI_HELP_DESCRIPTION
 String for the command line help text. More...
 
static const char * CLI_CONFIG_FILE
 String for the command line arguments. More...
 
static const char * CLI_CONFIG_FILE_DESCRIPTION
 String for the command line help text. More...
 
static const char * CLI_LOG_FILE
 String for the command line arguments. More...
 
static const char * CLI_LOG_FILE_DESCRIPTION
 String for the command line help text. More...
 
static const char * CLI_PLUGINS_FILE
 String for the command line arguments. More...
 
static const char * CLI_PLUGINS_FILE_DESCRIPTION
 String for the command line help text. More...
 
static const char * CLI_RESOURCES_FILE
 String for the command line arguments. More...
 
static const char * CLI_RESOURCES_FILE_DESCRIPTION
 String for the command line help text. More...
 

Detailed Description

The V-Gears main applicacion.

Member Typedef Documentation

◆ ResourceManagerVector

typedef std::vector<std::shared_ptr<Ogre::ResourceManager> > VGears::Application::ResourceManagerVector
private

List of resource managers.

Constructor & Destructor Documentation

◆ Application() [1/2]

VGears::Application::Application ( Ogre::String  pluginsFileName,
Ogre::String  resourcesFile,
Ogre::String  logFileName 
)
inline

Constructor.

Parameters
[in]pluginsFileNamePath to the plugins file.
[in]resourcesFilePath to the resources file.
[in]logFileNamePath to the log file.

◆ Application() [2/2]

VGears::Application::Application ( int  argc,
char *  argv[] 
)

Constructor.

Parameters
[in]argcNumber of command line arguments.
[in]argvList of command line arguments.

◆ ~Application()

VGears::Application::~Application ( )
virtual

Destructor.

Member Function Documentation

◆ createResourceManagers()

void VGears::Application::createResourceManagers ( void  )
protected

Initializes the resource manager.

◆ destroyComponents()

void VGears::Application::destroyComponents ( void  )
protected

Unloads components.

Unoads the TexCodec component and the resource manager.

◆ destroyResourceManagers()

void VGears::Application::destroyResourceManagers ( void  )
protected

Unloads the resource manager.

◆ getRenderWindow()

Ogre::RenderWindow * VGears::Application::getRenderWindow ( void  )

Retrieves the Ogre main window.

Returns
Pointer to the Ogre window.

◆ getResourcesFilename()

const String & VGears::Application::getResourcesFilename ( void  )

Retrieves the Ogre resources file name.

Returns
Ogre resource configuration file name.

◆ getRoot()

Ogre::Root * VGears::Application::getRoot ( void  )

Retrieves the Ogre system main component.

Returns
Pointer to the Ogre main component.

◆ getWindowTitle()

String VGears::Application::getWindowTitle ( void  ) const
protected

Retrieves the main window title.

Returns
Th windo title.

◆ initComponents()

void VGears::Application::initComponents ( void  )
protected

Initializes components.

Initializes the TexCodec component and the resource manager.

◆ initOgre()

bool VGears::Application::initOgre ( bool  hideWindow = false)

Initializes the Ogre rendering system.

Parameters
[in]hideWindowTrue to not show the main window, false to show it.
Returns
True if the system was succesfully initiated, false if there were errors or it was already initialized.

◆ loadResourcesConfig()

void VGears::Application::loadResourcesConfig ( void  )
protected

Loads the resource configuration from the file.

◆ processCommandLine()

bool VGears::Application::processCommandLine ( int  argc,
char *  argv[] 
)
protected

Processes command line arguments.

Parameters
[in]argcNumber of command line arguments.
[in]argvList of command line arguments.
Returns
True if all arguments were successfully processed, false on error

◆ registerArchiveFactories()

void VGears::Application::registerArchiveFactories ( void  )
protected

Registers an {.

See also
LGPArchiveFactory} with the Ogre archive manager

◆ ResMgr()

Ogre::ResourceGroupManager * VGears::Application::ResMgr ( )
inline

Retrieves the Ogre resource manager.

Returns
Pointer to the Ogre resource manager.

Member Data Documentation

◆ _argc

int VGears::Application::_argc = 0
private

Number of arguments assed by command line.

◆ _argv

char** VGears::Application::_argv = nullptr
private

List of arguments passed by command line.

◆ _initialized

bool VGears::Application::_initialized = false
private

Flag for initialization status.

◆ _overlay_system

std::unique_ptr<Ogre::OverlaySystem> VGears::Application::_overlay_system
private

The ogre overlay system.

◆ _render_window

Ogre::RenderWindow* VGears::Application::_render_window = nullptr
private

The Ogre main window.

◆ _resource_managers

ResourceManagerVector VGears::Application::_resource_managers
private

List of Ogre resource managers.

◆ _root

std::unique_ptr<Ogre::Root> VGears::Application::_root
private

Ogre main component.

◆ CLI_CONFIG_FILE

const char * VGears::Application::CLI_CONFIG_FILE
staticprivate

String for the command line arguments.

◆ CLI_CONFIG_FILE_DESCRIPTION

const char * VGears::Application::CLI_CONFIG_FILE_DESCRIPTION
staticprivate

String for the command line help text.

◆ CLI_HELP

const char * VGears::Application::CLI_HELP
staticprivate

String for the command line arguments.

◆ CLI_HELP_DESCRIPTION

const char * VGears::Application::CLI_HELP_DESCRIPTION
staticprivate

String for the command line help text.

◆ CLI_LOG_FILE

const char * VGears::Application::CLI_LOG_FILE
staticprivate

String for the command line arguments.

◆ CLI_LOG_FILE_DESCRIPTION

const char * VGears::Application::CLI_LOG_FILE_DESCRIPTION
staticprivate

String for the command line help text.

◆ CLI_PLUGINS_FILE

const char * VGears::Application::CLI_PLUGINS_FILE
staticprivate

String for the command line arguments.

◆ CLI_PLUGINS_FILE_DESCRIPTION

const char * VGears::Application::CLI_PLUGINS_FILE_DESCRIPTION
staticprivate

String for the command line help text.

◆ CLI_RESOURCES_FILE

const char * VGears::Application::CLI_RESOURCES_FILE
staticprivate

String for the command line arguments.

◆ CLI_RESOURCES_FILE_DESCRIPTION

const char * VGears::Application::CLI_RESOURCES_FILE_DESCRIPTION
staticprivate

String for the command line help text.

◆ CLI_SECTION_GENERIC

const char * VGears::Application::CLI_SECTION_GENERIC
staticprivate

String for the command line help text.

◆ config_filename_

String VGears::Application::config_filename_
private

Path to the configuration file.

◆ log_filename_

String VGears::Application::log_filename_
private

Path to the log file.

◆ plugins_filename_

String VGears::Application::plugins_filename_
private

Path to the plugin configuration file.

◆ res_mgr_

Ogre::ResourceGroupManager* VGears::Application::res_mgr_ = nullptr
private

Ogre resource group manager.

◆ resources_filename_

String VGears::Application::resources_filename_
private

Path to the resource configuration file.


The documentation for this class was generated from the following files: