chore: add output implementations for gltf and glb

This commit is contained in:
Jan
2024-03-31 22:46:31 +02:00
parent 7a0930a208
commit c27f4ed544
7 changed files with 228 additions and 0 deletions

View File

@ -0,0 +1,20 @@
#pragma once
#include "Utils/FileUtils.h"
#include <cstdint>
namespace gltf
{
constexpr uint32_t GLTF_MAGIC = FileUtils::MakeMagic32('g', 'l', 'T', 'F');
constexpr uint32_t GLTF_VERSION = 2u;
constexpr uint32_t CHUNK_MAGIC_JSON = FileUtils::MakeMagic32('J', 'S', 'O', 'N');
constexpr uint32_t CHUNK_MAGIC_BIN = FileUtils::MakeMagic32('B', 'I', 'N', '\x00');
constexpr auto GLTF_LENGTH_OFFSET = 8u;
constexpr auto GLTF_JSON_CHUNK_LENGTH_OFFSET = 12u;
constexpr auto GLTF_JSON_CHUNK_DATA_OFFSET = 20u;
constexpr auto GLTF_DATA_URI_PREFIX = "data:application/octet-stream;base64,";
} // namespace gltf