From fee884ff326eb8eff722d47e94921ae87ef083e9 Mon Sep 17 00:00:00 2001 From: Green Sky Date: Mon, 13 Jan 2025 13:47:59 +0100 Subject: [PATCH] update to v3 texture uploader --- src/solanaceae/texture_uploader.hpp | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/solanaceae/texture_uploader.hpp b/src/solanaceae/texture_uploader.hpp index 1c6668c..1b92713 100644 --- a/src/solanaceae/texture_uploader.hpp +++ b/src/solanaceae/texture_uploader.hpp @@ -4,7 +4,7 @@ #include struct TextureUploaderI { - static constexpr const char* version {"2"}; + static constexpr const char* version {"3"}; enum Filter { NEAREST, @@ -17,13 +17,30 @@ struct TextureUploaderI { // target? }; + enum Format { + RGBA, + //RGB, + + IYUV, + YV12, + + NV12, + NV21, + + MAX + }; + virtual ~TextureUploaderI(void) {} - virtual uint64_t uploadRGBA(const uint8_t* data, uint32_t width, uint32_t height, Filter filter = LINEAR, Access access = STATIC) = 0; + [[deprecated]] virtual uint64_t uploadRGBA(const uint8_t* data, uint32_t width, uint32_t height, Filter filter = LINEAR, Access access = STATIC) = 0; // keeps width height filter // TODO: wh instead of size? - virtual bool updateRGBA(uint64_t tex_id, const uint8_t* data, size_t size) = 0; + [[deprecated]] virtual bool updateRGBA(uint64_t tex_id, const uint8_t* data, size_t size) = 0; + + // use upload to create a texture, and update to update existing + virtual uint64_t upload(const uint8_t* data, uint32_t width, uint32_t height, Format format = RGBA, Filter filter = LINEAR, Access access = STATIC) = 0; + virtual bool update(uint64_t tex_id, const uint8_t* data, size_t size) = 0; virtual void destroy(uint64_t tex_id) = 0; };