LiteFX 0.4.1.2025
Computer Graphics Engine
Loading...
Searching...
No Matches
SampleApp Class Reference

#include <sample.h>

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

Public Member Functions

StringView name () const noexcept override
 Returns the name of the app.
 
AppVersion version () const noexcept override
 Returns the version of the app.
 
 SampleApp (GlfwWindowPtr &&window, Optional< UInt32 > adapterId)
 
void keyDown (int key, int scancode, int action, int mods)
 
void handleEvents ()
 
void drawFrame ()
 
void updateWindowTitle ()
 
StringView name () const noexcept override
 Returns the name of the app.
 
AppVersion version () const noexcept override
 Returns the version of the app.
 
 SampleApp (GlfwWindowPtr &&window, Optional< UInt32 > adapterId)
 
void keyDown (int key, int scancode, int action, int mods)
 
void handleEvents ()
 
void drawFrame ()
 
void updateWindowTitle ()
 
StringView name () const noexcept override
 Returns the name of the app.
 
AppVersion version () const noexcept override
 Returns the version of the app.
 
 SampleApp (GlfwWindowPtr &&window, Optional< UInt32 > adapterId)
 
void keyDown (int key, int scancode, int action, int mods)
 
void handleEvents ()
 
void drawFrame ()
 
void updateWindowTitle ()
 
StringView name () const noexcept override
 Returns the name of the app.
 
AppVersion version () const noexcept override
 Returns the version of the app.
 
 SampleApp (GlfwWindowPtr &&window, Optional< UInt32 > adapterId)
 
void keyDown (int key, int scancode, int action, int mods)
 
void handleEvents ()
 
void drawFrame ()
 
void updateWindowTitle ()
 
StringView name () const noexcept override
 Returns the name of the app.
 
AppVersion version () const noexcept override
 Returns the version of the app.
 
 SampleApp (GlfwWindowPtr &&window, Optional< UInt32 > adapterId)
 
void keyDown (int key, int scancode, int action, int mods)
 
void handleEvents ()
 
void drawFrame ()
 
void updateWindowTitle ()
 
StringView name () const noexcept override
 Returns the name of the app.
 
AppVersion version () const noexcept override
 Returns the version of the app.
 
 SampleApp (GlfwWindowPtr &&window, Optional< UInt32 > adapterId)
 
void keyDown (int key, int scancode, int action, int mods)
 
void handleEvents ()
 
void drawFrame ()
 
void updateWindowTitle ()
 
StringView name () const noexcept override
 Returns the name of the app.
 
AppVersion version () const noexcept override
 Returns the version of the app.
 
 SampleApp (GlfwWindowPtr &&window, Optional< UInt32 > adapterId)
 
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 ()
 
StringView name () const noexcept override
 Returns the name of the app.
 
AppVersion version () const noexcept override
 Returns the version of the app.
 
 SampleApp (GlfwWindowPtr &&window, Optional< UInt32 > adapterId)
 
void keyDown (int key, int scancode, int action, int mods)
 
void handleEvents ()
 
void drawFrame ()
 
void updateWindowTitle ()
 
StringView name () const noexcept override
 Returns the name of the app.
 
AppVersion version () const noexcept override
 Returns the version of the app.
 
 SampleApp (GlfwWindowPtr &&window, Optional< UInt32 > adapterId)
 
void keyDown (int key, int scancode, int action, int mods)
 
void handleEvents ()
 
void drawFrame ()
 
void updateWindowTitle ()
 
StringView name () const noexcept override
 Returns the name of the app.
 
AppVersion version () const noexcept override
 Returns the version of the app.
 
 SampleApp (GlfwWindowPtr &&window, Optional< UInt32 > adapterId)
 
void keyDown (int key, int scancode, int action, int mods)
 
void handleEvents ()
 
void drawFrame ()
 
void updateWindowTitle ()
 
StringView name () const noexcept override
 Returns the name of the app.
 
AppVersion version () const noexcept override
 Returns the version of the app.
 
 SampleApp (GlfwWindowPtr &&window, Optional< UInt32 > adapterId)
 
void keyDown (int key, int scancode, int action, int mods)
 
void handleEvents ()
 
void drawFrame ()
 
void updateWindowTitle ()
 
StringView name () const noexcept override
 Returns the name of the app.
 
