mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
ui: Refactoring: Use IsNodeJS
This commit is contained in:
parent
176b80cc83
commit
c2df8326fc
@ -25,6 +25,7 @@ import (
|
|||||||
"github.com/hajimehoshi/ebiten/internal/devicescale"
|
"github.com/hajimehoshi/ebiten/internal/devicescale"
|
||||||
"github.com/hajimehoshi/ebiten/internal/input"
|
"github.com/hajimehoshi/ebiten/internal/input"
|
||||||
"github.com/hajimehoshi/ebiten/internal/opengl"
|
"github.com/hajimehoshi/ebiten/internal/opengl"
|
||||||
|
"github.com/hajimehoshi/ebiten/internal/web"
|
||||||
)
|
)
|
||||||
|
|
||||||
var canvas *js.Object
|
var canvas *js.Object
|
||||||
@ -216,7 +217,7 @@ func init() {
|
|||||||
|
|
||||||
func initialize() error {
|
func initialize() error {
|
||||||
// Do nothing in node.js.
|
// Do nothing in node.js.
|
||||||
if js.Global.Get("require") != js.Undefined {
|
if web.IsNodeJS() {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user