mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-17 08:39:19 +02:00
Every module unit now includes the standard headers it uses. Declarations reaching a unit only through an imported module's global module fragment are reachable but not visible, so ADL misses the free operators older libstdc++ declares beside a type - reproduced on ubuntu 24.04 (libstdc++ 13), where gl/vao.cpp could not compare vector iterators. Also drops a stale editor/editorSettings.hpp from the MSVC source list, which broke the Windows configure step, silences the deliberate include-in-purview warning in the glm wrapper, and removes GCC support: clang or MSVC only.
67 lines
2.1 KiB
C++
67 lines
2.1 KiB
C++
/*
|
|
This Source Code Form is subject to the
|
|
terms of the Mozilla Public License, v.
|
|
2.0. If a copy of the MPL was not
|
|
distributed with this file, You can
|
|
obtain one at
|
|
http://mozilla.org/MPL/2.0/.
|
|
*/
|
|
|
|
|
|
|
|
// component implementing specific mode of application behaviour
|
|
// base interface
|
|
module;
|
|
#include <string>
|
|
#include <memory>
|
|
|
|
export module eu07.application.applicationmode;
|
|
import eu07.application.uilayer;
|
|
export {
|
|
class application_mode {
|
|
|
|
public:
|
|
// destructor
|
|
virtual ~application_mode() = default;
|
|
// methods;
|
|
// initializes internal data structures of the mode. returns: true on success, false otherwise
|
|
virtual bool init() = 0;
|
|
// mode-specific update of simulation data. returns: false on error, true otherwise
|
|
virtual bool update() = 0;
|
|
// draws mode-specific user interface
|
|
inline
|
|
void render_ui() {
|
|
if( m_userinterface != nullptr ) {
|
|
m_userinterface->render(); } }
|
|
inline
|
|
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 ) {
|
|
if( m_userinterface != nullptr ) {
|
|
m_userinterface->set_progress( Progress, Subtaskprogress ); } }
|
|
inline
|
|
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;
|
|
// maintenance method, called when the mode is deactivated
|
|
virtual void exit() = 0;
|
|
// input handlers
|
|
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
|
|
std::shared_ptr<ui_layer> m_userinterface;
|
|
};
|
|
|
|
} // export
|