aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/lldrawpoolground.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/lldrawpoolground.cpp')
-rw-r--r--linden/indra/newview/lldrawpoolground.cpp104
1 files changed, 104 insertions, 0 deletions
diff --git a/linden/indra/newview/lldrawpoolground.cpp b/linden/indra/newview/lldrawpoolground.cpp
new file mode 100644
index 0000000..f2f2002
--- /dev/null
+++ b/linden/indra/newview/lldrawpoolground.cpp
@@ -0,0 +1,104 @@
1/**
2 * @file lldrawpoolground.cpp
3 * @brief LLDrawPoolGround class implementation
4 *
5 * Copyright (c) 2002-2007, Linden Research, Inc.
6 *
7 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement
10 * ("Other License"), formally executed by you and Linden Lab. Terms of
11 * the GPL can be found in doc/GPL-license.txt in this distribution, or
12 * online at http://secondlife.com/developers/opensource/gplv2
13 *
14 * There are special exceptions to the terms and conditions of the GPL as
15 * it is applied to this Source Code. View the full text of the exception
16 * in the file doc/FLOSS-exception.txt in this software distribution, or
17 * online at http://secondlife.com/developers/opensource/flossexception
18 *
19 * By copying, modifying or distributing this software, you acknowledge
20 * that you have read and understood your obligations described above,
21 * and agree to abide by those obligations.
22 *
23 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
24 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
25 * COMPLETENESS OR PERFORMANCE.
26 */
27
28#include "llviewerprecompiledheaders.h"
29
30#include "lldrawpoolground.h"
31
32#include "llviewercontrol.h"
33
34#include "llagparray.h"
35#include "lldrawable.h"
36#include "llface.h"
37#include "llsky.h"
38#include "llviewercamera.h"
39#include "llviewerwindow.h"
40#include "llworld.h"
41#include "pipeline.h"
42
43LLDrawPoolGround::LLDrawPoolGround() :
44 LLDrawPool(POOL_GROUND, DATA_SIMPLE_IL_MASK, DATA_SIMPLE_NIL_MASK)
45{
46}
47
48LLDrawPool *LLDrawPoolGround::instancePool()
49{
50 return new LLDrawPoolGround();
51}
52
53void LLDrawPoolGround::prerender()
54{
55 mVertexShaderLevel = gPipeline.getVertexShaderLevel(LLPipeline::SHADER_ENVIRONMENT);
56}
57
58void LLDrawPoolGround::render(S32 pass)
59{
60 if (mDrawFace.empty())
61 {
62 return;
63 }
64
65 glEnableClientState(GL_TEXTURE_COORD_ARRAY);
66 glEnableClientState(GL_VERTEX_ARRAY);
67 glDisableClientState(GL_NORMAL_ARRAY);
68
69 bindGLVertexPointer();
70 bindGLTexCoordPointer();
71
72 LLGLSPipelineSkyBox gls_skybox;
73 LLGLDepthTest gls_depth(GL_FALSE, GL_FALSE);
74
75 glMatrixMode( GL_PROJECTION );
76
77 glPushMatrix();
78 gViewerWindow->setup3DRender();
79
80 glMatrixMode(GL_MODELVIEW);
81
82 LLGLState tex2d(GL_TEXTURE_2D, (mVertexShaderLevel > 0) ? TRUE : FALSE);
83 LLViewerImage::bindTexture(gSky.mVOSkyp->getScatterMap(), 0);
84
85 LLFace *facep = mDrawFace[0];
86
87 if (!(mVertexShaderLevel > 0))
88 {
89 gPipeline.disableLights();
90 }
91
92 glColor4fv(facep->getFaceColor().mV);
93
94 facep->renderIndexed(getRawIndices());
95
96 glMatrixMode( GL_PROJECTION );
97 glPopMatrix();
98 glMatrixMode( GL_MODELVIEW );
99}
100
101void LLDrawPoolGround::renderForSelect()
102{
103}
104