Commit 0994d6ca authored by Burlen Loring's avatar Burlen Loring
Browse files

OpenGL error hunt -- dashboard cleanup

Test for context in vtkFrameBufferObject when Get'ing
FBO attributes. This prevents driver segfault in
TestSetGet.tcl on Apple.

Change-Id: If093750770a5a55ac3cd69eaa0a7d8115e2d3771
parent e07e9824
......@@ -529,17 +529,27 @@ void vtkFrameBufferObject::CreateColorBuffers(
//----------------------------------------------------------------------------
unsigned int vtkFrameBufferObject::GetMaximumNumberOfActiveTargets()
{
unsigned int result = 0;
if (this->Context)
{
GLint maxbuffers;
glGetIntegerv(vtkgl::MAX_DRAW_BUFFERS, &maxbuffers);
return static_cast<unsigned int>(maxbuffers);
result = static_cast<unsigned int>(maxbuffers);
}
return result;
}
//----------------------------------------------------------------------------
unsigned int vtkFrameBufferObject::GetMaximumNumberOfRenderTargets()
{
unsigned int result = 0;
if (this->Context)
{
GLint maxColorAttachments;
glGetIntegerv(vtkgl::MAX_COLOR_ATTACHMENTS_EXT,&maxColorAttachments);
return static_cast<unsigned int>(maxColorAttachments);
result = static_cast<unsigned int>(maxColorAttachments);
}
return result;
}
//----------------------------------------------------------------------------
......
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