Lines Matching refs:ctx
48 GET_CURRENT_CONTEXT(ctx);
49 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
50 _mesa_set_viewport(ctx, x, y, width, height);
58 * \param ctx GL context.
64 _mesa_set_viewport(struct gl_context *ctx, GLint x, GLint y,
68 _mesa_debug(ctx, "glViewport %d %d %d %d\n", x, y, width, height);
71 _mesa_error(ctx, GL_INVALID_VALUE,
77 width = MIN2(width, (GLsizei) ctx->Const.MaxViewportWidth);
78 height = MIN2(height, (GLsizei) ctx->Const.MaxViewportHeight);
80 ctx->Viewport.X = x;
81 ctx->Viewport.Width = width;
82 ctx->Viewport.Y = y;
83 ctx->Viewport.Height = height;
84 ctx->NewState |= _NEW_VIEWPORT;
91 _math_matrix_viewport(&ctx->Viewport._WindowMap,
92 ctx->Viewport.X, ctx->Viewport.Y,
93 ctx->Viewport.Width, ctx->Viewport.Height,
94 ctx->Viewport.Near, ctx->Viewport.Far,
95 ctx->DrawBuffer->_DepthMaxF);
98 if (ctx->Driver.Viewport) {
102 ctx->Driver.Viewport(ctx, x, y, width, height);
118 GET_CURRENT_CONTEXT(ctx);
119 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
122 _mesa_debug(ctx, "glDepthRange %f %f\n", nearval, farval);
124 if (ctx->Viewport.Near == nearval &&
125 ctx->Viewport.Far == farval)
128 ctx->Viewport.Near = (GLfloat) CLAMP(nearval, 0.0, 1.0);
129 ctx->Viewport.Far = (GLfloat) CLAMP(farval, 0.0, 1.0);
130 ctx->NewState |= _NEW_VIEWPORT;
137 _math_matrix_viewport(&ctx->Viewport._WindowMap,
138 ctx->Viewport.X, ctx->Viewport.Y,
139 ctx->Viewport.Width, ctx->Viewport.Height,
140 ctx->Viewport.Near, ctx->Viewport.Far,
141 ctx->DrawBuffer->_DepthMaxF);
144 if (ctx->Driver.DepthRange) {
145 ctx->Driver.DepthRange(ctx, nearval, farval);
157 * \param ctx the GL context.
159 void _mesa_init_viewport(struct gl_context *ctx)
164 ctx->Viewport.X = 0;
165 ctx->Viewport.Y = 0;
166 ctx->Viewport.Width = 0;
167 ctx->Viewport.Height = 0;
168 ctx->Viewport.Near = 0.0;
169 ctx->Viewport.Far = 1.0;
170 _math_matrix_ctr(&ctx->Viewport._WindowMap);
172 _math_matrix_viewport(&ctx->Viewport._WindowMap, 0, 0, 0, 0,
179 * \param ctx the GL context.
181 void _mesa_free_viewport_data(struct gl_context *ctx)
183 _math_matrix_dtr(&ctx->Viewport._WindowMap);