Jump to content


Frame rate/render rate question


7 replies to this topic

#1 kop48

    New Member

  • Members
  • Pip
  • 5 posts

Posted 08 May 2005 - 06:43 AM

Hi,

I just found this forum while googling for DirectX information, so hi to all. :)

ok I have to do a project at uni and I though I'd post here instead of the beginner's area (because I AM a beginner at DX :)). Basically, I'm implementing this project:
http://www.itee.uq.e...roduct-1-05.htm
Basically, I'm using DirectX because we need to guarantee a certain rate of drawing and I don't think I can rely on Windows standard forms to do that for me. I need to flash the screen to a certain colour once per refresh rate. However, I don't think that Present(...) actually blocks until the refresh time has come. Since I've never used it before, someone could say for me to try it, but it's a little hard to see the screen changing colour at 75hz and be able to tell. :)

Therefore, I'm wondering if anyone would be able to help me on this matter. Right now, my idea is to simply change the clear colour and present nothing rendered. I need to make sure that I only change this colour once per refresh rate, so timers are out of the question as they do not have high enough resolutions. Any idea would be very welcome.

Cheers,

kop48

#2 bladder

    DevMaster Staff

  • Members
  • PipPipPipPip
  • 1057 posts

Posted 08 May 2005 - 07:18 AM

Set the presentation interval to "one" when you fill in the d3d presentation parameters structure. one tells d3d to only update the screen at the speed of the refresh rate.

#3 kop48

    New Member

  • Members
  • Pip
  • 5 posts

Posted 08 May 2005 - 10:12 AM

bladder said:

Set the presentation interval to "one" when you fill in the d3d presentation parameters structure. one tells d3d to only update the screen at the speed of the refresh rate.

View Post



Yup - I'd read that one, but does that mean DX also only allows you to draw to the back buffer once per screen refresh - effectively making Present a blocking call?

#4 bladder

    DevMaster Staff

  • Members
  • PipPipPipPip
  • 1057 posts

Posted 09 May 2005 - 12:25 AM

yes something like that. The different valuies represent how many times the backbuffer becomes the frontbuffer. INTERVAL_ONE means once per refresh. TWO means once every two refreshes. and IMMEDIATE means as fast as possible.

#5 kop48

    New Member

  • Members
  • Pip
  • 5 posts

Posted 09 May 2005 - 12:32 AM

bladder said:

yes something like that. The different valuies represent how many times the backbuffer becomes the frontbuffer. INTERVAL_ONE means once per refresh. TWO means once every two refreshes. and IMMEDIATE means as fast as possible.

View Post


ok, cheers mate, I'll give it a go. :)

#6 kop48

    New Member

  • Members
  • Pip
  • 5 posts

Posted 09 May 2005 - 01:06 AM

kop48 said:

bladder said:

yes something like that. The different valuies represent how many times the backbuffer becomes the frontbuffer. INTERVAL_ONE means once per refresh. TWO means once every two refreshes. and IMMEDIATE means as fast as possible.

View Post


ok, cheers mate, I'll give it a go. :)

View Post



Alright, looks like it works, but it seems to miss one frame every 30ish or so. I'm not sure why but I'm guessing it's because of another process using the processor for a second. I'll have to look into completely minimising my program so that it only does really essential stuff when rendering.

#7 ravuya

    Member

  • Members
  • PipPip
  • 70 posts

Posted 13 May 2005 - 03:28 PM

If you're not yielding your game to other processes on the machine, sometimes the Windows task scheduler can force it to pause for awhile to let other processes work.

#8 kop48

    New Member

  • Members
  • Pip
  • 5 posts

Posted 15 May 2005 - 02:43 AM

ravuya said:

If you're not yielding your game to other processes on the machine, sometimes the Windows task scheduler can force it to pause for awhile to let other processes work.

View Post

Yup - we've taken that into consideration and have an error check at the end of the transmition. I could also check tick counts between frames, but it's not really necessary. Seems to work great though! We've pretty much got 100% reliability! :)





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users