132 ctx->Current.Normal[0] =
nx;
133 ctx->Current.Normal[1] =
ny;
134 ctx->Current.Normal[2] =
nz;
144 ctx->Current.Normal[0] =
n[0];
145 ctx->Current.Normal[1] =
n[1];
146 ctx->Current.Normal[2] =
n[2];
186#if defined(USE_IEEE) && !defined(DEBUG) && 0
188#define IEEE_ONE 0x3f7f0000
195#define FLOAT_COLOR_TO_UBYTE_COLOR(b, f) \
197 GLfloat tmp = f + 32768.0F; \
198 b = ((*(GLuint *)&f >= IEEE_ONE) \
199 ? (*(GLint *)&f < 0) ? (GLubyte)0 : (GLubyte)255 \
200 : (GLubyte)*(GLuint *)&tmp); \
205#define FLOAT_COLOR_TO_UBYTE_COLOR(b, f) \
206 b = FloatToInt(CLAMP(f, 0.0F, 1.0F) * 255.0F)
222 ASSERT( !
ctx->Light.ColorMaterialEnabled );
236 ctx->Current.ByteColor[3] = 255;
237 ASSERT( !
ctx->Light.ColorMaterialEnabled );
252 ASSERT( !
ctx->Light.ColorMaterialEnabled );
266 ctx->Current.ByteColor[3] = 255;
267 ASSERT( !
ctx->Light.ColorMaterialEnabled );
284 ASSERT( !
ctx->Light.ColorMaterialEnabled );
300 ASSERT( !
ctx->Light.ColorMaterialEnabled );
315 ASSERT( !
ctx->Light.ColorMaterialEnabled );
330 ASSERT( !
ctx->Light.ColorMaterialEnabled );
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 );
359 ASSERT( !
ctx->Light.ColorMaterialEnabled );
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 );
387 ASSERT( !
ctx->Light.ColorMaterialEnabled );
404 ASSERT(
ctx->Light.ColorMaterialEnabled );
423 ASSERT(
ctx->Light.ColorMaterialEnabled );
443 ASSERT(
ctx->Light.ColorMaterialEnabled );
462 ASSERT(
ctx->Light.ColorMaterialEnabled );
477 if (
ctx->Visual->EightBitColor) {
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);
487 ASSERT(
ctx->Light.ColorMaterialEnabled );
1111 ctx->Current.TexCoord[0] =
s;
1112 ctx->Current.TexCoord[1] =
t;
1122 ctx->Current.TexCoord[0] =
s;
1123 ctx->Current.TexCoord[1] =
t;
1124 ctx->Current.TexCoord[2] = 0.0F;
1125 ctx->Current.TexCoord[3] = 1.0F;
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) {
1140 ctx->VB->TexCoordSize = 4;
1164 if (
ctx->Visual->RGBAflag) {
1165 if (
ctx->NeedNormals) {
1167 if (
ctx->Texture.Enabled) {
1168 if (
ctx->VB->TexCoordSize==2) {
1187 if (
ctx->Texture.Enabled) {
1188 if (
ctx->VB->TexCoordSize==2) {
1208 if (
ctx->Light.Enabled) {
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;
1240 if (
ctx->Light.ColorMaterialEnabled) {
1248 else if (
ctx->Visual->EightBitColor) {
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;
1305#ifdef GL_VERSION_1_1
1306 if (
ctx->Light.ColorMaterialEnabled
1307 && (
ctx->Eval.Map1Color4 ||
ctx->Eval.Map2Color4)) {
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;
1346 begin_time = gl_time();
1353 if (
ctx->NewModelViewMatrix) {
1356 if (
ctx->NewProjectionMatrix) {
1359 if (
ctx->NewState) {
1366 if (
ctx->Driver.Begin) {
1367 (*
ctx->Driver.Begin)(
ctx,
p );
1371 VB->Start =
VB->Count = 0;
1373 VB->MonoColor =
ctx->MonoPixels;
1375 if (
VB->MonoColor) {
1379 if (
ctx->Visual->RGBAflag) {
1387 (*
ctx->Driver.Index)(
ctx,
ctx->Current.Index );
1392 VB->Color =
VB->Fcolor;
1393 VB->Index =
VB->Findex;
1395 switch (
ctx->Primitive) {
1404 ctx->StippleCounter = 0;
1413 ctx->LightTwoSide =
ctx->Light.Enabled &&
ctx->Light.Model.TwoSide;
1435 if (
VB->Count >
VB->Start) {
1442 if (
ctx->Driver.End) {
1449 ctx->BeginEndTime += gl_time() - begin_time;
1450 ctx->BeginEndCount++;
void gl_error(GLcontext *ctx, GLenum error, const char *s)
void gl_update_state(GLcontext *ctx)
void gl_analyze_modelview_matrix(GLcontext *ctx)
void gl_analyze_projection_matrix(GLcontext *ctx)
GLint GLint GLint GLint GLint x
#define GL_INVALID_OPERATION
GLclampf GLclampf GLclampf alpha
GLint GLint GLint GLint GLint GLint y
GLuint GLuint GLsizei count
GLdouble GLdouble GLdouble r
#define GL_TRIANGLE_STRIP
GLdouble GLdouble GLdouble GLdouble q
GLboolean GLboolean GLboolean b
GLfloat GLfloat GLfloat GLfloat nx
GLboolean GLboolean GLboolean GLboolean a
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 flag
#define ASSIGN_4V(V, V0, V1, V2, V3)
#define COPY_2V(DST, SRC)
#define INSIDE_BEGIN_END(CTX)
#define ASSIGN_3V(V, V0, V1, V2)
#define COPY_3V(DST, SRC)
#define COPY_4UBV(DST, SRC)
#define COPY_4V(DST, SRC)
void gl_set_material(GLcontext *ctx, GLuint bitmask, const GLfloat *params)
void gl_flush_pb(GLcontext *ctx)
#define PB_INIT(PB, PRIM)
#define CLAMP(f, min, max)
struct vertex_buffer * VB
void gl_ColorMat4fv(GLcontext *ctx, const GLfloat *c)
static void vertex2f_feedback(GLcontext *ctx, GLfloat x, GLfloat y)
static void vertex3f_color_tex4(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z)
void gl_End(GLcontext *ctx)
static void vertex3fv_normal_color_tex2(GLcontext *ctx, const GLfloat v[3])
void gl_Color4f(GLcontext *ctx, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
static void vertex2f_color(GLcontext *ctx, GLfloat x, GLfloat y)
void gl_Normal3fv(GLcontext *ctx, const GLfloat *n)
static void vertex4f_feedback(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
void gl_set_color_function(GLcontext *ctx)
void gl_vertex4f_nop(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
void gl_ColorMat4ubv(GLcontext *ctx, const GLubyte *c)
static void vertex3fv_normal(GLcontext *ctx, const GLfloat v[3])
static void vertex4(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
static void vertex2f_normal_color_tex4(GLcontext *ctx, GLfloat x, GLfloat y)
void gl_vertex3f_nop(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z)
void gl_TexCoord2f4(GLcontext *ctx, GLfloat s, GLfloat t)
static void vertex3fv_color_tex4(GLcontext *ctx, const GLfloat v[3])
void gl_Indexi(GLcontext *ctx, GLint c)
static void vertex3f_feedback(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z)
void gl_Color3fv8bit(GLcontext *ctx, const GLfloat *c)
#define FLOAT_COLOR_TO_UBYTE_COLOR(b, f)
static void vertex2f_color_tex2(GLcontext *ctx, GLfloat x, GLfloat y)
static void vertex2f_normal(GLcontext *ctx, GLfloat x, GLfloat y)
static void vertex2f_color_tex4(GLcontext *ctx, GLfloat x, GLfloat y)
void gl_Color4fv8bit(GLcontext *ctx, const GLfloat *c)
static void vertex3fv_color_tex2(GLcontext *ctx, const GLfloat v[3])
static void vertex3f_normal_color_tex2(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z)
static void vertex3fv_normal_color_tex4(GLcontext *ctx, const GLfloat v[3])
void gl_Begin(GLcontext *ctx, GLenum p)
static void vertex2f_normal_color_tex2(GLcontext *ctx, GLfloat x, GLfloat y)
void gl_Normal3f(GLcontext *ctx, GLfloat nx, GLfloat ny, GLfloat nz)
void gl_Color4ubv8bit(GLcontext *ctx, const GLubyte *c)
void gl_ColorMat3fv(GLcontext *ctx, const GLfloat *c)
void gl_Color4ubv(GLcontext *ctx, const GLubyte *c)
void gl_vertex3fv_nop(GLcontext *ctx, const GLfloat v[3])
static void vertex3fv_color(GLcontext *ctx, const GLfloat v[3])
static void vertex3f_color_tex2(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z)
void gl_ColorMat3f(GLcontext *ctx, GLfloat red, GLfloat green, GLfloat blue)
void gl_Indexf(GLcontext *ctx, GLfloat c)
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_Color4ub(GLcontext *ctx, GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
static void vertex3f_normal(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z)
static void vertex3f_color(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z)
void gl_TexCoord2f(GLcontext *ctx, GLfloat s, GLfloat t)
void gl_ColorMat4f(GLcontext *ctx, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
void gl_Color4f8bit(GLcontext *ctx, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
void gl_Color4ub8bit(GLcontext *ctx, GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
static void vertex3fv_index(GLcontext *ctx, const GLfloat v[3])
void gl_TexCoord4f(GLcontext *ctx, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
void gl_EdgeFlag(GLcontext *ctx, GLboolean flag)
void gl_Color3fv(GLcontext *ctx, const GLfloat *c)
static void vertex2f_index(GLcontext *ctx, GLfloat x, GLfloat y)
void gl_Color4fv(GLcontext *ctx, const GLfloat *c)
void gl_Color3f8bit(GLcontext *ctx, GLfloat red, GLfloat green, GLfloat blue)
void gl_vertex2f_nop(GLcontext *ctx, GLfloat x, GLfloat y)
static void vertex3f_normal_color_tex4(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z)
void gl_set_vertex_function(GLcontext *ctx)
static void vertex3f_index(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z)
static void vertex3fv_feedback(GLcontext *ctx, const GLfloat v[3])
void gl_Color3f(GLcontext *ctx, GLfloat red, GLfloat green, GLfloat blue)
void gl_ColorMat4ub(GLcontext *ctx, GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)