From d74a3349e90308be9a24daf774bfd50662e04d62 Mon Sep 17 00:00:00 2001 From: ocornut Date: Mon, 19 Dec 2016 23:15:38 +0100 Subject: [PATCH] Examples: DirectX9: Explicitely setting viewport to match that other examples are doing (#937) --- examples/directx9_example/imgui_impl_dx9.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/examples/directx9_example/imgui_impl_dx9.cpp b/examples/directx9_example/imgui_impl_dx9.cpp index 82e638ef..93472f65 100644 --- a/examples/directx9_example/imgui_impl_dx9.cpp +++ b/examples/directx9_example/imgui_impl_dx9.cpp @@ -94,6 +94,15 @@ void ImGui_ImplDX9_RenderDrawLists(ImDrawData* draw_data) g_pd3dDevice->SetIndices(g_pIB); g_pd3dDevice->SetFVF(D3DFVF_CUSTOMVERTEX); + // Setup viewport + D3DVIEWPORT9 vp; + vp.X = vp.Y = 0; + vp.Width = (DWORD)io.DisplaySize.x; + vp.Height = (DWORD)io.DisplaySize.y; + vp.MinZ = 0.0f; + vp.MaxZ = 1.0f; + g_pd3dDevice->SetViewport(&vp); + // Setup render state: fixed-pipeline, alpha-blending, no face culling, no depth testing g_pd3dDevice->SetPixelShader(NULL); g_pd3dDevice->SetVertexShader(NULL);