> I only took a few seconds to look at your code, but I'm pretty sure
> it's because you're calling blit 247 times per frame. The first
> optimization is to use a display list (it will at least save you all
> those excess function calls). I think there is `batch' feature in
> pyglet which might help, but I haven't looked into it much yet - so
> take my advice with a grain salt there. There is another much more
> involved optimization that entails ordering your renderable objects by
> driver state - but that would require overriding or monkey-patching
> blit on Texture.
Yes, it seems the 247 blits are killing fps, too.
I did say that something was wrong, but I get the same 96 FPS with this
simple test code, and reducing the range increases drastically fps:
#Grass Test
#------------------------------------------
from pyglet import window,clock,image
from pyglet.gl import *
test=image.load('grass1.png')
win = window.Window(width=800,height=600,vsync=False)
clo = clock.Clock()
clo.set_fps_limit(0)
def render():
global test
for x in range(13):
for y in range(19):
test.blit(x*60,y*30)
glEnable(GL_BLEND)
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
while not win.has_exit:
glClear(GL_COLOR_BUFFER_BIT)
win.dispatch_events()
dt=clo.tick()
render()
win.flip()
win.set_caption("FPS="+str(int(clo.get_fps())))
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---