Hi Alex,

I am Using Pyglet to browse (interactively) the contents of an Object
database such as ZODB. Since it is impracticable to send you the
database, I am sending you a script that, shows the problem, which
seems  to be related  to assigning long strings to text objects.

I understand that this problem may not necessarily be minimizable,
since pyglet is not meant to be a text editor.

BTW i am running Ubuntu Feisty

here is the code:

from pyglet import font
from pyglet import clock
from pyglet import window
from pyglet import image
from pyglet.gl import *
from pyglet.window import mouse
from pyglet.window import event
from pyglet.window import key
import random


win = window.Window(resizable=True)
ft = font.load('Arial', 22)
T = font.Text(ft,"",valign=font.Text.TOP,y=win.height-40,width =
win.width)

def change_text():
    longstring = ','.join([str(random.random()) for i in
xrange(10000)])
    T.text = longstring


def mainLoop():
    """
    Interface mainloop
    """
    #clock.set_fps_limit(30)
    while not win.has_exit:
        win.dispatch_events()
        glClear(GL_COLOR_BUFFER_BIT)
        #win.clear()
        change_text()
        T.draw()
        win.flip()

glEnable(GL_BLEND)
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
mainLoop()

On Sep 19, 8:46 pm, Alex Holkner <[EMAIL PROTECTED]> wrote:
> On 20/09/2007, at 9:06 AM, fccoelho wrote:
>
>
>
> > The level of slowness I am getting is that it takes a couple of
> > seconds for every  screen update, that is, I scroll the mouse and a
> > couple of seconds later I see the updated string on screen....
>
> You may have come across a bug, or there may be an error in some
> other part of your program that we can't see.  Would it be possible
> for you to provide a complete running example demonstrating the
> problem?  I imagine this would be similar to the snippet you posted
> below, with the relevant imports and extra objects or classes
> defined.  At least then we can both run code on the same page, and
> quickly determine if the problem is local to your hardware or not.
>
> > I should mention that I am running this on a quadcore Xeon, with 4GB
> > of RAM, and a NVidia Geforce 8600. Plus all the examples that come
> > with pyglet run at normal speed.
>
> > one last question: is the size of text an important factor here?
>
> Only in the obvious way: increasing font size increases the size of
> the textures that need to be used, and the amount of fragment work.
> Neither of these are likely to be problematic with your hardware,
> assuming your drivers are good.
>
> Please also let us know what operating system/version you're running.
>
> Alex.


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