#include <RenderSystem.hpp>
Public Member Functions | |
bool | initialize (const bool sceneManager) |
Initialize renderer. | |
void | update () |
Update rendering system. | |
void | present () |
Present rendered graphics to the screen. | |
bool | getStatus () const |
Get status of the rendering system. | |
void * | getWindowHandle () const |
Get window handle. | |
Ogre::Root * | getOgre () const |
Get Ogre root object. | |
Ogre::SceneManager * | getSceneManager () const |
Get main scene manager. | |
Ogre::RenderWindow * | getRenderWindow () const |
Get rendering window. | |
bool | loadTexture (const std::string &texture) |
Load texture. | |
bool | createDynamicTexture (const std::string &name, const unsigned int width, const unsigned int height) |
Create a dynamic texture. | |
bool | updateDynamicTexture (const std::string &name, const unsigned char *data, const unsigned int dataRowStride) |
Update a dynamic texture. | |
void | deleteDynamicTexture (const std::string &name) |
Delete a dynamic texture. | |
bool | createOverlay (const std::string &name, const std::string &material, const bool dynamicTextureMaterial, const float x, const float y, const float width, const float height) |
Create an overlay. | |
void | deleteOverlay (const std::string &name) |
Static Public Member Functions | |
static bool | initializeSingleton (const std::string &ogreLogPrefix, Core::Logger *pLogger) |
Initialize singleton. | |
static RenderSystem * | getSingleton () |
Retrieve singleton instance. | |
static void | terminateSingleton (Core::Logger *pLogger) |
Terminate singleton. | |
Private Member Functions | |
RenderSystem (const std::string &ogreLogPrefix, Core::Logger *pLogger) | |
Constructor. | |
~RenderSystem () | |
Destructor. | |
Private Attributes | |
Core::Logger * | m_pLogger |
Pointer to the logger to be used. | |
Ogre::Root * | m_pOgre |
Ogre main object used for rendering. | |
Ogre::LogManager * | m_pLogManager |
Ogre::RenderWindow * | m_pOgreWindow |
Ogre::SceneManager * | m_pSceneManager |
Ogre::Camera * | m_pOgreCamera |
Ogre::Viewport * | m_pOgreViewport |
bool | m_status |
One of these :
| |
std::map < std::string, DynamicTexture > | m_mapDynamicTextures |
Map of dynamic textures. | |
std::map < std::string, Ogre::Overlay * > | m_mapOverlays |
Map of overlays. | |
Static Private Attributes | |
static RenderSystem * | sm_pSingleton = NULL |
Singleton instance. | |
Classes | |
struct | DynamicTexture |
Structure holding dynamic texture informations. More... |
This is the main class of the rendering system.
syBR::Renderer::RenderSystem::RenderSystem | ( | const std::string & | ogreLogPrefix, | |
Core::Logger * | pLogger | |||
) | [private] |
syBR::Renderer::RenderSystem::~RenderSystem | ( | ) | [private] |
Destructor.
bool syBR::Renderer::RenderSystem::initializeSingleton | ( | const std::string & | ogreLogPrefix, | |
Core::Logger * | pLogger | |||
) | [static] |
Initialize singleton.
Create a new instance of the render system only if none already exists.
ogreLogPrefix | Prefix to use for the name of the Ogre3D log file, so that it will be {ogreLogPrefix}-ogre3d.log | |
pLogger | Pointer to the instance of the logger to use |
RenderSystem * syBR::Renderer::RenderSystem::getSingleton | ( | ) | [static] |
Retrieve singleton instance.
void syBR::Renderer::RenderSystem::terminateSingleton | ( | Core::Logger * | pLogger | ) | [static] |
Terminate singleton.
pLogger | Pointer to the instance of the logger to use |
bool syBR::Renderer::RenderSystem::initialize | ( | const bool | sceneManager | ) |
Initialize renderer.
Initialize Ogre rendering engine and the scene manager if requested
sceneManager | true to create a sceneManager and default viewport false otherwise |
void syBR::Renderer::RenderSystem::update | ( | ) |
Update rendering system.
void syBR::Renderer::RenderSystem::present | ( | ) |
Present rendered graphics to the screen.
bool syBR::Renderer::RenderSystem::getStatus | ( | ) | const |
Get status of the rendering system.
This function is present in order the rendering system to be able to warn the game system that its window has been destroyed.
void * syBR::Renderer::RenderSystem::getWindowHandle | ( | ) | const |
Get window handle.
Ogre::Root * syBR::Renderer::RenderSystem::getOgre | ( | ) | const |
Ogre::SceneManager * syBR::Renderer::RenderSystem::getSceneManager | ( | ) | const |
Get main scene manager.
Ogre::RenderWindow * syBR::Renderer::RenderSystem::getRenderWindow | ( | ) | const |
Get rendering window.
bool syBR::Renderer::RenderSystem::loadTexture | ( | const std::string & | texture | ) |
Load texture.
texture | Name of the texture to load |
bool syBR::Renderer::RenderSystem::createDynamicTexture | ( | const std::string & | name, | |
const unsigned int | width, | |||
const unsigned int | height | |||
) |
Create a dynamic texture.
name | Name of the dynamic texture | |
width | Width of the texture | |
height | Height of the texture |
bool syBR::Renderer::RenderSystem::updateDynamicTexture | ( | const std::string & | name, | |
const unsigned char * | data, | |||
const unsigned int | dataRowStride | |||
) |
Update a dynamic texture.
name | Name of the dynamic texture to update | |
data | Data to be copied to the texture | |
dataRowStride | Stride of the data to be copied to the texture |
void syBR::Renderer::RenderSystem::deleteDynamicTexture | ( | const std::string & | name | ) |
Delete a dynamic texture.
name | Name of the dynamic texture to delete |
bool syBR::Renderer::RenderSystem::createOverlay | ( | const std::string & | name, | |
const std::string & | material, | |||
const bool | dynamicTextureMaterial, | |||
const float | x, | |||
const float | y, | |||
const float | width, | |||
const float | height | |||
) |
Create an overlay.
name | Name of the overlay to create | |
material | Name of the material to use | |
dynamicTextureMaterial | One of these:
| |
x | Horizontal position of the overlay | |
y | Vertical position of the overlay | |
width | Width of the overlay | |
height | Height of the overlay |
void syBR::Renderer::RenderSystem::deleteOverlay | ( | const std::string & | name | ) |
RenderSystem * syBR::Renderer::RenderSystem::sm_pSingleton = NULL [static, private] |
Singleton instance.
Pointer to the logger to be used.
Ogre::Root* syBR::Renderer::RenderSystem::m_pOgre [private] |
Ogre main object used for rendering.
Ogre::LogManager* syBR::Renderer::RenderSystem::m_pLogManager [private] |
Ogre::RenderWindow* syBR::Renderer::RenderSystem::m_pOgreWindow [private] |
Ogre::SceneManager* syBR::Renderer::RenderSystem::m_pSceneManager [private] |
Ogre::Camera* syBR::Renderer::RenderSystem::m_pOgreCamera [private] |
Ogre::Viewport* syBR::Renderer::RenderSystem::m_pOgreViewport [private] |
bool syBR::Renderer::RenderSystem::m_status [private] |
One of these :
std::map<std::string, DynamicTexture> syBR::Renderer::RenderSystem::m_mapDynamicTextures [private] |
Map of dynamic textures.
std::map<std::string, Ogre::Overlay*> syBR::Renderer::RenderSystem::m_mapOverlays [private] |
Map of overlays.
Copyright © 2008 by Sebastien Frippiat
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License.
Last modified Tue Dec 30 17:57:34 2008