On Thu, 20 Sep 2007, fccoelho wrote:
> Hi I just wrote my first pyglet program
>
> its a very simple program: I have a couple of Text objects which I
> update on mouse scrolling and then redraw.
>
> It is absurdly slow!
Please define slow. What are you measuring, what do you get and what would you
expect to get?
> here is my mainloop:
> def mainLoop(root):
> """
> Interface mainloop
> """
> clock.set_fps_limit(15)
This will limit your application to 15 frames per second.
> B = Browser(0,root)
> #win.on_resize = B.rView
> win.on_mouse_scroll = B.objPicker
> win.on_key_press = B.diveIn
>
> while not win.has_exit:
> win.dispatch_events()
> glClear(GL_COLOR_BUFFER_BIT)
> #win.clear()
> B.renderView()
> win.flip()
>
> here is my renderView function:
>
> def renderView(self):
> self.currobj = self.olist[self.pos]
> self.curkey.text = '/'.join([self.olabeldic[i] for i in
> xrange(self.level+1)])
> print self.olabeldic
> self.curkey.x = self.xoff*self.level
> self.curkey.y = (win.height-self.yoff)-
> (self.linespace*self.level)
> self.curval.text =pformat(self.currobj[1])
> self.curval.y = y=(win.height-self.yoff*2)-
> (self.linespace*self.level)
> self.curkey.draw()
> self.curval.draw()
>
> there is nothing time consuming in these functions...
> so, what could be causing the slowness...
I don't know what pformat() does, so I'll just have to believe you :)
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
-~----------~----~----~----~------~----~------~--~---