Serban Ungureanu
Serban Ungureanu

Reputation: 13

Save RenderCopyEx

I want to create an image processing application with SDL.

My problem is that I want to rotate a surface. I tried to write the algorithm for accessing the pixels and putting them in the right position but I get really jaggy results.For this reason,I thought that the easiest solution would be to take advantage of the SLD_RenderCopyEx.

However, as I expected, this function doesn't affect the surface but the renderer, and if I want to save the result(after rotation) I will not get the rotated version of the image. Do you guys know if there is any way of saving the image as I see it on the screen? And if not, what do you guys suggest me to do ?

Upvotes: 1

Views: 65

Answers (1)

genpfault
genpfault

Reputation: 52089

You can use SDL_RenderReadPixels() to read pixels from the current rendering target.

Upvotes: 1

Related Questions