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 managed sdl2:texture.
  • create-texture-from-surface* returns an unmanaged sdl2:texture, which must 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.

These procedures are available in sdl2 egg version 0.2.0 and higher.