My Project
TextureSet.h
1 #pragma once
2 #include "TerrainCommon.h"
3 #include "Terrain.h"
4 #include "Texture.h"
5 
6 #include <stdlib.h>
7 #include <vector>
8 
9 namespace ParaEngine
10 {
11  struct TextureEntity;
12  class CParaFile;
13 }
14 namespace ParaTerrain
15 {
16  using namespace ParaEngine;
17  //class Terrain;
18  //class vector;
19  //class Texture;
20 
22 
29  class TextureSet
30  {
31  public:
33 
37  TextureSet();
38  ~TextureSet();
40 
43  int AddTexture(Texture * pTexture);
44 
47  Texture *GetTexture(int index);
53  bool ReplaceTexture(int nIndex, ParaEngine::TextureEntity* TextureAsset);
54 
57 
59  int UnbindAllTextures();
61  int GetNumTextures();
62 
63  void WriteMask(CParaFile& file, Terrain * pTerrain);
64  void ReadMask(CParaFile& file, Terrain * pTerrain);
65 
67  void GarbageCollect(Terrain * pTerrain);
68 
72  void RemoveTexture(int nIndex, Terrain * pTerrain, bool bNormalizeOthers=true);
73 
74  private:
75  std::vector < Texture * >m_Textures;
76 
77  };
78 }
Which DXT Compression to Use? Obviously, there are some trade-offs between the different formats whic...
Definition: TextureEntity.h:29
int UnbindAllTextures()
unbind and delete all device texture objects.
Definition: TextureSet.cpp:97
Definition: SceneObject.h:15
void RemoveTexture(int nIndex, Terrain *pTerrain, bool bNormalizeOthers=true)
remove the given texture
Definition: TextureSet.cpp:213
different physics engine has different winding order.
Definition: EventBinding.h:32
TextureSet()
Constructs a new TextureSet.
Definition: TextureSet.cpp:21
A TextureSet is a pool of Texture objects that are used by a Terrain to do detail texture rendering...
Definition: TextureSet.h:29
int AddTexture(Texture *pTexture)
Adds a Texture to the TextureSet.
Definition: TextureSet.cpp:35
Definition: mdx.h:48
int GetNumTextures()
Indicates how many Texture objects are in the TextureSet.
Definition: TextureSet.cpp:92
int FindTexture(ParaEngine::TextureEntity *pTexture)
find the index of the given texture entity in the set, if not found returned -1
Definition: TextureSet.cpp:42
void GarbageCollect(Terrain *pTerrain)
remove unused textures
Definition: TextureSet.cpp:154
bool ReplaceTexture(int nIndex, ParaEngine::TextureEntity *TextureAsset)
replace the texture at the given index.
Definition: TextureSet.cpp:60
it presents a real or virtual file in ParaEngine.
Definition: ParaFile.h:31
Texture * GetTexture(int index)
Gets a Texture by its shared index.
Definition: TextureSet.cpp:55
This class represents a single, contiguous chunk of terrain and is the primary public interface to De...
Definition: Terrain.h:386