[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [pygame] Testing vector graphics
Em Thu, 20 Jun 2002 19:32:41 -0700
Pete Shinners <pete@visionart.com> escreveu:
> Leonardo Santagada wrote:
> > Here is my test to make sure pygame could do a good job drawing
> > vectors. It is not very well documented, nor it's finished. But I want
> > to know from you all if I'm doing everything right and fast, because I'm
> > getting 99 fps just drawing one spaceship and I am using a PIII-850
> > 384mb ram and a nvidia TNT2 card running the nvidia accelerated drivers
> > for linux.
>
> a couple things.. first, i like what you've done to the sprite
> classes. i think it's a good start. here's the biggest things i see.
>
> first, you are clearing and flipping the entire screen for each
> frame. on my p2-300 at work the program runs at 35fps. not that the
> vector graphics are too slow, that is simply the maximum speed this
> computer can fill/flip an entire screen surface with software rendering.
>
> with some minor changes i've got "teste" only updating the parts of
> the screen that are drawn to, and a cheap fix to only fill the parts
> of the screen that have a ship on them.
>
> on my machine the framerate jumps up to over 800fps. now in the end
> this may not have such a benefit for you. if the real game has the
> entire screen filled with vector effects, you'll be at the same
> speed as the fullscreen fill/flip. i guess it just depends what the
> game is going to be if this will really benefit you or not.
>
> also, the graphics card and driver will really not make much
> difference for you with this type of program. it is basically all
> software based, and the line rendering in pygame is done with
> software, so probably works best on regular software surfaces. it's
> really just a test of how quick the cpu can move pixels around in
> memory.
>
> actually, i suppose with accelerated displays the fill and flip are
> done in hardware, so it could be a bit faster. i'm just unsure the
> speed of software line rendering on hardware surfaces...
>
>
> hmm, actually, instead of filling the vector areas with black, you
> might be better off redrawing the lines with black? it might be
> worth trying.
>
Thanks for the code tip. I am now working to make it use renderupdates because inflating the resulting rect of lines was not good enought to me. I wonder how to make the coillision detection and the start doing the fun stuff like ai and a particle engine.
____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org