The code is off the tutorial on the SFML site. When I compile and run it the circle scales proportionally as the window is scaled by the user. I want the circle to stay a constant shape.
When the screen is re-sized, both the correct screen dimensions and the correct circle radius are printed to the console, but the way the circle is drawn to the screen is definitely not what it claims to be. The circle is not visually distorted in any way, but looks as though it is being drawn with a different set of values as to what is printed to the console.
The antialiasingLevel
makes no difference to the shape dawn, if that helps.
#include <iostream>
#include <SFML/Graphics.hpp>
int main()
{
sf::ContextSettings settings;
settings.antialiasingLevel = 8;
sf::RenderWindow window(sf::VideoMode(200, 200), "Title", sf::Style::Default, settings);
sf::CircleShape shape(100);
shape.setFillColor(sf::Color::Green);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
else if (event.type == sf::Event::Resized)
{
std::cout << "resize: (" << event.size.width << ',' << event.size.height << ") -> " << shape.getRadius() << std::endl;
}
}
window.clear();
window.draw(shape);
window.display();
}
return 0;
}