source:
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ResourceManager.h
@
2948
Revision 2948, 1.4 KB checked in by mattausch, 16 years ago (diff) |
---|
Rev | Line | |
---|---|---|
[2795] | 1 | #ifndef __ResourceManager_H__ |
2 | #define __ResourceManager_H__ | |
[2747] | 3 | |
[2795] | 4 | |
[2747] | 5 | #include <string> |
[2755] | 6 | #include <iostream> |
7 | #include <fstream> | |
[2757] | 8 | #include <map> |
[2755] | 9 | #include "common.h" |
[2747] | 10 | |
[2840] | 11 | |
[2795] | 12 | class igzstream; |
[2747] | 13 | |
[2795] | 14 | |
[2776] | 15 | namespace CHCDemoEngine |
[2755] | 16 | { |
17 | ||
18 | class SceneEntity; | |
19 | class Material; | |
[2747] | 20 | class Geometry; |
[2757] | 21 | class Texture; |
[2795] | 22 | class Matrix4x4; |
[2840] | 23 | class Transform3; |
[2747] | 24 | |
[2840] | 25 | |
[2795] | 26 | /** Loads a scene and also handles the cleanup |
27 | */ | |
28 | class ResourceManager | |
[2747] | 29 | { |
30 | public: | |
31 | ||
[2795] | 32 | ~ResourceManager(); |
33 | /** Loads a model | |
34 | */ | |
[2755] | 35 | bool Load(const std::string &filename, SceneEntityContainer &geometry); |
[2747] | 36 | |
[2948] | 37 | int GetNumEntities() const { return (int)mSceneEntities.size(); } |
38 | ||
[2747] | 39 | protected: |
[2755] | 40 | |
[2795] | 41 | void LoadTextures(igzstream &str); |
42 | void LoadShapes(igzstream &str); | |
43 | void LoadSceneEntities(igzstream &str, SceneEntityContainer &entities); | |
[2757] | 44 | |
[2795] | 45 | SceneEntity *LoadSceneEntity(igzstream &str); |
46 | Material *LoadMaterial(igzstream &str); | |
47 | Geometry *LoadGeometry(igzstream &str); | |
[2747] | 48 | |
[2757] | 49 | std::map<int, Texture *> mTextureTable; |
[2764] | 50 | std::map<int, Material *> mMaterialTable; |
51 | std::map<int, Geometry *> mGeometryTable; | |
[2842] | 52 | //std::map<int, Shape *> mShapesTable; |
[2795] | 53 | |
54 | // these are kept to be able to delete these resources afterwards | |
55 | std::vector<Texture *> mTextures; | |
56 | std::vector<Material *> mMaterials; | |
57 | std::vector<Geometry *> mGeometry; | |
[2840] | 58 | std::vector<Transform3 *> mTrafos; |
[2842] | 59 | |
60 | ShapeContainer mShapes; | |
[2946] | 61 | |
62 | //////// | |
63 | ||
[2948] | 64 | /// the scene entities |
[2946] | 65 | SceneEntityContainer mSceneEntities; |
[2747] | 66 | }; |
67 | ||
[2755] | 68 | } |
[2747] | 69 | #endif |
Note: See TracBrowser
for help on using the repository browser.