------------------------------------------------------------------------------
| 240 | |
| 241 | //------------------------------------------------------------------------------ |
| 242 | void 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 | //------------------------------------------------------------------------------ |
| 274 | vtkOpenGLRenderWindow* vtkTextureObject::GetContext() |
no test coverage detected