ui: Bug fix: Init should always return a opengl context

This commit is contained in:
Hajime Hoshi 2016-02-21 04:56:27 +09:00
parent 46c74ec818
commit 591d71b447

View File

@ -116,7 +116,7 @@ func (*userInterface) swapBuffers() {
func Init() *opengl.Context { func Init() *opengl.Context {
// Do nothing in node.js. // Do nothing in node.js.
if js.Global.Get("require") != js.Undefined { if js.Global.Get("require") != js.Undefined {
return nil return opengl.NewContext()
} }
doc := js.Global.Get("document") doc := js.Global.Get("document")