开发者

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?


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


Take a look at SDL_gfx.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