LiteFX 0.3.1.2022
Computer Graphics Engine
SampleApp Class Reference

#include <sample.h>

Inherits LiteFX::App, LiteFX::App, LiteFX::App, LiteFX::App, LiteFX::App, LiteFX::App, LiteFX::App, and LiteFX::App.

Public Member Functions

String name () const noexcept override
 Returns the name of the app. More...
 
AppVersion version () const noexcept override
 Returns the version of the app. More...
 
 SampleApp (GlfwWindowPtr &&window, Optional< UInt32 > adapterId)
 
virtual void run () override
 Starts the application. More...
 
virtual void initialize () override
 Called to initialize the application state. More...
 
virtual void resize (int &width, int &height) override
 Called, if the application window resizes. More...
 
void keyDown (int key, int scancode, int action, int mods)
 
void handleEvents ()
 
void drawFrame ()
 
void updateWindowTitle ()
 
String name () const noexcept override
 Returns the name of the app. More...
 
AppVersion version () const noexcept override
 Returns the version of the app. More...
 
 SampleApp (GlfwWindowPtr &&window, Optional< UInt32 > adapterId)
 
virtual void run () override
 Starts the application. More...
 
virtual void initialize () override
 Called to initialize the application state. More...
 
virtual void resize (int &width, int &height) override
 Called, if the application window resizes. More...
 
void keyDown (int key, int scancode, int action, int mods)
 
void handleEvents ()
 
void drawFrame ()
 
void updateWindowTitle ()
 
String name () const noexcept override
 Returns the name of the app. More...
 
AppVersion version () const noexcept override
 Returns the version of the app. More...
 
 SampleApp (GlfwWindowPtr &&window, Optional< UInt32 > adapterId)
 
virtual void run () override
 Starts the application. More...
 
virtual void initialize () override
 Called to initialize the application state. More...
 
virtual void resize (int &width, int &height) override
 Called, if the application window resizes. More...
 
void keyDown (int key, int scancode, int action, int mods)
 
void handleEvents ()
 
void drawFrame ()
 
void updateWindowTitle ()
 
String name () const noexcept override
 Returns the name of the app. More...
 
AppVersion version () const noexcept override
 Returns the version of the app. More...
 
 SampleApp (GlfwWindowPtr &&window, Optional< UInt32 > adapterId)
 
virtual void run () override
 Starts the application. More...
 
virtual void initialize () override
 Called to initialize the application state. More...
 
virtual void resize (int &width, int &height) override
 Called, if the application window resizes. More...
 
void keyDown (int key, int scancode, int action, int mods)
 
void handleEvents ()
 
void drawObject (const IRenderPass *renderPass, int i, int backBuffer, float time)
 
void drawFrame ()
 
void updateWindowTitle ()
 
String name () const noexcept override
 Returns the name of the app. More...
 
AppVersion version () const noexcept override
 Returns the version of the app. More...
 
 SampleApp (GlfwWindowPtr &&window, Optional< UInt32 > adapterId)
 
virtual void run () override
 Starts the application. More...
 
virtual void initialize () override
 Called to initialize the application state. More...
 
virtual void resize (int &width, int &height) override
 Called, if the application window resizes. More...
 
void keyDown (int key, int scancode, int action, int mods)
 
void handleEvents ()
 
void drawFrame ()
 
void updateWindowTitle ()
 
String name () const noexcept override
 Returns the name of the app. More...
 
AppVersion version () const noexcept override
 Returns the version of the app. More...
 
 SampleApp (GlfwWindowPtr &&window, Optional< UInt32 > adapterId)
 
virtual void run () override
 Starts the application. More...
 
virtual void initialize () override
 Called to initialize the application state. More...
 
virtual void resize (int &width, int &height) override
 Called, if the application window resizes. More...
 
void keyDown (int key, int scancode, int action, int mods)
 
void handleEvents ()
 
void drawFrame ()
 
void updateWindowTitle ()
 
String name () const noexcept override
 Returns the name of the app. More...
 
AppVersion version () const noexcept override
 Returns the version of the app. More...
 
 SampleApp (GlfwWindowPtr &&window, Optional< UInt32 > adapterId)
 
virtual void run () override
 Starts the application. More...
 
virtual void initialize () override
 Called to initialize the application state. More...
 
virtual void resize (int &width, int &height) override
 Called, if the application window resizes. More...
 
void keyDown (int key, int scancode, int action, int mods)
 
void handleEvents ()
 
void drawFrame ()
 
void updateWindowTitle ()
 
String name () const noexcept override
 Returns the name of the app. More...
 
