Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
TerrainTextureOverlay Class Referenceabstract

Base class for texture-based terrain overlays, with an arbitrary number of texels per terrain tile, intended for debugging purposes. More...

#include <TerrainOverlay.h>

Inheritance diagram for TerrainTextureOverlay:
Collaboration diagram for TerrainTextureOverlay:

Public Member Functions

 TerrainTextureOverlay (float texelsPerTile, int priority=100)
 
 ~TerrainTextureOverlay () override
 
- Public Member Functions inherited from ITerrainOverlay
virtual ~ITerrainOverlay ()
 
virtual void RenderBeforeWater (Renderer::Backend::IDeviceCommandContext *deviceCommandContext)
 
virtual void RenderAfterWater (Renderer::Backend::IDeviceCommandContext *deviceCommandContext, int cullGroup)
 

Protected Member Functions

virtual void BuildTextureRGBA (u8 *data, size_t w, size_t h)=0
 Called each frame to generate the texture to render on the terrain. More...
 
SColor4ub GetColor (size_t idx, u8 alpha) const
 Returns an arbitrary color, for subclasses that want to distinguish different integers visually. More...
 
- Protected Member Functions inherited from ITerrainOverlay
 ITerrainOverlay (int priority)
 

Private Member Functions

void RenderAfterWater (Renderer::Backend::IDeviceCommandContext *deviceCommandContext, int cullGroup) override
 

Private Attributes

float m_TexelsPerTile
 
std::unique_ptr< Renderer::Backend::ITexturem_Texture
 

Additional Inherited Members

- Static Public Member Functions inherited from ITerrainOverlay
static void RenderOverlaysBeforeWater (Renderer::Backend::IDeviceCommandContext *deviceCommandContext)
 Draw all ITerrainOverlay objects that exist and that should be drawn before water. More...
 
static void RenderOverlaysAfterWater (Renderer::Backend::IDeviceCommandContext *deviceCommandContext, int cullGroup)
 Draw all ITerrainOverlay objects that exist and that should be drawn after water. More...
 

Detailed Description

Base class for texture-based terrain overlays, with an arbitrary number of texels per terrain tile, intended for debugging purposes.

Subclasses must implement BuildTextureRGBA which will be called each frame.

Constructor & Destructor Documentation

◆ TerrainTextureOverlay()

TerrainTextureOverlay::TerrainTextureOverlay ( float  texelsPerTile,
int  priority = 100 
)

◆ ~TerrainTextureOverlay()

TerrainTextureOverlay::~TerrainTextureOverlay ( )
overridedefault

Member Function Documentation

◆ BuildTextureRGBA()

virtual void TerrainTextureOverlay::BuildTextureRGBA ( u8 data,
size_t  w,
size_t  h 
)
protectedpure virtual

Called each frame to generate the texture to render on the terrain.

data is w*h*4 bytes, where w and h are the terrain size multiplied by texelsPerTile. data defaults to fully transparent, and should be filled with data in RGBA order.

Implemented in HierarchicalOverlay, LongOverlay, AtlasOverlay, and TerritoryOverlay.

◆ GetColor()

SColor4ub TerrainTextureOverlay::GetColor ( size_t  idx,
u8  alpha 
) const
protected

Returns an arbitrary color, for subclasses that want to distinguish different integers visually.

◆ RenderAfterWater()

void TerrainTextureOverlay::RenderAfterWater ( Renderer::Backend::IDeviceCommandContext deviceCommandContext,
int  cullGroup 
)
overrideprivatevirtual

Reimplemented from ITerrainOverlay.

Member Data Documentation

◆ m_TexelsPerTile

float TerrainTextureOverlay::m_TexelsPerTile
private

◆ m_Texture

std::unique_ptr<Renderer::Backend::ITexture> TerrainTextureOverlay::m_Texture
private

The documentation for this class was generated from the following files: