Integrate nuklear into engine

This commit is contained in:
2023-11-08 10:04:47 +01:00
parent 16972e4f9a
commit efada40908
3 changed files with 66 additions and 35 deletions

View File

@@ -59,14 +59,22 @@ void render(float dt, Game *game) {
camera->zoom += ((float)GetMouseWheelMove() * 0.05f);
BeginDrawing();
BeginMode2D(*camera);
ClearBackground(RAYWHITE);
bzTileMapDraw(&game->map);
EndMode2D();
EndDrawing();
if (nk_begin(NK, "Show", nk_rect(50, 50, 220, 220),
NK_WINDOW_BORDER|NK_WINDOW_MOVABLE|NK_WINDOW_CLOSABLE)) {
// fixed widget pixel width
nk_layout_row_static(NK, 30, 80, 1);
if (nk_button_label(NK, "button")) {
// event handling
}
}
nk_end(NK);
}
bool bzMain(BzAppDesc *appDesc, int argc, const char **argv) {
@@ -80,6 +88,7 @@ bool bzMain(BzAppDesc *appDesc, int argc, const char **argv) {
appDesc->render = (BzAppRenderFunc) render;
appDesc->userData = &GAME;
appDesc->useNuklear = true;
return true;
}