- Handle multiple nodes having output volume control.
[AROS.git] / rom / graphics / newregion.c
blob93af1fe24567597ee91cb70b2c1fe337f3e651d1
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: english
7 */
8 #include "graphics_intern.h"
9 #include <exec/types.h>
10 #include <exec/memory.h>
11 #include <graphics/regions.h>
12 #include <proto/exec.h>
13 #include "intregions.h"
15 /*****************************************************************************
17 NAME */
18 #include <proto/graphics.h>
20 AROS_LH0(struct Region *, NewRegion,
22 /* SYNOPSIS */
23 /* void */
25 /* LOCATION */
26 struct GfxBase *, GfxBase, 86, Graphics)
28 /* FUNCTION
29 Allocates memory for a new Region and initializes it
30 to an empty Region.
32 INPUTS
34 RESULT
35 region - pointer to a newly created Region structure that
36 should be freed by a call to DisposeRegion()
38 NOTES
40 EXAMPLE
42 BUGS
44 SEE ALSO
45 DisposeRegion()
47 INTERNALS
49 HISTORY
50 27-11-96 digulla automatically created from
51 graphics_lib.fd and clib/graphics_protos.h
52 15-01-97 mreckt initial version
54 *****************************************************************************/
56 AROS_LIBFUNC_INIT
58 struct Region *new;
60 #if REGIONS_USE_MEMPOOL
61 ObtainSemaphore(&PrivGBase(GfxBase)->regionsem);
62 new = AllocPooled(PrivGBase(GfxBase)->regionpool, sizeof(struct Region));
63 ReleaseSemaphore(&PrivGBase(GfxBase)->regionsem);
64 #else
65 new = AllocMem(sizeof(struct Region), MEMF_ANY);
66 #endif
68 if (new) InitRegion(new);
70 return new;
72 AROS_LIBFUNC_EXIT
74 } /* NewRegion */