aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/graphics/Sprite.cpp9
-rw-r--r--src/window/Window.cpp2
2 files changed, 6 insertions, 5 deletions
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) {