Pioneer
Loading...
Searching...
No Matches
ModelCache.h
Go to the documentation of this file.
1// Copyright © 2008-2024 Pioneer Developers. See AUTHORS.txt for details
2// Licensed under the terms of the GPL v3. See licenses/GPL-3.txt
3
4#ifndef _MODELCACHE_H
5#define _MODELCACHE_H
6/*
7 * This class is a quick thoughtless hack
8 * Also it only deals in New Models
9 */
10
11#include <map>
12#include <stdexcept>
13
14namespace Graphics {
15 class Renderer;
16}
17namespace SceneGraph {
18 class Model;
19}
20
22public:
23 struct ModelNotFoundException : public std::runtime_error {
25 std::runtime_error("Could not find model") {}
26 };
29 SceneGraph::Model *FindModel(const std::string &);
30 void Flush();
31
32private:
33 typedef std::map<std::string, SceneGraph::Model *> ModelMap;
34 ModelMap m_models;
35 Graphics::Renderer *m_renderer;
36};
37
38#endif
Definition: Renderer.h:45
Definition: ModelCache.h:21
~ModelCache()
Definition: ModelCache.cpp:13
SceneGraph::Model * FindModel(const std::string &)
Definition: ModelCache.cpp:18
void Flush()
Definition: ModelCache.cpp:36
Definition: Model.h:87
Definition: Background.h:14
Definition: CityOnPlanet.h:32
Definition: ModelCache.h:23
ModelNotFoundException()
Definition: ModelCache.h:24