func initGL() {
        var err error
        program, err = glutil.CreateProgram(vertexShader, fragmentShader)
        if err != nil {
                log.Printf("error creating GL program: %v", err)
                return
        }
        buf = gl.GenBuffer()
        gl.BindBuffer(gl.ARRAY_BUFFER, buf)
        gl.BufferData(gl.ARRAY_BUFFER, gl.STATIC_DRAW, triangleData)
        position = gl.GetAttribLocation(program, "position")
        color = gl.GetUniformLocation(program, "color")
        offset = gl.GetUniformLocation(program, "offset")
        touchLoc = geom.Point{geom.Width / 2, geom.Height / 2}
}
TODO(crawshaw): Need an easier way to do GL-dependent initialization.
package main
import (
        "encoding/binary"
        "log"
        "golang.org/x/mobile/app"
        "golang.org/x/mobile/app/debug"
        "golang.org/x/mobile/event"
        "golang.org/x/mobile/f32"
        "golang.org/x/mobile/geom"
        "golang.org/x/mobile/gl"
        "golang.org/x/mobile/gl/glutil"
        "golang.org/x/mobile/cl"
)
var (
        numPlatforms cl.CL_uint
        program  gl.Program
        position gl.Attrib
        offset   gl.Uniform
        color    gl.Uniform
        buf      gl.Buffer
        blue    float32
        touchLoc geom.Point
)
func main() {
        app.Run(app.Callbacks{
                Draw:  draw,
                Touch: touch,
        })
}