In order to scale my SFML Windows application, I'm trying to figure this, the program originally run with a (640, 480) dimensions by default.
My objective is execute the program in fullscreen mode and put the old window in the center and at this way conserv the original dimensions and features.
I'm initializing the main file application with the default SFML style 'Style::Fullscreen'.
RenderWindow(sf::VideoMode(), "app.exe", sf::Style::Fullscreen);
The blank parameter 'VideoMode()' don't make a default scale from sfml (not resize nothing), this avoid me a distorted program, but some functionalities aren't work as well, for example the View is altered and some the rest of images are distribuided on the window as be with the old dimensions, this is logical because my application get the view by this way.
sf::View worldview(RenderWindow.getDefaultView());
The main problem is that most of the main mechanisms of my application are only displayed distorted, such as sprites, font of the main menu, or simply the view is occupying half of the screen.
The view size should be the same as the fullscreen resolution so, as you wrote:
sf::View worldview(RenderWindow.getDefaultView());
should be fine.
However, the thing you want to be in the centre of that window is what was in the centre of the original window size. Therefore, you can just set the centre of the view to where the centre was before:
const sf::Vector2u originalSize{ 640u, 480u };
worldview.setCenter(sf::Vector2f(originalSize / 2u));
Note that this means that the view's range will have negative values.
For example, on a 1920x1080 display:
The view's size is, of course: 1920x1080.
The view's center is (now obviously): (320, 240).
The (0, 0) - (640, 480) co-ordinate range is in the centre.
The top-left corner of that view (top-left of the screen) will be: (-640, -300).
The bottom-right corner of the view/screen will be: (1280, 780).