AppVersion version () const noexcept override
 Returns the version of the app.
 
 SampleApp (GlfwWindowPtr &&window, Optional< UInt32 > adapterId)
 
void updateCamera (const ICommandBuffer &commandBuffer, IBuffer &buffer) const
 Updates the camera buffer. This needs to be done whenever the frame buffer changes, since we need to pass changes in the aspect ratio to the view/projection matrix.
 
void keyDown (int key, int scancode, int action, int mods)
 
void handleEvents ()
 
void drawFrame ()
 
void updateWindowTitle ()
 
StringView name () const noexcept override
 Returns the name of the app.
 
AppVersion version () const noexcept override
 Returns the version of the app.
 
 SampleApp (GlfwWindowPtr &&window, Optional< UInt32 > adapterId)
 
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.
 
 App (const App &)=delete
 
 App (App &&) noexcept=delete
 
auto operator= (const App &)=delete
 
auto operator= (App &&) noexcept=delete
 
virtual ~App () noexcept
 
Platform platform () const noexcept
 Returns the platform, the app is running on.
 
const IBackendoperator[] (std::type_index type) const
 Returns the registered backend instance for a type index.
 
const IBackendgetBackend (std::type_index type) const
 Returns the registered backend instance for a type index.
 
Enumerable< const IBackend & > getBackends (const BackendType type) const
 Returns all registered backend instances of a backend type.
 
template<typename TBackend >
requires meta::implements<TBackend, IBackend>
void onBackendStart (const std::function< bool(TBackend *)> &callback)
 Sets a callback that is called, if a backend is started.
 
template<typename TBackend >
requires meta::implements<TBackend, IBackend>
void onBackendStop (const std::function< void(TBackend *)> &callback)
 Sets a callback that is called, if a backend is stopped.
 
template<typename TBackend >
requires meta::implements<TBackend, IBackend>
const TBackend * findBackend () const
 Returns the registered backend instance for a type index.
 
template<typename TBackend >
requires meta::implements<TBackend, IBackend>
void startBackend ()
 Attempts to start a backend of type TBackend and stops the active backend of the same BackendType, if any.
 
template<typename TBackend >
requires meta::implements<TBackend, IBackend>
void stopBackend ()
 Stops a backend, if it is currently running.
 
virtual void use (UniquePtr< IBackend > &&backend)
 Adds a backend to the app.
 
void run ()
 Starts the application.
 
void resize (int width, int height)
 Called, if the application window resizes.
 

Static Public Member Functions

static StringView Name () noexcept
 
static AppVersion Version ()
 
static StringView Name () noexcept
 
static AppVersion Version () noexcept
 
static StringView Name () noexcept
 
static AppVersion Version () noexcept
 
static StringView Name () noexcept
 
static AppVersion Version () noexcept
 
static StringView Name () noexcept
 
static AppVersion Version () noexcept
 
static StringView Name () noexcept
 
static AppVersion Version () noexcept
 
static StringView Name () noexcept
 
static AppVersion Version () noexcept
 
static StringView Name () noexcept
 
static AppVersion Version () noexcept
 
static StringView Name () noexcept
 
static AppVersion Version () noexcept
 
static StringView Name () noexcept
 
static AppVersion Version () noexcept
 
static StringView Name () noexcept
 
static AppVersion Version () noexcept
 
static StringView Name () noexcept
 
static AppVersion Version () noexcept
 
static StringView 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.
 

Additional Inherited Members

- Public Attributes inherited from LiteFX::App
Event< const IBackend * > backendStarted
 Invoked, if a backend has been started.
 
Event< const IBackend * > backendStopped
 Invoked, if a backend has been stopped.
 
Event< EventArgsstartup
 Invoked, if the application has been started.
 
Event< EventArgsinitializing
 Invoked during initialization.
 
Event< EventArgsshutdown
 Invoked, if the application has is shutting down.
 
Event< ResizeEventArgsresized
 Invoked, if the app window or context gets resized.
 
- Protected Member Functions inherited from LiteFX::App
IBackendgetBackend (std::type_index type)
 Returns the registered backend instance for a type index.
 
template<typename TBackend >
requires meta::implements<TBackend, IBackend>
TBackend * findBackend ()
 Returns the registered backend instance for a type index.
 
