Esempio n. 1
0
        public void Evaluate(int SpreadMax)
        {
            this.cursorDisplay.HideCursor = !this.FInShowCursor[0];

            if (this.FOutQueryable[0] == null)
            {
                this.FOutQueryable[0] = this;
            }
            if (this.FOutBackBuffer[0] == null)
            {
                this.FOutBackBuffer[0] = new DX11Resource <DX11SwapChain>();
                this.FOuFS             = new Spread <DX11Resource <DX11SwapChain> >();
                this.FOuFS.SliceCount  = 1;
                this.FOuFS[0]          = new DX11Resource <DX11SwapChain>();
            }

            this.updateddevices.Clear();
            this.rendereddevices.Clear();
            this.FInvalidateSwapChain = false;

            if (!this.depthmanager.FormatChanged) // do not clear reset if format changed
            {
                this.depthmanager.NeedReset = false;
            }
            else
            {
                this.depthmanager.FormatChanged = false; //Clear flag ok
            }

            if (FInAASamplesPerPixel.IsChanged || this.FInBufferCount.IsChanged || this.FInFlipSequential.IsChanged || this.FInRefreshRate.IsChanged)
            {
                this.depthmanager.NeedReset = true;
                this.FInvalidateSwapChain   = true;
            }

            if (this.FInFullScreen.IsChanged)
            {
                string path;
                this.FHost.GetNodePath(false, out path);
                INode2 n2 = hde.GetNodeFromPath(path);

                if (n2.Window != null)
                {
                    if (n2.Window.IsVisible)
                    {
                        if (this.FInFullScreen[0])
                        {
                            // if the pin is true we want to give it priority over the component mode set in the patch. also in the first frame.
                            hde.SetComponentMode(n2, ComponentMode.Fullscreen);
                        }
                        else
                        {
                            // checking for first frame is necessary. the pin will always report to be changed in the very first frame.
                            // however in the first frame we want to respect the component mode that is saved in the patch
                            if (!FirstFrame)
                            {
                                hde.SetComponentMode(n2, ComponentMode.InAWindow);
                            }
                        }
                    }
                }
            }

            this.FOutKState[0]         = new KeyboardState(this.FKeys);
            this.FOutMouseState[0]     = MouseState.Create(this.FMousePos.x, this.FMousePos.y, this.FMouseButtons.x > 0.5f, this.FMouseButtons.y > 0.5f, this.FMouseButtons.z > 0.5f, false, false, this.wheel);
            this.FOutBackBufferSize[0] = new Vector2D(this.Width, this.Height);

            this.FOutTouchSupport[0] = this.touchsupport;

            this.FOutTouchData.SliceCount = this.touches.Count;

            int   tcnt = 0;
            float fw   = (float)this.ClientSize.Width;
            float fh   = (float)this.ClientSize.Height;

            lock (m_touchlock)
            {
                foreach (int key in touches.Keys)
                {
                    TouchData t = touches[key];

                    this.FOutTouchData[tcnt] = t.Clone(fw, fh);
                    t.IsNew = false;
                    tcnt++;
                }
            }
            FirstFrame = false;
        }
Esempio n. 2
0
        public void Evaluate(int SpreadMax)
        {
            this.FOutCtrl[0] = this;
            this.FOutRef[0]  = (INode)this.FHost;

            if (this.FOutQueryable[0] == null)
            {
                this.FOutQueryable[0] = this;
            }
            if (this.FOutBackBuffer[0] == null)
            {
                this.FOutBackBuffer[0] = new DX11Resource <DX11SwapChain>();
                this.FOuFS             = new Spread <DX11Resource <DX11SwapChain> >();
                this.FOuFS.SliceCount  = 1;
                this.FOuFS[0]          = new DX11Resource <DX11SwapChain>();
            }

            this.updateddevices.Clear();
            this.rendereddevices.Clear();
            this.FInvalidateSwapChain = false;

            if (!this.depthmanager.FormatChanged) // do not clear reset if format changed
            {
                this.depthmanager.NeedReset = false;
            }
            else
            {
                this.depthmanager.FormatChanged = false; //Clear flag ok
            }

            if (FInAASamplesPerPixel.IsChanged || this.FInBufferCount.IsChanged)
            {
                this.depthmanager.NeedReset = true;
                this.FInvalidateSwapChain   = true;
            }

            if (this.FInFullScreen.IsChanged)
            {
                string path;
                this.FHost.GetNodePath(false, out path);
                INode2 n2 = hde.GetNodeFromPath(path);

                if (n2.Window != null)
                {
                    if (n2.Window.IsVisible)
                    {
                        if (this.FInFullScreen[0])
                        {
                            hde.SetComponentMode(n2, ComponentMode.Fullscreen);
                        }
                        else
                        {
                            hde.SetComponentMode(n2, ComponentMode.InAWindow);
                        }
                    }
                }
            }

            /*if (this.FInFullScreen.IsChanged)
             * {
             *  if (this.FInFullScreen[0])
             *  {
             *      string path;
             *      this.FHost.GetNodePath(false, out path);
             *      INode2 n2 = hde.GetNodeFromPath(path);
             *      hde.SetComponentMode(n2, ComponentMode.Fullscreen);
             *  }
             *  else
             *  {
             *      string path;
             *      this.FHost.GetNodePath(false, out path);
             *      INode2 n2 = hde.GetNodeFromPath(path);
             *      hde.SetComponentMode(n2, ComponentMode.InAWindow);
             *  }
             * }*/

            this.FOutKState[0]         = new KeyboardState(this.FKeys);
            this.FOutMouseState[0]     = MouseState.Create(this.FMousePos.x, this.FMousePos.y, this.FMouseButtons.x > 0.5f, this.FMouseButtons.y > 0.5f, this.FMouseButtons.z > 0.5f, false, false, this.wheel);
            this.FOutBackBufferSize[0] = new Vector2D(this.Width, this.Height);

            this.FOutTouchSupport[0] = this.touchsupport;

            this.FOutTouchData.SliceCount = this.touches.Count;

            int   tcnt = 0;
            float fw   = (float)this.ClientSize.Width;
            float fh   = (float)this.ClientSize.Height;

            lock (m_touchlock)
            {
                foreach (int key in touches.Keys)
                {
                    TouchData t = touches[key];

                    this.FOutTouchData[tcnt] = t.Clone(fw, fh);
                    t.IsNew = false;
                    tcnt++;
                }
            }
        }