#include "rgl.h" void RGL_Rect(RGL_Context *ctx, unsigned int x, unsigned int y, unsigned int width, unsigned int height) { RGL_Command *rectCommand = (RGL_Command *)RGL_ArenaAlloc(&ctx->queue.arena, sizeof(RGL_Command)); rectCommand->type = Rect; rectCommand->data.rect.x = x; rectCommand->data.rect.y = y; rectCommand->data.rect.width = width; rectCommand->data.rect.height = height; rectCommand->data.rect.color = ctx->color; ctx->queue.size += 1; } void RGL_BeginPath(RGL_Context *ctx, RGL_PathVerb verb) { ctx->current = (RGL_Command *)RGL_ArenaAlloc(&ctx->queue.arena, sizeof(RGL_Command)); ctx->current->type = Path; ctx->current->data.path.color = ctx->color; ctx->current->data.path.size = 0; ctx->current->data.path.verb = verb; } void RGL_PathMoveTo(RGL_Context *ctx, int x, int y) { RGL_Point *p = (RGL_Point *)RGL_ArenaAlloc(&ctx->queue.arena, sizeof(RGL_Point)); p->x = RGL_GetFixedI(x); p->y = RGL_GetFixedI(y); ctx->current->data.path.size += 1; } void RGL_EndPath(RGL_Context *ctx) { ctx->current->data.path.color = ctx->color; ctx->current = 0; ctx->queue.size += 1; }