<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>


<!--
This Vulkan demo builds the command buffer once in the INIT script and executes it in 
the FRAME script. The command buffer is rebuilt if the size of the window changes.

There is one command buffer for each swapchain buffer.
-->


<geexlab>
	
  <window name="win3d01" title="VkTorus of Death (Vulkan)" 
          width="1920" height="1080"  fullscreen="1"
          vsync="0"
          renderer_type="Vulkan2" gpu_index="0" vk_present_mode="1" menubar="0" />
  
  
  <script name="init_scene" run_mode="INIT" filename="init.lua" />

	<script name="update_scene" run_mode="FRAME" filename="frame.lua" livecoding="1" />


	
	<script name="terminate_scene" run_mode="TERMINATE" >
		<raw_data><![CDATA[	
   
gh_gpu_buffer.unmap(ub1)

		]]></raw_data>
	</script> 
	

  
	

	<script name="resize_scene" run_mode="SIZE" >
		<raw_data><![CDATA[	
winW, winH = gh_window.getsize(0)



-----------------------------------------------------------------------
-- Updates camera transformation in the gpu buffer.
--
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(ub1, camera)


		]]></raw_data>
	</script> 
  
  
</geexlab>
