PageRenderTime 44ms CodeModel.GetById 33ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 1ms

/indra/newview/lldrawpoolsimple.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 141 lines | 89 code | 25 blank | 27 comment | 0 complexity | 9a6d8bdd880fd29906d5a81e05a9eef3 MD5 | raw file
  1/** 
  2 * @file lldrawpoolsimple.h
  3 * @brief LLDrawPoolSimple 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_LLDRAWPOOLSIMPLE_H
 28#define LL_LLDRAWPOOLSIMPLE_H
 29
 30#include "lldrawpool.h"
 31
 32class LLDrawPoolSimple : public LLRenderPass
 33{
 34public:
 35	enum
 36	{
 37		VERTEX_DATA_MASK =	LLVertexBuffer::MAP_VERTEX |
 38							LLVertexBuffer::MAP_NORMAL |
 39							LLVertexBuffer::MAP_TEXCOORD0 |
 40							LLVertexBuffer::MAP_COLOR
 41	};
 42	virtual U32 getVertexDataMask() { return VERTEX_DATA_MASK; }
 43
 44	LLDrawPoolSimple();
 45	
 46	/*virtual*/ S32 getNumDeferredPasses() { return 1; }
 47	/*virtual*/ void beginDeferredPass(S32 pass);
 48	/*virtual*/ void endDeferredPass(S32 pass);
 49	/*virtual*/ void renderDeferred(S32 pass);
 50
 51	/*virtual*/ void beginRenderPass(S32 pass);
 52	/*virtual*/ void endRenderPass(S32 pass);
 53	/// We need two passes so we can handle emissive materials separately.
 54	/*virtual*/ S32	 getNumPasses() { return 1; }
 55	/*virtual*/ void render(S32 pass = 0);
 56	/*virtual*/ void prerender();
 57
 58};
 59
 60class LLDrawPoolGrass : public LLRenderPass
 61{
 62public:
 63	enum
 64	{
 65		VERTEX_DATA_MASK =	LLVertexBuffer::MAP_VERTEX |
 66							LLVertexBuffer::MAP_NORMAL |
 67							LLVertexBuffer::MAP_TEXCOORD0 |
 68							LLVertexBuffer::MAP_COLOR
 69	};
 70	virtual U32 getVertexDataMask() { return VERTEX_DATA_MASK; }
 71
 72	LLDrawPoolGrass();
 73	
 74	/*virtual*/ S32 getNumDeferredPasses() { return 1; }
 75	/*virtual*/ void beginDeferredPass(S32 pass);
 76	/*virtual*/ void endDeferredPass(S32 pass);
 77	/*virtual*/ void renderDeferred(S32 pass);
 78
 79	/*virtual*/ void beginRenderPass(S32 pass);
 80	/*virtual*/ void endRenderPass(S32 pass);
 81	/// We need two passes so we can handle emissive materials separately.
 82	/*virtual*/ S32	 getNumPasses() { return 1; }
 83	/*virtual*/ void render(S32 pass = 0);
 84	/*virtual*/ void prerender();
 85};
 86
 87class LLDrawPoolFullbright : public LLRenderPass
 88{
 89public:
 90	enum
 91	{
 92		VERTEX_DATA_MASK =	LLVertexBuffer::MAP_VERTEX |
 93							LLVertexBuffer::MAP_TEXCOORD0 |
 94							LLVertexBuffer::MAP_COLOR
 95	};
 96	virtual U32 getVertexDataMask() { return VERTEX_DATA_MASK; }
 97
 98	LLDrawPoolFullbright();
 99	
100	/*virtual*/ S32 getNumPostDeferredPasses() { return 1; }
101	/*virtual*/ void beginPostDeferredPass(S32 pass);
102	/*virtual*/ void endPostDeferredPass(S32 pass);
103	/*virtual*/ void renderPostDeferred(S32 pass);
104
105	/*virtual*/ void beginRenderPass(S32 pass);
106	/*virtual*/ void endRenderPass(S32 pass);
107	/*virtual*/ S32	 getNumPasses();
108	/*virtual*/ void render(S32 pass = 0);
109	/*virtual*/ void prerender();
110
111};
112
113class LLDrawPoolGlow : public LLRenderPass
114{
115public:
116	LLDrawPoolGlow(): LLRenderPass(LLDrawPool::POOL_GLOW) { }
117	
118	enum
119	{
120		VERTEX_DATA_MASK =	LLVertexBuffer::MAP_VERTEX |
121							LLVertexBuffer::MAP_TEXCOORD0 |
122							LLVertexBuffer::MAP_EMISSIVE
123	};
124
125	virtual U32 getVertexDataMask() { return VERTEX_DATA_MASK; }
126
127	virtual void prerender() { }
128
129	/*virtual*/ S32 getNumPostDeferredPasses() { return 1; }
130	/*virtual*/ void beginPostDeferredPass(S32 pass); 
131	/*virtual*/ void endPostDeferredPass(S32 pass);
132	/*virtual*/ void renderPostDeferred(S32 pass);
133
134	/*virtual*/ S32 getNumPasses();
135
136	void render(S32 pass = 0);
137	void pushBatch(LLDrawInfo& params, U32 mask, BOOL texture = TRUE, BOOL batch_textures = FALSE);
138
139};
140
141#endif // LL_LLDRAWPOOLSIMPLE_H