Frapper  1.0a
Static Public Member Functions | Static Private Attributes | List of all members
Frapper::OgreManager Class Reference

Static class containing OGRE utility functions. More...

#include <OgreManager.h>

Static Public Member Functions

static Ogre::RenderWindow * createRenderWindow (const Ogre::String &name="OGRE Render Window", int width=800, int height=600, const Ogre::NameValuePairList *miscParams=0)
 Creates a render window.
 
static void execConfigDialog ()
 Executes the OGRE configuration dialog.
 
static void initialize (const Ogre::String &pluginFileName="config/plugins.cfg", const Ogre::String &configFileName="config/ogre.cfg", const Ogre::String &resourceFileName="config/resources.cfg", const Ogre::String &logFileName="logs/ogre.log")
 Initializes private static data of the OgreManager.
 
static void finalize ()
 Frees all resources that were used by the OgreManager.
 
static Ogre::Root * getRoot ()
 Returns the OGRE root object.
 
static Ogre::SceneManager * getSceneManager ()
 Returns the OGRE scene manager.
 
static Ogre::SceneNodecreateSceneNode (const QString &name)
 Creates a new scene node with the given name using the default scene manager.
 
static void deleteSceneNode (Ogre::SceneNode *sceneNode)
 Deletes a specific scene node with the given name using the default scene manager.
 
static Ogre::SceneNoderelocateSceneNode (Ogre::SceneNode *sceneNode, Ogre::SceneNode *newParent)
 Detach a given SceneNode from its current parent and attach to another SceneNode.
 
static void deleteAttachedObjects (Ogre::SceneNode *sceneNode)
 Deletes all attached objects of a scene node with the given name using the default scene manager.
 
static bool isFullscreen ()
 Returns whether fullscreen mode is currently enabled.
 
static void setFullscreen (bool fullscreen)
 Set Fullscreen.
 
static Ogre::String getRenderSystemName ()
 Returns the name of the current render system.
 
static Ogre::ColourValue convertColor (const QColor &color)
 Returns the given Qt color value as an OGRE color value.
 
static void unloadResource (Ogre::ResourceManager *resMgr, const std::string &resourceName)
 Unload resource using given resource manager.
 
static void loadResource (Ogre::ResourceManager *resMgr, const std::string &resourceName, const std::string &resourceGroup)
 Load resource using given resource manager.
 
static void unloadMaterials (const std::string &filename)
 Unload materials in material listed file.
 
static void unloadVertexPrograms (const std::string &filename)
 Unload vertex programs in file.
 
static void unloadFragmentPrograms (const std::string &filename)
 Unload fragment programs file.
 
static void reloadMaterial (const std::string &materialName, const std::string &groupName, const std::string &filename, bool parseMaterialScript)
 Reload material.
 

Static Private Attributes

static Ogre::Root * s_root = 0
 The OGRE root object.
 
static Ogre::SceneManager * s_sceneManager = 0
 The OGRE scene manager.
 
static bool s_initialized = false
 Flag that states whether the OgreManager has been initialized.
 
static bool s_fullscreen = false
 Flag that states whether next created render window should be fullscreen or not.
 
static Ogre::String s_rendersystemName = "UNKNOWN"
 The Name of the currently used render system.
 

Detailed Description

Static class containing OGRE utility functions.

Member Function Documentation

Ogre::RenderWindow * Frapper::OgreManager::createRenderWindow ( const Ogre::String &  name = "OGRE Render Window",
int  width = 800,
int  height = 600,
const Ogre::NameValuePairList *  miscParams = 0 
)
static

Creates a render window.

Public Static Functions.

Parameters
nameThe name to use for the render window.
widthThe width to use for the render window.
heightThe height to use for the render window.
miscParamsAdditional parameters to pass on to the render window.
Returns
The created render window.

Create a render window.

Parameters
fullscreenFullscreen or not.
widthHeight of the render window.
heightWidth of the render window.
Returns
The created render window.
void Frapper::OgreManager::execConfigDialog ( )
static

Executes the OGRE configuration dialog.

void Frapper::OgreManager::initialize ( const Ogre::String &  pluginFileName = "config/plugins.cfg",
const Ogre::String &  configFileName = "config/ogre.cfg",
const Ogre::String &  resourceFileName = "config/resources.cfg",
const Ogre::String &  logFileName = "logs/ogre.log" 
)
static

Initializes private static data of the OgreManager.

void Frapper::OgreManager::finalize ( )
static

Frees all resources that were used by the OgreManager.

Ogre::Root * Frapper::OgreManager::getRoot ( )
static

Returns the OGRE root object.

