hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/src/rendering/texture.h
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2025-08-12 19:17:50 +0200
committerhachem <im@hachem.wtf>2025-08-12 19:17:50 +0200
commit3b02022fd79ad0e130b8c49e7707d221bfc97bb5 (patch)
tree0da9ee9559969a7f40d92611a3b1c234e38ae36f /src/rendering/texture.h
parent7e06a916e6a385c37075abcb83d14b8c1fef7bc0 (diff)
feat: texture and pixel buffers
Diffstat (limited to 'src/rendering/texture.h')
-rw-r--r--src/rendering/texture.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/rendering/texture.h b/src/rendering/texture.h
new file mode 100644
index 0000000..e3c53f8
--- /dev/null
+++ b/src/rendering/texture.h
@@ -0,0 +1,30 @@
+#pragma once
+
+#include <memory>
+#include <string>
+#include <glm/glm.hpp>
+
+namespace Donut
+{
+ class Texture
+ {
+ public:
+ virtual ~Texture() = default;
+
+ virtual uint32_t get_width() const = 0;
+ virtual uint32_t get_height() const = 0;
+ virtual uint32_t get_renderer_id() const = 0;
+
+ virtual void set_data(void* data, uint32_t size) = 0;
+ virtual void bind(uint32_t slot = 0) const = 0;
+
+ virtual bool operator==(const Texture& other) const = 0;
+ };
+
+ class Texture2D : public Texture
+ {
+ public:
+ static std::shared_ptr<Texture2D> create(uint32_t width, uint32_t height);
+ static std::shared_ptr<Texture2D> create(const std::string& path);
+ };
+};