GLuint first;
GLint i;
- if (n < 0) {
- _mesa_error(ctx, GL_INVALID_VALUE, "%s(n < 0)", func);
- return;
- }
-
- if (!arrays) {
+ if (!arrays)
return;
- }
first = _mesa_HashFindFreeKeyBlock(ctx->Array.Objects, n);
}
+static void
+gen_vertex_arrays_err(struct gl_context *ctx, GLsizei n, GLuint *arrays,
+ bool create, const char *func)
+{
+ if (n < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE, "%s(n < 0)", func);
+ return;
+ }
+
+ gen_vertex_arrays(ctx, n, arrays, create, func);
+}
+
+
/**
* ARB version of glGenVertexArrays()
* All arrays will be required to live in VBOs.
_mesa_GenVertexArrays(GLsizei n, GLuint *arrays)
{
GET_CURRENT_CONTEXT(ctx);
- gen_vertex_arrays(ctx, n, arrays, false, "glGenVertexArrays");
+ gen_vertex_arrays_err(ctx, n, arrays, false, "glGenVertexArrays");
}
_mesa_CreateVertexArrays(GLsizei n, GLuint *arrays)
{
GET_CURRENT_CONTEXT(ctx);
- gen_vertex_arrays(ctx, n, arrays, true, "glCreateVertexArrays");
+ gen_vertex_arrays_err(ctx, n, arrays, true, "glCreateVertexArrays");
}