summaryrefslogtreecommitdiff
path: root/progs/egl/openvg/trivial/clear.c
blob: efb6bf4182074ebe7f1ded1d166db99f124e2d17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include "eglcommon.h"

#include <VG/openvg.h>
#include <stdio.h>

float red_color[4] = {1.0, 0.0, 0.0, 1.0};
float blue_color[4] = {0.0, 0.0, 1.0, 1.0};

static void
init(void)
{
}

/* new window size or exposure */
static void
reshape(int w, int h)
{
   vgLoadIdentity();
}

static void
draw(void)
{
    VGint scissor[4] = {100, 100, 25, 25};
    vgSetfv(VG_CLEAR_COLOR, 4, red_color);
    vgClear(0, 0, window_width(), window_height());

    vgSetfv(VG_CLEAR_COLOR, 4, blue_color);
    vgClear(50, 50, 50, 50);

    //vgSetiv(VG_SCISSOR_RECTS, 4, scissor);
    //vgSeti(VG_SCISSORING, VG_TRUE);
    vgCopyPixels(100, 100, 50, 50, 50, 50);
    vgClear(150, 150, 50, 50);
}


int main(int argc, char **argv)
{
   return run(argc, argv, init, reshape,
              draw, 0);
}