public DXGameWindow(XGamePlatform platform, Control control) : base(platform) { if (control == null) { throw new ArgumentNullException("control"); } this.Control = control; this.Cursor = new DXGameWindowCursor(control); this.Control_ClientSizeChanged(this, EventArgs.Empty); if (this.Control.TopLevelControl is Form) { formClose = delegate() { (this.Control.TopLevelControl as Form).Close(); }; } this.desc = new SwapChainDescription() { BufferCount = 2, ModeDescription = new ModeDescription((int)this.Width, (int)this.Height, new Rational(60, 1), Format.R8G8B8A8_UNorm), IsWindowed = true, OutputHandle = this.Control.Handle, SampleDescription = new SampleDescription(1, 0), // multisampling ? SwapEffect = SwapEffect.Discard, Usage = Usage.RenderTargetOutput }; this.Control.Disposed += Control_Disposed; this.Control.ClientSizeChanged += Control_ClientSizeChanged; }
public DXGameDeviceManager(XGamePlatform platform) { if (platform == null) { throw new ArgumentNullException("platform"); } this.platform = platform; (this.platform.Game as DXGame).Services.AddService(typeof(IGraphicsDeviceManager), this); (this.platform.Game as DXGame).Services.AddService(typeof(IGraphicsDeviceService), this); }
public void Dispose() { Console.WriteLine("DXGameDeviceManager.Dispose .. start"); this.GraphicsDevice.Dispose(); this.GraphicsDevice = null; this.Dx11Device.Dispose(); this.Dx11Device = null; this.Factory.Dispose(); this.Factory = null; this.platform = null; Console.WriteLine("DXGameDeviceManager.Dispose .. done"); }