.notify(&set_debug_name<Mesh>);
add_type<Module>().suffix(".glsl").suffix(".spv")
.creator([this](const string &n){ return create_module(n); });
.notify(&set_debug_name<Mesh>);
add_type<Module>().suffix(".glsl").suffix(".spv")
.creator([this](const string &n){ return create_module(n); });
- add_type<Object>().keyword("object");
- add_type<OccludedScene>().base<Scene>().suffix(".scene")
+ add_type<Object>().base<Renderable>().keyword("object");
+ add_type<OccludedScene>().base<Scene>().base<Renderable>().suffix(".scene")
.creator([this](const string &n) -> OrderedScene * { create_generic<Scene>(n); return 0; });
add_type<PbrMaterial>().base<Material>().suffix(".mat")
.creator([this](const string &n) -> PbrMaterial * { create_generic<Material>(n); return 0; })
.creator([this](const string &n) -> OrderedScene * { create_generic<Scene>(n); return 0; });
add_type<PbrMaterial>().base<Material>().suffix(".mat")
.creator([this](const string &n) -> PbrMaterial * { create_generic<Material>(n); return 0; })
.notify(&set_debug_name<Program>);
add_type<Sampler>().suffix(".samp").keyword("sampler")
.notify(&set_debug_name<Sampler>);
.notify(&set_debug_name<Program>);
add_type<Sampler>().suffix(".samp").keyword("sampler")
.notify(&set_debug_name<Sampler>);
.creator([this](const string &n) -> SimpleScene * { create_generic<Scene>(n); return 0; });
add_type<Technique>().suffix(".tech").keyword("technique")
.notify(&set_debug_name<Technique>);
.creator([this](const string &n) -> SimpleScene * { create_generic<Scene>(n); return 0; });
add_type<Technique>().suffix(".tech").keyword("technique")
.notify(&set_debug_name<Technique>);
- add_type<Texture2D>().base<Texture>().suffix(".tex2d").suffix(".png").suffix(".jpg").keyword("texture2d")
- .creator([this](const string &n){ return create_texture2d(n); })
+ add_type<Texture2D>().base<Texture>().suffix(".tex").suffix(".png").suffix(".jpg")
+ .creator([this](const string &n) -> Texture2D * { create_texture(n); return 0; })
.notify(&set_debug_name<Texture2DArray>);
add_type<UnlitMaterial>().base<Material>().suffix(".mat")
.creator([this](const string &n) -> UnlitMaterial * { create_generic<Material>(n); return 0; })
.notify(&set_debug_name<Material>);
.notify(&set_debug_name<Texture2DArray>);
add_type<UnlitMaterial>().base<Material>().suffix(".mat")
.creator([this](const string &n) -> UnlitMaterial * { create_generic<Material>(n); return 0; })
.notify(&set_debug_name<Material>);
.creator([this](const string &n) -> ZSortedScene * { create_generic<Scene>(n); return 0; });
add_source(get_builtins());
.creator([this](const string &n) -> ZSortedScene * { create_generic<Scene>(n); return 0; });
add_source(get_builtins());
T *Resources::create_generic(const string &name)
{
if(RefPtr<IO::Seekable> io = open_raw(name))
{
DataFile::Parser parser(*io, name);
T *Resources::create_generic(const string &name)
{
if(RefPtr<IO::Seekable> io = open_raw(name))
{
DataFile::Parser parser(*io, name);
- DataFile::Parser parser(*io, name);
- Texture2D::Loader ldr(*tex, *this);
- ldr.load(parser);
+ resource_manager->set_resource_location(*tex, *this, name);
add("light", &Loader::generic<Light>);
add("material", &Loader::generic<Material>);
add("scene", &Loader::generic<Scene>);
add("light", &Loader::generic<Light>);
add("material", &Loader::generic<Material>);
add("scene", &Loader::generic<Scene>);