Exemplo n.º 1
0
        public void CreateMainForm(int w, int h)
        {
            GlFwForm      form1          = new GlFwForm(w, h, "PixelFarm on GLfw and GLES2");
            MyRootGraphic myRootGfx      = new MyRootGraphic(w, h, s_textServices);
            var           canvasViewport = new UISurfaceViewportControl();

            canvasViewport.InitRootGraphics(myRootGfx, myRootGfx.TopWinEventPortal, InnerViewportKind.GLES);
            canvasViewport.SetBounds(0, 0, w, h);
            form1.Controls.Add(canvasViewport);


            _surfaceViewport = canvasViewport;
            LayoutFarm.AppHostNeutral appHost = new LayoutFarm.AppHostNeutral(canvasViewport);
            form1.SetDrawFrameDelegate(e =>
            {
                _surfaceViewport.PaintMeFullMode();
            });
            if (_app != null)
            {
                appHost.StartApp(_app);//start app
                canvasViewport.TopDownRecalculateContent();
                canvasViewport.PaintMe();
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// load html string
 /// </summary>
 /// <param name="rootdir">root dir for solve other resource</param>
 /// <param name="htmlText">raw html text</param>
 public void LoadHtmlString(string rootdir, string htmlText)
 {
     userWorkspace.LoadHtml(rootdir, htmlText);
     viewportControl.PaintMeFullMode();
 }
Exemplo n.º 3
0
 public override void UpdateViewContent(PaintEventArgs formRenderUpdateEventArgs)
 {
     _surfaceViewport.PaintMeFullMode();
 }