2 * Mesa 3-D graphics library
5 * Copyright (C) 2010 VMware, Inc. All Rights Reserved.
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
24 * DEALINGS IN THE SOFTWARE.
37 _mesa_PrimitiveRestart(void)
39 GET_CURRENT_CONTEXT(ctx
);
41 if (ctx
->VersionMajor
* 10 + ctx
->VersionMinor
< 31) {
42 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glPrimitiveRestart()");
46 /* XXX call into vbo module */
54 _mesa_PrimitiveRestartIndex(GLuint index
)
56 GET_CURRENT_CONTEXT(ctx
);
58 if (ctx
->VersionMajor
* 10 + ctx
->VersionMinor
< 31) {
59 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glPrimitiveRestartIndex()");
63 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx
);
65 FLUSH_VERTICES(ctx
, _NEW_TRANSFORM
);
67 ctx
->Array
.RestartIndex
= index
;