Gareth Hughes | 22144ab | 2001-03-12 00:48:37 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Mesa 3-D graphics library |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 3 | * Version: 6.3 |
Gareth Hughes | 22144ab | 2001-03-12 00:48:37 +0000 | [diff] [blame] | 4 | * |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 5 | * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. |
Gareth Hughes | 22144ab | 2001-03-12 00:48:37 +0000 | [diff] [blame] | 6 | * |
| 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: |
| 13 | * |
| 14 | * The above copyright notice and this permission notice shall be included |
| 15 | * in all copies or substantial portions of the Software. |
| 16 | * |
| 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
| 18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 20 | * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN |
| 21 | * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 23 | */ |
| 24 | |
Keith Whitwell | fc00cbe | 2001-12-20 15:30:45 +0000 | [diff] [blame] | 25 | /* Author: |
Brian Paul | 05a4b37 | 2002-10-29 20:28:36 +0000 | [diff] [blame] | 26 | * Keith Whitwell <keith@tungstengraphics.com> |
Keith Whitwell | fc00cbe | 2001-12-20 15:30:45 +0000 | [diff] [blame] | 27 | */ |
| 28 | |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 29 | #include "glheader.h" |
Keith Whitwell | 4b7d6f2 | 2001-06-01 22:22:10 +0000 | [diff] [blame] | 30 | #include "api_arrayelt.h" |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 31 | #include "context.h" |
Keith Whitwell | fc00cbe | 2001-12-20 15:30:45 +0000 | [diff] [blame] | 32 | #include "glapi.h" |
Brian Paul | 3c63452 | 2002-10-24 23:57:19 +0000 | [diff] [blame] | 33 | #include "imports.h" |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 34 | #include "macros.h" |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 35 | #include "mtypes.h" |
| 36 | |
Karl Schultz | b72902e | 2004-01-28 22:24:12 +0000 | [diff] [blame] | 37 | typedef void (GLAPIENTRY *array_func)( const void * ); |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 38 | |
| 39 | typedef struct { |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 40 | const struct gl_client_array *array; |
Gareth Hughes | 1fb0a43 | 2001-12-28 06:28:10 +0000 | [diff] [blame] | 41 | array_func func; |
Keith Whitwell | 4b7d6f2 | 2001-06-01 22:22:10 +0000 | [diff] [blame] | 42 | } AEarray; |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 43 | |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 44 | typedef void (GLAPIENTRY *attrib_func)( GLuint indx, const void *data ); |
| 45 | |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 46 | typedef struct { |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 47 | const struct gl_client_array *array; |
| 48 | attrib_func func; |
| 49 | GLuint index; |
| 50 | } AEattrib; |
| 51 | |
| 52 | typedef struct { |
Brian Paul | 53ad036 | 2004-02-09 00:24:48 +0000 | [diff] [blame] | 53 | AEarray arrays[32]; |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 54 | AEattrib attribs[VERT_ATTRIB_MAX + 1]; |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 55 | GLuint NewState; |
Keith Whitwell | 4b7d6f2 | 2001-06-01 22:22:10 +0000 | [diff] [blame] | 56 | } AEcontext; |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 57 | |
Keith Whitwell | 4b7d6f2 | 2001-06-01 22:22:10 +0000 | [diff] [blame] | 58 | #define AE_CONTEXT(ctx) ((AEcontext *)(ctx)->aelt_context) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 59 | |
| 60 | /* |
| 61 | * Convert GL_BYTE, GL_UNSIGNED_BYTE, .. GL_DOUBLE into an integer |
| 62 | * in the range [0, 7]. Luckily these type tokens are sequentially |
Brian Paul | f2f3350 | 2004-04-23 17:58:06 +0000 | [diff] [blame] | 63 | * numbered in gl.h, except for GL_DOUBLE. |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 64 | */ |
Brian Paul | f2f3350 | 2004-04-23 17:58:06 +0000 | [diff] [blame] | 65 | #define TYPE_IDX(t) ( (t) == GL_DOUBLE ? 7 : (t) & 7 ) |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 66 | |
Adam Jackson | 94987be | 2004-10-24 02:05:40 +0000 | [diff] [blame] | 67 | static void GLAPIENTRY Color3bv(const GLbyte *v) |
| 68 | { |
| 69 | GL_CALL(Color3bv)(v); |
| 70 | } |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 71 | |
Adam Jackson | 94987be | 2004-10-24 02:05:40 +0000 | [diff] [blame] | 72 | static void GLAPIENTRY Color3ubv(const GLubyte *v) |
| 73 | { |
| 74 | GL_CALL(Color3ubv)(v); |
| 75 | } |
Brian Paul | 53ad036 | 2004-02-09 00:24:48 +0000 | [diff] [blame] | 76 | |
Adam Jackson | 94987be | 2004-10-24 02:05:40 +0000 | [diff] [blame] | 77 | static void GLAPIENTRY Color3sv(const GLshort *v) |
| 78 | { |
| 79 | GL_CALL(Color3sv)(v); |
| 80 | } |
| 81 | |
| 82 | static void GLAPIENTRY Color3usv(const GLushort *v) |
| 83 | { |
| 84 | GL_CALL(Color3usv)(v); |
| 85 | } |
| 86 | |
| 87 | static void GLAPIENTRY Color3iv(const GLint *v) |
| 88 | { |
| 89 | GL_CALL(Color3iv)(v); |
| 90 | } |
| 91 | |
| 92 | static void GLAPIENTRY Color3uiv(const GLuint *v) |
| 93 | { |
| 94 | GL_CALL(Color3uiv)(v); |
| 95 | } |
| 96 | |
| 97 | static void GLAPIENTRY Color3fv(const GLfloat *v) |
| 98 | { |
| 99 | GL_CALL(Color3fv)(v); |
| 100 | } |
| 101 | |
| 102 | static void GLAPIENTRY Color3dv(const GLdouble *v) |
| 103 | { |
| 104 | GL_CALL(Color3dv)(v); |
| 105 | } |
| 106 | |
| 107 | static void GLAPIENTRY Color4bv(const GLbyte *v) |
| 108 | { |
| 109 | GL_CALL(Color4bv)(v); |
| 110 | } |
| 111 | |
| 112 | static void GLAPIENTRY Color4ubv(const GLubyte *v) |
| 113 | { |
| 114 | GL_CALL(Color4ubv)(v); |
| 115 | } |
| 116 | |
| 117 | static void GLAPIENTRY Color4sv(const GLshort *v) |
| 118 | { |
| 119 | GL_CALL(Color4sv)(v); |
| 120 | } |
| 121 | |
| 122 | static void GLAPIENTRY Color4usv(const GLushort *v) |
| 123 | { |
| 124 | GL_CALL(Color4usv)(v); |
| 125 | } |
| 126 | |
| 127 | static void GLAPIENTRY Color4iv(const GLint *v) |
| 128 | { |
| 129 | GL_CALL(Color4iv)(v); |
| 130 | } |
| 131 | |
| 132 | static void GLAPIENTRY Color4uiv(const GLuint *v) |
| 133 | { |
| 134 | GL_CALL(Color4uiv)(v); |
| 135 | } |
| 136 | |
| 137 | static void GLAPIENTRY Color4fv(const GLfloat *v) |
| 138 | { |
| 139 | GL_CALL(Color4fv)(v); |
| 140 | } |
| 141 | |
| 142 | static void GLAPIENTRY Color4dv(const GLdouble *v) |
| 143 | { |
| 144 | GL_CALL(Color4dv)(v); |
| 145 | } |
| 146 | |
| 147 | static const array_func ColorFuncs[2][8] = { |
| 148 | { |
| 149 | (array_func) Color3bv, |
| 150 | (array_func) Color3ubv, |
| 151 | (array_func) Color3sv, |
| 152 | (array_func) Color3usv, |
| 153 | (array_func) Color3iv, |
| 154 | (array_func) Color3uiv, |
| 155 | (array_func) Color3fv, |
| 156 | (array_func) Color3dv, |
| 157 | }, |
| 158 | { |
| 159 | (array_func) Color4bv, |
| 160 | (array_func) Color4ubv, |
| 161 | (array_func) Color4sv, |
| 162 | (array_func) Color4usv, |
| 163 | (array_func) Color4iv, |
| 164 | (array_func) Color4uiv, |
| 165 | (array_func) Color4fv, |
| 166 | (array_func) Color4dv, |
| 167 | }, |
Brian Paul | 53ad036 | 2004-02-09 00:24:48 +0000 | [diff] [blame] | 168 | }; |
| 169 | |
Adam Jackson | 94987be | 2004-10-24 02:05:40 +0000 | [diff] [blame] | 170 | static void GLAPIENTRY Vertex2sv(const GLshort *v) |
| 171 | { |
| 172 | GL_CALL(Vertex2sv)(v); |
| 173 | } |
Brian Paul | 53ad036 | 2004-02-09 00:24:48 +0000 | [diff] [blame] | 174 | |
Adam Jackson | 94987be | 2004-10-24 02:05:40 +0000 | [diff] [blame] | 175 | static void GLAPIENTRY Vertex2iv(const GLint *v) |
| 176 | { |
| 177 | GL_CALL(Vertex2iv)(v); |
| 178 | } |
Brian Paul | 53ad036 | 2004-02-09 00:24:48 +0000 | [diff] [blame] | 179 | |
Adam Jackson | 94987be | 2004-10-24 02:05:40 +0000 | [diff] [blame] | 180 | static void GLAPIENTRY Vertex2fv(const GLfloat *v) |
| 181 | { |
| 182 | GL_CALL(Vertex2fv)(v); |
| 183 | } |
| 184 | |
| 185 | static void GLAPIENTRY Vertex2dv(const GLdouble *v) |
| 186 | { |
| 187 | GL_CALL(Vertex2dv)(v); |
| 188 | } |
| 189 | |
| 190 | static void GLAPIENTRY Vertex3sv(const GLshort *v) |
| 191 | { |
| 192 | GL_CALL(Vertex3sv)(v); |
| 193 | } |
| 194 | |
| 195 | static void GLAPIENTRY Vertex3iv(const GLint *v) |
| 196 | { |
| 197 | GL_CALL(Vertex3iv)(v); |
| 198 | } |
| 199 | |
| 200 | static void GLAPIENTRY Vertex3fv(const GLfloat *v) |
| 201 | { |
| 202 | GL_CALL(Vertex3fv)(v); |
| 203 | } |
| 204 | |
| 205 | static void GLAPIENTRY Vertex3dv(const GLdouble *v) |
| 206 | { |
| 207 | GL_CALL(Vertex3dv)(v); |
| 208 | } |
| 209 | |
| 210 | static void GLAPIENTRY Vertex4sv(const GLshort *v) |
| 211 | { |
| 212 | GL_CALL(Vertex4sv)(v); |
| 213 | } |
| 214 | |
| 215 | static void GLAPIENTRY Vertex4iv(const GLint *v) |
| 216 | { |
| 217 | GL_CALL(Vertex4iv)(v); |
| 218 | } |
| 219 | |
| 220 | static void GLAPIENTRY Vertex4fv(const GLfloat *v) |
| 221 | { |
| 222 | GL_CALL(Vertex4fv)(v); |
| 223 | } |
| 224 | |
| 225 | static void GLAPIENTRY Vertex4dv(const GLdouble *v) |
| 226 | { |
| 227 | GL_CALL(Vertex4dv)(v); |
| 228 | } |
| 229 | |
| 230 | static const array_func VertexFuncs[3][8] = { |
| 231 | { |
Keith Whitwell | a0c8524 | 2005-02-11 09:34:05 +0000 | [diff] [blame] | 232 | NULL, |
| 233 | NULL, |
Adam Jackson | 94987be | 2004-10-24 02:05:40 +0000 | [diff] [blame] | 234 | (array_func) Vertex2sv, |
Keith Whitwell | a0c8524 | 2005-02-11 09:34:05 +0000 | [diff] [blame] | 235 | NULL, |
Adam Jackson | 94987be | 2004-10-24 02:05:40 +0000 | [diff] [blame] | 236 | (array_func) Vertex2iv, |
Keith Whitwell | a0c8524 | 2005-02-11 09:34:05 +0000 | [diff] [blame] | 237 | NULL, |
Adam Jackson | 94987be | 2004-10-24 02:05:40 +0000 | [diff] [blame] | 238 | (array_func) Vertex2fv, |
| 239 | (array_func) Vertex2dv, |
| 240 | }, |
| 241 | { |
Keith Whitwell | a0c8524 | 2005-02-11 09:34:05 +0000 | [diff] [blame] | 242 | NULL, |
| 243 | NULL, |
Adam Jackson | 94987be | 2004-10-24 02:05:40 +0000 | [diff] [blame] | 244 | (array_func) Vertex3sv, |
Keith Whitwell | a0c8524 | 2005-02-11 09:34:05 +0000 | [diff] [blame] | 245 | NULL, |
Adam Jackson | 94987be | 2004-10-24 02:05:40 +0000 | [diff] [blame] | 246 | (array_func) Vertex3iv, |
Keith Whitwell | a0c8524 | 2005-02-11 09:34:05 +0000 | [diff] [blame] | 247 | NULL, |
Adam Jackson | 94987be | 2004-10-24 02:05:40 +0000 | [diff] [blame] | 248 | (array_func) Vertex3fv, |
| 249 | (array_func) Vertex3dv, |
| 250 | }, |
| 251 | { |
Keith Whitwell | a0c8524 | 2005-02-11 09:34:05 +0000 | [diff] [blame] | 252 | NULL, |
| 253 | NULL, |
Adam Jackson | 94987be | 2004-10-24 02:05:40 +0000 | [diff] [blame] | 254 | (array_func) Vertex4sv, |
Keith Whitwell | a0c8524 | 2005-02-11 09:34:05 +0000 | [diff] [blame] | 255 | NULL, |
Adam Jackson | 94987be | 2004-10-24 02:05:40 +0000 | [diff] [blame] | 256 | (array_func) Vertex4iv, |
Keith Whitwell | a0c8524 | 2005-02-11 09:34:05 +0000 | [diff] [blame] | 257 | NULL, |
Adam Jackson | 94987be | 2004-10-24 02:05:40 +0000 | [diff] [blame] | 258 | (array_func) Vertex4fv, |
| 259 | (array_func) Vertex4dv, |
| 260 | }, |
Brian Paul | 53ad036 | 2004-02-09 00:24:48 +0000 | [diff] [blame] | 261 | }; |
| 262 | |
Adam Jackson | 94987be | 2004-10-24 02:05:40 +0000 | [diff] [blame] | 263 | static void GLAPIENTRY Indexubv(const GLubyte *c) |
| 264 | { |
| 265 | GL_CALL(Indexubv)(c); |
| 266 | } |
| 267 | |
| 268 | static void GLAPIENTRY Indexsv(const GLshort *c) |
| 269 | { |
| 270 | GL_CALL(Indexsv)(c); |
| 271 | } |
| 272 | |
| 273 | static void GLAPIENTRY Indexiv(const GLint *c) |
| 274 | { |
| 275 | GL_CALL(Indexiv)(c); |
| 276 | } |
| 277 | |
| 278 | static void GLAPIENTRY Indexfv(const GLfloat *c) |
| 279 | { |
| 280 | GL_CALL(Indexfv)(c); |
| 281 | } |
| 282 | |
| 283 | static void GLAPIENTRY Indexdv(const GLdouble *c) |
| 284 | { |
| 285 | GL_CALL(Indexdv)(c); |
| 286 | } |
| 287 | |
| 288 | static const array_func IndexFuncs[8] = { |
Keith Whitwell | a0c8524 | 2005-02-11 09:34:05 +0000 | [diff] [blame] | 289 | NULL, |
Adam Jackson | 94987be | 2004-10-24 02:05:40 +0000 | [diff] [blame] | 290 | (array_func) Indexubv, |
| 291 | (array_func) Indexsv, |
Keith Whitwell | a0c8524 | 2005-02-11 09:34:05 +0000 | [diff] [blame] | 292 | NULL, |
Adam Jackson | 94987be | 2004-10-24 02:05:40 +0000 | [diff] [blame] | 293 | (array_func) Indexiv, |
Keith Whitwell | a0c8524 | 2005-02-11 09:34:05 +0000 | [diff] [blame] | 294 | NULL, |
Adam Jackson | 94987be | 2004-10-24 02:05:40 +0000 | [diff] [blame] | 295 | (array_func) Indexfv, |
| 296 | (array_func) Indexdv, |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 297 | }; |
| 298 | |
Adam Jackson | 94987be | 2004-10-24 02:05:40 +0000 | [diff] [blame] | 299 | static void GLAPIENTRY Normal3bv(const GLbyte *v) |
| 300 | { |
| 301 | GL_CALL(Normal3bv)(v); |
| 302 | } |
Brian Paul | 53ad036 | 2004-02-09 00:24:48 +0000 | [diff] [blame] | 303 | |
Adam Jackson | 94987be | 2004-10-24 02:05:40 +0000 | [diff] [blame] | 304 | static void GLAPIENTRY Normal3sv(const GLshort *v) |
| 305 | { |
| 306 | GL_CALL(Normal3sv)(v); |
| 307 | } |
| 308 | |
| 309 | static void GLAPIENTRY Normal3iv(const GLint *v) |
| 310 | { |
| 311 | GL_CALL(Normal3iv)(v); |
| 312 | } |
| 313 | |
| 314 | static void GLAPIENTRY Normal3fv(const GLfloat *v) |
| 315 | { |
| 316 | GL_CALL(Normal3fv)(v); |
| 317 | } |
| 318 | |
| 319 | static void GLAPIENTRY Normal3dv(const GLdouble *v) |
| 320 | { |
| 321 | GL_CALL(Normal3dv)(v); |
| 322 | } |
| 323 | |
| 324 | static const array_func NormalFuncs[8] = { |
| 325 | (array_func) Normal3bv, |
Keith Whitwell | a0c8524 | 2005-02-11 09:34:05 +0000 | [diff] [blame] | 326 | NULL, |
Adam Jackson | 94987be | 2004-10-24 02:05:40 +0000 | [diff] [blame] | 327 | (array_func) Normal3sv, |
Keith Whitwell | a0c8524 | 2005-02-11 09:34:05 +0000 | [diff] [blame] | 328 | NULL, |
Adam Jackson | 94987be | 2004-10-24 02:05:40 +0000 | [diff] [blame] | 329 | (array_func) Normal3iv, |
Keith Whitwell | a0c8524 | 2005-02-11 09:34:05 +0000 | [diff] [blame] | 330 | NULL, |
Adam Jackson | 94987be | 2004-10-24 02:05:40 +0000 | [diff] [blame] | 331 | (array_func) Normal3fv, |
| 332 | (array_func) Normal3dv, |
| 333 | }; |
Brian Paul | 53ad036 | 2004-02-09 00:24:48 +0000 | [diff] [blame] | 334 | |
| 335 | /* Wrapper functions in case glSecondaryColor*EXT doesn't exist */ |
Brian Paul | 2615e81 | 2004-02-24 14:47:01 +0000 | [diff] [blame] | 336 | static void GLAPIENTRY SecondaryColor3bvEXT(const GLbyte *c) |
Brian Paul | 53ad036 | 2004-02-09 00:24:48 +0000 | [diff] [blame] | 337 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 338 | GL_CALL(SecondaryColor3bvEXT)(c); |
Brian Paul | 53ad036 | 2004-02-09 00:24:48 +0000 | [diff] [blame] | 339 | } |
| 340 | |
Brian Paul | 2615e81 | 2004-02-24 14:47:01 +0000 | [diff] [blame] | 341 | static void GLAPIENTRY SecondaryColor3ubvEXT(const GLubyte *c) |
Brian Paul | 53ad036 | 2004-02-09 00:24:48 +0000 | [diff] [blame] | 342 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 343 | GL_CALL(SecondaryColor3ubvEXT)(c); |
Brian Paul | 53ad036 | 2004-02-09 00:24:48 +0000 | [diff] [blame] | 344 | } |
| 345 | |
Brian Paul | 2615e81 | 2004-02-24 14:47:01 +0000 | [diff] [blame] | 346 | static void GLAPIENTRY SecondaryColor3svEXT(const GLshort *c) |
Brian Paul | 53ad036 | 2004-02-09 00:24:48 +0000 | [diff] [blame] | 347 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 348 | GL_CALL(SecondaryColor3svEXT)(c); |
Brian Paul | 53ad036 | 2004-02-09 00:24:48 +0000 | [diff] [blame] | 349 | } |
| 350 | |
Brian Paul | 2615e81 | 2004-02-24 14:47:01 +0000 | [diff] [blame] | 351 | static void GLAPIENTRY SecondaryColor3usvEXT(const GLushort *c) |
Brian Paul | 53ad036 | 2004-02-09 00:24:48 +0000 | [diff] [blame] | 352 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 353 | GL_CALL(SecondaryColor3usvEXT)(c); |
Brian Paul | 53ad036 | 2004-02-09 00:24:48 +0000 | [diff] [blame] | 354 | } |
| 355 | |
Brian Paul | 2615e81 | 2004-02-24 14:47:01 +0000 | [diff] [blame] | 356 | static void GLAPIENTRY SecondaryColor3ivEXT(const GLint *c) |
Brian Paul | 53ad036 | 2004-02-09 00:24:48 +0000 | [diff] [blame] | 357 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 358 | GL_CALL(SecondaryColor3ivEXT)(c); |
Brian Paul | 53ad036 | 2004-02-09 00:24:48 +0000 | [diff] [blame] | 359 | } |
| 360 | |
Brian Paul | 2615e81 | 2004-02-24 14:47:01 +0000 | [diff] [blame] | 361 | static void GLAPIENTRY SecondaryColor3uivEXT(const GLuint *c) |
Brian Paul | 53ad036 | 2004-02-09 00:24:48 +0000 | [diff] [blame] | 362 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 363 | GL_CALL(SecondaryColor3uivEXT)(c); |
Brian Paul | 53ad036 | 2004-02-09 00:24:48 +0000 | [diff] [blame] | 364 | } |
| 365 | |
Brian Paul | 2615e81 | 2004-02-24 14:47:01 +0000 | [diff] [blame] | 366 | static void GLAPIENTRY SecondaryColor3fvEXT(const GLfloat *c) |
Brian Paul | 53ad036 | 2004-02-09 00:24:48 +0000 | [diff] [blame] | 367 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 368 | GL_CALL(SecondaryColor3fvEXT)(c); |
Brian Paul | 53ad036 | 2004-02-09 00:24:48 +0000 | [diff] [blame] | 369 | } |
| 370 | |
Brian Paul | 2615e81 | 2004-02-24 14:47:01 +0000 | [diff] [blame] | 371 | static void GLAPIENTRY SecondaryColor3dvEXT(const GLdouble *c) |
Brian Paul | 53ad036 | 2004-02-09 00:24:48 +0000 | [diff] [blame] | 372 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 373 | GL_CALL(SecondaryColor3dvEXT)(c); |
Brian Paul | 53ad036 | 2004-02-09 00:24:48 +0000 | [diff] [blame] | 374 | } |
| 375 | |
Adam Jackson | 94987be | 2004-10-24 02:05:40 +0000 | [diff] [blame] | 376 | static const array_func SecondaryColorFuncs[8] = { |
Brian Paul | 53ad036 | 2004-02-09 00:24:48 +0000 | [diff] [blame] | 377 | (array_func) SecondaryColor3bvEXT, |
| 378 | (array_func) SecondaryColor3ubvEXT, |
| 379 | (array_func) SecondaryColor3svEXT, |
| 380 | (array_func) SecondaryColor3usvEXT, |
| 381 | (array_func) SecondaryColor3ivEXT, |
| 382 | (array_func) SecondaryColor3uivEXT, |
| 383 | (array_func) SecondaryColor3fvEXT, |
| 384 | (array_func) SecondaryColor3dvEXT, |
| 385 | }; |
| 386 | |
| 387 | |
| 388 | /* Again, wrapper functions in case glSecondaryColor*EXT doesn't exist */ |
Brian Paul | 2615e81 | 2004-02-24 14:47:01 +0000 | [diff] [blame] | 389 | static void GLAPIENTRY FogCoordfvEXT(const GLfloat *f) |
Brian Paul | 53ad036 | 2004-02-09 00:24:48 +0000 | [diff] [blame] | 390 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 391 | GL_CALL(FogCoordfvEXT)(f); |
Brian Paul | 53ad036 | 2004-02-09 00:24:48 +0000 | [diff] [blame] | 392 | } |
| 393 | |
Brian Paul | 2615e81 | 2004-02-24 14:47:01 +0000 | [diff] [blame] | 394 | static void GLAPIENTRY FogCoorddvEXT(const GLdouble *f) |
Brian Paul | 53ad036 | 2004-02-09 00:24:48 +0000 | [diff] [blame] | 395 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 396 | GL_CALL(FogCoorddvEXT)(f); |
Brian Paul | 53ad036 | 2004-02-09 00:24:48 +0000 | [diff] [blame] | 397 | } |
| 398 | |
Adam Jackson | 94987be | 2004-10-24 02:05:40 +0000 | [diff] [blame] | 399 | static const array_func FogCoordFuncs[8] = { |
Keith Whitwell | a0c8524 | 2005-02-11 09:34:05 +0000 | [diff] [blame] | 400 | NULL, |
| 401 | NULL, |
| 402 | NULL, |
| 403 | NULL, |
| 404 | NULL, |
| 405 | NULL, |
Brian Paul | 53ad036 | 2004-02-09 00:24:48 +0000 | [diff] [blame] | 406 | (array_func) FogCoordfvEXT, |
| 407 | (array_func) FogCoorddvEXT |
| 408 | }; |
| 409 | |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 410 | /**********************************************************************/ |
| 411 | |
| 412 | /* GL_BYTE attributes */ |
| 413 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 414 | static void GLAPIENTRY VertexAttrib1NbvNV(GLuint index, const GLbyte *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 415 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 416 | GL_CALL(VertexAttrib1fNV)(index, BYTE_TO_FLOAT(v[0])); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 417 | } |
| 418 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 419 | static void GLAPIENTRY VertexAttrib1bvNV(GLuint index, const GLbyte *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 420 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 421 | GL_CALL(VertexAttrib1fNV)(index, v[0]); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 422 | } |
| 423 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 424 | static void GLAPIENTRY VertexAttrib2NbvNV(GLuint index, const GLbyte *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 425 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 426 | GL_CALL(VertexAttrib2fNV)(index, BYTE_TO_FLOAT(v[0]), BYTE_TO_FLOAT(v[1])); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 427 | } |
| 428 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 429 | static void GLAPIENTRY VertexAttrib2bvNV(GLuint index, const GLbyte *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 430 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 431 | GL_CALL(VertexAttrib2fNV)(index, v[0], v[1]); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 432 | } |
| 433 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 434 | static void GLAPIENTRY VertexAttrib3NbvNV(GLuint index, const GLbyte *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 435 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 436 | GL_CALL(VertexAttrib3fNV)(index, BYTE_TO_FLOAT(v[0]), |
| 437 | BYTE_TO_FLOAT(v[1]), |
| 438 | BYTE_TO_FLOAT(v[2])); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 439 | } |
| 440 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 441 | static void GLAPIENTRY VertexAttrib3bvNV(GLuint index, const GLbyte *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 442 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 443 | GL_CALL(VertexAttrib3fNV)(index, v[0], v[1], v[2]); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 444 | } |
| 445 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 446 | static void GLAPIENTRY VertexAttrib4NbvNV(GLuint index, const GLbyte *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 447 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 448 | GL_CALL(VertexAttrib4fNV)(index, BYTE_TO_FLOAT(v[0]), |
| 449 | BYTE_TO_FLOAT(v[1]), |
| 450 | BYTE_TO_FLOAT(v[2]), |
| 451 | BYTE_TO_FLOAT(v[3])); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 452 | } |
| 453 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 454 | static void GLAPIENTRY VertexAttrib4bvNV(GLuint index, const GLbyte *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 455 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 456 | GL_CALL(VertexAttrib4fNV)(index, v[0], v[1], v[2], v[3]); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 457 | } |
| 458 | |
| 459 | /* GL_UNSIGNED_BYTE attributes */ |
| 460 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 461 | static void GLAPIENTRY VertexAttrib1NubvNV(GLuint index, const GLubyte *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 462 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 463 | GL_CALL(VertexAttrib1fNV)(index, UBYTE_TO_FLOAT(v[0])); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 464 | } |
| 465 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 466 | static void GLAPIENTRY VertexAttrib1ubvNV(GLuint index, const GLubyte *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 467 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 468 | GL_CALL(VertexAttrib1fNV)(index, v[0]); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 469 | } |
| 470 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 471 | static void GLAPIENTRY VertexAttrib2NubvNV(GLuint index, const GLubyte *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 472 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 473 | GL_CALL(VertexAttrib2fNV)(index, UBYTE_TO_FLOAT(v[0]), |
| 474 | UBYTE_TO_FLOAT(v[1])); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 475 | } |
| 476 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 477 | static void GLAPIENTRY VertexAttrib2ubvNV(GLuint index, const GLubyte *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 478 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 479 | GL_CALL(VertexAttrib2fNV)(index, v[0], v[1]); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 480 | } |
| 481 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 482 | static void GLAPIENTRY VertexAttrib3NubvNV(GLuint index, const GLubyte *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 483 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 484 | GL_CALL(VertexAttrib3fNV)(index, UBYTE_TO_FLOAT(v[0]), |
| 485 | UBYTE_TO_FLOAT(v[1]), |
| 486 | UBYTE_TO_FLOAT(v[2])); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 487 | } |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 488 | static void GLAPIENTRY VertexAttrib3ubvNV(GLuint index, const GLubyte *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 489 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 490 | GL_CALL(VertexAttrib3fNV)(index, v[0], v[1], v[2]); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 491 | } |
| 492 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 493 | static void GLAPIENTRY VertexAttrib4NubvNV(GLuint index, const GLubyte *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 494 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 495 | GL_CALL(VertexAttrib4fNV)(index, UBYTE_TO_FLOAT(v[0]), |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 496 | UBYTE_TO_FLOAT(v[1]), |
| 497 | UBYTE_TO_FLOAT(v[2]), |
| 498 | UBYTE_TO_FLOAT(v[3])); |
| 499 | } |
| 500 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 501 | static void GLAPIENTRY VertexAttrib4ubvNV(GLuint index, const GLubyte *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 502 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 503 | GL_CALL(VertexAttrib4fNV)(index, v[0], v[1], v[2], v[3]); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 504 | } |
| 505 | |
| 506 | /* GL_SHORT attributes */ |
| 507 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 508 | static void GLAPIENTRY VertexAttrib1NsvNV(GLuint index, const GLshort *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 509 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 510 | GL_CALL(VertexAttrib1fNV)(index, SHORT_TO_FLOAT(v[0])); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 511 | } |
| 512 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 513 | static void GLAPIENTRY VertexAttrib1svNV(GLuint index, const GLshort *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 514 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 515 | GL_CALL(VertexAttrib1fNV)(index, v[0]); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 516 | } |
| 517 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 518 | static void GLAPIENTRY VertexAttrib2NsvNV(GLuint index, const GLshort *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 519 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 520 | GL_CALL(VertexAttrib2fNV)(index, SHORT_TO_FLOAT(v[0]), |
| 521 | SHORT_TO_FLOAT(v[1])); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 522 | } |
| 523 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 524 | static void GLAPIENTRY VertexAttrib2svNV(GLuint index, const GLshort *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 525 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 526 | GL_CALL(VertexAttrib2fNV)(index, v[0], v[1]); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 527 | } |
| 528 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 529 | static void GLAPIENTRY VertexAttrib3NsvNV(GLuint index, const GLshort *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 530 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 531 | GL_CALL(VertexAttrib3fNV)(index, SHORT_TO_FLOAT(v[0]), |
| 532 | SHORT_TO_FLOAT(v[1]), |
| 533 | SHORT_TO_FLOAT(v[2])); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 534 | } |
| 535 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 536 | static void GLAPIENTRY VertexAttrib3svNV(GLuint index, const GLshort *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 537 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 538 | GL_CALL(VertexAttrib3fNV)(index, v[0], v[1], v[2]); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 539 | } |
| 540 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 541 | static void GLAPIENTRY VertexAttrib4NsvNV(GLuint index, const GLshort *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 542 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 543 | GL_CALL(VertexAttrib4fNV)(index, SHORT_TO_FLOAT(v[0]), |
| 544 | SHORT_TO_FLOAT(v[1]), |
| 545 | SHORT_TO_FLOAT(v[2]), |
| 546 | SHORT_TO_FLOAT(v[3])); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 547 | } |
| 548 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 549 | static void GLAPIENTRY VertexAttrib4svNV(GLuint index, const GLshort *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 550 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 551 | GL_CALL(VertexAttrib4fNV)(index, v[0], v[1], v[2], v[3]); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 552 | } |
| 553 | |
| 554 | /* GL_UNSIGNED_SHORT attributes */ |
| 555 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 556 | static void GLAPIENTRY VertexAttrib1NusvNV(GLuint index, const GLushort *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 557 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 558 | GL_CALL(VertexAttrib1fNV)(index, USHORT_TO_FLOAT(v[0])); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 559 | } |
| 560 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 561 | static void GLAPIENTRY VertexAttrib1usvNV(GLuint index, const GLushort *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 562 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 563 | GL_CALL(VertexAttrib1fNV)(index, v[0]); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 564 | } |
| 565 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 566 | static void GLAPIENTRY VertexAttrib2NusvNV(GLuint index, const GLushort *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 567 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 568 | GL_CALL(VertexAttrib2fNV)(index, USHORT_TO_FLOAT(v[0]), |
| 569 | USHORT_TO_FLOAT(v[1])); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 570 | } |
| 571 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 572 | static void GLAPIENTRY VertexAttrib2usvNV(GLuint index, const GLushort *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 573 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 574 | GL_CALL(VertexAttrib2fNV)(index, v[0], v[1]); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 575 | } |
| 576 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 577 | static void GLAPIENTRY VertexAttrib3NusvNV(GLuint index, const GLushort *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 578 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 579 | GL_CALL(VertexAttrib3fNV)(index, USHORT_TO_FLOAT(v[0]), |
| 580 | USHORT_TO_FLOAT(v[1]), |
| 581 | USHORT_TO_FLOAT(v[2])); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 582 | } |
| 583 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 584 | static void GLAPIENTRY VertexAttrib3usvNV(GLuint index, const GLushort *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 585 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 586 | GL_CALL(VertexAttrib3fNV)(index, v[0], v[1], v[2]); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 587 | } |
| 588 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 589 | static void GLAPIENTRY VertexAttrib4NusvNV(GLuint index, const GLushort *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 590 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 591 | GL_CALL(VertexAttrib4fNV)(index, USHORT_TO_FLOAT(v[0]), |
| 592 | USHORT_TO_FLOAT(v[1]), |
| 593 | USHORT_TO_FLOAT(v[2]), |
| 594 | USHORT_TO_FLOAT(v[3])); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 595 | } |
| 596 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 597 | static void GLAPIENTRY VertexAttrib4usvNV(GLuint index, const GLushort *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 598 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 599 | GL_CALL(VertexAttrib4fNV)(index, v[0], v[1], v[2], v[3]); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 600 | } |
| 601 | |
| 602 | /* GL_INT attributes */ |
| 603 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 604 | static void GLAPIENTRY VertexAttrib1NivNV(GLuint index, const GLint *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 605 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 606 | GL_CALL(VertexAttrib1fNV)(index, INT_TO_FLOAT(v[0])); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 607 | } |
| 608 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 609 | static void GLAPIENTRY VertexAttrib1ivNV(GLuint index, const GLint *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 610 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 611 | GL_CALL(VertexAttrib1fNV)(index, v[0]); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 612 | } |
| 613 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 614 | static void GLAPIENTRY VertexAttrib2NivNV(GLuint index, const GLint *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 615 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 616 | GL_CALL(VertexAttrib2fNV)(index, INT_TO_FLOAT(v[0]), |
| 617 | INT_TO_FLOAT(v[1])); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 618 | } |
| 619 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 620 | static void GLAPIENTRY VertexAttrib2ivNV(GLuint index, const GLint *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 621 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 622 | GL_CALL(VertexAttrib2fNV)(index, v[0], v[1]); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 623 | } |
| 624 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 625 | static void GLAPIENTRY VertexAttrib3NivNV(GLuint index, const GLint *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 626 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 627 | GL_CALL(VertexAttrib3fNV)(index, INT_TO_FLOAT(v[0]), |
| 628 | INT_TO_FLOAT(v[1]), |
| 629 | INT_TO_FLOAT(v[2])); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 630 | } |
| 631 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 632 | static void GLAPIENTRY VertexAttrib3ivNV(GLuint index, const GLint *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 633 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 634 | GL_CALL(VertexAttrib3fNV)(index, v[0], v[1], v[2]); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 635 | } |
| 636 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 637 | static void GLAPIENTRY VertexAttrib4NivNV(GLuint index, const GLint *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 638 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 639 | GL_CALL(VertexAttrib4fNV)(index, INT_TO_FLOAT(v[0]), |
| 640 | INT_TO_FLOAT(v[1]), |
| 641 | INT_TO_FLOAT(v[2]), |
| 642 | INT_TO_FLOAT(v[3])); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 643 | } |
| 644 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 645 | static void GLAPIENTRY VertexAttrib4ivNV(GLuint index, const GLint *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 646 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 647 | GL_CALL(VertexAttrib4fNV)(index, v[0], v[1], v[2], v[3]); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 648 | } |
| 649 | |
| 650 | /* GL_UNSIGNED_INT attributes */ |
| 651 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 652 | static void GLAPIENTRY VertexAttrib1NuivNV(GLuint index, const GLuint *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 653 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 654 | GL_CALL(VertexAttrib1fNV)(index, UINT_TO_FLOAT(v[0])); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 655 | } |
| 656 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 657 | static void GLAPIENTRY VertexAttrib1uivNV(GLuint index, const GLuint *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 658 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 659 | GL_CALL(VertexAttrib1fNV)(index, v[0]); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 660 | } |
| 661 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 662 | static void GLAPIENTRY VertexAttrib2NuivNV(GLuint index, const GLuint *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 663 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 664 | GL_CALL(VertexAttrib2fNV)(index, UINT_TO_FLOAT(v[0]), |
| 665 | UINT_TO_FLOAT(v[1])); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 666 | } |
| 667 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 668 | static void GLAPIENTRY VertexAttrib2uivNV(GLuint index, const GLuint *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 669 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 670 | GL_CALL(VertexAttrib2fNV)(index, v[0], v[1]); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 671 | } |
| 672 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 673 | static void GLAPIENTRY VertexAttrib3NuivNV(GLuint index, const GLuint *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 674 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 675 | GL_CALL(VertexAttrib3fNV)(index, UINT_TO_FLOAT(v[0]), |
| 676 | UINT_TO_FLOAT(v[1]), |
| 677 | UINT_TO_FLOAT(v[2])); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 678 | } |
| 679 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 680 | static void GLAPIENTRY VertexAttrib3uivNV(GLuint index, const GLuint *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 681 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 682 | GL_CALL(VertexAttrib3fNV)(index, v[0], v[1], v[2]); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 683 | } |
| 684 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 685 | static void GLAPIENTRY VertexAttrib4NuivNV(GLuint index, const GLuint *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 686 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 687 | GL_CALL(VertexAttrib4fNV)(index, UINT_TO_FLOAT(v[0]), |
| 688 | UINT_TO_FLOAT(v[1]), |
| 689 | UINT_TO_FLOAT(v[2]), |
| 690 | UINT_TO_FLOAT(v[3])); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 691 | } |
| 692 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 693 | static void GLAPIENTRY VertexAttrib4uivNV(GLuint index, const GLuint *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 694 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 695 | GL_CALL(VertexAttrib4fNV)(index, v[0], v[1], v[2], v[3]); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 696 | } |
| 697 | |
| 698 | /* GL_FLOAT attributes */ |
| 699 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 700 | static void GLAPIENTRY VertexAttrib1fvNV(GLuint index, const GLfloat *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 701 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 702 | GL_CALL(VertexAttrib1fvNV)(index, v); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 703 | } |
| 704 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 705 | static void GLAPIENTRY VertexAttrib2fvNV(GLuint index, const GLfloat *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 706 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 707 | GL_CALL(VertexAttrib2fvNV)(index, v); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 708 | } |
| 709 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 710 | static void GLAPIENTRY VertexAttrib3fvNV(GLuint index, const GLfloat *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 711 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 712 | GL_CALL(VertexAttrib3fvNV)(index, v); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 713 | } |
| 714 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 715 | static void GLAPIENTRY VertexAttrib4fvNV(GLuint index, const GLfloat *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 716 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 717 | GL_CALL(VertexAttrib4fvNV)(index, v); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 718 | } |
| 719 | |
| 720 | /* GL_DOUBLE attributes */ |
| 721 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 722 | static void GLAPIENTRY VertexAttrib1dvNV(GLuint index, const GLdouble *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 723 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 724 | GL_CALL(VertexAttrib1dvNV)(index, v); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 725 | } |
| 726 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 727 | static void GLAPIENTRY VertexAttrib2dvNV(GLuint index, const GLdouble *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 728 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 729 | GL_CALL(VertexAttrib2dvNV)(index, v); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 730 | } |
| 731 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 732 | static void GLAPIENTRY VertexAttrib3dvNV(GLuint index, const GLdouble *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 733 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 734 | GL_CALL(VertexAttrib3dvNV)(index, v); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 735 | } |
| 736 | |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 737 | static void GLAPIENTRY VertexAttrib4dvNV(GLuint index, const GLdouble *v) |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 738 | { |
Ian Romanick | c1d455f | 2004-05-27 00:03:53 +0000 | [diff] [blame] | 739 | GL_CALL(VertexAttrib4dvNV)(index, v); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 740 | } |
| 741 | |
| 742 | |
| 743 | /* |
| 744 | * Array [size][type] of VertexAttrib functions |
| 745 | */ |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 746 | static attrib_func AttribFuncsNV[2][4][8] = { |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 747 | { |
| 748 | /* non-normalized */ |
| 749 | { |
| 750 | /* size 1 */ |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 751 | (attrib_func) VertexAttrib1bvNV, |
| 752 | (attrib_func) VertexAttrib1ubvNV, |
| 753 | (attrib_func) VertexAttrib1svNV, |
| 754 | (attrib_func) VertexAttrib1usvNV, |
| 755 | (attrib_func) VertexAttrib1ivNV, |
| 756 | (attrib_func) VertexAttrib1uivNV, |
| 757 | (attrib_func) VertexAttrib1fvNV, |
| 758 | (attrib_func) VertexAttrib1dvNV |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 759 | }, |
| 760 | { |
| 761 | /* size 2 */ |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 762 | (attrib_func) VertexAttrib2bvNV, |
| 763 | (attrib_func) VertexAttrib2ubvNV, |
| 764 | (attrib_func) VertexAttrib2svNV, |
| 765 | (attrib_func) VertexAttrib2usvNV, |
| 766 | (attrib_func) VertexAttrib2ivNV, |
| 767 | (attrib_func) VertexAttrib2uivNV, |
| 768 | (attrib_func) VertexAttrib2fvNV, |
| 769 | (attrib_func) VertexAttrib2dvNV |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 770 | }, |
| 771 | { |
| 772 | /* size 3 */ |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 773 | (attrib_func) VertexAttrib3bvNV, |
| 774 | (attrib_func) VertexAttrib3ubvNV, |
| 775 | (attrib_func) VertexAttrib3svNV, |
| 776 | (attrib_func) VertexAttrib3usvNV, |
| 777 | (attrib_func) VertexAttrib3ivNV, |
| 778 | (attrib_func) VertexAttrib3uivNV, |
| 779 | (attrib_func) VertexAttrib3fvNV, |
| 780 | (attrib_func) VertexAttrib3dvNV |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 781 | }, |
| 782 | { |
| 783 | /* size 4 */ |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 784 | (attrib_func) VertexAttrib4bvNV, |
| 785 | (attrib_func) VertexAttrib4ubvNV, |
| 786 | (attrib_func) VertexAttrib4svNV, |
| 787 | (attrib_func) VertexAttrib4usvNV, |
| 788 | (attrib_func) VertexAttrib4ivNV, |
| 789 | (attrib_func) VertexAttrib4uivNV, |
| 790 | (attrib_func) VertexAttrib4fvNV, |
| 791 | (attrib_func) VertexAttrib4dvNV |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 792 | } |
| 793 | }, |
| 794 | { |
| 795 | /* normalized (except for float/double) */ |
| 796 | { |
| 797 | /* size 1 */ |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 798 | (attrib_func) VertexAttrib1NbvNV, |
| 799 | (attrib_func) VertexAttrib1NubvNV, |
| 800 | (attrib_func) VertexAttrib1NsvNV, |
| 801 | (attrib_func) VertexAttrib1NusvNV, |
| 802 | (attrib_func) VertexAttrib1NivNV, |
| 803 | (attrib_func) VertexAttrib1NuivNV, |
| 804 | (attrib_func) VertexAttrib1fvNV, |
| 805 | (attrib_func) VertexAttrib1dvNV |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 806 | }, |
| 807 | { |
| 808 | /* size 2 */ |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 809 | (attrib_func) VertexAttrib2NbvNV, |
| 810 | (attrib_func) VertexAttrib2NubvNV, |
| 811 | (attrib_func) VertexAttrib2NsvNV, |
| 812 | (attrib_func) VertexAttrib2NusvNV, |
| 813 | (attrib_func) VertexAttrib2NivNV, |
| 814 | (attrib_func) VertexAttrib2NuivNV, |
| 815 | (attrib_func) VertexAttrib2fvNV, |
| 816 | (attrib_func) VertexAttrib2dvNV |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 817 | }, |
| 818 | { |
| 819 | /* size 3 */ |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 820 | (attrib_func) VertexAttrib3NbvNV, |
| 821 | (attrib_func) VertexAttrib3NubvNV, |
| 822 | (attrib_func) VertexAttrib3NsvNV, |
| 823 | (attrib_func) VertexAttrib3NusvNV, |
| 824 | (attrib_func) VertexAttrib3NivNV, |
| 825 | (attrib_func) VertexAttrib3NuivNV, |
| 826 | (attrib_func) VertexAttrib3fvNV, |
| 827 | (attrib_func) VertexAttrib3dvNV |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 828 | }, |
| 829 | { |
| 830 | /* size 4 */ |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 831 | (attrib_func) VertexAttrib4NbvNV, |
| 832 | (attrib_func) VertexAttrib4NubvNV, |
| 833 | (attrib_func) VertexAttrib4NsvNV, |
| 834 | (attrib_func) VertexAttrib4NusvNV, |
| 835 | (attrib_func) VertexAttrib4NivNV, |
| 836 | (attrib_func) VertexAttrib4NuivNV, |
| 837 | (attrib_func) VertexAttrib4fvNV, |
| 838 | (attrib_func) VertexAttrib4dvNV |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 839 | } |
| 840 | } |
| 841 | }; |
| 842 | |
Adam Jackson | 94987be | 2004-10-24 02:05:40 +0000 | [diff] [blame] | 843 | static void GLAPIENTRY EdgeFlagv(const GLboolean *flag) |
| 844 | { |
| 845 | GL_CALL(EdgeFlagv)(flag); |
| 846 | } |
| 847 | |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 848 | /**********************************************************************/ |
| 849 | |
Keith Whitwell | 4b7d6f2 | 2001-06-01 22:22:10 +0000 | [diff] [blame] | 850 | |
| 851 | GLboolean _ae_create_context( GLcontext *ctx ) |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 852 | { |
Keith Whitwell | ae0eaf9 | 2003-11-24 15:23:18 +0000 | [diff] [blame] | 853 | if (ctx->aelt_context) |
| 854 | return GL_TRUE; |
| 855 | |
Keith Whitwell | 4b7d6f2 | 2001-06-01 22:22:10 +0000 | [diff] [blame] | 856 | ctx->aelt_context = MALLOC( sizeof(AEcontext) ); |
Gareth Hughes | 1fb0a43 | 2001-12-28 06:28:10 +0000 | [diff] [blame] | 857 | if (!ctx->aelt_context) |
Keith Whitwell | 4b7d6f2 | 2001-06-01 22:22:10 +0000 | [diff] [blame] | 858 | return GL_FALSE; |
| 859 | |
| 860 | AE_CONTEXT(ctx)->NewState = ~0; |
| 861 | return GL_TRUE; |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 862 | } |
| 863 | |
Keith Whitwell | 4b7d6f2 | 2001-06-01 22:22:10 +0000 | [diff] [blame] | 864 | |
| 865 | void _ae_destroy_context( GLcontext *ctx ) |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 866 | { |
Keith Whitwell | 4b7d6f2 | 2001-06-01 22:22:10 +0000 | [diff] [blame] | 867 | if ( AE_CONTEXT( ctx ) ) { |
| 868 | FREE( ctx->aelt_context ); |
Keith Whitwell | a0c8524 | 2005-02-11 09:34:05 +0000 | [diff] [blame] | 869 | ctx->aelt_context = NULL; |
Keith Whitwell | 4b7d6f2 | 2001-06-01 22:22:10 +0000 | [diff] [blame] | 870 | } |
| 871 | } |
| 872 | |
| 873 | |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 874 | /** |
| 875 | * Make a list of per-vertex functions to call for each glArrayElement call. |
Brian Paul | 1e3d868 | 2004-02-24 02:49:43 +0000 | [diff] [blame] | 876 | * These functions access the array data (i.e. glVertex, glColor, glNormal, |
| 877 | * etc). |
| 878 | * Note: this may be called during display list construction. |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 879 | */ |
Keith Whitwell | 4b7d6f2 | 2001-06-01 22:22:10 +0000 | [diff] [blame] | 880 | static void _ae_update_state( GLcontext *ctx ) |
| 881 | { |
| 882 | AEcontext *actx = AE_CONTEXT(ctx); |
Keith Whitwell | 4b7d6f2 | 2001-06-01 22:22:10 +0000 | [diff] [blame] | 883 | AEarray *aa = actx->arrays; |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 884 | AEattrib *at = actx->attribs; |
Brian Paul | db07de0 | 2002-04-19 00:23:08 +0000 | [diff] [blame] | 885 | GLuint i; |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 886 | |
Brian Paul | 1e3d868 | 2004-02-24 02:49:43 +0000 | [diff] [blame] | 887 | /* conventional vertex arrays */ |
| 888 | if (ctx->Array.Index.Enabled) { |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 889 | aa->array = &ctx->Array.Index; |
Brian Paul | 2615e81 | 2004-02-24 14:47:01 +0000 | [diff] [blame] | 890 | aa->func = IndexFuncs[TYPE_IDX(aa->array->Type)]; |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 891 | aa++; |
| 892 | } |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 893 | if (ctx->Array.EdgeFlag.Enabled) { |
Keith Whitwell | 4b7d6f2 | 2001-06-01 22:22:10 +0000 | [diff] [blame] | 894 | aa->array = &ctx->Array.EdgeFlag; |
Adam Jackson | 94987be | 2004-10-24 02:05:40 +0000 | [diff] [blame] | 895 | aa->func = (array_func) EdgeFlagv; |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 896 | aa++; |
| 897 | } |
Brian Paul | 1e3d868 | 2004-02-24 02:49:43 +0000 | [diff] [blame] | 898 | if (ctx->Array.Normal.Enabled) { |
| 899 | aa->array = &ctx->Array.Normal; |
Brian Paul | 2615e81 | 2004-02-24 14:47:01 +0000 | [diff] [blame] | 900 | aa->func = NormalFuncs[TYPE_IDX(aa->array->Type)]; |
Brian Paul | 1e3d868 | 2004-02-24 02:49:43 +0000 | [diff] [blame] | 901 | aa++; |
| 902 | } |
| 903 | if (ctx->Array.Color.Enabled) { |
| 904 | aa->array = &ctx->Array.Color; |
Brian Paul | 2615e81 | 2004-02-24 14:47:01 +0000 | [diff] [blame] | 905 | aa->func = ColorFuncs[aa->array->Size-3][TYPE_IDX(aa->array->Type)]; |
Brian Paul | 1e3d868 | 2004-02-24 02:49:43 +0000 | [diff] [blame] | 906 | aa++; |
| 907 | } |
| 908 | if (ctx->Array.SecondaryColor.Enabled) { |
| 909 | aa->array = &ctx->Array.SecondaryColor; |
Brian Paul | 2615e81 | 2004-02-24 14:47:01 +0000 | [diff] [blame] | 910 | aa->func = SecondaryColorFuncs[TYPE_IDX(aa->array->Type)]; |
Brian Paul | 1e3d868 | 2004-02-24 02:49:43 +0000 | [diff] [blame] | 911 | aa++; |
| 912 | } |
| 913 | if (ctx->Array.FogCoord.Enabled) { |
| 914 | aa->array = &ctx->Array.FogCoord; |
Brian Paul | 2615e81 | 2004-02-24 14:47:01 +0000 | [diff] [blame] | 915 | aa->func = FogCoordFuncs[TYPE_IDX(aa->array->Type)]; |
Brian Paul | 1e3d868 | 2004-02-24 02:49:43 +0000 | [diff] [blame] | 916 | aa++; |
| 917 | } |
| 918 | for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) { |
| 919 | if (ctx->Array.TexCoord[i].Enabled) { |
| 920 | /* NOTE: we use generic glVertexAttrib functions here. |
| 921 | * If we ever de-alias conventional/generic vertex attribs this |
| 922 | * will have to change. |
| 923 | */ |
| 924 | struct gl_client_array *attribArray = &ctx->Array.TexCoord[i]; |
| 925 | at->array = attribArray; |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 926 | at->func = AttribFuncsNV[at->array->Normalized][at->array->Size-1][TYPE_IDX(at->array->Type)]; |
Brian Paul | 9d1ff8c | 2004-02-24 14:59:26 +0000 | [diff] [blame] | 927 | at->index = VERT_ATTRIB_TEX0 + i; |
Brian Paul | 1e3d868 | 2004-02-24 02:49:43 +0000 | [diff] [blame] | 928 | at++; |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 929 | } |
Brian Paul | 1e3d868 | 2004-02-24 02:49:43 +0000 | [diff] [blame] | 930 | } |
Roland Scheidegger | faaf78a | 2004-02-11 01:06:03 +0000 | [diff] [blame] | 931 | |
Brian Paul | 1e3d868 | 2004-02-24 02:49:43 +0000 | [diff] [blame] | 932 | /* generic vertex attribute arrays */ |
| 933 | for (i = 1; i < VERT_ATTRIB_MAX; i++) { /* skip zero! */ |
| 934 | if (ctx->Array.VertexAttrib[i].Enabled) { |
| 935 | struct gl_client_array *attribArray = &ctx->Array.VertexAttrib[i]; |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 936 | at->array = attribArray; |
| 937 | /* Note: we can't grab the _glapi_Dispatch->VertexAttrib1fvNV |
| 938 | * function pointer here (for float arrays) since the pointer may |
| 939 | * change from one execution of _ae_loopback_array_elt() to |
| 940 | * the next. Doing so caused UT to break. |
| 941 | */ |
Brian Paul | b5b8d22 | 2004-11-27 20:07:08 +0000 | [diff] [blame] | 942 | at->func = AttribFuncsNV[at->array->Normalized][at->array->Size-1][TYPE_IDX(at->array->Type)]; |
Brian Paul | 1e3d868 | 2004-02-24 02:49:43 +0000 | [diff] [blame] | 943 | at->index = i; |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 944 | at++; |
| 945 | } |
Roland Scheidegger | faaf78a | 2004-02-11 01:06:03 +0000 | [diff] [blame] | 946 | } |
Brian Paul | 1e3d868 | 2004-02-24 02:49:43 +0000 | [diff] [blame] | 947 | |
| 948 | /* finally, vertex position */ |
| 949 | if (ctx->Array.VertexAttrib[0].Enabled) { |
| 950 | /* Use glVertex(v) instead of glVertexAttrib(0, v) to be sure it's |
| 951 | * issued as the last (proviking) attribute). |
| 952 | */ |
| 953 | aa->array = &ctx->Array.VertexAttrib[0]; |
| 954 | assert(aa->array->Size >= 2); /* XXX fix someday? */ |
Brian Paul | 2615e81 | 2004-02-24 14:47:01 +0000 | [diff] [blame] | 955 | aa->func = VertexFuncs[aa->array->Size-2][TYPE_IDX(aa->array->Type)]; |
Brian Paul | 1e3d868 | 2004-02-24 02:49:43 +0000 | [diff] [blame] | 956 | aa++; |
| 957 | } |
| 958 | else if (ctx->Array.Vertex.Enabled) { |
| 959 | aa->array = &ctx->Array.Vertex; |
Brian Paul | 2615e81 | 2004-02-24 14:47:01 +0000 | [diff] [blame] | 960 | aa->func = VertexFuncs[aa->array->Size-2][TYPE_IDX(aa->array->Type)]; |
Brian Paul | 1e3d868 | 2004-02-24 02:49:43 +0000 | [diff] [blame] | 961 | aa++; |
| 962 | } |
| 963 | |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 964 | ASSERT(at - actx->attribs <= VERT_ATTRIB_MAX); |
| 965 | ASSERT(aa - actx->arrays < 32); |
| 966 | at->func = NULL; /* terminate the list */ |
| 967 | aa->func = NULL; /* terminate the list */ |
Roland Scheidegger | faaf78a | 2004-02-11 01:06:03 +0000 | [diff] [blame] | 968 | |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 969 | actx->NewState = 0; |
| 970 | } |
| 971 | |
| 972 | |
Brian Paul | 1e3d868 | 2004-02-24 02:49:43 +0000 | [diff] [blame] | 973 | /** |
| 974 | * Called via glArrayElement() and glDrawArrays(). |
| 975 | * Issue the glNormal, glVertex, glColor, glVertexAttrib, etc functions |
| 976 | * for all enabled vertex arrays (for elt-th element). |
| 977 | * Note: this may be called during display list construction. |
| 978 | */ |
Karl Schultz | d674569 | 2003-12-04 20:23:44 +0000 | [diff] [blame] | 979 | void GLAPIENTRY _ae_loopback_array_elt( GLint elt ) |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 980 | { |
| 981 | GET_CURRENT_CONTEXT(ctx); |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 982 | const AEcontext *actx = AE_CONTEXT(ctx); |
| 983 | const AEarray *aa; |
| 984 | const AEattrib *at; |
Keith Whitwell | 4b7d6f2 | 2001-06-01 22:22:10 +0000 | [diff] [blame] | 985 | |
| 986 | if (actx->NewState) |
| 987 | _ae_update_state( ctx ); |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 988 | |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 989 | /* generic attributes */ |
| 990 | for (at = actx->attribs; at->func; at++) { |
| 991 | const GLubyte *src = at->array->BufferObj->Data |
Karl Schultz | 6258b76 | 2005-05-05 21:08:07 +0000 | [diff] [blame^] | 992 | + (uintptr_t) at->array->Ptr |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 993 | + elt * at->array->StrideB; |
| 994 | at->func( at->index, src ); |
Brian Paul | 53ad036 | 2004-02-09 00:24:48 +0000 | [diff] [blame] | 995 | } |
| 996 | |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 997 | /* conventional arrays */ |
| 998 | for (aa = actx->arrays; aa->func ; aa++) { |
| 999 | const GLubyte *src = aa->array->BufferObj->Data |
Karl Schultz | 6258b76 | 2005-05-05 21:08:07 +0000 | [diff] [blame^] | 1000 | + (uintptr_t) aa->array->Ptr |
Brian Paul | 0d4393a | 2004-02-11 22:53:38 +0000 | [diff] [blame] | 1001 | + elt * aa->array->StrideB; |
Brian Paul | 0aa8a10 | 2004-02-08 02:03:41 +0000 | [diff] [blame] | 1002 | aa->func( src ); |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 1003 | } |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 1004 | } |
| 1005 | |
| 1006 | |
Keith Whitwell | 4b7d6f2 | 2001-06-01 22:22:10 +0000 | [diff] [blame] | 1007 | void _ae_invalidate_state( GLcontext *ctx, GLuint new_state ) |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 1008 | { |
Keith Whitwell | 4b7d6f2 | 2001-06-01 22:22:10 +0000 | [diff] [blame] | 1009 | AE_CONTEXT(ctx)->NewState |= new_state; |
Keith Whitwell | cab974c | 2000-12-26 05:09:27 +0000 | [diff] [blame] | 1010 | } |