chickadee » sdl2 » create-texture-from-surface*

create-texture-from-surface renderer surfaceprocedure
create-texture-from-surface* renderer surfaceprocedure

Create a new sdl2:texture from a sdl2:surface.

The texture will contain a copy of the pixel data from the surface. The texture will have the same color mod and alpha mod as the surface. If the surface had a color key, the texture will have 'blend blend mode; otherwise it will have the same blend mode as the surface.

  • create-texture-from-surface returns a memory-managed sdl2:texture.
  • create-texture-from-surface* returns an unmanaged sdl2:texture, which should be destroyed with destroy-texture! when you are done with it.

These procedures signal an exception of kind (exn sdl2) if the sdl2:texture could not be created.

Requires sdl2 egg 0.2.0 or higher.