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>_setvisualpage() set memory area for displaying pages</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 _setvisualpage()        Set memory area for displaying pages

 #include   <graph.h>

 short far _setvisualpage(page);
  short page;       Video memory page number

    _setvisualpage() selects the video memory page to display on the
    monitor. Images can be written to an active page while the viewer is
    looking at another page, then the displayed page can be switched with
    the newly redrawn page to present a screen update that appears to be
    instantaneous. The page argument establishes the current visual page
    (the default page is 0).

       Returns:     If successful, _setvisualpage() returns the page
                    number of the previous visual page. If unsuccessful,
                    it returns a negative number.

         Notes:     If you display one page while graphics routines write
                    to a different page, then use _setvisualpage() to
                    switch between them, screen updates will appear to be
                    instantaneous. This technique will permit screen
                    animation effects.

                    The MA adapter does not support multiple pages. The
                    CGA adapter supports multiple pages in text mode
                    only. The EGA, MCGA, and VGA adapters will support
                    multiple graphics pages if sufficient memory is
                    installed. You will need to test the amount of
                    available memory at runtime using the struct
                    videoconfig memory member, since if a routine writes
                    outside the range of the available buffer the image
                    will be lost.

                    Text which accompanies graphic images can also be
                    written to the active page while displaying a
                    different visual page if you use the text functions
                    _outtext(), _settextposition(), _gettextposition(),
                    _settextcolor(), _gettextcolor(), _settextwindow(),
                    and _wrapon() instead of the standard C I/O functions
                    (which do not recognize multiple pages).

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

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

    This program writes an image to an active page then displays the new
    page to simulate a moving ellipse

           #include <graph.h>

           main()
           {
              short i;
              short page = 1;
              _setvideomode( _MRES16COLOR );

              . . . test EGA or VGA video buffer for sufficient memory . . .

              for ( i = 0; i < 85; i += 5)
                 {
                 _setactivepage( page );
                 _ellipse( _GFILLINTERIOR, 40 + i, 10 + i,
                           200 + i, 110 + i );
                 page = _setvisualpage( page );
                 }

              _setvideomode( _DEFAULTMODE );
           }


See Also: _setactivepage() _setvideomode() _settextposition()

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