add place-holder directory for the a3000 wd533c93 scsi controller implementation.
[AROS.git] / workbench / libs / mesa / mesa3dgl_gladestroycontext.c
blobc317219ff3d900620c4959083bb8d293594e683a
1 /*
2 Copyright © 2009-2019, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <aros/debug.h>
8 #include <proto/exec.h>
9 #include <proto/gallium.h>
11 #include "mesa3dgl_support.h"
12 #include "mesa3dgl_gallium.h"
14 /*****************************************************************************
16 NAME */
18 void glADestroyContext(
20 /* SYNOPSIS */
21 GLAContext ctx)
23 /* FUNCTION
24 Destroys the GL rendering context and frees all resoureces.
26 INPUTS
27 ctx - pointer to GL rendering context. A NULL pointer will be
28 ignored.
30 RESULT
31 The GL context is destroyed. Do no use it anymore.
33 BUGS
35 INTERNALS
37 HISTORY
39 *****************************************************************************/
41 struct mesa3dgl_context * _ctx = (struct mesa3dgl_context *)ctx;
43 /* Destroy a MESA3DGL context */
44 D(bug("[MESA3DGL] %s(ctx @ %x)\n", __func__, ctx));
46 if (_ctx)
48 struct st_context_iface * st_ctx = _ctx->st;
50 if (st_ctx)
52 struct st_context_iface * cur_ctx = glstapi->get_current(glstapi);
54 if (cur_ctx == st_ctx)
56 /* Unbind if current */
57 _ctx->st->flush(_ctx->st, 0, NULL);
58 glstapi->make_current(glstapi, NULL, NULL, NULL);
61 _ctx->st->destroy(_ctx->st);
62 MESA3DGLFreeFrameBuffer(_ctx->framebuffer);
63 MESA3DGLFreeStManager(_ctx->driver, _ctx->stmanager);
64 glstapi->destroy(glstapi);
65 MESA3DGLFreeContext(_ctx);