Hi all,

The code below demonstrates the problem. I'm running pyglet 1.0beta3
with python 2.5 on OS 10.5.1.

########
#import pyglet and modules
########

import pyglet
from pyglet import window
from pyglet import font
from pyglet.gl import *


########
#initialize the window
########

win = window.Window()
my_font = font.load(None, 16)


########
#Helper functions
########

def show_message(win,text,my_font):
        win.dispatch_events()
        win.clear()
        rendered_text = font.Text(my_font,text,win.width/2,win.height/2)
        rendered_text.draw()
        win.flip()


def draw_cross(win,size,thickness,color):
        win.clear()
        aspect=win.height/float(win.width)
        glColor3f(color[0],color[1],color[2])
        glRectf(-aspect*size*thickness/2,-size/2,aspect*size*thickness/2,size/
2)
        glRectf(-aspect*size/2,-size*thickness/2,aspect*size/2,size*thickness/
2)
        win.flip()


########
#Demonstrate the problem
########

#I can draw a cross...
draw_cross(win,.5,.2,[.5,.5,.5])

#but when I write some text to the screen...
show_message(win,'Ahoy there!',my_font)

#I can no longer draw the cross...
draw_cross(win,.5,.2,[.5,.5,.5])

#but I can draw more text...
show_message(win,'Arrrgh!',my_font)

#Any help with this would be greatly appreciated!
--~--~---------~--~----~------------~-------~--~----~
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