Inheritance: IdbugOutputWindow
        public void InitRootGraphics(
            RootGraphic rootgfx,
            ITopWindowEventRoot topWinEventRoot,
            InnerViewportKind innerViewportKind)
        {
            //1.
            this.rootgfx = rootgfx;
            this.topWinEventRoot = topWinEventRoot;
            this.innerViewportKind = innerViewportKind;
            switch (innerViewportKind)
            {
                case InnerViewportKind.GL:
                    {
                        //temp not suppport 

                        throw new NotSupportedException();
                        //PixelFarm.Drawing.DrawingGL.CanvasGLPortal.Start();

                        //var bridge = new OpenGL.MyTopWindowBridgeOpenGL(rootgfx, topWinEventRoot);
                        //var view = new OpenGL.GpuOpenGLSurfaceView();
                        //view.Width = 800;
                        //view.Height = 600;
                        ////view.Dock = DockStyle.Fill;
                        //this.Controls.Add(view);
                        ////--------------------------------------- 
                        //view.Bind(bridge); 
                        //this.winBridge = bridge; 
                    }
                    break;
                case InnerViewportKind.Skia:
                    {
                        //skiasharp ***
                        var bridge = new Skia.MyTopWindowBridgeSkia(rootgfx, topWinEventRoot);
                        var view = new CpuSurfaceView();
                        view.Dock = DockStyle.Fill;
                        this.Controls.Add(view);
                        //--------------------------------------- 
                        view.Bind(bridge);
                        this.winBridge = bridge;
                    }
                    break;
                case InnerViewportKind.GdiPlus:
                default:
                    {
                        var bridge = new GdiPlus.MyTopWindowBridgeGdiPlus(rootgfx, topWinEventRoot);
                        var view = new CpuSurfaceView();
                        view.Dock = DockStyle.Fill;
                        this.Controls.Add(view);
                        //--------------------------------------- 
                        view.Bind(bridge);
                        this.winBridge = bridge;
                    }
                    break;
            }
        }
        public void InitRootGraphics(
            RootGraphic rootgfx,
            ITopWindowEventRoot topWinEventRoot,
            InnerViewportKind innerViewportKind)
        {
            //1.
            this.rootgfx           = rootgfx;
            this.topWinEventRoot   = topWinEventRoot;
            this.innerViewportKind = innerViewportKind;

            switch (innerViewportKind)
            {
            case InnerViewportKind.GL:
            {
                PixelFarm.Drawing.DrawingGL.CanvasGLPortal.Start();

                var bridge = new OpenGL.MyTopWindowBridgeOpenGL(rootgfx, topWinEventRoot);
                var view   = new OpenGL.GpuOpenGLSurfaceView();
                view.Width  = 800;
                view.Height = 600;
                //view.Dock = DockStyle.Fill;
                this.Controls.Add(view);
                //---------------------------------------
                view.Bind(bridge);

                this.winBridge = bridge;
            } break;

            case InnerViewportKind.GdiPlus:
            default:
            {
                var bridge = new GdiPlus.MyTopWindowBridgeGdiPlus(rootgfx, topWinEventRoot);
                var view   = new GdiPlus.CpuGdiPlusSurfaceView();
                view.Dock = DockStyle.Fill;
                this.Controls.Add(view);
                //---------------------------------------
                view.Bind(bridge);

                this.winBridge = bridge;
            } break;
            }
        }
Esempio n. 3
0
 public void Bind(TopWindowBridge winBridge)
 {
     //1. 
     this.winBridge = winBridge;
     this.winBridge.BindWindowControl(this);
 }