get_rle_sprite(3alleg)

get_rle_sprite3alleg

Creates an rle sprite using a bitmap as source. allegro game programming library.

Usage

#include <allegro.h>

RLE_SPRITE *get_rle_sprite(BITMAP *bitmap);

Overview

Creates an RLE sprite based on the specified bitmap (which must be a memory bitmap). Remember to free this RLE sprite later to avoid memory leaks. Example:

   RLE_SPRITE *rle;
   BITMAP *bmp;
   ...
   /* Create RLE sprite from an existent bitmap. */
   rle = get_rle_sprite(bmp);
   if (!rle)
      abort_on_error("Couldn't create RLE sprite!");
   /* We don't need the bitmap any more.*/
   destroy_bitmap(bmp);
   /* Use the RLE sprite. */
   ...
   /* Destroy it when we don't need it any more. */
   destroy_rle_sprite(rle);

Return value

Returns a pointer to the created RLE sprite, or NULL if the RLE sprite could not be created. Remember to free this RLE sprite later to avoid memory leaks.

Releases

4 releases since Debian 3.1 (Sarge); the text changed 2 times.

  1. 3.1
  2. 4.0
  3. 5.0–6.0

From liballegro-doc 2:4.2.2-2.2 in Debian 6.0 (Squeeze). Parsed by carta from the page's man source.