Пример #1
0
        async Task InitViewport(EditorCommon.ViewPort.ViewPortControl vpCtrl)
        {
            if (mViewPortInited)
            {
                return;
            }
            mViewPortInited = true;
            var rc = EngineNS.CEngine.Instance.RenderContext;

            mRP_EditorMobile = new EngineNS.Graphics.RenderPolicy.CGfxRP_EditorMobile();
            var width  = (uint)vpCtrl.GetViewPortWidth();
            var height = (uint)vpCtrl.GetViewPortHeight();
            await mRP_EditorMobile.Init(rc, width, height, Viewport.Camera, vpCtrl.DrawHandle);

            vpCtrl.RPolicy = mRP_EditorMobile;

            mRP_EditorMobile.mHitProxy.mEnabled = false;

            Viewport.SizeChanged += Viewport_SizeChanged;
            vpCtrl.TickLogicEvent = Viewport_TickLogic;
            Viewport.SetDrawPanelMouseWheelCallback(Viewport_MouseWheel);
            Viewport.SetDrawPanelMouseDownCallback(Viewport_MouseDown);
            Viewport.SetDrawPanelMouseUpCallback(Viewport_MouseUp);
            Viewport.SetDrawPanelMouseMoveCallback(Viewport_MouseMove);
            Viewport.SetDrawPanelDragEnterCallback(Viewport_DragEnter);
            Viewport.SetDrawPanelDragLeaveCallback(Viewport_DragLeave);
            Viewport.SetDrawPanelDragOverCallback(Viewport_DragOver);
            Viewport.SetDrawPanelDragDropCallback(Viewport_DragDrop);
        }
Пример #2
0
        async Task InitViewPort(EditorCommon.ViewPort.ViewPortControl vpCtrl)
        {
            if (mViewPortInited)
            {
                return;
            }
            mViewPortInited = true;
            var rc = EngineNS.CEngine.Instance.RenderContext;

            mRP_EditorMobile = new EngineNS.Graphics.RenderPolicy.CGfxRP_EditorMobile();
            var width  = (uint)vpCtrl.GetViewPortWidth();
            var height = (uint)vpCtrl.GetViewPortHeight();
            await mRP_EditorMobile.Init(rc, width, height, Viewport.Camera, vpCtrl.DrawHandle);

            vpCtrl.RPolicy = mRP_EditorMobile;

            mRP_EditorMobile.mHitProxy.mEnabled = false;

            vpCtrl.TickLogicEvent = Viewport_TickLogic;
        }