Elaztek Developer Hub
Blamite Game Engine - blam!  00398.09.22.23.2015.blamite
The core library for the Blamite Game Engine.
Demo::GraphicsSystem Class Reference

#include <GraphicsSystem.h>

+ Inheritance diagram for Demo::GraphicsSystem:
+ Collaboration diagram for Demo::GraphicsSystem:

Public Member Functions

 GraphicsSystem (GameState *gameState=nullptr, Ogre::String resourcePath=Ogre::String(""), Ogre::ColourValue backgroundColour=Ogre::ColourValue(0.2f, 0.4f, 0.6f))
 
virtual ~GraphicsSystem ()
 
void _notifyLogicSystem (BaseSystem *logicSystem)
 
void initialize (const Ogre::String &windowTitle)
 
void deinitialize (void)
 
void update (float timeSinceLast)
 
void updateGameEntities (const GameEntityVec &gameEntities, float weight)
 Updates the SceneNodes of all the game entities in the container, interpolating them according to weight, reading the transforms from mCurrentTransformIdx and mCurrentTransformIdx-1. More...
 
virtual void execute (size_t threadId, size_t numThreads)
 Overload Ogre::UniformScalableTask. More...
 
const GameEntityVecgetGameEntities (Ogre::SceneMemoryMgrTypes type) const
 Returns the GameEntities that are ready to be rendered. More...
 
void setQuit (void)
 
bool getQuit (void) const
 
float getAccumTimeSinceLastLogicFrame (void) const
 
Ogre::Root * getRoot (void) const
 
Ogre::Window * getRenderWindow (void) const
 
Ogre::SceneManager * getSceneManager (void) const
 
Ogre::Camera * getCamera (void) const
 
Ogre::CompositorWorkspace * getCompositorWorkspace (void) const
 
Ogre::v1::OverlaySystem * getOverlaySystem (void) const
 
void setAlwaysAskForConfig (bool alwaysAskForConfig)
 
bool getAlwaysAskForConfig (void) const
 
const Ogre::String & getPluginsFolder (void) const
 
const Ogre::String & getWriteAccessFolder (void) const
 
const Ogre::String & getResourcePath (void) const
 
const char * getMediaReadArchiveType (void) const
 
virtual void stopCompositor (void)
 
virtual void restartCompositor (void)
 
- Public Member Functions inherited from Demo::BaseSystem
 BaseSystem (GameState *gameState=nullptr)
 
virtual ~BaseSystem ()
 
virtual void initialize (void)
 
virtual void createScene01 (void)
 
virtual void createScene02 (void)
 
virtual void destroyScene (void)
 
void beginFrameParallel (void)
 
void update (float timeSinceLast)
 
void finishFrameParallel (void)
 
void finishFrame (void)
 
- Public Member Functions inherited from Demo::Mq::MessageQueueSystem
virtual ~MessageQueueSystem ()
 
template<typename T >
void queueSendMessage (MessageQueueSystem *dstSystem, Mq::MessageId messageId, const T &msg)
 Queues message 'msg' to be sent to a destination MessageQueueSystem. More...
 
void flushQueuedMessages (void)
 Sends all the messages queued via see queueSendMessage(); Must be called from the thread that owns 'this'. More...
 
template<typename T >
void receiveMessageImmediately (Mq::MessageId messageId, const T &msg)
 Sends a message to 'this' base system immediately. More...
 

Public Attributes

size_t debug_mode_thread_count = 1
 
BlamCompositorPassRegistryogre_pass_registry = nullptr
 

Protected Member Functions

bool isWriteAccessFolder (const Ogre::String &folderPath, const Ogre::String &fileToSave)
 
virtual void processIncomingMessage (Mq::MessageId messageId, const void *data)
 
void loadTextureCache (void)
 
void saveTextureCache (void)
 
void loadHlmsDiskCache (void)
 
void saveHlmsDiskCache (void)
 
virtual void setupResources (void)
 
virtual void registerHlms (void)
 
virtual void loadResources (void)
 Optional override method where you can perform resource group loading Must at least do ResourceGroupManager::getSingleton().initialiseAllResourceGroups();. More...
 
virtual void chooseSceneManager (void)
 
virtual void createCamera (void)
 