void startBackend (std::type_index type) const
 Starts a backend.
 
void stopBackend (std::type_index type) const
 Stops a backend.
 
void stopActiveBackends (BackendType type) const
 Stops the active backend of type .
 
IBackendactiveBackend (BackendType type) const
 Returns the active backend of the provided backend type .
 
std::type_index activeBackendType (BackendType type) const
 Returns the type index of the active backend of the provided backend type .
 

Constructor & Destructor Documentation

◆ SampleApp() [1/13]

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

◆ SampleApp() [2/13]

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

◆ SampleApp() [3/13]

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

◆ SampleApp() [4/13]

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

◆ SampleApp() [5/13]

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

◆ SampleApp() [6/13]

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

◆ SampleApp() [7/13]

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

◆ SampleApp() [8/13]

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

◆ SampleApp() [9/13]

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

◆ SampleApp() [10/13]

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

◆ SampleApp() [11/13]

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

◆ SampleApp() [12/13]

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

◆ SampleApp() [13/13]

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

Member Function Documentation

◆ drawFrame() [1/13]

void SampleApp::drawFrame ( )

◆ drawFrame() [2/13]

void SampleApp::drawFrame ( )

◆ drawFrame() [3/13]

void SampleApp::drawFrame ( )

◆ drawFrame() [4/13]

void SampleApp::drawFrame ( )

◆ drawFrame() [5/13]

void SampleApp::drawFrame ( )

◆ drawFrame() [6/13]

void SampleApp::drawFrame ( )

◆ drawFrame() [7/13]

void SampleApp::drawFrame ( )

◆ drawFrame() [8/13]

void SampleApp::drawFrame ( )

◆ drawFrame() [9/13]

void SampleApp::drawFrame ( )

◆ drawFrame() [10/13]

void SampleApp::drawFrame ( )

◆ drawFrame() [11/13]

void SampleApp::drawFrame ( )

◆ drawFrame() [12/13]

void SampleApp::drawFrame ( )

◆ drawFrame() [13/13]

void SampleApp::drawFrame ( )

◆ drawObject()

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

◆ handleEvents() [1/13]

void SampleApp::handleEvents ( )

◆ handleEvents() [2/13]

void SampleApp::handleEvents ( )

◆ handleEvents() [3/13]

void SampleApp::handleEvents ( )

◆ handleEvents() [4/13]

void SampleApp::handleEvents ( )

◆ handleEvents() [5/13]

void SampleApp::handleEvents ( )

◆ handleEvents() [6/13]

void SampleApp::handleEvents ( )

◆ handleEvents() [7/13]

void SampleApp::handleEvents ( )

◆ handleEvents() [8/13]

void SampleApp::handleEvents ( )

◆ handleEvents() [9/13]

void SampleApp::handleEvents ( )

◆ handleEvents() [10/13]

void SampleApp::handleEvents ( )

◆ handleEvents() [11/13]

void SampleApp::handleEvents ( )

◆ handleEvents() [12/13]

void SampleApp::handleEvents ( )

◆ handleEvents() [13/13]

void SampleApp::handleEvents ( )

◆ keyDown() [1/13]

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

◆ keyDown() [2/13]

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

◆ keyDown() [3/13]

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

◆ keyDown() [4/13]

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

◆ keyDown() [5/13]

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

◆ keyDown() [6/13]

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

◆ keyDown() [7/13]

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

◆ keyDown() [8/13]

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

◆ keyDown() [9/13]

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

◆ keyDown() [10/13]

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

◆ keyDown() [11/13]

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

◆ keyDown() [12/13]

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

◆ keyDown() [13/13]

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

◆ Name() [1/13]

static StringView SampleApp::Name ( )
inlinestaticnoexcept

◆ Name() [2/13]

static StringView SampleApp::Name ( )
inlinestaticnoexcept

◆ Name() [3/13]

static StringView SampleApp::Name ( )
inlinestaticnoexcept

◆ Name() [4/13]

static StringView SampleApp::Name ( )
inlinestaticnoexcept

◆ Name() [5/13]

static StringView SampleApp::Name ( )
inlinestaticnoexcept

◆ Name() [6/13]

static StringView SampleApp::Name ( )
inlinestaticnoexcept

◆ Name() [7/13]

