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

Method Start

Rendering/External/vtkExternalOpenGLRenderWindow.cxx:28–75  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

26
27//------------------------------------------------------------------------------
28void 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//------------------------------------------------------------------------------
78bool vtkExternalOpenGLRenderWindow::IsCurrent()

Callers

nothing calls this directly

Calls 10

SetIsDirectMethod · 0.80
vtkglGetIntegervMethod · 0.80
GetRenderersMethod · 0.80
GetStateMethod · 0.45
SetPositionMethod · 0.45
SetSizeMethod · 0.45
CreateFramebuffersMethod · 0.45
InitTraversalMethod · 0.45
BindMethod · 0.45

Tested by

no test coverage detected