chickadee » sdl2 » rotate-surface-90

rotate-surface-90 surface turnsprocedure
rotate-surface-90* surface turnsprocedure

Return a copy of the given surface rotated by the given number of 90° clockwise turns. turns must be an integer. For example:

  • turns 0 means no rotation
  • turns 1 means 90° clockwise rotation
  • turns 2 means 180° rotation
  • turns 3 (or -1) means 270° clockwise (i.e. 90° counter-clockwise) rotation

The new surface will have an equivalent pixel format, color key, blend mode, alpha mod, and color mod as the given surface. If the given surface has a palette, the new surface will share the same palette. The new surface will have no clip rect.

  • rotate-surface-90 returns a memory-managed sdl2:surface.
  • rotate-surface-90* returns an unmanaged sdl2:surface, which should be freed with free-surface! when you are done with it.

Signals an exception of kind (exn sdl2) if an error occurs.