2 * Mesa 3-D graphics library
5 * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
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:
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
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.
28 #include "api_validate.h"
29 #include "api_arrayelt.h"
38 /* In states where certain vertex components are required for t&l or
39 * rasterization, we still need to keep track of the current values.
40 * These functions provide this service by keeping uptodate the
41 * 'ctx->Current' struct for all data elements not included in the
42 * currently enabled hardware vertex.
43 * I.e. these functions would typically be used when outside of glBegin/End.
47 void GLAPIENTRY
_mesa_noop_EdgeFlag( GLboolean b
)
49 GET_CURRENT_CONTEXT(ctx
);
50 ctx
->Current
.EdgeFlag
= b
;
53 void GLAPIENTRY
_mesa_noop_EdgeFlagv( const GLboolean
*b
)
55 GET_CURRENT_CONTEXT(ctx
);
56 ctx
->Current
.EdgeFlag
= *b
;
59 void GLAPIENTRY
_mesa_noop_Indexf( GLfloat f
)
61 GET_CURRENT_CONTEXT(ctx
);
62 ctx
->Current
.Index
= f
;
65 void GLAPIENTRY
_mesa_noop_Indexfv( const GLfloat
*v
)
67 GET_CURRENT_CONTEXT(ctx
);
68 ctx
->Current
.Index
= *v
;
71 void GLAPIENTRY
_mesa_noop_FogCoordfEXT( GLfloat a
)
73 GET_CURRENT_CONTEXT(ctx
);
74 GLfloat
*dest
= ctx
->Current
.Attrib
[VERT_ATTRIB_FOG
];
81 void GLAPIENTRY
_mesa_noop_FogCoordfvEXT( const GLfloat
*v
)
83 GET_CURRENT_CONTEXT(ctx
);
84 GLfloat
*dest
= ctx
->Current
.Attrib
[VERT_ATTRIB_NORMAL
];
91 void GLAPIENTRY
_mesa_noop_Normal3f( GLfloat a
, GLfloat b
, GLfloat c
)
93 GET_CURRENT_CONTEXT(ctx
);
94 GLfloat
*dest
= ctx
->Current
.Attrib
[VERT_ATTRIB_NORMAL
];
101 void GLAPIENTRY
_mesa_noop_Normal3fv( const GLfloat
*v
)
103 GET_CURRENT_CONTEXT(ctx
);
104 GLfloat
*dest
= ctx
->Current
.Attrib
[VERT_ATTRIB_NORMAL
];
111 void GLAPIENTRY
_mesa_noop_Color4f( GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
113 GET_CURRENT_CONTEXT(ctx
);
114 GLfloat
*color
= ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
];
121 void GLAPIENTRY
_mesa_noop_Color4fv( const GLfloat
*v
)
123 GET_CURRENT_CONTEXT(ctx
);
124 GLfloat
*color
= ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
];
131 void GLAPIENTRY
_mesa_noop_Color3f( GLfloat a
, GLfloat b
, GLfloat c
)
133 GET_CURRENT_CONTEXT(ctx
);
134 GLfloat
*color
= ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
];
141 void GLAPIENTRY
_mesa_noop_Color3fv( const GLfloat
*v
)
143 GET_CURRENT_CONTEXT(ctx
);
144 GLfloat
*color
= ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR0
];
151 void GLAPIENTRY
_mesa_noop_MultiTexCoord1fARB( GLenum target
, GLfloat a
)
153 GET_CURRENT_CONTEXT(ctx
);
154 GLuint unit
= target
- GL_TEXTURE0_ARB
;
156 /* unit is unsigned -- cannot be less than zero.
158 if (unit
< MAX_TEXTURE_COORD_UNITS
)
160 GLfloat
*dest
= ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ unit
];
168 void GLAPIENTRY
_mesa_noop_MultiTexCoord1fvARB( GLenum target
, const GLfloat
*v
)
170 GET_CURRENT_CONTEXT(ctx
);
171 GLuint unit
= target
- GL_TEXTURE0_ARB
;
173 /* unit is unsigned -- cannot be less than zero.
175 if (unit
< MAX_TEXTURE_COORD_UNITS
)
177 GLfloat
*dest
= ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ unit
];
185 void GLAPIENTRY
_mesa_noop_MultiTexCoord2fARB( GLenum target
, GLfloat a
, GLfloat b
)
187 GET_CURRENT_CONTEXT(ctx
);
188 GLuint unit
= target
- GL_TEXTURE0_ARB
;
190 /* unit is unsigned -- cannot be less than zero.
192 if (unit
< MAX_TEXTURE_COORD_UNITS
)
194 GLfloat
*dest
= ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ unit
];
202 void GLAPIENTRY
_mesa_noop_MultiTexCoord2fvARB( GLenum target
, const GLfloat
*v
)
204 GET_CURRENT_CONTEXT(ctx
);
205 GLuint unit
= target
- GL_TEXTURE0_ARB
;
207 /* unit is unsigned -- cannot be less than zero.
209 if (unit
< MAX_TEXTURE_COORD_UNITS
)
211 GLfloat
*dest
= ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ unit
];
219 void GLAPIENTRY
_mesa_noop_MultiTexCoord3fARB( GLenum target
, GLfloat a
, GLfloat b
, GLfloat c
)
221 GET_CURRENT_CONTEXT(ctx
);
222 GLuint unit
= target
- GL_TEXTURE0_ARB
;
224 /* unit is unsigned -- cannot be less than zero.
226 if (unit
< MAX_TEXTURE_COORD_UNITS
)
228 GLfloat
*dest
= ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ unit
];
236 void GLAPIENTRY
_mesa_noop_MultiTexCoord3fvARB( GLenum target
, const GLfloat
*v
)
238 GET_CURRENT_CONTEXT(ctx
);
239 GLuint unit
= target
- GL_TEXTURE0_ARB
;
241 /* unit is unsigned -- cannot be less than zero.
243 if (unit
< MAX_TEXTURE_COORD_UNITS
)
245 GLfloat
*dest
= ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ unit
];
253 void GLAPIENTRY
_mesa_noop_MultiTexCoord4fARB( GLenum target
, GLfloat a
, GLfloat b
,
254 GLfloat c
, GLfloat d
)
256 GET_CURRENT_CONTEXT(ctx
);
257 GLuint unit
= target
- GL_TEXTURE0_ARB
;
259 /* unit is unsigned -- cannot be less than zero.
261 if (unit
< MAX_TEXTURE_COORD_UNITS
)
263 GLfloat
*dest
= ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ unit
];
271 void GLAPIENTRY
_mesa_noop_MultiTexCoord4fvARB( GLenum target
, const GLfloat
*v
)
273 GET_CURRENT_CONTEXT(ctx
);
274 GLuint unit
= target
- GL_TEXTURE0_ARB
;
276 /* unit is unsigned -- cannot be less than zero.
278 if (unit
< MAX_TEXTURE_COORD_UNITS
)
280 GLfloat
*dest
= ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
+ unit
];
288 void GLAPIENTRY
_mesa_noop_SecondaryColor3fEXT( GLfloat a
, GLfloat b
, GLfloat c
)
290 GET_CURRENT_CONTEXT(ctx
);
291 GLfloat
*color
= ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
];
298 void GLAPIENTRY
_mesa_noop_SecondaryColor3fvEXT( const GLfloat
*v
)
300 GET_CURRENT_CONTEXT(ctx
);
301 GLfloat
*color
= ctx
->Current
.Attrib
[VERT_ATTRIB_COLOR1
];
308 void GLAPIENTRY
_mesa_noop_TexCoord1f( GLfloat a
)
310 GET_CURRENT_CONTEXT(ctx
);
311 GLfloat
*dest
= ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
];
318 void GLAPIENTRY
_mesa_noop_TexCoord1fv( const GLfloat
*v
)
320 GET_CURRENT_CONTEXT(ctx
);
321 GLfloat
*dest
= ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
];
328 void GLAPIENTRY
_mesa_noop_TexCoord2f( GLfloat a
, GLfloat b
)
330 GET_CURRENT_CONTEXT(ctx
);
331 GLfloat
*dest
= ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
];
338 void GLAPIENTRY
_mesa_noop_TexCoord2fv( const GLfloat
*v
)
340 GET_CURRENT_CONTEXT(ctx
);
341 GLfloat
*dest
= ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
];
348 void GLAPIENTRY
_mesa_noop_TexCoord3f( GLfloat a
, GLfloat b
, GLfloat c
)
350 GET_CURRENT_CONTEXT(ctx
);
351 GLfloat
*dest
= ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
];
358 void GLAPIENTRY
_mesa_noop_TexCoord3fv( const GLfloat
*v
)
360 GET_CURRENT_CONTEXT(ctx
);
361 GLfloat
*dest
= ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
];
368 void GLAPIENTRY
_mesa_noop_TexCoord4f( GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
370 GET_CURRENT_CONTEXT(ctx
);
371 GLfloat
*dest
= ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
];
378 void GLAPIENTRY
_mesa_noop_TexCoord4fv( const GLfloat
*v
)
380 GET_CURRENT_CONTEXT(ctx
);
381 GLfloat
*dest
= ctx
->Current
.Attrib
[VERT_ATTRIB_TEX0
];
390 void GLAPIENTRY
_mesa_noop_VertexAttrib1fNV( GLuint index
, GLfloat x
)
392 GET_CURRENT_CONTEXT(ctx
);
393 if (index
< VERT_ATTRIB_MAX
) {
394 ASSIGN_4V(ctx
->Current
.Attrib
[index
], x
, 0, 0, 1);
397 _mesa_error( ctx
, GL_INVALID_ENUM
, "glVertexAttrib1f" );
400 void GLAPIENTRY
_mesa_noop_VertexAttrib1fvNV( GLuint index
, const GLfloat
*v
)
402 GET_CURRENT_CONTEXT(ctx
);
403 if (index
< VERT_ATTRIB_MAX
) {
404 ASSIGN_4V(ctx
->Current
.Attrib
[index
], v
[0], 0, 0, 1);
407 _mesa_error( ctx
, GL_INVALID_ENUM
, "glVertexAttrib1fv" );
410 void GLAPIENTRY
_mesa_noop_VertexAttrib2fNV( GLuint index
, GLfloat x
, GLfloat y
)
412 GET_CURRENT_CONTEXT(ctx
);
413 if (index
< VERT_ATTRIB_MAX
) {
414 ASSIGN_4V(ctx
->Current
.Attrib
[index
], x
, y
, 0, 1);
417 _mesa_error( ctx
, GL_INVALID_ENUM
, "glVertexAttrib2f" );
420 void GLAPIENTRY
_mesa_noop_VertexAttrib2fvNV( GLuint index
, const GLfloat
*v
)
422 GET_CURRENT_CONTEXT(ctx
);
423 if (index
< VERT_ATTRIB_MAX
) {
424 ASSIGN_4V(ctx
->Current
.Attrib
[index
], v
[0], v
[1], 0, 1);
427 _mesa_error( ctx
, GL_INVALID_ENUM
, "glVertexAttrib2fv" );
430 void GLAPIENTRY
_mesa_noop_VertexAttrib3fNV( GLuint index
, GLfloat x
,
431 GLfloat y
, GLfloat z
)
433 GET_CURRENT_CONTEXT(ctx
);
434 if (index
< VERT_ATTRIB_MAX
) {
435 ASSIGN_4V(ctx
->Current
.Attrib
[index
], x
, y
, z
, 1);
438 _mesa_error( ctx
, GL_INVALID_ENUM
, "glVertexAttrib3f" );
441 void GLAPIENTRY
_mesa_noop_VertexAttrib3fvNV( GLuint index
, const GLfloat
*v
)
443 GET_CURRENT_CONTEXT(ctx
);
444 if (index
< VERT_ATTRIB_MAX
) {
445 ASSIGN_4V(ctx
->Current
.Attrib
[index
], v
[0], v
[1], v
[2], 1);
448 _mesa_error( ctx
, GL_INVALID_ENUM
, "glVertexAttrib3fv" );
451 void GLAPIENTRY
_mesa_noop_VertexAttrib4fNV( GLuint index
, GLfloat x
,
452 GLfloat y
, GLfloat z
, GLfloat w
)
454 GET_CURRENT_CONTEXT(ctx
);
455 if (index
< VERT_ATTRIB_MAX
) {
456 ASSIGN_4V(ctx
->Current
.Attrib
[index
], x
, y
, z
, w
);
459 _mesa_error( ctx
, GL_INVALID_ENUM
, "glVertexAttrib4f" );
462 void GLAPIENTRY
_mesa_noop_VertexAttrib4fvNV( GLuint index
, const GLfloat
*v
)
464 GET_CURRENT_CONTEXT(ctx
);
465 if (index
< VERT_ATTRIB_MAX
) {
466 ASSIGN_4V(ctx
->Current
.Attrib
[index
], v
[0], v
[1], v
[2], v
[3]);
469 _mesa_error( ctx
, GL_INVALID_ENUM
, "glVertexAttrib4fv" );
474 void GLAPIENTRY
_mesa_noop_Materialfv( GLenum face
, GLenum pname
, const GLfloat
*params
)
476 GET_CURRENT_CONTEXT(ctx
);
478 struct gl_material
*mat
= &ctx
->Light
.Material
;
479 GLuint bitmask
= _mesa_material_bitmask( ctx
, face
, pname
, ~0,
480 "_mesa_noop_Materialfv" );
482 if (ctx
->Light
.ColorMaterialEnabled
)
483 bitmask
&= ~ctx
->Light
.ColorMaterialBitmask
;
489 case GL_SHININESS
: nr
= 1; break;
490 case GL_COLOR_INDEXES
: nr
= 3; break;
491 default: nr
= 4 ; break;
494 for (i
= 0 ; i
< MAT_ATTRIB_MAX
; i
++)
495 if (bitmask
& (1<<i
))
496 COPY_SZ_4V( mat
->Attrib
[i
], nr
, params
);
498 _mesa_update_material( ctx
, bitmask
);
501 /* These really are noops outside begin/end:
503 void GLAPIENTRY
_mesa_noop_Vertex2fv( const GLfloat
*v
)
508 void GLAPIENTRY
_mesa_noop_Vertex3fv( const GLfloat
*v
)
513 void GLAPIENTRY
_mesa_noop_Vertex4fv( const GLfloat
*v
)
518 void GLAPIENTRY
_mesa_noop_Vertex2f( GLfloat a
, GLfloat b
)
523 void GLAPIENTRY
_mesa_noop_Vertex3f( GLfloat a
, GLfloat b
, GLfloat c
)
525 (void) a
; (void) b
; (void) c
;
528 void GLAPIENTRY
_mesa_noop_Vertex4f( GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
530 (void) a
; (void) b
; (void) c
; (void) d
;
533 /* Similarly, these have no effect outside begin/end:
535 void GLAPIENTRY
_mesa_noop_EvalCoord1f( GLfloat a
)
540 void GLAPIENTRY
_mesa_noop_EvalCoord1fv( const GLfloat
*v
)
545 void GLAPIENTRY
_mesa_noop_EvalCoord2f( GLfloat a
, GLfloat b
)
550 void GLAPIENTRY
_mesa_noop_EvalCoord2fv( const GLfloat
*v
)
555 void GLAPIENTRY
_mesa_noop_EvalPoint1( GLint a
)
560 void GLAPIENTRY
_mesa_noop_EvalPoint2( GLint a
, GLint b
)
566 /* Begin -- call into driver, should result in the vtxfmt being
569 void GLAPIENTRY
_mesa_noop_Begin( GLenum mode
)
575 /* End -- just raise an error
577 void GLAPIENTRY
_mesa_noop_End( void )
579 GET_CURRENT_CONTEXT(ctx
);
580 _mesa_error( ctx
, GL_INVALID_OPERATION
, "glEnd" );
584 /* Execute a glRectf() function. This is not suitable for GL_COMPILE
585 * modes (as the test for outside begin/end is not compiled),
586 * but may be useful for drivers in circumstances which exclude
587 * display list interactions.
589 * (None of the functions in this file are suitable for GL_COMPILE
592 void GLAPIENTRY
_mesa_noop_Rectf( GLfloat x1
, GLfloat y1
, GLfloat x2
, GLfloat y2
)
595 GET_CURRENT_CONTEXT(ctx
);
596 ASSERT_OUTSIDE_BEGIN_END(ctx
);
599 GL_CALL(Begin
)( GL_QUADS
);
600 GL_CALL(Vertex2f
)( x1
, y1
);
601 GL_CALL(Vertex2f
)( x2
, y1
);
602 GL_CALL(Vertex2f
)( x2
, y2
);
603 GL_CALL(Vertex2f
)( x1
, y2
);
608 /* Some very basic support for arrays. Drivers without explicit array
609 * support can hook these in, but still need to supply an array-elt
612 void GLAPIENTRY
_mesa_noop_DrawArrays(GLenum mode
, GLint start
, GLsizei count
)
614 GET_CURRENT_CONTEXT(ctx
);
617 if (!_mesa_validate_DrawArrays( ctx
, mode
, start
, count
))
620 GL_CALL(Begin
)(mode
);
621 for (i
= 0; i
< count
; i
++)
622 GL_CALL(ArrayElement
)(start
+ i
);
627 void GLAPIENTRY
_mesa_noop_DrawElements(GLenum mode
, GLsizei count
, GLenum type
,
628 const GLvoid
*indices
)
630 GET_CURRENT_CONTEXT(ctx
);
633 if (!_mesa_validate_DrawElements( ctx
, mode
, count
, type
, indices
))
636 GL_CALL(Begin
)(mode
);
639 case GL_UNSIGNED_BYTE
:
640 for (i
= 0 ; i
< count
; i
++)
641 GL_CALL(ArrayElement
)( ((GLubyte
*)indices
)[i
] );
643 case GL_UNSIGNED_SHORT
:
644 for (i
= 0 ; i
< count
; i
++)
645 GL_CALL(ArrayElement
)( ((GLushort
*)indices
)[i
] );
647 case GL_UNSIGNED_INT
:
648 for (i
= 0 ; i
< count
; i
++)
649 GL_CALL(ArrayElement
)( ((GLuint
*)indices
)[i
] );
652 _mesa_error( ctx
, GL_INVALID_ENUM
, "glDrawElements(type)" );
659 void GLAPIENTRY
_mesa_noop_DrawRangeElements(GLenum mode
,
660 GLuint start
, GLuint end
,
661 GLsizei count
, GLenum type
,
662 const GLvoid
*indices
)
664 GET_CURRENT_CONTEXT(ctx
);
666 if (_mesa_validate_DrawRangeElements( ctx
, mode
,
668 count
, type
, indices
))
669 GL_CALL(DrawElements
)( mode
, count
, type
, indices
);
676 /* KW: If are compiling, we don't know whether eval will produce a
677 * vertex when it is run in the future. If this is pure immediate
678 * mode, eval is a noop if neither vertex map is enabled.
680 * Thus we need to have a check in the display list code or
681 * elsewhere for eval(1,2) vertices in the case where
682 * map(1,2)_vertex is disabled, and to purge those vertices from
685 void GLAPIENTRY
_mesa_noop_EvalMesh1( GLenum mode
, GLint i1
, GLint i2
)
687 GET_CURRENT_CONTEXT(ctx
);
697 prim
= GL_LINE_STRIP
;
700 _mesa_error( ctx
, GL_INVALID_ENUM
, "glEvalMesh1(mode)" );
704 /* No effect if vertex maps disabled.
706 if (!ctx
->Eval
.Map1Vertex4
&&
707 !ctx
->Eval
.Map1Vertex3
&&
708 !(ctx
->VertexProgram
._Enabled
&& ctx
->Eval
.Map1Attrib
[VERT_ATTRIB_POS
]))
711 du
= ctx
->Eval
.MapGrid1du
;
712 u
= ctx
->Eval
.MapGrid1u1
+ i1
* du
;
714 GL_CALL(Begin
)( prim
);
715 for (i
=i1
;i
<=i2
;i
++,u
+=du
) {
716 GL_CALL(EvalCoord1f
)( u
);
723 void GLAPIENTRY
_mesa_noop_EvalMesh2( GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
725 GET_CURRENT_CONTEXT(ctx
);
726 GLfloat u
, du
, v
, dv
, v1
, u1
;
735 _mesa_error( ctx
, GL_INVALID_ENUM
, "glEvalMesh2(mode)" );
739 /* No effect if vertex maps disabled.
741 if (!ctx
->Eval
.Map2Vertex4
&&
742 !ctx
->Eval
.Map2Vertex3
&&
743 !(ctx
->VertexProgram
._Enabled
&& ctx
->Eval
.Map2Attrib
[VERT_ATTRIB_POS
]))
746 du
= ctx
->Eval
.MapGrid2du
;
747 dv
= ctx
->Eval
.MapGrid2dv
;
748 v1
= ctx
->Eval
.MapGrid2v1
+ j1
* dv
;
749 u1
= ctx
->Eval
.MapGrid2u1
+ i1
* du
;
753 GL_CALL(Begin
)( GL_POINTS
);
754 for (v
=v1
,j
=j1
;j
<=j2
;j
++,v
+=dv
) {
755 for (u
=u1
,i
=i1
;i
<=i2
;i
++,u
+=du
) {
756 GL_CALL(EvalCoord2f
)(u
, v
);
762 for (v
=v1
,j
=j1
;j
<=j2
;j
++,v
+=dv
) {
763 GL_CALL(Begin
)( GL_LINE_STRIP
);
764 for (u
=u1
,i
=i1
;i
<=i2
;i
++,u
+=du
) {
765 GL_CALL(EvalCoord2f
)(u
, v
);
769 for (u
=u1
,i
=i1
;i
<=i2
;i
++,u
+=du
) {
770 GL_CALL(Begin
)( GL_LINE_STRIP
);
771 for (v
=v1
,j
=j1
;j
<=j2
;j
++,v
+=dv
) {
772 GL_CALL(EvalCoord2f
)(u
, v
);
778 for (v
=v1
,j
=j1
;j
<j2
;j
++,v
+=dv
) {
779 GL_CALL(Begin
)( GL_TRIANGLE_STRIP
);
780 for (u
=u1
,i
=i1
;i
<=i2
;i
++,u
+=du
) {
781 GL_CALL(EvalCoord2f
)(u
, v
);
782 GL_CALL(EvalCoord2f
)(u
, v
+dv
);
788 _mesa_error( ctx
, GL_INVALID_ENUM
, "glEvalMesh2(mode)" );
795 /* Build a vertexformat full of things to use outside begin/end pairs.
797 * TODO -- build a whole dispatch table for this purpose, and likewise
798 * for inside begin/end.
800 void _mesa_noop_vtxfmt_init( GLvertexformat
*vfmt
)
802 vfmt
->ArrayElement
= _ae_loopback_array_elt
; /* generic helper */
803 vfmt
->Begin
= _mesa_noop_Begin
;
804 vfmt
->CallList
= _mesa_CallList
;
805 vfmt
->CallLists
= _mesa_CallLists
;
806 vfmt
->Color3f
= _mesa_noop_Color3f
;
807 vfmt
->Color3fv
= _mesa_noop_Color3fv
;
808 vfmt
->Color4f
= _mesa_noop_Color4f
;
809 vfmt
->Color4fv
= _mesa_noop_Color4fv
;
810 vfmt
->EdgeFlag
= _mesa_noop_EdgeFlag
;
811 vfmt
->EdgeFlagv
= _mesa_noop_EdgeFlagv
;
812 vfmt
->End
= _mesa_noop_End
;
813 vfmt
->EvalCoord1f
= _mesa_noop_EvalCoord1f
;
814 vfmt
->EvalCoord1fv
= _mesa_noop_EvalCoord1fv
;
815 vfmt
->EvalCoord2f
= _mesa_noop_EvalCoord2f
;
816 vfmt
->EvalCoord2fv
= _mesa_noop_EvalCoord2fv
;
817 vfmt
->EvalPoint1
= _mesa_noop_EvalPoint1
;
818 vfmt
->EvalPoint2
= _mesa_noop_EvalPoint2
;
819 vfmt
->FogCoordfEXT
= _mesa_noop_FogCoordfEXT
;
820 vfmt
->FogCoordfvEXT
= _mesa_noop_FogCoordfvEXT
;
821 vfmt
->Indexf
= _mesa_noop_Indexf
;
822 vfmt
->Indexfv
= _mesa_noop_Indexfv
;
823 vfmt
->Materialfv
= _mesa_noop_Materialfv
;
824 vfmt
->MultiTexCoord1fARB
= _mesa_noop_MultiTexCoord1fARB
;
825 vfmt
->MultiTexCoord1fvARB
= _mesa_noop_MultiTexCoord1fvARB
;
826 vfmt
->MultiTexCoord2fARB
= _mesa_noop_MultiTexCoord2fARB
;
827 vfmt
->MultiTexCoord2fvARB
= _mesa_noop_MultiTexCoord2fvARB
;
828 vfmt
->MultiTexCoord3fARB
= _mesa_noop_MultiTexCoord3fARB
;
829 vfmt
->MultiTexCoord3fvARB
= _mesa_noop_MultiTexCoord3fvARB
;
830 vfmt
->MultiTexCoord4fARB
= _mesa_noop_MultiTexCoord4fARB
;
831 vfmt
->MultiTexCoord4fvARB
= _mesa_noop_MultiTexCoord4fvARB
;
832 vfmt
->Normal3f
= _mesa_noop_Normal3f
;
833 vfmt
->Normal3fv
= _mesa_noop_Normal3fv
;
834 vfmt
->SecondaryColor3fEXT
= _mesa_noop_SecondaryColor3fEXT
;
835 vfmt
->SecondaryColor3fvEXT
= _mesa_noop_SecondaryColor3fvEXT
;
836 vfmt
->TexCoord1f
= _mesa_noop_TexCoord1f
;
837 vfmt
->TexCoord1fv
= _mesa_noop_TexCoord1fv
;
838 vfmt
->TexCoord2f
= _mesa_noop_TexCoord2f
;
839 vfmt
->TexCoord2fv
= _mesa_noop_TexCoord2fv
;
840 vfmt
->TexCoord3f
= _mesa_noop_TexCoord3f
;
841 vfmt
->TexCoord3fv
= _mesa_noop_TexCoord3fv
;
842 vfmt
->TexCoord4f
= _mesa_noop_TexCoord4f
;
843 vfmt
->TexCoord4fv
= _mesa_noop_TexCoord4fv
;
844 vfmt
->Vertex2f
= _mesa_noop_Vertex2f
;
845 vfmt
->Vertex2fv
= _mesa_noop_Vertex2fv
;
846 vfmt
->Vertex3f
= _mesa_noop_Vertex3f
;
847 vfmt
->Vertex3fv
= _mesa_noop_Vertex3fv
;
848 vfmt
->Vertex4f
= _mesa_noop_Vertex4f
;
849 vfmt
->Vertex4fv
= _mesa_noop_Vertex4fv
;
850 vfmt
->VertexAttrib1fNV
= _mesa_noop_VertexAttrib1fNV
;
851 vfmt
->VertexAttrib1fvNV
= _mesa_noop_VertexAttrib1fvNV
;
852 vfmt
->VertexAttrib2fNV
= _mesa_noop_VertexAttrib2fNV
;
853 vfmt
->VertexAttrib2fvNV
= _mesa_noop_VertexAttrib2fvNV
;
854 vfmt
->VertexAttrib3fNV
= _mesa_noop_VertexAttrib3fNV
;
855 vfmt
->VertexAttrib3fvNV
= _mesa_noop_VertexAttrib3fvNV
;
856 vfmt
->VertexAttrib4fNV
= _mesa_noop_VertexAttrib4fNV
;
857 vfmt
->VertexAttrib4fvNV
= _mesa_noop_VertexAttrib4fvNV
;
859 vfmt
->Rectf
= _mesa_noop_Rectf
;
861 vfmt
->DrawArrays
= _mesa_noop_DrawArrays
;
862 vfmt
->DrawElements
= _mesa_noop_DrawElements
;
863 vfmt
->DrawRangeElements
= _mesa_noop_DrawRangeElements
;
864 vfmt
->EvalMesh1
= _mesa_noop_EvalMesh1
;
865 vfmt
->EvalMesh2
= _mesa_noop_EvalMesh2
;