Resize the overlay framebuffer when the application window is resized

This commit is contained in:
David Rowe 2014-07-03 18:23:37 -07:00
parent 97ca6d70fa
commit 2ad2b6cd1c
3 changed files with 8 additions and 0 deletions

View file

@ -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();

View file

@ -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());

View file

@ -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();