public ResolutionComponent(Game game, GraphicsDeviceManager graphics, Point virtualResolution, Point screenResolution, bool fullscreen, bool letterbox) : base(game) { _graphics = graphics; VirtualResolution = virtualResolution; ScreenResolution = screenResolution; _fullscreen = fullscreen; _letterbox = letterbox; Game.Components.Add(this); Game.Services.AddService <IResolution>(this); ResolutionAdapter = new ResolutionAdapter(_graphics); ResolutionAdapter.SetVirtualResolution(VirtualResolution.X, VirtualResolution.Y); ResolutionAdapter.SetScreenResolution(ScreenResolution.X, ScreenResolution.Y, _fullscreen, _letterbox); ResolutionAdapter.ResetViewport(); }
public void ResetViewport() { ResolutionAdapter.ResetViewport(); }
public override void Draw(GameTime gameTime) { ResolutionAdapter.ResetViewport(); base.Draw(gameTime); }