mirror of
				https://github.com/Drezil/imgui.git
				synced 2025-10-31 05:01:05 +01:00 
			
		
		
		
	Examples: DirectX9/10/11: Comments
This commit is contained in:
		| @@ -484,7 +484,7 @@ void    ImGui_ImplDX10_InvalidateDeviceObjects() | |||||||
|         return; |         return; | ||||||
|  |  | ||||||
|     if (g_pFontSampler) { g_pFontSampler->Release(); g_pFontSampler = NULL; } |     if (g_pFontSampler) { g_pFontSampler->Release(); g_pFontSampler = NULL; } | ||||||
|     if (g_pFontTextureView) { g_pFontTextureView->Release(); g_pFontTextureView = NULL; ImGui::GetIO().Fonts->TexID = 0; } |     if (g_pFontTextureView) { g_pFontTextureView->Release(); g_pFontTextureView = NULL; ImGui::GetIO().Fonts->TexID = NULL; } // We copied g_pFontTextureView to io.Fonts->TexID so let's clear that as well. | ||||||
|     if (g_pIB) { g_pIB->Release(); g_pIB = NULL; } |     if (g_pIB) { g_pIB->Release(); g_pIB = NULL; } | ||||||
|     if (g_pVB) { g_pVB->Release(); g_pVB = NULL; } |     if (g_pVB) { g_pVB->Release(); g_pVB = NULL; } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -485,7 +485,7 @@ void    ImGui_ImplDX11_InvalidateDeviceObjects() | |||||||
|         return; |         return; | ||||||
|  |  | ||||||
|     if (g_pFontSampler) { g_pFontSampler->Release(); g_pFontSampler = NULL; } |     if (g_pFontSampler) { g_pFontSampler->Release(); g_pFontSampler = NULL; } | ||||||
|     if (g_pFontTextureView) { g_pFontTextureView->Release(); g_pFontTextureView = NULL; ImGui::GetIO().Fonts->TexID = 0; } |     if (g_pFontTextureView) { g_pFontTextureView->Release(); g_pFontTextureView = NULL; ImGui::GetIO().Fonts->TexID = NULL; } // We copied g_pFontTextureView to io.Fonts->TexID so let's clear that as well. | ||||||
|     if (g_pIB) { g_pIB->Release(); g_pIB = NULL; } |     if (g_pIB) { g_pIB->Release(); g_pIB = NULL; } | ||||||
|     if (g_pVB) { g_pVB->Release(); g_pVB = NULL; } |     if (g_pVB) { g_pVB->Release(); g_pVB = NULL; } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -313,10 +313,11 @@ void ImGui_ImplDX9_InvalidateDeviceObjects() | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     // At this point note that we set ImGui::GetIO().Fonts->TexID to be == g_FontTexture, so clear both. |     // At this point note that we set ImGui::GetIO().Fonts->TexID to be == g_FontTexture, so clear both. | ||||||
|  |     ImGuiIO& io = ImGui::GetIO(); | ||||||
|  |     IM_ASSERT(g_FontTexture == io.Fonts->TexID); | ||||||
|     if (g_FontTexture) |     if (g_FontTexture) | ||||||
|         g_FontTexture->Release(); |         g_FontTexture->Release(); | ||||||
|     g_FontTexture = NULL; |     g_FontTexture = NULL; | ||||||
|     ImGuiIO& io = ImGui::GetIO(); |  | ||||||
|     io.Fonts->TexID = NULL; |     io.Fonts->TexID = NULL; | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user