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

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