• Forum
  • Lounge
  • Been searching how to rotate an image in

 
Been searching how to rotate an image in sdl

Well basically I can't find anything on how to rotate an image in SDL. So just if anyone knows of anyway possible to rotate one. If it be sending me a tutorial or if you know how.

But I want it to have no external files i need to include. Like a function someone has already made a small framework for etc.

Cheers,
Myth.
Quick search in google brought me to this topic:
http://forums.indiegamer.com/archive/index.php/t-3836.html

I'm learning SDL myself, so I don't know to much about it. But when you can isolate every single pixel in a surface, it would be quit easy to calculate it's new position by writing you're own function.
Thanks for that Scipio - But not exactly what I'm looking for as they are talking about using something from SDL_gfx and well. If you look at his code for his rotation its very complex / resource consuming for something so basic. I have a wrapper function in OpenGL somewhere back on another PC of mine. So I think I'll have to go dig that up and use it. I'll post the code for it if you'd like a copy of it.

I know it works perfect as I've used it before but yeah - Have to use some openGL for it.

Thanks though!
Unless you don't mind nearest neighbor, arbitrary rotation is a pretty expensive operation, particularly from software.
What does "mind nearest neighbor" mean?
Nearest neighbor is the cheapest interpolation algorithm, but it's results are usually unacceptable. If you don't mind using it, arbitrary rotation can be cheap. Otherwise...

http://en.wikipedia.org/wiki/Nearest-neighbor_interpolation
Topic archived. No new replies allowed.