static StringView SampleApp::Name ( )
inlinestaticnoexcept

◆ Name() [8/13]

static StringView SampleApp::Name ( )
inlinestaticnoexcept

◆ Name() [9/13]

static StringView SampleApp::Name ( )
inlinestaticnoexcept

◆ Name() [10/13]

static StringView SampleApp::Name ( )
inlinestaticnoexcept

◆ Name() [11/13]

static StringView SampleApp::Name ( )
inlinestaticnoexcept

◆ Name() [12/13]

static StringView SampleApp::Name ( )
inlinestaticnoexcept

◆ Name() [13/13]

static StringView SampleApp::Name ( )
inlinestaticnoexcept

◆ name() [1/13]

StringView SampleApp::name ( ) const
inlineoverridevirtualnoexcept

Returns the name of the app.

Returns
The name of the app.

Implements LiteFX::App.

◆ name() [2/13]

StringView SampleApp::name ( ) const
inlineoverridevirtualnoexcept

Returns the name of the app.

Returns
The name of the app.

Implements LiteFX::App.

◆ name() [3/13]

StringView SampleApp::name ( ) const
inlineoverridevirtualnoexcept

Returns the name of the app.

Returns
The name of the app.

Implements LiteFX::App.

◆ name() [4/13]

StringView SampleApp::name ( ) const
inlineoverridevirtualnoexcept

Returns the name of the app.

Returns
The name of the app.

Implements LiteFX::App.

◆ name() [5/13]

StringView SampleApp::name ( ) const
inlineoverridevirtualnoexcept

Returns the name of the app.

Returns
The name of the app.

Implements LiteFX::App.

◆ name() [6/13]

StringView SampleApp::name ( ) const
inlineoverridevirtualnoexcept

Returns the name of the app.

Returns
The name of the app.

Implements LiteFX::App.

◆ name() [7/13]

StringView SampleApp::name ( ) const
inlineoverridevirtualnoexcept

Returns the name of the app.

Returns
The name of the app.

Implements LiteFX::App.

◆ name() [8/13]

StringView SampleApp::name ( ) const
inlineoverridevirtualnoexcept

Returns the name of the app.

Returns
The name of the app.

Implements LiteFX::App.

◆ name() [9/13]

StringView SampleApp::name ( ) const
inlineoverridevirtualnoexcept

Returns the name of the app.

Returns
The name of the app.

Implements LiteFX::App.

◆ name() [10/13]

StringView SampleApp::name ( ) const
inlineoverridevirtualnoexcept

Returns the name of the app.

Returns
The name of the app.

Implements LiteFX::App.

◆ name() [11/13]

StringView SampleApp::name ( ) const
inlineoverridevirtualnoexcept

Returns the name of the app.

Returns
The name of the app.

Implements LiteFX::App.

◆ name() [12/13]

StringView SampleApp::name ( ) const
inlineoverridevirtualnoexcept

Returns the name of the app.

Returns
The name of the app.

Implements LiteFX::App.

◆ name() [13/13]

StringView SampleApp::name ( ) const
inlineoverridevirtualnoexcept

Returns the name of the app.

Returns
The name of the app.

Implements LiteFX::App.

◆ updateCamera()

void SampleApp::updateCamera ( const ICommandBuffer & commandBuffer,
IBuffer & buffer ) const

Updates the camera buffer. This needs to be done whenever the frame buffer changes, since we need to pass changes in the aspect ratio to the view/projection matrix.

◆ updateWindowTitle() [1/13]

void SampleApp::updateWindowTitle ( )

◆ updateWindowTitle() [2/13]

void SampleApp::updateWindowTitle ( )

◆ updateWindowTitle() [3/13]

void SampleApp::updateWindowTitle ( )

◆ updateWindowTitle() [4/13]

void SampleApp::updateWindowTitle ( )

◆ updateWindowTitle() [5/13]

void SampleApp::updateWindowTitle ( )

◆ updateWindowTitle() [6/13]

void SampleApp::updateWindowTitle ( )

◆ updateWindowTitle() [7/13]

void SampleApp::updateWindowTitle ( )

◆ updateWindowTitle() [8/13]

void SampleApp::updateWindowTitle ( )

◆ updateWindowTitle() [9/13]

void SampleApp::updateWindowTitle ( )

