Files
PixelDefense/engine/tests/ui_test.c
2023-12-21 15:27:49 +01:00

48 lines
987 B
C

#define BZ_ENTRYPOINT
#include <breeze.h>
#include <raylib.h>
#include <rlImGui.h>
BzUI *ui;
bool init(int *game) {
rlImGuiSetup(true);
ui = bzUICreate();
return true;
}
void render(float dt, int *game) {
ClearBackground(WHITE);
bzUIBegin(ui, GetScreenWidth(), GetScreenHeight());
bzUIPushLayout(ui, *&(BzUILayout) {
.type = BZ_UI_LAYOUT_FLEX_BOX,
.flags = BZ_UI_FLEX_DIR_COLUMN | BZ_UI_FLEX_ALIGN_CENTER | BZ_UI_FLEX_JUSTIFY_CENTER,
});
if (bzUIButton(ui, "Hello world", NULL)) {
bzLogInfo("Hello world");
}
if (bzUIButton(ui, "foo", NULL)) {
bzLogInfo("foo");
}
if (bzUIButton(ui, "bar", NULL)) {
bzLogInfo("bar");
}
bzUIEnd(ui);
rlImGuiBegin();
igShowDemoWindow(NULL);
rlImGuiEnd();
}
bool bzMain(BzAppDesc *appDesc, int argc, const char **argv) {
appDesc->init = (BzAppInitFunc) init;
appDesc->render = (BzAppRenderFunc) render;
return true;
}