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

Author Topic: Window Resizing  (Read 2780 times)

0 Members and 1 Guest are viewing this topic.

Cyrana

  • Newbie
  • *
  • Posts: 21
    • View Profile
Window Resizing
« on: December 19, 2016, 11:22:03 am »
Hello dear forum : )

I just found out, that the window does not update during resize.
So I did some research and this seems to be because SFML goes into an infinite loop.
Hence there is no solution to this.

But is there really nothing to do? I heard using another thread would be a solution, but that sounds like an extreme solution.

How much change would SFML need to go through to make this behaviour work as expected (screen shows what actually should be shown when resizing)?
Is switching the event-polling to maybe an observer-pattern a solution?
Anything that could be done? Even if it ends up in editing SFML.

I really would not want to switch my libraries just because of this, as I pretty much love SFML! : )

Thanks for taking your time reading my thread, have a great week!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Window Resizing
« Reply #1 on: December 19, 2016, 11:32:29 am »
Yes, the only solution would be to radically change the way SFML is designed, and use callbacks for events (and add one for "repaint") instead of a polling loop. So we'll obviously not go this way ;)

The thread workaround is not as extreme as it looks. You just have to move your event loop to another thread.
Laurent Gomila - SFML developer

Cyrana

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Window Resizing
« Reply #2 on: December 19, 2016, 11:48:33 am »
Ah! I can totally understand that : )

Hm, well having it on another thread would require it to be on the same as the window, right?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Window Resizing
« Reply #3 on: December 19, 2016, 12:44:19 pm »
Laurent Gomila - SFML developer