Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


DirectDraw Beginner: Help with smooth animations needed


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   -  Reputation: 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


Sponsor:

#2 Melo   Members   -  Reputation: 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.



PARTNERS