From: Jean-Philippe Bruyère Date: Mon, 15 Nov 2021 15:08:08 +0000 (+0100) Subject: tests wip X-Git-Tag: v0.2.0~59^2~2 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=da4929693bcadf50f7661a5e5f6141d130a8002f;p=jp%2Fvkvg.git tests wip --- diff --git a/tests/common/test.c b/tests/common/test.c index 24ddad9..6152a9e 100644 --- a/tests/common/test.c +++ b/tests/common/test.c @@ -176,7 +176,7 @@ void _print_usage_and_exit () { printf("\t-x width:\tOutput surface width.\n"); printf("\t-y height:\tOutput surface height.\n"); printf("\t-S num samples:\tOutput surface filter, default is 1.\n"); - printf("\t-G gpu_type:\tSet prefered GPU type:\n"); + printf("\t-g gpu_type:\tSet prefered GPU type:\n"); printf("\t\t\t\t- 0: Other\n"); printf("\t\t\t\t- 1: Integrated\n"); printf("\t\t\t\t- 2: Discrete\n"); diff --git a/tests/random_rects.c b/tests/random_rects.c index f192206..fc26077 100644 --- a/tests/random_rects.c +++ b/tests/random_rects.c @@ -1,114 +1,27 @@ #include "test.h" -/*void drawRandomRect (VkvgContext ctx) { +void drawRandomRect (VkvgContext ctx, float s) { float w = (float)test_width; float h = (float)test_height; randomize_color(ctx); - float z = truncf((0.5f*w*rand()/RAND_MAX)+1.f); - float v = truncf((0.5f*w*rand()/RAND_MAX)+1.f); - float x = truncf((w-z)*rand()/RAND_MAX); - float y = truncf((h-v)*rand()/RAND_MAX); + float x = truncf(w*rndf()); + float y = truncf(h*rndf()); - vkvg_rectangle(ctx, x, y, z, v); -}*/ -static float shape_size = 0.2f; - -void _shape_fill(shape_t shape){ - VkvgContext ctx = _initCtx (); - for (uint32_t i=0; i