| 143 | } |
| 144 | |
| 145 | void vtkOpenGLContextDevice3D::BuildVBO(vtkOpenGLHelper* cellBO, const float* f, int nv, |
| 146 | const unsigned char* colors, int nc, float* tcoords) |
| 147 | { |
| 148 | // build up temporary vtkDataArrays without copying the data. |
| 149 | vtkNew<vtkFloatArray> positionsArray; |
| 150 | vtkNew<vtkUnsignedCharArray> colorsArray; |
| 151 | vtkNew<vtkFloatArray> tcoordsArray; |
| 152 | |
| 153 | positionsArray->SetNumberOfComponents(3); |
| 154 | positionsArray->SetNumberOfTuples(nv); |
| 155 | std::copy(f, f + nv * 3, positionsArray->Begin()); |
| 156 | |
| 157 | colorsArray->SetNumberOfComponents(nc); |
| 158 | colorsArray->SetNumberOfTuples(nv); |
| 159 | std::copy(colors, colors + nv * nc, colorsArray->Begin()); |
| 160 | |
| 161 | tcoordsArray->SetNumberOfComponents(2); |
| 162 | tcoordsArray->SetArray(tcoords, nv * 2, 1); // do not take ownership of 'tcoords' |
| 163 | |
| 164 | // use 'anonymous' cache identifier because of raw typed array pointers. |
| 165 | this->Storage->BufferObjectBuilder.BuildVBO( |
| 166 | cellBO, positionsArray, colorsArray, tcoordsArray, /*cacheIdentifier=*/0, this->RenderWindow); |
| 167 | } |
| 168 | |
| 169 | void vtkOpenGLContextDevice3D::ReadyVBOProgram() |
| 170 | { |
no test coverage detected