NewayPix / hazard-memory

An experimental SDL2 Game Engine written in C++
MIT License
0 stars 0 forks source link

Add fps_lock method to GameLoop and public attr fps_target #28

Closed ryukinix closed 3 years ago

ryukinix commented 3 years ago

Closes #26

Set fps_target for all examples

Now the CPU consumption is very low! My CPU temp is not burning anymore.

wesleycsj commented 3 years ago

Ok, the functionality seems work well. The only thing, less important, is the name of the variable, i don't think which fps_target is a good name for variable, and doesn't better to it be setted in something like a set method? Like this, "game.set_max_frame_rate(60);" ?

ryukinix commented 3 years ago

Ok, the functionality seems work well. The only thing, less important, is the name of the variable, i don't think which fps_target is a good name for variable, and doesn't better to it be setted in something like a set method? Like this, "game.setMaxFramerate(60);" ?

Good suggestion, fps target is a common term used in various context, but of course we can change it. I think providing the method set_max_frame_rate(int) would be enough in that case.

wesleycsj commented 3 years ago

Ok. Don't forget to update all examples after in the same commit.