VEX Engine
Retro looking game engine made in vulkan mostly because i wanted to understand it better.
Loading...
Searching...
No Matches
AssetTypes.hpp
1#pragma once
2#include <string>
3#include <vector>
4#include <algorithm>
5
6#if DEBUG
7#include <imgui.h>
8#endif
9
10namespace vex {
11
12 namespace AssetExtensions {
13 inline const std::vector<std::string> Mesh = {
14 ".obj", ".fbx", ".gltf", ".glb", ".dae", ".3ds", ".blend", ".ase", ".ply", ".stl"
15 };
16
17 inline const std::vector<std::string> Texture = {
18 ".png", ".jpg", ".jpeg", ".bmp", ".tga", ".hdr", ".pic", ".ppm", ".pgm"
19 };
20
21 inline const std::vector<std::string> Audio = {
22 ".wav", ".ogg"
23 };
24
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();
28 }
29 }
30
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) {}
37 };
38
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) {}
43 };
44
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) {}
49 };
50
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) {}
55 };
56}