home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2006 July & August
/
PCWorld_2006-07-08_cd.bin
/
temacd
/
planearcade
/
planearcade.exe
/
Tank3.bmp
/
stencil.h
< prev
next >
Wrap
C/C++ Source or Header
|
2004-03-21
|
2KB
|
93 lines
#ifndef _STENCIL_H_
#define _STENCIL_H_
//----------------------------
//Custom Vertex - SQUARE
//----------------------------
struct CUSTOMVERTEXSTENCILSQUARE
{
D3DXVECTOR4 p;
D3DCOLOR color;
};
#define D3DFVF_CUSTOMVERTEXSTENCILSQUARE (D3DFVF_XYZRHW|D3DFVF_DIFFUSE)
//----------------------------
//Custom Vertex - Shadow
//----------------------------
struct CUSTOMVERTEXSTENCILSHADOW
{
float x,y,z;
};
#define D3DFVF_CUSTOMVERTEXSTENCILSHADOW (D3DFVF_XYZ)
//------------------------------
//Shadow Edge
//-------------------------------
struct SHADOWEDGE
{
VECTOR3D V1;
VECTOR3D V2;
};
//------------------------------------------------------------------
// Name: Stencil Class
// Desc: *************
//------------------------------------------------------------------
class STENCIL
{
private:
//SHADOW
D3DXVECTOR3 Vertices[32000];
int NumVertices;
SHADOWEDGE Edge[10000];
int NumEdges;
//BIG SQUARE
LPDIRECT3DVERTEXBUFFER9 SquareVB;
public:
//konstruktor
STENCIL();
//destruktor
~STENCIL();
//SVETLO
VECTOR3D LightPosition;
//SHADOW
void RenderShadowQuads();
void RenderShadowBuffer();
void RenderShadowScreen();
void RenderShadow();
//OTHER
void Initialize();
void AddEdge(VECTOR3D V1,VECTOR3D V2);
void ProcessEdge(VECTOR3D LightPos);
void AddQuad(VECTOR3D V1,VECTOR3D V2,VECTOR3D LightPos);
};
#endif //_STENCIL_H_