Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rcore] [web] Updates SetWindowState() and ClearWindowState() to handle FLAG_WINDOW_MAXIMIZED for PLATFORM_WEB #4402

Merged
merged 2 commits into from
Oct 20, 2024

Conversation

asdqwe
Copy link
Contributor

@asdqwe asdqwe commented Oct 20, 2024

Complementary to #4397. This PR can be tested with:

// Note: usage of `minshell.html` is recommended since it won't force canvas CSS overrides

#include "raylib.h"
int main(void) {
    InitWindow(800, 450, "test");
    SetTargetFPS(60);

    SetWindowState(FLAG_WINDOW_RESIZABLE);

    while (!WindowShouldClose()) {

        if (IsKeyPressed(KEY_ONE)) SetWindowState(FLAG_WINDOW_MAXIMIZED);
        if (IsKeyPressed(KEY_TWO)) ClearWindowState(FLAG_WINDOW_MAXIMIZED);

        if (IsKeyPressed(KEY_Q)) MaximizeWindow();
        if (IsKeyPressed(KEY_W)) RestoreWindow();

        BeginDrawing();
        ClearBackground(RAYWHITE);
        DrawText("test", 20, 20, 20, BLACK);
        EndDrawing();
    }
    CloseWindow();
    return 0;
}

@raysan5 raysan5 merged commit 4290a0d into raysan5:master Oct 20, 2024
14 checks passed
@raysan5
Copy link
Owner

raysan5 commented Oct 20, 2024

@asdqwe Thanks for the further review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants