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()
293 push_matrix(struct gl_context *ctx, struct gl_matrix_stack *stack, in push_matrix() argument
296 if (stack->Depth + 1 >= stack->MaxDepth) { in push_matrix()
307 if (stack->Depth + 1 >= stack->StackSize) { in push_matrix()
308 unsigned new_stack_size = stack->StackSize * 2; in push_matrix()
310 GLmatrix *new_stack = realloc(stack->Stack, in push_matrix()
318 for (i = stack->StackSize; i < new_stack_size; i++) in push_matrix()
321 stack->Stack = new_stack; in push_matrix()
322 stack->StackSize = new_stack_size; in push_matrix()
325 _math_matrix_copy( &stack->Stack[stack->Depth + 1], in push_matrix()
326 &stack->Stack[stack->Depth] ); in push_matrix()
327 stack->Depth++; in push_matrix()
328 stack->Top = &(stack->Stack[stack->Depth]); in push_matrix()
329 ctx->NewState |= stack->DirtyFlag; 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()
375 stack->Top = &(stack->Stack[stack->Depth]); in pop_matrix()
376 ctx->NewState |= stack->DirtyFlag; in pop_matrix()
382 * Pop the current matrix stack.
386 * Flushes the vertices, verifies the current matrix stack is not empty, and
387 * moves the stack head down.
388 * Marks __struct gl_contextRec::NewState with the dirty stack flag.
394 struct gl_matrix_stack *stack = ctx->CurrentStack; in _mesa_PopMatrix() local
402 if (!pop_matrix(ctx, stack)) { in _mesa_PopMatrix()
420 struct gl_matrix_stack *stack = get_named_matrix_stack(ctx, matrixMode, in _mesa_MatrixPopEXT() local
422 if (!stack) in _mesa_MatrixPopEXT()
425 if (!pop_matrix(ctx, stack)) { in _mesa_MatrixPopEXT()
440 _mesa_load_identity_matrix(struct gl_context *ctx, struct gl_matrix_stack *stack) in _mesa_load_identity_matrix() argument
444 _math_matrix_set_identity(stack->Top); in _mesa_load_identity_matrix()
445 ctx->NewState |= stack->DirtyFlag; in _mesa_load_identity_matrix()
455 * top-most matrix in the current stack.
456 * Marks __struct gl_contextRec::NewState with the stack dirty flag.
473 struct gl_matrix_stack *stack; in _mesa_MatrixLoadIdentityEXT() local
475 stack = get_named_matrix_stack(ctx, matrixMode, "glMatrixLoadIdentityEXT"); in _mesa_MatrixLoadIdentityEXT()
476 if (!stack) in _mesa_MatrixLoadIdentityEXT()
479 _mesa_load_identity_matrix(ctx, stack); in _mesa_MatrixLoadIdentityEXT()
484 _mesa_load_matrix(struct gl_context *ctx, struct gl_matrix_stack *stack, in _mesa_load_matrix() argument
487 if (memcmp(m, stack->Top->m, 16 * sizeof(GLfloat)) != 0) { in _mesa_load_matrix()
489 _math_matrix_loadf(stack->Top, m); in _mesa_load_matrix()
490 ctx->NewState |= stack->DirtyFlag; in _mesa_load_matrix()
496 matrix_load(struct gl_context *ctx, struct gl_matrix_stack *stack, in matrix_load() argument
509 _mesa_load_matrix(ctx, stack, m); in matrix_load()
521 * matrix in the current stack and the given matrix.
522 * Marks __struct gl_contextRec::NewState with the dirty stack flag.
544 struct gl_matrix_stack * stack = in _mesa_MatrixLoadfEXT() local
546 if (!stack) in _mesa_MatrixLoadfEXT()
549 matrix_load(ctx, stack, m, "glMatrixLoadfEXT"); in _mesa_MatrixLoadfEXT()
554 matrix_mult(struct gl_matrix_stack *stack, const GLfloat *m, const char* caller) in matrix_mult() argument
568 _math_matrix_mul_floats(stack->Top, m); in matrix_mult()
569 ctx->NewState |= stack->DirtyFlag; in matrix_mult()
581 * matrix in the current stack and the given matrix. Marks
582 * __struct gl_contextRec::NewState with the dirty stack flag.
596 struct gl_matrix_stack * stack = in _mesa_MatrixMultfEXT() local
598 if (!stack) in _mesa_MatrixMultfEXT()
601 matrix_mult(stack, m, "glMultMatrix"); in _mesa_MatrixMultfEXT()
606 matrix_rotate(struct gl_matrix_stack *stack, GLfloat angle, in matrix_rotate() argument
613 _math_matrix_rotate(stack->Top, angle, x, y, z); in matrix_rotate()
614 ctx->NewState |=stack->DirtyFlag; in matrix_rotate()
630 * matrix in the current stack and the given parameters. Marks
631 * __struct gl_contextRec::NewState with the dirty stack flag.
645 struct gl_matrix_stack *stack = in _mesa_MatrixRotatefEXT() local
647 if (!stack) in _mesa_MatrixRotatefEXT()
650 matrix_rotate(stack, angle, x, y, z, "glMatrixRotatefEXT"); in _mesa_MatrixRotatefEXT()
664 * matrix in the current stack and the given parameters. Marks
665 * __struct gl_contextRec::NewState with the dirty stack flag.
681 struct gl_matrix_stack *stack; in _mesa_MatrixScalefEXT() local
684 stack = get_named_matrix_stack(ctx, matrixMode, "glMatrixScalefEXT"); in _mesa_MatrixScalefEXT()
685 if (!stack) in _mesa_MatrixScalefEXT()
689 _math_matrix_scale(stack->Top, x, y, z); in _mesa_MatrixScalefEXT()
690 ctx->NewState |= stack->DirtyFlag; in _mesa_MatrixScalefEXT()
704 * matrix in the current stack and the given parameters. Marks
705 * __struct gl_contextRec::NewState with the dirty stack flag.
722 struct gl_matrix_stack *stack = in _mesa_MatrixTranslatefEXT() local
724 if (!stack) in _mesa_MatrixTranslatefEXT()
728 _math_matrix_translate(stack->Top, x, y, z); in _mesa_MatrixTranslatefEXT()
729 ctx->NewState |= stack->DirtyFlag; in _mesa_MatrixTranslatefEXT()
901 * Update the projection matrix stack.
906 * stack, and recomputes user clip positions if necessary.
983 /** Matrix stack initialization */
988 * Initialize a matrix stack.
990 * \param stack matrix stack.
991 * \param maxDepth maximum stack depth.
994 * Allocates an array of \p maxDepth elements for the matrix stack and calls
998 init_matrix_stack(struct gl_matrix_stack *stack, in init_matrix_stack() argument
1001 stack->Depth = 0; in init_matrix_stack()
1002 stack->MaxDepth = maxDepth; in init_matrix_stack()
1003 stack->DirtyFlag = dirtyFlag; in init_matrix_stack()
1004 /* The stack will be dynamically resized at glPushMatrix() time */ in init_matrix_stack()
1005 stack->Stack = calloc(1, sizeof(GLmatrix)); in init_matrix_stack()
1006 stack->StackSize = 1; in init_matrix_stack()
1007 _math_matrix_ctr(&stack->Stack[0]); in init_matrix_stack()
1008 stack->Top = stack->Stack; in init_matrix_stack()
1012 * Free matrix stack.
1014 * \param stack matrix stack.
1016 * Calls _math_matrix_dtr() for each element of the matrix stack and
1020 free_matrix_stack( struct gl_matrix_stack *stack ) in free_matrix_stack() argument
1023 for (i = 0; i < stack->StackSize; i++) { in free_matrix_stack()
1024 _math_matrix_dtr(&stack->Stack[i]); in free_matrix_stack()
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()