VKVG_STATUS_INVALID_VISUAL, /*!< */
VKVG_STATUS_FILE_NOT_FOUND, /*!< */
VKVG_STATUS_INVALID_DASH, /*!< invalid value for a dash setting */
+ VKVG_STATUS_INVALID_RECT, /*!< invalid value for a dash setting */
}vkvg_status_t;
typedef enum {
* @param h The height in pixel of the rectangle to draw.
*/
vkvg_public
-void vkvg_rectangle (VkvgContext ctx, float x, float y, float w, float h);
+void vkvg_rectangle(VkvgContext ctx, float x, float y, float w, float h);
/**
* @brief
*
}
void vkvg_flush (VkvgContext ctx){
_flush_cmd_buff(ctx);
- //_wait_flush_fence(ctx);
+ _wait_flush_fence(ctx);
/*
#ifdef DEBUG
void vkvg_rectangle (VkvgContext ctx, float x, float y, float w, float h){
_finish_path (ctx);
+ if (w <= 0 || h <= 0) {
+ ctx->status = VKVG_STATUS_INVALID_RECT;
+ return;
+ }
+
_add_point (ctx, x, y);
_add_point (ctx, x + w, y);
_add_point (ctx, x + w, y + h);
ctx->lineJoin = join;
}
void vkvg_set_operator (VkvgContext ctx, vkvg_operator_t op){
+ if (op == ctx->curOperator)
+ return;
+
+ _emit_draw_cmd_undrawn_vertices(ctx);//draw call with different ops cant be combined, so emit draw cmd for previous vertices.
+
ctx->curOperator = op;
+
if (ctx->cmdStarted)
_bind_draw_pipeline (ctx);
}