[…]
wait_vbl() will only fall back on FB_WaitVBL() if the framebuffer isn’t
Matrox, Riva, or 3DFx based. And even if you have an unsupported
HW-accelerated framebuffer and wait_vbl() is a nop - so what? That
doesn’t necessarily mean you can’t get smooth animation.
Right - provided the video card does retrace sync’ed page flips (pretty
much guaranteed if it does h/w page flipping at all) and there is a way
to keep applications in sync with the refresh rate. (That is not
necessarily in sync with the retrace - very important difference!)
Really smooth animation requires exactly one frame per refresh, and
without an RTOS, the only way to get that is using triple buffering (or
using just a fraction of the frame duration for rendering…) and some
method of synchronizing with the refresh rate, so you don’t drop any
video or game frames.
Get out of the DOS mode of thinking.
I have to agree there - but only to the point of not synchronizing the
application with every retrace, like most games did back then.
Vertical retrace is definitely a good thing
to have, but it isn’t guaranteed on every platform.
Or; every platform isn’t capable of producing high quality animation. We
can either deal with it, or try to fix it.
So in your opinion, if there is no way to sync to the vertical
retrace how can smooth animation be achieved? I open to any and all
suggestions.
Do it the same way that everyone else who doesn’t rely on vertical
retrace does it. Search the list archives for more than enough info.
I was thinking of using RTLinux by first polling for the retrace and
then setting a timer to be called. Once the timer is called I can
check if indeed the vga is in retrace and then signal the usermode
thread to update the display. I prefer not to go this route but if
that’s what I have to do then so be it.
Overkill … non-portable … RTLinux sucks … :).
Sure, it’s non-portable, but who cares if it’s an embedded system in a
arcade machine or something? If there’s no other way to get the video
card to pump out a steady stream of frames, it’s not overkill.
And finally, RTLinux - as well as RTAI - work great, and provide
scheduling accuracy down to the very limits of the hardware - but they’re
not meant for much higher level stuff than in this case, guaranteeing
that exactly one page is shown for each video refresh. You don’t run a
full game as RTL/RTAI threads.
//David Olofson — Programmer, Reologica Instruments AB
.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------------> http://www.linuxdj.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |
-------------------------------------> http://olofson.net -'On Sunday 09 December 2001 06:16, M. R. Brown wrote: