aboutsummaryrefslogtreecommitdiff
path: root/include/mglpp/window/Window.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/mglpp/window/Window.hpp')
-rw-r--r--include/mglpp/window/Window.hpp28
1 files changed, 22 insertions, 6 deletions
diff --git a/include/mglpp/window/Window.hpp b/include/mglpp/window/Window.hpp
index 2ef6526..1ce399c 100644
--- a/include/mglpp/window/Window.hpp
+++ b/include/mglpp/window/Window.hpp
@@ -4,7 +4,10 @@
#include "../graphics/PrimitiveType.hpp"
#include "../graphics/Color.hpp"
#include "../system/vec.hpp"
+#include "Keyboard.hpp"
+#include "Mouse.hpp"
#include <stddef.h>
+#include <string>
extern "C" {
#include <mgl/window/window.h>
@@ -25,16 +28,19 @@ namespace mgl {
class Window {
public:
- class Delegate {
- public:
- virtual ~Delegate() = default;
- virtual void draw() = 0;
+ /* Has to match mgl_window_create_params */
+ struct CreateParams {
+ mgl::vec2i position;
+ mgl::vec2i size;
+ mgl::vec2i min_size; /* (0, 0) = no limit */
+ mgl::vec2i max_size; /* (0, 0) = no limit */
+ WindowHandle parent_window = 0; /* 0 = root window */
};
Window();
~Window();
- bool create(const char *title, int width, int height);
+ bool create(const char *title, CreateParams create_params);
// Initialize this window from an existing window
bool create(WindowHandle existing_window);
@@ -53,7 +59,11 @@ namespace mgl {
void set_key_repeat_enabled(bool enabled);
void set_cursor_visible(bool visible);
vec2i get_size() const;
- vec2i get_cursor_position() const;
+ void set_size(mgl::vec2i size);
+ void set_position(mgl::vec2i position);
+ /* if |minimum| is (0, 0) then there is no minimum limit, if |maximum| is (0, 0) then there is no maximum limit */
+ void set_size_limits(mgl::vec2i minimum, mgl::vec2i maximum);
+ vec2i get_mouse_position() const;
/*
This should be called every frame to retain the view.
@@ -64,6 +74,12 @@ namespace mgl {
void set_view(const View &new_view);
View get_view();
+ bool is_key_pressed(Keyboard::Key key) const;
+ bool is_mouse_button_pressed(Mouse::Button button) const;
+
+ void set_clipboard(const std::string &str);
+ std::string get_clipboard();
+
WindowHandle get_system_handle() const;
private:
mgl_window window;