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

Revision 3020, 1.4 KB checked in by mattausch, 16 years ago (diff)

removed most leaks

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
12
13class igzstream;
14
15
16namespace CHCDemoEngine
17{
18
19class SceneEntity;
20class Material;
21class Geometry;
22class Texture;
23class Matrix4x4;
24class Transform3;
25
26
27/** Loads a scene and also handles the cleanup
28*/
29class ResourceManager
30{
31public:
32
33        ~ResourceManager();
34        /** Loads a model
35        */
36        bool Load(const std::string &filename, SceneEntityContainer &geometry);
37
38        int GetNumEntities() const { return (int)mSceneEntities.size(); }
39
40protected:
41       
42        void LoadTextures(igzstream &str);
43        void LoadShapes(igzstream &str);
44        void LoadSceneEntities(igzstream &str, SceneEntityContainer &entities);
45
46        SceneEntity *LoadSceneEntity(igzstream &str);
47        Material *LoadMaterial(igzstream &str);
48        Geometry *LoadGeometry(igzstream &str);
49
50        std::map<int, Texture *> mTextureTable;
51        std::map<int, Material *> mMaterialTable;
52        std::map<int, Geometry *> mGeometryTable;
53        //std::map<int, Shape *> mShapesTable;
54
55        // these are kept to be able to delete these resources afterwards
56        std::vector<Texture *> mTextures;
57        std::vector<Material *> mMaterials;
58        std::vector<Geometry *> mGeometry;
59        std::vector<Transform3 *> mTrafos;
60       
61        ShapeContainer mShapes;
62
63        LODContainer mLODs;
64
65        ////////
66
67        /// the scene entities
68        SceneEntityContainer mSceneEntities;
69};
70
71}
72#endif
Note: See TracBrowser for help on using the repository browser.