![]() |
OGRE
1.10.4
Object-Oriented Graphics Rendering Engine
|
Base class responsible for setting up a common context for applications. More...
#include <OgreApplicationContext.h>
Public Member Functions | |
ApplicationContext (const Ogre::String &appName=OGRE_VERSION_NAME, bool grabInput=true) | |
virtual | ~ApplicationContext () |
void | _fireInputEvent (const Event &event) const |
inspect the event and call one of the corresponding functions on the registered InputListener More... | |
void | addInputListener (InputListener *lis) |
attach input listener More... | |
void | closeApp () |
This function closes down the application - saves the configuration then shutdowns. More... | |
void | createDummyScene () |
Creates dummy scene to allow rendering GUI in viewport. More... | |
virtual void | createRoot () |
Creates the OGRE root. More... | |
void | destroyDummyScene () |
Destroys dummy scene. More... | |
void | destroyRTShaderSystem () |
Destroy the RT Shader system. More... | |
void | enableShaderCache () const |
enables the caching of compiled shaders to file More... | |
virtual bool | frameEnded (const Ogre::FrameEvent &evt) |
Called just after a frame has been rendered. More... | |
virtual bool | frameRenderingQueued (const Ogre::FrameEvent &evt) |
Called after all render targets have had their rendering commands issued, but before render windows have been asked to flip their buffers over. More... | |
virtual bool | frameStarted (const Ogre::FrameEvent &evt) |
Called when a frame is about to begin rendering. More... | |
Ogre::OverlaySystem * | getOverlaySystem () const |
Ogre::RenderWindow * | getRenderWindow () const |
Ogre::Root * | getRoot () const |
void | initApp () |
This function initializes the render system and resources. More... | |
bool | initialiseRTShaderSystem () |
Initialize the RT Shader system. More... | |
virtual void | loadResources () |
Loads context-wide resource groups. More... | |
virtual void | locateResources () |
Finds context-wide resource groups. More... | |
virtual bool | oneTimeConfig () |
Configures the startup settings for OGRE. More... | |
void | pollEvents () |
poll for any events for the main window More... | |
virtual void | reconfigure (const Ogre::String &renderer, Ogre::NameValuePairList &options) |
Reconfigures the context. More... | |
void | removeInputListener (InputListener *lis) |
detach input listener More... | |
void | setRTSSWriteShadersToDisk (bool write) |
make the RTSS write out the generated shaders for caching and debugging More... | |
virtual void | setup () |
Sets up the context after configuration. More... | |
virtual void | setupInput (bool grab) |
Sets up SDL input. More... | |
virtual void | shutdown () |
Cleans up and shuts down the context. More... | |
virtual void | windowClosed (Ogre::RenderWindow *rw) |
virtual bool | windowClosing (Ogre::RenderWindow *rw) |
virtual void | windowFocusChange (Ogre::RenderWindow *rw) |
virtual void | windowMoved (Ogre::RenderWindow *rw) |
virtual void | windowResized (Ogre::RenderWindow *rw) |
Base class responsible for setting up a common context for applications.
Subclass to implement specific event callbacks.
|
explicit |
|
virtual |
|
inline |
|
inline |
|
inline |
void OgreBites::ApplicationContext::initApp | ( | ) |
This function initializes the render system and resources.
void OgreBites::ApplicationContext::closeApp | ( | ) |
This function closes down the application - saves the configuration then shutdowns.
|
inlinevirtual |
Called when a frame is about to begin rendering.
Reimplemented from Ogre::FrameListener.
|
virtual |
Called after all render targets have had their rendering commands issued, but before render windows have been asked to flip their buffers over.
Reimplemented from Ogre::FrameListener.
|
inlinevirtual |
Called just after a frame has been rendered.
Reimplemented from Ogre::FrameListener.
|
inlinevirtual |
rw | The RenderWindow which created this events |
Reimplemented from Ogre::WindowEventListener.
|
inlinevirtual |
rw | The RenderWindow which created this events |
Reimplemented from Ogre::WindowEventListener.
|
inlinevirtual |
rw | The RenderWindow which created this events |
Reimplemented from Ogre::WindowEventListener.
|
inlinevirtual |
rw | The RenderWindow which created this events |
Reimplemented from Ogre::WindowEventListener.
|
inlinevirtual |
rw | The RenderWindow which created this events |
Reimplemented from Ogre::WindowEventListener.
void OgreBites::ApplicationContext::_fireInputEvent | ( | const Event & | event | ) | const |
inspect the event and call one of the corresponding functions on the registered InputListener
event | Input Event |
bool OgreBites::ApplicationContext::initialiseRTShaderSystem | ( | ) |
Initialize the RT Shader system.
void OgreBites::ApplicationContext::setRTSSWriteShadersToDisk | ( | bool | write | ) |
make the RTSS write out the generated shaders for caching and debugging
by default all shaders are generated to system memory. Must be called before loadResources
write |
void OgreBites::ApplicationContext::destroyRTShaderSystem | ( | ) |
Destroy the RT Shader system.
|
virtual |
Sets up the context after configuration.
|
virtual |
Creates the OGRE root.
|
virtual |
Configures the startup settings for OGRE.
I use the config dialog here, but you can also restore from a config file. Note that this only happens when you start the context, and not when you reset it.
|
virtual |
Sets up SDL input.
|
virtual |
Finds context-wide resource groups.
I load paths from a config file here, but you can choose your resource locations however you want.
|
virtual |
Loads context-wide resource groups.
I chose here to simply initialise all groups, but you can fully load specific ones if you wish.
|
virtual |
Reconfigures the context.
Attempts to preserve the current sample state.
|
virtual |
Cleans up and shuts down the context.
void OgreBites::ApplicationContext::pollEvents | ( | ) |
poll for any events for the main window
void OgreBites::ApplicationContext::createDummyScene | ( | ) |
Creates dummy scene to allow rendering GUI in viewport.
void OgreBites::ApplicationContext::destroyDummyScene | ( | ) |
Destroys dummy scene.
void OgreBites::ApplicationContext::enableShaderCache | ( | ) | const |
enables the caching of compiled shaders to file
also loads any existing cache
|
inline |
attach input listener
|
inline |
detach input listener