But this function takes a surface… I’m new with this library and I’m not sure how to solve something this simple. Is this possible or I need to draw the triangle each time with different coordinates?if this is the case, it’s insanely long and complicated.

I do not understand why you think it is “insanely long and complicated”. Drawing the triangle each time, with different coordinates, is straightforward in terms of code and almost certainly computationally less effort than rotating a surface!

If for some reason you don’t want to do it this way, you could render the triangle once onto a target texture, and then rotate it using SDL_RenderCopyEx().

Because to make the transition looks smooth, i need to figure out how to draw the triangle in a way to make it rotate a little each frame, i didn’t try it yet but it seems to me to be complicated

If you want to achieve smooth, slow, rotation then the fact that filledTrigonRGBA() takes integer (rather than float) vertex coordinates is unfortunate and may result in aliasing artifacts. You might want to consider using the anti-aliased routine aaFilledPolygonRGBA() which is one of my extensions to SDL2_gfx that I described here recently.

An easy way is to specify the vertices of your triangle using polar coordinates rather than Cartesian coordinates. Rotation can then be achieved simply by adding the same offset to all three angles, and you need only convert the polar coordinates to Cartesian (which is the easier direction) for plotting.

I’d rather use filledPolygonRGBA() or aaFilledPolygonRGBA() because they receive the vertex coordinates in an array and it’s neater to do the polar-to-Cartesian conversion in a loop.