chickadee » sdl2 » surface-set!

surface-ref surface x yprocedure
surface-ref-raw surface x yprocedure
(set! (surface-ref surface x y) color)setter
surface-set! surface x y colorsetter

Get or set the color of the specified pixel on the surface.

  • surface-ref returns an sdl2:color.
  • surface-ref-raw returns a mapped color (an integer). You can use get-rgba to convert the mapped color to color fields.
  • The setters accept either an sdl2:color or a mapped color.

These procedures automatically lock and unlock the surface if needed. They signal an exception of kind (exn sdl2) if the surface cannot be locked.

These procedures signal an exception of kind (exn bounds) if x or y is out of bounds.

The setters ignore the surface's clip rect.