From aaf57e5ee1e0cf74afdbdf56293f1afd7e79e6b0 Mon Sep 17 00:00:00 2001 From: Adam NAILI Date: Thu, 28 Dec 2017 16:22:43 +0100 Subject: Reworking signatures of pictureframe function, beginning of implementation, debug tests --- test/gui/pictureframe.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 test/gui/pictureframe.c (limited to 'test/gui/pictureframe.c') diff --git a/test/gui/pictureframe.c b/test/gui/pictureframe.c new file mode 100644 index 0000000..a47eaa0 --- /dev/null +++ b/test/gui/pictureframe.c @@ -0,0 +1,40 @@ +#include +#include +#include "MLV/MLV_all.h" + + +static void test_pictureframe() { + Window window; + window_init(&window, 1000, 512, "Coucou"); + window_create(&window); + + PictureFrame pictureFrame1; + PictureFrame pictureFrame2; + + Morphing *morphing = morphing_create(500,250); + Canvas canvas; + canvas_init(&canvas,500,250); + + pictureframe_init(&pictureFrame1,500,250,0,0,pictureframe_origin_split,morphing,&canvas); + pictureframe_init(&pictureFrame2,500,250,0,0,pictureframe_target_split,morphing,&canvas); + + window_add_pictureframe(&window,&pictureFrame1); + window_add_pictureframe(&window,&pictureFrame2); + + window_print_pictureframes(&window); + int mouse_x; + int mouse_y; + while(1){ + if (MLV_get_mouse_button_state(MLV_BUTTON_LEFT) == MLV_PRESSED) { + MLV_get_mouse_position(&mouse_x, &mouse_y); + group_click_handler(mouse_x,mouse_y,&(window.group_pictureframe->component)); + } + } + /*MLV_wait_seconds(15); + window_free(&window);*/ +} + +int main() { + test_pictureframe(); + return 0; +} \ No newline at end of file -- cgit v1.2.3