I'm trying to draw about a hundred lines on the screen. So far I'm testing my code with adding only two vertices to a vector but the code won't compile because of
error: expected primary-expression before ']' token vertices.push_back(line[]);
I'm not really experienced in C++ and any help would be greatly appreciated.
Here's my code so far.
std::vector <sf::Vertex> vertices;
sf::Vertex line[] =
{
sf::Vertex(sf::Vector2f(1, 0), sf::Color::Red),
sf::Vertex(sf::Vector2f(1, 150), sf::Color::Green),
};
sf::Vertex line2[] =
{
sf::Vertex(sf::Vector2f(3, 0), sf::Color::Red),
sf::Vertex(sf::Vector2f(3, 150), sf::Color::Green)
};
vertices.push_back(line[]);
vertices.push_back(line2[]);