|
Infinity Engine v0.6.20
C++ API Documentation
|
Abstract base class for source-specific asset loading plugins. More...
#include <AssetPlugin.hpp>
Public Member Functions | |
| AssetPlugin () | |
| Default constructor. | |
| virtual | ~AssetPlugin () |
| Virtual destructor. | |
| Asset | load (const AssetLoadInfo &loadInfo) |
| Loads an asset using the provided load information. | |
| Asset | load (const Infinity::Types::TypeID &type, const std::string &path) |
| Convenience function to load an asset with a full path. | |
| virtual AssetPluginAPIVer | getPluginAPIVersion ()=0 |
| Gets the plugin API version this plugin implements. | |
| virtual std::string | getPluginName ()=0 |
| Gets the name of this plugin. | |
| virtual std::string | getPluginVendor ()=0 |
| Gets the vendor/author of this plugin. | |
Protected Member Functions | |
| virtual Asset | load_Text (const AssetLoadInfo &loadInfo) |
| Loads a text asset from this plugin's source. | |
| virtual Asset | load_Array2D_ubyte (const AssetLoadInfo &loadInfo) |
| Loads a 2D array of unsigned bytes from this plugin's source. | |
| virtual Asset | load_Array2D_float (const AssetLoadInfo &loadInfo) |
| Loads a 2D array of floats from this plugin's source. | |
| virtual Asset | load_Array2D_Vector3ub (const AssetLoadInfo &loadInfo) |
| Loads a 2D array of 3-component unsigned byte vectors from this plugin's source. | |
| virtual Asset | load_Array2D_Vector3 (const AssetLoadInfo &loadInfo) |
| Loads a 2D array of 3-component float vectors from this plugin's source. | |
| virtual Asset | load_Array2D_Vector4ub (const AssetLoadInfo &loadInfo) |
| Loads a 2D array of 4-component unsigned byte vectors from this plugin's source. | |
| virtual Asset | load_Array2D_Vector4 (const AssetLoadInfo &loadInfo) |
| Loads a 2D array of 4-component float vectors from this plugin's source. | |
| virtual Asset | load_Array3D_ubyte (const AssetLoadInfo &loadInfo) |
| Loads a 3D array of unsigned bytes from this plugin's source. | |
| virtual Asset | load_Array3D_float (const AssetLoadInfo &loadInfo) |
| Loads a 3D array of floats from this plugin's source. | |
| virtual Asset | load_Array3D_Vector3ub (const AssetLoadInfo &loadInfo) |
| Loads a 3D array of 3-component unsigned byte vectors from this plugin's source. | |
| virtual Asset | load_Array3D_Vector3 (const AssetLoadInfo &loadInfo) |
| Loads a 3D array of 3-component float vectors from this plugin's source. | |
| virtual Asset | load_Array3D_Vector4ub (const AssetLoadInfo &loadInfo) |
| Loads a 3D array of 4-component unsigned byte vectors from this plugin's source. | |
| virtual Asset | load_Array3D_Vector4 (const AssetLoadInfo &loadInfo) |
| Loads a 3D array of 4-component float vectors from this plugin's source. | |
| virtual Asset | load_Mesh (const AssetLoadInfo &loadInfo) |
| Loads a mesh asset from this plugin's source. | |
| virtual Asset | load_Material (const AssetLoadInfo &loadInfo) |
| Loads a material asset from this plugin's source. | |
| virtual Asset | load_RenderObject (const AssetLoadInfo &loadInfo) |
| Loads a render object asset from this plugin's source. | |
Abstract base class for source-specific asset loading plugins.
AssetPlugin provides an extensible architecture for loading assets from different sources in the Infinity engine. Each plugin represents a specific asset source, such as the filesystem, a remote server, a database, or even another abstraction layer above the library.
Derived classes implement loading functions for the asset types they support by overriding the corresponding protected virtual load_* methods. Not all asset types need to be supported by every plugin - plugins only implement loaders for the types that make sense for their source.
When an asset is requested, the default loader is tried first. If it cannot provide a valid asset (either because the asset doesn't exist in that source or the loader doesn't support that asset type), the secondary loader is automatically tried as a fallback.
| Infinity::Assets::AssetPlugin::AssetPlugin | ( | ) |
Default constructor.
Initializes the asset plugin and sets up the internal loader map.
|
virtual |
Virtual destructor.
Ensures proper cleanup of derived plugin classes.
|
pure virtual |
Gets the plugin API version this plugin implements.
|
pure virtual |
Gets the name of this plugin.
Should return a unique identifier for this plugin that describes its source or purpose (e.g., "FilesystemLoader", "RemoteAssetLoader").
|
pure virtual |
Gets the vendor/author of this plugin.
| Asset Infinity::Assets::AssetPlugin::load | ( | const AssetLoadInfo & | loadInfo | ) |
Loads an asset using the provided load information.
Dispatches to the appropriate type-specific loader based on the asset type specified in the loadInfo. If this plugin doesn't support the requested asset type or cannot load the asset from its source, it should return an invalid Asset to allow fallback to other loaders.
| loadInfo | Complete information about the asset to load |
| Asset Infinity::Assets::AssetPlugin::load | ( | const Infinity::Types::TypeID & | type, |
| const std::string & | path | ||
| ) |
Convenience function to load an asset with a full path.
Simplified loading interface that constructs an AssetLoadInfo internally with just the type and path.
| type | The type identifier for the asset |
| path | The full path to the asset file |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
Loads a material asset from this plugin's source.
Override this method to implement material loading from your specific source. Return an invalid Asset if this plugin doesn't support material assets or if the asset cannot be loaded.
| loadInfo | Information about the material asset to load |
|
protectedvirtual |
Loads a mesh asset from this plugin's source.
Override this method to implement mesh loading from your specific source. Return an invalid Asset if this plugin doesn't support mesh assets or if the asset cannot be loaded.
| loadInfo | Information about the mesh asset to load |
|
protectedvirtual |
Loads a render object asset from this plugin's source.
Override this method to implement render object loading from your specific source. Return an invalid Asset if this plugin doesn't support render object assets or if the asset cannot be loaded.
| loadInfo | Information about the render object asset to load |
|
protectedvirtual |
Loads a text asset from this plugin's source.
Override this method to implement text file loading from your specific source. Return an invalid Asset if this plugin doesn't support text assets or if the asset cannot be loaded from this source.
| loadInfo | Information about the text asset to load |