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>setactivepage() set active page</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 setactivepage()         Set Active Page

 #include   <graphics.h>

 void far   setactivepage(pnum);
 int        pnum;

    setactivepage() selects which screen page 'pnum' is the active one;
    ie., where program graphics are to be placed.  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: setvisualpage() initgraph()

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