gl.library: introduce new OpenGL ABI
[AROS.git] / workbench / libs / mesa / src / gallium / state_trackers / arosmesa / arosmesaswapbuffers.c
blob3a4940ec66fe46540d3a485bc3b8dbc301a99d5f
1 /*
2 Copyright 2009-2014, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include "arosmesa_funcs.h"
7 #include "arosmesa_funcs_gallium.h"
8 #include <proto/exec.h>
9 #include <proto/gallium.h>
10 #include <gallium/pipe/p_screen.h>
11 #include <gallium/util/u_inlines.h>
13 void AROSMesaSwapBuffers(AROSMesaContext amesa);
15 /*****************************************************************************
17 NAME */
19 AROS_LH1(void, AROSMesaSwapBuffers,
21 /* SYNOPSIS */
22 AROS_LHA(AROSMesaContext, amesa, A0),
24 /* LOCATION */
25 struct Library *, MesaBase, 9, Mesa)
27 /* FUNCTION
28 Swaps the back with front buffers. MUST BE used to display the effect
29 of rendering onto the target RastPort, since AROSMesa always work in
30 double buffer mode.
32 INPUTS
33 amesa - GL rendering context on which swap is to be performed.
35 RESULT
37 BUGS
39 INTERNALS
41 HISTORY
43 *****************************************************************************/
45 AROS_LIBFUNC_INIT
47 AROSMesaSwapBuffers(amesa);
49 AROS_LIBFUNC_EXIT
52 void AROSMesaSwapBuffers(AROSMesaContext amesa)
54 if (amesa->framebuffer->render_resource)
56 /* Flush rendering cache before blitting */
57 amesa->st->flush(amesa->st, ST_FLUSH_FRONT, NULL);
59 BltPipeResourceRastPort(amesa->framebuffer->render_resource, 0, 0,
60 amesa->visible_rp, amesa->left, amesa->top,
61 amesa->framebuffer->width, amesa->framebuffer->height);
64 AROSMesaCheckAndUpdateBufferSize(amesa);