Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gles2 runtime error: cgo argument has Go pointer to Go pointer #23

Closed
darmie opened this issue Jun 5, 2018 · 1 comment
Closed

gles2 runtime error: cgo argument has Go pointer to Go pointer #23

darmie opened this issue Jun 5, 2018 · 1 comment

Comments

@darmie
Copy link

darmie commented Jun 5, 2018

I am trying to port nanovgo to android using android-go

I am trying to pass vertices []float32 data into gl.BufferData but I am getting a runtime error.

gl.BufferData(gl.ARRAY_BUFFER, len(b), unsafe.Pointer(&vertexes), gl.STREAM_DRAW)

06-05 12:22:17.041 32181-0/com.go_android.minimal E/Go: panic: runtime error: cgo argument has Go pointer to Go pointer
06-05 12:22:17.041 32181-0/com.go_android.minimal E/Go: goroutine 7 [running]:
06-05 12:22:17.041 32181-0/com.go_android.minimal E/Go: github.com/xlab/android-go/gles3.BufferData.func1(0x8892, 0x3940, 0xb7ae2258, 0x88e0)
06-05 12:22:17.041 32181-0/com.go_android.minimal E/Go: 	/Users/damilare/go/src/github.com/xlab/android-go/gles3/gles3.go:110 +0x3c
06-05 12:22:17.041 32181-0/com.go_android.minimal E/Go: github.com/xlab/android-go/gles3.BufferData(0x8892, 0x3940, 0xb7ae2258, 0x88e0)
06-05 12:22:17.041 32181-0/com.go_android.minimal E/Go: 	/Users/damilare/go/src/github.com/xlab/android-go/gles3/gles3.go:110 +0x34
06-05 12:22:17.042 32181-0/com.go_android.minimal E/Go: github.com/shibukawa/nanovgo.(*glParams).renderFlush(0xb7a5e258)
06-05 12:22:17.042 32181-0/com.go_android.minimal E/Go: 	/Users/damilare/go/src/github.com/shibukawa/nanovgo/gl_backend.go:584 +0x188
06-05 12:22:17.042 32181-0/com.go_android.minimal E/Go: github.com/shibukawa/nanovgo.(*Context).EndFrame(0xb7abe090)
06-05 12:22:17.042 32181-0/com.go_android.minimal E/Go: 	/Users/damilare/go/src/github.com/shibukawa/nanovgo/nanovgo.go:169 +0x28
06-05 12:22:17.042 32181-0/com.go_android.minimal E/Go: main.draw(0xb7abe090)
06-05 12:22:17.042 32181-0/com.go_android.minimal E/Go: 	/Users/damilare/go/src/github.com/darmie/nanovg-android/main.go:86 +0x180
06-05 12:22:17.042 32181-0/com.go_android.minimal E/Go: main.main.func1(0xd7cf0f00, 0xd7d602a8)
06-05 12:22:17.042 32181-0/com.go_android.minimal E/Go: 	/Users/damilare/go/src/github.com/darmie/nanovg-android/main.go:53 +0x35c
06-05 12:22:17.042 32181-0/com.go_android.minimal E/Go: github.com/xlab/android-go/app.Main(0xb7a7ffc4)
06-05 12:22:17.042 32181-0/com.go_android.minimal E/Go: 	/Users/damilare/go/src/github.com/xlab/android-go/app/app.go:86 +0x38
06-05 12:22:17.042 32181-0/com.go_android.minimal E/Go: main.main()
06-05 12:22:17.042 32181-0/com.go_android.minimal E/Go: 	/Users/damilare/go/src/github.com/darmie/nanovg-android/main.go:37 +0x17c
06-05 12:22:17.042 32181-0/com.go_android.minimal E/Go: github.com/xlab/android-go/app/internal/callfn.CallFn(0xd7c6d39c)
06-05 12:22:17.042 32181-0/com.go_android.minimal E/Go: 	/Users/damilare/go/src/github.com/xlab/android-go/app/internal/callfn/callfn_arm.s:10 +0x18
06-05 12:22:17.042 32181-0/com.go_android.minimal E/Go: created by github.com/xlab/android-go/app.callMain
06-05 12:22:17.042 32181-0/com.go_android.minimal E/Go: 	/Users/damilare/go/src/github.com/xlab/android-go/app/app.go:50 +0x2e4
06-05 12:22:17.043 32181-32208/com.go_android.minimal A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 32208 (android.minimal)
@darmie darmie closed this as completed Jun 8, 2018
@xlab
Copy link
Owner

xlab commented Jun 8, 2018

Yeah should've used unsafe.Pointer(&vertexes[0]) instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants