From 1ad6bc34323f5b30d463ebe47a58d47ff9d4f328 Mon Sep 17 00:00:00 2001 From: hachem Date: Tue, 12 Aug 2025 19:17:50 +0200 Subject: [add]: 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..eebce85 --- /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 GetWidth() const = 0; + virtual uint32_t GetHeight() const = 0; + virtual uint32_t GetRendererID() const = 0; + + virtual void SetData(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); + }; +}; \ No newline at end of file -- cgit v1.3