Commit f497ed3a authored by Ken Martin's avatar Ken Martin

Added some ifdef needed for OpenGL ES 20

Change-Id: I19b5acbec07a1ee4493876e9fedbda2befe749ad
parent 9b3d5ea3
......@@ -134,8 +134,10 @@ void vtkGaussianBlurPass::Render(const vtkRenderState *s)
this->FrameBufferObject->SetActiveBuffer(0);
this->FrameBufferObject->SetDepthBufferNeeded(true);
#if GL_ES_VERSION_2_0 != 1
GLint savedCurrentDrawBuffer;
glGetIntegerv(GL_DRAW_BUFFER,&savedCurrentDrawBuffer);
#endif
supported=this->FrameBufferObject->StartNonOrtho(64,64,false);
if(!supported)
{
......@@ -144,7 +146,9 @@ void vtkGaussianBlurPass::Render(const vtkRenderState *s)
else
{
this->FrameBufferObject->UnBind();
#if GL_ES_VERSION_2_0 != 1
glDrawBuffer(static_cast<GLenum>(savedCurrentDrawBuffer));
#endif
}
}
......@@ -159,8 +163,10 @@ void vtkGaussianBlurPass::Render(const vtkRenderState *s)
return;
}
#if GL_ES_VERSION_2_0 != 1
GLint savedDrawBuffer;
glGetIntegerv(GL_DRAW_BUFFER,&savedDrawBuffer);
#endif
// 1. Create a new render state with an FBO.
......@@ -296,7 +302,9 @@ void vtkGaussianBlurPass::Render(const vtkRenderState *s)
// restore some state.
this->FrameBufferObject->UnBind();
#if GL_ES_VERSION_2_0 != 1
glDrawBuffer(static_cast<GLenum>(savedDrawBuffer));
#endif
return;
}
......@@ -389,10 +397,11 @@ void vtkGaussianBlurPass::Render(const vtkRenderState *s)
this->FrameBufferObject->UnBind();
#if GL_ES_VERSION_2_0 != 1
glDrawBuffer(static_cast<GLenum>(savedDrawBuffer));
#endif
// to2 is the source
this->Pass2->Activate();
sourceId = this->Pass2->GetTextureUnit();
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
......
......@@ -121,11 +121,12 @@ void vtkSobelGradientMagnitudePass::Render(const vtkRenderState *s)
vtkOpenGLClearErrorMacro();
#if GL_ES_VERSION_2_0 != 1
GLint savedDrawBuffer;
glGetIntegerv(GL_DRAW_BUFFER,&savedDrawBuffer);
#endif
// 1. Create a new render state with an FBO.
int width=0;
int height=0;
int size[2];
......@@ -281,8 +282,9 @@ void vtkSobelGradientMagnitudePass::Render(const vtkRenderState *s)
// restore some state.
this->FrameBufferObject->UnBind();
#if GL_ES_VERSION_2_0 != 1
glDrawBuffer(savedDrawBuffer);
#endif
return;
}
......@@ -411,7 +413,9 @@ void vtkSobelGradientMagnitudePass::Render(const vtkRenderState *s)
if(this->Program2->Program->GetCompiled() != true)
{
vtkErrorMacro("Couldn't build the shader program. At this point , it can be an error in a shader or a driver bug.");
#if GL_ES_VERSION_2_0 != 1
glDrawBuffer(savedDrawBuffer);
#endif
return;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment