mirror of
https://github.com/overte-org/overte.git
synced 2025-07-22 23:54:02 +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);
|
resetCamerasOnResizeGL(_myCamera, width, height);
|
||||||
|
|
||||||
glViewport(0, 0, width, height); // shouldn't this account for the menu???
|
glViewport(0, 0, width, height); // shouldn't this account for the menu???
|
||||||
|
_applicationOverlay.resize();
|
||||||
|
|
||||||
updateProjectionMatrix();
|
updateProjectionMatrix();
|
||||||
glLoadIdentity();
|
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() {
|
QOpenGLFramebufferObject* ApplicationOverlay::getFramebufferObject() {
|
||||||
if (!_framebufferObject) {
|
if (!_framebufferObject) {
|
||||||
_framebufferObject = new QOpenGLFramebufferObject(Application::getInstance()->getGLWidget()->size());
|
_framebufferObject = new QOpenGLFramebufferObject(Application::getInstance()->getGLWidget()->size());
|
||||||
|
|
|
@ -32,6 +32,7 @@ public:
|
||||||
void displayOverlayTexture3DTV(Camera& whichCamera, float aspectRatio, float fov);
|
void displayOverlayTexture3DTV(Camera& whichCamera, float aspectRatio, float fov);
|
||||||
void computeOculusPickRay(float x, float y, glm::vec3& direction) const;
|
void computeOculusPickRay(float x, float y, glm::vec3& direction) const;
|
||||||
void getClickLocation(int &x, int &y) const;
|
void getClickLocation(int &x, int &y) const;
|
||||||
|
void resize();
|
||||||
|
|
||||||
// Getters
|
// Getters
|
||||||
QOpenGLFramebufferObject* getFramebufferObject();
|
QOpenGLFramebufferObject* getFramebufferObject();
|
||||||
|
|
Loading…
Reference in a new issue