Day 3 and first problems
I just don't know what's happening. If I draw a 800x600 background image and the grass blades, the FPS counter goes down to 15. It's just that combination. If I just draw the grass or I just draw the background, I get more than 30fps.All that while the player and more than 50 bugs move around. But it has nothing to do with them!
Player+bugs+background -> 30fps.
Player+bugs+grass -> 30fps
Player+bugs+background+grass -> 15fps 8(
I've fighting all day against that. There's something in pyglet batches and OpenGL that I just don't get. GRRRR!
Nothing much was accomplished today :(
(log in to comment)
Comments
import pyglet pyglet.options['debug_gl'] = False def zero_errcheck( result, func, arguments ): return result pyglet.gl.lib.errcheck = zero_errcheckThis gives very good speeds, try it!
PS: Also make sure you set window.invalid = False in on_draw() and True in update()!
Is there a way to turn on -O from the code? Or some way to force the user to use it? I should probably change run_game.py to start with
#! /usr/bin/env python -O
But that does not solve it on Windows.
I'll investigate this further after PyWeek, but I've got so much to do now :).
richard on 2009/04/29 00:59:
Check your image sizes - some graphics cards can really slow down if the images (textures) are too big (>1024 in either dimension, or in really bad cases perhaps >512)