On 28 October 2011 15:45, Nathan <[email protected]> wrote:
> First, and most annoying, the window would always start hidden.  According
> to the events, it was always active and shown, but it wasn't.  During the
> graphics test, the window process was selected, but to get the window to
> actually appear I had to switch to another application (like Terminal) and
> then switch back to the python app, and then it displayed.  During the font
> tests, I could just click on the python app and the window appeared.  NOTE
> that this problem did NOT occur in the checkouts of Philip's version -- so
> if his changes were merged, this would seem to be a regression.

Hmm, that's a question for Philip - he merged the branch:

http://code.google.com/p/pyglet/source/detail?r=caf8b30706b757a4e70809f404408b51ba5b3513


> Second, during ANY resize event, garbage would be displayed.  In the case of
> resize-by-mouse garbage would continue to be displayed until the mouse
> button was released.  Results when resizing was inconsistent.  Sometimes the
> scene seemed sane after a resize, often it didn't.  Lots of garbage and
> garbled artifacts.

I also saw this. I suspect that the older-style test code is to blame.
For example, WINDOW_RESIZABLE has:

        self.w = w = window.Window(self.width, self.height, resizable=True)
        glClearColor(1, 1, 1, 1)
        while not w.has_exit:
            w.dispatch_events()
            window_util.draw_client_border(w)
            w.flip()
        w.close()

It looks like the OS X code (cocoa and carbon) is blocking in
w.dispatch_events() while the mouse is held down on the resize handle.
When the mouse is released the window contents are redrawn as
expected.

I'm not sure whether this is reasonable or even controllable. I'd
appreciate it if someone could indicate the behaviour of
WINDOW_RESIZABLE on other platforms.

To account for the blocking and allow redraw while events are being
handled, I modified the code to:

        self.w = w = window.Window(self.width, self.height, resizable=True)
        def on_draw():
            glClearColor(1, 1, 1, 1)
            window_util.draw_client_border(w)
            w.flip()
        w.push_handlers(on_draw)
        on_draw()
        while not w.has_exit:
            w.dispatch_events()
        w.close()

all flickering / corruption goes away. I'm just not sure this is appropriate.

Thanks for the log! I'm not sure how much of the objc-based code I'm
going to be able to address, but we'll see :-)


     Richard

-- 
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en.

Reply via email to