stdlib/assetView source ↗
asset
29 items · generated by scribe fromstdlib/asset.fd· synced 2026-11-15
Contents
- ASSET_TEXTURE: (const)
- AssetEntry (struct)
- AssetManager (struct)
- asset_init (function)
- asset_set_root (function)
- asset_set_auto_reload (function)
- asset_find (function)
- asset_load_texture (function)
- asset_load_sound (function)
- asset_load_font (function)
- asset_load_mesh (function)
- asset_load_text (function)
- asset_handle (function)
- asset_type (function)
- asset_path (function)
- asset_release (function)
- asset_unload (function)
- asset_reload (function)
- asset_hot_reload (function)
- asset_count (function)
- asset_memory_usage (function)
- asset_unload_all (function)
- asset_shutdown (function)
ASSET_TEXTURE:
pub const ASSET_TEXTURE: i64 = 0; pub const ASSET_SOUND: i64 = 1; pub const ASSET_FONT: i64 = 2; pub const ASSET_MESH: i64 = 3; pub const ASSET_TEXT: i64 = 4; pub const ASSET_DATA: i64 = 5;Defined at line 29
AssetEntry
pub struct AssetEntry {Fields:
| Name | Type |
|---|---|
path | str |
asset_type | i64 |
handle | i64 |
ref_count | i64 |
loaded | bool |
last_modified | i64 |
size | i64 |
Defined at line 32
AssetManager
pub struct AssetManager {Fields:
| Name | Type |
|---|---|
assets | Vec<AssetEntry> |
root_path | str |
auto_reload | bool |
total_loaded | i64 |
total_memory | i64 |
Defined at line 44
asset_init
Initialize the asset manager.
pub fn asset_init() -> void {Returns: void
Defined at line 58
asset_set_root
Set the root path for asset loading.
pub fn asset_set_root(path: str) -> void {Parameters:
path:str
Returns: void
Defined at line 65
asset_set_auto_reload
Enable or disable automatic hot-reload checking.
pub fn asset_set_auto_reload(enabled: bool) -> void {Parameters:
enabled:bool
Returns: void
Defined at line 70
asset_find
Find an asset by path. Returns index or -1.
pub fn asset_find(path: str) -> i64 {Parameters:
path:str
Returns: i64
Defined at line 75
asset_load_texture
Load a texture asset. Returns the asset index or -1 on failure.
pub fn asset_load_texture(path: str) -> i64 {Parameters:
path:str
Returns: i64
Defined at line 87
asset_load_sound
Load a sound asset.
pub fn asset_load_sound(path: str) -> i64 {Parameters:
path:str
Returns: i64
Defined at line 111
asset_load_font
Load a font asset.
pub fn asset_load_font(path: str, size: f64) -> i64 {Parameters:
path:strsize:f64
Returns: i64
Defined at line 134
asset_load_mesh
Load a mesh asset (OBJ file).
pub fn asset_load_mesh(path: str) -> i64 {Parameters:
path:str
Returns: i64
Defined at line 157
asset_load_text
Load a text file asset (shaders, configs).
pub fn asset_load_text(path: str) -> i64 {Parameters:
path:str
Returns: i64
Defined at line 180
asset_handle
Get the native handle for an asset.
pub fn asset_handle(idx: i64) -> i64 {Parameters:
idx:i64
Returns: i64
Defined at line 204
asset_type
Get the asset type.
pub fn asset_type(idx: i64) -> i64 {Parameters:
idx:i64
Returns: i64
Defined at line 212
asset_path
Get the asset path.
pub fn asset_path(idx: i64) -> str {Parameters:
idx:i64
Returns: str
Defined at line 220
asset_release
Release a reference to an asset. When ref_count reaches 0, it’s unloaded.
pub fn asset_release(idx: i64) -> void {Parameters:
idx:i64
Returns: void
Defined at line 228
asset_unload
Force unload an asset regardless of ref count.
pub fn asset_unload(idx: i64) -> void {Parameters:
idx:i64
Returns: void
Defined at line 245
asset_reload
Reload an asset (for hot reload).
pub fn asset_reload(idx: i64) -> bool {Parameters:
idx:i64
Returns: bool
Defined at line 260
asset_hot_reload
Check all assets for file modifications and reload changed ones.
pub fn asset_hot_reload() -> i64 {Returns: i64
Defined at line 293
asset_count
Get the total number of loaded assets.
pub fn asset_count() -> i64 {Returns: i64
Defined at line 312
asset_memory_usage
Get estimated memory usage in bytes.
pub fn asset_memory_usage() -> i64 {Returns: i64
Defined at line 317
asset_unload_all
Unload all assets.
pub fn asset_unload_all() -> void {Returns: void
Defined at line 322
asset_shutdown
Shutdown the asset manager.
pub fn asset_shutdown() -> void {Returns: void
Defined at line 332
Generated by scribe, the Fides documentation generator