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

<glsl_hacker>
	
  <window name="win3d01" title="RGB Triangle - LuaGL - GL1.1" 
          width="800" height="400" 
          gl_version_major="1" gl_version_minor="1"  />

	<script name="init_scene" run_mode="INIT" >
		<raw_data><![CDATA[	

winW, winH = gh_window.getsize(0)

gh_renderer.set_vsync(0)

		]]></raw_data>
	</script> 

  
	<script name="update_scene" run_mode="FRAME" >
		<raw_data><![CDATA[	

gh_renderer.set_viewport(0, 0, winW, winH)
gh_renderer.clear_color_depth_buffers(0.2, 0.2, 0.2, 1.0, 1.0)
gh_renderer.set_depth_test_state(0)






-- LuaGL code ===============================

gl.Disable('DEPTH_TEST') 

--gl.PolygonMode('FRONT_AND_BACK', 'LINE')
gl.PolygonMode('FRONT_AND_BACK', 'FILL')

gl.Disable('CULL_FACE')




gl.MatrixMode('PROJECTION')
gl.LoadIdentity()

gl.MatrixMode('MODELVIEW')
gl.LoadIdentity()



gl.Begin('TRIANGLES') 
gl.Color(1, 0, 0)
gl.Vertex(-1, -1, 0)

gl.Color(0, 1, 0)
gl.Vertex(0, 1, 0)

gl.Color(0, 0, 1)
gl.Vertex(1, -1, 0)

gl.End()      			

-- LuaGL code ===============================


		]]></raw_data>
	</script> 

 
	<script name="resize_scene" run_mode="SIZE" >
		<raw_data><![CDATA[	

winW, winH = gh_window.getsize(0)

		]]></raw_data>
	</script> 
  
  
  
</glsl_hacker>
