Manages the video display and graphics hardware.
A Display object represents a region of displayable video memory and metadata that defines the display mode. The Display is a primitive, hardware oriented interface. It is recommended that unless otherwise required, the Surface class is used to create displayable graphics regions.
The Display class consists of the following fields:
Access | Name | Type | Comment | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Bitmap | *Bitmap | Reference to the display's bitmap information. | |||||||||||||||||||||||||||||||||||||||||
The Bitmap object describes the video region that will be used for displaying graphics. It holds details on the width, height, type, number of colours and so on. The display class inherits the bitmap's attributes, so it is not necessary to retrieve a direct reference to the bitmap object in order to make adjustments. The Bitmap⇒Width and Bitmap⇒Height can be larger than the display area, but never smaller. | |||||||||||||||||||||||||||||||||||||||||||
BmpX | INT | The horizontal coordinate of the bitmap within a display. | |||||||||||||||||||||||||||||||||||||||||
BmpY | INT | The vertical coordinate of the Bitmap within a display. | |||||||||||||||||||||||||||||||||||||||||
BottomMargin | INT | In hosted mode, indicates the bottom margin of the client window. | |||||||||||||||||||||||||||||||||||||||||
If the display is hosted in a client window, the BottomMargin indicates the number of pixels between the client area and the bottom window edge. | |||||||||||||||||||||||||||||||||||||||||||
Chipset | STRING | String describing the graphics chipset. | |||||||||||||||||||||||||||||||||||||||||
This string describes the graphic card's chipset, if known. | |||||||||||||||||||||||||||||||||||||||||||
Display | STRING | String describing the display (e.g. model name of the monitor). | |||||||||||||||||||||||||||||||||||||||||
This string describes the display device that is connected to the user's graphics card. | |||||||||||||||||||||||||||||||||||||||||||
DisplayManufacturer | STRING | String describing the display manufacturer. | |||||||||||||||||||||||||||||||||||||||||
This string names the manufacturer of the user's display device. | |||||||||||||||||||||||||||||||||||||||||||
DisplayType | DT | In hosted mode, indicates the bottom margin of the client window. | |||||||||||||||||||||||||||||||||||||||||
If the display is hosted in a client window, the BottomMargin indicates the number of pixels between the client area and the bottom window edge.
| |||||||||||||||||||||||||||||||||||||||||||
Flags | SCR | Optional flag settings. | |||||||||||||||||||||||||||||||||||||||||
Optional display flags can be defined here. Post-initialisation, the only flags that can be set are
| |||||||||||||||||||||||||||||||||||||||||||
Gamma | DOUBLE [] | Contains red, green and blue values for the display's gamma setting. | |||||||||||||||||||||||||||||||||||||||||
The gamma settings for the display are stored in this field. The settings are stored in an array of 3 floating point values that represent red, green and blue colours guns. The default gamma value for each colour gun is 1.0. To modify the display gamma values, please refer to the SetGamma() and SetGammaLinear() methods. | |||||||||||||||||||||||||||||||||||||||||||
HDensity | INT | Returns the horizontal pixel density for the display. | |||||||||||||||||||||||||||||||||||||||||
Reading the HDensity field will return the horizontal pixel density for the display (pixels per inch). If the physical size of the display is unknown, a default value based on knowledge of the platform will be retuned. For standard PC's this will usually be 96. A custom density value can be enforced by setting the Reading this field always succeeds. | |||||||||||||||||||||||||||||||||||||||||||
Height | INT | Defines the height of the display. | |||||||||||||||||||||||||||||||||||||||||
This field defines the height of a display. This is known as the 'viewport' that the bitmap data is displayed through. If the height exceeds allowable limits, it will be restricted to a value that the display hardware can handle. If the display is hosted, the height reflects the internal height of the host window. On some hosted systems, the true height of the window can be calculated by reading the TopMargin and BottomMargin fields. | |||||||||||||||||||||||||||||||||||||||||||
InsideHeight | INT | Represents the internal height of the display. | |||||||||||||||||||||||||||||||||||||||||
On full-screen displays, the video data area can exceed the height of the screen display. The InsideHeight reflects the height of the video data in pixels. If this feature is not in use or is unavailable, the InsideWidth is equal to the display Height. | |||||||||||||||||||||||||||||||||||||||||||
InsideWidth | INT | Represents the internal width of the display. | |||||||||||||||||||||||||||||||||||||||||
On full-screen displays, the video data area can exceed the width of the screen display. The InsideWidth reflects the width of the video data in pixels. If this feature is not in use or is unavailable, the InsideWidth is equal to the display Width. | |||||||||||||||||||||||||||||||||||||||||||
LeftMargin | INT | In hosted mode, indicates the left-hand margin of the client window. | |||||||||||||||||||||||||||||||||||||||||
If the display is hosted in a client window, the LeftMargin indicates the number of pixels between the client area and the left window edge. | |||||||||||||||||||||||||||||||||||||||||||
Manufacturer | STRING | String describing the manufacturer of the graphics hardware. | |||||||||||||||||||||||||||||||||||||||||
The string in this field returns the name of the manufacturer that created the user's graphics card. If this information is not detectable, a | |||||||||||||||||||||||||||||||||||||||||||
MaxHScan | INT | The maximum horizontal scan rate of the display output device. | |||||||||||||||||||||||||||||||||||||||||
If the display output device supports variable refresh rates, this field will refer to the maximum horizontal scan rate supported by the device. If variable refresh rates are not supported, this field is set to zero. | |||||||||||||||||||||||||||||||||||||||||||
MaxVScan | INT | The maximum vertical scan rate of the display output device. | |||||||||||||||||||||||||||||||||||||||||
If the display output device supports variable refresh rates, this field will refer to the maximum vertical scan rate supported by the device. If variable refresh rates are not supported, this field is set to zero. | |||||||||||||||||||||||||||||||||||||||||||
MinHScan | INT | The minimum horizontal scan rate of the display output device. | |||||||||||||||||||||||||||||||||||||||||
If the display output device supports variable refresh rates, this field will refer to the minimum horizontal scan rate supported by the device. If variable refresh rates are not supported, this field is set to zero. | |||||||||||||||||||||||||||||||||||||||||||
MinVScan | INT | The minimum vertical scan rate of the display output device. | |||||||||||||||||||||||||||||||||||||||||
If the display output device supports variable refresh rates, this field will refer to the minimum vertical scan rate supported by the device. If variable refresh rates are not supported, this field is set to zero. | |||||||||||||||||||||||||||||||||||||||||||
Opacity | DOUBLE | Determines the level of translucency applied to the display (hosted displays only). | |||||||||||||||||||||||||||||||||||||||||
This field determines the translucency level applied to a display. Its support level is limited to hosted displays that support translucent windows (for example, Windows XP). The default setting is 100%, which means that the display will be solid. High values will retain the boldness of the display, while low values reduce visibility. | |||||||||||||||||||||||||||||||||||||||||||
PopOver | OBJECTID | Enables pop-over support for hosted display windows. | |||||||||||||||||||||||||||||||||||||||||
The PopOver field can be used when a display is hosted as a window. Setting the PopOver field to refer to the object ID of another display will ensure that the host window is always in front of the other display's window (assuming both windows are visible on the desktop). The | |||||||||||||||||||||||||||||||||||||||||||
PowerMode | DPMS | The display's power management method. | |||||||||||||||||||||||||||||||||||||||||
When DPMS is enabled via a call to Disable(), the DPMS method that is applied is controlled by this field. DPMS is a user configurable option and it is not recommended that the PowerMode value is changed manually.
| |||||||||||||||||||||||||||||||||||||||||||
RefreshRate | DOUBLE | This field manages the display refresh rate. | |||||||||||||||||||||||||||||||||||||||||
The value in this field reflects the refresh rate of the currently active display, if operating in full-screen mode. | |||||||||||||||||||||||||||||||||||||||||||
ResizeFeedback | FUNCTION | This field manages the display refresh rate. | |||||||||||||||||||||||||||||||||||||||||
The value in this field reflects the refresh rate of the currently active display, if operating in full-screen mode. | |||||||||||||||||||||||||||||||||||||||||||
RightMargin | INT | In hosted mode, indicates the pixel margin between the client window and right window edge. | |||||||||||||||||||||||||||||||||||||||||
Title | STRING | Sets the window title (hosted environments only). | |||||||||||||||||||||||||||||||||||||||||
TopMargin | INT | In hosted mode, indicates the pixel margin between the client window and top window edge. | |||||||||||||||||||||||||||||||||||||||||
TotalMemory | INT | The total amount of user accessible RAM installed on the video card, or zero if unknown. | |||||||||||||||||||||||||||||||||||||||||
TotalResolutions | INT | The total number of resolutions supported by the display. | |||||||||||||||||||||||||||||||||||||||||
VDensity | INT | Returns the vertical pixel density for the display. | |||||||||||||||||||||||||||||||||||||||||
Reading the VDensity field will return the vertical pixel density for the display (pixels per inch). If the physical size of the display is unknown, a default value based on knowledge of the platform will be retuned. For standard PC's this will usually be 96. A custom density value can be enforced by setting the Reading this field always succeeds. | |||||||||||||||||||||||||||||||||||||||||||
Width | INT | Defines the width of the display. | |||||||||||||||||||||||||||||||||||||||||
This field defines the width of a display. This is known as the 'viewport' that the bitmap data is displayed through. If the width exceeds allowable limits, it will be restricted to a value that the display hardware can handle. If the display is hosted, the width reflects the internal width of the host window. On some hosted systems, the true width of the window can be calculated by reading the LeftMargin and RightMargin fields. | |||||||||||||||||||||||||||||||||||||||||||
WindowHandle | APTR | Refers to a display object's window handle, if relevant. | |||||||||||||||||||||||||||||||||||||||||
This field refers to the window handle of a display object, but only if such a thing is relevant to the platform that the system is running on. Currently, this field is only usable when creating a display within an X11 window manager or Microsoft Windows. It is possible to set the WindowHandle field prior to initialisation if you want a display object to be based on a window that already exists. | |||||||||||||||||||||||||||||||||||||||||||
X | INT | Defines the horizontal coordinate of the display. | |||||||||||||||||||||||||||||||||||||||||
The X field defines the horizontal hardware coordinate for a display. This field should be set to zero unless the screen requires adjustment. Most hardware drivers and output devices do not support this feature. On hosted displays, prior to initialisation the coordinate will reflect the position of the display window when it is created. After initialisation, the coordinate is altered to reflect the absolute position of the client area of the display window. The LeftMargin can be used to determine the actual position of the host window. To adjust the position of the display, use the MoveToPoint() action rather than setting this field directly. | |||||||||||||||||||||||||||||||||||||||||||
Y | INT | Defines the vertical coordinate of the display. | |||||||||||||||||||||||||||||||||||||||||
The Y field defines the vertical hardware coordinate for a display. This field should be set to zero unless the screen requires adjustment. Most hardware drivers and output devices do not support this feature. On hosted displays, prior to initialisation the coordinate will reflect the position of the display window when it is created. After initialisation, the coordinate is altered to reflect the absolute position of the client area of the display window. The TopMargin can be used to determine the actual position of the host window. To adjust the position of the display, use the MoveToPoint() action rather than setting this field directly. |
The following actions are currently supported:
Name | Comment | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Activate | Activating a display has the same effect as calling the Show action. | |||||||||||||||
Clear | Clears a display's image data and hardware buffers (e.g. OpenGL) | |||||||||||||||
Disable | Disables the display (goes into power saving mode). | |||||||||||||||
ERR acDisable(*Object) Disabling a display will put the display into power saving mode. The DPMS mode is determined by the user's system settings and cannot be changed by the developer. The display will remain off until the Enable action is called. This action does nothing if the display is in hosted mode. Error Codes
| ||||||||||||||||
Draw | Draws object graphics to drawable areas. | |||||||||||||||
ERR acDraw(*Object, DOUBLE X, DOUBLE Y, DOUBLE Width, DOUBLE Height)
| ||||||||||||||||
Enable | Restores the screen display from power saving mode. | |||||||||||||||
Flush | Flush pending graphics operations to the display. | |||||||||||||||
Focus | Focus on this object in the user interface. | |||||||||||||||
GetKey | Retrieve formatted information from the display. | |||||||||||||||
ERR acGetKey(*Object, CSTRING Key, STRING Value, LONG Size)
| ||||||||||||||||
Hide | Hides a display from the user's view. | |||||||||||||||
ERR acHide(*Object) Calling this action will hide a display from the user's view. If the hidden display was at the front of the display and there is a display object behind it, then the next underlying display will be displayed. If there are no other displays available then the user's viewport will be blank after calling this action. | ||||||||||||||||
Move | Move the display to a new display position (relative coordinates). | |||||||||||||||
ERR acMove(*Object, DOUBLE DeltaX, DOUBLE DeltaY, DOUBLE DeltaZ)
| ||||||||||||||||
MoveToBack | Move the display to the back of the display list. | |||||||||||||||
MoveToFront | Move the display to the front of the display list. | |||||||||||||||
MoveToPoint | Move the display to a new position. | |||||||||||||||
ERR acMoveToPoint(*Object, DOUBLE X, DOUBLE Y, DOUBLE Z, MTF Flags)
The MoveToPoint action moves the display to a new position. In a hosted environment, the supplied coordinates are treated as being indicative of the absolute position of the host window (not the client area). For full-screen displays, MoveToPoint can alter the screen position for the hardware device managing the display output. This is a rare feature that requires hardware support. | ||||||||||||||||
Redimension | Moves and resizes a display object in a single action call. | |||||||||||||||
ERR acRedimension(*Object, DOUBLE X, DOUBLE Y, DOUBLE Z, DOUBLE Width, DOUBLE Height, DOUBLE Depth)
| ||||||||||||||||
Resize | Resizes the dimensions of a display object. | |||||||||||||||
ERR acResize(*Object, DOUBLE Width, DOUBLE Height, DOUBLE Depth)
If the display is hosted, the Width and Height values will determine the size of the inside area of the window. | ||||||||||||||||
SaveImage | Saves the image of a display to a data object. | |||||||||||||||
ERR acSaveImage(*Object, OBJECTID Dest, CLASSID ClassID)
| ||||||||||||||||
SaveSettings | Saves the current display settings as the default. | |||||||||||||||
Show | Presents a display object to the user. | |||||||||||||||
ERR acShow(*Object) This method presents a display object to the user. On a hosted platform, this will result in a window appearing on screen. By default the window will be hosted within a window border which may contain regular window gadgets such as a titlebar and buttons for close, maximise and minimise operations. The position of the window is determined by the X and Y fields. In Parasol's native environment, the user's screen display will be altered to match the required resolution and the graphics of the display's Bitmap object will take up the entirety of the screen. If the In Microsoft Windows, the LeftMargin, RightMargin, TopMargin and BottomMargin fields will be updated to reflect the position of the client area within the hosted window. In X11 these field values are all set to zero. If the window is minimised at the time this action is called, the window will be restored to its original position if the code for the host platform supports this capability. The |
The following methods are currently supported:
Name | Comment | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Minimise | Minimise the desktop window hosting the display. | ||||||||||||||||||||||||||
ERR gfx::Minimise(OBJECTPTR Object) If a display is hosted in a desktop window, calling the Minimise method will perform the default minimise action on that window. On a platform such as Microsoft Windows, this would normally result in the window being minimised to the task bar. Calling Minimise on a display that is already in the minimised state may result in the host window being restored to the desktop. This behaviour is platform dependent and should be manually tested to confirm its reliability on the host platform. Error Codes
| |||||||||||||||||||||||||||
SetDisplay | Changes the current display mode. | ||||||||||||||||||||||||||
ERR gfx::SetDisplay(OBJECTPTR Object, LONG X, LONG Y, LONG Width, LONG Height, LONG InsideWidth, LONG InsideHeight, LONG BitsPerPixel, DOUBLE RefreshRate, LONG Flags)
The SetDisplay method changes the current display settings for the screen. It can alter the position and screen dimensions and the display refresh rate. The new settings are applied immediately, although minor delays are possible while the graphics card and monitor adjust to the changes. To keep any of the display settings at their current value, set the appropriate parameters to zero to leave them unchanged. Only the parameters that you set will be used. If the display parameters do not match with a valid display mode - for instance if you request a screen size of 1280x1024 and the nearest equivalent is 1024x768, the SetDisplay method will automatically adjust to match against the nearest screen size. Only the original owner of the display object is allowed to change the display settings. Error Codes
| |||||||||||||||||||||||||||
SetGamma | Sets the display gamma levels. | ||||||||||||||||||||||||||
ERR gfx::SetGamma(OBJECTPTR Object, DOUBLE Red, DOUBLE Green, DOUBLE Blue, GMF Flags)
The SetGamma method controls the gamma correction levels for the display. Gamma levels for the red, green and blue colour components can be set at floating point precision. The default gamma level for each component is 1.0; the minimum value is 0.0 and the maximum value is 100. Optional flags include If you would like to know the default gamma correction settings for a display, please refer to the Gamma field. Error Codes
| |||||||||||||||||||||||||||
SetGammaLinear | Sets the display gamma level using a linear algorithm. | ||||||||||||||||||||||||||
ERR gfx::SetGammaLinear(OBJECTPTR Object, DOUBLE Red, DOUBLE Green, DOUBLE Blue, GMF Flags)
Call SetGammaLinear() to update a target display's gamma values with a linear algorithm that takes input from Error Codes
| |||||||||||||||||||||||||||
SetMonitor | Changes the default monitor settings. | ||||||||||||||||||||||||||
ERR gfx::SetMonitor(OBJECTPTR Object, CSTRING Name, LONG MinH, LONG MaxH, LONG MinV, LONG MaxV, MON Flags)
Use the SetMonitor() method to change the settings that configure the user's monitor display. You can set the model name of the monitor and the frequencies that are supported by it. Altering the display frequencies will affect the available display resolutions, as well as the maximum allowable refresh rate. An AutoDetect option is available, which if defined will cause the display settings to be automatically detected when the desktop is loaded at startup. If it is not possible to detect the correct settings for the plugged-in display, it reverts to the default display settings. This method does not work on hosted platforms. All parameters passed to this method are optional (set a value to zero if it should not be changed). Error Codes
| |||||||||||||||||||||||||||
SizeHints | Sets the width and height restrictions for the host window (hosted environments only). | ||||||||||||||||||||||||||
ERR gfx::SizeHints(OBJECTPTR Object, LONG MinWidth, LONG MinHeight, LONG MaxWidth, LONG MaxHeight, LONG EnforceAspect)
If a display is hosted in a desktop window, it may be possible to enforce size restrictions that prevent the window from being shrunk or expanded beyond a certain size. This feature is platform dependent and Error Codes
| |||||||||||||||||||||||||||
UpdatePalette | Updates the video display palette to new colour values if in 256 colour mode. | ||||||||||||||||||||||||||
ERR gfx::UpdatePalette(OBJECTPTR Object, struct RGBPalette * NewPalette)
Call UpdatePalette() to copy a new palette to the display bitmap's internal palette. If the video display is running in 256 colour mode, the new palette colours will also be reflected in the display. This method has no visible effect on RGB pixel displays. Error Codes
| |||||||||||||||||||||||||||
WaitVBL | Waits for a vertical blank. | ||||||||||||||||||||||||||
ERR gfx::WaitVBL(OBJECTPTR Object) This method waits for the strobe to reach the vertical blank area at the bottom of the display. Not all graphics hardware will support this method. If this is the case, WaitVBL() will return immediately with Error Codes
|
Possible modes for the Display class' PowerMode field.
Name | Description |
---|---|
DPMS::DEFAULT | Use the default DPMS mode as defined by the display driver. |
DPMS::OFF | Stop sending power to the display in order to turn it off (it may not be possible to restart the display without the user's intervention). |
DPMS::STANDBY | Puts the display into standby (reduced power) mode. |
DPMS::SUSPEND | Puts the display into suspend mode (blanks the display output while maintaining normal power levels). |
Flags for GetDisplayType().
Name | Description |
---|---|
DT::GLES | The display is driven by OpenGLES. |
DT::NATIVE | The display is native (supported by internal drivers). |
DT::WINGDI | The display is driven by Microsoft Windows drivers. |
DT::X11 | The display is driven by the X Window System (X11, X.Org, XFree86) |
Flags for gamma operations.
Name | Description |
---|---|
GMF::SAVE | Save the provided settings permanently. |
Flags for the Display class SetMonitor() method.
Name | Description |
---|---|
MON::AUTO_DETECT | Monitor settings to be auto-detected on startup. |
MON::BIT_6 | The device is limited to 6-bit colour production in real terms. |
Display flags.
Name | Description |
---|---|
SCR::ALPHA_BLEND | Enables alpha channel blending (if display is hosted and 32-bit). |
SCR::AUTO_SAVE | Saves settings to the global display state when the object is freed. |
SCR::BIT_6 | Display is limited to 6-bit output per colour gun. |
SCR::BORDERLESS | If display is hosted, create it as a popup / borderless window. |
SCR::BUFFER | Set if you would like a complementing buffer in video RAM. |
SCR::COMPOSITE | Enables alpha channel blending (if display is hosted and 32-bit). |
SCR::CUSTOM_WINDOW | The display has been created with a custom window reference. |
SCR::DPMS_ENABLED | Power saving through DPMS is supported. |
SCR::FLIPPABLE | If SCR::BUFFER is used, this flag may be set by the display manager if it is possible to flip the buffer. |
SCR::GRAB_CONTROLLERS | Grab controllers for receiving input when the display has the focus. |
SCR::GTF_ENABLED | GTF frequency timings are supported. |
SCR::HOSTED | The display is a desktop hosted window. |
SCR::MAXIMISE | Special win32 flag. |
SCR::MAXSIZE | For GetDisplayInfo() only, indicates that the width and height values indicate the display's maximum size. |
SCR::NO_ACCELERATION | 2D graphics card acceleration is not available. |
SCR::POWERSAVE | Power saving is active (read-only). |
SCR::READ_ONLY | Synonym for MAXIMISE | CUSTOM_WINDOW | FLIPPABLE | GTF_ENABLED | DPMS_ENABLED | POWERSAVE | HOSTED | MAXSIZE | REFRESH | BIT_6 | VISIBLE | NO_ACCELERATION |
SCR::REFRESH | For GetDisplayInfo() only, used to indicate that a display change has recently occurred and cache refresh is required. |
SCR::VISIBLE | Set if the screen is on display. |
Class Info | |
---|---|
ID | ID_DISPLAY |
Category | Graphics |
Include | modules/display.h |
Version | 1 |