# Instantiate Shader $shdr = new OpenGL::Shader(); # Determine shader type my $ext = lc($shdr->GetType()); # Load shader programs my $stat = $shdr->LoadFiles("fragment.$ext","vertex.$ext"); # Enable shaders $shdr->Enable(); # Set uniform float4 vector $shdr->SetVector('surfacecolor',1.0,0.5,0.0,1.0); # Set uniform float4x4 matrix from an OpenGL::Array (OGA) object $shdr->SetMatrix('xform',$xform); # Draw here # Disable shaders $shdr->Disable();