clear frame caches and renderers if the viewer node is ever changed
Clears the state if a viewer node is disconnected.
This commit is contained in:
@@ -123,11 +123,6 @@ void ViewerGLWidget::initializeGL()
|
||||
|
||||
void ViewerGLWidget::paintGL()
|
||||
{
|
||||
// We only draw if we have a pipeline
|
||||
if (!pipeline_ || !texture_) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Get functions attached to this context (they will already be initialized)
|
||||
QOpenGLFunctions* f = context()->functions();
|
||||
|
||||
@@ -135,6 +130,11 @@ void ViewerGLWidget::paintGL()
|
||||
f->glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
f->glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
// We only draw if we have a pipeline
|
||||
if (!pipeline_ || !texture_) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Bind retrieved texture
|
||||
f->glBindTexture(GL_TEXTURE_2D, texture_->texture());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user