How to maximize window in XNA

后端 未结 5 2102
离开以前
离开以前 2021-01-14 22:35

This SHOULD be a very simple question but after lots of searching there seems to be no working example anywhere. I just want my XNA window to start off maximized. I know how

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-14 22:54

    _graphics = new GraphicsDeviceManager(this);
    DisplayMode displayMode = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode;
    this._graphics.PreferredBackBufferFormat = displayMode.Format;
    this._graphics.PreferredBackBufferWidth = (int)(displayMode.Width);
    this._graphics.PreferredBackBufferHeight = (int)(displayMode.Height);
    

    Sort of works for me but not quite, you'll understand once you try. I mean, it's not perfect and I'm sure there's a better way but for prototyping this should work - or maybe with some tweaking you could get what you need.

提交回复
热议问题