[wxruby-users] Tearing in my buffered animation test script...
Paul w Florczykowski
lists at ruby-forum.com
Fri Mar 28 21:16:38 EDT 2008
Thanks for your replies.
Well I assumed double buffering automatically implies vertical sync, but
ofcourse it actually means drawing on offscreen buffer first; with or
without vsync..- While I'm rather new to both Ruby and WxRuby (and for
that matter to any GUI toolkit at all:) I have done my share of
programming graphics using Direct3D and other APIs specifically designed
for that. In that world there is almost always some easy way to
synchronize the actual copy or buffer swap with the vertical blank
period of the screen.
For example the Present(...) method of the rendering device
interface in DirectX 9, automatically waits for the V-blank period
before it swaps buffers, provided it is called with correct arguments.
And since I come from there I was kind of expecting similar
solutions for any kind of graphics.
However after doing some research I realized that the opposite holds for
the world of GUI APIs. On Windows (XP at least, don't know about Vista)
it seems very hard to get any info about the current position of the
electron ray from the OS, unless working with either DirectX, OpenGL or
directly with the graphics driver. And that is probably the right
approach unless one is generating a lot of fast changing screen content
at high framerates - because first then the shearing will be noticeable
unless vertiacally synced.
As for my own WxRuby-learning-application, I'm also completely satisfied
with copying to the frontbuffer without the vsync, feel free to take a
look: http://web.comhem.se/paul/triplot . The shearing is there, but I
have to look very hard to see it. When I saw info on the paint_buffered
method that stated it was there to faciliate flicker-free drawing I
assumed it was supposed to be vertically synced just because of a
preconception, sorry about that.
And... I took a look at the Zyps application (really cool). As you say,
there is no visible shearing.
--
Posted via http://www.ruby-forum.com/.
More information about the wxruby-users
mailing list