Skip to content

[rcore] Desktop full screen offset on y-axis #4880

Open
@FedericoMansutti

Description

@FedericoMansutti

Issue description

There is a slight offset on the y -axis after the screen is filled with Init window InitWindow(0, 0, "raylib");
It appears to not be setting the window to undecorated but computing the window size as the full monitor size, so the window origin ends up at a -y.

Environment

Platform: Desktop
OS: Windows 11
GPU: AMD RX 7900 XTX
Reproducible in both the mingw32 compiler (VSCode) and msvc (VStudio)

Issue Screenshot

VStudio (msvc)
Image

VSCode (ming32)
Image

Interestingly this issue seems worse on VStudio.

Code Example

int main()
{
    // Initialization
    //--------------------------------------------------------------------------------------
    InitWindow(0, 0, "raylib");

    int currentMonitor = GetCurrentMonitor();

    camera.position = Vector3{ 10.0f, 10.0f, 8.0f };
    camera.target = Vector3{ 0.0f, 0.0f, 0.0f };
    camera.up = Vector3{ 0.0f, 1.0f, 0.0f };
    camera.fovy = 60.0f;
    camera.projection = CAMERA_PERSPECTIVE;

    //--------------------------------------------------------------------------------------
    int targetFPS = GetMonitorRefreshRate(currentMonitor);
    SetTargetFPS(targetFPS);             // Set our game to run at the monitor refresh rate
    //--------------------------------------------------------------------------------------

    // Main game loop
    while (!WindowShouldClose())    // Detect window close button or ESC key
    {
        UpdateDrawFrame();
    }

    // De-Initialization
    //--------------------------------------------------------------------------------------
    CloseWindow();                  // Close window and OpenGL context
    //--------------------------------------------------------------------------------------

    return 0;
}

Current workarounds:

  1. SetConfigFlags(FLAG_FULLSCREEN_MODE);
  2. SetConfigFlags(FLAG_WINDOW_RESIZABLE);
    InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window");
    MaximizeWindow();

Metadata

Metadata

Assignees

No one assigned

    Labels

    windowingIssues about the window system

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions