151 GLfloat invRedScale =
ctx->Visual->InvRedScale;
152 GLfloat invGreenScale =
ctx->Visual->InvGreenScale;
153 GLfloat invBlueScale =
ctx->Visual->InvBlueScale;
154 GLfloat invAlphaScale =
ctx->Visual->InvAlphaScale;
174 else if (
i==1)
v =
v1;
184 color[0] =
VB->Color[
v][0] * invRedScale;
185 color[1] =
VB->Color[
v][1] * invGreenScale;
186 color[2] =
VB->Color[
v][2] * invBlueScale;
187 color[3] =
VB->Color[
v][3] * invAlphaScale;
190 invq = (
VB->TexCoord[
v][3]==0.0) ? 1.0 : (1.0F /
VB->TexCoord[
v][3]);
191 tc[0] =
VB->TexCoord[
v][0] * invq;
192 tc[1] =
VB->TexCoord[
v][1] * invq;
193 tc[2] =
VB->TexCoord[
v][2] * invq;
194 tc[3] =
VB->TexCoord[
v][3];
226 GLuint index = VB->Index[pv]; \
227 if (!VB->MonoColor) { \
229 (*ctx->Driver.Index)( ctx, index ); \
232#define INNER_LOOP( LEFT, RIGHT, Y ) \
234 GLint i, n = RIGHT-LEFT; \
235 GLdepth zspan[MAX_WIDTH]; \
237 for (i=0;i<n;i++) { \
241 gl_write_monoindex_span( ctx, n, LEFT, Y, \
242 zspan, index, GL_POLYGON ); \
258#define INTERP_INDEX 1
260#define INNER_LOOP( LEFT, RIGHT, Y ) \
262 GLint i, n = RIGHT-LEFT; \
263 GLdepth zspan[MAX_WIDTH]; \
264 GLuint index[MAX_WIDTH]; \
266 for (i=0;i<n;i++) { \
268 index[i] = FixedToInt(ffi); \
272 gl_write_index_span( ctx, n, LEFT, Y, zspan, \
273 index, GL_POLYGON ); \
291 if (!VB->MonoColor) { \
293 GLubyte r = VB->Color[pv][0]; \
294 GLubyte g = VB->Color[pv][1]; \
295 GLubyte b = VB->Color[pv][2]; \
296 GLubyte a = VB->Color[pv][3]; \
297 (*ctx->Driver.Color)( ctx, r, g, b, a ); \
300#define INNER_LOOP( LEFT, RIGHT, Y ) \
302 GLint i, n = RIGHT-LEFT; \
303 GLdepth zspan[MAX_WIDTH]; \
305 for (i=0;i<n;i++) { \
309 gl_write_monocolor_span( ctx, n, LEFT, Y, zspan, \
310 VB->Color[pv][0], VB->Color[pv][1],\
311 VB->Color[pv][2], VB->Color[pv][3],\
329#define INTERP_ALPHA 1
331#define INNER_LOOP( LEFT, RIGHT, Y ) \
333 GLint i, n = RIGHT-LEFT; \
334 GLdepth zspan[MAX_WIDTH]; \
335 GLubyte red[MAX_WIDTH], green[MAX_WIDTH]; \
336 GLubyte blue[MAX_WIDTH], alpha[MAX_WIDTH]; \
338 for (i=0;i<n;i++) { \
340 red[i] = FixedToInt(ffr); \
341 green[i] = FixedToInt(ffg); \
342 blue[i] = FixedToInt(ffb); \
343 alpha[i] = FixedToInt(ffa); \
350 gl_write_color_span( ctx, n, LEFT, Y, zspan, \
351 red, green, blue, alpha, \
369#define S_SCALE twidth
370#define T_SCALE theight
372 GLfloat twidth = (GLfloat) ctx->Texture.Current2D->Image[0]->Width; \
373 GLfloat theight = (GLfloat) ctx->Texture.Current2D->Image[0]->Height;\
374 GLint twidth_log2 = ctx->Texture.Current2D->Image[0]->WidthLog2; \
375 GLubyte *texture = ctx->Texture.Current2D->Image[0]->Data; \
376 GLint smask = ctx->Texture.Current2D->Image[0]->Width - 1; \
377 GLint tmask = ctx->Texture.Current2D->Image[0]->Height - 1;
379#define INNER_LOOP( LEFT, RIGHT, Y ) \
381 GLint i, n = RIGHT-LEFT; \
382 GLubyte red[MAX_WIDTH], green[MAX_WIDTH]; \
383 GLubyte blue[MAX_WIDTH], alpha[MAX_WIDTH]; \
385 for (i=0;i<n;i++) { \
386 GLint s = FixedToInt(ffs) & smask; \
387 GLint t = FixedToInt(fft) & tmask; \
388 GLint pos = (t << twidth_log2) + s; \
389 pos = pos + pos + pos; \
390 red[i] = texture[pos]; \
391 green[i] = texture[pos+1]; \
392 blue[i] = texture[pos+2]; \
397 (*ctx->Driver.WriteColorSpan)( ctx, n, LEFT, Y, \
398 red, green, blue, alpha, NULL ); \
417#define S_SCALE twidth
418#define T_SCALE theight
420 GLfloat twidth = (GLfloat) ctx->Texture.Current2D->Image[0]->Width; \
421 GLfloat theight = (GLfloat) ctx->Texture.Current2D->Image[0]->Height;\
422 GLint twidth_log2 = ctx->Texture.Current2D->Image[0]->WidthLog2; \
423 GLubyte *texture = ctx->Texture.Current2D->Image[0]->Data; \
424 GLint smask = ctx->Texture.Current2D->Image[0]->Width - 1; \
425 GLint tmask = ctx->Texture.Current2D->Image[0]->Height - 1;
427#define INNER_LOOP( LEFT, RIGHT, Y ) \
429 GLint i, n = RIGHT-LEFT; \
430 GLubyte red[MAX_WIDTH], green[MAX_WIDTH]; \
431 GLubyte blue[MAX_WIDTH], alpha[MAX_WIDTH]; \
432 GLubyte mask[MAX_WIDTH]; \
434 for (i=0;i<n;i++) { \
437 GLint s = FixedToInt(ffs) & smask; \
438 GLint t = FixedToInt(fft) & tmask; \
439 GLint pos = (t << twidth_log2) + s; \
440 pos = pos + pos + pos; \
441 red[i] = texture[pos]; \
442 green[i] = texture[pos+1]; \
443 blue[i] = texture[pos+2]; \
455 (*ctx->Driver.WriteColorSpan)( ctx, n, LEFT, Y, \
456 red, green, blue, alpha, mask ); \
476#define INTERP_ALPHA 1
480 GLboolean flat_shade = (ctx->Light.ShadeModel==GL_FLAT); \
483 r = VB->Color[pv][0]; \
484 g = VB->Color[pv][1]; \
485 b = VB->Color[pv][2]; \
486 a = VB->Color[pv][3]; \
488#define INNER_LOOP( LEFT, RIGHT, Y ) \
490 GLint i, n = RIGHT-LEFT; \
491 GLdepth zspan[MAX_WIDTH]; \
492 GLubyte red[MAX_WIDTH], green[MAX_WIDTH]; \
493 GLubyte blue[MAX_WIDTH], alpha[MAX_WIDTH]; \
494 GLfloat s[MAX_WIDTH], t[MAX_WIDTH], u[MAX_WIDTH]; \
497 for (i=0;i<n;i++) { \
498 GLdouble wwvvInv = 1.0 / (ww*vv); \
516 for (i=0;i<n;i++) { \
517 GLdouble wwvvInv = 1.0 / (ww*vv); \
519 red[i] = FixedToInt(ffr); \
520 green[i] = FixedToInt(ffg); \
521 blue[i] = FixedToInt(ffb); \
522 alpha[i] = FixedToInt(ffa); \
538 gl_write_texture_span( ctx, n, LEFT, Y, zspan, \
540 red, green, blue, alpha, \
561 GLfloat dudx, dudy, dvdx, dvdy;
564 dudx = (dsdx -
s*dwdx) * invw *
width;
565 dudy = (dsdy -
s*dwdy) * invw *
width;
566 dvdx = (dtdx -
t*dwdx) * invw *
height;
567 dvdy = (dtdy -
t*dwdy) * invw *
height;
569 r1 = dudx * dudx + dudy * dudy;
570 r2 = dvdx * dvdx + dvdy * dvdy;
579 return log(rho2) * 1.442695 * 0.5;
597#define INTERP_ALPHA 1
602 GLboolean flat_shade = (ctx->Light.ShadeModel==GL_FLAT); \
604 GLfloat twidth, theight; \
605 if (ctx->Texture.Enabled & TEXTURE_2D) { \
606 twidth = (GLfloat) ctx->Texture.Current2D->Image[0]->Width; \
607 theight = (GLfloat) ctx->Texture.Current2D->Image[0]->Height; \
610 twidth = (GLfloat) ctx->Texture.Current1D->Image[0]->Width; \
614 r = VB->Color[pv][0]; \
615 g = VB->Color[pv][1]; \
616 b = VB->Color[pv][2]; \
617 a = VB->Color[pv][3]; \
620#define INNER_LOOP( LEFT, RIGHT, Y ) \
622 GLint i, n = RIGHT-LEFT; \
623 GLdepth zspan[MAX_WIDTH]; \
624 GLubyte red[MAX_WIDTH], green[MAX_WIDTH]; \
625 GLubyte blue[MAX_WIDTH], alpha[MAX_WIDTH]; \
626 GLfloat s[MAX_WIDTH], t[MAX_WIDTH], u[MAX_WIDTH]; \
627 DEFARRAY(GLfloat,lambda,MAX_WIDTH); \
630 for (i=0;i<n;i++) { \
631 GLdouble wwvvInv = 1.0 / (ww*vv); \
640 lambda[i] = compute_lambda( s[i], t[i], \
654 for (i=0;i<n;i++) { \
655 GLdouble wwvvInv = 1.0 / (ww*vv); \
657 red[i] = FixedToInt(ffr); \
658 green[i] = FixedToInt(ffg); \
659 blue[i] = FixedToInt(ffb); \
660 alpha[i] = FixedToInt(ffa); \
664 lambda[i] = compute_lambda( s[i], t[i], \
681 gl_write_texture_span( ctx, n, LEFT, Y, zspan, \
683 red, green, blue, alpha, \
686 UNDEFARRAY(lambda); \
717 if (
ctx->Driver.TriangleFunc) {
720 else if (
ctx->Texture.Enabled
721 &&
ctx->Texture.Current
722 &&
ctx->Texture.Current->Complete) {
728 &&
ctx->Texture.Current2D->Image[0]->Format==
GL_RGB
729 &&
ctx->Texture.Current2D->Image[0]->Border==0
737 ||
ctx->RasterMask==0)
739 &&
ctx->Visual->EightBitColor) {
751 if (
ctx->Texture.Current2D->MinFilter==
752 ctx->Texture.Current2D->MagFilter) {
757 if (
ctx->Texture.Current1D->MinFilter==
758 ctx->Texture.Current1D->MagFilter) {
void gl_feedback_vertex(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z, GLfloat w, const GLfloat color[4], GLfloat index, const GLfloat texcoord[4])
void gl_update_hitflag(GLcontext *ctx, GLfloat z)
#define FEEDBACK_TOKEN(CTX, T)
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
GLint GLint GLsizei GLsizei height
GLint GLint GLsizei width
GLfloat GLfloat GLfloat v2
GLubyte GLubyte GLubyte GLubyte w
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
static void flat_rgba_triangle(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint pv)
static void smooth_rgba_triangle(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint pv)
static void simple_textured_triangle(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint pv)
static void flat_ci_triangle(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint pv)
static void feedback_triangle(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint pv)
static void simple_z_textured_triangle(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint pv)
static void null_triangle(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint pv)
static void smooth_ci_triangle(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint pv)
static void lambda_textured_triangle(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint pv)
static GLfloat compute_lambda(GLfloat s, GLfloat t, GLfloat dsdx, GLfloat dsdy, GLfloat dtdx, GLfloat dtdy, GLfloat w, GLfloat dwdx, GLfloat dwdy, GLfloat width, GLfloat height)
static void select_triangle(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint pv)
static void general_textured_triangle(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint pv)
void gl_set_triangle_function(GLcontext *ctx)
struct vertex_buffer * VB