The window's size is different from the one I set up.

Hello, i’ve been working on a windows project since more than a year and is the first time i have this problem:
When setting the window’s size with the lines
graphics.PreferredBackBufferWidth = X;
graphics.PreferredBackBufferHeight = Y;
it doesn’t work correctly, and the window’s size ends being different. for 640x480, it uses 800x600. For 1000,1000, it even doesn’t respect the ratio and ends being something like 12xx 10xx.
Also, what’s drawn is scaled so the game goes from 640x480 to 800x600, no matter which resolution i try.

I can’t really say when it began, and I’ve been touching and commenting everything i think may be related but can’t fix it. I’ve created a new project and it works fine, so in the worst case i may just try to copy the game into a new proyect, i’m not sure if it’s a code related problem or not.

Any idea?
Thank you for reading!

Is this in full screen? What MonoGame version? What platform? Can you show the code you’re using?

It’s windowed, monogame version is 3.6 and i’m working on windows 10.
I just woke up, I’m gonna try to just comment everything (well, i did it yesternight, but just in case i missed something) and post the code later.
thanks for replying!

I’ve removed near everything and just left the same code you can find when you create a new project, and even it kept creating the window with a different size i think i’ve got what the problem is:
GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width and Height have the wrong size in my project, while in a new one it returns the correct 1920x1080 of my screen.

Seems related to this:

I’m trying to copy the new dlls to the old project but still keep drawing it wrong, but i guess i just have to look into that direction.

Edit: At the end i’ve just created a new project and moved to it, it works fine.

I don’t have a clue what caused this issue, but nice that you resolved it :slight_smile: