Minimal reproducible example:
static auto WHITE_COL = sf::Color{255, 255, 255, 255};
static sf::Vertex myQuads[] = {
sf::Vertex{sf::Vector2f{100.f, 100.f}, WHITE_COL },
sf::Vertex{sf::Vector2f{200.f, 100.f}, WHITE_COL },
sf::Vertex{sf::Vector2f{200.f, 200.f}, WHITE_COL },
sf::Vertex{sf::Vector2f{100.f, 200.f}, WHITE_COL },
};
aWindow.draw(myQuads, 4, sf::Quads);
static auto BLACK_COL = sf::Color{0, 0, 0, 255};
static sf::Vertex myLines[] = {
sf::Vertex{sf::Vector2f{110.f, 150.f}, BLACK_COL},
sf::Vertex{sf::Vector2f{190.f, 150.f}, BLACK_COL},
};
aWindow.draw(myLines, 2, sf::Lines);
This results in a gray line with RGB (99,99,99)
Oddly, adding another line 1 pixel below will resolve the issue, and the now "thickness 2" line is now black. Further, a rectangle will also be of a black colour. I'd prefer to be using a line here though.
I also tried adding sf::BlendNone , this does not help and results in the same outcome.
What is going on here?
Thanks