RobLoach / raylib-nuklear

Nuklear immediate mode GUI for raylib

Home Page:https://robloach.github.io/raylib-nuklear/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Windows are not properly closed.

rsachetto opened this issue · comments

If you draw a single window and try to close it, the window do not close.

The above code is a small example of this issue.

int main() {
    InitWindow(640, 480, "raylib-nuklear example");

    // Create the Nuklear Context
    int fontSize = 10;
    struct nk_context *ctx = InitNuklear(fontSize);

    while (!WindowShouldClose()) {
        // Update the Nuklear context, along with input
        UpdateNuklear(ctx);

        // Nuklear GUI Code
        // https://github.com/Immediate-Mode-UI/Nuklear/wiki/Window
        if (nk_begin(ctx, "Nuklear", nk_rect(100, 100, 220, 220),
                NK_WINDOW_BORDER|NK_WINDOW_MOVABLE|NK_WINDOW_CLOSABLE)) {
            if (nk_button_label(ctx, "Button")) {
                // Button was clicked!
            }
        }
        nk_end(ctx);

        // Render
        BeginDrawing();
            ClearBackground(RAYWHITE);

            // Render the Nuklear GUI
            DrawNuklear(ctx);

        EndDrawing();
    }

    // De-initialize the Nuklear GUI
    UnloadNuklear(ctx);

    CloseWindow();
    return 0;
}

did you figure it out??? Could be one of the initializer constants.

Sorry, I closed the issue because the problem also happened using Nucklear without raylib.So I think the problem is upstream.

Thanks