[visionegg] Re: VisionEgg with wxPython on Windows

  • From: Simeon Fitch <simeon.fitch@xxxxxxxxxxxxx>
  • To: visionegg@xxxxxxxxxxxxx
  • Date: Fri, 4 Nov 2005 13:09:55 -0500

<snip>

> One serious issues with GLUT is that you relinquish control to its
> mainloop.

Ah, I'd forgotten about that aspect of GLUT.

>I think wxGLCanvas would be the same.

I'm going to look into this. I've not used wxGLCanvas, but in my GUI
code I was (somewhat) able to interleave the wx event loop with
VisionEgg in order to display a parameter configuration window while
displaying stimuli. Here's the code if anyone else is interested (the
time and iteration values in the loop still need some tweaking). Don't
use this in experiment mode as it will eat into your frame rate.

---------------------------------------
class WxStimulus(Stimulus):
    """
    Class for processing GUI events inside the Presentation event loop.
    """
    def __init__(self, **kw):
        Stimulus.__init__(self, **kw)

    def draw(self):
        # Process any GUI events
        # until there are no more waiting.
        wxApp = wx.GetApp()
        if wxApp is None:
            return

        for i in range(25):
            while wxApp.Pending():
                wxApp.Dispatch()

            # Send idle events to idle handlers.
            wxApp.ProcessIdle()
            time.sleep(0.01)
-----------------------------------------------

Perhaps I can do something similar to latch wxGLCanvas, if the need arises.

> Another historical
> reason for choosing pygame was the promise of support for multiple
> screens, which hasn't materialized (but workarounds are available).

While I now have my application working in development mode, once I
package it with "py2exe" pygame crashes again. I need to revisit the
pygame FAQ, but must say that pygame is the only package that gives me
trouble when porting between platforms and OS versions.

Another issue I may be having to tackle is hacking pygame to enable
the stereo buffers, a la "glutInitDisplayMode(GLUT_STEREO)". Apple has
just added windowed stereo support in the latest 10.4.3 update!

Thanks for you help!

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

Other related posts: