![]() |
NDEVR
API Documentation
|
Responsible for updating resources or layouts of data in-between calls to render. More...
Public Member Functions | |
| GraphicsUpdater (DesignObjectLookup *lookup, const DynamicPointer< GraphicsDevice > &device, LogPtr log=LogPtr()) | |
| Constructs the updater for a design lookup and graphics device. | |
| ~GraphicsUpdater () | |
| Destructor. | |
| void | addManager (const UUID &id, Renderer *renderer) |
| Registers a renderer for a given camera ID. | |
| void | addPipeline (GraphicsPipeline *pipline) |
| Adds a graphics pipeline to the update list. | |
| GraphicsUpdateArguments & | args () |
| Returns the current graphics update arguments. | |
| CheckoutLock | checkout (const UUID &id, bool wait_until_ready) |
| Checks out a renderer, blocking until available. | |
| const DynamicPointer< GraphicsDevice > & | device () const |
| Returns the graphics device. | |
| bool | hasManager (const UUID &id) |
| Checks whether a renderer is registered for the given ID. | |
| Time | lastUpdateTime () const |
| Returns the last time an update was performed. | |
| void | recreate () |
| Triggers a full pipeline recreation. | |
| void | removeManager (const UUID &id) |
| Removes a registered renderer. | |
| void | removePipeline (GraphicsPipeline *pipline) |
| Removes a graphics pipeline from the update list. | |
| void | setExceptionCallback (const std::function< void(const Exception &)> &callback) |
| Sets a callback invoked when a graphics exception occurs. | |
| void | setIsGrabSetup (bool grab_setup) |
| Sets whether this updater is configured for image grab mode. | |
| void | setLog (LogPtr log) |
| Sets the log for graphics update operations. | |
| void | setLookup (DesignObjectLookup *lookup) |
| Sets the design object lookup. | |
| CheckoutLock | tryCheckout (const UUID &id, bool wait_until_ready) |
| Attempts a non-blocking checkout of a renderer. | |
| void | update () |
| Performs an update using the internal arguments. | |
| void | update (DesignObjectLookup *lookup, Time time) override |
| Performs a full update cycle for all graphics resources. | |
| void | update (GraphicsUpdateArguments &args) |
| Performs an update using the provided arguments. | |
Static Public Member Functions | |
| static GraphicsUpdater * | DefaultUpdater (DesignObjectLookup *lookup, LogPtr log, DynamicPointer< GraphicsDevice > device) |
| Returns or creates the default updater singleton. | |
Protected Attributes | |
| GraphicsUpdateArguments | m_args |
| Current graphics update arguments. | |
| std::mutex | m_critical_section |
| Mutex for thread-safe access. | |
| DynamicPointer< GraphicsDevice > | m_device |
| The graphics device used for rendering. | |
| std::function< void(const Exception &)> | m_exception_callback |
| Callback for graphics exceptions. | |
| bool | m_grab_setup |
| Whether the updater is in image-grab mode. | |
| Time | m_last_update_time |
| Last time a full update was performed. | |
| Buffer< GraphicsPipeline * > | m_pipelines |
| Registered graphics pipelines. | |
| Dictionary< UUID, Renderer * > | m_renderers |
| Registered renderers keyed by camera UUID. | |
| volatile uint04 | m_total_checked_out_count |
| Number of currently checked-out renderers. | |
| Dictionary< UUID, bool > | needs_update |
| Per-renderer update flags. | |
Responsible for updating resources or layouts of data in-between calls to render.
Definition at line 49 of file GraphicsUpdater.h.
| GraphicsUpdater::GraphicsUpdater | ( | DesignObjectLookup * | lookup, |
| const DynamicPointer< GraphicsDevice > & | device, | ||
| LogPtr | log = LogPtr() ) |
Constructs the updater for a design lookup and graphics device.
| [in] | lookup | The design object lookup. |
| [in] | device | The graphics device. |
| [in] | log | Optional log. |
References device().
Referenced by DefaultUpdater().
Registers a renderer for a given camera ID.
| [in] | id | The camera UUID. |
| [in] | renderer | The renderer to register. |
|
inline |
Adds a graphics pipeline to the update list.
| [in] | pipline | The pipeline to add. |
Definition at line 108 of file GraphicsUpdater.h.
References m_pipelines.
|
inline |
Returns the current graphics update arguments.
Definition at line 118 of file GraphicsUpdater.h.
References m_args.
Referenced by update().
| CheckoutLock GraphicsUpdater::checkout | ( | const UUID & | id, |
| bool | wait_until_ready ) |
Checks out a renderer, blocking until available.
| [in] | id | The camera UUID. |
| [in] | wait_until_ready | Whether to wait for the renderer. |
|
static |
Returns or creates the default updater singleton.
| [in] | lookup | The design object lookup. |
| [in] | log | The log. |
| [in] | device | The graphics device. |
References GraphicsUpdater(), and device().
|
inline |
Returns the graphics device.
Definition at line 105 of file GraphicsUpdater.h.
References m_device.
Referenced by GraphicsUpdater(), and DefaultUpdater().
| bool GraphicsUpdater::hasManager | ( | const UUID & | id | ) |
Checks whether a renderer is registered for the given ID.
| [in] | id | The renderer UUID. |
|
inline |
Returns the last time an update was performed.
Definition at line 78 of file GraphicsUpdater.h.
References m_last_update_time.
| void GraphicsUpdater::removeManager | ( | const UUID & | id | ) |
Removes a registered renderer.
| [in] | id | The camera UUID. |
| void GraphicsUpdater::removePipeline | ( | GraphicsPipeline * | pipline | ) |
Removes a graphics pipeline from the update list.
| [in] | pipline | The pipeline to remove. |
|
inline |
Sets a callback invoked when a graphics exception occurs.
| [in] | callback | The exception callback function. |
Definition at line 129 of file GraphicsUpdater.h.
References m_exception_callback.
| void GraphicsUpdater::setIsGrabSetup | ( | bool | grab_setup | ) |
Sets whether this updater is configured for image grab mode.
| [in] | grab_setup | Whether grab mode is active. |
|
inline |
Sets the log for graphics update operations.
| [in] | log | The log pointer. |
Definition at line 66 of file GraphicsUpdater.h.
References m_args.
|
inline |
Sets the design object lookup.
| [in] | lookup | The lookup to use. |
Definition at line 72 of file GraphicsUpdater.h.
References m_args.
| CheckoutLock GraphicsUpdater::tryCheckout | ( | const UUID & | id, |
| bool | wait_until_ready ) |
Attempts a non-blocking checkout of a renderer.
| [in] | id | The camera UUID. |
| [in] | wait_until_ready | Whether to wait for the renderer. |
|
overridevirtual |
Performs a full update cycle for all graphics resources.
| [in] | lookup | The design object lookup. |
| [in] | time | The current time. |
Implements DesignObjectUpdateTarget.
| void GraphicsUpdater::update | ( | GraphicsUpdateArguments & | args | ) |