virtual Ogre::CompositorWorkspace * setupCompositor (void)
 Virtual so that advanced samples such as Sample_Compositor can override this method to change the default behavior if setupCompositor() is overridden, be aware @mBackgroundColour will be ignored. More...
 
virtual void initMiscParamsListener (Ogre::NameValuePairList &params)
 Called right before initializing Ogre's first window, so the params can be customized. More...
 
virtual void createResourceListener (void)
 Optional override method where you can create resource listeners (e.g. for loading screens) More...
 
void gameEntityAdded (const GameEntityManager::CreatedGameEntity *createdGameEntity)
 
void gameEntityRemoved (GameEntity *toRemove)
 
- Protected Member Functions inherited from Demo::Mq::MessageQueueSystem
void processIncomingMessages (void)
 Processes all incoming messages received from other threads. More...
 

Static Protected Member Functions

static void addResourceLocation (const Ogre::String &archName, const Ogre::String &typeName, const Ogre::String &secName)
 

Protected Attributes

BaseSystemmLogicSystem
 
Ogre::Root * mRoot
 
Ogre::Window * mRenderWindow
 
Ogre::SceneManager * mSceneManager
 
Ogre::Camera * mCamera
 
Ogre::CompositorWorkspace * mWorkspace
 
Ogre::String mPluginsFolder
 
Ogre::String mWriteAccessFolder
 
Ogre::String mResourcePath
 
Ogre::v1::OverlaySystem * mOverlaySystem
 
StaticPluginLoader mStaticPluginLoader
 
float mAccumTimeSinceLastLogicFrame
 Tracks the amount of elapsed time since we last heard from the LogicSystem finishing a frame. More...
 
Ogre::uint32 mCurrentTransformIdx
 
GameEntityVec mGameEntities [Ogre::NUM_SCENE_MEMORY_MANAGER_TYPES]
 
const GameEntityVecmThreadGameEntityToUpdate
 
float mThreadWeight
 
bool mQuit
 
bool mAlwaysAskForConfig
 
bool mUseHlmsDiskCache
 
bool mUseMicrocodeCache
 
Ogre::ColourValue mBackgroundColour
 
- Protected Attributes inherited from Demo::BaseSystem
GameStatemCurrentGameState
 

Constructor & Destructor Documentation

◆ GraphicsSystem()

Demo::GraphicsSystem::GraphicsSystem ( GameState gameState = nullptr,
Ogre::String  resourcePath = Ogre::String(""),
Ogre::ColourValue  backgroundColour = Ogre::ColourValue( 0.2f, 0.4f, 0.6f ) 
)

◆ ~GraphicsSystem()

Demo::GraphicsSystem::~GraphicsSystem ( )
virtual

Member Function Documentation

◆ _notifyLogicSystem()

void Demo::GraphicsSystem::_notifyLogicSystem ( BaseSystem logicSystem)
inline

◆ addResourceLocation()

void Demo::GraphicsSystem::addResourceLocation ( const Ogre::String &  archName,
const Ogre::String &  typeName,
const Ogre::String &  secName 
)
staticprotected
+ Here is the caller graph for this function:

◆ chooseSceneManager()

void Demo::GraphicsSystem::chooseSceneManager ( void  )
protectedvirtual
+ Here is the caller graph for this function:

◆ createCamera()

void Demo::GraphicsSystem::createCamera ( void  )
protectedvirtual
+ Here is the caller graph for this function:

◆ createResourceListener()

virtual void Demo::GraphicsSystem::createResourceListener ( void  )
inlineprotectedvirtual

Optional override method where you can create resource listeners (e.g. for loading screens)

◆ deinitialize()

void Demo::GraphicsSystem::deinitialize ( void  )
virtual

Reimplemented from Demo::BaseSystem.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ execute()

void Demo::GraphicsSystem::execute ( size_t  threadId,
size_t  numThreads 
)
virtual

Overload Ogre::UniformScalableTask.

See also
updateGameEntities

◆ gameEntityAdded()

void Demo::GraphicsSystem::gameEntityAdded ( const GameEntityManager::CreatedGameEntity createdGameEntity)
protected
+ Here is the caller graph for this function:

◆ gameEntityRemoved()

