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

Author Topic: Automatic Graphics Switching  (Read 3316 times)

0 Members and 1 Guest are viewing this topic.

ghost231

  • Newbie
  • *
  • Posts: 1
    • View Profile
Automatic Graphics Switching
« on: October 11, 2020, 10:43:27 am »
I have a 2019 Mac book Pro with an Intel Integrated GPU and a dedicated AMD GPU. MacOS has a feature called Automatic Graphics Switching which switches between GPUs to save power.

If I create an SFML Window with Automatic Graphics Switching turned on, the screen hitches for about half a second and sometimes flashes black before the window is displayed. It also closes very slowly. There are no problems while it is running, but opening and closing causes the entire system and background applications to lag for a second. In addition, window.setMouseCursorVisible(false) does not work when the feature is turned on. Turning off Automatic Graphics Switching fixes the problem.

Can you manually set which GPU the windows uses, or is there some other workaround to not have to manually turn off the feature in Settings?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Automatic Graphics Switching
« Reply #1 on: October 14, 2020, 10:57:46 am »
There's the GpuPreference #define that is used to encourage the system to use the discrete graphics card, as one usually wants, due to better graphics support, but I'm not even sure if this has an effect on macOS...
Other than that, I'm not sure if there's even a way to define the mode, as this seems mostly defined from the OS itself.
You could try and use something like gSwitch to better handle the enabling/disabling of the discrete graphics card.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything