aboutsummaryrefslogtreecommitdiff
path: root/include/mglpp/graphics/Texture.hpp
blob: 9559829bb18c1b2528c9a03eb90818b859fc0b38 (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
#ifndef MGLPP_TEXTURE_HPP
#define MGLPP_TEXTURE_HPP

#include "../system/vec.hpp"

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

namespace mgl {
    class Image;
    class Texture {
    public:
        Texture();
        ~Texture();

        static Texture reference(mgl_texture ref);

        bool load_from_file(const char *filepath);
        bool load_from_image(Image &image);
        vec2i get_size() const;
        bool is_valid() const;

        mgl_texture* internal_texture();
    private:
        mgl_texture texture;
        bool owned = true;
    };
}

#endif /* MGLPP_TEXTURE_HPP */