MeshLib C++ Docs
Loading...
Searching...
No Matches
MRSaveOnClose.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRViewerPlugin.h"
5
6namespace MR
7{
10
11
13class MRVIEWER_CLASS SaveOnClosePlugin : public MR::ViewerPlugin, public MultiListener<PreDrawListener,InterruptCloseListener>
14{
15public:
16 MRVIEWER_API virtual void init( Viewer* _viewer ) override;
17 MRVIEWER_API virtual void shutdown() override;
18
19private:
20 virtual void preDraw_() override;
21 virtual bool interruptClose_() override;
22
23 bool initialized_{ false };
24 bool shouldClose_{ false };
25 bool showCloseModal_{ false };
27 float activeModalHighlightTimer_{ 0.0f };
28};
29
30}
this plugin will show a message to the user if she closes the application when something is modified
Definition MRSaveOnClose.h:14
Definition MRViewerPlugin.h:30
GLFW-based mesh viewer.
Definition MRViewer.h:69
virtual MRVIEWER_API void shutdown() override
This function is called before shutdown.
virtual MRVIEWER_API void init(Viewer *_viewer) override
This function is called when the viewer is initialized (no mesh will be loaded at this stage)
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
Definition MRViewerEventsListener.h:32