#include "clip.h"
#include "context.h"
#include "light.h"
#include "macros.h"
#include "matrix.h"
#include "pb.h"
#include "types.h"
#include "vb.h"
#include "vbrender.h"
#include "xform.h"
Go to the source code of this file.
|
static void | render_clipped_line (GLcontext *ctx, GLuint v1, GLuint v2) |
|
static void | offset_polygon (GLcontext *ctx, GLfloat a, GLfloat b, GLfloat c) |
|
static void | unfilled_polygon (GLcontext *ctx, GLuint n, GLuint vlist[], GLuint pv, GLuint facing) |
|
static GLfloat | polygon_area (const struct vertex_buffer *vb, GLuint n, const GLuint vlist[]) |
|
static void | render_polygon (GLcontext *ctx, GLuint n, GLuint vlist[]) |
|
static void | render_clipped_polygon (GLcontext *ctx, GLuint n, GLuint vlist[]) |
|
static void | render_triangle (GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint pv) |
|
static void | render_quad (GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3, GLuint pv) |
|
static void | copy_vertex (struct vertex_buffer *vb, GLuint dst, GLuint src) |
|
void | gl_render_vb (GLcontext *ctx, GLboolean allDone) |
|
void | gl_reset_vb (GLcontext *ctx, GLboolean allDone) |
|
◆ CLIP_ALL_BITS
◆ END_PROFILE
◆ START_PROFILE
◆ copy_vertex()
Definition at line 742 of file vbrender.c.
743{
757}
#define COPY_3V(DST, SRC)
#define COPY_4V(DST, SRC)
GLfloat TexCoord[VB_SIZE][4]
GLubyte Bcolor[VB_SIZE][4]
GLuint MaterialMask[VB_SIZE]
GLubyte Fcolor[VB_SIZE][4]
GLboolean Edgeflag[VB_SIZE]
struct gl_material Material[VB_SIZE][2]
GLubyte ClipMask[VB_SIZE]
Referenced by gl_reset_vb().
◆ gl_render_vb()
Definition at line 774 of file vbrender.c.
775{
778
779 switch (
ctx->Primitive) {
782 (*
ctx->Driver.PointsFunc)(
ctx, 0,
VB->Count-1 );
784 break;
785
789 for (
i=1;
i<
VB->Count;
i+=2) {
790 if (
VB->ClipMask[
i-1] |
VB->ClipMask[
i]) {
792 }
793 else {
795 (*
ctx->Driver.LineFunc)(
ctx,
i-1,
i,
i );
797 }
798 ctx->StippleCounter = 0;
799 }
800 }
801 else {
803 for (
i=1;
i<
VB->Count;
i+=2) {
805 (*
ctx->Driver.LineFunc)(
ctx,
i-1,
i,
i );
807 ctx->StippleCounter = 0;
808 }
809 }
810 break;
811
815 for (
i=1;
i<
VB->Count;
i++) {
816 if (
VB->ClipMask[
i-1] |
VB->ClipMask[
i]) {
818 }
819 else {
821 (*
ctx->Driver.LineFunc)(
ctx,
i-1,
i,
i );
823 }
824 }
825 }
826 else {
827
829 for (
i=1;
i<
VB->Count;
i++) {
831 (*
ctx->Driver.LineFunc)(
ctx,
i-1,
i,
i );
833 }
834 }
835 break;
836
838 {
842 }
843 else {
845 }
846 while (i<VB->
Count) {
847 if (
VB->ClipMask[
i-1] |
VB->ClipMask[
i]) {
849 }
850 else {
852 (*
ctx->Driver.LineFunc)(
ctx,
i-1,
i,
i );
854 }
856 }
857 }
858 break;
859
861 if (
VB->ClipOrMask) {
863 for (
i=2;
i<
VB->Count;
i+=3) {
864 if (
VB->ClipMask[
i-2] &
VB->ClipMask[
i-1]
866
867 continue;
868 }
869 else if (
VB->ClipMask[
i-2] |
VB->ClipMask[
i-1] |
VB->ClipMask[
i]) {
874 }
875 else {
876 if (
ctx->DirectTriangles) {
878 (*
ctx->Driver.TriangleFunc)(
ctx,
i-2,
i-1,
i,
i );
880 }
881 else {
883 }
884 }
885 }
886 }
887 else {
888
890 if (
ctx->DirectTriangles) {
891 for (
i=2;
i<
VB->Count;
i+=3) {
893 (*
ctx->Driver.TriangleFunc)(
ctx,
i-2,
i-1,
i,
i );
895 }
896 }
897 else {
898 for (
i=2;
i<
VB->Count;
i+=3) {
900 }
901 }
902 }
903 break;
904
906 if (
VB->ClipOrMask) {
908 for (
i=2;
i<
VB->Count;
i++) {
909 if (
VB->ClipMask[
i-2] &
VB->ClipMask[
i-1]
911
912 continue;
913 }
914 else if (
VB->ClipMask[
i-2] |
VB->ClipMask[
i-1] |
VB->ClipMask[
i]) {
916
921 }
922 else {
927 }
928 }
929 else {
930 if (
ctx->DirectTriangles) {
932 (*
ctx->Driver.TriangleFunc)(
ctx,
i-2,
i-1,
i,
i );
934 }
935 else {
938 else
940 }
941 }
942 }
943 }
944 else {
945
947 if (
ctx->DirectTriangles) {
948 for (
i=2;
i<
VB->Count;
i++) {
950 (*
ctx->Driver.TriangleFunc)(
ctx,
i-2,
i-1,
i,
i );
952 }
953 }
954 else {
955 for (
i=2;
i<
VB->Count;
i++) {
958 else
960 }
961 }
962 }
963 break;
964
966 if (
VB->ClipOrMask) {
968 for (
i=2;
i<
VB->Count;
i++) {
969 if (
VB->ClipMask[0] &
VB->ClipMask[
i-1] &
VB->ClipMask[
i]
971
972 continue;
973 }
974 else if (
VB->ClipMask[0] |
VB->ClipMask[
i-1] |
VB->ClipMask[
i]) {
975 vlist[0] = 0;
979 }
980 else {
981 if (
ctx->DirectTriangles) {
983 (*
ctx->Driver.TriangleFunc)(
ctx, 0,
i-1,
i,
i );
985 }
986 else {
988 }
989 }
990 }
991 }
992 else {
993
995 if (
ctx->DirectTriangles) {
996 for (
i=2;
i<
VB->Count;
i++) {
998 (*
ctx->Driver.TriangleFunc)(
ctx, 0,
i-1,
i,
i );
1000 }
1001 }
1002 else {
1003 for (
i=2;
i<
VB->Count;
i++) {
1005 }
1006 }
1007 }
1008 break;
1009
1011 if (
VB->ClipOrMask) {
1013 for (
i=3;
i<
VB->Count;
i+=4) {
1014 if (
VB->ClipMask[
i-3] &
VB->ClipMask[
i-2]
1016
1017 continue;
1018 }
1019 else if (
VB->ClipMask[
i-3] |
VB->ClipMask[
i-2]
1020 |
VB->ClipMask[
i-1] |
VB->ClipMask[
i]) {
1026 }
1027 else {
1028 if (
ctx->DirectTriangles) {
1030 (*
ctx->Driver.QuadFunc)(
ctx,
i-3,
i-2,
i-1,
i,
i );
1032 }
1033 else {
1035 }
1036 }
1037 }
1038 }
1039 else {
1040
1042 if (
ctx->DirectTriangles) {
1043 for (
i=3;
i<
VB->Count;
i+=4) {
1045 (*
ctx->Driver.QuadFunc)(
ctx,
i-3,
i-2,
i-1,
i,
i );
1047 }
1048 }
1049 else {
1050 for (
i=3;
i<
VB->Count;
i+=4) {
1052 }
1053 }
1054 }
1055 break;
1056
1058 if (
VB->ClipOrMask) {
1060 for (
i=3;
i<
VB->Count;
i+=2) {
1061 if (
VB->ClipMask[
i-2] &
VB->ClipMask[
i-3]
1063
1064 continue;
1065 }
1066 else if (
VB->ClipMask[
i-2] |
VB->ClipMask[
i-3]
1067 |
VB->ClipMask[
i-1] |
VB->ClipMask[
i]) {
1073 }
1074 else {
1075 if (
ctx->DirectTriangles) {
1077 (*
ctx->Driver.QuadFunc)(
ctx,
i-3,
i-2,
i,
i-1,
i );
1079 }
1080 else {
1082 }
1083 }
1084 }
1085 }
1086 else {
1087
1089 if (
ctx->DirectTriangles) {
1090 for (
i=3;
i<
VB->Count;
i+=2) {
1092 (*
ctx->Driver.QuadFunc)(
ctx,
i-3,
i-2,
i,
i-1,
i );
1094 }
1095 }
1096 else {
1097 for (
i=3;
i<
VB->Count;
i+=2) {
1099 }
1100 }
1101 }
1102 break;
1103
1107
1108 break;
1109 }
1110 if (
VB->ClipOrMask) {
1111
1113 for (
i=0;
i<
VB->Count;
i++) {
1115 }
1117 }
1118 else {
1119
1122 if (initFlag) {
1123
1127 }
1129 }
1131 }
1132 }
1133 break;
1134
1135 default:
1136
1138 }
1139
1141}
void gl_problem(const GLcontext *ctx, const char *s)
#define GL_TRIANGLE_STRIP
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
struct vertex_buffer * VB
static void render_clipped_line(GLcontext *ctx, GLuint v1, GLuint v2)
static void render_polygon(GLcontext *ctx, GLuint n, GLuint vlist[])
static void render_triangle(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint pv)
void gl_reset_vb(GLcontext *ctx, GLboolean allDone)
#define END_PROFILE(TIMER, COUNTER, INCR)
static void render_clipped_polygon(GLcontext *ctx, GLuint n, GLuint vlist[])
static void render_quad(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3, GLuint pv)
Referenced by gl_transform_vb_part2().
◆ gl_reset_vb()
Definition at line 1155 of file vbrender.c.
1156{
1158
1159
1160 int oldCount =
VB->Count;
1163 GLuint vertexSizeMask =
VB->VertexSizeMask;
1164
1165
1167 if (
VB->ClipMask[
VB->Count-1] |
VB->ClipMask[0]) {
1169 }
1170 else {
1172 (*
ctx->Driver.LineFunc)(
ctx,
VB->Count-1, 0, 0 );
1174 }
1175 }
1176
1177 if (allDone) {
1178
1179 VB->Start =
VB->Count = 0;
1186 if (
VB->TexCoordSize!=2) {
1189 VB->TexCoord[
i][2] = 0.0F;
1190 VB->TexCoord[
i][3] = 1.0F;
1191 }
1192 }
1193 if (
ctx->Current.TexCoord[2]==0.0F &&
ctx->Current.TexCoord[3]==1.0F) {
1194 VB->TexCoordSize = 2;
1195 }
1196 else {
1197 VB->TexCoordSize = 4;
1198 }
1199 }
1200 else {
1201
1202
1203
1204 switch (
ctx->Primitive) {
1207 VB->Start =
VB->Count = 0;
1212 break;
1215 VB->Start =
VB->Count = 0;
1220 break;
1223 VB->Start =
VB->Count = 1;
1224 VB->ClipOrMask =
VB->ClipMask[0];
1225 VB->ClipAndMask =
VB->ClipMask[0];
1227 break;
1231 VB->Start =
VB->Count = 2;
1232 VB->ClipOrMask =
VB->ClipMask[0] |
VB->ClipMask[1];
1233 VB->ClipAndMask =
VB->ClipMask[0] &
VB->ClipMask[1];
1234 VB->MonoMaterial = !(
VB->MaterialMask[0] |
VB->MaterialMask[1]);
1235 break;
1238 VB->Start =
VB->Count = 0;
1243 break;
1247 VB->Start =
VB->Count = 2;
1248 VB->ClipOrMask =
VB->ClipMask[0] |
VB->ClipMask[1];
1249 VB->ClipAndMask =
VB->ClipMask[0] &
VB->ClipMask[1];
1250 VB->MonoMaterial = !(
VB->MaterialMask[0] |
VB->MaterialMask[1]);
1251 break;
1254 VB->Start =
VB->Count = 2;
1255 VB->ClipOrMask =
VB->ClipMask[0] |
VB->ClipMask[1];
1256 VB->ClipAndMask =
VB->ClipMask[0] &
VB->ClipMask[1];
1257 VB->MonoMaterial = !(
VB->MaterialMask[0] |
VB->MaterialMask[1]);
1258 break;
1261 VB->Start =
VB->Count = 0;
1266 break;
1270 VB->Start =
VB->Count = 2;
1271 VB->ClipOrMask =
VB->ClipMask[0] |
VB->ClipMask[1];
1272 VB->ClipAndMask =
VB->ClipMask[0] &
VB->ClipMask[1];
1273 VB->MonoMaterial = !(
VB->MaterialMask[0] |
VB->MaterialMask[1]);
1274 break;
1277 VB->Start =
VB->Count = 2;
1278 VB->ClipOrMask =
VB->ClipMask[0] |
VB->ClipMask[1];
1279 VB->ClipAndMask =
VB->ClipMask[0] &
VB->ClipMask[1];
1280 VB->MonoMaterial = !(
VB->MaterialMask[0] |
VB->MaterialMask[1]);
1281 break;
1282 default:
1283
1285 }
1286 }
1287
1288 if (clipOrMask) {
1289
1291 (oldCount -
VB->Start) *
sizeof(
VB->ClipMask[0]) );
1292 }
1293
1294 if (!monoMaterial) {
1295
1297 (oldCount -
VB->Start) *
sizeof(
VB->MaterialMask[0]) );
1299 }
1300
1302
1305 n = oldCount -
VB->Start;
1306 for (
i=0;
i<
n;
i++) {
1308 }
1309 }
1310}
#define MEMSET(DST, VAL, N)
void gl_update_lighting(GLcontext *ctx)
static void copy_vertex(struct vertex_buffer *vb, GLuint dst, GLuint src)
Referenced by gl_render_vb(), and gl_transform_vb_part2().
◆ offset_polygon()
◆ polygon_area()
◆ render_clipped_line()
Definition at line 149 of file vbrender.c.
150{
154
155
156 provoking_vertex =
v2;
157
158
159
160
161
162
164
165
166 if (
ctx->Transform.AnyClip) {
169 return;
170
173 }
176 }
177 }
178
179
181 return;
182
183
184 if (
VB->Clip[
v1][3] != 0.0F) {
186 ndc_x =
VB->Clip[
v1][0] * wInv;
187 ndc_y =
VB->Clip[
v1][1] * wInv;
188 ndc_z =
VB->Clip[
v1][2] * wInv;
189 }
190 else {
191
192 ndc_x = ndc_y = ndc_z = 0.0F;
193 }
194
195
196 VB->Win[
v1][0] = ndc_x *
ctx->Viewport.Sx +
ctx->Viewport.Tx;
197 VB->Win[
v1][1] = ndc_y *
ctx->Viewport.Sy +
ctx->Viewport.Ty;
198 VB->Win[
v1][2] = ndc_z *
ctx->Viewport.Sz +
ctx->Viewport.Tz;
199
200
201 if (
VB->Clip[
v2][3] != 0.0F) {
203 ndc_x =
VB->Clip[
v2][0] * wInv;
204 ndc_y =
VB->Clip[
v2][1] * wInv;
205 ndc_z =
VB->Clip[
v2][2] * wInv;
206 }
207 else {
208
209 ndc_x = ndc_y = ndc_z = 0.0F;
210 }
211
212
213 VB->Win[
v2][0] = ndc_x *
ctx->Viewport.Sx +
ctx->Viewport.Tx;
214 VB->Win[
v2][1] = ndc_y *
ctx->Viewport.Sy +
ctx->Viewport.Ty;
215 VB->Win[
v2][2] = ndc_z *
ctx->Viewport.Sz +
ctx->Viewport.Tz;
216
217 if (
ctx->Driver.RasterSetup) {
218
221 }
222
224 (*
ctx->Driver.LineFunc)(
ctx,
v1,
v2, provoking_vertex );
226}
GLuint gl_userclip_line(GLcontext *ctx, GLuint *i, GLuint *j)
GLuint gl_viewclip_line(GLcontext *ctx, GLuint *i, GLuint *j)
GLfloat GLfloat GLfloat v2
Referenced by gl_render_vb(), and gl_reset_vb().
◆ render_clipped_polygon()
Definition at line 442 of file vbrender.c.
443{
447
448
450
451
452
453
454
455
457
458
459 if (
ctx->Transform.AnyClip) {
464 return;
465
469 }
470 }
471
472
475 return;
476
477
478
479
480
481 {
489
491 if (
VB->Clip[
i][3] != 0.0F) {
493 win[
i][0] =
VB->Clip[
i][0] * wInv * sx + tx;
494 win[
i][1] =
VB->Clip[
i][1] * wInv * sy +
ty;
495 win[
i][2] =
VB->Clip[
i][2] * wInv * sz +
tz;
496 }
497 else {
498
500 }
501 }
502 if (
ctx->Driver.RasterSetup && (
VB->Free >
VB_MAX)) {
503
505 }
506
507#ifdef DEBUG
508 {
512 if (
VB->ClipMask[
j]) {
513
515 printf(
"CLIPMASK %d %d %02x\n",
i,
j,
VB->ClipMask[
j]);
517 VB->Eye[
j][2],
VB->Eye[
j][3]);
519 VB->Clip[
j][2],
VB->Clip[
j][3]);
523 }
524 }
525 }
526 }
527#endif
528 }
529
530
531 {
534
536
537 return;
538 }
539
541
542 if ((facing+1) &
ctx->Polygon.CullBits) {
543 return;
544 }
545
546 if (
ctx->Polygon.OffsetAny) {
547
551 GLuint j3 = vlist[ (
n==3) ? 0 : 3 ];
562 }
563
564 if (
ctx->LightTwoSide) {
565 if (facing==1) {
566
567 VB->Color =
VB->Bcolor;
568 VB->Index =
VB->Bindex;
569 }
570 else {
571
572 VB->Color =
VB->Fcolor;
573 VB->Index =
VB->Findex;
574 }
575 }
576
577
578 if (
ctx->Polygon.Unfilled) {
580 }
581 else {
582
587 (*
ctx->Driver.TriangleFunc)(
ctx, j0, vlist[
i-1], vlist[
i], pv );
589 }
590 }
591 }
592}
GLuint gl_viewclip_polygon(GLcontext *ctx, GLuint n, GLuint vlist[])
GLuint gl_userclip_polygon(GLcontext *ctx, GLuint n, GLuint vlist[])
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
static GLfloat polygon_area(const struct vertex_buffer *vb, GLuint n, const GLuint vlist[])
static void unfilled_polygon(GLcontext *ctx, GLuint n, GLuint vlist[], GLuint pv, GLuint facing)
static void offset_polygon(GLcontext *ctx, GLfloat a, GLfloat b, GLfloat c)
Referenced by gl_render_vb().
◆ render_polygon()
Definition at line 362 of file vbrender.c.
363{
366
367
369
370
371 {
374
376
377 return;
378 }
379
381
382 if ((facing+1) &
ctx->Polygon.CullBits) {
383 return;
384 }
385
386 if (
ctx->Polygon.OffsetAny) {
387
391 GLuint j3 = vlist[ (
n==3) ? 0 : 3 ];
402 }
403
404 if (
ctx->LightTwoSide) {
405 if (facing==1) {
406
407 VB->Color =
VB->Bcolor;
408 VB->Index =
VB->Bindex;
409 }
410 else {
411
412 VB->Color =
VB->Fcolor;
413 VB->Index =
VB->Findex;
414 }
415 }
416
417
418 if (
ctx->Polygon.Unfilled) {
420 }
421 else {
422
427 (*
ctx->Driver.TriangleFunc)(
ctx, j0, vlist[
i-1], vlist[
i], pv );
429 }
430 }
431 }
432}
Referenced by gl_render_vb().
◆ render_quad()
Definition at line 670 of file vbrender.c.
672{
677
678
684
686
687 return;
688 }
689
690 facing = (
c<0.0F) ^ (
ctx->Polygon.FrontFace==
GL_CW);
691
692 if ((facing+1) &
ctx->Polygon.CullBits) {
693 return;
694 }
695
696 if (
ctx->Polygon.OffsetAny) {
697
703 }
704
705 if (
ctx->LightTwoSide) {
706 if (facing==1) {
707
708 VB->Color =
VB->Bcolor;
709 VB->Index =
VB->Bindex;
710 }
711 else {
712
713 VB->Color =
VB->Fcolor;
714 VB->Index =
VB->Findex;
715 }
716 }
717
718
719 if (
ctx->Polygon.Unfilled) {
726 }
727 else {
731 }
732}
GLfloat GLfloat GLfloat GLfloat v3
Referenced by gl_render_vb().
◆ render_triangle()
Definition at line 601 of file vbrender.c.
603{
608
609
615
617
618 return;
619 }
620
621 facing = (
c<0.0F) ^ (
ctx->Polygon.FrontFace==
GL_CW);
622
623 if ((facing+1) &
ctx->Polygon.CullBits) {
624 return;
625 }
626
627 if (
ctx->Polygon.OffsetAny) {
628
634 }
635
636 if (
ctx->LightTwoSide) {
637 if (facing==1) {
638
639 VB->Color =
VB->Bcolor;
640 VB->Index =
VB->Bindex;
641 }
642 else {
643
644 VB->Color =
VB->Fcolor;
645 VB->Index =
VB->Findex;
646 }
647 }
648
649 if (
ctx->Polygon.Unfilled) {
655 }
656 else {
660 }
661}
Referenced by gl_render_vb().
◆ unfilled_polygon()
Definition at line 265 of file vbrender.c.
268{
271
275
280 }
281 else {
283 }
284
287 if (edge ||
VB->Edgeflag[
j]) {
288 (*
ctx->Driver.PointsFunc)(
ctx,
j,
j );
289 }
290 }
291 }
295
296 ctx->StippleCounter = 0;
297
302 }
303 else {
305 }
306
307
309 j0 = (
i==0) ? vlist[
n-1] : vlist[
i-1];
311 if (edge ||
VB->Edgeflag[j0]) {
313 (*
ctx->Driver.LineFunc)(
ctx, j0, j1, pv );
315 }
316 }
317 }
318 else {
319
321 j0 = vlist[0];
324 (*
ctx->Driver.TriangleFunc)(
ctx, j0, vlist[
i-1], vlist[
i], pv );
326 }
327 }
328}
Referenced by render_clipped_polygon(), render_polygon(), render_quad(), and render_triangle().