func (r *Renderer) SetVec4(uniformAttributeName string, v1, v2, v3, v4 float32) {
	location := r.locationOrPanic(uniformAttributeName)
	r.api.Uniform4f(location, v1, v2, v3, v4)
}
SetVec4 sets uniform attribute of type vec4
package gl
import (
	"fmt"
	"strings"
	"github.com/jacekolszak/pixiq/image"
)
type Command interface {
	RunGL(renderer *Renderer, selections []image.AcceleratedImageSelection)
}
type Renderer struct {
	program      *Program
	api          API
	allImages    allImages
	blendFactors BlendFactors
}
func (r *Renderer) BindTexture(textureUnit int, uniformAttributeName string, image image.AcceleratedImage) {
	if textureUnit < 0 {
		panic("negative textureUnit")
	}
	textureLocation := r.locationOrPanic(uniformAttributeName)
	img, ok := r.allImages[image]
	if !ok {
		panic("image has not been created in this OpenGL context")
	}
	r.api.Uniform1i(textureLocation, int32(textureUnit))
	r.api.ActiveTexture(uint32(texture0 + textureUnit))
	r.api.BindTexture(texture2D, img.textureID)
}
func (r *Renderer) SetFloat(uniformAttributeName string, value float32) {
	location := r.locationOrPanic(uniformAttributeName)
	r.api.Uniform1f(location, value)
}
func (r *Renderer) locationOrPanic(uniformAttributeName string) int32 {
	trimmed := strings.TrimSpace(uniformAttributeName)
	if trimmed == "" {
		panic("empty uniformAttributeName")
	}
	location, ok := r.program.uniformLocations[uniformAttributeName]
	if !ok {
		panic("not existing uniform attribute name: " + uniformAttributeName)
	}
	return location
}
func (r *Renderer) SetVec2(uniformAttributeName string, v1, v2 float32) {
	location := r.locationOrPanic(uniformAttributeName)
	r.api.Uniform2f(location, v1, v2)
}
func (r *Renderer) SetVec3(uniformAttributeName string, v1, v2, v3 float32) {
	location := r.locationOrPanic(uniformAttributeName)
	r.api.Uniform3f(location, v1, v2, v3)
}