AppVersion version () const noexcept override
 Returns the version of the app. More...
 
 SampleApp (GlfwWindowPtr &&window, Optional< UInt32 > adapterId)
 
virtual void run () override
 Starts the application. More...
 
virtual void initialize () override
 Called to initialize the application state. More...
 
virtual void resize (int &width, int &height) override
 Called, if the application window resizes. More...
 
void keyDown (int key, int scancode, int action, int mods)
 
void handleEvents ()
 
void drawFrame ()
 
void updateWindowTitle ()
 
- Public Member Functions inherited from LiteFX::App
 App ()
 Initializes a new app instance. More...
 
 App (const App &)=delete
 
 App (App &&)=delete
 
virtual ~App () noexcept
 
virtual String name () const noexcept=0
 Returns the name of the app. More...
 
virtual AppVersion version () const noexcept=0
 Returns the version of the app. More...
 
Platform platform () const noexcept
 Returns the platform, the app is running on. More...
 
virtual const IBackendoperator[] (std::type_index type) const
 Returns the registered backend instance for a type index. More...
 
virtual const IBackendgetBackend (std::type_index type) const
 Returns the registered backend instance for a type index. More...
 
virtual Array< const IBackend * > getBackends (const BackendType type) const noexcept
 Returns all registered backend instances of a backend type. More...
 
template<typename TBackend >
requires rtti::implements<TBackend, IBackend>
void onBackendStart (const std::function< bool(TBackend *)> &callback)
 Sets a callback that is called, if a backend is started. More...
 
template<typename TBackend >
requires rtti::implements<TBackend, IBackend>
void onBackendStop (const std::function< void(TBackend *)> &callback)
 Sets a callback that is called, if a backend is stopped. More...
 
template<typename TBackend >
requires rtti::implements<TBackend, IBackend>
const TBackend * findBackend () const
 Returns the registered backend instance for a type index. More...
 
template<typename TBackend >
requires rtti::implements<TBackend, IBackend>
void startBackend ()
 Attempts to start a backend of type TBackend and stops the active backend of the same BackendType, if any. More...
 
template<typename TBackend >
requires rtti::implements<TBackend, IBackend>
void stopBackend ()
 Stops a backend, if it is currently running. More...
 
virtual void use (UniquePtr< IBackend > &&backend)
 Adds a backend to the app. More...
 
virtual void run ()=0
 Starts the application. More...
 
virtual void initialize ()=0
 Called to initialize the application state. More...
 
virtual void resize (int &width, int &height)
 Called, if the application window resizes. More...
 

Static Public Member Functions

static String Name () noexcept
 
static AppVersion Version () noexcept
 
static String Name () noexcept
 
static AppVersion Version () noexcept
 
static String Name () noexcept
 
static AppVersion Version () noexcept
 
static String Name () noexcept
 
static AppVersion Version () noexcept
 
static String Name () noexcept
 
static AppVersion Version () noexcept
 
static String Name () noexcept
 
static AppVersion Version () noexcept
 
static String Name () noexcept
 
static AppVersion Version () noexcept
 
static String Name () noexcept
 
static AppVersion Version () noexcept
 
- Static Public Member Functions inherited from LiteFX::App
template<typename TApp , typename ... TArgs>
static AppBuilder build (TArgs &&... _args)
 Creates a new application builder. More...
 

Additional Inherited Members

- Protected Member Functions inherited from LiteFX::App
virtual IBackendgetBackend (std::type_index type)
 Returns the registered backend instance for a type index. More...
 
template<typename TBackend >
requires rtti::implements<TBackend, IBackend>
TBackend * findBackend ()
 Returns the registered backend instance for a type index. More...
 
virtual void startBackend (std::type_index type) const
 Starts a backend. More...
 
virtual void stopBackend (std::type_index type) const
 Stops a backend. More...
 
virtual void stopActiveBackends (const BackendType &type) const
 Stops the active backend of type . More...
 
virtual IBackendactiveBackend (const BackendType &type) const
 Returns the active backend of the provided backend type . More...
 
virtual std::type_index activeBackendType (const BackendType &type) const
 Returns the type index of the active backend of the provided backend type . More...
 

Constructor & Destructor Documentation

◆ SampleApp() [1/8]

SampleApp::SampleApp ( GlfwWindowPtr &&  window,
Optional< UInt32 adapterId 
)
inline

◆ SampleApp() [2/8]

SampleApp::SampleApp ( GlfwWindowPtr &&  window,
Optional< UInt32 adapterId 
)
inline

