Lines Matching full:stack
103 static void matrix_frustum(struct gl_matrix_stack* stack, in matrix_frustum() argument
121 _math_matrix_frustum(stack->Top, in matrix_frustum()
125 stack->ChangedSincePush = true; in matrix_frustum()
126 ctx->NewState |= stack->DirtyFlag; in matrix_frustum()
143 * the top matrix of the current matrix stack and sets
167 struct gl_matrix_stack *stack = get_named_matrix_stack(ctx, matrixMode, in _mesa_MatrixFrustumEXT() local
169 if (!stack) in _mesa_MatrixFrustumEXT()
172 matrix_frustum(stack, in _mesa_MatrixFrustumEXT()
181 matrix_ortho(struct gl_matrix_stack* stack, in matrix_ortho() argument
203 _math_matrix_ortho( stack->Top, in matrix_ortho()
207 stack->ChangedSincePush = true; in matrix_ortho()
208 ctx->NewState |= stack->DirtyFlag; in matrix_ortho()
225 * the top matrix of the current matrix stack and sets
249 struct gl_matrix_stack *stack = get_named_matrix_stack(ctx, matrixMode, in _mesa_MatrixOrthoEXT() local
251 if (!stack) in _mesa_MatrixOrthoEXT()
254 matrix_ortho(stack, in _mesa_MatrixOrthoEXT()
263 * Set the current matrix stack.
265 * \param mode matrix stack.
271 * with the specified matrix stack.
276 struct gl_matrix_stack * stack; in _mesa_MatrixMode() local
283 stack = NULL; in _mesa_MatrixMode()
285 stack = get_named_matrix_stack(ctx, mode, "glMatrixMode"); in _mesa_MatrixMode()
288 if (stack) { in _mesa_MatrixMode()
289 ctx->CurrentStack = stack; in _mesa_MatrixMode()
297 push_matrix(struct gl_context *ctx, struct gl_matrix_stack *stack, in push_matrix() argument
300 if (stack->Depth + 1 >= stack->MaxDepth) { in push_matrix()
311 if (stack->Depth + 1 >= stack->StackSize) { in push_matrix()
312 unsigned new_stack_size = stack->StackSize * 2; in push_matrix()
314 GLmatrix *new_stack = realloc(stack->Stack, in push_matrix()
322 for (i = stack->StackSize; i < new_stack_size; i++) in push_matrix()
325 stack->Stack = new_stack; in push_matrix()
326 stack->StackSize = new_stack_size; in push_matrix()
329 _math_matrix_push_copy(&stack->Stack[stack->Depth + 1], in push_matrix()
330 &stack->Stack[stack->Depth]); in push_matrix()
331 stack->Depth++; in push_matrix()
332 stack->Top = &(stack->Stack[stack->Depth]); in push_matrix()
333 stack->ChangedSincePush = false; in push_matrix()
338 * Push the current matrix stack.
342 * Verifies the current matrix stack is not full, and duplicates the top-most
343 * matrix in the stack.
344 * Marks __struct gl_contextRec::NewState with the stack dirty flag.
350 struct gl_matrix_stack *stack = ctx->CurrentStack; in _mesa_PushMatrix() local
356 push_matrix(ctx, stack, ctx->Transform.MatrixMode, "glPushMatrix"); in _mesa_PushMatrix()
364 struct gl_matrix_stack *stack = get_named_matrix_stack(ctx, matrixMode, in _mesa_MatrixPushEXT() local
367 if (stack) in _mesa_MatrixPushEXT()
368 push_matrix(ctx, stack, matrixMode, "glMatrixPushEXT"); in _mesa_MatrixPushEXT()
373 pop_matrix( struct gl_context *ctx, struct gl_matrix_stack *stack ) in pop_matrix() argument
375 if (stack->Depth == 0) in pop_matrix()
378 stack->Depth--; in pop_matrix()
383 if (stack->ChangedSincePush && in pop_matrix()
384 memcmp(stack->Top, &stack->Stack[stack->Depth], in pop_matrix()
387 ctx->NewState |= stack->DirtyFlag; in pop_matrix()
390 stack->Top = &(stack->Stack[stack->Depth]); in pop_matrix()
391 stack->ChangedSincePush = true; in pop_matrix()
397 * Pop the current matrix stack.
401 * Flushes the vertices, verifies the current matrix stack is not empty, and
402 * moves the stack head down.
403 * Marks __struct gl_contextRec::NewState with the dirty stack flag.
409 struct gl_matrix_stack *stack = ctx->CurrentStack; in _mesa_PopMatrix() local
415 if (!pop_matrix(ctx, stack)) { in _mesa_PopMatrix()
433 struct gl_matrix_stack *stack = get_named_matrix_stack(ctx, matrixMode, in _mesa_MatrixPopEXT() local
435 if (!stack) in _mesa_MatrixPopEXT()
438 if (!pop_matrix(ctx, stack)) { in _mesa_MatrixPopEXT()
453 _mesa_load_identity_matrix(struct gl_context *ctx, struct gl_matrix_stack *stack) in _mesa_load_identity_matrix() argument
457 _math_matrix_set_identity(stack->Top); in _mesa_load_identity_matrix()
458 stack->ChangedSincePush = true; in _mesa_load_identity_matrix()
459 ctx->NewState |= stack->DirtyFlag; in _mesa_load_identity_matrix()
469 * top-most matrix in the current stack.
470 * Marks __struct gl_contextRec::NewState with the stack dirty flag.
487 struct gl_matrix_stack *stack; in _mesa_MatrixLoadIdentityEXT() local
489 stack = get_named_matrix_stack(ctx, matrixMode, "glMatrixLoadIdentityEXT"); in _mesa_MatrixLoadIdentityEXT()
490 if (!stack) in _mesa_MatrixLoadIdentityEXT()
493 _mesa_load_identity_matrix(ctx, stack); in _mesa_MatrixLoadIdentityEXT()
498 _mesa_load_matrix(struct gl_context *ctx, struct gl_matrix_stack *stack, in _mesa_load_matrix() argument
501 if (memcmp(m, stack->Top->m, 16 * sizeof(GLfloat)) != 0) { in _mesa_load_matrix()
503 _math_matrix_loadf(stack->Top, m); in _mesa_load_matrix()
504 stack->ChangedSincePush = true; in _mesa_load_matrix()
505 ctx->NewState |= stack->DirtyFlag; in _mesa_load_matrix()
511 matrix_load(struct gl_context *ctx, struct gl_matrix_stack *stack, in matrix_load() argument
524 _mesa_load_matrix(ctx, stack, m); in matrix_load()
536 * matrix in the current stack and the given matrix.
537 * Marks __struct gl_contextRec::NewState with the dirty stack flag.
559 struct gl_matrix_stack * stack = in _mesa_MatrixLoadfEXT() local
561 if (!stack) in _mesa_MatrixLoadfEXT()
564 matrix_load(ctx, stack, m, "glMatrixLoadfEXT"); in _mesa_MatrixLoadfEXT()
569 matrix_mult(struct gl_matrix_stack *stack, const GLfloat *m, const char* caller) in matrix_mult() argument
587 _math_matrix_mul_floats(stack->Top, m); in matrix_mult()
588 stack->ChangedSincePush = true; in matrix_mult()
589 ctx->NewState |= stack->DirtyFlag; in matrix_mult()
601 * matrix in the current stack and the given matrix. Marks
602 * __struct gl_contextRec::NewState with the dirty stack flag.
616 struct gl_matrix_stack * stack = in _mesa_MatrixMultfEXT() local
618 if (!stack) in _mesa_MatrixMultfEXT()
621 matrix_mult(stack, m, "glMultMatrix"); in _mesa_MatrixMultfEXT()
626 matrix_rotate(struct gl_matrix_stack *stack, GLfloat angle, in matrix_rotate() argument
633 _math_matrix_rotate(stack->Top, angle, x, y, z); in matrix_rotate()
634 stack->ChangedSincePush = true; in matrix_rotate()
635 ctx->NewState |=stack->DirtyFlag; in matrix_rotate()
651 * matrix in the current stack and the given parameters. Marks
652 * __struct gl_contextRec::NewState with the dirty stack flag.
666 struct gl_matrix_stack *stack = in _mesa_MatrixRotatefEXT() local
668 if (!stack) in _mesa_MatrixRotatefEXT()
671 matrix_rotate(stack, angle, x, y, z, "glMatrixRotatefEXT"); in _mesa_MatrixRotatefEXT()
685 * matrix in the current stack and the given parameters. Marks
686 * __struct gl_contextRec::NewState with the dirty stack flag.
703 struct gl_matrix_stack *stack; in _mesa_MatrixScalefEXT() local
706 stack = get_named_matrix_stack(ctx, matrixMode, "glMatrixScalefEXT"); in _mesa_MatrixScalefEXT()
707 if (!stack) in _mesa_MatrixScalefEXT()
711 _math_matrix_scale(stack->Top, x, y, z); in _mesa_MatrixScalefEXT()
712 stack->ChangedSincePush = true; in _mesa_MatrixScalefEXT()
713 ctx->NewState |= stack->DirtyFlag; in _mesa_MatrixScalefEXT()
727 * matrix in the current stack and the given parameters. Marks
728 * __struct gl_contextRec::NewState with the dirty stack flag.
746 struct gl_matrix_stack *stack = in _mesa_MatrixTranslatefEXT() local
748 if (!stack) in _mesa_MatrixTranslatefEXT()
752 _math_matrix_translate(stack->Top, x, y, z); in _mesa_MatrixTranslatefEXT()
753 stack->ChangedSincePush = true; in _mesa_MatrixTranslatefEXT()
754 ctx->NewState |= stack->DirtyFlag; in _mesa_MatrixTranslatefEXT()
926 * Update the projection matrix stack.
989 /** Matrix stack initialization */
994 * Initialize a matrix stack.
996 * \param stack matrix stack.
997 * \param maxDepth maximum stack depth.
1000 * Allocates an array of \p maxDepth elements for the matrix stack and calls
1004 init_matrix_stack(struct gl_matrix_stack *stack, in init_matrix_stack() argument
1007 stack->Depth = 0; in init_matrix_stack()
1008 stack->MaxDepth = maxDepth; in init_matrix_stack()
1009 stack->DirtyFlag = dirtyFlag; in init_matrix_stack()
1010 /* The stack will be dynamically resized at glPushMatrix() time */ in init_matrix_stack()
1011 stack->Stack = calloc(1, sizeof(GLmatrix)); in init_matrix_stack()
1012 stack->StackSize = 1; in init_matrix_stack()
1013 _math_matrix_ctr(&stack->Stack[0]); in init_matrix_stack()
1014 stack->Top = stack->Stack; in init_matrix_stack()
1015 stack->ChangedSincePush = false; in init_matrix_stack()
1019 * Free matrix stack.
1021 * \param stack matrix stack.
1024 free_matrix_stack( struct gl_matrix_stack *stack ) in free_matrix_stack() argument
1026 free(stack->Stack); in free_matrix_stack()
1027 stack->Stack = stack->Top = NULL; in free_matrix_stack()
1028 stack->StackSize = 0; in free_matrix_stack()