Some games (like modern GameMaker) resize the window before the DX11 backend is initialized. ImGui does not null check the backend data in some spots, so we have to check if we've initialized before calling them. This is an upstream ImGui issue and this is just a workaround for it. Whether it is considered invalid behavior by them is unknown. This might also happen on DX9, but I don't have a game to test it with.
Sorry about the random whitespace changes, that was Rider being mystical and magical.
Related issue: #7
Some games (like modern GameMaker) resize the window before the DX11 backend is initialized. ImGui does not null check the backend data in some spots, so we have to check if we've initialized before calling them. This is an upstream ImGui issue and this is just a workaround for it. Whether it is considered invalid behavior by them is unknown. This might also happen on DX9, but I don't have a game to test it with.
Sorry about the random whitespace changes, that was Rider being mystical and magical.