------------------------------------------------------------------------------
| 26 | |
| 27 | //------------------------------------------------------------------------------ |
| 28 | void vtkExternalOpenGLRenderWindow::Start() |
| 29 | { |
| 30 | // Use hardware acceleration |
| 31 | this->SetIsDirect(1); |
| 32 | |
| 33 | auto ostate = this->GetState(); |
| 34 | |
| 35 | if (this->AutomaticWindowPositionAndResize) |
| 36 | { |
| 37 | int info[4]; |
| 38 | ostate->vtkglGetIntegerv(GL_VIEWPORT, info); |
| 39 | this->SetPosition(info[0], info[1]); |
| 40 | this->SetSize(info[2], info[3]); |
| 41 | } |
| 42 | |
| 43 | // creates or resizes the framebuffer |
| 44 | this->Size[0] = (this->Size[0] > 0 ? this->Size[0] : 300); |
| 45 | this->Size[1] = (this->Size[1] > 0 ? this->Size[1] : 300); |
| 46 | this->CreateFramebuffers(this->Size[0], this->Size[1]); |
| 47 | |
| 48 | // For stereo, render the correct eye based on the OpenGL buffer mode |
| 49 | GLint bufferType; |
| 50 | ostate->vtkglGetIntegerv(GL_DRAW_BUFFER, &bufferType); |
| 51 | vtkCollectionSimpleIterator sit; |
| 52 | vtkRenderer* renderer; |
| 53 | for (this->GetRenderers()->InitTraversal(sit); |
| 54 | (renderer = this->GetRenderers()->GetNextRenderer(sit));) |
| 55 | { |
| 56 | if (bufferType == GL_BACK_RIGHT || bufferType == GL_RIGHT || bufferType == GL_FRONT_RIGHT) |
| 57 | { |
| 58 | this->StereoRenderOn(); |
| 59 | this->SetStereoTypeToRight(); |
| 60 | } |
| 61 | else |
| 62 | { |
| 63 | this->SetStereoTypeToLeft(); |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | ostate->PushFramebufferBindings(); |
| 68 | |
| 69 | if (this->UseExternalContent) |
| 70 | { |
| 71 | this->BlitToRenderFramebuffer(true); |
| 72 | } |
| 73 | |
| 74 | this->RenderFramebuffer->Bind(); |
| 75 | } |
| 76 | |
| 77 | //------------------------------------------------------------------------------ |
| 78 | bool vtkExternalOpenGLRenderWindow::IsCurrent() |
nothing calls this directly
no test coverage detected