home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / magazine / drdobbs / 1990 / 01 / zgtest.c < prev   
C/C++ Source or Header  |  1989-10-28  |  2KB  |  59 lines

  1. #include "zg_lwlvl.h"
  2.  
  3. int main(void);
  4.  
  5. int main(void)
  6.     {
  7.     int x, y, c;
  8.  
  9.     if (ZG_Init())
  10.         return 1;
  11.  
  12.     if (ZG_SetMode(ZG_MOD_BESTRES))
  13.         return 2;
  14.  
  15.     for (x = 0; x < ZG_VideoInfo.Xwidth; ++x)
  16.         for (y = 0; y < ZG_VideoInfo.Ylength; ++y)
  17.             ZG_PlotPixel(x, y, (x % ZG_VideoInfo.NoColors));
  18.  
  19.     ZG_SetPixelMode(ZG_PXL_XOR);
  20.  
  21.     for (x = 0; x < ZG_VideoInfo.Xwidth; ++x)
  22.         for (y = 0; y < ZG_VideoInfo.Ylength; ++y)
  23.             ZG_PlotPixel(x, y, ZG_VideoInfo.NoColors - (x % ZG_VideoInfo.NoColors));
  24.  
  25.     for (x = 0; x < ZG_VideoInfo.Xwidth; ++x)
  26.         for (y = 0; y < ZG_VideoInfo.Ylength; ++y)
  27.             ZG_PlotPixel(x, y, ZG_VideoInfo.NoColors - (x % ZG_VideoInfo.NoColors));
  28.  
  29.     if (ZG_SetMode(ZG_MOD_MOSTCOLOR))
  30.         return 3;
  31.  
  32.     ZG_SetPixelMode(ZG_PXL_SET);
  33.  
  34.     for (x = 0; x < ZG_VideoInfo.Xwidth; ++x)
  35.         for (y = 0; y < ZG_VideoInfo.Ylength; ++y)
  36.             ZG_PlotPixel(x, y, (x % ZG_VideoInfo.NoColors));
  37.  
  38.     ZG_SetPixelMode(ZG_PXL_XOR);
  39.  
  40.     for (x = 0; x < ZG_VideoInfo.Xwidth; ++x)
  41.         for (y = 0; y < ZG_VideoInfo.Ylength; ++y)
  42.             ZG_PlotPixel(x, y, ZG_VideoInfo.NoColors - (x % ZG_VideoInfo.NoColors));
  43.  
  44.     for (x = 0; x < ZG_VideoInfo.Xwidth; ++x)
  45.         for (y = 0; y < ZG_VideoInfo.Ylength; ++y)
  46.             ZG_PlotPixel(x, y, ZG_VideoInfo.NoColors - (x % ZG_VideoInfo.NoColors));
  47.  
  48.     ZG_PlotPixel(10, 10, ZG_VideoInfo.NoColors - 1);
  49.  
  50.     c = ZG_ReadPixel(10, 10);
  51.  
  52.     ZG_Done();
  53.  
  54.     if (c != (ZG_VideoInfo.NoColors - 1))
  55.         return 4;
  56.  
  57.     return 0;
  58.     }
  59.