Fix IO memory access .. SB128 driver makes noises in VMWare - CMI is untested (Curren...
[AROS.git] / rom / graphics / createrastport.c
blobf92dbd01f98dd3e386b21c558217f61afc3df090
1 /*
2 Copyright © 1995-2007, 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
57 struct RastPort * newRP;
58 BOOL ok = FALSE;
60 newRP = AllocMem (sizeof (struct RastPort), MEMF_ANY);
62 if (newRP)
64 if (InitRastPort(newRP))
66 /* Mark the rastport as being cleaned up by the
67 user itself later on (through FreeRastPort()).
68 No need for garbage collection */
69 newRP->Flags |= RPF_SELF_CLEANUP;
70 ok = TRUE;
73 if (!ok)
75 FreeMem (newRP, sizeof (struct RastPort));
76 newRP = NULL;
80 return newRP;
81 AROS_LIBFUNC_EXIT
82 } /* CreateRastPort */