ReactOS 0.4.15-dev-8231-g29a56f3
vbfill.h File Reference
#include "types.h"
Include dependency graph for vbfill.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void gl_Normal3f (GLcontext *ctx, GLfloat nx, GLfloat ny, GLfloat nz)
 
void gl_Normal3fv (GLcontext *ctx, const GLfloat *normal)
 
void gl_Indexf (GLcontext *ctx, GLfloat c)
 
void gl_Indexi (GLcontext *ctx, GLint c)
 
void gl_Color3f (GLcontext *ctx, GLfloat red, GLfloat green, GLfloat blue)
 
void gl_Color3fv (GLcontext *ctx, const GLfloat *c)
 
void gl_Color4f (GLcontext *ctx, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
 
void gl_Color4fv (GLcontext *ctx, const GLfloat *c)
 
void gl_Color4ub (GLcontext *ctx, GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
 
void gl_Color4ub8bit (GLcontext *ctx, GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
 
void gl_Color4ubv (GLcontext *ctx, const GLubyte *c)
 
void gl_Color4ubv8bit (GLcontext *ctx, const GLubyte *c)
 
void gl_ColorMat3f (GLcontext *ctx, GLfloat red, GLfloat green, GLfloat blue)
 
void gl_ColorMat3fv (GLcontext *ctx, const GLfloat *c)
 
void gl_ColorMat3ub (GLcontext *ctx, GLubyte red, GLubyte green, GLubyte blue)
 
void gl_ColorMat4f (GLcontext *ctx, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
 
void gl_ColorMat4fv (GLcontext *ctx, const GLfloat *c)
 
void gl_ColorMat4ub (GLcontext *ctx, GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
 
void gl_TexCoord2f (GLcontext *ctx, GLfloat s, GLfloat t)
 
void gl_TexCoord4f (GLcontext *ctx, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
 
void gl_EdgeFlag (GLcontext *ctx, GLboolean flag)
 
void gl_vertex2f_nop (GLcontext *ctx, GLfloat x, GLfloat y)
 
void gl_vertex3f_nop (GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z)
 
void gl_vertex4f_nop (GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
 
void gl_vertex3fv_nop (GLcontext *ctx, const GLfloat *v)
 
void gl_set_vertex_function (GLcontext *ctx)
 
void gl_set_color_function (GLcontext *ctx)
 
void gl_eval_vertex (GLcontext *ctx, const GLfloat vertex[4], const GLfloat normal[3], const GLubyte color[4], GLuint index, const GLfloat texcoord[4])
 
void gl_Begin (GLcontext *ctx, GLenum p)
 
void gl_End (GLcontext *ctx)
 

Function Documentation

◆ gl_Begin()

void gl_Begin ( GLcontext ctx,
GLenum  p 
)

Definition at line 1341 of file vbfill.c.

1342{
1343 struct vertex_buffer *VB = ctx->VB;
1344 struct pixel_buffer *PB = ctx->PB;
1345#ifdef PROFILE
1346 begin_time = gl_time();
1347#endif
1348
1349 if (INSIDE_BEGIN_END(ctx)) {
1350 gl_error( ctx, GL_INVALID_OPERATION, "glBegin" );
1351 return;
1352 }
1353 if (ctx->NewModelViewMatrix) {
1355 }
1356 if (ctx->NewProjectionMatrix) {
1358 }
1359 if (ctx->NewState) {
1361 }
1362 else if (ctx->Exec.Vertex3f==gl_vertex3f_nop) {
1364 }
1365
1366 if (ctx->Driver.Begin) {
1367 (*ctx->Driver.Begin)( ctx, p );
1368 }
1369
1370 ctx->Primitive = p;
1371 VB->Start = VB->Count = 0;
1372
1373 VB->MonoColor = ctx->MonoPixels;
1374 VB->MonoNormal = GL_TRUE;
1375 if (VB->MonoColor) {
1376 /* All pixels generated are likely to be the same color so have
1377 * the device driver set the "monocolor" now.
1378 */
1379 if (ctx->Visual->RGBAflag) {
1380 GLubyte r = ctx->Current.ByteColor[0];
1381 GLubyte g = ctx->Current.ByteColor[1];
1382 GLubyte b = ctx->Current.ByteColor[2];
1383 GLubyte a = ctx->Current.ByteColor[3];
1384 (*ctx->Driver.Color)( ctx, r, g, b, a );
1385 }
1386 else {
1387 (*ctx->Driver.Index)( ctx, ctx->Current.Index );
1388 }
1389 }
1390
1391 /* By default use front color/index. Two-sided lighting may override. */
1392 VB->Color = VB->Fcolor;
1393 VB->Index = VB->Findex;
1394
1395 switch (ctx->Primitive) {
1396 case GL_POINTS:
1397 ctx->LightTwoSide = GL_FALSE;
1398 PB_INIT( PB, GL_POINT );
1399 break;
1400 case GL_LINES:
1401 case GL_LINE_STRIP:
1402 case GL_LINE_LOOP:
1403 ctx->LightTwoSide = GL_FALSE;
1404 ctx->StippleCounter = 0;
1405 PB_INIT( PB, GL_LINE );
1406 break;
1407 case GL_TRIANGLES:
1408 case GL_TRIANGLE_STRIP:
1409 case GL_TRIANGLE_FAN:
1410 case GL_QUADS:
1411 case GL_QUAD_STRIP:
1412 case GL_POLYGON:
1413 ctx->LightTwoSide = ctx->Light.Enabled && ctx->Light.Model.TwoSide;
1414 PB_INIT( PB, GL_POLYGON );
1415 break;
1416 default:
1417 gl_error( ctx, GL_INVALID_ENUM, "glBegin" );
1418 ctx->Primitive = GL_BITMAP;
1419 }
1420}
void gl_error(GLcontext *ctx, GLenum error, const char *s)
Definition: context.c:1421
void gl_update_state(GLcontext *ctx)
Definition: context.c:1749
void gl_analyze_modelview_matrix(GLcontext *ctx)
Definition: matrix.c:420
void gl_analyze_projection_matrix(GLcontext *ctx)
Definition: matrix.c:455
#define PB
unsigned char GLubyte
Definition: gl.h:157
#define GL_TRUE
Definition: gl.h:174
#define GL_POINT
Definition: gl.h:265
#define GL_QUADS
Definition: gl.h:197
#define GL_TRIANGLE_FAN
Definition: gl.h:196
#define GL_LINE_STRIP
Definition: gl.h:193
#define GL_LINES
Definition: gl.h:191
#define GL_INVALID_OPERATION
Definition: gl.h:696
#define GL_TRIANGLES
Definition: gl.h:194
#define GL_BITMAP
Definition: gl.h:497
#define GL_POINTS
Definition: gl.h:190
#define GL_LINE
Definition: gl.h:266
#define GL_FALSE
Definition: gl.h:173
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define GL_POLYGON
Definition: gl.h:199
#define GL_LINE_LOOP
Definition: gl.h:192
#define GL_TRIANGLE_STRIP
Definition: gl.h:195
#define GL_INVALID_ENUM
Definition: gl.h:694
#define GL_QUAD_STRIP
Definition: gl.h:198
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean g
Definition: glext.h:6204
GLfloat GLfloat p
Definition: glext.h:8902
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
#define INSIDE_BEGIN_END(CTX)
Definition: macros.h:135
#define PB_INIT(PB, PRIM)
Definition: pb.h:79
struct vertex_buffer * VB
Definition: tritemp.h:139
void gl_vertex3f_nop(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z)
Definition: vbfill.c:1084
void gl_set_vertex_function(GLcontext *ctx)
Definition: vbfill.c:1154

Referenced by execute_list(), gl_DrawArrays(), gl_DrawElements(), gl_EvalMesh1(), gl_EvalMesh2(), gl_Rectf(), and init_exec_pointers().

◆ gl_Color3f()

void gl_Color3f ( GLcontext ctx,
GLfloat  red,
GLfloat  green,
GLfloat  blue 
)

Definition at line 216 of file vbfill.c.

217{
218 ctx->Current.ByteColor[0] = FloatToInt(CLAMP(red , 0.0F, 1.0F) * ctx->Visual->RedScale);
219 ctx->Current.ByteColor[1] = FloatToInt(CLAMP(green, 0.0F, 1.0F) * ctx->Visual->GreenScale);
220 ctx->Current.ByteColor[2] = FloatToInt(CLAMP(blue , 0.0F, 1.0F) * ctx->Visual->BlueScale);
221 ctx->Current.ByteColor[3] = FloatToInt(ctx->Visual->AlphaScale);
222 ASSERT( !ctx->Light.ColorMaterialEnabled );
223 ctx->VB->MonoColor = GL_FALSE;
224}
GLclampf green
Definition: gl.h:1740
GLclampf GLclampf blue
Definition: gl.h:1740
#define red
Definition: linetest.c:67
#define FloatToInt(F)
Definition: mmath.h:56
#define ASSERT(a)
Definition: mode.c:44
#define CLAMP(f, min, max)
Definition: tif_color.c:177

Referenced by gl_set_color_function(), and init_exec_pointers().

◆ gl_Color3fv()

void gl_Color3fv ( GLcontext ctx,
const GLfloat c 
)

Definition at line 246 of file vbfill.c.

247{
248 ctx->Current.ByteColor[0] = FloatToInt(CLAMP(c[0], 0.0F, 1.0F) * ctx->Visual->RedScale);
249 ctx->Current.ByteColor[1] = FloatToInt(CLAMP(c[1], 0.0F, 1.0F) * ctx->Visual->GreenScale);
250 ctx->Current.ByteColor[2] = FloatToInt(CLAMP(c[2], 0.0F, 1.0F) * ctx->Visual->BlueScale);
251 ctx->Current.ByteColor[3] = FloatToInt(ctx->Visual->AlphaScale);
252 ASSERT( !ctx->Light.ColorMaterialEnabled );
253 ctx->VB->MonoColor = GL_FALSE;
254}
const GLubyte * c
Definition: glext.h:8905

Referenced by gl_set_color_function(), and init_exec_pointers().

◆ gl_Color4f()

void gl_Color4f ( GLcontext ctx,
GLfloat  red,
GLfloat  green,
GLfloat  blue,
GLfloat  alpha 
)

Definition at line 277 of file vbfill.c.

279{
280 ctx->Current.ByteColor[0] = FloatToInt(CLAMP(red , 0.0F, 1.0F) * ctx->Visual->RedScale);
281 ctx->Current.ByteColor[1] = FloatToInt(CLAMP(green, 0.0F, 1.0F) * ctx->Visual->GreenScale);
282 ctx->Current.ByteColor[2] = FloatToInt(CLAMP(blue , 0.0F, 1.0F) * ctx->Visual->BlueScale);
283 ctx->Current.ByteColor[3] = FloatToInt(CLAMP(alpha, 0.0F, 1.0F) * ctx->Visual->AlphaScale);
284 ASSERT( !ctx->Light.ColorMaterialEnabled );
285 ctx->VB->MonoColor = GL_FALSE;
286}
GLclampf GLclampf GLclampf alpha
Definition: gl.h:1740

Referenced by gl_set_color_function(), and init_exec_pointers().

◆ gl_Color4fv()

void gl_Color4fv ( GLcontext ctx,
const GLfloat c 
)

Definition at line 309 of file vbfill.c.

310{
311 ctx->Current.ByteColor[0] = FloatToInt(CLAMP(c[0], 0.0F, 1.0F) * ctx->Visual->RedScale);
312 ctx->Current.ByteColor[1] = FloatToInt(CLAMP(c[1], 0.0F, 1.0F) * ctx->Visual->GreenScale);
313 ctx->Current.ByteColor[2] = FloatToInt(CLAMP(c[2], 0.0F, 1.0F) * ctx->Visual->BlueScale);
314 ctx->Current.ByteColor[3] = FloatToInt(CLAMP(c[3], 0.0F, 1.0F) * ctx->Visual->AlphaScale);
315 ASSERT( !ctx->Light.ColorMaterialEnabled );
316 ctx->VB->MonoColor = GL_FALSE;
317}

Referenced by gl_set_color_function(), and init_exec_pointers().

◆ gl_Color4ub()

void gl_Color4ub ( GLcontext ctx,
GLubyte  red,
GLubyte  green,
GLubyte  blue,
GLubyte  alpha 
)

Definition at line 339 of file vbfill.c.

341{
342 ctx->Current.ByteColor[0] = red * ctx->Visual->RedScale * (1.0F/255.0F);
343 ctx->Current.ByteColor[1] = green * ctx->Visual->GreenScale * (1.0F/255.0F);
344 ctx->Current.ByteColor[2] = blue * ctx->Visual->BlueScale * (1.0F/255.0F);
345 ctx->Current.ByteColor[3] = alpha * ctx->Visual->AlphaScale * (1.0F/255.0F);
346 ASSERT( !ctx->Light.ColorMaterialEnabled );
347 ctx->VB->MonoColor = GL_FALSE;
348}

Referenced by gl_set_color_function(), and init_exec_pointers().

◆ gl_Color4ub8bit()

void gl_Color4ub8bit ( GLcontext ctx,
GLubyte  red,
GLubyte  green,
GLubyte  blue,
GLubyte  alpha 
)

Definition at line 355 of file vbfill.c.

357{
358 ASSIGN_4V( ctx->Current.ByteColor, red, green, blue, alpha );
359 ASSERT( !ctx->Light.ColorMaterialEnabled );
360 ctx->VB->MonoColor = GL_FALSE;
361}
#define ASSIGN_4V(V, V0, V1, V2, V3)
Definition: macros.h:128

Referenced by gl_set_color_function().

◆ gl_Color4ubv()

void gl_Color4ubv ( GLcontext ctx,
const GLubyte c 
)

Definition at line 368 of file vbfill.c.

369{
370 ctx->Current.ByteColor[0] = c[0] * ctx->Visual->RedScale * (1.0F/255.0F);
371 ctx->Current.ByteColor[1] = c[1] * ctx->Visual->GreenScale * (1.0F/255.0F);
372 ctx->Current.ByteColor[2] = c[2] * ctx->Visual->BlueScale * (1.0F/255.0F);
373 ctx->Current.ByteColor[3] = c[3] * ctx->Visual->AlphaScale * (1.0F/255.0F);
374 ASSERT( !ctx->Light.ColorMaterialEnabled );
375 ctx->VB->MonoColor = GL_FALSE;
376}

Referenced by gl_set_color_function(), and init_exec_pointers().

◆ gl_Color4ubv8bit()

void gl_Color4ubv8bit ( GLcontext ctx,
const GLubyte c 
)

Definition at line 384 of file vbfill.c.

385{
386 COPY_4UBV( ctx->Current.ByteColor, c );
387 ASSERT( !ctx->Light.ColorMaterialEnabled );
388 ctx->VB->MonoColor = GL_FALSE;
389}
#define COPY_4UBV(DST, SRC)
Definition: macros.h:110

Referenced by gl_set_color_function().

◆ gl_ColorMat3f()

void gl_ColorMat3f ( GLcontext ctx,
GLfloat  red,
GLfloat  green,
GLfloat  blue 
)

Definition at line 396 of file vbfill.c.

397{
398 GLfloat color[4];
399 ctx->Current.ByteColor[0] = FloatToInt(CLAMP(red , 0.0F, 1.0F) * ctx->Visual->RedScale);
400 ctx->Current.ByteColor[1] = FloatToInt(CLAMP(green, 0.0F, 1.0F) * ctx->Visual->GreenScale);
401 ctx->Current.ByteColor[2] = FloatToInt(CLAMP(blue , 0.0F, 1.0F) * ctx->Visual->BlueScale);
402 ctx->Current.ByteColor[3] = FloatToInt(ctx->Visual->AlphaScale);
403 /* update material */
404 ASSERT( ctx->Light.ColorMaterialEnabled );
405 ASSIGN_4V( color, red, green, blue, 1.0F );
406 gl_set_material( ctx, ctx->Light.ColorMaterialBitmask, color );
407 ctx->VB->MonoColor = GL_FALSE;
408}
float GLfloat
Definition: gl.h:161
GLuint color
Definition: glext.h:6243
void gl_set_material(GLcontext *ctx, GLuint bitmask, const GLfloat *params)
Definition: light.c:413

Referenced by gl_set_color_function().

◆ gl_ColorMat3fv()

void gl_ColorMat3fv ( GLcontext ctx,
const GLfloat c 
)

Definition at line 415 of file vbfill.c.

416{
417 GLfloat color[4];
418 ctx->Current.ByteColor[0] = FloatToInt(CLAMP(c[0], 0.0F, 1.0F) * ctx->Visual->RedScale);
419 ctx->Current.ByteColor[1] = FloatToInt(CLAMP(c[1], 0.0F, 1.0F) * ctx->Visual->GreenScale);
420 ctx->Current.ByteColor[2] = FloatToInt(CLAMP(c[2], 0.0F, 1.0F) * ctx->Visual->BlueScale);
421 ctx->Current.ByteColor[3] = FloatToInt(ctx->Visual->AlphaScale);
422 /* update material */
423 ASSERT( ctx->Light.ColorMaterialEnabled );
424 ASSIGN_4V( color, c[0], c[1], c[2], 1.0F );
425 gl_set_material( ctx, ctx->Light.ColorMaterialBitmask, color );
426 ctx->VB->MonoColor = GL_FALSE;
427}

Referenced by gl_set_color_function().

◆ gl_ColorMat3ub()

void gl_ColorMat3ub ( GLcontext ctx,
GLubyte  red,
GLubyte  green,
GLubyte  blue 
)

◆ gl_ColorMat4f()

void gl_ColorMat4f ( GLcontext ctx,
GLfloat  red,
GLfloat  green,
GLfloat  blue,
GLfloat  alpha 
)

Definition at line 434 of file vbfill.c.

436{
437 GLfloat color[4];
438 ctx->Current.ByteColor[0] = FloatToInt(CLAMP(red , 0.0F, 1.0F) * ctx->Visual->RedScale);
439 ctx->Current.ByteColor[1] = FloatToInt(CLAMP(green, 0.0F, 1.0F) * ctx->Visual->GreenScale);
440 ctx->Current.ByteColor[2] = FloatToInt(CLAMP(blue , 0.0F, 1.0F) * ctx->Visual->BlueScale);
441 ctx->Current.ByteColor[3] = FloatToInt(CLAMP(alpha, 0.0F, 1.0F) * ctx->Visual->AlphaScale);
442 /* update material */
443 ASSERT( ctx->Light.ColorMaterialEnabled );
445 gl_set_material( ctx, ctx->Light.ColorMaterialBitmask, color );
446 ctx->VB->MonoColor = GL_FALSE;
447}

Referenced by gl_set_color_function().

◆ gl_ColorMat4fv()

void gl_ColorMat4fv ( GLcontext ctx,
const GLfloat c 
)

Definition at line 454 of file vbfill.c.

455{
456 GLfloat color[4];
457 ctx->Current.ByteColor[0] = FloatToInt(CLAMP(c[0], 0.0F, 1.0F) * ctx->Visual->RedScale);
458 ctx->Current.ByteColor[1] = FloatToInt(CLAMP(c[1], 0.0F, 1.0F) * ctx->Visual->GreenScale);
459 ctx->Current.ByteColor[2] = FloatToInt(CLAMP(c[2], 0.0F, 1.0F) * ctx->Visual->BlueScale);
460 ctx->Current.ByteColor[3] = FloatToInt(CLAMP(c[3], 0.0F, 1.0F) * ctx->Visual->AlphaScale);
461 /* update material */
462 ASSERT( ctx->Light.ColorMaterialEnabled );
463 ASSIGN_4V( color, c[0], c[1], c[2], c[3] );
464 gl_set_material( ctx, ctx->Light.ColorMaterialBitmask, color );
465 ctx->VB->MonoColor = GL_FALSE;
466}

Referenced by gl_set_color_function().

◆ gl_ColorMat4ub()

void gl_ColorMat4ub ( GLcontext ctx,
GLubyte  red,
GLubyte  green,
GLubyte  blue,
GLubyte  alpha 
)

Definition at line 473 of file vbfill.c.

475{
476 GLfloat color[4];
477 if (ctx->Visual->EightBitColor) {
478 ASSIGN_4V( ctx->Current.ByteColor, red, green, blue, alpha );
479 }
480 else {
481 ctx->Current.ByteColor[0] = red * ctx->Visual->RedScale * (1.0F/255.0F);
482 ctx->Current.ByteColor[1] = green * ctx->Visual->GreenScale * (1.0F/255.0F);
483 ctx->Current.ByteColor[2] = blue * ctx->Visual->BlueScale * (1.0F/255.0F);
484 ctx->Current.ByteColor[3] = alpha * ctx->Visual->AlphaScale * (1.0F/255.0F);
485 }
486 /* update material */
487 ASSERT( ctx->Light.ColorMaterialEnabled );
488 color[0] = red * (1.0F/255.0F);
489 color[1] = green * (1.0F/255.0F);
490 color[2] = blue * (1.0F/255.0F);
491 color[3] = alpha * (1.0F/255.0F);
492 gl_set_material( ctx, ctx->Light.ColorMaterialBitmask, color );
493 ctx->VB->MonoColor = GL_FALSE;
494}

Referenced by gl_ColorMat4ubv(), and gl_set_color_function().

◆ gl_EdgeFlag()

void gl_EdgeFlag ( GLcontext ctx,
GLboolean  flag 
)

Definition at line 515 of file vbfill.c.

516{
517 ctx->Current.EdgeFlag = flag;
518}
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 flag
Definition: glfuncs.h:52

Referenced by init_exec_pointers().

◆ gl_End()

void gl_End ( GLcontext ctx)

Definition at line 1424 of file vbfill.c.

1425{
1426 struct pixel_buffer *PB = ctx->PB;
1427 struct vertex_buffer *VB = ctx->VB;
1428
1429 if (ctx->Primitive==GL_BITMAP) {
1430 /* glEnd without glBegin */
1431 gl_error( ctx, GL_INVALID_OPERATION, "glEnd" );
1432 return;
1433 }
1434
1435 if (VB->Count > VB->Start) {
1437 }
1438 if (PB->count>0) {
1440 }
1441
1442 if (ctx->Driver.End) {
1443 (*ctx->Driver.End)(ctx);
1444 }
1445
1446 PB->primitive = ctx->Primitive = GL_BITMAP; /* Default mode */
1447
1448#ifdef PROFILE
1449 ctx->BeginEndTime += gl_time() - begin_time;
1450 ctx->BeginEndCount++;
1451#endif
1452}
void gl_flush_pb(GLcontext *ctx)
Definition: pb.c:136
void gl_transform_vb_part1(GLcontext *ctx, GLboolean allDone)
Definition: vbxform.c:1120

Referenced by execute_list(), gl_DrawArrays(), gl_DrawElements(), gl_EvalMesh1(), gl_EvalMesh2(), gl_Rectf(), and init_exec_pointers().

◆ gl_eval_vertex()

void gl_eval_vertex ( GLcontext ctx,
const GLfloat  vertex[4],
const GLfloat  normal[3],
const GLubyte  color[4],
GLuint  index,
const GLfloat  texcoord[4] 
)

Definition at line 1290 of file vbfill.c.

1295{
1296 struct vertex_buffer *VB = ctx->VB;
1297 GLuint count = VB->Count; /* copy to local var to encourage optimization */
1298
1299 VB->VertexSizeMask = VERTEX4_BIT;
1300 VB->MonoNormal = GL_FALSE;
1301 COPY_4V( VB->Obj[count], vertex );
1302 COPY_3V( VB->Normal[count], normal );
1303 COPY_4UBV( VB->Fcolor[count], color );
1304
1305#ifdef GL_VERSION_1_1
1306 if (ctx->Light.ColorMaterialEnabled
1307 && (ctx->Eval.Map1Color4 || ctx->Eval.Map2Color4)) {
1308 GLfloat fcolor[4];
1309 fcolor[0] = color[0] * ctx->Visual->InvRedScale;
1310 fcolor[1] = color[1] * ctx->Visual->InvGreenScale;
1311 fcolor[2] = color[2] * ctx->Visual->InvBlueScale;
1312 fcolor[3] = color[3] * ctx->Visual->InvAlphaScale;
1313 gl_set_material( ctx, ctx->Light.ColorMaterialBitmask, fcolor );
1314 }
1315#endif
1316 VB->Findex[count] = index;
1317 COPY_4V( VB->TexCoord[count], texcoord );
1318 VB->Edgeflag[count] = ctx->Current.EdgeFlag;
1319
1320 count++;
1321 VB->Count = count;
1322 if (count==VB_MAX) {
1324 }
1325}
#define index(s, c)
Definition: various.h:29
unsigned int GLuint
Definition: gl.h:159
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define COPY_3V(DST, SRC)
Definition: macros.h:98
#define COPY_4V(DST, SRC)
Definition: macros.h:102
@ normal
Definition: optimize.h:166
Definition: mesh.c:4558
#define VERTEX4_BIT
Definition: vb.h:95
#define VB_MAX
Definition: vb.h:86

Referenced by gl_EvalCoord1f(), and gl_EvalCoord2f().

◆ gl_Indexf()

void gl_Indexf ( GLcontext ctx,
GLfloat  c 
)

Definition at line 159 of file vbfill.c.

160{
161 ctx->Current.Index = (GLuint) (GLint) c;
162 ctx->VB->MonoColor = GL_FALSE;
163}
int GLint
Definition: gl.h:156
#define c
Definition: ke_i.h:80

Referenced by init_exec_pointers().

◆ gl_Indexi()

void gl_Indexi ( GLcontext ctx,
GLint  c 
)

Definition at line 169 of file vbfill.c.

170{
171 ctx->Current.Index = (GLuint) c;
172 ctx->VB->MonoColor = GL_FALSE;
173}

Referenced by init_exec_pointers().

◆ gl_Normal3f()

void gl_Normal3f ( GLcontext ctx,
GLfloat  nx,
GLfloat  ny,
GLfloat  nz 
)

Definition at line 130 of file vbfill.c.

131{
132 ctx->Current.Normal[0] = nx;
133 ctx->Current.Normal[1] = ny;
134 ctx->Current.Normal[2] = nz;
135 ctx->VB->MonoNormal = GL_FALSE;
136}
#define nz(x)
GLfloat ny
Definition: glext.h:8896
GLfloat GLfloat GLfloat GLfloat nx
Definition: glext.h:8898

Referenced by init_exec_pointers().

◆ gl_Normal3fv()

void gl_Normal3fv ( GLcontext ctx,
const GLfloat normal 
)

Definition at line 142 of file vbfill.c.

143{
144 ctx->Current.Normal[0] = n[0];
145 ctx->Current.Normal[1] = n[1];
146 ctx->Current.Normal[2] = n[2];
147 ctx->VB->MonoNormal = GL_FALSE;
148}
GLdouble n
Definition: glext.h:7729

Referenced by init_exec_pointers().

◆ gl_set_color_function()

void gl_set_color_function ( GLcontext ctx)

Definition at line 1236 of file vbfill.c.

1237{
1239
1240 if (ctx->Light.ColorMaterialEnabled) {
1241 ctx->Exec.Color3f = gl_ColorMat3f;
1242 ctx->Exec.Color3fv = gl_ColorMat3fv;
1243 ctx->Exec.Color4f = gl_ColorMat4f;
1244 ctx->Exec.Color4fv = gl_ColorMat4fv;
1245 ctx->Exec.Color4ub = gl_ColorMat4ub;
1246 ctx->Exec.Color4ubv = gl_ColorMat4ubv;
1247 }
1248 else if (ctx->Visual->EightBitColor) {
1249 ctx->Exec.Color3f = gl_Color3f8bit;
1250 ctx->Exec.Color3fv = gl_Color3fv8bit;
1251 ctx->Exec.Color4f = gl_Color4f8bit;
1252 ctx->Exec.Color4fv = gl_Color4fv8bit;
1253 ctx->Exec.Color4ub = gl_Color4ub8bit;
1254 ctx->Exec.Color4ubv = gl_Color4ubv8bit;
1255 }
1256 else {
1257 ctx->Exec.Color3f = gl_Color3f;
1258 ctx->Exec.Color3fv = gl_Color3fv;
1259 ctx->Exec.Color4f = gl_Color4f;
1260 ctx->Exec.Color4fv = gl_Color4fv;
1261 ctx->Exec.Color4ub = gl_Color4ub;
1262 ctx->Exec.Color4ubv = gl_Color4ubv;
1263 }
1264 if (!ctx->CompileFlag) {
1265 ctx->API.Color3f = ctx->Exec.Color3f;
1266 ctx->API.Color3fv = ctx->Exec.Color3fv;
1267 ctx->API.Color4f = ctx->Exec.Color4f;
1268 ctx->API.Color4fv = ctx->Exec.Color4fv;
1269 ctx->API.Color4ub = ctx->Exec.Color4ub;
1270 ctx->API.Color4ubv = ctx->Exec.Color4ubv;
1271 }
1272}
void gl_ColorMat4fv(GLcontext *ctx, const GLfloat *c)
Definition: vbfill.c:454
void gl_Color4f(GLcontext *ctx, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
Definition: vbfill.c:277
void gl_ColorMat4ubv(GLcontext *ctx, const GLubyte *c)
Definition: vbfill.c:501
void gl_Color3fv8bit(GLcontext *ctx, const GLfloat *c)
Definition: vbfill.c:261
void gl_Color4fv8bit(GLcontext *ctx, const GLfloat *c)
Definition: vbfill.c:324
void gl_Color4ubv8bit(GLcontext *ctx, const GLubyte *c)
Definition: vbfill.c:384
void gl_ColorMat3fv(GLcontext *ctx, const GLfloat *c)
Definition: vbfill.c:415
void gl_Color4ubv(GLcontext *ctx, const GLubyte *c)
Definition: vbfill.c:368
void gl_ColorMat3f(GLcontext *ctx, GLfloat red, GLfloat green, GLfloat blue)
Definition: vbfill.c:396
void gl_Color4ub(GLcontext *ctx, GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
Definition: vbfill.c:339
void gl_ColorMat4f(GLcontext *ctx, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
Definition: vbfill.c:434
void gl_Color4f8bit(GLcontext *ctx, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
Definition: vbfill.c:293
void gl_Color4ub8bit(GLcontext *ctx, GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
Definition: vbfill.c:355
void gl_Color3fv(GLcontext *ctx, const GLfloat *c)
Definition: vbfill.c:246
void gl_Color4fv(GLcontext *ctx, const GLfloat *c)
Definition: vbfill.c:309
void gl_Color3f8bit(GLcontext *ctx, GLfloat red, GLfloat green, GLfloat blue)
Definition: vbfill.c:231
void gl_Color3f(GLcontext *ctx, GLfloat red, GLfloat green, GLfloat blue)
Definition: vbfill.c:216
void gl_ColorMat4ub(GLcontext *ctx, GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
Definition: vbfill.c:473

Referenced by gl_enable(), and gl_update_state().

◆ gl_set_vertex_function()

void gl_set_vertex_function ( GLcontext ctx)

Definition at line 1154 of file vbfill.c.

1155{
1156 if (ctx->RenderMode==GL_FEEDBACK) {
1157 ctx->Exec.Vertex4f = vertex4f_feedback;
1158 ctx->Exec.Vertex3f = vertex3f_feedback;
1159 ctx->Exec.Vertex2f = vertex2f_feedback;
1160 ctx->Exec.Vertex3fv = vertex3fv_feedback;
1161 }
1162 else {
1163 ctx->Exec.Vertex4f = vertex4;
1164 if (ctx->Visual->RGBAflag) {
1165 if (ctx->NeedNormals) {
1166 /* lighting enabled, need normal vectors */
1167 if (ctx->Texture.Enabled) {
1168 if (ctx->VB->TexCoordSize==2) {
1169 ctx->Exec.Vertex2f = vertex2f_normal_color_tex2;
1170 ctx->Exec.Vertex3f = vertex3f_normal_color_tex2;
1171 ctx->Exec.Vertex3fv = vertex3fv_normal_color_tex2;
1172 }
1173 else {
1174 ctx->Exec.Vertex2f = vertex2f_normal_color_tex4;
1175 ctx->Exec.Vertex3f = vertex3f_normal_color_tex4;
1176 ctx->Exec.Vertex3fv = vertex3fv_normal_color_tex4;
1177 }
1178 }
1179 else {
1180 ctx->Exec.Vertex2f = vertex2f_normal;
1181 ctx->Exec.Vertex3f = vertex3f_normal;
1182 ctx->Exec.Vertex3fv = vertex3fv_normal;
1183 }
1184 }
1185 else {
1186 /* not lighting, need vertex color */
1187 if (ctx->Texture.Enabled) {
1188 if (ctx->VB->TexCoordSize==2) {
1189 ctx->Exec.Vertex2f = vertex2f_color_tex2;
1190 ctx->Exec.Vertex3f = vertex3f_color_tex2;
1191 ctx->Exec.Vertex3fv = vertex3fv_color_tex2;
1192 }
1193 else {
1194 ctx->Exec.Vertex2f = vertex2f_color_tex4;
1195 ctx->Exec.Vertex3f = vertex3f_color_tex4;
1196 ctx->Exec.Vertex3fv = vertex3fv_color_tex4;
1197 }
1198 }
1199 else {
1200 ctx->Exec.Vertex2f = vertex2f_color;
1201 ctx->Exec.Vertex3f = vertex3f_color;
1202 ctx->Exec.Vertex3fv = vertex3fv_color;
1203 }
1204 }
1205 }
1206 else {
1207 /* color index mode */
1208 if (ctx->Light.Enabled) {
1209 ctx->Exec.Vertex2f = vertex2f_normal;
1210 ctx->Exec.Vertex3f = vertex3f_normal;
1211 ctx->Exec.Vertex3fv = vertex3fv_normal;
1212 }
1213 else {
1214 ctx->Exec.Vertex2f = vertex2f_index;
1215 ctx->Exec.Vertex3f = vertex3f_index;
1216 ctx->Exec.Vertex3fv = vertex3fv_index;
1217 }
1218 }
1219 }
1220
1221 if (!ctx->CompileFlag) {
1222 ctx->API.Vertex2f = ctx->Exec.Vertex2f;
1223 ctx->API.Vertex3f = ctx->Exec.Vertex3f;
1224 ctx->API.Vertex4f = ctx->Exec.Vertex4f;
1225 ctx->API.Vertex3fv = ctx->Exec.Vertex3fv;
1226 }
1227}
#define GL_FEEDBACK
Definition: gl.h:387
static void vertex2f_feedback(GLcontext *ctx, GLfloat x, GLfloat y)
Definition: vbfill.c:568
static void vertex3f_color_tex4(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z)
Definition: vbfill.c:703
static void vertex3fv_normal_color_tex2(GLcontext *ctx, const GLfloat v[3])
Definition: vbfill.c:924
static void vertex2f_color(GLcontext *ctx, GLfloat x, GLfloat y)
Definition: vbfill.c:880
static void vertex4f_feedback(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
Definition: vbfill.c:530
static void vertex3fv_normal(GLcontext *ctx, const GLfloat v[3])
Definition: vbfill.c:970
static void vertex4(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
Definition: vbfill.c:585
static void vertex2f_normal_color_tex4(GLcontext *ctx, GLfloat x, GLfloat y)
Definition: vbfill.c:792
static void vertex3fv_color_tex4(GLcontext *ctx, const GLfloat v[3])
Definition: vbfill.c:1013
static void vertex3f_feedback(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z)
Definition: vbfill.c:562
static void vertex2f_color_tex2(GLcontext *ctx, GLfloat x, GLfloat y)
Definition: vbfill.c:836
static void vertex2f_normal(GLcontext *ctx, GLfloat x, GLfloat y)
Definition: vbfill.c:815
static void vertex2f_color_tex4(GLcontext *ctx, GLfloat x, GLfloat y)
Definition: vbfill.c:858
static void vertex3fv_color_tex2(GLcontext *ctx, const GLfloat v[3])
Definition: vbfill.c:991
static void vertex3f_normal_color_tex2(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z)
Definition: vbfill.c:611
static void vertex3fv_normal_color_tex4(GLcontext *ctx, const GLfloat v[3])
Definition: vbfill.c:947
static void vertex2f_normal_color_tex2(GLcontext *ctx, GLfloat x, GLfloat y)
Definition: vbfill.c:769
static void vertex3fv_color(GLcontext *ctx, const GLfloat v[3])
Definition: vbfill.c:1035
static void vertex3f_color_tex2(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z)
Definition: vbfill.c:680
static void vertex3f_normal(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z)
Definition: vbfill.c:659
static void vertex3f_color(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z)
Definition: vbfill.c:726
static void vertex3fv_index(GLcontext *ctx, const GLfloat v[3])
Definition: vbfill.c:1056
static void vertex2f_index(GLcontext *ctx, GLfloat x, GLfloat y)
Definition: vbfill.c:901
static void vertex3f_normal_color_tex4(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z)
Definition: vbfill.c:635
static void vertex3f_index(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z)
Definition: vbfill.c:747
static void vertex3fv_feedback(GLcontext *ctx, const GLfloat v[3])
Definition: vbfill.c:574

Referenced by execute_list(), gl_Begin(), gl_TexCoord4f(), and gl_update_state().

◆ gl_TexCoord2f()

void gl_TexCoord2f ( GLcontext ctx,
GLfloat  s,
GLfloat  t 
)

Definition at line 1109 of file vbfill.c.

1110{
1111 ctx->Current.TexCoord[0] = s;
1112 ctx->Current.TexCoord[1] = t;
1113}
GLdouble s
Definition: gl.h:2039
GLdouble GLdouble t
Definition: gl.h:2047

Referenced by init_exec_pointers().

◆ gl_TexCoord4f()

void gl_TexCoord4f ( GLcontext ctx,
GLfloat  s,
GLfloat  t,
GLfloat  r,
GLfloat  q 
)

Definition at line 1132 of file vbfill.c.

1133{
1134 ctx->Current.TexCoord[0] = s;
1135 ctx->Current.TexCoord[1] = t;
1136 ctx->Current.TexCoord[2] = r;
1137 ctx->Current.TexCoord[3] = q;
1138 if (ctx->VB->TexCoordSize==2) {
1139 /* Have to switch to 4-component texture mode now */
1140 ctx->VB->TexCoordSize = 4;
1142 ctx->Exec.TexCoord2f = ctx->API.TexCoord2f = gl_TexCoord2f4;
1143 }
1144}
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
void gl_TexCoord2f4(GLcontext *ctx, GLfloat s, GLfloat t)
Definition: vbfill.c:1120

Referenced by init_exec_pointers().

◆ gl_vertex2f_nop()

void gl_vertex2f_nop ( GLcontext ctx,
GLfloat  x,
GLfloat  y 
)

Definition at line 1089 of file vbfill.c.

1090{
1091 gl_error( ctx, GL_INVALID_OPERATION, "glVertex2" );
1092}

Referenced by init_exec_pointers().

◆ gl_vertex3f_nop()

void gl_vertex3f_nop ( GLcontext ctx,
GLfloat  x,
GLfloat  y,
GLfloat  z 
)

Definition at line 1084 of file vbfill.c.

1085{
1086 gl_error( ctx, GL_INVALID_OPERATION, "glVertex3" );
1087}

Referenced by gl_Begin(), and init_exec_pointers().

◆ gl_vertex3fv_nop()

void gl_vertex3fv_nop ( GLcontext ctx,
const GLfloat v 
)

◆ gl_vertex4f_nop()

void gl_vertex4f_nop ( GLcontext ctx,
GLfloat  x,
GLfloat  y,
GLfloat  z,
GLfloat  w 
)

Definition at line 1078 of file vbfill.c.

1080{
1081 gl_error( ctx, GL_INVALID_OPERATION, "glVertex4" );
1082}

Referenced by init_exec_pointers().