1 /* $Id: lines.c,v 1.8 2000/02/27 20:38:15 keithw Exp $ */
4 * Mesa 3-D graphics library
7 * Copyright (C) 1999 Brian Paul All Rights Reserved.
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the "Software"),
11 * to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
16 * The above copyright notice and this permission notice shall be included
17 * in all copies or substantial portions of the Software.
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
23 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
47 _mesa_LineWidth( GLfloat width
)
49 GET_CURRENT_CONTEXT(ctx
);
51 gl_error( ctx
, GL_INVALID_VALUE
, "glLineWidth" );
54 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx
, "glLineWidth");
56 if (ctx
->Line
.Width
!= width
) {
57 ctx
->Line
.Width
= width
;
58 ctx
->TriangleCaps
&= ~DD_LINE_WIDTH
;
59 if (width
!= 1.0) ctx
->TriangleCaps
|= DD_LINE_WIDTH
;
60 ctx
->NewState
|= NEW_RASTER_OPS
;
67 _mesa_LineStipple( GLint factor
, GLushort pattern
)
69 GET_CURRENT_CONTEXT(ctx
);
70 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx
, "glLineStipple");
71 ctx
->Line
.StippleFactor
= CLAMP( factor
, 1, 256 );
72 ctx
->Line
.StipplePattern
= pattern
;
73 ctx
->NewState
|= NEW_RASTER_OPS
;
75 if (ctx
->Driver
.LineStipple
)
76 ctx
->Driver
.LineStipple( ctx
, factor
, pattern
);
81 /**********************************************************************/
82 /***** Rasterization *****/
83 /**********************************************************************/
87 * There are 4 pairs (RGBA, CI) of line drawing functions:
88 * 1. simple: width=1 and no special rasterization functions (fastest)
89 * 2. flat: width=1, non-stippled, flat-shaded, any raster operations
90 * 3. smooth: width=1, non-stippled, smooth-shaded, any raster operations
91 * 4. general: any other kind of line (slowest)
96 * All line drawing functions have the same arguments:
97 * v1, v2 - indexes of first and second endpoints into vertex buffer arrays
98 * pv - provoking vertex: which vertex color/index to use for flat shading.
106 #if MAX_WIDTH > MAX_HEIGHT
107 # define MAXPOINTS MAX_WIDTH
109 # define MAXPOINTS MAX_HEIGHT
113 /* Flat, color index line */
114 static void flat_ci_line( GLcontext
*ctx
,
115 GLuint vert0
, GLuint vert1
, GLuint pvert
)
118 GLint
*pbx
= ctx
->PB
->x
;
119 GLint
*pby
= ctx
->PB
->y
;
120 PB_SET_INDEX( ctx
, ctx
->PB
, ctx
->VB
->IndexPtr
->data
[pvert
] );
121 count
= ctx
->PB
->count
;
130 #include "linetemp.h"
132 ctx
->PB
->count
= count
;
138 /* Flat, color index line with Z interpolation/testing */
139 static void flat_ci_z_line( GLcontext
*ctx
,
140 GLuint vert0
, GLuint vert1
, GLuint pvert
)
143 GLint
*pbx
= ctx
->PB
->x
;
144 GLint
*pby
= ctx
->PB
->y
;
145 GLdepth
*pbz
= ctx
->PB
->z
;
146 PB_SET_INDEX( ctx
, ctx
->PB
, ctx
->VB
->IndexPtr
->data
[pvert
] );
147 count
= ctx
->PB
->count
;
158 #include "linetemp.h"
160 ctx
->PB
->count
= count
;
166 /* Flat-shaded, RGBA line */
167 static void flat_rgba_line( GLcontext
*ctx
,
168 GLuint vert0
, GLuint vert1
, GLuint pvert
)
171 GLint
*pbx
= ctx
->PB
->x
;
172 GLint
*pby
= ctx
->PB
->y
;
173 GLubyte
*color
= ctx
->VB
->ColorPtr
->data
[pvert
];
174 PB_SET_COLOR( ctx
, ctx
->PB
, color
[0], color
[1], color
[2], color
[3] );
175 count
= ctx
->PB
->count
;
184 #include "linetemp.h"
186 ctx
->PB
->count
= count
;
192 /* Flat-shaded, RGBA line with Z interpolation/testing */
193 static void flat_rgba_z_line( GLcontext
*ctx
,
194 GLuint vert0
, GLuint vert1
, GLuint pvert
)
197 GLint
*pbx
= ctx
->PB
->x
;
198 GLint
*pby
= ctx
->PB
->y
;
199 GLdepth
*pbz
= ctx
->PB
->z
;
200 GLubyte
*color
= ctx
->VB
->ColorPtr
->data
[pvert
];
201 PB_SET_COLOR( ctx
, ctx
->PB
, color
[0], color
[1], color
[2], color
[3] );
202 count
= ctx
->PB
->count
;
213 #include "linetemp.h"
215 ctx
->PB
->count
= count
;
221 /* Smooth shaded, color index line */
222 static void smooth_ci_line( GLcontext
*ctx
,
223 GLuint vert0
, GLuint vert1
, GLuint pvert
)
225 GLint count
= ctx
->PB
->count
;
226 GLint
*pbx
= ctx
->PB
->x
;
227 GLint
*pby
= ctx
->PB
->y
;
228 GLuint
*pbi
= ctx
->PB
->i
;
232 #define INTERP_INDEX 1
240 #include "linetemp.h"
242 ctx
->PB
->count
= count
;
248 /* Smooth shaded, color index line with Z interpolation/testing */
249 static void smooth_ci_z_line( GLcontext
*ctx
,
250 GLuint vert0
, GLuint vert1
, GLuint pvert
)
252 GLint count
= ctx
->PB
->count
;
253 GLint
*pbx
= ctx
->PB
->x
;
254 GLint
*pby
= ctx
->PB
->y
;
255 GLdepth
*pbz
= ctx
->PB
->z
;
256 GLuint
*pbi
= ctx
->PB
->i
;
261 #define INTERP_INDEX 1
270 #include "linetemp.h"
272 ctx
->PB
->count
= count
;
278 /* Smooth-shaded, RGBA line */
279 static void smooth_rgba_line( GLcontext
*ctx
,
280 GLuint vert0
, GLuint vert1
, GLuint pvert
)
282 GLint count
= ctx
->PB
->count
;
283 GLint
*pbx
= ctx
->PB
->x
;
284 GLint
*pby
= ctx
->PB
->y
;
285 GLubyte (*pbrgba
)[4] = ctx
->PB
->rgba
;
290 #define INTERP_ALPHA 1
295 pbrgba[count][RCOMP] = FixedToInt(r0); \
296 pbrgba[count][GCOMP] = FixedToInt(g0); \
297 pbrgba[count][BCOMP] = FixedToInt(b0); \
298 pbrgba[count][ACOMP] = FixedToInt(a0); \
301 #include "linetemp.h"
303 ctx
->PB
->count
= count
;
309 /* Smooth-shaded, RGBA line with Z interpolation/testing */
310 static void smooth_rgba_z_line( GLcontext
*ctx
,
311 GLuint vert0
, GLuint vert1
, GLuint pvert
)
313 GLint count
= ctx
->PB
->count
;
314 GLint
*pbx
= ctx
->PB
->x
;
315 GLint
*pby
= ctx
->PB
->y
;
316 GLdepth
*pbz
= ctx
->PB
->z
;
317 GLubyte (*pbrgba
)[4] = ctx
->PB
->rgba
;
323 #define INTERP_ALPHA 1
329 pbrgba[count][RCOMP] = FixedToInt(r0); \
330 pbrgba[count][GCOMP] = FixedToInt(g0); \
331 pbrgba[count][BCOMP] = FixedToInt(b0); \
332 pbrgba[count][ACOMP] = FixedToInt(a0); \
335 #include "linetemp.h"
337 ctx
->PB
->count
= count
;
342 #define CHECK_FULL(count) \
343 if (count >= PB_SIZE-MAX_WIDTH) { \
344 ctx->PB->count = count; \
346 count = ctx->PB->count; \
351 /* Smooth shaded, color index, any width, maybe stippled */
352 static void general_smooth_ci_line( GLcontext
*ctx
,
353 GLuint vert0
, GLuint vert1
, GLuint pvert
)
355 GLint count
= ctx
->PB
->count
;
356 GLint
*pbx
= ctx
->PB
->x
;
357 GLint
*pby
= ctx
->PB
->y
;
358 GLdepth
*pbz
= ctx
->PB
->z
;
359 GLuint
*pbi
= ctx
->PB
->i
;
362 if (ctx
->Line
.StippleFlag
) {
366 #define INTERP_INDEX 1
376 #include "linetemp.h"
380 if (ctx
->Line
.Width
==2.0F
) {
381 /* special case: unstippled and width=2 */
384 #define INTERP_INDEX 1
385 #define XMAJOR_PLOT(X,Y) \
386 pbx[count] = X; pbx[count+1] = X; \
387 pby[count] = Y; pby[count+1] = Y+1; \
388 pbz[count] = Z; pbz[count+1] = Z; \
389 pbi[count] = I; pbi[count+1] = I; \
392 #define YMAJOR_PLOT(X,Y) \
393 pbx[count] = X; pbx[count+1] = X+1; \
394 pby[count] = Y; pby[count+1] = Y; \
395 pbz[count] = Z; pbz[count+1] = Z; \
396 pbi[count] = I; pbi[count+1] = I; \
399 #include "linetemp.h"
402 /* unstippled, any width */
405 #define INTERP_INDEX 1
414 #include "linetemp.h"
418 ctx
->PB
->count
= count
;
423 /* Flat shaded, color index, any width, maybe stippled */
424 static void general_flat_ci_line( GLcontext
*ctx
,
425 GLuint vert0
, GLuint vert1
, GLuint pvert
)
428 GLint
*pbx
= ctx
->PB
->x
;
429 GLint
*pby
= ctx
->PB
->y
;
430 GLdepth
*pbz
= ctx
->PB
->z
;
431 PB_SET_INDEX( ctx
, ctx
->PB
, ctx
->VB
->IndexPtr
->data
[pvert
] );
432 count
= ctx
->PB
->count
;
434 if (ctx
->Line
.StippleFlag
) {
435 /* stippled, any width */
446 #include "linetemp.h"
450 if (ctx
->Line
.Width
==2.0F
) {
451 /* special case: unstippled and width=2 */
454 #define XMAJOR_PLOT(X,Y) \
455 pbx[count] = X; pbx[count+1] = X; \
456 pby[count] = Y; pby[count+1] = Y+1; \
457 pbz[count] = Z; pbz[count+1] = Z; \
460 #define YMAJOR_PLOT(X,Y) \
461 pbx[count] = X; pbx[count+1] = X+1; \
462 pby[count] = Y; pby[count+1] = Y; \
463 pbz[count] = Z; pbz[count+1] = Z; \
466 #include "linetemp.h"
469 /* unstippled, any width */
479 #include "linetemp.h"
483 ctx
->PB
->count
= count
;
489 static void general_smooth_rgba_line( GLcontext
*ctx
,
490 GLuint vert0
, GLuint vert1
, GLuint pvert
)
492 GLint count
= ctx
->PB
->count
;
493 GLint
*pbx
= ctx
->PB
->x
;
494 GLint
*pby
= ctx
->PB
->y
;
495 GLdepth
*pbz
= ctx
->PB
->z
;
496 GLubyte (*pbrgba
)[4] = ctx
->PB
->rgba
;
499 if (ctx
->Line
.StippleFlag
) {
504 #define INTERP_ALPHA 1
511 pbrgba[count][RCOMP] = FixedToInt(r0); \
512 pbrgba[count][GCOMP] = FixedToInt(g0); \
513 pbrgba[count][BCOMP] = FixedToInt(b0); \
514 pbrgba[count][ACOMP] = FixedToInt(a0); \
517 #include "linetemp.h"
521 if (ctx
->Line
.Width
==2.0F
) {
522 /* special case: unstippled and width=2 */
526 #define INTERP_ALPHA 1
527 #define XMAJOR_PLOT(X,Y) \
528 pbx[count] = X; pbx[count+1] = X; \
529 pby[count] = Y; pby[count+1] = Y+1; \
530 pbz[count] = Z; pbz[count+1] = Z; \
531 pbrgba[count][RCOMP] = FixedToInt(r0); \
532 pbrgba[count][GCOMP] = FixedToInt(g0); \
533 pbrgba[count][BCOMP] = FixedToInt(b0); \
534 pbrgba[count][ACOMP] = FixedToInt(a0); \
535 pbrgba[count+1][RCOMP] = FixedToInt(r0); \
536 pbrgba[count+1][GCOMP] = FixedToInt(g0); \
537 pbrgba[count+1][BCOMP] = FixedToInt(b0); \
538 pbrgba[count+1][ACOMP] = FixedToInt(a0); \
541 #define YMAJOR_PLOT(X,Y) \
542 pbx[count] = X; pbx[count+1] = X+1; \
543 pby[count] = Y; pby[count+1] = Y; \
544 pbz[count] = Z; pbz[count+1] = Z; \
545 pbrgba[count][RCOMP] = FixedToInt(r0); \
546 pbrgba[count][GCOMP] = FixedToInt(g0); \
547 pbrgba[count][BCOMP] = FixedToInt(b0); \
548 pbrgba[count][ACOMP] = FixedToInt(a0); \
549 pbrgba[count+1][RCOMP] = FixedToInt(r0); \
550 pbrgba[count+1][GCOMP] = FixedToInt(g0); \
551 pbrgba[count+1][BCOMP] = FixedToInt(b0); \
552 pbrgba[count+1][ACOMP] = FixedToInt(a0); \
555 #include "linetemp.h"
558 /* unstippled, any width */
562 #define INTERP_ALPHA 1
568 pbrgba[count][RCOMP] = FixedToInt(r0); \
569 pbrgba[count][GCOMP] = FixedToInt(g0); \
570 pbrgba[count][BCOMP] = FixedToInt(b0); \
571 pbrgba[count][ACOMP] = FixedToInt(a0); \
574 #include "linetemp.h"
578 ctx
->PB
->count
= count
;
583 static void general_flat_rgba_line( GLcontext
*ctx
,
584 GLuint vert0
, GLuint vert1
, GLuint pvert
)
587 GLint
*pbx
= ctx
->PB
->x
;
588 GLint
*pby
= ctx
->PB
->y
;
589 GLdepth
*pbz
= ctx
->PB
->z
;
590 GLubyte
*color
= ctx
->VB
->ColorPtr
->data
[pvert
];
591 PB_SET_COLOR( ctx
, ctx
->PB
, color
[0], color
[1], color
[2], color
[3] );
592 count
= ctx
->PB
->count
;
594 if (ctx
->Line
.StippleFlag
) {
606 #include "linetemp.h"
610 if (ctx
->Line
.Width
==2.0F
) {
611 /* special case: unstippled and width=2 */
614 #define XMAJOR_PLOT(X,Y) \
615 pbx[count] = X; pbx[count+1] = X; \
616 pby[count] = Y; pby[count+1] = Y+1; \
617 pbz[count] = Z; pbz[count+1] = Z; \
620 #define YMAJOR_PLOT(X,Y) \
621 pbx[count] = X; pbx[count+1] = X+1; \
622 pby[count] = Y; pby[count+1] = Y; \
623 pbz[count] = Z; pbz[count+1] = Z; \
626 #include "linetemp.h"
629 /* unstippled, any width */
639 #include "linetemp.h"
643 ctx
->PB
->count
= count
;
648 /* Flat-shaded, textured, any width, maybe stippled */
649 static void flat_textured_line( GLcontext
*ctx
,
650 GLuint vert0
, GLuint vert1
, GLuint pv
)
653 GLint
*pbx
= ctx
->PB
->x
;
654 GLint
*pby
= ctx
->PB
->y
;
655 GLdepth
*pbz
= ctx
->PB
->z
;
656 GLfloat
*pbs
= ctx
->PB
->s
[0];
657 GLfloat
*pbt
= ctx
->PB
->t
[0];
658 GLfloat
*pbu
= ctx
->PB
->u
[0];
659 GLubyte
*color
= ctx
->VB
->ColorPtr
->data
[pv
];
660 PB_SET_COLOR( ctx
, ctx
->PB
, color
[0], color
[1], color
[2], color
[3] );
661 count
= ctx
->PB
->count
;
663 if (ctx
->Line
.StippleFlag
) {
667 #define INTERP_STUV0 1
681 #include "linetemp.h"
687 #define INTERP_STUV0 1
700 #include "linetemp.h"
703 ctx
->PB
->count
= count
;
709 /* Smooth-shaded, textured, any width, maybe stippled */
710 static void smooth_textured_line( GLcontext
*ctx
,
711 GLuint vert0
, GLuint vert1
, GLuint pvert
)
713 GLint count
= ctx
->PB
->count
;
714 GLint
*pbx
= ctx
->PB
->x
;
715 GLint
*pby
= ctx
->PB
->y
;
716 GLdepth
*pbz
= ctx
->PB
->z
;
717 GLfloat
*pbs
= ctx
->PB
->s
[0];
718 GLfloat
*pbt
= ctx
->PB
->t
[0];
719 GLfloat
*pbu
= ctx
->PB
->u
[0];
720 GLubyte (*pbrgba
)[4] = ctx
->PB
->rgba
;
723 if (ctx
->Line
.StippleFlag
) {
728 #define INTERP_ALPHA 1
729 #define INTERP_STUV0 1
740 pbrgba[count][RCOMP] = FixedToInt(r0); \
741 pbrgba[count][GCOMP] = FixedToInt(g0); \
742 pbrgba[count][BCOMP] = FixedToInt(b0); \
743 pbrgba[count][ACOMP] = FixedToInt(a0); \
747 #include "linetemp.h"
754 #define INTERP_ALPHA 1
755 #define INTERP_STUV0 1
765 pbrgba[count][RCOMP] = FixedToInt(r0); \
766 pbrgba[count][GCOMP] = FixedToInt(g0); \
767 pbrgba[count][BCOMP] = FixedToInt(b0); \
768 pbrgba[count][ACOMP] = FixedToInt(a0); \
772 #include "linetemp.h"
775 ctx
->PB
->count
= count
;
780 /* Smooth-shaded, multitextured, any width, maybe stippled, separate specular
781 * color interpolation.
783 static void smooth_multitextured_line( GLcontext
*ctx
,
784 GLuint vert0
, GLuint vert1
, GLuint pvert
)
786 GLint count
= ctx
->PB
->count
;
787 GLint
*pbx
= ctx
->PB
->x
;
788 GLint
*pby
= ctx
->PB
->y
;
789 GLdepth
*pbz
= ctx
->PB
->z
;
790 GLfloat
*pbs
= ctx
->PB
->s
[0];
791 GLfloat
*pbt
= ctx
->PB
->t
[0];
792 GLfloat
*pbu
= ctx
->PB
->u
[0];
793 GLfloat
*pbs1
= ctx
->PB
->s
[1];
794 GLfloat
*pbt1
= ctx
->PB
->t
[1];
795 GLfloat
*pbu1
= ctx
->PB
->u
[1];
796 GLubyte (*pbrgba
)[4] = ctx
->PB
->rgba
;
797 GLubyte (*pbspec
)[3] = ctx
->PB
->spec
;
800 if (ctx
->Line
.StippleFlag
) {
805 #define INTERP_SPEC 1
806 #define INTERP_ALPHA 1
807 #define INTERP_STUV0 1
808 #define INTERP_STUV1 1
822 pbrgba[count][RCOMP] = FixedToInt(r0); \
823 pbrgba[count][GCOMP] = FixedToInt(g0); \
824 pbrgba[count][BCOMP] = FixedToInt(b0); \
825 pbrgba[count][ACOMP] = FixedToInt(a0); \
826 pbspec[count][RCOMP] = FixedToInt(sr0); \
827 pbspec[count][GCOMP] = FixedToInt(sg0); \
828 pbspec[count][BCOMP] = FixedToInt(sb0); \
832 #include "linetemp.h"
839 #define INTERP_SPEC 1
840 #define INTERP_ALPHA 1
841 #define INTERP_STUV0 1
842 #define INTERP_STUV1 1
855 pbrgba[count][RCOMP] = FixedToInt(r0); \
856 pbrgba[count][GCOMP] = FixedToInt(g0); \
857 pbrgba[count][BCOMP] = FixedToInt(b0); \
858 pbrgba[count][ACOMP] = FixedToInt(a0); \
859 pbspec[count][RCOMP] = FixedToInt(sr0); \
860 pbspec[count][GCOMP] = FixedToInt(sg0); \
861 pbspec[count][BCOMP] = FixedToInt(sb0); \
865 #include "linetemp.h"
868 ctx
->PB
->count
= count
;
874 * Antialiased RGBA line
876 * This AA line function isn't terribly efficient but it's pretty
877 * straight-forward to understand. Also, it doesn't exactly conform
878 * to the specification.
880 static void aa_rgba_line( GLcontext
*ctx
,
881 GLuint vert0
, GLuint vert1
, GLuint pvert
)
883 #define INTERP_RGBA 1
884 #define PLOT(x, y) { PB_WRITE_RGBA_PIXEL( pb, (x), (y), z, red, green, blue, coverage ); }
885 #include "lnaatemp.h"
889 * Antialiased Textured RGBA line
891 * This AA line function isn't terribly efficient but it's pretty
892 * straight-forward to understand. Also, it doesn't exactly conform
893 * to the specification.
895 static void aa_tex_rgba_line( GLcontext
*ctx
,
896 GLuint vert0
, GLuint vert1
, GLuint pvert
)
898 #define INTERP_RGBA 1
899 #define INTERP_STUV0 1
902 PB_WRITE_TEX_PIXEL( pb, (x), (y), z, red, green, blue, coverage, \
905 #include "lnaatemp.h"
910 * Antialiased Multitextured RGBA line
912 * This AA line function isn't terribly efficient but it's pretty
913 * straight-forward to understand. Also, it doesn't exactly conform
914 * to the specification.
916 static void aa_multitex_rgba_line( GLcontext
*ctx
,
917 GLuint vert0
, GLuint vert1
, GLuint pvert
)
919 #define INTERP_RGBA 1
920 #define INTERP_SPEC 1
921 #define INTERP_STUV0 1
922 #define INTERP_STUV1 1
925 PB_WRITE_MULTITEX_SPEC_PIXEL( pb, (x), (y), z, \
926 red, green, blue, coverage, specRed, specGreen, specBlue, \
927 s, t, u, s1, t1, u1 ); \
929 #include "lnaatemp.h"
934 * Antialiased CI line. Same comments for RGBA antialiased lines apply.
936 static void aa_ci_line( GLcontext
*ctx
,
937 GLuint vert0
, GLuint vert1
, GLuint pvert
)
939 #define INTERP_INDEX 1
942 PB_WRITE_CI_PIXEL( pb, (x), (y), z, index + coverage ); \
944 #include "lnaatemp.h"
949 * Null rasterizer for measuring transformation speed.
951 static void null_line( GLcontext
*ctx
, GLuint v1
, GLuint v2
, GLuint pv
)
961 * Determine which line drawing function to use given the current
964 void gl_set_line_function( GLcontext
*ctx
)
966 GLboolean rgbmode
= ctx
->Visual
->RGBAflag
;
967 /* TODO: antialiased lines */
969 if (ctx
->RenderMode
==GL_RENDER
) {
971 ctx
->Driver
.LineFunc
= null_line
;
974 if (ctx
->Driver
.LineFunc
) {
975 /* Device driver will draw lines. */
979 if (ctx
->Line
.SmoothFlag
) {
980 /* antialiased lines */
982 if (ctx
->Texture
.ReallyEnabled
) {
983 if (ctx
->Texture
.ReallyEnabled
>= TEXTURE1_1D
984 || ctx
->Light
.Model
.ColorControl
==GL_SEPARATE_SPECULAR_COLOR
)
986 ctx
->Driver
.LineFunc
= aa_multitex_rgba_line
;
988 ctx
->Driver
.LineFunc
= aa_tex_rgba_line
;
990 ctx
->Driver
.LineFunc
= aa_rgba_line
;
994 ctx
->Driver
.LineFunc
= aa_ci_line
;
997 else if (ctx
->Texture
.ReallyEnabled
) {
998 if (ctx
->Texture
.ReallyEnabled
>= TEXTURE1_1D
999 || ctx
->Light
.Model
.ColorControl
==GL_SEPARATE_SPECULAR_COLOR
) {
1000 /* multi-texture and/or separate specular color */
1001 ctx
->Driver
.LineFunc
= smooth_multitextured_line
;
1004 if (ctx
->Light
.ShadeModel
==GL_SMOOTH
) {
1005 ctx
->Driver
.LineFunc
= smooth_textured_line
;
1008 ctx
->Driver
.LineFunc
= flat_textured_line
;
1012 else if (ctx
->Line
.Width
!=1.0 || ctx
->Line
.StippleFlag
1013 || ctx
->Line
.SmoothFlag
) {
1014 if (ctx
->Light
.ShadeModel
==GL_SMOOTH
) {
1016 ctx
->Driver
.LineFunc
= general_smooth_rgba_line
;
1018 ctx
->Driver
.LineFunc
= general_smooth_ci_line
;
1022 ctx
->Driver
.LineFunc
= general_flat_rgba_line
;
1024 ctx
->Driver
.LineFunc
= general_flat_ci_line
;
1028 if (ctx
->Light
.ShadeModel
==GL_SMOOTH
) {
1029 /* Width==1, non-stippled, smooth-shaded */
1030 if (ctx
->Depth
.Test
|| ctx
->FogMode
== FOG_FRAGMENT
) {
1032 ctx
->Driver
.LineFunc
= smooth_rgba_z_line
;
1034 ctx
->Driver
.LineFunc
= smooth_ci_z_line
;
1038 ctx
->Driver
.LineFunc
= smooth_rgba_line
;
1040 ctx
->Driver
.LineFunc
= smooth_ci_line
;
1044 /* Width==1, non-stippled, flat-shaded */
1045 if (ctx
->Depth
.Test
|| ctx
->FogMode
== FOG_FRAGMENT
) {
1047 ctx
->Driver
.LineFunc
= flat_rgba_z_line
;
1049 ctx
->Driver
.LineFunc
= flat_ci_z_line
;
1053 ctx
->Driver
.LineFunc
= flat_rgba_line
;
1055 ctx
->Driver
.LineFunc
= flat_ci_line
;
1060 else if (ctx
->RenderMode
==GL_FEEDBACK
) {
1061 ctx
->Driver
.LineFunc
= gl_feedback_line
;
1064 /* GL_SELECT mode */
1065 ctx
->Driver
.LineFunc
= gl_select_line
;