aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llrender/llglimmediate.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/llrender/llglimmediate.h107
1 files changed, 1 insertions, 106 deletions
diff --git a/linden/indra/llrender/llglimmediate.h b/linden/indra/llrender/llglimmediate.h
index e0cddff..4a7a0eb 100644
--- a/linden/indra/llrender/llglimmediate.h
+++ b/linden/indra/llrender/llglimmediate.h
@@ -1,106 +1 @@
1/** #error This file has been renamed llrender.h
2 * @file llglimmediate.h
3 * @brief LLGLImmediate definition
4 *
5 * This class acts as a wrapper for OpenGL immediate calls concerning glBegin and glEnd.
6 * The goal of this class is to minimize the number of api calls due to legacy rendering
7 * code, and to define an interface for a multiple rendering API abstraction of the UI
8 * rendering.
9 *
10 * $LicenseInfo:firstyear=2001&license=viewergpl$
11 *
12 * Copyright (c) 2001-2008, Linden Research, Inc.
13 *
14 * Second Life Viewer Source Code
15 * The source code in this file ("Source Code") is provided by Linden Lab
16 * to you under the terms of the GNU General Public License, version 2.0
17 * ("GPL"), unless you have obtained a separate licensing agreement
18 * ("Other License"), formally executed by you and Linden Lab. Terms of
19 * the GPL can be found in doc/GPL-license.txt in this distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
21 *
22 * There are special exceptions to the terms and conditions of the GPL as
23 * it is applied to this Source Code. View the full text of the exception
24 * in the file doc/FLOSS-exception.txt in this software distribution, or
25 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
26 *
27 * By copying, modifying or distributing this software, you acknowledge
28 * that you have read and understood your obligations described above,
29 * and agree to abide by those obligations.
30 *
31 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
32 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
33 * COMPLETENESS OR PERFORMANCE.
34 * $/LicenseInfo$
35 */
36
37#ifndef LL_LLGLIMMEDIATE_H
38#define LL_LLGLIMMEDIATE_H
39
40#include "stdtypes.h"
41#include "llgltypes.h"
42#include "llglheaders.h"
43#include "llvertexbuffer.h"
44
45class LLGLImmediate
46{
47public:
48 LLGLImmediate();
49
50 void translatef(const GLfloat& x, const GLfloat& y, const GLfloat& z);
51 void pushMatrix();
52 void popMatrix();
53 void blendFunc(GLenum sfactor, GLenum dfactor);
54 void flush();
55
56 void begin(const GLuint& mode);
57 void end();
58 void vertex2i(const GLint& x, const GLint& y);
59 void vertex2f(const GLfloat& x, const GLfloat& y);
60 void vertex3f(const GLfloat& x, const GLfloat& y, const GLfloat& z);
61 void vertex2fv(const GLfloat* v);
62 void vertex3fv(const GLfloat* v);
63
64 void texCoord2i(const GLint& x, const GLint& y);
65 void texCoord2f(const GLfloat& x, const GLfloat& y);
66 void texCoord2fv(const GLfloat* tc);
67
68 void color4ub(const GLubyte& r, const GLubyte& g, const GLubyte& b, const GLubyte& a);
69 void color4f(const GLfloat& r, const GLfloat& g, const GLfloat& b, const GLfloat& a);
70 void color4fv(const GLfloat* c);
71 void color3f(const GLfloat& r, const GLfloat& g, const GLfloat& b);
72 void color3fv(const GLfloat* c);
73 void color4ubv(const GLubyte* c);
74
75 // switch clever mode GL immediate rendering on or off. Setting to true builds
76 // client arrays manually, setting to false passes through the GL immediate mode
77 // commands to the GL implementation. Controllable by the RenderUseCleverUI
78 // debug setting.
79 // *NOTE: I have measured that this has about a 9% performance cost (0.6ms) for the
80 // Render/UI fasttimer vs the old #if CLEVER compile time switch. Dave Parks and I
81 // agreed that this was acceptable at the time due to it enabling better regression
82 // testing for QA.
83 // -Brad
84 void setClever(bool do_clever);
85
86 typedef struct Vertex
87 {
88 GLfloat v[3];
89 GLubyte c[4];
90 GLfloat uv[2];
91 };
92
93private:
94 static bool sClever;
95
96 U32 mCount;
97 U32 mMode;
98 LLPointer<LLVertexBuffer> mBuffer;
99 LLStrider<LLVector3> mVerticesp;
100 LLStrider<LLVector2> mTexcoordsp;
101 LLStrider<LLColor4U> mColorsp;
102};
103
104extern LLGLImmediate gGL;
105
106#endif