| 268 | } |
| 269 | |
| 270 | void vtkOpenGLContextDevice3D::DrawPoly( |
| 271 | const float* verts, int n, const unsigned char* colors, int nc) |
| 272 | { |
| 273 | assert("verts must be non-null" && verts != nullptr); |
| 274 | assert("n must be greater than 0" && n > 0); |
| 275 | |
| 276 | if (this->Pen->GetLineType() == vtkPen::NO_PEN) |
| 277 | { |
| 278 | return; |
| 279 | } |
| 280 | |
| 281 | vtkOpenGLClearErrorMacro(); |
| 282 | |
| 283 | this->EnableDepthBuffer(); |
| 284 | |
| 285 | this->Storage->SetLineType(this->Pen->GetLineType()); |
| 286 | |
| 287 | vtkOpenGLHelper* cbo = nullptr; |
| 288 | if (colors) |
| 289 | { |
| 290 | this->ReadyVCBOProgram(); |
| 291 | cbo = this->VCBO; |
| 292 | if (!cbo->Program) |
| 293 | { |
| 294 | return; |
| 295 | } |
| 296 | } |
| 297 | else |
| 298 | { |
| 299 | this->ReadyVBOProgram(); |
| 300 | cbo = this->VBO; |
| 301 | if (!cbo->Program) |
| 302 | { |
| 303 | return; |
| 304 | } |
| 305 | if (this->HaveWideLines()) |
| 306 | { |
| 307 | vtkWarningMacro( |
| 308 | << "a line width has been requested that is larger than your system supports"); |
| 309 | } |
| 310 | else |
| 311 | { |
| 312 | this->RenderWindow->GetState()->vtkglLineWidth(this->Pen->GetWidth()); |
| 313 | } |
| 314 | cbo->Program->SetUniform4uc("vertexColor", this->Pen->GetColor()); |
| 315 | } |
| 316 | |
| 317 | this->BuildVBO(cbo, verts, n, colors, nc, nullptr); |
| 318 | this->SetMatrices(cbo->Program); |
| 319 | |
| 320 | auto timer = this->RenderWindow->GetRenderTimer(); |
| 321 | VTK_SCOPED_RENDER_EVENT(this->GetClassNameInternal() |
| 322 | << "::" << __func__ << "|glDrawArrays(cacheIdentifier: " |
| 323 | << "null" |
| 324 | << ",mode:GL_LINE_STRIP,n:" << n, |
| 325 | timer); |
| 326 | glDrawArrays(GL_LINE_STRIP, 0, n); |
| 327 |
nothing calls this directly
no test coverage detected