message: Expose methods to access the private transform/view change methods on context from outside sources and separate recalculation of the mvp matrix into a different function
diff: @@ -349,8 +349,8 @@ impl GraphicsContext {
  background_color: Color::new(0.1, 0.2, 0.3, 1.0),
  shader_globals: globals,
  projection: initial_projection,
  - view_stack: vec![initial_view],
  transform_stack: vec![initial_transform],
  + view_stack: vec![initial_view],
  white_image: white_image,
  screen_rect: Rect::new(left, bottom, (right - left), (top - bottom)),
  dpi: dpi,
  @@ -381,18 +381,20 @@ impl GraphicsContext {
  };
  gfx.set_projection_rect(rect);
  gfx.update_globals()?;
  - gfx.update_transform()?;
  Ok(gfx)
  }
  fn update_globals(&mut self) -> GameResult<()> {
  + self.encoder
  + .update_buffer(&self.data.globals, &[self.shader_globals], 0)?;
  + Ok(())
  + }
  +
  + fn apply_transformation_globals(&mut self) {
  let model = self.transform_stack[self.transform_stack.len() - 1];
  let view = self.view_stack[self.view_stack.len() - 1];
  let mvp = self.projection * view * model;
  self.shader_globals.mvp_matrix = mvp.into();
  - self.encoder
  - .update_buffer(&self.data.globals, &[self.shader_globals], 0)?;
  - Ok(())
  }
  fn push_transform(&mut self, t: Matrix4) {
  @@ -497,7 +499,6 @@ impl GraphicsContext {
  -1.0,
  1.0)
  .append_nonuniform_scaling(&Vec3::new(1.0, -1.0, 1.0));
  -
  }
  /// Just a helper method to set window mode from a WindowMode object.
  @@ -738,6 +739,27 @@ pub fn set_screen_coordinates(context: &mut Context, rect: Rect) -> GameResult<(
  gfx.update_globals()
  }
  +pub fn push_transform(context: &mut Context, transform: Matrix4) {
  + let gfx = &mut context.gfx_context;
  + gfx.push_transform(transform);
  +}
  +pub fn pop_transform(context: &mut Context) {
  + let gfx = &mut context.gfx_context;
  + gfx.pop_transform();
  +}
  +pub fn push_view(context: &mut Context, view: Matrix4) {
  + let gfx = &mut context.gfx_context;
  + gfx.push_view(view);
  +}
  +pub fn pop_view(context: &mut Context) {
  + let gfx = &mut context.gfx_context;
  + gfx.pop_view();
  +}
  +pub fn apply_transformations(context: &mut Context) -> GameResult<()> {
  + let gfx = &mut context.gfx_context;
  + gfx.apply_transformation_globals();
  + gfx.update_globals()
  +}
  /// Sets the window mode, such as the size and other properties.
  ///
  