diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2018-04-10 08:22:21 +0200 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2018-04-10 08:22:21 +0200 |
| commit | e9f311def74bf9f4e124ca0d73a70e40bdbd3cfb (patch) | |
| tree | 3d31429ee9a39fbcefce8833321a9ccf51d0bc28 /src | |
| parent | 88996c4e1f4844e183189eb578eff70d3bf09384 (diff) | |
vkvg_rectangle
Diffstat (limited to 'src')
| -rw-r--r-- | src/vkvg_context.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/vkvg_context.c b/src/vkvg_context.c index 45bc9a1..9569b73 100644 --- a/src/vkvg_context.c +++ b/src/vkvg_context.c @@ -202,11 +202,27 @@ void vkvg_move_to (VkvgContext ctx, float x, float y) ctx->curPos.x = x; ctx->curPos.y = y; } - void vkvg_curve_to (VkvgContext ctx, float x1, float y1, float x2, float y2, float x3, float y3) { _bezier (ctx, ctx->curPos.x, ctx->curPos.y, x1, y1, x2, y2, x3, y3); } +void vkvg_rectangle (VkvgContext ctx, float x, float y, float w, float h){ + _finish_path (ctx); + + //set start to current idx in point array + ctx->pathes[ctx->pathPtr] = ctx->pointCount; + _check_pathes_array(ctx); + ctx->pathPtr++; + + _add_point (ctx, x, y); + _add_point (ctx, x + w, y); + _add_point (ctx, x + w, y + h); + _add_point (ctx, x, y + h); + + vkvg_close_path (ctx); + ctx->curPos.x = x; + ctx->curPos.y = y; +} void vkvg_clip_preserve (VkvgContext ctx){ vkCmdBindPipeline(ctx->cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, ctx->pSurf->dev->pipelineClipping); vkvg_fill_preserve(ctx); |