wip - import hostgl from abi v0 and adapt to abi v1/GL.library ABI
[AROS.git] / arch / all-hosted / libs / hostgl / hostgl_glasetrast.c
blob0e27737b3e54982b93fa00bfeb8389ed950bfad1
1 /*
2 Copyright 2011-2015, The AROS Development Team. All rights reserved.
3 $Id$
4 */
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 /*****************************************************************************
17 NAME */
19 void glASetRast(
21 /* SYNOPSIS */
22 GLAContext ctx,
23 struct TagItem * tagList)
25 /* FUNCTION
27 Sets a new rendering target for an existing context
29 INPUTS
31 tagList - a pointer to tags to be used during creation.
33 TAGS
35 GLA_Window - pointer to Window onto which scene is to be rendered. Must
36 be provided.
38 RESULT
40 None
42 BUGS
44 INTERNALS
46 HISTORY
48 *****************************************************************************/
50 struct hostgl_context *_ctx = (struct hostgl_context *)ctx;
52 if (_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 */
60 if (_ctx->visible_rp)
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);