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

Method AddVertex

src/SFGUI/Primitive.cpp:35–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35void Primitive::AddVertex( const PrimitiveVertex& vertex ) {
36 m_synced = false;
37
38 auto vertice_count = m_vertices.size();
39
40 // Skip the duplicate search if this vertex is part of the first triangle.
41 if( vertice_count >= 3 ) {
42 for( std::size_t index = 0; index < vertice_count; ++index ) {
43 if( m_vertices[index] == vertex ) {
44 // Vertex already part of this primitive. Index it.
45 m_indices.push_back( static_cast<unsigned int>( index ) );
46
47 return;
48 }
49 }
50 }
51
52 m_indices.push_back( static_cast<unsigned int>( vertice_count ) );
53 m_vertices.push_back( vertex );
54}
55
56void Primitive::AddTexture( PrimitiveTexture::Ptr texture ) {
57 m_textures.push_back( texture );

Callers 5

CreateTextMethod · 0.80
CreateQuadMethod · 0.80
CreatePaneMethod · 0.80
CreateTriangleMethod · 0.80
CreateSpriteMethod · 0.80

Calls 1

sizeMethod · 0.80

Tested by

no test coverage detected