Ian P
Ian P

Reputation: 1533

Drawing list of points in SDL?

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?

Upvotes: 3

Views: 914

Answers (2)

Miquel Ramirez
Miquel Ramirez

Reputation: 543

You can implement yourself the Bresenham line algorithm directly accessing the framebuffer but I think you'll be doing much better using OpenGL...

Upvotes: 1

genpfault
genpfault

Reputation: 52094

Take a look at SDL_gfx.

Upvotes: 0

Related Questions