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

#include <Corrade/Containers/StringView.h>
#include <Magnum/Trade/ImageData.h>

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

namespace Magnum::Examples {

struct tile_atlas;

struct loader_
{
    virtual std::string shader(const Containers::StringView& filename) = 0;
    virtual Trade::ImageData2D tile_texture(const Containers::StringView& filename) = 0;
    virtual std::shared_ptr<struct tile_atlas> tile_atlas(const Containers::StringView& filename, Vector2i 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 Magnum::Examples