Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: I'm missing something about resizable windows  (Read 1647 times)

0 Members and 1 Guest are viewing this topic.

gajbooks

  • Newbie
  • *
  • Posts: 2
    • View Profile
I'm missing something about resizable windows
« 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?

Erdrick

  • Jr. Member
  • **
  • Posts: 61
    • View Profile
    • Email
Re: I'm missing something about resizable windows
« Reply #1 on: May 25, 2016, 03:52:56 am »
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.




gajbooks

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: I'm missing something about resizable windows
« Reply #2 on: May 25, 2016, 05:36:45 am »
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?
« Last Edit: May 25, 2016, 05:46:00 am by gajbooks »

fallahn

  • Sr. Member
  • ****
  • Posts: 492
  • Buns.
    • View Profile
    • Trederia
Re: I'm missing something about resizable windows
« Reply #3 on: May 25, 2016, 10:36:54 am »
Maybe views are what you're looking for.

 

anything