Brian Paul | 05a4b37 | 2002-10-29 20:28:36 +0000 | [diff] [blame^] | 1 | /* $Id: acache.h,v 1.4 2002/10/29 20:28:58 brianp Exp $ */ |
Gareth Hughes | 22144ab | 2001-03-12 00:48:37 +0000 | [diff] [blame] | 2 | |
Keith Whitwell | 770169f | 2000-12-26 15:14:04 +0000 | [diff] [blame] | 3 | /* |
| 4 | * Mesa 3-D graphics library |
Brian Paul | b775272 | 2002-04-21 18:49:18 +0000 | [diff] [blame] | 5 | * Version: 4.1 |
Keith Whitwell | 770169f | 2000-12-26 15:14:04 +0000 | [diff] [blame] | 6 | * |
Brian Paul | b775272 | 2002-04-21 18:49:18 +0000 | [diff] [blame] | 7 | * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. |
Keith Whitwell | 770169f | 2000-12-26 15:14:04 +0000 | [diff] [blame] | 8 | * |
| 9 | * Permission is hereby granted, free of charge, to any person obtaining a |
| 10 | * copy of this software and associated documentation files (the "Software"), |
| 11 | * to deal in the Software without restriction, including without limitation |
| 12 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 13 | * and/or sell copies of the Software, and to permit persons to whom the |
| 14 | * Software is furnished to do so, subject to the following conditions: |
| 15 | * |
| 16 | * The above copyright notice and this permission notice shall be included |
| 17 | * in all copies or substantial portions of the Software. |
| 18 | * |
| 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
| 20 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 22 | * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN |
| 23 | * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 24 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 25 | * |
| 26 | * Authors: |
Brian Paul | 05a4b37 | 2002-10-29 20:28:36 +0000 | [diff] [blame^] | 27 | * Keith Whitwell <keith@tungstengraphics.com> |
Keith Whitwell | 770169f | 2000-12-26 15:14:04 +0000 | [diff] [blame] | 28 | */ |
| 29 | |
| 30 | #ifndef _ARRAYCACHE_H |
| 31 | #define _ARRAYCACHE_H |
| 32 | |
| 33 | #include "mtypes.h" |
| 34 | |
| 35 | |
| 36 | extern GLboolean |
| 37 | _ac_CreateContext( GLcontext *ctx ); |
| 38 | |
| 39 | extern void |
| 40 | _ac_DestroyContext( GLcontext *ctx ); |
| 41 | |
| 42 | extern void |
| 43 | _ac_InvalidateState( GLcontext *ctx, GLuint new_state ); |
| 44 | |
| 45 | extern struct gl_client_array * |
Gareth Hughes | 22144ab | 2001-03-12 00:48:37 +0000 | [diff] [blame] | 46 | _ac_import_vertex( GLcontext *ctx, |
Keith Whitwell | 770169f | 2000-12-26 15:14:04 +0000 | [diff] [blame] | 47 | GLenum type, |
Gareth Hughes | 22144ab | 2001-03-12 00:48:37 +0000 | [diff] [blame] | 48 | GLuint reqstride, |
Keith Whitwell | 770169f | 2000-12-26 15:14:04 +0000 | [diff] [blame] | 49 | GLuint reqsize, |
| 50 | GLboolean reqwritable, |
| 51 | GLboolean *writable ); |
| 52 | |
| 53 | extern struct gl_client_array * |
Gareth Hughes | 22144ab | 2001-03-12 00:48:37 +0000 | [diff] [blame] | 54 | _ac_import_normal( GLcontext *ctx, |
Keith Whitwell | 770169f | 2000-12-26 15:14:04 +0000 | [diff] [blame] | 55 | GLenum type, |
Gareth Hughes | 22144ab | 2001-03-12 00:48:37 +0000 | [diff] [blame] | 56 | GLuint reqstride, |
Keith Whitwell | 770169f | 2000-12-26 15:14:04 +0000 | [diff] [blame] | 57 | GLboolean reqwritable, |
| 58 | GLboolean *writable ); |
| 59 | |
| 60 | extern struct gl_client_array * |
Gareth Hughes | 22144ab | 2001-03-12 00:48:37 +0000 | [diff] [blame] | 61 | _ac_import_color( GLcontext *ctx, |
Keith Whitwell | 770169f | 2000-12-26 15:14:04 +0000 | [diff] [blame] | 62 | GLenum type, |
Gareth Hughes | 22144ab | 2001-03-12 00:48:37 +0000 | [diff] [blame] | 63 | GLuint reqstride, |
Keith Whitwell | 770169f | 2000-12-26 15:14:04 +0000 | [diff] [blame] | 64 | GLuint reqsize, |
| 65 | GLboolean reqwritable, |
| 66 | GLboolean *writable ); |
| 67 | |
| 68 | extern struct gl_client_array * |
Gareth Hughes | 22144ab | 2001-03-12 00:48:37 +0000 | [diff] [blame] | 69 | _ac_import_index( GLcontext *ctx, |
Keith Whitwell | 770169f | 2000-12-26 15:14:04 +0000 | [diff] [blame] | 70 | GLenum type, |
Gareth Hughes | 22144ab | 2001-03-12 00:48:37 +0000 | [diff] [blame] | 71 | GLuint reqstride, |
Keith Whitwell | 770169f | 2000-12-26 15:14:04 +0000 | [diff] [blame] | 72 | GLboolean reqwritable, |
| 73 | GLboolean *writable ); |
| 74 | |
| 75 | extern struct gl_client_array * |
Gareth Hughes | 22144ab | 2001-03-12 00:48:37 +0000 | [diff] [blame] | 76 | _ac_import_secondarycolor( GLcontext *ctx, |
Keith Whitwell | 770169f | 2000-12-26 15:14:04 +0000 | [diff] [blame] | 77 | GLenum type, |
Gareth Hughes | 22144ab | 2001-03-12 00:48:37 +0000 | [diff] [blame] | 78 | GLuint reqstride, |
Keith Whitwell | 770169f | 2000-12-26 15:14:04 +0000 | [diff] [blame] | 79 | GLuint reqsize, |
| 80 | GLboolean reqwritable, |
| 81 | GLboolean *writable ); |
| 82 | |
| 83 | extern struct gl_client_array * |
Gareth Hughes | 22144ab | 2001-03-12 00:48:37 +0000 | [diff] [blame] | 84 | _ac_import_fogcoord( GLcontext *ctx, |
Keith Whitwell | 770169f | 2000-12-26 15:14:04 +0000 | [diff] [blame] | 85 | GLenum type, |
Gareth Hughes | 22144ab | 2001-03-12 00:48:37 +0000 | [diff] [blame] | 86 | GLuint reqstride, |
Keith Whitwell | 770169f | 2000-12-26 15:14:04 +0000 | [diff] [blame] | 87 | GLboolean reqwritable, |
| 88 | GLboolean *writable ); |
| 89 | |
| 90 | extern struct gl_client_array * |
Gareth Hughes | 22144ab | 2001-03-12 00:48:37 +0000 | [diff] [blame] | 91 | _ac_import_edgeflag( GLcontext *ctx, |
Keith Whitwell | 770169f | 2000-12-26 15:14:04 +0000 | [diff] [blame] | 92 | GLenum type, |
Gareth Hughes | 22144ab | 2001-03-12 00:48:37 +0000 | [diff] [blame] | 93 | GLuint reqstride, |
Keith Whitwell | 770169f | 2000-12-26 15:14:04 +0000 | [diff] [blame] | 94 | GLboolean reqwritable, |
| 95 | GLboolean *writable ); |
| 96 | |
Brian Paul | b775272 | 2002-04-21 18:49:18 +0000 | [diff] [blame] | 97 | extern struct gl_client_array * |
| 98 | _ac_import_texcoord( GLcontext *ctx, |
| 99 | GLuint unit, |
| 100 | GLenum type, |
| 101 | GLuint reqstride, |
| 102 | GLuint reqsize, |
| 103 | GLboolean reqwritable, |
| 104 | GLboolean *writable ); |
| 105 | |
| 106 | extern struct gl_client_array * |
| 107 | _ac_import_attrib( GLcontext *ctx, |
| 108 | GLuint index, |
| 109 | GLenum type, |
| 110 | GLuint reqstride, |
| 111 | GLuint reqsize, |
| 112 | GLboolean reqwritable, |
| 113 | GLboolean *writable ); |
| 114 | |
Keith Whitwell | 770169f | 2000-12-26 15:14:04 +0000 | [diff] [blame] | 115 | |
| 116 | /* Clients must call this function to validate state and set bounds |
Gareth Hughes | 22144ab | 2001-03-12 00:48:37 +0000 | [diff] [blame] | 117 | * before importing any data: |
Keith Whitwell | 770169f | 2000-12-26 15:14:04 +0000 | [diff] [blame] | 118 | */ |
Gareth Hughes | 22144ab | 2001-03-12 00:48:37 +0000 | [diff] [blame] | 119 | extern void |
Keith Whitwell | 770169f | 2000-12-26 15:14:04 +0000 | [diff] [blame] | 120 | _ac_import_range( GLcontext *ctx, GLuint start, GLuint count ); |
| 121 | |
| 122 | |
| 123 | /* Additional convenience function: |
| 124 | */ |
| 125 | extern CONST void * |
| 126 | _ac_import_elements( GLcontext *ctx, |
| 127 | GLenum new_type, |
| 128 | GLuint count, |
| 129 | GLenum old_type, |
| 130 | CONST void *indices ); |
| 131 | |
| 132 | |
| 133 | #endif |