Beispiel #1
0
        public void CompileShader()
        {
            try {
                ShazzamSwitchboard.MainWindow.Effect = blur;
                versionNotSupported.Visibility       = Visibility.Hidden;

                blurStoryBoard.Begin(this, true);

                if (Shazzam.Properties.Settings.Default.TargetFramework == "WPF_PS3")
                {
                    if (RenderCapability.IsPixelShaderVersionSupported(3, 0))
                    {
                        versionNotSupported.Visibility = Visibility.Hidden;
                    }
                    else
                    {
                        versionNotSupported.Visibility = Visibility.Visible;
                    }
                    _compiler.Compile(this.CodeText, ShaderProfile.PixelShader3);
                    //_compiler.Compile(this.CodeText);
                }
                else
                {
                    _compiler.Compile(this.CodeText, ShaderProfile.PixelShader2);
                    //_compiler.Compile(this.CodeText);
                }


                compileStatusText.Text = String.Format("Last Compiled at: {0}", DateTime.Now.ToLongTimeString());
            }
            catch (CompilerException ex) {
                MessageBox.Show(ShazzamSwitchboard.MainWindow, ex.Message, "Could not compile", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Beispiel #2
0
        private void OnViewLoaded(object sender, RoutedEventArgs e)
        {
            MouseLeftButtonDown         += view_MouseButtonIgnore;
            MouseLeftButtonUp           += view_MouseButtonIgnore;
            MouseRightButtonUp          += view_MouseRightButtonUp;
            PreviewMouseRightButtonDown += view_PreviewMouseRightButtonDown;

            var vm = DataContext as IWatchViewModel;

            //check this for null so the designer can load the preview
            if (vm != null)
            {
                vm.VisualizationManager.RenderComplete          += VisualizationManagerRenderComplete;
                vm.VisualizationManager.ResultsReadyToVisualize += VisualizationManager_ResultsReadyToVisualize;

                var renderingTier           = (RenderCapability.Tier >> 16);
                var pixelShader3Supported   = RenderCapability.IsPixelShaderVersionSupported(3, 0);
                var pixelShader4Supported   = RenderCapability.IsPixelShaderVersionSupported(4, 0);
                var softwareEffectSupported = RenderCapability.IsShaderEffectSoftwareRenderingSupported;
                var maxTextureSize          = RenderCapability.MaxHardwareTextureSize;

                vm.ViewModel.Model.Logger.Log(string.Format("RENDER : Rendering Tier: {0}", renderingTier), LogLevel.File);
                vm.ViewModel.Model.Logger.Log(string.Format("RENDER : Pixel Shader 3 Supported: {0}", pixelShader3Supported), LogLevel.File);
                vm.ViewModel.Model.Logger.Log(string.Format("RENDER : Pixel Shader 4 Supported: {0}", pixelShader4Supported), LogLevel.File);
                vm.ViewModel.Model.Logger.Log(string.Format("RENDER : Software Effect Rendering Supported: {0}", softwareEffectSupported), LogLevel.File);
                vm.ViewModel.Model.Logger.Log(string.Format("RENDER : Maximum hardware texture size: {0}", maxTextureSize), LogLevel.File);
            }

            DrawGrid();
        }
Beispiel #3
0
        private void OnModalDialogsRegionSelectionChanged(object sender, SelectionChangedEventArgs args)
        {
            var enableShaders = RenderCapability.IsPixelShaderVersionSupported(2, 0);

            if (ModalDialogsRegion.ActiveDialog == null)
            {
                GameScreensRegionBorder.ClearValue(OpacityProperty);
                GameScreensRegionBorder.ClearValue(EffectProperty);
                CheckScreenFocus();
            }
            else if (enableShaders)
            {
                GameScreensRegionBorder.Effect = new ColorToneEffect
                {
                    DarkColor    = Color.FromScRgb(1.0f, 0.1f, 0.075f, 0.125f),
                    LightColor   = Color.FromScRgb(1.0f, 0.4f, 0.3f, 0.5f),
                    Desaturation = .8,
                    ToneAmount   = 0
                };
            }
            else
            {
                GameScreensRegionBorder.Opacity = 0.4;
            }
        }
 private void SettingsPlugin_Loaded(object sender, RoutedEventArgs e)
 {
     if (RenderCapability.IsPixelShaderVersionSupported(3, 0))
     {
         notAvailable.Visibility = Visibility.Collapsed;
     }
     else
     {
         notAvailable.Visibility = Visibility.Visible;
         notAvailable.ToolTip    = "PS_3 is not supported on your video card.";
     }
 }
Beispiel #5
0
 private void SettingsPluginLoaded(object sender, RoutedEventArgs e)
 {
     if (RenderCapability.IsPixelShaderVersionSupported(3, 0))
     {
         this.NotAvailable.SetCurrentValue(VisibilityProperty, Visibility.Collapsed);
     }
     else
     {
         this.NotAvailable.SetCurrentValue(VisibilityProperty, Visibility.Visible);
         this.NotAvailable.SetCurrentValue(ToolTipProperty, "PS_3 is not supported on your video card.");
     }
 }
        private void LogVisualizationCapabilities()
        {
            var renderingTier           = (RenderCapability.Tier >> 16);
            var pixelShader3Supported   = RenderCapability.IsPixelShaderVersionSupported(3, 0);
            var pixelShader4Supported   = RenderCapability.IsPixelShaderVersionSupported(4, 0);
            var softwareEffectSupported = RenderCapability.IsShaderEffectSoftwareRenderingSupported;
            var maxTextureSize          = RenderCapability.MaxHardwareTextureSize;

            logger.Log(string.Format("RENDER : Rendering Tier: {0}", renderingTier));
            logger.LogError(string.Format("RENDER : Pixel Shader 3 Supported: {0}", pixelShader3Supported));
            logger.Log(string.Format("RENDER : Pixel Shader 4 Supported: {0}", pixelShader4Supported));
            logger.Log(string.Format("RENDER : Software Effect Rendering Supported: {0}", softwareEffectSupported));
            logger.Log(string.Format("RENDER : Maximum hardware texture size: {0}", maxTextureSize));
        }
Beispiel #7
0
        private void RecordRenderCapabilities()
        {
            UnsafeNativeMethods.Set(this.sqmSessionHandle, 33U, (uint)(RenderCapability.Tier >> 16));
            short majorVersionRequested = (short)3;
            short minorVersionRequested = (short)0;

            if (!RenderCapability.IsPixelShaderVersionSupported(majorVersionRequested, minorVersionRequested))
            {
                majorVersionRequested = (short)2;
                if (!RenderCapability.IsPixelShaderVersionSupported(majorVersionRequested, minorVersionRequested))
                {
                    majorVersionRequested = (short)0;
                }
            }
            UnsafeNativeMethods.Set(this.sqmSessionHandle, 34U, ((uint)majorVersionRequested << 16) + (uint)minorVersionRequested);
        }
 public TabControlTransitionSelector()
 {
     if (!RenderCapability.IsPixelShaderVersionSupported(2, 0))
     {
         return;
     }
     _transitions = new TransitionEffect[]
     {
         new SmoothSwirlGridTransitionEffect(),
         new BlindsTransitionEffect(),
         new CircleRevealTransitionEffect(),
         new CloudRevealTransitionEffect(),
         new FadeTransitionEffect(),
         new PixelateTransitionEffect(),
         new RadialBlurTransitionEffect(),
         new RippleTransitionEffect(),
         new WaveTransitionEffect(),
         new WipeTransitionEffect(),
         new SmoothSwirlGridTransitionEffect(),
         new BlodTransitionEffectEffect(),
         new FoldTransitionEffectEffect(),
         new PivotTransitionEffectEffect(PivotTransitionEffectEffect.Direction.Left),
         new PivotTransitionEffectEffect(PivotTransitionEffectEffect.Direction.Right),
         new SlideInTransitionEffect {
             SlideDirection = SlideDirection.TopToBottom
         },
         new SlideInTransitionEffect {
             SlideDirection = SlideDirection.LeftToRight
         },
         new SlideInTransitionEffect {
             SlideDirection = SlideDirection.RightToLeft
         },
         new SlideInTransitionEffect {
             SlideDirection = SlideDirection.BottomToTop
         }
     };
     _transitions = (from i in _transitions orderby _random.Next() select i).ToArray();
     _animcount   = new int[_transitions.Length];
 }