set_color_depth(3alleg)

set_color_depth3alleg

Sets the global pixel color depth. allegro game programming library.

Usage

#include <allegro.h>

void set_color_depth(int depth);

Overview

Sets the pixel format to be used by subsequent calls to set_gfx_mode() and create_bitmap(). Valid depths are 8 (the default), 15, 16, 24, and 32 bits. Example:

   set_color_depth(32);
   if (set_gfx_mode(GFX_AUTODETECT, 640, 480, 0, 0) != 0) {
      abort_on_error("Couldn't set a 32 bit color resolution");
   }

Note that the screen color depth won't change until the next successful call to set_gfx_mode().

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.