2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 Desc: Private graphics function for allocating screen bitmaps
8 #include "graphics_intern.h"
9 #include <exec/memory.h>
10 #include <graphics/rastport.h>
11 #include <proto/exec.h>
12 #include <proto/oop.h>
14 #include "gfxfuncsupport.h"
17 /*****************************************************************************
20 #include <graphics/rastport.h>
21 #include <proto/graphics.h>
23 AROS_LH1(struct BitMap
* , AllocScreenBitMap
,
26 AROS_LHA(ULONG
, modeid
, D0
),
29 struct GfxBase
*, GfxBase
, 182, Graphics
)
32 Allocates a bitmap for use with a screen opened by OpenScreen()
35 modeid - the DisplayID of the screen to create
38 bitmap - pointer to the newly created bitmap.
41 This function is private and AROS specific.
53 *****************************************************************************/
56 AROS_LIBBASE_EXT_DECL(struct GfxBase
*,GfxBase
)
58 struct BitMap
*nbm
= NULL
;
59 HIDDT_ModeID hiddmode
;
61 /* First get the the gfxmode for this modeid */
62 hiddmode
= get_hiddmode_for_amigamodeid(modeid
, GfxBase
);
64 if (vHidd_ModeID_Invalid
!= hiddmode
)
66 /* Create the bitmap from the hidd mode */
67 OOP_Object
*sync
, *pf
;
69 if (HIDD_Gfx_GetMode(SDD(GfxBase
)->gfxhidd
, hiddmode
, &sync
, &pf
))
71 ULONG width
, height
, depth
;
73 OOP_GetAttr(sync
, aHidd_Sync_HDisp
, &width
);
74 OOP_GetAttr(sync
, aHidd_Sync_VDisp
, &height
);
75 OOP_GetAttr(pf
, aHidd_PixFmt_Depth
, &depth
);
77 /* Hack: a negative depth indicates to AllocBitMap, that
78 the friend bitmap param actually is the hiddmode */
80 nbm
= AllocBitMap(width
, height
, -((LONG
)depth
), BMF_DISPLAYABLE
, (struct BitMap
*)hiddmode
);
88 } /* AllocScreenBitMap */