New bitmap method SetRGBConversionFunction which can be used to
[tangerine.git] / rom / graphics / createrastport.c
blob0459e3e7968377a88c6d9ad3cb22eddcaf1d62b4
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: AROS Graphics function CreateRastPort()
6 Lang: english
7 */
8 #include "graphics_intern.h"
9 #include <exec/memory.h>
10 #include <graphics/rastport.h>
11 #include <proto/exec.h>
12 #include "gfxfuncsupport.h"
14 /*****************************************************************************
16 NAME */
17 #include <graphics/rastport.h>
18 #include <proto/graphics.h>
20 AROS_LH0(struct RastPort *, CreateRastPort,
22 /* SYNOPSIS */
24 /* LOCATION */
25 struct GfxBase *, GfxBase, 177, Graphics)
27 /* FUNCTION
28 This function creates a new RastPort.
30 INPUTS
31 None.
33 RESULT
34 A pointer to a new RastPort or NULL if there was not enough memory
35 to perform the operation.
37 NOTES
38 This function is AROS specific. For compatibility, there is a
39 function in aros.lib which does the same on Amiga.
41 EXAMPLE
43 BUGS
45 SEE ALSO
47 INTERNALS
49 HISTORY
50 29-10-95 digulla automatically created from
51 graphics_lib.fd and clib/graphics_protos.h
53 *****************************************************************************/
55 AROS_LIBFUNC_INIT
56 AROS_LIBBASE_EXT_DECL(struct GfxBase *,GfxBase)
58 struct RastPort * newRP;
59 BOOL ok = FALSE;
61 newRP = AllocMem (sizeof (struct RastPort), MEMF_ANY);
63 if (newRP)
65 if (InitRastPort(newRP))
67 /* Mark the rastport as being cleaned up by the
68 user itself later on (through FreeRastPort()).
69 No need for garbage collection */
70 newRP->Flags |= RPF_SELF_CLEANUP;
71 ok = TRUE;
74 if (!ok)
76 FreeMem (newRP, sizeof (struct RastPort));
77 newRP = NULL;
81 return newRP;
82 AROS_LIBFUNC_EXIT
83 } /* CreateRastPort */