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 ctx->NewState |= stack->DirtyFlag; in matrix_frustum()
142 * the top matrix of the current matrix stack and sets
166 struct gl_matrix_stack *stack = get_named_matrix_stack(ctx, matrixMode, in _mesa_MatrixFrustumEXT() local
168 if (!stack) in _mesa_MatrixFrustumEXT()
171 matrix_frustum(stack, in _mesa_MatrixFrustumEXT()
180 matrix_ortho(struct gl_matrix_stack* stack, in matrix_ortho() argument
202 _math_matrix_ortho( stack->Top, in matrix_ortho()
206 ctx->NewState |= stack->DirtyFlag; in matrix_ortho()
223 * the top matrix of the current matrix stack and sets
247 struct gl_matrix_stack *stack = get_named_matrix_stack(ctx, matrixMode, in _mesa_MatrixOrthoEXT() local
249 if (!stack) in _mesa_MatrixOrthoEXT()
252 matrix_ortho(stack, in _mesa_MatrixOrthoEXT()
261 * Set the current matrix stack.
263 * \param mode matrix stack.
269 * with the specified matrix stack.
274 struct gl_matrix_stack * stack; in _mesa_MatrixMode() local
281 stack = NULL; in _mesa_MatrixMode()
283 stack = get_named_matrix_stack(ctx, mode, "glMatrixMode"); in _mesa_MatrixMode()
286 if (stack) { in _mesa_MatrixMode()
287 ctx->CurrentStack = stack; in _mesa_MatrixMode()
295 push_matrix(struct gl_context *ctx, struct gl_matrix_stack *stack, in push_matrix() argument
298 if (stack->Depth + 1 >= stack->MaxDepth) { in push_matrix()
309 if (stack->Depth + 1 >= stack->StackSize) { in push_matrix()
310 unsigned new_stack_size = stack->StackSize * 2; in push_matrix()
312 GLmatrix *new_stack = realloc(stack->Stack, in push_matrix()
320 for (i = stack->StackSize; i < new_stack_size; i++) in push_matrix()
323 stack->Stack = new_stack; in push_matrix()
324 stack->StackSize = new_stack_size; in push_matrix()
327 _math_matrix_push_copy(&stack->Stack[stack->Depth + 1], in push_matrix()
328 &stack->Stack[stack->Depth]); in push_matrix()
329 stack->Depth++; in push_matrix()
330 stack->Top = &(stack->Stack[stack->Depth]); in push_matrix()
335 * Push the current matrix stack.
339 * Verifies the current matrix stack is not full, and duplicates the top-most
340 * matrix in the stack.
341 * Marks __struct gl_contextRec::NewState with the stack dirty flag.
347 struct gl_matrix_stack *stack = ctx->CurrentStack; in _mesa_PushMatrix() local
353 push_matrix(ctx, stack, ctx->Transform.MatrixMode, "glPushMatrix"); in _mesa_PushMatrix()
361 struct gl_matrix_stack *stack = get_named_matrix_stack(ctx, matrixMode, in _mesa_MatrixPushEXT() local
364 if (stack) in _mesa_MatrixPushEXT()
365 push_matrix(ctx, stack, matrixMode, "glMatrixPushEXT"); in _mesa_MatrixPushEXT()
370 pop_matrix( struct gl_context *ctx, struct gl_matrix_stack *stack ) in pop_matrix() argument
372 if (stack->Depth == 0) in pop_matrix()
375 stack->Depth--; in pop_matrix()
380 if (memcmp(stack->Top, &stack->Stack[stack->Depth], in pop_matrix()
383 ctx->NewState |= stack->DirtyFlag; in pop_matrix()
386 stack->Top = &(stack->Stack[stack->Depth]); in pop_matrix()
392 * Pop the current matrix stack.
396 * Flushes the vertices, verifies the current matrix stack is not empty, and
397 * moves the stack head down.
398 * Marks __struct gl_contextRec::NewState with the dirty stack flag.
404 struct gl_matrix_stack *stack = ctx->CurrentStack; in _mesa_PopMatrix() local
410 if (!pop_matrix(ctx, stack)) { in _mesa_PopMatrix()
428 struct gl_matrix_stack *stack = get_named_matrix_stack(ctx, matrixMode, in _mesa_MatrixPopEXT() local
430 if (!stack) in _mesa_MatrixPopEXT()
433 if (!pop_matrix(ctx, stack)) { in _mesa_MatrixPopEXT()
448 _mesa_load_identity_matrix(struct gl_context *ctx, struct gl_matrix_stack *stack) in _mesa_load_identity_matrix() argument
452 _math_matrix_set_identity(stack->Top); in _mesa_load_identity_matrix()
453 ctx->NewState |= stack->DirtyFlag; in _mesa_load_identity_matrix()
463 * top-most matrix in the current stack.
464 * Marks __struct gl_contextRec::NewState with the stack dirty flag.
481 struct gl_matrix_stack *stack; in _mesa_MatrixLoadIdentityEXT() local
483 stack = get_named_matrix_stack(ctx, matrixMode, "glMatrixLoadIdentityEXT"); in _mesa_MatrixLoadIdentityEXT()
484 if (!stack) in _mesa_MatrixLoadIdentityEXT()
487 _mesa_load_identity_matrix(ctx, stack); in _mesa_MatrixLoadIdentityEXT()
492 _mesa_load_matrix(struct gl_context *ctx, struct gl_matrix_stack *stack, in _mesa_load_matrix() argument
495 if (memcmp(m, stack->Top->m, 16 * sizeof(GLfloat)) != 0) { in _mesa_load_matrix()
497 _math_matrix_loadf(stack->Top, m); in _mesa_load_matrix()
498 ctx->NewState |= stack->DirtyFlag; in _mesa_load_matrix()
504 matrix_load(struct gl_context *ctx, struct gl_matrix_stack *stack, in matrix_load() argument
517 _mesa_load_matrix(ctx, stack, m); in matrix_load()
529 * matrix in the current stack and the given matrix.
530 * Marks __struct gl_contextRec::NewState with the dirty stack flag.
552 struct gl_matrix_stack * stack = in _mesa_MatrixLoadfEXT() local
554 if (!stack) in _mesa_MatrixLoadfEXT()
557 matrix_load(ctx, stack, m, "glMatrixLoadfEXT"); in _mesa_MatrixLoadfEXT()
562 matrix_mult(struct gl_matrix_stack *stack, const GLfloat *m, const char* caller) in matrix_mult() argument
581 _math_matrix_mul_floats(stack->Top, m); in matrix_mult()
582 ctx->NewState |= stack->DirtyFlag; in matrix_mult()
594 * matrix in the current stack and the given matrix. Marks
595 * __struct gl_contextRec::NewState with the dirty stack flag.
609 struct gl_matrix_stack * stack = in _mesa_MatrixMultfEXT() local
611 if (!stack) in _mesa_MatrixMultfEXT()
614 matrix_mult(stack, m, "glMultMatrix"); in _mesa_MatrixMultfEXT()
619 matrix_rotate(struct gl_matrix_stack *stack, GLfloat angle, in matrix_rotate() argument
626 _math_matrix_rotate(stack->Top, angle, x, y, z); in matrix_rotate()
627 ctx->NewState |=stack->DirtyFlag; in matrix_rotate()
643 * matrix in the current stack and the given parameters. Marks
644 * __struct gl_contextRec::NewState with the dirty stack flag.
658 struct gl_matrix_stack *stack = in _mesa_MatrixRotatefEXT() local
660 if (!stack) in _mesa_MatrixRotatefEXT()
663 matrix_rotate(stack, angle, x, y, z, "glMatrixRotatefEXT"); in _mesa_MatrixRotatefEXT()
677 * matrix in the current stack and the given parameters. Marks
678 * __struct gl_contextRec::NewState with the dirty stack flag.
694 struct gl_matrix_stack *stack; in _mesa_MatrixScalefEXT() local
697 stack = get_named_matrix_stack(ctx, matrixMode, "glMatrixScalefEXT"); in _mesa_MatrixScalefEXT()
698 if (!stack) in _mesa_MatrixScalefEXT()
702 _math_matrix_scale(stack->Top, x, y, z); in _mesa_MatrixScalefEXT()
703 ctx->NewState |= stack->DirtyFlag; in _mesa_MatrixScalefEXT()
717 * matrix in the current stack and the given parameters. Marks
718 * __struct gl_contextRec::NewState with the dirty stack flag.
735 struct gl_matrix_stack *stack = in _mesa_MatrixTranslatefEXT() local
737 if (!stack) in _mesa_MatrixTranslatefEXT()
741 _math_matrix_translate(stack->Top, x, y, z); in _mesa_MatrixTranslatefEXT()
742 ctx->NewState |= stack->DirtyFlag; in _mesa_MatrixTranslatefEXT()
914 * Update the projection matrix stack.
977 /** Matrix stack initialization */
982 * Initialize a matrix stack.
984 * \param stack matrix stack.
985 * \param maxDepth maximum stack depth.
988 * Allocates an array of \p maxDepth elements for the matrix stack and calls
992 init_matrix_stack(struct gl_matrix_stack *stack, in init_matrix_stack() argument
995 stack->Depth = 0; in init_matrix_stack()
996 stack->MaxDepth = maxDepth; in init_matrix_stack()
997 stack->DirtyFlag = dirtyFlag; in init_matrix_stack()
998 /* The stack will be dynamically resized at glPushMatrix() time */ in init_matrix_stack()
999 stack->Stack = calloc(1, sizeof(GLmatrix)); in init_matrix_stack()
1000 stack->StackSize = 1; in init_matrix_stack()
1001 _math_matrix_ctr(&stack->Stack[0]); in init_matrix_stack()
1002 stack->Top = stack->Stack; in init_matrix_stack()
1006 * Free matrix stack.
1008 * \param stack matrix stack.
1011 free_matrix_stack( struct gl_matrix_stack *stack ) in free_matrix_stack() argument
1013 free(stack->Stack); in free_matrix_stack()
1014 stack->Stack = stack->Top = NULL; in free_matrix_stack()
1015 stack->StackSize = 0; in free_matrix_stack()