chickadee » sdl2 » lock-texture-raw!

lock-texture-raw! texture rectprocedure

Lock the texture so that its pixel data can be overwritten. This is for advanced users, and must be used with caution. See SDL_LockTexture. See also unlock-texture!.

  • texture is the sdl2:texture that you wish to modify
  • rect is either an sdl2:rect (to lock part of the texture), or #f (to lock all of the texture).

This procedure returns multiple values:

pixels
A raw pointer that you can write pixel data to. Does not necessarily contain the old data.
pitch
An integer indicating the pitch of the pixel data

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

Requires sdl2 egg 0.2.0 or higher.