2023-07-26 20:09:57 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <cstdint>
|
2024-03-08 22:04:58 +01:00
|
|
|
#include <cstddef>
|
2023-07-26 20:09:57 +02:00
|
|
|
|
|
|
|
struct TextureUploaderI {
|
2024-03-08 22:04:58 +01:00
|
|
|
static constexpr const char* version {"2"};
|
2024-01-18 00:32:11 +01:00
|
|
|
|
2024-01-21 13:58:22 +01:00
|
|
|
enum Filter {
|
|
|
|
NEAREST,
|
|
|
|
LINEAR,
|
|
|
|
};
|
|
|
|
|
2024-03-08 22:04:58 +01:00
|
|
|
enum Access {
|
|
|
|
STATIC,
|
|
|
|
STREAMING,
|
|
|
|
// target?
|
|
|
|
};
|
|
|
|
|
2023-07-26 20:09:57 +02:00
|
|
|
virtual ~TextureUploaderI(void) {}
|
|
|
|
|
2024-03-08 22:04:58 +01:00
|
|
|
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;
|
2023-07-26 20:09:57 +02:00
|
|
|
|
|
|
|
virtual void destroy(uint64_t tex_id) = 0;
|
|
|
|
};
|
|
|
|
|