On Thu, Mar 6, 2008 at 7:00 PM, Juan Jose Alonso
<[EMAIL PROTECTED]> wrote:
>
> Hi guys, have a problem on my game, here extract a little version of
> my game that also have the fps problem.
> also i can see the pink tinted, alpha channel of the ,png images about
> one second at window startup.
>
> Here a link with my simple example for run it.
> http://dump.no/files/ccaffc285aeb/test.zip
>
> And here the code for see without download it. (without images)
>
> http://rafb.net/p/79RQlB27.html
>
>
> Someone can help me? on my two machines i get 13fps aprox. (And i dont
> have problems running others pyglet stuff)
> I test on WindowsXP and Ubuntu Linux, with pyglet 1.0.
>
>
> Happy hacking and blessed :)
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.
Cheers,
--
\\\\\/\"/\\\\\\\\\\\
\\\\/ // //\/\\\\\\\
\\\/ \\// /\ \/\\\\
\\/ /\/ / /\/ /\ \\\
\/ / /\/ /\ /\\\ \\
/ /\\\ /\\\ \\\\\/\
\/\\\\\/\\\\\/\\\\\\
d.p.s
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---