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

Method SetContext

Rendering/OpenGL2/vtkTextureObject.cxx:242–271  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

240
241//------------------------------------------------------------------------------
242void vtkTextureObject::SetContext(vtkOpenGLRenderWindow* renWin)
243{
244 this->ResourceCallback->RegisterGraphicsResources(renWin);
245
246 // avoid pointless reassignment
247 if (this->Context == renWin)
248 {
249 return;
250 }
251
252 this->ResetFormatAndType();
253
254 this->Context = nullptr;
255 this->Modified();
256 // all done if assigned null
257 if (!renWin)
258 {
259 return;
260 }
261
262 if (!this->LoadRequiredExtensions(renWin))
263 {
264 vtkErrorMacro("Required OpenGL extensions not supported by the context.");
265 return;
266 }
267
268 // initialize
269 this->Context = renWin;
270 this->Context->MakeCurrent();
271}
272
273//------------------------------------------------------------------------------
274vtkOpenGLRenderWindow* vtkTextureObject::GetContext()

Callers 3

DownloadMethod · 0.45
CopyFromFrameBufferMethod · 0.45

Calls 5

ResetFormatAndTypeMethod · 0.95
ModifiedMethod · 0.45
MakeCurrentMethod · 0.45

Tested by

no test coverage detected