2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 Copyright © 2001-2003, The MorphOS Development Team. All Rights Reserved.
7 #include <graphics/rastport.h>
8 #include <proto/graphics.h>
9 #include "intuition_intern.h"
11 /*****************************************************************************
14 #include <intuition/screens.h>
15 #include <proto/intuition.h>
17 AROS_LH2(void, FreeScreenBuffer
,
20 AROS_LHA(struct Screen
* , screen
, A0
),
21 AROS_LHA(struct ScreenBuffer
*, screenbuffer
, A1
),
24 struct IntuitionBase
*, IntuitionBase
, 129, Intuition
)
27 Frees a ScreenBuffer allocated by AllocScreenBuffer() and releases
28 associated resources. You have to call this before closing your
32 screen - The screen this screenbuffer belongs to
33 screenbuffer - The screenbuffer obtained by AllocScreenBuffer()
34 It is safe to pass NULL.
40 When used SB_SCREEN_BITMAP on allocating the ScreenBuffer
41 (ie. the ScreenBuffer only refers to the screen's BitMap) you must
42 FreeScreenBuffer() the ScreenBuffer before closing the screen.
43 Intuition will recognize when FreeScreenBuffer() is called for the
44 currently installed ScreenBuffer that it must not free the BitMap.
45 This is left to the CloseScreen() function.
52 AllocScreenBuffer(), ChangeScreenBuffer()
58 *****************************************************************************/
62 DEBUG_FREESCREENBUFFER(dprintf("FreeScreenBuffer: Screen 0x%lx ScreenBuffer 0x%lx\n",
63 screen
, screenbuffer
));
65 screen
= screen
; /* shut up the compiler */
69 FreeDBufInfo(screenbuffer
->sb_DBufInfo
);
71 if (((struct IntScreenBuffer
*)screenbuffer
)->free_bitmap
)
72 FreeBitMap(screenbuffer
->sb_BitMap
);
74 FreeMem(screenbuffer
, sizeof(struct IntScreenBuffer
));
78 } /* FreeScreenBuffer */