From 7b462801d500b43bd7ebebe69c2e8a9d5e3f1261 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 25 Jan 2024 23:49:27 +0000 Subject: Remove the static texture cache Static variables persist too long, destruction is unmanaged and occurs after the gl context is gone. --- game/terrain.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'game/terrain.cpp') diff --git a/game/terrain.cpp b/game/terrain.cpp index 3778f3d..a4b6510 100644 --- a/game/terrain.cpp +++ b/game/terrain.cpp @@ -18,8 +18,8 @@ #include Terrain::Terrain(std::shared_ptr tm) : - geoData {std::move(tm)}, grass {Texture::cachedTexture.get("grass.png")}, - water {Texture::cachedTexture.get("water.png")} + geoData {std::move(tm)}, grass {std::make_shared("grass.png")}, + water {std::make_shared("water.png")} { generateMeshes(); } -- cgit v1.2.3