Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

  1. /*
  2.  * Mesa 3-D graphics library
  3.  *
  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.
  7.  *
  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:
  14.  *
  15.  * The above copyright notice and this permission notice shall be included
  16.  * in all copies or substantial portions of the Software.
  17.  *
  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.
  25.  */
  26.  
  27. #ifndef ARRAYOBJ_H
  28. #define ARRAYOBJ_H
  29.  
  30. #include "glheader.h"
  31. #include "mtypes.h"
  32. #include "glformats.h"
  33.  
  34. struct gl_context;
  35.  
  36. /**
  37.  * \file arrayobj.h
  38.  * Functions for the GL_APPLE_vertex_array_object extension.
  39.  *
  40.  * \author Ian Romanick <idr@us.ibm.com>
  41.  * \author Brian Paul
  42.  */
  43.  
  44. /*
  45.  * Internal functions
  46.  */
  47.  
  48. extern struct gl_array_object *
  49. _mesa_new_array_object( struct gl_context *ctx, GLuint name );
  50.  
  51. extern void
  52. _mesa_delete_array_object( struct gl_context *ctx, struct gl_array_object *obj );
  53.  
  54. extern void
  55. _mesa_reference_array_object_(struct gl_context *ctx,
  56.                               struct gl_array_object **ptr,
  57.                               struct gl_array_object *arrayObj);
  58.  
  59. static inline void
  60. _mesa_reference_array_object(struct gl_context *ctx,
  61.                              struct gl_array_object **ptr,
  62.                              struct gl_array_object *arrayObj)
  63. {
  64.    if (*ptr != arrayObj)
  65.       _mesa_reference_array_object_(ctx, ptr, arrayObj);
  66. }
  67.  
  68.  
  69. extern void
  70. _mesa_initialize_array_object( struct gl_context *ctx,
  71.                                struct gl_array_object *obj, GLuint name );
  72.  
  73.  
  74. extern void
  75. _mesa_update_array_object_max_element(struct gl_context *ctx,
  76.                                       struct gl_array_object *arrayObj);
  77.  
  78. /** Returns the bitmask of all enabled arrays in fixed function mode.
  79.  *
  80.  *  In fixed function mode only the traditional fixed function arrays
  81.  *  are available.
  82.  */
  83. static inline GLbitfield64
  84. _mesa_array_object_get_enabled_ff(const struct gl_array_object *arrayObj)
  85. {
  86.    return arrayObj->_Enabled & VERT_BIT_FF_ALL;
  87. }
  88.  
  89. /** Returns the bitmask of all enabled arrays in arb/glsl shader mode.
  90.  *
  91.  *  In arb/glsl shader mode all the fixed function and the arb/glsl generic
  92.  *  arrays are available. Only the first generic array takes
  93.  *  precedence over the legacy position array.
  94.  */
  95. static inline GLbitfield64
  96. _mesa_array_object_get_enabled_arb(const struct gl_array_object *arrayObj)
  97. {
  98.    GLbitfield64 enabled = arrayObj->_Enabled;
  99.    return enabled & ~(VERT_BIT_POS & (enabled >> VERT_ATTRIB_GENERIC0));
  100. }
  101.  
  102.  
  103. /*
  104.  * API functions
  105.  */
  106.  
  107.  
  108. void GLAPIENTRY _mesa_BindVertexArray( GLuint id );
  109.  
  110. void GLAPIENTRY _mesa_BindVertexArrayAPPLE( GLuint id );
  111.  
  112. void GLAPIENTRY _mesa_DeleteVertexArrays(GLsizei n, const GLuint *ids);
  113.  
  114. void GLAPIENTRY _mesa_GenVertexArrays(GLsizei n, GLuint *arrays);
  115.  
  116. void GLAPIENTRY _mesa_GenVertexArraysAPPLE(GLsizei n, GLuint *buffer);
  117.  
  118. GLboolean GLAPIENTRY _mesa_IsVertexArray( GLuint id );
  119.  
  120. #endif /* ARRAYOBJ_H */
  121.