Esempio n. 1
0
        internal void EndFrame()
        {
            GUIContext    g = Form.current.uiContext;
            WindowManager w = g.WindowManager;

            Debug.Assert(g.Initialized);                       // Forgot to call ImGui::NewFrame()
            Debug.Assert(g.FrameCountEnded != g.FrameCount);   // ImGui::EndFrame() called multiple times, or forgot to call ImGui::NewFrame() again

            // Hide implicit "Debug" window if it hasn't been used
            Debug.Assert(w.WindowStack.Count == 1);    // Mismatched Begin()/End() calls
            if (w.CurrentWindow != null && !w.CurrentWindow.Accessed)
            {
                w.CurrentWindow.Active = false;
            }
            GUI.End();//end of the implicit "Debug" window

            uiContext.ForeBackGroundRenderClose();
            w.EndFrame(g);

            // Clear Input data for next frame
            Mouse.Instance.MouseWheel = 0;
            Ime.ImeBuffer.Clear();

            g.FrameCountEnded = g.FrameCount;
        }
Esempio n. 2
0
        internal static void EndFrame()
        {
            GUIContext    g = Application.ImGuiContext;
            WindowManager w = g.WindowManager;

            Debug.Assert(g.Initialized);                       // Forgot to call ImGui::NewFrame()
            Debug.Assert(g.FrameCountEnded != g.FrameCount);   // ImGui::EndFrame() called multiple times, or forgot to call ImGui::NewFrame() again

            // Hide implicit "Debug" window if it hasn't been used
            Debug.Assert(w.WindowStack.Count == 1);    // Mismatched Begin()/End() calls
            if (w.CurrentWindow != null && !w.CurrentWindow.Accessed)
            {
                w.CurrentWindow.Active = false;
            }
            GUI.End();//end of the implicit "Debug" window

            w.CurrentViewport = null;

            //TODO drag and drop

            // End frame
            g.FrameCountEnded = g.FrameCount;

            // Initiate moving window + handle left-click and right-click focus
            UpdateMouseMovingWindowEndFrame();

            // Update user-facing viewport list (g.Viewports -> g.PlatformIO.Viewports after filtering out some)
            UpdateViewportsEndFrame();

            foreach (var form in w.Viewports)
            {
                if (!form.PlatformWindowCreated)
                {
                    continue;
                }
                form.ForeBackGroundRenderClose();
            }

            // Update windows
            // TODO merge UpdateViewportsEndFrame to w.EndFrame
            w.EndFrame(g);

            // Clear Input data for next frame
            Mouse.Instance.MouseWheel = 0;
            Ime.ImeBuffer.Clear();
        }