tags:

views:

49

answers:

2

If i have an array of coordinates for a path(Such as in a paint program), what is the best way to render the entire path with SDL?

I looked at setting pixels individually, but from what i've seen that's a bad idea.

I also thought about drawing all the coordinates as SDL_Rect's, but rendering a large list of rect's each frame sounds slow.

Is there a simple way of achieving this effect?

Thanks!

A: 

You can implement yourself the Bressenham line algorithm (http://www.webkinesia.com/games/sdl-turtle.php) accessing directly the framebuffer but I think you'll be doing much better using OpenGL...

miquelramirez
A: 

Take a look at SDL_gfx.

genpfault