Hello,
while testing macOS 10.14 Beta I discovered a bug which appears in combination with SFML.
Under macOS 10.14 all positions and sizes in the window are wrong but under macOS 10.13 everything works as expected.
I have made some examples:
200x200 Window, 100 radius circle at 0,0
#include <SFML/Graphics.hpp>
int main() {
sf::RenderWindow wnd(sf::VideoMode(200, 200), "Test");
sf::CircleShape circle(100.0f);
circle.setFillColor(sf::Color::Green);
while(wnd.isOpen()) {
sf::Event evt{};
while(wnd.pollEvent(evt)) {
if(evt.type == sf::Event::Closed) {
wnd.close();
}
}
wnd.clear(sf::Color::Black);
wnd.draw(circle);
wnd.display();
}
return 0;
}
macOS 10.14:
macOS 10.13:
200x200 Window, 100 radius circle at 50,50
#include <SFML/Graphics.hpp>
int main() {
sf::RenderWindow wnd(sf::VideoMode(200, 200), "Test");
sf::CircleShape circle(100.0f);
circle.setFillColor(sf::Color::Green);
circle.setPosition(50, 50);
while(wnd.isOpen()) {
sf::Event evt{};
while(wnd.pollEvent(evt)) {
if(evt.type == sf::Event::Closed) {
wnd.close();
}
}
wnd.clear(sf::Color::Black);
wnd.draw(circle);
wnd.display();
}
return 0;
}
macOS 10.14:
macOS 10.13:
It looks like SFML use internally only 100x100 size while the window is 200x200, maybe the viewport is generated wrong.
All projects are generated with:
cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.13
generating with
cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.14
doesn't change anything (also tried other different versions).
SFML is installed from 2.5.0 source with:
cmake
make
sudo make install
Apple Clang Version is 10.0.0 (cland-1000.10.38)
Edit: Change the scaling of the display changes nothing