void Demo::GraphicsSystem::gameEntityRemoved ( GameEntity toRemove)
protected
+ Here is the caller graph for this function:

◆ getAccumTimeSinceLastLogicFrame()

float Demo::GraphicsSystem::getAccumTimeSinceLastLogicFrame ( void  ) const
inline

◆ getAlwaysAskForConfig()

bool Demo::GraphicsSystem::getAlwaysAskForConfig ( void  ) const
inline

◆ getCamera()

Ogre::Camera* Demo::GraphicsSystem::getCamera ( void  ) const
inline
+ Here is the caller graph for this function:

◆ getCompositorWorkspace()

Ogre::CompositorWorkspace* Demo::GraphicsSystem::getCompositorWorkspace ( void  ) const
inline

◆ getGameEntities()

const GameEntityVec& Demo::GraphicsSystem::getGameEntities ( Ogre::SceneMemoryMgrTypes  type) const
inline

Returns the GameEntities that are ready to be rendered.

May include entities that are scheduled to be removed (i.e. they are no longer updated by logic)

◆ getMediaReadArchiveType()

const char * Demo::GraphicsSystem::getMediaReadArchiveType ( void  ) const
+ Here is the caller graph for this function:

◆ getOverlaySystem()

Ogre::v1::OverlaySystem* Demo::GraphicsSystem::getOverlaySystem ( void  ) const
inline

◆ getPluginsFolder()

const Ogre::String& Demo::GraphicsSystem::getPluginsFolder ( void  ) const
inline

◆ getQuit()

bool Demo::GraphicsSystem::getQuit ( void  ) const
inline
+ Here is the caller graph for this function:

◆ getRenderWindow()

Ogre::Window* Demo::GraphicsSystem::getRenderWindow ( void  ) const
inline
+ Here is the caller graph for this function:

◆ getResourcePath()

const Ogre::String& Demo::GraphicsSystem::getResourcePath ( void  ) const
inline

◆ getRoot()

Ogre::Root* Demo::GraphicsSystem::getRoot ( void  ) const
inline
+ Here is the caller graph for this function:

◆ getSceneManager()

Ogre::SceneManager* Demo::GraphicsSystem::getSceneManager ( void  ) const
inline
+ Here is the caller graph for this function:

◆ getWriteAccessFolder()

const Ogre::String& Demo::GraphicsSystem::getWriteAccessFolder ( void  ) const
inline

◆ initialize()

void Demo::GraphicsSystem::initialize ( const Ogre::String &  windowTitle)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initMiscParamsListener()

void Demo::GraphicsSystem::initMiscParamsListener ( Ogre::NameValuePairList &  params)
protectedvirtual

Called right before initializing Ogre's first window, so the params can be customized.

+ Here is the caller graph for this function:

◆ isWriteAccessFolder()

bool Demo::GraphicsSystem::isWriteAccessFolder ( const Ogre::String &  folderPath,
const Ogre::String &  fileToSave 
)
protected

◆ loadHlmsDiskCache()

void Demo::GraphicsSystem::loadHlmsDiskCache ( void  )
protected
+ Here is the caller graph for this function:

◆ loadResources()

void Demo::GraphicsSystem::loadResources ( void  )
protectedvirtual

Optional override method where you can perform resource group loading Must at least do ResourceGroupManager::getSingleton().initialiseAllResourceGroups();.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadTextureCache()

void Demo::GraphicsSystem::loadTextureCache ( void  )
protected
+ Here is the caller graph for this function:

◆ processIncomingMessage()

void Demo::GraphicsSystem::processIncomingMessage ( Mq::MessageId  messageId,
const void *  data 
)
protectedvirtual
See also
MessageQueueSystem::processIncomingMessage

Implements Demo::Mq::MessageQueueSystem.

+ Here is the call graph for this function:

◆ registerHlms()

void Demo::GraphicsSystem::registerHlms ( void  )
protectedvirtual
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ restartCompositor()

void Demo::GraphicsSystem::restartCompositor ( void  )
virtual
+ Here is the call graph for this function:

◆ saveHlmsDiskCache()

void Demo::GraphicsSystem::saveHlmsDiskCache ( void  )
protected
+ Here is the caller graph for this function:

◆ saveTextureCache()

void Demo::GraphicsSystem::saveTextureCache ( void  )
protected
+ Here is the caller graph for this function:

