aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/Resource.h
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-12-10 19:19:10 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-12-10 19:19:10 +0100
commit963c6c0d3e77c20ec2a2ca2b045bfae3e070702f (patch)
treecd3adce16793a466365ebf4ead9c1398fcbd7879 /src/crepe/Resource.h
parentbf32bee7d66a701c43676e28b87e19138c0c8666 (diff)
parent7cbc577e94ed048f2a8146fab6972ae6ff290be7 (diff)
merge master
Diffstat (limited to 'src/crepe/Resource.h')
-rw-r--r--src/crepe/Resource.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/crepe/Resource.h b/src/crepe/Resource.h
new file mode 100644
index 0000000..eceb15b
--- /dev/null
+++ b/src/crepe/Resource.h
@@ -0,0 +1,29 @@
+#pragma once
+
+namespace crepe {
+
+class ResourceManager;
+class Asset;
+
+/**
+ * \brief Resource interface
+ *
+ * Resource is an interface class used to represent a (deserialized) game resource (e.g.
+ * textures, sounds). Resources are always created from \ref Asset "assets" by ResourceManager.
+ *
+ * The game programmer has the ability to use the ResourceManager to keep instances of concrete
+ * resources between scenes, preventing them from being reinstantiated during a scene
+ * transition.
+ */
+class Resource {
+public:
+ Resource(const Asset & src);
+ virtual ~Resource() = default;
+
+ Resource(const Resource &) = delete;
+ Resource(Resource &&) = delete;
+ Resource & operator=(const Resource &) = delete;
+ Resource & operator=(Resource &&) = delete;
+};
+
+} // namespace crepe