diff options
author | Adam NAILI | 2018-01-01 23:55:04 +0100 |
---|---|---|
committer | Adam NAILI | 2018-01-01 23:55:04 +0100 |
commit | c675120b5fc8e429e42aab2c4d609970a422afaa (patch) | |
tree | 028cfe9dd8cd7510fa2a89bc40b04ca2f01d1d5b | |
parent | ff2d78256b6b2288e9a5954a49fe4babaf6400cb (diff) | |
download | morpher-c675120b5fc8e429e42aab2c4d609970a422afaa.tar.gz |
Successful test of rendering (GUI BETA)
-rw-r--r-- | test/gui/pictureframe.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/test/gui/pictureframe.c b/test/gui/pictureframe.c index 2dcbec6..13926b4 100644 --- a/test/gui/pictureframe.c +++ b/test/gui/pictureframe.c | |||
@@ -28,8 +28,6 @@ static void test_pictureframe() { | |||
28 | Canvas *canvasSrc = canvas_create_from_image("/home/adam/Images/goku.png"); | 28 | Canvas *canvasSrc = canvas_create_from_image("/home/adam/Images/goku.png"); |
29 | Canvas *canvasTarget = canvas_create_from_image("/home/adam/Images/marty.jpg"); | 29 | Canvas *canvasTarget = canvas_create_from_image("/home/adam/Images/marty.jpg"); |
30 | 30 | ||
31 | int i; | ||
32 | |||
33 | sprintf(labelFrame, "%03d frames", frame); | 31 | sprintf(labelFrame, "%03d frames", frame); |
34 | button_init(&button1, "Add constraint point", 10, 0, 0, button_click_add_constraint); | 32 | button_init(&button1, "Add constraint point", 10, 0, 0, button_click_add_constraint); |
35 | button_init(&button2, "Show/Hide", 10, 0, 0, button_click_show_hide); | 33 | button_init(&button2, "Show/Hide", 10, 0, 0, button_click_show_hide); |
@@ -59,13 +57,14 @@ static void test_pictureframe() { | |||
59 | 57 | ||
60 | window_print_buttons(&window); | 58 | window_print_buttons(&window); |
61 | window_print_pictureframes(&window); | 59 | window_print_pictureframes(&window); |
60 | |||
61 | MLV_Keyboard_button keyboardButton; | ||
62 | MLV_Keyboard_modifier keyboardModifier; | ||
63 | int unicode; | ||
62 | int mouse_x; | 64 | int mouse_x; |
63 | int mouse_y; | 65 | int mouse_y; |
64 | while (mode != EXITING) { | 66 | while (mode != EXITING) { |
65 | MLV_wait_mouse(&mouse_x, &mouse_y); | 67 | window_click_keyboard_handler(&window, &keyboardButton, &keyboardModifier, &unicode, &mouse_x, &mouse_y); |
66 | group_click_handler(mouse_x, mouse_y, &(window.group_buttons->component)); | ||
67 | group_click_handler(mouse_x, mouse_y, &(window.group_pictureframe->component)); | ||
68 | |||
69 | switch (mode) { | 68 | switch (mode) { |
70 | case PRINTING: | 69 | case PRINTING: |
71 | window_print_pictureframes(&window); | 70 | window_print_pictureframes(&window); |
@@ -83,14 +82,13 @@ static void test_pictureframe() { | |||
83 | mode = WAITING_BUTTON_SHOW; | 82 | mode = WAITING_BUTTON_SHOW; |
84 | break; | 83 | break; |
85 | case RENDERING: | 84 | case RENDERING: |
86 | for (i = 1; i <= frame ; ++i) { | 85 | window_rendering(&window,&pictureFrame1,canvasSrc,canvasTarget,morphing); |
87 | pictureFrame1.canvas = rasterize(canvasSrc,canvasTarget,morphing,(TimeVector)(i/(float)frame)); | 86 | break; |
88 | pictureframe_draw_canvas(&pictureFrame1); | 87 | case INSERT_TARGET: |
89 | MLV_actualise_window(); | 88 | if (keyboardButton == MLV_KEYBOARD_ESCAPE) { |
90 | MLV_wait_seconds(1); | 89 | window_print_pictureframes(&window); |
90 | mode = WAITING_BUTTON_SHOW; | ||
91 | } | 91 | } |
92 | mode = EXITING; | ||
93 | MLV_wait_seconds(15); | ||
94 | break; | 92 | break; |
95 | default: | 93 | default: |
96 | break; | 94 | break; |