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:
itsmattkc
2020-01-03 21:17:20 +11:00
parent 3369bb53f9
commit 3a8a509f1a
6 changed files with 36 additions and 11 deletions
+5 -5
View File
@@ -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());