Yes, i was already thinking about something like that, or change the FOV (field of view of game) to mantain the proper ratio in any resolution.
I partially solved the problem, i just set window(sf::Style::Fullscreen) (sorry for not checking this before) and it goes fullscreen, changing the desktop resolution to 320x200, with letterbox and original aspect ration, and most important keeping the original windowed CPU usage, that's great!!
But there is another little problem, in this way the image is blurry, i dont't know if is a SFML problem or maybe Microsoft Windows. What i want is a pixeled image, like the one on the RIGHT:
(https://i.imgur.com/gdftVXb.png)
If i'm not clear please ask me!
How are your stretching from one window to another? Copying each pixel manually? :o
The render texture technique is similar to what you seem to be doing.
Create a window. This can be any size but full screen and native resolution would be fine.
Create a render texture (https://www.sfml-dev.org/documentation/2.5.1/classsf_1_1RenderTexture.php); this is very similar to a window but doesn't show anywhere. This allows you to draw to it without it actually been drawn to a window. The render texture should be 320x200 in your case.
Since you can use the texture of a render texture as a standard texture, you can create a sprite (https://www.sfml-dev.org/tutorials/2.5/graphics-sprite.php) with that texture and draw that to the main window, scaled however you like.
Without scaling, the sprite would appear as 320x200 since this is the size of the original (render) texture. You can set the sprite's scale so that one edge reaches the window edge or just a static value, like three.
It might look something like this:
sf::RenderTexture renderTexture;
renderTexture.create(320, 200);
sf::Window window(sf::VideMode::getDefaultMode(), "", sf::Style::Fullscreen);
// prepare render sprite to draw the render texture
sf::Sprite renderSprite(renderTexture.getTexture());
renderSprite.setScale({ 3.f, 3.f }); // scale it x3
// position the render sprite in the center of the window
renderSprite.setOrigin(sf::Vector2f(renderSprite.getTexture()->getSize() / 2u));
renderSprite.setPosition(window.getView().getCenter());
while (window.isOpen())
{
// process events
// do updates
// draw your stuff to the render texture (320x200)
renderTexture.clear();
renderTexture.draw(yourStuff);
renderTexture.display();
// draw the render sprite to the window
window.clear();
window.draw(renderSprite);
window.display();
}