Rendu
A lightweight rendering engine for experimentations
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | Private Attributes | Static Private Attributes | List of all members
Application Class Referenceabstract

Base structure of an application. More...

#include <Application.hpp>

Public Member Functions

 Application (RenderingConfig &config, Window &window)
 
virtual void draw ()=0
 
virtual void update ()
 
virtual void finish ()
 
virtual void resize ()=0
 
double timeElapsed ()
 
double frameTime ()
 
double frameRate ()
 
Windowwindow ()
 
virtual ~Application ()
 
 Application (const Application &)=delete
 
Applicationoperator= (const Application &)=delete
 
 Application (Application &&)=delete
 
Applicationoperator= (Application &&)=delete
 

Protected Attributes

RenderingConfig_config
 The current configuration.
 
std::unique_ptr< DebugViewer_debug
 Debug viewer.
 

Private Attributes

Window_window
 The application main window.
 
double _timer = 0.0
 Absolute timer.
 
double _startTime = 0.0
 TImer value at app start.
 
double _frameTime = 0.0
 Last frame duration.
 
std::array< double, _framesCount_frameTimes
 Last N frame times.
 
double _smoothTime = 0.0
 Time elapsed over the last N frames.
 
size_t _currFrame = 0
 Current frame index for smoothing.
 
bool _showDebug = false
 Show debug viewer.
 

Static Private Attributes

static const size_t _framesCount = 30
 Frames to average over for FPS display.
 

Detailed Description

Base structure of an application.

Inherited by CameraApp.

Constructor & Destructor Documentation

◆ Application() [1/3]

Application::Application ( RenderingConfig config,
Window window 
)
explicit

Constructor.

Parameters
configthe configuration to apply when setting up
windowthe window to render to

◆ ~Application()

Application::~Application ( )
virtual

Destructor

◆ Application() [2/3]

Application::Application ( const Application )
delete

Copy constructor.

◆ Application() [3/3]

Application::Application ( Application &&  )
delete

Move constructor.

Member Function Documentation

◆ draw()

virtual void Application::draw ( )
pure virtual

◆ finish()

void Application::finish ( )
virtual

End of frame operations (screenshot,...)

◆ frameRate()

double Application::frameRate ( )
Returns
the frame rate, smoothed over the last 30 frames.

◆ frameTime()

double Application::frameTime ( )
Returns
the last frame time

◆ operator=() [1/2]

Application & Application::operator= ( Application &&  )
delete

Move assignment.

Returns
a reference to the object assigned to

◆ operator=() [2/2]

Application & Application::operator= ( const Application )
delete

Copy assignment.

Returns
a reference to the object assigned to

◆ resize()

virtual void Application::resize ( )
pure virtual

Handle a window resize event, the configuration has been updated with the new size.

Implemented in AtmosphereApp, FilteringApp, IslandApp, PathTracerApp, PBRDemo, ShaderEditor, StenciledApp, and SceneEditor.

◆ timeElapsed()

double Application::timeElapsed ( )
Returns
the time elapsed since launch

◆ update()

void Application::update ( )
virtual

◆ window()

Window & Application::window ( )
Returns
the application main window

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