------------------------------------------------------------------------------
| 405 | |
| 406 | //------------------------------------------------------------------------------ |
| 407 | void vtkTextureObject::ReleaseGraphicsResources(vtkWindow* win) |
| 408 | { |
| 409 | if (!this->ResourceCallback->IsReleasing()) |
| 410 | { |
| 411 | this->ResourceCallback->Release(); |
| 412 | return; |
| 413 | } |
| 414 | |
| 415 | // Ensure that the context is current before releasing any graphics |
| 416 | // resources tied to it. |
| 417 | if (this->Handle) |
| 418 | { |
| 419 | vtkOpenGLRenderWindow* rwin = vtkOpenGLRenderWindow::SafeDownCast(win); |
| 420 | // you can commewnt out the next line to look for textures left active |
| 421 | rwin->DeactivateTexture(this); |
| 422 | if (this->OwnHandle) |
| 423 | { |
| 424 | GLuint tex = this->Handle; |
| 425 | glDeleteTextures(1, &tex); |
| 426 | this->OwnHandle = false; |
| 427 | } |
| 428 | this->Handle = 0; |
| 429 | this->NumberOfDimensions = 0; |
| 430 | this->Target = 0; |
| 431 | this->InternalFormat = 0; |
| 432 | this->Format = 0; |
| 433 | this->Type = 0; |
| 434 | this->Components = 0; |
| 435 | this->Width = this->Height = this->Depth = 0; |
| 436 | this->Modified(); |
| 437 | } |
| 438 | if (this->ShaderProgram) |
| 439 | { |
| 440 | this->ShaderProgram->ReleaseGraphicsResources(win); |
| 441 | delete this->ShaderProgram; |
| 442 | this->ShaderProgram = nullptr; |
| 443 | this->Modified(); |
| 444 | } |
| 445 | } |
| 446 | |
| 447 | //------------------------------------------------------------------------------ |
| 448 | void vtkTextureObject::Bind() |
no test coverage detected