Arbitrary scale-up

This commit is contained in:
Attila Uygun 2023-10-25 23:40:07 +02:00
parent 669ed5e098
commit 75b5046684
1 changed files with 6 additions and 0 deletions

View File

@ -27,6 +27,7 @@ ImguiBackend::~ImguiBackend() = default;
void ImguiBackend::Initialize() {
IMGUI_CHECKVERSION();
ImGui::CreateContext();
ImGui::GetIO().IniFilename = nullptr;
size_t buffer_size = 0;
auto buffer = AssetFile::ReadWholeFile("engine/RobotoMono-Regular.ttf",
@ -43,6 +44,11 @@ void ImguiBackend::Initialize() {
LOG(0) << "Failed to read font file.";
}
// Arbitrary scale-up for mobile devices.
// TODO: Put some effort into DPI awareness.
if (Engine::Get().IsMobile())
ImGui::GetStyle().ScaleAllSizes(2.0f);
Engine::Get().SetImageSource(
"imgui_atlas",
[]() -> std::unique_ptr<Image> {