Cinder-ImGui
Cinder-ImGui copied to clipboard
Rendering issue with macOS Mojave
I noticed that rendering may be broken on macOS Mojave. ImGui is being drawn at the wrong scale and mouse clicks don't align with what is drawn. I've also noticed clipping some problems.
To reproduce, start an empty project with TinderBox + the Cinder-ImGui block and add the hello-world example,
void cinderApp::setup() {
ImGui::initialize();
}
void cinderApp::draw() {
gl::clear( Color( 0, 0, 0 ) );
ImGui::Text("Hello, world!");
}
Tested using the latest Cinder 0.9.2dev, although the problem exists with previous versions. I get 
I also get the same just by rebuilding some of my previous projects, which is how i noticed this in the first place - the problem there is even more pronounced and makes ImGui essentially unusable. My hunch is that it's related to Mojave, although i've only returned to Cinder since upgrading so i can't be sure when this first occurred. Any thoughts?
There were some high density rendering issues on Mojave previously. Does this help? https://discourse.libcinder.org/t/window-issue-on-osx-mojave/1326
Thanks for this. Enabling high density display on startup did the trick. As you mentioned there, it seems the default is high density on Mojave, but Cinder does not detect it.
CINDER_APP( cinderApp, RendererGl(), [&](App::Settings *settings) {
settings->setHighDensityDisplayEnabled(true);
})
Of course this alone makes the text impossibly small, but for reference it's straightforward to scale ImGui to compensate
ImGui::GetStyle().ScaleAllSizes(2);
ImGui::GetIO().FontGlobalScale = 2;
This still leaves the issue of how to handle ImGui for those that need Cinder at 1x scale. The thread suggests there were some wider Cinder issues on Mojave here too, so i suspect this is all related.