Open IntellectualKitty opened 1 year ago
Isn't this somehow being solved using the Cinder function toPixels()
? Or is there a problem with window creation only, which may not be accessible code for the average user?
It's been a while since I used Cinder, but the OpenGL ShadowMapping sample is a nice base for me to build from, and Cinder is always easy to work with.
Anyway, when built and ran the sample, it was drawing to the lower-left quarter of the window, a symptom I often come across on my Mac, hence my familiarity with it.
I don't know if toPixels() solves this or not. I did try to find a getFramebufferSize() as a counterpart to getWindowSize() in the App code, but didn't find anything. (That's the standard solution that I'm familiar with.)
My issue is that an app should draw to the whole window right out of the box. But thanks for the tip about toPixels()!
I've checked, and toPixels() is being called when the viewport is being set with the window size.
When I take out the toPixels() call, it doesn't change. I did notice that getContentScale(), which is what toPixels() uses, defaults to 1.0f...
I apologize. This may or may not be the issue. The architecture and base SDK settings are incorrect for the current main branch (I freshly downloaded Cinder) when using CMake to generate an Xcode project for the library; the samples seem to have the same erroneous settings as well (e.g., x486_64).
Resetting the architecture to standard architectures and the base SDK to macOS in the pull-down list for both the library and the samples seems to work. I was able to run other samples now, and they are scaled correctly, when they didn't build before.
Sadly, the ShadowMapping still doesn't work, but I'm on a new project now, and don't have time to figure out what's wrong. I started modifying it and who knows what I did to it...
Anyway, I hope the information is helpful.
Thanks again!
Thanks for your report, anyway! I currently do not have access to a Mac, so I can't attempt to fix your issue myself. But it seems to me that getContentScale()
should return something else than 1.0.
On Windows, I seem to recall that the application manifest needs to be changed to enable high pixel density settings. And perhaps something similar needs to be done on the Mac. If your SDK or other settings are out of date, that probably doesn't help.
Perhaps someone else finds time to look at this. The information presented above may help.
On Windows, I seem to recall that the application manifest needs to be changed to enable high pixel density settings. And perhaps something similar needs to be done on the Mac. If your SDK or other settings are out of date, that probably doesn't help.
Yep, to opt out of retina mode you can set High Resolution Capable to NO
in your Info.plist
On my Mac, content is drawn only in the lower left quarter of the window because the frame buffer is 2x2 times the resolution of the window on the Retina display thingy.
I'm notccompletely fluent on the details, I just have experience with this with GLFW. And they solve this -- and explain it pretty clearly, too! -- by using glfwGetFramebufferSize instead of glfwGetWindowSize for the call to glViewport.