add GL/Texture

This commit is contained in:
2022-10-10 13:03:22 +09:00
parent 58d39739e8
commit 4b79c5e4df
3 changed files with 242 additions and 19 deletions

View File

@@ -52,8 +52,7 @@ struct Obj_BufferMeta final {
const GLenum type;
size_t size = 0;
uint8_t* ptr = nullptr; // address returned by glMapBuffer or nullptr
size_t size = 0;
static GLuint Gen() noexcept {
GLuint id;
@@ -70,9 +69,14 @@ using BufferFactory = AsyncFactory<nf7::Mutex::Resource<std::shared_ptr<Buffer>>
struct Obj_TextureMeta final {
public:
GLenum type;
GLenum format;
uint32_t w, h, d;
Obj_TextureMeta() = delete;
Obj_TextureMeta(GLenum t) noexcept : type(t) {
}
const GLenum type;
GLint format = 0;
uint32_t w = 0, h = 0, d = 0;
static GLuint Gen() noexcept {
GLuint id;

View File

@@ -31,4 +31,12 @@ struct EnumSerializer {
}
};
#define NF7_YAS_DEFINE_ENUM_SERIALIZER(T) \
template <size_t F> \
struct serializer< \
yas::detail::type_prop::is_enum, \
yas::detail::ser_case::use_internal_serializer, \
F, T> : nf7::EnumSerializer<T> { \
}
} // namespace nf7