mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-11 18:34:58 +01:00
perform render thumbnail only if framebuffer available
This commit is contained in:
@@ -76,16 +76,11 @@ void RenderView::draw()
|
|||||||
scene.root()->draw(glm::identity<glm::mat4>(), P);
|
scene.root()->draw(glm::identity<glm::mat4>(), P);
|
||||||
fading_overlay_->draw(glm::identity<glm::mat4>(), projection);
|
fading_overlay_->draw(glm::identity<glm::mat4>(), projection);
|
||||||
frame_buffer_->end();
|
frame_buffer_->end();
|
||||||
}
|
|
||||||
|
|
||||||
// if a thumbnailer is pending
|
// if a thumbnailer is pending
|
||||||
if (thumbnailer_.size() > 0) {
|
if (thumbnailer_.size() > 0) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// promise will fail if no framebuffer
|
|
||||||
if ( frame_buffer_ == nullptr )
|
|
||||||
throw std::runtime_error("no frame");
|
|
||||||
|
|
||||||
// new thumbnailing framebuffer
|
// new thumbnailing framebuffer
|
||||||
FrameBuffer *frame_thumbnail = new FrameBuffer( glm::vec3(SESSION_THUMBNAIL_HEIGHT * frame_buffer_->aspectRatio(), SESSION_THUMBNAIL_HEIGHT, 1.f) );
|
FrameBuffer *frame_thumbnail = new FrameBuffer( glm::vec3(SESSION_THUMBNAIL_HEIGHT * frame_buffer_->aspectRatio(), SESSION_THUMBNAIL_HEIGHT, 1.f) );
|
||||||
|
|
||||||
@@ -116,7 +111,7 @@ void RenderView::draw()
|
|||||||
// done with this promise
|
// done with this promise
|
||||||
thumbnailer_.pop_back();
|
thumbnailer_.pop_back();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -136,7 +131,8 @@ FrameBufferImage *RenderView::thumbnail ()
|
|||||||
img = t.get();
|
img = t.get();
|
||||||
}
|
}
|
||||||
// catch any failed promise
|
// catch any failed promise
|
||||||
catch (std::runtime_error&){ }
|
catch (std::runtime_error&){
|
||||||
|
}
|
||||||
|
|
||||||
return img;
|
return img;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user