Viewport: Replaced UpdatePlatformWindows/RenderPlatformWindows by RenderAdditionalViewports(). The update is always called in EndFrame(). (#1542)

This commit is contained in:
omar
2018-03-02 22:44:06 +01:00
parent b807347e94
commit e9fa17e1bf
10 changed files with 33 additions and 30 deletions

View File

@ -205,8 +205,7 @@ int main(int, char**)
ImGui::Render();
ImGui_ImplDX10_RenderDrawData(ImGui::GetDrawData());
ImGui::UpdatePlatformWindows();
ImGui::RenderPlatformWindows();
ImGui::RenderAdditionalViewports();
g_pSwapChain->Present(1, 0); // Present with vsync
//g_pSwapChain->Present(0, 0); // Present without vsync

View File

@ -208,8 +208,7 @@ int main(int, char**)
ImGui::Render();
ImGui_ImplDX11_RenderDrawData(ImGui::GetDrawData());
ImGui::UpdatePlatformWindows();
ImGui::RenderPlatformWindows();
ImGui::RenderAdditionalViewports();
g_pSwapChain->Present(1, 0); // Present with vsync
//g_pSwapChain->Present(0, 0); // Present without vsync

View File

@ -401,8 +401,7 @@ int main(int, char**)
g_pd3dCommandQueue->ExecuteCommandLists(1, (ID3D12CommandList* const*)&g_pd3dCommandList);
ImGui::UpdatePlatformWindows();
ImGui::RenderPlatformWindows();
ImGui::RenderAdditionalViewports();
g_pSwapChain->Present(1, 0); // Present with vsync
//g_pSwapChain->Present(0, 0); // Present without vsync

View File

@ -709,6 +709,7 @@ static void ImGui_ImplDX12_ResizeViewport(ImGuiViewport* viewport, int w, int h)
{
ImGuiPlatformDataDx12* data = (ImGuiPlatformDataDx12*)viewport->RendererUserData;
IM_ASSERT(0);
(void)data; (void)w; (void)h;
/*
if (data->RTView)
{
@ -730,6 +731,7 @@ static void ImGui_ImplDX12_RenderViewport(ImGuiViewport* viewport)
{
ImGuiPlatformDataDx12* data = (ImGuiPlatformDataDx12*)viewport->RendererUserData;
IM_ASSERT(0);
(void)data;
/*
ImVec4 clear_color = ImGui::GetStyle().Colors[ImGuiCol_WindowBg]; // FIXME-PLATFORM
clear_color.w = 1.0f;
@ -743,6 +745,7 @@ static void ImGui_ImplDX12_SwapBuffers(ImGuiViewport* viewport)
{
ImGuiPlatformDataDx12* data = (ImGuiPlatformDataDx12*)viewport->RendererUserData;
IM_ASSERT(0);
(void)data;
/*
data->SwapChain->Present(0, 0); // Present without vsync
*/

View File

@ -122,9 +122,8 @@ int main(int, char**)
glClear(GL_COLOR_BUFFER_BIT);
ImGui::Render();
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());
ImGui::UpdatePlatformWindows();
ImGui::RenderPlatformWindows();
ImGui::RenderAdditionalViewports();
glfwMakeContextCurrent(window);
glfwSwapBuffers(window);

View File

@ -130,9 +130,7 @@ int main(int, char**)
glClear(GL_COLOR_BUFFER_BIT);
ImGui::Render();
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());
ImGui::UpdatePlatformWindows();
ImGui::RenderPlatformWindows();
ImGui::RenderAdditionalViewports();
SDL_GL_MakeCurrent(window, gl_context);
SDL_GL_SwapWindow(window);

View File

@ -733,10 +733,7 @@ int main(int, char**)
#endif
swap_chain_has_at_least_one_image = true;
wd->FrameIndex = (wd->FrameIndex + 1) % IMGUI_VK_QUEUED_FRAMES;
// FIXME-PLATFORM
ImGui::UpdatePlatformWindows();
ImGui::RenderPlatformWindows();
ImGui::RenderAdditionalViewports();
}
// Cleanup

View File

@ -735,9 +735,7 @@ int main(int, char**)
swap_chain_has_at_least_one_image = true;
wd->FrameIndex = (wd->FrameIndex + 1) % IMGUI_VK_QUEUED_FRAMES;
// FIXME-PLATFORM
ImGui::UpdatePlatformWindows();
ImGui::RenderPlatformWindows();
//ImGui::RenderAdditionalViewports();
}
// Cleanup