summaryrefslogtreecommitdiffstatsci
path: root/tests/offscreen.c
blob: 86140bd9aeb9e88382ecf773e76d597695acab75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "vkvg.h"

int main(int argc, char* argv[]) {
    vkvg_device_create_info_t info = {0};
    VkvgDevice                dev  = vkvg_device_create(&info);
    VkvgSurface               surf = vkvg_surface_create(dev, 512, 512);
    VkvgContext               ctx  = vkvg_create(surf);

    vkvg_clear(ctx);
    vkvg_rectangle(ctx, 10, 10, 250, 200);
    vkvg_set_source_rgb(ctx, 1, 0, 0);
    vkvg_fill(ctx);

    vkvg_destroy(ctx);

    vkvg_surface_write_to_png(surf, "offscreen.png");
    vkvg_surface_destroy(surf);

    vkvg_device_destroy(dev);
    return 0;
}