Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenvbo_attrib_tmp.h
Go to the documentation of this file.
00001 /************************************************************************** 00002 00003 Copyright 2002 Tungsten Graphics Inc., Cedar Park, Texas. 00004 00005 All Rights Reserved. 00006 00007 Permission is hereby granted, free of charge, to any person obtaining a 00008 copy of this software and associated documentation files (the "Software"), 00009 to deal in the Software without restriction, including without limitation 00010 on the rights to use, copy, modify, merge, publish, distribute, sub 00011 license, and/or sell copies of the Software, and to permit persons to whom 00012 the Software is furnished to do so, subject to the following conditions: 00013 00014 The above copyright notice and this permission notice (including the next 00015 paragraph) shall be included in all copies or substantial portions of the 00016 Software. 00017 00018 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 00019 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00020 FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL 00021 TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, 00022 DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 00023 OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 00024 USE OR OTHER DEALINGS IN THE SOFTWARE. 00025 00026 **************************************************************************/ 00027 00028 #define ATTR1FV( A, V ) ATTR( A, 1, (V)[0], 0, 0, 1 ) 00029 #define ATTR2FV( A, V ) ATTR( A, 2, (V)[0], (V)[1], 0, 1 ) 00030 #define ATTR3FV( A, V ) ATTR( A, 3, (V)[0], (V)[1], (V)[2], 1 ) 00031 #define ATTR4FV( A, V ) ATTR( A, 4, (V)[0], (V)[1], (V)[2], (V)[3] ) 00032 00033 #define ATTR1F( A, X ) ATTR( A, 1, X, 0, 0, 1 ) 00034 #define ATTR2F( A, X, Y ) ATTR( A, 2, X, Y, 0, 1 ) 00035 #define ATTR3F( A, X, Y, Z ) ATTR( A, 3, X, Y, Z, 1 ) 00036 #define ATTR4F( A, X, Y, Z, W ) ATTR( A, 4, X, Y, Z, W ) 00037 00038 #define MAT_ATTR( A, N, V ) ATTR( A, N, (V)[0], (V)[1], (V)[2], (V)[3] ) 00039 00040 static void GLAPIENTRY TAG(Vertex2f)( GLfloat x, GLfloat y ) 00041 { 00042 GET_CURRENT_CONTEXT( ctx ); 00043 ATTR2F( VBO_ATTRIB_POS, x, y ); 00044 } 00045 00046 static void GLAPIENTRY TAG(Vertex2fv)( const GLfloat *v ) 00047 { 00048 GET_CURRENT_CONTEXT( ctx ); 00049 ATTR2FV( VBO_ATTRIB_POS, v ); 00050 } 00051 00052 static void GLAPIENTRY TAG(Vertex3f)( GLfloat x, GLfloat y, GLfloat z ) 00053 { 00054 GET_CURRENT_CONTEXT( ctx ); 00055 ATTR3F( VBO_ATTRIB_POS, x, y, z ); 00056 } 00057 00058 static void GLAPIENTRY TAG(Vertex3fv)( const GLfloat *v ) 00059 { 00060 GET_CURRENT_CONTEXT( ctx ); 00061 ATTR3FV( VBO_ATTRIB_POS, v ); 00062 } 00063 00064 static void GLAPIENTRY TAG(Vertex4f)( GLfloat x, GLfloat y, GLfloat z, GLfloat w ) 00065 { 00066 GET_CURRENT_CONTEXT( ctx ); 00067 ATTR4F( VBO_ATTRIB_POS, x, y, z, w ); 00068 } 00069 00070 static void GLAPIENTRY TAG(Vertex4fv)( const GLfloat *v ) 00071 { 00072 GET_CURRENT_CONTEXT( ctx ); 00073 ATTR4FV( VBO_ATTRIB_POS, v ); 00074 } 00075 00076 static void GLAPIENTRY TAG(TexCoord1f)( GLfloat x ) 00077 { 00078 GET_CURRENT_CONTEXT( ctx ); 00079 ATTR1F( VBO_ATTRIB_TEX0, x ); 00080 } 00081 00082 static void GLAPIENTRY TAG(TexCoord1fv)( const GLfloat *v ) 00083 { 00084 GET_CURRENT_CONTEXT( ctx ); 00085 ATTR1FV( VBO_ATTRIB_TEX0, v ); 00086 } 00087 00088 static void GLAPIENTRY TAG(TexCoord2f)( GLfloat x, GLfloat y ) 00089 { 00090 GET_CURRENT_CONTEXT( ctx ); 00091 ATTR2F( VBO_ATTRIB_TEX0, x, y ); 00092 } 00093 00094 static void GLAPIENTRY TAG(TexCoord2fv)( const GLfloat *v ) 00095 { 00096 GET_CURRENT_CONTEXT( ctx ); 00097 ATTR2FV( VBO_ATTRIB_TEX0, v ); 00098 } 00099 00100 static void GLAPIENTRY TAG(TexCoord3f)( GLfloat x, GLfloat y, GLfloat z ) 00101 { 00102 GET_CURRENT_CONTEXT( ctx ); 00103 ATTR3F( VBO_ATTRIB_TEX0, x, y, z ); 00104 } 00105 00106 static void GLAPIENTRY TAG(TexCoord3fv)( const GLfloat *v ) 00107 { 00108 GET_CURRENT_CONTEXT( ctx ); 00109 ATTR3FV( VBO_ATTRIB_TEX0, v ); 00110 } 00111 00112 static void GLAPIENTRY TAG(TexCoord4f)( GLfloat x, GLfloat y, GLfloat z, GLfloat w ) 00113 { 00114 GET_CURRENT_CONTEXT( ctx ); 00115 ATTR4F( VBO_ATTRIB_TEX0, x, y, z, w ); 00116 } 00117 00118 static void GLAPIENTRY TAG(TexCoord4fv)( const GLfloat *v ) 00119 { 00120 GET_CURRENT_CONTEXT( ctx ); 00121 ATTR4FV( VBO_ATTRIB_TEX0, v ); 00122 } 00123 00124 static void GLAPIENTRY TAG(Normal3f)( GLfloat x, GLfloat y, GLfloat z ) 00125 { 00126 GET_CURRENT_CONTEXT( ctx ); 00127 ATTR3F( VBO_ATTRIB_NORMAL, x, y, z ); 00128 } 00129 00130 static void GLAPIENTRY TAG(Normal3fv)( const GLfloat *v ) 00131 { 00132 GET_CURRENT_CONTEXT( ctx ); 00133 ATTR3FV( VBO_ATTRIB_NORMAL, v ); 00134 } 00135 00136 static void GLAPIENTRY TAG(FogCoordfEXT)( GLfloat x ) 00137 { 00138 GET_CURRENT_CONTEXT( ctx ); 00139 ATTR1F( VBO_ATTRIB_FOG, x ); 00140 } 00141 00142 static void GLAPIENTRY TAG(FogCoordfvEXT)( const GLfloat *v ) 00143 { 00144 GET_CURRENT_CONTEXT( ctx ); 00145 ATTR1FV( VBO_ATTRIB_FOG, v ); 00146 } 00147 00148 static void GLAPIENTRY TAG(Color3f)( GLfloat x, GLfloat y, GLfloat z ) 00149 { 00150 GET_CURRENT_CONTEXT( ctx ); 00151 ATTR3F( VBO_ATTRIB_COLOR0, x, y, z ); 00152 } 00153 00154 static void GLAPIENTRY TAG(Color3fv)( const GLfloat *v ) 00155 { 00156 GET_CURRENT_CONTEXT( ctx ); 00157 ATTR3FV( VBO_ATTRIB_COLOR0, v ); 00158 } 00159 00160 static void GLAPIENTRY TAG(Color4f)( GLfloat x, GLfloat y, GLfloat z, GLfloat w ) 00161 { 00162 GET_CURRENT_CONTEXT( ctx ); 00163 ATTR4F( VBO_ATTRIB_COLOR0, x, y, z, w ); 00164 } 00165 00166 static void GLAPIENTRY TAG(Color4fv)( const GLfloat *v ) 00167 { 00168 GET_CURRENT_CONTEXT( ctx ); 00169 ATTR4FV( VBO_ATTRIB_COLOR0, v ); 00170 } 00171 00172 static void GLAPIENTRY TAG(SecondaryColor3fEXT)( GLfloat x, GLfloat y, GLfloat z ) 00173 { 00174 GET_CURRENT_CONTEXT( ctx ); 00175 ATTR3F( VBO_ATTRIB_COLOR1, x, y, z ); 00176 } 00177 00178 static void GLAPIENTRY TAG(SecondaryColor3fvEXT)( const GLfloat *v ) 00179 { 00180 GET_CURRENT_CONTEXT( ctx ); 00181 ATTR3FV( VBO_ATTRIB_COLOR1, v ); 00182 } 00183 00184 00185 static void GLAPIENTRY TAG(EdgeFlag)( GLboolean b ) 00186 { 00187 GET_CURRENT_CONTEXT( ctx ); 00188 ATTR1F( VBO_ATTRIB_EDGEFLAG, (GLfloat)b ); 00189 } 00190 00191 static void GLAPIENTRY TAG(Indexf)( GLfloat f ) 00192 { 00193 GET_CURRENT_CONTEXT( ctx ); 00194 ATTR1F( VBO_ATTRIB_INDEX, f ); 00195 } 00196 00197 static void GLAPIENTRY TAG(Indexfv)( const GLfloat *f ) 00198 { 00199 GET_CURRENT_CONTEXT( ctx ); 00200 ATTR1FV( VBO_ATTRIB_INDEX, f ); 00201 } 00202 00203 00204 static void GLAPIENTRY TAG(MultiTexCoord1f)( GLenum target, GLfloat x ) 00205 { 00206 GET_CURRENT_CONTEXT( ctx ); 00207 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0; 00208 ATTR1F( attr, x ); 00209 } 00210 00211 static void GLAPIENTRY TAG(MultiTexCoord1fv)( GLenum target, const GLfloat *v ) 00212 { 00213 GET_CURRENT_CONTEXT( ctx ); 00214 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0; 00215 ATTR1FV( attr, v ); 00216 } 00217 00218 static void GLAPIENTRY TAG(MultiTexCoord2f)( GLenum target, GLfloat x, GLfloat y ) 00219 { 00220 GET_CURRENT_CONTEXT( ctx ); 00221 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0; 00222 ATTR2F( attr, x, y ); 00223 } 00224 00225 static void GLAPIENTRY TAG(MultiTexCoord2fv)( GLenum target, const GLfloat *v ) 00226 { 00227 GET_CURRENT_CONTEXT( ctx ); 00228 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0; 00229 ATTR2FV( attr, v ); 00230 } 00231 00232 static void GLAPIENTRY TAG(MultiTexCoord3f)( GLenum target, GLfloat x, GLfloat y, 00233 GLfloat z) 00234 { 00235 GET_CURRENT_CONTEXT( ctx ); 00236 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0; 00237 ATTR3F( attr, x, y, z ); 00238 } 00239 00240 static void GLAPIENTRY TAG(MultiTexCoord3fv)( GLenum target, const GLfloat *v ) 00241 { 00242 GET_CURRENT_CONTEXT( ctx ); 00243 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0; 00244 ATTR3FV( attr, v ); 00245 } 00246 00247 static void GLAPIENTRY TAG(MultiTexCoord4f)( GLenum target, GLfloat x, GLfloat y, 00248 GLfloat z, GLfloat w ) 00249 { 00250 GET_CURRENT_CONTEXT( ctx ); 00251 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0; 00252 ATTR4F( attr, x, y, z, w ); 00253 } 00254 00255 static void GLAPIENTRY TAG(MultiTexCoord4fv)( GLenum target, const GLfloat *v ) 00256 { 00257 GET_CURRENT_CONTEXT( ctx ); 00258 GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0; 00259 ATTR4FV( attr, v ); 00260 } 00261 00262 00263 static void GLAPIENTRY TAG(VertexAttrib1fARB)( GLuint index, GLfloat x ) 00264 { 00265 GET_CURRENT_CONTEXT( ctx ); 00266 if (index == 0) 00267 ATTR1F(0, x); 00268 else if (index < MAX_VERTEX_ATTRIBS) 00269 ATTR1F(VBO_ATTRIB_GENERIC0 + index, x); 00270 else 00271 ERROR(); 00272 } 00273 00274 static void GLAPIENTRY TAG(VertexAttrib1fvARB)( GLuint index, 00275 const GLfloat *v ) 00276 { 00277 GET_CURRENT_CONTEXT( ctx ); 00278 if (index == 0) 00279 ATTR1FV(0, v); 00280 else if (index < MAX_VERTEX_ATTRIBS) 00281 ATTR1FV(VBO_ATTRIB_GENERIC0 + index, v); 00282 else 00283 ERROR(); 00284 } 00285 00286 static void GLAPIENTRY TAG(VertexAttrib2fARB)( GLuint index, GLfloat x, 00287 GLfloat y ) 00288 { 00289 GET_CURRENT_CONTEXT( ctx ); 00290 if (index == 0) 00291 ATTR2F(0, x, y); 00292 else if (index < MAX_VERTEX_ATTRIBS) 00293 ATTR2F(VBO_ATTRIB_GENERIC0 + index, x, y); 00294 else 00295 ERROR(); 00296 } 00297 00298 static void GLAPIENTRY TAG(VertexAttrib2fvARB)( GLuint index, 00299 const GLfloat *v ) 00300 { 00301 GET_CURRENT_CONTEXT( ctx ); 00302 if (index == 0) 00303 ATTR2FV(0, v); 00304 else if (index < MAX_VERTEX_ATTRIBS) 00305 ATTR2FV(VBO_ATTRIB_GENERIC0 + index, v); 00306 else 00307 ERROR(); 00308 } 00309 00310 static void GLAPIENTRY TAG(VertexAttrib3fARB)( GLuint index, GLfloat x, 00311 GLfloat y, GLfloat z ) 00312 { 00313 GET_CURRENT_CONTEXT( ctx ); 00314 if (index == 0) 00315 ATTR3F(0, x, y, z); 00316 else if (index < MAX_VERTEX_ATTRIBS) 00317 ATTR3F(VBO_ATTRIB_GENERIC0 + index, x, y, z); 00318 else 00319 ERROR(); 00320 } 00321 00322 static void GLAPIENTRY TAG(VertexAttrib3fvARB)( GLuint index, 00323 const GLfloat *v ) 00324 { 00325 GET_CURRENT_CONTEXT( ctx ); 00326 if (index == 0) 00327 ATTR3FV(0, v); 00328 else if (index < MAX_VERTEX_ATTRIBS) 00329 ATTR3FV(VBO_ATTRIB_GENERIC0 + index, v); 00330 else 00331 ERROR(); 00332 } 00333 00334 static void GLAPIENTRY TAG(VertexAttrib4fARB)( GLuint index, GLfloat x, 00335 GLfloat y, GLfloat z, 00336 GLfloat w ) 00337 { 00338 GET_CURRENT_CONTEXT( ctx ); 00339 if (index == 0) 00340 ATTR4F(0, x, y, z, w); 00341 else if (index < MAX_VERTEX_ATTRIBS) 00342 ATTR4F(VBO_ATTRIB_GENERIC0 + index, x, y, z, w); 00343 else 00344 ERROR(); 00345 } 00346 00347 static void GLAPIENTRY TAG(VertexAttrib4fvARB)( GLuint index, 00348 const GLfloat *v ) 00349 { 00350 GET_CURRENT_CONTEXT( ctx ); 00351 if (index == 0) 00352 ATTR4FV(0, v); 00353 else if (index < MAX_VERTEX_ATTRIBS) 00354 ATTR4FV(VBO_ATTRIB_GENERIC0 + index, v); 00355 else 00356 ERROR(); 00357 } 00358 00359 00360 /* In addition to supporting NV_vertex_program, these entrypoints are 00361 * used by the display list and other code specifically because of 00362 * their property of aliasing with other attributes. (See 00363 * vbo_save_loopback.c) 00364 */ 00365 static void GLAPIENTRY TAG(VertexAttrib1fNV)( GLuint index, GLfloat x ) 00366 { 00367 GET_CURRENT_CONTEXT( ctx ); 00368 if (index < VBO_ATTRIB_MAX) 00369 ATTR1F(index, x); 00370 } 00371 00372 static void GLAPIENTRY TAG(VertexAttrib1fvNV)( GLuint index, 00373 const GLfloat *v ) 00374 { 00375 GET_CURRENT_CONTEXT( ctx ); 00376 if (index < VBO_ATTRIB_MAX) 00377 ATTR1FV(index, v); 00378 } 00379 00380 static void GLAPIENTRY TAG(VertexAttrib2fNV)( GLuint index, GLfloat x, 00381 GLfloat y ) 00382 { 00383 GET_CURRENT_CONTEXT( ctx ); 00384 if (index < VBO_ATTRIB_MAX) 00385 ATTR2F(index, x, y); 00386 } 00387 00388 static void GLAPIENTRY TAG(VertexAttrib2fvNV)( GLuint index, 00389 const GLfloat *v ) 00390 { 00391 GET_CURRENT_CONTEXT( ctx ); 00392 if (index < VBO_ATTRIB_MAX) 00393 ATTR2FV(index, v); 00394 } 00395 00396 static void GLAPIENTRY TAG(VertexAttrib3fNV)( GLuint index, GLfloat x, 00397 GLfloat y, GLfloat z ) 00398 { 00399 GET_CURRENT_CONTEXT( ctx ); 00400 if (index < VBO_ATTRIB_MAX) 00401 ATTR3F(index, x, y, z); 00402 } 00403 00404 static void GLAPIENTRY TAG(VertexAttrib3fvNV)( GLuint index, 00405 const GLfloat *v ) 00406 { 00407 GET_CURRENT_CONTEXT( ctx ); 00408 if (index < VBO_ATTRIB_MAX) 00409 ATTR3FV(index, v); 00410 } 00411 00412 static void GLAPIENTRY TAG(VertexAttrib4fNV)( GLuint index, GLfloat x, 00413 GLfloat y, GLfloat z, 00414 GLfloat w ) 00415 { 00416 GET_CURRENT_CONTEXT( ctx ); 00417 if (index < VBO_ATTRIB_MAX) 00418 ATTR4F(index, x, y, z, w); 00419 } 00420 00421 static void GLAPIENTRY TAG(VertexAttrib4fvNV)( GLuint index, 00422 const GLfloat *v ) 00423 { 00424 GET_CURRENT_CONTEXT( ctx ); 00425 if (index < VBO_ATTRIB_MAX) 00426 ATTR4FV(index, v); 00427 } 00428 00429 00430 #define MAT( ATTR, N, face, params ) \ 00431 do { \ 00432 if (face != GL_BACK) \ 00433 MAT_ATTR( ATTR, N, params ); /* front */ \ 00434 if (face != GL_FRONT) \ 00435 MAT_ATTR( ATTR + 1, N, params ); /* back */ \ 00436 } while (0) 00437 00438 00439 /* Colormaterial conflicts are dealt with later. 00440 */ 00441 static void GLAPIENTRY TAG(Materialfv)( GLenum face, GLenum pname, 00442 const GLfloat *params ) 00443 { 00444 GET_CURRENT_CONTEXT( ctx ); 00445 switch (pname) { 00446 case GL_EMISSION: 00447 MAT( VBO_ATTRIB_MAT_FRONT_EMISSION, 4, face, params ); 00448 break; 00449 case GL_AMBIENT: 00450 MAT( VBO_ATTRIB_MAT_FRONT_AMBIENT, 4, face, params ); 00451 break; 00452 case GL_DIFFUSE: 00453 MAT( VBO_ATTRIB_MAT_FRONT_DIFFUSE, 4, face, params ); 00454 break; 00455 case GL_SPECULAR: 00456 MAT( VBO_ATTRIB_MAT_FRONT_SPECULAR, 4, face, params ); 00457 break; 00458 case GL_SHININESS: 00459 MAT( VBO_ATTRIB_MAT_FRONT_SHININESS, 1, face, params ); 00460 break; 00461 case GL_COLOR_INDEXES: 00462 MAT( VBO_ATTRIB_MAT_FRONT_INDEXES, 3, face, params ); 00463 break; 00464 case GL_AMBIENT_AND_DIFFUSE: 00465 MAT( VBO_ATTRIB_MAT_FRONT_AMBIENT, 4, face, params ); 00466 MAT( VBO_ATTRIB_MAT_FRONT_DIFFUSE, 4, face, params ); 00467 break; 00468 default: 00469 ERROR(); 00470 return; 00471 } 00472 } 00473 00474 00475 #undef ATTR1FV 00476 #undef ATTR2FV 00477 #undef ATTR3FV 00478 #undef ATTR4FV 00479 00480 #undef ATTR1F 00481 #undef ATTR2F 00482 #undef ATTR3F 00483 #undef ATTR4F 00484 00485 #undef MAT 00486 #undef MAT_ATTR Generated on Sun May 27 2012 04:20:48 for ReactOS by
1.7.6.1
|