Jump to content

View more

Image of the Day

WIP title screen for #DeathOfAPartisan #screenshotsaturday #gamedev https://t.co/qJNhfZCvd4
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

DirectDraw Beginner: Help with smooth animations needed

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
1 reply to this topic

#1 andy   Members   

122
Like
Likes
Like

Posted 22 October 1999 - 05:14 AM

Hi,
I've just started learning DirectX, starting with DirectDraw.

I've got a ball bouncing round the screen.
If I set the screen res to 640x480 it's pretty smooth, but if I set it to 800x600 then it's very jerky. Then I tried 1024x768, the ball is now moving very smoothly?

Can anyone help me? I want it to be smooth for all screen res settings.

I don't do any timing, is this the problem? If so, is there some sample code?

Cheers
Andy


#2 Melo   Members   

122
Like
Likes
Like

Posted 22 October 1999 - 05:14 AM

Hi.

I think the best way looks like this:

code:

#include mmsystem.h

DWORD LastTime;

while (sth) // This is your loop
{
LastTime = timeGetTime ();

// Your code

while ((timeGetTime () - LastTime) < WAIT_TIME)
{
// You can put in sth useful here
// (like Wave-Streaming)
}



This code avoids the program to run too fast on better computers.
If you want your ball to move at a constant speed (independant to the framerate) it would be much more difficult

Well, that's the way I'm doing it and it works fine with my text-scroller...

[This message has been edited by Melo (edited October 22, 1999).]





Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.