From cfe1aa1191ec4b137252b02a47c48d3954b16674 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Fri, 24 Apr 2020 16:46:56 +0900 Subject: [PATCH] monogame: Add a variable for a namespace that will be overwritten --- internal/monogame/monogame.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/internal/monogame/monogame.go b/internal/monogame/monogame.go index c80cd7de6..6abdd662b 100644 --- a/internal/monogame/monogame.go +++ b/internal/monogame/monogame.go @@ -29,8 +29,10 @@ import ( // TODO: This implementation depends on some C# files that are not uploaded yet. // Create 'ebitenmonogame' command to generate C# project for the MonoGame. -// TODO: Update this -const temporaryNamespace = "Go2DotNet.Example.Ebiten" +// namespace is C# namespace. +// +// This is overwritten by -ldflags='-X github.com/hajimehoshi/ebiten/internal/monogame.namespace=NAMESPACE'. +var namespace = "Go2DotNet.Example.Ebiten" type UpdateDrawer interface { Update() error @@ -52,7 +54,7 @@ func NewGame(ud UpdateDrawer) *Game { 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{ binding: v, update: update,