gl.library: introduce new OpenGL ABI
[AROS.git] / workbench / libs / mesa / src / gallium / state_trackers / arosmesa / arosmesasetrast.c
blob3906a3f2520a62ac34bd49f55c84af3d8529645a
1 /*
2 Copyright 2011-2014, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include "arosmesa_funcs.h"
7 #include "arosmesa_funcs_gallium.h"
8 #include <proto/exec.h>
9 #include <proto/utility.h>
10 #include <proto/graphics.h>
11 #include <aros/debug.h>
13 void AROSMesaSetRast(AROSMesaContext amesa, struct TagItem * tagList);
15 /*****************************************************************************
17 NAME */
19 AROS_LH2(void, AROSMesaSetRast,
21 /* SYNOPSIS */
22 AROS_LHA(AROSMesaContext, amesa, A0),
23 AROS_LHA(struct TagItem *, tagList, A1),
25 /* LOCATION */
26 struct Library *, MesaBase, 12, Mesa)
28 /* FUNCTION
30 Sets a new rendering target for an existing context
32 INPUTS
34 tagList - a pointer to tags to be used during creation.
36 TAGS
38 AMA_Window - pointer to Window onto which scene is to be rendered. Must
39 be provided.
41 RESULT
43 None
45 BUGS
47 INTERNALS
49 HISTORY
51 *****************************************************************************/
53 AROS_LIBFUNC_INIT
55 AROSMesaSetRast(amesa, tagList);
57 AROS_LIBFUNC_EXIT
60 void AROSMesaSetRast(AROSMesaContext amesa, struct TagItem * tagList)
62 if (amesa)
64 /* Check if at least one of window, rastport or screen have been passed */
65 if ((GetTagData(AMA_Screen, 0, tagList) != 0) ||
66 (GetTagData(AMA_Window, 0, tagList) != 0) ||
67 (GetTagData(AMA_RastPort, 0, tagList) != 0))
69 /* If there already is visible_rp, free it */
70 if (amesa->visible_rp)
71 FreeRastPort(amesa->visible_rp);
72 /* Do standard rast port selection */
73 AROSMesaSelectRastPort(amesa, tagList);
75 /* Do standard initialization */
76 AROSMesaStandardInit(amesa, tagList);
78 /* TODO: what to do with visual and framebuffer, if BPP changes, we are in trouble */
80 /* After the new render target has been attached, invoke framebuffer recalculation */
81 AROSMesaCheckAndUpdateBufferSize(amesa);