My Project
DetailTexture.h
1 #pragma once
2 
3 #include "TerrainCommon.h"
4 #include "Texture.h"
5 #include "Terrain.h"
6 
7 namespace ParaEngine
8 {
9  class CParaFile;
10 }
11 namespace ParaTerrain
12 {
13  using namespace ParaEngine;
14  //class Texture;
15  //class Terrain;
16 
18 
24  {
25  public:
27  DetailTexture(Texture * pTexture, Texture * pMask);
28  DetailTexture(Texture * pTexture = NULL, byte DefaultMaskValue = 0);
29  DetailTexture(CParaFile& file,Terrain * pTerrain);
30  ~DetailTexture();
32  void SetMask(Texture *);
34  void SetTexture(Texture *);
35 
37  DeviceTexturePtr_type BindMask();
39  DeviceTexturePtr_type BindTexture();
41  void Unbind();
43  Texture *GetMask();
44 
50  Texture* RegenerateMask(byte DefaultMaskValue = 0xff);
51 
54 
55  void WriteMask(CParaFile& file, Terrain * pTerrain);
56  void ReadMask(CParaFile& file, Terrain * pTerrain);
57 
59  void FlipVertical();
61  void FlipHorizontal();
62 
63  bool IsOwnMask() {return m_bOwnMask;};
64  void SetOwnMask(bool bOwn) {m_bOwnMask = bOwn;};
65 
66  bool IsOwnTexture() {return m_bOwnTexture;};
67  void SetOwnTexture(bool bOwn) {m_bOwnTexture = bOwn;};
68  private:
70  bool m_bOwnMask;
71  Texture * m_pMask;
72 
74  bool m_bOwnTexture;
75  Texture *m_pTexture;
76  };
77 }
Definition: SceneObject.h:15
void FlipVertical()
Works exactly like Texture::FlipVertical().
Definition: DetailTexture.cpp:79
void SetMask(Texture *)
Sets the alpha mask to be used for this painting layer. This should be an alpha-only Texture...
Definition: DetailTexture.cpp:87
different physics engine has different winding order.
Definition: EventBinding.h:32
Definition: mdx.h:48
DeviceTexturePtr_type BindMask()
Binds the mask layer to an OpenGL texture object.
Definition: DetailTexture.cpp:122
Texture * RegenerateMask(byte DefaultMaskValue=0xff)
regenerate the Mask file based on the dimension of the detailed texture.
Definition: DetailTexture.cpp:37
DetailTexture(Texture *pTexture, Texture *pMask)
Constructs a new DetailTexture that allows splatting of the specified Texture as a detail texture...
Definition: DetailTexture.cpp:14
Texture * GetTexture()
Gets the detail texture.
Definition: DetailTexture.cpp:117
void Unbind()
Unloads both the mask and detail OpenGL texture objects.
Definition: DetailTexture.cpp:138
void FlipHorizontal()
Works exactly like Texture::FlipHorizontal().
Definition: DetailTexture.cpp:71
Texture * GetMask()
Gets the alpha mask layer.
Definition: DetailTexture.cpp:100
it presents a real or virtual file in ParaEngine.
Definition: ParaFile.h:31
A DetailTexture is a "layer" that can be painted onto to put texture "splats" on a terrain surface...
Definition: DetailTexture.h:23
This class represents a single, contiguous chunk of terrain and is the primary public interface to De...
Definition: Terrain.h:386
DeviceTexturePtr_type BindTexture()
Binds the detail texture to an OpenGL texture object.
Definition: DetailTexture.cpp:130
void SetTexture(Texture *)
Sets the Texture that this painting layer uses as a detail texture.
Definition: DetailTexture.cpp:105