PageRenderTime 25ms CodeModel.GetById 15ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/lldrawpoolwater.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 92 lines | 49 code | 18 blank | 25 comment | 0 complexity | 0251c000416a6fb9be394e05e10bfce1 MD5 | raw file
 1/** 
 2 * @file lldrawpoolwater.h
 3 * @brief LLDrawPoolWater class definition
 4 *
 5 * $LicenseInfo:firstyear=2002&license=viewerlgpl$
 6 * Second Life Viewer Source Code
 7 * Copyright (C) 2010, Linden Research, Inc.
 8 * 
 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation;
12 * version 2.1 of the License only.
13 * 
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 * Lesser General Public License for more details.
18 * 
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
22 * 
23 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
24 * $/LicenseInfo$
25 */
26
27#ifndef LL_LLDRAWPOOLWATER_H
28#define LL_LLDRAWPOOLWATER_H
29
30#include "lldrawpool.h"
31
32
33class LLFace;
34class LLHeavenBody;
35class LLWaterSurface;
36
37class LLDrawPoolWater: public LLFacePool
38{
39protected:
40	LLPointer<LLViewerTexture> mHBTex[2];
41	LLPointer<LLViewerTexture> mWaterImagep;
42	LLPointer<LLViewerTexture> mOpaqueWaterImagep;
43	LLPointer<LLViewerTexture> mWaterNormp;
44
45public:
46	static BOOL sSkipScreenCopy;
47	static BOOL sNeedsReflectionUpdate;
48	static BOOL sNeedsDistortionUpdate;
49	static LLVector3 sLightDir;
50
51	static LLColor4 sWaterFogColor;
52	static F32 sWaterFogEnd;
53
54	enum
55	{
56		VERTEX_DATA_MASK =	LLVertexBuffer::MAP_VERTEX |
57							LLVertexBuffer::MAP_NORMAL |
58							LLVertexBuffer::MAP_TEXCOORD0	
59	};
60
61	virtual U32 getVertexDataMask() { return VERTEX_DATA_MASK; }
62
63	LLDrawPoolWater();
64	/*virtual*/ ~LLDrawPoolWater();
65
66	/*virtual*/ LLDrawPool *instancePool();
67	static void restoreGL();
68	
69	/*virtual*/ S32 getNumPostDeferredPasses() { return 0; } //getNumPasses(); }
70	/*virtual*/ void beginPostDeferredPass(S32 pass);
71	/*virtual*/ void endPostDeferredPass(S32 pass);
72	/*virtual*/ void renderPostDeferred(S32 pass) { render(pass); }
73	/*virtual*/ S32 getNumDeferredPasses() { return 1; }
74	/*virtual*/ void renderDeferred(S32 pass = 0);
75
76	/*virtual*/ S32 getNumPasses();
77	/*virtual*/ void render(S32 pass = 0);
78	/*virtual*/ void prerender();
79
80	/*virtual*/ LLViewerTexture *getDebugTexture();
81	/*virtual*/ LLColor3 getDebugColor() const; // For AGP debug display
82
83	void renderReflection(LLFace* face);
84	void shade();
85
86protected:
87	void renderOpaqueLegacyWater();
88};
89
90void cgErrorCallback();
91
92#endif // LL_LLDRAWPOOLWATER_H