Metropoli BBS
VIEWER: wgt10.c MODE: TEXT (ASCII)
/*
==============================================================================
                      WordUp Graphics Toolkit Version 5.0                     
                             Demonstration Program 10                         
                                                                              
 Shows the difference between normal and xray putblock modes                 
 and demonstrates the flipblock procedure.                                   
                                                                              
 *** PROJECT ***                                                             
 This program requires the file WGT5_WC.LIB to be linked.                    
                                                                              
 *** DATA FILES ***                                                          
 NONE                                                                        
                                                           WATCOM C++ VERSION 
==============================================================================
*/

#include <wgt5.h>


void main(void)
{
  short i,x,y;
  short oldmode;
  color palette[256];
  block part1;                    /* part of the screen */
  
  printf ("WGT Example #10\n\n");
  printf ("This program will use wflipblock to paste a bitmap onto the screen in various.\n");
  printf ("orientations. Press a key to advance to the next image each time.\n");
  printf ("\n\nPress any key to continue.\n");
  getch ();

  if ( !vgadetected () )
  {
    printf("Error - VGA card required for any WGT program.\n");
    exit (0);
  }
  oldmode = wgetmode ();
  vga256 ();

  for (y = 40; y >= 4; y--)
  {
    wfill_circle (y + 40, y + 10, y);      /* draw a pattern */
    wsetcolor (y + 20);
  }

  part1 = wnewblock (0, 0, 160, 100);       /* get the circle in a block */
  wcls (0);

  for (x = 0; x < 320; x++)
  {
    wsetcolor (x);
    wline (x, 0, x, 199);
  }

  getch ();
  wputblock (160, 0, part1, 0);             /* normal mode */
  wflipblock (part1, 0);

  getch ();
  wputblock (160, 100, part1, 1);           /* XRAY mode */
  wflipblock (part1, 1);

  getch ();
  wputblock (0, 100, part1, 0);             /* normal mode */
  wflipblock (part1, 0);

  getch ();
  wputblock(0, 0, part1, 1);               /* XRAY mode */

  getch ();
  wfreeblock (part1);
  wsetmode (oldmode);
}
[ RETURN TO DIRECTORY ]