Remove nuklear from engine

This commit is contained in:
2023-11-10 10:13:49 +01:00
parent 3468e6caf4
commit 2f358ef5f7
5 changed files with 29 additions and 48 deletions

View File

@@ -207,17 +207,15 @@ int sizeY = 1;
void render(float dt, Game *game) {
Camera2D *camera = &game->camera;
if (!nk_item_is_any_active(NK)) {
if (IsKeyDown(KEY_W)) camera->target.y -= 20;
if (IsKeyDown(KEY_S)) camera->target.y += 20;
if (IsKeyDown(KEY_A)) camera->target.x -= 20;
if (IsKeyDown(KEY_D)) camera->target.x += 20;
if (IsKeyDown(KEY_W)) camera->target.y -= 20;
if (IsKeyDown(KEY_S)) camera->target.y += 20;
if (IsKeyDown(KEY_A)) camera->target.x -= 20;
if (IsKeyDown(KEY_D)) camera->target.x += 20;
if (IsKeyDown(KEY_Q)) camera->rotation--;
if (IsKeyDown(KEY_E)) camera->rotation++;
if (IsKeyDown(KEY_Q)) camera->rotation--;
if (IsKeyDown(KEY_E)) camera->rotation++;
camera->zoom += ((float) GetMouseWheelMove() * 0.05f);
}
camera->zoom += ((float) GetMouseWheelMove() * 0.05f);
BeginMode2D(*camera);
ClearBackground(RAYWHITE);
@@ -238,25 +236,7 @@ void render(float dt, Game *game) {
EndMode2D();
if (nk_begin(NK, "DebugMenu", nk_rect(50, 50, 220, 220),
NK_WINDOW_BORDER |NK_WINDOW_MOVABLE | NK_WINDOW_SCALABLE |
NK_WINDOW_TITLE | NK_WINDOW_MINIMIZABLE)) {
// fixed widget pixel width
nk_layout_row_static(NK, 30, 80, 1);
nk_labelf(NK, NK_TEXT_LEFT, "tileX: %d", tileX);
nk_labelf(NK, NK_TEXT_LEFT, "tileY: %d", tileY);
static char buf[256] = {};
nk_edit_string_zero_terminated(NK, NK_EDIT_FIELD, buf, sizeof(buf) - 1, nk_filter_default);
nk_labelf(NK, NK_TEXT_LEFT, "x: %d", sizeX);
nk_labelf(NK, NK_TEXT_LEFT, "y: %d", sizeY);
nk_slider_int(NK, 0, &sizeX, 10, 1);
nk_slider_int(NK, 0, &sizeY, 10, 1);
}
nk_end(NK);
}
bool bzMain(BzAppDesc *appDesc, int argc, const char **argv) {