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

Author Topic: When you move the window, the program stops.  (Read 1517 times)

0 Members and 1 Guest are viewing this topic.

EvgenyPin

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
When you move the window, the program stops.
« on: May 04, 2019, 05:57:56 am »
When you move the window, the program stops. How to make the program work normally when moving the window?

Hapax

  • Hero Member
  • *****
  • Posts: 3346
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: When you move the window, the program stops.
« Reply #1 on: May 04, 2019, 05:01:49 pm »
This is possible although not directly from within SFML.
You will need to be in control of the window directly, whether that be OS-specific or using a library and then apply SFML inside that window.
Using more advanced window controls, you can refresh the window when receiving messages from the operating system that the window has moved rather than waiting for the window to have finished moving or resizing.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

EvgenyPin

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Re: When you move the window, the program stops.
« Reply #2 on: May 04, 2019, 07:58:32 pm »
Can you elaborate on how to do this? Or where you can see how to do it?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10800
    • View Profile
    • development blog
    • Email
Re: When you move the window, the program stops.
« Reply #3 on: May 05, 2019, 06:37:45 pm »
You can handle the events in a separate thread, that way the event queue won't block the rendering.

Personally, I wouldn't really bother with "fixing" this and instead just make sure that once the rendering and logic update resumes, that you discard the long "frametime".
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/