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

Function SetTexture

Rendering/OpenGL2/vtkOpenGLFramebufferObject.cxx:149–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147 }
148
149 void SetTexture(vtkTextureObject* val, unsigned int attachment, unsigned int target = 0,
150 unsigned int mipmapLevel = 0)
151 {
152
153 // always reset to false
154 this->CreatedByFO = false;
155
156 if (this->Texture == val && this->Attachment == attachment)
157 {
158 return;
159 }
160 this->Attached = false;
161 val->Register(nullptr);
162 if (this->Texture)
163 {
164 this->Texture->Delete();
165 this->Texture = nullptr;
166 }
167 if (this->Renderbuffer)
168 {
169 this->Renderbuffer->Delete();
170 this->Renderbuffer = nullptr;
171 }
172 this->Texture = val;
173 this->Attachment = attachment;
174 // if target not specified, used texture target
175 // a custom target is useful for cubemap
176 this->Target = target ? target : val->GetTarget();
177 this->MipmapLevel = mipmapLevel;
178 }
179
180 void SetRenderbuffer(vtkRenderbuffer* val, unsigned int attachment)
181 {

Callers 1

SetUpMethod · 0.85

Calls 3

GetTargetMethod · 0.80
DeleteMethod · 0.65
RegisterMethod · 0.45

Tested by

no test coverage detected