Controlling Video Modes

The functions described below affect the current video mode, coordinate systems, clipping regions, viewports, and windows. For more information, use Help.

_clearscreen

Erases the text or graphics screen and fills it with the current background color (note that setting the video mode automatically clears the screen). Pass one of the constants _GCLEARSCREEN, _GVIEWPORT, or _GWINDOW. No return value.

_getphyscoord

Converts viewport coordinates to physical coordinates. Pass an x and y coordinate from the viewport. The function returns an _xycoord structure, which includes an x and a y position from the physical screen.

_getvideoconfig

Obtains the status of the current graphics environment. Pass it the address of a structure of type _videoconfig. See “Reading the _videoconfig Structure”.

_getviewcoord

Converts physical coordinates to viewport coordinates. Pass two integers: an x and y coordinate. The function returns an _xycoord structure containing the equivalent position within the viewport.

_getviewcoord_w

Converts window coordinates to viewport coordinates. Pass two doubles that name points within the window. Returns the equivalent viewport coordinates as an _xycoord structure.

_getviewcoord_wxy

Converts window coordinates to viewport coordinates in an _xycoord structure. Pass a _wxycoord structure.

_getwindowcoord

Converts viewport coordinates to window coordinates. Pass two integers representing viewport coordinates. Returns a _wxycoord structure.

_setcliprgn

Limits graphic output to part of the screen, called the “clipping region.” Pass four values: the x and y coordinate of the upper-left corner (on the physical screen) and the coordinates of the lower-right corner. The default clipping region is the entire screen. See “Physical Coordinates”.

_setvideomode

Selects an operating mode for the display screen. Pass a constant, such as _HRES16COLOR. Returns 0 if the video mode selected is not supported by the hardware. See “Setting a Video Mode”.

_setvideomoderows

Sets the video mode and the number of rows for text operations. Pass two values: a video mode and the desired number of text rows (25, 30, 43, 50, or 60). Pass the symbolic constant _MAXTEXTROWS to get the largest available number of rows. Returns the number of rows or 0 if unsuccessful.

_setvieworg

Repositions the viewport origin. Pass an x and y position: the physical screen location that will become the new origin. Returns the previous origin in an _xycoord structure.

_setviewport

Creates a viewport, including a clipping region and a new origin in the upper-left corner of the viewport. Subsequent calls to graphics routines will be limited to the viewport area. Pass four short integers that indicate the physical screen locations of the x and y coordinates in the upper-left and lower-right corners of the viewport. No return value.

_setwindow

Defines a window coordinate system. Pass five values: a short invert flag (TRUE or FALSE) and four doubles that represent the extreme values in the upper-left and lower-right portions of the current viewport. See “Window Coordinates”.