	
   
local elapsed_time = gh_utils.get_elapsed_time()



gh_object.set_euler_angles(quad, 0, 0, elapsed_time*21.0)
UpdateObjectTransform(quad, ub1, 1)


if (gh_vk.swapchain_has_changed() == 1) then
  winW, winH = gh_window.getsize(0)

  gh_camera.update_ortho(camera_ortho, -1, 1, -1, 1, 1.0, 10.0)
  gh_camera.set_viewport(camera_ortho, 0, 0, winW, winH)
  UpdateCameraTransform(camera_ortho, ub1, 0)
 

  local aspect = winW / winH
  gh_camera.update_persp(camera, camera_params.fov, aspect, camera_params.znear, camera_params.zfar)
  gh_camera.set_viewport(camera, 0, 0, winW, winH)
  UpdateCameraTransform(camera, ub1, 1)

  
  local ai = gh_vk.frame_get_active_command_buffer_index()
  for i=0, swapchain_image_count-1 do
    gh_vk.frame_set_active_command_buffer_index(i)
    build_command_buffer(winW, winH)
  end
  gh_vk.frame_set_active_command_buffer_index(ai)
end





