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