SFML community forums
Help => Graphics => Topic started by: gajbooks on May 25, 2016, 03:42:43 am
-
So, I create a resizable window, and try and make a circle fit inside it. At first I tried to re-scale the circle manually in relation to the window size, but this resulted in some odd behavior. I soon discovered that the circle was already re-sizing itself? I had anticipated that a "re-sizable" window would mean the raw pixel area of the window would change and all user code would have to do the scaling, but the circle seems to scale with it already?
-
When you create a window you define a VideoMode with the number of pixels in width and number of pixels height.
The total number of pixels does not change if you re-size the Window. It would only change if you altered the VideoMode.
This is actually a good thing as it keeps your screen resolution constant for drawing purposes.
If you later want to program in order to support multiple resolutions, that's a different matter.
-
I can see how it would be good, but I found it really weird that the circle scaled in pixel count.
Is there any way I can change the video mode when the physical window resizes without the flickering of re-creating a window?
-
Maybe views (http://www.sfml-dev.org/tutorials/2.3/graphics-view.php) are what you're looking for.