The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Allegro::Display - Allegro Display object

SYNOPSIS

   use Allegro;

   $al = Allegro->new();
   $display = $al->Display(width  => 640,
                           height => 480);

DESCRIPTION

Allegro::Display provides an object used to access the full screen or window bitmap. It is anagalous to Allegro's screen pointer.

This class contains methods to create and destroy a new window/screen, as well as methods to set the palette.

METHODS

The Display class inherits from the Bitmap class. Therefore all Bitmap methods will work on a Display object.

new - create a new display object

Creates a new Allergo::Display object. This will set a graphics mode and return an object that can be used as a normal Allegro::Bitmap object (it is a sub-class of Bitmap).

   $disp = $al->Display(width    => 640,
                        height   => 480,
                        v_width  => 1024,
                        v_height => 768,
                        depth    => 24,
                        mode     => 'window');

The virtual width and height requested will not necessarily be what you requested. Use the v_width and v_height methods to check. Similarly, if you don't specify width and height, use width and height to find out the width and height.

width, w (optional)

Width of desired screen or window.

height, h (optional)

Height of desired screen or window.

v_width, vw (optional)

Desired virtual width of screen. Defaults to width.

v_height, vh (optional)

Desired virtual height of screen. Defaults to height.

depth (optional)

Depth (in bits) of screen. Defaults to whatever is convenient. Therefore you should always specify this if a certain bit depth is required.

mode (optional)

Type of display to create. Valid options are auto, window, and fullscreen. Defaults to auto.

shutdown

Shuts down the display and either returns to text mode or destroys the visible window, depending on platform.

   $disp->shutdown;
title

Sets the display window's title. This method has no effect if the display is in full screen mode or there are no window titles. Returns the current title.

   $title = $disp->title;
   $disp->title("Allegro Perl program");
palette

Sets the current palette to the one supplied as an argument. Returns the current palette. The supplied palette should be an Allegro::Palette object.

   $old_pal = $disp->palette;
   $disp->palette($new_pal);
v_width

Retrieves virtual width of the screen.

v_height

Retrieves virtual height of the screen.

AUTHOR

Colin O'Leary <colino@cpan.org>

COPYRIGHT

Copyright 2003 by Colin O'Leary. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

The Allegro library is copyright its authors, and is giftware. See http://alleg.sf.net for more information.

SEE ALSO

Allegro - base Allegro routines
Allegro::Bitmap - Allegro bitmap routines
Allegro::Palette - Allegro palette routines