mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 18:25:52 +02:00
Fix for fullscreen mode switching: when we reshape, we need to resize the
render texture (if it exists).
This commit is contained in:
parent
346f213e3b
commit
9dfc6c6590
1 changed files with 6 additions and 0 deletions
|
@ -1748,6 +1748,12 @@ void reshape(int width, int height)
|
||||||
camera.setAspectRatio(aspectRatio *= 0.5);
|
camera.setAspectRatio(aspectRatio *= 0.5);
|
||||||
camera.setFieldOfView(fov = 2 * atan((0.0468 * ::oculusDistortionScale) / 0.041) * (180 / PI));
|
camera.setFieldOfView(fov = 2 * atan((0.0468 * ::oculusDistortionScale) / 0.041) * (180 / PI));
|
||||||
|
|
||||||
|
// resize the render texture
|
||||||
|
if (::oculusTextureID != 0) {
|
||||||
|
glBindTexture(GL_TEXTURE_2D, ::oculusTextureID);
|
||||||
|
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, WIDTH, HEIGHT, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
|
||||||
|
glBindTexture(GL_TEXTURE_2D, 0);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
camera.setFieldOfView(fov = 60);
|
camera.setFieldOfView(fov = 60);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue