Mac OSX High Sierra Desktop mode Graphics Size incorrect

  • Hi, I'm getting an issue when compiling to the desktop target on Mac osx. Rendering to an imagecanvas only draws to the bottom left quarter of the window even a full imageCanvas.clear r,g,b will only fill up the bottom left quarter with the colour. But compiling to HTML5 it works fine. Is this a bug, possibly to do with how the mac deals with half-pixels, or is there something I'm missing that I should be doing?

  • What values does DeviceWidth/Height report back? Did you use a config file to set the window?
    What machine do you run it on?

  • I'm running it on:
    MacBook Pro (Retina, 15-inch, Late 2013)
    2.6 GHz Intel Core i7
    16 GB 1600 MHz DDR3
    NVIDIA GeForce GT 750M 2 GB
    Intel Iris Pro 1536 MB

    I'm running Cerberus V2017-10-24.

    I haven't edited the config file for either the HTML5 or the Desktop version.

    In HTML5 it reports back DeviceWidth 640 and DeviceHeight 480 and displays correctly.
    In Desktop (Glfw3) it also reports back DeviceWidth 640 and DeviceWidth 480 and the window is that size when compared to other software but the only part draw in is the bottom left at a size of 320x240. See the screenshot below for the comparison:

  • I will setup my El Capitan Imac in the next days to see if I can recreate this behaviour. I have a feeling that it is another quirk of High Sierra.

  • The problem is that the viewport was set incorrectly. I think that has something to do with the retina display from iMac. (4k)

    We are currently using glfwGetWindowSize() in gxtkGraphics::BeginRender() to determine the widht and height of the screen, but we need to use glfwGetFramebufferSize instead.

    I have changed the file mojo.glfw.cpp

    to this

  • Awesoem that you have found and fixed the problem. I will test it under El Capitan. If that fix works there too, I will add it to the repository.

  • I've copied the edits suggested above into my mojo.glfw.cpp file but it doesn't seem to make any difference in High Sierra unless there's something I'm doing wrong.

  • I diddn´t saw that you are using mojo2. This fix only works with mojo1.

    I have checked your code quickly and I have currently not enough time. But if you open your compiled main.cpp check for "glViewport" in the



    If you change




    it works. If you want to run on other devices you need to use glfwGetFramebufferSize().

    Mojo2 also use the DeviceWidth/DeviceHeight to set the viewport.

    Edited 4 times, last by York (February 24, 2018 at 6:29 AM).

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!