summaryrefslogtreecommitdiffhomepage
path: root/loader/loader.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'loader/loader.hpp')
-rw-r--r--loader/loader.hpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/loader/loader.hpp b/loader/loader.hpp
new file mode 100644
index 00000000..32158675
--- /dev/null
+++ b/loader/loader.hpp
@@ -0,0 +1,36 @@
+#pragma once
+
+#include <memory>
+#include <Corrade/Containers/ArrayView.h>
+#include <Corrade/Containers/StringView.h>
+#include <Magnum/Trade/ImageData.h>
+
+#define FM_IMAGE_PATH "share/floormat/images/"
+#define FM_ANIM_PATH "share/floormat/anim/"
+
+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_();
+
+protected:
+ loader_();
+};
+
+extern loader_& loader; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
+
+} // namespace floormat