monogame: Add a variable for a namespace that will be overwritten

This commit is contained in:
Hajime Hoshi 2020-04-24 16:46:56 +09:00
parent edc58a2c9d
commit cfe1aa1191

View File

@ -29,8 +29,10 @@ import (
// TODO: This implementation depends on some C# files that are not uploaded yet. // TODO: This implementation depends on some C# files that are not uploaded yet.
// Create 'ebitenmonogame' command to generate C# project for the MonoGame. // Create 'ebitenmonogame' command to generate C# project for the MonoGame.
// TODO: Update this // namespace is C# namespace.
const temporaryNamespace = "Go2DotNet.Example.Ebiten" //
// This is overwritten by -ldflags='-X github.com/hajimehoshi/ebiten/internal/monogame.namespace=NAMESPACE'.
var namespace = "Go2DotNet.Example.Ebiten"
type UpdateDrawer interface { type UpdateDrawer interface {
Update() error Update() error
@ -52,7 +54,7 @@ func NewGame(ud UpdateDrawer) *Game {
return ud.Draw() return ud.Draw()
}) })
v := js.Global().Get(".net").Get(temporaryNamespace+".GameGoBinding").New(update, draw) v := js.Global().Get(".net").Get(namespace+".GameGoBinding").New(update, draw)
g := &Game{ g := &Game{
binding: v, binding: v,
update: update, update: update,