mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-22 12:59:07 -06:00
Started change moving from explicit SGCT functions to wrapper class
This commit is contained in:
@@ -46,7 +46,7 @@ class GUI;
|
||||
class RenderEngine;
|
||||
class SyncBuffer;
|
||||
class ModuleEngine;
|
||||
class Window;
|
||||
class WindowHandler;
|
||||
|
||||
namespace interaction {
|
||||
class InteractionHandler;
|
||||
@@ -68,7 +68,7 @@ namespace properties {
|
||||
|
||||
class OpenSpaceEngine {
|
||||
public:
|
||||
static bool create(int argc, char** argv, Window* windowHandler, std::vector<std::string>& sgctArguments);
|
||||
static bool create(int argc, char** argv, WindowHandler* windowHandler, std::vector<std::string>& sgctArguments);
|
||||
static void destroy();
|
||||
static OpenSpaceEngine& ref();
|
||||
|
||||
@@ -90,7 +90,7 @@ public:
|
||||
ModuleEngine* moduleEngine();
|
||||
network::ParallelConnection* parallelConnection();
|
||||
properties::PropertyOwner* globalPropertyOwner();
|
||||
Window* windowWrapper();
|
||||
WindowHandler* windowWrapper();
|
||||
|
||||
gui::GUI* gui();
|
||||
|
||||
@@ -115,7 +115,7 @@ public:
|
||||
void runSettingsScripts();
|
||||
|
||||
private:
|
||||
OpenSpaceEngine(std::string programName, Window* windowHandler);
|
||||
OpenSpaceEngine(std::string programName, WindowHandler* windowHandler);
|
||||
~OpenSpaceEngine();
|
||||
OpenSpaceEngine(const OpenSpaceEngine& rhs) = delete;
|
||||
|
||||
@@ -139,7 +139,7 @@ private:
|
||||
ModuleEngine* _moduleEngine;
|
||||
gui::GUI* _gui;
|
||||
network::ParallelConnection* _parallelConnection;
|
||||
Window* _windowWrapper;
|
||||
WindowHandler* _windowHandler;
|
||||
|
||||
properties::PropertyOwner* _globalPropertyNamespace;
|
||||
|
||||
|
||||
@@ -22,18 +22,28 @@
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
|
||||
#ifndef __SGCTWINDOW_H__
|
||||
#define __SGCTWINDOW_H__
|
||||
#ifndef __SGCTWINDOWHANDLER_H__
|
||||
#define __SGCTWINDOWHANDLER_H__
|
||||
|
||||
#include <openspace/engine/window.h>
|
||||
#include <openspace/engine/windowhandler.h>
|
||||
|
||||
namespace openspace {
|
||||
|
||||
class SGCTWindow : public Window {
|
||||
class SGCTWindowHandler : public WindowHandler {
|
||||
public:
|
||||
void setBarrier(bool enabled) override;
|
||||
void clearAllWindows() override;
|
||||
|
||||
double averageDeltaTime() override;
|
||||
glm::vec2 mousePosition() override;
|
||||
glm::ivec2 currentWindowSize() override;
|
||||
glm::ivec2 currentWindowResolution() override;
|
||||
|
||||
|
||||
// void forEachWindow(std::function<void (void)> function) override;
|
||||
|
||||
};
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
#endif // __SGCTWINDOW_H__
|
||||
#endif // __SGCTWINDOWHANDLER_H__
|
||||
@@ -22,14 +22,29 @@
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
|
||||
#ifndef __WINDOW_H__
|
||||
#define __WINDOW_H__
|
||||
#ifndef __WINDOWHANDLER_H__
|
||||
#define __WINDOWHANDLER_H__
|
||||
|
||||
#include <ghoul/glm.h>
|
||||
|
||||
#include <functional>
|
||||
|
||||
namespace openspace {
|
||||
|
||||
class Window {
|
||||
class WindowHandler {
|
||||
public:
|
||||
virtual void setBarrier(bool enabled) = 0;
|
||||
virtual void clearAllWindows() = 0;
|
||||
virtual double averageDeltaTime() = 0;
|
||||
virtual glm::vec2 mousePosition() = 0;
|
||||
virtual glm::ivec2 currentWindowSize() = 0;
|
||||
virtual glm::ivec2 currentWindowResolution() = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
//virtual void forEachWindow(std::function<void (void)> function) = 0;
|
||||
|
||||
};
|
||||
|
||||
} // namespace openspace
|
||||
Reference in New Issue
Block a user