◆ SampleApp() [3/8]

SampleApp::SampleApp ( GlfwWindowPtr &&  window,
Optional< UInt32 adapterId 
)
inline

◆ SampleApp() [4/8]

SampleApp::SampleApp ( GlfwWindowPtr &&  window,
Optional< UInt32 adapterId 
)
inline

◆ SampleApp() [5/8]

SampleApp::SampleApp ( GlfwWindowPtr &&  window,
Optional< UInt32 adapterId 
)
inline

◆ SampleApp() [6/8]

SampleApp::SampleApp ( GlfwWindowPtr &&  window,
Optional< UInt32 adapterId 
)
inline

◆ SampleApp() [7/8]

SampleApp::SampleApp ( GlfwWindowPtr &&  window,
Optional< UInt32 adapterId 
)
inline

◆ SampleApp() [8/8]

SampleApp::SampleApp ( GlfwWindowPtr &&  window,
Optional< UInt32 adapterId 
)
inline

Member Function Documentation

◆ drawFrame() [1/8]

void SampleApp::drawFrame ( )

◆ drawFrame() [2/8]

void SampleApp::drawFrame ( )

◆ drawFrame() [3/8]

void SampleApp::drawFrame ( )

◆ drawFrame() [4/8]

void SampleApp::drawFrame ( )

◆ drawFrame() [5/8]

void SampleApp::drawFrame ( )

◆ drawFrame() [6/8]

void SampleApp::drawFrame ( )

◆ drawFrame() [7/8]

void SampleApp::drawFrame ( )

◆ drawFrame() [8/8]

void SampleApp::drawFrame ( )

◆ drawObject()

void SampleApp::drawObject ( const IRenderPass renderPass,
int  i,
int  backBuffer,
float  time 
)

◆ handleEvents() [1/8]

void SampleApp::handleEvents ( )

◆ handleEvents() [2/8]

void SampleApp::handleEvents ( )

◆ handleEvents() [3/8]

void SampleApp::handleEvents ( )

◆ handleEvents() [4/8]

void SampleApp::handleEvents ( )

◆ handleEvents() [5/8]

void SampleApp::handleEvents ( )

◆ handleEvents() [6/8]

void SampleApp::handleEvents ( )

◆ handleEvents() [7/8]

void SampleApp::handleEvents ( )

◆ handleEvents() [8/8]

void SampleApp::handleEvents ( )

◆ initialize() [1/8]

void SampleApp::initialize ( )
overridevirtual

Called to initialize the application state.

Implements LiteFX::App.

◆ initialize() [2/8]

virtual void SampleApp::initialize ( )
overridevirtual

Called to initialize the application state.

Implements LiteFX::App.

◆ initialize() [3/8]

virtual void SampleApp::initialize ( )
overridevirtual

Called to initialize the application state.

Implements LiteFX::App.

◆ initialize() [4/8]

virtual void SampleApp::initialize ( )
overridevirtual

Called to initialize the application state.

Implements LiteFX::App.

◆ initialize() [5/8]

virtual void SampleApp::initialize ( )
overridevirtual

Called to initialize the application state.

Implements LiteFX::App.

◆ initialize() [6/8]

virtual void SampleApp::initialize ( )
overridevirtual

Called to initialize the application state.

Implements LiteFX::App.

◆ initialize() [7/8]

virtual void SampleApp::initialize ( )
overridevirtual

Called to initialize the application state.

Implements LiteFX::App.

◆ initialize() [8/8]

virtual void SampleApp::initialize ( )
overridevirtual

Called to initialize the application state.

Implements LiteFX::App.

◆ keyDown() [1/8]

void SampleApp::keyDown ( int  key,
int  scancode,
int  action,
int  mods 
)

◆ keyDown() [2/8]

void SampleApp::keyDown ( int  key,
int  scancode,
int  action,
int  mods 
)

◆ keyDown() [3/8]

void SampleApp::keyDown ( int  key,
int  scancode,
int  action,
int  mods 
)

◆ keyDown() [4/8]

void SampleApp::keyDown ( int  key,
int  scancode,
int  action,
int  mods 
)

◆ keyDown() [5/8]

void SampleApp::keyDown ( int  key,
int  scancode,
int  action,
int  mods 
)

◆ keyDown() [6/8]

void SampleApp::keyDown ( int  key,
int  scancode,
int  action,
int  mods 
)

◆ keyDown() [7/8]

void SampleApp::keyDown ( int  key,
int  scancode,
int  action,
int  mods 
)

◆ keyDown() [8/8]

