Original Post
Hi,
I have a little problem with my program. It's a simple opengl application but it uses too many resources. Whenever I start it my processor fan gets very loud after a few seconds and I don't understand why. I think the problem is connected to my main loop. It is an indefinite while loop so it makes sense to me that my computer should be working at all times. However there must be something that other games do differently, because I don't hear my processor fan while playing them. Can someone tell me what that might be?
My best guess is that I'm doing too much during each execution of the while loop. I have a list of objects which are simulated by box2d and update their position and rotation at every iteration of the loop. Should I rather update them only after certain timesteps? But if this is true I still don't understand why because then each iteration would finish faster but there would also be more iteration so my computer should still be working all the time and thus use the same amount of resources, right? I hope someone can explain this to me.
I have a little problem with my program. It's a simple opengl application but it uses too many resources. Whenever I start it my processor fan gets very loud after a few seconds and I don't understand why. I think the problem is connected to my main loop. It is an indefinite while loop so it makes sense to me that my computer should be working at all times. However there must be something that other games do differently, because I don't hear my processor fan while playing them. Can someone tell me what that might be?
My best guess is that I'm doing too much during each execution of the while loop. I have a list of objects which are simulated by box2d and update their position and rotation at every iteration of the loop. Should I rather update them only after certain timesteps? But if this is true I still don't understand why because then each iteration would finish faster but there would also be more iteration so my computer should still be working all the time and thus use the same amount of resources, right? I hope someone can explain this to me.