◆ setAlwaysAskForConfig()

void Demo::GraphicsSystem::setAlwaysAskForConfig ( bool  alwaysAskForConfig)
+ Here is the caller graph for this function:

◆ setQuit()

void Demo::GraphicsSystem::setQuit ( void  )
inline

◆ setupCompositor()

Ogre::CompositorWorkspace * Demo::GraphicsSystem::setupCompositor ( void  )
protectedvirtual

Virtual so that advanced samples such as Sample_Compositor can override this method to change the default behavior if setupCompositor() is overridden, be aware @mBackgroundColour will be ignored.

+ Here is the caller graph for this function:

◆ setupResources()

void Demo::GraphicsSystem::setupResources ( void  )
protectedvirtual
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ stopCompositor()

void Demo::GraphicsSystem::stopCompositor ( void  )
virtual
+ Here is the caller graph for this function:

◆ update()

void Demo::GraphicsSystem::update ( float  timeSinceLast)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateGameEntities()

void Demo::GraphicsSystem::updateGameEntities ( const GameEntityVec gameEntities,
float  weight 
)

Updates the SceneNodes of all the game entities in the container, interpolating them according to weight, reading the transforms from mCurrentTransformIdx and mCurrentTransformIdx-1.

Parameters
gameEntitiesThe container with entities to update.
weightThe interpolation weight, ideally in range [0; 1]

Member Data Documentation

◆ debug_mode_thread_count

size_t Demo::GraphicsSystem::debug_mode_thread_count = 1

◆ mAccumTimeSinceLastLogicFrame

float Demo::GraphicsSystem::mAccumTimeSinceLastLogicFrame
protected

Tracks the amount of elapsed time since we last heard from the LogicSystem finishing a frame.

◆ mAlwaysAskForConfig

bool Demo::GraphicsSystem::mAlwaysAskForConfig
protected

◆ mBackgroundColour

Ogre::ColourValue Demo::GraphicsSystem::mBackgroundColour
protected

◆ mCamera

Ogre::Camera* Demo::GraphicsSystem::mCamera
protected

◆ mCurrentTransformIdx

Ogre::uint32 Demo::GraphicsSystem::mCurrentTransformIdx
protected

◆ mGameEntities

GameEntityVec Demo::GraphicsSystem::mGameEntities[Ogre::NUM_SCENE_MEMORY_MANAGER_TYPES]
protected

◆ mLogicSystem

BaseSystem* Demo::GraphicsSystem::mLogicSystem
protected

◆ mOverlaySystem

Ogre::v1::OverlaySystem* Demo::GraphicsSystem::mOverlaySystem
protected

◆ mPluginsFolder

Ogre::String Demo::GraphicsSystem::mPluginsFolder
protected

◆ mQuit

bool Demo::GraphicsSystem::mQuit
protected

◆ mRenderWindow

Ogre::Window* Demo::GraphicsSystem::mRenderWindow
protected

◆ mResourcePath

Ogre::String Demo::GraphicsSystem::mResourcePath
protected

◆ mRoot

Ogre::Root* Demo::GraphicsSystem::mRoot
protected

◆ mSceneManager

Ogre::SceneManager* Demo::GraphicsSystem::mSceneManager
protected

◆ mStaticPluginLoader

StaticPluginLoader Demo::GraphicsSystem::mStaticPluginLoader
protected

◆ mThreadGameEntityToUpdate

const GameEntityVec* Demo::GraphicsSystem::mThreadGameEntityToUpdate
protected

◆ mThreadWeight

float Demo::GraphicsSystem::mThreadWeight
protected

◆ mUseHlmsDiskCache

bool Demo::GraphicsSystem::mUseHlmsDiskCache
protected

◆ mUseMicrocodeCache

bool Demo::GraphicsSystem::mUseMicrocodeCache
protected

◆ mWorkspace

Ogre::CompositorWorkspace* Demo::GraphicsSystem::mWorkspace
protected

◆ mWriteAccessFolder

Ogre::String Demo::GraphicsSystem::mWriteAccessFolder
protected

◆ ogre_pass_registry

BlamCompositorPassRegistry* Demo::GraphicsSystem::ogre_pass_registry = nullptr

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