public static AddRef ( |
||
windowHandle | ||
width | int | |
height | int | |
Результат |
/// <summary> /// Initializes the control. /// </summary> protected override void OnCreateControl() { // Don't initialize the graphics device if we are running in the designer. if (!DesignMode) { graphicsDeviceService = GraphicsDeviceService.AddRef(Handle, ClientSize.Width, ClientSize.Height); // Register the service, so components like ContentManager can find it. services.AddService <IGraphicsDeviceService>(graphicsDeviceService); // Give derived classes a chance to initialize themselves. gametime = new GameTime(); starttime = DateTime.Now; currentframetime = DateTime.Now; DrawTimer = new Timer(); DrawTimer.Enabled = true; DrawTimer.Interval = 16; DrawTimer.Tick += new EventHandler(DrawTimer_Tick); Initialize(); initialized = true; } base.OnCreateControl(); }
/// <summary>Initializes the control.</summary> protected override void OnCreateControl() { if (!this.DesignMode) { this.graphicsDeviceService = GraphicsDeviceService.AddRef(this.Handle, this.ClientSize.Width, this.ClientSize.Height); this.services.AddService <IGraphicsDeviceService>((IGraphicsDeviceService)this.graphicsDeviceService); this.Initialize(); } base.OnCreateControl(); }
protected override void OnCreateControl() { // Don't initialize the graphics device if we are running in the designer. if (!DesignMode) { graphicsDeviceService = GraphicsDeviceService.AddRef(Handle, ClientSize.Width, ClientSize.Height); services.AddService <IGraphicsDeviceService>(graphicsDeviceService); _renderTarget = new SwapChainRenderTarget(GraphicsDevice, Handle, ClientSize.Width, ClientSize.Height); Initialize(); } base.OnCreateControl(); }
/// <summary> /// Initializes the control. /// </summary> protected override void OnCreateControl() { // Don't initialize the graphics device if we are running in the designer. if (!DesignMode) { graphicsDeviceService = GraphicsDeviceService.AddRef(Handle, ClientSize.Width, ClientSize.Height); // Register the service, so components like ContentManager can find it. services.AddService <IGraphicsDeviceService>(graphicsDeviceService); // Give derived classes a chance to initialize themselves. Initialize(); } base.OnCreateControl(); }
protected override void OnCreateControl() { if (!DesignMode) { _deviceService = GraphicsDeviceService.AddRef(Handle, ClientSize.Width, ClientSize.Height); _services.AddService <IGraphicsDeviceService>(_deviceService); if (ControlInitializing != null) { ControlInitializing(this, EventArgs.Empty); } Initialize(); if (ControlInitialized != null) { ControlInitialized(this, EventArgs.Empty); } } }