Skip to content
Snippets Groups Projects
Commit 57cc6bd4 authored by Sean McBride's avatar Sean McBride
Browse files

Fixed #18047: modified Cocoa drawRect: to push/pop OpenGLState before Render

Patch from Ken Martin:

We think macOS is doing stuff in OpenGL as part of its process for getting the image on the screen. Which is reasonable. But it means that macOS may change the OpenGL state in a way that VTK is not aware of. And likewise VTK could change state in a way that screws up what macOS is expecting. So the added code tries to avoid all that by making some extra OpenGL calls to protect both sides of the equation.

Superficially, this fixes "Error in cache state for GL_SCISSOR_BOX" logs that were previously spewed while resizing a window.
parent 259a6a62
No related branches found
No related tags found
No related merge requests found
......@@ -21,6 +21,7 @@
#import "vtkCocoaRenderWindowInteractor.h"
#import "vtkCommand.h"
#import "vtkNew.h"
#import "vtkOpenGLState.h"
#import "vtkStringArray.h"
//----------------------------------------------------------------------------
......@@ -125,6 +126,10 @@
if (_myVTKRenderWindow && _myVTKRenderWindow->GetMapped())
{
vtkOpenGLState* state = _myVTKRenderWindow->GetState();
state->ResetGLScissorState();
vtkOpenGLState::ScopedglScissor ss(state);
_myVTKRenderWindow->Render();
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment