|
Infinity Engine v0.6.20
C++ API Documentation
|
Classes | |
| class | Asset |
| Type-erased container for loaded asset data. More... | |
| struct | AssetLoadInfo |
| Encapsulates the information required to load an asset in the Infinity engine. More... | |
| class | AssetPlugin |
| Abstract base class for source-specific asset loading plugins. More... | |
| class | AssetPluginStore |
| Central registry and management system for source-specific AssetPlugin instances. More... | |
Typedefs | |
| typedef AssetPlugin *() | CreateAssetPluginFunction(void) |
| Function signature for creating an AssetPlugin instance. | |
| typedef void() | DestroyAssetPluginFunction(AssetPlugin *) |
| Function signature for destroying an AssetPlugin instance. | |
Enumerations | |
| enum | AssetPluginAPIVer { V1 = 1 } |
| Versioning for the AssetPlugin API. More... | |
Functions | |
| INFINITY_API_PUBLIC Asset | load (const AssetLoadInfo &loadInfo) |
| Loads an asset using the configured loader chain. | |
| INFINITY_API_PUBLIC Asset | load (const std::string &loader, const AssetLoadInfo &loadInfo) |
| Loads an asset using a specific named loader source. | |
| INFINITY_API_PUBLIC Asset | load (const Infinity::Types::TypeID &type, const std::string &path) |
| Loads an asset using the configured loader chain with simplified parameters. | |
| INFINITY_API_PUBLIC Asset | load (const std::string &loader, const Infinity::Types::TypeID &type, const std::string &path) |
| Loads an asset from a specific named source with simplified parameters. | |
Variables | |
| INFINITY_API_PLUGIN CreateAssetPluginFunction | CreateAssetPlugin |
| Plugin entry point for creating an AssetPlugin instance. | |
| INFINITY_API_PLUGIN DestroyAssetPluginFunction | DestroyAssetPlugin |
| Plugin entry point for destroying an AssetPlugin instance. | |
| Infinity::Assets::CreateAssetPluginFunction |
Function signature for creating an AssetPlugin instance.
Plugins must export a function matching this signature to instantiate the plugin object. This allows the engine to dynamically load and create plugin instances at runtime.
| Infinity::Assets::DestroyAssetPluginFunction |
Function signature for destroying an AssetPlugin instance.
Plugins must export a function matching this signature to properly clean up the plugin object and free any associated resources.
| plugin | Pointer to the AssetPlugin instance to destroy |
Versioning for the AssetPlugin API.
Allows plugins to specify which version of the plugin API they implement, enabling backward compatibility and version checking.
| Enumerator | |
|---|---|
| V1 | Version 1 of the AssetPlugin API. |
| INFINITY_API_PUBLIC Asset Infinity::Assets::load | ( | const AssetLoadInfo & | loadInfo | ) |
Loads an asset using the configured loader chain.
Loads an asset by first attempting to use the default loader configured in AssetPluginStore. If the default loader cannot provide a valid asset (either because it doesn't support the asset type or the asset doesn't exist in that source), the secondary loader is automatically tried as a fallback.
| loadInfo | Complete information about the asset to load |
| std::runtime_error | if no loaders are configured or all loaders fail |
| INFINITY_API_PUBLIC Asset Infinity::Assets::load | ( | const Infinity::Types::TypeID & | type, |
| const std::string & | path | ||
| ) |
Loads an asset using the configured loader chain with simplified parameters.
Convenience function that loads an asset using the default/secondary loader chain with just the asset type and path. Internally constructs an AssetLoadInfo with default corePath and loadPrefix values.
The default loader is tried first, with automatic fallback to the secondary loader if needed.
| type | The type identifier for the asset being loaded |
| path | The path to the asset file |
| std::runtime_error | if no loaders are configured or all loaders fail |
| INFINITY_API_PUBLIC Asset Infinity::Assets::load | ( | const std::string & | loader, |
| const AssetLoadInfo & | loadInfo | ||
| ) |
Loads an asset using a specific named loader source.
Loads an asset using the AssetPlugin identified by the given loader name, bypassing the default loader chain. This allows explicit control over which asset source is used, useful when you need to load from a specific source regardless of the configured defaults.
| loader | The name of the AssetPlugin source to use for loading |
| loadInfo | Complete information about the asset to load |
| std::runtime_error | if the specified loader doesn't exist or loading fails |
| INFINITY_API_PUBLIC Asset Infinity::Assets::load | ( | const std::string & | loader, |
| const Infinity::Types::TypeID & | type, | ||
| const std::string & | path | ||
| ) |
Loads an asset from a specific named source with simplified parameters.
Convenience function that loads an asset using the specified loader source with just the asset type and path. Internally constructs an AssetLoadInfo with default corePath and loadPrefix values.
Bypasses the loader chain to load directly from the named source.
| loader | The name of the AssetPlugin source to use for loading |
| type | The type identifier for the asset being loaded |
| path | The path to the asset file |
| std::runtime_error | if the specified loader doesn't exist or loading fails |
| INFINITY_API_PLUGIN CreateAssetPluginFunction Infinity::Assets::CreateAssetPlugin |
Plugin entry point for creating an AssetPlugin instance.
All asset plugins must export this function to allow the engine to instantiate the plugin. This function should return a pointer to a newly allocated plugin object.
| INFINITY_API_PLUGIN DestroyAssetPluginFunction Infinity::Assets::DestroyAssetPlugin |
Plugin entry point for destroying an AssetPlugin instance.
All asset plugins must export this function to allow the engine to properly cleanup the plugin. This function should delete the plugin object and free any associated resources.