home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1997 #3 / amigamamagazinepolishissue03-1 / ma_1995 / 09 / ami931a.txt < prev    next >
Text File  |  1997-04-07  |  1KB  |  121 lines

  1. ^-
  2. <l>
  3. /* Listing #7 */
  4.  
  5.  
  6.  
  7. #include <intuition/intuition.h>
  8.  
  9.  
  10.  
  11. #include <proto/exec.h>
  12.  
  13. #include <proto/graphics.h>
  14.  
  15. #include <proto/intuition.h>
  16.  
  17.  
  18.  
  19. #include <stdio.h>
  20.  
  21.  
  22.  
  23. struct IntuitionBase *IntuitionBase;
  24.  
  25. struct GfxBase *GfxBase;
  26.  
  27.  
  28.  
  29. struct Screen *ekran;
  30.  
  31.  
  32.  
  33. ULONG modeid=DEFAULT_MONITOR_ID | HIRES_KEY;
  34.  
  35.  
  36.  
  37. UWORD tabpens[]={(UWORD)~0};
  38.  
  39.  
  40.  
  41. int main(int argc, char *argv[])
  42.  
  43. {
  44.  
  45.     check_os(OS_20);
  46.  
  47.     if (!(IntuitionBase=(struct IntuitionBase*)OpenLibrary("intuition.library", 37)))
  48.  
  49.         return 20;
  50.  
  51.     if (!(GfxBase=(struct GfxBase*)OpenLibrary("graphics.library", 37)))
  52.  
  53.     {
  54.  
  55.         CloseLibrary((struct Library*)IntuitionBase);
  56.  
  57.         return 20;
  58.  
  59.     }
  60.  
  61.     if (argc>1)
  62.  
  63.         modeid=strtoul(argv[1], 0, 0); /* Konwersja na wartoôê liczbowâ */
  64.  
  65.     if (!ModeNotAvailable(modeid))
  66.  
  67.         if (ekran=OpenScreenTags(0,
  68.  
  69.         SA_Depth, 2,
  70.  
  71.         SA_Title, "LISTING7",
  72.  
  73.         SA_Type, PUBLICSCREEN,
  74.  
  75.         SA_PubName, "LISTING7",
  76.  
  77.         SA_DisplayID, modeid,
  78.  
  79.         SA_Pens, tabpens,
  80.  
  81.         TAG_DONE))
  82.  
  83.         {
  84.  
  85.             PubScreenStatus(ekran, 0);
  86.  
  87.             for (;;)
  88.  
  89.             {
  90.  
  91.                 printf("Naciônij RETURN, aby zamknâê ekran...\n");
  92.  
  93.                 getchar();
  94.  
  95.                 if (CloseScreen(ekran))
  96.  
  97.                     break;
  98.  
  99.                 printf("Zamknij wszystkie okna znajdujâce sië na ekranie!\n");
  100.  
  101.             }
  102.  
  103.         }
  104.  
  105.         else
  106.  
  107.             printf("Nie mogë otworzyê ekranu!\n");
  108.  
  109.     else
  110.  
  111.         printf("Podano nieznany identyfikator trybu wyôwietlania!\n");
  112.  
  113.     CloseLibrary((struct Library*)GfxBase);
  114.  
  115.     CloseLibrary((struct Library*)IntuitionBase);
  116.  
  117.     return 0;
  118.  
  119. }
  120.  
  121.