<div dir="ltr">I don't see anything wrong with this patch, but I'm forced to ask the question: What's the point?  I mean, it's a little bouncing ball, why does it need to be configurable?<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Nov 29, 2014 at 5:36 AM, Seedo Eldho Paul <span dir="ltr"><<a href="mailto:seedoeldhopaul@gmail.com" target="_blank">seedoeldhopaul@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Also change "simple-shm exiting" to "simple-damage exiting"<br>
<br>
Signed-off-by: Seedo Eldho Paul <<a href="mailto:seedoeldhopaul@gmail.com">seedoeldhopaul@gmail.com</a>><br>
---<br>
 clients/simple-damage.c | 21 ++++++++++++++-------<br>
 1 file changed, 14 insertions(+), 7 deletions(-)<br>
<br>
diff --git a/clients/simple-damage.c b/clients/simple-damage.c<br>
index fe532fe..9f3d58f 100644<br>
--- a/clients/simple-damage.c<br>
+++ b/clients/simple-damage.c<br>
@@ -172,8 +172,6 @@ window_init_game(struct window *window)<br>
        gettimeofday(&tv, NULL);<br>
        srand(tv.tv_usec);<br>
<br>
-       window->ball.radius = 10;<br>
-<br>
        ax1 = window->border + window->ball.radius;<br>
        ay1 = window->border + window->ball.radius;<br>
        ax2 = window->width - window->border - window->ball.radius;<br>
@@ -233,8 +231,8 @@ window_advance_game(struct window *window, uint32_t timestamp)<br>
<br>
 static struct window *<br>
 create_window(struct display *display, int width, int height,<br>
-             enum wl_output_transform transform, int scale,<br>
-             enum window_flags flags)<br>
+             int border, int radius, enum wl_output_transform transform,<br>
+             int scale, enum window_flags flags)<br>
 {<br>
        struct window *window;<br>
<br>
@@ -268,7 +266,8 @@ create_window(struct display *display, int width, int height,<br>
        window->display = display;<br>
        window->width = width;<br>
        window->height = height;<br>
-       window->border = 10;<br>
+       window->border = border;<br>
+       window->ball.radius = radius;<br>
        window->flags = flags;<br>
        window->transform = transform;<br>
        window->scale = scale;<br>
@@ -772,6 +771,8 @@ print_usage(int retval)<br>
                "  --version=VERSION\tVersion of wl_surface to use\n"<br>
                "  --width=WIDTH\t\tWidth of the window\n"<br>
                "  --height=HEIGHT\tHeight of the window\n"<br>
+               "  --border=BORDER\tBorder width of the window\n"<br>
+               "  --radius=RADIUS\tRadius of the ball\n"<br>
                "  --scale=SCALE\t\tScale factor for the surface\n"<br>
                "  --transform=TRANSFORM\tTransform for the surface\n"<br>
                "  --rotating-transform\tUse a different buffer_transform for each frame\n"<br>
@@ -818,6 +819,7 @@ main(int argc, char **argv)<br>
        int i, ret = 0;<br>
        int version = -1;<br>
        int width = 300, height = 200, scale = 1;<br>
+       int border = 10, radius = 10;<br>
        enum wl_output_transform transform = WL_OUTPUT_TRANSFORM_NORMAL;<br>
        enum window_flags flags = 0;<br>
<br>
@@ -839,6 +841,10 @@ main(int argc, char **argv)<br>
                        continue;<br>
                } else if (sscanf(argv[i], "--height=%d", &height) > 0) {<br>
                        continue;<br>
+               } else if (sscanf(argv[i], "--border=%d", &border) > 0) {<br>
+                       continue;<br>
+               } else if (sscanf(argv[i], "--radius=%d", &radius) > 0) {<br>
+                       continue;<br>
                } else if (strncmp(argv[i], "--transform=", 12) == 0 &&<br>
                           parse_transform(argv[i] + 12, &transform) > 0) {<br>
                        continue;<br>
@@ -858,7 +864,8 @@ main(int argc, char **argv)<br>
<br>
        display = create_display(version);<br>
<br>
-       window = create_window(display, width, height, transform, scale, flags);<br>
+       window = create_window(display, width, height, border, radius,<br>
+                              transform, scale, flags);<br>
        if (!window)<br>
                return 1;<br>
<br>
@@ -872,7 +879,7 @@ main(int argc, char **argv)<br>
        while (running && ret != -1)<br>
                ret = wl_display_dispatch(display->display);<br>
<br>
-       fprintf(stderr, "simple-shm exiting\n");<br>
+       fprintf(stderr, "simple-damage exiting\n");<br>
        destroy_window(window);<br>
        destroy_display(display);<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
1.9.1<br>
<br>
_______________________________________________<br>
wayland-devel mailing list<br>
<a href="mailto:wayland-devel@lists.freedesktop.org">wayland-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/wayland-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br>
</font></span></blockquote></div><br></div>