Lines Matching refs:ctx

56    GET_CURRENT_CONTEXT(ctx);
59 _mesa_debug(ctx, "glCullFace %s\n", _mesa_enum_to_string(mode));
62 _mesa_error( ctx, GL_INVALID_ENUM, "glCullFace" );
66 if (ctx->Polygon.CullFaceMode == mode)
69 FLUSH_VERTICES(ctx, _NEW_POLYGON);
70 ctx->Polygon.CullFaceMode = mode;
72 if (ctx->Driver.CullFace)
73 ctx->Driver.CullFace( ctx, mode );
91 GET_CURRENT_CONTEXT(ctx);
94 _mesa_debug(ctx, "glFrontFace %s\n", _mesa_enum_to_string(mode));
96 if (ctx->Polygon.FrontFace == mode)
100 _mesa_error( ctx, GL_INVALID_ENUM, "glFrontFace" );
104 FLUSH_VERTICES(ctx, _NEW_POLYGON);
105 ctx->Polygon.FrontFace = mode;
107 if (ctx->Driver.FrontFace)
108 ctx->Driver.FrontFace( ctx, mode );
127 GET_CURRENT_CONTEXT(ctx);
130 _mesa_debug(ctx, "glPolygonMode %s %s\n",
135 _mesa_error( ctx, GL_INVALID_ENUM, "glPolygonMode(mode)" );
141 if (ctx->API == API_OPENGL_CORE) {
142 _mesa_error( ctx, GL_INVALID_ENUM, "glPolygonMode(face)" );
145 if (ctx->Polygon.FrontMode == mode)
147 FLUSH_VERTICES(ctx, _NEW_POLYGON);
148 ctx->Polygon.FrontMode = mode;
151 if (ctx->Polygon.FrontMode == mode &&
152 ctx->Polygon.BackMode == mode)
154 FLUSH_VERTICES(ctx, _NEW_POLYGON);
155 ctx->Polygon.FrontMode = mode;
156 ctx->Polygon.BackMode = mode;
159 if (ctx->API == API_OPENGL_CORE) {
160 _mesa_error( ctx, GL_INVALID_ENUM, "glPolygonMode(face)" );
163 if (ctx->Polygon.BackMode == mode)
165 FLUSH_VERTICES(ctx, _NEW_POLYGON);
166 ctx->Polygon.BackMode = mode;
169 _mesa_error( ctx, GL_INVALID_ENUM, "glPolygonMode(face)" );
173 if (ctx->Driver.PolygonMode)
174 ctx->Driver.PolygonMode(ctx, face, mode);
184 GET_CURRENT_CONTEXT(ctx);
187 _mesa_debug(ctx, "glPolygonStipple\n");
189 FLUSH_VERTICES(ctx, _NEW_POLYGONSTIPPLE);
191 pattern = _mesa_map_validate_pbo_source(ctx, 2,
192 &ctx->Unpack, 32, 32, 1,
199 _mesa_unpack_polygon_stipple(pattern, ctx->PolygonStipple, &ctx->Unpack);
201 _mesa_unmap_pbo_source(ctx, &ctx->Unpack);
203 if (ctx->Driver.PolygonStipple)
204 ctx->Driver.PolygonStipple(ctx, pattern);
214 GET_CURRENT_CONTEXT(ctx);
217 _mesa_debug(ctx, "glGetPolygonStipple\n");
219 dest = _mesa_map_validate_pbo_dest(ctx, 2,
220 &ctx->Pack, 32, 32, 1,
226 _mesa_pack_polygon_stipple(ctx->PolygonStipple, dest, &ctx->Pack);
228 _mesa_unmap_pbo_dest(ctx, &ctx->Pack);
239 _mesa_polygon_offset_clamp(struct gl_context *ctx,
242 if (ctx->Polygon.OffsetFactor == factor &&
243 ctx->Polygon.OffsetUnits == units &&
244 ctx->Polygon.OffsetClamp == clamp)
247 FLUSH_VERTICES(ctx, _NEW_POLYGON);
248 ctx->Polygon.OffsetFactor = factor;
249 ctx->Polygon.OffsetUnits = units;
250 ctx->Polygon.OffsetClamp = clamp;
252 if (ctx->Driver.PolygonOffset)
253 ctx->Driver.PolygonOffset( ctx, factor, units, clamp );
259 GET_CURRENT_CONTEXT(ctx);
262 _mesa_debug(ctx, "glPolygonOffset %f %f\n", factor, units);
264 _mesa_polygon_offset_clamp(ctx, factor, units, 0.0);
271 GET_CURRENT_CONTEXT(ctx);
273 _mesa_PolygonOffset(factor, bias * ctx->DrawBuffer->_DepthMaxF );
279 GET_CURRENT_CONTEXT(ctx);
281 if (!ctx->Extensions.EXT_polygon_offset_clamp) {
282 _mesa_error(ctx, GL_INVALID_OPERATION,
288 _mesa_debug(ctx, "glPolygonOffsetClampEXT %f %f %f\n", factor, units, clamp);
290 _mesa_polygon_offset_clamp(ctx, factor, units, clamp);
302 * \param ctx GL context.
307 void _mesa_init_polygon( struct gl_context * ctx )
310 ctx->Polygon.CullFlag = GL_FALSE;
311 ctx->Polygon.CullFaceMode = GL_BACK;
312 ctx->Polygon.FrontFace = GL_CCW;
313 ctx->Polygon._FrontBit = 0;
314 ctx->Polygon.FrontMode = GL_FILL;
315 ctx->Polygon.BackMode = GL_FILL;
316 ctx->Polygon.SmoothFlag = GL_FALSE;
317 ctx->Polygon.StippleFlag = GL_FALSE;
318 ctx->Polygon.OffsetFactor = 0.0F;
319 ctx->Polygon.OffsetUnits = 0.0F;
320 ctx->Polygon.OffsetClamp = 0.0F;
321 ctx->Polygon.OffsetPoint = GL_FALSE;
322 ctx->Polygon.OffsetLine = GL_FALSE;
323 ctx->Polygon.OffsetFill = GL_FALSE;
327 memset( ctx->PolygonStipple, 0xff, 32*sizeof(GLuint) );