Ignore:
Timestamp:
06/22/08 05:24:22 (16 years ago)
Author:
mattausch
Message:
 
File:
1 moved

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ResourceManager.h

    r2782 r2795  
    1 #ifndef __BinaryLoader_H__ 
    2 #define __BinaryLoader_H__ 
     1#ifndef __ResourceManager_H__ 
     2#define __ResourceManager_H__ 
    33 
    4 // note use forward declaration instead 
     4 
    55#include <string> 
    66#include <iostream> 
     
    1010#include "common.h" 
    1111 
     12class igzstream; 
     13 
    1214 
    1315namespace CHCDemoEngine 
    1416{ 
    1517 
    16 class igzstream; 
    1718class SceneEntity; 
    1819class Material; 
    1920class Geometry; 
    2021class Texture; 
     22class Matrix4x4; 
    2123 
    22  
    23 class BinaryLoader 
     24/** Loads a scene and also handles the cleanup 
     25*/ 
     26class ResourceManager 
    2427{ 
    2528public: 
    2629 
    27         ~BinaryLoader(); 
    28  
     30        ~ResourceManager(); 
     31        /** Loads a model 
     32        */ 
    2933        bool Load(const std::string &filename, SceneEntityContainer &geometry); 
    3034 
    3135protected: 
    3236         
    33         void LoadTextures(std::ifstream &str); 
    34         void LoadShapes(std::ifstream &str); 
    35         void LoadSceneEntities(std::ifstream &str, SceneEntityContainer &entities); 
     37        void LoadTextures(igzstream &str); 
     38        void LoadShapes(igzstream &str); 
     39        void LoadSceneEntities(igzstream &str, SceneEntityContainer &entities); 
    3640 
    37         SceneEntity *LoadSceneEntity(std::ifstream &str); 
    38         Material *LoadMaterial(std::ifstream &str); 
    39         Geometry *LoadGeometry(std::ifstream &str); 
     41        SceneEntity *LoadSceneEntity(igzstream &str); 
     42        Material *LoadMaterial(igzstream &str); 
     43        Geometry *LoadGeometry(igzstream &str); 
    4044 
    4145        std::map<int, Texture *> mTextureTable; 
    4246        std::map<int, Material *> mMaterialTable; 
    4347        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; 
    4455}; 
    4556 
Note: See TracChangeset for help on using the changeset viewer.