finish transitioning from arosmesa -> mesa3dgl.library
[AROS.git] / workbench / libs / mesa / src / aros / arosmesa / mesa3dgl_glamakecurrent.c
blobc33832f28c3b91fb66fba00132cd407dbc28041e
1 /*
2 Copyright 2009-2015, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <proto/exec.h>
8 #include "mesa3dgl_types.h"
9 #include "mesa3dgl_funcs.h"
11 /*****************************************************************************
13 NAME */
15 void glAMakeCurrent(
17 /* SYNOPSIS */
18 GLAContext ctx)
20 /* FUNCTION
21 Make the selected GL rendering context active.
23 INPUTS
24 ctx - GL rendering context to be made active for all following GL
25 calls.
27 RESULT
29 BUGS
31 INTERNALS
33 HISTORY
35 *****************************************************************************/
37 struct mesa3dgl_context *_ctx = (struct mesa3dgl_context *)ctx;
39 if (_ctx)
41 struct st_context_iface * cur_ctx = glstapi->get_current(glstapi);
43 if (_ctx->st != cur_ctx)
45 /* Recalculate buffer dimensions */
46 MESA3DGLRecalculateBufferWidthHeight(_ctx);
48 /* Attach */
49 glstapi->make_current(glstapi, _ctx->st,
50 &_ctx->framebuffer->base, &_ctx->framebuffer->base);
53 else
55 /* Detach */
56 glstapi->make_current(glstapi, NULL, NULL, NULL);