chickadee » sdl2 » duplicate-surface

duplicate-surface surfaceprocedure
duplicate-surface* surfaceprocedure

Returns a new surface with the same data and format as the given surface.

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

With SDL 2.0.6, this uses SDL_DuplicateSurface. With earlier SDL versions, it uses SDL_ConvertSurface.

Requires sdl2 egg version 0.4.0 or higher.