ID3D11Factory instead of ID3D11Factory1 #1989
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While integrating the current version of ImGui, I kept failing the following assert of
ImGui::NewFrame
in my application:IM_ASSERT(g.IO.Fonts->Fonts.Size > 0 && "Font Atlas not built. Did you call io.Fonts >GetTexDataAsRGBA32() / GetTexDataAsAlpha8() ?");
However, the actual cause is not directly related to fonts and font atlases, but rather to ImGui's provided D3D11 bindings. In the code below, the first two
if
conditions are true and the third one is false, resulting in no device, device context and factory bindings. This is the case for my application, but not for the demo application provided with ImGui.For obtaining a device and device context in my application, I go the other way around and start with a
IDXGIFactory
(whereas ImGui does use the defaultIDXGIAdapter
).When I replace both occurrences of
IDXGIFactory1
withIDXGIFactory
inimgui_impl_dx11.cpp
, both my application and the provided demo application work correctly. This change is handled by this pull request. (Apparently, ImGui's provided D3D11 bindings do not really use the global variableg_pFactory
at all. So I am not sure why there is such a variable in the first place and why it needs to be of typeIDXGIFactory1
?)