Castor3D 0.16.0
Multiplatform 3D engine
Public Member Functions | List of all members
castor3d::RenderLoopAsync Class Reference

#include <RenderLoopAsync.hpp>

Inheritance diagram for castor3d::RenderLoopAsync:
Inheritance graph
[legend]
Collaboration diagram for castor3d::RenderLoopAsync:
Collaboration graph
[legend]

Public Member Functions

C3D_API RenderLoopAsync (Engine &engine, uint32_t wantedFPS)
 Constructor.
 
C3D_API ~RenderLoopAsync () noexcept override
 Destructor.
 
C3D_API bool isRendering () const
 Retrieves the render start status.
 
C3D_API bool isPaused () const
 Retrieves the render paused status.
 
C3D_API bool isInterrupted () const
 Thread-safe.
 
C3D_API bool isEnded () const
 Retrieves the render loop end status.
 
C3D_API void enableVSync (bool enable) override
 Updates the V-Sync status.
 
C3D_API void beginRendering () override
 Starts threaded render loop.
 
C3D_API void renderSyncFrame (castor::Milliseconds tslf) override
 Renders one frame, only if not in render loop.
 
C3D_API void pause () override
 Pauses the render loop.
 
C3D_API void resume () override
 Resumes the render loop.
 
C3D_API void endRendering () override
 Ends the render, cleans upĀ engine.
 
- Public Member Functions inherited from castor3d::RenderLoop
C3D_API RenderLoop (Engine &engine, uint32_t wantedFPS)
 Constructor.
 
virtual C3D_API ~RenderLoop () noexcept
 Destructor.
 
C3D_API void cleanup ()
 Cleans up the render loop.
 
C3D_API void showDebugOverlays (bool show)
 Show or hide debug overlays.
 
C3D_API void flushEvents () const
 Flushs all events of all frame listeners.
 
C3D_API void registerTimer (castor::String const &category, FramePassTimer &timer)
 Registers a render pass timer.
 
C3D_API void unregisterTimer (castor::String const &category, FramePassTimer &timer)
 Unregisters a render pass timer.
 
C3D_API void registerBuffer (ShaderBuffer const &buffer)
 Registers a ShaderBuffer.
 
C3D_API void unregisterBuffer (ShaderBuffer const &buffer)
 Unregisters a ShaderBuffer.
 
C3D_API bool hasDebugOverlays () const
 
C3D_API void dumpFrameTimes (Parameters &params) const
 The average frame time, in nanoseconds.
 
C3D_API castor::Nanoseconds getAvgFrameTime () const
 
castor::Milliseconds getFrameTime () const noexcept
 
uint32_t getWantedFps () const noexcept
 
castor::Microseconds getLastFrameTime () const noexcept
 
UploadDatagetUploadData () const noexcept
 
- Public Member Functions inherited from castor::OwnedBy< Engine >
Engine * getOwner () const
 

Additional Inherited Members

- Static Public Attributes inherited from castor3d::RenderLoop
static constexpr uint32_t UnlimitedFPS = 0xFFFFFFFFu
 
- Protected Member Functions inherited from castor3d::RenderLoop
C3D_API void doRenderFrame (castor::Milliseconds tslf=0_ms)
 Starts threaded render loop.
 
- Protected Member Functions inherited from castor::OwnedBy< Engine >
 OwnedBy (Engine &owner)
 Constructor.
 
- Protected Attributes inherited from castor3d::RenderLoop
RenderSystemm_renderSystem
 
uint32_t m_wantedFPS
 
castor::Milliseconds m_frameTime
 
std::atomic< castor::Microsecondsm_lastFrameTime
 
castor::RawUniquePtr< DebugOverlaysm_debugOverlays
 
castor::Mutex m_debugOverlaysMtx
 

Constructor & Destructor Documentation

◆ RenderLoopAsync()

C3D_API castor3d::RenderLoopAsync::RenderLoopAsync ( Engine & engine,
uint32_t wantedFPS )

Constructor.

Parameters
[in]engineThe engine.
[in]wantedFPSThe wanted FPS count.

◆ ~RenderLoopAsync()

C3D_API castor3d::RenderLoopAsync::~RenderLoopAsync ( )
overridenoexcept

Destructor.

Member Function Documentation

◆ beginRendering()

C3D_API void castor3d::RenderLoopAsync::beginRendering ( )
overridevirtual

Starts threaded render loop.

Implements castor3d::RenderLoop.

◆ enableVSync()

C3D_API void castor3d::RenderLoopAsync::enableVSync ( bool enable)
overridevirtual

Updates the V-Sync status.

Parameters
[in]enableThe status.

Reimplemented from castor3d::RenderLoop.

◆ endRendering()

C3D_API void castor3d::RenderLoopAsync::endRendering ( )
overridevirtual

Ends the render, cleans upĀ engine.

Remarks
Ends the threaded render loop, if any.

Implements castor3d::RenderLoop.

◆ isEnded()

C3D_API bool castor3d::RenderLoopAsync::isEnded ( ) const

Retrieves the render loop end status.

Remarks
Thread-safe.
Returns
true if created.

◆ isInterrupted()

C3D_API bool castor3d::RenderLoopAsync::isInterrupted ( ) const

Thread-safe.

Returns
true if the render loop is interrupted.

◆ isPaused()

C3D_API bool castor3d::RenderLoopAsync::isPaused ( ) const

Retrieves the render paused status.

Remarks
Thread-safe.
Returns
true if paused.

◆ isRendering()

C3D_API bool castor3d::RenderLoopAsync::isRendering ( ) const

Retrieves the render start status.

Remarks
Thread-safe.
Returns
true if started.

◆ pause()

C3D_API void castor3d::RenderLoopAsync::pause ( )
overridevirtual

Pauses the render loop.

Implements castor3d::RenderLoop.

◆ renderSyncFrame()

C3D_API void castor3d::RenderLoopAsync::renderSyncFrame ( castor::Milliseconds tslf)
overridevirtual

Renders one frame, only if not in render loop.

Parameters
[in]tslfThe time elapsed since last frame.

Implements castor3d::RenderLoop.

◆ resume()

C3D_API void castor3d::RenderLoopAsync::resume ( )
overridevirtual

Resumes the render loop.

Implements castor3d::RenderLoop.


The documentation for this class was generated from the following file: