Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

Renderer::PointStarVertexBuffer Class Reference

#include <render.h>

Collaboration diagram for Renderer::PointStarVertexBuffer:

Collaboration graph
List of all members.

Public Member Functions

void addStar (const Point3f &f, const Color &, float)
void finish ()
 PointStarVertexBuffer (unsigned int _capacity)
void render ()
void start (const GLContext &)
 ~PointStarVertexBuffer ()

Private Attributes

unsigned int capacity
const GLContextcontext
unsigned int nStars
StarVertexvertices

Classes

struct  StarVertex

Constructor & Destructor Documentation

Renderer::PointStarVertexBuffer::PointStarVertexBuffer unsigned int  _capacity  ) 
 

Renderer::PointStarVertexBuffer::~PointStarVertexBuffer  ) 
 


Member Function Documentation

void Renderer::PointStarVertexBuffer::addStar const Point3f f,
const Color ,
float 
 

Definition at line 7358 of file render.cpp.

References capacity, nStars, Renderer::PointStarVertexBuffer::StarVertex::position, render(), Renderer::PointStarVertexBuffer::StarVertex::size, and vertices.

07361 {
07362     if (nStars < capacity)
07363     {
07364         vertices[nStars].position = pos;
07365         vertices[nStars].size = size;
07366         color.get(vertices[nStars].color);
07367         nStars++;
07368     }
07369 
07370     if (nStars == capacity)
07371     {
07372         render();
07373         nStars = 0;
07374     }
07375 }

void Renderer::PointStarVertexBuffer::finish  ) 
 

Definition at line 7348 of file render.cpp.

References context, VertexProcessor::disableAttribArray(), GLContext::getVertexProcessor(), and render().

07349 {
07350     render();
07351     glDisableClientState(GL_COLOR_ARRAY);
07352     glDisableClientState(GL_VERTEX_ARRAY);
07353     glDisableClientState(GL_TEXTURE_COORD_ARRAY);
07354     context->getVertexProcessor()->disableAttribArray(6);
07355     //glEnable(GL_TEXTURE_2D);
07356 }

void Renderer::PointStarVertexBuffer::render  ) 
 

Definition at line 7339 of file render.cpp.

References nStars.

Referenced by addStar(), and finish().

07340 {
07341     if (nStars != 0)
07342     {
07343         glDrawArrays(GL_POINTS, 0, nStars);
07344         nStars = 0;
07345     }
07346 }

void Renderer::PointStarVertexBuffer::start const GLContext  ) 
 


Member Data Documentation

unsigned int Renderer::PointStarVertexBuffer::capacity [private]
 

Definition at line 262 of file render.h.

Referenced by addStar().

const GLContext* Renderer::PointStarVertexBuffer::context [private]
 

Definition at line 265 of file render.h.

Referenced by finish().

unsigned int Renderer::PointStarVertexBuffer::nStars [private]
 

Definition at line 263 of file render.h.

Referenced by addStar(), and render().

StarVertex* Renderer::PointStarVertexBuffer::vertices [private]
 

Definition at line 264 of file render.h.

Referenced by addStar().


The documentation for this class was generated from the following files:
Generated on Sat Jan 14 22:33:33 2006 for Celestia by  doxygen 1.4.1