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

<geexlab> 
	
  <window name="win3d01" title="Bouncing Box at Window Borders" 
          width="512" height="512"
          gl_version_major="2" gl_version_minor="1" />
 
  

	<script name="init_scene" run_mode="INIT" filename="init.lua" />

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

	<script name="resize_scene" run_mode="SIZE" filename="size.lua" />






  <gpu_program name="tex_prog" >
    <raw_data_vs><![CDATA[	 
#version 120    
void main()
{
  gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;		
  gl_TexCoord[0] = gl_MultiTexCoord0;
}
  ]]></raw_data_vs>
    <raw_data_ps><![CDATA[	 
#version 120    
uniform int mode;
uniform vec4 transp;
uniform sampler2D tex0;
void main (void)
{
  vec2 uv = gl_TexCoord[0].xy * 2.0;
  uv.y *= -1.0;
  vec3 t = texture2D(tex0,uv).rgb;
  if (mode == 1)
  {
    if (t.r==transp.r && t.g==transp.g && t.b==transp.b)
      discard;
  }
  gl_FragColor = vec4(t, 1.0);
}
    ]]></raw_data_ps>
  </gpu_program>
  

  
    <gpu_program name="color_prog" >
    <raw_data_vs><![CDATA[	 
#version 120    
void main()
{
  gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;		
}
  ]]></raw_data_vs>
    <raw_data_ps><![CDATA[	 
#version 120    
uniform vec4 color;
void main (void)
{
  gl_FragColor = color;
  //gl_FragColor = vec4(1, 0, 0, 1);
}
    ]]></raw_data_ps>
  </gpu_program>

  
  
  
  
</geexlab>
