(glctx gl.Context)
| 99 | } |
| 100 | |
| 101 | func onStart(glctx gl.Context) { |
| 102 | var err error |
| 103 | program, err = glutil.CreateProgram(glctx, vertexShader, fragmentShader) |
| 104 | if err != nil { |
| 105 | log.Printf("error creating GL program: %v", err) |
| 106 | return |
| 107 | } |
| 108 | |
| 109 | buf = glctx.CreateBuffer() |
| 110 | glctx.BindBuffer(gl.ARRAY_BUFFER, buf) |
| 111 | glctx.BufferData(gl.ARRAY_BUFFER, triangleData, gl.STATIC_DRAW) |
| 112 | |
| 113 | position = glctx.GetAttribLocation(program, "position") |
| 114 | color = glctx.GetUniformLocation(program, "color") |
| 115 | offset = glctx.GetUniformLocation(program, "offset") |
| 116 | |
| 117 | images = glutil.NewImages(glctx) |
| 118 | fps = debug.NewFPS(images) |
| 119 | } |
| 120 | |
| 121 | func onStop(glctx gl.Context) { |
| 122 | glctx.DeleteProgram(program) |
no test coverage detected