const Mesh & GlUtils::getMesh(Resource res) { typedef std::map<Resource, MeshPtr> MeshMap; static MeshMap meshes; if (0 == meshes.count(res)) { std::string meshData = Platform::getResourceData(res); meshes[res] = MeshPtr(new Mesh(meshData)); } return *meshes[res]; }