diff --git a/engine/breeze/ui/ui.c b/engine/breeze/ui/ui.c index aa802dc..f224656 100644 --- a/engine/breeze/ui/ui.c +++ b/engine/breeze/ui/ui.c @@ -71,6 +71,7 @@ typedef struct BzUI { bool captureKeyboard; bool capturedMouse; bool capturedKeyboard; + bool debugMode; } BzUI; BzUIKey bzUIKeyNull() { @@ -171,6 +172,10 @@ void bzUISetCaptureKeyboard(BzUI *ui, bool state) { ui->captureKeyboard = state; } +void bzUISetDebugMode(BzUI *ui, bool mode) { + ui->debugMode = mode; +} + void bzUIBegin(BzUI *ui, i32 width, i32 height) { bzArrayClear(ui->nodeStack); bzArrayPush(ui->nodeStack, ui->root); @@ -508,7 +513,7 @@ static void renderNode(BzUI *ui, BzUINode *node) { drawRect.x, drawRect.y }, style.fontSize, style.fontSpacing, color); } - if (node->flags & BZ_UI_DRAW_DEBUG) { + if (node->flags & BZ_UI_DRAW_DEBUG || ui->debugMode) { DrawRectangleLines(rect.x, rect.y, rect.width, rect.height, RED); } diff --git a/engine/breeze/ui/ui.h b/engine/breeze/ui/ui.h index 7bb2dea..b74e25b 100644 --- a/engine/breeze/ui/ui.h +++ b/engine/breeze/ui/ui.h @@ -189,6 +189,8 @@ bool bzUIGetCaptureKeyboard(BzUI *ui); void bzUISetCaptureMouse(BzUI *ui, bool state); void bzUISetCaptureKeyboard(BzUI *ui, bool state); +void bzUISetDebugMode(BzUI *ui, bool mode); + void bzUIBegin(BzUI *ui, i32 width, i32 height); void bzUIEnd(BzUI *ui);