Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Microsoft C 6.0 - <b>_setvieworg() set the viewpoint origin</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 _setvieworg()           Set the viewpoint origin

 #include   <graph.h>

 struct xycoord far _setvieworg(x, y);
  short x;     Horizontal origin point
  short y;     Vertical origin point

    _setvieworg() moves the logical origin (0, 0) to the physical point
    (x, y). All other logical points move the same direction and
    distance.

       Returns:     _setvieworg() returns the physical coordinates of
                    the previous logical origin in an xycoord structure,
                    defined in graph.h:

                    struct xycoord {
                       short xcoord;    x coordinate (horizontal)
                       short ycoord;    y coordinate (vertical)
                       };

         Notes:     This function replaces _setlogorg() from Microsoft
                    C 5.1.

                    The graphics functions recognize two sets of
                    coordinates:

                    1. Physical coordinates determined by the hardware
                    and display  configuration of the user's environment.

                    2. Logical coordinates defined by the application,
                    which can be reassigned to different physical
                    coordinates.

                    Functions affected by the logical coordinates
                    translate them to the appropriate physical
                    coordinates, and vice versa.

                    The default logical coordinate system is identical to
                    the physical one. The physical origin (0, 0) is
                    always in the upper-left corner of the display.
                    Increasing physical x values move the origin from
                    left to right. Increasing physical y values move the
                    origin from top to bottom.

                    The dimensions of the x and y axes depend on the
                    available display hardware and the selected video
                    mode. These values are accessible at run time by
                    examining the numxpixels and numypixels members of
                    the videoconfig structure returned by
                    _getvideoconfig().

                    The physical coordinates of any logical point can be
                    determined using _getphyscoord(), and the logical
                    coordinates of any physical point can be determined
                    with _getviewcoord().

                    The logical and physical coordinate systems affect
                    the location of images only, and have no effect on
                    the location of text.

   Portability:     MS-DOS only, true MDPA, CGA, EGA, MCGA, or VGA video
                    compatibles

 -------------------------------- Example ---------------------------------

    This program resets the logical coordinates from the upper left
    corner to the middle of the screen.

           #include <graph.h>

           main()
           {
              struct videoconfig config;
              _setvideomode( _MRES4COLOR );
              _getvideoconfig( &config );

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

              . . . perform graphics routines . . .

              _setvideomode( _DEFAULTMODE );
           }


See Also: _getviewcoord() _getphyscoord() _getvideoconfig()

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