#ifndef __GLTF_HPP_ #define __GLTF_HPP_ #include #include "utils.hpp" #include "handle.hpp" #include "mesh.hpp" #include "material.hpp" struct node { std::vector children; u32 mesh; }; struct raw_image { int32_t width; int32_t height; int32_t channels; const uint8_t *data; }; struct buffer { u8* bytes; size_t size; }; class gltf { public: gltf(const char* filepath); void deinit(); std::vector root_nodes; std::vector nodes; std::vector meshes; std::vector materials; std::vector> textures; // handle samplers; std::vector buffers; // gbl only struct glb_chunk { u32 length; u32 type; u8 data[1]; }; struct glb_header { u32 magic; u32 version; u32 length; }; std::vector chunks; glb_header* header; // TODO: remove bool is_glb; }; #endif