◆ updateWindowTitle() [10/13]

void SampleApp::updateWindowTitle ( )

◆ updateWindowTitle() [11/13]

void SampleApp::updateWindowTitle ( )

◆ updateWindowTitle() [12/13]

void SampleApp::updateWindowTitle ( )

◆ updateWindowTitle() [13/13]

void SampleApp::updateWindowTitle ( )

◆ Version() [1/13]

static AppVersion SampleApp::Version ( )
inlinestatic

◆ Version() [2/13]

static AppVersion SampleApp::Version ( )
inlinestaticnoexcept

◆ Version() [3/13]

static AppVersion SampleApp::Version ( )
inlinestaticnoexcept

◆ Version() [4/13]

static AppVersion SampleApp::Version ( )
inlinestaticnoexcept

◆ Version() [5/13]

static AppVersion SampleApp::Version ( )
inlinestaticnoexcept

◆ Version() [6/13]

static AppVersion SampleApp::Version ( )
inlinestaticnoexcept

◆ Version() [7/13]

static AppVersion SampleApp::Version ( )
inlinestaticnoexcept

◆ Version() [8/13]

static AppVersion SampleApp::Version ( )
inlinestaticnoexcept

◆ Version() [9/13]

static AppVersion SampleApp::Version ( )
inlinestaticnoexcept

◆ Version() [10/13]

static AppVersion SampleApp::Version ( )
inlinestaticnoexcept

◆ Version() [11/13]

static AppVersion SampleApp::Version ( )
inlinestaticnoexcept

◆ Version() [12/13]

static AppVersion SampleApp::Version ( )
inlinestaticnoexcept

◆ Version() [13/13]

static AppVersion SampleApp::Version ( )
inlinestaticnoexcept

◆ version() [1/13]

AppVersion SampleApp::version ( ) const
inlineoverridevirtualnoexcept

Returns the version of the app.

Returns
The version of the app.

Implements LiteFX::App.

◆ version() [2/13]

AppVersion SampleApp::version ( ) const
inlineoverridevirtualnoexcept

Returns the version of the app.

Returns
The version of the app.

Implements LiteFX::App.

◆ version() [3/13]

AppVersion SampleApp::version ( ) const
inlineoverridevirtualnoexcept

Returns the version of the app.

Returns
The version of the app.

Implements LiteFX::App.

◆ version() [4/13]

AppVersion SampleApp::version ( ) const
inlineoverridevirtualnoexcept

Returns the version of the app.

Returns
The version of the app.

Implements LiteFX::App.

◆ version() [5/13]

AppVersion SampleApp::version ( ) const
inlineoverridevirtualnoexcept

Returns the version of the app.

Returns
The version of the app.

Implements LiteFX::App.

◆ version() [6/13]

AppVersion SampleApp::version ( ) const
inlineoverridevirtualnoexcept

Returns the version of the app.

Returns
The version of the app.

Implements LiteFX::App.

◆ version() [7/13]

AppVersion SampleApp::version ( ) const
inlineoverridevirtualnoexcept

Returns the version of the app.

Returns
The version of the app.

Implements LiteFX::App.

◆ version() [8/13]

AppVersion SampleApp::version ( ) const
inlineoverridevirtualnoexcept

Returns the version of the app.

Returns
The version of the app.

Implements LiteFX::App.

◆ version() [9/13]

AppVersion SampleApp::version ( ) const
inlineoverridevirtualnoexcept

Returns the version of the app.

Returns
The version of the app.

Implements LiteFX::App.

◆ version() [10/13]

AppVersion SampleApp::version ( ) const
inlineoverridevirtualnoexcept

Returns the version of the app.

Returns
The version of the app.

Implements LiteFX::App.

◆ version() [11/13]

AppVersion SampleApp::version ( ) const
inlineoverridevirtualnoexcept

Returns the version of the app.

Returns
The version of the app.

Implements LiteFX::App.

◆ version() [12/13]

AppVersion SampleApp::version ( ) const
inlineoverridevirtualnoexcept

Returns the version of the app.

Returns
The version of the app.

Implements LiteFX::App.

◆ version() [13/13]

AppVersion SampleApp::version ( ) const
inlineoverridevirtualnoexcept

Returns the version of the app.

Returns
The version of the app.

Implements LiteFX::App.