class GLProgram
  # @overload initialize(*shaders, options = {})
  #
  # @param shaders [Array<GLShader>]
  #   Shaders to attach to the program.
  # @param options [Hash]
  #   Optional parameters.
  # @option options [Array<String>] :uniforms
  #   Names of uniforms to load locations of for this program.
  def initialize(*args)
    options = args.last.is_a?(Hash) ? args.pop : {}
    args.each do |arg|
      if arg.is_a?(GLShader)
        attach_shader(arg)
      else
        raise NotImplementedError.new("Other arguments not yet implemented")
      end
    end
    link
    options.each do |option, value|
      case option
      when :uniforms
        value.each do |uniform|
          load_uniform_location(uniform)
        end
      else
        raise "Unknown option #{option.inspect}"
      end
    end
  end
end
