IDI-Systems / UnrealImGui

Unreal plug-in that integrates Dear ImGui framework into Unreal Engine 4/5.
MIT License
121 stars 27 forks source link

Fix DPIScale never getting initialized properly #5

Closed rlabrecque closed 5 months ago

rlabrecque commented 8 months ago

Problem & Repro steps are:

GEngine is invalid at this point because the plugin is set to the PreDefault loading phase, and the callstack to get into CalculateResolutionBasedScale runs via module load. We had tried changing the LoadingPhase which also fixed it but resulted in other issues.

This code is just taken from the call to GetDesktopResolution(), that function does a little more to fallback if SlateApplication is not initialized, but that doesn't seem to be necessary here.