add the bcm2836 peripheral base, and fix a typo
[AROS.git] / test / monitorclass.c
blobbd4a62fecdd9aa5a4ebaf219a69057b32aec2f13
1 /*
2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <cybergraphx/cybergraphics.h>
7 #include <intuition/monitorclass.h>
9 #include <proto/alib.h>
10 #include <proto/intuition.h>
12 #include <stdio.h>
14 static STRPTR pfnames[] =
16 "LUT8",
17 "RGB15",
18 "BGR15",
19 "RGB15PC",
20 "BGR15PC",
21 "RGB16",
22 "BGR16",
23 "RGB16PC",
24 "BGR16PC",
25 "RGB24",
26 "BGR24",
27 "ARGB32",
28 "BGRA32",
29 "RGBA32"
32 static UBYTE depths[] = {8, 15, 16, 24, 32, 0};
34 int main(void)
36 Object **monitors, **mon;
38 monitors = GetMonitorList(NULL);
40 if (!monitors)
42 printf("Failed to obtain monitors list!\n");
43 return 0;
46 for (mon = monitors; *mon; mon++)
48 STRPTR name, drvname;
49 ULONG *pfs;
50 UBYTE i;
52 GetAttr(MA_MonitorName, *mon, (IPTR *)&name);
53 GetAttr(MA_DriverName, *mon, (IPTR *)&drvname);
54 printf("Monitor %p %s %s\n", *mon, name, drvname);
56 printf("Supported pixelformats:\n");
57 GetAttr(MA_PixelFormats, *mon, (IPTR *)&pfs);
58 for (i = PIXFMT_LUT8; i <= PIXFMT_RGBA32; i++)
59 printf(" %7s %s\n", pfnames[i], pfs[i] ? "yes" : "no");
61 printf("Preferred pixelformats:\n");
62 for (i = 0; depths[i]; i++)
64 IPTR pf;
66 printf(" %2d ", depths[i]);
67 DoMethod(*mon, MM_GetDefaultPixelFormat, depths[i], (IPTR *)&pf);
69 if (pf <= PIXFMT_RGBA32)
70 printf("%s\n", pfnames[pf]);
71 else if (pf == -1)
72 printf("Not supported\n");
73 else
74 printf("Unknown (%ld)\n", pf);
76 printf("\n");
79 FreeMonitorList(monitors);
80 return 0;