Window dimension not right

Hi, I am trying go through C++ fundamentals course and when I am in visual studio code, everything is ok. But lately found, that when I start coded game (or just bare code for window initialization) the size of the window does not corespond with the settings in the code.

On screenshot you can see on top runing it from exe file, and on bottom from debuging option within VS code.

Could you please help me figure out what is causing it?

code example


#include "raylib.h"
const int width {1024};
const int height {768};
int fps {60};


int main()
{

     InitWindow(width, height, "Dapper Dasher!!");
     SetTargetFPS(fps);

     while(!WindowShouldClose()){
        BeginDrawing();
        ClearBackground(BLACK);


        
        EndDrawing();
     }
CloseWindow();

}

Hi Libor,

I’m not able to replicate the issue on my end, what OS are you using? Though in the grand scheme of things I wouldn’t worry about it, as it won’t affect your ability to follow the course.

Hi Tuomo,

I am running latest version of windows 11 (build 22000). Also for more information including dxdiag info
DX Diag

For me is just strange, that in visual studio it is working. I know that I can continue with curse like this, but on the other hand, I would like to know whats going on :slight_smile:

Tried again in Windows 11 (I was using Linux before) and still couldn’t replicate the problem. One hail-mary shot would be to try updating your graphics drivers both for the integrated AMD GPU and for the NVidia (dedicated) GPU.

Hi,

just found where the probleme where. It was in the dpi setings of the system. As I am using multiple monitors, on one of them is set DPI scale and when I check in compatibility setings of specific app to override dpi settings with app settings it started working.

Hope this may help also others in future :slight_smile:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms