protected void OnRendering(object sender, EventArgs e) { if (_d3DScene != null) { _d3DScene.Render(); } if (OnRenderView != null) { OnRenderView(sender, e); } WeatherGame.RenderLoop.Game.Device.Flush(); if (D3DImageContainer != null) { D3DImageContainer.InvalidateD3DImage(); } }
private void OnRendering(object sender, EventArgs e) { var re = (RenderingEventArgs)e; var time = re.RenderingTime; _dxScene.Wireframe = renderProps.Wireframe; SlimDX.Direct3D10.Texture2D lastTexture = _dxScene.SharedTexture; _dxScene.Render((float)time.TotalSeconds, (int)helixView.ActualWidth, (int)helixView.ActualHeight); // output buffer could change because of size change if (lastTexture != _dxScene.SharedTexture) { _dxImageContainer.SetBackBufferSlimDX(_dxScene.SharedTexture); } _dxImageContainer.InvalidateD3DImage(); _frameCounter.AddFrame(); textFrameRate.Text = _frameCounter.FramesPerSecond.ToString("f1"); }