# Window issue on OSX Mojave

**URL:** <https://discourse.libcinder.org/t/window-issue-on-osx-mojave/1326>\
**Category:** Using Cinder\
**Created:** [October 5, 2018, 4:02pm UTC](https://discourse.libcinder.org/t/window-issue-on-osx-mojave/1326 "2018-10-05T16:02:11Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![barry.m](https://avatars.discourse-cdn.com/v4/letter/b/ee7513/32.png) [@barry.m](https://discourse.libcinder.org/u/barry.m)\
**Post date:** [October 5, 2018, 4:02pm UTC](https://discourse.libcinder.org/t/window-issue-on-osx-mojave/1326/1 "2018-10-05T16:02:11Z")

</div>

Hi

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.

Has anyone else noticed this behavior?

Can anyone suggest a workaround?

 ![05%20PM](https://canada1.discourse-cdn.com/flex030/uploads/libcinder/original/1X/f5396601520a6591bde950f6260377e6441407b4.jpeg)

---

<div class="post-metadata">

**Author:** ![phil](https://avatars.discourse-cdn.com/v4/letter/p/e95f7d/32.png) [@phil](https://discourse.libcinder.org/u/phil)\
**Post date:** [October 5, 2018, 6:36pm UTC](https://discourse.libcinder.org/t/window-issue-on-osx-mojave/1326/2 "2018-10-05T18:36:17Z")

</div>

Hi Barry,

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.

Phil

---

<div class="post-metadata">

**Author:** ![barry.m](https://avatars.discourse-cdn.com/v4/letter/b/ee7513/32.png) [@barry.m](https://discourse.libcinder.org/u/barry.m)\
**Post date:** [October 5, 2018, 7:01pm UTC](https://discourse.libcinder.org/t/window-issue-on-osx-mojave/1326/3 "2018-10-05T19:01:10Z")

</div>

Hi Phil

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?

---

<div class="post-metadata">

**Author:** ![paul.houx](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/paul.houx/32/31_2.png) [@paul.houx](https://discourse.libcinder.org/u/paul.houx)\
**Post date:** [October 5, 2018, 9:06pm UTC](https://discourse.libcinder.org/t/window-issue-on-osx-mojave/1326/4 "2018-10-05T21:06:09Z")

</div>

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:

```auto
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:

```auto
void MyApp::resize()
{
    gl::setMatricesWindow( getWindowSize() );
}

```

If that’s not it, the issue might also be related to content scaling. Perhaps you’re running this on a high density monitor. Try this:

```auto
gl::drawSolidCircle( toPixels( getWindowCenter() ), toPixels( 20.0f ) );

```

(note: I did not try this code myself, so it might need some tweaks)

---

<div class="post-metadata">

**Author:** ![barry.m](https://avatars.discourse-cdn.com/v4/letter/b/ee7513/32.png) [@barry.m](https://discourse.libcinder.org/u/barry.m)\
**Post date:** [October 6, 2018, 11:18am UTC](https://discourse.libcinder.org/t/window-issue-on-osx-mojave/1326/5 "2018-10-06T11:18:24Z")

</div>

I hadn’t been resizing the window and

```
gl::drawSolidCircle( toPixels( getWindowCenter() ), toPixels( 20.0f ) );

```

hasn’t worked.

Could it be anything to do with the fact that I’m using an Intel Iris Graphics 6100 1536 MB?

Edit: Spotted this issue on the oF forums. There appears to be issues with oF on Mojave too.

> **[No rendering initially in Mojave](https://forum.openframeworks.cc/t/no-rendering-initially-in-mojave/30624)**
>
> Hi All I’m running oF 0.10.0 and just updated to Mojave and Apple appear to be doing something slightly different under the hood now, I get a blank screen when my app starts up, although the code is running in the background, I’ve found I need to...

---

<div class="post-metadata">

**Author:** ![gabor\_papp](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/gabor_papp/32/769_2.png) [@gabor\_papp](https://discourse.libcinder.org/u/gabor_papp)\
**Post date:** [October 6, 2018, 2:43pm UTC](https://discourse.libcinder.org/t/window-issue-on-osx-mojave/1326/6 "2018-10-06T14:43:25Z")

</div>

If you send your full code someone can try it in pre Mojave, maybe.

---

<div class="post-metadata">

**Author:** ![barry.m](https://avatars.discourse-cdn.com/v4/letter/b/ee7513/32.png) [@barry.m](https://discourse.libcinder.org/u/barry.m)\
**Post date:** [October 6, 2018, 2:52pm UTC](https://discourse.libcinder.org/t/window-issue-on-osx-mojave/1326/7 "2018-10-06T14:52:08Z")

</div>

That would be great.

```
#include "cinder/app/App.h"
#include "cinder/app/RendererGl.h"
#include "cinder/gl/gl.h"

using namespace ci;
using namespace ci::app;
using namespace std;

class CinderProjectApp : public App {
public:
    void setup() override;
    void mouseDown( MouseEvent event ) override;
    void update() override;
    void draw() override;
};

void CinderProjectApp::setup()
{
    cout << "height: " << getWindowHeight() << endl;
    cout << "width: " << getWindowWidth() << endl;
    cout << "center: " << getWindowCenter() << endl;
}

void CinderProjectApp::mouseDown( MouseEvent event )
{
}

void CinderProjectApp::update()
{
}

void CinderProjectApp::draw()
{
gl::clear( Color( 0, 0, 0 ) );
    gl::setMatricesWindow( getWindowSize() );
    gl::drawSolidCircle( getWindowCenter(), 20.0 );
    // gl::drawSolidCircle( toPixels( getWindowCenter() ), toPixels( 20.0f ) );
}

CINDER_APP( CinderProjectApp, RendererGl )

```

Like I said, it’s a very basic example.

---

<div class="post-metadata">

**Author:** ![seph](https://avatars.discourse-cdn.com/v4/letter/s/87869e/32.png) [@seph](https://discourse.libcinder.org/u/seph)\
**Post date:** [October 6, 2018, 11:01pm UTC](https://discourse.libcinder.org/t/window-issue-on-osx-mojave/1326/8 "2018-10-06T23:01:14Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![gabor\_papp](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/gabor_papp/32/769_2.png) [@gabor\_papp](https://discourse.libcinder.org/u/gabor_papp)\
**Post date:** [October 7, 2018, 7:23am UTC](https://discourse.libcinder.org/t/window-issue-on-osx-mojave/1326/9 "2018-10-07T07:23:09Z")

</div>

I tried it on sierra and it works fine. also with high density enabled on startup.

---

<div class="post-metadata">

**Author:** ![barry.m](https://avatars.discourse-cdn.com/v4/letter/b/ee7513/32.png) [@barry.m](https://discourse.libcinder.org/u/barry.m)\
**Post date:** [October 7, 2018, 12:06pm UTC](https://discourse.libcinder.org/t/window-issue-on-osx-mojave/1326/10 "2018-10-07T12:06:20Z")

</div>

Thanks for your responses guys.

Stupid question: How do I enable / disable highDensity?

---

<div class="post-metadata">

**Author:** ![gabor\_papp](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/gabor_papp/32/769_2.png) [@gabor\_papp](https://discourse.libcinder.org/u/gabor_papp)\
**Post date:** [October 7, 2018, 12:18pm UTC](https://discourse.libcinder.org/t/window-issue-on-osx-mojave/1326/11 "2018-10-07T12:18:20Z")

</div>

extend the CINDER\_APP macro at the end of the source.

```auto
CINDER_APP( CinderProjectApp, RendererGl,
        []( CinderProjectApp::Settings *settings )
        {
            settings->setHighDensityDisplayEnabled( false );
        } )

```

---

<div class="post-metadata">

**Author:** ![barry.m](https://avatars.discourse-cdn.com/v4/letter/b/ee7513/32.png) [@barry.m](https://discourse.libcinder.org/u/barry.m)\
**Post date:** [October 7, 2018, 1:25pm UTC](https://discourse.libcinder.org/t/window-issue-on-osx-mojave/1326/12 "2018-10-07T13:25:39Z")

</div>

> [@gabor\_papp](#):
>
> ```auto
> CINDER_APP( CinderProjectApp, RendererGl,
> []( CinderProjectApp::Settings *settings )
> {
> settings->setHighDensityDisplayEnabled( false );
> } )
> 
> ```

Thanks gabor! setting setHighDensityDisplayEnabled to true did the trick!

---

<div class="post-metadata">

**Author:** ![gabor\_papp](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/gabor_papp/32/769_2.png) [@gabor\_papp](https://discourse.libcinder.org/u/gabor_papp)\
**Post date:** [October 7, 2018, 1:38pm UTC](https://discourse.libcinder.org/t/window-issue-on-osx-mojave/1326/13 "2018-10-07T13:38:34Z")

</div>

Great. So it seems that the default is high density on Mojave as @seph thought, but Cinder does not detect it.

---

<div class="post-metadata">

**Author:** ![lithium](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/lithium/32/38_2.png) [@lithium](https://discourse.libcinder.org/u/lithium)\
**Post date:** [October 19, 2018, 11:15pm UTC](https://discourse.libcinder.org/t/window-issue-on-osx-mojave/1326/14 "2018-10-19T23:15:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![paul.houx](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/paul.houx/32/31_2.png) [@paul.houx](https://discourse.libcinder.org/u/paul.houx)\
**Post date:** [October 20, 2018, 9:13am UTC](https://discourse.libcinder.org/t/window-issue-on-osx-mojave/1326/15 "2018-10-20T09:13:53Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![lithium](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/lithium/32/38_2.png) [@lithium](https://discourse.libcinder.org/u/lithium)\
**Post date:** [November 1, 2018, 10:24am UTC](https://discourse.libcinder.org/t/window-issue-on-osx-mojave/1326/16 "2018-11-01T10:24:19Z")

</div>

This seems to be addressed with the xcode 10.1 release.
