Page 2 of 2
Posted: Mon May 23, 2005 2:43 pm
by THCM
Thanx for the help!
Very weird! I get a few beeps per second, but when I run my game on a windowed screen I get only 4-6% processor usage...
A delay of 1 or 2 works, but anything higher than 10 gives me massive slowdowns....
SetFrameRate() uses exactly the same value as EnumDisplaySettings_() command gives: 60.
This is driving me nuts! I want my Amiga back... and one refreshrate for all people on this planet!
So for now I'll stick to the original FlipBuffers().
Posted: Tue May 24, 2005 11:13 pm
by va!n
why are you using delay() in a loop? i think its the badest think a coder can do, isnt it? if you set delay(2) for example the game may run smooth on your machine but on a slower machine this may happen that your game may run slower...
And i dont like to limit the fps of a game! As i said before... on slower machines the game may run slower due fact of setting the fps the game should run! I even dislike this way, because when i buy a very expensive and powerfull gfxcard, i want fell the power of this and getting a nice fps instead just only 25 or 50 or 60 fps for example!
Posted: Wed May 25, 2005 12:32 am
by Pantcho!!
I dont understand what is you are all talking but i understood that you are saying that the graphics in PB uses loads of cpu resources
and va!n is right it might go slow on fast computers if you put on delay
my recommand: do a user lib that dedects cpu speed+ graphics card and put on a appropiate delay.
good day!
Posted: Wed May 25, 2005 9:14 am
by Psychophanta
va!n wrote:why are you using delay() in a loop? i think its the badest think a coder can do, isnt it? if you set delay(2) for example the game may run smooth on your machine but on a slower machine this may happen that your game may run slower...
And i dont like to limit the fps of a game! As i said before... on slower machines the game may run slower due fact of setting the fps the game should run! I even dislike this way, because when i buy a very expensive and powerfull gfxcard, i want fell the power of this and getting a nice fps instead just only 25 or 50 or 60 fps for example!
Well, i suppose you are talking about adding a static value for Delay() after Flipbuffers(), then yes, you are right in what you say.
But the myFlipBuffers routine just delays a dynamic value which, for each frame, will depend on the surplus rendering time, so it shouldn't to slow down a slower machine.
Pantcho!! wrote:my recommand: do a user lib that dedects cpu speed+ graphics card and put on a appropiate delay.
Yes, that is a not bad idea. To use a static parameter for a Delay() function after FlipBuffers() which depends on machine speed

Posted: Wed May 25, 2005 11:28 am
by THCM
@va!n 2D Games don't need more than 60fps and I don't want to use subpixel precision with a simple 2D Game!
@Psychophanta I get diffrent results using your approach! On my notebook your routine works great! But on my desktop PC movement is still jerky as mentioned above!
@Fred Perhaps you can add an optional parameter to FlipBuffers() which gives cpu back to the system until vsync was reached.
Posted: Wed May 25, 2005 2:00 pm
by Psychophanta
THCM wrote:@Psychophanta I get diffrent results using your approach! On my notebook your routine works great! But on my desktop PC movement is still jerky as mentioned above!
Dunno! but i guees it could be due to the different accuracy of hardware ticks
THCM wrote:@Fred Perhaps you can add an optional parameter to FlipBuffers() which gives cpu back to the system until vsync was reached.
Ohhh! it seems to be not so easy to do it well done.
Take a look at here:
viewtopic.php?t=12747
http://www.codeproject.com/gdi/tearingfreedrawing.asp