diff options
author | Zack Rusin <zackr@vmware.com> | 2009-07-06 21:43:26 -0400 |
---|---|---|
committer | Zack Rusin <zackr@vmware.com> | 2009-07-06 21:43:26 -0400 |
commit | edb02671704aeb60e3eeaa7f58c73f4845c5b7e2 (patch) | |
tree | 0bd971c7c8aa4639fcbd5b060f560d978b9f0cf3 /progs/openvg/trivial/clear.c | |
parent | 124a6b1958c630ea049025e2b72547096fdc8f2c (diff) | |
parent | 54324d9e0c6956bdc7bc9b0620fe53c8e6b66a04 (diff) |
Merge commit 'origin/openvg-1.0'
Diffstat (limited to 'progs/openvg/trivial/clear.c')
-rw-r--r-- | progs/openvg/trivial/clear.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/progs/openvg/trivial/clear.c b/progs/openvg/trivial/clear.c new file mode 100644 index 0000000000..efb6bf4182 --- /dev/null +++ b/progs/openvg/trivial/clear.c @@ -0,0 +1,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); +} |