2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
6 #include <cybergraphx/cybergraphics.h>
7 #include <graphics/displayinfo.h>
8 #include <hidd/graphics.h>
9 #include <proto/cybergraphics.h>
10 #include <proto/exec.h>
11 #include <proto/graphics.h>
12 #include <proto/oop.h>
17 int main(int argc
, char **argv
)
22 struct DimensionInfo info
;
23 struct Library
*OOPBase
;
24 OOP_AttrBase HiddPixFmtAttrBase
;
27 printf("Usage: %s <modeid>\n", argv
[0]);
31 modeid
= strtoul(argv
[1], NULL
, 16);
33 OOPBase
= OpenLibrary("oop.library", 0);
35 printf("Failed to open oop.library\n");
39 HiddPixFmtAttrBase
= OOP_ObtainAttrBase(IID_Hidd_PixFmt
);
40 if (!HiddPixFmtAttrBase
) {
41 printf("Failed to obtain PixFmt attribute base\n");
42 CloseLibrary(OOPBase
);
46 if (GetDisplayInfoData(NULL
, (UBYTE
*)&name
, sizeof(name
), DTAG_NAME
, modeid
) == sizeof(name
)) {
47 printf("Obtained NameInfo: %s\n", name
.Name
);
49 printf("Failed to obtain NameInfo\n");
51 iscyber
= IsCyberModeID(modeid
);
52 printf("IsCyberModeID() returns %d\n", iscyber
);
54 if (GetDisplayInfoData(NULL
, (UBYTE
*)&info
, sizeof(info
), DTAG_DIMS
, modeid
) == sizeof(info
)) {
55 OOP_Object
*pixfmt
= (OOP_Object
*)info
.reserved
[1];
58 printf("Obtained DimensionInfo\n");
60 printf("Pixelformat data:\n");
61 OOP_GetAttr(pixfmt
, aHidd_PixFmt_ColorModel
, &val
);
62 printf("Color model: %lu\n", val
);
63 OOP_GetAttr(pixfmt
, aHidd_PixFmt_RedShift
, &val
);
64 printf("Red shift: %lu\n", val
);
65 OOP_GetAttr(pixfmt
, aHidd_PixFmt_GreenShift
, &val
);
66 printf("Green shift: %lu\n", val
);
67 OOP_GetAttr(pixfmt
, aHidd_PixFmt_BlueShift
, &val
);
68 printf("Blue shift: %lu\n", val
);
69 OOP_GetAttr(pixfmt
, aHidd_PixFmt_AlphaShift
, &val
);
70 printf("Alpha shift: %lu\n", val
);
71 OOP_GetAttr(pixfmt
, aHidd_PixFmt_RedMask
, &val
);
72 printf("Red mask: 0x%08lX\n", val
);
73 OOP_GetAttr(pixfmt
, aHidd_PixFmt_GreenMask
, &val
);
74 printf("Green mask: 0x%08lX\n", val
);
75 OOP_GetAttr(pixfmt
, aHidd_PixFmt_BlueMask
, &val
);
76 printf("Blue mask: 0x%08lX\n", val
);
77 OOP_GetAttr(pixfmt
, aHidd_PixFmt_AlphaMask
, &val
);
78 printf("Alpha mask: 0x%08lX\n", val
);
79 OOP_GetAttr(pixfmt
, aHidd_PixFmt_Depth
, &val
);
80 printf("Depth: %lu\n", val
);
81 OOP_GetAttr(pixfmt
, aHidd_PixFmt_BitsPerPixel
, &val
);
82 printf("Bits per pixel: %lu\n", val
);
83 OOP_GetAttr(pixfmt
, aHidd_PixFmt_BytesPerPixel
, &val
);
84 printf("Bytes per pixel: %lu\n", val
);
85 OOP_GetAttr(pixfmt
, aHidd_PixFmt_StdPixFmt
, &val
);
86 printf("Pixelformat code: %lu\n", val
);
87 OOP_GetAttr(pixfmt
, aHidd_PixFmt_CLUTMask
, &val
);
88 printf("Palette mask: 0x%08lX\n", val
);
89 OOP_GetAttr(pixfmt
, aHidd_PixFmt_CLUTShift
, &val
);
90 printf("Palette shift: %lu\n", val
);
91 OOP_GetAttr(pixfmt
, aHidd_PixFmt_BitMapType
, &val
);
92 printf("Bitmap type: %lu\n", val
);
94 printf("Failed to obtain DimensionInfo\n");
96 OOP_ReleaseAttrBase(IID_Hidd_PixFmt
);
97 CloseLibrary(OOPBase
);