I’m very new to Cinder. Trying some simple examples I’ve noticed that calling gl::drawSolidCircle(getWindowCenter(), 20.0);
places the object in the top right corner of the window instead of in the center.
Could you try running the same code on pre-Mojave OSX and see if it’s a Mojave only issue? Also, is your code using Fbo? I did notice some retina scale related problem in glBlitFramebuffer in the first couple beta releases of Mojave, but that only happened to my other apps and I haven’t been able to reproduce in Cinder.
I don’t have access to a pre Mojave machine I’m afraid. I’m not using any FBOs, the code I posted is my entire draw call. Should I open an issue on the repo?
Did you resize the window while running the application?
If so, you will have to adjust the projection matrix to the new window dimensions. The easiest way to do this is to add this call to your draw function:
void MyApp::draw()
{
gl::clear();
gl::setMatricesWindow( getWindowSize() ); // <-- this one
gl::drawSolidCircle( getWindowCenter(), 20.0f );
}
A slightly better way is to only do this when the window resizes. Override the void resize(); function with this implementation:
I just gave a shot on both mojave(MacBook air with intel hd 5000) and high sierra(MacBook pro 2018) and they all works fine. but it might be that retina is enabled by default on mojave? since my MacBook air is none retina so I can’t test that, can you try explicitly disable highDensity in prepareSetting?
Just for people potentially running into this in the future, I didn’t have this issue on mojave until upgrading to xcode 10.
*edit. This has sent me down the rabbit hole. Apple have really screwed the pooch on this one (going by the sheer volume of broken projects i’ve found, though I suppose we were warned about the GL deprecation).
Anyway it seems there’s no way to disable retina-sized framebuffers with the current setWantsBestResolutionOpenGLSurface dance, which results in coordinate systems being all over the place. If you can afford to render at high dpi then enabling high density will work fine, but the default 1x mode is basically no longer “officially” supported in the context of cinder without mucking around with projection matrices and whatnot (This only fixes the coordinate space, the results are unacceptably blurry). I’m in the process of downgrading xcode to 9.4.1, which by all reports fixes the issue.
If you’re in the middle of a project that relies on the 1x scale of OpenGL surfaces, don’t upgrade. Better yet, throw away your mac. This company is dogshit. /rant
I feel sad for all Apple developers and Mac users. Such a pleasant OS to work with, but the tools and support are now lightyears behind most other platforms.