private void Log(string message)
        {
            //System.Diagnostics.Debug.WriteLine(message);

            InfoTextBlock.Text += message + Environment.NewLine;
            InfoTextBlock.ScrollToEnd();
        }
Beispiel #2
0
        private void StartBenchmark()
        {
            StartStopTestButton.Content = "Abort benchmark";

            OptionsGrid.Visibility   = Visibility.Collapsed;
            InfoTextBlock.Visibility = Visibility.Visible;

            _mouseCameraController.IsEnabled = false;

            _totalRenderTimes.Clear();

            _performanceAnalyzer = new PerformanceAnalyzer(_mainDXViewportView);


            // get only system info
            string systemInfo = _performanceAnalyzer.GetResultsText(addSystemInfo: true, addDXEngineInfo: true, addGarbageCollectionsInfo: false, addTotals: false, addStateChangesStatistics: false, addFirstFrameStatisticsWhenAvailable: false, addRenderingStatistics: false, addMultiThreadingStatistics: false);

            InfoTextBlock.Text = $"Starting benchmark ({_mainDXViewportView.PresentationType} with {_objectsCount} objects)\r\nwith changing MaxBackgroundThreadsCount from 0 to {ThreadsCountSlider.Maximum:0}.\r\n\r\n{systemInfo}\r\n====================\r\n\r\nRendering with MaxBackgroundThreadsCount = 0\r\n\r\n";
            InfoTextBlock.UpdateLayout();
            InfoTextBlock.ScrollToEnd();


            SetLightingMode(LightingMode.DirectionalLight);
            ThreadsCountSlider.Value = 0;

            _benchmarkResults          = new StringBuilder();
            _benchmarkTotalRenderTimes = new List <double>();

            _benchmarkStepFramesCount          = 1;
            _mainDXViewportView.SceneRendered += OnBenchmarkSceneRendered;
        }
Beispiel #3
0
        private void UpdateInfoTextBlockWidths()
        {
            if (ActualWidth < 750)
            {
                // Hide the image
                BannerImage.Visibility = Visibility.Collapsed;

                InfoTextBlock.ClearValue(TextBlock.MaxWidthProperty);
            }
            else
            {
                // Adjust the TextBlockEx controls width so the controls do not overlap with with BannerImage
                double infoTextWidth = ActualWidth - BannerImage.ActualWidth - 60;
                InfoTextBlock.MaxWidth = infoTextWidth;

                if (BannerImage.Visibility == Visibility.Collapsed)
                {
                    BannerImage.Visibility = Visibility.Visible;
                }
            }
        }
Beispiel #4
0
 private void AddInfoText(string text)
 {
     InfoTextBlock.Text += text + Environment.NewLine;
     InfoTextBlock.ScrollToEnd();
 }