Ejemplo n.º 1
0
        private void ReinitializeWindow()
        {
            if (_renderSetup == null)
            {
                return;
            }

            _renderSetup.Resize((int)XGrid.ActualWidth, (int)XGrid.ActualHeight);
            _D3DImageContainer.SetBackBufferSharpDX(_renderSetup.SharedTexture);

            var contextSettings = new ContextSettings();

            contextSettings.DisplayMode = new SharpDX.Direct3D9.DisplayMode()
            {
                Width       = _renderSetup.WindowWidth,
                Height      = _renderSetup.WindowHeight,
                RefreshRate = 60,
                Format      = D3DImageSharpDX.TranslateFormat(_renderSetup.SharedTexture)
            };
            contextSettings.AspectRatio = contextSettings.DisplayMode.AspectRatio;

            _defaultContext = OperatorPartContext.createDefault(contextSettings);

            if (_operator != null && _operator.Outputs.Count > 0)
            {
                var invalidator = new OperatorPart.InvalidateVariableAccessors("AspectRatio");
                _operator.Outputs[0].TraverseWithFunction(null, invalidator);
            }

            RenderContent();
        }
Ejemplo n.º 2
0
        private void CreateContextSettingsWithAspectRatio()
        {
            _D3DImageContainer.SetBackBufferSharpDX(_sharedTexture);

            var contextSettings = new ContextSettings();

            contextSettings.DisplayMode = new SharpDX.Direct3D9.DisplayMode()
            {
                Width       = RenderConfig.Width,
                Height      = RenderConfig.Height,
                RefreshRate = 60,
                Format      = D3DImageSharpDX.TranslateFormat(_sharedTexture)
            };
            contextSettings.AspectRatio = contextSettings.DisplayMode.AspectRatio;
            _defaultContext             = OperatorPartContext.createDefault(contextSettings);
        }
Ejemplo n.º 3
0
        private void SetupRendering()
        {
            XSceneImage.Source = _D3DImageContainer;
            _renderSetup       = new D3DRenderSetup((int)XGrid.ActualWidth, (int)XGrid.ActualHeight);
            _D3DImageContainer.SetBackBufferSharpDX(_renderSetup.SharedTexture);

            var contextSettings = new ContextSettings();

            contextSettings.DisplayMode = new SharpDX.Direct3D9.DisplayMode()
            {
                Width       = _renderSetup.WindowWidth,
                Height      = _renderSetup.WindowHeight,
                RefreshRate = 60,
                Format      = D3DImageSharpDX.TranslateFormat(_renderSetup.SharedTexture)
            };
            contextSettings.AspectRatio = contextSettings.DisplayMode.AspectRatio;
            _defaultContext             = OperatorPartContext.createDefault(contextSettings);
        }