2 Copyright 2011-2015, The AROS Development Team. All rights reserved.
6 #include <proto/exec.h>
7 #include <proto/utility.h>
8 #include <proto/graphics.h>
9 #include <proto/arossupport.h>
11 #include "hostgl_ctx_manager.h"
12 #include "hostgl_funcs.h"
13 #include "hostgl_support.h"
15 /*****************************************************************************
23 struct TagItem
* tagList
)
27 Sets a new rendering target for an existing context
31 tagList - a pointer to tags to be used during creation.
35 GLA_Window - pointer to Window onto which scene is to be rendered. Must
48 *****************************************************************************/
50 struct hostgl_context
*_ctx
= (struct hostgl_context
*)ctx
;
54 /* Check if at least one of window, rastport or screen have been passed */
55 if ((GetTagData(GLA_Screen
, 0, tagList
) != 0) ||
56 (GetTagData(GLA_Window
, 0, tagList
) != 0) ||
57 (GetTagData(GLA_RastPort
, 0, tagList
) != 0))
59 /* If there already is visible_rp, free it */
61 FreeRastPort(_ctx
->visible_rp
);
62 /* Do standard rast port selection */
63 HostGLSelectRastPort(_ctx
, tagList
);
65 /* Do standard initialization */
66 HostGLStandardInit(_ctx
, tagList
);
68 /* TODO: what to do with visual and framebuffer, if BPP changes, we are in trouble */
70 /* After the new render target has been attached, invoke framebuffer recalculation */
71 HostGL_CheckAndUpdateBufferSize(_ctx
);