ppc-sam440: Use Write-Through caching for main memory.
[AROS.git] / test / monitorclass.c
blob34f154b98360b276c57f72128ee2c78abb7e349a
1 #include <cybergraphx/cybergraphics.h>
2 #include <intuition/monitorclass.h>
4 #include <proto/alib.h>
5 #include <proto/intuition.h>
7 #include <stdio.h>
9 static STRPTR pfnames[] =
11 "LUT8",
12 "RGB15",
13 "BGR15",
14 "RGB15PC",
15 "BGR15PC",
16 "RGB16",
17 "BGR16",
18 "RGB16PC",
19 "BGR16PC",
20 "RGB24",
21 "BGR24",
22 "ARGB32",
23 "BGRA32",
24 "RGBA32"
27 static UBYTE depths[] = {8, 15, 16, 24, 32, 0};
29 int main(void)
31 Object **monitors, **mon;
33 monitors = GetMonitorList(NULL);
35 if (!monitors)
37 printf("Failed to obtain monitors list!\n");
38 return 0;
41 for (mon = monitors; *mon; mon++)
43 STRPTR name, drvname;
44 ULONG *pfs;
45 UBYTE i;
47 GetAttr(MA_MonitorName, *mon, (IPTR *)&name);
48 GetAttr(MA_DriverName, *mon, (IPTR *)&drvname);
49 printf("Monitor %p %s %s\n", *mon, name, drvname);
51 printf("Supported pixelformats:\n");
52 GetAttr(MA_PixelFormats, *mon, (IPTR *)&pfs);
53 for (i = PIXFMT_LUT8; i <= PIXFMT_RGBA32; i++)
54 printf(" %7s %s\n", pfnames[i], pfs[i] ? "yes" : "no");
56 printf("Preferred pixelformats:\n");
57 for (i = 0; depths[i]; i++)
59 IPTR pf;
61 printf(" %2d ", depths[i]);
62 DoMethod(*mon, MM_GetDefaultPixelFormat, depths[i], (IPTR *)&pf);
64 if (pf <= PIXFMT_RGBA32)
65 printf("%s\n", pfnames[pf]);
66 else if (pf == -1)
67 printf("Not supported\n");
68 else
69 printf("Unknown (%ld)\n", pf);
71 printf("\n");
74 FreeMonitorList(monitors);
75 return 0;