Elektito
Elektito

Reputation: 4155

How to draw rotated polygons in SDL2

I'm using SDL2 to draw a couple of polygons on a window for a simulation I'm doing. I'm using SDL2_gfx primitives for drawing polygons, but now I want the polygons to be rotated. What is the easiest way to achieve this? Performance is not terribly important at the moment. I'd just rather not to dirty my hands with trigonometry!

Upvotes: 0

Views: 1933

Answers (1)

TPS
TPS

Reputation: 2137

SDL2_gfx includes this functionality as standard. It is found in 'SDL_rotozoom.h' and documentation of the use of functions from it can be found at the link below:

http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__rotozoom_8h.html

Upvotes: 1

Related Questions