ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+ if (ctx->Array.ElementArrayBufferObj->Name) {
+ /* use indices in the buffer object */
+ ASSERT(ctx->Array.ElementArrayBufferObj->Data);
+ indices = (const GLvoid **) ctx->Array.ElementArrayBufferObj->Data;
+ }
+
for (i = 0; i < primcount; i++) {
if (count[i] > 0) {
(ctx->Exec->DrawElements)(mode, count[i], type, indices[i]);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+ /* XXX not sure about ARB_vertex_buffer_object handling here */
+
for ( i = 0 ; i < primcount ; i++ ) {
if ( count[i] > 0 ) {
(ctx->Exec->DrawElements)( *(GLenum *) ((char *) mode + (i * modestride)),
{
if (_tnl_hard_begin(ctx, mode)) {
GLint i;
- for (i = 0 ; i < count ; i++)
- glArrayElement( indices[i] );
+ if (ctx->Array.ElementArrayBufferObj->Name) {
+ /* use indices in the buffer object */
+ ASSERT(ctx->Array.ElementArrayBufferObj->Data);
+ indices = (const GLuint *) ctx->Array.ElementArrayBufferObj->Data;
+ }
+ for (i = 0 ; i < count ; i++) {
+ glArrayElement( indices[i] );
+ }
glEnd();
}
}
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(NULL, "_tnl_DrawRangeElements %d %d %d\n", start, end, count);
+ if (ctx->Array.ElementArrayBufferObj->Name) {
+ /* use indices in the buffer object */
+ ASSERT(ctx->Array.ElementArrayBufferObj->Data);
+ indices = (GLuint *) ctx->Array.ElementArrayBufferObj->Data;
+ }
+
/* Check arguments, etc.
*/
if (!_mesa_validate_DrawRangeElements( ctx, mode, start, end, count,
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(NULL, "_tnl_DrawElements %d\n", count);
+ if (ctx->Array.ElementArrayBufferObj->Name) {
+ /* use indices in the buffer object */
+ ASSERT(ctx->Array.ElementArrayBufferObj->Data);
+ indices = (const GLvoid *) ctx->Array.ElementArrayBufferObj->Data;
+ }
+
/* Check arguments, etc.
*/
if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices ))
writeable,
&is_writeable);
+#if 0
+ /* guess we really don't need to add pointers here - BP */
data = ADD_POINTERS(tmp->Ptr, tmp->BufferObj->Data);
+#else
+ data = tmp->Ptr;
+#endif
inputs->Obj.data = (GLfloat (*)[4]) data;
inputs->Obj.start = (GLfloat *) data;
inputs->Obj.stride = tmp->StrideB;
stride ? 3*sizeof(GLfloat) : 0, writeable,
&is_writeable);
+#if 0
data = ADD_POINTERS(tmp->Ptr, tmp->BufferObj->Data);
+#else
+ data = tmp->Ptr;
+#endif
inputs->Normal.data = (GLfloat (*)[4]) data;
inputs->Normal.start = (GLfloat *) data;
inputs->Normal.stride = tmp->StrideB;
stride ? sizeof(GLfloat) : 0, writeable,
&is_writeable);
+#if 0
data = ADD_POINTERS(tmp->Ptr, tmp->BufferObj->Data);
+#else
+ data = tmp->Ptr;
+#endif
inputs->FogCoord.data = (GLfloat (*)[4]) data;
inputs->FogCoord.start = (GLfloat *) data;
inputs->FogCoord.stride = tmp->StrideB;
stride ? sizeof(GLuint) : 0, writeable,
&is_writeable);
+#if 0
data = ADD_POINTERS(tmp->Ptr, tmp->BufferObj->Data);
+#else
+ data = tmp->Ptr;
+#endif
inputs->Index.data = (GLuint *) data;
inputs->Index.start = (GLuint *) data;
inputs->Index.stride = tmp->StrideB;
writeable,
&is_writeable);
+#if 0
data = ADD_POINTERS(tmp->Ptr, tmp->BufferObj->Data);
+#else
+ data = tmp->Ptr;
+#endif
inputs->TexCoord[unit].data = (GLfloat (*)[4]) data;
inputs->TexCoord[unit].start = (GLfloat *) data;
inputs->TexCoord[unit].stride = tmp->StrideB;
0,
&is_writeable);
+#if 0
data = ADD_POINTERS(tmp->Ptr, tmp->BufferObj->Data);
+#else
+ data = tmp->Ptr;
+#endif
inputs->EdgeFlag.data = (GLubyte *) data;
inputs->EdgeFlag.start = (GLubyte *) data;
inputs->EdgeFlag.stride = tmp->StrideB;
writeable,
&is_writeable);
+#if 0
data = ADD_POINTERS(tmp->Ptr, tmp->BufferObj->Data);
+#else
+ data = tmp->Ptr;
+#endif
inputs->Attribs[index].data = (GLfloat (*)[4]) data;
inputs->Attribs[index].start = (GLfloat *) data;
inputs->Attribs[index].stride = tmp->StrideB;