Created
September 21, 2014 11:58
-
-
Save neguse/142f683c799f2daad8c5 to your computer and use it in GitHub Desktop.
This code causes segmentation fault on my machine( OS X 10.9.5, go1.3.1 darwin/amd64, sdl2-2.0.3 )
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "github.com/veandco/go-sdl2/sdl" | |
func main() { | |
window := sdl.CreateWindow("test", sdl.WINDOWPOS_UNDEFINED, sdl.WINDOWPOS_UNDEFINED, | |
800, 600, sdl.WINDOW_SHOWN) | |
surface := window.GetSurface() | |
rect := sdl.Rect{0, 0, 200, 200} | |
surface.FillRect(&rect, 0xffff0000) | |
go func() { | |
window.UpdateSurface() | |
}() | |
sdl.Delay(1000) | |
window.Destroy() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
runtime.LockOSThread()していないのが原因だった
http://www.oki-osk.jp/esc/golang/cgo-osx.html#3