Home Contents | # gcx:displayGeometry | Graphics | Core4 Lua Commands

## SYNOPSIS

width, height, bpp, hz = gcx:displayGeometry([width, height[, bpp[, hz]]])

## DESCRIPTION

This function is used to query and control the display resolution, color depth and refresh rate.

gcx must be a valid framebuffer handle obtained with gfx.open().

Changing the resolution and refresh rate is only possible for displays that are controlled through a DVI cable.

When called without arguments, the function returns the current settings.

The width and height always present the physical display size, without taking the orientation setting into account.

Where possible, the function will check that the display can handle the requested resolution and will reject the attempt if found to be false.

## RETURN VALUE

On success, returns four values which reflect the current settings of the attached display: width and height, the bits per pixel value bpp and finally the refresh rate hz.

When a DVI display is unplugged or powered off, just returns nil.

On failure, returns three values: nil, a string describing the error (The result of the C library call strerror() on the errno code) and the errno number from the standard C library.

## NOTES

Only DVI cables are allowed to be unplugged while the controller is powered on. Displays that are connected directly to the controller must never be attached or removed while under power.

## SEE ALSO

Introduction to DVI support
gfx.open(), gcx:backplaneVersion(), gcx:edid(), gcx:linkState(), gcx:orientation()