Toast Engine
Loading...
Searching...
No Matches
assets.hpp File Reference

Public API for the asset management system. More...

#include "core_types.hpp"
#include <atomic>
#include <string>
#include <string_view>
#include <toast/events/event.hpp>
#include <toast/export.hpp>
#include <toast/uid.hpp>
#include <utility>
Include dependency graph for assets.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  event::ReloadAssetsManifest
 Fired to request a refresh of the asset manifest. More...
struct  event::PrefabAssetReloaded
struct  event::ScriptAssetReloaded
 Fired after a hot-reload. More...
struct  event::ShaderAssetReloaded
 Fired after a shader source hot-reload. More...
struct  event::MaterialAssetReloaded
 Fired after a material or material instance hot-reload. More...
struct  event::VoxelPaletteAssetReloaded
struct  event::DataAssetReloaded
 Anything that copied values out of the asset has to read them again. More...
struct  event::AssetReplaced
 Fired when a reloaded asset was replaced by a new object instead of rebuilt in place. More...
struct  event::UIAssetReloaded
 Fired after an RML document or RCSS stylesheet hot-reload. More...
struct  event::ClearUnusedAssets
 Fired to request the unloading of all unused assets. More...

Functions

auto assets::load (toast::UID uid) -> HandleBase
auto assets::load (std::string_view uri) -> HandleBase
auto assets::resolveURI (std::string_view uri) -> std::optional< toast::UID >
auto assets::listByType (std::string_view type) -> std::vector< toast::UID >
 Lists the UIDs of every manifest asset of a given type.
auto assets::typeOf (toast::UID uid) -> std::string
 Looks up an asset's type string in the manifest without loading it.
auto assets::save (toast::UID uid) -> bool
template<typename T>
auto assets::load (toast::UID uid) -> Handle< T >
 Type-safe load helper.
template<typename T>
auto assets::load (std::string_view uri) -> Handle< T >

Detailed Description

Public API for the asset management system.

Author
Xein
Date
06 Jun 2026

Function Documentation

◆ listByType()

auto TOAST_API assets::listByType ( std::string_view type) -> std::vector< toast::UID >

Lists the UIDs of every manifest asset of a given type.

Parameters
typeThe asset type string, e.g. "input_action"
Returns
The UIDs tracked by the manifest for that type; empty when none exist

◆ typeOf()

auto TOAST_API assets::typeOf ( toast::UID uid) -> std::string

Looks up an asset's type string in the manifest without loading it.

Returns
The manifest type