00001
00002
00003
00004
00005 #ifndef ps2gl_clear_h
00006 #define ps2gl_clear_h
00007
00008 #include "GL/gl.h"
00009
00010 #include "ps2s/drawenv.h"
00011
00012 #include "ps2s/sprite.h"
00013
00014 class CVifSCDmaPacket;
00015
00016
00017
00018
00019
00020 class CClearEnv {
00021
00022 GS::CDrawEnv *pDrawEnv;
00023 CSprite *pSprite;
00024
00025 public:
00026 CClearEnv();
00027 ~CClearEnv();
00028
00029 void SetDimensions( int width, int height );
00030 void SetFrameBufPsm( GS::tPSM psm );
00031 void SetDepthBufPsm( GS::tPSM psm );
00032 void SetFrameBufAddr( unsigned int gsWordAddr ) {
00033 pDrawEnv->SetFrameBufferAddr( gsWordAddr );
00034 }
00035 void SetDepthBufAddr( unsigned int gsWordAddr ) {
00036 pDrawEnv->SetDepthBufferAddr( gsWordAddr );
00037 }
00038
00039 void SetClearColor( float r, float g, float b, float a ) {
00040 pSprite->SetColor( (unsigned int)(255.0f * r),
00041 (unsigned int)(255.0f * g),
00042 (unsigned int)(255.0f * b),
00043 (unsigned int)(255.0f * a) );
00044 }
00045
00046 void SetClearDepth( float depth ) {
00047 pSprite->SetDepth( Core::FToI4(depth) );
00048 }
00049
00050 void ClearBuffers( unsigned int bitMask );
00051 };
00052
00053
00054 #endif // ps2gl_clear_h