If I design a game to run at 1280x720 but someone tries to start the game on a lower resolution screen, SFML's behavior is undesirable. It will open up a window as big as it can (up to the desired resolution), but doesn't preserve aspect ratio. Is there any way to center the scene in SFML, with black bars on the top and bottom (or left and right, in the case of 4:3 resolutions on a 16:9 screen)?
I tried playing with SetView and sf::View objects, and that kind of works. The game can still draw outside of the "screen," but that could be fixed by drawing black rects over the portions that are supposed to stay black. And in windowed mode, you can just set the height of the window to what it should be for the width it gave you.
Of course this wouldn't be ideal. Scaling down never looks good, but at least it'll work and not be unnaturally stretched.
I was mostly just wondering if there is any supported way to do this, or if anyone has any code that already does this that they'd like to share?