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] Add GetMonitorScale() #4525

Closed
wants to merge 3 commits into from
Closed

Conversation

ghost
Copy link

@ghost ghost commented Nov 20, 2024

Ref: #4522

Necessary to allow the user to factor in arbitrary user defined/applied monitor scales (GLFW ref, SDL3 ref, Web ref).
Note: this is different from GetWindowScaleDPI (GLFW ref, SDL3 ref).
The PR can be tested with:

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

        const Vector2 monitorScale = GetMonitorScale(GetCurrentMonitor());

        BeginDrawing();
        ClearBackground(RAYWHITE);
        DrawText(TextFormat("monitor scale %fx%f", monitorScale.x, monitorScale.y), 20, 20, 20, BLACK);
        EndDrawing();
    }
    CloseWindow();
    return 0;
}

@ghost
Copy link
Author

ghost commented Nov 21, 2024

After further review GetMonitorScale() will basically end up returning the same as GetWindowScaleDPI(), so I guess no need for this function afterall.

@ghost ghost closed this Nov 21, 2024
@ghost ghost deleted the add-getmonitorscale branch November 22, 2024 12:12
This pull request was closed.
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.

1 participant