[visionegg] Re: poll LPT during swap_buffers()

thanks :)

at the moment I can live with the status quo. I was just wondering if
this could be done...in case some people ask me about whether VE can do
this..

I have no experience with thread programming....is difficult, I
think...?

ciao

Christoph
On Thu, 2003-07-10 at 13:07, Andrew Straw wrote:
> Christoph Lehmann wrote:
> 
> > Since in the swap_buffers() code you wait for the vsync pulse: would it
> > be possible not only to wait for the vsync but in this time also 
> > polling
> > the LPT, logging any changes in the Lpt and returing it to the main 
> > loop
> > (with a log-object as return value)...? would be nice, this way being
> > able to log button-box responses, wired to LPT, even during the small
> > time-window, where VE waits for the vsync.
> 
> Hi Christoph,
> 
> One of the most annoying things about modern video systems is that 
> there is no easy way to do what you want.
> 
> When the swap_buffers() function is synchronized to the vertical 
> retrace, it blocks--doesn't return--until the monitor is sent a 
> vertical sync pulse.  It would be great to have a callback function or 
> event notification system, but such a thing does not exist on the most 
> common operating systems.  (However, I think we may get this with 
> OpenGL 2.0.)
> 
> I can name several (more difficult?) ways to do what you want.  In 
> order of increasing complexity:
> 
> 1) Don't operate with swap_buffers() synchronized to the vertical 
> retrace.  (It might be necessary, depending on your stimulus, to guess 
> how many frames you've drawn based on your display's refresh rate.)
> 
> 2) Write a threaded application that calls swap_buffers() in one 
> thread, but listens on LPT in another thread.
> 
> 3) I've heard about some Windows-only function which lets you ask the 
> video card what line it's currently drawing, and therefore you could be 
> smarter about time-management within your program, calling 
> swap_buffers() only at the last possible moment.
> 
> 4) Use a data acquisition device (instead of the LPT port) which is 
> configured to time-stamp the arrival of the pulse.
> 
> Cheers!
> Andrew
> 
> ======================================
> The Vision Egg mailing list
> Archives: http://www.freelists.org/archives/visionegg
> Website: http://www.visionegg.org/mailinglist.html
-- 
Christoph Lehmann <lehmann@xxxxxxxxxxxx>
University Hospital of Clinical Psychiatry

======================================
The Vision Egg mailing list
Archives: http://www.freelists.org/archives/visionegg
Website: http://www.visionegg.org/mailinglist.html

Other related posts: