Skip to content

finite_draw_finish

The finite_draw_finish function attempts to clean up the cairo objects and commit the data to the window.

bool finite_draw_finish(FiniteShell *shell, int width, int height, int stride, bool withAlpha)
TypeDescription
FiniteShell *shellThe FiniteShell where the window is.
int widthThe width of the area to redraw.
int heightThe height of the area to redraw.
strideThe stride of the window.
bool withAlphaWhether or not the window supports Alpha Channels.
#include <finite/draw.h>
FiniteGradientPoint points[2] = {
{0, 0.325, 0.325, 0.325, alpha},
{0.5, 0.207, 0.207, 0.207, alpha}
};
cairo_pattern_t *pat = finite_draw_pattern_linear(0,0, (double)shell->details->width, (double)shell->details->height, points, 2);
finite_draw_rect(shell, 0,0, shell->details->width, shell->details->height, NULL, pat);
cairo_pattern_destroy(pat);
finite_draw_finish(shell, shell->details->width, shell->details->height, shell->stride, true);

This function must have a valid FiniteShell

This function uses Cairo which requires a valid cairo_surface_t in FiniteShell.cairo_surface beforehand.

This function destroys the cairo draw object within a given FiniteShell. The cairo_surface_t however is not destroyed.

At some point (likely after the render loop) you should call finite_draw_cleanup