MCPcopy Create free account
hub / github.com/Kitware/VTK / PrepProgramForGL2PS

Function PrepProgramForGL2PS

Rendering/ContextOpenGL2/vtkOpenGLContextDevice2D.cxx:140–162  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Releases the current shader program if it is inconsistent with the GL2PS capture state. Returns the current OpenGLGL2PSHelper instance if one exists.

Source from the content-addressed store, hash-verified

138// Releases the current shader program if it is inconsistent with the GL2PS
139// capture state. Returns the current OpenGLGL2PSHelper instance if one exists.
140vtkOpenGLGL2PSHelper* PrepProgramForGL2PS(vtkOpenGLHelper& helper)
141{
142 vtkOpenGLGL2PSHelper* gl2ps = vtkOpenGLGL2PSHelper::GetInstance();
143 if (gl2ps && gl2ps->GetActiveState() == vtkOpenGLGL2PSHelper::Capture)
144 {
145 // Always recreate the program when doing GL2PS capture.
146 if (helper.Program)
147 {
148 helper.ReleaseGraphicsResources(nullptr);
149 }
150 }
151 else
152 {
153 // If there is a feedback transform capturer set on the current shader
154 // program and we're not capturing, recreate the program.
155 if (helper.Program && helper.Program->GetTransformFeedback())
156 {
157 helper.ReleaseGraphicsResources(nullptr);
158 }
159 }
160
161 return gl2ps;
162}
163
164//------------------------------------------------------------------------------
165// Call before glDraw* commands to ensure that vertices are properly captured

Callers 4

ReadyVBOProgramMethod · 0.85
ReadyVCBOProgramMethod · 0.85
ReadyLinesBOProgramMethod · 0.85
ReadyLinesCBOProgramMethod · 0.85

Calls 1

Tested by

no test coverage detected