コード例 #1
0
ファイル: cogl-matrix-stack.c プロジェクト: nobled/clutter
gboolean
_cogl_matrix_stack_get_inverse (CoglMatrixStack *stack,
                                CoglMatrix      *inverse)
{
  CoglMatrixState *state;

  state = _cogl_matrix_stack_top_mutable (stack, TRUE);

  return cogl_matrix_get_inverse (&state->matrix, inverse);
}
コード例 #2
0
ファイル: cogl-matrix-stack.c プロジェクト: collects/cogl
void
_cogl_matrix_stack_set (CoglMatrixStack  *stack,
                        const CoglMatrix *matrix)
{
  CoglMatrixState *state;

  state = _cogl_matrix_stack_top_mutable (stack, FALSE);
  state->matrix = *matrix;
  state->is_identity = FALSE;
  stack->age++;
}
コード例 #3
0
ファイル: cogl-matrix-stack.c プロジェクト: collects/cogl
void
_cogl_matrix_stack_multiply (CoglMatrixStack  *stack,
                             const CoglMatrix *matrix)
{
  CoglMatrixState *state;

  state = _cogl_matrix_stack_top_mutable (stack, TRUE);
  cogl_matrix_multiply (&state->matrix, &state->matrix, matrix);
  state->is_identity = FALSE;
  stack->age++;
}
コード例 #4
0
ファイル: cogl-matrix-stack.c プロジェクト: nobled/clutter
void
_cogl_matrix_stack_set (CoglMatrixStack  *stack,
                        const CoglMatrix *matrix)
{
  CoglMatrixState *state;

  state = _cogl_matrix_stack_top_mutable (stack, FALSE);
  state->matrix = *matrix;
  /* mark dirty */
  stack->flushed_state = NULL;
  state->is_identity = FALSE;
  stack->age++;
}
コード例 #5
0
ファイル: cogl-matrix-stack.c プロジェクト: collects/cogl
void
_cogl_matrix_stack_translate (CoglMatrixStack *stack,
                              float            x,
                              float            y,
                              float            z)
{
  CoglMatrixState *state;

  state = _cogl_matrix_stack_top_mutable (stack, TRUE);
  cogl_matrix_translate (&state->matrix, x, y, z);
  state->is_identity = FALSE;
  stack->age++;
}
コード例 #6
0
ファイル: cogl-matrix-stack.c プロジェクト: nobled/clutter
void
_cogl_matrix_stack_scale (CoglMatrixStack *stack,
                          float            x,
                          float            y,
                          float            z)
{
  CoglMatrixState *state;

  state = _cogl_matrix_stack_top_mutable (stack, TRUE);
  cogl_matrix_scale (&state->matrix, x, y, z);
  /* mark dirty */
  stack->flushed_state = NULL;
  state->is_identity = FALSE;
  stack->age++;
}
コード例 #7
0
ファイル: cogl-matrix-stack.c プロジェクト: collects/cogl
void
_cogl_matrix_stack_perspective (CoglMatrixStack *stack,
                                float            fov_y,
                                float            aspect,
                                float            z_near,
                                float            z_far)
{
  CoglMatrixState *state;

  state = _cogl_matrix_stack_top_mutable (stack, TRUE);
  cogl_matrix_perspective (&state->matrix,
                           fov_y, aspect, z_near, z_far);
  state->is_identity = FALSE;
  stack->age++;
}
コード例 #8
0
ファイル: cogl-matrix-stack.c プロジェクト: collects/cogl
void
_cogl_matrix_stack_ortho (CoglMatrixStack *stack,
                          float            left,
                          float            right,
                          float            bottom,
                          float            top,
                          float            z_near,
                          float            z_far)
{
  CoglMatrixState *state;

  state = _cogl_matrix_stack_top_mutable (stack, TRUE);
  cogl_matrix_ortho (&state->matrix,
                     left, right, bottom, top, z_near, z_far);
  state->is_identity = FALSE;
  stack->age++;
}
コード例 #9
0
ファイル: cogl-matrix-stack.c プロジェクト: nobled/clutter
void
_cogl_matrix_stack_frustum (CoglMatrixStack *stack,
                            float            left,
                            float            right,
                            float            bottom,
                            float            top,
                            float            z_near,
                            float            z_far)
{
  CoglMatrixState *state;

  state = _cogl_matrix_stack_top_mutable (stack, TRUE);
  cogl_matrix_frustum (&state->matrix,
                       left, right, bottom, top,
                       z_near, z_far);
  /* mark dirty */
  stack->flushed_state = NULL;
  state->is_identity = FALSE;
  stack->age++;
}
コード例 #10
0
ファイル: cogl-matrix-stack.c プロジェクト: collects/cogl
void
_cogl_matrix_stack_load_identity (CoglMatrixStack *stack)
{
  CoglMatrixState *state;

  state = _cogl_matrix_stack_top_mutable (stack, FALSE);

  /* NB: Identity matrices are represented by setting
   * state->is_identity = TRUE and leaving state->matrix
   * uninitialized.
   *
   * This is done to optimize the heavy usage of
   * _cogl_matrix_stack_load_identity by the Cogl Journal.
   */
  if (!state->is_identity)
    {
      state->is_identity = TRUE;
      stack->age++;
    }
}