_setvideomoderows

Description

Sets the video mode and number of text rows for text modes.

#include <graph.h>

short __far _setvideomoderows( short mode, short rows );

mode Desired mode  
rows Number of text rows  

Remarks

The _setvideomoderows function selects a screen mode for a particular hardware/display combination. The manifest constants for the screen mode are given in the reference pages for _setvideomode. The _setvideomoderows function also specifies the number of text rows to be used in a text mode. If the constant _MAXTEXTROWS is specified for the rows argument, the _setvideomoderows function will choose the maximum number of rows available. In text modes, this is 50 rows on VGA, 43 on EGA, and 25 on others. In graphics modes that support 30 or 60 rows, _MAXTEXTROWS specifies 60 rows. In SVGA modes, _MAXTEXTROWS specifies the vertical resolution (as returned in a _videoconfig struct by the _getvideoconfig function) divided by 8.

Return Value

The _setvideomoderows function returns the numbers of rows set. The function returns 0 if an error occurred (e.g., if the mode is not supported).

Compatibility

Standards:None

16-Bit:DOS

32-Bit:None

See Also

_getvideoconfig, _settextrows, _setvideomode

Example

/* SVMROWS.C */

#include <stdlib.h>

#include <conio.h>

#include <graph.h>

void main( void )

{

struct _videoconfig config;

/* Set 43-line graphics mode if available. */

if( !_setvideomoderows( _ERESCOLOR, 43 ) )

{

_outtext( "EGA or VGA required" );

exit( 1 );

}

_getvideoconfig( &config );

/* Set logical origin to center and draw a rectangle. */

_setlogorg( config.numxpixels / 2 - 1, config.numypixels / 2 - 1 );

_rectangle( _GBORDER, -80, -50, 80, 50 );

_getch();

_setvideomode( _DEFAULTMODE );

exit( 0 );

}