MCPcopy Create free account
hub / github.com/golang/mobile / onStart

Function onStart

example/basic/main.go:101–119  ·  view source on GitHub ↗
(glctx gl.Context)

Source from the content-addressed store, hash-verified

99}
100
101func 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
121func onStop(glctx gl.Context) {
122 glctx.DeleteProgram(program)

Callers 1

mainFunction · 0.70

Calls 9

CreateProgramFunction · 0.92
NewImagesFunction · 0.92
NewFPSFunction · 0.92
PrintfMethod · 0.80
CreateBufferMethod · 0.65
BindBufferMethod · 0.65
BufferDataMethod · 0.65
GetAttribLocationMethod · 0.65
GetUniformLocationMethod · 0.65

Tested by

no test coverage detected