On Fri, May 28, 2010 at 7:14 PM, Matthew Mitchell <[email protected]> wrote: > Hello. My game runs nicely at about 40fps. That's before after about a > minute, it suddenly drops to about 10-20fps for another minute > (Doesn't have to be a minute). > > I've used the hotshot profiler and I get this information: > > Does this mean the flip method is a problem? What could be the > potential problems? What parts of the code should I show because I > have massive amounts of code. The flip method is the window.flip > method for pyglet.
The flip method is where the OpenGL buffer swap occurs, and consequently is where the CPU waits for the GPU to finish rendering everything submitted in the current frame. This implies that your performance bottleneck is on the GPU side, so your first step should be to learn your way around the OpenGL Profiler, and/or the OpenGL Driver Monitor, both of which are included in the XCode Developer Tools. Those should give you a decent idea of where the bottleneck occurs, but some general guidelines are to make sure you are using VBO rather than immediate mode (i.e. pyglet's drawing functions, rather than glBegin/glEnd), and do everything possible to reduce the total amount of draw calls submitted each frame. Also beware of format mismatches between multiple rendertargets/textures and copy operations you perform thereon. -- Tristam MacDonald http://swiftcoder.wordpress.com/ -- 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.
