summaryrefslogtreecommitdiffhomepage
path: root/loader/loader.hpp
blob: e3f306ea4701c1433c4ffbe2c588e9b7bd04490d (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
#pragma once
#include <memory>

namespace Magnum { using Vector2ub = Math::Vector2<unsigned char>; }

namespace floormat {

struct tile_atlas;
struct anim_atlas;

struct loader_
{
    virtual StringView shader(StringView filename) = 0;
    virtual std::shared_ptr<struct tile_atlas> tile_atlas(StringView filename, Vector2ub size) = 0;
    virtual ArrayView<String> anim_atlas_list() = 0;
    virtual std::shared_ptr<struct anim_atlas> anim_atlas(StringView name) = 0;
    static void destroy();
    static loader_& default_loader() noexcept;

    loader_(const loader_&) = delete;
    loader_& operator=(const loader_&) = delete;

    virtual ~loader_();

    static const StringView IMAGE_PATH;
    static const StringView ANIM_PATH;

protected:
    loader_();
};

extern loader_& loader; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)

} // namespace floormat