Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C Library Reference - <u>synopsis:</u> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <graph.h>
    void _FAR _setviewport( short x1, short y1,
                            short x2, short y2 );

Description:
    The _setviewport function restricts the display of graphics output to
    the clipping region and then sets the origin of the view coordinate
    system to be the top left corner of the region.  This region is a
    rectangle whose opposite corners are established by the physical points
    (x1,y1) and (x2,y2).

    The _setviewport function does not affect text output using the
     _outtext and  _outmem functions.  To control the location of text
    output, see the  _settextwindow function.

Returns:
    The _setviewport function does not return a value.

Example:
    #include <conio.h>
    #include <graph.h>

    #define XSIZE 380
    #define YSIZE 280

    main()
    {
        _setvideomode( _VRES16COLOR );
        _setviewport( 130, 100, 130 + XSIZE, 100 + YSIZE );
        _ellipse( _GBORDER, 0, 0, XSIZE, YSIZE );
        getch();
        _setvideomode( _DEFAULTMODE );
    }

Classification:
    PC Graphics

Systems:
    DOS, QNX

See Also:
    _setcliprgn, _setvieworg, _settextwindow, _setwindow

See Also: _setcliprgn _setvieworg

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson