Replace last glDrawBuffer call with glDrawBuffers(1, ...)
authorStefan Brüns <stefan.bruens@rwth-aachen.de>
Sun, 28 Jun 2020 20:13:32 +0000 (22:13 +0200)
committerAnton Gladky <gladk@debian.org>
Sun, 13 Dec 2020 11:55:42 +0000 (11:55 +0000)
glDrawBuffer is only available in Desktop OpenGL, while the equivalent
glDrawBuffers is valid also for GLES.

Just defining glDrawBuffer as an empty macro is obviously not the right
solution, as the call is also required on GLES. This also causes
a compilation failure - GL.h may be included via GLX.h on X11 platforms,
and the glDrawBuffer prototype declaration becomes malformed.

Gbp-Pq: Name 81_allow_gles_platforms.patch

Rendering/ContextOpenGL2/vtkOpenGLContextDevice2DPrivate.h
ThirdParty/glew/vtk_glew.h.in

index 5632547459072967736976c1dbf610cfcc7da978..ae3bd53f058cef36c277cafb465d343fd643e61c 100644 (file)
@@ -324,7 +324,8 @@ public:
 
       if (this->SavedDrawBuffer != GL_BACK_LEFT)
       {
-        glDrawBuffer(this->SavedDrawBuffer);
+        const GLenum bufs[1] = { static_cast<GLenum>(this->SavedDrawBuffer) };
+        ::glDrawBuffers(1, bufs);
       }
 
       ostate->vtkglClearColor(this->SavedClearColor[0], this->SavedClearColor[1],
index 6aa8c2ee9ea218b962ce15a24db0f475320fb5f5..6afed1d6556399f8cc95dba7d6b53ed4e1ed5930 100644 (file)
@@ -52,7 +52,6 @@
 
 /* some fixes for both ES 2 and 3 */
 #ifdef GL_ES_VERSION_3_0
-#  define glDrawBuffer(arg)
 #  define GL_BACK_LEFT 0
 #  define GL_BACK_RIGHT 0
 #  define GL_FRONT_LEFT 0