mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-26 14:08:53 -05:00
Add access to deltaTime/getDt in SGCT/WindowWrapper
This commit is contained in:
@@ -42,6 +42,7 @@ public:
|
||||
bool windowHasResized() const override;
|
||||
|
||||
double averageDeltaTime() const override;
|
||||
double deltaTime() const override;
|
||||
glm::vec2 mousePosition() const override;
|
||||
uint32_t mouseButtons(int maxNumber) const override;
|
||||
glm::ivec2 currentWindowSize() const override;
|
||||
|
||||
@@ -79,6 +79,12 @@ public:
|
||||
*/
|
||||
virtual double averageDeltaTime() const;
|
||||
|
||||
/**
|
||||
* Returns the frametime in seconds. On default, this method returns <code>0.0</code>.
|
||||
* \return The frametime in seconds
|
||||
*/
|
||||
virtual double deltaTime() const;
|
||||
|
||||
/**
|
||||
* Returns the location of the mouse cursor in pixel screen coordinates. On default,
|
||||
* this method returns <code>0,0</code>.
|
||||
|
||||
@@ -61,6 +61,10 @@ bool SGCTWindowWrapper::windowHasResized() const {
|
||||
double SGCTWindowWrapper::averageDeltaTime() const {
|
||||
return sgct::Engine::instance()->getAvgDt();
|
||||
}
|
||||
|
||||
double SGCTWindowWrapper::deltaTime() const {
|
||||
return sgct::Engine::instance()->getDt();
|
||||
}
|
||||
|
||||
glm::vec2 SGCTWindowWrapper::mousePosition() const {
|
||||
int id = sgct::Engine::instance()->getCurrentWindowPtr()->getId();
|
||||
|
||||
@@ -45,6 +45,10 @@ bool WindowWrapper::windowHasResized() const {
|
||||
double WindowWrapper::averageDeltaTime() const {
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
double WindowWrapper::deltaTime() const {
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
glm::vec2 WindowWrapper::mousePosition() const {
|
||||
return glm::vec2(0.f);
|
||||
|
||||
Reference in New Issue
Block a user