Use runtime.LockOSThread at main

This commit is contained in:
Hajime Hoshi 2013-12-04 21:51:39 +09:00
parent dd979ac4d6
commit 24a735dd0b
2 changed files with 2 additions and 6 deletions

View File

@ -24,6 +24,7 @@ type Game interface {
func main() {
runtime.GOMAXPROCS(runtime.NumCPU())
runtime.LockOSThread()
gameName := ""
if 2 <= len(os.Args) {

View File

@ -19,14 +19,9 @@ import (
"github.com/hajimehoshi/go-ebiten/graphics"
"github.com/hajimehoshi/go-ebiten/graphics/opengl"
"github.com/hajimehoshi/go-ebiten/ui"
"runtime"
"unsafe"
)
func init() {
runtime.LockOSThread()
}
type UI struct {
screenWidth int
screenHeight int
@ -87,7 +82,7 @@ func (u *UI) LoadTextures(map[int]string) {
func (u *UI) LoadResources(f func(graphics.TextureFactory)) {
C.BeginDrawing(u.window)
f(u.graphicsDevice.TextureFactory())
f(u.graphicsDevice)
C.EndDrawing(u.window)
}