47 lines
1.8 KiB
Diff
47 lines
1.8 KiB
Diff
|
From 98857882cdd0a08a5102d663dc9510e6343adbfa Mon Sep 17 00:00:00 2001
|
||
|
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
|
||
|
Date: Sun, 28 Jun 2020 22:13:32 +0200
|
||
|
Subject: [PATCH 1/2] Replace last glDrawBuffer call with glDrawBuffers(1, ...)
|
||
|
|
||
|
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.
|
||
|
---
|
||
|
Rendering/ContextOpenGL2/vtkOpenGLContextDevice2DPrivate.h | 3 ++-
|
||
|
ThirdParty/glew/vtk_glew.h.in | 1 -
|
||
|
2 files changed, 2 insertions(+), 2 deletions(-)
|
||
|
|
||
|
diff --git a/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2DPrivate.h b/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2DPrivate.h
|
||
|
index ddeeb04d38..2e1cc9cbf2 100644
|
||
|
--- a/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2DPrivate.h
|
||
|
+++ b/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2DPrivate.h
|
||
|
@@ -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],
|
||
|
diff --git a/ThirdParty/glew/vtk_glew.h.in b/ThirdParty/glew/vtk_glew.h.in
|
||
|
index 009f230b19..1763e79319 100644
|
||
|
--- a/ThirdParty/glew/vtk_glew.h.in
|
||
|
+++ b/ThirdParty/glew/vtk_glew.h.in
|
||
|
@@ -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
|
||
|
--
|
||
|
2.27.0
|
||
|
|