Lines Matching refs:stack
62 * the top matrix of the current matrix stack and sets
105 * the top matrix of the current matrix stack and sets
138 * Set the current matrix stack.
140 * \param mode matrix stack.
146 * with the specified matrix stack.
216 * Push the current matrix stack.
220 * Verifies the current matrix stack is not full, and duplicates the top-most
221 * matrix in the stack.
222 * Marks __struct gl_contextRec::NewState with the stack dirty flag.
228 struct gl_matrix_stack *stack = ctx->CurrentStack;
234 if (stack->Depth + 1 >= stack->MaxDepth) {
246 if (stack->Depth + 1 >= stack->StackSize) {
247 unsigned new_stack_size = stack->StackSize * 2;
249 GLmatrix *new_stack = realloc(stack->Stack,
257 for (i = stack->StackSize; i < new_stack_size; i++)
260 stack->Stack = new_stack;
261 stack->StackSize = new_stack_size;
264 _math_matrix_copy( &stack->Stack[stack->Depth + 1],
265 &stack->Stack[stack->Depth] );
266 stack->Depth++;
267 stack->Top = &(stack->Stack[stack->Depth]);
268 ctx->NewState |= stack->DirtyFlag;
273 * Pop the current matrix stack.
277 * Flushes the vertices, verifies the current matrix stack is not empty, and
278 * moves the stack head down.
279 * Marks __struct gl_contextRec::NewState with the dirty stack flag.
285 struct gl_matrix_stack *stack = ctx->CurrentStack;
293 if (stack->Depth == 0) {
305 stack->Depth--;
306 stack->Top = &(stack->Stack[stack->Depth]);
307 ctx->NewState |= stack->DirtyFlag;
317 * top-most matrix in the current stack.
318 * Marks __struct gl_contextRec::NewState with the stack dirty flag.
343 * matrix in the current stack and the given matrix.
344 * Marks __struct gl_contextRec::NewState with the dirty stack flag.
375 * matrix in the current stack and the given matrix. Marks
376 * __struct gl_contextRec::NewState with the dirty stack flag.
408 * matrix in the current stack and the given parameters. Marks
409 * __struct gl_contextRec::NewState with the dirty stack flag.
434 * matrix in the current stack and the given parameters. Marks
435 * __struct gl_contextRec::NewState with the dirty stack flag.
458 * matrix in the current stack and the given parameters. Marks
459 * __struct gl_contextRec::NewState with the dirty stack flag.
563 * Update the projection matrix stack.
568 * stack, and recomputes user clip positions if necessary.
645 /** Matrix stack initialization */
650 * Initialize a matrix stack.
652 * \param stack matrix stack.
653 * \param maxDepth maximum stack depth.
656 * Allocates an array of \p maxDepth elements for the matrix stack and calls
660 init_matrix_stack( struct gl_matrix_stack *stack,
665 stack->Depth = 0;
666 stack->MaxDepth = maxDepth;
667 stack->DirtyFlag = dirtyFlag;
668 /* The stack will be dynamically resized at glPushMatrix() time */
669 stack->Stack = calloc(1, sizeof(GLmatrix));
670 stack->StackSize = 1;
671 for (i = 0; i < stack->StackSize; i++) {
672 _math_matrix_ctr(&stack->Stack[i]);
674 stack->Top = stack->Stack;
678 * Free matrix stack.
680 * \param stack matrix stack.
682 * Calls _math_matrix_dtr() for each element of the matrix stack and
686 free_matrix_stack( struct gl_matrix_stack *stack )
689 for (i = 0; i < stack->StackSize; i++) {
690 _math_matrix_dtr(&stack->Stack[i]);
692 free(stack->Stack);
693 stack->Stack = stack->Top = NULL;
694 stack->StackSize = 0;