diff --git a/main.go b/main.go index fb04bf9..42ac90f 100644 --- a/main.go +++ b/main.go @@ -86,10 +86,10 @@ func main() { model := mgl32.Ident4() controls := fpscontrols.Get(10, 10, mgl32.Vec3{0, 0, -10}, mgl32.Vec2{0, 0}, window) - demoMaterial := am.GetAsset[material.Material](assetManager, "assets/material/demo") - screenMaterial := am.GetAsset[material.Material](assetManager, "assets/material/screen") + demoMaterial := am.GetAsset[material.Material]("assets/material/demo") + screenMaterial := am.GetAsset[material.Material]("assets/material/screen-debug") - teapot := am.GetAsset[geometry.Geometry](assetManager, "assets/geometry/teapot") + teapot := am.GetAsset[geometry.Geometry]("assets/geometry/teapot") for !window.ShouldClose() { glfw.PollEvents() diff --git a/utils/assetmanager/assetmanager.go b/utils/assetmanager/assetmanager.go index a611ade..abaf921 100644 --- a/utils/assetmanager/assetmanager.go +++ b/utils/assetmanager/assetmanager.go @@ -131,8 +131,8 @@ func Get() *AssetManager { return instance } -func GetAsset[T asset.Asset](a *AssetManager, name string) *T { - value, ok := a.assets[name].(T) +func GetAsset[T asset.Asset](name string) *T { + value, ok := instance.assets[name].(T) if !ok { return nil }