Vector struktury - dodawanie elementów

0

Witam
W jaki sposób można dodawać elementy na koniec vectora, którego typem jest struktura?
Próbowałem w ten sposób, jednak nie odnosi on rezultatu - błąd podczas kompilacji.

struct SimpleVertex
{
    XMFLOAT3 Pos;
    XMFLOAT2 Tex;
};
	std::vector <SimpleVertex> Vertexy;
	WczObj (Vertexy);
void WczObj(SimpleVertex TVertex){
	for (short int KW = 0; KW < 10; KW++){

		TVertex.push_back (	XMFLOAT3( -1.0f, 1.0f, -1.0f ), XMFLOAT2( 0.0f, 1.0f ));

	}
}
1
struct SimpleVertex
  {
   XMFLOAT3 Pos;
   XMFLOAT2 Tex;
  };

void WczObj(std::vector <SimpleVertex> &V)
  {
   SimpleVertex s={{-1.0f, 1.0f, -1.0f},{0.0f, 1.0f}};
   for(int KW=0;KW<10;++KW) V.push_back(s);
  }

std::vector <SimpleVertex> Vertexy;
WczObj(Vertexy);
0

Bardzo dziękuję za pomoc.
Problem rozwiązany.

1 użytkowników online, w tym zalogowanych: 0, gości: 1