0

Hi there
I have made and run several different graphics programs and applications. The applications I have made so far always use the full processor and graphics card available. The game for instance may run at 5000fps or some really high number.

I am assuming this is not how games and graphics applications run in the real world.

how do specify what speed or resources to allocate to a specific task?

I have done things such as time based movement and looked at framelocking, but this still tends to use about 100% resources when its not truly required.

Thanks for the help and ideas

Edited by eskimo456: n/a

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by eskimo456
0

I guess the reason that framelocking would still consume 100% of the available processor cycles is the engine might only draw a frame after a defined time has passed, but still update as fast as possible in the background.

You could apply a similar methodology to the call to your update function. Say you wanted to update your scene at 120fps; inside your main game loop, check if 1/120.f seconds have passed since last update. If not, instruct your process to sleep for a short amount of time (1ms should be fine), then continue the loop. Implementation of this will vary depending on the system you are using.

0

Awesome that makes perfect sense thanks a lot I'll try implementing and see how much processor and GPU is used. Can't see the point of using 100% GPU for a 2D game.

Thanks

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.