^- /* Listing #7 */ #include #include #include #include #include struct IntuitionBase *IntuitionBase; struct GfxBase *GfxBase; struct Screen *ekran; ULONG modeid=DEFAULT_MONITOR_ID | HIRES_KEY; UWORD tabpens[]={(UWORD)~0}; int main(int argc, char *argv[]) { check_os(OS_20); if (!(IntuitionBase=(struct IntuitionBase*)OpenLibrary("intuition.library", 37))) return 20; if (!(GfxBase=(struct GfxBase*)OpenLibrary("graphics.library", 37))) { CloseLibrary((struct Library*)IntuitionBase); return 20; } if (argc>1) modeid=strtoul(argv[1], 0, 0); /* Konwersja na wartoôê liczbowâ */ if (!ModeNotAvailable(modeid)) if (ekran=OpenScreenTags(0, SA_Depth, 2, SA_Title, "LISTING7", SA_Type, PUBLICSCREEN, SA_PubName, "LISTING7", SA_DisplayID, modeid, SA_Pens, tabpens, TAG_DONE)) { PubScreenStatus(ekran, 0); for (;;) { printf("Naciônij RETURN, aby zamknâê ekran...\n"); getchar(); if (CloseScreen(ekran)) break; printf("Zamknij wszystkie okna znajdujâce sië na ekranie!\n"); } } else printf("Nie mogë otworzyê ekranu!\n"); else printf("Podano nieznany identyfikator trybu wyôwietlania!\n"); CloseLibrary((struct Library*)GfxBase); CloseLibrary((struct Library*)IntuitionBase); return 0; }