2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
3 Copyright © 2001-2003, The MorphOS Development Team. All Rights Reserved.
7 #include <proto/graphics.h>
8 #include "intuition_intern.h"
9 #include "inputhandler.h"
12 /*****************************************************************************
15 #include <intuition/screens.h>
16 #include <proto/intuition.h>
18 AROS_LH2(ULONG
, ChangeScreenBuffer
,
21 AROS_LHA(struct Screen
* , screen
, A0
),
22 AROS_LHA(struct ScreenBuffer
*, screenbuffer
, A1
),
25 struct IntuitionBase
*, IntuitionBase
, 130, Intuition
)
28 Do double or multiple buffering on an intuition screen in an
29 intuition-cooperative way.
30 The ScreenBuffer's BitMap will be installed on the specifies screen,
32 After a signal from graphics.library, the previously installed
33 BitMap will be available for re-use.
34 Consult graphics.library/AllocDBufInfo() and
35 graphics.library/ChangeVPBitMap() for further information.
38 screen - The screen this screenbuffer belongs to
39 screenbuffer - The screenbuffer obtained by AllocScreenBuffer()
42 Non-zero if fuction succeeded, or zero if operation could not be
43 performed, eg. if user selects menus or gadgets.
46 You need not re-install the original ScreenBuffer before closing
47 a screen. Just FreeScreenBuffer() all buffers used for that screen.
54 AllocScreenBuffer(), FreeScreenBuffer(),
55 graphics.library/ChangeVPBitMap()
61 *****************************************************************************/
65 struct GfxBase
*GfxBase
= GetPrivIBase(IntuitionBase
)->GfxBase
;
66 struct IIHData
*iihdata
;
69 if (!screen
) return 0;
70 if (!screenbuffer
) return 0;
72 if (MENUS_ACTIVE
) return 0;
73 iihdata
= (struct IIHData
*)((struct IntIntuitionBase
*)(IntuitionBase
))->InputHandler
->is_Data
;
74 if (iihdata
->ActiveGadget
) return 0;
76 ChangeVPBitMap(&screen
->ViewPort
,screenbuffer
->sb_BitMap
,screenbuffer
->sb_DBufInfo
);
80 screen
->BitMap
= *screenbuffer
->sb_BitMap
;
81 screen
->RastPort
.BitMap
= screenbuffer
->sb_BitMap
;
88 } /* ChangeScreenBuffer */