aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/mglpp/window/Window.hpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/mglpp/window/Window.hpp b/include/mglpp/window/Window.hpp
index 88a025c..2ef6526 100644
--- a/include/mglpp/window/Window.hpp
+++ b/include/mglpp/window/Window.hpp
@@ -18,6 +18,11 @@ namespace mgl {
class Shader;
class Vertex;
+ struct View {
+ vec2i position;
+ vec2i size;
+ };
+
class Window {
public:
class Delegate {
@@ -49,6 +54,16 @@ namespace mgl {
void set_cursor_visible(bool visible);
vec2i get_size() const;
vec2i get_cursor_position() const;
+
+ /*
+ This should be called every frame to retain the view.
+ Make sure to set the view back to the previous view after rendering items
+ by saving the previous view with |get_view| and then call
+ |set_view| with that saved view.
+ */
+ void set_view(const View &new_view);
+ View get_view();
+
WindowHandle get_system_handle() const;
private:
mgl_window window;