stellarlib 0.1.0
Loading...
Searching...
No Matches
stellarlib::app::scene Class Referenceabstract

Application scene interface. More...

#include <scene.hpp>

Public Member Functions

virtual ~scene () noexcept=0
 Destructor.

Protected Member Functions

 scene () noexcept
 Default constructor.
 scene (const scene &other) noexcept
 Copy constructor.
 scene (scene &&other) noexcept
 Move constructor.
auto operator= (const scene &other) noexcept -> scene &
 Copy assignment operator.
auto operator= (scene &&other) noexcept -> scene &
 Move assignment operator.
virtual void begin (class context &ctx)
 Called after the previous scene has finished deactivation and before the first update.
virtual constexpr auto update (class context &ctx) -> std::optional< std::unique_ptr< scene > >=0
 Called once per frame.
virtual void end (class context &ctx)
 Called after the last update and before the next scene begins activation.

Friends

class context

Detailed Description

Application scene interface.

Examples
examples/scenes.cpp.

Constructor & Destructor Documentation

◆ scene() [1/2]

stellarlib::app::scene::scene ( const scene & other)
nodiscardprotectednoexcept

Copy constructor.

Parameters
otherOther instance

◆ scene() [2/2]

stellarlib::app::scene::scene ( scene && other)
nodiscardprotectednoexcept

Move constructor.

Parameters
otherOther instance

Member Function Documentation

◆ operator=() [1/2]

auto stellarlib::app::scene::operator= ( const scene & other) -> scene &
protectednoexcept

Copy assignment operator.

Parameters
otherOther instance
Returns
Current instance

◆ operator=() [2/2]

auto stellarlib::app::scene::operator= ( scene && other) -> scene &
protectednoexcept

Move assignment operator.

Parameters
otherOther instance
Returns
Current instance

◆ begin()

virtual void stellarlib::app::scene::begin ( class context & ctx)
protectedvirtual

Called after the previous scene has finished deactivation and before the first update.

Parameters
ctxGlobal application context

◆ update()

virtual constexpr auto stellarlib::app::scene::update ( class context & ctx) -> std::optional< std::unique_ptr< scene > >
nodiscardconstexprprotectedpure virtual

Called once per frame.

Parameters
ctxGlobal application context
Returns
std::nullopt to continue execution, a scene instance to request a transition or nullptr to terminate the application

◆ end()

virtual void stellarlib::app::scene::end ( class context & ctx)
protectedvirtual

Called after the last update and before the next scene begins activation.

Parameters
ctxGlobal application context

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