Castor3D 0.12.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. More...
 
C3D_API ~RenderLoopAsync () override
 Destructor. More...
 
C3D_API bool isRendering () const
 Retrieves the render start status. More...
 
C3D_API bool isPaused () const
 Retrieves the render paused status. More...
 
C3D_API bool isInterrupted () const
 Thread-safe. More...
 
C3D_API bool isEnded () const
 Retrieves the render loop end status. More...
 
C3D_API void enableVSync (bool enable) override
 Updates the V-Sync status. More...
 
C3D_API void beginRendering () override
 Starts threaded render loop. More...
 
C3D_API void renderSyncFrame (castor::Milliseconds tslf) override
 Renders one frame, only if not in render loop. More...
 
C3D_API void pause () override
 Pauses the render loop. More...
 
C3D_API void resume () override
 Resumes the render loop. More...
 
C3D_API void endRendering () override
 Ends the render, cleans up engine. More...
 
- Public Member Functions inherited from castor3d::RenderLoop
C3D_API RenderLoop (Engine &engine, uint32_t wantedFPS, bool isAsync)
 Constructor. More...
 
virtual C3D_API ~RenderLoop ()
 Destructor. More...
 
C3D_API void cleanup ()
 Cleans up the render loop. More...
 
C3D_API void showDebugOverlays (bool show)
 Show or hide debug overlays. More...
 
virtual C3D_API void enableVSync (bool enable)
 Updates the V-Sync status. More...
 
C3D_API void flushEvents ()
 Flushs all events of all frame listeners. More...
 
C3D_API uint32_t registerTimer (castor::String const &category, FramePassTimer &timer)
 Registers a render pass timer. More...
 
C3D_API void unregisterTimer (castor::String const &category, FramePassTimer &timer)
 Unregisters a render pass timer. More...
 
C3D_API void registerBuffer (ShaderBuffer const &buffer)
 Registers a ShaderBuffer. More...
 
C3D_API void unregisterBuffer (ShaderBuffer const &buffer)
 Unregisters a ShaderBuffer. More...
 
C3D_API bool hasDebugOverlays () const
 
C3D_API void dumpFrameTimes (Parameters &params) const
 The average frame time, in nanoseconds. More...
 
C3D_API castor::Nanoseconds getAvgFrameTime () const
 
virtual C3D_API void beginRendering ()=0
 Starts threaded render loop. More...
 
virtual C3D_API void renderSyncFrame (castor::Milliseconds tslf=0_ms)=0
 Renders one frame, only if not in render loop. More...
 
virtual C3D_API void pause ()=0
 Pauses the render loop. More...
 
virtual C3D_API void resume ()=0
 Resumes the render loop. More...
 
virtual C3D_API void endRendering ()=0
 Ends the render, cleans up engine. More...
 
castor::Milliseconds getFrameTime () const
 
uint32_t getWantedFps () const
 
castor::Microseconds getLastFrameTime () 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. More...
 
- Protected Attributes inherited from castor3d::RenderLoop
RenderSystemm_renderSystem
 
uint32_t m_wantedFPS
 
castor::Milliseconds m_frameTime
 
std::atomic< castor::Microseconds > m_lastFrameTime
 
std::unique_ptr< DebugOverlaysm_debugOverlays
 
std::mutex m_debugOverlaysMtx
 
std::array< UploadResources, 2u > m_uploadResources
 
uint32_t m_currentUpdate { 0u }
 
crg::SemaphoreWaitArray m_toWait
 

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 ( )
override

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: