curved line in SDL

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Post Reply
mary
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 33
Joined: Tue Apr 27, 2010 2:13 pm

curved line in SDL

Post by mary »

is it possible to make a curved line is SDL?
User avatar
epicasian
Chaos Rift Junior
Chaos Rift Junior
Posts: 232
Joined: Mon Feb 22, 2010 10:32 pm
Current Project: Gigazilla Engine
Favorite Gaming Platforms: Dreamcast, SNES, PS2, PC
Programming Language of Choice: C/++
Location: WoFo, KY

Re: curved line in SDL

Post by epicasian »

Do you mean, like in an image?

If yes, all you have to do is setup SDL, and display the image of a curved line.

If no, please explain.

Hope it helps,
EpicAsian
User avatar
Bakkon
Chaos Rift Junior
Chaos Rift Junior
Posts: 384
Joined: Wed May 20, 2009 2:38 pm
Programming Language of Choice: C++
Location: Indiana

Re: curved line in SDL

Post by Bakkon »

SDL by itself isn't capable of drawing primitives, but SDL_gfx is a library extension that includes arcs and bezier curves.

http://www.ferzkopp.net/joomla/content/view/19/14/
Avishaiozeri
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 85
Joined: Wed Mar 17, 2010 4:32 pm

Re: curved line in SDL

Post by Avishaiozeri »

If you want, you can make a function that draws a curved line in the pixel frame buffer yourself, using some math. But i guess there are some libraries on the internet that does these things for you.
Post Reply