mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
Make launcher respond to window resize
This commit is contained in:
@@ -17,65 +17,41 @@ class application_mode {
|
||||
|
||||
public:
|
||||
// destructor
|
||||
virtual
|
||||
~application_mode() = default;
|
||||
virtual ~application_mode() = default;
|
||||
// methods;
|
||||
// initializes internal data structures of the mode. returns: true on success, false otherwise
|
||||
virtual
|
||||
bool
|
||||
init() = 0;
|
||||
virtual bool init() = 0;
|
||||
// mode-specific update of simulation data. returns: false on error, true otherwise
|
||||
virtual
|
||||
bool
|
||||
update() = 0;
|
||||
virtual bool update() = 0;
|
||||
// draws mode-specific user interface
|
||||
inline
|
||||
void
|
||||
render_ui() {
|
||||
void render_ui() {
|
||||
if( m_userinterface != nullptr ) {
|
||||
m_userinterface->render(); } }
|
||||
inline
|
||||
void
|
||||
begin_ui_frame() {
|
||||
void begin_ui_frame() {
|
||||
if( m_userinterface != nullptr ) {
|
||||
m_userinterface->begin_ui_frame(); } }
|
||||
inline
|
||||
void
|
||||
set_progress( float const Progress = 0.f, float const Subtaskprogress = 0.f ) {
|
||||
void set_progress( float const Progress = 0.f, float const Subtaskprogress = 0.f ) {
|
||||
if( m_userinterface != nullptr ) {
|
||||
m_userinterface->set_progress( Progress, Subtaskprogress ); } }
|
||||
inline
|
||||
void
|
||||
set_tooltip( std::string const &Tooltip ) {
|
||||
void set_tooltip( std::string const &Tooltip ) {
|
||||
if( m_userinterface != nullptr ) {
|
||||
m_userinterface->set_tooltip( Tooltip ); } }
|
||||
// maintenance method, called when the mode is activated
|
||||
virtual
|
||||
void
|
||||
enter() = 0;
|
||||
virtual void enter() = 0;
|
||||
// maintenance method, called when the mode is deactivated
|
||||
virtual
|
||||
void
|
||||
exit() = 0;
|
||||
virtual void exit() = 0;
|
||||
// input handlers
|
||||
virtual
|
||||
void
|
||||
on_key( int const Key, int const Scancode, int const Action, int const Mods ) = 0;
|
||||
virtual
|
||||
void
|
||||
on_cursor_pos( double const X, double const Y ) = 0;
|
||||
virtual
|
||||
void
|
||||
on_mouse_button( int const Button, int const Action, int const Mods ) = 0;
|
||||
virtual
|
||||
void
|
||||
on_scroll( double const Xoffset, double const Yoffset ) = 0;
|
||||
virtual
|
||||
void
|
||||
on_event_poll() = 0;
|
||||
virtual
|
||||
bool
|
||||
is_command_processor() const = 0;
|
||||
virtual void on_key( int Key, int Scancode, int Action, int Mods ) = 0;
|
||||
virtual void on_cursor_pos( double X, double Y ) = 0;
|
||||
virtual void on_mouse_button( int Button, int Action, int Mods ) = 0;
|
||||
virtual void on_scroll( double Xoffset, double Yoffset ) = 0;
|
||||
virtual void on_window_resize( int w, int h ) = 0;
|
||||
virtual void on_event_poll() = 0;
|
||||
virtual bool is_command_processor() const = 0;
|
||||
|
||||
protected:
|
||||
// members
|
||||
|
||||
Reference in New Issue
Block a user