开发者

Drawing list of points in SDL?

开发者 https://www.devze.com 2023-01-03 22:55 出处:网络
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?

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

精彩评论

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