From: Stefan BrĂ¼ns Date: Tue, 9 Jun 2020 15:11:12 +0000 (+0200) Subject: Fix compilation when Qt is built for GLES platforms X-Git-Tag: archive/raspbian/9.0.1+dfsg1-8+rpi1~1^2~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=fe66b1162170ab171c6ce8fdb1840b3a7f1d3d6c;p=vtk9.git Fix compilation when Qt is built for GLES platforms On GLES 2.0/3.0 platforms (more specifically, for Qt5 "opengl es2" builds), QOpenGLFunctions_3_2_Core does not exist. After the last restructuring, from the GL 3.2 Core functions only glDrawBuffer is used. glDrawBuffer can be trivially replaced with glDrawBuffers, which is part of OpenGL 2.0 and GLES 3.0, and as an extension in many GLES 2.0 implementations. Gbp-Pq: Name 82_allow_gles_platforms.patch --- diff --git a/GUISupport/Qt/QVTKRenderWindowAdapter.cxx b/GUISupport/Qt/QVTKRenderWindowAdapter.cxx index 5a66e236..530cec9b 100644 --- a/GUISupport/Qt/QVTKRenderWindowAdapter.cxx +++ b/GUISupport/Qt/QVTKRenderWindowAdapter.cxx @@ -28,9 +28,8 @@ #include #include #include +#include #include -#include -#include #include #include #include @@ -334,14 +333,15 @@ public: { return false; } - QOpenGLFunctions_3_2_Core* f = this->Context->versionFunctions(); + QOpenGLExtraFunctions* f = this->Context->extraFunctions(); if (!f) { return false; } f->glBindFramebuffer(GL_DRAW_FRAMEBUFFER, targetId); - f->glDrawBuffer(targetAttachment); + const GLenum bufs[1] = { static_cast(targetAttachment) }; + f->glDrawBuffers(1, bufs); f->glBindFramebuffer(GL_READ_FRAMEBUFFER, this->FBO->handle()); f->glReadBuffer( @@ -436,7 +436,7 @@ public: { Q_ASSERT(this->Context && this->FBO); - QOpenGLFunctions_3_2_Core* f = this->Context->versionFunctions(); + QOpenGLFunctions* f = this->Context->functions(); if (f) { // now clear alpha otherwise we end up blending the rendering with