Archived

This topic is now archived and is closed to further replies.

Better performance?

This topic is 5403 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi! Anyone have an idea of why I have so bad performance in my games? I recently installed Windows XP, and a simple 2D game I''ve developed is really slow! I guess this has something to do with my graphics card''s drivers for XP. My game is fast in Windows 2000! However the "Sprite anitamte" example in DXSDK 8.1 runns fast, it''s using the timeGetTime() function to control the loop, 24-bit images for the sprites, the ddutil and dxutilclasses just as I do in my game. But why is my game so slow? What can I do to increase performance? And why is my game slower on my machine under XP and not 2000? Games like Unreal Tournament and Worms are fast, whats their secret? I control the game like this: //Get the time DWORD dwStart = timeGetTime(); //Run game loop MainLoop(); //Lock to 50 FPS (20ms per frame) while ((timeGetTime() - dwStart) < 20); Regards, Mattias

Share this post


Link to post
Share on other sites
first off, instead of looping for 20ms.. put everything in an if statement... sorta like the code below. other than that, from the code you posted, it has to be drivers (since you said it runs fine on other systems) or your timeGetTime() is wrong (but that doesn't seem likely).



        
// sets up dwStart once when it's declared to timeGetTime();

static DWORD dwStart=timeGetTime();
// test to see if 20ms has been passed

if ((timeGetTime() - dwStart) < 20) {
// game stuff

MainLoop();
// set time to current time again.

dwStart=timeGetTime();
}



heh sorry, i hate to see wasted cycles is all. g'luck

[edited by - sporff on March 2, 2003 8:28:28 PM]

Share this post


Link to post
Share on other sites