1
Graphics / Problem with VertexArray
« on: November 24, 2016, 07:45:35 pm »
Hello,
I want to draw rhombus with sf::VertexArray class
but result shape is interrupted in the bottom. How can I solve this problem?
I want to draw rhombus with sf::VertexArray class
sf::VertexArray polygonImage2;
polygonImage2.clear();
polygonImage2.setPrimitiveType (sf::LinesStrip);
polygonImage2.resize (5);
float c = 1.0f;
polygonImage2[0] = {sf::Vector2f {62.5f * c, 55.0f * c}, sf::Color::Black};
polygonImage2[1] = {sf::Vector2f {70.0f * c, 62.5f * c}, sf::Color::Black};
polygonImage2[2] = {sf::Vector2f {62.5f * c, 70.0f * c}, sf::Color::Black};
polygonImage2[3] = {sf::Vector2f {55.0f * c, 62.5f * c}, sf::Color::Black};
polygonImage2[4] = {sf::Vector2f {62.5f * c, 55.0f * c}, sf::Color::Black};
theWindow.draw (polygonImage2);
polygonImage2.clear();
polygonImage2.setPrimitiveType (sf::LinesStrip);
polygonImage2.resize (5);
float c = 1.0f;
polygonImage2[0] = {sf::Vector2f {62.5f * c, 55.0f * c}, sf::Color::Black};
polygonImage2[1] = {sf::Vector2f {70.0f * c, 62.5f * c}, sf::Color::Black};
polygonImage2[2] = {sf::Vector2f {62.5f * c, 70.0f * c}, sf::Color::Black};
polygonImage2[3] = {sf::Vector2f {55.0f * c, 62.5f * c}, sf::Color::Black};
polygonImage2[4] = {sf::Vector2f {62.5f * c, 55.0f * c}, sf::Color::Black};
theWindow.draw (polygonImage2);
but result shape is interrupted in the bottom. How can I solve this problem?