Commit 7f1300d5 authored by mostajab's avatar mostajab
Browse files

+ Add the functionality to resizing the depth buffer as the canvas is resized.

parent 22e94059
......@@ -160,6 +160,22 @@ namespace campvis {
void DataContainerInspectorCanvas::paint() {
/// if the window is resized, change the depth buffer size, also!
if(_depthBuffer)
if(_depthBuffer->getWidth() != width() || _depthBuffer->getHeight() != height()) {
delete _depthBuffer;
_depthBuffer = new tgt::Texture(0, tgt::ivec3(width(), height(), 1), GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT24, GL_FLOAT, tgt::Texture::LINEAR); //, _renderingWndSize(tgt::ivec2(400, 100))
_texturesDirty = true;
}
else {
// Do nothing!
}
else {
_depthBuffer = new tgt::Texture(0, tgt::ivec3(width(), height(), 1), GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT24, GL_FLOAT, tgt::Texture::LINEAR); //, _renderingWndSize(tgt::ivec2(400, 100))
_texturesDirty = true;
}
LGL_ERROR;
tbb::mutex::scoped_lock lock(_localMutex);
if (_texturesDirty)
......@@ -404,7 +420,7 @@ namespace campvis {
invalidate();
}
void DataContainerInspectorCanvas::sizeChanged(const tgt::ivec2&) {
void DataContainerInspectorCanvas::sizeChanged(const tgt::ivec2& size) {
invalidate();
}
......
......@@ -151,6 +151,7 @@ namespace campvis {
* \param handle DataHandle containing the image to save. Must contain ImageData or RenderData!
* \param filename Filename for the file to save.
*/
//protected:
public: // Only for Debuggin
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment