12 namespace AssetExtensions {
13 inline const std::vector<std::string> Mesh = {
14 ".obj",
".fbx",
".gltf",
".glb",
".dae",
".3ds",
".blend",
".ase",
".ply",
".stl"
17 inline const std::vector<std::string> Texture = {
18 ".png",
".jpg",
".jpeg",
".bmp",
".tga",
".hdr",
".pic",
".ppm",
".pgm"
21 inline const std::vector<std::string> Audio = {
26 inline bool IsValid(
const std::string& ext,
const std::vector<std::string>& list) {
27 return std::find(list.begin(), list.end(), ext) != list.end();
32 struct asset_path :
public std::string {
33 using std::string::string;
34 asset_path() =
default;
35 asset_path(
const std::string& s) : std::string(s) {}
36 asset_path(
const char* s) : std::string(s) {}
40 struct mesh_asset_path :
public asset_path {
41 using asset_path::asset_path;
42 mesh_asset_path(
const std::string& s) : asset_path(s) {}
46 struct texture_asset_path :
public asset_path {
47 using asset_path::asset_path;
48 texture_asset_path(
const std::string& s) : asset_path(s) {}
52 struct audio_asset_path :
public asset_path {
53 using asset_path::asset_path;
54 audio_asset_path(
const std::string& s) : asset_path(s) {}