Crazy Eddie's GUI System  ${CEGUI_VERSION}
SamplesFrameworkBase Class Referenceabstract

This is a base class that is intended to be used for all sample applications. Here we take care of common things such the renderer selection and application startup. More...

+ Inheritance diagram for SamplesFrameworkBase:
+ Collaboration diagram for SamplesFrameworkBase:

Public Member Functions

 SamplesFrameworkBase ()
 Constructor.
 
virtual ~SamplesFrameworkBase ()
 Destructor.
 
int run (const CEGUI::String &dataPathPrefixOverride)
 Application entry point. More...
 
virtual bool initialise (const CEGUI::String &logFile, const CEGUI::String &dataPathPrefixOverride)
 Initialises the sample system, this includes asking the user for a render to use and the subsequent creation of the required systems to support that renderer. More...
 
virtual void cleanup ()
 
virtual void update (float passedTime)=0
 Update function called before rendering.
 
virtual void handleNewWindowSize (float width, float height)=0
 Update function for window size changes.
 
void renderSingleFrame (float elapsed)
 
virtual void renderGUIContexts ()=0
 Draw function to draw GUIContexts.
 
virtual bool injectKeyDown (const CEGUI::Key::Scan &ceguiKey)=0
 Function to inject key down to GUIContexts. More...
 
virtual bool injectKeyUp (const CEGUI::Key::Scan &ceguiKey)=0
 Function to inject key up to GUIContexts. More...
 
virtual bool injectChar (int character)=0
 Function to inject characters to GUIContexts. More...
 
virtual bool injectMouseButtonDown (const CEGUI::MouseButton &ceguiMouseButton)=0
 Function to inject mouse button down to GUIContexts. More...
 
virtual bool injectMouseButtonUp (const CEGUI::MouseButton &ceguiMouseButton)=0
 Function to inject mouse button up to GUIContexts. More...
 
virtual bool injectMouseWheelChange (float position)=0
 Function to inject mouse wheel changes to GUIContexts. More...
 
virtual bool injectMousePosition (float x, float y)=0
 Function to inject the mouse position to GUIContexts. More...
 
virtual void setQuitting (bool quit)
 Function to set the bool defining if the application should quit as soon as possible.
 
bool isQuitting ()
 Function returning if the application should quit as soon as possible. More...
 
void setApplicationWindowSize (int width, int height)
 Function setting the application window's size.
 
void outputExceptionMessage (const char *message)
 Output a message to the user in some OS independant way.
 

Protected Attributes

CEGuiRendererSelectord_rendererSelector
 Points to the renderer selector object.
 
CEGuiBaseApplicationd_baseApp
 Pointer to the base application object.
 
bool d_quitting
 Bool defining if application should quit.
 
int d_appWindowWidth
 Int defining the application window's width.
 
int d_appWindowHeight
 Int defining the application window's height.
 

Detailed Description

This is a base class that is intended to be used for all sample applications. Here we take care of common things such the renderer selection and application startup.

Member Function Documentation

bool SamplesFrameworkBase::initialise ( const CEGUI::String logFile,
const CEGUI::String dataPathPrefixOverride 
)
virtual

Initialises the sample system, this includes asking the user for a render to use and the subsequent creation of the required systems to support that renderer.

Returns
false if anything went wrong.

Reimplemented in SamplesFramework.

References CEGuiBaseApplication::cleanup(), d_baseApp, d_rendererSelector, CEGuiRendererSelector::getSelectedRendererType(), CEGuiBaseApplication::init(), CEGuiRendererSelector::invokeDialog(), CEGuiBaseApplication::renderSingleFrame(), and CEGuiRendererSelector::setRendererAvailability().

Referenced by SamplesFramework::initialise(), and run().

virtual bool SamplesFrameworkBase::injectChar ( int  character)
pure virtual

Function to inject characters to GUIContexts.

Returns
true if event was handled.

Implemented in SamplesFramework.

Referenced by CEGuiGLFWSharedBase::endRendering().

virtual bool SamplesFrameworkBase::injectKeyDown ( const CEGUI::Key::Scan &  ceguiKey)
pure virtual

Function to inject key down to GUIContexts.

Returns
true if event was handled.

Implemented in SamplesFramework.

Referenced by CEGuiGLFWSharedBase::endRendering().

virtual bool SamplesFrameworkBase::injectKeyUp ( const CEGUI::Key::Scan &  ceguiKey)
pure virtual

Function to inject key up to GUIContexts.

Returns
true if event was handled.

Implemented in SamplesFramework.

Referenced by CEGuiGLFWSharedBase::endRendering().

virtual bool SamplesFrameworkBase::injectMouseButtonDown ( const CEGUI::MouseButton ceguiMouseButton)
pure virtual

Function to inject mouse button down to GUIContexts.

Returns
true if event was handled.

Implemented in SamplesFramework.

Referenced by CEGuiGLFWSharedBase::endRendering().

virtual bool SamplesFrameworkBase::injectMouseButtonUp ( const CEGUI::MouseButton ceguiMouseButton)
pure virtual

Function to inject mouse button up to GUIContexts.

Returns
true if event was handled.

Implemented in SamplesFramework.

Referenced by CEGuiGLFWSharedBase::endRendering().

virtual bool SamplesFrameworkBase::injectMousePosition ( float  x,
float  y 
)
pure virtual

Function to inject the mouse position to GUIContexts.

Returns
true if event was handled.

Implemented in SamplesFramework.

Referenced by CEGuiGLFWSharedBase::endRendering().

virtual bool SamplesFrameworkBase::injectMouseWheelChange ( float  position)
pure virtual

Function to inject mouse wheel changes to GUIContexts.

Returns
true if event was handled.

Implemented in SamplesFramework.

Referenced by CEGuiGLFWSharedBase::endRendering().

bool SamplesFrameworkBase::isQuitting ( )

Function returning if the application should quit as soon as possible.

Returns
true if should quit.

References d_quitting.

Referenced by CEGuiGLFWSharedBase::run().

int SamplesFrameworkBase::run ( const CEGUI::String dataPathPrefixOverride)

Application entry point.

Returns
code to be returned by the application.

References d_baseApp, initialise(), outputExceptionMessage(), and CEGuiBaseApplication::run().