2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
6 #include <graphics/gfxbase.h>
7 #include <intuition/screens.h>
8 #include <hidd/graphics.h>
9 #include <proto/intuition.h>
10 #include <proto/oop.h>
14 OOP_AttrBase HiddBitMapAttrBase
;
15 OOP_AttrBase HiddSyncAttrBase
;
17 static void PrintMode(HIDDT_ModeID m
, OOP_Object
*sync
, OOP_Object
*pixfmt
)
19 STRPTR desc
= "No description";
21 if (m
== vHidd_ModeID_Invalid
)
25 OOP_GetAttr(sync
, aHidd_Sync_Description
, (IPTR
*)&desc
);
30 printf("ModeID: 0x%08lX %s\n", m
, desc
);
38 HiddBitMapAttrBase
= OOP_ObtainAttrBase(IID_Hidd_BitMap
);
39 if (!HiddBitMapAttrBase
) {
40 printf("Failed to obtain IID_Hidd_BitMap\n");
44 HiddSyncAttrBase
= OOP_ObtainAttrBase(IID_Hidd_Sync
);
45 if (!HiddSyncAttrBase
) {
46 printf("Failed to obtain IID_Hidd_Sync\n");
47 OOP_ReleaseAttrBase(IID_Hidd_BitMap
);
51 scr
= LockPubScreen(NULL
);
54 printf("Failed to lock default public screen\n");
55 OOP_ReleaseAttrBase(IID_Hidd_Sync
);
56 OOP_ReleaseAttrBase(IID_Hidd_BitMap
);
60 bm
= scr
->RastPort
.BitMap
;
63 OOP_Object
*bmobj
= HIDD_BM_OBJ(bm
);
64 OOP_Object
*gfxhidd
= NULL
;
66 OOP_GetAttr(bmobj
, aHidd_BitMap_GfxHidd
, (IPTR
*)&gfxhidd
);
71 OOP_Object
*sync
, *pixfmt
;
73 printf("Checking QueryModeIDs()...\n");
74 modes
= HIDD_Gfx_QueryModeIDs(gfxhidd
, NULL
);
76 HIDDT_ModeID
*m
= modes
;
81 if ((*m
== vHidd_ModeID_Invalid
) ||
82 HIDD_Gfx_GetMode(gfxhidd
, *m
, &sync
, &pixfmt
))
83 PrintMode(*m
, sync
, pixfmt
);
85 printf("ModeID 0x%08lX GetMode() failed\n", *m
);
86 } while (*m
++ != vHidd_ModeID_Invalid
);
88 HIDD_Gfx_ReleaseModeIDs(gfxhidd
, modes
);
90 printf("Failed to obtain ModeID list\n");
92 printf("Checking NextModeID()...\n");
93 mode
= vHidd_ModeID_Invalid
;
98 mode
= HIDD_Gfx_NextModeID(gfxhidd
, mode
, &sync
, &pixfmt
);
99 PrintMode(mode
, sync
, pixfmt
);
100 } while (mode
!= vHidd_ModeID_Invalid
);
103 printf("Public screen bitmap does not have aHidd_BitMap_GfxHidd, weird\n");
105 printf("Public screen bitmap is not a HIDD bitmap, unsupported for now\n");
107 UnlockPubScreen(NULL
, scr
);
108 OOP_ReleaseAttrBase(IID_Hidd_Sync
);
109 OOP_ReleaseAttrBase(IID_Hidd_BitMap
);