Game Window Screen smaller after use graphic.IsFullScreen = true

I got this problem.
I created new Monogame’s project and run it.
this is result.

And then . i add
> graphics.IsFullScreen = true;

        graphics.ApplyChanges();

into Game1() like this.

 public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            graphics.IsFullScreen = true;
            graphics.ApplyChanges();
            Content.RootDirectory = "Content";
        }

After that i run it. Of course,it showing full screen window.


And next, i deleted
> graphics.IsFullScreen = true;

        graphics.ApplyChanges();

from Game1().
So Game1() is similar initial code of new Monogame project.

   public Game1()
            {
                graphics = new GraphicsDeviceManager(this);
                Content.RootDirectory = "Content";
            }

And i run it again the result is ,Game Window is smaller.

I really have no idea why,
Anyone have the same problem?
I want game window be bigger like first picture.

Is it a bug?

Any suggestion for making game window bigger again?

Try commenting out the graphics.ApplyChanges(). I read an MSDN advisory that said to leave that statement out of initialization code.

Also, I note that you say, “So Game1() is similar initial code of new Monogame project.” Make it identical and see if your secondary problem goes away.

If all else fails, consult willmotil’s reply to my earlier question.

  public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            //graphics.IsFullScreen = true;
            //graphics.ApplyChanges();
            Content.RootDirectory = "Content";
        }

This is my Game1() . I have comment ApplyChanges out. I don’t have change other code of the new project. but it still show small game screen.

Thank you. I’ll follow willmotil’s reply on your question.

I have no clue as to what’s going on. I’d say start a fresh new project.

Will’s code is good guidance for sequences of code that really work – for fullscreen toggling and for window resizing.

are u setting the screen size anywhere?

You should be setting the size anyway instead of hoping that it comes out right. I wouldn’t rely on the default size at all, even if it worked right:

graphics.PreferredBackBufferWidth = width; graphics.PreferredBackBufferHeight = height;

I have set it to 640:480, but after used grapc.IsfullScreen = true and comment grapc.IsfullScreen = true out. my screen show smaller screen too. I dont know why, Only me got this problem?

I have set it but i got the same problem.

but where do you set it? if its not in the constructor it will only apply it when you come out of full screen and then apply changes.

Sorry i am newbie
Is this setting screen size?

graphics.PreferredBackBufferWidth = width;
graphics.PreferredBackBufferHeight = height;

I have use it. it work fine before i add 2 lines like this

graphics.PreferredBackBufferWidth = width;
graphics.PreferredBackBufferHeight = height;
graphics.IsFullScreen = true;
graphics.ApplyChanges();

Game Screen will set to full-screen,And after that i delete the 2 lines

graphics.IsFullScreen = true;
graphics.ApplyChanges();

When i run my code again my Game Screen is smaller like example image on my post that showing above

@Tanakhon_Kaewkunha

You need to set the width and height as well as when setting the IsFullScreen flag, when you apply changes and the full screen flag is true it will try and make the full screen to the size set. If your monitor can’t display that resolution at full screen then it will ignore the fullscreen flag. e.g. setting the width & height to both be 500 won’t work in full screen because your monitor can’t display a 500x500 resolution.

To help you out, this is what I have in one of my Game1() constuctors:

public Game1()
{
	_graphics = new GraphicsDeviceManager(this);
	_graphics.PreferredBackBufferWidth = Settings.ScreenWidth * Settings.PixelRatio;
	_graphics.PreferredBackBufferHeight = Settings.ScreenHeight * Settings.PixelRatio;
	_graphics.IsFullScreen = Settings.IsFullscreen;
	IsMouseVisible = Settings.IsMouseVisible;
	IsFixedTimeStep = true;
	Content.RootDirectory = nameof(Content);
} 

The Settings.* you see is just a singleton class I have that holds the settings: something like this:

public static class Settings
{
	public static Color BackgroundColor = Color.CornflowerBlue;
	public static Difficulty Difficulty = Difficulty.Novice;
	public static bool IsFullscreen = false;
	public static bool IsMouseVisible = true;
	public static int PixelRatio = 2;
	public static int ScreenHeight = 256;
	public static int ScreenWidth = 144;
}

Hope fully this helps.

BTW I think the default setting for the width/height is 800x640.