diff options
m--------- | depends/mgl | 0 | ||||
-rw-r--r-- | include/mglpp/graphics/Sprite.hpp | 1 | ||||
-rw-r--r-- | include/mglpp/window/Window.hpp | 1 | ||||
-rw-r--r-- | src/graphics/Sprite.cpp | 9 | ||||
-rw-r--r-- | src/window/Window.cpp | 2 |
5 files changed, 8 insertions, 5 deletions
diff --git a/depends/mgl b/depends/mgl -Subproject 1a1ce3f6733b524122bdfe33e4b662803a69816 +Subproject b4799373f7fb9c8faec813e78a955438301cb9d diff --git a/include/mglpp/graphics/Sprite.hpp b/include/mglpp/graphics/Sprite.hpp index 21b2a41..67f7cad 100644 --- a/include/mglpp/graphics/Sprite.hpp +++ b/include/mglpp/graphics/Sprite.hpp @@ -25,6 +25,7 @@ namespace mgl { void set_scale(vec2f scale); void set_scale(float scale); void set_size(vec2f size); + void set_height(float height); void set_rotation(float degrees); void set_origin(vec2f origin); diff --git a/include/mglpp/window/Window.hpp b/include/mglpp/window/Window.hpp index 7fa1117..08cd435 100644 --- a/include/mglpp/window/Window.hpp +++ b/include/mglpp/window/Window.hpp @@ -45,6 +45,7 @@ namespace mgl { bool hidden = false; bool override_redirect = false; bool support_alpha = false; /* support alpha for the window */ + bool hide_decorations = false; /* this is a hint, it may be ignored by the window manager */ Color background_color = {0, 0, 0, 0}; const char *class_name = nullptr; mgl_window_type window_type = MGL_WINDOW_TYPE_NORMAL; diff --git a/src/graphics/Sprite.cpp b/src/graphics/Sprite.cpp index 461b14c..f2ba460 100644 --- a/src/graphics/Sprite.cpp +++ b/src/graphics/Sprite.cpp @@ -50,10 +50,11 @@ namespace mgl { } void Sprite::set_size(vec2f size) { - if(texture) - set_scale({ size.x / (float)texture->get_size().x, size.y / (float)texture->get_size().y }); - else - set_scale({ 0.0f, 0.0f }); + mgl_sprite_set_size(&sprite, *(mgl_vec2f*)&size); + } + + void Sprite::set_height(float height) { + mgl_sprite_set_height(&sprite, height); } void Sprite::set_rotation(float degrees) { diff --git a/src/window/Window.cpp b/src/window/Window.cpp index d519e2f..cf6f64b 100644 --- a/src/window/Window.cpp +++ b/src/window/Window.cpp @@ -27,7 +27,7 @@ namespace mgl { bool Window::create(const char *title, CreateParams create_params) { if(window.window) return false; - return mgl_window_create(&window, title, (mgl_window_create_params*)&create_params) == 0; + return mgl_window_create(&window, title, (const mgl_window_create_params*)&create_params) == 0; } bool Window::create(WindowHandle existing_window) { |