import ( "golang.org/x/mobile/gl" "golang.org/x/mobile/app" ) func onGLThread(ctx gl.Context) { var buffer uint32 ctx.GenBuffers(1, &buffer) // Bind the buffer to the GL_ARRAY_BUFFER target. ctx.BindBuffer(gl.ARRAY_BUFFER, buffer) }
import ( "golang.org/x/mobile/gl" "golang.org/x/mobile/app" ) func onGLThread(ctx gl.Context) { // Bind the existing buffer object to the GL_ELEMENT_ARRAY_BUFFER target. ctx.BindBuffer(gl.ELEMENT_ARRAY_BUFFER, existingBufferObject) }In this example, an existing buffer object is bound to the GL_ELEMENT_ARRAY_BUFFER target using the BindBuffer function. In both examples, the golang.org.x.mobile.gl package library is used to access the Context BindBuffer function.