|
-
Apr 28th, 2013, 01:54 PM
#5
Thread Starter
PowerPoster
Re: i need some advices that i can't find easly:(
 Originally Posted by Jacob Roman
I wasn't mad, I was just saying you are correct.
When it comes to making games, using the Do Loop or While loop will unfortunately lead to very high CPU usage. You can see this in majority of your major games for your PC. If you run them, you will see a lot of CPU usage being used. This is expected as the games are taking advantage of every aspect of your computer such as the video card, all the 3D graphics, the physics, the sound, and all the calculations that need done, etc etc. However the only way you can really really control your CPU usage is through C++ using various multithreading techniques. However its not really worth the hassle because A) Major games use a lot of CPU anyways, and B) A program using a lot of CPU isn't gonna affect your computer too much. Just as long as thats the only major game running. Otherwise you'll notice maybe a little lag. Noone really runs two major games at the same time anyways.
Now to answer your next question, theres 2 ways you can go about this. One is to use DirectX. DirectX handles the framerate for you automatically and goes with the monitors refresh rate. The other way I showed you using VB6 but can be converted to C++, and thats to lock the framerate at 60 frames per second. The function I created you can lock the framerate at any rate you want. But since most monitors run at 60 Hz. you should stick with 60 FPS.
can i test if any key was pressed by using GetAsyncKeyState()?
i build a nice function for these, but i get unpested results
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|