private protected WindowManager(Game game) : base(game) { DpiScaling = SystemInfo.DisplayScalingFactor(System.Windows.Forms.Screen.FromControl((System.Windows.Forms.Form)System.Windows.Forms.Control.FromHandle(game.Window.Handle))); ControlLayout.ScaleFactor = DpiScaling; clientBounds = Game.Window.ClientBounds; WhiteTexture = new Texture2D(game.GraphicsDevice, 1, 1, false, SurfaceFormat.Color); WhiteTexture.SetData(new[] { Color.White }); MaterialManager.Initialize(game.GraphicsDevice); game.Window.ClientSizeChanged += Window_ClientSizeChanged; DrawOrder = 100; spriteBatch = new SpriteBatch(GraphicsDevice); //TODO 20211104 needs to move to a TextureManager using (FileStream stream = File.OpenRead(Path.Combine(RuntimeInfo.ContentFolder, "NoTitleBarWindow.png"))) { windowTexture = Texture2D.FromStream(GraphicsDevice, stream); } WindowShader = MaterialManager.Instance.EffectShaders[ShaderEffect.PopupWindow] as PopupWindowShader; WindowShader.GlassColor = Color.Black; WindowShader.Opacity = 0.6f; WindowShader.WindowTexture = windowTexture; TextFontDefault = FontManager.Scaled(DefaultFont, System.Drawing.FontStyle.Regular)[DefaultFontSize]; TextFontDefaultBold = FontManager.Scaled(DefaultFont, System.Drawing.FontStyle.Bold)[DefaultFontSize]; UpdateSize(); }