Namespace List Class Hierarchy Compound List File List Namespace Members Compound Members

# ptc::Mode Class Reference

Describes a display mode. More...

List of all members.

## Public Members

- Mode ()
- Mode (int width,int height,const Format &format)
- Mode (const Mode &mode)
- ~Mode ()
- bool valid () const
- int width () const
- int height () const
- const Format& format () const
- Mode& operator= (const Mode &mode)
- bool operator== (const Mode &mode) const
- bool operator!= (const Mode &mode) const

## Detailed Description

Describes a display mode.

The mode class describes a display mode with a specific width, height and pixel format.

Mode objects are typically used with Console::modes() and Console::open()(const char title[],const Mode &mode,int pages).

## Member Function Documentation

### ptc::Mode::Mode ()

Default constructor.

The display mode object created by the default constructor is an invalid mode.

See Mode::valid() for details.

### ptc::Mode::Mode (int width, int height, const Format & format)

Creates a display mode object of dimensions width x height pixels and a pixel format of format.

Parameters:
  width - the mode width.
  height - the mode height.
  format - the mode format.

### ptc::Mode::Mode (const Mode & mode)

Copy constructor.

### ptc::Mode::~Mode ()

Destructor.

### bool ptc::Mode::valid () const

Tests whether the mode is valid.

A display mode is invalid when it was created by the default constructor.

Typically this function is used to check for the invalid display mode that terminates the console mode list.

See BaseConsole::modes() for more information.

Returns:
  true if the mode is valid, false otherwise.

### int ptc::Mode::width () const

Gets the width of the display mode in pixels.

Returns:
  The mode width.

### int ptc::Mode::height () const

Gets the height of the display mode in pixels.

Returns:
  The mode height.

### const Format & ptc::Mode::format () const

Gets the pixel format of the display mode.

Returns:
  The mode format.

### Mode & ptc::Mode::operator= (const Mode & mode)

Assignment operator.

### bool ptc::Mode::operator== (const Mode & mode) const

Equality operator.

### bool ptc::Mode::operator!= (const Mode & mode) const

Inequality operator.

The documentation for this class was generated from the following file:

- ptc.h