diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-11-16 11:07:49 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-11-16 11:07:49 +0100 |
commit | 3a29b9984760af0b3a85e35190e1dede39e13891 (patch) | |
tree | c9baa5cb9204d15d081ef73a82729b493e6898fb /src/graphics/Sprite.cpp | |
parent | 01e3403abf86050e4096ecf60466de4139ac78e2 (diff) |
Implement all interfaces to mgl
Diffstat (limited to 'src/graphics/Sprite.cpp')
-rw-r--r-- | src/graphics/Sprite.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/graphics/Sprite.cpp b/src/graphics/Sprite.cpp index b9066ee..e6cef73 100644 --- a/src/graphics/Sprite.cpp +++ b/src/graphics/Sprite.cpp @@ -9,7 +9,8 @@ namespace mgl { Sprite::Sprite() : Sprite(nullptr, vec2f(0.0f, 0.0f)) {} Sprite::Sprite(Texture *texture, vec2f position) : texture(texture) { - mgl_sprite_init(&sprite, texture ? texture->internal_texture() : nullptr, position.x, position.y); + mgl_sprite_init(&sprite, texture ? texture->internal_texture() : nullptr); + set_position(position); } Sprite::~Sprite() { @@ -41,14 +42,12 @@ namespace mgl { sprite.scale = { scale, scale }; } - // TODO: Implement void Sprite::set_rotation(float degrees) { - + mgl_sprite_set_rotation(&sprite, degrees); } - // TODO: Implement void Sprite::set_origin(vec2f origin) { - + mgl_sprite_set_origin(&sprite, *(mgl_vec2f*)&origin); } vec2f Sprite::get_scale() const { |