feat: allow passing custom material for grid overlay

This commit is contained in:
Nick Fisher committed 2025-01-07 08:25:48 +08:00
1 parent 1b979252db
commit 94863134fc
1 file changed
+8 -2
@@ -153,11 +153,17 @@ namespace thermion
AssetLoader::destroy(&_assetLoader); AssetLoader::destroy(&_assetLoader);
} }
SceneAsset *SceneManager::createGrid() SceneAsset *SceneManager::createGrid(Material *material)
{ {
if (!_grid) if (!_grid)
{ {
_grid = std::make_unique<GridOverlay>(*_engine); if(!material) {
material = Material::Builder()
.package(GRID_PACKAGE, GRID_GRID_SIZE)
.build(*_engine);
}
_grid = std::make_unique<GridOverlay>(*_engine, material);
} }
return _grid.get(); return _grid.get();
} }