public unsafe void EndFrame() { ImGui.Render(); DrawData *data = ImGui.GetDrawData(); RenderImDrawData(data); }
/// <summary> /// Renders the ImGui draw list data. /// This method requires a <see cref="GraphicsDevice"/> because it may create new DeviceBuffers if the size of vertex /// or index data has increased beyond the capacity of the existing buffers. /// A <see cref="CommandList"/> is needed to submit drawing and resource update commands. /// </summary> public unsafe void Render(GraphicsDevice gd, CommandList cl) { if (_frameBegun) { _frameBegun = false; ImGui.Render(); RenderImDrawData(ImGui.GetDrawData(), gd, cl); } }
/// <summary> /// Updates ImGui input and IO configuration state. /// </summary> public void Update(float deltaSeconds, InputSnapshot snapshot) { if (_frameBegun) { ImGui.Render(); } SetPerFrameImGuiData(deltaSeconds); UpdateImGuiInput(snapshot); _frameBegun = true; ImGui.NewFrame(); }
unsafe void Render() { io.DisplaySize = new System.Numerics.Vector2(window.Width, window.Height); io.DisplayFramebufferScale = new System.Numerics.Vector2(window.Width / setting.Width); io.DeltaTime = setting.DesiredFrameRate; control.Update(); ImGui.NewFrame(); DrawUI(); ImGui.Render(); RenderImDrawData(ImGui.GetDrawData()); }
/// <summary> /// Updates ImGui input and IO configuration state. /// </summary> public void Update(float deltaSeconds, InputSnapshot snapshot) { if (_frameBegun) { ImGui.Render(); ImGui.UpdatePlatformWindows(); } SetPerFrameImGuiData(deltaSeconds); UpdateImGuiInput(snapshot); UpdateMonitors(); _frameBegun = true; ImGui.NewFrame(); ImGui.Text($"Main viewport Position: {ImGui.GetPlatformIO().MainViewport.Pos}"); ImGui.Text($"Main viewport Size: {ImGui.GetPlatformIO().MainViewport.Size}"); ImGui.Text($"MoouseHoveredViewport: {ImGui.GetIO().MouseHoveredViewport}"); }
private unsafe void RenderFrame() { IO io = ImGui.GetIO(); io.DisplaySize = new System.Numerics.Vector2(_nativeWindow.Width, _nativeWindow.Height); io.DisplayFramebufferScale = new System.Numerics.Vector2(_scaleFactor); io.DeltaTime = (1f / 60f); UpdateImGuiInput(io); ImGui.NewFrame(); SubmitImGuiStuff(); ImGui.Render(); DrawData *data = ImGui.GetDrawData(); RenderImDrawData(data); }
/// <summary> /// Renders the ImGui draw list data. /// This method requires a <see cref="GraphicsDevice"/> because it may create new DeviceBuffers if the size of vertex /// or index data has increased beyond the capacity of the existing buffers. /// A <see cref="CommandList"/> is needed to submit drawing and resource update commands. /// </summary> public void Render(GraphicsDevice gd, CommandList cl) { if (_frameBegun) { _frameBegun = false; ImGui.Render(); RenderImDrawData(ImGui.GetDrawData(), gd, cl); // Update and Render additional Platform Windows if ((ImGui.GetIO().ConfigFlags & ImGuiConfigFlags.ViewportsEnable) != 0) { ImGui.UpdatePlatformWindows(); ImGuiPlatformIOPtr platformIO = ImGui.GetPlatformIO(); for (int i = 1; i < platformIO.Viewports.Size; i++) { ImGuiViewportPtr vp = platformIO.Viewports[i]; VeldridImGuiWindow window = (VeldridImGuiWindow)GCHandle.FromIntPtr(vp.PlatformUserData).Target; cl.SetFramebuffer(window.Swapchain.Framebuffer); RenderImDrawData(vp.DrawData, gd, cl); } } } }
/// <summary> /// Asks ImGui for the generated geometry data and sends it to the graphics pipeline, should be called after the UI is drawn using ImGui.** calls /// </summary> public virtual void AfterLayout() { ImGui.Render(); unsafe { RenderDrawData(ImGui.GetDrawData()); } }
public static void Render() { ImGui.Render(); RenderDrawLists(ImGui.GetDrawData(), ImGui.GetIO()); }
public static void Render(RenderTarget target) { target.ResetGLStates(); ImGui.Render(); RenderDrawLists(ImGui.GetDrawData(), ImGui.GetIO()); }