source: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ResourceManager.h @ 2795

Revision 2795, 1.2 KB checked in by mattausch, 17 years ago (diff)
Line 
1#ifndef __ResourceManager_H__
2#define __ResourceManager_H__
3
4
5#include <string>
6#include <iostream>
7#include <fstream>
8#include <map>
9
10#include "common.h"
11
12class igzstream;
13
14
15namespace CHCDemoEngine
16{
17
18class SceneEntity;
19class Material;
20class Geometry;
21class Texture;
22class Matrix4x4;
23
24/** Loads a scene and also handles the cleanup
25*/
26class ResourceManager
27{
28public:
29
30        ~ResourceManager();
31        /** Loads a model
32        */
33        bool Load(const std::string &filename, SceneEntityContainer &geometry);
34
35protected:
36       
37        void LoadTextures(igzstream &str);
38        void LoadShapes(igzstream &str);
39        void LoadSceneEntities(igzstream &str, SceneEntityContainer &entities);
40
41        SceneEntity *LoadSceneEntity(igzstream &str);
42        Material *LoadMaterial(igzstream &str);
43        Geometry *LoadGeometry(igzstream &str);
44
45        std::map<int, Texture *> mTextureTable;
46        std::map<int, Material *> mMaterialTable;
47        std::map<int, Geometry *> mGeometryTable;
48
49        // these are kept to be able to delete these resources afterwards
50        std::vector<Texture *> mTextures;
51        std::vector<Material *> mMaterials;
52        std::vector<Geometry *> mGeometry;
53        std::vector<SceneEntity *> mSceneEntities;
54        std::vector<Matrix4x4 *> mTrafos;
55};
56
57}
58#endif
Note: See TracBrowser for help on using the repository browser.