コード例 #1
0
void GraphicsObjectManager::privDrawObjectsTreeDepthFirst( PCSNode *node ) const
{
   PCSNode *child = 0;

   GraphicsObject *go = (GraphicsObject *)node;

   // Transform and draw graphics object
	go->transform();
	go->setRenderState();
	go->draw();

   // iterate through all of the active children 
   if (node->getChild() != 0)
	{  
	   child =	node->getChild();
	   // make sure that allocation is not a child node 
	   while (child != 0)
	   {
         privDrawObjectsTreeDepthFirst( child );
         // goto next sibling
         child = child->getSibling();
	   }
   }
   else
	{
      // bye bye exit condition
	}

}
コード例 #2
0
void GraphicsObjectManager::drawObjectsList()
{
	// Walk the graphics object list
	std::list<GraphicsObject *>::iterator it;
	for ( it=goList.begin(); it != goList.end(); it++ )
	{
		// local pointer
		GraphicsObject *go = *it;

		// Transform and draw graphics object
		go->transform();
		go->setRenderState();
		go->draw();
	}
}