Example #1
0
        public void SetUISurfaceViewportControl(LayoutFarm.UI.UISurfaceViewportControl vw)
        {
            //---------------------------------------
            //this specific for WindowForm viewport
            //---------------------------------------
            _vw = vw;

            _ownerForm = _vw.FindForm();
            System.Drawing.Rectangle screenRectangle = _ownerForm.RectangleToScreen(_ownerForm.ClientRectangle);
            _formTitleBarHeight = screenRectangle.Top - _ownerForm.Top;


            System.Drawing.Rectangle primScreenWorkingArea = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea;
            _primaryScreenWorkingAreaW = primScreenWorkingArea.Width;
            _primaryScreenWorkingAreaH = primScreenWorkingArea.Height;


            //
            switch (vw.InnerViewportKind)
            {
            case InnerViewportKind.GdiPlusOnGLES:
            case InnerViewportKind.AggOnGLES:
                SetUpGLSurface(vw.GetOpenTKControl());
                break;
            }
        }
Example #2
0
        public void BindSurface(LayoutFarm.UI.UISurfaceViewportControl surfaceViewport)
        {
            _surfaceViewport = surfaceViewport;
            _rootGfx         = surfaceViewport.RootGfx;

            //----------------------
            _glControl = surfaceViewport.GetOpenTKControl();
            _myWidth   = _glControl.Width;
            _myHeight  = _glControl.Height;


            IntPtr hh1 = _glControl.Handle; //ensure that contrl handler is created

            _glControl.MakeCurrent();
        }