disable debug
[AROS.git] / workbench / libs / mesa / src / aros / mesa3dgl / mesa3dgl_glasetrast.c
blob5bb8cdd337de41f5ca4fcf9b594aa211895e76ec
1 /*
2 Copyright 2011-2015, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #define DEBUG 0
7 #include <aros/debug.h>
9 #include <proto/exec.h>
10 #include <proto/utility.h>
11 #include <proto/graphics.h>
13 #include "mesa3dgl_support.h"
14 #include "mesa3dgl_gallium.h"
16 /*****************************************************************************
18 NAME */
20 void glASetRast(
22 /* SYNOPSIS */
23 GLAContext ctx,
24 struct TagItem * tagList)
26 /* FUNCTION
28 Sets a new rendering target for an existing context
30 INPUTS
32 ctx -
33 tagList - a pointer to tags to be used during creation.
35 TAGS
37 GLA_Window - pointer to Window onto which scene is to be rendered. Must
38 be provided.
40 RESULT
42 None
44 BUGS
46 INTERNALS
48 HISTORY
50 *****************************************************************************/
52 struct mesa3dgl_context * _ctx = (struct mesa3dgl_context *)ctx;
54 if (_ctx)
56 /* Check if at least one of window, rastport or screen have been passed */
57 if ((GetTagData(GLA_Screen, 0, tagList) != 0) ||
58 (GetTagData(GLA_Window, 0, tagList) != 0) ||
59 (GetTagData(GLA_RastPort, 0, tagList) != 0))
61 /* If there already is visible_rp, free it */
62 if (_ctx->visible_rp)
63 FreeRastPort(_ctx->visible_rp);
64 /* Do standard rast port selection */
65 MESA3DGLSelectRastPort(_ctx, tagList);
67 /* Do standard initialization */
68 MESA3DGLStandardInit(_ctx, tagList);
70 /* TODO: what to do with visual and framebuffer, if BPP changes, we are in trouble */
72 /* After the new render target has been attached, invoke framebuffer recalculation */
73 MESA3DGLCheckAndUpdateBufferSize(_ctx);