ShadowMap Class Reference

#include <ShadowMap.h>

List of all members.

Public Member Functions

 ShadowMap ()
virtual ~ShadowMap ()
void setTexture ()
void addSquare (float x, float y, float w, float opacity=1.0f)
void addCircle (float sx, float sy, float sw, float opacity=1.0f)
bool shouldAddShadow ()
unsigned int getShadowCount ()

Protected Member Functions

void addShadow (float sx, float sy, float sw, float opacity, bool circle)

Protected Attributes

unsigned int shadowCount_
GLTexture shadowTexture_
GLubyteshadowBytes_
GLint size_
GLint sizeSq_


Detailed Description

Definition at line 26 of file ShadowMap.h.


Constructor & Destructor Documentation

ShadowMap::ShadowMap (  ) 

Definition at line 30 of file ShadowMap.cpp.

References GLTexture::create(), GL_LUMINANCE, shadowBytes_, shadowTexture_, size_, and sizeSq_.

ShadowMap::~ShadowMap (  )  [virtual]

Definition at line 37 of file ShadowMap.cpp.

References shadowBytes_.


Member Function Documentation

void ShadowMap::setTexture (  ) 

Definition at line 42 of file ShadowMap.cpp.

References GLTexture::draw(), GLStateExtension::getNoTexSubImage(), GL_LUMINANCE, GL_TEXTURE_2D, GL_UNSIGNED_BYTE, glTexSubImage2D(), shadowBytes_, shadowCount_, shadowTexture_, size_, and sizeSq_.

Referenced by Landscape::actualDrawLandTextured().

void ShadowMap::addSquare ( float  x,
float  y,
float  w,
float  opacity = 1.0f 
)

Definition at line 66 of file ShadowMap.cpp.

References addShadow().

void ShadowMap::addCircle ( float  sx,
float  sy,
float  sw,
float  opacity = 1.0f 
)

Definition at line 71 of file ShadowMap.cpp.

References addShadow().

Referenced by TargetRendererImplTarget::render(), and TargetRendererImplTank::render().

bool ShadowMap::shouldAddShadow (  ) 

Definition at line 76 of file ShadowMap.cpp.

References GLStateExtension::getNoTexSubImage(), GLStateExtension::hasHardwareShadows(), GLStateExtension::hasMultiTex(), and OptionsDisplay::instance().

Referenced by addShadow(), TargetRendererImplTarget::render(), and TargetRendererImplTank::render().

unsigned int ShadowMap::getShadowCount (  )  [inline]

Definition at line 38 of file ShadowMap.h.

References shadowCount_.

void ShadowMap::addShadow ( float  sx,
float  sy,
float  sw,
float  opacity,
bool  circle 
) [protected]

Definition at line 85 of file ShadowMap.cpp.

References LandscapeMaps::getGroundMaps(), GroundMaps::getLandscapeHeight(), ScorchedContext::getLandscapeMaps(), GroundMaps::getLandscapeWidth(), ScorchedClient::instance(), int(), MAX, MIN, shadowBytes_, shadowCount_, shouldAddShadow(), and size_.

Referenced by addCircle(), and addSquare().


Member Data Documentation

unsigned int ShadowMap::shadowCount_ [protected]

Definition at line 41 of file ShadowMap.h.

Referenced by addShadow(), getShadowCount(), and setTexture().

GLTexture ShadowMap::shadowTexture_ [protected]

Definition at line 42 of file ShadowMap.h.

Referenced by setTexture(), and ShadowMap().

GLubyte* ShadowMap::shadowBytes_ [protected]

Definition at line 43 of file ShadowMap.h.

Referenced by addShadow(), setTexture(), ShadowMap(), and ~ShadowMap().

GLint ShadowMap::size_ [protected]

Definition at line 44 of file ShadowMap.h.

Referenced by addShadow(), setTexture(), and ShadowMap().

GLint ShadowMap::sizeSq_ [protected]

Definition at line 44 of file ShadowMap.h.

Referenced by setTexture(), and ShadowMap().


The documentation for this class was generated from the following files:
Generated on Mon Feb 16 15:15:06 2009 for Scorched3D by  doxygen 1.5.3