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] Simplify EmscriptenResizeCallback() #4415

Merged
merged 1 commit into from
Oct 22, 2024

Conversation

asdqwe
Copy link
Contributor

@asdqwe asdqwe commented Oct 22, 2024

So it doesn't depend on macro'd JS functions. Changes 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()) {
        BeginDrawing();
        ClearBackground(RAYWHITE);

        DrawText("Resize the browser window manually", 20, 20, 20, BLACK);
        DrawText(TextFormat("canvas size: %i x %i", GetScreenWidth(), GetScreenHeight()), 20, 40, 20, BLACK);

        EndDrawing();
    }
    CloseWindow();
    return 0;
}

@raysan5 raysan5 merged commit 4cd243f into raysan5:master Oct 22, 2024
14 checks passed
@raysan5
Copy link
Owner

raysan5 commented Oct 22, 2024

@asdqwe Nice! Thanks for the review!

@asdqwe asdqwe deleted the simplify-resizecallback-web branch October 22, 2024 12:07
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