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

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