From 3b02022fd79ad0e130b8c49e7707d221bfc97bb5 Mon Sep 17 00:00:00 2001 From: hachem Date: Tue, 12 Aug 2025 19:17:50 +0200 Subject: feat: texture and pixel buffers --- src/rendering/texture.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/rendering/texture.h (limited to 'src/rendering/texture.h') 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 +#include +#include + +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 create(uint32_t width, uint32_t height); + static std::shared_ptr create(const std::string& path); + }; +}; -- cgit v1.3