/*@}*/
- /**
- * \name Vertex array functions
- *
- * Called by the corresponding OpenGL functions.
- */
- /*@{*/
- void (*VertexPointer)(GLcontext *ctx, GLint size, GLenum type,
- GLsizei stride, const GLvoid *ptr);
- void (*NormalPointer)(GLcontext *ctx, GLenum type,
- GLsizei stride, const GLvoid *ptr);
- void (*ColorPointer)(GLcontext *ctx, GLint size, GLenum type,
- GLsizei stride, const GLvoid *ptr);
- void (*FogCoordPointer)(GLcontext *ctx, GLenum type,
- GLsizei stride, const GLvoid *ptr);
- void (*IndexPointer)(GLcontext *ctx, GLenum type,
- GLsizei stride, const GLvoid *ptr);
- void (*SecondaryColorPointer)(GLcontext *ctx, GLint size, GLenum type,
- GLsizei stride, const GLvoid *ptr);
- void (*TexCoordPointer)(GLcontext *ctx, GLint size, GLenum type,
- GLsizei stride, const GLvoid *ptr);
- void (*EdgeFlagPointer)(GLcontext *ctx, GLsizei stride, const GLvoid *ptr);
- void (*VertexAttribPointer)(GLcontext *ctx, GLuint index, GLint size,
- GLenum type, GLsizei stride, const GLvoid *ptr);
- void (*LockArraysEXT)( GLcontext *ctx, GLint first, GLsizei count );
- void (*UnlockArraysEXT)( GLcontext *ctx );
- /*@}*/
-
-
/**
* \name State-query functions
*
* \param stride stride between elements, in elements
* \param normalized are integer types converted to floats in [-1, 1]?
* \param ptr the address (or offset inside VBO) of the array data
- * \return GL_TRUE if no error, GL_FALSE if error
*/
-static GLboolean
+static void
update_array(GLcontext *ctx, struct gl_client_array *array,
GLbitfield dirtyBit, GLsizei elementSize,
GLint size, GLenum type, GLenum format,
*/
_mesa_error(ctx, GL_INVALID_OPERATION,
"glVertex/Normal/EtcPointer(non-VBO array)");
- return GL_FALSE;
+ return;
}
array->Size = size;
ctx->NewState |= _NEW_ARRAY;
ctx->Array.NewState |= dirtyBit;
-
- return GL_TRUE;
}
return;
}
- if (!update_array(ctx, &ctx->Array.ArrayObj->Vertex, _NEW_ARRAY_VERTEX,
- elementSize, size, type, GL_RGBA, stride, GL_FALSE, ptr))
- return;
-
- if (ctx->Driver.VertexPointer)
- ctx->Driver.VertexPointer( ctx, size, type, stride, ptr );
+ update_array(ctx, &ctx->Array.ArrayObj->Vertex, _NEW_ARRAY_VERTEX,
+ elementSize, size, type, GL_RGBA, stride, GL_FALSE, ptr);
}
return;
}
- if (!update_array(ctx, &ctx->Array.ArrayObj->Normal, _NEW_ARRAY_NORMAL,
- elementSize, 3, type, GL_RGBA, stride, GL_TRUE, ptr))
- return;
-
- if (ctx->Driver.NormalPointer)
- ctx->Driver.NormalPointer( ctx, type, stride, ptr );
+ update_array(ctx, &ctx->Array.ArrayObj->Normal, _NEW_ARRAY_NORMAL,
+ elementSize, 3, type, GL_RGBA, stride, GL_TRUE, ptr);
}
return;
}
- if (!update_array(ctx, &ctx->Array.ArrayObj->Color, _NEW_ARRAY_COLOR0,
- elementSize, size, type, format, stride, GL_TRUE, ptr))
- return;
-
- if (ctx->Driver.ColorPointer)
- ctx->Driver.ColorPointer( ctx, size, type, stride, ptr );
+ update_array(ctx, &ctx->Array.ArrayObj->Color, _NEW_ARRAY_COLOR0,
+ elementSize, size, type, format, stride, GL_TRUE, ptr);
}
return;
}
- if (!update_array(ctx, &ctx->Array.ArrayObj->FogCoord, _NEW_ARRAY_FOGCOORD,
- elementSize, 1, type, GL_RGBA, stride, GL_FALSE, ptr))
- return;
-
- if (ctx->Driver.FogCoordPointer)
- ctx->Driver.FogCoordPointer( ctx, type, stride, ptr );
+ update_array(ctx, &ctx->Array.ArrayObj->FogCoord, _NEW_ARRAY_FOGCOORD,
+ elementSize, 1, type, GL_RGBA, stride, GL_FALSE, ptr);
}
return;
}
- if (!update_array(ctx, &ctx->Array.ArrayObj->Index, _NEW_ARRAY_INDEX,
- elementSize, 1, type, GL_RGBA, stride, GL_FALSE, ptr))
- return;
-
- if (ctx->Driver.IndexPointer)
- ctx->Driver.IndexPointer( ctx, type, stride, ptr );
+ update_array(ctx, &ctx->Array.ArrayObj->Index, _NEW_ARRAY_INDEX,
+ elementSize, 1, type, GL_RGBA, stride, GL_FALSE, ptr);
}
return;
}
- if (!update_array(ctx, &ctx->Array.ArrayObj->SecondaryColor,
- _NEW_ARRAY_COLOR1, elementSize, size, type,
- format, stride, GL_TRUE, ptr))
- return;
-
- if (ctx->Driver.SecondaryColorPointer)
- ctx->Driver.SecondaryColorPointer( ctx, size, type, stride, ptr );
+ update_array(ctx, &ctx->Array.ArrayObj->SecondaryColor, _NEW_ARRAY_COLOR1,
+ elementSize, size, type, format, stride, GL_TRUE, ptr);
}
return;
}
- if (!update_array(ctx, &ctx->Array.ArrayObj->TexCoord[unit],
- _NEW_ARRAY_TEXCOORD(unit),
- elementSize, size, type, GL_RGBA, stride, GL_FALSE, ptr))
- return;
-
- if (ctx->Driver.TexCoordPointer)
- ctx->Driver.TexCoordPointer( ctx, size, type, stride, ptr );
+ update_array(ctx, &ctx->Array.ArrayObj->TexCoord[unit],
+ _NEW_ARRAY_TEXCOORD(unit),
+ elementSize, size, type, GL_RGBA, stride, GL_FALSE, ptr);
}
return;
}
- if (!update_array(ctx, &ctx->Array.ArrayObj->EdgeFlag, _NEW_ARRAY_EDGEFLAG,
- sizeof(GLboolean), 1, GL_UNSIGNED_BYTE, GL_RGBA,
- stride, GL_FALSE, ptr))
- return;
-
- if (ctx->Driver.EdgeFlagPointer)
- ctx->Driver.EdgeFlagPointer( ctx, stride, ptr );
+ update_array(ctx, &ctx->Array.ArrayObj->EdgeFlag, _NEW_ARRAY_EDGEFLAG,
+ sizeof(GLboolean), 1, GL_UNSIGNED_BYTE, GL_RGBA,
+ stride, GL_FALSE, ptr);
}
return;
}
- if (!update_array(ctx, &ctx->Array.ArrayObj->VertexAttrib[index],
- _NEW_ARRAY_ATTRIB(index),
- elementSize, size, type, format, stride, normalized, ptr))
- return;
-
- if (ctx->Driver.VertexAttribPointer)
- ctx->Driver.VertexAttribPointer( ctx, index, size, type, stride, ptr );
+ update_array(ctx, &ctx->Array.ArrayObj->VertexAttrib[index],
+ _NEW_ARRAY_ATTRIB(index),
+ elementSize, size, type, format, stride, normalized, ptr);
}
#endif
return;
}
- if (!update_array(ctx, &ctx->Array.ArrayObj->VertexAttrib[index],
- _NEW_ARRAY_ATTRIB(index),
- elementSize, size, type, format, stride, normalized, ptr))
- return;
-
- if (ctx->Driver.VertexAttribPointer)
- ctx->Driver.VertexAttribPointer(ctx, index, size, type, stride, ptr);
+ update_array(ctx, &ctx->Array.ArrayObj->VertexAttrib[index],
+ _NEW_ARRAY_ATTRIB(index),
+ elementSize, size, type, format, stride, normalized, ptr);
}
#endif
ctx->NewState |= _NEW_ARRAY;
ctx->Array.NewState |= _NEW_ARRAY_ALL;
-
- if (ctx->Driver.LockArraysEXT)
- ctx->Driver.LockArraysEXT( ctx, first, count );
}
ctx->Array.LockCount = 0;
ctx->NewState |= _NEW_ARRAY;
ctx->Array.NewState |= _NEW_ARRAY_ALL;
-
- if (ctx->Driver.UnlockArraysEXT)
- ctx->Driver.UnlockArraysEXT( ctx );
}