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>
    struct xycoord _FAR _getviewcoord( short x, short y );

    struct xycoord _FAR _getviewcoord_w( double x, double y );

    struct xycoord _FAR _getviewcoord_wxy(
                        struct _wxycoord _FAR *p );

Description:
    The _getviewcoord functions translate a point from one coordinate system
    to viewport coordinates.  The _getviewcoord function translates the
    point (x,y) from physical coordinates.  The _getviewcoord_w and
    _getviewcoord_wxy functions translate the point from the window
    coordinate system.

    Viewport coordinates are defined by the  _setvieworg and  _setviewport
    functions.  Window coordinates are defined by the  _setwindow function.

    Note:  In previous versions of the software, the _getviewcoord function
    was called _getlogcoord.

Returns:
    The _getviewcoord functions return the viewport coordinates, as an
    xycoord structure, of the given point.

See Also:
    _getphyscoord, _setvieworg, _setviewport, _setwindow

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

    main()
    {
        struct xycoord pos1, pos2;

        _setvideomode( _VRES16COLOR );
        _setvieworg( rand() % 640, rand() % 480 );
        pos1 = _getviewcoord( 0, 0 );
        pos2 = _getviewcoord( 639, 479 );
        _rectangle( _GBORDER, pos1.xcoord, pos1.ycoord,
                              pos2.xcoord, pos2.ycoord );
        getch();
        _setvideomode( _DEFAULTMODE );
    }

Classification:
    PC Graphics

Systems:
     _getviewcoord - DOS, QNX

    _getviewcoord_w - DOS, QNX
    _getviewcoord_wxy - DOS, QNX

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