Returns
The OGRE root object.
Ogre::SceneManager * Frapper::OgreManager::getSceneManager ( )
static

Returns the OGRE scene manager.

Returns
The OGRE scene manager.
Ogre::SceneNode * Frapper::OgreManager::createSceneNode ( const QString &  name)
static

Creates a new scene node with the given name using the default scene manager.

Creates a new scene sceneNode with the given name using the default scene manager.

Parameters
nameThe name for the scene node.
Returns
The new scene node, or 0 if the scene node could not be created.

A suffix ("SceneNode") will be added to the name of the scene sceneNode.

Parameters
nameThe name for the scene sceneNode.
Returns
The new scene sceneNode, or 0 if the scene sceneNode could not be created.
void Frapper::OgreManager::deleteSceneNode ( Ogre::SceneNode sceneNode)
static

Deletes a specific scene node with the given name using the default scene manager.

Deletes a specific scene node with the given name using the default scene manager. Use in conjunction with OgreManager::createSceneNode().

Parameters
sceneNodeThe scene node to be deleted.
Ogre::SceneNode * Frapper::OgreManager::relocateSceneNode ( Ogre::SceneNode sceneNode,
Ogre::SceneNode newParent 
)
static

Detach a given SceneNode from its current parent and attach to another SceneNode.

Parameters
sceneNodeThe SceneNode to be relocated.
newParentWhere the SceneNode will be attached
sceneNodeThe SceneNode to be relocated.
newParentWhere the SceneNode will be attached
Returns
The previous parent of the scene node
void Frapper::OgreManager::deleteAttachedObjects ( Ogre::SceneNode sceneNode)
static

Deletes all attached objects of a scene node with the given name using the default scene manager.

Parameters
sceneNodeThe scene node with attached objects to be deleted
bool Frapper::OgreManager::isFullscreen ( )
static

Returns whether fullscreen mode is currently enabled.

Returns
True if fullscreen mode is currently enabled, otherwise False.
void Frapper::OgreManager::setFullscreen ( bool  fullscreen)
static

Set Fullscreen.

Parameters
fullsreenFullscreen oder not.
Ogre::String Frapper::OgreManager::getRenderSystemName ( )
static

Returns the name of the current render system.

Returns
The name of the current render system.
Ogre::ColourValue Frapper::OgreManager::convertColor ( const QColor &  color)
static

Returns the given Qt color value as an OGRE color value.

Parameters
colorThe Qt color value to convert.
Returns
The OGRE color value corresponding to the given Qt color value.
void Frapper::OgreManager::unloadResource ( Ogre::ResourceManager *  resMgr,
const std::string &  resourceName 
)
static

Unload resource using given resource manager.

Parameters
resMgrThe reource manager.
resourceNameThe resource to unload.
resMgrThe resource manager.
resourceNameThe resource to unload.
void Frapper::OgreManager::loadResource ( Ogre::ResourceManager *  resMgr,
const std::string &  resourceName,
const std::string &  resourceGroup 
)
static

Load resource using given resource manager.

Parameters
resMgrThe reource manager.
resourceNameThe resource to load.
resourceGroupThe resource group.
void Frapper::OgreManager::unloadMaterials ( const std::string &  filename)
static

Unload materials in material listed file.

Parameters
filenameThe material filename.
void Frapper::OgreManager::unloadVertexPrograms ( const std::string &  filename)
static

Unload vertex programs in file.

Parameters
filenameThe vertex program filename.
void Frapper::OgreManager::unloadFragmentPrograms ( const std::string &  filename)
static

Unload fragment programs file.

Parameters
filenameThe fragment program filename.
void Frapper::OgreManager::reloadMaterial ( const std::string &  materialName,
const std::string &  groupName,
const std::string &  filename,
bool  parseMaterialScript 
)
static

Reload material.

Parameters
materialNameThe material's name.
groupNameThe group name.
filenameThe filename.
parseMaterialScriptParse the material script or not.

Member Data Documentation

Ogre::Root * Frapper::OgreManager::s_root = 0
staticprivate

The OGRE root object.

Private Static Data.

Ogre::SceneManager * Frapper::OgreManager::s_sceneManager = 0
staticprivate

The OGRE scene manager.

bool Frapper::OgreManager::s_initialized = false
staticprivate

Flag that states whether the OgreManager has been initialized.

bool Frapper::OgreManager::s_fullscreen = false
staticprivate

Flag that states whether next created render window should be fullscreen or not.

Ogre::String Frapper::OgreManager::s_rendersystemName = "UNKNOWN"
staticprivate

The Name of the currently used render system.


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