glRenderer Class Reference

Inheritance diagram for glRenderer:

Inheritance graph
[legend]
Collaboration diagram for glRenderer:

Collaboration graph
[legend]

List of all members.

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


Detailed Description

Definition at line 38 of file rGLRender.cpp.


Constructor & Destructor Documentation

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     };

Here is the call graph for this function:

virtual glRenderer::~glRenderer (  )  [inline, virtual]

Definition at line 78 of file rGLRender.cpp.

00078 {};


Member Function Documentation

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     }

Here is the call graph for this function:

Here is the caller graph for this function:

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     }

Here is the caller graph for this function:

virtual void glRenderer::Vertex ( REAL  x,
REAL  y 
) [inline, virtual]

Implements rRenderer.

Definition at line 80 of file rGLRender.cpp.

00080                                        {
00081         glVertex2f(x,y);
00082     };

virtual void glRenderer::Vertex ( REAL  x,
REAL  y,
REAL  z 
) [inline, virtual]

Implements rRenderer.

Definition at line 84 of file rGLRender.cpp.

00084                                                {
00085         glVertex3f(x,y,z);
00086     }

virtual void glRenderer::Vertex3 ( REAL x  )  [inline, virtual]

Implements rRenderer.

Definition at line 88 of file rGLRender.cpp.

00088                                  {
00089         glVertex3fv(x);
00090     }

virtual void glRenderer::Vertex ( REAL  x,
REAL  y,
REAL  z,
REAL  w 
) [inline, virtual]

Implements rRenderer.

Definition at line 92 of file rGLRender.cpp.

00092                                                        {
00093         glVertex4f(x,y,z,w);
00094     }

virtual void glRenderer::TexCoord ( REAL  u,
REAL  v 
) [inline, virtual]

Implements rRenderer.

Definition at line 96 of file rGLRender.cpp.

00096                                          {
00097         glTexCoord2f(u,v);
00098     }

virtual void glRenderer::TexCoord ( REAL  u,
REAL  v,
REAL  w 
) [inline, virtual]

Implements rRenderer.

Definition at line 100 of file rGLRender.cpp.

00100                                                  {
00101         glTexCoord3f(u,v,w);
00102     }

virtual void glRenderer::TexCoord ( REAL  u,
REAL  v,
REAL  w,
REAL  t 
) [inline, virtual]

Implements rRenderer.

Definition at line 104 of file rGLRender.cpp.

00104                                                          {
00105         glTexCoord4f(u,v,w,t);
00106     };

virtual void glRenderer::TexVertex ( REAL  x,
REAL  y,
REAL  z,
REAL  u,
REAL  v 
) [inline, virtual]

Reimplemented from rRenderer.

Definition at line 108 of file rGLRender.cpp.

00109                                           {
00110         glTexCoord2f(u,v);
00111         glVertex3f(x,y,z);
00112     }

virtual void glRenderer::Color ( REAL  r,
REAL  g,
REAL  b 
) [inline, virtual]

Implements rRenderer.

Definition at line 115 of file rGLRender.cpp.

00115                                               {
00116         glColor3f(r,g,b);
00117     };

virtual void glRenderer::Color ( REAL  r,
REAL  g,
REAL  b,
REAL  a 
) [inline, virtual]

Implements rRenderer.

Definition at line 119 of file rGLRender.cpp.

00119                                                      {
00120         glColor4f(r,g,b,a);
00121     };

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     }

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void glRenderer::BeginLines (  )  [inline, virtual]

Implements rRenderer.

Definition at line 137 of file rGLRender.cpp.

References BeginPrimitive().

00137                              {
00138         BeginPrimitive(GL_LINES);
00139     };

Here is the call graph for this function:

virtual void glRenderer::BeginTriangles (  )  [inline, virtual]

Implements rRenderer.

Definition at line 141 of file rGLRender.cpp.

References BeginPrimitive().

00141                                  {
00142         BeginPrimitive(GL_TRIANGLES);
00143     }

Here is the call graph for this function:

virtual void glRenderer::BeginQuads (  )  [inline, virtual]

Implements rRenderer.

Definition at line 145 of file rGLRender.cpp.

References BeginPrimitive().

00145                              {
00146         BeginPrimitive(GL_QUADS);
00147     }

Here is the call graph for this function:

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     };

Here is the call graph for this function:

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     };

Here is the call graph for this function:

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     };

Here is the call graph for this function:

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     };

Here is the call graph for this function:

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     };

Here is the call graph for this function:

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     }

Here is the call graph for this function:

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     };

Here is the call graph for this function:

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     };

Here is the call graph for this function:

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     };

Here is the call graph for this function:

virtual void glRenderer::PushMatrix (  )  [inline, virtual]

Implements rRenderer.

Definition at line 195 of file rGLRender.cpp.

00195                              {
00196         glPushMatrix();
00197     };

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     };

Here is the call graph for this function:

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     };

Here is the call graph for this function:

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     };

Here is the call graph for this function:

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     };

Here is the call graph for this function:

virtual void glRenderer::ScaleMatrix ( REAL  f1,
REAL  f2,
REAL  f3 
) [inline, virtual]

Implements rRenderer.

Definition at line 221 of file rGLRender.cpp.

References End().

00221                                                        {
00222         End(true);
00223         glScalef(f1,f2,f2);
00224     };

Here is the call graph for this function:

virtual void glRenderer::TranslateMatrix ( REAL  x1,
REAL  x2,
REAL  x3 
) [inline, virtual]

Implements rRenderer.

Definition at line 226 of file rGLRender.cpp.

References End().

00226                                                            {
00227         End(true);
00228         glTranslatef(x1,x2,x3);
00229     }

Here is the call graph for this function:

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     };


Member Data Documentation

GLenum glRenderer::lastPrimitive [private]

Definition at line 39 of file rGLRender.cpp.

Referenced by BeginPrimitive(), and End().

bool glRenderer::forceglEnd [private]

Definition at line 40 of file rGLRender.cpp.

Referenced by BeginPrimitive(), and End().

GLenum glRenderer::lastMatrix [private]

Definition at line 42 of file rGLRender.cpp.

Referenced by MatrixMode().


The documentation for this class was generated from the following file:
Generated on Sat Mar 15 23:40:06 2008 for Armagetron Advanced by  doxygen 1.5.4