mirror of
https://github.com/overte-org/overte.git
synced 2025-07-22 15:33:39 +02:00
Resize the overlay framebuffer when the application window is resized
This commit is contained in:
parent
97ca6d70fa
commit
2ad2b6cd1c
3 changed files with 8 additions and 0 deletions
|
@ -712,6 +712,7 @@ void Application::resizeGL(int width, int height) {
|
|||
resetCamerasOnResizeGL(_myCamera, width, height);
|
||||
|
||||
glViewport(0, 0, width, height); // shouldn't this account for the menu???
|
||||
_applicationOverlay.resize();
|
||||
|
||||
updateProjectionMatrix();
|
||||
glLoadIdentity();
|
||||
|
|
|
@ -998,6 +998,12 @@ void ApplicationOverlay::renderTexturedHemisphere() {
|
|||
|
||||
}
|
||||
|
||||
void ApplicationOverlay::resize() {
|
||||
delete _framebufferObject;
|
||||
_framebufferObject = NULL;
|
||||
// _framebufferObject is recreated at the correct size the next time it is accessed via getFramebufferObject().
|
||||
}
|
||||
|
||||
QOpenGLFramebufferObject* ApplicationOverlay::getFramebufferObject() {
|
||||
if (!_framebufferObject) {
|
||||
_framebufferObject = new QOpenGLFramebufferObject(Application::getInstance()->getGLWidget()->size());
|
||||
|
|
|
@ -32,6 +32,7 @@ public:
|
|||
void displayOverlayTexture3DTV(Camera& whichCamera, float aspectRatio, float fov);
|
||||
void computeOculusPickRay(float x, float y, glm::vec3& direction) const;
|
||||
void getClickLocation(int &x, int &y) const;
|
||||
void resize();
|
||||
|
||||
// Getters
|
||||
QOpenGLFramebufferObject* getFramebufferObject();
|
||||
|
|
Loading…
Reference in a new issue