Ok, that works for me ... and I think I'm starting to understand
better.

May I suggest a small change (inserted in your message below.)

André

On Aug 19, 11:58 pm, "Richard Jones" <[EMAIL PROTECTED]> wrote:
> The problem is that the standard window on_resize is invoked after the
> perspective projection is set up. I've checked in a fixed version (attach
> setup() as the on_resize method on the windows) to SVN.
>
> Alternatively, we could alter the demo to use the standard pyglet ortho
> projection and default OpenGL environment to simplify things and not confuse
> the message of the example. The following is a proposed replacement for the
> example:
>
> from pyglet.gl import *
> from pyglet import window
> from pyglet import clock
>
> def draw(w):
>     glClear(GL_COLOR_BUFFER_BIT)
>     glLoadIdentity()
>
>     glTranslatef(w.width/2, w.height/2, 0)
>     glRotatef(r, 0, 0, 1)
>     glBegin(GL_QUADS)
>     glVertex2f(-w.width/4, -w.width/4)
>     glVertex2f(-w.width/4, w.width/4)
>     glVertex2f(w.width/4, w.width/4)
>     glVertex2f(w.width/4, -w.width/4)
>     glEnd()
>

def set_grey_levels(w, background=0, foreground=1):
    b = background
    f = foreground
    glClearColor(b, b, b, 1)
    glColor4f(f, f, f, .5)

> w1 = window.Window(200, 200, caption='First window')
>
> w2 = window.Window(300, 300, caption='Second window')
>

set_grey_levels(w1)
set_grey_levels(w2, 1, 0.5)

> r = 0
> clock.set_fps_limit(30)
> while not (w1.has_exit or w2.has_exit):
>     dt = clock.tick()
>     r += 1
>     if r > 360: r = 0
>
>     w1.switch_to()
>     w1.dispatch_events()
>     draw(w1)
>     w1.flip()
>
>     w2.switch_to()
>     w2.dispatch_events()
>     draw(w2)
>     w2.flip()
>
>      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