Om
1.0.0
A universal framework for multimedia simulation
|
A simple demo application with a single window, basic key/mouse input, and drawing. More...
#include <omSimpleDemo.h>
Classes | |
class | Delegate |
A class that represents a set of delegate methods for demo event handling. More... | |
Public Member Functions | |
SimpleDemo () | |
Create a new simple demo with the name "Simple Demo" and window size 1024x768. More... | |
SimpleDemo (const UTF8String &newName, const Size2D &newWindowSize) | |
Create a new simple demo with the specified name and window size. More... | |
virtual | ~SimpleDemo () |
virtual void | run () |
Run this demo. More... | |
void | stop () |
Stop running this demo. More... | |
Bool | getIsRunning () const |
Return whether or not the demo is currently running. More... | |
void | setIsRunning (Bool newIsRunning) |
Set whether or not the demo should be running. More... | |
Bool | getIsPaused () const |
Return whether or not the demo is currently paused. More... | |
void | setIsPaused (Bool newIsPaused) |
Set whether or not the demo should be paused. More... | |
Bool | getIsFullscreen () const |
Return whether or not the demo is currently fullscreen. More... | |
void | setIsFullscreen (Bool newIsFullscreen) |
Set whether or not the demo should be fullscreen. More... | |
const Time & | getTargetDt () const |
Return the frame time that the demo attempts to execute at (but not faster than). More... | |
void | setTargetDt (const Time &newTargetDt) |
Set the frame time that the demo attempts to execute at (but not faster than). More... | |
const Shared< GraphicsContext > & | getContext () const |
Return a pointer to the graphics context which this simple demo is using. More... | |
ResourceManager & | getResourceManager () |
Return a reference to the resource manager which this simple demo is using. More... | |
const ResourceManager & | getResourceManager () const |
Return a reference to the resource manager which this simple demo is using. More... | |
const Keyboard & | getKeyboard () const |
Return a reference to the keyboard state for this demo. More... | |
Size | getDelegateCount () const |
Return the total number of delegate objects that are responding to events for this demo. More... | |
const Delegate * | getDelegate (Index delegateIndex) const |
Return a pointer to the delegate at the specified index. More... | |
Delegate * | getDelegate (Index delegateIndex) |
Return a pointer to the delegate at the specified index. More... | |
Index | addDelegate (const Delegate &newDelegate) |
Add a new delegate to this demo. More... | |
void | clearDelegates () |
Remove all delegates from this simple demo. More... | |
base::EngineContext & | getEngine () |
Return a reference to the engine context for this demo. More... | |
const base::EngineContext & | getEngine () const |
Return a reference to the engine context for this demo. More... | |
const Time & | getLastUpdateTime () const |
Return the total time that it took to update the last frame. More... | |
const Time & | getLastDrawTime () const |
Return the total time that it took to draw the last frame. More... | |
const Time & | getLastFrameTime () const |
Return the total time that it took to complete the last frame. More... | |
Double | getCurrentFPS () const |
Return current average frames per second for the demo. More... | |
Protected Member Functions | |
virtual Bool | initialize (const Shared< GraphicsContext > &context) |
virtual void | deinitialize () |
virtual void | update (const Time &dt) |
virtual void | draw (const Shared< GraphicsContext > &context) |
virtual void | resize (const Size2D &newSize) |
virtual Bool | textEvent (const TextEvent &event) |
virtual Bool | keyEvent (const KeyEvent &event) |
virtual Bool | mouseButtonEvent (const MouseButtonEvent &event) |
virtual Bool | mouseWheelEvent (const MouseWheelEvent &event) |
virtual Bool | mouseMotionEvent (const MouseMotionEvent &event) |
A simple demo application with a single window, basic key/mouse input, and drawing.
This class provides basic functionality needed for simple demo applications where quick prototyping is important.
om::engine::SimpleDemo::SimpleDemo | ( | ) |
Create a new simple demo with the name "Simple Demo" and window size 1024x768.
om::engine::SimpleDemo::SimpleDemo | ( | const UTF8String & | newName, |
const Size2D & | newWindowSize | ||
) |
Create a new simple demo with the specified name and window size.
|
virtual |
|
virtual |
Run this demo.
void om::engine::SimpleDemo::stop | ( | ) |
Stop running this demo.
|
inline |
Return whether or not the demo is currently running.
|
inline |
Set whether or not the demo should be running.
|
inline |
Return whether or not the demo is currently paused.
|
inline |
Set whether or not the demo should be paused.
|
inline |
Return whether or not the demo is currently fullscreen.
|
inline |
Set whether or not the demo should be fullscreen.
|
inline |
Return the frame time that the demo attempts to execute at (but not faster than).
|
inline |
Set the frame time that the demo attempts to execute at (but not faster than).
|
inline |
Return a pointer to the graphics context which this simple demo is using.
If the demo has not yet been started or the context was not able to be created, this method returns NULL.
|
inline |
Return a reference to the resource manager which this simple demo is using.
|
inline |
Return a reference to the resource manager which this simple demo is using.
|
inline |
Return a reference to the keyboard state for this demo.
|
inline |
Return the total number of delegate objects that are responding to events for this demo.
Return a pointer to the delegate at the specified index.
The method returns NULL if the specified delegate index is invalid.
Return a pointer to the delegate at the specified index.
The method returns NULL if the specified delegate index is invalid.
Add a new delegate to this demo.
The method returns the index of the new delegate.
|
inline |
Remove all delegates from this simple demo.
|
inline |
Return a reference to the engine context for this demo.
|
inline |
Return a reference to the engine context for this demo.
|
inline |
Return the total time that it took to update the last frame.
|
inline |
Return the total time that it took to draw the last frame.
|
inline |
Return the total time that it took to complete the last frame.
|
inline |
Return current average frames per second for the demo.
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |