grub2: bring back build of aros-side grub2 tools
[AROS.git] / workbench / libs / cgfx / iscybermodeid.c
blobde1a929986ac69e9cd7b26993531f2356794fa17
1 /*
2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: english
7 */
9 #include <hidd/graphics.h>
10 #include <proto/graphics.h>
11 #include <proto/oop.h>
13 #include "cybergraphics_intern.h"
14 #include "gfxfuncsupport.h"
16 /*****************************************************************************
18 NAME */
19 #include <proto/cybergraphics.h>
21 AROS_LH1(BOOL, IsCyberModeID,
23 /* SYNOPSIS */
24 AROS_LHA(ULONG, modeID, D0),
26 /* LOCATION */
27 struct Library *, CyberGfxBase, 9, Cybergraphics)
29 /* FUNCTION
30 Checks if the given display mode ID belongs to an RTG driver.
32 INPUTS
33 modeID - a display mode ID to check.
35 RESULT
36 result - TRUE if the mode belongs to an RTG driver, FALSE otherwise.
38 NOTES
40 EXAMPLE
42 BUGS
44 SEE ALSO
46 INTERNALS
47 The function relies on the pixelformat object being passed in
48 DimensionInfo.reserved[1] by graphics.library/GetDisplayInfoData().
50 *****************************************************************************/
52 AROS_LIBFUNC_INIT
54 struct DimensionInfo info;
56 /* This function works by querying pixelformat for the mode and checking if it is planar */
57 if (GetDisplayInfoData(NULL, (UBYTE *)&info, sizeof(info), DTAG_DIMS, modeID) == sizeof(info)) {
58 HIDDT_StdPixFmt stdpf;
59 OOP_Object *pf = (OOP_Object *)info.reserved[1];
61 OOP_GetAttr(pf, aHidd_PixFmt_StdPixFmt, &stdpf);
63 return (stdpf != vHidd_StdPixFmt_Plane);
66 return FALSE;
68 AROS_LIBFUNC_EXIT
69 } /* IsCyberModeID */