void SampleApp::keyDown ( int  key,
int  scancode,
int  action,
int  mods 
)

◆ name() [1/8]

String SampleApp::name ( ) const
inlineoverridevirtualnoexcept

Returns the name of the app.

Returns
The name of the app.

Implements LiteFX::App.

◆ name() [2/8]

String SampleApp::name ( ) const
inlineoverridevirtualnoexcept

Returns the name of the app.

Returns
The name of the app.

Implements LiteFX::App.

◆ name() [3/8]

String SampleApp::name ( ) const
inlineoverridevirtualnoexcept

Returns the name of the app.

Returns
The name of the app.

Implements LiteFX::App.

◆ name() [4/8]

String SampleApp::name ( ) const
inlineoverridevirtualnoexcept

Returns the name of the app.

Returns
The name of the app.

Implements LiteFX::App.

◆ name() [5/8]

String SampleApp::name ( ) const
inlineoverridevirtualnoexcept

Returns the name of the app.

Returns
The name of the app.

Implements LiteFX::App.

◆ name() [6/8]

String SampleApp::name ( ) const
inlineoverridevirtualnoexcept

Returns the name of the app.

Returns
The name of the app.

Implements LiteFX::App.

◆ name() [7/8]

String SampleApp::name ( ) const
inlineoverridevirtualnoexcept

Returns the name of the app.

Returns
The name of the app.

Implements LiteFX::App.

◆ name() [8/8]

String SampleApp::name ( ) const
inlineoverridevirtualnoexcept

Returns the name of the app.

Returns
The name of the app.

Implements LiteFX::App.

◆ Name() [1/8]

static String SampleApp::Name ( )
inlinestaticnoexcept

◆ Name() [2/8]

static String SampleApp::Name ( )
inlinestaticnoexcept

◆ Name() [3/8]

static String SampleApp::Name ( )
inlinestaticnoexcept

◆ Name() [4/8]

static String SampleApp::Name ( )
inlinestaticnoexcept

◆ Name() [5/8]

static String SampleApp::Name ( )
inlinestaticnoexcept

◆ Name() [6/8]

static String SampleApp::Name ( )
inlinestaticnoexcept

◆ Name() [7/8]

static String SampleApp::Name ( )
inlinestaticnoexcept

◆ Name() [8/8]

static String SampleApp::Name ( )
inlinestaticnoexcept

◆ resize() [1/8]

void SampleApp::resize ( int &  width,
int &  height 
)
overridevirtual

Called, if the application window resizes.

Calling this method ensures, that the width and height parameters are valid.

Parameters
widthThe new width of the application window.
heightThe new height of the application window.

Reimplemented from LiteFX::App.

◆ resize() [2/8]

virtual void SampleApp::resize ( int &  width,
int &  height 
)
overridevirtual

Called, if the application window resizes.

Calling this method ensures, that the width and height parameters are valid.

Parameters
widthThe new width of the application window.
heightThe new height of the application window.

Reimplemented from LiteFX::App.

◆ resize() [3/8]

virtual void SampleApp::resize ( int &  width,
int &  height 
)
overridevirtual

Called, if the application window resizes.

Calling this method ensures, that the width and height parameters are valid.

Parameters
widthThe new width of the application window.
heightThe new height of the application window.

Reimplemented from LiteFX::App.

◆ resize() [4/8]

virtual void SampleApp::resize ( int &  width,
int &  height 
)
overridevirtual

Called, if the application window resizes.

Calling this method ensures, that the width and height parameters are valid.

Parameters
widthThe new width of the application window.
heightThe new height of the application window.

Reimplemented from LiteFX::App.

◆ resize() [5/8]

virtual void SampleApp::resize ( int &  width,
int &  height 
)
overridevirtual

Called, if the application window resizes.

Calling this method ensures, that the width and height parameters are valid.

Parameters
widthThe new width of the application window.
heightThe new height of the application window.

Reimplemented from LiteFX::App.

◆ resize() [6/8]

virtual void SampleApp::resize ( int &  width,
int &  height 
)
overridevirtual

Called, if the application window resizes.

Calling this method ensures, that the width and height parameters are valid.

Parameters
widthThe new width of the application window.
heightThe new height of the application window.

Reimplemented from LiteFX::App.

◆ resize() [7/8]

virtual void SampleApp::resize ( int &  width,
int &  height 
)
overridevirtual

Called, if the application window resizes.

Calling this method ensures, that the width and height parameters are valid.

Parameters
widthThe new width of the application window.
heightThe new height of the application window.

