14#include <lagrange/ui/Entity.h>
15#include <lagrange/ui/api.h>
16#include <lagrange/ui/types/Shader.h>
23 enum class PathType { REAL, VIRTUAL };
25 using result_type = std::shared_ptr<Shader>;
27 result_type operator()(
28 const std::string& generic_path,
30 const ShaderDefines& defines = {})
const;
32using ShaderCache = entt::resource_cache<Shader, ShaderLoader>;
33using ShaderResource = entt::resource<Shader>;
39 ShaderLoader::PathType path_type = ShaderLoader::PathType::REAL;
40 std::string display_name;
41 ShaderDefines defines;
43using RegisteredShaders = std::unordered_map<entt::id_type, ShaderDefinition>;
47LA_UI_API entt::id_type
48register_shader_as(Registry& r, entt::id_type
id,
const ShaderDefinition& def);
51LA_UI_API entt::id_type register_shader(Registry& r,
const ShaderDefinition& def);
52LA_UI_API entt::id_type
53register_shader(Registry& r,
const std::string& path,
const std::string& display_name);
55LA_UI_API entt::id_type
56register_shader_variant(Registry& r, entt::id_type
id,
const ShaderDefines& shader_defines);
58LA_UI_API ShaderResource get_shader(Registry& r, entt::id_type
id);
61LA_UI_API RegisteredShaders& get_registered_shaders(Registry& r);
62LA_UI_API ShaderCache& get_shader_cache(Registry& r);
70 const std::string& virtual_path,
71 const std::string& contents,
72 bool overwrite =
false);
Lagrange UI Viewer and mini 3D engine.
Definition: AcceleratedPicking.h:22
LA_UI_API bool add_file_to_shader_virtual_fs(const std::string &virtual_path, const std::string &contents, bool overwrite=false)
Creates a file using virtual_path with contents in the shader virtual file system.
Definition: ShaderLoader.cpp:145
Main namespace for Lagrange.
Definition: AABBIGL.h:30
Definition: ShaderLoader.h:37
Definition: ShaderLoader.h:22