2 * Mesa 3-D graphics library
4 * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
5 * (C) Copyright IBM Corporation 2006
6 * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
8 * Permission is hereby granted, free of charge, to any person obtaining a
9 * copy of this software and associated documentation files (the "Software"),
10 * to deal in the Software without restriction, including without limitation
11 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12 * and/or sell copies of the Software, and to permit persons to whom the
13 * Software is furnished to do so, subject to the following conditions:
15 * The above copyright notice and this permission notice shall be included
16 * in all copies or substantial portions of the Software.
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
22 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
23 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24 * OTHER DEALINGS IN THE SOFTWARE.
32 #include "glformats.h"
38 * Functions for the GL_APPLE_vertex_array_object extension.
40 * \author Ian Romanick <idr@us.ibm.com>
48 extern struct gl_vertex_array_object
*
49 _mesa_lookup_vao(struct gl_context
*ctx
, GLuint id
);
51 extern struct gl_vertex_array_object
*
52 _mesa_new_vao(struct gl_context
*ctx
, GLuint name
);
55 _mesa_delete_vao(struct gl_context
*ctx
, struct gl_vertex_array_object
*obj
);
58 _mesa_reference_vao_(struct gl_context
*ctx
,
59 struct gl_vertex_array_object
**ptr
,
60 struct gl_vertex_array_object
*vao
);
63 _mesa_reference_vao(struct gl_context
*ctx
,
64 struct gl_vertex_array_object
**ptr
,
65 struct gl_vertex_array_object
*vao
)
68 _mesa_reference_vao_(ctx
, ptr
, vao
);
73 _mesa_initialize_vao(struct gl_context
*ctx
,
74 struct gl_vertex_array_object
*obj
, GLuint name
);
78 _mesa_update_vao_max_element(struct gl_context
*ctx
,
79 struct gl_vertex_array_object
*vao
);
82 _mesa_update_vao_client_arrays(struct gl_context
*ctx
,
83 struct gl_vertex_array_object
*vao
);
86 /** Returns the bitmask of all enabled arrays in fixed function mode.
88 * In fixed function mode only the traditional fixed function arrays
91 static inline GLbitfield64
92 _mesa_array_object_get_enabled_ff(const struct gl_vertex_array_object
*vao
)
94 return vao
->_Enabled
& VERT_BIT_FF_ALL
;
97 /** Returns the bitmask of all enabled arrays in arb/glsl shader mode.
99 * In arb/glsl shader mode all the fixed function and the arb/glsl generic
100 * arrays are available. Only the first generic array takes
101 * precedence over the legacy position array.
103 static inline GLbitfield64
104 _mesa_array_object_get_enabled_arb(const struct gl_vertex_array_object
*vao
)
106 GLbitfield64 enabled
= vao
->_Enabled
;
107 return enabled
& ~(VERT_BIT_POS
& (enabled
>> VERT_ATTRIB_GENERIC0
));
116 void GLAPIENTRY
_mesa_BindVertexArray( GLuint id
);
118 void GLAPIENTRY
_mesa_BindVertexArrayAPPLE( GLuint id
);
120 void GLAPIENTRY
_mesa_DeleteVertexArrays(GLsizei n
, const GLuint
*ids
);
122 void GLAPIENTRY
_mesa_GenVertexArrays(GLsizei n
, GLuint
*arrays
);
124 void GLAPIENTRY
_mesa_GenVertexArraysAPPLE(GLsizei n
, GLuint
*buffer
);
126 GLboolean GLAPIENTRY
_mesa_IsVertexArray( GLuint id
);
128 #endif /* ARRAYOBJ_H */