ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

api_noop.c
Go to the documentation of this file.
00001 /*
00002  * Mesa 3-D graphics library
00003  * Version:  6.5.1
00004  *
00005  * Copyright (C) 1999-2006  Brian Paul   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  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
00011  * and/or sell copies of the Software, and to permit persons to whom the
00012  * Software is furnished to do so, subject to the following conditions:
00013  *
00014  * The above copyright notice and this permission notice shall be included
00015  * in all copies or substantial portions of the Software.
00016  *
00017  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00018  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00019  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
00020  * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
00021  * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
00022  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00023  */
00024 
00025 
00026 #include "glheader.h"
00027 #include "api_noop.h"
00028 #include "api_validate.h"
00029 #include "api_arrayelt.h"
00030 #include "context.h"
00031 #include "light.h"
00032 #include "macros.h"
00033 #if FEATURE_dlist
00034 #include "dlist.h"
00035 #endif
00036 #include "glapi/dispatch.h"
00037 
00038 
00047 static void GLAPIENTRY _mesa_noop_EdgeFlag( GLboolean b )
00048 {
00049    GET_CURRENT_CONTEXT(ctx);
00050    ctx->Current.Attrib[VERT_ATTRIB_EDGEFLAG][0] = (GLfloat)b;
00051 }
00052 
00053 static void GLAPIENTRY _mesa_noop_Indexf( GLfloat f )
00054 {
00055    GET_CURRENT_CONTEXT(ctx);
00056    ctx->Current.Attrib[VERT_ATTRIB_COLOR_INDEX][0] = f;
00057 }
00058 
00059 static void GLAPIENTRY _mesa_noop_Indexfv( const GLfloat *v )
00060 {
00061    GET_CURRENT_CONTEXT(ctx);
00062    ctx->Current.Attrib[VERT_ATTRIB_COLOR_INDEX][0] = *v;
00063 }
00064 
00065 static void GLAPIENTRY _mesa_noop_FogCoordfEXT( GLfloat a )
00066 {
00067    GET_CURRENT_CONTEXT(ctx);
00068    GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_FOG];
00069    dest[0] = a;
00070    dest[1] = 0.0;
00071    dest[2] = 0.0;
00072    dest[3] = 1.0;
00073 }
00074 
00075 static void GLAPIENTRY _mesa_noop_FogCoordfvEXT( const GLfloat *v )
00076 {
00077    GET_CURRENT_CONTEXT(ctx);
00078    GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_FOG];
00079    dest[0] = v[0];
00080    dest[1] = 0.0;
00081    dest[2] = 0.0;
00082    dest[3] = 1.0;
00083 }
00084 
00085 static void GLAPIENTRY _mesa_noop_Normal3f( GLfloat a, GLfloat b, GLfloat c )
00086 {
00087    GET_CURRENT_CONTEXT(ctx);
00088    GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_NORMAL];
00089    dest[0] = a;
00090    dest[1] = b;
00091    dest[2] = c;
00092    dest[3] = 1.0;
00093 }
00094 
00095 static void GLAPIENTRY _mesa_noop_Normal3fv( const GLfloat *v )
00096 {
00097    GET_CURRENT_CONTEXT(ctx);
00098    GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_NORMAL];
00099    dest[0] = v[0];
00100    dest[1] = v[1];
00101    dest[2] = v[2];
00102    dest[3] = 1.0;
00103 }
00104 
00105 static void GLAPIENTRY _mesa_noop_Color4f( GLfloat a, GLfloat b, GLfloat c, GLfloat d )
00106 {
00107    GET_CURRENT_CONTEXT(ctx);
00108    GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR0];
00109    color[0] = a;
00110    color[1] = b;
00111    color[2] = c;
00112    color[3] = d;
00113 }
00114 
00115 static void GLAPIENTRY _mesa_noop_Color4fv( const GLfloat *v )
00116 {
00117    GET_CURRENT_CONTEXT(ctx);
00118    GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR0];
00119    color[0] = v[0];
00120    color[1] = v[1];
00121    color[2] = v[2];
00122    color[3] = v[3];
00123 }
00124 
00125 static void GLAPIENTRY _mesa_noop_Color3f( GLfloat a, GLfloat b, GLfloat c )
00126 {
00127    GET_CURRENT_CONTEXT(ctx);
00128    GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR0];
00129    color[0] = a;
00130    color[1] = b;
00131    color[2] = c;
00132    color[3] = 1.0;
00133 }
00134 
00135 static void GLAPIENTRY _mesa_noop_Color3fv( const GLfloat *v )
00136 {
00137    GET_CURRENT_CONTEXT(ctx);
00138    GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR0];
00139    color[0] = v[0];
00140    color[1] = v[1];
00141    color[2] = v[2];
00142    color[3] = 1.0;
00143 }
00144 
00145 static void GLAPIENTRY _mesa_noop_MultiTexCoord1fARB( GLenum target, GLfloat a )
00146 {
00147    GET_CURRENT_CONTEXT(ctx);
00148    GLuint unit = target - GL_TEXTURE0_ARB;
00149 
00150    /* unit is unsigned -- cannot be less than zero.
00151     */
00152    if (unit < MAX_TEXTURE_COORD_UNITS)
00153    {
00154       GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit];
00155       dest[0] = a;
00156       dest[1] = 0;
00157       dest[2] = 0;
00158       dest[3] = 1;
00159    }
00160 }
00161 
00162 static void GLAPIENTRY _mesa_noop_MultiTexCoord1fvARB( GLenum target, const GLfloat *v )
00163 {
00164    GET_CURRENT_CONTEXT(ctx);
00165    GLuint unit = target - GL_TEXTURE0_ARB;
00166 
00167    /* unit is unsigned -- cannot be less than zero.
00168     */
00169    if (unit < MAX_TEXTURE_COORD_UNITS)
00170    {
00171       GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit];
00172       dest[0] = v[0];
00173       dest[1] = 0;
00174       dest[2] = 0;
00175       dest[3] = 1;
00176    }
00177 }
00178 
00179 static void GLAPIENTRY _mesa_noop_MultiTexCoord2fARB( GLenum target, GLfloat a, GLfloat b )
00180 {
00181    GET_CURRENT_CONTEXT(ctx);
00182    GLuint unit = target - GL_TEXTURE0_ARB;
00183 
00184    /* unit is unsigned -- cannot be less than zero.
00185     */
00186    if (unit < MAX_TEXTURE_COORD_UNITS)
00187    {
00188       GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit];
00189       dest[0] = a;
00190       dest[1] = b;
00191       dest[2] = 0;
00192       dest[3] = 1;
00193    }
00194 }
00195 
00196 static void GLAPIENTRY _mesa_noop_MultiTexCoord2fvARB( GLenum target, const GLfloat *v )
00197 {
00198    GET_CURRENT_CONTEXT(ctx);
00199    GLuint unit = target - GL_TEXTURE0_ARB;
00200 
00201    /* unit is unsigned -- cannot be less than zero.
00202     */
00203    if (unit < MAX_TEXTURE_COORD_UNITS)
00204    {
00205       GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit];
00206       dest[0] = v[0];
00207       dest[1] = v[1];
00208       dest[2] = 0;
00209       dest[3] = 1;
00210    }
00211 }
00212 
00213 static void GLAPIENTRY _mesa_noop_MultiTexCoord3fARB( GLenum target, GLfloat a, GLfloat b, GLfloat c)
00214 {
00215    GET_CURRENT_CONTEXT(ctx);
00216    GLuint unit = target - GL_TEXTURE0_ARB;
00217 
00218    /* unit is unsigned -- cannot be less than zero.
00219     */
00220    if (unit < MAX_TEXTURE_COORD_UNITS)
00221    {
00222       GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit];
00223       dest[0] = a;
00224       dest[1] = b;
00225       dest[2] = c;
00226       dest[3] = 1;
00227    }
00228 }
00229 
00230 static void GLAPIENTRY _mesa_noop_MultiTexCoord3fvARB( GLenum target, const GLfloat *v )
00231 {
00232    GET_CURRENT_CONTEXT(ctx);
00233    GLuint unit = target - GL_TEXTURE0_ARB;
00234 
00235    /* unit is unsigned -- cannot be less than zero.
00236     */
00237    if (unit < MAX_TEXTURE_COORD_UNITS)
00238    {
00239       GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit];
00240       dest[0] = v[0];
00241       dest[1] = v[1];
00242       dest[2] = v[2];
00243       dest[3] = 1;
00244    }
00245 }
00246 
00247 static void GLAPIENTRY _mesa_noop_MultiTexCoord4fARB( GLenum target, GLfloat a, GLfloat b,
00248                   GLfloat c, GLfloat d )
00249 {
00250    GET_CURRENT_CONTEXT(ctx);
00251    GLuint unit = target - GL_TEXTURE0_ARB;
00252 
00253    /* unit is unsigned -- cannot be less than zero.
00254     */
00255    if (unit < MAX_TEXTURE_COORD_UNITS)
00256    {
00257       GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit];
00258       dest[0] = a;
00259       dest[1] = b;
00260       dest[2] = c;
00261       dest[3] = d;
00262    }
00263 }
00264 
00265 static void GLAPIENTRY _mesa_noop_MultiTexCoord4fvARB( GLenum target, const GLfloat *v )
00266 {
00267    GET_CURRENT_CONTEXT(ctx);
00268    GLuint unit = target - GL_TEXTURE0_ARB;
00269 
00270    /* unit is unsigned -- cannot be less than zero.
00271     */
00272    if (unit < MAX_TEXTURE_COORD_UNITS)
00273    {
00274       GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0 + unit];
00275       dest[0] = v[0];
00276       dest[1] = v[1];
00277       dest[2] = v[2];
00278       dest[3] = v[3];
00279    }
00280 }
00281 
00282 static void GLAPIENTRY _mesa_noop_SecondaryColor3fEXT( GLfloat a, GLfloat b, GLfloat c )
00283 {
00284    GET_CURRENT_CONTEXT(ctx);
00285    GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR1];
00286    color[0] = a;
00287    color[1] = b;
00288    color[2] = c;
00289    color[3] = 1.0;
00290 }
00291 
00292 static void GLAPIENTRY _mesa_noop_SecondaryColor3fvEXT( const GLfloat *v )
00293 {
00294    GET_CURRENT_CONTEXT(ctx);
00295    GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR1];
00296    color[0] = v[0];
00297    color[1] = v[1];
00298    color[2] = v[2];
00299    color[3] = 1.0;
00300 }
00301 
00302 static void GLAPIENTRY _mesa_noop_TexCoord1f( GLfloat a )
00303 {
00304    GET_CURRENT_CONTEXT(ctx);
00305    GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0];
00306    dest[0] = a;
00307    dest[1] = 0;
00308    dest[2] = 0;
00309    dest[3] = 1;
00310 }
00311 
00312 static void GLAPIENTRY _mesa_noop_TexCoord1fv( const GLfloat *v )
00313 {
00314    GET_CURRENT_CONTEXT(ctx);
00315    GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0];
00316    dest[0] = v[0];
00317    dest[1] = 0;
00318    dest[2] = 0;
00319    dest[3] = 1;
00320 }
00321 
00322 static void GLAPIENTRY _mesa_noop_TexCoord2f( GLfloat a, GLfloat b )
00323 {
00324    GET_CURRENT_CONTEXT(ctx);
00325    GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0];
00326    dest[0] = a;
00327    dest[1] = b;
00328    dest[2] = 0;
00329    dest[3] = 1;
00330 }
00331 
00332 static void GLAPIENTRY _mesa_noop_TexCoord2fv( const GLfloat *v )
00333 {
00334    GET_CURRENT_CONTEXT(ctx);
00335    GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0];
00336    dest[0] = v[0];
00337    dest[1] = v[1];
00338    dest[2] = 0;
00339    dest[3] = 1;
00340 }
00341 
00342 static void GLAPIENTRY _mesa_noop_TexCoord3f( GLfloat a, GLfloat b, GLfloat c )
00343 {
00344    GET_CURRENT_CONTEXT(ctx);
00345    GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0];
00346    dest[0] = a;
00347    dest[1] = b;
00348    dest[2] = c;
00349    dest[3] = 1;
00350 }
00351 
00352 static void GLAPIENTRY _mesa_noop_TexCoord3fv( const GLfloat *v )
00353 {
00354    GET_CURRENT_CONTEXT(ctx);
00355    GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0];
00356    dest[0] = v[0];
00357    dest[1] = v[1];
00358    dest[2] = v[2];
00359    dest[3] = 1;
00360 }
00361 
00362 static void GLAPIENTRY _mesa_noop_TexCoord4f( GLfloat a, GLfloat b, GLfloat c, GLfloat d )
00363 {
00364    GET_CURRENT_CONTEXT(ctx);
00365    GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0];
00366    dest[0] = a;
00367    dest[1] = b;
00368    dest[2] = c;
00369    dest[3] = d;
00370 }
00371 
00372 static void GLAPIENTRY _mesa_noop_TexCoord4fv( const GLfloat *v )
00373 {
00374    GET_CURRENT_CONTEXT(ctx);
00375    GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0];
00376    dest[0] = v[0];
00377    dest[1] = v[1];
00378    dest[2] = v[2];
00379    dest[3] = v[3];
00380 }
00381 
00382 
00388 static void GLAPIENTRY _mesa_noop_VertexAttrib1fNV( GLuint index, GLfloat x )
00389 {
00390    GET_CURRENT_CONTEXT(ctx);
00391    if (index < MAX_NV_VERTEX_PROGRAM_INPUTS) {
00392       ASSIGN_4V(ctx->Current.Attrib[index], x, 0, 0, 1);
00393    }
00394    else
00395       _mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib1fNV(index)" );
00396 }
00397 
00398 static void GLAPIENTRY _mesa_noop_VertexAttrib1fvNV( GLuint index, const GLfloat *v )
00399 {
00400    GET_CURRENT_CONTEXT(ctx);
00401    if (index < MAX_NV_VERTEX_PROGRAM_INPUTS) {
00402       ASSIGN_4V(ctx->Current.Attrib[index], v[0], 0, 0, 1);
00403    }
00404    else
00405       _mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib1fvNV(index)" );
00406 }
00407 
00408 static void GLAPIENTRY _mesa_noop_VertexAttrib2fNV( GLuint index, GLfloat x, GLfloat y )
00409 {
00410    GET_CURRENT_CONTEXT(ctx);
00411    if (index < MAX_NV_VERTEX_PROGRAM_INPUTS) {
00412       ASSIGN_4V(ctx->Current.Attrib[index], x, y, 0, 1);
00413    }
00414    else
00415       _mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib2fNV(index)" );
00416 }
00417 
00418 static void GLAPIENTRY _mesa_noop_VertexAttrib2fvNV( GLuint index, const GLfloat *v )
00419 {
00420    GET_CURRENT_CONTEXT(ctx);
00421    if (index < MAX_NV_VERTEX_PROGRAM_INPUTS) {
00422       ASSIGN_4V(ctx->Current.Attrib[index], v[0], v[1], 0, 1);
00423    }
00424    else
00425       _mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib2fvNV(index)" );
00426 }
00427 
00428 static void GLAPIENTRY _mesa_noop_VertexAttrib3fNV( GLuint index, GLfloat x,
00429                                   GLfloat y, GLfloat z )
00430 {
00431    GET_CURRENT_CONTEXT(ctx);
00432    if (index < MAX_NV_VERTEX_PROGRAM_INPUTS) {
00433       ASSIGN_4V(ctx->Current.Attrib[index], x, y, z, 1);
00434    }
00435    else
00436       _mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib3fNV(index)" );
00437 }
00438 
00439 static void GLAPIENTRY _mesa_noop_VertexAttrib3fvNV( GLuint index, const GLfloat *v )
00440 {
00441    GET_CURRENT_CONTEXT(ctx);
00442    if (index < MAX_NV_VERTEX_PROGRAM_INPUTS) {
00443       ASSIGN_4V(ctx->Current.Attrib[index], v[0], v[1], v[2], 1);
00444    }
00445    else
00446       _mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib3fvNV(index)" );
00447 }
00448 
00449 static void GLAPIENTRY _mesa_noop_VertexAttrib4fNV( GLuint index, GLfloat x,
00450                                   GLfloat y, GLfloat z, GLfloat w )
00451 {
00452    GET_CURRENT_CONTEXT(ctx);
00453    if (index < MAX_NV_VERTEX_PROGRAM_INPUTS) {
00454       ASSIGN_4V(ctx->Current.Attrib[index], x, y, z, w);
00455    }
00456    else
00457       _mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib4fNV(index)" );
00458 }
00459 
00460 static void GLAPIENTRY _mesa_noop_VertexAttrib4fvNV( GLuint index, const GLfloat *v )
00461 {
00462    GET_CURRENT_CONTEXT(ctx);
00463    if (index < MAX_NV_VERTEX_PROGRAM_INPUTS) {
00464       ASSIGN_4V(ctx->Current.Attrib[index], v[0], v[1], v[2], v[3]);
00465    }
00466    else
00467       _mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib4fvNV(index)" );
00468 }
00469 
00470 
00471 
00477 static void GLAPIENTRY _mesa_noop_VertexAttrib1fARB( GLuint index, GLfloat x )
00478 {
00479    GET_CURRENT_CONTEXT(ctx);
00480    if (index < MAX_VERTEX_ATTRIBS) {
00481       ASSIGN_4V(ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index], x, 0, 0, 1);
00482    }
00483    else
00484       _mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib1fARB(index)" );
00485 }
00486 
00487 static void GLAPIENTRY _mesa_noop_VertexAttrib1fvARB( GLuint index, const GLfloat *v )
00488 {
00489    GET_CURRENT_CONTEXT(ctx);
00490    if (index < MAX_VERTEX_ATTRIBS) {
00491       ASSIGN_4V(ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index], v[0], 0, 0, 1);
00492    }
00493    else
00494       _mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib1fvARB(index)" );
00495 }
00496 
00497 static void GLAPIENTRY _mesa_noop_VertexAttrib2fARB( GLuint index, GLfloat x, GLfloat y )
00498 {
00499    GET_CURRENT_CONTEXT(ctx);
00500    if (index < MAX_VERTEX_ATTRIBS) {
00501       ASSIGN_4V(ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index], x, y, 0, 1);
00502    }
00503    else
00504       _mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib2fARB(index)" );
00505 }
00506 
00507 static void GLAPIENTRY _mesa_noop_VertexAttrib2fvARB( GLuint index, const GLfloat *v )
00508 {
00509    GET_CURRENT_CONTEXT(ctx);
00510    if (index < MAX_VERTEX_ATTRIBS) {
00511       ASSIGN_4V(ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index], v[0], v[1], 0, 1);
00512    }
00513    else
00514       _mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib2fvARB(index)" );
00515 }
00516 
00517 static void GLAPIENTRY _mesa_noop_VertexAttrib3fARB( GLuint index, GLfloat x,
00518                                   GLfloat y, GLfloat z )
00519 {
00520    GET_CURRENT_CONTEXT(ctx);
00521    if (index < MAX_VERTEX_ATTRIBS) {
00522       ASSIGN_4V(ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index], x, y, z, 1);
00523    }
00524    else
00525       _mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib3fARB(index)" );
00526 }
00527 
00528 static void GLAPIENTRY _mesa_noop_VertexAttrib3fvARB( GLuint index, const GLfloat *v )
00529 {
00530    GET_CURRENT_CONTEXT(ctx);
00531    if (index < MAX_VERTEX_ATTRIBS) {
00532       ASSIGN_4V(ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index], v[0], v[1], v[2], 1);
00533    }
00534    else
00535       _mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib3fvARB(index)" );
00536 }
00537 
00538 static void GLAPIENTRY _mesa_noop_VertexAttrib4fARB( GLuint index, GLfloat x,
00539                                   GLfloat y, GLfloat z, GLfloat w )
00540 {
00541    GET_CURRENT_CONTEXT(ctx);
00542    if (index < MAX_VERTEX_ATTRIBS) {
00543       ASSIGN_4V(ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index], x, y, z, w);
00544    }
00545    else
00546       _mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib4fARB(index)" );
00547 }
00548 
00549 static void GLAPIENTRY _mesa_noop_VertexAttrib4fvARB( GLuint index, const GLfloat *v )
00550 {
00551    GET_CURRENT_CONTEXT(ctx);
00552    if (index < MAX_VERTEX_ATTRIBS) {
00553       ASSIGN_4V(ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index], v[0], v[1], v[2], v[3]);
00554    }
00555    else
00556       _mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib4fvARB(index)" );
00557 }
00558 
00559 
00560 
00564 void GLAPIENTRY
00565 _mesa_noop_Materialfv( GLenum face, GLenum pname, const GLfloat *params )
00566 {
00567    GET_CURRENT_CONTEXT(ctx);
00568    GLint i, nr;
00569    struct gl_material *mat = &ctx->Light.Material;
00570    GLuint bitmask = _mesa_material_bitmask( ctx, face, pname, ~0,
00571                                             "_mesa_noop_Materialfv" );
00572 
00573    if (ctx->Light.ColorMaterialEnabled)
00574       bitmask &= ~ctx->Light.ColorMaterialBitmask;
00575 
00576    if (bitmask == 0)
00577       return;
00578 
00579    switch (pname) {
00580    case GL_SHININESS: nr = 1; break;
00581    case GL_COLOR_INDEXES: nr = 3; break;
00582    default: nr = 4 ; break;
00583    }
00584 
00585    for (i = 0 ; i < MAT_ATTRIB_MAX ; i++) 
00586       if (bitmask & (1<<i))
00587      COPY_SZ_4V( mat->Attrib[i], nr, params ); 
00588 
00589    _mesa_update_material( ctx, bitmask );
00590 }
00591 
00592 
00596 static void GLAPIENTRY _mesa_noop_Vertex2fv( const GLfloat *v )
00597 {
00598    (void) v;
00599 }
00600 
00601 static void GLAPIENTRY _mesa_noop_Vertex3fv( const GLfloat *v )
00602 {
00603    (void) v;
00604 }
00605 
00606 static void GLAPIENTRY _mesa_noop_Vertex4fv( const GLfloat *v )
00607 {
00608    (void) v;
00609 }
00610 
00611 static void GLAPIENTRY _mesa_noop_Vertex2f( GLfloat a, GLfloat b )
00612 {
00613    (void) a; (void) b;
00614 }
00615 
00616 static void GLAPIENTRY _mesa_noop_Vertex3f( GLfloat a, GLfloat b, GLfloat c )
00617 {
00618    (void) a; (void) b; (void) c;
00619 }
00620 
00621 static void GLAPIENTRY _mesa_noop_Vertex4f( GLfloat a, GLfloat b, GLfloat c, GLfloat d )
00622 {
00623    (void) a; (void) b; (void) c; (void) d;
00624 }
00625 
00626 
00627 #if FEATURE_evaluators
00628 /* Similarly, these have no effect outside begin/end:
00629  */
00630 static void GLAPIENTRY _mesa_noop_EvalCoord1f( GLfloat a )
00631 {
00632    (void) a;
00633 }
00634 
00635 static void GLAPIENTRY _mesa_noop_EvalCoord1fv( const GLfloat *v )
00636 {
00637    (void) v;
00638 }
00639 
00640 static void GLAPIENTRY _mesa_noop_EvalCoord2f( GLfloat a, GLfloat b )
00641 {
00642    (void) a; (void) b;
00643 }
00644 
00645 static void GLAPIENTRY _mesa_noop_EvalCoord2fv( const GLfloat *v )
00646 {
00647    (void) v;
00648 }
00649 
00650 static void GLAPIENTRY _mesa_noop_EvalPoint1( GLint a )
00651 {
00652    (void) a;
00653 }
00654 
00655 static void GLAPIENTRY _mesa_noop_EvalPoint2( GLint a, GLint b )
00656 {
00657    (void) a; (void) b;
00658 }
00659 #endif /* FEATURE_evaluators */
00660 
00661 
00662 /* Begin -- call into driver, should result in the vtxfmt being
00663  * swapped out:
00664  */
00665 static void GLAPIENTRY _mesa_noop_Begin( GLenum mode )
00666 {
00667    (void) mode;
00668 }
00669 
00670 
00671 /* End -- just raise an error
00672  */
00673 static void GLAPIENTRY _mesa_noop_End( void )
00674 {
00675    GET_CURRENT_CONTEXT(ctx);
00676    _mesa_error( ctx, GL_INVALID_OPERATION, "glEnd(no glBegin)" );
00677 }
00678 
00679 
00689 void GLAPIENTRY
00690 _mesa_noop_Rectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 )
00691 {
00692    {
00693       GET_CURRENT_CONTEXT(ctx);
00694       ASSERT_OUTSIDE_BEGIN_END(ctx);
00695    }
00696 
00697    CALL_Begin(GET_DISPATCH(), (GL_QUADS));
00698    CALL_Vertex2f(GET_DISPATCH(), (x1, y1));
00699    CALL_Vertex2f(GET_DISPATCH(), (x2, y1));
00700    CALL_Vertex2f(GET_DISPATCH(), (x2, y2));
00701    CALL_Vertex2f(GET_DISPATCH(), (x1, y2));
00702    CALL_End(GET_DISPATCH(), ());
00703 }
00704 
00705 
00711 static void GLAPIENTRY
00712 _mesa_noop_DrawArrays(GLenum mode, GLint start, GLsizei count)
00713 {
00714    GET_CURRENT_CONTEXT(ctx);
00715    GLint i;
00716 
00717    if (!_mesa_validate_DrawArrays( ctx, mode, start, count ))
00718       return;
00719 
00720    CALL_Begin(GET_DISPATCH(), (mode));
00721    for (i = 0; i < count; i++)
00722        CALL_ArrayElement(GET_DISPATCH(), (start + i));
00723    CALL_End(GET_DISPATCH(), ());
00724 }
00725 
00726 
00727 static void GLAPIENTRY
00728 _mesa_noop_DrawElements(GLenum mode, GLsizei count, GLenum type,
00729                         const GLvoid *indices)
00730 {
00731    GET_CURRENT_CONTEXT(ctx);
00732    GLint i;
00733 
00734    if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices ))
00735       return;
00736 
00737    CALL_Begin(GET_DISPATCH(), (mode));
00738 
00739    switch (type) {
00740    case GL_UNSIGNED_BYTE:
00741       for (i = 0 ; i < count ; i++)
00742       CALL_ArrayElement(GET_DISPATCH(), ( ((GLubyte *)indices)[i] ));
00743       break;
00744    case GL_UNSIGNED_SHORT:
00745       for (i = 0 ; i < count ; i++)
00746       CALL_ArrayElement(GET_DISPATCH(), ( ((GLushort *)indices)[i] ));
00747       break;
00748    case GL_UNSIGNED_INT:
00749       for (i = 0 ; i < count ; i++)
00750       CALL_ArrayElement(GET_DISPATCH(), ( ((GLuint *)indices)[i] ));
00751       break;
00752    default:
00753       _mesa_error( ctx, GL_INVALID_ENUM, "glDrawElements(type)" );
00754       break;
00755    }
00756 
00757    CALL_End(GET_DISPATCH(), ());
00758 }
00759 
00760 
00761 static void GLAPIENTRY
00762 _mesa_noop_DrawRangeElements(GLenum mode,
00763                              GLuint start, GLuint end,
00764                              GLsizei count, GLenum type,
00765                              const GLvoid *indices)
00766 {
00767    GET_CURRENT_CONTEXT(ctx);
00768 
00769    if (_mesa_validate_DrawRangeElements( ctx, mode,
00770                      start, end,
00771                      count, type, indices ))
00772        CALL_DrawElements(GET_DISPATCH(), (mode, count, type, indices));
00773 }
00774 
00775 /*
00776  * Eval Mesh
00777  */
00778 
00789 void GLAPIENTRY
00790 _mesa_noop_EvalMesh1( GLenum mode, GLint i1, GLint i2 )
00791 {
00792    GET_CURRENT_CONTEXT(ctx);
00793    GLint i;
00794    GLfloat u, du;
00795    GLenum prim;
00796 
00797    switch (mode) {
00798    case GL_POINT:
00799       prim = GL_POINTS;
00800       break;
00801    case GL_LINE:
00802       prim = GL_LINE_STRIP;
00803       break;
00804    default:
00805       _mesa_error( ctx, GL_INVALID_ENUM, "glEvalMesh1(mode)" );
00806       return;
00807    }
00808 
00809    /* No effect if vertex maps disabled.
00810     */
00811    if (!ctx->Eval.Map1Vertex4 && 
00812        !ctx->Eval.Map1Vertex3 &&
00813        !(ctx->VertexProgram._Enabled && ctx->Eval.Map1Attrib[VERT_ATTRIB_POS]))
00814       return;
00815 
00816    du = ctx->Eval.MapGrid1du;
00817    u = ctx->Eval.MapGrid1u1 + i1 * du;
00818 
00819    CALL_Begin(GET_DISPATCH(), (prim));
00820    for (i=i1;i<=i2;i++,u+=du) {
00821       CALL_EvalCoord1f(GET_DISPATCH(), (u));
00822    }
00823    CALL_End(GET_DISPATCH(), ());
00824 }
00825 
00826 
00827 
00828 void GLAPIENTRY
00829 _mesa_noop_EvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 )
00830 {
00831    GET_CURRENT_CONTEXT(ctx);
00832    GLfloat u, du, v, dv, v1, u1;
00833    GLint i, j;
00834 
00835    switch (mode) {
00836    case GL_POINT:
00837    case GL_LINE:
00838    case GL_FILL:
00839       break;
00840    default:
00841       _mesa_error( ctx, GL_INVALID_ENUM, "glEvalMesh2(mode)" );
00842       return;
00843    }
00844 
00845    /* No effect if vertex maps disabled.
00846     */
00847    if (!ctx->Eval.Map2Vertex4 && 
00848        !ctx->Eval.Map2Vertex3 &&
00849        !(ctx->VertexProgram._Enabled && ctx->Eval.Map2Attrib[VERT_ATTRIB_POS]))
00850       return;
00851 
00852    du = ctx->Eval.MapGrid2du;
00853    dv = ctx->Eval.MapGrid2dv;
00854    v1 = ctx->Eval.MapGrid2v1 + j1 * dv;
00855    u1 = ctx->Eval.MapGrid2u1 + i1 * du;
00856 
00857    switch (mode) {
00858    case GL_POINT:
00859       CALL_Begin(GET_DISPATCH(), (GL_POINTS));
00860       for (v=v1,j=j1;j<=j2;j++,v+=dv) {
00861      for (u=u1,i=i1;i<=i2;i++,u+=du) {
00862         CALL_EvalCoord2f(GET_DISPATCH(), (u, v));
00863      }
00864       }
00865       CALL_End(GET_DISPATCH(), ());
00866       break;
00867    case GL_LINE:
00868       for (v=v1,j=j1;j<=j2;j++,v+=dv) {
00869      CALL_Begin(GET_DISPATCH(), (GL_LINE_STRIP));
00870      for (u=u1,i=i1;i<=i2;i++,u+=du) {
00871         CALL_EvalCoord2f(GET_DISPATCH(), (u, v));
00872      }
00873      CALL_End(GET_DISPATCH(), ());
00874       }
00875       for (u=u1,i=i1;i<=i2;i++,u+=du) {
00876      CALL_Begin(GET_DISPATCH(), (GL_LINE_STRIP));
00877      for (v=v1,j=j1;j<=j2;j++,v+=dv) {
00878         CALL_EvalCoord2f(GET_DISPATCH(), (u, v));
00879      }
00880      CALL_End(GET_DISPATCH(), ());
00881       }
00882       break;
00883    case GL_FILL:
00884       for (v=v1,j=j1;j<j2;j++,v+=dv) {
00885      CALL_Begin(GET_DISPATCH(), (GL_TRIANGLE_STRIP));
00886      for (u=u1,i=i1;i<=i2;i++,u+=du) {
00887         CALL_EvalCoord2f(GET_DISPATCH(), (u, v));
00888         CALL_EvalCoord2f(GET_DISPATCH(), (u, v+dv));
00889      }
00890      CALL_End(GET_DISPATCH(), ());
00891       }
00892       break;
00893    default:
00894       _mesa_error( ctx, GL_INVALID_ENUM, "glEvalMesh2(mode)" );
00895       return;
00896    }
00897 }
00898 
00899 
00900 
00907 void
00908 _mesa_noop_vtxfmt_init( GLvertexformat *vfmt )
00909 {
00910    vfmt->ArrayElement = _ae_loopback_array_elt;         /* generic helper */
00911    vfmt->Begin = _mesa_noop_Begin;
00912 #if FEATURE_dlist
00913    vfmt->CallList = _mesa_CallList;
00914    vfmt->CallLists = _mesa_CallLists;
00915 #endif
00916    vfmt->Color3f = _mesa_noop_Color3f;
00917    vfmt->Color3fv = _mesa_noop_Color3fv;
00918    vfmt->Color4f = _mesa_noop_Color4f;
00919    vfmt->Color4fv = _mesa_noop_Color4fv;
00920    vfmt->EdgeFlag = _mesa_noop_EdgeFlag;
00921    vfmt->End = _mesa_noop_End;
00922 #if FEATURE_evaluators
00923    vfmt->EvalCoord1f = _mesa_noop_EvalCoord1f;
00924    vfmt->EvalCoord1fv = _mesa_noop_EvalCoord1fv;
00925    vfmt->EvalCoord2f = _mesa_noop_EvalCoord2f;
00926    vfmt->EvalCoord2fv = _mesa_noop_EvalCoord2fv;
00927    vfmt->EvalPoint1 = _mesa_noop_EvalPoint1;
00928    vfmt->EvalPoint2 = _mesa_noop_EvalPoint2;
00929 #endif
00930    vfmt->FogCoordfEXT = _mesa_noop_FogCoordfEXT;
00931    vfmt->FogCoordfvEXT = _mesa_noop_FogCoordfvEXT;
00932    vfmt->Indexf = _mesa_noop_Indexf;
00933    vfmt->Indexfv = _mesa_noop_Indexfv;
00934    vfmt->Materialfv = _mesa_noop_Materialfv;
00935    vfmt->MultiTexCoord1fARB = _mesa_noop_MultiTexCoord1fARB;
00936    vfmt->MultiTexCoord1fvARB = _mesa_noop_MultiTexCoord1fvARB;
00937    vfmt->MultiTexCoord2fARB = _mesa_noop_MultiTexCoord2fARB;
00938    vfmt->MultiTexCoord2fvARB = _mesa_noop_MultiTexCoord2fvARB;
00939    vfmt->MultiTexCoord3fARB = _mesa_noop_MultiTexCoord3fARB;
00940    vfmt->MultiTexCoord3fvARB = _mesa_noop_MultiTexCoord3fvARB;
00941    vfmt->MultiTexCoord4fARB = _mesa_noop_MultiTexCoord4fARB;
00942    vfmt->MultiTexCoord4fvARB = _mesa_noop_MultiTexCoord4fvARB;
00943    vfmt->Normal3f = _mesa_noop_Normal3f;
00944    vfmt->Normal3fv = _mesa_noop_Normal3fv;
00945    vfmt->SecondaryColor3fEXT = _mesa_noop_SecondaryColor3fEXT;
00946    vfmt->SecondaryColor3fvEXT = _mesa_noop_SecondaryColor3fvEXT;
00947    vfmt->TexCoord1f = _mesa_noop_TexCoord1f;
00948    vfmt->TexCoord1fv = _mesa_noop_TexCoord1fv;
00949    vfmt->TexCoord2f = _mesa_noop_TexCoord2f;
00950    vfmt->TexCoord2fv = _mesa_noop_TexCoord2fv;
00951    vfmt->TexCoord3f = _mesa_noop_TexCoord3f;
00952    vfmt->TexCoord3fv = _mesa_noop_TexCoord3fv;
00953    vfmt->TexCoord4f = _mesa_noop_TexCoord4f;
00954    vfmt->TexCoord4fv = _mesa_noop_TexCoord4fv;
00955    vfmt->Vertex2f = _mesa_noop_Vertex2f;
00956    vfmt->Vertex2fv = _mesa_noop_Vertex2fv;
00957    vfmt->Vertex3f = _mesa_noop_Vertex3f;
00958    vfmt->Vertex3fv = _mesa_noop_Vertex3fv;
00959    vfmt->Vertex4f = _mesa_noop_Vertex4f;
00960    vfmt->Vertex4fv = _mesa_noop_Vertex4fv;
00961    vfmt->VertexAttrib1fNV = _mesa_noop_VertexAttrib1fNV;
00962    vfmt->VertexAttrib1fvNV = _mesa_noop_VertexAttrib1fvNV;
00963    vfmt->VertexAttrib2fNV = _mesa_noop_VertexAttrib2fNV;
00964    vfmt->VertexAttrib2fvNV = _mesa_noop_VertexAttrib2fvNV;
00965    vfmt->VertexAttrib3fNV = _mesa_noop_VertexAttrib3fNV;
00966    vfmt->VertexAttrib3fvNV = _mesa_noop_VertexAttrib3fvNV;
00967    vfmt->VertexAttrib4fNV = _mesa_noop_VertexAttrib4fNV;
00968    vfmt->VertexAttrib4fvNV = _mesa_noop_VertexAttrib4fvNV;
00969    vfmt->VertexAttrib1fARB = _mesa_noop_VertexAttrib1fARB;
00970    vfmt->VertexAttrib1fvARB = _mesa_noop_VertexAttrib1fvARB;
00971    vfmt->VertexAttrib2fARB = _mesa_noop_VertexAttrib2fARB;
00972    vfmt->VertexAttrib2fvARB = _mesa_noop_VertexAttrib2fvARB;
00973    vfmt->VertexAttrib3fARB = _mesa_noop_VertexAttrib3fARB;
00974    vfmt->VertexAttrib3fvARB = _mesa_noop_VertexAttrib3fvARB;
00975    vfmt->VertexAttrib4fARB = _mesa_noop_VertexAttrib4fARB;
00976    vfmt->VertexAttrib4fvARB = _mesa_noop_VertexAttrib4fvARB;
00977 
00978    vfmt->Rectf = _mesa_noop_Rectf;
00979 
00980    vfmt->DrawArrays = _mesa_noop_DrawArrays;
00981    vfmt->DrawElements = _mesa_noop_DrawElements;
00982    vfmt->DrawRangeElements = _mesa_noop_DrawRangeElements;
00983    vfmt->EvalMesh1 = _mesa_noop_EvalMesh1;
00984    vfmt->EvalMesh2 = _mesa_noop_EvalMesh2;
00985 }

Generated on Sun May 27 2012 04:20:10 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.