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

Author Topic: CPU usage 100% help  (Read 1548 times)

0 Members and 1 Guest are viewing this topic.

smilesprower

  • Newbie
  • *
  • Posts: 25
    • View Profile
    • Email
CPU usage 100% help
« on: June 03, 2017, 05:24:02 pm »
Quick question
Why is my cpu usage at 100% when I enable vsync ?
If I used window.setFramerateLimit(60) this is not the case and the cpu usage is relatively low

My graphics card is a nvidia gtx970.
Thanks

Code: [Select]
int main()
{
sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
window.setVerticalSyncEnabled(true);

while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event)){
if (event.type == sf::Event::Closed)
window.close();
}
window.clear();
window.display();
}
return 0;
}

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: CPU usage 100% help
« Reply #1 on: June 03, 2017, 09:47:18 pm »
Check your GPU driver settings, some allow to globally set it to on or off.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

smilesprower

  • Newbie
  • *
  • Posts: 25
    • View Profile
    • Email
Re: CPU usage 100% help
« Reply #2 on: June 04, 2017, 03:07:48 pm »
The frames are still locked to 60 its just using 100% cpu time.

 

anything