summaryrefslogtreecommitdiffhomepage
path: root/loader/loader.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-11-12 13:43:34 +0100
committerStanislaw Halik <sthalik@misaki.pl>2022-11-12 17:47:30 +0100
commitd481edb3619e251285c238c05f47a121ecd96df7 (patch)
treeff81314fbcb75ad1272285b827b6c2e8f3ac694e /loader/loader.hpp
parent58bf715b7932be0e6e611cbde0c6aa6fe82a6f70 (diff)
cmake: add targets for loader, serialize, draw
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