githole / Live-Coder

Live Coder is a realtime GLSL editor/viewer mainly for demosceners.
http://kagamin.net/hole/lc/index.htm
135 stars 16 forks source link

Add Option to Limit FPS #5

Closed personalcomputer closed 7 years ago

personalcomputer commented 7 years ago

Hi hole! Thanks for publishing this software.

One issue with it is by default it uses up 100% of CPU/GPU to render frames as fast as possible. This hogs resources from other software and can cause GPUs to unnecessarily spin up their cooling fans all the way. I want to fix that.

My pull request adds the option to specify --fps= on the command line to limit FPS to something more reasonable, such as a max of 60 frames per second with --fps=60. This fixes the excessive CPU/GPU use, and at 60 FPS there is no impact on how rapidly the software responds for most people as their monitors are naturally limited to 60fps (60 hertz). By default the option is disabled so the software can behave the same as it did before. It also still correctly parses the width/height and fullscreen options in combination with the fps option.

Please let me know if you have any questions!

Thanks

githole commented 7 years ago

Thank you for your commit :)