www.pudn.com > sxdl.zip > sphere.h


#if !defined Sphere_Included
#define Sphere_Included

#include "sxdl.h"

class CSphere :
public CCustomRenderer
{
public:
CSphere ( int Rings , int Segments , int Tex1 , int Tex2 , int Tex3 , Color color = 0xFFFFFFFF ) ;
virtual ~CSphere(void);

protected :
virtual HRESULT OnSetRenderStates ( LPDIRECT3DDEVICE9 Device ) { return S_OK ; } ;
virtual HRESULT OnRestoreRenderStates ( LPDIRECT3DDEVICE9 Device ) { return S_OK ; } ;
virtual HRESULT OnRestore ( ) { return S_OK ; } ;
virtual HRESULT OnInvalidate ( ) { return S_OK ; } ;

//HRESULT OnSetVertexShaderConstants ( LPDIRECT3DDEVICE9 Device , CEntity * Entity ) { return S_OK ; } ;
//HRESULT OnSetPixelShaderConstants ( LPDIRECT3DDEVICE9 Device , CEntity * Entity ) { return S_OK ; } ;
private :
int Rings ;
int Segments ;
int Vertices ; // = ( Rings + 1 ) * ( Segments + 1 ) ;
int Indices ; // = 2 * Rings * ( Segments + 1 ) ;
Color color ;

HRESULT OnPopulateBuffers ( void * Vertices , void * Indices ) ;
HRESULT OnRender ( LPDIRECT3DDEVICE9 Device , CEntity * Entity ) ;
} ;

class CTexturedSphere :
public CSphere
{
public:
CTexturedSphere ( int Rings , int Segments , int Tex ) ;
virtual ~CTexturedSphere ( void ) { } ;
} ;

class CAlphaSphere :
public CSphere
{
public:
CAlphaSphere ( int Rings , int Segments , int Tex ) ;
virtual ~CAlphaSphere ( void) { } ;

private :
HRESULT OnSetRenderStates ( LPDIRECT3DDEVICE9 Device ) ;
HRESULT OnRestoreRenderStates ( LPDIRECT3DDEVICE9 Device ) ;
} ;



class CBumpedSphere :
public CSphere
{
public:
CBumpedSphere ( int Rings , int Segments , int Tex1 , int Tex2 ) ;
virtual ~CBumpedSphere ( void ) { } ;

private :

HRESULT OnSetRenderStates ( LPDIRECT3DDEVICE9 Device ) ;
HRESULT OnRestoreRenderStates ( LPDIRECT3DDEVICE9 Device ) ;
HRESULT OnRestore ( ) ;
HRESULT OnInvalidate ( ) ;
};

#endif