chickadee » sdl2 » load-bmp-rw*

load-bmp-rw rwops #!optional close?procedure
load-bmp-rw* rwops #!optional close?procedure

See SDL_LoadBMP_RW.

Attempts to load a BMP image from the given sdl2:rwops. Returns a sdl2:surface containing the image data. Signals an exception of kind (exn sdl2) if the image could not be loaded.

If close? is #t, rwops will be automatically closed (see rw-close!) after the image is loaded. If close? is #f or omitted, rwops will not be closed.

NOTE: This procedure only supports certain kinds of BMP image. Use the sdl2-image egg for better BMP support, plus support for loading other image formats like JPG, PNG, and GIF.

  • load-bmp-rw returns a managed sdl2:surface.
  • load-bmp-rw* returns an unmanaged sdl2:surface, which must be freed with free-surface! when you are done with it.