[SDL] single pixel drawing

Loren Osborn linux_dr at yahoo.com
Mon Jul 15 01:53:00 PDT 2002

While I agree that function calling overhead can be
expensive, decalring a function as "inline" largely
eliminates the majority of this.

That leaves two other potential bottelnecks:
pixel addressing (which you discussed).  While the
multiplies can be expensive, they can only be replaced
with faster operations (like adds and increments) when
the pixels are drawn in a predictable shape (such as a
curve or a line).

The bottleneck you did not address is converting the
desired pixel color into the pixel format of the
surface. This can be especially redundant if the same
color is being converted repeatedly. (Which is why I
advised caching)...

I hope that helped,

--- Atrix Wolfe <Atrix2 at cox.net> wrote:
> Drawing single pixels at a time is inherantly slow
> and if at all possible it
> should be avoided.  That aside im going to try to
> explain as best as i can
> and hopefully itll make sense to you. The fastest

Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes

More information about the SDL mailing list