2 Copyright © 1995-2017, The AROS Development Team. All rights reserved.
9 #include <aros/debug.h>
10 #include <cybergraphx/cybergraphics.h>
12 #include <proto/graphics.h>
13 #include <proto/oop.h>
15 #include "cybergraphics_intern.h"
16 #include "gfxfuncsupport.h"
18 /*****************************************************************************
21 #include <proto/cybergraphics.h>
23 AROS_LH2(ULONG
, GetCyberIDAttr
,
26 AROS_LHA(ULONG
, attribute
, D0
),
27 AROS_LHA(ULONG
, DisplayModeID
, D1
),
30 struct Library
*, CyberGfxBase
, 17, Cybergraphics
)
33 Provides information about a specific RTG screenmode.
36 attribute - one of the following display attributes:
37 CYBERIDATTR_PIXFMT - the display's pixel format. See
38 LockBitMapTagList() for possible values.
39 CYBERIDATTR_WIDTH - the display's width (in pixels).
40 CYBERIDATTR_HEIGHT - the display's height (in pixels).
41 CYBERIDATTR_DEPTH - the number of bits per pixel.
42 CYBERIDATTR_BPPIX - the number of bytes per pixel.
43 DisplayModeID - an RTG screenmode ID.
46 value - the value associated with the requested attribute.
49 If an unknown attribute is requested, -1 is returned.
58 The function relies on pixelformat object being passed in
59 DimensionInfo.reserved[1] by graphics.library/GetDisplayInfoData().
61 *****************************************************************************/
65 IPTR retval
= (IPTR
)-1;
66 struct DimensionInfo info
;
68 if (GetDisplayInfoData(NULL
, (UBYTE
*)&info
, sizeof(info
), DTAG_DIMS
, DisplayModeID
) == sizeof(info
)) {
69 OOP_Object
*pf
= (OOP_Object
*)info
.reserved
[1];
73 case CYBRIDATTR_PIXFMT
:
74 OOP_GetAttr(pf
, aHidd_PixFmt_CgxPixFmt
, &retval
);
75 D(if (-1 == retval
) bug("!!! NO CGFX PIXFMT IN GetCyberIDAttr() !!!\n");)
78 case CYBRIDATTR_DEPTH
:
79 retval
= info
.MaxDepth
;
82 case CYBRIDATTR_WIDTH
:
83 retval
= info
.Nominal
.MaxX
- info
.Nominal
.MinX
+ 1;
86 case CYBRIDATTR_HEIGHT
:
87 retval
= info
.Nominal
.MaxY
- info
.Nominal
.MinY
+ 1;
90 case CYBRIDATTR_BPPIX
:
91 OOP_GetAttr(pf
, aHidd_PixFmt_BytesPerPixel
, &retval
);
95 D(bug("!!! UNKNOWN ATTRIBUTE IN GetCyberIDAttr(): %x !!!\n",
103 } /* GetCyberIDAttr */