mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-06 03:29:44 -06:00
Add the ability to limit-rate the dashboard updating (#3527)
Co-authored-by: Emma Broman <emma.broman@liu.se>
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
#include <openspace/properties/propertyowner.h>
|
||||
|
||||
#include <openspace/properties/scalar/boolproperty.h>
|
||||
#include <openspace/properties/scalar/intproperty.h>
|
||||
#include <openspace/properties/vector/ivec2property.h>
|
||||
#include <openspace/rendering/dashboarditem.h>
|
||||
#include <ghoul/glm.h>
|
||||
@@ -43,6 +44,14 @@ public:
|
||||
Dashboard();
|
||||
virtual ~Dashboard() override = default;
|
||||
|
||||
/**
|
||||
* Renders all of the items of this Dashboard at the provided \p penPosition. The
|
||||
* position is provided in pixels with the top-left corner being located at (0,0). The
|
||||
* rendering of the DashboardItems will update the \p penPosition according to where
|
||||
* the next item should be placed.
|
||||
*
|
||||
* \param penPosition The location at which we want to render the dashboard items
|
||||
*/
|
||||
void render(glm::vec2& penPosition);
|
||||
|
||||
void addDashboardItem(std::unique_ptr<DashboardItem> item);
|
||||
@@ -63,8 +72,10 @@ public:
|
||||
private:
|
||||
properties::BoolProperty _isEnabled;
|
||||
properties::IVec2Property _startPositionOffset;
|
||||
properties::IntProperty _refreshRate;
|
||||
|
||||
std::vector<std::unique_ptr<DashboardItem>> _items;
|
||||
std::chrono::steady_clock::time_point _lastRefresh;
|
||||
};
|
||||
|
||||
} // openspace
|
||||
|
||||
Reference in New Issue
Block a user