Lines Matching full:stack
102 static void matrix_frustum(struct gl_matrix_stack* stack, in matrix_frustum() argument
120 _math_matrix_frustum(stack->Top, in matrix_frustum()
124 ctx->NewState |= stack->DirtyFlag; in matrix_frustum()
141 * the top matrix of the current matrix stack and sets
165 struct gl_matrix_stack *stack = get_named_matrix_stack(ctx, matrixMode, in _mesa_MatrixFrustumEXT() local
167 if (!stack) in _mesa_MatrixFrustumEXT()
170 matrix_frustum(stack, in _mesa_MatrixFrustumEXT()
179 matrix_ortho(struct gl_matrix_stack* stack, in matrix_ortho() argument
201 _math_matrix_ortho( stack->Top, in matrix_ortho()
205 ctx->NewState |= stack->DirtyFlag; in matrix_ortho()
222 * the top matrix of the current matrix stack and sets
246 struct gl_matrix_stack *stack = get_named_matrix_stack(ctx, matrixMode, in _mesa_MatrixOrthoEXT() local
248 if (!stack) in _mesa_MatrixOrthoEXT()
251 matrix_ortho(stack, in _mesa_MatrixOrthoEXT()
260 * Set the current matrix stack.
262 * \param mode matrix stack.
268 * with the specified matrix stack.
273 struct gl_matrix_stack * stack; in _mesa_MatrixMode() local
280 stack = NULL; in _mesa_MatrixMode()
282 stack = get_named_matrix_stack(ctx, mode, "glMatrixMode"); in _mesa_MatrixMode()
285 if (stack) { in _mesa_MatrixMode()
286 ctx->CurrentStack = stack; in _mesa_MatrixMode()
294 push_matrix(struct gl_context *ctx, struct gl_matrix_stack *stack, in push_matrix() argument
297 if (stack->Depth + 1 >= stack->MaxDepth) { in push_matrix()
308 if (stack->Depth + 1 >= stack->StackSize) { in push_matrix()
309 unsigned new_stack_size = stack->StackSize * 2; in push_matrix()
311 GLmatrix *new_stack = realloc(stack->Stack, in push_matrix()
319 for (i = stack->StackSize; i < new_stack_size; i++) in push_matrix()
322 stack->Stack = new_stack; in push_matrix()
323 stack->StackSize = new_stack_size; in push_matrix()
326 _math_matrix_push_copy(&stack->Stack[stack->Depth + 1], in push_matrix()
327 &stack->Stack[stack->Depth]); in push_matrix()
328 stack->Depth++; in push_matrix()
329 stack->Top = &(stack->Stack[stack->Depth]); in push_matrix()
334 * Push the current matrix stack.
338 * Verifies the current matrix stack is not full, and duplicates the top-most
339 * matrix in the stack.
340 * Marks __struct gl_contextRec::NewState with the stack dirty flag.
346 struct gl_matrix_stack *stack = ctx->CurrentStack; in _mesa_PushMatrix() local
352 push_matrix(ctx, stack, ctx->Transform.MatrixMode, "glPushMatrix"); in _mesa_PushMatrix()
360 struct gl_matrix_stack *stack = get_named_matrix_stack(ctx, matrixMode, in _mesa_MatrixPushEXT() local
363 if (stack) in _mesa_MatrixPushEXT()
364 push_matrix(ctx, stack, matrixMode, "glMatrixPushEXT"); in _mesa_MatrixPushEXT()
369 pop_matrix( struct gl_context *ctx, struct gl_matrix_stack *stack ) in pop_matrix() argument
371 if (stack->Depth == 0) in pop_matrix()
374 stack->Depth--; in pop_matrix()
379 if (memcmp(stack->Top, &stack->Stack[stack->Depth], in pop_matrix()
382 ctx->NewState |= stack->DirtyFlag; in pop_matrix()
385 stack->Top = &(stack->Stack[stack->Depth]); in pop_matrix()
391 * Pop the current matrix stack.
395 * Flushes the vertices, verifies the current matrix stack is not empty, and
396 * moves the stack head down.
397 * Marks __struct gl_contextRec::NewState with the dirty stack flag.
403 struct gl_matrix_stack *stack = ctx->CurrentStack; in _mesa_PopMatrix() local
409 if (!pop_matrix(ctx, stack)) { in _mesa_PopMatrix()
427 struct gl_matrix_stack *stack = get_named_matrix_stack(ctx, matrixMode, in _mesa_MatrixPopEXT() local
429 if (!stack) in _mesa_MatrixPopEXT()
432 if (!pop_matrix(ctx, stack)) { in _mesa_MatrixPopEXT()
447 _mesa_load_identity_matrix(struct gl_context *ctx, struct gl_matrix_stack *stack) in _mesa_load_identity_matrix() argument
451 _math_matrix_set_identity(stack->Top); in _mesa_load_identity_matrix()
452 ctx->NewState |= stack->DirtyFlag; in _mesa_load_identity_matrix()
462 * top-most matrix in the current stack.
463 * Marks __struct gl_contextRec::NewState with the stack dirty flag.
480 struct gl_matrix_stack *stack; in _mesa_MatrixLoadIdentityEXT() local
482 stack = get_named_matrix_stack(ctx, matrixMode, "glMatrixLoadIdentityEXT"); in _mesa_MatrixLoadIdentityEXT()
483 if (!stack) in _mesa_MatrixLoadIdentityEXT()
486 _mesa_load_identity_matrix(ctx, stack); in _mesa_MatrixLoadIdentityEXT()
491 _mesa_load_matrix(struct gl_context *ctx, struct gl_matrix_stack *stack, in _mesa_load_matrix() argument
494 if (memcmp(m, stack->Top->m, 16 * sizeof(GLfloat)) != 0) { in _mesa_load_matrix()
496 _math_matrix_loadf(stack->Top, m); in _mesa_load_matrix()
497 ctx->NewState |= stack->DirtyFlag; in _mesa_load_matrix()
503 matrix_load(struct gl_context *ctx, struct gl_matrix_stack *stack, in matrix_load() argument
516 _mesa_load_matrix(ctx, stack, m); in matrix_load()
528 * matrix in the current stack and the given matrix.
529 * Marks __struct gl_contextRec::NewState with the dirty stack flag.
551 struct gl_matrix_stack * stack = in _mesa_MatrixLoadfEXT() local
553 if (!stack) in _mesa_MatrixLoadfEXT()
556 matrix_load(ctx, stack, m, "glMatrixLoadfEXT"); in _mesa_MatrixLoadfEXT()
561 matrix_mult(struct gl_matrix_stack *stack, const GLfloat *m, const char* caller) in matrix_mult() argument
580 _math_matrix_mul_floats(stack->Top, m); in matrix_mult()
581 ctx->NewState |= stack->DirtyFlag; in matrix_mult()
593 * matrix in the current stack and the given matrix. Marks
594 * __struct gl_contextRec::NewState with the dirty stack flag.
608 struct gl_matrix_stack * stack = in _mesa_MatrixMultfEXT() local
610 if (!stack) in _mesa_MatrixMultfEXT()
613 matrix_mult(stack, m, "glMultMatrix"); in _mesa_MatrixMultfEXT()
618 matrix_rotate(struct gl_matrix_stack *stack, GLfloat angle, in matrix_rotate() argument
625 _math_matrix_rotate(stack->Top, angle, x, y, z); in matrix_rotate()
626 ctx->NewState |=stack->DirtyFlag; in matrix_rotate()
642 * matrix in the current stack and the given parameters. Marks
643 * __struct gl_contextRec::NewState with the dirty stack flag.
657 struct gl_matrix_stack *stack = in _mesa_MatrixRotatefEXT() local
659 if (!stack) in _mesa_MatrixRotatefEXT()
662 matrix_rotate(stack, angle, x, y, z, "glMatrixRotatefEXT"); in _mesa_MatrixRotatefEXT()
676 * matrix in the current stack and the given parameters. Marks
677 * __struct gl_contextRec::NewState with the dirty stack flag.
693 struct gl_matrix_stack *stack; in _mesa_MatrixScalefEXT() local
696 stack = get_named_matrix_stack(ctx, matrixMode, "glMatrixScalefEXT"); in _mesa_MatrixScalefEXT()
697 if (!stack) in _mesa_MatrixScalefEXT()
701 _math_matrix_scale(stack->Top, x, y, z); in _mesa_MatrixScalefEXT()
702 ctx->NewState |= stack->DirtyFlag; in _mesa_MatrixScalefEXT()
716 * matrix in the current stack and the given parameters. Marks
717 * __struct gl_contextRec::NewState with the dirty stack flag.
734 struct gl_matrix_stack *stack = in _mesa_MatrixTranslatefEXT() local
736 if (!stack) in _mesa_MatrixTranslatefEXT()
740 _math_matrix_translate(stack->Top, x, y, z); in _mesa_MatrixTranslatefEXT()
741 ctx->NewState |= stack->DirtyFlag; in _mesa_MatrixTranslatefEXT()
913 * Update the projection matrix stack.
976 /** Matrix stack initialization */
981 * Initialize a matrix stack.
983 * \param stack matrix stack.
984 * \param maxDepth maximum stack depth.
987 * Allocates an array of \p maxDepth elements for the matrix stack and calls
991 init_matrix_stack(struct gl_matrix_stack *stack, in init_matrix_stack() argument
994 stack->Depth = 0; in init_matrix_stack()
995 stack->MaxDepth = maxDepth; in init_matrix_stack()
996 stack->DirtyFlag = dirtyFlag; in init_matrix_stack()
997 /* The stack will be dynamically resized at glPushMatrix() time */ in init_matrix_stack()
998 stack->Stack = calloc(1, sizeof(GLmatrix)); in init_matrix_stack()
999 stack->StackSize = 1; in init_matrix_stack()
1000 _math_matrix_ctr(&stack->Stack[0]); in init_matrix_stack()
1001 stack->Top = stack->Stack; in init_matrix_stack()
1005 * Free matrix stack.
1007 * \param stack matrix stack.
1010 free_matrix_stack( struct gl_matrix_stack *stack ) in free_matrix_stack() argument
1012 free(stack->Stack); in free_matrix_stack()
1013 stack->Stack = stack->Top = NULL; in free_matrix_stack()
1014 stack->StackSize = 0; in free_matrix_stack()