OGRE
13.6
Object-Oriented Graphics Rendering Engine
|
Base class responsible for setting up a common context for applications. More...
#include <OgreApplicationContextBase.h>
Public Member Functions | |
ApplicationContextBase (const Ogre::String &appName="Ogre3D") | |
virtual | ~ApplicationContextBase () |
void | _fireInputEvent (const Event &event, uint32_t windowID) const |
inspect the event and call one of the corresponding functions on the registered InputListener More... | |
void | addInputListener (InputListener *lis) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
virtual void | addInputListener (NativeWindowType *win, 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... | |
virtual NativeWindowPair | createWindow (const Ogre::String &name, uint32_t w=0, uint32_t h=0, Ogre::NameValuePairList miscParams=Ogre::NameValuePairList()) |
Create a new render window. More... | |
void | destroyDummyScene () |
Destroys dummy scene. More... | |
void | destroyRTShaderSystem () |
Destroy the RT Shader system. More... | |
void | destroyWindow (const Ogre::String &name) |
destroy and erase an NativeWindowPair by name More... | |
void | enableShaderCache () const |
enables the caching of compiled shaders to file More... | |
bool | frameEnded (const Ogre::FrameEvent &evt) override |
Called just after a frame has been rendered. More... | |
bool | frameRenderingQueued (const Ogre::FrameEvent &evt) override |
Called after all render targets have had their rendering commands issued, but before render windows have been asked to flip their buffers over. More... | |
bool | frameStarted (const Ogre::FrameEvent &evt) override |
Called when a frame is about to begin rendering. More... | |
virtual float | getDisplayDPI () const |
get the vertical DPI of the display More... | |
Ogre::FileSystemLayer & | getFSLayer () |
get the FileSystemLayer instace pointing to an application specific directory More... | |
Ogre::OverlaySystem * | getOverlaySystem () const |
Ogre::RenderWindow * | getRenderWindow () const |
get the main RenderWindow owns the context on OpenGL More... | |
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... | |
virtual void | pollEvents () |
process all window events since last call More... | |
virtual void | reconfigure (const Ogre::String &renderer, Ogre::NameValuePairList &options) |
Reconfigures the context. More... | |
void | removeInputListener (InputListener *lis) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
virtual void | removeInputListener (NativeWindowType *win, InputListener *lis) |
detatch 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... | |
void | setWindowGrab (bool grab=true) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
virtual void | setWindowGrab (NativeWindowType *win, bool grab=true) |
When input is grabbed the mouse is confined to the window. 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) |
Public Member Functions inherited from Ogre::FrameListener | |
virtual | ~FrameListener () |
Static Public Member Functions | |
static Ogre::String | getDefaultMediaDir () |
the directory where the media files were installed More... | |
Base class responsible for setting up a common context for applications.
Subclass to implement specific event callbacks.
|
explicit |
|
virtual |
|
inline |
get the main RenderWindow owns the context on OpenGL
|
inline |
|
inline |
void OgreBites::ApplicationContextBase::initApp | ( | ) |
This function initializes the render system and resources.
void OgreBites::ApplicationContextBase::closeApp | ( | ) |
This function closes down the application - saves the configuration then shutdowns.
|
inlineoverridevirtual |
Called when a frame is about to begin rendering.
Reimplemented from Ogre::FrameListener.
|
overridevirtual |
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.
|
inlineoverridevirtual |
Called just after a frame has been rendered.
Reimplemented from Ogre::FrameListener.
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
void OgreBites::ApplicationContextBase::_fireInputEvent | ( | const Event & | event, |
uint32_t | windowID | ||
) | const |
inspect the event and call one of the corresponding functions on the registered InputListener
event | Input Event |
windowID | only call listeners of this window |
bool OgreBites::ApplicationContextBase::initialiseRTShaderSystem | ( | ) |
Initialize the RT Shader system.
void OgreBites::ApplicationContextBase::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 | Whether to write out the generated shaders |
void OgreBites::ApplicationContextBase::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.
|
inlinevirtual |
When input is grabbed the mouse is confined to the window.
Reimplemented in OgreBites::ApplicationContextQt.
|
inlinevirtual |
get the vertical DPI of the display
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
References OgreAssert.
|
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.
Reimplemented in OgreBites::ApplicationContextQt.
|
virtual |
process all window events since last call
Reimplemented in OgreBites::ApplicationContextQt.
void OgreBites::ApplicationContextBase::createDummyScene | ( | ) |
Creates dummy scene to allow rendering GUI in viewport.
void OgreBites::ApplicationContextBase::destroyDummyScene | ( | ) |
Destroys dummy scene.
void OgreBites::ApplicationContextBase::enableShaderCache | ( | ) | const |
enables the caching of compiled shaders to file
also loads any existing cache
|
virtual |
attach input listener
lis | the listener |
win | the window to receive the events for. |
Reimplemented in OgreBites::ApplicationContextQt.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
References OgreAssert.
|
virtual |
detatch input listener
lis | the listener |
win | the window to receive the events for. |
Reimplemented in OgreBites::ApplicationContextQt.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
References OgreAssert.
|
virtual |
Create a new render window.
You must use SDL and not an auto-created window as SDL does not get the events otherwise.
By default the values from ogre.cfg are used for w, h and miscParams.
Reimplemented in OgreBites::ApplicationContextQt.
void OgreBites::ApplicationContextBase::destroyWindow | ( | const Ogre::String & | name | ) |
destroy and erase an NativeWindowPair by name
|
inline |
get the FileSystemLayer instace pointing to an application specific directory
|
static |
the directory where the media files were installed
same as OGRE_MEDIA_DIR in CMake