PS2GL
OpenGL*-like API for the PS2
Loading...
Searching...
No Matches
clear.h
1/* Copyright (C) 2000,2001,2002 Sony Computer Entertainment America
2
3 This file is subject to the terms and conditions of the GNU Lesser
4 General Public License Version 2.1. See the file "COPYING" in the
5 main directory of this archive for more details. */
6
7#ifndef ps2gl_clear_h
8#define ps2gl_clear_h
9
10#include "GL/gl.h"
11
12#include "ps2s/drawenv.h"
13
14#include "ps2s/sprite.h"
15
16class CVifSCDmaPacket;
17
18/********************************************
19 * class def
20 */
21
22class CClearEnv {
23
24 GS::CDrawEnv* pDrawEnv;
25 CSprite* pSprite;
26
27public:
28 CClearEnv();
29 ~CClearEnv();
30
31 void SetDimensions(int width, int height);
32 void SetFrameBufPsm(GS::tPSM psm);
33 void SetDepthBufPsm(GS::tPSM psm);
34 void SetFrameBufAddr(unsigned int gsWordAddr)
35 {
36 pDrawEnv->SetFrameBufferAddr(gsWordAddr);
37 }
38 void SetDepthBufAddr(unsigned int gsWordAddr)
39 {
40 pDrawEnv->SetDepthBufferAddr(gsWordAddr);
41 }
42
43 void SetClearColor(float r, float g, float b, float a)
44 {
45 pSprite->SetColor((unsigned int)(255.0f * r),
46 (unsigned int)(255.0f * g),
47 (unsigned int)(255.0f * b),
48 (unsigned int)(255.0f * a));
49 }
50
51 void SetClearDepth(float depth)
52 {
53 pSprite->SetDepth(Core::FToI4(depth));
54 }
55
56 void ClearBuffers(unsigned int bitMask);
57};
58
59#endif // ps2gl_clear_h