Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Borland C++ 2.x ( with Turbo C ) - <b>setvisualpage() set visual graphics page number</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 setvisualpage()         Set Visual Graphics Page Number

 #include   <graphics.h>

 void far   setvisualpage(pnum);
 int        pnum;

    setvisualpage() selects which graphics page is displayed on the
    screen. A graphics system may have anywhere from one to eight screen
    page buffers; refer to initgraph() for info relating to specific
    graphics systems. These are areas in memory where screen images are
    stored. If your system has more than one graphics page,
    setactivepage() can be used to designate one where a picture can be
    built "off-screen". When that page is selected as the visual screen,
    using setvisualpage(), that whole picture becomes the one that is
    displayed on the screen.

    Returns:    Nothing.

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

    The following statements draw a slowly expanding circle.

           #include <graphics.h>

           int gdriver = DETECT;
           int gmode;
           int x;

           main()
           {
               int i;

               initgraph(&gdriver,&gmode,"");
               x = 0;
               for (i = 0; i < 100; i++) {
                  setpage();
                  cleardevice();
                  circle(300,150,i);
                  showpage();
               }
               getch();
               cleardevice();
               closegraph();
           }

           setpage()
           {
               if (x == 0)
                   setactivepage(1);
               else if (x == 1)
                   setactivepage(0);
           }

           showpage()
           {
               if (x == 0) {
                   x = 1;
                   setvisualpage(x);
               }
               else if (x == 1) {
                   x = 0;
                   setvisualpage(x);
               }
           }


See Also: setactivepage() initgraph()

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