protected void OnSizeChanged(int newWidth, int newHeight)
        {
            if (PresentationSource.FromVisual(this) != null)
            {
                Point upperLeft = PointToScreen(new Point(0, 0));

                CRenderer renderer = CRenderer.Instance;
                renderer.Dispatch(ERendererDispatcherPriority.BeginFrame, () => renderer.Resize(newWidth, newHeight, (int)upperLeft.X, (int)upperLeft.Y, Hwnd));
                CEngine.Instance.Dispatch(EEngineUpdatePriority.BeginFrame, () => { World?.ViewManager.ResizeView(newWidth, newHeight, (float)upperLeft.X, (float)upperLeft.Y); });
            }
        }
Esempio n. 2
0
 protected override void OnResizeEnd(EventArgs e)
 {
     if (engineWorld != null)
     {
         System.Drawing.Point topLeft  = PointToScreen(new System.Drawing.Point(0, 0));
         CRenderer            renderer = CRenderer.Instance;
         IntPtr handlePtr = Handle;
         renderer.Dispatch(ERendererDispatcherPriority.BeginFrame, () => renderer.Resize(ClientSize.Width, ClientSize.Height, topLeft.X, topLeft.Y, handlePtr));
         CEngine.Instance.Dispatch(EEngineUpdatePriority.BeginFrame, () => { engineWorld.ViewManager.ResizeView(ClientSize.Width, ClientSize.Height, topLeft.X, topLeft.Y); });
     }
     base.OnResizeEnd(e);
 }
Esempio n. 3
0
        private void ShowWorld(CWorld world)
        {
            engineWorld = world;

            System.Drawing.Point topLeft  = PointToScreen(new System.Drawing.Point(0, 0));
            CRenderer            renderer = CRenderer.Instance;
            IntPtr handlePtr = Handle;

            renderer.Dispatch(ERendererDispatcherPriority.BeginFrame, () => renderer.Resize(ClientSize.Width, ClientSize.Height, topLeft.X, topLeft.Y, handlePtr));
            CEngine.Instance.Dispatch(EEngineUpdatePriority.BeginFrame, () => { engineWorld.ViewManager.ResizeView(ClientSize.Width, ClientSize.Height, topLeft.X, topLeft.Y); });

            Show();
        }