summaryrefslogtreecommitdiffhomepage
path: root/src/loader.hpp
blob: 0bb541f5fac595347a24f06cf098fc780820f6cf (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 <Corrade/Containers/StringView.h>
#include <Magnum/Trade/ImageData.h>

#include <string>
#include <optional>
#include <memory>

#define IMAGE_PATH "share/floormat/images/"

namespace floormat {

struct tile_atlas;

struct loader_
{
    virtual std::string shader(Containers::StringView filename) = 0;
    virtual Trade::ImageData2D tile_texture(Containers::StringView filename) = 0;
    virtual std::shared_ptr<struct tile_atlas> tile_atlas(Containers::StringView filename, Vector2ui size) = 0;
    static void destroy();

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

    virtual ~loader_();

protected:
    loader_();
};

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

} // namespace floormat