| 766 | } |
| 767 | |
| 768 | void Renderer::AddPrimitive( Primitive::Ptr primitive ) { |
| 769 | m_primitives.push_back( primitive ); |
| 770 | |
| 771 | // Check for alpha values in primitive. |
| 772 | // Disable depth test if any found. |
| 773 | const std::vector<PrimitiveVertex>& vertices( primitive->GetVertices() ); |
| 774 | const std::vector<unsigned int>& indices( primitive->GetIndices() ); |
| 775 | |
| 776 | m_vertex_count += static_cast<int>( vertices.size() ); |
| 777 | m_index_count += static_cast<int>( indices.size() ); |
| 778 | |
| 779 | m_primitives_sorted = false; |
| 780 | |
| 781 | Invalidate( INVALIDATE_ALL ); |
| 782 | } |
| 783 | |
| 784 | void Renderer::RemovePrimitive( Primitive::Ptr primitive ) { |
| 785 | std::vector<Primitive::Ptr>::iterator iter( std::find( m_primitives.begin(), m_primitives.end(), primitive ) ); |