MCPcopy Create free account
hub / github.com/TankOs/SFGUI / RemovePrimitive

Method RemovePrimitive

src/SFGUI/Renderer.cpp:784–801  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

782}
783
784void Renderer::RemovePrimitive( Primitive::Ptr primitive ) {
785 std::vector<Primitive::Ptr>::iterator iter( std::find( m_primitives.begin(), m_primitives.end(), primitive ) );
786
787 if( iter != m_primitives.end() ) {
788 const std::vector<PrimitiveVertex>& vertices( (*iter)->GetVertices() );
789 const std::vector<unsigned int>& indices( (*iter)->GetIndices() );
790
791 assert( m_vertex_count >= static_cast<int>( vertices.size() ) );
792 assert( m_index_count >= static_cast<int>( indices.size() ) );
793
794 m_vertex_count -= static_cast<int>( vertices.size() );
795 m_index_count -= static_cast<int>( indices.size() );
796
797 m_primitives.erase( iter );
798 }
799
800 Invalidate( INVALIDATE_ALL );
801}
802
803void Renderer::Invalidate( unsigned char datasets ) {
804 InvalidateImpl( datasets );

Callers 1

~RenderQueueMethod · 0.80

Calls 2

endMethod · 0.80
sizeMethod · 0.80

Tested by

no test coverage detected