I looked online to see if this issue was reported anywhere and didn't find anything. Apologies if I missed it.
I'm running into an issue where the resolution appears to be set incorrectly when using SFML in fullscreen mode with a duplicated monitor setup in Windows.
I'm on Windows 10. The issue doesn't happen in any version of Linux that I've tried. I don't know if it also happens in other versions of Windows, I don't have a machine to test anything other than Windows 10.
I'm using two 1920x1080 monitors. This is the test code
#include <SFML/Graphics.hpp>
int main(int argc, char* argv[])
{
//sf::RenderWindow window(sf::VideoMode(1920, 1080), "SFML window");
sf::RenderWindow window(sf::VideoMode::getFullscreenModes()[0], "SFML window", sf::Style::Fullscreen);
sf::CircleShape shape(100.f);
shape.setFillColor(sf::Color::Green);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
window.clear();
window.draw(shape);
window.display();
}
return 0;
}
If I log sf::VideoMode::getFullscreenModes()[0].width and sf::VideoMode::getFullscreenModes()[0].height, they're reporting 1920 and 1080, which are the correct values.
It was hard for me to take a screenshot showing the issue off, as when I take a screenshot, my monitor goes blank for a moment and some of the issues go away momentarily until after the screenshot. For instance, the mouse cursor is much larger than it should be ordinarily, and the circle is a lot more jaggy than the image shows.
Still though, I hope the following images show what I'm talking about. I'm alt tabbing because it shows the issue more readily.
This is what the program / my desktop looks like when running the above code in windowed mode (so the first window line uncommented with the second one commented).
This is what the program / my desktop looks like when running the above code in fullscreen mode. Although, again, it's worse than the image makes it out to be.