Skip to content
This repository has been archived by the owner on Apr 22, 2020. It is now read-only.

Setting fontGlobalScale in Options causes error #72

Open
felixfaire opened this issue Nov 5, 2018 · 2 comments
Open

Setting fontGlobalScale in Options causes error #72

felixfaire opened this issue Nov 5, 2018 · 2 comments

Comments

@felixfaire
Copy link

Trying to set the font scale in the initialisation options causes an error.

ui::initialize( ui::Options().fontGlobalScale( getWindowContentScale() ) );

results in:

Assertion failed: (GImGui != __null && "No current context. Did you call ImGui::CreateContext() or ImGui::SetCurrentContext()?"), function GetIO, file /Users/felixfaire/Developer/Cinder-0.9/Cinder/blocks/Cinder-ImGui/lib/imgui/imgui.cpp, line 2638.

in GetIO()

Most other options seem to be ok.

Macbook pro, macos Mojave.

@felixfaire
Copy link
Author

Setting this after initialise() works as a workaround:

ImGui::GetIO().FontGlobalScale = getWindowContentScale();

@richardeakin
Copy link
Contributor

FWIW this is exactly what I'm doing on Windows 10 to use ImGui on a high-dpi aware display. It's working great (as long as I do the setting on GetIO().FontGlobalScale like you did above).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants