Lines Matching refs:ctx
81 * \param ctx GL context.
87 userclip_point( struct gl_context *ctx, const GLfloat v[] )
91 for (p = 0; p < ctx->Const.MaxClipPlanes; p++) {
92 if (ctx->Transform.ClipPlanesEnabled & (1 << p)) {
93 GLfloat dot = v[0] * ctx->Transform._ClipUserPlane[p][0]
94 + v[1] * ctx->Transform._ClipUserPlane[p][1]
95 + v[2] * ctx->Transform._ClipUserPlane[p][2]
96 + v[3] * ctx->Transform._ClipUserPlane[p][3];
109 * \param ctx the context
116 shade_rastpos(struct gl_context *ctx,
122 /*const*/ GLfloat (*base)[3] = ctx->Light._BaseColor;
128 ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3], 0.0F, 1.0F );
131 foreach (light, &ctx->Light.EnabledList) {
195 if (ctx->Light.Model.LocalViewer) {
204 ACC_3V(VP, ctx->_EyeZDir);
218 shine = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_SHININESS][0];
222 if (ctx->Light.Model.ColorControl==GL_SEPARATE_SPECULAR_COLOR) {
251 * \param ctx rendering context
259 compute_texgen(struct gl_context *ctx, const GLfloat vObj[4], const GLfloat vEye[4],
262 const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
296 _mesa_problem(ctx, "Bad S texgen in compute_texgen()");
319 _mesa_problem(ctx, "Bad T texgen in compute_texgen()");
339 _mesa_problem(ctx, "Bad R texgen in compute_texgen()");
353 _mesa_problem(ctx, "Bad Q texgen in compute_texgen()");
361 * glRasterPos transformation. Typically called via ctx->Driver.RasterPos().
363 * of ctx->Current.Raster* fields) could get lifted up into the
369 _tnl_RasterPos(struct gl_context *ctx, const GLfloat vObj[4])
371 if (ctx->VertexProgram._Enabled) {
373 _mesa_problem(ctx, "Vertex programs not implemented for glRasterPos");
379 GLfloat *objnorm = ctx->Current.Attrib[VERT_ATTRIB_NORMAL];
382 TRANSFORM_POINT( eye, ctx->ModelviewMatrixStack.Top->m, vObj );
384 TRANSFORM_POINT( clip, ctx->ProjectionMatrixStack.Top->m, eye );
387 if (!ctx->Transform.DepthClamp) {
389 ctx->Current.RasterPosValid = GL_FALSE;
393 if (!ctx->Transform.RasterPositionUnclipped) {
395 ctx->Current.RasterPosValid = GL_FALSE;
401 if (ctx->Transform.ClipPlanesEnabled && !userclip_point(ctx, clip)) {
402 ctx->Current.RasterPosValid = GL_FALSE;
412 ctx->Current.RasterPos[0] = (ndc[0] * ctx->Viewport._WindowMap.m[MAT_SX]
413 + ctx->Viewport._WindowMap.m[MAT_TX]);
414 ctx->Current.RasterPos[1] = (ndc[1] * ctx->Viewport._WindowMap.m[MAT_SY]
415 + ctx->Viewport._WindowMap.m[MAT_TY]);
416 ctx->Current.RasterPos[2] = (ndc[2] * ctx->Viewport._WindowMap.m[MAT_SZ]
417 + ctx->Viewport._WindowMap.m[MAT_TZ])
418 / ctx->DrawBuffer->_DepthMaxF;
419 ctx->Current.RasterPos[3] = clip[3];
421 if (ctx->Transform.DepthClamp) {
422 ctx->Current.RasterPos[3] = CLAMP(ctx->Current.RasterPos[3],
423 ctx->Viewport.Near,
424 ctx->Viewport.Far);
428 if (ctx->Fog.FogCoordinateSource == GL_FOG_COORDINATE_EXT)
429 ctx->Current.RasterDistance = ctx->Current.Attrib[VERT_ATTRIB_FOG][0];
431 ctx->Current.RasterDistance =
435 if (ctx->_NeedEyeCoords) {
436 const GLfloat *inv = ctx->ModelviewMatrixStack.Top->inv;
445 if (ctx->Light.Enabled) {
447 shade_rastpos( ctx, vObj, norm,
448 ctx->Current.RasterColor,
449 ctx->Current.RasterSecondaryColor );
453 COPY_4FV(ctx->Current.RasterColor,
454 ctx->Current.Attrib[VERT_ATTRIB_COLOR0]);
455 COPY_4FV(ctx->Current.RasterSecondaryColor,
456 ctx->Current.Attrib[VERT_ATTRIB_COLOR1]);
462 for (u = 0; u < ctx->Const.MaxTextureCoordUnits; u++) {
464 COPY_4V(tc, ctx->Current.Attrib[VERT_ATTRIB_TEX0 + u]);
465 if (ctx->Texture.Unit[u].TexGenEnabled) {
466 compute_texgen(ctx, vObj, eye, norm, u, tc);
468 TRANSFORM_POINT(ctx->Current.RasterTexCoords[u],
469 ctx->TextureMatrixStack[u].Top->m, tc);
473 ctx->Current.RasterPosValid = GL_TRUE;
476 if (ctx->RenderMode == GL_SELECT) {
477 _mesa_update_hitflag( ctx, ctx->Current.RasterPos[2] );