Pyrogenesis
trunk
|
Maintains the LOS (fog-of-war / shroud-of-darkness) texture, used for rendering and for the minimap. More...
#include <LOSTexture.h>
Public Member Functions | |
CLOSTexture (CSimulation2 &simulation) | |
~CLOSTexture () | |
void | MakeDirty () |
Marks the LOS texture as needing recomputation. More... | |
void | BindTexture (int unit) |
Recomputes the LOS texture if necessary, and binds it to the requested texture unit. More... | |
GLuint | GetTexture () |
Recomputes the LOS texture if necessary, and returns the texture handle. More... | |
void | InterpolateLOS () |
GLuint | GetTextureSmooth () |
const CMatrix3D & | GetTextureMatrix () |
Returns a matrix to map (x,y,z) world coordinates onto (u,v) LOS texture coordinates, in the form expected by glLoadMatrixf. More... | |
const CMatrix3D * | GetMinimapTextureMatrix () |
Returns a matrix to map (0,0)-(1,1) texture coordinates onto LOS texture coordinates, in the form expected by glLoadMatrixf. More... | |
Private Member Functions | |
NONCOPYABLE (CLOSTexture) | |
void | DeleteTexture () |
bool | CreateShader () |
void | ConstructTexture (int unit) |
void | RecomputeTexture (int unit) |
size_t | GetBitmapSize (size_t w, size_t h, size_t *pitch) |
void | GenerateBitmap (ICmpRangeManager::CLosQuerier los, u8 *losData, size_t w, size_t h, size_t pitch) |
Private Attributes | |
CSimulation2 & | m_Simulation |
bool | m_Dirty |
bool | m_ShaderInitialized |
GLuint | m_Texture |
GLuint | m_TextureSmooth1 |
GLuint | m_TextureSmooth2 |
bool | whichTex |
GLuint | m_smoothFbo |
CShaderTechniquePtr | m_smoothShader |
ssize_t | m_MapSize |
GLsizei | m_TextureSize |
CMatrix3D | m_TextureMatrix |
CMatrix3D | m_MinimapTextureMatrix |
Friends | |
class | TestLOSTexture |
Maintains the LOS (fog-of-war / shroud-of-darkness) texture, used for rendering and for the minimap.
CLOSTexture::CLOSTexture | ( | CSimulation2 & | simulation | ) |
CLOSTexture::~CLOSTexture | ( | ) |
void CLOSTexture::BindTexture | ( | int | unit | ) |
Recomputes the LOS texture if necessary, and binds it to the requested texture unit.
Also switches the current active texture unit, and enables texturing on it. The texture is in 8-bit ALPHA format.
|
private |
|
private |
|
private |
|
private |
|
private |
const CMatrix3D * CLOSTexture::GetMinimapTextureMatrix | ( | ) |
Returns a matrix to map (0,0)-(1,1) texture coordinates onto LOS texture coordinates, in the form expected by glLoadMatrixf.
This must only be called after BindTexture.
GLuint CLOSTexture::GetTexture | ( | ) |
Recomputes the LOS texture if necessary, and returns the texture handle.
Also potentially switches the current active texture unit, and enables texturing on it. The texture is in 8-bit ALPHA format.
const CMatrix3D & CLOSTexture::GetTextureMatrix | ( | ) |
Returns a matrix to map (x,y,z) world coordinates onto (u,v) LOS texture coordinates, in the form expected by glLoadMatrixf.
This must only be called after BindTexture.
GLuint CLOSTexture::GetTextureSmooth | ( | ) |
void CLOSTexture::InterpolateLOS | ( | ) |
void CLOSTexture::MakeDirty | ( | ) |
Marks the LOS texture as needing recomputation.
Call this after each simulation update, to ensure responsive updates.
|
private |
|
private |
|
friend |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |