Beispiel #1
0
        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");
        }