#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.. :(