Closed nikita-yfh closed 3 years ago
You could rotate each vertex before rendering to get this effect.
I believe SDL_gpu can do that with GPU_Rotate.
I solved this by using GPU_PrimitiveBatch, passing the vertex coordinates and texture coordinates to it.
Did you solve the image rotation too?
Yes, I solved. I rotate vertices with point rotation function (xd = x×cos(a) - y×sin(a); yd = y×cos(a) + x×sin(a)).
I need to draw a non-convex textured polygon, or a set of textured triangles. In this picture, I am achieving the result using SDL_GFX, but its capabilities have become lacking: I can't rotate the image. Can I do something similar with SDL_GPU, and with the ability to rotate the image?