Reimplemented from LiteFX::App.

◆ resize() [8/8]

virtual void SampleApp::resize ( int &  width,
int &  height 
)
overridevirtual

Called, if the application window resizes.

Calling this method ensures, that the width and height parameters are valid.

Parameters
widthThe new width of the application window.
heightThe new height of the application window.

Reimplemented from LiteFX::App.

◆ run() [1/8]

void SampleApp::run ( )
overridevirtual

Starts the application.

Implements LiteFX::App.

◆ run() [2/8]

virtual void SampleApp::run ( )
overridevirtual

Starts the application.

Implements LiteFX::App.

◆ run() [3/8]

virtual void SampleApp::run ( )
overridevirtual

Starts the application.

Implements LiteFX::App.

◆ run() [4/8]

virtual void SampleApp::run ( )
overridevirtual

Starts the application.

Implements LiteFX::App.

◆ run() [5/8]

virtual void SampleApp::run ( )
overridevirtual

Starts the application.

Implements LiteFX::App.

◆ run() [6/8]

virtual void SampleApp::run ( )
overridevirtual

Starts the application.

Implements LiteFX::App.

◆ run() [7/8]

virtual void SampleApp::run ( )
overridevirtual

Starts the application.

Implements LiteFX::App.

◆ run() [8/8]

virtual void SampleApp::run ( )
overridevirtual

Starts the application.

Implements LiteFX::App.

◆ updateWindowTitle() [1/8]

void SampleApp::updateWindowTitle ( )

◆ updateWindowTitle() [2/8]

void SampleApp::updateWindowTitle ( )

◆ updateWindowTitle() [3/8]

void SampleApp::updateWindowTitle ( )

◆ updateWindowTitle() [4/8]

void SampleApp::updateWindowTitle ( )

◆ updateWindowTitle() [5/8]

void SampleApp::updateWindowTitle ( )

◆ updateWindowTitle() [6/8]

void SampleApp::updateWindowTitle ( )

◆ updateWindowTitle() [7/8]

void SampleApp::updateWindowTitle ( )

◆ updateWindowTitle() [8/8]

void SampleApp::updateWindowTitle ( )

◆ version() [1/8]

AppVersion SampleApp::version ( ) const
inlineoverridevirtualnoexcept

Returns the version of the app.

Returns
The version of the app.

Implements LiteFX::App.

◆ version() [2/8]

AppVersion SampleApp::version ( ) const
inlineoverridevirtualnoexcept

Returns the version of the app.

Returns
The version of the app.

Implements LiteFX::App.

◆ version() [3/8]

AppVersion SampleApp::version ( ) const
inlineoverridevirtualnoexcept

Returns the version of the app.

Returns
The version of the app.

Implements LiteFX::App.

◆ version() [4/8]

AppVersion SampleApp::version ( ) const
inlineoverridevirtualnoexcept

Returns the version of the app.

Returns
The version of the app.

Implements LiteFX::App.

◆ version() [5/8]

AppVersion SampleApp::version ( ) const
inlineoverridevirtualnoexcept

Returns the version of the app.

Returns
The version of the app.

Implements LiteFX::App.

◆ version() [6/8]

AppVersion SampleApp::version ( ) const
inlineoverridevirtualnoexcept

Returns the version of the app.

Returns
The version of the app.

Implements LiteFX::App.

◆ version() [7/8]

AppVersion SampleApp::version ( ) const
inlineoverridevirtualnoexcept

Returns the version of the app.

Returns
The version of the app.

Implements LiteFX::App.

◆ version() [8/8]

AppVersion SampleApp::version ( ) const
inlineoverridevirtualnoexcept

Returns the version of the app.

Returns
The version of the app.

Implements LiteFX::App.

◆ Version() [1/8]

static AppVersion SampleApp::Version ( )
inlinestaticnoexcept

◆ Version() [2/8]

static AppVersion SampleApp::Version ( )
inlinestaticnoexcept

◆ Version() [3/8]

static AppVersion SampleApp::Version ( )
inlinestaticnoexcept

◆ Version() [4/8]

static AppVersion SampleApp::Version ( )
inlinestaticnoexcept

◆ Version() [5/8]

static AppVersion SampleApp::Version ( )
inlinestaticnoexcept

◆ Version() [6/8]

static AppVersion SampleApp::Version ( )
inlinestaticnoexcept

◆ Version() [7/8]

static AppVersion SampleApp::Version ( )
inlinestaticnoexcept

◆ Version() [8/8]

static AppVersion SampleApp::Version ( )
inlinestaticnoexcept