From 536b3a31976940c112cd76e5bfbdff16bf0d180a Mon Sep 17 00:00:00 2001 From: Burcu Dogan Date: Wed, 13 May 2015 21:16:59 -0700 Subject: [PATCH] mobile/app: fix the build for darwin/arm Fixes golang/go#10849 Change-Id: I9531c9640dff8dbf6e6291dc51bf9f72d54d239e Reviewed-on: https://go-review.googlesource.com/10080 Reviewed-by: Minux Ma --- app/darwin_arm.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/app/darwin_arm.go b/app/darwin_arm.go index 16cf896..6e783b0 100644 --- a/app/darwin_arm.go +++ b/app/darwin_arm.go @@ -44,7 +44,7 @@ func init() { initThreadID = uint64(C.threadID()) } -func run(callbacks Callbacks) { +func run(callbacks []Callbacks) { if tid := uint64(C.threadID()); tid != initThreadID { log.Fatalf("app.Run called on thread %d, but app.init ran on %d", tid, initThreadID) } @@ -112,15 +112,14 @@ func setGeom(width, height int) { } configAlt.Width = geom.Pt(float32(width) / geom.PixelsPerPt) configAlt.Height = geom.Pt(float32(height) / geom.PixelsPerPt) - configSwap() - + configSwap(cb) } func initGL() { - stateStart() + stateStart(cb) } -var cb Callbacks +var cb []Callbacks var initGLOnce sync.Once //export drawgl @@ -137,8 +136,10 @@ func drawgl(ctx uintptr) { // TODO not here? gl.ClearColor(0, 0, 0, 1) gl.Clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT) - if cb.Draw != nil { - cb.Draw() + for _, c := range cb { + if c.Draw != nil { + c.Draw() + } } // TODO