Skip to content

Commit

Permalink
Examples: DirectX9: Explicitly disable fog (D3DRS_FOGENABLE) before d…
Browse files Browse the repository at this point in the history
…rawing in case user state has it set. (#2288, #2290)
  • Loading branch information
giladreich authored and ocornut committed Jan 17, 2019
1 parent f2c9280 commit 14c4024
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ HOW TO UPDATE?


-----------------------------------------------------------------------
VERSION 1.68
VERSION 1.68 (In progress)
-----------------------------------------------------------------------

Other Changes:
Expand All @@ -41,6 +41,7 @@ Other Changes:
- Examples: Win32: Using GetForegroundWindow() instead of GetActiveWindow() to be compatible with windows created
in a different thread. (#1951, #2087, #2156, #2232) [many people]
- Examples: Win32: Added support for XInput games (if ImGuiConfigFlags_NavEnableGamepad is enabled).
- Examples: DirectX9: Explicitly disable fog (D3DRS_FOGENABLE) before drawing in case user state has it set. (#2288, #2230)


-----------------------------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions examples/imgui_impl_dx9.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

// CHANGELOG
// (minor and older changes stripped away, please see git history for details)
// 2019-01-16: Misc: Disabled fog before drawing UI's. Fixes issue #2288.
// 2018-11-30: Misc: Setting up io.BackendRendererName so it can be displayed in the About Window.
// 2018-06-08: Misc: Extracted imgui_impl_dx9.cpp/.h away from the old combined DX9+Win32 example.
// 2018-06-08: DirectX9: Use draw_data->DisplayPos and draw_data->DisplaySize to setup projection matrix and clipping rectangle.
Expand Down Expand Up @@ -131,6 +132,7 @@ void ImGui_ImplDX9_RenderDrawData(ImDrawData* draw_data)
g_pd3dDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
g_pd3dDevice->SetRenderState(D3DRS_SCISSORTESTENABLE, true);
g_pd3dDevice->SetRenderState(D3DRS_SHADEMODE, D3DSHADE_GOURAUD);
g_pd3dDevice->SetRenderState(D3DRS_FOGENABLE, false);
g_pd3dDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_MODULATE);
g_pd3dDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE);
g_pd3dDevice->SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_DIFFUSE);
Expand Down

0 comments on commit 14c4024

Please sign in to comment.