Om  1.0.0
A universal framework for multimedia simulation
Public Member Functions | Static Public Member Functions | List of all members
om::system::Display Class Reference

A class that represents an interface to a single connected video display. More...

#include <omDisplay.h>

Public Member Functions

 Display (DisplayID newDisplayID)
 Create a display object that interfaces with the physical display with the specified ID. More...
 
 ~Display ()
 Destroy this display object and release all state associated with it. More...
 
Size getModeCount () const
 Return the number of valid modes there are for this display. More...
 
DisplayMode getMode (Index modeIndex) const
 Return the mode for this display at the specified index. More...
 
DisplayMode getCurrentMode () const
 Return the current mode for this display. More...
 
Bool setMode (const DisplayMode &newMode)
 Attempt to change the display's current mode to the specified mode. More...
 
Bool setBestMode (const DisplayMode &newMode)
 Attempt to change the display's current mode to the valid mode closest to the specified mode. More...
 
Bool capture ()
 Attempt to capture this display for exclusive use by the application. More...
 
void release ()
 Release this display if it was previously captured by the application. More...
 
Bool isCaptured () const
 Return whether or not this display is currently captured for exclusive use by the application. More...
 
Size getWidth () const
 Return the horizontal size in pixels of this display. More...
 
Size getHeight () const
 Return the vertical size in pixels of this display. More...
 
math::Size2D getSize () const
 Return a 2D vector indicating the size in pixels of this display. More...
 
Bool setSize (const math::Size2D &newSize)
 Attempt to change the size in pixels of this display. More...
 
Bool setSize (Size width, Size height)
 Attempt to change the size in pixels of this display. More...
 
Double getRefreshRate () const
 Return the frequency of this display's refresh rate, in frames per second (Hz). More...
 
Bool setRefreshRate (Double newRefreshRate)
 Attempt to change the refresh rate of this display. More...
 
Size getBitsPerPixel () const
 Return number of bits used to represent each pixel of this display's current mode. More...
 
Bool setBitsPerPixel (Size newBitsPerPixel)
 Attempt to change the bit depth of this display. More...
 
Bool isValid () const
 Return whether or not this display object represents a valid physical video display. More...
 
Bool isMain () const
 Return whether or not this display is the main display for the system. More...
 
DisplayID getID () const
 Return a display ID which uniquely identifies this display on this system. More...
 
data::UTF8String getName () const
 Return a human-readable name for this display. More...
 

Static Public Member Functions

static Size getCount ()
 Return the total number of displays that are connected to the system. More...
 
static DisplayID getID (Index displayIndex)
 Return an ID representing the display connected to the system at the specified index. More...
 
static DisplayID getMainID ()
 Return the ID of the display which represents the main video display for the system. More...
 

Detailed Description

A class that represents an interface to a single connected video display.

This class allows the user to query available displays, their supported modes, and allows the user to change display parameters such as size (resolution) and bit depth.

Constructor & Destructor Documentation

om::system::Display::Display ( DisplayID  newDisplayID)

Create a display object that interfaces with the physical display with the specified ID.

om::system::Display::~Display ( )

Destroy this display object and release all state associated with it.

Destructing a display object does not effect the physical display device.

Member Function Documentation

Size om::system::Display::getModeCount ( ) const

Return the number of valid modes there are for this display.

DisplayMode om::system::Display::getMode ( Index  modeIndex) const

Return the mode for this display at the specified index.

DisplayMode om::system::Display::getCurrentMode ( ) const

Return the current mode for this display.

Bool om::system::Display::setMode ( const DisplayMode newMode)

Attempt to change the display's current mode to the specified mode.

This method synchronously changes the mode of this display and won't return until the mode change is complete. If the method can't find a display mode for this display that matches the specified mode, FALSE is returned and the display's mode is not changed. Otherwise, TRUE is returned and the display's mode is changed to the specified mode.

Bool om::system::Display::setBestMode ( const DisplayMode newMode)

Attempt to change the display's current mode to the valid mode closest to the specified mode.

This method synchronously changes the mode of this display and won't return until the mode change is complete. If the method can't find a display mode for this display that is close to the specified mode, FALSE is returned and the display's mode is not changed. Otherwise, TRUE is returned and the display's mode is changed.

Bool om::system::Display::capture ( )

Attempt to capture this display for exclusive use by the application.

The method returns whether or not the capture operation was successful. Capturing the display prevents other applications from detecting that the display mode has changed and will keep their windows from being resized. One should always call this method when changing the display's size as a courtesy to other applications.

void om::system::Display::release ( )

Release this display if it was previously captured by the application.

The method returns whether or not the capture operation was successful.

Bool om::system::Display::isCaptured ( ) const

Return whether or not this display is currently captured for exclusive use by the application.

Size om::system::Display::getWidth ( ) const
inline

Return the horizontal size in pixels of this display.

Size om::system::Display::getHeight ( ) const
inline

Return the vertical size in pixels of this display.

math::Size2D om::system::Display::getSize ( ) const

Return a 2D vector indicating the size in pixels of this display.

Bool om::system::Display::setSize ( const math::Size2D newSize)

Attempt to change the size in pixels of this display.

The display chooses the available display mode with the size closest to the given size and changes the display to that size. If this operation is successful, TRUE is returned. Otherwise, no size change is performed and FALSE is returned.

This method may change other display attributes like the refresh rate, but it will use the display mode that most closely matches the current values of those attributes while satisfying the size requirement.

Bool om::system::Display::setSize ( Size  width,
Size  height 
)
inline

Attempt to change the size in pixels of this display.

The display chooses the available display mode with the size closest to the given size and changes the display to that size. If this operation is successful, TRUE is returned. Otherwise, no size change is performed and FALSE is returned.

This method may change other display attributes like the refresh rate, but it will use the display mode that most closely matches the current values of those attributes while satisfying the size requirement.

Double om::system::Display::getRefreshRate ( ) const

Return the frequency of this display's refresh rate, in frames per second (Hz).

Bool om::system::Display::setRefreshRate ( Double  newRefreshRate)

Attempt to change the refresh rate of this display.

The display chooses the available display mode with the refresh rate closest to the given one and changes the display to that refresh rate. If this operation is successful, TRUE is returned. Otherwise, no refresh rate change is performed and FALSE is returned.

Size om::system::Display::getBitsPerPixel ( ) const

Return number of bits used to represent each pixel of this display's current mode.

Bool om::system::Display::setBitsPerPixel ( Size  newBitsPerPixel)

Attempt to change the bit depth of this display.

The display chooses the available display mode with the bit depth closest to the given one and changes the display to that bit depth. If this operation is successful, TRUE is returned. Otherwise, no bit depth change is performed and FALSE is returned.

Bool om::system::Display::isValid ( ) const

Return whether or not this display object represents a valid physical video display.

Bool om::system::Display::isMain ( ) const

Return whether or not this display is the main display for the system.

DisplayID om::system::Display::getID ( ) const

Return a display ID which uniquely identifies this display on this system.

data::UTF8String om::system::Display::getName ( ) const

Return a human-readable name for this display.

static Size om::system::Display::getCount ( )
static

Return the total number of displays that are connected to the system.

static DisplayID om::system::Display::getID ( Index  displayIndex)
static

Return an ID representing the display connected to the system at the specified index.

static DisplayID om::system::Display::getMainID ( )
static

Return the ID of the display which represents the main video display for the system.


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