Om
1.0.0
A universal framework for multimedia simulation
|
A class that facilitates creation of a graphics rendering context that renders to one or more gui::RenderView. More...
#include <omGraphicsContextRenderer.h>
Classes | |
class | Delegate |
A class that contains function objects that recieve context renderer events. More... | |
Public Member Functions | |
GraphicsContextRenderer () | |
Create a default graphics context renderer. More... | |
~GraphicsContextRenderer () | |
Destroy this context renderer, releasing all non-shared resources. More... | |
Size | getViewCount () const |
Return the number of target render views that this context renderer has. More... | |
RenderView * | getView (Index viewIndex) const |
Return a pointer to the target render view at the specified index. More... | |
const Delegate & | getViewDelegate (Index viewIndex) const |
Return a const reference to the delegate for the target render view at the specified index. More... | |
void | setViewDelegate (Index viewIndex, const Delegate &newDelegate) |
Set the delegate for the target render view at the specified index. More... | |
Bool | addView (RenderView *newView) |
Add a new target view that this context renderer should draw to. More... | |
Bool | addView (RenderView *newView, const Delegate &delegate) |
Add a new target view and associated delegate that this context renderer should draw to. More... | |
Bool | removeView (RenderView *view) |
Remove a target view that this context renderer should no longer draw to. More... | |
void | clearViews () |
Remove all target render views from this context renderer. More... | |
Bool | startDrawing (const GraphicsDeviceType &deviceType, const RenderedPixelFormat &pixelFormat, const GraphicsContextFlags &flags) |
Start a background rendering thread for the context renderer that creates a context with the given attributes. More... | |
void | stopDrawing () |
A method called when the user want to stop the rendering thread for this view. More... | |
Bool | isDrawing () const |
Return whether or not the context renderer is currently drawing. More... | |
const Shared< GraphicsDevice > & | getDevice () const |
Return a pointer to the graphics device that is being used to render this view. More... | |
const Shared< GraphicsContext > & | getContext () const |
Return a pointer to the graphics context that is being used to render this view. More... | |
const Time & | getMinFrameTime () const |
Return the minimum time that can elapse between successive frames, acting as a framerate limiter. More... | |
void | setMinFrameTime (const Time &newMinFrameTime) |
Set the minimum time that can elapse between successive frames, acting as a framerate limiter. More... | |
Float | getMaxFrameRate () const |
Return the maximum frame rate at which this render view will be drawn. More... | |
void | setMaxFrameRate (Float newMaxFrameRate) |
Return the maximum frame rate at which this render view will be drawn. More... | |
Delegate & | getDelegate () |
Return an object that handles events for this context renderer. More... | |
const Delegate & | getDelegate () const |
Return an object that handles events for this context renderer. More... | |
void | setDelegate (const Delegate &newDelegate) |
Set an object that handles events for this context renderer. More... | |
Static Public Attributes | |
static const Time | DEFAULT_MIN_FRAME_TIME |
The default minimum frame time that is used for this context renderer. More... | |
A class that facilitates creation of a graphics rendering context that renders to one or more gui::RenderView.
om::graphics::devices::GraphicsContextRenderer::GraphicsContextRenderer | ( | ) |
Create a default graphics context renderer.
om::graphics::devices::GraphicsContextRenderer::~GraphicsContextRenderer | ( | ) |
Destroy this context renderer, releasing all non-shared resources.
This destructor automatically stops the drawing thread and releases the graphics context for the views.
|
inline |
Return the number of target render views that this context renderer has.
|
inline |
Return a pointer to the target render view at the specified index.
|
inline |
Return a const reference to the delegate for the target render view at the specified index.
|
inline |
Set the delegate for the target render view at the specified index.
Bool om::graphics::devices::GraphicsContextRenderer::addView | ( | RenderView * | newView | ) |
Add a new target view that this context renderer should draw to.
The method returns whether or not the view was able to be added.
Bool om::graphics::devices::GraphicsContextRenderer::addView | ( | RenderView * | newView, |
const Delegate & | delegate | ||
) |
Add a new target view and associated delegate that this context renderer should draw to.
The method returns whether or not the view was able to be added.
Bool om::graphics::devices::GraphicsContextRenderer::removeView | ( | RenderView * | view | ) |
Remove a target view that this context renderer should no longer draw to.
The method returns whether or not the view was able to be removed.
void om::graphics::devices::GraphicsContextRenderer::clearViews | ( | ) |
Remove all target render views from this context renderer.
Bool om::graphics::devices::GraphicsContextRenderer::startDrawing | ( | const GraphicsDeviceType & | deviceType, |
const RenderedPixelFormat & | pixelFormat, | ||
const GraphicsContextFlags & | flags | ||
) |
Start a background rendering thread for the context renderer that creates a context with the given attributes.
The user provides an output pixel format, and configuration flags for the new graphics context.
The method returns whether or not drawing was able to be started successfully. The method may fail if there are no suitable graphics devices, the graphics context was unable to created, or if some other error occurred.
void om::graphics::devices::GraphicsContextRenderer::stopDrawing | ( | ) |
A method called when the user want to stop the rendering thread for this view.
Bool om::graphics::devices::GraphicsContextRenderer::isDrawing | ( | ) | const |
Return whether or not the context renderer is currently drawing.
|
inline |
Return a pointer to the graphics device that is being used to render this view.
If the method returns a NULL pointer, either the drawing thread is not running, or device creation failed.
|
inline |
Return a pointer to the graphics context that is being used to render this view.
If the method returns a NULL pointer, either the drawing thread is not running, or context creation failed. Using the context from any other thread than the drawing thread will result in undefined behavior.
|
inline |
Return the minimum time that can elapse between successive frames, acting as a framerate limiter.
This is used to save CPU and GPU time when rendering interfaces that don't need to be updated as fast as the system can.
The default minimum frame time is 1/60th of a second, equivalent to a maximum frame rate of 60fps.
|
inline |
Set the minimum time that can elapse between successive frames, acting as a framerate limiter.
This is used to save CPU and GPU time when rendering interfaces that don't need to be updated as fast as the system can.
The default minimum frame time is 1/60th of a second, equivalent to a maximum frame rate of 60fps.
|
inline |
Return the maximum frame rate at which this render view will be drawn.
This is used to save CPU and GPU time when rendering interfaces that don't need to be updated as fast as the system can.
The default maximum frame rate is 60fps.
|
inline |
Return the maximum frame rate at which this render view will be drawn.
This is used to save CPU and GPU time when rendering interfaces that don't need to be updated as fast as the system can.
If the specified maximum frame rate is less than or equal to zero, the maximum frame rate is set to infinity.
The default maximum frame rate is 60fps.
|
inline |
Return an object that handles events for this context renderer.
|
inline |
Return an object that handles events for this context renderer.
|
inline |
Set an object that handles events for this context renderer.
|
static |
The default minimum frame time that is used for this context renderer.