VideoMode

VideoMode defines a video mode (width, height, bpp)

A video mode is defined by a width and a height (in pixels) and a depth (in bits per pixel).

Video modes are used to setup windows (Window class) at creation time.

The main usage of video modes is for fullscreen mode: indeed you must use one of the valid video modes allowed by the OS (which are defined by what the monitor and the graphics card support), otherwise your window creation will just fail.

VideoMode provides a static function for retrieving the list of all the video modes supported by the system: getFullscreenModes().

A custom video mode can also be checked directly for fullscreen compatibility with its isValid() function.

Additionnally, VideoMode provides a static function to get the mode currently used by the desktop: getDesktopMode(). This allows to build windows with the same size or pixel depth as the current resolution.

Constructors

this
this(uint Width, uint Height, uint bits)

Construct the video mode with its attributes.

Members

Functions

isValid
bool isValid()

Tell whether or not the video mode is valid.

toString
string toString()

Returns a string representation of the video mode.

Static functions

getDesktopMode
VideoMode getDesktopMode()

Get the current desktop video mode.

getFullscreenModes
VideoMode[] getFullscreenModes()

Retrieve all the video modes supported in fullscreen mode.

Variables

bitsPerPixel
uint bitsPerPixel;

Video mode pixel depth, in bits per pixels.

height
uint height;

Video mode height, in pixels.

width
uint width;

Video mode width, in pixels.

Meta