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/C++ v10.0 : C library - <b>synopsis:</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <graph.h>
    short _FAR _setwindow( short invert,
                           double x1, double y1,
                           double x2, double y2 );

Description:
    The _setwindow function defines a window for the window coordinate
    system.  Window coordinates are specified as a user-defined range of
    values.  This allows for consistent pictures regardless of the video
    mode.

    The window is defined as the region with opposite corners established by
    the points (x1,y1) and (x2,y2).  The argument invert specifies the
    direction of the y-axis.  If the value is non-zero, the y values
    increase from the bottom of the screen to the top, otherwise, the y
    values increase as you move down the screen.

    The window defined by the _setwindow function is displayed in the
    current viewport.  A viewport is defined by the  _setviewport function.

    By default, the window coordinate system is defined with the point
    (0.0,0.0) located at the lower left corner of the screen, and the point
    (1.0,1.0) at the upper right corner.

Returns:
    The _setwindow function returns a non-zero value when the window is set
    successfully; otherwise, zero is returned.

See Also:
    _setviewport

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

    main()
    {
        _setvideomode( _MAXRESMODE );
        draw_house( "Default window" );
        _setwindow( 1, -0.5, -0.5, 1.5, 1.5 );
        draw_house( "Larger window" );
        _setwindow( 1, 0.0, 0.0, 0.5, 1.0 );
        draw_house( "Left side" );
        _setvideomode( _DEFAULTMODE );
    }

    draw_house( char *msg )
    {
        _clearscreen( _GCLEARSCREEN );
        _outtext( msg );
        _rectangle_w( _GBORDER, 0.2, 0.1, 0.8, 0.6 );
        _moveto_w( 0.1, 0.5 );
        _lineto_w( 0.5, 0.9 );
        _lineto_w( 0.9, 0.5 );
        _arc_w( 0.4, 0.5, 0.6, 0.3, 0.6, 0.4, 0.4, 0.4 );
        _rectangle_w( _GBORDER, 0.4, 0.1, 0.6, 0.4 );
        getch();
    }

Classification:
    PC Graphics

Systems:
    DOS, QNX

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