Grindstone Game Engine v0.2.0
An open source game engine and toolkit.
|
The Grindstone Asset System provides a unified, extensible way to load, manage, and reference game content (assets) across both the editor and runtime. It supports reference counting, type-safe asset access, and optimized loading strategies through a dual loader system.
You can learn about creating new assets with the following guides:
The asset system abstracts asset management away from file IO, providing a consistent and efficient API for accessing resources like meshes, materials, textures, audio clips, and more.
It supports:
AssetReference<T>
.Asset
Base class for all asset types. Each asset:
referenceCount
.AssetLoadStatus
(e.g. Ready
, Loading
, Missing
, etc.)AssetReference<T>
Type-safe smart reference to an asset. Handles:
Get()
and GetUnchecked()
).⚠️ Asset data access is not guaranteed to be cheap — cache it if reused frequently.
AssetImporter
An abstract interface for managing asset lifecycles. Implements:
Specialized via SpecificAssetImporter<YourAssetStruct>
for each asset type.
AssetManager
The global hub for managing all registered asset types. Responsibilities include:
AssetType
to importer.You can register new asset types in plugins using:
RegisterAssetType(AssetType assetType, const char* typeName, AssetImporter* assetImporter)
UnregisterAssetType(AssetType assetType)
RegisterAssetImporter(const char* extension, Grindstone::Editor::ImporterFactory importerFactory, Grindstone::Editor::ImporterVersion importerVersion)
DeregisterAssetImporter(const char* extension)
Two kinds of loaders support different use cases:
FileAssetLoader
Used in the editor.
AssetPackLoader
Used in runtime builds.
Out of the box, Grindstone includes support for:
Mesh3dAsset
MaterialAsset
TextureAsset
AudioClipAsset
GraphicsPipelineSetAsset
ComputePipelineSetAsset
Each is implemented with its own importer and load logic.