diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2020-08-27 14:48:04 +0200 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2020-08-30 13:55:10 +0200 |
| commit | d0793f5cd45840307382e5edbc32e3813aeeb05a (patch) | |
| tree | 57436d5171865915c4f9335df681ef88a7a4c5e7 /src | |
| parent | e50e82df9b5bb2fc5b27272e729bd29702ce28e0 (diff) | |
save commit
Diffstat (limited to 'src')
| -rw-r--r-- | src/vkvg_context.c | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/src/vkvg_context.c b/src/vkvg_context.c index 3351c5b..6b49c9a 100644 --- a/src/vkvg_context.c +++ b/src/vkvg_context.c @@ -56,33 +56,21 @@ VkvgContext vkvg_create(VkvgSurface surf) ctx->sizeIndices = ctx->sizeIBO = VKVG_IBO_SIZE; ctx->sizePathes = VKVG_PATHES_SIZE; ctx->lineWidth = 1; - ctx->dashCount = 0; - ctx->dashOffset = 0; - ctx->dashes = NULL; ctx->curOperator = VKVG_OPERATOR_OVER; ctx->curFillRule = VKVG_FILL_RULE_NON_ZERO; - ctx->curSavBit = 0; - ctx->vertCount = 0; - ctx->indCount = 0; - ctx->curIndStart = 0; - ctx->curVertOffset = 0; - ctx->pSurf = surf; - VkRect2D scissor = {{0,0},{ctx->pSurf->width,ctx->pSurf->height}}; - ctx->bounds = scissor; - - push_constants pc = { + + ctx->bounds = (VkRect2D) {{0,0},{ctx->pSurf->width,ctx->pSurf->height}}; + ctx->pushConsts = (push_constants) { {.height=1}, {(float)ctx->pSurf->width,(float)ctx->pSurf->height}, VKVG_PATTERN_TYPE_SOLID, 0, VKVG_IDENTITY_MATRIX, VKVG_IDENTITY_MATRIX - }; - ctx->pushConsts = pc; + }; + ctx->clearRect = (VkClearRect) {{{0},{ctx->pSurf->width, ctx->pSurf->height}},0,1}; - const VkClearRect cr = {{{0},{ctx->pSurf->width, ctx->pSurf->height}},0,1}; - ctx->clearRect = cr; ctx->renderPassBeginInfo.sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO; ctx->renderPassBeginInfo.framebuffer = ctx->pSurf->fb; ctx->renderPassBeginInfo.renderArea.extent.width = ctx->pSurf->width; @@ -305,7 +293,7 @@ void vkvg_rel_line_to (VkvgContext ctx, float dx, float dy){ return; } vec2 cp = _get_current_position(ctx); - vkvg_line_to(ctx, cp.x + x, cp.y + dy); + vkvg_line_to(ctx, cp.x + dx, cp.y + dy); } void vkvg_line_to (VkvgContext ctx, float x, float y) { |