diff --git a/graphics/opengl/device.go b/graphics/opengl/device.go index 9a09b6ea8..f9d0dcf66 100644 --- a/graphics/opengl/device.go +++ b/graphics/opengl/device.go @@ -28,6 +28,7 @@ import "C" import ( "github.com/hajimehoshi/go.ebiten/graphics" "github.com/hajimehoshi/go.ebiten/graphics/matrix" + "runtime" ) type Device struct { @@ -96,3 +97,7 @@ func (device *Device) Update() { func (device *Device) TextureFactory() graphics.TextureFactory { return device.context } + +func init() { + runtime.LockOSThread() +}