SFML community forums

Help => Graphics => Topic started by: Macecraft on June 13, 2017, 09:53:16 pm

Title: Laptop Graphics Cards
Post by: Macecraft on June 13, 2017, 09:53:16 pm
Hi!

I've been using SFML 2.4.2 with Visual Studio 2015 to create a computer game. The game works fine but I'm just having an issue. I develop on a laptop with a gaming gfx card (960M) and an integrated desktop card (Intel HD Graphics 530).

When I'm running the game through Visual Studio it doesn't alternate to my dedicated graphics card like other computer games do. I have to run the game externally and select use the Nvidia card. The Intel card causes a game FPS drop below the 60 that it is capable of achieving on dedicated cards. Is there anything specific I need to do to get it to always run with the Nvidia card.

I have profiled the game numerous times and I'm 100% sure the reason I'm not achieving 60 is that the card it's being run on is the Intel. Once I switch to the dedicated card I get the performance I desire.
Title: Re: Laptop Graphics Cards
Post by: Macecraft on June 13, 2017, 10:35:35 pm
Nevermind, I found a solution online through stackoverflow!

Sent from my SM-G920F using Tapatalk

Title: Re: Laptop Graphics Cards
Post by: eXpl0it3r on June 13, 2017, 10:53:59 pm
Can you provide a link to said solution, so others could maybe find it as well in the future?

Btw. if you link sfml-main, SFML should use your dedicated GPU.
Title: Re: Laptop Graphics Cards
Post by: Macecraft on June 14, 2017, 12:28:21 am
Can you provide a link to said solution, so others could maybe find it as well in the future?

Btw. if you link sfml-main, SFML should use your dedicated GPU.

Sure thing! The link I found which solved my problem is:
https://stackoverflow.com/questions/10535950/forcing-nvidia-gpu-programmatically-in-optimus-laptops (https://stackoverflow.com/questions/10535950/forcing-nvidia-gpu-programmatically-in-optimus-laptops)

And I did link sfml-main, it has worked on previous versions of SFML 2.0 but for some reason, on this project specifically, I've had this issue. Previous SFML projects of mine have never had this issue. I'll probably investigate further when I have the time and update my post with the cause of my problem incase anyone else gets the issue in future.

--

Update: I tell a lie, it seems I had linked sfml-main on my previous projects but had neglected to do so on this one! Thanks for the helpful tip!