aboutsummaryrefslogtreecommitdiff
path: root/include/mglpp/graphics/Sprite.hpp
blob: d3b8885aa8fe444d2ce0e1652131669654d6c3bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef MGLPP_SPRITE_HPP
#define MGLPP_SPRITE_HPP

#include "Drawable.hpp"

extern "C" {
#include <mgl/graphics/sprite.h>
}

namespace mgl {
    class Texture;
    class Sprite : public Drawable {
    public:
        Sprite(Texture &texture, vec2f position);
        ~Sprite();

        void set_position(vec2f position) override;
        void set_color(Color color) override;
        vec2f get_position() const override;
        void set_scale(vec2f scale);
        void set_scale(float scale);

        vec2f get_scale() const;

        const Texture& get_texture() const;
    protected:
        void draw(Window &window) override;
    private:
        mgl_sprite sprite;
        Texture &texture;
    };
}

#endif /* MGLPP_SPRITE_HPP */