I can't be sure, but I think it's because you need to dispatch_events()
once before drawing anything so that an on_resize event gets handled, which
will set the projection matrix for the window. If you draw before it, the
projection matrix is probably such that you can't see wherever the text
gets drawn. So call window.dispatch_events() once before drawing and it
does display.

On 24 December 2012 16:30, anatoly techtonik <[email protected]> wrote:

> Why pyglet doesn't display label on the first iteration?
> On my Vista machine it is visible only after I hit Enter the second time.
>
> import pyglet
>
> wincfg = pyglet.gl.Config(double_buffer=False)
> window = pyglet.window.Window(config=wincfg)
>
> label = pyglet.text.Label('[]',
>                           font_name='Lucida Console',
>                           font_size=14,
>                           x=10, y=10)
> label.draw()
> pyglet.gl.glFlush()
> window.dispatch_events()
>
> raw_input("Done.")
>
> label.draw()
> pyglet.gl.glFlush()
> window.dispatch_events()
>
> raw_input("Done.")
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "pyglet-users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/pyglet-users/-/Tr5ouPliAKMJ.
> 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.
>

-- 
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