[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pygame] from Python+Pygame to C+SDL, Any experiences?k



On Tue, 18 Mar 2003, Gerrit Holl wrote:

> Bob Ippolito schreef op dinsdag 18 maart om 16:22:25 +0000:
> > >Has anyone on this list used Pygame to learn and then moved to C and 
> > >sdl, and if so what was it like? is it worth it.
> > 
> > You gain very little from this approach.
> 
> How about speed?
> 
> http://pygame.org/docs/tut/newbieguide.html states:
> There are two cases where this technique just won't work. The first is
> where the whole window or screen really is being updated every frame -
> think of a smooth-scrolling engine like an overhead real-time strategy game
> or a side-scroller. So what do you do in this case? Well, the short answer
> is - don't write this kind of game in pygame. The long answer is to scroll
> in steps of several pixels at a time; don't try to make scrolling perfectly
> smooth. Your player will appreciate a game that scrolls quickly, and won't
> notice the background jumping along too much.

[snip]

Smooth scrolling Works fine for me when I render in OpenGL.

I would avoid C like the plague; you should optimize for speed _after_ you
have done the majority of your programming -- and only when profiling has
shown you specific bottlenecks.  Optimizing those bottlenecks should get you
more than 90% of the speed of C -- because the slow bits will be in C.

Premature optimization is the prime source of bad code.

-Jasper