-1

I want to change the resolution of my game in the menu. Now I've made a nice method where it looks up if the resolution is available for this PC and changes then it does:

graphics.PreferredBackBufferWidth = iWidth;
graphics.PreferredBackBufferHeight = iHeight;
ScreenManager.sScreenSize.X = iWidth;
ScreenManager.sScreenSize.Y = iHeight;
graphics.ApplyChanges();

sScreenSize is just a rectangle for the buttons to position and such things.

When I call this function at start then everything is right, but if I call it in the menu, the resolution changes, but nothing that gets drawn changes. So I see only some percent of the screen. How do I fix it? I can only find online how to initialize the resolution.

Racil Hilan
  • 24,690
  • 13
  • 50
  • 55

1 Answers1

0

I had to remove the screen before I changed the resolution and then add the screen then again.

takendarkk
  • 3,347
  • 8
  • 25
  • 37