| |   |
| 170 | 170 | QGLCube cube; |
| 171 | 171 | QGLDisplayList list; |
| 172 | 172 | list.newSection(QGL::Faceted); |
| QGLSceneNode *node = list.currentNode(); |
| 173 | 174 | list << cube; |
| 174 | 175 | list.finalize(); |
| QGLVertexArray ary = list.geometry()->toVertexArray(); |
| QGLVertexArray ary = node->geometry()->toVertexArray(); |
| 176 | 177 | QGLVertexDescription desc = ary.fields(); |
| 177 | 178 | int verts = desc.indexOf(QGL::Position); |
| 178 | 179 | int texx = desc.indexOf(QGL::TextureCoord0); |
| … | … | |
| 200 | 200 | { |
| 201 | 201 | QGLDisplayList list; |
| 202 | 202 | list.newSection(QGL::Faceted); |
| QGLSceneNode *node = list.currentNode(); |
| 203 | 204 | list << cube; |
| 204 | 205 | list.finalize(); |
| QGLVertexArray ary = list.geometry()->toVertexArray(); |
| QGLVertexArray ary = node->geometry()->toVertexArray(); |
| 206 | 207 | int texx = ary.fields().indexOf(QGL::TextureCoord0); |
| 207 | 208 | for (int i = 0, v = 0; i < QGL_CUBE_SIZE; ++v, i += 8) |
| 208 | 209 | { |
| … | … | |
| 218 | 218 | { |
| 219 | 219 | QGLDisplayList list; |
| 220 | 220 | list.newSection(QGL::Faceted); |
| QGLSceneNode *node = list.currentNode(); |
| 221 | 222 | list << cube; |
| 222 | 223 | list.finalize(); |
| QGLVertexArray ary = list.geometry()->toVertexArray(); |
| QGLVertexArray ary = node->geometry()->toVertexArray(); |
| 224 | 225 | int texx = ary.fields().indexOf(QGL::TextureCoord0); |
| 225 | 226 | for (int i = 0, v = 0; i < QGL_CUBE_SIZE; ++v, i += 8) |
| 226 | 227 | { |
| … | … | |
| 245 | 245 | { |
| 246 | 246 | QGLDisplayList list; |
| 247 | 247 | list.newSection(QGL::Faceted); |
| QGLSceneNode *node = list.currentNode(); |
| 248 | 249 | list << cfL << cfT << cfR << cfBt << cfF << cfBk; |
| 249 | 250 | list.finalize(); |
| QGLVertexArray ary = list.geometry()->toVertexArray(); |
| QGLIndexArray indx = list.geometry()->indices(); |
| QGLVertexArray ary = node->geometry()->toVertexArray(); |
| QGLIndexArray indx = node->geometry()->indices(); |
| 252 | 253 | int texx = ary.fields().indexOf(QGL::TextureCoord0); |
| 253 | 254 | QVector3DArray fm; |
| 254 | 255 | for (int i = 0; i < QGL_CUBE_SIZE; i += 8) |
| … | … | |
| 281 | 281 | { |
| 282 | 282 | QGLDisplayList list; |
| 283 | 283 | list.newSection(QGL::Faceted); |
| QGLSceneNode *node = list.currentNode(); |
| 284 | 285 | list << cubeFace; |
| 285 | 286 | list.finalize(); |
| QGLVertexArray ary = list.geometry()->toVertexArray(); |
| QGLVertexArray ary = node->geometry()->toVertexArray(); |
| 287 | 288 | int texx = ary.fields().indexOf(QGL::TextureCoord0); |
| 288 | 289 | for (int i = begin; i < end; i += 8) |
| 289 | 290 | { |
| … | … | |
| 300 | 300 | { |
| 301 | 301 | QGLDisplayList list; |
| 302 | 302 | list.newSection(QGL::Faceted); |
| QGLSceneNode *node = list.currentNode(); |
| 303 | 304 | list << cubeFace; |
| 304 | 305 | list.finalize(); |
| QGLVertexArray ary = list.geometry()->toVertexArray(); |
| QGLVertexArray ary = node->geometry()->toVertexArray(); |
| 306 | 307 | int texx = ary.fields().indexOf(QGL::TextureCoord0); |
| 307 | 308 | for (int i = begin; i < end; i += 8) |
| 308 | 309 | { |
| … | … | |
| 340 | 340 | int begin = f * 8 * 6; |
| 341 | 341 | QGLDisplayList list; |
| 342 | 342 | list.newSection(QGL::Faceted); |
| QGLSceneNode *node = list.currentNode(); |
| 343 | 344 | list << cfL; |
| 344 | 345 | list.finalize(); |
| QGLVertexArray ary = list.geometry()->toVertexArray(); |
| QGLVertexArray ary = node->geometry()->toVertexArray(); |
| 346 | 347 | int texx = ary.fields().indexOf(QGL::TextureCoord0); |
| 347 | 348 | |
| 348 | 349 | int i = begin; // starts at bottom right |
| … | … | |
| 389 | 389 | int begin = f * 8 * 6; |
| 390 | 390 | QGLDisplayList list; |
| 391 | 391 | list.newSection(QGL::Faceted); |
| QGLSceneNode *node = list.currentNode(); |
| 392 | 393 | list << cfT; |
| 393 | 394 | list.finalize(); |
| QGLVertexArray ary = list.geometry()->toVertexArray(); |
| QGLVertexArray ary = node->geometry()->toVertexArray(); |
| 395 | 396 | int texx = ary.fields().indexOf(QGL::TextureCoord0); |
| 396 | 397 | |
| 397 | 398 | int i = begin; // starts at bottom right |