![]() |
NDEVR
API Documentation
|
An object that renders a specific Camera object, typically run on a different thread than the main UI thread. More...
Public Member Functions | |
| Renderer (const DynamicPointer< GraphicsPipeline > &pipeline, const ConstPointer< Camera > &camera, WindowInstance *instance, LogPtr log) | |
| Constructs a renderer for a given pipeline, camera, and window. | |
| virtual | ~Renderer () |
| Destructor. | |
| void | cleanup () |
| Cleans up all GPU resources. | |
| const DynamicPointer< GraphicsDevice > & | device () const |
| Returns the graphics device. | |
| void | ensureLastRenderComplete () |
| Blocks until the last submitted render is complete. | |
| GraphicsUpdateArguments & | getArguments () |
| Returns the render arguments. | |
| fltp08 | getFPS () const |
| Returns the target frames per second. | |
| Time | getFrameStartTime () const |
| Returns the start time of the current frame. | |
| void | grabImage (Image *image) |
| Grabs the current frame into an image immediately. | |
| void | grabImageNextRender (Image *image) |
| Queues an image grab for the next render. | |
| void | init (DesignObjectLookup *lookup) |
| Initializes the renderer with a design object lookup. | |
| bool | isActive () |
| Checks whether this renderer is active. | |
| LogPtr | log () |
| Returns the log pointer. | |
| uint04 | multisample () const |
| Returns the current multisample count. | |
| void | pause (TimeSpan span) |
| Pauses rendering for a duration. | |
| DynamicPointer< GraphicsPipeline > | pipeline () const |
| Returns the graphics pipeline. | |
| void | render (bool wait_until_needed, bool force_render=true) |
| Renders a single frame. | |
| void | renderLoop () |
| Enters the continuous render loop. | |
| void | requestRedraw () |
| Requests a redraw on the next update cycle. | |
| void | run () |
| Starts the render thread. | |
| void | setActive (bool is_active) |
| Sets whether this renderer is active. | |
| virtual void | setCamera (const ConstPointer< Camera > &camera) |
| Sets the camera to render from. | |
| void | setFPS (fltp08 fps) |
| Sets the target frames per second. | |
| void | setOverrideMaterial (UUID material) |
| Sets a material override for all rendered objects. | |
| void | setPostRenderFunction (const std::function< void()> &function) |
| Sets a function called after each render completes. | |
| void | setupSurface () |
| Creates the rendering surface for the window. | |
| void | setWindowInstance (WindowInstance *window) |
| Sets the window instance for this renderer. | |
| void | update () |
| Performs a single update cycle. | |
| void | updateArgs (bool force_render) |
| Updates the render arguments from current state. | |
| void | updatePipeline () |
| Recreates and updates the rendering pipeline. | |
| GraphicsUpdater * | updater () const |
| Returns the associated graphics updater. | |
An object that renders a specific Camera object, typically run on a different thread than the main UI thread.
Rendering takes place between calls to the GraphicsUpdater. If there is more than one QTGraphicsWindow, there may be more than one Renderer running at a time.
Definition at line 52 of file Renderer.h.
| Renderer::Renderer | ( | const DynamicPointer< GraphicsPipeline > & | pipeline, |
| const ConstPointer< Camera > & | camera, | ||
| WindowInstance * | instance, | ||
| LogPtr | log ) |
Constructs a renderer for a given pipeline, camera, and window.
| [in] | pipeline | The graphics pipeline. |
| [in] | camera | The camera to render from. |
| [in] | instance | The window instance. |
| [in] | log | The log. |
References log(), and pipeline().
| const DynamicPointer< GraphicsDevice > & Renderer::device | ( | ) | const |
Returns the graphics device.
|
inline |
Returns the render arguments.
Definition at line 111 of file Renderer.h.
|
inline |
|
inline |
Returns the start time of the current frame.
Definition at line 87 of file Renderer.h.
| void Renderer::grabImage | ( | Image * | image | ) |
Grabs the current frame into an image immediately.
| [in] | image | The image to fill. |
| void Renderer::grabImageNextRender | ( | Image * | image | ) |
Queues an image grab for the next render.
| [in] | image | The image to fill after rendering. |
| void Renderer::init | ( | DesignObjectLookup * | lookup | ) |
Initializes the renderer with a design object lookup.
| [in] | lookup | The design object lookup. |
|
inline |
Checks whether this renderer is active.
Definition at line 151 of file Renderer.h.
|
inline |
Returns the log pointer.
Definition at line 100 of file Renderer.h.
Referenced by Renderer().
| uint04 Renderer::multisample | ( | ) | const |
Returns the current multisample count.
| void Renderer::pause | ( | TimeSpan | span | ) |
Pauses rendering for a duration.
| [in] | span | The pause duration. |
|
inline |
Returns the graphics pipeline.
Definition at line 136 of file Renderer.h.
Referenced by Renderer().
| void Renderer::render | ( | bool | wait_until_needed, |
| bool | force_render = true ) |
Renders a single frame.
| [in] | wait_until_needed | Whether to wait for a render request. |
| [in] | force_render | Whether to force rendering even if not needed. |
| void Renderer::setActive | ( | bool | is_active | ) |
Sets whether this renderer is active.
| [in] | is_active | Whether the renderer is active. |
|
virtual |
Sets the camera to render from.
| [in] | camera | The camera pointer. |
|
inline |
Sets the target frames per second.
| [in] | fps | The target FPS. |
Definition at line 74 of file Renderer.h.
| void Renderer::setOverrideMaterial | ( | UUID | material | ) |
Sets a material override for all rendered objects.
| [in] | material | The override material UUID. |
|
inline |
Sets a function called after each render completes.
| [in] | function | The post-render callback. |
Definition at line 120 of file Renderer.h.
| void Renderer::setWindowInstance | ( | WindowInstance * | window | ) |
Sets the window instance for this renderer.
| [in] | window | The window instance. |
| void Renderer::updateArgs | ( | bool | force_render | ) |
Updates the render arguments from current state.
| [in] | force_render | Whether to force a render. |
|
inline |
Returns the associated graphics updater.
Definition at line 108 of file Renderer.h.