Inheritance: RenderElement
Ejemplo n.º 1
0
        void SetUpGLSurface(OpenTK.MyGLControl glControl)
        {
            if (glControl == null)
            {
                return;
            }
            //TODO: review here
            //Temp:
            _glControl = glControl;
            _glControl.SetGLPaintHandler(null);
            //
            IntPtr hh1 = _glControl.Handle; //ensure that contrl handler is created

            _glControl.MakeCurrent();

            if (_vw.InnerViewportKind == InnerViewportKind.GdiPlusOnGLES)
            {
                _bridgeUI = new GdiOnGLESUIElement(glControl.Width, glControl.Height);
            }
            else
            {
                //pure agg's cpu blit
                _bridgeUI = new CpuBlitGLESUIElement(glControl.Width, glControl.Height);
            }


            //optional***
            //_bridgeUI.SetUpdateCpuBlitSurfaceDelegate((p, area) =>
            //{
            //    _client.DrawToThisCanvas(_bridgeUI.GetDrawBoard(), area);
            //});


            GLPainterContext pcx       = _vw.GetGLRenderSurface();
            GLPainter        glPainter = _vw.GetGLPainter();

            RootGraphic rootGfx = _vw.RootGfx;

            _bridgeUI.CreatePrimaryRenderElement(pcx, glPainter, rootGfx);



            //*****
            RenderBoxBase renderE = (RenderBoxBase)_bridgeUI.GetPrimaryRenderElement(rootGfx);

            rootGfx.AddChild(renderE);
            rootGfx.SetPrimaryContainerElement(renderE);
            //***
        }
 protected static void SetCalculatedSize(RenderBoxBase v, int w, int h)
 {
     v.b_width  = w;
     v.b_height = h;
     v.MarkHasValidCalculateSize();
 }
Ejemplo n.º 3
0
 public abstract void SetPrimaryContainerElement(RenderBoxBase renderBox);