summary refs log tree commit diff
path: root/src/Assets.hpp
blob: 0de6d90b97c53cf9d31ac9318771a3fdcdcf791f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#pragma once

#include "Common/Sizes.hpp"

#define MC_DECLARE_ASSET(ns, name, raw_name) \
    namespace Files { extern char const* raw_name; } \
    namespace ns { extern Char const* name; }

#define MC_DECLARE_SHADER_ASSET(name) \
    MC_DECLARE_ASSET(Shaders::name, vertex, shaders_##name##_vertex) \
    MC_DECLARE_ASSET(Shaders::name, fragment, shaders_##name##_fragment)

namespace MC::Assets {

MC_DECLARE_SHADER_ASSET(terrain)
MC_DECLARE_SHADER_ASSET(clouds)
MC_DECLARE_SHADER_ASSET(block_outline)
MC_DECLARE_SHADER_ASSET(image_viewer)

MC_DECLARE_ASSET(Images, atlas, images_atlas_ppm)

}

// NOTE: We need to declare dependencies both in Assets.cpp and and here
// in Assets.hpp but only because we rename the variable name from it's
// file name to a more readable name. If we didn't do that we could just
// declare the variable in the hpp file, without needing another compilation
// unit at all.
// This would work easily if there was a using x = y; directive that didn't
// just work for types but for variables as well. But there isn't, I think.. :(