mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-14 11:46:34 +02:00
Merge pull request #5547 from jherico/marge
PLUGINS - Retina display issues
This commit is contained in:
commit
34f6699fb7
1 changed files with 9 additions and 4 deletions
|
@ -1191,16 +1191,21 @@ void Application::resizeGL() {
|
|||
|
||||
// Possible change in aspect ratio
|
||||
loadViewFrustum(_myCamera, _viewFrustum);
|
||||
float fov = glm::radians(DEFAULT_FIELD_OF_VIEW_DEGREES);
|
||||
float aspectRatio = aspect(_renderResolution);
|
||||
_myCamera.setProjection(glm::perspective(fov, aspectRatio, DEFAULT_NEAR_CLIP, DEFAULT_FAR_CLIP));
|
||||
}
|
||||
_myCamera.setProjection(glm::perspective(glm::radians(DEFAULT_FIELD_OF_VIEW_DEGREES), aspect(_renderResolution),
|
||||
DEFAULT_NEAR_CLIP, DEFAULT_FAR_CLIP));
|
||||
|
||||
|
||||
auto offscreenUi = DependencyManager::get<OffscreenUi>();
|
||||
|
||||
auto uiSize = displayPlugin->getRecommendedUiSize();
|
||||
if (offscreenUi->size() != fromGlm(uiSize)) {
|
||||
// Bit of a hack since there's no device pixel ratio change event I can find.
|
||||
static qreal lastDevicePixelRatio = 0;
|
||||
qreal devicePixelRatio = _window->devicePixelRatio();
|
||||
if (offscreenUi->size() != fromGlm(uiSize) || devicePixelRatio != lastDevicePixelRatio) {
|
||||
offscreenUi->resize(fromGlm(uiSize));
|
||||
_offscreenContext->makeCurrent();
|
||||
lastDevicePixelRatio = devicePixelRatio;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue