| 1765 | DrawMainWindow(); |
| 1766 | } |
| 1767 | |
| 1768 | void Render() |
| 1769 | { |
| 1770 | if (!s_initialized) |
| 1771 | return; |
| 1772 | ImGui::Render(); |
| 1773 | // Make sure we draw to the default framebuffer in case the engine left |
| 1774 | // an FBO bound — happens with post-FX in GL33. Other state (blend, |
| 1775 | // scissor, vao, depth) is saved/restored inside RenderDrawData. |
| 1776 | glBindFramebuffer(GL_FRAMEBUFFER, 0); |
| 1777 | ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData()); |
| 1778 | |
| 1779 | // Drain deferred actions queued by UI click handlers. See the |
| 1780 | // s_pendingActions comment for the why — running cheats here |
| 1781 | // (after ImGui::Render returns) means engine code in the cheat |
| 1782 | // can freely realloc / clean up without trashing ImGui state. |
| 1783 | if (!s_pendingActions.empty()) |
| 1784 | { |
| 1785 | auto local = std::move(s_pendingActions); |
| 1786 | s_pendingActions.clear(); |
| 1787 | for (auto& fn : local) |
| 1788 | fn(); |
| 1789 | } |
| 1790 | } |
| 1791 | |
| 1792 | bool IsVisible() |
no test coverage detected