func (r *Renderer) DrawArrays(array *VertexArray, mode Mode, first, count int) {
	r.validateAttributeTypes(array)
	r.api.BindVertexArray(array.id)
	r.api.BlendFunc(uint32(r.blendFactors.SrcFactor), uint32(r.blendFactors.DstFactor))
	r.api.DrawArrays(mode.glMode, int32(first), int32(count))
}
DrawArrays draws primitives (such as triangles) using vertices defined in VertexArray.

Before primitive is drawn this method validates if
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)
}
func (r *Renderer) SetVec4(uniformAttributeName string, v1, v2, v3, v4 float32) {
	location := r.locationOrPanic(uniformAttributeName)
	r.api.Uniform4f(location, v1, v2, v3, v4)
}
func (r *Renderer) SetInt(uniformAttributeName string, value int32) {
	location := r.locationOrPanic(uniformAttributeName)
	r.api.Uniform1i(location, value)
}
func (r *Renderer) SetIVec2(uniformAttributeName string, v1, v2 int32) {
	location := r.locationOrPanic(uniformAttributeName)
	r.api.Uniform2i(location, v1, v2)
}
func (r *Renderer) SetIVec3(uniformAttributeName string, v1, v2, v3 int32) {
	location := r.locationOrPanic(uniformAttributeName)
	r.api.Uniform3i(location, v1, v2, v3)
}
func (r *Renderer) SetIVec4(uniformAttributeName string, v1, v2, v3, v4 int32) {
	location := r.locationOrPanic(uniformAttributeName)
	r.api.Uniform4i(location, v1, v2, v3, v4)
}
func (r *Renderer) SetMat3(uniformAttributeName string, value [9]float32) {
	location := r.locationOrPanic(uniformAttributeName)
	r.api.UniformMatrix3fv(location, 1, false, &value[0])
}
func (r *Renderer) SetMat4(uniformAttributeName string, value [16]float32) {
	location := r.locationOrPanic(uniformAttributeName)
	r.api.UniformMatrix4fv(location, 1, false, &value[0])
}
type Mode struct {
	glMode uint32
}
var (
	Points = Mode{glMode: points}
	LineStrip = Mode{glMode: lineStrip}
	LineLoop = Mode{glMode: lineLoop}
	Lines = Mode{glMode: lines}
	TriangleStrip = Mode{glMode: triangleStrip}
	TriangleFan = Mode{glMode: triangleFan}
	Triangles = Mode{glMode: triangles}
)
type BlendFactor uint32
const (
	Zero = BlendFactor(0)
	One = BlendFactor(1)
	OneMinusSrcAlpha = BlendFactor(0x0303)
	SrcAlpha = BlendFactor(0x0302)
	DstAlpha = BlendFactor(0x0304)
	OneMinusDstAlpha = BlendFactor(0x0305)
)
type BlendFactors struct {
	SrcFactor, DstFactor BlendFactor
}
var SourceBlendFactors = BlendFactors{SrcFactor: One, DstFactor: Zero}
func (r *Renderer) SetBlendFactors(factors BlendFactors) {
	r.blendFactors = factors
}