diff options
author | Chia-I Wu <[email protected]> | 2010-04-01 14:20:24 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2010-04-01 22:25:48 +0800 |
commit | fc3ddd4b566380e7684c780450016e3e191a4160 (patch) | |
tree | 539e4eb39fb89a9ebb83116deef9c5d5ebc57e4d /progs/egl/openvg/trivial/clear.c | |
parent | 7f231cab2b7c13ba70d6aa694f74b6d6eee6470f (diff) |
progs/openvg: Move OpenVG demos to a subdirectory of progs/egl.
That is, move
progs/openvg/demos to progs/egl/openvg,
progs/openvg/trivial to progs/egl/openvg/trivial.
Diffstat (limited to 'progs/egl/openvg/trivial/clear.c')
-rw-r--r-- | progs/egl/openvg/trivial/clear.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/progs/egl/openvg/trivial/clear.c b/progs/egl/openvg/trivial/clear.c new file mode 100644 index 00000000000..efb6bf41820 --- /dev/null +++ b/progs/egl/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); +} |