Public Member Functions | |
glRenderer () | |
virtual | ~glRenderer () |
virtual void | Vertex (REAL x, REAL y) |
virtual void | Vertex (REAL x, REAL y, REAL z) |
virtual void | Vertex3 (REAL *x) |
virtual void | Vertex (REAL x, REAL y, REAL z, REAL w) |
virtual void | TexCoord (REAL u, REAL v) |
virtual void | TexCoord (REAL u, REAL v, REAL w) |
virtual void | TexCoord (REAL u, REAL v, REAL w, REAL t) |
virtual void | TexVertex (REAL x, REAL y, REAL z, REAL u, REAL v) |
virtual void | Color (REAL r, REAL g, REAL b) |
virtual void | Color (REAL r, REAL g, REAL b, REAL a) |
virtual void | End (bool force=true) |
virtual void | BeginLines () |
virtual void | BeginTriangles () |
virtual void | BeginQuads () |
virtual void | BeginLineStrip () |
virtual void | BeginLineLoop () |
virtual void | BeginTriangleStrip () |
virtual void | BeginQuadStrip () |
virtual void | BeginTriangleFan () |
virtual void | Line (REAL x1, REAL y1, REAL z1, REAL x2, REAL y2, REAL z2) |
virtual void | ProjMatrix () |
virtual void | ModelMatrix () |
virtual void | TexMatrix () |
virtual void | PushMatrix () |
virtual void | PopMatrix () |
virtual void | MultMatrix (REAL mdata[4][4]) |
virtual void | IdentityMatrix () |
virtual void | ScaleMatrix (REAL f) |
virtual void | ScaleMatrix (REAL f1, REAL f2, REAL f3) |
virtual void | TranslateMatrix (REAL x1, REAL x2, REAL x3) |
virtual void | ReallySetFlag (flag f, bool c) |
Private Member Functions | |
void | BeginPrimitive (GLenum p, bool forceEnd=false) |
void | MatrixMode (GLenum mm) |
Private Attributes | |
GLenum | lastPrimitive |
bool | forceglEnd |
GLenum | lastMatrix |
Definition at line 38 of file rGLRender.cpp.
glRenderer::glRenderer | ( | ) | [inline] |
Definition at line 74 of file rGLRender.cpp.
References rRenderer::ChangeFlags().
00074 :lastPrimitive(GL_FALSE), forceglEnd(false), lastMatrix(GL_FALSE){ 00075 ChangeFlags(0xffffffff,0); 00076 };
virtual glRenderer::~glRenderer | ( | ) | [inline, virtual] |
void glRenderer::BeginPrimitive | ( | GLenum | p, | |
bool | forceEnd = false | |||
) | [inline, private] |
Definition at line 44 of file rGLRender.cpp.
References forceglEnd, glBegin, glEnd, lastPrimitive, and sr_CheckGLError().
Referenced by BeginLineLoop(), BeginLines(), BeginLineStrip(), BeginQuads(), BeginQuadStrip(), BeginTriangleFan(), BeginTriangles(), BeginTriangleStrip(), and Line().
00044 { 00045 // glBegin(p); 00046 // return; 00047 00048 if (lastPrimitive != p && lastPrimitive != GL_FALSE) 00049 { 00050 glEnd(); 00051 sr_CheckGLError(); 00052 } 00053 00054 if ( lastPrimitive != p ) 00055 { 00056 sr_CheckGLError(); 00057 glBegin(p); 00058 } 00059 00060 lastPrimitive = p; 00061 00062 forceglEnd = forceEnd; 00063 }
void glRenderer::MatrixMode | ( | GLenum | mm | ) | [inline, private] |
Definition at line 65 of file rGLRender.cpp.
References glMatrixMode, and lastMatrix.
Referenced by ModelMatrix(), ProjMatrix(), and TexMatrix().
00065 { 00066 // if (lastMatrix != mm) 00067 { 00068 glMatrixMode(mm); 00069 lastMatrix = mm; 00070 } 00071 }
Implements rRenderer.
Definition at line 80 of file rGLRender.cpp.
00080 { 00081 glVertex2f(x,y); 00082 };
virtual void glRenderer::Vertex3 | ( | REAL * | x | ) | [inline, virtual] |
Implements rRenderer.
Definition at line 88 of file rGLRender.cpp.
00088 { 00089 glVertex3fv(x); 00090 }
Implements rRenderer.
Definition at line 115 of file rGLRender.cpp.
00115 { 00116 glColor3f(r,g,b); 00117 };
virtual void glRenderer::End | ( | bool | force = true |
) | [inline, virtual] |
Implements rRenderer.
Definition at line 124 of file rGLRender.cpp.
References forceglEnd, glEnd, lastPrimitive, and sr_CheckGLError().
Referenced by IdentityMatrix(), Line(), ModelMatrix(), MultMatrix(), PopMatrix(), ProjMatrix(), ScaleMatrix(), TexMatrix(), and TranslateMatrix().
00124 { 00125 // glEnd(); 00126 // return; 00127 00128 if ((forceglEnd || force ) && lastPrimitive!=GL_FALSE) 00129 { 00130 forceglEnd = false; 00131 glEnd(); 00132 sr_CheckGLError(); 00133 lastPrimitive = GL_FALSE; 00134 } 00135 }
virtual void glRenderer::BeginLines | ( | ) | [inline, virtual] |
Implements rRenderer.
Definition at line 137 of file rGLRender.cpp.
References BeginPrimitive().
00137 { 00138 BeginPrimitive(GL_LINES); 00139 };
virtual void glRenderer::BeginTriangles | ( | ) | [inline, virtual] |
Implements rRenderer.
Definition at line 141 of file rGLRender.cpp.
References BeginPrimitive().
00141 { 00142 BeginPrimitive(GL_TRIANGLES); 00143 }
virtual void glRenderer::BeginQuads | ( | ) | [inline, virtual] |
Implements rRenderer.
Definition at line 145 of file rGLRender.cpp.
References BeginPrimitive().
00145 { 00146 BeginPrimitive(GL_QUADS); 00147 }
virtual void glRenderer::BeginLineStrip | ( | ) | [inline, virtual] |
Implements rRenderer.
Definition at line 149 of file rGLRender.cpp.
References BeginPrimitive().
00149 { 00150 BeginPrimitive(GL_LINE_STRIP, true); 00151 };
virtual void glRenderer::BeginLineLoop | ( | ) | [inline, virtual] |
Implements rRenderer.
Definition at line 153 of file rGLRender.cpp.
References BeginPrimitive().
00153 { 00154 BeginPrimitive(GL_LINE_LOOP, true); 00155 };
virtual void glRenderer::BeginTriangleStrip | ( | ) | [inline, virtual] |
Implements rRenderer.
Definition at line 157 of file rGLRender.cpp.
References BeginPrimitive().
00157 { 00158 BeginPrimitive(GL_TRIANGLE_STRIP, true); 00159 };
virtual void glRenderer::BeginQuadStrip | ( | ) | [inline, virtual] |
Implements rRenderer.
Definition at line 161 of file rGLRender.cpp.
References BeginPrimitive().
00161 { 00162 BeginPrimitive(GL_QUAD_STRIP, true); 00163 };
virtual void glRenderer::BeginTriangleFan | ( | ) | [inline, virtual] |
Implements rRenderer.
Definition at line 165 of file rGLRender.cpp.
References BeginPrimitive().
00165 { 00166 BeginPrimitive(GL_TRIANGLE_FAN, true); 00167 };
virtual void glRenderer::Line | ( | REAL | x1, | |
REAL | y1, | |||
REAL | z1, | |||
REAL | x2, | |||
REAL | y2, | |||
REAL | z2 | |||
) | [inline, virtual] |
Reimplemented from rRenderer.
Definition at line 169 of file rGLRender.cpp.
References BeginPrimitive(), and End().
00170 { 00171 BeginPrimitive(GL_LINES); 00172 glVertex3f(x1,y1,z1); 00173 glVertex3f(x2,y2,z2); 00174 End(); 00175 }
virtual void glRenderer::ProjMatrix | ( | ) | [inline, virtual] |
Implements rRenderer.
Definition at line 180 of file rGLRender.cpp.
References End(), and MatrixMode().
00180 { 00181 End(true); 00182 MatrixMode(GL_PROJECTION); 00183 };
virtual void glRenderer::ModelMatrix | ( | ) | [inline, virtual] |
Implements rRenderer.
Definition at line 185 of file rGLRender.cpp.
References End(), and MatrixMode().
00185 { 00186 End(true); 00187 MatrixMode(GL_MODELVIEW); 00188 };
virtual void glRenderer::TexMatrix | ( | ) | [inline, virtual] |
Implements rRenderer.
Definition at line 190 of file rGLRender.cpp.
References End(), and MatrixMode().
00190 { 00191 End(true); 00192 MatrixMode(GL_TEXTURE); 00193 };
virtual void glRenderer::PushMatrix | ( | ) | [inline, virtual] |
virtual void glRenderer::PopMatrix | ( | ) | [inline, virtual] |
Implements rRenderer.
Definition at line 199 of file rGLRender.cpp.
References End().
00199 { 00200 End(true); 00201 glPopMatrix(); 00202 };
virtual void glRenderer::MultMatrix | ( | REAL | mdata[4][4] | ) | [inline, virtual] |
Implements rRenderer.
Definition at line 204 of file rGLRender.cpp.
References End(), REAL, and tASSERT.
00204 { 00205 End(true); 00206 tASSERT(sizeof(REAL) == sizeof(GLfloat)); 00207 REAL * mdat=&mdata[0][0]; 00208 glMultMatrixf(reinterpret_cast<GLfloat *>(mdat)); 00209 };
virtual void glRenderer::IdentityMatrix | ( | ) | [inline, virtual] |
Implements rRenderer.
Definition at line 211 of file rGLRender.cpp.
References End().
00211 { 00212 End(true); 00213 glLoadIdentity(); 00214 };
virtual void glRenderer::ScaleMatrix | ( | REAL | f | ) | [inline, virtual] |
Implements rRenderer.
Definition at line 216 of file rGLRender.cpp.
References End().
00216 { 00217 End(true); 00218 glScalef(f,f,f); 00219 };
Implements rRenderer.
Definition at line 221 of file rGLRender.cpp.
References End().
00221 { 00222 End(true); 00223 glScalef(f1,f2,f2); 00224 };
Implements rRenderer.
Definition at line 226 of file rGLRender.cpp.
References End().
00226 { 00227 End(true); 00228 glTranslatef(x1,x2,x3); 00229 }
virtual void glRenderer::ReallySetFlag | ( | flag | f, | |
bool | c | |||
) | [inline, virtual] |
Implements rRenderer.
Definition at line 233 of file rGLRender.cpp.
References rRenderer::ALPHA_BLEND, and rRenderer::DEPTH_TEST.
00233 { 00234 GLenum fl = GL_DEPTH_TEST; 00235 switch (f) 00236 { 00237 case ALPHA_BLEND: 00238 fl = GL_BLEND; 00239 break; 00240 case DEPTH_TEST: 00241 fl = GL_DEPTH_TEST; 00242 break; 00243 default: 00244 break; 00245 } 00246 00247 if (c) 00248 glEnable(fl); 00249 else 00250 glDisable(fl); 00251 };
GLenum glRenderer::lastPrimitive [private] |
bool glRenderer::forceglEnd [private] |
GLenum glRenderer::lastMatrix [private] |