Rotating Rectangles?

Hi all,
I programmed the graphics for a professor’s neuroscience lab this
semester in SDL and just when I thought all my work was done, it
turns out my graphics library is useless unless I add the ability to
rotate rectangles. I’m in a huge rush to get this done before I have
to move back home for the summer. Can anyone recommend the easiest
way to do this? I’m using no OpenGL at all, just simple Rectangle
objects I created which store a width, height, x, y, and color, and
which call SDL_draw’s Draw_FillRect(…) (which just wraps a call to
SDL_FillRect) when necessary. If I add a rotation angle field, how
could I get the rectangles to be drawn rotated?

Thanks,
Josh

Hi all,
I programmed the graphics for a professor’s neuroscience lab this
semester in SDL and just when I thought all my work was done, it
turns out my graphics library is useless unless I add the ability to
rotate rectangles. I’m in a huge rush to get this done before I have
to move back home for the summer. Can anyone recommend the easiest
way to do this? I’m using no OpenGL at all, just simple Rectangle
objects I created which store a width, height, x, y, and color, and
which call SDL_draw’s Draw_FillRect(…) (which just wraps a call to
SDL_FillRect) when necessary. If I add a rotation angle field, how
could I get the rectangles to be drawn rotated?

Have a look at SDL_gfx ( http://www.ferzkopp.net/Software/SDL_gfx-2.0/ ), it
does the job for you.

Regards, Joonas.On Friday 26 May 2006 19:50, Joshua Bronson wrote:

Thanks,
Josh


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Joonas “dolphin” Lahtinen <@Joonas_Lahtinen>

I programmed the graphics for a professor’s neuroscience lab
this
semester in SDL and just when I thought all my work was done, it
turns out my graphics library is useless unless I add the ability to
rotate rectangles. I’m in a huge rush to get this done before I have
to move back home for the summer. Can anyone recommend the easiest
way to do this? I’m using no OpenGL at all, just simple Rectangle
objects I created which store a width, height, x, y, and color, and
which call SDL_draw’s Draw_FillRect(…) (which just wraps a call to
SDL_FillRect) when necessary. If I add a rotation angle field, how
could I get the rectangles to be drawn rotated?

If it’s just filled rects, you may find this interesting :
http://gabrielongraphics.blogspot.com________________________________________________________________________
Gabriel Gambetta
Mystery Studio - http://www.mysterystudio.com
Gabriel on Graphics - http://gabrielongraphics.blogspot.com